commit 2dde18cd1d8fac735875f2e4987f11817cc0bc2c Author: Linus Torvalds Date: Sun Aug 27 14:49:51 2023 -0700 Linux 6.5 commit 85eb043618bb17124050197d71c453d4a1f556e5 Merge: 28f20a19294da 1bd3a76880b2b Author: Linus Torvalds Date: Sun Aug 27 07:33:54 2023 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Three small driver fixes and one larger unused function set removal in the raid class (so no external impact)" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: snic: Fix double free in snic_tgt_create() scsi: core: raid_class: Remove raid_component_add() scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW major version > 5 scsi: ufs: mcq: Fix the search/wrap around logic commit 28f20a19294da7df158dfca259d0e2b5866baaf9 Merge: 3b35375f19fe8 2c66ca3949dc7 Author: Linus Torvalds Date: Sat Aug 26 10:57:29 2023 -0700 Merge tag 'x86-urgent-2023-08-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Ingo Molnar: "Fix an FPU invalidation bug on exec(), and fix a performance regression due to a missing setting of X86_FEATURE_OSXSAVE" * tag 'x86-urgent-2023-08-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu: Set X86_FEATURE_OSXSAVE feature after enabling OSXSAVE in CR4 x86/fpu: Invalidate FPU state correctly on exec() commit 3b35375f19fe87b5d8822ce01f917095d575ee28 Merge: c313761337fb8 9f5deb551655a Author: Linus Torvalds Date: Sat Aug 26 10:34:29 2023 -0700 Merge tag 'irq-urgent-2023-08-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fix from Thomas Gleixner: "A last minute fix for a regression introduced in the v6.5 merge window. The conversion of the software based interrupt resend mechanism to hlist missed to add a check whether the descriptor is already enqueued and dropped the interrupt descriptor lookup for nested interrupts. The missing check whether the descriptor is already queued causes hlist corruption and can be observed in the wild. The dropped parent descriptor lookup has not yet caused problems, but it would result in stale interrupt line in the worst case. Add the missing enqueued check and bring the descriptor lookup back to cure this" * tag 'irq-urgent-2023-08-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: genirq: Fix software resend lockup and nested resend commit c313761337fb8fa7fc44296f0e10844505916208 Merge: 7d2f353b2682d 9730870b484e9 Author: Linus Torvalds Date: Sat Aug 26 10:28:52 2023 -0700 Merge tag 'loongarch-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: "Fix a ptrace bug, a hw_breakpoint bug, some build errors/warnings and some trivial cleanups" * tag 'loongarch-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: Fix hw_breakpoint_control() for watchpoints LoongArch: Ensure FP/SIMD registers in the core dump file is up to date LoongArch: Put the body of play_dead() into arch_cpu_idle_dead() LoongArch: Add identifier names to arguments of die() declaration LoongArch: Return earlier in die() if notify_die() returns NOTIFY_STOP LoongArch: Do not kill the task in die() if notify_die() returns NOTIFY_STOP LoongArch: Remove LoongArch: Replace #include with #include LoongArch: Remove unneeded #include LoongArch: Replace -ffreestanding with finer-grained -fno-builtin's LoongArch: Remove redundant "source drivers/firmware/Kconfig" commit 9f5deb551655a4cff04b21ecffdcdab75112da3a Author: Johan Hovold Date: Sat Aug 26 17:40:04 2023 +0200 genirq: Fix software resend lockup and nested resend The switch to using hlist for managing software resend of interrupts broke resend in at least two ways: First, unconditionally adding interrupt descriptors to the resend list can corrupt the list when the descriptor in question has already been added. This causes the resend tasklet to loop indefinitely with interrupts disabled as was recently reported with the Lenovo ThinkPad X13s after threaded NAPI was disabled in the ath11k WiFi driver. This bug is easily fixed by restoring the old semantics of irq_sw_resend() so that it can be called also for descriptors that have already been marked for resend. Second, the offending commit also broke software resend of nested interrupts by simply discarding the code that made sure that such interrupts are retriggered using the parent interrupt. Add back the corresponding code that adds the parent descriptor to the resend list. Fixes: bc06a9e08742 ("genirq: Use hlist for managing resend handlers") Signed-off-by: Johan Hovold Signed-off-by: Thomas Gleixner Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/lkml/20230809073432.4193-1-johan+linaro@kernel.org/ Link: https://lore.kernel.org/r/20230826154004.1417-1-johan+linaro@kernel.org commit 9730870b484e9de852b51df08a8b357b1129489e Author: Huacai Chen Date: Sat Aug 26 22:21:57 2023 +0800 LoongArch: Fix hw_breakpoint_control() for watchpoints In hw_breakpoint_control(), encode_ctrl_reg() has already encoded the MWPnCFG3_LoadEn/MWPnCFG3_StoreEn bits in info->ctrl. We don't need to add (1 << MWPnCFG3_LoadEn | 1 << MWPnCFG3_StoreEn) unconditionally. Otherwise we can't set read watchpoint and write watchpoint separately. Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen commit 656f9aec07dba7c61d469727494a5d1b18d0bef4 Author: Huacai Chen Date: Sat Aug 26 22:21:57 2023 +0800 LoongArch: Ensure FP/SIMD registers in the core dump file is up to date This is a port of commit 379eb01c21795edb4c ("riscv: Ensure the value of FP registers in the core dump file is up to date"). The values of FP/SIMD registers in the core dump file come from the thread.fpu. However, kernel saves the FP/SIMD registers only before scheduling out the process. If no process switch happens during the exception handling, kernel will not have a chance to save the latest values of FP/SIMD registers. So it may cause their values in the core dump file incorrect. To solve this problem, force fpr_get()/simd_get() to save the FP/SIMD registers into the thread.fpu if the target task equals the current task. Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen commit 7d2f353b2682dcfe5f9bc71e5b61d5b61770d98e Merge: 382d4cd184751 66fbfb35da47f Author: Linus Torvalds Date: Fri Aug 25 17:49:03 2023 -0700 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fixes from Stephen Boyd: "One clk driver fix and two clk framework fixes: - Fix an OOB access when devm_get_clk_from_child() is used and devm_clk_release() casts the void pointer to the wrong type - Move clk_rate_exclusive_{get,put}() within the correct ifdefs in clk.h so that the stubs are used when CONFIG_COMMON_CLK=n - Register the proper clk provider function depending on the value of #clock-cells in the TI keystone driver" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: Fix slab-out-of-bounds error in devm_clk_release() clk: Fix undefined reference to `clk_rate_exclusive_{get,put}' clk: keystone: syscon-clk: Fix audio refclk commit 382d4cd1847517ffcb1800fd462b625db7b2ebea Author: Helge Deller Date: Fri Aug 25 21:50:33 2023 +0200 lib/clz_ctz.c: Fix __clzdi2() and __ctzdi2() for 32-bit kernels The gcc compiler translates on some architectures the 64-bit __builtin_clzll() function to a call to the libgcc function __clzdi2(), which should take a 64-bit parameter on 32- and 64-bit platforms. But in the current kernel code, the built-in __clzdi2() function is defined to operate (wrongly) on 32-bit parameters if BITS_PER_LONG == 32, thus the return values on 32-bit kernels are in the range from [0..31] instead of the expected [0..63] range. This patch fixes the in-kernel functions __clzdi2() and __ctzdi2() to take a 64-bit parameter on 32-bit kernels as well, thus it makes the functions identical for 32- and 64-bit kernels. This bug went unnoticed since kernel 3.11 for over 10 years, and here are some possible reasons for that: a) Some architectures have assembly instructions to count the bits and which are used instead of calling __clzdi2(), e.g. on x86 the bsr instruction and on ppc cntlz is used. On such architectures the wrong __clzdi2() implementation isn't used and as such the bug has no effect and won't be noticed. b) Some architectures link to libgcc.a, and the in-kernel weak functions get replaced by the correct 64-bit variants from libgcc.a. c) __builtin_clzll() and __clzdi2() doesn't seem to be used in many places in the kernel, and most likely only in uncritical functions, e.g. when printing hex values via seq_put_hex_ll(). The wrong return value will still print the correct number, but just in a wrong formatting (e.g. with too many leading zeroes). d) 32-bit kernels aren't used that much any longer, so they are less tested. A trivial testcase to verify if the currently running 32-bit kernel is affected by the bug is to look at the output of /proc/self/maps: Here the kernel uses a correct implementation of __clzdi2(): root@debian:~# cat /proc/self/maps 00010000-00019000 r-xp 00000000 08:05 787324 /usr/bin/cat 00019000-0001a000 rwxp 00009000 08:05 787324 /usr/bin/cat 0001a000-0003b000 rwxp 00000000 00:00 0 [heap] f7551000-f770d000 r-xp 00000000 08:05 794765 /usr/lib/hppa-linux-gnu/libc.so.6 ... and this kernel uses the broken implementation of __clzdi2(): root@debian:~# cat /proc/self/maps 0000000010000-0000000019000 r-xp 00000000 000000008:000000005 787324 /usr/bin/cat 0000000019000-000000001a000 rwxp 000000009000 000000008:000000005 787324 /usr/bin/cat 000000001a000-000000003b000 rwxp 00000000 00:00 0 [heap] 00000000f73d1000-00000000f758d000 r-xp 00000000 000000008:000000005 794765 /usr/lib/hppa-linux-gnu/libc.so.6 ... Signed-off-by: Helge Deller Fixes: 4df87bb7b6a22 ("lib: add weak clz/ctz functions") Cc: Chanho Min Cc: Geert Uytterhoeven Cc: stable@vger.kernel.org # v3.11+ Signed-off-by: Linus Torvalds commit 6f0edbb833ec16ab2042073af4846152b455104d Merge: 4942fed84b98c e5548f85b4527 Author: Linus Torvalds Date: Fri Aug 25 11:44:43 2023 -0700 Merge tag 'mm-hotfixes-stable-2023-08-25-11-07' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc fixes from Andrew Morton: "18 hotfixes. 13 are cc:stable and the remainder pertain to post-6.4 issues or aren't considered suitable for a -stable backport" * tag 'mm-hotfixes-stable-2023-08-25-11-07' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: shmem: fix smaps BUG sleeping while atomic selftests: cachestat: catch failing fsync test on tmpfs selftests: cachestat: test for cachestat availability maple_tree: disable mas_wr_append() when other readers are possible madvise:madvise_free_pte_range(): don't use mapcount() against large folio for sharing check madvise:madvise_free_huge_pmd(): don't use mapcount() against large folio for sharing check madvise:madvise_cold_or_pageout_pte_range(): don't use mapcount() against large folio for sharing check mm: multi-gen LRU: don't spin during memcg release mm: memory-failure: fix unexpected return value in soft_offline_page() radix tree: remove unused variable mm: add a call to flush_cache_vmap() in vmap_pfn() selftests/mm: FOLL_LONGTERM need to be updated to 0x100 nilfs2: fix general protection fault in nilfs_lookup_dirty_data_buffers() mm/gup: handle cont-PTE hugetlb pages correctly in gup_must_unshare() via GUP-fast selftests: cgroup: fix test_kmem_basic less than error mm: enable page walking API to lock vmas during the walk smaps: use vm_normal_page_pmd() instead of follow_trans_huge_pmd() mm/gup: reintroduce FOLL_NUMA as FOLL_HONOR_NUMA_FAULT commit 4942fed84b98cfb71d3cdff1a3df0072a57bbdfa Merge: 98c6b8a558d26 ef21fa7c198e0 Author: Linus Torvalds Date: Fri Aug 25 09:29:47 2023 -0700 Merge tag 'riscv-for-linus-6.5-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: "This is obviously not ideal, particularly for something this late in the cycle. Unfortunately we found some uABI issues in the vector support while reviewing the GDB port, which has triggered a revert -- probably a good sign we should have reviewed GDB before merging this, I guess I just dropped the ball because I was so worried about the context extension and libc suff I forgot. Hence the late revert. There's some risk here as we're still exposing the vector context for signal handlers, but changing that would have meant reverting all of the vector support. The issues we've found so far have been fixed already and they weren't absolute showstoppers, so we're essentially just playing it safe by holding ptrace support for another release (or until we get through a proper userspace code review). Summary: - The vector ucontext extension has been extended with vlenb - The vector registers ELF core dump note type has been changed to avoid aliasing with the CSR type used in embedded systems - Support for accessing vector registers via ptrace() has been reverted - Another build fix for the ISA spec changes around Zifencei/Zicsr that manifests on some systems built with binutils-2.37 and gcc-11.2" * tag 'riscv-for-linus-6.5-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Fix build errors using binutils2.37 toolchains RISC-V: vector: export VLENB csr in __sc_riscv_v_state RISC-V: Remove ptrace support for vectors commit 98c6b8a558d26d3c334986146d9d03ece5f25dec Merge: a87eaffbb26b8 6e39c1ac68816 Author: Linus Torvalds Date: Fri Aug 25 09:18:22 2023 -0700 Merge tag 'gpio-fixes-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix an irq mapping leak in gpio-sim - associate the GPIO device's software node with the irq domain in gpio-sim * tag 'gpio-fixes-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: sim: pass the GPIO device's software node to irq domain gpio: sim: dispose of irq mappings before destroying the irq_sim domain commit a87eaffbb26b810d50769272effbe6747e1e3ea4 Merge: ced5bf2493d42 6bc3462a0f5ec Author: Linus Torvalds Date: Fri Aug 25 09:10:16 2023 -0700 Merge tag 'pinctrl-v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "Here are some Renesas and AMD driver fixes, the AMD fix affects important laptops in the wild so this one is pretty important. It seems a bit tough to get this right. - Fix DT parsing and related locking in the Renesas driver. - Fix wakeup IRQs in the AMD driver once again. Really tricky this one" * tag 'pinctrl-v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: amd: Mask wake bits on probe again pinctrl: renesas: rza2: Add lock around pinctrl_generic{{add,remove}_group,{add,remove}_function} pinctrl: renesas: rzv2m: Fix NULL pointer dereference in rzv2m_dt_subnode_to_map() pinctrl: renesas: rzg2l: Fix NULL pointer dereference in rzg2l_dt_subnode_to_map() commit ced5bf2493d42fe855c224b2ae2ac6545fd91517 Merge: beaa71d6e6410 37e44d60cb875 Author: Linus Torvalds Date: Fri Aug 25 08:48:14 2023 -0700 Merge tag 'sound-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Hopefully the last bits for 6.5. It's slightly higher LOCs than wished, but it doesn't look scary. The biggest change is MAINTAINERS update for TI; it's good to have the update before the final release, so that people can contact to the right persons for bug reports (which shouldn't happen of course!) The rest are all device-specific fixes and quirks, most for various ASoC platforms" * tag 'sound-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ASoC: amd: yc: Fix a non-functional mic on Lenovo 82SJ ALSA: ymfpci: Fix the missing snd_card_free() call at probe error ASoC: cs35l41: Correct amp_gain_tlv values ASoC: amd: yc: Add VivoBook Pro 15 to quirks list for acp6x ASoC: tas2781: fixed register access error when switching to other chips ASoC: cs35l56: Add an ACPI match table ASoC: cs35l56: Read firmware uuid from a device property instead of _SUB ASoC: SOF: ipc4-pcm: fix possible null pointer deference MAINTAINERS: Add entries for TEXAS INSTRUMENTS ASoC DRIVERS commit c337c849ab528241897ddfb6f334912ead0bfd66 Author: Tiezhu Yang Date: Fri Aug 25 23:40:38 2023 +0800 LoongArch: Put the body of play_dead() into arch_cpu_idle_dead() The initial aim is to silence the following objtool warning: arch/loongarch/kernel/process.o: warning: objtool: arch_cpu_idle_dead() falls through to next function start_thread() According to tools/objtool/Documentation/objtool.txt, this is because the last instruction of arch_cpu_idle_dead() is a call to a noreturn function play_dead(). In order to silence the warning, one simple way is to add the noreturn function play_dead() to objtool's hard-coded global_noreturns array, that is to say, just put "NORETURN(play_dead)" into tools/objtool/noreturns.h, it works well. But I noticed that play_dead() is only defined once and only called by arch_cpu_idle_dead(), so put the body of play_dead() into the caller arch_cpu_idle_dead(), then remove the noreturn function play_dead() is an alternative way which can reduce the overhead of the function call at the same time. Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 8879515e1219857df1f142e23840b91a37cbde88 Author: Tiezhu Yang Date: Fri Aug 25 23:40:26 2023 +0800 LoongArch: Add identifier names to arguments of die() declaration Add identifier names to arguments of die() declaration in ptrace.h to fix the following checkpatch warnings: WARNING: function definition argument 'const char *' should also have an identifier name WARNING: function definition argument 'struct pt_regs *' should also have an identifier name Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit a038ae7148469ab6cf4afadb155a15d9554a0b59 Author: Tiezhu Yang Date: Fri Aug 25 23:40:26 2023 +0800 LoongArch: Return earlier in die() if notify_die() returns NOTIFY_STOP After the call to oops_exit(), it should not panic or execute the crash kernel if the oops is to be suppressed. Suggested-by: Maciej W. Rozycki Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 6933c11fb501a40681d43336b3e0eee9df2abee0 Author: Tiezhu Yang Date: Fri Aug 25 23:40:26 2023 +0800 LoongArch: Do not kill the task in die() if notify_die() returns NOTIFY_STOP If notify_die() returns NOTIFY_STOP, honor the return value from the handler chain invocation in die() and return without killing the task as, through a debugger, the fault may have been fixed. It makes sense even if ignoring the event will make the system unstable: by allowing access through a debugger it has been compromised already anyway. It makes our port consistent with x86, arm64, riscv and csky. Commit 20c0d2d44029 ("[PATCH] i386: pass proper trap numbers to die chain handlers") may be the earliest of similar changes. Link: https://lore.kernel.org/r/43DDF02E.76F0.0078.0@novell.com/ Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit a746ceb1f32cc375e983c4bc40378a72ff26c766 Author: Masahiro Yamada Date: Fri Aug 25 23:40:26 2023 +0800 LoongArch: Remove All *.S files under arch/loongarch/ have been converted to include instead of . Remove . Signed-off-by: Masahiro Yamada Signed-off-by: Huacai Chen commit 55b46ff9396caca6ebb73a1d5a00f6f8698391cc Author: Masahiro Yamada Date: Fri Aug 25 23:40:26 2023 +0800 LoongArch: Replace #include with #include Commit ddb5cdbafaaad ("kbuild: generate KSYMTAB entries by modpost") deprecated , which is now a wrapper of . Replace #include with #include . After all the lines are converted, and will be removed. Signed-off-by: Masahiro Yamada Signed-off-by: Huacai Chen commit 347aa8dec220c7692981e1a175391ea7620abfeb Author: Masahiro Yamada Date: Fri Aug 25 23:40:26 2023 +0800 LoongArch: Remove unneeded #include There is no EXPORT_SYMBOL() line there, hence #include is unneeded. Signed-off-by: Masahiro Yamada Signed-off-by: Huacai Chen commit 3f301dc292eb122eff61b8b2906e519154b0327f Author: WANG Xuerui Date: Fri Aug 25 23:40:26 2023 +0800 LoongArch: Replace -ffreestanding with finer-grained -fno-builtin's As explained by Nick in the original issue: the kernel usually does a good job of providing library helpers that have similar semantics as their ordinary userspace libc equivalents, but -ffreestanding disables such libcall optimization and other related features in the compiler, which can lead to unexpected things such as CONFIG_FORTIFY_SOURCE not working (!). However, due to the desire for better control over unaligned accesses with respect to CONFIG_ARCH_STRICT_ALIGN, and also for avoiding the GCC bug https://gcc.gnu.org/PR109465, we do want to still disable optimizations for the memory libcalls (memcpy, memmove and memset for now). Use finer-grained -fno-builtin-* toggles to achieve this without losing source fortification and other libcall optimizations. Closes: https://github.com/ClangBuiltLinux/linux/issues/1897 Reported-by: Nathan Chancellor Suggested-by: Nick Desaulniers Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit b8e2771b7f880a0b899b380ef15476160c693b59 Author: Xi Ruoyao Date: Fri Aug 25 23:40:26 2023 +0800 LoongArch: Remove redundant "source drivers/firmware/Kconfig" In drivers/Kconfig, drivers/firmware/Kconfig is sourced for all ports so there is no need to source it in the port-specific Kconfig file. And sourcing it here also caused the "Firmware Drivers" menu appeared two times: one in the "Device Drivers" menu, another in the toplevel menu. This is really puzzling so remove it. Reviewed-by: Randy Dunlap Signed-off-by: Xi Ruoyao Signed-off-by: Huacai Chen commit beaa71d6e64103403a328bcc8cefa6e9b19544c1 Merge: 4f9e7fabf8643 59fe2029b9e05 Author: Linus Torvalds Date: Fri Aug 25 08:38:40 2023 -0700 Merge tag 'drm-fixes-2023-08-25' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "A bit bigger than I'd care for, but it's mostly a single vmwgfx fix and a fix for an i915 hotplug probing. Otherwise misc i915, bridge, panfrost and dma-buf fixes. core: - add a HPD poll helper i915: - fix regression in i915 polling - fix docs build warning - fix DG2 idle power consumption bridge: - samsung-dsim: init fix panfrost: - fix speed binning issue dma-buf: - fix recursive lock in fence signal vmwgfx: - fix shader stage validation - fix NULL ptr derefs in gem put" * tag 'drm-fixes-2023-08-25' of git://anongit.freedesktop.org/drm/drm: drm/i915: Fix HPD polling, reenabling the output poll work as needed drm: Add an HPD poll helper to reschedule the poll work drm/vmwgfx: Fix possible invalid drm gem put calls drm/vmwgfx: Fix shader stage validation dma-buf/sw_sync: Avoid recursive lock during fence signal drm/i915: fix Sphinx indentation warning drm/i915/dgfx: Enable d3cold at s2idle drm/display/dp: Fix the DP DSC Receiver cap size drm/panfrost: Skip speed binning on EOPNOTSUPP drm: bridge: samsung-dsim: Fix init during host transfer commit 37e44d60cb875862930359e16a1f4764cedb342b Merge: a4a6eed851bb6 c008323fe361b Author: Takashi Iwai Date: Fri Aug 25 09:43:49 2023 +0200 Merge tag 'asoc-fix-v6.5-rc7-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Quirk for v6.5 One additional fix for v6.5, an additional quirk. As with the other fixes this could wait for the merge window. commit 4f9e7fabf8643003afefc172e62dd276686f016e Merge: 14ddccc8a647f e332938e6fc81 Author: Linus Torvalds Date: Thu Aug 24 19:39:20 2023 -0700 Merge tag 'trace-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Fix ring buffer being permanently disabled due to missed record_disabled() Changing the trace cpu mask will disable the ring buffers for the CPUs no longer in the mask. But it fails to update the snapshot buffer. If a snapshot takes place, the accounting for the ring buffer being disabled is corrupted and this can lead to the ring buffer being permanently disabled. - Add test case for snapshot and cpu mask working together - Fix memleak by the function graph tracer not getting closed properly. The iterator is used to read the ring buffer. When it opens, it calls the open function of a tracer, and when it is closed, it calls the close iteration. While a trace is being read, it is still possible to change the tracer. If this happens between the function graph tracer and the wakeup tracer (which uses function graph tracing), the tracers are not closed properly during when the iterator sees the switch, and the wakeup function did not initialize its private pointer to NULL, which is used to know if the function graph tracer was the last tracer. It could be fooled in thinking it is, but then on exit it does not call the close function of the function graph tracer to clean up its data. - Fix synthetic events on big endian machines, by introducing a union that does the conversions properly. - Fix synthetic events from printing out the number of elements in the stacktrace when it shouldn't. - Fix synthetic events stacktrace to not print a bogus value at the end. - Introduce a pipe_cpumask that prevents the trace_pipe files from being opened by more than one task (file descriptor). There was a race found where if splice is called, the iter->ent could become stale and events could be missed. There's no point reading a producer/consumer file by more than one task as they will corrupt each other anyway. Add a cpumask that keeps track of the per_cpu trace_pipe files as well as the global trace_pipe file that prevents more than one open of a trace_pipe file that represents the same ring buffer. This prevents the race from happening. - Fix ftrace samples for arm64 to work with older compilers. * tag 'trace-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: samples: ftrace: Replace bti assembly with hint for older compiler tracing: Introduce pipe_cpumask to avoid race on trace_pipes tracing: Fix memleak due to race between current_tracer and trace tracing/synthetic: Allocate one additional element for size tracing/synthetic: Skip first entry for stack traces tracing/synthetic: Use union instead of casts selftests/ftrace: Add a basic testcase for snapshot tracing: Fix cpu buffers unavailable due to 'record_disabled' missed commit 1bd3a76880b2bce017987cf53780b372cf59528e Author: Zhu Wang Date: Sat Aug 19 08:39:41 2023 +0000 scsi: snic: Fix double free in snic_tgt_create() Commit 41320b18a0e0 ("scsi: snic: Fix possible memory leak if device_add() fails") fixed the memory leak caused by dev_set_name() when device_add() failed. However, it did not consider that 'tgt' has already been released when put_device(&tgt->dev) is called. Remove kfree(tgt) in the error path to avoid double free of 'tgt' and move put_device(&tgt->dev) after the removed kfree(tgt) to avoid a use-after-free. Fixes: 41320b18a0e0 ("scsi: snic: Fix possible memory leak if device_add() fails") Signed-off-by: Zhu Wang Link: https://lore.kernel.org/r/20230819083941.164365-1-wangzhu9@huawei.com Signed-off-by: Martin K. Petersen commit 14ddccc8a647f0e6b268858c4fe2804ae42aabb0 Merge: f8d6ff449094b e7f2e65699e22 Author: Linus Torvalds Date: Thu Aug 24 19:10:53 2023 -0700 Merge tag 'media/v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fix from Mauro Carvalho Chehab: "Fix a potential array out-of-bounds in the mediatek vcodec driver" * tag 'media/v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: vcodec: Fix potential array out-of-bounds in encoder queue_setup commit 60c5fd2e8f3c42a5abc565ba9876ead1da5ad2b7 Author: Zhu Wang Date: Tue Aug 22 01:52:54 2023 +0000 scsi: core: raid_class: Remove raid_component_add() The raid_component_add() function was added to the kernel tree via patch "[SCSI] embryonic RAID class" (2005). Remove this function since it never has had any callers in the Linux kernel. And also raid_component_release() is only used in raid_component_add(), so it is also removed. Signed-off-by: Zhu Wang Link: https://lore.kernel.org/r/20230822015254.184270-1-wangzhu9@huawei.com Reviewed-by: Bart Van Assche Fixes: 04b5b5cb0136 ("scsi: core: Fix possible memory leak if device_add() fails") Signed-off-by: Martin K. Petersen commit 59fe2029b9e05cd490eaf972053dd86f96f77869 Merge: ce22e89eb0f54 1dcc437427bbc Author: Dave Airlie Date: Fri Aug 25 07:35:23 2023 +1000 Merge tag 'drm-intel-fixes-2023-08-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix power consumption at s2idle on DG2 (Anshuman) - Fix documentation build warning (Jani) - Fix Display HPD (Imre) Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/ZOdPRFSJpo0ErPX/@intel.com commit e5548f85b4527c4c803b7eae7887c10bf8f90c97 Author: Hugh Dickins Date: Tue Aug 22 22:14:47 2023 -0700 shmem: fix smaps BUG sleeping while atomic smaps_pte_hole_lookup() is calling shmem_partial_swap_usage() with page table lock held: but shmem_partial_swap_usage() does cond_resched_rcu() if need_resched(): "BUG: sleeping function called from invalid context". Since shmem_partial_swap_usage() is designed to count across a range, but smaps_pte_hole_lookup() only calls it for a single page slot, just break out of the loop on the last or only page, before checking need_resched(). Link: https://lkml.kernel.org/r/6fe3b3ec-abdf-332f-5c23-6a3b3a3b11a9@google.com Fixes: 230100321518 ("mm/smaps: simplify shmem handling of pte holes") Signed-off-by: Hugh Dickins Acked-by: Peter Xu Cc: [5.16+] Signed-off-by: Andrew Morton commit f84f62e69963d7742acec4340ec1c4c7ef22b887 Author: Andre Przywara Date: Mon Aug 21 17:05:34 2023 +0100 selftests: cachestat: catch failing fsync test on tmpfs The cachestat kselftest runs a test on a normal file, which is created temporarily in the current directory. Among the tests it runs there is a call to fsync(), which is expected to clean all dirty pages used by the file. However the tmpfs filesystem implements fsync() as noop_fsync(), so the call will not even attempt to clean anything when this test file happens to live on a tmpfs instance. This happens in an initramfs, or when the current directory is in /dev/shm or sometimes /tmp. To avoid this test failing wrongly, use statfs() to check which filesystem the test file lives on. If that is "tmpfs", we skip the fsync() test. Since the fsync test is only one part of the "normal file" test, we now execute this twice, skipping the fsync part on the first call. This way only the second test, including the fsync part, would be skipped. Link: https://lkml.kernel.org/r/20230821160534.3414911-3-andre.przywara@arm.com Signed-off-by: Andre Przywara Cc: Johannes Weiner Cc: Nhat Pham Cc: Shuah Khan Signed-off-by: Andrew Morton commit 5e56982dd0759d8b345fe1468297dd4f630db5d7 Author: Andre Przywara Date: Mon Aug 21 17:05:33 2023 +0100 selftests: cachestat: test for cachestat availability Patch series "selftests: cachestat: fix run on older kernels", v2. I ran all kernel selftests on some test machine, and stumbled upon cachestat failing (among others). These patches fix the run on older kernels and when the current directory is on a tmpfs instance. This patch (of 2): As cachestat is a new syscall, it won't be available on older kernels, for instance those running on a development machine. At the moment the test reports all tests as "not ok" in this case. Test for the cachestat syscall availability first, before doing further tests, and bail out early with a TAP SKIP comment. This also uses the opportunity to add the proper TAP headers, and add one check for proper error handling (illegal file descriptor). Link: https://lkml.kernel.org/r/20230821160534.3414911-1-andre.przywara@arm.com Link: https://lkml.kernel.org/r/20230821160534.3414911-2-andre.przywara@arm.com Signed-off-by: Andre Przywara Acked-by: Nhat Pham Cc: Johannes Weiner Cc: Shuah Khan Signed-off-by: Andrew Morton commit cfeb6ae8bcb96ccf674724f223661bbcef7b0d0b Author: Liam R. Howlett Date: Fri Aug 18 20:43:55 2023 -0400 maple_tree: disable mas_wr_append() when other readers are possible The current implementation of append may cause duplicate data and/or incorrect ranges to be returned to a reader during an update. Although this has not been reported or seen, disable the append write operation while the tree is in rcu mode out of an abundance of caution. During the analysis of the mas_next_slot() the following was artificially created by separating the writer and reader code: Writer: reader: mas_wr_append set end pivot updates end metata Detects write to last slot last slot write is to start of slot store current contents in slot overwrite old end pivot mas_next_slot(): read end metadata read old end pivot return with incorrect range store new value Alternatively: Writer: reader: mas_wr_append set end pivot updates end metata Detects write to last slot last lost write to end of slot store value mas_next_slot(): read end metadata read old end pivot read new end pivot return with incorrect range set old end pivot There may be other accesses that are not safe since we are now updating both metadata and pointers, so disabling append if there could be rcu readers is the safest action. Link: https://lkml.kernel.org/r/20230819004356.1454718-2-Liam.Howlett@oracle.com Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Liam R. Howlett Cc: Signed-off-by: Andrew Morton commit 0e0e9bd5f7b9d40fd03b70092367247d52da1db0 Author: Yin Fengwei Date: Tue Aug 8 10:09:17 2023 +0800 madvise:madvise_free_pte_range(): don't use mapcount() against large folio for sharing check Commit 98b211d6415f ("madvise: convert madvise_free_pte_range() to use a folio") replaced the page_mapcount() with folio_mapcount() to check whether the folio is shared by other mapping. It's not correct for large folios. folio_mapcount() returns the total mapcount of large folio which is not suitable to detect whether the folio is shared. Use folio_estimated_sharers() which returns a estimated number of shares. That means it's not 100% correct. It should be OK for madvise case here. User-visible effects is that the THP is skipped when user call madvise. But the correct behavior is THP should be split and processed then. NOTE: this change is a temporary fix to reduce the user-visible effects before the long term fix from David is ready. Link: https://lkml.kernel.org/r/20230808020917.2230692-4-fengwei.yin@intel.com Fixes: 98b211d6415f ("madvise: convert madvise_free_pte_range() to use a folio") Signed-off-by: Yin Fengwei Reviewed-by: Yu Zhao Reviewed-by: Ryan Roberts Cc: David Hildenbrand Cc: Kefeng Wang Cc: Matthew Wilcox Cc: Minchan Kim Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Signed-off-by: Andrew Morton commit 20b18aada1856b2ce0512b087a8681342af73e60 Author: Yin Fengwei Date: Tue Aug 8 10:09:16 2023 +0800 madvise:madvise_free_huge_pmd(): don't use mapcount() against large folio for sharing check Commit fc986a38b670 ("mm: huge_memory: convert madvise_free_huge_pmd to use a folio") replaced the page_mapcount() with folio_mapcount() to check whether the folio is shared by other mapping. It's not correct for large folios. folio_mapcount() returns the total mapcount of large folio which is not suitable to detect whether the folio is shared. Use folio_estimated_sharers() which returns a estimated number of shares. That means it's not 100% correct. It should be OK for madvise case here. User-visible effects is that the THP is skipped when user call madvise. But the correct behavior is THP should be split and processed then. NOTE: this change is a temporary fix to reduce the user-visible effects before the long term fix from David is ready. Link: https://lkml.kernel.org/r/20230808020917.2230692-3-fengwei.yin@intel.com Fixes: fc986a38b670 ("mm: huge_memory: convert madvise_free_huge_pmd to use a folio") Signed-off-by: Yin Fengwei Reviewed-by: Yu Zhao Reviewed-by: Ryan Roberts Cc: David Hildenbrand Cc: Kefeng Wang Cc: Matthew Wilcox Cc: Minchan Kim Cc: Vishal Moola (Oracle) Cc: Yang Shi Signed-off-by: Andrew Morton commit 2f406263e3e954aa24c1248edcfa9be0c1bb30fa Author: Yin Fengwei Date: Tue Aug 8 10:09:15 2023 +0800 madvise:madvise_cold_or_pageout_pte_range(): don't use mapcount() against large folio for sharing check Patch series "don't use mapcount() to check large folio sharing", v2. In madvise_cold_or_pageout_pte_range() and madvise_free_pte_range(), folio_mapcount() is used to check whether the folio is shared. But it's not correct as folio_mapcount() returns total mapcount of large folio. Use folio_estimated_sharers() here as the estimated number is enough. This patchset will fix the cases: User space application call madvise() with MADV_FREE, MADV_COLD and MADV_PAGEOUT for specific address range. There are THP mapped to the range. Without the patchset, the THP is skipped. With the patch, the THP will be split and handled accordingly. David reported the cow self test skip some cases because of MADV_PAGEOUT skip THP: https://lore.kernel.org/linux-mm/9e92e42d-488f-47db-ac9d-75b24cd0d037@intel.com/T/#mbf0f2ec7fbe45da47526de1d7036183981691e81 and I confirmed this patchset make it work again. This patch (of 3): Commit 07e8c82b5eff ("madvise: convert madvise_cold_or_pageout_pte_range() to use folios") replaced the page_mapcount() with folio_mapcount() to check whether the folio is shared by other mapping. It's not correct for large folio. folio_mapcount() returns the total mapcount of large folio which is not suitable to detect whether the folio is shared. Use folio_estimated_sharers() which returns a estimated number of shares. That means it's not 100% correct. It should be OK for madvise case here. User-visible effects is that the THP is skipped when user call madvise. But the correct behavior is THP should be split and processed then. NOTE: this change is a temporary fix to reduce the user-visible effects before the long term fix from David is ready. Link: https://lkml.kernel.org/r/20230808020917.2230692-1-fengwei.yin@intel.com Link: https://lkml.kernel.org/r/20230808020917.2230692-2-fengwei.yin@intel.com Fixes: 07e8c82b5eff ("madvise: convert madvise_cold_or_pageout_pte_range() to use folios") Signed-off-by: Yin Fengwei Reviewed-by: Yu Zhao Reviewed-by: Ryan Roberts Cc: David Hildenbrand Cc: Kefeng Wang Cc: Matthew Wilcox Cc: Minchan Kim Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Signed-off-by: Andrew Morton commit f8d6ff449094b4b5eff40d4af08e47c520b78bc5 Merge: 0de5ec446310d 8073a98e95323 Author: Linus Torvalds Date: Thu Aug 24 14:30:47 2023 -0700 Merge tag 'nfsd-6.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: "Two last-minute one-liners for v6.5-rc. One got lost in the shuffle, and the other was reported just this morning" - Close race window when handling FREE_STATEID operations - Fix regression in /proc/fs/nfsd/v4_end_grace introduced in v6.5-rc" * tag 'nfsd-6.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: NFSD: Fix a thinko introduced by recent trace point changes nfsd: Fix race to FREE_STATEID and cl_revoked commit 0de5ec446310ddc2fc8d446c9bcd69313e0ce9d2 Merge: b5cc3833f13ac 627d05a41ca1f Author: Linus Torvalds Date: Thu Aug 24 13:55:35 2023 -0700 Merge tag 'spi-fix-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A couple more small driver specific fixes for v6.5. The device mode for Cadence had been broken by some recent updates done for host mode and large transfers for multi-byte words on stm32 had been broken by an API update in what I think was a rebasing incident" * tag 'spi-fix-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spi-cadence: Fix data corruption issues in slave mode spi: stm32: fix accidential revert to byte-sized transfer splitting commit ef21fa7c198e04f3d3053b1c5b5f2b4b225c3350 Author: Mingzheng Xing Date: Fri Aug 25 03:08:52 2023 +0800 riscv: Fix build errors using binutils2.37 toolchains When building the kernel with binutils 2.37 and GCC-11.1.0/GCC-11.2.0, the following error occurs: Assembler messages: Error: cannot find default versions of the ISA extension `zicsr' Error: cannot find default versions of the ISA extension `zifencei' The above error originated from this commit of binutils[0], which has been resolved and backported by GCC-12.1.0[1] and GCC-11.3.0[2]. So fix this by change the GCC version in CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC to GCC-11.3.0. Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=f0bae2552db1dd4f1995608fbf6648fcee4e9e0c [0] Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ca2bbb88f999f4d3cc40e89bc1aba712505dd598 [1] Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d29f5d6ab513c52fd872f532c492e35ae9fd6671 [2] Fixes: ca09f772ccca ("riscv: Handle zicsr/zifencei issue between gcc and binutils") Reported-by: Conor Dooley Cc: Signed-off-by: Mingzheng Xing Link: https://lore.kernel.org/r/20230824190852.45470-1-xingmingzheng@iscas.ac.cn Closes: https://lore.kernel.org/all/20230823-captive-abdomen-befd942a4a73@wendy/ Reviewed-by: Conor Dooley Tested-by: Conor Dooley Signed-off-by: Palmer Dabbelt commit ce22e89eb0f541b9998f67bd51d311275a3ee51a Merge: 706a741595047 f9e96bf190547 Author: Dave Airlie Date: Fri Aug 25 05:15:54 2023 +1000 Merge tag 'drm-misc-fixes-2023-08-24' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes A samsung-dsim initialization fix, a devfreq fix for panfrost, a DP DSC define fix, a recursive lock fix for dma-buf, a shader validation fix and a reference counting fix for vmwgfx Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/amy26vu5xbeeikswpx7nt6rddwfocdidshrtt2qovipihx5poj@y45p3dtzrloc commit b5cc3833f13ace75e26e3f7b51cd7b6da5e9cf17 Merge: 93f5de5f648d2 8938fc0c7e16e Author: Linus Torvalds Date: Thu Aug 24 08:23:13 2023 -0700 Merge tag 'net-6.5-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from wifi, can and netfilter. Fixes to fixes: - nf_tables: - GC transaction race with abort path - defer gc run if previous batch is still pending Previous releases - regressions: - ipv4: fix data-races around inet->inet_id - phy: fix deadlocking in phy_error() invocation - mdio: fix C45 read/write protocol - ipvlan: fix a reference count leak warning in ipvlan_ns_exit() - ice: fix NULL pointer deref during VF reset - i40e: fix potential NULL pointer dereferencing of pf->vf in i40e_sync_vsi_filters() - tg3: use slab_build_skb() when needed - mtk_eth_soc: fix NULL pointer on hw reset Previous releases - always broken: - core: validate veth and vxcan peer ifindexes - sched: fix a qdisc modification with ambiguous command request - devlink: add missing unregister linecard notification - wifi: mac80211: limit reorder_buf_filtered to avoid UBSAN warning - batman: - do not get eth header before batadv_check_management_packet - fix batadv_v_ogm_aggr_send memory leak - bonding: fix macvlan over alb bond support - mlxsw: set time stamp fields also when its type is MIRROR_UTC" * tag 'net-6.5-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (54 commits) selftests: bonding: add macvlan over bond testing selftest: bond: add new topo bond_topo_2d1c.sh bonding: fix macvlan over alb bond support rtnetlink: Reject negative ifindexes in RTM_NEWLINK netfilter: nf_tables: defer gc run if previous batch is still pending netfilter: nf_tables: fix out of memory error handling netfilter: nf_tables: use correct lock to protect gc_list netfilter: nf_tables: GC transaction race with abort path netfilter: nf_tables: flush pending destroy work before netlink notifier netfilter: nf_tables: validate all pending tables ibmveth: Use dcbf rather than dcbfl i40e: fix potential NULL pointer dereferencing of pf->vf i40e_sync_vsi_filters() net/sched: fix a qdisc modification with ambiguous command request igc: Fix the typo in the PTM Control macro batman-adv: Hold rtnl lock during MTU update via netlink igb: Avoid starting unnecessary workqueues can: raw: add missing refcount for memory leak fix can: isotp: fix support for transmission of SF without flow control bnx2x: new flag for track HW resource allocation sfc: allocate a big enough SKB for loopback selftest packet ... commit 8073a98e95323abdea5491533bf5cb51e0ba18d9 Author: Chuck Lever Date: Thu Aug 24 10:30:27 2023 -0400 NFSD: Fix a thinko introduced by recent trace point changes The fixed commit erroneously removed a call to nfsd_end_grace(), which makes calls to write_v4_end_grace() a no-op. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202308241229.68396422-oliver.sang@intel.com Fixes: 39d432fc7630 ("NFSD: trace nfsctl operations") Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit c008323fe361bd62a43d9fb29737dacd5c067fb7 Author: Mario Limonciello Date: Wed Aug 23 20:11:49 2023 -0500 ASoC: amd: yc: Fix a non-functional mic on Lenovo 82SJ Lenovo 82SJ doesn't have DMIC connected like 82V2 does. Narrow the match down to only cover 82V2. Reported-by: prosenfeld@Yuhsbstudents.org Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217063 Fixes: 2232b2dd8cd4 ("ASoC: amd: yc: Add Lenovo Yoga Slim 7 Pro X to quirks table") Signed-off-by: Mario Limonciello Date: Wed Aug 23 14:57:47 2023 +0800 x86/fpu: Set X86_FEATURE_OSXSAVE feature after enabling OSXSAVE in CR4 0-Day found a 34.6% regression in stress-ng's 'af-alg' test case, and bisected it to commit b81fac906a8f ("x86/fpu: Move FPU initialization into arch_cpu_finalize_init()"), which optimizes the FPU init order, and moves the CR4_OSXSAVE enabling into a later place: arch_cpu_finalize_init identify_boot_cpu identify_cpu generic_identify get_cpu_cap --> setup cpu capability ... fpu__init_cpu fpu__init_cpu_xstate cr4_set_bits(X86_CR4_OSXSAVE); As the FPU is not yet initialized the CPU capability setup fails to set X86_FEATURE_OSXSAVE. Many security module like 'camellia_aesni_avx_x86_64' depend on this feature and therefore fail to load, causing the regression. Cure this by setting X86_FEATURE_OSXSAVE feature right after OSXSAVE enabling. [ tglx: Moved it into the actual BSP FPU initialization code and added a comment ] Fixes: b81fac906a8f ("x86/fpu: Move FPU initialization into arch_cpu_finalize_init()") Reported-by: kernel test robot Signed-off-by: Feng Tang Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/202307192135.203ac24e-oliver.sang@intel.com Link: https://lore.kernel.org/lkml/20230823065747.92257-1-feng.tang@intel.com commit 1f69383b203e28cf8a4ca9570e572da1699f76cd Author: Rick Edgecombe Date: Fri Aug 18 10:03:05 2023 -0700 x86/fpu: Invalidate FPU state correctly on exec() The thread flag TIF_NEED_FPU_LOAD indicates that the FPU saved state is valid and should be reloaded when returning to userspace. However, the kernel will skip doing this if the FPU registers are already valid as determined by fpregs_state_valid(). The logic embedded there considers the state valid if two cases are both true: 1: fpu_fpregs_owner_ctx points to the current tasks FPU state 2: the last CPU the registers were live in was the current CPU. This is usually correct logic. A CPU’s fpu_fpregs_owner_ctx is set to the current FPU during the fpregs_restore_userregs() operation, so it indicates that the registers have been restored on this CPU. But this alone doesn’t preclude that the task hasn’t been rescheduled to a different CPU, where the registers were modified, and then back to the current CPU. To verify that this was not the case the logic relies on the second condition. So the assumption is that if the registers have been restored, AND they haven’t had the chance to be modified (by being loaded on another CPU), then they MUST be valid on the current CPU. Besides the lazy FPU optimizations, the other cases where the FPU registers might not be valid are when the kernel modifies the FPU register state or the FPU saved buffer. In this case the operation modifying the FPU state needs to let the kernel know the correspondence has been broken. The comment in “arch/x86/kernel/fpu/context.h” has: /* ... * If the FPU register state is valid, the kernel can skip restoring the * FPU state from memory. * * Any code that clobbers the FPU registers or updates the in-memory * FPU state for a task MUST let the rest of the kernel know that the * FPU registers are no longer valid for this task. * * Either one of these invalidation functions is enough. Invalidate * a resource you control: CPU if using the CPU for something else * (with preemption disabled), FPU for the current task, or a task that * is prevented from running by the current task. */ However, this is not completely true. When the kernel modifies the registers or saved FPU state, it can only rely on __fpu_invalidate_fpregs_state(), which wipes the FPU’s last_cpu tracking. The exec path instead relies on fpregs_deactivate(), which sets the CPU’s FPU context to NULL. This was observed to fail to restore the reset FPU state to the registers when returning to userspace in the following scenario: 1. A task is executing in userspace on CPU0 - CPU0’s FPU context points to tasks - fpu->last_cpu=CPU0 2. The task exec()’s 3. While in the kernel the task is preempted - CPU0 gets a thread executing in the kernel (such that no other FPU context is activated) - Scheduler sets task’s fpu->last_cpu=CPU0 when scheduling out 4. Task is migrated to CPU1 5. Continuing the exec(), the task gets to fpu_flush_thread()->fpu_reset_fpregs() - Sets CPU1’s fpu context to NULL - Copies the init state to the task’s FPU buffer - Sets TIF_NEED_FPU_LOAD on the task 6. The task reschedules back to CPU0 before completing the exec() and returning to userspace - During the reschedule, scheduler finds TIF_NEED_FPU_LOAD is set - Skips saving the registers and updating task’s fpu→last_cpu, because TIF_NEED_FPU_LOAD is the canonical source. 7. Now CPU0’s FPU context is still pointing to the task’s, and fpu->last_cpu is still CPU0. So fpregs_state_valid() returns true even though the reset FPU state has not been restored. So the root cause is that exec() is doing the wrong kind of invalidate. It should reset fpu->last_cpu via __fpu_invalidate_fpregs_state(). Further, fpu__drop() doesn't really seem appropriate as the task (and FPU) are not going away, they are just getting reset as part of an exec. So switch to __fpu_invalidate_fpregs_state(). Also, delete the misleading comment that says that either kind of invalidate will be enough, because it’s not always the case. Fixes: 33344368cb08 ("x86/fpu: Clean up the fpu__clear() variants") Reported-by: Lei Wang Signed-off-by: Rick Edgecombe Signed-off-by: Thomas Gleixner Tested-by: Lijun Pan Reviewed-by: Sohil Mehta Acked-by: Lijun Pan Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230818170305.502891-1-rick.p.edgecombe@intel.com commit 8938fc0c7e16e0868a1083deadc91b95b72ca0da Merge: b251610c676c9 8e51830e29e12 Author: Paolo Abeni Date: Thu Aug 24 10:33:22 2023 +0200 Merge tag 'nf-23-08-23' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Florian Westphal says: ==================== netfilter updates for net This PR contains nf_tables updates for your *net* tree. First patch fixes table validation, I broke this in 6.4 when tracking validation state per table, reported by Pablo, fixup from myself. Second patch makes sure objects waiting for memory release have been released, this was broken in 6.1, patch from Pablo Neira Ayuso. Patch three is a fix-for-fix from previous PR: In case a transaction gets aborted, gc sequence counter needs to be incremented so pending gc requests are invalidated, from Pablo. Same for patch 4: gc list needs to use gc list lock, not destroy lock, also from Pablo. Patch 5 fixes a UaF in a set backend, but this should only occur when failslab is enabled for GFP_KERNEL allocations, broken since feature was added in 5.6, from myself. Patch 6 fixes a double-free bug that was also added via previous PR: We must not schedule gc work if the previous batch is still queued. netfilter pull request 2023-08-23 * tag 'nf-23-08-23' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nf_tables: defer gc run if previous batch is still pending netfilter: nf_tables: fix out of memory error handling netfilter: nf_tables: use correct lock to protect gc_list netfilter: nf_tables: GC transaction race with abort path netfilter: nf_tables: flush pending destroy work before netlink notifier netfilter: nf_tables: validate all pending tables ==================== Link: https://lore.kernel.org/r/20230823152711.15279-1-fw@strlen.de Signed-off-by: Paolo Abeni commit b251610c676c93f99aff86bcaf1e8ef86650579e Merge: 30188bd7838c1 246af950b9404 Author: Paolo Abeni Date: Thu Aug 24 10:07:16 2023 +0200 Merge branch 'fix-macvlan-over-alb-bond-support' Hangbin Liu says: ==================== fix macvlan over alb bond support Currently, the macvlan over alb bond is broken after commit 14af9963ba1e ("bonding: Support macvlans on top of tlb/rlb mode bonds"). Fix this and add relate tests. ==================== Link: https://lore.kernel.org/r/20230823071907.3027782-1-liuhangbin@gmail.com Signed-off-by: Paolo Abeni commit 246af950b9404da3cb1fed0dc85c7a637be0aff6 Author: Hangbin Liu Date: Wed Aug 23 15:19:06 2023 +0800 selftests: bonding: add macvlan over bond testing Add a macvlan over bonding test with mode active-backup, balance-tlb and balance-alb. ]# ./bond_macvlan.sh TEST: active-backup: IPv4: client->server [ OK ] TEST: active-backup: IPv6: client->server [ OK ] TEST: active-backup: IPv4: client->macvlan_1 [ OK ] TEST: active-backup: IPv6: client->macvlan_1 [ OK ] TEST: active-backup: IPv4: client->macvlan_2 [ OK ] TEST: active-backup: IPv6: client->macvlan_2 [ OK ] TEST: active-backup: IPv4: macvlan_1->macvlan_2 [ OK ] TEST: active-backup: IPv6: macvlan_1->macvlan_2 [ OK ] TEST: active-backup: IPv4: server->client [ OK ] TEST: active-backup: IPv6: server->client [ OK ] TEST: active-backup: IPv4: macvlan_1->client [ OK ] TEST: active-backup: IPv6: macvlan_1->client [ OK ] TEST: active-backup: IPv4: macvlan_2->client [ OK ] TEST: active-backup: IPv6: macvlan_2->client [ OK ] TEST: active-backup: IPv4: macvlan_2->macvlan_2 [ OK ] TEST: active-backup: IPv6: macvlan_2->macvlan_2 [ OK ] [...] TEST: balance-alb: IPv4: client->server [ OK ] TEST: balance-alb: IPv6: client->server [ OK ] TEST: balance-alb: IPv4: client->macvlan_1 [ OK ] TEST: balance-alb: IPv6: client->macvlan_1 [ OK ] TEST: balance-alb: IPv4: client->macvlan_2 [ OK ] TEST: balance-alb: IPv6: client->macvlan_2 [ OK ] TEST: balance-alb: IPv4: macvlan_1->macvlan_2 [ OK ] TEST: balance-alb: IPv6: macvlan_1->macvlan_2 [ OK ] TEST: balance-alb: IPv4: server->client [ OK ] TEST: balance-alb: IPv6: server->client [ OK ] TEST: balance-alb: IPv4: macvlan_1->client [ OK ] TEST: balance-alb: IPv6: macvlan_1->client [ OK ] TEST: balance-alb: IPv4: macvlan_2->client [ OK ] TEST: balance-alb: IPv6: macvlan_2->client [ OK ] TEST: balance-alb: IPv4: macvlan_2->macvlan_2 [ OK ] TEST: balance-alb: IPv6: macvlan_2->macvlan_2 [ OK ] Signed-off-by: Hangbin Liu Acked-by: Jay Vosburgh Signed-off-by: Paolo Abeni commit 27aa43f83c83e9243c6959426f6e36cb32aeb2d5 Author: Hangbin Liu Date: Wed Aug 23 15:19:05 2023 +0800 selftest: bond: add new topo bond_topo_2d1c.sh Add a new testing topo bond_topo_2d1c.sh which is used more commonly. Make bond_topo_3d1c.sh just source bond_topo_2d1c.sh and add the extra link. Signed-off-by: Hangbin Liu Acked-by: Jay Vosburgh Signed-off-by: Paolo Abeni commit e74216b8def3803e98ae536de78733e9d7f3b109 Author: Hangbin Liu Date: Wed Aug 23 15:19:04 2023 +0800 bonding: fix macvlan over alb bond support The commit 14af9963ba1e ("bonding: Support macvlans on top of tlb/rlb mode bonds") aims to enable the use of macvlans on top of rlb bond mode. However, the current rlb bond mode only handles ARP packets to update remote neighbor entries. This causes an issue when a macvlan is on top of the bond, and remote devices send packets to the macvlan using the bond's MAC address as the destination. After delivering the packets to the macvlan, the macvlan will rejects them as the MAC address is incorrect. Consequently, this commit makes macvlan over bond non-functional. To address this problem, one potential solution is to check for the presence of a macvlan port on the bond device using netif_is_macvlan_port(bond->dev) and return NULL in the rlb_arp_xmit() function. However, this approach doesn't fully resolve the situation when a VLAN exists between the bond and macvlan. So let's just do a partial revert for commit 14af9963ba1e in rlb_arp_xmit(). As the comment said, Don't modify or load balance ARPs that do not originate locally. Fixes: 14af9963ba1e ("bonding: Support macvlans on top of tlb/rlb mode bonds") Reported-by: susan.zheng@veritas.com Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2117816 Signed-off-by: Hangbin Liu Acked-by: Jay Vosburgh Signed-off-by: Paolo Abeni commit 30188bd7838c16a98a520db1fe9df01ffc6ed368 Author: Ido Schimmel Date: Wed Aug 23 09:43:48 2023 +0300 rtnetlink: Reject negative ifindexes in RTM_NEWLINK Negative ifindexes are illegal, but the kernel does not validate the ifindex in the ancillary header of RTM_NEWLINK messages, resulting in the kernel generating a warning [1] when such an ifindex is specified. Fix by rejecting negative ifindexes. [1] WARNING: CPU: 0 PID: 5031 at net/core/dev.c:9593 dev_index_reserve+0x1a2/0x1c0 net/core/dev.c:9593 [...] Call Trace: register_netdevice+0x69a/0x1490 net/core/dev.c:10081 br_dev_newlink+0x27/0x110 net/bridge/br_netlink.c:1552 rtnl_newlink_create net/core/rtnetlink.c:3471 [inline] __rtnl_newlink+0x115e/0x18c0 net/core/rtnetlink.c:3688 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3701 rtnetlink_rcv_msg+0x439/0xd30 net/core/rtnetlink.c:6427 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x536/0x810 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:728 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:751 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2538 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2592 __sys_sendmsg+0x117/0x1e0 net/socket.c:2621 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 38f7b870d4a6 ("[RTNETLINK]: Link creation API") Reported-by: syzbot+5ba06978f34abb058571@syzkaller.appspotmail.com Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Reviewed-by: Jakub Kicinski Link: https://lore.kernel.org/r/20230823064348.2252280-1-idosch@nvidia.com Signed-off-by: Paolo Abeni commit a4a6eed851bb661477654d772807d0e5aee5629c Merge: 1d0eb6143c1e8 1613781d7e8a9 Author: Takashi Iwai Date: Thu Aug 24 09:20:36 2023 +0200 Merge tag 'asoc-fix-v6.5-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.5 A relatively large but generally not super urgent set of fixes for ASoC, including some quirks and a MAINTAINERS update. There's also an update to cs35l56 to change the firmware ABI, there are no current shipping systems which use the current interface and the sooner we get the new interface in the less likely it is that something will start. It'd be nice if these landed for v6.5 but not the end of the world if they wait till v6.6. commit 93f5de5f648d2b1ce3540a4ac71756d4a852dc23 Merge: a5e505a99ca74 453b014e2c294 Author: Linus Torvalds Date: Wed Aug 23 14:28:19 2023 -0700 Merge tag 'acpi-6.5-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Make an existing ACPI IRQ override quirk for PCSpecialist Elimina Pro 16 M work as intended (Hans de Goede)" * tag 'acpi-6.5-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: resource: Fix IRQ override quirk for PCSpecialist Elimina Pro 16 M commit 1dcc437427bbcebc8381226352f7ade08a271191 Author: Imre Deak Date: Tue Aug 22 14:30:15 2023 +0300 drm/i915: Fix HPD polling, reenabling the output poll work as needed After the commit in the Fixes: line below, HPD polling stopped working on i915, since after that change calling drm_kms_helper_poll_enable() doesn't restart drm_mode_config::output_poll_work if the work was stopped (no connectors needing polling) and enabling polling for a connector (during runtime suspend or detecting an HPD IRQ storm). After the above change calling drm_kms_helper_poll_enable() is a nop after it's been called already and polling for some connectors was disabled/re-enabled. Fix this by calling drm_kms_helper_poll_reschedule() added in the previous patch instead, which reschedules the work whenever expected. Fixes: d33a54e3991d ("drm/probe_helper: sort out poll_running vs poll_enabled") CC: stable@vger.kernel.org # 6.4+ Cc: Dmitry Baryshkov Cc: dri-devel@lists.freedesktop.org Reviewed-by: Jouni Högander Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230822113015.41224-2-imre.deak@intel.com (cherry picked from commit 50452f2f76852322620b63e62922b85e955abe94) Signed-off-by: Rodrigo Vivi commit a94e7ccfc400c024976f3c2f31689ed843498b7c Author: Imre Deak Date: Tue Aug 22 14:30:14 2023 +0300 drm: Add an HPD poll helper to reschedule the poll work Add a helper to reschedule drm_mode_config::output_poll_work after polling has been enabled for a connector (and needing a reschedule, since previously polling was disabled for all connectors and hence output_poll_work was not running). This is needed by the next patch fixing HPD polling on i915. CC: stable@vger.kernel.org # 6.4+ Cc: Dmitry Baryshkov Cc: dri-devel@lists.freedesktop.org Reviewed-by: Jouni Högander Reviewed-by: Dmitry Baryshkov Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230822113015.41224-1-imre.deak@intel.com (cherry picked from commit fe2352fd64029918174de4b460dfe6df0c6911cd) Signed-off-by: Rodrigo Vivi commit e2de1646f79632ca19980ed6a13a7779ae086088 Merge: ca09f772cccae c35f3aa345090 Author: Palmer Dabbelt Date: Tue Aug 22 13:55:14 2023 -0700 Merge patch series "riscv: fix ptrace and export VLENB" Andy Chiu says: We add a vlenb field in Vector context and save it with the riscv_vstate_save() macro. It should not cause performance regression as VLENB is a design-time constant and is frequently used by hardware. Also, adding this field into the __sc_riscv_v_state may benifit us on a future compatibility issue becuse a hardware may have writable VLENB. Adding and saving VLENB have an immediate benifit as it gives ptrace a better view of the Vector extension and makes it possible to reconstruct Vector register files from the dump without doing an additional csr read. This patchset also sync the number of note types between us and gdb for riscv to solve a conflicting note. This is not an ABI break given that 6.5 has not been released yet. * b4-shazam-merge: RISC-V: vector: export VLENB csr in __sc_riscv_v_state RISC-V: Remove ptrace support for vectors Link: https://lore.kernel.org/r/20230816155450.26200-1-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 6e39c1ac688161b4db3617aabbca589b395242bc Author: Bartosz Golaszewski Date: Tue Aug 22 21:29:43 2023 +0200 gpio: sim: pass the GPIO device's software node to irq domain Associate the swnode of the GPIO device's (which is the interrupt controller here) with the irq domain. Otherwise the interrupt-controller device attribute is a no-op. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko commit ab4109f91b328ff5cb5e1279f64d443241add2d1 Author: Bartosz Golaszewski Date: Tue Aug 22 21:29:42 2023 +0200 gpio: sim: dispose of irq mappings before destroying the irq_sim domain If a GPIO simulator device is unbound with interrupts still requested, we will hit a use-after-free issue in __irq_domain_deactivate_irq(). The owner of the irq domain must dispose of all mappings before destroying the domain object. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko commit f9e96bf1905479f18e83a3a4c314a8dfa56ede2c Author: Zack Rusin Date: Fri Aug 18 00:13:01 2023 -0400 drm/vmwgfx: Fix possible invalid drm gem put calls vmw_bo_unreference sets the input buffer to null on exit, resulting in null ptr deref's on the subsequent drm gem put calls. This went unnoticed because only very old userspace would be exercising those paths but it wouldn't be hard to hit on old distros with brand new kernels. Introduce a new function that abstracts unrefing of user bo's to make the code cleaner and more explicit. Signed-off-by: Zack Rusin Reported-by: Ian Forbes Fixes: 9ef8d83e8e25 ("drm/vmwgfx: Do not drop the reference to the handle too soon") Cc: # v6.4+ Reviewed-by: Maaz Mombasawala Link: https://patchwork.freedesktop.org/patch/msgid/20230818041301.407636-1-zack@kde.org commit 14abdfae508228a7307f7491b5c4215ae70c6542 Author: Zack Rusin Date: Fri Jun 16 15:09:34 2023 -0400 drm/vmwgfx: Fix shader stage validation For multiple commands the driver was not correctly validating the shader stages resulting in possible kernel oopses. The validation code was only. if ever, checking the upper bound on the shader stages but never a lower bound (valid shader stages start at 1 not 0). Fixes kernel oopses ending up in vmw_binding_add, e.g.: Oops: 0000 [#1] PREEMPT SMP PTI CPU: 1 PID: 2443 Comm: testcase Not tainted 6.3.0-rc4-vmwgfx #1 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020 RIP: 0010:vmw_binding_add+0x4c/0x140 [vmwgfx] Code: 7e 30 49 83 ff 0e 0f 87 ea 00 00 00 4b 8d 04 7f 89 d2 89 cb 48 c1 e0 03 4c 8b b0 40 3d 93 c0 48 8b 80 48 3d 93 c0 49 0f af de <48> 03 1c d0 4c 01 e3 49 8> RSP: 0018:ffffb8014416b968 EFLAGS: 00010206 RAX: ffffffffc0933ec0 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 00000000ffffffff RSI: ffffb8014416b9c0 RDI: ffffb8014316f000 RBP: ffffb8014416b998 R08: 0000000000000003 R09: 746f6c735f726564 R10: ffffffffaaf2bda0 R11: 732e676e69646e69 R12: ffffb8014316f000 R13: ffffb8014416b9c0 R14: 0000000000000040 R15: 0000000000000006 FS: 00007fba8c0af740(0000) GS:ffff8a1277c80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000007c0933eb8 CR3: 0000000118244001 CR4: 00000000003706e0 Call Trace: vmw_view_bindings_add+0xf5/0x1b0 [vmwgfx] ? ___drm_dbg+0x8a/0xb0 [drm] vmw_cmd_dx_set_shader_res+0x8f/0xc0 [vmwgfx] vmw_execbuf_process+0x590/0x1360 [vmwgfx] vmw_execbuf_ioctl+0x173/0x370 [vmwgfx] ? __drm_dev_dbg+0xb4/0xe0 [drm] ? __pfx_vmw_execbuf_ioctl+0x10/0x10 [vmwgfx] drm_ioctl_kernel+0xbc/0x160 [drm] drm_ioctl+0x2d2/0x580 [drm] ? __pfx_vmw_execbuf_ioctl+0x10/0x10 [vmwgfx] ? do_fault+0x1a6/0x420 vmw_generic_ioctl+0xbd/0x180 [vmwgfx] vmw_unlocked_ioctl+0x19/0x20 [vmwgfx] __x64_sys_ioctl+0x96/0xd0 do_syscall_64+0x5d/0x90 ? handle_mm_fault+0xe4/0x2f0 ? debug_smp_processor_id+0x1b/0x30 ? fpregs_assert_state_consistent+0x2e/0x50 ? exit_to_user_mode_prepare+0x40/0x180 ? irqentry_exit_to_user_mode+0xd/0x20 ? irqentry_exit+0x3f/0x50 ? exc_page_fault+0x8b/0x180 entry_SYSCALL_64_after_hwframe+0x72/0xdc Signed-off-by: Zack Rusin Cc: security@openanolis.org Reported-by: Ziming Zhang Testcase-found-by: Niels De Graef Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support") Cc: # v4.3+ Reviewed-by: Maaz Mombasawala Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20230616190934.54828-1-zack@kde.org commit 1d0eb6143c1e85d3f9a3f5a616ee7e5dc351d33b Author: Takashi Iwai Date: Wed Aug 23 18:16:25 2023 +0200 ALSA: ymfpci: Fix the missing snd_card_free() call at probe error Like a few other drivers, YMFPCI driver needs to clean up with snd_card_free() call at an error path of the probe; otherwise the other devres resources are released before the card and it results in the UAF. This patch uses the helper for handling the probe error gracefully. Fixes: f33fc1576757 ("ALSA: ymfpci: Create card with device-managed snd_devm_card_new()") Cc: Reported-and-tested-by: Takashi Yano Closes: https://lore.kernel.org/r/20230823135846.1812-1-takashi.yano@nifty.ne.jp Link: https://lore.kernel.org/r/20230823161625.5807-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit a5e505a99ca748583dbe558b691be1b26f05d678 Merge: 89bf6209cad66 0848cab765c63 Author: Linus Torvalds Date: Wed Aug 23 08:32:52 2023 -0700 Merge tag 'platform-drivers-x86-v6.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "Final set of three small fixes for 6.5" * tag 'platform-drivers-x86-v6.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/mellanox: Fix mlxbf-tmfifo not handling all virtio CONSOLE notifications platform/x86: ideapad-laptop: Add support for new hotkeys found on ThinkBook 14s Yoga ITL platform/x86: lenovo-ymc: Add Lenovo Yoga 7 14ACN6 to ec_trigger_quirk_dmi_table commit 0848cab765c634597636810bf76d0934003cce28 Author: Shih-Yi Chen Date: Mon Aug 21 11:06:27 2023 -0400 platform/mellanox: Fix mlxbf-tmfifo not handling all virtio CONSOLE notifications rshim console does not show all entries of dmesg. Fixed by setting MLXBF_TM_TX_LWM_IRQ for every CONSOLE notification. Signed-off-by: Shih-Yi Chen Reviewed-by: Liming Sung Reviewed-by: David Thompson Link: https://lore.kernel.org/r/20230821150627.26075-1-shihyic@nvidia.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 8e51830e29e12670b4c10df070a4ea4c9593e961 Author: Florian Westphal Date: Tue Aug 22 22:03:57 2023 +0200 netfilter: nf_tables: defer gc run if previous batch is still pending Don't queue more gc work, else we may queue the same elements multiple times. If an element is flagged as dead, this can mean that either the previous gc request was invalidated/discarded by a transaction or that the previous request is still pending in the system work queue. The latter will happen if the gc interval is set to a very low value, e.g. 1ms, and system work queue is backlogged. The sets refcount is 1 if no previous gc requeusts are queued, so add a helper for this and skip gc run if old requests are pending. Add a helper for this and skip the gc run in this case. Fixes: f6c383b8c31a ("netfilter: nf_tables: adapt set backend to use GC transaction API") Signed-off-by: Florian Westphal Reviewed-by: Pablo Neira Ayuso commit 5e1be4cdc98c989d5387ce94ff15b5ad06a5b681 Author: Florian Westphal Date: Tue Aug 22 19:49:52 2023 +0200 netfilter: nf_tables: fix out of memory error handling Several instances of pipapo_resize() don't propagate allocation failures, this causes a crash when fault injection is enabled for gfp_kernel slabs. Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges") Signed-off-by: Florian Westphal Reviewed-by: Stefano Brivio commit 8357bc946a2abc2a10ca40e5a2105d2b4c57515e Author: Pablo Neira Ayuso Date: Mon Aug 21 14:33:32 2023 +0200 netfilter: nf_tables: use correct lock to protect gc_list Use nf_tables_gc_list_lock spinlock, not nf_tables_destroy_list_lock to protect the gc list. Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 720344340fb9be2765bbaab7b292ece0a4570eae Author: Pablo Neira Ayuso Date: Fri Aug 18 01:13:52 2023 +0200 netfilter: nf_tables: GC transaction race with abort path Abort path is missing a synchronization point with GC transactions. Add GC sequence number hence any GC transaction losing race will be discarded. Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 2c9f0293280e258606e54ed2b96fa71498432eae Author: Pablo Neira Ayuso Date: Fri Aug 18 01:13:31 2023 +0200 netfilter: nf_tables: flush pending destroy work before netlink notifier Destroy work waits for the RCU grace period then it releases the objects with no mutex held. All releases objects follow this path for transactions, therefore, order is guaranteed and references to top-level objects in the hierarchy remain valid. However, netlink notifier might interfer with pending destroy work. rcu_barrier() is not correct because objects are not release via RCU callback. Flush destroy work before releasing objects from netlink notifier path. Fixes: d4bc8271db21 ("netfilter: nf_tables: netlink notifier might race to release objects") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 4b80ced971b0d118f9a11dd503a5833a5016de92 Author: Florian Westphal Date: Thu Aug 17 20:28:32 2023 +0200 netfilter: nf_tables: validate all pending tables We have to validate all tables in the transaction that are in VALIDATE_DO state, the blamed commit below did not move the break statement to its right location so we only validate one table. Moreover, we can't init table->validate to _SKIP when a table object is allocated. If we do, then if a transcaction creates a new table and then fails the transaction, nfnetlink will loop and nft will hang until user cancels the command. Add back the pernet state as a place to stash the last state encountered. This is either _DO (we hit an error during commit validation) or _SKIP (transaction passed all checks). Fixes: 00c320f9b755 ("netfilter: nf_tables: make validation state per table") Reported-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 1613781d7e8a93618ff3a6b37f81f06769b53717 Author: Charles Keepax Date: Wed Aug 23 09:53:08 2023 +0100 ASoC: cs35l41: Correct amp_gain_tlv values The current analog gain TLV seems to have completely incorrect values in it. The gain starts at 0.5dB, proceeds in 1dB steps, and has no mute value, correct the control to match. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20230823085308.753572-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit bfedba3b2c7793ce127680bc8f70711e05ec7a17 Author: Michael Ellerman Date: Wed Aug 23 14:51:39 2023 +1000 ibmveth: Use dcbf rather than dcbfl When building for power4, newer binutils don't recognise the "dcbfl" extended mnemonic. dcbfl RA, RB is equivalent to dcbf RA, RB, 1. Switch to "dcbf" to avoid the build error. Signed-off-by: Michael Ellerman Signed-off-by: David S. Miller commit 9525a3c38accd2e186f52443e35e633e296cc7f5 Author: Andrii Staikov Date: Tue Aug 22 15:16:53 2023 -0700 i40e: fix potential NULL pointer dereferencing of pf->vf i40e_sync_vsi_filters() Add check for pf->vf not being NULL before dereferencing pf->vf[vsi->vf_id] in updating VSI filter sync. Add a similar check before dereferencing !pf->vf[vsi->vf_id].trusted in the condition for clearing promisc mode bit. Fixes: c87c938f62d8 ("i40e: Add VF VLAN pruning") Signed-off-by: Andrii Staikov Signed-off-by: Aleksandr Loktionov Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller commit da71714e359b64bd7aab3bd56ec53f307f058133 Author: Jamal Hadi Salim Date: Tue Aug 22 06:12:31 2023 -0400 net/sched: fix a qdisc modification with ambiguous command request When replacing an existing root qdisc, with one that is of the same kind, the request boils down to essentially a parameterization change i.e not one that requires allocation and grafting of a new qdisc. syzbot was able to create a scenario which resulted in a taprio qdisc replacing an existing taprio qdisc with a combination of NLM_F_CREATE, NLM_F_REPLACE and NLM_F_EXCL leading to create and graft scenario. The fix ensures that only when the qdisc kinds are different that we should allow a create and graft, otherwise it goes into the "change" codepath. While at it, fix the code and comments to improve readability. While syzbot was able to create the issue, it did not zone on the root cause. Analysis from Vladimir Oltean helped narrow it down. v1->V2 changes: - remove "inline" function definition (Vladmir) - remove extrenous braces in branches (Vladmir) - change inline function names (Pedro) - Run tdc tests (Victor) v2->v3 changes: - dont break else/if (Simon) Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzbot+a3618a167af2021433cd@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/20230816225759.g25x76kmgzya2gei@skbuf/T/ Tested-by: Vladimir Oltean Tested-by: Victor Nogueira Reviewed-by: Pedro Tammela Reviewed-by: Victor Nogueira Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit e531fdb5cd5ee2564b7fe10c8a9219e2b2fac61e Author: Rob Clark Date: Fri Aug 18 07:59:38 2023 -0700 dma-buf/sw_sync: Avoid recursive lock during fence signal If a signal callback releases the sw_sync fence, that will trigger a deadlock as the timeline_fence_release recurses onto the fence->lock (used both for signaling and the the timeline tree). To avoid that, temporarily hold an extra reference to the signalled fences until after we drop the lock. (This is an alternative implementation of https://patchwork.kernel.org/patch/11664717/ which avoids some potential UAF issues with the original patch.) v2: Remove now obsolete comment, use list_move_tail() and list_del_init() Reported-by: Bas Nieuwenhuizen Fixes: d3c6dd1fb30d ("dma-buf/sw_sync: Synchronize signal vs syncpt free") Signed-off-by: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/20230818145939.39697-1-robdclark@gmail.com Reviewed-by: Christian König Signed-off-by: Christian König commit e7f2e65699e2290fd547ec12a17008764e5d9620 Author: Wei Chen Date: Thu Aug 10 08:23:33 2023 +0000 media: vcodec: Fix potential array out-of-bounds in encoder queue_setup variable *nplanes is provided by user via system call argument. The possible value of q_data->fmt->num_planes is 1-3, while the value of *nplanes can be 1-8. The array access by index i can cause array out-of-bounds. Fix this bug by checking *nplanes against the array size. Fixes: 4e855a6efa54 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver") Signed-off-by: Wei Chen Cc: stable@vger.kernel.org Reviewed-by: Chen-Yu Tsai Signed-off-by: Hans Verkuil commit de43975721b97283d5f17eea4228faddf08f2681 Author: Sasha Neftin Date: Mon Aug 21 10:17:21 2023 -0700 igc: Fix the typo in the PTM Control macro The IGC_PTM_CTRL_SHRT_CYC defines the time between two consecutive PTM requests. The bit resolution of this field is six bits. That bit five was missing in the mask. This patch comes to correct the typo in the IGC_PTM_CTRL_SHRT_CYC macro. Fixes: a90ec8483732 ("igc: Add support for PTP getcrosststamp()") Signed-off-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen Reviewed-by: Simon Horman Reviewed-by: Kalesh AP Link: https://lore.kernel.org/r/20230821171721.2203572-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 987aae75fc1041072941ffb622b45ce2359a99b9 Author: Sven Eckelmann Date: Mon Aug 21 21:48:48 2023 +0200 batman-adv: Hold rtnl lock during MTU update via netlink The automatic recalculation of the maximum allowed MTU is usually triggered by code sections which are already rtnl lock protected by callers outside of batman-adv. But when the fragmentation setting is changed via batman-adv's own batadv genl family, then the rtnl lock is not yet taken. But dev_set_mtu requires that the caller holds the rtnl lock because it uses netdevice notifiers. And this code will then fail the check for this lock: RTNL: assertion failed at net/core/dev.c (1953) Cc: stable@vger.kernel.org Reported-by: syzbot+f8812454d9b3ac00d282@syzkaller.appspotmail.com Fixes: c6a953cce8d0 ("batman-adv: Trigger events for auto adjusted MTU") Signed-off-by: Sven Eckelmann Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230821-batadv-missing-mtu-rtnl-lock-v1-1-1c5a7bfe861e@narfation.org Signed-off-by: Jakub Kicinski commit b888c510f7b3d64ca75fc0f43b4a4bd1a611312f Author: Alessio Igor Bogani Date: Mon Aug 21 10:19:27 2023 -0700 igb: Avoid starting unnecessary workqueues If ptp_clock_register() fails or CONFIG_PTP isn't enabled, avoid starting PTP related workqueues. In this way we can fix this: BUG: unable to handle page fault for address: ffffc9000440b6f8 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 100000067 P4D 100000067 PUD 1001e0067 PMD 107dc5067 PTE 0 Oops: 0000 [#1] PREEMPT SMP [...] Workqueue: events igb_ptp_overflow_check RIP: 0010:igb_rd32+0x1f/0x60 [...] Call Trace: igb_ptp_read_82580+0x20/0x50 timecounter_read+0x15/0x60 igb_ptp_overflow_check+0x1a/0x50 process_one_work+0x1cb/0x3c0 worker_thread+0x53/0x3f0 ? rescuer_thread+0x370/0x370 kthread+0x142/0x160 ? kthread_associate_blkcg+0xc0/0xc0 ret_from_fork+0x1f/0x30 Fixes: 1f6e8178d685 ("igb: Prevent dropped Tx timestamps via work items and interrupts.") Fixes: d339b1331616 ("igb: add PTP Hardware Clock code") Signed-off-by: Alessio Igor Bogani Tested-by: Arpana Arland (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230821171927.2203644-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 9536c2f51f146daf849185c9bc00c3f94ef6f886 Merge: c8777fa6f3c6e 67f6317dfa609 Author: Jakub Kicinski Date: Tue Aug 22 17:22:32 2023 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-08-21 (ice) This series contains updates to ice driver only. Jesse fixes an issue on calculating buffer size. Petr Oros reverts a commit that does not fully resolve VF reset issues and implements one that provides a fuller fix. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: Fix NULL pointer deref during VF reset Revert "ice: Fix ice VF reset during iavf initialization" ice: fix receive buffer size miscalculation ==================== Link: https://lore.kernel.org/r/20230821171633.2203505-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit c8777fa6f3c6e0cfa4ef7e7028df83d35a586671 Merge: bf23ffc8a9a77 c275a176e4b69 Author: Jakub Kicinski Date: Tue Aug 22 17:18:56 2023 -0700 Merge branch 'can-fixes-for-6-5-rc7' Oliver Hartkopp says: ==================== CAN fixes for 6.5-rc7 The isotp fix removes an unnecessary check which leads to delays and/or a wrong error notification. The fix for the CAN_RAW socket solves the last issue that has been introduced with commit ee8b94c8510c ("can: raw: fix receiver memory leak") in this upstream cycle (detected by Eric Dumazet). ==================== Link: https://lore.kernel.org/r/20230821144547.6658-1-socketcan@hartkopp.net Signed-off-by: Jakub Kicinski commit c275a176e4b69868576e543409927ae75e3a3288 Author: Oliver Hartkopp Date: Mon Aug 21 16:45:47 2023 +0200 can: raw: add missing refcount for memory leak fix Commit ee8b94c8510c ("can: raw: fix receiver memory leak") introduced a new reference to the CAN netdevice that has assigned CAN filters. But this new ro->dev reference did not maintain its own refcount which lead to another KASAN use-after-free splat found by Eric Dumazet. This patch ensures a proper refcount for the CAN nedevice. Fixes: ee8b94c8510c ("can: raw: fix receiver memory leak") Reported-by: Eric Dumazet Cc: Ziyang Xuan Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/r/20230821144547.6658-3-socketcan@hartkopp.net Signed-off-by: Jakub Kicinski commit 0bfe71159230bab79ee230225ae12ffecbb69f3e Author: Oliver Hartkopp Date: Mon Aug 21 16:45:46 2023 +0200 can: isotp: fix support for transmission of SF without flow control The original implementation had a very simple handling for single frame transmissions as it just sent the single frame without a timeout handling. With the new echo frame handling the echo frame was also introduced for single frames but the former exception ('simple without timers') has been maintained by accident. This leads to a 1 second timeout when closing the socket and to an -ECOMM error when CAN_ISOTP_WAIT_TX_DONE is selected. As the echo handling is always active (also for single frames) remove the wrong extra condition for single frames. Fixes: 9f39d36530e5 ("can: isotp: add support for transmission without flow control") Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/r/20230821144547.6658-2-socketcan@hartkopp.net Signed-off-by: Jakub Kicinski commit bf23ffc8a9a777dfdeb04232e0946b803adbb6a9 Author: Thinh Tran Date: Fri Aug 18 11:14:40 2023 -0500 bnx2x: new flag for track HW resource allocation While injecting PCIe errors to the upstream PCIe switch of a BCM57810 NIC, system hangs/crashes were observed. After several calls to bnx2x_tx_timout() complete, bnx2x_nic_unload() is called to free up HW resources and bnx2x_napi_disable() is called to release NAPI objects. Later, when the EEH driver calls bnx2x_io_slot_reset() to complete the recovery process, bnx2x attempts to disable NAPI again by calling bnx2x_napi_disable() and freeing resources which have already been freed, resulting in a hang or crash. Introduce a new flag to track the HW resource and NAPI allocation state, refactor duplicated code into a single function, check page pool allocation status before freeing, and reduces debug output when a TX timeout event occurs. Reviewed-by: Manish Chopra Tested-by: Abdul Haleem Tested-by: David Christensen Reviewed-by: Simon Horman Tested-by: Venkata Sai Duggi Signed-off-by: Thinh Tran Link: https://lore.kernel.org/r/20230818161443.708785-2-thinhtr@linux.vnet.ibm.com Signed-off-by: Jakub Kicinski commit 66fbfb35da47f391bdadf9fa7ceb88af4faa9022 Author: Andrey Skvortsov Date: Sat Aug 5 11:48:47 2023 +0300 clk: Fix slab-out-of-bounds error in devm_clk_release() Problem can be reproduced by unloading snd_soc_simple_card, because in devm_get_clk_from_child() devres data is allocated as `struct clk`, but devm_clk_release() expects devres data to be `struct devm_clk_state`. KASAN report: ================================================================== BUG: KASAN: slab-out-of-bounds in devm_clk_release+0x20/0x54 Read of size 8 at addr ffffff800ee09688 by task (udev-worker)/287 Call trace: dump_backtrace+0xe8/0x11c show_stack+0x1c/0x30 dump_stack_lvl+0x60/0x78 print_report+0x150/0x450 kasan_report+0xa8/0xf0 __asan_load8+0x78/0xa0 devm_clk_release+0x20/0x54 release_nodes+0x84/0x120 devres_release_all+0x144/0x210 device_unbind_cleanup+0x1c/0xac really_probe+0x2f0/0x5b0 __driver_probe_device+0xc0/0x1f0 driver_probe_device+0x68/0x120 __driver_attach+0x140/0x294 bus_for_each_dev+0xec/0x160 driver_attach+0x38/0x44 bus_add_driver+0x24c/0x300 driver_register+0xf0/0x210 __platform_driver_register+0x48/0x54 asoc_simple_card_init+0x24/0x1000 [snd_soc_simple_card] do_one_initcall+0xac/0x340 do_init_module+0xd0/0x300 load_module+0x2ba4/0x3100 __do_sys_init_module+0x2c8/0x300 __arm64_sys_init_module+0x48/0x5c invoke_syscall+0x64/0x190 el0_svc_common.constprop.0+0x124/0x154 do_el0_svc+0x44/0xdc el0_svc+0x14/0x50 el0t_64_sync_handler+0xec/0x11c el0t_64_sync+0x14c/0x150 Allocated by task 287: kasan_save_stack+0x38/0x60 kasan_set_track+0x28/0x40 kasan_save_alloc_info+0x20/0x30 __kasan_kmalloc+0xac/0xb0 __kmalloc_node_track_caller+0x6c/0x1c4 __devres_alloc_node+0x44/0xb4 devm_get_clk_from_child+0x44/0xa0 asoc_simple_parse_clk+0x1b8/0x1dc [snd_soc_simple_card_utils] simple_parse_node.isra.0+0x1ec/0x230 [snd_soc_simple_card] simple_dai_link_of+0x1bc/0x334 [snd_soc_simple_card] __simple_for_each_link+0x2ec/0x320 [snd_soc_simple_card] asoc_simple_probe+0x468/0x4dc [snd_soc_simple_card] platform_probe+0x90/0xf0 really_probe+0x118/0x5b0 __driver_probe_device+0xc0/0x1f0 driver_probe_device+0x68/0x120 __driver_attach+0x140/0x294 bus_for_each_dev+0xec/0x160 driver_attach+0x38/0x44 bus_add_driver+0x24c/0x300 driver_register+0xf0/0x210 __platform_driver_register+0x48/0x54 asoc_simple_card_init+0x24/0x1000 [snd_soc_simple_card] do_one_initcall+0xac/0x340 do_init_module+0xd0/0x300 load_module+0x2ba4/0x3100 __do_sys_init_module+0x2c8/0x300 __arm64_sys_init_module+0x48/0x5c invoke_syscall+0x64/0x190 el0_svc_common.constprop.0+0x124/0x154 do_el0_svc+0x44/0xdc el0_svc+0x14/0x50 el0t_64_sync_handler+0xec/0x11c el0t_64_sync+0x14c/0x150 The buggy address belongs to the object at ffffff800ee09600 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 136 bytes inside of 256-byte region [ffffff800ee09600, ffffff800ee09700) The buggy address belongs to the physical page: page:000000002d97303b refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4ee08 head:000000002d97303b order:1 compound_mapcount:0 compound_pincount:0 flags: 0x10200(slab|head|zone=0) raw: 0000000000010200 0000000000000000 dead000000000122 ffffff8002c02480 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffffff800ee09580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffffff800ee09600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffff800ee09680: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffffff800ee09700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffffff800ee09780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== Fixes: abae8e57e49a ("clk: generalize devm_clk_get() a bit") Signed-off-by: Andrey Skvortsov Link: https://lore.kernel.org/r/20230805084847.3110586-1-andrej.skvortzov@gmail.com Signed-off-by: Stephen Boyd commit e0d25c591ac676ece0e1ad6bbd72a159b9355598 Author: Jani Nikula Date: Wed Jun 21 15:31:56 2023 +0300 drm/i915: fix Sphinx indentation warning Fix Sphinx warning about unexpected indent. Signed-off-by: Jani Nikula Reviewed-by: Luca Coelho Link: https://patchwork.freedesktop.org/patch/msgid/20230621123156.14907-2-jani.nikula@intel.com (cherry picked from commit 175b036472f678948b03baabce4a008b7ba91ce7) Signed-off-by: Rodrigo Vivi commit c35f3aa34509085bfc9800c86bc9998f8954933d Author: Andy Chiu Date: Wed Aug 16 15:54:49 2023 +0000 RISC-V: vector: export VLENB csr in __sc_riscv_v_state VLENB is critical for callers of ptrace to reconstruct Vector register files from the register dump of NT_RISCV_VECTOR. Also, future systems may will have a writable VLENB, so add it now to potentially save future compatibility issue. Fixes: 0c59922c769a ("riscv: Add ptrace vector support") Signed-off-by: Andy Chiu Link: https://lore.kernel.org/r/20230816155450.26200-3-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit e3f9324b231aba1dc707572bfe80be210c2d4cbd Author: Palmer Dabbelt Date: Wed Aug 16 15:54:48 2023 +0000 RISC-V: Remove ptrace support for vectors We've found two bugs here: NT_RISCV_VECTOR steps on NT_RISCV_CSR (which is only for embedded), and we don't have vlenb in the core dumps. Given that we've have a pair of bugs croup up as part of the GDB review we've probably got other issues, so let's just cut this for 6.5 and get it right. Fixes: 0c59922c769a ("riscv: Add ptrace vector support") Reviewed-by: Maciej W. Rozycki Signed-off-by: Andy Chiu Link: https://lore.kernel.org/r/20230816155450.26200-2-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 89bf6209cad66214d3774dac86b6bbf2aec6a30d Merge: 53663f4103ff6 7882541ca06d5 Author: Linus Torvalds Date: Tue Aug 22 11:16:23 2023 -0700 Merge tag 'devicetree-fixes-for-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Fix DT node refcount when creating platform devices - Fix deadlock in changeset code due to printing with devtree_lock held - Fix unittest EXPECT strings for parse_phandle_with_args_map() test - Fix IMA kexec memblock freeing * tag 'devicetree-fixes-for-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: of/platform: increase refcount of fwnode of: dynamic: Refactor action prints to not use "%pOF" inside devtree_lock of: unittest: Fix EXPECT for parse_phandle_with_args_map() test mm,ima,kexec,of: use memblock_free_late from ima_free_kexec_buffer commit 6dc5774deefe38d9ab385a5dafbe6614ae63d166 Author: Edward Cree Date: Mon Aug 21 19:01:53 2023 +0100 sfc: allocate a big enough SKB for loopback selftest packet Cited commits passed a size to alloc_skb that was only big enough for the actual packet contents, but the following skb_put + memcpy writes the whole struct efx_loopback_payload including leading and trailing padding bytes (which are then stripped off with skb_pull/skb_trim). This could cause an skb_over_panic, although in practice we get saved by kmalloc_size_roundup. Pass the entire size we use, instead of the size of the final packet. Reported-by: Andy Moreton Fixes: cf60ed469629 ("sfc: use padding to fix alignment in loopback test") Fixes: 30c24dd87f3f ("sfc: siena: use padding to fix alignment in loopback test") Fixes: 1186c6b31ee1 ("sfc: falcon: use padding to fix alignment in loopback test") Signed-off-by: Edward Cree Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230821180153.18652-1-edward.cree@amd.com Signed-off-by: Jakub Kicinski commit 1a8660546b31b6696e6634f529efe021c8360141 Merge: 44f0fb8dfe263 b98c16107cc16 Author: Jakub Kicinski Date: Tue Aug 22 11:04:01 2023 -0700 Merge tag 'wireless-2023-08-22' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Johannes Berg says: ==================== Two fixes: - reorder buffer filter checks can cause bad shift/UBSAN warning with newer HW, avoid the check (mac80211) - add Kconfig dependency for iwlwifi for PTP clock usage * tag 'wireless-2023-08-22' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: mac80211: limit reorder_buf_filtered to avoid UBSAN warning wifi: iwlwifi: mvm: add dependency for PTP clock ==================== Link: https://lore.kernel.org/r/20230822124206.43926-2-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit 44f0fb8dfe263e27ac95d502a58586fe95fd5958 Author: Marek Behún Date: Mon Aug 21 14:14:53 2023 +0200 leds: trigger: netdev: rename 'hw_control' sysfs entry to 'offloaded' Commit b655892ffd6d ("leds: trigger: netdev: expose hw_control status via sysfs") exposed to sysfs the flag that tells whether the LED trigger is offloaded to hardware, under the name "hw_control", since that is the name under which this setting is called in the code. Everywhere else in kernel when some work that is normally done in software can be made to be done by hardware instead, we use the word "offloading" to describe this, e.g. "LED blinking is offloaded to hardware". Normally renaming sysfs entries is a no-go because of backwards compatibility. But since this patch was not yet released in a stable kernel, I think it is still possible to rename it, if there is consensus. Fixes: b655892ffd6d ("leds: trigger: netdev: expose hw_control status via sysfs") Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230821121453.30203-1-kabel@kernel.org Signed-off-by: Jakub Kicinski commit 604204fcb321abe81238551936ecda5269e81076 Author: Daniel Golle Date: Mon Aug 21 17:12:44 2023 +0100 net: ethernet: mtk_eth_soc: fix NULL pointer on hw reset When a hardware reset is triggered on devices not initializing WED the calls to mtk_wed_fe_reset and mtk_wed_fe_reset_complete dereference a pointer on uninitialized stack memory. Break out of both functions in case a hw_list entry is 0. Fixes: 08a764a7c51b ("net: ethernet: mtk_wed: add reset/reset_complete callbacks") Signed-off-by: Daniel Golle Reviewed-by: Simon Horman Acked-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/5465c1609b464cc7407ae1530c40821dcdf9d3e6.1692634266.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski commit 53663f4103ff6738e4697004d6f84864d052333d Merge: e4311f7c0508d 895cedc179191 Author: Linus Torvalds Date: Tue Aug 22 10:50:17 2023 -0700 Merge tag 'nfs-for-6.5-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs Pull NFS client fixes from Trond Myklebust: - fix a use after free in nfs_direct_join_group() (Cc: stable) - fix sysfs server name memory leak - fix lock recovery hang in NFSv4.0 - fix page free in the error path for nfs42_proc_getxattr() and __nfs4_get_acl_uncached() - SUNRPC/rdma: fix receive buffer dma-mapping after a server disconnect * tag 'nfs-for-6.5-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: xprtrdma: Remap Receive buffers after a reconnect NFSv4: fix out path in __nfs4_get_acl_uncached NFSv4.2: fix error handling in nfs42_proc_getxattr NFS: Fix sysfs server name memory leak NFS: Fix a use after free in nfs_direct_join_group() NFSv4: Fix dropped lock for racing OPEN and delegation return commit e4311f7c0508d6d0d1176a0d7b7ef3ab4a24be1e Merge: f7757129e3dea 70d91dc9b2ac9 Author: Linus Torvalds Date: Tue Aug 22 10:38:29 2023 -0700 Merge tag 'selinux-pr-20230821' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux fix from Paul Moore: "A small fix for a potential problem when cleaning up after a failed SELinux policy load (list next pointer not being properly initialized to NULL early enough)" * tag 'selinux-pr-20230821' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: set next pointer before attaching to list commit 2872144aec04baa7e43ecd2a60f7f0be3aa843fd Author: Anshuman Gupta Date: Wed Aug 16 18:22:16 2023 +0530 drm/i915/dgfx: Enable d3cold at s2idle System wide suspend already has support for lmem save/restore during suspend therefore enabling d3cold for s2idle and keepng it disable for runtime PM.(Refer below commit for d3cold runtime PM disable justification) 'commit 66eb93e71a7a ("drm/i915/dgfx: Keep PCI autosuspend control 'on' by default on all dGPU")' It will reduce the DG2 Card power consumption to ~0 Watt for s2idle power KPI. v2: - Added "Cc: stable@vger.kernel.org". Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8755 Cc: stable@vger.kernel.org Cc: Rodrigo Vivi Signed-off-by: Anshuman Gupta Reviewed-by: Rodrigo Vivi Tested-by: Aaron Ma Tested-by: Jianshui Yu Link: https://patchwork.freedesktop.org/patch/msgid/20230816125216.1722002-1-anshuman.gupta@intel.com (cherry picked from commit 2643e6d1f2a5e51877be24042d53cf956589be10) Signed-off-by: Rodrigo Vivi commit 5ad1ab30ac0809d2963ddcf39ac34317a24a2f17 Author: Ankit Nautiyal Date: Fri Aug 18 10:14:36 2023 +0530 drm/display/dp: Fix the DP DSC Receiver cap size DP DSC Receiver Capabilities are exposed via DPCD 60h-6Fh. Fix the DSC RECEIVER CAP SIZE accordingly. Fixes: ffddc4363c28 ("drm/dp: Add DP DSC DPCD receiver capability size define and missing SHIFT") Cc: Anusha Srivatsa Cc: Manasi Navare Cc: # v5.0+ Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230818044436.177806-1-ankit.k.nautiyal@intel.com commit 99b415fe8986803ba0eaf6b8897b16edc8fe7ec2 Author: Kees Cook Date: Fri Aug 18 10:54:21 2023 -0700 tg3: Use slab_build_skb() when needed The tg3 driver will use kmalloc() under some conditions. Check the frag_size and use slab_build_skb() when frag_size is 0. Silences the warning introduced by commit ce098da1497c ("skbuff: Introduce slab_build_skb()"): Use slab_build_skb() instead ... tg3_poll_work+0x638/0xf90 [tg3] Fixes: ce098da1497c ("skbuff: Introduce slab_build_skb()") Reported-by: Fiona Ebner Closes: https://lore.kernel.org/all/1bd4cb9c-4eb8-3bdb-3e05-8689817242d1@proxmox.com Cc: Siva Reddy Kallam Cc: Prashant Sreedharan Cc: Michael Chan Cc: Bagas Sanjaya Signed-off-by: Kees Cook Reviewed-by: Pavan Chebbi Link: https://lore.kernel.org/r/20230818175417.never.273-kees@kernel.org Signed-off-by: Jakub Kicinski commit be809424659c2844a2d7ab653aacca4898538023 Author: Hangbin Liu Date: Thu Aug 17 16:24:59 2023 +0800 selftests: bonding: do not set port down before adding to bond Before adding a port to bond, it need to be set down first. In the lacpdu test the author set the port down specifically. But commit a4abfa627c38 ("net: rtnetlink: Enslave device before bringing it up") changed the operation order, the kernel will set the port down _after_ adding to bond. So all the ports will be down at last and the test failed. In fact, the veth interfaces are already inactive when added. This means there's no need to set them down again before adding to the bond. Let's just remove the link down operation. Fixes: a4abfa627c38 ("net: rtnetlink: Enslave device before bringing it up") Reported-by: Zhengchao Shao Closes: https://lore.kernel.org/netdev/a0ef07c7-91b0-94bd-240d-944a330fcabd@huawei.com/ Signed-off-by: Hangbin Liu Link: https://lore.kernel.org/r/20230817082459.1685972-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski commit e332938e6fc8117fb9bb1374339cea879b3972d9 Author: GONG, Ruiqi Date: Sun Aug 20 19:15:09 2023 +0800 samples: ftrace: Replace bti assembly with hint for older compiler When cross-building the arm64 kernel with allmodconfig using GCC 9.4, the following error occurs on multiple files under samples/ftrace/: /tmp/ccPC1ODs.s: Assembler messages: /tmp/ccPC1ODs.s:8: Error: selected processor does not support `bti c' Fix this issue by replacing `bti c` with `hint 34`, which is compatible for the older compiler. Link: https://lore.kernel.org/linux-trace-kernel/20230820111509.1470826-1-gongruiqi@huaweicloud.com Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Florent Revest Fixes: 8c3526fb86060cb5 ("arm64: ftrace: Add direct call trampoline samples support") Acked-by: Mark Rutland Signed-off-by: GONG, Ruiqi Signed-off-by: Steven Rostedt (Google) commit c422fbd5cb58c9a078172ae1e9750971b738a197 Author: Neil Armstrong Date: Mon Aug 21 14:11:21 2023 +0200 scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW major version > 5 The qunipro_g4_sel clear is also needed for new platforms with major version > 5. Fix the version check to take this into account. Fixes: 9c02aa24bf40 ("scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5") Acked-by: Manivannan Sadhasivam Reviewed-by: Nitin Rawat Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20230821-topic-sm8x50-upstream-ufs-major-5-plus-v2-1-f42a4b712e58@linaro.org Reviewed-by: "Bao D. Nguyen" Signed-off-by: Martin K. Petersen commit d0c89af3130eb4ff962266bb7597690a696f1cbc Author: Bao D. Nguyen Date: Tue Aug 15 18:38:29 2023 -0700 scsi: ufs: mcq: Fix the search/wrap around logic The search and wrap around logic in the ufshcd_mcq_sqe_search() function does not work correctly when the hwq's queue depth is not a power of two number. Correct it so that any queue depth with a positive integer value within the supported range would work. Signed-off-by: "Bao D. Nguyen" Link: https://lore.kernel.org/r/ff49c15be205135ed3ec186f3086694c02867dbd.1692149603.git.quic_nguyenb@quicinc.com Reviewed-by: Bart Van Assche Fixes: 8d7290348992 ("scsi: ufs: mcq: Add supporting functions for MCQ abort") Signed-off-by: Martin K. Petersen commit 7882541ca06d51a6c12d687827176c16d5e05f65 Author: Peng Fan Date: Mon Aug 21 10:39:28 2023 +0800 of/platform: increase refcount of fwnode commit 0f8e5651095b ("of/platform: Propagate firmware node by calling device_set_node()") use of_fwnode_handle to replace of_node_get, which introduces a side effect that the refcount is not increased. Then the out of tree jailhouse hypervisor enable/disable test will trigger kernel dump in of_overlay_remove, with the following sequence " of_changeset_revert(&overlay_changeset); of_changeset_destroy(&overlay_changeset); of_overlay_remove(&overlay_id); " So increase the refcount to avoid issues. This patch also release the refcount when releasing amba device to avoid refcount leakage. Fixes: 0f8e5651095b ("of/platform: Propagate firmware node by calling device_set_node()") Reviewed-by: Andy Shevchenko Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20230821023928.3324283-2-peng.fan@oss.nxp.com Signed-off-by: Rob Herring commit 6867c7a3320669cbe44b905a3eb35db725c6d470 Author: T.J. Mercier Date: Mon Aug 14 15:16:36 2023 +0000 mm: multi-gen LRU: don't spin during memcg release When a memcg is in the process of being released mem_cgroup_tryget will fail because its reference count has already reached 0. This can happen during reclaim if the memcg has already been offlined, and we reclaim all remaining pages attributed to the offlined memcg. shrink_many attempts to skip the empty memcg in this case, and continue reclaiming from the remaining memcgs in the old generation. If there is only one memcg remaining, or if all remaining memcgs are in the process of being released then shrink_many will spin until all memcgs have finished being released. The release occurs through a workqueue, so it can take a while before kswapd is able to make any further progress. This fix results in reductions in kswapd activity and direct reclaim in a test where 28 apps (working set size > total memory) are repeatedly launched in a random sequence: A B delta ratio(%) allocstall_movable 5962 3539 -2423 -40.64 allocstall_normal 2661 2417 -244 -9.17 kswapd_high_wmark_hit_quickly 53152 7594 -45558 -85.71 pageoutrun 57365 11750 -45615 -79.52 Link: https://lkml.kernel.org/r/20230814151636.1639123-1-tjmercier@google.com Fixes: e4dde56cd208 ("mm: multi-gen LRU: per-node lru_gen_folio lists") Signed-off-by: T.J. Mercier Acked-by: Yu Zhao Cc: Signed-off-by: Andrew Morton commit e2c1ab070fdc81010ec44634838d24fce9ff9e53 Author: Miaohe Lin Date: Tue Jun 27 19:28:08 2023 +0800 mm: memory-failure: fix unexpected return value in soft_offline_page() When page_handle_poison() fails to handle the hugepage or free page in retry path, soft_offline_page() will return 0 while -EBUSY is expected in this case. Consequently the user will think soft_offline_page succeeds while it in fact failed. So the user will not try again later in this case. Link: https://lkml.kernel.org/r/20230627112808.1275241-1-linmiaohe@huawei.com Fixes: b94e02822deb ("mm,hwpoison: try to narrow window race for free pages") Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton commit d59070d1076ec5114edb67c87658aeb1d691d381 Author: Arnd Bergmann Date: Fri Aug 11 15:10:13 2023 +0200 radix tree: remove unused variable Recent versions of clang warn about an unused variable, though older versions saw the 'slot++' as a use and did not warn: radix-tree.c:1136:50: error: parameter 'slot' set but not used [-Werror,-Wunused-but-set-parameter] It's clearly not needed any more, so just remove it. Link: https://lkml.kernel.org/r/20230811131023.2226509-1-arnd@kernel.org Fixes: 3a08cd52c37c7 ("radix tree: Remove multiorder support") Signed-off-by: Arnd Bergmann Cc: Matthew Wilcox Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Peng Zhang Cc: Rong Tao Cc: Tom Rix Cc: Signed-off-by: Andrew Morton commit a50420c79731fc5cf27ad43719c1091e842a2606 Author: Alexandre Ghiti Date: Wed Aug 9 18:46:33 2023 +0200 mm: add a call to flush_cache_vmap() in vmap_pfn() flush_cache_vmap() must be called after new vmalloc mappings are installed in the page table in order to allow architectures to make sure the new mapping is visible. It could lead to a panic since on some architectures (like powerpc), the page table walker could see the wrong pte value and trigger a spurious page fault that can not be resolved (see commit f1cb8f9beba8 ("powerpc/64s/radix: avoid ptesync after set_pte and ptep_set_access_flags")). But actually the patch is aiming at riscv: the riscv specification allows the caching of invalid entries in the TLB, and since we recently removed the vmalloc page fault handling, we now need to emit a tlb shootdown whenever a new vmalloc mapping is emitted (https://lore.kernel.org/linux-riscv/20230725132246.817726-1-alexghiti@rivosinc.com/). That's a temporary solution, there are ways to avoid that :) Link: https://lkml.kernel.org/r/20230809164633.1556126-1-alexghiti@rivosinc.com Fixes: 3e9a9e256b1e ("mm: add a vmap_pfn function") Reported-by: Dylan Jhong Closes: https://lore.kernel.org/linux-riscv/ZMytNY2J8iyjbPPy@atctrx.andestech.com/ Signed-off-by: Alexandre Ghiti Reviewed-by: Christoph Hellwig Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Reviewed-by: Dylan Jhong Cc: Signed-off-by: Andrew Morton commit 1738b949625c7e17a454b25de33f1f415da3db69 Author: Ayush Jain Date: Tue Aug 8 07:43:47 2023 -0500 selftests/mm: FOLL_LONGTERM need to be updated to 0x100 After commit 2c2241081f7d ("mm/gup: move private gup FOLL_ flags to internal.h") FOLL_LONGTERM flag value got updated from 0x10000 to 0x100 at include/linux/mm_types.h. As hmm.hmm_device_private.hmm_gup_test uses FOLL_LONGTERM Updating same here as well. Before this change test goes in an infinite assert loop in hmm.hmm_device_private.hmm_gup_test ========================================================== RUN hmm.hmm_device_private.hmm_gup_test ... hmm-tests.c:1962:hmm_gup_test:Expected HMM_DMIRROR_PROT_WRITE.. ..(2) == m[2] (34) hmm-tests.c:157:hmm_gup_test:Expected ret (-1) == 0 (0) hmm-tests.c:157:hmm_gup_test:Expected ret (-1) == 0 (0) ... ========================================================== Call Trace: ? sched_clock+0xd/0x20 ? __lock_acquire.constprop.0+0x120/0x6c0 ? ktime_get+0x2c/0xd0 ? sched_clock+0xd/0x20 ? local_clock+0x12/0xd0 ? lock_release+0x26e/0x3b0 pin_user_pages_fast+0x4c/0x70 gup_test_ioctl+0x4ff/0xbb0 ? gup_test_ioctl+0x68c/0xbb0 __x64_sys_ioctl+0x99/0xd0 do_syscall_64+0x60/0x90 ? syscall_exit_to_user_mode+0x2a/0x50 ? do_syscall_64+0x6d/0x90 ? syscall_exit_to_user_mode+0x2a/0x50 ? do_syscall_64+0x6d/0x90 ? irqentry_exit_to_user_mode+0xd/0x20 ? irqentry_exit+0x3f/0x50 ? exc_page_fault+0x96/0x200 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f6aaa31aaff After this change test is able to pass successfully. Link: https://lkml.kernel.org/r/20230808124347.79163-1-ayush.jain3@amd.com Fixes: 2c2241081f7d ("mm/gup: move private gup FOLL_ flags to internal.h") Signed-off-by: Ayush Jain Reviewed-by: Raghavendra K T Reviewed-by: John Hubbard Acked-by: David Hildenbrand Cc: Jason Gunthorpe Cc: Signed-off-by: Andrew Morton commit f83913f8c5b882a312e72b7669762f8a5c9385e4 Author: Ryusuke Konishi Date: Sat Aug 5 22:20:38 2023 +0900 nilfs2: fix general protection fault in nilfs_lookup_dirty_data_buffers() A syzbot stress test reported that create_empty_buffers() called from nilfs_lookup_dirty_data_buffers() can cause a general protection fault. Analysis using its reproducer revealed that the back reference "mapping" from a page/folio has been changed to NULL after dirty page/folio gang lookup in nilfs_lookup_dirty_data_buffers(). Fix this issue by excluding pages/folios from being collected if, after acquiring a lock on each page/folio, its back reference "mapping" differs from the pointer to the address space struct that held the page/folio. Link: https://lkml.kernel.org/r/20230805132038.6435-1-konishi.ryusuke@gmail.com Signed-off-by: Ryusuke Konishi Reported-by: syzbot+0ad741797f4565e7e2d2@syzkaller.appspotmail.com Closes: https://lkml.kernel.org/r/0000000000002930a705fc32b231@google.com Tested-by: Ryusuke Konishi Cc: Signed-off-by: Andrew Morton commit 5805192c7b7257d290474cb1a3897d0567281bbc Author: David Hildenbrand Date: Sat Aug 5 12:12:56 2023 +0200 mm/gup: handle cont-PTE hugetlb pages correctly in gup_must_unshare() via GUP-fast In contrast to most other GUP code, GUP-fast common page table walking code like gup_pte_range() also handles hugetlb pages. But in contrast to other hugetlb page table walking code, it does not look at the hugetlb PTE abstraction whereby we have only a single logical hugetlb PTE per hugetlb page, even when using multiple cont-PTEs underneath -- which is for example what huge_ptep_get() abstracts. So when we have a hugetlb page that is mapped via cont-PTEs, GUP-fast might stumble over a PTE that does not map the head page of a hugetlb page -- not the first "head" PTE of such a cont mapping. Logically, the whole hugetlb page is mapped (entire_mapcount == 1), but we might end up calling gup_must_unshare() with a tail page of a hugetlb page. We only maintain a single PageAnonExclusive flag per hugetlb page (as hugetlb pages cannot get partially COW-shared), stored for the head page. That flag is clear for all tail pages. So when gup_must_unshare() ends up calling PageAnonExclusive() with a tail page of a hugetlb page: 1) With CONFIG_DEBUG_VM_PGFLAGS Stumbles over the: VM_BUG_ON_PGFLAGS(PageHuge(page) && !PageHead(page), page); For example, when executing the COW selftests with 64k hugetlb pages on arm64: [ 61.082187] page:00000000829819ff refcount:3 mapcount:1 mapping:0000000000000000 index:0x1 pfn:0x11ee11 [ 61.082842] head:0000000080f79bf7 order:4 entire_mapcount:1 nr_pages_mapped:0 pincount:2 [ 61.083384] anon flags: 0x17ffff80003000e(referenced|uptodate|dirty|head|mappedtodisk|node=0|zone=2|lastcpupid=0xfffff) [ 61.084101] page_type: 0xffffffff() [ 61.084332] raw: 017ffff800000000 fffffc00037b8401 0000000000000402 0000000200000000 [ 61.084840] raw: 0000000000000010 0000000000000000 00000000ffffffff 0000000000000000 [ 61.085359] head: 017ffff80003000e ffffd9e95b09b788 ffffd9e95b09b788 ffff0007ff63cf71 [ 61.085885] head: 0000000000000000 0000000000000002 00000003ffffffff 0000000000000000 [ 61.086415] page dumped because: VM_BUG_ON_PAGE(PageHuge(page) && !PageHead(page)) [ 61.086914] ------------[ cut here ]------------ [ 61.087220] kernel BUG at include/linux/page-flags.h:990! [ 61.087591] Internal error: Oops - BUG: 00000000f2000800 [#1] SMP [ 61.087999] Modules linked in: ... [ 61.089404] CPU: 0 PID: 4612 Comm: cow Kdump: loaded Not tainted 6.5.0-rc4+ #3 [ 61.089917] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 [ 61.090409] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 61.090897] pc : gup_must_unshare.part.0+0x64/0x98 [ 61.091242] lr : gup_must_unshare.part.0+0x64/0x98 [ 61.091592] sp : ffff8000825eb940 [ 61.091826] x29: ffff8000825eb940 x28: 0000000000000000 x27: fffffc00037b8440 [ 61.092329] x26: 0400000000000001 x25: 0000000000080101 x24: 0000000000080000 [ 61.092835] x23: 0000000000080100 x22: ffff0000cffb9588 x21: ffff0000c8ec6b58 [ 61.093341] x20: 0000ffffad6b1000 x19: fffffc00037b8440 x18: ffffffffffffffff [ 61.093850] x17: 2864616548656761 x16: 5021202626202965 x15: 6761702865677548 [ 61.094358] x14: 6567615028454741 x13: 2929656761702864 x12: 6165486567615021 [ 61.094858] x11: 00000000ffff7fff x10: 00000000ffff7fff x9 : ffffd9e958b7a1c0 [ 61.095359] x8 : 00000000000bffe8 x7 : c0000000ffff7fff x6 : 00000000002bffa8 [ 61.095873] x5 : ffff0008bb19e708 x4 : 0000000000000000 x3 : 0000000000000000 [ 61.096380] x2 : 0000000000000000 x1 : ffff0000cf6636c0 x0 : 0000000000000046 [ 61.096894] Call trace: [ 61.097080] gup_must_unshare.part.0+0x64/0x98 [ 61.097392] gup_pte_range+0x3a8/0x3f0 [ 61.097662] gup_pgd_range+0x1ec/0x280 [ 61.097942] lockless_pages_from_mm+0x64/0x1a0 [ 61.098258] internal_get_user_pages_fast+0xe4/0x1d0 [ 61.098612] pin_user_pages_fast+0x58/0x78 [ 61.098917] pin_longterm_test_start+0xf4/0x2b8 [ 61.099243] gup_test_ioctl+0x170/0x3b0 [ 61.099528] __arm64_sys_ioctl+0xa8/0xf0 [ 61.099822] invoke_syscall.constprop.0+0x7c/0xd0 [ 61.100160] el0_svc_common.constprop.0+0xe8/0x100 [ 61.100500] do_el0_svc+0x38/0xa0 [ 61.100736] el0_svc+0x3c/0x198 [ 61.100971] el0t_64_sync_handler+0x134/0x150 [ 61.101280] el0t_64_sync+0x17c/0x180 [ 61.101543] Code: aa1303e0 f00074c1 912b0021 97fffeb2 (d4210000) 2) Without CONFIG_DEBUG_VM_PGFLAGS Always detects "not exclusive" for passed tail pages and refuses to PIN the tail pages R/O, as gup_must_unshare() == true. GUP-fast will fallback to ordinary GUP. As ordinary GUP properly considers the logical hugetlb PTE abstraction in hugetlb_follow_page_mask(), pinning the page will succeed when looking at the PageAnonExclusive on the head page only. So the only real effect of this is that with cont-PTE hugetlb pages, we'll always fallback from GUP-fast to ordinary GUP when not working on the head page, which ends up checking the head page and do the right thing. Consequently, the cow selftests pass with cont-PTE hugetlb pages as well without CONFIG_DEBUG_VM_PGFLAGS. Note that this only applies to anon hugetlb pages that are mapped using cont-PTEs: for example 64k hugetlb pages on a 4k arm64 kernel. ... and only when R/O-pinning (FOLL_PIN) such pages that are mapped into the page table R/O using GUP-fast. On production kernels (and even most debug kernels, that don't set CONFIG_DEBUG_VM_PGFLAGS) this patch should theoretically not be required to be backported. But of course, it does not hurt. Link: https://lkml.kernel.org/r/20230805101256.87306-1-david@redhat.com Fixes: a7f226604170 ("mm/gup: trigger FAULT_FLAG_UNSHARE when R/O-pinning a possibly shared anonymous page") Signed-off-by: David Hildenbrand Reported-by: Ryan Roberts Reviewed-by: Ryan Roberts Tested-by: Ryan Roberts Cc: Vlastimil Babka Cc: John Hubbard Cc: Jason Gunthorpe Cc: Peter Xu Cc: Mike Kravetz Cc: Signed-off-by: Andrew Morton commit 60439471f30be00dc4f6648322ab1a3a3f89777f Author: Lucas Karpinski Date: Fri Aug 4 15:35:29 2023 -0400 selftests: cgroup: fix test_kmem_basic less than error test_kmem_basic creates 100,000 negative dentries, with each one mapping to a slab object. After memory.high is set, these are reclaimed through the shrink_slab function call which reclaims all 100,000 entries. The test passes the majority of the time because when slab1 or current is calculated, it is often above 0, however, 0 is also an acceptable value. Link: https://lkml.kernel.org/r/7d6gcuyzdjcice6qbphrmpmv5skr5jtglg375unnjxqhstvhxc@qkn6dw6bao6v Signed-off-by: Lucas Karpinski Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Cc: Shuah Khan Cc: Tejun Heo Cc: Zefan Li Signed-off-by: Andrew Morton commit 49b0638502da097c15d46cd4e871dbaa022caf7c Author: Suren Baghdasaryan Date: Fri Aug 4 08:27:19 2023 -0700 mm: enable page walking API to lock vmas during the walk walk_page_range() and friends often operate under write-locked mmap_lock. With introduction of vma locks, the vmas have to be locked as well during such walks to prevent concurrent page faults in these areas. Add an additional member to mm_walk_ops to indicate locking requirements for the walk. The change ensures that page walks which prevent concurrent page faults by write-locking mmap_lock, operate correctly after introduction of per-vma locks. With per-vma locks page faults can be handled under vma lock without taking mmap_lock at all, so write locking mmap_lock would not stop them. The change ensures vmas are properly locked during such walks. A sample issue this solves is do_mbind() performing queue_pages_range() to queue pages for migration. Without this change a concurrent page can be faulted into the area and be left out of migration. Link: https://lkml.kernel.org/r/20230804152724.3090321-2-surenb@google.com Signed-off-by: Suren Baghdasaryan Suggested-by: Linus Torvalds Suggested-by: Jann Horn Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: Hugh Dickins Cc: Johannes Weiner Cc: Laurent Dufour Cc: Liam Howlett Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Michel Lespinasse Cc: Peter Xu Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton commit 8b9c1cc0418a43196477083e7082568e7a4c9418 Author: David Hildenbrand Date: Thu Aug 3 16:32:03 2023 +0200 smaps: use vm_normal_page_pmd() instead of follow_trans_huge_pmd() We shouldn't be using a GUP-internal helper if it can be avoided. Similar to smaps_pte_entry() that uses vm_normal_page(), let's use vm_normal_page_pmd() that similarly refuses to return the huge zeropage. In contrast to follow_trans_huge_pmd(), vm_normal_page_pmd(): (1) Will always return the head page, not a tail page of a THP. If we'd ever call smaps_account with a tail page while setting "compound = true", we could be in trouble, because smaps_account() would look at the memmap of unrelated pages. If we're unlucky, that memmap does not exist at all. Before we removed PG_doublemap, we could have triggered something similar as in commit 24d7275ce279 ("fs/proc: task_mmu.c: don't read mapcount for migration entry"). This can theoretically happen ever since commit ff9f47f6f00c ("mm: proc: smaps_rollup: do not stall write attempts on mmap_lock"): (a) We're in show_smaps_rollup() and processed a VMA (b) We release the mmap lock in show_smaps_rollup() because it is contended (c) We merged that VMA with another VMA (d) We collapsed a THP in that merged VMA at that position If the end address of the original VMA falls into the middle of a THP area, we would call smap_gather_stats() with a start address that falls into a PMD-mapped THP. It's probably very rare to trigger when not really forced. (2) Will succeed on a is_pci_p2pdma_page(), like vm_normal_page() Treat such PMDs here just like smaps_pte_entry() would treat such PTEs. If such pages would be anonymous, we most certainly would want to account them. (3) Will skip over pmd_devmap(), like vm_normal_page() for pte_devmap() As noted in vm_normal_page(), that is only for handling legacy ZONE_DEVICE pages. So just like smaps_pte_entry(), we'll now also ignore such PMD entries. Especially, follow_pmd_mask() never ends up calling follow_trans_huge_pmd() on pmd_devmap(). Instead it calls follow_devmap_pmd() -- which will fail if neither FOLL_GET nor FOLL_PIN is set. So skipping pmd_devmap() pages seems to be the right thing to do. (4) Will properly handle VM_MIXEDMAP/VM_PFNMAP, like vm_normal_page() We won't be returning a memmap that should be ignored by core-mm, or worse, a memmap that does not even exist. Note that while walk_page_range() will skip VM_PFNMAP mappings, walk_page_vma() won't. Most probably this case doesn't currently really happen on the PMD level, otherwise we'd already be able to trigger kernel crashes when reading smaps / smaps_rollup. So most probably only (1) is relevant in practice as of now, but could only cause trouble in extreme corner cases. Let's move follow_trans_huge_pmd() to mm/internal.h to discourage future reuse in wrong context. Link: https://lkml.kernel.org/r/20230803143208.383663-3-david@redhat.com Fixes: ff9f47f6f00c ("mm: proc: smaps_rollup: do not stall write attempts on mmap_lock") Signed-off-by: David Hildenbrand Acked-by: Mel Gorman Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: John Hubbard Cc: Linus Torvalds Cc: liubo Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Paolo Bonzini Cc: Peter Xu Cc: Shuah Khan Signed-off-by: Andrew Morton commit d74943a2f3cdade34e471b36f55f7979be656867 Author: David Hildenbrand Date: Thu Aug 3 16:32:02 2023 +0200 mm/gup: reintroduce FOLL_NUMA as FOLL_HONOR_NUMA_FAULT Unfortunately commit 474098edac26 ("mm/gup: replace FOLL_NUMA by gup_can_follow_protnone()") missed that follow_page() and follow_trans_huge_pmd() never implicitly set FOLL_NUMA because they really don't want to fail on PROT_NONE-mapped pages -- either due to NUMA hinting or due to inaccessible (PROT_NONE) VMAs. As spelled out in commit 0b9d705297b2 ("mm: numa: Support NUMA hinting page faults from gup/gup_fast"): "Other follow_page callers like KSM should not use FOLL_NUMA, or they would fail to get the pages if they use follow_page instead of get_user_pages." liubo reported [1] that smaps_rollup results are imprecise, because they miss accounting of pages that are mapped PROT_NONE. Further, it's easy to reproduce that KSM no longer works on inaccessible VMAs on x86-64, because pte_protnone()/pmd_protnone() also indictaes "true" in inaccessible VMAs, and follow_page() refuses to return such pages right now. As KVM really depends on these NUMA hinting faults, removing the pte_protnone()/pmd_protnone() handling in GUP code completely is not really an option. To fix the issues at hand, let's revive FOLL_NUMA as FOLL_HONOR_NUMA_FAULT to restore the original behavior for now and add better comments. Set FOLL_HONOR_NUMA_FAULT independent of FOLL_FORCE in is_valid_gup_args(), to add that flag for all external GUP users. Note that there are three GUP-internal __get_user_pages() users that don't end up calling is_valid_gup_args() and consequently won't get FOLL_HONOR_NUMA_FAULT set. 1) get_dump_page(): we really don't want to handle NUMA hinting faults. It specifies FOLL_FORCE and wouldn't have honored NUMA hinting faults already. 2) populate_vma_page_range(): we really don't want to handle NUMA hinting faults. It specifies FOLL_FORCE on accessible VMAs, so it wouldn't have honored NUMA hinting faults already. 3) faultin_vma_page_range(): we similarly don't want to handle NUMA hinting faults. To make the combination of FOLL_FORCE and FOLL_HONOR_NUMA_FAULT work in inaccessible VMAs properly, we have to perform VMA accessibility checks in gup_can_follow_protnone(). As GUP-fast should reject such pages either way in pte_access_permitted()/pmd_access_permitted() -- for example on x86-64 and arm64 that both implement pte_protnone() -- let's just always fallback to ordinary GUP when stumbling over pte_protnone()/pmd_protnone(). As Linus notes [2], honoring NUMA faults might only make sense for selected GUP users. So we should really see if we can instead let relevant GUP callers specify it manually, and not trigger NUMA hinting faults from GUP as default. Prepare for that by making FOLL_HONOR_NUMA_FAULT an external GUP flag and adding appropriate documenation. While at it, remove a stale comment from follow_trans_huge_pmd(): That comment for pmd_protnone() was added in commit 2b4847e73004 ("mm: numa: serialise parallel get_user_page against THP migration"), which noted: THP does not unmap pages due to a lack of support for migration entries at a PMD level. This allows races with get_user_pages Nowadays, we do have PMD migration entries, so the comment no longer applies. Let's drop it. [1] https://lore.kernel.org/r/20230726073409.631838-1-liubo254@huawei.com [2] https://lore.kernel.org/r/CAHk-=wgRiP_9X0rRdZKT8nhemZGNateMtb366t37d8-x7VRs=g@mail.gmail.com Link: https://lkml.kernel.org/r/20230803143208.383663-2-david@redhat.com Fixes: 474098edac26 ("mm/gup: replace FOLL_NUMA by gup_can_follow_protnone()") Signed-off-by: David Hildenbrand Reported-by: liubo Closes: https://lore.kernel.org/r/20230726073409.631838-1-liubo254@huawei.com Reported-by: Peter Xu Closes: https://lore.kernel.org/all/ZMKJjDaqZ7FW0jfe@x1n/ Acked-by: Mel Gorman Acked-by: Peter Xu Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: John Hubbard Cc: Linus Torvalds Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Paolo Bonzini Cc: Shuah Khan Cc: Signed-off-by: Andrew Morton commit 67f6317dfa609846a227a706532439a22828c24b Author: Petr Oros Date: Fri Aug 11 10:07:02 2023 +0200 ice: Fix NULL pointer deref during VF reset During stress test with attaching and detaching VF from KVM and simultaneously changing VFs spoofcheck and trust there was a NULL pointer dereference in ice_reset_vf that VF's VSI is null. More than one instance of ice_reset_vf() can be running at a given time. When we rebuild the VSI in ice_reset_vf, another reset can be triaged from ice_service_task. In this case we can access the currently uninitialized VSI and cause panic. The window for this racing condition has been around for a long time but it's much worse after commit 227bf4500aaa ("ice: move VSI delete outside deconfig") because the reset runs faster. ice_reset_vf() using vf->cfg_lock and when we move this lock before accessing to the VF VSI, we can fix BUG for all cases. Panic occurs sometimes in ice_vsi_is_rx_queue_active() and sometimes in ice_vsi_stop_all_rx_rings() With our reproducer, we can hit BUG: ~8h before commit 227bf4500aaa ("ice: move VSI delete outside deconfig"). ~20m after commit 227bf4500aaa ("ice: move VSI delete outside deconfig"). After this fix we are not able to reproduce it after ~48h There was commit cf90b74341ee ("ice: Fix call trace with null VSI during VF reset") which also tried to fix this issue, but it was only partially resolved and the bug still exists. [ 6420.658415] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 6420.665382] #PF: supervisor read access in kernel mode [ 6420.670521] #PF: error_code(0x0000) - not-present page [ 6420.675659] PGD 0 [ 6420.677679] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 6420.682038] CPU: 53 PID: 326472 Comm: kworker/53:0 Kdump: loaded Not tainted 5.14.0-317.el9.x86_64 #1 [ 6420.691250] Hardware name: Dell Inc. PowerEdge R750/04V528, BIOS 1.6.5 04/15/2022 [ 6420.698729] Workqueue: ice ice_service_task [ice] [ 6420.703462] RIP: 0010:ice_vsi_is_rx_queue_active+0x2d/0x60 [ice] [ 6420.705860] ice 0000:ca:00.0: VF 0 is now untrusted [ 6420.709494] Code: 00 00 66 83 bf 76 04 00 00 00 48 8b 77 10 74 3e 31 c0 eb 0f 0f b7 97 76 04 00 00 48 83 c0 01 39 c2 7e 2b 48 8b 97 68 04 00 00 <0f> b7 0c 42 48 8b 96 20 13 00 00 48 8d 94 8a 00 00 12 00 8b 12 83 [ 6420.714426] ice 0000:ca:00.0 ens7f0: Setting MAC 22:22:22:22:22:00 on VF 0. VF driver will be reinitialized [ 6420.733120] RSP: 0018:ff778d2ff383fdd8 EFLAGS: 00010246 [ 6420.733123] RAX: 0000000000000000 RBX: ff2acf1916294000 RCX: 0000000000000000 [ 6420.733125] RDX: 0000000000000000 RSI: ff2acf1f2c6401a0 RDI: ff2acf1a27301828 [ 6420.762346] RBP: ff2acf1a27301828 R08: 0000000000000010 R09: 0000000000001000 [ 6420.769476] R10: ff2acf1916286000 R11: 00000000019eba3f R12: ff2acf19066460d0 [ 6420.776611] R13: ff2acf1f2c6401a0 R14: ff2acf1f2c6401a0 R15: 00000000ffffffff [ 6420.783742] FS: 0000000000000000(0000) GS:ff2acf28ffa80000(0000) knlGS:0000000000000000 [ 6420.791829] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 6420.797575] CR2: 0000000000000000 CR3: 00000016ad410003 CR4: 0000000000773ee0 [ 6420.804708] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 6420.811034] vfio-pci 0000:ca:01.0: enabling device (0000 -> 0002) [ 6420.811840] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 6420.811841] PKRU: 55555554 [ 6420.811842] Call Trace: [ 6420.811843] [ 6420.811844] ice_reset_vf+0x9a/0x450 [ice] [ 6420.811876] ice_process_vflr_event+0x8f/0xc0 [ice] [ 6420.841343] ice_service_task+0x23b/0x600 [ice] [ 6420.845884] ? __schedule+0x212/0x550 [ 6420.849550] process_one_work+0x1e2/0x3b0 [ 6420.853563] ? rescuer_thread+0x390/0x390 [ 6420.857577] worker_thread+0x50/0x3a0 [ 6420.861242] ? rescuer_thread+0x390/0x390 [ 6420.865253] kthread+0xdd/0x100 [ 6420.868400] ? kthread_complete_and_exit+0x20/0x20 [ 6420.873194] ret_from_fork+0x1f/0x30 [ 6420.876774] [ 6420.878967] Modules linked in: vfio_pci vfio_pci_core vfio_iommu_type1 vfio iavf vhost_net vhost vhost_iotlb tap tun xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 nft_compat nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_counter nf_tables bridge stp llc sctp ip6_udp_tunnel udp_tunnel nfp tls nfnetlink bluetooth mlx4_en mlx4_core rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs lockd grace fscache netfs rfkill sunrpc intel_rapl_msr intel_rapl_common i10nm_edac nfit libnvdimm ipmi_ssif x86_pkg_temp_thermal intel_powerclamp coretemp irdma kvm_intel i40e kvm iTCO_wdt dcdbas ib_uverbs irqbypass iTCO_vendor_support mgag200 mei_me ib_core dell_smbios isst_if_mmio isst_if_mbox_pci rapl i2c_algo_bit drm_shmem_helper intel_cstate drm_kms_helper syscopyarea sysfillrect isst_if_common sysimgblt intel_uncore fb_sys_fops dell_wmi_descriptor wmi_bmof intel_vsec mei i2c_i801 acpi_ipmi ipmi_si i2c_smbus ipmi_devintf intel_pch_thermal acpi_power_meter pcspk r Fixes: efe41860008e ("ice: Fix memory corruption in VF driver") Fixes: f23df5220d2b ("ice: Fix spurious interrupt during removal of trusted VF") Signed-off-by: Petr Oros Reviewed-by: Simon Horman Reviewed-by: Przemek Kitszel Reviewed-by: Jacob Keller Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 0ecff05e6c59dd82dbcb9706db911f7fd9f40fb8 Author: Petr Oros Date: Fri Aug 11 10:07:01 2023 +0200 Revert "ice: Fix ice VF reset during iavf initialization" This reverts commit 7255355a0636b4eff08d5e8139c77d98f151c4fc. After this commit we are not able to attach VF to VM: virsh attach-interface v0 hostdev --managed 0000:41:01.0 --mac 52:52:52:52:52:52 error: Failed to attach interface error: Cannot set interface MAC to 52:52:52:52:52:52 for ifname enp65s0f0np0 vf 0: Resource temporarily unavailable ice_check_vf_ready_for_cfg() already contain waiting for reset. New condition in ice_check_vf_ready_for_reset() causing only problems. Fixes: 7255355a0636 ("ice: Fix ice VF reset during iavf initialization") Signed-off-by: Petr Oros Reviewed-by: Simon Horman Reviewed-by: Przemek Kitszel Reviewed-by: Jacob Keller Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 10083aef784031fa9f06c19a1b182e6fad5338d9 Author: Jesse Brandeburg Date: Thu Aug 10 16:51:10 2023 -0700 ice: fix receive buffer size miscalculation The driver is misconfiguring the hardware for some values of MTU such that it could use multiple descriptors to receive a packet when it could have simply used one. Change the driver to use a round-up instead of the result of a shift, as the shift can truncate the lower bits of the size, and result in the problem noted above. It also aligns this driver with similar code in i40e. The insidiousness of this problem is that everything works with the wrong size, it's just not working as well as it could, as some MTU sizes end up using two or more descriptors, and there is no way to tell that is happening without looking at ice_trace or a bus analyzer. Fixes: efc2214b6047 ("ice: Add support for XDP") Reviewed-by: Przemek Kitszel Signed-off-by: Jesse Brandeburg Reviewed-by: Leon Romanovsky Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit c2489bb7e6be2e8cdced12c16c42fa128403ac03 Author: Zheng Yejian Date: Fri Aug 18 10:26:45 2023 +0800 tracing: Introduce pipe_cpumask to avoid race on trace_pipes There is race issue when concurrently splice_read main trace_pipe and per_cpu trace_pipes which will result in data read out being different from what actually writen. As suggested by Steven: > I believe we should add a ref count to trace_pipe and the per_cpu > trace_pipes, where if they are opened, nothing else can read it. > > Opening trace_pipe locks all per_cpu ref counts, if any of them are > open, then the trace_pipe open will fail (and releases any ref counts > it had taken). > > Opening a per_cpu trace_pipe will up the ref count for just that > CPU buffer. This will allow multiple tasks to read different per_cpu > trace_pipe files, but will prevent the main trace_pipe file from > being opened. But because we only need to know whether per_cpu trace_pipe is open or not, using a cpumask instead of using ref count may be easier. After this patch, users will find that: - Main trace_pipe can be opened by only one user, and if it is opened, all per_cpu trace_pipes cannot be opened; - Per_cpu trace_pipes can be opened by multiple users, but each per_cpu trace_pipe can only be opened by one user. And if one of them is opened, main trace_pipe cannot be opened. Link: https://lore.kernel.org/linux-trace-kernel/20230818022645.1948314-1-zhengyejian1@huawei.com Suggested-by: Steven Rostedt (Google) Signed-off-by: Zheng Yejian Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit f19df6e4de64b7fc6d71f192aa9ff3b701e4bade Author: David Michael Date: Tue Aug 15 21:42:41 2023 -0400 drm/panfrost: Skip speed binning on EOPNOTSUPP Encountered on an ARM Mali-T760 MP4, attempting to read the nvmem variable can also return EOPNOTSUPP instead of ENOENT when speed binning is unsupported. Cc: Fixes: 7d690f936e9b ("drm/panfrost: Add basic support for speed binning") Signed-off-by: David Michael Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/87msyryd7y.fsf@gmail.com commit 914d9d831e6126a6e7a92e27fcfaa250671be42c Author: Rob Herring Date: Fri Aug 18 15:40:57 2023 -0500 of: dynamic: Refactor action prints to not use "%pOF" inside devtree_lock While originally it was fine to format strings using "%pOF" while holding devtree_lock, this now causes a deadlock. Lockdep reports: of_get_parent from of_fwnode_get_parent+0x18/0x24 ^^^^^^^^^^^^^ of_fwnode_get_parent from fwnode_count_parents+0xc/0x28 fwnode_count_parents from fwnode_full_name_string+0x18/0xac fwnode_full_name_string from device_node_string+0x1a0/0x404 device_node_string from pointer+0x3c0/0x534 pointer from vsnprintf+0x248/0x36c vsnprintf from vprintk_store+0x130/0x3b4 Fix this by moving the printing in __of_changeset_entry_apply() outside the lock. As the only difference in the multiple prints is the action name, use the existing "action_names" to refactor the prints into a single print. Fixes: a92eb7621b9fb2c2 ("lib/vsprintf: Make use of fwnode API to obtain node names and separators") Cc: stable@vger.kernel.org Reported-by: Geert Uytterhoeven Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230801-dt-changeset-fixes-v3-2-5f0410e007dd@kernel.org Signed-off-by: Rob Herring commit 0aeae3788e28f64ccb95405d4dc8cd80637ffaea Author: Rob Herring Date: Fri Aug 18 15:40:56 2023 -0500 of: unittest: Fix EXPECT for parse_phandle_with_args_map() test Commit 12e17243d8a1 ("of: base: improve error msg in of_phandle_iterator_next()") added printing of the phandle value on error, but failed to update the unittest. Fixes: 12e17243d8a1 ("of: base: improve error msg in of_phandle_iterator_next()") Cc: stable@vger.kernel.org Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230801-dt-changeset-fixes-v3-1-5f0410e007dd@kernel.org Signed-off-by: Rob Herring commit 627d05a41ca1fbb9d390f9513af262f001f261f7 Author: Srinivas Goud Date: Mon Aug 21 15:00:16 2023 +0530 spi: spi-cadence: Fix data corruption issues in slave mode Remove 10us delay in cdns_spi_process_fifo() (called from cdns_spi_irq()) to fix data corruption issue on Master side when this driver configured in Slave mode, as Slave is failed to prepare the date on time due to above delay. Add 10us delay before processing the RX FIFO as TX empty doesn't guarantee valid data in RX FIFO. Signed-off-by: Srinivas Goud Reviewed-by: Charles Keepax Tested-by: Charles Keepax Link: https://lore.kernel.org/r/1692610216-217644-1-git-send-email-srinivas.goud@amd.com Signed-off-by: Mark Brown commit 715dc9a1f0c8ae0bbd4e5b37f9a165ea39e47fe9 Author: Leonard Göhrs Date: Wed Aug 16 16:52:37 2023 +0200 spi: stm32: fix accidential revert to byte-sized transfer splitting Commit 6f486556abe35 ("spi: stm32: renaming of spi_master into spi_controller") included an accidential reverted of a change added in commit 1e4929112507f ("spi: stm32: split large transfers based on word size instead of bytes"). This breaks large SPI transfers with word sizes > 8 bits, which are e.g. common when driving MIPI DBI displays. Fix this by using `spi_split_transfers_maxwords()` instead of `spi_split_transfers_maxsize()`. Fixes: 6f486556abe35 ("spi: stm32: renaming of spi_master into spi_controller") Signed-off-by: Leonard Göhrs Link: https://lore.kernel.org/r/20230816145237.3159817-1-l.goehrs@pengutronix.de Signed-off-by: Mark Brown commit a260f7d726fde52c0278bd3fa085a758639bcee2 Author: André Apitzsch Date: Sat Aug 19 09:12:15 2023 +0200 platform/x86: ideapad-laptop: Add support for new hotkeys found on ThinkBook 14s Yoga ITL The Lenovo Thinkbook 14s Yoga ITL has 4 new symbols/shortcuts on their F9-F11 and PrtSc keys: F9: Has a symbol of a head with a headset, the manual says "Service key" F10: Has a symbol of a telephone horn which has been picked up from the receiver, the manual says: "Answer incoming calls" F11: Has a symbol of a telephone horn which is resting on the receiver, the manual says: "Reject incoming calls" PrtSc: Has a symbol of a siccor and a dashed ellipse, the manual says: "Open the Windows 'Snipping' Tool app" This commit adds support for these 4 new hkey events. Signed-off-by: André Apitzsch Link: https://lore.kernel.org/r/20230819-lenovo_keys-v1-1-9d34eac88e0a@apitzsch.eu Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit db35610a181c18f7a521a2e157f7acdef7ce425f Author: Swapnil Devesh Date: Fri Aug 18 18:09:47 2023 +0530 platform/x86: lenovo-ymc: Add Lenovo Yoga 7 14ACN6 to ec_trigger_quirk_dmi_table This adds my laptop Lenovo Yoga 7 14ACN6, with Product Name: 82N7 (from `dmidecode -t1 | grep "Product Name"`) to the ec_trigger_quirk_dmi_table, have tested that this is required for the YMC driver to work correctly on this model. Signed-off-by: Swapnil Devesh Reviewed-by: Gergő Köteles Link: https://lore.kernel.org/r/18a08a8b173.895ef3b250414.1213194126082324071@sidevesh.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 453b014e2c294abf762d3bce12e91ce4b34055e6 Author: Hans de Goede Date: Mon Aug 21 11:09:27 2023 +0200 ACPI: resource: Fix IRQ override quirk for PCSpecialist Elimina Pro 16 M It turns out that some PCSpecialist Elimina Pro 16 M models have "GM6BGEQ" as DMI product-name instead of "Elimina Pro 16 M", causing the existing DMI quirk to not work on these models. The DMI board-name is always "GM6BGEQ", so match on that instead. Fixes: 56fec0051a69 ("ACPI: resource: Add IRQ override quirk for PCSpecialist Elimina Pro 16 M") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217394#c36 Cc: All applicable Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 6bc3462a0f5ecaa376a0b3d76dafc55796799e17 Author: Mario Limonciello Date: Fri Aug 18 09:48:50 2023 -0500 pinctrl: amd: Mask wake bits on probe again Shubhra reports that their laptop is heating up over s2idle. Even though it's getting into the deepest state, it appears to be having spurious wakeup events. While debugging a tangential issue with the RTC Carsten reports that recent 6.1.y based kernel face a similar problem. Looking at acpidump and GPIO register comparisons these spurious wakeup events are from the GPIO associated with the I2C touchpad on both laptops and occur even when the touchpad is not marked as a wake source by the kernel. This means that the boot firmware has programmed these bits and because Linux didn't touch them lead to spurious wakeup events from that GPIO. To fix this issue, restore most of the code that previously would clear all the bits associated with wakeup sources. This will allow the kernel to only program the wake up sources that are necessary. This is similar to what was done previously; but only the wake bits are cleared by default instead of interrupts and wake bits. If any other problems are reported then it may make sense to clear interrupts again too. Cc: Sachi King Cc: stable@vger.kernel.org Cc: Thorsten Leemhuis Fixes: 65f6c7c91cb2 ("pinctrl: amd: Revert "pinctrl: amd: disable and mask interrupts on probe"") Reported-by: Shubhra Prakash Nandi Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217754 Reported-by: Carsten Hatger Link: https://bugzilla.kernel.org/show_bug.cgi?id=217626#c28 Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20230818144850.1439-1-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit 6046c356ada95f390d7f27e12cddd06fc794ed1c Merge: 706a741595047 8fcc1c40b7470 Author: Linus Walleij Date: Mon Aug 21 12:24:33 2023 +0200 Merge tag 'renesas-pinctrl-fixes-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into fixes pinctrl: renesas: Fixes for v6.5 (take two) - Fix race conditions in pinctrl group and function creation/remove calls on the RZ/G2L, RZ/V2M, and RZ/A2 SoC families. Signed-off-by: Linus Walleij commit b98c16107cc1647242abbd11f234c05a3a5864f6 Author: Ping-Ke Shih Date: Fri Aug 18 09:40:04 2023 +0800 wifi: mac80211: limit reorder_buf_filtered to avoid UBSAN warning The commit 06470f7468c8 ("mac80211: add API to allow filtering frames in BA sessions") added reorder_buf_filtered to mark frames filtered by firmware, and it can only work correctly if hw.max_rx_aggregation_subframes <= 64 since it stores the bitmap in a u64 variable. However, new HE or EHT devices can support BlockAck number up to 256 or 1024, and then using a higher subframe index leads UBSAN warning: UBSAN: shift-out-of-bounds in net/mac80211/rx.c:1129:39 shift exponent 215 is too large for 64-bit type 'long long unsigned int' Call Trace: dump_stack_lvl+0x48/0x70 dump_stack+0x10/0x20 __ubsan_handle_shift_out_of_bounds+0x1ac/0x360 ieee80211_release_reorder_frame.constprop.0.cold+0x64/0x69 [mac80211] ieee80211_sta_reorder_release+0x9c/0x400 [mac80211] ieee80211_prepare_and_rx_handle+0x1234/0x1420 [mac80211] ieee80211_rx_list+0xaef/0xf60 [mac80211] ieee80211_rx_napi+0x53/0xd0 [mac80211] Since only old hardware that supports <=64 BlockAck uses ieee80211_mark_rx_ba_filtered_frames(), limit the use as it is, so add a WARN_ONCE() and comment to note to avoid using this function if hardware capability is not suitable. Signed-off-by: Ping-Ke Shih Link: https://lore.kernel.org/r/20230818014004.16177-1-pkshih@realtek.com [edit commit message] Signed-off-by: Johannes Berg commit d1cdbf66e18cd39dd749937221240ab97c06d9e6 Author: Sabrina Dubroca Date: Fri Aug 18 22:57:49 2023 +0200 MAINTAINERS: add entry for macsec Jakub asked if I'd be willing to be the maintainer of the macsec code and review the driver code adding macsec offload, so let's add the corresponding entry. The keyword lines are meant to catch selftests and patches adding HW offload support to other drivers. Suggested-by: Jakub Kicinski Signed-off-by: Sabrina Dubroca Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit f7757129e3dea336c407551c98f50057c22bb266 Merge: 4542057e18cae 080aa61e370b9 Author: Linus Torvalds Date: Mon Aug 21 07:02:21 2023 +0200 Merge tag 'v6.5-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: "Fix a regression in the caam driver and af_alg" * tag 'v6.5-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: fix uninit-value in af_alg_free_resources Revert "crypto: caam - adjust RNG timing to support more devices" commit 4542057e18caebe5ebaee28f0438878098674504 Author: Linus Torvalds Date: Mon Aug 21 06:11:33 2023 +0200 mm: avoid 'might_sleep()' in get_mmap_lock_carefully() This might_sleep() goes back a long time: it was originally introduced way back when by commit 010060741ad3 ("x86: add might_sleep() to do_page_fault()"), and made it into the generic VM code when the x86 fault path got re-organized and generalized in commit c2508ec5a58d ("mm: introduce new 'lock_mm_and_find_vma()' page fault helper"). However, it turns out that the placement of that might_sleep() has always been rather questionable simply because it's not only a debug statement to warn about sleeping in contexts that shouldn't sleep (which was the original reason for adding it), but it also implies a voluntary scheduling point. That, in turn, is less than desirable for two reasons: (a) it ends up being done after we successfully got the mmap_lock, so just as we got the lock we will now eagerly schedule away and increase lock contention and (b) this is all very possibly part of the "oops, things went horribly wrong" path and we just haven't figured that out yet After all, the whole _reason_ for having that get_mmap_lock_carefully() rather than just doing the obvious mmap_read_lock() is because this code wants to deal somewhat gracefully with potential kernel wild pointer bugs. So then a voluntary scheduling point here is simply not a good idea. We could certainly turn the 'might_sleep()' into a '__might_sleep()' and make it be just the debug check that it was originally intended to be. But even that seems questionable in the wild kernel pointer case - which again is part of the whole point of this code. The problem wouldn't be about the _sleeping_ part of the page fault, but about a bad kernel access. The fact that that bad kernel access might happen in a section that you shouldn't sleep in is secondary. So it really ends up being the case that this is simply entirely the wrong place to do this debug check and related scheduling point at all. So let's just remove the check entirely. It's been around for over a decade, it has served its purpose. The re-schedule will happen at return to user space anyway for the normal case, and the warning - if we even need it - might be better off done as a special case for "page fault from kernel mode" once we've dealt with any potential kernel oopses where the oops is the relevant thing, not some artificial "scheduling while atomic" test. Reported-by: Mateusz Guzik Link: https://lore.kernel.org/lkml/20230820104303.2083444-1-mjguzik@gmail.com/ Cc: Matthew Wilcox Signed-off-by: Linus Torvalds commit 144e22e7569ad78f09f354016683776e0b75e573 Author: Anh Tuan Phan Date: Sat Aug 19 00:37:02 2023 +0700 selftests/net: Add log.txt and tools to .gitignore Update .gitignore to untrack tools directory and log.txt. "tools" is generated in "selftests/net/Makefile" and log.txt is generated in "selftests/net/gro.sh" when executing run_all_tests. Signed-off-by: Anh Tuan Phan Signed-off-by: David S. Miller commit 706a741595047797872e669b3101429ab8d378ef Author: Linus Torvalds Date: Sun Aug 20 15:02:52 2023 +0200 Linux 6.5-rc7 commit f866fbc842de5976e41ba874b76ce31710b634b5 Author: Eric Dumazet Date: Sat Aug 19 03:17:07 2023 +0000 ipv4: fix data-races around inet->inet_id UDP sendmsg() is lockless, so ip_select_ident_segs() can very well be run from multiple cpus [1] Convert inet->inet_id to an atomic_t, but implement a dedicated path for TCP, avoiding cost of a locked instruction (atomic_add_return()) Note that this patch will cause a trivial merge conflict because we added inet->flags in net-next tree. v2: added missing change in drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c (David Ahern) [1] BUG: KCSAN: data-race in __ip_make_skb / __ip_make_skb read-write to 0xffff888145af952a of 2 bytes by task 7803 on cpu 1: ip_select_ident_segs include/net/ip.h:542 [inline] ip_select_ident include/net/ip.h:556 [inline] __ip_make_skb+0x844/0xc70 net/ipv4/ip_output.c:1446 ip_make_skb+0x233/0x2c0 net/ipv4/ip_output.c:1560 udp_sendmsg+0x1199/0x1250 net/ipv4/udp.c:1260 inet_sendmsg+0x63/0x80 net/ipv4/af_inet.c:830 sock_sendmsg_nosec net/socket.c:725 [inline] sock_sendmsg net/socket.c:748 [inline] ____sys_sendmsg+0x37c/0x4d0 net/socket.c:2494 ___sys_sendmsg net/socket.c:2548 [inline] __sys_sendmmsg+0x269/0x500 net/socket.c:2634 __do_sys_sendmmsg net/socket.c:2663 [inline] __se_sys_sendmmsg net/socket.c:2660 [inline] __x64_sys_sendmmsg+0x57/0x60 net/socket.c:2660 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd read to 0xffff888145af952a of 2 bytes by task 7804 on cpu 0: ip_select_ident_segs include/net/ip.h:541 [inline] ip_select_ident include/net/ip.h:556 [inline] __ip_make_skb+0x817/0xc70 net/ipv4/ip_output.c:1446 ip_make_skb+0x233/0x2c0 net/ipv4/ip_output.c:1560 udp_sendmsg+0x1199/0x1250 net/ipv4/udp.c:1260 inet_sendmsg+0x63/0x80 net/ipv4/af_inet.c:830 sock_sendmsg_nosec net/socket.c:725 [inline] sock_sendmsg net/socket.c:748 [inline] ____sys_sendmsg+0x37c/0x4d0 net/socket.c:2494 ___sys_sendmsg net/socket.c:2548 [inline] __sys_sendmmsg+0x269/0x500 net/socket.c:2634 __do_sys_sendmmsg net/socket.c:2663 [inline] __se_sys_sendmmsg net/socket.c:2660 [inline] __x64_sys_sendmmsg+0x57/0x60 net/socket.c:2660 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0x184d -> 0x184e Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 7804 Comm: syz-executor.1 Not tainted 6.5.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 ================================================================== Fixes: 23f57406b82d ("ipv4: avoid using shared IP generator for connected sockets") Reported-by: syzbot Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit f534f6581ec084fe94d6759f7672bd009794b07e Author: Jakub Kicinski Date: Fri Aug 18 18:26:02 2023 -0700 net: validate veth and vxcan peer ifindexes veth and vxcan need to make sure the ifindexes of the peer are not negative, core does not validate this. Using iproute2 with user-space-level checking removed: Before: # ./ip link add index 10 type veth peer index -1 # ip link show 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: enp1s0: mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 52:54:00:74:b2:03 brd ff:ff:ff:ff:ff:ff 10: veth1@veth0: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 8a:90:ff:57:6d:5d brd ff:ff:ff:ff:ff:ff -1: veth0@veth1: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether ae:ed:18:e6:fa:7f brd ff:ff:ff:ff:ff:ff Now: $ ./ip link add index 10 type veth peer index -1 Error: ifindex can't be negative. This problem surfaced in net-next because an explicit WARN() was added, the root cause is older. Fixes: e6f8f1a739b6 ("veth: Allow to create peer link with given ifindex") Fixes: a8f820a380a2 ("can: add Virtual CAN Tunnel driver (vxcan)") Reported-by: syzbot+5ba06978f34abb058571@syzkaller.appspotmail.com Signed-off-by: Jakub Kicinski Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit c727c6f788e673add829e4b54e7894fb2907df1c Merge: a0e026e7b37e9 32bbe64a13860 Author: David S. Miller Date: Sun Aug 20 10:58:28 2023 +0100 Merge branch 'fixed_phy_register-return-value' Ruan Jinjie says: ==================== net: Fix return value check for fixed_phy_register() The fixed_phy_register() function returns error pointers and never returns NULL. Update the checks accordingly. Changes in v3: - Drop the error fix patch for fixed_phy_get_gpiod(). - Split the error code update code into another patch set as suggested. - Update the commit title and message. ==================== Signed-off-by: David S. Miller commit 32bbe64a1386065ab2aef8ce8cae7c689d0add6e Author: Ruan Jinjie Date: Fri Aug 18 13:12:21 2023 +0800 net: bcmgenet: Fix return value check for fixed_phy_register() The fixed_phy_register() function returns error pointers and never returns NULL. Update the checks accordingly. Fixes: b0ba512e25d7 ("net: bcmgenet: enable driver to work without a device tree") Signed-off-by: Ruan Jinjie Reviewed-by: Leon Romanovsky Acked-by: Doug Berger Signed-off-by: David S. Miller commit 23a14488ea5882dea5851b65c9fce2127ee8fcad Author: Ruan Jinjie Date: Fri Aug 18 13:12:20 2023 +0800 net: bgmac: Fix return value check for fixed_phy_register() The fixed_phy_register() function returns error pointers and never returns NULL. Update the checks accordingly. Fixes: c25b23b8a387 ("bgmac: register fixed PHY for ARM BCM470X / BCM5301X chipsets") Signed-off-by: Ruan Jinjie Reviewed-by: Andrew Lunn Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit b320441c04c9bea76cbee1196ae55c20288fd7a6 Merge: ec27a636d7e1a 04c7f60ca477f Author: Linus Torvalds Date: Sun Aug 20 08:26:51 2023 +0200 Merge tag 'tty-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial fixes from Greg KH: "Here are some small tty and serial core fixes for 6.5-rc7 that resolve a lot of reported issues. Primarily in here are the fixes for the serial bus code from Tony that came in -rc1, as it hit wider testing with the huge number of different types of systems and serial ports. All of the reported issues with duplicate names and other issues with this code are now resolved. Other than that included in here is: - n_gsm fix for a previous fix - 8250 lockdep annotation fix - fsl_lpuart serial driver fix - TIOCSTI documentation update for previous CAP_SYS_ADMIN change All of these have been in linux-next for a while with no reported problems" * tag 'tty-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: core: Fix serial core port id, including multiport devices serial: 8250: drop lockdep annotation from serial8250_clear_IER() tty: n_gsm: fix the UAF caused by race condition in gsm_cleanup_mux serial: core: Revert port_id use TIOCSTI: Document CAP_SYS_ADMIN behaviour in Kconfig serial: 8250: Fix oops for port->pm on uart_change_pm() serial: 8250: Reinit port_id when adding back serial8250_isa_devs serial: core: Fix kmemleak issue for serial core device remove MAINTAINERS: Merge TTY layer and serial drivers serial: core: Fix serial_base_match() after fixing controller port name serial: core: Fix serial core controller port name to show controller id serial: core: Fix serial core port id to not use port->line serial: core: Controller id cannot be negative tty: serial: fsl_lpuart: Clear the error flags by writing 1 for lpuart32 platforms commit ec27a636d7e1aa05e64ef0b1bd848f27f8105a39 Merge: 9e6c269de404b 3fa7187eceee1 Author: Linus Torvalds Date: Sun Aug 20 08:18:58 2023 +0200 Merge tag 'rust-fixes-6.5-rc7' of https://github.com/Rust-for-Linux/linux Pull rust fix from Miguel Ojeda: - Macros: fix 'HAS_*' redefinition by the '#[vtable]' macro under conditional compilation * tag 'rust-fixes-6.5-rc7' of https://github.com/Rust-for-Linux/linux: rust: macros: vtable: fix `HAS_*` redefinition (`gen_const_name`) commit a0e026e7b37e997f4fa3fcaa714e5484f3ce9e75 Author: Serge Semin Date: Fri Aug 18 15:54:45 2023 +0300 net: phy: Fix deadlocking in phy_error() invocation Since commit 91a7cda1f4b8 ("net: phy: Fix race condition on link status change") all the phy_error() method invocations have been causing the nested-mutex-lock deadlock because it's normally done in the PHY-driver threaded IRQ handlers which since that change have been called with the phydev->lock mutex held. Here is the calls thread: IRQ: phy_interrupt() +-> mutex_lock(&phydev->lock); <--------------------+ drv->handle_interrupt() | Deadlock due +-> ERROR: phy_error() + to the nested +-> phy_process_error() | mutex lock +-> mutex_lock(&phydev->lock); <-+ phydev->state = PHY_ERROR; mutex_unlock(&phydev->lock); mutex_unlock(&phydev->lock); The problem can be easily reproduced just by calling phy_error() from any PHY-device threaded interrupt handler. Fix it by dropping the phydev->lock mutex lock from the phy_process_error() method and printing a nasty error message to the system log if the mutex isn't held in the caller execution context. Note for the fix to work correctly in the PHY-subsystem itself the phydev->lock mutex locking must be added to the phy_error_precise() function. Link: https://lore.kernel.org/netdev/20230816180944.19262-1-fancer.lancer@gmail.com Fixes: 91a7cda1f4b8 ("net: phy: Fix race condition on link status change") Suggested-by: Andrew Lunn Signed-off-by: Serge Semin Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit db1a6ad77c180efc7242d7204b9a0c72c8a5a1bb Author: Josua Mayer Date: Fri Aug 18 13:05:56 2023 +0200 net: sfp: handle 100G/25G active optical cables in sfp_parse_support Handle extended compliance code 0x1 (SFF8024_ECC_100G_25GAUI_C2M_AOC) for active optical cables supporting 25G and 100G speeds. Since the specification makes no statement about transmitter range, and as the specific sfp module that had been tested features only 2m fiber - short-range (SR) modes are selected. The 100G speed is irrelevant because it would require multiple fibers / multiple SFP28 modules combined under one netdev. sfp-bus.c only handles a single module per netdev, so only 25Gbps modes are selected. sfp_parse_support already handles SFF8024_ECC_100GBASE_SR4_25GBASE_SR with compatible properties, however that entry is a contradiction in itself since with SFP(28) 100GBASE_SR4 is impossible - that would likely be a mode for qsfp modules only. Add a case for SFF8024_ECC_100G_25GAUI_C2M_AOC selecting 25gbase-r interface mode and 25000baseSR link mode. Also enforce SFP28 bitrate limits on the values read from sfp eeprom as requested by Russell King. Tested with fs.com S28-AO02 AOC SFP28 module. Signed-off-by: Josua Mayer Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 9e6c269de404bef2fb50b9407e988083a0805e3b Merge: 12e6ccedb311b 4caf4cb1eaed4 Author: Linus Torvalds Date: Sat Aug 19 19:22:41 2023 +0200 Merge tag 'i2c-for-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "Usual set of driver fixes. A bit more than usual because I was unavailable for a while" * tag 'i2c-for-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: bcm-iproc: Fix bcm_iproc_i2c_isr deadlock issue i2c: Update documentation to use .probe() again i2c: sun6i-p2wi: Fix an error message in probe() i2c: hisi: Only handle the interrupt of the driver's transfer i2c: tegra: Fix i2c-tegra DMA config option processing i2c: tegra: Fix failure during probe deferral cleanup i2c: designware: Handle invalid SMBus block data response length value i2c: designware: Correct length byte validation logic i2c: imx-lpi2c: return -EINVAL when i2c peripheral clk doesn't work commit 12e6ccedb311b32b16f767fdd606cc84630e45ae Merge: b5cab28be6ccf c962098ca4af1 Author: Linus Torvalds Date: Sat Aug 19 17:57:07 2023 +0200 Merge tag 'for-6.5-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - fix infinite loop in readdir(), could happen in a big directory when files get renamed during enumeration - fix extent map handling of skipped pinned ranges - fix a corner case when handling ordered extent length - fix a potential crash when balance cancel races with pause - verify correct uuid when starting scrub or device replace * tag 'for-6.5-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: fix incorrect splitting in btrfs_drop_extent_map_range btrfs: fix BUG_ON condition in btrfs_cancel_balance btrfs: only subtract from len_to_oe_boundary when it is tracking an extent btrfs: fix replace/scrub failure with metadata_uuid btrfs: fix infinite directory reads commit b5cab28be6ccf08237078b675fc1d446679779ba Merge: 2383ffc41a7c7 0650d5098f8b6 Author: Linus Torvalds Date: Sat Aug 19 17:43:55 2023 +0200 Merge tag 'fbdev-for-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev fixes and cleanups from Helge Deller: - various code cleanups in amifb, atmel_lcdfb, ssd1307fb, kyro and goldfishfb * tag 'fbdev-for-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbdev: goldfishfb: Do not check 0 for platform_get_irq() fbdev: atmel_lcdfb: Remove redundant of_match_ptr() fbdev: kyro: Remove unused declarations fbdev: ssd1307fb: Print the PWM's label instead of its number fbdev: mmp: fix value check in mmphw_probe() fbdev: amifb: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper commit 2383ffc41a7c701c058f6bb18030cd569aecd541 Merge: aa9ea98cca3a5 e5c0ca13659e9 Author: Linus Torvalds Date: Sat Aug 19 17:31:46 2023 +0200 Merge tag 'block-6.5-2023-08-19' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: "Main thing here is the fix for the regression in flush handling which caused IO hangs/stalls for a few reporters. Hopefully that should all be sorted out now. Outside of that, just a few minor fixes for issues that were introduced in this cycle" * tag 'block-6.5-2023-08-19' of git://git.kernel.dk/linux: blk-mq: release scheduler resource when request completes blk-crypto: dynamically allocate fallback profile blk-cgroup: hold queue_lock when removing blkg->q_node drivers/rnbd: restore sysfs interface to rnbd-client commit 895cedc1791916e8a98864f12b656702fad0bb67 Author: Chuck Lever Date: Mon Jul 3 14:18:29 2023 -0400 xprtrdma: Remap Receive buffers after a reconnect On server-initiated disconnect, rpcrdma_xprt_disconnect() was DMA- unmapping the Receive buffers, but rpcrdma_post_recvs() neglected to remap them after a new connection had been established. The result was immediate failure of the new connection with the Receives flushing with LOCAL_PROT_ERR. Fixes: 671c450b6fe0 ("xprtrdma: Fix oops in Receive handler after device removal") Signed-off-by: Chuck Lever Signed-off-by: Trond Myklebust commit f4e89f1a6dab4c063fc1e823cc9dddc408ff40cf Author: Fedor Pchelkin Date: Tue Jul 25 14:59:30 2023 +0300 NFSv4: fix out path in __nfs4_get_acl_uncached Another highly rare error case when a page allocating loop (inside __nfs4_get_acl_uncached, this time) is not properly unwound on error. Since pages array is allocated being uninitialized, need to free only lower array indices. NULL checks were useful before commit 62a1573fcf84 ("NFSv4 fix acl retrieval over krb5i/krb5p mounts") when the array had been initialized to zero on stack. Found by Linux Verification Center (linuxtesting.org). Fixes: 62a1573fcf84 ("NFSv4 fix acl retrieval over krb5i/krb5p mounts") Signed-off-by: Fedor Pchelkin Reviewed-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit 4e3733fd2b0f677faae21cf838a43faf317986d3 Author: Fedor Pchelkin Date: Tue Jul 25 14:58:58 2023 +0300 NFSv4.2: fix error handling in nfs42_proc_getxattr There is a slight issue with error handling code inside nfs42_proc_getxattr(). If page allocating loop fails then we free the failing page array element which is NULL but __free_page() can't deal with NULL args. Found by Linux Verification Center (linuxtesting.org). Fixes: a1f26739ccdc ("NFSv4.2: improve page handling for GETXATTR") Signed-off-by: Fedor Pchelkin Reviewed-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit c3dd7de2a3137d84161dcfb522c19f8b2884e502 Author: Benjamin Coddington Date: Mon Jul 10 14:41:58 2023 -0400 NFS: Fix sysfs server name memory leak Free the formatted server index string after it has been duplicated by kobject_rename(). Fixes: 1c7251187dc0 ("NFS: add superblock sysfs entries") Reported-by: Alexander Aring Signed-off-by: Benjamin Coddington Tested-by: Ido Schimmel Signed-off-by: Trond Myklebust commit e5c0ca13659e9d18f53368d651ed7e6e433ec1cf Author: Chengming Zhou Date: Sun Aug 13 23:23:25 2023 +0800 blk-mq: release scheduler resource when request completes Chuck reported [1] an IO hang problem on NFS exports that reside on SATA devices and bisected to commit 615939a2ae73 ("blk-mq: defer to the normal submission path for post-flush requests"). We analysed the IO hang problem, found there are two postflush requests waiting for each other. The first postflush request completed the REQ_FSEQ_DATA sequence, so go to the REQ_FSEQ_POSTFLUSH sequence and added in the flush pending list, but failed to blk_kick_flush() because of the second postflush request which is inflight waiting in scheduler queue. The second postflush waiting in scheduler queue can't be dispatched because the first postflush hasn't released scheduler resource even though it has completed by itself. Fix it by releasing scheduler resource when the first postflush request completed, so the second postflush can be dispatched and completed, then make blk_kick_flush() succeed. While at it, remove the check for e->ops.finish_request, as all schedulers set that. Reaffirm this requirement by adding a WARN_ON_ONCE() at scheduler registration time, just like we do for insert_requests and dispatch_request. [1] https://lore.kernel.org/all/7A57C7AE-A51A-4254-888B-FE15CA21F9E9@oracle.com/ Link: https://lore.kernel.org/linux-block/20230819031206.2744005-1-chengming.zhou@linux.dev/ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202308172100.8ce4b853-oliver.sang@intel.com Fixes: 615939a2ae73 ("blk-mq: defer to the normal submission path for post-flush requests") Reported-by: Chuck Lever Signed-off-by: Chengming Zhou Tested-by: Chuck Lever Link: https://lore.kernel.org/r/20230813152325.3017343-1-chengming.zhou@linux.dev [axboe: folded in incremental fix and added tags] Signed-off-by: Jens Axboe commit 2572ce62415cf3b632391091447252e2661ed520 Author: Serge Semin Date: Wed Aug 16 21:06:52 2023 +0300 net: mdio: mdio-bitbang: Fix C45 read/write protocol Based on the original code semantic in case of Clause 45 MDIO, the address command is supposed to be followed by the command sending the MMD address, not the CSR address. The commit 002dd3de097c ("net: mdio: mdio-bitbang: Separate C22 and C45 transactions") has erroneously broken that. So most likely due to an unfortunate variable name it switched the code to sending the CSR address. In our case it caused the protocol malfunction so the read operation always failed with the turnaround bit always been driven to one by PHY instead of zero. Fix that by getting back the correct behaviour: sending MMD address command right after the regular address command. Fixes: 002dd3de097c ("net: mdio: mdio-bitbang: Separate C22 and C45 transactions") Signed-off-by: Serge Semin Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit e94b590abfff2cdbf0bdaa7d9904364c8d480af5 Author: Arınç ÜNAL Date: Sun Aug 13 13:59:17 2023 +0300 net: dsa: mt7530: fix handling of 802.1X PAE frames 802.1X PAE frames are link-local frames, therefore they must be trapped to the CPU port. Currently, the MT753X switches treat 802.1X PAE frames as regular multicast frames, therefore flooding them to user ports. To fix this, set 802.1X PAE frames to be trapped to the CPU port(s). Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch") Signed-off-by: Arınç ÜNAL Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit aa9ea98cca3a56869df1dc6347f3e3bfe0c01f44 Merge: bf98bae3d8a18 2908042a37b56 Author: Linus Torvalds Date: Sat Aug 19 13:13:55 2023 +0200 Merge tag 'media/v6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: "Three driver fixes" * tag 'media/v6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: imx: imx7-media-csi: Fix applying format constraints media: uvcvideo: Fix menu count handling for userspace XU mappings media: mtk-jpeg: Set platform driver data earlier commit bf98bae3d8a18745e54fef9fd71fd129f6e9f7e5 Merge: 4e7ffde6984a7 6405b72e8d17b Author: Linus Torvalds Date: Sat Aug 19 10:46:02 2023 +0200 Merge tag 'x86_urgent_for_v6.5_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: "Extraordinary embargoed times call for extraordinary measures. That's why this week's x86/urgent branch is larger than usual, containing all the known fallout fixes after the SRSO mitigation got merged. I know, it is a bit late in the game but everyone who has reported a bug stemming from the SRSO pile, has tested that branch and has confirmed that it fixes their bug. Also, I've run it on every possible hardware I have and it is looking good. It is running on this very machine while I'm typing, for 2 days now without an issue. Famous last words... - Use LEA ...%rsp instead of ADD %rsp in the Zen1/2 SRSO return sequence as latter clobbers flags which interferes with fastop emulation in KVM, leading to guests freezing during boot - A fix for the DIV(0) quotient data leak on Zen1 to clear the divider buffers at the right time - Disable the SRSO mitigation on unaffected configurations as it got enabled there unnecessarily - Change .text section name to fix CONFIG_LTO_CLANG builds - Improve the optprobe indirect jmp check so that certain configurations can still be able to use optprobes at all - A serious and good scrubbing of the untraining routines by PeterZ: - Add proper speculation stopping traps so that objtool is happy - Adjust objtool to handle the new thunks - Make the thunk pointer assignable to the different untraining sequences at runtime, thus avoiding the alternative at the return thunk. It simplifies the code a bit too. - Add a entry_untrain_ret() main entry point which selects the respective untraining sequence - Rename things so that they're more clear - Fix stack validation with FRAME_POINTER=y builds - Fix static call patching to handle when a JMP to the return thunk is the last insn on the very last module memory page - Add more documentation about what each untraining routine does and why" * tag 'x86_urgent_for_v6.5_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/srso: Correct the mitigation status when SMT is disabled x86/static_call: Fix __static_call_fixup() objtool/x86: Fixup frame-pointer vs rethunk x86/srso: Explain the untraining sequences a bit more x86/cpu/kvm: Provide UNTRAIN_RET_VM x86/cpu: Cleanup the untrain mess x86/cpu: Rename srso_(.*)_alias to srso_alias_\1 x86/cpu: Rename original retbleed methods x86/cpu: Clean up SRSO return thunk mess x86/alternative: Make custom return thunk unconditional objtool/x86: Fix SRSO mess x86/cpu: Fix up srso_safe_ret() and __x86_return_thunk() x86/cpu: Fix __x86_return_thunk symbol type x86/retpoline,kprobes: Skip optprobe check for indirect jumps with retpolines and IBT x86/retpoline,kprobes: Fix position of thunk sections with CONFIG_LTO_CLANG x86/srso: Disable the mitigation on unaffected configurations x86/CPU/AMD: Fix the DIV(0) initial fix attempt x86/retpoline: Don't clobber RFLAGS during srso_safe_ret() commit 4e7ffde6984a7fa842489be7055570e5f5a4f0b5 Merge: d4ddefee5160d 4f3175979e62d Author: Linus Torvalds Date: Sat Aug 19 08:32:16 2023 +0200 Merge tag 'powerpc-6.5-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fix from Michael Ellerman: - Fix hardened usercopy BUG when using /proc based firmware update interface Thanks to Nathan Lynch and Kees Cook. * tag 'powerpc-6.5-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/rtas_flash: allow user copy to flash block cache objects commit cfceccca0157307318905907fd7a4d4231494de7 Merge: 043d5f68d0ccd f520489e99a35 Author: Jakub Kicinski Date: Fri Aug 18 19:41:10 2023 -0700 Merge branch 'mlxsw-fixes-for-spectrum-4' Petr Machata says: ==================== mlxsw: Fixes for Spectrum-4 This patchset contains an assortment of fixes for mlxsw Spectrum-4 support. ==================== Link: https://lore.kernel.org/r/cover.1692268427.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit f520489e99a35b0a5257667274fbe9afd2d8c50b Author: Ido Schimmel Date: Thu Aug 17 15:58:25 2023 +0200 selftests: mlxsw: Fix test failure on Spectrum-4 Remove assumptions about shared buffer cell size and instead query the cell size from devlink. Adjust the test to send small packets that fit inside a single cell. Tested on Spectrum-{1,2,3,4}. Fixes: 4735402173e6 ("mlxsw: spectrum: Extend to support Spectrum-4 ASIC") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/f7dfbf3c4d1cb23838d9eb99bab09afaa320c4ca.1692268427.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 348c976be0a599918b88729def198a843701c9fe Author: Amit Cohen Date: Thu Aug 17 15:58:24 2023 +0200 mlxsw: Fix the size of 'VIRT_ROUTER_MSB' The field 'virtual router' was extended to 12 bits in Spectrum-4. Therefore, the element 'MLXSW_AFK_ELEMENT_VIRT_ROUTER_MSB' needs 3 bits for Spectrum < 4 and 4 bits for Spectrum >= 4. The elements are stored in an internal storage scratchpad. Currently, the MSB is defined there as 3 bits. It means that for Spectrum-4, only 2K VRFs can be used for multicast routing, as the highest bit is not really used by the driver. Fix the definition of 'VIRT_ROUTER_MSB' to use 4 bits. Adjust the definitions of 'virtual router' field in the blocks accordingly - use '_avoid_size_check' for Spectrum-2 instead of for Spectrum-4. Fix the mask in parse function to use 4 bits. Fixes: 6d5d8ebb881c ("mlxsw: Rename virtual router flex key element") Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/79bed2b70f6b9ed58d4df02e9798a23da648015b.1692268427.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 0dc63b9cfd4c5666ced52c829fdd65dcaeb9f0f1 Author: Ido Schimmel Date: Thu Aug 17 15:58:23 2023 +0200 mlxsw: reg: Fix SSPR register layout The two most significant bits of the "local_port" field in the SSPR register are always cleared since they are overwritten by the deprecated and overlapping "sub_port" field. On systems with more than 255 local ports (e.g., Spectrum-4), this results in the firmware maintaining invalid mappings between system port and local port. Specifically, two different systems ports (0x1 and 0x101) point to the same local port (0x1), which eventually leads to firmware errors. Fix by removing the deprecated "sub_port" field. Fixes: fd24b29a1b74 ("mlxsw: reg: Align existing registers to use extended local_port field") Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/9b909a3033c8d3d6f67f237306bef4411c5e6ae4.1692268427.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit bc2de151ab6ad0762a04563527ec42e54dde572a Author: Danielle Ratson Date: Thu Aug 17 15:58:22 2023 +0200 mlxsw: pci: Set time stamp fields also when its type is MIRROR_UTC Currently, in Spectrum-2 and above, time stamps are extracted from the CQE into the time stamp fields in 'struct mlxsw_skb_cb', only when the CQE time stamp type is UTC. The time stamps are read directly from the CQE and software can get the time stamp in UTC format using CQEv2. From Spectrum-4, the time stamps that are read from the CQE are allowed to be also from MIRROR_UTC type. Therefore, we get a warning [1] from the driver that the time stamp fields were not set, when LLDP control packet is sent. Allow the time stamp type to be MIRROR_UTC and set the time stamp in this case as well. [1] WARNING: CPU: 11 PID: 0 at drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c:1409 mlxsw_sp2_ptp_hwtstamp_fill+0x1f/0x70 [mlxsw_spectrum] [...] Call Trace: mlxsw_sp2_ptp_receive+0x3c/0x80 [mlxsw_spectrum] mlxsw_core_skb_receive+0x119/0x190 [mlxsw_core] mlxsw_pci_cq_tasklet+0x3c9/0x780 [mlxsw_pci] tasklet_action_common.constprop.0+0x9f/0x110 __do_softirq+0xbb/0x296 irq_exit_rcu+0x79/0xa0 common_interrupt+0x86/0xa0 Fixes: 4735402173e6 ("mlxsw: spectrum: Extend to support Spectrum-4 ASIC") Signed-off-by: Danielle Ratson Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/bcef4d044ef608a4e258d33a7ec0ecd91f480db5.1692268427.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 043d5f68d0ccdda91029b4b6dce7eeffdcfad281 Author: Lu Wei Date: Thu Aug 17 22:54:49 2023 +0800 ipvlan: Fix a reference count leak warning in ipvlan_ns_exit() There are two network devices(veth1 and veth3) in ns1, and ipvlan1 with L3S mode and ipvlan2 with L2 mode are created based on them as figure (1). In this case, ipvlan_register_nf_hook() will be called to register nf hook which is needed by ipvlans in L3S mode in ns1 and value of ipvl_nf_hook_refcnt is set to 1. (1) ns1 ns2 ------------ ------------ veth1--ipvlan1 (L3S) veth3--ipvlan2 (L2) (2) ns1 ns2 ------------ ------------ veth1--ipvlan1 (L3S) ipvlan2 (L2) veth3 | | |------->-------->--------->-------- migrate When veth3 migrates from ns1 to ns2 as figure (2), veth3 will register in ns2 and calls call_netdevice_notifiers with NETDEV_REGISTER event: dev_change_net_namespace call_netdevice_notifiers ipvlan_device_event ipvlan_migrate_l3s_hook ipvlan_register_nf_hook(newnet) (I) ipvlan_unregister_nf_hook(oldnet) (II) In function ipvlan_migrate_l3s_hook(), ipvl_nf_hook_refcnt in ns1 is not 0 since veth1 with ipvlan1 still in ns1, (I) and (II) will be called to register nf_hook in ns2 and unregister nf_hook in ns1. As a result, ipvl_nf_hook_refcnt in ns1 is decreased incorrectly and this in ns2 is increased incorrectly. When the second net namespace is removed, a reference count leak warning in ipvlan_ns_exit() will be triggered. This patch add a check before ipvlan_migrate_l3s_hook() is called. The warning can be triggered as follows: $ ip netns add ns1 $ ip netns add ns2 $ ip netns exec ns1 ip link add veth1 type veth peer name veth2 $ ip netns exec ns1 ip link add veth3 type veth peer name veth4 $ ip netns exec ns1 ip link add ipv1 link veth1 type ipvlan mode l3s $ ip netns exec ns1 ip link add ipv2 link veth3 type ipvlan mode l2 $ ip netns exec ns1 ip link set veth3 netns ns2 $ ip net del ns2 Fixes: 3133822f5ac1 ("ipvlan: use pernet operations and restrict l3s hooks to master netns") Signed-off-by: Lu Wei Reviewed-by: Florian Westphal Link: https://lore.kernel.org/r/20230817145449.141827-1-luwei32@huawei.com Signed-off-by: Jakub Kicinski commit cba3f1786916063261e3e5ccbb803abc325b24ef Author: Eric Dumazet Date: Fri Aug 18 01:58:20 2023 +0000 dccp: annotate data-races in dccp_poll() We changed tcp_poll() over time, bug never updated dccp. Note that we also could remove dccp instead of maintaining it. Fixes: 7c657876b63c ("[DCCP]: Initial implementation") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230818015820.2701595-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 76f33296d2e09f63118db78125c95ef56df438e9 Author: Eric Dumazet Date: Fri Aug 18 01:51:32 2023 +0000 sock: annotate data-races around prot->memory_pressure *prot->memory_pressure is read/writen locklessly, we need to add proper annotations. A recent commit added a new race, it is time to audit all accesses. Fixes: 2d0c88e84e48 ("sock: Fix misuse of sk_under_memory_pressure()") Fixes: 4d93df0abd50 ("[SCTP]: Rewrite of sctp buffer management code") Signed-off-by: Eric Dumazet Cc: Abel Wu Reviewed-by: Shakeel Butt Link: https://lore.kernel.org/r/20230818015132.2699348-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit d44036cad31170da0cb9c728e80743f84267da6e Author: Vladimir Oltean Date: Thu Aug 17 15:01:11 2023 +0300 net: dsa: felix: fix oversize frame dropping for always closed tc-taprio gates The blamed commit resolved a bug where frames would still get stuck at egress, even though they're smaller than the maxSDU[tc], because the driver did not take into account the extra 33 ns that the queue system needs for scheduling the frame. It now takes that into account, but the arithmetic that we perform in vsc9959_tas_remaining_gate_len_ps() is buggy, because we operate on 64-bit unsigned integers, so gate_len_ns - VSC9959_TAS_MIN_GATE_LEN_NS may become a very large integer if gate_len_ns < 33 ns. In practice, this means that we've introduced a regression where all traffic class gates which are permanently closed will not get detected by the driver, and we won't enable oversize frame dropping for them. Before: mscc_felix 0000:00:00.5: port 0: max frame size 1526 needs 12400000 ps, 1152000 ps for mPackets at speed 1000 mscc_felix 0000:00:00.5: port 0 tc 0 min gate len 1000000, sending all frames mscc_felix 0000:00:00.5: port 0 tc 1 min gate len 0, sending all frames mscc_felix 0000:00:00.5: port 0 tc 2 min gate len 0, sending all frames mscc_felix 0000:00:00.5: port 0 tc 3 min gate len 0, sending all frames mscc_felix 0000:00:00.5: port 0 tc 4 min gate len 0, sending all frames mscc_felix 0000:00:00.5: port 0 tc 5 min gate len 0, sending all frames mscc_felix 0000:00:00.5: port 0 tc 6 min gate len 0, sending all frames mscc_felix 0000:00:00.5: port 0 tc 7 min gate length 5120 ns not enough for max frame size 1526 at 1000 Mbps, dropping frames over 615 octets including FCS After: mscc_felix 0000:00:00.5: port 0: max frame size 1526 needs 12400000 ps, 1152000 ps for mPackets at speed 1000 mscc_felix 0000:00:00.5: port 0 tc 0 min gate len 1000000, sending all frames mscc_felix 0000:00:00.5: port 0 tc 1 min gate length 0 ns not enough for max frame size 1526 at 1000 Mbps, dropping frames over 1 octets including FCS mscc_felix 0000:00:00.5: port 0 tc 2 min gate length 0 ns not enough for max frame size 1526 at 1000 Mbps, dropping frames over 1 octets including FCS mscc_felix 0000:00:00.5: port 0 tc 3 min gate length 0 ns not enough for max frame size 1526 at 1000 Mbps, dropping frames over 1 octets including FCS mscc_felix 0000:00:00.5: port 0 tc 4 min gate length 0 ns not enough for max frame size 1526 at 1000 Mbps, dropping frames over 1 octets including FCS mscc_felix 0000:00:00.5: port 0 tc 5 min gate length 0 ns not enough for max frame size 1526 at 1000 Mbps, dropping frames over 1 octets including FCS mscc_felix 0000:00:00.5: port 0 tc 6 min gate length 0 ns not enough for max frame size 1526 at 1000 Mbps, dropping frames over 1 octets including FCS mscc_felix 0000:00:00.5: port 0 tc 7 min gate length 5120 ns not enough for max frame size 1526 at 1000 Mbps, dropping frames over 615 octets including FCS Fixes: 11afdc6526de ("net: dsa: felix: tc-taprio intervals smaller than MTU should send at least one packet") Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230817120111.3522827-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 2ebbc9752d06bb1d01201fe632cb6da033b0248d Author: Jiri Pirko Date: Thu Aug 17 14:52:40 2023 +0200 devlink: add missing unregister linecard notification Cited fixes commit introduced linecard notifications for register, however it didn't add them for unregister. Fix that by adding them. Fixes: c246f9b5fd61 ("devlink: add support to create line card and expose to user") Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230817125240.2144794-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 3b1f08833c45d0167741e4097b0150e7cf086102 Author: BrenoRCBrito Date: Fri Aug 18 18:14:16 2023 -0300 ASoC: amd: yc: Add VivoBook Pro 15 to quirks list for acp6x VivoBook Pro 15 Ryzen Edition uses Ryzen 6800H processor, and adding to quirks list for acp6x will enable internal mic. Signed-off-by: BrenoRCBrito Link: https://lore.kernel.org/r/20230818211417.32167-1-brenorcbrito@gmail.com Signed-off-by: Mark Brown commit 05f3d5bc23524bed6f043dfe6b44da687584f9fb Author: Hariprasad Kelam Date: Thu Aug 17 12:00:06 2023 +0530 octeontx2-af: SDP: fix receive link config On SDP interfaces, frame oversize and undersize errors are observed as driver is not considering packet sizes of all subscribers of the link before updating the link config. This patch fixes the same. Fixes: 9b7dd87ac071 ("octeontx2-af: Support to modify min/max allowed packet lengths") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Goutham Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20230817063006.10366-1-hkelam@marvell.com Signed-off-by: Jakub Kicinski commit 7793a88e881ffd4cde6d14eadc6485931d12a4cc Merge: 0e8860d2125f5 421d467dc2d48 Author: Jakub Kicinski Date: Fri Aug 18 15:16:04 2023 -0700 Merge tag 'batadv-net-pullrequest-20230816' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== Here are some batman-adv bugfixes: - Fix issues with adjusted MTUs (2 patches), by Sven Eckelmann - Fix header access for memory reallocation case, by Remi Pommarel - Fix two memory leaks (2 patches), by Remi Pommarel * tag 'batadv-net-pullrequest-20230816' of git://git.open-mesh.org/linux-merge: batman-adv: Fix batadv_v_ogm_aggr_send memory leak batman-adv: Fix TT global entry leak when client roamed back batman-adv: Do not get eth header before batadv_check_management_packet batman-adv: Don't increase MTU when set by user batman-adv: Trigger events for auto adjusted MTU ==================== Link: https://lore.kernel.org/r/20230816163318.189996-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski commit c984ff1423ae9f70b1f28ce811856db0d9c99021 Author: Sweet Tea Dorminy Date: Thu Aug 17 10:15:56 2023 -0400 blk-crypto: dynamically allocate fallback profile blk_crypto_profile_init() calls lockdep_register_key(), which warns and does not register if the provided memory is a static object. blk-crypto-fallback currently has a static blk_crypto_profile and calls blk_crypto_profile_init() thereupon, resulting in the warning and failure to register. Fortunately it is simple enough to use a dynamically allocated profile and make lockdep function correctly. Fixes: 2fb48d88e77f ("blk-crypto: use dynamic lock class for blk_crypto_profile::lock") Cc: stable@vger.kernel.org Signed-off-by: Sweet Tea Dorminy Reviewed-by: Eric Biggers Link: https://lore.kernel.org/r/20230817141615.15387-1-sweettea-kernel@dorminy.me Signed-off-by: Jens Axboe commit c164c7bc9775be7bcc68754bb3431fce5823822e Author: Ming Lei Date: Thu Aug 17 22:17:51 2023 +0800 blk-cgroup: hold queue_lock when removing blkg->q_node When blkg is removed from q->blkg_list from blkg_free_workfn(), queue_lock has to be held, otherwise, all kinds of bugs(list corruption, hard lockup, ..) can be triggered from blkg_destroy_all(). Fixes: f1c006f1c685 ("blk-cgroup: synchronize pd_free_fn() from blkg_free_workfn() and blkcg_deactivate_policy()") Cc: Yu Kuai Cc: xiaoli feng Cc: Chunyu Hu Cc: Mike Snitzer Cc: Tejun Heo Signed-off-by: Ming Lei Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230817141751.1128970-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 6548fce05803262ab43241b61dee3e2982486e4b Author: Li Zhijian Date: Wed Aug 16 10:22:10 2023 +0800 drivers/rnbd: restore sysfs interface to rnbd-client Commit 137380c0ec40 renamed 'rnbd-client' to 'rnbd_client', this changed sysfs interface to /sys/devices/virtual/rnbd_client/ctl/map_device from /sys/devices/virtual/rnbd-client/ctl/map_device. CC: Ivan Orlov CC: "Md. Haris Iqbal" CC: Jack Wang Fixes: 137380c0ec40 ("block/rnbd: make all 'class' structures const") Signed-off-by: Li Zhijian Acked-by: Jack Wang Link: https://lore.kernel.org/r/20230816022210.2501228-1-lizhijian@fujitsu.com Signed-off-by: Jens Axboe commit 70d91dc9b2ac91327d0eefd86163abc3548effa6 Author: Christian Göttsche Date: Fri Aug 18 17:33:58 2023 +0200 selinux: set next pointer before attaching to list Set the next pointer in filename_trans_read_helper() before attaching the new node under construction to the list, otherwise garbage would be dereferenced on subsequent failure during cleanup in the out goto label. Cc: Fixes: 430059024389 ("selinux: implement new format of filename transitions") Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit d4ddefee5160dc477d0e30c9d7a10ce8861c3007 Merge: 3e13eee10521b 2f43f549cd0b3 Author: Linus Torvalds Date: Fri Aug 18 20:52:25 2023 +0200 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: "Two more SME fixes related to ptrace(): ensure that the SME is properly set up for the target thread and that the thread sees the ZT registers set via ptrace" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/ptrace: Ensure that the task sees ZT writes on first use arm64/ptrace: Ensure that SME is set up for target when writing SSVE state commit 3e13eee10521b236b6b96a0e1d7f29c6bf2fd989 Merge: 8abd7287db923 3386fb86ecdef Author: Linus Torvalds Date: Fri Aug 18 20:36:49 2023 +0200 Merge tag 'gpio-fixes-for-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix a regression in the sysfs interface - fix a reference counting bug that's been around for years - MAINTAINERS update * tag 'gpio-fixes-for-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpiolib: fix reference leaks when removing GPIO chips still in use gpiolib: sysfs: Do unexport GPIO when user asks for it MAINTAINERS: add content regex for gpio-regmap commit 8abd7287db9231485261d36c17d77f044de32d20 Merge: cd479d9c72681 270d73e6507f9 Author: Linus Torvalds Date: Fri Aug 18 19:41:12 2023 +0200 Merge tag '6.5-rc6-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fix from Steve French: "A small SMB mount option fix, also for stable" * tag '6.5-rc6-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6: smb: client: fix null auth commit cd479d9c72681606cbfaf1b77629187fe904cbee Merge: ce03e1807c1f7 ca09f772cccae Author: Linus Torvalds Date: Fri Aug 18 19:26:53 2023 +0200 Merge tag 'riscv-for-linus-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - avoid excessive rejections from seccomp RET_ERRNO rules - compressed jal/jalr decoding fix - fixes for independent irq/softirq stacks on kernels built with CONFIG_FRAME_POINTER=n - avoid a hang handling uaccess fixups - another build fix for toolchain ISA strings, this time for Zicsr and Zifenci on old GNU toolchains * tag 'riscv-for-linus-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Handle zicsr/zifencei issue between gcc and binutils riscv: uaccess: Return the number of bytes effectively not copied riscv: stack: Fixup independent softirq stack for CONFIG_FRAME_POINTER=n riscv: stack: Fixup independent irq stack for CONFIG_FRAME_POINTER=n riscv: correct riscv_insn_is_c_jr() and riscv_insn_is_c_jalr() riscv: entry: set a0 = -ENOSYS only when syscall != -1 commit ce03e1807c1f71abcba185e6052cbef250600514 Merge: 88d4a1643afca 46cdff2369cbd Author: Linus Torvalds Date: Fri Aug 18 19:17:01 2023 +0200 Merge tag 'sound-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Slightly bigger than I wished, but here we go, a collection of fixes for 6.5. The only change in the core side is the ease for repeated ASoC error messages, and the rest are all pretty device-specific small fixes (including regression fixes) for ASoC Intel and HD-audio / USB-audio quirks" * tag 'sound-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek - Remodified 3k pull low procedure ASoC: rt1308-sdw: fix random louder sound ALSA: hda/cs8409: Support new Dell Dolphin Variants ALSA: hda/realtek: Switch Dell Oasis models to use SPI ALSA: hda/realtek: Add quirks for HP G11 Laptops ASoC: meson: axg-tdm-formatter: fix channel slot allocation ASoC: SOF: ipc4-topology: Update the basecfg for copier earlier ASoC: SOF: intel: hda: Clean up link DMA for IPC3 during stop ASoC: Intel: sof-sdw-cs42142: fix for codec button mapping ASoC: Intel: sof-sdw: update jack detection quirk for LunarLake RVP ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work() ASoC: lower "no backend DAIs enabled for ... Port" log severity ASoC: rt5665: add missed regulator_bulk_disable ASoC: max98363: don't return on success reading revision ID ALSA: usb-audio: Add support for Mythware XA001AU capture and playback interfaces. ASoC: fsl: micfil: Use dual license micfil code commit 88d4a1643afca63a3832eefad5c00775ea20c117 Merge: f33fd7eb209ac 58abdd80b93b0 Author: Linus Torvalds Date: Fri Aug 18 19:10:41 2023 +0200 Merge tag 'mmc-v6.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Fix in_flight[issue_type] value error to properly manage requests MMC host: - wbsd: Fix double free in the probe error path - sunplus: Fix error path in probe - sdhci_f_sdh30: Fix order of function calls in sdhci_f_sdh30_remove" * tag 'mmc-v6.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: f-sdh30: fix order of function calls in sdhci_f_sdh30_remove mmc: sunplus: Fix error handling in spmmc_drv_probe() mmc: sunplus: fix return value check of mmc_add_host() mmc: wbsd: fix double mmc_free_host() in wbsd_init() mmc: block: Fix in_flight[issue_type] value error commit f0362a253606e2031f8d61c74195d4d6556e12a4 Author: Rik van Riel Date: Thu Aug 17 13:57:59 2023 -0400 mm,ima,kexec,of: use memblock_free_late from ima_free_kexec_buffer The code calling ima_free_kexec_buffer runs long after the memblock allocator has already been torn down, potentially resulting in a use after free in memblock_isolate_range. With KASAN or KFENCE, this use after free will result in a BUG from the idle task, and a subsequent kernel panic. Switch ima_free_kexec_buffer over to memblock_free_late to avoid that issue. Fixes: fee3ff99bc67 ("powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c") Cc: stable@kernel.org Signed-off-by: Rik van Riel Suggested-by: Mike Rappoport Link: https://lore.kernel.org/r/20230817135759.0888e5ef@imladris.surriel.com Signed-off-by: Rob Herring commit f33fd7eb209acf8f6d698fc7979af9e5815271c3 Merge: 80706f552983a 9757300d2750e Author: Linus Torvalds Date: Fri Aug 18 18:37:40 2023 +0200 Merge tag 'pinctrl-v6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "Fixes two issues with the Qualcomm SA8775P platform: - Some minor device tree binding flunky that is nice to iron out but more importantly: - Support the increased interrupt targets mask from 3 to 4 bits, making interrupts with higher (hardware) numbers work" * tag 'pinctrl-v6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: qcom: Add intr_target_width field to support increased number of interrupt targets dt-bindings: pinctrl: qcom,sa8775p-tlmm: add gpio function constant commit 80706f552983ae62ef21f6c50303bad51ab7592c Merge: eabeef9054fdd 3c78dbf251350 Author: Linus Torvalds Date: Fri Aug 18 18:24:41 2023 +0200 Merge tag 'soc-fixes-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "As usual, mostly DT fixes for the major Arm platforms from Qualcomm and NXP, plus a bit for Rockchips and others: The qualcomm fixes mainly deal with their higher-end arm64 devices trees, fixing issues in L3 interconnect, crypto, thermal, UFS and a regression for the DSI phy. NXP i.MX has two correctness fixes for the 64-bit chips, dealing with the imx93 "anatop" module and the CSI interface. On the 32-bit side, there are functional fixes for RTC, display and SD card intefaces. Rockchip fixes are for wifi support on certain boards, a eMMC stability and DT build warnings. On TI OMAP, a regulator is described in DT to avoid problems with the ethernet phy initialization. The code changes include a missing MMIO serialization on OMAP, plus a few minor fixes on ASpeed and AMD/Zynq chips" * tag 'soc-fixes-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (30 commits) ARM: dts: am335x-bone-common: Add vcc-supply for on-board eeprom ARM: dts: am335x-bone-common: Add GPIO PHY reset on revision C3 board soc: aspeed: socinfo: Add kfree for kstrdup soc: aspeed: uart-routing: Use __sysfs_match_string ARM: dts: integrator: fix PCI bus dtc warnings arm64: dts: imx93: Fix anatop node size arm64: dts: qcom: sc7180: Fix DSI0_PHY reg-names ARM: dts: imx: Set default tuning step for imx6sx usdhc arm64: dts: imx8mm: Drop CSI1 PHY reference clock configuration arm64: dts: imx8mn: Drop CSI1 PHY reference clock configuration ARM: dts: imx: Set default tuning step for imx7d usdhc ARM: dts: imx6: phytec: fix RTC interrupt level ARM: dts: imx6sx: Remove LDB endpoint arm64: dts: rockchip: Fix Wifi/Bluetooth on ROCK Pi 4 boards ARM: zynq: Explicitly include correct DT includes arm64: dts: qcom: sa8775p-ride: Update L4C parameters arm64: dts: rockchip: minor whitespace cleanup around '=' arm64: dts: rockchip: Disable HS400 for eMMC on ROCK 4C+ arm64: dts: rockchip: Disable HS400 for eMMC on ROCK Pi 4 arm64: dts: rockchip: add missing space before { on indiedroid nova ... commit eabeef9054fdd317e58387ed0ab1a32fe9eb5909 Merge: 0e8860d2125f5 6e8d96909a23c Author: Linus Torvalds Date: Fri Aug 18 18:13:36 2023 +0200 Merge tag 'asm-generic-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic regression fix from Arnd Bergmann: "Just one partial revert for a commit from the merge window that caused annoying behavior when building old kernels on arm64 hosts" * tag 'asm-generic-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: asm-generic: partially revert "Unify uapi bitsperlong.h for arm64, riscv and loongarch" commit c962098ca4af146f2625ed64399926a098752c9c Author: Josef Bacik Date: Thu Aug 17 16:57:30 2023 -0400 btrfs: fix incorrect splitting in btrfs_drop_extent_map_range In production we were seeing a variety of WARN_ON()'s in the extent_map code, specifically in btrfs_drop_extent_map_range() when we have to call add_extent_mapping() for our second split. Consider the following extent map layout PINNED [0 16K) [32K, 48K) and then we call btrfs_drop_extent_map_range for [0, 36K), with skip_pinned == true. The initial loop will have start = 0 end = 36K len = 36K we will find the [0, 16k) extent, but since we are pinned we will skip it, which has this code start = em_end; if (end != (u64)-1) len = start + len - em_end; em_end here is 16K, so now the values are start = 16K len = 16K + 36K - 16K = 36K len should instead be 20K. This is a problem when we find the next extent at [32K, 48K), we need to split this extent to leave [36K, 48k), however the code for the split looks like this split->start = start + len; split->len = em_end - (start + len); In this case we have em_end = 48K split->start = 16K + 36K // this should be 16K + 20K split->len = 48K - (16K + 36K) // this overflows as 16K + 36K is 52K and now we have an invalid extent_map in the tree that potentially overlaps other entries in the extent map. Even in the non-overlapping case we will have split->start set improperly, which will cause problems with any block related calculations. We don't actually need len in this loop, we can simply use end as our end point, and only adjust start up when we find a pinned extent we need to skip. Adjust the logic to do this, which keeps us from inserting an invalid extent map. We only skip_pinned in the relocation case, so this is relatively rare, except in the case where you are running relocation a lot, which can happen with auto relocation on. Fixes: 55ef68990029 ("Btrfs: Fix btrfs_drop_extent_cache for skip pinned case") CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 8fcc1c40b747069644db6102c1d84c942c9d4d86 Author: Biju Das Date: Tue Aug 15 14:15:58 2023 +0100 pinctrl: renesas: rza2: Add lock around pinctrl_generic{{add,remove}_group,{add,remove}_function} The pinctrl group and function creation/remove calls expect caller to take care of locking. Add lock around these functions. Fixes: b59d0e782706 ("pinctrl: Add RZ/A2 pin and gpio controller") Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230815131558.33787-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit f982b9d57e7f834138fc908804fe66f646f2b108 Author: Biju Das Date: Tue Aug 15 14:15:57 2023 +0100 pinctrl: renesas: rzv2m: Fix NULL pointer dereference in rzv2m_dt_subnode_to_map() Fix the below random NULL pointer crash during boot by serializing pinctrl group and function creation/remove calls in rzv2m_dt_subnode_to_map() with mutex lock. Crash logs: pc : __pi_strcmp+0x20/0x140 lr : pinmux_func_name_to_selector+0x68/0xa4 Call trace: __pi_strcmp+0x20/0x140 pinmux_generic_add_function+0x34/0xcc rzv2m_dt_subnode_to_map+0x2e4/0x418 rzv2m_dt_node_to_map+0x15c/0x18c pinctrl_dt_to_map+0x218/0x37c create_pinctrl+0x70/0x3d8 While at it, add a comment for lock. Fixes: 92a9b8252576 ("pinctrl: renesas: Add RZ/V2M pin and gpio controller driver") Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230815131558.33787-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 661efa2284bbc2338da0424e219603f034072c74 Author: Biju Das Date: Tue Aug 15 14:15:56 2023 +0100 pinctrl: renesas: rzg2l: Fix NULL pointer dereference in rzg2l_dt_subnode_to_map() Fix the below random NULL pointer crash during boot by serializing pinctrl group and function creation/remove calls in rzg2l_dt_subnode_to_map() with mutex lock. Crash log: pc : __pi_strcmp+0x20/0x140 lr : pinmux_func_name_to_selector+0x68/0xa4 Call trace: __pi_strcmp+0x20/0x140 pinmux_generic_add_function+0x34/0xcc rzg2l_dt_subnode_to_map+0x314/0x44c rzg2l_dt_node_to_map+0x164/0x194 pinctrl_dt_to_map+0x218/0x37c create_pinctrl+0x70/0x3d8 While at it, add comments for bitmap_lock and lock. Fixes: c4c4637eb57f ("pinctrl: renesas: Add RZ/G2L pin and gpio controller driver") Tested-by: Chris Paterson Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230815131558.33787-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 6405b72e8d17bd1875a56ae52d23ec3cd51b9d66 Author: Borislav Petkov (AMD) Date: Tue Aug 15 11:53:13 2023 +0200 x86/srso: Correct the mitigation status when SMT is disabled Specify how is SRSO mitigated when SMT is disabled. Also, correct the SMT check for that. Fixes: e9fbc47b818b ("x86/srso: Disable the mitigation on unaffected configurations") Suggested-by: Josh Poimboeuf Signed-off-by: Borislav Petkov (AMD) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20230814200813.p5czl47zssuej7nv@treble commit 080aa61e370b9c5cafe71cacadbfe0e72db4d6df Author: Pavel Skripkin Date: Mon Aug 14 21:03:41 2023 +0300 crypto: fix uninit-value in af_alg_free_resources Syzbot was able to trigger use of uninitialized memory in af_alg_free_resources. Bug is caused by missing initialization of rsgl->sgl.need_unpin before adding to rsgl_list. Then in case of extract_iter_to_sg() failure, rsgl is left with uninitialized need_unpin which is read during clean up BUG: KMSAN: uninit-value in af_alg_free_sg crypto/af_alg.c:545 [inline] BUG: KMSAN: uninit-value in af_alg_free_areq_sgls crypto/af_alg.c:778 [inline] BUG: KMSAN: uninit-value in af_alg_free_resources+0x3d1/0xf60 crypto/af_alg.c:1117 af_alg_free_sg crypto/af_alg.c:545 [inline] af_alg_free_areq_sgls crypto/af_alg.c:778 [inline] af_alg_free_resources+0x3d1/0xf60 crypto/af_alg.c:1117 _skcipher_recvmsg crypto/algif_skcipher.c:144 [inline] ... Uninit was created at: slab_post_alloc_hook+0x12f/0xb70 mm/slab.h:767 slab_alloc_node mm/slub.c:3470 [inline] __kmem_cache_alloc_node+0x536/0x8d0 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc+0x121/0x3c0 mm/slab_common.c:998 kmalloc include/linux/slab.h:586 [inline] sock_kmalloc+0x128/0x1c0 net/core/sock.c:2683 af_alg_alloc_areq+0x41/0x2a0 crypto/af_alg.c:1188 _skcipher_recvmsg crypto/algif_skcipher.c:71 [inline] Fixes: c1abe6f570af ("crypto: af_alg: Use extract_iter_to_sg() to create scatterlists") Reported-and-tested-by: syzbot+cba21d50095623218389@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=cba21d50095623218389 Signed-off-by: Pavel Skripkin Signed-off-by: Herbert Xu commit 83874b8e97f895e62d9ab03223318176d5e78203 Author: Herbert Xu Date: Fri Aug 18 16:47:02 2023 +0800 Revert "crypto: caam - adjust RNG timing to support more devices" This reverts commit ef492d080302913e85122a2d92efa2ca174930f8. This patch breaks the RNG on i.MX8MM. Reported-by: Bastian Krause Link: https://lore.kernel.org/all/e1f3f073-9d5e-1bae-f4f8-08dc48adad62@pengutronix.de/ Signed-off-by: Herbert Xu commit 20c827683de05a6c7e7ae7fae586899690693251 Author: Frieder Schrempf Date: Mon Jul 24 17:16:32 2023 +0200 drm: bridge: samsung-dsim: Fix init during host transfer In case the downstream bridge or panel uses DSI transfers before the DSI host was actually initialized through samsung_dsim_atomic_enable() which clears the stop state (LP11) mode, all transfers will fail. This happens with downstream bridges that are controlled by DSI commands such as the tc358762. As documented in [1] DSI hosts are expected to allow transfers outside the normal bridge enable/disable flow. To fix this make sure that stop state is cleared in samsung_dsim_host_transfer() which restores the previous behavior. We also factor out the common code to enable/disable stop state to samsung_dsim_set_stop_state(). [1] https://docs.kernel.org/gpu/drm-kms-helpers.html#mipi-dsi-bridge-operation Fixes: 0c14d3130654 ("drm: bridge: samsung-dsim: Fix i.MX8M enable flow to meet spec") Reported-by: Tim Harvey Signed-off-by: Frieder Schrempf Reviewed-by: Neil Armstrong Tested-by: Tim Harvey Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230724151640.555490-1-frieder@fris.de commit 0e8860d2125f51ba9bca67a520d826cb8f66cf42 Merge: 1ada9c07407d6 820a38d8f2cb3 Author: Linus Torvalds Date: Fri Aug 18 06:52:23 2023 +0200 Merge tag 'net-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from ipsec and netfilter. No known outstanding regressions. Fixes to fixes: - virtio-net: set queues after driver_ok, avoid a potential race added by recent fix - Revert "vlan: Fix VLAN 0 memory leak", it may lead to a warning when VLAN 0 is registered explicitly - nf_tables: - fix false-positive lockdep splat in recent fixes - don't fail inserts if duplicate has expired (fix test failures) - fix races between garbage collection and netns dismantle Current release - new code bugs: - mlx5: Fix mlx5_cmd_update_root_ft() error flow Previous releases - regressions: - phy: fix IRQ-based wake-on-lan over hibernate / power off Previous releases - always broken: - sock: fix misuse of sk_under_memory_pressure() preventing system from exiting global TCP memory pressure if a single cgroup is under pressure - fix the RTO timer retransmitting skb every 1ms if linear option is enabled - af_key: fix sadb_x_filter validation, amment netlink policy - ipsec: fix slab-use-after-free in decode_session6() - macb: in ZynqMP resume always configure PS GTR for non-wakeup source Misc: - netfilter: set default timeout to 3 secs for sctp shutdown send and recv state (from 300ms), align with protocol timers" * tag 'net-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (49 commits) ice: Block switchdev mode when ADQ is active and vice versa qede: fix firmware halt over suspend and resume net: do not allow gso_size to be set to GSO_BY_FRAGS sock: Fix misuse of sk_under_memory_pressure() sfc: don't fail probe if MAE/TC setup fails sfc: don't unregister flow_indr if it was never registered net: dsa: mv88e6xxx: Wait for EEPROM done before HW reset net/mlx5: Fix mlx5_cmd_update_root_ft() error flow net/mlx5e: XDP, Fix fifo overrun on XDP_REDIRECT i40e: fix misleading debug logs iavf: fix FDIR rule fields masks validation ipv6: fix indentation of a config attribute mailmap: add entries for Simon Horman broadcom: b44: Use b44_writephy() return value net: openvswitch: reject negative ifindex team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves net: phy: broadcom: stub c45 read/write for 54810 netfilter: nft_dynset: disallow object maps netfilter: nf_tables: GC transaction race with netns dismantle netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path ... commit 1ada9c07407d66679967fe5c2cbb7eda2e0addbf Merge: 16931859a6500 c611589b4259e Author: Linus Torvalds Date: Fri Aug 18 06:37:34 2023 +0200 Merge tag 'drm-fixes-2023-08-18-1' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Regular enough week, mostly the usual amdgpu and i915 fixes. Also qaic, nouveau, qxl and a revert for an EDID patch that had some side effects, along with a couple of panel fixes. edid: - revert mode parsing fix that had side effects. i915: - Fix the flow for ignoring GuC SLPC efficient frequency selection - Fix SDVO panel_type initialization - Fix display probe for IVB Q and IVB D GT2 server nouveau: - fix use-after-free in connector code qaic: - integer overflow check fix - fix slicing memory leak panel: - fix JDI LT070ME05000 probing - fix AUO G121EAN01 timings amdgpu: - SMU 13.x fixes - Fix mcbp parameter for gfx9 - SMU 11.x fixes - Temporary fix for large numbers of XCP partitions - S0ix fixes - DCN 2.0 fix qxl: - fix use after free race in dumb object allocation" * tag 'drm-fixes-2023-08-18-1' of git://anongit.freedesktop.org/drm/drm: drm/qxl: fix UAF on handle creation Revert "drm/edid: Fix csync detailed mode parsing" drm/nouveau/disp: fix use-after-free in error handling of nouveau_connector_create Revert "Revert "drm/amdgpu/display: change pipe policy for DCN 2.0"" drm/amd: flush any delayed gfxoff on suspend entry drm/amdgpu: skip fence GFX interrupts disable/enable for S0ix drm/amdgpu: skip xcp drm device allocation when out of drm resource drm/amd/pm: Update pci link width for smu v13.0.6 drm/amd/pm: Fix temperature unit of SMU v13.0.6 drm/amdgpu/pm: fix throttle_status for other than MP1 11.0.7 drm/amdgpu: disable mcbp if parameter zero is set drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0 accel/qaic: Clean up integer overflow checking in map_user_pages() accel/qaic: Fix slicing memory leak drm/i915: fix display probe for IVB Q and IVB D GT2 server drm/i915/sdvo: fix panel_type initialization drm/i915/guc/slpc: Restore efficient freq earlier drm/panel: simple: Fix AUO G121EAN01 panel timings according to the docs drm/panel: JDI LT070ME05000 simplify with dev_err_probe() commit 820a38d8f2cb3a749ffb7bbde206acec9a387411 Merge: e9bbd6016947c 2f2beb8874cb0 Author: Jakub Kicinski Date: Thu Aug 17 14:35:34 2023 -0700 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-08-16 (iavf, i40e) This series contains updates to iavf and i40e drivers. Piotr adds checks for unsupported Flow Director rules on iavf. Andrii replaces incorrect 'write' messaging on read operations for i40e. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: i40e: fix misleading debug logs iavf: fix FDIR rule fields masks validation ==================== Link: https://lore.kernel.org/r/20230816193308.1307535-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit c611589b4259ed63b9b77be6872b1ce07ec0ac16 Author: Wander Lairson Costa Date: Mon Aug 14 13:51:19 2023 -0300 drm/qxl: fix UAF on handle creation qxl_mode_dumb_create() dereferences the qobj returned by qxl_gem_object_create_with_handle(), but the handle is the only one holding a reference to it. A potential attacker could guess the returned handle value and closes it between the return of qxl_gem_object_create_with_handle() and the qobj usage, triggering a use-after-free scenario. Reproducer: int dri_fd =-1; struct drm_mode_create_dumb arg = {0}; void gem_close(int handle); void* trigger(void* ptr) { int ret; arg.width = arg.height = 0x20; arg.bpp = 32; ret = ioctl(dri_fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg); if(ret) { perror("[*] DRM_IOCTL_MODE_CREATE_DUMB Failed"); exit(-1); } gem_close(arg.handle); while(1) { struct drm_mode_create_dumb args = {0}; args.width = args.height = 0x20; args.bpp = 32; ret = ioctl(dri_fd, DRM_IOCTL_MODE_CREATE_DUMB, &args); if (ret) { perror("[*] DRM_IOCTL_MODE_CREATE_DUMB Failed"); exit(-1); } printf("[*] DRM_IOCTL_MODE_CREATE_DUMB created, %d\n", args.handle); gem_close(args.handle); } return NULL; } void gem_close(int handle) { struct drm_gem_close args; args.handle = handle; int ret = ioctl(dri_fd, DRM_IOCTL_GEM_CLOSE, &args); // gem close handle if (!ret) printf("gem close handle %d\n", args.handle); } int main(void) { dri_fd= open("/dev/dri/card0", O_RDWR); printf("fd:%d\n", dri_fd); if(dri_fd == -1) return -1; pthread_t tid1; if(pthread_create(&tid1,NULL,trigger,NULL)){ perror("[*] thread_create tid1\n"); return -1; } while (1) { gem_close(arg.handle); } return 0; } This is a KASAN report: ================================================================== BUG: KASAN: slab-use-after-free in qxl_mode_dumb_create+0x3c2/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:69 Write of size 1 at addr ffff88801136c240 by task poc/515 CPU: 1 PID: 515 Comm: poc Not tainted 6.3.0 #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-debian-1.16.0-4 04/01/2014 Call Trace: __dump_stack linux/lib/dump_stack.c:88 dump_stack_lvl+0x48/0x70 linux/lib/dump_stack.c:106 print_address_description linux/mm/kasan/report.c:319 print_report+0xd2/0x660 linux/mm/kasan/report.c:430 kasan_report+0xd2/0x110 linux/mm/kasan/report.c:536 __asan_report_store1_noabort+0x17/0x30 linux/mm/kasan/report_generic.c:383 qxl_mode_dumb_create+0x3c2/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:69 drm_mode_create_dumb linux/drivers/gpu/drm/drm_dumb_buffers.c:96 drm_mode_create_dumb_ioctl+0x1f5/0x2d0 linux/drivers/gpu/drm/drm_dumb_buffers.c:102 drm_ioctl_kernel+0x21d/0x430 linux/drivers/gpu/drm/drm_ioctl.c:788 drm_ioctl+0x56f/0xcc0 linux/drivers/gpu/drm/drm_ioctl.c:891 vfs_ioctl linux/fs/ioctl.c:51 __do_sys_ioctl linux/fs/ioctl.c:870 __se_sys_ioctl linux/fs/ioctl.c:856 __x64_sys_ioctl+0x13d/0x1c0 linux/fs/ioctl.c:856 do_syscall_x64 linux/arch/x86/entry/common.c:50 do_syscall_64+0x5b/0x90 linux/arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc linux/arch/x86/entry/entry_64.S:120 RIP: 0033:0x7ff5004ff5f7 Code: 00 00 00 48 8b 05 99 c8 0d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 69 c8 0d 00 f7 d8 64 89 01 48 RSP: 002b:00007ff500408ea8 EFLAGS: 00000286 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff5004ff5f7 RDX: 00007ff500408ec0 RSI: 00000000c02064b2 RDI: 0000000000000003 RBP: 00007ff500408ef0 R08: 0000000000000000 R09: 000000000000002a R10: 0000000000000000 R11: 0000000000000286 R12: 00007fff1c6cdafe R13: 00007fff1c6cdaff R14: 00007ff500408fc0 R15: 0000000000802000 Allocated by task 515: kasan_save_stack+0x38/0x70 linux/mm/kasan/common.c:45 kasan_set_track+0x25/0x40 linux/mm/kasan/common.c:52 kasan_save_alloc_info+0x1e/0x40 linux/mm/kasan/generic.c:510 ____kasan_kmalloc linux/mm/kasan/common.c:374 __kasan_kmalloc+0xc3/0xd0 linux/mm/kasan/common.c:383 kasan_kmalloc linux/./include/linux/kasan.h:196 kmalloc_trace+0x48/0xc0 linux/mm/slab_common.c:1066 kmalloc linux/./include/linux/slab.h:580 kzalloc linux/./include/linux/slab.h:720 qxl_bo_create+0x11a/0x610 linux/drivers/gpu/drm/qxl/qxl_object.c:124 qxl_gem_object_create+0xd9/0x360 linux/drivers/gpu/drm/qxl/qxl_gem.c:58 qxl_gem_object_create_with_handle+0xa1/0x180 linux/drivers/gpu/drm/qxl/qxl_gem.c:89 qxl_mode_dumb_create+0x1cd/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:63 drm_mode_create_dumb linux/drivers/gpu/drm/drm_dumb_buffers.c:96 drm_mode_create_dumb_ioctl+0x1f5/0x2d0 linux/drivers/gpu/drm/drm_dumb_buffers.c:102 drm_ioctl_kernel+0x21d/0x430 linux/drivers/gpu/drm/drm_ioctl.c:788 drm_ioctl+0x56f/0xcc0 linux/drivers/gpu/drm/drm_ioctl.c:891 vfs_ioctl linux/fs/ioctl.c:51 __do_sys_ioctl linux/fs/ioctl.c:870 __se_sys_ioctl linux/fs/ioctl.c:856 __x64_sys_ioctl+0x13d/0x1c0 linux/fs/ioctl.c:856 do_syscall_x64 linux/arch/x86/entry/common.c:50 do_syscall_64+0x5b/0x90 linux/arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc linux/arch/x86/entry/entry_64.S:120 Freed by task 515: kasan_save_stack+0x38/0x70 linux/mm/kasan/common.c:45 kasan_set_track+0x25/0x40 linux/mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x60 linux/mm/kasan/generic.c:521 ____kasan_slab_free linux/mm/kasan/common.c:236 ____kasan_slab_free+0x180/0x1f0 linux/mm/kasan/common.c:200 __kasan_slab_free+0x12/0x30 linux/mm/kasan/common.c:244 kasan_slab_free linux/./include/linux/kasan.h:162 slab_free_hook linux/mm/slub.c:1781 slab_free_freelist_hook+0xd2/0x1a0 linux/mm/slub.c:1807 slab_free linux/mm/slub.c:3787 __kmem_cache_free+0x196/0x2d0 linux/mm/slub.c:3800 kfree+0x78/0x120 linux/mm/slab_common.c:1019 qxl_ttm_bo_destroy+0x140/0x1a0 linux/drivers/gpu/drm/qxl/qxl_object.c:49 ttm_bo_release+0x678/0xa30 linux/drivers/gpu/drm/ttm/ttm_bo.c:381 kref_put linux/./include/linux/kref.h:65 ttm_bo_put+0x50/0x80 linux/drivers/gpu/drm/ttm/ttm_bo.c:393 qxl_gem_object_free+0x3e/0x60 linux/drivers/gpu/drm/qxl/qxl_gem.c:42 drm_gem_object_free+0x5c/0x90 linux/drivers/gpu/drm/drm_gem.c:974 kref_put linux/./include/linux/kref.h:65 __drm_gem_object_put linux/./include/drm/drm_gem.h:431 drm_gem_object_put linux/./include/drm/drm_gem.h:444 qxl_gem_object_create_with_handle+0x151/0x180 linux/drivers/gpu/drm/qxl/qxl_gem.c:100 qxl_mode_dumb_create+0x1cd/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:63 drm_mode_create_dumb linux/drivers/gpu/drm/drm_dumb_buffers.c:96 drm_mode_create_dumb_ioctl+0x1f5/0x2d0 linux/drivers/gpu/drm/drm_dumb_buffers.c:102 drm_ioctl_kernel+0x21d/0x430 linux/drivers/gpu/drm/drm_ioctl.c:788 drm_ioctl+0x56f/0xcc0 linux/drivers/gpu/drm/drm_ioctl.c:891 vfs_ioctl linux/fs/ioctl.c:51 __do_sys_ioctl linux/fs/ioctl.c:870 __se_sys_ioctl linux/fs/ioctl.c:856 __x64_sys_ioctl+0x13d/0x1c0 linux/fs/ioctl.c:856 do_syscall_x64 linux/arch/x86/entry/common.c:50 do_syscall_64+0x5b/0x90 linux/arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc linux/arch/x86/entry/entry_64.S:120 The buggy address belongs to the object at ffff88801136c000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 576 bytes inside of freed 1024-byte region [ffff88801136c000, ffff88801136c400) The buggy address belongs to the physical page: page:0000000089fc329b refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11368 head:0000000089fc329b order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfffffc0010200(slab|head|node=0|zone=1|lastcpupid=0x1fffff) raw: 000fffffc0010200 ffff888007841dc0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801136c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801136c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801136c200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801136c280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801136c300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Disabling lock debugging due to kernel taint Instead of returning a weak reference to the qxl_bo object, return the created drm_gem_object and let the caller decrement the reference count when it no longer needs it. As a convenience, if the caller is not interested in the gobj object, it can pass NULL to the parameter and the reference counting is descremented internally. The bug and the reproducer were originally found by the Zero Day Initiative project (ZDI-CAN-20940). Link: https://www.zerodayinitiative.com/ Signed-off-by: Wander Lairson Costa Cc: stable@vger.kernel.org Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230814165119.90847-1-wander@redhat.com commit 68c60b343301c5a150e6da4c0c9e4123b2b9c017 Merge: be48306f764dc 6ecc10295abb2 Author: Dave Airlie Date: Fri Aug 18 06:09:21 2023 +1000 Merge tag 'amd-drm-fixes-6.5-2023-08-16' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.5-2023-08-16: amdgpu: - SMU 13.x fixes - Fix mcbp parameter for gfx9 - SMU 11.x fixes - Temporary fix for large numbers of XCP partitions - S0ix fixes - DCN 2.0 fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20230816200226.10771-1-alexander.deucher@amd.com commit be48306f764dc84906a5054e60e6cfa9889fb44d Merge: dd64d8ae0f8f2 50b6f2c829779 Author: Dave Airlie Date: Fri Aug 18 06:08:54 2023 +1000 Merge tag 'drm-misc-fixes-2023-08-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes One EPROBE_DEFER handling fix for the JDI LT070ME05000, a timing fix for the AUO G121EAN01 panel, an integer overflow and a memory leak fixes for the qaic accel, a use-after-free fix for nouveau and a revert for an alleged fix in EDID parsing. Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/3olqt33em5uhxzjbqghwcwnvmw73h7bxkbdxookmnkecymd4vc@7ogm6gewpprq commit dd64d8ae0f8f271e8629e9d2ba9971081583c394 Merge: 2ccdd1b13c591 423ffe62c06ae Author: Dave Airlie Date: Fri Aug 18 06:07:59 2023 +1000 Merge tag 'drm-intel-fixes-2023-08-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix the flow for ignoring GuC SLPC efficient frequency selection (Vinay) - Fix SDVO panel_type initialization (Jani) - Fix display probe for IVB Q and IVB D GT2 server (Jani) Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/ZN4yduyBU1Ev9dc7@intel.com commit e9bbd6016947c40728558b7b921c1e77e6193e8b Merge: 43d00e102d9ec 0fd23db0cc74c Author: Jakub Kicinski Date: Thu Aug 17 11:56:44 2023 -0700 Merge tag 'mlx5-fixes-2023-08-16' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2023-08-16 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2023-08-16' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5: Fix mlx5_cmd_update_root_ft() error flow net/mlx5e: XDP, Fix fifo overrun on XDP_REDIRECT ==================== Link: https://lore.kernel.org/r/20230816204108.53819-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 43d00e102d9ecbe2635d7e3f2e14d2e90183d6af Author: Marcin Szycik Date: Wed Aug 16 12:34:05 2023 -0700 ice: Block switchdev mode when ADQ is active and vice versa ADQ and switchdev are not supported simultaneously. Enabling both at the same time can result in nullptr dereference. To prevent this, check if ADQ is active when changing devlink mode to switchdev mode, and check if switchdev is active when enabling ADQ. Fixes: fbc7b27af0f9 ("ice: enable ndo_setup_tc support for mqprio_qdisc") Signed-off-by: Marcin Szycik Reviewed-by: Przemek Kitszel Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230816193405.1307580-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 2eb9625a3a32251ecea470cd576659a3a03b4e59 Author: Manish Chopra Date: Wed Aug 16 20:37:11 2023 +0530 qede: fix firmware halt over suspend and resume While performing certain power-off sequences, PCI drivers are called to suspend and resume their underlying devices through PCI PM (power management) interface. However this NIC hardware does not support PCI PM suspend/resume operations so system wide suspend/resume leads to bad MFW (management firmware) state which causes various follow-up errors in driver when communicating with the device/firmware afterwards. To fix this driver implements PCI PM suspend handler to indicate unsupported operation to the PCI subsystem explicitly, thus avoiding system to go into suspended/standby mode. Without this fix device/firmware does not recover unless system is power cycled. Fixes: 2950219d87b0 ("qede: Add basic network device support") Signed-off-by: Manish Chopra Signed-off-by: Alok Prasad Reviewed-by: John Meneghini Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230816150711.59035-1-manishc@marvell.com Signed-off-by: Jakub Kicinski commit b616be6b97688f2f2bd7c4a47ab32f27f94fb2a9 Author: Eric Dumazet Date: Wed Aug 16 14:21:58 2023 +0000 net: do not allow gso_size to be set to GSO_BY_FRAGS One missing check in virtio_net_hdr_to_skb() allowed syzbot to crash kernels again [1] Do not allow gso_size to be set to GSO_BY_FRAGS (0xffff), because this magic value is used by the kernel. [1] general protection fault, probably for non-canonical address 0xdffffc000000000e: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000070-0x0000000000000077] CPU: 0 PID: 5039 Comm: syz-executor401 Not tainted 6.5.0-rc5-next-20230809-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 RIP: 0010:skb_segment+0x1a52/0x3ef0 net/core/skbuff.c:4500 Code: 00 00 00 e9 ab eb ff ff e8 6b 96 5d f9 48 8b 84 24 00 01 00 00 48 8d 78 70 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e ea 21 00 00 48 8b 84 24 00 01 RSP: 0018:ffffc90003d3f1c8 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 000000000001fffe RCX: 0000000000000000 RDX: 000000000000000e RSI: ffffffff882a3115 RDI: 0000000000000070 RBP: ffffc90003d3f378 R08: 0000000000000005 R09: 000000000000ffff R10: 000000000000ffff R11: 5ee4a93e456187d6 R12: 000000000001ffc6 R13: dffffc0000000000 R14: 0000000000000008 R15: 000000000000ffff FS: 00005555563f2380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020020000 CR3: 000000001626d000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: udp6_ufo_fragment+0x9d2/0xd50 net/ipv6/udp_offload.c:109 ipv6_gso_segment+0x5c4/0x17b0 net/ipv6/ip6_offload.c:120 skb_mac_gso_segment+0x292/0x610 net/core/gso.c:53 __skb_gso_segment+0x339/0x710 net/core/gso.c:124 skb_gso_segment include/net/gso.h:83 [inline] validate_xmit_skb+0x3a5/0xf10 net/core/dev.c:3625 __dev_queue_xmit+0x8f0/0x3d60 net/core/dev.c:4329 dev_queue_xmit include/linux/netdevice.h:3082 [inline] packet_xmit+0x257/0x380 net/packet/af_packet.c:276 packet_snd net/packet/af_packet.c:3087 [inline] packet_sendmsg+0x24c7/0x5570 net/packet/af_packet.c:3119 sock_sendmsg_nosec net/socket.c:727 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:750 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2496 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2550 __sys_sendmsg+0x117/0x1e0 net/socket.c:2579 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7ff27cdb34d9 Fixes: 3953c46c3ac7 ("sk_buff: allow segmenting based on frag sizes") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Xin Long Cc: "Michael S. Tsirkin" Cc: Jason Wang Reviewed-by: Willem de Bruijn Reviewed-by: Marcelo Ricardo Leitner Reviewed-by: Xuan Zhuo Link: https://lore.kernel.org/r/20230816142158.1779798-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 2d0c88e84e483982067a82073f6125490ddf3614 Author: Abel Wu Date: Wed Aug 16 17:12:22 2023 +0800 sock: Fix misuse of sk_under_memory_pressure() The status of global socket memory pressure is updated when: a) __sk_mem_raise_allocated(): enter: sk_memory_allocated(sk) > sysctl_mem[1] leave: sk_memory_allocated(sk) <= sysctl_mem[0] b) __sk_mem_reduce_allocated(): leave: sk_under_memory_pressure(sk) && sk_memory_allocated(sk) < sysctl_mem[0] So the conditions of leaving global pressure are inconstant, which may lead to the situation that one pressured net-memcg prevents the global pressure from being cleared when there is indeed no global pressure, thus the global constrains are still in effect unexpectedly on the other sockets. This patch fixes this by ignoring the net-memcg's pressure when deciding whether should leave global memory pressure. Fixes: e1aab161e013 ("socket: initial cgroup code.") Signed-off-by: Abel Wu Acked-by: Shakeel Butt Link: https://lore.kernel.org/r/20230816091226.1542-1-wuyun.abel@bytedance.com Signed-off-by: Jakub Kicinski commit 54c9016eb8eda55952a195b071359cd13f50ed9b Author: Edward Cree Date: Tue Aug 15 16:57:28 2023 +0100 sfc: don't fail probe if MAE/TC setup fails Existing comment in the source explains why we don't want efx_init_tc() failure to be fatal. Cited commit erroneously consolidated failure paths causing the probe to be failed in this case. Fixes: 7e056e2360d9 ("sfc: obtain device mac address based on firmware handle for ef100") Reviewed-by: Martin Habets Signed-off-by: Edward Cree Link: https://lore.kernel.org/r/aa7f589dd6028bd1ad49f0a85f37ab33c09b2b45.1692114888.git.ecree.xilinx@gmail.com Signed-off-by: Jakub Kicinski commit fa165e1949976704500a442faeef8d9596faee76 Author: Edward Cree Date: Tue Aug 15 16:57:27 2023 +0100 sfc: don't unregister flow_indr if it was never registered In efx_init_tc(), move the setting of efx->tc->up after the flow_indr_dev_register() call, so that if it fails, efx_fini_tc() won't call flow_indr_dev_unregister(). Fixes: 5b2e12d51bd8 ("sfc: bind indirect blocks for TC offload on EF100") Suggested-by: Pieter Jansen van Vuuren Reviewed-by: Martin Habets Signed-off-by: Edward Cree Link: https://lore.kernel.org/r/a81284d7013aba74005277bd81104e4cfbea3f6f.1692114888.git.ecree.xilinx@gmail.com Signed-off-by: Jakub Kicinski commit 2f43f549cd0b3164ea0345e59aa3958c0d243383 Author: Mark Brown Date: Wed Aug 16 19:40:07 2023 +0100 arm64/ptrace: Ensure that the task sees ZT writes on first use When the value of ZT is set via ptrace we don't disable traps for SME. This means that when a the task has never used SME before then the value set via ptrace will never be seen by the target task since it will trigger a SME access trap which will flush the register state. Disable SME traps when setting ZT, this means we also need to allocate storage for SVE if it is not already allocated, for the benefit of streaming SVE. Fixes: f90b529bcbe5 ("arm64/sme: Implement ZT0 ptrace support") Signed-off-by: Mark Brown Cc: # 6.3.x Link: https://lore.kernel.org/r/20230816-arm64-zt-ptrace-first-use-v2-1-00aa82847e28@kernel.org Signed-off-by: Catalin Marinas commit 5d0a8d2fba50e9c07cde4aad7fba28c008b07a5b Author: Mark Brown Date: Thu Aug 10 12:28:19 2023 +0100 arm64/ptrace: Ensure that SME is set up for target when writing SSVE state When we use NT_ARM_SSVE to either enable streaming mode or change the vector length for a process we do not currently do anything to ensure that there is storage allocated for the SME specific register state. If the task had not previously used SME or we changed the vector length then the task will not have had TIF_SME set or backing storage for ZA/ZT allocated, resulting in inconsistent register sizes when saving state and spurious traps which flush the newly set register state. We should set TIF_SME to disable traps and ensure that storage is allocated for ZA and ZT if it is not already allocated. This requires modifying sme_alloc() to make the flush of any existing register state optional so we don't disturb existing state for ZA and ZT. Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers") Reported-by: David Spickett Signed-off-by: Mark Brown Cc: # 5.19.x Link: https://lore.kernel.org/r/20230810-arm64-fix-ptrace-race-v1-1-a5361fad2bd6@kernel.org Signed-off-by: Catalin Marinas commit eecb91b9f98d6427d4af5fdb8f108f52572a39e7 Author: Zheng Yejian Date: Thu Aug 17 20:55:39 2023 +0800 tracing: Fix memleak due to race between current_tracer and trace Kmemleak report a leak in graph_trace_open(): unreferenced object 0xffff0040b95f4a00 (size 128): comm "cat", pid 204981, jiffies 4301155872 (age 99771.964s) hex dump (first 32 bytes): e0 05 e7 b4 ab 7d 00 00 0b 00 01 00 00 00 00 00 .....}.......... f4 00 01 10 00 a0 ff ff 00 00 00 00 65 00 10 00 ............e... backtrace: [<000000005db27c8b>] kmem_cache_alloc_trace+0x348/0x5f0 [<000000007df90faa>] graph_trace_open+0xb0/0x344 [<00000000737524cd>] __tracing_open+0x450/0xb10 [<0000000098043327>] tracing_open+0x1a0/0x2a0 [<00000000291c3876>] do_dentry_open+0x3c0/0xdc0 [<000000004015bcd6>] vfs_open+0x98/0xd0 [<000000002b5f60c9>] do_open+0x520/0x8d0 [<00000000376c7820>] path_openat+0x1c0/0x3e0 [<00000000336a54b5>] do_filp_open+0x14c/0x324 [<000000002802df13>] do_sys_openat2+0x2c4/0x530 [<0000000094eea458>] __arm64_sys_openat+0x130/0x1c4 [<00000000a71d7881>] el0_svc_common.constprop.0+0xfc/0x394 [<00000000313647bf>] do_el0_svc+0xac/0xec [<000000002ef1c651>] el0_svc+0x20/0x30 [<000000002fd4692a>] el0_sync_handler+0xb0/0xb4 [<000000000c309c35>] el0_sync+0x160/0x180 The root cause is descripted as follows: __tracing_open() { // 1. File 'trace' is being opened; ... *iter->trace = *tr->current_trace; // 2. Tracer 'function_graph' is // currently set; ... iter->trace->open(iter); // 3. Call graph_trace_open() here, // and memory are allocated in it; ... } s_start() { // 4. The opened file is being read; ... *iter->trace = *tr->current_trace; // 5. If tracer is switched to // 'nop' or others, then memory // in step 3 are leaked!!! ... } To fix it, in s_start(), close tracer before switching then reopen the new tracer after switching. And some tracers like 'wakeup' may not update 'iter->private' in some cases when reopen, then it should be cleared to avoid being mistakenly closed again. Link: https://lore.kernel.org/linux-trace-kernel/20230817125539.1646321-1-zhengyejian1@huawei.com Fixes: d7350c3f4569 ("tracing/core: make the read callbacks reentrants") Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit ab0b5072d184bdb013c9c2419cb21c593fa3802a Merge: 3d521f9f3663b e8500a7027033 Author: Mark Brown Date: Thu Aug 17 18:36:28 2023 +0100 ASoC: cs35l56: Update ACPI HID and property Merge series from Richard Fitzgerald : These two patches add an ACPI HID and update the way the platform- specific firmware identifier is extracted from the ACPI. commit 16931859a6500d360b90aeacab3b505a3560a3ed Merge: 4853c74bd7ab7 c96e2a695e00b Author: Linus Torvalds Date: Thu Aug 17 16:38:48 2023 +0200 Merge tag 'nfsd-6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fix from Chuck Lever: - Fix new MSG_SPLICE_PAGES support in server's TCP sendmsg helper * tag 'nfsd-6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: sunrpc: set the bv_offset of first bvec in svc_tcp_sendmsg commit be2fd1560eb57b7298aa3c258ddcca0d53ecdea3 Author: Trond Myklebust Date: Tue Aug 8 21:17:11 2023 -0400 NFS: Fix a use after free in nfs_direct_join_group() Be more careful when tearing down the subrequests of an O_DIRECT write as part of a retransmission. Reported-by: Chris Mason Fixes: ed5d588fe47f ("NFS: Try to join page groups before an O_DIRECT retransmission") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust commit 29eefa6d0d07e185f7bfe9576f91e6dba98189c2 Author: xiaoshoukui Date: Tue Aug 15 02:55:59 2023 -0400 btrfs: fix BUG_ON condition in btrfs_cancel_balance Pausing and canceling balance can race to interrupt balance lead to BUG_ON panic in btrfs_cancel_balance. The BUG_ON condition in btrfs_cancel_balance does not take this race scenario into account. However, the race condition has no other side effects. We can fix that. Reproducing it with panic trace like this: kernel BUG at fs/btrfs/volumes.c:4618! RIP: 0010:btrfs_cancel_balance+0x5cf/0x6a0 Call Trace: ? do_nanosleep+0x60/0x120 ? hrtimer_nanosleep+0xb7/0x1a0 ? sched_core_clone_cookie+0x70/0x70 btrfs_ioctl_balance_ctl+0x55/0x70 btrfs_ioctl+0xa46/0xd20 __x64_sys_ioctl+0x7d/0xa0 do_syscall_64+0x38/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Race scenario as follows: > mutex_unlock(&fs_info->balance_mutex); > -------------------- > .......issue pause and cancel req in another thread > -------------------- > ret = __btrfs_balance(fs_info); > > mutex_lock(&fs_info->balance_mutex); > if (ret == -ECANCELED && atomic_read(&fs_info->balance_pause_req)) { > btrfs_info(fs_info, "balance: paused"); > btrfs_exclop_balance(fs_info, BTRFS_EXCLOP_BALANCE_PAUSED); > } CC: stable@vger.kernel.org # 4.19+ Signed-off-by: xiaoshoukui Reviewed-by: David Sterba Signed-off-by: David Sterba commit 09c3717c3a60e3ef599bc17c70cd3ae2b979ad41 Author: Chris Mason Date: Tue Aug 1 09:28:28 2023 -0700 btrfs: only subtract from len_to_oe_boundary when it is tracking an extent bio_ctrl->len_to_oe_boundary is used to make sure we stay inside a zone as we submit bios for writes. Every time we add a page to the bio, we decrement those bytes from len_to_oe_boundary, and then we submit the bio if we happen to hit zero. Most of the time, len_to_oe_boundary gets set to U32_MAX. submit_extent_page() adds pages into our bio, and the size of the bio ends up limited by: - Are we contiguous on disk? - Does bio_add_page() allow us to stuff more in? - is len_to_oe_boundary > 0? The len_to_oe_boundary math starts with U32_MAX, which isn't page or sector aligned, and subtracts from it until it hits zero. In the non-zoned case, the last IO we submit before we hit zero is going to be unaligned, triggering BUGs. This is hard to trigger because bio_add_page() isn't going to make a bio of U32_MAX size unless you give it a perfect set of pages and fully contiguous extents on disk. We can hit it pretty reliably while making large swapfiles during provisioning because the machine is freshly booted, mostly idle, and the disk is freshly formatted. It's also possible to trigger with reads when read_ahead_kb is set to 4GB. The code has been clean up and shifted around a few times, but this flaw has been lurking since the counter was added. I think the commit 24e6c8082208 ("btrfs: simplify main loop in submit_extent_page") ended up exposing the bug. The fix used here is to skip doing math on len_to_oe_boundary unless we've changed it from the default U32_MAX value. bio_add_page() is the real limit we want, and there's no reason to do extra math when block layer is doing it for us. Sample reproducer, note you'll need to change the path to the bdi and device: SUBVOL=/btrfs/swapvol SWAPFILE=$SUBVOL/swapfile SZMB=8192 mkfs.btrfs -f /dev/vdb mount /dev/vdb /btrfs btrfs subvol create $SUBVOL chattr +C $SUBVOL dd if=/dev/zero of=$SWAPFILE bs=1M count=$SZMB sync echo 4 > /proc/sys/vm/drop_caches echo 4194304 > /sys/class/bdi/btrfs-2/read_ahead_kb while true; do echo 1 > /proc/sys/vm/drop_caches echo 1 > /proc/sys/vm/drop_caches dd of=/dev/zero if=$SWAPFILE bs=4096M count=2 iflag=fullblock done Fixes: 24e6c8082208 ("btrfs: simplify main loop in submit_extent_page") CC: stable@vger.kernel.org # 6.4+ Reviewed-by: Sweet Tea Dorminy Reviewed-by: Christoph Hellwig Reviewed-by: Qu Wenruo Signed-off-by: Chris Mason Signed-off-by: David Sterba commit b471965fdb2daa225850e5972d86600992fa398e Author: Anand Jain Date: Fri Jul 28 14:48:13 2023 +0800 btrfs: fix replace/scrub failure with metadata_uuid Fstests with POST_MKFS_CMD="btrfstune -m" (as in the mailing list) reported a few of the test cases failing. The failure scenario can be summarized and simplified as follows: $ mkfs.btrfs -fq -draid1 -mraid1 /dev/sdb1 /dev/sdb2 :0 $ btrfstune -m /dev/sdb1 :0 $ wipefs -a /dev/sdb1 :0 $ mount -o degraded /dev/sdb2 /btrfs :0 $ btrfs replace start -B -f -r 1 /dev/sdb1 /btrfs :1 STDERR: ERROR: ioctl(DEV_REPLACE_START) failed on "/btrfs": Input/output error [11290.583502] BTRFS warning (device sdb2): tree block 22036480 mirror 2 has bad fsid, has 99835c32-49f0-4668-9e66-dc277a96b4a6 want da40350c-33ac-4872-92a8-4948ed8c04d0 [11290.586580] BTRFS error (device sdb2): unable to fix up (regular) error at logical 22020096 on dev /dev/sdb8 physical 1048576 As above, the replace is failing because we are verifying the header with fs_devices::fsid instead of fs_devices::metadata_uuid, despite the metadata_uuid actually being present. To fix this, use fs_devices::metadata_uuid. We copy fsid into fs_devices::metadata_uuid if there is no metadata_uuid, so its fine. Fixes: a3ddbaebc7c9 ("btrfs: scrub: introduce a helper to verify one metadata block") CC: stable@vger.kernel.org # 6.4+ Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 6e8d96909a23c8078ee965bd48bb31cbef2de943 Author: Arnd Bergmann Date: Fri Aug 11 22:36:58 2023 +0200 asm-generic: partially revert "Unify uapi bitsperlong.h for arm64, riscv and loongarch" Unifying the asm-generic headers across 32-bit and 64-bit architectures based on the compiler provided macros was a good idea and appears to work with all user space, but it caused a regression when building old kernels on systems that have the new headers installed in /usr/include, as this combination trips an inconsistency in the kernel's own tools/include headers that are a mix of userspace and kernel-internal headers. This affects kernel builds on arm64, riscv64 and loongarch64 systems that might end up using the "#define __BITS_PER_LONG 32" default from the old tools headers. Backporting the commit into stable kernels would address this, but it would still break building kernels without that backport, and waste time for developers trying to understand the problem. arm64 build machines are rather common, and on riscv64 this can also happen in practice, but loongarch64 is probably new enough to not be used much for building old kernels, so only revert the bits for arm64 and riscv. Link: https://lore.kernel.org/all/20230731160402.GB1823389@dev-arch.thelio-3990X/ Reported-by: Nathan Chancellor Fixes: 8386f58f8deda ("asm-generic: Unify uapi bitsperlong.h for arm64, riscv and loongarch") Acked-by: Catalin Marinas Acked-by: Palmer Dabbelt Tested-by: Nathan Chancellor Signed-off-by: Arnd Bergmann commit 3c78dbf251350fdf3a9dab3b9c3391fb89df208d Merge: 17fd01a243b4a 6d4cc57630a86 Author: Arnd Bergmann Date: Thu Aug 17 14:39:38 2023 +0200 Merge tag 'qcom-arm64-fixes-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes Qualcomm ARM64 fixes for v6.5 This corrects the invalid path specifier for L3 interconnects in the CPU nodes of SM8150 and SM8250. It corrects the compatible of the SC8180X L3 node, to pass the binding check. The crypto core, and its DMA controller, is disabled on SM8350 to avoid the system from crashing at boot while the issue is diagnosed. A thermal zone node name conflict is resolved for PM8150L, on the RB5 board. The UFS vccq voltage is corrected on the SA877P Ride platform, to address observed stability issues. The reg-names of the DSI phy on SC7180 are restored after an accidental search-and-replace update. * tag 'qcom-arm64-fixes-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: dts: qcom: sc7180: Fix DSI0_PHY reg-names arm64: dts: qcom: sa8775p-ride: Update L4C parameters arm64: dts: qcom: qrb5165-rb5: fix thermal zone conflict arm64: dts: qcom: sm8350: fix BAM DMA crash and reboot arm64: dts: qcom: sc8180x: Fix OSM L3 compatible arm64: dts: qcom: sm8250: Fix EPSS L3 interconnect cells arm64: dts: qcom: sm8150: Fix OSM L3 interconnect cells Link: https://lore.kernel.org/r/20230815142042.2459048-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 17fd01a243b4a45239e0e325ff18dd46b33a7661 Merge: e7c12167a2948 7aff940ec8865 Author: Arnd Bergmann Date: Thu Aug 17 14:18:57 2023 +0200 Merge tag 'omap-for-v6.5/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes Fixes for omaps A fix external abort on non-linefetch for am335x that is fixed with a flush of posted write. And two networking fixes for beaglebone mostly for revision c3 to do phy reset with a gpio and to fix a boot time warning. * tag 'omap-for-v6.5/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: am335x-bone-common: Add vcc-supply for on-board eeprom ARM: dts: am335x-bone-common: Add GPIO PHY reset on revision C3 board bus: ti-sysc: Flush posted write on enable before reset Link: https://lore.kernel.org/r/pull-1692158536-457318@atomide.com Signed-off-by: Arnd Bergmann commit e7c12167a2948f4b638785e236a29e76208f8e83 Merge: 6e6d847a8ce18 ebceec271e552 Author: Arnd Bergmann Date: Thu Aug 17 14:16:45 2023 +0200 Merge tag 'v6.5-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/fixes Correct wifi interrupt flags for some boards, fixed wifi on Rock PI4, disabled hs400 speeds for some boards having problems with data intergrity and some dt property/styling fixes. * tag 'v6.5-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: Fix Wifi/Bluetooth on ROCK Pi 4 boards arm64: dts: rockchip: minor whitespace cleanup around '=' arm64: dts: rockchip: Disable HS400 for eMMC on ROCK 4C+ arm64: dts: rockchip: Disable HS400 for eMMC on ROCK Pi 4 arm64: dts: rockchip: add missing space before { on indiedroid nova arm64: dts: rockchip: correct wifi interrupt flag in Box Demo arm64: dts: rockchip: correct wifi interrupt flag in Rock Pi 4B arm64: dts: rockchip: correct wifi interrupt flag in eaidk-610 arm64: dts: rockchip: Drop invalid regulator-init-microvolt property Link: https://lore.kernel.org/r/4519945.8hzESeGDPO@phil Signed-off-by: Arnd Bergmann commit 3d521f9f3663ba7a22e56d339c6632f0ca787371 Author: Shenghao Ding Date: Thu Aug 17 17:32:56 2023 +0800 ASoC: tas2781: fixed register access error when switching to other chips fixed register access error when switching to other tas2781 -- refresh the page inside regmap on the switched tas2781 Signed-off-by: Shenghao Ding Link: https://lore.kernel.org/r/20230817093257.951-1-shenghao-ding@ti.com Signed-off-by: Mark Brown commit e8500a70270334b9abad72fea504ef38a2952274 Author: Simon Trimmer Date: Thu Aug 17 12:27:12 2023 +0100 ASoC: cs35l56: Add an ACPI match table An ACPI ID has been allocated for CS35L56 ASoC devices so that they can be instantiated from ACPI Device entries. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20230817112712.16637-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 897a6b5a030e62c21566551c870d81740f82ca13 Author: Maciej Strozek Date: Thu Aug 17 12:27:11 2023 +0100 ASoC: cs35l56: Read firmware uuid from a device property instead of _SUB Use a device property "cirrus,firmware-uid" to get the unique firmware identifier instead of using ACPI _SUB. There aren't any products that use _SUB. There will not usually be a _SUB in Soundwire nodes. The ACPI can use a _DSD section for custom properties. There is also a need to support instantiating this driver using software nodes. This is for systems where the CS35L56 is a back-end device and the ACPI refers only to the front-end audio device - there will not be any ACPI references to CS35L56. Fixes: e49611252900 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56") Signed-off-by: Maciej Strozek Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20230817112712.16637-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 50b6f2c8297793f7f3315623db78dcff85158e96 Author: Jani Nikula Date: Tue Aug 15 13:19:07 2023 +0300 Revert "drm/edid: Fix csync detailed mode parsing" This reverts commit ca62297b2085b5b3168bd891ca24862242c635a1. Commit ca62297b2085 ("drm/edid: Fix csync detailed mode parsing") fixed EDID detailed mode sync parsing. Unfortunately, there are quite a few displays out there that have bogus (zero) sync field that are broken by the change. Zero means analog composite sync, which is not right for digital displays, and the modes get rejected. Regardless, it used to work, and it needs to continue to work. Revert the change. Rejecting modes with analog composite sync was the part that fixed the gitlab issue 8146 [1]. We'll need to get back to the drawing board with that. [1] https://gitlab.freedesktop.org/drm/intel/-/issues/8146 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8789 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8930 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9044 Fixes: ca62297b2085 ("drm/edid: Fix csync detailed mode parsing") Cc: Ville Syrjälä Cc: dri-devel@lists.freedesktop.org Cc: # v6.4+ Signed-off-by: Jani Nikula Acked-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230815101907.2900768-1-jani.nikula@intel.com commit 54097309620ef0dc2d7083783dc521c6a5fef957 Author: Peter Zijlstra Date: Wed Aug 16 12:44:19 2023 +0200 x86/static_call: Fix __static_call_fixup() Christian reported spurious module load crashes after some of Song's module memory layout patches. Turns out that if the very last instruction on the very last page of the module is a 'JMP __x86_return_thunk' then __static_call_fixup() will trip a fault and die. And while the module rework made this slightly more likely to happen, it's always been possible. Fixes: ee88d363d156 ("x86,static_call: Use alternative RET encoding") Reported-by: Christian Bricart Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20230816104419.GA982867@hirez.programming.kicks-ass.net commit 23d775f12dcd23d052a4927195f15e970e27ab26 Author: Alfred Lee Date: Mon Aug 14 17:13:23 2023 -0700 net: dsa: mv88e6xxx: Wait for EEPROM done before HW reset If the switch is reset during active EEPROM transactions, as in just after an SoC reset after power up, the I2C bus transaction may be cut short leaving the EEPROM internal I2C state machine in the wrong state. When the switch is reset again, the bad state machine state may result in data being read from the wrong memory location causing the switch to enter unexpected mode rendering it inoperational. Fixes: a3dcb3e7e70c ("net: dsa: mv88e6xxx: Wait for EEPROM done after HW reset") Signed-off-by: Alfred Lee Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230815001323.24739-1-l00g33k@gmail.com Signed-off-by: Jakub Kicinski commit 4f3175979e62de3b929bfa54a0db4b87d36257a7 Author: Nathan Lynch Date: Thu Aug 10 22:37:55 2023 -0500 powerpc/rtas_flash: allow user copy to flash block cache objects With hardened usercopy enabled (CONFIG_HARDENED_USERCOPY=y), using the /proc/powerpc/rtas/firmware_update interface to prepare a system firmware update yields a BUG(): kernel BUG at mm/usercopy.c:102! Oops: Exception in kernel mode, sig: 5 [#1] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries Modules linked in: CPU: 0 PID: 2232 Comm: dd Not tainted 6.5.0-rc3+ #2 Hardware name: IBM,8408-E8E POWER8E (raw) 0x4b0201 0xf000004 of:IBM,FW860.50 (SV860_146) hv:phyp pSeries NIP: c0000000005991d0 LR: c0000000005991cc CTR: 0000000000000000 REGS: c0000000148c76a0 TRAP: 0700 Not tainted (6.5.0-rc3+) MSR: 8000000000029033 CR: 24002242 XER: 0000000c CFAR: c0000000001fbd34 IRQMASK: 0 [ ... GPRs omitted ... ] NIP usercopy_abort+0xa0/0xb0 LR usercopy_abort+0x9c/0xb0 Call Trace: usercopy_abort+0x9c/0xb0 (unreliable) __check_heap_object+0x1b4/0x1d0 __check_object_size+0x2d0/0x380 rtas_flash_write+0xe4/0x250 proc_reg_write+0xfc/0x160 vfs_write+0xfc/0x4e0 ksys_write+0x90/0x160 system_call_exception+0x178/0x320 system_call_common+0x160/0x2c4 The blocks of the firmware image are copied directly from user memory to objects allocated from flash_block_cache, so flash_block_cache must be created using kmem_cache_create_usercopy() to mark it safe for user access. Fixes: 6d07d1cd300f ("usercopy: Restrict non-usercopy caches to size 0") Signed-off-by: Nathan Lynch Reviewed-by: Kees Cook [mpe: Trim and indent oops] Signed-off-by: Michael Ellerman Link: https://msgid.link/20230810-rtas-flash-vs-hardened-usercopy-v2-1-dcf63793a938@linux.ibm.com commit dbf46008775516f7f25c95b7760041c286299783 Author: Peter Zijlstra Date: Wed Aug 16 13:59:21 2023 +0200 objtool/x86: Fixup frame-pointer vs rethunk For stack-validation of a frame-pointer build, objtool validates that every CALL instruction is preceded by a frame-setup. The new SRSO return thunks violate this with their RSB stuffing trickery. Extend the __fentry__ exception to also cover the embedded_insn case used for this. This cures: vmlinux.o: warning: objtool: srso_untrain_ret+0xd: call without frame pointer save/setup Fixes: 4ae68b26c3ab ("objtool/x86: Fix SRSO mess") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20230816115921.GH980931@hirez.programming.kicks-ass.net commit 1b254b791d7b7dea6e8adc887fbbd51746d8bb27 Author: Karol Herbst Date: Mon Aug 14 16:49:32 2023 +0200 drm/nouveau/disp: fix use-after-free in error handling of nouveau_connector_create We can't simply free the connector after calling drm_connector_init on it. We need to clean up the drm side first. It might not fix all regressions from commit 2b5d1c29f6c4 ("drm/nouveau/disp: PIOR DP uses GPIO for HPD, not PMGR AUX interrupts"), but at least it fixes a memory corruption in error handling related to that commit. Link: https://lore.kernel.org/lkml/20230806213107.GFZNARG6moWpFuSJ9W@fat_crate.local/ Fixes: 95983aea8003 ("drm/nouveau/disp: add connector class") Signed-off-by: Karol Herbst Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230814144933.3956959-1-kherbst@redhat.com commit 0fd23db0cc74cf6d28d26ce5e7802e982608d830 Author: Shay Drory Date: Sun Jun 25 10:43:03 2023 +0300 net/mlx5: Fix mlx5_cmd_update_root_ft() error flow The cited patch change mlx5_cmd_update_root_ft() to work with multiple peer devices. However, it didn't align the error flow as well. Hence, Fix the error code to work with multiple peer devices. Fixes: 222dd185833e ("{net/RDMA}/mlx5: introduce lag_for_each_peer") Signed-off-by: Shay Drory Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 34a79876d9f77e971115236bcf7b5d14a8ecf542 Author: Dragos Tatulea Date: Tue Aug 1 20:41:03 2023 +0300 net/mlx5e: XDP, Fix fifo overrun on XDP_REDIRECT Before this fix, running high rate traffic through XDP_REDIRECT with multibuf could overrun the fifo used to release the xdp frames after tx completion. This resulted in corrupted data being consumed on the free side. The culplirt was a miscalculation of the fifo size: the maximum ratio between fifo entries / data segments was incorrect. This ratio serves to calculate the max fifo size for a full sq where each packet uses the worst case number of entries in the fifo. This patch fixes the formula and names the constant. It also makes sure that future values will use a power of 2 number of entries for the fifo mask to work. Signed-off-by: Dragos Tatulea Fixes: 3f734b8c594b ("net/mlx5e: XDP, Use multiple single-entry objects in xdpi_fifo") Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit c4d6b5438116c184027b2e911c0f2c7c406fb47c Author: Sven Schnelle Date: Wed Aug 16 17:49:28 2023 +0200 tracing/synthetic: Allocate one additional element for size While debugging another issue I noticed that the stack trace contains one invalid entry at the end: -0 [008] d..4. 26.484201: wake_lat: pid=0 delta=2629976084 000000009cc24024 stack=STACK: => __schedule+0xac6/0x1a98 => schedule+0x126/0x2c0 => schedule_timeout+0x150/0x2c0 => kcompactd+0x9ca/0xc20 => kthread+0x2f6/0x3d8 => __ret_from_fork+0x8a/0xe8 => 0x6b6b6b6b6b6b6b6b This is because the code failed to add the one element containing the number of entries to field_size. Link: https://lkml.kernel.org/r/20230816154928.4171614-4-svens@linux.ibm.com Cc: Masami Hiramatsu Fixes: 00cf3d672a9d ("tracing: Allow synthetic events to pass around stacktraces") Signed-off-by: Sven Schnelle Signed-off-by: Steven Rostedt (Google) commit 887f92e09ef34a949745ad26ce82be69e2dabcf6 Author: Sven Schnelle Date: Wed Aug 16 17:49:27 2023 +0200 tracing/synthetic: Skip first entry for stack traces While debugging another issue I noticed that the stack trace output contains the number of entries on top: -0 [000] d..4. 203.322502: wake_lat: pid=0 delta=2268270616 stack=STACK: => 0x10 => __schedule+0xac6/0x1a98 => schedule+0x126/0x2c0 => schedule_timeout+0x242/0x2c0 => __wait_for_common+0x434/0x680 => __wait_rcu_gp+0x198/0x3e0 => synchronize_rcu+0x112/0x138 => ring_buffer_reset_online_cpus+0x140/0x2e0 => tracing_reset_online_cpus+0x15c/0x1d0 => tracing_set_clock+0x180/0x1d8 => hist_register_trigger+0x486/0x670 => event_hist_trigger_parse+0x494/0x1318 => trigger_process_regex+0x1d4/0x258 => event_trigger_write+0xb4/0x170 => vfs_write+0x210/0xad0 => ksys_write+0x122/0x208 Fix this by skipping the first element. Also replace the pointer logic with an index variable which is easier to read. Link: https://lkml.kernel.org/r/20230816154928.4171614-3-svens@linux.ibm.com Cc: Masami Hiramatsu Fixes: 00cf3d672a9d ("tracing: Allow synthetic events to pass around stacktraces") Signed-off-by: Sven Schnelle Signed-off-by: Steven Rostedt (Google) commit ddeea494a16f32522bce16ee65f191d05d4b8282 Author: Sven Schnelle Date: Wed Aug 16 17:49:26 2023 +0200 tracing/synthetic: Use union instead of casts The current code uses a lot of casts to access the fields member in struct synth_trace_events with different sizes. This makes the code hard to read, and had already introduced an endianness bug. Use a union and struct instead. Link: https://lkml.kernel.org/r/20230816154928.4171614-2-svens@linux.ibm.com Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Fixes: 00cf3d672a9dd ("tracing: Allow synthetic events to pass around stacktraces") Signed-off-by: Sven Schnelle Signed-off-by: Steven Rostedt (Google) commit 9dbd23e42ff0b10c9b02c9e649c76e5228241a8e Author: Borislav Petkov (AMD) Date: Mon Aug 14 21:29:50 2023 +0200 x86/srso: Explain the untraining sequences a bit more The goal is to eventually have a proper documentation about all this. Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230814164447.GFZNpZ/64H4lENIe94@fat_crate.local commit 864bcaa38ee44ec6c0e43f79c2d2997b977e26b2 Author: Peter Zijlstra Date: Mon Aug 14 13:44:35 2023 +0200 x86/cpu/kvm: Provide UNTRAIN_RET_VM Similar to how it doesn't make sense to have UNTRAIN_RET have two untrain calls, it also doesn't make sense for VMEXIT to have an extra IBPB call. This cures VMEXIT doing potentially unret+IBPB or double IBPB. Also, the (SEV) VMEXIT case seems to have been overlooked. Redefine the meaning of the synthetic IBPB flags to: - ENTRY_IBPB -- issue IBPB on entry (was: entry + VMEXIT) - IBPB_ON_VMEXIT -- issue IBPB on VMEXIT And have 'retbleed=ibpb' set *BOTH* feature flags to ensure it retains the previous behaviour and issues IBPB on entry+VMEXIT. The new 'srso=ibpb_vmexit' option only sets IBPB_ON_VMEXIT. Create UNTRAIN_RET_VM specifically for the VMEXIT case, and have that check IBPB_ON_VMEXIT. All this avoids having the VMEXIT case having to check both ENTRY_IBPB and IBPB_ON_VMEXIT and simplifies the alternatives. Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230814121149.109557833@infradead.org commit e7c25c441e9e0fa75b4c83e0b26306b702cfe90d Author: Peter Zijlstra Date: Mon Aug 14 13:44:34 2023 +0200 x86/cpu: Cleanup the untrain mess Since there can only be one active return_thunk, there only needs be one (matching) untrain_ret. It fundamentally doesn't make sense to allow multiple untrain_ret at the same time. Fold all the 3 different untrain methods into a single (temporary) helper stub. Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230814121149.042774962@infradead.org commit 42be649dd1f2eee6b1fb185f1a231b9494cf095f Author: Peter Zijlstra Date: Mon Aug 14 13:44:33 2023 +0200 x86/cpu: Rename srso_(.*)_alias to srso_alias_\1 For a more consistent namespace. [ bp: Fixup names in the doc too. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230814121148.976236447@infradead.org commit d025b7bac07a6e90b6b98b487f88854ad9247c39 Author: Peter Zijlstra Date: Mon Aug 14 13:44:32 2023 +0200 x86/cpu: Rename original retbleed methods Rename the original retbleed return thunk and untrain_ret to retbleed_return_thunk() and retbleed_untrain_ret(). No functional changes. Suggested-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230814121148.909378169@infradead.org commit d43490d0ab824023e11d0b57d0aeec17a6e0ca13 Author: Peter Zijlstra Date: Mon Aug 14 13:44:31 2023 +0200 x86/cpu: Clean up SRSO return thunk mess Use the existing configurable return thunk. There is absolute no justification for having created this __x86_return_thunk alternative. To clarify, the whole thing looks like: Zen3/4 does: srso_alias_untrain_ret: nop2 lfence jmp srso_alias_return_thunk int3 srso_alias_safe_ret: // aliasses srso_alias_untrain_ret just so add $8, %rsp ret int3 srso_alias_return_thunk: call srso_alias_safe_ret ud2 While Zen1/2 does: srso_untrain_ret: movabs $foo, %rax lfence call srso_safe_ret (jmp srso_return_thunk ?) int3 srso_safe_ret: // embedded in movabs instruction add $8,%rsp ret int3 srso_return_thunk: call srso_safe_ret ud2 While retbleed does: zen_untrain_ret: test $0xcc, %bl lfence jmp zen_return_thunk int3 zen_return_thunk: // embedded in the test instruction ret int3 Where Zen1/2 flush the BTB entry using the instruction decoder trick (test,movabs) Zen3/4 use BTB aliasing. SRSO adds a return sequence (srso_safe_ret()) which forces the function return instruction to speculate into a trap (UD2). This RET will then mispredict and execution will continue at the return site read from the top of the stack. Pick one of three options at boot (evey function can only ever return once). [ bp: Fixup commit message uarch details and add them in a comment in the code too. Add a comment about the srso_select_mitigation() dependency on retbleed_select_mitigation(). Add moar ifdeffery for 32-bit builds. Add a dummy srso_untrain_ret_alias() definition for 32-bit alternatives needing the symbol. ] Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230814121148.842775684@infradead.org commit 6ecc10295abb2fdd9c21dd17b34e4cacfd829cd4 Author: Alex Deucher Date: Tue Aug 15 17:25:37 2023 -0400 Revert "Revert "drm/amdgpu/display: change pipe policy for DCN 2.0"" This reverts commit 27dd79c00aeab36cd7542c7a4481a32549038659. It appears MPC_SPLIT_DYNAMIC still causes problems with multiple displays on DCN2.0 hardware. Switch back to MPC_SPLIT_AVOID_MULT_DISP. This increases power usage with multiple displays, but avoids hangs. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2475 Cc: Rodrigo Siqueira Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.4.x commit a7b7d9e8aee4f71b4c7151702fd74237b8cef989 Author: Mario Limonciello Date: Thu May 18 11:52:51 2023 -0500 drm/amd: flush any delayed gfxoff on suspend entry DCN 3.1.4 is reported to hang on s2idle entry if graphics activity is happening during entry. This is because GFXOFF was scheduled as delayed but RLC gets disabled in s2idle entry sequence which will hang GFX IP if not already in GFXOFF. To help this problem, flush any delayed work for GFXOFF early in s2idle entry sequence to ensure that it's off when RLC is changed. commit 4b31b92b143f ("drm/amdgpu: complete gfxoff allow signal during suspend without delay") modified power gating flow so that if called in s0ix that it ensured that GFXOFF wasn't put in work queue but instead processed immediately. This is dead code due to commit 10cb67eb8a1b ("drm/amdgpu: skip CG/PG for gfx during S0ix") because GFXOFF will now not be explicitly called as part of the suspend entry code. Remove that dead code. Signed-off-by: Mario Limonciello Signed-off-by: Tim Huang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit f1740b1ab2703b2a057da7cf33b03297e0381aa0 Author: Tim Huang Date: Mon Aug 14 15:13:04 2023 +0800 drm/amdgpu: skip fence GFX interrupts disable/enable for S0ix GFX v11.0.1 reported fence fallback timer expired issue on SDMA and GFX rings after S0ix resume. This is generated by EOP interrupts are disabled when S0ix suspend but fails to re-enable when resume because of the GFX is in GFXOFF. [ 203.349571] [drm] Fence fallback timer expired on ring sdma0 [ 203.349572] [drm] Fence fallback timer expired on ring gfx_0.0.0 [ 203.861635] [drm] Fence fallback timer expired on ring gfx_0.0.0 For S0ix, GFX is in GFXOFF state, avoid to touch the GFX registers to configure the fence driver interrupts for rings that belong to GFX. The interrupts configuration will be restored by GFXOFF exit. Signed-off-by: Tim Huang Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit b25fdc048cb2250c7e859184f54d3261b55ad099 Author: James Zhu Date: Wed Aug 9 16:45:04 2023 -0400 drm/amdgpu: skip xcp drm device allocation when out of drm resource Return 0 when drm device alloc failed with -ENOSPC in order to allow amdgpu drive loading. But the xcp without drm device node assigned won't be visiable in user space. This helps amdgpu driver loading on system which has more than 64 nodes, the current limitation. The proposal to add more drm nodes is discussed in public, which will support up to 2^20 nodes totally. kernel drm: https://lore.kernel.org/lkml/20230724211428.3831636-1-michal.winiarski@intel.com/T/ libdrm: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/305 Signed-off-by: James Zhu Acked-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit d621114ffba56b032e91ee82d6469b2f9f0b2427 Author: Asad Kamal Date: Thu Aug 10 20:44:54 2023 +0800 drm/amd/pm: Update pci link width for smu v13.0.6 Update addresses of PCIE link width registers, & link width format used to populate gpu metrics table for smu v13.0.6 v2: Removed ESM register update v3: Updated patch subject and message Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 8d036427f0042a91136e6f19a39542eedec4e96c Author: Lijo Lazar Date: Thu Aug 10 16:10:03 2023 +0530 drm/amd/pm: Fix temperature unit of SMU v13.0.6 Temperature needs to be reported in millidegree Celsius. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 6a92761a86817ad15c9a562e2a809386237fae3e Author: Umio Yasuno Date: Tue Aug 8 06:40:42 2023 +0000 drm/amdgpu/pm: fix throttle_status for other than MP1 11.0.7 Use the right metrics table version based on the firmware. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2720 Reviewed-by: Evan Quan Signed-off-by: Umio Yasuno Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 0d6f374c0c66e8ecc2897f0837d2cb4bd169bb42 Author: Jiadong Zhu Date: Tue Aug 8 10:59:25 2023 +0800 drm/amdgpu: disable mcbp if parameter zero is set The parameter amdgpu_mcbp shall have priority against the default value calculated from the chip version. User could disable mcbp by setting the parameter mcbp as zero. v2: do not trigger preemption in sw ring muxer when mcbp is disabled. Signed-off-by: Jiadong Zhu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 5450be6befc63670f2c05aa6773a8e437b39a3fe Author: Zheng Yejian Date: Sat Aug 5 11:38:16 2023 +0800 selftests/ftrace: Add a basic testcase for snapshot This testcase is constrived to reproduce a problem that the cpu buffers become unavailable which is due to 'record_disabled' of array_buffer and max_buffer being messed up. Local test result after bugfix: # ./ftracetest test.d/00basic/snapshot1.tc === Ftrace unit tests === [1] Snapshot and tracing_cpumask [PASS] [2] (instance) Snapshot and tracing_cpumask [PASS] # of passed: 2 # of failed: 0 # of unresolved: 0 # of untested: 0 # of unsupported: 0 # of xfailed: 0 # of undefined(test bug): 0 Link: https://lkml.kernel.org/r/20230805033816.3284594-3-zhengyejian1@huawei.com Cc: Cc: Cc: Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit b71645d6af10196c46cbe3732de2ea7d36b3ff6d Author: Zheng Yejian Date: Sat Aug 5 11:38:15 2023 +0800 tracing: Fix cpu buffers unavailable due to 'record_disabled' missed Trace ring buffer can no longer record anything after executing following commands at the shell prompt: # cd /sys/kernel/tracing # cat tracing_cpumask fff # echo 0 > tracing_cpumask # echo 1 > snapshot # echo fff > tracing_cpumask # echo 1 > tracing_on # echo "hello world" > trace_marker -bash: echo: write error: Bad file descriptor The root cause is that: 1. After `echo 0 > tracing_cpumask`, 'record_disabled' of cpu buffers in 'tr->array_buffer.buffer' became 1 (see tracing_set_cpumask()); 2. After `echo 1 > snapshot`, 'tr->array_buffer.buffer' is swapped with 'tr->max_buffer.buffer', then the 'record_disabled' became 0 (see update_max_tr()); 3. After `echo fff > tracing_cpumask`, the 'record_disabled' become -1; Then array_buffer and max_buffer are both unavailable due to value of 'record_disabled' is not 0. To fix it, enable or disable both array_buffer and max_buffer at the same time in tracing_set_cpumask(). Link: https://lkml.kernel.org/r/20230805033816.3284594-2-zhengyejian1@huawei.com Cc: Cc: Cc: Fixes: 71babb2705e2 ("tracing: change CPU ring buffer state from tracing_cpumask") Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit b6360a5ec31d160d58c1a64387b323b556cedca8 Author: Kenneth Feng Date: Wed Aug 9 18:06:05 2023 +0800 drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0 drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0 V2: depend on pm.no_fan to check Signed-off-by: Kenneth Feng Reviewed-by: Alex Deucher Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 2f2beb8874cb0844e84ad26e990f05f4f13ff63f Author: Andrii Staikov Date: Wed Aug 2 09:47:32 2023 +0200 i40e: fix misleading debug logs Change "write" into the actual "read" word. Change parameters description. Fixes: 7073f46e443e ("i40e: Add AQ commands for NVM Update for X722") Signed-off-by: Aleksandr Loktionov Signed-off-by: Andrii Staikov Signed-off-by: Tony Nguyen commit 751969e5b1196821ef78f0aa664a8a97c92c9057 Author: Piotr Gardocki Date: Mon Aug 7 16:46:04 2023 +0200 iavf: fix FDIR rule fields masks validation Return an error if a field's mask is neither full nor empty. When a mask is only partial the field is not being used for rule programming but it gives a wrong impression it is used. Fix by returning an error on any partial mask to make it clear they are not supported. The ip_ver assignment is moved earlier in code to allow using it in iavf_validate_fdir_fltr_masks. Fixes: 527691bf0682 ("iavf: Support IPv4 Flow Director filters") Fixes: e90cbc257a6f ("iavf: Support IPv6 Flow Director filters") Signed-off-by: Piotr Gardocki Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit ca09f772cccaeec4cd05a21528c37a260aa2dd2c Author: Mingzheng Xing Date: Thu Aug 10 00:56:48 2023 +0800 riscv: Handle zicsr/zifencei issue between gcc and binutils Binutils-2.38 and GCC-12.1.0 bumped[0][1] the default ISA spec to the newer 20191213 version which moves some instructions from the I extension to the Zicsr and Zifencei extensions. So if one of the binutils and GCC exceeds that version, we should explicitly specifying Zicsr and Zifencei via -march to cope with the new changes. but this only occurs when binutils >= 2.36 and GCC >= 11.1.0. It's a different story when binutils < 2.36. binutils-2.36 supports the Zifencei extension[2] and splits Zifencei and Zicsr from I[3]. GCC-11.1.0 is particular[4] because it add support Zicsr and Zifencei extension for -march. binutils-2.35 does not support the Zifencei extension, and does not need to specify Zicsr and Zifencei when working with GCC >= 12.1.0. To make our lives easier, let's relax the check to binutils >= 2.36 in CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI. For the other two cases, where clang < 17 or GCC < 11.1.0, we will deal with them in CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC. For more information, please refer to: commit 6df2a016c0c8 ("riscv: fix build with binutils 2.38") commit e89c2e815e76 ("riscv: Handle zicsr/zifencei issues between clang and binutils") Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc [0] Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=98416dbb0a62579d4a7a4a76bab51b5b52fec2cd [1] Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5a1b31e1e1cee6e9f1c92abff59cdcfff0dddf30 [2] Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=729a53530e86972d1143553a415db34e6e01d5d2 [3] Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b03be74bad08c382da47e048007a78fa3fb4ef49 [4] Link: https://lore.kernel.org/all/20230308220842.1231003-1-conor@kernel.org Link: https://lore.kernel.org/all/20230223220546.52879-1-conor@kernel.org Reviewed-by: Conor Dooley Acked-by: Guo Ren Cc: Signed-off-by: Mingzheng Xing Link: https://lore.kernel.org/r/20230809165648.21071-1-xingmingzheng@iscas.ac.cn Signed-off-by: Palmer Dabbelt commit 4b05b993900dd3eba0fc83ef5c5ddc7d65d786c6 Author: Alexandre Ghiti Date: Fri Aug 11 17:06:04 2023 +0200 riscv: uaccess: Return the number of bytes effectively not copied It was reported that the riscv kernel hangs while executing the test in [1]. Indeed, the test hangs when trying to write a buffer to a file. The problem is that the riscv implementation of raw_copy_from_user() does not return the correct number of bytes not written when an exception happens and is fixed up, instead it always returns the initial size to copy, even if some bytes were actually copied. generic_perform_write() pre-faults the user pages and bails out if nothing can be written, otherwise it will access the userspace buffer: here the riscv implementation keeps returning it was not able to copy any byte though the pre-faulting indicates otherwise. So generic_perform_write() keeps retrying to access the user memory and ends up in an infinite loop. Note that before the commit mentioned in [1] that introduced this regression, it worked because generic_perform_write() would bail out if only one byte could not be written. So fix this by returning the number of bytes effectively not written in __asm_copy_[to|from]_user() and __clear_user(), as it is expected. Link: https://lore.kernel.org/linux-riscv/20230309151841.bomov6hq3ybyp42a@debian/ [1] Fixes: ebcbd75e3962 ("riscv: Fix the bug in memory access fixup code") Reported-by: Bo YU Closes: https://lore.kernel.org/linux-riscv/20230309151841.bomov6hq3ybyp42a@debian/#t Reported-by: Aurelien Jarno Closes: https://lore.kernel.org/linux-riscv/ZNOnCakhwIeue3yr@aurel32.net/ Signed-off-by: Alexandre Ghiti Reviewed-by: Björn Töpel Tested-by: Aurelien Jarno Reviewed-by: Aurelien Jarno Link: https://lore.kernel.org/r/20230811150604.1621784-1-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit ebc9cb03b21e263db607a7604134a195aa314ebb Author: Guo Ren Date: Sat Jul 15 20:15:06 2023 -0400 riscv: stack: Fixup independent softirq stack for CONFIG_FRAME_POINTER=n The independent softirq stack uses s0 to save & restore sp, but s0 would be corrupted when CONFIG_FRAME_POINTER=n. So add s0 in the clobber list to fix the problem. Fixes: dd69d07a5a6c ("riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK") Cc: stable@vger.kernel.org Reported-by: Zhangjin Wu Signed-off-by: Guo Ren Signed-off-by: Guo Ren Tested-by: Drew Fustini Link: https://lore.kernel.org/r/20230716001506.3506041-3-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 8d0be64154cf24660a947b84340e8d5bb1af855a Author: Guo Ren Date: Sat Jul 15 20:15:05 2023 -0400 riscv: stack: Fixup independent irq stack for CONFIG_FRAME_POINTER=n The independent irq stack uses s0 to save & restore sp, but s0 would be corrupted when CONFIG_FRAME_POINTER=n. So add s0 in the clobber list to fix the problem. Fixes: 163e76cc6ef4 ("riscv: stack: Support HAVE_IRQ_EXIT_ON_IRQ_STACK") Cc: stable@vger.kernel.org Reported-by: Zhangjin Wu Signed-off-by: Guo Ren Signed-off-by: Guo Ren Tested-by: Drew Fustini Link: https://lore.kernel.org/r/20230716001506.3506041-2-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 79bc3f85c51fc352f8e684ba6b626f677a3aa230 Author: Nam Cao Date: Mon Jul 31 20:39:25 2023 +0200 riscv: correct riscv_insn_is_c_jr() and riscv_insn_is_c_jalr() The instructions c.jr and c.jalr must have rs1 != 0, but riscv_insn_is_c_jr() and riscv_insn_is_c_jalr() do not check for this. So, riscv_insn_is_c_jr() can match a reserved encoding, while riscv_insn_is_c_jalr() can match the c.ebreak instruction. Rewrite them with check for rs1 != 0. Signed-off-by: Nam Cao Reviewed-by: Charlie Jenkins Fixes: ec5f90877516 ("RISC-V: Move riscv_insn_is_* macros into a common header") Link: https://lore.kernel.org/r/20230731183925.152145-1-namcaov@gmail.com Signed-off-by: Palmer Dabbelt commit 52449c17bdd1540940e21511612b58acebc49c06 Author: Celeste Liu Date: Tue Aug 1 22:15:16 2023 +0800 riscv: entry: set a0 = -ENOSYS only when syscall != -1 When we test seccomp with 6.4 kernel, we found errno has wrong value. If we deny NETLINK_AUDIT with EAFNOSUPPORT, after f0bddf50586d, we will get ENOSYS instead. We got same result with commit 9c2598d43510 ("riscv: entry: Save a0 prior syscall_enter_from_user_mode()"). After analysing code, we think that regs->a0 = -ENOSYS should only be executed when syscall != -1. In __seccomp_filter, when seccomp rejected this syscall with specified errno, they will set a0 to return number as syscall ABI, and then return -1. This return number is finally pass as return number of syscall_enter_from_user_mode, and then is compared with NR_syscalls after converted to ulong (so it will be ULONG_MAX). The condition syscall < NR_syscalls will always be false, so regs->a0 = -ENOSYS is always executed. It covered a0 set by seccomp, so we always get ENOSYS when match seccomp RET_ERRNO rule. Fixes: f0bddf50586d ("riscv: entry: Convert to generic entry") Reported-by: Felix Yan Co-developed-by: Ruizhe Pan Signed-off-by: Ruizhe Pan Co-developed-by: Shiqi Zhang Signed-off-by: Shiqi Zhang Signed-off-by: Celeste Liu Tested-by: Felix Yan Tested-by: Emil Renner Berthing Reviewed-by: Björn Töpel Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/20230801141607.435192-1-CoelacanthusHex@gmail.com Signed-off-by: Palmer Dabbelt commit 2d218b45848b92b03b220bf4d9bef29f058f866f Author: Chao Song Date: Wed Aug 16 16:33:11 2023 +0300 ASoC: SOF: ipc4-pcm: fix possible null pointer deference The call to snd_sof_find_spcm_dai() could return NULL, add nullable check for the return value to avoid null pointer defenrece. Fixes: 7cb19007baba ("ASoC: SOF: ipc4-pcm: add hw_params") Signed-off-by: Chao Song Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230816133311.7523-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 46cdff2369cbdf8d78081a22526e77bd1323f563 Author: Kailang Yang Date: Tue Aug 15 15:54:23 2023 +0800 ALSA: hda/realtek - Remodified 3k pull low procedure Set spec->en_3kpull_low default to true. Then fillback ALC236 and ALC257 to false. Additional note: this addresses a regression caused by the previous fix 69ea4c9d02b7 ("ALSA: hda/realtek - remove 3k pull low procedure"). The previous workaround was applied too widely without necessity, which resulted in the pop noise at PM again. This patch corrects the condition and restores the old behavior for the devices that don't suffer from the original problem. Fixes: 69ea4c9d02b7 ("ALSA: hda/realtek - remove 3k pull low procedure") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217732 Link: https://lore.kernel.org/r/01e212a538fc407ca6edd10b81ff7b05@realtek.com Signed-off-by: Kailang Yang Signed-off-by: Takashi Iwai commit 3386fb86ecdef0d39ee3306aea8ec290e61b934f Author: Bartosz Golaszewski Date: Fri Aug 11 21:30:34 2023 +0200 gpiolib: fix reference leaks when removing GPIO chips still in use After we remove a GPIO chip that still has some requested descriptors, gpiod_free_commit() will fail and we will never put the references to the GPIO device and the owning module in gpiod_free(). Rework this function to: - not warn on desc == NULL as this is a use-case on which most free functions silently return - put the references to desc->gdev and desc->gdev->owner unconditionally so that the release callback actually gets called when the remaining references are dropped by external GPIO users Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit 20d9b3b5f2749673e1b5e9c8b0846ff6deff4032 Author: Andy Shevchenko Date: Mon Aug 14 14:26:15 2023 +0300 gpiolib: sysfs: Do unexport GPIO when user asks for it It seems that sysfs interface implicitly relied on the gpiod_free() to unexport the line. This is logically incorrect as core gpiolib should not deal with sysfs so instead of restoring it, let's call gpiod_unexport() from sysfs code. Fixes: b0ce9ce408b6 ("gpiolib: Do not unexport GPIO on freeing") Reported-by: Marek Behún Closes: https://lore.kernel.org/r/20230808102828.4a9eac09@dellmb Signed-off-by: Andy Shevchenko Tested-by: Marek Behún [Bartosz: tweaked the commit message] Signed-off-by: Bartosz Golaszewski commit de4c5efeeca7172306bdc2e3efc0c6c3953bb338 Merge: b35c968363c03 23185c6aed1ff Author: David S. Miller Date: Wed Aug 16 11:11:24 2023 +0100 Merge tag 'nf-23-08-16' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Florisn Westphal says: ==================== These are netfilter fixes for the *net* tree. First patch resolves a false-positive lockdep splat: rcu_dereference is used outside of rcu read lock. Let lockdep validate that the transaction mutex is locked. Second patch fixes a kdoc warning added in previous PR. Third patch fixes a memory leak: The catchall element isn't disabled correctly, this allows userspace to deactivate the element again. This results in refcount underflow which in turn prevents memory release. This was always broken since the feature was added in 5.13. Patch 4 fixes an incorrect change in the previous pull request: Adding a duplicate key to a set should work if the duplicate key has expired, restore this behaviour. All from myself. Patch #5 resolves an old historic artifact in sctp conntrack: a 300ms timeout for shutdown_ack. Increase this to 3s. From Xin Long. Patch #6 fixes a sysctl data race in ipvs, two threads can clobber the sysctl value, from Sishuai Gong. This is a day-0 bug that predates git history. Patches 7, 8 and 9, from Pablo Neira Ayuso, are also followups for the previous GC rework in nf_tables: The netlink notifier and the netns exit path must both increment the gc worker seqcount, else worker may encounter stale (free'd) pointers. ================ Signed-off-by: David S. Miller commit b35c968363c036e93f95cb233182f2d1c44605c2 Author: Prasad Pandit Date: Wed Aug 16 13:26:06 2023 +0530 ipv6: fix indentation of a config attribute Fix indentation of a type attribute of IPV6_VTI config entry. Signed-off-by: Prasad Pandit Signed-off-by: David S. Miller commit 0b70f1950e79b37df5617c83ed1ad1a4cc7fc89c Author: Simon Horman Date: Tue Aug 15 17:27:49 2023 +0200 mailmap: add entries for Simon Horman Retire some of my email addresses from Kernel activities. Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 5fc43ce03bc3e50d16a94ec31fba3318ff1cbcd0 Merge: 9944d203fa637 f3ec2b5d879ef Author: David S. Miller Date: Wed Aug 16 08:57:41 2023 +0100 Merge tag 'ipsec-2023-08-15' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== 1) Fix a slab-out-of-bounds read in xfrm_address_filter. From Lin Ma. 2) Fix the pfkey sadb_x_filter validation. From Lin Ma. 3) Use the correct nla_policy structure for XFRMA_SEC_CTX. From Lin Ma. 4) Fix warnings triggerable by bad packets in the encap functions. From Herbert Xu. 5) Fix some slab-use-after-free in decode_session6. From Zhengchao Shao. 6) Fix a possible NULL piointer dereference in xfrm_update_ae_params. Lin Ma. 7) Add a forgotten nla_policy for XFRMA_MTIMER_THRESH. From Lin Ma. 8) Don't leak offloaded policies. From Leon Romanovsky. 9) Delete also the offloading part of an acquire state. From Leon Romanovsky. Please pull or let me know if there are problems. commit 095b8303f3835c68ac4a8b6d754ca1c3b6230711 Author: Peter Zijlstra Date: Mon Aug 14 13:44:30 2023 +0200 x86/alternative: Make custom return thunk unconditional There is infrastructure to rewrite return thunks to point to any random thunk one desires, unwrap that from CALL_THUNKS, which up to now was the sole user of that. [ bp: Make the thunks visible on 32-bit and add ifdeffery for the 32-bit builds. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230814121148.775293785@infradead.org commit 4ae68b26c3ab5a82aa271e6e9fc9b1a06e1d6b40 Author: Peter Zijlstra Date: Mon Aug 14 13:44:29 2023 +0200 objtool/x86: Fix SRSO mess Objtool --rethunk does two things: - it collects all (tail) call's of __x86_return_thunk and places them into .return_sites. These are typically compiler generated, but RET also emits this same. - it fudges the validation of the __x86_return_thunk symbol; because this symbol is inside another instruction, it can't actually find the instruction pointed to by the symbol offset and gets upset. Because these two things pertained to the same symbol, there was no pressing need to separate these two separate things. However, alas, along comes SRSO and more crazy things to deal with appeared. The SRSO patch itself added the following symbol names to identify as rethunk: 'srso_untrain_ret', 'srso_safe_ret' and '__ret' Where '__ret' is the old retbleed return thunk, 'srso_safe_ret' is a new similarly embedded return thunk, and 'srso_untrain_ret' is completely unrelated to anything the above does (and was only included because of that INT3 vs UD2 issue fixed previous). Clear things up by adding a second category for the embedded instruction thing. Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230814121148.704502245@infradead.org commit af023ef335f13c8b579298fc432daeef609a9e60 Author: Peter Zijlstra Date: Mon Aug 14 13:44:28 2023 +0200 x86/cpu: Fix up srso_safe_ret() and __x86_return_thunk() vmlinux.o: warning: objtool: srso_untrain_ret() falls through to next function __x86_return_skl() vmlinux.o: warning: objtool: __x86_return_thunk() falls through to next function __x86_return_skl() This is because these functions (can) end with CALL, which objtool does not consider a terminating instruction. Therefore, replace the INT3 instruction (which is a non-fatal trap) with UD2 (which is a fatal-trap). This indicates execution will not continue past this point. Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230814121148.637802730@infradead.org commit 77f67119004296a9b2503b377d610e08b08afc2a Author: Peter Zijlstra Date: Mon Aug 14 13:44:27 2023 +0200 x86/cpu: Fix __x86_return_thunk symbol type Commit fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") reimplemented __x86_return_thunk with a mix of SYM_FUNC_START and SYM_CODE_END, this is not a sane combination. Since nothing should ever actually 'CALL' this, make it consistently CODE. Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230814121148.571027074@infradead.org commit 9944d203fa63721b87eee84a89f7275dc3d25c05 Author: Artem Chernyshev Date: Tue Aug 15 00:00:30 2023 +0300 broadcom: b44: Use b44_writephy() return value Return result of b44_writephy() instead of zero to deal with possible error. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Artem Chernyshev Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 270d73e6507f9c7fff43844d74f86365df000b36 Author: Scott Mayhew Date: Wed Aug 16 00:23:56 2023 -0500 smb: client: fix null auth Commit abdb1742a312 removed code that clears ctx->username when sec=none, so attempting to mount with '-o sec=none' now fails with -EACCES. Fix it by adding that logic to the parsing of the 'sec' option, as well as checking if the mount is using null auth before setting the username when parsing the 'user' option. Fixes: abdb1742a312 ("cifs: get rid of mount options string parsing") Cc: stable@vger.kernel.org Signed-off-by: Scott Mayhew Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit a552bfa16bab4ce901ee721346a28c4e483f4066 Author: Jakub Kicinski Date: Mon Aug 14 13:38:40 2023 -0700 net: openvswitch: reject negative ifindex Recent changes in net-next (commit 759ab1edb56c ("net: store netdevs in an xarray")) refactored the handling of pre-assigned ifindexes and let syzbot surface a latent problem in ovs. ovs does not validate ifindex, making it possible to create netdev ports with negative ifindex values. It's easy to repro with YNL: $ ./cli.py --spec netlink/specs/ovs_datapath.yaml \ --do new \ --json '{"upcall-pid": 1, "name":"my-dp"}' $ ./cli.py --spec netlink/specs/ovs_vport.yaml \ --do new \ --json '{"upcall-pid": "00000001", "name": "some-port0", "dp-ifindex":3,"ifindex":4294901760,"type":2}' $ ip link show -65536: some-port0: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 7a:48:21:ad:0b:fb brd ff:ff:ff:ff:ff:ff ... Validate the inputs. Now the second command correctly returns: $ ./cli.py --spec netlink/specs/ovs_vport.yaml \ --do new \ --json '{"upcall-pid": "00000001", "name": "some-port0", "dp-ifindex":3,"ifindex":4294901760,"type":2}' lib.ynl.NlError: Netlink error: Numerical result out of range nl_len = 108 (92) nl_flags = 0x300 nl_type = 2 error: -34 extack: {'msg': 'integer out of range', 'unknown': [[type:4 len:36] b'\x0c\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x03\x00\xff\xff\xff\x7f\x00\x00\x00\x00\x08\x00\x01\x00\x08\x00\x00\x00'], 'bad-attr': '.ifindex'} Accept 0 since it used to be silently ignored. Fixes: 54c4ef34c4b6 ("openvswitch: allow specifying ifindex of new interfaces") Reported-by: syzbot+7456b5dcf65111553320@syzkaller.appspotmail.com Reviewed-by: Leon Romanovsky Reviewed-by: Aaron Conole Link: https://lore.kernel.org/r/20230814203840.2908710-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit dafcbce07136d799edc4c67f04f9fd69ff1eac1f Author: Ziyang Xuan Date: Mon Aug 14 11:23:01 2023 +0800 team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves Similar to commit 01f4fd270870 ("bonding: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves"), we can trigger BUG_ON(!vlan_info) in unregister_vlan_dev() with the following testcase: # ip netns add ns1 # ip netns exec ns1 ip link add team1 type team # ip netns exec ns1 ip link add team_slave type veth peer veth2 # ip netns exec ns1 ip link set team_slave master team1 # ip netns exec ns1 ip link add link team_slave name team_slave.10 type vlan id 10 protocol 802.1ad # ip netns exec ns1 ip link add link team1 name team1.10 type vlan id 10 protocol 802.1ad # ip netns exec ns1 ip link set team_slave nomaster # ip netns del ns1 Add S-VLAN tag related features support to team driver. So the team driver will always propagate the VLAN info to its slaves. Fixes: 8ad227ff89a7 ("net: vlan: add 802.1ad support") Suggested-by: Ido Schimmel Signed-off-by: Ziyang Xuan Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230814032301.2804971-1-william.xuanziyang@huawei.com Signed-off-by: Jakub Kicinski commit 096516d092d54604d590827d05b1022c8f326639 Author: Justin Chen Date: Sat Aug 12 21:41:47 2023 -0700 net: phy: broadcom: stub c45 read/write for 54810 The 54810 does not support c45. The mmd_phy_indirect accesses return arbirtary values leading to odd behavior like saying it supports EEE when it doesn't. We also see that reading/writing these non-existent MMD registers leads to phy instability in some cases. Fixes: b14995ac2527 ("net: phy: broadcom: Add BCM54810 PHY entry") Signed-off-by: Justin Chen Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/1691901708-28650-1-git-send-email-justin.chen@broadcom.com Signed-off-by: Jakub Kicinski commit 23185c6aed1ffb8fc44087880ba2767aba493779 Author: Pablo Neira Ayuso Date: Tue Aug 15 15:39:02 2023 +0200 netfilter: nft_dynset: disallow object maps Do not allow to insert elements from datapath to objects maps. Fixes: 8aeff920dcc9 ("netfilter: nf_tables: add stateful object reference to set elements") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 02c6c24402bf1c1e986899c14ba22a10b510916b Author: Pablo Neira Ayuso Date: Tue Aug 15 15:39:01 2023 +0200 netfilter: nf_tables: GC transaction race with netns dismantle Use maybe_get_net() since GC workqueue might race with netns exit path. Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 6a33d8b73dfac0a41f3877894b38082bd0c9a5bc Author: Pablo Neira Ayuso Date: Tue Aug 15 15:39:00 2023 +0200 netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path Netlink event path is missing a synchronization point with GC transactions. Add GC sequence number update to netns release path and netlink event path, any GC transaction losing race will be discarded. Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 5310760af1d4fbea1452bfc77db5f9a680f7ae47 Author: Sishuai Gong Date: Thu Aug 10 15:12:42 2023 -0400 ipvs: fix racy memcpy in proc_do_sync_threshold When two threads run proc_do_sync_threshold() in parallel, data races could happen between the two memcpy(): Thread-1 Thread-2 memcpy(val, valp, sizeof(val)); memcpy(valp, val, sizeof(val)); This race might mess up the (struct ctl_table *) table->data, so we add a mutex lock to serialize them. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Link: https://lore.kernel.org/netdev/B6988E90-0A1E-4B85-BF26-2DAF6D482433@gmail.com/ Signed-off-by: Sishuai Gong Acked-by: Simon Horman Acked-by: Julian Anastasov Signed-off-by: Florian Westphal commit 9bfab6d23a2865966a4f89a96536fbf23f83bc8c Author: Xin Long Date: Tue Aug 15 14:08:47 2023 -0400 netfilter: set default timeout to 3 secs for sctp shutdown send and recv state In SCTP protocol, it is using the same timer (T2 timer) for SHUTDOWN and SHUTDOWN_ACK retransmission. However in sctp conntrack the default timeout value for SCTP_CONNTRACK_SHUTDOWN_ACK_SENT state is 3 secs while it's 300 msecs for SCTP_CONNTRACK_SHUTDOWN_SEND/RECV state. As Paolo Valerio noticed, this might cause unwanted expiration of the ct entry. In my test, with 1s tc netem delay set on the NAT path, after the SHUTDOWN is sent, the sctp ct entry enters SCTP_CONNTRACK_SHUTDOWN_SEND state. However, due to 300ms (too short) delay, when the SHUTDOWN_ACK is sent back from the peer, the sctp ct entry has expired and been deleted, and then the SHUTDOWN_ACK has to be dropped. Also, it is confusing these two sysctl options always show 0 due to all timeout values using sec as unit: net.netfilter.nf_conntrack_sctp_timeout_shutdown_recd = 0 net.netfilter.nf_conntrack_sctp_timeout_shutdown_sent = 0 This patch fixes it by also using 3 secs for sctp shutdown send and recv state in sctp conntrack, which is also RTO.initial value in SCTP protocol. Note that the very short time value for SCTP_CONNTRACK_SHUTDOWN_SEND/RECV was probably used for a rare scenario where SHUTDOWN is sent on 1st path but SHUTDOWN_ACK is replied on 2nd path, then a new connection started immediately on 1st path. So this patch also moves from SHUTDOWN_SEND/RECV to CLOSE when receiving INIT in the ORIGINAL direction. Fixes: 9fb9cbb1082d ("[NETFILTER]: Add nf_conntrack subsystem.") Reported-by: Paolo Valerio Signed-off-by: Xin Long Reviewed-by: Simon Horman Signed-off-by: Florian Westphal commit 7845914f45f066497ac75b30c50dbc735e84e884 Author: Florian Westphal Date: Sat Aug 12 20:03:57 2023 +0200 netfilter: nf_tables: don't fail inserts if duplicate has expired nftables selftests fail: run-tests.sh testcases/sets/0044interval_overlap_0 Expected: 0-2 . 0-3, got: W: [FAILED] ./testcases/sets/0044interval_overlap_0: got 1 Insertion must ignore duplicate but expired entries. Moreover, there is a strange asymmetry in nft_pipapo_activate: It refetches the current element, whereas the other ->activate callbacks (bitmap, hash, rhash, rbtree) use elem->priv. Same for .remove: other set implementations take elem->priv, nft_pipapo_remove fetches elem->priv, then does a relookup, remove this. I suspect this was the reason for the change that prompted the removal of the expired check in pipapo_get() in the first place, but skipping exired elements there makes no sense to me, this helper is used for normal get requests, insertions (duplicate check) and deactivate callback. In first two cases expired elements must be skipped. For ->deactivate(), this gets called for DELSETELEM, so it seems to me that expired elements should be skipped as well, i.e. delete request should fail with -ENOENT error. Fixes: 24138933b97b ("netfilter: nf_tables: don't skip expired elements during walk") Signed-off-by: Florian Westphal commit 90e5b3462efa37b8bba82d7c4e63683856e188af Author: Florian Westphal Date: Sat Aug 12 13:05:16 2023 +0200 netfilter: nf_tables: deactivate catchall elements in next generation When flushing, individual set elements are disabled in the next generation via the ->flush callback. Catchall elements are not disabled. This is incorrect and may lead to double-deactivations of catchall elements which then results in memory leaks: WARNING: CPU: 1 PID: 3300 at include/net/netfilter/nf_tables.h:1172 nft_map_deactivate+0x549/0x730 CPU: 1 PID: 3300 Comm: nft Not tainted 6.5.0-rc5+ #60 RIP: 0010:nft_map_deactivate+0x549/0x730 [..] ? nft_map_deactivate+0x549/0x730 nf_tables_delset+0xb66/0xeb0 (the warn is due to nft_use_dec() detecting underflow). Fixes: aaa31047a6d2 ("netfilter: nftables: add catch-all set element support") Reported-by: lonial con Signed-off-by: Florian Westphal commit 08713cb006b6f07434f276c5ee214fb20c7fd965 Author: Florian Westphal Date: Thu Aug 10 23:59:03 2023 +0200 netfilter: nf_tables: fix kdoc warnings after gc rework Jakub Kicinski says: We've got some new kdoc warnings here: net/netfilter/nft_set_pipapo.c:1557: warning: Function parameter or member '_set' not described in 'pipapo_gc' net/netfilter/nft_set_pipapo.c:1557: warning: Excess function parameter 'set' description in 'pipapo_gc' include/net/netfilter/nf_tables.h:577: warning: Function parameter or member 'dead' not described in 'nft_set' Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane") Fixes: f6c383b8c31a ("netfilter: nf_tables: adapt set backend to use GC transaction API") Reported-by: Jakub Kicinski Closes: https://lore.kernel.org/netdev/20230810104638.746e46f1@kernel.org/ Signed-off-by: Florian Westphal commit b9f052dc68f69dac89fe1e24693354c033daa091 Author: Florian Westphal Date: Tue Aug 8 20:40:17 2023 +0200 netfilter: nf_tables: fix false-positive lockdep splat ->abort invocation may cause splat on debug kernels: WARNING: suspicious RCU usage net/netfilter/nft_set_pipapo.c:1697 suspicious rcu_dereference_check() usage! [..] rcu_scheduler_active = 2, debug_locks = 1 1 lock held by nft/133554: [..] (nft_net->commit_mutex){+.+.}-{3:3}, at: nf_tables_valid_genid [..] lockdep_rcu_suspicious+0x1ad/0x260 nft_pipapo_abort+0x145/0x180 __nf_tables_abort+0x5359/0x63d0 nf_tables_abort+0x24/0x40 nfnetlink_rcv+0x1a0a/0x22c0 netlink_unicast+0x73c/0x900 netlink_sendmsg+0x7f0/0xc20 ____sys_sendmsg+0x48d/0x760 Transaction mutex is held, so parallel updates are not possible. Switch to _protected and check mutex is held for lockdep enabled builds. Fixes: 212ed75dc5fb ("netfilter: nf_tables: integrate pipapo into commit protocol") Signed-off-by: Florian Westphal commit 0650d5098f8b6b232cd5ea0e15437fc38f7d63ba Author: Zhu Wang Date: Thu Aug 3 15:10:06 2023 +0800 fbdev: goldfishfb: Do not check 0 for platform_get_irq() Since platform_get_irq() never returned zero, so it need not to check whether it returned zero, and we use the return error code of platform_get_irq() to replace the current return error code. Please refer to the commit a85a6c86c25b ("driver core: platform: Clarify that IRQ 0 is invalid") to get that platform_get_irq() never returned zero. Signed-off-by: Zhu Wang Signed-off-by: Helge Deller commit 73d7f28b08319d33fb1e9939f89d7b1ab29c9672 Author: Ruan Jinjie Date: Fri Aug 11 15:28:10 2023 +0800 fbdev: atmel_lcdfb: Remove redundant of_match_ptr() The driver depends on CONFIG_OF, it is not necessary to use of_match_ptr() here. Signed-off-by: Ruan Jinjie Signed-off-by: Helge Deller commit 082f613127832c6e57ad21fa76500bc08427f04a Author: Yue Haibing Date: Mon Aug 14 22:05:10 2023 +0800 fbdev: kyro: Remove unused declarations These declarations is never implemented since the beginning of git history. Signed-off-by: Yue Haibing Signed-off-by: Helge Deller commit 4853c74bd7ab7fdb83f319bd9ace8a08c031e9b6 Merge: 2d7b8c6b90e40 7a894c8737477 Author: Linus Torvalds Date: Tue Aug 15 20:28:04 2023 +0000 Merge tag 'parisc-for-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc fix from Helge Deller: "Fix the parisc TLB ptlock checks so that they can be enabled together with the lightweight spinlock checks" * tag 'parisc-for-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix CONFIG_TLB_PTLOCK to work with lightweight spinlock checks commit 2d7b8c6b90e4054a35eb59cd6d7c66e903e8ae4b Merge: d4f8e13b0614d 7b38f6ddc97bf Author: Linus Torvalds Date: Tue Aug 15 20:00:40 2023 +0000 Merge tag '6.5-rc6-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: "Three smb client fixes, all for stable: - fix for oops in unmount race with lease break of deferred close - debugging improvement for reconnect - fix for fscache deadlock (folio_wait_bit_common hang)" * tag '6.5-rc6-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb3: display network namespace in debug information cifs: Release folio lock on fscache read hit. cifs: fix potential oops in cifs_oplock_break commit d4f8e13b0614dc237deefb4e270d6d0f060bed70 Merge: 91aa6c412d7f8 7cdf55462c553 Author: Linus Torvalds Date: Tue Aug 15 19:34:12 2023 +0000 Merge tag 'regulator-fix-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "Two small driver specific fixes: one incorrect definition for one of the Qualcomm regulators and better handling of poorly formed DTs in the DA9063 driver" * tag 'regulator-fix-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: qcom-rpmh: Fix LDO 12 regulator for PM8550 regulator: da9063: better fix null deref with partial DT commit e4dd0d3a2f64b8bd8029ec70f52bdbebd0644408 Author: Jason Xing Date: Fri Aug 11 10:37:47 2023 +0800 net: fix the RTO timer retransmitting skb every 1ms if linear option is enabled In the real workload, I encountered an issue which could cause the RTO timer to retransmit the skb per 1ms with linear option enabled. The amount of lost-retransmitted skbs can go up to 1000+ instantly. The root cause is that if the icsk_rto happens to be zero in the 6th round (which is the TCP_THIN_LINEAR_RETRIES value), then it will always be zero due to the changed calculation method in tcp_retransmit_timer() as follows: icsk->icsk_rto = min(icsk->icsk_rto << 1, TCP_RTO_MAX); Above line could be converted to icsk->icsk_rto = min(0 << 1, TCP_RTO_MAX) = 0 Therefore, the timer expires so quickly without any doubt. I read through the RFC 6298 and found that the RTO value can be rounded up to a certain value, in Linux, say TCP_RTO_MIN as default, which is regarded as the lower bound in this patch as suggested by Eric. Fixes: 36e31b0af587 ("net: TCP thin linear timeouts") Suggested-by: Eric Dumazet Signed-off-by: Jason Xing Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 220c8f67133010c37a3240ba179f7f1fa2425cc7 Merge: 7c761166399be 37aba3190891d Author: Takashi Iwai Date: Tue Aug 15 20:46:13 2023 +0200 Merge tag 'asoc-fix-v6.5-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.5 A fairly large collection of fixes here, mostly SOF and Intel related. The one core fix is Hans' change which reduces the log spam when working out new use cases for DPCM. commit 0fc7769e54e747c8fd1b4899af2ac43cb68daa1c Author: Kevin-Lu Date: Tue Aug 15 17:56:31 2023 +0800 MAINTAINERS: Add entries for TEXAS INSTRUMENTS ASoC DRIVERS Add the MAINTAINERS entries for TEXAS INSTRUMENTS ASoC DRIVERS. Signed-off-by: Kevin-Lu Link: https://lore.kernel.org/r/20230815095631.1655-1-kevin-lu@ti.com Signed-off-by: Mark Brown commit 96d3c1cadedb6ae2e8965e19cd12caa244afbd9c Author: Dan Carpenter Date: Thu Aug 10 15:23:06 2023 +0300 accel/qaic: Clean up integer overflow checking in map_user_pages() The encode_dma() function has some validation on in_trans->size but it would be more clear to move those checks to find_and_map_user_pages(). The encode_dma() had two checks: if (in_trans->addr + in_trans->size < in_trans->addr || !in_trans->size) return -EINVAL; The in_trans->addr variable is the starting address. The in_trans->size variable is the total size of the transfer. The transfer can occur in parts and the resources->xferred_dma_size tracks how many bytes we have already transferred. This patch introduces a new variable "remaining" which represents the amount we want to transfer (in_trans->size) minus the amount we have already transferred (resources->xferred_dma_size). I have modified the check for if in_trans->size is zero to instead check if in_trans->size is less than resources->xferred_dma_size. If we have already transferred more bytes than in_trans->size then there are negative bytes remaining which doesn't make sense. If there are zero bytes remaining to be copied, just return success. The check in encode_dma() checked that "addr + size" could not overflow and barring a driver bug that should work, but it's easier to check if we do this in parts. First check that "in_trans->addr + resources->xferred_dma_size" is safe. Then check that "xfer_start_addr + remaining" is safe. My final concern was that we are dealing with u64 values but on 32bit systems the kmalloc() function will truncate the sizes to 32 bits. So I calculated "total = in_trans->size + offset_in_page(xfer_start_addr);" and returned -EINVAL if it were >= SIZE_MAX. This will not affect 64bit systems. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter Reviewed-by: Jeffrey Hugo Reviewed-by: Carl Vanderlip Signed-off-by: Jeffrey Hugo Link: https://patchwork.freedesktop.org/patch/msgid/24d3348b-25ac-4c1b-b171-9dae7c43e4e0@moroto.mountain commit 2d956177b7c96e62fac762a3b7da4318cde27a73 Author: Pranjal Ramajor Asha Kanojiya Date: Wed Aug 2 08:59:37 2023 -0600 accel/qaic: Fix slicing memory leak The temporary buffer storing slicing configuration data from user is only freed on error. This is a memory leak. Free the buffer unconditionally. Fixes: ff13be830333 ("accel/qaic: Add datapath") Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Carl Vanderlip Reviewed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo Link: https://patchwork.freedesktop.org/patch/msgid/20230802145937.14827-1-quic_jhugo@quicinc.com commit 58abdd80b93b09023ca03007b608685c41e3a289 Author: Yangtao Li Date: Thu Jul 27 15:00:51 2023 +0800 mmc: f-sdh30: fix order of function calls in sdhci_f_sdh30_remove The order of function calls in sdhci_f_sdh30_remove is wrong, let's call sdhci_pltfm_unregister first. Cc: Uwe Kleine-König Fixes: 5def5c1c15bf ("mmc: sdhci-f-sdh30: Replace with sdhci_pltfm") Signed-off-by: Yangtao Li Reported-by: Uwe Kleine-König Acked-by: Uwe Kleine-König Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230727070051.17778-62-frank.li@vivo.com Signed-off-by: Ulf Hansson commit 609a1bcd7bebac90a1b443e9fed47fd48dac5799 Author: Randy Dunlap Date: Fri Aug 11 22:29:47 2023 -0700 wifi: iwlwifi: mvm: add dependency for PTP clock When the code to use the PTP HW clock was added, it didn't update the Kconfig entry for the PTP dependency, leading to build errors, so update the Kconfig entry to depend on PTP_1588_CLOCK_OPTIONAL. aarch64-linux-ld: drivers/net/wireless/intel/iwlwifi/mvm/ptp.o: in function `iwl_mvm_ptp_init': drivers/net/wireless/intel/iwlwifi/mvm/ptp.c:294: undefined reference to `ptp_clock_register' drivers/net/wireless/intel/iwlwifi/mvm/ptp.c:294:(.text+0xce8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ptp_clock_register' aarch64-linux-ld: drivers/net/wireless/intel/iwlwifi/mvm/ptp.c:301: undefined reference to `ptp_clock_index' drivers/net/wireless/intel/iwlwifi/mvm/ptp.c:301:(.text+0xd18): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ptp_clock_index' aarch64-linux-ld: drivers/net/wireless/intel/iwlwifi/mvm/ptp.o: in function `iwl_mvm_ptp_remove': drivers/net/wireless/intel/iwlwifi/mvm/ptp.c:315: undefined reference to `ptp_clock_index' drivers/net/wireless/intel/iwlwifi/mvm/ptp.c:315:(.text+0xe80): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ptp_clock_index' aarch64-linux-ld: drivers/net/wireless/intel/iwlwifi/mvm/ptp.c:319: undefined reference to `ptp_clock_unregister' drivers/net/wireless/intel/iwlwifi/mvm/ptp.c:319:(.text+0xeac): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ptp_clock_unregister' Fixes: 1595ecce1cf3 ("wifi: iwlwifi: mvm: add support for PTP HW clock (PHC)") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Link: https://lore.kernel.org/all/202308110447.4QSJHmFH-lkp@intel.com/ Cc: Krishnanand Prabhu Cc: Luca Coelho Cc: Gregory Greenman Cc: Johannes Berg Cc: Kalle Valo Cc: linux-wireless@vger.kernel.org Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: netdev@vger.kernel.org Reviewed-by: Simon Horman Tested-by: Simon Horman # build-tested Acked-by: Richard Cochran Acked-by: Gregory Greenman Link: https://lore.kernel.org/r/20230812052947.22913-1-rdunlap@infradead.org Signed-off-by: Johannes Berg commit 91aa6c412d7f85e48aead7b00a7d9e91f5cf5863 Merge: 2ccdd1b13c591 f55484fd7be92 Author: Linus Torvalds Date: Tue Aug 15 06:03:44 2023 +0000 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: "Just a bunch of bugfixes all over the place" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (26 commits) virtio-mem: check if the config changed before fake offlining memory virtio-mem: keep retrying on offline_and_remove_memory() errors in Sub Block Mode (SBM) virtio-mem: convert most offline_and_remove_memory() errors to -EBUSY virtio-mem: remove unsafe unplug in Big Block Mode (BBM) pds_vdpa: fix up debugfs feature bit printing pds_vdpa: alloc irq vectors on DRIVER_OK pds_vdpa: clean and reset vqs entries pds_vdpa: always allow offering VIRTIO_NET_F_MAC pds_vdpa: reset to vdpa specified mac virtio-net: Zero max_tx_vq field for VIRTIO_NET_CTRL_MQ_HASH_CONFIG case vdpa/mlx5: Fix crash on shutdown for when no ndev exists vdpa/mlx5: Delete control vq iotlb in destroy_mr only when necessary vdpa/mlx5: Fix mr->initialized semantics vdpa/mlx5: Correct default number of queues when MQ is on virtio-vdpa: Fix cpumask memory leak in virtio_vdpa_find_vqs() vduse: Use proper spinlock for IRQ injection vdpa: Enable strict validation for netlinks ops vdpa: Add max vqp attr to vdpa_nl_policy for nlattr length check vdpa: Add queue index attr to vdpa_nl_policy for nlattr length check vdpa: Add features attr to vdpa_nl_policy for nlattr length check ... commit 8a519a572598b7c0c07b02f69bf5b4e8dd4b2d7d Author: Liang Chen Date: Sat Aug 12 10:30:16 2023 +0800 net: veth: Page pool creation error handling for existing pools only The failure handling procedure destroys page pools for all queues, including those that haven't had their page pool created yet. this patch introduces necessary adjustments to prevent potential risks and inconsistency with the error handling behavior. Fixes: 0ebab78cbcbf ("net: veth: add page_pool for page recycling") Acked-by: Jesper Dangaard Brouer Signed-off-by: Liang Chen Link: https://lore.kernel.org/r/20230812023016.10553-1-liangchen.linux@gmail.com Signed-off-by: Jakub Kicinski commit f6f978fc4d006c9d3fa6df9f172d4660139fd3dd Merge: 6c461e394d11a 758c91078165a Author: Jakub Kicinski Date: Mon Aug 14 19:08:14 2023 -0700 Merge branch 'octeon_ep-fixes-for-error-and-remove-paths' Michal Schmidt says: ==================== octeon_ep: fixes for error and remove paths I have an Octeon card that's misconfigured in a way that exposes a couple of bugs in the octeon_ep driver's error paths. It can reproduce the issues that patches 1 & 4 are fixing. Patches 2 & 3 are a result of reviewing the nearby code. ==================== Link: https://lore.kernel.org/r/20230810150114.107765-1-mschmidt@redhat.com Signed-off-by: Jakub Kicinski commit 758c91078165ae641b698750a72eafe7968b3756 Author: Michal Schmidt Date: Thu Aug 10 17:01:14 2023 +0200 octeon_ep: cancel queued works in probe error path If it fails to get the devices's MAC address, octep_probe exits while leaving the delayed work intr_poll_task queued. When the work later runs, it's a use after free. Move the cancelation of intr_poll_task from octep_remove into octep_device_cleanup. This does not change anything in the octep_remove flow, but octep_device_cleanup is called also in the octep_probe error path, where the cancelation is needed. Note that the cancelation of ctrl_mbox_task has to follow intr_poll_task's, because the ctrl_mbox_task may be queued by intr_poll_task. Fixes: 24d4333233b3 ("octeon_ep: poll for control messages") Signed-off-by: Michal Schmidt Link: https://lore.kernel.org/r/20230810150114.107765-5-mschmidt@redhat.com Signed-off-by: Jakub Kicinski commit 607a7a45cdf38c1901e0d81e4e00a2a88786330a Author: Michal Schmidt Date: Thu Aug 10 17:01:13 2023 +0200 octeon_ep: cancel ctrl_mbox_task after intr_poll_task intr_poll_task may queue ctrl_mbox_task. The function octep_poll_non_ioq_interrupts_cn93_pf does this. When removing the driver and canceling these two works, cancel ctrl_mbox_task last to guarantee it does not run anymore. Fixes: 24d4333233b3 ("octeon_ep: poll for control messages") Signed-off-by: Michal Schmidt Link: https://lore.kernel.org/r/20230810150114.107765-4-mschmidt@redhat.com Signed-off-by: Jakub Kicinski commit 28458c80006bb4e993a09fc094094a8578cad292 Author: Michal Schmidt Date: Thu Aug 10 17:01:12 2023 +0200 octeon_ep: cancel tx_timeout_task later in remove sequence tx_timeout_task is canceled too early when removing the driver. Nothing prevents .ndo_tx_timeout from triggering and queuing the work again. Better cancel it after the netdev is unregistered. It's harmless for octep_tx_timeout_task to run in the window between the unregistration and cancelation, because it checks netif_running. Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization") Signed-off-by: Michal Schmidt Link: https://lore.kernel.org/r/20230810150114.107765-3-mschmidt@redhat.com Signed-off-by: Jakub Kicinski commit 519b227904f0e70d4a1d6cf41daa5392715f2d2f Author: Michal Schmidt Date: Thu Aug 10 17:01:11 2023 +0200 octeon_ep: fix timeout value for waiting on mbox response The intention was to wait up to 500 ms for the mbox response. The third argument to wait_event_interruptible_timeout() is supposed to be the timeout duration. The driver mistakenly passed absolute time instead. Fixes: 577f0d1b1c5f ("octeon_ep: add separate mailbox command and response queues") Signed-off-by: Michal Schmidt Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230810150114.107765-2-mschmidt@redhat.com Signed-off-by: Jakub Kicinski commit 6c461e394d11a981c662cc16cebfb05b602e23ba Author: Radhey Shyam Pandey Date: Mon Aug 7 18:44:51 2023 +0530 net: macb: In ZynqMP resume always configure PS GTR for non-wakeup source On Zynq UltraScale+ MPSoC ubuntu platform when systemctl issues suspend, network manager bring down the interface and goes into suspend. When it wakes up it again enables the interface. This leads to xilinx-psgtr "PLL lock timeout" on interface bringup, as the power management controller power down the entire FPD (including SERDES) if none of the FPD devices are in use and serdes is not initialized on resume. $ sudo rtcwake -m no -s 120 -v $ sudo systemctl suspend $ ifconfig eth1 up xilinx-psgtr fd400000.phy: lane 0 (type 10, protocol 5): PLL lock timeout phy phy-fd400000.phy.0: phy poweron failed --> -110 macb driver is called in this way: 1. macb_close: Stop network interface. In this function, it reset MACB IP and disables PHY and network interface. 2. macb_suspend: It is called in kernel suspend flow. But because network interface has been disabled(netif_running(ndev) is false), it does nothing and returns directly; 3. System goes into suspend state. Some time later, system is waken up by RTC wakeup device; 4. macb_resume: It does nothing because network interface has been disabled; 5. macb_open: It is called to enable network interface again. ethernet interface is initialized in this API but serdes which is power-off by PMUFW during FPD-off suspend is not initialized again and so we hit GT PLL lock issue on open. To resolve this PLL timeout issue always do PS GTR initialization when ethernet device is configured as non-wakeup source. Fixes: f22bd29ba19a ("net: macb: Fix ZynqMP SGMII non-wakeup source resume failure") Fixes: 8b73fa3ae02b ("net: macb: Added ZynqMP-specific initialization") Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1691414091-2260697-1-git-send-email-radhey.shyam.pandey@amd.com Signed-off-by: Jakub Kicinski commit c96e2a695e00bca5487824d84b85aab6aa2c1891 Author: Jeff Layton Date: Mon Aug 14 13:36:54 2023 -0400 sunrpc: set the bv_offset of first bvec in svc_tcp_sendmsg svc_tcp_sendmsg used to factor in the xdr->page_base when sending pages, but commit 5df5dd03a8f7 ("sunrpc: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage") dropped that part of the handling. Fix it by setting the bv_offset of the first bvec. Fixes: 5df5dd03a8f7 ("sunrpc: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage") Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 4caf4cb1eaed469742ef719f2cc024b1ec3fa9e6 Author: Chengfeng Ye Date: Fri Jul 7 08:49:41 2023 +0000 i2c: bcm-iproc: Fix bcm_iproc_i2c_isr deadlock issue iproc_i2c_rd_reg() and iproc_i2c_wr_reg() are called from both interrupt context (e.g. bcm_iproc_i2c_isr) and process context (e.g. bcm_iproc_i2c_suspend). Therefore, interrupts should be disabled to avoid potential deadlock. To prevent this scenario, use spin_lock_irqsave(). Fixes: 9a1038728037 ("i2c: iproc: add NIC I2C support") Signed-off-by: Chengfeng Ye Acked-by: Ray Jui Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 7d711966f94c189f38d9e2df05152a2336352ab8 Author: Uwe Kleine-König Date: Tue Jun 27 08:45:22 2023 +0200 i2c: Update documentation to use .probe() again Since commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") .probe() is the recommended callback to implement (again). Reflect this in the documentation and don't mention .probe_new() any more. Signed-off-by: Uwe Kleine-König Reviewed-by: Jean Delvare Reviewed-by: Javier Martinez Canillas Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 423ffe62c06ae241ad460f4629dddb9dcf55e060 Author: Jani Nikula Date: Fri Aug 4 11:45:59 2023 +0300 drm/i915: fix display probe for IVB Q and IVB D GT2 server The current display probe is unable to differentiate between IVB Q and IVB D GT2 server, as they both have the same device id, but different subvendor and subdevice. This leads to the latter being misidentified as the former, and should just end up not having a display. However, the no display case returns a NULL as the display device info, and promptly oopses. As the IVB Q case is rare, and we're anyway moving towards GMD ID, handle the identification requiring subvendor and subdevice as a special case first, instead of unnecessarily growing the intel_display_ids[] array with subvendor and subdevice. [ 5.425298] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 5.426059] #PF: supervisor read access in kernel mode [ 5.426810] #PF: error_code(0x0000) - not-present page [ 5.427570] PGD 0 P4D 0 [ 5.428285] Oops: 0000 [#1] PREEMPT SMP PTI [ 5.429035] CPU: 0 PID: 137 Comm: (udev-worker) Not tainted 6.4.0-1-amd64 #1 Debian 6.4.4-1 [ 5.429759] Hardware name: HP HP Z220 SFF Workstation/HP Z220 SFF Workstation, BIOS 4.19-218-gb184e6e0a1 02/02/2023 [ 5.430485] RIP: 0010:intel_device_info_driver_create+0xf1/0x120 [i915] [ 5.431338] Code: 48 8b 97 80 1b 00 00 89 8f c0 1b 00 00 48 89 b7 b0 1b 00 00 48 89 97 b8 1b 00 00 0f b7 fd e8 76 e8 14 00 48 89 83 50 1b 00 00 <48> 8b 08 48 89 8b c4 1b 00 00 48 8b 48 08 48 89 8b cc 1b 00 00 8b [ 5.432920] RSP: 0018:ffffb8254044fb98 EFLAGS: 00010206 [ 5.433707] RAX: 0000000000000000 RBX: ffff923076e80000 RCX: 0000000000000000 [ 5.434494] RDX: 0000000000000260 RSI: 0000000100001000 RDI: 000000000000016a [ 5.435277] RBP: 000000000000016a R08: ffffb8254044fb00 R09: 0000000000000000 [ 5.436055] R10: ffff922d02761de8 R11: 00657361656c6572 R12: ffffffffc0e5d140 [ 5.436867] R13: ffff922d00b720d0 R14: 0000000076e80000 R15: ffff923078c0cae8 [ 5.437646] FS: 00007febd19a18c0(0000) GS:ffff92307c000000(0000) knlGS:0000000000000000 [ 5.438434] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5.439218] CR2: 0000000000000000 CR3: 000000010256e002 CR4: 00000000001706f0 [ 5.440009] Call Trace: [ 5.440824] [ 5.441611] ? __die+0x23/0x70 [ 5.442394] ? page_fault_oops+0x17d/0x4c0 [ 5.443173] ? exc_page_fault+0x7f/0x180 [ 5.443949] ? asm_exc_page_fault+0x26/0x30 [ 5.444756] ? intel_device_info_driver_create+0xf1/0x120 [i915] [ 5.445652] ? intel_device_info_driver_create+0xea/0x120 [i915] [ 5.446545] i915_driver_probe+0x7f/0xb60 [i915] [ 5.447431] ? drm_privacy_screen_get+0x15c/0x1a0 [drm] [ 5.448240] local_pci_probe+0x45/0xa0 [ 5.449013] pci_device_probe+0xc7/0x240 [ 5.449748] really_probe+0x19e/0x3e0 [ 5.450464] ? __pfx___driver_attach+0x10/0x10 [ 5.451172] __driver_probe_device+0x78/0x160 [ 5.451870] driver_probe_device+0x1f/0x90 [ 5.452601] __driver_attach+0xd2/0x1c0 [ 5.453293] bus_for_each_dev+0x88/0xd0 [ 5.453989] bus_add_driver+0x116/0x220 [ 5.454672] driver_register+0x59/0x100 [ 5.455336] i915_init+0x25/0xc0 [i915] [ 5.456104] ? __pfx_i915_init+0x10/0x10 [i915] [ 5.456882] do_one_initcall+0x5d/0x240 [ 5.457511] do_init_module+0x60/0x250 [ 5.458126] __do_sys_finit_module+0xac/0x120 [ 5.458721] do_syscall_64+0x60/0xc0 [ 5.459314] ? syscall_exit_to_user_mode+0x1b/0x40 [ 5.459897] ? do_syscall_64+0x6c/0xc0 [ 5.460510] entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 5.461082] RIP: 0033:0x7febd20b0eb9 [ 5.461648] Code: 08 89 e8 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 2f 1f 0d 00 f7 d8 64 89 01 48 [ 5.462905] RSP: 002b:00007fffabb1ba78 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 5.463554] RAX: ffffffffffffffda RBX: 0000561e6304f410 RCX: 00007febd20b0eb9 [ 5.464201] RDX: 0000000000000000 RSI: 00007febd2244f0d RDI: 0000000000000015 [ 5.464869] RBP: 00007febd2244f0d R08: 0000000000000000 R09: 000000000000000a [ 5.465512] R10: 0000000000000015 R11: 0000000000000246 R12: 0000000000020000 [ 5.466124] R13: 0000000000000000 R14: 0000561e63032b60 R15: 000000000000000a [ 5.466700] [ 5.467271] Modules linked in: i915(+) drm_buddy video crc32_pclmul sr_mod hid_generic wmi crc32c_intel i2c_algo_bit sd_mod cdrom drm_display_helper cec usbhid rc_core ghash_clmulni_intel hid sha512_ssse3 ttm sha512_generic xhci_pci ehci_pci xhci_hcd ehci_hcd nvme ahci drm_kms_helper nvme_core libahci t10_pi libata psmouse aesni_intel scsi_mod crypto_simd i2c_i801 scsi_common crc64_rocksoft_generic cryptd i2c_smbus drm lpc_ich crc64_rocksoft crc_t10dif e1000e usbcore crct10dif_generic usb_common crct10dif_pclmul crc64 crct10dif_common button [ 5.469750] CR2: 0000000000000000 [ 5.470364] ---[ end trace 0000000000000000 ]--- [ 5.470971] RIP: 0010:intel_device_info_driver_create+0xf1/0x120 [i915] [ 5.471699] Code: 48 8b 97 80 1b 00 00 89 8f c0 1b 00 00 48 89 b7 b0 1b 00 00 48 89 97 b8 1b 00 00 0f b7 fd e8 76 e8 14 00 48 89 83 50 1b 00 00 <48> 8b 08 48 89 8b c4 1b 00 00 48 8b 48 08 48 89 8b cc 1b 00 00 8b [ 5.473034] RSP: 0018:ffffb8254044fb98 EFLAGS: 00010206 [ 5.473698] RAX: 0000000000000000 RBX: ffff923076e80000 RCX: 0000000000000000 [ 5.474371] RDX: 0000000000000260 RSI: 0000000100001000 RDI: 000000000000016a [ 5.475045] RBP: 000000000000016a R08: ffffb8254044fb00 R09: 0000000000000000 [ 5.475725] R10: ffff922d02761de8 R11: 00657361656c6572 R12: ffffffffc0e5d140 [ 5.476405] R13: ffff922d00b720d0 R14: 0000000076e80000 R15: ffff923078c0cae8 [ 5.477124] FS: 00007febd19a18c0(0000) GS:ffff92307c000000(0000) knlGS:0000000000000000 [ 5.477811] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5.478499] CR2: 0000000000000000 CR3: 000000010256e002 CR4: 00000000001706f0 Fixes: 69d439818fe5 ("drm/i915/display: Make display responsible for probing its own IP") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8991 Cc: Matt Roper Cc: Andrzej Hajda Reviewed-by: Luca Coelho Reviewed-by: Matt Roper Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230804084600.1005818-1-jani.nikula@intel.com (cherry picked from commit 1435188307d128671f677eb908e165666dd83652) Signed-off-by: Rodrigo Vivi commit 2002eb6d3ea954dde9f8a223018d5335779937d0 Author: Jani Nikula Date: Thu Aug 3 15:27:06 2023 +0300 drm/i915/sdvo: fix panel_type initialization Commit 3f9ffce5765d ("drm/i915: Do panel VBT init early if the VBT declares an explicit panel type") started using -1 as the value for unset panel_type. It gets initialized in intel_panel_init_alloc(), but the SDVO code never calls it. Call intel_panel_init_alloc() to initialize the panel, including the panel_type. Reported-by: Tomi Leppänen Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8896 Fixes: 3f9ffce5765d ("drm/i915: Do panel VBT init early if the VBT declares an explicit panel type") Cc: Ville Syrjälä Cc: # v6.1+ Reviewed-by: Uma Shankar Tested-by: Tomi Leppänen Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230803122706.838721-1-jani.nikula@intel.com (cherry picked from commit 26e60294e8eacedc8ebb33405b2c375fd80e0900) Signed-off-by: Rodrigo Vivi commit 5598c9bfdb81f40f2f5d769b342d25bff74b07a6 Author: Vinay Belgaumkar Date: Tue Jul 25 18:00:44 2023 -0700 drm/i915/guc/slpc: Restore efficient freq earlier This should be done before the soft min/max frequencies are restored. When we disable the "Ignore efficient frequency" flag, GuC does not actually bring the requested freq down to RPn. Specifically, this scenario- - ignore efficient freq set to true - reduce min to RPn (from efficient) - suspend - resume (includes GuC load, restore soft min/max, restore efficient freq) - validate min freq has been resored to RPn This will fail if we didn't first restore(disable, in this case) efficient freq flag before setting the soft min frequency. v2: Bring the min freq down to RPn when we disable efficient freq (Rodrigo) Also made the change to set the min softlimit to RPn at init. Otherwise, we were storing RPe there. Link: https://gitlab.freedesktop.org/drm/intel/-/issues/8736 Fixes: 55f9720dbf23 ("drm/i915/guc/slpc: Provide sysfs for efficient freq") Fixes: 95ccf312a1e4 ("drm/i915/guc/slpc: Allow SLPC to use efficient frequency") Signed-off-by: Vinay Belgaumkar Reviewed-by: Rodrigo Vivi Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230726010044.3280402-1-vinay.belgaumkar@intel.com (cherry picked from commit 28e671114fb0f28f334fac8d0a6b9c395c7b0498) Signed-off-by: Rodrigo Vivi commit 0abbf0ac10eeede6e771a1a79342baf5e8466ee3 Author: Dan Carpenter Date: Tue Jun 27 10:12:36 2023 +0300 i2c: sun6i-p2wi: Fix an error message in probe() The "ret" variable is uninitialized. It was the "p2wi->rstc" variable that was intended. We can also use the %pe string format to print the error code name instead of just the number. Fixes: 75ff8a340a81 ("i2c: sun6i-p2wi: Use devm_clk_get_enabled()") Signed-off-by: Dan Carpenter Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 9b378f6ad48cfa195ed868db9123c09ee7ec5ea2 Author: Filipe Manana Date: Sun Aug 13 12:34:08 2023 +0100 btrfs: fix infinite directory reads The readdir implementation currently processes always up to the last index it finds. This however can result in an infinite loop if the directory has a large number of entries such that they won't all fit in the given buffer passed to the readdir callback, that is, dir_emit() returns a non-zero value. Because in that case readdir() will be called again and if in the meanwhile new directory entries were added and we still can't put all the remaining entries in the buffer, we keep repeating this over and over. The following C program and test script reproduce the problem: $ cat /mnt/readdir_prog.c #include #include #include int main(int argc, char *argv[]) { DIR *dir = opendir("."); struct dirent *dd; while ((dd = readdir(dir))) { printf("%s\n", dd->d_name); rename(dd->d_name, "TEMPFILE"); rename("TEMPFILE", dd->d_name); } closedir(dir); } $ gcc -o /mnt/readdir_prog /mnt/readdir_prog.c $ cat test.sh #!/bin/bash DEV=/dev/sdi MNT=/mnt/sdi mkfs.btrfs -f $DEV &> /dev/null #mkfs.xfs -f $DEV &> /dev/null #mkfs.ext4 -F $DEV &> /dev/null mount $DEV $MNT mkdir $MNT/testdir for ((i = 1; i <= 2000; i++)); do echo -n > $MNT/testdir/file_$i done cd $MNT/testdir /mnt/readdir_prog cd /mnt umount $MNT This behaviour is surprising to applications and it's unlike ext4, xfs, tmpfs, vfat and other filesystems, which always finish. In this case where new entries were added due to renames, some file names may be reported more than once, but this varies according to each filesystem - for example ext4 never reported the same file more than once while xfs reports the first 13 file names twice. So change our readdir implementation to track the last index number when opendir() is called and then make readdir() never process beyond that index number. This gives the same behaviour as ext4. Reported-by: Rob Landley Link: https://lore.kernel.org/linux-btrfs/2c8c55ec-04c6-e0dc-9c5c-8c7924778c35@landley.net/ Link: https://bugzilla.kernel.org/show_bug.cgi?id=217681 CC: stable@vger.kernel.org # 6.4+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 7b38f6ddc97bf572c3422d3175e8678dd95502fa Author: Steve French Date: Thu Aug 10 21:41:03 2023 -0500 smb3: display network namespace in debug information We recently had problems where a network namespace was deleted causing hard to debug reconnect problems. To help deal with configuration issues like this it is useful to dump the network namespace to better debug what happened. So add this to information displayed in /proc/fs/cifs/DebugData for the server (and channels if mounted with multichannel). For example: Local Users To Server: 1 SecMode: 0x1 Req On Wire: 0 Net namespace: 4026531840 This can be easily compared with what is displayed for the processes on the system. For example /proc/1/ns/net in this case showed the same thing (see below), and we can see that the namespace is still valid in this example. 'net:[4026531840]' Cc: stable@vger.kernel.org Acked-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit fff67c1b17ee093947bdcbac6f64d072e644159a Author: Yicong Yang Date: Tue Aug 1 20:46:25 2023 +0800 i2c: hisi: Only handle the interrupt of the driver's transfer The controller may be shared with other port, for example the firmware. Handle the interrupt from other sources will cause crash since some data are not initialized. So only handle the interrupt of the driver's transfer and discard others. Fixes: d62fbdb99a85 ("i2c: add support for HiSilicon I2C controller") Signed-off-by: Yicong Yang Reviewed-by: Andi Shyti Link: https://lore.kernel.org/r/20230801124625.63587-1-yangyicong@huawei.com Signed-off-by: Wolfram Sang commit 69513dd669e243928f7450893190915a88f84a2b Author: Russell Harmon via samba-technical Date: Thu Aug 10 00:19:22 2023 -0700 cifs: Release folio lock on fscache read hit. Under the current code, when cifs_readpage_worker is called, the call contract is that the callee should unlock the page. This is documented in the read_folio section of Documentation/filesystems/vfs.rst as: > The filesystem should unlock the folio once the read has completed, > whether it was successful or not. Without this change, when fscache is in use and cache hit occurs during a read, the page lock is leaked, producing the following stack on subsequent reads (via mmap) to the page: $ cat /proc/3890/task/12864/stack [<0>] folio_wait_bit_common+0x124/0x350 [<0>] filemap_read_folio+0xad/0xf0 [<0>] filemap_fault+0x8b1/0xab0 [<0>] __do_fault+0x39/0x150 [<0>] do_fault+0x25c/0x3e0 [<0>] __handle_mm_fault+0x6ca/0xc70 [<0>] handle_mm_fault+0xe9/0x350 [<0>] do_user_addr_fault+0x225/0x6c0 [<0>] exc_page_fault+0x84/0x1b0 [<0>] asm_exc_page_fault+0x27/0x30 This requires a reboot to resolve; it is a deadlock. Note however that the call to cifs_readpage_from_fscache does mark the page clean, but does not free the folio lock. This happens in __cifs_readpage_from_fscache on success. Releasing the lock at that point however is not appropriate as cifs_readahead also calls cifs_readpage_from_fscache and *does* unconditionally release the lock after its return. This change therefore effectively makes cifs_readpage_worker work like cifs_readahead. Signed-off-by: Russell Harmon Acked-by: Paulo Alcantara (SUSE) Reviewed-by: David Howells Cc: stable@vger.kernel.org Signed-off-by: Steve French commit 27ec43c77b5db780a56fc3a6d6de6bf2f74614f7 Author: Parker Newman Date: Tue Aug 8 16:01:06 2023 +0200 i2c: tegra: Fix i2c-tegra DMA config option processing Tegra processors prior to Tegra186 used APB DMA for I2C requiring CONFIG_TEGRA20_APB_DMA=y while Tegra186 and later use GPC DMA requiring CONFIG_TEGRA186_GPC_DMA=y. The check for if the processor uses APB DMA is inverted and so the wrong DMA config options are checked. This means if CONFIG_TEGRA20_APB_DMA=y but CONFIG_TEGRA186_GPC_DMA=n with a Tegra186 or later processor the driver will incorrectly think DMA is enabled and attempt to request DMA channels that will never be availible, leaving the driver in a perpetual EPROBE_DEFER state. Fixes: 48cb6356fae1 ("i2c: tegra: Add GPCDMA support") Signed-off-by: Parker Newman Acked-by: Andi Shyti Acked-by: Akhil R Link: https://lore.kernel.org/r/fcfcf9b3-c8c4-9b34-2ff8-cd60a3d490bd@connecttech.com Signed-off-by: Wolfram Sang commit b3497ef404dc3a8a7b8438a8950f46c4cd0e6ccf Author: Thierry Reding Date: Fri Jul 7 15:26:19 2023 +0200 i2c: tegra: Fix failure during probe deferral cleanup If the driver fails to obtain a DMA channel, it will initiate cleanup and try to release the DMA channel that couldn't be retrieved. This will cause a crash because the cleanup will try to dereference an ERR_PTR()- encoded error code. However, there's nothing to clean up at this point yet, so we can avoid this by simply resetting the DMA channel to NULL instead of storing the error code. Fixes: fcc8a89a1c83 ("i2c: tegra: Share same DMA channel for RX and TX") Signed-off-by: Thierry Reding Tested-by: Akhil R Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 69f035c480d76f12bf061148ccfd578e1099e5fc Author: Tam Nguyen Date: Wed Jul 26 15:00:01 2023 +0700 i2c: designware: Handle invalid SMBus block data response length value In the I2C_FUNC_SMBUS_BLOCK_DATA case, the invalid length byte value (outside of 1-32) of the SMBus block data response from the Slave device is not correctly handled by the I2C Designware driver. In case IC_EMPTYFIFO_HOLD_MASTER_EN==1, which cannot be detected from the registers, the Master can be disabled only if the STOP bit is set. Without STOP bit set, the Master remains active, holding the bus until receiving a block data response length. This hangs the bus and is unrecoverable. Avoid this by issuing another dump read to reach the stop condition when an invalid length byte is received. Cc: stable@vger.kernel.org Signed-off-by: Tam Nguyen Acked-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230726080001.337353-3-tamnguyenchi@os.amperecomputing.com Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 49d4db3953cb9004ff94efc0c176e026c820af5a Author: Quan Nguyen Date: Wed Jul 26 15:00:00 2023 +0700 i2c: designware: Correct length byte validation logic Commit 0daede80f870 ("i2c: designware: Convert driver to using regmap API") changes the logic to validate the whole 32-bit return value of DW_IC_DATA_CMD register instead of 8-bit LSB without reason. Later, commit f53f15ba5a85 ("i2c: designware: Get right data length"), introduced partial fix but not enough because the "tmp > 0" still test tmp as 32-bit value and is wrong in case the IC_DATA_CMD[11] is set. Revert the logic to just before commit 0daede80f870 ("i2c: designware: Convert driver to using regmap API"). Fixes: f53f15ba5a85 ("i2c: designware: Get right data length") Fixes: 0daede80f870 ("i2c: designware: Convert driver to using regmap API") Cc: stable@vger.kernel.org Signed-off-by: Tam Nguyen Signed-off-by: Quan Nguyen Acked-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230726080001.337353-2-tamnguyenchi@os.amperecomputing.com Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit b610c4bbd153c2cde548db48559e170905d7c369 Author: Carlos Song Date: Wed Jul 26 17:22:38 2023 +0800 i2c: imx-lpi2c: return -EINVAL when i2c peripheral clk doesn't work On MX8X platforms, the default clock rate is 0 if without explicit clock setting in dts nodes. I2c can't work when i2c peripheral clk rate is 0. Add a i2c peripheral clk rate check before configuring the clock register. When i2c peripheral clk rate is 0 and directly return -EINVAL. Signed-off-by: Carlos Song Acked-by: Dong Aisheng Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit e8470c0a7bcaa82f78ad34282d662dd7bd9630c2 Author: Luca Ceresoli Date: Fri Aug 4 17:12:39 2023 +0200 drm/panel: simple: Fix AUO G121EAN01 panel timings according to the docs Commit 03e909acd95a ("drm/panel: simple: Add support for AUO G121EAN01.4 panel") added support for this panel model, but the timings it implements are very different from what the datasheet describes. I checked both the G121EAN01.0 datasheet from [0] and the G121EAN01.4 one from [1] and they all have the same timings: for example the LVDS clock typical value is 74.4 MHz, not 66.7 MHz as implemented. Replace the timings with the ones from the documentation. These timings have been tested and the clock frequencies verified with an oscilloscope to ensure they are correct. Also use struct display_timing instead of struct drm_display_mode in order to also specify the minimum and maximum values. [0] https://embedded.avnet.com/product/g121ean01-0/ [1] https://embedded.avnet.com/product/g121ean01-4/ Fixes: 03e909acd95a ("drm/panel: simple: Add support for AUO G121EAN01.4 panel") Signed-off-by: Luca Ceresoli Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230804151239.835216-1-luca.ceresoli@bootlin.com commit ae6546835efaa7195aaaa10e5ff4e695cd82a816 Author: David Heidelberg Date: Sat Aug 12 20:52:39 2023 +0200 drm/panel: JDI LT070ME05000 simplify with dev_err_probe() Use the dev_err_probe() helper to simplify error handling during probe. This also handle scenario, when EDEFER is returned and useless error is printed. Fixes error: panel-jdi-lt070me05000 4700000.dsi.0: cannot get enable-gpio -517 Signed-off-by: David Heidelberg Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230812185239.378582-1-david@ixit.cz commit 7aff940ec88658f7fd21137cf515956a7deaaf54 Author: Shengyu Qu Date: Sun Aug 6 16:50:43 2023 +0800 ARM: dts: am335x-bone-common: Add vcc-supply for on-board eeprom The on-board eeprom on beaglebone series has a power supply from VDD_3V3A, add that to dts to reduce dummy regulator warning. Signed-off-by: Shengyu Qu Message-ID: Signed-off-by: Tony Lindgren commit 623cef652768860bd5f205fb7b741be278585fba Author: Shengyu Qu Date: Sun Aug 6 16:50:44 2023 +0800 ARM: dts: am335x-bone-common: Add GPIO PHY reset on revision C3 board This patch adds ethernet PHY reset GPIO config for Beaglebone Black series boards with revision C3. This fixes a random phy startup failure bug discussed at [1]. The GPIO pin used for reset is not used on older revisions, so it is ok to apply to all board revisions. The reset timing was discussed and tested at [2]. [1] https://forum.digikey.com/t/ethernet-device-is-not-detecting-on-ubuntu-20-04-lts-on-bbg/19948 [2] https://forum.beagleboard.org/t/recognizing-a-beaglebone-black-rev-c3-board/31249/ Signed-off-by: Robert Nelson Signed-off-by: Shengyu Qu Message-ID: Signed-off-by: Tony Lindgren commit 855067defa36b1f9effad8c219d9a85b655cf500 Author: Petr Machata Date: Fri Aug 11 17:59:27 2023 +0200 selftests: mirror_gre_changes: Tighten up the TTL test match This test verifies whether the encapsulated packets have the correct configured TTL. It does so by sending ICMP packets through the test topology and mirroring them to a gretap netdevice. On a busy host however, more than just the test ICMP packets may end up flowing through the topology, get mirrored, and counted. This leads to potential spurious failures as the test observes much more mirrored packets than the sent test packets, and assumes a bug. Fix this by tightening up the mirror action match. Change it from matchall to a flower classifier matching on ICMP packets specifically. Fixes: 45315673e0c5 ("selftests: forwarding: Test changes in mirror-to-gretap") Signed-off-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Ido Schimmel Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 833fd800bf56b74d39d71d3f5936dffb3e0409c6 Author: Petr Pavlu Date: Tue Jul 11 11:19:52 2023 +0200 x86/retpoline,kprobes: Skip optprobe check for indirect jumps with retpolines and IBT The kprobes optimization check can_optimize() calls insn_is_indirect_jump() to detect indirect jump instructions in a target function. If any is found, creating an optprobe is disallowed in the function because the jump could be from a jump table and could potentially land in the middle of the target optprobe. With retpolines, insn_is_indirect_jump() additionally looks for calls to indirect thunks which the compiler potentially used to replace original jumps. This extra check is however unnecessary because jump tables are disabled when the kernel is built with retpolines. The same is currently the case with IBT. Based on this observation, remove the logic to look for calls to indirect thunks and skip the check for indirect jumps altogether if the kernel is built with retpolines or IBT. Remove subsequently the symbols __indirect_thunk_start and __indirect_thunk_end which are no longer needed. Dropping this logic indirectly fixes a problem where the range [__indirect_thunk_start, __indirect_thunk_end] wrongly included also the return thunk. It caused that machines which used the return thunk as a mitigation and didn't have it patched by any alternative ended up not being able to use optprobes in any regular function. Fixes: 0b53c374b9ef ("x86/retpoline: Use -mfunction-return") Suggested-by: Peter Zijlstra (Intel) Suggested-by: Masami Hiramatsu (Google) Signed-off-by: Petr Pavlu Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Acked-by: Masami Hiramatsu (Google) Link: https://lore.kernel.org/r/20230711091952.27944-3-petr.pavlu@suse.com commit 79cd2a11224eab86d6673fe8a11d2046ae9d2757 Author: Petr Pavlu Date: Tue Jul 11 11:19:51 2023 +0200 x86/retpoline,kprobes: Fix position of thunk sections with CONFIG_LTO_CLANG The linker script arch/x86/kernel/vmlinux.lds.S matches the thunk sections ".text.__x86.*" from arch/x86/lib/retpoline.S as follows: .text { [...] TEXT_TEXT [...] __indirect_thunk_start = .; *(.text.__x86.*) __indirect_thunk_end = .; [...] } Macro TEXT_TEXT references TEXT_MAIN which normally expands to only ".text". However, with CONFIG_LTO_CLANG, TEXT_MAIN becomes ".text .text.[0-9a-zA-Z_]*" which wrongly matches also the thunk sections. The output layout is then different than expected. For instance, the currently defined range [__indirect_thunk_start, __indirect_thunk_end] becomes empty. Prevent the problem by using ".." as the first separator, for example, ".text..__x86.indirect_thunk". This pattern is utilized by other explicit section names which start with one of the standard prefixes, such as ".text" or ".data", and that need to be individually selected in the linker script. [ nathan: Fix conflicts with SRSO and fold in fix issue brought up by Andrew Cooper in post-review: https://lore.kernel.org/20230803230323.1478869-1-andrew.cooper3@citrix.com ] Fixes: dc5723b02e52 ("kbuild: add support for Clang LTO") Signed-off-by: Petr Pavlu Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Nathan Chancellor Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230711091952.27944-2-petr.pavlu@suse.com commit e9fbc47b818b964ddff5df5b2d5c0f5f32f4a147 Author: Borislav Petkov (AMD) Date: Sun Aug 13 12:39:34 2023 +0200 x86/srso: Disable the mitigation on unaffected configurations Skip the srso cmd line parsing which is not needed on Zen1/2 with SMT disabled and with the proper microcode applied (latter should be the case anyway) as those are not affected. Fixes: 5a15d8348881 ("x86/srso: Tie SBPB bit setting to microcode patch detection") Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230813104517.3346-1-bp@alien8.de commit f58d6fbcb7c848b7f2469be339bc571f2e9d245b Author: Borislav Petkov (AMD) Date: Fri Aug 11 23:38:24 2023 +0200 x86/CPU/AMD: Fix the DIV(0) initial fix attempt Initially, it was thought that doing an innocuous division in the #DE handler would take care to prevent any leaking of old data from the divider but by the time the fault is raised, the speculation has already advanced too far and such data could already have been used by younger operations. Therefore, do the innocuous division on every exit to userspace so that userspace doesn't see any potentially old data from integer divisions in kernel space. Do the same before VMRUN too, to protect host data from leaking into the guest too. Fixes: 77245f1c3c64 ("x86/CPU/AMD: Do not leak quotient data after a division by 0") Signed-off-by: Borislav Petkov (AMD) Cc: Link: https://lore.kernel.org/r/20230811213824.10025-1-bp@alien8.de commit ba5ca5e5e6a1d55923e88b4a83da452166f5560e Author: Sean Christopherson Date: Fri Aug 11 08:52:55 2023 -0700 x86/retpoline: Don't clobber RFLAGS during srso_safe_ret() Use LEA instead of ADD when adjusting %rsp in srso_safe_ret{,_alias}() so as to avoid clobbering flags. Drop one of the INT3 instructions to account for the LEA consuming one more byte than the ADD. KVM's emulator makes indirect calls into a jump table of sorts, where the destination of each call is a small blob of code that performs fast emulation by executing the target instruction with fixed operands. E.g. to emulate ADC, fastop() invokes adcb_al_dl(): adcb_al_dl: <+0>: adc %dl,%al <+2>: jmp <__x86_return_thunk> A major motivation for doing fast emulation is to leverage the CPU to handle consumption and manipulation of arithmetic flags, i.e. RFLAGS is both an input and output to the target of the call. fastop() collects the RFLAGS result by pushing RFLAGS onto the stack and popping them back into a variable (held in %rdi in this case): asm("push %[flags]; popf; " CALL_NOSPEC " ; pushf; pop %[flags]\n" <+71>: mov 0xc0(%r8),%rdx <+78>: mov 0x100(%r8),%rcx <+85>: push %rdi <+86>: popf <+87>: call *%rsi <+89>: nop <+90>: nop <+91>: nop <+92>: pushf <+93>: pop %rdi and then propagating the arithmetic flags into the vCPU's emulator state: ctxt->eflags = (ctxt->eflags & ~EFLAGS_MASK) | (flags & EFLAGS_MASK); <+64>: and $0xfffffffffffff72a,%r9 <+94>: and $0x8d5,%edi <+109>: or %rdi,%r9 <+122>: mov %r9,0x10(%r8) The failures can be most easily reproduced by running the "emulator" test in KVM-Unit-Tests. If you're feeling a bit of deja vu, see commit b63f20a778c8 ("x86/retpoline: Don't clobber RFLAGS during CALL_NOSPEC on i386"). In addition, this breaks booting of clang-compiled guest on a gcc-compiled host where the host contains the %rsp-modifying SRSO mitigations. [ bp: Massage commit message, extend, remove addresses. ] Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Closes: https://lore.kernel.org/all/de474347-122d-54cd-eabf-9dcc95ab9eae@amd.com Reported-by: Srikanth Aithal Reported-by: Nathan Chancellor Signed-off-by: Sean Christopherson Signed-off-by: Borislav Petkov (AMD) Tested-by: Nathan Chancellor Cc: stable@vger.kernel.org Link: https://lore.kernel.org/20230810013334.GA5354@dev-arch.thelio-3990X/ Link: https://lore.kernel.org/r/20230811155255.250835-1-seanjc@google.com commit 7a894c87374771f3cfb1b8e5453fbe03f1fb8135 Author: Helge Deller Date: Sun Aug 13 22:11:19 2023 +0200 parisc: Fix CONFIG_TLB_PTLOCK to work with lightweight spinlock checks For the TLB_PTLOCK checks we used an optimization to store the spc register into the spinlock to unlock it. This optimization works as long as the lightweight spinlock checks (CONFIG_LIGHTWEIGHT_SPINLOCK_CHECK) aren't enabled, because they really check if the lock word is zero or __ARCH_SPIN_LOCK_UNLOCKED_VAL and abort with a kernel crash ("Spinlock was trashed") otherwise. Drop that optimization to make it possible to activate both checks at the same time. Noticed-by: Sam James Signed-off-by: Helge Deller Tested-by: Sam James Cc: stable@vger.kernel.org # v6.4+ Fixes: 15e64ef6520e ("parisc: Add lightweight spinlock checks") commit ace0ab3a4b54205a01d3f4a0fd9bdb4616cfb60b Author: Vlad Buslov Date: Fri Aug 11 17:45:23 2023 +0200 Revert "vlan: Fix VLAN 0 memory leak" This reverts commit 718cb09aaa6fa78cc8124e9517efbc6c92665384. The commit triggers multiple syzbot issues, probably due to possibility of manually creating VLAN 0 on netdevice which will cause the code to delete it since it can't distinguish such VLAN from implicit VLAN 0 automatically created for devices with NETIF_F_HW_VLAN_CTAG_FILTER feature. Reported-by: syzbot+662f783a5cdf3add2719@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/00000000000090196d0602a6167d@google.com/ Reported-by: syzbot+4b4f06495414e92701d5@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/00000000000096ae870602a61602@google.com/ Reported-by: syzbot+d810d3cd45ed1848c3f7@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/0000000000009f0f9c0602a616ce@google.com/ Fixes: 718cb09aaa6f ("vlan: Fix VLAN 0 memory leak") Signed-off-by: Vlad Buslov Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 2fc8d02058dbec258039c3253ebd1f124766a796 Author: Michael Walle Date: Thu Aug 10 11:34:14 2023 +0200 MAINTAINERS: add content regex for gpio-regmap Add a glob to get patches of the users of gpio-regmap, too. Signed-off-by: Michael Walle Acked-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 2ccdd1b13c591d306f0401d98dedc4bdcd02b421 Author: Linus Torvalds Date: Sun Aug 13 11:29:55 2023 -0700 Linux 6.5-rc6 commit 37aba3190891d4de189bd5192ee95220e295f34d Author: Shuming Fan Date: Fri Aug 11 17:38:22 2023 +0800 ASoC: rt1308-sdw: fix random louder sound This patch uses a vendor register to check whether the system hibernated ever. The driver will only set the preset when the driver brings up or the system hibernated. It will avoid the unknown issue that makes the speaker output louder and can't control the volume. Signed-off-by: Shuming Fan Date: Sun Aug 13 08:56:24 2023 -0700 Merge tag 'kbuild-fixes-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Clear errno before calling getline() - Fix a modpost warning for ARCH=alpha * tag 'kbuild-fixes-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: alpha: remove __init annotation from exported page_is_ram() scripts/kallsyms: Fix build failure by setting errno before calling getline() commit 3dcf1473c711be5536321fa4d465b9ed9e42a0ce Merge: 7308e92756d58 2b6aa6610dc96 Author: Linus Torvalds Date: Sun Aug 13 08:50:26 2023 -0700 Merge tag 'platform-drivers-x86-v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform drivers fixes from Hans de Goede: - lenovo-ymc driver causes keyboard + touchpad to not work with >= 6.4 on some Thinkbook models, fix this - A set of small fixes for mlx-platform - Other small fixes and hw-id additions * tag 'platform-drivers-x86-v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: lenovo-ymc: Only bind on machines with a convertible DMI chassis-type platform: mellanox: Change register offset addresses platform: mellanox: mlx-platform: Modify graceful shutdown callback and power down mask platform: mellanox: mlx-platform: Fix signals polarity and latch mask platform: mellanox: Fix order in exit flow platform/x86: ISST: Reduce noise for missing numa information in logs platform/x86: msi-ec: Fix the build ACPI: scan: Create platform device for CS35L56 platform/x86/amd/pmf: Fix unsigned comparison with less than zero commit 7308e92756d5891d58e7bcae01a516514583921d Merge: a785fd28d31f7 ef222f551e7c4 Author: Linus Torvalds Date: Sun Aug 13 08:43:26 2023 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Eleven small fixes, ten in drivers. Of the two fixes marked core, one is in the raid helper class (used by some raid device drivers) and the other one is the /proc/scsi/scsi parsing fix for potential reads beyond the end of the buffer" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: qedf: Fix firmware halt over suspend and resume scsi: qedi: Fix firmware halt over suspend and resume scsi: qedi: Fix potential deadlock on &qedi_percpu->p_work_lock scsi: lpfc: Remove reftag check in DIF paths scsi: ufs: renesas: Fix private allocation scsi: snic: Fix possible memory leak if device_add() fails scsi: core: Fix possible memory leak if device_add() fails scsi: core: Fix legacy /proc parsing buffer overflow scsi: 53c700: Check that command slot is not NULL scsi: fnic: Replace return codes in fnic_clean_pending_aborts() scsi: storvsc: Fix handling of virtual Fibre Channel timeouts commit 2b6aa6610dc9690f79d305ca938abfb799a4f766 Author: Hans de Goede Date: Sat Aug 12 16:48:18 2023 +0200 platform/x86: lenovo-ymc: Only bind on machines with a convertible DMI chassis-type The lenovo-ymc driver is causing the keyboard + touchpad to stop working on some regular laptop models such as the Lenovo ThinkBook 13s G2 ITL 20V9. The problem is that there are YMC WMI GUID methods in the ACPI tables of these laptops, despite them not being Yogas and lenovo-ymc loading causes libinput to see a SW_TABLET_MODE switch with state 1. This in turn causes libinput to ignore events from the builtin keyboard and touchpad, since it filters those out for a Yoga in tablet mode. Similar issues with false-positive SW_TABLET_MODE=1 reporting have been seen with the intel-hid driver. Copy the intel-hid driver approach to fix this and only bind to the WMI device on machines where the DMI chassis-type indicates the machine is a convertible. Add a 'force' module parameter to allow overriding the chassis-type check so that users can easily test if the YMC interface works on models which report an unexpected chassis-type. Fixes: e82882cdd241 ("platform/x86: Add driver for Yoga Tablet Mode switch") Link: https://bugzilla.redhat.com/show_bug.cgi?id=2229373 Cc: André Apitzsch Cc: stable@vger.kernel.org Tested-by: Andrew Kallmeyer Tested-by: Gergő Köteles Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230812144818.383230-1-hdegoede@redhat.com commit d66a8aab7dc36c975bbaa6aa74cf7445878e7c69 Author: Vadim Pasternak Date: Sun Aug 13 08:37:35 2023 +0000 platform: mellanox: Change register offset addresses Move debug register offsets to different location due to hardware changes. Fixes: dd635e33b5c9 ("platform: mellanox: Introduce support of new Nvidia L1 switch") Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Link: https://lore.kernel.org/r/20230813083735.39090-5-vadimp@nvidia.com Signed-off-by: Hans de Goede commit 9f8ccdb5088bd03062d9ad9c0f6abf600cbed8e8 Author: Vadim Pasternak Date: Sun Aug 13 08:37:34 2023 +0000 platform: mellanox: mlx-platform: Modify graceful shutdown callback and power down mask Use kernel_power_off() instead of kernel_halt() to pass through machine_power_off() -> pm_power_off(), otherwise axillary power does not go off. Change "power down" bitmask. Fixes: dd635e33b5c9 ("platform: mellanox: Introduce support of new Nvidia L1 switch") Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Link: https://lore.kernel.org/r/20230813083735.39090-4-vadimp@nvidia.com Signed-off-by: Hans de Goede commit 3c91d7e8c64f75c63da3565d16d5780320bd5d76 Author: Vadim Pasternak Date: Sun Aug 13 08:37:33 2023 +0000 platform: mellanox: mlx-platform: Fix signals polarity and latch mask Change polarity of chassis health and power signals and fix latch reset mask for L1 switch. Fixes: dd635e33b5c9 ("platform: mellanox: Introduce support of new Nvidia L1 switch") Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Link: https://lore.kernel.org/r/20230813083735.39090-3-vadimp@nvidia.com Signed-off-by: Hans de Goede commit 8e3938cff0191c810b2abd827313c090fe09d166 Author: Vadim Pasternak Date: Sun Aug 13 08:37:32 2023 +0000 platform: mellanox: Fix order in exit flow Fix exit flow order: call mlxplat_post_exit() after mlxplat_i2c_main_exit() in order to unregister main i2c driver before to "mlxplat" driver. Fixes: 0170f616f496 ("platform: mellanox: Split initialization procedure") Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Link: https://lore.kernel.org/r/20230813083735.39090-2-vadimp@nvidia.com Signed-off-by: Hans de Goede commit cc941e548bffc01b5816b4edc5cb432a137a58b3 Author: Russell King (Oracle) Date: Fri Aug 11 11:26:30 2023 +0100 net: phy: fix IRQ-based wake-on-lan over hibernate / power off Uwe reports: "Most PHYs signal WoL using an interrupt. So disabling interrupts [at shutdown] breaks WoL at least on PHYs covered by the marvell driver." Discussing with Ioana, the problem which was trying to be solved was: "The board in question is a LS1021ATSN which has two AR8031 PHYs that share an interrupt line. In case only one of the PHYs is probed and there are pending interrupts on the PHY#2 an IRQ storm will happen since there is no entity to clear the interrupt from PHY#2's registers. PHY#1's driver will get stuck in .handle_interrupt() indefinitely." Further confirmation that "the two AR8031 PHYs are on the same MDIO bus." With WoL using interrupts to wake the system, in such a case, the system will begin booting with an asserted interrupt. Thus, we need to cope with an interrupt asserted during boot. Solve this instead by disabling interrupts during PHY probe. This will ensure in Ioana's situation that both PHYs of the same type sharing an interrupt line on a common MDIO bus will have their interrupt outputs disabled when the driver probes the device, but before we hook in any interrupt handlers - thus avoiding the interrupt storm. A better fix would be for platform firmware to disable the interrupting devices at source during boot, before control is handed to the kernel. Fixes: e2f016cf7751 ("net: phy: add a shutdown procedure") Link: 20230804071757.383971-1-u.kleine-koenig@pengutronix.de Reported-by: Uwe Kleine-König Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit a785fd28d31f76d50004712b6e0b409d5a8239d8 Merge: ae545c3283dc6 92fb94b69c6ac Author: Linus Torvalds Date: Sat Aug 12 13:28:55 2023 -0700 Merge tag 'for-6.5-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "More fixes, some of them going back to older releases and there are fixes for hangs in stress tests regarding space caching: - fixes and progress tracking for hangs in free space caching, found by test generic/475 - writeback fixes, write pages in integrity mode and skip writing pages that have been written meanwhile - properly clear end of extent range after an error - relocation fixes: - fix race betwen qgroup tree creation and relocation - detect and report invalid reloc roots" * tag 'for-6.5-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: set cache_block_group_error if we find an error btrfs: reject invalid reloc tree root keys with stack dump btrfs: exit gracefully if reloc roots don't match btrfs: avoid race between qgroup tree creation and relocation btrfs: properly clear end of the unreserved range in cow_file_range btrfs: don't wait for writeback on clean pages in extent_write_cache_pages btrfs: don't stop integrity writeback too early btrfs: wait for actual caching progress during allocation commit ae545c3283dc673f7e748065efa46ba95f678ef2 Merge: c8afaa1b0f8bc 33f83d13ded16 Author: Linus Torvalds Date: Sat Aug 12 11:34:23 2023 -0700 Merge tag 'gpio-fixes-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - mark virtual chips exposed by gpio-sim as ones that can sleep (callbacks must not be called from interrupt context) - fix an off-by-one error in gpio-ws16c48 * tag 'gpio-fixes-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: ws16c48: Fix off-by-one error in WS16C48 resource region extent gpio: sim: mark the GPIO chip as a one that can sleep commit c8afaa1b0f8bc93d013ab2ea6b9649958af3f1d3 Author: Mateusz Guzik Date: Sat Aug 12 18:15:54 2023 +0200 locking: remove spin_lock_prefetch The only remaining consumer is new_inode, where it showed up in 2001 as commit c37fa164f793 ("v2.4.9.9 -> v2.4.9.10") in a historical repo [1] with a changelog which does not mention it. Since then the line got only touched up to keep compiling. While it may have been of benefit back in the day, it is guaranteed to at best not get in the way in the multicore setting -- as the code performs *a lot* of work between the prefetch and actual lock acquire, any contention means the cacheline is already invalid by the time the routine calls spin_lock(). It adds spurious traffic, for short. On top of it prefetch is notoriously tricky to use for single-threaded purposes, making it questionable from the get go. As such, remove it. I admit upfront I did not see value in benchmarking this change, but I can do it if that is deemed appropriate. Removal from new_inode and of the entire thing are in the same patch as requested by Linus, so whatever weird looks can be directed at that guy. Link: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/fs/inode.c?id=c37fa164f793735b32aa3f53154ff1a7659e6442 [1] Signed-off-by: Mateusz Guzik Signed-off-by: Linus Torvalds commit 3feecb1b848359b152dd66b26c24c2454a64fc15 Merge: 469a2f5041880 51a26bb02ae58 Author: Linus Torvalds Date: Sat Aug 12 09:03:15 2023 -0700 Merge tag 'char-misc-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char / misc driver fixes from Greg KH: "Here are some small char/misc driver fixes for 6.5-rc6 that resolve some reported issues. Included in here are: - bunch of iio driver fixes for reported problems - interconnect driver fixes - counter driver build fix - cardreader driver fixes - binder driver fixes - other tiny driver fixes All of these have been in linux-next for a while with no reported problems" * tag 'char-misc-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits) misc: tps6594-esm: Disable ESM for rev 1 PMIC misc: rtsx: judge ASPM Mode to set PETXCFG Reg binder: fix memory leak in binder_init() iio: cros_ec: Fix the allocation size for cros_ec_command tools/counter: Makefile: Replace rmdir by rm to avoid make,clean failure iio: imu: lsm6dsx: Fix mount matrix retrieval iio: adc: meson: fix core clock enable/disable moment iio: core: Prevent invalid memory access when there is no parent iio: frequency: admv1013: propagate errors from regulator_get_voltage() counter: Fix menuconfig "Counter support" submenu entries disappearance dt-bindings: iio: adi,ad74115: remove ref from -nanoamp iio: adc: ina2xx: avoid NULL pointer dereference on OF device match iio: light: bu27008: Fix intensity data type iio: light: bu27008: Fix scale format iio: light: bu27034: Fix scale format iio: adc: ad7192: Fix ac excitation feature interconnect: qcom: sa8775p: add enable_mask for bcm nodes interconnect: qcom: sm8550: add enable_mask for bcm nodes interconnect: qcom: sm8450: add enable_mask for bcm nodes interconnect: qcom: Add support for mask-based BCMs ... commit 469a2f504188003d76718f99a4f5755c4d369b74 Merge: 43972cf2deb2f f48585c468f51 Author: Linus Torvalds Date: Sat Aug 12 08:58:54 2023 -0700 Merge tag 'usb-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB / Thunderbolt driver fixes from Greg KH: "Here are some small USB and Thunderbolt driver fixes for reported problems. Included in here are: - thunderbolt driver memory leak fix - thunderbolt display flicker fix - usb dwc3 driver fix - usb gadget uvc disconnect crash fix - usb typec Kconfig build dependency fix - usb typec small fixes - usb-con-gpio bugfix - usb-storage old driver bugfix All of these have been in linux-next for a while with no reported issues" * tag 'usb-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request() usb: dwc3: Properly handle processing of pending events usb-storage: alauda: Fix uninit-value in alauda_check_media() usb: common: usb-conn-gpio: Prevent bailing out if initial role is none USB: Gadget: core: Help prevent panic during UVC unconfigure usb: typec: mux: intel: Add dependency on USB_COMMON usb: typec: nb7vpq904m: Add an error handling path in nb7vpq904m_probe() usb: typec: altmodes/displayport: Signal hpd when configuring pin assignment usb: typec: tcpm: Fix response to vsafe0V event thunderbolt: Fix Thunderbolt 3 display flickering issue on 2nd hot plug onwards commit 43972cf2deb2f54a97530c82b88c555fd682428e Merge: 272b86ba9d975 6dbef74aeb090 Author: Linus Torvalds Date: Sat Aug 12 08:47:01 2023 -0700 Merge tag 'x86_urgent_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Do not parse the confidential computing blob on non-AMD hardware as it leads to an EFI config table ending up unmapped - Use the correct segment selector in the 32-bit version of getcpu() in the vDSO - Make sure vDSO and VVAR regions are placed in the 47-bit VA range even on 5-level paging systems - Add models 0x90-0x91 to the range of AMD Zenbleed-affected CPUs * tag 'x86_urgent_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu/amd: Enable Zenbleed fix for AMD Custom APU 0405 x86/mm: Fix VDSO and VVAR placement on 5-level paging machines x86/linkage: Fix typo of BUILD_VDSO in asm/linkage.h x86/vdso: Choose the right GDT_ENTRY_CPUNODE for 32-bit getcpu() on 64-bit kernel x86/sev: Do not try to parse for the CC blob on non-AMD hardware commit 272b86ba9d97518b3c14b97514b6544eef87e7a5 Merge: f8de32cc060ba 3477144c878a5 Author: Linus Torvalds Date: Sat Aug 12 08:34:20 2023 -0700 Merge tag 'x86_bugs_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 mitigation fixes from Borislav Petkov: "The first set of fallout fixes after the embargo madness. There will be another set next week too. - A first series of cleanups/unifications and documentation improvements to the SRSO and GDS mitigations code which got postponed to after the embargo date - Fix the SRSO aliasing addresses assertion so that the LLVM linker can parse it too" * tag 'x86_bugs_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: driver core: cpu: Fix the fallback cpu_show_gds() name x86: Move gds_ucode_mitigated() declaration to header x86/speculation: Add cpu_show_gds() prototype driver core: cpu: Make cpu_show_not_affected() static x86/srso: Fix build breakage with the LLVM linker Documentation/srso: Document IBPB aspect and fix formatting driver core: cpu: Unify redundant silly stubs Documentation/hw-vuln: Unify filename specification in index commit 6e6d847a8ce18ab2fbec4f579f682486a82d2c6b Author: Jiasheng Jiang Date: Thu Aug 10 22:01:04 2023 +0930 soc: aspeed: socinfo: Add kfree for kstrdup Add kfree() in the later error handling in order to avoid memory leak. Fixes: e0218dca5787 ("soc: aspeed: Add soc info driver") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20230707021625.7727-1-jiasheng@iscas.ac.cn Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20230810123104.231167-1-joel@jms.id.au Signed-off-by: Arnd Bergmann commit e4ad279ae345413d900d791f2f618d0a1cd0d791 Author: Zev Weiss Date: Thu Aug 10 21:59:41 2023 +0930 soc: aspeed: uart-routing: Use __sysfs_match_string The existing use of match_string() caused it to reject 'echo foo' due to the implicitly appended newline, which was somewhat ergonomically awkward and inconsistent with typical sysfs behavior. Using the __sysfs_* variant instead provides more convenient and consistent linefeed-agnostic behavior. Signed-off-by: Zev Weiss Fixes: c6807970c3bc ("soc: aspeed: Add UART routing support") Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20230628083735.19946-2-zev@bewilderbeest.net Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20230810122941.231085-1-joel@jms.id.au Signed-off-by: Arnd Bergmann commit 42ff49a1967af71772b264009659ce181f7d2d2a Author: Lin Yujun Date: Fri Aug 11 09:00:06 2023 +0200 ARM: dts: integrator: fix PCI bus dtc warnings An warning is reported when allmodconfig is used to compile the kernel of the ARM architecture: arch/arm/boot/dts/arm/integratorap.dts:161.22-206.4: Warning (pci_bridge): /pciv3@62000000: node name is not "pci" or "pcie" Change the node name to pci to clear the build warning. Signed-off-by: Lin Yujun Reviewed-by: Krzysztof Kozlowski Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230811-versatile-dts-v6-6-v1-1-d8cb9d1947ed@linaro.org Signed-off-by: Arnd Bergmann commit d842f4dc68a0700e83df6a77a646c145f85a79ea Merge: 991e0d9dbbd01 bb54e6609977f Author: Arnd Bergmann Date: Sat Aug 12 10:13:11 2023 +0200 Merge tag 'zynq-soc-for-6.6' of https://github.com/Xilinx/linux-xlnx into arm/fixes ARM: Zynq SoC changes for v6.6 - Sort out OF headers in pm.c * tag 'zynq-soc-for-6.6' of https://github.com/Xilinx/linux-xlnx: ARM: zynq: Explicitly include correct DT includes Link: https://lore.kernel.org/r/a56457a0-7e5a-df46-2c86-3f2ace578984@monstr.eu Signed-off-by: Arnd Bergmann commit 991e0d9dbbd018fb9904f369348fb248f0b22687 Merge: 52a93d39b17dc 78e869dd8b2ba Author: Arnd Bergmann Date: Sat Aug 12 10:12:23 2023 +0200 Merge tag 'imx-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 6.5, 2nd round: - Fix i.MX93 ANATOP 'reg' resource size to avoid overlapping with TMU memory area. - Fix RTC interrupt level on imx6qdl-phytec-mira board. - Remove LDB endpoint from from the common imx6sx.dtsi as it causes regression for boards that has the LCDIF connected directly to a parallel display. - Drop CSI1 PHY reference clock configuration from i.MX8MM/N device tree to avoid overclocking. - Set a proper default tuning step for i.MX6SX and i.MX7D uSDHC to fix a tuning failure seen with some SD cards. * tag 'imx-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: imx93: Fix anatop node size ARM: dts: imx: Set default tuning step for imx6sx usdhc arm64: dts: imx8mm: Drop CSI1 PHY reference clock configuration arm64: dts: imx8mn: Drop CSI1 PHY reference clock configuration ARM: dts: imx: Set default tuning step for imx7d usdhc ARM: dts: imx6: phytec: fix RTC interrupt level ARM: dts: imx6sx: Remove LDB endpoint Link: https://lore.kernel.org/r/20230809100034.GS151430@dragon Signed-off-by: Arnd Bergmann commit f8de32cc060ba3f63171aaa0e8764d22d8c37978 Merge: 9a20704fb4064 6aaf663ee04a8 Author: Linus Torvalds Date: Fri Aug 11 19:46:04 2023 -0700 Merge tag 'tpmdd-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull tpm irq fixes from Jarkko Sakkinen: "These change the probing and enabling of interrupts advertised by the platform firmware (i.e. ACPI, Device Tree) to be an opt-in for tpm_tis, which can be set from the kernel command-line. Note that the opt-in change is only for the PC MMIO tpm_tis module. It does not affect other similar drivers using IRQs, like tpm_tis_spi and synquacer" * tag 'tpmdd-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: tpm_tis: Opt-in interrupts tpm: tpm_tis: Fix UPX-i11 DMI_MATCH condition commit 9a20704fb40642d5b7d4f1db58f252f6aca563a9 Merge: 0725a70411bd8 64b632654b973 Author: Linus Torvalds Date: Fri Aug 11 19:39:01 2023 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "A few small bugs: - Fix longstanding mlx5 bug where ODP would fail with certain MR alignments - cancel work to prevent a hfi1 UAF - MAINTAINERS update - UAF, missing mutex_init and an error unwind bug in bnxt_re" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/bnxt_re: Initialize dpi_tbl_lock mutex RDMA/bnxt_re: Fix error handling in probe failure path RDMA/bnxt_re: Properly order ib_device_unalloc() to avoid UAF MAINTAINERS: Remove maintainer of HiSilicon RoCE IB/hfi1: Fix possible panic during hotplug remove RDMA/umem: Set iova in ODP flow commit 0725a70411bd836231c3e78090ac47cac51246b1 Merge: 5512c33c7b942 fe9da61ffccad Author: Linus Torvalds Date: Fri Aug 11 18:35:56 2023 -0700 Merge tag 'zonefs-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs Pull zonefs fix from Damien Le Moal: - The switch to using iomap for executing a direct synchronous write to sequential files using a zone append BIO overlooked cases where the BIO built by iomap is too large and needs splitting, which is not allowed with zone append. Fix this by using regular write commands instead. The use of zone append commands will be reintroduced later with proper support from iomap. * tag 'zonefs-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: zonefs: fix synchronous direct writes to sequential files commit 5512c33c7b942033f772db56be46d5de9493deae Merge: 190bf7b14b0cf 56b930dcd88c2 Author: Linus Torvalds Date: Fri Aug 11 18:30:29 2023 -0700 Merge tag 'hwmon-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - Fix sporadic comunication errors in pmbus/bel-pfe and aquacomputer_d5next drivers * tag 'hwmon-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (aquacomputer_d5next) Add selective 200ms delay after sending ctrl report hwmon: (pmbus/bel-pfe) Enable PMBUS_SKIP_STATUS_CHECK for pfe1100 commit 6aaf663ee04a80b445f8f5abff53cb92cb583c88 Author: Jarkko Sakkinen Date: Sat Aug 12 02:07:10 2023 +0300 tpm_tis: Opt-in interrupts Cc: stable@vger.kernel.org # v6.4+ Link: https://lore.kernel.org/linux-integrity/CAHk-=whRVp4h8uWOX1YO+Y99+44u4s=XxMK4v00B6F1mOfqPLg@mail.gmail.com/ Fixes: e644b2f498d2 ("tpm, tpm_tis: Enable interrupt test") Signed-off-by: Jarkko Sakkinen commit 51e5e551af53259e0274b0cd4ff83d8351fb8c40 Author: Peter Ujfalusi Date: Tue Aug 8 12:48:36 2023 +0300 tpm: tpm_tis: Fix UPX-i11 DMI_MATCH condition The patch which made it to the kernel somehow changed the match condition from DMI_MATCH(DMI_PRODUCT_NAME, "UPX-TGL01") to DMI_MATCH(DMI_PRODUCT_VERSION, "UPX-TGL") Revert back to the correct match condition to disable the interrupt mode on the board. Cc: stable@vger.kernel.org # v6.4+ Fixes: edb13d7bb034 ("tpm: tpm_tis: Disable interrupts *only* for AEON UPX-i11") Link: https://lore.kernel.org/lkml/20230524085844.11580-1-peter.ujfalusi@linux.intel.com/ Signed-off-by: Peter Ujfalusi Signed-off-by: Jarkko Sakkinen commit 190bf7b14b0cf3df19c059061be032bd8994a597 Merge: 29d99aae13cf2 5f1fc67f2cb8d Author: Linus Torvalds Date: Fri Aug 11 14:19:20 2023 -0700 Merge tag 'mm-hotfixes-stable-2023-08-11-13-44' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc fixes from Andrew Morton: "14 hotfixes. 11 of these are cc:stable and the remainder address post-6.4 issues, or are not considered suitable for -stable backporting" * tag 'mm-hotfixes-stable-2023-08-11-13-44' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm/damon/core: initialize damo_filter->list from damos_new_filter() nilfs2: fix use-after-free of nilfs_root in dirtying inodes via iput selftests: cgroup: fix test_kmem_basic false positives fs/proc/kcore: reinstate bounce buffer for KCORE_TEXT regions MAINTAINERS: add maple tree mailing list mm: compaction: fix endless looping over same migrate block selftests: mm: ksm: fix incorrect evaluation of parameter hugetlb: do not clear hugetlb dtor until allocating vmemmap mm: memory-failure: avoid false hwpoison page mapped error info mm: memory-failure: fix potential unexpected return value from unpoison_memory() mm/swapfile: fix wrong swap entry type for hwpoisoned swapcache page radix tree test suite: fix incorrect allocation size for pthreads crypto, cifs: fix error handling in extract_iter_to_sg() zsmalloc: fix races between modifications of fullness and isolated commit 6dbef74aeb090d6bee7d64ef3fa82ae6fa53f271 Author: Cristian Ciocaltea Date: Fri Aug 11 23:37:05 2023 +0300 x86/cpu/amd: Enable Zenbleed fix for AMD Custom APU 0405 Commit 522b1d69219d ("x86/cpu/amd: Add a Zenbleed fix") provided a fix for the Zen2 VZEROUPPER data corruption bug affecting a range of CPU models, but the AMD Custom APU 0405 found on SteamDeck was not listed, although it is clearly affected by the vulnerability. Add this CPU variant to the Zenbleed erratum list, in order to unconditionally enable the fallback fix until a proper microcode update is available. Fixes: 522b1d69219d ("x86/cpu/amd: Add a Zenbleed fix") Signed-off-by: Cristian Ciocaltea Signed-off-by: Borislav Petkov (AMD) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230811203705.1699914-1-cristian.ciocaltea@collabora.com commit 33f83d13ded164cd49ce2a3bd2770115abc64e6f Author: William Breathitt Gray Date: Thu Aug 10 18:00:44 2023 -0400 gpio: ws16c48: Fix off-by-one error in WS16C48 resource region extent The WinSystems WS16C48 I/O address region spans offsets 0x0 through 0xA, which is a total of 11 bytes. Fix the WS16C48_EXTENT define to the correct value of 11 so that access to necessary device registers is properly requested in the ws16c48_probe() callback by the devm_request_region() function call. Fixes: 2c05a0f29f41 ("gpio: ws16c48: Implement and utilize register structures") Cc: stable@vger.kernel.org Cc: Paul Demetrotion Signed-off-by: William Breathitt Gray Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 29d99aae13cf2713b85bc26a37921e231676ba48 Merge: 9578b04c32397 56fec0051a69a Author: Linus Torvalds Date: Fri Aug 11 12:30:00 2023 -0700 Merge tag 'acpi-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "Rework the handling of interrupt overrides on AMD Zen-based machines to avoid recently introduced regressions (Hans de Goede). Note that this is intended as a short-term mitigation for 6.5 and the long-term approach will be to attempt to use the configuration left by the BIOS, but it requires more investigation" * tag 'acpi-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: resource: Add IRQ override quirk for PCSpecialist Elimina Pro 16 M ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen ACPI: resource: Always use MADT override IRQ settings for all legacy non i8042 IRQs ACPI: resource: revert "Remove "Zen" specific match and quirks" commit 9578b04c32397e664bd4643c8b7f525728df3028 Merge: 360e694282fce 4778e1288447d Author: Linus Torvalds Date: Fri Aug 11 12:24:22 2023 -0700 Merge tag 'pm-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These fix an amd-pstate cpufreq driver issues and recently introduced hibernation-related breakage. Specifics: - Make amd-pstate use device_attributes as expected by the CPU root kobject (Thomas Weißschuh) - Restore the previous behavior of resume_store() when hibernation is not available which is to return the full number of bytes that were to be written by user space (Vlastimil Babka)" * tag 'pm-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: amd-pstate: fix global sysfs attribute type PM: hibernate: fix resume_store() return value when hibernation not available commit 04c7f60ca477ffbf7b7910320482335050f0d23a Author: Tony Lindgren Date: Fri Aug 11 13:36:45 2023 +0300 serial: core: Fix serial core port id, including multiport devices We want to fix the serial core port DEVNAME to use a port id of the hardware specific controller port instance instead of the port->line. For example, the 8250 driver sets up a number of serial8250 ports initially that can be inherited by the hardware specific driver. At that the port->line no longer decribes the port's relation to the serial core controller instance. Let's fix the issue by assigning port->port_id for each serial core controller port instance. Fixes: 7d695d83767c ("serial: core: Fix serial_base_match() after fixing controller port name") Tested-by: Guenter Roeck Reviewed-by: Dhruva Gole Signed-off-by: Tony Lindgren Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230811103648.2826-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 3d9e6f556e235ddcdc9f73600fdd46fe1736b090 Author: Jiri Slaby (SUSE) Date: Fri Aug 11 08:43:40 2023 +0200 serial: 8250: drop lockdep annotation from serial8250_clear_IER() The port lock is not always held when calling serial8250_clear_IER(). When an oops is in progress, the lock is tried to be taken and when it is not, a warning is issued: WARNING: CPU: 0 PID: 1 at drivers/tty/serial/8250/8250_port.c:707 +0x57/0x60 Modules linked in: CPU: 0 PID: 1 Comm: init Not tainted 6.5.0-rc5-1.g225bfb7-default+ #774 00f1be860db663ed29479b8255d3b01ab1135bd3 Hardware name: QEMU Standard PC ... RIP: 0010:serial8250_clear_IER+0x57/0x60 ... Call Trace: serial8250_console_write+0x9e/0x4b0 console_flush_all+0x217/0x5f0 ... Therefore, remove the annotation as it doesn't hold for all invocations. The other option would be to make the lockdep test conditional on 'oops_in_progress' or pass 'locked' from serial8250_console_write(). I don't think, that is worth it. Signed-off-by: "Jiri Slaby (SUSE)" Reported-by: Vlastimil Babka Cc: John Ogness Fixes: d0b309a5d3f4 (serial: 8250: synchronize and annotate UART_IER access) Link: https://lore.kernel.org/r/20230811064340.13400-1-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 3c4f8333b582487a2d1e02171f1465531cde53e3 Author: Yi Yang Date: Fri Aug 11 11:11:21 2023 +0800 tty: n_gsm: fix the UAF caused by race condition in gsm_cleanup_mux In commit 9b9c8195f3f0 ("tty: n_gsm: fix UAF in gsm_cleanup_mux"), the UAF problem is not completely fixed. There is a race condition in gsm_cleanup_mux(), which caused this UAF. The UAF problem is triggered by the following race: task[5046] task[5054] ----------------------- ----------------------- gsm_cleanup_mux(); dlci = gsm->dlci[0]; mutex_lock(&gsm->mutex); gsm_cleanup_mux(); dlci = gsm->dlci[0]; //Didn't take the lock gsm_dlci_release(gsm->dlci[i]); gsm->dlci[i] = NULL; mutex_unlock(&gsm->mutex); mutex_lock(&gsm->mutex); dlci->dead = true; //UAF Fix it by assigning values after mutex_lock(). Link: https://syzkaller.appspot.com/text?tag=CrashReport&x=176188b5a80000 Cc: stable Fixes: 9b9c8195f3f0 ("tty: n_gsm: fix UAF in gsm_cleanup_mux") Fixes: aa371e96f05d ("tty: n_gsm: fix restart handling via CLD command") Signed-off-by: Yi Yang Co-developed-by: Qiumiao Zhang Signed-off-by: Qiumiao Zhang Link: https://lore.kernel.org/r/20230811031121.153237-1-yiyang13@huawei.com Signed-off-by: Greg Kroah-Hartman commit 360e694282fce69608e2775bf843b2aafd19e4b4 Merge: 2e40ed24e1696 a7a7dabb5dd72 Author: Linus Torvalds Date: Fri Aug 11 12:14:08 2023 -0700 Merge tag 'block-6.5-2023-08-11' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - NVMe pull request via Keith: - Fixes for request_queue state (Ming) - Another uuid quirk (August) - RCU poll fix for NVMe (Ming) - Fix for an IO stall with polled IO (me) - Fix for blk-iocost stats enable/disable accounting (Chengming) - Regression fix for large pages for zram (Christoph) * tag 'block-6.5-2023-08-11' of git://git.kernel.dk/linux: nvme: core: don't hold rcu read lock in nvme_ns_chr_uring_cmd_iopoll blk-iocost: fix queue stats accounting block: don't make REQ_POLLED imply REQ_NOWAIT block: get rid of unused plug->nowait flag zram: take device and not only bvec offset into account nvme-pci: add NVME_QUIRK_BOGUS_NID for Samsung PM9B1 256G and 512G nvme-rdma: fix potential unbalanced freeze & unfreeze nvme-tcp: fix potential unbalanced freeze & unfreeze nvme: fix possible hang when removing a controller during error recovery commit 2e40ed24e1696e47e94e804d09ef88ecb6617201 Merge: 9106536c1aa37 56675f8b9f9b1 Author: Linus Torvalds Date: Fri Aug 11 12:06:51 2023 -0700 Merge tag 'io_uring-6.5-2023-08-11' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: "A followup fix for the parisc/SHM_COLOUR fix, also from Helge, which is heading to stable. And then just the io_uring equivalent of the RESOLVE_CACHED fix in commit a0fc452a5d7f from last week for build_open_flags()" * tag 'io_uring-6.5-2023-08-11' of git://git.kernel.dk/linux: io_uring/parisc: Adjust pgoff in io_uring mmap() for parisc io_uring: correct check for O_TMPFILE commit 3477144c878a52fc3938a529186e81ea030e7779 Author: Borislav Petkov (AMD) Date: Fri Aug 11 11:32:09 2023 +0200 driver core: cpu: Fix the fallback cpu_show_gds() name In 6524c798b727 ("driver core: cpu: Make cpu_show_not_affected() static") I fat-fingered the name of cpu_show_gds(). Usually, I'd rebase but since those are extraordinary embargoed times, the commit above was already pulled into another tree so no no. Therefore, fix it ontop. Fixes: 6524c798b727 ("driver core: cpu: Make cpu_show_not_affected() static") Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230811095831.27513-1-bp@alien8.de commit 4778e1288447d9f90d87df07d195dc89e290d973 Merge: df2f7cde73cb5 5e720f8c8c9d9 Author: Rafael J. Wysocki Date: Fri Aug 11 19:57:24 2023 +0200 Merge branch 'pm-cpufreq' Merge a cpufreq fix for 6.5-rc6. This makes amd-pstate use device_attributes as expected by the CPU root kobject. * pm-cpufreq: cpufreq: amd-pstate: fix global sysfs attribute type commit 9106536c1aa37bcf60202ad93bb8b94bcd29f3f0 Merge: 2a3c17edbf538 cc22522fd55e2 Author: Linus Torvalds Date: Fri Aug 11 09:39:17 2023 -0700 Merge tag 'pci-v6.5-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci Pull pci fixes from Bjorn Helgaas: - Add Manivannan Sadhasivam as DesignWare PCIe driver co-maintainer (Krzysztof Wilczyński) - Revert "PCI: dwc: Wait for link up only if link is started" to fix a regression on Qualcomm platforms that don't reach interconnect sync state if the slot is empty (Johan Hovold) - Revert "PCI: mvebu: Mark driver as BROKEN" so people can use pci-mvebu even though some others report problems (Bjorn Helgaas) - Avoid a NULL pointer dereference when using acpiphp for root bus hotplug to fix a regression added in v6.5-rc1 (Igor Mammedov) * tag 'pci-v6.5-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus Revert "PCI: mvebu: Mark driver as BROKEN" Revert "PCI: dwc: Wait for link up only if link is started" MAINTAINERS: Add Manivannan Sadhasivam as DesignWare PCIe driver maintainer commit 2a3c17edbf53816ba61746c38833b48c73ee2a16 Merge: feb0eee9aa3c8 7e3811521dc39 Author: Linus Torvalds Date: Fri Aug 11 09:12:44 2023 -0700 Merge tag 'riscv-for-linus-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - Fixes for a pair of kexec_file_load() failures - A fix to ensure the direct mapping is PMD-aligned - A fix for CPU feature detection on SMP=n - The MMIO ordering fences have been strengthened to ensure ordering WRT delay() - Fixes for a pair of -Wmissing-variable-declarations warnings - A fix to avoid PUD mappings in vmap on sv39 - flush_cache_vmap() now flushes the TLB to avoid issues on systems that cache invalid mappings * tag 'riscv-for-linus-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Implement flush_cache_vmap() riscv: Do not allow vmap pud mappings for 3-level page table riscv: mm: fix 2 instances of -Wmissing-variable-declarations riscv,mmio: Fix readX()-to-delay() ordering riscv: Fix CPU feature detection with SMP disabled riscv: Start of DRAM should at least be aligned on PMD size for the direct mapping riscv/kexec: load initrd high in available memory riscv/kexec: handle R_RISCV_CALL_PLT relocation type commit feb0eee9aa3c85aa15e3b60f82cb8d1fae28f2fe Merge: 2a5482c284e09 d863066e6ce0a Author: Linus Torvalds Date: Fri Aug 11 09:07:23 2023 -0700 Merge tag 'parisc-for-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture fixes from Helge Deller: "A bugfix in the LWS code, which used different lock words than the parisc lightweight spinlock checks. This inconsistency triggered false positives when the lightweight spinlock checks checked the locks of mutexes. The other patches are trivial cleanups and most of them fix sparse warnings. Summary: - Fix LWS code to use same lock words as for the parisc lightweight spinlocks - Use PTR_ERR_OR_ZERO() in pdt init code - Fix lots of sparse warnings" * tag 'parisc-for-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: perf: Make cpu_device variable static parisc: ftrace: Add declaration for ftrace_function_trampoline() parisc: boot: Nuke some sparse warnings in decompressor parisc: processor: Include asm/smp.h for init_per_cpu() parisc: unaligned: Include linux/sysctl.h for unaligned_enabled parisc: Move proc_mckinley_root and proc_runway_root to sba_iommu parisc: dma: Add prototype for pcxl_dma_start parisc: parisc_ksyms: Include libgcc.h for libgcc prototypes parisc: ucmpdi2: Fix no previous prototype for '__ucmpdi2' warning parisc: firmware: Mark pdc_result buffers local parisc: firmware: Fix sparse context imbalance warnings parisc: signal: Fix sparse incorrect type in assignment warning parisc: ioremap: Fix sparse warnings parisc: fault: Use C99 arrary initializers parisc: pdt: Use PTR_ERR_OR_ZERO() to simplify code parisc: Fix lightweight spinlock checks to not break futexes commit 2a5482c284e09423face5a7ef571b85185f43a48 Merge: 9b1b1b74ddb23 12acb348fa452 Author: Linus Torvalds Date: Fri Aug 11 09:00:31 2023 -0700 Merge tag 'cpuidle-psci-v6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm Pull cpuidle psci fixes from Ulf Hansson: "A couple of cpuidle-psci fixes. Usually, this is managed by arm-soc maintainers or Rafael, although due to a busy period I have stepped in to help out: - Fix the error path to prevent reverting from OSI back to PC mode" * tag 'cpuidle-psci-v6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: cpuidle: psci: Move enabling OSI mode after power domains creation cpuidle: dt_idle_genpd: Add helper function to remove genpd topology commit 9b1b1b74ddb236e7ccf6d11d4c0b642fbe0c66c6 Merge: 25aa0bebba72b fbe8ff726a1de Author: Linus Torvalds Date: Fri Aug 11 08:53:58 2023 -0700 Merge tag 'drm-fixes-2023-08-11' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "This week's fixes, as expected amdgpu is probably a little larger since it skipped a week, but otherwise a few nouveau fixes, a couple of bridge, rockchip and ivpu fixes. amdgpu: - S/G display workaround for platforms with >= 64G of memory - S0i3 fix - SMU 13.0.0 fixes - Disable SMU 13.x OD features temporarily while the interface is reworked to enable additional functionality - Fix cursor gamma issues on DCN3+ - SMU 13.0.6 fixes - Fix possible UAF in CS IOCTL - Polaris display regression fix - Only enable CP GFX shadowing on SR-IOV amdkfd: - Raven/Picasso KFD regression fix bridge: - it6505: runtime PM fix - lt9611: revert Do not generate HFP/HBP/HSA and EOT packet nouveau: - enable global memory loads for helper invocations for userspace driver - dp 1.3 dpcd+ workaround fix - remove unused function - revert incorrect NULL check accel/ivpu: - Add set_pages_array_wc/uc for internal buffers rockchip: - Don't spam logs in atomic check" * tag 'drm-fixes-2023-08-11' of git://anongit.freedesktop.org/drm/drm: (23 commits) drm/shmem-helper: Reset vma->vm_ops before calling dma_buf_mmap() drm/amdkfd: disable IOMMUv2 support for Raven drm/amdkfd: disable IOMMUv2 support for KV/CZ drm/amdkfd: ignore crat by default drm/amdgpu/gfx11: only enable CP GFX shadowing on SR-IOV drm/amd/display: Fix a regression on Polaris cards drm/amdgpu: fix possible UAF in amdgpu_cs_pass1() drm/amd/pm: Fix SMU v13.0.6 energy reporting drm/amd/display: check attr flag before set cursor degamma on DCN3+ drm/amd/pm: disable the SMU13 OD feature support temporarily drm/amd/pm: correct the pcie width for smu 13.0.0 drm/amd/display: Don't show stack trace for missing eDP drm/amdgpu: Match against exact bootloader status drm/amd/pm: skip the RLC stop when S0i3 suspend for SMU v13.0.4/11 drm/amd: Disable S/G for APUs when 64GB or more host memory drm/rockchip: Don't spam logs in atomic check accel/ivpu: Add set_pages_array_wc/uc for internal buffers drm/nouveau/disp: Revert a NULL check inside nouveau_connector_get_modes Revert "drm/bridge: lt9611: Do not generate HFP/HBP/HSA and EOT packet" drm/nouveau: remove unused tu102_gr_load() function ... commit 7c761166399bedfc89c928bef8015546d85a9099 Author: Stefan Binding Date: Fri Aug 11 13:30:44 2023 +0100 ALSA: hda/cs8409: Support new Dell Dolphin Variants Add 4 new Dell Dolphin Systems, same configuration as older systems. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20230811123044.1045651-1-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit a7a7dabb5dd72d2875bc3ce56f94ea5ceb259d5b Author: Ming Lei Date: Wed Aug 9 10:04:40 2023 +0800 nvme: core: don't hold rcu read lock in nvme_ns_chr_uring_cmd_iopoll Now nvme_ns_chr_uring_cmd_iopoll() has switched to request based io polling, and the associated NS is guaranteed to be live in case of io polling, so request is guaranteed to be valid because blk-mq uses pre-allocated request pool. Remove the rcu read lock in nvme_ns_chr_uring_cmd_iopoll(), which isn't needed any more after switching to request based io polling. Fix "BUG: sleeping function called from invalid context" because set_page_dirty_lock() from blk_rq_unmap_user() may sleep. Fixes: 585079b6e425 ("nvme: wire up async polling for io passthrough commands") Reported-by: Guangwu Zhang Cc: Kanchan Joshi Cc: Anuj Gupta Signed-off-by: Ming Lei Tested-by: Guangwu Zhang Link: https://lore.kernel.org/r/20230809020440.174682-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 829c6524d6729d05a82575dbcc16f99be5ee843d Author: Xiang Yang Date: Thu Aug 10 22:06:39 2023 +0800 net: pcs: Add missing put_device call in miic_create The reference of pdev->dev is taken by of_find_device_by_node, so it should be released when not need anymore. Fixes: 7dc54d3b8d91 ("net: pcs: add Renesas MII converter driver") Signed-off-by: Xiang Yang Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 51b813176f098ff61bd2833f627f5319ead098a5 Author: Jason Wang Date: Wed Aug 9 23:12:56 2023 -0400 virtio-net: set queues after driver_ok Commit 25266128fe16 ("virtio-net: fix race between set queues and probe") tries to fix the race between set queues and probe by calling _virtnet_set_queues() before DRIVER_OK is set. This violates virtio spec. Fixing this by setting queues after virtio_device_ready(). Note that rtnl needs to be held for userspace requests to change the number of queues. So we are serialized in this way. Fixes: 25266128fe16 ("virtio-net: fix race between set queues and probe") Reported-by: Dragos Tatulea Acked-by: Michael S. Tsirkin Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit fbe8ff726a1de82d87524f306b0f6491e13d7dfa Merge: 8ba371c778cbb 091ae5473f96c Author: Dave Airlie Date: Fri Aug 11 14:49:17 2023 +1000 Merge tag 'amd-drm-fixes-6.5-2023-08-09' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.5-2023-08-09: amdgpu: - S/G display workaround for platforms with >= 64G of memory - S0i3 fix - SMU 13.0.0 fixes - Disable SMU 13.x OD features temporarily while the interface is reworked to enable additional functionality - Fix cursor gamma issues on DCN3+ - SMU 13.0.6 fixes - Fix possible UAF in CS IOCTL - Polaris display regression fix - Only enable CP GFX shadowing on SR-IOV amdkfd: - Raven/Picasso KFD regression fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20230809182827.8135-1-alexander.deucher@amd.com commit 8ba371c778cbb3f0399b8ba8919bf89e462cdda3 Merge: 52a93d39b17dc 07dd476f61169 Author: Dave Airlie Date: Fri Aug 11 13:56:20 2023 +1000 Merge tag 'drm-misc-fixes-2023-08-10' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Multiple fixes for nouveau around memory safety and DisplayPort, one fix to reduce the log level of rockchip, a power state fix for the it6505 bridge, a timing fix for the lt9611 bridge, a cache maintenance fix for ivpu and one to reset vma->vm_ops on mmap for shmem-helper. Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/fwed6gzdtkse5ocrgd37elhyw7qirfptsvfp5mqqverdzifhxj@4da3vesxcqp2 commit e8f5f849ffce24490eb9449e98312b66c0dba76f Author: Steve French Date: Thu Aug 10 15:34:21 2023 -0500 cifs: fix potential oops in cifs_oplock_break With deferred close we can have closes that race with lease breaks, and so with the current checks for whether to send the lease response, oplock_response(), this can mean that an unmount (kill_sb) can occur just before we were checking if the tcon->ses is valid. See below: [Fri Aug 4 04:12:50 2023] RIP: 0010:cifs_oplock_break+0x1f7/0x5b0 [cifs] [Fri Aug 4 04:12:50 2023] Code: 7d a8 48 8b 7d c0 c0 e9 02 48 89 45 b8 41 89 cf e8 3e f5 ff ff 4c 89 f7 41 83 e7 01 e8 82 b3 03 f2 49 8b 45 50 48 85 c0 74 5e <48> 83 78 60 00 74 57 45 84 ff 75 52 48 8b 43 98 48 83 eb 68 48 39 [Fri Aug 4 04:12:50 2023] RSP: 0018:ffffb30607ddbdf8 EFLAGS: 00010206 [Fri Aug 4 04:12:50 2023] RAX: 632d223d32612022 RBX: ffff97136944b1e0 RCX: 0000000080100009 [Fri Aug 4 04:12:50 2023] RDX: 0000000000000001 RSI: 0000000080100009 RDI: ffff97136944b188 [Fri Aug 4 04:12:50 2023] RBP: ffffb30607ddbe58 R08: 0000000000000001 R09: ffffffffc08e0900 [Fri Aug 4 04:12:50 2023] R10: 0000000000000001 R11: 000000000000000f R12: ffff97136944b138 [Fri Aug 4 04:12:50 2023] R13: ffff97149147c000 R14: ffff97136944b188 R15: 0000000000000000 [Fri Aug 4 04:12:50 2023] FS: 0000000000000000(0000) GS:ffff9714f7c00000(0000) knlGS:0000000000000000 [Fri Aug 4 04:12:50 2023] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [Fri Aug 4 04:12:50 2023] CR2: 00007fd8de9c7590 CR3: 000000011228e000 CR4: 0000000000350ef0 [Fri Aug 4 04:12:50 2023] Call Trace: [Fri Aug 4 04:12:50 2023] [Fri Aug 4 04:12:50 2023] process_one_work+0x225/0x3d0 [Fri Aug 4 04:12:50 2023] worker_thread+0x4d/0x3e0 [Fri Aug 4 04:12:50 2023] ? process_one_work+0x3d0/0x3d0 [Fri Aug 4 04:12:50 2023] kthread+0x12a/0x150 [Fri Aug 4 04:12:50 2023] ? set_kthread_struct+0x50/0x50 [Fri Aug 4 04:12:50 2023] ret_from_fork+0x22/0x30 [Fri Aug 4 04:12:50 2023] To fix this change the ordering of the checks before sending the oplock_response to first check if the openFileList is empty. Fixes: da787d5b7498 ("SMB3: Do not send lease break acknowledgment if all file handles have been closed") Suggested-by: Bharath SM Reviewed-by: Bharath SM Reviewed-by: Shyam Prasad N Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 9ebbb29db9cae23e29881b9a268767d4baa53cdb Merge: 25aa0bebba72b eb3515dc99c7c Author: Jakub Kicinski Date: Thu Aug 10 18:18:24 2023 -0700 Merge branch 'x86/bugs' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Cross merge x86 fixes to fix clang linking errors: ld.lld: error: ./arch/x86/kernel/vmlinux.lds:221: at least one side of the expression must be absolute These will hopefully be downstream by the time we ship the next batch of fixes. * 'x86/bugs' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Move gds_ucode_mitigated() declaration to header x86/speculation: Add cpu_show_gds() prototype driver core: cpu: Make cpu_show_not_affected() static x86/srso: Fix build breakage with the LLVM linker Documentation/srso: Document IBPB aspect and fix formatting driver core: cpu: Unify redundant silly stubs Documentation/hw-vuln: Unify filename specification in index Link: https://lore.kernel.org/all/CAHk-=wj_b+FGTnevQSBAtCWuhCk=0oQ_THvthBW2hzqpOTLFmg@mail.gmail.com/ Signed-off-by: Jakub Kicinski commit d863066e6ce0a70c479a7f618088912ac0ba44ac Author: Helge Deller Date: Thu Aug 10 23:00:18 2023 +0200 parisc: perf: Make cpu_device variable static Signed-off-by: Helge Deller commit 2794f8ecb483b680610968423179005758a5ce63 Author: Helge Deller Date: Thu Aug 10 22:51:54 2023 +0200 parisc: ftrace: Add declaration for ftrace_function_trampoline() Make sparse happy by adding declaration for ftrace_function_trampoline(). Signed-off-by: Helge Deller commit b967f48d0240fa9b3ac0bfd7135647985016826e Author: Helge Deller Date: Thu Aug 10 22:42:57 2023 +0200 parisc: boot: Nuke some sparse warnings in decompressor Signed-off-by: Helge Deller commit 2c9227fd1c7e508f55eb4a38e8205f317e7c4ac9 Author: Helge Deller Date: Thu Aug 10 22:32:24 2023 +0200 parisc: processor: Include asm/smp.h for init_per_cpu() Fix sparse warning that init_per_cpu() isn't declared. Signed-off-by: Helge Deller commit 66f80386a99f2773611e1b537ad045061fdd92ec Author: Helge Deller Date: Thu Aug 10 20:23:01 2023 +0200 parisc: unaligned: Include linux/sysctl.h for unaligned_enabled Fix sparse warning that unaligned_enabled wasn't declared. Signed-off-by: Helge Deller commit 547259580dfa9a5d345dd1b46fd5e9977654c1cc Author: Helge Deller Date: Thu Aug 10 19:56:19 2023 +0200 parisc: Move proc_mckinley_root and proc_runway_root to sba_iommu Clean up the procfs root entries for gsc, runway, and mckinley busses. Signed-off-by: Helge Deller commit f55484fd7be923b740e8e1fc304070ba53675cb4 Author: David Hildenbrand Date: Thu Jul 13 16:55:51 2023 +0200 virtio-mem: check if the config changed before fake offlining memory If we repeatedly fail to fake offline memory to unplug it, we won't be sending any unplug requests to the device. However, we only check if the config changed when sending such (un)plug requests. We could end up trying for a long time to unplug memory, even though the config changed already and we're not supposed to unplug memory anymore. For example, the hypervisor might detect a low-memory situation while unplugging memory and decide to replug some memory. Continuing trying to unplug memory in that case can be problematic. So let's check on a more regular basis. Signed-off-by: David Hildenbrand Message-Id: <20230713145551.2824980-5-david@redhat.com> Signed-off-by: Michael S. Tsirkin commit a31648fd4f96fbe0a4d0aeb16b57a2405c6943c0 Author: David Hildenbrand Date: Thu Jul 13 16:55:50 2023 +0200 virtio-mem: keep retrying on offline_and_remove_memory() errors in Sub Block Mode (SBM) In case offline_and_remove_memory() fails in SBM, we leave a completely unplugged Linux memory block stick around until we try plugging memory again. We won't try removing that memory block again. offline_and_remove_memory() may, for example, fail if we're racing with another alloc_contig_range() user, if allocating temporary memory fails, or if some memory notifier rejected the offlining request. Let's handle that case better, by simple retrying to offline and remove such memory. Tested using CONFIG_MEMORY_NOTIFIER_ERROR_INJECT. Signed-off-by: David Hildenbrand Message-Id: <20230713145551.2824980-4-david@redhat.com> Signed-off-by: Michael S. Tsirkin commit ddf409851461f515cc32974714b73efe2e012bde Author: David Hildenbrand Date: Thu Jul 13 16:55:49 2023 +0200 virtio-mem: convert most offline_and_remove_memory() errors to -EBUSY Just like we do with alloc_contig_range(), let's convert all unknown errors to -EBUSY, but WARN so we can look into the issue. For example, offline_pages() could fail with -EINTR, which would be unexpected in our case. Signed-off-by: David Hildenbrand Message-Id: <20230713145551.2824980-3-david@redhat.com> Signed-off-by: Michael S. Tsirkin commit f504e15b94eb4e5b47f8715da59c0207f68dffe1 Author: David Hildenbrand Date: Thu Jul 13 16:55:48 2023 +0200 virtio-mem: remove unsafe unplug in Big Block Mode (BBM) When "unsafe unplug" is enabled, we don't fake-offline all memory ahead of actual memory offlining using alloc_contig_range(). Instead, we rely on offline_pages() to also perform actual page migration, which might fail or take a very long time. In that case, it's possible to easily run into endless loops that cannot be aborted anymore (as offlining is triggered by a workqueue then): For example, a single (accidentally) permanently unmovable page in ZONE_MOVABLE results in an endless loop. For ZONE_NORMAL, races between isolating the pageblock (and checking for unmovable pages) and concurrent page allocation are possible and similarly result in endless loops. The idea of the unsafe unplug mode was to make it possible to more reliably unplug large memory blocks. However, (a) we really should be tackling that differently, by extending the alloc_contig_range()-based mechanism; and (b) this mode is not the default and as far as I know, it's unused either way. So let's simply get rid of it. Signed-off-by: David Hildenbrand Message-Id: <20230713145551.2824980-2-david@redhat.com> Signed-off-by: Michael S. Tsirkin commit 8efc365b20dc9a5b0c8fd0e8a195690bf21cd8be Author: Shannon Nelson Date: Mon Jul 10 21:24:37 2023 -0700 pds_vdpa: fix up debugfs feature bit printing Make clearer in debugfs output the difference between the hw feature bits, the features supported through the driver, and the features that have been negotiated. Signed-off-by: Shannon Nelson Message-Id: <20230711042437.69381-6-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit c0a6c5cbf1a9e49357e942ed393da08a55808a49 Author: Allen Hubbe Date: Mon Jul 10 21:24:36 2023 -0700 pds_vdpa: alloc irq vectors on DRIVER_OK We were allocating irq vectors at the time the aux dev was probed, but that is before the PCI VF is assigned to a separate iommu domain by vhost_vdpa. Because vhost_vdpa later changes the iommu domain the interrupts do not work. Instead, we can allocate the irq vectors later when we see DRIVER_OK and know that the reassignment of the PCI VF to an iommu domain has already happened. Fixes: 151cc834f3dd ("pds_vdpa: add support for vdpa and vdpamgmt interfaces") Signed-off-by: Allen Hubbe Signed-off-by: Shannon Nelson Acked-by: Jason Wang Message-Id: <20230711042437.69381-5-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin commit ed88863040daad18d3f9b12f7c9c1c3da3731e1f Author: Shannon Nelson Date: Mon Jul 10 21:24:35 2023 -0700 pds_vdpa: clean and reset vqs entries Make sure that we initialize the vqs[] entries the same way both for initial setup and after a vq reset. Fixes: 151cc834f3dd ("pds_vdpa: add support for vdpa and vdpamgmt interfaces") Signed-off-by: Shannon Nelson Message-Id: <20230711042437.69381-4-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit abdf31bd91120035172dc58e2e87064a72e9e087 Author: Shannon Nelson Date: Mon Jul 10 21:24:34 2023 -0700 pds_vdpa: always allow offering VIRTIO_NET_F_MAC Our driver sets a mac if the HW is 00:..:00 so we need to be sure to advertise VIRTIO_NET_F_MAC even if the HW doesn't. We also need to be sure that virtio_net sees the VIRTIO_NET_F_MAC and doesn't rewrite the mac address that a user may have set with the vdpa utility. After reading the hw_feature bits, add the VIRTIO_NET_F_MAC to the driver's supported_features and use that for reporting what is available. If the HW is not advertising it, be sure to strip the VIRTIO_NET_F_MAC before finishing the feature negotiation. If the user specifies a device_features bitpattern in the vdpa utility without the VIRTIO_NET_F_MAC set, then don't set the mac. Fixes: 151cc834f3dd ("pds_vdpa: add support for vdpa and vdpamgmt interfaces") Signed-off-by: Shannon Nelson Message-Id: <20230711042437.69381-3-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 0cd2c13b1c15dbbdf1e2ae5b7160537f97df06b5 Author: Allen Hubbe Date: Mon Jul 10 21:24:33 2023 -0700 pds_vdpa: reset to vdpa specified mac When the vdpa device is reset, also reinitialize it with the mac address that was assigned when the device was added. Fixes: 151cc834f3dd ("pds_vdpa: add support for vdpa and vdpamgmt interfaces") Signed-off-by: Allen Hubbe Signed-off-by: Shannon Nelson Message-Id: <20230711042437.69381-2-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 2c507ce90e02cd78d00fd4b0fe26c8641873c13f Author: Hawkins Jiawei Date: Thu Aug 10 19:04:05 2023 +0800 virtio-net: Zero max_tx_vq field for VIRTIO_NET_CTRL_MQ_HASH_CONFIG case Kernel uses `struct virtio_net_ctrl_rss` to save command-specific-data for both the VIRTIO_NET_CTRL_MQ_HASH_CONFIG and VIRTIO_NET_CTRL_MQ_RSS_CONFIG commands. According to the VirtIO standard, "Field reserved MUST contain zeroes. It is defined to make the structure to match the layout of virtio_net_rss_config structure, defined in 5.1.6.5.7.". Yet for the VIRTIO_NET_CTRL_MQ_HASH_CONFIG command case, the `max_tx_vq` field in struct virtio_net_ctrl_rss, which corresponds to the `reserved` field in struct virtio_net_hash_config, is not zeroed, thereby violating the VirtIO standard. This patch solves this problem by zeroing this field in virtnet_init_default_rss(). Cc: Andrew Melnychenko Cc: stable@vger.kernel.org Fixes: c7114b1249fa ("drivers/net/virtio_net: Added basic RSS support.") Signed-off-by: Hawkins Jiawei Acked-by: Jason Wang Acked-by: Eugenio Pérez Acked-by: Michael S. Tsirkin Message-Id: <20230810110405.25558-1-yin31149@gmail.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo Acked-by: Jason Wang commit 25aa0bebba72b318e71fe205bfd1236550cc9534 Merge: 30813656c6b82 5e3d20617b055 Author: Linus Torvalds Date: Thu Aug 10 12:37:24 2023 -0700 Merge tag 'net-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter, wireless and bpf. Still trending up in size but the good news is that the "current" regressions are resolved, AFAIK. We're getting weirdly many fixes for Wake-on-LAN and suspend/resume handling on embedded this week (most not merged yet), not sure why. But those are all for older bugs. Current release - regressions: - tls: set MSG_SPLICE_PAGES consistently when handing encrypted data over to TCP Current release - new code bugs: - eth: mlx5: correct IDs on VFs internal to the device (IPU) Previous releases - regressions: - phy: at803x: fix WoL support / reporting on AR8032 - bonding: fix incorrect deletion of ETH_P_8021AD protocol VID from slaves, leading to BUG_ON() - tun: prevent tun_build_skb() from exceeding the packet size limit - wifi: rtw89: fix 8852AE disconnection caused by RX full flags - eth/PCI: enetc: fix probing after 6fffbc7ae137 ("PCI: Honor firmware's device disabled status"), keep PCI devices around even if they are disabled / not going to be probed to be able to apply quirks on them - eth: prestera: fix handling IPv4 routes with nexthop IDs Previous releases - always broken: - netfilter: re-work garbage collection to avoid races between user-facing API and timeouts - tunnels: fix generating ipv4 PMTU error on non-linear skbs - nexthop: fix infinite nexthop bucket dump when using maximum nexthop ID - wifi: nl80211: fix integer overflow in nl80211_parse_mbssid_elems() Misc: - unix: use consistent error code in SO_PEERPIDFD - ipv6: adjust ndisc_is_useropt() to include PREFIX_INFO, in prep for upcoming IETF RFC" * tag 'net-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (94 commits) net: hns3: fix strscpy causing content truncation issue net: tls: set MSG_SPLICE_PAGES consistently ibmvnic: Ensure login failure recovery is safe from other resets ibmvnic: Do partial reset on login failure ibmvnic: Handle DMA unmapping of login buffs in release functions ibmvnic: Unmap DMA login rsp buffer on send login fail ibmvnic: Enforce stronger sanity checks on login response net: mana: Fix MANA VF unload when hardware is unresponsive netfilter: nf_tables: remove busy mark and gc batch API netfilter: nft_set_hash: mark set element as dead when deleting from packet path netfilter: nf_tables: adapt set backend to use GC transaction API netfilter: nf_tables: GC transaction API to avoid race with control plane selftests/bpf: Add sockmap test for redirecting partial skb data selftests/bpf: fix a CI failure caused by vsock sockmap test bpf, sockmap: Fix bug that strp_done cannot be called bpf, sockmap: Fix map type error in sock_map_del_link xsk: fix refcount underflow in error path ipv6: adjust ndisc_is_useropt() to also return true for PIO selftests: forwarding: bridge_mdb: Make test more robust selftests: forwarding: bridge_mdb_max: Fix failing test with old libnet ... commit 64b632654b97319b253c2c902fe4c11349aaa70f Author: Kashyap Desai Date: Wed Aug 9 21:44:37 2023 -0700 RDMA/bnxt_re: Initialize dpi_tbl_lock mutex Fix the missing dpi_tbl_lock mutex initialization. Fixes: 0ac20faf5d83 ("RDMA/bnxt_re: Reorg the bar mapping") Link: https://lore.kernel.org/r/1691642677-21369-4-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 5ac8480ae4d01f0ca5dfd561884424046df2478a Author: Kalesh AP Date: Wed Aug 9 21:44:36 2023 -0700 RDMA/bnxt_re: Fix error handling in probe failure path During bnxt_re_dev_init(), when bnxt_re_setup_chip_ctx() fails unregister with L2 first before bailing out probe. Fixes: ae8637e13185 ("RDMA/bnxt_re: Add chip context to identify 57500 series") Link: https://lore.kernel.org/r/1691642677-21369-3-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 5363fc488da579923edf6a2fdca3d3b651dd800b Author: Selvin Xavier Date: Wed Aug 9 21:44:35 2023 -0700 RDMA/bnxt_re: Properly order ib_device_unalloc() to avoid UAF ib_dealloc_device() should be called only after device cleanup. Fix the dealloc sequence. Fixes: 6d758147c7b8 ("RDMA/bnxt_re: Use auxiliary driver interface") Link: https://lore.kernel.org/r/1691642677-21369-2-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 810b0cc1c28a9b8d055dd8f7d85975e3cf9f4430 Author: Dragos Tatulea Date: Thu Aug 3 18:26:33 2023 +0300 vdpa/mlx5: Fix crash on shutdown for when no ndev exists The ndev was accessed on shutdown without a check if it actually exists. This triggered the crash pasted below. Instead of doing the ndev check, delete the shutdown handler altogether. The irqs will be released at the parent VF level (mlx5_core). BUG: kernel NULL pointer dereference, address: 0000000000000300 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] SMP CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 6.5.0-rc2_for_upstream_min_debug_2023_07_17_15_05 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:mlx5v_shutdown+0xe/0x50 [mlx5_vdpa] RSP: 0018:ffff8881003bfdc0 EFLAGS: 00010286 RAX: ffff888103befba0 RBX: ffff888109d28008 RCX: 0000000000000017 RDX: 0000000000000001 RSI: 0000000000000212 RDI: ffff888109d28000 RBP: 0000000000000000 R08: 0000000d3a3a3882 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000000 R12: ffff888109d28000 R13: ffff888109d28080 R14: 00000000fee1dead R15: 0000000000000000 FS: 00007f4969e0be40(0000) GS:ffff88852c800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000300 CR3: 00000001051cd006 CR4: 0000000000370eb0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? __die+0x20/0x60 ? page_fault_oops+0x14c/0x3c0 ? exc_page_fault+0x75/0x140 ? asm_exc_page_fault+0x22/0x30 ? mlx5v_shutdown+0xe/0x50 [mlx5_vdpa] device_shutdown+0x13e/0x1e0 kernel_restart+0x36/0x90 __do_sys_reboot+0x141/0x210 ? vfs_writev+0xcd/0x140 ? handle_mm_fault+0x161/0x260 ? do_writev+0x6b/0x110 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f496990fb56 RSP: 002b:00007fffc7bdde88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a9 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f496990fb56 RDX: 0000000001234567 RSI: 0000000028121969 RDI: fffffffffee1dead RBP: 00007fffc7bde1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 00007fffc7bddf10 R14: 0000000000000000 R15: 00007fffc7bde2b8 CR2: 0000000000000300 ---[ end trace 0000000000000000 ]--- Fixes: bc9a2b3e686e ("vdpa/mlx5: Support interrupt bypassing") Signed-off-by: Dragos Tatulea Message-Id: <20230803152648.199297-1-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin commit ad03a0f44cdb97b46e5c84ed353dac9b8ae2c276 Author: Eugenio Pérez Date: Wed Aug 2 20:12:20 2023 +0300 vdpa/mlx5: Delete control vq iotlb in destroy_mr only when necessary mlx5_vdpa_destroy_mr can be called from .set_map with data ASID after the control virtqueue ASID iotlb has been populated. The control vq iotlb must not be cleared, since it will not be populated again. So call the ASID aware destroy function which makes sure that the right vq resource is destroyed. Fixes: 8fcd20c30704 ("vdpa/mlx5: Support different address spaces for control and data") Signed-off-by: Eugenio Pérez Reviewed-by: Gal Pressman Message-Id: <20230802171231.11001-5-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 9ee811009ad8f87982b69e61d07447d12233ad01 Author: Dragos Tatulea Date: Wed Aug 2 20:12:18 2023 +0300 vdpa/mlx5: Fix mr->initialized semantics The mr->initialized flag is shared between the control vq and data vq part of the mr init/uninit. But if the control vq and data vq get placed in different ASIDs, it can happen that initializing the control vq will prevent the data vq mr from being initialized. This patch consolidates the control and data vq init parts into their own init functions. The mr->initialized will now be used for the data vq only. The control vq currently doesn't need a flag. The uninitializing part is also taken care of: mlx5_vdpa_destroy_mr got split into data and control vq functions which are now also ASID aware. Fixes: 8fcd20c30704 ("vdpa/mlx5: Support different address spaces for control and data") Signed-off-by: Dragos Tatulea Reviewed-by: Eugenio Pérez Reviewed-by: Gal Pressman Message-Id: <20230802171231.11001-3-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 3fe024193340b225d1fd410d78c495434a9d68e0 Author: Dragos Tatulea Date: Thu Jul 27 20:23:46 2023 +0300 vdpa/mlx5: Correct default number of queues when MQ is on The standard specifies that the initial number of queues is the default, which is 1 (1 tx, 1 rx). Signed-off-by: Dragos Tatulea Reviewed-by: Eugenio Pérez Message-Id: <20230727172354.68243-2-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Tested-by: Lei Yang commit df9557046440b0a62250fee3169a8f6a139f55a6 Author: Gal Pressman Date: Wed Jul 26 22:10:07 2023 +0300 virtio-vdpa: Fix cpumask memory leak in virtio_vdpa_find_vqs() Free the cpumask allocated by create_affinity_masks() before returning from the function. Fixes: 3dad56823b53 ("virtio-vdpa: Support interrupt affinity spreading mechanism") Signed-off-by: Gal Pressman Reviewed-by: Dragos Tatulea Message-Id: <20230726191036.14324-1-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Xie Yongji commit 7ca26efb09a1543fddb29308ea3b63b66cb5d3ee Author: Maxime Coquelin Date: Wed Jul 5 13:45:05 2023 +0200 vduse: Use proper spinlock for IRQ injection The IRQ injection work used spin_lock_irq() to protect the scheduling of the softirq, but spin_lock_bh() should be used. With spin_lock_irq(), we noticed delay of more than 6 seconds between the time a NAPI polling work is scheduled and the time it is executed. Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Cc: xieyongji@bytedance.com Suggested-by: Jason Wang Signed-off-by: Maxime Coquelin Message-Id: <20230705114505.63274-1-maxime.coquelin@redhat.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Xie Yongji commit f46c1e1620c6bbc9aad5693082efd1b80822e97c Author: Dragos Tatulea Date: Thu Jul 27 20:57:54 2023 +0300 vdpa: Enable strict validation for netlinks ops The previous patches added the missing nla policies that were required for validation to work. Now strict validation on netlink ops can be enabled. This patch does it. Signed-off-by: Dragos Tatulea Cc: stable@vger.kernel.org Message-Id: <20230727175757.73988-9-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin commit 5d6ba607d6cb5c58a4ddf33381e18c83dbb4098f Author: Lin Ma Date: Thu Jul 27 20:57:52 2023 +0300 vdpa: Add max vqp attr to vdpa_nl_policy for nlattr length check The vdpa_nl_policy structure is used to validate the nlattr when parsing the incoming nlmsg. It will ensure the attribute being described produces a valid nlattr pointer in info->attrs before entering into each handler in vdpa_nl_ops. That is to say, the missing part in vdpa_nl_policy may lead to illegal nlattr after parsing, which could lead to OOB read just like CVE-2023-3773. This patch adds the missing nla_policy for vdpa max vqp attr to avoid such bugs. Fixes: ad69dd0bf26b ("vdpa: Introduce query of device config layout") Signed-off-by: Lin Ma Cc: stable@vger.kernel.org Message-Id: <20230727175757.73988-7-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin commit b3003e1b54e057f5f3124e437b80c3bef26ed3fe Author: Lin Ma Date: Thu Jul 27 20:57:50 2023 +0300 vdpa: Add queue index attr to vdpa_nl_policy for nlattr length check The vdpa_nl_policy structure is used to validate the nlattr when parsing the incoming nlmsg. It will ensure the attribute being described produces a valid nlattr pointer in info->attrs before entering into each handler in vdpa_nl_ops. That is to say, the missing part in vdpa_nl_policy may lead to illegal nlattr after parsing, which could lead to OOB read just like CVE-2023-3773. This patch adds the missing nla_policy for vdpa queue index attr to avoid such bugs. Fixes: 13b00b135665 ("vdpa: Add support for querying vendor statistics") Signed-off-by: Lin Ma Cc: stable@vger.kernelorg Message-Id: <20230727175757.73988-5-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin commit 79c8651587504ba263d2fd67fd4406240fb21f69 Author: Lin Ma Date: Thu Jul 27 20:57:48 2023 +0300 vdpa: Add features attr to vdpa_nl_policy for nlattr length check The vdpa_nl_policy structure is used to validate the nlattr when parsing the incoming nlmsg. It will ensure the attribute being described produces a valid nlattr pointer in info->attrs before entering into each handler in vdpa_nl_ops. That is to say, the missing part in vdpa_nl_policy may lead to illegal nlattr after parsing, which could lead to OOB read just like CVE-2023-3773. This patch adds the missing nla_policy for vdpa features attr to avoid such bugs. Fixes: 90fea5a800c3 ("vdpa: device feature provisioning") Signed-off-by: Lin Ma Cc: stable@vger.kernel.org Message-Id: <20230727175757.73988-3-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin commit 13f3efaca024e16ccfab0e8b2cf29d66489d8d54 Author: Feng Liu Date: Wed Jul 19 11:45:50 2023 -0400 virtio-pci: Fix legacy device flag setting error in probe The 'is_legacy' flag is used to differentiate between legacy vs modern device. Currently, it is based on the value of vp_dev->ldev.ioaddr. However, due to the shared memory of the union between struct virtio_pci_legacy_device and struct virtio_pci_modern_device, when virtio_pci_modern_probe modifies the content of struct virtio_pci_modern_device, it affects the content of struct virtio_pci_legacy_device, and ldev.ioaddr is no longer zero, causing the 'is_legacy' flag to be set as true. To resolve issue, when legacy device is probed, mark 'is_legacy' as true, when modern device is probed, keep 'is_legacy' as false. Fixes: 4f0fc22534e3 ("virtio_pci: Optimize virtio_pci_device structure size") Signed-off-by: Feng Liu Reviewed-by: Parav Pandit Reviewed-by: Jiri Pirko Message-Id: <20230719154550.79536-1-feliu@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo Acked-by: Jason Wang commit 8d4bdf11f096e5b343ee0f9aaa8c262dc16d2e1e Author: Mike Christie Date: Sat Jul 15 09:20:27 2023 -0500 MAINTAINERS: add vhost-scsi entry and myself as a co-maintainer I've been doing a lot of the development on vhost-scsi the last couple of years, so per Michael T's suggestion this adds me as co-maintainer. Signed-off-by: Mike Christie Message-Id: <20230715142027.5572-1-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Acked-by: Stefano Garzarella Acked-by: Stefan Hajnoczi commit c5ace19efb0ac884a9a417e2a1499ce9849bdaa5 Author: Mike Christie Date: Sun Jul 9 15:28:59 2023 -0500 vhost-scsi: Rename vhost_scsi_iov_to_sgl Rename vhost_scsi_iov_to_sgl to vhost_scsi_map_iov_to_sgl so it matches matches the naming style used for vhost_scsi_copy_iov_to_sgl. Signed-off-by: Mike Christie Message-Id: <20230709202859.138387-3-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin Acked-by: Stefan Hajnoczi commit 5ced58bfa132c8ba0f9c893eb621595a84cfee12 Author: Mike Christie Date: Sun Jul 9 15:28:58 2023 -0500 vhost-scsi: Fix alignment handling with windows The linux block layer requires bios/requests to have lengths with a 512 byte alignment. Some drivers/layers like dm-crypt and the directi IO code will test for it and just fail. Other drivers like SCSI just assume the requirement is met and will end up in infinte retry loops. The problem for drivers like SCSI is that it uses functions like blk_rq_cur_sectors and blk_rq_sectors which divide the request's length by 512. If there's lefovers then it just gets dropped. But other code in the block/scsi layer may use blk_rq_bytes/blk_rq_cur_bytes and end up thinking there is still data left and try to retry the cmd. We can then end up getting stuck in retry loops where part of the block/scsi thinks there is data left, but other parts think we want to do IOs of zero length. Linux will always check for alignment, but windows will not. When vhost-scsi then translates the iovec it gets from a windows guest to a scatterlist, we can end up with sg items where the sg->length is not divisible by 512 due to the misaligned offset: sg[0].offset = 255; sg[0].length = 3841; sg... sg[N].offset = 0; sg[N].length = 255; When the lio backends then convert the SG to bios or other iovecs, we end up sending them with the same misaligned values and can hit the issues above. This just has us drop down to allocating a temp page and copying the data when we detect a misaligned buffer and the IO is large enough that it will get split into multiple bad IOs. Signed-off-by: Mike Christie Message-Id: <20230709202859.138387-2-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin Acked-by: Stefan Hajnoczi commit 9ad1a29cb0991e3145996cdce691525e8ac65db7 Author: Shannon Nelson Date: Thu Jul 6 16:17:18 2023 -0700 pds_vdpa: protect Makefile from unconfigured debugfs debugfs.h protects itself from an undefined DEBUG_FS, so it is not necessary to check it in the driver code or the Makefile. The driver code had been updated for this, but the Makefile had missed the update. Link: https://lore.kernel.org/linux-next/fec68c3c-8249-7af4-5390-0495386a76f9@infradead.org/ Fixes: a16291b5bcbb ("pds_vdpa: Add new vDPA driver for AMD/Pensando DSC") Signed-off-by: Shannon Nelson Message-Id: <20230706231718.54198-1-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Acked-by: Jason Wang commit 55c91fedd03d7b9cf0c5199b2eb12b9b8e95281a Author: Wolfram Sang Date: Thu Jun 29 14:05:26 2023 +0200 virtio-mmio: don't break lifecycle of vm_dev vm_dev has a separate lifecycle because it has a 'struct device' embedded. Thus, having a release callback for it is correct. Allocating the vm_dev struct with devres totally breaks this protection, though. Instead of waiting for the vm_dev release callback, the memory is freed when the platform_device is removed. Resulting in a use-after-free when finally the callback is to be called. To easily see the problem, compile the kernel with CONFIG_DEBUG_KOBJECT_RELEASE and unbind with sysfs. The fix is easy, don't use devres in this case. Found during my research about object lifetime problems. Fixes: 7eb781b1bbb7 ("virtio_mmio: add cleanup for virtio_mmio_probe") Signed-off-by: Wolfram Sang Message-Id: <20230629120526.7184-1-wsa+renesas@sang-engineering.com> Signed-off-by: Michael S. Tsirkin commit 5e3d20617b055e725e785e0058426368269949f3 Author: Hao Chen Date: Wed Aug 9 10:09:02 2023 +0800 net: hns3: fix strscpy causing content truncation issue hns3_dbg_fill_content()/hclge_dbg_fill_content() is aim to integrate some items to a string for content, and we add '\n' and '\0' in the last two bytes of content. strscpy() will add '\0' in the last byte of destination buffer(one of items), it result in finishing content print ahead of schedule and some dump content truncation. One Error log shows as below: cat mac_list/uc UC MAC_LIST: Expected: UC MAC_LIST: FUNC_ID MAC_ADDR STATE pf 00:2b:19:05:03:00 ACTIVE The destination buffer is length-bounded and not required to be NUL-terminated, so just change strscpy() to memcpy() to fix it. Fixes: 1cf3d5567f27 ("net: hns3: fix strncpy() not using dest-buf length as length issue") Signed-off-by: Hao Chen Signed-off-by: Jijie Shao Link: https://lore.kernel.org/r/20230809020902.1941471-1-shaojijie@huawei.com Signed-off-by: Jakub Kicinski commit 6b486676b41c369fe822fe65771ffda7eeb3ea6f Author: Jakub Kicinski Date: Tue Aug 8 11:09:17 2023 -0700 net: tls: set MSG_SPLICE_PAGES consistently We used to change the flags for the last segment, because non-last segments had the MSG_SENDPAGE_NOTLAST flag set. That flag is no longer a thing so remove the setting. Since flags most likely don't have MSG_SPLICE_PAGES set this avoids passing parts of the sg as splice and parts as non-splice. Before commit under Fixes we'd have called tcp_sendpage() which would add the MSG_SPLICE_PAGES. Why this leads to trouble remains unclear but Tariq reports hitting the WARN_ON(!sendpage_ok()) due to page refcount of 0. Fixes: e117dcfd646e ("tls: Inline do_tcp_sendpages()") Reported-by: Tariq Toukan Link: https://lore.kernel.org/all/4c49176f-147a-4283-f1b1-32aac7b4b996@gmail.com/ Tested-by: Tariq Toukan Link: https://lore.kernel.org/r/20230808180917.1243540-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 30813656c6b827947be024484d6da8b18e50c186 Merge: 374a7f47bf401 422dbc66b7702 Author: Linus Torvalds Date: Thu Aug 10 11:32:26 2023 -0700 Merge tag 'dmaengine-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine fixes from Vinod Koul: - HAS_IOMEM fixes for fsl edma and intel idma - return-value fix, interrupt vector setting and typo fix for xilinx xdma - email updates for codeaurora email domain move - correct pause status for pl330 driver - idxd clear flag on disable fix - function documentation fix for owl dma - potential un-allocated memory fix for mcf driver * tag 'dmaengine-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: dmaengine: xilinx: xdma: Fix typo dmaengine: xilinx: xdma: Fix interrupt vector setting dmaengine: owl-dma: Modify mismatched function name dmaengine: idxd: Clear PRS disable flag when disabling IDXD device dmaengine: pl330: Return DMA_PAUSED when transaction is paused dmaengine: qcom_hidma: Update codeaurora email domain dmaengine: mcf-edma: Fix a potential un-allocated memory access dmaengine: xilinx: xdma: Fix Judgment of the return value idmaengine: make FSL_EDMA and INTEL_IDMA64 depends on HAS_IOMEM commit 3e91b0ebd994635df2346353322ac51ce84ce6d8 Merge: 62d02fca8be59 a2dd0233cbc4d Author: Jakub Kicinski Date: Thu Aug 10 10:47:07 2023 -0700 Merge tag 'nf-23-08-10' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The existing attempt to resolve races between control plane and GC work is error prone, as reported by Bien Pham , some places forgot to call nft_set_elem_mark_busy(), leading to double-deactivation of elements. This series contains the following patches: 1) Do not skip expired elements during walk otherwise elements might never decrement the reference counter on data, leading to memleak. 2) Add a GC transaction API to replace the former attempt to deal with races between control plane and GC. GC worker sets on NFT_SET_ELEM_DEAD_BIT on elements and it creates a GC transaction to remove the expired elements, GC transaction could abort in case of interference with control plane and retried later (GC async). Set backends such as rbtree and pipapo also perform GC from control plane (GC sync), in such case, element deactivation and removal is safe because mutex is held then collected elements are released via call_rcu(). 3) Adapt existing set backends to use the GC transaction API. 4) Update rhash set backend to set on _DEAD bit to report deleted elements from datapath for GC. 5) Remove old GC batch API and the NFT_SET_ELEM_BUSY_BIT. * tag 'nf-23-08-10' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nf_tables: remove busy mark and gc batch API netfilter: nft_set_hash: mark set element as dead when deleting from packet path netfilter: nf_tables: adapt set backend to use GC transaction API netfilter: nf_tables: GC transaction API to avoid race with control plane netfilter: nf_tables: don't skip expired elements during walk ==================== Link: https://lore.kernel.org/r/20230810070830.24064-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 62d02fca8be59292703ba369b48b4c910f71d9a6 Merge: 6db541ae279bd b734f02c887d9 Author: Jakub Kicinski Date: Thu Aug 10 10:41:36 2023 -0700 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Martin KaFai Lau says: ==================== pull-request: bpf 2023-08-09 We've added 5 non-merge commits during the last 7 day(s) which contain a total of 6 files changed, 102 insertions(+), 8 deletions(-). The main changes are: 1) A bpf sockmap memleak fix and a fix in accessing the programs of a sockmap under the incorrect map type from Xu Kuohai. 2) A refcount underflow fix in xsk from Magnus Karlsson. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: selftests/bpf: Add sockmap test for redirecting partial skb data selftests/bpf: fix a CI failure caused by vsock sockmap test bpf, sockmap: Fix bug that strp_done cannot be called bpf, sockmap: Fix map type error in sock_map_del_link xsk: fix refcount underflow in error path ==================== Link: https://lore.kernel.org/r/20230810055303.120917-1-martin.lau@linux.dev Signed-off-by: Jakub Kicinski commit 6db541ae279bd4e76dbd939e5fbf298396166242 Author: Nick Child Date: Wed Aug 9 17:10:38 2023 -0500 ibmvnic: Ensure login failure recovery is safe from other resets If a login request fails, the recovery process should be protected against parallel resets. It is a known issue that freeing and registering CRQ's in quick succession can result in a failover CRQ from the VIOS. Processing a failover during login recovery is dangerous for two reasons: 1. This will result in two parallel initialization processes, this can cause serious issues during login. 2. It is possible that the failover CRQ is received but never executed. We get notified of a pending failover through a transport event CRQ. The reset is not performed until a INIT CRQ request is received. Previously, if CRQ init fails during login recovery, then the ibmvnic irq is freed and the login process returned error. If failover_pending is true (a transport event was received), then the ibmvnic device would never be able to process the reset since it cannot receive the CRQ_INIT request due to the irq being freed. This leaved the device in a inoperable state. Therefore, the login failure recovery process must be hardened against these possible issues. Possible failovers (due to quick CRQ free and init) must be avoided and any issues during re-initialization should be dealt with instead of being propagated up the stack. This logic is similar to that of ibmvnic_probe(). Fixes: dff515a3e71d ("ibmvnic: Harden device login requests") Signed-off-by: Nick Child Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230809221038.51296-5-nnac123@linux.ibm.com Signed-off-by: Jakub Kicinski commit 23cc5f667453ca7645a24c8d21bf84dbf61107b2 Author: Nick Child Date: Wed Aug 9 17:10:37 2023 -0500 ibmvnic: Do partial reset on login failure Perform a partial reset before sending a login request if any of the following are true: 1. If a previous request times out. This can be dangerous because the VIOS could still receive the old login request at any point after the timeout. Therefore, it is best to re-register the CRQ's and sub-CRQ's before retrying. 2. If the previous request returns an error that is not described in PAPR. PAPR provides procedures if the login returns with partial success or aborted return codes (section L.5.1) but other values do not have a defined procedure. Previously, these conditions just returned error from the login function rather than trying to resolve the issue. This can cause further issues since most callers of the login function are not prepared to handle an error when logging in. This improper cleanup can lead to the device being permanently DOWN'd. For example, if the VIOS believes that the device is already logged in then it will return INVALID_STATE (-7). If we never re-register CRQ's then it will always think that the device is already logged in. This leaves the device inoperable. The partial reset involves freeing the sub-CRQs, freeing the CRQ then registering and initializing a new CRQ and sub-CRQs. This essentially restarts all communication with VIOS to allow for a fresh login attempt that will be unhindered by any previous failed attempts. Fixes: dff515a3e71d ("ibmvnic: Harden device login requests") Signed-off-by: Nick Child Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230809221038.51296-4-nnac123@linux.ibm.com Signed-off-by: Jakub Kicinski commit d78a671eb8996af19d6311ecdee9790d2fa479f0 Author: Nick Child Date: Wed Aug 9 17:10:36 2023 -0500 ibmvnic: Handle DMA unmapping of login buffs in release functions Rather than leaving the DMA unmapping of the login buffers to the login response handler, move this work into the login release functions. Previously, these functions were only used for freeing the allocated buffers. This could lead to issues if there are more than one outstanding login buffer requests, which is possible if a login request times out. If a login request times out, then there is another call to send login. The send login function makes a call to the login buffer release function. In the past, this freed the buffers but did not DMA unmap. Therefore, the VIOS could still write to the old login (now freed) buffer. It is for this reason that it is a good idea to leave the DMA unmap call to the login buffers release function. Since the login buffer release functions now handle DMA unmapping, remove the duplicate DMA unmapping in handle_login_rsp(). Fixes: dff515a3e71d ("ibmvnic: Harden device login requests") Signed-off-by: Nick Child Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230809221038.51296-3-nnac123@linux.ibm.com Signed-off-by: Jakub Kicinski commit 411c565b4bc63e9584a8493882bd566e35a90588 Author: Nick Child Date: Wed Aug 9 17:10:35 2023 -0500 ibmvnic: Unmap DMA login rsp buffer on send login fail If the LOGIN CRQ fails to send then we must DMA unmap the response buffer. Previously, if the CRQ failed then the memory was freed without DMA unmapping. Fixes: c98d9cc4170d ("ibmvnic: send_login should check for crq errors") Signed-off-by: Nick Child Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230809221038.51296-2-nnac123@linux.ibm.com Signed-off-by: Jakub Kicinski commit db17ba719bceb52f0ae4ebca0e4c17d9a3bebf05 Author: Nick Child Date: Wed Aug 9 17:10:34 2023 -0500 ibmvnic: Enforce stronger sanity checks on login response Ensure that all offsets in a login response buffer are within the size of the allocated response buffer. Any offsets or lengths that surpass the allocation are likely the result of an incomplete response buffer. In these cases, a full reset is necessary. When attempting to login, the ibmvnic device will allocate a response buffer and pass a reference to the VIOS. The VIOS will then send the ibmvnic device a LOGIN_RSP CRQ to signal that the buffer has been filled with data. If the ibmvnic device does not get a response in 20 seconds, the old buffer is freed and a new login request is sent. With 2 outstanding requests, any LOGIN_RSP CRQ's could be for the older login request. If this is the case then the login response buffer (which is for the newer login request) could be incomplete and contain invalid data. Therefore, we must enforce strict sanity checks on the response buffer values. Testing has shown that the `off_rxadd_buff_size` value is filled in last by the VIOS and will be the smoking gun for these circumstances. Until VIOS can implement a mechanism for tracking outstanding response buffers and a method for mapping a LOGIN_RSP CRQ to a particular login response buffer, the best ibmvnic can do in this situation is perform a full reset. Fixes: dff515a3e71d ("ibmvnic: Harden device login requests") Signed-off-by: Nick Child Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230809221038.51296-1-nnac123@linux.ibm.com Signed-off-by: Jakub Kicinski commit a7dfeda6fdeccab4c7c3dce9a72c4262b9530c80 Author: Souradeep Chakrabarti Date: Wed Aug 9 03:22:05 2023 -0700 net: mana: Fix MANA VF unload when hardware is unresponsive When unloading the MANA driver, mana_dealloc_queues() waits for the MANA hardware to complete any inflight packets and set the pending send count to zero. But if the hardware has failed, mana_dealloc_queues() could wait forever. Fix this by adding a timeout to the wait. Set the timeout to 120 seconds, which is a somewhat arbitrary value that is more than long enough for functional hardware to complete any sends. Cc: stable@vger.kernel.org Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)") Signed-off-by: Souradeep Chakrabarti Link: https://lore.kernel.org/r/1691576525-24271-1-git-send-email-schakrabarti@linux.microsoft.com Signed-off-by: Jakub Kicinski commit a4c59c9adc5f6b2a6b0115e3c4dc1e5127c2a01b Author: Helge Deller Date: Thu Aug 10 19:12:16 2023 +0200 parisc: dma: Add prototype for pcxl_dma_start Signed-off-by: Helge Deller commit 388d5bdba3fd791f734cc6687309fe59fb3343bb Author: Helge Deller Date: Thu Aug 10 18:32:24 2023 +0200 parisc: parisc_ksyms: Include libgcc.h for libgcc prototypes Signed-off-by: Helge Deller commit 438e9230d60ed8771db5770c3c795f3272ef7aae Author: Helge Deller Date: Thu Aug 10 18:31:47 2023 +0200 parisc: ucmpdi2: Fix no previous prototype for '__ucmpdi2' warning Signed-off-by: Helge Deller commit eb3515dc99c7c85f4170b50838136b2a193f8012 Author: Arnd Bergmann Date: Wed Aug 9 15:05:00 2023 +0200 x86: Move gds_ucode_mitigated() declaration to header The declaration got placed in the .c file of the caller, but that causes a warning for the definition: arch/x86/kernel/cpu/bugs.c:682:6: error: no previous prototype for 'gds_ucode_mitigated' [-Werror=missing-prototypes] Move it to a header where both sides can observe it instead. Fixes: 81ac7e5d74174 ("KVM: Add GDS_NO support to KVM") Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Tested-by: Daniel Sneddon Cc: stable@kernel.org Link: https://lore.kernel.org/all/20230809130530.1913368-2-arnd%40kernel.org commit a57c27c7ad85c420b7de44c6ee56692d51709dda Author: Arnd Bergmann Date: Wed Aug 9 15:04:59 2023 +0200 x86/speculation: Add cpu_show_gds() prototype The newly added function has two definitions but no prototypes: drivers/base/cpu.c:605:16: error: no previous prototype for 'cpu_show_gds' [-Werror=missing-prototypes] Add a declaration next to the other ones for this file to avoid the warning. Fixes: 8974eb588283b ("x86/speculation: Add Gather Data Sampling mitigation") Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Tested-by: Daniel Sneddon Cc: stable@kernel.org Link: https://lore.kernel.org/all/20230809130530.1913368-1-arnd%40kernel.org commit 7e3811521dc3934e2ecae8458676fc4a1f62bf9f Author: Alexandre Ghiti Date: Tue Jul 25 15:22:46 2023 +0200 riscv: Implement flush_cache_vmap() The RISC-V kernel needs a sfence.vma after a page table modification: we used to rely on the vmalloc fault handling to emit an sfence.vma, but commit 7d3332be011e ("riscv: mm: Pre-allocate PGD entries for vmalloc/modules area") got rid of this path for 64-bit kernels, so now we need to explicitly emit a sfence.vma in flush_cache_vmap(). Note that we don't need to implement flush_cache_vunmap() as the generic code should emit a flush tlb after unmapping a vmalloc region. Fixes: 7d3332be011e ("riscv: mm: Pre-allocate PGD entries for vmalloc/modules area") Signed-off-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20230725132246.817726-1-alexghiti@rivosinc.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit d566bea4a638ff0ae824df804bc08818bace41a5 Author: Alexandre Ghiti Date: Tue Aug 8 15:07:09 2023 +0200 riscv: Do not allow vmap pud mappings for 3-level page table The vmalloc_fault() path was removed and to avoid syncing the vmalloc PGD mappings, they are now preallocated. But if the kernel can use a PUD mapping (which in sv39 is actually a PGD mapping) for large vmalloc allocation, it will free the current unused preallocated PGD mapping and install a new leaf one. Since there is no sync anymore, some page tables lack this new mapping and that triggers a panic. So only allow PUD mappings for sv48 and sv57. Fixes: 7d3332be011e ("riscv: mm: Pre-allocate PGD entries for vmalloc/modules area") Signed-off-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20230808130709.1502614-1-alexghiti@rivosinc.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit eed869aaf1305444434ad5a9a56abc45aacc0c40 Author: Helge Deller Date: Thu Aug 10 04:34:58 2023 +0200 parisc: firmware: Mark pdc_result buffers local This fixes a sparse warning which suggest to make those static. Signed-off-by: Helge Deller commit a07c03e8064026d55d1699d161c536cc437d58d6 Author: Helge Deller Date: Thu Aug 10 04:29:29 2023 +0200 parisc: firmware: Fix sparse context imbalance warnings Tell sparse about correct context for pdc_cpu_rendezvous_*lock() functions. Signed-off-by: Helge Deller commit dc54a52a8cd43cff4fbe8d761c98edeb857d3ad7 Author: Helge Deller Date: Thu Aug 10 04:07:01 2023 +0200 parisc: signal: Fix sparse incorrect type in assignment warning Signed-off-by: Helge Deller commit b873bde58578db2201b2f30ca708dcb0e35ff4b1 Author: Helge Deller Date: Thu Aug 10 03:55:47 2023 +0200 parisc: ioremap: Fix sparse warnings Fix sparse warning: incorrect type in assignment (different base types) expected unsigned long [usertype] addr got void *addr Signed-off-by: Helge Deller commit aa1bb8b6351a81b28b9e10ab3414c21ded7cf11d Author: Helge Deller Date: Thu Aug 10 03:31:18 2023 +0200 parisc: fault: Use C99 arrary initializers Sparse wants C99 array initializers. Signed-off-by: Helge Deller commit 56cf894effc2946f273f7bfc9a28f3741978156c Author: Yang Yingliang Date: Wed Aug 9 17:19:53 2023 +0800 parisc: pdt: Use PTR_ERR_OR_ZERO() to simplify code Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to simplify code. Signed-off-by: Yang Yingliang Signed-off-by: Helge Deller commit a0f4b7879f2e14986200747d1b545e5daac8c624 Author: Helge Deller Date: Wed Aug 9 09:21:58 2023 +0200 parisc: Fix lightweight spinlock checks to not break futexes The lightweight spinlock checks verify that a spinlock has either value 0 (spinlock locked) and that not any other bits than in __ARCH_SPIN_LOCK_UNLOCKED_VAL is set. This breaks the current LWS code, which writes the address of the lock into the lock word to unlock it, which was an optimization to save one assembler instruction. Fix it by making spinlock_types.h accessible for asm code, change the LWS spinlock-unlocking code to write __ARCH_SPIN_LOCK_UNLOCKED_VAL into the lock word, and add some missing lightweight spinlock checks to the LWS path. Finally, make the spinlock checks dependend on DEBUG_KERNEL. Noticed-by: John David Anglin Signed-off-by: Helge Deller Tested-by: John David Anglin Cc: stable@vger.kernel.org # v6.4+ Fixes: 15e64ef6520e ("parisc: Add lightweight spinlock checks") commit 92fb94b69c6accf1e49fff699640fa0ce03dc910 Author: Josef Bacik Date: Wed Aug 2 09:20:24 2023 -0400 btrfs: set cache_block_group_error if we find an error We set cache_block_group_error if btrfs_cache_block_group() returns an error, this is because we could end up not finding space to allocate and mistakenly return -ENOSPC, and which could then abort the transaction with the incorrect errno, and in the case of ENOSPC result in a WARN_ON() that will trip up tests like generic/475. However there's the case where multiple threads can be racing, one thread gets the proper error, and the other thread doesn't actually call btrfs_cache_block_group(), it instead sees ->cached == BTRFS_CACHE_ERROR. Again the result is the same, we fail to allocate our space and return -ENOSPC. Instead we need to set cache_block_group_error to -EIO in this case to make sure that if we do not make our allocation we get the appropriate error returned back to the caller. CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 6ebcd021c92b8e4b904552e4d87283032100796d Author: Qu Wenruo Date: Thu Aug 3 17:20:43 2023 +0800 btrfs: reject invalid reloc tree root keys with stack dump [BUG] Syzbot reported a crash that an ASSERT() got triggered inside prepare_to_merge(). That ASSERT() makes sure the reloc tree is properly pointed back by its subvolume tree. [CAUSE] After more debugging output, it turns out we had an invalid reloc tree: BTRFS error (device loop1): reloc tree mismatch, root 8 has no reloc root, expect reloc root key (-8, 132, 8) gen 17 Note the above root key is (TREE_RELOC_OBJECTID, ROOT_ITEM, QUOTA_TREE_OBJECTID), meaning it's a reloc tree for quota tree. But reloc trees can only exist for subvolumes, as for non-subvolume trees, we just COW the involved tree block, no need to create a reloc tree since those tree blocks won't be shared with other trees. Only subvolumes tree can share tree blocks with other trees (thus they have BTRFS_ROOT_SHAREABLE flag). Thus this new debug output proves my previous assumption that corrupted on-disk data can trigger that ASSERT(). [FIX] Besides the dedicated fix and the graceful exit, also let tree-checker to check such root keys, to make sure reloc trees can only exist for subvolumes. CC: stable@vger.kernel.org # 5.15+ Reported-by: syzbot+ae97a827ae1c3336bbb4@syzkaller.appspotmail.com Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 05d7ce504545f7874529701664c90814ca645c5d Author: Qu Wenruo Date: Thu Aug 3 17:20:42 2023 +0800 btrfs: exit gracefully if reloc roots don't match [BUG] Syzbot reported a crash that an ASSERT() got triggered inside prepare_to_merge(). [CAUSE] The root cause of the triggered ASSERT() is we can have a race between quota tree creation and relocation. This leads us to create a duplicated quota tree in the btrfs_read_fs_root() path, and since it's treated as fs tree, it would have ROOT_SHAREABLE flag, causing us to create a reloc tree for it. The bug itself is fixed by a dedicated patch for it, but this already taught us the ASSERT() is not something straightforward for developers. [ENHANCEMENT] Instead of using an ASSERT(), let's handle it gracefully and output extra info about the mismatch reloc roots to help debug. Also with the above ASSERT() removed, we can trigger ASSERT(0)s inside merge_reloc_roots() later. Also replace those ASSERT(0)s with WARN_ON()s. CC: stable@vger.kernel.org # 5.15+ Reported-by: syzbot+ae97a827ae1c3336bbb4@syzkaller.appspotmail.com Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 773e722a98e25caf96f91aced7070c1858250ba2 Author: Qu Wenruo Date: Thu Aug 3 17:20:41 2023 +0800 btrfs: avoid race between qgroup tree creation and relocation [BUG] Syzbot reported a weird ASSERT() triggered inside prepare_to_merge(). assertion failed: root->reloc_root == reloc_root, in fs/btrfs/relocation.c:1919 ------------[ cut here ]------------ kernel BUG at fs/btrfs/relocation.c:1919! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 9904 Comm: syz-executor.3 Not tainted 6.4.0-syzkaller-08881-g533925cb7604 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 RIP: 0010:prepare_to_merge+0xbb2/0xc40 fs/btrfs/relocation.c:1919 Code: fe e9 f5 (...) RSP: 0018:ffffc9000325f760 EFLAGS: 00010246 RAX: 000000000000004f RBX: ffff888075644030 RCX: 1481ccc522da5800 RDX: ffffc90005c09000 RSI: 00000000000364ca RDI: 00000000000364cb RBP: ffffc9000325f870 R08: ffffffff816f33ac R09: 1ffff9200064bea0 R10: dffffc0000000000 R11: fffff5200064bea1 R12: ffff888075644000 R13: ffff88803b166000 R14: ffff88803b166560 R15: ffff88803b166558 FS: 00007f4e305fd700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000056080679c000 CR3: 00000000193ad000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: relocate_block_group+0xa5d/0xcd0 fs/btrfs/relocation.c:3749 btrfs_relocate_block_group+0x7ab/0xd70 fs/btrfs/relocation.c:4087 btrfs_relocate_chunk+0x12c/0x3b0 fs/btrfs/volumes.c:3283 __btrfs_balance+0x1b06/0x2690 fs/btrfs/volumes.c:4018 btrfs_balance+0xbdb/0x1120 fs/btrfs/volumes.c:4402 btrfs_ioctl_balance+0x496/0x7c0 fs/btrfs/ioctl.c:3604 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f4e2f88c389 [CAUSE] With extra debugging, the offending reloc_root is for quota tree (rootid 8). Normally we should not use the reloc tree for quota root at all, as reloc trees are only for subvolume trees. But there is a race between quota enabling and relocation, this happens after commit 85724171b302 ("btrfs: fix the btrfs_get_global_root return value"). Before that commit, for quota and free space tree, we exit immediately if we cannot grab it from fs_info. But now we would try to read it from disk, just as if they are fs trees, this sets ROOT_SHAREABLE flags in such race: Thread A | Thread B ---------------------------------+------------------------------ btrfs_quota_enable() | | | btrfs_get_root_ref() | | |- btrfs_get_global_root() | | | Returned NULL | | |- btrfs_lookup_fs_root() | | | Returned NULL |- btrfs_create_tree() | | | Now quota root item is | | | inserted | |- btrfs_read_tree_root() | | | Got the newly inserted quota root | | |- btrfs_init_fs_root() | | | Set ROOT_SHAREABLE flag [FIX] Get back to the old behavior by returning PTR_ERR(-ENOENT) if the target objectid is not a subvolume tree or data reloc tree. Reported-and-tested-by: syzbot+ae97a827ae1c3336bbb4@syzkaller.appspotmail.com Fixes: 85724171b302 ("btrfs: fix the btrfs_get_global_root return value") Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 12b2d64e591652a2d97dd3afa2b062ca7a4ba352 Author: Christoph Hellwig Date: Mon Jul 24 06:26:55 2023 -0700 btrfs: properly clear end of the unreserved range in cow_file_range When the call to btrfs_reloc_clone_csums in cow_file_range returns an error, we jump to the out_unlock label with the extent_reserved variable set to false. The cleanup at the label will then call extent_clear_unlock_delalloc on the range from start to end. But we've already added cur_alloc_size to start before the jump, so there might no range be left from the newly incremented start to end. Move the check for 'start < end' so that it is reached by also for the !extent_reserved case. CC: stable@vger.kernel.org # 6.1+ Fixes: a315e68f6e8b ("Btrfs: fix invalid attempt to free reserved space on failure to cow range") Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5c25699871112853f231e52d51c576d5c759a020 Author: Christoph Hellwig Date: Mon Jul 24 06:26:54 2023 -0700 btrfs: don't wait for writeback on clean pages in extent_write_cache_pages __extent_writepage could have started on more pages than the one it was called for. This happens regularly for zoned file systems, and in theory could happen for compressed I/O if the worker thread was executed very quickly. For such pages extent_write_cache_pages waits for writeback to complete before moving on to the next page, which is highly inefficient as it blocks the flusher thread. Port over the PageDirty check that was added to write_cache_pages in commit 515f4a037fb ("mm: write_cache_pages optimise page cleaning") to fix this. CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit effa24f689ce0948f68c754991a445a8d697d3a8 Author: Christoph Hellwig Date: Mon Jul 24 06:26:53 2023 -0700 btrfs: don't stop integrity writeback too early extent_write_cache_pages stops writing pages as soon as nr_to_write hits zero. That is the right thing for opportunistic writeback, but incorrect for data integrity writeback, which needs to ensure that no dirty pages are left in the range. Thus only stop the writeback for WB_SYNC_NONE if nr_to_write hits 0. This is a port of write_cache_pages changes in commit 05fe478dd04e ("mm: write_cache_pages integrity fix"). Note that I've only trigger the problem with other changes to the btrfs writeback code, but this condition seems worthwhile fixing anyway. CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba [ updated comment ] Signed-off-by: David Sterba commit 56fec0051a69ace182ca3fba47be9c13038b4e3f Author: Hans de Goede Date: Thu Aug 10 11:00:11 2023 +0200 ACPI: resource: Add IRQ override quirk for PCSpecialist Elimina Pro 16 M The PCSpecialist Elimina Pro 16 M laptop model is a Zen laptop which needs to use the MADT IRQ settings override and which does not have an INT_SRC_OVR entry for IRQ 1 in its MADT. So this model needs a DMI quirk to enable the MADT IRQ settings override to fix its keyboard not working. Fixes: a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217394#c18 Cc: All applicable Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit fc1f91b9231a28fba333f931a031bf776bc6ef0e Author: Josef Bacik Date: Fri Jul 21 16:09:43 2023 -0400 btrfs: wait for actual caching progress during allocation Recently we've been having mysterious hangs while running generic/475 on the CI system. This turned out to be something like this: Task 1 dmsetup suspend --nolockfs -> __dm_suspend -> dm_wait_for_completion -> dm_wait_for_bios_completion -> Unable to complete because of IO's on a plug in Task 2 Task 2 wb_workfn -> wb_writeback -> blk_start_plug -> writeback_sb_inodes -> Infinite loop unable to make an allocation Task 3 cache_block_group ->read_extent_buffer_pages ->Waiting for IO to complete that can't be submitted because Task 1 suspended the DM device The problem here is that we need Task 2 to be scheduled completely for the blk plug to flush. Normally this would happen, we normally wait for the block group caching to finish (Task 3), and this schedule would result in the block plug flushing. However if there's enough free space available from the current caching to satisfy the allocation we won't actually wait for the caching to complete. This check however just checks that we have enough space, not that we can make the allocation. In this particular case we were trying to allocate 9MiB, and we had 10MiB of free space, but we didn't have 9MiB of contiguous space to allocate, and thus the allocation failed and we looped. We specifically don't cycle through the FFE loop until we stop finding cached block groups because we don't want to allocate new block groups just because we're caching, so we short circuit the normal loop once we hit LOOP_CACHING_WAIT and we found a caching block group. This is normally fine, except in this particular case where the caching thread can't make progress because the DM device has been suspended. Fix this by not only waiting for free space to >= the amount of space we want to allocate, but also that we make some progress in caching from the time we start waiting. This will keep us from busy looping when the caching is taking a while but still theoretically has enough space for us to allocate from, and fixes this particular case by forcing us to actually sleep and wait for forward progress, which will flush the plug. With this fix we're no longer hanging with generic/475. CC: stable@vger.kernel.org # 6.1+ Reviewed-by: Boris Burkov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 6524c798b727ffdb5c7eaed2f50e8e839997df8e Author: Borislav Petkov (AMD) Date: Thu Aug 10 13:22:29 2023 +0200 driver core: cpu: Make cpu_show_not_affected() static Fix a -Wmissing-prototypes warning and add the gather_data_sampling() stub macro call for real. Fixes: 0fddfe338210 ("driver core: cpu: Unify redundant silly stubs") Closes: https://lore.kernel.org/oe-kbuild-all/202308101956.oRj1ls7s-lkp@intel.com Reported-by: kernel test robot Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/202308101956.oRj1ls7s-lkp@intel.com commit cbe8ded48b939b9d55d2c5589ab56caa7b530709 Author: Nick Desaulniers Date: Wed Aug 9 09:40:26 2023 -0700 x86/srso: Fix build breakage with the LLVM linker The assertion added to verify the difference in bits set of the addresses of srso_untrain_ret_alias() and srso_safe_ret_alias() would fail to link in LLVM's ld.lld linker with the following error: ld.lld: error: ./arch/x86/kernel/vmlinux.lds:210: at least one side of the expression must be absolute ld.lld: error: ./arch/x86/kernel/vmlinux.lds:211: at least one side of the expression must be absolute Use ABSOLUTE to evaluate the expression referring to at least one of the symbols so that LLD can evaluate the linker script. Also, add linker version info to the comment about XOR being unsupported in either ld.bfd or ld.lld until somewhat recently. Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Closes: https://lore.kernel.org/llvm/CA+G9fYsdUeNu-gwbs0+T6XHi4hYYk=Y9725-wFhZ7gJMspLDRA@mail.gmail.com/ Reported-by: Nathan Chancellor Reported-by: Daniel Kolesa Reported-by: Naresh Kamboju Suggested-by: Sven Volkinsfeld Signed-off-by: Nick Desaulniers Signed-off-by: Borislav Petkov (AMD) Link: https://github.com/ClangBuiltLinux/linux/issues/1907 Link: https://lore.kernel.org/r/20230809-gds-v1-1-eaac90b0cbcc@google.com commit 09f9f37c324d90102e8574856ab168c34de1916d Author: Borislav Petkov (AMD) Date: Wed Aug 2 20:07:32 2023 +0200 Documentation/srso: Document IBPB aspect and fix formatting Add a note about the dependency of the User->User mitigation on the previous Spectre v2 IBPB selection. Make the layout moar pretty. Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230809102700.29449-4-bp@alien8.de commit 0fddfe338210aa018137c03030c581f5ea4be282 Author: Borislav Petkov (AMD) Date: Sat Jul 29 17:20:33 2023 +0200 driver core: cpu: Unify redundant silly stubs Make them all a weak function, aliasing to a single function which issues the "Not affected" string. No functional changes. Suggested-by: Linus Torvalds Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Greg Kroah-Hartman Reviewed-by: Nikolay Borisov Link: https://lore.kernel.org/r/20230809102700.29449-3-bp@alien8.de commit 9757300d2750ef76f139aa6f5f7eadd61a0de0d3 Author: Ninad Naik Date: Wed Aug 9 15:36:34 2023 +0530 pinctrl: qcom: Add intr_target_width field to support increased number of interrupt targets SA8775 and newer target have added support for an increased number of interrupt targets. To implement this change, the intr_target field, which is used to configure the interrupt target in the interrupt configuration register is increased from 3 bits to 4 bits. In accordance to these updates, a new intr_target_width member is introduced in msm_pingroup structure. This member stores the value of width of intr_target field in the interrupt configuration register. This value is used to dynamically calculate and generate mask for setting the intr_target field. By default, this mask is set to 3 bit wide, to ensure backward compatibility with the older targets. Fixes: 4b6b18559927 ("pinctrl: qcom: add the tlmm driver sa8775p platforms") Tested-by: Andrew Halaney # sa8775p-ride Signed-off-by: Ninad Naik Reviewed-by: Konrad Dybcio Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230809100634.3961-1-quic_ninanaik@quicinc.com Signed-off-by: Linus Walleij commit 182ac87070e26d32a01445cec7ca7afa07411468 Author: Borislav Petkov (AMD) Date: Sat Jul 29 16:53:02 2023 +0200 Documentation/hw-vuln: Unify filename specification in index Most of the index.rst files in Documentation/ refer to other rst files without their file extension in the name. Do that here too. No functional changes. Reported-by: Linus Torvalds Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230809102700.29449-2-bp@alien8.de commit 98c68ea0312ad629f6b05f9db762f468af805326 Author: Stefan Binding Date: Wed Aug 9 15:29:57 2023 +0100 ALSA: hda/realtek: Switch Dell Oasis models to use SPI All I2C Dell Oasis models using CS35L41 have been changed to use SPI. In addition, System 10280cc5 is no longer required. Fixes: de90f5165b1c ("ALSA: hda/realtek: Add support for DELL Oasis 13/14/16 laptops") Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20230809142957.675933-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit fb8cce69e5e56eedb35fc4d77b2f099860965859 Author: Stefan Binding Date: Wed Aug 9 15:29:56 2023 +0100 ALSA: hda/realtek: Add quirks for HP G11 Laptops These HP G11 laptops use Realtek HDA codec combined with 2xCS35L41 Amplifiers using SPI or I2C with External Boost. Laptop 103c8c26 has been removed as this has been replaced by this new series of laptops. Fixes: 3e10f6ca76c4 ("ALSA: hda/realtek: Add quirk for HP EliteBook G10 laptops") Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20230809142957.675933-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 07dd476f6116966cb2006e25fdcf48f0715115ff Author: Boris Brezillon Date: Mon Jul 24 13:26:10 2023 +0200 drm/shmem-helper: Reset vma->vm_ops before calling dma_buf_mmap() The dma-buf backend is supposed to provide its own vm_ops, but some implementation just have nothing special to do and leave vm_ops untouched, probably expecting this field to be zero initialized (this is the case with the system_heap implementation for instance). Let's reset vma->vm_ops to NULL to keep things working with these implementations. Fixes: 26d3ac3cb04d ("drm/shmem-helpers: Redirect mmap for imported dma-buf") Cc: Cc: Daniel Vetter Reported-by: Roman Stratiienko Signed-off-by: Boris Brezillon Tested-by: Roman Stratiienko Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230724112610.60974-1-boris.brezillon@collabora.com commit a2dd0233cbc4d8a0abb5f64487487ffc9265beb5 Author: Pablo Neira Ayuso Date: Wed Aug 9 15:00:36 2023 +0200 netfilter: nf_tables: remove busy mark and gc batch API Ditch it, it has been replace it by the GC transaction API and it has no clients anymore. Signed-off-by: Pablo Neira Ayuso commit c92db3030492b8ad1d0faace7a93bbcf53850d0c Author: Pablo Neira Ayuso Date: Wed Aug 9 15:00:06 2023 +0200 netfilter: nft_set_hash: mark set element as dead when deleting from packet path Set on the NFT_SET_ELEM_DEAD_BIT flag on this element, instead of performing element removal which might race with an ongoing transaction. Enable gc when dynamic flag is set on since dynset deletion requires garbage collection after this patch. Fixes: d0a8d877da97 ("netfilter: nft_dynset: support for element deletion") Signed-off-by: Pablo Neira Ayuso commit f6c383b8c31a93752a52697f8430a71dcbc46adf Author: Pablo Neira Ayuso Date: Wed Aug 9 14:54:23 2023 +0200 netfilter: nf_tables: adapt set backend to use GC transaction API Use the GC transaction API to replace the old and buggy gc API and the busy mark approach. No set elements are removed from async garbage collection anymore, instead the _DEAD bit is set on so the set element is not visible from lookup path anymore. Async GC enqueues transaction work that might be aborted and retried later. rbtree and pipapo set backends does not set on the _DEAD bit from the sync GC path since this runs in control plane path where mutex is held. In this case, set elements are deactivated, removed and then released via RCU callback, sync GC never fails. Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges") Fixes: 8d8540c4f5e0 ("netfilter: nft_set_rbtree: add timeout support") Fixes: 9d0982927e79 ("netfilter: nft_hash: add support for timeouts") Signed-off-by: Pablo Neira Ayuso commit 5f68718b34a531a556f2f50300ead2862278da26 Author: Pablo Neira Ayuso Date: Wed Aug 9 14:31:54 2023 +0200 netfilter: nf_tables: GC transaction API to avoid race with control plane The set types rhashtable and rbtree use a GC worker to reclaim memory. From system work queue, in periodic intervals, a scan of the table is done. The major caveat here is that the nft transaction mutex is not held. This causes a race between control plane and GC when they attempt to delete the same element. We cannot grab the netlink mutex from the work queue, because the control plane has to wait for the GC work queue in case the set is to be removed, so we get following deadlock: cpu 1 cpu2 GC work transaction comes in , lock nft mutex `acquire nft mutex // BLOCKS transaction asks to remove the set set destruction calls cancel_work_sync() cancel_work_sync will now block forever, because it is waiting for the mutex the caller already owns. This patch adds a new API that deals with garbage collection in two steps: 1) Lockless GC of expired elements sets on the NFT_SET_ELEM_DEAD_BIT so they are not visible via lookup. Annotate current GC sequence in the GC transaction. Enqueue GC transaction work as soon as it is full. If ruleset is updated, then GC transaction is aborted and retried later. 2) GC work grabs the mutex. If GC sequence has changed then this GC transaction lost race with control plane, abort it as it contains stale references to objects and let GC try again later. If the ruleset is intact, then this GC transaction deactivates and removes the elements and it uses call_rcu() to destroy elements. Note that no elements are removed from GC lockless path, the _DEAD bit is set and pointers are collected. GC catchall does not remove the elements anymore too. There is a new set->dead flag that is set on to abort the GC transaction to deal with set->ops->destroy() path which removes the remaining elements in the set from commit_release, where no mutex is held. To deal with GC when mutex is held, which allows safe deactivate and removal, add sync GC API which releases the set element object via call_rcu(). This is used by rbtree and pipapo backends which also perform garbage collection from control plane path. Since element removal from sets can happen from control plane and element garbage collection/timeout, it is necessary to keep the set structure alive until all elements have been deactivated and destroyed. We cannot do a cancel_work_sync or flush_work in nft_set_destroy because its called with the transaction mutex held, but the aforementioned async work queue might be blocked on the very mutex that nft_set_destroy() callchain is sitting on. This gives us the choice of ABBA deadlock or UaF. To avoid both, add set->refs refcount_t member. The GC API can then increment the set refcount and release it once the elements have been free'd. Set backends are adapted to use the GC transaction API in a follow up patch entitled: ("netfilter: nf_tables: use gc transaction API in set backends") This is joint work with Florian Westphal. Fixes: cfed7e1b1f8e ("netfilter: nf_tables: add set garbage collection helpers") Signed-off-by: Pablo Neira Ayuso commit 374a7f47bf401441edff0a64465e61326bf70a82 Merge: b4f63b0f2d170 79ed288cef201 Author: Linus Torvalds Date: Wed Aug 9 21:12:56 2023 -0700 Merge tag '6.5-rc5-ksmbd-server' of git://git.samba.org/ksmbd Pull smb server fixes from Steve French: "Two ksmbd server fixes, both also for stable: - improve buffer validation when multiple EAs returned - missing check for command payload size" * tag '6.5-rc5-ksmbd-server' of git://git.samba.org/ksmbd: ksmbd: fix wrong next length validation of ea buffer in smb2_set_ea() ksmbd: validate command request size commit 56b930dcd88c2adc261410501c402c790980bdb5 Author: Aleksa Savic Date: Mon Aug 7 19:20:03 2023 +0200 hwmon: (aquacomputer_d5next) Add selective 200ms delay after sending ctrl report Add a 200ms delay after sending a ctrl report to Quadro, Octo, D5 Next and Aquaero to give them enough time to process the request and save the data to memory. Otherwise, under heavier userspace loads where multiple sysfs entries are usually set in quick succession, a new ctrl report could be requested from the device while it's still processing the previous one and fail with -EPIPE. The delay is only applied if two ctrl report operations are near each other in time. Reported by a user on Github [1] and tested by both of us. [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/issues/82 Fixes: 752b927951ea ("hwmon: (aquacomputer_d5next) Add support for Aquacomputer Octo") Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/20230807172004.456968-1-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck commit b4f63b0f2d170b9dfae0de3fd2981424873cce2b Merge: cacc6e22932f3 487ae3b42d104 Author: Linus Torvalds Date: Wed Aug 9 21:06:14 2023 -0700 Merge tag 'perf-tools-fixes-for-v6.5-3-2023-08-09' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Revert a patch that unconditionally resolved addresses to inlines in callchains, something that was done before when DWARF mode was asked for, but could as well be done when just frame pointers (the default) was selected. This enriches the callchains with inlines but the way to resolve it is gross right now, relying on addr2line, and even if we come up with an efficient way of processing all the associated DWARF info for a big file as vmlinux is, this has to be something people opt-in, as it will still result in overheads, so revert it until we get this done in a saner way. - Update the x86 msr-index.h header with the kernel original, no change in tooling output, just addresses a tools/perf build warning. - Resolve a regression where special "tool events", such as "duration_time" were being presented for all CPUs, when it only makes sense to show it for the workload, that is, just once. * tag 'perf-tools-fixes-for-v6.5-3-2023-08-09' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf stat: Don't display zero tool counts tools arch x86: Sync the msr-index.h copy with the kernel sources Revert "perf report: Append inlines to non-DWARF callchains" commit fe9da61ffccad80ae79fadad836971acf0d465bd Author: Damien Le Moal Date: Mon Aug 7 13:11:48 2023 +0900 zonefs: fix synchronous direct writes to sequential files Commit 16d7fd3cfa72 ("zonefs: use iomap for synchronous direct writes") changes zonefs code from a self-built zone append BIO to using iomap for synchronous direct writes. This change relies on iomap submit BIO callback to change the write BIO built by iomap to a zone append BIO. However, this change overlooked the fact that a write BIO may be very large as it is split when issued. The change from a regular write to a zone append operation for the built BIO can result in a block layer warning as zone append BIO are not allowed to be split. WARNING: CPU: 18 PID: 202210 at block/bio.c:1644 bio_split+0x288/0x350 Call Trace: ? __warn+0xc9/0x2b0 ? bio_split+0x288/0x350 ? report_bug+0x2e6/0x390 ? handle_bug+0x41/0x80 ? exc_invalid_op+0x13/0x40 ? asm_exc_invalid_op+0x16/0x20 ? bio_split+0x288/0x350 bio_split_rw+0x4bc/0x810 ? __pfx_bio_split_rw+0x10/0x10 ? lockdep_unlock+0xf2/0x250 __bio_split_to_limits+0x1d8/0x900 blk_mq_submit_bio+0x1cf/0x18a0 ? __pfx_iov_iter_extract_pages+0x10/0x10 ? __pfx_blk_mq_submit_bio+0x10/0x10 ? find_held_lock+0x2d/0x110 ? lock_release+0x362/0x620 ? mark_held_locks+0x9e/0xe0 __submit_bio+0x1ea/0x290 ? __pfx___submit_bio+0x10/0x10 ? seqcount_lockdep_reader_access.constprop.0+0x82/0x90 submit_bio_noacct_nocheck+0x675/0xa20 ? __pfx_bio_iov_iter_get_pages+0x10/0x10 ? __pfx_submit_bio_noacct_nocheck+0x10/0x10 iomap_dio_bio_iter+0x624/0x1280 __iomap_dio_rw+0xa22/0x18a0 ? lock_is_held_type+0xe3/0x140 ? __pfx___iomap_dio_rw+0x10/0x10 ? lock_release+0x362/0x620 ? zonefs_file_write_iter+0x74c/0xc80 [zonefs] ? down_write+0x13d/0x1e0 iomap_dio_rw+0xe/0x40 zonefs_file_write_iter+0x5ea/0xc80 [zonefs] do_iter_readv_writev+0x18b/0x2c0 ? __pfx_do_iter_readv_writev+0x10/0x10 ? inode_security+0x54/0xf0 do_iter_write+0x13b/0x7c0 ? lock_is_held_type+0xe3/0x140 vfs_writev+0x185/0x550 ? __pfx_vfs_writev+0x10/0x10 ? __handle_mm_fault+0x9bd/0x1c90 ? find_held_lock+0x2d/0x110 ? lock_release+0x362/0x620 ? find_held_lock+0x2d/0x110 ? lock_release+0x362/0x620 ? __up_read+0x1ea/0x720 ? do_pwritev+0x136/0x1f0 do_pwritev+0x136/0x1f0 ? __pfx_do_pwritev+0x10/0x10 ? syscall_enter_from_user_mode+0x22/0x90 ? lockdep_hardirqs_on+0x7d/0x100 do_syscall_64+0x58/0x80 This error depends on the hardware used, specifically on the max zone append bytes and max_[hw_]sectors limits. Tests using AMD Epyc machines that have low limits did not reveal this issue while runs on Intel Xeon machines with larger limits trigger it. Manually splitting the zone append BIO using bio_split_rw() can solve this issue but also requires issuing the fragment BIOs synchronously with submit_bio_wait(), to avoid potential reordering of the zone append BIO fragments, which would lead to data corruption. That is, this solution is not better than using regular write BIOs which are subject to serialization using zone write locking at the IO scheduler level. Given this, fix the issue by removing zone append support and using regular write BIOs for synchronous direct writes. This allows preseving the use of iomap and having identical synchronous and asynchronous sequential file write path. Zone append support will be reintroduced later through io_uring commands to ensure that the needed special handling is done correctly. Reported-by: Shin'ichiro Kawasaki Fixes: 16d7fd3cfa72 ("zonefs: use iomap for synchronous direct writes") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal Tested-by: Shin'ichiro Kawasaki Reviewed-by: Christoph Hellwig commit b734f02c887d9a02cd777ee3a74be38df341fabb Merge: 85c2c79a07302 a4b7193d8efdf Author: Martin KaFai Lau Date: Wed Aug 9 20:29:03 2023 -0700 Merge branch 'bug fixes for sockmap' Xu Kuohai says: ==================== bug fixes and a new test case for sockmap. v3: fix bpf ci failure v2: https://lore.kernel.org/bpf/20230803064838.108784-1-xukuohai@huaweicloud.com add a test case v1: https://lore.kernel.org/bpf/20230728105649.3978774-1-xukuohai@huaweicloud.com https://lore.kernel.org/bpf/20230728105717.3978849-1-xukuohai@huaweicloud.com ==================== Signed-off-by: Martin KaFai Lau commit a4b7193d8efdfde1ea89fe34e921ad031f79f993 Author: Xu Kuohai Date: Fri Aug 4 03:37:40 2023 -0400 selftests/bpf: Add sockmap test for redirecting partial skb data Add a test case to check whether sockmap redirection works correctly when data length returned by stream_parser is less than skb->len. In addition, this test checks whether strp_done is called correctly. The reason is that we returns skb->len - 1 from the stream_parser, so the last byte in the skb will be held by strp->skb_head. Therefore, if strp_done is not called to free strp->skb_head, we'll get a memleak warning. Signed-off-by: Xu Kuohai Link: https://lore.kernel.org/r/20230804073740.194770-5-xukuohai@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 90f0074cd9f9a24b7b6c4d5afffa676aee48c0e9 Author: Xu Kuohai Date: Fri Aug 4 03:37:39 2023 -0400 selftests/bpf: fix a CI failure caused by vsock sockmap test BPF CI has reported the following failure: Error: #200/79 sockmap_listen/sockmap VSOCK test_vsock_redir Error: #200/79 sockmap_listen/sockmap VSOCK test_vsock_redir ./test_progs:vsock_unix_redir_connectible:1506: egress: write: Transport endpoint is not connected vsock_unix_redir_connectible:FAIL:1506 ./test_progs:vsock_unix_redir_connectible:1506: ingress: write: Transport endpoint is not connected vsock_unix_redir_connectible:FAIL:1506 ./test_progs:vsock_unix_redir_connectible:1506: egress: write: Transport endpoint is not connected vsock_unix_redir_connectible:FAIL:1506 ./test_progs:vsock_unix_redir_connectible:1514: ingress: recv() err, errno=11 vsock_unix_redir_connectible:FAIL:1514 ./test_progs:vsock_unix_redir_connectible:1518: ingress: vsock socket map failed, a != b vsock_unix_redir_connectible:FAIL:1518 ./test_progs:vsock_unix_redir_connectible:1525: ingress: want pass count 1, have 0 It’s because the recv(... MSG_DONTWAIT) syscall in the test case is called before the queued work sk_psock_backlog() in the kernel finishes executing. So the data to be read is still queued in psock->ingress_skb and cannot be read by the user program. Therefore, the non-blocking recv() reads nothing and reports an EAGAIN error. So replace recv(... MSG_DONTWAIT) with xrecv_nonblock(), which calls select() to wait for data to be readable or timeout before calls recv(). Fixes: d61bd8c1fd02 ("selftests/bpf: add a test case for vsock sockmap") Signed-off-by: Xu Kuohai Link: https://lore.kernel.org/r/20230804073740.194770-4-xukuohai@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 809e4dc71a0f2b8d2836035d98603694fff11d5d Author: Xu Kuohai Date: Fri Aug 4 03:37:38 2023 -0400 bpf, sockmap: Fix bug that strp_done cannot be called strp_done is only called when psock->progs.stream_parser is not NULL, but stream_parser was set to NULL by sk_psock_stop_strp(), called by sk_psock_drop() earlier. So, strp_done can never be called. Introduce SK_PSOCK_RX_ENABLED to mark whether there is strp on psock. Change the condition for calling strp_done from judging whether stream_parser is set to judging whether this flag is set. This flag is only set once when strp_init() succeeds, and will never be cleared later. Fixes: c0d95d3380ee ("bpf, sockmap: Re-evaluate proto ops when psock is removed from sockmap") Signed-off-by: Xu Kuohai Reviewed-by: John Fastabend Link: https://lore.kernel.org/r/20230804073740.194770-3-xukuohai@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 7e96ec0e6605b69bb21bbf6c0ff9051e656ec2b1 Author: Xu Kuohai Date: Fri Aug 4 03:37:37 2023 -0400 bpf, sockmap: Fix map type error in sock_map_del_link sock_map_del_link() operates on both SOCKMAP and SOCKHASH, although both types have member named "progs", the offset of "progs" member in these two types is different, so "progs" should be accessed with the real map type. Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Xu Kuohai Reviewed-by: John Fastabend Link: https://lore.kernel.org/r/20230804073740.194770-2-xukuohai@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 85c2c79a07302fe68a1ad5cc449458cc559e314d Author: Magnus Karlsson Date: Wed Aug 9 16:28:43 2023 +0200 xsk: fix refcount underflow in error path Fix a refcount underflow problem reported by syzbot that can happen when a system is running out of memory. If xp_alloc_tx_descs() fails, and it can only fail due to not having enough memory, then the error path is triggered. In this error path, the refcount of the pool is decremented as it has incremented before. However, the reference to the pool in the socket was not nulled. This means that when the socket is closed later, the socket teardown logic will think that there is a pool attached to the socket and try to decrease the refcount again, leading to a refcount underflow. I chose this fix as it involved adding just a single line. Another option would have been to move xp_get_pool() and the assignment of xs->pool to after the if-statement and using xs_umem->pool instead of xs->pool in the whole if-statement resulting in somewhat simpler code, but this would have led to much more churn in the code base perhaps making it harder to backport. Fixes: ba3beec2ec1d ("xsk: Fix possible crash when multiple sockets are created") Reported-by: syzbot+8ada0057e69293a05fd4@syzkaller.appspotmail.com Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230809142843.13944-1-magnus.karlsson@gmail.com Signed-off-by: Martin KaFai Lau commit c1f848f12103920ca165758aedb1c10904e193e1 Author: Jerome Brunet Date: Wed Aug 9 19:19:31 2023 +0200 ASoC: meson: axg-tdm-formatter: fix channel slot allocation When the tdm lane mask is computed, the driver currently fills the 1st lane before moving on to the next. If the stream has less channels than the lanes can accommodate, slots will be disabled on the last lanes. Unfortunately, the HW distribute channels in a different way. It distribute channels in pair on each lanes before moving on the next slots. This difference leads to problems if a device has an interface with more than 1 lane and with more than 2 slots per lane. For example: a playback interface with 2 lanes and 4 slots each (total 8 slots - zero based numbering) - Playing a 8ch stream: - All slots activated by the driver - channel #2 will be played on lane #1 - slot #0 following HW placement - Playing a 4ch stream: - Lane #1 disabled by the driver - channel #2 will be played on lane #0 - slot #2 This behaviour is obviously not desirable. Change the way slots are activated on the TDM lanes to follow what the HW does and make sure each channel always get mapped to the same slot/lane. Fixes: 1a11d88f499c ("ASoC: meson: add tdm formatter base driver") Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20230809171931.1244502-1-jbrunet@baylibre.com Signed-off-by: Mark Brown commit 048c796beb6eb4fa3a5a647ee1c81f5c6f0f6a2a Author: Maciej Żenczykowski Date: Mon Aug 7 03:25:32 2023 -0700 ipv6: adjust ndisc_is_useropt() to also return true for PIO The upcoming (and nearly finalized): https://datatracker.ietf.org/doc/draft-collink-6man-pio-pflag/ will update the IPv6 RA to include a new flag in the PIO field, which will serve as a hint to perform DHCPv6-PD. As we don't want DHCPv6 related logic inside the kernel, this piece of information needs to be exposed to userspace. The simplest option is to simply expose the entire PIO through the already existing mechanism. Even without this new flag, the already existing PIO R (router address) flag (from RFC6275) cannot AFAICT be handled entirely in kernel, and provides useful information that should be exposed to userspace (the router's global address, for use by Mobile IPv6). Also cc'ing stable@ for inclusion in LTS, as while technically this is not quite a bugfix, and instead more of a feature, it is absolutely trivial and the alternative is manually cherrypicking into all Android Common Kernel trees - and I know Greg will ask for it to be sent in via LTS instead... Cc: Jen Linkova Cc: Lorenzo Colitti Cc: David Ahern Cc: YOSHIFUJI Hideaki / 吉藤英明 Cc: stable@vger.kernel.org Signed-off-by: Maciej Żenczykowski Link: https://lore.kernel.org/r/20230807102533.1147559-1-maze@google.com Signed-off-by: Jakub Kicinski commit 15c8795dbff8105b9071a7e38e6d4a1649747ec9 Merge: acaaffc570f77 06f2ab86a5b6e Author: Jakub Kicinski Date: Wed Aug 9 15:04:44 2023 -0700 Merge tag 'wireless-2023-08-09' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Johannes Berg says: ==================== Just a few small updates: * fix an integer overflow in nl80211 * fix rtw89 8852AE disconnections * fix a buffer overflow in ath12k * fix AP_VLAN configuration lookups * fix allocation failure handling in brcm80211 * update MAINTAINERS for some drivers * tag 'wireless-2023-08-09' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: ath12k: Fix buffer overflow when scanning with extraie wifi: nl80211: fix integer overflow in nl80211_parse_mbssid_elems() wifi: cfg80211: fix sband iftype data lookup for AP_VLAN wifi: rtw89: fix 8852AE disconnection caused by RX full flags MAINTAINERS: Remove tree entry for rtl8180 MAINTAINERS: Update entry for rtl8187 wifi: brcm80211: handle params_v1 allocation failure ==================== Link: https://lore.kernel.org/r/20230809124818.167432-2-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit f099a108cabf72a1184b1e14e4a09f4ca3375750 Author: Chengming Zhou Date: Fri Aug 4 15:06:09 2023 +0800 blk-iocost: fix queue stats accounting The q->stats->accounting is not only used by iocost, but iocost only increase this counter, never decrease it. So queue stats accounting will always enabled after using iocost once. Signed-off-by: Chengming Zhou Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230804070609.31623-1-chengming.zhou@linux.dev Signed-off-by: Jens Axboe commit 2bc057692599a5b3dc93d75a3dff34f72576355d Author: Jens Axboe Date: Tue Aug 8 11:06:17 2023 -0600 block: don't make REQ_POLLED imply REQ_NOWAIT Normally these two flags do go together, as the issuer of polled IO generally cannot wait for resources that will get freed as part of IO completion. This is because that very task is the one that will complete the request and free those resources, hence that would introduce a deadlock. But it is possible to have someone else issue the polled IO, eg via io_uring if the request is punted to io-wq. For that case, it's fine to have the task block on IO submission, as it is not the same task that will be completing the IO. It's completely up to the caller to ask for both polled and nowait IO separately! If we don't allow polled IO where IOCB_NOWAIT isn't set in the kiocb, then we can run into repeated -EAGAIN submissions and not make any progress. Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit acaaffc570f7743ce6395ffba31d34a566e32b85 Merge: 8a70ed9520c5f 8b5ff37097775 Author: Jakub Kicinski Date: Wed Aug 9 14:53:38 2023 -0700 Merge branch 'selftests-forwarding-various-fixes' Ido Schimmel says: ==================== selftests: forwarding: Various fixes Fix various problems with forwarding selftests. See individual patches for problem description and solution. ==================== Link: https://lore.kernel.org/r/20230808141503.4060661-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 8b5ff37097775cdbd447442603957066dd2e4d02 Author: Ido Schimmel Date: Tue Aug 8 17:15:03 2023 +0300 selftests: forwarding: bridge_mdb: Make test more robust Some test cases check that the group timer is (or isn't) 0. Instead of grepping for "0.00" grep for " 0.00" as the former can also match "260.00" which is the default group membership interval. Fixes: b6d00da08610 ("selftests: forwarding: Add bridge MDB test") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-18-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit cb034948ac292da82cc0e6bc1340f81be36e117d Author: Ido Schimmel Date: Tue Aug 8 17:15:02 2023 +0300 selftests: forwarding: bridge_mdb_max: Fix failing test with old libnet As explained in commit 8bcfb4ae4d97 ("selftests: forwarding: Fix failing tests with old libnet"), old versions of libnet (used by mausezahn) do not use the "SO_BINDTODEVICE" socket option. For IP unicast packets, this can be solved by prefixing mausezahn invocations with "ip vrf exec". However, IP multicast packets do not perform routing and simply egress the bound device, which does not exist in this case. Fix by specifying the source and destination MAC of the packet which will cause mausezahn to use a packet socket instead of an IP socket. Fixes: 3446dcd7df05 ("selftests: forwarding: bridge_mdb_max: Add a new selftest") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-17-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit e98e195d90cc93b1bf2ad762c7c274a40dab7173 Author: Ido Schimmel Date: Tue Aug 8 17:15:01 2023 +0300 selftests: forwarding: bridge_mdb: Fix failing test with old libnet As explained in commit 8bcfb4ae4d97 ("selftests: forwarding: Fix failing tests with old libnet"), old versions of libnet (used by mausezahn) do not use the "SO_BINDTODEVICE" socket option. For IP unicast packets, this can be solved by prefixing mausezahn invocations with "ip vrf exec". However, IP multicast packets do not perform routing and simply egress the bound device, which does not exist in this case. Fix by specifying the source and destination MAC of the packet which will cause mausezahn to use a packet socket instead of an IP socket. Fixes: b6d00da08610 ("selftests: forwarding: Add bridge MDB test") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-16-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 21a72166abb9c9d13fe24a07cef0a0b9f1e331b0 Author: Ido Schimmel Date: Tue Aug 8 17:15:00 2023 +0300 selftests: forwarding: tc_flower_l2_miss: Fix failing test with old libnet As explained in commit 8bcfb4ae4d97 ("selftests: forwarding: Fix failing tests with old libnet"), old versions of libnet (used by mausezahn) do not use the "SO_BINDTODEVICE" socket option. For IP unicast packets, this can be solved by prefixing mausezahn invocations with "ip vrf exec". However, IP multicast packets do not perform routing and simply egress the bound device, which does not exist in this case. Fix by specifying the source and destination MAC of the packet which will cause mausezahn to use a packet socket instead of an IP socket. Fixes: 8c33266ae26a ("selftests: forwarding: Add layer 2 miss test cases") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-15-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 11604178fdc3404d46518e5332f1fe865d30c4a1 Author: Ido Schimmel Date: Tue Aug 8 17:14:59 2023 +0300 selftests: forwarding: tc_tunnel_key: Make filters more specific The test installs filters that match on various IP fragments (e.g., no fragment, first fragment) and expects a certain amount of packets to hit each filter. This is problematic as the filters are not specific enough and can match IP packets (e.g., IGMP) generated by the stack, resulting in failures [1]. Fix by making the filters more specific and match on more fields in the IP header: Source IP, destination IP and protocol. [1] # timeout set to 0 # selftests: net/forwarding: tc_tunnel_key.sh # TEST: tunnel_key nofrag (skip_hw) [FAIL] # packet smaller than MTU was not tunneled # INFO: Could not test offloaded functionality not ok 89 selftests: net/forwarding: tc_tunnel_key.sh # exit=1 Fixes: 533a89b1940f ("selftests: forwarding: add tunnel_key "nofrag" test case") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Acked-by: Davide Caratti Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-14-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 9ee37e53e7687654b487fc94e82569377272a7a8 Author: Ido Schimmel Date: Tue Aug 8 17:14:58 2023 +0300 selftests: forwarding: tc_flower: Relax success criterion The test checks that filters that match on source or destination MAC were only hit once. A host can send more than one packet with a given source or destination MAC, resulting in failures. Fix by relaxing the success criterion and instead check that the filters were not hit zero times. Using tc_check_at_least_x_packets() is also an option, but it is not available in older kernels. Fixes: 07e5c75184a1 ("selftests: forwarding: Introduce tc flower matching tests") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-13-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 5e8670610b93158ffacc3241f835454ff26a3469 Author: Ido Schimmel Date: Tue Aug 8 17:14:57 2023 +0300 selftests: forwarding: tc_actions: Use ncat instead of nc The test relies on 'nc' being the netcat version from the nmap project. While this seems to be the case on Fedora, it is not the case on Ubuntu, resulting in failures such as [1]. Fix by explicitly using the 'ncat' utility from the nmap project and the skip the test in case it is not installed. [1] # timeout set to 0 # selftests: net/forwarding: tc_actions.sh # TEST: gact drop and ok (skip_hw) [ OK ] # TEST: mirred egress flower redirect (skip_hw) [ OK ] # TEST: mirred egress flower mirror (skip_hw) [ OK ] # TEST: mirred egress matchall mirror (skip_hw) [ OK ] # TEST: mirred_egress_to_ingress (skip_hw) [ OK ] # nc: invalid option -- '-' # usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-M ttl] # [-m minttl] [-O length] [-P proxy_username] [-p source_port] # [-q seconds] [-s sourceaddr] [-T keyword] [-V rtable] [-W recvlimit] # [-w timeout] [-X proxy_protocol] [-x proxy_address[:port]] # [destination] [port] # nc: invalid option -- '-' # usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-M ttl] # [-m minttl] [-O length] [-P proxy_username] [-p source_port] # [-q seconds] [-s sourceaddr] [-T keyword] [-V rtable] [-W recvlimit] # [-w timeout] [-X proxy_protocol] [-x proxy_address[:port]] # [destination] [port] # TEST: mirred_egress_to_ingress_tcp (skip_hw) [FAIL] # server output check failed # INFO: Could not test offloaded functionality not ok 80 selftests: net/forwarding: tc_actions.sh # exit=1 Fixes: ca22da2fbd69 ("act_mirred: use the backlog for nested calls to mirred ingress") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-12-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 23fb886a1ced6f885ddd541cc86d45c415ce705c Author: Ido Schimmel Date: Tue Aug 8 17:14:56 2023 +0300 selftests: forwarding: ethtool_mm: Skip when MAC Merge is not supported MAC Merge cannot be tested with veth pairs, resulting in failures: # ./ethtool_mm.sh [...] TEST: Manual configuration with verification: swp1 to swp2 [FAIL] Verification did not succeed Fix by skipping the test when the interfaces do not support MAC Merge. Fixes: e6991384ace5 ("selftests: forwarding: add a test for MAC Merge layer") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-11-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 9a711cde07c245a163d95eee5b42ed1871e73236 Author: Ido Schimmel Date: Tue Aug 8 17:14:55 2023 +0300 selftests: forwarding: hw_stats_l3_gre: Skip when using veth pairs Layer 3 hardware stats cannot be used when the underlying interfaces are veth pairs, resulting in failures: # ./hw_stats_l3_gre.sh TEST: ping gre flat [ OK ] TEST: Test rx packets: [FAIL] Traffic not reflected in the counter: 0 -> 0 TEST: Test tx packets: [FAIL] Traffic not reflected in the counter: 0 -> 0 Fix by skipping the test when used with veth pairs. Fixes: 813f97a26860 ("selftests: forwarding: Add a tunnel-based test for L3 HW stats") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-10-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit b3d9305e60d121dac20a77b6847c4cf14a4c0001 Author: Ido Schimmel Date: Tue Aug 8 17:14:54 2023 +0300 selftests: forwarding: ethtool_extended_state: Skip when using veth pairs Ethtool extended state cannot be tested with veth pairs, resulting in failures: # ./ethtool_extended_state.sh TEST: Autoneg, No partner detected [FAIL] Expected "Autoneg", got "Link detected: no" [...] Fix by skipping the test when used with veth pairs. Fixes: 7d10bcce98cd ("selftests: forwarding: Add tests for ethtool extended state") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-9-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 60a36e21915c31c0375d9427be9406aa8ce2ec34 Author: Ido Schimmel Date: Tue Aug 8 17:14:53 2023 +0300 selftests: forwarding: ethtool: Skip when using veth pairs Auto-negotiation cannot be tested with veth pairs, resulting in failures: # ./ethtool.sh TEST: force of same speed autoneg off [FAIL] error in configuration. swp1 speed Not autoneg off [...] Fix by skipping the test when used with veth pairs. Fixes: 64916b57c0b1 ("selftests: forwarding: Add speed and auto-negotiation test") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-8-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 66e131861ab7bf754b50813216f5c6885cd32d63 Author: Ido Schimmel Date: Tue Aug 8 17:14:52 2023 +0300 selftests: forwarding: Add a helper to skip test when using veth pairs A handful of tests require physical loopbacks to be used instead of veth pairs. Add a helper that these tests will invoke in order to be skipped when executed with veth pairs. Fixes: 64916b57c0b1 ("selftests: forwarding: Add speed and auto-negotiation test") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-7-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 38f7c44d6e760a8513557e27340d61b820c91b8f Author: Ido Schimmel Date: Tue Aug 8 17:14:51 2023 +0300 selftests: forwarding: Set default IPv6 traceroute utility The test uses the 'TROUTE6' environment variable to encode the name of the IPv6 traceroute utility. By default (without a configuration file), this variable is not set, resulting in failures: # ./ip6_forward_instats_vrf.sh TEST: ping6 [ OK ] TEST: Ip6InTooBigErrors [ OK ] TEST: Ip6InHdrErrors [FAIL] TEST: Ip6InAddrErrors [ OK ] TEST: Ip6InDiscards [ OK ] Fix by setting a default utility name and skip the test if the utility is not present. Fixes: 0857d6f8c759 ("ipv6: When forwarding count rx stats on the orig netdev") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-6-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 6bdf3d9765f4e0eebfd919e70acc65bce5daa9b9 Author: Ido Schimmel Date: Tue Aug 8 17:14:50 2023 +0300 selftests: forwarding: bridge_mdb_max: Check iproute2 version The selftest relies on iproute2 changes present in version 6.3, but the test does not check for it, resulting in errors: # ./bridge_mdb_max.sh INFO: 802.1d tests TEST: cfg4: port: ngroups reporting [FAIL] Number of groups was null, now is null, but 5 expected TEST: ctl4: port: ngroups reporting [FAIL] Number of groups was null, now is null, but 5 expected TEST: cfg6: port: ngroups reporting [FAIL] Number of groups was null, now is null, but 5 expected [...] Fix by skipping the test if iproute2 is too old. Fixes: 3446dcd7df05 ("selftests: forwarding: bridge_mdb_max: Add a new selftest") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/6b04b2ba-2372-6f6b-3ac8-b7cba1cfae83@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-5-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit ab2eda04e2c2116910b9d77ccc82e727efa71d49 Author: Ido Schimmel Date: Tue Aug 8 17:14:49 2023 +0300 selftests: forwarding: bridge_mdb: Check iproute2 version The selftest relies on iproute2 changes present in version 6.3, but the test does not check for it, resulting in error: # ./bridge_mdb.sh INFO: # Host entries configuration tests TEST: Common host entries configuration tests (IPv4) [FAIL] Managed to add IPv4 host entry with a filter mode TEST: Common host entries configuration tests (IPv6) [FAIL] Managed to add IPv6 host entry with a filter mode TEST: Common host entries configuration tests (L2) [FAIL] Managed to add L2 host entry with a filter mode INFO: # Port group entries configuration tests - (*, G) Command "replace" is unknown, try "bridge mdb help". [...] Fix by skipping the test if iproute2 is too old. Fixes: b6d00da08610 ("selftests: forwarding: Add bridge MDB test") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/6b04b2ba-2372-6f6b-3ac8-b7cba1cfae83@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-4-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 0529883ad102f6c04e19fb7018f31e1bda575bbe Author: Ido Schimmel Date: Tue Aug 8 17:14:48 2023 +0300 selftests: forwarding: Switch off timeout The default timeout for selftests is 45 seconds, but it is not enough for forwarding selftests which can takes minutes to finish depending on the number of tests cases: # make -C tools/testing/selftests TARGETS=net/forwarding run_tests TAP version 13 1..102 # timeout set to 45 # selftests: net/forwarding: bridge_igmp.sh # TEST: IGMPv2 report 239.10.10.10 [ OK ] # TEST: IGMPv2 leave 239.10.10.10 [ OK ] # TEST: IGMPv3 report 239.10.10.10 is_include [ OK ] # TEST: IGMPv3 report 239.10.10.10 include -> allow [ OK ] # not ok 1 selftests: net/forwarding: bridge_igmp.sh # TIMEOUT 45 seconds Fix by switching off the timeout and setting it to 0. A similar change was done for BPF selftests in commit 6fc5916cc256 ("selftests: bpf: Switch off timeout"). Fixes: 81573b18f26d ("selftests/net/forwarding: add Makefile to install tests") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/8d149f8c-818e-d141-a0ce-a6bae606bc22@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-3-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit d72c83b1e4b4a36a38269c77a85ff52f95eb0d08 Author: Ido Schimmel Date: Tue Aug 8 17:14:47 2023 +0300 selftests: forwarding: Skip test when no interfaces are specified As explained in [1], the forwarding selftests are meant to be run with either physical loopbacks or veth pairs. The interfaces are expected to be specified in a user-provided forwarding.config file or as command line arguments. By default, this file is not present and the tests fail: # make -C tools/testing/selftests TARGETS=net/forwarding run_tests [...] TAP version 13 1..102 # timeout set to 45 # selftests: net/forwarding: bridge_igmp.sh # Command line is not complete. Try option "help" # Failed to create netif not ok 1 selftests: net/forwarding: bridge_igmp.sh # exit=1 [...] Fix by skipping a test if interfaces are not provided either via the configuration file or command line arguments. # make -C tools/testing/selftests TARGETS=net/forwarding run_tests [...] TAP version 13 1..102 # timeout set to 45 # selftests: net/forwarding: bridge_igmp.sh # SKIP: Cannot create interface. Name not specified ok 1 selftests: net/forwarding: bridge_igmp.sh # SKIP [1] tools/testing/selftests/net/forwarding/README Fixes: 81573b18f26d ("selftests/net/forwarding: add Makefile to install tests") Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/netdev/856d454e-f83c-20cf-e166-6dc06cbc1543@alu.unizg.hr/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Tested-by: Mirsad Todorovac Reviewed-by: Hangbin Liu Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230808141503.4060661-2-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 8a70ed9520c5fafaac91053cacdd44625c39e188 Author: Eric Dumazet Date: Tue Aug 8 08:49:23 2023 +0000 tcp: add missing family to tcp_set_ca_state() tracepoint Before this code is copied, add the missing family, as we did in commit 3dd344ea84e1 ("net: tracepoint: exposing sk_family in all tcp:tracepoints") Fixes: 15fcdf6ae116 ("tcp: Add tracepoint for tcp_set_ca_state") Signed-off-by: Eric Dumazet Cc: Ping Gan Cc: Manjusaka Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230808084923.2239142-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit f8d3e0dc4b3aed92063de6e9fd34a75efe8d4a03 Merge: 718cb09aaa6fa 8743aeff5bc4d Author: Jakub Kicinski Date: Wed Aug 9 13:42:09 2023 -0700 Merge branch 'nexthop-nexthop-dump-fixes' Ido Schimmel says: ==================== nexthop: Nexthop dump fixes Patches #1 and #3 fix two problems related to nexthops and nexthop buckets dump, respectively. Patch #2 is a preparation for the third patch. The pattern described in these patches of splitting the NLMSG_DONE to a separate response is prevalent in other rtnetlink dump callbacks. I don't know if it's because I'm missing something or if this was done intentionally to ensure the message is delivered to user space. After commit 0642840b8bb0 ("af_netlink: ensure that NLMSG_DONE never fails in dumps") this is no longer necessary and I can improve these dump callbacks assuming this analysis is correct. No regressions in existing tests: # ./fib_nexthops.sh [...] Tests passed: 230 Tests failed: 0 ==================== Link: https://lore.kernel.org/r/20230808075233.3337922-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 8743aeff5bc4dcb5b87b43765f48d5ac3ad7dd9f Author: Ido Schimmel Date: Tue Aug 8 10:52:33 2023 +0300 nexthop: Fix infinite nexthop bucket dump when using maximum nexthop ID A netlink dump callback can return a positive number to signal that more information needs to be dumped or zero to signal that the dump is complete. In the second case, the core netlink code will append the NLMSG_DONE message to the skb in order to indicate to user space that the dump is complete. The nexthop bucket dump callback always returns a positive number if nexthop buckets were filled in the provided skb, even if the dump is complete. This means that a dump will span at least two recvmsg() calls as long as nexthop buckets are present. In the last recvmsg() call the dump callback will not fill in any nexthop buckets because the previous call indicated that the dump should restart from the last dumped nexthop ID plus one. # ip link add name dummy1 up type dummy # ip nexthop add id 1 dev dummy1 # ip nexthop add id 10 group 1 type resilient buckets 2 # strace -e sendto,recvmsg -s 5 ip nexthop bucket sendto(3, [[{nlmsg_len=24, nlmsg_type=RTM_GETNEXTHOPBUCKET, nlmsg_flags=NLM_F_REQUEST|NLM_F_DUMP, nlmsg_seq=1691396980, nlmsg_pid=0}, {family=AF_UNSPEC, data="\x00\x00\x00\x00\x00"...}], {nlmsg_len=0, nlmsg_type=0 /* NLMSG_??? */, nlmsg_flags=0, nlmsg_seq=0, nlmsg_pid=0}], 152, 0, NULL, 0) = 152 recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_TRUNC}, MSG_PEEK|MSG_TRUNC) = 128 recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[[{nlmsg_len=64, nlmsg_type=RTM_NEWNEXTHOPBUCKET, nlmsg_flags=NLM_F_MULTI, nlmsg_seq=1691396980, nlmsg_pid=347}, {family=AF_UNSPEC, data="\x00\x00\x00\x00\x00"...}], [{nlmsg_len=64, nlmsg_type=RTM_NEWNEXTHOPBUCKET, nlmsg_flags=NLM_F_MULTI, nlmsg_seq=1691396980, nlmsg_pid=347}, {family=AF_UNSPEC, data="\x00\x00\x00\x00\x00"...}]], iov_len=32768}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 128 id 10 index 0 idle_time 6.66 nhid 1 id 10 index 1 idle_time 6.66 nhid 1 recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_TRUNC}, MSG_PEEK|MSG_TRUNC) = 20 recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=20, nlmsg_type=NLMSG_DONE, nlmsg_flags=NLM_F_MULTI, nlmsg_seq=1691396980, nlmsg_pid=347}, 0], iov_len=32768}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 20 +++ exited with 0 +++ This behavior is both inefficient and buggy. If the last nexthop to be dumped had the maximum ID of 0xffffffff, then the dump will restart from 0 (0xffffffff + 1) and never end: # ip link add name dummy1 up type dummy # ip nexthop add id 1 dev dummy1 # ip nexthop add id $((2**32-1)) group 1 type resilient buckets 2 # ip nexthop bucket id 4294967295 index 0 idle_time 5.55 nhid 1 id 4294967295 index 1 idle_time 5.55 nhid 1 id 4294967295 index 0 idle_time 5.55 nhid 1 id 4294967295 index 1 idle_time 5.55 nhid 1 [...] Fix by adjusting the dump callback to return zero when the dump is complete. After the fix only one recvmsg() call is made and the NLMSG_DONE message is appended to the RTM_NEWNEXTHOPBUCKET responses: # ip link add name dummy1 up type dummy # ip nexthop add id 1 dev dummy1 # ip nexthop add id $((2**32-1)) group 1 type resilient buckets 2 # strace -e sendto,recvmsg -s 5 ip nexthop bucket sendto(3, [[{nlmsg_len=24, nlmsg_type=RTM_GETNEXTHOPBUCKET, nlmsg_flags=NLM_F_REQUEST|NLM_F_DUMP, nlmsg_seq=1691396737, nlmsg_pid=0}, {family=AF_UNSPEC, data="\x00\x00\x00\x00\x00"...}], {nlmsg_len=0, nlmsg_type=0 /* NLMSG_??? */, nlmsg_flags=0, nlmsg_seq=0, nlmsg_pid=0}], 152, 0, NULL, 0) = 152 recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_TRUNC}, MSG_PEEK|MSG_TRUNC) = 148 recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[[{nlmsg_len=64, nlmsg_type=RTM_NEWNEXTHOPBUCKET, nlmsg_flags=NLM_F_MULTI, nlmsg_seq=1691396737, nlmsg_pid=350}, {family=AF_UNSPEC, data="\x00\x00\x00\x00\x00"...}], [{nlmsg_len=64, nlmsg_type=RTM_NEWNEXTHOPBUCKET, nlmsg_flags=NLM_F_MULTI, nlmsg_seq=1691396737, nlmsg_pid=350}, {family=AF_UNSPEC, data="\x00\x00\x00\x00\x00"...}], [{nlmsg_len=20, nlmsg_type=NLMSG_DONE, nlmsg_flags=NLM_F_MULTI, nlmsg_seq=1691396737, nlmsg_pid=350}, 0]], iov_len=32768}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 148 id 4294967295 index 0 idle_time 6.61 nhid 1 id 4294967295 index 1 idle_time 6.61 nhid 1 +++ exited with 0 +++ Note that if the NLMSG_DONE message cannot be appended because of size limitations, then another recvmsg() will be needed, but the core netlink code will not invoke the dump callback and simply reply with a NLMSG_DONE message since it knows that the callback previously returned zero. Add a test that fails before the fix: # ./fib_nexthops.sh -t basic_res [...] TEST: Maximum nexthop ID dump [FAIL] [...] And passes after it: # ./fib_nexthops.sh -t basic_res [...] TEST: Maximum nexthop ID dump [ OK ] [...] Fixes: 8a1bbabb034d ("nexthop: Add netlink handlers for bucket dump") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20230808075233.3337922-4-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit f10d3d9df49d9e6ee244fda6ca264f901a9c5d85 Author: Ido Schimmel Date: Tue Aug 8 10:52:32 2023 +0300 nexthop: Make nexthop bucket dump more efficient rtm_dump_nexthop_bucket_nh() is used to dump nexthop buckets belonging to a specific resilient nexthop group. The function returns a positive return code (the skb length) upon both success and failure. The above behavior is problematic. When a complete nexthop bucket dump is requested, the function that walks the different nexthops treats the non-zero return code as an error. This causes buckets belonging to different resilient nexthop groups to be dumped using different buffers even if they can all fit in the same buffer: # ip link add name dummy1 up type dummy # ip nexthop add id 1 dev dummy1 # ip nexthop add id 10 group 1 type resilient buckets 1 # ip nexthop add id 20 group 1 type resilient buckets 1 # strace -e recvmsg -s 0 ip nexthop bucket [...] recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[...], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 64 id 10 index 0 idle_time 10.27 nhid 1 [...] recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[...], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 64 id 20 index 0 idle_time 6.44 nhid 1 [...] Fix by only returning a non-zero return code when an error occurred and restarting the dump from the bucket index we failed to fill in. This allows buckets belonging to different resilient nexthop groups to be dumped using the same buffer: # ip link add name dummy1 up type dummy # ip nexthop add id 1 dev dummy1 # ip nexthop add id 10 group 1 type resilient buckets 1 # ip nexthop add id 20 group 1 type resilient buckets 1 # strace -e recvmsg -s 0 ip nexthop bucket [...] recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[...], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 128 id 10 index 0 idle_time 30.21 nhid 1 id 20 index 0 idle_time 26.7 nhid 1 [...] While this change is more of a performance improvement change than an actual bug fix, it is a prerequisite for a subsequent patch that does fix a bug. Fixes: 8a1bbabb034d ("nexthop: Add netlink handlers for bucket dump") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20230808075233.3337922-3-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 913f60cacda73ccac8eead94983e5884c03e04cd Author: Ido Schimmel Date: Tue Aug 8 10:52:31 2023 +0300 nexthop: Fix infinite nexthop dump when using maximum nexthop ID A netlink dump callback can return a positive number to signal that more information needs to be dumped or zero to signal that the dump is complete. In the second case, the core netlink code will append the NLMSG_DONE message to the skb in order to indicate to user space that the dump is complete. The nexthop dump callback always returns a positive number if nexthops were filled in the provided skb, even if the dump is complete. This means that a dump will span at least two recvmsg() calls as long as nexthops are present. In the last recvmsg() call the dump callback will not fill in any nexthops because the previous call indicated that the dump should restart from the last dumped nexthop ID plus one. # ip nexthop add id 1 blackhole # strace -e sendto,recvmsg -s 5 ip nexthop sendto(3, [[{nlmsg_len=24, nlmsg_type=RTM_GETNEXTHOP, nlmsg_flags=NLM_F_REQUEST|NLM_F_DUMP, nlmsg_seq=1691394315, nlmsg_pid=0}, {nh_family=AF_UNSPEC, nh_scope=RT_SCOPE_UNIVERSE, nh_protocol=RTPROT_UNSPEC, nh_flags=0}], {nlmsg_len=0, nlmsg_type=0 /* NLMSG_??? */, nlmsg_flags=0, nlmsg_seq=0, nlmsg_pid=0}], 152, 0, NULL, 0) = 152 recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_TRUNC}, MSG_PEEK|MSG_TRUNC) = 36 recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=36, nlmsg_type=RTM_NEWNEXTHOP, nlmsg_flags=NLM_F_MULTI, nlmsg_seq=1691394315, nlmsg_pid=343}, {nh_family=AF_INET, nh_scope=RT_SCOPE_UNIVERSE, nh_protocol=RTPROT_UNSPEC, nh_flags=0}, [[{nla_len=8, nla_type=NHA_ID}, 1], {nla_len=4, nla_type=NHA_BLACKHOLE}]], iov_len=32768}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 36 id 1 blackhole recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_TRUNC}, MSG_PEEK|MSG_TRUNC) = 20 recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=20, nlmsg_type=NLMSG_DONE, nlmsg_flags=NLM_F_MULTI, nlmsg_seq=1691394315, nlmsg_pid=343}, 0], iov_len=32768}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 20 +++ exited with 0 +++ This behavior is both inefficient and buggy. If the last nexthop to be dumped had the maximum ID of 0xffffffff, then the dump will restart from 0 (0xffffffff + 1) and never end: # ip nexthop add id $((2**32-1)) blackhole # ip nexthop id 4294967295 blackhole id 4294967295 blackhole [...] Fix by adjusting the dump callback to return zero when the dump is complete. After the fix only one recvmsg() call is made and the NLMSG_DONE message is appended to the RTM_NEWNEXTHOP response: # ip nexthop add id $((2**32-1)) blackhole # strace -e sendto,recvmsg -s 5 ip nexthop sendto(3, [[{nlmsg_len=24, nlmsg_type=RTM_GETNEXTHOP, nlmsg_flags=NLM_F_REQUEST|NLM_F_DUMP, nlmsg_seq=1691394080, nlmsg_pid=0}, {nh_family=AF_UNSPEC, nh_scope=RT_SCOPE_UNIVERSE, nh_protocol=RTPROT_UNSPEC, nh_flags=0}], {nlmsg_len=0, nlmsg_type=0 /* NLMSG_??? */, nlmsg_flags=0, nlmsg_seq=0, nlmsg_pid=0}], 152, 0, NULL, 0) = 152 recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_TRUNC}, MSG_PEEK|MSG_TRUNC) = 56 recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[[{nlmsg_len=36, nlmsg_type=RTM_NEWNEXTHOP, nlmsg_flags=NLM_F_MULTI, nlmsg_seq=1691394080, nlmsg_pid=342}, {nh_family=AF_INET, nh_scope=RT_SCOPE_UNIVERSE, nh_protocol=RTPROT_UNSPEC, nh_flags=0}, [[{nla_len=8, nla_type=NHA_ID}, 4294967295], {nla_len=4, nla_type=NHA_BLACKHOLE}]], [{nlmsg_len=20, nlmsg_type=NLMSG_DONE, nlmsg_flags=NLM_F_MULTI, nlmsg_seq=1691394080, nlmsg_pid=342}, 0]], iov_len=32768}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 56 id 4294967295 blackhole +++ exited with 0 +++ Note that if the NLMSG_DONE message cannot be appended because of size limitations, then another recvmsg() will be needed, but the core netlink code will not invoke the dump callback and simply reply with a NLMSG_DONE message since it knows that the callback previously returned zero. Add a test that fails before the fix: # ./fib_nexthops.sh -t basic [...] TEST: Maximum nexthop ID dump [FAIL] [...] And passes after it: # ./fib_nexthops.sh -t basic [...] TEST: Maximum nexthop ID dump [ OK ] [...] Fixes: ab84be7e54fc ("net: Initial nexthop code") Reported-by: Petr Machata Closes: https://lore.kernel.org/netdev/87sf91enuf.fsf@nvidia.com/ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20230808075233.3337922-2-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 718cb09aaa6fa78cc8124e9517efbc6c92665384 Author: Vlad Buslov Date: Tue Aug 8 11:35:21 2023 +0200 vlan: Fix VLAN 0 memory leak The referenced commit intended to fix memleak of VLAN 0 that is implicitly created on devices with NETIF_F_HW_VLAN_CTAG_FILTER feature. However, it doesn't take into account that the feature can be re-set during the netdevice lifetime which will cause memory leak if feature is disabled during the device deletion as illustrated by [0]. Fix the leak by unconditionally deleting VLAN 0 on NETDEV_DOWN event. [0]: > modprobe 8021q > ip l set dev eth2 up > ethtool -K eth2 rx-vlan-filter off > modprobe -r mlx5_ib > modprobe -r mlx5_core > cat /sys/kernel/debug/kmemleak unreferenced object 0xffff888103dcd900 (size 256): comm "ip", pid 1490, jiffies 4294907305 (age 325.364s) hex dump (first 32 bytes): 00 80 5d 03 81 88 ff ff 00 00 00 00 00 00 00 00 ..]............. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000899f3bb9>] kmalloc_trace+0x25/0x80 [<000000002889a7a2>] vlan_vid_add+0xa0/0x210 [<000000007177800e>] vlan_device_event+0x374/0x760 [8021q] [<000000009a0716b1>] notifier_call_chain+0x35/0xb0 [<00000000bbf3d162>] __dev_notify_flags+0x58/0xf0 [<0000000053d2b05d>] dev_change_flags+0x4d/0x60 [<00000000982807e9>] do_setlink+0x28d/0x10a0 [<0000000058c1be00>] __rtnl_newlink+0x545/0x980 [<00000000e66c3bd9>] rtnl_newlink+0x44/0x70 [<00000000a2cc5970>] rtnetlink_rcv_msg+0x29c/0x390 [<00000000d307d1e4>] netlink_rcv_skb+0x54/0x100 [<00000000259d16f9>] netlink_unicast+0x1f6/0x2c0 [<000000007ce2afa1>] netlink_sendmsg+0x232/0x4a0 [<00000000f3f4bb39>] sock_sendmsg+0x38/0x60 [<000000002f9c0624>] ____sys_sendmsg+0x1e3/0x200 [<00000000d6ff5520>] ___sys_sendmsg+0x80/0xc0 unreferenced object 0xffff88813354fde0 (size 32): comm "ip", pid 1490, jiffies 4294907305 (age 325.364s) hex dump (first 32 bytes): a0 d9 dc 03 81 88 ff ff a0 d9 dc 03 81 88 ff ff ................ 81 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000899f3bb9>] kmalloc_trace+0x25/0x80 [<000000002da64724>] vlan_vid_add+0xdf/0x210 [<000000007177800e>] vlan_device_event+0x374/0x760 [8021q] [<000000009a0716b1>] notifier_call_chain+0x35/0xb0 [<00000000bbf3d162>] __dev_notify_flags+0x58/0xf0 [<0000000053d2b05d>] dev_change_flags+0x4d/0x60 [<00000000982807e9>] do_setlink+0x28d/0x10a0 [<0000000058c1be00>] __rtnl_newlink+0x545/0x980 [<00000000e66c3bd9>] rtnl_newlink+0x44/0x70 [<00000000a2cc5970>] rtnetlink_rcv_msg+0x29c/0x390 [<00000000d307d1e4>] netlink_rcv_skb+0x54/0x100 [<00000000259d16f9>] netlink_unicast+0x1f6/0x2c0 [<000000007ce2afa1>] netlink_sendmsg+0x232/0x4a0 [<00000000f3f4bb39>] sock_sendmsg+0x38/0x60 [<000000002f9c0624>] ____sys_sendmsg+0x1e3/0x200 [<00000000d6ff5520>] ___sys_sendmsg+0x80/0xc0 Fixes: efc73f4bbc23 ("net: Fix memory leak - vlan_info struct") Reviewed-by: Ido Schimmel Signed-off-by: Vlad Buslov Link: https://lore.kernel.org/r/20230808093521.1468929-1-vladbu@nvidia.com Signed-off-by: Jakub Kicinski commit 1b8b1aa90c9c0e825b181b98b8d9e249dc395470 Author: Kirill A. Shutemov Date: Thu Aug 3 18:16:09 2023 +0300 x86/mm: Fix VDSO and VVAR placement on 5-level paging machines Yingcong has noticed that on the 5-level paging machine, VDSO and VVAR VMAs are placed above the 47-bit border: 8000001a9000-8000001ad000 r--p 00000000 00:00 0 [vvar] 8000001ad000-8000001af000 r-xp 00000000 00:00 0 [vdso] This might confuse users who are not aware of 5-level paging and expect all userspace addresses to be under the 47-bit border. So far problem has only been triggered with ASLR disabled, although it may also occur with ASLR enabled if the layout is randomized in a just right way. The problem happens due to custom placement for the VMAs in the VDSO code: vdso_addr() tries to place them above the stack and checks the result against TASK_SIZE_MAX, which is wrong. TASK_SIZE_MAX is set to the 56-bit border on 5-level paging machines. Use DEFAULT_MAP_WINDOW instead. Fixes: b569bab78d8d ("x86/mm: Prepare to expose larger address space to userspace") Reported-by: Yingcong Wu Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/20230803151609.22141-1-kirill.shutemov%40linux.intel.com commit af8a6d281bfb68023fb60f616ec87fe8a875875e Author: Srinivas Pandruvada Date: Tue Aug 8 10:43:59 2023 -0700 platform/x86: ISST: Reduce noise for missing numa information in logs On platforms with no numa support and with several CPUs, logs have lots of noise for message "Fail to get numa node for CPU:.." Change pr_info() to pr_info_once() as one print is enough to show the issue. Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20230808174359.50602-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 5a66d59b5ff537ddae84a1f175c3f8eb1140a562 Author: Jean Delvare Date: Sat Aug 5 10:10:10 2023 +0200 platform/x86: msi-ec: Fix the build The msi-ec driver fails to build for me (gcc 7.5): CC [M] drivers/platform/x86/msi-ec.o drivers/platform/x86/msi-ec.c:72:6: error: initializer element is not constant { SM_ECO_NAME, 0xc2 }, ^~~~~~~~~~~ drivers/platform/x86/msi-ec.c:72:6: note: (near initialization for ‘CONF0.shift_mode.modes[0].name’) drivers/platform/x86/msi-ec.c:73:6: error: initializer element is not constant { SM_COMFORT_NAME, 0xc1 }, ^~~~~~~~~~~~~~~ drivers/platform/x86/msi-ec.c:73:6: note: (near initialization for ‘CONF0.shift_mode.modes[1].name’) drivers/platform/x86/msi-ec.c:74:6: error: initializer element is not constant { SM_SPORT_NAME, 0xc0 }, ^~~~~~~~~~~~~ drivers/platform/x86/msi-ec.c:74:6: note: (near initialization for ‘CONF0.shift_mode.modes[2].name’) (...) Don't try to be smart, just use defines for the constant strings. The compiler will recognize it's the same string and will store it only once in the data section anyway. Signed-off-by: Jean Delvare Fixes: 392cacf2aa10 ("platform/x86: Add new msi-ec driver") Cc: stable@vger.kernel.org Cc: Nikita Kravets Cc: Hans de Goede Cc: Mark Gross Link: https://lore.kernel.org/r/20230805101010.54d49e91@endymion.delvare Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit c6a1fd910d1bf8a0e3db7aebb229e3c81bc305c4 Author: Hans de Goede Date: Wed Aug 9 10:55:25 2023 +0200 ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings. This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1. Fixes: a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217336 Link: https://bugzilla.kernel.org/show_bug.cgi?id=217394 Link: https://bugzilla.kernel.org/show_bug.cgi?id=217406 Cc: All applicable Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 9728ac221160c5ea111879125a7694bb81364720 Author: Hans de Goede Date: Wed Aug 9 10:55:24 2023 +0200 ACPI: resource: Always use MADT override IRQ settings for all legacy non i8042 IRQs All the cases, were the DSDT IRQ settings should be used instead of the MADT override, are for IRQ 1 or 12, the PS/2 kbd resp. mouse IRQs. Simplify things by always honering the override for other legacy IRQs (for non DMI quirked cases). This allows removing the DMI quirks to honor the override for some non i8042 IRQs on some AMD ZEN based Lenovo models. Fixes: a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks") Cc: All applicable Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 2d331a6ac4815e2e2fe5f2d80d908566e57797cc Author: Hans de Goede Date: Wed Aug 9 10:55:23 2023 +0200 ACPI: resource: revert "Remove "Zen" specific match and quirks" Commit a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks") is causing keyboard problems for quite a log of AMD based laptop users, leading to many bug reports. Revert this change for now, until we can come up with a better fix for the PS/2 IRQ trigger-type/polarity problems on some x86 laptops. Fixes: a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks") Link: https://bugzilla.redhat.com/show_bug.cgi?id=2228891 Link: https://bugzilla.redhat.com/show_bug.cgi?id=2229165 Link: https://bugzilla.redhat.com/show_bug.cgi?id=2229317 Link: https://bugzilla.kernel.org/show_bug.cgi?id=217718 Link: https://bugzilla.kernel.org/show_bug.cgi?id=217726 Link: https://bugzilla.kernel.org/show_bug.cgi?id=217731 Cc: All applicable Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 3fa7187eceee11998f756481e45ce8c4f9d9dc48 Author: Qingsong Chen Date: Tue Aug 8 10:54:01 2023 +0800 rust: macros: vtable: fix `HAS_*` redefinition (`gen_const_name`) If we define the same function name twice in a trait (using `#[cfg]`), the `vtable` macro will redefine its `gen_const_name`, e.g. this will define `HAS_BAR` twice: #[vtable] pub trait Foo { #[cfg(CONFIG_X)] fn bar(); #[cfg(not(CONFIG_X))] fn bar(x: usize); } Fixes: b44becc5ee80 ("rust: macros: add `#[vtable]` proc macro") Signed-off-by: Qingsong Chen Reviewed-by: Andreas Hindborg Reviewed-by: Gary Guo Reviewed-by: Sergio González Collado Link: https://lore.kernel.org/r/20230808025404.2053471-1-changxian.cqs@antgroup.com Signed-off-by: Miguel Ojeda commit 6ccbd7fd474674654019a20177c943359469103a Author: Masahiro Yamada Date: Sat Jul 29 16:42:23 2023 +0900 alpha: remove __init annotation from exported page_is_ram() EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Commit c5a130325f13 ("ACPI/APEI: Add parameter check before error injection") exported page_is_ram(), hence the __init annotation should be removed. This fixes the modpost warning in ARCH=alpha builds: WARNING: modpost: vmlinux: page_is_ram: EXPORT_SYMBOL used for init symbol. Remove __init or EXPORT_SYMBOL. Fixes: c5a130325f13 ("ACPI/APEI: Add parameter check before error injection") Signed-off-by: Masahiro Yamada Reviewed-by: Randy Dunlap commit cacc6e22932f373a91d7be55a9b992dc77f4c59b Author: Mario Limonciello Date: Mon Aug 7 23:12:29 2023 -0500 tpm: Add a helper for checking hwrng enabled The same checks are repeated in three places to decide whether to use hwrng. Consolidate these into a helper. Also this fixes a case that one of them was missing a check in the cleanup path. Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs") Signed-off-by: Mario Limonciello Signed-off-by: Linus Torvalds commit 421d467dc2d483175bad4fb76a31b9e5a3d744cf Author: Remi Pommarel Date: Wed Aug 9 17:29:13 2023 +0200 batman-adv: Fix batadv_v_ogm_aggr_send memory leak When batadv_v_ogm_aggr_send is called for an inactive interface, the skb is silently dropped by batadv_v_ogm_send_to_if() but never freed causing the following memory leak: unreferenced object 0xffff00000c164800 (size 512): comm "kworker/u8:1", pid 2648, jiffies 4295122303 (age 97.656s) hex dump (first 32 bytes): 00 80 af 09 00 00 ff ff e1 09 00 00 75 01 60 83 ............u.`. 1f 00 00 00 b8 00 00 00 15 00 05 00 da e3 d3 64 ...............d backtrace: [<0000000007ad20f6>] __kmalloc_track_caller+0x1a8/0x310 [<00000000d1029e55>] kmalloc_reserve.constprop.0+0x70/0x13c [<000000008b9d4183>] __alloc_skb+0xec/0x1fc [<00000000c7af5051>] __netdev_alloc_skb+0x48/0x23c [<00000000642ee5f5>] batadv_v_ogm_aggr_send+0x50/0x36c [<0000000088660bd7>] batadv_v_ogm_aggr_work+0x24/0x40 [<0000000042fc2606>] process_one_work+0x3b0/0x610 [<000000002f2a0b1c>] worker_thread+0xa0/0x690 [<0000000059fae5d4>] kthread+0x1fc/0x210 [<000000000c587d3a>] ret_from_fork+0x10/0x20 Free the skb in that case to fix this leak. Cc: stable@vger.kernel.org Fixes: 0da0035942d4 ("batman-adv: OGMv2 - add basic infrastructure") Signed-off-by: Remi Pommarel Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 22883973244b1caaa26f9c6171a41ba843c8d4bd Author: Kirill A. Shutemov Date: Wed Aug 9 17:46:00 2023 +0300 mm: Fix access_remote_vm() regression on tagged addresses GDB uses /proc/PID/mem to access memory of the target process. GDB doesn't untag addresses manually, but relies on kernel to do the right thing. mem_rw() of procfs uses access_remote_vm() to get data from the target process. It worked fine until recent changes in __access_remote_vm() that now checks if there's VMA at target address using raw address. Untag the address before looking up the VMA. Signed-off-by: Kirill A. Shutemov Reported-by: Christina Schimpe Fixes: eee9c708cc89 ("gup: avoid stack expansion warning for known-good case") Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds commit 091ae5473f96ced844af6ba39b94757359b12348 Author: Alex Deucher Date: Fri Jul 28 11:38:02 2023 -0400 drm/amdkfd: disable IOMMUv2 support for Raven Use the dGPU path instead. There were a lot of platform issues with IOMMU in general on these chips due to windows not enabling IOMMU at the time. The dGPU path has been used for a long time with newer APUs and works fine. This also paves the way to simplify the driver significantly. Reviewed-by: Felix Kuehling Acked-by: Christian König Tested-by: Mike Lothian Signed-off-by: Alex Deucher commit 616f92d188ee7142a95a52068efdbea82645f859 Author: Alex Deucher Date: Fri Jul 28 11:34:59 2023 -0400 drm/amdkfd: disable IOMMUv2 support for KV/CZ Use the dGPU path instead. There were a lot of platform issues with IOMMU in general on these chips due to windows not enabling IOMMU at the time. The dGPU path has been used for a long time with newer APUs and works fine. This also paves the way to simplify the driver significantly. v2: use the dGPU queue manager functions Reviewed-by: Felix Kuehling Acked-by: Christian König Tested-by: Mike Lothian Signed-off-by: Alex Deucher commit a6dea2d64ff92851e68cd4e20a35f6534286e016 Author: Alex Deucher Date: Fri Jul 28 11:45:53 2023 -0400 drm/amdkfd: ignore crat by default We are dropping the IOMMUv2 path, so no need to enable this. It's often buggy on consumer platforms anyway. Reviewed-by: Felix Kuehling Acked-by: Christian König Tested-by: Mike Lothian Signed-off-by: Alex Deucher commit 2e91e731f24817bc55f9c9acc95a8939c4077b05 Author: Alex Deucher Date: Fri Jul 28 16:53:49 2023 -0400 drm/amdgpu/gfx11: only enable CP GFX shadowing on SR-IOV This is only required for SR-IOV world switches, but it adds additional latency leading to reduced performance in some benchmarks. Disable for now on bare metal. Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 3bb575572bf498a9d39e9d1ca5c06cc3152928a1 Author: Mario Limonciello Date: Fri Jul 28 17:04:01 2023 -0500 drm/amd/display: Fix a regression on Polaris cards DCE products don't define a `remove_stream_from_ctx` like DCN ones do. This means that when compute_mst_dsc_configs_for_state() is called it always returns -EINVAL which causes MST to fail to setup. Cc: stable@vger.kernel.org # 6.4.y Cc: Harry Wentland Reported-by: Klaus.Kusche@computerix.info Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2671 Fixes: efa4c4df864e ("drm/amd/display: call remove_stream_from_ctx from res_pool funcs") Signed-off-by: Mario Limonciello Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 90e065677e0362a777b9db97ea21d43a39211399 Author: Alex Deucher Date: Fri Jul 28 11:14:05 2023 -0400 drm/amdgpu: fix possible UAF in amdgpu_cs_pass1() Since the gang_size check is outside of chunk parsing loop, we need to reset i before we free the chunk data. Suggested by Ye Zhang (@VAR10CK) of Baidu Security. Reviewed-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 77245f1c3c6495521f6a3af082696ee2f8ce3921 Author: Borislav Petkov (AMD) Date: Sat Aug 5 00:06:43 2023 +0200 x86/CPU/AMD: Do not leak quotient data after a division by 0 Under certain circumstances, an integer division by 0 which faults, can leave stale quotient data from a previous division operation on Zen1 microarchitectures. Do a dummy division 0/1 before returning from the #DE exception handler in order to avoid any leaks of potentially sensitive data. Signed-off-by: Borislav Petkov (AMD) Cc: Signed-off-by: Linus Torvalds commit a73ea79a0c94bacfab4df23a1043644d14f56591 Author: Lijo Lazar Date: Wed Aug 2 10:24:36 2023 +0530 drm/amd/pm: Fix SMU v13.0.6 energy reporting Energy counter should be reported in units of 15.259 uJ. Don't apply any conversion. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 96b020e2163fb2197266b2f71b1007495206e6bb Author: Melissa Wen Date: Mon Jul 31 07:35:05 2023 -0100 drm/amd/display: check attr flag before set cursor degamma on DCN3+ Don't set predefined degamma curve to cursor plane if the cursor attribute flag is not set. Applying a degamma curve to the cursor by default breaks userspace expectation. Checking the flag before performing any color transformation prevents too dark cursor gamma in DCN3+ on many Linux desktop environment (KDE Plasma, GNOME, wlroots-based, etc.) as reported at: - https://gitlab.freedesktop.org/drm/amd/-/issues/1513 This is the same approach followed by DCN2 drivers where the issue is not present. Fixes: 03f54d7d3448 ("drm/amd/display: Add DCN3 DPP") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1513 Signed-off-by: Melissa Wen Reviewed-by: Harry Wentland Tested-by: Alex Hung Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 61319b8e3b58a7167cf146313fd4523fe72586bc Author: Evan Quan Date: Fri Jul 21 19:18:00 2023 +0800 drm/amd/pm: disable the SMU13 OD feature support temporarily The existing OD interface cannot support the growing demand for more OD features. We are in the transition to a new OD mechanism. So, disable the SMU13 OD feature support temporarily. And this should be reverted when the new OD mechanism online. Signed-off-by: Evan Quan Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit bd60e2eafd8fb053948b6e23e8167baf7a159750 Author: Kenneth Feng Date: Thu Jul 27 19:37:31 2023 +0800 drm/amd/pm: correct the pcie width for smu 13.0.0 correct the pcie width value in pp_dpm_pcie for smu 13.0.0 Signed-off-by: Kenneth Feng Reviewed-by: Harish Kasiviswanathan Acked-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 7ad1dfc144cbf62702fd07838da8fd8a77921083 Author: Mario Limonciello Date: Mon Jul 31 09:22:05 2023 -0500 drm/amd/display: Don't show stack trace for missing eDP Some systems are only connected by HDMI or DP, so warning related to missing eDP is unnecessary. Downgrade to debug instead. Cc: Hamza Mahfooz Fixes: 6d9b6dceaa51 ("drm/amd/display: only warn once in dce110_edp_wait_for_hpd_ready()") Reported-by: Mastan.Katragadda@amd.com Signed-off-by: Mario Limonciello Reviewed-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit d3de41ee5febe5c2d9989fe9810bce2bb54a3a8e Author: Lijo Lazar Date: Tue Jul 25 19:11:54 2023 +0530 drm/amdgpu: Match against exact bootloader status On PSP v13.x ASICs, boot loader will set only the MSB to 1 and clear the least significant bits for any command submission. Hence match against the exact register value, otherwise a register value of all 0xFFs also could falsely indicate that boot loader is ready. Also, from PSP v13.0.6 and newer, bits[7:0] will be used to indicate command error status. Signed-off-by: Lijo Lazar Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 730d44e1fa306a20746ad4a85da550662aed9daa Author: Tim Huang Date: Thu Jul 27 09:59:45 2023 +0800 drm/amd/pm: skip the RLC stop when S0i3 suspend for SMU v13.0.4/11 For SMU v13.0.4/11, driver does not need to stop RLC for S0i3, the firmwares will handle that properly. Signed-off-by: Tim Huang Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher commit 08fffa74d9772d9538338be3f304006c94dde6f0 Author: Mario Limonciello Date: Thu Jul 27 10:22:20 2023 -0500 drm/amd: Disable S/G for APUs when 64GB or more host memory Users report a white flickering screen on multiple systems that is tied to having 64GB or more memory. When S/G is enabled pages will get pinned to both VRAM carve out and system RAM leading to this. Until it can be fixed properly, disable S/G when 64GB of memory or more is detected. This will force pages to be pinned into VRAM. This should fix white screen flickers but if VRAM pressure is encountered may lead to black screens. It's a trade-off for now. Fixes: 81d0bcf99009 ("drm/amdgpu: make display pinning more flexible (v2)") Cc: Hamza Mahfooz Cc: Roman Li Cc: # 6.1.y: bf0207e172703 ("drm/amdgpu: add S/G display parameter") Cc: # 6.4.y Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2735 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2354 Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit e6475ce253187d2e68867102fddd57341ebbf8eb Author: Peter Ujfalusi Date: Wed Aug 9 15:56:56 2023 +0300 ASoC: SOF: ipc4-topology: Update the basecfg for copier earlier The sof_ipc4_update_resource_usage() call updates the CPC value in basecfg and it must be done prior to making a copy of the copier configuration for the init message. Other module types do the resource update as last step or in case of a process module at the correct time, before the memcpy. Fixes: d8a2c9879349 ("ASoC: SOF: ipc4-loader/topology: Query the CPC value from manifest") Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Adrian Bonislawski Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Chao Song Link: https://lore.kernel.org/r/20230809125656.27585-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 06f2ab86a5b6ed55f013258de4be9319841853ea Author: Wen Gong Date: Wed Aug 9 04:12:41 2023 -0400 wifi: ath12k: Fix buffer overflow when scanning with extraie If cfg80211 is providing extraie's for a scanning process then ath12k will copy that over to the firmware. The extraie.len is a 32 bit value in struct element_info and describes the amount of bytes for the vendor information elements. The problem is the allocation of the buffer. It has to align the TLV sections by 4 bytes. But the code was using an u8 to store the newly calculated length of this section (with alignment). And the new calculated length was then used to allocate the skbuff. But the actual code to copy in the data is using the extraie.len and not the calculated "aligned" length. The length of extraie with IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS enabled was 264 bytes during tests with a wifi card. But it only allocated 8 bytes (264 bytes % 256) for it. As consequence, the code to memcpy the extraie into the skb was then just overwriting data after skb->end. Things like shinfo were therefore corrupted. This could usually be seen by a crash in skb_zcopy_clear which tried to call a ubuf_info callback (using a bogus address). Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Link: https://lore.kernel.org/r/20230809081241.32765-1-quic_wgong@quicinc.com Signed-off-by: Johannes Berg commit 6311071a056272e1e761de8d0305e87cc566f734 Author: Keith Yeo Date: Mon Jul 31 11:47:20 2023 +0800 wifi: nl80211: fix integer overflow in nl80211_parse_mbssid_elems() nl80211_parse_mbssid_elems() uses a u8 variable num_elems to count the number of MBSSID elements in the nested netlink attribute attrs, which can lead to an integer overflow if a user of the nl80211 interface specifies 256 or more elements in the corresponding attribute in userspace. The integer overflow can lead to a heap buffer overflow as num_elems determines the size of the trailing array in elems, and this array is thereafter written to for each element in attrs. Note that this vulnerability only affects devices with the wiphy->mbssid_max_interfaces member set for the wireless physical device struct in the device driver, and can only be triggered by a process with CAP_NET_ADMIN capabilities. Fix this by checking for a maximum of 255 elements in attrs. Cc: stable@vger.kernel.org Fixes: dc1e3cb8da8b ("nl80211: MBSSID and EMA support in AP mode") Signed-off-by: Keith Yeo Link: https://lore.kernel.org/r/20230731034719.77206-1-keithyjy@gmail.com Signed-off-by: Johannes Berg commit 24138933b97b055d486e8064b4a1721702442a9b Author: Florian Westphal Date: Wed Aug 9 14:31:15 2023 +0200 netfilter: nf_tables: don't skip expired elements during walk There is an asymmetry between commit/abort and preparation phase if the following conditions are met: 1. set is a verdict map ("1.2.3.4 : jump foo") 2. timeouts are enabled In this case, following sequence is problematic: 1. element E in set S refers to chain C 2. userspace requests removal of set S 3. kernel does a set walk to decrement chain->use count for all elements from preparation phase 4. kernel does another set walk to remove elements from the commit phase (or another walk to do a chain->use increment for all elements from abort phase) If E has already expired in 1), it will be ignored during list walk, so its use count won't have been changed. Then, when set is culled, ->destroy callback will zap the element via nf_tables_set_elem_destroy(), but this function is only safe for elements that have been deactivated earlier from the preparation phase: lack of earlier deactivate removes the element but leaks the chain use count, which results in a WARN splat when the chain gets removed later, plus a leak of the nft_chain structure. Update pipapo_get() not to skip expired elements, otherwise flush command reports bogus ENOENT errors. Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges") Fixes: 8d8540c4f5e0 ("netfilter: nft_set_rbtree: add timeout support") Fixes: 9d0982927e79 ("netfilter: nft_hash: add support for timeouts") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 43dae319b50fac075ad864f84501c703ef20eb2b Author: Daniel Stone Date: Tue Aug 8 11:44:05 2023 +0100 drm/rockchip: Don't spam logs in atomic check Userspace should not be able to trigger DRM_ERROR messages to spam the logs; especially not through atomic commit parameters which are completely legitimate for userspace to attempt. Signed-off-by: Daniel Stone Fixes: 7707f7227f09 ("drm/rockchip: Add support for afbc") Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230808104405.522493-1-daniels@collabora.com commit a4a79e03bab57729bd8046d22bf3666912e586fb Author: Tony Lindgren Date: Sun Aug 6 09:20:50 2023 +0300 serial: core: Revert port_id use Guenter reports boot issues with duplicate sysfs entries for multiport drivers. Let's go back to using port->line for now to fix the regression. With this change, the serial core port device names are not correct for the hardware specific 8250 single port drivers, but that's a cosmetic issue for now. Fixes: d962de6ae51f ("serial: core: Fix serial core port id to not use port->line") Reported-by: Guenter Roeck Signed-off-by: Tony Lindgren Tested-by: Guenter Roeck Link: https://lore.kernel.org/r/20230806062052.47737-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 3f29d9ee323ae5cda59d144d1f8b0b10ea065be0 Author: Günther Noack Date: Tue Aug 8 22:11:12 2023 +0200 TIOCSTI: Document CAP_SYS_ADMIN behaviour in Kconfig Clarifies that the LEGACY_TIOCSTI setting is safe to turn off even when running BRLTTY, as it was introduced in commit 690c8b804ad2 ("TIOCSTI: always enable for CAP_SYS_ADMIN"). Signed-off-by: Günther Noack Reviewed-by: Samuel Thibault Link: https://lore.kernel.org/r/20230808201115.23993-1-gnoack3000@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2908042a37b56d6a9a595eca946e187e9d2df39a Author: Fabio Estevam Date: Tue Jul 25 21:14:45 2023 +0200 media: imx: imx7-media-csi: Fix applying format constraints v4l_bound_align_image() aligns to a multiple of 2 to the power of walign, not to walign. Depending on the pixel format, this causes the image width to be aligned to 16 or 256 pixels instead of 4 or 8 as required by the hardware. Fix it by rounding and clamping the width and height manually. Closes: https://lore.kernel.org/linux-media/CAJ+vNU0BOVLTL17ofgHwtexbpuMYwH_aGUC==EXABUtHHiv_ag@mail.gmail.com Reported-by: Tim Harvey Fixes: 6f482c4729d9 ("media: imx: imx7-media-csi: Get rid of superfluous call to imx7_csi_mbus_fmt_to_pix_fmt") Co-developed-by: Alexander Stein Signed-off-by: Alexander Stein Signed-off-by: Fabio Estevam Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit cf3f15b8c6601c1dc70f85949788ee993dd9a439 Author: Harshit Mogalapalli Date: Wed Aug 9 00:18:11 2023 -0700 mmc: sunplus: Fix error handling in spmmc_drv_probe() When mmc allocation succeeds, the error paths are not freeing mmc. Fix the above issue by changing mmc_alloc_host() to devm_mmc_alloc_host() to simplify the error handling. Remove label 'probe_free_host' as devm_* api takes care of freeing, also remove mmc_free_host() from remove function as devm_* takes care of freeing. Fixes: 4e268fed8b18 ("mmc: Add mmc driver for Sunplus SP7021") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/a3829ed3-d827-4b9d-827e-9cc24a3ec3bc@moroto.mountain/ Signed-off-by: Harshit Mogalapalli Reviewed-by: Dan Carpenter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230809071812.547229-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Ulf Hansson commit dce6d8f985fa1ef5c2af47f4f86ea65511b78656 Author: Wei Chen Date: Thu Jun 22 09:02:33 2023 +0000 mmc: sunplus: fix return value check of mmc_add_host() mmc_add_host() may return error, if we ignore its return value, 1. the memory allocated in mmc_alloc_host() will be leaked 2. null-ptr-deref will happen when calling mmc_remove_host() in remove function spmmc_drv_remove() because deleting not added device. Fix this by checking the return value of mmc_add_host(). Moreover, I fixed the error handling path of spmmc_drv_probe() to clean up. Fixes: 4e268fed8b18 ("mmc: Add mmc driver for Sunplus SP7021") Cc: stable@vger.kernel.org Signed-off-by: Wei Chen Link: https://lore.kernel.org/r/20230622090233.188539-1-harperchen1110@gmail.com Signed-off-by: Ulf Hansson commit d83035433701919ac6db15f7737cbf554c36c1a6 Author: Yang Yingliang Date: Mon Aug 7 20:44:42 2023 +0800 mmc: wbsd: fix double mmc_free_host() in wbsd_init() mmc_free_host() has already be called in wbsd_free_mmc(), remove the mmc_free_host() in error path in wbsd_init(). Fixes: dc5b9b50fc9d ("mmc: wbsd: fix return value check of mmc_add_host()") Signed-off-by: Yang Yingliang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230807124443.3431366-1-yangyingliang@huawei.com Signed-off-by: Ulf Hansson commit c992fde9f977da9beec584528f9026d21c27a053 Merge: d0378ae6d16ca 30c3c4a4497c3 Author: David S. Miller Date: Wed Aug 9 11:20:29 2023 +0100 Merge branch 'smc-fixes' Gerd Bayer says: ==================== net/smc: Fix effective buffer size commit 0227f058aa29 ("net/smc: Unbind r/w buffer size from clcsock and make them tunable") started to derive the effective buffer size for SMC connections inconsistently in case a TCP fallback was used and memory consumption of SMC with the default settings was doubled when a connection negotiated SMC. That was not what we want. This series consolidates the resulting effective buffer size that is used with SMC sockets, which is based on Jan Karcher's effort (see [1]). For all TCP exchanges (in particular in case of a fall back when no SMC connection was possible) the values from net.ipv4.tcp_[rw]mem are used. If SMC succeeds in establishing a SMC connection, the newly introduced values from net.smc.[rw]mem are used. net.smc.[rw]mem is initialized to 64kB, respectively. Internal test have show this to be a good compromise between throughput/latency and memory consumption. Also net.smc.[rw]mem is now decoupled completely from any tuning through net.ipv4.tcp_[rw]mem. If a user chose to tune a socket's receive or send buffer size with setsockopt, this tuning is now consistently applied to either fall-back TCP or proper SMC connections over the socket. Thanks, Gerd v2 - v3: - Rebase to and resolve conflict of second patch with latest net/master. v1 - v2: - In second patch, use sock_net() helper as suggested by Tony and demanded by kernel test robot. ==================== Signed-off-by: David S. Miller commit 30c3c4a4497c3765bf6b298f5072c8165aeaf7cc Author: Gerd Bayer Date: Fri Aug 4 19:06:24 2023 +0200 net/smc: Use correct buffer sizes when switching between TCP and SMC Tuning of the effective buffer size through setsockopts was working for SMC traffic only but not for TCP fall-back connections even before commit 0227f058aa29 ("net/smc: Unbind r/w buffer size from clcsock and make them tunable"). That change made it apparent that TCP fall-back connections would use net.smc.[rw]mem as buffer size instead of net.ipv4_tcp_[rw]mem. Amend the code that copies attributes between the (TCP) clcsock and the SMC socket and adjust buffer sizes appropriately: - Copy over sk_userlocks so that both sockets agree on whether tuning via setsockopt is active. - When falling back to TCP use sk_sndbuf or sk_rcvbuf as specified with setsockopt. Otherwise, use the sysctl value for TCP/IPv4. - Likewise, use either values from setsockopt or from sysctl for SMC (duplicated) on successful SMC connect. In smc_tcp_listen_work() drop the explicit copy of buffer sizes as that is taken care of by the attribute copy. Fixes: 0227f058aa29 ("net/smc: Unbind r/w buffer size from clcsock and make them tunable") Reviewed-by: Wenjia Zhang Reviewed-by: Tony Lu Signed-off-by: Gerd Bayer Signed-off-by: David S. Miller commit 833bac7ec392bf75053c8a4fa4c36d4148dac77d Author: Gerd Bayer Date: Fri Aug 4 19:06:23 2023 +0200 net/smc: Fix setsockopt and sysctl to specify same buffer size again Commit 0227f058aa29 ("net/smc: Unbind r/w buffer size from clcsock and make them tunable") introduced the net.smc.rmem and net.smc.wmem sysctls to specify the size of buffers to be used for SMC type connections. This created a regression for users that specified the buffer size via setsockopt() as the effective buffer size was now doubled. Re-introduce the division by 2 in the SMC buffer create code and level this out by duplicating the net.smc.[rw]mem values used for initializing sk_rcvbuf/sk_sndbuf at socket creation time. This gives users of both methods (setsockopt or sysctl) the effective buffer size that they expect. Initialize net.smc.[rw]mem from its own constant of 64kB, respectively. Internal performance tests show that this value is a good compromise between throughput/latency and memory consumption. Also, this decouples it from any tuning that was done to net.ipv4.tcp_[rw]mem[1] before the module for SMC protocol was loaded. Check that no more than INT_MAX / 2 is assigned to net.smc.[rw]mem, in order to avoid any overflow condition when that is doubled for use in sk_sndbuf or sk_rcvbuf. While at it, drop the confusing sk_buf_size variable from __smc_buf_create and name "compressed" buffer size variables more consistently. Background: Before the commit mentioned above, SMC's buffer allocator in __smc_buf_create() always used half of the sockets' sk_rcvbuf/sk_sndbuf value as initial value to search for appropriate buffers. If the search resorted to using a bigger buffer when all buffers of the specified size were busy, the duplicate of the used effective buffer size is stored back to sk_rcvbuf/sk_sndbuf. When available, buffers of exactly the size that a user had specified as input to setsockopt() were used, despite setsockopt()'s documentation in "man 7 socket" talking of a mandatory duplication: [...] SO_SNDBUF Sets or gets the maximum socket send buffer in bytes. The kernel doubles this value (to allow space for book‐ keeping overhead) when it is set using setsockopt(2), and this doubled value is returned by getsockopt(2). The default value is set by the /proc/sys/net/core/wmem_default file and the maximum allowed value is set by the /proc/sys/net/core/wmem_max file. The minimum (doubled) value for this option is 2048. [...] Fixes: 0227f058aa29 ("net/smc: Unbind r/w buffer size from clcsock and make them tunable") Co-developed-by: Jan Karcher Signed-off-by: Jan Karcher Reviewed-by: Wenjia Zhang Reviewed-by: Tony Lu Signed-off-by: Gerd Bayer Signed-off-by: David S. Miller commit d0378ae6d16cac86579c0350d275741fd898ba08 Merge: 0fb1d8eb234b6 bfce089ddd0e4 Author: David S. Miller Date: Wed Aug 9 09:18:31 2023 +0100 Merge branch 'enetc-probe-fix' Vladimir Oltean says: ==================== Fix ENETC probing after 6fffbc7ae137 ("PCI: Honor firmware's device disabled status") I'm not sure who should take this patch set (net maintainers or PCI maintainers). Everyone could pick up just their part, and that would work (no compile time dependencies). However, the entire series needs ACK from both sides and Rob for sure. v1 at: https://lore.kernel.org/netdev/20230521115141.2384444-1-vladimir.oltean@nxp.com/ ==================== Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit bfce089ddd0e440d799717cb7312b44faac47983 Author: Vladimir Oltean Date: Thu Aug 3 16:58:58 2023 +0300 net: enetc: remove of_device_is_available() handling Since commit 6fffbc7ae137 ("PCI: Honor firmware's device disabled status"), this is redundant and does nothing, because enetc_pf_probe() no longer even gets called. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f0168042a21292d20007d24ab2e4fc32f79ebf11 Author: Vladimir Oltean Date: Thu Aug 3 16:58:57 2023 +0300 net: enetc: reimplement RFS/RSS memory clearing as PCI quirk The workaround implemented in commit 3222b5b613db ("net: enetc: initialize RFS/RSS memories for unused ports too") is no longer effective after commit 6fffbc7ae137 ("PCI: Honor firmware's device disabled status"). Thus, it has introduced a regression and we see AER errors being reported again: $ ip link set sw2p0 up && dhclient -i sw2p0 && ip addr show sw2p0 fsl_enetc 0000:00:00.2 eno2: configuring for fixed/internal link mode fsl_enetc 0000:00:00.2 eno2: Link is Up - 2.5Gbps/Full - flow control rx/tx mscc_felix 0000:00:00.5 swp2: configuring for fixed/sgmii link mode mscc_felix 0000:00:00.5 swp2: Link is Up - 1Gbps/Full - flow control off sja1105 spi2.2 sw2p0: configuring for phy/rgmii-id link mode sja1105 spi2.2 sw2p0: Link is Up - 1Gbps/Full - flow control off pcieport 0000:00:1f.0: AER: Multiple Corrected error received: 0000:00:00.0 pcieport 0000:00:1f.0: AER: can't find device of ID0000 Rob's suggestion is to reimplement the enetc driver workaround as a PCI fixup, and to modify the PCI core to run the fixups for all PCI functions. This change handles the first part. We refactor the common code in enetc_psi_create() and enetc_psi_destroy(), and use the PCI fixup only for those functions for which enetc_pf_probe() won't get called. This avoids some work being done twice for the PFs which are enabled. Fixes: 6fffbc7ae137 ("PCI: Honor firmware's device disabled status") Link: https://lore.kernel.org/netdev/CAL_JsqLsVYiPLx2kcHkDQ4t=hQVCR7NHziDwi9cCFUFhx48Qow@mail.gmail.com/ Suggested-by: Rob Herring Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 1a8c251cff2052b60009a070173308322e9600d3 Author: Vladimir Oltean Date: Thu Aug 3 16:58:56 2023 +0300 PCI: move OF status = "disabled" detection to dev->match_driver The blamed commit has broken probing on arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi when &enetc_port0 (PCI function 0) has status = "disabled". Background: pci_scan_slot() has logic to say that if the function 0 of a device is absent, the entire device is absent and we can skip the other functions entirely. Traditionally, this has meant that pci_bus_read_dev_vendor_id() returns an error code for that function. However, since the blamed commit, there is an extra confounding condition: function 0 of the device exists and has a valid vendor id, but it is disabled in the device tree. In that case, pci_scan_slot() would incorrectly skip the entire device instead of just that function. In the case of NXP LS1028A, status = "disabled" does not mean that the PCI function's config space is not available for reading. It is, but the Ethernet port is just not functionally useful with a particular SerDes protocol configuration (0x9999) due to pinmuxing constraints of the Soc. So, pci_scan_slot() skips all other functions on the ENETC ECAM (enetc_port1, enetc_port2, enetc_mdio_pf3 etc) when just enetc_port0 had to not be probed. There is an additional regression introduced by the change, caused by its fundamental premise. The enetc driver needs to run code for all PCI functions, regardless of whether they're enabled or not in the device tree. That is no longer possible if the driver's probe function is no longer called. But Rob recommends that we move the of_device_is_available() detection to dev->match_driver, and this makes the PCI fixups still run on all functions, while just probing drivers for those functions that are enabled. So, a separate change in the enetc driver will have to move the workarounds to a PCI fixup. Fixes: 6fffbc7ae137 ("PCI: Honor firmware's device disabled status") Link: https://lore.kernel.org/netdev/CAL_JsqLsVYiPLx2kcHkDQ4t=hQVCR7NHziDwi9cCFUFhx48Qow@mail.gmail.com/ Suggested-by: Rob Herring Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 0fb1d8eb234b6979d4981d2d385780dd7d8d9771 Author: Piotr Gardocki Date: Mon Aug 7 13:50:11 2023 -0700 iavf: fix potential races for FDIR filters Add fdir_fltr_lock locking in unprotected places. The change in iavf_fdir_is_dup_fltr adds a spinlock around a loop which iterates over all filters and looks for a duplicate. The filter can be removed from list and freed from memory at the same time it's being compared. All other places where filters are deleted are already protected with spinlock. The remaining changes protect adapter->fdir_active_fltr variable so now all its uses are under a spinlock. Fixes: 527691bf0682 ("iavf: Support IPv4 Flow Director filters") Signed-off-by: Piotr Gardocki Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230807205011.3129224-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 06b412589eef780b792e73df131d35dc43cc4a49 Author: Muhammad Husaini Zulkifli Date: Mon Aug 7 13:51:29 2023 -0700 igc: Add lock to safeguard global Qbv variables Access to shared variables through hrtimer requires locking in order to protect the variables because actions to write into these variables (oper_gate_closed, admin_gate_closed, and qbv_transition) might potentially occur simultaneously. This patch provides a locking mechanisms to avoid such scenarios. Fixes: 175c241288c0 ("igc: Fix TX Hang issue when QBV Gate is closed") Suggested-by: Leon Romanovsky Signed-off-by: Muhammad Husaini Zulkifli Tested-by: Naama Meir Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20230807205129.3129346-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit b9077ef4c1368b5a51852facc53c24fcd234e910 Merge: 81f3768d91ac5 548ee049b19fb Author: Jakub Kicinski Date: Tue Aug 8 16:33:18 2023 -0700 Merge tag 'mlx5-fixes-2023-08-07' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2023-08-07 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2023-08-07' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: Add capability check for vnic counters net/mlx5: Reload auxiliary devices in pci error handlers net/mlx5: Skip clock update work when device is in error state net/mlx5: LAG, Check correct bucket when modifying LAG net/mlx5e: Unoffload post act rule when handling FIB events net/mlx5: Fix devlink controller number for ECVF net/mlx5: Allow 0 for total host VFs net/mlx5: Return correct EC_VF function ID net/mlx5: DR, Fix wrong allocation of modify hdr pattern net/mlx5e: TC, Fix internal port memory leak net/mlx5e: Take RTNL lock when needed before calling xdp_set_features() ==================== Link: https://lore.kernel.org/r/20230807212607.50883-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 81f3768d91ac535528e9a7ad07cfefe5c705629f Merge: b6f79e826fbd2 ac6257a3ae5db Author: Jakub Kicinski Date: Tue Aug 8 16:13:07 2023 -0700 Merge branch 'there-are-some-bugfix-for-the-hns3-ethernet-driver' Jijie Shao says: ==================== There are some bugfix for the HNS3 ethernet driver There are some bugfix for the HNS3 ethernet driver v1: https://lore.kernel.org/all/20230728075840.4022760-2-shaojijie@huawei.com/ ==================== Link: https://lore.kernel.org/r/20230807113452.474224-1-shaojijie@huawei.com Signed-off-by: Jakub Kicinski commit ac6257a3ae5db5193b1f19c268e4f72d274ddb88 Author: Yonglong Liu Date: Mon Aug 7 19:34:52 2023 +0800 net: hns3: fix deadlock issue when externel_lb and reset are executed together When externel_lb and reset are executed together, a deadlock may occur: [ 3147.217009] INFO: task kworker/u321:0:7 blocked for more than 120 seconds. [ 3147.230483] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 3147.238999] task:kworker/u321:0 state:D stack: 0 pid: 7 ppid: 2 flags:0x00000008 [ 3147.248045] Workqueue: hclge hclge_service_task [hclge] [ 3147.253957] Call trace: [ 3147.257093] __switch_to+0x7c/0xbc [ 3147.261183] __schedule+0x338/0x6f0 [ 3147.265357] schedule+0x50/0xe0 [ 3147.269185] schedule_preempt_disabled+0x18/0x24 [ 3147.274488] __mutex_lock.constprop.0+0x1d4/0x5dc [ 3147.279880] __mutex_lock_slowpath+0x1c/0x30 [ 3147.284839] mutex_lock+0x50/0x60 [ 3147.288841] rtnl_lock+0x20/0x2c [ 3147.292759] hclge_reset_prepare+0x68/0x90 [hclge] [ 3147.298239] hclge_reset_subtask+0x88/0xe0 [hclge] [ 3147.303718] hclge_reset_service_task+0x84/0x120 [hclge] [ 3147.309718] hclge_service_task+0x2c/0x70 [hclge] [ 3147.315109] process_one_work+0x1d0/0x490 [ 3147.319805] worker_thread+0x158/0x3d0 [ 3147.324240] kthread+0x108/0x13c [ 3147.328154] ret_from_fork+0x10/0x18 In externel_lb process, the hns3 driver call napi_disable() first, then the reset happen, then the restore process of the externel_lb will fail, and will not call napi_enable(). When doing externel_lb again, napi_disable() will be double call, cause a deadlock of rtnl_lock(). This patch use the HNS3_NIC_STATE_DOWN state to protect the calling of napi_disable() and napi_enable() in externel_lb process, just as the usage in ndo_stop() and ndo_start(). Fixes: 04b6ba143521 ("net: hns3: add support for external loopback test") Signed-off-by: Yonglong Liu Signed-off-by: Jijie Shao Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20230807113452.474224-5-shaojijie@huawei.com Signed-off-by: Jakub Kicinski commit 6265e242f7b95f2c1195b42ec912b84ad161470e Author: Jie Wang Date: Mon Aug 7 19:34:51 2023 +0800 net: hns3: add wait until mac link down In some configure flow of hns3 driver, for example, change mtu, it will disable MAC through firmware before configuration. But firmware disables MAC asynchronously. The rx traffic may be not stopped in this case. So fixes it by waiting until mac link is down. Fixes: a9775bb64aa7 ("net: hns3: fix set and get link ksettings issue") Signed-off-by: Jie Wang Signed-off-by: Jijie Shao Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20230807113452.474224-4-shaojijie@huawei.com Signed-off-by: Jakub Kicinski commit 08469dacfad25428b66549716811807203744f4f Author: Jie Wang Date: Mon Aug 7 19:34:50 2023 +0800 net: hns3: refactor hclge_mac_link_status_wait for interface reuse Some nic configurations could only be performed after link is down. So this patch refactor this API for reuse. Signed-off-by: Jie Wang Signed-off-by: Jijie Shao Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20230807113452.474224-3-shaojijie@huawei.com Signed-off-by: Jakub Kicinski commit 15159ec0c831b565820c2de05114ea1b4cf07681 Author: Jian Shen Date: Mon Aug 7 19:34:49 2023 +0800 net: hns3: restore user pause configure when disable autoneg Restore the mac pause state to user configuration when autoneg is disabled Signed-off-by: Jian Shen Signed-off-by: Peiyang Wang Signed-off-by: Jijie Shao Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20230807113452.474224-2-shaojijie@huawei.com Signed-off-by: Jakub Kicinski commit b6f79e826fbd26e91e2fb28070484634cacdeb26 Author: David Rheinsberg Date: Mon Aug 7 10:12:25 2023 +0200 net/unix: use consistent error code in SO_PEERPIDFD Change the new (unreleased) SO_PEERPIDFD sockopt to return ENODATA rather than ESRCH if a socket type does not support remote peer-PID queries. Currently, SO_PEERPIDFD returns ESRCH when the socket in question is not an AF_UNIX socket. This is quite unexpected, given that one would assume ESRCH means the peer process already exited and thus cannot be found. However, in that case the sockopt actually returns EINVAL (via pidfd_prepare()). This is rather inconsistent with other syscalls, which usually return ESRCH if a given PID refers to a non-existant process. This changes SO_PEERPIDFD to return ENODATA instead. This is also what SO_PEERGROUPS returns, and thus keeps a consistent behavior across sockopts. Note that this code is returned in 2 cases: First, if the socket type is not AF_UNIX, and secondly if the socket was not yet connected. In both cases ENODATA seems suitable. Signed-off-by: David Rheinsberg Reviewed-by: Christian Brauner Acked-by: Luca Boccassi Fixes: 7b26952a91cf ("net: core: add getsockopt SO_PEERPIDFD") Link: https://lore.kernel.org/r/20230807081225.816199-1-david@readahead.eu Signed-off-by: Jakub Kicinski commit d2402048bc8a206a56fde4bc41dd01336c7b5a21 Author: Nick Desaulniers Date: Tue Aug 8 09:35:00 2023 -0700 riscv: mm: fix 2 instances of -Wmissing-variable-declarations I'm looking to enable -Wmissing-variable-declarations behind W=1. 0day bot spotted the following instance in ARCH=riscv builds: arch/riscv/mm/init.c:276:7: warning: no previous extern declaration for non-static variable 'trampoline_pg_dir' [-Wmissing-variable-declarations] 276 | pgd_t trampoline_pg_dir[PTRS_PER_PGD] __page_aligned_bss; | ^ arch/riscv/mm/init.c:276:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit 276 | pgd_t trampoline_pg_dir[PTRS_PER_PGD] __page_aligned_bss; | ^ arch/riscv/mm/init.c:279:7: warning: no previous extern declaration for non-static variable 'early_pg_dir' [-Wmissing-variable-declarations] 279 | pgd_t early_pg_dir[PTRS_PER_PGD] __initdata __aligned(PAGE_SIZE); | ^ arch/riscv/mm/init.c:279:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit 279 | pgd_t early_pg_dir[PTRS_PER_PGD] __initdata __aligned(PAGE_SIZE); | ^ These symbols are referenced by more than one translation unit, so make sure they're both declared and include the correct header for their declarations. Finally, sort the list of includes to help keep them tidy. Reported-by: kernel test robot Closes: https://lore.kernel.org/llvm/202308081000.tTL1ElTr-lkp@intel.com/ Signed-off-by: Nick Desaulniers Link: https://lore.kernel.org/r/20230808-riscv_static-v2-1-2a1e2d2c7a4f@google.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 4eb2eb1b4c0eb07793c240744843498564a67b83 Author: Andrea Parri Date: Thu Aug 3 06:27:38 2023 +0200 riscv,mmio: Fix readX()-to-delay() ordering Section 2.1 of the Platform Specification [1] states: Unless otherwise specified by a given I/O device, I/O devices are on ordering channel 0 (i.e., they are point-to-point strongly ordered). which is not sufficient to guarantee that a readX() by a hart completes before a subsequent delay() on the same hart (cf. memory-barriers.txt, "Kernel I/O barrier effects"). Set the I(nput) bit in __io_ar() to restore the ordering, align inline comments. [1] https://github.com/riscv/riscv-platform-specs Signed-off-by: Andrea Parri Link: https://lore.kernel.org/r/20230803042738.5937-1-parri.andrea@gmail.com Fixes: fab957c11efe ("RISC-V: Atomic and Locking Code") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 6514f81e1bd55cbe419a5001a4ce910acc276211 Author: Samuel Holland Date: Wed Aug 2 18:26:06 2023 -0700 riscv: Fix CPU feature detection with SMP disabled commit 914d6f44fc50 ("RISC-V: only iterate over possible CPUs in ISA string parser") changed riscv_fill_hwcap() from iterating over CPU DT nodes to iterating over logical CPU IDs. Since this function runs long before cpu_dev_init() creates CPU devices, it hits the fallback path in of_cpu_device_node_get(), which itself iterates over the DT nodes, searching for a node with the requested CPU ID. (Incidentally, this makes riscv_fill_hwcap() now take quadratic time.) riscv_fill_hwcap() passes a logical CPU ID to of_cpu_device_node_get(), which uses the arch_match_cpu_phys_id() hook to translate the logical ID to a physical ID as found in the DT. arch_match_cpu_phys_id() has a generic weak definition, and RISC-V provides a strong definition using cpuid_to_hartid_map(). However, the RISC-V specific implementation is located in arch/riscv/kernel/smp.c, and that file is only compiled when SMP is enabled. As a result, when SMP is disabled, the generic definition is used, and riscv_isa gets initialized based on the ISA string of hart 0, not the boot hart. On FU740, this means has_fpu() returns false, and userspace crashes when trying to use floating-point instructions. Fix this by moving arch_match_cpu_phys_id() to a file which is always compiled. Fixes: 70114560b285 ("RISC-V: Add RISC-V specific arch_match_cpu_phys_id") Fixes: 914d6f44fc50 ("RISC-V: only iterate over possible CPUs in ISA string parser") Reported-by: Palmer Dabbelt Signed-off-by: Samuel Holland Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230803012608.3540081-1-samuel.holland@sifive.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 13b9372068660fe4f7023f43081067376582ef3c Merge: 02aee814d37c5 cdddb626dc053 Author: Linus Torvalds Date: Tue Aug 8 14:59:49 2023 -0700 Merge tag 'hardening-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening fixes from Kees Cook: - Replace remaining open-coded struct_size_t() instance (Gustavo A. R. Silva) - Adjust vboxsf's trailing arrays to be proper flexible arrays * tag 'hardening-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: media: venus: Use struct_size_t() helper in pkt_session_unset_buffers() vboxsf: Use flexible arrays for trailing string member commit d74f714896fd6268882789ba28e52c9145951403 Author: Jens Axboe Date: Tue Aug 8 11:03:28 2023 -0600 block: get rid of unused plug->nowait flag This was introduced to add a plug based way of signaling nowait issues, but we have since moved on from that. Kill the old dead code, nobody is setting it anymore. Reviewed-by: Chaitanya Kulkarni Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit fa40ea27ede397cb19b8cb264f136db9c43c6f7e Author: Claudiu Beznea Date: Fri Aug 4 08:00:07 2023 +0300 MAINTAINERS: update Claudiu Beznea's email address Update MAINTAINERS entries with a valid email address as the Microchip one is no longer valid. Acked-by: Conor Dooley Acked-by: Nicolas Ferre Signed-off-by: Claudiu Beznea Acked-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230804050007.235799-1-claudiu.beznea@tuxon.dev Signed-off-by: Jakub Kicinski commit 7324f74d39531262b8e362f228b46512e6bee632 Author: Jinghao Jia Date: Tue Aug 8 14:23:53 2023 -0400 x86/linkage: Fix typo of BUILD_VDSO in asm/linkage.h The BUILD_VDSO macro was incorrectly spelled as BULID_VDSO in asm/linkage.h. This causes the !defined(BULID_VDSO) directive to always evaluate to true. Correct the spelling to BUILD_VDSO. Fixes: bea75b33895f ("x86/Kconfig: Introduce function padding") Signed-off-by: Jinghao Jia Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Thomas Gleixner Acked-by: Randy Dunlap Cc: Link: https://lore.kernel.org/r/20230808182353.76218-1-jinghao@linux.ibm.com commit cc22522fd55e257c86d340ae9aedc122e705a435 Author: Igor Mammedov Date: Wed Jul 26 14:35:18 2023 +0200 PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus 40613da52b13 ("PCI: acpiphp: Reassign resources on bridge if necessary") changed acpiphp hotplug to use pci_assign_unassigned_bridge_resources() which depends on bridge being available, however enable_slot() can be called without bridge associated: 1. Legitimate case of hotplug on root bus (widely used in virt world) 2. A (misbehaving) firmware, that sends ACPI Bus Check notifications to non existing root ports (Dell Inspiron 7352/0W6WV0), which end up at enable_slot(..., bridge = 0) where bus has no bridge assigned to it. acpihp doesn't know that it's a bridge, and bus specific 'PCI subsystem' can't augment ACPI context with bridge information since the PCI device to get this data from is/was not available. Issue is easy to reproduce with QEMU's 'pc' machine, which supports PCI hotplug on hostbridge slots. To reproduce, boot kernel at commit 40613da52b13 in VM started with following CLI (assuming guest root fs is installed on sda1 partition): # qemu-system-x86_64 -M pc -m 1G -enable-kvm -cpu host \ -monitor stdio -serial file:serial.log \ -kernel arch/x86/boot/bzImage \ -append "root=/dev/sda1 console=ttyS0" \ guest_disk.img Once guest OS is fully booted at qemu prompt: (qemu) device_add e1000 (check serial.log) it will cause NULL pointer dereference at: void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge) { struct pci_bus *parent = bridge->subordinate; BUG: kernel NULL pointer dereference, address: 0000000000000018 ? pci_assign_unassigned_bridge_resources+0x1f/0x260 enable_slot+0x21f/0x3e0 acpiphp_hotplug_notify+0x13d/0x260 acpi_device_hotplug+0xbc/0x540 acpi_hotplug_work_fn+0x15/0x20 process_one_work+0x1f7/0x370 worker_thread+0x45/0x3b0 The issue was discovered on Dell Inspiron 7352/0W6WV0 laptop with following sequence: 1. Suspend to RAM 2. Wake up with the same backtrace being observed: 3. 2nd suspend to RAM attempt makes laptop freeze Fix it by using __pci_bus_assign_resources() instead of pci_assign_unassigned_bridge_resources() as we used to do, but only in case when bus doesn't have a bridge associated (to cover for the case of ACPI event on hostbridge or non existing root port). That lets us keep hotplug on root bus working like it used to and at the same time keeps resource reassignment usable on root ports (and other 1st level bridges) that was fixed by 40613da52b13. Fixes: 40613da52b13 ("PCI: acpiphp: Reassign resources on bridge if necessary") Link: https://lore.kernel.org/r/20230726123518.2361181-2-imammedo@redhat.com Reported-by: Woody Suwalski Tested-by: Woody Suwalski Tested-by: Michal Koutný Link: https://lore.kernel.org/r/11fc981c-af49-ce64-6b43-3e282728bd1a@gmail.com Signed-off-by: Igor Mammedov Signed-off-by: Bjorn Helgaas Acked-by: Rafael J. Wysocki Acked-by: Michael S. Tsirkin commit 56675f8b9f9b15b024b8e3145fa289b004916ab7 Author: Helge Deller Date: Mon Aug 7 20:04:09 2023 +0200 io_uring/parisc: Adjust pgoff in io_uring mmap() for parisc The changes from commit 32832a407a71 ("io_uring: Fix io_uring mmap() by using architecture-provided get_unmapped_area()") to the parisc implementation of get_unmapped_area() broke glibc's locale-gen executable when running on parisc. This patch reverts those architecture-specific changes, and instead adjusts in io_uring_mmu_get_unmapped_area() the pgoff offset which is then given to parisc's get_unmapped_area() function. This is much cleaner than the previous approach, and we still will get a coherent addresss. This patch has no effect on other architectures (SHM_COLOUR is only defined on parisc), and the liburing testcase stil passes on parisc. Cc: stable@vger.kernel.org # 6.4 Signed-off-by: Helge Deller Reported-by: Christoph Biedl Fixes: 32832a407a71 ("io_uring: Fix io_uring mmap() by using architecture-provided get_unmapped_area()") Fixes: d808459b2e31 ("io_uring: Adjust mapping wrt architecture aliasing requirements") Link: https://lore.kernel.org/r/ZNEyGV0jyI8kOOfz@p100 Signed-off-by: Jens Axboe commit 8e7b295da1ed051baedd068b7f785f5d959ef95d Author: Junxian Huang Date: Mon Aug 7 14:42:28 2023 +0800 MAINTAINERS: Remove maintainer of HiSilicon RoCE Haoyue no longer maintains the Hisilicon RoCE driver. So remove him from MAINTAINERS. Signed-off-by: Junxian Huang Link: https://lore.kernel.org/r/20230807064228.4032536-1-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit 487ae3b42d1040b4cd5ff9754e7516b409204029 Author: Ian Rogers Date: Tue Aug 1 13:54:52 2023 -0700 perf stat: Don't display zero tool counts Andi reported (see link below) a regression when printing the 'duration_time' tool event, where it gets printed as "not counted" for most of the CPUs, fix it by skipping zero counts for tool events. Reported-by: Andi Kleen Signed-off-by: Ian Rogers Tested-by: Andi Kleen Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Athira Rajeev Cc: Claire Jensen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/all/ZMlrzcVrVi1lTDmn@tassilo/ Signed-off-by: Arnaldo Carvalho de Melo commit 02aee814d37c563e24b73bcd0f9cb608fbd403d4 Merge: da703fe9416d7 0be8432166a61 Author: Linus Torvalds Date: Tue Aug 8 09:27:08 2023 -0700 Merge tag 'gfs2-v6.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 fixes from Andreas Gruenbacher: - Fix a freeze consistency check in gfs2_trans_add_meta() - Don't use filemap_splice_read as it can cause deadlocks on gfs2 * tag 'gfs2-v6.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Don't use filemap_splice_read gfs2: Fix freeze consistency check in gfs2_trans_add_meta commit 1963546390ed8b649f529993a755eba0fdeb7aaa Author: Karol Wachowski Date: Wed Aug 2 08:37:35 2023 +0200 accel/ivpu: Add set_pages_array_wc/uc for internal buffers Buffers mapped with pgprot_writecombined() are not correctly flushed. This triggers issues on VPU access using random memory content such as MMU translation faults, invalid context descriptors being fetched and can lead to VPU FW crashes. Fixes: 647371a6609d ("accel/ivpu: Add GEM buffer object management") Cc: stable@vger.kernel.org # 6.3+ Signed-off-by: Karol Wachowski Reviewed-by: Stanislaw Gruszka Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230802063735.3005291-1-stanislaw.gruszka@linux.intel.com commit 12acb348fa4528a4203edf1cce7a3be2c9af2279 Author: Maulik Shah Date: Mon Jul 3 14:25:54 2023 +0530 cpuidle: psci: Move enabling OSI mode after power domains creation A switch from OSI to PC mode is only possible if all CPUs other than the calling one are OFF, either through a call to CPU_OFF or not yet booted. Currently OSI mode is enabled before power domains are created. In cases where CPUidle states are not using hierarchical CPU topology the bail out path tries to switch back to PC mode which gets denied by firmware since other CPUs are online at this point and creates inconsistent state as firmware is in OSI mode and Linux in PC mode. This change moves enabling OSI mode after power domains are created, this would makes sure that hierarchical CPU topology is used before switching firmware to OSI mode. Cc: stable@vger.kernel.org Fixes: 70c179b49870 ("cpuidle: psci: Allow PM domain to be initialized even if no OSI mode") Signed-off-by: Maulik Shah Reviewed-by: Ulf Hansson Signed-off-by: Ulf Hansson commit 9a8fa00dad3c7b260071f2f220cfb00505372c40 Author: Maulik Shah Date: Mon Jul 3 14:25:53 2023 +0530 cpuidle: dt_idle_genpd: Add helper function to remove genpd topology Genpd parent and child domain topology created using dt_idle_pd_init_topology() needs to be removed during error cases. Add new helper function dt_idle_pd_remove_topology() for same. Cc: stable@vger.kernel.org Reviewed-by: Ulf Hanssson Signed-off-by: Maulik Shah Signed-off-by: Ulf Hansson commit 8cdd4aeff2e858c95bb088409028893cfb4e53d4 Author: Arnaldo Carvalho de Melo Date: Mon Aug 7 10:41:42 2023 -0300 tools arch x86: Sync the msr-index.h copy with the kernel sources To pick up the changes from these csets: 522b1d69219d8f08 ("x86/cpu/amd: Add a Zenbleed fix") That cause no changes to tooling: $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after $ diff -u before after $ Just silences this perf build warning: Warning: Kernel ABI header differences: diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h Cc: Adrian Hunter Cc: Borislav Petkov (AMD) Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ZND17H7BI4ariERn@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c0b067588a4836b762cfc6a4c83f122ca1dbb93a Author: Arnaldo Carvalho de Melo Date: Tue Aug 1 18:42:47 2023 -0300 Revert "perf report: Append inlines to non-DWARF callchains" This reverts commit 46d21ec067490ab9cdcc89b9de5aae28786a8b8e. The tests were made with a specific workload, further tests on a recently updated fedora 38 system with a system wide perf.data file shows 'perf report' taking excessive time resolving inlines in vmlinux, so lets revert this until a full investigation and improvement on the addr2line support code is made. Reported-by: Jesper Dangaard Brouer Acked-by: Artem Savkov Tested-by: Jesper Dangaard Brouer Cc: Andrii Nakryiko Cc: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Milian Wolff Cc: Peter Zijlstra Link: https://lore.kernel.org/r/ZMl8VyhdwhClTM5g@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 90219f1bd273055f1dc1d7bdc0965755b992c045 Author: Ranjani Sridharan Date: Tue Aug 8 14:06:27 2023 +0300 ASoC: SOF: intel: hda: Clean up link DMA for IPC3 during stop With IPC3, we reset hw_params during the stop trigger, so we should also clean up the link DMA during the stop trigger. Fixes: 1bf83fa6654c ("ASoC: SOF: Intel: hda-dai: Do not perform DMA cleanup during stop") Closes: https://github.com/thesofproject/linux/issues/4455 Closes: https://github.com/thesofproject/linux/issues/4482 Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217673 Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Guennadi Liakhovetski Reviewed-by: Bard Liao Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230808110627.32375-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 5fb9a9fb71a33be61d7d8e8ba4597bfb18d604d0 Author: Felix Fietkau Date: Thu Jun 22 18:59:19 2023 +0200 wifi: cfg80211: fix sband iftype data lookup for AP_VLAN AP_VLAN interfaces are virtual, so doesn't really exist as a type for capabilities. When passed in as a type, AP is the one that's really intended. Fixes: c4cbaf7973a7 ("cfg80211: Add support for HE") Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20230622165919.46841-1-nbd@nbd.name Signed-off-by: Johannes Berg commit b74bb07cdab6859e1a3fc9fe7351052176322ddf Author: Ping-Ke Shih Date: Tue Aug 8 08:54:26 2023 +0800 wifi: rtw89: fix 8852AE disconnection caused by RX full flags RX full flags are raised if certain types of RX FIFO are full, and then drop all following MPDU of AMPDU. In order to resume to receive MPDU when RX FIFO becomes available, we clear the register bits by the commit a0d99ebb3ecd ("wifi: rtw89: initialize DMA of CMAC"). But, 8852AE needs more settings to support this. To quickly fix disconnection problem, revert the behavior as before. Fixes: a0d99ebb3ecd ("wifi: rtw89: initialize DMA of CMAC") Reported-by: Damian B Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217710 Cc: Signed-off-by: Ping-Ke Shih Tested-by: Damian B Link: https://lore.kernel.org/r/20230808005426.5327-1-pkshih@realtek.com Signed-off-by: Johannes Berg commit 017e9420c1ca19bc169e20fa749709723eaf1eb7 Author: Larry Finger Date: Fri Aug 4 17:24:38 2023 -0500 MAINTAINERS: Remove tree entry for rtl8180 This entry is not needed. Remove it. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20230804222438.16076-3-Larry.Finger@lwfinger.net Signed-off-by: Johannes Berg commit 6a67fe45fe3fffb0721ba068e21103b94a1e57a0 Author: Larry Finger Date: Fri Aug 4 17:24:37 2023 -0500 MAINTAINERS: Update entry for rtl8187 As Herton Ronaldo Krzesinski is no longer active, remove him as maintainer for rtl8187. The git tree entry is also removed. Signed-off-by: Larry Finger Link: https://lore.kernel.org/r/20230804222438.16076-2-Larry.Finger@lwfinger.net Signed-off-by: Johannes Berg commit 07d698324110339b420deebab7a7805815340b4f Author: Petr Tesarik Date: Wed Aug 2 18:34:30 2023 +0200 wifi: brcm80211: handle params_v1 allocation failure Return -ENOMEM from brcmf_run_escan() if kzalloc() fails for v1 params. Fixes: 398ce273d6b1 ("wifi: brcmfmac: cfg80211: Add support for scan params v2") Signed-off-by: Petr Tesarik Link: https://lore.kernel.org/r/20230802163430.1656-1-petrtesarik@huaweicloud.com Signed-off-by: Johannes Berg commit d5712cd22b9cf109fded1b7f178f4c1888c8b84b Author: Karol Herbst Date: Sat Aug 5 12:18:13 2023 +0200 drm/nouveau/disp: Revert a NULL check inside nouveau_connector_get_modes The original commit adding that check tried to protect the kenrel against a potential invalid NULL pointer access. However we call nouveau_connector_detect_depth once without a native_mode set on purpose for non LVDS connectors and this broke DP support in a few cases. Cc: Olaf Skibbe Cc: Lyude Paul Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/238 Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/245 Fixes: 20a2ce87fbaf8 ("drm/nouveau/dp: check for NULL nv_connector->native_mode") Signed-off-by: Karol Herbst Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230805101813.2603989-1-kherbst@redhat.com commit 4b430d4ac99750ee2ae2f893f1055c7af1ec3dc5 Author: Yibin Ding Date: Wed Aug 2 10:30:23 2023 +0800 mmc: block: Fix in_flight[issue_type] value error For a completed request, after the mmc_blk_mq_complete_rq(mq, req) function is executed, the bitmap_tags corresponding to the request will be cleared, that is, the request will be regarded as idle. If the request is acquired by a different type of process at this time, the issue_type of the request may change. It further caused the value of mq->in_flight[issue_type] to be abnormal, and a large number of requests could not be sent. p1: p2: mmc_blk_mq_complete_rq blk_mq_free_request blk_mq_get_request blk_mq_rq_ctx_init mmc_blk_mq_dec_in_flight mmc_issue_type(mq, req) This strategy can ensure the consistency of issue_type before and after executing mmc_blk_mq_complete_rq. Fixes: 81196976ed94 ("mmc: block: Add blk-mq support") Cc: stable@vger.kernel.org Signed-off-by: Yibin Ding Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20230802023023.1318134-1-yunlong.xing@unisoc.com Signed-off-by: Ulf Hansson commit f48585c468f51ac038c2cfaafcd4437bc3746bce Merge: 3ddaa6a274578 596a5123cc782 Author: Greg Kroah-Hartman Date: Tue Aug 8 10:04:47 2023 +0200 Merge tag 'thunderbolt-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-linus Mika writes: thunderbolt: Fixes for v6.5-rc6 This includes two fixes for v6.5-rc6: - Correct display flickering when connecting a Thunderbolt 3 device to an AMD USB4 host controller - Fix a memory leak in bandwidth allocation request. Both have been in linux-next with no reported issues. * tag 'thunderbolt-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request() thunderbolt: Fix Thunderbolt 3 display flickering issue on 2nd hot plug onwards commit 39163d5479285a36522b6e8f9cc568cc4987db08 Author: Xin Li Date: Tue Mar 21 23:17:58 2023 -0700 x86/vdso: Choose the right GDT_ENTRY_CPUNODE for 32-bit getcpu() on 64-bit kernel The vDSO getcpu() reads CPU ID from the GDT_ENTRY_CPUNODE entry when the RDPID instruction is not available. And GDT_ENTRY_CPUNODE is defined as 28 on 32-bit Linux kernel and 15 on 64-bit. But the 32-bit getcpu() on 64-bit Linux kernel is compiled with 32-bit Linux kernel GDT_ENTRY_CPUNODE, i.e., 28, beyond the 64-bit Linux kernel GDT limit. Thus, it just fails _silently_. When BUILD_VDSO32_64 is defined, choose the 64-bit Linux kernel GDT definitions to compile the 32-bit getcpu(). Fixes: 877cff5296faa6e ("x86/vdso: Fake 32bit VDSO build on 64bit compile for vgetcpu") Reported-by: kernel test robot Reported-by: Shan Kang Signed-off-by: Xin Li Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230322061758.10639-1-xin3.li@intel.com Link: https://lore.kernel.org/oe-lkp/202303020903.b01fd1de-yujie.liu@intel.com commit 2aa71b4b294ee2c3041d085404cea914be9b3225 Author: Jonas Gorski Date: Fri Aug 4 12:12:20 2023 +0200 net: marvell: prestera: fix handling IPv4 routes with nhid Fix handling IPv4 routes referencing a nexthop via its id by replacing calls to fib_info_nh() with fib_info_nhc(). Trying to add an IPv4 route referencing a nextop via nhid: $ ip link set up swp5 $ ip a a 10.0.0.1/24 dev swp5 $ ip nexthop add dev swp5 id 20 via 10.0.0.2 $ ip route add 10.0.1.0/24 nhid 20 triggers warnings when trying to handle the route: [ 528.805763] ------------[ cut here ]------------ [ 528.810437] WARNING: CPU: 3 PID: 53 at include/net/nexthop.h:468 __prestera_fi_is_direct+0x2c/0x68 [prestera] [ 528.820434] Modules linked in: prestera_pci act_gact act_police sch_ingress cls_u32 cls_flower prestera arm64_delta_tn48m_dn_led(O) arm64_delta_tn48m_dn_cpld(O) [last unloaded: prestera_pci] [ 528.837485] CPU: 3 PID: 53 Comm: kworker/u8:3 Tainted: G O 6.4.5 #1 [ 528.845178] Hardware name: delta,tn48m-dn (DT) [ 528.849641] Workqueue: prestera_ordered __prestera_router_fib_event_work [prestera] [ 528.857352] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 528.864347] pc : __prestera_fi_is_direct+0x2c/0x68 [prestera] [ 528.870135] lr : prestera_k_arb_fib_evt+0xb20/0xd50 [prestera] [ 528.876007] sp : ffff80000b20bc90 [ 528.879336] x29: ffff80000b20bc90 x28: 0000000000000000 x27: ffff0001374d3a48 [ 528.886510] x26: ffff000105604000 x25: ffff000134af8a28 x24: ffff0001374d3800 [ 528.893683] x23: ffff000101c89148 x22: ffff000101c89000 x21: ffff000101c89200 [ 528.900855] x20: ffff00013641fda0 x19: ffff800009d01088 x18: 0000000000000059 [ 528.908027] x17: 0000000000000277 x16: 0000000000000000 x15: 0000000000000000 [ 528.915198] x14: 0000000000000003 x13: 00000000000fe400 x12: 0000000000000000 [ 528.922371] x11: 0000000000000002 x10: 0000000000000aa0 x9 : ffff8000013d2020 [ 528.929543] x8 : 0000000000000018 x7 : 000000007b1703f8 x6 : 000000001ca72f86 [ 528.936715] x5 : 0000000033399ea7 x4 : 0000000000000000 x3 : ffff0001374d3acc [ 528.943886] x2 : 0000000000000000 x1 : ffff00010200de00 x0 : ffff000134ae3f80 [ 528.951058] Call trace: [ 528.953516] __prestera_fi_is_direct+0x2c/0x68 [prestera] [ 528.958952] __prestera_router_fib_event_work+0x100/0x158 [prestera] [ 528.965348] process_one_work+0x208/0x488 [ 528.969387] worker_thread+0x4c/0x430 [ 528.973068] kthread+0x120/0x138 [ 528.976313] ret_from_fork+0x10/0x20 [ 528.979909] ---[ end trace 0000000000000000 ]--- [ 528.984998] ------------[ cut here ]------------ [ 528.989645] WARNING: CPU: 3 PID: 53 at include/net/nexthop.h:468 __prestera_fi_is_direct+0x2c/0x68 [prestera] [ 528.999628] Modules linked in: prestera_pci act_gact act_police sch_ingress cls_u32 cls_flower prestera arm64_delta_tn48m_dn_led(O) arm64_delta_tn48m_dn_cpld(O) [last unloaded: prestera_pci] [ 529.016676] CPU: 3 PID: 53 Comm: kworker/u8:3 Tainted: G W O 6.4.5 #1 [ 529.024368] Hardware name: delta,tn48m-dn (DT) [ 529.028830] Workqueue: prestera_ordered __prestera_router_fib_event_work [prestera] [ 529.036539] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 529.043533] pc : __prestera_fi_is_direct+0x2c/0x68 [prestera] [ 529.049318] lr : __prestera_k_arb_fc_apply+0x280/0x2f8 [prestera] [ 529.055452] sp : ffff80000b20bc60 [ 529.058781] x29: ffff80000b20bc60 x28: 0000000000000000 x27: ffff0001374d3a48 [ 529.065953] x26: ffff000105604000 x25: ffff000134af8a28 x24: ffff0001374d3800 [ 529.073126] x23: ffff000101c89148 x22: ffff000101c89148 x21: ffff00013641fda0 [ 529.080299] x20: ffff000101c89000 x19: ffff000101c89020 x18: 0000000000000059 [ 529.087471] x17: 0000000000000277 x16: 0000000000000000 x15: 0000000000000000 [ 529.094642] x14: 0000000000000003 x13: 00000000000fe400 x12: 0000000000000000 [ 529.101814] x11: 0000000000000002 x10: 0000000000000aa0 x9 : ffff8000013cee80 [ 529.108985] x8 : 0000000000000018 x7 : 000000007b1703f8 x6 : 0000000000000018 [ 529.116157] x5 : 00000000d3497eb6 x4 : ffff000105604081 x3 : 000000008e979557 [ 529.123329] x2 : 0000000000000000 x1 : ffff00010200de00 x0 : ffff000134ae3f80 [ 529.130501] Call trace: [ 529.132958] __prestera_fi_is_direct+0x2c/0x68 [prestera] [ 529.138394] prestera_k_arb_fib_evt+0x6b8/0xd50 [prestera] [ 529.143918] __prestera_router_fib_event_work+0x100/0x158 [prestera] [ 529.150313] process_one_work+0x208/0x488 [ 529.154348] worker_thread+0x4c/0x430 [ 529.158030] kthread+0x120/0x138 [ 529.161274] ret_from_fork+0x10/0x20 [ 529.164867] ---[ end trace 0000000000000000 ]--- and results in a non offloaded route: $ ip route 10.0.0.0/24 dev swp5 proto kernel scope link src 10.0.0.1 rt_trap 10.0.1.0/24 nhid 20 via 10.0.0.2 dev swp5 rt_trap When creating a route referencing a nexthop via its ID, the nexthop will be stored in a separate nh pointer instead of the array of nexthops in the fib_info struct. This causes issues since fib_info_nh() only handles the nexthops array, but not the separate nh pointer, and will loudly WARN about it. In contrast fib_info_nhc() handles both, but returns a fib_nh_common pointer instead of a fib_nh pointer. Luckily we only ever access fields from the fib_nh_common parts, so we can just replace all instances of fib_info_nh() with fib_info_nhc() and access the fields via their fib_nh_common names. This allows handling IPv4 routes with an external nexthop, and they now get offloaded as expected: $ ip route 10.0.0.0/24 dev swp5 proto kernel scope link src 10.0.0.1 rt_trap 10.0.1.0/24 nhid 20 via 10.0.0.2 dev swp5 offload rt_offload Fixes: 396b80cb5cc8 ("net: marvell: prestera: Add neighbour cache accounting") Signed-off-by: Jonas Gorski Acked-by: Elad Nachman Link: https://lore.kernel.org/r/20230804101220.247515-1-jonas.gorski@bisdn.de Signed-off-by: Jakub Kicinski commit d14eea09edf427fa36bd446f4a3271f99164202f Author: Andrew Kanner Date: Thu Aug 3 21:03:18 2023 +0200 net: core: remove unnecessary frame_sz check in bpf_xdp_adjust_tail() Syzkaller reported the following issue: ======================================= Too BIG xdp->frame_sz = 131072 WARNING: CPU: 0 PID: 5020 at net/core/filter.c:4121 ____bpf_xdp_adjust_tail net/core/filter.c:4121 [inline] WARNING: CPU: 0 PID: 5020 at net/core/filter.c:4121 bpf_xdp_adjust_tail+0x466/0xa10 net/core/filter.c:4103 ... Call Trace: bpf_prog_4add87e5301a4105+0x1a/0x1c __bpf_prog_run include/linux/filter.h:600 [inline] bpf_prog_run_xdp include/linux/filter.h:775 [inline] bpf_prog_run_generic_xdp+0x57e/0x11e0 net/core/dev.c:4721 netif_receive_generic_xdp net/core/dev.c:4807 [inline] do_xdp_generic+0x35c/0x770 net/core/dev.c:4866 tun_get_user+0x2340/0x3ca0 drivers/net/tun.c:1919 tun_chr_write_iter+0xe8/0x210 drivers/net/tun.c:2043 call_write_iter include/linux/fs.h:1871 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd xdp->frame_sz > PAGE_SIZE check was introduced in commit c8741e2bfe87 ("xdp: Allow bpf_xdp_adjust_tail() to grow packet size"). But Jesper Dangaard Brouer noted that after introducing the xdp_init_buff() which all XDP driver use - it's safe to remove this check. The original intend was to catch cases where XDP drivers have not been updated to use xdp.frame_sz, but that is not longer a concern (since xdp_init_buff). Running the initial syzkaller repro it was discovered that the contiguous physical memory allocation is used for both xdp paths in tun_get_user(), e.g. tun_build_skb() and tun_alloc_skb(). It was also stated by Jesper Dangaard Brouer that XDP can work on higher order pages, as long as this is contiguous physical memory (e.g. a page). Reported-and-tested-by: syzbot+f817490f5bd20541b90a@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/000000000000774b9205f1d8a80d@google.com/T/ Link: https://syzkaller.appspot.com/bug?extid=f817490f5bd20541b90a Link: https://lore.kernel.org/all/20230725155403.796-1-andrew.kanner@gmail.com/T/ Fixes: 43b5169d8355 ("net, xdp: Introduce xdp_init_buff utility routine") Signed-off-by: Andrew Kanner Acked-by: Jesper Dangaard Brouer Acked-by: Jason Wang Link: https://lore.kernel.org/r/20230803190316.2380231-1-andrew.kanner@gmail.com Signed-off-by: Jakub Kicinski commit 59eeb232940515590de513b997539ef495faca9a Author: Andrew Kanner Date: Thu Aug 3 20:59:48 2023 +0200 drivers: net: prevent tun_build_skb() to exceed the packet size limit Using the syzkaller repro with reduced packet size it was discovered that XDP_PACKET_HEADROOM is not checked in tun_can_build_skb(), although pad may be incremented in tun_build_skb(). This may end up with exceeding the PAGE_SIZE limit in tun_build_skb(). Jason Wang proposed to count XDP_PACKET_HEADROOM always (e.g. without rcu_access_pointer(tun->xdp_prog)) in tun_can_build_skb() since there's a window during which XDP program might be attached between tun_can_build_skb() and tun_build_skb(). Fixes: 7df13219d757 ("tun: reserve extra headroom only when XDP is set") Link: https://syzkaller.appspot.com/bug?extid=f817490f5bd20541b90a Signed-off-by: Andrew Kanner Link: https://lore.kernel.org/r/20230803185947.2379988-1-andrew.kanner@gmail.com Signed-off-by: Jakub Kicinski commit ef222f551e7c4e2008fc442ffc9edcd1a7fd8f63 Author: Nilesh Javali Date: Mon Aug 7 15:07:24 2023 +0530 scsi: qedf: Fix firmware halt over suspend and resume While performing certain power-off sequences, PCI drivers are called to suspend and resume their underlying devices through PCI PM (power management) interface. However the hardware does not support PCI PM suspend/resume operations so system wide suspend/resume leads to bad MFW (management firmware) state which causes various follow-up errors in driver when communicating with the device/firmware. To fix this driver implements PCI PM suspend handler to indicate unsupported operation to the PCI subsystem explicitly, thus avoiding system to go into suspended/standby mode. Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.") Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230807093725.46829-1-njavali@marvell.com Signed-off-by: Martin K. Petersen commit 1516ee035df32115197cd93ae3619dba7b020986 Author: Nilesh Javali Date: Mon Aug 7 15:07:25 2023 +0530 scsi: qedi: Fix firmware halt over suspend and resume While performing certain power-off sequences, PCI drivers are called to suspend and resume their underlying devices through PCI PM (power management) interface. However the hardware does not support PCI PM suspend/resume operations so system wide suspend/resume leads to bad MFW (management firmware) state which causes various follow-up errors in driver when communicating with the device/firmware. To fix this driver implements PCI PM suspend handler to indicate unsupported operation to the PCI subsystem explicitly, thus avoiding system to go into suspended/standby mode. Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.") Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230807093725.46829-2-njavali@marvell.com Signed-off-by: Martin K. Petersen commit dd64f80587190265ca8a0f4be6c64c2fda6d3ac2 Author: Chengfeng Ye Date: Wed Jul 26 12:56:55 2023 +0000 scsi: qedi: Fix potential deadlock on &qedi_percpu->p_work_lock As &qedi_percpu->p_work_lock is acquired by hard IRQ qedi_msix_handler(), other acquisitions of the same lock under process context should disable IRQ, otherwise deadlock could happen if the IRQ preempts the execution while the lock is held in process context on the same CPU. qedi_cpu_offline() is one such function which acquires the lock in process context. [Deadlock Scenario] qedi_cpu_offline() ->spin_lock(&p->p_work_lock) ->qedi_msix_handler() ->edi_process_completions() ->spin_lock_irqsave(&p->p_work_lock, flags); (deadlock here) This flaw was found by an experimental static analysis tool I am developing for IRQ-related deadlocks. The tentative patch fix the potential deadlock by spin_lock_irqsave() under process context. Signed-off-by: Chengfeng Ye Link: https://lore.kernel.org/r/20230726125655.4197-1-dg573847474@gmail.com Acked-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit 8eebf0e84f0614cebc7347f7bbccba4056d77d42 Author: Justin Tee Date: Thu Aug 3 14:19:32 2023 -0700 scsi: lpfc: Remove reftag check in DIF paths When preparing protection DIF I/O for DMA, the driver obtains reference tags from scsi_prot_ref_tag(). Previously, there was a wrong assumption that an all 0xffffffff value meant error and thus the driver failed the I/O. This patch removes the evaluation code and accepts whatever the upper layer returns. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230803211932.155745-1-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit b6d128f89a85771433a004e8656090ccbe1fb969 Author: Yoshihiro Shimoda Date: Thu Aug 3 17:18:12 2023 +0900 scsi: ufs: renesas: Fix private allocation Should use devm_kzalloc() for struct ufs_renesas_priv because the .initialized should be false as default. Fixes: d69520288efd ("scsi: ufs: ufs-renesas: Add support for Renesas R-Car UFS controller") Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20230803081812.1446282-1-yoshihiro.shimoda.uh@renesas.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 41320b18a0e0dfb236dba4edb9be12dba1878156 Author: Zhu Wang Date: Tue Aug 1 19:14:21 2023 +0800 scsi: snic: Fix possible memory leak if device_add() fails If device_add() returns error, the name allocated by dev_set_name() needs be freed. As the comment of device_add() says, put_device() should be used to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanp(). Fixes: c8806b6c9e82 ("snic: driver for Cisco SCSI HBA") Signed-off-by: Zhu Wang Acked-by: Narsimhulu Musini Link: https://lore.kernel.org/r/20230801111421.63651-1-wangzhu9@huawei.com Signed-off-by: Martin K. Petersen commit 04b5b5cb0136ce970333a9c6cec7e46adba1ea3a Author: Zhu Wang Date: Thu Aug 3 10:02:30 2023 +0800 scsi: core: Fix possible memory leak if device_add() fails If device_add() returns error, the name allocated by dev_set_name() needs be freed. As the comment of device_add() says, put_device() should be used to decrease the reference count in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanp(). Fixes: ee959b00c335 ("SCSI: convert struct class_device to struct device") Signed-off-by: Zhu Wang Link: https://lore.kernel.org/r/20230803020230.226903-1-wangzhu9@huawei.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit da703fe9416d7a03058432ccc27b898504b1383d Merge: 64094e7e3118a 534fc31d09b70 Author: Linus Torvalds Date: Mon Aug 7 17:25:19 2023 -0700 Merge tag 'xsa432-6.5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen netback buffer overflow fix from Juergen Gross: "The fix for XSA-423 added logic to Linux'es netback driver to deal with a frontend splitting a packet in a way such that not all of the headers would come in one piece. Unfortunately the logic introduced there didn't account for the extreme case of the entire packet being split into as many pieces as permitted by the protocol, yet still being smaller than the area that's specially dealt with to keep all (possible) headers together. Such an unusual packet would therefore trigger a buffer overrun in the driver" * tag 'xsa432-6.5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/netback: Fix buffer overrun triggered by unusual packet commit 64094e7e3118aff4b0be8ff713c242303e139834 Merge: 138bcddb86d8a 1b0fc0345f285 Author: Linus Torvalds Date: Mon Aug 7 17:03:54 2023 -0700 Merge tag 'gds-for-linus-2023-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86/gds fixes from Dave Hansen: "Mitigate Gather Data Sampling issue: - Add Base GDS mitigation - Support GDS_NO under KVM - Fix a documentation typo" * tag 'gds-for-linus-2023-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Documentation/x86: Fix backwards on/off logic about YMM support KVM: Add GDS_NO support to KVM x86/speculation: Add Kconfig option for GDS x86/speculation: Add force option to GDS mitigation x86/speculation: Add Gather Data Sampling mitigation commit 138bcddb86d8a4f842e4ed6f0585abc9b1a764ff Merge: 14f9643dc90ad 5a15d8348881e Author: Linus Torvalds Date: Mon Aug 7 16:35:44 2023 -0700 Merge tag 'x86_bugs_srso' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86/srso fixes from Borislav Petkov: "Add a mitigation for the speculative RAS (Return Address Stack) overflow vulnerability on AMD processors. In short, this is yet another issue where userspace poisons a microarchitectural structure which can then be used to leak privileged information through a side channel" * tag 'x86_bugs_srso' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/srso: Tie SBPB bit setting to microcode patch detection x86/srso: Add a forgotten NOENDBR annotation x86/srso: Fix return thunks in generated code x86/srso: Add IBPB on VMEXIT x86/srso: Add IBPB x86/srso: Add SRSO_NO support x86/srso: Add IBPB_BRTYPE support x86/srso: Add a Speculative RAS Overflow mitigation x86/bugs: Increase the x86 bugs vector size to two u32s commit e61994882611d1a49387be37fda005e0ef6226ac Author: jairaj-arava Date: Mon Aug 7 16:49:59 2023 -0500 ASoC: Intel: sof-sdw-cs42142: fix for codec button mapping The CS42142 soundwire codec button mapping is corrected to handle the button detection correctly. Fixes: 43cdea08a4ac ("ASoC: Intel: sof_sdw: Add helper function for cs42l42 codec") Signed-off-by: jairaj-arava Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20230807215000.515846-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit bd76caa26ab53ed3bf13ad541d69f119e910d764 Author: Pierre-Louis Bossart Date: Mon Aug 7 16:50:00 2023 -0500 ASoC: Intel: sof-sdw: update jack detection quirk for LunarLake RVP Experimental results show that the headset is only detected with the JD2 quirk. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230807215000.515846-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 14f9643dc90adea074a0ffb7a17d337eafc6a5cc Merge: 8043e2225aa2e aa6fde93f3a49 Author: Linus Torvalds Date: Mon Aug 7 13:07:12 2023 -0700 Merge tag 'wq-for-6.5-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue fixes from Tejun Heo: - The recently added cpu_intensive auto detection and warning mechanism was spuriously triggered on slow CPUs. While not causing serious issues, it's still a nuisance and can cause unintended concurrency management behaviors. Relax the threshold on machines with lower BogoMIPS. While BogoMIPS is not an accurate measure of performance by most measures, we don't have to be accurate and it has rough but strong enough correlation. - A correction in Kconfig help text * tag 'wq-for-6.5-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Scale up wq_cpu_intensive_thresh_us if BogoMIPS is below 4000 workqueue: Fix cpu_intensive_thresh_us name in help text commit 8043e2225aa2ef7c7a04aac129a7ded3b1771aba Merge: a027b2eca0b7e e117e7adc637e Author: Linus Torvalds Date: Mon Aug 7 13:03:36 2023 -0700 Merge tag 'tpmdd-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull tpm fixes from Jarkko Sakkinen: "A few more bug fixes" * tag 'tpmdd-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: tpm/tpm_tis: Disable interrupts for Lenovo P620 devices tpm: Disable RNG for all AMD fTPMs sysctl: set variable key_sysctls storage-class-specifier to static tpm/tpm_tis: Disable interrupts for TUXEDO InfinityBook S 15/17 Gen7 commit fa41884c1c6deb6774135390e5813a97184903e0 Merge: 01f4fd2708707 46622219aae2b Author: Jakub Kicinski Date: Mon Aug 7 12:26:58 2023 -0700 Merge branch 'wireguard-fixes-for-6-5-rc6' Jason A. Donenfeld says: ==================== wireguard fixes for 6.5-rc6 Just one patch this time, somewhat late in the cycle: 1) Fix an off-by-one calculation for the maximum node depth size in the allowedips trie data structure, and also adjust the self-tests to hit this case so it doesn't regress again in the future. ==================== Link: https://lore.kernel.org/r/20230807132146.2191597-1-Jason@zx2c4.com Signed-off-by: Jakub Kicinski commit 46622219aae2b67813fe31a7b8cb7da5baff5c8a Author: Jason A. Donenfeld Date: Mon Aug 7 15:21:27 2023 +0200 wireguard: allowedips: expand maximum node depth In the allowedips self-test, nodes are inserted into the tree, but it generated an even amount of nodes, but for checking maximum node depth, there is of course the root node, which makes the total number necessarily odd. With two few nodes added, it never triggered the maximum depth check like it should have. So, add 129 nodes instead of 128 nodes, and do so with a more straightforward scheme, starting with all the bits set, and shifting over one each time. Then increase the maximum depth to 129, and choose a better name for that variable to make it clear that it represents depth as opposed to bits. Cc: stable@vger.kernel.org Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Signed-off-by: Jason A. Donenfeld Link: https://lore.kernel.org/r/20230807132146.2191597-2-Jason@zx2c4.com Signed-off-by: Jakub Kicinski commit 01f4fd27087078c90a0e22860d1dfa2cd0510791 Author: Ziyang Xuan Date: Wed Aug 2 19:43:20 2023 +0800 bonding: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves BUG_ON(!vlan_info) is triggered in unregister_vlan_dev() with following testcase: # ip netns add ns1 # ip netns exec ns1 ip link add bond0 type bond mode 0 # ip netns exec ns1 ip link add bond_slave_1 type veth peer veth2 # ip netns exec ns1 ip link set bond_slave_1 master bond0 # ip netns exec ns1 ip link add link bond_slave_1 name vlan10 type vlan id 10 protocol 802.1ad # ip netns exec ns1 ip link add link bond0 name bond0_vlan10 type vlan id 10 protocol 802.1ad # ip netns exec ns1 ip link set bond_slave_1 nomaster # ip netns del ns1 The logical analysis of the problem is as follows: 1. create ETH_P_8021AD protocol vlan10 for bond_slave_1: register_vlan_dev() vlan_vid_add() vlan_info_alloc() __vlan_vid_add() // add [ETH_P_8021AD, 10] vid to bond_slave_1 2. create ETH_P_8021AD protocol bond0_vlan10 for bond0: register_vlan_dev() vlan_vid_add() __vlan_vid_add() vlan_add_rx_filter_info() if (!vlan_hw_filter_capable(dev, proto)) // condition established because bond0 without NETIF_F_HW_VLAN_STAG_FILTER return 0; if (netif_device_present(dev)) return dev->netdev_ops->ndo_vlan_rx_add_vid(dev, proto, vid); // will be never called // The slaves of bond0 will not refer to the [ETH_P_8021AD, 10] vid. 3. detach bond_slave_1 from bond0: __bond_release_one() vlan_vids_del_by_dev() list_for_each_entry(vid_info, &vlan_info->vid_list, list) vlan_vid_del(dev, vid_info->proto, vid_info->vid); // bond_slave_1 [ETH_P_8021AD, 10] vid will be deleted. // bond_slave_1->vlan_info will be assigned NULL. 4. delete vlan10 during delete ns1: default_device_exit_batch() dev->rtnl_link_ops->dellink() // unregister_vlan_dev() for vlan10 vlan_info = rtnl_dereference(real_dev->vlan_info); // real_dev of vlan10 is bond_slave_1 BUG_ON(!vlan_info); // bond_slave_1->vlan_info is NULL now, bug is triggered!!! Add S-VLAN tag related features support to bond driver. So the bond driver will always propagate the VLAN info to its slaves. Fixes: 8ad227ff89a7 ("net: vlan: add 802.1ad support") Suggested-by: Ido Schimmel Signed-off-by: Ziyang Xuan Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20230802114320.4156068-1-william.xuanziyang@huawei.com Signed-off-by: Jakub Kicinski commit 548ee049b19fb9a3d0a4335314d0d1217a521bc5 Author: Lama Kayal Date: Sun Jun 11 16:29:13 2023 +0300 net/mlx5e: Add capability check for vnic counters Add missing capability check for each of the vnic counters exposed by devlink health reporter, and thus avoid unexpected behavior due to invalid access to registers. While at it, read only the exact number of bits for each counter whether it was 32 bits or 64 bits. Fixes: b0bc615df488 ("net/mlx5: Add vnic devlink health reporter to PFs/VFs") Fixes: a33682e4e78e ("net/mlx5e: Expose catastrophic steering error counters") Signed-off-by: Lama Kayal Reviewed-by: Gal Pressman Reviewed-by: Rahul Rameshbabu Reviewed-by: Maher Sanalla Signed-off-by: Saeed Mahameed commit aab8e1a200b926147db51e3f82fd07bb9edf6a98 Author: Moshe Shemesh Date: Sun Jul 23 11:03:01 2023 +0300 net/mlx5: Reload auxiliary devices in pci error handlers Handling pci errors should fully teardown and load back auxiliary devices, same as done through mlx5 health recovery flow. Fixes: 72ed5d5624af ("net/mlx5: Suspend auxiliary devices only in case of PCI device suspend") Signed-off-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit d006207625657322ba8251b6e7e829f9659755dc Author: Moshe Shemesh Date: Wed Jul 19 11:33:44 2023 +0300 net/mlx5: Skip clock update work when device is in error state When device is in error state, marked by the flag MLX5_DEVICE_STATE_INTERNAL_ERROR, the HW and PCI may not be accessible and so clock update work should be skipped. Furthermore, such access through PCI in error state, after calling mlx5_pci_disable_device() can result in failing to recover from pci errors. Fixes: ef9814deafd0 ("net/mlx5e: Add HW timestamping (TS) support") Reported-and-tested-by: Ganesh G R Closes: https://lore.kernel.org/netdev/9bdb9b9d-140a-7a28-f0de-2e64e873c068@nvidia.com Signed-off-by: Moshe Shemesh Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit 86ed7b773c01ba71617538b3b107c33fd9cf90b8 Author: Shay Drory Date: Sun Jul 30 09:26:27 2023 +0300 net/mlx5: LAG, Check correct bucket when modifying LAG Cited patch introduced buckets in hash mode, but missed to update the ports/bucket check when modifying LAG. Fix the check. Fixes: 352899f384d4 ("net/mlx5: Lag, use buckets in hash mode") Signed-off-by: Shay Drory Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 6b5926eb1c034affff3fb44a98cb8c67153847d8 Author: Chris Mi Date: Wed Jul 26 09:06:33 2023 +0300 net/mlx5e: Unoffload post act rule when handling FIB events If having the following tc rule on stack device: filter parent ffff: protocol ip pref 3 flower chain 1 filter parent ffff: protocol ip pref 3 flower chain 1 handle 0x1 dst_mac 24:25:d0:e1:00:00 src_mac 02:25:d0:25:01:02 eth_type ipv4 ct_state +trk+new in_hw in_hw_count 1 action order 1: ct commit zone 0 pipe index 2 ref 1 bind 1 installed 3807 sec used 3779 sec firstused 3800 sec Action statistics: Sent 120 bytes 2 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 used_hw_stats delayed action order 2: tunnel_key set src_ip 192.168.1.25 dst_ip 192.168.1.26 key_id 4 dst_port 4789 csum pipe index 3 ref 1 bind 1 installed 3807 sec used 3779 sec firstused 3800 sec Action statistics: Sent 120 bytes 2 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 used_hw_stats delayed action order 3: mirred (Egress Redirect to device vxlan1) stolen index 9 ref 1 bind 1 installed 3807 sec used 3779 sec firstused 3800 sec Action statistics: Sent 120 bytes 2 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 used_hw_stats delayed When handling FIB events, the rule in post act will not be deleted. And because the post act rule has packet reformat and modify header actions, also will hit the following syndromes: mlx5_core 0000:08:00.0: mlx5_cmd_out_err:829:(pid 11613): DEALLOC_MODIFY_HEADER_CONTEXT(0x941) op_mod(0x0) failed, status bad resource state(0x9), syndrome (0x1ab444), err(-22) mlx5_core 0000:08:00.0: mlx5_cmd_out_err:829:(pid 11613): DEALLOC_PACKET_REFORMAT_CONTEXT(0x93e) op_mod(0x0) failed, status bad resource state(0x9), syndrome (0x179e84), err(-22) Fix it by unoffloading post act rule when handling FIB events. Fixes: 314e1105831b ("net/mlx5e: Add post act offload/unoffload API") Signed-off-by: Chris Mi Reviewed-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 2d691c90f45ad2d0eafdd24c6abb0973a831c1d2 Author: Daniel Jurgens Date: Tue Aug 1 21:46:00 2023 +0300 net/mlx5: Fix devlink controller number for ECVF The controller number for ECVFs is always 0, because the ECPF must be the eswitch owner for EC VFs to be enabled. Fixes: dc13180824b7 ("net/mlx5: Enable devlink port for embedded cpu VF vports") Signed-off-by: Daniel Jurgens Signed-off-by: Saeed Mahameed commit 2dc2b3922d3c0f52d3a792d15dcacfbc4cc76b8f Author: Daniel Jurgens Date: Tue Jul 11 00:28:10 2023 +0300 net/mlx5: Allow 0 for total host VFs When querying eswitch functions 0 is a valid number of host VFs. After introducing ARM SRIOV falling through to getting the max value from PCI results in using the total VFs allowed on the ARM for the host. Fixes: 86eec50beaf3 ("net/mlx5: Support querying max VFs from device"); Signed-off-by: Daniel Jurgens Signed-off-by: Saeed Mahameed commit 06c868fde61fd0bbf9a7c7405f6eb9925bf0c2ed Author: Daniel Jurgens Date: Mon Jun 26 22:55:03 2023 +0300 net/mlx5: Return correct EC_VF function ID The ECVF function ID range is 1..max_ec_vfs. Currently mlx5_vport_to_func_id returns 0..max_ec_vfs - 1. Which results in a syndrome when querying the caps with more recent firmware, or reading incorrect caps with older firmware that supports EC VFs. Fixes: 9ac0b128248e ("net/mlx5: Update vport caps query/set for EC VFs") Signed-off-by: Daniel Jurgens Signed-off-by: Saeed Mahameed commit 8bfe1e19fb96d89fce14302e35cba0cd9f39d0a1 Author: Yevgeny Kliteynik Date: Wed Jul 26 14:38:03 2023 +0300 net/mlx5: DR, Fix wrong allocation of modify hdr pattern Fixing wrong calculation of the modify hdr pattern size, where the previously calculated number would not be enough to accommodate the required number of actions. Fixes: da5d0027d666 ("net/mlx5: DR, Add cache for modify header pattern") Signed-off-by: Yevgeny Kliteynik Reviewed-by: Erez Shitrit Signed-off-by: Saeed Mahameed commit ac5da544a3c2047cbfd715acd9cec8380d7fe5c6 Author: Jianbo Liu Date: Fri Apr 14 08:48:20 2023 +0000 net/mlx5e: TC, Fix internal port memory leak The flow rule can be splited, and the extra post_act rules are added to post_act table. It's possible to trigger memleak when the rule forwards packets from internal port and over tunnel, in the case that, for example, CT 'new' state offload is allowed. As int_port object is assigned to the flow attribute of post_act rule, and its refcnt is incremented by mlx5e_tc_int_port_get(), but mlx5e_tc_int_port_put() is not called, the refcnt is never decremented, then int_port is never freed. The kmemleak reports the following error: unreferenced object 0xffff888128204b80 (size 64): comm "handler20", pid 50121, jiffies 4296973009 (age 642.932s) hex dump (first 32 bytes): 01 00 00 00 19 00 00 00 03 f0 00 00 04 00 00 00 ................ 98 77 67 41 81 88 ff ff 98 77 67 41 81 88 ff ff .wgA.....wgA.... backtrace: [<00000000e992680d>] kmalloc_trace+0x27/0x120 [<000000009e945a98>] mlx5e_tc_int_port_get+0x3f3/0xe20 [mlx5_core] [<0000000035a537f0>] mlx5e_tc_add_fdb_flow+0x473/0xcf0 [mlx5_core] [<0000000070c2cec6>] __mlx5e_add_fdb_flow+0x7cf/0xe90 [mlx5_core] [<000000005cc84048>] mlx5e_configure_flower+0xd40/0x4c40 [mlx5_core] [<000000004f8a2031>] mlx5e_rep_indr_offload.isra.0+0x10e/0x1c0 [mlx5_core] [<000000007df797dc>] mlx5e_rep_indr_setup_tc_cb+0x90/0x130 [mlx5_core] [<0000000016c15cc3>] tc_setup_cb_add+0x1cf/0x410 [<00000000a63305b4>] fl_hw_replace_filter+0x38f/0x670 [cls_flower] [<000000008bc9e77c>] fl_change+0x1fd5/0x4430 [cls_flower] [<00000000e7f766e4>] tc_new_tfilter+0x867/0x2010 [<00000000e101c0ef>] rtnetlink_rcv_msg+0x6fc/0x9f0 [<00000000e1111d44>] netlink_rcv_skb+0x12c/0x360 [<0000000082dd6c8b>] netlink_unicast+0x438/0x710 [<00000000fc568f70>] netlink_sendmsg+0x794/0xc50 [<0000000016e92590>] sock_sendmsg+0xc5/0x190 So fix this by moving int_port cleanup code to the flow attribute free helper, which is used by all the attribute free cases. Fixes: 8300f225268b ("net/mlx5e: Create new flow attr for multi table actions") Signed-off-by: Jianbo Liu Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 72cc654970658e88a1cdea08f06b11c218efa4da Author: Gal Pressman Date: Sun Jul 16 14:28:10 2023 +0300 net/mlx5e: Take RTNL lock when needed before calling xdp_set_features() Hold RTNL lock when calling xdp_set_features() with a registered netdev, as the call triggers the netdev notifiers. This could happen when switching from uplink rep to nic profile for example. This resolves the following call trace: RTNL: assertion failed at net/core/dev.c (1953) WARNING: CPU: 6 PID: 112670 at net/core/dev.c:1953 call_netdevice_notifiers_info+0x7c/0x80 Modules linked in: sch_mqprio sch_mqprio_lib act_tunnel_key act_mirred act_skbedit cls_matchall nfnetlink_cttimeout act_gact cls_flower sch_ingress bonding ib_umad ip_gre rdma_ucm mlx5_vfio_pci ipip tunnel4 ip6_gre gre mlx5_ib vfio_pci vfio_pci_core vfio_iommu_type1 ib_uverbs vfio mlx5_core ib_ipoib geneve nf_tables ip6_tunnel tunnel6 iptable_raw openvswitch nsh rpcrdma ib_iser libiscsi scsi_transport_iscsi rdma_cm iw_cm ib_cm ib_core xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcsec_gss_krb5 auth_rpcgss oid_registry overlay zram zsmalloc fuse [last unloaded: ib_uverbs] CPU: 6 PID: 112670 Comm: devlink Not tainted 6.4.0-rc7_for_upstream_min_debug_2023_06_28_17_02 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:call_netdevice_notifiers_info+0x7c/0x80 Code: 90 ff 80 3d 2d 6b f7 00 00 75 c5 ba a1 07 00 00 48 c7 c6 e4 ce 0b 82 48 c7 c7 c8 f4 04 82 c6 05 11 6b f7 00 01 e8 a4 7c 8e ff <0f> 0b eb a2 0f 1f 44 00 00 55 48 89 e5 41 54 48 83 e4 f0 48 83 ec RSP: 0018:ffff8882a21c3948 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffffffff82e6f880 RCX: 0000000000000027 RDX: ffff88885f99b5c8 RSI: 0000000000000001 RDI: ffff88885f99b5c0 RBP: 0000000000000028 R08: ffff88887ffabaa8 R09: 0000000000000003 R10: ffff88887fecbac0 R11: ffff88887ff7bac0 R12: ffff8882a21c3968 R13: ffff88811c018940 R14: 0000000000000000 R15: ffff8881274401a0 FS: 00007fe141c81800(0000) GS:ffff88885f980000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f787c28b948 CR3: 000000014bcf3005 CR4: 0000000000370ea0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? __warn+0x79/0x120 ? call_netdevice_notifiers_info+0x7c/0x80 ? report_bug+0x17c/0x190 ? handle_bug+0x3c/0x60 ? exc_invalid_op+0x14/0x70 ? asm_exc_invalid_op+0x16/0x20 ? call_netdevice_notifiers_info+0x7c/0x80 ? call_netdevice_notifiers_info+0x7c/0x80 call_netdevice_notifiers+0x2e/0x50 mlx5e_set_xdp_feature+0x21/0x50 [mlx5_core] mlx5e_nic_init+0xf1/0x1a0 [mlx5_core] mlx5e_netdev_init_profile+0x76/0x110 [mlx5_core] mlx5e_netdev_attach_profile+0x1f/0x90 [mlx5_core] mlx5e_netdev_change_profile+0x92/0x160 [mlx5_core] mlx5e_netdev_attach_nic_profile+0x1b/0x30 [mlx5_core] mlx5e_vport_rep_unload+0xaa/0xc0 [mlx5_core] __esw_offloads_unload_rep+0x52/0x60 [mlx5_core] mlx5_esw_offloads_rep_unload+0x52/0x70 [mlx5_core] esw_offloads_unload_rep+0x34/0x70 [mlx5_core] esw_offloads_disable+0x2b/0x90 [mlx5_core] mlx5_eswitch_disable_locked+0x1b9/0x210 [mlx5_core] mlx5_devlink_eswitch_mode_set+0xf5/0x630 [mlx5_core] ? devlink_get_from_attrs_lock+0x9e/0x110 devlink_nl_cmd_eswitch_set_doit+0x60/0xe0 genl_family_rcv_msg_doit.isra.0+0xc2/0x110 genl_rcv_msg+0x17d/0x2b0 ? devlink_get_from_attrs_lock+0x110/0x110 ? devlink_nl_cmd_eswitch_get_doit+0x290/0x290 ? devlink_pernet_pre_exit+0xf0/0xf0 ? genl_family_rcv_msg_doit.isra.0+0x110/0x110 netlink_rcv_skb+0x54/0x100 genl_rcv+0x24/0x40 netlink_unicast+0x1f6/0x2c0 netlink_sendmsg+0x232/0x4a0 sock_sendmsg+0x38/0x60 ? _copy_from_user+0x2a/0x60 __sys_sendto+0x110/0x160 ? __count_memcg_events+0x48/0x90 ? handle_mm_fault+0x161/0x260 ? do_user_addr_fault+0x278/0x6e0 __x64_sys_sendto+0x20/0x30 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7fe141b1340a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f 00 f3 0f 1e fa 41 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 15 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 7e c3 0f 1f 44 00 00 41 54 48 83 ec 30 44 89 RSP: 002b:00007fff61d03de8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000afab00 RCX: 00007fe141b1340a RDX: 0000000000000038 RSI: 0000000000afab00 RDI: 0000000000000003 RBP: 0000000000afa910 R08: 00007fe141d80200 R09: 000000000000000c R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000001 Fixes: 4d5ab0ad964d ("net/mlx5e: take into account device reconfiguration for xdp_features flag") Signed-off-by: Gal Pressman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 41aad0905568508070842e22ebc5398f8b733939 Author: Xia Fukun Date: Mon Aug 7 15:51:18 2023 +0800 ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work() Here hdr is a pointer, and we should measure the size of struct sof_ipc_cmd_hdr. Fixes: 12c41c779fad ("ASoC: SOF: Refactor rx function for fuzzing") Signed-off-by: Xia Fukun Reviewed-by: Curtis Malainey Link: https://lore.kernel.org/r/20230807075118.128122-1-xiafukun@huawei.com Signed-off-by: Mark Brown commit 1f566435141047ca7db26aa4b0b6647a25badaee Author: Hans de Goede Date: Sat Aug 5 19:14:35 2023 +0200 ASoC: lower "no backend DAIs enabled for ... Port" log severity If SNDRV_PCM_IOCTL_PREPARE is called when the mixer settings linking frontend and backend have not been setup yet this results in e.g. the following errors getting logged: [ 43.244549] Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port [ 43.244744] Baytrail Audio Port: ASoC: error at dpcm_fe_dai_prepare on Baytrail Audio Port: -22 pipewire triggers this leading to 96 lines getting logged after the user has logged into a GNOME session. Change the actual "no backend DAIs enabled for ... Port" error to dev_err_once() to avoid it getting repeated 48 times. While at it also improve the error by hinting the user how to fix this. To not make developing new UCM profiles harder, also log the error at dev_dbg() level all the time (vs once). So that e.g. dyndbg can be used to (re)enable the messages. Also changes _soc_pcm_ret() to not log for -EINVAL errors, to fix the other error getting logged 48 times. Userspace passing wrong parameters should not lead to dmesg messages. Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3407 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230805171435.31696-1-hdegoede@redhat.com Signed-off-by: Mark Brown commit 72dbde0f2afbe4af8e8595a89c650ae6b9d9c36f Author: Aleksa Sarai Date: Mon Aug 7 12:24:15 2023 +1000 io_uring: correct check for O_TMPFILE O_TMPFILE is actually __O_TMPFILE|O_DIRECTORY. This means that the old check for whether RESOLVE_CACHED can be used would incorrectly think that O_DIRECTORY could not be used with RESOLVE_CACHED. Cc: stable@vger.kernel.org # v5.12+ Fixes: 3a81fd02045c ("io_uring: enable LOOKUP_CACHED path resolution for filename lookups") Signed-off-by: Aleksa Sarai Link: https://lore.kernel.org/r/20230807-resolve_cached-o_tmpfile-v3-1-e49323e1ef6f@cyphar.com Signed-off-by: Jens Axboe commit e117e7adc637e364b599dc766f1d740698e7e027 Author: Jonathan McDowell Date: Fri Aug 4 17:08:40 2023 +0000 tpm/tpm_tis: Disable interrupts for Lenovo P620 devices The Lenovo ThinkStation P620 suffers from an irq storm issue like various other Lenovo machines, so add an entry for it to tpm_tis_dmi_table and force polling. It is worth noting that 481c2d14627d (tpm,tpm_tis: Disable interrupts after 1000 unhandled IRQs) does not seem to fix the problem on this machine, but setting 'tpm_tis.interrupts=0' on the kernel command line does. [jarkko@kernel.org: truncated the commit ID in the description to 12 characters] Cc: stable@vger.kernel.org # v6.4+ Fixes: e644b2f498d2 ("tpm, tpm_tis: Enable interrupt test") Signed-off-by: Jonathan McDowell Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 554b841d470338a3b1d6335b14ee1cd0c8f5d754 Author: Mario Limonciello Date: Wed Aug 2 07:25:33 2023 -0500 tpm: Disable RNG for all AMD fTPMs The TPM RNG functionality is not necessary for entropy when the CPU already supports the RDRAND instruction. The TPM RNG functionality was previously disabled on a subset of AMD fTPM series, but reports continue to show problems on some systems causing stutter root caused to TPM RNG functionality. Expand disabling TPM RNG use for all AMD fTPMs whether they have versions that claim to have fixed or not. To accomplish this, move the detection into part of the TPM CRB registration and add a flag indicating that the TPM should opt-out of registration to hwrng. Cc: stable@vger.kernel.org # 6.1.y+ Fixes: b006c439d58d ("hwrng: core - start hwrng kthread also for untrusted sources") Fixes: f1324bbc4011 ("tpm: disable hwrng for fTPM on some AMD designs") Reported-by: daniil.stas@posteo.net Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217719 Reported-by: bitlord0xff@gmail.com Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217212 Signed-off-by: Mario Limonciello Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 0de030b308236a1392f924f527cf74614d8b6aef Author: Tom Rix Date: Sun Jun 11 07:32:10 2023 -0400 sysctl: set variable key_sysctls storage-class-specifier to static smatch reports security/keys/sysctl.c:12:18: warning: symbol 'key_sysctls' was not declared. Should it be static? This variable is only used in its defining file, so it should be static. Signed-off-by: Tom Rix Signed-off-by: Jarkko Sakkinen commit 0b15afc9038146bb2009e7924b1ead2e919b2a56 Author: Takashi Iwai Date: Wed Jul 26 20:00:35 2023 +0200 tpm/tpm_tis: Disable interrupts for TUXEDO InfinityBook S 15/17 Gen7 TUXEDO InfinityBook S 15/17 Gen7 suffers from an IRQ problem on tpm_tis like a few other laptops. Add an entry for the workaround. Cc: stable@vger.kernel.org Fixes: e644b2f498d2 ("tpm, tpm_tis: Enable interrupt test") Link: https://bugzilla.suse.com/show_bug.cgi?id=1213645 Signed-off-by: Takashi Iwai Acked-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 5e720f8c8c9d959283c3908bbf32a91a01a86547 Author: Thomas Weißschuh Date: Mon Aug 7 08:37:45 2023 +0200 cpufreq: amd-pstate: fix global sysfs attribute type In commit 3666062b87ec ("cpufreq: amd-pstate: move to use bus_get_dev_root()") the "amd_pstate" attributes where moved from a dedicated kobject to the cpu root kobject. While the dedicated kobject expects to contain kobj_attributes the root kobject needs device_attributes. As the changed arguments are not used by the callbacks it works most of the time. However CFI will detect this issue: [ 4947.849350] CFI failure at dev_attr_show+0x24/0x60 (target: show_status+0x0/0x70; expected type: 0x8651b1de) ... [ 4947.849409] Call Trace: [ 4947.849410] [ 4947.849411] ? __warn+0xcf/0x1c0 [ 4947.849414] ? dev_attr_show+0x24/0x60 [ 4947.849415] ? report_cfi_failure+0x4e/0x60 [ 4947.849417] ? handle_cfi_failure+0x14c/0x1d0 [ 4947.849419] ? __cfi_show_status+0x10/0x10 [ 4947.849420] ? handle_bug+0x4f/0x90 [ 4947.849421] ? exc_invalid_op+0x1a/0x60 [ 4947.849422] ? asm_exc_invalid_op+0x1a/0x20 [ 4947.849424] ? __cfi_show_status+0x10/0x10 [ 4947.849425] ? dev_attr_show+0x24/0x60 [ 4947.849426] sysfs_kf_seq_show+0xa6/0x110 [ 4947.849433] seq_read_iter+0x16c/0x4b0 [ 4947.849436] vfs_read+0x272/0x2d0 [ 4947.849438] ksys_read+0x72/0xe0 [ 4947.849439] do_syscall_64+0x76/0xb0 [ 4947.849440] ? do_user_addr_fault+0x252/0x650 [ 4947.849442] ? exc_page_fault+0x7a/0x1b0 [ 4947.849443] entry_SYSCALL_64_after_hwframe+0x72/0xdc Fixes: 3666062b87ec ("cpufreq: amd-pstate: move to use bus_get_dev_root()") Reported-by: Jannik Glückert Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217765 Link: https://lore.kernel.org/lkml/c7f1bf9b-b183-bf6e-1cbb-d43f72494083@gmail.com/ Cc: All applicable Signed-off-by: Thomas Weißschuh Reviewed-by: Greg Kroah-Hartman Reviewed-by: Nathan Chancellor Signed-off-by: Rafael J. Wysocki commit a027b2eca0b7e90b11a0b0ddfad0dc4068707799 Merge: 016ce29713a0f d5ad9aae13dcc Author: Linus Torvalds Date: Mon Aug 7 10:18:20 2023 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "x86: - Fix SEV race condition ARM: - Fixes for the configuration of SVE/SME traps when hVHE mode is in use - Allow use of pKVM on systems with FF-A implementations that are v1.0 compatible - Request/release percpu IRQs (arch timer, vGIC maintenance) correctly when pKVM is in use - Fix function prototype after __kvm_host_psci_cpu_entry() rename - Skip to the next instruction when emulating writes to TCR_EL1 on AmpereOne systems Selftests: - Fix missing include" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: selftests/rseq: Fix build with undefined __weak KVM: SEV: remove ghcb variable declarations KVM: SEV: only access GHCB fields once KVM: SEV: snapshot the GHCB before accessing it KVM: arm64: Skip instruction after emulating write to TCR_EL1 KVM: arm64: fix __kvm_host_psci_cpu_entry() prototype KVM: arm64: Fix resetting SME trap values on reset for (h)VHE KVM: arm64: Fix resetting SVE trap values on reset for hVHE KVM: arm64: Use the appropriate feature trap register when activating traps KVM: arm64: Helper to write to appropriate feature trap register based on mode KVM: arm64: Disable SME traps for (h)VHE at setup KVM: arm64: Use the appropriate feature trap register for SVE at EL2 setup KVM: arm64: Factor out code for checking (h)VHE mode into a macro KVM: arm64: Rephrase percpu enable/disable tracking in terms of hyp KVM: arm64: Fix hardware enable/disable flows for pKVM KVM: arm64: Allow pKVM on v1.0 compatible FF-A implementations commit 016ce29713a0f276ce73e6e8172b9968e62e9b09 Merge: 52a93d39b17dc 5def5c1c15bf2 Author: Linus Torvalds Date: Mon Aug 7 10:08:55 2023 -0700 Merge tag 'mmc-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: - moxart: Fix big-endian conversion for SCR structure - sdhci-f-sdh30: Replace with sdhci_pltfm to fix PM support * tag 'mmc-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-f-sdh30: Replace with sdhci_pltfm mmc: moxart: read scr register without changing byte order commit 0be8432166a61abc537e1247e530f4b85970b56b Author: Bob Peterson Date: Wed Aug 2 09:24:12 2023 -0500 gfs2: Don't use filemap_splice_read Starting with patch 2cb1e08985, gfs2 started using the new function filemap_splice_read rather than the old (and subsequently deleted) function generic_file_splice_read. filemap_splice_read works by taking references to a number of folios in the page cache and splicing those folios into a pipe. The folios are then read from the pipe and the folio references are dropped. This can take an arbitrary amount of time. We cannot allow that in gfs2 because those folio references will pin the inode glock to the node and prevent it from being demoted, which can lead to cluster-wide deadlocks. Instead, use copy_splice_read. (In addition, the old generic_file_splice_read called into ->read_iter, which called gfs2_file_read_iter, which took the inode glock during the operation. The new filemap_splice_read interface does not take the inode glock anymore. This is fixable, but it still wouldn't prevent cluster-wide deadlocks.) Fixes: 2cb1e08985e3 ("splice: Use filemap_splice_read() instead of generic_file_splice_read()") Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 2cbd80642b76480c9b0697297af917d9388a0b46 Author: Andreas Gruenbacher Date: Fri Aug 4 22:17:32 2023 +0200 gfs2: Fix freeze consistency check in gfs2_trans_add_meta Function gfs2_trans_add_meta() checks for the SDF_FROZEN flag to make sure that no buffers are added to a transaction while the filesystem is frozen. With the recent freeze/thaw rework, the SDF_FROZEN flag is cleared after thaw_super() is called, which is sufficient for serializing freeze/thaw. However, other filesystem operations started after thaw_super() may now be calling gfs2_trans_add_meta() before the SDF_FROZEN flag is cleared, which will trigger the SDF_FROZEN check in gfs2_trans_add_meta(). Fix that by checking the s_writers.frozen state instead. In addition, make sure not to call gfs2_assert_withdraw() with the sd_log_lock spin lock held. Check for a withdrawn filesystem before checking for a frozen filesystem, and don't pin/add buffers to the current transaction in case of a failure in either case. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson commit bee6cf1a80b54548a039e224c651bb15b644a480 Author: Borislav Petkov (AMD) Date: Sun Jul 16 20:22:20 2023 +0200 x86/sev: Do not try to parse for the CC blob on non-AMD hardware Tao Liu reported a boot hang on an Intel Atom machine due to an unmapped EFI config table. The reason being that the CC blob which contains the CPUID page for AMD SNP guests is parsed for before even checking whether the machine runs on AMD hardware. Usually that's not a problem on !AMD hw - it simply won't find the CC blob's GUID and return. However, if any parts of the config table pointers array is not mapped, the kernel will #PF very early in the decompressor stage without any opportunity to recover. Therefore, do a superficial CPUID check before poking for the CC blob. This will fix the current issue on real hardware. It would also work as a guest on a non-lying hypervisor. For the lying hypervisor, the check is done again, *after* parsing the CC blob as the real CPUID page will be present then. Clear the #VC handler in case SEV-{ES,SNP} hasn't been detected, as a precaution. Fixes: c01fce9cef84 ("x86/compressed: Add SEV-SNP feature detection/setup") Reported-by: Tao Liu Signed-off-by: Borislav Petkov (AMD) Acked-by: Tom Lendacky Tested-by: Tao Liu Cc: Link: https://lore.kernel.org/r/20230601072043.24439-1-ltao@redhat.com commit 7cdf55462c5533a1c78ae13ab8563558e30e4130 Author: Abel Vesa Date: Tue Aug 1 12:57:02 2023 +0300 regulator: qcom-rpmh: Fix LDO 12 regulator for PM8550 The LDO 12 is NLDO 515 low voltage type, so fix accordingly. Fixes: e6e3776d682d ("regulator: qcom-rpmh: Add support for PM8550 regulators") Signed-off-by: Abel Vesa Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230801095702.2891127-1-abel.vesa@linaro.org Signed-off-by: Mark Brown commit c163108e706909570f8aa9aa5bcf6806e2b4c98c Author: Zhang Shurong Date: Tue Aug 1 23:59:11 2023 +0800 ASoC: rt5665: add missed regulator_bulk_disable The driver forgets to call regulator_bulk_disable() Add the missed call to fix it. Fixes: 33ada14a26c8 ("ASoC: add rt5665 codec driver") Signed-off-by: Zhang Shurong Link: https://lore.kernel.org/r/tencent_A560D01E3E0A00A85A12F137E4B5205B3508@qq.com Signed-off-by: Mark Brown commit df2f7cde73cb58c0e6a60f97d1cd6037138a45cd Author: Vlastimil Babka Date: Mon Aug 7 10:33:57 2023 +0200 PM: hibernate: fix resume_store() return value when hibernation not available On a laptop with hibernation set up but not actively used, and with secure boot and lockdown enabled kernel, 6.5-rc1 gets stuck on boot with the following repeated messages: A start job is running for Resume from hibernation using device /dev/system/swap (24s / no limit) lockdown_is_locked_down: 25311154 callbacks suppressed Lockdown: systemd-hiberna: hibernation is restricted; see man kernel_lockdown.7 ... Checking the resume code leads to commit cc89c63e2fe3 ("PM: hibernate: move finding the resume device out of software_resume") which inadvertently changed the return value from resume_store() to 0 when !hibernation_available(). This apparently translates to userspace write() returning 0 as in number of bytes written, and userspace looping indefinitely in the attempt to write the intended value. Fix this by returning the full number of bytes that were to be written, as that's what was done before the commit. Fixes: cc89c63e2fe3 ("PM: hibernate: move finding the resume device out of software_resume") Signed-off-by: Vlastimil Babka Reviewed-by: Christoph Hellwig Acked-by: Greg Kroah-Hartman Signed-off-by: Rafael J. Wysocki commit 5a15d8348881e9371afdf9f5357a135489496955 Author: Borislav Petkov (AMD) Date: Mon Aug 7 10:46:04 2023 +0200 x86/srso: Tie SBPB bit setting to microcode patch detection The SBPB bit in MSR_IA32_PRED_CMD is supported only after a microcode patch has been applied so set X86_FEATURE_SBPB only then. Otherwise, guests would attempt to set that bit and #GP on the MSR write. While at it, make SMT detection more robust as some guests - depending on how and what CPUID leafs their report - lead to cpu_smt_control getting set to CPU_SMT_NOT_SUPPORTED but SRSO_NO should be set for any guest incarnation where one simply cannot do SMT, for whatever reason. Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Reported-by: Konrad Rzeszutek Wilk Reported-by: Salvatore Bonaccorso Signed-off-by: Borislav Petkov (AMD) commit 52a93d39b17dc7eb98b6aa3edb93943248e03b2f Author: Linus Torvalds Date: Sun Aug 6 15:07:51 2023 -0700 Linux 6.5-rc5 commit 422dbc66b7702ae797326d5480c3c9b6467053da Author: Miquel Raynal Date: Mon Jul 31 12:14:40 2023 +0200 dmaengine: xilinx: xdma: Fix typo Probably a copy/paste error with the previous block, here we are actually managing C2H IRQs. Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver") Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20230731101442.792514-3-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul commit 96891e90d1256b569b1c183e7c9a0cfc568fa3b0 Author: Miquel Raynal Date: Mon Jul 31 12:14:39 2023 +0200 dmaengine: xilinx: xdma: Fix interrupt vector setting A couple of hardware registers need to be set to reflect which interrupts have been allocated to the device. Each register is 32-bit wide and can receive four 8-bit values. If we provide any other interrupt number than four, the irq_num variable will never be 0 within the while check and the while block will loop forever. There is an easy way to prevent this: just break the for loop when we reach "irq_num == 0", which anyway means all interrupts have been processed. Cc: stable@vger.kernel.org Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver") Signed-off-by: Miquel Raynal Acked-by: Lizhi Hou Link: https://lore.kernel.org/r/20230731101442.792514-2-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul commit 74d7221c1f9c9f3a8c316a3557ca7dca8b99d14c Author: Zhang Jianhua Date: Sat Jul 22 15:32:44 2023 +0000 dmaengine: owl-dma: Modify mismatched function name No functional modification involved. drivers/dma/owl-dma.c:208: warning: expecting prototype for struct owl_dma_pchan. Prototype was for struct owl_dma_vchan instead HDRTEST usr/include/sound/asequencer.h Fixes: 47e20577c24d ("dmaengine: Add Actions Semi Owl family S900 DMA driver") Signed-off-by: Zhang Jianhua Reviewed-by: Randy Dunlap Link: https://lore.kernel.org/r/20230722153244.2086949-1-chris.zjh@huawei.com Signed-off-by: Vinod Koul commit 863676fe1ac1b82fc9eb56c242e80acfbfc18b76 Author: Fenghua Yu Date: Wed Jul 12 12:35:05 2023 -0700 dmaengine: idxd: Clear PRS disable flag when disabling IDXD device Disabling IDXD device doesn't reset Page Request Service (PRS) disable flag to its initial value 0. This may cause user confusion because once PRS is disabled user will see PRS still remains the previous setting (i.e. disabled) via sysfs interface even after the device is disabled. To eliminate user confusion, reset PRS disable flag to ensure that the PRS flag bit reflects correct state after the device is disabled. Additionally, simplify the code by setting wq->flags to 0, which clears all flag bits, including any future additions. Fixes: f2dc327131b5 ("dmaengine: idxd: add per wq PRS disable") Tested-by: Tony Zhu Signed-off-by: Fenghua Yu Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20230712193505.3440752-1-fenghua.yu@intel.com Signed-off-by: Vinod Koul commit 8cda3ececf07d374774f6a13e5a94bc2dc04c26c Author: Ilpo Järvinen Date: Fri May 26 13:54:34 2023 +0300 dmaengine: pl330: Return DMA_PAUSED when transaction is paused pl330_pause() does not set anything to indicate paused condition which causes pl330_tx_status() to return DMA_IN_PROGRESS. This breaks 8250 DMA flush after the fix in commit 57e9af7831dc ("serial: 8250_dma: Fix DMA Rx rearm race"). The function comment for pl330_pause() claims pause is supported but resume is not which is enough for 8250 DMA flush to work as long as DMA status reports DMA_PAUSED when appropriate. Add PAUSED state for descriptor and mark BUSY descriptors with PAUSED in pl330_pause(). Return DMA_PAUSED from pl330_tx_status() when the descriptor is PAUSED. Reported-by: Richard Tresidder Tested-by: Richard Tresidder Fixes: 88987d2c7534 ("dmaengine: pl330: add DMA_PAUSE feature") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-serial/f8a86ecd-64b1-573f-c2fa-59f541083f1a@electromag.com.au/ Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230526105434.14959-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Vinod Koul commit e2dcbc330f46afb82fd49a6dcbb10f6cdcb466ec Author: Jeffrey Hugo Date: Fri Jul 7 13:50:03 2023 -0600 dmaengine: qcom_hidma: Update codeaurora email domain The codeaurora.org email domain is defunct and will bounce. Update entries to Sinan's kernel.org address which is the address in MAINTAINERS for this component. Signed-off-by: Jeffrey Hugo Acked-By: Sinan Kaya Link: https://lore.kernel.org/r/20230707195003.6619-1-quic_jhugo@quicinc.com Signed-off-by: Vinod Koul commit 0a46781c89dece85386885a407244ca26e5c1c44 Author: Christophe JAILLET Date: Wed Jul 12 18:26:45 2023 +0530 dmaengine: mcf-edma: Fix a potential un-allocated memory access When 'mcf_edma' is allocated, some space is allocated for a flexible array at the end of the struct. 'chans' item are allocated, that is to say 'pdata->dma_channels'. Then, this number of item is stored in 'mcf_edma->n_chans'. A few lines later, if 'mcf_edma->n_chans' is 0, then a default value of 64 is set. This ends to no space allocated by devm_kzalloc() because chans was 0, but 64 items are read and/or written in some not allocated memory. Change the logic to define a default value before allocating the memory. Fixes: e7a3ff92eaf1 ("dmaengine: fsl-edma: add ColdFire mcf5441x edma support") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/f55d914407c900828f6fad3ea5fa791a5f17b9a4.1685172449.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit 0108963f14e96abcfae0c4d1186c237cfb1a7fad Merge: f0ab9f34e59e0 7d84d1b9af636 Author: Linus Torvalds Date: Sun Aug 6 10:43:52 2023 -0700 Merge tag 'v6.5-rc5.vfs.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull vfs fixes from Christian Brauner: - Fix a wrong check for O_TMPFILE during RESOLVE_CACHED lookup - Clean up directory iterators and clarify file_needs_f_pos_lock() * tag 'v6.5-rc5.vfs.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fs: rely on ->iterate_shared to determine f_pos locking vfs: get rid of old '->iterate' directory operation proc: fix missing conversion to 'iterate_shared' open: make RESOLVE_CACHED correctly test for O_TMPFILE commit 52417a95ff2d810dc31a68ae71102e741efea772 Author: Nitya Sunkad Date: Fri Aug 4 13:56:22 2023 -0700 ionic: Add missing err handling for queue reconfig ionic_start_queues_reconfig returns an error code if txrx_init fails. Handle this error code in the relevant places. This fixes a corner case where the device could get left in a detached state if the CMB reconfig fails and the attempt to clean up the mess also fails. Note that calling netif_device_attach when the netdev is already attached does not lead to unexpected behavior. Change goto name "errout" to "err_out" to maintain consistency across goto statements. Fixes: 40bc471dc714 ("ionic: add tx/rx-push support with device Component Memory Buffers") Fixes: 6f7d6f0fd7a3 ("ionic: pull reset_queues into tx_timeout handler") Signed-off-by: Nitya Sunkad Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit b1c936e9af5dd08636d568736fc6075ed9d1d529 Author: Fedor Pchelkin Date: Fri Aug 4 18:53:36 2023 +0300 drivers: vxlan: vnifilter: free percpu vni stats on error path In case rhashtable_lookup_insert_fast() fails inside vxlan_vni_add(), the allocated percpu vni stats are not freed on the error path. Introduce vxlan_vni_free() which would work as a nice wrapper to free vxlan_vni_node resources properly. Found by Linux Verification Center (linuxtesting.org). Fixes: 4095e0e1328a ("drivers: vxlan: vnifilter: per vni stats") Suggested-by: Ido Schimmel Signed-off-by: Fedor Pchelkin Signed-off-by: David S. Miller commit f38963b9cd0645a336cf30c5da2e89e34e34fec3 Author: Tao Ren Date: Fri Aug 4 15:14:03 2023 -0700 hwmon: (pmbus/bel-pfe) Enable PMBUS_SKIP_STATUS_CHECK for pfe1100 Skip status check for both pfe1100 and pfe3000 because the communication error is also observed on pfe1100 devices. Signed-off-by: Tao Ren Fixes: 626bb2f3fb3c hwmon: (pmbus) add driver for BEL PFE1100 and PFE3000 Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230804221403.28931-1-rentao.bupt@gmail.com Signed-off-by: Guenter Roeck commit 7d84d1b9af6366aa9df1b523bdb7e002372e38d0 Author: Christian Brauner Date: Sun Aug 6 14:49:35 2023 +0200 fs: rely on ->iterate_shared to determine f_pos locking Now that we removed ->iterate we don't need to check for either ->iterate or ->iterate_shared in file_needs_f_pos_lock(). Simply check for ->iterate_shared instead. This will tell us whether we need to unconditionally take the lock. Not just does it allow us to avoid checking f_inode's mode it also actually clearly shows that we're locking because of readdir. Signed-off-by: Christian Brauner commit 3e3271549670783be20e233a2b78a87a0b04c715 Author: Linus Torvalds Date: Sat Aug 5 12:25:01 2023 -0700 vfs: get rid of old '->iterate' directory operation All users now just use '->iterate_shared()', which only takes the directory inode lock for reading. Filesystems that never got convered to shared mode now instead use a wrapper that drops the lock, re-takes it in write mode, calls the old function, and then downgrades the lock back to read mode. This way the VFS layer and other callers no longer need to care about filesystems that never got converted to the modern era. The filesystems that use the new wrapper are ceph, coda, exfat, jfs, ntfs, ocfs2, overlayfs, and vboxsf. Honestly, several of them look like they really could just iterate their directories in shared mode and skip the wrapper entirely, but the point of this change is to not change semantics or fix filesystems that haven't been fixed in the last 7+ years, but to finally get rid of the dual iterators. Signed-off-by: Linus Torvalds Signed-off-by: Christian Brauner commit 0a2c2baafa312ac4cec4f0bababedab3f971f224 Author: Linus Torvalds Date: Sat Aug 5 10:49:31 2023 -0700 proc: fix missing conversion to 'iterate_shared' I'm looking at the directory handling due to the discussion about f_pos locking (see commit 797964253d35: "file: reinstate f_pos locking optimization for regular files"), and wanting to clean that up. And one source of ugliness is how we were supposed to move filesystems over to the '->iterate_shared()' function that only takes the inode lock for reading many many years ago, but several filesystems still use the bad old '->iterate()' that takes the inode lock for exclusive access. See commit 6192269444eb ("introduce a parallel variant of ->iterate()") that also added some documentation stating Old method is only used if the new one is absent; eventually it will be removed. Switch while you still can; the old one won't stay. and that was back in April 2016. Here we are, many years later, and the old version is still clearly sadly alive and well. Now, some of those old style iterators are probably just because the filesystem may end up having per-inode mutable data that it uses for iterating a directory, but at least one case is just a mistake. Al switched over most filesystems to use '->iterate_shared()' back when it was introduced. In particular, the /proc filesystem was converted as one of the first ones in commit f50752eaa0b0 ("switch all procfs directories ->iterate_shared()"). But then later one new user of '->iterate()' was then re-introduced by commit 6d9c939dbe4d ("procfs: add smack subdir to attrs"). And that's clearly not what we wanted, since that new case just uses the same 'proc_pident_readdir()' and 'proc_pident_lookup()' helper functions that other /proc pident directories use, and they are most definitely safe to use with the inode lock held shared. So just fix it. This still leaves a fair number of oddball filesystems using the old-style directory iterator (ceph, coda, exfat, jfs, ntfs, ocfs2, overlayfs, and vboxsf), but at least we don't have any remaining in the core filesystems. I'm going to add a wrapper function that just drops the read-lock and takes it as a write lock, so that we can clean up the core vfs layer and make all the ugly 'this filesystem needs exclusive inode locking' be just filesystem-internal warts. I just didn't want to make that conversion when we still had a core user left. Signed-off-by: Linus Torvalds Signed-off-by: Christian Brauner commit a0fc452a5d7fed986205539259df1d60546f536c Author: Aleksa Sarai Date: Sun Aug 6 02:11:58 2023 +1000 open: make RESOLVE_CACHED correctly test for O_TMPFILE O_TMPFILE is actually __O_TMPFILE|O_DIRECTORY. This means that the old fast-path check for RESOLVE_CACHED would reject all users passing O_DIRECTORY with -EAGAIN, when in fact the intended test was to check for __O_TMPFILE. Cc: stable@vger.kernel.org # v5.12+ Fixes: 99668f618062 ("fs: expose LOOKUP_CACHED through openat2() RESOLVE_CACHED") Signed-off-by: Aleksa Sarai Message-Id: <20230806-resolve_cached-o_tmpfile-v1-1-7ba16308465e@cyphar.com> Signed-off-by: Christian Brauner commit 32d0a49d36a2a306c2e47fe5659361e424f0ed3f Author: Eric Dumazet Date: Fri Aug 4 17:26:52 2023 +0000 macsec: use DEV_STATS_INC() syzbot/KCSAN reported data-races in macsec whenever dev->stats fields are updated. It appears all of these updates can happen from multiple cpus. Adopt SMP safe DEV_STATS_INC() to update dev->stats fields. Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Sabrina Dubroca Signed-off-by: David S. Miller commit 6b47808f223c70ff564f9b363446d2a5fa1e05b2 Author: Jakub Kicinski Date: Fri Aug 4 15:59:51 2023 -0700 net: tls: avoid discarding data on record close TLS records end with a 16B tag. For TLS device offload we only need to make space for this tag in the stream, the device will generate and replace it with the actual calculated tag. Long time ago the code would just re-reference the head frag which mostly worked but was suboptimal because it prevented TCP from combining the record into a single skb frag. I'm not sure if it was correct as the first frag may be shorter than the tag. The commit under fixes tried to replace that with using the page frag and if the allocation failed rolling back the data, if record was long enough. It achieves better fragment coalescing but is also buggy. We don't roll back the iterator, so unless we're at the end of send we'll skip the data we designated as tag and start the next record as if the rollback never happened. There's also the possibility that the record was constructed with MSG_MORE and the data came from a different syscall and we already told the user space that we "got it". Allocate a single dummy page and use it as fallback. Found by code inspection, and proven by forcing allocation failures. Fixes: e7b159a48ba6 ("net/tls: remove the record tail optimization") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 78e869dd8b2ba19765ac9b05cdea3e432d1dc188 Author: Alexander Stein Date: Fri Jul 28 10:34:35 2023 +0200 arm64: dts: imx93: Fix anatop node size Although the memory map of i.MX93 reference manual rev. 2 claims that analog top has start address of 0x44480000 and end address of 0x4448ffff, this overlaps with TMU memory area starting at 0x44482000, as stated in section 73.6.1. As PLL configuration registers start at addresses up to 0x44481400, as used by clk-imx93, reduce the anatop size to 0x2000, so exclude the TMU area but keep all PLL registers inside. Fixes: ec8b5b5058ea ("arm64: dts: freescale: Add i.MX93 dtsi support") Signed-off-by: Alexander Stein Reviewed-by: Peng Fan Reviewed-by: Jacky Bai Signed-off-by: Shawn Guo commit f0ab9f34e59e0c01a1c31142e0b336245367fd86 Merge: fb0d91991cedb b05544884300e Author: Linus Torvalds Date: Sat Aug 5 19:28:02 2023 -0700 Merge tag 'rust-fixes-6.5-rc5' of https://github.com/Rust-for-Linux/linux Pull rust fixes from Miguel Ojeda: - Allocator: prevent mis-aligned allocation - Types: delete 'ForeignOwnable::borrow_mut'. A sound replacement is planned for the merge window - Build: fix bindgen error with UBSAN_BOUNDS_STRICT * tag 'rust-fixes-6.5-rc5' of https://github.com/Rust-for-Linux/linux: rust: fix bindgen build error with UBSAN_BOUNDS_STRICT rust: delete `ForeignOwnable::borrow_mut` rust: allocator: Prevent mis-aligned allocation commit 79ed288cef201f1f212dfb934bcaac75572fb8f6 Author: Namjae Jeon Date: Sun Aug 6 08:44:17 2023 +0900 ksmbd: fix wrong next length validation of ea buffer in smb2_set_ea() There are multiple smb2_ea_info buffers in FILE_FULL_EA_INFORMATION request from client. ksmbd find next smb2_ea_info using ->NextEntryOffset of current smb2_ea_info. ksmbd need to validate buffer length Before accessing the next ea. ksmbd should check buffer length using buf_len, not next variable. next is the start offset of current ea that got from previous ea. Cc: stable@vger.kernel.org Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21598 Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 5aa4fda5aa9c2a5a7bac67b4a12b089ab81fee3c Author: Long Li Date: Sat Jul 29 11:36:18 2023 +0800 ksmbd: validate command request size In commit 2b9b8f3b68ed ("ksmbd: validate command payload size"), except for SMB2_OPLOCK_BREAK_HE command, the request size of other commands is not checked, it's not expected. Fix it by add check for request size of other commands. Cc: stable@vger.kernel.org Fixes: 2b9b8f3b68ed ("ksmbd: validate command payload size") Acked-by: Namjae Jeon Signed-off-by: Long Li Signed-off-by: Steve French commit fb0d91991cedb51bc604c6b3915df75d8a59a4a3 Merge: f6a6916859626 0a8589055936d Author: Linus Torvalds Date: Sat Aug 5 18:45:18 2023 -0700 Merge tag 'ata-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fix from Damien Le Moal: - Prevent the scsi disk driver from issuing a START STOP UNIT command for ATA devices during system resume as this causes various issues reported by multiple users. * tag 'ata-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata,scsi: do not issue START STOP UNIT on resume commit 95848dcb9d676738411a8ff70a9704039f1b3982 Author: Christoph Hellwig Date: Sat Aug 5 07:55:37 2023 +0200 zram: take device and not only bvec offset into account Commit af8b04c63708 ("zram: simplify bvec iteration in __zram_make_request") changed the bio iteration in zram to rely on the implicit capping to page boundaries in bio_for_each_segment. But it failed to care for the fact zram not only care about the page alignment of the bio payload, but also the page alignment into the device. For buffered I/O and swap those are the same, but for direct I/O or kernel internal I/O like XFS log buffer writes they can differ. Fix this by open coding bio_for_each_segment and limiting the bvec len so that it never crosses over a page alignment boundary in the device in addition to the payload boundary already taken care of by bio_iter_iovec. Cc: stable@vger.kernel.org Fixes: af8b04c63708 ("zram: simplify bvec iteration in __zram_make_request") Reported-by: Dusty Mabe Signed-off-by: Christoph Hellwig Acked-by: Sergey Senozhatsky Link: https://lore.kernel.org/r/20230805055537.147835-1-hch@lst.de Signed-off-by: Jens Axboe commit f6a691685962637e53371788fe2a72b171aedc68 Merge: 251a94f1f66e9 11260c3d608b5 Author: Linus Torvalds Date: Sat Aug 5 13:44:06 2023 -0700 Merge tag '6.5-rc4-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fix from Steve French: - Fix DFS interlink problem (different namespace) * tag '6.5-rc4-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6: smb: client: fix dfs link mount against w2k8 commit 251a94f1f66e909d75a774ac474a63bd9bc38382 Merge: 947c2a83584d3 86582e6189dd8 Author: Linus Torvalds Date: Sat Aug 5 13:16:17 2023 -0700 Merge tag 'powerpc-6.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix vmemmap altmap boundary check which could cause memory hotunplug failure - Create a dummy stackframe to fix ftrace stack unwind - Fix secondary thread bringup for Book3E ELFv2 kernels - Use early_ioremap/unmap() in via_calibrate_decr() Thanks to Aneesh Kumar K.V, Benjamin Gray, Christophe Leroy, David Hildenbrand, and Naveen N Rao. * tag 'powerpc-6.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/powermac: Use early_* IO variants in via_calibrate_decr() powerpc/64e: Fix secondary thread bringup for ELFv2 kernels powerpc/ftrace: Create a dummy stackframe to fix stack unwind powerpc/mm/altmap: Fix altmap boundary check commit 947c2a83584d3093efea1edf52430db47f11080f Merge: c9d26d8de10f7 99b2f159b6e76 Author: Linus Torvalds Date: Sat Aug 5 13:09:05 2023 -0700 Merge tag 'parisc-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture fixes from Helge Deller: - early fixmap preallocation to fix boot failures on kernel >= 6.4 - remove DMA leftover code in parport_gsc - drop old comments and code style fixes * tag 'parisc-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: unaligned: Add required spaces after ',' parport: gsc: remove DMA leftover code parisc: pci-dma: remove unused and dead EISA code and comment parisc/mm: preallocate fixmap page tables at init commit 51a26bb02ae58c7db6b4156d7e1e39cd79008757 Merge: 77107b08f0f29 3cb11fe244d51 Author: Greg Kroah-Hartman Date: Sat Aug 5 08:35:14 2023 +0200 Merge tag 'icc-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-linus Georgi writes: interconnect fixes for v6.5-rc This contains a fix for a potential issue on some Qualcomm SoCs where bit-masks should have been used to configure the Bus Clock Manager hardware, instead of bandwidth units. - interconnect: qcom: Add support for mask-based BCMs - interconnect: qcom: sm8450: add enable_mask for bcm nodes - interconnect: qcom: sm8550: add enable_mask for bcm nodes - interconnect: qcom: sa8775p: add enable_mask for bcm nodes Signed-off-by: Georgi Djakov * tag 'icc-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: interconnect: qcom: sa8775p: add enable_mask for bcm nodes interconnect: qcom: sm8550: add enable_mask for bcm nodes interconnect: qcom: sm8450: add enable_mask for bcm nodes interconnect: qcom: Add support for mask-based BCMs commit d25ddb7e788d34cf27ff1738d11a87cb4b67d446 Author: Remi Pommarel Date: Fri Aug 4 11:39:36 2023 +0200 batman-adv: Fix TT global entry leak when client roamed back When a client roamed back to a node before it got time to destroy the pending local entry (i.e. within the same originator interval) the old global one is directly removed from hash table and left as such. But because this entry had an extra reference taken at lookup (i.e using batadv_tt_global_hash_find) there is no way its memory will be reclaimed at any time causing the following memory leak: unreferenced object 0xffff0000073c8000 (size 18560): comm "softirq", pid 0, jiffies 4294907738 (age 228.644s) hex dump (first 32 bytes): 06 31 ac 12 c7 7a 05 00 01 00 00 00 00 00 00 00 .1...z.......... 2c ad be 08 00 80 ff ff 6c b6 be 08 00 80 ff ff ,.......l....... backtrace: [<00000000ee6e0ffa>] kmem_cache_alloc+0x1b4/0x300 [<000000000ff2fdbc>] batadv_tt_global_add+0x700/0xe20 [<00000000443897c7>] _batadv_tt_update_changes+0x21c/0x790 [<000000005dd90463>] batadv_tt_update_changes+0x3c/0x110 [<00000000a2d7fc57>] batadv_tt_tvlv_unicast_handler_v1+0xafc/0xe10 [<0000000011793f2a>] batadv_tvlv_containers_process+0x168/0x2b0 [<00000000b7cbe2ef>] batadv_recv_unicast_tvlv+0xec/0x1f4 [<0000000042aef1d8>] batadv_batman_skb_recv+0x25c/0x3a0 [<00000000bbd8b0a2>] __netif_receive_skb_core.isra.0+0x7a8/0xe90 [<000000004033d428>] __netif_receive_skb_one_core+0x64/0x74 [<000000000f39a009>] __netif_receive_skb+0x48/0xe0 [<00000000f2cd8888>] process_backlog+0x174/0x344 [<00000000507d6564>] __napi_poll+0x58/0x1f4 [<00000000b64ef9eb>] net_rx_action+0x504/0x590 [<00000000056fa5e4>] _stext+0x1b8/0x418 [<00000000878879d6>] run_ksoftirqd+0x74/0xa4 unreferenced object 0xffff00000bae1a80 (size 56): comm "softirq", pid 0, jiffies 4294910888 (age 216.092s) hex dump (first 32 bytes): 00 78 b1 0b 00 00 ff ff 0d 50 00 00 00 00 00 00 .x.......P...... 00 00 00 00 00 00 00 00 50 c8 3c 07 00 00 ff ff ........P.<..... backtrace: [<00000000ee6e0ffa>] kmem_cache_alloc+0x1b4/0x300 [<00000000d9aaa49e>] batadv_tt_global_add+0x53c/0xe20 [<00000000443897c7>] _batadv_tt_update_changes+0x21c/0x790 [<000000005dd90463>] batadv_tt_update_changes+0x3c/0x110 [<00000000a2d7fc57>] batadv_tt_tvlv_unicast_handler_v1+0xafc/0xe10 [<0000000011793f2a>] batadv_tvlv_containers_process+0x168/0x2b0 [<00000000b7cbe2ef>] batadv_recv_unicast_tvlv+0xec/0x1f4 [<0000000042aef1d8>] batadv_batman_skb_recv+0x25c/0x3a0 [<00000000bbd8b0a2>] __netif_receive_skb_core.isra.0+0x7a8/0xe90 [<000000004033d428>] __netif_receive_skb_one_core+0x64/0x74 [<000000000f39a009>] __netif_receive_skb+0x48/0xe0 [<00000000f2cd8888>] process_backlog+0x174/0x344 [<00000000507d6564>] __napi_poll+0x58/0x1f4 [<00000000b64ef9eb>] net_rx_action+0x504/0x590 [<00000000056fa5e4>] _stext+0x1b8/0x418 [<00000000878879d6>] run_ksoftirqd+0x74/0xa4 Releasing the extra reference from batadv_tt_global_hash_find even at roam back when batadv_tt_global_free is called fixes this memory leak. Cc: stable@vger.kernel.org Fixes: 068ee6e204e1 ("batman-adv: roaming handling mechanism redesign") Signed-off-by: Remi Pommarel Signed-off-by; Sven Eckelmann Signed-off-by: Simon Wunderlich commit c9d26d8de10f7c4decd10b6e75f5593c11ff9dfc Merge: 024ff300db339 ae9b14582ad03 Author: Linus Torvalds Date: Fri Aug 4 19:35:09 2023 -0700 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fixes from Stephen Boyd: "A few clk driver fixes for some SoC clk drivers: - Change a usleep() to udelay() to avoid scheduling while atomic in the Amlogic PLL code - Revert a patch to the Mediatek MT8183 driver that caused an out-of-bounds write - Return the right error value when devm_of_iomap() fails in imx93_clocks_probe() - Constrain the Kconfig for the fixed mmio clk so that it depends on HAS_IOMEM and can't be compiled on architectures such as s390" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: fixed-mmio: make COMMON_CLK_FIXED_MMIO depend on HAS_IOMEM clk: imx93: Propagate correct error in imx93_clocks_probe() clk: mediatek: mt8183: Add back SSPM related clocks clk: meson: change usleep_range() to udelay() for atomic context commit a47e598fbd8617967e49d85c49c22f9fc642704c Author: Eric Dumazet Date: Thu Aug 3 16:30:21 2023 +0000 dccp: fix data-race around dp->dccps_mss_cache dccp_sendmsg() reads dp->dccps_mss_cache before locking the socket. Same thing in do_dccp_getsockopt(). Add READ_ONCE()/WRITE_ONCE() annotations, and change dccp_sendmsg() to check again dccps_mss_cache after socket is locked. Fixes: 7c657876b63c ("[DCCP]: Initial implementation") Reported-by: syzbot Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230803163021.2958262-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit fc2ea6ab0a73b58328c61237017e28ba49b3a21e Merge: ec935188399d8 511b90e392501 Author: Jakub Kicinski Date: Fri Aug 4 18:26:29 2023 -0700 Merge branch 'mptcp-more-fixes-for-v6-5' Matthieu Baerts says: ==================== mptcp: more fixes for v6.5 Here is a new batch of fixes related to MPTCP for v6.5 and older. Patches 1 and 2 fix issues with MPTCP Join selftest when manually launched with '-i' parameter to use 'ip mptcp' tool instead of the dedicated one (pm_nl_ctl). The issues have been there since v5.18. Thank you Andrea for your first contributions to MPTCP code in the upstream kernel! Patch 3 avoids corrupting the data stream when trying to reset connections that have fallen back to TCP. This can happen from v6.1. Patch 4 fixes a race when doing a disconnect() and an accept() in parallel on a listener socket. The issue only happens in rare cases if the user is really unlucky since a fix that landed in v6.3 but backported up to v6.1. ==================== Link: https://lore.kernel.org/r/20230803-upstream-net-20230803-misc-fixes-6-5-v1-0-6671b1ab11cc@tessares.net Signed-off-by: Jakub Kicinski commit 511b90e39250135a7f900f1c3afbce25543018a2 Author: Paolo Abeni Date: Thu Aug 3 18:27:30 2023 +0200 mptcp: fix disconnect vs accept race Despite commit 0ad529d9fd2b ("mptcp: fix possible divide by zero in recvmsg()"), the mptcp protocol is still prone to a race between disconnect() (or shutdown) and accept. The root cause is that the mentioned commit checks the msk-level flag, but mptcp_stream_accept() does acquire the msk-level lock, as it can rely directly on the first subflow lock. As reported by Christoph than can lead to a race where an msk socket is accepted after that mptcp_subflow_queue_clean() releases the listener socket lock and just before it takes destructive actions leading to the following splat: BUG: kernel NULL pointer dereference, address: 0000000000000012 PGD 5a4ca067 P4D 5a4ca067 PUD 37d4c067 PMD 0 Oops: 0000 [#1] PREEMPT SMP CPU: 2 PID: 10955 Comm: syz-executor.5 Not tainted 6.5.0-rc1-gdc7b257ee5dd #37 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014 RIP: 0010:mptcp_stream_accept+0x1ee/0x2f0 include/net/inet_sock.h:330 Code: 0a 09 00 48 8b 1b 4c 39 e3 74 07 e8 bc 7c 7f fe eb a1 e8 b5 7c 7f fe 4c 8b 6c 24 08 eb 05 e8 a9 7c 7f fe 49 8b 85 d8 09 00 00 <0f> b6 40 12 88 44 24 07 0f b6 6c 24 07 bf 07 00 00 00 89 ee e8 89 RSP: 0018:ffffc90000d07dc0 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff888037e8d020 RCX: ffff88803b093300 RDX: 0000000000000000 RSI: ffffffff833822c5 RDI: ffffffff8333896a RBP: 0000607f82031520 R08: ffff88803b093300 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000003e83 R12: ffff888037e8d020 R13: ffff888037e8c680 R14: ffff888009af7900 R15: ffff888009af6880 FS: 00007fc26d708640(0000) GS:ffff88807dd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000012 CR3: 0000000066bc5001 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: do_accept+0x1ae/0x260 net/socket.c:1872 __sys_accept4+0x9b/0x110 net/socket.c:1913 __do_sys_accept4 net/socket.c:1954 [inline] __se_sys_accept4 net/socket.c:1951 [inline] __x64_sys_accept4+0x20/0x30 net/socket.c:1951 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x47/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 Address the issue by temporary removing the pending request socket from the accept queue, so that racing accept() can't touch them. After depleting the msk - the ssk still exists, as plain TCP sockets, re-insert them into the accept queue, so that later inet_csk_listen_stop() will complete the tcp socket disposal. Fixes: 2a6a870e44dd ("mptcp: stops worker on unaccepted sockets at listener close") Cc: stable@vger.kernel.org Reported-by: Christoph Paasch Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/423 Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20230803-upstream-net-20230803-misc-fixes-6-5-v1-4-6671b1ab11cc@tessares.net Signed-off-by: Jakub Kicinski commit ff18f9ef30ee87740f741b964375d0cfb84e1ec2 Author: Paolo Abeni Date: Thu Aug 3 18:27:29 2023 +0200 mptcp: avoid bogus reset on fallback close Since the blamed commit, the MPTCP protocol unconditionally sends TCP resets on all the subflows on disconnect(). That fits full-blown MPTCP sockets - to implement the fastclose mechanism - but causes unexpected corruption of the data stream, caught as sporadic self-tests failures. Fixes: d21f83485518 ("mptcp: use fastclose on more edge scenarios") Cc: stable@vger.kernel.org Tested-by: Matthieu Baerts Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/419 Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20230803-upstream-net-20230803-misc-fixes-6-5-v1-3-6671b1ab11cc@tessares.net Signed-off-by: Jakub Kicinski commit c8c101ae390a3e817369e94a6f12a1ddea420702 Author: Andrea Claudi Date: Thu Aug 3 18:27:28 2023 +0200 selftests: mptcp: join: fix 'implicit EP' test mptcp_join 'implicit EP' test currently fails when using ip mptcp: $ ./mptcp_join.sh -iI 001 implicit EP creation[fail] expected '10.0.2.2 10.0.2.2 id 1 implicit' found '10.0.2.2 id 1 rawflags 10 ' Error: too many addresses or duplicate one: -22. ID change is prevented[fail] expected '10.0.2.2 10.0.2.2 id 1 implicit' found '10.0.2.2 id 1 rawflags 10 ' modif is allowed[fail] expected '10.0.2.2 10.0.2.2 id 1 signal' found '10.0.2.2 id 1 signal ' This happens because of two reasons: - iproute v6.3.0 does not support the implicit flag, fixed with iproute2-next commit 3a2535a41854 ("mptcp: add support for implicit flag") - pm_nl_check_endpoint wrongly expects the ip address to be repeated two times in iproute output, and does not account for a final whitespace in it. This fixes the issue trimming the whitespace in the output string and removing the double address in the expected string. Fixes: 69c6ce7b6eca ("selftests: mptcp: add implicit endpoint test case") Cc: stable@vger.kernel.org Signed-off-by: Andrea Claudi Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20230803-upstream-net-20230803-misc-fixes-6-5-v1-2-6671b1ab11cc@tessares.net Signed-off-by: Jakub Kicinski commit aaf2123a5cf46dbd97f84b6eee80269758064d93 Author: Andrea Claudi Date: Thu Aug 3 18:27:27 2023 +0200 selftests: mptcp: join: fix 'delete and re-add' test mptcp_join 'delete and re-add' test fails when using ip mptcp: $ ./mptcp_join.sh -iI 002 delete and re-add before delete[ ok ] mptcp_info subflows=1 [ ok ] Error: argument "ADDRESS" is wrong: invalid for non-zero id address after delete[fail] got 2:2 subflows expected 1 This happens because endpoint delete includes an ip address while id is not 0, contrary to what is indicated in the ip mptcp man page: "When used with the delete id operation, an IFADDR is only included when the ID is 0." This fixes the issue using the $addr variable in pm_nl_del_endpoint() only when id is 0. Fixes: 34aa6e3bccd8 ("selftests: mptcp: add ip mptcp wrappers") Cc: stable@vger.kernel.org Signed-off-by: Andrea Claudi Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20230803-upstream-net-20230803-misc-fixes-6-5-v1-1-6671b1ab11cc@tessares.net Signed-off-by: Jakub Kicinski commit ec935188399d8f7f8618c7ec1c83eb6da8d3118f Merge: 8a98961777840 136a1b434bbb9 Author: Jakub Kicinski Date: Fri Aug 4 18:24:53 2023 -0700 Merge branch 'tunnels-fix-ipv4-pmtu-icmp-checksum' Florian Westphal says: ==================== tunnels: fix ipv4 pmtu icmp checksum The checksum of the generated ipv4 icmp pmtud message is only correct if the skb that causes the icmp error generation is linear. Fix this and add a selftest for this. ==================== Link: https://lore.kernel.org/r/20230803152653.29535-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit 136a1b434bbb90c5e50831646ad0680c744c79bb Author: Florian Westphal Date: Thu Aug 3 17:26:50 2023 +0200 selftests: net: test vxlan pmtu exceptions with tcp TCP might get stuck if a nonlinear skb exceeds the path MTU, icmp error contains an incorrect icmp checksum in that case. Extend the existing test for vxlan to also send at least 1MB worth of data via TCP in addition to the existing 'large icmp packet adds route exception'. On my test VM this fails due to 0-size output file without "tunnels: fix kasan splat when generating ipv4 pmtu error". Signed-off-by: Florian Westphal Link: https://lore.kernel.org/r/20230803152653.29535-3-fw@strlen.de Signed-off-by: Jakub Kicinski commit 6a7ac3d20593865209dceb554d8b3f094c6bd940 Author: Florian Westphal Date: Thu Aug 3 17:26:49 2023 +0200 tunnels: fix kasan splat when generating ipv4 pmtu error If we try to emit an icmp error in response to a nonliner skb, we get BUG: KASAN: slab-out-of-bounds in ip_compute_csum+0x134/0x220 Read of size 4 at addr ffff88811c50db00 by task iperf3/1691 CPU: 2 PID: 1691 Comm: iperf3 Not tainted 6.5.0-rc3+ #309 [..] kasan_report+0x105/0x140 ip_compute_csum+0x134/0x220 iptunnel_pmtud_build_icmp+0x554/0x1020 skb_tunnel_check_pmtu+0x513/0xb80 vxlan_xmit_one+0x139e/0x2ef0 vxlan_xmit+0x1867/0x2760 dev_hard_start_xmit+0x1ee/0x4f0 br_dev_queue_push_xmit+0x4d1/0x660 [..] ip_compute_csum() cannot deal with nonlinear skbs, so avoid it. After this change, splat is gone and iperf3 is no longer stuck. Fixes: 4cb47a8644cc ("tunnels: PMTU discovery support for directly bridged IP packets") Signed-off-by: Florian Westphal Link: https://lore.kernel.org/r/20230803152653.29535-2-fw@strlen.de Signed-off-by: Jakub Kicinski commit 2746f13f6f1df7999001d6595b16f789ecc28ad1 Author: Biju Das Date: Tue Jul 25 18:51:40 2023 +0100 clk: Fix undefined reference to `clk_rate_exclusive_{get,put}' The COMMON_CLK config is not enabled in some of the architectures. This causes below build issues: pwm-rz-mtu3.c:(.text+0x114): undefined reference to `clk_rate_exclusive_put' pwm-rz-mtu3.c:(.text+0x32c): undefined reference to `clk_rate_exclusive_get' Fix these issues by moving clk_rate_exclusive_{get,put} inside COMMON_CLK code block, as clk.c is enabled by COMMON_CLK. Fixes: 55e9b8b7b806 ("clk: add clk_rate_exclusive api") Reported-by: kernel test robot Closes: https://lore.kernel.org/all/202307251752.vLfmmhYm-lkp@intel.com/ Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230725175140.361479-1-biju.das.jz@bp.renesas.com Signed-off-by: Stephen Boyd commit dd1df82ce27a05c7cf0bc5387978412e35fbdaaf Author: Francesco Dolcini Date: Sat Jul 29 00:26:39 2023 +0200 clk: keystone: syscon-clk: Fix audio refclk Audio REFCLK's are not working correctly, trying to use them lead to the following errors: [ 6.575277] of_clk_hw_onecell_get: invalid index 4294934528 [ 6.581515] wm8904 1-001a: Failed to get MCLK [ 6.586290] wm8904: probe of 1-001a failed with error -2 The issue is that Audio REFCLK has #clock-cells = 0 [1], while the driver is registering those clocks assuming they have one cells. Fix this by registering the clock with of_clk_hw_simple_get() when there is only one instance, e.g. "audio_refclk". [1] Documentation/devicetree/bindings/clock/ti,am62-audio-refclk.yaml Fixes: 6acab96ee337 ("clk: keystone: syscon-clk: Add support for audio refclk") Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20230728222639.110409-1-francesco@dolcini.it [sboyd@kernel.org: Simplify if-return-else logic] Signed-off-by: Stephen Boyd commit 8a9896177784063d01068293caea3f74f6830ff6 Author: Eric Dumazet Date: Thu Aug 3 14:56:00 2023 +0000 net/packet: annotate data-races around tp->status Another syzbot report [1] is about tp->status lockless reads from __packet_get_status() [1] BUG: KCSAN: data-race in __packet_rcv_has_room / __packet_set_status write to 0xffff888117d7c080 of 8 bytes by interrupt on cpu 0: __packet_set_status+0x78/0xa0 net/packet/af_packet.c:407 tpacket_rcv+0x18bb/0x1a60 net/packet/af_packet.c:2483 deliver_skb net/core/dev.c:2173 [inline] __netif_receive_skb_core+0x408/0x1e80 net/core/dev.c:5337 __netif_receive_skb_one_core net/core/dev.c:5491 [inline] __netif_receive_skb+0x57/0x1b0 net/core/dev.c:5607 process_backlog+0x21f/0x380 net/core/dev.c:5935 __napi_poll+0x60/0x3b0 net/core/dev.c:6498 napi_poll net/core/dev.c:6565 [inline] net_rx_action+0x32b/0x750 net/core/dev.c:6698 __do_softirq+0xc1/0x265 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x57/0xa0 kernel/softirq.c:650 sysvec_apic_timer_interrupt+0x6d/0x80 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 smpboot_thread_fn+0x33c/0x4a0 kernel/smpboot.c:112 kthread+0x1d7/0x210 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 read to 0xffff888117d7c080 of 8 bytes by interrupt on cpu 1: __packet_get_status net/packet/af_packet.c:436 [inline] packet_lookup_frame net/packet/af_packet.c:524 [inline] __tpacket_has_room net/packet/af_packet.c:1255 [inline] __packet_rcv_has_room+0x3f9/0x450 net/packet/af_packet.c:1298 tpacket_rcv+0x275/0x1a60 net/packet/af_packet.c:2285 deliver_skb net/core/dev.c:2173 [inline] dev_queue_xmit_nit+0x38a/0x5e0 net/core/dev.c:2243 xmit_one net/core/dev.c:3574 [inline] dev_hard_start_xmit+0xcf/0x3f0 net/core/dev.c:3594 __dev_queue_xmit+0xefb/0x1d10 net/core/dev.c:4244 dev_queue_xmit include/linux/netdevice.h:3088 [inline] can_send+0x4eb/0x5d0 net/can/af_can.c:276 bcm_can_tx+0x314/0x410 net/can/bcm.c:302 bcm_tx_timeout_handler+0xdb/0x260 __run_hrtimer kernel/time/hrtimer.c:1685 [inline] __hrtimer_run_queues+0x217/0x700 kernel/time/hrtimer.c:1749 hrtimer_run_softirq+0xd6/0x120 kernel/time/hrtimer.c:1766 __do_softirq+0xc1/0x265 kernel/softirq.c:571 run_ksoftirqd+0x17/0x20 kernel/softirq.c:939 smpboot_thread_fn+0x30a/0x4a0 kernel/smpboot.c:164 kthread+0x1d7/0x210 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 value changed: 0x0000000000000000 -> 0x0000000020000081 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 19 Comm: ksoftirqd/1 Not tainted 6.4.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Fixes: 69e3c75f4d54 ("net: TX_RING and packet mmap") Reported-by: syzbot Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/20230803145600.2937518-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 024ff300db33968c133435a146d51ac22db27374 Merge: e661f98c82832 6ad0f2f91ad14 Author: Linus Torvalds Date: Fri Aug 4 17:16:14 2023 -0700 Merge tag 'hyperv-fixes-signed-20230804' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv fixes from Wei Liu: - Fix a bug in a python script for Hyper-V (Ani Sinha) - Workaround a bug in Hyper-V when IBT is enabled (Michael Kelley) - Fix an issue parsing MP table when Linux runs in VTL2 (Saurabh Sengar) - Several cleanup patches (Nischala Yelchuri, Kameron Carr, YueHaibing, ZhiHu) * tag 'hyperv-fixes-signed-20230804' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: Drivers: hv: vmbus: Remove unused extern declaration vmbus_ontimer() x86/hyperv: add noop functions to x86_init mpparse functions vmbus_testing: fix wrong python syntax for integer value comparison x86/hyperv: fix a warning in mshyperv.h x86/hyperv: Disable IBT when hypercall page lacks ENDBR instruction x86/hyperv: Improve code for referencing hyperv_pcpu_input_arg Drivers: hv: Change hv_free_hyperv_page() to take void * argument commit e661f98c82832ddb76423f57dffb4ba6256e0fc6 Merge: ea4f142ffa876 640c503d7dbd7 Author: Linus Torvalds Date: Fri Aug 4 16:04:37 2023 -0700 Merge tag 'riscv-for-linus-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - A pair of fixes for build-related failures in the selftests - A fix for a sparse warning in acpi_os_ioremap() - A fix to restore the kernel PA offset in vmcoreinfo, to fix crash handling * tag 'riscv-for-linus-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: Documentation: kdump: Add va_kernel_pa_offset for RISCV64 riscv: Export va_kernel_pa_offset in vmcoreinfo RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address selftests: riscv: Fix compilation error with vstate_exec_nolibc.c selftests/riscv: fix potential build failure during the "emit_tests" step commit ea4f142ffa876ee4e7e99bbd8d666e0e81cbcc2c Merge: e6fda526d9db2 16e95a62eed18 Author: Linus Torvalds Date: Fri Aug 4 15:54:03 2023 -0700 Merge tag 'pm-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fix from Rafael Wysocki: "Fix a sparse warning triggered by the TPMI interface recently added to the Intel RAPL power capping driver (Zhang Rui)" * tag 'pm-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: powercap: intel_rapl: Fix a sparse warning in TPMI interface commit a94c16a2fda010866b8858a386a8bfbeba4f72c5 Author: Vladimir Oltean Date: Thu Aug 3 16:42:53 2023 +0300 net: dsa: ocelot: call dsa_tag_8021q_unregister() under rtnl_lock() on driver remove When the tagging protocol in current use is "ocelot-8021q" and we unbind the driver, we see this splat: $ echo '0000:00:00.2' > /sys/bus/pci/drivers/fsl_enetc/unbind mscc_felix 0000:00:00.5 swp0: left promiscuous mode sja1105 spi2.0: Link is Down DSA: tree 1 torn down mscc_felix 0000:00:00.5 swp2: left promiscuous mode sja1105 spi2.2: Link is Down DSA: tree 3 torn down fsl_enetc 0000:00:00.2 eno2: left promiscuous mode mscc_felix 0000:00:00.5: Link is Down ------------[ cut here ]------------ RTNL: assertion failed at net/dsa/tag_8021q.c (409) WARNING: CPU: 1 PID: 329 at net/dsa/tag_8021q.c:409 dsa_tag_8021q_unregister+0x12c/0x1a0 Modules linked in: CPU: 1 PID: 329 Comm: bash Not tainted 6.5.0-rc3+ #771 pc : dsa_tag_8021q_unregister+0x12c/0x1a0 lr : dsa_tag_8021q_unregister+0x12c/0x1a0 Call trace: dsa_tag_8021q_unregister+0x12c/0x1a0 felix_tag_8021q_teardown+0x130/0x150 felix_teardown+0x3c/0xd8 dsa_tree_teardown_switches+0xbc/0xe0 dsa_unregister_switch+0x168/0x260 felix_pci_remove+0x30/0x60 pci_device_remove+0x4c/0x100 device_release_driver_internal+0x188/0x288 device_links_unbind_consumers+0xfc/0x138 device_release_driver_internal+0xe0/0x288 device_driver_detach+0x24/0x38 unbind_store+0xd8/0x108 drv_attr_store+0x30/0x50 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ RTNL: assertion failed at net/8021q/vlan_core.c (376) WARNING: CPU: 1 PID: 329 at net/8021q/vlan_core.c:376 vlan_vid_del+0x1b8/0x1f0 CPU: 1 PID: 329 Comm: bash Tainted: G W 6.5.0-rc3+ #771 pc : vlan_vid_del+0x1b8/0x1f0 lr : vlan_vid_del+0x1b8/0x1f0 dsa_tag_8021q_unregister+0x8c/0x1a0 felix_tag_8021q_teardown+0x130/0x150 felix_teardown+0x3c/0xd8 dsa_tree_teardown_switches+0xbc/0xe0 dsa_unregister_switch+0x168/0x260 felix_pci_remove+0x30/0x60 pci_device_remove+0x4c/0x100 device_release_driver_internal+0x188/0x288 device_links_unbind_consumers+0xfc/0x138 device_release_driver_internal+0xe0/0x288 device_driver_detach+0x24/0x38 unbind_store+0xd8/0x108 drv_attr_store+0x30/0x50 DSA: tree 0 torn down This was somewhat not so easy to spot, because "ocelot-8021q" is not the default tagging protocol, and thus, not everyone who tests the unbinding path may have switched to it beforehand. The default felix_tag_npi_teardown() does not require rtnl_lock() to be held. Fixes: 7c83a7c539ab ("net: dsa: add a second tagger for Ocelot switches based on tag_8021q") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20230803134253.2711124-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 17ebf8a4c38b5481c29623f5e003fdf7583947f9 Author: Xiang Yang Date: Thu Aug 3 07:24:38 2023 +0000 mptcp: fix the incorrect judgment for msk->cb_flags Coccicheck reports the error below: net/mptcp/protocol.c:3330:15-28: ERROR: test of a variable/field address Since the address of msk->cb_flags is used in __test_and_clear_bit, the address should not be NULL. The judgment for if (unlikely(msk->cb_flags)) will always be true, we should check the real value of msk->cb_flags here. Fixes: 65a569b03ca8 ("mptcp: optimize release_cb for the common case") Signed-off-by: Xiang Yang Reviewed-by: Matthieu Baerts Link: https://lore.kernel.org/r/20230803072438.1847500-1-xiangyang3@huawei.com Signed-off-by: Jakub Kicinski commit d5ad9aae13dcced333c1a7816ff0a4fbbb052466 Author: Mark Brown Date: Fri Aug 4 20:22:11 2023 +0100 selftests/rseq: Fix build with undefined __weak Commit 3bcbc20942db ("selftests/rseq: Play nice with binaries statically linked against glibc 2.35+") which is now in Linus' tree introduced uses of __weak but did nothing to ensure that a definition is provided for it resulting in build failures for the rseq tests: rseq.c:41:1: error: unknown type name '__weak' __weak ptrdiff_t __rseq_offset; ^ rseq.c:41:17: error: expected ';' after top level declarator __weak ptrdiff_t __rseq_offset; ^ ; rseq.c:42:1: error: unknown type name '__weak' __weak unsigned int __rseq_size; ^ rseq.c:43:1: error: unknown type name '__weak' __weak unsigned int __rseq_flags; Fix this by using the definition from tools/include compiler.h. Fixes: 3bcbc20942db ("selftests/rseq: Play nice with binaries statically linked against glibc 2.35+") Signed-off-by: Mark Brown Message-Id: <20230804-kselftest-rseq-build-v1-1-015830b66aa9@kernel.org> Signed-off-by: Paolo Bonzini commit 3bfc37d92687b4b19056998cebc02f94fbc81427 Author: Bjorn Helgaas Date: Fri Aug 4 11:54:43 2023 -0500 Revert "PCI: mvebu: Mark driver as BROKEN" b3574f579ece ("PCI: mvebu: Mark driver as BROKEN") made it impossible to enable the pci-mvebu driver. The driver does have known problems, but as Russell and Uwe reported, it does work in some configurations, so removing it broke some working setups. Revert b3574f579ece so pci-mvebu is available. Reported-by: Russell King (Oracle) Link: https://lore.kernel.org/r/ZMzicVQEyHyZzBOc@shell.armlinux.org.uk Reported-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230804134622.pmbymxtzxj2yfhri@pengutronix.de Signed-off-by: Bjorn Helgaas commit 5f1fc67f2cb8d3035d3acd273b48b97835af8afd Author: SeongJae Park Date: Sat Jul 29 20:37:32 2023 +0000 mm/damon/core: initialize damo_filter->list from damos_new_filter() damos_new_filter() is not initializing the list field of newly allocated filter object. However, DAMON sysfs interface and DAMON_RECLAIM are not initializing it after calling damos_new_filter(). As a result, accessing uninitialized memory is possible. Actually, adding multiple DAMOS filters via DAMON sysfs interface caused NULL pointer dereferencing. Initialize the field just after the allocation from damos_new_filter(). Link: https://lkml.kernel.org/r/20230729203733.38949-2-sj@kernel.org Fixes: 98def236f63c ("mm/damon/core: implement damos filter") Signed-off-by: SeongJae Park Cc: Signed-off-by: Andrew Morton commit f8654743a0e6909dc634cbfad6db6816f10f3399 Author: Ryusuke Konishi Date: Sat Jul 29 04:13:18 2023 +0900 nilfs2: fix use-after-free of nilfs_root in dirtying inodes via iput During unmount process of nilfs2, nothing holds nilfs_root structure after nilfs2 detaches its writer in nilfs_detach_log_writer(). Previously, nilfs_evict_inode() could cause use-after-free read for nilfs_root if inodes are left in "garbage_list" and released by nilfs_dispose_list at the end of nilfs_detach_log_writer(), and this bug was fixed by commit 9b5a04ac3ad9 ("nilfs2: fix use-after-free bug of nilfs_root in nilfs_evict_inode()"). However, it turned out that there is another possibility of UAF in the call path where mark_inode_dirty_sync() is called from iput(): nilfs_detach_log_writer() nilfs_dispose_list() iput() mark_inode_dirty_sync() __mark_inode_dirty() nilfs_dirty_inode() __nilfs_mark_inode_dirty() nilfs_load_inode_block() --> causes UAF of nilfs_root struct This can happen after commit 0ae45f63d4ef ("vfs: add support for a lazytime mount option"), which changed iput() to call mark_inode_dirty_sync() on its final reference if i_state has I_DIRTY_TIME flag and i_nlink is non-zero. This issue appears after commit 28a65b49eb53 ("nilfs2: do not write dirty data after degenerating to read-only") when using the syzbot reproducer, but the issue has potentially existed before. Fix this issue by adding a "purging flag" to the nilfs structure, setting that flag while disposing the "garbage_list" and checking it in __nilfs_mark_inode_dirty(). Unlike commit 9b5a04ac3ad9 ("nilfs2: fix use-after-free bug of nilfs_root in nilfs_evict_inode()"), this patch does not rely on ns_writer to determine whether to skip operations, so as not to break recovery on mount. The nilfs_salvage_orphan_logs routine dirties the buffer of salvaged data before attaching the log writer, so changing __nilfs_mark_inode_dirty() to skip the operation when ns_writer is NULL will cause recovery write to fail. The purpose of using the cleanup-only flag is to allow for narrowing of such conditions. Link: https://lkml.kernel.org/r/20230728191318.33047-1-konishi.ryusuke@gmail.com Signed-off-by: Ryusuke Konishi Reported-by: syzbot+74db8b3087f293d3a13a@syzkaller.appspotmail.com Closes: https://lkml.kernel.org/r/000000000000b4e906060113fd63@google.com Fixes: 0ae45f63d4ef ("vfs: add support for a lazytime mount option") Tested-by: Ryusuke Konishi Cc: # 4.0+ Signed-off-by: Andrew Morton commit fac2650276eced3c94bcdbc21d0e5be637c1e582 Author: Johannes Weiner Date: Tue Aug 1 09:56:32 2023 -0400 selftests: cgroup: fix test_kmem_basic false positives This test fails routinely in our prod testing environment, and I can reproduce it locally as well. The test allocates dcache inside a cgroup, then drops the memory limit and checks that usage drops correspondingly. The reason it fails is because dentries are freed with an RCU delay - a debugging sleep shows that usage drops as expected shortly after. Insert a 1s sleep after dropping the limit. This should be good enough, assuming that machines running those tests are otherwise not very busy. Link: https://lkml.kernel.org/r/20230801135632.1768830-1-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Paul E. McKenney Cc: Michal Hocko Cc: Roman Gushchin Signed-off-by: Andrew Morton commit 17457784004c84178798432a029ab20e14f728b1 Author: Lorenzo Stoakes Date: Mon Jul 31 22:50:21 2023 +0100 fs/proc/kcore: reinstate bounce buffer for KCORE_TEXT regions Some architectures do not populate the entire range categorised by KCORE_TEXT, so we must ensure that the kernel address we read from is valid. Unfortunately there is no solution currently available to do so with a purely iterator solution so reinstate the bounce buffer in this instance so we can use copy_from_kernel_nofault() in order to avoid page faults when regions are unmapped. This change partly reverts commit 2e1c0170771e ("fs/proc/kcore: avoid bounce buffer for ktext data"), reinstating the bounce buffer, but adapts the code to continue to use an iterator. [lstoakes@gmail.com: correct comment to be strictly correct about reasoning] Link: https://lkml.kernel.org/r/525a3f14-74fa-4c22-9fca-9dab4de8a0c3@lucifer.local Link: https://lkml.kernel.org/r/20230731215021.70911-1-lstoakes@gmail.com Fixes: 2e1c0170771e ("fs/proc/kcore: avoid bounce buffer for ktext data") Signed-off-by: Lorenzo Stoakes Reported-by: Jiri Olsa Closes: https://lore.kernel.org/all/ZHc2fm+9daF6cgCE@krava Tested-by: Jiri Olsa Tested-by: Will Deacon Cc: Alexander Viro Cc: Ard Biesheuvel Cc: Baoquan He Cc: Catalin Marinas Cc: David Hildenbrand Cc: Jens Axboe Cc: Kefeng Wang Cc: Liu Shixin Cc: Matthew Wilcox Cc: Mike Galbraith Cc: Thorsten Leemhuis Cc: Uladzislau Rezki (Sony) Cc: Signed-off-by: Andrew Morton commit d1ef9dba07bf637995202d0efd29c2fea19e809c Author: Liam R. Howlett Date: Mon Jul 31 13:55:42 2023 -0400 MAINTAINERS: add maple tree mailing list There is a mailing list for the maple tree development. Add the list to the maple tree entry of the MAINTAINERS file so patches will be sent to interested parties. Link: https://lkml.kernel.org/r/20230731175542.1653200-1-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Andrew Morton commit 493614da0d4e8d8bb37c3c558e0c01de20344cff Author: Johannes Weiner Date: Mon Jul 31 13:24:50 2023 -0400 mm: compaction: fix endless looping over same migrate block During stress testing, the following situation was observed: 70 root 39 19 0 0 0 R 100.0 0.0 959:29.92 khugepaged 310936 root 20 0 84416 25620 512 R 99.7 1.5 642:37.22 hugealloc Tracing shows isolate_migratepages_block() endlessly looping over the first block in the DMA zone: hugealloc-310936 [001] ..... 237297.415718: mm_compaction_finished: node=0 zone=DMA order=9 ret=no_suitable_page hugealloc-310936 [001] ..... 237297.415718: mm_compaction_isolate_migratepages: range=(0x1 ~ 0x400) nr_scanned=513 nr_taken=0 hugealloc-310936 [001] ..... 237297.415718: mm_compaction_finished: node=0 zone=DMA order=9 ret=no_suitable_page hugealloc-310936 [001] ..... 237297.415718: mm_compaction_isolate_migratepages: range=(0x1 ~ 0x400) nr_scanned=513 nr_taken=0 hugealloc-310936 [001] ..... 237297.415718: mm_compaction_finished: node=0 zone=DMA order=9 ret=no_suitable_page hugealloc-310936 [001] ..... 237297.415718: mm_compaction_isolate_migratepages: range=(0x1 ~ 0x400) nr_scanned=513 nr_taken=0 hugealloc-310936 [001] ..... 237297.415718: mm_compaction_finished: node=0 zone=DMA order=9 ret=no_suitable_page hugealloc-310936 [001] ..... 237297.415718: mm_compaction_isolate_migratepages: range=(0x1 ~ 0x400) nr_scanned=513 nr_taken=0 The problem is that the functions tries to test and set the skip bit once on the block, to avoid skipping on its own skip-set, using pageblock_aligned() on the pfn as a test. But because this is the DMA zone which starts at pfn 1, this is never true for the first block, and the skip bit isn't set or tested at all. As a result, fast_find_migrateblock() returns the same pageblock over and over. If the pfn isn't pageblock-aligned, also check if it's the start of the zone to ensure test-and-set-exactly-once on unaligned ranges. Thanks to Vlastimil Babka for the help in debugging this. Link: https://lkml.kernel.org/r/20230731172450.1632195-1-hannes@cmpxchg.org Fixes: 90ed667c03fe ("Revert "Revert "mm/compaction: fix set skip in fast_find_migrateblock""") Signed-off-by: Johannes Weiner Reviewed-by: Vlastimil Babka Acked-by: Mel Gorman Reviewed-by: Baolin Wang Signed-off-by: Andrew Morton commit 65294de30cb8bc7659e445f7be2846af9ed35499 Author: Ayush Jain Date: Fri Jul 28 22:09:51 2023 +0530 selftests: mm: ksm: fix incorrect evaluation of parameter A missing break in kms_tests leads to kselftest hang when the parameter -s is used. In current code flow because of missing break in -s, -t parses args spilled from -s and as -t accepts only valid values as 0,1 so any arg in -s >1 or <0, gets in ksm_test failure This went undetected since, before the addition of option -t, the next case -M would immediately break out of the switch statement but that is no longer the case Add the missing break statement. ----Before---- ./ksm_tests -H -s 100 Invalid merge type ----After---- ./ksm_tests -H -s 100 Number of normal pages: 0 Number of huge pages: 50 Total size: 100 MiB Total time: 0.401732682 s Average speed: 248.922 MiB/s Link: https://lkml.kernel.org/r/20230728163952.4634-1-ayush.jain3@amd.com Fixes: 07115fcc15b4 ("selftests/mm: add new selftests for KSM") Signed-off-by: Ayush Jain Reviewed-by: David Hildenbrand Cc: Stefan Roesch Cc: Signed-off-by: Andrew Morton commit 32c877191e022b55fe3a374f3d7e9fb5741c514d Author: Mike Kravetz Date: Tue Jul 11 15:09:41 2023 -0700 hugetlb: do not clear hugetlb dtor until allocating vmemmap Patch series "Fix hugetlb free path race with memory errors". In the discussion of Jiaqi Yan's series "Improve hugetlbfs read on HWPOISON hugepages" the race window was discovered. https://lore.kernel.org/linux-mm/20230616233447.GB7371@monkey/ Freeing a hugetlb page back to low level memory allocators is performed in two steps. 1) Under hugetlb lock, remove page from hugetlb lists and clear destructor 2) Outside lock, allocate vmemmap if necessary and call low level free Between these two steps, the hugetlb page will appear as a normal compound page. However, vmemmap for tail pages could be missing. If a memory error occurs at this time, we could try to update page flags non-existant page structs. A much more detailed description is in the first patch. The first patch addresses the race window. However, it adds a hugetlb_lock lock/unlock cycle to every vmemmap optimized hugetlb page free operation. This could lead to slowdowns if one is freeing a large number of hugetlb pages. The second path optimizes the update_and_free_pages_bulk routine to only take the lock once in bulk operations. The second patch is technically not a bug fix, but includes a Fixes tag and Cc stable to avoid a performance regression. It can be combined with the first, but was done separately make reviewing easier. This patch (of 2): Freeing a hugetlb page and releasing base pages back to the underlying allocator such as buddy or cma is performed in two steps: - remove_hugetlb_folio() is called to remove the folio from hugetlb lists, get a ref on the page and remove hugetlb destructor. This all must be done under the hugetlb lock. After this call, the page can be treated as a normal compound page or a collection of base size pages. - update_and_free_hugetlb_folio() is called to allocate vmemmap if needed and the free routine of the underlying allocator is called on the resulting page. We can not hold the hugetlb lock here. One issue with this scheme is that a memory error could occur between these two steps. In this case, the memory error handling code treats the old hugetlb page as a normal compound page or collection of base pages. It will then try to SetPageHWPoison(page) on the page with an error. If the page with error is a tail page without vmemmap, a write error will occur when trying to set the flag. Address this issue by modifying remove_hugetlb_folio() and update_and_free_hugetlb_folio() such that the hugetlb destructor is not cleared until after allocating vmemmap. Since clearing the destructor requires holding the hugetlb lock, the clearing is done in remove_hugetlb_folio() if the vmemmap is present. This saves a lock/unlock cycle. Otherwise, destructor is cleared in update_and_free_hugetlb_folio() after allocating vmemmap. Note that this will leave hugetlb pages in a state where they are marked free (by hugetlb specific page flag) and have a ref count. This is not a normal state. The only code that would notice is the memory error code, and it is set up to retry in such a case. A subsequent patch will create a routine to do bulk processing of vmemmap allocation. This will eliminate a lock/unlock cycle for each hugetlb page in the case where we are freeing a large number of pages. Link: https://lkml.kernel.org/r/20230711220942.43706-1-mike.kravetz@oracle.com Link: https://lkml.kernel.org/r/20230711220942.43706-2-mike.kravetz@oracle.com Fixes: ad2fa3717b74 ("mm: hugetlb: alloc the vmemmap pages associated with each HugeTLB page") Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Tested-by: Naoya Horiguchi Cc: Axel Rasmussen Cc: James Houghton Cc: Jiaqi Yan Cc: Miaohe Lin Cc: Michal Hocko Cc: Signed-off-by: Andrew Morton commit faeb2ff2c1c5cb60ce0da193580b256c941f99ca Author: Miaohe Lin Date: Thu Jul 27 19:56:42 2023 +0800 mm: memory-failure: avoid false hwpoison page mapped error info folio->_mapcount is overloaded in SLAB, so folio_mapped() has to be done after folio_test_slab() is checked. Otherwise slab folio might be treated as a mapped folio leading to false 'Someone maps the hwpoison page' error info. Link: https://lkml.kernel.org/r/20230727115643.639741-4-linmiaohe@huawei.com Fixes: 230ac719c500 ("mm/hwpoison: don't try to unpoison containment-failed pages") Signed-off-by: Miaohe Lin Reviewed-by: Matthew Wilcox (Oracle) Acked-by: Naoya Horiguchi Cc: Kefeng Wang Cc: Signed-off-by: Andrew Morton commit f29623e4a599c295cc8f518c8e4bb7848581a14d Author: Miaohe Lin Date: Thu Jul 27 19:56:41 2023 +0800 mm: memory-failure: fix potential unexpected return value from unpoison_memory() If unpoison_memory() fails to clear page hwpoisoned flag, return value ret is expected to be -EBUSY. But when get_hwpoison_page() returns 1 and fails to clear page hwpoisoned flag due to races, return value will be unexpected 1 leading to users being confused. And there's a code smell that the variable "ret" is used not only to save the return value of unpoison_memory(), but also the return value from get_hwpoison_page(). Make a further cleanup by using another auto-variable solely to save the return value of get_hwpoison_page() as suggested by Naoya. Link: https://lkml.kernel.org/r/20230727115643.639741-3-linmiaohe@huawei.com Fixes: bf181c582588 ("mm/hwpoison: fix unpoison_memory()") Signed-off-by: Miaohe Lin Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Cc: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton commit f985fc322063c73916a0d5b6b3fcc6db2ba5792c Author: Miaohe Lin Date: Thu Jul 27 19:56:40 2023 +0800 mm/swapfile: fix wrong swap entry type for hwpoisoned swapcache page Patch series "A few fixup patches for mm", v2. This series contains a few fixup patches to fix potential unexpected return value, fix wrong swap entry type for hwpoisoned swapcache page and so on. More details can be found in the respective changelogs. This patch (of 3): Hwpoisoned dirty swap cache page is kept in the swap cache and there's simple interception code in do_swap_page() to catch it. But when trying to swapoff, unuse_pte() will wrongly install a general sense of "future accesses are invalid" swap entry for hwpoisoned swap cache page due to unaware of such type of page. The user will receive SIGBUS signal without expected BUS_MCEERR_AR payload. BTW, typo 'hwposioned' is fixed. Link: https://lkml.kernel.org/r/20230727115643.639741-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20230727115643.639741-2-linmiaohe@huawei.com Fixes: 6b970599e807 ("mm: hwpoison: support recovery from ksm_might_need_to_copy()") Signed-off-by: Miaohe Lin Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Cc: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton commit cac7ea57a06016e4914848b707477fb07ee4ae1c Author: Colin Ian King Date: Thu Jul 27 17:09:30 2023 +0100 radix tree test suite: fix incorrect allocation size for pthreads Currently the pthread allocation for each array item is based on the size of a pthread_t pointer and should be the size of the pthread_t structure, so the allocation is under-allocating the correct size. Fix this by using the size of each element in the pthreads array. Static analysis cppcheck reported: tools/testing/radix-tree/regression1.c:180:2: warning: Size of pointer 'threads' used instead of size of its data. [pointerSize] Link: https://lkml.kernel.org/r/20230727160930.632674-1-colin.i.king@gmail.com Fixes: 1366c37ed84b ("radix tree test harness") Signed-off-by: Colin Ian King Cc: Konstantin Khlebnikov Cc: Matthew Wilcox (Oracle) Cc: Signed-off-by: Andrew Morton commit f443fd5af5dbd531f880d3645d5dd36976cf087f Author: David Howells Date: Wed Jul 26 11:57:56 2023 +0100 crypto, cifs: fix error handling in extract_iter_to_sg() Fix error handling in extract_iter_to_sg(). Pages need to be unpinned, not put in extract_user_to_sg() when handling IOVEC/UBUF sources. The bug may result in a warning like the following: WARNING: CPU: 1 PID: 20384 at mm/gup.c:229 __lse_atomic_add arch/arm64/include/asm/atomic_lse.h:27 [inline] WARNING: CPU: 1 PID: 20384 at mm/gup.c:229 arch_atomic_add arch/arm64/include/asm/atomic.h:28 [inline] WARNING: CPU: 1 PID: 20384 at mm/gup.c:229 raw_atomic_add include/linux/atomic/atomic-arch-fallback.h:537 [inline] WARNING: CPU: 1 PID: 20384 at mm/gup.c:229 atomic_add include/linux/atomic/atomic-instrumented.h:105 [inline] WARNING: CPU: 1 PID: 20384 at mm/gup.c:229 try_grab_page+0x108/0x160 mm/gup.c:252 ... pc : try_grab_page+0x108/0x160 mm/gup.c:229 lr : follow_page_pte+0x174/0x3e4 mm/gup.c:651 ... Call trace: __lse_atomic_add arch/arm64/include/asm/atomic_lse.h:27 [inline] arch_atomic_add arch/arm64/include/asm/atomic.h:28 [inline] raw_atomic_add include/linux/atomic/atomic-arch-fallback.h:537 [inline] atomic_add include/linux/atomic/atomic-instrumented.h:105 [inline] try_grab_page+0x108/0x160 mm/gup.c:252 follow_pmd_mask mm/gup.c:734 [inline] follow_pud_mask mm/gup.c:765 [inline] follow_p4d_mask mm/gup.c:782 [inline] follow_page_mask+0x12c/0x2e4 mm/gup.c:839 __get_user_pages+0x174/0x30c mm/gup.c:1217 __get_user_pages_locked mm/gup.c:1448 [inline] __gup_longterm_locked+0x94/0x8f4 mm/gup.c:2142 internal_get_user_pages_fast+0x970/0xb60 mm/gup.c:3140 pin_user_pages_fast+0x4c/0x60 mm/gup.c:3246 iov_iter_extract_user_pages lib/iov_iter.c:1768 [inline] iov_iter_extract_pages+0xc8/0x54c lib/iov_iter.c:1831 extract_user_to_sg lib/scatterlist.c:1123 [inline] extract_iter_to_sg lib/scatterlist.c:1349 [inline] extract_iter_to_sg+0x26c/0x6fc lib/scatterlist.c:1339 hash_sendmsg+0xc0/0x43c crypto/algif_hash.c:117 sock_sendmsg_nosec net/socket.c:725 [inline] sock_sendmsg+0x54/0x60 net/socket.c:748 ____sys_sendmsg+0x270/0x2ac net/socket.c:2494 ___sys_sendmsg+0x80/0xdc net/socket.c:2548 __sys_sendmsg+0x68/0xc4 net/socket.c:2577 __do_sys_sendmsg net/socket.c:2586 [inline] __se_sys_sendmsg net/socket.c:2584 [inline] __arm64_sys_sendmsg+0x24/0x30 net/socket.c:2584 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x48/0x114 arch/arm64/kernel/syscall.c:52 el0_svc_common.constprop.0+0x44/0xe4 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x38/0xa4 arch/arm64/kernel/syscall.c:191 el0_svc+0x2c/0xb0 arch/arm64/kernel/entry-common.c:647 el0t_64_sync_handler+0xc0/0xc4 arch/arm64/kernel/entry-common.c:665 el0t_64_sync+0x19c/0x1a0 arch/arm64/kernel/entry.S:591 Link: https://lkml.kernel.org/r/20571.1690369076@warthog.procyon.org.uk Fixes: 018584697533 ("netfs: Add a function to extract an iterator into a scatterlist") Reported-by: syzbot+9b82859567f2e50c123e@syzkaller.appspotmail.com Link: https://lore.kernel.org/linux-mm/000000000000273d0105ff97bf56@google.com/ Signed-off-by: David Howells Reviewed-by: David Hildenbrand Acked-by: Steve French Cc: Sven Schnelle Cc: Herbert Xu Cc: Jeff Layton Cc: Shyam Prasad N Cc: Rohith Surabattula Cc: Jens Axboe Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Matthew Wilcox Cc: Signed-off-by: Andrew Morton commit 4b5d1e47b69426c0f7491d97d73ad0152d02d437 Author: Andrew Yang Date: Fri Jul 21 14:37:01 2023 +0800 zsmalloc: fix races between modifications of fullness and isolated We encountered many kernel exceptions of VM_BUG_ON(zspage->isolated == 0) in dec_zspage_isolation() and BUG_ON(!pages[1]) in zs_unmap_object() lately. This issue only occurs when migration and reclamation occur at the same time. With our memory stress test, we can reproduce this issue several times a day. We have no idea why no one else encountered this issue. BTW, we switched to the new kernel version with this defect a few months ago. Since fullness and isolated share the same unsigned int, modifications of them should be protected by the same lock. [andrew.yang@mediatek.com: move comment] Link: https://lkml.kernel.org/r/20230727062910.6337-1-andrew.yang@mediatek.com Link: https://lkml.kernel.org/r/20230721063705.11455-1-andrew.yang@mediatek.com Fixes: c4549b871102 ("zsmalloc: remove zspage isolation for migration") Signed-off-by: Andrew Yang Reviewed-by: Sergey Senozhatsky Cc: AngeloGioacchino Del Regno Cc: Matthias Brugger Cc: Minchan Kim Cc: Sebastian Andrzej Siewior Cc: Signed-off-by: Andrew Morton commit e6fda526d9db2c7897dacb9daff8c80e13ce893d Merge: c8273a25864e7 69af56ae56a48 Author: Linus Torvalds Date: Fri Aug 4 12:11:40 2023 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: "More SVE/SME fixes for ptrace() and for the (potentially future) case where SME is implemented in hardware without SVE support" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/fpsimd: Sync and zero pad FPSIMD state for streaming SVE arm64/fpsimd: Sync FPSIMD state with SVE for SME only systems arm64/ptrace: Don't enable SVE when setting streaming SVE arm64/ptrace: Flush FP state when setting ZT0 arm64/fpsimd: Clear SME state in the target task when setting the VL commit c8273a25864e74ab66601459686d6f78b0eb666b Merge: 4142fc6743d39 c6abce60338aa Author: Linus Torvalds Date: Fri Aug 4 12:01:26 2023 -0700 Merge tag 'mtd/fixes-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull mtd fixes from Miquel Raynal: "Raw NAND fixes: - fsl_upm: Fix an off-by one test in fun_exec_op() - Rockchip: - Align hwecc vs. raw page helper layouts - Fix oobfree offset and description - Meson: Fix OOB available bytes for ECC - Omap ELM: Fix incorrect type in assignment SPI-NOR fix: - Avoid holes in struct spi_mem_op Hyperbus fix: - Add Tudor as reviewer in MAINTAINERS SPI-NAND fixes: - Winbond and Toshiba: Fix ecc_get_status" * tag 'mtd/fixes-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: rawnand: fsl_upm: Fix an off-by one test in fun_exec_op() mtd: spi-nor: avoid holes in struct spi_mem_op MAINTAINERS: Add myself as reviewer for HYPERBUS mtd: rawnand: rockchip: Align hwecc vs. raw page helper layouts mtd: rawnand: rockchip: fix oobfree offset and description mtd: rawnand: meson: fix OOB available bytes for ECC mtd: rawnand: omap_elm: Fix incorrect type in assignment mtd: spinand: winbond: Fix ecc_get_status mtd: spinand: toshiba: Fix ecc_get_status commit 4142fc6743d39271e712936d9fb284cd84cb6010 Merge: 4593f3c2c62c1 1958b0f95a35e Author: Linus Torvalds Date: Fri Aug 4 11:50:22 2023 -0700 Merge tag 'drm-fixes-2023-08-04' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Small set of fixes this week, i915 and a few misc ones. I didn't see an amd pull so maybe next week it'll have a few more on that driver. ttm: - NULL ptr deref fix panel: - add missing MODULE_DEVICE_TABLE imx/ipuv3: - timing fix i915: - Fix bug in getting msg length in AUX CH registers handler - Gen12 AUX invalidation fixes - Fix premature release of request's reusable memory" * tag 'drm-fixes-2023-08-04' of git://anongit.freedesktop.org/drm/drm: drm/panel: samsung-s6d7aa0: Add MODULE_DEVICE_TABLE drm/i915: Fix premature release of request's reusable memory drm/i915/gt: Support aux invalidation on all engines drm/i915/gt: Poll aux invalidation register bit on invalidation drm/i915/gt: Enable the CCS_FLUSH bit in the pipe control and in the CS drm/i915/gt: Rename flags with bit_group_X according to the datasheet drm/i915/gt: Ensure memory quiesced before invalidation drm/i915: Add the gen12_needs_ccs_aux_inv helper drm/i915/gt: Cleanup aux invalidation registers drm/i915/gvt: Fix bug in getting msg length in AUX CH registers handler drm/imx/ipuv3: Fix front porch adjustment upon hactive aligning drm/ttm: check null pointer before accessing when swapping commit 4593f3c2c62c1bcdf274038ef87b08a057531692 Merge: 797964253d358 e6e2843230799 Author: Linus Torvalds Date: Fri Aug 4 11:29:38 2023 -0700 Merge tag 'ceph-for-6.5-rc5' of https://github.com/ceph/ceph-client Pull ceph fixes from Ilya Dryomov: "Two patches to improve RBD exclusive lock interaction with osd_request_timeout option and another fix to reduce the potential for erroneous blocklisting -- this time in CephFS. All going to stable" * tag 'ceph-for-6.5-rc5' of https://github.com/ceph/ceph-client: libceph: fix potential hang in ceph_osdc_notify() rbd: prevent busy loop when requesting exclusive lock ceph: defer stopping mdsc delayed_work commit 797964253d358cf8d705614dda394dbe30120223 Author: Linus Torvalds Date: Thu Aug 3 11:35:53 2023 -0700 file: reinstate f_pos locking optimization for regular files In commit 20ea1e7d13c1 ("file: always lock position for FMODE_ATOMIC_POS") we ended up always taking the file pos lock, because pidfd_getfd() could get a reference to the file even when it didn't have an elevated file count due to threading of other sharing cases. But Mateusz Guzik reports that the extra locking is actually measurable, so let's re-introduce the optimization, and only force the locking for directory traversal. Directories need the lock for correctness reasons, while regular files only need it for "POSIX semantics". Since pidfd_getfd() is about debuggers etc special things that are _way_ outside of POSIX, we can relax the rules for that case. Reported-by: Mateusz Guzik Cc: Christian Brauner Link: https://lore.kernel.org/linux-fsdevel/20230803095311.ijpvhx3fyrbkasul@f/ Signed-off-by: Linus Torvalds commit 251199f4b381de17feaf553757564871587f8123 Merge: 63dbc67cf4ed1 74158a8cad79d Author: Paolo Bonzini Date: Fri Aug 4 13:39:07 2023 -0400 Merge tag 'kvmarm-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 6.5, part #2 - Fixes for the configuration of SVE/SME traps when hVHE mode is in use - Allow use of pKVM on systems with FF-A implementations that are v1.0 compatible - Request/release percpu IRQs (arch timer, vGIC maintenance) correctly when pKVM is in use - Fix function prototype after __kvm_host_psci_cpu_entry() rename - Skip to the next instruction when emulating writes to TCR_EL1 on AmpereOne systems commit 63dbc67cf4ed11f94b2e8dde34b41438a3cb3d83 Author: Paolo Bonzini Date: Fri Aug 4 13:01:43 2023 -0400 KVM: SEV: remove ghcb variable declarations To avoid possible time-of-check/time-of-use issues, the GHCB should almost never be accessed outside dump_ghcb, sev_es_sync_to_ghcb and sev_es_sync_from_ghcb. The only legitimate uses are to set the exitinfo fields and to find the address of the scratch area embedded in the ghcb. Accessing ghcb_usage also goes through svm->sev_es.ghcb in sev_es_validate_vmgexit(), but that is because anyway the value is not used. Removing a shortcut variable that contains the value of svm->sev_es.ghcb makes these cases a bit more verbose, but it limits the chance of someone reading the ghcb by mistake. Signed-off-by: Paolo Bonzini commit 7588dbcebcbf0193ab5b76987396d0254270b04a Author: Paolo Bonzini Date: Fri Aug 4 12:56:36 2023 -0400 KVM: SEV: only access GHCB fields once A KVM guest using SEV-ES or SEV-SNP with multiple vCPUs can trigger a double fetch race condition vulnerability and invoke the VMGEXIT handler recursively. sev_handle_vmgexit() maps the GHCB page using kvm_vcpu_map() and then fetches the exit code using ghcb_get_sw_exit_code(). Soon after, sev_es_validate_vmgexit() fetches the exit code again. Since the GHCB page is shared with the guest, the guest is able to quickly swap the values with another vCPU and hence bypass the validation. One vmexit code that can be rejected by sev_es_validate_vmgexit() is SVM_EXIT_VMGEXIT; if sev_handle_vmgexit() observes it in the second fetch, the call to svm_invoke_exit_handler() will invoke sev_handle_vmgexit() again recursively. To avoid the race, always fetch the GHCB data from the places where sev_es_sync_from_ghcb stores it. Exploiting recursions on linux kernel has been proven feasible in the past, but the impact is mitigated by stack guard pages (CONFIG_VMAP_STACK). Still, if an attacker manages to call the handler multiple times, they can theoretically trigger a stack overflow and cause a denial-of-service, or potentially guest-to-host escape in kernel configurations without stack guard pages. Note that winning the race reliably in every iteration is very tricky due to the very tight window of the fetches; depending on the compiler settings, they are often consecutive because of optimization and inlining. Tested by booting an SEV-ES RHEL9 guest. Fixes: CVE-2023-4155 Fixes: 291bd20d5d88 ("KVM: SVM: Add initial support for a VMGEXIT VMEXIT") Cc: stable@vger.kernel.org Reported-by: Andy Nguyen Signed-off-by: Paolo Bonzini commit 4e15a0ddc3ff40e8ea84032213976ecf774d7f77 Author: Paolo Bonzini Date: Fri Aug 4 12:42:45 2023 -0400 KVM: SEV: snapshot the GHCB before accessing it Validation of the GHCB is susceptible to time-of-check/time-of-use vulnerabilities. To avoid them, we would like to always snapshot the fields that are read in sev_es_validate_vmgexit(), and not use the GHCB anymore after it returns. This means: - invoking sev_es_sync_from_ghcb() before any GHCB access, including before sev_es_validate_vmgexit() - snapshotting all fields including the valid bitmap and the sw_scratch field, which are currently not caching anywhere. The valid bitmap is the first thing to be copied out of the GHCB; then, further accesses will use the copy in svm->sev_es. Fixes: 291bd20d5d88 ("KVM: SVM: Add initial support for a VMGEXIT VMEXIT") Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit c3bcc65d4d2e8292c435322cbc34c318d06b8b6c Author: Alexandre Ghiti Date: Tue Jul 4 14:18:37 2023 +0200 riscv: Start of DRAM should at least be aligned on PMD size for the direct mapping So that we do not end up mapping the whole linear mapping using 4K pages, which is slow at boot time, and also very likely at runtime. So make sure we align the start of DRAM on a PMD boundary. Signed-off-by: Alexandre Ghiti Reported-by: Song Shuai Fixes: 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping") Tested-by: Song Shuai Link: https://lore.kernel.org/r/20230704121837.248976-1-alexghiti@rivosinc.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit f8069826eb4fe7ae7f769987abf527708354bfd5 Merge: 640c503d7dbd7 49af7a2cd5f67 Author: Palmer Dabbelt Date: Wed Aug 2 20:36:57 2023 -0700 Merge patch series "RISC-V: Fix a few kexec_file_load(2) failures" Petr Tesarik says: From: Petr Tesarik The kexec_file_load(2) syscall does not work at least in some kernel builds. For details see the relevant section in this blog post: https://sigillatum.tesarici.cz/2023-07-21-state-of-riscv64-kdump.html This patch series handles an additional relocation types, removes the need to implement a Global Offset Table (GOT) for the purgatory and fixes the placement of initrd. * b4-shazam-merge: riscv/kexec: load initrd high in available memory riscv/kexec: handle R_RISCV_CALL_PLT relocation type Link: https://lore.kernel.org/r/cover.1690365011.git.petr.tesarik.ext@huawei.com Signed-off-by: Palmer Dabbelt commit 49af7a2cd5f678217b8b4f86a29411aebebf3e78 Author: Torsten Duwe Date: Wed Jul 26 11:54:01 2023 +0200 riscv/kexec: load initrd high in available memory When initrd is loaded low, the secondary kernel fails like this: INITRD: 0xdc581000+0x00eef000 overlaps in-use memory region This initrd load address corresponds to the _end symbol, but the reservation is aligned on PMD_SIZE, as explained by a comment in setup_bootmem(). It is technically possible to align the initrd load address accordingly, leaving a hole between the end of kernel and the initrd, but it is much simpler to allocate the initrd top-down. Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file") Signed-off-by: Torsten Duwe Signed-off-by: Petr Tesarik Cc: stable@vger.kernel.org Reviewed-by: Conor Dooley Link: https://lore.kernel.org/all/67c8eb9eea25717c2c8208d9bfbfaa39e6e2a1c6.1690365011.git.petr.tesarik.ext@huawei.com/ Signed-off-by: Palmer Dabbelt commit d0b4f95a51038becce4bdab4789aa7ce59d4ea6e Author: Torsten Duwe Date: Wed Jul 26 11:53:59 2023 +0200 riscv/kexec: handle R_RISCV_CALL_PLT relocation type R_RISCV_CALL has been deprecated and replaced by R_RISCV_CALL_PLT. See Enum 18-19 in Table 3. Relocation types here: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc It was deprecated in ("Deprecated R_RISCV_CALL, prefer R_RISCV_CALL_PLT"): https://github.com/riscv-non-isa/riscv-elf-psabi-doc/commit/a0dced85018d7a0ec17023c9389cbd70b1dbc1b0 Recent tools (at least GNU binutils-2.40) already use R_RISCV_CALL_PLT. Kernels built with such binutils fail kexec_load_file(2) with: kexec_image: Unknown rela relocation: 19 kexec_image: Error loading purgatory ret=-8 The binary code at the call site remains the same, so tell arch_kexec_apply_relocations_add() to handle _PLT alike. Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file") Signed-off-by: Torsten Duwe Signed-off-by: Petr Tesarik Cc: Li Zhengyu Cc: stable@vger.kernel.org Reviewed-by: Conor Dooley Link: https://lore.kernel.org/all/b046b164af8efd33bbdb7d4003273bdf9196a5b0.1690365011.git.petr.tesarik.ext@huawei.com/ Signed-off-by: Palmer Dabbelt commit 3b816601e279756e781e6c4d9b3f3bd21a72ac67 Author: Benjamin Coddington Date: Fri Aug 4 10:52:20 2023 -0400 nfsd: Fix race to FREE_STATEID and cl_revoked We have some reports of linux NFS clients that cannot satisfy a linux knfsd server that always sets SEQ4_STATUS_RECALLABLE_STATE_REVOKED even though those clients repeatedly walk all their known state using TEST_STATEID and receive NFS4_OK for all. Its possible for revoke_delegation() to set NFS4_REVOKED_DELEG_STID, then nfsd4_free_stateid() finds the delegation and returns NFS4_OK to FREE_STATEID. Afterward, revoke_delegation() moves the same delegation to cl_revoked. This would produce the observed client/server effect. Fix this by ensuring that the setting of sc_type to NFS4_REVOKED_DELEG_STID and move to cl_revoked happens within the same cl_lock. This will allow nfsd4_free_stateid() to properly remove the delegation from cl_revoked. Link: https://bugzilla.redhat.com/show_bug.cgi?id=2217103 Link: https://bugzilla.redhat.com/show_bug.cgi?id=2176575 Signed-off-by: Benjamin Coddington Cc: stable@vger.kernel.org # v4.17+ Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 69af56ae56a48a2522aad906c4461c6c7c092737 Author: Mark Brown Date: Thu Aug 3 19:33:23 2023 +0100 arm64/fpsimd: Sync and zero pad FPSIMD state for streaming SVE We have a function sve_sync_from_fpsimd_zeropad() which is used by the ptrace code to update the SVE state when the user writes to the the FPSIMD register set. Currently this checks that the task has SVE enabled but this will miss updates for tasks which have streaming SVE enabled if SVE has not been enabled for the thread, also do the conversion if the task has streaming SVE enabled. Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers") Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-ssve-no-sve-v1-3-49df214bfb3e@kernel.org Signed-off-by: Catalin Marinas commit 507ea5dd92d23fcf10e4d1a68a443c86a49753ed Author: Mark Brown Date: Thu Aug 3 19:33:22 2023 +0100 arm64/fpsimd: Sync FPSIMD state with SVE for SME only systems Currently we guard FPSIMD/SVE state conversions with a check for the system supporting SVE but SME only systems may need to sync streaming mode SVE state so add a check for SME support too. These functions are only used by the ptrace code. Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers") Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-ssve-no-sve-v1-2-49df214bfb3e@kernel.org Signed-off-by: Catalin Marinas commit 045aecdfcb2e060db142d83a0f4082380c465d2c Author: Mark Brown Date: Thu Aug 3 19:33:21 2023 +0100 arm64/ptrace: Don't enable SVE when setting streaming SVE Systems which implement SME without also implementing SVE are architecturally valid but were not initially supported by the kernel, unfortunately we missed one issue in the ptrace code. The SVE register setting code is shared between SVE and streaming mode SVE. When we set full SVE register state we currently enable TIF_SVE unconditionally, in the case where streaming SVE is being configured on a system that supports vanilla SVE this is not an issue since we always initialise enough state for both vector lengths but on a system which only support SME it will result in us attempting to restore the SVE vector length after having set streaming SVE registers. Fix this by making the enabling of SVE conditional on setting SVE vector state. If we set streaming SVE state and SVE was not already enabled this will result in a SVE access trap on next use of normal SVE, this will cause us to flush our register state but this is fine since the only way to trigger a SVE access trap would be to exit streaming mode which will cause the in register state to be flushed anyway. Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers") Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-ssve-no-sve-v1-1-49df214bfb3e@kernel.org Signed-off-by: Catalin Marinas commit dfe2aeb226fd5e19b0ee795f4f6ed8bc494c1534 Author: Tony Lindgren Date: Fri Aug 4 16:15:51 2023 +0300 serial: 8250: Fix oops for port->pm on uart_change_pm() Unloading a hardware specific 8250 driver can produce error "Unable to handle kernel paging request at virtual address" about ten seconds after unloading the driver. This happens on uart_hangup() calling uart_change_pm(). Turns out commit 04e82793f068 ("serial: 8250: Reinit port->pm on port specific driver unbind") was only a partial fix. If the hardware specific driver has initialized port->pm function, we need to clear port->pm too. Just reinitializing port->ops does not do this. Otherwise serial8250_pm() will call port->pm() instead of serial8250_do_pm(). Fixes: 04e82793f068 ("serial: 8250: Reinit port->pm on port specific driver unbind") Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230804131553.52927-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit b05544884300e98512964103b33f8f87650ce887 Author: Andrea Righi Date: Tue Jul 11 09:19:14 2023 +0200 rust: fix bindgen build error with UBSAN_BOUNDS_STRICT With commit 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC") if CONFIG_UBSAN is enabled and gcc supports -fsanitize=bounds-strict, we can trigger the following build error due to bindgen lacking support for this additional build option: BINDGEN rust/bindings/bindings_generated.rs error: unsupported argument 'bounds-strict' to option '-fsanitize=' Fix by adding -fsanitize=bounds-strict to the list of skipped gcc flags for bindgen. Fixes: 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC") Signed-off-by: Andrea Righi Acked-by: Kees Cook Reviewed-by: Martin Rodriguez Reboredo Link: https://lore.kernel.org/r/20230711071914.133946-1-andrea.righi@canonical.com Signed-off-by: Miguel Ojeda commit 1d24eb2d536ba27ef938a6563ac8bfb49c738cc1 Author: Alice Ryhl Date: Thu Jul 6 09:46:15 2023 +0000 rust: delete `ForeignOwnable::borrow_mut` We discovered that the current design of `borrow_mut` is problematic. This patch removes it until a better solution can be found. Specifically, the current design gives you access to a `&mut T`, which lets you change where the `ForeignOwnable` points (e.g., with `core::mem::swap`). No upcoming user of this API intended to make that possible, making all of them unsound. Signed-off-by: Alice Ryhl Reviewed-by: Gary Guo Reviewed-by: Benno Lossin Reviewed-by: Martin Rodriguez Reboredo Fixes: 0fc4424d24a2 ("rust: types: introduce `ForeignOwnable`") Link: https://lore.kernel.org/r/20230706094615.3080784-1-aliceryhl@google.com Signed-off-by: Miguel Ojeda commit b3d8aa84bbfe9b58ccc5332cacf8ea17200af310 Author: Boqun Feng Date: Sat Jul 29 18:29:02 2023 -0700 rust: allocator: Prevent mis-aligned allocation Currently the rust allocator simply passes the size of the type Layout to krealloc(), and in theory the alignment requirement from the type Layout may be larger than the guarantee provided by SLAB, which means the allocated object is mis-aligned. Fix this by adjusting the allocation size to the nearest power of two, which SLAB always guarantees a size-aligned allocation. And because Rust guarantees that the original size must be a multiple of alignment and the alignment must be a power of two, then the alignment requirement is satisfied. Suggested-by: Vlastimil Babka Co-developed-by: "Andreas Hindborg (Samsung)" Signed-off-by: "Andreas Hindborg (Samsung)" Signed-off-by: Boqun Feng Cc: stable@vger.kernel.org # v6.1+ Acked-by: Vlastimil Babka Fixes: 247b365dc8dc ("rust: add `kernel` crate") Link: https://github.com/Rust-for-Linux/linux/issues/974 Link: https://lore.kernel.org/r/20230730012905.643822-2-boqun.feng@gmail.com [ Applied rewording of comment as discussed in the mailing list. ] Signed-off-by: Miguel Ojeda commit 77107b08f0f29c6e9d02c2e4bfcd6e1e0c57bdd5 Author: Esteban Blanc Date: Thu Jul 27 11:04:35 2023 +0200 misc: tps6594-esm: Disable ESM for rev 1 PMIC Due to a silicon bug, ESM on TPS6594 PMIC revision 1 is not working properly. This patch keeps SOC ESM disabled for such PMIC. Fixes: 875fdd0787e4 ("misc: tps6594-esm: Add driver for TI TPS6594 ESM") Co-developed-by: Julien Panis Signed-off-by: Julien Panis Signed-off-by: Esteban Blanc Link: https://lore.kernel.org/r/20230726-tps6594_fix_esm_for_v1-v1-1-2adfdcad31c2@baylibre.com Signed-off-by: Greg Kroah-Hartman commit 101bd907b4244a726980ee67f95ed9cafab6ff7a Author: Ricky WU Date: Tue Jul 25 09:10:54 2023 +0000 misc: rtsx: judge ASPM Mode to set PETXCFG Reg ASPM Mode is ASPM_MODE_CFG need to judge the value of clkreq_0 to set HIGH or LOW, if the ASPM Mode is ASPM_MODE_REG always set to HIGH during the initialization. Cc: stable@vger.kernel.org Signed-off-by: Ricky Wu Link: https://lore.kernel.org/r/52906c6836374c8cb068225954c5543a@realtek.com Signed-off-by: Greg Kroah-Hartman commit adb9743d6a08778b78d62d16b4230346d3508986 Author: Qi Zheng Date: Sun Jun 25 15:49:37 2023 +0000 binder: fix memory leak in binder_init() In binder_init(), the destruction of binder_alloc_shrinker_init() is not performed in the wrong path, which will cause memory leaks. So this commit introduces binder_alloc_shrinker_exit() and calls it in the wrong path to fix that. Signed-off-by: Qi Zheng Acked-by: Carlos Llamas Fixes: f2517eb76f1f ("android: binder: Add global lru shrinker to binder") Cc: stable Link: https://lore.kernel.org/r/20230625154937.64316-1-qi.zheng@linux.dev Signed-off-by: Greg Kroah-Hartman commit 63b93e70c862922fedb8d1045e89245bc984a898 Merge: bb6578bab876f 8a4629055ef55 Author: Greg Kroah-Hartman Date: Fri Aug 4 15:19:44 2023 +0200 Merge tag 'iio-fixes-for-6.5a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus Jonathan writes: 1st set of IIO fixes for 6.5 Usual mixed bag of fixes for recently introduced issues and ones from way back that have recently been noticed. * core - Avoid a device with no parent issues seen on the dummy example device. * adi,ad71145 - Drop ref now that dt-schema supports -nanoamp. * adi,ad7192 - Fix wrong bit set for enabling AC excitation and exposure of control on devices without the feature. * adi,admv1013 - Don't ignore errors from regulator_get_voltage(). * amlogic,meson-adc - Make sure clocks enabled early enough. * google,cros_ec - Fix undersized cros_ec_command allocation that resulted in a buffer overrun. * rohm,bu27008 - Fix truncation issue with scale format that prevents smallest value being set - Report intensity as unsigned. Previously large values would be interpretted as negative intensities (and odd concept). * rohm,bu27034 - Fix truncation issue with scale format that prevents smallest value being set. * st,lsm6dsx - Return an error code, not false (which is 0 and hence success) to indicate ACPI mount matrix retrieval failed due to no ACPI support. * ti,ina2xx - Avoid a NULL pointer dereference if fall back compatible is used. * tag 'iio-fixes-for-6.5a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: cros_ec: Fix the allocation size for cros_ec_command iio: imu: lsm6dsx: Fix mount matrix retrieval iio: adc: meson: fix core clock enable/disable moment iio: core: Prevent invalid memory access when there is no parent iio: frequency: admv1013: propagate errors from regulator_get_voltage() dt-bindings: iio: adi,ad74115: remove ref from -nanoamp iio: adc: ina2xx: avoid NULL pointer dereference on OF device match iio: light: bu27008: Fix intensity data type iio: light: bu27008: Fix scale format iio: light: bu27034: Fix scale format iio: adc: ad7192: Fix ac excitation feature commit bb6578bab876f7fb138f5099f833a265b11a60d7 Merge: ec3041b30133f aead78125a987 Author: Greg Kroah-Hartman Date: Fri Aug 4 15:17:53 2023 +0200 Merge tag 'counter-fixes-for-6.5b' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-linus William writes: Second set of Counter fixes for 6.5 The I8254 Kconfig entry is repositioned to resolve a misplacement causing the "Counter support" submenu items to disappear in menuconfig. The tools/counter/Makefile clean recipe is adjusted to replace rmdir with an equivalent set of rm to prevent failure if someone tries to clean the counter directory without building it first. * tag 'counter-fixes-for-6.5b' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter: tools/counter: Makefile: Replace rmdir by rm to avoid make,clean failure counter: Fix menuconfig "Counter support" submenu entries disappearance commit 596a5123cc782d458b057eb3837e66535cd0befa Author: Mika Westerberg Date: Thu Jun 22 14:59:12 2023 +0300 thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request() The memory allocated in tb_queue_dp_bandwidth_request() needs to be released once the request is handled to avoid leaking it. Fixes: 6ce3563520be ("thunderbolt: Add support for DisplayPort bandwidth allocation mode") Cc: stable@vger.kernel.org Signed-off-by: Mika Westerberg commit ec3041b30133f92cfbce783e02239aa0853f8ab3 Merge: 5d0c230f1de8c 9b53a13422162 Author: Greg Kroah-Hartman Date: Fri Aug 4 15:17:29 2023 +0200 Merge tag 'counter-fixes-for-6.5a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-linus William writes: First set of Counter fixes for 6.5 In commit d428487471ba ("counter: i8254: Introduce the Intel 8254 interface library module"), the misplacement of the I8254 Kconfig entry results in the "Counter support" submenu items disappearing in menuconfig. A fix is provided to reposition the I8254 Kconfig entry to restore the intended submenu behavior. * tag 'counter-fixes-for-6.5a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter: counter: Fix menuconfig "Counter support" submenu entries disappearance commit bbb4abb1bcfb5c25bc022ccecfea919286093b5d Author: Tony Lindgren Date: Fri Aug 4 15:35:44 2023 +0300 serial: 8250: Reinit port_id when adding back serial8250_isa_devs After fixing the serial core port device to use port->port_id instead of port->line, unloading a hardware specific 8250 port driver started producing an error for "sysfs: cannot create duplicate filename". This is happening as we are wrongly initializing port->port_id to zero when adding back serial8250_isa_devs instances, and the serial8250:0.0 sysfs entry may already exist. For serial8250 devices, we typically have multiple devices mapped to a single driver instance. For the serial8250_isa_devs instances, the port->port_id is the same as port->line. Let's fix the issue by re-initializing port_id when adding back the serial8250_isa_devs instances in serial8250_unregister_port(). Fixes: d962de6ae51f ("serial: core: Fix serial core port id to not use port->line") Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230804123546.25293-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 6be1a8d50b381ca022a79e47f2dc0d3aa698af14 Author: Tony Lindgren Date: Fri Aug 4 12:09:07 2023 +0300 serial: core: Fix kmemleak issue for serial core device remove Kmemleak reports issues for serial8250 ports after the hardware specific driver takes over on boot as noted by Tomi. The kerneldoc for device_initialize() says we must call device_put() after calling device_initialize(). We are calling device_put() on the error path, but are missing it from the device remove path. This causes release() to never get called for the devices on remove. Let's add the missing put_device() calls for both serial ctrl and port devices. Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Reported-by: Tomi Valkeinen Signed-off-by: Tony Lindgren Tested-by: Tomi Valkeinen Link: https://lore.kernel.org/r/20230804090909.51529-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 238500e2d67c0463ec83a43a083dc25db6520acd Author: Tony Lindgren Date: Fri Aug 4 13:20:40 2023 +0300 MAINTAINERS: Merge TTY layer and serial drivers Greg suggested we merge TTY layer and serial driver entries to avoid duplicates. Suggested-by: Greg Kroah-Hartman Acked-by: Ilpo Järvinen Acked-by: Jiri Slaby Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230804102042.53576-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 3ddaa6a274578e23745b7466346fc2650df8f959 Author: Elson Roy Serrao Date: Tue Aug 1 12:26:58 2023 -0700 usb: dwc3: Properly handle processing of pending events If dwc3 is runtime suspended we defer processing the event buffer until resume, by setting the pending_events flag. Set this flag before triggering resume to avoid race with the runtime resume callback. While handling the pending events, in addition to checking the event buffer we also need to process it. Handle this by explicitly calling dwc3_thread_interrupt(). Also balance the runtime pm get() operation that triggered this processing. Cc: stable@vger.kernel.org Fixes: fc8bb91bc83e ("usb: dwc3: implement runtime PM") Signed-off-by: Elson Roy Serrao Acked-by: Thinh Nguyen Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230801192658.19275-1-quic_eserrao@quicinc.com Signed-off-by: Greg Kroah-Hartman commit a6ff6e7a9dd69364547751db0f626a10a6d628d2 Author: Alan Stern Date: Wed Aug 2 13:49:02 2023 -0400 usb-storage: alauda: Fix uninit-value in alauda_check_media() Syzbot got KMSAN to complain about access to an uninitialized value in the alauda subdriver of usb-storage: BUG: KMSAN: uninit-value in alauda_transport+0x462/0x57f0 drivers/usb/storage/alauda.c:1137 CPU: 0 PID: 12279 Comm: usb-storage Not tainted 5.3.0-rc7+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x191/0x1f0 lib/dump_stack.c:113 kmsan_report+0x13a/0x2b0 mm/kmsan/kmsan_report.c:108 __msan_warning+0x73/0xe0 mm/kmsan/kmsan_instr.c:250 alauda_check_media+0x344/0x3310 drivers/usb/storage/alauda.c:460 The problem is that alauda_check_media() doesn't verify that its USB transfer succeeded before trying to use the received data. What should happen if the transfer fails isn't entirely clear, but a reasonably conservative approach is to pretend that no media is present. A similar problem exists in a usb_stor_dbg() call in alauda_get_media_status(). In this case, when an error occurs the call is redundant, because usb_stor_ctrl_transfer() already will print a debugging message. Finally, unrelated to the uninitialized memory access, is the fact that alauda_check_media() performs DMA to a buffer on the stack. Fortunately usb-storage provides a general purpose DMA-able buffer for uses like this. We'll use it instead. Reported-and-tested-by: syzbot+e7d46eb426883fb97efd@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/0000000000007d25ff059457342d@google.com/T/ Suggested-by: Christophe JAILLET Signed-off-by: Alan Stern Fixes: e80b0fade09e ("[PATCH] USB Storage: add alauda support") Cc: Link: https://lore.kernel.org/r/693d5d5e-f09b-42d0-8ed9-1f96cd30bcce@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit 8e21a620c7e6e00347ade1a6ed4967b359eada5a Author: Prashanth K Date: Tue Aug 1 14:33:52 2023 +0530 usb: common: usb-conn-gpio: Prevent bailing out if initial role is none Currently if we bootup a device without cable connected, then usb-conn-gpio won't call set_role() because last_role is same as current role. This happens since last_role gets initialised to zero during the probe. To avoid this, add a new flag initial_detection into struct usb_conn_info, which prevents bailing out during initial detection. Cc: # 5.4 Fixes: 4602f3bff266 ("usb: common: add USB GPIO based connection detection driver") Signed-off-by: Prashanth K Tested-by: AngeloGioacchino Del Regno Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/1690880632-12588-1-git-send-email-quic_prashk@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 65dadb2beeb7360232b09ebc4585b54475dfee06 Author: Alan Stern Date: Sat Jul 29 10:59:38 2023 -0400 USB: Gadget: core: Help prevent panic during UVC unconfigure Avichal Rakesh reported a kernel panic that occurred when the UVC gadget driver was removed from a gadget's configuration. The panic involves a somewhat complicated interaction between the kernel driver and a userspace component (as described in the Link tag below), but the analysis did make one thing clear: The Gadget core should accomodate gadget drivers calling usb_gadget_deactivate() as part of their unbind procedure. Currently this doesn't work. gadget_unbind_driver() calls driver->unbind() while holding the udc->connect_lock mutex, and usb_gadget_deactivate() attempts to acquire that mutex, which will result in a deadlock. The simple fix is for gadget_unbind_driver() to release the mutex when invoking the ->unbind() callback. There is no particular reason for it to be holding the mutex at that time, and the mutex isn't held while the ->bind() callback is invoked. So we'll drop the mutex before performing the unbind callback and reacquire it afterward. We'll also add a couple of comments to usb_gadget_activate() and usb_gadget_deactivate(). Because they run in process context they must not be called from a gadget driver's ->disconnect() callback, which (according to the kerneldoc for struct usb_gadget_driver in include/linux/usb/gadget.h) may run in interrupt context. This may help prevent similar bugs from arising in the future. Reported-and-tested-by: Avichal Rakesh Signed-off-by: Alan Stern Fixes: 286d9975a838 ("usb: gadget: udc: core: Prevent soft_connect_store() race") Link: https://lore.kernel.org/linux-usb/4d7aa3f4-22d9-9f5a-3d70-1bd7148ff4ba@google.com/ Cc: Badhri Jagan Sridharan Cc: Link: https://lore.kernel.org/r/48b2f1f1-0639-46bf-bbfc-98cb05a24914@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit ef7c4d8a90c64bac294363c6f67eb98246a162a2 Author: Heikki Krogerus Date: Mon Jul 31 16:12:10 2023 +0300 usb: typec: mux: intel: Add dependency on USB_COMMON This fixes an undefined reference to `usb_debug_root' issue when USB_COMMON is not enabled. Fixes: 0a453dc9f260 ("usb: typec: intel_pmc_mux: Expose IOM port status to debugfs") Reported-by: Randy Dunlap Closes: https://lore.kernel.org/lkml/c3bb8781-676d-2448-cfbb-62e29f1f570b@infradead.org/ Cc: Rajat Khandelwal Signed-off-by: Heikki Krogerus Tested-by: Randy Dunlap # build-tested Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20230731131210.43158-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 348359e7c232adc153ed7ec9a157f22d68d29860 Author: Christophe JAILLET Date: Tue Jul 18 23:40:05 2023 +0200 usb: typec: nb7vpq904m: Add an error handling path in nb7vpq904m_probe() In case of error in the nb7vpq904m_probe() probe function, some resources need to be freed, as already done in the remove function. Add the missing error handling path and adjust code accordingly. Fixes: 88d8f3ac9c67 ("usb: typec: add support for the nb7vpq904m Type-C Linear Redriver") Signed-off-by: Christophe JAILLET Reviewed-by: Neil Armstrong Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/9118954765821ea9f1179883602b4eca63e91749.1689716381.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 5a5ccd61cfd76156cb3e0373c300c509d05448ce Author: RD Babiera Date: Wed Jul 26 02:09:02 2023 +0000 usb: typec: altmodes/displayport: Signal hpd when configuring pin assignment When connecting to some DisplayPort partners, the initial status update after entering DisplayPort Alt Mode notifies that the DFP_D/UFP_D is not in the connected state. This leads to sending a configure message that keeps the device in USB mode. The port partner then sets DFP_D/UFP_D to the connected state and HPD to high in the same Attention message. Currently, the HPD signal is dropped in order to handle configuration. This patch saves changes to the HPD signal when the device chooses to configure during dp_altmode_status_update, and invokes sysfs_notify if necessary for HPD after configuring. Fixes: 0e3bb7d6894d ("usb: typec: Add driver for DisplayPort alternate mode") Cc: stable@vger.kernel.org Signed-off-by: RD Babiera Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230726020903.1409072-1-rdbabiera@google.com Signed-off-by: Greg Kroah-Hartman commit 4270d2b4845e820b274702bfc2a7140f69e4d19d Author: Badhri Jagan Sridharan Date: Wed Jul 12 08:57:22 2023 +0000 usb: typec: tcpm: Fix response to vsafe0V event Do not transition to SNK_UNATTACHED state when receiving vsafe0v event while in SNK_HARD_RESET_WAIT_VBUS. Ignore VBUS off events as well as in some platforms VBUS off can be signalled more than once. [143515.364753] Requesting mux state 1, usb-role 2, orientation 2 [143515.365520] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET] [143515.632281] CC1: 0 -> 0, CC2: 3 -> 0 [state SNK_HARD_RESET_SINK_OFF, polarity 1, disconnected] [143515.637214] VBUS on [143515.664985] VBUS off [143515.664992] state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_WAIT_VBUS [rev3 HARD_RESET] [143515.665564] VBUS VSAFE0V [143515.665566] state change SNK_HARD_RESET_WAIT_VBUS -> SNK_UNATTACHED [rev3 HARD_RESET] Fixes: 28b43d3d746b ("usb: typec: tcpm: Introduce vsafe0v for vbus") Cc: Signed-off-by: Badhri Jagan Sridharan Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230712085722.1414743-1-badhri@google.com Signed-off-by: Greg Kroah-Hartman commit 30c694fd4a99fbbc4115d180156ca01b60953371 Author: Martin Fuzzey Date: Fri Aug 4 10:34:30 2023 +0200 regulator: da9063: better fix null deref with partial DT Two versions of the original patch were sent but V1 was merged instead of V2 due to a mistake. So update to V2. The advantage of V2 is that it completely avoids dereferencing the pointer, even just to take the address, which may fix problems with some compilers. Both versions work on my gcc 9.4 but use the safer one. Fixes: 98e2dd5f7a8b ("regulator: da9063: fix null pointer deref with partial DT config") Signed-off-by: Martin Fuzzey Tested-by: Benjamin Bara Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230804083514.1887124-1-martin.fuzzey@flowbird.group Signed-off-by: Mark Brown commit 385311101538b071a487a9245e01349e3a68ed2c Author: Bard Liao Date: Fri Aug 4 11:47:34 2023 +0800 ASoC: max98363: don't return on success reading revision ID max98363_io_init needs to keep going when we read revision ID successfully. Fixes: 18c0af945fa3 ("ASoC: max98363: add soundwire amplifier driver") Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230804034734.3848227-1-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 4d84f763f7e137be7eeab30cc7daa9449c9cb053 Merge: 788449ae57f42 f803ec63686de Author: Takashi Iwai Date: Fri Aug 4 13:53:15 2023 +0200 Merge tag 'asoc-fix-v6.5-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fix for v6.5 Not really a fix, but rather a licensing update for the fsl_micfil driver. commit 788449ae57f4273111b779bbcaad552b67f517d5 Author: dengxiang Date: Thu Aug 3 10:44:37 2023 +0800 ALSA: usb-audio: Add support for Mythware XA001AU capture and playback interfaces. This patch adds a USB quirk for Mythware XA001AU USB interface. Signed-off-by: dengxiang Cc: Link: https://lore.kernel.org/r/20230803024437.370069-1-dengxiang@nfschina.com Signed-off-by: Takashi Iwai commit 1733d0be68ab1b89358a3b0471ef425fd61de7c5 Merge: 1696ec8654016 d7791cec2304a Author: David S. Miller Date: Fri Aug 4 10:00:17 2023 +0100 Merge branch 'at803x-wol' Li Yang says: ==================== fix at803x wol setting v3: Break long lines Add back error checking of phy_read v4: Disable WoL in 1588 register for AR8031 in probe ==================== Signed-off-by: David S. Miller commit d7791cec2304aea22eb2ada944e4d467302f5bfe Author: Li Yang Date: Wed Aug 2 14:13:47 2023 -0500 net: phy: at803x: remove set/get wol callbacks for AR8032 Since the AR8032 part does not support wol, remove related callbacks from it. Fixes: 5800091a2061 ("net: phy: at803x: add support for AR8032 PHY") Signed-off-by: Li Yang Cc: David Bauer Signed-off-by: David S. Miller commit e58f30246c35c126c7571065b33bee4b3b1d2ef8 Author: Li Yang Date: Wed Aug 2 14:13:46 2023 -0500 net: phy: at803x: fix the wol setting functions In commit 7beecaf7d507 ("net: phy: at803x: improve the WOL feature"), it seems not correct to use a wol_en bit in a 1588 Control Register which is only available on AR8031/AR8033(share the same phy_id) to determine if WoL is enabled. Change it back to use AT803X_INTR_ENABLE_WOL for determining the WoL status which is applicable on all chips supporting wol. Also update the at803x_set_wol() function to only update the 1588 register on chips having it. After this change, disabling wol at probe from commit d7cd5e06c9dd ("net: phy: at803x: disable WOL at probe") is no longer needed. Change it to just disable the WoL bit in 1588 register for AR8031/AR8033 to be aligned with AT803X_INTR_ENABLE_WOL in probe. Fixes: 7beecaf7d507 ("net: phy: at803x: improve the WOL feature") Signed-off-by: Li Yang Reviewed-by: Viorel Suman Reviewed-by: Wei Fang Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 3c6bd1b7e2043fb00ce6b622709d176609431406 Author: Neil Armstrong Date: Wed Aug 2 10:52:22 2023 +0200 Revert "drm/bridge: lt9611: Do not generate HFP/HBP/HSA and EOT packet" This reverts commit 8ddce13ae696 ("drm/bridge: lt9611: Do not generate HFP/HBP/HSA and EOT packet") to fix display regression on the Dragonboard 845c (SDM845) devboard. There's a mismatch on the real action of the following flags: - MIPI_DSI_MODE_VIDEO_NO_HSA - MIPI_DSI_MODE_VIDEO_NO_HFP - MIPI_DSI_MODE_VIDEO_NO_HBP which leads to a non-working display on qcom platforms. Cc: Marek Vasut Cc: Robert Foss Cc: Jagan Teki Cc: Dmitry Baryshkov Cc: Abhinav Kumar Fixes: 8ddce13ae696 ("drm/bridge: lt9611: Do not generate HFP/HBP/HSA and EOT packet") Reported-by: Amit Pundir Closes: https://lore.kernel.org/r/CAMi1Hd0TD=2z_=bcDrht3H_wiLvAFcv8Z-U_r_KUOoeMc6UMjw@mail.gmail.com/ Tested-by: Amit Pundir Acked-by: Dmitry Baryshkov #fix db845c [narmstrong: fixed commit message format] Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230802-revert-do-not-generate-hfp-hbp-hsa-eot-packet-v1-1-f8a20084e15a@linaro.org commit a592ab6171bd943ce3b988bd271c79fe275a7bec Merge: 3e9dce80dbf91 688b419c57c13 Author: Jens Axboe Date: Thu Aug 3 20:03:42 2023 -0600 Merge tag 'nvme-6.5-2023-08-02' of git://git.infradead.org/nvme into block-6.5 Pull NVMe fixes from Keith: "nvme fixes for Linux 6.5 - Fixes for request_queue state (Ming) - Another uuid quirk (August)" * tag 'nvme-6.5-2023-08-02' of git://git.infradead.org/nvme: nvme-pci: add NVME_QUIRK_BOGUS_NID for Samsung PM9B1 256G and 512G nvme-rdma: fix potential unbalanced freeze & unfreeze nvme-tcp: fix potential unbalanced freeze & unfreeze nvme: fix possible hang when removing a controller during error recovery commit 1696ec8654016dad3b1baf6c024303e584400453 Author: Nathan Chancellor Date: Wed Aug 2 10:40:29 2023 -0700 mISDN: Update parameter type of dsp_cmx_send() When booting a kernel with CONFIG_MISDN_DSP=y and CONFIG_CFI_CLANG=y, there is a failure when dsp_cmx_send() is called indirectly from call_timer_fn(): [ 0.371412] CFI failure at call_timer_fn+0x2f/0x150 (target: dsp_cmx_send+0x0/0x530; expected type: 0x92ada1e9) The function pointer prototype that call_timer_fn() expects is void (*fn)(struct timer_list *) whereas dsp_cmx_send() has a parameter type of 'void *', which causes the control flow integrity checks to fail because the parameter types do not match. Change dsp_cmx_send()'s parameter type to be 'struct timer_list' to match the expected prototype. The argument is unused anyways, so this has no functional change, aside from avoiding the CFI failure. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202308020936.58787e6c-oliver.sang@intel.com Signed-off-by: Nathan Chancellor Reviewed-by: Sami Tolvanen Reviewed-by: Kees Cook Fixes: e313ac12eb13 ("mISDN: Convert timers to use timer_setup()") Link: https://lore.kernel.org/r/20230802-fix-dsp_cmx_send-cfi-failure-v1-1-2f2e79b0178d@kernel.org Signed-off-by: Jakub Kicinski commit 1958b0f95a35e4443573c4c3ec2efd89d2d00d82 Merge: 062ff85b11da6 0bc057eae2610 Author: Dave Airlie Date: Fri Aug 4 09:38:36 2023 +1000 Merge tag 'drm-intel-fixes-2023-08-03' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix bug in getting msg length in AUX CH registers handler [gvt] (Yan Zhao) - Gen12 AUX invalidation fixes [gt] (Andi Shyti, Jonathan Cavitt) - Fix premature release of request's reusable memory (Janusz Krzysztofik) - Merge tag 'gvt-fixes-2023-08-02' of https://github.com/intel/gvt-linux into drm-intel-fixes (Tvrtko Ursulin) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZMtkxWGuUKpaRMmo@tursulin-desk commit 062ff85b11da63ecccf7c17778ad225e7b5d06bf Merge: 5d0c230f1de8c c71b7aa8619a0 Author: Dave Airlie Date: Fri Aug 4 09:26:56 2023 +1000 Merge tag 'drm-misc-fixes-2023-08-03' of ssh://git.freedesktop.org/git/drm/drm-misc into drm-fixes A NULL pointer dereference fix for TTM, a timings fix for imx/ipuv3 and the addition of a MODULE_DEVICE_TABLE for the samsung-s6d7aa0 panel. Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/ztfogof2dhtlvjwe73mvd2jp5kbldhkkav7k5culuseqblwpti@qfobohwx3c3j commit c1a515d3c0270628df8ae5f5118ba859b85464a2 Merge: 638c1913d2b01 07d2b820fd75b Author: Linus Torvalds Date: Thu Aug 3 15:47:39 2023 -0700 Merge tag 'perf-tools-fixes-for-v6.5-2-2023-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix segfault in the powerpc specific arch_skip_callchain_idx function. The patch doing the reference count init/exit that went into 6.5 missed this function. - Fix regression reading the arm64 PMU cpu slots in sysfs, a patch removing some code duplication ended up duplicating the /sysfs prefix for these files. - Fix grouping of events related to topdown, addressing a regression on the CSV output produced by 'perf stat' noticed on the downstream tool toplev. - Fix the uprobe_from_different_cu 'perf test' entry, it is failing when gcc isn't available, so we need to check that and skip the test if it is not installed. * tag 'perf-tools-fixes-for-v6.5-2-2023-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: perf test parse-events: Test complex name has required event format perf pmus: Create placholder regardless of scanning core_only perf test uprobe_from_different_cu: Skip if there is no gcc perf parse-events: Only move force grouped evsels when sorting perf parse-events: When fixing group leaders always set the leader perf parse-events: Extra care around force grouped events perf callchain powerpc: Fix addr location init during arch_skip_callchain_idx function perf pmu arm64: Fix reading the PMU cpu slots in sysfs commit 638c1913d2b01ab48159f0723fbf98483579934f Merge: 999f6631866e9 ad64f5952ce3e Author: Linus Torvalds Date: Thu Aug 3 15:41:48 2023 -0700 Merge tag 'cxl-fixes-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl Pull cxl fixes from Vishal Verma: - Fixup the Sanitixe device ABI that was merged for v6.5 to hide some sysfs files when the necessary support is missing. Update the ABI documentation around this as well. * tag 'cxl-fixes-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: cxl/memdev: Only show sanitize sysfs files when supported cxl/memdev: Document security state in kern-doc cxl/memdev: Improve sanitize ABI descriptions commit 999f6631866e9ea81add935b9c6ebaab0579d259 Merge: 7bafbd4027ae8 0765c5f293357 Author: Linus Torvalds Date: Thu Aug 3 14:00:02 2023 -0700 Merge tag 'net-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bpf and wireless. Nothing scary here. Feels like the first wave of regressions from v6.5 is addressed - one outstanding fix still to come in TLS for the sendpage rework. Current release - regressions: - udp: fix __ip_append_data()'s handling of MSG_SPLICE_PAGES - dsa: fix older DSA drivers using phylink Previous releases - regressions: - gro: fix misuse of CB in udp socket lookup - mlx5: unregister devlink params in case interface is down - Revert "wifi: ath11k: Enable threaded NAPI" Previous releases - always broken: - sched: cls_u32: fix match key mis-addressing - sched: bind logic fixes for cls_fw, cls_u32 and cls_route - add bound checks to a number of places which hand-parse netlink - bpf: disable preemption in perf_event_output helpers code - qed: fix scheduling in a tasklet while getting stats - avoid using APIs which are not hardirq-safe in couple of drivers, when we may be in a hard IRQ (netconsole) - wifi: cfg80211: fix return value in scan logic, avoid page allocator warning - wifi: mt76: mt7615: do not advertise 5 GHz on first PHY of MT7615D (DBDC) Misc: - drop handful of inactive maintainers, put some new in place" * tag 'net-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (98 commits) MAINTAINERS: update TUN/TAP maintainers test/vsock: remove vsock_perf executable on `make clean` tcp_metrics: fix data-race in tcpm_suck_dst() vs fastopen tcp_metrics: annotate data-races around tm->tcpm_net tcp_metrics: annotate data-races around tm->tcpm_vals[] tcp_metrics: annotate data-races around tm->tcpm_lock tcp_metrics: annotate data-races around tm->tcpm_stamp tcp_metrics: fix addr_same() helper prestera: fix fallback to previous version on same major version udp: Fix __ip_append_data()'s handling of MSG_SPLICE_PAGES net/mlx5e: Set proper IPsec source port in L4 selector net/mlx5: fs_core: Skip the FTs in the same FS_TYPE_PRIO_CHAINS fs_prio net/mlx5: fs_core: Make find_closest_ft more generic wifi: brcmfmac: Fix field-spanning write in brcmf_scan_params_v2_to_v1() vxlan: Fix nexthop hash size ip6mr: Fix skb_under_panic in ip6mr_cache_report() s390/qeth: Don't call dev_close/dev_open (DOWN/UP) net: tap_open(): set sk_uid from current_fsuid() net: tun_chr_open(): set sk_uid from current_fsuid() net: dcb: choose correct policy to parse DCB_ATTR_BCN ... commit 0765c5f293357ee43eca72e27c3547f9d99ac355 Author: Jakub Kicinski Date: Wed Aug 2 11:28:43 2023 -0700 MAINTAINERS: update TUN/TAP maintainers Willem and Jason have agreed to take over the maintainer duties for TUN/TAP, thank you! There's an existing entry for TUN/TAP which only covers the user mode Linux implementation. Since we haven't heard from Maxim on the list for almost a decade, extend that entry and take it over, rather than adding a new one. Acked-by: Willem de Bruijn Acked-by: Jason Wang Link: https://lore.kernel.org/r/20230802182843.4193099-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 3932f2272313fc79c3166cceb886c9697c00ff86 Merge: 0d48a84b31f5b 4c9fbff542974 Author: Jakub Kicinski Date: Thu Aug 3 11:22:53 2023 -0700 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Martin KaFai Lau says: ==================== pull-request: bpf 2023-08-03 We've added 5 non-merge commits during the last 7 day(s) which contain a total of 3 files changed, 37 insertions(+), 20 deletions(-). The main changes are: 1) Disable preemption in perf_event_output helpers code, from Jiri Olsa 2) Add length check for SK_DIAG_BPF_STORAGE_REQ_MAP_FD parsing, from Lin Ma 3) Multiple warning splat fixes in cpumap from Hou Tao * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf, cpumap: Handle skb as well when clean up ptr_ring bpf, cpumap: Make sure kthread is running before map update returns bpf: Add length check for SK_DIAG_BPF_STORAGE_REQ_MAP_FD parsing bpf: Disable preemption in bpf_event_output bpf: Disable preemption in bpf_perf_event_output ==================== Link: https://lore.kernel.org/r/20230803181429.994607-1-martin.lau@linux.dev Signed-off-by: Jakub Kicinski commit 4fdfaef71fced490835145631a795497646f4555 Author: Douglas Miller Date: Wed Aug 2 13:32:41 2023 -0400 IB/hfi1: Fix possible panic during hotplug remove During hotplug remove it is possible that the update counters work might be pending, and may run after memory has been freed. Cancel the update counters work before freeing memory. Fixes: 7724105686e7 ("IB/hfi1: add driver files") Signed-off-by: Douglas Miller Signed-off-by: Dennis Dalessandro Link: https://lore.kernel.org/r/169099756100.3927190.15284930454106475280.stgit@awfm-02.cornelisnetworks.com Signed-off-by: Leon Romanovsky commit 0d48a84b31f5beaded651a115f102c1d2e19a3a9 Merge: 3c50c8b240390 16e455a465fca Author: Jakub Kicinski Date: Thu Aug 3 11:05:46 2023 -0700 Merge tag 'wireless-2023-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Kalle Valo says: ==================== wireless fixes for v6.5 We did some house cleaning in MAINTAINERS file so several patches about that. Few regressions fixed and also fix some recently enabled memcpy() warnings. Only small commits and nothing special standing out. * tag 'wireless-2023-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: brcmfmac: Fix field-spanning write in brcmf_scan_params_v2_to_v1() wifi: ray_cs: Replace 1-element array with flexible array MAINTAINERS: add Jeff as ath10k, ath11k and ath12k maintainer MAINTAINERS: wifi: mark mlw8k as orphan MAINTAINERS: wifi: mark b43 as orphan MAINTAINERS: wifi: mark zd1211rw as orphan MAINTAINERS: wifi: mark wl3501 as orphan MAINTAINERS: wifi: mark rndis_wlan as orphan MAINTAINERS: wifi: mark ar5523 as orphan MAINTAINERS: wifi: mark cw1200 as orphan MAINTAINERS: wifi: atmel: mark as orphan MAINTAINERS: wifi: rtw88: change Ping as the maintainer Revert "wifi: ath6k: silence false positive -Wno-dangling-pointer warning on GCC 12" wifi: cfg80211: Fix return value in scan logic Revert "wifi: ath11k: Enable threaded NAPI" MAINTAINERS: Update mwifiex maintainer list wifi: mt76: mt7615: do not advertise 5 GHz on first phy of MT7615D (DBDC) ==================== Link: https://lore.kernel.org/r/20230803140058.57476C433C9@smtp.kernel.org Signed-off-by: Jakub Kicinski commit 3c50c8b240390907c9a33c86d25d850520db6dfa Author: Stefano Garzarella Date: Thu Aug 3 10:54:54 2023 +0200 test/vsock: remove vsock_perf executable on `make clean` We forgot to add vsock_perf to the rm command in the `clean` target, so now we have a left over after `make clean` in tools/testing/vsock. Fixes: 8abbffd27ced ("test/vsock: vsock_perf utility") Cc: AVKrasnov@sberdevices.ru Signed-off-by: Stefano Garzarella Reviewed-by: Simon Horman Tested-by: Simon Horman # build-tested Link: https://lore.kernel.org/r/20230803085454.30897-1-sgarzare@redhat.com Signed-off-by: Jakub Kicinski commit 374297e8350b7c3fba7dde438f3414ff05fcba04 Merge: b755c25fbcd56 ddf251fa2bc1d Author: Jakub Kicinski Date: Thu Aug 3 10:58:27 2023 -0700 Merge branch 'tcp_metrics-series-of-fixes' Eric Dumazet says: ==================== tcp_metrics: series of fixes This series contains a fix for addr_same() and various data-race annotations. We still have to address races over tm->tcpm_saddr and tm->tcpm_daddr later. ==================== Link: https://lore.kernel.org/r/20230802131500.1478140-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit ddf251fa2bc1d3699eec0bae6ed0bc373b8fda79 Author: Eric Dumazet Date: Wed Aug 2 13:15:00 2023 +0000 tcp_metrics: fix data-race in tcpm_suck_dst() vs fastopen Whenever tcpm_new() reclaims an old entry, tcpm_suck_dst() would overwrite data that could be read from tcp_fastopen_cache_get() or tcp_metrics_fill_info(). We need to acquire fastopen_seqlock to maintain consistency. For newly allocated objects, tcpm_new() can switch to kzalloc() to avoid an extra fastopen_seqlock acquisition. Fixes: 1fe4c481ba63 ("net-tcp: Fast Open client - cookie cache") Signed-off-by: Eric Dumazet Cc: Yuchung Cheng Reviewed-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230802131500.1478140-7-edumazet@google.com Signed-off-by: Jakub Kicinski commit d5d986ce42c71a7562d32c4e21e026b0f87befec Author: Eric Dumazet Date: Wed Aug 2 13:14:59 2023 +0000 tcp_metrics: annotate data-races around tm->tcpm_net tm->tcpm_net can be read or written locklessly. Instead of changing write_pnet() and read_pnet() and potentially hurt performance, add the needed READ_ONCE()/WRITE_ONCE() in tm_net() and tcpm_new(). Fixes: 849e8a0ca8d5 ("tcp_metrics: Add a field tcpm_net and verify it matches on lookup") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Reviewed-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230802131500.1478140-6-edumazet@google.com Signed-off-by: Jakub Kicinski commit 8c4d04f6b443869d25e59822f7cec88d647028a9 Author: Eric Dumazet Date: Wed Aug 2 13:14:58 2023 +0000 tcp_metrics: annotate data-races around tm->tcpm_vals[] tm->tcpm_vals[] values can be read or written locklessly. Add needed READ_ONCE()/WRITE_ONCE() to document this, and force use of tcp_metric_get() and tcp_metric_set() Fixes: 51c5d0c4b169 ("tcp: Maintain dynamic metrics in local cache.") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Reviewed-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 285ce119a3c6c4502585936650143e54c8692788 Author: Eric Dumazet Date: Wed Aug 2 13:14:57 2023 +0000 tcp_metrics: annotate data-races around tm->tcpm_lock tm->tcpm_lock can be read or written locklessly. Add needed READ_ONCE()/WRITE_ONCE() to document this. Fixes: 51c5d0c4b169 ("tcp: Maintain dynamic metrics in local cache.") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Reviewed-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230802131500.1478140-4-edumazet@google.com Signed-off-by: Jakub Kicinski commit 949ad62a5d5311d36fce2e14fe5fed3f936da51c Author: Eric Dumazet Date: Wed Aug 2 13:14:56 2023 +0000 tcp_metrics: annotate data-races around tm->tcpm_stamp tm->tcpm_stamp can be read or written locklessly. Add needed READ_ONCE()/WRITE_ONCE() to document this. Also constify tcpm_check_stamp() dst argument. Fixes: 51c5d0c4b169 ("tcp: Maintain dynamic metrics in local cache.") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Reviewed-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230802131500.1478140-3-edumazet@google.com Signed-off-by: Jakub Kicinski commit e6638094d7af6c7b9dcca05ad009e79e31b4f670 Author: Eric Dumazet Date: Wed Aug 2 13:14:55 2023 +0000 tcp_metrics: fix addr_same() helper Because v4 and v6 families use separate inetpeer trees (respectively net->ipv4.peers and net->ipv6.peers), inetpeer_addr_cmp(a, b) assumes a & b share the same family. tcp_metrics use a common hash table, where entries can have different families. We must therefore make sure to not call inetpeer_addr_cmp() if the families do not match. Fixes: d39d14ffa24c ("net: Add helper function to compare inetpeer addresses") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Reviewed-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230802131500.1478140-2-edumazet@google.com Signed-off-by: Jakub Kicinski commit b755c25fbcd568821a3bb0e0d5c2daa5fcb00bba Author: Jonas Gorski Date: Wed Aug 2 11:23:56 2023 +0200 prestera: fix fallback to previous version on same major version When both supported and previous version have the same major version, and the firmwares are missing, the driver ends in a loop requesting the same (previous) version over and over again: [ 76.327413] Prestera DX 0000:01:00.0: missing latest mrvl/prestera/mvsw_prestera_fw-v4.1.img firmware, fall-back to previous 4.0 version [ 76.339802] Prestera DX 0000:01:00.0: missing latest mrvl/prestera/mvsw_prestera_fw-v4.0.img firmware, fall-back to previous 4.0 version [ 76.352162] Prestera DX 0000:01:00.0: missing latest mrvl/prestera/mvsw_prestera_fw-v4.0.img firmware, fall-back to previous 4.0 version [ 76.364502] Prestera DX 0000:01:00.0: missing latest mrvl/prestera/mvsw_prestera_fw-v4.0.img firmware, fall-back to previous 4.0 version [ 76.376848] Prestera DX 0000:01:00.0: missing latest mrvl/prestera/mvsw_prestera_fw-v4.0.img firmware, fall-back to previous 4.0 version [ 76.389183] Prestera DX 0000:01:00.0: missing latest mrvl/prestera/mvsw_prestera_fw-v4.0.img firmware, fall-back to previous 4.0 version [ 76.401522] Prestera DX 0000:01:00.0: missing latest mrvl/prestera/mvsw_prestera_fw-v4.0.img firmware, fall-back to previous 4.0 version [ 76.413860] Prestera DX 0000:01:00.0: missing latest mrvl/prestera/mvsw_prestera_fw-v4.0.img firmware, fall-back to previous 4.0 version [ 76.426199] Prestera DX 0000:01:00.0: missing latest mrvl/prestera/mvsw_prestera_fw-v4.0.img firmware, fall-back to previous 4.0 version ... Fix this by inverting the check to that we aren't yet at the previous version, and also check the minor version. This also catches the case where both versions are the same, as it was after commit bb5dbf2cc64d ("net: marvell: prestera: add firmware v4.0 support"). With this fix applied: [ 88.499622] Prestera DX 0000:01:00.0: missing latest mrvl/prestera/mvsw_prestera_fw-v4.1.img firmware, fall-back to previous 4.0 version [ 88.511995] Prestera DX 0000:01:00.0: failed to request previous firmware: mrvl/prestera/mvsw_prestera_fw-v4.0.img [ 88.522403] Prestera DX: probe of 0000:01:00.0 failed with error -2 Fixes: 47f26018a414 ("net: marvell: prestera: try to load previous fw version") Signed-off-by: Jonas Gorski Acked-by: Elad Nachman Reviewed-by: Jesse Brandeburg Acked-by: Taras Chornyi Link: https://lore.kernel.org/r/20230802092357.163944-1-jonas.gorski@bisdn.de Signed-off-by: Jakub Kicinski commit 7bafbd4027ae86572f308c4ddf93120c90126332 Merge: 556c9424e271a 101df45e7ec36 Author: Linus Torvalds Date: Thu Aug 3 09:26:34 2023 -0700 Merge tag 'nfsd-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fix from Chuck Lever: - Fix tmpfs splice read support * tag 'nfsd-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: Fix reading via splice commit 556c9424e271abff7ada9196007418f7b8431c6e Merge: 5e0ba14595232 4da3c7183e186 Author: Linus Torvalds Date: Thu Aug 3 09:20:50 2023 -0700 Merge tag 'erofs-for-6.5-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs fixes from Gao Xiang: - Fix data corruption caused by insufficient decompression on deduplicated compressed extents - Drop a useless s_magic checking in erofs_kill_sb() * tag 'erofs-for-6.5-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: drop unnecessary WARN_ON() in erofs_kill_sb() erofs: fix wrong primary bvec selection on deduplicated extents commit 5e0ba145952328bf1a9c2f0be0bd59a9cc5a7b21 Merge: ec351c8f2e621 388acb471662c Author: Linus Torvalds Date: Thu Aug 3 09:06:38 2023 -0700 Merge tag 's390-6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Heiko Carstens: - Split kernel large page mappings into 4k mappings in case debug pagealloc is enabled again. This got accidentally removed by commit bb1520d581a3 ("s390/mm: start kernel with DAT enabled") - Fix error handling in KVM's sthyi handling - Add missing include to s390's uapi ptrace.h - Update defconfigs * tag 's390-6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/ptrace: add missing linux/const.h include KVM: s390: fix sthyi error handling s390: update defconfigs s390/vmem: split pages when debug pagealloc is enabled commit 421dabcad1c69e02a41c0d601aefbc29ee3f5368 Author: Arnd Bergmann Date: Thu Aug 3 16:33:48 2023 +0200 drm/nouveau: remove unused tu102_gr_load() function tu102_gr_load() is completely unused and can be removed to address this warning: drivers/gpu/drm/nouveau/dispnv50/disp.c:2517:1: error: no previous prototype for 'nv50_display_create' Another patch was sent in the meantime to mark the function static but that would just cause a different warning about an unused function. Fixes: 1cd97b5490c8 ("drm/nouveau/gr/tu102-: use sw_veid_bundle_init from firmware") Link: https://lore.kernel.org/all/CACO55tuaNOYphHyB9+ygi9AnXVuF49etsW7x2X5K5iEtFNAAyw@mail.gmail.com/ Link: https://lore.kernel.org/all/20230417210310.2443152-1-arnd@kernel.org/ Signed-off-by: Arnd Bergmann Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20230803143358.13563-1-arnd@kernel.org commit 89a65c3f170e5c3b05a626046c68354e2afd7912 Author: Mark Brown Date: Thu Aug 3 01:19:06 2023 +0100 arm64/ptrace: Flush FP state when setting ZT0 When setting ZT0 via ptrace we do not currently force a reload of the floating point register state from memory, do that to ensure that the newly set value gets loaded into the registers on next task execution. The function was templated off the function for FPSIMD which due to our providing the option of embedding a FPSIMD regset within the SVE regset does not directly include the flush. Fixes: f90b529bcbe5 ("arm64/sme: Implement ZT0 ptrace support") Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-zt0-flush-v1-1-72e854eaf96e@kernel.org Signed-off-by: Catalin Marinas commit c9bb40b7f786662e33d71afe236442b0b61f0446 Author: Mark Brown Date: Thu Aug 3 00:46:39 2023 +0100 arm64/fpsimd: Clear SME state in the target task when setting the VL When setting SME vector lengths we clear TIF_SME to reenable SME traps, doing a reallocation of the backing storage on next use. We do this using clear_thread_flag() which operates on the current thread, meaning that when setting the vector length via ptrace we may both not force traps for the target task and force a spurious flush of any SME state that the tracing task may have. Clear the flag in the target task. Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers") Reported-by: David Spickett Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-tif-sme-v1-1-88312fd6fbfd@kernel.org Signed-off-by: Catalin Marinas commit f803ec63686dec863a33cad87218d7d99c4b5e92 Author: Daniel Baluta Date: Thu Aug 3 10:26:38 2023 +0300 ASoC: fsl: micfil: Use dual license micfil code We need this in order to easily reuse register definitions and some functions with Sound Open Firmware driver. According to Documentation/process/license-rules.rst: "Dual BSD/GPL" The module is dual licensed under a GPL v2 variant or BSD license choice. The exact variant of the BSD license can only be determined via the license information in the corresponding source files. so use "Dual BSD/GPL" for license string. Signed-off-by: Shengjiu Wang Signed-off-by: Daniel Baluta Acked-by: Sascha Hauer Link: https://lore.kernel.org/r/20230803072638.640789-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 5a78d5db9c90c9dc84212f40a5f2687b7cafc8ec Author: Bartosz Golaszewski Date: Tue Aug 1 21:09:51 2023 +0200 gpio: sim: mark the GPIO chip as a one that can sleep Simulated chips use a mutex for synchronization in driver callbacks so they must not be called from interrupt context. Set the can_sleep field of the GPIO chip to true to force users to only use threaded irqs. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 99b2f159b6e76b84357eae6dc2a206871aa630d5 Author: hanyu001@208suo.com Date: Thu Jul 20 14:40:27 2023 +0800 parisc: unaligned: Add required spaces after ',' Fix checkpatch warnings: unaligned.c:475: ERROR: space required after that ',' Signed-off-by: Yu Han Signed-off-by: Helge Deller commit 2e1b1d7063a35ab6cf9984f9d5bc29829e1e8788 Author: Arnd Bergmann Date: Wed Jul 26 17:09:14 2023 +0200 parport: gsc: remove DMA leftover code This driver does not actually work with DMA mode, but still tries to call ISA DMA interface functions that are stubbed out on parisc, resulting in a W=1 build warning: drivers/parport/parport_gsc.c: In function 'parport_remove_chip': drivers/parport/parport_gsc.c:389:20: warning: suggest braces around empty body in an 'if' statement [-Wempty-body] 389 | free_dma(p->dma); Remove the corresponding code as a prerequisite for turning on -Wempty-body by default in all kernels. Signed-off-by: Arnd Bergmann Signed-off-by: Helge Deller commit ce9ff57d393db86a34ba3f817d7fb886b7c278dc Author: Petr Tesarik Date: Wed Aug 2 18:33:21 2023 +0200 parisc: pci-dma: remove unused and dead EISA code and comment Clearly, this code isn't needed, but it gives a false positive when grepping the complete source tree for coherent_dma_mask. Signed-off-by: Petr Tesarik Signed-off-by: Helge Deller commit c2ff2b736c41cc63bb0aaec85cccfead9fbcfe92 Author: Mike Rapoport (IBM) Date: Thu Aug 3 09:24:04 2023 +0300 parisc/mm: preallocate fixmap page tables at init Christoph Biedl reported early OOM on recent kernels: swapper: page allocation failure: order:0, mode:0x100(__GFP_ZERO), nodemask=(null) CPU: 0 PID: 0 Comm: swapper Not tainted 6.3.0-rc4+ #16 Hardware name: 9000/785/C3600 Backtrace: [<10408594>] show_stack+0x48/0x5c [<10e152d8>] dump_stack_lvl+0x48/0x64 [<10e15318>] dump_stack+0x24/0x34 [<105cf7f8>] warn_alloc+0x10c/0x1c8 [<105d068c>] __alloc_pages+0xbbc/0xcf8 [<105d0e4c>] __get_free_pages+0x28/0x78 [<105ad10c>] __pte_alloc_kernel+0x30/0x98 [<10406934>] set_fixmap+0xec/0xf4 [<10411ad4>] patch_map.constprop.0+0xa8/0xdc [<10411bb0>] __patch_text_multiple+0xa8/0x208 [<10411d78>] patch_text+0x30/0x48 [<1041246c>] arch_jump_label_transform+0x90/0xcc [<1056f734>] jump_label_update+0xd4/0x184 [<1056fc9c>] static_key_enable_cpuslocked+0xc0/0x110 [<1056fd08>] static_key_enable+0x1c/0x2c [<1011362c>] init_mem_debugging_and_hardening+0xdc/0xf8 [<1010141c>] start_kernel+0x5f0/0xa98 [<10105da8>] start_parisc+0xb8/0xe4 Mem-Info: active_anon:0 inactive_anon:0 isolated_anon:0 active_file:0 inactive_file:0 isolated_file:0 unevictable:0 dirty:0 writeback:0 slab_reclaimable:0 slab_unreclaimable:0 mapped:0 shmem:0 pagetables:0 sec_pagetables:0 bounce:0 kernel_misc_reclaimable:0 free:0 free_pcp:0 free_cma:0 Node 0 active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:0kB writeback:0kB shmem:0kB +writeback_tmp:0kB kernel_stack:0kB pagetables:0kB sec_pagetables:0kB all_unreclaimable? no Normal free:0kB boost:0kB min:0kB low:0kB high:0kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB +present:1048576kB managed:1039360kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB lowmem_reserve[]: 0 0 Normal: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 0kB 0 total pagecache pages 0 pages in swap cache Free swap = 0kB Total swap = 0kB 262144 pages RAM 0 pages HighMem/MovableOnly 2304 pages reserved Backtrace: [<10411d78>] patch_text+0x30/0x48 [<1041246c>] arch_jump_label_transform+0x90/0xcc [<1056f734>] jump_label_update+0xd4/0x184 [<1056fc9c>] static_key_enable_cpuslocked+0xc0/0x110 [<1056fd08>] static_key_enable+0x1c/0x2c [<1011362c>] init_mem_debugging_and_hardening+0xdc/0xf8 [<1010141c>] start_kernel+0x5f0/0xa98 [<10105da8>] start_parisc+0xb8/0xe4 Kernel Fault: Code=15 (Data TLB miss fault) at addr 0f7fe3c0 CPU: 0 PID: 0 Comm: swapper Not tainted 6.3.0-rc4+ #16 Hardware name: 9000/785/C3600 This happens because patching static key code temporarily maps it via fixmap and if it happens before page allocator is initialized set_fixmap() cannot allocate memory using pte_alloc_kernel(). Make sure that fixmap page tables are preallocated early so that pte_offset_kernel() in set_fixmap() never resorts to pte allocation. Signed-off-by: Mike Rapoport (IBM) Acked-by: Vlastimil Babka Signed-off-by: Helge Deller Tested-by: Christoph Biedl Tested-by: John David Anglin Cc: # v6.4+ commit 583893a66d731f5da010a3fa38a0460e05f0149b Author: Sanjay R Mehta Date: Wed Aug 2 06:11:49 2023 -0500 thunderbolt: Fix Thunderbolt 3 display flickering issue on 2nd hot plug onwards Previously, on unplug events, the TMU mode was disabled first followed by the Time Synchronization Handshake, irrespective of whether the tb_switch_tmu_rate_write() API was successful or not. However, this caused a problem with Thunderbolt 3 (TBT3) devices, as the TSPacketInterval bits were always enabled by default, leading the host router to assume that the device router's TMU was already enabled and preventing it from initiating the Time Synchronization Handshake. As a result, TBT3 monitors experienced display flickering from the second hot plug onwards. To address this issue, we have modified the code to only disable the Time Synchronization Handshake during TMU disable if the tb_switch_tmu_rate_write() function is successful. This ensures that the TBT3 devices function correctly and eliminates the display flickering issue. Co-developed-by: Sanath S Signed-off-by: Sanath S Signed-off-by: Sanjay R Mehta Cc: stable@vger.kernel.org Signed-off-by: Mika Westerberg commit e4060dad253352382b20420d8ef98daab24dbc17 Author: Lyude Paul Date: Fri Jul 28 18:58:57 2023 -0400 drm/nouveau/nvkm/dp: Add workaround to fix DP 1.3+ DPCD issues Currently we use the drm_dp_dpcd_read_caps() helper in the DRM side of nouveau in order to read the DPCD of a DP connector, which makes sure we do the right thing and also check for extended DPCD caps. However, it turns out we're not currently doing this on the nvkm side since we don't have access to the drm_dp_aux structure there - which means that the DRM side of the driver and the NVKM side can end up with different DPCD capabilities for the same connector. Ideally in order to fix this, we just want to use the drm_dp_read_dpcd_caps() helper in nouveau. That's not currently possible though, and is going to depend on having a bunch of the DP code moved out of nvkm and into the DRM side of things as part of the GSP enablement work. Until then however, let's workaround this problem by porting a copy of drm_dp_read_dpcd_caps() into NVKM - which should fix this issue. Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/211 Link: https://patchwork.freedesktop.org/patch/msgid/20230728225858.350581-1-lyude@redhat.com (cherry picked from commit cc4adf3a7323212f303bc9ff0f96346c44fcba06 in drm-misc-next) Cc: # 6.3+ Signed-off-by: Karol Herbst commit 1cb9e2ef66d53b020842b18762e30d0eb4384de8 Author: Karol Herbst Date: Thu Jun 22 17:20:17 2023 +0200 drm/nouveau/gr: enable memory loads on helper invocation on all channels We have a lurking bug where Fragment Shader Helper Invocations can't load from memory. But this is actually required in OpenGL and is causing random hangs or failures in random shaders. It is unknown how widespread this issue is, but shaders hitting this can end up with infinite loops. We enable those only on all Kepler and newer GPUs where we use our own Firmware. Nvidia's firmware provides a way to set a kernelspace controlled list of mmio registers in the gr space from push buffers via MME macros. v2: drop code for gm200 and newer. Cc: Ben Skeggs Cc: David Airlie Cc: nouveau@lists.freedesktop.org Cc: stable@vger.kernel.org # 4.19+ Signed-off-by: Karol Herbst Reviewed-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230622152017.2512101-1-kherbst@redhat.com commit e9d699af3f65d62cf195f0e7a039400093ab2af2 Author: Pin-yen Lin Date: Thu Jul 27 18:01:10 2023 +0800 drm/bridge: it6505: Check power state with it6505->powered in IRQ handler On system resume, the driver might call it6505_poweron directly if the runtime PM hasn't been enabled. In such case, pm_runtime_get_if_in_use will always return 0 because dev->power.runtime_status stays at RPM_SUSPENDED, and the IRQ will never be handled. Use it6505->powered from the driver struct fixes this because it always gets updated when it6505_poweron is called. Fixes: 5eb9a4314053 ("drm/bridge: it6505: Guard bridge power in IRQ handler") Signed-off-by: Pin-yen Lin Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230727100131.2338127-1-treapking@chromium.org commit 7d695d83767cdb4288b101affef6d1d1bcf44d31 Author: Tony Lindgren Date: Thu Aug 3 10:10:32 2023 +0300 serial: core: Fix serial_base_match() after fixing controller port name While fixing DEVNAME to be more usable, I broke serial_base_match() as the ctrl and port prefix for device names seemed unnecessary. The prefixes are still needed by serial_base_match() to probe the serial base controller port, and serial tx is now broken. Let's fix the issue by checking against dev->type and drv->name instead of the prefixes that are no longer in the DEVNAME. Fixes: 1ef2c2df1199 ("serial: core: Fix serial core controller port name to show controller id") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202308021529.35b3ad6c-oliver.sang@intel.com Signed-off-by: Tony Lindgren Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20230803071034.25571-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 534fc31d09b706a16d83533e16b5dc855caf7576 Author: Ross Lagerwall Date: Thu Aug 3 08:41:22 2023 +0200 xen/netback: Fix buffer overrun triggered by unusual packet It is possible that a guest can send a packet that contains a head + 18 slots and yet has a len <= XEN_NETBACK_TX_COPY_LEN. This causes nr_slots to underflow in xenvif_get_requests() which then causes the subsequent loop's termination condition to be wrong, causing a buffer overrun of queue->tx_map_ops. Rework the code to account for the extra frag_overflow slots. This is CVE-2023-34319 / XSA-432. Fixes: ad7f402ae4f4 ("xen/netback: Ensure protocol headers don't fall in the non-linear area") Signed-off-by: Ross Lagerwall Reviewed-by: Paul Durrant Reviewed-by: Wei Liu Signed-off-by: Juergen Gross commit 0f71c9caf26726efea674646f566984e735cc3b9 Author: David Howells Date: Tue Aug 1 16:48:53 2023 +0100 udp: Fix __ip_append_data()'s handling of MSG_SPLICE_PAGES __ip_append_data() can get into an infinite loop when asked to splice into a partially-built UDP message that has more than the frag-limit data and up to the MTU limit. Something like: pipe(pfd); sfd = socket(AF_INET, SOCK_DGRAM, 0); connect(sfd, ...); send(sfd, buffer, 8161, MSG_CONFIRM|MSG_MORE); write(pfd[1], buffer, 8); splice(pfd[0], 0, sfd, 0, 0x4ffe0ul, 0); where the amount of data given to send() is dependent on the MTU size (in this instance an interface with an MTU of 8192). The problem is that the calculation of the amount to copy in __ip_append_data() goes negative in two places, and, in the second place, this gets subtracted from the length remaining, thereby increasing it. This happens when pagedlen > 0 (which happens for MSG_ZEROCOPY and MSG_SPLICE_PAGES), because the terms in: copy = datalen - transhdrlen - fraggap - pagedlen; then mostly cancel when pagedlen is substituted for, leaving just -fraggap. This causes: length -= copy + transhdrlen; to increase the length to more than the amount of data in msg->msg_iter, which causes skb_splice_from_iter() to be unable to fill the request and it returns less than 'copied' - which means that length never gets to 0 and we never exit the loop. Fix this by: (1) Insert a note about the dodgy calculation of 'copy'. (2) If MSG_SPLICE_PAGES, clear copy if it is negative from the above equation, so that 'offset' isn't regressed and 'length' isn't increased, which will mean that length and thus copy should match the amount left in the iterator. (3) When handling MSG_SPLICE_PAGES, give a warning and return -EIO if we're asked to splice more than is in the iterator. It might be better to not give the warning or even just give a 'short' write. [!] Note that this ought to also affect MSG_ZEROCOPY, but MSG_ZEROCOPY avoids the problem by simply assuming that everything asked for got copied, not just the amount that was in the iterator. This is a potential bug for the future. Fixes: 7ac7c987850c ("udp: Convert udp_sendpage() to use MSG_SPLICE_PAGES") Reported-by: syzbot+f527b971b4bdc8e79f9e@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/000000000000881d0606004541d1@google.com/ Signed-off-by: David Howells cc: David Ahern cc: Jens Axboe Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/1420063.1690904933@warthog.procyon.org.uk Signed-off-by: Jakub Kicinski commit a2d9831dab3ea9e2f45f37956d32fbdde6dc7053 Merge: 0756384fb1bd3 62da08331f1a2 Author: Jakub Kicinski Date: Wed Aug 2 18:38:45 2023 -0700 Merge branch 'mlx5-ipsec-fixes' Leon Romanovsky says: ==================== mlx5 IPsec fixes The following patches are combination of Jianbo's work on IPsec eswitch mode together with our internal review toward addition of TCP protocol selectors support to IPSec packet offload. Despite not-being fix, the first patch helps us to make second one more clear, so I'm asking to apply it anyway as part of this series. ==================== Link: https://lore.kernel.org/r/cover.1690803944.git.leonro@nvidia.com Signed-off-by: Jakub Kicinski commit 62da08331f1a2bef9d0148613133ce8e640a2f8d Author: Leon Romanovsky Date: Mon Jul 31 14:58:42 2023 +0300 net/mlx5e: Set proper IPsec source port in L4 selector Fix typo in setup_fte_upper_proto_match() where destination UDP port was used instead of source port. Fixes: a7385187a386 ("net/mlx5e: IPsec, support upper protocol selector field offload") Signed-off-by: Leon Romanovsky Link: https://lore.kernel.org/r/ffc024a4d192113103f392b0502688366ca88c1f.1690803944.git.leonro@nvidia.com Signed-off-by: Jakub Kicinski commit c635ca45a7a2023904a1f851e99319af7b87017d Author: Jianbo Liu Date: Mon Jul 31 14:58:41 2023 +0300 net/mlx5: fs_core: Skip the FTs in the same FS_TYPE_PRIO_CHAINS fs_prio In the cited commit, new type of FS_TYPE_PRIO_CHAINS fs_prio was added to support multiple parallel namespaces for multi-chains. And we skip all the flow tables under the fs_node of this type unconditionally, when searching for the next or previous flow table to connect for a new table. As this search function is also used for find new root table when the old one is being deleted, it will skip the entire FS_TYPE_PRIO_CHAINS fs_node next to the old root. However, new root table should be chosen from it if there is any table in it. Fix it by skipping only the flow tables in the same FS_TYPE_PRIO_CHAINS fs_node when finding the closest FT for a fs_node. Besides, complete the connecting from FTs of previous priority of prio because there should be multiple prevs after this fs_prio type is introduced. And also the next FT should be chosen from the first flow table next to the prio in the same FS_TYPE_PRIO_CHAINS fs_prio, if this prio is the first child. Fixes: 328edb499f99 ("net/mlx5: Split FDB fast path prio to multiple namespaces") Signed-off-by: Jianbo Liu Reviewed-by: Paul Blakey Signed-off-by: Leon Romanovsky Link: https://lore.kernel.org/r/7a95754df479e722038996c97c97b062b372591f.1690803944.git.leonro@nvidia.com Signed-off-by: Jakub Kicinski commit 618d28a535a0582617465d14e05f3881736a2962 Author: Jianbo Liu Date: Mon Jul 31 14:58:40 2023 +0300 net/mlx5: fs_core: Make find_closest_ft more generic As find_closest_ft_recursive is called to find the closest FT, the first parameter of find_closest_ft can be changed from fs_prio to fs_node. Thus this function is extended to find the closest FT for the nodes of any type, not only prios, but also the sub namespaces. Signed-off-by: Jianbo Liu Signed-off-by: Leon Romanovsky Link: https://lore.kernel.org/r/d3962c2b443ec8dde7a740dc742a1f052d5e256c.1690803944.git.leonro@nvidia.com Signed-off-by: Jakub Kicinski commit ec351c8f2e6211054e51e661589cddd1fe856425 Merge: a4e98a30bc958 d21afb098c510 Author: Linus Torvalds Date: Wed Aug 2 18:21:12 2023 -0700 Merge tag 'soc-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "A couple of platforms get a lone dts fix each: - SoCFPGA: Fix incorrect I2C property for SCL signal - Renesas: Fix interrupt names for MTU3 channels on RZ/G2L and RZ/V2L. - Juno/Vexpress: remove a dangling symlink - at91: sam9x60 SoC detection compatible strings - nspire: Fix arm primecell compatible string On the NXP i.MX platform, there multiple issues that get addressed: - A couple of ARM DTS fixes for i.MX6SLL usbphy and supported CPU frequency of sk-imx53 board - Add missing pull-up for imx8mn-var-som onboard PHY reset pinmux - A couple of imx8mm-venice fixes from Tim Harvey to diable disp_blk_ctrl - A couple of phycore-imx8mm fixes from Yashwanth Varakala to correct VPU label and gpio-line-names - Fix imx8mp-blk-ctrl driver to register HSIO PLL clock as bus_power_dev child, so that runtime PM can translate into the necessary GPC power domain action On the driver side, there are two fixes for tegra memory controller drivers addressing regressions from the merge window, a couple of minor correctness fixes for SCMI and SMCCC firmware, as well as a build fix for an lcd backlight driver" * tag 'soc-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (22 commits) backlight: corgi_lcd: fix missing prototype memory: tegra: make icc_set_bw return zero if BWMGR not supported arm64: dts: renesas: rzg2l: Update overfow/underflow IRQ names for MTU3 channels dt-bindings: serial: atmel,at91-usart: update compatible for sam9x60 ARM: dts: at91: sam9x60: fix the SOC detection ARM: dts: nspire: Fix arm primecell compatible string firmware: arm_scmi: Fix chan_free cleanup on SMC firmware: arm_scmi: Drop OF node reference in the transport channel setup soc: imx: imx8mp-blk-ctrl: register HSIO PLL clock as bus_power_dev child ARM: dts: nxp/imx: limit sk-imx53 supported frequencies firmware: arm_scmi: Fix signed error return values handling firmware: smccc: Fix use of uninitialised results structure arm64: dts: freescale: Fix VPU G2 clock arm64: dts: imx8mn-var-som: add missing pull-up for onboard PHY reset pinmux arm64: dts: phycore-imx8mm: Correction in gpio-line-names arm64: dts: phycore-imx8mm: Label typo-fix of VPU ARM: dts: nxp/imx6sll: fix wrong property name in usbphy node arm64: dts: imx8mm-venice-gw7904: disable disp_blk_ctrl arm64: dts: imx8mm-venice-gw7903: disable disp_blk_ctrl arm64: dts: arm: Remove the dangling vexpress-v2m-rs1.dtsi symlink ... commit a4e98a30bc958694579dd5346aa6fcd38b5afe86 Merge: 4b954598a47ba 2356d198d2b4d Author: Linus Torvalds Date: Wed Aug 2 18:10:26 2023 -0700 Merge tag 'bitmap-6.5-rc5' of https://github.com:/norov/linux Pull bitmap fixes from Yury Norov: - Fix for bitmap documentation - Fix for kernel build under certain configurations * tag 'bitmap-6.5-rc5' of https://github.com:/norov/linux: lib/bitmap: workaround const_eval test build failure cpumask: eliminate kernel-doc warnings commit 6ad0f2f91ad14ba0a3c2990c054fd6fbe8100429 Author: YueHaibing Date: Tue Jul 25 22:21:08 2023 +0800 Drivers: hv: vmbus: Remove unused extern declaration vmbus_ontimer() Since commit 30fbee49b071 ("Staging: hv: vmbus: Get rid of the unused function vmbus_ontimer()") this is not used anymore, so can remove it. Signed-off-by: YueHaibing Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20230725142108.27280-1-yuehaibing@huawei.com Signed-off-by: Wei Liu commit 9e2d0c336524706fb327e9b87477f5f3337ad7a6 Author: Saurabh Sengar Date: Fri Jun 23 09:28:08 2023 -0700 x86/hyperv: add noop functions to x86_init mpparse functions Hyper-V can run VMs at different privilege "levels" known as Virtual Trust Levels (VTL). Sometimes, it chooses to run two different VMs at different levels but they share some of their address space. In such setups VTL2 (higher level VM) has visibility of all of the VTL0 (level 0) memory space. When the CONFIG_X86_MPPARSE is enabled for VTL2, the VTL2 kernel performs a search within the low memory to locate MP tables. However, in systems where VTL0 manages the low memory and may contain valid tables, this scanning can result in incorrect MP table information being provided to the VTL2 kernel, mistakenly considering VTL0's MP table as its own Add noop functions to avoid MP parse scan by VTL2. Signed-off-by: Saurabh Sengar Acked-by: Dave Hansen Link: https://lore.kernel.org/r/1687537688-5397-1-git-send-email-ssengar@linux.microsoft.com Signed-off-by: Wei Liu commit 640c503d7dbd7d34a62099c933f4db0ed77ccbec Author: Song Shuai Date: Mon Jul 24 18:09:17 2023 +0800 Documentation: kdump: Add va_kernel_pa_offset for RISCV64 RISC-V Linux exports "va_kernel_pa_offset" in vmcoreinfo to help Crash-utility translate the kernel virtual address correctly. Here adds the definition of "va_kernel_pa_offset". Fixes: 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping") Link: https://lore.kernel.org/linux-riscv/20230724040649.220279-1-suagrfillet@gmail.com/ Signed-off-by: Song Shuai Reviewed-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20230724100917.309061-2-suagrfillet@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit fbe7d19d2b7fcbd38905ba9f691be8f245c6faa6 Author: Song Shuai Date: Mon Jul 24 18:09:16 2023 +0800 riscv: Export va_kernel_pa_offset in vmcoreinfo Since RISC-V Linux v6.4, the commit 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping") changes phys_ram_base from the physical start of the kernel to the actual start of the DRAM. The Crash-utility's VTOP() still uses phys_ram_base and kernel_map.virt_addr to translate kernel virtual address, that failed the Crash with Linux v6.4 [1]. Export kernel_map.va_kernel_pa_offset in vmcoreinfo to help Crash translate the kernel virtual address correctly. Fixes: 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping") Link: https://lore.kernel.org/linux-riscv/20230724040649.220279-1-suagrfillet@gmail.com/ [1] Signed-off-by: Song Shuai Reviewed-by: Xianting Tian  Reviewed-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20230724100917.309061-1-suagrfillet@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 568701fee36652a7660ed667a3980c945d8051e0 Author: Sunil V L Date: Mon Jul 24 15:33:46 2023 +0530 RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address acpi_os_ioremap() currently is a wrapper to memremap() on RISC-V. But the callers of acpi_os_ioremap() expect it to return __iomem address and hence sparse tool reports a new warning. Fix this issue by type casting to __iomem type. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307230357.egcTAefj-lkp@intel.com/ Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core") Signed-off-by: Sunil V L Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230724100346.1302937-1-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 25696067202f047e22c1562f1f56b0e2eb547d1a Author: Alexandre Ghiti Date: Thu Jul 13 13:58:29 2023 +0200 selftests: riscv: Fix compilation error with vstate_exec_nolibc.c The following error happens: In file included from vstate_exec_nolibc.c:2: /usr/include/riscv64-linux-gnu/sys/prctl.h:42:12: error: conflicting types for ‘prctl’; h ave ‘int(int, ...)’ 42 | extern int prctl (int __option, ...) __THROW; | ^~~~~ In file included from ./../../../../include/nolibc/nolibc.h:99, from : ./../../../../include/nolibc/sys.h:892:5: note: previous definition of ‘prctl’ with type ‘int(int, long unsigned int, long unsigned int, long unsigned int, long unsigned int) ’ 892 | int prctl(int option, unsigned long arg2, unsigned long arg3, | ^~~~~ Fix this by not including , which is not needed here since prctl syscall is directly called using its number. Fixes: 7cf6198ce22d ("selftests: Test RISC-V Vector prctl interface") Signed-off-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20230713115829.110421-1-alexghiti@rivosinc.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 8c82d2bf5944123d8e90d01bf27655497d9aa321 Author: John Hubbard Date: Wed Jul 12 12:35:14 2023 -0700 selftests/riscv: fix potential build failure during the "emit_tests" step The riscv selftests (which were modeled after the arm64 selftests) are improperly declaring the "emit_tests" target to depend upon the "all" target. This approach, when combined with commit 9fc96c7c19df ("selftests: error out if kernel header files are not yet built"), has caused build failures [1] on arm64, and is likely to cause similar failures for riscv. To fix this, simply remove the unnecessary "all" dependency from the emit_tests target. The dependency is still effectively honored, because again, invocation is via "install", which also depends upon "all". An alternative approach would be to harden the emit_tests target so that it can depend upon "all", but that's a lot more complicated and hard to get right, and doesn't seem worth it, especially given that emit_tests should probably not be overridden at all. [1] https://lore.kernel.org/20230710-kselftest-fix-arm64-v1-1-48e872844f25@kernel.org Fixes: 9fc96c7c19df ("selftests: error out if kernel header files are not yet built") Signed-off-by: John Hubbard Tested-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20230712193514.740033-1-jhubbard@nvidia.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 4b954598a47ba07034aab9af8ddd485bdc3d5b16 Merge: 79d65ee53b968 ff84772fd45d4 Author: Linus Torvalds Date: Wed Aug 2 11:43:06 2023 -0700 Merge tag 'exfat-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat Pull exfat fixes from Namjae Jeon: - Fix page allocation failure from allocation bitmap by using kvmalloc_array/kvfree - Add the check to validate if filename entries exceeds max filename length - Fix potential deadlock condition from dir_emit*() * tag 'exfat-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat: exfat: release s_lock before calling dir_emit() exfat: check if filename entries exceeds max filename length exfat: use kvmalloc_array/kvfree instead of kmalloc_array/kfree commit 11260c3d608b59231f4c228147a795ab21a10b33 Author: Paulo Alcantara Date: Wed Aug 2 13:43:03 2023 -0300 smb: client: fix dfs link mount against w2k8 Customer reported that they couldn't mount their DFS link that was seen by the client as a DFS interlink -- special form of DFS link where its single target may point to a different DFS namespace -- and it turned out that it was just a regular DFS link where its referral header flags missed the StorageServers bit thus making the client think it couldn't tree connect to target directly without requiring further referrals. When the DFS link referral header flags misses the StoraServers bit and its target doesn't respond to any referrals, then tree connect to it. Fixes: a1c0d00572fc ("cifs: share dfs connections and supers") Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 79d65ee53b968c006ad382a4d4c2dccd898706f9 Merge: 79e8328e5acbe d4e0265345778 Author: Linus Torvalds Date: Wed Aug 2 11:04:27 2023 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Three small fixes, all in drivers" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: pm80xx: Fix error return code in pm8001_pci_probe() scsi: zfcp: Defer fc_rport blocking until after ADISC response scsi: storvsc: Limit max_sectors for virtual Fibre Channel devices commit 79e8328e5acbe691bbde029a52c89d70dcbc22f3 Author: ndesaulniers@google.com Date: Tue Aug 1 15:22:17 2023 -0700 word-at-a-time: use the same return type for has_zero regardless of endianness Compiling big-endian targets with Clang produces the diagnostic: fs/namei.c:2173:13: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] } while (!(has_zero(a, &adata, &constants) | has_zero(b, &bdata, &constants))); ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ || fs/namei.c:2173:13: note: cast one or both operands to int to silence this warning It appears that when has_zero was introduced, two definitions were produced with different signatures (in particular different return types). Looking at the usage in hash_name() in fs/namei.c, I suspect that has_zero() is meant to be invoked twice per while loop iteration; using logical-or would not update `bdata` when `a` did not have zeros. So I think it's preferred to always return an unsigned long rather than a bool than update the while loop in hash_name() to use a logical-or rather than bitwise-or. [ Also changed powerpc version to do the same - Linus ] Link: https://github.com/ClangBuiltLinux/linux/issues/1832 Link: https://lore.kernel.org/lkml/20230801-bitwise-v1-1-799bec468dc4@google.com/ Fixes: 36126f8f2ed8 ("word-at-a-time: make the interfaces truly generic") Debugged-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Acked-by: Heiko Carstens Cc: Arnd Bergmann Signed-off-by: Linus Torvalds commit 86582e6189dd8f9f52c25d46c70fe5d111da6345 Author: Benjamin Gray Date: Thu Jul 6 11:08:16 2023 +1000 powerpc/powermac: Use early_* IO variants in via_calibrate_decr() On a powermac platform, via the call path: start_kernel() time_init() ppc_md.calibrate_decr() (pmac_calibrate_decr) via_calibrate_decr() ioremap() and iounmap() are called. The unmap can enable interrupts unexpectedly (cond_resched() in vunmap_pmd_range()), which causes a warning later in the boot sequence in start_kernel(). Use the early_* variants of these IO functions to prevent this. The issue is pre-existing, but is surfaced by commit 721255b9826b ("genirq: Use a maple tree for interrupt descriptor management"). Signed-off-by: Benjamin Gray Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/20230706010816.72682-1-bgray@linux.ibm.com commit 16e455a465fca91907af0108f3d013150386df30 Author: Hans de Goede Date: Sat Jul 29 16:05:00 2023 +0200 wifi: brcmfmac: Fix field-spanning write in brcmf_scan_params_v2_to_v1() Using brcmfmac with 6.5-rc3 on a brcmfmac43241b4-sdio triggers a backtrace caused by the following field-spanning warning: memcpy: detected field-spanning write (size 120) of single field "¶ms_le->channel_list[0]" at drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1072 (size 2) The driver still works after this warning. The warning was introduced by the new field-spanning write checks which were enabled recently. Fix this by replacing the channel_list[1] declaration at the end of the struct with a flexible array declaration. Most users of struct brcmf_scan_params_le calculate the size to alloc using the size of the non flex-array part of the struct + needed extra space, so they do not care about sizeof(struct brcmf_scan_params_le). brcmf_notify_escan_complete() however uses the struct on the stack, expecting there to be room for at least 1 entry in the channel-list to store the special -1 abort channel-id. To make this work use an anonymous union with a padding member added + the actual channel_list flexible array. Cc: Kees Cook Signed-off-by: Hans de Goede Reviewed-by: Kees Cook Reviewed-by: Franky Lin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230729140500.27892-1-hdegoede@redhat.com commit 0756384fb1bd38adb2ebcfd1307422f433a1d772 Author: Benjamin Poirier Date: Mon Jul 31 16:02:08 2023 -0400 vxlan: Fix nexthop hash size The nexthop code expects a 31 bit hash, such as what is returned by fib_multipath_hash() and rt6_multipath_hash(). Passing the 32 bit hash returned by skb_get_hash() can lead to problems related to the fact that 'int hash' is a negative number when the MSB is set. In the case of hash threshold nexthop groups, nexthop_select_path_hthr() will disproportionately select the first nexthop group entry. In the case of resilient nexthop groups, nexthop_select_path_res() may do an out of bounds access in nh_buckets[], for example: hash = -912054133 num_nh_buckets = 2 bucket_index = 65535 which leads to the following panic: BUG: unable to handle page fault for address: ffffc900025910c8 PGD 100000067 P4D 100000067 PUD 10026b067 PMD 0 Oops: 0002 [#1] PREEMPT SMP KASAN NOPTI CPU: 4 PID: 856 Comm: kworker/4:3 Not tainted 6.5.0-rc2+ #34 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Workqueue: ipv6_addrconf addrconf_dad_work RIP: 0010:nexthop_select_path+0x197/0xbf0 Code: c1 e4 05 be 08 00 00 00 4c 8b 35 a4 14 7e 01 4e 8d 6c 25 00 4a 8d 7c 25 08 48 01 dd e8 c2 25 15 ff 49 8d 7d 08 e8 39 13 15 ff <4d> 89 75 08 48 89 ef e8 7d 12 15 ff 48 8b 5d 00 e8 14 55 2f 00 85 RSP: 0018:ffff88810c36f260 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 00000000002000c0 RCX: ffffffffaf02dd77 RDX: dffffc0000000000 RSI: 0000000000000008 RDI: ffffc900025910c8 RBP: ffffc900025910c0 R08: 0000000000000001 R09: fffff520004b2219 R10: ffffc900025910cf R11: 31392d2068736168 R12: 00000000002000c0 R13: ffffc900025910c0 R14: 00000000fffef608 R15: ffff88811840e900 FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffc900025910c8 CR3: 0000000129d00000 CR4: 0000000000750ee0 PKRU: 55555554 Call Trace: ? __die+0x23/0x70 ? page_fault_oops+0x1ee/0x5c0 ? __pfx_is_prefetch.constprop.0+0x10/0x10 ? __pfx_page_fault_oops+0x10/0x10 ? search_bpf_extables+0xfe/0x1c0 ? fixup_exception+0x3b/0x470 ? exc_page_fault+0xf6/0x110 ? asm_exc_page_fault+0x26/0x30 ? nexthop_select_path+0x197/0xbf0 ? nexthop_select_path+0x197/0xbf0 ? lock_is_held_type+0xe7/0x140 vxlan_xmit+0x5b2/0x2340 ? __lock_acquire+0x92b/0x3370 ? __pfx_vxlan_xmit+0x10/0x10 ? __pfx___lock_acquire+0x10/0x10 ? __pfx_register_lock_class+0x10/0x10 ? skb_network_protocol+0xce/0x2d0 ? dev_hard_start_xmit+0xca/0x350 ? __pfx_vxlan_xmit+0x10/0x10 dev_hard_start_xmit+0xca/0x350 __dev_queue_xmit+0x513/0x1e20 ? __pfx___dev_queue_xmit+0x10/0x10 ? __pfx_lock_release+0x10/0x10 ? mark_held_locks+0x44/0x90 ? skb_push+0x4c/0x80 ? eth_header+0x81/0xe0 ? __pfx_eth_header+0x10/0x10 ? neigh_resolve_output+0x215/0x310 ? ip6_finish_output2+0x2ba/0xc90 ip6_finish_output2+0x2ba/0xc90 ? lock_release+0x236/0x3e0 ? ip6_mtu+0xbb/0x240 ? __pfx_ip6_finish_output2+0x10/0x10 ? find_held_lock+0x83/0xa0 ? lock_is_held_type+0xe7/0x140 ip6_finish_output+0x1ee/0x780 ip6_output+0x138/0x460 ? __pfx_ip6_output+0x10/0x10 ? __pfx___lock_acquire+0x10/0x10 ? __pfx_ip6_finish_output+0x10/0x10 NF_HOOK.constprop.0+0xc0/0x420 ? __pfx_NF_HOOK.constprop.0+0x10/0x10 ? ndisc_send_skb+0x2c0/0x960 ? __pfx_lock_release+0x10/0x10 ? __local_bh_enable_ip+0x93/0x110 ? lock_is_held_type+0xe7/0x140 ndisc_send_skb+0x4be/0x960 ? __pfx_ndisc_send_skb+0x10/0x10 ? mark_held_locks+0x65/0x90 ? find_held_lock+0x83/0xa0 ndisc_send_ns+0xb0/0x110 ? __pfx_ndisc_send_ns+0x10/0x10 addrconf_dad_work+0x631/0x8e0 ? lock_acquire+0x180/0x3f0 ? __pfx_addrconf_dad_work+0x10/0x10 ? mark_held_locks+0x24/0x90 process_one_work+0x582/0x9c0 ? __pfx_process_one_work+0x10/0x10 ? __pfx_do_raw_spin_lock+0x10/0x10 ? mark_held_locks+0x24/0x90 worker_thread+0x93/0x630 ? __kthread_parkme+0xdc/0x100 ? __pfx_worker_thread+0x10/0x10 kthread+0x1a5/0x1e0 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x34/0x60 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1b/0x30 RIP: 0000:0x0 Code: Unable to access opcode bytes at 0xffffffffffffffd6. RSP: 0000:0000000000000000 EFLAGS: 00000000 ORIG_RAX: 0000000000000000 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: CR2: ffffc900025910c8 ---[ end trace 0000000000000000 ]--- RIP: 0010:nexthop_select_path+0x197/0xbf0 Code: c1 e4 05 be 08 00 00 00 4c 8b 35 a4 14 7e 01 4e 8d 6c 25 00 4a 8d 7c 25 08 48 01 dd e8 c2 25 15 ff 49 8d 7d 08 e8 39 13 15 ff <4d> 89 75 08 48 89 ef e8 7d 12 15 ff 48 8b 5d 00 e8 14 55 2f 00 85 RSP: 0018:ffff88810c36f260 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 00000000002000c0 RCX: ffffffffaf02dd77 RDX: dffffc0000000000 RSI: 0000000000000008 RDI: ffffc900025910c8 RBP: ffffc900025910c0 R08: 0000000000000001 R09: fffff520004b2219 R10: ffffc900025910cf R11: 31392d2068736168 R12: 00000000002000c0 R13: ffffc900025910c0 R14: 00000000fffef608 R15: ffff88811840e900 FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 0000000129d00000 CR4: 0000000000750ee0 PKRU: 55555554 Kernel panic - not syncing: Fatal exception in interrupt Kernel Offset: 0x2ca00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]--- Fix this problem by ensuring the MSB of hash is 0 using a right shift - the same approach used in fib_multipath_hash() and rt6_multipath_hash(). Fixes: 1274e1cc4226 ("vxlan: ecmp support for mac fdb entries") Signed-off-by: Benjamin Poirier Reviewed-by: Ido Schimmel Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 30e0191b16e8a58e4620fa3e2839ddc7b9d4281c Author: Yue Haibing Date: Tue Aug 1 14:43:18 2023 +0800 ip6mr: Fix skb_under_panic in ip6mr_cache_report() skbuff: skb_under_panic: text:ffffffff88771f69 len:56 put:-4 head:ffff88805f86a800 data:ffff887f5f86a850 tail:0x88 end:0x2c0 dev:pim6reg ------------[ cut here ]------------ kernel BUG at net/core/skbuff.c:192! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 2 PID: 22968 Comm: kworker/2:11 Not tainted 6.5.0-rc3-00044-g0a8db05b571a #236 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Workqueue: ipv6_addrconf addrconf_dad_work RIP: 0010:skb_panic+0x152/0x1d0 Call Trace: skb_push+0xc4/0xe0 ip6mr_cache_report+0xd69/0x19b0 reg_vif_xmit+0x406/0x690 dev_hard_start_xmit+0x17e/0x6e0 __dev_queue_xmit+0x2d6a/0x3d20 vlan_dev_hard_start_xmit+0x3ab/0x5c0 dev_hard_start_xmit+0x17e/0x6e0 __dev_queue_xmit+0x2d6a/0x3d20 neigh_connected_output+0x3ed/0x570 ip6_finish_output2+0x5b5/0x1950 ip6_finish_output+0x693/0x11c0 ip6_output+0x24b/0x880 NF_HOOK.constprop.0+0xfd/0x530 ndisc_send_skb+0x9db/0x1400 ndisc_send_rs+0x12a/0x6c0 addrconf_dad_completed+0x3c9/0xea0 addrconf_dad_work+0x849/0x1420 process_one_work+0xa22/0x16e0 worker_thread+0x679/0x10c0 ret_from_fork+0x28/0x60 ret_from_fork_asm+0x11/0x20 When setup a vlan device on dev pim6reg, DAD ns packet may sent on reg_vif_xmit(). reg_vif_xmit() ip6mr_cache_report() skb_push(skb, -skb_network_offset(pkt));//skb_network_offset(pkt) is 4 And skb_push declared as: void *skb_push(struct sk_buff *skb, unsigned int len); skb->data -= len; //0xffff88805f86a84c - 0xfffffffc = 0xffff887f5f86a850 skb->data is set to 0xffff887f5f86a850, which is invalid mem addr, lead to skb_push() fails. Fixes: 14fb64e1f449 ("[IPV6] MROUTE: Support PIM-SM (SSM).") Signed-off-by: Yue Haibing Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 1cfef80d4c2b2c599189f36f36320b205d9447d9 Author: Alexandra Winter Date: Tue Aug 1 10:00:16 2023 +0200 s390/qeth: Don't call dev_close/dev_open (DOWN/UP) dev_close() and dev_open() are issued to change the interface state to DOWN or UP (dev->flags IFF_UP). When the netdev is set DOWN it loses e.g its Ipv6 addresses and routes. We don't want this in cases of device recovery (triggered by hardware or software) or when the qeth device is set offline. Setting a qeth device offline or online and device recovery actions call netif_device_detach() and/or netif_device_attach(). That will reset or set the LOWER_UP indication i.e. change the dev->state Bit __LINK_STATE_PRESENT. That is enough to e.g. cause bond failovers, and still preserves the interface settings that are handled by the network stack. Don't call dev_open() nor dev_close() from the qeth device driver. Let the network stack handle this. Fixes: d4560150cb47 ("s390/qeth: call dev_close() during recovery") Signed-off-by: Alexandra Winter Reviewed-by: Wenjia Zhang Signed-off-by: David S. Miller commit 666c135b2d859a00ee74c8645b2affacfae45421 Merge: 31d49ba033095 5c9241f3ceab3 Author: David S. Miller Date: Wed Aug 2 10:06:06 2023 +0100 Merge branch 'tun-tap-uid' Laszlo Ersek says: ==================== tun/tap: set sk_uid from current_fsuid() The original patches fixing CVE-2023-1076 are incorrect in my opinion. This small series fixes them up; see the individual commit messages for explanation. I have a very elaborate test procedure demonstrating the problem for both tun and tap; it involves libvirt, qemu, and "crash". I can share that procedure if necessary, but it's indeed quite long (I wrote it originally for our QE team). The patches in this series are supposed to "re-fix" CVE-2023-1076; given that said CVE is classified as Low Impact (CVSSv3=5.5), I'm posting this publicly, and not suggesting any embargo. Red Hat Product Security may assign a new CVE number later. I've tested the patches on top of v6.5-rc4, with "crash" built at commit c74f375e0ef7. Cc: Eric Dumazet Cc: Lorenzo Colitti Cc: Paolo Abeni Cc: Pietro Borrello Cc: netdev@vger.kernel.org Cc: stable@vger.kernel.org ==================== Signed-off-by: David S. Miller commit 5c9241f3ceab3257abe2923a59950db0dc8bb737 Author: Laszlo Ersek Date: Mon Jul 31 18:42:37 2023 +0200 net: tap_open(): set sk_uid from current_fsuid() Commit 66b2c338adce initializes the "sk_uid" field in the protocol socket (struct sock) from the "/dev/tapX" device node's owner UID. Per original commit 86741ec25462 ("net: core: Add a UID field to struct sock.", 2016-11-04), that's wrong: the idea is to cache the UID of the userspace process that creates the socket. Commit 86741ec25462 mentions socket() and accept(); with "tap", the action that creates the socket is open("/dev/tapX"). Therefore the device node's owner UID is irrelevant. In most cases, "/dev/tapX" will be owned by root, so in practice, commit 66b2c338adce has no observable effect: - before, "sk_uid" would be zero, due to undefined behavior (CVE-2023-1076), - after, "sk_uid" would be zero, due to "/dev/tapX" being owned by root. What matters is the (fs)UID of the process performing the open(), so cache that in "sk_uid". Cc: Eric Dumazet Cc: Lorenzo Colitti Cc: Paolo Abeni Cc: Pietro Borrello Cc: netdev@vger.kernel.org Cc: stable@vger.kernel.org Fixes: 66b2c338adce ("tap: tap_open(): correctly initialize socket uid") Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2173435 Signed-off-by: Laszlo Ersek Signed-off-by: David S. Miller commit 9bc3047374d5bec163e83e743709e23753376f0c Author: Laszlo Ersek Date: Mon Jul 31 18:42:36 2023 +0200 net: tun_chr_open(): set sk_uid from current_fsuid() Commit a096ccca6e50 initializes the "sk_uid" field in the protocol socket (struct sock) from the "/dev/net/tun" device node's owner UID. Per original commit 86741ec25462 ("net: core: Add a UID field to struct sock.", 2016-11-04), that's wrong: the idea is to cache the UID of the userspace process that creates the socket. Commit 86741ec25462 mentions socket() and accept(); with "tun", the action that creates the socket is open("/dev/net/tun"). Therefore the device node's owner UID is irrelevant. In most cases, "/dev/net/tun" will be owned by root, so in practice, commit a096ccca6e50 has no observable effect: - before, "sk_uid" would be zero, due to undefined behavior (CVE-2023-1076), - after, "sk_uid" would be zero, due to "/dev/net/tun" being owned by root. What matters is the (fs)UID of the process performing the open(), so cache that in "sk_uid". Cc: Eric Dumazet Cc: Lorenzo Colitti Cc: Paolo Abeni Cc: Pietro Borrello Cc: netdev@vger.kernel.org Cc: stable@vger.kernel.org Fixes: a096ccca6e50 ("tun: tun_chr_open(): correctly initialize socket uid") Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2173435 Signed-off-by: Laszlo Ersek Signed-off-by: David S. Miller commit c71b7aa8619a0c9700132d0733e33999fb614339 Author: Nikita Travkin Date: Wed Aug 2 11:41:22 2023 +0500 drm/panel: samsung-s6d7aa0: Add MODULE_DEVICE_TABLE The driver can be built as a module, however the lack of the MODULE_DEVICE_TABLE macro prevents it from being automatically probed from the DT in such case. Add the missed macro to make sure the module can load automatically. Fixes: 6810bb390282 ("drm/panel: Add Samsung S6D7AA0 panel controller driver") Signed-off-by: Nikita Travkin Acked-by: Artur Weber Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230802-gt5-panel-dtable-v1-1-c0a765c175e2@trvn.ru commit 0a8589055936d8feb56477123a8373ac634018fa Author: Damien Le Moal Date: Mon Jul 24 13:23:14 2023 +0900 ata,scsi: do not issue START STOP UNIT on resume During system resume, ata_port_pm_resume() triggers ata EH to 1) Resume the controller 2) Reset and rescan the ports 3) Revalidate devices This EH execution is started asynchronously from ata_port_pm_resume(), which means that when sd_resume() is executed, none or only part of the above processing may have been executed. However, sd_resume() issues a START STOP UNIT to wake up the drive from sleep mode. This command is translated to ATA with ata_scsi_start_stop_xlat() and issued to the device. However, depending on the state of execution of the EH process and revalidation triggerred by ata_port_pm_resume(), two things may happen: 1) The START STOP UNIT fails if it is received before the controller has been reenabled at the beginning of the EH execution. This is visible with error messages like: ata10.00: device reported invalid CHS sector 0 sd 9:0:0:0: [sdc] Start/Stop Unit failed: Result: hostbyte=DID_OK driverbyte=DRIVER_OK sd 9:0:0:0: [sdc] Sense Key : Illegal Request [current] sd 9:0:0:0: [sdc] Add. Sense: Unaligned write command sd 9:0:0:0: PM: dpm_run_callback(): scsi_bus_resume+0x0/0x90 returns -5 sd 9:0:0:0: PM: failed to resume async: error -5 2) The START STOP UNIT command is received while the EH process is on-going, which mean that it is stopped and must wait for its completion, at which point the command is rather useless as the drive is already fully spun up already. This case results also in a significant delay in sd_resume() which is observable by users as the entire system resume completion is delayed. Given that ATA devices will be woken up by libata activity on resume, sd_resume() has no need to issue a START STOP UNIT command, which solves the above mentioned problems. Do not issue this command by introducing the new scsi_device flag no_start_on_resume and setting this flag to 1 in ata_scsi_dev_config(). sd_resume() is modified to issue a START STOP UNIT command only if this flag is not set. Reported-by: Paul Ausbeck Closes: https://bugzilla.kernel.org/show_bug.cgi?id=215880 Fixes: a19a93e4c6a9 ("scsi: core: pm: Rely on the device driver core for async power management") Signed-off-by: Damien Le Moal Tested-by: Tanner Watkins Tested-by: Paul Ausbeck Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche commit 27c146e3de9bb2ac31402660ccea43a374701e68 Merge: 06c2afb862f9d 34539b442b3bc Author: Tony Lindgren Date: Wed Aug 2 10:49:57 2023 +0300 Merge branch 'omap-for-v6.5/ti-sysc' into omap-for-v6.5/fixes Merge in a missed change into fixes. Signed-off-by: Tony Lindgren commit 0bc057eae2610c275361766a064a23cc2758f3ff Merge: a337b64f0d571 46d14e1709523 Author: Tvrtko Ursulin Date: Wed Aug 2 08:14:57 2023 +0100 Merge tag 'gvt-fixes-2023-08-02' of https://github.com/intel/gvt-linux into drm-intel-fixes gvt-fixes-2023-08-02 - Fix bug to get AUX CH register message length (Yan) Signed-off-by: Tvrtko Ursulin From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/ZMnvf46JqgeIuTir@debian-scheme commit e6e2843230799230fc5deb8279728a7218b0d63c Author: Ilya Dryomov Date: Tue Aug 1 19:14:24 2023 +0200 libceph: fix potential hang in ceph_osdc_notify() If the cluster becomes unavailable, ceph_osdc_notify() may hang even with osd_request_timeout option set because linger_notify_finish_wait() waits for MWatchNotify NOTIFY_COMPLETE message with no associated OSD request in flight -- it's completely asynchronous. Introduce an additional timeout, derived from the specified notify timeout. While at it, switch both waits to killable which is more correct. Cc: stable@vger.kernel.org Signed-off-by: Ilya Dryomov Reviewed-by: Dongsheng Yang Reviewed-by: Xiubo Li commit 9d01e07fd1bfb4daae156ab528aa196f5ac2b2bc Author: Ilya Dryomov Date: Tue Aug 1 19:14:24 2023 +0200 rbd: prevent busy loop when requesting exclusive lock Due to rbd_try_acquire_lock() effectively swallowing all but EBLOCKLISTED error from rbd_try_lock() ("request lock anyway") and rbd_request_lock() returning ETIMEDOUT error not only for an actual notify timeout but also when the lock owner doesn't respond, a busy loop inside of rbd_acquire_lock() between rbd_try_acquire_lock() and rbd_request_lock() is possible. Requesting the lock on EBUSY error (returned by get_lock_owner_info() if an incompatible lock or invalid lock owner is detected) makes very little sense. The same goes for ETIMEDOUT error (might pop up pretty much anywhere if osd_request_timeout option is set) and many others. Just fail I/O requests on rbd_dev->acquiring_list immediately on any error from rbd_try_lock(). Cc: stable@vger.kernel.org # 588159009d5b: rbd: retrieve and check lock owner twice before blocklisting Cc: stable@vger.kernel.org Signed-off-by: Ilya Dryomov Reviewed-by: Dongsheng Yang commit 31d49ba033095f6e8158c60f69714a500922e0c3 Author: Lin Ma Date: Tue Aug 1 09:32:48 2023 +0800 net: dcb: choose correct policy to parse DCB_ATTR_BCN The dcbnl_bcn_setcfg uses erroneous policy to parse tb[DCB_ATTR_BCN], which is introduced in commit 859ee3c43812 ("DCB: Add support for DCB BCN"). Please see the comment in below code static int dcbnl_bcn_setcfg(...) { ... ret = nla_parse_nested_deprecated(..., dcbnl_pfc_up_nest, .. ) // !!! dcbnl_pfc_up_nest for attributes // DCB_PFC_UP_ATTR_0 to DCB_PFC_UP_ATTR_ALL in enum dcbnl_pfc_up_attrs ... for (i = DCB_BCN_ATTR_RP_0; i <= DCB_BCN_ATTR_RP_7; i++) { // !!! DCB_BCN_ATTR_RP_0 to DCB_BCN_ATTR_RP_7 in enum dcbnl_bcn_attrs ... value_byte = nla_get_u8(data[i]); ... } ... for (i = DCB_BCN_ATTR_BCNA_0; i <= DCB_BCN_ATTR_RI; i++) { // !!! DCB_BCN_ATTR_BCNA_0 to DCB_BCN_ATTR_RI in enum dcbnl_bcn_attrs ... value_int = nla_get_u32(data[i]); ... } ... } That is, the nla_parse_nested_deprecated uses dcbnl_pfc_up_nest attributes to parse nlattr defined in dcbnl_pfc_up_attrs. But the following access code fetch each nlattr as dcbnl_bcn_attrs attributes. By looking up the associated nla_policy for dcbnl_bcn_attrs. We can find the beginning part of these two policies are "same". static const struct nla_policy dcbnl_pfc_up_nest[...] = { [DCB_PFC_UP_ATTR_0] = {.type = NLA_U8}, [DCB_PFC_UP_ATTR_1] = {.type = NLA_U8}, [DCB_PFC_UP_ATTR_2] = {.type = NLA_U8}, [DCB_PFC_UP_ATTR_3] = {.type = NLA_U8}, [DCB_PFC_UP_ATTR_4] = {.type = NLA_U8}, [DCB_PFC_UP_ATTR_5] = {.type = NLA_U8}, [DCB_PFC_UP_ATTR_6] = {.type = NLA_U8}, [DCB_PFC_UP_ATTR_7] = {.type = NLA_U8}, [DCB_PFC_UP_ATTR_ALL] = {.type = NLA_FLAG}, }; static const struct nla_policy dcbnl_bcn_nest[...] = { [DCB_BCN_ATTR_RP_0] = {.type = NLA_U8}, [DCB_BCN_ATTR_RP_1] = {.type = NLA_U8}, [DCB_BCN_ATTR_RP_2] = {.type = NLA_U8}, [DCB_BCN_ATTR_RP_3] = {.type = NLA_U8}, [DCB_BCN_ATTR_RP_4] = {.type = NLA_U8}, [DCB_BCN_ATTR_RP_5] = {.type = NLA_U8}, [DCB_BCN_ATTR_RP_6] = {.type = NLA_U8}, [DCB_BCN_ATTR_RP_7] = {.type = NLA_U8}, [DCB_BCN_ATTR_RP_ALL] = {.type = NLA_FLAG}, // from here is somewhat different [DCB_BCN_ATTR_BCNA_0] = {.type = NLA_U32}, ... [DCB_BCN_ATTR_ALL] = {.type = NLA_FLAG}, }; Therefore, the current code is buggy and this nla_parse_nested_deprecated could overflow the dcbnl_pfc_up_nest and use the adjacent nla_policy to parse attributes from DCB_BCN_ATTR_BCNA_0. Hence use the correct policy dcbnl_bcn_nest to parse the nested tb[DCB_ATTR_BCN] TLV. Fixes: 859ee3c43812 ("DCB: Add support for DCB BCN") Signed-off-by: Lin Ma Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230801013248.87240-1-linma@zju.edu.cn Signed-off-by: Jakub Kicinski commit 1b0fc0345f2852ffe54fb9ae0e12e2ee69ad6a20 Author: Dave Hansen Date: Tue Aug 1 07:31:07 2023 -0700 Documentation/x86: Fix backwards on/off logic about YMM support These options clearly turn *off* XSAVE YMM support. Correct the typo. Reported-by: Ben Hutchings Fixes: 553a5c03e90a ("x86/speculation: Add force option to GDS mitigation") Signed-off-by: Dave Hansen commit e7e607bd00481745550389a29ecabe33e13d67cf Author: Xiubo Li Date: Tue Jul 25 12:03:59 2023 +0800 ceph: defer stopping mdsc delayed_work Flushing the dirty buffer may take a long time if the cluster is overloaded or if there is network issue. So we should ping the MDSs periodically to keep alive, else the MDS will blocklist the kclient. Cc: stable@vger.kernel.org Link: https://tracker.ceph.com/issues/61843 Signed-off-by: Xiubo Li Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit 4a4474e3bf8af318e556c6c9bfa9ce24103d5c8d Merge: 3ff1617450ece 08450ea98ae98 Author: Jakub Kicinski Date: Tue Aug 1 15:05:00 2023 -0700 Merge branch 'bnxt_en-2-xdp-bug-fixes' Michael Chan says: ==================== bnxt_en: 2 XDP bug fixes The first patch fixes XDP page pool logic on systems with page size >= 64K. The second patch fixes the max_mtu setting when an XDP program supporting multi buffers is attached. ==================== Link: https://lore.kernel.org/r/20230731142043.58855-1-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit 08450ea98ae98d5a35145b675b76db616046ea11 Author: Michael Chan Date: Mon Jul 31 07:20:43 2023 -0700 bnxt_en: Fix max_mtu setting for multi-buf XDP The existing code does not allow the MTU to be set to the maximum even after an XDP program supporting multiple buffers is attached. Fix it to set the netdev->max_mtu to the maximum value if the attached XDP program supports mutiple buffers, regardless of the current MTU value. Also use a local variable dev instead of repeatedly using bp->dev. Fixes: 1dc4c557bfed ("bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff") Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde Reviewed-by: Andy Gospodarek Signed-off-by: Michael Chan Link: https://lore.kernel.org/r/20230731142043.58855-3-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit f6974b4c2d8e1062b5a52228ee47293c15b4ee1e Author: Somnath Kotur Date: Mon Jul 31 07:20:42 2023 -0700 bnxt_en: Fix page pool logic for page size >= 64K The RXBD length field on all bnxt chips is 16-bit and so we cannot support a full page when the native page size is 64K or greater. The non-XDP (non page pool) code path has logic to handle this but the XDP page pool code path does not handle this. Add the missing logic to use page_pool_dev_alloc_frag() to allocate 32K chunks if the page size is 64K or greater. Fixes: 9f4b28301ce6 ("bnxt: XDP multibuffer enablement") Link: https://lore.kernel.org/netdev/20230728231829.235716-2-michael.chan@broadcom.com/ Reviewed-by: Andy Gospodarek Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan Link: https://lore.kernel.org/r/20230731142043.58855-2-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit 3ff1617450eceb290ac17120fc172815e09a93cf Author: Kuniyuki Iwashima Date: Mon Jul 31 11:15:53 2023 -0700 selftest: net: Assert on a proper value in so_incoming_cpu.c. Dan Carpenter reported an error spotted by Smatch. ./tools/testing/selftests/net/so_incoming_cpu.c:163 create_clients() error: uninitialized symbol 'ret'. The returned value of sched_setaffinity() should be checked with ASSERT_EQ(), but the value was not saved in a proper variable, resulting in an error above. Let's save the returned value of with sched_setaffinity(). Fixes: 6df96146b202 ("selftest: Add test for SO_INCOMING_CPU.") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/linux-kselftest/fe376760-33b6-4fc9-88e8-178e809af1ac@moroto.mountain/ Signed-off-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230731181553.5392-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit f3bb7759a924713bc54d15f6d0d70733b5935fad Author: Mark Brown Date: Mon Jul 31 11:48:32 2023 +0100 net: netsec: Ignore 'phy-mode' on SynQuacer in DT mode As documented in acd7aaf51b20 ("netsec: ignore 'phy-mode' device property on ACPI systems") the SocioNext SynQuacer platform ships with firmware defining the PHY mode as RGMII even though the physical configuration of the PHY is for TX and RX delays. Since bbc4d71d63549bc ("net: phy: realtek: fix rtl8211e rx/tx delay config") this has caused misconfiguration of the PHY, rendering the network unusable. This was worked around for ACPI by ignoring the phy-mode property but the system is also used with DT. For DT instead if we're running on a SynQuacer force a working PHY mode, as well as the standard EDK2 firmware with DT there are also some of these systems that use u-boot and might not initialise the PHY if not netbooting. Newer firmware imagaes for at least EDK2 are available from Linaro so print a warning when doing this. Fixes: 533dd11a12f6 ("net: socionext: Add Synquacer NetSec driver") Signed-off-by: Mark Brown Acked-by: Ard Biesheuvel Acked-by: Ilias Apalodimas Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230731-synquacer-net-v3-1-944be5f06428@kernel.org Signed-off-by: Jakub Kicinski commit 0b6291ad1940c403734312d0e453e8dac9148f69 Author: Yuanjun Gong Date: Mon Jul 31 17:05:35 2023 +0800 net: korina: handle clk prepare error in korina_probe() in korina_probe(), the return value of clk_prepare_enable() should be checked since it might fail. we can use devm_clk_get_optional_enabled() instead of devm_clk_get_optional() and clk_prepare_enable() to automatically handle the error. Fixes: e4cd854ec487 ("net: korina: Get mdio input clock via common clock framework") Signed-off-by: Yuanjun Gong Link: https://lore.kernel.org/r/20230731090535.21416-1-ruc_gongyuanjun@163.com Signed-off-by: Jakub Kicinski commit b99225b4fe297d07400f9e2332ecd7347b224f8d Author: Ross Maynard Date: Mon Jul 31 15:42:04 2023 +1000 USB: zaurus: Add ID for A-300/B-500/C-700 The SL-A300, B500/5600, and C700 devices no longer auto-load because of "usbnet: Remove over-broad module alias from zaurus." This patch adds IDs for those 3 devices. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217632 Fixes: 16adf5d07987 ("usbnet: Remove over-broad module alias from zaurus.") Signed-off-by: Ross Maynard Cc: stable@vger.kernel.org Acked-by: Greg Kroah-Hartman Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/69b5423b-2013-9fc9-9569-58e707d9bafb@bigpond.com Signed-off-by: Jakub Kicinski commit ef45e8400f5bb66b03cc949f76c80e2a118447de Author: Dan Carpenter Date: Mon Jul 31 10:42:32 2023 +0300 net: ll_temac: fix error checking of irq_of_parse_and_map() Most kernel functions return negative error codes but some irq functions return zero on error. In this code irq_of_parse_and_map(), returns zero and platform_get_irq() returns negative error codes. We need to handle both cases appropriately. Fixes: 8425c41d1ef7 ("net: ll_temac: Extend support to non-device-tree platforms") Signed-off-by: Dan Carpenter Acked-by: Esben Haabendal Reviewed-by: Yang Yingliang Reviewed-by: Harini Katakam Link: https://lore.kernel.org/r/3d0aef75-06e0-45a5-a2a6-2cc4738d4143@moroto.mountain Signed-off-by: Jakub Kicinski commit 688b419c57c13637d95d7879e165fff3dec581eb Author: August Wikerfors Date: Wed Nov 16 18:17:27 2022 +0100 nvme-pci: add NVME_QUIRK_BOGUS_NID for Samsung PM9B1 256G and 512G The Samsung PM9B1 512G SSD found in some Lenovo Yoga 7 14ARB7 laptop units reports eui as 0001000200030004 when resuming from s2idle, causing the device to be removed with this error in dmesg: nvme nvme0: identifiers changed for nsid 1 To fix this, add a quirk to ignore namespace identifiers for this device. Signed-off-by: August Wikerfors Signed-off-by: Keith Busch commit 388acb471662c273d94163a8502f09668f380686 Author: Heiko Carstens Date: Mon Jul 31 20:39:26 2023 +0200 s390/ptrace: add missing linux/const.h include Adrian Reber reported the following CRIU build bug after commit b8af5999779d ("s390/ptrace: make all psw related defines also available for asm"): compel/arch/s390/src/lib/infect.c: In function 'arch_can_dump_task': compel/arch/s390/src/lib/infect.c:523:25: error: 'UL' undeclared (first use in this function) 523 | if (psw->mask & PSW_MASK_RI) { | ^~~~~~~~~~~ Add the missing linux/const.h include to fix this. Reported-by: Adrian Reber Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2225745 Link: https://github.com/checkpoint-restore/criu/pull/2232 Tested-by: Adrian Reber Fixes: b8af5999779d ("s390/ptrace: make all psw related defines also available for asm") Link: https://lore.kernel.org/r/20230731183926.330932-1-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit 1d7dd5aa35474e553b8671b58579e0749b560779 Author: Kees Cook Date: Fri Jul 28 16:13:02 2023 -0700 wifi: ray_cs: Replace 1-element array with flexible array The trailing array member of struct tx_buf was defined as a 1-element array, but used as a flexible array. This was resulting in build warnings: In function 'fortify_memset_chk', inlined from 'memset_io' at /kisskb/src/arch/mips/include/asm/io.h:486:2, inlined from 'build_auth_frame' at /kisskb/src/drivers/net/wireless/legacy/ray_cs.c:2697:2: /kisskb/src/include/linux/fortify-string.h:493:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 493 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Replace it with an actual flexible array. Binary difference comparison shows a single change in output: │ drivers/net/wireless/legacy/ray_cs.c:883 │ lea 0x1c(%rbp),%r13d │ - cmp $0x7c3,%r13d │ + cmp $0x7c4,%r13d This is from: if (len + TX_HEADER_LENGTH > TX_BUF_SIZE) { specifically: #define TX_BUF_SIZE (2048 - sizeof(struct tx_msg)) This appears to have been originally buggy, so the change is correct. Reported-by: Geert Uytterhoeven Closes: https://lore.kernel.org/all/88f83d73-781d-bdc-126-aa629cb368c@linux-m68k.org Cc: Kalle Valo Cc: linux-wireless@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230728231245.never.309-kees@kernel.org commit 16e95a62eed18864aecac404f1e4eed764c363f2 Author: Zhang Rui Date: Tue Jul 25 13:39:12 2023 +0800 powercap: intel_rapl: Fix a sparse warning in TPMI interface Depends on the interface used, the RAPL registers can be either MSR indexes or memory mapped IO addresses. Current RAPL common code uses u64 to save both MSR and memory mapped IO registers. With this, when handling register address with an __iomem annotation, it triggers a sparse warning like below: sparse warnings: (new ones prefixed by >>) >> drivers/powercap/intel_rapl_tpmi.c:141:41: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned long long [usertype] *tpmi_rapl_regs @@ got void [noderef] __iomem * @@ drivers/powercap/intel_rapl_tpmi.c:141:41: sparse: expected unsigned long long [usertype] *tpmi_rapl_regs drivers/powercap/intel_rapl_tpmi.c:141:41: sparse: got void [noderef] __iomem * Fix the problem by using a union to save the registers instead. Suggested-by: David Laight Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307031405.dy3druuy-lkp@intel.com/ Tested-by: Wang Wendy Signed-off-by: Zhang Rui [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 2dc0bc1138eecc88b2c376ccb0b0acb215c25a5c Author: Michael Ellerman Date: Tue Aug 1 20:26:50 2023 +1000 powerpc/64e: Fix secondary thread bringup for ELFv2 kernels When booting on e6500 with an ELF v2 ABI kernel, the secondary threads do not start correctly: [ 0.051118] smp: Bringing up secondary CPUs ... [ 5.072700] Processor 1 is stuck. This occurs because the startup code is written to use function descriptors when loading the entry point for the secondary threads. When building with ELF v2 ABI there are no function descriptors, and the code loads junk values for the entry point address. Fix it by using ppc_function_entry() in C, and DOTSYM() in asm, both of which work correctly for ELF v2 ABI as well as ELF v1 ABI kernels. Fixes: 8c5fa3b5c4df ("powerpc/64: Make ELFv2 the default for big-endian builds") Signed-off-by: Michael Ellerman Link: https://msgid.link/20230801102650.48705-1-mpe@ellerman.id.au commit f3ec2b5d879ef5bbcb24678914641343cb6399a2 Author: Leon Romanovsky Date: Mon Jul 31 14:38:27 2023 +0300 xfrm: don't skip free of empty state in acquire policy In destruction flow, the assignment of NULL to xso->dev caused to skip of xfrm_dev_state_free() call, which was called in xfrm_state_put(to_put) routine. Instead of open-coded variant of xfrm_dev_state_delete() and xfrm_dev_state_free(), let's use them directly. Fixes: f8a70afafc17 ("xfrm: add TX datapath support for IPsec packet offload mode") Signed-off-by: Leon Romanovsky Signed-off-by: Steffen Klassert commit 982c3aca8bac8ae38acdc940e4f1ecec3bffc623 Author: Leon Romanovsky Date: Mon Jul 31 14:38:26 2023 +0300 xfrm: delete offloaded policy The policy memory was released but not HW driver data. Add call to xfrm_dev_policy_delete(), so drivers will have a chance to release their resources. Fixes: 919e43fad516 ("xfrm: add an interface to offload policy") Signed-off-by: Leon Romanovsky Signed-off-by: Steffen Klassert commit a337b64f0d5717248a0c894e2618e658e6a9de9f Author: Janusz Krzysztofik Date: Thu Jul 20 11:35:44 2023 +0200 drm/i915: Fix premature release of request's reusable memory Infinite waits for completion of GPU activity have been observed in CI, mostly inside __i915_active_wait(), triggered by igt@gem_barrier_race or igt@perf@stress-open-close. Root cause analysis, based of ftrace dumps generated with a lot of extra trace_printk() calls added to the code, revealed loops of request dependencies being accidentally built, preventing the requests from being processed, each waiting for completion of another one's activity. After we substitute a new request for a last active one tracked on a timeline, we set up a dependency of our new request to wait on completion of current activity of that previous one. While doing that, we must take care of keeping the old request still in memory until we use its attributes for setting up that await dependency, or we can happen to set up the await dependency on an unrelated request that already reuses the memory previously allocated to the old one, already released. Combined with perf adding consecutive kernel context remote requests to different user context timelines, unresolvable loops of await dependencies can be built, leading do infinite waits. We obtain a pointer to the previous request to wait upon when we substitute it with a pointer to our new request in an active tracker, e.g. in intel_timeline.last_request. In some processing paths we protect that old request from being freed before we use it by getting a reference to it under RCU protection, but in others, e.g. __i915_request_commit() -> __i915_request_add_to_timeline() -> __i915_request_ensure_ordering(), we don't. But anyway, since the requests' memory is SLAB_FAILSAFE_BY_RCU, that RCU protection is not sufficient against reuse of memory. We could protect i915_request's memory from being prematurely reused by calling its release function via call_rcu() and using rcu_read_lock() consequently, as proposed in v1. However, that approach leads to significant (up to 10 times) increase of SLAB utilization by i915_request SLAB cache. Another potential approach is to take a reference to the previous active fence. When updating an active fence tracker, we first lock the new fence, substitute a pointer of the current active fence with the new one, then we lock the substituted fence. With this approach, there is a time window after the substitution and before the lock when the request can be concurrently released by an interrupt handler and its memory reused, then we may happen to lock and return a new, unrelated request. Always get a reference to the current active fence first, before replacing it with a new one. Having it protected from premature release and reuse, lock it and then replace with the new one but only if not yet signalled via a potential concurrent interrupt nor replaced with another one by a potential concurrent thread, otherwise retry, starting from getting a reference to the new current one. Adjust users to not get a reference to the previous active fence themselves and always put the reference got by __i915_active_fence_set() when no longer needed. v3: Fix lockdep splat reports and other issues caused by incorrect use of try_cmpxchg() (use (cmpxchg() != prev) instead) v2: Protect request's memory by getting a reference to it in favor of delegating its release to call_rcu() (Chris) Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8211 Fixes: df9f85d8582e ("drm/i915: Serialise i915_active_fence_set() with itself") Suggested-by: Chris Wilson Signed-off-by: Janusz Krzysztofik Cc: # v5.6+ Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230720093543.832147-2-janusz.krzysztofik@linux.intel.com (cherry picked from commit 946e047a3d88d46d15b5c5af0414098e12b243f7) Signed-off-by: Tvrtko Ursulin commit 6a35f22d222528e1b157c6978c9424d2f8cbe0a1 Author: Andi Shyti Date: Tue Jul 25 02:19:50 2023 +0200 drm/i915/gt: Support aux invalidation on all engines Perform some refactoring with the purpose of keeping in one single place all the operations around the aux table invalidation. With this refactoring add more engines where the invalidation should be performed. Fixes: 972282c4cf24 ("drm/i915/gen12: Add aux table invalidate for all engines") Signed-off-by: Andi Shyti Cc: Jonathan Cavitt Cc: Matt Roper Cc: # v5.8+ Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230725001950.1014671-8-andi.shyti@linux.intel.com (cherry picked from commit 76ff7789d6e63d1a10b3b58f5c70b2e640c7a880) Signed-off-by: Tvrtko Ursulin commit 0fde2f23516a00fd90dfb980b66b4665fcbfa659 Author: Jonathan Cavitt Date: Tue Jul 25 02:19:49 2023 +0200 drm/i915/gt: Poll aux invalidation register bit on invalidation For platforms that use Aux CCS, wait for aux invalidation to complete by checking the aux invalidation register bit is cleared. Fixes: 972282c4cf24 ("drm/i915/gen12: Add aux table invalidate for all engines") Signed-off-by: Jonathan Cavitt Signed-off-by: Andi Shyti Cc: # v5.8+ Reviewed-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230725001950.1014671-7-andi.shyti@linux.intel.com (cherry picked from commit d459c86f00aa98028d155a012c65dc42f7c37e76) Signed-off-by: Tvrtko Ursulin commit 824df77ab2107d8d4740b834b276681a41ae1ac8 Author: Andi Shyti Date: Tue Jul 25 02:19:48 2023 +0200 drm/i915/gt: Enable the CCS_FLUSH bit in the pipe control and in the CS Enable the CCS_FLUSH bit 13 in the control pipe for render and compute engines in platforms starting from Meteor Lake (BSPEC 43904 and 47112). For the copy engine add MI_FLUSH_DW_CCS (bit 16) in the command streamer. Fixes: 972282c4cf24 ("drm/i915/gen12: Add aux table invalidate for all engines") Requires: 8da173db894a ("drm/i915/gt: Rename flags with bit_group_X according to the datasheet") Signed-off-by: Andi Shyti Cc: Jonathan Cavitt Cc: Nirmoy Das Cc: # v5.8+ Reviewed-by: Matt Roper Reviewed-by: Andrzej Hajda Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230725001950.1014671-6-andi.shyti@linux.intel.com (cherry picked from commit b70df82b428774875c7c56d3808102165891547c) Signed-off-by: Tvrtko Ursulin commit 592b228f12e15867a63e3a6eeeb54c5c12662a62 Author: Andi Shyti Date: Tue Jul 25 02:19:47 2023 +0200 drm/i915/gt: Rename flags with bit_group_X according to the datasheet In preparation of the next patch align with the datasheet (BSPEC 47112) with the naming of the pipe control set of flag values. The variable "flags" in gen12_emit_flush_rcs() is applied as a set of flags called Bit Group 1. Define also the Bit Group 0 as bit_group_0 where currently only PIPE_CONTROL0_HDC_PIPELINE_FLUSH bit is set. Signed-off-by: Andi Shyti Cc: # v5.8+ Reviewed-by: Matt Roper Reviewed-by: Andrzej Hajda Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230725001950.1014671-5-andi.shyti@linux.intel.com (cherry picked from commit f2dcd21d5a22e13f2fbfe7ab65149038b93cf2ff) Signed-off-by: Tvrtko Ursulin commit 78a6ccd65fa3a7cc697810db079cc4b84dff03d5 Author: Jonathan Cavitt Date: Tue Jul 25 02:19:46 2023 +0200 drm/i915/gt: Ensure memory quiesced before invalidation All memory traffic must be quiesced before requesting an aux invalidation on platforms that use Aux CCS. Fixes: 972282c4cf24 ("drm/i915/gen12: Add aux table invalidate for all engines") Requires: a2a4aa0eef3b ("drm/i915: Add the gen12_needs_ccs_aux_inv helper") Signed-off-by: Jonathan Cavitt Signed-off-by: Andi Shyti Cc: # v5.8+ Reviewed-by: Nirmoy Das Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230725001950.1014671-4-andi.shyti@linux.intel.com (cherry picked from commit ad8ebf12217e451cd19804b1c3e97ad56491c74a) Signed-off-by: Tvrtko Ursulin commit b2f59e9026038a5bbcbc0019fa58f963138211ee Author: Andi Shyti Date: Tue Jul 25 02:19:45 2023 +0200 drm/i915: Add the gen12_needs_ccs_aux_inv helper We always assumed that a device might either have AUX or FLAT CCS, but this is an approximation that is not always true, e.g. PVC represents an exception. Set the basis for future finer selection by implementing a boolean gen12_needs_ccs_aux_inv() function that tells whether aux invalidation is needed or not. Currently PVC is the only exception to the above mentioned rule. Requires: 059ae7ae2a1c ("drm/i915/gt: Cleanup aux invalidation registers") Signed-off-by: Andi Shyti Cc: Matt Roper Cc: Jonathan Cavitt Cc: # v5.8+ Reviewed-by: Matt Roper Reviewed-by: Andrzej Hajda Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230725001950.1014671-3-andi.shyti@linux.intel.com (cherry picked from commit c827655b87ad201ebe36f2e28d16b5491c8f7801) Signed-off-by: Tvrtko Ursulin commit d14560ac1b595aa2e792365e91fea6aeaee66c2b Author: Andi Shyti Date: Tue Jul 25 02:19:44 2023 +0200 drm/i915/gt: Cleanup aux invalidation registers Fix the 'NV' definition postfix that is supposed to be INV. Take the chance to also order properly the registers based on their address and call the GEN12_GFX_CCS_AUX_INV address as GEN12_CCS_AUX_INV like all the other similar registers. Remove also VD1, VD3 and VE1 registers that don't exist and add BCS0 and CCS0. Signed-off-by: Andi Shyti Cc: # v5.8+ Reviewed-by: Nirmoy Das Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230725001950.1014671-2-andi.shyti@linux.intel.com (cherry picked from commit 2f0b927d3ca3440445975ebde27f3df1c3ed6f76) Signed-off-by: Tvrtko Ursulin commit 4da3c7183e186afe8196160f16d5a0248a24e45d Author: Gao Xiang Date: Tue Aug 1 09:47:37 2023 +0800 erofs: drop unnecessary WARN_ON() in erofs_kill_sb() Previously, .kill_sb() will be called only after fill_super fails. It will be changed [1]. Besides, checking for s_magic in erofs_kill_sb() is unnecessary from any point of view. Let's get rid of it now. [1] https://lore.kernel.org/r/20230731-flugbereit-wohnlage-78acdf95ab7e@brauner Signed-off-by: Gao Xiang Reviewed-by: Christoph Hellwig Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230801014737.28614-1-hsiangkao@linux.alibaba.com commit 94c43de73521d8ed7ebcfc6191d9dace1cbf7caa Author: Gao Xiang Date: Wed Jul 19 14:54:59 2023 +0800 erofs: fix wrong primary bvec selection on deduplicated extents When handling deduplicated compressed data, there can be multiple decompressed extents pointing to the same compressed data in one shot. In such cases, the bvecs which belong to the longest extent will be selected as the primary bvecs for real decompressors to decode and the other duplicated bvecs will be directly copied from the primary bvecs. Previously, only relative offsets of the longest extent were checked to decompress the primary bvecs. On rare occasions, it can be incorrect if there are several extents with the same start relative offset. As a result, some short bvecs could be selected for decompression and then cause data corruption. For example, as Shijie Sun reported off-list, considering the following extents of a file: 117: 903345.. 915250 | 11905 : 385024.. 389120 | 4096 ... 119: 919729.. 930323 | 10594 : 385024.. 389120 | 4096 ... 124: 968881.. 980786 | 11905 : 385024.. 389120 | 4096 The start relative offset is the same: 2225, but extent 119 (919729.. 930323) is shorter than the others. Let's restrict the bvec length in addition to the start offset if bvecs are not full. Reported-by: Shijie Sun Fixes: 5c2a64252c5d ("erofs: introduce partial-referenced pclusters") Tested-by Shijie Sun Reviewed-by: Yue Hu Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20230719065459.60083-1-hsiangkao@linux.alibaba.com commit 13d2618b48f15966d1adfe1ff6a1985f5eef40ba Author: Tomas Glozar Date: Fri Jul 28 08:44:11 2023 +0200 bpf: sockmap: Remove preempt_disable in sock_map_sk_acquire Disabling preemption in sock_map_sk_acquire conflicts with GFP_ATOMIC allocation later in sk_psock_init_link on PREEMPT_RT kernels, since GFP_ATOMIC might sleep on RT (see bpf: Make BPF and PREEMPT_RT co-exist patchset notes for details). This causes calling bpf_map_update_elem on BPF_MAP_TYPE_SOCKMAP maps to BUG (sleeping function called from invalid context) on RT kernels. preempt_disable was introduced together with lock_sk and rcu_read_lock in commit 99ba2b5aba24e ("bpf: sockhash, disallow bpf_tcp_close and update in parallel"), probably to match disabled migration of BPF programs, and is no longer necessary. Remove preempt_disable to fix BUG in sock_map_update_common on RT. Signed-off-by: Tomas Glozar Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/all/20200224140131.461979697@linutronix.de/ Fixes: 99ba2b5aba24 ("bpf: sockhash, disallow bpf_tcp_close and update in parallel") Reviewed-by: John Fastabend Link: https://lore.kernel.org/r/20230728064411.305576-1-tglozar@redhat.com Signed-off-by: Paolo Abeni commit 1ef2c2df11997b8135f34adcf2c200d3b4aacbe9 Author: Tony Lindgren Date: Tue Jul 25 08:42:12 2023 +0300 serial: core: Fix serial core controller port name to show controller id We are missing the serial core controller id for the serial core port name. Let's fix the issue for sane sysfs output, and to avoid issues addressing serial ports later on. And as we're now showing the controller id, the "ctrl" and "port" prefix for the DEVNAME become useless, we can just drop them. Let's standardize on DEVNAME:0 for controller name, where 0 is the controller id. And DEVNAME:0.0 for port name, where 0.0 are the controller id and port id. This makes the sysfs output nicer, on qemu for example: $ ls /sys/bus/serial-base/devices 00:04:0 serial8250:0 serial8250:0.2 00:04:0.0 serial8250:0.1 serial8250:0.3 Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Reported-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Tony Lindgren Acked-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230725054216.45696-4-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit d962de6ae51f9b76ad736220077cda83084090b1 Author: Tony Lindgren Date: Tue Jul 25 08:42:11 2023 +0300 serial: core: Fix serial core port id to not use port->line The serial core port id should be serial core controller specific port instance, which is not always the port->line index. For example, 8250 driver maps a number of legacy ports, and when a hardware specific device driver takes over, we typically have one driver instance for each port. Let's instead add port->port_id to keep track serial ports mapped to each serial core controller instance. Currently this is only a cosmetic issue for the serial core port device names. The issue can be noticed looking at /sys/bus/serial-base/devices for example though. Let's fix the issue to avoid port addressing issues later on. Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Reviewed-by: Andy Shevchenko Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230725054216.45696-3-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 83c35180abfdfb22f3d7703b0c85ad2d442ed2c5 Author: Tony Lindgren Date: Tue Jul 25 08:42:10 2023 +0300 serial: core: Controller id cannot be negative The controller id cannot be negative. Let's fix the ctrl_id in preparation for adding port_id to fix the device name. Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Reported-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230725054216.45696-2-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 282069845af388b08d622ad192b831dcd0549c62 Author: Sherry Sun Date: Tue Aug 1 10:23:04 2023 +0800 tty: serial: fsl_lpuart: Clear the error flags by writing 1 for lpuart32 platforms Do not read the data register to clear the error flags for lpuart32 platforms, the additional read may cause the receive FIFO underflow since the DMA has already read the data register. Actually all lpuart32 platforms support write 1 to clear those error bits, let's use this method to better clear the error flags. Fixes: 42b68768e51b ("serial: fsl_lpuart: DMA support for 32-bit variant") Cc: stable Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20230801022304.24251-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit 07d2b820fd75b96f550c93503f19c8cfcbc577cf Author: Ian Rogers Date: Thu Jul 6 11:37:05 2023 -0700 perf test parse-events: Test complex name has required event format test__checkevent_complex_name will use an "event" format which if not present, such as with a placeholder PMU, will cause test failures. Skip the test in this case to avoid failures in restricted environments. Add perf_pmu__has_format utility as a general PMU utility. Fixes: 628eaa4e877af823 ("perf pmus: Add placeholder core PMU") Signed-off-by: Ian Rogers Tested-by: Thomas Richter Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Link: https://lore.kernel.org/r/20230706183705.601412-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 34bc65d6d831200194c0b9a30fb8fe47faaf83d6 Author: Ian Rogers Date: Thu Jul 6 11:37:04 2023 -0700 perf pmus: Create placholder regardless of scanning core_only If scanning all PMUs the placeholder is still necessary if no core PMU is found. This situation occurs in perf test's parse-events test, when uncore events appear before core. Fixes: 628eaa4e877af823 ("perf pmus: Add placeholder core PMU") Signed-off-by: Ian Rogers Tested-by: Thomas Richter Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Link: https://lore.kernel.org/r/20230706183705.601412-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 46d14e17095237007b59f56aae2d81ae2dcb0f93 Author: Yan Zhao Date: Mon Jul 31 19:20:33 2023 +0800 drm/i915/gvt: Fix bug in getting msg length in AUX CH registers handler Msg length should be obtained from value written to AUX_CH_CTL register rather than from enum type of the register. Commit 0cad796a2269 ("drm/i915: Use REG_BIT() & co. for AUX CH registers") incorrectly calculates the msg_length from reg type and yields below warning in intel_gvt_i2c_handle_aux_ch_write(): "i915 0000:00:02.0: drm_WARN_ON(msg_length != 4)". Fixes: 0cad796a2269 ("drm/i915: Use REG_BIT() & co. for AUX CH registers") Signed-off-by: Yan Zhao Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20230731112033.7275-1-yan.y.zhao@intel.com Reviewed-by: Zhenyu Wang commit c5ccff70501d92db445a135fa49cf9bc6b98c444 Merge: 611e1b016c7be b80b829e9e2c1 Author: Jakub Kicinski Date: Mon Jul 31 20:10:39 2023 -0700 Merge branch 'net-sched-bind-logic-fixes-for-cls_fw-cls_u32-and-cls_route' valis says: ==================== net/sched Bind logic fixes for cls_fw, cls_u32 and cls_route Three classifiers (cls_fw, cls_u32 and cls_route) always copy tcf_result struct into the new instance of the filter on update. This causes a problem when updating a filter bound to a class, as tcf_unbind_filter() is always called on the old instance in the success path, decreasing filter_cnt of the still referenced class and allowing it to be deleted, leading to a use-after-free. This patch set fixes this issue in all affected classifiers by no longer copying the tcf_result struct from the old filter. ==================== Link: https://lore.kernel.org/r/20230729123202.72406-1-jhs@mojatatu.com Signed-off-by: Jakub Kicinski commit b80b829e9e2c1b3f7aae34855e04d8f6ecaf13c8 Author: valis Date: Sat Jul 29 08:32:02 2023 -0400 net/sched: cls_route: No longer copy tcf_result on update to avoid use-after-free When route4_change() is called on an existing filter, the whole tcf_result struct is always copied into the new instance of the filter. This causes a problem when updating a filter bound to a class, as tcf_unbind_filter() is always called on the old instance in the success path, decreasing filter_cnt of the still referenced class and allowing it to be deleted, leading to a use-after-free. Fix this by no longer copying the tcf_result struct from the old filter. Fixes: 1109c00547fc ("net: sched: RCU cls_route") Reported-by: valis Reported-by: Bing-Jhong Billy Jheng Signed-off-by: valis Signed-off-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Reviewed-by: Pedro Tammela Reviewed-by: M A Ramdhan Link: https://lore.kernel.org/r/20230729123202.72406-4-jhs@mojatatu.com Signed-off-by: Jakub Kicinski commit 76e42ae831991c828cffa8c37736ebfb831ad5ec Author: valis Date: Sat Jul 29 08:32:01 2023 -0400 net/sched: cls_fw: No longer copy tcf_result on update to avoid use-after-free When fw_change() is called on an existing filter, the whole tcf_result struct is always copied into the new instance of the filter. This causes a problem when updating a filter bound to a class, as tcf_unbind_filter() is always called on the old instance in the success path, decreasing filter_cnt of the still referenced class and allowing it to be deleted, leading to a use-after-free. Fix this by no longer copying the tcf_result struct from the old filter. Fixes: e35a8ee5993b ("net: sched: fw use RCU") Reported-by: valis Reported-by: Bing-Jhong Billy Jheng Signed-off-by: valis Signed-off-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Reviewed-by: Pedro Tammela Reviewed-by: M A Ramdhan Link: https://lore.kernel.org/r/20230729123202.72406-3-jhs@mojatatu.com Signed-off-by: Jakub Kicinski commit 3044b16e7c6fe5d24b1cdbcf1bd0a9d92d1ebd81 Author: valis Date: Sat Jul 29 08:32:00 2023 -0400 net/sched: cls_u32: No longer copy tcf_result on update to avoid use-after-free When u32_change() is called on an existing filter, the whole tcf_result struct is always copied into the new instance of the filter. This causes a problem when updating a filter bound to a class, as tcf_unbind_filter() is always called on the old instance in the success path, decreasing filter_cnt of the still referenced class and allowing it to be deleted, leading to a use-after-free. Fix this by no longer copying the tcf_result struct from the old filter. Fixes: de5df63228fc ("net: sched: cls_u32 changes to knode must appear atomic to readers") Reported-by: valis Reported-by: M A Ramdhan Signed-off-by: valis Signed-off-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Reviewed-by: Pedro Tammela Reviewed-by: M A Ramdhan Link: https://lore.kernel.org/r/20230729123202.72406-2-jhs@mojatatu.com Signed-off-by: Jakub Kicinski commit 4c9fbff54297471d4e2bbfe9c27e80067c722eae Merge: bcc29b7f5af67 7c62b75cd1a79 Author: Martin KaFai Lau Date: Mon Jul 31 15:37:13 2023 -0700 Merge branch 'Two fixes for cpu-map' Hou Tao says: ==================== The patchset fixes two reported warning in cpu-map when running xdp_redirect_cpu and some RT threads concurrently. Patch #1 fixes the warning in __cpu_map_ring_cleanup() when kthread is stopped prematurely. Patch #2 fixes the warning in __xdp_return() when there are pending skbs in ptr_ring. Please see individual patches for more details. And comments are always welcome. ==================== Signed-off-by: Martin KaFai Lau commit 7c62b75cd1a792e14b037fa4f61f9b18914e7de1 Author: Hou Tao Date: Sat Jul 29 17:51:07 2023 +0800 bpf, cpumap: Handle skb as well when clean up ptr_ring The following warning was reported when running xdp_redirect_cpu with both skb-mode and stress-mode enabled: ------------[ cut here ]------------ Incorrect XDP memory type (-2128176192) usage WARNING: CPU: 7 PID: 1442 at net/core/xdp.c:405 Modules linked in: CPU: 7 PID: 1442 Comm: kworker/7:0 Tainted: G 6.5.0-rc2+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Workqueue: events __cpu_map_entry_free RIP: 0010:__xdp_return+0x1e4/0x4a0 ...... Call Trace: ? show_regs+0x65/0x70 ? __warn+0xa5/0x240 ? __xdp_return+0x1e4/0x4a0 ...... xdp_return_frame+0x4d/0x150 __cpu_map_entry_free+0xf9/0x230 process_one_work+0x6b0/0xb80 worker_thread+0x96/0x720 kthread+0x1a5/0x1f0 ret_from_fork+0x3a/0x70 ret_from_fork_asm+0x1b/0x30 The reason for the warning is twofold. One is due to the kthread cpu_map_kthread_run() is stopped prematurely. Another one is __cpu_map_ring_cleanup() doesn't handle skb mode and treats skbs in ptr_ring as XDP frames. Prematurely-stopped kthread will be fixed by the preceding patch and ptr_ring will be empty when __cpu_map_ring_cleanup() is called. But as the comments in __cpu_map_ring_cleanup() said, handling and freeing skbs in ptr_ring as well to "catch any broken behaviour gracefully". Fixes: 11941f8a8536 ("bpf: cpumap: Implement generic cpumap") Signed-off-by: Hou Tao Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/r/20230729095107.1722450-3-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 640a604585aa30f93e39b17d4d6ba69fcb1e66c9 Author: Hou Tao Date: Sat Jul 29 17:51:06 2023 +0800 bpf, cpumap: Make sure kthread is running before map update returns The following warning was reported when running stress-mode enabled xdp_redirect_cpu with some RT threads: ------------[ cut here ]------------ WARNING: CPU: 4 PID: 65 at kernel/bpf/cpumap.c:135 CPU: 4 PID: 65 Comm: kworker/4:1 Not tainted 6.5.0-rc2+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Workqueue: events cpu_map_kthread_stop RIP: 0010:put_cpu_map_entry+0xda/0x220 ...... Call Trace: ? show_regs+0x65/0x70 ? __warn+0xa5/0x240 ...... ? put_cpu_map_entry+0xda/0x220 cpu_map_kthread_stop+0x41/0x60 process_one_work+0x6b0/0xb80 worker_thread+0x96/0x720 kthread+0x1a5/0x1f0 ret_from_fork+0x3a/0x70 ret_from_fork_asm+0x1b/0x30 The root cause is the same as commit 436901649731 ("bpf: cpumap: Fix memory leak in cpu_map_update_elem"). The kthread is stopped prematurely by kthread_stop() in cpu_map_kthread_stop(), and kthread() doesn't call cpu_map_kthread_run() at all but XDP program has already queued some frames or skbs into ptr_ring. So when __cpu_map_ring_cleanup() checks the ptr_ring, it will find it was not emptied and report a warning. An alternative fix is to use __cpu_map_ring_cleanup() to drop these pending frames or skbs when kthread_stop() returns -EINTR, but it may confuse the user, because these frames or skbs have been handled correctly by XDP program. So instead of dropping these frames or skbs, just make sure the per-cpu kthread is running before __cpu_map_entry_alloc() returns. After apply the fix, the error handle for kthread_stop() will be unnecessary because it will always return 0, so just remove it. Fixes: 6710e1126934 ("bpf: introduce new bpf cpu map type BPF_MAP_TYPE_CPUMAP") Signed-off-by: Hou Tao Reviewed-by: Pu Lehui Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/r/20230729095107.1722450-2-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau commit 611e1b016c7beceec5ae82ac62d4a7ca224c8f9d Author: Michal Schmidt Date: Sat Jul 29 17:15:16 2023 +0200 octeon_ep: initialize mbox mutexes The two mbox-related mutexes are destroyed in octep_ctrl_mbox_uninit(), but the corresponding mutex_init calls were missing. A "DEBUG_LOCKS_WARN_ON(lock->magic != lock)" warning was emitted with CONFIG_DEBUG_MUTEXES on. Initialize the two mutexes in octep_ctrl_mbox_init(). Fixes: 577f0d1b1c5f ("octeon_ep: add separate mailbox command and response queues") Signed-off-by: Michal Schmidt Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20230729151516.24153-1-mschmidt@redhat.com Signed-off-by: Jakub Kicinski commit 37b61cda9c1606cd8b6445d900ca9dc03185e8b6 Author: Jakub Kicinski Date: Fri Jul 28 13:50:20 2023 -0700 bnxt: don't handle XDP in netpoll Similarly to other recently fixed drivers make sure we don't try to access XDP or page pool APIs when NAPI budget is 0. NAPI budget of 0 may mean that we are in netpoll. This may result in running software IRQs in hard IRQ context, leading to deadlocks or crashes. To make sure bnapi->tx_pkts don't get wiped without handling the events, move clearing the field into the handler itself. Remember to clear tx_pkts after reset (bnxt_enable_napi()) as it's technically possible that netpoll will accumulate some tx_pkts and then a reset will happen, leaving tx_pkts out of sync with reality. Fixes: 322b87ca55f2 ("bnxt_en: add page_pool support") Reviewed-by: Andy Gospodarek Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20230728205020.2784844-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 4b31fd4d77ffa430d0b74ba1885ea0a41594f202 Author: Rafal Rogalski Date: Fri Jul 28 10:12:43 2023 -0700 ice: Fix RDMA VSI removal during queue rebuild During qdisc create/delete, it is necessary to rebuild the queue of VSIs. An error occurred because the VSIs created by RDMA were still active. Added check if RDMA is active. If yes, it disallows qdisc changes and writes a message in the system logs. Fixes: 348048e724a0 ("ice: Implement iidc operations") Signed-off-by: Rafal Rogalski Signed-off-by: Mateusz Palczewski Signed-off-by: Kamil Maziarz Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20230728171243.2446101-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 55c1528f9b97ff3b7efad73e8f79627fc2efb298 Author: Edward Cree Date: Fri Jul 28 17:55:28 2023 +0100 sfc: fix field-spanning memcpy in selftest Add a struct_group for the whole packet body so we can copy it in one go without triggering FORTIFY_SOURCE complaints. Fixes: cf60ed469629 ("sfc: use padding to fix alignment in loopback test") Fixes: 30c24dd87f3f ("sfc: siena: use padding to fix alignment in loopback test") Fixes: 1186c6b31ee1 ("sfc: falcon: use padding to fix alignment in loopback test") Reviewed-by: Andy Moreton Tested-by: Andy Moreton Signed-off-by: Edward Cree Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230728165528.59070-1-edward.cree@amd.com Signed-off-by: Jakub Kicinski commit d4480c9bb9258db9ddf2e632f6ef81e96b41089c Author: Martin Kohn Date: Thu Jul 27 20:00:43 2023 +0000 net: usb: qmi_wwan: add Quectel EM05GV2 Add support for Quectel EM05GV2 (G=global) with vendor ID 0x2c7c and product ID 0x030e Enabling DTR on this modem was necessary to ensure stable operation. Patch for usb: serial: option: is also in progress. T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=030e Rev= 3.18 S: Manufacturer=Quectel S: Product=Quectel EM05-G C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan E: Ad=89(I) Atr=03(Int.) MxPS= 8 Ivl=32ms E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Martin Kohn Link: https://lore.kernel.org/r/AM0PR04MB57648219DE893EE04FA6CC759701A@AM0PR04MB5764.eurprd04.prod.outlook.com Signed-off-by: Jakub Kicinski commit 9426d3cef5000824e5f24f80ed5f42fb935f2488 Author: Tony Battersby Date: Mon Jul 24 14:25:40 2023 -0400 scsi: core: Fix legacy /proc parsing buffer overflow (lightly modified commit message mostly by Linus Torvalds) The parsing code for /proc/scsi/scsi is disgusting and broken. We should have just used 'sscanf()' or something simple like that, but the logic may actually predate our kernel sscanf library routine for all I know. It certainly predates both git and BK histories. And we can't change it to be something sane like that now, because the string matching at the start is done case-insensitively, and the separator parsing between numbers isn't done at all, so *any* separator will work, including a possible terminating NUL character. This interface is root-only, and entirely for legacy use, so there is absolutely no point in trying to tighten up the parsing. Because any separator has traditionally worked, it's entirely possible that people have used random characters rather than the suggested space. So don't bother to try to pretty it up, and let's just make a minimal patch that can be back-ported and we can forget about this whole sorry thing for another two decades. Just make it at least not read past the end of the supplied data. Link: https://lore.kernel.org/linux-scsi/b570f5fe-cb7c-863a-6ed9-f6774c219b88@cybernetics.com/ Cc: Linus Torvalds Cc: Martin K Petersen Cc: James Bottomley Cc: Willy Tarreau Cc: stable@kernel.org Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Tony Battersby Signed-off-by: Martin K Petersen commit 8366d1f1249a0d0bba41d0bd1298d63e5d34c7f7 Author: Alexandra Diupina Date: Fri Jul 28 15:35:21 2023 +0300 scsi: 53c700: Check that command slot is not NULL Add a check for the command slot value to avoid dereferencing a NULL pointer. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Co-developed-by: Vladimir Telezhnikov Signed-off-by: Vladimir Telezhnikov Signed-off-by: Alexandra Diupina Link: https://lore.kernel.org/r/20230728123521.18293-1-adiupina@astralinux.ru Signed-off-by: Martin K. Petersen commit 5a43b07a87835660f91d88a4db11abfea8c523b7 Author: Karan Tilak Kumar Date: Thu Jul 27 12:39:19 2023 -0700 scsi: fnic: Replace return codes in fnic_clean_pending_aborts() fnic_clean_pending_aborts() was returning a non-zero value irrespective of failure or success. This caused the caller of this function to assume that the device reset had failed, even though it would succeed in most cases. As a consequence, a successful device reset would escalate to host reset. Reviewed-by: Sesidhar Baddela Tested-by: Karan Tilak Kumar Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20230727193919.2519-1-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 175544ad48cbf56affeef2a679c6a4d4fb1e2881 Author: Michael Kelley Date: Fri Jul 28 21:59:24 2023 -0700 scsi: storvsc: Fix handling of virtual Fibre Channel timeouts Hyper-V provides the ability to connect Fibre Channel LUNs to the host system and present them in a guest VM as a SCSI device. I/O to the vFC device is handled by the storvsc driver. The storvsc driver includes a partial integration with the FC transport implemented in the generic portion of the Linux SCSI subsystem so that FC attributes can be displayed in /sys. However, the partial integration means that some aspects of vFC don't work properly. Unfortunately, a full and correct integration isn't practical because of limitations in what Hyper-V provides to the guest. In particular, in the context of Hyper-V storvsc, the FC transport timeout function fc_eh_timed_out() causes a kernel panic because it can't find the rport and dereferences a NULL pointer. The original patch that added the call from storvsc_eh_timed_out() to fc_eh_timed_out() is faulty in this regard. In many cases a timeout is due to a transient condition, so the situation can be improved by just continuing to wait like with other I/O requests issued by storvsc, and avoiding the guaranteed panic. For a permanent failure, continuing to wait may result in a hung thread instead of a panic, which again may be better. So fix the panic by removing the storvsc call to fc_eh_timed_out(). This allows storvsc to keep waiting for a response. The change has been tested by users who experienced a panic in fc_eh_timed_out() due to transient timeouts, and it solves their problem. In the future we may want to deprecate the vFC functionality in storvsc since it can't be fully fixed. But it has current users for whom it is working well enough, so it should probably stay for a while longer. Fixes: 3930d7309807 ("scsi: storvsc: use default I/O timeout handler for FC devices") Cc: stable@vger.kernel.org Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1690606764-79669-1-git-send-email-mikelley@microsoft.com Signed-off-by: Martin K. Petersen commit 6d4cc57630a867a944483fdf7f8a060d2bbebdb9 Author: Konrad Dybcio Date: Tue Jun 27 18:24:17 2023 +0200 arm64: dts: qcom: sc7180: Fix DSI0_PHY reg-names Commit 2b616f86d51b ("arm64: dts: qcom: sc7180: rename labels for DSI nodes") broke reg-names, possibly with search-and-replace. Fix it. Fixes: 2b616f86d51b ("arm64: dts: qcom: sc7180: rename labels for DSI nodes") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230627-topic-more_bindings-v1-1-6b4b6cd081e5@linaro.org Signed-off-by: Bjorn Andersson commit 1cd0302be5645420f73090aee26fa787287e1096 Author: Simon Trimmer Date: Fri Jul 28 12:13:45 2023 +0100 ACPI: scan: Create platform device for CS35L56 The ACPI device CSC3556 is a Cirrus Logic CS35L56 mono amplifier which is used in multiples, and can be connected either to I2C or SPI. There will be multiple instances under the same Device() node. Add it to ignore_serial_bus_ids and handle it in the serial-multi-instantiate driver. There can be a 5th I2cSerialBusV2, but this is an alias address and doesn't represent a real device. Ignore this by having a dummy 5th entry in the serial-multi-instantiate instance list with the name of a non-existent driver, on the same pattern as done for bsg2150. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230728111345.7224-1-rf@opensource.cirrus.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 785c00993dc4c4bb2f7b0f3a3f29c03a6f7aab2e Author: Yang Li Date: Thu Jul 27 09:43:15 2023 +0800 platform/x86/amd/pmf: Fix unsigned comparison with less than zero The return value from the call to amd_pmf_get_pprof_modes() is int. However, the return value is being assigned to an unsigned char variable 'mode', so making 'mode' an int. silence the warning: ./drivers/platform/x86/amd/pmf/sps.c:183:5-9: WARNING: Unsigned expression compared with zero: mode < 0 Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5995 Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20230727014315.51375-1-yang.lee@linux.alibaba.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit bc2e67ac3eb57a8d4f4d0022616e550aada50e7b Author: Uwe Kleine-König Date: Fri Jul 28 16:58:23 2023 +0200 fbdev: ssd1307fb: Print the PWM's label instead of its number struct pwm_device::pwm is a write-only variable in the pwm core and used nowhere apart from this and another dev_dbg. So it isn't useful to identify the used PWM. Emit the PWM's label instead in the debug message. Signed-off-by: Uwe Kleine-König Reviewed-by: Javier Martinez Canillas Signed-off-by: Helge Deller commit 0872b2c0abc0e84ac82472959c8e14e35277549c Author: Yuanjun Gong Date: Fri Jul 28 01:03:18 2023 +0800 fbdev: mmp: fix value check in mmphw_probe() in mmphw_probe(), check the return value of clk_prepare_enable() and return the error code if clk_prepare_enable() returns an unexpected value. Fixes: d63028c38905 ("video: mmp display controller support") Signed-off-by: Yuanjun Gong Signed-off-by: Helge Deller commit 43a1120c0578791a7cdac1978406d9bf486001d9 Author: Atul Raut Date: Sun Jul 30 19:18:08 2023 -0700 fbdev: amifb: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper Replacing zero-length arrays with C99 flexible-array members because they are deprecated. Use the new DECLARE_FLEX_ARRAY() auxiliary macro instead of defining a zero-length array. This fixes warnings such as: ./drivers/video/fbdev/amifb.c:690:6-10: WARNING use flexible-array member instead Signed-off-by: Atul Raut Signed-off-by: Helge Deller commit 1e7417c188d0a83fb385ba2dbe35fd2563f2b6f3 Author: Duoming Zhou Date: Wed Jul 26 16:14:07 2023 +0800 net: usb: lan78xx: reorder cleanup operations to avoid UAF bugs The timer dev->stat_monitor can schedule the delayed work dev->wq and the delayed work dev->wq can also arm the dev->stat_monitor timer. When the device is detaching, the net_device will be deallocated. but the net_device private data could still be dereferenced in delayed work or timer handler. As a result, the UAF bugs will happen. One racy situation is shown below: (Thread 1) | (Thread 2) lan78xx_stat_monitor() | ... | lan78xx_disconnect() lan78xx_defer_kevent() | ... ... | cancel_delayed_work_sync(&dev->wq); schedule_delayed_work() | ... (wait some time) | free_netdev(net); //free net_device lan78xx_delayedwork() | //use net_device private data | dev-> //use | Although we use cancel_delayed_work_sync() to cancel the delayed work in lan78xx_disconnect(), it could still be scheduled in timer handler lan78xx_stat_monitor(). Another racy situation is shown below: (Thread 1) | (Thread 2) lan78xx_delayedwork | mod_timer() | lan78xx_disconnect() | cancel_delayed_work_sync() (wait some time) | if (timer_pending(&dev->stat_monitor)) | del_timer_sync(&dev->stat_monitor); lan78xx_stat_monitor() | ... lan78xx_defer_kevent() | free_netdev(net); //free //use net_device private data| dev-> //use | Although we use del_timer_sync() to delete the timer, the function timer_pending() returns 0 when the timer is activated. As a result, the del_timer_sync() will not be executed and the timer could be re-armed. In order to mitigate this bug, We use timer_shutdown_sync() to shutdown the timer and then use cancel_delayed_work_sync() to cancel the delayed work. As a result, the net_device could be deallocated safely. What's more, the dev->flags is set to EVENT_DEV_DISCONNECT in lan78xx_disconnect(). But it could still be set to EVENT_STAT_UPDATE in lan78xx_stat_monitor(). So this patch put the set_bit() behind timer_shutdown_sync(). Fixes: 77dfff5bb7e2 ("lan78xx: Fix race condition in disconnect handling") Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller commit 186b169cf1e4be85aa212a893ea783a543400979 Author: Michael Guralnik Date: Wed Jul 19 12:02:41 2023 +0300 RDMA/umem: Set iova in ODP flow Fixing the ODP registration flow to set the iova correctly. The calculation in ib_umem_num_dma_blocks() function assumes the iova of the umem is set correctly. When iova is not set, the calculation in ib_umem_num_dma_blocks() is equivalent to length/page_size, which is true only when memory is aligned. For unaligned memory, iova must be set for the ALIGN() in the ib_umem_num_dma_blocks() to take effect and return a correct value. mlx5_ib uses ib_umem_num_dma_blocks() to decide the mkey size to use for the MR. Without this fix, when registering unaligned ODP MR, a wrong size mkey might be chosen and this might cause the UMR to fail. UMR would fail over insufficient size to update the mkey translation: infiniband mlx5_0: dump_cqe:273:(pid 0): dump error cqe 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000030: 00 00 00 00 0f 00 78 06 25 00 00 58 00 da ac d2 infiniband mlx5_0: mlx5_ib_post_send_wait:806:(pid 20311): reg umr failed (6) infiniband mlx5_0: pagefault_real_mr:661:(pid 20311): Failed to update mkey page tables Fixes: f0093fb1a7cb ("RDMA/mlx5: Move mlx5_ib_cont_pages() to the creation of the mlx5_ib_mr") Fixes: a665aca89a41 ("RDMA/umem: Split ib_umem_num_pages() into ib_umem_num_dma_blocks()") Signed-off-by: Artemy Kovalyov Signed-off-by: Michael Guralnik Link: https://lore.kernel.org/r/3d4be7ca2155bf239dd8c00a2d25974a92c26ab8.1689757344.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit 8469c7f5472fe5f77fc31c8f10f23d5aad987231 Author: Rafał Miłecki Date: Sat Jul 29 13:10:45 2023 +0200 dt-bindings: net: mediatek,net: fixup MAC binding 1. Use unevaluatedProperties It's needed to allow ethernet-controller.yaml properties work correctly. 2. Drop unneeded phy-handle/phy-mode 3. Don't require phy-handle Some SoCs may use fixed link. For in-kernel MT7621 DTS files this fixes following errors: arch/mips/boot/dts/ralink/mt7621-tplink-hc220-g5-v1.dtb: ethernet@1e100000: mac@0: 'fixed-link' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/net/mediatek,net.yaml arch/mips/boot/dts/ralink/mt7621-tplink-hc220-g5-v1.dtb: ethernet@1e100000: mac@0: 'phy-handle' is a required property From schema: Documentation/devicetree/bindings/net/mediatek,net.yaml arch/mips/boot/dts/ralink/mt7621-tplink-hc220-g5-v1.dtb: ethernet@1e100000: mac@1: 'fixed-link' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/net/mediatek,net.yaml arch/mips/boot/dts/ralink/mt7621-tplink-hc220-g5-v1.dtb: ethernet@1e100000: mac@1: 'phy-handle' is a required property From schema: Documentation/devicetree/bindings/net/mediatek,net.yaml Signed-off-by: Rafał Miłecki Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit e739718444f7bf2fa3d70d101761ad83056ca628 Author: Kuniyuki Iwashima Date: Fri Jul 28 17:07:05 2023 -0700 net/sched: taprio: Limit TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME to INT_MAX. syzkaller found zero division error [0] in div_s64_rem() called from get_cycle_time_elapsed(), where sched->cycle_time is the divisor. We have tests in parse_taprio_schedule() so that cycle_time will never be 0, and actually cycle_time is not 0 in get_cycle_time_elapsed(). The problem is that the types of divisor are different; cycle_time is s64, but the argument of div_s64_rem() is s32. syzkaller fed this input and 0x100000000 is cast to s32 to be 0. @TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME={0xc, 0x8, 0x100000000} We use s64 for cycle_time to cast it to ktime_t, so let's keep it and set max for cycle_time. While at it, we prevent overflow in setup_txtime() and add another test in parse_taprio_schedule() to check if cycle_time overflows. Also, we add a new tdc test case for this issue. [0]: divide error: 0000 [#1] PREEMPT SMP KASAN NOPTI CPU: 1 PID: 103 Comm: kworker/1:3 Not tainted 6.5.0-rc1-00330-g60cc1f7d0605 #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 Workqueue: ipv6_addrconf addrconf_dad_work RIP: 0010:div_s64_rem include/linux/math64.h:42 [inline] RIP: 0010:get_cycle_time_elapsed net/sched/sch_taprio.c:223 [inline] RIP: 0010:find_entry_to_transmit+0x252/0x7e0 net/sched/sch_taprio.c:344 Code: 3c 02 00 0f 85 5e 05 00 00 48 8b 4c 24 08 4d 8b bd 40 01 00 00 48 8b 7c 24 48 48 89 c8 4c 29 f8 48 63 f7 48 99 48 89 74 24 70 <48> f7 fe 48 29 d1 48 8d 04 0f 49 89 cc 48 89 44 24 20 49 8d 85 10 RSP: 0018:ffffc90000acf260 EFLAGS: 00010206 RAX: 177450e0347560cf RBX: 0000000000000000 RCX: 177450e0347560cf RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000100000000 RBP: 0000000000000056 R08: 0000000000000000 R09: ffffed10020a0934 R10: ffff8880105049a7 R11: ffff88806cf3a520 R12: ffff888010504800 R13: ffff88800c00d800 R14: ffff8880105049a0 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f0edf84f0e8 CR3: 000000000d73c002 CR4: 0000000000770ee0 PKRU: 55555554 Call Trace: get_packet_txtime net/sched/sch_taprio.c:508 [inline] taprio_enqueue_one+0x900/0xff0 net/sched/sch_taprio.c:577 taprio_enqueue+0x378/0xae0 net/sched/sch_taprio.c:658 dev_qdisc_enqueue+0x46/0x170 net/core/dev.c:3732 __dev_xmit_skb net/core/dev.c:3821 [inline] __dev_queue_xmit+0x1b2f/0x3000 net/core/dev.c:4169 dev_queue_xmit include/linux/netdevice.h:3088 [inline] neigh_resolve_output net/core/neighbour.c:1552 [inline] neigh_resolve_output+0x4a7/0x780 net/core/neighbour.c:1532 neigh_output include/net/neighbour.h:544 [inline] ip6_finish_output2+0x924/0x17d0 net/ipv6/ip6_output.c:135 __ip6_finish_output+0x620/0xaa0 net/ipv6/ip6_output.c:196 ip6_finish_output net/ipv6/ip6_output.c:207 [inline] NF_HOOK_COND include/linux/netfilter.h:292 [inline] ip6_output+0x206/0x410 net/ipv6/ip6_output.c:228 dst_output include/net/dst.h:458 [inline] NF_HOOK.constprop.0+0xea/0x260 include/linux/netfilter.h:303 ndisc_send_skb+0x872/0xe80 net/ipv6/ndisc.c:508 ndisc_send_ns+0xb5/0x130 net/ipv6/ndisc.c:666 addrconf_dad_work+0xc14/0x13f0 net/ipv6/addrconf.c:4175 process_one_work+0x92c/0x13a0 kernel/workqueue.c:2597 worker_thread+0x60f/0x1240 kernel/workqueue.c:2748 kthread+0x2fe/0x3f0 kernel/kthread.c:389 ret_from_fork+0x2c/0x50 arch/x86/entry/entry_64.S:308 Modules linked in: Fixes: 4cfd5779bd6e ("taprio: Add support for txtime-assist mode") Reported-by: syzkaller Signed-off-by: Kuniyuki Iwashima Co-developed-by: Eric Dumazet Co-developed-by: Pedro Tammela Acked-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit 5e2424708da7207087934c5c75211e8584d553a0 Author: Lin Ma Date: Sun Jul 23 15:41:10 2023 +0800 xfrm: add forgotten nla_policy for XFRMA_MTIMER_THRESH The previous commit 4e484b3e969b ("xfrm: rate limit SA mapping change message to user space") added one additional attribute named XFRMA_MTIMER_THRESH and described its type at compat_policy (net/xfrm/xfrm_compat.c). However, the author forgot to also describe the nla_policy at xfrma_policy (net/xfrm/xfrm_user.c). Hence, this suppose NLA_U32 (4 bytes) value can be faked as empty (0 bytes) by a malicious user, which leads to 4 bytes overflow read and heap information leak when parsing nlattrs. To exploit this, one malicious user can spray the SLUB objects and then leverage this 4 bytes OOB read to leak the heap data into x->mapping_maxage (see xfrm_update_ae_params(...)), and leak it to userspace via copy_to_user_state_extra(...). The above bug is assigned CVE-2023-3773. To fix it, this commit just completes the nla_policy description for XFRMA_MTIMER_THRESH, which enforces the length check and avoids such OOB read. Fixes: 4e484b3e969b ("xfrm: rate limit SA mapping change message to user space") Signed-off-by: Lin Ma Reviewed-by: Simon Horman Reviewed-by: Leon Romanovsky Signed-off-by: Steffen Klassert commit 00374d9b6d9f932802b55181be9831aa948e5b7c Author: Lin Ma Date: Fri Jul 21 22:51:03 2023 +0800 xfrm: add NULL check in xfrm_update_ae_params Normally, x->replay_esn and x->preplay_esn should be allocated at xfrm_alloc_replay_state_esn(...) in xfrm_state_construct(...), hence the xfrm_update_ae_params(...) is okay to update them. However, the current implementation of xfrm_new_ae(...) allows a malicious user to directly dereference a NULL pointer and crash the kernel like below. BUG: kernel NULL pointer dereference, address: 0000000000000000 PGD 8253067 P4D 8253067 PUD 8e0e067 PMD 0 Oops: 0002 [#1] PREEMPT SMP KASAN NOPTI CPU: 0 PID: 98 Comm: poc.npd Not tainted 6.4.0-rc7-00072-gdad9774deaf1 #8 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.o4 RIP: 0010:memcpy_orig+0xad/0x140 Code: e8 4c 89 5f e0 48 8d 7f e0 73 d2 83 c2 20 48 29 d6 48 29 d7 83 fa 10 72 34 4c 8b 06 4c 8b 4e 08 c RSP: 0018:ffff888008f57658 EFLAGS: 00000202 RAX: 0000000000000000 RBX: ffff888008bd0000 RCX: ffffffff8238e571 RDX: 0000000000000018 RSI: ffff888007f64844 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff888008f57818 R13: ffff888007f64aa4 R14: 0000000000000000 R15: 0000000000000000 FS: 00000000014013c0(0000) GS:ffff88806d600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000000054d8000 CR4: 00000000000006f0 Call Trace: ? __die+0x1f/0x70 ? page_fault_oops+0x1e8/0x500 ? __pfx_is_prefetch.constprop.0+0x10/0x10 ? __pfx_page_fault_oops+0x10/0x10 ? _raw_spin_unlock_irqrestore+0x11/0x40 ? fixup_exception+0x36/0x460 ? _raw_spin_unlock_irqrestore+0x11/0x40 ? exc_page_fault+0x5e/0xc0 ? asm_exc_page_fault+0x26/0x30 ? xfrm_update_ae_params+0xd1/0x260 ? memcpy_orig+0xad/0x140 ? __pfx__raw_spin_lock_bh+0x10/0x10 xfrm_update_ae_params+0xe7/0x260 xfrm_new_ae+0x298/0x4e0 ? __pfx_xfrm_new_ae+0x10/0x10 ? __pfx_xfrm_new_ae+0x10/0x10 xfrm_user_rcv_msg+0x25a/0x410 ? __pfx_xfrm_user_rcv_msg+0x10/0x10 ? __alloc_skb+0xcf/0x210 ? stack_trace_save+0x90/0xd0 ? filter_irq_stacks+0x1c/0x70 ? __stack_depot_save+0x39/0x4e0 ? __kasan_slab_free+0x10a/0x190 ? kmem_cache_free+0x9c/0x340 ? netlink_recvmsg+0x23c/0x660 ? sock_recvmsg+0xeb/0xf0 ? __sys_recvfrom+0x13c/0x1f0 ? __x64_sys_recvfrom+0x71/0x90 ? do_syscall_64+0x3f/0x90 ? entry_SYSCALL_64_after_hwframe+0x72/0xdc ? copyout+0x3e/0x50 netlink_rcv_skb+0xd6/0x210 ? __pfx_xfrm_user_rcv_msg+0x10/0x10 ? __pfx_netlink_rcv_skb+0x10/0x10 ? __pfx_sock_has_perm+0x10/0x10 ? mutex_lock+0x8d/0xe0 ? __pfx_mutex_lock+0x10/0x10 xfrm_netlink_rcv+0x44/0x50 netlink_unicast+0x36f/0x4c0 ? __pfx_netlink_unicast+0x10/0x10 ? netlink_recvmsg+0x500/0x660 netlink_sendmsg+0x3b7/0x700 This Null-ptr-deref bug is assigned CVE-2023-3772. And this commit adds additional NULL check in xfrm_update_ae_params to fix the NPD. Fixes: d8647b79c3b7 ("xfrm: Add user interface for esn and big anti-replay windows") Signed-off-by: Lin Ma Reviewed-by: Leon Romanovsky Signed-off-by: Steffen Klassert commit 101df45e7ec36f470559c8fdab8e272cb991ef42 Author: David Howells Date: Thu Jul 27 17:21:17 2023 +0100 nfsd: Fix reading via splice nfsd_splice_actor() has a clause in its loop that chops up a compound page into individual pages such that if the same page is seen twice in a row, it is discarded the second time. This is a problem with the advent of shmem_splice_read() as that inserts zero_pages into the pipe in lieu of pages that aren't present in the pagecache. Fix this by assuming that the last page is being extended only if the currently stored length + starting offset is not currently on a page boundary. This can be tested by NFS-exporting a tmpfs filesystem on the test machine and truncating it to more than a page in size (eg. truncate -s 8192) and then reading it by NFS. The first page will be all zeros, but thereafter garbage will be read. Note: I wonder if we can ever get a situation now where we get a splice that gives us contiguous parts of a page in separate actor calls. As NFSD can only be splicing from a file (I think), there are only three sources of the page: copy_splice_read(), shmem_splice_read() and file_splice_read(). The first allocates pages for the data it reads, so the problem cannot occur; the second should never see a partial page; and the third waits for each page to become available before we're allowed to read from it. Fixes: bd194b187115 ("shmem: Implement splice-read") Reported-by: Chuck Lever Signed-off-by: David Howells Reviewed-by: Jeff Layton Reviewed-by: NeilBrown cc: Hugh Dickins cc: Jens Axboe cc: Matthew Wilcox cc: linux-nfs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Chuck Lever commit 5d0c230f1de8c7515b6567d9afba1f196fb4e2f4 Author: Linus Torvalds Date: Sun Jul 30 13:23:47 2023 -0700 Linux 6.5-rc4 commit d5bb4b89ac6996fe51a3ab63fdb25e15743e4351 Merge: 3dfe6886f9696 cc71c42b3dc10 Author: Linus Torvalds Date: Sun Jul 30 12:54:31 2023 -0700 Merge tag 'spi-fix-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A bunch of fixes for the Qualcomm QSPI driver, fixing multiple issues with the newly added DMA mode - it had a number of issues exposed when tested in a wider range of use cases, both race condition style issues and issues with different inputs to those that had been used in test" * tag 'spi-fix-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spi-qcom-qspi: Add mem_ops to avoid PIO for badly sized reads spi: spi-qcom-qspi: Fallback to PIO for xfers that aren't multiples of 4 bytes spi: spi-qcom-qspi: Add DMA_CHAIN_DONE to ALL_IRQS spi: spi-qcom-qspi: Call dma_wmb() after setting up descriptors spi: spi-qcom-qspi: Use GFP_ATOMIC flag while allocating for descriptor spi: spi-qcom-qspi: Ignore disabled interrupts' status in isr commit 3dfe6886f96969c46afc42f9ba2791103b7b47c0 Merge: 88f66f13ea510 67cb608838e0a Author: Linus Torvalds Date: Sun Jul 30 12:52:05 2023 -0700 Merge tag 'regulator-fix-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "A couple of small fixes for the the mt6358 driver, fixing error reporting and a bootstrapping issue" * tag 'regulator-fix-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: mt6358: Fix incorrect VCN33 sync error message regulator: mt6358: Sync VCN33_* enable status after checking ID commit 88f66f13ea51029280d3f91feafb6d66296c95d0 Merge: e6d34ced01bc3 7f2327666a908 Author: Linus Torvalds Date: Sun Jul 30 11:57:51 2023 -0700 Merge tag 'usb-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are a set of USB driver fixes for 6.5-rc4. Include in here are: - new USB serial device ids - dwc3 driver fixes for reported issues - typec driver fixes for reported problems - gadget driver fixes - reverts of some problematic USB changes that went into -rc1 All of these have been in linux-next with no reported problems" * tag 'usb-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (24 commits) usb: misc: ehset: fix wrong if condition usb: dwc3: pci: skip BYT GPIO lookup table for hardwired phy usb: cdns3: fix incorrect calculation of ep_buf_size when more than one config usb: gadget: call usb_gadget_check_config() to verify UDC capability usb: typec: Use sysfs_emit_at when concatenating the string usb: typec: Iterate pds array when showing the pd list usb: typec: Set port->pd before adding device for typec_port usb: typec: qcom: fix return value check in qcom_pmic_typec_probe() Revert "usb: gadget: tegra-xudc: Fix error check in tegra_xudc_powerdomain_init()" Revert "usb: xhci: tegra: Fix error check" USB: gadget: Fix the memory leak in raw_gadget driver usb: gadget: core: remove unbalanced mutex_unlock in usb_gadget_activate Revert "usb: dwc3: core: Enable AutoRetry feature in the controller" Revert "xhci: add quirk for host controllers that don't update endpoint DCS" USB: quirks: add quirk for Focusrite Scarlett usb: xhci-mtk: set the dma max_seg_size MAINTAINERS: drop invalid usb/cdns3 Reviewer e-mail usb: dwc3: don't reset device side if dwc3 was configured as host-only usb: typec: ucsi: move typec_set_mode(TYPEC_STATE_SAFE) to ucsi_unregister_partner() usb: ohci-at91: Fix the unhandle interrupt when resume ... commit e6d34ced01bc3aaad616b9446bbaa96cd04617c4 Merge: 3d6b77a8d4b46 748c5ea8b8796 Author: Linus Torvalds Date: Sun Jul 30 11:51:36 2023 -0700 Merge tag 'tty-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial fixes from Greg KH: "Here are some small TTY and serial driver fixes for 6.5-rc4 for some reported problems. Included in here is: - TIOCSTI fix for braille readers - documentation fix for minor numbers - MAINTAINERS update for new serial files in -rc1 - minor serial driver fixes for reported problems All of these have been in linux-next with no reported problems" * tag 'tty-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: 8250_dw: Preserve original value of DLF register tty: serial: sh-sci: Fix sleeping in atomic context serial: sifive: Fix sifive_serial_console_setup() section Documentation: devices.txt: reconcile serial/ucc_uart minor numers MAINTAINERS: Update TTY layer for lists and recently added files tty: n_gsm: fix UAF in gsm_cleanup_mux TIOCSTI: always enable for CAP_SYS_ADMIN commit 3d6b77a8d4b4603c243ab2ee0f04f74f122d576a Merge: cf270e7b75147 5f1c7031e044c Author: Linus Torvalds Date: Sun Jul 30 11:47:56 2023 -0700 Merge tag 'staging-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver fixes from Greg KH: "Here are three small staging driver fixes for 6.5-rc4 that resolve some reported problems. These fixes are: - fix for an old bug in the r8712 driver - fbtft driver fix for a spi device - potential overflow fix in the ks7010 driver All of these have been in linux-next with no reported problems" * tag 'staging-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: ks7010: potential buffer overflow in ks_wlan_set_encode_ext() staging: fbtft: ili9341: use macro FBTFT_REGISTER_SPI_DRIVER staging: r8712: Fix memory leak in _r8712_init_xmit_priv() commit cf270e7b751478a0834acdc6068edc58fead82cd Merge: b0b9850e7d53a f8ea950210228 Author: Linus Torvalds Date: Sun Jul 30 11:44:00 2023 -0700 Merge tag 'char-misc-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char driver and Documentation fixes from Greg KH: "Here is a char driver fix and some documentation updates for 6.5-rc4 that contain the following changes: - sram/genalloc bugfix for reported problem - security-bugs.rst update based on recent discussions - embargoed-hardware-issues minor cleanups and then partial revert for the project/company lists All of these have been in linux-next for a while with no reported problems, and the documentation updates have all been reviewed by the relevant developers" * tag 'char-misc-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: misc/genalloc: Name subpools by of_node_full_name() Documentation: embargoed-hardware-issues.rst: add AMD to the list Documentation: embargoed-hardware-issues.rst: clean out empty and unused entries Documentation: security-bugs.rst: clarify CVE handling Documentation: security-bugs.rst: update preferences when dealing with the linux-distros group commit b0b9850e7d53aec13ef12a485e5a301774d9132e Merge: 98a05fe8cd5e0 de02f2ac5d8cf Author: Linus Torvalds Date: Sun Jul 30 11:27:22 2023 -0700 Merge tag 'probes-fixes-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull probe fixes from Masami Hiramatsu: - probe-events: add NULL check for some BTF API calls which can return error code and NULL. - ftrace selftests: check fprobe and kprobe event correctly. This fixes a miss condition of the test command. - kprobes: do not allow probing functions that start with "__cfi_" or "__pfx_" since those are auto generated for kernel CFI and not executed. * tag 'probes-fixes-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: kprobes: Prohibit probing on CFI preamble symbol selftests/ftrace: Fix to check fprobe event eneblement tracing/probes: Fix to add NULL check for BTF APIs commit 98a05fe8cd5e0afe2b4c52b5013b53c44d615148 Merge: c959e90094d6d 5a7591176c47c Author: Linus Torvalds Date: Sun Jul 30 11:19:08 2023 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "x86: - Do not register IRQ bypass consumer if posted interrupts not supported - Fix missed device interrupt due to non-atomic update of IRR - Use GFP_KERNEL_ACCOUNT for pid_table in ipiv - Make VMREAD error path play nice with noinstr - x86: Acquire SRCU read lock when handling fastpath MSR writes - Support linking rseq tests statically against glibc 2.35+ - Fix reference count for stats file descriptors - Detect userspace setting invalid CR0 Non-KVM: - Remove coccinelle script that has caused multiple confusion ("debugfs, coccinelle: check for obsolete DEFINE_SIMPLE_ATTRIBUTE() usage", acked by Greg)" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (21 commits) KVM: selftests: Expand x86's sregs test to cover illegal CR0 values KVM: VMX: Don't fudge CR0 and CR4 for restricted L2 guest KVM: x86: Disallow KVM_SET_SREGS{2} if incoming CR0 is invalid Revert "debugfs, coccinelle: check for obsolete DEFINE_SIMPLE_ATTRIBUTE() usage" KVM: selftests: Verify stats fd is usable after VM fd has been closed KVM: selftests: Verify stats fd can be dup()'d and read KVM: selftests: Verify userspace can create "redundant" binary stats files KVM: selftests: Explicitly free vcpus array in binary stats test KVM: selftests: Clean up stats fd in common stats_test() helper KVM: selftests: Use pread() to read binary stats header KVM: Grab a reference to KVM for VM and vCPU stats file descriptors selftests/rseq: Play nice with binaries statically linked against glibc 2.35+ Revert "KVM: SVM: Skip WRMSR fastpath on VM-Exit if next RIP isn't valid" KVM: x86: Acquire SRCU read lock when handling fastpath MSR writes KVM: VMX: Use vmread_error() to report VM-Fail in "goto" path KVM: VMX: Make VMREAD error path play nice with noinstr KVM: x86/irq: Conditionally register IRQ bypass consumer again KVM: X86: Use GFP_KERNEL_ACCOUNT for pid_table in ipiv KVM: x86: check the kvm_cpu_get_interrupt result before using it KVM: x86: VMX: set irr_pending in kvm_apic_update_irr ... commit c959e90094d6db8ee1bfbe1a9c571fbd35d4daac Merge: d410b62e45ed9 f7853c3424180 Author: Linus Torvalds Date: Sun Jul 30 11:12:32 2023 -0700 Merge tag 'locking_urgent_for_v6.5_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking fix from Borislav Petkov: - Fix a rtmutex race condition resulting from sharing of the sort key between the lock waiters and the PI chain tree (->pi_waiters) of a task by giving each tree their own sort key * tag 'locking_urgent_for_v6.5_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/rtmutex: Fix task->pi_waiters integrity commit d410b62e45ed9702593fb3ddc45cde3d3f277c9b Merge: eb9fe1791ba87 fd470a8beed88 Author: Linus Torvalds Date: Sun Jul 30 11:05:35 2023 -0700 Merge tag 'x86_urgent_for_v6.5_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - AMD's automatic IBRS doesn't enable cross-thread branch target injection protection (STIBP) for user processes. Enable STIBP on such systems. - Do not delete (but put the ref instead) of AMD MCE error thresholding sysfs kobjects when destroying them in order not to delete the kernfs pointer prematurely - Restore annotation in ret_from_fork_asm() in order to fix kthread stack unwinding from being marked as unreliable and thus breaking livepatching * tag 'x86_urgent_for_v6.5_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu: Enable STIBP on AMD if Automatic IBRS is enabled x86/MCE/AMD: Decrement threshold_bank refcount when removing threshold blocks x86: Fix kthread unwind commit eb9fe1791ba87ec95a0408b7074f2400459aa1e4 Merge: d31e3792919e5 de99090852107 Author: Linus Torvalds Date: Sun Jul 30 10:59:19 2023 -0700 Merge tag 'irq_urgent_for_v6.5_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fixes from Borislav Petkov: - Work around an erratum on GIC700, where a race between a CPU handling a wake-up interrupt, a change of affinity, and another CPU going to sleep can result in a lack of wake-up event on the next interrupt - Fix the locking required on a VPE for GICv4 - Enable Rockchip 3588001 erratum workaround for RK3588S - Fix the irq-bcm6345-l1 assumtions of the boot CPU always be the first CPU in the system * tag 'irq_urgent_for_v6.5_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic-v3: Workaround for GIC-700 erratum 2941627 irqchip/gic-v3: Enable Rockchip 3588001 erratum workaround for RK3588S irqchip/gic-v4.1: Properly lock VPEs when doing a directLPI invalidation irq-bcm6345-l1: Do not assume a fixed block to cpu mapping commit 0a2b96e42a0284c4fc03022236f656a085ca714a Author: Xiaolei Wang Date: Wed Jul 26 15:57:47 2023 +0800 ARM: dts: imx: Set default tuning step for imx6sx usdhc If the tuning step is not set, the tuning step is set to 1. For some sd cards, the following Tuning timeout will occur. Tuning failed, falling back to fixed sampling clock So set the default tuning step. This refers to the NXP vendor's commit below: https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/ arch/arm/boot/dts/imx6sx.dtsi#L1108-L1109 Fixes: 1e336aa0c025 ("mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting") Signed-off-by: Xiaolei Wang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit f02b53375e8f14b4c27a14f6e4fb6e89914fdc29 Author: Fabio Estevam Date: Tue Jul 25 20:26:28 2023 -0300 arm64: dts: imx8mm: Drop CSI1 PHY reference clock configuration The CSI1 PHY reference clock is limited to 125 MHz according to: i.MX 8M Mini Applications Processor Reference Manual, Rev. 3, 11/2020 Table 5-1. Clock Root Table (continued) / page 307 Slice Index n = 123 . Currently the IMX8MM_CLK_CSI1_PHY_REF clock is configured to be fed directly from 1 GHz PLL2 , which overclocks them. Instead, drop the configuration altogether, which defaults the clock to 24 MHz REF clock input, which for the PHY reference clock is just fine. Based on a patch from Marek Vasut for the imx8mn. Fixes: e523b7c54c05 ("arm64: dts: imx8mm: Add CSI nodes") Signed-off-by: Fabio Estevam Reviewed-by: Marek Vasut Reviewed-by: Marco Felsch Reviewed-by: Adam Ford Signed-off-by: Shawn Guo commit 926c733508ddb9ec10e28a403f67feb0e38fad0d Author: Marek Vasut Date: Tue Jul 25 00:22:47 2023 +0200 arm64: dts: imx8mn: Drop CSI1 PHY reference clock configuration The CSI1 PHY reference clock are limited to 125 MHz according to: i.MX 8M Nano Applications Processor Reference Manual, Rev. 2, 07/2022 Table 5-1. Clock Root Table (continued) / page 319 Slice Index n = 123 . Currently those IMX8MN_CLK_CSI1_PHY_REF clock are configured to be fed directly from 1 GHz PLL2 , which overclocks them . Instead, drop the configuration altogether, which defaults the clock to 24 MHz REF clock input, which for the PHY reference clock is just fine. Fixes: ae9279f301b5 ("arm64: dts: imx8mn: Add CSI and ISI Nodes") Signed-off-by: Marek Vasut Reviewed-by: Marco Felsch Reviewed-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit be18293e47cbca7c6acee9231fc851601d69563a Author: Xiaolei Wang Date: Mon Jul 24 23:45:10 2023 +0800 ARM: dts: imx: Set default tuning step for imx7d usdhc If the tuning step is not set, the tuning step is set to 1. For some sd cards, the following Tuning timeout will occur. Tuning failed, falling back to fixed sampling clock mmc0: Tuning failed, falling back to fixed sampling clock So set the default tuning step. This refers to the NXP vendor's commit below: https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/ arch/arm/boot/dts/imx7s.dtsi#L1216-L1217 Fixes: 1e336aa0c025 ("mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting") Signed-off-by: Xiaolei Wang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 762b700982a1e0f562184363f19860c3b9bdd0bf Author: Andrej Picej Date: Wed Jul 19 13:43:26 2023 +0200 ARM: dts: imx6: phytec: fix RTC interrupt level RTC interrupt level should be set to "LOW". This was revealed by the introduction of commit: f181987ef477 ("rtc: m41t80: use IRQ flags obtained from fwnode") which changed the way IRQ type is obtained. Signed-off-by: Andrej Picej Reviewed-by: Stefan Riedmüller Fixes: 800d595151bb ("ARM: dts: imx6: Add initial support for phyBOARD-Mira") Signed-off-by: Shawn Guo commit d31e3792919e5c97d572c8a27a5a7c1eb9de5aca Merge: b88e123cc0b53 a171eb5cac427 Author: Linus Torvalds Date: Sat Jul 29 20:49:13 2023 -0700 Merge tag '6.5-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: "Four small SMB3 client fixes: - two reconnect fixes (to address the case where non-default iocharset gets incorrectly overridden at reconnect with the default charset) - fix for NTLMSSP_AUTH request setting a flag incorrectly) - Add missing check for invalid tlink (tree connection) in ioctl" * tag '6.5-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: add missing return value check for cifs_sb_tlink smb3: do not set NTLMSSP_VERSION flag for negotiate not auth request cifs: fix charset issue in reconnection fs/nls: make load_nls() take a const parameter commit b88e123cc0b53e32b0a20700e4815a28895e6b47 Merge: 1f2190d6b7112 dea499781a115 Author: Linus Torvalds Date: Sat Jul 29 20:40:43 2023 -0700 Merge tag 'trace-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Fix to /sys/kernel/tracing/per_cpu/cpu*/stats read and entries. If a resize shrinks the buffer it clears the read count to notify readers that they need to reset. But the read count is also used for accounting and this causes the numbers to be off. Instead, create a separate variable to use to notify readers to reset. - Fix the ref counts of the "soft disable" mode. The wrong value was used for testing if soft disable mode should be enabled or disable, but instead, just change the logic to do the enable and disable in place when the SOFT_MODE is set or cleared. - Several kernel-doc fixes - Removal of unused external declarations * tag 'trace-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing: Fix warning in trace_buffered_event_disable() ftrace: Remove unused extern declarations tracing: Fix kernel-doc warnings in trace_seq.c tracing: Fix kernel-doc warnings in trace_events_trigger.c tracing/synthetic: Fix kernel-doc warnings in trace_events_synth.c ring-buffer: Fix kernel-doc warnings in ring_buffer.c ring-buffer: Fix wrong stat of cpu_buffer->read commit f6dfa9f882a7819127343b30eaa24ebdd1950f49 Author: Fabio Estevam Date: Wed Jul 12 08:52:59 2023 -0300 ARM: dts: imx6sx: Remove LDB endpoint Remove the LDB endpoint description from the common imx6sx.dtsi as it causes regression for boards that has the LCDIF connected directly to a parallel display. Let the LDB endpoint be described in the board devicetree file instead. Cc: stable@vger.kernel.org Fixes: b74edf626c4f ("ARM: dts: imx6sx: Add LDB support") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 1f2190d6b7112d22d3f8dfeca16a2f6a2f51444e Author: Sven Joachim Date: Thu Jul 27 22:00:41 2023 +0200 arch/*/configs/*defconfig: Replace AUTOFS4_FS by AUTOFS_FS Commit a2225d931f75 ("autofs: remove left-over autofs4 stubs") promised the removal of the fs/autofs/Kconfig fragment for AUTOFS4_FS within a couple of releases, but five years later this still has not happened yet, and AUTOFS4_FS is still enabled in 63 defconfigs. Get rid of it mechanically: git grep -l CONFIG_AUTOFS4_FS -- '*defconfig' | xargs sed -i 's/AUTOFS4_FS/AUTOFS_FS/' Also just remove the AUTOFS4_FS config option stub. Anybody who hasn't regenerated their config file in the last five years will need to just get the new name right when they do. Signed-off-by: Sven Joachim Acked-by: Ian Kent Signed-off-by: Linus Torvalds commit 37e3cecb4cdfbc99aaa1da2175681aac1d8a7f6d Merge: 7938cd1543687 8bf43be799d4b Author: David S. Miller Date: Sat Jul 29 18:13:41 2023 +0100 Merge branch 'net-data-races' Eric Dumazet says: ==================== net: annotate data-races This series was inspired by a syzbot/KCSAN report. This will later also permit some optimizations, like not having to lock the socket while reading/writing some of its fields. ==================== Signed-off-by: David S. Miller commit 8bf43be799d4b242ea552a14db10456446be843e Author: Eric Dumazet Date: Fri Jul 28 15:03:18 2023 +0000 net: annotate data-races around sk->sk_priority sk_getsockopt() runs locklessly. This means sk->sk_priority can be read while other threads are changing its value. Other reads also happen without socket lock being held. Add missing annotations where needed. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit e5f0d2dd3c2faa671711dac6d3ff3cef307bcfe3 Author: Eric Dumazet Date: Fri Jul 28 15:03:17 2023 +0000 net: add missing data-race annotation for sk_ll_usec In a prior commit I forgot that sk_getsockopt() reads sk->sk_ll_usec without holding a lock. Fixes: 0dbffbb5335a ("net: annotate data race around sk_ll_usec") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 11695c6e966b0ec7ed1d16777d294cef865a5c91 Author: Eric Dumazet Date: Fri Jul 28 15:03:16 2023 +0000 net: add missing data-race annotations around sk->sk_peek_off sk_getsockopt() runs locklessly, thus we need to annotate the read of sk->sk_peek_off. While we are at it, add corresponding annotations to sk_set_peek_off() and unix_set_peek_off(). Fixes: b9bb53f3836f ("sock: convert sk_peek_offset functions to WRITE_ONCE") Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Signed-off-by: David S. Miller commit 3c5b4d69c358a9275a8de98f87caf6eda644b086 Author: Eric Dumazet Date: Fri Jul 28 15:03:15 2023 +0000 net: annotate data-races around sk->sk_mark sk->sk_mark is often read while another thread could change the value. Fixes: 4a19ec5800fc ("[NET]: Introducing socket mark socket option.") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit b4b553253091cafe9ec38994acf42795e073bef5 Author: Eric Dumazet Date: Fri Jul 28 15:03:14 2023 +0000 net: add missing READ_ONCE(sk->sk_rcvbuf) annotation In a prior commit, I forgot to change sk_getsockopt() when reading sk->sk_rcvbuf locklessly. Fixes: ebb3b78db7bf ("tcp: annotate sk->sk_rcvbuf lockless reads") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 74bc084327c643499474ba75df485607da37dd6e Author: Eric Dumazet Date: Fri Jul 28 15:03:13 2023 +0000 net: add missing READ_ONCE(sk->sk_sndbuf) annotation In a prior commit, I forgot to change sk_getsockopt() when reading sk->sk_sndbuf locklessly. Fixes: e292f05e0df7 ("tcp: annotate sk->sk_sndbuf lockless reads") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 285975dd674258ccb33e77a1803e8f2015e67105 Author: Eric Dumazet Date: Fri Jul 28 15:03:12 2023 +0000 net: annotate data-races around sk->sk_{rcv|snd}timeo sk_getsockopt() runs without locks, we must add annotations to sk->sk_rcvtimeo and sk->sk_sndtimeo. In the future we might allow fetching these fields before we lock the socket in TCP fast path. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit e6d12bdb435d23ff6c1890c852d85408a2f496ee Author: Eric Dumazet Date: Fri Jul 28 15:03:11 2023 +0000 net: add missing READ_ONCE(sk->sk_rcvlowat) annotation In a prior commit, I forgot to change sk_getsockopt() when reading sk->sk_rcvlowat locklessly. Fixes: eac66402d1c3 ("net: annotate sk->sk_rcvlowat lockless reads") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit ea7f45ef77b39e72244d282e47f6cb1ef4135cd2 Author: Eric Dumazet Date: Fri Jul 28 15:03:10 2023 +0000 net: annotate data-races around sk->sk_max_pacing_rate sk_getsockopt() runs locklessly. This means sk->sk_max_pacing_rate can be read while other threads are changing its value. Fixes: 62748f32d501 ("net: introduce SO_MAX_PACING_RATE") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit c76a0328899bbe226f8adeb88b8da9e4167bd316 Author: Eric Dumazet Date: Fri Jul 28 15:03:09 2023 +0000 net: annotate data-race around sk->sk_txrehash sk_getsockopt() runs locklessly. This means sk->sk_txrehash can be read while other threads are changing its value. Other locations were handled in commit cb6cd2cec799 ("tcp: Change SYN ACK retransmit behaviour to account for rehash") Fixes: 26859240e4ee ("txhash: Add socket option to control TX hash rethink behavior") Signed-off-by: Eric Dumazet Cc: Akhmat Karakotov Signed-off-by: David S. Miller commit fe11fdcb4207907d80cda2e73777465d68131e66 Author: Eric Dumazet Date: Fri Jul 28 15:03:08 2023 +0000 net: annotate data-races around sk->sk_reserved_mem sk_getsockopt() runs locklessly. This means sk->sk_reserved_mem can be read while other threads are changing its value. Add missing annotations where they are needed. Fixes: 2bb2f5fb21b0 ("net: add new socket option SO_RESERVE_MEM") Signed-off-by: Eric Dumazet Cc: Wei Wang Signed-off-by: David S. Miller commit 7938cd15436873f649f31cb867bac2d88ca564d0 Author: Richard Gobert Date: Thu Jul 27 17:33:56 2023 +0200 net: gro: fix misuse of CB in udp socket lookup This patch fixes a misuse of IP{6}CB(skb) in GRO, while calling to `udp6_lib_lookup2` when handling udp tunnels. `udp6_lib_lookup2` fetch the device from CB. The fix changes it to fetch the device from `skb->dev`. l3mdev case requires special attention since it has a master and a slave device. Fixes: a6024562ffd7 ("udp: Add GRO functions to UDP socket") Reported-by: Gal Pressman Signed-off-by: Richard Gobert Reviewed-by: David Ahern Signed-off-by: David S. Miller commit e346e231b42bcae6822a6326acfb7b741e9e6026 Author: Konstantin Khorenko Date: Thu Jul 27 18:26:09 2023 +0300 qed: Fix scheduling in a tasklet while getting stats Here we've got to a situation when tasklet called usleep_range() in PTT acquire logic, thus welcome to the "scheduling while atomic" BUG(). BUG: scheduling while atomic: swapper/24/0/0x00000100 [] schedule+0x29/0x70 [] schedule_hrtimeout_range_clock+0xb2/0x150 [] schedule_hrtimeout_range+0x13/0x20 [] usleep_range+0x4f/0x70 [] qed_ptt_acquire+0x38/0x100 [qed] [] _qed_get_vport_stats+0x458/0x580 [qed] [] qed_get_vport_stats+0x1c/0xd0 [qed] [] qed_get_protocol_stats+0x93/0x100 [qed] qed_mcp_send_protocol_stats case MFW_DRV_MSG_GET_LAN_STATS: case MFW_DRV_MSG_GET_FCOE_STATS: case MFW_DRV_MSG_GET_ISCSI_STATS: case MFW_DRV_MSG_GET_RDMA_STATS: [] qed_mcp_handle_events+0x2d8/0x890 [qed] qed_int_assertion qed_int_attentions [] qed_int_sp_dpc+0xa50/0xdc0 [qed] [] tasklet_action+0x83/0x140 [] __do_softirq+0x125/0x2bb [] call_softirq+0x1c/0x30 [] do_softirq+0x65/0xa0 [] irq_exit+0x105/0x110 [] do_IRQ+0x56/0xf0 Fix this by making caller to provide the context whether it could be in atomic context flow or not when getting stats from QED driver. QED driver based on the context provided decide to schedule out or not when acquiring the PTT BAR window. We faced the BUG_ON() while getting vport stats, but according to the code same issue could happen for fcoe and iscsi statistics as well, so fixing them too. Fixes: 6c75424612a7 ("qed: Add support for NCSI statistics.") Fixes: 1e128c81290a ("qed: Add support for hardware offloaded FCoE.") Fixes: 2f2b2614e893 ("qed: Provide iSCSI statistics to management") Cc: Sudarsana Kalluru Cc: David Miller Cc: Manish Chopra Signed-off-by: Konstantin Khorenko Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 8d7ae22ae9f8c8a4407f8e993df64440bdbd0cee Author: Lukasz Majewski Date: Thu Jul 27 10:13:42 2023 +0200 net: dsa: microchip: KSZ9477 register regmap alignment to 32 bit boundaries The commit (SHA1: 5c844d57aa7894154e49cf2fc648bfe2f1aefc1c) provided code to apply "Module 6: Certain PHY registers must be written as pairs instead of singly" errata for KSZ9477 as this chip for certain PHY registers (0xN120 to 0xN13F, N=1,2,3,4,5) must be accesses as 32 bit words instead of 16 or 8 bit access. Otherwise, adjacent registers (no matter if reserved or not) are overwritten with 0x0. Without this patch some registers (e.g. 0x113c or 0x1134) required for 32 bit access are out of valid regmap ranges. As a result, following error is observed and KSZ9477 is not properly configured: ksz-switch spi1.0: can't rmw 32bit reg 0x113c: -EIO ksz-switch spi1.0: can't rmw 32bit reg 0x1134: -EIO ksz-switch spi1.0 lan1 (uninitialized): failed to connect to PHY: -EIO ksz-switch spi1.0 lan1 (uninitialized): error -5 setting up PHY for tree 0, switch 0, port 0 The solution is to modify regmap_reg_range to allow accesses with 4 bytes boundaries. Signed-off-by: Lukasz Majewski Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit a0b1b2055be34c0ec1371764d040164cde1ead79 Author: Thierry Reding Date: Wed Jul 26 18:32:00 2023 +0200 net: stmmac: tegra: Properly allocate clock bulk data The clock data is an array of struct clk_bulk_data, so make sure to allocate enough memory. Fixes: d8ca113724e7 ("net: stmmac: tegra: Add MGBE support") Signed-off-by: Thierry Reding Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 12214540ad87ce824a8a791a3f063e6121ec5b66 Merge: ffabf7c731765 1e74ae32805b6 Author: Linus Torvalds Date: Sat Jul 29 08:59:25 2023 -0700 Merge tag 'loongarch-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: "Some bug fixes for build system, builtin cmdline handling, bpf and {copy, clear}_user, together with a trivial cleanup" * tag 'loongarch-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: Cleanup __builtin_constant_p() checking for cpu_has_* LoongArch: BPF: Fix check condition to call lu32id in move_imm() LoongArch: BPF: Enable bpf_probe_read{, str}() on LoongArch LoongArch: Fix return value underflow in exception path LoongArch: Fix CMDLINE_EXTEND and CMDLINE_BOOTLOADER handling LoongArch: Fix module relocation error with binutils 2.41 LoongArch: Only fiddle with CHECKFLAGS if `need-compiler' commit 5a7591176c47cce363c1eed704241e5d1c42c5a6 Author: Sean Christopherson Date: Tue Jun 13 13:30:37 2023 -0700 KVM: selftests: Expand x86's sregs test to cover illegal CR0 values Add coverage to x86's set_sregs_test to verify KVM rejects vendor-agnostic illegal CR0 values, i.e. CR0 values whose legality doesn't depend on the current VMX mode. KVM historically has neglected to reject bad CR0s from userspace, i.e. would happily accept a completely bogus CR0 via KVM_SET_SREGS{2}. Punt VMX specific subtests to future work, as they would require quite a bit more effort, and KVM gets coverage for CR0 checks in general through other means, e.g. KVM-Unit-Tests. Signed-off-by: Sean Christopherson Message-Id: <20230613203037.1968489-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c4abd7352023aa96114915a0bb2b88016a425cda Author: Sean Christopherson Date: Tue Jun 13 13:30:36 2023 -0700 KVM: VMX: Don't fudge CR0 and CR4 for restricted L2 guest Stuff CR0 and/or CR4 to be compliant with a restricted guest if and only if KVM itself is not configured to utilize unrestricted guests, i.e. don't stuff CR0/CR4 for a restricted L2 that is running as the guest of an unrestricted L1. Any attempt to VM-Enter a restricted guest with invalid CR0/CR4 values should fail, i.e. in a nested scenario, KVM (as L0) should never observe a restricted L2 with incompatible CR0/CR4, since nested VM-Enter from L1 should have failed. And if KVM does observe an active, restricted L2 with incompatible state, e.g. due to a KVM bug, fudging CR0/CR4 instead of letting VM-Enter fail does more harm than good, as KVM will often neglect to undo the side effects, e.g. won't clear rmode.vm86_active on nested VM-Exit, and thus the damage can easily spill over to L1. On the other hand, letting VM-Enter fail due to bad guest state is more likely to contain the damage to L2 as KVM relies on hardware to perform most guest state consistency checks, i.e. KVM needs to be able to reflect a failed nested VM-Enter into L1 irrespective of (un)restricted guest behavior. Cc: Jim Mattson Cc: stable@vger.kernel.org Fixes: bddd82d19e2e ("KVM: nVMX: KVM needs to unset "unrestricted guest" VM-execution control in vmcs02 if vmcs12 doesn't set it") Signed-off-by: Sean Christopherson Message-Id: <20230613203037.1968489-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 26a0652cb453c72f6aab0974bc4939e9b14f886b Author: Sean Christopherson Date: Tue Jun 13 13:30:35 2023 -0700 KVM: x86: Disallow KVM_SET_SREGS{2} if incoming CR0 is invalid Reject KVM_SET_SREGS{2} with -EINVAL if the incoming CR0 is invalid, e.g. due to setting bits 63:32, illegal combinations, or to a value that isn't allowed in VMX (non-)root mode. The VMX checks in particular are "fun" as failure to disallow Real Mode for an L2 that is configured with unrestricted guest disabled, when KVM itself has unrestricted guest enabled, will result in KVM forcing VM86 mode to virtual Real Mode for L2, but then fail to unwind the related metadata when synthesizing a nested VM-Exit back to L1 (which has unrestricted guest enabled). Opportunistically fix a benign typo in the prototype for is_valid_cr4(). Cc: stable@vger.kernel.org Reported-by: syzbot+5feef0b9ee9c8e9e5689@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/000000000000f316b705fdf6e2b4@google.com Signed-off-by: Sean Christopherson Message-Id: <20230613203037.1968489-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 880218361c10d6dd7f99423d621112b8770fc32f Author: Sean Christopherson Date: Wed Jul 26 13:29:20 2023 -0700 Revert "debugfs, coccinelle: check for obsolete DEFINE_SIMPLE_ATTRIBUTE() usage" Remove coccinelle's recommendation to use DEFINE_DEBUGFS_ATTRIBUTE() instead of DEFINE_SIMPLE_ATTRIBUTE(). Regardless of whether or not the "significant overhead" incurred by debugfs_create_file() is actually meaningful, warnings from the script have led to a rash of low-quality patches that have sowed confusion and consumed maintainer time for little to no benefit. There have been no less than four attempts to "fix" KVM, and a quick search on lore shows that KVM is not alone. This reverts commit 5103068eaca290f890a30aae70085fac44cecaf6. Link: https://lore.kernel.org/all/87tu2nbnz3.fsf@mpe.ellerman.id.au Link: https://lore.kernel.org/all/c0b98151-16b6-6d8f-1765-0f7d46682d60@redhat.com Link: https://lkml.kernel.org/r/20230706072954.4881-1-duminjie%40vivo.com Link: https://lore.kernel.org/all/Y2FsbufV00jbyF0B@google.com Link: https://lore.kernel.org/all/Y2ENJJ1YiSg5oHiy@orome Link: https://lore.kernel.org/all/7560b350e7b23786ce712118a9a504356ff1cca4.camel@kernel.org Suggested-by: Paolo Bonzini Acked-by: Greg Kroah-Hartman Signed-off-by: Sean Christopherson Message-Id: <20230726202920.507756-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 211c0189ea18648a0cf23dea9f4ed745bc9252f6 Author: Sean Christopherson Date: Tue Jul 11 16:01:31 2023 -0700 KVM: selftests: Verify stats fd is usable after VM fd has been closed Verify that VM and vCPU binary stats files are usable even after userspace has put its last direct reference to the VM. This is a regression test for a UAF bug where KVM didn't gift the stats files a reference to the VM. Signed-off-by: Sean Christopherson Message-Id: <20230711230131.648752-8-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 65f1f57f35e5e833c879a7afb9c862c603695917 Author: Sean Christopherson Date: Tue Jul 11 16:01:30 2023 -0700 KVM: selftests: Verify stats fd can be dup()'d and read Expand the binary stats test to verify that a stats fd can be dup()'d and read, to (very) roughly simulate userspace passing around the file. Adding the dup() test is primarily an intermediate step towards verifying that userspace can read VM/vCPU stats before _and_ after userspace closes its copy of the VM fd; the dup() test itself is only mildly interesting. Signed-off-by: Sean Christopherson Message-Id: <20230711230131.648752-7-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 47d1be8a78fb587fe5a8f0873244476700171403 Author: Sean Christopherson Date: Tue Jul 11 16:01:29 2023 -0700 KVM: selftests: Verify userspace can create "redundant" binary stats files Verify that KVM doesn't artificially limit KVM_GET_STATS_FD to a single file per VM/vCPU. There's no known use case for getting multiple stats fds, but it should work, and more importantly creating multiple files will make it easier to test that KVM correct manages VM refcounts for stats files. Signed-off-by: Sean Christopherson Message-Id: <20230711230131.648752-6-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 33b02704071b0972a62ec32516847f91cab6cb8f Author: Sean Christopherson Date: Tue Jul 11 16:01:28 2023 -0700 KVM: selftests: Explicitly free vcpus array in binary stats test Explicitly free the all-encompassing vcpus array in the binary stats test so that the test is consistent with respect to freeing all dynamically allocated resources (versus letting them be freed on exit). Signed-off-by: Sean Christopherson Message-Id: <20230711230131.648752-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 87d53582bc8be30a11654a45fac0a257ed830ea8 Author: Sean Christopherson Date: Tue Jul 11 16:01:27 2023 -0700 KVM: selftests: Clean up stats fd in common stats_test() helper Move the stats fd cleanup code into stats_test() and drop the superfluous vm_stats_test() and vcpu_stats_test() helpers in order to decouple creation of the stats file from consuming/testing the file (deduping code is a bonus). This will make it easier to test various edge cases related to stats, e.g. that userspace can dup() a stats fd, that userspace can have multiple stats files for a singleVM/vCPU, etc. Signed-off-by: Sean Christopherson Message-Id: <20230711230131.648752-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 625646aede90554fed8d46fd0e081238e071ac5e Author: Sean Christopherson Date: Tue Jul 11 16:01:26 2023 -0700 KVM: selftests: Use pread() to read binary stats header Use pread() with an explicit offset when reading the header and the header name for a binary stats fd so that the common helper and the binary stats test don't subtly rely on the file effectively being untouched, e.g. to allow multiple reads of the header, name, etc. Signed-off-by: Sean Christopherson Message-Id: <20230711230131.648752-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit eed3013faa401aae662398709410a59bb0646e32 Author: Sean Christopherson Date: Tue Jul 11 16:01:25 2023 -0700 KVM: Grab a reference to KVM for VM and vCPU stats file descriptors Grab a reference to KVM prior to installing VM and vCPU stats file descriptors to ensure the underlying VM and vCPU objects are not freed until the last reference to any and all stats fds are dropped. Note, the stats paths manually invoke fd_install() and so don't need to grab a reference before creating the file. Fixes: ce55c049459c ("KVM: stats: Support binary stats retrieval for a VCPU") Fixes: fcfe1baeddbf ("KVM: stats: Support binary stats retrieval for a VM") Reported-by: Zheng Zhang Closes: https://lore.kernel.org/all/CAC_GQSr3xzZaeZt85k_RCBd5kfiOve8qXo7a81Cq53LuVQ5r=Q@mail.gmail.com Cc: stable@vger.kernel.org Cc: Kees Cook Signed-off-by: Sean Christopherson Reviewed-by: Kees Cook Message-Id: <20230711230131.648752-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 3bcbc20942db5d738221cca31a928efc09827069 Author: Sean Christopherson Date: Fri Jul 21 15:33:52 2023 -0700 selftests/rseq: Play nice with binaries statically linked against glibc 2.35+ To allow running rseq and KVM's rseq selftests as statically linked binaries, initialize the various "trampoline" pointers to point directly at the expect glibc symbols, and skip the dlysm() lookups if the rseq size is non-zero, i.e. the binary is statically linked *and* the libc registered its own rseq. Define weak versions of the symbols so as not to break linking against libc versions that don't support rseq in any capacity. The KVM selftests in particular are often statically linked so that they can be run on targets with very limited runtime environments, i.e. test machines. Fixes: 233e667e1ae3 ("selftests/rseq: Uplift rseq selftests for compatibility with glibc-2.35") Cc: Aaron Lewis Cc: kvm@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20230721223352.2333911-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit b439eb8ab578557263815ba8581d02c1b730e348 Author: Sean Christopherson Date: Fri Jul 21 15:43:37 2023 -0700 Revert "KVM: SVM: Skip WRMSR fastpath on VM-Exit if next RIP isn't valid" Now that handle_fastpath_set_msr_irqoff() acquires kvm->srcu, i.e. allows dereferencing memslots during WRMSR emulation, drop the requirement that "next RIP" is valid. In hindsight, acquiring kvm->srcu would have been a better fix than avoiding the pastpath, but at the time it was thought that accessing SRCU-protected data in the fastpath was a one-off edge case. This reverts commit 5c30e8101e8d5d020b1d7119117889756a6ed713. Signed-off-by: Sean Christopherson Message-Id: <20230721224337.2335137-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 3f2739bd1e0b7e9669333852b4e618294d5a1e54 Author: Sean Christopherson Date: Fri Jul 21 15:43:36 2023 -0700 KVM: x86: Acquire SRCU read lock when handling fastpath MSR writes Temporarily acquire kvm->srcu for read when potentially emulating WRMSR in the VM-Exit fastpath handler, as several of the common helpers used during emulation expect the caller to provide SRCU protection. E.g. if the guest is counting instructions retired, KVM will query the PMU event filter when stepping over the WRMSR. dump_stack+0x85/0xdf lockdep_rcu_suspicious+0x109/0x120 pmc_event_is_allowed+0x165/0x170 kvm_pmu_trigger_event+0xa5/0x190 handle_fastpath_set_msr_irqoff+0xca/0x1e0 svm_vcpu_run+0x5c3/0x7b0 [kvm_amd] vcpu_enter_guest+0x2108/0x2580 Alternatively, check_pmu_event_filter() could acquire kvm->srcu, but this isn't the first bug of this nature, e.g. see commit 5c30e8101e8d ("KVM: SVM: Skip WRMSR fastpath on VM-Exit if next RIP isn't valid"). Providing protection for the entirety of WRMSR emulation will allow reverting the aforementioned commit, and will avoid having to play whack-a-mole when new uses of SRCU-protected structures are inevitably added in common emulation helpers. Fixes: dfdeda67ea2d ("KVM: x86/pmu: Prevent the PMU from counting disallowed events") Reported-by: Greg Thelen Reported-by: Aaron Lewis Signed-off-by: Sean Christopherson Message-Id: <20230721224337.2335137-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit a062dad7ec4b91473e2e82c4e03cbee953189a87 Author: Sean Christopherson Date: Fri Jul 21 16:56:37 2023 -0700 KVM: VMX: Use vmread_error() to report VM-Fail in "goto" path Use vmread_error() to report VM-Fail on VMREAD for the "asm goto" case, now that trampoline case has yet another wrapper around vmread_error() to play nice with instrumentation. Signed-off-by: Sean Christopherson Message-Id: <20230721235637.2345403-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c20d403fd04c20959b7e6669868372f433947e5f Author: Sean Christopherson Date: Fri Jul 21 16:56:36 2023 -0700 KVM: VMX: Make VMREAD error path play nice with noinstr Mark vmread_error_trampoline() as noinstr, and add a second trampoline for the CONFIG_CC_HAS_ASM_GOTO_OUTPUT=n case to enable instrumentation when handling VM-Fail on VMREAD. VMREAD is used in various noinstr flows, e.g. immediately after VM-Exit, and objtool rightly complains that the call to the error trampoline leaves a no-instrumentation section without annotating that it's safe to do so. vmlinux.o: warning: objtool: vmx_vcpu_enter_exit+0xc9: call to vmread_error_trampoline() leaves .noinstr.text section Note, strictly speaking, enabling instrumentation in the VM-Fail path isn't exactly safe, but if VMREAD fails the kernel/system is likely hosed anyways, and logging that there is a fatal error is more important than *maybe* encountering slightly unsafe instrumentation. Reported-by: Su Hui Signed-off-by: Sean Christopherson Message-Id: <20230721235637.2345403-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 5e1fe4a21c0c2a69419d97d62d3213e8f843920d Author: Like Xu Date: Mon Jul 24 19:12:36 2023 +0800 KVM: x86/irq: Conditionally register IRQ bypass consumer again As was attempted commit 14717e203186 ("kvm: Conditionally register IRQ bypass consumer"): "if we don't support a mechanism for bypassing IRQs, don't register as a consumer. Initially this applied to AMD processors, but when AVIC support was implemented for assigned devices, kvm_arch_has_irq_bypass() was always returning true. We can still skip registering the consumer where enable_apicv or posted-interrupts capability is unsupported or globally disabled. This eliminates meaningless dev_info()s when the connect fails between producer and consumer", such as on Linux hosts where enable_apicv or posted-interrupts capability is unsupported or globally disabled. Cc: Alex Williamson Reported-by: Yong He Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217379 Signed-off-by: Like Xu Message-Id: <20230724111236.76570-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit fd1815ea709e414f83a06e4cf13ade4a49dd0fda Author: Peng Hao Date: Fri Jul 28 14:49:48 2023 +0800 KVM: X86: Use GFP_KERNEL_ACCOUNT for pid_table in ipiv The pid_table of ipiv is the persistent memory allocated by per-vcpu, which should be counted into the memory cgroup. Signed-off-by: Peng Hao Message-Id: Signed-off-by: Paolo Bonzini commit bf672720e83cf04c007aa11c242229e70985135b Author: Maxim Levitsky Date: Wed Jul 26 16:59:45 2023 +0300 KVM: x86: check the kvm_cpu_get_interrupt result before using it The code was blindly assuming that kvm_cpu_get_interrupt never returns -1 when there is a pending interrupt. While this should be true, a bug in KVM can still cause this. If -1 is returned, the code before this patch was converting it to 0xFF, and 0xFF interrupt was injected to the guest, which results in an issue which was hard to debug. Add WARN_ON_ONCE to catch this case and skip the injection if this happens again. Signed-off-by: Maxim Levitsky Message-Id: <20230726135945.260841-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit cff540ebef38303a4cabf4b8bb49317be01b4b0f Author: Maxim Levitsky Date: Wed Jul 26 16:59:44 2023 +0300 KVM: x86: VMX: set irr_pending in kvm_apic_update_irr When the APICv is inhibited, the irr_pending optimization is used. Therefore, when kvm_apic_update_irr sets bits in the IRR, it must set irr_pending to true as well. Signed-off-by: Maxim Levitsky Message-Id: <20230726135945.260841-3-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 514946d1436341bae57f647ee633cef5edb19ee2 Author: Maxim Levitsky Date: Wed Jul 26 16:59:43 2023 +0300 KVM: x86: VMX: __kvm_apic_update_irr must update the IRR atomically If APICv is inhibited, then IPIs from peer vCPUs are done by atomically setting bits in IRR. This means, that when __kvm_apic_update_irr copies PIR to IRR, it has to modify IRR atomically as well. Signed-off-by: Maxim Levitsky Message-Id: <20230726135945.260841-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit de02f2ac5d8cfb311f44f2bf144cc20002f1fbbd Author: Masami Hiramatsu (Google) Date: Tue Jul 11 10:50:47 2023 +0900 kprobes: Prohibit probing on CFI preamble symbol Do not allow to probe on "__cfi_" or "__pfx_" started symbol, because those are used for CFI and not executed. Probing it will break the CFI. Link: https://lore.kernel.org/all/168904024679.116016.18089228029322008512.stgit@devnote2/ Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) commit 3bbbe97ad83db8d9df06daf027b0840188de625d Author: Borislav Petkov (AMD) Date: Fri Jul 28 23:03:22 2023 +0200 x86/srso: Add a forgotten NOENDBR annotation Fix: vmlinux.o: warning: objtool: .export_symbol+0x29e40: data relocation to !ENDBR: srso_untrain_ret_alias+0x0 Reported-by: Linus Torvalds Signed-off-by: Borislav Petkov (AMD) commit 0c02cc576eac161601927b41634f80bfd55bfa9e Author: Heiko Carstens Date: Thu Jul 27 20:29:39 2023 +0200 KVM: s390: fix sthyi error handling Commit 9fb6c9b3fea1 ("s390/sthyi: add cache to store hypervisor info") added cache handling for store hypervisor info. This also changed the possible return code for sthyi_fill(). Instead of only returning a condition code like the sthyi instruction would do, it can now also return a negative error value (-ENOMEM). handle_styhi() was not changed accordingly. In case of an error, the negative error value would incorrectly injected into the guest PSW. Add proper error handling to prevent this, and update the comment which describes the possible return values of sthyi_fill(). Fixes: 9fb6c9b3fea1 ("s390/sthyi: add cache to store hypervisor info") Reviewed-by: Christian Borntraeger Link: https://lore.kernel.org/r/20230727182939.2050744-1-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit 238ec850b95a02dcdff3edc86781aa913549282f Author: Josh Poimboeuf Date: Fri Jul 28 17:28:43 2023 -0500 x86/srso: Fix return thunks in generated code Set X86_FEATURE_RETHUNK when enabling the SRSO mitigation so that generated code (e.g., ftrace, static call, eBPF) generates "jmp __x86_return_thunk" instead of RET. [ bp: Add a comment. ] Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov (AMD) commit 8a4629055ef55177b5b63dab1ecce676bd8cccdd Author: Yiyuan Guo Date: Fri Jun 30 22:37:19 2023 +0800 iio: cros_ec: Fix the allocation size for cros_ec_command The struct cros_ec_command contains several integer fields and a trailing array. An allocation size neglecting the integer fields can lead to buffer overrun. Reviewed-by: Tzung-Bi Shih Signed-off-by: Yiyuan Guo Fixes: 974e6f02e27e ("iio: cros_ec_sensors_core: Add common functions for the ChromeOS EC Sensor Hub.") Link: https://lore.kernel.org/r/20230630143719.1513906-1-yguoaz@gmail.com Cc: Signed-off-by: Jonathan Cameron commit 238353088e9b28d61f58994aa058d736fc306614 Author: James Clark Date: Tue Jul 25 11:58:26 2023 +0100 scripts/kallsyms: Fix build failure by setting errno before calling getline() getline() returns -1 at EOF as well as on error. It also doesn't set errno to 0 on success, so initialize it to 0 before using errno to check for an error condition. See the paragraph here [1]: For some system calls and library functions (e.g., getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value. Bear has a bug [2] that launches processes with errno set and causes the following build failure: $ bear -- make LLVM=1 ... LD .tmp_vmlinux.kallsyms1 NM .tmp_vmlinux.kallsyms1.syms KSYMS .tmp_vmlinux.kallsyms1.S read_symbol: Invalid argument [1]: https://linux.die.net/man/3/errno [2]: https://github.com/rizsotto/Bear/issues/469 Fixes: 1c975da56a6f ("scripts/kallsyms: remove KSYM_NAME_LEN_BUFFER") Reviewed-by: Miguel Ojeda Signed-off-by: James Clark Signed-off-by: Masahiro Yamada commit 56c6be35fcbed54279df0a2c9e60480a61841d6f Author: Chengfeng Ye Date: Thu Jul 27 08:56:19 2023 +0000 mISDN: hfcpci: Fix potential deadlock on &hc->lock As &hc->lock is acquired by both timer _hfcpci_softirq() and hardirq hfcpci_int(), the timer should disable irq before lock acquisition otherwise deadlock could happen if the timmer is preemtped by the hadr irq. Possible deadlock scenario: hfcpci_softirq() (timer) -> _hfcpci_softirq() -> spin_lock(&hc->lock); -> hfcpci_int() -> spin_lock(&hc->lock); (deadlock here) This flaw was found by an experimental static analysis tool I am developing for irq-related deadlock. The tentative patch fixes the potential deadlock by spin_lock_irq() in timer. Fixes: b36b654a7e82 ("mISDN: Create /sys/class/mISDN") Signed-off-by: Chengfeng Ye Link: https://lore.kernel.org/r/20230727085619.7419-1-dg573847474@gmail.com Signed-off-by: Jakub Kicinski commit ffabf7c731765da3dbfaffa4ed58b51ae9c2e650 Merge: 122e7943b252f 3ac873c76d79f Author: Linus Torvalds Date: Fri Jul 28 18:31:18 2023 -0700 Merge tag 'ata-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fixes from Damien Le Moal: - Fix error message output in the pata_arasan_cf driver (Minjie) - Fix invalid error return in the pata_octeon_cf driver initialization (Yingliang) - Fix a compilation warning due to a missing static function declaration in the pata_ns87415 driver (Arnd) - Fix the condition evaluating when to fetch sense data for successful completions, which should be done only when command duration limits are being used (Niklas) * tag 'ata-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: libata-core: fix when to fetch sense data for successful commands ata: pata_ns87415: mark ns87560_tf_read static ata: pata_octeon_cf: fix error return code in octeon_cf_probe() ata: pata_arasan_cf: Use dev_err_probe() instead dev_err() in data_xfer() commit e68409db995380d1badacba41ff24996bd396171 Author: Jamal Hadi Salim Date: Wed Jul 26 09:51:51 2023 -0400 net: sched: cls_u32: Fix match key mis-addressing A match entry is uniquely identified with an "address" or "path" in the form of: hashtable ID(12b):bucketid(8b):nodeid(12b). When creating table match entries all of hash table id, bucket id and node (match entry id) are needed to be either specified by the user or reasonable in-kernel defaults are used. The in-kernel default for a table id is 0x800(omnipresent root table); for bucketid it is 0x0. Prior to this fix there was none for a nodeid i.e. the code assumed that the user passed the correct nodeid and if the user passes a nodeid of 0 (as Mingi Cho did) then that is what was used. But nodeid of 0 is reserved for identifying the table. This is not a problem until we dump. The dump code notices that the nodeid is zero and assumes it is referencing a table and therefore references table struct tc_u_hnode instead of what was created i.e match entry struct tc_u_knode. Ming does an equivalent of: tc filter add dev dummy0 parent 10: prio 1 handle 0x1000 \ protocol ip u32 match ip src 10.0.0.1/32 classid 10:1 action ok Essentially specifying a table id 0, bucketid 1 and nodeid of zero Tableid 0 is remapped to the default of 0x800. Bucketid 1 is ignored and defaults to 0x00. Nodeid was assumed to be what Ming passed - 0x000 dumping before fix shows: ~$ tc filter ls dev dummy0 parent 10: filter protocol ip pref 1 u32 chain 0 filter protocol ip pref 1 u32 chain 0 fh 800: ht divisor 1 filter protocol ip pref 1 u32 chain 0 fh 800: ht divisor -30591 Note that the last line reports a table instead of a match entry (you can tell this because it says "ht divisor..."). As a result of reporting the wrong data type (misinterpretting of struct tc_u_knode as being struct tc_u_hnode) the divisor is reported with value of -30591. Ming identified this as part of the heap address (physmap_base is 0xffff8880 (-30591 - 1)). The fix is to ensure that when table entry matches are added and no nodeid is specified (i.e nodeid == 0) then we get the next available nodeid from the table's pool. After the fix, this is what the dump shows: $ tc filter ls dev dummy0 parent 10: filter protocol ip pref 1 u32 chain 0 filter protocol ip pref 1 u32 chain 0 fh 800: ht divisor 1 filter protocol ip pref 1 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 flowid 10:1 not_in_hw match 0a000001/ffffffff at 12 action order 1: gact action pass random type none pass val 0 index 1 ref 1 bind 1 Reported-by: Mingi Cho Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Jamal Hadi Salim Link: https://lore.kernel.org/r/20230726135151.416917-1-jhs@mojatatu.com Signed-off-by: Jakub Kicinski commit dea499781a1150d285c62b26659f62fb00824fce Author: Zheng Yejian Date: Wed Jul 26 17:58:04 2023 +0800 tracing: Fix warning in trace_buffered_event_disable() Warning happened in trace_buffered_event_disable() at WARN_ON_ONCE(!trace_buffered_event_ref) Call Trace: ? __warn+0xa5/0x1b0 ? trace_buffered_event_disable+0x189/0x1b0 __ftrace_event_enable_disable+0x19e/0x3e0 free_probe_data+0x3b/0xa0 unregister_ftrace_function_probe_func+0x6b8/0x800 event_enable_func+0x2f0/0x3d0 ftrace_process_regex.isra.0+0x12d/0x1b0 ftrace_filter_write+0xe6/0x140 vfs_write+0x1c9/0x6f0 [...] The cause of the warning is in __ftrace_event_enable_disable(), trace_buffered_event_enable() was called once while trace_buffered_event_disable() was called twice. Reproduction script show as below, for analysis, see the comments: ``` #!/bin/bash cd /sys/kernel/tracing/ # 1. Register a 'disable_event' command, then: # 1) SOFT_DISABLED_BIT was set; # 2) trace_buffered_event_enable() was called first time; echo 'cmdline_proc_show:disable_event:initcall:initcall_finish' > \ set_ftrace_filter # 2. Enable the event registered, then: # 1) SOFT_DISABLED_BIT was cleared; # 2) trace_buffered_event_disable() was called first time; echo 1 > events/initcall/initcall_finish/enable # 3. Try to call into cmdline_proc_show(), then SOFT_DISABLED_BIT was # set again!!! cat /proc/cmdline # 4. Unregister the 'disable_event' command, then: # 1) SOFT_DISABLED_BIT was cleared again; # 2) trace_buffered_event_disable() was called second time!!! echo '!cmdline_proc_show:disable_event:initcall:initcall_finish' > \ set_ftrace_filter ``` To fix it, IIUC, we can change to call trace_buffered_event_enable() at fist time soft-mode enabled, and call trace_buffered_event_disable() at last time soft-mode disabled. Link: https://lore.kernel.org/linux-trace-kernel/20230726095804.920457-1-zhengyejian1@huawei.com Cc: Fixes: 0fc1b09ff1ff ("tracing: Use temp buffer when filtering events") Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit 122e7943b252fcf48b4d085dec084e24fc8bec45 Merge: 20d3f2417b41a 6c54312f9689f Author: Linus Torvalds Date: Fri Jul 28 17:19:52 2023 -0700 Merge tag 'mm-hotfixes-stable-2023-07-28-15-52' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull hotfixes from Andrew Morton: "11 hotfixes. Five are cc:stable and the remainder address post-6.4 issues or aren't considered serious enough to justify backporting" * tag 'mm-hotfixes-stable-2023-07-28-15-52' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm/memory-failure: fix hardware poison check in unpoison_memory() proc/vmcore: fix signedness bug in read_from_oldmem() mailmap: update remaining active codeaurora.org email addresses mm: lock VMA in dup_anon_vma() before setting ->anon_vma mm: fix memory ordering for mm_lock_seq and vm_lock_seq scripts/spelling.txt: remove 'thead' as a typo mm/pagewalk: fix EFI_PGT_DUMP of espfix area shmem: minor fixes to splice-read implementation tmpfs: fix Documentation of noswap and huge mount options Revert "um: Use swap() to make code cleaner" mm/damon/core-test: initialise context before test in damon_test_set_attrs() commit 20d3f2417b41a04510722144eb9a2d7ab53bd75b Merge: 3632f42176a9b ac4436a5b20e0 Author: Linus Torvalds Date: Fri Jul 28 17:14:05 2023 -0700 Merge tag 'thermal-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control fixes from Rafael Wysocki: "Constify thermal_zone_device_register() parameters, which was omitted by mistake, and fix a double free on thermal zone unregistration in the generic DT thermal driver (Ahmad Fatoum)" * tag 'thermal-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: of: fix double-free on unregistration thermal: core: constify params in thermal_zone_device_register commit 3632f42176a9baaa6959c59364c85d71e574c0c0 Merge: 2f4effd85fe92 4dd8752a14ca0 Author: Linus Torvalds Date: Fri Jul 28 17:08:59 2023 -0700 Merge tag 'pm-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "Fix the arming of wakeup IRQs in the generic wakeup IRQ code (wakeirq), drop unused functions from it and fix up a driver using it and trying to work around the IRQ arming issue in a questionable way (Johan Hovold)" * tag 'pm-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: serial: qcom-geni: drop bogus runtime pm state update PM: sleep: wakeirq: drop unused enable helpers PM: sleep: wakeirq: fix wake irq arming commit 2f4effd85fe9228a21bdfd037be006aa9bd7a617 Merge: c06f9091a2913 e146503ac6841 Author: Linus Torvalds Date: Fri Jul 28 17:02:11 2023 -0700 Merge tag 'hwmon-for-v6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - k10temp: Display negative temperatures for industrial processors - pmbus core: Fix deadlock, NULL pointer dereference, and chip enable detection - nct7802: Do not display PECI1 temperature if disabled - nct6775: Fix IN scaling factors and feature detection for NCT6798/6799 - oxp-sensors: Fix race condition during device attribute creation - aquacomputer_d5next: Fix incorrect PWM value readout * tag 'hwmon-for-v6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (k10temp) Enable AMD3255 Proc to show negative temperature hwmon: (pmbus_core) Fix Deadlock in pmbus_regulator_get_status hwmon: (pmbus_core) Fix NULL pointer dereference hwmon: (pmbus_core) Fix pmbus_is_enabled() hwmon: (nct7802) Fix for temp6 (PECI1) processed even if PECI1 disabled hwmon: (nct6775) Fix IN scaling factors for 6798/6799 hwmon: (oxp-sensors) Move tt_toggle attribute to dev_groups hwmon: (aquacomputer_d5next) Fix incorrect PWM value readout hwmon: (nct6775) Fix register for nct6799 commit 800959e697de0c55613a2ce40bca52520a421c9f Author: YueHaibing Date: Tue Jul 25 21:48:08 2023 +0800 ftrace: Remove unused extern declarations commit 6a9c981b1e96 ("ftrace: Remove unused function ftrace_arch_read_dyn_info()") left ftrace_arch_read_dyn_info() extern declaration. And commit 1d74f2a0f64b ("ftrace: remove ftrace_ip_converted()") leave ftrace_ip_converted() declaration. Link: https://lore.kernel.org/linux-trace-kernel/20230725134808.9716-1-yuehaibing@huawei.com Cc: Cc: Signed-off-by: YueHaibing Signed-off-by: Steven Rostedt (Google) commit 6c95d71bad61410e3717afcf7fd1837a8e03edf2 Author: Gaosheng Cui Date: Mon Jul 24 22:08:27 2023 +0800 tracing: Fix kernel-doc warnings in trace_seq.c Fix kernel-doc warning: kernel/trace/trace_seq.c:142: warning: Function parameter or member 'args' not described in 'trace_seq_vprintf' Link: https://lkml.kernel.org/r/20230724140827.1023266-5-cuigaosheng1@huawei.com Cc: Signed-off-by: Gaosheng Cui Signed-off-by: Steven Rostedt (Google) commit bd7217f30c7f08fc20f745aa1e2174eb3ff6d82a Author: Gaosheng Cui Date: Mon Jul 24 22:08:26 2023 +0800 tracing: Fix kernel-doc warnings in trace_events_trigger.c Fix kernel-doc warnings: kernel/trace/trace_events_trigger.c:59: warning: Function parameter or member 'buffer' not described in 'event_triggers_call' kernel/trace/trace_events_trigger.c:59: warning: Function parameter or member 'event' not described in 'event_triggers_call' Link: https://lkml.kernel.org/r/20230724140827.1023266-4-cuigaosheng1@huawei.com Cc: Signed-off-by: Gaosheng Cui Signed-off-by: Steven Rostedt (Google) commit b32c789f7dbbba3e55f6295ad64923cb69e6f563 Author: Gaosheng Cui Date: Mon Jul 24 22:08:25 2023 +0800 tracing/synthetic: Fix kernel-doc warnings in trace_events_synth.c Fix kernel-doc warning: kernel/trace/trace_events_synth.c:1257: warning: Function parameter or member 'mod' not described in 'synth_event_gen_cmd_array_start' Link: https://lkml.kernel.org/r/20230724140827.1023266-3-cuigaosheng1@huawei.com Cc: Signed-off-by: Gaosheng Cui Signed-off-by: Steven Rostedt (Google) commit 151e34d1c6eb2f9b4b0b9d085d1fa9f02cc74f48 Author: Gaosheng Cui Date: Mon Jul 24 22:08:24 2023 +0800 ring-buffer: Fix kernel-doc warnings in ring_buffer.c Fix kernel-doc warnings: kernel/trace/ring_buffer.c:954: warning: Function parameter or member 'cpu' not described in 'ring_buffer_wake_waiters' kernel/trace/ring_buffer.c:3383: warning: Excess function parameter 'event' description in 'ring_buffer_unlock_commit' kernel/trace/ring_buffer.c:5359: warning: Excess function parameter 'cpu' description in 'ring_buffer_reset_online_cpus' Link: https://lkml.kernel.org/r/20230724140827.1023266-2-cuigaosheng1@huawei.com Cc: Signed-off-by: Gaosheng Cui Signed-off-by: Steven Rostedt (Google) commit c06f9091a2913f9f76e68ce3e0a7f781546034b6 Merge: 2b17e90d3f92f ae463563b7a1b Author: Linus Torvalds Date: Fri Jul 28 16:55:56 2023 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Several smaller driver fixes and a core RDMA CM regression fix: - Fix improperly accepting flags from userspace in mlx4 - Add missing DMA barriers for irdma - Fix two kcsan warnings in irdma - Report the correct CQ op code to userspace in irdma - Report the correct MW bind error code for irdma - Load the destination address in RDMA CM to resolve a recent regression - Fix a QP regression in mthca - Remove a race processing completions in bnxt_re resulting in a crash - Fix driver unloading races with interrupts and tasklets in bnxt_re - Fix missing error unwind in rxe" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/irdma: Report correct WC error RDMA/irdma: Fix op_type reporting in CQEs RDMA/rxe: Fix an error handling path in rxe_bind_mw() RDMA/bnxt_re: Fix hang during driver unload RDMA/bnxt_re: Prevent handling any completions after qp destroy RDMA/mthca: Fix crash when polling CQ for shared QPs RDMA/core: Update CMA destination address on rdma_resolve_addr RDMA/irdma: Fix data race on CQP request done RDMA/irdma: Fix data race on CQP completion stats RDMA/irdma: Add missing read barriers RDMA/mlx4: Make check for invalid flags stricter commit 2b17e90d3f92f394a6dea9243aac70a5aa0d0c57 Merge: f837f0a3c9488 513253f8c293c Author: Linus Torvalds Date: Fri Jul 28 16:44:32 2023 -0700 Merge tag 'tpmdd-v6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull tpm fixes from Jarkko Sakkinen: "I picked up three small scale updates that I think would improve the quality of the release" * tag 'tpmdd-v6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: tpm_tis: Explicitly check for error code tpm: Switch i2c drivers back to use .probe() security: keys: perform capable check only on privileged operations commit 2d093282b0d4357373497f65db6a05eb0c28b7c8 Author: Zheng Yejian Date: Mon Jul 24 13:40:40 2023 +0800 ring-buffer: Fix wrong stat of cpu_buffer->read When pages are removed in rb_remove_pages(), 'cpu_buffer->read' is set to 0 in order to make sure any read iterators reset themselves. However, this will mess 'entries' stating, see following steps: # cd /sys/kernel/tracing/ # 1. Enlarge ring buffer prepare for later reducing: # echo 20 > per_cpu/cpu0/buffer_size_kb # 2. Write a log into ring buffer of cpu0: # taskset -c 0 echo "hello1" > trace_marker # 3. Read the log: # cat per_cpu/cpu0/trace_pipe <...>-332 [000] ..... 62.406844: tracing_mark_write: hello1 # 4. Stop reading and see the stats, now 0 entries, and 1 event readed: # cat per_cpu/cpu0/stats entries: 0 [...] read events: 1 # 5. Reduce the ring buffer # echo 7 > per_cpu/cpu0/buffer_size_kb # 6. Now entries became unexpected 1 because actually no entries!!! # cat per_cpu/cpu0/stats entries: 1 [...] read events: 0 To fix it, introduce 'page_removed' field to count total removed pages since last reset, then use it to let read iterators reset themselves instead of changing the 'read' pointer. Link: https://lore.kernel.org/linux-trace-kernel/20230724054040.3489499-1-zhengyejian1@huawei.com Cc: Cc: Fixes: 83f40318dab0 ("ring-buffer: Make removal of ring buffer pages atomic") Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit ad64f5952ce3ea565c7f76ec37ab41df0dde773a Author: Davidlohr Bueso Date: Tue Jul 25 22:19:40 2023 -0700 cxl/memdev: Only show sanitize sysfs files when supported If the device does not support Sanitize or Secure Erase commands, hide the respective sysfs interfaces such that the operation can never be attempted. In order to be generic, keep track of the enabled security commands found in the CEL - the driver does not support Security Passthrough. Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20230726051940.3570-4-dave@stgolabs.net Reviewed-by: Dave Jiang Signed-off-by: Vishal Verma commit 3de8cd2242419fb0adaee629d488acfd6cd93c92 Author: Davidlohr Bueso Date: Tue Jul 25 22:19:39 2023 -0700 cxl/memdev: Document security state in kern-doc ... as is the case with all members of struct cxl_memdev_state. Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20230726051940.3570-3-dave@stgolabs.net Reviewed-by: Dave Jiang Signed-off-by: Vishal Verma commit 0fcde5989e8a54b2a155d8bcea21a7f99abb50f9 Author: Davidlohr Bueso Date: Tue Jul 25 22:19:38 2023 -0700 cxl/memdev: Improve sanitize ABI descriptions Be more detailed about the CPU cache management situation. The same goes for both sanitize and secure erase. Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20230726051940.3570-2-dave@stgolabs.net Reviewed-by: Dave Jiang Signed-off-by: Vishal Verma commit 98ce8e4a9dcfb448b30a2d7a16190f4a00382377 Author: Georg Müller Date: Fri Jul 28 17:18:12 2023 +0200 perf test uprobe_from_different_cu: Skip if there is no gcc Without gcc, the test will fail. On cleanup, ignore probe removal errors. Otherwise, in case of an error adding the probe, the temporary directory is not removed. Fixes: 56cbeacf14353057 ("perf probe: Add test for regression introduced by switch to die_get_decl_file()") Signed-off-by: Georg Müller Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Georg Müller Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230728151812.454806-2-georgmueller@gmx.net Link: https://lore.kernel.org/r/CAP-5=fUP6UuLgRty3t2=fQsQi3k4hDMz415vWdp1x88QMvZ8ug@mail.gmail.com/ Signed-off-by: Arnaldo Carvalho de Melo commit f837f0a3c94882a29e38ff211a36c1c8a0f07804 Merge: 81eef8909d171 003e6b56d7800 Author: Linus Torvalds Date: Fri Jul 28 11:21:57 2023 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - A couple of SME updates for recent fixes (one of which went to stable): reverting the flushing of the SME hardware state along with the thread flushing and making sure we have the correct vector length before reallocating. - An ACPI/IORT fix to avoid skipping ID mappings whose "number of IDs" is 0 (the spec reports the number of IDs in the mapping range minus 1). * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: ACPI/IORT: Remove erroneous id_count check in iort_node_get_rmr_info() arm64/sme: Set new vector length before reallocating arm64/fpsimd: Don't flush SME register hardware state along with thread commit 81eef8909d171bdca6af37028a11a24e011ed312 Merge: e62e26d3e9ab8 c04e9894846c6 Author: Linus Torvalds Date: Fri Jul 28 11:17:30 2023 -0700 Merge tag 'for-linus-6.5a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: - A fix for a performance problem in QubesOS, adding a way to drain the queue of grants experiencing delayed unmaps faster - A patch enabling the use of static event channels from user mode, which was omitted when introducing supporting static event channels - A fix for a problem where Xen related code didn't check properly for running in a Xen environment, resulting in a WARN splat * tag 'for-linus-6.5a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: speed up grant-table reclaim xen/evtchn: Introduce new IOCTL to bind static evtchn xenbus: check xen_domain in xenbus_probe_initcall commit 513253f8c293c0c8bd46d09d337fc892bf8f9f48 Author: Alexander Steffen Date: Tue Jun 13 20:02:56 2023 +0200 tpm_tis: Explicitly check for error code recv_data either returns the number of received bytes, or a negative value representing an error code. Adding the return value directly to the total number of received bytes therefore looks a little weird, since it might add a negative error code to a sum of bytes. The following check for size < expected usually makes the function return ETIME in that case, so it does not cause too many problems in practice. But to make the code look cleaner and because the caller might still be interested in the original error code, explicitly check for the presence of an error code and pass that through. Cc: stable@vger.kernel.org Fixes: cb5354253af2 ("[PATCH] tpm: spacing cleanups 2") Signed-off-by: Alexander Steffen Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit be6f48a7c8e44a15ffc95f6f323dec548a4b990e Author: Uwe Kleine-König Date: Thu May 25 22:24:24 2023 +0200 tpm: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 2d7f105edbb3b2be5ffa4d833abbf9b6965e9ce7 Author: Christian Göttsche Date: Thu May 11 14:32:52 2023 +0200 security: keys: perform capable check only on privileged operations If the current task fails the check for the queried capability via `capable(CAP_SYS_ADMIN)` LSMs like SELinux generate a denial message. Issuing such denial messages unnecessarily can lead to a policy author granting more privileges to a subject than needed to silence them. Reorder CAP_SYS_ADMIN checks after the check whether the operation is actually privileged. Signed-off-by: Christian Göttsche Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit e62e26d3e9ab89a0d40f94b237676b7e540d6d5c Merge: 28d79b746cf46 588159009d5b7 Author: Linus Torvalds Date: Fri Jul 28 10:47:24 2023 -0700 Merge tag 'ceph-for-6.5-rc4' of https://github.com/ceph/ceph-client Pull ceph fixes from Ilya Dryomov: "A patch to reduce the potential for erroneous RBD exclusive lock blocklisting (fencing) with a couple of prerequisites and a fixup to prevent metrics from being sent to the MDS even just once after that has been disabled by the user. All marked for stable" * tag 'ceph-for-6.5-rc4' of https://github.com/ceph/ceph-client: rbd: retrieve and check lock owner twice before blocklisting rbd: harden get_lock_owner_info() a bit rbd: make get_lock_owner_info() return a single locker or NULL ceph: never send metrics if disable_send_metrics is set commit 28d79b746cf46e48e5c38c6904ea5faac217da21 Merge: 818680d154170 e6ab0b914c12a Author: Linus Torvalds Date: Fri Jul 28 10:43:16 2023 -0700 Merge tag '9p-fixes-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs Pull 9p fixes from Eric Van Hensbergen: "Misc set of fixes for 9p. Most of these clean up warnings we've gotten out of compilation tools, but several of them were from inspection while hunting down a couple of regressions. The most important one is 75b396821cb7 ("fs/9p: remove unnecessary and overrestrictive check") which caused a regression for some folks by restricting mmap in any case where writeback caches weren't enabled. Most of the other bugs caught via inspection were type mismatches" * tag '9p-fixes-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs: fs/9p: Remove unused extern declaration 9p: remove dead stores (variable set again without being read) 9p: virtio: skip incrementing unused variable 9p: virtio: make sure 'offs' is initialized in zc_request 9p: virtio: fix unlikely null pointer deref in handle_rerror 9p: fix ignored return value in v9fs_dir_release fs/9p: remove unnecessary invalidate_inode_pages2 fs/9p: fix type mismatch in file cache mode helper fs/9p: fix typo in comparison logic for cache mode fs/9p: remove unnecessary and overrestrictive check fs/9p: Fix a datatype used with V9FS_DIRECT_IO commit 818680d154170b4e41dc0c1a10e20bc03ca14a00 Merge: 9c65505826395 3e9dce80dbf91 Author: Linus Torvalds Date: Fri Jul 28 10:23:41 2023 -0700 Merge tag 'block-6.5-2023-07-28' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: "A few fixes that should go into the current kernel release, mainly: - Set of fixes for dasd (Stefan) - Handle interruptible waits returning because of a signal for ublk (Ming)" * tag 'block-6.5-2023-07-28' of git://git.kernel.dk/linux: ublk: return -EINTR if breaking from waiting for existed users in DEL_DEV ublk: fail to recover device if queue setup is interrupted ublk: fail to start device if queue setup is interrupted block: Fix a source code comment in include/uapi/linux/blkzoned.h s390/dasd: print copy pair message only for the correct error s390/dasd: fix hanging device after request requeue s390/dasd: use correct number of retries for ERP requests s390/dasd: fix hanging device after quiesce/resume commit 9c65505826395e1193495ad73087bcdaa4347813 Merge: 0299a13af0be4 7b72d661f1f2f Author: Linus Torvalds Date: Fri Jul 28 10:19:44 2023 -0700 Merge tag 'io_uring-6.5-2023-07-28' of git://git.kernel.dk/linux Pull io_uring fix from Jens Axboe: "Just a single tweak to a patch from last week, to avoid having idle cqring waits be attributed as iowait" * tag 'io_uring-6.5-2023-07-28' of git://git.kernel.dk/linux: io_uring: gate iowait schedule on having pending requests commit 0299a13af0be43f2679047c7236e3a58e587f3f8 Merge: c75981a1be350 b7c822fa6b770 Author: Linus Torvalds Date: Fri Jul 28 10:15:44 2023 -0700 Merge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd Pull iommufd fixes from Jason Gunthorpe: "Two user triggerable problems: - Syzkaller found a way to trigger a WARN_ON and leak memory by racing destroy with other actions - There is still a bug in the "batch carry" stuff that gets invoked for complex cases with accesses and unmapping of huge pages. The test suite found this (triggers rarely)" * tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd: iommufd: Set end correctly when doing batch carry iommufd: IOMMUFD_DESTROY should not increase the refcount commit 74158a8cad79d2f5dcf71508993664c5cfcbfa3c Author: Oliver Upton Date: Fri Jul 28 00:08:24 2023 +0000 KVM: arm64: Skip instruction after emulating write to TCR_EL1 Whelp, this is embarrassing. Since commit 082fdfd13841 ("KVM: arm64: Prevent guests from enabling HA/HD on Ampere1") KVM traps writes to TCR_EL1 on AmpereOne to work around an erratum in the unadvertised HAFDBS implementation, preventing the guest from enabling the feature. Unfortunately, I failed virtualization 101 when working on that change, and forgot to advance PC after instruction emulation. Do the right thing and skip the MSR instruction after emulating the write. Fixes: 082fdfd13841 ("KVM: arm64: Prevent guests from enabling HA/HD on Ampere1") Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20230728000824.3848025-1-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit c75981a1be350f14dbfca56e62bea077dafdad96 Merge: 6fb9f7f839e09 1e4ab7b4c881c Author: Linus Torvalds Date: Fri Jul 28 10:08:49 2023 -0700 Merge tag 'for-6.5/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - Fix double free on memory allocation failure in DM integrity target's integrity_recalc() - Fix locking in DM raid target's raid_ctr() and around call to md_stop() - Fix DM cache target's cleaner policy to always allow work to be queued for writeback; even if cache isn't idle. * tag 'for-6.5/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm cache policy smq: ensure IO doesn't prevent cleaner policy progress dm raid: protect md_stop() with 'reconfig_mutex' dm raid: clean up four equivalent goto tags in raid_ctr() dm raid: fix missing reconfig_mutex unlock in raid_ctr() error paths dm integrity: fix double free on memory allocation failure commit 6fb9f7f839e0928dd15e68d4006729d1a9782c75 Merge: 17bf3df9af08c 3b9adfbba5af9 Author: Linus Torvalds Date: Fri Jul 28 10:04:40 2023 -0700 Merge tag 'sound-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of device-specific small fixes such as ASoC Realtek codec fixes for PM issues, ASoC nau8821 quirk additions, and usual HD- and USB-audio quirks" * tag 'sound-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek: Support ASUS G713PV laptop ALSA: usb-audio: Update for native DSD support quirks ALSA: usb-audio: Add quirk for Microsoft Modern Wireless Headset ALSA: hda/relatek: Enable Mute LED on HP 250 G8 ASoC: atmel: Fix the 8K sample parameter in I2SC master ASoC: rt711-sdca: fix for JD event handling in ClockStop Mode0 ASoC: rt711: fix for JD event handling in ClockStop Mode0 ASoC: rt722-sdca: fix for JD event handling in ClockStop Mode0 ASoC: rt712-sdca: fix for JD event handling in ClockStop Mode0 ASoc: codecs: ES8316: Fix DMIC config ASoC: rt5682-sdw: fix for JD event handling in ClockStop Mode0 ASoC: wm8904: Fill the cache for WM8904_ADC_TEST_0 register ASoC: nau8821: Add DMI quirk mechanism for active-high jack-detect ASoC: da7219: Check for failure reading AAD IRQ events ASoC: da7219: Flush pending AAD IRQ when suspending ALSA: seq: remove redundant unsigned comparison to zero ASoC: fsl_spdif: Silence output on stop commit 17bf3df9af08c5e87c07a92b811b7f9f8034a32c Merge: f24767ca4f004 9a767faa9477e Author: Linus Torvalds Date: Fri Jul 28 09:59:39 2023 -0700 Merge tag 'drm-fixes-2023-07-28' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Regular scheduled fixes, msm and amdgpu leading the way, with some i915 and a single misc fbdev, all seems fine. fbdev: - remove unused function amdgpu: - gfxhub partition fix - Fix error handling in psp_sw_init() - SMU13 fix - DCN 3.1 fix - DCN 3.2 fix - Fix for display PHY programming sequence - DP MST error handling fix - GFX 9.4.3 fix amdkfd: - GFX11 trap handling fix i915: - Use shmem for dpt objects - Fix an error handling path in igt_write_huge() msm: - display: - Fix to correct the UBWC programming for decoder version 4.3 seen on SM8550 - Add the missing flush and fetch bits for DMA4 and DMA5 SSPPs. - Fix to drop the unused dpu_core_perf_data_bus_id enum from the code - Drop the unused dsi_phy_14nm_17mA_regulators from QCM 2290 DSI cfg. - gpu: - Fix warn splat for newer devices without revn - Remove name/revn for a690.. we shouldn't be populating these for newer devices, for consistency, but it slipped through review - Fix a6xx gpu snapshot BINDLESS_DATA size (was listed in bytes instead of dwords, causing AHB faults on a6xx gen4/a660-family) - Disallow submit with fence id 0" * tag 'drm-fixes-2023-07-28' of git://anongit.freedesktop.org/drm/drm: (22 commits) drm/msm: Disallow submit with fence id 0 drm/amdgpu: Restore HQD persistent state register drm/amd/display: Unlock on error path in dm_handle_mst_sideband_msg_ready_event() drm/amd/display: Exit idle optimizations before attempt to access PHY drm/amd/display: Don't apply FIFO resync W/A if rdivider = 0 drm/amd/display: Guard DCN31 PHYD32CLK logic against chip family drm/amd/smu: use AverageGfxclkFrequency* to replace previous GFX Curr Clock drm/amd: Fix an error handling mistake in psp_sw_init() drm/amdgpu: Fix infinite loop in gfxhub_v1_2_xcc_gart_enable (v2) drm/amdkfd: fix trap handling work around for debugging drm/fb-helper: Remove unused inline function drm_fb_helper_defio_init() drm/i915: Fix an error handling path in igt_write_huge() drm/i915/dpt: Use shmem for dpt objects drm/msm: Fix hw_fence error path cleanup drm/msm: Fix IS_ERR_OR_NULL() vs NULL check in a5xx_submit_in_rb() drm/msm/adreno: Fix snapshot BINDLESS_DATA size drm/msm/a690: Remove revn and name drm/msm/adreno: Fix warn splat for devices without revn drm/msm/dsi: Drop unused regulators from QCM2290 14nm DSI PHY config drm/msm/dpu: drop enum dpu_core_perf_data_bus_id ... commit f24767ca4f004f6a34411229a84394e1b94deae7 Merge: c442a957b2f4e 70d49bbf962ce Author: Linus Torvalds Date: Fri Jul 28 09:50:04 2023 -0700 Merge tag 'cxl-fixes-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl Pull cxl fixes from Vishal Verma: - Update MAINTAINERS for cxl - A few static analysis fixes - Fix a Kconfig dependency for CONFIG_FW_LOADER * tag 'cxl-fixes-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: tools/testing/cxl: Remove unused SZ_512G macro cxl/acpi: Return 'rc' instead of '0' in cxl_parse_cfmws() cxl/acpi: Fix a use-after-free in cxl_parse_cfmws() cxl: Update MAINTAINERS cxl/mem: Fix a double shift bug cxl: fix CONFIG_FW_LOADER dependency commit c442a957b2f4e116f28aeb55bf2719cb7bb2ad60 Author: Mike Rapoport (IBM) Date: Fri Jul 28 13:55:12 2023 +0300 Revert "mm,memblock: reset memblock.reserved to system init state to prevent UAF" This reverts commit 9e46e4dcd9d6cd88342b028dbfa5f4fb7483d39c. kbuild reports a warning in memblock_remove_region() because of a false positive caused by partial reset of the memblock state. Doing the full reset will remove the false positives, but will allow late use of memblock_free() to go unnoticed, so it is better to revert the offending commit. WARNING: CPU: 0 PID: 1 at mm/memblock.c:352 memblock_remove_region (kbuild/src/x86_64/mm/memblock.c:352 (discriminator 1)) Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.5.0-rc3-00001-g9e46e4dcd9d6 #2 RIP: 0010:memblock_remove_region (kbuild/src/x86_64/mm/memblock.c:352 (discriminator 1)) Call Trace: memblock_discard (kbuild/src/x86_64/mm/memblock.c:383) page_alloc_init_late (kbuild/src/x86_64/include/linux/find.h:208 kbuild/src/x86_64/include/linux/nodemask.h:266 kbuild/src/x86_64/mm/mm_init.c:2405) kernel_init_freeable (kbuild/src/x86_64/init/main.c:1325 kbuild/src/x86_64/init/main.c:1546) kernel_init (kbuild/src/x86_64/init/main.c:1439) ret_from_fork (kbuild/src/x86_64/arch/x86/kernel/process.c:145) ret_from_fork_asm (kbuild/src/x86_64/arch/x86/entry/entry_64.S:298) Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202307271656.447aa17e-oliver.sang@intel.com Signed-off-by: "Mike Rapoport (IBM)" Signed-off-by: Linus Torvalds commit 6c21e066f9256ea1df6f88768f6ae1080b7cf509 Author: Jann Horn Date: Fri Jul 28 06:13:21 2023 +0200 mm/mempolicy: Take VMA lock before replacing policy mbind() calls down into vma_replace_policy() without taking the per-VMA locks, replaces the VMA's vma->vm_policy pointer, and frees the old policy. That's bad; a concurrent page fault might still be using the old policy (in vma_alloc_folio()), resulting in use-after-free. Normally this will manifest as a use-after-free read first, but it can result in memory corruption, including because vma_alloc_folio() can call mpol_cond_put() on the freed policy, which conditionally changes the policy's refcount member. This bug is specific to CONFIG_NUMA, but it does also affect non-NUMA systems as long as the kernel was built with CONFIG_NUMA. Signed-off-by: Jann Horn Reviewed-by: Suren Baghdasaryan Fixes: 5e31275cc997 ("mm: add per-VMA lock and helper functions to control it") Cc: stable@kernel.org Signed-off-by: Linus Torvalds commit ee31742bf17636da1304af77b2cb1c29b5dda642 Author: Alexander Stein Date: Mon May 15 09:21:37 2023 +0200 drm/imx/ipuv3: Fix front porch adjustment upon hactive aligning When hactive is not aligned to 8 pixels, it is aligned accordingly and hfront porch needs to be reduced the same amount. Unfortunately the front porch is set to the difference rather than reducing it. There are some Samsung TVs which can't cope with a front porch of instead of 70. Fixes: 94dfec48fca7 ("drm/imx: Add 8 pixel alignment fix") Signed-off-by: Alexander Stein Reviewed-by: Philipp Zabel Link: https://lore.kernel.org/r/20230515072137.116211-1-alexander.stein@ew.tq-group.com [p.zabel@pengutronix.de: Fixed subject] Signed-off-by: Philipp Zabel Link: https://patchwork.freedesktop.org/patch/msgid/20230515072137.116211-1-alexander.stein@ew.tq-group.com commit 003e6b56d780095a9adc23efc9cb4b4b4717169b Author: Guanghui Feng Date: Mon Jul 17 19:33:45 2023 +0800 ACPI/IORT: Remove erroneous id_count check in iort_node_get_rmr_info() According to the ARM IORT specifications DEN 0049 issue E, the "Number of IDs" field in the ID mapping format reports the number of IDs in the mapping range minus one. In iort_node_get_rmr_info(), we erroneously skip ID mappings whose "Number of IDs" equal to 0, resulting in valid mapping nodes with a single ID to map being skipped, which is wrong. Fix iort_node_get_rmr_info() by removing the bogus id_count check. Fixes: 491cf4a6735a ("ACPI/IORT: Add support to retrieve IORT RMR reserved regions") Signed-off-by: Guanghui Feng Cc: # 6.0.x Acked-by: Lorenzo Pieralisi Tested-by: Hanjun Guo Link: https://lore.kernel.org/r/1689593625-45213-1-git-send-email-guanghuifeng@linux.alibaba.com Signed-off-by: Catalin Marinas commit eac27a41ab641de074655d2932fc7f8cdb446881 Author: Remi Pommarel Date: Fri Jul 28 15:38:50 2023 +0200 batman-adv: Do not get eth header before batadv_check_management_packet If received skb in batadv_v_elp_packet_recv or batadv_v_ogm_packet_recv is either cloned or non linearized then its data buffer will be reallocated by batadv_check_management_packet when skb_cow or skb_linearize get called. Thus geting ethernet header address inside skb data buffer before batadv_check_management_packet had any chance to reallocate it could lead to the following kernel panic: Unable to handle kernel paging request at virtual address ffffff8020ab069a Mem abort info: ESR = 0x96000007 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x07: level 3 translation fault Data abort info: ISV = 0, ISS = 0x00000007 CM = 0, WnR = 0 swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000040f45000 [ffffff8020ab069a] pgd=180000007fffa003, p4d=180000007fffa003, pud=180000007fffa003, pmd=180000007fefe003, pte=0068000020ab0706 Internal error: Oops: 96000007 [#1] SMP Modules linked in: ahci_mvebu libahci_platform libahci dvb_usb_af9035 dvb_usb_dib0700 dib0070 dib7000m dibx000_common ath11k_pci ath10k_pci ath10k_core mwl8k_new nf_nat_sip nf_conntrack_sip xhci_plat_hcd xhci_hcd nf_nat_pptp nf_conntrack_pptp at24 sbsa_gwdt CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 5.15.42-00066-g3242268d425c-dirty #550 Hardware name: A8k (DT) pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : batadv_is_my_mac+0x60/0xc0 lr : batadv_v_ogm_packet_recv+0x98/0x5d0 sp : ffffff8000183820 x29: ffffff8000183820 x28: 0000000000000001 x27: ffffff8014f9af00 x26: 0000000000000000 x25: 0000000000000543 x24: 0000000000000003 x23: ffffff8020ab0580 x22: 0000000000000110 x21: ffffff80168ae880 x20: 0000000000000000 x19: ffffff800b561000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 00dc098924ae0032 x14: 0f0405433e0054b0 x13: ffffffff00000080 x12: 0000004000000001 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : 0000000000000000 x7 : ffffffc076dae000 x6 : ffffff8000183700 x5 : ffffffc00955e698 x4 : ffffff80168ae000 x3 : ffffff80059cf000 x2 : ffffff800b561000 x1 : ffffff8020ab0696 x0 : ffffff80168ae880 Call trace: batadv_is_my_mac+0x60/0xc0 batadv_v_ogm_packet_recv+0x98/0x5d0 batadv_batman_skb_recv+0x1b8/0x244 __netif_receive_skb_core.isra.0+0x440/0xc74 __netif_receive_skb_one_core+0x14/0x20 netif_receive_skb+0x68/0x140 br_pass_frame_up+0x70/0x80 br_handle_frame_finish+0x108/0x284 br_handle_frame+0x190/0x250 __netif_receive_skb_core.isra.0+0x240/0xc74 __netif_receive_skb_list_core+0x6c/0x90 netif_receive_skb_list_internal+0x1f4/0x310 napi_complete_done+0x64/0x1d0 gro_cell_poll+0x7c/0xa0 __napi_poll+0x34/0x174 net_rx_action+0xf8/0x2a0 _stext+0x12c/0x2ac run_ksoftirqd+0x4c/0x7c smpboot_thread_fn+0x120/0x210 kthread+0x140/0x150 ret_from_fork+0x10/0x20 Code: f9403844 eb03009f 54fffee1 f94 Thus ethernet header address should only be fetched after batadv_check_management_packet has been called. Fixes: 0da0035942d4 ("batman-adv: OGMv2 - add basic infrastructure") Cc: stable@vger.kernel.org Signed-off-by: Remi Pommarel Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 41a506ef71eb38d94fe133f565c87c3e06ccc072 Author: Naveen N Rao Date: Wed Jun 21 10:43:49 2023 +0530 powerpc/ftrace: Create a dummy stackframe to fix stack unwind With ppc64 -mprofile-kernel and ppc32 -pg, profiling instructions to call into ftrace are emitted right at function entry. The instruction sequence used is minimal to reduce overhead. Crucially, a stackframe is not created for the function being traced. This breaks stack unwinding since the function being traced does not have a stackframe for itself. As such, it never shows up in the backtrace: /sys/kernel/debug/tracing # echo 1 > /proc/sys/kernel/stack_tracer_enabled /sys/kernel/debug/tracing # cat stack_trace Depth Size Location (17 entries) ----- ---- -------- 0) 4144 32 ftrace_call+0x4/0x44 1) 4112 432 get_page_from_freelist+0x26c/0x1ad0 2) 3680 496 __alloc_pages+0x290/0x1280 3) 3184 336 __folio_alloc+0x34/0x90 4) 2848 176 vma_alloc_folio+0xd8/0x540 5) 2672 272 __handle_mm_fault+0x700/0x1cc0 6) 2400 208 handle_mm_fault+0xf0/0x3f0 7) 2192 80 ___do_page_fault+0x3e4/0xbe0 8) 2112 160 do_page_fault+0x30/0xc0 9) 1952 256 data_access_common_virt+0x210/0x220 10) 1696 400 0xc00000000f16b100 11) 1296 384 load_elf_binary+0x804/0x1b80 12) 912 208 bprm_execve+0x2d8/0x7e0 13) 704 64 do_execveat_common+0x1d0/0x2f0 14) 640 160 sys_execve+0x54/0x70 15) 480 64 system_call_exception+0x138/0x350 16) 416 416 system_call_common+0x160/0x2c4 Fix this by having ftrace create a dummy stackframe for the function being traced. With this, backtraces now capture the function being traced: /sys/kernel/debug/tracing # cat stack_trace Depth Size Location (17 entries) ----- ---- -------- 0) 3888 32 _raw_spin_trylock+0x8/0x70 1) 3856 576 get_page_from_freelist+0x26c/0x1ad0 2) 3280 64 __alloc_pages+0x290/0x1280 3) 3216 336 __folio_alloc+0x34/0x90 4) 2880 176 vma_alloc_folio+0xd8/0x540 5) 2704 416 __handle_mm_fault+0x700/0x1cc0 6) 2288 96 handle_mm_fault+0xf0/0x3f0 7) 2192 48 ___do_page_fault+0x3e4/0xbe0 8) 2144 192 do_page_fault+0x30/0xc0 9) 1952 608 data_access_common_virt+0x210/0x220 10) 1344 16 0xc0000000334bbb50 11) 1328 416 load_elf_binary+0x804/0x1b80 12) 912 64 bprm_execve+0x2d8/0x7e0 13) 848 176 do_execveat_common+0x1d0/0x2f0 14) 672 192 sys_execve+0x54/0x70 15) 480 64 system_call_exception+0x138/0x350 16) 416 416 system_call_common+0x160/0x2c4 This results in two additional stores in the ftrace entry code, but produces reliable backtraces. Fixes: 153086644fd1 ("powerpc/ftrace: Add support for -mprofile-kernel ftrace ABI") Cc: stable@vger.kernel.org Signed-off-by: Naveen N Rao Signed-off-by: Michael Ellerman Link: https://msgid.link/20230621051349.759567-1-naveen@kernel.org commit 5416d7925e6ee72bf1d35cad1957c9a194554da4 Author: Eugen Hristev Date: Wed Jul 26 10:06:15 2023 +0300 dt-bindings: net: rockchip-dwmac: fix {tx|rx}-delay defaults/range in schema The range and the defaults are specified in the description instead of being specified in the schema. Fix it by adding the default value in the `default` field and specifying the range as `minimum` and `maximum`. Fixes: b331b8ef86f0 ("dt-bindings: net: convert rockchip-dwmac to json-schema") Signed-off-by: Eugen Hristev Signed-off-by: David S. Miller commit 6d00f4ec1205a01a6aac1fe3ce04d53a6b2ede59 Author: Laurent Pinchart Date: Tue Jun 6 18:55:30 2023 +0200 media: uvcvideo: Fix menu count handling for userspace XU mappings When commit 716c330433e3 ("media: uvcvideo: Use standard names for menus") reworked the handling of menu controls, it inadvertently replaced a GENMASK(n - 1, 0) with a BIT_MASK(n). The latter isn't equivalent to the former, which broke adding XU mappings from userspace. Fix it. Link: https://lore.kernel.org/linux-media/468a36ec-c3ac-cb47-e12f-5906239ae3cd@spahan.ch/ Cc: stable@vger.kernel.org Reported-by: Poncho Fixes: 716c330433e3 ("media: uvcvideo: Use standard names for menus") Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab commit 8329d0c7355bfb7237baf09ec979c3e8144d2781 Author: Chen-Yu Tsai Date: Mon Jul 10 08:51:36 2023 +0200 media: mtk-jpeg: Set platform driver data earlier In the multi-core JPEG encoder/decoder setup, the driver for the individual cores references the parent device's platform driver data. However, in the parent driver, this is only set at the end of the probe function, way later than devm_of_platform_populate(), which triggers the probe of the cores. This causes a kernel splat in the sub-device probe function. Move platform_set_drvdata() to before devm_of_platform_populate() to fix this. Fixes: 934e8bccac95 ("mtk-jpegenc: support jpegenc multi-hardware") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6722b25712054c0f903b839b8f5088438dd04df3 Author: Aneesh Kumar K.V Date: Mon Jul 24 23:43:20 2023 +0530 powerpc/mm/altmap: Fix altmap boundary check altmap->free includes the entire free space from which altmap blocks can be allocated. So when checking whether the kernel is doing altmap block free, compute the boundary correctly, otherwise memory hotunplug can fail. Fixes: 9ef34630a461 ("powerpc/mm: Fallback to RAM if the altmap is unusable") Signed-off-by: "Aneesh Kumar K.V" Reviewed-by: David Hildenbrand Signed-off-by: Michael Ellerman Link: https://msgid.link/20230724181320.471386-1-aneesh.kumar@linux.ibm.com commit 4a0822608e6aafdcb67ea0aaaa516b67826d1119 Merge: dadc5b86cc945 53d737dfd3d7b Author: Jakub Kicinski Date: Thu Jul 27 20:03:40 2023 -0700 Merge tag 'mlx5-fixes-2023-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2023-07-26 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2023-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5: Unregister devlink params in case interface is down net/mlx5: DR, Fix peer domain namespace setting net/mlx5: fs_chains: Fix ft prio if ignore_flow_level is not supported net/mlx5e: kTLS, Fix protection domain in use syndrome when devlink reload net/mlx5: Bridge, set debugfs access right to root-only net/mlx5e: xsk: Fix crash on regular rq reactivation net/mlx5e: xsk: Fix invalid buffer access for legacy rq net/mlx5e: Move representor neigh cleanup to profile cleanup_tx net/mlx5e: Fix crash moving to switchdev mode when ntuple offload is set net/mlx5e: Don't hold encap tbl lock if there is no encap action net/mlx5: Honor user input for migratable port fn attr net/mlx5e: fix return value check in mlx5e_ipsec_remove_trailer() net/mlx5: fix potential memory leak in mlx5e_init_rep_rx net/mlx5: DR, fix memory leak in mlx5dr_cmd_create_reformat_ctx net/mlx5e: fix double free in macsec_fs_tx_create_crypto_table_groups ==================== Link: https://lore.kernel.org/r/20230726213206.47022-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit dadc5b86cc9459581f37fe755b431adc399ea393 Author: Yuanjun Gong Date: Thu Jul 27 01:05:06 2023 +0800 net: dsa: fix value check in bcm_sf2_sw_probe() in bcm_sf2_sw_probe(), check the return value of clk_prepare_enable() and return the error code if clk_prepare_enable() returns an unexpected value. Fixes: e9ec5c3bd238 ("net: dsa: bcm_sf2: request and handle clocks") Signed-off-by: Yuanjun Gong Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20230726170506.16547-1-ruc_gongyuanjun@163.com Signed-off-by: Jakub Kicinski commit 4d50e50045aa46d9f3e578ed2edea9bd0a123d24 Author: Eric Dumazet Date: Wed Jul 26 14:58:15 2023 +0000 net: flower: fix stack-out-of-bounds in fl_set_key_cfm() Typical misuse of nla_parse_nested(array, XXX_MAX, ...); array must be declared as struct nlattr *array[XXX_MAX + 1]; v2: Based on feedbacks from Ido Schimmel and Zahari Doychev, I also changed TCA_FLOWER_KEY_CFM_OPT_MAX and cfm_opt_policy definitions. syzbot reported: BUG: KASAN: stack-out-of-bounds in __nla_validate_parse+0x136/0x2bd0 lib/nlattr.c:588 Write of size 32 at addr ffffc90003a0ee20 by task syz-executor296/5014 CPU: 0 PID: 5014 Comm: syz-executor296 Not tainted 6.5.0-rc2-syzkaller-00307-gd192f5382581 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:187 __asan_memset+0x23/0x40 mm/kasan/shadow.c:84 __nla_validate_parse+0x136/0x2bd0 lib/nlattr.c:588 __nla_parse+0x40/0x50 lib/nlattr.c:700 nla_parse_nested include/net/netlink.h:1262 [inline] fl_set_key_cfm+0x1e3/0x440 net/sched/cls_flower.c:1718 fl_set_key+0x2168/0x6620 net/sched/cls_flower.c:1884 fl_tmplt_create+0x1fe/0x510 net/sched/cls_flower.c:2666 tc_chain_tmplt_add net/sched/cls_api.c:2959 [inline] tc_ctl_chain+0x131d/0x1ac0 net/sched/cls_api.c:3068 rtnetlink_rcv_msg+0x82b/0xf50 net/core/rtnetlink.c:6424 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2549 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365 netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1914 sock_sendmsg_nosec net/socket.c:725 [inline] sock_sendmsg net/socket.c:748 [inline] ____sys_sendmsg+0x592/0x890 net/socket.c:2494 ___sys_sendmsg net/socket.c:2548 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2577 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f54c6150759 Code: 48 83 c4 28 c3 e8 d7 19 00 00 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffe06c30578 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f54c619902d RCX: 00007f54c6150759 RDX: 0000000000000000 RSI: 0000000020000280 RDI: 0000000000000003 RBP: 00007ffe06c30590 R08: 0000000000000000 R09: 00007ffe06c305f0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f54c61c35f0 R13: 00007ffe06c30778 R14: 0000000000000001 R15: 0000000000000001 The buggy address belongs to stack of task syz-executor296/5014 and is located at offset 32 in frame: fl_set_key_cfm+0x0/0x440 net/sched/cls_flower.c:374 This frame has 1 object: [32, 56) 'nla_cfm_opt' The buggy address belongs to the virtual mapping at [ffffc90003a08000, ffffc90003a11000) created by: copy_process+0x5c8/0x4290 kernel/fork.c:2330 Fixes: 7cfffd5fed3e ("net: flower: add support for matching cfm fields") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Simon Horman Reviewed-by: Ido Schimmel Reviewed-by: Zahari Doychev Link: https://lore.kernel.org/r/20230726145815.943910-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 1e74ae32805b6630c78bd7fb746fbfe936fb8f86 Author: Huacai Chen Date: Fri Jul 28 10:30:42 2023 +0800 LoongArch: Cleanup __builtin_constant_p() checking for cpu_has_* In the current configuration, cpu_has_lsx and cpu_has_lasx cannot be constants. So cleanup the __builtin_constant_p() checking to reduce the complexity. Reviewed-by: WANG Xuerui Signed-off-by: Huacai Chen commit 4eece7e6de94d833c8aeed2f438faf487cbf94ff Author: Tiezhu Yang Date: Fri Jul 28 10:30:42 2023 +0800 LoongArch: BPF: Fix check condition to call lu32id in move_imm() As the code comment says, the initial aim is to reduce one instruction in some corner cases, if bit[51:31] is all 0 or all 1, no need to call lu32id. That is to say, it should call lu32id only if bit[51:31] is not all 0 and not all 1. The current code always call lu32id, the result is right but the logic is unexpected and wrong, fix it. Cc: stable@vger.kernel.org # 6.1 Fixes: 5dc615520c4d ("LoongArch: Add BPF JIT support") Reported-by: Colin King (gmail) Closes: https://lore.kernel.org/all/bcf97046-e336-712a-ac68-7fd194f2953e@gmail.com/ Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit de0e30bee86d0f99c696a1fea34474e556a946ec Author: Chenguang Zhao Date: Fri Jul 28 10:30:42 2023 +0800 LoongArch: BPF: Enable bpf_probe_read{, str}() on LoongArch Currently nettrace does not work on LoongArch due to missing bpf_probe_read{,str}() support, with the error message: ERROR: failed to load kprobe-based eBPF ERROR: failed to load kprobe-based bpf According to commit 0ebeea8ca8a4d1d ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work"), we only need to select CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE to add said support, because LoongArch does have non-overlapping address ranges for kernel and userspace. Cc: stable@vger.kernel.org # 6.1 Signed-off-by: Chenguang Zhao Signed-off-by: Huacai Chen commit e66d511fc92201ba481392e54896f1aeadfcf0e9 Author: WANG Rui Date: Fri Jul 28 10:30:42 2023 +0800 LoongArch: Fix return value underflow in exception path This patch fixes an underflow issue in the return value within the exception path, specifically at .Llt8 when the remaining length is less than 8 bytes. Cc: stable@vger.kernel.org Fixes: 8941e93ca590 ("LoongArch: Optimize memory ops (memset/memcpy/memmove)") Reported-by: Weihao Li Signed-off-by: WANG Rui Signed-off-by: Huacai Chen commit 83da30d73b86ab5898fb84f8b49c11557c3fcc67 Author: Zhihong Dong Date: Fri Jul 28 10:30:42 2023 +0800 LoongArch: Fix CMDLINE_EXTEND and CMDLINE_BOOTLOADER handling On FDT systems these command line processing are already taken care of by early_init_dt_scan_chosen(). Add similar handling to the ACPI (non- FDT) code path to allow these config options to work for ACPI (non-FDT) systems too. Signed-off-by: Zhihong Dong Signed-off-by: Huacai Chen commit 03c53eb90c0c61885b2175adf8675fb56df7f8db Author: Huacai Chen Date: Fri Jul 28 10:30:42 2023 +0800 LoongArch: Fix module relocation error with binutils 2.41 Binutils 2.41 enables linker relaxation by default, but the kernel module loader doesn't support that, so just disable it. Otherwise we get such an error when loading modules: "Unknown relocation type 102" As an alternative, we could add linker relaxation support in the kernel module loader. But it is relatively large complexity that may or may not bring a similar gain, and we don't really want to include this linker pass in the kernel. Reviewed-by: WANG Xuerui Signed-off-by: Huacai Chen commit 54c2c9df083fe1d4a9df54d9876f32582ce6d77a Author: Huacai Chen Date: Fri Jul 28 10:30:42 2023 +0800 LoongArch: Only fiddle with CHECKFLAGS if `need-compiler' This is a port of commit 4fe4a6374c4db9ae2b ("MIPS: Only fiddle with CHECKFLAGS if `need-compiler'") to LoongArch. We have originally guarded fiddling with CHECKFLAGS in our arch Makefile by checking for the CONFIG_LOONGARCH variable, not set for targets such as `distclean', etc. that neither include `.config' nor use the compiler. Starting from commit 805b2e1d427aab4 ("kbuild: include Makefile.compiler only when compiler is needed") we have had a generic `need-compiler' variable explicitly telling us if the compiler will be used and thus its capabilities need to be checked and expressed in the form of compilation flags. If this variable is not set, then `make' functions such as `cc-option' are undefined, causing all kinds of weirdness to happen if we expect specific results to be returned. It doesn't cause problems on LoongArch now. But as a guard we replace the check for CONFIG_LOONGARCH with one for `need-compiler' instead, so as to prevent the compiler from being ever called for CHECKFLAGS when not needed. Signed-off-by: Huacai Chen commit 3ac873c76d79f055e1712754d9f2e90e41582f04 Author: Niklas Cassel Date: Sun Jul 23 15:03:14 2023 +0200 ata: libata-core: fix when to fetch sense data for successful commands The condition to fetch sense data was supposed to be: ATA_SENSE set AND either 1) Command was NCQ and ATA_DFLAG_CDL_ENABLED flag set (flag ATA_DFLAG_CDL_ENABLED will only be set if the Successful NCQ command sense data supported bit is set); or 2) Command was non-NCQ and regular sense data reporting is enabled. However the check in 2) accidentally had the negation at the wrong place, causing it to try to fetch sense data if it was a non-NCQ command _or_ if regular sense data reporting was _not_ enabled. Fix this by removing the extra parentheses that should not be there, such that only the correct return (ata_is_ncq()) is negated. Fixes: 18bd7718b5c4 ("scsi: ata: libata: Handle completion of CDL commands using policy 0xD") Reported-by: Borislav Petkov Closes: https://lore.kernel.org/linux-ide/20230722155621.GIZLv8JbURKzHtKvQE@fat_crate.local/ Signed-off-by: Niklas Cassel Tested-by: Borislav Petkov (AMD) Reviewed-by: Jason Yan Signed-off-by: Damien Le Moal commit 9a767faa9477ef2a5fee6a0c9d69587b95a885df Merge: 0dd9c514d2ce1 1b5d0ddcb34a6 Author: Dave Airlie Date: Fri Jul 28 11:59:14 2023 +1000 Merge tag 'drm-msm-fixes-2023-07-27' of https://gitlab.freedesktop.org/drm/msm into drm-fixes Fixes for v6.5-rc4 Display: + Fix to correct the UBWC programming for decoder version 4.3 seen on SM8550 + Add the missing flush and fetch bits for DMA4 and DMA5 SSPPs. + Fix to drop the unused dpu_core_perf_data_bus_id enum from the code + Drop the unused dsi_phy_14nm_17mA_regulators from QCM 2290 DSI cfg. GPU: + Fix warn splat for newer devices without revn + Remove name/revn for a690.. we shouldn't be populating these for newer devices, for consistency, but it slipped through review + Fix a6xx gpu snapshot BINDLESS_DATA size (was listed in bytes instead of dwords, causing AHB faults on a6xx gen4/a660-family) + Disallow submit with fence id 0 Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGs9MwCSfiyv8i7yWAsJKYEzCDyzaTx=ujX80Y23rZd9RA@mail.gmail.com commit 0dd9c514d2ce19c896daffd76de008a68982de23 Merge: 75da46c1fad5f bc1688fce2ec7 Author: Dave Airlie Date: Fri Jul 28 11:55:13 2023 +1000 Merge tag 'amd-drm-fixes-6.5-2023-07-26' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.5-2023-07-26: amdgpu: - gfxhub partition fix - Fix error handling in psp_sw_init() - SMU13 fix - DCN 3.1 fix - DCN 3.2 fix - Fix for display PHY programming sequence - DP MST error handling fix - GFX 9.4.3 fix amdkfd: - GFX11 trap handling fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20230726184936.7812-1-alexander.deucher@amd.com commit 75da46c1fad5f88e24c08995f6e303e9b9fe8f12 Merge: 8e4bc0284cd8d e354f67733115 Author: Dave Airlie Date: Fri Jul 28 11:53:26 2023 +1000 Merge tag 'drm-intel-fixes-2023-07-27' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Use shmem for dpt objects [dpt] (Radhakrishna Sripada) - Fix an error handling path in igt_write_huge() (Christophe JAILLET) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZMI4Mtom7pDhLB7M@tursulin-desk commit 8e4bc0284cd8df25556671796acea5442f246dfb Merge: 6eaae19807608 39b1320e5dc2b Author: Dave Airlie Date: Fri Jul 28 11:46:27 2023 +1000 Merge tag 'drm-misc-fixes-2023-07-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes A single patch to remove an unused function. Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/dqvxednqyab5t7gvwvcq72x6yu7ug5gusmhpgs3kq6z7pf3co6@ofr6s7547gbe commit fa467226669c09520bfb3e67fca5aeff947cdf17 Author: Jakub Kicinski Date: Wed Jul 26 08:11:20 2023 -0700 MAINTAINERS: stmmac: retire Giuseppe Cavallaro I tried to get stmmac maintainers to be more active by agreeing with them off-list on a review rotation. I pinged Peppe 3 times over 2 weeks during his "shift month", no reviews are flowing. All the contributions are much appreciated! But stmmac is quite active, we need participating maintainers :( Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230726151120.1649474-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 9945c1fb03a3c9f7e0dcf9aa17041a70e551387a Author: Russell King (Oracle) Date: Wed Jul 26 15:45:16 2023 +0100 net: dsa: fix older DSA drivers using phylink Older DSA drivers that do not provide an dsa_ops adjust_link method end up using phylink. Unfortunately, a recent phylink change that requires its supported_interfaces bitmap to be filled breaks these drivers because the bitmap remains empty. Rather than fixing each driver individually, fix it in the core code so we have a sensible set of defaults. Reported-by: Sergei Antonov Fixes: de5c9bf40c45 ("net: phylink: require supported_interfaces to be filled") Signed-off-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean # dsa_loop Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/E1qOflM-001AEz-D3@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit d73ef2d69c0dba5f5a1cb9600045c873bab1fb7f Author: Lin Ma Date: Wed Jul 26 15:53:14 2023 +0800 rtnetlink: let rtnl_bridge_setlink checks IFLA_BRIDGE_MODE length There are totally 9 ndo_bridge_setlink handlers in the current kernel, which are 1) bnxt_bridge_setlink, 2) be_ndo_bridge_setlink 3) i40e_ndo_bridge_setlink 4) ice_bridge_setlink 5) ixgbe_ndo_bridge_setlink 6) mlx5e_bridge_setlink 7) nfp_net_bridge_setlink 8) qeth_l2_bridge_setlink 9) br_setlink. By investigating the code, we find that 1-7 parse and use nlattr IFLA_BRIDGE_MODE but 3 and 4 forget to do the nla_len check. This can lead to an out-of-attribute read and allow a malformed nlattr (e.g., length 0) to be viewed as a 2 byte integer. To avoid such issues, also for other ndo_bridge_setlink handlers in the future. This patch adds the nla_len check in rtnl_bridge_setlink and does an early error return if length mismatches. To make it works, the break is removed from the parsing for IFLA_BRIDGE_FLAGS to make sure this nla_for_each_nested iterates every attribute. Fixes: b1edc14a3fbf ("ice: Implement ice_bridge_getlink and ice_bridge_setlink") Fixes: 51616018dd1b ("i40e: Add support for getlink, setlink ndo ops") Suggested-by: Jakub Kicinski Signed-off-by: Lin Ma Acked-by: Nikolay Aleksandrov Reviewed-by: Hangbin Liu Link: https://lore.kernel.org/r/20230726075314.1059224-1-linma@zju.edu.cn Signed-off-by: Jakub Kicinski commit 3fc2febb0f8ffae354820c1772ec008733237cfa Author: Arnd Bergmann Date: Wed Jul 26 22:33:22 2023 +0200 ata: pata_ns87415: mark ns87560_tf_read static The global function triggers a warning because of the missing prototype drivers/ata/pata_ns87415.c:263:6: warning: no previous prototype for 'ns87560_tf_read' [-Wmissing-prototypes] 263 | void ns87560_tf_read(struct ata_port *ap, struct ata_taskfile *tf) There are no other references to this, so just make it static. Fixes: c4b5b7b6c4423 ("pata_ns87415: Initial cut at 87415/87560 IDE support") Reviewed-by: Sergey Shtylyov Reviewed-by: Serge Semin Signed-off-by: Arnd Bergmann Signed-off-by: Damien Le Moal commit 6c54312f9689fbe27c70db5d42eebd29d04b672e Author: Sidhartha Kumar Date: Mon Jul 17 11:18:12 2023 -0700 mm/memory-failure: fix hardware poison check in unpoison_memory() It was pointed out[1] that using folio_test_hwpoison() is wrong as we need to check the indiviual page that has poison. folio_test_hwpoison() only checks the head page so go back to using PageHWPoison(). User-visible effects include existing hwpoison-inject tests possibly failing as unpoisoning a single subpage could lead to unpoisoning an entire folio. Memory unpoisoning could also not work as expected as the function will break early due to only checking the head page and not the actually poisoned subpage. [1]: https://lore.kernel.org/lkml/ZLIbZygG7LqSI9xe@casper.infradead.org/ Link: https://lkml.kernel.org/r/20230717181812.167757-1-sidhartha.kumar@oracle.com Fixes: a6fddef49eef ("mm/memory-failure: convert unpoison_memory() to folios") Signed-off-by: Sidhartha Kumar Reported-by: Matthew Wilcox (Oracle) Acked-by: Naoya Horiguchi Reviewed-by: Miaohe Lin Cc: Signed-off-by: Andrew Morton commit 641db40f3afe7998011bfabc726dba3e698f8196 Author: Dan Carpenter Date: Tue Jul 25 20:03:16 2023 +0300 proc/vmcore: fix signedness bug in read_from_oldmem() The bug is the error handling: if (tmp < nr_bytes) { "tmp" can hold negative error codes but because "nr_bytes" is type size_t the negative error codes are treated as very high positive values (success). Fix this by changing "nr_bytes" to type ssize_t. The "nr_bytes" variable is used to store values between 1 and PAGE_SIZE and they can fit in ssize_t without any issue. Link: https://lkml.kernel.org/r/b55f7eed-1c65-4adc-95d1-6c7c65a54a6e@moroto.mountain Fixes: 5d8de293c224 ("vmcore: convert copy_oldmem_page() to take an iov_iter") Signed-off-by: Dan Carpenter Reviewed-by: Matthew Wilcox (Oracle) Acked-by: Baoquan He Cc: Dave Young Cc: Vivek Goyal Cc: Alexey Dobriyan Cc: Signed-off-by: Andrew Morton commit 286812b041ccc74b114cada5c10ada70a6277a20 Author: Bjorn Andersson Date: Thu Jul 20 14:02:56 2023 -0700 mailmap: update remaining active codeaurora.org email addresses The lack of mailmap updates for @codeaurora.org addresses reduces the usefulness of tools such as get_maintainer.pl. Some recent (and welcome!) additions has been made to improve the situation, this concludes the effort. Link: https://lkml.kernel.org/r/20230720210256.1296567-1-quic_bjorande@quicinc.com Signed-off-by: Bjorn Andersson Cc: Arnd Bergmann Cc: Konrad Dybcio Signed-off-by: Andrew Morton commit d8ab9f7b644a2c9b64de405c1953c905ff219dc9 Author: Jann Horn Date: Fri Jul 21 05:46:43 2023 +0200 mm: lock VMA in dup_anon_vma() before setting ->anon_vma When VMAs are merged, dup_anon_vma() is called with `dst` pointing to the VMA that is being expanded to cover the area previously occupied by another VMA. This currently happens while `dst` is not write-locked. This means that, in the `src->anon_vma && !dst->anon_vma` case, as soon as the assignment `dst->anon_vma = src->anon_vma` has happened, concurrent page faults can happen on `dst` under the per-VMA lock. This is already icky in itself, since such page faults can now install pages into `dst` that are attached to an `anon_vma` that is not yet tied back to the `anon_vma` with an `anon_vma_chain`. But if `anon_vma_clone()` fails due to an out-of-memory error, things get much worse: `anon_vma_clone()` then reverts `dst->anon_vma` back to NULL, and `dst` remains completely unconnected to the `anon_vma`, even though we can have pages in the area covered by `dst` that point to the `anon_vma`. This means the `anon_vma` of such pages can be freed while the pages are still mapped into userspace, which leads to UAF when a helper like folio_lock_anon_vma_read() tries to look up the anon_vma of such a page. This theoretically is a security bug, but I believe it is really hard to actually trigger as an unprivileged user because it requires that you can make an order-0 GFP_KERNEL allocation fail, and the page allocator tries pretty hard to prevent that. I think doing the vma_start_write() call inside dup_anon_vma() is the most straightforward fix for now. For a kernel-assisted reproducer, see the notes section of the patch mail. Link: https://lkml.kernel.org/r/20230721034643.616851-1-jannh@google.com Fixes: 5e31275cc997 ("mm: add per-VMA lock and helper functions to control it") Signed-off-by: Jann Horn Reviewed-by: Suren Baghdasaryan Cc: Signed-off-by: Andrew Morton commit b1f02b95758d05b799731d939e76a0bd6da312db Author: Jann Horn Date: Sat Jul 22 00:51:07 2023 +0200 mm: fix memory ordering for mm_lock_seq and vm_lock_seq mm->mm_lock_seq effectively functions as a read/write lock; therefore it must be used with acquire/release semantics. A specific example is the interaction between userfaultfd_register() and lock_vma_under_rcu(). userfaultfd_register() does the following from the point where it changes a VMA's flags to the point where concurrent readers are permitted again (in a simple scenario where only a single private VMA is accessed and no merging/splitting is involved): userfaultfd_register userfaultfd_set_vm_flags vm_flags_reset vma_start_write down_write(&vma->vm_lock->lock) vma->vm_lock_seq = mm_lock_seq [marks VMA as busy] up_write(&vma->vm_lock->lock) vm_flags_init [sets VM_UFFD_* in __vm_flags] vma->vm_userfaultfd_ctx.ctx = ctx mmap_write_unlock vma_end_write_all WRITE_ONCE(mm->mm_lock_seq, mm->mm_lock_seq + 1) [unlocks VMA] There are no memory barriers in between the __vm_flags update and the mm->mm_lock_seq update that unlocks the VMA, so the unlock can be reordered to above the `vm_flags_init()` call, which means from the perspective of a concurrent reader, a VMA can be marked as a userfaultfd VMA while it is not VMA-locked. That's bad, we definitely need a store-release for the unlock operation. The non-atomic write to vma->vm_lock_seq in vma_start_write() is mostly fine because all accesses to vma->vm_lock_seq that matter are always protected by the VMA lock. There is a racy read in vma_start_read() though that can tolerate false-positives, so we should be using WRITE_ONCE() to keep things tidy and data-race-free (including for KCSAN). On the other side, lock_vma_under_rcu() works as follows in the relevant region for locking and userfaultfd check: lock_vma_under_rcu vma_start_read vma->vm_lock_seq == READ_ONCE(vma->vm_mm->mm_lock_seq) [early bailout] down_read_trylock(&vma->vm_lock->lock) vma->vm_lock_seq == READ_ONCE(vma->vm_mm->mm_lock_seq) [main check] userfaultfd_armed checks vma->vm_flags & __VM_UFFD_FLAGS Here, the interesting aspect is how far down the mm->mm_lock_seq read can be reordered - if this read is reordered down below the vma->vm_flags access, this could cause lock_vma_under_rcu() to partly operate on information that was read while the VMA was supposed to be locked. To prevent this kind of downwards bleeding of the mm->mm_lock_seq read, we need to read it with a load-acquire. Some of the comment wording is based on suggestions by Suren. BACKPORT WARNING: One of the functions changed by this patch (which I've written against Linus' tree) is vma_try_start_write(), but this function no longer exists in mm/mm-everything. I don't know whether the merged version of this patch will be ordered before or after the patch that removes vma_try_start_write(). If you're backporting this patch to a tree with vma_try_start_write(), make sure this patch changes that function. Link: https://lkml.kernel.org/r/20230721225107.942336-1-jannh@google.com Fixes: 5e31275cc997 ("mm: add per-VMA lock and helper functions to control it") Signed-off-by: Jann Horn Reviewed-by: Suren Baghdasaryan Cc: Signed-off-by: Andrew Morton commit 15571273db93ac2e4415e74280e04566c31d5eb0 Author: Drew Fustini Date: Sat Jul 22 18:03:30 2023 -0700 scripts/spelling.txt: remove 'thead' as a typo T-Head is a vendor of processor core IP, and they have recently introduced the RISC-V TH1520 SoC. Remove 'thead' as a typo of 'thread' to avoid checkpatch incorrectly warning that 'thead' is typo in patches that add support for T-Head designs in the kernel. Link: https://lkml.kernel.org/r/20230723010329.674186-1-dfustini@baylibre.com Link: https://www.t-head.cn/ Signed-off-by: Drew Fustini Acked-by: Guo Ren Cc: Conor Dooley Cc: Jisheng Zhang Cc: Colin Ian King Cc: Diederik de Haas Cc: Ian Rogers Cc: Luca Ceresoli # versaclock5 Cc: Randy Dunlap Cc: SeongJae Park Signed-off-by: Andrew Morton commit 8b1cb4a2e819a2e4851ceeba53563f4edf03a8cf Author: Hugh Dickins Date: Sun Jul 23 14:17:55 2023 -0700 mm/pagewalk: fix EFI_PGT_DUMP of espfix area Booting x86_64 with CONFIG_EFI_PGT_DUMP=y shows messages of the form "mm/pgtable-generic.c:53: bad pmd (____ptrval____)(8000000100077061)". EFI_PGT_DUMP dumps all of efi_mm, including the espfix area, which is set up with pmd entries which fit the pmd_bad() check: so 0d940a9b270b warns and clears those entries, which would ruin running Win16 binaries. The failing pte_offset_map() stopped such a kernel from even booting, until a few commits later be872f83bf57 changed the pagewalk to tolerate that: but it needs to be even more careful, to not spoil those entries. I might have preferred to change init_espfix_ap() not to use "bad" pmd entries; or to leave them out of the efi_mm dump. But there is great value in staying away from there, and a pagewalk check of address against TASK_SIZE may protect from other such aberrations too. Link: https://lkml.kernel.org/r/22bca736-4cab-9ee5-6a52-73a3b2bbe865@google.com Closes: https://lore.kernel.org/linux-mm/CABXGCsN3JqXckWO=V7p=FhPU1tK03RE1w9UE6xL5Y86SMk209w@mail.gmail.com/ Fixes: 0d940a9b270b ("mm/pgtable: allow pte_offset_map[_lock]() to fail") Fixes: be872f83bf57 ("mm/pagewalk: walk_pte_range() allow for pte_offset_map()") Signed-off-by: Hugh Dickins Reported-by: Mikhail Gavrilov Tested-by: Mikhail Gavrilov Cc: Bagas Sanjaya Cc: Laura Abbott Signed-off-by: Andrew Morton commit fa598952fac059054316dccb2213478ccb81a0d1 Author: Hugh Dickins Date: Sun Jul 23 14:05:54 2023 -0700 shmem: minor fixes to splice-read implementation HWPoison: my reading of folio_test_hwpoison() is that it only tests the head page of a large folio, whereas splice_folio_into_pipe() will splice as much of the folio as it can: so for safety we should also check the has_hwpoisoned flag, set if any of the folio's pages are hwpoisoned. (Perhaps that ugliness can be improved at the mm end later.) The call to splice_zeropage_into_pipe() risked overrunning past EOF: ask it for "part" not "len". Link: https://lkml.kernel.org/r/32c72c9c-72a8-115f-407d-f0148f368@google.com Fixes: bd194b187115 ("shmem: Implement splice-read") Signed-off-by: Hugh Dickins Reviewed-by: David Howells Cc: David Hildenbrand Cc: Jens Axboe Signed-off-by: Andrew Morton commit 253e5df8b8f0145adb090f57c6f4e6efa52d738e Author: Hugh Dickins Date: Sun Jul 23 13:55:00 2023 -0700 tmpfs: fix Documentation of noswap and huge mount options The noswap mount option is surely not one of the three options for sizing: move its description down. The huge= mount option does not accept numeric values: those are just in an internal enum. Delete those numbers, and follow the manpage text more closely (but there's not yet any fadvise() or fcntl() which applies here). /sys/kernel/mm/transparent_hugepage/shmem_enabled is hard to describe, and barely relevant to mounting a tmpfs: just refer to transhuge.rst (while still using the words deny and force, to help as informal reminders). [rdunlap@infradead.org: fixup Docs table for huge mount options] Link: https://lkml.kernel.org/r/20230725052333.26857-1-rdunlap@infradead.org Link: https://lkml.kernel.org/r/986cb0bf-9780-354-9bb-4bf57aadbab@google.com Signed-off-by: Hugh Dickins Signed-off-by: Randy Dunlap Fixes: d0f5a85442d1 ("shmem: update documentation") Fixes: 2c6efe9cf2d7 ("shmem: add support to ignore swap") Reviewed-by: Luis Chamberlain Cc: Christian Brauner Signed-off-by: Andrew Morton commit dddfa05eb58076ad60f9a66e7155a5b3502b2dd5 Author: Andy Shevchenko Date: Mon Jul 24 17:31:31 2023 +0300 Revert "um: Use swap() to make code cleaner" This reverts commit 9b0da3f22307af693be80f5d3a89dc4c7f360a85. The sigio.c is clearly user space code which is handled by arch/um/scripts/Makefile.rules (see USER_OBJS rule). The above mentioned commit simply broke this agreement, we may not use Linux kernel internal headers in them without thorough thinking. Hence, revert the wrong commit. Link: https://lkml.kernel.org/r/20230724143131.30090-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307212304.cH79zJp1-lkp@intel.com/ Cc: Anton Ivanov Cc: Herve Codina Cc: Jason A. Donenfeld Cc: Johannes Berg Cc: Rasmus Villemoes Cc: Richard Weinberger Cc: Yang Guang Cc: Signed-off-by: Andrew Morton commit d1836a3b2a9a50134ac449359b2fec56e3685e1d Author: Feng Tang Date: Tue Jul 18 13:28:11 2023 +0800 mm/damon/core-test: initialise context before test in damon_test_set_attrs() Running kunit test for 6.5-rc1 hits one bug: ok 10 damon_test_update_monitoring_result general protection fault, probably for non-canonical address 0x1bffa5c419cfb81: 0000 [#1] PREEMPT SMP NOPTI CPU: 1 PID: 110 Comm: kunit_try_catch Tainted: G N 6.5.0-rc2 #15 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 RIP: 0010:damon_set_attrs+0xb9/0x120 Code: f8 00 00 00 4c 8d 58 e0 48 39 c3 74 ba 41 ba 59 17 b7 d1 49 8b 43 10 4d 8d 4b 10 48 8d 70 e0 49 39 c1 74 50 49 8b 40 08 31 d2 <69> 4e 18 10 27 00 00 49 f7 30 31 d2 48 89 c5 89 c8 f7 f5 31 d2 89 RSP: 0000:ffffc900005bfd40 EFLAGS: 00010246 RAX: ffffffff81159fc0 RBX: ffffc900005bfeb8 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 01bffa5c419cfb69 RDI: ffffc900005bfd70 RBP: ffffc90000013c10 R08: ffffc900005bfdc0 R09: ffffffff81ff10ed R10: 00000000d1b71759 R11: ffffffff81ff10dd R12: ffffc90000013a78 R13: ffff88810eb78180 R14: ffffffff818297c0 R15: ffffc90000013c28 FS: 0000000000000000(0000) GS:ffff88813bd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000002a1c001 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: damon_test_set_attrs+0x63/0x1f0 kunit_generic_run_threadfn_adapter+0x17/0x30 kthread+0xfd/0x130 The problem seems to be related with the damon_ctx was used without being initialized. Fix it by adding the initialization. Link: https://lkml.kernel.org/r/20230718052811.1065173-1-feng.tang@intel.com Fixes: aa13779be6b7 ("mm/damon/core-test: add a test for damon_set_attrs()") Signed-off-by: Feng Tang Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 57012c57536f8814dec92e74197ee96c3498d24e Merge: bc168790de87b de52e17326c3e Author: Linus Torvalds Date: Thu Jul 27 12:27:37 2023 -0700 Merge tag 'net-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from can, netfilter. Current release - regressions: - core: fix splice_to_socket() for O_NONBLOCK socket - af_unix: fix fortify_panic() in unix_bind_bsd(). - can: raw: fix lockdep issue in raw_release() Previous releases - regressions: - tcp: reduce chance of collisions in inet6_hashfn(). - netfilter: skip immediate deactivate in _PREPARE_ERROR - tipc: stop tipc crypto on failure in tipc_node_create - eth: igc: fix kernel panic during ndo_tx_timeout callback - eth: iavf: fix potential deadlock on allocation failure Previous releases - always broken: - ipv6: fix bug where deleting a mngtmpaddr can create a new temporary address - eth: ice: fix memory management in ice_ethtool_fdir.c - eth: hns3: fix the imp capability bit cannot exceed 32 bits issue - eth: vxlan: calculate correct header length for GPE - eth: stmmac: apply redundant write work around on 4.xx too" * tag 'net-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (49 commits) tipc: stop tipc crypto on failure in tipc_node_create af_unix: Terminate sun_path when bind()ing pathname socket. tipc: check return value of pskb_trim() benet: fix return value check in be_lancer_xmit_workarounds() virtio-net: fix race between set queues and probe net/sched: mqprio: Add length check for TCA_MQPRIO_{MAX/MIN}_RATE64 splice, net: Fix splice_to_socket() for O_NONBLOCK socket net: fec: tx processing does not call XDP APIs if budget is 0 mptcp: more accurate NL event generation selftests: mptcp: join: only check for ip6tables if needed tools: ynl-gen: fix parse multi-attr enum attribute tools: ynl-gen: fix enum index in _decode_enum(..) netfilter: nf_tables: disallow rule addition to bound chain via NFTA_RULE_CHAIN_ID netfilter: nf_tables: skip immediate deactivate in _PREPARE_ERROR netfilter: nft_set_rbtree: fix overlap expiration walk igc: Fix Kernel Panic during ndo_tx_timeout callback net: dsa: qca8k: fix mdb add/del case with 0 VID net: dsa: qca8k: fix broken search_and_del net: dsa: qca8k: fix search_and_insert wrong handling of new rule net: dsa: qca8k: enable use_single_write for qca8xxx ... commit bc168790de87bd70371793cfecb0fab26f85b857 Merge: 53c8621b9e6c3 7891d0a5ce6f6 Author: Linus Torvalds Date: Thu Jul 27 12:07:41 2023 -0700 Merge tag 'soundwire-6.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire Pull soundwire fixes from Vinod Koul: - Core fix for enumeration completion - Qualcomm driver fix to update status - AMD driver fix for probe error check * tag 'soundwire-6.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: amd: Fix a check for errors in probe() soundwire: qcom: update status correctly with mask soundwire: fix enumeration completion commit 53c8621b9e6c3fa2607cb36db76780f6e327f57d Merge: 64de76ce8e26f 13c088cf3657d Author: Linus Torvalds Date: Thu Jul 27 11:52:41 2023 -0700 Merge tag 'phy-fixes-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy Pull phy fixes from Vinod Koul: - Out of bound fix for hisilicon phy - Qualcomm synopsis femto phy for keeping clock enabled during suspend and enabling ref clocks - Mediatek driver fixes for upper limit test and error code * tag 'phy-fixes-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe() phy: qcom-snps-femto-v2: use qcom_snps_hsphy_suspend/resume error code phy: qcom-snps-femto-v2: properly enable ref clock phy: qcom-snps-femto-v2: keep cfg_ahb_clk enabled during runtime suspend phy: mediatek: hdmi: mt8195: fix prediv bad upper limit test phy: phy-mtk-dp: Fix an error code in probe() commit 64de76ce8e26fb0a5ca32ac2210ef99238c28525 Merge: 379e66711b33f b28ff3a7d7e97 Author: Linus Torvalds Date: Thu Jul 27 11:44:08 2023 -0700 Merge tag 'for-6.5-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - fix accounting of global block reserve size when block group tree is enabled - the async discard has been enabled in 6.2 unconditionally, but for zoned mode it does not make that much sense to do it asynchronously as the zones are reset as needed - error handling and proper error value propagation fixes * tag 'for-6.5-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: check for commit error at btrfs_attach_transaction_barrier() btrfs: check if the transaction was aborted at btrfs_wait_for_commit() btrfs: remove BUG_ON()'s in add_new_free_space() btrfs: account block group tree when calculating global reserve size btrfs: zoned: do not enable async discard commit 379e66711b33f9fdc0513daee6cf3dd8d2f6f435 Merge: 657b5146955eb 9e46e4dcd9d6c Author: Linus Torvalds Date: Thu Jul 27 11:37:34 2023 -0700 Merge tag 'fixes-2023-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock Pull memblock fix from Mike Rapoport: "A call to memblock_free() or memblock_phys_free() issued after memblock data is discarded will result in use after free in memblock_isolate_range(). Avoid those issues by making sure that memblock_discard points memblock.reserved.regions back at the static buffer" * tag 'fixes-2023-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: mm,memblock: reset memblock.reserved to system init state to prevent UAF commit 657b5146955eba331e01b9a6ae89ce2e716ba306 Author: Jann Horn Date: Wed Jul 26 23:41:03 2023 +0200 mm: lock_vma_under_rcu() must check vma->anon_vma under vma lock lock_vma_under_rcu() tries to guarantee that __anon_vma_prepare() can't be called in the VMA-locked page fault path by ensuring that vma->anon_vma is set. However, this check happens before the VMA is locked, which means a concurrent move_vma() can concurrently call unlink_anon_vmas(), which disassociates the VMA's anon_vma. This means we can get UAF in the following scenario: THREAD 1 THREAD 2 ======== ======== lock_vma_under_rcu() rcu_read_lock() mas_walk() check vma->anon_vma mremap() syscall move_vma() vma_start_write() unlink_anon_vmas() handle_mm_fault() __handle_mm_fault() handle_pte_fault() do_pte_missing() do_anonymous_page() anon_vma_prepare() __anon_vma_prepare() find_mergeable_anon_vma() mas_walk() [looks up VMA X] munmap() syscall (deletes VMA X) reusable_anon_vma() [called on freed VMA X] This is a security bug if you can hit it, although an attacker would have to win two races at once where the first race window is only a few instructions wide. This patch is based on some previous discussion with Linus Torvalds on the security list. Cc: stable@vger.kernel.org Fixes: 5e31275cc997 ("mm: add per-VMA lock and helper functions to control it") Signed-off-by: Jann Horn Signed-off-by: Linus Torvalds commit cdddb626dc053a2bbe8be4150e9b67395130a683 Author: Gustavo A. R. Silva Date: Sat Jul 1 11:17:22 2023 -0600 media: venus: Use struct_size_t() helper in pkt_session_unset_buffers() Prefer struct_size_t() over struct_size() when no pointer instance of the structure type is present. Signed-off-by: "Gustavo A. R. Silva" Reviewed-by: Vikash Garodia Link: https://lore.kernel.org/r/ZKBfoqSl61jfpO2r@work Signed-off-by: Kees Cook commit bcc29b7f5af6797702c2306a7aacb831fc5ce9cb Author: Lin Ma Date: Tue Jul 25 10:33:30 2023 +0800 bpf: Add length check for SK_DIAG_BPF_STORAGE_REQ_MAP_FD parsing The nla_for_each_nested parsing in function bpf_sk_storage_diag_alloc does not check the length of the nested attribute. This can lead to an out-of-attribute read and allow a malformed nlattr (e.g., length 0) to be viewed as a 4 byte integer. This patch adds an additional check when the nlattr is getting counted. This makes sure the latter nla_get_u32 can access the attributes with the correct length. Fixes: 1ed4d92458a9 ("bpf: INET_DIAG support in bpf_sk_storage") Suggested-by: Jakub Kicinski Signed-off-by: Lin Ma Reviewed-by: Jakub Kicinski Link: https://lore.kernel.org/r/20230725023330.422856-1-linma@zju.edu.cn Signed-off-by: Martin KaFai Lau commit e146503ac68418859fb063a3a0cd9ec93bc52238 Author: Baskaran Kannan Date: Thu Jul 27 11:21:59 2023 -0500 hwmon: (k10temp) Enable AMD3255 Proc to show negative temperature Industrial processor i3255 supports temperatures -40 deg celcius to 105 deg Celcius. The current implementation of k10temp_read_temp rounds off any negative temperatures to '0'. To fix this, the following changes have been made. A flag 'disp_negative' is added to struct k10temp_data to support AMD i3255 processors. Flag 'disp_negative' is set if 3255 processor is found during k10temp_probe. Flag 'disp_negative' is used to determine whether to round off negative temperatures to '0' in k10temp_read_temp. Signed-off-by: Baskaran Kannan Link: https://lore.kernel.org/r/20230727162159.1056136-1-Baski.Kannan@amd.com Fixes: aef17ca12719 ("hwmon: (k10temp) Only apply temperature offset if result is positive") Cc: stable@vger.kernel.org [groeck: Fixed multi-line comment] Signed-off-by: Guenter Roeck commit c6abce60338aa2080973cd95be0aedad528bb41f Author: Christophe JAILLET Date: Wed Jul 19 23:55:01 2023 +0200 mtd: rawnand: fsl_upm: Fix an off-by one test in fun_exec_op() 'op-cs' is copied in 'fun->mchip_number' which is used to access the 'mchip_offsets' and the 'rnb_gpio' arrays. These arrays have NAND_MAX_CHIPS elements, so the index must be below this limit. Fix the sanity check in order to avoid the NAND_MAX_CHIPS value. This would lead to out-of-bound accesses. Fixes: 54309d657767 ("mtd: rawnand: fsl_upm: Implement exec_op()") Signed-off-by: Christophe JAILLET Reviewed-by: Dan Carpenter Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/cd01cba1c7eda58bdabaae174c78c067325803d2.1689803636.git.christophe.jaillet@wanadoo.fr commit 71c8f9cf2623d0db79665f876b95afcdd8214aec Author: Arnd Bergmann Date: Wed Jul 19 21:00:25 2023 +0200 mtd: spi-nor: avoid holes in struct spi_mem_op gcc gets confused when -ftrivial-auto-var-init=pattern is used on sparse bit fields such as 'struct spi_mem_op', which caused the previous false positive warning about an uninitialized variable: drivers/mtd/spi-nor/spansion.c: error: 'op' is used uninitialized [-Werror=uninitialized] In fact, the variable is fully initialized and gcc does not see it being used, so the warning is entirely bogus. The problem appears to be a misoptimization in the initialization of single bit fields when the rest of the bytes are not initialized. A previous workaround added another initialization, which ended up shutting up the warning in spansion.c, though it apparently still happens in other files as reported by Peter Foley in the gcc bugzilla. The workaround of adding a fake initialization seems particularly bad because it would set values that can never be correct but prevent the compiler from warning about actually missing initializations. Revert the broken workaround and instead pad the structure to only have bitfields that add up to full bytes, which should avoid this behavior in all drivers. I also filed a new bug against gcc with what I found, so this can hopefully be addressed in future gcc releases. At the moment, only gcc-12 and gcc-13 are affected. Cc: Peter Foley Cc: Pedro Falcato Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110743 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108402 Link: https://godbolt.org/z/efMMsG1Kx Fixes: 420c4495b5e56 ("mtd: spi-nor: spansion: make sure local struct does not contain garbage") Signed-off-by: Arnd Bergmann Acked-by: Mark Brown Acked-by: Tudor Ambarus Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230719190045.4007391-1-arnd@kernel.org commit d3053b4a6b76f29fd1bf0b438b19a2d6ece9657d Author: Tudor Ambarus Date: Tue Jun 20 05:53:59 2023 +0300 MAINTAINERS: Add myself as reviewer for HYPERBUS Add myself as Designated Reviewer for Hyperbus support. I'm assessing the framework and I'd like to get involved in reviewing further patches. Signed-off-by: Tudor Ambarus Acked-by: Vignesh Raghavendra Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230620025359.33839-1-tudor.ambarus@linaro.org commit b7c822fa6b7701b17e139f1c562fc24135880ed4 Author: Jason Gunthorpe Date: Tue Jul 25 16:05:50 2023 -0300 iommufd: Set end correctly when doing batch carry Even though the test suite covers this it somehow became obscured that this wasn't working. The test iommufd_ioas.mock_domain.access_domain_destory would blow up rarely. end should be set to 1 because this just pushed an item, the carry, to the pfns list. Sometimes the test would blow up with: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] SMP CPU: 5 PID: 584 Comm: iommufd Not tainted 6.5.0-rc1-dirty #1236 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:batch_unpin+0xa2/0x100 [iommufd] Code: 17 48 81 fe ff ff 07 00 77 70 48 8b 15 b7 be 97 e2 48 85 d2 74 14 48 8b 14 fa 48 85 d2 74 0b 40 0f b6 f6 48 c1 e6 04 48 01 f2 <48> 8b 3a 48 c1 e0 06 89 ca 48 89 de 48 83 e7 f0 48 01 c7 e8 96 dc RSP: 0018:ffffc90001677a58 EFLAGS: 00010246 RAX: 00007f7e2646f000 RBX: 0000000000000000 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 00000000fefc4c8d RDI: 0000000000fefc4c RBP: ffffc90001677a80 R08: 0000000000000048 R09: 0000000000000200 R10: 0000000000030b98 R11: ffffffff81f3bb40 R12: 0000000000000001 R13: ffff888101f75800 R14: ffffc90001677ad0 R15: 00000000000001fe FS: 00007f9323679740(0000) GS:ffff8881ba540000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000105ede003 CR4: 00000000003706a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? show_regs+0x5c/0x70 ? __die+0x1f/0x60 ? page_fault_oops+0x15d/0x440 ? lock_release+0xbc/0x240 ? exc_page_fault+0x4a4/0x970 ? asm_exc_page_fault+0x27/0x30 ? batch_unpin+0xa2/0x100 [iommufd] ? batch_unpin+0xba/0x100 [iommufd] __iopt_area_unfill_domain+0x198/0x430 [iommufd] ? __mutex_lock+0x8c/0xb80 ? __mutex_lock+0x6aa/0xb80 ? xa_erase+0x28/0x30 ? iopt_table_remove_domain+0x162/0x320 [iommufd] ? lock_release+0xbc/0x240 iopt_area_unfill_domain+0xd/0x10 [iommufd] iopt_table_remove_domain+0x195/0x320 [iommufd] iommufd_hw_pagetable_destroy+0xb3/0x110 [iommufd] iommufd_object_destroy_user+0x8e/0xf0 [iommufd] iommufd_device_detach+0xc5/0x140 [iommufd] iommufd_selftest_destroy+0x1f/0x70 [iommufd] iommufd_object_destroy_user+0x8e/0xf0 [iommufd] iommufd_destroy+0x3a/0x50 [iommufd] iommufd_fops_ioctl+0xfb/0x170 [iommufd] __x64_sys_ioctl+0x40d/0x9a0 do_syscall_64+0x3c/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Link: https://lore.kernel.org/r/3-v1-85aacb2af554+bc-iommufd_syz3_jgg@nvidia.com Cc: Fixes: f394576eb11d ("iommufd: PFN handling for iopt_pages") Reviewed-by: Kevin Tian Tested-by: Nicolin Chen Reported-by: Nicolin Chen Signed-off-by: Jason Gunthorpe commit 99f98a7c0d6985d5507c8130a981972e4b7b3bdc Author: Jason Gunthorpe Date: Tue Jul 25 16:05:49 2023 -0300 iommufd: IOMMUFD_DESTROY should not increase the refcount syzkaller found a race where IOMMUFD_DESTROY increments the refcount: obj = iommufd_get_object(ucmd->ictx, cmd->id, IOMMUFD_OBJ_ANY); if (IS_ERR(obj)) return PTR_ERR(obj); iommufd_ref_to_users(obj); /* See iommufd_ref_to_users() */ if (!iommufd_object_destroy_user(ucmd->ictx, obj)) As part of the sequence to join the two existing primitives together. Allowing the refcount the be elevated without holding the destroy_rwsem violates the assumption that all temporary refcount elevations are protected by destroy_rwsem. Racing IOMMUFD_DESTROY with iommufd_object_destroy_user() will cause spurious failures: WARNING: CPU: 0 PID: 3076 at drivers/iommu/iommufd/device.c:477 iommufd_access_destroy+0x18/0x20 drivers/iommu/iommufd/device.c:478 Modules linked in: CPU: 0 PID: 3076 Comm: syz-executor.0 Not tainted 6.3.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 RIP: 0010:iommufd_access_destroy+0x18/0x20 drivers/iommu/iommufd/device.c:477 Code: e8 3d 4e 00 00 84 c0 74 01 c3 0f 0b c3 0f 1f 44 00 00 f3 0f 1e fa 48 89 fe 48 8b bf a8 00 00 00 e8 1d 4e 00 00 84 c0 74 01 c3 <0f> 0b c3 0f 1f 44 00 00 41 57 41 56 41 55 4c 8d ae d0 00 00 00 41 RSP: 0018:ffffc90003067e08 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff888109ea0300 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000000 RDI: 00000000ffffffff RBP: 0000000000000004 R08: 0000000000000000 R09: ffff88810bbb3500 R10: ffff88810bbb3e48 R11: 0000000000000000 R12: ffffc90003067e88 R13: ffffc90003067ea8 R14: ffff888101249800 R15: 00000000fffffffe FS: 00007ff7254fe6c0(0000) GS:ffff888237c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000555557262da8 CR3: 000000010a6fd000 CR4: 0000000000350ef0 Call Trace: iommufd_test_create_access drivers/iommu/iommufd/selftest.c:596 [inline] iommufd_test+0x71c/0xcf0 drivers/iommu/iommufd/selftest.c:813 iommufd_fops_ioctl+0x10f/0x1b0 drivers/iommu/iommufd/main.c:337 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x84/0xc0 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The solution is to not increment the refcount on the IOMMUFD_DESTROY path at all. Instead use the xa_lock to serialize everything. The refcount check == 1 and xa_erase can be done under a single critical region. This avoids the need for any refcount incrementing. It has the downside that if userspace races destroy with other operations it will get an EBUSY instead of waiting, but this is kind of racing is already dangerous. Fixes: 2ff4bed7fee7 ("iommufd: File descriptor, context, kconfig and makefiles") Link: https://lore.kernel.org/r/2-v1-85aacb2af554+bc-iommufd_syz3_jgg@nvidia.com Reviewed-by: Kevin Tian Reported-by: syzbot+7574ebfe589049630608@syzkaller.appspotmail.com Signed-off-by: Jason Gunthorpe commit d21afb098c510739a2f5dd27aed5d3198816d8dc Merge: 77489a4eb76c3 db66795f61354 Author: Arnd Bergmann Date: Thu Jul 27 15:44:02 2023 +0200 Merge tag 'socfpga_dts_fix_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/fixes SoCFPGA dts fix for v6.5 - Fix incorrect I2C property for SCL signal * tag 'socfpga_dts_fix_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: arm64: dts: stratix10: fix incorrect I2C property for SCL signal Link: https://lore.kernel.org/r/20230724145617.887443-1-dinguyen@kernel.org Signed-off-by: Arnd Bergmann commit 77489a4eb76c3bf597bd92dee750cf8669cad1ce Merge: b1e052903cb56 4c188fa183ebb Author: Arnd Bergmann Date: Thu Jul 27 15:41:10 2023 +0200 Merge tag 'renesas-fixes-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/fixes Renesas fixes for v6.5 - Fix interrupt names for MTU3 channels on RZ/G2L and RZ/V2L. * tag 'renesas-fixes-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: dts: renesas: rzg2l: Update overfow/underflow IRQ names for MTU3 channels Link: https://lore.kernel.org/r/cover.1690463347.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit b1e052903cb5605e77476166a3296759835fdb69 Merge: c05cfd71df7c0 faafd6ca7e6e7 Author: Arnd Bergmann Date: Thu Jul 27 15:40:53 2023 +0200 Merge tag 'memory-controller-drv-fixes-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/fixes Memory controller drivers - fixes for v6.5 Two fixes are needed for Tegra194 memory controllers caused by the same Tegra PCI commit merged in v6.5-rc1. The Tegra PCI requires now interconnect from the memory controller, which was set only for Tegra234, but not for Tegra194, causing probe deferrals. Expose some dummy interconnect provider for Tegra194, to satisfy PCI driver needs. * tag 'memory-controller-drv-fixes-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: tegra: make icc_set_bw return zero if BWMGR not supported memory: tegra: Add dummy implementation on Tegra194 Link: https://lore.kernel.org/r/20230726084811.124038-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit c05cfd71df7c0adfaa60c153a75b23e6efbd3978 Merge: 09eadda27ca4a 53cab4d871690 Author: Arnd Bergmann Date: Thu Jul 27 15:40:33 2023 +0200 Merge tag 'imx-fixes-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 6.5: - A couple of ARM DTS fixes for i.MX6SLL usbphy and supported CPU frequency of sk-imx53 board - Add missing pull-up for imx8mn-var-som onboard PHY reset pinmux - A couple of imx8mm-venice fixes from Tim Harvey to diable disp_blk_ctrl - A couple of phycore-imx8mm fixes from Yashwanth Varakala to correct VPU label and gpio-line-names - Fix imx8mp-blk-ctrl driver to register HSIO PLL clock as bus_power_dev child, so that runtime PM can translate into the necessary GPC power domain action * tag 'imx-fixes-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx: imx8mp-blk-ctrl: register HSIO PLL clock as bus_power_dev child ARM: dts: nxp/imx: limit sk-imx53 supported frequencies arm64: dts: freescale: Fix VPU G2 clock arm64: dts: imx8mn-var-som: add missing pull-up for onboard PHY reset pinmux arm64: dts: phycore-imx8mm: Correction in gpio-line-names arm64: dts: phycore-imx8mm: Label typo-fix of VPU ARM: dts: nxp/imx6sll: fix wrong property name in usbphy node arm64: dts: imx8mm-venice-gw7904: disable disp_blk_ctrl arm64: dts: imx8mm-venice-gw7903: disable disp_blk_ctrl Link: https://lore.kernel.org/r/20230725075837.GR151430@dragon Signed-off-by: Arnd Bergmann commit 09eadda27ca4afc3f560efea265bbe7a93ef786d Author: Arnd Bergmann Date: Sun Mar 19 22:29:28 2023 +0100 backlight: corgi_lcd: fix missing prototype The corgi_lcd_limit_intensity() function is called from platform and defined in a driver, but the driver does not see the declaration: drivers/video/backlight/corgi_lcd.c:434:6: error: no previous prototype for 'corgi_lcd_limit_intensity' [-Werror=missing-prototypes] 434 | void corgi_lcd_limit_intensity(int limit) Move the prototype into a header that can be included from both sides to shut up the warning. Reviewed-by: Daniel Thompson Signed-off-by: Arnd Bergmann commit b161f25fa30644598007d752a1b802cda0140788 Author: Ian Rogers Date: Tue Jul 18 17:18:36 2023 -0700 perf parse-events: Only move force grouped evsels when sorting Prior to this change, events without a group would be sorted as if they were from the location of the first event without a group. For example instructions and cycles are without a group: instructions,{imc_free_running/data_read/,imc_free_running/data_write/},cycles parse events would create an eventual evlist like: instructions,cycles,{uncore_imc_free_running_0/data_read/,uncore_imc_free_running_1/data_read/,uncore_imc_free_running_0/data_write/,uncore_imc_free_running_1/data_write/} This is done so that perf metric events, that must always be in a group, will be adjacent and so can be forced into a group. This change modifies the sorting so that only force grouped events, like perf metrics, are sorted and all other events keep their position with respect to groups in the evlist. The location of the force grouped event is chosen to match the first force grouped event. For architectures without force grouped events, ie anything not Intel Icelake or newer, this should mean sorting and fixing doesn't modify the event positions except when fixing the grouping for PMUs of things like uncore events. Fixes: 347c2f0a0988c59c ("perf parse-events: Sort and group parsed events") Reported-by: Andi Kleen Signed-off-by: Ian Rogers Tested-by: Andi Kleen Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230719001836.198363-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e8d38345da249be17046b74d7bb64b77cdd07a08 Author: Ian Rogers Date: Tue Jul 18 17:18:35 2023 -0700 perf parse-events: When fixing group leaders always set the leader The evsel grouping fix iterates over evsels tracking the leader group and the current position's group, updating the current position's leader if an evsel is being forced into a group or groups changed. However, groups changing isn't a sufficient condition as sorting may have reordered events and the leader may no longer come first. For this reason update all leaders whenever they disagree. This change breaks certain Icelake+ metrics due to bugs in the kernel. For example, tma_l3_bound with threshold enabled tries to program the events: {topdown-retiring,slots,CYCLE_ACTIVITY.STALLS_L2_MISS,topdown-fe-bound,EXE_ACTIVITY.BOUND_ON_STORES,EXE_ACTIVITY.1_PORTS_UTIL,topdown-be-bound,cpu/INT_MISC.RECOVERY_CYCLES,cmask=1,edge/,CYCLE_ACTIVITY.STALLS_L3_MISS,CPU_CLK_UNHALTED.THREAD,CYCLE_ACTIVITY.STALLS_MEM_ANY,EXE_ACTIVITY.2_PORTS_UTIL,CYCLE_ACTIVITY.STALLS_TOTAL,topdown-bad-spec}:W fixing the perf metric event order gives: {slots,topdown-retiring,topdown-fe-bound,topdown-be-bound,topdown-bad-spec,CYCLE_ACTIVITY.STALLS_L2_MISS,EXE_ACTIVITY.BOUND_ON_STORES,EXE_ACTIVITY.1_PORTS_UTIL,cpu/INT_MISC.RECOVERY_CYCLES,cmask=1,edge/,CYCLE_ACTIVITY.STALLS_L3_MISS,CPU_CLK_UNHALTED.THREAD,CYCLE_ACTIVITY.STALLS_MEM_ANY,EXE_ACTIVITY.2_PORTS_UTIL,CYCLE_ACTIVITY.STALLS_TOTAL}:W Both of these return "" for all events, whilst they work with the group removed respecting that the perf metric events must still be grouped. A vendor events update will need to add METRIC_NO_GROUP to these metrics to workaround the kernel PMU driver issue. Fixes: a90cc5a9eeab45ea ("perf evsel: Don't let evsel__group_pmu_name() traverse unsorted group") Signed-off-by: Ian Rogers Tested-by: Andi Kleen Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230719001836.198363-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5c49b6c3f2cc6d44f691c4aa3d22ca49bedf637b Author: Ian Rogers Date: Tue Jul 18 17:18:34 2023 -0700 perf parse-events: Extra care around force grouped events Perf metric (topdown) events on Intel Icelake+ machines require a group, however, they may be next to events that don't require a group. Consider: cycles,slots,topdown-fe-bound The cycles event needn't be grouped but slots and topdown-fe-bound need grouping. Prior to this change, as slots and topdown-fe-bound need a group forcing and all events share the same PMU, slots and topdown-fe-bound would be forced into a group with cycles. This is a bug on two fronts, cycles wasn't supposed to be grouped and cycles can't be a group leader with a perf metric event. This change adds recognition that cycles isn't force grouped and so it shouldn't be force grouped with slots and topdown-fe-bound. Fixes: a90cc5a9eeab45ea ("perf evsel: Don't let evsel__group_pmu_name() traverse unsorted group") Signed-off-by: Ian Rogers Tested-by: Andi Kleen Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230719001836.198363-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3e9dce80dbf91972aed972c743f539c396a34312 Author: Ming Lei Date: Wed Jul 26 22:45:02 2023 +0800 ublk: return -EINTR if breaking from waiting for existed users in DEL_DEV If user interrupts wait_event_interruptible() in ublk_ctrl_del_dev(), return -EINTR and let user know what happens. Fixes: 0abe39dec065 ("block: ublk: improve handling device deletion") Reported-by: Stefano Garzarella Signed-off-by: Ming Lei Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20230726144502.566785-4-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 0c0cbd4ebc375ceebc75c89df04b74f215fab23a Author: Ming Lei Date: Wed Jul 26 22:45:01 2023 +0800 ublk: fail to recover device if queue setup is interrupted In ublk_ctrl_end_recovery(), if wait_for_completion_interruptible() is interrupted by signal, queues aren't setup successfully yet, so we have to fail UBLK_CMD_END_USER_RECOVERY, otherwise kernel oops can be triggered. Fixes: c732a852b419 ("ublk_drv: add START_USER_RECOVERY and END_USER_RECOVERY support") Reported-by: Stefano Garzarella Signed-off-by: Ming Lei Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20230726144502.566785-3-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 53e7d08f6d6e214c40db1f51291bb2975c789dc2 Author: Ming Lei Date: Wed Jul 26 22:45:00 2023 +0800 ublk: fail to start device if queue setup is interrupted In ublk_ctrl_start_dev(), if wait_for_completion_interruptible() is interrupted by signal, queues aren't setup successfully yet, so we have to fail UBLK_CMD_START_DEV, otherwise kernel oops can be triggered. Reported by German when working on qemu-storage-deamon which requires single thread ublk daemon. Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver") Reported-by: German Maglione Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230726144502.566785-2-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 3b9adfbba5af9e1e83897e832fbe6f5778bfc5d3 Merge: 8019a4ab3d80c f85739c0b2b0d Author: Takashi Iwai Date: Thu Jul 27 14:54:23 2023 +0200 Merge tag 'asoc-fix-v6.5-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.5 A collection of device specific fixes, none particularly remarkable. There's a set of repetitive fixes for the RealTek drivers fixing an issue with suspend that was replicated in multiple drivers. commit 2608766756578629b42b54c8307c56269ca07a33 Author: Heiko Carstens Date: Wed Jul 26 15:25:33 2023 +0200 s390: update defconfigs Changes from before and new defaults: - enable USER_EVENTS - enable FAULT_INJECTION_CONFIGFS (debug only) - disable FW_LOADER Signed-off-by: Heiko Carstens commit edc1e4b6e26536868ef819a735e04a5b32c10589 Author: Sven Schnelle Date: Wed Jul 26 11:10:19 2023 +0200 s390/vmem: split pages when debug pagealloc is enabled Since commit bb1520d581a3 ("s390/mm: start kernel with DAT enabled") the kernel crashes early during boot when debug pagealloc is enabled: mem auto-init: stack:off, heap alloc:off, heap free:off addressing exception: 0005 ilc:2 [#1] SMP DEBUG_PAGEALLOC Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 6.5.0-rc3-09759-gc5666c912155 #630 [..] Krnl Code: 00000000001325f6: ec5600248064 cgrj %r5,%r6,8,000000000013263e 00000000001325fc: eb880002000c srlg %r8,%r8,2 #0000000000132602: b2210051 ipte %r5,%r1,%r0,0 >0000000000132606: b90400d1 lgr %r13,%r1 000000000013260a: 41605008 la %r6,8(%r5) 000000000013260e: a7db1000 aghi %r13,4096 0000000000132612: b221006d ipte %r6,%r13,%r0,0 0000000000132616: e3d0d0000171 lay %r13,4096(%r13) Call Trace: __kernel_map_pages+0x14e/0x320 __free_pages_ok+0x23a/0x5a8) free_low_memory_core_early+0x214/0x2c8 memblock_free_all+0x28/0x58 mem_init+0xb6/0x228 mm_core_init+0xb6/0x3b0 start_kernel+0x1d2/0x5a8 startup_continue+0x36/0x40 Kernel panic - not syncing: Fatal exception: panic_on_oops This is caused by using large mappings on machines with EDAT1/EDAT2. Add the code to split the mappings into 4k pages if debug pagealloc is enabled by CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT or the debug_pagealloc kernel command line option. Fixes: bb1520d581a3 ("s390/mm: start kernel with DAT enabled") Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit de52e17326c3e9a719c9ead4adb03467b8fae0ef Author: Fedor Pchelkin Date: Wed Jul 26 00:46:25 2023 +0300 tipc: stop tipc crypto on failure in tipc_node_create If tipc_link_bc_create() fails inside tipc_node_create() for a newly allocated tipc node then we should stop its tipc crypto and free the resources allocated with a call to tipc_crypto_start(). As the node ref is initialized to one to that point, just put the ref on tipc_link_bc_create() error case that would lead to tipc_node_free() be eventually executed and properly clean the node and its crypto resources. Found by Linux Verification Center (linuxtesting.org). Fixes: cb8092d70a6f ("tipc: move bc link creation back to tipc_node_create") Suggested-by: Xin Long Signed-off-by: Fedor Pchelkin Reviewed-by: Xin Long Link: https://lore.kernel.org/r/20230725214628.25246-1-pchelkin@ispras.ru Signed-off-by: Paolo Abeni commit ecb4534b6a1c8a9c01d4d1d532d58fc18f23c8da Author: Kuniyuki Iwashima Date: Wed Jul 26 12:08:28 2023 -0700 af_unix: Terminate sun_path when bind()ing pathname socket. kernel test robot reported slab-out-of-bounds access in strlen(). [0] Commit 06d4c8a80836 ("af_unix: Fix fortify_panic() in unix_bind_bsd().") removed unix_mkname_bsd() call in unix_bind_bsd(). If sunaddr->sun_path is not terminated by user and we don't enable CONFIG_INIT_STACK_ALL_ZERO=y, strlen() will do the out-of-bounds access during file creation. Let's go back to strlen()-with-sockaddr_storage way and pack all 108 trickiness into unix_mkname_bsd() with bold comments. [0]: BUG: KASAN: slab-out-of-bounds in strlen (lib/string.c:?) Read of size 1 at addr ffff000015492777 by task fortify_strlen_/168 CPU: 0 PID: 168 Comm: fortify_strlen_ Not tainted 6.5.0-rc1-00333-g3329b603ebba #16 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace (arch/arm64/kernel/stacktrace.c:235) show_stack (arch/arm64/kernel/stacktrace.c:242) dump_stack_lvl (lib/dump_stack.c:107) print_report (mm/kasan/report.c:365 mm/kasan/report.c:475) kasan_report (mm/kasan/report.c:590) __asan_report_load1_noabort (mm/kasan/report_generic.c:378) strlen (lib/string.c:?) getname_kernel (./include/linux/fortify-string.h:? fs/namei.c:226) kern_path_create (fs/namei.c:3926) unix_bind (net/unix/af_unix.c:1221 net/unix/af_unix.c:1324) __sys_bind (net/socket.c:1792) __arm64_sys_bind (net/socket.c:1801) invoke_syscall (arch/arm64/kernel/syscall.c:? arch/arm64/kernel/syscall.c:52) el0_svc_common (./include/linux/thread_info.h:127 arch/arm64/kernel/syscall.c:147) do_el0_svc (arch/arm64/kernel/syscall.c:189) el0_svc (./arch/arm64/include/asm/daifflags.h:28 arch/arm64/kernel/entry-common.c:133 arch/arm64/kernel/entry-common.c:144 arch/arm64/kernel/entry-common.c:648) el0t_64_sync_handler (arch/arm64/kernel/entry-common.c:?) el0t_64_sync (arch/arm64/kernel/entry.S:591) Allocated by task 168: kasan_set_track (mm/kasan/common.c:45 mm/kasan/common.c:52) kasan_save_alloc_info (mm/kasan/generic.c:512) __kasan_kmalloc (mm/kasan/common.c:383) __kmalloc (mm/slab_common.c:? mm/slab_common.c:998) unix_bind (net/unix/af_unix.c:257 net/unix/af_unix.c:1213 net/unix/af_unix.c:1324) __sys_bind (net/socket.c:1792) __arm64_sys_bind (net/socket.c:1801) invoke_syscall (arch/arm64/kernel/syscall.c:? arch/arm64/kernel/syscall.c:52) el0_svc_common (./include/linux/thread_info.h:127 arch/arm64/kernel/syscall.c:147) do_el0_svc (arch/arm64/kernel/syscall.c:189) el0_svc (./arch/arm64/include/asm/daifflags.h:28 arch/arm64/kernel/entry-common.c:133 arch/arm64/kernel/entry-common.c:144 arch/arm64/kernel/entry-common.c:648) el0t_64_sync_handler (arch/arm64/kernel/entry-common.c:?) el0t_64_sync (arch/arm64/kernel/entry.S:591) The buggy address belongs to the object at ffff000015492700 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 0 bytes to the right of allocated 119-byte region [ffff000015492700, ffff000015492777) The buggy address belongs to the physical page: page:00000000aeab52ba refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x55492 anon flags: 0x3fffc0000000200(slab|node=0|zone=0|lastcpupid=0xffff) page_type: 0xffffffff() raw: 03fffc0000000200 ffff0000084018c0 fffffc00003d0e00 0000000000000005 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff000015492600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff000015492680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff000015492700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07 fc ^ ffff000015492780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff000015492800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb Fixes: 06d4c8a80836 ("af_unix: Fix fortify_panic() in unix_bind_bsd().") Reported-by: kernel test robot Closes: https://lore.kernel.org/netdev/202307262110.659e5e8-oliver.sang@intel.com/ Signed-off-by: Kuniyuki Iwashima Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230726190828.47874-1-kuniyu@amazon.com Signed-off-by: Paolo Abeni commit d893832d0e1ef41c72cdae444268c1d64a2be8ad Author: Borislav Petkov (AMD) Date: Fri Jul 7 13:53:41 2023 +0200 x86/srso: Add IBPB on VMEXIT Add the option to flush IBPB only on VMEXIT in order to protect from malicious guests but one otherwise trusts the software that runs on the hypervisor. Signed-off-by: Borislav Petkov (AMD) commit 233d6f68b98d480a7c42ebe78c38f79d44741ca9 Author: Borislav Petkov (AMD) Date: Thu Jul 6 15:04:35 2023 +0200 x86/srso: Add IBPB Add the option to mitigate using IBPB on a kernel entry. Pull in the Retbleed alternative so that the IBPB call from there can be used. Also, if Retbleed mitigation is done using IBPB, the same mitigation can and must be used here. Signed-off-by: Borislav Petkov (AMD) commit 1b5277c0ea0b247393a9c426769fde18cff5e2f6 Author: Borislav Petkov (AMD) Date: Thu Jun 29 17:43:40 2023 +0200 x86/srso: Add SRSO_NO support Add support for the CPUID flag which denotes that the CPU is not affected by SRSO. Signed-off-by: Borislav Petkov (AMD) commit 79113e4060aba744787a81edb9014f2865193854 Author: Borislav Petkov (AMD) Date: Tue Jul 18 11:13:40 2023 +0200 x86/srso: Add IBPB_BRTYPE support Add support for the synthetic CPUID flag which "if this bit is 1, it indicates that MSR 49h (PRED_CMD) bit 0 (IBPB) flushes all branch type predictions from the CPU branch predictor." This flag is there so that this capability in guests can be detected easily (otherwise one would have to track microcode revisions which is impossible for guests). It is also needed only for Zen3 and -4. The other two (Zen1 and -2) always flush branch type predictions by default. Signed-off-by: Borislav Petkov (AMD) commit fb3bd914b3ec28f5fb697ac55c4846ac2d542855 Author: Borislav Petkov (AMD) Date: Wed Jun 28 11:02:39 2023 +0200 x86/srso: Add a Speculative RAS Overflow mitigation Add a mitigation for the speculative return address stack overflow vulnerability found on AMD processors. The mitigation works by ensuring all RET instructions speculate to a controlled location, similar to how speculation is controlled in the retpoline sequence. To accomplish this, the __x86_return_thunk forces the CPU to mispredict every function return using a 'safe return' sequence. To ensure the safety of this mitigation, the kernel must ensure that the safe return sequence is itself free from attacker interference. In Zen3 and Zen4, this is accomplished by creating a BTB alias between the untraining function srso_untrain_ret_alias() and the safe return function srso_safe_ret_alias() which results in evicting a potentially poisoned BTB entry and using that safe one for all function returns. In older Zen1 and Zen2, this is accomplished using a reinterpretation technique similar to Retbleed one: srso_untrain_ret() and srso_safe_ret(). Signed-off-by: Borislav Petkov (AMD) commit e46e06ffc6d667a89b979701288e2264f45e6a7b Author: Yuanjun Gong Date: Tue Jul 25 14:48:10 2023 +0800 tipc: check return value of pskb_trim() goto free_skb if an unexpected result is returned by pskb_tirm() in tipc_crypto_rcv_complete(). Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication") Signed-off-by: Yuanjun Gong Reviewed-by: Tung Nguyen Link: https://lore.kernel.org/r/20230725064810.5820-1-ruc_gongyuanjun@163.com Signed-off-by: Paolo Abeni commit 7f2327666a9080e428166964e37548b0168cd5e9 Author: Xu Yang Date: Wed Jul 5 17:52:31 2023 +0800 usb: misc: ehset: fix wrong if condition A negative number from ret means the host controller had failed to send usb message and 0 means succeed. Therefore, the if logic is wrong here and this patch will fix it. Fixes: f2b42379c576 ("usb: misc: ehset: Rework test mode entry") Cc: stable Signed-off-by: Xu Yang Link: https://lore.kernel.org/r/20230705095231.457860-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman commit b32b8f2b9542d8039f5468303a6ca78c1b5611a5 Author: Gratian Crisan Date: Wed Jul 26 13:45:56 2023 -0500 usb: dwc3: pci: skip BYT GPIO lookup table for hardwired phy Hardware based on the Bay Trail / BYT SoCs require an external ULPI phy for USB device-mode. The phy chip usually has its 'reset' and 'chip select' lines connected to GPIOs described by ACPI fwnodes in the DSDT table. Because of hardware with missing ACPI resources for the 'reset' and 'chip select' GPIOs commit 5741022cbdf3 ("usb: dwc3: pci: Add GPIO lookup table on platforms without ACPI GPIO resources") introduced a fallback gpiod_lookup_table with hard-coded mappings for Bay Trail devices. However there are existing Bay Trail based devices, like the National Instruments cRIO-903x series, where the phy chip has its 'reset' and 'chip-select' lines always asserted in hardware via resistor pull-ups. On this hardware the phy chip is always enabled and the ACPI dsdt table is missing information not only for the 'chip-select' and 'reset' lines but also for the BYT GPIO controller itself "INT33FC". With the introduction of the gpiod_lookup_table initializing the USB device-mode on these hardware now errors out. The error comes from the gpiod_get_optional() calls in dwc3_pci_quirks() which will now return an -ENOENT error due to the missing ACPI entry for the INT33FC gpio controller used in the aforementioned table. This hardware used to work before because gpiod_get_optional() will return NULL instead of -ENOENT if no GPIO has been assigned to the requested function. The dwc3_pci_quirks() code for setting the 'cs' and 'reset' GPIOs was then skipped (due to the NULL return). This is the correct behavior in cases where the phy chip is hardwired and there are no GPIOs to control. Since the gpiod_lookup_table relies on the presence of INT33FC fwnode in ACPI tables only add the table if we know the entry for the INT33FC gpio controller is present. This allows Bay Trail based devices with hardwired dwc3 ULPI phys to continue working. Fixes: 5741022cbdf3 ("usb: dwc3: pci: Add GPIO lookup table on platforms without ACPI GPIO resources") Cc: stable Signed-off-by: Gratian Crisan Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230726184555.218091-2-gratian.crisan@ni.com Signed-off-by: Greg Kroah-Hartman commit 5c85f7065718a949902b238a6abd8fc907c5d3e0 Author: Yuanjun Gong Date: Tue Jul 25 11:27:26 2023 +0800 benet: fix return value check in be_lancer_xmit_workarounds() in be_lancer_xmit_workarounds(), it should go to label 'tx_drop' if an unexpected value is returned by pskb_trim(). Fixes: 93040ae5cc8d ("be2net: Fix to trim skb for padded vlan packets to workaround an ASIC Bug") Signed-off-by: Yuanjun Gong Link: https://lore.kernel.org/r/20230725032726.15002-1-ruc_gongyuanjun@163.com Signed-off-by: Paolo Abeni commit 5f1c7031e044cb2fba82836d55cc235e2ad619dc Author: Zhang Shurong Date: Sun Jul 9 13:50:07 2023 +0800 staging: ks7010: potential buffer overflow in ks_wlan_set_encode_ext() The "exc->key_len" is a u16 that comes from the user. If it's over IW_ENCODING_TOKEN_MAX (64) that could lead to memory corruption. Fixes: b121d84882b9 ("staging: ks7010: simplify calls to memcpy()") Cc: stable Signed-off-by: Zhang Shurong Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/tencent_5153B668C0283CAA15AA518325346E026A09@qq.com Signed-off-by: Greg Kroah-Hartman commit 4912649e1cf0317bf563f91655e04a303cacaf8d Author: Raphael Gallais-Pou Date: Tue Jul 18 19:20:24 2023 +0200 staging: fbtft: ili9341: use macro FBTFT_REGISTER_SPI_DRIVER Using FBTFT_REGISTER_DRIVER resolves to a NULL struct spi_device_id. This ultimately causes a warning when the module probes. Fixes it. Signed-off-by: Raphael Gallais-Pou Link: https://lore.kernel.org/r/20230718172024.67488-1-rgallaispou@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2dedcf414bb01b8d966eb445db1d181d92304fb2 Author: Guchun Chen Date: Mon Jul 24 10:42:29 2023 +0800 drm/ttm: check null pointer before accessing when swapping Add a check to avoid null pointer dereference as below: [ 90.002283] general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN NOPTI [ 90.002292] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] [ 90.002346] ? exc_general_protection+0x159/0x240 [ 90.002352] ? asm_exc_general_protection+0x26/0x30 [ 90.002357] ? ttm_bo_evict_swapout_allowable+0x322/0x5e0 [ttm] [ 90.002365] ? ttm_bo_evict_swapout_allowable+0x42e/0x5e0 [ttm] [ 90.002373] ttm_bo_swapout+0x134/0x7f0 [ttm] [ 90.002383] ? __pfx_ttm_bo_swapout+0x10/0x10 [ttm] [ 90.002391] ? lock_acquire+0x44d/0x4f0 [ 90.002398] ? ttm_device_swapout+0xa5/0x260 [ttm] [ 90.002412] ? lock_acquired+0x355/0xa00 [ 90.002416] ? do_raw_spin_trylock+0xb6/0x190 [ 90.002421] ? __pfx_lock_acquired+0x10/0x10 [ 90.002426] ? ttm_global_swapout+0x25/0x210 [ttm] [ 90.002442] ttm_device_swapout+0x198/0x260 [ttm] [ 90.002456] ? __pfx_ttm_device_swapout+0x10/0x10 [ttm] [ 90.002472] ttm_global_swapout+0x75/0x210 [ttm] [ 90.002486] ttm_tt_populate+0x187/0x3f0 [ttm] [ 90.002501] ttm_bo_handle_move_mem+0x437/0x590 [ttm] [ 90.002517] ttm_bo_validate+0x275/0x430 [ttm] [ 90.002530] ? __pfx_ttm_bo_validate+0x10/0x10 [ttm] [ 90.002544] ? kasan_save_stack+0x33/0x60 [ 90.002550] ? kasan_set_track+0x25/0x30 [ 90.002554] ? __kasan_kmalloc+0x8f/0xa0 [ 90.002558] ? amdgpu_gtt_mgr_new+0x81/0x420 [amdgpu] [ 90.003023] ? ttm_resource_alloc+0xf6/0x220 [ttm] [ 90.003038] amdgpu_bo_pin_restricted+0x2dd/0x8b0 [amdgpu] [ 90.003210] ? __x64_sys_ioctl+0x131/0x1a0 [ 90.003210] ? do_syscall_64+0x60/0x90 Fixes: a2848d08742c ("drm/ttm: never consider pinned BOs for eviction&swap") Tested-by: Mikhail Gavrilov Signed-off-by: Guchun Chen Reviewed-by: Alex Deucher Reviewed-by: Christian König Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20230724024229.1118444-1-guchun.chen@amd.com Signed-off-by: Christian König commit ac83631230f77dda94154ed0ebfd368fc81c70a3 Author: Larry Finger Date: Fri Jul 14 12:54:17 2023 -0500 staging: r8712: Fix memory leak in _r8712_init_xmit_priv() In the above mentioned routine, memory is allocated in several places. If the first succeeds and a later one fails, the routine will leak memory. This patch fixes commit 2865d42c78a9 ("staging: r8712u: Add the new driver to the mainline kernel"). A potential memory leak in r8712_xmit_resource_alloc() is also addressed. Fixes: 2865d42c78a9 ("staging: r8712u: Add the new driver to the mainline kernel") Reported-by: syzbot+cf71097ffb6755df8251@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/x/log.txt?x=11ac3fa0a80000 Cc: stable@vger.kernel.org Cc: Nam Cao Signed-off-by: Larry Finger Reviewed-by: Nam Cao Link: https://lore.kernel.org/r/20230714175417.18578-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 8019a4ab3d80c7af391a646cccff953753fc025f Author: Pavel Asyutchenko Date: Thu Jul 27 01:37:32 2023 +0300 ALSA: hda/realtek: Support ASUS G713PV laptop This laptop has CS35L41 amp connected via I2C. With this patch speakers begin to work if the missing _DSD properties are added to ACPI tables. Signed-off-by: Pavel Asyutchenko Cc: Link: https://lore.kernel.org/r/20230726223732.20775-1-svenpavel@gmail.com Signed-off-by: Takashi Iwai commit c04e9894846c663f3278a414f34416e6e45bbe68 Author: Demi Marie Obenour Date: Wed Jul 26 12:52:41 2023 -0400 xen: speed up grant-table reclaim When a grant entry is still in use by the remote domain, Linux must put it on a deferred list. Normally, this list is very short, because the PV network and block protocols expect the backend to unmap the grant first. However, Qubes OS's GUI protocol is subject to the constraints of the X Window System, and as such winds up with the frontend unmapping the window first. As a result, the list can grow very large, resulting in a massive memory leak and eventual VM freeze. To partially solve this problem, make the number of entries that the VM will attempt to free at each iteration tunable. The default is still 10, but it can be overridden via a module parameter. This is Cc: stable because (when combined with appropriate userspace changes) it fixes a severe performance and stability problem for Qubes OS users. Cc: stable@vger.kernel.org Signed-off-by: Demi Marie Obenour Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20230726165354.1252-1-demi@invisiblethingslab.com Signed-off-by: Juergen Gross commit ff0df20827f6ac32822f9855998c4db3e99af47c Merge: 25266128fe16d 0ebc1064e4874 Author: Jakub Kicinski Date: Wed Jul 26 22:18:00 2023 -0700 Merge tag 'nf-23-07-26' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Florian Westphal says: ==================== netfilter fixes for net 1. On-demand overlap detection in 'rbtree' set can cause memory leaks. This is broken since 6.2. 2. An earlier fix in 6.4 to address an imbalance in refcounts during transaction error unwinding was incomplete, from Pablo Neira. 3. Disallow adding a rule to a deleted chain, also from Pablo. Broken since 5.9. * tag 'nf-23-07-26' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nf_tables: disallow rule addition to bound chain via NFTA_RULE_CHAIN_ID netfilter: nf_tables: skip immediate deactivate in _PREPARE_ERROR netfilter: nft_set_rbtree: fix overlap expiration walk ==================== Link: https://lore.kernel.org/r/20230726152524.26268-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit 25266128fe16d5632d43ada34c847d7b8daba539 Author: Jason Wang Date: Tue Jul 25 03:20:49 2023 -0400 virtio-net: fix race between set queues and probe A race were found where set_channels could be called after registering but before virtnet_set_queues() in virtnet_probe(). Fixing this by moving the virtnet_set_queues() before netdevice registering. While at it, use _virtnet_set_queues() to avoid holding rtnl as the device is not even registered at that time. Cc: stable@vger.kernel.org Fixes: a220871be66f ("virtio-net: correctly enable multiqueue") Signed-off-by: Jason Wang Acked-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo Link: https://lore.kernel.org/r/20230725072049.617289-1-jasowang@redhat.com Signed-off-by: Jakub Kicinski commit 6c58c8816abb7b93b21fa3b1d0c1726402e5e568 Author: Lin Ma Date: Tue Jul 25 10:42:27 2023 +0800 net/sched: mqprio: Add length check for TCA_MQPRIO_{MAX/MIN}_RATE64 The nla_for_each_nested parsing in function mqprio_parse_nlattr() does not check the length of the nested attribute. This can lead to an out-of-attribute read and allow a malformed nlattr (e.g., length 0) to be viewed as 8 byte integer and passed to priv->max_rate/min_rate. This patch adds the check based on nla_len() when check the nla_type(), which ensures that the length of these two attribute must equals sizeof(u64). Fixes: 4e8b86c06269 ("mqprio: Introduce new hardware offload mode and shaper in mqprio") Reviewed-by: Victor Nogueira Signed-off-by: Lin Ma Link: https://lore.kernel.org/r/20230725024227.426561-1-linma@zju.edu.cn Signed-off-by: Jakub Kicinski commit 0f0fa27b871b53a62c3cd2b054ebcce199277310 Author: Jan Stancek Date: Mon Jul 24 19:39:04 2023 +0200 splice, net: Fix splice_to_socket() for O_NONBLOCK socket LTP sendfile07 [1], which expects sendfile() to return EAGAIN when transferring data from regular file to a "full" O_NONBLOCK socket, started failing after commit 2dc334f1a63a ("splice, net: Use sendmsg(MSG_SPLICE_PAGES) rather than ->sendpage()"). sendfile() no longer immediately returns, but now blocks. Removed sock_sendpage() handled this case by setting a MSG_DONTWAIT flag, fix new splice_to_socket() to do the same for O_NONBLOCK sockets. [1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/sendfile/sendfile07.c Fixes: 2dc334f1a63a ("splice, net: Use sendmsg(MSG_SPLICE_PAGES) rather than ->sendpage()") Acked-by: David Howells Signed-off-by: Jan Stancek Tested-by: Xi Ruoyao Link: https://lore.kernel.org/r/023c0e21e595e00b93903a813bc0bfb9a5d7e368.1690219914.git.jstancek@redhat.com Signed-off-by: Jakub Kicinski commit 15cec633fc7bfe4cd69aa012c3b35b31acfc86f2 Author: Wei Fang Date: Tue Jul 25 15:41:48 2023 +0800 net: fec: tx processing does not call XDP APIs if budget is 0 According to the clarification [1] in the latest napi.rst, the tx processing cannot call any XDP (or page pool) APIs if the "budget" is 0. Because NAPI is called with the budget of 0 (such as netpoll) indicates we may be in an IRQ context, however, we cannot use the page pool from IRQ context. [1] https://lore.kernel.org/all/20230720161323.2025379-1-kuba@kernel.org/ Fixes: 20f797399035 ("net: fec: recycle pages for transmitted XDP frames") Signed-off-by: Wei Fang Suggested-by: Jakub Kicinski Link: https://lore.kernel.org/r/20230725074148.2936402-1-wei.fang@nxp.com Signed-off-by: Jakub Kicinski commit b84000f2274520f73ac9dc59fd9403260b61c4e7 Author: Guenter Roeck Date: Wed Jul 26 20:18:13 2023 -0700 hwmon: (pmbus_core) Fix Deadlock in pmbus_regulator_get_status pmbus_regulator_get_status() acquires update_lock. pmbus_regulator_get_error_flags() acquires it again, resulting in an immediate deadlock. Call _pmbus_get_flags() from pmbus_regulator_get_status() directly to avoid the problem. Reported-by: Patrick Rudolph Closes: https://lore.kernel.org/linux-hwmon/b7a3ad85-aab4-4718-a001-1d8b1c0eef36@roeck-us.net/T/#u Cc: Naresh Solanki Cc: stable@vger.kernel.org # v6.2+ Fixes: c05f477c4ba3 ("hwmon: (pmbus/core) Implement regulator get_status") Signed-off-by: Guenter Roeck commit 2e3c5df2ee89d01c4dc6c30b4366375d3cf942bd Merge: fa29d467977d5 21d9b73a7d524 Author: Jakub Kicinski Date: Wed Jul 26 16:48:55 2023 -0700 Merge branch 'mptcp-more-fixes-for-6-5' Mat Martineau says: ==================== mptcp: More fixes for 6.5 Patch 1: Better detection of ip6tables vs ip6tables-legacy tools for self tests. Fix for 6.4 and newer. Patch 2: Only generate "new listener" event if listen operation succeeds. Fix for 6.2 and newer. ==================== Link: https://lore.kernel.org/r/20230725-send-net-20230725-v1-0-6f60fe7137a9@kernel.org Signed-off-by: Jakub Kicinski commit 21d9b73a7d5241905367098d260a3c68b811da32 Author: Paolo Abeni Date: Tue Jul 25 11:34:56 2023 -0700 mptcp: more accurate NL event generation Currently the mptcp code generate a "new listener" event even if the actual listen() syscall fails. Address the issue moving the event generation call under the successful branch. Cc: stable@vger.kernel.org Fixes: f8c9dfbd875b ("mptcp: add pm listener events") Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20230725-send-net-20230725-v1-2-6f60fe7137a9@kernel.org Signed-off-by: Jakub Kicinski commit 016e7ba47f33064fbef8c4307a2485d2669dfd03 Author: Matthieu Baerts Date: Tue Jul 25 11:34:55 2023 -0700 selftests: mptcp: join: only check for ip6tables if needed If 'iptables-legacy' is available, 'ip6tables-legacy' command will be used instead of 'ip6tables'. So no need to look if 'ip6tables' is available in this case. Cc: stable@vger.kernel.org Fixes: 0c4cd3f86a40 ("selftests: mptcp: join: use 'iptables-legacy' if available") Acked-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20230725-send-net-20230725-v1-1-6f60fe7137a9@kernel.org Signed-off-by: Jakub Kicinski commit a8f014ec6a214c94ed6a9ff5ba8904a5cadd42a6 Author: Kees Cook Date: Thu Jul 20 08:15:06 2023 -0700 vboxsf: Use flexible arrays for trailing string member The declaration of struct shfl_string used trailing fake flexible arrays for the string member. This was tripping FORTIFY_SOURCE since commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3"). Replace the utf8 and utf16 members with actual flexible arrays, drop the unused ucs2 member, and retriain a 2 byte padding to keep the structure size the same. Reported-by: Larry Finger Closes: https://lore.kernel.org/lkml/ab3a70e9-60ed-0f13-e3d4-8866eaccc8c1@lwfinger.net/ Tested-by: Larry Finger Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230720151458.never.673-kees@kernel.org Signed-off-by: Kees Cook commit 53d737dfd3d7b023fa9fa445ea3f3db0ac9da402 Author: Shay Drory Date: Sun Jun 25 11:07:38 2023 +0300 net/mlx5: Unregister devlink params in case interface is down Currently, in case an interface is down, mlx5 driver doesn't unregister its devlink params, which leads to this WARN[1]. Fix it by unregistering devlink params in that case as well. [1] [ 295.244769 ] WARNING: CPU: 15 PID: 1 at net/core/devlink.c:9042 devlink_free+0x174/0x1fc [ 295.488379 ] CPU: 15 PID: 1 Comm: shutdown Tainted: G S OE 5.15.0-1017.19.3.g0677e61-bluefield #g0677e61 [ 295.509330 ] Hardware name: https://www.mellanox.com BlueField SoC/BlueField SoC, BIOS 4.2.0.12761 Jun 6 2023 [ 295.543096 ] pc : devlink_free+0x174/0x1fc [ 295.551104 ] lr : mlx5_devlink_free+0x18/0x2c [mlx5_core] [ 295.561816 ] sp : ffff80000809b850 [ 295.711155 ] Call trace: [ 295.716030 ] devlink_free+0x174/0x1fc [ 295.723346 ] mlx5_devlink_free+0x18/0x2c [mlx5_core] [ 295.733351 ] mlx5_sf_dev_remove+0x98/0xb0 [mlx5_core] [ 295.743534 ] auxiliary_bus_remove+0x2c/0x50 [ 295.751893 ] __device_release_driver+0x19c/0x280 [ 295.761120 ] device_release_driver+0x34/0x50 [ 295.769649 ] bus_remove_device+0xdc/0x170 [ 295.777656 ] device_del+0x17c/0x3a4 [ 295.784620 ] mlx5_sf_dev_remove+0x28/0xf0 [mlx5_core] [ 295.794800 ] mlx5_sf_dev_table_destroy+0x98/0x110 [mlx5_core] [ 295.806375 ] mlx5_unload+0x34/0xd0 [mlx5_core] [ 295.815339 ] mlx5_unload_one+0x70/0xe4 [mlx5_core] [ 295.824998 ] shutdown+0xb0/0xd8 [mlx5_core] [ 295.833439 ] pci_device_shutdown+0x3c/0xa0 [ 295.841651 ] device_shutdown+0x170/0x340 [ 295.849486 ] __do_sys_reboot+0x1f4/0x2a0 [ 295.857322 ] __arm64_sys_reboot+0x2c/0x40 [ 295.865329 ] invoke_syscall+0x78/0x100 [ 295.872817 ] el0_svc_common.constprop.0+0x54/0x184 [ 295.882392 ] do_el0_svc+0x30/0xac [ 295.889008 ] el0_svc+0x48/0x160 [ 295.895278 ] el0t_64_sync_handler+0xa4/0x130 [ 295.903807 ] el0t_64_sync+0x1a4/0x1a8 [ 295.911120 ] ---[ end trace 4f1d2381d00d9dce ]--- Fixes: fe578cbb2f05 ("net/mlx5: Move devlink registration before mlx5_load") Signed-off-by: Shay Drory Reviewed-by: Maher Sanalla Signed-off-by: Saeed Mahameed commit 62752c0bc67f79f064cbe2605054f99d52809e7b Author: Shay Drory Date: Wed Jun 14 09:03:32 2023 +0300 net/mlx5: DR, Fix peer domain namespace setting The offending patch is based on the assumption that for PFs, mlx5_get_dev_index() is the same as vhca_id. However, this assumption is wrong in case of DPU (ECPF). Fix it by using vhca_id directly, and switch the array of peers to xarray. Fixes: 6d5b7321d8af ("net/mlx5: DR, handle more than one peer domain") Signed-off-by: Shay Drory Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit 61eab651f6e96791cfad6db45f1107c398699b2d Author: Chris Mi Date: Mon Jul 17 08:32:51 2023 +0300 net/mlx5: fs_chains: Fix ft prio if ignore_flow_level is not supported The cited commit sets ft prio to fs_base_prio. But if ignore_flow_level it not supported, ft prio must be set based on tc filter prio. Otherwise, all the ft prio are the same on the same chain. It is invalid if ignore_flow_level is not supported. Fix it by setting ft prio based on tc filter prio and setting fs_base_prio to 0 for fdb. Fixes: 8e80e5648092 ("net/mlx5: fs_chains: Refactor to detach chains from tc usage") Signed-off-by: Chris Mi Reviewed-by: Paul Blakey Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 3e4cf1dd2ce413f4be3e2c9062fb470e2ad2be88 Author: Jianbo Liu Date: Mon May 8 03:36:10 2023 +0000 net/mlx5e: kTLS, Fix protection domain in use syndrome when devlink reload There are DEK objects cached in DEK pool after kTLS is used, and they are freed only in mlx5e_ktls_cleanup(). mlx5e_destroy_mdev_resources() is called in mlx5e_suspend() to free mdev resources, including protection domain (PD). However, PD is still referenced by the cached DEK objects in this case, because profile->cleanup() (and therefore mlx5e_ktls_cleanup()) is called after mlx5e_suspend() during devlink reload. So the following FW syndrome is generated: mlx5_cmd_out_err:803:(pid 12948): DEALLOC_PD(0x801) op_mod(0x0) failed, status bad resource state(0x9), syndrome (0xef0c8a), err(-22) To avoid this syndrome, move DEK pool destruction to mlx5e_ktls_cleanup_tx(), which is called by profile->cleanup_tx(). And move pool creation to mlx5e_ktls_init_tx() for symmetry. Fixes: f741db1a5171 ("net/mlx5e: kTLS, Improve connection rate by using fast update encryption key") Signed-off-by: Jianbo Liu Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit eb02b93aad952008f1692cee5c5b13001e908407 Author: Vlad Buslov Date: Tue Jun 27 09:26:56 2023 +0200 net/mlx5: Bridge, set debugfs access right to root-only As suggested during code review set the access rights for bridge 'fdb' debugfs file to root-only. Fixes: 791eb78285e8 ("net/mlx5: Bridge, expose FDB state via debugfs") Reported-by: Jakub Kicinski Link: https://lore.kernel.org/netdev/20230619120515.5045132a@kernel.org/ Signed-off-by: Vlad Buslov Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit 39646d9bcd1a65d2396328026626859a1dab59d7 Author: Dragos Tatulea Date: Mon Apr 24 18:19:00 2023 +0300 net/mlx5e: xsk: Fix crash on regular rq reactivation When the regular rq is reactivated after the XSK socket is closed it could be reading stale cqes which eventually corrupts the rq. This leads to no more traffic being received on the regular rq and a crash on the next close or deactivation of the rq. Kal Cuttler Conely reported this issue as a crash on the release path when the xdpsock sample program is stopped (killed) and restarted in sequence while traffic is running. This patch flushes all cqes when during the rq flush. The cqe flushing is done in the reset state of the rq. mlx5e_rq_to_ready code is moved into the flush function to allow for this. Fixes: 082a9edf12fe ("net/mlx5e: xsk: Flush RQ on XSK activation to save memory") Reported-by: Kal Cutter Conley Closes: https://lore.kernel.org/xdp-newbies/CAHApi-nUAs4TeFWUDV915CZJo07XVg2Vp63-no7UDfj6wur9nQ@mail.gmail.com Signed-off-by: Dragos Tatulea Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit e0f52298fee449fec37e3e3c32df60008b509b16 Author: Dragos Tatulea Date: Tue Jul 18 11:13:33 2023 +0300 net/mlx5e: xsk: Fix invalid buffer access for legacy rq The below crash can be encountered when using xdpsock in rx mode for legacy rq: the buffer gets released in the XDP_REDIRECT path, and then once again in the driver. This fix sets the flag to avoid releasing on the driver side. XSK handling of buffers for legacy rq was relying on the caller to set the skip release flag. But the referenced fix started using fragment counts for pages instead of the skip flag. Crash log: general protection fault, probably for non-canonical address 0xffff8881217e3a: 0000 [#1] SMP CPU: 0 PID: 14 Comm: ksoftirqd/0 Not tainted 6.5.0-rc1+ #31 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:bpf_prog_03b13f331978c78c+0xf/0x28 Code: ... RSP: 0018:ffff88810082fc98 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff888138404901 RCX: c0ffffc900027cbc RDX: ffffffffa000b514 RSI: 00ffff8881217e32 RDI: ffff888138404901 RBP: ffff88810082fc98 R08: 0000000000091100 R09: 0000000000000006 R10: 0000000000000800 R11: 0000000000000800 R12: ffffc9000027a000 R13: ffff8881217e2dc0 R14: ffff8881217e2910 R15: ffff8881217e2f00 FS: 0000000000000000(0000) GS:ffff88852c800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000564cb2e2cde0 CR3: 000000010e603004 CR4: 0000000000370eb0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? die_addr+0x32/0x80 ? exc_general_protection+0x192/0x390 ? asm_exc_general_protection+0x22/0x30 ? 0xffffffffa000b514 ? bpf_prog_03b13f331978c78c+0xf/0x28 mlx5e_xdp_handle+0x48/0x670 [mlx5_core] ? dev_gro_receive+0x3b5/0x6e0 mlx5e_xsk_skb_from_cqe_linear+0x6e/0x90 [mlx5_core] mlx5e_handle_rx_cqe+0x55/0x100 [mlx5_core] mlx5e_poll_rx_cq+0x87/0x6e0 [mlx5_core] mlx5e_napi_poll+0x45e/0x6b0 [mlx5_core] __napi_poll+0x25/0x1a0 net_rx_action+0x28a/0x300 __do_softirq+0xcd/0x279 ? sort_range+0x20/0x20 run_ksoftirqd+0x1a/0x20 smpboot_thread_fn+0xa2/0x130 kthread+0xc9/0xf0 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 Modules linked in: mlx5_ib mlx5_core rpcrdma rdma_ucm ib_iser libiscsi scsi_transport_iscsi ib_umad rdma_cm ib_ipoib iw_cm ib_cm ib_uverbs ib_core xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter overlay zram zsmalloc fuse [last unloaded: mlx5_core] ---[ end trace 0000000000000000 ]--- Fixes: 7abd955a58fb ("net/mlx5e: RX, Fix page_pool page fragment tracking for XDP") Signed-off-by: Dragos Tatulea Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit d03b6e6f31820b84f7449cca022047f36c42bc3f Author: Jianbo Liu Date: Mon Jul 3 08:28:16 2023 +0000 net/mlx5e: Move representor neigh cleanup to profile cleanup_tx For IP tunnel encapsulation in ECMP (Equal-Cost Multipath) mode, as the flow is duplicated to the peer eswitch, the related neighbour information on the peer uplink representor is created as well. In the cited commit, eswitch devcom unpair is moved to uplink unload API, specifically the profile->cleanup_tx. If there is a encap rule offloaded in ECMP mode, when one eswitch does unpair (because of unloading the driver, for instance), and the peer rule from the peer eswitch is going to be deleted, the use-after-free error is triggered while accessing neigh info, as it is already cleaned up in uplink's profile->disable, which is before its profile->cleanup_tx. To fix this issue, move the neigh cleanup to profile's cleanup_tx callback, and after mlx5e_cleanup_uplink_rep_tx is called. The neigh init is moved to init_tx for symmeter. [ 2453.376299] BUG: KASAN: slab-use-after-free in mlx5e_rep_neigh_entry_release+0x109/0x3a0 [mlx5_core] [ 2453.379125] Read of size 4 at addr ffff888127af9008 by task modprobe/2496 [ 2453.381542] CPU: 7 PID: 2496 Comm: modprobe Tainted: G B 6.4.0-rc7+ #15 [ 2453.383386] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [ 2453.384335] Call Trace: [ 2453.384625] [ 2453.384891] dump_stack_lvl+0x33/0x50 [ 2453.385285] print_report+0xc2/0x610 [ 2453.385667] ? __virt_addr_valid+0xb1/0x130 [ 2453.386091] ? mlx5e_rep_neigh_entry_release+0x109/0x3a0 [mlx5_core] [ 2453.386757] kasan_report+0xae/0xe0 [ 2453.387123] ? mlx5e_rep_neigh_entry_release+0x109/0x3a0 [mlx5_core] [ 2453.387798] mlx5e_rep_neigh_entry_release+0x109/0x3a0 [mlx5_core] [ 2453.388465] mlx5e_rep_encap_entry_detach+0xa6/0xe0 [mlx5_core] [ 2453.389111] mlx5e_encap_dealloc+0xa7/0x100 [mlx5_core] [ 2453.389706] mlx5e_tc_tun_encap_dests_unset+0x61/0xb0 [mlx5_core] [ 2453.390361] mlx5_free_flow_attr_actions+0x11e/0x340 [mlx5_core] [ 2453.391015] ? complete_all+0x43/0xd0 [ 2453.391398] ? free_flow_post_acts+0x38/0x120 [mlx5_core] [ 2453.392004] mlx5e_tc_del_fdb_flow+0x4ae/0x690 [mlx5_core] [ 2453.392618] mlx5e_tc_del_fdb_peers_flow+0x308/0x370 [mlx5_core] [ 2453.393276] mlx5e_tc_clean_fdb_peer_flows+0xf5/0x140 [mlx5_core] [ 2453.393925] mlx5_esw_offloads_unpair+0x86/0x540 [mlx5_core] [ 2453.394546] ? mlx5_esw_offloads_set_ns_peer.isra.0+0x180/0x180 [mlx5_core] [ 2453.395268] ? down_write+0xaa/0x100 [ 2453.395652] mlx5_esw_offloads_devcom_event+0x203/0x530 [mlx5_core] [ 2453.396317] mlx5_devcom_send_event+0xbb/0x190 [mlx5_core] [ 2453.396917] mlx5_esw_offloads_devcom_cleanup+0xb0/0xd0 [mlx5_core] [ 2453.397582] mlx5e_tc_esw_cleanup+0x42/0x120 [mlx5_core] [ 2453.398182] mlx5e_rep_tc_cleanup+0x15/0x30 [mlx5_core] [ 2453.398768] mlx5e_cleanup_rep_tx+0x6c/0x80 [mlx5_core] [ 2453.399367] mlx5e_detach_netdev+0xee/0x120 [mlx5_core] [ 2453.399957] mlx5e_netdev_change_profile+0x84/0x170 [mlx5_core] [ 2453.400598] mlx5e_vport_rep_unload+0xe0/0xf0 [mlx5_core] [ 2453.403781] mlx5_eswitch_unregister_vport_reps+0x15e/0x190 [mlx5_core] [ 2453.404479] ? mlx5_eswitch_register_vport_reps+0x200/0x200 [mlx5_core] [ 2453.405170] ? up_write+0x39/0x60 [ 2453.405529] ? kernfs_remove_by_name_ns+0xb7/0xe0 [ 2453.405985] auxiliary_bus_remove+0x2e/0x40 [ 2453.406405] device_release_driver_internal+0x243/0x2d0 [ 2453.406900] ? kobject_put+0x42/0x2d0 [ 2453.407284] bus_remove_device+0x128/0x1d0 [ 2453.407687] device_del+0x240/0x550 [ 2453.408053] ? waiting_for_supplier_show+0xe0/0xe0 [ 2453.408511] ? kobject_put+0xfa/0x2d0 [ 2453.408889] ? __kmem_cache_free+0x14d/0x280 [ 2453.409310] mlx5_rescan_drivers_locked.part.0+0xcd/0x2b0 [mlx5_core] [ 2453.409973] mlx5_unregister_device+0x40/0x50 [mlx5_core] [ 2453.410561] mlx5_uninit_one+0x3d/0x110 [mlx5_core] [ 2453.411111] remove_one+0x89/0x130 [mlx5_core] [ 2453.411628] pci_device_remove+0x59/0xf0 [ 2453.412026] device_release_driver_internal+0x243/0x2d0 [ 2453.412511] ? parse_option_str+0x14/0x90 [ 2453.412915] driver_detach+0x7b/0xf0 [ 2453.413289] bus_remove_driver+0xb5/0x160 [ 2453.413685] pci_unregister_driver+0x3f/0xf0 [ 2453.414104] mlx5_cleanup+0xc/0x20 [mlx5_core] Fixes: 2be5bd42a5bb ("net/mlx5: Handle pairing of E-switch via uplink un/load APIs") Signed-off-by: Jianbo Liu Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 3ec43c1b082a8804472430e1253544d75f4b540e Author: Amir Tzin Date: Tue May 30 20:11:14 2023 +0300 net/mlx5e: Fix crash moving to switchdev mode when ntuple offload is set Moving to switchdev mode with ntuple offload on causes the kernel to crash since fs->arfs is freed during nic profile cleanup flow. Ntuple offload is not supported in switchdev mode and it is already unset by mlx5 fix feature ndo in switchdev mode. Verify fs->arfs is valid before disabling it. trace: [] RIP: 0010:_raw_spin_lock_bh+0x17/0x30 [] arfs_del_rules+0x44/0x1a0 [mlx5_core] [] mlx5e_arfs_disable+0xe/0x20 [mlx5_core] [] mlx5e_handle_feature+0x3d/0xb0 [mlx5_core] [] ? __rtnl_unlock+0x25/0x50 [] mlx5e_set_features+0xfe/0x160 [mlx5_core] [] __netdev_update_features+0x278/0xa50 [] ? netdev_run_todo+0x5e/0x2a0 [] netdev_update_features+0x22/0x70 [] ? _cond_resched+0x15/0x30 [] mlx5e_attach_netdev+0x12a/0x1e0 [mlx5_core] [] mlx5e_netdev_attach_profile+0xa1/0xc0 [mlx5_core] [] mlx5e_netdev_change_profile+0x77/0xe0 [mlx5_core] [] mlx5e_vport_rep_load+0x1ed/0x290 [mlx5_core] [] mlx5_esw_offloads_rep_load+0x88/0xd0 [mlx5_core] [] esw_offloads_load_rep.part.38+0x31/0x50 [mlx5_core] [] esw_offloads_enable+0x6c5/0x710 [mlx5_core] [] mlx5_eswitch_enable_locked+0x1bb/0x290 [mlx5_core] [] mlx5_devlink_eswitch_mode_set+0x14f/0x320 [mlx5_core] [] devlink_nl_cmd_eswitch_set_doit+0x94/0x120 [] genl_family_rcv_msg_doit.isra.17+0x113/0x150 [] genl_family_rcv_msg+0xb7/0x170 [] ? devlink_nl_cmd_port_split_doit+0x100/0x100 [] genl_rcv_msg+0x47/0xa0 [] ? genl_family_rcv_msg+0x170/0x170 [] netlink_rcv_skb+0x4c/0x130 [] genl_rcv+0x24/0x40 [] netlink_unicast+0x19a/0x230 [] netlink_sendmsg+0x204/0x3d0 [] sock_sendmsg+0x50/0x60 Fixes: 90b22b9bcd24 ("net/mlx5e: Disable Rx ntuple offload for uplink representor") Signed-off-by: Amir Tzin Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit 93a331939d1d1c6c3422bc09ec43cac658594b34 Author: Chris Mi Date: Thu Jun 29 11:32:03 2023 +0300 net/mlx5e: Don't hold encap tbl lock if there is no encap action The cited commit holds encap tbl lock unconditionally when setting up dests. But it may cause the following deadlock: PID: 1063722 TASK: ffffa062ca5d0000 CPU: 13 COMMAND: "handler8" #0 [ffffb14de05b7368] __schedule at ffffffffa1d5aa91 #1 [ffffb14de05b7410] schedule at ffffffffa1d5afdb #2 [ffffb14de05b7430] schedule_preempt_disabled at ffffffffa1d5b528 #3 [ffffb14de05b7440] __mutex_lock at ffffffffa1d5d6cb #4 [ffffb14de05b74e8] mutex_lock_nested at ffffffffa1d5ddeb #5 [ffffb14de05b74f8] mlx5e_tc_tun_encap_dests_set at ffffffffc12f2096 [mlx5_core] #6 [ffffb14de05b7568] post_process_attr at ffffffffc12d9fc5 [mlx5_core] #7 [ffffb14de05b75a0] mlx5e_tc_add_fdb_flow at ffffffffc12de877 [mlx5_core] #8 [ffffb14de05b75f0] __mlx5e_add_fdb_flow at ffffffffc12e0eef [mlx5_core] #9 [ffffb14de05b7660] mlx5e_tc_add_flow at ffffffffc12e12f7 [mlx5_core] #10 [ffffb14de05b76b8] mlx5e_configure_flower at ffffffffc12e1686 [mlx5_core] #11 [ffffb14de05b7720] mlx5e_rep_indr_offload at ffffffffc12e3817 [mlx5_core] #12 [ffffb14de05b7730] mlx5e_rep_indr_setup_tc_cb at ffffffffc12e388a [mlx5_core] #13 [ffffb14de05b7740] tc_setup_cb_add at ffffffffa1ab2ba8 #14 [ffffb14de05b77a0] fl_hw_replace_filter at ffffffffc0bdec2f [cls_flower] #15 [ffffb14de05b7868] fl_change at ffffffffc0be6caa [cls_flower] #16 [ffffb14de05b7908] tc_new_tfilter at ffffffffa1ab71f0 [1031218.028143] wait_for_completion+0x24/0x30 [1031218.028589] mlx5e_update_route_decap_flows+0x9a/0x1e0 [mlx5_core] [1031218.029256] mlx5e_tc_fib_event_work+0x1ad/0x300 [mlx5_core] [1031218.029885] process_one_work+0x24e/0x510 Actually no need to hold encap tbl lock if there is no encap action. Fix it by checking if encap action exists or not before holding encap tbl lock. Fixes: 37c3b9fa7ccf ("net/mlx5e: Prevent encap offload when neigh update is running") Signed-off-by: Chris Mi Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 0507f2c8be0d345fe7014147c027cea6dc1c00a4 Author: Shay Drory Date: Mon Jul 3 17:34:44 2023 +0300 net/mlx5: Honor user input for migratable port fn attr Currently, whenever a user is setting migratable port fn attr, the driver is always turn migratable capability on. Fix it by honor the user input Fixes: e5b9642a33be ("net/mlx5: E-Switch, Implement devlink port function cmds to control migratable") Signed-off-by: Shay Drory Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit e5bcb7564d3bd0c88613c76963c5349be9c511c5 Author: Yuanjun Gong Date: Tue Jul 25 14:56:55 2023 +0800 net/mlx5e: fix return value check in mlx5e_ipsec_remove_trailer() mlx5e_ipsec_remove_trailer() should return an error code if function pskb_trim() returns an unexpected value. Fixes: 2ac9cfe78223 ("net/mlx5e: IPSec, Add Innova IPSec offload TX data path") Signed-off-by: Yuanjun Gong Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit c6cf0b6097bf1bf1b2a89b521e9ecd26b581a93a Author: Zhengchao Shao Date: Sat Jul 8 15:13:07 2023 +0800 net/mlx5: fix potential memory leak in mlx5e_init_rep_rx The memory pointed to by the priv->rx_res pointer is not freed in the error path of mlx5e_init_rep_rx, which can lead to a memory leak. Fix by freeing the memory in the error path, thereby making the error path identical to mlx5e_cleanup_rep_rx(). Fixes: af8bbf730068 ("net/mlx5e: Convert mlx5e_flow_steering member of mlx5e_priv to pointer") Signed-off-by: Zhengchao Shao Reviewed-by: Simon Horman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 5dd77585dd9d0e03dd1bceb95f0269a7eaf6b936 Author: Zhengchao Shao Date: Wed Jul 5 20:15:27 2023 +0800 net/mlx5: DR, fix memory leak in mlx5dr_cmd_create_reformat_ctx when mlx5_cmd_exec failed in mlx5dr_cmd_create_reformat_ctx, the memory pointed by 'in' is not released, which will cause memory leak. Move memory release after mlx5_cmd_exec. Fixes: 1d9186476e12 ("net/mlx5: DR, Add direct rule command utilities") Signed-off-by: Zhengchao Shao Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit aeb660171b0663847fa04806a96302ac6112ad26 Author: Zhengchao Shao Date: Tue Jul 4 15:06:40 2023 +0800 net/mlx5e: fix double free in macsec_fs_tx_create_crypto_table_groups In function macsec_fs_tx_create_crypto_table_groups(), when the ft->g memory is successfully allocated but the 'in' memory fails to be allocated, the memory pointed to by ft->g is released once. And in function macsec_fs_tx_create(), macsec_fs_tx_destroy() is called to release the memory pointed to by ft->g again. This will cause double free problem. Fixes: e467b283ffd5 ("net/mlx5e: Add MACsec TX steering rules") Signed-off-by: Zhengchao Shao Reviewed-by: Simon Horman Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit a171eb5cac427fa8d084eaf5e47fbe4c0f1e279f Author: Shyam Prasad N Date: Wed Jul 26 17:02:11 2023 +0000 cifs: add missing return value check for cifs_sb_tlink Whenever a tlink is obtained by cifs_sb_tlink, we need to check that the tlink returned is not an error. It was missing with the last change here. Fixes: b3edef6b9cd0 ("cifs: allow dumping keys for directories too") Reported-by: Dan Carpenter Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit fa29d467977d50400f6bb1374e942e7474fdf53c Merge: d4a7ce6421007 df15c15e6c987 Author: Jakub Kicinski Date: Wed Jul 26 13:38:29 2023 -0700 Merge branch 'tools-ynl-gen-fix-parse-multi-attr-enum-attribute' Arkadiusz Kubalewski says: ==================== tools: ynl-gen: fix parse multi-attr enum attribute Fix the issues with parsing enums in ynl.py script. ==================== Link: https://lore.kernel.org/r/20230725101642.267248-1-arkadiusz.kubalewski@intel.com Signed-off-by: Jakub Kicinski commit df15c15e6c987a32ecbafe011ffae8a53c84cb4f Author: Arkadiusz Kubalewski Date: Tue Jul 25 12:16:42 2023 +0200 tools: ynl-gen: fix parse multi-attr enum attribute When attribute is enum type and marked as multi-attr, the netlink respond is not parsed, fails with stack trace: Traceback (most recent call last): File "/net-next/tools/net/ynl/./test.py", line 520, in main() File "/net-next/tools/net/ynl/./test.py", line 488, in main dplls=dplls_get(282574471561216) File "/net-next/tools/net/ynl/./test.py", line 48, in dplls_get reply=act(args) File "/net-next/tools/net/ynl/./test.py", line 41, in act reply = ynl.dump(args.dump, attrs) File "/net-next/tools/net/ynl/lib/ynl.py", line 598, in dump return self._op(method, vals, dump=True) File "/net-next/tools/net/ynl/lib/ynl.py", line 584, in _op rsp_msg = self._decode(gm.raw_attrs, op.attr_set.name) File "/net-next/tools/net/ynl/lib/ynl.py", line 451, in _decode self._decode_enum(rsp, attr_spec) File "/net-next/tools/net/ynl/lib/ynl.py", line 408, in _decode_enum value = enum.entries_by_val[raw].name TypeError: unhashable type: 'list' error: 1 Redesign _decode_enum(..) to take a enum int value and translate it to either a bitmask or enum name as expected. Signed-off-by: Arkadiusz Kubalewski Reviewed-by: Donald Hunter Link: https://lore.kernel.org/r/20230725101642.267248-3-arkadiusz.kubalewski@intel.com Reviewed-by: Jakub Kicinski Signed-off-by: Jakub Kicinski commit d7ddf5f4269fcaf19aafe971e635d91897423a3a Author: Arkadiusz Kubalewski Date: Tue Jul 25 12:16:41 2023 +0200 tools: ynl-gen: fix enum index in _decode_enum(..) Remove wrong index adjustment, which is leftover from adding support for sparse enums. enum.entries_by_val() function shall not subtract the start-value, as it is indexed with real enum value. Fixes: c311aaa74ca1 ("tools: ynl: fix enum-as-flags in the generic CLI") Signed-off-by: Arkadiusz Kubalewski Reviewed-by: Donald Hunter Link: https://lore.kernel.org/r/20230725101642.267248-2-arkadiusz.kubalewski@intel.com Reviewed-by: Jakub Kicinski Signed-off-by: Jakub Kicinski commit ae9b14582ad03abb3db66ba3f8dc5ca443ff54a1 Merge: e7dd44f4f3166 6e2acbfe59b83 Author: Stephen Boyd Date: Wed Jul 26 11:47:57 2023 -0700 Merge tag 'clk-meson-fixes-v6.5-1' of https://github.com/BayLibre/clk-meson into clk-fixes Pull an Amlogic clk driver fix from Jerome Brunet: - Fix PLL scheduling while atomic following a1 locking sequence update * tag 'clk-meson-fixes-v6.5-1' of https://github.com/BayLibre/clk-meson: clk: meson: change usleep_range() to udelay() for atomic context commit 0a8db05b571ad5b8d5c8774a004c0424260a90bd Merge: f40125c0a1609 c21733754cd6e Author: Linus Torvalds Date: Wed Jul 26 11:37:34 2023 -0700 Merge tag 'platform-drivers-x86-v6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "Misc small fixes and hw-id additions" * tag 'platform-drivers-x86-v6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: huawei-wmi: Silence ambient light sensor platform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100 platform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops platform/x86: think-lmi: Use kfree_sensitive instead of kfree platform/x86/intel/hid: Add HP Dragonfly G2 to VGBS DMI quirks platform/x86: intel: hid: Always call BTNL ACPI method platform/x86/amd/pmf: Notify OS power slider update platform/x86/amd/pmf: reduce verbosity of apmf_get_system_params platform/x86: serial-multi-instantiate: Auto detect IRQ resource for CSC3551 platform/x86/amd: pmc: Use release_mem_region() to undo request_mem_region_muxed() platform/x86: touchscreen_dmi.c: small changes for Archos 101 Cesium Educ tablet commit f40125c0a160912ee3ac8def2f7de5bacb80df50 Merge: 5f0bc0b042fc7 536bb492d39bb Author: Linus Torvalds Date: Wed Jul 26 11:20:36 2023 -0700 Merge tag '6.5-rc3-ksmbd-server-fixes' of git://git.samba.org/ksmbd Pull ksmbd server fixes from Steve French: - fixes for two possible out of bounds access (in negotiate, and in decrypt msg) - fix unsigned compared to zero warning - fix path lookup crossing a mountpoint - fix case when first compound request is a tree connect - fix memory leak if reads are compounded * tag '6.5-rc3-ksmbd-server-fixes' of git://git.samba.org/ksmbd: ksmbd: fix out of bounds in init_smb2_rsp_hdr() ksmbd: no response from compound read ksmbd: validate session id and tree id in compound request ksmbd: fix out of bounds in smb3_decrypt_req() ksmbd: check if a mount point is crossed during path lookup ksmbd: Fix unsigned expression compared with zero commit f7fea075edfa085c25eb34c44ceacf3602537f98 Author: Jussi Laako Date: Wed Jul 26 19:56:45 2023 +0300 ALSA: usb-audio: Update for native DSD support quirks Maintenance patch for native DSD support. Remove incorrect T+A device quirks. Move set of device quirks to vendor quirks. Add set of missing device and vendor quirks. Signed-off-by: Jussi Laako Link: https://lore.kernel.org/r/20230726165645.404311-1-jussi@sonarnerd.net Signed-off-by: Takashi Iwai commit 5f0bc0b042fc77ff70e14c790abdec960cde4ec1 Author: Linus Torvalds Date: Tue Jul 25 09:38:32 2023 -0700 mm: suppress mm fault logging if fatal signal already pending Commit eda0047296a1 ("mm: make the page fault mmap locking killable") intentionally made it much easier to trigger the "page fault fails because a fatal signal is pending" situation, by having the mmap locking fail early in that case. We have long aborted page faults in other fatal cases when the actual IO for a page is interrupted by SIGKILL - which is particularly useful for the traditional case of NFS hanging due to network issues, but local filesystems could cause it too if you happened to get the SIGKILL while waiting for a page to be faulted in (eg lock_folio_maybe_drop_mmap()). So aborting the page fault wasn't a new condition - but it now triggers earlier, before we even get to 'handle_mm_fault()'. And as a result the error doesn't go through our 'fault_signal_pending()' logic, and doesn't get filtered away there. Normally you'd never even notice, because if a fatal signal is pending, the new SIGSEGV we send ends up being ignored anyway. But it turns out that there is one very noticeable exception: if you enable 'show_unhandled_signals', the aborted page fault will be logged in the kernel messages, and you'll get a scary line looking something like this in your logs: pverados[2183248]: segfault at 55e5a00f9ae0 ip 000055e5a00f9ae0 sp 00007ffc0720bea8 error 14 in perl[55e5a00d4000+195000] likely on CPU 10 (core 4, socket 0) which is rather misleading. It's not really a segfault at all, it's just "the thread was killed before the page fault completed, so we aborted the page fault". Fix this by just making it clear that a pending fatal signal means that any new signal coming in after that is implicitly handled. This will avoid the misleading logging, since now the signal isn't 'unhandled' any more. Reported-and-tested-by: Fiona Ebner Tested-by: Thomas Lamprecht Link: https://lore.kernel.org/lkml/8d063a26-43f5-0bb7-3203-c6a04dc159f8@proxmox.com/ Acked-by: Oleg Nesterov Fixes: eda0047296a1 ("mm: make the page fault mmap locking killable") Signed-off-by: Linus Torvalds commit 1b5d0ddcb34a605835051ae2950d5cfed0373dd8 Author: Rob Clark Date: Mon Jul 24 13:30:21 2023 -0700 drm/msm: Disallow submit with fence id 0 A fence id of zero is expected to be invalid, and is not removed from the fence_idr table. If userspace is requesting to specify the fence id with the FENCE_SN_IN flag, we need to reject a zero fence id value. Fixes: 17154addc5c1 ("drm/msm: Add MSM_SUBMIT_FENCE_SN_IN") Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/549180/ commit 05d881b85b48c7ac6a7c92ce00aa916c4a84d052 Author: Mark Brown Date: Wed Jul 26 13:12:26 2023 +0100 arm64/sme: Set new vector length before reallocating As part of fixing the allocation of the buffer for SVE state when changing SME vector length we introduced an immediate reallocation of the SVE state, this is also done when changing the SVE vector length for consistency. Unfortunately this reallocation is done prior to writing the new vector length to the task struct, meaning the allocation is done with the old vector length and can lead to memory corruption due to an undersized buffer being used. Move the update of the vector length before the allocation to ensure that the new vector length is taken into account. For some reason this isn't triggering any problems when running tests on the arm64 fixes branch (even after repeated tries) but is triggering issues very often after merge into mainline. Fixes: d4d5be94a878 ("arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes") Signed-off-by: Mark Brown Cc: Link: https://lore.kernel.org/r/20230726-arm64-fix-sme-fix-v1-1-7752ec58af27@kernel.org Signed-off-by: Catalin Marinas commit 3421ddbe6d64e55b76a67d57cef9e950b3d873ba Author: Mark Brown Date: Mon Jul 24 14:09:19 2023 +0100 arm64/fpsimd: Don't flush SME register hardware state along with thread We recently changed the fpsimd thread flush to flush the physical SME state as well as the thread state for the current thread. Unfortunately this leads to intermittent corruption in interaction with the lazy FPSIMD register switching. When under heavy load such as can be triggered by the startup phase of fp-stress it is possible that the current thread may not be scheduled prior to returning to userspace, and indeed we may end up returning to the last thread that was scheduled on the PE without ever exiting the kernel to any other task. If that happens then we will not reload the register state from memory, leading to loss of any SME register state. Since this was purely an attempt to defensively close off potential problems revert the change. Fixes: af3215fd0230 ("arm64/fpsimd: Exit streaming mode when flushing tasks") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230724-arm64-dont-flush-smstate-v1-1-9a8b637ace6c@kernel.org Signed-off-by: Catalin Marinas commit 01b94b0f3922039f7d3e0d1eeb33b8891746b65f Author: Arnd Bergmann Date: Mon Jul 24 14:18:42 2023 +0200 KVM: arm64: fix __kvm_host_psci_cpu_entry() prototype The kvm_host_psci_cpu_entry() function was renamed in order to add a wrapper around it, but the prototype did not change, so now the missing-prototype warning came back in W=1 builds: arch/arm64/kvm/hyp/nvhe/psci-relay.c:203:28: error: no previous prototype for function '__kvm_host_psci_cpu_entry' [-Werror,-Wmissing-prototypes] asmlinkage void __noreturn __kvm_host_psci_cpu_entry(bool is_cpu_on) Fixes: dcf89d1111995 ("KVM: arm64: Add missing BTI instructions") Signed-off-by: Arnd Bergmann Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20230724121850.1386668-1-arnd@kernel.org Signed-off-by: Oliver Upton commit 375110ab51dec5dcd077b8fa95075b2c67499119 Author: Fuad Tabba Date: Mon Jul 24 13:38:29 2023 +0100 KVM: arm64: Fix resetting SME trap values on reset for (h)VHE Ensure that SME traps are disabled for (h)VHE when getting the reset value for the architectural feature control register. Fixes: 75c76ab5a641 ("KVM: arm64: Rework CPTR_EL2 programming for HVHE configuration") Signed-off-by: Fuad Tabba Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230724123829.2929609-9-tabba@google.com Signed-off-by: Oliver Upton commit 7af0d5e50006614cbf313373df708df79d9f4657 Author: Fuad Tabba Date: Mon Jul 24 13:38:28 2023 +0100 KVM: arm64: Fix resetting SVE trap values on reset for hVHE Ensure that SVE traps are disabled for hVHE, if the FPSIMD state isn't owned by the guest, when getting the reset value for the architectural feature control register. Fixes: 75c76ab5a641 ("KVM: arm64: Rework CPTR_EL2 programming for HVHE configuration") Signed-off-by: Fuad Tabba Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230724123829.2929609-8-tabba@google.com Signed-off-by: Oliver Upton commit a9626099a51f697939d35983b92a9384a4c4a676 Author: Fuad Tabba Date: Mon Jul 24 13:38:27 2023 +0100 KVM: arm64: Use the appropriate feature trap register when activating traps Instead of writing directly to cptr_el2, use the helper that selects which feature trap register to write to based on the KVM mode. Fixes: 75c76ab5a641 ("KVM: arm64: Rework CPTR_EL2 programming for HVHE configuration") Signed-off-by: Fuad Tabba Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230724123829.2929609-7-tabba@google.com Signed-off-by: Oliver Upton commit 90ae31c65d5afdd0864017c9354247ddb601917f Author: Fuad Tabba Date: Mon Jul 24 13:38:26 2023 +0100 KVM: arm64: Helper to write to appropriate feature trap register based on mode Factor out the code that decides whether to write to the feature trap registers, CPTR_EL2 or CPACR_EL1, based on the KVM mode, i.e., (h)VHE or nVHE. This function will be used in the subsequent patch. No functional change intended. Signed-off-by: Fuad Tabba Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230724123829.2929609-6-tabba@google.com Signed-off-by: Oliver Upton commit 380624d4358b0150804d279c20632555e453bc1f Author: Fuad Tabba Date: Mon Jul 24 13:38:25 2023 +0100 KVM: arm64: Disable SME traps for (h)VHE at setup Ensure that SME traps are disabled for (h)VHE when setting up EL2, as they are for nVHE. Signed-off-by: Fuad Tabba Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230724123829.2929609-5-tabba@google.com Signed-off-by: Oliver Upton commit 45a3681a10ff1732fcd7a177fbf1f9ceeaffd7c9 Author: Fuad Tabba Date: Mon Jul 24 13:38:24 2023 +0100 KVM: arm64: Use the appropriate feature trap register for SVE at EL2 setup Use the architectural feature trap/control register that corresponds to the current KVM mode, i.e., CPTR_EL2 or CPACR_EL1, when setting up SVE feature traps. Signed-off-by: Fuad Tabba Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230724123829.2929609-4-tabba@google.com Signed-off-by: Oliver Upton commit ce92232614a5fb16992de8eb85bba7cb90772a1f Author: Fuad Tabba Date: Mon Jul 24 13:38:23 2023 +0100 KVM: arm64: Factor out code for checking (h)VHE mode into a macro The code for checking whether the kernel is in (h)VHE mode is repeated, and will be needed again in future patches. Factor it out in a macro. No functional change intended. No change in emitted assembly code intended. Signed-off-by: Fuad Tabba Link: https://lore.kernel.org/kvmarm/20230724123829.2929609-3-tabba@google.com/ Reviewed-by: Marc Zyngier Signed-off-by: Oliver Upton commit c5097b9869a136349d8404715dc8aabb7570a762 Author: Johan Hovold Date: Thu Jul 6 10:26:10 2023 +0200 Revert "PCI: dwc: Wait for link up only if link is started" This reverts commit da56a1bfbab55189595e588f1d984bdfb5cf5924. Bjorn Andersson, Fabio Estevam, Xiaolei Wang, and Jon Hunter reported that da56a1bfbab5 ("PCI: dwc: Wait for link up only if link is started") broke controller probing by returning an error in case the link does not come up during host initialisation, for example when the slot is empty. As explained in commit 886a9c134755 ("PCI: dwc: Move link handling into common code") and as indicated by the comment "Ignore errors, the link may come up later" in the code, waiting for link up and ignoring errors is the intended behaviour: Let's standardize this to succeed as there are usecases where devices (and the link) appear later even without hotplug. For example, a reconfigured FPGA device. Reverting the offending commit specifically fixes a regression on Qualcomm platforms like the Lenovo ThinkPad X13s which no longer reach the interconnect sync state if a slot does not have a device populated (e.g. an optional modem). Note that enabling asynchronous probing by default as was done for Qualcomm platforms by commit c0e1eb441b1d ("PCI: qcom: Enable async probe by default"), should take care of any related boot time concerns. Finally, note that the intel-gw driver is the only driver currently not providing a .start_link() callback and instead starts the link in its .host_init() callback, which may avoid an additional one-second timeout during probe by making the link-up wait conditional. If anyone cares, that can be done in a follow-up patch with a proper motivation. [bhelgaas: add Fabio Estevam, Xiaolei Wang, Jon Hunter reports] Fixes: da56a1bfbab5 ("PCI: dwc: Wait for link up only if link is started") Link: https://lore.kernel.org/r/20230706082610.26584-1-johan+linaro@kernel.org Reported-by: Bjorn Andersson Signed-off-by: Johan Hovold Reported-by: Fabio Estevam Link: https://lore.kernel.org/r/20230704122635.1362156-1-festevam@gmail.com/ Reported-by: Xiaolei Wang Link: https://lore.kernel.org/r/20230705010624.3912934-1-xiaolei.wang@windriver.com/ Reported-by: Jon Hunter Link: https://lore.kernel.org/r/6ca287a1-6c7c-7b90-9022-9e73fb82b564@nvidia.com Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam Cc: Sajid Dalvi Cc: Ajay Agarwal commit 0ebc1064e4874d5987722a2ddbc18f94aa53b211 Author: Pablo Neira Ayuso Date: Sun Jul 23 16:41:48 2023 +0200 netfilter: nf_tables: disallow rule addition to bound chain via NFTA_RULE_CHAIN_ID Bail out with EOPNOTSUPP when adding rule to bound chain via NFTA_RULE_CHAIN_ID. The following warning splat is shown when adding a rule to a deleted bound chain: WARNING: CPU: 2 PID: 13692 at net/netfilter/nf_tables_api.c:2013 nf_tables_chain_destroy+0x1f7/0x210 [nf_tables] CPU: 2 PID: 13692 Comm: chain-bound-rul Not tainted 6.1.39 #1 RIP: 0010:nf_tables_chain_destroy+0x1f7/0x210 [nf_tables] Fixes: d0e2c7de92c7 ("netfilter: nf_tables: add NFT_CHAIN_BINDING") Reported-by: Kevin Rich Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 0a771f7b266b02d262900c75f1e175c7fe76fec2 Author: Pablo Neira Ayuso Date: Sun Jul 23 16:24:46 2023 +0200 netfilter: nf_tables: skip immediate deactivate in _PREPARE_ERROR On error when building the rule, the immediate expression unbinds the chain, hence objects can be deactivated by the transaction records. Otherwise, it is possible to trigger the following warning: WARNING: CPU: 3 PID: 915 at net/netfilter/nf_tables_api.c:2013 nf_tables_chain_destroy+0x1f7/0x210 [nf_tables] CPU: 3 PID: 915 Comm: chain-bind-err- Not tainted 6.1.39 #1 RIP: 0010:nf_tables_chain_destroy+0x1f7/0x210 [nf_tables] Fixes: 4bedf9eee016 ("netfilter: nf_tables: fix chain binding transaction logic") Reported-by: Kevin Rich Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit f718863aca469a109895cb855e6b81fff4827d71 Author: Florian Westphal Date: Thu Jul 20 21:30:05 2023 +0200 netfilter: nft_set_rbtree: fix overlap expiration walk The lazy gc on insert that should remove timed-out entries fails to release the other half of the interval, if any. Can be reproduced with tests/shell/testcases/sets/0044interval_overlap_0 in nftables.git and kmemleak enabled kernel. Second bug is the use of rbe_prev vs. prev pointer. If rbe_prev() returns NULL after at least one iteration, rbe_prev points to element that is not an end interval, hence it should not be removed. Lastly, check the genmask of the end interval if this is active in the current generation. Fixes: c9e6978e2725 ("netfilter: nft_set_rbtree: Switch to node list walk for overlap detection") Signed-off-by: Florian Westphal commit 588159009d5b7a09c3e5904cffddbe4a4e170301 Author: Ilya Dryomov Date: Sat Jul 22 20:28:08 2023 +0200 rbd: retrieve and check lock owner twice before blocklisting An attempt to acquire exclusive lock can race with the current lock owner closing the image: 1. lock is held by client123, rbd_lock() returns -EBUSY 2. get_lock_owner_info() returns client123 instance details 3. client123 closes the image, lock is released 4. find_watcher() returns 0 as there is no matching watcher anymore 5. client123 instance gets erroneously blocklisted Particularly impacted is mirror snapshot scheduler in snapshot-based mirroring since it happens to open and close images a lot (images are opened only for as long as it takes to take the next mirror snapshot, the same client instance is used for all images). To reduce the potential for erroneous blocklisting, retrieve the lock owner again after find_watcher() returns 0. If it's still there, make sure it matches the previously detected lock owner. Cc: stable@vger.kernel.org # f38cb9d9c204: rbd: make get_lock_owner_info() return a single locker or NULL Cc: stable@vger.kernel.org # 8ff2c64c9765: rbd: harden get_lock_owner_info() a bit Cc: stable@vger.kernel.org Signed-off-by: Ilya Dryomov Reviewed-by: Dongsheng Yang commit 8ff2c64c9765446c3cef804fb99da04916603e27 Author: Ilya Dryomov Date: Sat Jul 8 16:16:59 2023 +0200 rbd: harden get_lock_owner_info() a bit - we want the exclusive lock type, so test for it directly - use sscanf() to actually parse the lock cookie and avoid admitting invalid handles - bail if locker has a blank address Signed-off-by: Ilya Dryomov Reviewed-by: Dongsheng Yang commit f38cb9d9c2045dad16eead4a2e1aedfddd94603b Author: Ilya Dryomov Date: Fri Jun 30 13:52:13 2023 +0200 rbd: make get_lock_owner_info() return a single locker or NULL Make the "num_lockers can be only 0 or 1" assumption explicit and simplify the API by getting rid of output parameters in preparation for calling get_lock_owner_info() twice before blocklisting. Signed-off-by: Ilya Dryomov Reviewed-by: Dongsheng Yang commit ae463563b7a1b7d4a3d0b065b09d37a76b693937 Author: Sindhu Devale Date: Tue Jul 25 10:54:38 2023 -0500 RDMA/irdma: Report correct WC error Report the correct WC error if a MW bind is performed on an already valid/bound window. Fixes: 44d9e52977a1 ("RDMA/irdma: Implement device initialization definitions") Signed-off-by: Sindhu Devale Signed-off-by: Shiraz Saleem Link: https://lore.kernel.org/r/20230725155439.1057-2-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky commit 3bfb25fa2b5bb9c29681e6ac861808f4be1331a9 Author: Sindhu Devale Date: Tue Jul 25 10:54:37 2023 -0500 RDMA/irdma: Fix op_type reporting in CQEs The op_type field CQ poll info structure is incorrectly filled in with the queue type as opposed to the op_type received in the CQEs. The wrong opcode could be decoded and returned to the ULP. Copy the op_type field received in the CQE in the CQ poll info structure. Fixes: 24419777e943 ("RDMA/irdma: Fix RQ completion opcode") Signed-off-by: Sindhu Devale Signed-off-by: Shiraz Saleem Link: https://lore.kernel.org/r/20230725155439.1057-1-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky commit b28ff3a7d7e97456fd86b68d24caa32e1cfa7064 Author: Filipe Manana Date: Fri Jul 21 10:49:21 2023 +0100 btrfs: check for commit error at btrfs_attach_transaction_barrier() btrfs_attach_transaction_barrier() is used to get a handle pointing to the current running transaction if the transaction has not started its commit yet (its state is < TRANS_STATE_COMMIT_START). If the transaction commit has started, then we wait for the transaction to commit and finish before returning - however we completely ignore if the transaction was aborted due to some error during its commit, we simply return ERR_PT(-ENOENT), which makes the caller assume everything is fine and no errors happened. This could make an fsync return success (0) to user space when in fact we had a transaction abort and the target inode changes were therefore not persisted. Fix this by checking for the return value from btrfs_wait_for_commit(), and if it returned an error, return it back to the caller. Fixes: d4edf39bd5db ("Btrfs: fix uncompleted transaction") CC: stable@vger.kernel.org # 4.19+ Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit cc71c42b3dc1085d3e72dfa5603e827b9eb59da1 Author: Douglas Anderson Date: Tue Jul 25 11:02:27 2023 -0700 spi: spi-qcom-qspi: Add mem_ops to avoid PIO for badly sized reads In the patch ("spi: spi-qcom-qspi: Fallback to PIO for xfers that aren't multiples of 4 bytes") we detect reads that we can't handle properly and fallback to PIO mode. While that's correct behavior, we can do better by adding "spi_controller_mem_ops" for our controller. Once we do this then the caller will give us a transfer that's a multiple of 4-bytes so we can DMA. Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") Signed-off-by: Douglas Anderson Reviewed-by: Vijaya Krishna Nivarthi Link: https://lore.kernel.org/r/20230725110226.2.Id4a39804e01e4a06dae9b73fd2a5194c4c7ea453@changeid Signed-off-by: Mark Brown commit 138d73b627c71bf2b2f61502dc6c1137b9656434 Author: Douglas Anderson Date: Tue Jul 25 11:02:26 2023 -0700 spi: spi-qcom-qspi: Fallback to PIO for xfers that aren't multiples of 4 bytes The Qualcomm QSPI driver appears to require that any reads using DMA are a mutliple of 4 bytes. If this isn't true then the controller will clobber any extra bytes in memory following the last word. Let's detect this and falback to PIO. This fixes problems reported by slub_debug=FZPUA, which would complain about "kmalloc Redzone overwritten". One such instance said: 0xffffff80c29d541a-0xffffff80c29d541b @offset=21530. First byte 0x0 instead of 0xcc Allocated in mtd_kmalloc_up_to+0x98/0xac age=36 cpu=3 pid=6658 Tracing through what was happening I saw that, while we often did DMA tranfers of 0x1000 bytes, sometimes we'd end up doing ones of 0x41a bytes. Those 0x41a byte transfers were the problem. NOTE: a future change will enable the SPI "mem ops" to help avoid this case, but it still seems good to add the extra check in the transfer. Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") Signed-off-by: Douglas Anderson Reviewed-by: Vijaya Krishna Nivarthi Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230725110226.1.Ia2f980fc7cd0b831e633391f0bb1272914d8f381@changeid Signed-off-by: Mark Brown commit d4a7ce642100765119a872d4aba1bf63e3a22c8a Author: Muhammad Husaini Zulkifli Date: Mon Jul 24 09:12:50 2023 -0700 igc: Fix Kernel Panic during ndo_tx_timeout callback The Xeon validation group has been carrying out some loaded tests with various HW configurations, and they have seen some transmit queue time out happening during the test. This will cause the reset adapter function to be called by igc_tx_timeout(). Similar race conditions may arise when the interface is being brought down and up in igc_reinit_locked(), an interrupt being generated, and igc_clean_tx_irq() being called to complete the TX. When the igc_tx_timeout() function is invoked, this patch will turn off all TX ring HW queues during igc_down() process. TX ring HW queues will be activated again during the igc_configure_tx_ring() process when performing the igc_up() procedure later. This patch also moved existing igc_disable_tx_ring_hw() to avoid using forward declaration. Kernel trace: [ 7678.747813] ------------[ cut here ]------------ [ 7678.757914] NETDEV WATCHDOG: enp1s0 (igc): transmit queue 2 timed out [ 7678.770117] WARNING: CPU: 0 PID: 13 at net/sched/sch_generic.c:525 dev_watchdog+0x1ae/0x1f0 [ 7678.784459] Modules linked in: xt_conntrack nft_chain_nat xt_MASQUERADE xt_addrtype nft_compat nf_tables nfnetlink br_netfilter bridge stp llc overlay dm_mod emrcha(PO) emriio(PO) rktpm(PO) cegbuf_mod(PO) patch_update(PO) se(PO) sgx_tgts(PO) mktme(PO) keylocker(PO) svtdx(PO) svfs_pci_hotplug(PO) vtd_mod(PO) davemem(PO) svmabort(PO) svindexio(PO) usbx2(PO) ehci_sched(PO) svheartbeat(PO) ioapic(PO) sv8259(PO) svintr(PO) lt(PO) pcierootport(PO) enginefw_mod(PO) ata(PO) smbus(PO) spiflash_cdf(PO) arden(PO) dsa_iax(PO) oobmsm_punit(PO) cpm(PO) svkdb(PO) ebg_pch(PO) pch(PO) sviotargets(PO) svbdf(PO) svmem(PO) svbios(PO) dram(PO) svtsc(PO) targets(PO) superio(PO) svkernel(PO) cswitch(PO) mcf(PO) pentiumIII_mod(PO) fs_svfs(PO) mdevdefdb(PO) svfs_os_services(O) ixgbe mdio mdio_devres libphy emeraldrapids_svdefs(PO) regsupport(O) libnvdimm nls_cp437 snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hwdep x86_pkg_temp_thermal snd_hda_core snd_pcm snd_timer isst_if_mbox_pci [ 7678.784496] input_leds isst_if_mmio sg snd isst_if_common soundcore wmi button sad9(O) drm fuse backlight configfs efivarfs ip_tables x_tables vmd sdhci led_class rtl8150 r8152 hid_generic pegasus mmc_block usbhid mmc_core hid megaraid_sas ixgb igb i2c_algo_bit ice i40e hpsa scsi_transport_sas e1000e e1000 e100 ax88179_178a usbnet xhci_pci sd_mod xhci_hcd t10_pi crc32c_intel crc64_rocksoft igc crc64 crc_t10dif usbcore crct10dif_generic ptp crct10dif_common usb_common pps_core [ 7679.200403] RIP: 0010:dev_watchdog+0x1ae/0x1f0 [ 7679.210201] Code: 28 e9 53 ff ff ff 4c 89 e7 c6 05 06 42 b9 00 01 e8 17 d1 fb ff 44 89 e9 4c 89 e6 48 c7 c7 40 ad fb 81 48 89 c2 e8 52 62 82 ff <0f> 0b e9 72 ff ff ff 65 8b 05 80 7d 7c 7e 89 c0 48 0f a3 05 0a c1 [ 7679.245438] RSP: 0018:ffa00000001f7d90 EFLAGS: 00010282 [ 7679.256021] RAX: 0000000000000000 RBX: ff11000109938440 RCX: 0000000000000000 [ 7679.268710] RDX: ff11000361e26cd8 RSI: ff11000361e1b880 RDI: ff11000361e1b880 [ 7679.281314] RBP: ffa00000001f7da8 R08: ff1100035f8fffe8 R09: 0000000000027ffb [ 7679.293840] R10: 0000000000001f0a R11: ff1100035f840000 R12: ff11000109938000 [ 7679.306276] R13: 0000000000000002 R14: dead000000000122 R15: ffa00000001f7e18 [ 7679.318648] FS: 0000000000000000(0000) GS:ff11000361e00000(0000) knlGS:0000000000000000 [ 7679.332064] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 7679.342757] CR2: 00007ffff7fca168 CR3: 000000013b08a006 CR4: 0000000000471ef8 [ 7679.354984] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 7679.367207] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 [ 7679.379370] PKRU: 55555554 [ 7679.386446] Call Trace: [ 7679.393152] [ 7679.399363] ? __pfx_dev_watchdog+0x10/0x10 [ 7679.407870] call_timer_fn+0x31/0x110 [ 7679.415698] expire_timers+0xb2/0x120 [ 7679.423403] run_timer_softirq+0x179/0x1e0 [ 7679.431532] ? __schedule+0x2b1/0x820 [ 7679.439078] __do_softirq+0xd1/0x295 [ 7679.446426] ? __pfx_smpboot_thread_fn+0x10/0x10 [ 7679.454867] run_ksoftirqd+0x22/0x30 [ 7679.462058] smpboot_thread_fn+0xb7/0x160 [ 7679.469670] kthread+0xcd/0xf0 [ 7679.476097] ? __pfx_kthread+0x10/0x10 [ 7679.483211] ret_from_fork+0x29/0x50 [ 7679.490047] [ 7679.495204] ---[ end trace 0000000000000000 ]--- [ 7679.503179] igc 0000:01:00.0 enp1s0: Register Dump [ 7679.511230] igc 0000:01:00.0 enp1s0: Register Name Value [ 7679.519892] igc 0000:01:00.0 enp1s0: CTRL 181c0641 [ 7679.528782] igc 0000:01:00.0 enp1s0: STATUS 40280683 [ 7679.537551] igc 0000:01:00.0 enp1s0: CTRL_EXT 10000040 [ 7679.546284] igc 0000:01:00.0 enp1s0: MDIC 180a3800 [ 7679.554942] igc 0000:01:00.0 enp1s0: ICR 00000081 [ 7679.563503] igc 0000:01:00.0 enp1s0: RCTL 04408022 [ 7679.571963] igc 0000:01:00.0 enp1s0: RDLEN[0-3] 00001000 00001000 00001000 00001000 [ 7679.583075] igc 0000:01:00.0 enp1s0: RDH[0-3] 00000068 000000b6 0000000f 00000031 [ 7679.594162] igc 0000:01:00.0 enp1s0: RDT[0-3] 00000066 000000b2 0000000e 00000030 [ 7679.605174] igc 0000:01:00.0 enp1s0: RXDCTL[0-3] 02040808 02040808 02040808 02040808 [ 7679.616196] igc 0000:01:00.0 enp1s0: RDBAL[0-3] 1bb7c000 1bb7f000 1bb82000 0ef33000 [ 7679.627242] igc 0000:01:00.0 enp1s0: RDBAH[0-3] 00000001 00000001 00000001 00000001 [ 7679.638256] igc 0000:01:00.0 enp1s0: TCTL a503f0fa [ 7679.646607] igc 0000:01:00.0 enp1s0: TDBAL[0-3] 2ba4a000 1bb6f000 1bb74000 1bb79000 [ 7679.657609] igc 0000:01:00.0 enp1s0: TDBAH[0-3] 00000001 00000001 00000001 00000001 [ 7679.668551] igc 0000:01:00.0 enp1s0: TDLEN[0-3] 00001000 00001000 00001000 00001000 [ 7679.679470] igc 0000:01:00.0 enp1s0: TDH[0-3] 000000a7 0000002d 000000bf 000000d9 [ 7679.690406] igc 0000:01:00.0 enp1s0: TDT[0-3] 000000a7 0000002d 000000bf 000000d9 [ 7679.701264] igc 0000:01:00.0 enp1s0: TXDCTL[0-3] 02100108 02100108 02100108 02100108 [ 7679.712123] igc 0000:01:00.0 enp1s0: Reset adapter [ 7683.085967] igc 0000:01:00.0 enp1s0: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX [ 8086.945561] ------------[ cut here ]------------ Entering kdb (current=0xffffffff8220b200, pid 0) on processor 0 Oops: (null) due to oops @ 0xffffffff81573888 RIP: 0010:dql_completed+0x148/0x160 Code: c9 00 48 89 57 58 e9 46 ff ff ff 45 85 e4 41 0f 95 c4 41 39 db 0f 95 c1 41 84 cc 74 05 45 85 ed 78 0a 44 89 c1 e9 27 ff ff ff <0f> 0b 01 f6 44 89 c1 29 f1 0f 48 ca eb 8c cc cc cc cc cc cc cc cc RSP: 0018:ffa0000000003e00 EFLAGS: 00010287 RAX: 000000000000006c RBX: ffa0000003eb0f78 RCX: ff11000109938000 RDX: 0000000000000003 RSI: 0000000000000160 RDI: ff110001002e9480 RBP: ffa0000000003ed8 R08: ff110001002e93c0 R09: ffa0000000003d28 R10: 0000000000007cc0 R11: 0000000000007c54 R12: 00000000ffffffd9 R13: ff1100037039cb00 R14: 00000000ffffffd9 R15: ff1100037039c048 FS: 0000000000000000(0000) GS:ff11000361e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffff7fca168 CR3: 000000013b08a003 CR4: 0000000000471ef8 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: ? igc_poll+0x1a9/0x14d0 [igc] __napi_poll+0x2e/0x1b0 net_rx_action+0x126/0x250 __do_softirq+0xd1/0x295 irq_exit_rcu+0xc5/0xf0 common_interrupt+0x86/0xa0 asm_common_interrupt+0x27/0x40 RIP: 0010:cpuidle_enter_state+0xd3/0x3e0 Code: 73 f1 ff ff 49 89 c6 8b 05 e2 ca a7 00 85 c0 0f 8f b3 02 00 00 31 ff e8 1b de 75 ff 80 7d d7 00 0f 85 cd 01 00 00 fb 45 85 ff <0f> 88 fd 00 00 00 49 63 cf 4c 2b 75 c8 48 8d 04 49 48 89 ca 48 8d RSP: 0018:ffffffff82203df0 EFLAGS: 00000202 RAX: ff11000361e2a200 RBX: 0000000000000002 RCX: 000000000000001f RDX: 0000000000000000 RSI: 000000003cf3cf3d RDI: 0000000000000000 RBP: ffffffff82203e28 R08: 0000075ae38471c8 R09: 0000000000000018 R10: 000000000000031a R11: ffffffff8238dca0 R12: ffd1ffffff200000 R13: ffffffff8238dca0 R14: 0000075ae38471c8 R15: 0000000000000002 cpuidle_enter+0x2e/0x50 call_cpuidle+0x23/0x40 do_idle+0x1be/0x220 cpu_startup_entry+0x20/0x30 rest_init+0xb5/0xc0 arch_call_rest_init+0xe/0x30 start_kernel+0x448/0x760 x86_64_start_kernel+0x109/0x150 secondary_startup_64_no_verify+0xe0/0xeb more> [0]kdb> [0]kdb> [0]kdb> go Catastrophic error detected kdb_continue_catastrophic=0, type go a second time if you really want to continue [0]kdb> go Catastrophic error detected kdb_continue_catastrophic=0, attempting to continue [ 8086.955689] refcount_t: underflow; use-after-free. [ 8086.955697] WARNING: CPU: 0 PID: 0 at lib/refcount.c:28 refcount_warn_saturate+0xc2/0x110 [ 8086.955706] Modules linked in: xt_conntrack nft_chain_nat xt_MASQUERADE xt_addrtype nft_compat nf_tables nfnetlink br_netfilter bridge stp llc overlay dm_mod emrcha(PO) emriio(PO) rktpm(PO) cegbuf_mod(PO) patch_update(PO) se(PO) sgx_tgts(PO) mktme(PO) keylocker(PO) svtdx(PO) svfs_pci_hotplug(PO) vtd_mod(PO) davemem(PO) svmabort(PO) svindexio(PO) usbx2(PO) ehci_sched(PO) svheartbeat(PO) ioapic(PO) sv8259(PO) svintr(PO) lt(PO) pcierootport(PO) enginefw_mod(PO) ata(PO) smbus(PO) spiflash_cdf(PO) arden(PO) dsa_iax(PO) oobmsm_punit(PO) cpm(PO) svkdb(PO) ebg_pch(PO) pch(PO) sviotargets(PO) svbdf(PO) svmem(PO) svbios(PO) dram(PO) svtsc(PO) targets(PO) superio(PO) svkernel(PO) cswitch(PO) mcf(PO) pentiumIII_mod(PO) fs_svfs(PO) mdevdefdb(PO) svfs_os_services(O) ixgbe mdio mdio_devres libphy emeraldrapids_svdefs(PO) regsupport(O) libnvdimm nls_cp437 snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hwdep x86_pkg_temp_thermal snd_hda_core snd_pcm snd_timer isst_if_mbox_pci [ 8086.955751] input_leds isst_if_mmio sg snd isst_if_common soundcore wmi button sad9(O) drm fuse backlight configfs efivarfs ip_tables x_tables vmd sdhci led_class rtl8150 r8152 hid_generic pegasus mmc_block usbhid mmc_core hid megaraid_sas ixgb igb i2c_algo_bit ice i40e hpsa scsi_transport_sas e1000e e1000 e100 ax88179_178a usbnet xhci_pci sd_mod xhci_hcd t10_pi crc32c_intel crc64_rocksoft igc crc64 crc_t10dif usbcore crct10dif_generic ptp crct10dif_common usb_common pps_core [ 8086.955784] RIP: 0010:refcount_warn_saturate+0xc2/0x110 [ 8086.955788] Code: 01 e8 82 e7 b4 ff 0f 0b 5d c3 cc cc cc cc 80 3d 68 c6 eb 00 00 75 81 48 c7 c7 a0 87 f6 81 c6 05 58 c6 eb 00 01 e8 5e e7 b4 ff <0f> 0b 5d c3 cc cc cc cc 80 3d 42 c6 eb 00 00 0f 85 59 ff ff ff 48 [ 8086.955790] RSP: 0018:ffa0000000003da0 EFLAGS: 00010286 [ 8086.955793] RAX: 0000000000000000 RBX: ff1100011da40ee0 RCX: ff11000361e1b888 [ 8086.955794] RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ff11000361e1b880 [ 8086.955795] RBP: ffa0000000003da0 R08: 80000000ffff9f45 R09: ffa0000000003d28 [ 8086.955796] R10: ff1100035f840000 R11: 0000000000000028 R12: ff11000319ff8000 [ 8086.955797] R13: ff1100011bb79d60 R14: 00000000ffffffd6 R15: ff1100037039cb00 [ 8086.955798] FS: 0000000000000000(0000) GS:ff11000361e00000(0000) knlGS:0000000000000000 [ 8086.955800] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 8086.955801] CR2: 00007ffff7fca168 CR3: 000000013b08a003 CR4: 0000000000471ef8 [ 8086.955803] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 8086.955803] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 [ 8086.955804] PKRU: 55555554 [ 8086.955805] Call Trace: [ 8086.955806] [ 8086.955808] tcp_wfree+0x112/0x130 [ 8086.955814] skb_release_head_state+0x24/0xa0 [ 8086.955818] napi_consume_skb+0x9c/0x160 [ 8086.955821] igc_poll+0x5d8/0x14d0 [igc] [ 8086.955835] __napi_poll+0x2e/0x1b0 [ 8086.955839] net_rx_action+0x126/0x250 [ 8086.955843] __do_softirq+0xd1/0x295 [ 8086.955846] irq_exit_rcu+0xc5/0xf0 [ 8086.955851] common_interrupt+0x86/0xa0 [ 8086.955857] [ 8086.955857] [ 8086.955858] asm_common_interrupt+0x27/0x40 [ 8086.955862] RIP: 0010:cpuidle_enter_state+0xd3/0x3e0 [ 8086.955866] Code: 73 f1 ff ff 49 89 c6 8b 05 e2 ca a7 00 85 c0 0f 8f b3 02 00 00 31 ff e8 1b de 75 ff 80 7d d7 00 0f 85 cd 01 00 00 fb 45 85 ff <0f> 88 fd 00 00 00 49 63 cf 4c 2b 75 c8 48 8d 04 49 48 89 ca 48 8d [ 8086.955867] RSP: 0018:ffffffff82203df0 EFLAGS: 00000202 [ 8086.955869] RAX: ff11000361e2a200 RBX: 0000000000000002 RCX: 000000000000001f [ 8086.955870] RDX: 0000000000000000 RSI: 000000003cf3cf3d RDI: 0000000000000000 [ 8086.955871] RBP: ffffffff82203e28 R08: 0000075ae38471c8 R09: 0000000000000018 [ 8086.955872] R10: 000000000000031a R11: ffffffff8238dca0 R12: ffd1ffffff200000 [ 8086.955873] R13: ffffffff8238dca0 R14: 0000075ae38471c8 R15: 0000000000000002 [ 8086.955875] cpuidle_enter+0x2e/0x50 [ 8086.955880] call_cpuidle+0x23/0x40 [ 8086.955884] do_idle+0x1be/0x220 [ 8086.955887] cpu_startup_entry+0x20/0x30 [ 8086.955889] rest_init+0xb5/0xc0 [ 8086.955892] arch_call_rest_init+0xe/0x30 [ 8086.955895] start_kernel+0x448/0x760 [ 8086.955898] x86_64_start_kernel+0x109/0x150 [ 8086.955900] secondary_startup_64_no_verify+0xe0/0xeb [ 8086.955904] [ 8086.955904] ---[ end trace 0000000000000000 ]--- [ 8086.955912] ------------[ cut here ]------------ [ 8086.955913] kernel BUG at lib/dynamic_queue_limits.c:27! [ 8086.955918] invalid opcode: 0000 [#1] SMP [ 8086.955922] RIP: 0010:dql_completed+0x148/0x160 [ 8086.955925] Code: c9 00 48 89 57 58 e9 46 ff ff ff 45 85 e4 41 0f 95 c4 41 39 db 0f 95 c1 41 84 cc 74 05 45 85 ed 78 0a 44 89 c1 e9 27 ff ff ff <0f> 0b 01 f6 44 89 c1 29 f1 0f 48 ca eb 8c cc cc cc cc cc cc cc cc [ 8086.955927] RSP: 0018:ffa0000000003e00 EFLAGS: 00010287 [ 8086.955928] RAX: 000000000000006c RBX: ffa0000003eb0f78 RCX: ff11000109938000 [ 8086.955929] RDX: 0000000000000003 RSI: 0000000000000160 RDI: ff110001002e9480 [ 8086.955930] RBP: ffa0000000003ed8 R08: ff110001002e93c0 R09: ffa0000000003d28 [ 8086.955931] R10: 0000000000007cc0 R11: 0000000000007c54 R12: 00000000ffffffd9 [ 8086.955932] R13: ff1100037039cb00 R14: 00000000ffffffd9 R15: ff1100037039c048 [ 8086.955933] FS: 0000000000000000(0000) GS:ff11000361e00000(0000) knlGS:0000000000000000 [ 8086.955934] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 8086.955935] CR2: 00007ffff7fca168 CR3: 000000013b08a003 CR4: 0000000000471ef8 [ 8086.955936] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 8086.955937] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 [ 8086.955938] PKRU: 55555554 [ 8086.955939] Call Trace: [ 8086.955939] [ 8086.955940] ? igc_poll+0x1a9/0x14d0 [igc] [ 8086.955949] __napi_poll+0x2e/0x1b0 [ 8086.955952] net_rx_action+0x126/0x250 [ 8086.955956] __do_softirq+0xd1/0x295 [ 8086.955958] irq_exit_rcu+0xc5/0xf0 [ 8086.955961] common_interrupt+0x86/0xa0 [ 8086.955964] [ 8086.955965] [ 8086.955965] asm_common_interrupt+0x27/0x40 [ 8086.955968] RIP: 0010:cpuidle_enter_state+0xd3/0x3e0 [ 8086.955971] Code: 73 f1 ff ff 49 89 c6 8b 05 e2 ca a7 00 85 c0 0f 8f b3 02 00 00 31 ff e8 1b de 75 ff 80 7d d7 00 0f 85 cd 01 00 00 fb 45 85 ff <0f> 88 fd 00 00 00 49 63 cf 4c 2b 75 c8 48 8d 04 49 48 89 ca 48 8d [ 8086.955972] RSP: 0018:ffffffff82203df0 EFLAGS: 00000202 [ 8086.955973] RAX: ff11000361e2a200 RBX: 0000000000000002 RCX: 000000000000001f [ 8086.955974] RDX: 0000000000000000 RSI: 000000003cf3cf3d RDI: 0000000000000000 [ 8086.955974] RBP: ffffffff82203e28 R08: 0000075ae38471c8 R09: 0000000000000018 [ 8086.955975] R10: 000000000000031a R11: ffffffff8238dca0 R12: ffd1ffffff200000 [ 8086.955976] R13: ffffffff8238dca0 R14: 0000075ae38471c8 R15: 0000000000000002 [ 8086.955978] cpuidle_enter+0x2e/0x50 [ 8086.955981] call_cpuidle+0x23/0x40 [ 8086.955984] do_idle+0x1be/0x220 [ 8086.955985] cpu_startup_entry+0x20/0x30 [ 8086.955987] rest_init+0xb5/0xc0 [ 8086.955990] arch_call_rest_init+0xe/0x30 [ 8086.955992] start_kernel+0x448/0x760 [ 8086.955994] x86_64_start_kernel+0x109/0x150 [ 8086.955996] secondary_startup_64_no_verify+0xe0/0xeb [ 8086.955998] [ 8086.955999] Modules linked in: xt_conntrack nft_chain_nat xt_MASQUERADE xt_addrtype nft_compat nf_tables nfnetlink br_netfilter bridge stp llc overlay dm_mod emrcha(PO) emriio(PO) rktpm(PO) cegbuf_mod(PO) patch_update(PO) se(PO) sgx_tgts(PO) mktme(PO) keylocker(PO) svtdx(PO) svfs_pci_hotplug(PO) vtd_mod(PO) davemem(PO) svmabort(PO) svindexio(PO) usbx2(PO) ehci_sched(PO) svheartbeat(PO) ioapic(PO) sv8259(PO) svintr(PO) lt(PO) pcierootport(PO) enginefw_mod(PO) ata(PO) smbus(PO) spiflash_cdf(PO) arden(PO) dsa_iax(PO) oobmsm_punit(PO) cpm(PO) svkdb(PO) ebg_pch(PO) pch(PO) sviotargets(PO) svbdf(PO) svmem(PO) svbios(PO) dram(PO) svtsc(PO) targets(PO) superio(PO) svkernel(PO) cswitch(PO) mcf(PO) pentiumIII_mod(PO) fs_svfs(PO) mdevdefdb(PO) svfs_os_services(O) ixgbe mdio mdio_devres libphy emeraldrapids_svdefs(PO) regsupport(O) libnvdimm nls_cp437 snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hwdep x86_pkg_temp_thermal snd_hda_core snd_pcm snd_timer isst_if_mbox_pci [ 8086.956029] input_leds isst_if_mmio sg snd isst_if_common soundcore wmi button sad9(O) drm fuse backlight configfs efivarfs ip_tables x_tables vmd sdhci led_class rtl8150 r8152 hid_generic pegasus mmc_block usbhid mmc_core hid megaraid_sas ixgb igb i2c_algo_bit ice i40e hpsa scsi_transport_sas e1000e e1000 e100 ax88179_178a usbnet xhci_pci sd_mod xhci_hcd t10_pi crc32c_intel crc64_rocksoft igc crc64 crc_t10dif usbcore crct10dif_generic ptp crct10dif_common usb_common pps_core [16762.543675] INFO: NMI handler (kgdb_nmi_handler) took too long to run: 8675587.593 msecs [16762.543678] INFO: NMI handler (kgdb_nmi_handler) took too long to run: 8675587.595 msecs [16762.543673] INFO: NMI handler (kgdb_nmi_handler) took too long to run: 8675587.495 msecs [16762.543679] INFO: NMI handler (kgdb_nmi_handler) took too long to run: 8675587.599 msecs [16762.543678] INFO: NMI handler (kgdb_nmi_handler) took too long to run: 8675587.598 msecs [16762.543690] INFO: NMI handler (kgdb_nmi_handler) took too long to run: 8675587.605 msecs [16762.543684] INFO: NMI handler (kgdb_nmi_handler) took too long to run: 8675587.599 msecs [16762.543693] INFO: NMI handler (kgdb_nmi_handler) took too long to run: 8675587.613 msecs [16762.543784] ---[ end trace 0000000000000000 ]--- [16762.849099] RIP: 0010:dql_completed+0x148/0x160 PANIC: Fatal exception in interrupt Fixes: 9b275176270e ("igc: Add ndo_tx_timeout support") Tested-by: Alejandra Victoria Alcaraz Signed-off-by: Muhammad Husaini Zulkifli Acked-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit dfd739f182b00b02bd7470ed94d112684cc04fa2 Author: Christian Marangi Date: Mon Jul 24 05:25:31 2023 +0200 net: dsa: qca8k: fix mdb add/del case with 0 VID The qca8k switch doesn't support using 0 as VID and require a default VID to be always set. MDB add/del function doesn't currently handle this and are currently setting the default VID. Fix this by correctly handling this corner case and internally use the default VID for VID 0 case. Fixes: ba8f870dfa63 ("net: dsa: qca8k: add support for mdb_add/del") Signed-off-by: Christian Marangi Cc: stable@vger.kernel.org Signed-off-by: David S. Miller commit ae70dcb9d9ecaf7d9836d3e1b5bef654d7ef5680 Author: Christian Marangi Date: Mon Jul 24 05:25:30 2023 +0200 net: dsa: qca8k: fix broken search_and_del On deleting an MDB entry for a port, fdb_search_and_del is used. An FDB entry can't be modified so it needs to be deleted and readded again with the new portmap (and the port deleted as requested) We use the SEARCH operator to search the entry to edit by vid and mac address and then we check the aging if we actually found an entry. Currently the code suffer from a bug where the searched fdb entry is never read again with the found values (if found) resulting in the code always returning -EINVAL as aging was always 0. Fix this by correctly read the fdb entry after it was searched. Fixes: ba8f870dfa63 ("net: dsa: qca8k: add support for mdb_add/del") Signed-off-by: Christian Marangi Cc: stable@vger.kernel.org Signed-off-by: David S. Miller commit 80248d4160894d7e40b04111bdbaa4ff93fc4bd7 Author: Christian Marangi Date: Mon Jul 24 05:25:29 2023 +0200 net: dsa: qca8k: fix search_and_insert wrong handling of new rule On inserting a mdb entry, fdb_search_and_insert is used to add a port to the qca8k target entry in the FDB db. A FDB entry can't be modified so it needs to be removed and insert again with the new values. To detect if an entry already exist, the SEARCH operation is used and we check the aging of the entry. If the entry is not 0, the entry exist and we proceed to delete it. Current code have 2 main problem: - The condition to check if the FDB entry exist is wrong and should be the opposite. - When a FDB entry doesn't exist, aging was never actually set to the STATIC value resulting in allocating an invalid entry. Fix both problem by adding aging support to the function, calling the function with STATIC as aging by default and finally by correct the condition to check if the entry actually exist. Fixes: ba8f870dfa63 ("net: dsa: qca8k: add support for mdb_add/del") Signed-off-by: Christian Marangi Cc: stable@vger.kernel.org Signed-off-by: David S. Miller commit 2c39dd025da489cf87d26469d9f5ff19715324a0 Author: Christian Marangi Date: Mon Jul 24 05:25:28 2023 +0200 net: dsa: qca8k: enable use_single_write for qca8xxx The qca8xxx switch supports 2 way to write reg values, a slow way using mdio and a fast way by sending specially crafted mgmt packet to read/write reg. The fast way can support up to 32 bytes of data as eth packet are used to send/receive. This correctly works for almost the entire regmap of the switch but with the use of some kernel selftests for dsa drivers it was found a funny and interesting hw defect/limitation. For some specific reg, bulk write won't work and will result in writing only part of the requested regs resulting in half data written. This was especially hard to track and discover due to the total strangeness of the problem and also by the specific regs where this occurs. This occurs in the specific regs of the ATU table, where multiple entry needs to be written to compose the entire entry. It was discovered that with a bulk write of 12 bytes on QCA8K_REG_ATU_DATA0 only QCA8K_REG_ATU_DATA0 and QCA8K_REG_ATU_DATA2 were written, but QCA8K_REG_ATU_DATA1 was always zero. Tcpdump was used to make sure the specially crafted packet was correct and this was confirmed. The problem was hard to track as the lack of QCA8K_REG_ATU_DATA1 resulted in an entry somehow possible as the first bytes of the mac address are set in QCA8K_REG_ATU_DATA0 and the entry type is set in QCA8K_REG_ATU_DATA2. Funlly enough writing QCA8K_REG_ATU_DATA1 results in the same problem with QCA8K_REG_ATU_DATA2 empty and QCA8K_REG_ATU_DATA1 and QCA8K_REG_ATU_FUNC correctly written. A speculation on the problem might be that there are some kind of indirection internally when accessing these regs and they can't be accessed all together, due to the fact that it's really a table mapped somewhere in the switch SRAM. Even more funny is the fact that every other reg was tested with all kind of combination and they are not affected by this problem. Read operation was also tested and always worked so it's not affected by this problem. The problem is not present if we limit writing a single reg at times. To handle this hardware defect, enable use_single_write so that bulk api can correctly split the write in multiple different operation effectively reverting to a non-bulk write. Cc: Mark Brown Fixes: c766e077d927 ("net: dsa: qca8k: convert to regmap read/write API") Signed-off-by: Christian Marangi Cc: stable@vger.kernel.org Signed-off-by: David S. Miller commit f8ea95021022826a010f56cf19451c21f4c9c155 Author: Linus Walleij Date: Thu Jun 22 09:45:20 2023 +0200 misc/genalloc: Name subpools by of_node_full_name() A previous commit tried to come up with more generic subpool names, but this isn't quite working: the node name was used elsewhere to match pools to consumers which regressed the nVidia Tegra 2/3 video decoder. Revert back to an earlier approach using of_node_full_name() instead of just the name to make sure the pool name is more unique, and change both sites using this in the kernel. It is not perfect since two SRAM nodes could have the same subpool name but it makes the situation better than before. Reported-by: Dmitry Osipenko Fixes: 21e5a2d10c8f ("misc: sram: Generate unique names for subpools") Signed-off-by: Linus Walleij Tested-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20230622074520.3058027-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit 645bb6b1fe0b15f2f134055e7ad470036aca9202 Author: Greg Kroah-Hartman Date: Tue Jul 25 08:38:15 2023 +0200 Documentation: embargoed-hardware-issues.rst: add AMD to the list Add AMD back to the embargoed-hardware-issues.rst list. There was confusion about a recent issue that ended up being due to third-party's misrepresentation, not AMD, so add AMD back to the list to get notified properly as they understand the proper procedures to follow. Cc: Tom Lendacky Cc: Thomas Gleixner Link: https://lore.kernel.org/r/2023072514-submersed-yanking-652e@gregkh Signed-off-by: Greg Kroah-Hartman commit 456b5e85d8a56e5563573b10e0840c7ae59373da Author: Kalle Valo Date: Tue Jul 25 12:42:48 2023 +0300 MAINTAINERS: add Jeff as ath10k, ath11k and ath12k maintainer Jeff will now start maintaining these drivers together with me. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230725094248.3205486-1-kvalo@kernel.org commit cc326aae03c37d393e8dfba950caa33493dcdfad Author: Kalle Valo Date: Mon Jul 24 13:45:47 2023 +0300 MAINTAINERS: wifi: mark mlw8k as orphan Last activity from Lennert is from 2012 so mark the driver as orphan. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230724104547.3061709-10-kvalo@kernel.org commit 3ccbc99c152fded21ff3661d7685095e14065e96 Author: Kalle Valo Date: Mon Jul 24 13:45:46 2023 +0300 MAINTAINERS: wifi: mark b43 as orphan There's no maintainer for b43 so mark it as orphan. Signed-off-by: Kalle Valo Acked-by: Larry Finger Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230724104547.3061709-9-kvalo@kernel.org commit c1e0a70de12dea642c696a81fd1104f5377fb203 Author: Kalle Valo Date: Mon Jul 24 13:45:45 2023 +0300 MAINTAINERS: wifi: mark zd1211rw as orphan Last activity from Ulrich is from 2007 so mark the driver orphan. Remove the zd1211-devs list, I doubt anyone uses it anymore. The webpage seems to be down so remove that as well. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230724104547.3061709-8-kvalo@kernel.org commit 0566ec90515c50352442db467d2a8c8950d35dc9 Author: Kalle Valo Date: Mon Jul 24 13:45:44 2023 +0300 MAINTAINERS: wifi: mark wl3501 as orphan There's no maintainer for this driver so mark it as orphan. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230724104547.3061709-7-kvalo@kernel.org commit bc5dee3ce7c06d2c3d7a3b135a24f85de45a8362 Author: Kalle Valo Date: Mon Jul 24 13:45:43 2023 +0300 MAINTAINERS: wifi: mark rndis_wlan as orphan Last activity from Jussi for this driver is from 2013 so mark the driver orphan. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230724104547.3061709-6-kvalo@kernel.org commit e76983151dc66717e43c2a77abcfdb36318d2255 Author: Kalle Valo Date: Mon Jul 24 13:45:42 2023 +0300 MAINTAINERS: wifi: mark ar5523 as orphan Last activity from Pontus for this driver is from 2013 so mark the driver orphan. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230724104547.3061709-5-kvalo@kernel.org commit 74b81eac2dda55584aa6102feb920142ab08721a Author: Kalle Valo Date: Mon Jul 24 13:45:41 2023 +0300 MAINTAINERS: wifi: mark cw1200 as orphan Last activity from Solomon is from 2013 so mark the driver orphan. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230724104547.3061709-4-kvalo@kernel.org commit 25700d4916fefd27f83b933149c4da3d32db8585 Author: Kalle Valo Date: Mon Jul 24 13:45:40 2023 +0300 MAINTAINERS: wifi: atmel: mark as orphan Last activity from Simon is from 2005 so mark the driver is orphan. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230724104547.3061709-3-kvalo@kernel.org commit 96839282edc28996809b2101afef8ae971b9dad7 Author: Kalle Valo Date: Mon Jul 24 13:45:39 2023 +0300 MAINTAINERS: wifi: rtw88: change Ping as the maintainer Yan-Hsuan has been away since 2021 and Ping has been the de facto maintainer the past year, actively reviewing patches and doing all other maintainer duties. So fix the MAINTAINERS file to show the current situation. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230724104547.3061709-2-kvalo@kernel.org commit a1ce186db7f0e449f35d12fb55ae0da2a1b400e2 Author: Kalle Valo Date: Mon Jul 24 13:08:23 2023 +0300 Revert "wifi: ath6k: silence false positive -Wno-dangling-pointer warning on GCC 12" This reverts commit bd1d129daa3ede265a880e2c6a7f91eab0f4dc62. The dangling-pointer warnings were disabled kernel-wide by commit 49beadbd47c2 ("gcc-12: disable '-Wdangling-pointer' warning for now") for v5.19. So this hack in ath6kl is not needed anymore. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230724100823.2948804-1-kvalo@kernel.org commit fd7f08d92fcd7cc3eca0dd6c853f722a4c6176df Author: Ilan Peer Date: Sun Jul 23 23:10:43 2023 +0300 wifi: cfg80211: Fix return value in scan logic The reporter noticed a warning when running iwlwifi: WARNING: CPU: 8 PID: 659 at mm/page_alloc.c:4453 __alloc_pages+0x329/0x340 As cfg80211_parse_colocated_ap() is not expected to return a negative value return 0 and not a negative value if cfg80211_calc_short_ssid() fails. Fixes: c8cb5b854b40f ("nl80211/cfg80211: support 6 GHz scanning") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217675 Signed-off-by: Ilan Peer Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230723201043.3007430-1-ilan.peer@intel.com commit d265ebe41c911314bd273c218a37088835959fa1 Author: Kalle Valo Date: Thu Jul 20 18:14:44 2023 +0300 Revert "wifi: ath11k: Enable threaded NAPI" This reverts commit 13aa2fb692d3717767303817f35b3e650109add3. This commit broke QCN9074 initialisation: [ 358.960477] ath11k_pci 0000:04:00.0: ce desc not available for wmi command 36866 [ 358.960481] ath11k_pci 0000:04:00.0: failed to send WMI_STA_POWERSAVE_PARAM_CMDID [ 358.960484] ath11k_pci 0000:04:00.0: could not set uapsd params -105 As there's no fix available let's just revert it to get QCN9074 working again. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217536 Signed-off-by: Kalle Valo Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230720151444.2016637-1-kvalo@kernel.org commit 58f6259b7a08f8d47d4629609703d358b042f0fd Author: Rahul Singh Date: Tue Jul 18 12:31:07 2023 +0100 xen/evtchn: Introduce new IOCTL to bind static evtchn Xen 4.17 supports the creation of static evtchns. To allow user space application to bind static evtchns introduce new ioctl "IOCTL_EVTCHN_BIND_STATIC". Existing IOCTL doing more than binding that’s why we need to introduce the new IOCTL to only bind the static event channels. Static evtchns to be available for use during the lifetime of the guest. When the application exits, __unbind_from_irq() ends up being called from release() file operations because of that static evtchns are getting closed. To avoid closing the static event channel, add the new bool variable "is_static" in "struct irq_info" to mark the event channel static when creating the event channel to avoid closing the static evtchn. Also, take this opportunity to remove the open-coded version of the evtchn close in drivers/xen/evtchn.c file and use xen_evtchn_close(). Signed-off-by: Rahul Singh Reviewed-by: Oleksandr Tyshchenko Acked-by: Stefano Stabellini Link: https://lore.kernel.org/r/ae7329bf1713f83e4aad4f3fa0f316258c40a3e9.1689677042.git.rahul.singh@arm.com Signed-off-by: Juergen Gross commit 02ab7234fc69695736d60b34044fe591689ffadd Author: Masami Hiramatsu (Google) Date: Tue Jul 25 10:37:29 2023 +0900 selftests/ftrace: Fix to check fprobe event eneblement Fix to check the availability of fprobe and kprobes for add_remove_btfarg.tc. Only if both kprobe and fprobe are not supported, it should return "unsupported". Link: https://lore.kernel.org/all/169024904889.395371.17998733386857387118.stgit@devnote2/ Fixes: 4231f30fcc34 ("selftests/ftrace: Add BTF arguments test cases") Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) commit 1f9f4f4777e7958e5c1fbdfd9ddf4207dc00a40f Author: Masami Hiramatsu (Google) Date: Tue Jul 25 10:37:19 2023 +0900 tracing/probes: Fix to add NULL check for BTF APIs Since find_btf_func_param() abd btf_type_by_id() can return NULL, the caller must check the return value correctly. Link: https://lore.kernel.org/all/169024903951.395371.11361556840733470934.stgit@devnote2/ Fixes: b576e09701c7 ("tracing/probes: Support function parameters if BTF is available") Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) commit e11ec2b868af2b351c6c1e2e50eb711cc5423a10 Author: Alex Elder Date: Mon Jul 24 17:40:55 2023 -0500 net: ipa: only reset hashed tables when supported Last year, the code that manages GSI channel transactions switched from using spinlock-protected linked lists to using indexes into the ring buffer used for a channel. Recently, Google reported seeing transaction reference count underflows occasionally during shutdown. Doug Anderson found a way to reproduce the issue reliably, and bisected the issue to the commit that eliminated the linked lists and the lock. The root cause was ultimately determined to be related to unused transactions being committed as part of the modem shutdown cleanup activity. Unused transactions are not normally expected (except in error cases). The modem uses some ranges of IPA-resident memory, and whenever it shuts down we zero those ranges. In ipa_filter_reset_table() a transaction is allocated to zero modem filter table entries. If hashing is not supported, hashed table memory should not be zeroed. But currently nothing prevents that, and the result is an unused transaction. Something similar occurs when we zero routing table entries for the modem. By preventing any attempt to clear hashed tables when hashing is not supported, the reference count underflow is avoided in this case. Note that there likely remains an issue with properly freeing unused transactions (if they occur due to errors). This patch addresses only the underflows that Google originally reported. Cc: # 6.1.x Fixes: d338ae28d8a8 ("net: ipa: kill all other transaction lists") Tested-by: Douglas Anderson Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20230724224055.1688854-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit a49441c9ab059ce47f97dc15fb82d4e7b7b2ef65 Merge: 55cef78c244d0 a0ade8404c3bc Author: Jakub Kicinski Date: Tue Jul 25 20:10:08 2023 -0700 Merge branch 'net-fix-error-warning-by-fstrict-flex-arrays-3' Kuniyuki Iwashima says: ==================== net: Fix error/warning by -fstrict-flex-arrays=3. df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") started applying strict rules for standard string functions (strlen(), memcpy(), etc.) if CONFIG_FORTIFY_SOURCE=y. This series fixes two false positives caught by syzkaller. v2: https://lore.kernel.org/netdev/20230720004410.87588-1-kuniyu@amazon.com/ v1: https://lore.kernel.org/netdev/20230719185322.44255-1-kuniyu@amazon.com/ ==================== Link: https://lore.kernel.org/r/20230724213425.22920-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit a0ade8404c3bc2bf2631cb0f20d372eed22d9d96 Author: Kuniyuki Iwashima Date: Mon Jul 24 14:34:25 2023 -0700 af_packet: Fix warning of fortified memcpy() in packet_getname(). syzkaller found a warning in packet_getname() [0], where we try to copy 16 bytes to sockaddr_ll.sll_addr[8]. Some devices (ip6gre, vti6, ip6tnl) have 16 bytes address expressed by struct in6_addr. Also, Infiniband has 32 bytes as MAX_ADDR_LEN. The write seems to overflow, but actually not since we use struct sockaddr_storage defined in __sys_getsockname() and its size is 128 (_K_SS_MAXSIZE) bytes. Thus, we have sufficient room after sll_addr[] as __data[]. To avoid the warning, let's add a flex array member union-ed with sll_addr. Another option would be to use strncpy() and limit the copied length to sizeof(sll_addr), but it will return the partial address and break an application that passes sockaddr_storage to getsockname(). [0]: memcpy: detected field-spanning write (size 16) of single field "sll->sll_addr" at net/packet/af_packet.c:3604 (size 8) WARNING: CPU: 0 PID: 255 at net/packet/af_packet.c:3604 packet_getname+0x25c/0x3a0 net/packet/af_packet.c:3604 Modules linked in: CPU: 0 PID: 255 Comm: syz-executor750 Not tainted 6.5.0-rc1-00330-g60cc1f7d0605 #4 Hardware name: linux,dummy-virt (DT) pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : packet_getname+0x25c/0x3a0 net/packet/af_packet.c:3604 lr : packet_getname+0x25c/0x3a0 net/packet/af_packet.c:3604 sp : ffff800089887bc0 x29: ffff800089887bc0 x28: ffff000010f80f80 x27: 0000000000000003 x26: dfff800000000000 x25: ffff700011310f80 x24: ffff800087d55000 x23: dfff800000000000 x22: ffff800089887c2c x21: 0000000000000010 x20: ffff00000de08310 x19: ffff800089887c20 x18: ffff800086ab1630 x17: 20646c6569662065 x16: 6c676e697320666f x15: 0000000000000001 x14: 1fffe0000d56d7ca x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 3e60944c3da92b00 x8 : 3e60944c3da92b00 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff8000898874f8 x4 : ffff800086ac99e0 x3 : ffff8000803f8808 x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000 Call trace: packet_getname+0x25c/0x3a0 net/packet/af_packet.c:3604 __sys_getsockname+0x168/0x24c net/socket.c:2042 __do_sys_getsockname net/socket.c:2057 [inline] __se_sys_getsockname net/socket.c:2054 [inline] __arm64_sys_getsockname+0x7c/0x94 net/socket.c:2054 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x134/0x240 arch/arm64/kernel/syscall.c:139 do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:188 el0_svc+0x2c/0x7c arch/arm64/kernel/entry-common.c:647 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:665 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 Fixes: df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") Reported-by: syzkaller Suggested-by: Kees Cook Signed-off-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230724213425.22920-3-kuniyu@amazon.com Reviewed-by: Simon Horman Reviewed-by: Kees Cook Signed-off-by: Jakub Kicinski commit 06d4c8a80836d76ffec4f71ddb3de94ee93ab40d Author: Kuniyuki Iwashima Date: Mon Jul 24 14:34:24 2023 -0700 af_unix: Fix fortify_panic() in unix_bind_bsd(). syzkaller found a bug in unix_bind_bsd() [0]. We can reproduce it by bind()ing a socket on a path with length 108. 108 is the size of sun_addr of struct sockaddr_un and is the maximum valid length for the pathname socket. When calling bind(), we use struct sockaddr_storage as the actual buffer size, so terminating sun_addr[108] with null is legitimate as done in unix_mkname_bsd(). However, strlen(sunaddr) for such a case causes fortify_panic() if CONFIG_FORTIFY_SOURCE=y. __fortify_strlen() has no idea about the actual buffer size and see the string as unterminated. Let's use strnlen() to allow sun_addr to be unterminated at 107. [0]: detected buffer overflow in __fortify_strlen kernel BUG at lib/string_helpers.c:1031! Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 255 Comm: syz-executor296 Not tainted 6.5.0-rc1-00330-g60cc1f7d0605 #4 Hardware name: linux,dummy-virt (DT) pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : fortify_panic+0x1c/0x20 lib/string_helpers.c:1030 lr : fortify_panic+0x1c/0x20 lib/string_helpers.c:1030 sp : ffff800089817af0 x29: ffff800089817af0 x28: ffff800089817b40 x27: 1ffff00011302f68 x26: 000000000000006e x25: 0000000000000012 x24: ffff800087e60140 x23: dfff800000000000 x22: ffff800089817c20 x21: ffff800089817c8e x20: 000000000000006c x19: ffff00000c323900 x18: ffff800086ab1630 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000001 x14: 1ffff00011302eb8 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 64a26b65474d2a00 x8 : 64a26b65474d2a00 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff800089817438 x4 : ffff800086ac99e0 x3 : ffff800080f19e8c x2 : 0000000000000001 x1 : 0000000100000000 x0 : 000000000000002c Call trace: fortify_panic+0x1c/0x20 lib/string_helpers.c:1030 _Z16__fortify_strlenPKcU25pass_dynamic_object_size1 include/linux/fortify-string.h:217 [inline] unix_bind_bsd net/unix/af_unix.c:1212 [inline] unix_bind+0xba8/0xc58 net/unix/af_unix.c:1326 __sys_bind+0x1ac/0x248 net/socket.c:1792 __do_sys_bind net/socket.c:1803 [inline] __se_sys_bind net/socket.c:1801 [inline] __arm64_sys_bind+0x7c/0x94 net/socket.c:1801 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x134/0x240 arch/arm64/kernel/syscall.c:139 do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:188 el0_svc+0x2c/0x7c arch/arm64/kernel/entry-common.c:647 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:665 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 Code: aa0003e1 d0000e80 91030000 97ffc91a (d4210000) Fixes: df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") Reported-by: syzkaller Suggested-by: Kees Cook Signed-off-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230724213425.22920-2-kuniyu@amazon.com Reviewed-by: Simon Horman Reviewed-by: Kees Cook Signed-off-by: Jakub Kicinski commit 55cef78c244d0d076f5a75a35530ca63c92f4426 Author: Lin Ma Date: Sun Jul 23 16:02:05 2023 +0800 macvlan: add forgotten nla_policy for IFLA_MACVLAN_BC_CUTOFF The previous commit 954d1fa1ac93 ("macvlan: Add netlink attribute for broadcast cutoff") added one additional attribute named IFLA_MACVLAN_BC_CUTOFF to allow broadcast cutfoff. However, it forgot to describe the nla_policy at macvlan_policy (drivers/net/macvlan.c). Hence, this suppose NLA_S32 (4 bytes) integer can be faked as empty (0 bytes) by a malicious user, which could leads to OOB in heap just like CVE-2023-3773. To fix it, this commit just completes the nla_policy description for IFLA_MACVLAN_BC_CUTOFF. This enforces the length check and avoids the potential OOB read. Fixes: 954d1fa1ac93 ("macvlan: Add netlink attribute for broadcast cutoff") Signed-off-by: Lin Ma Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230723080205.3715164-1-linma@zju.edu.cn Signed-off-by: Jakub Kicinski commit d4e0265345778c623d1fe619075b677731847c34 Author: Yang Yingliang Date: Tue Jul 25 20:57:06 2023 +0800 scsi: pm80xx: Fix error return code in pm8001_pci_probe() If pm8001_init_sas_add() fails, return error code in pm8001_pci_probe(). Fixes: 14a8f116cdc0 ("scsi: pm80xx: Add GET_NVMD timeout during probe") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230725125706.566990-1-yangyingliang@huawei.com Reviewed-by: Igor Pylypiv Signed-off-by: Martin K. Petersen commit e65851989001c0c9ba9177564b13b38201c0854c Author: Steffen Maier Date: Mon Jul 24 16:51:56 2023 +0200 scsi: zfcp: Defer fc_rport blocking until after ADISC response Storage devices are free to send RSCNs, e.g. for internal state changes. If this happens on all connected paths, zfcp risks temporarily losing all paths at the same time. This has strong requirements on multipath configuration such as "no_path_retry queue". Avoid such situations by deferring fc_rport blocking until after the ADISC response, when any actual state change of the remote port became clear. The already existing port recovery triggers explicitly block the fc_rport. The triggers are: on ADISC reject or timeout (typical cable pull case), and on ADISC indicating that the remote port has changed its WWPN or the port is meanwhile no longer open. As a side effect, this also removes a confusing direct function call to another work item function zfcp_scsi_rport_work() instead of scheduling that other work item. It was probably done that way to have the rport block side effect immediate and synchronous to the caller. Fixes: a2fa0aede07c ("[SCSI] zfcp: Block FC transport rports early on errors") Cc: stable@vger.kernel.org #v2.6.30+ Reviewed-by: Benjamin Block Reviewed-by: Fedor Loshakov Signed-off-by: Steffen Maier Link: https://lore.kernel.org/r/20230724145156.3920244-1-maier@linux.ibm.com Signed-off-by: Martin K. Petersen commit aa89592fcb3af8372bd39ff468fdd65477f57201 Merge: 284779dbf4e98 d62cc390c2e99 Author: Alexei Starovoitov Date: Tue Jul 25 17:04:27 2023 -0700 Merge branch 'bpf-disable-preemption-in-perf_event_output-helpers-code' Jiri Olsa says: ==================== bpf: Disable preemption in perf_event_output helpers code hi, we got report of kernel crash [1][3] within bpf_event_output helper. The reason is the nesting protection code in bpf_event_output that expects disabled preemption, which is not guaranteed for programs executed by bpf_prog_run_array_cg. I managed to reproduce on tracing side where we have the same problem in bpf_perf_event_output. The reproducer [2] just creates busy uprobe and call bpf_perf_event_output helper a lot. v3 changes: - added acks and fixed 'Fixes' tag style [Hou Tao] - added Closes tag to patch 2 v2 changes: - I changed 'Fixes' commits to where I saw we switched from preempt_disable to migrate_disable, but I'm not completely sure about the patch 2, because it was tricky to find, would be nice if somebody could check on that thanks, jirka [1] https://github.com/cilium/cilium/issues/26756 [2] https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?h=bpf_output_fix_reproducer&id=8054dcc634121b884c7c331329d61d93351d03b5 [3] slack: [66194.378161] BUG: kernel NULL pointer dereference, address: 0000000000000001 [66194.378324] #PF: supervisor instruction fetch in kernel mode [66194.378447] #PF: error_code(0x0010) - not-present page ... [66194.378692] Oops: 0010 [#1] PREEMPT SMP NOPTI ... [66194.380666] [66194.380775] ? perf_output_sample+0x12a/0x9a0 [66194.380902] ? finish_task_switch.isra.0+0x81/0x280 [66194.381024] ? perf_event_output+0x66/0xa0 [66194.381148] ? bpf_event_output+0x13a/0x190 [66194.381270] ? bpf_event_output_data+0x22/0x40 [66194.381391] ? bpf_prog_dfc84bbde731b257_cil_sock4_connect+0x40a/0xacb [66194.381519] ? xa_load+0x87/0xe0 [66194.381635] ? __cgroup_bpf_run_filter_sock_addr+0xc1/0x1a0 [66194.381759] ? release_sock+0x3e/0x90 [66194.381876] ? sk_setsockopt+0x1a1/0x12f0 [66194.381996] ? udp_pre_connect+0x36/0x50 [66194.382114] ? inet_dgram_connect+0x93/0xa0 [66194.382233] ? __sys_connect+0xb4/0xe0 [66194.382353] ? udp_setsockopt+0x27/0x40 [66194.382470] ? __pfx_udp_push_pending_frames+0x10/0x10 [66194.382593] ? __sys_setsockopt+0xdf/0x1a0 [66194.382713] ? __x64_sys_connect+0xf/0x20 [66194.382832] ? do_syscall_64+0x3a/0x90 [66194.382949] ? entry_SYSCALL_64_after_hwframe+0x72/0xdc [66194.383077] --- ==================== Link: https://lore.kernel.org/r/20230725084206.580930-1-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit d62cc390c2e99ae267ffe4b8d7e2e08b6c758c32 Author: Jiri Olsa Date: Tue Jul 25 10:42:06 2023 +0200 bpf: Disable preemption in bpf_event_output We received report [1] of kernel crash, which is caused by using nesting protection without disabled preemption. The bpf_event_output can be called by programs executed by bpf_prog_run_array_cg function that disabled migration but keeps preemption enabled. This can cause task to be preempted by another one inside the nesting protection and lead eventually to two tasks using same perf_sample_data buffer and cause crashes like: BUG: kernel NULL pointer dereference, address: 0000000000000001 #PF: supervisor instruction fetch in kernel mode #PF: error_code(0x0010) - not-present page ... ? perf_output_sample+0x12a/0x9a0 ? finish_task_switch.isra.0+0x81/0x280 ? perf_event_output+0x66/0xa0 ? bpf_event_output+0x13a/0x190 ? bpf_event_output_data+0x22/0x40 ? bpf_prog_dfc84bbde731b257_cil_sock4_connect+0x40a/0xacb ? xa_load+0x87/0xe0 ? __cgroup_bpf_run_filter_sock_addr+0xc1/0x1a0 ? release_sock+0x3e/0x90 ? sk_setsockopt+0x1a1/0x12f0 ? udp_pre_connect+0x36/0x50 ? inet_dgram_connect+0x93/0xa0 ? __sys_connect+0xb4/0xe0 ? udp_setsockopt+0x27/0x40 ? __pfx_udp_push_pending_frames+0x10/0x10 ? __sys_setsockopt+0xdf/0x1a0 ? __x64_sys_connect+0xf/0x20 ? do_syscall_64+0x3a/0x90 ? entry_SYSCALL_64_after_hwframe+0x72/0xdc Fixing this by disabling preemption in bpf_event_output. [1] https://github.com/cilium/cilium/issues/26756 Cc: stable@vger.kernel.org Reported-by: Oleg "livelace" Popov Closes: https://github.com/cilium/cilium/issues/26756 Fixes: 2a916f2f546c ("bpf: Use migrate_disable/enable in array macros and cgroup/lirc code.") Acked-by: Hou Tao Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20230725084206.580930-3-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit f2c67a3e60d1071b65848efaa8c3b66c363dd025 Author: Jiri Olsa Date: Tue Jul 25 10:42:05 2023 +0200 bpf: Disable preemption in bpf_perf_event_output The nesting protection in bpf_perf_event_output relies on disabled preemption, which is guaranteed for kprobes and tracepoints. However bpf_perf_event_output can be also called from uprobes context through bpf_prog_run_array_sleepable function which disables migration, but keeps preemption enabled. This can cause task to be preempted by another one inside the nesting protection and lead eventually to two tasks using same perf_sample_data buffer and cause crashes like: kernel tried to execute NX-protected page - exploit attempt? (uid: 0) BUG: unable to handle page fault for address: ffffffff82be3eea ... Call Trace: ? __die+0x1f/0x70 ? page_fault_oops+0x176/0x4d0 ? exc_page_fault+0x132/0x230 ? asm_exc_page_fault+0x22/0x30 ? perf_output_sample+0x12b/0x910 ? perf_event_output+0xd0/0x1d0 ? bpf_perf_event_output+0x162/0x1d0 ? bpf_prog_c6271286d9a4c938_krava1+0x76/0x87 ? __uprobe_perf_func+0x12b/0x540 ? uprobe_dispatcher+0x2c4/0x430 ? uprobe_notify_resume+0x2da/0xce0 ? atomic_notifier_call_chain+0x7b/0x110 ? exit_to_user_mode_prepare+0x13e/0x290 ? irqentry_exit_to_user_mode+0x5/0x30 ? asm_exc_int3+0x35/0x40 Fixing this by disabling preemption in bpf_perf_event_output. Cc: stable@vger.kernel.org Fixes: 8c7dcb84e3b7 ("bpf: implement sleepable uprobes by chaining gps") Acked-by: Hou Tao Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20230725084206.580930-2-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 1cfe2d28e4d50a4e3e49344ade3b28f8dc26f891 Author: Yang Yingliang Date: Tue Jul 25 20:28:09 2023 +0800 ata: pata_octeon_cf: fix error return code in octeon_cf_probe() The variable 'rv' is set to 0 after calling of_property_read_reg(), so it cannot be used as an error code. Change to using correct error codes in the error path. Fixes: d0b2461678b1 ("ata: Use of_property_read_reg() to parse "reg"") Signed-off-by: Yang Yingliang Reviewed-by: Sergey Shtylyov Reviewed-by: Rob Herring Signed-off-by: Damien Le Moal commit 4139f992c49356391fb086c0c8ce51f66c26d623 Author: Minjie Du Date: Tue Jul 25 11:06:25 2023 +0800 ata: pata_arasan_cf: Use dev_err_probe() instead dev_err() in data_xfer() It is possible for dma_request_chan() to return EPROBE_DEFER, which means acdev->host->dev is not ready yet. At this point dev_err() will have no output. Use dev_err_probe() instead. Signed-off-by: Minjie Du Acked-by: Viresh Kumar Reviewed-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit 18b44bc5a67275641fb26f2c54ba7eef80ac5950 Author: Eric Snowberg Date: Tue Jul 25 17:56:46 2023 -0400 ovl: Always reevaluate the file signature for IMA Commit db1d1e8b9867 ("IMA: use vfs_getattr_nosec to get the i_version") partially closed an IMA integrity issue when directly modifying a file on the lower filesystem. If the overlay file is first opened by a user and later the lower backing file is modified by root, but the extended attribute is NOT updated, the signature validation succeeds with the old original signature. Update the super_block s_iflags to SB_I_IMA_UNVERIFIABLE_SIGNATURE to force signature reevaluation on every file access until a fine grained solution can be found. Signed-off-by: Eric Snowberg Signed-off-by: Mimi Zohar Signed-off-by: Linus Torvalds commit 9f9116406120638b4d8db3831ffbc430dd2e1e95 Author: Kirill A. Shutemov Date: Tue Jul 25 02:03:29 2023 +0300 x86/traps: Fix load_unaligned_zeropad() handling for shared TDX memory Commit c4e34dd99f2e ("x86: simplify load_unaligned_zeropad() implementation") changes how exceptions around load_unaligned_zeropad() handled. The kernel now uses the fault_address in fixup_exception() to verify the address calculations for the load_unaligned_zeropad(). It works fine for #PF, but breaks on #VE since no fault address is passed down to fixup_exception(). Propagating ve_info.gla down to fixup_exception() resolves the issue. See commit 1e7769653b06 ("x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page") for more context. Signed-off-by: Kirill A. Shutemov Reported-by: Michael Kelley Fixes: c4e34dd99f2e ("x86: simplify load_unaligned_zeropad() implementation") Acked-by: Dave Hansen Signed-off-by: Linus Torvalds commit aa6fde93f3a49e42c0fe0490d7f3711bac0d162e Author: Tejun Heo Date: Mon Jul 17 12:50:02 2023 -1000 workqueue: Scale up wq_cpu_intensive_thresh_us if BogoMIPS is below 4000 wq_cpu_intensive_thresh_us is used to detect CPU-hogging per-cpu work items. Once detected, they're excluded from concurrency management to prevent them from blocking other per-cpu work items. If CONFIG_WQ_CPU_INTENSIVE_REPORT is enabled, repeat offenders are also reported so that the code can be updated. The default threshold is 10ms which is long enough to do fair bit of work on modern CPUs while short enough to be usually not noticeable. This unfortunately leads to a lot of, arguable spurious, detections on very slow CPUs. Using the same threshold across CPUs whose performance levels may be apart by multiple levels of magnitude doesn't make whole lot of sense. This patch scales up wq_cpu_intensive_thresh_us upto 1 second when BogoMIPS is below 4000. This is obviously very inaccurate but it doesn't have to be accurate to be useful. The mechanism is still useful when the threshold is fully scaled up and the benefits of reports are usually shared with everyone regardless of who's reporting, so as long as there are sufficient number of fast machines reporting, we don't lose much. Some (or is it all?) ARM CPUs systemtically report significantly lower BogoMIPS. While this doesn't break anything, given how widespread ARM CPUs are, it's at least a missed opportunity and it probably would be a good idea to teach workqueue about it. Signed-off-by: Tejun Heo Reported-and-Tested-by: Geert Uytterhoeven commit 0b4a9fdc9317440a71d4d4c264a5650bf4a90f3c Merge: af2e19389c2c1 f75546f58a70d Author: Linus Torvalds Date: Tue Jul 25 13:54:04 2023 -0700 Merge tag 'nfsd-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fix from Chuck Lever: - Fix TEST_STATEID response * tag 'nfsd-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: Remove incorrect check in nfsd4_validate_stateid commit bc1688fce2ec7726112276650762275392d1bab1 Author: Lijo Lazar Date: Tue Jul 25 11:00:08 2023 +0530 drm/amdgpu: Restore HQD persistent state register On GFX v9.4.3, compute queue MQD is populated using the values in HQD persistent state register. Hence don't clear the values on module unload, instead restore it to the default reset value so that MQD is initialized correctly during next module load. In particular, preload flag needs to be set on compute queue MQD, otherwise it could cause uninitialized values being used at device reset state resulting in EDC. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit 38ac4e8385ffb275b1837986ca6c16f26ea028c5 Author: Dan Carpenter Date: Fri Jul 21 17:55:49 2023 +0300 drm/amd/display: Unlock on error path in dm_handle_mst_sideband_msg_ready_event() This error path needs to unlock the "aconnector->handle_mst_msg_ready" mutex before returning. Fixes: 4f6d9e38c4d2 ("drm/amd/display: Add polling method to handle MST reply packet") Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit de612738e9771bd66aeb20044486c457c512f684 Author: Leo Chen Date: Wed Jul 12 16:50:15 2023 -0400 drm/amd/display: Exit idle optimizations before attempt to access PHY [Why & How] DMUB may hang when powering down pixel clocks due to no dprefclk. It is fixed by exiting idle optimization before the attempt to access PHY. Reviewed-by: Nicholas Kazlauskas Acked-by: Alex Hung Signed-off-by: Leo Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4509e69a07761d08df7c46d4a08c8222522b1933 Author: Alvin Lee Date: Wed Jul 12 17:22:25 2023 -0400 drm/amd/display: Don't apply FIFO resync W/A if rdivider = 0 [Description] It is not valid to set the WDIVIDER value to 0, so do not re-write to DISPCLK_WDIVIDER if the current value is 0 (i.e., it is at it's initial value and we have not made any requests to change DISPCLK yet). Reviewed-by: Saaem Rizvi Acked-by: Alex Hung Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 25b054c3c89cb6a7106a7982f0f70e83d0797dab Author: George Shen Date: Tue Jul 11 13:22:36 2023 -0400 drm/amd/display: Guard DCN31 PHYD32CLK logic against chip family [Why] Current yellow carp B0 PHYD32CLK logic is incorrectly applied to other ASICs. [How] Add guard to check chip family is yellow carp before applying logic. Reviewed-by: Hansen Dsouza Acked-by: Alex Hung Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4a37c55b859a69f429bfa7fab4fc43ee470b60ed Author: Jane Jian Date: Thu Jul 20 18:08:07 2023 +0800 drm/amd/smu: use AverageGfxclkFrequency* to replace previous GFX Curr Clock Report current GFX clock also from average clock value as the original CurrClock data is not valid/accurate any more as per FW team Signed-off-by: Jane Jian Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit c01aebeef3ce45f696ffa0a1303cea9b34babb45 Author: Mario Limonciello Date: Thu Jul 13 00:14:59 2023 -0500 drm/amd: Fix an error handling mistake in psp_sw_init() If the second call to amdgpu_bo_create_kernel() fails, the memory allocated from the first call should be cleared. If the third call fails, the memory from the second call should be cleared. Fixes: b95b5391684b ("drm/amdgpu/psp: move PSP memory alloc from hw_init to sw_init") Signed-off-by: Mario Limonciello Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 9beb223f2a3d1bb2cc4dff71b9750d2b82f01ae5 Author: Victor Lu Date: Tue Jul 18 14:31:58 2023 -0400 drm/amdgpu: Fix infinite loop in gfxhub_v1_2_xcc_gart_enable (v2) An instance of for_each_inst() was not changed to match its new behaviour and is causing a loop. v2: remove tmp_mask variable Fixes: b579ea632fca ("drm/amdgpu: Modify for_each_inst macro") Signed-off-by: Victor Lu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 602816c3ee3fdbf4a72cb4d2e5b8b756a5104b0f Author: Jonathan Kim Date: Wed Jul 12 16:32:29 2023 -0400 drm/amdkfd: fix trap handling work around for debugging Update the list of devices that require the cwsr trap handling workaround for debugging use cases. Signed-off-by: Jonathan Kim Acked-by: Ruili Ji Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit faafd6ca7e6e7100d21d3f43ec17674f36c9f843 Author: Sumit Gupta Date: Wed Jun 21 19:14:00 2023 +0530 memory: tegra: make icc_set_bw return zero if BWMGR not supported Return zero from icc_set_bw() to MC client driver if MRQ_BWMGR_INT is not supported by the BPMP-FW. Currently, 'EINVAL' is returned which causes error message in client drivers even when the platform doesn't support scaling. Fixes: 9365bf006f53 ("PCI: tegra194: Add interconnect support in Tegra234") Signed-off-by: Sumit Gupta Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20230621134400.23070-5-sumitg@nvidia.com Signed-off-by: Krzysztof Kozlowski commit 39b1320e5dc2b707dfb5c25b0298ce9d4fc05aea Author: YueHaibing Date: Tue Jul 25 10:13:17 2023 +0800 drm/fb-helper: Remove unused inline function drm_fb_helper_defio_init() Since commit 8e86dee02253 ("drm/fb-helper: Remove drm_fb_helper_defio_init() and update docs") this inline helper not used anymore. Fixes: 8e86dee02253 ("drm/fb-helper: Remove drm_fb_helper_defio_init() and update docs") Signed-off-by: YueHaibing Reviewed-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230725021317.8080-1-yuehaibing@huawei.com commit 748c5ea8b8796ae8ee80b8d3a3d940570b588d59 Author: Ruihong Luo Date: Thu Jul 13 08:42:36 2023 +0800 serial: 8250_dw: Preserve original value of DLF register Preserve the original value of the Divisor Latch Fraction (DLF) register. When the DLF register is modified without preservation, it can disrupt the baudrate settings established by firmware or bootloader, leading to data corruption and the generation of unreadable or distorted characters. Fixes: 701c5e73b296 ("serial: 8250_dw: add fractional divisor support") Cc: stable Signed-off-by: Ruihong Luo Link: https://lore.kernel.org/stable/20230713004235.35904-1-colorsu1922%40gmail.com Reviewed-by: Ilpo Järvinen Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230713004235.35904-1-colorsu1922@gmail.com Signed-off-by: Greg Kroah-Hartman commit 57c984f6fe20ebb9306d6e8c09b4f67fe63298c6 Author: Biju Das Date: Tue Jul 4 16:48:18 2023 +0100 tty: serial: sh-sci: Fix sleeping in atomic context Fix sleeping in atomic context warning as reported by the Smatch static checker tool by replacing disable_irq->disable_irq_nosync. Reported by: Dan Carpenter Fixes: 8749061be196 ("tty: serial: sh-sci: Add RZ/G2L SCIFA DMA tx support") Cc: stable@kernel.org Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230704154818.406913-1-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 9b8fef6345d5487137d4193bb0a0eae2203c284e Author: Samuel Holland Date: Fri Jun 23 23:01:59 2023 -0700 serial: sifive: Fix sifive_serial_console_setup() section This function is called indirectly from the platform driver probe function. Even if the driver is built in, it may be probed after free_initmem() due to deferral or unbinding/binding via sysfs. Thus the function cannot be marked as __init. Fixes: 45c054d0815b ("tty: serial: add driver for the SiFive UART") Cc: stable Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20230624060159.3401369-1-samuel.holland@sifive.com Signed-off-by: Greg Kroah-Hartman commit 916a4edf3daed845b1e5d6cf0578a7e43c6f520e Author: Vijaya Krishna Nivarthi Date: Tue Jul 25 17:18:09 2023 +0530 spi: spi-qcom-qspi: Add DMA_CHAIN_DONE to ALL_IRQS Add latest added DMA_CHAIN_DONE irq to QSPI_ALL_IRQS that encompasses all of the qspi IRQs. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/1690285689-30233-5-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Mark Brown commit cfb81f2243b25a0d79accc6510ad66c5c5ad99ba Author: Vijaya Krishna Nivarthi Date: Tue Jul 25 17:18:08 2023 +0530 spi: spi-qcom-qspi: Call dma_wmb() after setting up descriptors After setting up dma descriptors and before initiaiting dma transfer, call dma_wmb() to ensure all writes go through. This doesn't fix any reported problem but is added for safety. Signed-off-by: Vijaya Krishna Nivarthi Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/1690285689-30233-4-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Mark Brown commit f7ba36d399c4558f36886adff9400be591b245f6 Author: Vijaya Krishna Nivarthi Date: Tue Jul 25 17:18:07 2023 +0530 spi: spi-qcom-qspi: Use GFP_ATOMIC flag while allocating for descriptor While allocating for DMA descriptor, GFP_KERNEL flag is being used and this allocation happens within critical section with spinlock acquired. This generates a static checker warning. Use GFP_ATOMIC to prevent sleeping; and since this increases chances of allocation failure, add handling accordingly. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/abc223e8-44af-40bb-a0bd-9865b393f435@moroto.mountain/ Signed-off-by: Vijaya Krishna Nivarthi Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/1690285689-30233-3-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Mark Brown commit 17aaf9ea07b656016316dc37716e987742b3e296 Author: Vijaya Krishna Nivarthi Date: Tue Jul 25 17:18:06 2023 +0530 spi: spi-qcom-qspi: Ignore disabled interrupts' status in isr During FIFO/DMA modes dynamic switching, only corresponding interrupts are enabled. However its possible that FIFO related interrupt status registers get set during DMA mode. For example WR_FIFO_EMPTY bit is set during DMA TX. Ignore such status bits so that they don't trip unwanted operations. Suggested-by: Douglas Anderson Signed-off-by: Vijaya Krishna Nivarthi Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Link: https://lore.kernel.org/r/1690285689-30233-2-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Mark Brown commit af2e19389c2c1d8a299e04c5105b180ef0c5b5b5 Merge: 0b5547c51827e 922a9bd138101 Author: Linus Torvalds Date: Tue Jul 25 11:03:53 2023 -0700 Merge tag 'm68k-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k fix from Geert Uytterhoeven: - Fix the build when using the toolchain in Debian unstable. * tag 'm68k-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: Fix invalid .section syntax commit e29c3f81eb8904edb762ea450aa78f52e5044b31 Author: Randy Dunlap Date: Sun Jul 23 23:33:41 2023 -0700 Documentation: devices.txt: reconcile serial/ucc_uart minor numers Reconcile devices.txt with serial/ucc_uart.c regarding device number assignments. ucc_uart.c supports 4 ports and uses minor devnums 46-49, so update devices.txt with that info. Then update ucc_uart.c's reference to the location of the devices.txt list in the kernel source tree. Fixes: d7584ed2b994 ("[POWERPC] qe-uart: add support for Freescale QUICCEngine UART") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Randy Dunlap Cc: Timur Tabi Cc: Kumar Gala Cc: linuxppc-dev@lists.ozlabs.org Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/20230724063341.28198-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit 767bb2aacf64752946f0a72fcec521a4968b2942 Author: Tony Lindgren Date: Fri Jul 21 10:23:32 2023 +0300 MAINTAINERS: Update TTY layer for lists and recently added files Add mailing lists for linux-serial and lkml for the TTY layer. And let's list the recently added files. This makes it easier for get_maintainer.pl to include linux-serial for patches. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230721072334.59272-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 9b9c8195f3f0d74a826077fc1c01b9ee74907239 Author: Chaoyuan Peng Date: Tue Jul 18 04:39:43 2023 +0000 tty: n_gsm: fix UAF in gsm_cleanup_mux In gsm_cleanup_mux() the 'gsm->dlci' pointer was not cleaned properly, leaving it a dangling pointer after gsm_dlci_release. This leads to use-after-free where 'gsm->dlci[0]' are freed and accessed by the subsequent gsm_cleanup_mux(). Such is the case in the following call trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 gsm_cleanup_mux+0x76a/0x850 drivers/tty/n_gsm.c:2397 gsm_config drivers/tty/n_gsm.c:2653 [inline] gsmld_ioctl+0xaae/0x15b0 drivers/tty/n_gsm.c:2986 tty_ioctl+0x8ff/0xc50 drivers/tty/tty_io.c:2816 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Allocated by task 3501: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] gsm_dlci_alloc+0x53/0x3a0 drivers/tty/n_gsm.c:1932 gsm_activate_mux+0x1c/0x330 drivers/tty/n_gsm.c:2438 gsm_config drivers/tty/n_gsm.c:2677 [inline] gsmld_ioctl+0xd46/0x15b0 drivers/tty/n_gsm.c:2986 tty_ioctl+0x8ff/0xc50 drivers/tty/tty_io.c:2816 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 3501: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0xf1/0x270 mm/slub.c:4559 dlci_put drivers/tty/n_gsm.c:1988 [inline] gsm_dlci_release drivers/tty/n_gsm.c:2021 [inline] gsm_cleanup_mux+0x574/0x850 drivers/tty/n_gsm.c:2415 gsm_config drivers/tty/n_gsm.c:2653 [inline] gsmld_ioctl+0xaae/0x15b0 drivers/tty/n_gsm.c:2986 tty_ioctl+0x8ff/0xc50 drivers/tty/tty_io.c:2816 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Fixes: aa371e96f05d ("tty: n_gsm: fix restart handling via CLD command") Signed-off-by: Chaoyuan Peng Cc: stable Signed-off-by: Greg Kroah-Hartman commit 1e4ab7b4c881cf26c1c72b3f56519e03475486fb Author: Joe Thornber Date: Tue Jul 25 11:44:41 2023 -0400 dm cache policy smq: ensure IO doesn't prevent cleaner policy progress When using the cleaner policy to decommission the cache, there is never any writeback started from the cache as it is constantly delayed due to normal I/O keeping the device busy. Meaning @idle=false was always being passed to clean_target_met() Fix this by adding a specific 'cleaner' flag that is set when the cleaner policy is configured. This flag serves to always allow the cleaner's writeback work to be queued until the cache is decommissioned (even if the cache isn't idle). Reported-by: David Jeffery Fixes: b29d4986d0da ("dm cache: significant rework to leverage dm-bio-prison-v2") Cc: stable@vger.kernel.org Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer commit 7d5fff8982a2199d49ec067818af7d84d4f95ca0 Author: Yu Kuai Date: Sat Jul 8 17:21:53 2023 +0800 dm raid: protect md_stop() with 'reconfig_mutex' __md_stop_writes() and __md_stop() will modify many fields that are protected by 'reconfig_mutex', and all the callers will grab 'reconfig_mutex' except for md_stop(). Also, update md_stop() to make certain 'reconfig_mutex' is held using lockdep_assert_held(). Fixes: 9d09e663d550 ("dm: raid456 basic support") Signed-off-by: Yu Kuai Signed-off-by: Mike Snitzer commit e74c874eabe2e9173a8fbdad616cd89c70eb8ffd Author: Yu Kuai Date: Sat Jul 8 17:21:52 2023 +0800 dm raid: clean up four equivalent goto tags in raid_ctr() There are four equivalent goto tags in raid_ctr(), clean them up to use just one. There is no functional change and this is preparation to fix raid_ctr()'s unprotected md_stop(). Signed-off-by: Yu Kuai Signed-off-by: Mike Snitzer commit bae3028799dc4f1109acc4df37c8ff06f2d8f1a0 Author: Yu Kuai Date: Sat Jul 8 17:21:51 2023 +0800 dm raid: fix missing reconfig_mutex unlock in raid_ctr() error paths In the error paths 'bad_stripe_cache' and 'bad_check_reshape', 'reconfig_mutex' is still held after raid_ctr() returns. Fixes: 9dbd1aa3a81c ("dm raid: add reshaping support to the target") Signed-off-by: Yu Kuai Signed-off-by: Mike Snitzer commit d4a3806bea61c8ef6e0103d0f39786e00586522e Author: Mikulas Patocka Date: Mon Jul 3 17:12:39 2023 +0200 dm integrity: fix double free on memory allocation failure If the statement "recalc_tags = kvmalloc(recalc_tags_size, GFP_NOIO);" fails, we call "vfree(recalc_buffer)" and we jump to the label "oom". If the condition "recalc_sectors >= 1U << ic->sb->log2_sectors_per_block" is false, we jump to the label "free_ret" and call "vfree(recalc_buffer)" again, on an already released memory block. Fix the bug by setting "recalc_buffer = NULL" after freeing it. Fixes: da8b4fc1f63a ("dm integrity: only allocate recalculate buffer when needed") Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 2627335a1329a0d39d8d277994678571c4f21800 Author: Frank Li Date: Fri Jul 7 19:00:15 2023 -0400 usb: cdns3: fix incorrect calculation of ep_buf_size when more than one config Previously, the cdns3_gadget_check_config() function in the cdns3 driver mistakenly calculated the ep_buf_size by considering only one configuration's endpoint information because "claimed" will be clear after call usb_gadget_check_config(). The fix involves checking the private flags EP_CLAIMED instead of relying on the "claimed" flag. Fixes: dce49449e04f ("usb: cdns3: allocate TX FIFO size according to composite EP number") Cc: stable Reported-by: Ravi Gunasekaran Signed-off-by: Frank Li Acked-by: Peter Chen Tested-by: Ravi Gunasekaran Link: https://lore.kernel.org/r/20230707230015.494999-2-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman commit f4fc01af5b640bc39bd9403b5fd855345a2ad5f8 Author: Frank Li Date: Fri Jul 7 19:00:14 2023 -0400 usb: gadget: call usb_gadget_check_config() to verify UDC capability The legacy gadget driver omitted calling usb_gadget_check_config() to ensure that the USB device controller (UDC) has adequate resources, including sufficient endpoint numbers and types, to support the given configuration. Previously, usb_add_config() was solely invoked by the legacy gadget driver. Adds the necessary usb_gadget_check_config() after the bind() operation to fix the issue. Fixes: dce49449e04f ("usb: cdns3: allocate TX FIFO size according to composite EP number") Cc: stable Reported-by: Ravi Gunasekaran Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20230707230015.494999-1-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman commit 609fded3f91972ada551c141c5d04a71704f8967 Author: Kyle Tso Date: Fri Jun 23 23:10:36 2023 +0800 usb: typec: Use sysfs_emit_at when concatenating the string The buffer address used in sysfs_emit should be aligned to PAGE_SIZE. Use sysfs_emit_at instead to offset the buffer. Fixes: a7cff92f0635 ("usb: typec: USB Power Delivery helpers for ports and partners") Cc: stable@vger.kernel.org Signed-off-by: Kyle Tso Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230623151036.3955013-4-kyletso@google.com Signed-off-by: Greg Kroah-Hartman commit 4b642dc9829507e4afabc03d32a18abbdb192c5e Author: Kyle Tso Date: Fri Jun 23 23:10:35 2023 +0800 usb: typec: Iterate pds array when showing the pd list The pointers of each usb_power_delivery handles are stored in "pds" array returned from the pd_get ops but not in the adjacent memory calculated from "pd". Get the handles from "pds" array directly instead of deriving them from "pd". Fixes: a7cff92f0635 ("usb: typec: USB Power Delivery helpers for ports and partners") Cc: stable@vger.kernel.org Signed-off-by: Kyle Tso Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230623151036.3955013-3-kyletso@google.com Signed-off-by: Greg Kroah-Hartman commit b33ebb2415e7e0a55ee3d049c2890d3a3e3805b6 Author: Kyle Tso Date: Fri Jun 23 23:10:34 2023 +0800 usb: typec: Set port->pd before adding device for typec_port When calling device_add in the registration of typec_port, it will do the NULL check on usb_power_delivery handle in typec_port for the visibility of the device attributes. It is always NULL because port->pd is set in typec_port_set_usb_power_delivery which is later than the device_add call. Set port->pd before device_add and only link the device after that. Fixes: a7cff92f0635 ("usb: typec: USB Power Delivery helpers for ports and partners") Cc: stable@vger.kernel.org Signed-off-by: Kyle Tso Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230623151036.3955013-2-kyletso@google.com Signed-off-by: Greg Kroah-Hartman commit da6d91ed77062960107e2eddacd932abecfd0592 Author: Yang Yingliang Date: Tue Jul 25 20:53:19 2023 +0800 usb: typec: qcom: fix return value check in qcom_pmic_typec_probe() device_get_named_child_node() returns NULL, if it fails, replace IS_ERR() with NULL pointer check. Fixes: a4422ff22142 ("usb: typec: qcom: Add Qualcomm PMIC Type-C driver") Signed-off-by: Yang Yingliang Acked-by: Konrad Dybcio Acked-by: Bryan O'Donoghue Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230725125319.565733-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit a8291be6b5dd465c22af229483dbac543a91e24e Author: Dan Carpenter Date: Tue Jul 4 17:09:09 2023 +0300 Revert "usb: gadget: tegra-xudc: Fix error check in tegra_xudc_powerdomain_init()" This reverts commit f08aa7c80dac27ee00fa6827f447597d2fba5465. The reverted commit was based on static analysis and a misunderstanding of how PTR_ERR() and NULLs are supposed to work. When a function returns both pointer errors and NULL then normally the NULL means "continue operating without a feature because it was deliberately turned off". The NULL should not be treated as a failure. If a driver cannot work when that feature is disabled then the KConfig should enforce that the function cannot return NULL. We should not need to test for it. In this driver, the bug means that probe cannot succeed when CONFIG_PM is disabled. Signed-off-by: Dan Carpenter Fixes: f08aa7c80dac ("usb: gadget: tegra-xudc: Fix error check in tegra_xudc_powerdomain_init()") Cc: stable Link: https://lore.kernel.org/r/ZKQoBa84U/ykEh3C@moroto Signed-off-by: Greg Kroah-Hartman commit 288b4fa1798e3637a9304c6e90a93d900e02369c Author: Dan Carpenter Date: Tue Jul 4 17:08:27 2023 +0300 Revert "usb: xhci: tegra: Fix error check" This reverts commit 18fc7c435be3f17ea26a21b2e2312fcb9088e01f. The reverted commit was based on static analysis and a misunderstanding of how PTR_ERR() and NULLs are supposed to work. When a function returns both pointer errors and NULL then normally the NULL means "continue operating without a feature because it was deliberately turned off". The NULL should not be treated as a failure. If a driver cannot work when that feature is disabled then the KConfig should enforce that the function cannot return NULL. We should not need to test for it. In this code, the patch means that certain tegra_xusb_probe() will fail if the firmware supports power-domains but CONFIG_PM is disabled. Signed-off-by: Dan Carpenter Fixes: 18fc7c435be3 ("usb: xhci: tegra: Fix error check") Cc: stable Link: https://lore.kernel.org/r/8baace8d-fb4b-41a4-ad5f-848ae643a23b@moroto.mountain Signed-off-by: Greg Kroah-Hartman commit 83e30f2bf86ef7c38fbd476ed81a88522b620628 Author: Zqiang Date: Fri Jul 14 15:40:11 2023 +0800 USB: gadget: Fix the memory leak in raw_gadget driver Currently, increasing raw_dev->count happens before invoke the raw_queue_event(), if the raw_queue_event() return error, invoke raw_release() will not trigger the dev_free() to be called. [ 268.905865][ T5067] raw-gadget.0 gadget.0: failed to queue event [ 268.912053][ T5067] udc dummy_udc.0: failed to start USB Raw Gadget: -12 [ 268.918885][ T5067] raw-gadget.0: probe of gadget.0 failed with error -12 [ 268.925956][ T5067] UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy [ 268.934657][ T5067] misc raw-gadget: fail, usb_gadget_register_driver returned -16 BUG: memory leak [] kmalloc_trace+0x24/0x90 mm/slab_common.c:1076 [] kmalloc include/linux/slab.h:582 [inline] [] kzalloc include/linux/slab.h:703 [inline] [] dev_new drivers/usb/gadget/legacy/raw_gadget.c:191 [inline] [] raw_open+0x45/0x110 drivers/usb/gadget/legacy/raw_gadget.c:385 [] misc_open+0x1a9/0x1f0 drivers/char/misc.c:165 [] kmalloc_trace+0x24/0x90 mm/slab_common.c:1076 [] kmalloc include/linux/slab.h:582 [inline] [] raw_ioctl_init+0xdf/0x410 drivers/usb/gadget/legacy/raw_gadget.c:460 [] raw_ioctl+0x5f9/0x1120 drivers/usb/gadget/legacy/raw_gadget.c:1250 [] vfs_ioctl fs/ioctl.c:51 [inline] [] kmalloc_trace+0x24/0x90 mm/slab_common.c:1076 [] kmalloc include/linux/slab.h:582 [inline] [] kzalloc include/linux/slab.h:703 [inline] [] dummy_alloc_request+0x5a/0xe0 drivers/usb/gadget/udc/dummy_hcd.c:665 [] usb_ep_alloc_request+0x22/0xd0 drivers/usb/gadget/udc/core.c:196 [] gadget_bind+0x6d/0x370 drivers/usb/gadget/legacy/raw_gadget.c:292 This commit therefore invoke kref_get() under the condition that raw_queue_event() return success. Reported-by: syzbot+feb045d335c1fdde5bf7@syzkaller.appspotmail.com Cc: stable Closes: https://syzkaller.appspot.com/bug?extid=feb045d335c1fdde5bf7 Signed-off-by: Zqiang Reviewed-by: Andrey Konovalov Tested-by: Andrey Konovalov Link: https://lore.kernel.org/r/20230714074011.20989-1-qiang.zhang1211@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6237390644fb92b81f5262877fe545d0d2c7b5d7 Author: Michael Grzeschik Date: Sat Jul 22 00:22:56 2023 +0200 usb: gadget: core: remove unbalanced mutex_unlock in usb_gadget_activate Commit 286d9975a838 ("usb: gadget: udc: core: Prevent soft_connect_store() race") introduced one extra mutex_unlock of connect_lock in the usb_gadget_active function. Fixes: 286d9975a838 ("usb: gadget: udc: core: Prevent soft_connect_store() race") Cc: stable Signed-off-by: Michael Grzeschik Reviewed-by: Alan Stern Link: https://lore.kernel.org/r/20230721222256.1743645-1-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 734ae15ab95a18d3d425fc9cb38b7a627d786f08 Author: Jakub Vanek Date: Fri Jul 14 14:24:19 2023 +0200 Revert "usb: dwc3: core: Enable AutoRetry feature in the controller" This reverts commit b138e23d3dff90c0494925b4c1874227b81bddf7. AutoRetry has been found to sometimes cause controller freezes when communicating with buggy USB devices. This controller feature allows the controller in host mode to send non-terminating/burst retry ACKs instead of terminating retry ACKs to devices when a transaction error (CRC error or overflow) occurs. Unfortunately, if the USB device continues to respond with a CRC error, the controller will not complete endpoint-related commands while it keeps trying to auto-retry. [3] The xHCI driver will notice this once it tries to abort the transfer using a Stop Endpoint command and does not receive a completion in time. [1] This situation is reported to dmesg: [sda] tag#29 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN [sda] tag#29 CDB: opcode=0x28 28 00 00 69 42 80 00 00 48 00 xhci-hcd: xHCI host not responding to stop endpoint command xhci-hcd: xHCI host controller not responding, assume dead xhci-hcd: HC died; cleaning up Some users observed this problem on an Odroid HC2 with the JMS578 USB3-to-SATA bridge. The issue can be triggered by starting a read-heavy workload on an attached SSD. After a while, the host controller would die and the SSD would disappear from the system. [1] Further analysis by Synopsys determined that controller revisions other than the one in Odroid HC2 are also affected by this. The recommended solution was to disable AutoRetry altogether. This change does not have a noticeable performance impact. [2] Revert the enablement commit. This will keep the AutoRetry bit in the default state configured during SoC design [2]. Fixes: b138e23d3dff ("usb: dwc3: core: Enable AutoRetry feature in the controller") Link: https://lore.kernel.org/r/a21f34c04632d250cd0a78c7c6f4a1c9c7a43142.camel@gmail.com/ [1] Link: https://lore.kernel.org/r/20230711214834.kyr6ulync32d4ktk@synopsys.com/ [2] Link: https://lore.kernel.org/r/20230712225518.2smu7wse6djc7l5o@synopsys.com/ [3] Cc: stable@vger.kernel.org Cc: Mauro Ribeiro Cc: Krzysztof Kozlowski Suggested-by: Thinh Nguyen Signed-off-by: Jakub Vanek Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230714122419.27741-1-linuxtardis@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5bef4b3cb95a5b883dfec8b3ffc0d671323d55bb Author: Oliver Neukum Date: Thu Jul 13 13:28:10 2023 +0200 Revert "xhci: add quirk for host controllers that don't update endpoint DCS" This reverts commit 5255660b208aebfdb71d574f3952cf48392f4306. This quirk breaks at least the following hardware: 0b:00.0 0c03: 1106:3483 (rev 01) (prog-if 30 [XHCI]) Subsystem: 1106:3483 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Fixes: 5255660b208a ("xhci: add quirk for host controllers that don't update endpoint DCS") Cc: stable Link: https://lore.kernel.org/r/20230713112830.21773-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman commit 9dc162e22387080e2d06de708b89920c0e158c9a Author: Łukasz Bartosik Date: Mon Jul 24 13:29:11 2023 +0200 USB: quirks: add quirk for Focusrite Scarlett The Focusrite Scarlett audio device does not behave correctly during resumes. Below is what happens during every resume (captured with Beagle 5000): // The Scarlett disconnects and is enumerated again. However from time to time it drops completely off the USB bus during resume. Below is captured occurrence of such an event: // // To fix the condition a user has to unplug and plug the device again. With USB_QUIRK_RESET_RESUME applied ("usbcore.quirks=1235:8211:b") for the Scarlett audio device the issue still reproduces. Applying USB_QUIRK_DISCONNECT_SUSPEND ("usbcore.quirks=1235:8211:m") fixed the issue and the Scarlett audio device didn't drop off the USB bus for ~5000 suspend/resume cycles where originally issue reproduced in ~100 or less suspend/resume cycles. Signed-off-by: Łukasz Bartosik Cc: stable Link: https://lore.kernel.org/r/20230724112911.1802577-1-lb@semihalf.com Signed-off-by: Greg Kroah-Hartman commit 9fd10829a9eb482e192a845675ecc5480e0bfa10 Author: Ricardo Ribalda Date: Wed Jul 19 13:01:04 2023 +0000 usb: xhci-mtk: set the dma max_seg_size Allow devices to have dma operations beyond 64K, and avoid warnings such as: DMA-API: xhci-mtk 11200000.usb: mapping sg segment longer than device claims to support [len=98304] [max=65536] Fixes: 0cbd4b34cda9 ("xhci: mediatek: support MTK xHCI host controller") Cc: stable Tested-by: Zubin Mithra Reported-by: Zubin Mithra Signed-off-by: Ricardo Ribalda Link: https://lore.kernel.org/r/20230628-mtk-usb-v2-1-c8c34eb9f229@chromium.org Signed-off-by: Greg Kroah-Hartman commit 57111552a5284533282199ba20d0e264f4ed28bc Author: Roger Quadros Date: Wed Jul 12 15:28:28 2023 +0300 MAINTAINERS: drop invalid usb/cdns3 Reviewer e-mail Alternate working e-mail of this Reviewer not available so drop it do prevent unnecessary bounce backs. Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20230712122828.17793-1-rogerq@kernel.org Signed-off-by: Greg Kroah-Hartman commit e835c0a4e23c38531dcee5ef77e8d1cf462658c7 Author: Jisheng Zhang Date: Wed Jun 28 00:20:18 2023 +0800 usb: dwc3: don't reset device side if dwc3 was configured as host-only Commit c4a5153e87fd ("usb: dwc3: core: Power-off core/PHYs on system_suspend in host mode") replaces check for HOST only dr_mode with current_dr_role. But during booting, the current_dr_role isn't initialized, thus the device side reset is always issued even if dwc3 was configured as host-only. What's more, on some platforms with host only dwc3, aways issuing device side reset by accessing device register block can cause kernel panic. Fixes: c4a5153e87fd ("usb: dwc3: core: Power-off core/PHYs on system_suspend in host mode") Cc: stable Signed-off-by: Jisheng Zhang Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230627162018.739-1-jszhang@kernel.org Signed-off-by: Greg Kroah-Hartman commit 71c47ad8920ef19d6545202191252a50c03aca30 Author: Neil Armstrong Date: Mon Jun 26 18:52:00 2023 +0200 usb: typec: ucsi: move typec_set_mode(TYPEC_STATE_SAFE) to ucsi_unregister_partner() It's better to set TYPEC_STATE_SAFE mode from ucsi_unregister_partner() instead of ucsi_partner_change(), ucsi_unregister_partner() is always when the partner disconnects. Fixes: 25a2bc21c863 ("usb: typec: ucsi: call typec_set_mode on non-altmode partner change") Suggested-by: Heikki Krogerus Signed-off-by: Neil Armstrong Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230626-topic-sm8550-usb-c-audio-fixup-v1-1-bc72fddf3f42@linaro.org Signed-off-by: Greg Kroah-Hartman commit c55afcbeaa7a6f4fffdbc999a9bf3f0b29a5186f Author: Guiting Shen Date: Mon Jun 26 23:27:13 2023 +0800 usb: ohci-at91: Fix the unhandle interrupt when resume The ohci_hcd_at91_drv_suspend() sets ohci->rh_state to OHCI_RH_HALTED when suspend which will let the ohci_irq() skip the interrupt after resume. And nobody to handle this interrupt. According to the comment in ohci_hcd_at91_drv_suspend(), it need to reset when resume from suspend(MEM) to fix by setting "hibernated" argument of ohci_resume(). Signed-off-by: Guiting Shen Cc: stable Reviewed-by: Alan Stern Link: https://lore.kernel.org/r/20230626152713.18950-1-aarongt.shen@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0d8f7cc8057890db08c54fe610d8a94af59da082 Author: Stefano Stabellini Date: Fri Jul 21 16:13:03 2023 -0700 xenbus: check xen_domain in xenbus_probe_initcall The same way we already do in xenbus_init. Fixes the following warning: [ 352.175563] Trying to free already-free IRQ 0 [ 352.177355] WARNING: CPU: 1 PID: 88 at kernel/irq/manage.c:1893 free_irq+0xbf/0x350 [...] [ 352.213951] Call Trace: [ 352.214390] [ 352.214717] ? __warn+0x81/0x170 [ 352.215436] ? free_irq+0xbf/0x350 [ 352.215906] ? report_bug+0x10b/0x200 [ 352.216408] ? prb_read_valid+0x17/0x20 [ 352.216926] ? handle_bug+0x44/0x80 [ 352.217409] ? exc_invalid_op+0x13/0x60 [ 352.217932] ? asm_exc_invalid_op+0x16/0x20 [ 352.218497] ? free_irq+0xbf/0x350 [ 352.218979] ? __pfx_xenbus_probe_thread+0x10/0x10 [ 352.219600] xenbus_probe+0x7a/0x80 [ 352.221030] xenbus_probe_thread+0x76/0xc0 Fixes: 5b3353949e89 ("xen: add support for initializing xenstore later as HVM domain") Signed-off-by: Stefano Stabellini Tested-by: Petr Mladek Reviewed-by: Oleksandr Tyshchenko Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2307211609140.3118466@ubuntu-linux-20-04-desktop Signed-off-by: Juergen Gross commit 13e098b58b8ff6d17f98f459dcc23ff064818e80 Merge: 6eaae19807608 d245aedc00775 Author: Greg Kroah-Hartman Date: Tue Jul 25 17:07:44 2023 +0200 Merge tag 'usb-serial-6.5-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial device ids for 6.5-rc4 Here are some new modem device ids and a new "simple" driver for a CAN bus device. Included is also a patch sorting the "simple" driver entries in order to make it more obvious where new ones should be added. All have been in linux-next with no reported issues. * tag 'usb-serial-6.5-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: simple: sort driver entries USB: serial: simple: add Kaufmann RKS+CAN VCP USB: serial: option: add Quectel EC200A module support USB: serial: option: support Quectel EM060K_128 commit 0bd66784274a287beada2933c2c0fa3a0ddae0d7 Author: Patrick Rudolph Date: Tue Jul 25 14:54:26 2023 +0200 hwmon: (pmbus_core) Fix NULL pointer dereference Pass i2c_client to _pmbus_is_enabled to drop the assumption that a regulator device is passed in. This will fix the issue of a NULL pointer dereference when called from _pmbus_get_flags. Fixes: df5f6b6af01c ("hwmon: (pmbus/core) Generalise pmbus get status") Cc: stable@vger.kernel.org # v6.4 Signed-off-by: Patrick Rudolph Signed-off-by: Naresh Solanki Link: https://lore.kernel.org/r/20230725125428.3966803-2-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck commit 55aab08f1856894d7d47d0ee23abbb4bc4854345 Author: Patrick Rudolph Date: Tue Jul 25 14:54:25 2023 +0200 hwmon: (pmbus_core) Fix pmbus_is_enabled() Refactor pmbus_is_enabled() to return the status without any additional processing as it is already done in _pmbus_is_enabled(). Fixes: df5f6b6af01c ("hwmon: (pmbus/core) Generalise pmbus get status") Cc: stable@vger.kernel.org # v6.4 Signed-off-by: Patrick Rudolph Signed-off-by: Naresh Solanki Link: https://lore.kernel.org/r/20230725125428.3966803-1-Naresh.Solanki@9elements.com [groeck: Rephrased commit message] Signed-off-by: Guenter Roeck commit c21733754cd6ecbca346f2adf9b17d4cfa50504f Author: Konstantin Shelekhin Date: Sat Jul 22 18:59:20 2023 +0300 platform/x86: huawei-wmi: Silence ambient light sensor Currently huawei-wmi causes a lot of spam in dmesg on my Huawei MateBook X Pro 2022: ... [36409.328463] input input9: Unknown key pressed, code: 0x02c1 [36411.335104] input input9: Unknown key pressed, code: 0x02c1 [36412.338674] input input9: Unknown key pressed, code: 0x02c1 [36414.848564] input input9: Unknown key pressed, code: 0x02c1 [36416.858706] input input9: Unknown key pressed, code: 0x02c1 ... Fix that by ignoring events generated by ambient light sensor. This issue was reported on GitHub and resolved with the following merge request: https://github.com/aymanbagabas/Huawei-WMI/pull/70 I've contacted the mainter of this repo and he gave me the "go ahead" to send this patch to the maling list. Signed-off-by: Konstantin Shelekhin Link: https://lore.kernel.org/r/20230722155922.173856-1-k.shelekhin@ftml.net Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit ad084a6d99bc182bf109c190c808e2ea073ec57b Author: Maxim Mikityanskiy Date: Fri Jul 21 17:54:23 2023 +0300 platform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100 Only the HW rfkill state is toggled on laptops with quirks->ec_read_only (so far only MSI Wind U90/U100). There are, however, a few issues with the implementation: 1. The initial HW state is always unblocked, regardless of the actual state on boot, because msi_init_rfkill only sets the SW state, regardless of ec_read_only. 2. The initial SW state corresponds to the actual state on boot, but it can't be changed afterwards, because set_device_state returns -EOPNOTSUPP. It confuses the userspace, making Wi-Fi and/or Bluetooth unusable if it was blocked on boot, and breaking the airplane mode if the rfkill was unblocked on boot. Address the above issues by properly initializing the HW state on ec_read_only laptops and by allowing the userspace to toggle the SW state. Don't set the SW state ourselves and let the userspace fully control it. Toggling the SW state is a no-op, however, it allows the userspace to properly toggle the airplane mode. The actual SW radio disablement is handled by the corresponding rtl818x_pci and btusb drivers that have their own rfkills. Tested on MSI Wind U100 Plus, BIOS ver 1.0G, EC ver 130. Fixes: 0816392b97d4 ("msi-laptop: merge quirk tables to one") Fixes: 0de6575ad0a8 ("msi-laptop: Add MSI Wind U90/U100 support") Signed-off-by: Maxim Mikityanskiy Link: https://lore.kernel.org/r/20230721145423.161057-1-maxtram95@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 6a758a3e831ce1a84c9c209ac6dc755f4c8ce77a Author: Kristian Angelov Date: Thu Jul 20 18:29:50 2023 +0300 platform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops This patch fixes setting the cmd values to 0xb3 and 0xb4. This is necessary on some TUF laptops in order to set the RGB mode. Closes: https://lore.kernel.org/platform-driver-x86/443078148.491022.1677576298133@nm83.abv.bg Signed-off-by: Kristian Angelov Reviewed-by: Luke D. Jones Link: https://lore.kernel.org/r/ZLlS7o6UdTUBkyqa@wyvern.localdomain Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 1da0893aed2e48e2bdf37c29b029f2e060d25927 Author: Wang Ming Date: Mon Jul 17 18:11:02 2023 +0800 platform/x86: think-lmi: Use kfree_sensitive instead of kfree key might contain private part of the key, so better use kfree_sensitive to free it. Signed-off-by: Wang Ming Link: https://lore.kernel.org/r/20230717101114.18966-1-machel@vivo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 7783e97f8558ad7a4d1748922461bc88483fbcdf Author: Maxim Mikityanskiy Date: Sun Jul 16 21:32:13 2023 +0300 platform/x86/intel/hid: Add HP Dragonfly G2 to VGBS DMI quirks HP Elite Dragonfly G2 (a convertible laptop/tablet) has a reliable VGBS method. If VGBS is not called on boot, the firmware sends an initial 0xcd event shortly after calling the BTNL method, but only if the device is booted in the laptop mode. However, if the device is booted in the tablet mode and VGBS is not called, there is no initial 0xcc event, and the input device for SW_TABLET_MODE is not registered up until the user turns the device into the laptop mode. Call VGBS on boot on this device to get the initial state of SW_TABLET_MODE in a reliable way. Tested with BIOS 1.13.1. Signed-off-by: Maxim Mikityanskiy Link: https://lore.kernel.org/r/20230716183213.64173-1-maxtram95@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit e3ab18de2b09361d6f0e4aafb9cfd6d002ce43a1 Author: Hans de Goede Date: Sat Jul 15 20:15:16 2023 +0200 platform/x86: intel: hid: Always call BTNL ACPI method On a HP Elite Dragonfly G2 the 0xcc and 0xcd events for SW_TABLET_MODE are only send after the BTNL ACPI method has been called. Likely more devices need this, so make the BTNL ACPI method unconditional instead of only doing it on devices with a 5 button array. Note this also makes the intel_button_array_enable() call in probe() unconditional, that function does its own priv->array check. This makes the intel_button_array_enable() call in probe() consistent with the calls done on suspend/resume which also rely on the priv->array check inside the function. Reported-by: Maxim Mikityanskiy Closes: https://lore.kernel.org/platform-driver-x86/20230712175023.31651-1-maxtram95@gmail.com/ Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230715181516.5173-1-hdegoede@redhat.com commit 33c9ab5b493a0e922b06c12fed4fdcb862212cda Author: Shyam Sundar S K Date: Fri Jul 14 20:14:35 2023 +0530 platform/x86/amd/pmf: Notify OS power slider update APMF fn8 can notify EC about the OS slider position change. Add this capability to the PMF driver so that it can call the APMF fn8 based on the changes in the Platform profile events. Co-developed-by: Mario Limonciello Signed-off-by: Mario Limonciello Signed-off-by: Patil Rajesh Reddy Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20230714144435.1239776-2-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 839e90e75e695b3d9ee17f5a2811e7ee5aea8d4a Author: Shyam Sundar S K Date: Fri Jul 14 20:14:34 2023 +0530 platform/x86/amd/pmf: reduce verbosity of apmf_get_system_params apmf_get_system_params() failure is not a critical event, reduce its verbosity from dev_err to dev_dbg. Signed-off-by: Mario Limonciello Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20230714144435.1239776-1-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 3da435063777f8d861ba5a165344e3f75f839357 Author: Takashi Iwai Date: Tue Jul 25 11:20:57 2023 +0200 ALSA: usb-audio: Add quirk for Microsoft Modern Wireless Headset Microsoft Modern Wireless Headset (appearing on the host as "Microsoft USB Link") has a playback and a capture mixer volume/switch, but they are fairly broken. The descriptor reports wrong dB ranges for playback, and the capture volume/switch don't influence on the actual recording at all. Moreover, there seem instabilities in the connection, and at best, we should disable the runtime PM. So this ended up with a quirk entry for: - Correct the playback dB range; I picked up some reasonable values but it's a guess work - Disable the capture mixer; it's completely useless and confuses PA/PW - Suppress get-sample-rate, apply the delay for message handling, and suppress the auto-suspend The behavior of the wheel control on the headset is somehow flaky, too, but it's an issue of HID. Link: https://bugzilla.suse.com/show_bug.cgi?id=1207129 Link: https://lore.kernel.org/r/20230725092057.15115-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit d510acb610e6aa07a04b688236868b2a5fd60deb Author: Luka Guzenko Date: Tue Jul 25 13:15:09 2023 +0200 ALSA: hda/relatek: Enable Mute LED on HP 250 G8 This HP Notebook used ALC236 codec with COEF 0x07 idx 1 controlling the mute LED. Enable already existing quirk for this device. Signed-off-by: Luka Guzenko Cc: Link: https://lore.kernel.org/r/20230725111509.623773-1-l.guzenko@web.de Signed-off-by: Takashi Iwai commit f85739c0b2b0d98a32f5ca4fcc5501d2b76df4f6 Author: Guiting Shen Date: Sat Jul 15 11:06:20 2023 +0800 ASoC: atmel: Fix the 8K sample parameter in I2SC master The 8K sample parameter of 12.288Mhz main system bus clock doesn't work because the I2SC_MR.IMCKDIV must not be 0 according to the sama5d2 series datasheet(I2SC Mode Register of Register Summary). So use the 6.144Mhz instead of 12.288Mhz to support 8K sample. Signed-off-by: Guiting Shen Link: https://lore.kernel.org/r/20230715030620.62328-1-aarongt.shen@gmail.com Signed-off-by: Mark Brown commit 23adeb7056acd4fd866969f4afb91441776cc4f5 Author: Shuming Fan Date: Fri Jul 21 17:07:11 2023 +0800 ASoC: rt711-sdca: fix for JD event handling in ClockStop Mode0 When the system suspends, peripheral SDCA interrupts are disabled. When system level resume is invoked, the peripheral SDCA interrupts should be enabled to handle JD events. Enable SDCA interrupts in resume sequence when ClockStop Mode0 is applied. Signed-off-by: Shuming Fan Reported-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230721090711.128247-1-shumingf@realtek.com Signed-off-by: Mark Brown commit b69de265bd0e877015a00fbba453ef72af162e0f Author: Shuming Fan Date: Fri Jul 21 17:06:54 2023 +0800 ASoC: rt711: fix for JD event handling in ClockStop Mode0 When the system suspends, peripheral Imp-defined interrupt is disabled. When system level resume is invoked, the peripheral Imp-defined interrupts should be enabled to handle JD events. Signed-off-by: Shuming Fan Reported-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230721090654.128230-1-shumingf@realtek.com Signed-off-by: Mark Brown commit a0b7c59ac1a9bae015a9b90dfda28158586006c8 Author: Shuming Fan Date: Fri Jul 21 17:07:32 2023 +0800 ASoC: rt722-sdca: fix for JD event handling in ClockStop Mode0 When the system suspends, peripheral SDCA interrupts are disabled. When system level resume is invoked, the peripheral SDCA interrupts should be enabled to handle JD events. Enable SDCA interrupts in resume sequence when ClockStop Mode0 is applied. Signed-off-by: Shuming Fan Reported-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230721090732.128282-1-shumingf@realtek.com Signed-off-by: Mark Brown commit 7a8735c1551e489351172d0da96128f6f8b52b2d Author: Shuming Fan Date: Fri Jul 21 17:07:21 2023 +0800 ASoC: rt712-sdca: fix for JD event handling in ClockStop Mode0 When the system suspends, peripheral SDCA interrupts are disabled. When system level resume is invoked, the peripheral SDCA interrupts should be enabled to handle JD events. Enable SDCA interrupts in resume sequence when ClockStop Mode0 is applied. Signed-off-by: Shuming Fan Reported-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230721090721.128264-1-shumingf@realtek.com Signed-off-by: Mark Brown commit d20d35d1ad62c6cca36368c1e8f29335a068659e Author: Edgar Date: Wed Jul 19 13:47:22 2023 +0800 ASoc: codecs: ES8316: Fix DMIC config According to the datasheet, the DMIC config should be changed to { 0, 2 ,3 } Signed-off-by: Edgar Link: https://lore.kernel.org/r/20230719054722.401954-1-ljijcj@163.com Signed-off-by: Mark Brown commit 02fb23d72720df2b6be3f29fc5787ca018eb92c3 Author: Shuming Fan Date: Fri Jul 21 17:06:43 2023 +0800 ASoC: rt5682-sdw: fix for JD event handling in ClockStop Mode0 When the system suspends, peripheral Imp-defined interrupt is disabled. When system level resume is invoked, the peripheral Imp-defined interrupts should be enabled to handle JD events. Signed-off-by: Shuming Fan Reported-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230721090643.128213-1-shumingf@realtek.com Signed-off-by: Mark Brown commit 4c188fa183ebb45238ef16504c4c7606955cf9d4 Author: Biju Das Date: Mon Jul 24 10:19:25 2023 +0100 arm64: dts: renesas: rzg2l: Update overfow/underflow IRQ names for MTU3 channels As per R01UH0914EJ0130 Rev.1.30 HW manual the MTU3 overflow/underflow interrupt names start with 'tci' instead of 'tgi'. Replace the below overflow/underflow interrupt names: - tgiv0->tciv0 - tgiv1->tciv1 - tgiu1->tciu1 - tgiv2->tciv2 - tgiu2->tciu2 - tgiv3->tciv3 - tgiv4->tciv4 - tgiv6->tciv6 - tgiv7->tciv7 - tgiv8->tciv8 - tgiu8->tciu8 Fixes: 26336d66d021 ("arm64: dts: renesas: r9a07g044: Add MTU3a node") Fixes: dd123dd01def ("arm64: dts: renesas: r9a07g054: Add MTU3a node") Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230724091927.123847-5-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 284779dbf4e98753458708783af8c35630674a21 Author: Vincent Whitchurch Date: Fri Jul 21 15:39:20 2023 +0200 net: stmmac: Apply redundant write work around on 4.xx too commit a3a57bf07de23fe1ff779e0fdf710aa581c3ff73 ("net: stmmac: work around sporadic tx issue on link-up") worked around a problem with TX sometimes not working after a link-up by avoiding a redundant write to MAC_CTRL_REG (aka GMAC_CONFIG), since the IP appeared to have problems with handling multiple writes to that register in some cases. That commit however only added the work around to dwmac_lib.c (apart from the common code in stmmac_main.c), but my systems with version 4.21a of the IP exhibit the same problem, so add the work around to dwmac4_lib.c too. Fixes: a3a57bf07de2 ("net: stmmac: work around sporadic tx issue on link-up") Signed-off-by: Vincent Whitchurch Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230721-stmmac-tx-workaround-v1-1-9411cbd5ee07@axis.com Signed-off-by: Paolo Abeni commit 4e62c99d71e56817c934caa2a709a775c8cee078 Author: Suman Ghosh Date: Fri Jul 21 11:42:22 2023 +0530 octeontx2-af: Fix hash extraction enable configuration As of today, hash extraction support is enabled for all the silicons. Because of which we are facing initialization issues when the silicon does not support hash extraction. During creation of the hardware parsing table for IPv6 address, we need to consider if hash extraction is enabled then extract only 32 bit, otherwise 128 bit needs to be extracted. This patch fixes the issue and configures the hardware parser based on the availability of the feature. Fixes: a95ab93550d3 ("octeontx2-af: Use hashed field in MCAM key") Signed-off-by: Suman Ghosh Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230721061222.2632521-1-sumang@marvell.com Signed-off-by: Paolo Abeni commit e354f67733115b4453268f61e6e072e9b1ea7a2f Author: Christophe JAILLET Date: Mon Jul 17 20:49:31 2023 +0200 drm/i915: Fix an error handling path in igt_write_huge() All error handling paths go to 'out', except this one. Be consistent and also branch to 'out' here. Fixes: c10a652e239e ("drm/i915/selftests: Rework context handling in hugepages selftests") Signed-off-by: Christophe JAILLET Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/7a036b88671312ee9adc01c74ef5b3376f690b76.1689619758.git.christophe.jaillet@wanadoo.fr (cherry picked from commit 361ecaadb1ce3c5312c7c4c419271326d43899eb) Signed-off-by: Tvrtko Ursulin commit 3844ed5e78823eebb5f0f1edefc403310693d402 Author: Radhakrishna Sripada Date: Tue Jul 18 15:51:18 2023 -0700 drm/i915/dpt: Use shmem for dpt objects Dpt objects that are created from internal get evicted when there is memory pressure and do not get restored when pinned during scanout. The pinned page table entries look corrupted and programming the display engine with the incorrect pte's result in DE throwing pipe faults. Create DPT objects from shmem and mark the object as dirty when pinning so that the object is restored when shrinker evicts an unpinned buffer object. v2: Unconditionally mark the dpt objects dirty during pinning(Chris). Fixes: 0dc987b699ce ("drm/i915/display: Add smem fallback allocation for dpt") Cc: # v6.0+ Cc: Ville Syrjälä Cc: Tvrtko Ursulin Suggested-by: Chris Wilson Signed-off-by: Fei Yang Signed-off-by: Radhakrishna Sripada Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20230718225118.2562132-1-radhakrishna.sripada@intel.com (cherry picked from commit e91a777a6e602ba0e3366e053e4e094a334a1244) Signed-off-by: Tvrtko Ursulin commit 34192a2f46b99324877ef24a6f8f56b1a6b533de Merge: f0291103d2327 fa532bee17d15 Author: Paolo Abeni Date: Tue Jul 25 09:32:29 2023 +0200 Merge branch 'fix-up-dev-flags-when-add-p2p-down-link' Hangbin Liu says: ==================== Fix up dev flags when add P2P down link When adding p2p interfaces to bond/team. The POINTOPOINT, NOARP flags are not inherit to up devices. Which will trigger IPv6 DAD. Since there is no ethernet MAC address for P2P devices. This will cause unexpected DAD failures. ==================== Link: https://lore.kernel.org/r/20230721040356.3591174-1-liuhangbin@gmail.com Signed-off-by: Paolo Abeni commit fa532bee17d15acf8bba4bc8e2062b7a093ba801 Author: Hangbin Liu Date: Fri Jul 21 12:03:56 2023 +0800 team: reset team's flags when down link is P2P device When adding a point to point downlink to team device, we neglected to reset the team's flags, which were still using flags like BROADCAST and MULTICAST. Consequently, this would initiate ARP/DAD for P2P downlink interfaces, such as when adding a GRE device to team device. Fix this by remove multicast/broadcast flags and add p2p and noarp flags. After removing the none ethernet interface and adding an ethernet interface to team, we need to reset team interface flags. Unlike bonding interface, team do not need restore IFF_MASTER, IFF_SLAVE flags. Reported-by: Liang Li Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2221438 Fixes: 1d76efe1577b ("team: add support for non-ethernet devices") Signed-off-by: Hangbin Liu Signed-off-by: Paolo Abeni commit da19a2b967cf1e2c426f50d28550d1915214a81d Author: Hangbin Liu Date: Fri Jul 21 12:03:55 2023 +0800 bonding: reset bond's flags when down link is P2P device When adding a point to point downlink to the bond, we neglected to reset the bond's flags, which were still using flags like BROADCAST and MULTICAST. Consequently, this would initiate ARP/DAD for P2P downlink interfaces, such as when adding a GRE device to the bonding. To address this issue, let's reset the bond's flags for P2P interfaces. Before fix: 7: gre0@NONE: mtu 1500 qdisc noqueue master bond0 state UNKNOWN group default qlen 1000 link/gre6 2006:70:10::1 peer 2006:70:10::2 permaddr 167f:18:f188:: 8: bond0: mtu 1500 qdisc noqueue state UP group default qlen 1000 link/gre6 2006:70:10::1 brd 2006:70:10::2 inet6 fe80::200:ff:fe00:0/64 scope link valid_lft forever preferred_lft forever After fix: 7: gre0@NONE: mtu 1500 qdisc noqueue master bond2 state UNKNOWN group default qlen 1000 link/gre6 2006:70:10::1 peer 2006:70:10::2 permaddr c29e:557a:e9d9:: 8: bond0: mtu 1500 qdisc noqueue state UP group default qlen 1000 link/gre6 2006:70:10::1 peer 2006:70:10::2 inet6 fe80::1/64 scope link valid_lft forever preferred_lft forever Reported-by: Liang Li Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2221438 Fixes: 872254dd6b1f ("net/bonding: Enable bonding to enslave non ARPHRD_ETHER") Signed-off-by: Hangbin Liu Signed-off-by: Paolo Abeni commit 19826558210b9102a7d4681c91784d137d60d71b Author: Steve French Date: Tue Jul 25 01:05:23 2023 -0500 smb3: do not set NTLMSSP_VERSION flag for negotiate not auth request The NTLMSSP_NEGOTIATE_VERSION flag only needs to be sent during the NTLMSSP NEGOTIATE (not the AUTH) request, so filter it out for NTLMSSP AUTH requests. See MS-NLMP 2.2.1.3 This fixes a problem found by the gssntlmssp server. Link: https://github.com/gssapi/gss-ntlmssp/issues/95 Fixes: 52d005337b2c ("smb3: send NTLMSSP version information") Acked-by: Roy Shterman Signed-off-by: Steve French commit a43f95fdd39490f7b156fd126f1e90ec2d5553f1 Author: Winston Wen Date: Mon Jul 24 10:10:57 2023 +0800 cifs: fix charset issue in reconnection We need to specify charset, like "iocharset=utf-8", in mount options for Chinese path if the nls_default don't support it, such as iso8859-1, the default value for CONFIG_NLS_DEFAULT. But now in reconnection the nls_default is used, instead of the one we specified and used in mount, and this can lead to mount failure. Signed-off-by: Winston Wen Reviewed-by: Paulo Alcantara Signed-off-by: Steve French commit c1ed39ec116272935528ca9b348b8ee79b0791da Author: Winston Wen Date: Mon Jul 24 10:10:56 2023 +0800 fs/nls: make load_nls() take a const parameter load_nls() take a char * parameter, use it to find nls module in list or construct the module name to load it. This change make load_nls() take a const parameter, so we don't need do some cast like this: ses->local_nls = load_nls((char *)ctx->local_nls->charset); Suggested-by: Stephen Rothwell Signed-off-by: Winston Wen Reviewed-by: Paulo Alcantara Reviewed-by: Christian Brauner Signed-off-by: Steve French commit e0933b526fbfd937c4a8f4e35fcdd49f0e22d411 Author: Bart Van Assche Date: Thu Jul 6 13:14:12 2023 -0700 block: Fix a source code comment in include/uapi/linux/blkzoned.h Fix the symbolic names for zone conditions in the blkzoned.h header file. Cc: Hannes Reinecke Cc: Damien Le Moal Fixes: 6a0cb1bc106f ("block: Implement support for zoned block devices") Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230706201422.3987341-1-bvanassche@acm.org Signed-off-by: Jens Axboe commit f0291103d23276bc38d9b91f327e8dc3cecfdb0e Merge: ac2a7b1317615 91896c8acce23 Author: Jakub Kicinski Date: Mon Jul 24 17:12:06 2023 -0700 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-07-21 (i40e, iavf) This series contains updates to i40e and iavf drivers. Wang Ming corrects an error check on i40e. Jake unlocks crit_lock on allocation failure to prevent deadlock and stops re-enabling of interrupts when it's not intended for iavf. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: iavf: check for removal state before IAVF_FLAG_PF_COMMS_FAILED iavf: fix potential deadlock on allocation failure i40e: Fix an NULL vs IS_ERR() bug for debugfs_create_dir() ==================== Link: https://lore.kernel.org/r/20230721155812.1292752-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit ac2a7b13176157833baf5db0db20cfb370bd7779 Merge: a3336056504d7 11c9027c983e9 Author: Jakub Kicinski Date: Mon Jul 24 17:10:10 2023 -0700 Merge tag 'linux-can-fixes-for-6.5-20230724' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2023-07-24 The first patch is by me and adds a missing set of CAN state to CAN_STATE_STOPPED on close in the gs_usb driver. The last patch is by Eric Dumazet and fixes a lockdep issue in the CAN raw protocol. * tag 'linux-can-fixes-for-6.5-20230724' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: raw: fix lockdep issue in raw_release() can: gs_usb: gs_can_close(): add missing set of CAN state to CAN_STATE_STOPPED ==================== Link: https://lore.kernel.org/r/20230724150141.766047-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit a3336056504d780590ac6d6ac94fbba829994594 Author: Jedrzej Jagielski Date: Fri Jul 21 08:58:54 2023 -0700 ice: Fix memory management in ice_ethtool_fdir.c Fix ethtool FDIR logic to not use memory after its release. In the ice_ethtool_fdir.c file there are 2 spots where code can refer to pointers which may be missing. In the ice_cfg_fdir_xtrct_seq() function seg may be freed but even then may be still used by memcpy(&tun_seg[1], seg, sizeof(*seg)). In the ice_add_fdir_ethtool() function struct ice_fdir_fltr *input may first fail to be added via ice_fdir_update_list_entry() but then may be deleted by ice_fdir_update_list_entry. Terminate in both cases when the returned value of the previous operation is other than 0, free memory and don't use it anymore. Reported-by: Michal Schmidt Link: https://bugzilla.redhat.com/show_bug.cgi?id=2208423 Fixes: cac2a27cd9ab ("ice: Support IPv4 Flow Director filters") Reviewed-by: Przemek Kitszel Signed-off-by: Jedrzej Jagielski Reviewed-by: Leon Romanovsky Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20230721155854.1292805-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit d11b0df7ddf1831f3e170972f43186dad520bfcc Author: Stewart Smith Date: Fri Jul 21 15:24:10 2023 -0700 tcp: Reduce chance of collisions in inet6_hashfn(). For both IPv4 and IPv6 incoming TCP connections are tracked in a hash table with a hash over the source & destination addresses and ports. However, the IPv6 hash is insufficient and can lead to a high rate of collisions. The IPv6 hash used an XOR to fit everything into the 96 bits for the fast jenkins hash, meaning it is possible for an external entity to ensure the hash collides, thus falling back to a linear search in the bucket, which is slow. We take the approach of hash the full length of IPv6 address in __ipv6_addr_jhash() so that all users can benefit from a more secure version. While this may look like it adds overhead, the reality of modern CPUs means that this is unmeasurable in real world scenarios. In simulating with llvm-mca, the increase in cycles for the hashing code was ~16 cycles on Skylake (from a base of ~155), and an extra ~9 on Nehalem (base of ~173). In commit dd6d2910c5e0 ("netfilter: conntrack: switch to siphash") netfilter switched from a jenkins hash to a siphash, but even the faster hsiphash is a more significant overhead (~20-30%) in some preliminary testing. So, in this patch, we keep to the more conservative approach to ensure we don't add much overhead per SYN. In testing, this results in a consistently even spread across the connection buckets. In both testing and real-world scenarios, we have not found any measurable performance impact. Fixes: 08dcdbf6a7b9 ("ipv6: use a stronger hash for tcp") Signed-off-by: Stewart Smith Signed-off-by: Samuel Mendoza-Jonas Suggested-by: Eric Dumazet Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20230721222410.17914-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit bb7a0156365dffe2fcd63e2051145fbe4f8908b4 Author: Wei Fang Date: Fri Jul 21 16:35:59 2023 +0800 net: fec: avoid tx queue timeout when XDP is enabled According to the implementation of XDP of FEC driver, the XDP path shares the transmit queues with the kernel network stack, so it is possible to lead to a tx timeout event when XDP uses the tx queue pretty much exclusively. And this event will cause the reset of the FEC hardware. To avoid timeout in this case, we use the txq_trans_cond_update() interface to update txq->trans_start to jiffies so that watchdog won't generate a transmit timeout warning. Fixes: 6d6b39f180b8 ("net: fec: add initial XDP support") Signed-off-by: Wei Fang Link: https://lore.kernel.org/r/20230721083559.2857312-1-wei.fang@nxp.com Signed-off-by: Jakub Kicinski commit 69172f0bcb6a09110c5d2a6d792627f5095a9018 Author: Maciej Żenczykowski Date: Thu Jul 20 09:00:22 2023 -0700 ipv6 addrconf: fix bug where deleting a mngtmpaddr can create a new temporary address currently on 6.4 net/main: # ip link add dummy1 type dummy # echo 1 > /proc/sys/net/ipv6/conf/dummy1/use_tempaddr # ip link set dummy1 up # ip -6 addr add 2000::1/64 mngtmpaddr dev dummy1 # ip -6 addr show dev dummy1 11: dummy1: mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000 inet6 2000::44f3:581c:8ca:3983/64 scope global temporary dynamic valid_lft 604800sec preferred_lft 86172sec inet6 2000::1/64 scope global mngtmpaddr valid_lft forever preferred_lft forever inet6 fe80::e8a8:a6ff:fed5:56d4/64 scope link valid_lft forever preferred_lft forever # ip -6 addr del 2000::44f3:581c:8ca:3983/64 dev dummy1 (can wait a few seconds if you want to, the above delete isn't [directly] the problem) # ip -6 addr show dev dummy1 11: dummy1: mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000 inet6 2000::1/64 scope global mngtmpaddr valid_lft forever preferred_lft forever inet6 fe80::e8a8:a6ff:fed5:56d4/64 scope link valid_lft forever preferred_lft forever # ip -6 addr del 2000::1/64 mngtmpaddr dev dummy1 # ip -6 addr show dev dummy1 11: dummy1: mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000 inet6 2000::81c9:56b7:f51a:b98f/64 scope global temporary dynamic valid_lft 604797sec preferred_lft 86169sec inet6 fe80::e8a8:a6ff:fed5:56d4/64 scope link valid_lft forever preferred_lft forever This patch prevents this new 'global temporary dynamic' address from being created by the deletion of the related (same subnet prefix) 'mngtmpaddr' (which is triggered by there already being no temporary addresses). Cc: Jiri Pirko Fixes: 53bd67491537 ("ipv6 addrconf: introduce IFA_F_MANAGETEMPADDR to tell kernel to manage temporary addresses") Reported-by: Xiao Ma Signed-off-by: Maciej Żenczykowski Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20230720160022.1887942-1-maze@google.com Signed-off-by: Jakub Kicinski commit 69a184f7a372aac588babfb0bd681aaed9779f5b Author: Yuanjun Gong Date: Thu Jul 20 22:42:19 2023 +0800 ethernet: atheros: fix return value check in atl1e_tso_csum() in atl1e_tso_csum, it should check the return value of pskb_trim(), and return an error code if an unexpected value is returned by pskb_trim(). Fixes: a6a5325239c2 ("atl1e: Atheros L1E Gigabit Ethernet driver") Signed-off-by: Yuanjun Gong Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230720144219.39285-1-ruc_gongyuanjun@163.com Signed-off-by: Jakub Kicinski commit ed96824b71ed67664390890441b229423a25317f Author: Yuanjun Gong Date: Sat Jul 22 22:25:11 2023 +0800 atheros: fix return value check in atl1_tso() in atl1_tso(), it should check the return value of pskb_trim(), and return an error code if an unexpected value is returned by pskb_trim(). Fixes: 401c0aabec4b ("atl1: simplify tx packet descriptor") Signed-off-by: Yuanjun Gong Link: https://lore.kernel.org/r/20230722142511.12448-1-ruc_gongyuanjun@163.com Signed-off-by: Jakub Kicinski commit 0b5547c51827e053cc754db47d3ec3e6c2c451d2 Merge: 20ea1e7d13c1b 80b6051085c5f Author: Linus Torvalds Date: Mon Jul 24 14:38:41 2023 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fix from James Bottomley: "A single fix for a potential regression over a misunderstanding of the blk_get_queue() api" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: sg: Fix checking return value of blk_get_queue() commit 341e0e9f59e26676c88d0aa9a5a9b2d3c44bf21c Author: Athira Rajeev Date: Mon Jul 24 22:28:15 2023 +0530 perf callchain powerpc: Fix addr location init during arch_skip_callchain_idx function 'perf record; with callchain recording fails as below in powerpc: ./perf record -a -gR sleep 10 ./perf report perf: Segmentation fault gdb trace points to thread__find_map 0 0x00000000101df314 in atomic_cmpxchg (newval=1818846826, oldval=1818846827, v=0x1001a8f3) at /home/athira/linux/tools/include/asm-generic/atomic-gcc.h:70 1 refcount_sub_and_test (i=1, r=0x1001a8f3) at /home/athira/linux/tools/include/linux/refcount.h:135 2 refcount_dec_and_test (r=0x1001a8f3) at /home/athira/linux/tools/include/linux/refcount.h:148 3 map__put (map=0x1001a8b3) at util/map.c:311 4 0x000000001016842c in __map__zput (map=0x7fffffffa368) at util/map.h:190 5 thread__find_map (thread=0x105b92f0, cpumode=, addr=13835058055283572736, al=al@entry=0x7fffffffa358) at util/event.c:582 6 0x000000001016882c in thread__find_symbol (thread=, cpumode=, addr=, al=0x7fffffffa358) at util/event.c:656 7 0x00000000102e12b4 in arch_skip_callchain_idx (thread=, chain=) at arch/powerpc/util/skip-callchain-idx.c:255 8 0x00000000101d3bf4 in thread__resolve_callchain_sample (thread=0x105b92f0, cursor=0x1053d160, evsel=, sample=0x7fffffffa908, parent=0x7fffffffa778, root_al=0x7fffffffa710, max_stack=) at util/machine.c:2940 9 0x00000000101cd210 in sample__resolve_callchain (sample=, cursor=, parent=, evsel=, al=, max_stack=) at util/callchain.c:1112 10 0x000000001022a9d8 in hist_entry_iter__add (iter=0x7fffffffa750, al=0x7fffffffa710, max_stack_depth=, arg=0x7fffffffbbd0) at util/hist.c:1232 11 0x0000000010056d98 in process_sample_event (tool=0x7fffffffbbd0, event=0x7ffff6223c38, sample=0x7fffffffa908, evsel=, machine=0x10524ef8) at builtin-report.c:332 Here arch_skip_callchain_idx calls thread__find_symbol and which invokes thread__find_map with uninitialised "addr_location". Snippet: thread__find_symbol(thread, PERF_RECORD_MISC_USER, ip, &al); Recent change with commit 0dd5041c9a0eaf8c ("perf addr_location: Add init/exit/copy functions") , introduced "maps__zput" in the function thread__find_map. This could result in segfault while accessing uninitialised map from "struct addr_location". Fix this by adding addr_location__init and addr_location__exit in arch_skip_callchain_idx. Fixes: 0dd5041c9a0eaf8c ("perf addr_location: Add init/exit/copy functions") Reported-by: Aneesh Kumar K.V Signed-off-by: Athira Rajeev Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: Kajol Jain Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230724165815.17810-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit f061e2be8689057cb4ec0dbffa9f03e1a23cdcb2 Author: Mark Brown Date: Sun Jul 23 00:27:22 2023 +0100 ASoC: wm8904: Fill the cache for WM8904_ADC_TEST_0 register The WM8904_ADC_TEST_0 register is modified as part of updating the OSR controls but does not have a cache default, leading to errors when we try to modify these controls in cache only mode with no prior read: wm8904 3-001a: ASoC: error at snd_soc_component_update_bits on wm8904.3-001a for register: [0x000000c6] -16 Add a read of the register to probe() to fill the cache and avoid both the error messages and the misconfiguration of the chip which will result. Acked-by: Charles Keepax Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230723-asoc-fix-wm8904-adc-test-read-v1-1-2cdf2edd83fd@kernel.org Signed-off-by: Mark Brown commit c918008fe746285dedc9c3037cd484e964859788 Merge: 1bc40efdaf4a0 f0691dc16206f Author: Mark Brown Date: Mon Jul 24 20:09:31 2023 +0100 ASoC: da7219: Patches related to a spurious AAD IRQ Merge series from Dmytro Maluka : This series includes 2 patches related to (but not fixing) the following I2C failure which occurs sometimes during system suspend or resume and indicates a problem with a spurious DA7219 interrupt: [ 355.876211] i2c_designware i2c_designware.3: Transfer while suspended [ 355.876245] WARNING: CPU: 2 PID: 3576 at drivers/i2c/busses/i2c-designware-master.c:570 i2c_dw_xfer+0x411/0x440 ... [ 355.876462] Call Trace: [ 355.876468] [ 355.876475] ? update_load_avg+0x1b3/0x615 [ 355.876484] __i2c_transfer+0x101/0x1d8 [ 355.876494] i2c_transfer+0x74/0x10d [ 355.876504] regmap_i2c_read+0x6a/0x9c [ 355.876513] _regmap_raw_read+0x179/0x223 [ 355.876521] regmap_raw_read+0x1e1/0x28e [ 355.876527] regmap_bulk_read+0x17d/0x1ba [ 355.876532] ? __wake_up+0xed/0x1bb [ 355.876542] da7219_aad_irq_thread+0x54/0x2c9 [snd_soc_da7219 5fb8ebb2179cf2fea29af090f3145d68ed8e2184] [ 355.876556] irq_thread+0x13c/0x231 [ 355.876563] ? irq_forced_thread_fn+0x5f/0x5f [ 355.876570] ? irq_thread_fn+0x4d/0x4d [ 355.876576] kthread+0x13a/0x152 [ 355.876581] ? synchronize_irq+0xc3/0xc3 [ 355.876587] ? kthread_blkcg+0x31/0x31 [ 355.876592] ret_from_fork+0x1f/0x30 [ 355.876601] This log shows that DA7219 AAD interrupt handler da7219_aad_irq_thread() is unexpectedly running when DA7219 is suspended and should not generate interrupts. As a result, the IRQ handler is trying to read AAD IRQ event status over I2C and is hitting the I2C driver "Transfer while suspended" failure. Patch #1 adds synchronize_irq() when suspending DA7219, to prevent the IRQ handler from running after suspending if there is a pending IRQ generated before suspending. With this patch the above failure is still reproducible, so this patch does not fix any real observed issue so far, but at least is useful for confirming that the above issue is not caused by a pending IRQ but rather looks like a DA7219 hardware issue with an unexpectedly generated IRQ. Patch #2 does not fix the above issue either, but it prevents its potentially harmful side effects. With the existing code, if the issue occurs and the IRQ handler fails to read the AAD IRQ events status over I2C, it does not check that and tries to use the garbage uninitialized value of the events status, potentially reporting bogus events. This patch fixes that by adding missing error checking. In fact I'm sending these patches not only to submit them for review but also to ask Renesas folks for any hints on a possible cause of the described DA7219 issue (AAD interrupts spuriously firing after jack detection is already disabled) or how to debug it further. commit 856d8e3c633b183df23549ce760ae84478a7098d Author: Stefan Haberland Date: Fri Jul 21 21:36:47 2023 +0200 s390/dasd: print copy pair message only for the correct error The DASD driver has certain types of requests that might be rejected by the storage server or z/VM because they are not supported. Since the missing support of the command is not a real issue there is no user visible kernel error message for this. For copy pair setups there is a specific error that IO is not allowed on secondary devices. This error case is explicitly handled and an error message is printed. The code checking for the error did use a bitwise 'and' that is used to check for specific bits. But in this case the whole sense byte has to match. This leads to the problem that the copy pair related error message is erroneously printed for other error cases that are usually not reported. This might heavily confuse users and lead to follow on actions that might disrupt application processing. Fix by checking the sense byte for the exact value and not single bits. Cc: stable@vger.kernel.org # 6.1+ Fixes: 1fca631a1185 ("s390/dasd: suppress generic error messages for PPRC secondary devices") Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20230721193647.3889634-5-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 8a2278ce9c25048d999fe1a3561def75d963f471 Author: Stefan Haberland Date: Fri Jul 21 21:36:46 2023 +0200 s390/dasd: fix hanging device after request requeue The DASD device driver has a function to requeue requests to the blocklayer. This function is used in various cases when basic settings for the device have to be changed like High Performance Ficon related parameters or copy pair settings. The functions iterates over the device->ccw_queue and also removes the requests from the block->ccw_queue. In case the device is started on an alias device instead of the base device it might be removed from the block->ccw_queue without having it canceled properly before. This might lead to a hanging device since the request is no longer on a queue and can not be handled properly. Fix by iterating over the block->ccw_queue instead of the device->ccw_queue. This will take care of all blocklayer related requests and handle them on all associated DASD devices. Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20230721193647.3889634-4-sth@linux.ibm.com Signed-off-by: Jens Axboe commit acea28a6b74f458defda7417d2217b051ba7d444 Author: Stefan Haberland Date: Fri Jul 21 21:36:45 2023 +0200 s390/dasd: use correct number of retries for ERP requests If a DASD request fails an error recovery procedure (ERP) request might be built as a copy of the original request to do error recovery. The ERP request gets a number of retries assigned. This number is always 256 no matter what other value might have been set for the original request. This is not what is expected when a user specifies a certain amount of retries for the device via sysfs. Correctly use the number of retries of the original request for ERP requests. Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20230721193647.3889634-3-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 05f1d8ed03f547054efbc4d29bb7991c958ede95 Author: Stefan Haberland Date: Fri Jul 21 21:36:44 2023 +0200 s390/dasd: fix hanging device after quiesce/resume Quiesce and resume are functions that tell the DASD driver to stop/resume issuing I/Os to a specific DASD. On resume dasd_schedule_block_bh() is called to kick handling of IO requests again. This does unfortunately not cover internal requests which are used for path verification for example. This could lead to a hanging device when a path event or anything else that triggers internal requests occurs on a quiesced device. Fix by also calling dasd_schedule_device_bh() which triggers handling of internal requests on resume. Fixes: 8e09f21574ea ("[S390] dasd: add hyper PAV support to DASD device driver, part 1") Cc: stable@vger.kernel.org Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20230721193647.3889634-2-sth@linux.ibm.com Signed-off-by: Jens Axboe commit ebceec271e552a2b05e47d8ef0597052b1a39449 Author: Yogesh Hegde Date: Tue Jul 18 22:09:41 2023 +0530 arm64: dts: rockchip: Fix Wifi/Bluetooth on ROCK Pi 4 boards This patch fixes an issue affecting the Wifi/Bluetooth connectivity on ROCK Pi 4 boards. Commit f471b1b2db08 ("arm64: dts: rockchip: Fix Bluetooth on ROCK Pi 4 boards") introduced a problem with the clock configuration. Specifically, the clock-names property of the sdio-pwrseq node was not updated to 'lpo', causing the driver to wait indefinitely for the wrong clock signal 'ext_clock' instead of the expected one 'lpo'. This prevented the proper initialization of Wifi/Bluetooth chip on ROCK Pi 4 boards. To address this, this patch updates the clock-names property of the sdio-pwrseq node to "lpo" to align with the changes made to the bluetooth node. This patch has been tested on ROCK Pi 4B. Fixes: f471b1b2db08 ("arm64: dts: rockchip: Fix Bluetooth on ROCK Pi 4 boards") Cc: stable@vger.kernel.org Signed-off-by: Yogesh Hegde Link: https://lore.kernel.org/r/ZLbATQRjOl09aLAp@zephyrusG14 Signed-off-by: Heiko Stuebner commit 7b72d661f1f2f950ab8c12de7e2bc48bdac8ed69 Author: Jens Axboe Date: Mon Jul 24 11:28:17 2023 -0600 io_uring: gate iowait schedule on having pending requests A previous commit made all cqring waits marked as iowait, as a way to improve performance for short schedules with pending IO. However, for use cases that have a special reaper thread that does nothing but wait on events on the ring, this causes a cosmetic issue where we know have one core marked as being "busy" with 100% iowait. While this isn't a grave issue, it is confusing to users. Rather than always mark us as being in iowait, gate setting of current->in_iowait to 1 by whether or not the waiting task has pending requests. Cc: stable@vger.kernel.org Link: https://lore.kernel.org/io-uring/CAMEGJJ2RxopfNQ7GNLhr7X9=bHXKo+G5OOe0LUq=+UgLXsv1Xg@mail.gmail.com/ Link: https://bugzilla.kernel.org/show_bug.cgi?id=217699 Link: https://bugzilla.kernel.org/show_bug.cgi?id=217700 Reported-by: Oleksandr Natalenko Reported-by: Phil Elwell Tested-by: Andres Freund Fixes: 8a796565cec3 ("io_uring: Use io_schedule* in cqring wait") Signed-off-by: Jens Axboe commit 20ea1e7d13c1b544fe67c4a8dc3943bb1ab33e6f Author: Christian Brauner Date: Mon Jul 24 17:00:49 2023 +0200 file: always lock position for FMODE_ATOMIC_POS The pidfd_getfd() system call allows a caller with ptrace_may_access() abilities on another process to steal a file descriptor from this process. This system call is used by debuggers, container runtimes, system call supervisors, networking proxies etc. So while it is a special interest system call it is used in common tools. That ability ends up breaking our long-time optimization in fdget_pos(), which "knew" that if we had exclusive access to the file descriptor nobody else could access it, and we didn't need the lock for the file position. That check for file_count(file) was always fairly subtle - it depended on __fdget() not incrementing the file count for single-threaded processes and thus included that as part of the rule - but it did mean that we didn't need to take the lock in all those traditional unix process contexts. So it's sad to see this go, and I'd love to have some way to re-instate the optimization. At the same time, the lock obviously isn't ever contended in the case we optimized, so all we were optimizing away is the atomics and the cacheline dirtying. Let's see if anybody even notices that the optimization is gone. Link: https://lore.kernel.org/linux-fsdevel/20230724-vfs-fdget_pos-v1-1-a4abfd7103f3@kernel.org/ Fixes: 8649c322f75c ("pid: Implement pidfd_getfd syscall") Cc: stable@kernel.org Signed-off-by: Christian Brauner Signed-off-by: Linus Torvalds commit 9754353d0ab123d71bf572a483ecc8b330ef36a3 Author: Haixin Yu Date: Mon Jul 24 13:06:54 2023 +0800 perf pmu arm64: Fix reading the PMU cpu slots in sysfs Commit f8ad6018ce3c065a ("perf pmu: Remove duplication around EVENT_SOURCE_DEVICE_PATH") uses sysfs__read_ull() to read a full sysfs path, which will never succeeds as it already comes with the sysfs mount point in it, which sysfs__read_ull() will add again. Fix it by reading the file using filename__read_ull(), that will not add the sysfs mount point. Fixes: f8ad6018ce3c065a ("perf pmu: Remove duplication around EVENT_SOURCE_DEVICE_PATH") Signed-off-by: Haixin Yu Tested-by: Jing Zhang Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/ZL4G7rWXkfv-Ectq@B-Q60VQ05P-2326.local Signed-off-by: Arnaldo Carvalho de Melo commit 9e0ee0c7545c7ec012a53878e7687e05b87abc75 Merge: 0a9266b79cacd 0cb1d9c845110 Author: Linus Torvalds Date: Mon Jul 24 09:25:18 2023 -0700 Merge tag 'media/v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: - some warning fixes - verisilicon: an excessive usage of stack fix and changes at reg access - amphion: use dev_err_probe - pulse8-cec: handle possible ping error - imx-jpeg: Support to assign slot for encoder/decoder - amphion: Fix firmware path to match linux-firmware - pci: cx23885: fix error handling for cx23885 ATSC boards - staging: atomisp: select V4L2_FWNODE - mediatek: vcodec: fix cancel_work_sync fail with fluster test * tag 'media/v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: verisilicon: change confusingly named relaxed register access media: verisilicon: fix excessive stack usage media: mediatek: vcodec: fix cancel_work_sync fail with fluster test media: pci: cx23885: fix error handling for cx23885 ATSC boards media: pulse8-cec: handle possible ping error media: mtk_jpeg_core: avoid unused-variable warning media: imx-jpeg: Support to assign slot for encoder/decoder media: amphion: Fix firmware path to match linux-firmware media: amphion: use dev_err_probe media: staging: atomisp: select V4L2_FWNODE media: tc358746: Address compiler warnings commit bf7ecbe9875061bf3fce1883e3b26b77f847d1e8 Author: Filipe Manana Date: Fri Jul 21 10:49:20 2023 +0100 btrfs: check if the transaction was aborted at btrfs_wait_for_commit() At btrfs_wait_for_commit() we wait for a transaction to finish and then always return 0 (success) without checking if it was aborted, in which case the transaction didn't happen due to some critical error. Fix this by checking if the transaction was aborted. Fixes: 462045928bda ("Btrfs: add START_SYNC, WAIT_SYNC ioctls") CC: stable@vger.kernel.org # 4.19+ Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit d8ccbd21918fd7fa6ce3226cffc22c444228e8ad Author: Filipe Manana Date: Fri Jun 30 16:03:44 2023 +0100 btrfs: remove BUG_ON()'s in add_new_free_space() At add_new_free_space() we have these BUG_ON()'s that are there to deal with any failure to add free space to the in memory free space cache. Such failures are mostly -ENOMEM that should be very rare. However there's no need to have these BUG_ON()'s, we can just return any error to the caller and all callers and their upper call chain are already dealing with errors. So just make add_new_free_space() return any errors, while removing the BUG_ON()'s, and returning the total amount of added free space to an optional u64 pointer argument. Reported-by: syzbot+3ba856e07b7127889d8c@syzkaller.appspotmail.com Link: https://lore.kernel.org/linux-btrfs/000000000000e9cb8305ff4e8327@google.com/ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0a9266b79cacdd02b888aed1308c308ad6d4ee4e Merge: 6eaae19807608 522b1d69219d8 Author: Linus Torvalds Date: Mon Jul 24 08:55:53 2023 -0700 Merge tag 'x86_bugs_zenbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull Zen 2 errata fix from Borislav Petkov: "Fix an issue on AMD Zen2 processors called Zenbleed. The bug manifests itself as a data corruption issue when executing VZEROUPPER under certain microarchitectural conditions" * tag 'x86_bugs_zenbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu/amd: Add a Zenbleed fix x86/cpu/amd: Move the errata checking functionality up commit aead78125a987f48944bff2001f61df72b95afc4 Author: Anh Tuan Phan Date: Sun Jul 16 22:44:56 2023 +0700 tools/counter: Makefile: Replace rmdir by rm to avoid make,clean failure Use rm -df instead of rmdir -p since rmdir requires the directory exist so it causes "make -C tools clean" failed if someone only builds other tools but not counter. Fixes: 228354ed692f ("tools/counter: Makefile: Remove lingering 'include' directories on make clean") Signed-off-by: Anh Tuan Phan Link: https://lore.kernel.org/r/d4080db5-1825-2848-079a-8bb674d8ee44@gmail.com/ Signed-off-by: William Breathitt Gray commit 54685abe660a59402344d5045ce08c43c6a5ac42 Author: Gilles Buloz Date: Mon Jul 24 08:04:44 2023 +0000 hwmon: (nct7802) Fix for temp6 (PECI1) processed even if PECI1 disabled Because of hex value 0x46 used instead of decimal 46, the temp6 (PECI1) temperature is always declared visible and then displayed even if disabled in the chip Signed-off-by: Gilles Buloz Link: https://lore.kernel.org/r/DU0PR10MB62526435ADBC6A85243B90E08002A@DU0PR10MB6252.EURPRD10.PROD.OUTLOOK.COM Fixes: fcdc5739dce03 ("hwmon: (nct7802) add temperature sensor type attribute") Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck commit a2777be03236c00466326acba8d39ac4f9c3e971 Author: Brian Norris Date: Fri Jul 21 16:06:04 2023 -0700 MAINTAINERS: Update mwifiex maintainer list We haven't heard anything from these folks in years. I've been reviewing many submissions and plan to keep doing so. Cc: Amitkumar Karwar Cc: Ganapathi Bhat Cc: Sharvari Harisangam Cc: Xinming Hu Signed-off-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230721160603.1.Idf0e8025f59c62d73c08960638249b58cf215acc@changeid commit 421033deb91521aa6a9255e495cb106741a52275 Author: Paul Fertser Date: Mon Jun 5 10:34:07 2023 +0300 wifi: mt76: mt7615: do not advertise 5 GHz on first phy of MT7615D (DBDC) On DBDC devices the first (internal) phy is only capable of using 2.4 GHz band, and the 5 GHz band is exposed via a separate phy object, so avoid the false advertising. Reported-by: Rani Hod Closes: https://github.com/openwrt/openwrt/pull/12361 Fixes: 7660a1bd0c22 ("mt76: mt7615: register ext_phy if DBDC is detected") Cc: stable@vger.kernel.org Signed-off-by: Paul Fertser Reviewed-by: Simon Horman Acked-by: Felix Fietkau Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230605073408.8699-1-fercerpav@gmail.com commit 92d39d018347ead1078dcba3cb1d8aeb9de79e04 Author: Durai Manickam KR Date: Tue Jul 18 12:27:34 2023 +0530 dt-bindings: serial: atmel,at91-usart: update compatible for sam9x60 There is only one debug unit in the sam9x60 SOC and it has the chipid register. So, the dbgu compatible strings are valid only for debug usart. Defining these dbgu compatible strings are not valid for flexcom usart. So adding the items which is valid only for flexcom usart and removing the microchip,sam9x60-usart compatible string from the enum list as no usart node defines only this specific compatible string. Signed-off-by: Durai Manickam KR Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230718065735.10187-2-durai.manickamkr@microchip.com Signed-off-by: Arnd Bergmann commit 1b64daa6020c0cb4443b4a804a573ad67fc35561 Merge: f6ad3c13f1b8c d1ff11d7ad870 Author: Arnd Bergmann Date: Mon Jul 24 15:17:59 2023 +0200 Merge tag 'scmi-smccc-fixes-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm SCMI and SMCCC fixes for v6.5 Set of fixes addressing issues: 1. Possible use of uninitialised results structure in the SMCCC SOC_ID driver if the driver fails to complete the initialisation 2. Missed signed error return value handling from simple_write_to_buffer() used in scmi_dbg_raw_mode_common_write() 3. The OF node reference obtained is not dropped if node is incompatible with "arm,scmi-shmem" in the mailbox as well as SMC transport channel setup 4. The possibility of a late response to an in-flight pending transaction that could end up triggering the interrupt handler after the SCMI core has cleaned up the transport channel as part of core driver remove * tag 'scmi-smccc-fixes-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Fix chan_free cleanup on SMC firmware: arm_scmi: Drop OF node reference in the transport channel setup firmware: arm_scmi: Fix signed error return values handling firmware: smccc: Fix use of uninitialised results structure Link: https://lore.kernel.org/r/20230721114052.3371923-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 922a9bd138101e3e5718f0f4d40dba68ef89bb43 Author: Ben Hutchings Date: Fri Jun 16 17:36:10 2023 +0200 m68k: Fix invalid .section syntax gas supports several different forms for .section for ELF targets, including: .section NAME [, "FLAGS"[, @TYPE[,FLAG_SPECIFIC_ARGUMENTS]]] and: .section "NAME"[, #FLAGS...] In several places we use a mix of these two forms: .section NAME, #FLAGS... A current development snapshot of binutils (2.40.50.20230611) treats this mixed syntax as an error. Change to consistently use: .section NAME, "FLAGS" as is used elsewhere in the kernel. Link: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=m68k&ver=6.4%7Erc6-1%7Eexp1&stamp=1686907300&raw=1 Signed-off-by: Ben Hutchings Tested-by: Jan-Benedict Glaw Link: https://lore.kernel.org/r/ZIyBaueWT9jnTwRC@decadent.org.uk Signed-off-by: Geert Uytterhoeven commit 50164507f6b7b7ed85d8c3ac0266849fbd908db7 Author: Xiubo Li Date: Thu Jul 20 11:33:55 2023 +0800 ceph: never send metrics if disable_send_metrics is set Even the 'disable_send_metrics' is true so when the session is being opened it will always trigger to send the metric for the first time. Cc: stable@vger.kernel.org Signed-off-by: Xiubo Li Reviewed-by: Venky Shankar Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 13c088cf3657d70893d75cf116be937f1509cc0f Author: Harshit Mogalapalli Date: Fri Jul 21 02:05:55 2023 -0700 phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe() The size of array 'priv->ports[]' is INNO_PHY_PORT_NUM. In the for loop, 'i' is used as the index for array 'priv->ports[]' with a check (i > INNO_PHY_PORT_NUM) which indicates that INNO_PHY_PORT_NUM is allowed value for 'i' in the same loop. This > comparison needs to be changed to >=, otherwise it potentially leads to an out of bounds write on the next iteration through the loop Fixes: ba8b0ee81fbb ("phy: add inno-usb2-phy driver for hi3798cv200 SoC") Reported-by: Dan Carpenter Signed-off-by: Harshit Mogalapalli Link: https://lore.kernel.org/r/20230721090558.3588613-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Vinod Koul commit 22117b3ae6e37d07225653d9ae5ae86b3a54f99c Merge: 8d01da0a1db23 b0b672c4d0957 Author: David S. Miller Date: Mon Jul 24 10:47:09 2023 +0100 Merge branch 'vxlan-gro-fixes' Jiri Benc says: ==================== vxlan: fix GRO with VXLAN-GPE The first patch generalizes code for the second patch, which is a fix for broken VXLAN-GPE GRO. Thanks to Paolo for noticing the bug. ==================== Signed-off-by: David S. Miller commit b0b672c4d0957e5897685667fc848132b8bd2d71 Author: Jiri Benc Date: Fri Jul 21 16:30:47 2023 +0200 vxlan: fix GRO with VXLAN-GPE In VXLAN-GPE, there may not be an Ethernet header following the VXLAN header. But in GRO, the vxlan driver calls eth_gro_receive unconditionally, which means the following header is incorrectly parsed as Ethernet. Introduce GPE specific GRO handling. For better performance, do not check for GPE during GRO but rather install a different set of functions at setup time. Fixes: e1e5314de08ba ("vxlan: implement GPE") Reported-by: Paolo Abeni Signed-off-by: Jiri Benc Signed-off-by: David S. Miller commit 17a0a64448b568442a101de09575f81ffdc45d15 Author: Jiri Benc Date: Fri Jul 21 16:30:46 2023 +0200 vxlan: generalize vxlan_parse_gpe_hdr and remove unused args The vxlan_parse_gpe_hdr function extracts the next protocol value from the GPE header and marks GPE bits as parsed. In order to be used in the next patch, split the function into protocol extraction and bit marking. The bit marking is meaningful only in vxlan_rcv; move it directly there. Rename the function to vxlan_parse_gpe_proto to reflect what it now does. Remove unused arguments skb and vxflags. Move the function earlier in the file to allow it to be called from more places in the next patch. Signed-off-by: Jiri Benc Signed-off-by: David S. Miller commit 8d01da0a1db237c44c92859ce3612df7af8d3a53 Author: Yuanjun Gong Date: Thu Jul 20 22:42:08 2023 +0800 ethernet: atheros: fix return value check in atl1c_tso_csum() in atl1c_tso_csum, it should check the return value of pskb_trim(), and return an error code if an unexpected value is returned by pskb_trim(). Signed-off-by: Yuanjun Gong Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 94d166c5318c6edd1e079df8552233443e909c33 Author: Jiri Benc Date: Thu Jul 20 11:05:56 2023 +0200 vxlan: calculate correct header length for GPE VXLAN-GPE does not add an extra inner Ethernet header. Take that into account when calculating header length. This causes problems in skb_tunnel_check_pmtu, where incorrect PMTU is cached. In the collect_md mode (which is the only mode that VXLAN-GPE supports), there's no magic auto-setting of the tunnel interface MTU. It can't be, since the destination and thus the underlying interface may be different for each packet. So, the administrator is responsible for setting the correct tunnel interface MTU. Apparently, the administrators are capable enough to calculate that the maximum MTU for VXLAN-GPE is (their_lower_MTU - 36). They set the tunnel interface MTU to 1464. If you run a TCP stream over such interface, it's then segmented according to the MTU 1464, i.e. producing 1514 bytes frames. Which is okay, this still fits the lower MTU. However, skb_tunnel_check_pmtu (called from vxlan_xmit_one) uses 50 as the header size and thus incorrectly calculates the frame size to be 1528. This leads to ICMP too big message being generated (locally), PMTU of 1450 to be cached and the TCP stream to be resegmented. The fix is to use the correct actual header size, especially for skb_tunnel_check_pmtu calculation. Fixes: e1e5314de08ba ("vxlan: implement GPE") Signed-off-by: Jiri Benc Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit a071c6ace314d7bcc8400275ea79f13b5bcc89e9 Merge: c7b75bea853da 882481b1c55fc Author: David S. Miller Date: Mon Jul 24 09:36:23 2023 +0100 Merge branch 'hns3-fixes' Jijie Shao says: ==================== There are some bugfix for the HNS3 ethernet driver There are some bugfix for the HNS3 ethernet driver ==================== Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 882481b1c55fc44861d7e2d54b4e0936b1b39f2c Author: Jijie Shao Date: Thu Jul 20 10:05:10 2023 +0800 net: hns3: fix wrong bw weight of disabled tc issue In dwrr mode, the default bandwidth weight of disabled tc is set to 0. If the bandwidth weight is 0, the mode will change to sp. Therefore, disabled tc default bandwidth weight need changed to 1, and 0 is returned when query the bandwidth weight of disabled tc. In addition, driver need stop configure bandwidth weight if tc is disabled. Fixes: 848440544b41 ("net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver") Signed-off-by: Jie Wang Signed-off-by: Jijie Shao Signed-off-by: David S. Miller commit 116d9f732eef634abbd871f2c6f613a5b4677742 Author: Jijie Shao Date: Thu Jul 20 10:05:09 2023 +0800 net: hns3: fix wrong tc bandwidth weight data issue Currently, the weight saved by the driver is used as the query result, which may be different from the actual weight in the register. Therefore, the register value read from the firmware is used as the query result Fixes: 0e32038dc856 ("net: hns3: refactor dump tc of debugfs") Signed-off-by: Jijie Shao Signed-off-by: David S. Miller commit 6d2336120aa6e1a8a64fa5d6ee5c3f3d0809fe9b Author: Hao Lan Date: Thu Jul 20 10:05:08 2023 +0800 net: hns3: add tm flush when setting tm When the tm module is configured with traffic, traffic may be abnormal. This patch fixes this problem. Before the tm module is configured, traffic processing should be stopped. After the tm module is configured, traffic processing is enabled. Signed-off-by: Hao Lan Signed-off-by: Jijie Shao Signed-off-by: David S. Miller commit b27d0232e8897f7c896dc8ad80c9907dd57fd3f3 Author: Hao Lan Date: Thu Jul 20 10:05:07 2023 +0800 net: hns3: fix the imp capability bit cannot exceed 32 bits issue Current only the first 32 bits of the capability flag bit are considered. When the matching capability flag bit is greater than 31 bits, it will get an error bit.This patch use bitmap to solve this issue. It can handle each capability bit whitout bit width limit. Fixes: da77aef9cc58 ("net: hns3: create common cmdq resource allocate/free/query APIs") Signed-off-by: Hao Lan Signed-off-by: Jijie Shao Signed-off-by: David S. Miller commit de990908521073d98a46ad0e29885df447e95242 Merge: 67a4e1a3bf7c6 6fe5c68ee6a1a Author: Thomas Gleixner Date: Mon Jul 24 10:27:43 2023 +0200 Merge tag 'irqchip-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent Pull irqchip fixes from Marc Zyngier: - Work around an erratum on GIC700, where a race between a CPU handling a wake-up interrupt, a change of affinity, and another CPU going to sleep can result in a lack of wake-up event on the next interrupt. - Fix the locking required on a VPE for GICv4 - Enable Rockchip 3588001 erratum workaround for RK3588S - Fix the irq-bcm6345-l1 assumtions of the boot CPU always be the first CPU in the system Link: https://lore.kernel.org/lkml/20230717113857.304919-1-maz@kernel.org commit 4dd8752a14ca0303fbdf0a6c68ff65f0a50bd2fa Author: Johan Hovold Date: Thu Jul 13 16:57:41 2023 +0200 serial: qcom-geni: drop bogus runtime pm state update The runtime PM state should not be changed by drivers that do not implement runtime PM even if it happens to work around a bug in PM core. With the wake irq arming now fixed, drop the bogus runtime PM state update which left the device in active state (and could potentially prevent a parent device from suspending). Fixes: f3974413cf02 ("tty: serial: qcom_geni_serial: Wakeup IRQ cleanup") Cc: 5.6+ # 5.6+ Signed-off-by: Johan Hovold Reviewed-by: Tony Lindgren Signed-off-by: Rafael J. Wysocki commit e7b915219baa4b2bf30afe1dbaca7a24ff627ad2 Author: Johan Hovold Date: Thu Jul 13 16:57:40 2023 +0200 PM: sleep: wakeirq: drop unused enable helpers Drop the wake-irq enable and disable helpers which have not been used since commit bed570307ed7 ("PM / wakeirq: Fix dedicated wakeirq for drivers not using autosuspend"). Note that these functions are essentially just leftovers from the first iteration of the wake-irq implementation where device drivers were supposed to call these functions themselves instead of PM core (as is also indicated by the bogus kernel doc comments). Signed-off-by: Johan Hovold Reviewed-by: Tony Lindgren Signed-off-by: Rafael J. Wysocki commit 8527beb12087238d4387607597b4020bc393c4b4 Author: Johan Hovold Date: Thu Jul 13 16:57:39 2023 +0200 PM: sleep: wakeirq: fix wake irq arming The decision whether to enable a wake irq during suspend can not be done based on the runtime PM state directly as a driver may use wake irqs without implementing runtime PM. Such drivers specifically leave the state set to the default 'suspended' and the wake irq is thus never enabled at suspend. Add a new wake irq flag to track whether a dedicated wake irq has been enabled at runtime suspend and therefore must not be enabled at system suspend. Note that pm_runtime_enabled() can not be used as runtime PM is always disabled during late suspend. Fixes: 69728051f5bf ("PM / wakeirq: Fix unbalanced IRQ enable for wakeirq") Cc: 4.16+ # 4.16+ Signed-off-by: Johan Hovold Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren Signed-off-by: Rafael J. Wysocki commit ac4436a5b20e0ef1f608a9ef46c08d5d142f8da6 Author: Ahmad Fatoum Date: Sat Jul 8 13:27:20 2023 +0200 thermal: of: fix double-free on unregistration Since commit 3d439b1a2ad3 ("thermal/core: Alloc-copy-free the thermal zone parameters structure"), thermal_zone_device_register() allocates a copy of the tzp argument and frees it when unregistering, so thermal_of_zone_register() now ends up leaking its original tzp and double-freeing the tzp copy. Fix this by locating tzp on stack instead. Fixes: 3d439b1a2ad3 ("thermal/core: Alloc-copy-free the thermal zone parameters structure") Signed-off-by: Ahmad Fatoum Acked-by: Daniel Lezcano Cc: 6.4+ # 6.4+: 8bcbb18c61d6: thermal: core: constify params in thermal_zone_device_register Signed-off-by: Rafael J. Wysocki commit 80ddce5f2dbd0e83eadc9f9d373439180d599fe5 Author: Ahmad Fatoum Date: Sat Jul 8 13:27:19 2023 +0200 thermal: core: constify params in thermal_zone_device_register Since commit 3d439b1a2ad3 ("thermal/core: Alloc-copy-free the thermal zone parameters structure"), thermal_zone_device_register() allocates a copy of the tzp argument and callers need not explicitly manage its lifetime. This means the function no longer cares about the parameter being mutable, so constify it. No functional change. Signed-off-by: Ahmad Fatoum Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 9e46e4dcd9d6cd88342b028dbfa5f4fb7483d39c Author: Rik van Riel Date: Wed Jul 19 15:41:37 2023 -0400 mm,memblock: reset memblock.reserved to system init state to prevent UAF The memblock_discard function frees the memblock.reserved.regions array, which is good. However, if a subsequent memblock_free (or memblock_phys_free) comes in later, from for example ima_free_kexec_buffer, that will result in a use after free bug in memblock_isolate_range. When running a kernel with CONFIG_KASAN enabled, this will cause a kernel panic very early in boot. Without CONFIG_KASAN, there is a chance that memblock_isolate_range might scribble on memory that is now in use by somebody else. Avoid those issues by making sure that memblock_discard points memblock.reserved.regions back at the static buffer. If memblock_free is called after memblock memory is discarded, that will print a warning in memblock_remove_region. Signed-off-by: Rik van Riel Link: https://lore.kernel.org/r/20230719154137.732d8525@imladris.surriel.com Signed-off-by: Mike Rapoport (IBM) commit ed0cf84e9cc42e6310961c87709621f1825c2bb8 Author: Ani Sinha Date: Wed Jul 5 19:14:07 2023 +0530 vmbus_testing: fix wrong python syntax for integer value comparison It is incorrect in python to compare integer values using the "is" keyword. The "is" keyword in python is used to compare references to two objects, not their values. Newer version of python3 (version 3.8) throws a warning when such incorrect comparison is made. For value comparison, "==" should be used. Fix this in the code and suppress the following warning: /usr/sbin/vmbus_testing:167: SyntaxWarning: "is" with a literal. Did you mean "=="? Signed-off-by: Ani Sinha Link: https://lore.kernel.org/r/20230705134408.6302-1-anisinha@redhat.com Signed-off-by: Wei Liu commit 060f2b979c4e0e894c381c76a4dcad24376feddd Author: ZhiHu Date: Sun Jul 23 23:12:47 2023 +0000 x86/hyperv: fix a warning in mshyperv.h The following checkpatch warning is removed: WARNING: Use #include instead of Signed-off-by: ZhiHu Reviewed-by: Michael Kelley Signed-off-by: Wei Liu commit d5ace2a776442d80674eff9ed42e737f7dd95056 Author: Michael Kelley Date: Fri Jul 21 21:51:16 2023 -0700 x86/hyperv: Disable IBT when hypercall page lacks ENDBR instruction On hardware that supports Indirect Branch Tracking (IBT), Hyper-V VMs with ConfigVersion 9.3 or later support IBT in the guest. However, current versions of Hyper-V have a bug in that there's not an ENDBR64 instruction at the beginning of the hypercall page. Since hypercalls are made with an indirect call to the hypercall page, all hypercall attempts fail with an exception and Linux panics. A Hyper-V fix is in progress to add ENDBR64. But guard against the Linux panic by clearing X86_FEATURE_IBT if the hypercall page doesn't start with ENDBR. The VM will boot and run without IBT. If future Linux 32-bit kernels were to support IBT, additional hypercall page hackery would be needed to make IBT work for such kernels in a Hyper-V VM. Cc: stable@vger.kernel.org Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1690001476-98594-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 67cb608838e0aac8efb48828b1165156f99c1af9 Author: Chen-Yu Tsai Date: Fri Jul 21 16:28:55 2023 +0800 regulator: mt6358: Fix incorrect VCN33 sync error message After syncing the enable status of VCN33_WIFI to VCN33_BT, the driver will disable VCN33_WIFI. If it fails it will error out with a message. However the error message incorrectly refers to VCN33_BT. Fix the error message so that it correctly refers to VCN33_WIFI. Suggested-by: Fei Shao Fixes: 65bae54e08c1 ("regulator: mt6358: Merge VCN33_* regulators") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230721082903.2038975-4-wenst@chromium.org Signed-off-by: Mark Brown commit 649fee5a17a7f96152fee2fb9111d9a4db535f35 Author: Chen-Yu Tsai Date: Fri Jul 21 16:28:54 2023 +0800 regulator: mt6358: Sync VCN33_* enable status after checking ID Syncing VCN33_* enable status should be done after checking the PMIC's ID, to avoid setting random bits on other PMICs. Suggested-by: AngeloGioacchino Del Regno Fixes: 65bae54e08c1 ("regulator: mt6358: Merge VCN33_* regulators") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230721082903.2038975-3-wenst@chromium.org Signed-off-by: Mark Brown commit 1bc40efdaf4a0ccfdb10a1c8e4b458f4764e8e5f Author: Edson Juliano Drosdeck Date: Wed Jul 19 17:02:41 2023 -0300 ASoC: nau8821: Add DMI quirk mechanism for active-high jack-detect Add a quirk mechanism to allow specifying that active-high jack-detection should be used on platforms where this info is not available in devicetree. And add an entry for the Positivo CW14Q01P-V2 to the DMI table, so that jack-detection will work properly on this laptop. Signed-off-by: Edson Juliano Drosdeck Link: https://lore.kernel.org/r/20230719200241.4865-1-edson.drosdeck@gmail.com Signed-off-by: Mark Brown commit f0691dc16206f21b13c464434366e2cd632b8ed7 Author: Dmytro Maluka Date: Mon Jul 17 21:37:37 2023 +0200 ASoC: da7219: Check for failure reading AAD IRQ events When handling an AAD interrupt, if IRQ events read failed (for example, due to i2c "Transfer while suspended" failure, i.e. when attempting to read it while DA7219 is suspended, which may happen due to a spurious AAD interrupt), the events array contains garbage uninitialized values. So instead of trying to interprete those values and doing any actions based on them (potentially resulting in misbehavior, e.g. reporting bogus events), refuse to handle the interrupt. Signed-off-by: Dmytro Maluka Link: https://lore.kernel.org/r/20230717193737.161784-3-dmy@semihalf.com Signed-off-by: Mark Brown commit 91e292917dad64ab8d1d5ca2ab3069ad9dac6f72 Author: Dmytro Maluka Date: Mon Jul 17 21:37:36 2023 +0200 ASoC: da7219: Flush pending AAD IRQ when suspending da7219_aad_suspend() disables jack detection, which should prevent generating new interrupts by DA7219 while suspended. However, there is a theoretical possibility that there is a pending interrupt generated just before suspending DA7219 and not handled yet, so the IRQ handler may still run after DA7219 is suspended. To prevent that, wait until the pending IRQ handling is done. This patch arose as an attempt to fix the following I2C failure occurring sometimes during system suspend or resume: [ 355.876211] i2c_designware i2c_designware.3: Transfer while suspended [ 355.876245] WARNING: CPU: 2 PID: 3576 at drivers/i2c/busses/i2c-designware-master.c:570 i2c_dw_xfer+0x411/0x440 ... [ 355.876462] Call Trace: [ 355.876468] [ 355.876475] ? update_load_avg+0x1b3/0x615 [ 355.876484] __i2c_transfer+0x101/0x1d8 [ 355.876494] i2c_transfer+0x74/0x10d [ 355.876504] regmap_i2c_read+0x6a/0x9c [ 355.876513] _regmap_raw_read+0x179/0x223 [ 355.876521] regmap_raw_read+0x1e1/0x28e [ 355.876527] regmap_bulk_read+0x17d/0x1ba [ 355.876532] ? __wake_up+0xed/0x1bb [ 355.876542] da7219_aad_irq_thread+0x54/0x2c9 [snd_soc_da7219 5fb8ebb2179cf2fea29af090f3145d68ed8e2184] [ 355.876556] irq_thread+0x13c/0x231 [ 355.876563] ? irq_forced_thread_fn+0x5f/0x5f [ 355.876570] ? irq_thread_fn+0x4d/0x4d [ 355.876576] kthread+0x13a/0x152 [ 355.876581] ? synchronize_irq+0xc3/0xc3 [ 355.876587] ? kthread_blkcg+0x31/0x31 [ 355.876592] ret_from_fork+0x1f/0x30 [ 355.876601] which indicates that the AAD IRQ handler is unexpectedly running when DA7219 is suspended, and as a result, is trying to read data from DA7219 over I2C and is hitting the I2C driver "Transfer while suspended" failure. However, with this patch the above failure is still reproducible. So this patch does not fix any real observed issue so far, but at least is useful for confirming that the above issue is not caused by a pending IRQ but rather looks like a DA7219 hardware issue with an IRQ unexpectedly generated after jack detection is already disabled. Signed-off-by: Dmytro Maluka Link: https://lore.kernel.org/r/20230717193737.161784-2-dmy@semihalf.com Signed-off-by: Mark Brown commit 1477c794c771be0a873a41421812e7274717dcd1 Merge: 0e4c2b6b0c4a4 6eaae19807608 Author: Mark Brown Date: Sun Jul 23 23:32:05 2023 +0100 ASoC: Merge up fixes from mainline There's several things here that will really help my CI. commit 6eaae198076080886b9e7d57f4ae06fa782f90ef Author: Linus Torvalds Date: Sun Jul 23 15:24:10 2023 -0700 Linux 6.5-rc3 commit 3b4e48b8007105695c913348ca11df50260a5ccb Merge: 12a5336ca384b 4b8b3905165ef Author: Linus Torvalds Date: Sun Jul 23 15:19:14 2023 -0700 Merge tag 'trace-v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Swapping the ring buffer for snapshotting (for things like irqsoff) can crash if the ring buffer is being resized. Disable swapping when this happens. The missed swap will be reported to the tracer - Report error if the histogram fails to be created due to an error in adding a histogram variable, in event_hist_trigger_parse() - Remove unused declaration of tracing_map_set_field_descr() * tag 'trace-v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing/histograms: Return an error if we fail to add histogram to hist_vars list ring-buffer: Do not swap cpu_buffer during resize process tracing: Remove unused extern declaration tracing_map_set_field_descr() commit 12a5336ca384b295093c18e0c66ca60b4518d9b9 Merge: 269f4a4b85a1b df01b7cfcef08 Author: Linus Torvalds Date: Sun Jul 23 14:55:41 2023 -0700 Merge tag 'kbuild-fixes-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Fix stale help text in gconfig - Support *.S files in compile_commands.json - Flatten KBUILD_CFLAGS - Fix external module builds with Rust so that temporary files are created in the modules directories instead of the kernel tree * tag 'kbuild-fixes-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: rust: avoid creating temporary files kbuild: flatten KBUILD_CFLAGS gen_compile_commands: add assembly files to compilation database kconfig: gconfig: correct program name in help text kconfig: gconfig: drop the Show Debug Info help text commit f00295e890bbc8780cd2076ee17bc7a08a53091c Author: Shazad Hussain Date: Wed Jul 19 16:33:44 2023 +0530 dt-bindings: pinctrl: qcom,sa8775p-tlmm: add gpio function constant Alternative function 'gpio' is not listed in the constants for pin configuration, so adding this constant to the list. Cc: stable@vger.kernel.org Fixes: 9a2aaee23c79 ("dt-bindings: pinctrl: describe sa8775p-tlmm") Signed-off-by: Shazad Hussain Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230719110344.19983-1-quic_shazhuss@quicinc.com Signed-off-by: Linus Walleij commit 010c1e1c5741365dbbf44a5a5bb9f30192875c4c Author: Michael Kelley Date: Thu Jul 20 14:05:02 2023 -0700 scsi: storvsc: Limit max_sectors for virtual Fibre Channel devices The Hyper-V host is queried to get the max transfer size that it supports, and this value is used to set max_sectors for the synthetic SCSI controller. However, this max transfer size may be too large for virtual Fibre Channel devices, which are limited to 512 Kbytes. If a larger transfer size is used with a vFC device, Hyper-V always returns an error, and storvsc logs a message like this where the SRB status and SCSI status are both zero: hv_storvsc : tag#197 cmd 0x8a status: scsi 0x0 srb 0x0 hv 0xc0000001 Add logic to limit the max transfer size to 512 Kbytes for vFC devices. Fixes: 1d3e0980782f ("scsi: storvsc: Correct reporting of Hyper-V I/O size limits") Cc: stable@vger.kernel.org Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1689887102-32806-1-git-send-email-mikelley@microsoft.com Signed-off-by: Martin K. Petersen commit df01b7cfcef08bf3fdcac2909d0e1910781d6bfd Author: Miguel Ojeda Date: Sun Jul 23 16:21:28 2023 +0200 kbuild: rust: avoid creating temporary files `rustc` outputs by default the temporary files (i.e. the ones saved by `-Csave-temps`, such as `*.rcgu*` files) in the current working directory when `-o` and `--out-dir` are not given (even if `--emit=x=path` is given, i.e. it does not use those for temporaries). Since out-of-tree modules are compiled from the `linux` tree, `rustc` then tries to create them there, which may not be accessible. Thus pass `--out-dir` explicitly, even if it is just for the temporary files. Similarly, do so for Rust host programs too. Reported-by: Raphael Nestler Closes: https://github.com/Rust-for-Linux/linux/issues/1015 Reported-by: Andrea Righi Tested-by: Raphael Nestler # non-hostprogs Tested-by: Andrea Righi # non-hostprogs Fixes: 295d8398c67e ("kbuild: specify output names separately for each emission type from rustc") Cc: stable@vger.kernel.org Signed-off-by: Miguel Ojeda Tested-by: Martin Rodriguez Reboredo Signed-off-by: Masahiro Yamada commit 269f4a4b85a1b61e94bf935b30c56a938e92f585 Merge: 15b593ba68445 0c189708bfbfa Author: Linus Torvalds Date: Sun Jul 23 10:44:38 2023 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "ARM: - Avoid pKVM finalization if KVM initialization fails - Add missing BTI instructions in the hypervisor, fixing an early boot failure on BTI systems - Handle MMU notifiers correctly for non hugepage-aligned memslots - Work around a bug in the architecture where hypervisor timer controls have UNKNOWN behavior under nested virt - Disable preemption in kvm_arch_hardware_enable(), fixing a kernel BUG in cpu hotplug resulting from per-CPU accessor sanity checking - Make WFI emulation on GICv4 systems robust w.r.t. preemption, consistently requesting a doorbell interrupt on vcpu_put() - Uphold RES0 sysreg behavior when emulating older PMU versions - Avoid macro expansion when initializing PMU register names, ensuring the tracepoints pretty-print the sysreg s390: - Two fixes for asynchronous destroy x86 fixes will come early next week" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: s390: pv: fix index value of replaced ASCE KVM: s390: pv: simplify shutdown and fix race KVM: arm64: Fix the name of sys_reg_desc related to PMU KVM: arm64: Correctly handle RES0 bits PMEVTYPER_EL0.evtCount KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption KVM: arm64: Add missing BTI instructions KVM: arm64: Correctly handle page aging notifiers for unaligned memslot KVM: arm64: Disable preemption in kvm_arch_hardware_enable() KVM: arm64: Handle kvm_arm_init failure correctly in finalize_pkvm KVM: arm64: timers: Use CNTHCTL_EL2 when setting non-CNTKCTL_EL1 bits commit 15b593ba68445a2b436a63044eaecd0679457dc2 Merge: 8266f53b39087 9d3de7ee192a6 Author: Linus Torvalds Date: Sun Jul 23 10:21:49 2023 -0700 Merge tag 'ext4_for_linus-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 fixes from Ted Ts'o: "Bug and regression fixes for 6.5-rc3 for ext4's mballoc and jbd2's checkpoint code" * tag 'ext4_for_linus-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: fix rbtree traversal bug in ext4_mb_use_preallocated ext4: fix off by one issue in ext4_mb_choose_next_group_best_avail() ext4: correct inline offset when handling xattrs in inode body jbd2: remove __journal_try_to_free_buffer() jbd2: fix a race when checking checkpoint buffer busy jbd2: Fix wrongly judgement for buffer head removing while doing checkpoint jbd2: remove journal_clean_one_cp_list() jbd2: remove t_checkpoint_io_list jbd2: recheck chechpointing non-dirty buffer commit 8266f53b39087c195f0d011dc5696cb2e6155242 Merge: c2782531397f5 ba61a03af29a5 Author: Linus Torvalds Date: Sun Jul 23 10:16:44 2023 -0700 Merge tag '6.5-rc2-smb3-client-fixes-ver2' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fix from Steve French: "Add minor debugging improvement. The change improves ability to read a network trace to debug problems on encrypted connections which are very common (e.g. using wireshark or tcpdump). That works today with tools like 'smbinfo keys /mnt/file' but requires passing in a filename on the mount (see e.g. [1]), but it often makes more sense to just pass in the mount point path (ie a directory not a filename). So this fix was needed to debug some types of problems (an obvious example is on an encrypted connection failing operations on an empty share or with no files in the root of the directory) - so you can simply pass in the 'smbinfo keys ' and get the information that wireshark needs" Link: https://wiki.samba.org/index.php/Wireshark_Decryption [1] * tag '6.5-rc2-smb3-client-fixes-ver2' of git://git.samba.org/sfrench/cifs-2.6: cifs: update internal module version number for cifs.ko cifs: allow dumping keys for directories too commit 0c189708bfbfa90b458dac5f0fd4379f9a7d547e Merge: 675a15f4db67d c2fceb59bbda1 Author: Paolo Bonzini Date: Sun Jul 23 12:50:30 2023 -0400 Merge tag 'kvm-s390-master-6.5-1' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD Two fixes for asynchronous destroy commit 675a15f4db67d87710404533ab4a48f692f1f3dd Merge: fdf0eaf11452d 9d2a55b403eea Author: Paolo Bonzini Date: Sun Jul 23 12:50:14 2023 -0400 Merge tag 'kvmarm-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 6.5, part #1 - Avoid pKVM finalization if KVM initialization fails - Add missing BTI instructions in the hypervisor, fixing an early boot failure on BTI systems - Handle MMU notifiers correctly for non hugepage-aligned memslots - Work around a bug in the architecture where hypervisor timer controls have UNKNOWN behavior under nested virt. - Disable preemption in kvm_arch_hardware_enable(), fixing a kernel BUG in cpu hotplug resulting from per-CPU accessor sanity checking. - Make WFI emulation on GICv4 systems robust w.r.t. preemption, consistently requesting a doorbell interrupt on vcpu_put() - Uphold RES0 sysreg behavior when emulating older PMU versions - Avoid macro expansion when initializing PMU register names, ensuring the tracepoints pretty-print the sysreg. commit 536bb492d39bb6c080c92f31e8a55fe9934f452b Author: Namjae Jeon Date: Sun Jul 23 15:27:37 2023 +0900 ksmbd: fix out of bounds in init_smb2_rsp_hdr() If client send smb2 negotiate request and then send smb1 negotiate request, init_smb2_rsp_hdr is called for smb1 negotiate request since need_neg is set to false. This patch ignore smb1 packets after ->need_neg is set to false. Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21541 Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit e202a1e8634b186da38cbbff85382ea2b9e297cf Author: Namjae Jeon Date: Sun Jul 23 15:22:33 2023 +0900 ksmbd: no response from compound read ksmbd doesn't support compound read. If client send read-read in compound to ksmbd, there can be memory leak from read buffer. Windows and linux clients doesn't send it to server yet. For now, No response from compound read. compound read will be supported soon. Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21587, ZDI-CAN-21588 Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 3df0411e132ee74a87aa13142dfd2b190275332e Author: Namjae Jeon Date: Sun Jul 23 15:21:11 2023 +0900 ksmbd: validate session id and tree id in compound request `smb2_get_msg()` in smb2_get_ksmbd_tcon() and smb2_check_user_session() will always return the first request smb2 header in a compound request. if `SMB2_TREE_CONNECT_HE` is the first command in compound request, will return 0, i.e. The tree id check is skipped. This patch use ksmbd_req_buf_next() to get current command in compound. Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21506 Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit dc318846f3dd54574a36ae97fc8d8b75dd7cdb1e Author: Namjae Jeon Date: Sat Jul 22 00:09:28 2023 +0900 ksmbd: fix out of bounds in smb3_decrypt_req() smb3_decrypt_req() validate if pdu_length is smaller than smb2_transform_hdr size. Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21589 Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 2b57a4322b1b14348940744fdc02f9a86cbbdbeb Author: Namjae Jeon Date: Mon Jul 17 08:37:40 2023 +0900 ksmbd: check if a mount point is crossed during path lookup Since commit 74d7970febf7 ("ksmbd: fix racy issue from using ->d_parent and ->d_name"), ksmbd can not lookup cross mount points. If last component is a cross mount point during path lookup, check if it is crossed to follow it down. And allow path lookup to cross a mount point when a crossmnt parameter is set to 'yes' in smb.conf. Cc: stable@vger.kernel.org Fixes: 74d7970febf7 ("ksmbd: fix racy issue from using ->d_parent and ->d_name") Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 4b8b3905165ef98386a3c06f196c85d21292d029 Author: Mohamed Khalfella Date: Fri Jul 14 20:33:41 2023 +0000 tracing/histograms: Return an error if we fail to add histogram to hist_vars list Commit 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if they have referenced variables") added a check to fail histogram creation if save_hist_vars() failed to add histogram to hist_vars list. But the commit failed to set ret to failed return code before jumping to unregister histogram, fix it. Link: https://lore.kernel.org/linux-trace-kernel/20230714203341.51396-1-mkhalfella@purestorage.com Cc: stable@vger.kernel.org Fixes: 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if they have referenced variables") Signed-off-by: Mohamed Khalfella Signed-off-by: Steven Rostedt (Google) commit 8a96c0288d0737ad77882024974c075345c72011 Author: Chen Lin Date: Wed Jul 19 15:58:47 2023 +0800 ring-buffer: Do not swap cpu_buffer during resize process When ring_buffer_swap_cpu was called during resize process, the cpu buffer was swapped in the middle, resulting in incorrect state. Continuing to run in the wrong state will result in oops. This issue can be easily reproduced using the following two scripts: /tmp # cat test1.sh //#! /bin/sh for i in `seq 0 100000` do echo 2000 > /sys/kernel/debug/tracing/buffer_size_kb sleep 0.5 echo 5000 > /sys/kernel/debug/tracing/buffer_size_kb sleep 0.5 done /tmp # cat test2.sh //#! /bin/sh for i in `seq 0 100000` do echo irqsoff > /sys/kernel/debug/tracing/current_tracer sleep 1 echo nop > /sys/kernel/debug/tracing/current_tracer sleep 1 done /tmp # ./test1.sh & /tmp # ./test2.sh & A typical oops log is as follows, sometimes with other different oops logs. [ 231.711293] WARNING: CPU: 0 PID: 9 at kernel/trace/ring_buffer.c:2026 rb_update_pages+0x378/0x3f8 [ 231.713375] Modules linked in: [ 231.714735] CPU: 0 PID: 9 Comm: kworker/0:1 Tainted: G W 6.5.0-rc1-00276-g20edcec23f92 #15 [ 231.716750] Hardware name: linux,dummy-virt (DT) [ 231.718152] Workqueue: events update_pages_handler [ 231.719714] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 231.721171] pc : rb_update_pages+0x378/0x3f8 [ 231.722212] lr : rb_update_pages+0x25c/0x3f8 [ 231.723248] sp : ffff800082b9bd50 [ 231.724169] x29: ffff800082b9bd50 x28: ffff8000825f7000 x27: 0000000000000000 [ 231.726102] x26: 0000000000000001 x25: fffffffffffff010 x24: 0000000000000ff0 [ 231.728122] x23: ffff0000c3a0b600 x22: ffff0000c3a0b5c0 x21: fffffffffffffe0a [ 231.730203] x20: ffff0000c3a0b600 x19: ffff0000c0102400 x18: 0000000000000000 [ 231.732329] x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffffe7aa8510 [ 231.734212] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000002 [ 231.736291] x11: ffff8000826998a8 x10: ffff800082b9baf0 x9 : ffff800081137558 [ 231.738195] x8 : fffffc00030e82c8 x7 : 0000000000000000 x6 : 0000000000000001 [ 231.740192] x5 : ffff0000ffbafe00 x4 : 0000000000000000 x3 : 0000000000000000 [ 231.742118] x2 : 00000000000006aa x1 : 0000000000000001 x0 : ffff0000c0007208 [ 231.744196] Call trace: [ 231.744892] rb_update_pages+0x378/0x3f8 [ 231.745893] update_pages_handler+0x1c/0x38 [ 231.746893] process_one_work+0x1f0/0x468 [ 231.747852] worker_thread+0x54/0x410 [ 231.748737] kthread+0x124/0x138 [ 231.749549] ret_from_fork+0x10/0x20 [ 231.750434] ---[ end trace 0000000000000000 ]--- [ 233.720486] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 [ 233.721696] Mem abort info: [ 233.721935] ESR = 0x0000000096000004 [ 233.722283] EC = 0x25: DABT (current EL), IL = 32 bits [ 233.722596] SET = 0, FnV = 0 [ 233.722805] EA = 0, S1PTW = 0 [ 233.723026] FSC = 0x04: level 0 translation fault [ 233.723458] Data abort info: [ 233.723734] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 [ 233.724176] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 [ 233.724589] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [ 233.725075] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000104943000 [ 233.725592] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000 [ 233.726231] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP [ 233.726720] Modules linked in: [ 233.727007] CPU: 0 PID: 9 Comm: kworker/0:1 Tainted: G W 6.5.0-rc1-00276-g20edcec23f92 #15 [ 233.727777] Hardware name: linux,dummy-virt (DT) [ 233.728225] Workqueue: events update_pages_handler [ 233.728655] pstate: 200000c5 (nzCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 233.729054] pc : rb_update_pages+0x1a8/0x3f8 [ 233.729334] lr : rb_update_pages+0x154/0x3f8 [ 233.729592] sp : ffff800082b9bd50 [ 233.729792] x29: ffff800082b9bd50 x28: ffff8000825f7000 x27: 0000000000000000 [ 233.730220] x26: 0000000000000000 x25: ffff800082a8b840 x24: ffff0000c0102418 [ 233.730653] x23: 0000000000000000 x22: fffffc000304c880 x21: 0000000000000003 [ 233.731105] x20: 00000000000001f4 x19: ffff0000c0102400 x18: ffff800082fcbc58 [ 233.731727] x17: 0000000000000000 x16: 0000000000000001 x15: 0000000000000001 [ 233.732282] x14: ffff8000825fe0c8 x13: 0000000000000001 x12: 0000000000000000 [ 233.732709] x11: ffff8000826998a8 x10: 0000000000000ae0 x9 : ffff8000801b760c [ 233.733148] x8 : fefefefefefefeff x7 : 0000000000000018 x6 : ffff0000c03298c0 [ 233.733553] x5 : 0000000000000002 x4 : 0000000000000000 x3 : 0000000000000000 [ 233.733972] x2 : ffff0000c3a0b600 x1 : 0000000000000000 x0 : 0000000000000000 [ 233.734418] Call trace: [ 233.734593] rb_update_pages+0x1a8/0x3f8 [ 233.734853] update_pages_handler+0x1c/0x38 [ 233.735148] process_one_work+0x1f0/0x468 [ 233.735525] worker_thread+0x54/0x410 [ 233.735852] kthread+0x124/0x138 [ 233.736064] ret_from_fork+0x10/0x20 [ 233.736387] Code: 92400000 910006b5 aa000021 aa0303f7 (f9400060) [ 233.736959] ---[ end trace 0000000000000000 ]--- After analysis, the seq of the error is as follows [1-5]: int ring_buffer_resize(struct trace_buffer *buffer, unsigned long size, int cpu_id) { for_each_buffer_cpu(buffer, cpu) { cpu_buffer = buffer->buffers[cpu]; //1. get cpu_buffer, aka cpu_buffer(A) ... ... schedule_work_on(cpu, &cpu_buffer->update_pages_work); //2. 'update_pages_work' is queue on 'cpu', cpu_buffer(A) is passed to // update_pages_handler, do the update process, set 'update_done' in // complete(&cpu_buffer->update_done) and to wakeup resize process. //----> //3. Just at this moment, ring_buffer_swap_cpu is triggered, //cpu_buffer(A) be swaped to cpu_buffer(B), the max_buffer. //ring_buffer_swap_cpu is called as the 'Call trace' below. Call trace: dump_backtrace+0x0/0x2f8 show_stack+0x18/0x28 dump_stack+0x12c/0x188 ring_buffer_swap_cpu+0x2f8/0x328 update_max_tr_single+0x180/0x210 check_critical_timing+0x2b4/0x2c8 tracer_hardirqs_on+0x1c0/0x200 trace_hardirqs_on+0xec/0x378 el0_svc_common+0x64/0x260 do_el0_svc+0x90/0xf8 el0_svc+0x20/0x30 el0_sync_handler+0xb0/0xb8 el0_sync+0x180/0x1c0 //<---- /* wait for all the updates to complete */ for_each_buffer_cpu(buffer, cpu) { cpu_buffer = buffer->buffers[cpu]; //4. get cpu_buffer, cpu_buffer(B) is used in the following process, //the state of cpu_buffer(A) and cpu_buffer(B) is totally wrong. //for example, cpu_buffer(A)->update_done will leave be set 1, and will //not 'wait_for_completion' at the next resize round. if (!cpu_buffer->nr_pages_to_update) continue; if (cpu_online(cpu)) wait_for_completion(&cpu_buffer->update_done); cpu_buffer->nr_pages_to_update = 0; } ... } //5. the state of cpu_buffer(A) and cpu_buffer(B) is totally wrong, //Continuing to run in the wrong state, then oops occurs. Link: https://lore.kernel.org/linux-trace-kernel/202307191558478409990@zte.com.cn Signed-off-by: Chen Lin Signed-off-by: Steven Rostedt (Google) commit 1faf7e4a0b6ff13d50c45b4b3469fc125536cf37 Author: YueHaibing Date: Sat Jul 22 11:21:23 2023 +0800 tracing: Remove unused extern declaration tracing_map_set_field_descr() Since commit 08d43a5fa063 ("tracing: Add lock-free tracing_map"), this is never used, so can be removed. Link: https://lore.kernel.org/linux-trace-kernel/20230722032123.24664-1-yuehaibing@huawei.com Cc: Signed-off-by: YueHaibing Signed-off-by: Steven Rostedt (Google) commit 0817d2599cfe894fa4ded7dbaa2b06111f2609b5 Author: Alexey Dobriyan Date: Thu Jul 13 21:52:28 2023 +0300 kbuild: flatten KBUILD_CFLAGS Make it slightly easier to see which compiler options are added and removed (and not worry about column limit too!). Signed-off-by: Alexey Dobriyan Reviewed-by: Nicolas Schier Signed-off-by: Masahiro Yamada commit 1c67921444bf68107f7901d5bcfce954efaa8754 Author: Benjamin Gray Date: Wed Jul 19 13:19:12 2023 +1000 gen_compile_commands: add assembly files to compilation database Like C source files, tooling can find it useful to have the assembly source file compilation recorded. The .S extension appears to used across all architectures. Signed-off-by: Benjamin Gray Reviewed-by: Fangrui Song Reviewed-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 6811694eb2f6b7a4e97be2029edc7dd6a39460f8 Author: Alejandro Tafalla Date: Fri Jul 14 17:31:26 2023 +0200 iio: imu: lsm6dsx: Fix mount matrix retrieval The function lsm6dsx_get_acpi_mount_matrix should return an error when ACPI support is not enabled to allow executing iio_read_mount_matrix in the probe function. Fixes: dc3d25f22b88 ("iio: imu: lsm6dsx: Add ACPI mount matrix retrieval") Signed-off-by: Alejandro Tafalla Acked-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/20230714153132.27265-1-atafalla@dnyon.com Signed-off-by: Jonathan Cameron commit 9d3de7ee192a6a253f475197fe4d2e2af10a731f Author: Ojaswin Mujoo Date: Sat Jul 22 22:45:24 2023 +0530 ext4: fix rbtree traversal bug in ext4_mb_use_preallocated During allocations, while looking for preallocations(PA) in the per inode rbtree, we can't do a direct traversal of the tree because ext4_mb_discard_group_preallocation() can paralelly mark the pa deleted and that can cause direct traversal to skip some entries. This was leading to a BUG_ON() being hit [1] when we missed a PA that could satisfy our request and ultimately tried to create a new PA that would overlap with the missed one. To makes sure we handle that case while still keeping the performance of the rbtree, we make use of the fact that the only pa that could possibly overlap the original goal start is the one that satisfies the below conditions: 1. It must have it's logical start immediately to the left of (ie less than) original logical start. 2. It must not be deleted To find this pa we use the following traversal method: 1. Descend into the rbtree normally to find the immediate neighboring PA. Here we keep descending irrespective of if the PA is deleted or if it overlaps with our request etc. The goal is to find an immediately adjacent PA. 2. If the found PA is on right of original goal, use rb_prev() to find the left adjacent PA. 3. Check if this PA is deleted and keep moving left with rb_prev() until a non deleted PA is found. 4. This is the PA we are looking for. Now we can check if it can satisfy the original request and proceed accordingly. This approach also takes care of having deleted PAs in the tree. (While we are at it, also fix a possible overflow bug in calculating the end of a PA) [1] https://lore.kernel.org/linux-ext4/CA+G9fYv2FRpLqBZf34ZinR8bU2_ZRAUOjKAD3+tKRFaEQHtt8Q@mail.gmail.com/ Cc: stable@kernel.org # 6.4 Fixes: 3872778664e3 ("ext4: Use rbtrees to manage PAs instead of inode i_prealloc_list") Signed-off-by: Ojaswin Mujoo Reported-by: Naresh Kamboju Reviewed-by: Ritesh Harjani (IBM) ritesh.list@gmail.com Tested-by: Ritesh Harjani (IBM) ritesh.list@gmail.com Link: https://lore.kernel.org/r/edd2efda6a83e6343c5ace9deea44813e71dbe20.1690045963.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 5d5460fa7932bed3a9082a6a8852cfbdb46acbe8 Author: Ojaswin Mujoo Date: Fri Jun 9 16:04:03 2023 +0530 ext4: fix off by one issue in ext4_mb_choose_next_group_best_avail() In ext4_mb_choose_next_group_best_avail(), we want the start order to be 1 less than goal length and the min_order to be, at max, 1 more than the original length. This commit fixes an off by one issue that arose due to the fact that 1 << fls(n) > (n). After all the processing: order = 1 order below goal len min_order = maximum of the three:- - order - trim_order - 1 order below B2C(s_stripe) - 1 order above original len Cc: stable@kernel.org Fixes: 33122aa930 ("ext4: Add allocation criteria 1.5 (CR1_5)") Signed-off-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230609103403.112807-1-ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 6909cf5c4101214f4305a62d582a5b93c7e1eb9a Author: Eric Whitney Date: Mon May 22 14:15:20 2023 -0400 ext4: correct inline offset when handling xattrs in inode body When run on a file system where the inline_data feature has been enabled, xfstests generic/269, generic/270, and generic/476 cause ext4 to emit error messages indicating that inline directory entries are corrupted. This occurs because the inline offset used to locate inline directory entries in the inode body is not updated when an xattr in that shared region is deleted and the region is shifted in memory to recover the space it occupied. If the deleted xattr precedes the system.data attribute, which points to the inline directory entries, that attribute will be moved further up in the region. The inline offset continues to point to whatever is located in system.data's former location, with unfortunate effects when used to access directory entries or (presumably) inline data in the inode body. Cc: stable@kernel.org Signed-off-by: Eric Whitney Link: https://lore.kernel.org/r/20230522181520.1570360-1-enwlinux@gmail.com Signed-off-by: Theodore Ts'o commit c7b75bea853daeb64fc831dbf39a6bbabcc402ac Author: Jiawen Wu Date: Wed Jul 19 17:22:33 2023 +0800 net: phy: marvell10g: fix 88x3310 power up Clear MV_V2_PORT_CTRL_PWRDOWN bit to set power up for 88x3310 PHY, it sometimes does not take effect immediately. And a read of this register causes the bit not to clear. This will cause mv3310_reset() to time out, which will fail the config initialization. So add a delay before the next access. Fixes: c9cc1c815d36 ("net: phy: marvell10g: place in powersave mode at probe") Signed-off-by: Jiawen Wu Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit c2782531397f5cb19ca3f8f9c17727f1cdf5bee8 Merge: 295e1388de2d5 106ea7ffd56b0 Author: Linus Torvalds Date: Sat Jul 22 19:32:00 2023 -0700 Merge tag 'powerpc-6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Reinstate support for little endian ELFv1 binaries, which it turns out still exist in the wild. - Revert a change which used asm goto for WARN_ON/__WARN_FLAGS, as it lead to dead code generation and seemed to trigger compiler bugs in some edge cases. - Fix a deadlock in the pseries VAS code, between live migration and the driver's mmap handler. - Disable KCOV instrumentation in the powerpc KASAN code. Thanks to Andrew Donnellan, Benjamin Gray, Christophe Leroy, Haren Myneni, Russell Currey, and Uwe Kleine-König. * tag 'powerpc-6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: Revert "powerpc/64s: Remove support for ELFv1 little endian userspace" powerpc/kasan: Disable KCOV in KASAN code powerpc/512x: lpbfifo: Convert to platform remove callback returning void powerpc/crypto: Add gitignore for generated P10 AES/GCM .S files Revert "powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto" powerpc/pseries/vas: Hold mmap_mutex after mmap lock during window close commit ba61a03af29a5f305cb301eb83b42578474508f7 Author: Steve French Date: Thu Jul 20 08:30:32 2023 -0500 cifs: update internal module version number for cifs.ko From 2.43 to 2.44 Signed-off-by: Steve French commit b3edef6b9cd0b8893a5649ab1fa8bce71045d139 Author: Shyam Prasad N Date: Fri Jun 16 10:37:46 2023 +0000 cifs: allow dumping keys for directories too Dumping the enc/dec keys is a session wide operation. And it should not matter if the ioctl was run on a regular file or a directory. Currently, we obtain the tcon pointer from the cifs file handle. But since there's no dir open call in cifs, this is not populated for dirs. This change allows dumping of session keys using ioctl even for directories. To do this, we'll now get the tcon pointer from the superblock, and not from the file handle. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 295e1388de2d5c0c354adbd65d0319c5d636c222 Merge: f036d67c02b6f 4cfca532ddc34 Author: Linus Torvalds Date: Sat Jul 22 11:24:03 2023 -0700 Merge tag 's390-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Heiko Carstens: - Fix per vma lock fault handling: add missing !(fault & VM_FAULT_ERROR) check to fault handler to prevent error handling for return values that don't indicate an error - Use kfree_sensitive() instead of kfree() in paes crypto code to clear memory that may contain keys before freeing it - Fix reply buffer size calculation for CCA replies in zcrypt device driver * tag 's390-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/zcrypt: fix reply buffer calculations for CCA replies s390/crypto: use kfree_sensitive() instead of kfree() s390/mm: fix per vma lock fault handling commit f036d67c02b6f6966b0d45e9a16c9f2e7ede80a3 Merge: bdd1d82e7d02b bb5faa99f0ce4 Author: Linus Torvalds Date: Sat Jul 22 11:05:15 2023 -0700 Merge tag 'block-6.5-2023-07-21' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - Fix for loop regressions (Mauricio) - Fix a potential stall with batched wakeups in sbitmap (David) - Fix for stall with recursive plug flushes (Ross) - Skip accounting of empty requests for blk-iocost (Chengming) - Remove a dead field in struct blk_mq_hw_ctx (Chengming) * tag 'block-6.5-2023-07-21' of git://git.kernel.dk/linux: loop: do not enforce max_loop hard limit by (new) default loop: deprecate autoloading callback loop_probe() sbitmap: fix batching wakeup blk-iocost: skip empty flush bio in iocost blk-mq: delete dead struct blk_mq_hw_ctx->queued field blk-mq: Fix stall due to recursive flush plug commit bdd1d82e7d02bd2764a68a5cc54533dfc2ba452a Merge: 725d444db6b0a 07e981137f17e Author: Linus Torvalds Date: Sat Jul 22 10:46:30 2023 -0700 Merge tag 'io_uring-6.5-2023-07-21' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: - Fix for io-wq not always honoring REQ_F_NOWAIT, if it was set and punted directly (eg via DRAIN) (me) - Capability check fix (Ondrej) - Regression fix for the mmap changes that went into 6.4, which apparently broke IA64 (Helge) * tag 'io_uring-6.5-2023-07-21' of git://git.kernel.dk/linux: ia64: mmap: Consider pgoff when searching for free mapping io_uring: Fix io_uring mmap() by using architecture-provided get_unmapped_area() io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq io_uring: don't audit the capability check in io_uring_create() commit 725d444db6b0a8ed98461583ed1e6f12b8a7f0e9 Merge: 39b1428639ed2 ffc59c6414f9f Author: Linus Torvalds Date: Sat Jul 22 10:28:22 2023 -0700 Merge tag 'devicetree-fixes-for-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Fix moortec,mr75203 schema usage of 'multipleOf' keyword - Fix regression in systems depending on "of-display" device name - Build fix for s390 with CONFIG_PCI=n and OF_EARLY_FLATTREE=y - Drop two obsolete serial .txt bindings * tag 'devicetree-fixes-for-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: serial: Remove obsolete nxp,lpc1850-uart.txt dt-bindings: serial: Remove obsolete cavium-uart.txt dt-bindings: hwmon: moortec,mr75203: fix multipleOf for coefficients of: Preserve "of-display" device name for compatibility of: make OF_EARLY_FLATTREE depend on HAS_IOMEM commit 39b1428639ed2224832234f48bfce991786aa4df Merge: c0842db5e5244 a9e26169cfda6 Author: Linus Torvalds Date: Sat Jul 22 10:20:56 2023 -0700 Merge tag 'regmap-fix-v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fixes from Mark Brown: "Three fixes here: - The issues with accounting for register and padding length on raw buses turn out to be quite widespread in custom buses. In order to avoid disturbing anything drop the initial fixes and fall back to a point fix in the SMBus code where the issue was originally noticed, a more substantial refactoring of the API which ensures that all buses make the same assumptions will follow. - The generic regcache code had been forcing on async I/O which did not work with the new maple tree sync code when used with SPI. Since that was mainly for the rbtree cache and the assumptions about hardware that drove the choice are probably not true any more fix this by pushing the enablement of async down into the rbtree code. This probably also makes cache syncs for systems faster though it's not the point. - The test code was triggering use of the rbtree and maple tree caches with dynamic allocation of nodes since all the testing is with RAM backed caches with no I/O performance issues. Just disable the locking in the tests to avoid triggering warnings when allocation debugging is turned on, it's not really what's being tested" * tag 'regmap-fix-v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: Disable locking for RBTREE and MAPLE unit tests regcache: Push async I/O request down into the rbtree cache regmap: Account for register length in SMBus I/O limits regmap: Drop initial version of maximum transfer length fixes commit c0842db5e52441174f347dd185bb06e841d7cfab Merge: d192f5382581d 644ee70267a93 Author: Linus Torvalds Date: Sat Jul 22 10:14:04 2023 -0700 Merge tag 'gpio-fixes-for-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix initial value handling for output-only pins in gpio-tps68470 - fix two resource leaks in gpio-mvebu * tag 'gpio-fixes-for-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: mvebu: fix irq domain leak gpio: mvebu: Make use of devm_pwmchip_add gpio: tps68470: Make tps68470_gpio_output() always set the initial value commit 09738ccbc4148c62d6c8c4644ff4a099d57f49ad Author: George Stark Date: Fri Jul 21 13:23:08 2023 +0300 iio: adc: meson: fix core clock enable/disable moment Enable core clock at probe stage and disable it at remove stage. Core clock is responsible for turning on/off the entire SoC module so it should be on before the first module register is touched and be off at very last moment. Fixes: 3adbf3427330 ("iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs") Signed-off-by: George Stark Link: https://lore.kernel.org/r/20230721102413.255726-2-gnstark@sberdevices.ru Cc: Signed-off-by: Jonathan Cameron commit b2a69969908fcaf68596dfc04369af0fe2e1d2f7 Author: Milan Zamazal Date: Wed Jul 19 10:32:08 2023 +0200 iio: core: Prevent invalid memory access when there is no parent Commit 813665564b3d ("iio: core: Convert to use firmware node handle instead of OF node") switched the kind of nodes to use for label retrieval in device registration. Probably an unwanted change in that commit was that if the device has no parent then NULL pointer is accessed. This is what happens in the stock IIO dummy driver when a new entry is created in configfs: # mkdir /sys/kernel/config/iio/devices/dummy/foo BUG: kernel NULL pointer dereference, address: ... ... Call Trace: __iio_device_register iio_dummy_probe Since there seems to be no reason to make a parent device of an IIO dummy device mandatory, let’s prevent the invalid memory access in __iio_device_register when the parent device is NULL. With this change, the IIO dummy driver works fine with configfs. Fixes: 813665564b3d ("iio: core: Convert to use firmware node handle instead of OF node") Reviewed-by: Andy Shevchenko Signed-off-by: Milan Zamazal Link: https://lore.kernel.org/r/20230719083208.88149-1-mzamazal@redhat.com Signed-off-by: Jonathan Cameron commit 507397d19b5a296aa339f7a1bd16284f668a1906 Author: Dan Carpenter Date: Tue Jul 18 10:02:18 2023 +0300 iio: frequency: admv1013: propagate errors from regulator_get_voltage() The regulator_get_voltage() function returns negative error codes. This function saves it to an unsigned int and then does some range checking and, since the error code falls outside the correct range, it returns -EINVAL. Beyond the messiness, this is bad because the regulator_get_voltage() function can return -EPROBE_DEFER and it's important to propagate that back properly so it can be handled. Fixes: da35a7b526d9 ("iio: frequency: admv1013: add support for ADMV1013") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/ce75aac3-2aba-4435-8419-02e59fdd862b@moroto.mountain Cc: Signed-off-by: Jonathan Cameron commit fd470a8beed88440b160d690344fbae05a0b9b1b Author: Kim Phillips Date: Thu Jul 20 14:47:27 2023 -0500 x86/cpu: Enable STIBP on AMD if Automatic IBRS is enabled Unlike Intel's Enhanced IBRS feature, AMD's Automatic IBRS does not provide protection to processes running at CPL3/user mode, see section "Extended Feature Enable Register (EFER)" in the APM v2 at https://bugzilla.kernel.org/attachment.cgi?id=304652 Explicitly enable STIBP to protect against cross-thread CPL3 branch target injections on systems with Automatic IBRS enabled. Also update the relevant documentation. Fixes: e7862eda309e ("x86/cpu: Support AMD Automatic IBRS") Reported-by: Tom Lendacky Signed-off-by: Kim Phillips Signed-off-by: Borislav Petkov (AMD) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230720194727.67022-1-kim.phillips@amd.com commit 3ba2e83334bed2b1980b59734e6e84dfaf96026c Author: Yazen Ghannam Date: Mon Jun 6 19:45:56 2022 +0000 x86/MCE/AMD: Decrement threshold_bank refcount when removing threshold blocks AMD systems from Family 10h to 16h share MCA bank 4 across multiple CPUs. Therefore, the threshold_bank structure for bank 4, and its threshold_block structures, will be initialized once at boot time. And the kobject for the shared bank will be added to each of the CPUs that share it. Furthermore, the threshold_blocks for the shared bank will be added again to the bank's kobject. These additions will increase the refcount for the bank's kobject. For example, a shared bank with two blocks and shared across two CPUs will be set up like this: CPU0 init bank create and add; bank refcount = 1; threshold_create_bank() block 0 init and add; bank refcount = 2; allocate_threshold_blocks() block 1 init and add; bank refcount = 3; allocate_threshold_blocks() CPU1 init bank add; bank refcount = 3; threshold_create_bank() block 0 add; bank refcount = 4; __threshold_add_blocks() block 1 add; bank refcount = 5; __threshold_add_blocks() Currently in threshold_remove_bank(), if the bank is shared then __threshold_remove_blocks() is called. Here the shared bank's kobject and the bank's blocks' kobjects are deleted. This is done on the first call even while the structures are still shared. Subsequent calls from other CPUs that share the structures will attempt to delete the kobjects. During kobject_del(), kobject->sd is removed. If the kobject is not part of a kset with default_groups, then subsequent kobject_del() calls seem safe even with kobject->sd == NULL. Originally, the AMD MCA thresholding structures did not use default_groups. And so the above behavior was not apparent. However, a recent change implemented default_groups for the thresholding structures. Therefore, kobject_del() will go down the sysfs_remove_groups() code path. In this case, the first kobject_del() may succeed and remove kobject->sd. But subsequent kobject_del() calls will give a WARNing in kernfs_remove_by_name_ns() since kobject->sd == NULL. Use kobject_put() on the shared bank's kobject when "removing" blocks. This decrements the bank's refcount while keeping kobjects enabled until the bank is no longer shared. At that point, kobject_put() will be called on the blocks which drives their refcount to 0 and deletes them and also decrementing the bank's refcount. And finally kobject_put() will be called on the bank driving its refcount to 0 and deleting it. The same example above: CPU1 shutdown bank is shared; bank refcount = 5; threshold_remove_bank() block 0 put parent bank; bank refcount = 4; __threshold_remove_blocks() block 1 put parent bank; bank refcount = 3; __threshold_remove_blocks() CPU0 shutdown bank is no longer shared; bank refcount = 3; threshold_remove_bank() block 0 put block; bank refcount = 2; deallocate_threshold_blocks() block 1 put block; bank refcount = 1; deallocate_threshold_blocks() put bank; bank refcount = 0; threshold_remove_bank() Fixes: 7f99cb5e6039 ("x86/CPU/AMD: Use default_groups in kobj_type") Reported-by: Mikulas Patocka Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov (AMD) Tested-by: Mikulas Patocka Cc: Link: https://lore.kernel.org/r/alpine.LRH.2.02.2205301145540.25840@file01.intranet.prod.int.rdu2.redhat.com commit 32ad45b76990ece9c5dd1fe7aae6e688c3baa647 Author: Jakub Kicinski Date: Thu Jul 20 09:13:23 2023 -0700 docs: net: clarify the NAPI rules around XDP Tx page pool and XDP should not be accessed from IRQ context which may happen if drivers try to clean up XDP TX with NAPI budget of 0. Link: https://lore.kernel.org/r/20230720161323.2025379-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 81ac7e5d741742d650b4ed6186c4826c1a0631a7 Author: Daniel Sneddon Date: Wed Jul 12 19:43:14 2023 -0700 KVM: Add GDS_NO support to KVM Gather Data Sampling (GDS) is a transient execution attack using gather instructions from the AVX2 and AVX512 extensions. This attack allows malicious code to infer data that was previously stored in vector registers. Systems that are not vulnerable to GDS will set the GDS_NO bit of the IA32_ARCH_CAPABILITIES MSR. This is useful for VM guests that may think they are on vulnerable systems that are, in fact, not affected. Guests that are running on affected hosts where the mitigation is enabled are protected as if they were running on an unaffected system. On all hosts that are not affected or that are mitigated, set the GDS_NO bit. Signed-off-by: Daniel Sneddon Signed-off-by: Dave Hansen Acked-by: Josh Poimboeuf commit 53cf5797f114ba2bd86d23a862302119848eff19 Author: Daniel Sneddon Date: Wed Jul 12 19:43:13 2023 -0700 x86/speculation: Add Kconfig option for GDS Gather Data Sampling (GDS) is mitigated in microcode. However, on systems that haven't received the updated microcode, disabling AVX can act as a mitigation. Add a Kconfig option that uses the microcode mitigation if available and disables AVX otherwise. Setting this option has no effect on systems not affected by GDS. This is the equivalent of setting gather_data_sampling=force. Signed-off-by: Daniel Sneddon Signed-off-by: Dave Hansen Acked-by: Josh Poimboeuf commit 553a5c03e90a6087e88f8ff878335ef0621536fb Author: Daniel Sneddon Date: Wed Jul 12 19:43:12 2023 -0700 x86/speculation: Add force option to GDS mitigation The Gather Data Sampling (GDS) vulnerability allows malicious software to infer stale data previously stored in vector registers. This may include sensitive data such as cryptographic keys. GDS is mitigated in microcode, and systems with up-to-date microcode are protected by default. However, any affected system that is running with older microcode will still be vulnerable to GDS attacks. Since the gather instructions used by the attacker are part of the AVX2 and AVX512 extensions, disabling these extensions prevents gather instructions from being executed, thereby mitigating the system from GDS. Disabling AVX2 is sufficient, but we don't have the granularity to do this. The XCR0[2] disables AVX, with no option to just disable AVX2. Add a kernel parameter gather_data_sampling=force that will enable the microcode mitigation if available, otherwise it will disable AVX on affected systems. This option will be ignored if cmdline mitigations=off. This is a *big* hammer. It is known to break buggy userspace that uses incomplete, buggy AVX enumeration. Unfortunately, such userspace does exist in the wild: https://www.mail-archive.com/bug-coreutils@gnu.org/msg33046.html [ dhansen: add some more ominous warnings about disabling AVX ] Signed-off-by: Daniel Sneddon Signed-off-by: Dave Hansen Acked-by: Josh Poimboeuf commit ffc59c6414f9ffd52591786efe3e62e145563deb Author: Rob Herring Date: Fri Jul 7 16:16:06 2023 -0600 dt-bindings: serial: Remove obsolete nxp,lpc1850-uart.txt nxp,lpc1850-uart.txt binding is already covered by 8250.yaml, so remove it. Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230707221607.1064888-1-robh@kernel.org Signed-off-by: Rob Herring commit 5921181cf95aa7d0fe4f008a3d472cc5cb86bde5 Author: Rob Herring Date: Fri Jul 7 16:16:02 2023 -0600 dt-bindings: serial: Remove obsolete cavium-uart.txt cavium-uart.txt binding is already covered by 8250.yaml, so remove it. Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230707221602.1063972-1-robh@kernel.org Signed-off-by: Rob Herring commit bb5faa99f0ce40756ab7bbbce4f16c01ca5ebd5a Author: Mauricio Faria de Oliveira Date: Thu Jul 20 11:30:33 2023 -0300 loop: do not enforce max_loop hard limit by (new) default Problem: The max_loop parameter is used for 2 different purposes: 1) initial number of loop devices to pre-create on init 2) maximum number of loop devices to add on access/open() Historically, its default value (zero) caused 1) to create non-zero number of devices (CONFIG_BLK_DEV_LOOP_MIN_COUNT), and no hard limit on 2) to add devices with autoloading. However, the default value changed in commit 85c50197716c ("loop: Fix the max_loop commandline argument treatment when it is set to 0") to CONFIG_BLK_DEV_LOOP_MIN_COUNT, for max_loop=0 not to pre-create devices. That does improve 1), but unfortunately it breaks 2), as the default behavior changed from no-limit to hard-limit. Example: For example, this userspace code broke for N >= CONFIG, if the user relied on the default value 0 for max_loop: mknod("/dev/loopN"); open("/dev/loopN"); // now fails with ENXIO Though affected users may "fix" it with (loop.)max_loop=0, this means to require a kernel parameter change on stable kernel update (that commit Fixes: an old commit in stable). Solution: The original semantics for the default value in 2) can be applied if the parameter is not set (ie, default behavior). This still keeps the intended function in 1) and 2) if set, and that commit's intended improvement in 1) if max_loop=0. Before 85c50197716c: - default: 1) CONFIG devices 2) no limit - max_loop=0: 1) CONFIG devices 2) no limit - max_loop=X: 1) X devices 2) X limit After 85c50197716c: - default: 1) CONFIG devices 2) CONFIG limit (*) - max_loop=0: 1) 0 devices (*) 2) no limit - max_loop=X: 1) X devices 2) X limit This commit: - default: 1) CONFIG devices 2) no limit (*) - max_loop=0: 1) 0 devices 2) no limit - max_loop=X: 1) X devices 2) X limit Future: The issue/regression from that commit only affects code under the CONFIG_BLOCK_LEGACY_AUTOLOAD deprecation guard, thus the fix too is contained under it. Once that deprecated functionality/code is removed, the purpose 2) of max_loop (hard limit) is no longer in use, so the module parameter description can be changed then. Tests: Linux 6.4-rc7 CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 CONFIG_BLOCK_LEGACY_AUTOLOAD=y - default (original) # ls -1 /dev/loop* /dev/loop-control /dev/loop0 ... /dev/loop7 # ./test-loop open: /dev/loop8: No such device or address - default (patched) # ls -1 /dev/loop* /dev/loop-control /dev/loop0 ... /dev/loop7 # ./test-loop # - max_loop=0 (original & patched): # ls -1 /dev/loop* /dev/loop-control # ./test-loop # - max_loop=8 (original & patched): # ls -1 /dev/loop* /dev/loop-control /dev/loop0 ... /dev/loop7 # ./test-loop open: /dev/loop8: No such device or address - max_loop=0 (patched; CONFIG_BLOCK_LEGACY_AUTOLOAD is not set) # ls -1 /dev/loop* /dev/loop-control # ./test-loop open: /dev/loop8: No such device or address Fixes: 85c50197716c ("loop: Fix the max_loop commandline argument treatment when it is set to 0") Signed-off-by: Mauricio Faria de Oliveira Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230720143033.841001-3-mfo@canonical.com Signed-off-by: Jens Axboe commit 23881aec85f3219e8462e87c708815ee2cd82358 Author: Mauricio Faria de Oliveira Date: Thu Jul 20 11:30:32 2023 -0300 loop: deprecate autoloading callback loop_probe() The 'probe' callback in __register_blkdev() is only used under the CONFIG_BLOCK_LEGACY_AUTOLOAD deprecation guard. The loop_probe() function is only used for that callback, so guard it too, accordingly. See commit fbdee71bb5d8 ("block: deprecate autoloading based on dev_t"). Signed-off-by: Mauricio Faria de Oliveira Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230720143033.841001-2-mfo@canonical.com Signed-off-by: Jens Axboe commit 106397376c0369fcc01c58dd189ff925a2724a57 Author: David Jeffery Date: Fri Jul 21 17:57:15 2023 +0800 sbitmap: fix batching wakeup Current code supposes that it is enough to provide forward progress by just waking up one wait queue after one completion batch is done. Unfortunately this way isn't enough, cause waiter can be added to wait queue just after it is woken up. Follows one example(64 depth, wake_batch is 8) 1) all 64 tags are active 2) in each wait queue, there is only one single waiter 3) each time one completion batch(8 completions) wakes up just one waiter in each wait queue, then immediately one new sleeper is added to this wait queue 4) after 64 completions, 8 waiters are wakeup, and there are still 8 waiters in each wait queue 5) after another 8 active tags are completed, only one waiter can be wakeup, and the other 7 can't be waken up anymore. Turns out it isn't easy to fix this problem, so simply wakeup enough waiters for single batch. Cc: Kemeng Shi Cc: Chengming Zhou Cc: Jan Kara Signed-off-by: David Jeffery Signed-off-by: Ming Lei Reviewed-by: Gabriel Krisman Bertazi Reviewed-by: Keith Busch Link: https://lore.kernel.org/r/20230721095715.232728-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit d192f5382581d972c4ae1b4d72e0b59b34cadeb9 Merge: 892d7c1b29555 d4d5be94a8787 Author: Linus Torvalds Date: Fri Jul 21 10:24:21 2023 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "I've picked up a handful of arm64 fixes while Catalin's been away, so here they are. Below is the usual summary, but we have basically have two cleanups, a fix for an SME crash and a fix for hibernation: - Fix saving of SME state after SVE vector length is changed - Fix sparse warnings for missing vDSO function prototypes - Fix hibernation resume path when kfence is enabled - Fix field names for the HFGxTR_EL2 register" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes arm64: vdso: Clear common make C=2 warnings arm64: mm: Make hibernation aware of KFENCE arm64: Fix HFGxTR_EL2 field naming commit 892d7c1b29555cd145f0bf85818148c47bb7ac16 Merge: 3c05547a5fab4 5534f44627418 Author: Linus Torvalds Date: Fri Jul 21 10:16:20 2023 -0700 Merge tag 'pm-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "Revert three recent intel_idle commits that introduced a functional issue, included a coding mistake and have been questioned at the design level" * tag 'pm-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: Revert "intel_idle: Add support for using intel_idle in a VM guest using just hlt" Revert "intel_idle: Add a "Long HLT" C1 state for the VM guest mode" Revert "intel_idle: Add __init annotation to matchup_vm_state_with_baremetal()" commit 3c05547a5fab4ca2777afcb61a69ce68f5ef8a6a Merge: 55c225fbd8532 5f69c65e07b99 Author: Linus Torvalds Date: Fri Jul 21 10:10:18 2023 -0700 Merge tag 'sound-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A pile of fixes that have been gathered since the previous pull. Most of changes are device-specific, and nothing looks too scary. - A memory leak fix in ALSA sequencer code in 6.5-rc - Many fixes for ASoC Qualcomm CODEC drivers, covering SoundWire probe problems - A series of ASoC AMD fixes - A few fixes and cleanups of selftest stuff - HD-audio codec fixes and quirks for Clevo, HP, Lenovo, Dell" * tag 'sound-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (52 commits) ALSA: hda/realtek: Add support for DELL Oasis 13/14/16 laptops ALSA: hda/realtek: Fix generic fixup definition for cs35l41 amp ALSA: hda/realtek: Enable Mute LED on HP Laptop 15s-eq2xxx selftests: ALSA: Add test-pcmtest-driver to .gitignore ALSA: hda/realtek: Add quirk for Clevo NS70AU ASoC: fsl_sai: Disable bit clock with transmitter ALSA: seq: Fix memory leak at error path in snd_seq_create_port() ASoC: SOF: ipc3-dtrace: uninitialized data in dfsentry_trace_filter_write() ASoC: cs42l51: fix driver to properly autoload with automatic module loading MAINTAINERS: Redo addition of ssm3515 to APPLE SOUND ASoC: rt5640: Fix the issue of speaker noise ALSA: hda/realtek - remove 3k pull low procedure selftests: ALSA: Fix fclose on an already fclosed file pointer ALSA: pcmtest: Don't use static storage to track per device data ALSA: pcmtest: Convert to platform remove callback returning void ASoC: dt-bindings: audio-graph-card2: Drop incomplete example ASoC: dt-bindings: Update maintainer email id ASoC: amd: ps: Fix extraneous error messages ASoC: fsl_sai: Revert "ASoC: fsl_sai: Enable MCTL_MCLK_EN bit for master mode" ASoC: codecs: SND_SOC_WCD934X should select REGMAP_IRQ ... commit 55c225fbd8532a1bac6fd93c5085031650083a4a Merge: 4e076c73e4f6e e8812acb5bf72 Author: Linus Torvalds Date: Fri Jul 21 10:00:09 2023 -0700 Merge tag 'fbdev-for-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev fixes and cleanups from Helge Deller: "Just the usual bunch of code cleanups in various drivers, this time mostly in vgacon and imxfb: - Code cleanup in vgacon (Jiri Slaby) - Explicitly include correct DT includes (Rob Herring) - imxfb code cleanup (Yangtao Li, Martin Kaiser) - kyrofb: make arrays const and smaller (Colin Ian King) - ep93xx-fb: return value check fix (Yuanjun Gong) - au1200fb: add missing IRQ check (Zhang Shurong)" * tag 'fbdev-for-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbdev: Explicitly include correct DT includes fbdev: ep93xx-fb: fix return value check in ep93xxfb_probe fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe fbdev: kyro: make some const read-only arrays static and reduce type size fbcon: remove unused display (p) from fbcon_redraw() sticon: make sticon_set_def_font() void and remove op parameter vgacon: cache vc_cell_height in vgacon_cursor() vgacon: let vgacon_doresize() return void vgacon: remove unused xpos from vgacon_set_cursor_size() vgacon: remove unneeded forward declarations vgacon: switch vgacon_scrolldelta() and vgacon_restore_screen() fbdev: imxfb: remove unneeded labels fbdev: imxfb: Convert to devm_platform_ioremap_resource() fbdev: imxfb: Convert to devm_kmalloc_array() fbdev: imxfb: Removed unneeded release_mem_region fbdev: imxfb: switch to DEFINE_SIMPLE_DEV_PM_OPS fbdev: imxfb: warn about invalid left/right margin commit 4e076c73e4f6e90816b30fcd4a0d7ab365087255 Author: Daniel Vetter Date: Fri Jul 21 15:58:38 2023 +0200 drm/atomic: Fix potential use-after-free in nonblocking commits This requires a bit of background. Properly done a modeset driver's unload/remove sequence should be drm_dev_unplug(); drm_atomic_helper_shutdown(); drm_dev_put(); The trouble is that the drm_dev_unplugged() checks are by design racy, they do not synchronize against all outstanding ioctl. This is because those ioctl could block forever (both for modeset and for driver specific ioctls), leading to deadlocks in hotunplug. Instead the code sections that touch the hardware need to be annotated with drm_dev_enter/exit, to avoid accessing hardware resources after the unload/remove has finished. To avoid use-after-free issues all the involved userspace visible objects are supposed to hold a reference on the underlying drm_device, like drm_file does. The issue now is that we missed one, the atomic modeset ioctl can be run in a nonblocking fashion, and in that case it cannot rely on the implied drm_device reference provided by the ioctl calling context. This can result in a use-after-free if an nonblocking atomic commit is carefully raced against a driver unload. Fix this by unconditionally grabbing a drm_device reference for any drm_atomic_state structures. Strictly speaking this isn't required for blocking commits and TEST_ONLY calls, but it's the simpler approach. Thanks to shanzhulig for the initial idea of grabbing an unconditional reference, I just added comments, a condensed commit message and fixed a minor potential issue in where exactly we drop the final reference. Reported-by: shanzhulig Suggested-by: shanzhulig Reviewed-by: Maxime Ripard Cc: Maarten Lankhorst Cc: Thomas Zimmermann Cc: David Airlie Cc: stable@kernel.org Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Linus Torvalds commit 91896c8acce23d33ed078cffd46a9534b1f82be5 Author: Jacob Keller Date: Mon Jul 10 13:41:28 2023 -0700 iavf: check for removal state before IAVF_FLAG_PF_COMMS_FAILED In iavf_adminq_task(), if the function can't acquire the adapter->crit_lock, it checks if the driver is removing. If so, it simply exits without re-enabling the interrupt. This is done to ensure that the task stops processing as soon as possible once the driver is being removed. However, if the IAVF_FLAG_PF_COMMS_FAILED is set, the function checks this before attempting to acquire the lock. In this case, the function exits early and re-enables the interrupt. This will happen even if the driver is already removing. Avoid this, by moving the check to after the adapter->crit_lock is acquired. This way, if the driver is removing, we will not re-enable the interrupt. Fixes: fc2e6b3b132a ("iavf: Rework mutexes for better synchronisation") Signed-off-by: Jacob Keller Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit a2f054c10bef0b54600ec9cb776508443e941343 Author: Jacob Keller Date: Mon Jul 10 13:41:27 2023 -0700 iavf: fix potential deadlock on allocation failure In iavf_adminq_task(), if kzalloc() fails to allocate the event.msg_buf, the function will exit without releasing the adapter->crit_lock. This is unlikely, but if it happens, the next access to that mutex will deadlock. Fix this by moving the unlock to the end of the function, and adding a new label to allow jumping to the unlock portion of the function exit flow. Fixes: fc2e6b3b132a ("iavf: Rework mutexes for better synchronisation") Signed-off-by: Jacob Keller Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 043b1f185fb0f3939b7427f634787706f45411c4 Author: Wang Ming Date: Thu Jul 13 09:42:39 2023 +0800 i40e: Fix an NULL vs IS_ERR() bug for debugfs_create_dir() The debugfs_create_dir() function returns error pointers. It never returns NULL. Most incorrect error checks were fixed, but the one in i40e_dbg_init() was forgotten. Fix the remaining error check. Fixes: 02e9c290814c ("i40e: debugfs interface") Signed-off-by: Wang Ming Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 07e981137f17e5275b6fa5fd0c28b0ddb4519702 Author: Helge Deller Date: Fri Jul 21 17:24:32 2023 +0200 ia64: mmap: Consider pgoff when searching for free mapping IA64 is the only architecture which does not consider the pgoff value when searching for a possible free memory region with vm_unmapped_area(). Adding this seems to have no negative side effect on IA64, so add it now to make IA64 consistent with all other architectures. Cc: stable@vger.kernel.org # 6.4 Signed-off-by: Helge Deller Tested-by: matoro Cc: Andrew Morton Cc: linux-ia64@vger.kernel.org Link: https://lore.kernel.org/r/20230721152432.196382-3-deller@gmx.de Signed-off-by: Jens Axboe commit 32832a407a7178eec3215fad9b1a3298c14b0d69 Author: Helge Deller Date: Fri Jul 21 17:24:31 2023 +0200 io_uring: Fix io_uring mmap() by using architecture-provided get_unmapped_area() The io_uring testcase is broken on IA-64 since commit d808459b2e31 ("io_uring: Adjust mapping wrt architecture aliasing requirements"). The reason is, that this commit introduced an own architecture independend get_unmapped_area() search algorithm which finds on IA-64 a memory region which is outside of the regular memory region used for shared userspace mappings and which can't be used on that platform due to aliasing. To avoid similar problems on IA-64 and other platforms in the future, it's better to switch back to the architecture-provided get_unmapped_area() function and adjust the needed input parameters before the call. Beside fixing the issue, the function now becomes easier to understand and maintain. This patch has been successfully tested with the io_uring testcase on physical x86-64, ppc64le, IA-64 and PA-RISC machines. On PA-RISC the LTP mmmap testcases did not report any regressions. Cc: stable@vger.kernel.org # 6.4 Signed-off-by: Helge Deller Reported-by: matoro Fixes: d808459b2e31 ("io_uring: Adjust mapping wrt architecture aliasing requirements") Link: https://lore.kernel.org/r/20230721152432.196382-2-deller@gmx.de Signed-off-by: Jens Axboe commit f6ad3c13f1b8c4e785cb7bd423887197142f47b0 Author: Durai Manickam KR Date: Wed Jul 12 15:30:42 2023 +0530 ARM: dts: at91: sam9x60: fix the SOC detection Remove the dbgu compatible strings in the UART submodule of the flexcom for the proper SOC detection. Fixes: 99c808335877 (ARM: dts: at91: sam9x60: Add missing flexcom definitions) Signed-off-by: Durai Manickam KR Link: https://lore.kernel.org/r/20230712100042.317856-1-durai.manickamkr@microchip.com Signed-off-by: Arnd Bergmann commit b44c11d86b7a170e657030cbd4ff6067e233e8fb Author: Sudeep Holla Date: Tue Jul 11 10:26:17 2023 +0100 ARM: dts: nspire: Fix arm primecell compatible string Commit c44e0503e5fd ("docs: dt: fix documented Primecell compatible string") removed the last occurrence of incorrect "arm,amba-primecell" compatible string, but somehow one occurrence of the same is left in the nspire platform. Fix the same by replacing it with the correct "arm,primecell" compatible. Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Cc: devicetree@vger.kernel.org Signed-off-by: Sudeep Holla Link: https://lore.kernel.org/r/20230711092617.1412815-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 74d964097fb999c3b2346fba72f64c9e5ab77e22 Merge: fdf0eaf11452d d088d6b648f47 Author: Arnd Bergmann Date: Fri Jul 21 13:38:05 2023 +0200 Merge tag 'juno-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Armv8 Juno/Vexpress DTS fix for v6.5 A single simple fix removing dangling symlink left as part of arm dts files movement to vendor sub-directories. It is harmless and causes no issue for the build but scripts copying files see errors/failures. * tag 'juno-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: arm64: dts: arm: Remove the dangling vexpress-v2m-rs1.dtsi symlink Link: https://lore.kernel.org/r/20230721112359.3369716-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 59ea9138c0753d7af19f9eba0ee29b8b55cecaf2 Author: Wang Weiyang Date: Fri Jul 21 18:31:24 2023 +0800 ALSA: seq: remove redundant unsigned comparison to zero Since struct snd_ump_block_info::first_group is unsigned char, comparison to zero is redundant Signed-off-by: Wang Weiyang Fixes: 81fd444aa371 ("ALSA: seq: Bind UMP device") Link: https://lore.kernel.org/r/20230721103124.18522-1-wangweiyang2@huawei.com Signed-off-by: Takashi Iwai commit d4d5be94a87872421ea2569044092535aff0b886 Author: Mark Brown Date: Thu Jul 20 19:38:58 2023 +0100 arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes When we reconfigure the SVE vector length we discard the backing storage for the SVE vectors and then reallocate on next SVE use, leaving the SME specific state alone. This means that we do not enable SME traps if they were already disabled. That means that userspace code can enter streaming mode without trapping, putting the task in a state where if we try to save the state of the task we will fault. Since the ABI does not specify that changing the SVE vector length disturbs SME state, and since SVE code may not be aware of SME code in the process, we shouldn't simply discard any ZA state. Instead immediately reallocate the storage for SVE, and disable SME if we change the SVE vector length while there is no SME state active. Disabling SME traps on SVE vector length changes would make the overall code more complex since we would have a state where we have valid SME state stored but might get a SME trap. Fixes: 9e4ab6c89109 ("arm64/sme: Implement vector length configuration prctl()s") Reported-by: David Spickett Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230720-arm64-fix-sve-sme-vl-change-v2-1-8eea06b82d57@kernel.org Signed-off-by: Will Deacon commit 29b434d1e49252b3ad56ad3197e47fafff5356a1 Author: Ming Lei Date: Tue Jul 11 17:40:41 2023 +0800 nvme-rdma: fix potential unbalanced freeze & unfreeze Move start_freeze into nvme_rdma_configure_io_queues(), and there is at least two benefits: 1) fix unbalanced freeze and unfreeze, since re-connection work may fail or be broken by removal 2) IO during error recovery can be failfast quickly because nvme fabrics unquiesces queues after teardown. One side-effect is that !mpath request may timeout during connecting because of queue topo change, but that looks not one big deal: 1) same problem exists with current code base 2) compared with !mpath, mpath use case is dominant Fixes: 9f98772ba307 ("nvme-rdma: fix controller reset hang during traffic") Cc: stable@vger.kernel.org Signed-off-by: Ming Lei Tested-by: Yi Zhang Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 99dc264014d5aed66ee37ddf136a38b5a2b1b529 Author: Ming Lei Date: Tue Jul 11 17:40:40 2023 +0800 nvme-tcp: fix potential unbalanced freeze & unfreeze Move start_freeze into nvme_tcp_configure_io_queues(), and there is at least two benefits: 1) fix unbalanced freeze and unfreeze, since re-connection work may fail or be broken by removal 2) IO during error recovery can be failfast quickly because nvme fabrics unquiesces queues after teardown. One side-effect is that !mpath request may timeout during connecting because of queue topo change, but that looks not one big deal: 1) same problem exists with current code base 2) compared with !mpath, mpath use case is dominant Fixes: 2875b0aecabe ("nvme-tcp: fix controller reset hang during traffic") Cc: stable@vger.kernel.org Signed-off-by: Ming Lei Tested-by: Yi Zhang Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 1b95e817916069ec45a7f259d088fd1c091a8cc6 Author: Ming Lei Date: Tue Jul 11 17:40:39 2023 +0800 nvme: fix possible hang when removing a controller during error recovery Error recovery can be interrupted by controller removal, then the controller is left as quiesced, and IO hang can be caused. Fix the issue by unquiescing controller unconditionally when removing namespaces. This way is reasonable and safe given forward progress can be made when removing namespaces. Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reported-by: Chunguang Xu Closes: https://lore.kernel.org/linux-nvme/cover.1685350577.git.chunguang.xu@shopee.com/ Cc: stable@vger.kernel.org Signed-off-by: Ming Lei Signed-off-by: Keith Busch commit 70d49bbf962ce4579bebd82938ef7f265bc3e6ae Author: Xiao Yang Date: Thu Jul 20 00:31:03 2023 +0800 tools/testing/cxl: Remove unused SZ_512G macro SZ_512G macro has become useless since commit b2f3b74e1072 ("tools/testing/cxl: Move cxl_test resources to the top of memory") so remove it directly. Signed-off-by: Xiao Yang Link: https://lore.kernel.org/r/20230719163103.3392-1-yangx.jy@fujitsu.com Reviewed-by: Dave Jiang Signed-off-by: Vishal Verma commit f7e3a1bafdea735050dfde00523cf505dc7fd309 Merge: 12a5088eb138f 28801cc85906e Author: Linus Torvalds Date: Thu Jul 20 20:35:38 2023 -0700 Merge tag 'drm-fixes-2023-07-21' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Mostly amdgpu fixes, a couple of i915 fixes, some nouveau and then a few misc accel and other fixes. client: - memory leak fix dma-buf: - memory leak fix qaic: - bound check fixes - map_user_pages leak - int overflow fixes habanalabs: - debugfs stub helper nouveau: - aux event slot fixes - anx9805 cards fixes i915: - Add sentinel to xehp_oa_b_counters - Revert "drm/i915: use localized __diag_ignore_all() instead of per file" amdgpu: - More PCIe DPM fixes for Intel platforms - DCN3.0.1 fixes - Virtual display timer fix - Async flip fix - SMU13 clock reporting fixes - Add missing PSP firmware declaration - DP MST fix - DCN3.1.x fixes - Slab out of bounds fix" * tag 'drm-fixes-2023-07-21' of git://anongit.freedesktop.org/drm/drm: (31 commits) accel/habanalabs: add more debugfs stub helpers drm/nouveau/kms/nv50-: init hpd_irq_lock for PIOR DP drm/nouveau/disp: PIOR DP uses GPIO for HPD, not PMGR AUX interrupts drm/nouveau/i2c: fix number of aux event slots drm/amdgpu: use a macro to define no xcp partition case drm/amdgpu/vm: use the same xcp_id from root PD drm/amdgpu: fix slab-out-of-bounds issue in amdgpu_vm_pt_create drm/amdgpu: Allocate root PD on correct partition drm/amd/display: Keep PHY active for DP displays on DCN31 drm/amd/display: Prevent vtotal from being set to 0 drm/amd/display: Disable MPC split by default on special asic drm/amd/display: check TG is non-null before checking if enabled drm/amd/display: Add polling method to handle MST reply packet drm/amd/display: Clean up errors & warnings in amdgpu_dm.c drm/amdgpu: Allow the initramfs generator to include psp_13_0_6_ta drm/amdgpu/pm: make mclk consistent for smu 13.0.7 drm/amdgpu/pm: make gfxclock consistent for sienna cichlid drm/amd/display: only accept async flips for fast updates drm/amdgpu/vkms: relax timer deactivation by hrtimer_try_to_cancel drm/amd/display: add DCN301 specific logic for OTG programming ... commit 28801cc85906ea62043e62c71def7f9daaf1c168 Merge: 534a7915c6043 b13d3e9c6b625 Author: Dave Airlie Date: Fri Jul 21 12:16:41 2023 +1000 Merge tag 'amd-drm-fixes-6.5-2023-07-20' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.5-2023-07-20: amdgpu: - More PCIe DPM fixes for Intel platforms - DCN3.0.1 fixes - Virtual display timer fix - Async flip fix - SMU13 clock reporting fixes - Add missing PSP firmware declaration - DP MST fix - DCN3.1.x fixes - Slab out of bounds fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20230720133456.7826-1-alexander.deucher@amd.com commit 534a7915c6043c4abc3e4f44bc30576b361fa2e3 Merge: f4f19c03cfb99 2c27770a7bc88 Author: Dave Airlie Date: Fri Jul 21 12:15:09 2023 +1000 Merge tag 'drm-intel-fixes-2023-07-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Add sentinel to xehp_oa_b_counters [perf] (Andrzej Hajda) - Revert "drm/i915: use localized __diag_ignore_all() instead of per file" (Jani Nikula) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZLjuwhLhwab5B7RY@tursulin-desk commit f4f19c03cfb99b587cf35ff057be97cb98c5d251 Merge: 78e9b217d78e9 ea293f823a880 Author: Dave Airlie Date: Fri Jul 21 12:02:31 2023 +1000 Merge tag 'drm-misc-fixes-2023-07-20' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Memory leak fixes in drm/client, memory access/leak fixes for accel/qaic, another leak fix in dma-buf and three nouveau fixes around hotplugging. Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/fmj5nok7zggux2lcpdtls2iknweba54wfc6o4zxq6i6s3dgi2r@7z3eawwhyhen commit 12a5088eb138fbf14eaa0eea5fe6061c4341401c Merge: 57f1f9dd3abea cec148c2476a6 Author: Linus Torvalds Date: Thu Jul 20 19:10:50 2023 -0700 Merge tag 'ata-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fix from Damien Le Moal: - Add missing MODULE_DESCRIPTION() in the many of the protocol modules for the pata_parport driver to avoid compilation warnings with "make W=1". * tag 'ata-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: pata_parport: Add missing protocol modules description commit 57f1f9dd3abea322173ea75a15887ccf14bbbe51 Merge: e599e16c16a16 75d42b351f564 Author: Linus Torvalds Date: Thu Jul 20 14:46:39 2023 -0700 Merge tag 'net-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from BPF, netfilter, bluetooth and CAN. Current release - regressions: - eth: r8169: multiple fixes for PCIe ASPM-related problems - vrf: fix RCU lockdep splat in output path Previous releases - regressions: - gso: fall back to SW segmenting with GSO_UDP_L4 dodgy bit set - dsa: mv88e6xxx: do a final check before timing out when polling - nf_tables: fix sleep in atomic in nft_chain_validate Previous releases - always broken: - sched: fix undoing tcf_bind_filter() in multiple classifiers - bpf, arm64: fix BTI type used for freplace attached functions - can: gs_usb: fix time stamp counter initialization - nft_set_pipapo: fix improper element removal (leading to UAF) Misc: - net: support STP on bridge in non-root netns, STP prevents packet loops so not supporting it results in freezing systems of unsuspecting users, and in turn very upset noises being made - fix kdoc warnings - annotate various bits of TCP state to prevent data races" * tag 'net-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (95 commits) net: phy: prevent stale pointer dereference in phy_init() tcp: annotate data-races around fastopenq.max_qlen tcp: annotate data-races around icsk->icsk_user_timeout tcp: annotate data-races around tp->notsent_lowat tcp: annotate data-races around rskq_defer_accept tcp: annotate data-races around tp->linger2 tcp: annotate data-races around icsk->icsk_syn_retries tcp: annotate data-races around tp->keepalive_probes tcp: annotate data-races around tp->keepalive_intvl tcp: annotate data-races around tp->keepalive_time tcp: annotate data-races around tp->tsoffset tcp: annotate data-races around tp->tcp_tx_delay Bluetooth: MGMT: Use correct address for memcpy() Bluetooth: btusb: Fix bluetooth on Intel Macbook 2014 Bluetooth: SCO: fix sco_conn related locking and validity issues Bluetooth: hci_conn: return ERR_PTR instead of NULL when there is no link Bluetooth: hci_sync: Avoid use-after-free in dbg for hci_remove_adv_monitor() Bluetooth: coredump: fix building with coredump disabled Bluetooth: ISO: fix iso_conn related locking and validity issues Bluetooth: hci_event: call disconnect callback before deleting conn ... commit 2e7e5bbb1c3c8d502edeb5c0670eac4995134b6f Author: Peter Zijlstra Date: Wed Jul 19 22:15:38 2023 +0200 x86: Fix kthread unwind The rewrite of ret_from_form() misplaced an unwind hint which caused all kthread stack unwinds to be marked unreliable, breaking livepatching. Restore the annotation and add a comment to explain the how and why of things. Fixes: 3aec4ecb3d1f ("x86: Rewrite ret_from_fork() in C") Reported-by: Petr Mladek Signed-off-by: Peter Zijlstra (Intel) Tested-by: Petr Mladek Link: https://lkml.kernel.org/r/20230719201538.GA3553016@hirez.programming.kicks-ass.net commit 013adcbef165c3eaf73e297b7482290593815ab8 Author: Chengming Zhou Date: Thu Jul 20 20:14:41 2023 +0800 blk-iocost: skip empty flush bio in iocost The flush bio may have data, may have no data (empty flush), we couldn't calculate cost for empty flush bio. So we'd better just skip it for now. Another side effect is that empty flush bio's bio_end_sector() is 0, cause iocg->cursor reset to 0, may break the cost calculation of other bios. This isn't good enough, since flush bio still consume the device bandwidth, but flush request is special, can be merged randomly in the flush state machine, we don't know how to calculate cost for it for now. Its completion time also has flaws, which may include the pre-flush or post-flush completion time, but I don't know if we need to fix that and how to fix it. Signed-off-by: Chengming Zhou Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230720121441.1408522-1-chengming.zhou@linux.dev Signed-off-by: Jens Axboe commit 75d42b351f564b2568392a4e53cd74a3d9df4af2 Merge: 9b39f758974ff d1f0a9816f5fb Author: Jakub Kicinski Date: Thu Jul 20 12:57:55 2023 -0700 Merge tag 'for-net-2023-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Fix building with coredump disabled - Fix use-after-free in hci_remove_adv_monitor - Use RCU for hci_conn_params and iterate safely in hci_sync - Fix locking issues on ISO and SCO - Fix bluetooth on Intel Macbook 2014 * tag 'for-net-2023-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: MGMT: Use correct address for memcpy() Bluetooth: btusb: Fix bluetooth on Intel Macbook 2014 Bluetooth: SCO: fix sco_conn related locking and validity issues Bluetooth: hci_conn: return ERR_PTR instead of NULL when there is no link Bluetooth: hci_sync: Avoid use-after-free in dbg for hci_remove_adv_monitor() Bluetooth: coredump: fix building with coredump disabled Bluetooth: ISO: fix iso_conn related locking and validity issues Bluetooth: hci_event: call disconnect callback before deleting conn Bluetooth: use RCU for hci_conn_params and iterate safely in hci_sync ==================== Link: https://lore.kernel.org/r/20230720190201.446469-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit 9b39f758974ff8dfa721e68c6cecfd37e6ddb206 Merge: 1c613beaf877c 6eaf41e87a223 Author: Jakub Kicinski Date: Thu Jul 20 12:54:21 2023 -0700 Merge tag 'nf-23-07-20' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Florian Westphal says: ==================== Netfilter fixes for net: The following patchset contains Netfilter fixes for net: 1. Fix spurious -EEXIST error from userspace due to padding holes, this was broken since 4.9 days when 'ignore duplicate entries on insert' feature was added. 2. Fix a sched-while-atomic bug, present since 5.19. 3. Properly remove elements if they lack an "end range". nft userspace always sets an end range attribute, even when its the same as the start, but the abi doesn't have such a restriction. Always broken since it was added in 5.6, all three from myself. 4 + 5: Bound chain needs to be skipped in netns release and on rule flush paths, from Pablo Neira. * tag 'nf-23-07-20' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nf_tables: skip bound chain on rule flush netfilter: nf_tables: skip bound chain in netns release path netfilter: nft_set_pipapo: fix improper element removal netfilter: nf_tables: can't schedule in nft_chain_validate netfilter: nf_tables: fix spurious set element insertion failure ==================== Link: https://lore.kernel.org/r/20230720165143.30208-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit 1c613beaf877c0c0d755853dc62687e2013e55c4 Author: Vladimir Oltean Date: Thu Jul 20 03:02:31 2023 +0300 net: phy: prevent stale pointer dereference in phy_init() mdio_bus_init() and phy_driver_register() both have error paths, and if those are ever hit, ethtool will have a stale pointer to the phy_ethtool_phy_ops stub structure, which references memory from a module that failed to load (phylib). It is probably hard to force an error in this code path even manually, but the error teardown path of phy_init() should be the same as phy_exit(), which is now simply not the case. Fixes: 55d8f053ce1b ("net: phy: Register ethtool PHY operations") Link: https://lore.kernel.org/netdev/ZLaiJ4G6TaJYGJyU@shell.armlinux.org.uk/ Suggested-by: Russell King (Oracle) Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20230720000231.1939689-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 7998c0ad4c89cbb0bcd1594d9f989c8a5853daf7 Merge: ac528649f7c63 70f360dd7042c Author: Jakub Kicinski Date: Thu Jul 20 12:34:24 2023 -0700 Merge branch 'tcp-add-missing-annotations' Eric Dumazet says: ==================== tcp: add missing annotations This series was inspired by one syzbot (KCSAN) report. do_tcp_getsockopt() does not lock the socket, we need to annotate most of the reads there (and other places as well). This is a first round, another series will come later. ==================== Link: https://lore.kernel.org/r/20230719212857.3943972-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 70f360dd7042cb843635ece9d28335a4addff9eb Author: Eric Dumazet Date: Wed Jul 19 21:28:57 2023 +0000 tcp: annotate data-races around fastopenq.max_qlen This field can be read locklessly. Fixes: 1536e2857bd3 ("tcp: Add a TCP_FASTOPEN socket option to get a max backlog on its listner") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230719212857.3943972-12-edumazet@google.com Signed-off-by: Jakub Kicinski commit 26023e91e12c68669db416b97234328a03d8e499 Author: Eric Dumazet Date: Wed Jul 19 21:28:56 2023 +0000 tcp: annotate data-races around icsk->icsk_user_timeout This field can be read locklessly from do_tcp_getsockopt() Fixes: dca43c75e7e5 ("tcp: Add TCP_USER_TIMEOUT socket option.") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230719212857.3943972-11-edumazet@google.com Signed-off-by: Jakub Kicinski commit 1aeb87bc1440c5447a7fa2d6e3c2cca52cbd206b Author: Eric Dumazet Date: Wed Jul 19 21:28:55 2023 +0000 tcp: annotate data-races around tp->notsent_lowat tp->notsent_lowat can be read locklessly from do_tcp_getsockopt() and tcp_poll(). Fixes: c9bee3b7fdec ("tcp: TCP_NOTSENT_LOWAT socket option") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230719212857.3943972-10-edumazet@google.com Signed-off-by: Jakub Kicinski commit ae488c74422fb1dcd807c0201804b3b5e8a322a3 Author: Eric Dumazet Date: Wed Jul 19 21:28:54 2023 +0000 tcp: annotate data-races around rskq_defer_accept do_tcp_getsockopt() reads rskq_defer_accept while another cpu might change its value. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230719212857.3943972-9-edumazet@google.com Signed-off-by: Jakub Kicinski commit 9df5335ca974e688389c875546e5819778a80d59 Author: Eric Dumazet Date: Wed Jul 19 21:28:53 2023 +0000 tcp: annotate data-races around tp->linger2 do_tcp_getsockopt() reads tp->linger2 while another cpu might change its value. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230719212857.3943972-8-edumazet@google.com Signed-off-by: Jakub Kicinski commit 3a037f0f3c4bfe44518f2fbb478aa2f99a9cd8bb Author: Eric Dumazet Date: Wed Jul 19 21:28:52 2023 +0000 tcp: annotate data-races around icsk->icsk_syn_retries do_tcp_getsockopt() and reqsk_timer_handler() read icsk->icsk_syn_retries while another cpu might change its value. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230719212857.3943972-7-edumazet@google.com Signed-off-by: Jakub Kicinski commit 6e5e1de616bf5f3df1769abc9292191dfad9110a Author: Eric Dumazet Date: Wed Jul 19 21:28:51 2023 +0000 tcp: annotate data-races around tp->keepalive_probes do_tcp_getsockopt() reads tp->keepalive_probes while another cpu might change its value. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230719212857.3943972-6-edumazet@google.com Signed-off-by: Jakub Kicinski commit 5ecf9d4f52ff2f1d4d44c9b68bc75688e82f13b4 Author: Eric Dumazet Date: Wed Jul 19 21:28:50 2023 +0000 tcp: annotate data-races around tp->keepalive_intvl do_tcp_getsockopt() reads tp->keepalive_intvl while another cpu might change its value. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230719212857.3943972-5-edumazet@google.com Signed-off-by: Jakub Kicinski commit 4164245c76ff906c9086758e1c3f87082a7f5ef5 Author: Eric Dumazet Date: Wed Jul 19 21:28:49 2023 +0000 tcp: annotate data-races around tp->keepalive_time do_tcp_getsockopt() reads tp->keepalive_time while another cpu might change its value. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230719212857.3943972-4-edumazet@google.com Signed-off-by: Jakub Kicinski commit dd23c9f1e8d5c1d2e3d29393412385ccb9c7a948 Author: Eric Dumazet Date: Wed Jul 19 21:28:48 2023 +0000 tcp: annotate data-races around tp->tsoffset do_tcp_getsockopt() reads tp->tsoffset while another cpu might change its value. Fixes: 93be6ce0e91b ("tcp: set and get per-socket timestamp") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230719212857.3943972-3-edumazet@google.com Signed-off-by: Jakub Kicinski commit 348b81b68b13ebd489a3e6a46aa1c384c731c919 Author: Eric Dumazet Date: Wed Jul 19 21:28:47 2023 +0000 tcp: annotate data-races around tp->tcp_tx_delay do_tcp_getsockopt() reads tp->tcp_tx_delay while another cpu might change its value. Fixes: a842fe1425cb ("tcp: add optional per socket transmit delay") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230719212857.3943972-2-edumazet@google.com Signed-off-by: Jakub Kicinski commit 3641c90c4e369c8d0af5483e879174400a152cf8 Author: Chengming Zhou Date: Thu Jul 20 17:55:12 2023 +0800 blk-mq: delete dead struct blk_mq_hw_ctx->queued field This counter is not used anywhere, so delete it. Signed-off-by: Chengming Zhou Reviewed-by: Bart Van Assche Link: https://lore.kernel.org/r/20230720095512.1403123-1-chengming.zhou@linux.dev Signed-off-by: Jens Axboe commit e6ab0b914c12acefbb0880dded48cb930ccab5cf Author: YueHaibing Date: Thu Jul 20 22:35:06 2023 +0800 fs/9p: Remove unused extern declaration commit bd238fb431f3 ("9p: Reorganization of 9p file system code") left behind this. Signed-off-by: YueHaibing Reviewed-by: Christian Schoenebeck Signed-off-by: Eric Van Hensbergen commit a9be202269580ca611c6cebac90eaf1795497800 Author: Jens Axboe Date: Thu Jul 20 13:16:53 2023 -0600 io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq io-wq assumes that an issue is blocking, but it may not be if the request type has asked for a non-blocking attempt. If we get -EAGAIN for that case, then we need to treat it as a final result and not retry or arm poll for it. Cc: stable@vger.kernel.org # 5.10+ Link: https://github.com/axboe/liburing/issues/897 Signed-off-by: Jens Axboe commit cf7c33d332ab67603f159123b691c61270b14c33 Author: Dominique Martinet Date: Wed May 3 16:49:29 2023 +0900 9p: remove dead stores (variable set again without being read) The 9p code for some reason used to initialize variables outside of the declaration, e.g. instead of just initializing the variable like this: int retval = 0 We would be doing this: int retval; retval = 0; This is perfectly fine and the compiler will just optimize dead stores anyway, but scan-build seems to think this is a problem and there are many of these warnings making the output of scan-build full of such warnings: fs/9p/vfs_inode.c:916:2: warning: Value stored to 'retval' is never read [deadcode.DeadStores] retval = 0; ^ ~ I have no strong opinion here, but if we want to regularly run scan-build we should fix these just to silence the messages. I've confirmed these all are indeed ok to remove. Reviewed-by: Simon Horman Signed-off-by: Dominique Martinet Signed-off-by: Eric Van Hensbergen commit f41b402d2572e93bee85669ed05eb5e1f3725704 Author: Dominique Martinet Date: Wed May 3 16:49:28 2023 +0900 9p: virtio: skip incrementing unused variable Fix the following scan-build warning: net/9p/trans_virtio.c:504:3: warning: Value stored to 'in' is never read [deadcode.DeadStores] in += pack_sg_list_p(chan->sg, out + in, VIRTQUEUE_NUM, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I'm honestly not 100% sure about this one; I'm tempted to think we could (should?) just check the return value of pack_sg_list_p to skip the in_sgs++ and setting sgs[] if it didn't process anything, but I'm not sure it should ever happen so this is probably fine as is. Just removing the assignment at least makes it clear the return value isn't used, so it's an improvement in terms of readability. Reviewed-by: Simon Horman Signed-off-by: Dominique Martinet Signed-off-by: Eric Van Hensbergen commit 4a73edab69d3a6623f03817fe950a2d9585f80e4 Author: Dominique Martinet Date: Wed May 3 16:49:27 2023 +0900 9p: virtio: make sure 'offs' is initialized in zc_request Similarly to the previous patch: offs can be used in handle_rerrors without initializing on small payloads; in this case handle_rerrors will not use it because of the size check, but it doesn't hurt to make sure it is zero to please scan-build. This fixes the following warning: net/9p/trans_virtio.c:539:3: warning: 3rd function call argument is an uninitialized value [core.CallAndMessage] handle_rerror(req, in_hdr_len, offs, in_pages); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed-by: Simon Horman Signed-off-by: Dominique Martinet Signed-off-by: Eric Van Hensbergen commit 13ade4ac5c28e8a014fa85278f5a4270b215f906 Author: Dominique Martinet Date: Wed May 3 16:49:26 2023 +0900 9p: virtio: fix unlikely null pointer deref in handle_rerror handle_rerror can dereference the pages pointer, but it is not necessarily set for small payloads. In practice these should be filtered out by the size check, but might as well double-check explicitly. This fixes the following scan-build warnings: net/9p/trans_virtio.c:401:24: warning: Dereference of null pointer [core.NullDereference] memcpy_from_page(to, *pages++, offs, n); ^~~~~~~~ net/9p/trans_virtio.c:406:23: warning: Dereference of null pointer (loaded from variable 'pages') [core.NullDereference] memcpy_from_page(to, *pages, offs, size); ^~~~~~ Reviewed-by: Simon Horman Signed-off-by: Dominique Martinet Signed-off-by: Eric Van Hensbergen commit eee4a119e96c2f58cfd1b6d4de42095abc5f8877 Author: Dominique Martinet Date: Wed May 3 16:49:25 2023 +0900 9p: fix ignored return value in v9fs_dir_release retval from filemap_fdatawrite was immediately overwritten by the following p9_fid_put: preserve any error in fdatawrite if there was any first. This fixes the following scan-build warning: fs/9p/vfs_dir.c:220:4: warning: Value stored to 'retval' is never read [deadcode.DeadStores] retval = filemap_fdatawrite(inode->i_mapping); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 89c58cb395ec ("fs/9p: fix error reporting in v9fs_dir_release") Cc: stable@vger.kernel.org Reviewed-by: Simon Horman Signed-off-by: Dominique Martinet Signed-off-by: Eric Van Hensbergen commit d1f0a9816f5fbc1316355ec1aa4ddfb9b624cca5 Author: Andy Shevchenko Date: Mon Jul 17 12:32:14 2023 +0300 Bluetooth: MGMT: Use correct address for memcpy() In function ‘fortify_memcpy_chk’, inlined from ‘get_conn_info_complete’ at net/bluetooth/mgmt.c:7281:2: include/linux/fortify-string.h:592:25: error: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning] 592 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors This is due to the wrong member is used for memcpy(). Use correct one. Signed-off-by: Andy Shevchenko Signed-off-by: Luiz Augusto von Dentz commit 95b7015433053cd5f648ad2a7b8f43b2c99c949a Author: Tomasz Moń Date: Thu Jul 13 12:25:14 2023 +0200 Bluetooth: btusb: Fix bluetooth on Intel Macbook 2014 Commit c13380a55522 ("Bluetooth: btusb: Do not require hardcoded interface numbers") inadvertedly broke bluetooth on Intel Macbook 2014. The intention was to keep behavior intact when BTUSB_IFNUM_2 is set and otherwise allow any interface numbers. The problem is that the new logic condition omits the case where bInterfaceNumber is 0. Fix BTUSB_IFNUM_2 handling by allowing both interface number 0 and 2 when the flag is set. Fixes: c13380a55522 ("Bluetooth: btusb: Do not require hardcoded interface numbers") Reported-by: John Holland Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217651 Signed-off-by: Tomasz Moń Tested-by: John Holland Signed-off-by: Luiz Augusto von Dentz commit 3dcaa192ac2159193bc6ab57bc5369dcb84edd8e Author: Pauli Virtanen Date: Mon Jul 10 19:48:19 2023 +0300 Bluetooth: SCO: fix sco_conn related locking and validity issues Operations that check/update sk_state and access conn should hold lock_sock, otherwise they can race. The order of taking locks is hci_dev_lock > lock_sock > sco_conn_lock, which is how it is in connect/disconnect_cfm -> sco_conn_del -> sco_chan_del. Fix locking in sco_connect to take lock_sock around updating sk_state and conn. sco_conn_del must not occur during sco_connect, as it frees the sco_conn. Hold hdev->lock longer to prevent that. sco_conn_add shall return sco_conn with valid hcon. Make it so also when reusing an old SCO connection waiting for disconnect timeout (see __sco_sock_close where conn->hcon is set to NULL). This should not reintroduce the issue fixed in the earlier commit 9a8ec9e8ebb5 ("Bluetooth: SCO: Fix possible circular locking dependency on sco_connect_cfm"), the relevant fix of releasing lock_sock in sco_sock_connect before acquiring hdev->lock is retained. These changes mirror similar fixes earlier in ISO sockets. Fixes: 9a8ec9e8ebb5 ("Bluetooth: SCO: Fix possible circular locking dependency on sco_connect_cfm") Signed-off-by: Pauli Virtanen Signed-off-by: Luiz Augusto von Dentz commit b4066eb04bb67e7ff66e5aaab0db4a753f37eaad Author: Siddh Raman Pant Date: Tue Jul 11 18:43:53 2023 +0530 Bluetooth: hci_conn: return ERR_PTR instead of NULL when there is no link hci_connect_sco currently returns NULL when there is no link (i.e. when hci_conn_link() returns NULL). sco_connect() expects an ERR_PTR in case of any error (see line 266 in sco.c). Thus, hcon set as NULL passes through to sco_conn_add(), which tries to get hcon->hdev, resulting in dereferencing a NULL pointer as reported by syzkaller. The same issue exists for iso_connect_cis() calling hci_connect_cis(). Thus, make hci_connect_sco() and hci_connect_cis() return ERR_PTR instead of NULL. Reported-and-tested-by: syzbot+37acd5d80d00d609d233@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=37acd5d80d00d609d233 Fixes: 06149746e720 ("Bluetooth: hci_conn: Add support for linking multiple hcon") Signed-off-by: Siddh Raman Pant Signed-off-by: Luiz Augusto von Dentz commit de6dfcefd107667ce2dbedf4d9337f5ed557a4a1 Author: Douglas Anderson Date: Fri Jun 30 15:33:14 2023 -0700 Bluetooth: hci_sync: Avoid use-after-free in dbg for hci_remove_adv_monitor() KASAN reports that there's a use-after-free in hci_remove_adv_monitor(). Trawling through the disassembly, you can see that the complaint is from the access in bt_dev_dbg() under the HCI_ADV_MONITOR_EXT_MSFT case. The problem case happens because msft_remove_monitor() can end up freeing the monitor structure. Specifically: hci_remove_adv_monitor() -> msft_remove_monitor() -> msft_remove_monitor_sync() -> msft_le_cancel_monitor_advertisement_cb() -> hci_free_adv_monitor() Let's fix the problem by just stashing the relevant data when it's still valid. Fixes: 7cf5c2978f23 ("Bluetooth: hci_sync: Refactor remove Adv Monitor") Signed-off-by: Douglas Anderson Signed-off-by: Luiz Augusto von Dentz commit 6910e2eb39254d279bce5bc0f8eb6af45b59357c Author: Arnd Bergmann Date: Mon Jul 3 13:30:48 2023 +0200 Bluetooth: coredump: fix building with coredump disabled The btmtk driver uses an IS_ENABLED() check to conditionally compile the coredump support, but this fails to build because the hdev->dump member is in an #ifdef: drivers/bluetooth/btmtk.c: In function 'btmtk_process_coredump': drivers/bluetooth/btmtk.c:386:30: error: 'struct hci_dev' has no member named 'dump' 386 | schedule_delayed_work(&hdev->dump.dump_timeout, | ^~ The struct member doesn't really make a huge difference in the total size, so just remove the #ifdef around it to avoid adding similar checks around each user. Fixes: 872f8c253cb9e ("Bluetooth: btusb: mediatek: add MediaTek devcoredump support") Fixes: 9695ef876fd12 ("Bluetooth: Add support for hci devcoredump") Signed-off-by: Arnd Bergmann Signed-off-by: Luiz Augusto von Dentz commit d40ae85ee62e3666f45bc61864b22121346f88ef Author: Pauli Virtanen Date: Mon Jun 19 01:04:33 2023 +0300 Bluetooth: ISO: fix iso_conn related locking and validity issues sk->sk_state indicates whether iso_pi(sk)->conn is valid. Operations that check/update sk_state and access conn should hold lock_sock, otherwise they can race. The order of taking locks is hci_dev_lock > lock_sock > iso_conn_lock, which is how it is in connect/disconnect_cfm -> iso_conn_del -> iso_chan_del. Fix locking in iso_connect_cis/bis and sendmsg/recvmsg to take lock_sock around updating sk_state and conn. iso_conn_del must not occur during iso_connect_cis/bis, as it frees the iso_conn. Hold hdev->lock longer to prevent that. This should not reintroduce the issue fixed in commit 241f51931c35 ("Bluetooth: ISO: Avoid circular locking dependency"), since the we acquire locks in order. We retain the fix in iso_sock_connect to release lock_sock before iso_connect_* acquires hdev->lock. Similarly for commit 6a5ad251b7cd ("Bluetooth: ISO: Fix possible circular locking dependency"). We retain the fix in iso_conn_ready to not acquire iso_conn_lock before lock_sock. iso_conn_add shall return iso_conn with valid hcon. Make it so also when reusing an old CIS connection waiting for disconnect timeout (see __iso_sock_close where conn->hcon is set to NULL). Trace with iso_conn_del after iso_chan_add in iso_connect_cis: =============================================================== iso_sock_create:771: sock 00000000be9b69b7 iso_sock_init:693: sk 000000004dff667e iso_sock_bind:827: sk 000000004dff667e 70:1a:b8:98:ff:a2 type 1 iso_sock_setsockopt:1289: sk 000000004dff667e iso_sock_setsockopt:1289: sk 000000004dff667e iso_sock_setsockopt:1289: sk 000000004dff667e iso_sock_connect:875: sk 000000004dff667e iso_connect_cis:353: 70:1a:b8:98:ff:a2 -> 28:3d:c2:4a:7e:da hci_get_route:1199: 70:1a:b8:98:ff:a2 -> 28:3d:c2:4a:7e:da hci_conn_add:1005: hci0 dst 28:3d:c2:4a:7e:da iso_conn_add:140: hcon 000000007b65d182 conn 00000000daf8625e __iso_chan_add:214: conn 00000000daf8625e iso_connect_cfm:1700: hcon 000000007b65d182 bdaddr 28:3d:c2:4a:7e:da status 12 iso_conn_del:187: hcon 000000007b65d182 conn 00000000daf8625e, err 16 iso_sock_clear_timer:117: sock 000000004dff667e state 3 iso_chan_del:153: sk 000000004dff667e, conn 00000000daf8625e, err 16 hci_conn_del:1151: hci0 hcon 000000007b65d182 handle 65535 hci_conn_unlink:1102: hci0: hcon 000000007b65d182 hci_chan_list_flush:2780: hcon 000000007b65d182 iso_sock_getsockopt:1376: sk 000000004dff667e iso_sock_getname:1070: sock 00000000be9b69b7, sk 000000004dff667e iso_sock_getname:1070: sock 00000000be9b69b7, sk 000000004dff667e iso_sock_getsockopt:1376: sk 000000004dff667e iso_sock_getname:1070: sock 00000000be9b69b7, sk 000000004dff667e iso_sock_getname:1070: sock 00000000be9b69b7, sk 000000004dff667e iso_sock_shutdown:1434: sock 00000000be9b69b7, sk 000000004dff667e, how 1 __iso_sock_close:632: sk 000000004dff667e state 5 socket 00000000be9b69b7 BUG: kernel NULL pointer dereference, address: 0000000000000000 PGD 8000000006467067 P4D 8000000006467067 PUD 3f5f067 PMD 0 Oops: 0000 [#1] PREEMPT SMP PTI Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-1.fc38 04/01/2014 RIP: 0010:__iso_sock_close (net/bluetooth/iso.c:664) bluetooth =============================================================== Trace with iso_conn_del before iso_chan_add in iso_connect_cis: =============================================================== iso_connect_cis:356: 70:1a:b8:98:ff:a2 -> 28:3d:c2:4a:7e:da ... iso_conn_add:140: hcon 0000000093bc551f conn 00000000768ae504 hci_dev_put:1487: hci0 orig refcnt 21 hci_event_packet:7607: hci0: event 0x0e hci_cmd_complete_evt:4231: hci0: opcode 0x2062 hci_cc_le_set_cig_params:3846: hci0: status 0x07 hci_sent_cmd_data:3107: hci0 opcode 0x2062 iso_connect_cfm:1703: hcon 0000000093bc551f bdaddr 28:3d:c2:4a:7e:da status 7 iso_conn_del:187: hcon 0000000093bc551f conn 00000000768ae504, err 12 hci_conn_del:1151: hci0 hcon 0000000093bc551f handle 65535 hci_conn_unlink:1102: hci0: hcon 0000000093bc551f hci_chan_list_flush:2780: hcon 0000000093bc551f __iso_chan_add:214: conn 00000000768ae504 iso_sock_clear_timer:117: sock 0000000098323f95 state 3 general protection fault, probably for non-canonical address 0x30b29c630930aec8: 0000 [#1] PREEMPT SMP PTI CPU: 1 PID: 1920 Comm: bluetoothd Tainted: G E 6.3.0-rc7+ #4 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-1.fc38 04/01/2014 RIP: 0010:detach_if_pending+0x28/0xd0 Code: 90 90 0f 1f 44 00 00 48 8b 47 08 48 85 c0 0f 84 ad 00 00 00 55 89 d5 53 48 83 3f 00 48 89 fb 74 7d 66 90 48 8b 03 48 8b 53 08 <> RSP: 0018:ffffb90841a67d08 EFLAGS: 00010007 RAX: 0000000000000000 RBX: ffff9141bd5061b8 RCX: 0000000000000000 RDX: 30b29c630930aec8 RSI: ffff9141fdd21e80 RDI: ffff9141bd5061b8 RBP: 0000000000000001 R08: 0000000000000000 R09: ffffb90841a67b88 R10: 0000000000000003 R11: ffffffff8613f558 R12: ffff9141fdd21e80 R13: 0000000000000000 R14: ffff9141b5976010 R15: ffff914185755338 FS: 00007f45768bd840(0000) GS:ffff9141fdd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000619000424074 CR3: 0000000009f5e005 CR4: 0000000000170ee0 Call Trace: timer_delete+0x48/0x80 try_to_grab_pending+0xdf/0x170 __cancel_work+0x37/0xb0 iso_connect_cis+0x141/0x400 [bluetooth] =============================================================== Trace with NULL conn->hcon in state BT_CONNECT: =============================================================== __iso_sock_close:619: sk 00000000f7c71fc5 state 1 socket 00000000d90c5fe5 ... __iso_sock_close:619: sk 00000000f7c71fc5 state 8 socket 00000000d90c5fe5 iso_chan_del:153: sk 00000000f7c71fc5, conn 0000000022c03a7e, err 104 ... iso_sock_connect:862: sk 00000000129b56c3 iso_connect_cis:348: 70:1a:b8:98:ff:a2 -> 28:3d:c2:4a:7d:2a hci_get_route:1199: 70:1a:b8:98:ff:a2 -> 28:3d:c2:4a:7d:2a hci_dev_hold:1495: hci0 orig refcnt 19 __iso_chan_add:214: conn 0000000022c03a7e iso_sock_clear_timer:117: sock 00000000129b56c3 state 3 ... iso_sock_ready:1485: sk 00000000129b56c3 ... iso_sock_sendmsg:1077: sock 00000000e5013966, sk 00000000129b56c3 BUG: kernel NULL pointer dereference, address: 00000000000006a8 PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 1 PID: 1403 Comm: wireplumber Tainted: G E 6.3.0-rc7+ #4 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-1.fc38 04/01/2014 RIP: 0010:iso_sock_sendmsg+0x63/0x2a0 [bluetooth] =============================================================== Fixes: 241f51931c35 ("Bluetooth: ISO: Avoid circular locking dependency") Fixes: 6a5ad251b7cd ("Bluetooth: ISO: Fix possible circular locking dependency") Signed-off-by: Pauli Virtanen Signed-off-by: Luiz Augusto von Dentz commit 7f7cfcb6f0825652973b780f248603e23f16ee90 Author: Pauli Virtanen Date: Mon Jun 19 01:04:32 2023 +0300 Bluetooth: hci_event: call disconnect callback before deleting conn In hci_cs_disconnect, we do hci_conn_del even if disconnection failed. ISO, L2CAP and SCO connections refer to the hci_conn without hci_conn_get, so disconn_cfm must be called so they can clean up their conn, otherwise use-after-free occurs. ISO: ========================================================== iso_sock_connect:880: sk 00000000eabd6557 iso_connect_cis:356: 70:1a:b8:98:ff:a2 -> 28:3d:c2:4a:7e:da ... iso_conn_add:140: hcon 000000001696f1fd conn 00000000b6251073 hci_dev_put:1487: hci0 orig refcnt 17 __iso_chan_add:214: conn 00000000b6251073 iso_sock_clear_timer:117: sock 00000000eabd6557 state 3 ... hci_rx_work:4085: hci0 Event packet hci_event_packet:7601: hci0: event 0x0f hci_cmd_status_evt:4346: hci0: opcode 0x0406 hci_cs_disconnect:2760: hci0: status 0x0c hci_sent_cmd_data:3107: hci0 opcode 0x0406 hci_conn_del:1151: hci0 hcon 000000001696f1fd handle 2560 hci_conn_unlink:1102: hci0: hcon 000000001696f1fd hci_conn_drop:1451: hcon 00000000d8521aaf orig refcnt 2 hci_chan_list_flush:2780: hcon 000000001696f1fd hci_dev_put:1487: hci0 orig refcnt 21 hci_dev_put:1487: hci0 orig refcnt 20 hci_req_cmd_complete:3978: opcode 0x0406 status 0x0c ... ... iso_sock_sendmsg:1098: sock 00000000dea5e2e0, sk 00000000eabd6557 BUG: kernel NULL pointer dereference, address: 0000000000000668 PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-1.fc38 04/01/2014 RIP: 0010:iso_sock_sendmsg (net/bluetooth/iso.c:1112) bluetooth ========================================================== L2CAP: ================================================================== hci_cmd_status_evt:4359: hci0: opcode 0x0406 hci_cs_disconnect:2760: hci0: status 0x0c hci_sent_cmd_data:3085: hci0 opcode 0x0406 hci_conn_del:1151: hci0 hcon ffff88800c999000 handle 3585 hci_conn_unlink:1102: hci0: hcon ffff88800c999000 hci_chan_list_flush:2780: hcon ffff88800c999000 hci_chan_del:2761: hci0 hcon ffff88800c999000 chan ffff888018ddd280 ... BUG: KASAN: slab-use-after-free in hci_send_acl+0x2d/0x540 [bluetooth] Read of size 8 at addr ffff888018ddd298 by task bluetoothd/1175 CPU: 0 PID: 1175 Comm: bluetoothd Tainted: G E 6.4.0-rc4+ #2 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-1.fc38 04/01/2014 Call Trace: dump_stack_lvl+0x5b/0x90 print_report+0xcf/0x670 ? __virt_addr_valid+0xf8/0x180 ? hci_send_acl+0x2d/0x540 [bluetooth] kasan_report+0xa8/0xe0 ? hci_send_acl+0x2d/0x540 [bluetooth] hci_send_acl+0x2d/0x540 [bluetooth] ? __pfx___lock_acquire+0x10/0x10 l2cap_chan_send+0x1fd/0x1300 [bluetooth] ? l2cap_sock_sendmsg+0xf2/0x170 [bluetooth] ? __pfx_l2cap_chan_send+0x10/0x10 [bluetooth] ? lock_release+0x1d5/0x3c0 ? mark_held_locks+0x1a/0x90 l2cap_sock_sendmsg+0x100/0x170 [bluetooth] sock_write_iter+0x275/0x280 ? __pfx_sock_write_iter+0x10/0x10 ? __pfx___lock_acquire+0x10/0x10 do_iter_readv_writev+0x176/0x220 ? __pfx_do_iter_readv_writev+0x10/0x10 ? find_held_lock+0x83/0xa0 ? selinux_file_permission+0x13e/0x210 do_iter_write+0xda/0x340 vfs_writev+0x1b4/0x400 ? __pfx_vfs_writev+0x10/0x10 ? __seccomp_filter+0x112/0x750 ? populate_seccomp_data+0x182/0x220 ? __fget_light+0xdf/0x100 ? do_writev+0x19d/0x210 do_writev+0x19d/0x210 ? __pfx_do_writev+0x10/0x10 ? mark_held_locks+0x1a/0x90 do_syscall_64+0x60/0x90 ? lockdep_hardirqs_on_prepare+0x149/0x210 ? do_syscall_64+0x6c/0x90 ? lockdep_hardirqs_on_prepare+0x149/0x210 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7ff45cb23e64 Code: 15 d1 1f 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f 00 f3 0f 1e fa 80 3d 9d a7 0d 00 00 74 13 b8 14 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 48 83 ec 28 89 54 24 1c 48 89 RSP: 002b:00007fff21ae09b8 EFLAGS: 00000202 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007ff45cb23e64 RDX: 0000000000000001 RSI: 00007fff21ae0aa0 RDI: 0000000000000017 RBP: 00007fff21ae0aa0 R08: 000000000095a8a0 R09: 0000607000053f40 R10: 0000000000000001 R11: 0000000000000202 R12: 00007fff21ae0ac0 R13: 00000fffe435c150 R14: 00007fff21ae0a80 R15: 000060f000000040 Allocated by task 771: kasan_save_stack+0x33/0x60 kasan_set_track+0x25/0x30 __kasan_kmalloc+0xaa/0xb0 hci_chan_create+0x67/0x1b0 [bluetooth] l2cap_conn_add.part.0+0x17/0x590 [bluetooth] l2cap_connect_cfm+0x266/0x6b0 [bluetooth] hci_le_remote_feat_complete_evt+0x167/0x310 [bluetooth] hci_event_packet+0x38d/0x800 [bluetooth] hci_rx_work+0x287/0xb20 [bluetooth] process_one_work+0x4f7/0x970 worker_thread+0x8f/0x620 kthread+0x17f/0x1c0 ret_from_fork+0x2c/0x50 Freed by task 771: kasan_save_stack+0x33/0x60 kasan_set_track+0x25/0x30 kasan_save_free_info+0x2e/0x50 ____kasan_slab_free+0x169/0x1c0 slab_free_freelist_hook+0x9e/0x1c0 __kmem_cache_free+0xc0/0x310 hci_chan_list_flush+0x46/0x90 [bluetooth] hci_conn_cleanup+0x7d/0x330 [bluetooth] hci_cs_disconnect+0x35d/0x530 [bluetooth] hci_cmd_status_evt+0xef/0x2b0 [bluetooth] hci_event_packet+0x38d/0x800 [bluetooth] hci_rx_work+0x287/0xb20 [bluetooth] process_one_work+0x4f7/0x970 worker_thread+0x8f/0x620 kthread+0x17f/0x1c0 ret_from_fork+0x2c/0x50 ================================================================== Fixes: b8d290525e39 ("Bluetooth: clean up connection in hci_cs_disconnect") Signed-off-by: Pauli Virtanen Signed-off-by: Luiz Augusto von Dentz commit 195ef75e19287b4bc413da3e3e3722b030ac881e Author: Pauli Virtanen Date: Mon Jun 19 01:04:31 2023 +0300 Bluetooth: use RCU for hci_conn_params and iterate safely in hci_sync hci_update_accept_list_sync iterates over hdev->pend_le_conns and hdev->pend_le_reports, and waits for controller events in the loop body, without holding hdev lock. Meanwhile, these lists and the items may be modified e.g. by le_scan_cleanup. This can invalidate the list cursor or any other item in the list, resulting to invalid behavior (eg use-after-free). Use RCU for the hci_conn_params action lists. Since the loop bodies in hci_sync block and we cannot use RCU or hdev->lock for the whole loop, copy list items first and then iterate on the copy. Only the flags field is written from elsewhere, so READ_ONCE/WRITE_ONCE should guarantee we read valid values. Free params everywhere with hci_conn_params_free so the cleanup is guaranteed to be done properly. This fixes the following, which can be triggered e.g. by BlueZ new mgmt-tester case "Add + Remove Device Nowait - Success", or by changing hci_le_set_cig_params to always return false, and running iso-tester: ================================================================== BUG: KASAN: slab-use-after-free in hci_update_passive_scan_sync (net/bluetooth/hci_sync.c:2536 net/bluetooth/hci_sync.c:2723 net/bluetooth/hci_sync.c:2841) Read of size 8 at addr ffff888001265018 by task kworker/u3:0/32 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-1.fc38 04/01/2014 Workqueue: hci0 hci_cmd_sync_work Call Trace: dump_stack_lvl (./arch/x86/include/asm/irqflags.h:134 lib/dump_stack.c:107) print_report (mm/kasan/report.c:320 mm/kasan/report.c:430) ? __virt_addr_valid (./include/linux/mmzone.h:1915 ./include/linux/mmzone.h:2011 arch/x86/mm/physaddr.c:65) ? hci_update_passive_scan_sync (net/bluetooth/hci_sync.c:2536 net/bluetooth/hci_sync.c:2723 net/bluetooth/hci_sync.c:2841) kasan_report (mm/kasan/report.c:538) ? hci_update_passive_scan_sync (net/bluetooth/hci_sync.c:2536 net/bluetooth/hci_sync.c:2723 net/bluetooth/hci_sync.c:2841) hci_update_passive_scan_sync (net/bluetooth/hci_sync.c:2536 net/bluetooth/hci_sync.c:2723 net/bluetooth/hci_sync.c:2841) ? __pfx_hci_update_passive_scan_sync (net/bluetooth/hci_sync.c:2780) ? mutex_lock (kernel/locking/mutex.c:282) ? __pfx_mutex_lock (kernel/locking/mutex.c:282) ? __pfx_mutex_unlock (kernel/locking/mutex.c:538) ? __pfx_update_passive_scan_sync (net/bluetooth/hci_sync.c:2861) hci_cmd_sync_work (net/bluetooth/hci_sync.c:306) process_one_work (./arch/x86/include/asm/preempt.h:27 kernel/workqueue.c:2399) worker_thread (./include/linux/list.h:292 kernel/workqueue.c:2538) ? __pfx_worker_thread (kernel/workqueue.c:2480) kthread (kernel/kthread.c:376) ? __pfx_kthread (kernel/kthread.c:331) ret_from_fork (arch/x86/entry/entry_64.S:314) Allocated by task 31: kasan_save_stack (mm/kasan/common.c:46) kasan_set_track (mm/kasan/common.c:52) __kasan_kmalloc (mm/kasan/common.c:374 mm/kasan/common.c:383) hci_conn_params_add (./include/linux/slab.h:580 ./include/linux/slab.h:720 net/bluetooth/hci_core.c:2277) hci_connect_le_scan (net/bluetooth/hci_conn.c:1419 net/bluetooth/hci_conn.c:1589) hci_connect_cis (net/bluetooth/hci_conn.c:2266) iso_connect_cis (net/bluetooth/iso.c:390) iso_sock_connect (net/bluetooth/iso.c:899) __sys_connect (net/socket.c:2003 net/socket.c:2020) __x64_sys_connect (net/socket.c:2027) do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120) Freed by task 15: kasan_save_stack (mm/kasan/common.c:46) kasan_set_track (mm/kasan/common.c:52) kasan_save_free_info (mm/kasan/generic.c:523) __kasan_slab_free (mm/kasan/common.c:238 mm/kasan/common.c:200 mm/kasan/common.c:244) __kmem_cache_free (mm/slub.c:1807 mm/slub.c:3787 mm/slub.c:3800) hci_conn_params_del (net/bluetooth/hci_core.c:2323) le_scan_cleanup (net/bluetooth/hci_conn.c:202) process_one_work (./arch/x86/include/asm/preempt.h:27 kernel/workqueue.c:2399) worker_thread (./include/linux/list.h:292 kernel/workqueue.c:2538) kthread (kernel/kthread.c:376) ret_from_fork (arch/x86/entry/entry_64.S:314) ================================================================== Fixes: e8907f76544f ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3") Signed-off-by: Pauli Virtanen Signed-off-by: Luiz Augusto von Dentz commit 272ffb925e2020000863748867d91a2407d3e8e9 Author: William Breathitt Gray Date: Tue Jun 20 13:01:59 2023 -0400 counter: Fix menuconfig "Counter support" submenu entries disappearance The current placement of the I8254 Kconfig entry results in the disappearance of the "Counter support" submenu items in menuconfig. Move the I8254 above the menuconfig COUNTER entry to restore the intended submenu behavior. Fixes: d428487471ba ("counter: i8254: Introduce the Intel 8254 interface library module") Reported-by: Jarkko Nikula Closes: https://lore.kernel.org/all/32ddaa7b-53a8-d61f-d526-b545bd561337@linux.intel.com/ Reviewed-by: Randy Dunlap Tested-by: Jarkko Nikula Reviewed-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230620170159.556788-1-william.gray@linaro.org/ Signed-off-by: William Breathitt Gray commit 8dbfc14fc736eb701089aff09645c3d4ad3decb1 Author: Filipe Manana Date: Thu Jul 20 12:44:33 2023 +0100 btrfs: account block group tree when calculating global reserve size When using the block group tree feature, this tree is a critical tree just like the extent, csum and free space trees, and just like them it uses the delayed refs block reserve. So take into account the block group tree, and its current size, when calculating the size for the global reserve. CC: stable@vger.kernel.org # 6.1+ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 690c8b804ad2eafbd35da5d3c95ad325ca7d5061 Author: Samuel Thibault Date: Mon Jul 10 02:26:45 2023 +0200 TIOCSTI: always enable for CAP_SYS_ADMIN 83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled") broke BRLTTY's ability to simulate keypresses on the console, thus effectively breaking braille keyboards of blind users. This restores the TIOCSTI feature for CAP_SYS_ADMIN processes, which BRLTTY is, thus fixing braille keyboards without re-opening the security issue. Signed-off-by: Samuel Thibault Acked-by: Kees Cook Fixes: 83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled") Cc: stable@vger.kernel.org Reported-by: Nicolas Pitre Link: https://lore.kernel.org/r/20230710002645.v565c7xq5iddruse@begin Acked-by: Jiri Slaby Signed-off-by: Greg Kroah-Hartman commit 95ca6599a589ee84c69f02d0e1d928c8d1367fb1 Author: Naohiro Aota Date: Thu Jun 29 17:37:31 2023 +0900 btrfs: zoned: do not enable async discard The zoned mode need to reset a zone before using it. We rely on btrfs's original discard functionality (discarding unused block group range) to do the resetting. While the commit 63a7cb130718 ("btrfs: auto enable discard=async when possible") made the discard done in an async manner, a zoned reset do not need to be async, as it is fast enough. Even worth, delaying zone rests prevents using those zones again. So, let's disable async discard on the zoned mode. Fixes: 63a7cb130718 ("btrfs: auto enable discard=async when possible") CC: stable@vger.kernel.org # 6.3+ Reviewed-by: Damien Le Moal Reviewed-by: Christoph Hellwig Signed-off-by: Naohiro Aota Reviewed-by: David Sterba [ update message text ] Signed-off-by: David Sterba commit 733c758e509b86a5d38b9af927817258b88ededd Author: Oliver Upton Date: Wed Jul 19 23:18:55 2023 +0000 KVM: arm64: Rephrase percpu enable/disable tracking in terms of hyp kvm_arm_hardware_enabled is rather misleading, since it doesn't track the state of all hardware resources needed for running a VM. What it actually tracks is whether or not the hyp cpu context has been initialized. Since we're now at the point where vgic + timer irq management has been separated from kvm_arm_hardware_enabled, rephrase it (and the associated helpers) to make it clear what state is being tracked. Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20230719231855.262973-1-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit c718ca0e99401d80d2480c08e1b02cf5f7cd7033 Author: Raghavendra Rao Ananta Date: Wed Jul 19 17:54:00 2023 +0000 KVM: arm64: Fix hardware enable/disable flows for pKVM When running in protected mode, the hyp stub is disabled after pKVM is initialized, meaning the host cannot enable/disable the hyp at runtime. As such, kvm_arm_hardware_enabled is always 1 after initialization, and kvm_arch_hardware_enable() never enables the vgic maintenance irq or timer irqs. Unconditionally enable/disable the vgic + timer irqs in the respective calls, instead relying on the percpu bookkeeping in the generic code to keep track of which cpus have the interrupts unmasked. Fixes: 466d27e48d7c ("KVM: arm64: Simplify the CPUHP logic") Reported-by: Oliver Upton Suggested-by: Oliver Upton Signed-off-by: Raghavendra Rao Ananta Link: https://lore.kernel.org/r/20230719175400.647154-1-rananta@google.com Acked-by: Marc Zyngier Signed-off-by: Oliver Upton commit e599e16c16a16be9907fb00608212df56d08d57b Merge: 69435880cf138 efa96cc99793b Author: Linus Torvalds Date: Thu Jul 20 10:10:02 2023 -0700 Merge tag 'iomap-6.5-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull iomap fix from Darrick Wong: "Fix partial write regression. It turns out that fstests doesn't have any test coverage for short writes, but LTP does. Fortunately, this was caught right after -rc1 was tagged. Summary: - Fix a bug wherein a failed write could clobber short write status" * tag 'iomap-6.5-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: iomap: micro optimize the ki_pos assignment in iomap_file_buffered_write iomap: fix a regression for partial write errors commit 69435880cf138484c3012f6c38dcbc5605de39ee Merge: 46670259519f4 f6250e205691a Author: Linus Torvalds Date: Thu Jul 20 10:03:41 2023 -0700 Merge tag 'xfs-6.5-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Darrick Wong: "Flexarray declaration conversions. This probably should've been done with the merge window open, but I was not aware that the UBSAN knob would be getting turned up for 6.5, and the fstests failures due to the kernel warnings are getting in the way of testing. Summary: - Convert all the array[1] declarations into the accepted flex array[] declarations so that UBSAN and friends will not get confused" * tag 'xfs-6.5-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: convert flex-array declarations in xfs attr shortform objects xfs: convert flex-array declarations in xfs attr leaf blocks xfs: convert flex-array declarations in struct xfs_attrlist* commit 350cd9b959757e7c571f45fab29d116d5f67cbff Author: Eric Van Hensbergen Date: Wed Jul 19 16:22:33 2023 +0000 fs/9p: remove unnecessary invalidate_inode_pages2 There was an invalidate_inode_pages2 added to readonly mmap path that is unnecessary since that path is only entered when writeback cache is disabled on mount. Cc: stable@vger.kernel.org Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") Reviewed-by: Christian Schoenebeck Signed-off-by: Eric Van Hensbergen commit 09430aba3a9ffd986834614a3406a13588170bde Author: Eric Van Hensbergen Date: Wed Jul 19 16:22:32 2023 +0000 fs/9p: fix type mismatch in file cache mode helper There were two flags (s_flags and s_cache) which had incorrect signed type in the parameters of the file cache mode helper function. Cc: stable@vger.kernel.org Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") Reviewed-by: Dominique Martinet Signed-off-by: Eric Van Hensbergen commit 878cb3e0337d7c3096aee301a2a3cd358dc8aa81 Author: Eric Van Hensbergen Date: Wed Jul 19 16:22:31 2023 +0000 fs/9p: fix typo in comparison logic for cache mode There appears to be a typo in the comparison statement for the logic which sets a file's cache mode based on mount flags. Cc: stable@vger.kernel.org Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") Reviewed-by: Christian Schoenebeck Reviewed-by: Dominique Martinet Signed-off-by: Eric Van Hensbergen commit 75b396821cb71164dac3a1ad51dda4781ea8dbad Author: Eric Van Hensbergen Date: Wed Jul 19 16:22:30 2023 +0000 fs/9p: remove unnecessary and overrestrictive check This eliminates a check for shared that was overrestrictive and prevented read-only mmaps when writeback caches weren't enabled. Cc: stable@vger.kernel.org Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") Reported-by: Robert Schwebel Closes: https://lore.kernel.org/v9fs/ZK25XZ%2BGpR3KHIB%2F@pengutronix.de Reviewed-by: Dominique Martinet Reviewed-by: Christian Schoenebeck Signed-off-by: Eric Van Hensbergen commit 6eaf41e87a223ae6f8e7a28d6e78384ad7e407f8 Author: Pablo Neira Ayuso Date: Thu Jul 20 09:17:21 2023 +0200 netfilter: nf_tables: skip bound chain on rule flush Skip bound chain when flushing table rules, the rule that owns this chain releases these objects. Otherwise, the following warning is triggered: WARNING: CPU: 2 PID: 1217 at net/netfilter/nf_tables_api.c:2013 nf_tables_chain_destroy+0x1f7/0x210 [nf_tables] CPU: 2 PID: 1217 Comm: chain-flush Not tainted 6.1.39 #1 RIP: 0010:nf_tables_chain_destroy+0x1f7/0x210 [nf_tables] Fixes: d0e2c7de92c7 ("netfilter: nf_tables: add NFT_CHAIN_BINDING") Reported-by: Kevin Rich Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 46670259519f4ee4ab378dc014798aabe77c5057 Merge: 2922800a1803f aa84ce8a78a1a Author: Linus Torvalds Date: Thu Jul 20 08:11:30 2023 -0700 Merge tag 'for-6.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "Stable fixes: - fix race between balance and cancel/pause - various iput() fixes - fix use-after-free of new block group that became unused - fix warning when putting transaction with qgroups enabled after abort - fix crash in subpage mode when page could be released between map and map read - when scrubbing raid56 verify the P/Q stripes unconditionally - fix minor memory leak in zoned mode when a block group with an unexpected superblock is found Regression fixes: - fix ordered extent split error handling when submitting direct IO - user irq-safe locking when adding delayed iputs" * tag 'for-6.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: fix warning when putting transaction with qgroups enabled after abort btrfs: fix ordered extent split error handling in btrfs_dio_submit_io btrfs: set_page_extent_mapped after read_folio in btrfs_cont_expand btrfs: raid56: always verify the P/Q contents for scrub btrfs: use irq safe locking when running and adding delayed iputs btrfs: fix iput() on error pointer after error during orphan cleanup btrfs: fix double iput() on inode after an error during orphan cleanup btrfs: zoned: fix memory leak after finding block group with super blocks btrfs: fix use-after-free of new block group that became unused btrfs: be a bit more careful when setting mirror_num_ret in btrfs_map_block btrfs: fix race between balance and cancel/pause commit bb54e6609977f5140eb0af9b0c42d957cb35b4f4 Author: Rob Herring Date: Mon Jul 17 16:53:58 2023 -0600 ARM: zynq: Explicitly include correct DT includes The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it was merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230717225358.3210536-1-robh@kernel.org Signed-off-by: Michal Simek commit 2922800a1803f6319e329bdbfd2962fd83eb5360 Merge: bfa3037d82805 98e2dd5f7a8be Author: Linus Torvalds Date: Thu Jul 20 08:06:18 2023 -0700 Merge tag 'regulator-fix-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fix from Mark Brown: "One fix for an issue with parsing partially specified DTs" * tag 'regulator-fix-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: da9063: fix null pointer deref with partial DT config commit 751d460ccff3137212f47d876221534bf0490996 Author: Pablo Neira Ayuso Date: Wed Jul 19 20:19:43 2023 +0200 netfilter: nf_tables: skip bound chain in netns release path Skip bound chain from netns release path, the rule that owns this chain releases these objects. Fixes: d0e2c7de92c7 ("netfilter: nf_tables: add NFT_CHAIN_BINDING") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 4cfca532ddc3474b3fc42592d0e4237544344b1a Author: Harald Freudenberger Date: Mon Jul 17 16:55:29 2023 +0200 s390/zcrypt: fix reply buffer calculations for CCA replies The length information for available buffer space for CCA replies is covered with two fields in the T6 header prepended on each CCA reply: fromcardlen1 and fromcardlen2. The sum of these both values must not exceed the AP bus limit for this card (24KB for CEX8, 12KB CEX7 and older) minus the always present headers. The current code adjusted the fromcardlen2 value in case of exceeding the AP bus limit when there was a non-zero value given from userspace. Some tests now showed that this was the wrong assumption. Instead the userspace value given for this field should always be trusted and if the sum of the two fields exceeds the AP bus limit for this card the first field fromcardlen1 should be adjusted instead. So now the calculation is done with this new insight in mind. Also some additional checks for overflow have been introduced and some comments to provide some documentation for future maintainers of this complicated calculation code. Furthermore the 128 bytes of fix overhead which is used in the current code is not correct. Investigations showed that for a reply always the same two header structs are prepended before a possible payload. So this is also fixed with this patch. Signed-off-by: Harald Freudenberger Reviewed-by: Holger Dengler Cc: stable@vger.kernel.org Signed-off-by: Heiko Carstens commit 1f7e9067756cac5b44b9701bbe0bb83e93011e47 Author: Wang Ming Date: Mon Jul 17 17:45:19 2023 +0800 s390/crypto: use kfree_sensitive() instead of kfree() key might contain private part of the key, so better use kfree_sensitive() to free it. Signed-off-by: Wang Ming Reviewed-by: Harald Freudenberger Link: https://lore.kernel.org/r/20230717094533.18418-1-machel@vivo.com Signed-off-by: Heiko Carstens commit d245aedc00775c4d7265a9f4522cc4e1fd34d102 Author: Johan Hovold Date: Thu Jul 20 09:53:57 2023 +0200 USB: serial: simple: sort driver entries Sort the driver symbols alphabetically in order to make it more obvious where new driver entries should be added. Cc: stable@vger.kernel.org Acked-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit 5f69c65e07b99ceb113d304fe31e0c653eb1c4bc Merge: de90f5165b1cd 269f399dc19f0 Author: Takashi Iwai Date: Thu Jul 20 15:16:11 2023 +0200 Merge tag 'asoc-fix-v6.5-rc1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.5 A few more fixes for v6.5, just small driver specific ones. commit a9e26169cfda651802f88262a315146fbe4bc74c Author: Guenter Roeck Date: Wed Jul 19 20:28:47 2023 -0700 regmap: Disable locking for RBTREE and MAPLE unit tests REGCACHE_RBTREE and REGCACHE_MAPLE dynamically allocate memory for regmap operations. This is incompatible with spinlock based locking which is used for fast_io operations. Disable locking for the associated unit tests to avoid lockdep splashes. Fixes: f033c26de5a5 ("regmap: Add maple tree based register cache") Fixes: 2238959b6ad2 ("regmap: Add some basic kunit tests") Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20230720032848.1306349-1-linux@roeck-us.net Signed-off-by: Mark Brown commit 644ee70267a934be27370f9aa618b29af7290544 Author: Bartosz Golaszewski Date: Wed Jul 19 13:41:01 2023 +0200 gpio: mvebu: fix irq domain leak Uwe Kleine-König pointed out we still have one resource leak in the mvebu driver triggered on driver detach. Let's address it with a custom devm action. Fixes: 812d47889a8e ("gpio/mvebu: Use irq_domain_add_linear") Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Uwe Kleine-König commit d1ff11d7ad8704f8d615f6446041c221b2d2ec4d Author: Cristian Marussi Date: Wed Jul 19 18:35:33 2023 +0100 firmware: arm_scmi: Fix chan_free cleanup on SMC SCMI transport based on SMC can optionally use an additional IRQ to signal message completion. The associated interrupt handler is currently allocated using devres but on shutdown the core SCMI stack will call .chan_free() well before any managed cleanup is invoked by devres. As a consequence, the arrival of a late reply to an in-flight pending transaction could still trigger the interrupt handler well after the SCMI core has cleaned up the channels, with unpleasant results. Inhibit further message processing on the IRQ path by explicitly freeing the IRQ inside .chan_free() callback itself. Fixes: dd820ee21d5e ("firmware: arm_scmi: Augment SMC/HVC to allow optional interrupt") Reported-by: Bjorn Andersson Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20230719173533.2739319-1-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit dd92c8a1f99bcd166204ffc219ea5a23dd65d64f Author: Oliver Neukum Date: Wed Jul 12 16:16:41 2023 +0200 USB: serial: simple: add Kaufmann RKS+CAN VCP Add the device and product ID for this CAN bus interface / license dongle. The device is usable either directly from user space or can be attached to a kernel CAN interface with slcan_attach. Reported-by: Kaufmann Automotive GmbH Tested-by: Kaufmann Automotive GmbH Signed-off-by: Oliver Neukum [ johan: amend commit message and move entries in sort order ] Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 857ea9005806e2a458016880278f98715873e977 Author: Mohsen Tahmasebi Date: Mon Jul 10 11:22:18 2023 +0330 USB: serial: option: add Quectel EC200A module support Add Quectel EC200A "DIAG, AT, MODEM": 0x6005: ECM / RNDIS + DIAG + AT + MODEM T: Bus=01 Lev=01 Prnt=02 Port=05 Cnt=01 Dev#= 8 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=6005 Rev=03.18 S: Manufacturer=Android S: Product=Android S: SerialNumber=0000 C: #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether E: Ad=87(I) Atr=03(Int.) MxPS= 64 Ivl=4096ms I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=0c(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=0b(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=89(I) Atr=03(Int.) MxPS= 64 Ivl=4096ms I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=0a(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=88(I) Atr=03(Int.) MxPS= 64 Ivl=4096ms Signed-off-by: Mohsen Tahmasebi Tested-by: Mostafa Ghofrani Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 11c9027c983e9e4b408ee5613b6504d24ebd85be Author: Eric Dumazet Date: Thu Jul 20 11:44:38 2023 +0000 can: raw: fix lockdep issue in raw_release() syzbot complained about a lockdep issue [1] Since raw_bind() and raw_setsockopt() first get RTNL before locking the socket, we must adopt the same order in raw_release() [1] WARNING: possible circular locking dependency detected 6.5.0-rc1-syzkaller-00192-g78adb4bcf99e #0 Not tainted ------------------------------------------------------ syz-executor.0/14110 is trying to acquire lock: ffff88804e4b6130 (sk_lock-AF_CAN){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1708 [inline] ffff88804e4b6130 (sk_lock-AF_CAN){+.+.}-{0:0}, at: raw_bind+0xb1/0xab0 net/can/raw.c:435 but task is already holding lock: ffffffff8e3df368 (rtnl_mutex){+.+.}-{3:3}, at: raw_bind+0xa7/0xab0 net/can/raw.c:434 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (rtnl_mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747 raw_release+0x1c6/0x9b0 net/can/raw.c:391 __sock_release+0xcd/0x290 net/socket.c:654 sock_close+0x1c/0x20 net/socket.c:1386 __fput+0x3fd/0xac0 fs/file_table.c:384 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (sk_lock-AF_CAN){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5144 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 lock_sock_nested+0x3a/0xf0 net/core/sock.c:3492 lock_sock include/net/sock.h:1708 [inline] raw_bind+0xb1/0xab0 net/can/raw.c:435 __sys_bind+0x1ec/0x220 net/socket.c:1792 __do_sys_bind net/socket.c:1803 [inline] __se_sys_bind net/socket.c:1801 [inline] __x64_sys_bind+0x72/0xb0 net/socket.c:1801 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rtnl_mutex); lock(sk_lock-AF_CAN); lock(rtnl_mutex); lock(sk_lock-AF_CAN); *** DEADLOCK *** 1 lock held by syz-executor.0/14110: stack backtrace: CPU: 0 PID: 14110 Comm: syz-executor.0 Not tainted 6.5.0-rc1-syzkaller-00192-g78adb4bcf99e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x311/0x3f0 kernel/locking/lockdep.c:2195 check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5144 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 lock_sock_nested+0x3a/0xf0 net/core/sock.c:3492 lock_sock include/net/sock.h:1708 [inline] raw_bind+0xb1/0xab0 net/can/raw.c:435 __sys_bind+0x1ec/0x220 net/socket.c:1792 __do_sys_bind net/socket.c:1803 [inline] __se_sys_bind net/socket.c:1801 [inline] __x64_sys_bind+0x72/0xb0 net/socket.c:1801 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fd89007cb29 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd890d2a0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000031 RAX: ffffffffffffffda RBX: 00007fd89019bf80 RCX: 00007fd89007cb29 RDX: 0000000000000010 RSI: 0000000020000040 RDI: 0000000000000003 RBP: 00007fd8900c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fd89019bf80 R15: 00007ffebf8124f8 Fixes: ee8b94c8510c ("can: raw: fix receiver memory leak") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Ziyang Xuan Cc: Oliver Hartkopp Cc: stable@vger.kernel.org Cc: Marc Kleine-Budde Link: https://lore.kernel.org/all/20230720114438.172434-1-edumazet@google.com Signed-off-by: Marc Kleine-Budde commit 78e9b217d78e9f69c5699ccff18794ea03be597f Author: Arnd Bergmann Date: Fri Jun 9 14:06:32 2023 +0200 accel/habanalabs: add more debugfs stub helpers Two functions got added with normal prototypes for debugfs, but not alternative when building without it: drivers/accel/habanalabs/common/device.c: In function 'hl_device_init': drivers/accel/habanalabs/common/device.c:2177:14: error: implicit declaration of function 'hl_debugfs_device_init'; did you mean 'hl_debugfs_init'? [-Werror=implicit-function-declaration] drivers/accel/habanalabs/common/device.c:2305:9: error: implicit declaration of function 'hl_debugfs_device_fini'; did you mean 'hl_debugfs_remove_file'? [-Werror=implicit-function-declaration] Add stubs for these as well. Fixes: 3b9abb4fa642 ("accel/habanalabs: expose debugfs files later") Signed-off-by: Arnd Bergmann Reviewed-by: Tomer Tayar Acked-by: Oded Gabbay Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20230609120636.3969045-1-arnd@kernel.org commit 71e06e1acecbb50e712a3be9a7d56778509f3538 Author: Zhen Lei Date: Thu Jul 13 19:58:31 2023 +0800 arm64: vdso: Clear common make C=2 warnings make C=2 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- xxx.o When I use the command above to do a 'make C=2' check on any object file, the following warnings are always output: CHECK arch/arm64/kernel/vdso/vgettimeofday.c arch/arm64/kernel/vdso/vgettimeofday.c:9:5: warning: symbol '__kernel_clock_gettime' was not declared. Should it be static? arch/arm64/kernel/vdso/vgettimeofday.c:15:5: warning: symbol '__kernel_gettimeofday' was not declared. Should it be static? arch/arm64/kernel/vdso/vgettimeofday.c:21:5: warning: symbol '__kernel_clock_getres' was not declared. Should it be static? Therefore, the declaration of the three functions is added to eliminate these common warnings to provide a clean output. Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20230713115831.777-1-thunder.leizhen@huawei.com Signed-off-by: Will Deacon commit a8bd38dbc57c2fe074df2c9e549b9c2ad3183c83 Author: Nikhil V Date: Thu Jul 13 12:37:57 2023 +0530 arm64: mm: Make hibernation aware of KFENCE In the restore path, swsusp_arch_suspend_exit uses copy_page() to over-write memory. However, with features like KFENCE enabled, there could be situations where it may have marked some pages as not valid, due to which it could be reported as invalid accesses. Consider a situation where page 'P' was part of the hibernation image. Now, when the resume kernel tries to restore the pages, the same page 'P' is already in use in the resume kernel and is kfence protected, due to which its mapping is removed from linear map. Since restoring pages happens with the resume kernel page tables, we would end up accessing 'P' during copy and results in kernel pagefault. The proposed fix tries to solve this issue by marking PTE as valid for such kfence protected pages. Co-developed-by: Pavankumar Kondeti Signed-off-by: Pavankumar Kondeti Signed-off-by: Nikhil V Link: https://lore.kernel.org/r/20230713070757.4093-1-quic_nprakash@quicinc.com Signed-off-by: Will Deacon commit 87b5a5c209405cb6b57424cdfa226a6dbd349232 Author: Florian Westphal Date: Wed Jul 19 21:08:21 2023 +0200 netfilter: nft_set_pipapo: fix improper element removal end key should be equal to start unless NFT_SET_EXT_KEY_END is present. Its possible to add elements that only have a start key ("{ 1.0.0.0 . 2.0.0.0 }") without an internval end. Insertion treats this via: if (nft_set_ext_exists(ext, NFT_SET_EXT_KEY_END)) end = (const u8 *)nft_set_ext_key_end(ext)->data; else end = start; but removal side always uses nft_set_ext_key_end(). This is wrong and leads to garbage remaining in the set after removal next lookup/insert attempt will give: BUG: KASAN: slab-use-after-free in pipapo_get+0x8eb/0xb90 Read of size 1 at addr ffff888100d50586 by task nft-pipapo_uaf_/1399 Call Trace: kasan_report+0x105/0x140 pipapo_get+0x8eb/0xb90 nft_pipapo_insert+0x1dc/0x1710 nf_tables_newsetelem+0x31f5/0x4e00 .. Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges") Reported-by: lonial con Reviewed-by: Stefano Brivio Signed-off-by: Florian Westphal commit 314c82841602a111c04a7210c21dc77e0d560242 Author: Florian Westphal Date: Tue Jul 18 01:30:33 2023 +0200 netfilter: nf_tables: can't schedule in nft_chain_validate Can be called via nft set element list iteration, which may acquire rcu and/or bh read lock (depends on set type). BUG: sleeping function called from invalid context at net/netfilter/nf_tables_api.c:3353 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 1232, name: nft preempt_count: 0, expected: 0 RCU nest depth: 1, expected: 0 2 locks held by nft/1232: #0: ffff8881180e3ea8 (&nft_net->commit_mutex){+.+.}-{3:3}, at: nf_tables_valid_genid #1: ffffffff83f5f540 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire Call Trace: nft_chain_validate nft_lookup_validate_setelem nft_pipapo_walk nft_lookup_validate nft_chain_validate nft_immediate_validate nft_chain_validate nf_tables_validate nf_tables_abort No choice but to move it to nf_tables_validate(). Fixes: 81ea01066741 ("netfilter: nf_tables: add rescheduling points during loop detection walks") Signed-off-by: Florian Westphal commit ddbd8be68941985f166f5107109a90ce13147c44 Author: Florian Westphal Date: Thu Jul 20 00:29:58 2023 +0200 netfilter: nf_tables: fix spurious set element insertion failure On some platforms there is a padding hole in the nft_verdict structure, between the verdict code and the chain pointer. On element insertion, if the new element clashes with an existing one and NLM_F_EXCL flag isn't set, we want to ignore the -EEXIST error as long as the data associated with duplicated element is the same as the existing one. The data equality check uses memcmp. For normal data (NFT_DATA_VALUE) this works fine, but for NFT_DATA_VERDICT padding area leads to spurious failure even if the verdict data is the same. This then makes the insertion fail with 'already exists' error, even though the new "key : data" matches an existing entry and userspace told the kernel that it doesn't want to receive an error indication. Fixes: c016c7e45ddf ("netfilter: nf_tables: honor NLM_F_EXCL flag in set element insertion") Signed-off-by: Florian Westphal commit f8a2da6ec2417cca169fa85a8ab15817bccbb109 Author: Marc Kleine-Budde Date: Tue Jul 18 11:43:54 2023 +0200 can: gs_usb: gs_can_close(): add missing set of CAN state to CAN_STATE_STOPPED After an initial link up the CAN device is in ERROR-ACTIVE mode. Due to a missing CAN_STATE_STOPPED in gs_can_close() it doesn't change to STOPPED after a link down: | ip link set dev can0 up | ip link set dev can0 down | ip --details link show can0 | 13: can0: mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10 | link/can promiscuity 0 allmulti 0 minmtu 0 maxmtu 0 | can state ERROR-ACTIVE restart-ms 1000 Add missing assignment of CAN_STATE_STOPPED in gs_can_close(). Cc: stable@vger.kernel.org Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Link: https://lore.kernel.org/all/20230718-gs_usb-fix-can-state-v1-1-f19738ae2c23@pengutronix.de Signed-off-by: Marc Kleine-Budde commit de90f5165b1cda3f1b5975165e2da8a69dfae1d6 Author: Vitaly Rodionov Date: Thu Jul 20 09:20:22 2023 +0100 ALSA: hda/realtek: Add support for DELL Oasis 13/14/16 laptops Adding support for new Dell laptops using Cirrus Logic CS35L41 smart amplifiers with Realtek codec. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20230720082022.13033-2-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit f7b069cf08816252f494d193b9ecdff172bf9aa1 Author: Vitaly Rodionov Date: Thu Jul 20 09:20:21 2023 +0100 ALSA: hda/realtek: Fix generic fixup definition for cs35l41 amp Generic fixup for CS35L41 amplifies should not have vendor specific chained fixup. For ThinkPad laptops with led issue, we can just add specific fixup. Fixes: a6ac60b36dade (ALSA: hda/realtek: Fix mute led issue on thinkpad with cs35l41 s-codec) Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20230720082022.13033-1-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit ac528649f7c63bc233cc0d33cff11f767cc666e3 Merge: 9f9d4c1a2e821 7ebd00a5a20c4 Author: Paolo Abeni Date: Thu Jul 20 10:46:33 2023 +0200 Merge branch 'net-support-stp-on-bridge-in-non-root-netns' Kuniyuki Iwashima says: ==================== net: Support STP on bridge in non-root netns. Currently, STP does not work in non-root netns as llc_rcv() drops packets from non-root netns. This series fixes it by making some protocol handlers netns-aware, which are called from llc_rcv() as follows: llc_rcv() | |- sap->rcv_func : registered by llc_sap_open() | | * functions : regsitered by register_8022_client() | -> No in-kernel user call register_8022_client() | | * snap_rcv() | | | `- proto->rcvfunc() : registered by register_snap_client() | | * aarp_rcv() : drop packets from non-root netns | * atalk_rcv() : drop packets from non-root netns | | * stp_pdu_rcv() | | | `- garp_protos[]->rcv() : registered by stp_proto_register() | | * garp_pdu_rcv() : netns-aware | * br_stp_rcv() : netns-aware | |- llc_type_handlers[llc_pdu_type(skb) - 1] | | * llc_sap_handler() : NOT netns-aware (Patch 1) | * llc_conn_handler() : NOT netns-aware (Patch 2) | `- llc_station_handler * llc_station_rcv() : netns-aware Patch 1 & 2 convert not-netns-aware functions and Patch 3 remove the netns restriction in llc_rcv(). Note this series does not namespacify AF_LLC so that these patches can be backported to stable without conflicts (at least to 4.14.y). Another series that adds netns support for AF_LLC will be targeted to net-next later. ==================== Link: https://lore.kernel.org/r/20230718174152.57408-1-kuniyu@amazon.com Signed-off-by: Paolo Abeni commit 7ebd00a5a20c48e6020d49a3b2afb3cdfd2da8b7 Author: Kuniyuki Iwashima Date: Tue Jul 18 10:41:52 2023 -0700 Revert "bridge: Add extack warning when enabling STP in netns." This reverts commit 56a16035bb6effb37177867cea94c13a8382f745. Since the previous commit, STP works on bridge in netns. # unshare -n # ip link add br0 type bridge # ip link add veth0 type veth peer name veth1 # ip link set veth0 master br0 up [ 50.558135] br0: port 1(veth0) entered blocking state [ 50.558366] br0: port 1(veth0) entered disabled state [ 50.558798] veth0: entered allmulticast mode [ 50.564401] veth0: entered promiscuous mode # ip link set veth1 master br0 up [ 54.215487] br0: port 2(veth1) entered blocking state [ 54.215657] br0: port 2(veth1) entered disabled state [ 54.215848] veth1: entered allmulticast mode [ 54.219577] veth1: entered promiscuous mode # ip link set br0 type bridge stp_state 1 # ip link set br0 up [ 61.960726] br0: port 2(veth1) entered blocking state [ 61.961097] br0: port 2(veth1) entered listening state [ 61.961495] br0: port 1(veth0) entered blocking state [ 61.961653] br0: port 1(veth0) entered listening state [ 63.998835] br0: port 2(veth1) entered blocking state [ 77.437113] br0: port 1(veth0) entered learning state [ 86.653501] br0: received packet on veth0 with own address as source address (addr:6e:0f:e7:6f:5f:5f, vlan:0) [ 92.797095] br0: port 1(veth0) entered forwarding state [ 92.797398] br0: topology change detected, propagating Let's remove the warning. Signed-off-by: Kuniyuki Iwashima Signed-off-by: Paolo Abeni commit 6631463b6e6673916d2481f692938f393148aa82 Author: Kuniyuki Iwashima Date: Tue Jul 18 10:41:51 2023 -0700 llc: Don't drop packet from non-root netns. Now these upper layer protocol handlers can be called from llc_rcv() as sap->rcv_func(), which is registered by llc_sap_open(). * function which is passed to register_8022_client() -> no in-kernel user calls register_8022_client(). * snap_rcv() `- proto->rcvfunc() : registered by register_snap_client() -> aarp_rcv() and atalk_rcv() drop packets from non-root netns * stp_pdu_rcv() `- garp_protos[]->rcv() : registered by stp_proto_register() -> garp_pdu_rcv() and br_stp_rcv() are netns-aware So, we can safely remove the netns restriction in llc_rcv(). Fixes: e730c15519d0 ("[NET]: Make packet reception network namespace safe") Signed-off-by: Kuniyuki Iwashima Signed-off-by: Paolo Abeni commit 97b1d320f48c21e40cc42b4ac033f2520f9ecc5c Author: Kuniyuki Iwashima Date: Tue Jul 18 10:41:50 2023 -0700 llc: Check netns in llc_estab_match() and llc_listener_match(). We will remove this restriction in llc_rcv() in the following patch, which means that the protocol handler must be aware of netns. if (!net_eq(dev_net(dev), &init_net)) goto drop; llc_rcv() fetches llc_type_handlers[llc_pdu_type(skb) - 1] and calls it if not NULL. If the PDU type is LLC_DEST_CONN, llc_conn_handler() is called to pass skb to corresponding sockets. Then, we must look up a proper socket in the same netns with skb->dev. llc_conn_handler() calls __llc_lookup() to look up a established or litening socket by __llc_lookup_established() and llc_lookup_listener(). Both functions iterate on a list and call llc_estab_match() or llc_listener_match() to check if the socket is the correct destination. However, these functions do not check netns. Also, bind() and connect() call llc_establish_connection(), which finally calls __llc_lookup_established(), to check if there is a conflicting socket. Let's test netns in llc_estab_match() and llc_listener_match(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Paolo Abeni commit 9b64e93e83c2145a750e780198b41d612e3dfa5d Author: Kuniyuki Iwashima Date: Tue Jul 18 10:41:49 2023 -0700 llc: Check netns in llc_dgram_match(). We will remove this restriction in llc_rcv() soon, which means that the protocol handler must be aware of netns. if (!net_eq(dev_net(dev), &init_net)) goto drop; llc_rcv() fetches llc_type_handlers[llc_pdu_type(skb) - 1] and calls it if not NULL. If the PDU type is LLC_DEST_SAP, llc_sap_handler() is called to pass skb to corresponding sockets. Then, we must look up a proper socket in the same netns with skb->dev. If the destination is a multicast address, llc_sap_handler() calls llc_sap_mcast(). It calculates a hash based on DSAP and skb->dev->ifindex, iterates on a socket list, and calls llc_mcast_match() to check if the socket is the correct destination. Then, llc_mcast_match() checks if skb->dev matches with llc_sk(sk)->dev. So, we need not check netns here. OTOH, if the destination is a unicast address, llc_sap_handler() calls llc_lookup_dgram() to look up a socket, but it does not check the netns. Therefore, we need to add netns check in llc_lookup_dgram(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Paolo Abeni commit 4f7cab49cecee16120d27c1734cfdf3d6c0e5329 Author: Jerry Meng Date: Thu Jun 29 17:35:22 2023 +0800 USB: serial: option: support Quectel EM060K_128 EM060K_128 is EM060K's sub-model, having the same name "Quectel EM060K-GL" MBIM + GNSS + DIAG + NMEA + AT + QDSS + DPL T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 8 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0128 Rev= 5.04 S: Manufacturer=Quectel S: Product=Quectel EM060K-GL S: SerialNumber=f6fa08b6 C:* #Ifs= 8 Cfg#= 1 Atr=a0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none) E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 7 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none) E: Ad=8f(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Jerry Meng Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit d8e42a2b0addf238be8b3b37dcd9795a5c1be459 Author: Sven Eckelmann Date: Wed Jul 19 10:01:15 2023 +0200 batman-adv: Don't increase MTU when set by user If the user set an MTU value, it usually means that there are special requirements for the MTU. But if an interface gots activated, the MTU was always recalculated and then the user set value was overwritten. The only reason why this user set value has to be overwritten, is when the MTU has to be decreased because batman-adv is not able to transfer packets with the user specified size. Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol") Cc: stable@vger.kernel.org Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit c6a953cce8d0438391e6da48c8d0793d3fbfcfa6 Author: Sven Eckelmann Date: Wed Jul 19 09:29:29 2023 +0200 batman-adv: Trigger events for auto adjusted MTU If an interface changes the MTU, it is expected that an NETDEV_PRECHANGEMTU and NETDEV_CHANGEMTU notification events is triggered. This worked fine for .ndo_change_mtu based changes because core networking code took care of it. But for auto-adjustments after hard-interfaces changes, these events were simply missing. Due to this problem, non-batman-adv components weren't aware of MTU changes and thus couldn't perform their own tasks correctly. Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol") Cc: stable@vger.kernel.org Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit e8812acb5bf724f2fc23a500e590c776ebda7b0a Author: Rob Herring Date: Tue Jul 18 08:32:26 2023 -0600 fbdev: Explicitly include correct DT includes The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Reviewed-by: Thomas Zimmermann Signed-off-by: Rob Herring Signed-off-by: Helge Deller commit 9d5651ad2ae7b2ddfc56ff243a08937d9681f950 Author: Yuanjun Gong Date: Mon Jul 17 22:48:09 2023 +0800 fbdev: ep93xx-fb: fix return value check in ep93xxfb_probe function clk_prepare_enable may fail in ep93xxfb_probe, therefore, add a return value check to clk_prepare_enable and handle the error. Signed-off-by: Yuanjun Gong Signed-off-by: Helge Deller commit 4e88761f5f8c7869f15a2046b1a1116f4fab4ac8 Author: Zhang Shurong Date: Sat Jul 15 16:16:56 2023 +0800 fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe This func misses checking for platform_get_irq()'s call and may passes the negative error codes to request_irq(), which takes unsigned IRQ #, causing it to fail with -EINVAL, overriding an original error code. Fix this by stop calling request_irq() with invalid IRQ #s. Fixes: 1630d85a8312 ("au1200fb: fix hardcoded IRQ") Signed-off-by: Zhang Shurong Signed-off-by: Helge Deller commit 298e082558d86aa904486d087ce45d35c1122f1e Author: Colin Ian King Date: Wed Jul 12 17:11:23 2023 +0100 fbdev: kyro: make some const read-only arrays static and reduce type size Don't populate the const read-only arrays on the stack but instead make them static const. Use smaller types to use less storage for the arrays. Also makes the object code a little smaller. Signed-off-by: Colin Ian King Signed-off-by: Helge Deller commit 933ab3a81cb73d08bc6b4eadeb3a98c9194abdf5 Author: Jiri Slaby (SUSE) Date: Wed Jul 12 10:59:42 2023 +0200 fbcon: remove unused display (p) from fbcon_redraw() The parameter is unused. Signed-off-by: "Jiri Slaby (SUSE)" Cc: Daniel Vetter Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Helge Deller commit 4f2ba39a40480e6019133730f1741fdbb7137290 Author: Jiri Slaby (SUSE) Date: Wed Jul 12 10:59:41 2023 +0200 sticon: make sticon_set_def_font() void and remove op parameter sticon_set_def_font() always returns 0, so make it void. And remove an unused 'op' parameter. Signed-off-by: "Jiri Slaby (SUSE)" Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Helge Deller commit 1023ca1973c6253f7ba9024b2b0c27168f50ab3d Author: Jiri Slaby (SUSE) Date: Wed Jul 12 10:59:40 2023 +0200 vgacon: cache vc_cell_height in vgacon_cursor() There are many places c->vc_cell_height is used in the code of vgacon_cursor(). Caching the value to a local variable makes the code much easier to follow. Signed-off-by: "Jiri Slaby (SUSE)" Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Helge Deller commit 93686f6b01df3e904569ee7265ee181d859b201d Author: Jiri Slaby (SUSE) Date: Wed Jul 12 10:59:39 2023 +0200 vgacon: let vgacon_doresize() return void The return value is neither used, nor vgacon_doresize() returns an error. So change the reurn type to void. Signed-off-by: "Jiri Slaby (SUSE)" Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Helge Deller commit c900dc6858e87e2f2396954377ae956925b17135 Author: Jiri Slaby (SUSE) Date: Wed Jul 12 10:59:38 2023 +0200 vgacon: remove unused xpos from vgacon_set_cursor_size() xpos is unused, remove it. Signed-off-by: "Jiri Slaby (SUSE)" Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Helge Deller commit 6ceed69cde8fe4a78fe50d62d7a88a5c1eed4709 Author: Jiri Slaby (SUSE) Date: Wed Jul 12 10:59:37 2023 +0200 vgacon: remove unneeded forward declarations Most of the forward declarations in vgacon are not needed. Drop them. Signed-off-by: "Jiri Slaby (SUSE)" Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Helge Deller commit 03b89a08484a88fb9e0604cab2b3eb0c2f265c74 Author: Jiri Slaby (SUSE) Date: Wed Jul 12 10:59:36 2023 +0200 vgacon: switch vgacon_scrolldelta() and vgacon_restore_screen() Switch vgacon_scrolldelta() and vgacon_restore_screen() positions, so that the former is not needed to be forward-declared. Signed-off-by: "Jiri Slaby (SUSE)" Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Helge Deller commit 9f9d4c1a2e82174a4e799ec405284a2b0de32b6a Author: Daniel Golle Date: Wed Jul 19 01:39:36 2023 +0100 net: ethernet: mtk_eth_soc: always mtk_get_ib1_pkt_type entries and bind debugfs files would display wrong data on NETSYS_V2 and later because instead of using mtk_get_ib1_pkt_type the driver would use MTK_FOE_IB1_PACKET_TYPE which corresponds to NETSYS_V1(.x) SoCs. Use mtk_get_ib1_pkt_type so entries and bind records display correctly. Fixes: 03a3180e5c09e ("net: ethernet: mtk_eth_soc: introduce flow offloading support for mt7986") Signed-off-by: Daniel Golle Acked-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/c0ae03d0182f4d27b874cbdf0059bc972c317f3c.1689727134.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski commit 88f2e009761d120eea31e71dafd73b8433b0e379 Merge: 81b3ade5d2b98 e31a9fedc7d8d Author: Jakub Kicinski Date: Wed Jul 19 21:09:14 2023 -0700 Merge branch 'r8169-revert-two-changes-that-caused-regressions' Heiner Kallweit says: ==================== r8169: revert two changes that caused regressions This reverts two changes that caused regressions. ==================== Link: https://lore.kernel.org/r/ddadceae-19c9-81b8-47b5-a4ff85e2563a@gmail.com Signed-off-by: Jakub Kicinski commit e31a9fedc7d8d80722b19628e66fcb5a36981780 Author: Heiner Kallweit Date: Tue Jul 18 13:12:32 2023 +0200 Revert "r8169: disable ASPM during NAPI poll" This reverts commit e1ed3e4d91112027b90c7ee61479141b3f948e6a. Turned out the change causes a performance regression. Link: https://lore.kernel.org/netdev/20230713124914.GA12924@green245/T/ Cc: stable@vger.kernel.org Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/055c6bc2-74fa-8c67-9897-3f658abb5ae7@gmail.com Signed-off-by: Jakub Kicinski commit cf2ffdea0839398cb0551762af7f5efb0a6e0fea Author: Heiner Kallweit Date: Tue Jul 18 13:11:31 2023 +0200 r8169: revert 2ab19de62d67 ("r8169: remove ASPM restrictions now that ASPM is disabled during NAPI poll") There have been reports that on a number of systems this change breaks network connectivity. Therefore effectively revert it. Mainly affected seem to be systems where BIOS denies ASPM access to OS. Due to later changes we can't do a direct revert. Fixes: 2ab19de62d67 ("r8169: remove ASPM restrictions now that ASPM is disabled during NAPI poll") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/netdev/e47bac0d-e802-65e1-b311-6acb26d5cf10@freenet.de/T/ Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217596 Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/57f13ec0-b216-d5d8-363d-5b05528ec5fb@gmail.com Signed-off-by: Jakub Kicinski commit 81b3ade5d2b98ad6e0a473b0e1e420a801275592 Author: Kuniyuki Iwashima Date: Mon Jul 17 14:59:18 2023 -0700 Revert "tcp: avoid the lookup process failing to get sk in ehash table" This reverts commit 3f4ca5fafc08881d7a57daa20449d171f2887043. Commit 3f4ca5fafc08 ("tcp: avoid the lookup process failing to get sk in ehash table") reversed the order in how a socket is inserted into ehash to fix an issue that ehash-lookup could fail when reqsk/full sk/twsk are swapped. However, it introduced another lookup failure. The full socket in ehash is allocated from a slab with SLAB_TYPESAFE_BY_RCU and does not have SOCK_RCU_FREE, so the socket could be reused even while it is being referenced on another CPU doing RCU lookup. Let's say a socket is reused and inserted into the same hash bucket during lookup. After the blamed commit, a new socket is inserted at the end of the list. If that happens, we will skip sockets placed after the previous position of the reused socket, resulting in ehash lookup failure. As described in Documentation/RCU/rculist_nulls.rst, we should insert a new socket at the head of the list to avoid such an issue. This issue, the swap-lookup-failure, and another variant reported in [0] can all be handled properly by adding a locked ehash lookup suggested by Eric Dumazet [1]. However, this issue could occur for every packet, thus more likely than the other two races, so let's revert the change for now. Link: https://lore.kernel.org/netdev/20230606064306.9192-1-duanmuquan@baidu.com/ [0] Link: https://lore.kernel.org/netdev/CANn89iK8snOz8TYOhhwfimC7ykYA78GA3Nyv8x06SZYa1nKdyA@mail.gmail.com/ [1] Fixes: 3f4ca5fafc08 ("tcp: avoid the lookup process failing to get sk in ehash table") Signed-off-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230717215918.15723-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit 80b6051085c5fedcb1dfd7b2562a63a83655c4d8 Author: Yu Kuai Date: Wed Jul 5 10:40:01 2023 +0800 scsi: sg: Fix checking return value of blk_get_queue() Commit fcaa174a9c99 ("scsi/sg: don't grab scsi host module reference") make a mess how blk_get_queue() is called, blk_get_queue() returns true on success while the caller expects it returns 0 on success. Fix this problem and also add a corresponding error message on failure. Fixes: fcaa174a9c99 ("scsi/sg: don't grab scsi host module reference") Reported-by: Marc Hartmayer Closes: https://lore.kernel.org/all/87lefv622n.fsf@linux.ibm.com/ Signed-off-by: Yu Kuai Link: https://lore.kernel.org/r/20230705024001.177585-1-yukuai1@huaweicloud.com Tested-by: Shin'ichiro Kawasaki Tested-by: Marc Hartmayer Reviewed-by: Christoph Hellwig Reviewed-by: Marc Hartmayer Signed-off-by: Martin K. Petersen commit 8974eb588283b7d44a7c91fa09fcbaf380339f3a Author: Daniel Sneddon Date: Wed Jul 12 19:43:11 2023 -0700 x86/speculation: Add Gather Data Sampling mitigation Gather Data Sampling (GDS) is a hardware vulnerability which allows unprivileged speculative access to data which was previously stored in vector registers. Intel processors that support AVX2 and AVX512 have gather instructions that fetch non-contiguous data elements from memory. On vulnerable hardware, when a gather instruction is transiently executed and encounters a fault, stale data from architectural or internal vector registers may get transiently stored to the destination vector register allowing an attacker to infer the stale data using typical side channel techniques like cache timing attacks. This mitigation is different from many earlier ones for two reasons. First, it is enabled by default and a bit must be set to *DISABLE* it. This is the opposite of normal mitigation polarity. This means GDS can be mitigated simply by updating microcode and leaving the new control bit alone. Second, GDS has a "lock" bit. This lock bit is there because the mitigation affects the hardware security features KeyLocker and SGX. It needs to be enabled and *STAY* enabled for these features to be mitigated against GDS. The mitigation is enabled in the microcode by default. Disable it by setting gather_data_sampling=off or by disabling all mitigations with mitigations=off. The mitigation status can be checked by reading: /sys/devices/system/cpu/vulnerabilities/gather_data_sampling Signed-off-by: Daniel Sneddon Signed-off-by: Dave Hansen Acked-by: Josh Poimboeuf commit e80698b7f8e9ddc3b23e5fba2eea7bc24c06c537 Merge: aa7cb3789b429 a3f25d614bc73 Author: Jakub Kicinski Date: Wed Jul 19 15:01:10 2023 -0700 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Alexei Starovoitov says: ==================== pull-request: bpf 2023-07-19 We've added 4 non-merge commits during the last 1 day(s) which contain a total of 3 files changed, 55 insertions(+), 10 deletions(-). The main changes are: 1) Fix stack depth check in presence of async callbacks, from Kumar Kartikeya Dwivedi. 2) Fix BTI type used for freplace attached functions, from Alexander Duyck. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf, arm64: Fix BTI type used for freplace attached functions selftests/bpf: Add more tests for check_max_stack_depth bug bpf: Repeat check_max_stack_depth for async callbacks bpf: Fix subprog idx logic in check_max_stack_depth ==================== Link: https://lore.kernel.org/r/20230719174502.74023-1-alexei.starovoitov@gmail.com Signed-off-by: Jakub Kicinski commit e7dd44f4f3166db45248414f5df8f615392de47a Author: Baoquan He Date: Fri Jul 7 21:58:51 2023 +0800 clk: fixed-mmio: make COMMON_CLK_FIXED_MMIO depend on HAS_IOMEM On s390 systems (aka mainframes), it has classic channel devices for networking and permanent storage that are currently even more common than PCI devices. Hence it could have a fully functional s390 kernel with CONFIG_PCI=n, then the relevant iomem mapping functions [including ioremap(), devm_ioremap(), etc.] are not available. Here let COMMON_CLK_FIXED_MMIO depend on HAS_IOMEM so that it won't be built to cause below compiling error if PCI is unset: ------ ld: drivers/clk/clk-fixed-mmio.o: in function `fixed_mmio_clk_setup': clk-fixed-mmio.c:(.text+0x5e): undefined reference to `of_iomap' ld: clk-fixed-mmio.c:(.text+0xba): undefined reference to `iounmap' ------ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306211329.ticOJCSv-lkp@intel.com/ Signed-off-by: Baoquan He Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Link: https://lore.kernel.org/r/20230707135852.24292-8-bhe@redhat.com Signed-off-by: Stephen Boyd commit a29b2fccf5f2689a9637be85ff1f51c834c6fb33 Author: Geert Uytterhoeven Date: Tue Jul 11 17:08:12 2023 +0200 clk: imx93: Propagate correct error in imx93_clocks_probe() smatch reports: drivers/clk/imx/clk-imx93.c:294 imx93_clocks_probe() error: uninitialized symbol 'base'. Indeed, in case of an error, the wrong (yet uninitialized) variable is converted to an error code and returned. Fix this by propagating the error code in the correct variable. Fixes: e02ba11b45764705 ("clk: imx93: fix memory leak and missing unwind goto in imx93_clocks_probe") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/9c2acd81-3ad8-485d-819e-9e4201277831@kadam.mountain Reported-by: kernel test robot Closes: https://lore.kernel.org/all/202306161533.4YDmL22b-lkp@intel.com/ Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230711150812.3562221-1-geert+renesas@glider.be Reviewed-by: Peng Fan Signed-off-by: Stephen Boyd commit 13558a2e6341d1ba6dff9f8e2febf97877067885 Author: Ahmad Khalifa Date: Wed Jul 19 20:28:48 2023 +0100 hwmon: (nct6775) Fix IN scaling factors for 6798/6799 Scaling for VTT/VIN5/VIN6 registers were based on prior chips * Split scaling factors for 6798/6799 and assign at probe() * Pass them through driver data to sysfs functions Tested on nct6799 with old/new input/min/max Fixes: 0599682b826f ("hwmon: (nct6775) Add support for NCT6798D") Signed-off-by: Ahmad Khalifa Link: https://lore.kernel.org/r/20230719192848.337508-1-ahmad@khalifa.ws Signed-off-by: Guenter Roeck commit 1eb8d61ac5c9c7ec56bb96d433532807509b9288 Author: Chen-Yu Tsai Date: Wed Jul 19 15:42:50 2023 +0800 clk: mediatek: mt8183: Add back SSPM related clocks This reverts commit 860690a93ef23b567f781c1b631623e27190f101. On the MT8183, the SSPM related clocks were removed claiming a lack of usage. This however causes some issues when the driver was converted to the new simple-probe mechanism. This mechanism allocates enough space for all the clocks defined in the clock driver, not the highest index in the DT binding. This leads to out-of-bound writes if their are holes in the DT binding or the driver (due to deprecated or unimplemented clocks). These errors can go unnoticed and cause memory corruption, leading to crashes in unrelated areas, or nothing at all. KASAN will detect them. Add the SSPM related clocks back to the MT8183 clock driver to fully implement the DT binding. The SSPM clocks are for the power management co-processor, and should never be turned off. They are marked as such. Fixes: 3f37ba7cc385 ("clk: mediatek: mt8183: Convert all remaining clocks to common probe") Signed-off-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20230719074251.1219089-1-wenst@chromium.org Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit 5534f44627418897cd901d725303ce3dedd7bc1e Author: Rafael J. Wysocki Date: Wed Jul 19 20:10:03 2023 +0200 Revert "intel_idle: Add support for using intel_idle in a VM guest using just hlt" This reverts commit 2f3d08f074b0 ("intel_idle: Add support for using intel_idle in a VM guest using just hlt"), because it causes functional issues to appear and it is not really useful without a related commit that got reverted previously. Link: https://lore.kernel.org/linux-pm/5c7de6d5-7706-c4a5-7c41-146db1269aff@intel.com Reported-by: Xiaoyao Li Requested-by: Peter Zijlstra Signed-off-by: Rafael J. Wysocki commit 0e4c2b6b0c4a4b4014d9424c27e5e79d185229c5 Author: Matus Gajdos Date: Wed Jul 19 18:47:29 2023 +0200 ASoC: fsl_spdif: Silence output on stop Clear TX registers on stop to prevent the SPDIF interface from sending last written word over and over again. Fixes: a2388a498ad2 ("ASoC: fsl: Add S/PDIF CPU DAI driver") Signed-off-by: Matus Gajdos Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20230719164729.19969-1-matuszpd@gmail.com Signed-off-by: Mark Brown commit a5155c023d6a2c9ff5f4fad5f75117578a58affc Author: Rafael J. Wysocki Date: Wed Jul 19 19:57:39 2023 +0200 Revert "intel_idle: Add a "Long HLT" C1 state for the VM guest mode" This reverts commit 0fac214bb75e ("intel_idle: Add a "Long HLT" C1 state for the VM guest mode"), because there is a coding mistake in it and its validity is questioned. Link: https://lore.kernel.org/all/20230711132553.GN3062772@hirez.programming.kicks-ass.net Requested-by: Peter Zijlstra Signed-off-by: Rafael J. Wysocki commit bfa3037d828050896ae52f6467b6ca2489ae6fb1 Merge: ccff6d117d8dc 6a567e920fd04 Author: Linus Torvalds Date: Wed Jul 19 11:00:27 2023 -0700 Merge tag 'fuse-update-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse Pull fuse fixes from Miklos Szeredi: "Small but important fixes and a trivial cleanup" * tag 'fuse-update-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: ioctl: translate ENOSYS in outarg fuse: revalidate: don't invalidate if interrupted fuse: Apply flags2 only when userspace set the FUSE_INIT_EXT fuse: remove duplicate check for nodeid fuse: add feature flag for expire-only commit d46b0a05bdc849d39c75268ddaf654c59bd6785c Author: Rafael J. Wysocki Date: Wed Jul 19 19:56:08 2023 +0200 Revert "intel_idle: Add __init annotation to matchup_vm_state_with_baremetal()" This reverts commit b2918089d5cb ("intel_idle: Add __init annotation to matchup_vm_state_with_baremetal()"), because the commit fixed by it will be reverted. Signed-off-by: Rafael J. Wysocki commit da042eb4f061a0b54aedadcaa15391490c48e1ad Author: Krzysztof Kozlowski Date: Wed Jul 19 08:16:52 2023 +0200 firmware: arm_scmi: Drop OF node reference in the transport channel setup The OF node reference obtained from of_parse_phandle() should be dropped if node is not compatible with arm,scmi-shmem. Fixes: 507cd4d2c5eb ("firmware: arm_scmi: Add compatibility checks for shmem node") Cc: Signed-off-by: Krzysztof Kozlowski Reviewed-by: Cristian Marussi Link: https://lore.kernel.org/r/20230719061652.8850-1-krzysztof.kozlowski@linaro.org Signed-off-by: Sudeep Holla commit 84f68679032147dcdac9bb4d8eb8f4638e995dc6 Author: Oliver Upton Date: Tue Jul 18 18:45:37 2023 +0000 KVM: arm64: Allow pKVM on v1.0 compatible FF-A implementations pKVM initialization fails on systems with v1.1+ FF-A implementations, as the hyp does a strict match on the returned version from FFA_VERSION. This is a stronger assertion than required by the specification, which requires minor revisions be backwards compatible with earlier revisions of the same major version. Relax the check in hyp_ffa_init() to only test the returned major version. Even though v1.1 broke ABI, the expectation is that firmware incapable of using the v1.0 ABI return NOT_SUPPORTED instead of a valid version. Acked-by: Marc Zyngier Acked-by: Will Deacon Link: https://lore.kernel.org/r/20230718184537.3220867-1-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 0659400f18c0e6c0c69d74fe5d09e7f6fbbd52a2 Author: Luka Guzenko Date: Tue Jul 18 18:12:41 2023 +0200 ALSA: hda/realtek: Enable Mute LED on HP Laptop 15s-eq2xxx The HP Laptop 15s-eq2xxx uses ALC236 codec and controls the mute LED using COEF 0x07 index 1. No existing quirk covers this configuration. Adds a new quirk and enables it for the device. Signed-off-by: Luka Guzenko Cc: Link: https://lore.kernel.org/r/20230718161241.393181-1-l.guzenko@web.de Signed-off-by: Takashi Iwai commit a2a93f4e2fd400907f89753025d1e4bebb64d4db Author: Takashi Iwai Date: Wed Jul 19 13:43:36 2023 +0200 selftests: ALSA: Add test-pcmtest-driver to .gitignore It was forgotten to add the new binary to .gitignore. Let's fix it. Fixes: 10b98a4db11a ("selftests: ALSA: Add test for the 'pcmtest' driver") Link: https://lore.kernel.org/r/20230719114336.18409-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit b460a52257b1f5299ca70b7d1bb32442d3ce7bf6 Author: Mark Brown Date: Wed Jul 19 00:30:40 2023 +0100 regcache: Push async I/O request down into the rbtree cache Currently the regcache core unconditionally enables async I/O for all cache types, causing problems for the maple tree cache which dynamically allocates the buffers used to write registers to the device since async requires the buffers to be kept around until the I/O has been completed. This use of async I/O is mainly for the rbtree cache which stores data in a format directly usable for regmap_raw_write(), though there is a special case for single register writes which would also have allowed it to be used with the flat cache. It is a bit of a landmine for other caches since it implicitly converts sync operations to async, and with modern hardware it is not clear that async I/O is actually a performance win as shown by the performance work David Jander did with SPI. In multi core systems the cost of managing concurrency ends up swamping the performance benefit and almost all modern systems are multi core. Address this by pushing the enablement of async I/O down into the rbtree cache where it is actively used, avoiding surprises for other cache implementations. Reported-by: Charles Keepax Fixes: bfa0b38c1483 ("regmap: maple: Implement block sync for the maple tree cache") Reviewed-by: Charles Keepax Tested-by: Charles Keepax Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230719-regcache-async-rbtree-v1-1-b03d30cf1daf@kernel.org Signed-off-by: Mark Brown commit 1945063eb59e64d2919cb14d54d081476d9e53bb Author: Uwe Kleine-König Date: Mon Jul 17 16:27:43 2023 +0200 gpio: mvebu: Make use of devm_pwmchip_add This allows to get rid of a call to pwmchip_remove() in the error path. There is no .remove function for this driver, so this change fixes a resource leak when a gpio-mvebu device is unbound. Fixes: 757642f9a584 ("gpio: mvebu: Add limited PWM support") Signed-off-by: Uwe Kleine-König Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 106ea7ffd56b0f9454cd4f625474967f12ac4dbd Author: Andrew Donnellan Date: Wed Jul 19 17:18:21 2023 +1000 Revert "powerpc/64s: Remove support for ELFv1 little endian userspace" This reverts commit 606787fed7268feb256957872586370b56af697a. ELFv1 with LE has never been a thing, and people who try to make ELFv1 LE binaries are maniacs who need to be stopped, but unfortunately there are ELFv1 LE binaries out there in the wild. One such binary is the ppc64el (as Debian calls it) helper for arch-test[0], a tool for detecting architectures that can be executed on a given machine by means of attempting to execute helper binaries compiled for each architecture and seeing which binaries succeed and fail. The helpers are small snippets of assembly, and the ppc64el assembly doesn't include the right directives to generate an ELFv2 binary. This results in arch-test incorrectly determining that a ppc64el kernel can't execute a ppc64el userspace, which in turn means that a number of developer tools such as debootstrap will break (assuming arch-test is installed). [0] https://github.com/kilobyte/arch-test Signed-off-by: Andrew Donnellan Signed-off-by: Michael Ellerman Link: https://msgid.link/20230719071821.320594-1-ajd@linux.ibm.com commit aa7cb3789b429d4fdfbe767e0e0cf8c769299d7a Author: Yuanjun Gong Date: Mon Jul 17 22:49:18 2023 +0800 ipv4: ip_gre: fix return value check in erspan_xmit() goto free_skb if an unexpected result is returned by pskb_tirm() in erspan_xmit(). Signed-off-by: Yuanjun Gong Reviewed-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 02d84f3eb53a5be982b17c88410fa6c58806356b Author: Yuanjun Gong Date: Mon Jul 17 22:49:02 2023 +0800 ipv4: ip_gre: fix return value check in erspan_fb_xmit() goto err_free_skb if an unexpected result is returned by pskb_tirm() in erspan_fb_xmit(). Signed-off-by: Yuanjun Gong Reviewed-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit bce5603365d8184734ba7e6b22e74bd2c90a7167 Author: Yuanjun Gong Date: Mon Jul 17 22:46:52 2023 +0800 drivers:net: fix return value check in ocelot_fdma_receive_skb ocelot_fdma_receive_skb should return false if an unexpected value is returned by pskb_trim. Signed-off-by: Yuanjun Gong Reviewed-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 78a93c31003cc53aca5d67b1bbe2d5b9fc37cc4d Author: Yuanjun Gong Date: Mon Jul 17 22:46:21 2023 +0800 drivers: net: fix return value check in emac_tso_csum() in emac_tso_csum(), return an error code if an unexpected value is returned by pskb_trim(). Signed-off-by: Yuanjun Gong Reviewed-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 4258faa130be4ea43e5e2d839467da421b8ff274 Author: Yuanjun Gong Date: Mon Jul 17 22:45:19 2023 +0800 net:ipv6: check return value of pskb_trim() goto tx_err if an unexpected result is returned by pskb_tirm() in ip6erspan_tunnel_xmit(). Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support") Signed-off-by: Yuanjun Gong Reviewed-by: David Ahern Reviewed-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 5a7adc6c1069ce31ef4f606ae9c05592c80a6ab5 Author: Hans de Goede Date: Mon Jul 10 14:34:25 2023 +0200 gpio: tps68470: Make tps68470_gpio_output() always set the initial value Make tps68470_gpio_output() call tps68470_gpio_set() for output-only pins too, so that the initial value passed to gpiod_direction_output() is honored for these pins too. Fixes: 275b13a65547 ("gpio: Add support for TPS68470 GPIOs") Reviewed-by: Andy Shevchenko Reviewed-by: Daniel Scally Tested-by: Daniel Scally Reviewed-by: Sakari Ailus Signed-off-by: Hans de Goede Signed-off-by: Bartosz Golaszewski commit daa751444fd9d4184270b1479d8af49aaf1a1ee6 Author: Wang Ming Date: Mon Jul 17 17:59:19 2023 +0800 net: ipv4: Use kfree_sensitive instead of kfree key might contain private part of the key, so better use kfree_sensitive to free it. Fixes: 38320c70d282 ("[IPSEC]: Use crypto_aead and authenc in ESP") Signed-off-by: Wang Ming Reviewed-by: Tariq Toukan Reviewed-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit ea293f823a8805735d9e00124df81a8f448ed1ae Author: Ben Skeggs Date: Wed Jul 19 14:40:51 2023 +1000 drm/nouveau/kms/nv50-: init hpd_irq_lock for PIOR DP Fixes OOPS on boards with ANX9805 DP encoders. Cc: stable@vger.kernel.org # 6.4+ Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20230719044051.6975-3-skeggsb@gmail.com commit 2b5d1c29f6c4cb19369ef92881465e5ede75f4ef Author: Ben Skeggs Date: Wed Jul 19 14:40:50 2023 +1000 drm/nouveau/disp: PIOR DP uses GPIO for HPD, not PMGR AUX interrupts Fixes crash on boards with ANX9805 TMDS/DP encoders. Cc: stable@vger.kernel.org # 6.4+ Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20230719044051.6975-2-skeggsb@gmail.com commit 752a281032b2d6f4564be827e082bde6f7d2fd4f Author: Ben Skeggs Date: Wed Jul 19 14:40:49 2023 +1000 drm/nouveau/i2c: fix number of aux event slots This was completely bogus before, using maximum DCB device index rather than maximum AUX ID to size the buffer that stores event refcounts. *Pretty* unlikely to have been an actual problem on most configurations, that is, unless you've got one of the rare boards that have off-chip DP. There, it'll likely crash. Cc: stable@vger.kernel.org # 6.4+ Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20230719044051.6975-1-skeggsb@gmail.com commit 53cab4d871690c49fac87c657cbf459e39c5b93b Author: Lucas Stach Date: Mon Jul 17 16:54:09 2023 +0200 soc: imx: imx8mp-blk-ctrl: register HSIO PLL clock as bus_power_dev child The blk-ctrl device is deliberately placed outside of the GPC power domain as it needs to control the power sequencing of the blk-ctrl domains together with the GPC domains. Clock runtime PM works by operating on the clock parent device, which doesn't translate into the neccessary GPC power domain action if the clk parent is not part of the GPC power domain. Use the bus_power_device as the parent for the clock to trigger the proper GPC domain actions on clock runtime power management. Fixes: 2cbee26e5d59 ("soc: imx: imx8mp-blk-ctrl: expose high performance PLL clock") Reported-by: Yannic Moog Signed-off-by: Lucas Stach Tested-by: Yannic Moog Signed-off-by: Shawn Guo commit 7f5acea727e7a41ed40ed07d45e88ccdb01a87f5 Merge: e9b2bd96af6fc c34743daca0eb Author: Jakub Kicinski Date: Tue Jul 18 19:49:08 2023 -0700 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-07-17 (iavf) This series contains updates to iavf driver only. Ding Hui fixes use-after-free issue by calling netif_napi_del() for all allocated q_vectors. He also resolves out-of-bounds issue by not updating to new values when timeout is encountered. Marcin and Ahmed change the way resets are handled so that the callback operating under the RTNL lock will wait for the reset to finish, the rtnl_lock sensitive functions in reset flow will schedule the netdev update for later in order to remove circular dependency with the critical lock. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: iavf: fix reset task race with iavf_remove() iavf: fix a deadlock caused by rtnl and driver's lock circular dependencies Revert "iavf: Do not restart Tx queues after reset task failure" Revert "iavf: Detach device during reset task" iavf: Wait for reset in callbacks which trigger it iavf: use internal state to free traffic IRQs iavf: Fix out-of-bounds when setting channels on remove iavf: Fix use-after-free in free_netdev ==================== Link: https://lore.kernel.org/r/20230717175205.3217774-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit e9b2bd96af6fc35a81e37bbc2f3277d3677e6126 Merge: e7002b3b20c58 eba20811f3265 Author: Jakub Kicinski Date: Tue Jul 18 19:45:29 2023 -0700 Merge branch 'tcp-annotate-data-races-in-tcp_rsk-req' Eric Dumazet says: ==================== tcp: annotate data-races in tcp_rsk(req) Small series addressing two syzbot reports around tcp_rsk(req) ==================== Link: https://lore.kernel.org/r/20230717144445.653164-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit eba20811f32652bc1a52d5e7cc403859b86390d9 Author: Eric Dumazet Date: Mon Jul 17 14:44:45 2023 +0000 tcp: annotate data-races around tcp_rsk(req)->ts_recent TCP request sockets are lockless, tcp_rsk(req)->ts_recent can change while being read by another cpu as syzbot noticed. This is harmless, but we should annotate the known races. Note that tcp_check_req() changes req->ts_recent a bit early, we might change this in the future. BUG: KCSAN: data-race in tcp_check_req / tcp_check_req write to 0xffff88813c8afb84 of 4 bytes by interrupt on cpu 1: tcp_check_req+0x694/0xc70 net/ipv4/tcp_minisocks.c:762 tcp_v4_rcv+0x12db/0x1b70 net/ipv4/tcp_ipv4.c:2071 ip_protocol_deliver_rcu+0x356/0x6d0 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x13c/0x1a0 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:303 [inline] ip_local_deliver+0xec/0x1c0 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:468 [inline] ip_rcv_finish net/ipv4/ip_input.c:449 [inline] NF_HOOK include/linux/netfilter.h:303 [inline] ip_rcv+0x197/0x270 net/ipv4/ip_input.c:569 __netif_receive_skb_one_core net/core/dev.c:5493 [inline] __netif_receive_skb+0x90/0x1b0 net/core/dev.c:5607 process_backlog+0x21f/0x380 net/core/dev.c:5935 __napi_poll+0x60/0x3b0 net/core/dev.c:6498 napi_poll net/core/dev.c:6565 [inline] net_rx_action+0x32b/0x750 net/core/dev.c:6698 __do_softirq+0xc1/0x265 kernel/softirq.c:571 do_softirq+0x7e/0xb0 kernel/softirq.c:472 __local_bh_enable_ip+0x64/0x70 kernel/softirq.c:396 local_bh_enable+0x1f/0x20 include/linux/bottom_half.h:33 rcu_read_unlock_bh include/linux/rcupdate.h:843 [inline] __dev_queue_xmit+0xabb/0x1d10 net/core/dev.c:4271 dev_queue_xmit include/linux/netdevice.h:3088 [inline] neigh_hh_output include/net/neighbour.h:528 [inline] neigh_output include/net/neighbour.h:542 [inline] ip_finish_output2+0x700/0x840 net/ipv4/ip_output.c:229 ip_finish_output+0xf4/0x240 net/ipv4/ip_output.c:317 NF_HOOK_COND include/linux/netfilter.h:292 [inline] ip_output+0xe5/0x1b0 net/ipv4/ip_output.c:431 dst_output include/net/dst.h:458 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] __ip_queue_xmit+0xa4d/0xa70 net/ipv4/ip_output.c:533 ip_queue_xmit+0x38/0x40 net/ipv4/ip_output.c:547 __tcp_transmit_skb+0x1194/0x16e0 net/ipv4/tcp_output.c:1399 tcp_transmit_skb net/ipv4/tcp_output.c:1417 [inline] tcp_write_xmit+0x13ff/0x2fd0 net/ipv4/tcp_output.c:2693 __tcp_push_pending_frames+0x6a/0x1a0 net/ipv4/tcp_output.c:2877 tcp_push_pending_frames include/net/tcp.h:1952 [inline] __tcp_sock_set_cork net/ipv4/tcp.c:3336 [inline] tcp_sock_set_cork+0xe8/0x100 net/ipv4/tcp.c:3343 rds_tcp_xmit_path_complete+0x3b/0x40 net/rds/tcp_send.c:52 rds_send_xmit+0xf8d/0x1420 net/rds/send.c:422 rds_send_worker+0x42/0x1d0 net/rds/threads.c:200 process_one_work+0x3e6/0x750 kernel/workqueue.c:2408 worker_thread+0x5f2/0xa10 kernel/workqueue.c:2555 kthread+0x1d7/0x210 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 read to 0xffff88813c8afb84 of 4 bytes by interrupt on cpu 0: tcp_check_req+0x32a/0xc70 net/ipv4/tcp_minisocks.c:622 tcp_v4_rcv+0x12db/0x1b70 net/ipv4/tcp_ipv4.c:2071 ip_protocol_deliver_rcu+0x356/0x6d0 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x13c/0x1a0 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:303 [inline] ip_local_deliver+0xec/0x1c0 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:468 [inline] ip_rcv_finish net/ipv4/ip_input.c:449 [inline] NF_HOOK include/linux/netfilter.h:303 [inline] ip_rcv+0x197/0x270 net/ipv4/ip_input.c:569 __netif_receive_skb_one_core net/core/dev.c:5493 [inline] __netif_receive_skb+0x90/0x1b0 net/core/dev.c:5607 process_backlog+0x21f/0x380 net/core/dev.c:5935 __napi_poll+0x60/0x3b0 net/core/dev.c:6498 napi_poll net/core/dev.c:6565 [inline] net_rx_action+0x32b/0x750 net/core/dev.c:6698 __do_softirq+0xc1/0x265 kernel/softirq.c:571 run_ksoftirqd+0x17/0x20 kernel/softirq.c:939 smpboot_thread_fn+0x30a/0x4a0 kernel/smpboot.c:164 kthread+0x1d7/0x210 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 value changed: 0x1cd237f1 -> 0x1cd237f2 Fixes: 079096f103fa ("tcp/dccp: install syn_recv requests into ehash table") Signed-off-by: Eric Dumazet Reported-by: syzbot Reviewed-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230717144445.653164-3-edumazet@google.com Signed-off-by: Jakub Kicinski commit 5e5265522a9a7f91d1b0bd411d634bdaf16c80cd Author: Eric Dumazet Date: Mon Jul 17 14:44:44 2023 +0000 tcp: annotate data-races around tcp_rsk(req)->txhash TCP request sockets are lockless, some of their fields can change while being read by another cpu as syzbot noticed. This is usually harmless, but we should annotate the known races. This patch takes care of tcp_rsk(req)->txhash, a separate one is needed for tcp_rsk(req)->ts_recent. BUG: KCSAN: data-race in tcp_make_synack / tcp_rtx_synack write to 0xffff8881362304bc of 4 bytes by task 32083 on cpu 1: tcp_rtx_synack+0x9d/0x2a0 net/ipv4/tcp_output.c:4213 inet_rtx_syn_ack+0x38/0x80 net/ipv4/inet_connection_sock.c:880 tcp_check_req+0x379/0xc70 net/ipv4/tcp_minisocks.c:665 tcp_v6_rcv+0x125b/0x1b20 net/ipv6/tcp_ipv6.c:1673 ip6_protocol_deliver_rcu+0x92f/0xf30 net/ipv6/ip6_input.c:437 ip6_input_finish net/ipv6/ip6_input.c:482 [inline] NF_HOOK include/linux/netfilter.h:303 [inline] ip6_input+0xbd/0x1b0 net/ipv6/ip6_input.c:491 dst_input include/net/dst.h:468 [inline] ip6_rcv_finish+0x1e2/0x2e0 net/ipv6/ip6_input.c:79 NF_HOOK include/linux/netfilter.h:303 [inline] ipv6_rcv+0x74/0x150 net/ipv6/ip6_input.c:309 __netif_receive_skb_one_core net/core/dev.c:5452 [inline] __netif_receive_skb+0x90/0x1b0 net/core/dev.c:5566 netif_receive_skb_internal net/core/dev.c:5652 [inline] netif_receive_skb+0x4a/0x310 net/core/dev.c:5711 tun_rx_batched+0x3bf/0x400 tun_get_user+0x1d24/0x22b0 drivers/net/tun.c:1997 tun_chr_write_iter+0x18e/0x240 drivers/net/tun.c:2043 call_write_iter include/linux/fs.h:1871 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x4ab/0x7d0 fs/read_write.c:584 ksys_write+0xeb/0x1a0 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x42/0x50 fs/read_write.c:646 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd read to 0xffff8881362304bc of 4 bytes by task 32078 on cpu 0: tcp_make_synack+0x367/0xb40 net/ipv4/tcp_output.c:3663 tcp_v6_send_synack+0x72/0x420 net/ipv6/tcp_ipv6.c:544 tcp_conn_request+0x11a8/0x1560 net/ipv4/tcp_input.c:7059 tcp_v6_conn_request+0x13f/0x180 net/ipv6/tcp_ipv6.c:1175 tcp_rcv_state_process+0x156/0x1de0 net/ipv4/tcp_input.c:6494 tcp_v6_do_rcv+0x98a/0xb70 net/ipv6/tcp_ipv6.c:1509 tcp_v6_rcv+0x17b8/0x1b20 net/ipv6/tcp_ipv6.c:1735 ip6_protocol_deliver_rcu+0x92f/0xf30 net/ipv6/ip6_input.c:437 ip6_input_finish net/ipv6/ip6_input.c:482 [inline] NF_HOOK include/linux/netfilter.h:303 [inline] ip6_input+0xbd/0x1b0 net/ipv6/ip6_input.c:491 dst_input include/net/dst.h:468 [inline] ip6_rcv_finish+0x1e2/0x2e0 net/ipv6/ip6_input.c:79 NF_HOOK include/linux/netfilter.h:303 [inline] ipv6_rcv+0x74/0x150 net/ipv6/ip6_input.c:309 __netif_receive_skb_one_core net/core/dev.c:5452 [inline] __netif_receive_skb+0x90/0x1b0 net/core/dev.c:5566 netif_receive_skb_internal net/core/dev.c:5652 [inline] netif_receive_skb+0x4a/0x310 net/core/dev.c:5711 tun_rx_batched+0x3bf/0x400 tun_get_user+0x1d24/0x22b0 drivers/net/tun.c:1997 tun_chr_write_iter+0x18e/0x240 drivers/net/tun.c:2043 call_write_iter include/linux/fs.h:1871 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x4ab/0x7d0 fs/read_write.c:584 ksys_write+0xeb/0x1a0 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x42/0x50 fs/read_write.c:646 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0x91d25731 -> 0xe79325cd Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 32078 Comm: syz-executor.4 Not tainted 6.5.0-rc1-syzkaller-00033-geb26cbb1a754 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 Fixes: 58d607d3e52f ("tcp: provide skb->hash to synack packets") Signed-off-by: Eric Dumazet Reported-by: syzbot Reviewed-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230717144445.653164-2-edumazet@google.com Signed-off-by: Jakub Kicinski commit 957961b6dcc813e6222a4f7e8e3626fcd1f1e098 Author: Joaquín Ignacio Aramendía Date: Mon Jul 17 19:25:15 2023 -0300 hwmon: (oxp-sensors) Move tt_toggle attribute to dev_groups A driver should not be manually adding groups in its probe function (it will race with userspace), so replace the call to devm_device_add_groups() to use the platform dev_groups callback instead. This will allow for removal of the devm_device_add_groups() function. Signed-off-by: Joaquín Ignacio Aramendía Fixes: be144ee49127 ("hwmon: (oxp-sensors) Add tt_toggle attribute on supported boards") Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230717222526.229984-2-samsagax@gmail.com Signed-off-by: Guenter Roeck commit e7002b3b20c58bce4a88c15aca8e6cc894e3a7ed Author: Subbaraya Sundeep Date: Mon Jul 17 11:46:43 2023 +0530 octeontx2-pf: mcs: Generate hash key using ecb(aes) Hardware generated encryption and ICV tags are found to be wrong when tested with IEEE MACSEC test vectors. This is because as per the HRM, the hash key (derived by AES-ECB block encryption of an all 0s block with the SAK) has to be programmed by the software in MCSX_RS_MCS_CPM_TX_SLAVE_SA_PLCY_MEM_4X register. Hence fix this by generating hash key in software and configuring in hardware. Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading") Signed-off-by: Subbaraya Sundeep Reviewed-by: Kalesh AP Link: https://lore.kernel.org/r/1689574603-28093-1-git-send-email-sbhatta@marvell.com Signed-off-by: Jakub Kicinski commit c486762fb17c99fd642beea3e1e4744d093c262a Author: Dmitry Baryshkov Date: Sun Jul 9 23:30:19 2023 +0300 ARM: dts: nxp/imx: limit sk-imx53 supported frequencies The SK-IMX53 board, bearing i.MX536A CPU, is not stable when running at 1.2 GHz (default iMX53 maximum). The SoC is only rated up to 800 MHz. Disable 1.2 GHz and 1 GHz frequencies. Fixes: 0b8576d8440a ("ARM: dts: imx: Add support for SK-iMX53 board") Signed-off-by: Dmitry Baryshkov Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 78adb4bcf99effbb960c5f9091e2e062509d1030 Author: Florian Kauer Date: Mon Jul 17 10:54:44 2023 -0700 igc: Prevent garbled TX queue with XDP ZEROCOPY In normal operation, each populated queue item has next_to_watch pointing to the last TX desc of the packet, while each cleaned item has it set to 0. In particular, next_to_use that points to the next (necessarily clean) item to use has next_to_watch set to 0. When the TX queue is used both by an application using AF_XDP with ZEROCOPY as well as a second non-XDP application generating high traffic, the queue pointers can get in an invalid state where next_to_use points to an item where next_to_watch is NOT set to 0. However, the implementation assumes at several places that this is never the case, so if it does hold, bad things happen. In particular, within the loop inside of igc_clean_tx_irq(), next_to_clean can overtake next_to_use. Finally, this prevents any further transmission via this queue and it never gets unblocked or signaled. Secondly, if the queue is in this garbled state, the inner loop of igc_clean_tx_ring() will never terminate, completely hogging a CPU core. The reason is that igc_xdp_xmit_zc() reads next_to_use before acquiring the lock, and writing it back (potentially unmodified) later. If it got modified before locking, the outdated next_to_use is written pointing to an item that was already used elsewhere (and thus next_to_watch got written). Fixes: 9acf59a752d4 ("igc: Enable TX via AF_XDP zero-copy") Signed-off-by: Florian Kauer Reviewed-by: Kurt Kanzenbach Tested-by: Kurt Kanzenbach Acked-by: Vinicius Costa Gomes Reviewed-by: Simon Horman Tested-by: Naama Meir Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20230717175444.3217831-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 936fd2c50bddd8c1dbe49bc7bb31c5e5975fdf2e Merge: 195e903b342a7 9efa1a5407e81 Author: Jakub Kicinski Date: Tue Jul 18 18:33:34 2023 -0700 Merge tag 'linux-can-fixes-for-6.5-20230717' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2023-07-17 The 1st patch is by Ziyang Xuan and fixes a possible memory leak in the receiver handling in the CAN RAW protocol. YueHaibing contributes a use after free in bcm_proc_show() of the Broad Cast Manager (BCM) CAN protocol. The next 2 patches are by me and fix a possible null pointer dereference in the RX path of the gs_usb driver with activated hardware timestamps and the candlelight firmware. The last patch is by Fedor Ross, Marek Vasut and me and targets the mcp251xfd driver. The polling timeout of __mcp251xfd_chip_set_mode() is increased to fix bus joining on busy CAN buses and very low bit rate. * tag 'linux-can-fixes-for-6.5-20230717' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: mcp251xfd: __mcp251xfd_chip_set_mode(): increase poll timeout can: gs_usb: fix time stamp counter initialization can: gs_usb: gs_can_open(): improve error handling can: bcm: Fix UAF in bcm_proc_show() can: raw: fix receiver memory leak ==================== Link: https://lore.kernel.org/r/20230717180938.230816-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit 195e903b342a73c08c3249cec55b07bf3f23200a Author: John Fastabend Date: Mon Jul 17 10:33:06 2023 -0700 mailmap: Add entry for old intel email Fix old email to avoid bouncing email from net/drivers and older netdev work. Anyways my @intel email hasn't been active for years. Signed-off-by: John Fastabend Link: https://lore.kernel.org/r/20230717173306.38407-1-john.fastabend@gmail.com Signed-off-by: Jakub Kicinski commit d1998e505a995f5305a6add46f3d806fa38dae06 Author: Shannon Nelson Date: Mon Jul 17 12:32:42 2023 -0700 mailmap: add entries for past lives Update old emails for my current work email. Signed-off-by: Shannon Nelson Link: https://lore.kernel.org/r/20230717193242.43670-1-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski commit 2187d6ca8209d34a29aec3cd5c7b6c05dc6da43f Merge: 8fcd7c7b3a38a 031c99e71fedc Author: Jakub Kicinski Date: Tue Jul 18 16:52:15 2023 -0700 Merge branch 'selftests-tc-increase-timeout-and-add-missing-kconfig' Matthieu Baerts says: ==================== selftests: tc: increase timeout and add missing kconfig When looking for something else in LKFT reports [1], I noticed that the TC selftest ended with a timeout error: not ok 1 selftests: tc-testing: tdc.sh # TIMEOUT 45 seconds I also noticed most of the tests were skipped because the "teardown stage" did not complete successfully. It was due to missing kconfig. These patches fix these two errors plus an extra one because this selftest reads info from "/proc/net/nf_conntrack". Thank you Pedro for having helped me fixing these issues [2]. Link: https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230711/testrun/18267241/suite/kselftest-tc-testing/test/tc-testing_tdc_sh/log [1] Link: https://lore.kernel.org/netdev/0e061d4a-9a23-9f58-3b35-d8919de332d7@tessares.net/T/ [2] ==================== Link: https://lore.kernel.org/r/20230713-tc-selftests-lkft-v1-0-1eb4fd3a96e7@tessares.net Signed-off-by: Jakub Kicinski commit 031c99e71fedcce93b6785d38b7d287bf59e3952 Author: Matthieu Baerts Date: Thu Jul 13 23:16:46 2023 +0200 selftests: tc: add ConnTrack procfs kconfig When looking at the TC selftest reports, I noticed one test was failing because /proc/net/nf_conntrack was not available. not ok 373 3992 - Add ct action triggering DNAT tuple conflict Could not match regex pattern. Verify command output: cat: /proc/net/nf_conntrack: No such file or directory It is only available if NF_CONNTRACK_PROCFS kconfig is set. So the issue can be fixed simply by adding it to the list of required kconfig. Fixes: e46905641316 ("tc-testing: add test for ct DNAT tuple collision") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/netdev/0e061d4a-9a23-9f58-3b35-d8919de332d7@tessares.net/T/ [1] Signed-off-by: Matthieu Baerts Tested-by: Zhengchao Shao Link: https://lore.kernel.org/r/20230713-tc-selftests-lkft-v1-3-1eb4fd3a96e7@tessares.net Acked-by: Jamal Hadi Salim Signed-off-by: Jakub Kicinski commit 719b4774a8cb1a501e2d22a5a4a3a0a870e427d5 Author: Matthieu Baerts Date: Thu Jul 13 23:16:45 2023 +0200 selftests: tc: add 'ct' action kconfig dep When looking for something else in LKFT reports [1], I noticed most of the tests were skipped because the "teardown stage" did not complete successfully. Pedro found out this is due to the fact CONFIG_NF_FLOW_TABLE is required but not listed in the 'config' file. Adding it to the list fixes the issues on LKFT side. CONFIG_NET_ACT_CT is now set to 'm' in the final kconfig. Fixes: c34b961a2492 ("net/sched: act_ct: Create nf flow table per zone") Cc: stable@vger.kernel.org Link: https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230711/testrun/18267241/suite/kselftest-tc-testing/test/tc-testing_tdc_sh/log [1] Link: https://lore.kernel.org/netdev/0e061d4a-9a23-9f58-3b35-d8919de332d7@tessares.net/T/ [2] Suggested-by: Pedro Tammela Signed-off-by: Matthieu Baerts Tested-by: Zhengchao Shao Link: https://lore.kernel.org/r/20230713-tc-selftests-lkft-v1-2-1eb4fd3a96e7@tessares.net Acked-by: Jamal Hadi Salim Signed-off-by: Jakub Kicinski commit fda05798c22a354efde09a76bdfc276b2d591829 Author: Matthieu Baerts Date: Thu Jul 13 23:16:44 2023 +0200 selftests: tc: set timeout to 15 minutes When looking for something else in LKFT reports [1], I noticed that the TC selftest ended with a timeout error: not ok 1 selftests: tc-testing: tdc.sh # TIMEOUT 45 seconds The timeout had been introduced 3 years ago, see the Fixes commit below. This timeout is only in place when executing the selftests via the kselftests runner scripts. I guess this is not what most TC devs are using and nobody noticed the issue before. The new timeout is set to 15 minutes as suggested by Pedro [2]. It looks like it is plenty more time than what it takes in "normal" conditions. Fixes: 852c8cbf34d3 ("selftests/kselftest/runner.sh: Add 45 second timeout per test") Cc: stable@vger.kernel.org Link: https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230711/testrun/18267241/suite/kselftest-tc-testing/test/tc-testing_tdc_sh/log [1] Link: https://lore.kernel.org/netdev/0e061d4a-9a23-9f58-3b35-d8919de332d7@tessares.net/T/ [2] Suggested-by: Pedro Tammela Signed-off-by: Matthieu Baerts Reviewed-by: Zhengchao Shao Link: https://lore.kernel.org/r/20230713-tc-selftests-lkft-v1-1-1eb4fd3a96e7@tessares.net Acked-by: Jamal Hadi Salim Signed-off-by: Jakub Kicinski commit a3f25d614bc73b45e8f02adc6769876dfd16ca84 Author: Alexander Duyck Date: Thu Jul 13 09:49:31 2023 -0700 bpf, arm64: Fix BTI type used for freplace attached functions When running an freplace attached bpf program on an arm64 system w were seeing the following issue: Unhandled 64-bit el1h sync exception on CPU47, ESR 0x0000000036000003 -- BTI After a bit of work to track it down I determined that what appeared to be happening is that the 'bti c' at the start of the program was somehow being reached after a 'br' instruction. Further digging pointed me toward the fact that the function was attached via freplace. This in turn led me to build_plt which I believe is invoking the long jump which is triggering this error. To resolve it we can replace the 'bti c' with 'bti jc' and add a comment explaining why this has to be modified as such. Fixes: b2ad54e1533e ("bpf, arm64: Implement bpf_arch_text_poke() for arm64") Signed-off-by: Alexander Duyck Acked-by: Xu Kuohai Link: https://lore.kernel.org/r/168926677665.316237.9953845318337455525.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Alexei Starovoitov commit a8237cc87e3de1adb3f2f6a8056621e7e578cc00 Merge: 8fcd7c7b3a38a 824adae4530b4 Author: Alexei Starovoitov Date: Tue Jul 18 15:21:09 2023 -0700 Merge branch 'two-more-fixes-for-check_max_stack_depth' Kumar Kartikeya Dwivedi says: ==================== Two more fixes for check_max_stack_depth I noticed two more bugs while reviewing the code, description and examples available in the patches. One leads to incorrect subprog index to be stored in the frame stack maintained by the function (leading to incorrect tail_call_reachable marks, among other things). The other problem is missing exploration pass of other async callbacks when they are not called from the main prog. Call chains rooted at them can thus bypass the stack limits (32 call frames * max permitted stack depth per function). Changelog: ---------- v1 -> v2 v1: https://lore.kernel.org/bpf/20230713003118.1327943-1-memxor@gmail.com * Fix commit message for patch 2 (Alexei) ==================== Link: https://lore.kernel.org/r/20230717161530.1238-1-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 824adae4530b4db1d06987d8dd31a0adef37044f Author: Kumar Kartikeya Dwivedi Date: Mon Jul 17 21:45:30 2023 +0530 selftests/bpf: Add more tests for check_max_stack_depth bug Another test which now exercies the path of the verifier where it will explore call chains rooted at the async callback. Without the prior fixes, this program loads successfully, which is incorrect. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230717161530.1238-4-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit b5e9ad522c4ccd32d322877515cff8d47ed731b9 Author: Kumar Kartikeya Dwivedi Date: Mon Jul 17 21:45:29 2023 +0530 bpf: Repeat check_max_stack_depth for async callbacks While the check_max_stack_depth function explores call chains emanating from the main prog, which is typically enough to cover all possible call chains, it doesn't explore those rooted at async callbacks unless the async callback will have been directly called, since unlike non-async callbacks it skips their instruction exploration as they don't contribute to stack depth. It could be the case that the async callback leads to a callchain which exceeds the stack depth, but this is never reachable while only exploring the entry point from main subprog. Hence, repeat the check for the main subprog *and* all async callbacks marked by the symbolic execution pass of the verifier, as execution of the program may begin at any of them. Consider functions with following stack depths: main: 256 async: 256 foo: 256 main: rX = async bpf_timer_set_callback(...) async: foo() Here, async is not descended as it does not contribute to stack depth of main (since it is referenced using bpf_pseudo_func and not bpf_pseudo_call). However, when async is invoked asynchronously, it will end up breaching the MAX_BPF_STACK limit by calling foo. Hence, in addition to main, we also need to explore call chains beginning at all async callback subprogs in a program. Fixes: 7ddc80a476c2 ("bpf: Teach stack depth check about async callbacks.") Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230717161530.1238-3-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit ba7b3e7d5f9014be65879ede8fd599cb222901c9 Author: Kumar Kartikeya Dwivedi Date: Mon Jul 17 21:45:28 2023 +0530 bpf: Fix subprog idx logic in check_max_stack_depth The assignment to idx in check_max_stack_depth happens once we see a bpf_pseudo_call or bpf_pseudo_func. This is not an issue as the rest of the code performs a few checks and then pushes the frame to the frame stack, except the case of async callbacks. If the async callback case causes the loop iteration to be skipped, the idx assignment will be incorrect on the next iteration of the loop. The value stored in the frame stack (as the subprogno of the current subprog) will be incorrect. This leads to incorrect checks and incorrect tail_call_reachable marking. Save the target subprog in a new variable and only assign to idx once we are done with the is_async_cb check which may skip pushing of frame to the frame stack and subsequent stack depth checks and tail call markings. Fixes: 7ddc80a476c2 ("bpf: Teach stack depth check about async callbacks.") Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230717161530.1238-2-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit ccff6d117d8dc8d8d86e8695a75e5f8b01e573bf Merge: 4806364acf770 2480232c61b88 Author: Linus Torvalds Date: Tue Jul 18 14:51:29 2023 -0700 Merge tag 'perf-tools-fixes-for-v6.5-1-2023-07-18' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools Pull perf tools fixes from Arnaldo Carvalho de Melo: - Don't group events when computing metrics that require more than the maximum number of simultaneously enabled events on AMD systems. - Fix multi CU handling in 'perf probe', add a 'perf test' entry to regress test it. - Make the 'perf test task_exit' stop generating samples by using the 'dummy' event, all it is testing is if a PERF_RECORD_EXIT is generated at the end of a perf session. This makes this perf test to stop sometimes failing on some systems due to a full ring buffer. - Avoid SEGV if PMU lookup fails for legacy cache terms. - Fix libsubcmd SEGV/use-after-free when commands aren't excluded. - Fix OpenCSD (ARM64's CoreSight hardware tracing) library path resolution when specifying CSLIBS= in the make command line. - Fix broken feature check for libtracefs due to external lib changes, use the provided pkgconfig file instead future proof it. - Sync drm, fcntl, kvm, mount, prctl, socket, vhost, asound, arm64's cputype headers with the kernel sources, in some cases this made the tools become aware of new kernel APIs such as ioctls and the cachestat sysctl. * tag 'perf-tools-fixes-for-v6.5-1-2023-07-18' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: perf test task_exit: No need for a cycles event to check if we get an PERF_RECORD_EXIT tools headers arm64: Sync arm64's cputype.h with the kernel sources tools include UAPI: Sync the sound/asound.h copy with the kernel sources tools include UAPI: Sync linux/vhost.h with the kernel sources perf beauty: Update copy of linux/socket.h with the kernel sources perf parse-events: Avoid SEGV if PMU lookup fails for legacy cache terms libsubcmd: Avoid SEGV/use-after-free when commands aren't excluded tools headers UAPI: Sync linux/prctl.h with the kernel sources perf build: Fix broken feature check for libtracefs due to external lib changes tools include UAPI: Sync linux/mount.h copy with the kernel sources tools headers UAPI: Sync linux/kvm.h with the kernel sources tools headers uapi: Sync linux/fcntl.h with the kernel sources perf vendor events amd: Fix large metrics perf build: Fix library not found error when using CSLIBS tools headers UAPI: Sync files changed by new cachestat syscall with the kernel sources tools headers UAPI: Sync drm/i915_drm.h with the kernel sources perf probe: Read DWARF files from the correct CU perf probe: Add test for regression introduced by switch to die_get_decl_file() commit 4806364acf770fa1d24ccc98169ca6f5c6979caa Merge: 74f1456c4a5f3 ef5c3de5211b5 Author: Linus Torvalds Date: Tue Jul 18 14:19:42 2023 -0700 Merge tag 'mm-hotfixes-stable-2023-07-18-12-28' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull hotfixes from Andrew Morton: "Seven hotfixes, six of which are cc:stable and one of which addresses a post-6.5 issue" * tag 'mm-hotfixes-stable-2023-07-18-12-28' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: maple_tree: fix node allocation testing on 32 bit maple_tree: fix 32 bit mas_next testing selftests/mm: mkdirty: fix incorrect position of #endif maple_tree: set the node limit when creating a new root node mm/mlock: fix vma iterator conversion of apply_vma_lock_flags() prctl: move PR_GET_AUXV out of PR_MCE_KILL selftests/mm: give scripts execute permission commit 2356d198d2b4ddec24efea98271cb3be230bc787 Author: Yury Norov Date: Mon Jul 17 12:17:03 2023 -0700 lib/bitmap: workaround const_eval test build failure When building with Clang, and when KASAN and GCOV_PROFILE_ALL are both enabled, the test fails to build [1]: >> lib/test_bitmap.c:920:2: error: call to '__compiletime_assert_239' declared with 'error' attribute: BUILD_BUG_ON failed: !__builtin_constant_p(res) BUILD_BUG_ON(!__builtin_constant_p(res)); ^ include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON' BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition) ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^ include/linux/compiler_types.h:352:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:340:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:333:4: note: expanded from macro '__compiletime_assert' prefix ## suffix(); \ ^ :185:1: note: expanded from here __compiletime_assert_239 Originally it was attributed to s390, which now looks seemingly wrong. The issue is not related to bitmap code itself, but it breaks build for a given configuration. Disabling the const_eval test under that config may potentially hide other bugs. Instead, workaround it by disabling GCOV for the test_bitmap unless the compiler will get fixed. [1] https://github.com/ClangBuiltLinux/linux/issues/1874 Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307171254.yFcH97ej-lkp@intel.com/ Fixes: dc34d5036692 ("lib: test_bitmap: add compile-time optimization/evaluations assertions") Co-developed-by: Nathan Chancellor Signed-off-by: Nathan Chancellor Signed-off-by: Yury Norov Reviewed-by: Nick Desaulniers Reviewed-by: Alexander Lobakin commit 6adc2272aaaf84f34b652cf77f770c6fcc4b8336 Author: Ondrej Mosnacek Date: Tue Jul 18 13:56:07 2023 +0200 io_uring: don't audit the capability check in io_uring_create() The check being unconditional may lead to unwanted denials reported by LSMs when a process has the capability granted by DAC, but denied by an LSM. In the case of SELinux such denials are a problem, since they can't be effectively filtered out via the policy and when not silenced, they produce noise that may hide a true problem or an attack. Since not having the capability merely means that the created io_uring context will be accounted against the current user's RLIMIT_MEMLOCK limit, we can disable auditing of denials for this check by using ns_capable_noaudit() instead of capable(). Fixes: 2b188cc1bb85 ("Add io_uring IO interface") Link: https://bugzilla.redhat.com/show_bug.cgi?id=2193317 Signed-off-by: Ondrej Mosnacek Reviewed-by: Jeff Moyer Link: https://lore.kernel.org/r/20230718115607.65652-1-omosnace@redhat.com Signed-off-by: Jens Axboe commit 28f47693a920ed66e985feafc1937b4c96008b95 Author: Greg Kroah-Hartman Date: Tue Jun 27 13:26:43 2023 +0200 Documentation: embargoed-hardware-issues.rst: clean out empty and unused entries There are a few empty entries in the company/project list, which confuses people as to why they are there, so remove them entirely, and also remove an entry that doesn't wish to participate in this process. Cc: Tom Lendacky Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/2023062742-mouse-appease-7917@gregkh Signed-off-by: Greg Kroah-Hartman commit b13d3e9c6b62597a5c31fdc74febb3bc588893bf Author: Guchun Chen Date: Fri Jul 14 19:38:16 2023 +0800 drm/amdgpu: use a macro to define no xcp partition case ~0 as no xcp partition is used in several places, so improve its definition by a macro for code consistency. Suggested-by: Christian König Signed-off-by: Guchun Chen Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 8e78127143086bd89aa099740c1767d64fe80631 Author: Guchun Chen Date: Thu Jul 13 15:55:58 2023 +0800 drm/amdgpu/vm: use the same xcp_id from root PD Other PDs/PTs allocation should just use the same xcp_id as that stored in root PD. Suggested-by: Christian König Signed-off-by: Guchun Chen Reviewed-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 8ecee4cbc72b53551c1d33251a48c912d70282ea Author: Guchun Chen Date: Thu Jul 13 15:09:37 2023 +0800 drm/amdgpu: fix slab-out-of-bounds issue in amdgpu_vm_pt_create Recent code set xcp_id stored from file private data when opening device to amdgpu bo for accounting memory usage etc, but not all VMs are attached to this fpriv structure like the vm cases in amdgpu_mes_self_test, otherwise, KASAN will complain below out of bound access. And more importantly, VM code should not touch fpriv structure, so drop fpriv code handling from amdgpu_vm_pt. [ 77.292314] BUG: KASAN: slab-out-of-bounds in amdgpu_vm_pt_create+0x17e/0x4b0 [amdgpu] [ 77.293845] Read of size 4 at addr ffff888102c48a48 by task modprobe/1069 [ 77.294146] Call Trace: [ 77.294178] [ 77.294208] dump_stack_lvl+0x49/0x63 [ 77.294260] print_report+0x16f/0x4a6 [ 77.294307] ? amdgpu_vm_pt_create+0x17e/0x4b0 [amdgpu] [ 77.295979] ? kasan_complete_mode_report_info+0x3c/0x200 [ 77.296057] ? amdgpu_vm_pt_create+0x17e/0x4b0 [amdgpu] [ 77.297556] kasan_report+0xb4/0x130 [ 77.297609] ? amdgpu_vm_pt_create+0x17e/0x4b0 [amdgpu] [ 77.299202] __asan_load4+0x6f/0x90 [ 77.299272] amdgpu_vm_pt_create+0x17e/0x4b0 [amdgpu] [ 77.300796] ? amdgpu_init+0x6e/0x1000 [amdgpu] [ 77.302222] ? amdgpu_vm_pt_clear+0x750/0x750 [amdgpu] [ 77.303721] ? preempt_count_sub+0x18/0xc0 [ 77.303786] amdgpu_vm_init+0x39e/0x870 [amdgpu] [ 77.305186] ? amdgpu_vm_wait_idle+0x90/0x90 [amdgpu] [ 77.306683] ? kasan_set_track+0x25/0x30 [ 77.306737] ? kasan_save_alloc_info+0x1b/0x30 [ 77.306795] ? __kasan_kmalloc+0x87/0xa0 [ 77.306852] amdgpu_mes_self_test+0x169/0x620 [amdgpu] v2: without specifying xcp partition for PD/PT bo, the xcp id is -1. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2686 Fixes: 3ebfd221c1a8 ("drm/amdkfd: Store xcp partition id to amdgpu bo") Signed-off-by: Guchun Chen Tested-by: Mikhail Gavrilov Reviewed-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit dcaa32e1f58473b9f4ac566fadd326956be83138 Author: Guchun Chen Date: Mon Jul 17 09:55:07 2023 +0800 drm/amdgpu: Allocate root PD on correct partition file_priv needs to be setup firstly, otherwise, root PD will always be allocated on partition 0, even if opening the device from other partitions. Fixes: 3ebfd221c1a8 ("drm/amdkfd: Store xcp partition id to amdgpu bo") Signed-off-by: Guchun Chen Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2387ccf43e3c6cb5dbd757c5ef410cca9f14b971 Author: Nicholas Kazlauskas Date: Thu Jun 29 10:35:59 2023 -0400 drm/amd/display: Keep PHY active for DP displays on DCN31 [Why & How] Port of a change that went into DCN314 to keep the PHY enabled when we have a connected and active DP display. The PHY can hang if PHY refclk is disabled inadvertently. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Josip Pavic Acked-by: Alan Liu Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2a9482e55968ed7368afaa9c2133404069117320 Author: Daniel Miess Date: Thu Jun 22 08:11:48 2023 -0400 drm/amd/display: Prevent vtotal from being set to 0 [Why] In dcn314 DML the destination pipe vtotal was being set to the crtc adjustment vtotal_min value even in cases where that value is 0. [How] Only set vtotal to the crtc adjustment vtotal_min value in cases where the value is non-zero. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Nicholas Kazlauskas Acked-by: Alan Liu Signed-off-by: Daniel Miess Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a460beefe77d780ac48f19d39333852a7f93ffc1 Author: Zhikai Zhai Date: Fri Jun 30 11:35:14 2023 +0800 drm/amd/display: Disable MPC split by default on special asic [WHY] All of pipes will be used when the MPC split enable on the dcn which just has 2 pipes. Then MPO enter will trigger the minimal transition which need programe dcn from 2 pipes MPC split to 2 pipes MPO. This action will cause lag if happen frequently. [HOW] Disable the MPC split for the platform which dcn resource is limited Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Alvin Lee Acked-by: Alan Liu Signed-off-by: Zhikai Zhai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5a25cefc0920088bb9afafeb80ad3dcd84fe278b Author: Taimur Hassan Date: Tue Jun 20 17:00:28 2023 -0400 drm/amd/display: check TG is non-null before checking if enabled [Why & How] If there is no TG allocation we can dereference a NULL pointer when checking if the TG is enabled. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Nicholas Kazlauskas Acked-by: Alan Liu Signed-off-by: Taimur Hassan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4f6d9e38c4d244ad106eb9ebd8c0e1215e866f35 Author: Wayne Lin Date: Wed Mar 9 17:05:05 2022 +0800 drm/amd/display: Add polling method to handle MST reply packet [Why] Specific TBT4 dock doesn't send out short HPD to notify source that IRQ event DOWN_REP_MSG_RDY is set. Which violates the spec and cause source can't send out streams to mst sinks. [How] To cover this misbehavior, add an additional polling method to detect DOWN_REP_MSG_RDY is set. HPD driven handling method is still kept. Just hook up our handler to drm mgr->cbs->poll_hpd_irq(). Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Jerry Zuo Acked-by: Alan Liu Signed-off-by: Wayne Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 87279fdf5ee0ad1360765ef70389d1c4d0f81bb6 Author: Srinivasan Shanmugam Date: Sat Jun 17 21:09:46 2023 +0530 drm/amd/display: Clean up errors & warnings in amdgpu_dm.c Fix the following errors & warnings reported by checkpatch: ERROR: space required before the open brace '{' ERROR: space required before the open parenthesis '(' ERROR: that open brace { should be on the previous line ERROR: space prohibited before that ',' (ctx:WxW) ERROR: else should follow close brace '}' ERROR: open brace '{' following function definitions go on the next line ERROR: code indent should use tabs where possible WARNING: braces {} are not necessary for single statement blocks WARNING: void function return statements are not generally useful WARNING: Block comments use * on subsequent lines WARNING: Block comments use a trailing */ on a separate line Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b9c2213cdf254fba71b6bd602a0afe051e554ad9 Author: Candice Li Date: Wed Jul 5 15:00:45 2023 +0800 drm/amdgpu: Allow the initramfs generator to include psp_13_0_6_ta Allow the initramfs generator to automatically include psp_13_0_6_ta firmware to initramfs. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 068c8bb10f37bb84824625dbbda053a3a3e0d6e1 Author: Alex Deucher Date: Tue Jun 13 12:36:17 2023 -0400 drm/amdgpu/pm: make mclk consistent for smu 13.0.7 Use current uclk to be consistent with other dGPUs. Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.1.x commit a4eb11824170d742531998f4ebd1c6a18b63db47 Author: Alex Deucher Date: Tue Jun 13 12:15:38 2023 -0400 drm/amdgpu/pm: make gfxclock consistent for sienna cichlid Use average gfxclock for consistency with other dGPUs. Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.1.x commit 1ca67aba8d11c2849d395013e1fdce02918d5657 Author: Simon Ser Date: Wed Jun 21 17:24:59 2023 -0300 drm/amd/display: only accept async flips for fast updates Up until now, amdgpu was silently degrading to vsync when user-space requested an async flip but the hardware didn't support it. The hardware doesn't support immediate flips when the update changes the FB pitch, the DCC state, the rotation, enables or disables CRTCs or planes, etc. This is reflected in the dm_crtc_state.update_type field: UPDATE_TYPE_FAST means that immediate flip is supported. Silently degrading async flips to vsync is not the expected behavior from a uAPI point-of-view. Xorg expects async flips to fail if unsupported, to be able to fall back to a blit. i915 already behaves this way. This patch aligns amdgpu with uAPI expectations and returns a failure when an async flip is not possible. Signed-off-by: Simon Ser Reviewed-by: André Almeida Reviewed-by: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: André Almeida Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit b42ae87a7b3878afaf4c3852ca66c025a5b996e0 Author: Guchun Chen Date: Thu Jul 6 15:57:21 2023 +0800 drm/amdgpu/vkms: relax timer deactivation by hrtimer_try_to_cancel In below thousands of screen rotation loop tests with virtual display enabled, a CPU hard lockup issue may happen, leading system to unresponsive and crash. do { xrandr --output Virtual --rotate inverted xrandr --output Virtual --rotate right xrandr --output Virtual --rotate left xrandr --output Virtual --rotate normal } while (1); NMI watchdog: Watchdog detected hard LOCKUP on cpu 1 ? hrtimer_run_softirq+0x140/0x140 ? store_vblank+0xe0/0xe0 [drm] hrtimer_cancel+0x15/0x30 amdgpu_vkms_disable_vblank+0x15/0x30 [amdgpu] drm_vblank_disable_and_save+0x185/0x1f0 [drm] drm_crtc_vblank_off+0x159/0x4c0 [drm] ? record_print_text.cold+0x11/0x11 ? wait_for_completion_timeout+0x232/0x280 ? drm_crtc_wait_one_vblank+0x40/0x40 [drm] ? bit_wait_io_timeout+0xe0/0xe0 ? wait_for_completion_interruptible+0x1d7/0x320 ? mutex_unlock+0x81/0xd0 amdgpu_vkms_crtc_atomic_disable It's caused by a stuck in lock dependency in such scenario on different CPUs. CPU1 CPU2 drm_crtc_vblank_off hrtimer_interrupt grab event_lock (irq disabled) __hrtimer_run_queues grab vbl_lock/vblank_time_block amdgpu_vkms_vblank_simulate amdgpu_vkms_disable_vblank drm_handle_vblank hrtimer_cancel grab dev->event_lock So CPU1 stucks in hrtimer_cancel as timer callback is running endless on current clock base, as that timer queue on CPU2 has no chance to finish it because of failing to hold the lock. So NMI watchdog will throw the errors after its threshold, and all later CPUs are impacted/blocked. So use hrtimer_try_to_cancel to fix this, as disable_vblank callback does not need to wait the handler to finish. And also it's not necessary to check the return value of hrtimer_try_to_cancel, because even if it's -1 which means current timer callback is running, it will be reprogrammed in hrtimer_start with calling enable_vblank to make it works. v2: only re-arm timer when vblank is enabled (Christian) and add a Fixes tag as well v3: drop warn printing (Christian) v4: drop superfluous check of blank->enabled in timer function, as it's guaranteed in drm_handle_vblank (Christian) Fixes: 84ec374bd580 ("drm/amdgpu: create amdgpu_vkms (v4)") Cc: stable@vger.kernel.org Suggested-by: Christian König Signed-off-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher commit d1792509e1031a6750f82bc7faa5fc9d7203b5b7 Author: Aurabindo Pillai Date: Wed Jul 12 12:35:16 2023 -0400 drm/amd/display: add DCN301 specific logic for OTG programming [Why&How] DCN301 does not have FAMS hence the workaround needed on other DCN3x variants related to OTG min/max selector programming is not applicable for it. Hence isolate it and have it use the old sequence without workaround. Fixes: 1598fc576420 ("drm/amd/display: Program OTG vtotal min/max selectors unconditionally for DCN1+") Reviewed-by: Swapnil Patel Signed-off-by: Aurabindo Pillai Tested-by: Guilherme G. Piccoli Signed-off-by: Alex Deucher commit 2ed5a4c4615b47c70dcd8d7d942207e5a607561d Author: Aurabindo Pillai Date: Tue Jul 11 14:14:43 2023 -0400 drm/amd/display: export some optc function for reuse [Why&How] Make a few functions non static so that they can be reused for other asic. This is in preparation for separating out OTG programming sequence for DCN301 Fixes: 1598fc576420 ("drm/amd/display: Program OTG vtotal min/max selectors unconditionally for DCN1+") Reviewed-by: Swapnil Patel Signed-off-by: Aurabindo Pillai Tested-by: Guilherme G. Piccoli Signed-off-by: Alex Deucher commit 60a2dae4902015f43d144f5a4710f655b2955b9b Author: Mario Limonciello Date: Fri Jul 7 21:26:10 2023 -0500 drm/amd: Use amdgpu_device_pcie_dynamic_switching_supported() for SMU7 SMU7 does a check if the dGPU is inserted into a Rocket Lake system, to turn off DPM. Extend this check to all systems that have problems with dynamic switching by using the amdgpu_device_pcie_dynamic_switching_supported() helper. Signed-off-by: Mario Limonciello Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 91019b5bc7c2c5e6f676cce80ee6d12b2753d018 Author: Breno Leitao Date: Fri Jul 14 02:31:46 2023 -0700 cxl/acpi: Return 'rc' instead of '0' in cxl_parse_cfmws() Driver initialization returned success (return 0) even if the initialization (cxl_decoder_add() or acpi_table_parse_cedt()) failed. Return the error instead of swallowing it. Fixes: f4ce1f766f1e ("cxl/acpi: Convert CFMWS parsing to ACPI sub-table helpers") Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20230714093146.2253438-2-leitao@debian.org Reviewed-by: Alison Schofield Signed-off-by: Vishal Verma commit 4cf67d3cc9994a59cf77bb9c0ccf9007fe916afe Author: Breno Leitao Date: Fri Jul 14 02:31:45 2023 -0700 cxl/acpi: Fix a use-after-free in cxl_parse_cfmws() KASAN and KFENCE detected an user-after-free in the CXL driver. This happens in the cxl_decoder_add() fail path. KASAN prints the following error: BUG: KASAN: slab-use-after-free in cxl_parse_cfmws (drivers/cxl/acpi.c:299) This happens in cxl_parse_cfmws(), where put_device() is called, releasing cxld, which is accessed later. Use the local variables in the dev_err() instead of pointing to the released memory. Since the dev_err() is printing a resource, change the open coded print format to use the %pr format specifier. Fixes: e50fe01e1f2a ("cxl/core: Drop ->platform_res attribute for root decoders") Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20230714093146.2253438-1-leitao@debian.org Reviewed-by: Alison Schofield Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Signed-off-by: Vishal Verma commit 74f1456c4a5f3d7da4102ecae5c20370f89c6ed1 Merge: f2f393c385af0 569f8b501b177 Author: Linus Torvalds Date: Tue Jul 18 08:56:02 2023 -0700 Merge tag 'linux-kselftest-fixes-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest fixes from Shuah Khan: "Fixes to bugs that are interfering with arm64 and risc workflows. Also two fixes to timer and mincore tests that are causing test failures" * tag 'linux-kselftest-fixes-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/arm64: fix build failure during the "emit_tests" step selftests/riscv: fix potential build failure during the "emit_tests" step tools: timers: fix freq average calculation selftests/mincore: fix skip condition for check_huge_pages test commit f2f393c385af0635eddb58df8bcd645cb6a18f5d Merge: fdf0eaf11452d 481c2d14627de Author: Linus Torvalds Date: Tue Jul 18 08:43:35 2023 -0700 Merge tag 'tpmdd-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull tpm fixes from Jarkko Sakkinen. Mostly interrupt storm fixes, with some other minor changes. * tag 'tpmdd-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: tpm,tpm_tis: Disable interrupts after 1000 unhandled IRQs tpm/tpm_tis: Disable interrupts for Lenovo L590 devices tpm: Do not remap from ACPI resources again for Pluton TPM tpm/tpm_tis: Disable interrupts for Framework Laptop Intel 13th gen tpm/tpm_tis: Disable interrupts for Framework Laptop Intel 12th gen security: keys: Modify mismatched function name tpm: return false from tpm_amd_is_rng_defective on non-x86 platforms keys: Fix linking a duplicate key to a keyring's assoc_array tpm: tis_i2c: Limit write bursts to I2C_SMBUS_BLOCK_MAX (32) bytes tpm: tis_i2c: Limit read bursts to I2C_SMBUS_BLOCK_MAX (32) bytes tpm_tis_spi: Release chip select when flow control fails tpm: tpm_tis: Disable interrupts *only* for AEON UPX-i11 tpm: tpm_vtpm_proxy: fix a race condition in /dev/vtpmx creation commit f75546f58a70da5cfdcec5a45ffc377885ccbee8 Author: Trond Myklebust Date: Tue Jul 18 08:38:37 2023 -0400 nfsd: Remove incorrect check in nfsd4_validate_stateid If the client is calling TEST_STATEID, then it is because some event occurred that requires it to check all the stateids for validity and call FREE_STATEID on the ones that have been revoked. In this case, either the stateid exists in the list of stateids associated with that nfs4_client, in which case it should be tested, or it does not. There are no additional conditions to be considered. Reported-by: "Frank Ch. Eigler" Fixes: 7df302f75ee2 ("NFSD: TEST_STATEID should not return NFS4ERR_STALE_STATEID") Cc: stable@vger.kernel.org # v5.7+ Signed-off-by: Trond Myklebust Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit c250ef8954eda2024c8861c36e9fc1b589481fe7 Author: Christoffer Sandberg Date: Tue Jul 18 16:57:22 2023 +0200 ALSA: hda/realtek: Add quirk for Clevo NS70AU Fixes headset detection on Clevo NS70AU. Co-developed-by: Werner Sembach Signed-off-by: Werner Sembach Signed-off-by: Christoffer Sandberg Cc: Link: https://lore.kernel.org/r/20230718145722.10592-1-wse@tuxedocomputers.com Signed-off-by: Takashi Iwai commit 7686762d1ed092db4d120e29b565712c969dc075 Author: Sven Schnelle Date: Thu Jul 13 15:54:23 2023 +0200 s390/mm: fix per vma lock fault handling With per-vma locks, handle_mm_fault() may return non-fatal error flags. In this case the code should reset the fault flags before returning. Fixes: e06f47a16573 ("s390/mm: try VMA lock-based page fault handling first") Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 8fcd7c7b3a38ab5e452f542fda8f7940e77e479a Author: Geetha sowjanya Date: Sun Jul 16 15:07:41 2023 +0530 octeontx2-pf: Dont allocate BPIDs for LBK interfaces Current driver enables backpressure for LBK interfaces. But these interfaces do not support this feature. Hence, this patch fixes the issue by skipping the backpressure configuration for these interfaces. Fixes: 75f36270990c ("octeontx2-pf: Support to enable/disable pause frames via ethtool"). Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham Link: https://lore.kernel.org/r/20230716093741.28063-1-gakula@marvell.com Signed-off-by: Paolo Abeni commit 5c719d7aef298e9b727f39b45e88528a96df3620 Author: Christophe JAILLET Date: Mon Jul 17 21:55:56 2023 +0200 RDMA/rxe: Fix an error handling path in rxe_bind_mw() All errors go to the error handling path, except this one. Be consistent and also branch to it. Fixes: 02ed253770fb ("RDMA/rxe: Introduce rxe access supported flags") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/43698d8a3ed4e720899eadac887427f73d7ec2eb.1689623735.git.christophe.jaillet@wanadoo.fr Reviewed-by: Bob Pearson Acked-by: Zhu Yanjun Signed-off-by: Leon Romanovsky commit 2033ab90380d46e0e9f0520fd6776a73d107fd95 Author: Ido Schimmel Date: Sat Jul 15 18:36:05 2023 +0300 vrf: Fix lockdep splat in output path Cited commit converted the neighbour code to use the standard RCU variant instead of the RCU-bh variant, but the VRF code still uses rcu_read_lock_bh() / rcu_read_unlock_bh() around the neighbour lookup code in its IPv4 and IPv6 output paths, resulting in lockdep splats [1][2]. Can be reproduced using [3]. Fix by switching to rcu_read_lock() / rcu_read_unlock(). [1] ============================= WARNING: suspicious RCU usage 6.5.0-rc1-custom-g9c099e6dbf98 #403 Not tainted ----------------------------- include/net/neighbour.h:302 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 2 locks held by ping/183: #0: ffff888105ea1d80 (sk_lock-AF_INET){+.+.}-{0:0}, at: raw_sendmsg+0xc6c/0x33c0 #1: ffffffff85b46820 (rcu_read_lock_bh){....}-{1:2}, at: vrf_output+0x2e3/0x2030 stack backtrace: CPU: 0 PID: 183 Comm: ping Not tainted 6.5.0-rc1-custom-g9c099e6dbf98 #403 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc37 04/01/2014 Call Trace: dump_stack_lvl+0xc1/0xf0 lockdep_rcu_suspicious+0x211/0x3b0 vrf_output+0x1380/0x2030 ip_push_pending_frames+0x125/0x2a0 raw_sendmsg+0x200d/0x33c0 inet_sendmsg+0xa2/0xe0 __sys_sendto+0x2aa/0x420 __x64_sys_sendto+0xe5/0x1c0 do_syscall_64+0x38/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd [2] ============================= WARNING: suspicious RCU usage 6.5.0-rc1-custom-g9c099e6dbf98 #403 Not tainted ----------------------------- include/net/neighbour.h:302 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 2 locks held by ping6/182: #0: ffff888114b63000 (sk_lock-AF_INET6){+.+.}-{0:0}, at: rawv6_sendmsg+0x1602/0x3e50 #1: ffffffff85b46820 (rcu_read_lock_bh){....}-{1:2}, at: vrf_output6+0xe9/0x1310 stack backtrace: CPU: 0 PID: 182 Comm: ping6 Not tainted 6.5.0-rc1-custom-g9c099e6dbf98 #403 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc37 04/01/2014 Call Trace: dump_stack_lvl+0xc1/0xf0 lockdep_rcu_suspicious+0x211/0x3b0 vrf_output6+0xd32/0x1310 ip6_local_out+0xb4/0x1a0 ip6_send_skb+0xbc/0x340 ip6_push_pending_frames+0xe5/0x110 rawv6_sendmsg+0x2e6e/0x3e50 inet_sendmsg+0xa2/0xe0 __sys_sendto+0x2aa/0x420 __x64_sys_sendto+0xe5/0x1c0 do_syscall_64+0x38/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd [3] #!/bin/bash ip link add name vrf-red up numtxqueues 2 type vrf table 10 ip link add name swp1 up master vrf-red type dummy ip address add 192.0.2.1/24 dev swp1 ip address add 2001:db8:1::1/64 dev swp1 ip neigh add 192.0.2.2 lladdr 00:11:22:33:44:55 nud perm dev swp1 ip neigh add 2001:db8:1::2 lladdr 00:11:22:33:44:55 nud perm dev swp1 ip vrf exec vrf-red ping 192.0.2.2 -c 1 &> /dev/null ip vrf exec vrf-red ping6 2001:db8:1::2 -c 1 &> /dev/null Fixes: 09eed1192cec ("neighbour: switch to standard rcu, instead of rcu_bh") Reported-by: Naresh Kamboju Link: https://lore.kernel.org/netdev/CA+G9fYtEr-=GbcXNDYo3XOkwR+uYgehVoDjsP0pFLUpZ_AZcyg@mail.gmail.com/ Signed-off-by: Ido Schimmel Reviewed-by: David Ahern Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20230715153605.4068066-1-idosch@nvidia.com Signed-off-by: Paolo Abeni commit 81b233b8dd72f2d1df3da8bd4bd4f8c5e84937b9 Author: Sukrut Bellary Date: Tue Jul 18 01:55:29 2023 -0700 firmware: arm_scmi: Fix signed error return values handling Handle signed error return values returned by simple_write_to_buffer(). In case of an error, return the error code. Fixes: 3c3d818a9317 ("firmware: arm_scmi: Add core raw transmission support") Reported-by: Dan Carpenter Signed-off-by: Sukrut Bellary Reviewed-by: Cristian Marussi Tested-by: Cristian Marussi Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/20230718085529.258899-1-sukrut.bellary@linux.com Signed-off-by: Sudeep Holla commit 03803083a9b4d88886fb059458682301a8c7219a Merge: 162d626f30132 b3e7b3a6ee92a Author: Paolo Abeni Date: Tue Jul 18 11:50:10 2023 +0200 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-07-14 (ice) This series contains updates to ice driver only. Petr Oros removes multiple calls made to unregister netdev and devlink_port. Michal fixes null pointer dereference that can occur during reload. ==================== Link: https://lore.kernel.org/r/20230714201041.1717834-1-anthony.l.nguyen@intel.com Signed-off-by: Paolo Abeni commit c2fceb59bbda16468bda82b002383bff59de89ab Author: Claudio Imbrenda Date: Wed Jul 5 13:19:37 2023 +0200 KVM: s390: pv: fix index value of replaced ASCE The index field of the struct page corresponding to a guest ASCE should be 0. When replacing the ASCE in s390_replace_asce(), the index of the new ASCE should also be set to 0. Having the wrong index might lead to the wrong addresses being passed around when notifying pte invalidations, and eventually to validity intercepts (VM crash) if the prefix gets unmapped and the notifier gets called with the wrong address. Reviewed-by: Philippe Mathieu-Daudé Fixes: faa2f72cb356 ("KVM: s390: pv: leak the topmost page table when destroy fails") Reviewed-by: Janosch Frank Signed-off-by: Claudio Imbrenda Message-ID: <20230705111937.33472-3-imbrenda@linux.ibm.com> commit 5ff92181577a89ed12ad4e0e5813751faf16a139 Author: Claudio Imbrenda Date: Wed Jul 5 13:19:36 2023 +0200 KVM: s390: pv: simplify shutdown and fix race Simplify the shutdown of non-protected VMs. There is no need to do complex manipulations of the counter if it was zero. This also fixes a very rare race which caused pages to be torn down from the address space with a non-zero counter even on older machines that don't support the UVC instruction, causing a crash. Reported-by: Marc Hartmayer Fixes: fb491d5500a7 ("KVM: s390: pv: asynchronous destroy for reboot") Reviewed-by: Nico Boehr Signed-off-by: Claudio Imbrenda Message-ID: <20230705111937.33472-2-imbrenda@linux.ibm.com> commit d05799d7b4a39fa71c65aa277128ac7c843ffcdc Author: Punit Agrawal Date: Mon Jul 17 18:17:02 2023 +0100 firmware: smccc: Fix use of uninitialised results structure Commit 35727af2b15d ("irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4") moved the initialisation of the SoC version to arm_smccc_version_init() but forgot to update the results structure and it's usage. Fix the use of the uninitialised results structure and update the error strings. Fixes: 35727af2b15d ("irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4") Signed-off-by: Punit Agrawal Cc: Sudeep Holla Cc: Marc Zyngier Cc: Vikram Sethi Cc: Shanker Donthineni Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20230717171702.424253-1-punit.agrawal@bytedance.com Signed-off-by: Sudeep Holla commit 0e52740ffd10c6c316837c6c128f460f1aaba1ea Author: Borislav Petkov (AMD) Date: Sat Jul 8 10:21:35 2023 +0200 x86/bugs: Increase the x86 bugs vector size to two u32s There was never a doubt in my mind that they would not fit into a single u32 eventually. Signed-off-by: Borislav Petkov (AMD) commit b27bfc5103c72f84859bd32731b6a09eafdeda05 Author: Benjamin Gaignard Date: Fri Jul 7 11:42:00 2023 +0200 arm64: dts: freescale: Fix VPU G2 clock Set VPU G2 clock to 300MHz like described in documentation. This fixes pixels error occurring with large resolution ( >= 2560x1600) HEVC test stream when using the postprocessor to produce NV12. Fixes: 4ac7e4a81272 ("arm64: dts: imx8mq: Enable both G1 and G2 VPU's with vpu-blk-ctrl") Signed-off-by: Benjamin Gaignard Signed-off-by: Shawn Guo commit 253be5b53c2792fb4384f8005b05421e6f040ee3 Author: Hugo Villeneuve Date: Tue Jul 4 09:48:00 2023 -0400 arm64: dts: imx8mn-var-som: add missing pull-up for onboard PHY reset pinmux For SOMs with an onboard PHY, the RESET_N pull-up resistor is currently deactivated in the pinmux configuration. When the pinmux code selects the GPIO function for this pin, with a default direction of input, this prevents the RESET_N pin from being taken to the proper 3.3V level (deasserted), and this results in the PHY being not detected since it is held in reset. Taken from RESET_N pin description in ADIN13000 datasheet: This pin requires a 1K pull-up resistor to AVDD_3P3. Activate the pull-up resistor to fix the issue. Fixes: ade0176dd8a0 ("arm64: dts: imx8mn-var-som: Add Variscite VAR-SOM-MX8MN System on Module") Signed-off-by: Hugo Villeneuve Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 1ef0aa137a96c5f0564f2db0c556a4f0f60ce8f5 Author: Yashwanth Varakala Date: Fri Jun 16 11:50:09 2023 +0200 arm64: dts: phycore-imx8mm: Correction in gpio-line-names Remove unused nINT_ETHPHY entry from gpio-line-names in gpio1 nodes of phyCORE-i.MX8MM and phyBOARD-Polis-i.MX8MM devicetrees. Fixes: ae6847f26ac9 ("arm64: dts: freescale: Add phyBOARD-Polis-i.MX8MM support") Signed-off-by: Yashwanth Varakala Signed-off-by: Cem Tenruh Signed-off-by: Shawn Guo commit cddeefc1663294fb74b31ff5029a83c0e819ff3a Author: Yashwanth Varakala Date: Fri Jun 16 11:50:07 2023 +0200 arm64: dts: phycore-imx8mm: Label typo-fix of VPU Corrected the label of the VPU regulator node (buck 3) from reg_vdd_gpu to reg_vdd_vpu. Fixes: ae6847f26ac9 ("arm64: dts: freescale: Add phyBOARD-Polis-i.MX8MM support") Signed-off-by: Yashwanth Varakala Signed-off-by: Cem Tenruh Signed-off-by: Shawn Guo commit aa84ce8a78a1a5c10cdf9c7a5fb0c999fbc2c8d6 Author: Filipe Manana Date: Fri Jul 14 13:42:06 2023 +0100 btrfs: fix warning when putting transaction with qgroups enabled after abort If we have a transaction abort with qgroups enabled we get a warning triggered when doing the final put on the transaction, like this: [552.6789] ------------[ cut here ]------------ [552.6815] WARNING: CPU: 4 PID: 81745 at fs/btrfs/transaction.c:144 btrfs_put_transaction+0x123/0x130 [btrfs] [552.6817] Modules linked in: btrfs blake2b_generic xor (...) [552.6819] CPU: 4 PID: 81745 Comm: btrfs-transacti Tainted: G W 6.4.0-rc6-btrfs-next-134+ #1 [552.6819] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014 [552.6819] RIP: 0010:btrfs_put_transaction+0x123/0x130 [btrfs] [552.6821] Code: bd a0 01 00 (...) [552.6821] RSP: 0018:ffffa168c0527e28 EFLAGS: 00010286 [552.6821] RAX: ffff936042caed00 RBX: ffff93604a3eb448 RCX: 0000000000000000 [552.6821] RDX: ffff93606421b028 RSI: ffffffff92ff0878 RDI: ffff93606421b010 [552.6821] RBP: ffff93606421b000 R08: 0000000000000000 R09: ffffa168c0d07c20 [552.6821] R10: 0000000000000000 R11: ffff93608dc52950 R12: ffffa168c0527e70 [552.6821] R13: ffff93606421b000 R14: ffff93604a3eb420 R15: ffff93606421b028 [552.6821] FS: 0000000000000000(0000) GS:ffff93675fb00000(0000) knlGS:0000000000000000 [552.6821] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [552.6821] CR2: 0000558ad262b000 CR3: 000000014feda005 CR4: 0000000000370ee0 [552.6822] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [552.6822] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [552.6822] Call Trace: [552.6822] [552.6822] ? __warn+0x80/0x130 [552.6822] ? btrfs_put_transaction+0x123/0x130 [btrfs] [552.6824] ? report_bug+0x1f4/0x200 [552.6824] ? handle_bug+0x42/0x70 [552.6824] ? exc_invalid_op+0x14/0x70 [552.6824] ? asm_exc_invalid_op+0x16/0x20 [552.6824] ? btrfs_put_transaction+0x123/0x130 [btrfs] [552.6826] btrfs_cleanup_transaction+0xe7/0x5e0 [btrfs] [552.6828] ? _raw_spin_unlock_irqrestore+0x23/0x40 [552.6828] ? try_to_wake_up+0x94/0x5e0 [552.6828] ? __pfx_process_timeout+0x10/0x10 [552.6828] transaction_kthread+0x103/0x1d0 [btrfs] [552.6830] ? __pfx_transaction_kthread+0x10/0x10 [btrfs] [552.6832] kthread+0xee/0x120 [552.6832] ? __pfx_kthread+0x10/0x10 [552.6832] ret_from_fork+0x29/0x50 [552.6832] [552.6832] ---[ end trace 0000000000000000 ]--- This corresponds to this line of code: void btrfs_put_transaction(struct btrfs_transaction *transaction) { (...) WARN_ON(!RB_EMPTY_ROOT( &transaction->delayed_refs.dirty_extent_root)); (...) } The warning happens because btrfs_qgroup_destroy_extent_records(), called in the transaction abort path, we free all entries from the rbtree "dirty_extent_root" with rbtree_postorder_for_each_entry_safe(), but we don't actually empty the rbtree - it's still pointing to nodes that were freed. So set the rbtree's root node to NULL to avoid this warning (assign RB_ROOT). Fixes: 81f7eb00ff5b ("btrfs: destroy qgroup extent records on transaction abort") CC: stable@vger.kernel.org # 5.10+ Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 7cad645ebf20d777b2a48750ebd80fd81593b78c Author: Christoph Hellwig Date: Fri Jul 14 10:42:41 2023 +0200 btrfs: fix ordered extent split error handling in btrfs_dio_submit_io When the call to btrfs_extract_ordered_extent in btrfs_dio_submit_io fails to allocate memory for a new ordered_extent, it calls into the btrfs_dio_end_io for error handling. btrfs_dio_end_io then assumes that bbio->ordered is set because it is supposed to be at this point, except for this error handling corner case. Try to not overload the btrfs_dio_end_io with error handling of a bio in a non-canonical state, and instead call btrfs_finish_ordered_extent and iomap_dio_bio_end_io directly for this error case. Reported-by: syzbot Fixes: b41b6f6937dc ("btrfs: use btrfs_finish_ordered_extent to complete direct writes") Reviewed-by: Josef Bacik Tested-by: syzbot Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit 17b17fcd6d446b95904a6929c40012ee7f0afc0c Author: Josef Bacik Date: Wed Jul 12 12:44:12 2023 -0400 btrfs: set_page_extent_mapped after read_folio in btrfs_cont_expand While trying to get the subpage blocksize tests running, I hit the following panic on generic/476 assertion failed: PagePrivate(page) && page->private, in fs/btrfs/subpage.c:229 kernel BUG at fs/btrfs/subpage.c:229! Internal error: Oops - BUG: 00000000f2000800 [#1] SMP CPU: 1 PID: 1453 Comm: fsstress Not tainted 6.4.0-rc7+ #12 Hardware name: QEMU KVM Virtual Machine, BIOS edk2-20230301gitf80f052277c8-26.fc38 03/01/2023 pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) pc : btrfs_subpage_assert+0xbc/0xf0 lr : btrfs_subpage_assert+0xbc/0xf0 Call trace: btrfs_subpage_assert+0xbc/0xf0 btrfs_subpage_clear_checked+0x38/0xc0 btrfs_page_clear_checked+0x48/0x98 btrfs_truncate_block+0x5d0/0x6a8 btrfs_cont_expand+0x5c/0x528 btrfs_write_check.isra.0+0xf8/0x150 btrfs_buffered_write+0xb4/0x760 btrfs_do_write_iter+0x2f8/0x4b0 btrfs_file_write_iter+0x1c/0x30 do_iter_readv_writev+0xc8/0x158 do_iter_write+0x9c/0x210 vfs_iter_write+0x24/0x40 iter_file_splice_write+0x224/0x390 direct_splice_actor+0x38/0x68 splice_direct_to_actor+0x12c/0x260 do_splice_direct+0x90/0xe8 generic_copy_file_range+0x50/0x90 vfs_copy_file_range+0x29c/0x470 __arm64_sys_copy_file_range+0xcc/0x498 invoke_syscall.constprop.0+0x80/0xd8 do_el0_svc+0x6c/0x168 el0_svc+0x50/0x1b0 el0t_64_sync_handler+0x114/0x120 el0t_64_sync+0x194/0x198 This happens because during btrfs_cont_expand we'll get a page, set it as mapped, and if it's not Uptodate we'll read it. However between the read and re-locking the page we could have called release_folio() on the page, but left the page in the file mapping. release_folio() can clear the page private, and thus further down we blow up when we go to modify the subpage bits. Fix this by putting the set_page_extent_mapped() after the read. This is safe because read_folio() will call set_page_extent_mapped() before it does the read, and then if we clear page private but leave it on the mapping we're completely safe re-setting set_page_extent_mapped(). With this patch I can now run generic/476 without panicing. CC: stable@vger.kernel.org # 6.1+ Reviewed-by: Christoph Hellwig Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 486c737f7fdc0c3f6464cf27ede811daec2769a1 Author: Qu Wenruo Date: Fri Jun 30 08:56:40 2023 +0800 btrfs: raid56: always verify the P/Q contents for scrub [REGRESSION] Commit 75b470332965 ("btrfs: raid56: migrate recovery and scrub recovery path to use error_bitmap") changed the behavior of scrub_rbio(). Initially if we have no error reading the raid bio, we will assign @need_check to true, then finish_parity_scrub() would later verify the content of P/Q stripes before writeback. But after that commit we never verify the content of P/Q stripes and just writeback them. This can lead to unrepaired P/Q stripes during scrub, or already corrupted P/Q copied to the dev-replace target. [FIX] The situation is more complex than the regression, in fact the initial behavior is not 100% correct either. If we have the following rare case, it can still lead to the same problem using the old behavior: 0 16K 32K 48K 64K Data 1: |IIIIIII| | Data 2: | | Parity: | |CCCCCCC| | Where "I" means IO error, "C" means corruption. In the above case, we're scrubbing the parity stripe, then read out all the contents of Data 1, Data 2, Parity stripes. But found IO error in Data 1, which leads to rebuild using Data 2 and Parity and got the correct data. In that case, we would not verify if the Parity is correct for range [16K, 32K). So here we have to always verify the content of Parity no matter if we did recovery or not. This patch would remove the @need_check parameter of finish_parity_scrub() completely, and would always do the P/Q verification before writeback. Fixes: 75b470332965 ("btrfs: raid56: migrate recovery and scrub recovery path to use error_bitmap") CC: stable@vger.kernel.org # 6.2+ Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 866e98a4d95d93de2d485f82c69ffeabd712e48b Author: Filipe Manana Date: Thu Jul 6 00:41:16 2023 +0100 btrfs: use irq safe locking when running and adding delayed iputs Running delayed iputs, which never happens in an irq context, needs to lock the spinlock fs_info->delayed_iput_lock. When finishing bios for data writes (irq context, bio.c) we call btrfs_put_ordered_extent() which needs to add a delayed iput and for that it needs to acquire the spinlock fs_info->delayed_iput_lock. Without disabling irqs when running delayed iputs we can therefore deadlock on that spinlock. The same deadlock can also happen when adding an inode to the delayed iputs list, since this can be done outside an irq context as well. Syzbot recently reported this, which results in the following trace: ================================ WARNING: inconsistent lock state 6.4.0-syzkaller-09904-ga507db1d8fdc #0 Not tainted -------------------------------- inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. btrfs-cleaner/16079 [HC0[0]:SC0[0]:HE1:SE1] takes: ffff888107804d20 (&fs_info->delayed_iput_lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline] ffff888107804d20 (&fs_info->delayed_iput_lock){+.?.}-{2:2}, at: btrfs_run_delayed_iputs+0x28/0xe0 fs/btrfs/inode.c:3523 {IN-SOFTIRQ-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5726 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:350 [inline] btrfs_add_delayed_iput+0x128/0x390 fs/btrfs/inode.c:3490 btrfs_put_ordered_extent fs/btrfs/ordered-data.c:559 [inline] btrfs_put_ordered_extent+0x2f6/0x610 fs/btrfs/ordered-data.c:547 __btrfs_bio_end_io fs/btrfs/bio.c:118 [inline] __btrfs_bio_end_io+0x136/0x180 fs/btrfs/bio.c:112 btrfs_orig_bbio_end_io+0x86/0x2b0 fs/btrfs/bio.c:163 btrfs_simple_end_io+0x105/0x380 fs/btrfs/bio.c:378 bio_endio+0x589/0x690 block/bio.c:1617 req_bio_endio block/blk-mq.c:766 [inline] blk_update_request+0x5c5/0x1620 block/blk-mq.c:911 blk_mq_end_request+0x59/0x680 block/blk-mq.c:1032 lo_complete_rq+0x1c6/0x280 drivers/block/loop.c:370 blk_complete_reqs+0xb3/0xf0 block/blk-mq.c:1110 __do_softirq+0x1d4/0x905 kernel/softirq.c:553 run_ksoftirqd kernel/softirq.c:921 [inline] run_ksoftirqd+0x31/0x60 kernel/softirq.c:913 smpboot_thread_fn+0x659/0x9e0 kernel/smpboot.c:164 kthread+0x344/0x440 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 irq event stamp: 39 hardirqs last enabled at (39): [] __do_kmem_cache_free mm/slab.c:3558 [inline] hardirqs last enabled at (39): [] kmem_cache_free mm/slab.c:3582 [inline] hardirqs last enabled at (39): [] kmem_cache_free+0x244/0x370 mm/slab.c:3575 hardirqs last disabled at (38): [] __do_kmem_cache_free mm/slab.c:3553 [inline] hardirqs last disabled at (38): [] kmem_cache_free mm/slab.c:3582 [inline] hardirqs last disabled at (38): [] kmem_cache_free+0x1de/0x370 mm/slab.c:3575 softirqs last enabled at (0): [] copy_process+0x227f/0x75c0 kernel/fork.c:2448 softirqs last disabled at (0): [<0000000000000000>] 0x0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&fs_info->delayed_iput_lock); lock(&fs_info->delayed_iput_lock); *** DEADLOCK *** 1 lock held by btrfs-cleaner/16079: #0: ffff888107804860 (&fs_info->cleaner_mutex){+.+.}-{3:3}, at: cleaner_kthread+0x103/0x4b0 fs/btrfs/disk-io.c:1463 stack backtrace: CPU: 3 PID: 16079 Comm: btrfs-cleaner Not tainted 6.4.0-syzkaller-09904-ga507db1d8fdc #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_usage_bug kernel/locking/lockdep.c:3978 [inline] valid_state kernel/locking/lockdep.c:4020 [inline] mark_lock_irq kernel/locking/lockdep.c:4223 [inline] mark_lock.part.0+0x1102/0x1960 kernel/locking/lockdep.c:4685 mark_lock kernel/locking/lockdep.c:4649 [inline] mark_usage kernel/locking/lockdep.c:4598 [inline] __lock_acquire+0x8e4/0x5e20 kernel/locking/lockdep.c:5098 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5726 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:350 [inline] btrfs_run_delayed_iputs+0x28/0xe0 fs/btrfs/inode.c:3523 cleaner_kthread+0x2e5/0x4b0 fs/btrfs/disk-io.c:1478 kthread+0x344/0x440 kernel/kthread.c:389 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 So fix this by using spin_lock_irq() and spin_unlock_irq() when running delayed iputs, and using spin_lock_irqsave() and spin_unlock_irqrestore() when adding a delayed iput(). Reported-by: syzbot+da501a04be5ff533b102@syzkaller.appspotmail.com Fixes: ec63b84d4611 ("btrfs: add an ordered_extent pointer to struct btrfs_bio") Link: https://lore.kernel.org/linux-btrfs/000000000000d5c89a05ffbd39dd@google.com/ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit cbaee87f2ef628c10331b69a2f3def6bc32402d7 Author: Filipe Manana Date: Mon Jul 3 18:15:31 2023 +0100 btrfs: fix iput() on error pointer after error during orphan cleanup At btrfs_orphan_cleanup(), if we can't find an inode (btrfs_iget() returns an -ENOENT error pointer), we proceed with 'ret' set to -ENOENT and the inode pointer set to ERR_PTR(-ENOENT). Later when we proceed to the body of the following if statement: if (ret == -ENOENT || inode->i_nlink) { (...) trans = btrfs_start_transaction(root, 1); if (IS_ERR(trans)) { ret = PTR_ERR(trans); iput(inode); goto out; } (...) ret = btrfs_del_orphan_item(trans, root, found_key.objectid); btrfs_end_transaction(trans); if (ret) { iput(inode); goto out; } continue; } If we get an error from btrfs_start_transaction() or from the call to btrfs_del_orphan_item() we end calling iput() against an inode pointer that has a value of ERR_PTR(-ENOENT), resulting in a crash with the following trace: [876.667] BUG: kernel NULL pointer dereference, address: 0000000000000096 [876.667] #PF: supervisor read access in kernel mode [876.667] #PF: error_code(0x0000) - not-present page [876.667] PGD 0 P4D 0 [876.668] Oops: 0000 [#1] PREEMPT SMP PTI [876.668] CPU: 0 PID: 2356187 Comm: mount Tainted: G W 6.4.0-rc6-btrfs-next-134+ #1 [876.668] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014 [876.668] RIP: 0010:iput+0xa/0x20 [876.668] Code: ff ff ff 66 (...) [876.669] RSP: 0018:ffffafa9c0c9f9d0 EFLAGS: 00010282 [876.669] RAX: ffffffffffffffe4 RBX: 000000000009453b RCX: 0000000000000000 [876.669] RDX: 0000000000000001 RSI: ffffafa9c0c9f930 RDI: fffffffffffffffe [876.669] RBP: ffff95c612f3b800 R08: 0000000000000001 R09: ffffffffffffffe4 [876.670] R10: 00018f2a71010000 R11: 000000000ead96e3 R12: ffff95cb7d6909a0 [876.670] R13: fffffffffffffffe R14: ffff95c60f477000 R15: 00000000ffffffe4 [876.670] FS: 00007f5fbe30a840(0000) GS:ffff95ccdfa00000(0000) knlGS:0000000000000000 [876.670] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [876.671] CR2: 0000000000000096 CR3: 000000055e9f6004 CR4: 0000000000370ef0 [876.671] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [876.671] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [876.672] Call Trace: [876.744] [876.744] ? __die_body+0x1b/0x60 [876.744] ? page_fault_oops+0x15d/0x450 [876.745] ? __kmem_cache_alloc_node+0x47/0x410 [876.745] ? do_user_addr_fault+0x65/0x8a0 [876.745] ? exc_page_fault+0x74/0x170 [876.746] ? asm_exc_page_fault+0x22/0x30 [876.746] ? iput+0xa/0x20 [876.746] btrfs_orphan_cleanup+0x221/0x330 [btrfs] [876.746] btrfs_lookup_dentry+0x58f/0x5f0 [btrfs] [876.747] btrfs_lookup+0xe/0x30 [btrfs] [876.747] __lookup_slow+0x82/0x130 [876.785] walk_component+0xe5/0x160 [876.786] path_lookupat.isra.0+0x6e/0x150 [876.786] filename_lookup+0xcf/0x1a0 [876.786] ? mod_objcg_state+0xd2/0x360 [876.786] ? obj_cgroup_charge+0xf5/0x110 [876.787] ? should_failslab+0xa/0x20 [876.787] ? kmem_cache_alloc+0x47/0x450 [876.787] vfs_path_lookup+0x51/0x90 [876.788] mount_subtree+0x8d/0x130 [876.788] btrfs_mount+0x149/0x410 [btrfs] [876.788] ? __kmem_cache_alloc_node+0x47/0x410 [876.788] ? vfs_parse_fs_param+0xc0/0x110 [876.789] legacy_get_tree+0x24/0x50 [876.834] vfs_get_tree+0x22/0xd0 [876.852] path_mount+0x2d8/0x9c0 [876.852] do_mount+0x79/0x90 [876.852] __x64_sys_mount+0x8e/0xd0 [876.853] do_syscall_64+0x38/0x90 [876.899] entry_SYSCALL_64_after_hwframe+0x72/0xdc [876.958] RIP: 0033:0x7f5fbe50b76a [876.959] Code: 48 8b 0d a9 (...) [876.959] RSP: 002b:00007fff01925798 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 [876.959] RAX: ffffffffffffffda RBX: 00007f5fbe694264 RCX: 00007f5fbe50b76a [876.960] RDX: 0000561bde6c8720 RSI: 0000561bde6bdec0 RDI: 0000561bde6c31a0 [876.960] RBP: 0000561bde6bdc70 R08: 0000000000000000 R09: 0000000000000001 [876.960] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [876.960] R13: 0000561bde6c31a0 R14: 0000561bde6c8720 R15: 0000561bde6bdc70 [876.960] So fix this by setting 'inode' to NULL whenever we get an error from btrfs_iget(), and to make the code simpler, stop testing for 'ret' being -ENOENT to check if we have an inode - instead test for 'inode' being NULL or not. Having a NULL 'inode' prevents any iput() call from crashing, as iput() ignores NULL inode pointers. Also, stop testing for a NULL return value from btrfs_iget() with PTR_ERR_OR_ZERO(), because btrfs_iget() never returns NULL - in case an inode is not found, it returns ERR_PTR(-ENOENT), and in case of memory allocation failure, it returns ERR_PTR(-ENOMEM). We also don't need the extra iput() calls on the error branches for the btrfs_start_transaction() and btrfs_del_orphan_item() calls, as we have already called iput() before, so remove them. Fixes: a13bb2c03848 ("btrfs: add missing iputs on orphan cleanup failure") CC: stable@vger.kernel.org # 6.4 Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit b777d279ff31979add57e8a3f810bceb7ef0cfb7 Author: Filipe Manana Date: Mon Jul 3 18:15:30 2023 +0100 btrfs: fix double iput() on inode after an error during orphan cleanup At btrfs_orphan_cleanup(), if we were able to find the inode, we do an iput() on the inode, then if btrfs_drop_verity_items() succeeds and then either btrfs_start_transaction() or btrfs_del_orphan_item() fail, we do another iput() in the respective error paths, resulting in an extra iput() on the inode. Fix this by setting inode to NULL after the first iput(), as iput() ignores a NULL inode pointer argument. Fixes: a13bb2c03848 ("btrfs: add missing iputs on orphan cleanup failure") CC: stable@vger.kernel.org # 6.4 Reviewed-by: Boris Burkov Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit f1a07c2b4e2c473ec322b8b9ece071b8c88a3512 Author: Filipe Manana Date: Mon Jul 3 12:03:21 2023 +0100 btrfs: zoned: fix memory leak after finding block group with super blocks At exclude_super_stripes(), if we happen to find a block group that has super blocks mapped to it and we are on a zoned filesystem, we error out as this is not supposed to happen, indicating either a bug or maybe some memory corruption for example. However we are exiting the function without freeing the memory allocated for the logical address of the super blocks. Fix this by freeing the logical address. Fixes: 12659251ca5d ("btrfs: implement log-structured superblock for ZONED mode") CC: stable@vger.kernel.org # 5.10+ Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit ee70b908f77a9d8f689dea986f09e6d7dc481934 Author: Xu Yang Date: Mon Jul 17 10:28:33 2023 +0800 ARM: dts: nxp/imx6sll: fix wrong property name in usbphy node Property name "phy-3p0-supply" is used instead of "phy-reg_3p0-supply". Fixes: 9f30b6b1a957 ("ARM: dts: imx: Add basic dtsi file for imx6sll") cc: Signed-off-by: Xu Yang Signed-off-by: Shawn Guo commit dcb60f9c403e03133363563ac8ea5d8bba6c2be1 Author: Randy Dunlap Date: Wed Jul 12 20:08:32 2023 -0700 cpumask: eliminate kernel-doc warnings Update lib/cpumask.c and to fix all kernel-doc warnings: include/linux/cpumask.h:185: warning: Function parameter or member 'srcp1' not described in 'cpumask_first_and' include/linux/cpumask.h:185: warning: Function parameter or member 'srcp2' not described in 'cpumask_first_and' include/linux/cpumask.h:185: warning: Excess function parameter 'src1p' description in 'cpumask_first_and' include/linux/cpumask.h:185: warning: Excess function parameter 'src2p' description in 'cpumask_first_and' lib/cpumask.c:59: warning: Function parameter or member 'node' not described in 'alloc_cpumask_var_node' lib/cpumask.c:169: warning: Function parameter or member 'src1p' not described in 'cpumask_any_and_distribute' lib/cpumask.c:169: warning: Function parameter or member 'src2p' not described in 'cpumask_any_and_distribute' Fixes: 7b4967c53204 ("cpumask: Add alloc_cpumask_var_node()") Fixes: 839cad5fa54b ("cpumask: fix function description kernel-doc notation") Fixes: 93ba139ba819 ("cpumask: use find_first_and_bit()") Signed-off-by: Randy Dunlap Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov commit 1cd0787f082e1a179f2b6e749d08daff1a9f6b1b Author: Rob Clark Date: Wed Jul 12 15:25:23 2023 -0700 drm/msm: Fix hw_fence error path cleanup In an error path where the submit is free'd without the job being run, the hw_fence pointer is simply a kzalloc'd block of memory. In this case we should just kfree() it, rather than trying to decrement it's reference count. Fortunately we can tell that this is the case by checking for a zero refcount, since if the job was run, the submit would be holding a reference to the hw_fence. Fixes: f94e6a51e17c ("drm/msm: Pre-allocate hw_fence") Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/547088/ commit ef5c3de5211b5a3a8102b25aa83eb4cde65ac2fd Author: Liam R. Howlett Date: Wed Jul 12 13:39:16 2023 -0400 maple_tree: fix node allocation testing on 32 bit Internal node counting was altered and the 64 bit test was updated, however the 32bit test was missed. Restore the 32bit test to a functional state. Link: https://lore.kernel.org/linux-mm/CAMuHMdV4T53fOw7VPoBgPR7fP6RYqf=CBhD_y_vOg53zZX_DnA@mail.gmail.com/ Link: https://lkml.kernel.org/r/20230712173916.168805-2-Liam.Howlett@oracle.com Fixes: 541e06b772c1 ("maple_tree: remove GFP_ZERO from kmem_cache_alloc() and kmem_cache_alloc_bulk()") Signed-off-by: Liam R. Howlett Cc: Signed-off-by: Andrew Morton commit 7a93c71a6714ca1a9c03d70432dac104b0cfb815 Author: Liam R. Howlett Date: Wed Jul 12 13:39:15 2023 -0400 maple_tree: fix 32 bit mas_next testing The test setup of mas_next is dependent on node entry size to create a 2 level tree, but the tests did not account for this in the expected value when shifting beyond the scope of the tree. Fix this by setting up the test to succeed depending on the node entries which is dependent on the 32/64 bit setup. Link: https://lkml.kernel.org/r/20230712173916.168805-1-Liam.Howlett@oracle.com Fixes: 120b116208a0 ("maple_tree: reorganize testing to restore module testing") Signed-off-by: Liam R. Howlett Reported-by: Geert Uytterhoeven Closes: https://lore.kernel.org/linux-mm/CAMuHMdV4T53fOw7VPoBgPR7fP6RYqf=CBhD_y_vOg53zZX_DnA@mail.gmail.com/ Tested-by: Geert Uytterhoeven Cc: Signed-off-by: Andrew Morton commit 25b5949c30938c7f26dbadc948b491e0e0811c78 Author: Colin Ian King Date: Wed Jul 12 14:46:48 2023 +0100 selftests/mm: mkdirty: fix incorrect position of #endif The #endif is the wrong side of a } causing a build failure when __NR_userfaultfd is not defined. Fix this by moving the #end to enclose the } Link: https://lkml.kernel.org/r/20230712134648.456349-1-colin.i.king@gmail.com Fixes: 9eac40fc0cc7 ("selftests/mm: mkdirty: test behavior of (pte|pmd)_mkdirty on VMAs without write permissions") Signed-off-by: Colin Ian King Reviewed-by: David Hildenbrand Cc: Shuah Khan Cc: Signed-off-by: Andrew Morton commit 3c769fd88b9742954763a968e84de09f7ad78cfe Author: Peng Zhang Date: Tue Jul 11 11:54:37 2023 +0800 maple_tree: set the node limit when creating a new root node Set the node limit of the root node so that the last pivot of all nodes is the node limit (if the node is not full). This patch also fixes a bug in mas_rev_awalk(). Effectively, always setting a maximum makes mas_logical_pivot() behave as mas_safe_pivot(). Without this fix, it is possible that very small tasks would fail to find the correct gap. Although this has not been observed with real tasks, it has been reported to happen in m68k nommu running the maple tree tests. Link: https://lkml.kernel.org/r/20230711035444.526-1-zhangpeng.00@bytedance.com Link: https://lore.kernel.org/linux-mm/CAMuHMdV4T53fOw7VPoBgPR7fP6RYqf=CBhD_y_vOg53zZX_DnA@mail.gmail.com/ Link: https://lkml.kernel.org/r/20230711035444.526-2-zhangpeng.00@bytedance.com Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Tested-by: Geert Uytterhoeven Cc: Signed-off-by: Andrew Morton commit 2658f94d679243209889cdfa8de3743cde1abea9 Author: Liam R. Howlett Date: Tue Jul 11 13:50:20 2023 -0400 mm/mlock: fix vma iterator conversion of apply_vma_lock_flags() apply_vma_lock_flags() calls mlock_fixup(), which could merge the VMA after where the vma iterator is located. Although this is not an issue, the next iteration of the loop will check the start of the vma to be equal to the locally saved 'tmp' variable and cause an incorrect failure scenario. Fix the error by setting tmp to the end of the vma iterator value before restarting the loop. There is also a potential of the error code being overwritten when the loop terminates early. Fix the return issue by directly returning when an error is encountered since there is nothing to undo after the loop. Link: https://lkml.kernel.org/r/20230711175020.4091336-1-Liam.Howlett@oracle.com Fixes: 37598f5a9d8b ("mlock: convert mlock to vma iterator") Signed-off-by: Liam R. Howlett Reported-by: Ryan Roberts Link: https://lore.kernel.org/linux-mm/50341ca1-d582-b33a-e3d0-acb08a65166f@arm.com/ Tested-by: Ryan Roberts Cc: Signed-off-by: Andrew Morton commit 636e348353a7cc52609fdba5ff3270065da140d5 Author: Miguel Ojeda Date: Sun Jul 9 01:33:44 2023 +0200 prctl: move PR_GET_AUXV out of PR_MCE_KILL Somehow PR_GET_AUXV got added into PR_MCE_KILL's switch when the patch was applied [1]. Thus move it out of the switch, to the place the patch added it. In the recently released v6.4 kernel some user could, in principle, be already using this feature by mapping the right page and passing the PR_GET_AUXV constant as a pointer: prctl(PR_MCE_KILL, PR_GET_AUXV, ...) So this does change the behavior for users. We could keep the bug since the other subcases in PR_MCE_KILL (PR_MCE_KILL_CLEAR and PR_MCE_KILL_SET) do not overlap. However, v6.4 may be recent enough (2 weeks old) that moving the lines (rather than just adding a new case) does not break anybody? Moreover, the documentation in man-pages was just committed today [2]. Link: https://lkml.kernel.org/r/20230708233344.361854-1-ojeda@kernel.org Fixes: ddc65971bb67 ("prctl: add PR_GET_AUXV to copy auxv to userspace") Link: https://lore.kernel.org/all/d81864a7f7f43bca6afa2a09fc2e850e4050ab42.1680611394.git.josh@joshtriplett.org/ [1] Link: https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?id=8cf0c06bfd3c2b219b044d4151c96f0da50af9ad [2] Signed-off-by: Miguel Ojeda Cc: Josh Triplett Cc: Signed-off-by: Andrew Morton commit 481c2d14627de8ecbb54dd125466e4b4a5069b47 Author: Lino Sanfilippo Date: Thu Jul 13 21:01:08 2023 +0200 tpm,tpm_tis: Disable interrupts after 1000 unhandled IRQs After activation of interrupts for TPM TIS drivers 0-day reports an interrupt storm on an Inspur NF5180M6 server. Fix this by detecting the storm and falling back to polling: Count the number of unhandled interrupts within a 10 ms time interval. In case that more than 1000 were unhandled deactivate interrupts entirely, deregister the handler and use polling instead. Also print a note to point to the tpm_tis_dmi_table. Since the interrupt deregistration function devm_free_irq() waits for all interrupt handlers to finish, only trigger a worker in the interrupt handler and do the unregistration in the worker to avoid a deadlock. Note: the storm detection logic equals the implementation in note_interrupt() which uses timestamps and counters stored in struct irq_desc. Since this structure is private to the generic interrupt core the TPM TIS core uses its own timestamps and counters. Furthermore the TPM interrupt handler always returns IRQ_HANDLED to prevent the generic interrupt core from processing the interrupt storm. Cc: stable@vger.kernel.org # v6.4+ Fixes: e644b2f498d2 ("tpm, tpm_tis: Enable interrupt test") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202305041325.ae8b0c43-yujie.liu@intel.com/ Suggested-by: Lukas Wunner Signed-off-by: Lino Sanfilippo Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 393f362389cecc2e4f2e3520a6c8ee9dbb1e3d15 Author: Florian Bezdeka Date: Tue Jun 20 13:11:01 2023 +0200 tpm/tpm_tis: Disable interrupts for Lenovo L590 devices The Lenovo L590 suffers from an irq storm issue like the T490, T490s and P360 Tiny, so add an entry for it to tpm_tis_dmi_table and force polling. Cc: stable@vger.kernel.org # v6.4+ Link: https://bugzilla.redhat.com/show_bug.cgi?id=2214069#c0 Fixes: e644b2f498d2 ("tpm, tpm_tis: Enable interrupt test") Signed-off-by: Florian Bezdeka Reviewed-by: Jerry Snitselaar Reviewed-by: Hans de Goede Signed-off-by: Jarkko Sakkinen commit b1c1b98962d17a922989aa3b2822946bbb5c091f Author: Valentin David Date: Mon Jul 10 22:27:49 2023 +0200 tpm: Do not remap from ACPI resources again for Pluton TPM For Pluton TPM devices, it was assumed that there was no ACPI memory regions. This is not true for ASUS ROG Ally. ACPI advertises 0xfd500000-0xfd5fffff. Since remapping is already done in `crb_map_pluton`, remapping again in `crb_map_io` causes EBUSY error: [ 3.510453] tpm_crb MSFT0101:00: can't request region for resource [mem 0xfd500000-0xfd5fffff] [ 3.510463] tpm_crb: probe of MSFT0101:00 failed with error -16 Cc: stable@vger.kernel.org # v6.3+ Fixes: 4d2732882703 ("tpm_crb: Add support for CRB devices based on Pluton") Signed-off-by: Valentin David Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit bc825e851c2fe89c127cac1e0e5cf344c4940619 Author: Christian Hesse Date: Mon Jul 10 23:16:10 2023 +0200 tpm/tpm_tis: Disable interrupts for Framework Laptop Intel 13th gen This device suffer an irq storm, so add it in tpm_tis_dmi_table to force polling. Cc: stable@vger.kernel.org # v6.4+ Link: https://community.frame.work/t/boot-and-shutdown-hangs-with-arch-linux-kernel-6-4-1-mainline-and-arch/33118 Fixes: e644b2f498d2 ("tpm, tpm_tis: Enable interrupt test") Reported-by: Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217631 Signed-off-by: Christian Hesse Signed-off-by: Jarkko Sakkinen commit 08b0af4478bacb8bb701c172c99a34ea32da89f5 Author: Christian Hesse Date: Mon Jul 10 23:16:09 2023 +0200 tpm/tpm_tis: Disable interrupts for Framework Laptop Intel 12th gen This device suffer an irq storm, so add it in tpm_tis_dmi_table to force polling. Cc: stable@vger.kernel.org # v6.4+ Link: https://community.frame.work/t/boot-and-shutdown-hangs-with-arch-linux-kernel-6-4-1-mainline-and-arch/33118 Fixes: e644b2f498d2 ("tpm, tpm_tis: Enable interrupt test") Reported-by: Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217631 Signed-off-by: Christian Hesse Signed-off-by: Jarkko Sakkinen commit 2a4152742025c5f21482e8cebc581702a0fa5b01 Author: Jiapeng Chong Date: Wed Jun 14 10:18:25 2023 +0800 security: keys: Modify mismatched function name No functional modification involved. security/keys/trusted-keys/trusted_tpm2.c:203: warning: expecting prototype for tpm_buf_append_auth(). Prototype was for tpm2_buf_append_auth() instead. Fixes: 2e19e10131a0 ("KEYS: trusted: Move TPM2 trusted keys code") Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5524 Signed-off-by: Jiapeng Chong Reviewed-by: Paul Moore Signed-off-by: Jarkko Sakkinen commit ecff6813d2bcf0c670881a9ba3f51cb032dd405a Author: Jerry Snitselaar Date: Thu Jun 29 13:41:47 2023 -0700 tpm: return false from tpm_amd_is_rng_defective on non-x86 platforms tpm_amd_is_rng_defective is for dealing with an issue related to the AMD firmware TPM, so on non-x86 architectures just have it inline and return false. Cc: stable@vger.kernel.org # v6.3+ Reported-by: Sachin Sant Reported-by: Aneesh Kumar K. V Closes: https://lore.kernel.org/lkml/99B81401-DB46-49B9-B321-CF832B50CAC3@linux.ibm.com/ Fixes: f1324bbc4011 ("tpm: disable hwrng for fTPM on some AMD designs") Signed-off-by: Jerry Snitselaar Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit d55901522f96082a43b9842d34867363c0cdbac5 Author: Petr Pavlu Date: Thu Mar 23 14:04:12 2023 +0100 keys: Fix linking a duplicate key to a keyring's assoc_array When making a DNS query inside the kernel using dns_query(), the request code can in rare cases end up creating a duplicate index key in the assoc_array of the destination keyring. It is eventually found by a BUG_ON() check in the assoc_array implementation and results in a crash. Example report: [2158499.700025] kernel BUG at ../lib/assoc_array.c:652! [2158499.700039] invalid opcode: 0000 [#1] SMP PTI [2158499.700065] CPU: 3 PID: 31985 Comm: kworker/3:1 Kdump: loaded Not tainted 5.3.18-150300.59.90-default #1 SLE15-SP3 [2158499.700096] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020 [2158499.700351] Workqueue: cifsiod cifs_resolve_server [cifs] [2158499.700380] RIP: 0010:assoc_array_insert+0x85f/0xa40 [2158499.700401] Code: ff 74 2b 48 8b 3b 49 8b 45 18 4c 89 e6 48 83 e7 fe e8 95 ec 74 00 3b 45 88 7d db 85 c0 79 d4 0f 0b 0f 0b 0f 0b e8 41 f2 be ff <0f> 0b 0f 0b 81 7d 88 ff ff ff 7f 4c 89 eb 4c 8b ad 58 ff ff ff 0f [2158499.700448] RSP: 0018:ffffc0bd6187faf0 EFLAGS: 00010282 [2158499.700470] RAX: ffff9f1ea7da2fe8 RBX: ffff9f1ea7da2fc1 RCX: 0000000000000005 [2158499.700492] RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000000 [2158499.700515] RBP: ffffc0bd6187fbb0 R08: ffff9f185faf1100 R09: 0000000000000000 [2158499.700538] R10: ffff9f1ea7da2cc0 R11: 000000005ed8cec8 R12: ffffc0bd6187fc28 [2158499.700561] R13: ffff9f15feb8d000 R14: ffff9f1ea7da2fc0 R15: ffff9f168dc0d740 [2158499.700585] FS: 0000000000000000(0000) GS:ffff9f185fac0000(0000) knlGS:0000000000000000 [2158499.700610] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [2158499.700630] CR2: 00007fdd94fca238 CR3: 0000000809d8c006 CR4: 00000000003706e0 [2158499.700702] Call Trace: [2158499.700741] ? key_alloc+0x447/0x4b0 [2158499.700768] ? __key_link_begin+0x43/0xa0 [2158499.700790] __key_link_begin+0x43/0xa0 [2158499.700814] request_key_and_link+0x2c7/0x730 [2158499.700847] ? dns_resolver_read+0x20/0x20 [dns_resolver] [2158499.700873] ? key_default_cmp+0x20/0x20 [2158499.700898] request_key_tag+0x43/0xa0 [2158499.700926] dns_query+0x114/0x2ca [dns_resolver] [2158499.701127] dns_resolve_server_name_to_ip+0x194/0x310 [cifs] [2158499.701164] ? scnprintf+0x49/0x90 [2158499.701190] ? __switch_to_asm+0x40/0x70 [2158499.701211] ? __switch_to_asm+0x34/0x70 [2158499.701405] reconn_set_ipaddr_from_hostname+0x81/0x2a0 [cifs] [2158499.701603] cifs_resolve_server+0x4b/0xd0 [cifs] [2158499.701632] process_one_work+0x1f8/0x3e0 [2158499.701658] worker_thread+0x2d/0x3f0 [2158499.701682] ? process_one_work+0x3e0/0x3e0 [2158499.701703] kthread+0x10d/0x130 [2158499.701723] ? kthread_park+0xb0/0xb0 [2158499.701746] ret_from_fork+0x1f/0x40 The situation occurs as follows: * Some kernel facility invokes dns_query() to resolve a hostname, for example, "abcdef". The function registers its global DNS resolver cache as current->cred.thread_keyring and passes the query to request_key_net() -> request_key_tag() -> request_key_and_link(). * Function request_key_and_link() creates a keyring_search_context object. Its match_data.cmp method gets set via a call to type->match_preparse() (resolves to dns_resolver_match_preparse()) to dns_resolver_cmp(). * Function request_key_and_link() continues and invokes search_process_keyrings_rcu() which returns that a given key was not found. The control is then passed to request_key_and_link() -> construct_alloc_key(). * Concurrently to that, a second task similarly makes a DNS query for "abcdef." and its result gets inserted into the DNS resolver cache. * Back on the first task, function construct_alloc_key() first runs __key_link_begin() to determine an assoc_array_edit operation to insert a new key. Index keys in the array are compared exactly as-is, using keyring_compare_object(). The operation finds that "abcdef" is not yet present in the destination keyring. * Function construct_alloc_key() continues and checks if a given key is already present on some keyring by again calling search_process_keyrings_rcu(). This search is done using dns_resolver_cmp() and "abcdef" gets matched with now present key "abcdef.". * The found key is linked on the destination keyring by calling __key_link() and using the previously calculated assoc_array_edit operation. This inserts the "abcdef." key in the array but creates a duplicity because the same index key is already present. Fix the problem by postponing __key_link_begin() in construct_alloc_key() until an actual key which should be linked into the destination keyring is determined. [jarkko@kernel.org: added a fixes tag and cc to stable] Cc: stable@vger.kernel.org # v5.3+ Fixes: df593ee23e05 ("keys: Hoist locking out of __key_link_begin()") Signed-off-by: Petr Pavlu Reviewed-by: Joey Lee Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 83e7e5d89f04d1c417492940f7922bc8416a8cc4 Author: Alexander Sverdlin Date: Wed May 24 17:40:40 2023 +0200 tpm: tis_i2c: Limit write bursts to I2C_SMBUS_BLOCK_MAX (32) bytes Underlying I2C bus drivers not always support longer transfers and imx-lpi2c for instance doesn't. The fix is symmetric to previous patch which fixed the read direction. Cc: stable@vger.kernel.org # v5.20+ Fixes: bbc23a07b072 ("tpm: Add tpm_tis_i2c backend for tpm_tis_core") Tested-by: Michael Haener Signed-off-by: Alexander Sverdlin Reviewed-by: Jarkko Sakkinen Reviewed-by: Jerry Snitselaar Signed-off-by: Jarkko Sakkinen commit f3b70b6e3390bfdf18fdd7d278a72a12784fdcce Author: Alexander Sverdlin Date: Wed May 24 17:40:39 2023 +0200 tpm: tis_i2c: Limit read bursts to I2C_SMBUS_BLOCK_MAX (32) bytes Underlying I2C bus drivers not always support longer transfers and imx-lpi2c for instance doesn't. SLB 9673 offers 427-bytes packets. Visible symptoms are: tpm tpm0: Error left over data tpm tpm0: tpm_transmit: tpm_recv: error -5 tpm_tis_i2c: probe of 1-002e failed with error -5 Cc: stable@vger.kernel.org # v5.20+ Fixes: bbc23a07b072 ("tpm: Add tpm_tis_i2c backend for tpm_tis_core") Tested-by: Michael Haener Signed-off-by: Alexander Sverdlin Reviewed-by: Jarkko Sakkinen Reviewed-by: Jerry Snitselaar Signed-off-by: Jarkko Sakkinen commit f0afba4042bd902d290405c0638bc1295872d8a7 Author: Peijie Shao Date: Tue May 23 10:45:36 2023 +0800 tpm_tis_spi: Release chip select when flow control fails The failure paths in tpm_tis_spi_transfer() do not deactivate chip select. Send an empty message (cs_select == 0) to overcome this. The patch is tested by two ways. One way needs to touch hardware: 1. force pull MISO pin down to GND, it emulates a forever 'WAIT' timing. 2. probe cs pin by an oscilloscope. 3. load tpm_tis_spi.ko. After loading, dmesg prints: "probe of spi0.0 failed with error -110" and oscilloscope shows cs pin goes high(deactivated) after the failure. Before the patch, cs pin keeps low. Second way is by writing a fake spi controller. 1. implement .transfer_one method, fill all rx buf with 0. 2. implement .set_cs method, print the state of cs pin. we can see cs goes high after the failure. Signed-off-by: Peijie Shao Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit edb13d7bb034c4d5523f15e9aeea31c504af6f91 Author: Peter Ujfalusi Date: Wed May 17 15:29:31 2023 +0300 tpm: tpm_tis: Disable interrupts *only* for AEON UPX-i11 Further restrict with DMI_PRODUCT_VERSION. Cc: stable@vger.kernel.org # v6.4+ Link: https://lore.kernel.org/linux-integrity/20230517122931.22385-1-peter.ujfalusi@linux.intel.com/ Fixes: 95a9359ee22f ("tpm: tpm_tis: Disable interrupts for AEON UPX-i11") Signed-off-by: Peter Ujfalusi Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit f4032d615f90970d6c3ac1d9c0bce3351eb4445c Author: Jarkko Sakkinen Date: Tue May 16 01:25:54 2023 +0300 tpm: tpm_vtpm_proxy: fix a race condition in /dev/vtpmx creation /dev/vtpmx is made visible before 'workqueue' is initialized, which can lead to a memory corruption in the worst case scenario. Address this by initializing 'workqueue' as the very first step of the driver initialization. Cc: stable@vger.kernel.org Fixes: 6f99612e2500 ("tpm: Proxy driver for supporting multiple emulated TPMs") Reviewed-by: Stefan Berger Signed-off-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 6e8a996563ecbe68e49c49abd4aaeef69f11f2dc Author: Gaosheng Cui Date: Mon Jul 17 09:47:38 2023 +0800 drm/msm: Fix IS_ERR_OR_NULL() vs NULL check in a5xx_submit_in_rb() The msm_gem_get_vaddr() returns an ERR_PTR() on failure, and a null is catastrophic here, so we should use IS_ERR_OR_NULL() to check the return value. Fixes: 6a8bd08d0465 ("drm/msm: add sudo flag to submit ioctl") Signed-off-by: Gaosheng Cui Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Akhil P Oommen Patchwork: https://patchwork.freedesktop.org/patch/547712/ Signed-off-by: Rob Clark commit 269f399dc19f0e5c51711c3ba3bd06e0ef6ef403 Author: Matus Gajdos Date: Wed Jul 12 14:49:33 2023 +0200 ASoC: fsl_sai: Disable bit clock with transmitter Otherwise bit clock remains running writing invalid data to the DAC. Signed-off-by: Matus Gajdos Acked-by: Shengjiu Wang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230712124934.32232-1-matuszpd@gmail.com Signed-off-by: Mark Brown commit 9efa1a5407e81265ea502cab83be4de503decc49 Author: Fedor Ross Date: Thu May 4 21:50:59 2023 +0200 can: mcp251xfd: __mcp251xfd_chip_set_mode(): increase poll timeout The mcp251xfd controller needs an idle bus to enter 'Normal CAN 2.0 mode' or . The maximum length of a CAN frame is 736 bits (64 data bytes, CAN-FD, EFF mode, worst case bit stuffing and interframe spacing). For low bit rates like 10 kbit/s the arbitrarily chosen MCP251XFD_POLL_TIMEOUT_US of 1 ms is too small. Otherwise during polling for the CAN controller to enter 'Normal CAN 2.0 mode' the timeout limit is exceeded and the configuration fails with: | $ ip link set dev can1 up type can bitrate 10000 | [ 731.911072] mcp251xfd spi2.1 can1: Controller failed to enter mode CAN 2.0 Mode (6) and stays in Configuration Mode (4) (con=0x068b0760, osc=0x00000468). | [ 731.927192] mcp251xfd spi2.1 can1: CRC read error at address 0x0e0c (length=4, data=00 00 00 00, CRC=0x0000) retrying. | [ 731.938101] A link change request failed with some changes committed already. Interface can1 may have been left with an inconsistent configuration, please check. | RTNETLINK answers: Connection timed out Make MCP251XFD_POLL_TIMEOUT_US timeout calculation dynamic. Use maximum of 1ms and bit time of 1 full 64 data bytes CAN-FD frame in EFF mode, worst case bit stuffing and interframe spacing at the current bit rate. For easier backporting define the macro MCP251XFD_FRAME_LEN_MAX_BITS that holds the max frame length in bits, which is 736. This can be replaced by can_frame_bits(true, true, true, true, CANFD_MAX_DLEN) in a cleanup patch later. Fixes: 55e5b97f003e8 ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN") Signed-off-by: Fedor Ross Signed-off-by: Marek Vasut Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/20230717-mcp251xfd-fix-increase-poll-timeout-v5-1-06600f34c684@pengutronix.de Signed-off-by: Marc Kleine-Budde commit c34743daca0eb1dc855831a5210f0800a850088e Author: Ahmed Zaki Date: Mon Jun 5 10:52:26 2023 -0400 iavf: fix reset task race with iavf_remove() The reset task is currently scheduled from the watchdog or adminq tasks. First, all direct calls to schedule the reset task are replaced with the iavf_schedule_reset(), which is modified to accept the flag showing the type of reset. To prevent the reset task from starting once iavf_remove() starts, we need to check the __IAVF_IN_REMOVE_TASK bit before we schedule it. This is now easily added to iavf_schedule_reset(). Finally, remove the check for IAVF_FLAG_RESET_NEEDED in the watchdog task. It is redundant since all callers who set the flag immediately schedules the reset task. Fixes: 3ccd54ef44eb ("iavf: Fix init state closure on remove") Fixes: 14756b2ae265 ("iavf: Fix __IAVF_RESETTING state usage") Signed-off-by: Ahmed Zaki Signed-off-by: Mateusz Palczewski Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit d1639a17319ba78a018280cd2df6577a7e5d9fab Author: Ahmed Zaki Date: Mon Jun 5 10:52:25 2023 -0400 iavf: fix a deadlock caused by rtnl and driver's lock circular dependencies A driver's lock (crit_lock) is used to serialize all the driver's tasks. Lockdep, however, shows a circular dependency between rtnl and crit_lock. This happens when an ndo that already holds the rtnl requests the driver to reset, since the reset task (in some paths) tries to grab rtnl to either change real number of queues of update netdev features. [566.241851] ====================================================== [566.241893] WARNING: possible circular locking dependency detected [566.241936] 6.2.14-100.fc36.x86_64+debug #1 Tainted: G OE [566.241984] ------------------------------------------------------ [566.242025] repro.sh/2604 is trying to acquire lock: [566.242061] ffff9280fc5ceee8 (&adapter->crit_lock){+.+.}-{3:3}, at: iavf_close+0x3c/0x240 [iavf] [566.242167] but task is already holding lock: [566.242209] ffffffff9976d350 (rtnl_mutex){+.+.}-{3:3}, at: iavf_remove+0x6b5/0x730 [iavf] [566.242300] which lock already depends on the new lock. [566.242353] the existing dependency chain (in reverse order) is: [566.242401] -> #1 (rtnl_mutex){+.+.}-{3:3}: [566.242451] __mutex_lock+0xc1/0xbb0 [566.242489] iavf_init_interrupt_scheme+0x179/0x440 [iavf] [566.242560] iavf_watchdog_task+0x80b/0x1400 [iavf] [566.242627] process_one_work+0x2b3/0x560 [566.242663] worker_thread+0x4f/0x3a0 [566.242696] kthread+0xf2/0x120 [566.242730] ret_from_fork+0x29/0x50 [566.242763] -> #0 (&adapter->crit_lock){+.+.}-{3:3}: [566.242815] __lock_acquire+0x15ff/0x22b0 [566.242869] lock_acquire+0xd2/0x2c0 [566.242901] __mutex_lock+0xc1/0xbb0 [566.242934] iavf_close+0x3c/0x240 [iavf] [566.242997] __dev_close_many+0xac/0x120 [566.243036] dev_close_many+0x8b/0x140 [566.243071] unregister_netdevice_many_notify+0x165/0x7c0 [566.243116] unregister_netdevice_queue+0xd3/0x110 [566.243157] iavf_remove+0x6c1/0x730 [iavf] [566.243217] pci_device_remove+0x33/0xa0 [566.243257] device_release_driver_internal+0x1bc/0x240 [566.243299] pci_stop_bus_device+0x6c/0x90 [566.243338] pci_stop_and_remove_bus_device+0xe/0x20 [566.243380] pci_iov_remove_virtfn+0xd1/0x130 [566.243417] sriov_disable+0x34/0xe0 [566.243448] ice_free_vfs+0x2da/0x330 [ice] [566.244383] ice_sriov_configure+0x88/0xad0 [ice] [566.245353] sriov_numvfs_store+0xde/0x1d0 [566.246156] kernfs_fop_write_iter+0x15e/0x210 [566.246921] vfs_write+0x288/0x530 [566.247671] ksys_write+0x74/0xf0 [566.248408] do_syscall_64+0x58/0x80 [566.249145] entry_SYSCALL_64_after_hwframe+0x72/0xdc [566.249886] other info that might help us debug this: [566.252014] Possible unsafe locking scenario: [566.253432] CPU0 CPU1 [566.254118] ---- ---- [566.254800] lock(rtnl_mutex); [566.255514] lock(&adapter->crit_lock); [566.256233] lock(rtnl_mutex); [566.256897] lock(&adapter->crit_lock); [566.257388] *** DEADLOCK *** The deadlock can be triggered by a script that is continuously resetting the VF adapter while doing other operations requiring RTNL, e.g: while :; do ip link set $VF up ethtool --set-channels $VF combined 2 ip link set $VF down ip link set $VF up ethtool --set-channels $VF combined 4 ip link set $VF down done Any operation that triggers a reset can substitute "ethtool --set-channles" As a fix, add a new task "finish_config" that do all the work which needs rtnl lock. With the exception of iavf_remove(), all work that require rtnl should be called from this task. As for iavf_remove(), at the point where we need to call unregister_netdevice() (and grab rtnl_lock), we make sure the finish_config task is not running (cancel_work_sync()) to safely grab rtnl. Subsequent finish_config work cannot restart after that since the task is guarded by the __IAVF_IN_REMOVE_TASK bit in iavf_schedule_finish_config(). Fixes: 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections") Signed-off-by: Ahmed Zaki Signed-off-by: Mateusz Palczewski Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit d916d273041b0b5652434ff27aec716ff90992ac Author: Marcin Szycik Date: Mon Jun 5 10:52:24 2023 -0400 Revert "iavf: Do not restart Tx queues after reset task failure" This reverts commit 08f1c147b7265245d67321585c68a27e990e0c4b. Netdev is no longer being detached during reset, so this fix can be reverted. We leave the removal of "hacky" IFF_UP flag update. Signed-off-by: Marcin Szycik Signed-off-by: Mateusz Palczewski Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit d2806d960e8387945b53edf7ed9d71ab3ab5f073 Author: Marcin Szycik Date: Mon Jun 5 10:52:23 2023 -0400 Revert "iavf: Detach device during reset task" This reverts commit aa626da947e9cd30c4cf727493903e1adbb2c0a0. Detaching device during reset was not fully fixing the rtnl locking issue, as there could be a situation where callback was already in progress before detaching netdev. Furthermore, detaching netdevice causes TX timeouts if traffic is running. To reproduce: ip netns exec ns1 iperf3 -c $PEER_IP -t 600 --logfile /dev/null & while :; do for i in 200 7000 400 5000 300 3000 ; do ip netns exec ns1 ip link set $VF1 mtu $i sleep 2 done sleep 10 done Currently, callbacks such as iavf_change_mtu() wait for the reset. If the reset fails to acquire the rtnl_lock, they schedule the netdev update for later while continuing the reset flow. Operations like MTU changes are performed under the rtnl_lock. Therefore, when the operation finishes, another callback that uses rtnl_lock can start. Signed-off-by: Dawid Wesierski Signed-off-by: Marcin Szycik Signed-off-by: Mateusz Palczewski Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit c2ed2403f12c74a74a0091ed5d830e72c58406e8 Author: Marcin Szycik Date: Mon Jun 5 10:52:22 2023 -0400 iavf: Wait for reset in callbacks which trigger it There was a fail when trying to add the interface to bonding right after changing the MTU on the interface. It was caused by bonding interface unable to open the interface due to interface being in __RESETTING state because of MTU change. Add new reset_waitqueue to indicate that reset has finished. Add waiting for reset to finish in callbacks which trigger hw reset: iavf_set_priv_flags(), iavf_change_mtu() and iavf_set_ringparam(). We use a 5000ms timeout period because on Hyper-V based systems, this operation takes around 3000-4000ms. In normal circumstances, it doesn't take more than 500ms to complete. Add a function iavf_wait_for_reset() to reuse waiting for reset code and use it also in iavf_set_channels(), which already waits for reset. We don't use error handling in iavf_set_channels() as this could cause the device to be in incorrect state if the reset was scheduled but hit timeout or the waitng function was interrupted by a signal. Fixes: 4e5e6b5d9d13 ("iavf: Fix return of set the new channel count") Signed-off-by: Marcin Szycik Co-developed-by: Dawid Wesierski Signed-off-by: Dawid Wesierski Signed-off-by: Sylwester Dziedziuch Signed-off-by: Kamil Maziarz Signed-off-by: Mateusz Palczewski Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit a77ed5c5b768e9649be240a2d864e5cd9c6a2015 Author: Ahmed Zaki Date: Fri May 19 15:46:02 2023 -0600 iavf: use internal state to free traffic IRQs If the system tries to close the netdev while iavf_reset_task() is running, __LINK_STATE_START will be cleared and netif_running() will return false in iavf_reinit_interrupt_scheme(). This will result in iavf_free_traffic_irqs() not being called and a leak as follows: [7632.489326] remove_proc_entry: removing non-empty directory 'irq/999', leaking at least 'iavf-enp24s0f0v0-TxRx-0' [7632.490214] WARNING: CPU: 0 PID: 10 at fs/proc/generic.c:718 remove_proc_entry+0x19b/0x1b0 is shown when pci_disable_msix() is later called. Fix by using the internal adapter state. The traffic IRQs will always exist if state == __IAVF_RUNNING. Fixes: 5b36e8d04b44 ("i40evf: Enable VF to request an alternate queue allocation") Signed-off-by: Ahmed Zaki Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 7c4bced3caa749ce468b0c5de711c98476b23a52 Author: Ding Hui Date: Tue May 9 19:11:48 2023 +0800 iavf: Fix out-of-bounds when setting channels on remove If we set channels greater during iavf_remove(), and waiting reset done would be timeout, then returned with error but changed num_active_queues directly, that will lead to OOB like the following logs. Because the num_active_queues is greater than tx/rx_rings[] allocated actually. Reproducer: [root@host ~]# cat repro.sh #!/bin/bash pf_dbsf="0000:41:00.0" vf0_dbsf="0000:41:02.0" g_pids=() function do_set_numvf() { echo 2 >/sys/bus/pci/devices/${pf_dbsf}/sriov_numvfs sleep $((RANDOM%3+1)) echo 0 >/sys/bus/pci/devices/${pf_dbsf}/sriov_numvfs sleep $((RANDOM%3+1)) } function do_set_channel() { local nic=$(ls -1 --indicator-style=none /sys/bus/pci/devices/${vf0_dbsf}/net/) [ -z "$nic" ] && { sleep $((RANDOM%3)) ; return 1; } ifconfig $nic 192.168.18.5 netmask 255.255.255.0 ifconfig $nic up ethtool -L $nic combined 1 ethtool -L $nic combined 4 sleep $((RANDOM%3)) } function on_exit() { local pid for pid in "${g_pids[@]}"; do kill -0 "$pid" &>/dev/null && kill "$pid" &>/dev/null done g_pids=() } trap "on_exit; exit" EXIT while :; do do_set_numvf ; done & g_pids+=($!) while :; do do_set_channel ; done & g_pids+=($!) wait Result: [ 3506.152887] iavf 0000:41:02.0: Removing device [ 3510.400799] ================================================================== [ 3510.400820] BUG: KASAN: slab-out-of-bounds in iavf_free_all_tx_resources+0x156/0x160 [iavf] [ 3510.400823] Read of size 8 at addr ffff88b6f9311008 by task repro.sh/55536 [ 3510.400823] [ 3510.400830] CPU: 101 PID: 55536 Comm: repro.sh Kdump: loaded Tainted: G O --------- -t - 4.18.0 #1 [ 3510.400832] Hardware name: Powerleader PR2008AL/H12DSi-N6, BIOS 2.0 04/09/2021 [ 3510.400835] Call Trace: [ 3510.400851] dump_stack+0x71/0xab [ 3510.400860] print_address_description+0x6b/0x290 [ 3510.400865] ? iavf_free_all_tx_resources+0x156/0x160 [iavf] [ 3510.400868] kasan_report+0x14a/0x2b0 [ 3510.400873] iavf_free_all_tx_resources+0x156/0x160 [iavf] [ 3510.400880] iavf_remove+0x2b6/0xc70 [iavf] [ 3510.400884] ? iavf_free_all_rx_resources+0x160/0x160 [iavf] [ 3510.400891] ? wait_woken+0x1d0/0x1d0 [ 3510.400895] ? notifier_call_chain+0xc1/0x130 [ 3510.400903] pci_device_remove+0xa8/0x1f0 [ 3510.400910] device_release_driver_internal+0x1c6/0x460 [ 3510.400916] pci_stop_bus_device+0x101/0x150 [ 3510.400919] pci_stop_and_remove_bus_device+0xe/0x20 [ 3510.400924] pci_iov_remove_virtfn+0x187/0x420 [ 3510.400927] ? pci_iov_add_virtfn+0xe10/0xe10 [ 3510.400929] ? pci_get_subsys+0x90/0x90 [ 3510.400932] sriov_disable+0xed/0x3e0 [ 3510.400936] ? bus_find_device+0x12d/0x1a0 [ 3510.400953] i40e_free_vfs+0x754/0x1210 [i40e] [ 3510.400966] ? i40e_reset_all_vfs+0x880/0x880 [i40e] [ 3510.400968] ? pci_get_device+0x7c/0x90 [ 3510.400970] ? pci_get_subsys+0x90/0x90 [ 3510.400982] ? pci_vfs_assigned.part.7+0x144/0x210 [ 3510.400987] ? __mutex_lock_slowpath+0x10/0x10 [ 3510.400996] i40e_pci_sriov_configure+0x1fa/0x2e0 [i40e] [ 3510.401001] sriov_numvfs_store+0x214/0x290 [ 3510.401005] ? sriov_totalvfs_show+0x30/0x30 [ 3510.401007] ? __mutex_lock_slowpath+0x10/0x10 [ 3510.401011] ? __check_object_size+0x15a/0x350 [ 3510.401018] kernfs_fop_write+0x280/0x3f0 [ 3510.401022] vfs_write+0x145/0x440 [ 3510.401025] ksys_write+0xab/0x160 [ 3510.401028] ? __ia32_sys_read+0xb0/0xb0 [ 3510.401031] ? fput_many+0x1a/0x120 [ 3510.401032] ? filp_close+0xf0/0x130 [ 3510.401038] do_syscall_64+0xa0/0x370 [ 3510.401041] ? page_fault+0x8/0x30 [ 3510.401043] entry_SYSCALL_64_after_hwframe+0x65/0xca [ 3510.401073] RIP: 0033:0x7f3a9bb842c0 [ 3510.401079] Code: 73 01 c3 48 8b 0d d8 cb 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 89 24 2d 00 00 75 10 b8 01 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 fe dd 01 00 48 89 04 24 [ 3510.401080] RSP: 002b:00007ffc05f1fe18 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 3510.401083] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f3a9bb842c0 [ 3510.401085] RDX: 0000000000000002 RSI: 0000000002327408 RDI: 0000000000000001 [ 3510.401086] RBP: 0000000002327408 R08: 00007f3a9be53780 R09: 00007f3a9c8a4700 [ 3510.401086] R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000002 [ 3510.401087] R13: 0000000000000001 R14: 00007f3a9be52620 R15: 0000000000000001 [ 3510.401090] [ 3510.401093] Allocated by task 76795: [ 3510.401098] kasan_kmalloc+0xa6/0xd0 [ 3510.401099] __kmalloc+0xfb/0x200 [ 3510.401104] iavf_init_interrupt_scheme+0x26f/0x1310 [iavf] [ 3510.401108] iavf_watchdog_task+0x1d58/0x4050 [iavf] [ 3510.401114] process_one_work+0x56a/0x11f0 [ 3510.401115] worker_thread+0x8f/0xf40 [ 3510.401117] kthread+0x2a0/0x390 [ 3510.401119] ret_from_fork+0x1f/0x40 [ 3510.401122] 0xffffffffffffffff [ 3510.401123] In timeout handling, we should keep the original num_active_queues and reset num_req_queues to 0. Fixes: 4e5e6b5d9d13 ("iavf: Fix return of set the new channel count") Signed-off-by: Ding Hui Cc: Donglin Peng Cc: Huang Cun Reviewed-by: Leon Romanovsky Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 5f4fa1672d98fe99d2297b03add35346f1685d6b Author: Ding Hui Date: Tue May 9 19:11:47 2023 +0800 iavf: Fix use-after-free in free_netdev We do netif_napi_add() for all allocated q_vectors[], but potentially do netif_napi_del() for part of them, then kfree q_vectors and leave invalid pointers at dev->napi_list. Reproducer: [root@host ~]# cat repro.sh #!/bin/bash pf_dbsf="0000:41:00.0" vf0_dbsf="0000:41:02.0" g_pids=() function do_set_numvf() { echo 2 >/sys/bus/pci/devices/${pf_dbsf}/sriov_numvfs sleep $((RANDOM%3+1)) echo 0 >/sys/bus/pci/devices/${pf_dbsf}/sriov_numvfs sleep $((RANDOM%3+1)) } function do_set_channel() { local nic=$(ls -1 --indicator-style=none /sys/bus/pci/devices/${vf0_dbsf}/net/) [ -z "$nic" ] && { sleep $((RANDOM%3)) ; return 1; } ifconfig $nic 192.168.18.5 netmask 255.255.255.0 ifconfig $nic up ethtool -L $nic combined 1 ethtool -L $nic combined 4 sleep $((RANDOM%3)) } function on_exit() { local pid for pid in "${g_pids[@]}"; do kill -0 "$pid" &>/dev/null && kill "$pid" &>/dev/null done g_pids=() } trap "on_exit; exit" EXIT while :; do do_set_numvf ; done & g_pids+=($!) while :; do do_set_channel ; done & g_pids+=($!) wait Result: [ 4093.900222] ================================================================== [ 4093.900230] BUG: KASAN: use-after-free in free_netdev+0x308/0x390 [ 4093.900232] Read of size 8 at addr ffff88b4dc145640 by task repro.sh/6699 [ 4093.900233] [ 4093.900236] CPU: 10 PID: 6699 Comm: repro.sh Kdump: loaded Tainted: G O --------- -t - 4.18.0 #1 [ 4093.900238] Hardware name: Powerleader PR2008AL/H12DSi-N6, BIOS 2.0 04/09/2021 [ 4093.900239] Call Trace: [ 4093.900244] dump_stack+0x71/0xab [ 4093.900249] print_address_description+0x6b/0x290 [ 4093.900251] ? free_netdev+0x308/0x390 [ 4093.900252] kasan_report+0x14a/0x2b0 [ 4093.900254] free_netdev+0x308/0x390 [ 4093.900261] iavf_remove+0x825/0xd20 [iavf] [ 4093.900265] pci_device_remove+0xa8/0x1f0 [ 4093.900268] device_release_driver_internal+0x1c6/0x460 [ 4093.900271] pci_stop_bus_device+0x101/0x150 [ 4093.900273] pci_stop_and_remove_bus_device+0xe/0x20 [ 4093.900275] pci_iov_remove_virtfn+0x187/0x420 [ 4093.900277] ? pci_iov_add_virtfn+0xe10/0xe10 [ 4093.900278] ? pci_get_subsys+0x90/0x90 [ 4093.900280] sriov_disable+0xed/0x3e0 [ 4093.900282] ? bus_find_device+0x12d/0x1a0 [ 4093.900290] i40e_free_vfs+0x754/0x1210 [i40e] [ 4093.900298] ? i40e_reset_all_vfs+0x880/0x880 [i40e] [ 4093.900299] ? pci_get_device+0x7c/0x90 [ 4093.900300] ? pci_get_subsys+0x90/0x90 [ 4093.900306] ? pci_vfs_assigned.part.7+0x144/0x210 [ 4093.900309] ? __mutex_lock_slowpath+0x10/0x10 [ 4093.900315] i40e_pci_sriov_configure+0x1fa/0x2e0 [i40e] [ 4093.900318] sriov_numvfs_store+0x214/0x290 [ 4093.900320] ? sriov_totalvfs_show+0x30/0x30 [ 4093.900321] ? __mutex_lock_slowpath+0x10/0x10 [ 4093.900323] ? __check_object_size+0x15a/0x350 [ 4093.900326] kernfs_fop_write+0x280/0x3f0 [ 4093.900329] vfs_write+0x145/0x440 [ 4093.900330] ksys_write+0xab/0x160 [ 4093.900332] ? __ia32_sys_read+0xb0/0xb0 [ 4093.900334] ? fput_many+0x1a/0x120 [ 4093.900335] ? filp_close+0xf0/0x130 [ 4093.900338] do_syscall_64+0xa0/0x370 [ 4093.900339] ? page_fault+0x8/0x30 [ 4093.900341] entry_SYSCALL_64_after_hwframe+0x65/0xca [ 4093.900357] RIP: 0033:0x7f16ad4d22c0 [ 4093.900359] Code: 73 01 c3 48 8b 0d d8 cb 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 89 24 2d 00 00 75 10 b8 01 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 fe dd 01 00 48 89 04 24 [ 4093.900360] RSP: 002b:00007ffd6491b7f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 4093.900362] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f16ad4d22c0 [ 4093.900363] RDX: 0000000000000002 RSI: 0000000001a41408 RDI: 0000000000000001 [ 4093.900364] RBP: 0000000001a41408 R08: 00007f16ad7a1780 R09: 00007f16ae1f2700 [ 4093.900364] R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000002 [ 4093.900365] R13: 0000000000000001 R14: 00007f16ad7a0620 R15: 0000000000000001 [ 4093.900367] [ 4093.900368] Allocated by task 820: [ 4093.900371] kasan_kmalloc+0xa6/0xd0 [ 4093.900373] __kmalloc+0xfb/0x200 [ 4093.900376] iavf_init_interrupt_scheme+0x63b/0x1320 [iavf] [ 4093.900380] iavf_watchdog_task+0x3d51/0x52c0 [iavf] [ 4093.900382] process_one_work+0x56a/0x11f0 [ 4093.900383] worker_thread+0x8f/0xf40 [ 4093.900384] kthread+0x2a0/0x390 [ 4093.900385] ret_from_fork+0x1f/0x40 [ 4093.900387] 0xffffffffffffffff [ 4093.900387] [ 4093.900388] Freed by task 6699: [ 4093.900390] __kasan_slab_free+0x137/0x190 [ 4093.900391] kfree+0x8b/0x1b0 [ 4093.900394] iavf_free_q_vectors+0x11d/0x1a0 [iavf] [ 4093.900397] iavf_remove+0x35a/0xd20 [iavf] [ 4093.900399] pci_device_remove+0xa8/0x1f0 [ 4093.900400] device_release_driver_internal+0x1c6/0x460 [ 4093.900401] pci_stop_bus_device+0x101/0x150 [ 4093.900402] pci_stop_and_remove_bus_device+0xe/0x20 [ 4093.900403] pci_iov_remove_virtfn+0x187/0x420 [ 4093.900404] sriov_disable+0xed/0x3e0 [ 4093.900409] i40e_free_vfs+0x754/0x1210 [i40e] [ 4093.900415] i40e_pci_sriov_configure+0x1fa/0x2e0 [i40e] [ 4093.900416] sriov_numvfs_store+0x214/0x290 [ 4093.900417] kernfs_fop_write+0x280/0x3f0 [ 4093.900418] vfs_write+0x145/0x440 [ 4093.900419] ksys_write+0xab/0x160 [ 4093.900420] do_syscall_64+0xa0/0x370 [ 4093.900421] entry_SYSCALL_64_after_hwframe+0x65/0xca [ 4093.900422] 0xffffffffffffffff [ 4093.900422] [ 4093.900424] The buggy address belongs to the object at ffff88b4dc144200 which belongs to the cache kmalloc-8k of size 8192 [ 4093.900425] The buggy address is located 5184 bytes inside of 8192-byte region [ffff88b4dc144200, ffff88b4dc146200) [ 4093.900425] The buggy address belongs to the page: [ 4093.900427] page:ffffea00d3705000 refcount:1 mapcount:0 mapping:ffff88bf04415c80 index:0x0 compound_mapcount: 0 [ 4093.900430] flags: 0x10000000008100(slab|head) [ 4093.900433] raw: 0010000000008100 dead000000000100 dead000000000200 ffff88bf04415c80 [ 4093.900434] raw: 0000000000000000 0000000000030003 00000001ffffffff 0000000000000000 [ 4093.900434] page dumped because: kasan: bad access detected [ 4093.900435] [ 4093.900435] Memory state around the buggy address: [ 4093.900436] ffff88b4dc145500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 4093.900437] ffff88b4dc145580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 4093.900438] >ffff88b4dc145600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 4093.900438] ^ [ 4093.900439] ffff88b4dc145680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 4093.900440] ffff88b4dc145700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 4093.900440] ================================================================== Although the patch #2 (of 2) can avoid the issue triggered by this repro.sh, there still are other potential risks that if num_active_queues is changed to less than allocated q_vectors[] by unexpected, the mismatched netif_napi_add/del() can also cause UAF. Since we actually call netif_napi_add() for all allocated q_vectors unconditionally in iavf_alloc_q_vectors(), so we should fix it by letting netif_napi_del() match to netif_napi_add(). Fixes: 5eae00c57f5e ("i40evf: main driver core") Signed-off-by: Ding Hui Cc: Donglin Peng Cc: Huang Cun Reviewed-by: Simon Horman Reviewed-by: Madhu Chittim Reviewed-by: Leon Romanovsky Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit efa96cc99793bafe96bdbff6abab94d81472a32d Author: Christoph Hellwig Date: Mon Jul 17 08:49:57 2023 -0700 iomap: micro optimize the ki_pos assignment in iomap_file_buffered_write We have the new value for ki_pos right at hand in iter.pos, so assign that instead of recalculating it from ret. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Ritesh Harjani (IBM) commit 20c64ec83a9f779a750bbbcc1d07d065702313a5 Author: Christoph Hellwig Date: Mon Jul 17 08:49:57 2023 -0700 iomap: fix a regression for partial write errors When write* wrote some data it should return the amount of written data and not the error code that caused it to stop. Fix a recent regression in iomap_file_buffered_write that caused it to return the errno instead. Fixes: 219580eea1ee ("iomap: update ki_pos in iomap_file_buffered_write") Reported-by: kernel test robot Reported-by: Cyril Hrubis Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Ritesh Harjani (IBM) commit f6250e205691a58c81be041b1809a2e706852641 Author: Darrick J. Wong Date: Mon Jul 10 09:32:11 2023 -0700 xfs: convert flex-array declarations in xfs attr shortform objects As of 6.5-rc1, UBSAN trips over the ondisk extended attribute shortform definitions using an array length of 1 to pretend to be a flex array. Kernel compilers have to support unbounded array declarations, so let's correct this. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Kees Cook commit a49bbce58ea90b14d4cb1d00681023a8606955f2 Author: Darrick J. Wong Date: Mon Jul 10 09:12:20 2023 -0700 xfs: convert flex-array declarations in xfs attr leaf blocks As of 6.5-rc1, UBSAN trips over the ondisk extended attribute leaf block definitions using an array length of 1 to pretend to be a flex array. Kernel compilers have to support unbounded array declarations, so let's correct this. ================================================================================ UBSAN: array-index-out-of-bounds in fs/xfs/libxfs/xfs_attr_leaf.c:2535:24 index 2 is out of range for type '__u8 [1]' Call Trace: dump_stack_lvl+0x33/0x50 __ubsan_handle_out_of_bounds+0x9c/0xd0 xfs_attr3_leaf_getvalue+0x2ce/0x2e0 [xfs 4a986a89a77bb77402ab8a87a37da369ef6a3f09] xfs_attr_leaf_get+0x148/0x1c0 [xfs 4a986a89a77bb77402ab8a87a37da369ef6a3f09] xfs_attr_get_ilocked+0xae/0x110 [xfs 4a986a89a77bb77402ab8a87a37da369ef6a3f09] xfs_attr_get+0xee/0x150 [xfs 4a986a89a77bb77402ab8a87a37da369ef6a3f09] xfs_xattr_get+0x7d/0xc0 [xfs 4a986a89a77bb77402ab8a87a37da369ef6a3f09] __vfs_getxattr+0xa3/0x100 vfs_getxattr+0x87/0x1d0 do_getxattr+0x17a/0x220 getxattr+0x89/0xf0 Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Kees Cook commit 371baf5c9750a258fee21d0cb8c8d683bb057429 Author: Darrick J. Wong Date: Mon Jul 10 09:02:33 2023 -0700 xfs: convert flex-array declarations in struct xfs_attrlist* As of 6.5-rc1, UBSAN trips over the attrlist ioctl definitions using an array length of 1 to pretend to be a flex array. Kernel compilers have to support unbounded array declarations, so let's correct this. This may cause friction with userspace header declarations, but suck is life. ================================================================================ UBSAN: array-index-out-of-bounds in fs/xfs/xfs_ioctl.c:345:18 index 1 is out of range for type '__s32 [1]' Call Trace: dump_stack_lvl+0x33/0x50 __ubsan_handle_out_of_bounds+0x9c/0xd0 xfs_ioc_attr_put_listent+0x413/0x420 [xfs 4a986a89a77bb77402ab8a87a37da369ef6a3f09] xfs_attr_list_ilocked+0x170/0x850 [xfs 4a986a89a77bb77402ab8a87a37da369ef6a3f09] xfs_attr_list+0xb7/0x120 [xfs 4a986a89a77bb77402ab8a87a37da369ef6a3f09] xfs_ioc_attr_list+0x13b/0x2e0 [xfs 4a986a89a77bb77402ab8a87a37da369ef6a3f09] xfs_attrlist_by_handle+0xab/0x120 [xfs 4a986a89a77bb77402ab8a87a37da369ef6a3f09] xfs_file_ioctl+0x1ff/0x15e0 [xfs 4a986a89a77bb77402ab8a87a37da369ef6a3f09] vfs_ioctl+0x1f/0x60 The kernel and xfsprogs code that uses these structures will not have problems, but the long tail of external user programs might. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Kees Cook commit dc050849d93f4c5d8a88dc6789668212b7785967 Merge: 55c3b96074f3f 5886e4d5ecec3 Author: Marc Kleine-Budde Date: Mon Jul 17 16:41:23 2023 +0200 Merge patch series "can: gs_usb: fix time stamp counter initialization" Marc Kleine-Budde says: During testing I noticed a crash if unloading/loading the gs_usb driver during high CAN bus load. The current version of the candlelight firmware doesn't flush the queues of the received CAN frames during the reset command. This leads to a crash if hardware timestamps are enabled, and an URB from the device is received before the cycle counter/time counter infrastructure has been setup. First clean up then error handling in gs_can_open(). Then, fix the problem by converting the cycle counter/time counter infrastructure from a per-channel to per-device and set it up before submitting RX-URBs to the USB stack. Link: https://lore.kernel.org/all/20230716-gs_usb-fix-time-stamp-counter-v1-0-9017cefcd9d5@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 522b1d69219d8f083173819fde04f994aa051a98 Author: Borislav Petkov (AMD) Date: Sat Jul 15 13:41:28 2023 +0200 x86/cpu/amd: Add a Zenbleed fix Add a fix for the Zen2 VZEROUPPER data corruption bug where under certain circumstances executing VZEROUPPER can cause register corruption or leak data. The optimal fix is through microcode but in the case the proper microcode revision has not been applied, enable a fallback fix using a chicken bit. Signed-off-by: Borislav Petkov (AMD) commit 8b6f687743dacce83dbb0c7cfacf88bab00f808a Author: Borislav Petkov (AMD) Date: Sat Jul 15 13:31:32 2023 +0200 x86/cpu/amd: Move the errata checking functionality up Avoid new and remove old forward declarations. No functional changes. Signed-off-by: Borislav Petkov (AMD) commit 2480232c61b888a160153b9022858ac8c4362d5f Author: Arnaldo Carvalho de Melo Date: Fri Jul 14 15:29:31 2023 -0300 perf test task_exit: No need for a cycles event to check if we get an PERF_RECORD_EXIT The intent of this test is to check we get a PERF_RECORD_EXIT as asked for by setting perf_event_attr.task=1. When the test was written we didn't had the "dummy" event so we went with the default event, "cycles". There were reports of this test failing sometimes, one of these reports was with a PREEMPT_RT_FULL, but I noticed it failing sometimes with an aarch64 Firefly board. In the kernel the call to perf_event_task_output(), that generates the PERF_RECORD_EXIT may fail when there is not enough memory in the ring buffer, if the ring buffer is paused, etc. So switch to using the "dummy" event to use the ring buffer just for what the test was designed for, avoiding uneeded PERF_RECORD_SAMPLEs. Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Jiri Olsa Cc: Juri Lelli Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ZLGXmMuNRpx1ubFm@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ccb381e1af1ace292153c88eb1fffa5683d16a20 Author: Benjamin Gray Date: Mon Jul 10 14:41:43 2023 +1000 powerpc/kasan: Disable KCOV in KASAN code As per the generic KASAN code in mm/kasan, disable KCOV with KCOV_INSTRUMENT := n in the makefile. This fixes a ppc64 boot hang when KCOV and KASAN are enabled. kasan_early_init() gets called before a PACA is initialised, but the KCOV hook expects a valid PACA. Suggested-by: Christophe Leroy Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20230710044143.146840-1-bgray@linux.ibm.com commit 2c27770a7bc88ef7f6614d11d96d8e62017d0b78 Author: Jani Nikula Date: Tue Jul 11 14:02:14 2023 +0300 Revert "drm/i915: use localized __diag_ignore_all() instead of per file" This reverts commit 88e9664434c994e97a9f6f8cdd1535495c660cea. __diag_ignore_all() only works for GCC 8 or later. -Woverride-init (from -Wextra, enabled in i915 Makefile) combined with CONFIG_WERROR=y or W=e breaks the build for older GCC. With i386_defconfig and x86_64_defconfig enabling CONFIG_WERROR=y by default, we really need to roll back the change. An alternative would be to disable -Woverride-init in the Makefile for GCC <8, but the revert seems like the safest bet now. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8768 Reported-by: John Garry References: https://lore.kernel.org/r/ad2601c0-84bb-c574-3702-a83ff8faf98c@oracle.com References: https://lore.kernel.org/r/87wmzezns4.fsf@intel.com Fixes: 88e9664434c9 ("drm/i915: use localized __diag_ignore_all() instead of per file") Cc: Gustavo Sousa Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Signed-off-by: Jani Nikula Reviewed-by: Gustavo Sousa Tested-by: John Garry Link: https://patchwork.freedesktop.org/patch/msgid/20230711110214.25093-1-jani.nikula@intel.com (cherry picked from commit 290d161045753240f2100b8f44660426ecc97be5) Signed-off-by: Tvrtko Ursulin commit 785b3f667b4bf98804cad135005e964df0c750de Author: Andrzej Hajda Date: Tue Jul 11 17:34:10 2023 +0200 drm/i915/perf: add sentinel to xehp_oa_b_counters Arrays passed to reg_in_range_table should end with empty record. The patch solves KASAN detected bug with signature: BUG: KASAN: global-out-of-bounds in xehp_is_valid_b_counter_addr+0x2c7/0x350 [i915] Read of size 4 at addr ffffffffa1555d90 by task perf/1518 CPU: 4 PID: 1518 Comm: perf Tainted: G U 6.4.0-kasan_438-g3303d06107f3+ #1 Hardware name: Intel Corporation Meteor Lake Client Platform/MTL-P DDR5 SODIMM SBS RVP, BIOS MTLPFWI1.R00.3223.D80.2305311348 05/31/2023 Call Trace: ... xehp_is_valid_b_counter_addr+0x2c7/0x350 [i915] Fixes: 0fa9349dda03 ("drm/i915/perf: complete programming whitelisting for XEHPSDV") Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230711153410.1224997-1-andrzej.hajda@intel.com (cherry picked from commit 2f42c5afb34b5696cf5fe79e744f99be9b218798) Signed-off-by: Tvrtko Ursulin commit f7853c34241807bb97673a5e97719123be39a09e Author: Peter Zijlstra Date: Fri Jul 7 16:19:09 2023 +0200 locking/rtmutex: Fix task->pi_waiters integrity Henry reported that rt_mutex_adjust_prio_check() has an ordering problem and puts the lie to the comment in [7]. Sharing the sort key between lock->waiters and owner->pi_waiters *does* create problems, since unlike what the comment claims, holding [L] is insufficient. Notably, consider: A / \ M1 M2 | | B C That is, task A owns both M1 and M2, B and C block on them. In this case a concurrent chain walk (B & C) will modify their resp. sort keys in [7] while holding M1->wait_lock and M2->wait_lock. So holding [L] is meaningless, they're different Ls. This then gives rise to a race condition between [7] and [11], where the requeue of pi_waiters will observe an inconsistent tree order. B C (holds M1->wait_lock, (holds M2->wait_lock, holds B->pi_lock) holds A->pi_lock) [7] waiter_update_prio(); ... [8] raw_spin_unlock(B->pi_lock); ... [10] raw_spin_lock(A->pi_lock); [11] rt_mutex_enqueue_pi(); // observes inconsistent A->pi_waiters // tree order Fixing this means either extending the range of the owner lock from [10-13] to [6-13], with the immediate problem that this means [6-8] hold both blocked and owner locks, or duplicating the sort key. Since the locking in chain walk is horrible enough without having to consider pi_lock nesting rules, duplicate the sort key instead. By giving each tree their own sort key, the above race becomes harmless, if C sees B at the old location, then B will correct things (if they need correcting) when it walks up the chain and reaches A. Fixes: fb00aca47440 ("rtmutex: Turn the plist into an rb-tree") Reported-by: Henry Wu Signed-off-by: Peter Zijlstra (Intel) Acked-by: Thomas Gleixner Tested-by: Henry Wu Link: https://lkml.kernel.org/r/20230707161052.GF2883469%40hirez.programming.kicks-ass.net commit 5886e4d5ecec3e22844efed90b2dd383ef804b3a Author: Marc Kleine-Budde Date: Fri Jul 7 18:44:23 2023 +0200 can: gs_usb: fix time stamp counter initialization If the gs_usb device driver is unloaded (or unbound) before the interface is shut down, the USB stack first calls the struct usb_driver::disconnect and then the struct net_device_ops::ndo_stop callback. In gs_usb_disconnect() all pending bulk URBs are killed, i.e. no more RX'ed CAN frames are send from the USB device to the host. Later in gs_can_close() a reset control message is send to each CAN channel to remove the controller from the CAN bus. In this race window the USB device can still receive CAN frames from the bus and internally queue them to be send to the host. At least in the current version of the candlelight firmware, the queue of received CAN frames is not emptied during the reset command. After loading (or binding) the gs_usb driver, new URBs are submitted during the struct net_device_ops::ndo_open callback and the candlelight firmware starts sending its already queued CAN frames to the host. However, this scenario was not considered when implementing the hardware timestamp function. The cycle counter/time counter infrastructure is set up (gs_usb_timestamp_init()) after the USBs are submitted, resulting in a NULL pointer dereference if timecounter_cyc2time() (via the call chain: gs_usb_receive_bulk_callback() -> gs_usb_set_timestamp() -> gs_usb_skb_set_timestamp()) is called too early. Move the gs_usb_timestamp_init() function before the URBs are submitted to fix this problem. For a comprehensive solution, we need to consider gs_usb devices with more than 1 channel. The cycle counter/time counter infrastructure is setup per channel, but the RX URBs are per device. Once gs_can_open() of _a_ channel has been called, and URBs have been submitted, the gs_usb_receive_bulk_callback() can be called for _all_ available channels, even for channels that are not running, yet. As cycle counter/time counter has not set up, this will again lead to a NULL pointer dereference. Convert the cycle counter/time counter from a "per channel" to a "per device" functionality. Also set it up, before submitting any URBs to the device. Further in gs_usb_receive_bulk_callback(), don't process any URBs for not started CAN channels, only resubmit the URB. Fixes: 45dfa45f52e6 ("can: gs_usb: add RX and TX hardware timestamp support") Closes: https://github.com/candle-usb/candleLight_fw/issues/137#issuecomment-1623532076 Cc: stable@vger.kernel.org Cc: John Whittington Link: https://lore.kernel.org/all/20230716-gs_usb-fix-time-stamp-counter-v1-2-9017cefcd9d5@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 2603be9e8167ddc7bea95dcfab9ffc33414215aa Author: Marc Kleine-Budde Date: Fri Jul 7 13:43:10 2023 +0200 can: gs_usb: gs_can_open(): improve error handling The gs_usb driver handles USB devices with more than 1 CAN channel. The RX path for all channels share the same bulk endpoint (the transmitted bulk data encodes the channel number). These per-device resources are allocated and submitted by the first opened channel. During this allocation, the resources are either released immediately in case of a failure or the URBs are anchored. All anchored URBs are finally killed with gs_usb_disconnect(). Currently, gs_can_open() returns with an error if the allocation of a URB or a buffer fails. However, if usb_submit_urb() fails, the driver continues with the URBs submitted so far, even if no URBs were successfully submitted. Treat every error as fatal and free all allocated resources immediately. Switch to goto-style error handling, to prepare the driver for more per-device resource allocation. Cc: stable@vger.kernel.org Cc: John Whittington Link: https://lore.kernel.org/all/20230716-gs_usb-fix-time-stamp-counter-v1-1-9017cefcd9d5@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 55c3b96074f3f9b0aee19bf93cd71af7516582bb Author: YueHaibing Date: Sat Jul 15 17:25:43 2023 +0800 can: bcm: Fix UAF in bcm_proc_show() BUG: KASAN: slab-use-after-free in bcm_proc_show+0x969/0xa80 Read of size 8 at addr ffff888155846230 by task cat/7862 CPU: 1 PID: 7862 Comm: cat Not tainted 6.5.0-rc1-00153-gc8746099c197 #230 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Call Trace: dump_stack_lvl+0xd5/0x150 print_report+0xc1/0x5e0 kasan_report+0xba/0xf0 bcm_proc_show+0x969/0xa80 seq_read_iter+0x4f6/0x1260 seq_read+0x165/0x210 proc_reg_read+0x227/0x300 vfs_read+0x1d5/0x8d0 ksys_read+0x11e/0x240 do_syscall_64+0x35/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd Allocated by task 7846: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 __kasan_kmalloc+0x9e/0xa0 bcm_sendmsg+0x264b/0x44e0 sock_sendmsg+0xda/0x180 ____sys_sendmsg+0x735/0x920 ___sys_sendmsg+0x11d/0x1b0 __sys_sendmsg+0xfa/0x1d0 do_syscall_64+0x35/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 7846: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_save_free_info+0x27/0x40 ____kasan_slab_free+0x161/0x1c0 slab_free_freelist_hook+0x119/0x220 __kmem_cache_free+0xb4/0x2e0 rcu_core+0x809/0x1bd0 bcm_op is freed before procfs entry be removed in bcm_release(), this lead to bcm_proc_show() may read the freed bcm_op. Fixes: ffd980f976e7 ("[CAN]: Add broadcast manager (bcm) protocol") Signed-off-by: YueHaibing Reviewed-by: Oliver Hartkopp Acked-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20230715092543.15548-1-yuehaibing@huawei.com Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde commit ee8b94c8510ce64afe0b87ef548d23e00915fb10 Author: Ziyang Xuan Date: Tue Jul 11 09:17:37 2023 +0800 can: raw: fix receiver memory leak Got kmemleak errors with the following ltp can_filter testcase: for ((i=1; i<=100; i++)) do ./can_filter & sleep 0.1 done ============================================================== [<00000000db4a4943>] can_rx_register+0x147/0x360 [can] [<00000000a289549d>] raw_setsockopt+0x5ef/0x853 [can_raw] [<000000006d3d9ebd>] __sys_setsockopt+0x173/0x2c0 [<00000000407dbfec>] __x64_sys_setsockopt+0x61/0x70 [<00000000fd468496>] do_syscall_64+0x33/0x40 [<00000000b7e47d51>] entry_SYSCALL_64_after_hwframe+0x61/0xc6 It's a bug in the concurrent scenario of unregister_netdevice_many() and raw_release() as following: cpu0 cpu1 unregister_netdevice_many(can_dev) unlist_netdevice(can_dev) // dev_get_by_index() return NULL after this net_set_todo(can_dev) raw_release(can_socket) dev = dev_get_by_index(, ro->ifindex); // dev == NULL if (dev) { // receivers in dev_rcv_lists not free because dev is NULL raw_disable_allfilters(, dev, ); dev_put(dev); } ... ro->bound = 0; ... call_netdevice_notifiers(NETDEV_UNREGISTER, ) raw_notify(, NETDEV_UNREGISTER, ) if (ro->bound) // invalid because ro->bound has been set 0 raw_disable_allfilters(, dev, ); // receivers in dev_rcv_lists will never be freed Add a net_device pointer member in struct raw_sock to record bound can_dev, and use rtnl_lock to serialize raw_socket members between raw_bind(), raw_release(), raw_setsockopt() and raw_notify(). Use ro->dev to decide whether to free receivers in dev_rcv_lists. Fixes: 8d0caedb7596 ("can: bcm/raw/isotp: use per module netdevice notifier") Reviewed-by: Oliver Hartkopp Acked-by: Oliver Hartkopp Signed-off-by: Ziyang Xuan Link: https://lore.kernel.org/all/20230711011737.1969582-1-william.xuanziyang@huawei.com Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde commit 162d626f3013215b82b6514ca14f20932c7ccce5 Author: Heiner Kallweit Date: Fri Jul 14 07:39:36 2023 +0200 r8169: fix ASPM-related problem for chip version 42 and 43 Referenced commit missed that for chip versions 42 and 43 ASPM remained disabled in the respective rtl_hw_start_...() routines. This resulted in problems as described in the referenced bug ticket. Therefore re-instantiate the previous logic. Fixes: 5fc3f6c90cca ("r8169: consolidate disabling ASPM before EPHY access") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217635 Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 4bdf79d686b49ac49373b36466acfb93972c7d7c Author: Tristram Ha Date: Thu Jul 13 17:46:22 2023 -0700 net: dsa: microchip: correct KSZ8795 static MAC table access The KSZ8795 driver code was modified to use on KSZ8863/73, which has different register definitions. Some of the new KSZ8795 register information are wrong compared to previous code. KSZ8795 also behaves differently in that the STATIC_MAC_TABLE_USE_FID and STATIC_MAC_TABLE_FID bits are off by 1 when doing MAC table reading than writing. To compensate that a special code was added to shift the register value by 1 before applying those bits. This is wrong when the code is running on KSZ8863, so this special code is only executed when KSZ8795 is detected. Fixes: 4b20a07e103f ("net: dsa: microchip: ksz8795: add support for ksz88xx chips") Signed-off-by: Tristram Ha Reviewed-by: Horatiu Vultur Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 6e8778f8e0f58cac4955b17130549b156cf9d25f Merge: 0dd1805fe498e ac177a330077f Author: David S. Miller Date: Mon Jul 17 07:33:39 2023 +0100 Merge branch 'sched-fixes' Victor Nogueira says: ==================== net: sched: Fixes for classifiers Four different classifiers (bpf, u32, matchall, and flower) are calling tcf_bind_filter in their callbacks, but arent't undoing it by calling tcf_unbind_filter if their was an error after binding. This patch set fixes all this by calling tcf_unbind_filter in such cases. This set also undoes a refcount decrement in cls_u32 when an update fails under specific conditions which are described in patch #3. v1 -> v2: * Remove blank line after fixes tag * Fix reverse xmas tree issues pointed out by Simon v2 -> v3: * Inline functions cls_bpf_set_parms and fl_set_parms to avoid adding yet another parameter (and a return value at it) to them. * Remove similar fixes for u32 and matchall, which will be sent soon, once we find a way to do the fixes without adding a return parameter to their set_parms functions. v3 -> v4: * Inline mall_set_parms to avoid adding yet another parameter. * Remove set_flags parameter from u32_set_parms and create a separate function for calling tcf_bind_filter and tcf_unbind_filter in case of failure. * Change cover letter title to also encompass refcnt fix for u32 v4 -> v5: * Change back tag to net ==================== Signed-off-by: David S. Miller commit ac177a330077f264664f56259038e121bb214bec Author: Victor Nogueira Date: Thu Jul 13 15:05:14 2023 -0300 net: sched: cls_flower: Undo tcf_bind_filter in case of an error If TCA_FLOWER_CLASSID is specified in the netlink message, the code will call tcf_bind_filter. However, if any error occurs after that, the code should undo this by calling tcf_unbind_filter. Fixes: 77b9900ef53a ("tc: introduce Flower classifier") Signed-off-by: Victor Nogueira Acked-by: Jamal Hadi Salim Reviewed-by: Pedro Tammela Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 26a22194927e8521e304ed75c2f38d8068d55fc7 Author: Victor Nogueira Date: Thu Jul 13 15:05:13 2023 -0300 net: sched: cls_bpf: Undo tcf_bind_filter in case of an error If cls_bpf_offload errors out, we must also undo tcf_bind_filter that was done before the error. Fix that by calling tcf_unbind_filter in errout_parms. Fixes: eadb41489fd2 ("net: cls_bpf: add support for marking filters as hardware-only") Signed-off-by: Victor Nogueira Acked-by: Jamal Hadi Salim Reviewed-by: Pedro Tammela Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit e8d3d78c19be0264a5692bed477c303523aead31 Author: Victor Nogueira Date: Thu Jul 13 15:05:12 2023 -0300 net: sched: cls_u32: Undo refcount decrement in case update failed In the case of an update, when TCA_U32_LINK is set, u32_set_parms will decrement the refcount of the ht_down (struct tc_u_hnode) pointer present in the older u32 filter which we are replacing. However, if u32_replace_hw_knode errors out, the update command fails and that ht_down pointer continues decremented. To fix that, when u32_replace_hw_knode fails, check if ht_down's refcount was decremented and undo the decrement. Fixes: d34e3e181395 ("net: cls_u32: Add support for skip-sw flag to tc u32 classifier.") Signed-off-by: Victor Nogueira Acked-by: Jamal Hadi Salim Reviewed-by: Pedro Tammela Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 9cb36faedeafb9720ac236aeae2ea57091d90a09 Author: Victor Nogueira Date: Thu Jul 13 15:05:11 2023 -0300 net: sched: cls_u32: Undo tcf_bind_filter if u32_replace_hw_knode When u32_replace_hw_knode fails, we need to undo the tcf_bind_filter operation done at u32_set_parms. Fixes: d34e3e181395 ("net: cls_u32: Add support for skip-sw flag to tc u32 classifier.") Signed-off-by: Victor Nogueira Acked-by: Jamal Hadi Salim Reviewed-by: Pedro Tammela Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit b3d0e0489430735e2e7626aa37e6462cdd136e9d Author: Victor Nogueira Date: Thu Jul 13 15:05:10 2023 -0300 net: sched: cls_matchall: Undo tcf_bind_filter in case of failure after mall_set_parms In case an error occurred after mall_set_parms executed successfully, we must undo the tcf_bind_filter call it issues. Fix that by calling tcf_unbind_filter in err_replace_hw_filter label. Fixes: ec2507d2a306 ("net/sched: cls_matchall: Fix error path") Signed-off-by: Victor Nogueira Acked-by: Jamal Hadi Salim Reviewed-by: Pedro Tammela Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 057849ccc3d898b8a2dc21933b50ed8fbddc963b Author: Takashi Iwai Date: Mon Jul 17 08:25:55 2023 +0200 ALSA: seq: Fix memory leak at error path in snd_seq_create_port() We forgot to release a newly allocated item at the error path in snd_seq_create_port(). This patch fixes it. Fixes: 7c3f0d3d3a11 ("ALSA: seq: Check the conflicting port at port creation") Reported-by: syzbot+cf8e7fa4eeec59b3d485@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/00000000000098ed3a0600965f89@google.com Link: https://lore.kernel.org/r/20230717062555.31592-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit b2cb84d7802b75bc4029519bce2c4e0c9319ac42 Merge: 69ea4c9d02b79 e8bf1741c14eb Author: Takashi Iwai Date: Mon Jul 17 08:21:09 2023 +0200 Merge tag 'asoc-fix-v6.5-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.5 A lot of fixes here for the Qualcomm CODEC drivers, there was quite a bit of fragility with the SoundWire probe due to the combined DT and hotplug approach that the bus has which Johan Hovold fixed along with a bunch of other issues that came up in the process. Srivinvas Kandagatla also fixed some separate issues that have been lurking for a while in the Qualcomm AP side, and there's a good set of AMD fixes from Vijendar Mukunda too. commit 3c1897ae4b6bc7cc586eda2feaa2cd68325ec29c Author: Greg Kroah-Hartman Date: Fri Jun 30 09:14:21 2023 +0200 Documentation: security-bugs.rst: clarify CVE handling The kernel security team does NOT assign CVEs, so document that properly and provide the "if you want one, ask MITRE for it" response that we give on a weekly basis in the document, so we don't have to constantly say it to everyone who asks. Link: https://lore.kernel.org/r/2023063022-retouch-kerosene-7e4a@gregkh Signed-off-by: Greg Kroah-Hartman commit 4fee0915e649bd0cea56dece6d96f8f4643df33c Author: Greg Kroah-Hartman Date: Fri Jun 30 09:14:20 2023 +0200 Documentation: security-bugs.rst: update preferences when dealing with the linux-distros group Because the linux-distros group forces reporters to release information about reported bugs, and they impose arbitrary deadlines in having those bugs fixed despite not actually being kernel developers, the kernel security team recommends not interacting with them at all as this just causes confusion and the early-release of reported security problems. Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/2023063020-throat-pantyhose-f110@gregkh Signed-off-by: Greg Kroah-Hartman commit 98e2dd5f7a8be5cb2501a897e96910393a49f0ff Author: Martin Fuzzey Date: Fri Jun 16 16:36:28 2023 +0200 regulator: da9063: fix null pointer deref with partial DT config When some of the da9063 regulators do not have corresponding DT nodes a null pointer dereference occurs on boot because such regulators have no init_data causing the pointers calculated in da9063_check_xvp_constraints() to be invalid. Do not dereference them in this case. Fixes: b8717a80e6ee ("regulator: da9063: implement setter for voltage monitoring") Signed-off-by: Martin Fuzzey Link: https://lore.kernel.org/r/20230616143736.2946173-1-martin.fuzzey@flowbird.group Signed-off-by: Mark Brown commit 0c9d2eb5e94792fe64019008a04d4df5e57625af Author: Mark Brown Date: Wed Jul 12 12:16:40 2023 +0100 regmap: Account for register length in SMBus I/O limits The SMBus I2C buses have limits on the size of transfers they can do but do not factor in the register length meaning we may try to do a transfer longer than our length limit, the core will not take care of this. Future changes will factor this out into the core but there are a number of users that assume current behaviour so let's just do something conservative here. This does not take account padding bits but practically speaking these are very rarely if ever used on I2C buses given that they generally run slowly enough to mean there's no issue. Cc: stable@kernel.org Signed-off-by: Mark Brown Reviewed-by: Xu Yilun Link: https://lore.kernel.org/r/20230712-regmap-max-transfer-v1-2-80e2aed22e83@kernel.org Signed-off-by: Mark Brown commit bc64734825c59e18a27ac266b07e14944c111fd8 Author: Mark Brown Date: Wed Jul 12 12:16:39 2023 +0100 regmap: Drop initial version of maximum transfer length fixes When problems were noticed with the register address not being taken into account when limiting raw transfers with I2C devices we fixed this in the core. Unfortunately it has subsequently been realised that a lot of buses were relying on the prior behaviour, partly due to unclear documentation not making it obvious what was intended in the core. This is all more involved to fix than is sensible for a fix commit so let's just drop the original fixes, a separate commit will fix the originally observed problem in an I2C specific way Fixes: 3981514180c9 ("regmap: Account for register length when chunking") Fixes: c8e796895e23 ("regmap: spi-avmm: Fix regmap_bus max_raw_write") Signed-off-by: Mark Brown Reviewed-by: Xu Yilun Cc: stable@kernel.org Link: https://lore.kernel.org/r/20230712-regmap-max-transfer-v1-1-80e2aed22e83@kernel.org Signed-off-by: Mark Brown commit 469e2f28c2cbee2430058c1c9bb6d1675d7195fb Author: Dan Carpenter Date: Fri Jul 7 14:25:23 2023 +0300 ASoC: SOF: ipc3-dtrace: uninitialized data in dfsentry_trace_filter_write() This doesn't check how many bytes the simple_write_to_buffer() writes to the buffer. The only thing that we know is that the first byte is initialized and the last byte of the buffer is set to NUL. However the middle bytes could be uninitialized. There is no need to use simple_write_to_buffer(). This code does not support partial writes but instead passes "pos = 0" as the starting offset regardless of what the user passed as "*ppos". Just use the copy_from_user() function and initialize the whole buffer. Fixes: 671e0b90051e ("ASoC: SOF: Clone the trace code to ipc3-dtrace as fw_tracing implementation") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/74148292-ce4d-4e01-a1a7-921e6767da14@moroto.mountain Signed-off-by: Mark Brown commit e51df4f81b02bcdd828a04de7c1eb6a92988b61e Author: Thomas Petazzoni Date: Thu Jul 13 13:21:12 2023 +0200 ASoC: cs42l51: fix driver to properly autoload with automatic module loading In commit 2cb1e0259f50 ("ASoC: cs42l51: re-hook of_match_table pointer"), 9 years ago, some random guy fixed the cs42l51 after it was split into a core part and an I2C part to properly match based on a Device Tree compatible string. However, the fix in this commit is wrong: the MODULE_DEVICE_TABLE(of, ....) is in the core part of the driver, not the I2C part. Therefore, automatic module loading based on module.alias, based on matching with the DT compatible string, loads the core part of the driver, but not the I2C part. And threfore, the i2c_driver is not registered, and the codec is not known to the system, nor matched with a DT node with the corresponding compatible string. In order to fix that, we move the MODULE_DEVICE_TABLE(of, ...) into the I2C part of the driver. The cs42l51_of_match[] array is also moved as well, as it is not possible to have this definition in one file, and the MODULE_DEVICE_TABLE(of, ...) invocation in another file, due to how MODULE_DEVICE_TABLE works. Thanks to this commit, the I2C part of the driver now properly autoloads, and thanks to its dependency on the core part, the core part gets autoloaded as well, resulting in a functional sound card without having to manually load kernel modules. Fixes: 2cb1e0259f50 ("ASoC: cs42l51: re-hook of_match_table pointer") Cc: stable@vger.kernel.org Signed-off-by: Thomas Petazzoni Link: https://lore.kernel.org/r/20230713112112.778576-1-thomas.petazzoni@bootlin.com Signed-off-by: Mark Brown commit 8739312ed2faa79df61d157ac44fda840646d444 Author: Uwe Kleine-König Date: Tue Jul 11 16:31:45 2023 +0200 powerpc/512x: lpbfifo: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Michael Ellerman Link: https://msgid.link/20230711143145.1192651-1-u.kleine-koenig@pengutronix.de commit 0791faebfe750292a8a842b64795a390ca4a3b51 Merge: e8bf1741c14eb fdf0eaf11452d Author: Mark Brown Date: Mon Jul 17 06:12:31 2023 +0100 ASoC: Merge v6.5-rc2 Get a similar baseline to my other branches, and fixes for people using the branch. commit 29900bf351e1a7e4643da5c3c3cd9df75c577b88 Author: Selvin Xavier Date: Fri Jul 14 01:22:49 2023 -0700 RDMA/bnxt_re: Fix hang during driver unload Driver unload hits a hang during stress testing of load/unload. stack trace snippet - tasklet_kill at ffffffff9aabb8b2 bnxt_qplib_nq_stop_irq at ffffffffc0a805fb [bnxt_re] bnxt_qplib_disable_nq at ffffffffc0a80c5b [bnxt_re] bnxt_re_dev_uninit at ffffffffc0a67d15 [bnxt_re] bnxt_re_remove_device at ffffffffc0a6af1d [bnxt_re] tasklet_kill can hang if the tasklet is scheduled after it is disabled. Modified the sequences to disable the interrupt first and synchronize irq before disabling the tasklet. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1689322969-25402-3-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit b5bbc6551297447d3cca55cf907079e206e9cd82 Author: Kashyap Desai Date: Fri Jul 14 01:22:48 2023 -0700 RDMA/bnxt_re: Prevent handling any completions after qp destroy HW may generate completions that indicates QP is destroyed. Driver should not be scheduling any more completion handlers for this QP, after the QP is destroyed. Since CQs are active during the QP destroy, driver may still schedule completion handlers. This can cause a race where the destroy_cq and poll_cq running simultaneously. Snippet of kernel panic while doing bnxt_re driver load unload in loop. This indicates a poll after the CQ is freed.  [77786.481636] Call Trace: [77786.481640]   [77786.481644]  bnxt_re_poll_cq+0x14a/0x620 [bnxt_re] [77786.481658]  ? kvm_clock_read+0x14/0x30 [77786.481693]  __ib_process_cq+0x57/0x190 [ib_core] [77786.481728]  ib_cq_poll_work+0x26/0x80 [ib_core] [77786.481761]  process_one_work+0x1e5/0x3f0 [77786.481768]  worker_thread+0x50/0x3a0 [77786.481785]  ? __pfx_worker_thread+0x10/0x10 [77786.481790]  kthread+0xe2/0x110 [77786.481794]  ? __pfx_kthread+0x10/0x10 [77786.481797]  ret_from_fork+0x2c/0x50 To avoid this, complete all completion handlers before returning the destroy QP. If free_cq is called soon after destroy_qp, IB stack will cancel the CQ work before invoking the destroy_cq verb and this will prevent any race mentioned. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1689322969-25402-2-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit dc52aadbc1849cbe3fcf6bc54d35f6baa396e0a1 Author: Thomas Bogendoerfer Date: Thu Jul 13 16:16:58 2023 +0200 RDMA/mthca: Fix crash when polling CQ for shared QPs Commit 21c2fe94abb2 ("RDMA/mthca: Combine special QP struct with mthca QP") introduced a new struct mthca_sqp which doesn't contain struct mthca_qp any longer. Placing a pointer of this new struct into qptable leads to crashes, because mthca_poll_one() expects a qp pointer. Fix this by putting the correct pointer into qptable. Fixes: 21c2fe94abb2 ("RDMA/mthca: Combine special QP struct with mthca QP") Signed-off-by: Thomas Bogendoerfer Link: https://lore.kernel.org/r/20230713141658.9426-1-tbogendoerfer@suse.de Signed-off-by: Leon Romanovsky commit 0e15863015d97c1ee2cc29d599abcc7fa2dc3e95 Author: Shiraz Saleem Date: Wed Jul 12 18:41:33 2023 -0500 RDMA/core: Update CMA destination address on rdma_resolve_addr 8d037973d48c ("RDMA/core: Refactor rdma_bind_addr") intoduces as regression on irdma devices on certain tests which uses rdma CM, such as cmtime. No connections can be established with the MAD QP experiences a fatal error on the active side. The cma destination address is not updated with the dst_addr when ULP on active side calls rdma_bind_addr followed by rdma_resolve_addr. The id_priv state is 'bound' in resolve_prepare_src and update is skipped. This leaves the dgid passed into irdma driver to create an Address Handle (AH) for the MAD QP at 0. The create AH descriptor as well as the ARP cache entry is invalid and HW throws an asynchronous events as result. [ 1207.656888] resolve_prepare_src caller: ucma_resolve_addr+0xff/0x170 [rdma_ucm] daddr=200.0.4.28 id_priv->state=7 [....] [ 1207.680362] ice 0000:07:00.1 rocep7s0f1: caller: irdma_create_ah+0x3e/0x70 [irdma] ah_id=0 arp_idx=0 dest_ip=0.0.0.0 destMAC=00:00:64:ca:b7:52 ipvalid=1 raw=0000:0000:0000:0000:0000:ffff:0000:0000 [ 1207.682077] ice 0000:07:00.1 rocep7s0f1: abnormal ae_id = 0x401 bool qp=1 qp_id = 1, ae_src=5 [ 1207.691657] infiniband rocep7s0f1: Fatal error (1) on MAD QP (1) Fix this by updating the CMA destination address when the ULP calls a resolve address with the CM state already bound. Fixes: 8d037973d48c ("RDMA/core: Refactor rdma_bind_addr") Signed-off-by: Shiraz Saleem Link: https://lore.kernel.org/r/20230712234133.1343-1-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky commit f0842bb3d38863777e3454da5653d80b5fde6321 Author: Shiraz Saleem Date: Tue Jul 11 12:52:53 2023 -0500 RDMA/irdma: Fix data race on CQP request done KCSAN detects a data race on cqp_request->request_done memory location which is accessed locklessly in irdma_handle_cqp_op while being updated in irdma_cqp_ce_handler. Annotate lockless intent with READ_ONCE/WRITE_ONCE to avoid any compiler optimizations like load fusing and/or KCSAN warning. [222808.417128] BUG: KCSAN: data-race in irdma_cqp_ce_handler [irdma] / irdma_wait_event [irdma] [222808.417532] write to 0xffff8e44107019dc of 1 bytes by task 29658 on cpu 5: [222808.417610] irdma_cqp_ce_handler+0x21e/0x270 [irdma] [222808.417725] cqp_compl_worker+0x1b/0x20 [irdma] [222808.417827] process_one_work+0x4d1/0xa40 [222808.417835] worker_thread+0x319/0x700 [222808.417842] kthread+0x180/0x1b0 [222808.417852] ret_from_fork+0x22/0x30 [222808.417918] read to 0xffff8e44107019dc of 1 bytes by task 29688 on cpu 1: [222808.417995] irdma_wait_event+0x1e2/0x2c0 [irdma] [222808.418099] irdma_handle_cqp_op+0xae/0x170 [irdma] [222808.418202] irdma_cqp_cq_destroy_cmd+0x70/0x90 [irdma] [222808.418308] irdma_puda_dele_rsrc+0x46d/0x4d0 [irdma] [222808.418411] irdma_rt_deinit_hw+0x179/0x1d0 [irdma] [222808.418514] irdma_ib_dealloc_device+0x11/0x40 [irdma] [222808.418618] ib_dealloc_device+0x2a/0x120 [ib_core] [222808.418823] __ib_unregister_device+0xde/0x100 [ib_core] [222808.418981] ib_unregister_device+0x22/0x40 [ib_core] [222808.419142] irdma_ib_unregister_device+0x70/0x90 [irdma] [222808.419248] i40iw_close+0x6f/0xc0 [irdma] [222808.419352] i40e_client_device_unregister+0x14a/0x180 [i40e] [222808.419450] i40iw_remove+0x21/0x30 [irdma] [222808.419554] auxiliary_bus_remove+0x31/0x50 [222808.419563] device_remove+0x69/0xb0 [222808.419572] device_release_driver_internal+0x293/0x360 [222808.419582] driver_detach+0x7c/0xf0 [222808.419592] bus_remove_driver+0x8c/0x150 [222808.419600] driver_unregister+0x45/0x70 [222808.419610] auxiliary_driver_unregister+0x16/0x30 [222808.419618] irdma_exit_module+0x18/0x1e [irdma] [222808.419733] __do_sys_delete_module.constprop.0+0x1e2/0x310 [222808.419745] __x64_sys_delete_module+0x1b/0x30 [222808.419755] do_syscall_64+0x39/0x90 [222808.419763] entry_SYSCALL_64_after_hwframe+0x63/0xcd [222808.419829] value changed: 0x01 -> 0x03 Fixes: 915cc7ac0f8e ("RDMA/irdma: Add miscellaneous utility definitions") Signed-off-by: Shiraz Saleem Link: https://lore.kernel.org/r/20230711175253.1289-4-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky commit f2c3037811381f9149243828c7eb9a1631df9f9c Author: Shiraz Saleem Date: Tue Jul 11 12:52:52 2023 -0500 RDMA/irdma: Fix data race on CQP completion stats CQP completion statistics is read lockesly in irdma_wait_event and irdma_check_cqp_progress while it can be updated in the completion thread irdma_sc_ccq_get_cqe_info on another CPU as KCSAN reports. Make completion statistics an atomic variable to reflect coherent updates to it. This will also avoid load/store tearing logic bug potentially possible by compiler optimizations. [77346.170861] BUG: KCSAN: data-race in irdma_handle_cqp_op [irdma] / irdma_sc_ccq_get_cqe_info [irdma] [77346.171383] write to 0xffff8a3250b108e0 of 8 bytes by task 9544 on cpu 4: [77346.171483] irdma_sc_ccq_get_cqe_info+0x27a/0x370 [irdma] [77346.171658] irdma_cqp_ce_handler+0x164/0x270 [irdma] [77346.171835] cqp_compl_worker+0x1b/0x20 [irdma] [77346.172009] process_one_work+0x4d1/0xa40 [77346.172024] worker_thread+0x319/0x700 [77346.172037] kthread+0x180/0x1b0 [77346.172054] ret_from_fork+0x22/0x30 [77346.172136] read to 0xffff8a3250b108e0 of 8 bytes by task 9838 on cpu 2: [77346.172234] irdma_handle_cqp_op+0xf4/0x4b0 [irdma] [77346.172413] irdma_cqp_aeq_cmd+0x75/0xa0 [irdma] [77346.172592] irdma_create_aeq+0x390/0x45a [irdma] [77346.172769] irdma_rt_init_hw.cold+0x212/0x85d [irdma] [77346.172944] irdma_probe+0x54f/0x620 [irdma] [77346.173122] auxiliary_bus_probe+0x66/0xa0 [77346.173137] really_probe+0x140/0x540 [77346.173154] __driver_probe_device+0xc7/0x220 [77346.173173] driver_probe_device+0x5f/0x140 [77346.173190] __driver_attach+0xf0/0x2c0 [77346.173208] bus_for_each_dev+0xa8/0xf0 [77346.173225] driver_attach+0x29/0x30 [77346.173240] bus_add_driver+0x29c/0x2f0 [77346.173255] driver_register+0x10f/0x1a0 [77346.173272] __auxiliary_driver_register+0xbc/0x140 [77346.173287] irdma_init_module+0x55/0x1000 [irdma] [77346.173460] do_one_initcall+0x7d/0x410 [77346.173475] do_init_module+0x81/0x2c0 [77346.173491] load_module+0x1232/0x12c0 [77346.173506] __do_sys_finit_module+0x101/0x180 [77346.173522] __x64_sys_finit_module+0x3c/0x50 [77346.173538] do_syscall_64+0x39/0x90 [77346.173553] entry_SYSCALL_64_after_hwframe+0x63/0xcd [77346.173634] value changed: 0x0000000000000094 -> 0x0000000000000095 Fixes: 915cc7ac0f8e ("RDMA/irdma: Add miscellaneous utility definitions") Signed-off-by: Shiraz Saleem Link: https://lore.kernel.org/r/20230711175253.1289-3-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky commit 4984eb51453ff7eddee9e5ce816145be39c0ec5c Author: Shiraz Saleem Date: Tue Jul 11 12:52:51 2023 -0500 RDMA/irdma: Add missing read barriers On code inspection, there are many instances in the driver where CEQE and AEQE fields written to by HW are read without guaranteeing that the polarity bit has been read and checked first. Add a read barrier to avoid reordering of loads on the CEQE/AEQE fields prior to checking the polarity bit. Fixes: 3f49d6842569 ("RDMA/irdma: Implement HW Admin Queue OPs") Signed-off-by: Shiraz Saleem Link: https://lore.kernel.org/r/20230711175253.1289-2-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky commit fb74c4e3bee283ad8ce981fb744aa8239bed2d7a Author: Russell Currey Date: Thu Jul 13 14:21:45 2023 +1000 powerpc/crypto: Add gitignore for generated P10 AES/GCM .S files aesp10-ppc.S and ghashp10-ppc.S are autogenerated and not tracked by git, so they should be ignored. This is doing the same as the P8 files in drivers/crypto/vmx/.gitignore but for the P10 files in arch/powerpc/crypto. Signed-off-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://msgid.link/20230713042206.85669-1-ruscur@russell.cc commit b49e578b9314db051da0ad72bba24094193f9bd0 Author: Christophe Leroy Date: Wed Jul 12 23:45:02 2023 +1000 Revert "powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto" This partly reverts commit 1e688dd2a3d6759d416616ff07afc4bb836c4213. That commit aimed at optimising the code around generation of WARN_ON/BUG_ON but this leads to a lot of dead code erroneously generated by GCC. That dead code becomes a problem when we start using objtool validation because objtool will abort validation with a warning as soon as it detects unreachable code. This is because unreachable code might be the indication that objtool doesn't properly decode object text. text data bss dec hex filename 9551585 3627834 224376 13403795 cc8693 vmlinux.before 9535281 3628358 224376 13388015 cc48ef vmlinux.after Once this change is reverted, in a standard configuration (pmac32 + function tracer) the text is reduced by 16k which is around 1.7% We already had problem with it when starting to use objtool on powerpc as a replacement for recordmcount, see commit 93e3f45a2631 ("powerpc: Fix __WARN_FLAGS() for use with Objtool") There is also a problem with at least GCC 12, on ppc64_defconfig + CONFIG_CC_OPTIMIZE_FOR_SIZE=y + CONFIG_DEBUG_SECTION_MISMATCH=y : LD .tmp_vmlinux.kallsyms1 powerpc64-linux-ld: net/ipv4/tcp_input.o:(__ex_table+0xc4): undefined reference to `.L2136' make[2]: *** [scripts/Makefile.vmlinux:36: vmlinux] Error 1 make[1]: *** [/home/chleroy/linux-powerpc/Makefile:1238: vmlinux] Error 2 Taking into account that other problems are encountered with that 'asm goto' in WARN_ON(), including build failures, keeping that change is not worth it allthough it is primarily a compiler bug. Revert it for now. mpe: Retain EMIT_WARN_ENTRY as a synonym for EMIT_BUG_ENTRY to reduce churn, as there are now nearly as many uses of EMIT_WARN_ENTRY as EMIT_BUG_ENTRY. Signed-off-by: Christophe Leroy Acked-by: Naveen N Rao Signed-off-by: Michael Ellerman Link: https://msgid.link/20230712134552.534955-1-mpe@ellerman.id.au commit b59c9dc4d9d47b3c4572d826603fde507055b656 Author: Haren Myneni Date: Sun Jul 16 03:05:06 2023 -0700 powerpc/pseries/vas: Hold mmap_mutex after mmap lock during window close Commit 8ef7b9e1765a ("powerpc/pseries/vas: Close windows with DLPAR core removal") unmaps the window paste address and issues HCALL to close window in the hypervisor for migration or DLPAR core removal events. So holds mmap_mutex and then mmap lock before unmap the paste address. But if the user space issue mmap paste address at the same time with the migration event, coproc_mmap() is called after holding the mmap lock which can trigger deadlock when trying to acquire mmap_mutex in coproc_mmap(). t1: mmap() call to mmap t2: Migration event window paste address do_mmap2() migration_store() ksys_mmap_pgoff() pseries_migrate_partition() vm_mmap_pgoff() vas_migration_handler() Acquire mmap lock reconfig_close_windows() do_mmap() lock mmap_mutex mmap_region() Acquire mmap lock call_mmap() //Wait for mmap lock coproc_mmap() unmap vma lock mmap_mutex update window status //wait for mmap_mutex Release mmap lock mmap vma unlock mmap_mutex update window status unlock mmap_mutex ... Release mmap lock Fix this deadlock issue by holding mmap lock first before mmap_mutex in reconfig_close_windows(). Fixes: 8ef7b9e1765a ("powerpc/pseries/vas: Close windows with DLPAR core removal") Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://msgid.link/20230716100506.7833-1-haren@linux.ibm.com commit f7a0b57524cf811ac06257a5099f1b7c19ee7310 Author: Tim Harvey Date: Tue Jun 6 08:40:30 2023 -0700 arm64: dts: imx8mm-venice-gw7904: disable disp_blk_ctrl The GW7904 does not connect the VDD_MIPI power rails thus MIPI is disabled. However we must also disable disp_blk_ctrl as it uses the pgc_mipi power domain and without it being disabled imx8m-blk-ctrl will fail to probe: imx8m-blk-ctrl 32e28000.blk-ctrl: error -ETIMEDOUT: failed to attach power domain "mipi-dsi" imx8m-blk-ctrl: probe of 32e28000.blk-ctrl failed with error -110 Fixes: b999bdaf0597 ("arm64: dts: imx: Add i.mx8mm Gateworks gw7904 dts support") Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 3e7d3c5e13b05dda9db92d98803a626378e75438 Author: Tim Harvey Date: Tue Jun 6 08:39:45 2023 -0700 arm64: dts: imx8mm-venice-gw7903: disable disp_blk_ctrl The GW7903 does not connect the VDD_MIPI power rails thus MIPI is disabled. However we must also disable disp_blk_ctrl as it uses the pgc_mipi power domain and without it being disabled imx8m-blk-ctrl will fail to probe: imx8m-blk-ctrl 32e28000.blk-ctrl: error -ETIMEDOUT: failed to attach power domain "mipi-dsi" imx8m-blk-ctrl: probe of 32e28000.blk-ctrl failed with error -110 Fixes: a72ba91e5bc7 ("arm64: dts: imx: Add i.mx8mm Gateworks gw7903 dts support") Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit cec148c2476a6e06cf8190b20de81f98983b53ca Author: Damien Le Moal Date: Tue Jul 4 08:32:40 2023 +0900 ata: pata_parport: Add missing protocol modules description Most of the protocol modules for the pata_parport driver are missing a module description, causing warnings such as: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/ata/pata_parport/aten.o when compiling with W=1. Add the missing MODULE_DESCRIPTION() definitions to avoid these warnings. While at it, also add the missing MODULE_AUTHOR() definitions. Signed-off-by: Damien Le Moal commit fdf0eaf11452d72945af31804e2a1048ee1b574c Author: Linus Torvalds Date: Sun Jul 16 15:10:37 2023 -0700 Linux 6.5-rc2 commit 5b8d6e8539498e8b2fa67fbcce3fe87834d44a7a Merge: 1667e630c228c a160e9414d8a1 Author: Linus Torvalds Date: Sun Jul 16 14:12:49 2023 -0700 Merge tag 'xtensa-20230716' of https://github.com/jcmvbkbc/linux-xtensa Pull xtensa fixes from Max Filippov: - fix interaction between unaligned exception handler and load/store exception handler - fix parsing ISS network interface specification string - add comment about etherdev freeing to ISS network driver * tag 'xtensa-20230716' of https://github.com/jcmvbkbc/linux-xtensa: xtensa: fix unaligned and load/store configuration interaction xtensa: ISS: fix call to split_if_spec xtensa: ISS: add comment about etherdev freeing commit 1667e630c228ca2e7577de7a404c89de3d9f7772 Merge: 8a3e4a64849eb 27c68c216ee1f Author: Linus Torvalds Date: Sun Jul 16 13:46:08 2023 -0700 Merge tag 'perf_urgent_for_v6.5_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fix from Borislav Petkov: - Fix a lockdep warning when the event given is the first one, no event group exists yet but the code still goes and iterates over event siblings * tag 'perf_urgent_for_v6.5_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86: Fix lockdep warning in for_each_sibling_event() on SPR commit 8a3e4a64849eb9da0e8c7e693978499562581631 Merge: f61a89ca1182c 719a937b70039 Author: Linus Torvalds Date: Sun Jul 16 13:34:29 2023 -0700 Merge tag 'objtool_urgent_for_v6.5_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fixes from Borislav Petkov: - Mark copy_iovec_from_user() __noclone in order to prevent gcc from doing an inter-procedural optimization and confuse objtool - Initialize struct elf fully to avoid build failures * tag 'objtool_urgent_for_v6.5_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: iov_iter: Mark copy_iovec_from_user() noclone objtool: initialize all of struct elf commit f61a89ca1182c43aa7a141c40f4063be81bd2562 Merge: ede950b019227 aff037078ecae Author: Linus Torvalds Date: Sun Jul 16 13:22:08 2023 -0700 Merge tag 'sched_urgent_for_v6.5_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fixes from Borislav Petkov: - Remove a cgroup from under a polling process properly - Fix the idle sibling selection * tag 'sched_urgent_for_v6.5_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/psi: use kernfs polling functions for PSI trigger polling sched/fair: Use recent_used_cpu to test p->cpus_ptr commit ede950b01922778ade5ba0d0834f25fca4ed1d88 Merge: fe756ad021461 04e601f2a71c8 Author: Linus Torvalds Date: Sun Jul 16 12:55:31 2023 -0700 Merge tag 'pinctrl-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "I'm mostly on vacation but what would vacation be without a few critical fixes so people can use their gaming laptops when hiding away from the sun (or rain)? - Fix a really annoying interrupt storm in the AMD driver affecting Asus TUF gaming notebooks - Fix device tree parsing in the Renesas driver" * tag 'pinctrl-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: amd: Unify debounce handling into amd_pinconf_set() pinctrl: amd: Drop pull up select configuration pinctrl: amd: Use amd_pinconf_set() for all config options pinctrl: amd: Only use special debounce behavior for GPIO 0 pinctrl: renesas: rzg2l: Handle non-unique subnode names pinctrl: renesas: rzv2m: Handle non-unique subnode names commit fe756ad0214619ac01503c37f43ca5b912d760d4 Merge: 20edcec23f92d 69cba9d3c1284 Author: Linus Torvalds Date: Sun Jul 16 12:49:05 2023 -0700 Merge tag '6.5-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: - Two reconnect fixes: important fix to address inFlight count to leak (which can leak credits), and fix for better handling a deleted share - DFS fix - SMB1 cleanup fix - deferred close fix * tag '6.5-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix mid leak during reconnection after timeout threshold cifs: is_network_name_deleted should return a bool smb: client: fix missed ses refcounting smb: client: Fix -Wstringop-overflow issues cifs: if deferred close is disabled then close files immediately commit 20edcec23f92db47ca1ab33b4c6025bb8b3db7d7 Merge: 6eede0686f2f4 cf53564b11cef Author: Linus Torvalds Date: Sun Jul 16 12:28:04 2023 -0700 Merge tag 'powerpc-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix Speculation_Store_Bypass reporting in /proc/self/status on Power10 - Fix HPT with 4K pages since recent changes by implementing pmd_same() - Fix 64-bit native_hpte_remove() to be irq-safe Thanks to Aneesh Kumar K.V, Nageswara R Sastry, and Russell Currey. * tag 'powerpc-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/mm/book3s64/hash/4k: Add pmd_same callback for 4K page size powerpc/64e: Fix obtool warnings in exceptions-64e.S powerpc/security: Fix Speculation_Store_Bypass reporting on Power10 powerpc/64s: Fix native_hpte_remove() to be irq-safe commit 6eede0686f2f4a1b026a5714cb0481d074085855 Merge: 4b4eef57e6135 ec7633de404e7 Author: Linus Torvalds Date: Sun Jul 16 12:18:18 2023 -0700 Merge tag 'hardening-v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening fixes from Kees Cook: - Remove LTO-only suffixes from promoted global function symbols (Yonghong Song) - Remove unused .text..refcount section from vmlinux.lds.h (Petr Pavlu) - Add missing __always_inline to sparc __arch_xchg() (Arnd Bergmann) - Claim maintainership of string routines * tag 'hardening-v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: sparc: mark __arch_xchg() as __always_inline MAINTAINERS: Foolishly claim maintainership of string routines kallsyms: strip LTO-only suffixes from promoted global functions vmlinux.lds.h: Remove a reference to no longer used sections .text..refcount commit 4b4eef57e6135ebd28de8c6a3e7898e04172a897 Merge: 831fe284d8275 797311bce5c2a Author: Linus Torvalds Date: Sun Jul 16 12:13:51 2023 -0700 Merge tag 'probes-fixes-v6.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull probe fixes from Masami Hiramatsu: - fprobe: Add a comment why fprobe will be skipped if another kprobe is running in fprobe_kprobe_handler(). - probe-events: Fix some issues related to fetch-arguments: - Fix double counting of the string length for user-string and symstr. This will require longer buffer in the array case. - Fix not to count error code (minus value) for the total used length in array argument. This makes the total used length shorter. - Fix to update dynamic used data size counter only if fetcharg uses the dynamic size data. This may mis-count the used dynamic data size and corrupt data. - Revert "tracing: Add "(fault)" name injection to kernel probes" because that did not work correctly with a bug, and we agreed the current '(fault)' output (instead of '"(fault)"' like a string) explains what happened more clearly. - Fix to record 0-length (means fault access) data_loc data in fetch function itself, instead of store_trace_args(). If we record an array of string, this will fix to save fault access data on each entry of the array correctly. * tag 'probes-fixes-v6.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing/probes: Fix to record 0-length data_loc in fetch_store_string*() if fails Revert "tracing: Add "(fault)" name injection to kernel probes" tracing/probes: Fix to update dynamic data counter if fetcharg uses it tracing/probes: Fix not to count error code to total length tracing/probes: Fix to avoid double count of the string length on the array fprobes: Add a comment why fprobe_kprobe_handler exits if kprobe is running commit 48faabfb3634e519fc49ef01525448ad2ba96751 Author: Krzysztof Kozlowski Date: Wed Jul 12 10:05:12 2023 +0200 dt-bindings: iio: adi,ad74115: remove ref from -nanoamp dtschema v2023.06 comes with support for properties with -nanoamp suffix, thus bindings should not have a ref for it: adi,ad74115.yaml: properties:adi,ext1-burnout-current-nanoamp: '$ref' should not be valid under {'const': '$ref'} Cc: Cosmin Tanislav Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230712080512.94964-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit a41e19cc0d6b6a445a4133170b90271e4a2553dc Author: Alvin Šipraga Date: Mon Jun 19 16:12:39 2023 +0200 iio: adc: ina2xx: avoid NULL pointer dereference on OF device match The affected lines were resulting in a NULL pointer dereference on our platform because the device tree contained the following list of compatible strings: power-sensor@40 { compatible = "ti,ina232", "ti,ina231"; ... }; Since the driver doesn't declare a compatible string "ti,ina232", the OF matching succeeds on "ti,ina231". But the I2C device ID info is populated via the first compatible string, cf. modalias population in of_i2c_get_board_info(). Since there is no "ina232" entry in the legacy I2C device ID table either, the struct i2c_device_id *id pointer in the probe function is NULL. Fix this by using the already populated type variable instead, which points to the proper driver data. Since the name is also wanted, add a generic one to the ina2xx_config table. Signed-off-by: Alvin Šipraga Fixes: c43a102e67db ("iio: ina2xx: add support for TI INA2xx Power Monitors") Link: https://lore.kernel.org/r/20230619141239.2257392-1-alvin@pqrs.dk Cc: Signed-off-by: Jonathan Cameron commit 95fb1e7b23bc82130016daefa02a87e83185ca95 Author: Matti Vaittinen Date: Tue Jun 13 12:35:12 2023 +0300 iio: light: bu27008: Fix intensity data type The intensity data from bu27008 is unsigned. The type of the scan data was incorrectly marked as signed resulting large intensity values to be interpreted as negative ones. Fix the scan data type. Fixes: 41ff93d14f78 ("iio: light: ROHM BU27008 color sensor") Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/240a7ca5fc1b76da20d81f930d00f31a54b1fdf8.1686648422.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 096649cd7cb0fc1c8f684829f816d938ad1eb808 Author: Matti Vaittinen Date: Tue Jun 13 12:34:55 2023 +0300 iio: light: bu27008: Fix scale format The driver is expecting accuracy of NANOs for intensity scale in raw_write. The IIO core is however defaulting to MICROs. This leads the raw-write of smallest scales to never succeed as correct selector(s) are not found. Fix this by implementing the .write_raw_get_fmt callback to use NANO accuracy for writes of IIO_CHAN_INFO_SCALE. Fixes: 41ff93d14f78 ("iio: light: ROHM BU27008 color sensor") Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/e4778b74cde41431f77bc8dd88ec18605da0b400.1686648422.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit d47b9b84292706784482a661324bbc178153781f Author: Matti Vaittinen Date: Tue Jun 13 12:34:36 2023 +0300 iio: light: bu27034: Fix scale format The driver is expecting accuracy of NANOs for intensity scale in raw_write. The IIO core is however defaulting to MICROs. This leads the raw-write of smallest scales to never succeed as correct selector(s) are not found. Fix this by implementing the .write_raw_get_fmt callback to use NANO accuracy for writes of IIO_CHAN_INFO_SCALE. Signed-off-by: Matti Vaittinen Fixes: e52afbd61039 ("iio: light: ROHM BU27034 Ambient Light Sensor") Link: https://lore.kernel.org/r/5369117315cf05b88cf0ccb87373fd77190f6ca2.1686648422.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 6bc471b6c3aeaa7b95d1b86a1bb8d91a3c341fa5 Author: Alisa Roman Date: Wed Jun 14 18:52:43 2023 +0300 iio: adc: ad7192: Fix ac excitation feature AC excitation enable feature exposed to user on AD7192, allowing a bit which should be 0 to be set. This feature is specific only to AD7195. AC excitation attribute moved accordingly. In the AD7195 documentation, the AC excitation enable bit is on position 22 in the Configuration register. ACX macro changed to match correct register and bit. Note that the fix tag is for the commit that moved the driver out of staging. Fixes: b581f748cce0 ("staging: iio: adc: ad7192: move out of staging") Signed-off-by: Alisa Roman Cc: stable@vger.kernel.org Reviewed-by: Nuno Sa Link: https://lore.kernel.org/r/20230614155242.160296-1-alisa.roman@analog.com Signed-off-by: Jonathan Cameron commit ea690ad78dd611e3906df5b948a516000b05c1cb Author: Johan Jonker Date: Fri Jul 14 17:21:21 2023 +0200 mtd: rawnand: rockchip: Align hwecc vs. raw page helper layouts Currently, read/write_page_hwecc() and read/write_page_raw() are not aligned: there is a mismatch in the OOB bytes which are not read/written at the same offset in both cases (raw vs. hwecc). This is a real problem when relying on the presence of the Page Addresses (PA) when using the NAND chip as a boot device, as the BootROM expects additional data in the OOB area at specific locations. Rockchip boot blocks are written per 4 x 512 byte sectors per page. Each page with boot blocks must have a page address (PA) pointer in OOB to the next page. Pages are written in a pattern depending on the NAND chip ID. Generate boot block page address and pattern for hwecc in user space and copy PA data to/from the already reserved last 4 bytes before ECC in the chip->oob_poi data layout. Align the different helpers. This change breaks existing jffs2 users. Fixes: 058e0e847d54 ("mtd: rawnand: rockchip: NFC driver for RK3308, RK2928 and others") Signed-off-by: Johan Jonker Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/5e782c08-862b-51ae-47ff-3299940928ca@gmail.com commit d0ca3b92b7a6f42841ea9da8492aaf649db79780 Author: Johan Jonker Date: Fri Jul 14 17:21:01 2023 +0200 mtd: rawnand: rockchip: fix oobfree offset and description Rockchip boot blocks are written per 4 x 512 byte sectors per page. Each page with boot blocks must have a page address (PA) pointer in OOB to the next page. The currently advertised free OOB area starts at offset 6, like if 4 PA bytes were located right after the BBM. This is wrong as the PA bytes are located right before the ECC bytes. Fix the layout by allowing access to all bytes between the BBM and the PA bytes instead of reserving 4 bytes right after the BBM. This change breaks existing jffs2 users. Fixes: 058e0e847d54 ("mtd: rawnand: rockchip: NFC driver for RK3308, RK2928 and others") Signed-off-by: Johan Jonker Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/d202f12d-188c-20e8-f2c2-9cc874ad4d22@gmail.com commit a746b3689546da27125da9ccaea62b1dbaaf927c Author: Aleksa Savic Date: Fri Jul 14 14:07:11 2023 +0200 hwmon: (aquacomputer_d5next) Fix incorrect PWM value readout Commit 662d20b3a5af ("hwmon: (aquacomputer_d5next) Add support for temperature sensor offsets") changed aqc_get_ctrl_val() to return the value through a parameter instead of through the return value, but didn't fix up a case that relied on the old behavior. Fix it to use the proper received value and not the return code. Fixes: 662d20b3a5af ("hwmon: (aquacomputer_d5next) Add support for temperature sensor offsets") Cc: stable@vger.kernel.org Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/20230714120712.16721-1-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck commit 368da76be8df60e9228a41b7d46e7836a67158fd Author: Ahmad Khalifa Date: Sat Jul 15 15:58:31 2023 +0100 hwmon: (nct6775) Fix register for nct6799 Datasheet and variable name point to 0xe6 Fixes: aee395bb1905 ("hwmon: (nct6755) Add support for NCT6799D") Signed-off-by: Ahmad Khalifa Link: https://lore.kernel.org/r/20230715145831.1304633-1-ahmad@khalifa.ws Signed-off-by: Guenter Roeck commit 831fe284d8275987596b7d640518dddba5735f61 Merge: 393ea78172cdc 54ccc8758ef4d Author: Linus Torvalds Date: Sat Jul 15 08:51:02 2023 -0700 Merge tag 'spi-fix-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A couple of fairly minor driver specific fixes here, plus a bunch of maintainership and admin updates. Nothing too remarkable" * tag 'spi-fix-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: mailmap: add entry for Jonas Gorski MAINTAINERS: add myself for spi-bcm63xx spi: s3c64xx: clear loopback bit after loopback test spi: bcm63xx: fix max prepend length MAINTAINERS: Add myself as a maintainer for Microchip SPI commit 393ea78172cdc68800285cb43855c9531abc26a1 Merge: 82678ab2a4af2 963b54df82b6d Author: Linus Torvalds Date: Sat Jul 15 08:46:09 2023 -0700 Merge tag 'regmap-fix-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fix from Mark Brown: "One fix for an out of bounds access in the interupt code here" * tag 'regmap-fix-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap-irq: Fix out-of-bounds access when allocating config buffers commit 82678ab2a4af2b827d2b44b35b1295de8a1d312d Merge: b6e6cc1f78c77 c20ecf7bb6153 Author: Linus Torvalds Date: Sat Jul 15 08:40:00 2023 -0700 Merge tag 'iommu-fixes-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: - Fix a regression causing a crash on sysfs access of iommu-group specific files - Fix signedness bug in SVA code * tag 'iommu-fixes-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/sva: Fix signedness bug in iommu_sva_alloc_pasid() iommu: Fix crash during syfs iommu_groups/N/type commit bd846ceee9c478d0397428f02696602ba5eb264a Author: Rob Clark Date: Tue Jul 11 10:54:07 2023 -0700 drm/msm/adreno: Fix snapshot BINDLESS_DATA size The incorrect size was causing "CP | AHB bus error" when snapshotting the GPU state on a6xx gen4 (a660 family). Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/26 Signed-off-by: Rob Clark Reviewed-by: Akhil P Oommen Fixes: 1707add81551 ("drm/msm/a6xx: Add a6xx gpu state") Patchwork: https://patchwork.freedesktop.org/patch/546763/ commit 317ab1b90e593eba5b65165e959991837f5593bf Author: Rob Clark Date: Tue Jul 4 09:36:40 2023 -0700 drm/msm/a690: Remove revn and name These fields are deprecated. But any userspace new enough to support a690 also knows how to identify the GPU based on chip-id. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/545552/ commit 7164360030ea43c0a309fcff1cd728648501dfb7 Author: Rob Clark Date: Tue Jul 4 09:36:39 2023 -0700 drm/msm/adreno: Fix warn splat for devices without revn Recently, a WARN_ON() was introduced to ensure that revn is filled before adreno_is_aXYZ is called. This however doesn't work very well when revn is 0 by design (such as for A635). Cc: Konrad Dybcio Fixes: cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set") Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Tested-by: Abhinav Kumar # sc7280 Patchwork: https://patchwork.freedesktop.org/patch/545554/ commit e8bf1741c14eb8e4a4e1364d45aeeab66660ab9b Author: Martin Povišer Date: Wed Jul 12 14:15:56 2023 +0200 MAINTAINERS: Redo addition of ssm3515 to APPLE SOUND The MAINTAINERS entries added in commit 4ac690bbae02 ("ASoC: ssm3515: Add new amp driver") were later erased in a merge commit. Re-add those. Cc: Mark Brown Fixes: af53b00fa3ac ("Merge tag 'v6.4-rc2' into asoc-6.5 to get fixes for CI") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20230712121556.93500-1-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 05abb3be91d8788328231ee02973ab3d47f5e3d2 Author: Ville Syrjälä Date: Thu Jul 13 22:47:45 2023 +0300 dma-buf/dma-resv: Stop leaking on krealloc() failure Currently dma_resv_get_fences() will leak the previously allocated array if the fence iteration got restarted and the krealloc_array() fails. Free the old array by hand, and make sure we still clear the returned *fences so the caller won't end up accessing freed memory. Some (but not all) of the callers of dma_resv_get_fences() seem to still trawl through the array even when dma_resv_get_fences() failed. And let's zero out *num_fences as well for good measure. Cc: Sumit Semwal Cc: Christian König Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-sig@lists.linaro.org Fixes: d3c80698c9f5 ("dma-buf: use new iterator in dma_resv_get_fences v3") Signed-off-by: Ville Syrjälä Reviewed-by: Christian König Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20230713194745.1751-1-ville.syrjala@linux.intel.com Signed-off-by: Christian König commit 0dd1805fe498e0cf64f68e451a8baff7e64494ec Merge: 9840036786d90 04be3c95da826 Author: Jakub Kicinski Date: Fri Jul 14 20:39:35 2023 -0700 Merge branch 'net-fix-kernel-doc-problems-in-include-net' Randy Dunlap says: ==================== net: fix kernel-doc problems in include/net/ Fix many (but not all) kernel-doc warnings in include/net/. [PATCH v2 net 1/9] net: bonding: remove kernel-doc comment marker [PATCH v2 net 2/9] net: cfg802154: fix kernel-doc notation warnings [PATCH v2 net 3/9] codel: fix kernel-doc notation warnings [PATCH v2 net 4/9] devlink: fix kernel-doc notation warnings [PATCH v2 net 5/9] inet: frags: remove kernel-doc comment marker [PATCH v2 net 6/9] net: llc: fix kernel-doc notation warnings [PATCH v2 net 7/9] net: NSH: fix kernel-doc notation warning [PATCH v2 net 8/9] pie: fix kernel-doc notation warning [PATCH v2 net 9/9] rsi: remove kernel-doc comment marker ==================== Link: https://lore.kernel.org/r/20230714045127.18752-1-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit 04be3c95da8266a099c8446b6d1205ccf8a62e66 Author: Randy Dunlap Date: Thu Jul 13 21:51:27 2023 -0700 rsi: remove kernel-doc comment marker Change an errant kernel-doc comment marker (/**) to a regular comment to prevent a kernel-doc warning. rsi_91x.h:3: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Copyright (c) 2017 Redpine Signals Inc. Fixes: 4c10d56a76bb ("rsi: add header file rsi_91x") Signed-off-by: Randy Dunlap Cc: Prameela Rani Garnepudi Cc: Siva Rebbagondla Acked-by: Kalle Valo Link: https://lore.kernel.org/r/20230714045127.18752-10-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit d1cca974548d76e0fa8b6761d25f7b47376a3780 Author: Randy Dunlap Date: Thu Jul 13 21:51:26 2023 -0700 pie: fix kernel-doc notation warning Spell a struct member's name correctly to prevent a kernel-doc warning. pie.h:38: warning: Function parameter or member 'tupdate' not described in 'pie_params' Fixes: b42a3d7c7cff ("pie: improve comments and commenting style") Signed-off-by: Randy Dunlap Cc: Leslie Monis Cc: "Mohit P. Tahiliani" Cc: Gautam Ramakrishnan Cc: Jamal Hadi Salim Cc: Cong Wang Cc: Jiri Pirko Link: https://lore.kernel.org/r/20230714045127.18752-9-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit d1533d726aa1efca3a7ae8f40c94ccb149d22e6a Author: Randy Dunlap Date: Thu Jul 13 21:51:25 2023 -0700 net: NSH: fix kernel-doc notation warning Use the struct member's name and the correct format to prevent a kernel-doc warning. nsh.h:200: warning: Function parameter or member 'context' not described in 'nsh_md1_ctx' Fixes: 1f0b7744c505 ("net: add NSH header structures and helpers") Signed-off-by: Randy Dunlap Cc: Jiri Benc Link: https://lore.kernel.org/r/20230714045127.18752-8-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit 201a08830d8c4698f97ce65329ba92e36b7f402a Author: Randy Dunlap Date: Thu Jul 13 21:51:24 2023 -0700 net: llc: fix kernel-doc notation warnings Use the corrent function parameter name or format to prevent kernel-doc warnings. Add 2 function parameter descriptions to prevent kernel-doc warnings. llc_pdu.h:278: warning: Function parameter or member 'da' not described in 'llc_pdu_decode_da' llc_pdu.h:278: warning: Excess function parameter 'sa' description in 'llc_pdu_decode_da' llc_pdu.h:330: warning: Function parameter or member 'skb' not described in 'llc_pdu_init_as_test_cmd' llc_pdu.h:379: warning: Function parameter or member 'svcs_supported' not described in 'llc_pdu_init_as_xid_cmd' llc_pdu.h:379: warning: Function parameter or member 'rx_window' not described in 'llc_pdu_init_as_xid_cmd' Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230714045127.18752-7-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit d20909a0689f585fb6443da2d8797f7ad549f931 Author: Randy Dunlap Date: Thu Jul 13 21:51:23 2023 -0700 inet: frags: eliminate kernel-doc warning Modify the anonymous enum kernel-doc content so that it doesn't cause a kernel-doc warning. inet_frag.h:33: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Fixes: 1ab1934ed80a ("inet: frags: enum the flag definitions and add descriptions") Signed-off-by: Randy Dunlap Cc: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20230714045127.18752-6-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit 839f55c5ebdfc2c0825bc7e711a7dedaca11f84e Author: Randy Dunlap Date: Thu Jul 13 21:51:22 2023 -0700 devlink: fix kernel-doc notation warnings Spell function or struct member names correctly. Use ':' instead of '-' for struct member entries. Mark one field as private in kernel-doc. Add a few entries that were missing. Fix a typo. These changes prevent kernel-doc warnings: devlink.h:252: warning: Function parameter or member 'field_id' not described in 'devlink_dpipe_match' devlink.h:267: warning: Function parameter or member 'field_id' not described in 'devlink_dpipe_action' devlink.h:310: warning: Function parameter or member 'match_values_count' not described in 'devlink_dpipe_entry' devlink.h:355: warning: Function parameter or member 'list' not described in 'devlink_dpipe_table' devlink.h:374: warning: Function parameter or member 'actions_dump' not described in 'devlink_dpipe_table_ops' devlink.h:374: warning: Function parameter or member 'matches_dump' not described in 'devlink_dpipe_table_ops' devlink.h:374: warning: Function parameter or member 'entries_dump' not described in 'devlink_dpipe_table_ops' devlink.h:374: warning: Function parameter or member 'counters_set_update' not described in 'devlink_dpipe_table_ops' devlink.h:374: warning: Function parameter or member 'size_get' not described in 'devlink_dpipe_table_ops' devlink.h:384: warning: Function parameter or member 'headers' not described in 'devlink_dpipe_headers' devlink.h:384: warning: Function parameter or member 'headers_count' not described in 'devlink_dpipe_headers' devlink.h:398: warning: Function parameter or member 'unit' not described in 'devlink_resource_size_params' devlink.h:487: warning: Function parameter or member 'id' not described in 'devlink_param' devlink.h:645: warning: Function parameter or member 'overwrite_mask' not described in 'devlink_flash_update_params' Fixes: 1555d204e743 ("devlink: Support for pipeline debug (dpipe)") Fixes: d9f9b9a4d05f ("devlink: Add support for resource abstraction") Fixes: eabaef1896bc ("devlink: Add devlink_param register and unregister") Fixes: 5d5b4128c4ca ("devlink: introduce flash update overwrite mask") Signed-off-by: Randy Dunlap Cc: Jiri Pirko Cc: Moshe Shemesh Cc: Jacob Keller Link: https://lore.kernel.org/r/20230714045127.18752-5-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit cfe57122bba5dc16ad64b162d97e42923fc7587e Author: Randy Dunlap Date: Thu Jul 13 21:51:21 2023 -0700 codel: fix kernel-doc notation warnings Use '@' before the struct member names in kernel-doc notation to prevent kernel-doc warnings. codel.h:158: warning: Function parameter or member 'ecn_mark' not described in 'codel_stats' codel.h:158: warning: Function parameter or member 'ce_mark' not described in 'codel_stats' Fixes: 76e3cc126bb2 ("codel: Controlled Delay AQM") Signed-off-by: Randy Dunlap Cc: Jamal Hadi Salim Cc: Cong Wang Cc: Jiri Pirko Cc: Dave Taht Link: https://lore.kernel.org/r/20230714045127.18752-4-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit a63e40444e1bdb2ccdcd7c2e4afa51fdbc6c8589 Author: Randy Dunlap Date: Thu Jul 13 21:51:20 2023 -0700 net: cfg802154: fix kernel-doc notation warnings Add an enum heading to the kernel-doc comments to prevent kernel-doc warnings. cfg802154.h:174: warning: Cannot understand * @WPAN_PHY_FLAG_TRANSMIT_POWER: Indicates that transceiver will support on line 174 - I thought it was a doc line cfg802154.h:192: warning: Enum value 'WPAN_PHY_FLAG_TXPOWER' not described in enum 'wpan_phy_flags' cfg802154.h:192: warning: Excess enum value 'WPAN_PHY_FLAG_TRANSMIT_POWER' description in 'wpan_phy_flags' Fixes: edea8f7c75ec ("cfg802154: introduce wpan phy flags") Signed-off-by: Randy Dunlap Cc: Alexander Aring Cc: Stefan Schmidt Cc: Marcel Holtmann Acked-by: Miquel Raynal Link: https://lore.kernel.org/r/20230714045127.18752-3-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit a66557c790208610bdc21c0c788e7b9524b1a356 Author: Randy Dunlap Date: Thu Jul 13 21:51:19 2023 -0700 net: bonding: remove kernel-doc comment marker Change an errant kernel-doc comment marker (/**) to a regular comment to prevent a kernel-doc warning. bonding.h:282: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Returns NULL if the net_device does not belong to any of the bond's slaves Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Randy Dunlap Cc: Jay Vosburgh Cc: Andy Gospodarek Link: https://lore.kernel.org/r/20230714045127.18752-2-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit b6e6cc1f78c772e952495b7416c9ac9029f9390c Merge: be522ac7cdcc1 535d0ae39185a Author: Linus Torvalds Date: Fri Jul 14 20:19:25 2023 -0700 Merge tag 'x86_urgent_for_6.5_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 CFI fixes from Peter Zijlstra: "Fix kCFI/FineIBT weaknesses The primary bug Alyssa noticed was that with FineIBT enabled function prologues have a spurious ENDBR instruction: __cfi_foo: endbr64 subl $hash, %r10d jz 1f ud2 nop 1: foo: endbr64 <--- *sadface* This means that any indirect call that fails to target the __cfi symbol and instead targets (the regular old) foo+0, will succeed due to that second ENDBR. Fixing this led to the discovery of a single indirect call that was still doing this: ret_from_fork(). Since that's an assembly stub the compiler would not generate the proper kCFI indirect call magic and it would not get patched. Brian came up with the most comprehensive fix -- convert the thing to C with only a very thin asm wrapper. This ensures the kernel thread boostrap is a proper kCFI call. While discussing all this, Kees noted that kCFI hashes could/should be poisoned to seal all functions whose address is never taken, further limiting the valid kCFI targets -- much like we already do for IBT. So what was a 'simple' observation and fix cascaded into a bunch of inter-related CFI infrastructure fixes" * tag 'x86_urgent_for_6.5_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cfi: Only define poison_cfi() if CONFIG_X86_KERNEL_IBT=y x86/fineibt: Poison ENDBR at +0 x86: Rewrite ret_from_fork() in C x86/32: Remove schedule_tail_wrapper() x86/cfi: Extend ENDBR sealing to kCFI x86/alternative: Rename apply_ibt_endbr() x86/cfi: Extend {JMP,CAKK}_NOSPEC comment commit be522ac7cdcc1b7dd19fa348205363041ab65a98 Merge: b3bd86a049656 f4d1a8e011909 Author: Linus Torvalds Date: Fri Jul 14 19:57:29 2023 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "This is a bunch of small driver fixes and a larger rework of zone disk handling (which reaches into blk and nvme). The aacraid array-bounds fix is now critical since the security people turned on -Werror for some build tests, which now fail without it" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: storvsc: Handle SRB status value 0x30 scsi: block: Improve checks in blk_revalidate_disk_zones() scsi: block: virtio_blk: Set zone limits before revalidating zones scsi: block: nullblk: Set zone limits before revalidating zones scsi: nvme: zns: Set zone limits before revalidating zones scsi: sd_zbc: Set zone limits before revalidating zones scsi: ufs: core: Add support for qTimestamp attribute scsi: aacraid: Avoid -Warray-bounds warning scsi: ufs: ufs-mediatek: Add dependency for RESET_CONTROLLER scsi: ufs: core: Update contact email for monitor sysfs nodes scsi: scsi_debug: Remove dead code scsi: qla2xxx: Use vmalloc_array() and vcalloc() scsi: fnic: Use vmalloc_array() and vcalloc() scsi: qla2xxx: Fix error code in qla2x00_start_sp() scsi: qla2xxx: Silence a static checker warning scsi: lpfc: Fix a possible data race in lpfc_unregister_fcf_rescan() commit b3bd86a0496565272ee1fc003b4b75ddb2f6427f Merge: ec17f16432058 9f87fc4d72f52 Author: Linus Torvalds Date: Fri Jul 14 19:52:18 2023 -0700 Merge tag 'block-6.5-2023-07-14' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - NVMe pull request via Keith: - Don't require quirk to use duplicate namespace identifiers (Christoph, Sagi) - One more BOGUS_NID quirk (Pankaj) - IO timeout and error hanlding fixes for PCI (Keith) - Enhanced metadata format mask fix (Ankit) - Association race condition fix for fibre channel (Michael) - Correct debugfs error checks (Minjie) - Use PAGE_SECTORS_SHIFT where needed (Damien) - Reduce kernel logs for legacy nguid attribute (Keith) - Use correct dma direction when unmapping metadata (Ming) - Fix for a flush handling regression in this release (Christoph) - Fix for batched request time stamping (Chengming) - Fix for a regression in the mq-deadline position calculation (Bart) - Lockdep fix for blk-crypto (Eric) - Fix for a regression in the Amiga partition handling changes (Michael) * tag 'block-6.5-2023-07-14' of git://git.kernel.dk/linux: block: queue data commands from the flush state machine at the head blk-mq: fix start_time_ns and alloc_time_ns for pre-allocated rq nvme-pci: fix DMA direction of unmapping integrity data nvme: don't reject probe due to duplicate IDs for single-ported PCIe devices block/mq-deadline: Fix a bug in deadline_from_pos() nvme: ensure disabling pairs with unquiesce nvme-fc: fix race between error recovery and creating association nvme-fc: return non-zero status code when fails to create association nvme: fix parameter check in nvme_fault_inject_init() nvme: warn only once for legacy uuid attribute block: remove dead struc request->completion_data field nvme: fix the NVME_ID_NS_NVM_STS_MASK definition nvmet: use PAGE_SECTORS_SHIFT nvme: add BOGUS_NID quirk for Samsung SM953 blk-crypto: use dynamic lock class for blk_crypto_profile::lock block/partition: fix signedness issue for Amiga partitions commit ec17f16432058e1406c763a81acfc1394578bc8c Merge: 2772d7df3c93f 8a796565cec36 Author: Linus Torvalds Date: Fri Jul 14 19:46:54 2023 -0700 Merge tag 'io_uring-6.5-2023-07-14' of git://git.kernel.dk/linux Pull io_uring fix from Jens Axboe: "Just a single tweak for the wait logic in io_uring" * tag 'io_uring-6.5-2023-07-14' of git://git.kernel.dk/linux: io_uring: Use io_schedule* in cqring wait commit ff84772fd45d486e4fc78c82e2f70ce5333543e6 Author: Sungjong Seo Date: Fri Jul 14 17:43:54 2023 +0900 exfat: release s_lock before calling dir_emit() There is a potential deadlock reported by syzbot as below: ====================================================== WARNING: possible circular locking dependency detected 6.4.0-next-20230707-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor330/5073 is trying to acquire lock: ffff8880218527a0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock_killable include/linux/mmap_lock.h:151 [inline] ffff8880218527a0 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5293 [inline] ffff8880218527a0 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x369/0x510 mm/memory.c:5344 but task is already holding lock: ffff888019f760e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_iterate+0x117/0xb50 fs/exfat/dir.c:232 which lock already depends on the new lock. Chain exists of: &mm->mmap_lock --> mapping.invalidate_lock#3 --> &sbi->s_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->s_lock); lock(mapping.invalidate_lock#3); lock(&sbi->s_lock); rlock(&mm->mmap_lock); Let's try to avoid above potential deadlock condition by moving dir_emit*() out of sbi->s_lock coverage. Fixes: ca06197382bd ("exfat: add directory operations") Cc: stable@vger.kernel.org #v5.7+ Reported-by: syzbot+1741a5d9b79989c10bdc@syzkaller.appspotmail.com Link: https://lore.kernel.org/lkml/00000000000078ee7e060066270b@google.com/T/#u Tested-by: syzbot+1741a5d9b79989c10bdc@syzkaller.appspotmail.com Signed-off-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 9d2a55b403eea26cab7c831d8e1c00ef1e6a6850 Author: Xiang Chen Date: Fri Jul 14 11:38:40 2023 +0800 KVM: arm64: Fix the name of sys_reg_desc related to PMU For those PMU system registers defined in sys_reg_descs[], use macro PMU_SYS_REG() / PMU_PMEVCNTR_EL0 / PMU_PMEVTYPER_EL0 to define them, and later two macros call macro PMU_SYS_REG() actually. Currently the input parameter of PMU_SYS_REG() is another macro which is calculation formula of the value of system registers, so for example, if we want to "SYS_PMINTENSET_EL1" as the name of sys register, actually the name we get is as following: (((3) << 19) | ((0) << 16) | ((9) << 12) | ((14) << 8) | ((1) << 5)) The name of system register is used in some tracepoints such as trace_kvm_sys_access(), if not set correctly, we need to analyze the inaccurate name to get the exact name (which also is inconsistent with other system registers), and also the inaccurate name occupies more space. To fix the issue, use the name as a input parameter of PMU_SYS_REG like MTE_REG or EL2_REG. Signed-off-by: Xiang Chen Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/1689305920-170523-1-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Oliver Upton commit 6d4f9236cd678e0bf0c09fd0e1fa20435bb2e5a2 Author: Oliver Upton Date: Thu Jul 13 22:16:49 2023 +0000 KVM: arm64: Correctly handle RES0 bits PMEVTYPER_EL0.evtCount The PMU event ID varies from 10 to 16 bits, depending on the PMU version. If the PMU only supports 10 bits of event ID, bits [15:10] of the evtCount field behave as RES0. While the actual PMU emulation code gets this right (i.e. RES0 bits are masked out when programming the perf event), the sysreg emulation writes an unmasked value to the in-memory cpu context. The net effect is that guest reads and writes of PMEVTYPER_EL0 will see non-RES0 behavior in the reserved bits of the field. As it so happens, kvm_pmu_set_counter_event_type() already writes a masked value to the in-memory context that gets overwritten by access_pmu_evtyper(). Fix the issue by removing the unnecessary (and incorrect) register write in access_pmu_evtyper(). Reviewed-by: Marc Zyngier Reviewed-by: Reiji Watanabe Link: https://lore.kernel.org/r/20230713221649.3889210-1-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 030d2a0ce5dc621e5c6b2f5f65a77a4bb1620adb Author: Krzysztof Kozlowski Date: Wed Jul 12 10:11:24 2023 +0200 dt-bindings: hwmon: moortec,mr75203: fix multipleOf for coefficients Few coefficients use default values multiple of 100, not 1000 (in the example DTS and in the Linux driver): moortec,mr75203.example.dtb: pvt@e0680000: moortec,ts-coeff-g:0:0: 61400 is not a multiple of 1000 Fixes: bf1fdafdbc61 ("dt-bindings: hwmon: (mr75203) add coefficient properties for the thermal equation") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230712081124.110345-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 004ff1b049dda0ec484328a78fc550a9cfc0942b Author: Dan Williams Date: Wed Jul 12 18:50:36 2023 -0700 cxl: Update MAINTAINERS Ben, thank you for all the work to get the CXL subsystem off the ground and establishing QEMU as a place where hardware vendors can collaborate on the new advancements and mechanisms appearing in the CXL specification. Jonathan, thank you for your continued review and collaboration, you have been a defacto CXL maintainer for a while now. Davidlohr, thank you for getting the background command infrastructure off the ground and your leadership on and off the lists. Dave Jiang, thank you for yor continued attention to all the cross-subsytem plumbing issues that CXL continues to create. Cc: Davidlohr Bueso Cc: Jonathan Cameron Cc: Ben Widawsky Cc: Adam Manzanares Cc: Alison Schofield Cc: Vishal Verma Cc: Ira Weiny Cc: Dave Jiang Acked-by: Davidlohr Bueso Acked-by: Jonathan Cameron Reviewed-by: Adam Manzanares Signed-off-by: Dan Williams Link: https://lore.kernel.org/r/168921298745.190279.14706856880354094471.stgit@dwillia2-xfh.jf.intel.com Reviewed-by: Alison Schofield Reviewed-by: Vishal Verma Acked-by: Dave Jiang Signed-off-by: Vishal Verma commit 95c6bff72b02ca084be60c08503d563e506b733f Author: Dan Carpenter Date: Mon Jul 3 17:17:45 2023 +0300 cxl/mem: Fix a double shift bug The CXL_FW_CANCEL macro is used with set/test_bit() so it should be a bit number and not the shifted value. The original code is the equivalent of using BIT(BIT(0)) so it's 0x2 instead of 0x1. This has no effect on runtime because it's done consistently and nothing else was using the 0x2 bit. Fixes: 9521875bbe00 ("cxl: add a firmware update mechanism using the sysfs firmware loader") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/a11b0c78-4717-4f4e-90be-f47f300d607c@moroto.mountain Reviewed-by: Vishal Verma Reviewed-by: Davidlohr Bueso Reviewed-by: Dave Jiang Signed-off-by: Vishal Verma commit 9171dfcda4f26dc6ebfd8d50137c5f294c2060ee Author: Arnd Bergmann Date: Mon Jul 3 13:29:13 2023 +0200 cxl: fix CONFIG_FW_LOADER dependency When FW_LOADER is disabled, cxl fails to link: arm-linux-gnueabi-ld: drivers/cxl/core/memdev.o: in function `cxl_memdev_setup_fw_upload': memdev.c:(.text+0x90e): undefined reference to `firmware_upload_register' memdev.c:(.text+0x93c): undefined reference to `firmware_upload_unregister' In order to use the firmware_upload_register() function, both FW_LOADER and FW_UPLOAD have to be enabled, which is a bit confusing. In addition, the dependency is on the wrong symbol, as the caller is part of the cxl_core.ko module, not the cxl_mem.ko module. Fixes: 9521875bbe005 ("cxl: add a firmware update mechanism using the sysfs firmware loader") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230703112928.332321-1-arnd@kernel.org Reviewed-by: Xiao Yang Reviewed-by: Dave Jiang Signed-off-by: Vishal Verma commit 70904263512a74a3b8941dd9e6e515ca6fc57821 Author: Ross Lagerwall Date: Fri Jul 14 11:11:06 2023 +0100 blk-mq: Fix stall due to recursive flush plug We have seen rare IO stalls as follows: * blk_mq_plug_issue_direct() is entered with an mq_list containing two requests. * For the first request, it sets last == false and enters the driver's queue_rq callback. * The driver queue_rq callback indirectly calls schedule() which calls blk_flush_plug(). This may happen if the driver has the BLK_MQ_F_BLOCKING flag set and is allowed to sleep in ->queue_rq. * blk_flush_plug() handles the remaining request in the mq_list. mq_list is now empty. * The original call to queue_rq resumes (with last == false). * The loop in blk_mq_plug_issue_direct() terminates because there are no remaining requests in mq_list. The IO is now stalled because the last request submitted to the driver had last == false and there was no subsequent call to commit_rqs(). Fix this by returning early in blk_mq_flush_plug_list() if rq_count is 0 which it will be in the recursive case, rather than checking if the mq_list is empty. At the same time, adjust one of the callers to skip the mq_list empty check as it is not necessary. Fixes: dc5fc361d891 ("block: attempt direct issue of plug list") Signed-off-by: Ross Lagerwall Reviewed-by: Bart Van Assche Link: https://lore.kernel.org/r/20230714101106.3635611-1-ross.lagerwall@citrix.com Signed-off-by: Jens Axboe commit 569f8b501b177f21121d483a96491716ab8905f4 Author: John Hubbard Date: Mon Jul 10 17:56:29 2023 -0700 selftests/arm64: fix build failure during the "emit_tests" step The build failure reported in [1] occurred because commit <9fc96c7c19df> ("selftests: error out if kernel header files are not yet built") added a new "kernel_header_files" dependency to "all", and that triggered another, pre-existing problem. Specifically, the arm64 selftests override the emit_tests target, and that override improperly declares itself to depend upon the "all" target. This is a problem because the "emit_tests" target in lib.mk was not intended to be overridden. emit_tests is a very simple, sequential build target that was originally invoked from the "install" target, which in turn, depends upon "all". That approach worked for years. But with 9fc96c7c19df in place, emit_tests failed, because it does not set up all of the elaborate things that "install" does. And that caused the new "kernel_header_files" target (which depends upon $(KBUILD_OUTPUT) being correct) to fail. Some detail: The "all" target is .PHONY. Therefore, each target that depends on "all" will cause it to be invoked again, and because dependencies are managed quite loosely in the selftests Makefiles, many things will run, even "all" is invoked several times in immediate succession. So this is not a "real" failure, as far as build steps go: everything gets built, but "all" reports a problem when invoked a second time from a bad environment. To fix this, simply remove the unnecessary "all" dependency from the overridden emit_tests target. The dependency is still effectively honored, because again, invocation is via "install", which also depends upon "all". An alternative approach would be to harden the emit_tests target so that it can depend upon "all", but that's a lot more complicated and hard to get right, and doesn't seem worth it, especially given that emit_tests should probably not be overridden at all. [1] https://lore.kernel.org/20230710-kselftest-fix-arm64-v1-1-48e872844f25@kernel.org Fixes: 9fc96c7c19df ("selftests: error out if kernel header files are not yet built") Reported-by: Mark Brown Signed-off-by: John Hubbard Tested-by: Mark Brown Signed-off-by: Shuah Khan commit c77896b143d3c9c3e84c4ed0662b807ccbd8730b Author: John Hubbard Date: Wed Jul 12 12:35:14 2023 -0700 selftests/riscv: fix potential build failure during the "emit_tests" step The riscv selftests (which were modeled after the arm64 selftests) are improperly declaring the "emit_tests" target to depend upon the "all" target. This approach, when combined with commit 9fc96c7c19df ("selftests: error out if kernel header files are not yet built"), has caused build failures [1] on arm64, and is likely to cause similar failures for riscv. To fix this, simply remove the unnecessary "all" dependency from the emit_tests target. The dependency is still effectively honored, because again, invocation is via "install", which also depends upon "all". An alternative approach would be to harden the emit_tests target so that it can depend upon "all", but that's a lot more complicated and hard to get right, and doesn't seem worth it, especially given that emit_tests should probably not be overridden at all. [1] https://lore.kernel.org/20230710-kselftest-fix-arm64-v1-1-48e872844f25@kernel.org Fixes: 9fc96c7c19df ("selftests: error out if kernel header files are not yet built") Signed-off-by: John Hubbard Tested-by: Alexandre Ghiti Signed-off-by: Shuah Khan commit 2772d7df3c93f15e5b2119bd9e14724db6a21a04 Merge: bde7f150276bf ab2dbc7accedc Author: Linus Torvalds Date: Fri Jul 14 11:14:07 2023 -0700 Merge tag 'riscv-for-linus-6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - fix a formatting error in the hwprobe documentation - fix a spurious warning in the RISC-V PMU driver - fix memory detection on rv32 (problem does not manifest on any known system) - avoid parsing legacy parsing of I in ACPI ISA strings * tag 'riscv-for-linus-6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: Don't include Zicsr or Zifencei in I from ACPI riscv: mm: fix truncation warning on RV32 perf: RISC-V: Remove PERF_HES_STOPPED flag checking in riscv_pmu_start() Documentation: RISC-V: hwprobe: Fix a formatting error commit bde7f150276bf2a04f92d39beaf34eb40c42c9cc Merge: 3a97a2993e7e7 d121758da6df6 Author: Linus Torvalds Date: Fri Jul 14 11:07:04 2023 -0700 Merge tag 'pm-6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These fix hibernation (after recent changes), frequency QoS and the sparc cpufreq driver. Specifics: - Unbreak the /sys/power/resume interface after recent changes (Azat Khuzhin). - Allow PM_QOS_DEFAULT_VALUE to be used with frequency QoS (Chungkai Yang). - Remove __init from cpufreq callbacks in the sparc driver, because they may be called after initialization too (Viresh Kumar)" * tag 'pm-6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: sparc: Don't mark cpufreq callbacks with __init PM: QoS: Restore support for default value on frequency QoS PM: hibernate: Fix writing maj:min to /sys/power/resume commit d121758da6df6829cb505ef0143cf42d28bd865d Merge: bfb5ef2219b7b c9e4bf607d8c4 3a8395b565b5b Author: Rafael J. Wysocki Date: Fri Jul 14 19:13:21 2023 +0200 Merge branches 'pm-sleep' and 'pm-qos' Merge a PM QoS fix and a hibernation fix for 6.5-rc2. - Unbreak the /sys/power/resume interface after recent changes (Azat Khuzhin). - Allow PM_QOS_DEFAULT_VALUE to be used with frequency QoS (Chungkai Yang). * pm-sleep: PM: hibernate: Fix writing maj:min to /sys/power/resume * pm-qos: PM: QoS: Restore support for default value on frequency QoS commit 676b7c5ecab36274442887ceadd6dee8248a244f Author: David Xu Date: Thu Jul 13 21:35:28 2023 +0800 platform/x86: serial-multi-instantiate: Auto detect IRQ resource for CSC3551 The current code assumes that the CSC3551(multiple cs35l41) always have its interrupt pin connected to GPIO thus the IRQ can be acquired with acpi_dev_gpio_irq_get. However on some newer laptop models this is no longer the case as they have the CSC3551's interrupt pin connected to APIC. This causes smi_i2c_probe to fail on these machines. To support these machines, a new macro IRQ_RESOURCE_AUTO was introduced for cs35l41 smi_node, and smi_get_irq function was modified so it tries to get GPIO irq resource first and if failed, tries to get APIC irq resource for cs35l41. This patch affects only the cs35l41's probing and brings no negative influence on machines that indeed have the cs35l41's interrupt pin connected to GPIO. Signed-off-by: David Xu Link: https://lore.kernel.org/r/SY4P282MB18350CD8288687B87FFD2243E037A@SY4P282MB1835.AUSP282.PROD.OUTLOOK.COM Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit b3e7b3a6ee92ab927f750a6b19615ce88ece808f Author: Michal Swiatkowski Date: Thu Jul 6 08:25:51 2023 +0200 ice: prevent NULL pointer deref during reload Calling ethtool during reload can lead to call trace, because VSI isn't configured for some time, but netdev is alive. To fix it add rtnl lock for VSI deconfig and config. Set ::num_q_vectors to 0 after freeing and add a check for ::tx/rx_rings in ring related ethtool ops. Add proper unroll of filters in ice_start_eth(). Reproduction: $watch -n 0.1 -d 'ethtool -g enp24s0f0np0' $devlink dev reload pci/0000:18:00.0 action driver_reinit Call trace before fix: [66303.926205] BUG: kernel NULL pointer dereference, address: 0000000000000000 [66303.926259] #PF: supervisor read access in kernel mode [66303.926286] #PF: error_code(0x0000) - not-present page [66303.926311] PGD 0 P4D 0 [66303.926332] Oops: 0000 [#1] PREEMPT SMP PTI [66303.926358] CPU: 4 PID: 933821 Comm: ethtool Kdump: loaded Tainted: G OE 6.4.0-rc5+ #1 [66303.926400] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.00.01.0014.070920180847 07/09/2018 [66303.926446] RIP: 0010:ice_get_ringparam+0x22/0x50 [ice] [66303.926649] Code: 90 90 90 90 90 90 90 90 f3 0f 1e fa 0f 1f 44 00 00 48 8b 87 c0 09 00 00 c7 46 04 e0 1f 00 00 c7 46 10 e0 1f 00 00 48 8b 50 20 <48> 8b 12 0f b7 52 3a 89 56 14 48 8b 40 28 48 8b 00 0f b7 40 58 48 [66303.926722] RSP: 0018:ffffad40472f39c8 EFLAGS: 00010246 [66303.926749] RAX: ffff98a8ada05828 RBX: ffff98a8c46dd060 RCX: ffffad40472f3b48 [66303.926781] RDX: 0000000000000000 RSI: ffff98a8c46dd068 RDI: ffff98a8b23c4000 [66303.926811] RBP: ffffad40472f3b48 R08: 00000000000337b0 R09: 0000000000000000 [66303.926843] R10: 0000000000000001 R11: 0000000000000100 R12: ffff98a8b23c4000 [66303.926874] R13: ffff98a8c46dd060 R14: 000000000000000f R15: ffffad40472f3a50 [66303.926906] FS: 00007f6397966740(0000) GS:ffff98b390900000(0000) knlGS:0000000000000000 [66303.926941] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [66303.926967] CR2: 0000000000000000 CR3: 000000011ac20002 CR4: 00000000007706e0 [66303.926999] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [66303.927029] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [66303.927060] PKRU: 55555554 [66303.927075] Call Trace: [66303.927094] [66303.927111] ? __die+0x23/0x70 [66303.927140] ? page_fault_oops+0x171/0x4e0 [66303.927176] ? exc_page_fault+0x7f/0x180 [66303.927209] ? asm_exc_page_fault+0x26/0x30 [66303.927244] ? ice_get_ringparam+0x22/0x50 [ice] [66303.927433] rings_prepare_data+0x62/0x80 [66303.927469] ethnl_default_doit+0xe2/0x350 [66303.927501] genl_family_rcv_msg_doit.isra.0+0xe3/0x140 [66303.927538] genl_rcv_msg+0x1b1/0x2c0 [66303.927561] ? __pfx_ethnl_default_doit+0x10/0x10 [66303.927590] ? __pfx_genl_rcv_msg+0x10/0x10 [66303.927615] netlink_rcv_skb+0x58/0x110 [66303.927644] genl_rcv+0x28/0x40 [66303.927665] netlink_unicast+0x19e/0x290 [66303.927691] netlink_sendmsg+0x254/0x4d0 [66303.927717] sock_sendmsg+0x93/0xa0 [66303.927743] __sys_sendto+0x126/0x170 [66303.927780] __x64_sys_sendto+0x24/0x30 [66303.928593] do_syscall_64+0x5d/0x90 [66303.929370] ? __count_memcg_events+0x60/0xa0 [66303.930146] ? count_memcg_events.constprop.0+0x1a/0x30 [66303.930920] ? handle_mm_fault+0x9e/0x350 [66303.931688] ? do_user_addr_fault+0x258/0x740 [66303.932452] ? exc_page_fault+0x7f/0x180 [66303.933193] entry_SYSCALL_64_after_hwframe+0x72/0xdc Fixes: 5b246e533d01 ("ice: split probe into smaller functions") Reviewed-by: Przemek Kitszel Signed-off-by: Michal Swiatkowski Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 24a3298ac9e6bd8de838ab79f7868207170d556d Author: Petr Oros Date: Mon Jun 19 12:58:13 2023 +0200 ice: Unregister netdev and devlink_port only once Since commit 6624e780a577fc ("ice: split ice_vsi_setup into smaller functions") ice_vsi_release does things twice. There is unregister netdev which is unregistered in ice_deinit_eth also. It also unregisters the devlink_port twice which is also unregistered in ice_deinit_eth(). This double deregistration is hidden because devl_port_unregister ignores the return value of xa_erase. [ 68.642167] Call Trace: [ 68.650385] ice_devlink_destroy_pf_port+0xe/0x20 [ice] [ 68.655656] ice_vsi_release+0x445/0x690 [ice] [ 68.660147] ice_deinit+0x99/0x280 [ice] [ 68.664117] ice_remove+0x1b6/0x5c0 [ice] [ 171.103841] Call Trace: [ 171.109607] ice_devlink_destroy_pf_port+0xf/0x20 [ice] [ 171.114841] ice_remove+0x158/0x270 [ice] [ 171.118854] pci_device_remove+0x3b/0xc0 [ 171.122779] device_release_driver_internal+0xc7/0x170 [ 171.127912] driver_detach+0x54/0x8c [ 171.131491] bus_remove_driver+0x77/0xd1 [ 171.135406] pci_unregister_driver+0x2d/0xb0 [ 171.139670] ice_module_exit+0xc/0x55f [ice] Fixes: 6624e780a577 ("ice: split ice_vsi_setup into smaller functions") Signed-off-by: Petr Oros Reviewed-by: Maciej Fijalkowski Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 69cba9d3c1284e0838ae408830a02c4a063104bc Author: Shyam Prasad N Date: Fri Jul 14 08:56:33 2023 +0000 cifs: fix mid leak during reconnection after timeout threshold When the number of responses with status of STATUS_IO_TIMEOUT exceeds a specified threshold (NUM_STATUS_IO_TIMEOUT), we reconnect the connection. But we do not return the mid, or the credits returned for the mid, or reduce the number of in-flight requests. This bug could result in the server->in_flight count to go bad, and also cause a leak in the mids. This change moves the check to a few lines below where the response is decrypted, even of the response is read from the transform header. This way, the code for returning the mids can be reused. Also, the cifs_reconnect was reconnecting just the transport connection before. In case of multi-channel, this may not be what we want to do after several timeouts. Changed that to reconnect the session and the tree too. Also renamed NUM_STATUS_IO_TIMEOUT to a more appropriate name MAX_STATUS_IO_TIMEOUT. Fixes: 8e670f77c4a5 ("Handle STATUS_IO_TIMEOUT gracefully") Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit f13be0ad5344b46bb89323ea5576a2417c6d1e55 Author: Ryan Roberts Date: Thu Jul 13 14:54:33 2023 +0100 selftests/mm: give scripts execute permission When run under run_vmtests.sh, test scripts were failing to run with "permission denied" due to the scripts not being executable. It is also annoying not to be able to directly invoke run_vmtests.sh, which is solved by giving also it the execute permission. Link: https://lkml.kernel.org/r/20230713135440.3651409-3-ryan.roberts@arm.com Signed-off-by: Ryan Roberts Cc: SeongJae Park Cc: David Hildenbrand Cc: Florent Revest Cc: Jérôme Glisse Cc: John Hubbard Cc: Liam R. Howlett Cc: Mark Brown Cc: Shuah Khan Signed-off-by: Andrew Morton commit c071b34f62ddbf8435491ebb0e21eba9dc29f901 Author: Shyam Prasad N Date: Fri Jul 14 08:56:34 2023 +0000 cifs: is_network_name_deleted should return a bool Currently, is_network_name_deleted and it's implementations do not return anything if the network name did get deleted. So the function doesn't fully achieve what it advertizes. Changed the function to return a bool instead. It will now return true if the error returned is STATUS_NETWORK_NAME_DELETED and the share (tree id) was found to be connected. It returns false otherwise. Signed-off-by: Shyam Prasad N Acked-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 73274c33d961f4aa0f968f763e2c9f4210b4f4a3 Author: Dan Carpenter Date: Tue Jul 11 11:21:13 2023 +0300 accel/qaic: Fix a leak in map_user_pages() If get_user_pages_fast() allocates some pages but not as many as we wanted, then the current code leaks those pages. Call put_page() on the pages before returning. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter Reviewed-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo Reviewed-by: Dafna Hirschfeld Cc: stable@vger.kernel.org # 6.4.x Signed-off-by: Jeffrey Hugo Link: https://patchwork.freedesktop.org/patch/msgid/ZK0Q+ZuONTsBG+1T@moroto commit 47d87f71d00b7091b43a56f608f7151b33e5772e Author: Dan Carpenter Date: Tue Jul 11 11:21:00 2023 +0300 accel/qaic: Add consistent integer overflow checks The encode_dma() function has integer overflow checks. The encode_passthrough(), encode_activate() and encode_status() functions did not. I added integer overflow checking everywhere. I also updated the integer overflow checking in encode_dma() to use size_add() so everything is consistent. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter Reviewed-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo Cc: stable@vger.kernel.org # 6.4.x [jhugo: tweak if in encode_dma() to match existing style] Signed-off-by: Jeffrey Hugo Link: https://patchwork.freedesktop.org/patch/msgid/ZK0Q7IsPkj6WSCcL@moroto commit 3a97a2993e7e7392292323fefc46d79bf9633e44 Merge: ddbd91617f6d0 38d88d5e97c90 Author: Linus Torvalds Date: Fri Jul 14 09:10:28 2023 -0700 Merge tag 'drm-fixes-2023-07-14-1' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "There were a bunch of fixes lined up for 2 weeks, so we have quite a few scattered fixes, mostly amdgpu and i915, but ttm has a bunch and nouveau makes an appearance. So a bit busier than usual for rc2, but nothing seems out of the ordinary. fbdev: - dma: Fix documented default preferred_bpp value ttm: - fix warning that we shouldn't mix && and || - never consider pinned BOs for eviction&swap - Don't leak a resource on eviction error - Don't leak a resource on swapout move error - fix bulk_move corruption when adding a entry client: - Send hotplug event after registering a client dma-buf: - keep the signaling time of merged fences v3 - fix an error pointer vs NULL bug sched: - wait for all deps in kill jobs - call set fence parent from scheduled i915: - Don't preserve dpll_hw_state for slave crtc in Bigjoiner - Consider OA buffer boundary when zeroing out reports - Remove dead code from gen8_pte_encode - Fix one wrong caching mode enum usage amdgpu: - SMU i2c locking fix - Fix a possible deadlock in process restoration for ROCm apps - Disable PCIe lane/speed switching on Intel platforms (the platforms don't support it) nouveau: - disp: fix HDMI on gt215+ - disp/g94: enable HDMI - acr: Abort loading ACR if no firmware was found - bring back blit subchannel for pre nv50 GPUs - Fix drm_dp_remove_payload() invocation ivpu: - Fix VPU register access in irq disable - Clear specific interrupt status bits on C0 bridge: - dw_hdmi: fix connector access for scdc - ti-sn65dsi86: Fix auxiliary bus lifetime panel: - simple: Add connector_type for innolux_at043tn24 - simple: Add Powertip PH800480T013 drm_display_mode flags" * tag 'drm-fixes-2023-07-14-1' of git://anongit.freedesktop.org/drm/drm: (32 commits) drm/nouveau: bring back blit subchannel for pre nv50 GPUs drm/nouveau/acr: Abort loading ACR if no firmware was found drm/amd: Align SMU11 SMU_MSG_OverridePcieParameters implementation with SMU13 drm/amd: Move helper for dynamic speed switch check out of smu13 drm/amd/pm: conditionally disable pcie lane/speed switching for SMU13 drm/amd/pm: share the code around SMU13 pcie parameters update drm/amdgpu: avoid restore process run into dead loop. drm/amd/pm: fix smu i2c data read risk drm/nouveau/disp/g94: enable HDMI drm/nouveau/disp: fix HDMI on gt215+ drm/client: Send hotplug event after registering a client drm/i915: Fix one wrong caching mode enum usage drm/i915: Remove dead code from gen8_pte_encode drm/i915/perf: Consider OA buffer boundary when zeroing out reports drm/i915: Don't preserve dpll_hw_state for slave crtc in Bigjoiner drm/ttm: never consider pinned BOs for eviction&swap drm/fbdev-dma: Fix documented default preferred_bpp value dma-buf: fix an error pointer vs NULL bug accel/ivpu: Clear specific interrupt status bits on C0 accel/ivpu: Fix VPU register access in irq disable ... commit ddbd91617f6d0b2fd8d509c45348a56125df07b1 Merge: 4b810bf037e52 a282a2f10539d Author: Linus Torvalds Date: Fri Jul 14 09:05:15 2023 -0700 Merge tag 'ceph-for-6.5-rc2' of https://github.com/ceph/ceph-client Pull ceph fix from Ilya Dryomov: "A fix to prevent a potential buffer overrun in the messenger, marked for stable" * tag 'ceph-for-6.5-rc2' of https://github.com/ceph/ceph-client: libceph: harden msgr2.1 frame segment length checks commit 51b56382ed2a2b03347372272362b3baa623ed1e Author: Dan Carpenter Date: Tue Jul 11 11:20:54 2023 +0300 accel/qaic: tighten bounds checking in decode_message() Copy the bounds checking from encode_message() to decode_message(). This patch addresses the following concerns. Ensure that there is enough space for at least one header so that we don't have a negative size later. if (msg_hdr_len < sizeof(*trans_hdr)) Ensure that we have enough space to read the next header from the msg->data. if (msg_len > msg_hdr_len - sizeof(*trans_hdr)) return -EINVAL; Check that the trans_hdr->len is not below the minimum size: if (hdr_len < sizeof(*trans_hdr)) This minimum check ensures that we don't corrupt memory in decode_passthrough() when we do. memcpy(out_trans->data, in_trans->data, len - sizeof(in_trans->hdr)); And finally, use size_add() to prevent an integer overflow: if (size_add(msg_len, hdr_len) > msg_hdr_len) Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter Reviewed-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo Cc: stable@vger.kernel.org # 6.4.x Signed-off-by: Jeffrey Hugo Link: https://patchwork.freedesktop.org/patch/msgid/ZK0Q5nbLyDO7kJa+@moroto commit ea33cb6fc2788f9fe248d49e1c0b2553a58436ef Author: Dan Carpenter Date: Tue Jul 11 11:20:44 2023 +0300 accel/qaic: tighten bounds checking in encode_message() There are several issues in this code. The check at the start of the loop: if (user_len >= user_msg->len) { This check does not ensure that we have enough space for the trans_hdr (8 bytes). Instead the check needs to be: if (user_len > user_msg->len - sizeof(*trans_hdr)) { That subtraction is done as an unsigned long we want to avoid negatives. Add a lower bound to the start of the function. if (user_msg->len < sizeof(*trans_hdr)) There is a second integer underflow which can happen if trans_hdr->len is zero inside the encode_passthrough() function. memcpy(out_trans->data, in_trans->data, in_trans->hdr.len - sizeof(in_trans->hdr)); Instead of adding a check to encode_passthrough() it's better to check in this central place. Add that check: if (trans_hdr->len < sizeof(trans_hdr) The final concern is that the "user_len + trans_hdr->len" might have an integer overflow bug. Use size_add() to prevent that. - if (user_len + trans_hdr->len > user_msg->len) { + if (size_add(user_len, trans_hdr->len) > user_msg->len) { Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter Reviewed-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo Cc: stable@vger.kernel.org # 6.4.x Signed-off-by: Jeffrey Hugo Link: https://patchwork.freedesktop.org/patch/msgid/9a0cb0c1-a974-4f10-bc8d-94437983639a@moroto.mountain commit f2ae72541d52a0bf50366840fe2238aaf111f7ae Author: Hans de Goede Date: Tue Jul 11 11:59:20 2023 +0200 platform/x86/amd: pmc: Use release_mem_region() to undo request_mem_region_muxed() Muxed (mem) regions will wait in request_mem_region_muxed() if the region is busy (in use by another consumer) during the call. In order to wake-up possibly waiting other consumers of the region, it must be released by a release_mem_region() call, which will actually wake up any waiters. release_mem_region() also frees the resource created by request_mem_region_muxed(), avoiding the need for the unmatched kfree(). Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20230711095920.264308-1-hdegoede@redhat.com commit 9f87fc4d72f52b26ac3e19df5e4584227fe6740c Author: Christoph Hellwig Date: Fri Jul 14 16:30:14 2023 +0200 block: queue data commands from the flush state machine at the head We used to insert the data commands following a pre-flush to the head of the queue until commit 1e82fadfc6b ("blk-mq: do not do head insertions post-pre-flush commands"). Not doing this seems to cause hangs of such commands on NFS workloads when exported from file systems with SATA SSDs. I have no idea why this would starve these workloads, but doing a semantic revert of this patch (which looks quite different due to various other changes) fixes the hangs. Fixes: 1e82fadfc6b ("blk-mq: do not do head insertions post-pre-flush commands") Reported-by: Chuck Lever Signed-off-by: Christoph Hellwig Tested-by: Chuck Lever Link: https://lore.kernel.org/r/20230714143014.11879-1-hch@lst.de Signed-off-by: Jens Axboe commit 8b58f757cd1c712b5f081e4c26b13611298dfb07 Author: Thomas GENTY Date: Fri Jul 14 12:51:17 2023 +0200 platform/x86: touchscreen_dmi.c: small changes for Archos 101 Cesium Educ tablet Fix the axes and add home button support as suggested by Hans de Goede. Signed-off-by: Thomas GENTY Link: https://lore.kernel.org/r/20230714105117.192938-1-tomlohave@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit cc8ff2dfcb948f16267335ba5440a42abb41aee2 Author: Derek Fang Date: Wed Jul 12 14:25:53 2023 +0800 ASoC: rt5640: Fix the issue of speaker noise Remove the class-D internal register setting during initialization to be compatible with most speaker designs to avoid noise. Signed-off-by: Derek Fang Link: https://lore.kernel.org/r/20230712062553.31066-1-derek.fang@realtek.com Signed-off-by: Mark Brown commit 963293ff058cef54718fd225a542c73778257b3c Author: Arnaldo Carvalho de Melo Date: Fri Jul 14 10:36:16 2023 -0300 tools headers arm64: Sync arm64's cputype.h with the kernel sources To get the changes in: e910baa9c1efdf76 ("KVM: arm64: vgic: Add Apple M2 PRO/MAX cpus to the list of broken SEIS implementations") That makes this perf source code to be rebuilt: CC /tmp/build/perf-tools/util/arm-spe.o The changes in the above patch don't affect things that are used in arm-spe.c (things like MIDR_NEOVERSE_N1, etc). Unsure if Apple M2 has SPE (Statistical Profiling Extension) :-) That addresses this perf build warning: Warning: Kernel ABI header differences: diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h Cc: Adrian Hunter Cc: Ali Saidi Cc: Ian Rogers Cc: Jiri Olsa Cc: Leo Yan Cc: Marc Zyngier Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo commit 28e898ffa0c6a0875319d9362e387509819c9907 Author: Arnaldo Carvalho de Melo Date: Fri Jul 14 10:18:42 2023 -0300 tools include UAPI: Sync the sound/asound.h copy with the kernel sources Picking the changes from: 01dfa8e969dbbc72 ("ALSA: ump: Add info flag bit for static blocks") e375b8a045873cf5 ("ALSA: ump: Add more attributes to UMP EP and FB info") 30fc139260d46e9b ("ALSA: ump: Add ioctls to inquiry UMP EP and Block info via control API") 127ae6f6dad2edb2 ("ALSA: rawmidi: Skip UMP devices at SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE") e3a8a5b726bdd903 ("ALSA: rawmidi: UMP support") a4bb75c4f19db711 ("ALSA: uapi: pcm: control the filling of the silence samples for drain") That harvests some new ioctls: $ tools/perf/trace/beauty/sndrv_ctl_ioctl.sh > before.ctl $ tools/perf/trace/beauty/sndrv_pcm_ioctl.sh > before.pcm $ cp include/uapi/sound/asound.h tools/include/uapi/sound/asound.h $ tools/perf/trace/beauty/sndrv_ctl_ioctl.sh > after.ctl $ tools/perf/trace/beauty/sndrv_pcm_ioctl.sh > after.pcm $ diff -u before.ctl after.ctl --- before.ctl 2023-07-14 10:17:00.319591889 -0300 +++ after.ctl 2023-07-14 10:17:24.668248373 -0300 @@ -22,6 +22,9 @@ [0x40] = "RAWMIDI_NEXT_DEVICE", [0x41] = "RAWMIDI_INFO", [0x42] = "RAWMIDI_PREFER_SUBDEVICE", + [0x43] = "UMP_NEXT_DEVICE", + [0x44] = "UMP_ENDPOINT_INFO", + [0x45] = "UMP_BLOCK_INFO", [0xd0] = "POWER", [0xd1] = "POWER_STATE", }; $ diff -u before.pcm after.pcm $ Now those will be decoded when they appear, see a system wide 'perf trace' session example here: # perf trace -e ioctl --max-events=10 0.000 ( 0.010 ms): gnome-shell/2240 ioctl(fd: 9, cmd: DRM_MODE_RMFB, arg: 0x7ffc0041d54c) = 0 2.444 ( 0.005 ms): wireplumber/2304 ioctl(fd: 47, cmd: TIOCOUTQ, arg: 0x7f16e9afea24) = 0 2.452 ( 0.002 ms): wireplumber/2304 ioctl(fd: 47, cmd: TIOCOUTQ, arg: 0x7f16e9afea24) = 0 11.348 ( 0.010 ms): gnome-shell/2240 ioctl(fd: 14, cmd: DRM_I915_IRQ_WAIT, arg: 0x7ffc0041ccf0) = 0 11.406 ( 0.037 ms): gnome-shel:cs0/2259 ioctl(fd: 14, cmd: DRM_I915_IRQ_EMIT, arg: 0x7f3cf69fdc60) = 0 11.476 ( 0.009 ms): gnome-shell/2240 ioctl(fd: 9, cmd: DRM_MODE_ADDFB2, arg: 0x7ffc0041ce50) = 0 11.497 ( 0.019 ms): gnome-shell/2240 ioctl(fd: 9, cmd: DRM_MODE_ATOMIC, arg: 0x7ffc0041cdf0) = 0 12.481 ( 0.020 ms): firefox:cs0/3651 ioctl(fd: 40, cmd: DRM_I915_IRQ_EMIT, arg: 0x7f1c365fea60) = 0 12.529 ( 0.009 ms): firefox:cs0/3651 ioctl(fd: 40, cmd: DRM_I915_IRQ_EMIT, arg: 0x7f1c365feab0) = 0 12.624 ( 0.018 ms): firefox:cs0/3651 ioctl(fd: 40, cmd: DRM_I915_IRQ_EMIT, arg: 0x7f1c365fea30) = 0 # Silencing these perf build warnings: Warning: Kernel ABI header differences: diff -u tools/include/uapi/sound/asound.h include/uapi/sound/asound.h Cc: Adrian Hunter Cc: Ian Rogers Cc: Jaroslav Kysela Cc: Jiri Olsa Cc: Namhyung Kim Cc: Takashi Iwai Link: https://lore.kernel.org/lkml/ZLFOrTE2+xZBgHGe@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7b8615935560e1db55c962efa17a5cbdab349107 Author: Arnaldo Carvalho de Melo Date: Fri Jul 14 10:00:22 2023 -0300 tools include UAPI: Sync linux/vhost.h with the kernel sources To get the changes in: 228a27cf78afc63a ("vhost: Allow worker switching while work is queueing") c1ecd8e950079774 ("vhost: allow userspace to create workers") To pick up these changes and support them: $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > before $ cp include/uapi/linux/vhost.h tools/include/uapi/linux/vhost.h $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > after $ diff -u before after --- before 2023-07-14 09:58:14.268249807 -0300 +++ after 2023-07-14 09:58:23.041493892 -0300 @@ -10,6 +10,7 @@ [0x12] = "SET_VRING_BASE", [0x13] = "SET_VRING_ENDIAN", [0x14] = "GET_VRING_ENDIAN", + [0x15] = "ATTACH_VRING_WORKER", [0x20] = "SET_VRING_KICK", [0x21] = "SET_VRING_CALL", [0x22] = "SET_VRING_ERR", @@ -31,10 +32,12 @@ [0x7C] = "VDPA_SET_GROUP_ASID", [0x7D] = "VDPA_SUSPEND", [0x7E] = "VDPA_RESUME", + [0x9] = "FREE_WORKER", }; static const char *vhost_virtio_ioctl_read_cmds[] = { [0x00] = "GET_FEATURES", [0x12] = "GET_VRING_BASE", + [0x16] = "GET_VRING_WORKER", [0x26] = "GET_BACKEND_FEATURES", [0x70] = "VDPA_GET_DEVICE_ID", [0x71] = "VDPA_GET_STATUS", @@ -44,6 +47,7 @@ [0x79] = "VDPA_GET_CONFIG_SIZE", [0x7A] = "VDPA_GET_AS_NUM", [0x7B] = "VDPA_GET_VRING_GROUP", + [0x8] = "NEW_WORKER", [0x80] = "VDPA_GET_VQS_COUNT", [0x81] = "VDPA_GET_GROUP_NUM", }; $ For instance, see how those 'cmd' ioctl arguments get translated, now ATTACH_VRING_WORKER, GET_VRING_WORKER and NEW_WORKER, will be as well: # perf trace -a -e ioctl --max-events=10 0.000 ( 0.011 ms): pipewire/2261 ioctl(fd: 60, cmd: SNDRV_PCM_HWSYNC, arg: 0x1) = 0 21.353 ( 0.014 ms): pipewire/2261 ioctl(fd: 60, cmd: SNDRV_PCM_HWSYNC, arg: 0x1) = 0 25.766 ( 0.014 ms): gnome-shell/2196 ioctl(fd: 14, cmd: DRM_I915_IRQ_WAIT, arg: 0x7ffe4a22c740) = 0 25.845 ( 0.034 ms): gnome-shel:cs0/2212 ioctl(fd: 14, cmd: DRM_I915_IRQ_EMIT, arg: 0x7fd43915dc70) = 0 25.916 ( 0.011 ms): gnome-shell/2196 ioctl(fd: 9, cmd: DRM_MODE_ADDFB2, arg: 0x7ffe4a22c8a0) = 0 25.941 ( 0.025 ms): gnome-shell/2196 ioctl(fd: 9, cmd: DRM_MODE_ATOMIC, arg: 0x7ffe4a22c840) = 0 32.915 ( 0.009 ms): gnome-shell/2196 ioctl(fd: 9, cmd: DRM_MODE_RMFB, arg: 0x7ffe4a22cf9c) = 0 42.522 ( 0.013 ms): gnome-shell/2196 ioctl(fd: 14, cmd: DRM_I915_IRQ_WAIT, arg: 0x7ffe4a22c740) = 0 42.579 ( 0.031 ms): gnome-shel:cs0/2212 ioctl(fd: 14, cmd: DRM_I915_IRQ_EMIT, arg: 0x7fd43915dc70) = 0 42.644 ( 0.010 ms): gnome-shell/2196 ioctl(fd: 9, cmd: DRM_MODE_ADDFB2, arg: 0x7ffe4a22c8a0) = 0 # Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Michael S. Tsirkin Cc: Mike Christie Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ZLFJ%2FRsDGYiaH5nj@kernel.org/ Signed-off-by: Arnaldo Carvalho de Melo commit 0e022f5bf72f9d7b6f77466b41a87c2076aa8d03 Author: Arnaldo Carvalho de Melo Date: Fri Jul 14 09:52:36 2023 -0300 perf beauty: Update copy of linux/socket.h with the kernel sources To pick the changes in: b848b26c6672c9b9 ("net: Kill MSG_SENDPAGE_NOTLAST") 5e2ff6704a275be0 ("scm: add SO_PASSPIDFD and SCM_PIDFD") 4fe38acdac8a71f7 ("net: Block MSG_SENDPAGE_* from being passed to sendmsg() by userspace") b841b901c452d926 ("net: Declare MSG_SPLICE_PAGES internal sendmsg() flag") That don't result in any changes in the tables generated from that header. But while updating I noticed we were not handling MSG_BATCH and MSG_ZEROCOPY in the hard coded table for the msg flags table, add them. This silences this perf build warning: Warning: Kernel ABI header differences: diff -u tools/perf/trace/beauty/include/linux/socket.h include/linux/socket.h Cc: Adrian Hunter Cc: Alexander Mikhalitsyn Cc: David Howells Cc: David S. Miller Cc: Ian Rogers Cc: Jakub Kicinski Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ZLFGuHDwUGDGXdoR@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c20ecf7bb6153149b81a9277eda23398957656f2 Author: Dan Carpenter Date: Thu Apr 6 11:55:31 2023 +0300 iommu/sva: Fix signedness bug in iommu_sva_alloc_pasid() The ida_alloc_range() function returns negative error codes on error. On success it returns values in the min to max range (inclusive). It never returns more then INT_MAX even if "max" is higher. It never returns values in the 0 to (min - 1) range. The bug is that "min" is an unsigned int so negative error codes will be promoted to high positive values errors treated as success. Fixes: 1a14bf0fc7ed ("iommu/sva: Use GFP_KERNEL for pasid allocation") Signed-off-by: Dan Carpenter Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/6b32095d-7491-4ebb-a850-12e96209eaaf@kili.mountain Signed-off-by: Joerg Roedel commit 911476ef3c585da9fdf156fd7aaa7455455daf76 Author: Jason Gunthorpe Date: Mon Jun 26 12:13:11 2023 -0300 iommu: Fix crash during syfs iommu_groups/N/type The err_restore_domain flow was accidently inserted into the success path in commit 1000dccd5d13 ("iommu: Allow IOMMU_RESV_DIRECT to work on ARM"). It should only happen if iommu_create_device_direct_mappings() fails. This caused the domains the be wrongly changed and freed whenever the sysfs is used, resulting in an oops: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 1 PID: 3417 Comm: avocado Not tainted 6.4.0-rc4-next-20230602 #3 Hardware name: Dell Inc. PowerEdge R6515/07PXPY, BIOS 2.3.6 07/06/2021 RIP: 0010:__iommu_attach_device+0xc/0xa0 Code: c0 c3 cc cc cc cc 48 89 f0 c3 cc cc cc cc 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 41 54 55 48 8b 47 08 <48> 8b 00 48 85 c0 74 74 48 89 f5 e8 64 12 49 00 41 89 c4 85 c0 74 RSP: 0018:ffffabae0220bd48 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff9ac04f70e410 RCX: 0000000000000001 RDX: ffff9ac044db20c0 RSI: ffff9ac044fa50d0 RDI: ffff9ac04f70e410 RBP: ffff9ac044fa50d0 R08: 1000000100209001 R09: 00000000000002dc R10: 0000000000000000 R11: 0000000000000000 R12: ffff9ac043d54700 R13: ffff9ac043d54700 R14: 0000000000000001 R15: 0000000000000001 FS: 00007f02e30ae000(0000) GS:ffff9afeb2440000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000012afca006 CR4: 0000000000770ee0 PKRU: 55555554 Call Trace: ? __die+0x24/0x70 ? page_fault_oops+0x82/0x150 ? __iommu_queue_command_sync+0x80/0xc0 ? exc_page_fault+0x69/0x150 ? asm_exc_page_fault+0x26/0x30 ? __iommu_attach_device+0xc/0xa0 ? __iommu_attach_device+0x1c/0xa0 __iommu_device_set_domain+0x42/0x80 __iommu_group_set_domain_internal+0x5d/0x160 iommu_setup_default_domain+0x318/0x400 iommu_group_store_type+0xb1/0x200 kernfs_fop_write_iter+0x12f/0x1c0 vfs_write+0x2a2/0x3b0 ksys_write+0x63/0xe0 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 RIP: 0033:0x7f02e2f14a6f Reorganize the error flow so that the success branch and error branches are clearer. Fixes: 1000dccd5d13 ("iommu: Allow IOMMU_RESV_DIRECT to work on ARM") Reported-by: Dheeraj Kumar Srivastava Tested-by: Vasant Hegde Signed-off-by: Jason Gunthorpe Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/0-v1-5bd8cc969d9e+1f1-iommu_set_def_fix_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 9840036786d90cea11a90d1f30b6dc003b34ee67 Author: Yan Zhai Date: Thu Jul 13 10:28:00 2023 -0700 gso: fix dodgy bit handling for GSO_UDP_L4 Commit 1fd54773c267 ("udp: allow header check for dodgy GSO_UDP_L4 packets.") checks DODGY bit for UDP, but for packets that can be fed directly to the device after gso_segs reset, it actually falls through to fragmentation: https://lore.kernel.org/all/CAJPywTKDdjtwkLVUW6LRA2FU912qcDmQOQGt2WaDo28KzYDg+A@mail.gmail.com/ This change restores the expected behavior of GSO_UDP_L4 packets. Fixes: 1fd54773c267 ("udp: allow header check for dodgy GSO_UDP_L4 packets.") Suggested-by: Willem de Bruijn Signed-off-by: Yan Zhai Reviewed-by: Willem de Bruijn Acked-by: Jason Wang Signed-off-by: David S. Miller commit 5def5c1c15bf22934ee227af85c1716762f3829f Author: Kunihiko Hayashi Date: Fri Jun 30 09:45:33 2023 +0900 mmc: sdhci-f-sdh30: Replace with sdhci_pltfm Even if sdhci_pltfm_pmops is specified for PM, this driver doesn't apply sdhci_pltfm, so the structure is not correctly referenced in PM functions. This applies sdhci_pltfm to this driver to fix this issue. - Call sdhci_pltfm_init() instead of sdhci_alloc_host() and other functions that covered by sdhci_pltfm. - Move ops and quirks to sdhci_pltfm_data - Replace sdhci_priv() with own private function sdhci_f_sdh30_priv(). Fixes: 87a507459f49 ("mmc: sdhci: host: add new f_sdh30") Signed-off-by: Kunihiko Hayashi Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230630004533.26644-1-hayashi.kunihiko@socionext.com Signed-off-by: Ulf Hansson commit a822551c51f0dc063305ca16b9dd0dec7fe1f259 Author: Wang Ming Date: Thu Jul 13 20:16:03 2023 +0800 net: ethernet: Remove repeating expression Identify issues that arise by using the tests/doublebitand.cocci semantic patch. Need to remove duplicate expression in if statement. Signed-off-by: Wang Ming Reviewed-by: Jiawen Wu Signed-off-by: David S. Miller commit 4ad23d2368ccce6da74edc74e69300a4d75a2379 Author: Wang Ming Date: Thu Jul 13 17:51:06 2023 +0800 bna: Remove error checking for debugfs_create_dir() It is expected that most callers should _ignore_ the errors return by debugfs_create_dir() in bnad_debugfs_init(). Signed-off-by: Wang Ming Signed-off-by: David S. Miller commit 797311bce5c2ac90b8d65e357603cfd410d36ebb Author: Masami Hiramatsu (Google) Date: Tue Jul 11 23:16:07 2023 +0900 tracing/probes: Fix to record 0-length data_loc in fetch_store_string*() if fails Fix to record 0-length data to data_loc in fetch_store_string*() if it fails to get the string data. Currently those expect that the data_loc is updated by store_trace_args() if it returns the error code. However, that does not work correctly if the argument is an array of strings. In that case, store_trace_args() only clears the first entry of the array (which may have no error) and leaves other entries. So it should be cleared by fetch_store_string*() itself. Also, 'dyndata' and 'maxlen' in store_trace_args() should be updated only if it is used (ret > 0 and argument is a dynamic data.) Link: https://lore.kernel.org/all/168908496683.123124.4761206188794205601.stgit@devnote2/ Fixes: 40b53b771806 ("tracing: probeevent: Add array type support") Cc: stable@vger.kernel.org Reviewed-by: Steven Rostedt (Google) Signed-off-by: Masami Hiramatsu (Google) commit 1d6d537dc55d1f42d16290f00157ac387985b95b Author: Daniel Golle Date: Thu Jul 13 03:42:29 2023 +0100 net: ethernet: mtk_eth_soc: handle probe deferral Move the call to of_get_ethdev_address to mtk_add_mac which is part of the probe function and can hence itself return -EPROBE_DEFER should of_get_ethdev_address return -EPROBE_DEFER. This allows us to entirely get rid of the mtk_init function. The problem of of_get_ethdev_address returning -EPROBE_DEFER surfaced in situations in which the NVMEM provider holding the MAC address has not yet be loaded at the time mtk_eth_soc is initially probed. In this case probing of mtk_eth_soc should be deferred instead of falling back to use a random MAC address, so once the NVMEM provider becomes available probing can be repeated. Fixes: 656e705243fd ("net-next: mediatek: add support for MT7623 ethernet") Signed-off-by: Daniel Golle Signed-off-by: David S. Miller commit 56a16035bb6effb37177867cea94c13a8382f745 Author: Kuniyuki Iwashima Date: Wed Jul 12 08:44:49 2023 -0700 bridge: Add extack warning when enabling STP in netns. When we create an L2 loop on a bridge in netns, we will see packets storm even if STP is enabled. # unshare -n # ip link add br0 type bridge # ip link add veth0 type veth peer name veth1 # ip link set veth0 master br0 up # ip link set veth1 master br0 up # ip link set br0 type bridge stp_state 1 # ip link set br0 up # sleep 30 # ip -s link show br0 2: br0: mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/ether b6:61:98:1c:1c:b5 brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped missed mcast 956553768 12861249 0 0 0 12861249 <-. Keep TX: bytes packets errors dropped carrier collsns | increasing 1027834 11951 0 0 0 0 <-' rapidly This is because llc_rcv() drops all packets in non-root netns and BPDU is dropped. Let's add extack warning when enabling STP in netns. # unshare -n # ip link add br0 type bridge # ip link set br0 type bridge stp_state 1 Warning: bridge: STP does not work in non-root netns. Note this commit will be reverted later when we namespacify the whole LLC infra. Fixes: e730c15519d0 ("[NET]: Make packet reception network namespace safe") Suggested-by: Harry Coin Link: https://lore.kernel.org/netdev/0f531295-e289-022d-5add-5ceffa0df9bc@quietfountain.com/ Suggested-by: Ido Schimmel Signed-off-by: Kuniyuki Iwashima Acked-by: Nikolay Aleksandrov Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit b685f1a58956fa36cc01123f253351b25bfacfda Author: Tanmay Patil Date: Wed Jul 12 16:36:57 2023 +0530 net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field()/cpsw_ale_set_field() CPSW ALE has 75 bit ALE entries which are stored within three 32 bit words. The cpsw_ale_get_field() and cpsw_ale_set_field() functions assume that the field will be strictly contained within one word. However, this is not guaranteed to be the case and it is possible for ALE field entries to span across up to two words at the most. Fix the methods to handle getting/setting fields spanning up to two words. Fixes: db82173f23c5 ("netdev: driver: ethernet: add cpsw address lookup engine support") Signed-off-by: Tanmay Patil [s-vadapalli@ti.com: rephrased commit message and added Fixes tag] Signed-off-by: Siddharth Vadapalli Signed-off-by: David S. Miller commit 9845217d60d01d151b45842ef2017a65e8f39f5a Author: Mark Brown Date: Wed Jul 12 12:16:16 2023 +0100 net: dsa: ar9331: Use explict flags for regmap single read/write The at9331 is only able to read or write a single register at once. The driver has a custom regmap bus and chooses to tell the regmap core about this by reporting the maximum transfer sizes rather than the explicit flags that exist at the regmap level. Since there are a number of problems with the raw transfer limits and the regmap level flags are better integrated anyway convert the driver to use the flags. No functional change. Signed-off-by: Mark Brown Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 0cb1d9c845110ce638a43a1417c7df5968d1daa3 Author: Arnd Bergmann Date: Fri Jun 16 16:48:48 2023 +0200 media: verisilicon: change confusingly named relaxed register access The register abstraction has wrappers around both the normal writel() and its writel_relaxed() counterpart, but this has led to a lot of users ending up with the relaxed version. There is sometimes a need to intentionally pick the relaxed accessor for performance critical functions, but I noticed that each hantro_reg_write() call also contains a non-relaxed readl(), which is typically much more expensive than a writel, so there is little benefit here but an added risk of missing a serialization against DMA. To make this behave like other interfaces, use the normal accessor by default and only provide the relaxed version as an alternative for performance critical code. hantro_postproc.c is the only place that used both the relaxed and normal writel, but this does not seem cricital either, so change it all to the normal ones. [hverkuil: fix function prototype alignment] Signed-off-by: Arnd Bergmann Tested-by: Benjamin Gaignard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7ee8acd1b803502878992acd6f99e61f1e8c7a25 Author: Arnd Bergmann Date: Fri Jun 16 16:48:47 2023 +0200 media: verisilicon: fix excessive stack usage In some configurations, gcc decides not to inline the register accessor functions, which in turn leads to lots of temporary hantro_reg structures on the stack that cannot be eliminated because they escape into an uninlined function: drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c:1022:1: warning: the frame size of 1112 bytes is larger than 1024 bytes [-Wframe-larger-than=] Mark all of these as __always_inline so the compiler is able to completely eliminate the temporary structures instead, which brings the stack usage back down to just the normal local variables. Closes: https://lore.kernel.org/oe-kbuild-all/202306151506.goHEegOd-lkp@intel.com/ [hverkuil: fix function prototype alignment, wrap commit log] Reported-by: kernel test robot Fixes: 727a400686a2 ("media: verisilicon: Add Rockchip AV1 decoder") Signed-off-by: Arnd Bergmann Reviewed-by: Nicolas Dufresne Tested-by: Nathan Chancellor Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d05dea76d4a813eb959ba0a150c45246d54e7148 Author: Yunfei Dong Date: Mon Jun 12 05:15:57 2023 +0200 media: mediatek: vcodec: fix cancel_work_sync fail with fluster test Will cause below warning then reboot when exercising the decoder with fluster on mt8192-asurada-spherion. This deinit function is called on the v4l2 release callback, even though the work might not have been initialized as that only happens if/when the codec specific 'decode' callback is called (as a result of device_run m2m callback). CPU: 5 PID: 2338 Comm: gst-launch-1.0 Tainted: G W 6.4.0-rc5-next-20230607+ #475 Hardware name: Google Spherion (rev0 - 3) (DT) pstate: 00400009 (nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __flush_work.isra.0+0x23c/0x258 lr : __cancel_work_timer+0x14c/0x1c8 sp : ffff8000896e3b00 x29: ffff8000896e3b00 x28: ffff57c3d4079f80 x27: 0000000000000000 x26: ffff57c3d4079f80 x25: ffffb76395b59dc8 x24: 0000000000000001 x23: ffffb763928daab8 x22: ffff57c3d4079f80 x21: 0000000000000000 x20: ffffb763955f6778 x19: ffff57c3cf06f4a0 x18: 0000000000000000 x17: 000000040044ffff x16: 005000f2b5503510 x15: 0000000000000000 x14: ffff57c3c03a1f80 x13: ffffa0616a2fc000 x12: 000000003464d91d x11: 0000000000000000 x10: 0000000000001b10 x9 : ffffb763928de61c x8 : ffff57c3d407baf0 x7 : 0000000000000000 x6 : ffff57c3d4079f80 x5 : ffff57c3d4079f80 x4 : 0000000000000000 x3 : 0000000000000000 x2 : ffff8000896e3bf0 x1 : 0000000000000011 x0 : 0000000000000000 Call trace: __flush_work.isra.0+0x23c/0x258 __cancel_work_timer+0x14c/0x1c8 cancel_work_sync+0x1c/0x30 vdec_msg_queue_deinit+0xac/0xc8 vdec_h264_slice_deinit+0x64/0xb8 vdec_if_deinit+0x3c/0x68 mtk_vcodec_dec_release+0x20/0x40 fops_vcodec_release+0x50/0xd8 v4l2_release+0x7c/0x100 __fput+0x80/0x270 ____fput+0x18/0x30 task_work_run+0x78/0xe0 do_notify_resume+0x29c/0x7f8 el0_svc+0xa4/0xb8 el0t_64_sync_handler+0xc0/0xc8 el0t_64_sync+0x1a8/0x1b0 ---[ end trace 0000000000000000 ]--- Fixes: 297160d411e3 ("media: mediatek: vcodec: move core context from device to each instance") Reported-by: Nícolas F. R. A. Prado Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4aaa96b59df5fac41ba891969df6b092061ea9d7 Author: Nikolay Burykin Date: Tue Jan 10 10:09:00 2023 +0100 media: pci: cx23885: fix error handling for cx23885 ATSC boards After having been assigned to NULL value at cx23885-dvb.c:1202, pointer '0' is dereferenced at cx23885-dvb.c:2469. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Nikolay Burykin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 92cbf865ea2e0f2997ff97815c6db182eb23df1b Author: Dmitry Antipov Date: Tue Jun 6 06:38:15 2023 +0200 media: pulse8-cec: handle possible ping error Handle (and warn about) possible error waiting for MSGCODE_PING result. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 20de9fdaf4883deffb0138eef28e9cbbead32cfd Author: Arnd Bergmann Date: Thu Jun 1 23:37:22 2023 +0200 media: mtk_jpeg_core: avoid unused-variable warning The mtk8195_jpegenc_drvdata object was added outside of an #ifdef causing a harmless build warning. drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1879:32: error: 'mtk8195_jpegenc_drvdata' defined but not used [-Werror=unused-variable] 1879 | static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = { | ^~~~~~~~~~~~~~~~~~~~~~~ A follow-up patch moved it inside of an #ifdef, which caused more warnings, and a third patch ended up adding even more #ifdefs. These were all bogus, since the actual problem here is the incorrect use of of_ptr(). Since the driver (like any other modern platform driver) only works in combination with CONFIG_OF, there is no point in hiding the reference, so just remove that along with all the pointless #ifdef checks in the driver. This improves build coverage and avoids running into the same problem again when another part of the driver gets changed that relies on the #ifdef blocks to be completely matched. Fixes: 934e8bccac95 ("mtk-jpegenc: support jpegenc multi-hardware") Fixes: 4ae47770d57b ("media: mtk-jpegenc: Fix a compilation issue") Fixes: da4ede4b7fd6 ("media: mtk-jpeg: move data/code inside CONFIG_OF blocks") Signed-off-by: Arnd Bergmann Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 53ebeea50599c1ed05277d7a57e331a34e6d6a82 Author: Ming Qian Date: Tue May 30 09:16:30 2023 +0200 media: imx-jpeg: Support to assign slot for encoder/decoder imx jpeg encoder and decoder support 4 slots each, aim to support some virtualization scenarios. driver should only enable one slot one time. but due to some hardware issue, only slot 0 can be enabled in imx8q platform, and they may be fixed in imx9 platform. Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dcff0b56f661b6b42e828012b464d22cc2068c38 Author: Nicolas Dufresne Date: Thu May 25 22:10:15 2023 +0200 media: amphion: Fix firmware path to match linux-firmware The path did not match the one it was submitted into linux-firmware which prevented generic distribution from having working CODEC. Fixes: 9f599f351e86 ("media: amphion: add vpu core driver") Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 517f088385e1b8015606143e6212cb30f8714070 Author: Alexander Stein Date: Tue Jan 31 11:32:44 2023 +0100 media: amphion: use dev_err_probe This simplifies the code and silences -517 error messages. Also the reason is listed in /sys/kernel/debug/devices_deferred. Signed-off-by: Alexander Stein Reviewed-by: ming_qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bf4c985707d3168ebb7d87d15830de66949d979c Author: Sakari Ailus Date: Tue Jun 13 18:47:53 2023 +0200 media: staging: atomisp: select V4L2_FWNODE Select V4L2_FWNODE as the driver depends on it. Reported-by: Andy Shevchenko Fixes: aa31f6514047 ("media: atomisp: allow building the driver again") Signed-off-by: Sakari Ailus Tested-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 9c2dcfc2cf0f2e4e0a0db33bc1a626e35928c475 Author: Sakari Ailus Date: Tue May 30 12:16:39 2023 +0200 media: tc358746: Address compiler warnings Address these compiler warnings by initialising the m_best and p_best values to 0 and 1 respectively (as latter is used as a divisor): drivers/media/i2c/tc358746.c: In function 'tc358746_find_pll_settings': >> drivers/media/i2c/tc358746.c:817:13: warning: 'p_best' is used uninitialized [-Wuninitialized] 817 | u16 p_best, p; | ^~~~~~ >> drivers/media/i2c/tc358746.c:816:13: warning: 'm_best' is used uninitialized [-Wuninitialized] 816 | u16 m_best, mul; | ^~~~~~ The warnings may well be a false positive but it is difficult for a compiler to find out whether that truly is the case. Closes: https://lore.kernel.org/oe-kbuild-all/202305301627.fLT3Bkds-lkp@intel.com/ Reported-by: kernel test robot Fixes: 80a21da3605 ("media: tc358746: add Toshiba TC358746 Parallel to CSI-2 bridge driver") Signed-off-by: Sakari Ailus Reviewed-by: Marco Felsch Signed-off-by: Mauro Carvalho Chehab commit 69ea4c9d02b7947cdd612335a61cc1a02e544ccd Author: Kailang Yang Date: Thu Jul 13 15:57:13 2023 +0800 ALSA: hda/realtek - remove 3k pull low procedure This was the ALC283 depop procedure. Maybe this procedure wasn't suitable with new codec. So, let us remove it. But HP 15z-fc000 must do 3k pull low. If it reboot with plugged headset, it will have errors show don't find codec error messages. Run 3k pull low will solve issues. So, let AMD chipset will run this for workarround. Fixes: 5aec98913095 ("ALSA: hda/realtek - ALC236 headset MIC recording issue") Signed-off-by: Kailang Yang Cc: Reported-by: Joseph C. Sible Closes: https://lore.kernel.org/r/CABpewhE4REgn9RJZduuEU6Z_ijXNeQWnrxO1tg70Gkw=F8qNYg@mail.gmail.com/ Link: https://lore.kernel.org/r/4678992299664babac4403d9978e7ba7@realtek.com Signed-off-by: Takashi Iwai commit e608d16e01456f82738bd98f6f5ca9f46634369d Author: Naveen Kumar Goud Arepalli Date: Tue Jul 11 16:29:14 2023 +0530 arm64: dts: qcom: sa8775p-ride: Update L4C parameters L4c is the supply for UFS vccq, As per UFS spec range of vccq is 1.14V to 1.26V, There are stability issues when operating at marginal voltage. Hence configure the min and max vccq voltages to 1.2V. Signed-off-by: Naveen Kumar Goud Arepalli Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230711105915.30581-1-quic_narepall@quicinc.com Signed-off-by: Bjorn Andersson commit 5e1627cb43ddf1b24b92eb26f8d958a3f5676ccb Author: Alan Stern Date: Wed Jul 12 10:15:10 2023 -0400 net: usbnet: Fix WARNING in usbnet_start_xmit/usb_submit_urb The syzbot fuzzer identified a problem in the usbnet driver: usb 1-1: BOGUS urb xfer, pipe 3 != type 1 WARNING: CPU: 0 PID: 754 at drivers/usb/core/urb.c:504 usb_submit_urb+0xed6/0x1880 drivers/usb/core/urb.c:504 Modules linked in: CPU: 0 PID: 754 Comm: kworker/0:2 Not tainted 6.4.0-rc7-syzkaller-00014-g692b7dc87ca6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Workqueue: mld mld_ifc_work RIP: 0010:usb_submit_urb+0xed6/0x1880 drivers/usb/core/urb.c:504 Code: 7c 24 18 e8 2c b4 5b fb 48 8b 7c 24 18 e8 42 07 f0 fe 41 89 d8 44 89 e1 4c 89 ea 48 89 c6 48 c7 c7 a0 c9 fc 8a e8 5a 6f 23 fb <0f> 0b e9 58 f8 ff ff e8 fe b3 5b fb 48 81 c5 c0 05 00 00 e9 84 f7 RSP: 0018:ffffc9000463f568 EFLAGS: 00010086 RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000 RDX: ffff88801eb28000 RSI: ffffffff814c03b7 RDI: 0000000000000001 RBP: ffff8881443b7190 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000003 R13: ffff88802a77cb18 R14: 0000000000000003 R15: ffff888018262500 FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000556a99c15a18 CR3: 0000000028c71000 CR4: 0000000000350ef0 Call Trace: usbnet_start_xmit+0xfe5/0x2190 drivers/net/usb/usbnet.c:1453 __netdev_start_xmit include/linux/netdevice.h:4918 [inline] netdev_start_xmit include/linux/netdevice.h:4932 [inline] xmit_one net/core/dev.c:3578 [inline] dev_hard_start_xmit+0x187/0x700 net/core/dev.c:3594 ... This bug is caused by the fact that usbnet trusts the bulk endpoint addresses its probe routine receives in the driver_info structure, and it does not check to see that these endpoints actually exist and have the expected type and directions. The fix is simply to add such a check. Reported-and-tested-by: syzbot+63ee658b9a100ffadbe2@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-usb/000000000000a56e9105d0cec021@google.com/ Signed-off-by: Alan Stern CC: Oliver Neukum Link: https://lore.kernel.org/r/ea152b6d-44df-4f8a-95c6-4db51143dcc1@rowland.harvard.edu Signed-off-by: Jakub Kicinski commit 95ce158b6c93b28842b54b42ad1cb221b9844062 Author: Linus Walleij Date: Thu Jul 13 00:34:05 2023 +0200 dsa: mv88e6xxx: Do a final check before timing out I get sporadic timeouts from the driver when using the MV88E6352. Reading the status again after the loop fixes the problem: the operation is successful but goes undetected. Some added prints show things like this: [ 58.356209] mv88e6085 mdio_mux-0.1:00: Timeout while waiting for switch, addr 1b reg 0b, mask 8000, val 0000, data c000 [ 58.367487] mv88e6085 mdio_mux-0.1:00: Timeout waiting for ATU op 4000, fid 0001 (...) [ 61.826293] mv88e6085 mdio_mux-0.1:00: Timeout while waiting for switch, addr 1c reg 18, mask 8000, val 0000, data 9860 [ 61.837560] mv88e6085 mdio_mux-0.1:00: Timeout waiting for PHY command 1860 to complete The reason is probably not the commands: I think those are mostly fine with the 50+50ms timeout, but the problem appears when OpenWrt brings up several interfaces in parallel on a system with 7 populated ports: if one of them take more than 50 ms and waits one or more of the others can get stuck on the mutex for the switch and then this can easily multiply. As we sleep and wait, the function loop needs a final check after exiting the loop if we were successful. Suggested-by: Andrew Lunn Cc: Tobias Waldekranz Fixes: 35da1dfd9484 ("net: dsa: mv88e6xxx: Improve performance of busy bit polling") Signed-off-by: Linus Walleij Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230712223405.861899-1-linus.walleij@linaro.org Signed-off-by: Jakub Kicinski commit 38d88d5e97c9032ebeca092b9372209f2ca92cdf Merge: 864e029fea2b8 e701156ccc6c7 Author: Dave Airlie Date: Fri Jul 14 11:44:54 2023 +1000 Merge tag 'amd-drm-fixes-6.5-2023-07-12' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.5-2023-07-12: amdgpu: - SMU i2c locking fix - Fix a possible deadlock in process restoration for ROCm apps - Disable PCIe lane/speed switching on Intel platforms (the platforms don't support it) Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20230712184009.7740-1-alexander.deucher@amd.com commit 864e029fea2b8e6583e026a6f93e8933ba626d42 Merge: b7a57386b851a 113899c2669df Author: Dave Airlie Date: Fri Jul 14 11:13:14 2023 +1000 Merge tag 'drm-intel-fixes-2023-07-13' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Don't preserve dpll_hw_state for slave crtc in Bigjoiner (Stanislav Lisovskiy) - Consider OA buffer boundary when zeroing out reports [perf] (Umesh Nerlige Ramappa) - Remove dead code from gen8_pte_encode (Tvrtko Ursulin) - Fix one wrong caching mode enum usage (Tvrtko Ursulin) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZK+nHLCltaxoxVw/@tursulin-desk commit b7a57386b851aa28547c0d389644ec77d59cbc23 Merge: 06c2afb862f9d 835a65f51790e Author: Dave Airlie Date: Fri Jul 14 10:37:18 2023 +1000 Merge tag 'drm-misc-fixes-2023-07-13' of ssh://git.freedesktop.org/git/drm/drm-misc into drm-fixes A couple of nouveau patches addressing improving HDMI support and firmware handling, a fix for TTM to skip pinned BO when evicting, and a fix for the fbdev documentation. Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/nq3ke75juephbex5acfyi5t6bxv22nhmfcpfhru55haj2nv3us@gehrlmjbqgjk commit b321c31c9b7b309dcde5e8854b741c8e6a9a05f0 Author: Marc Zyngier Date: Thu Jul 13 08:06:57 2023 +0100 KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption Xiang reports that VMs occasionally fail to boot on GICv4.1 systems when running a preemptible kernel, as it is possible that a vCPU is blocked without requesting a doorbell interrupt. The issue is that any preemption that occurs between vgic_v4_put() and schedule() on the block path will mark the vPE as nonresident and *not* request a doorbell irq. This occurs because when the vcpu thread is resumed on its way to block, vcpu_load() will make the vPE resident again. Once the vcpu actually blocks, we don't request a doorbell anymore, and the vcpu won't be woken up on interrupt delivery. Fix it by tracking that we're entering WFI, and key the doorbell request on that flag. This allows us not to make the vPE resident when going through a preempt/schedule cycle, meaning we don't lose any state. Cc: stable@vger.kernel.org Fixes: 8e01d9a396e6 ("KVM: arm64: vgic-v4: Move the GICv4 residency flow to be driven by vcpu_load/put") Reported-by: Xiang Chen Suggested-by: Zenghui Yu Tested-by: Xiang Chen Co-developed-by: Oliver Upton Signed-off-by: Marc Zyngier Acked-by: Zenghui Yu Link: https://lore.kernel.org/r/20230713070657.3873244-1-maz@kernel.org Signed-off-by: Oliver Upton commit 4b810bf037e524b54669acbe4e0df54b15d87ea1 Merge: b1983d427a539 18bddc5b67038 Author: Linus Torvalds Date: Thu Jul 13 14:35:02 2023 -0700 Merge tag 'erofs-for-6.5-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs fixes from Gao Xiang: "Three patches address regressions related to post-EOF unexpected behaviors and fsdax unavailability of chunk-based regular files. The other two patches mainly get rid of kmap_atomic() and simplify z_erofs_transform_plain(). - Fix two unexpected loop cases when reading beyond EOF - Fix fsdax unavailability for chunk-based regular files - Get rid of the remaining kmap_atomic() - Minor cleanups" * tag 'erofs-for-6.5-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: fix fsdax unavailability for chunk-based regular files erofs: avoid infinite loop in z_erofs_do_read_page() when reading beyond EOF erofs: avoid useless loops in z_erofs_pcluster_readmore() when reading beyond EOF erofs: simplify z_erofs_transform_plain() erofs: get rid of the remaining kmap_atomic() commit b1983d427a53911ea71ba621d4bf994ae22b1536 Merge: ebc27aaceeb9c 9d23aac8a85f6 Author: Linus Torvalds Date: Thu Jul 13 14:21:22 2023 -0700 Merge tag 'net-6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from netfilter, wireless and ebpf. Current release - regressions: - netfilter: conntrack: gre: don't set assured flag for clash entries - wifi: iwlwifi: remove 'use_tfh' config to fix crash Previous releases - regressions: - ipv6: fix a potential refcount underflow for idev - icmp6: ifix null-ptr-deref of ip6_null_entry->rt6i_idev in icmp6_dev() - bpf: fix max stack depth check for async callbacks - eth: mlx5e: - check for NOT_READY flag state after locking - fix page_pool page fragment tracking for XDP - eth: igc: - fix tx hang issue when QBV gate is closed - fix corner cases for TSN offload - eth: octeontx2-af: Move validation of ptp pointer before its usage - eth: ena: fix shift-out-of-bounds in exponential backoff Previous releases - always broken: - core: prevent skb corruption on frag list segmentation - sched: - cls_fw: fix improper refcount update leads to use-after-free - sch_qfq: account for stab overhead in qfq_enqueue - netfilter: - report use refcount overflow - prevent OOB access in nft_byteorder_eval - wifi: mt7921e: fix init command fail with enabled device - eth: ocelot: fix oversize frame dropping for preemptible TCs - eth: fec: recycle pages for transmitted XDP frames" * tag 'net-6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (79 commits) selftests: tc-testing: add test for qfq with stab overhead net/sched: sch_qfq: account for stab overhead in qfq_enqueue selftests: tc-testing: add tests for qfq mtu sanity check net/sched: sch_qfq: reintroduce lmax bound check for MTU wifi: cfg80211: fix receiving mesh packets without RFC1042 header wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set() net: txgbe: fix eeprom calculation error net/sched: make psched_mtu() RTNL-less safe net: ena: fix shift-out-of-bounds in exponential backoff netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write() net/sched: flower: Ensure both minimum and maximum ports are specified MAINTAINERS: Add another mailing list for QUALCOMM ETHQOS ETHERNET DRIVER docs: netdev: update the URL of the status page wifi: iwlwifi: remove 'use_tfh' config to fix crash xdp: use trusted arguments in XDP hints kfuncs bpf: cpumap: Fix memory leak in cpu_map_update_elem wifi: airo: avoid uninitialized warning in airo_get_rate() octeontx2-pf: Add additional check for MCAM rules net: dsa: Removed unneeded of_node_put in felix_parse_ports_node net: fec: use netdev_err_once() instead of netdev_err() ... commit ebc27aaceeb9c4c988dbf321e849fcb75c6b55fa Merge: 15999328946bd d5a821896360c Author: Linus Torvalds Date: Thu Jul 13 13:44:28 2023 -0700 Merge tag 'trace-v6.5-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Fix some missing-prototype warnings - Fix user events struct args (did not include size of struct) When creating a user event, the "struct" keyword is to denote that the size of the field will be passed in. But the parsing failed to handle this case. - Add selftest to struct sizes for user events - Fix sample code for direct trampolines. The sample code for direct trampolines attached to handle_mm_fault(). But the prototype changed and the direct trampoline sample code was not updated. Direct trampolines needs to have the arguments correct otherwise it can fail or crash the system. - Remove unused ftrace_regs_caller_ret() prototype. - Quiet false positive of FORTIFY_SOURCE Due to backward compatibility, the structure used to save stack traces in the kernel had a fixed size of 8. This structure is exported to user space via the tracing format file. A change was made to allow more than 8 functions to be recorded, and user space now uses the size field to know how many functions are actually in the stack. But the structure still has size of 8 (even though it points into the ring buffer that has the required amount allocated to hold a full stack. This was fine until the fortifier noticed that the memcpy(&entry->caller, stack, size) was greater than the 8 functions and would complain at runtime about it. Hide this by using a pointer to the stack location on the ring buffer instead of using the address of the entry structure caller field. - Fix a deadloop in reading trace_pipe that was caused by a mismatch between ring_buffer_empty() returning false which then asked to read the data, but the read code uses rb_num_of_entries() that returned zero, and causing a infinite "retry". - Fix a warning caused by not using all pages allocated to store ftrace functions, where this can happen if the linker inserts a bunch of "NULL" entries, causing the accounting of how many pages needed to be off. - Fix histogram synthetic event crashing when the start event is removed and the end event is still using a variable from it - Fix memory leak in freeing iter->temp in tracing_release_pipe() * tag 'trace-v6.5-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing: Fix memory leak of iter->temp when reading trace_pipe tracing/histograms: Add histograms to hist_vars if they have referenced variables tracing: Stop FORTIFY_SOURCE complaining about stack trace caller ftrace: Fix possible warning on checking all pages used in ftrace_process_locs() ring-buffer: Fix deadloop issue on reading trace_pipe tracing: arm64: Avoid missing-prototype warnings selftests/user_events: Test struct size match cases tracing/user_events: Fix struct arg size match check x86/ftrace: Remove unsued extern declaration ftrace_regs_caller_ret() arm64: ftrace: Add direct call trampoline samples support samples: ftrace: Save required argument registers in sample trampolines commit 15999328946bd778b7bbf57179ee871dd5279b04 Merge: 9350cd0190c0d 21a235bce1236 Author: Linus Torvalds Date: Thu Jul 13 13:39:36 2023 -0700 Merge tag 'for-linus-6.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: - a cleanup of the Xen related ELF-notes - a fix for virtio handling in Xen dom0 when running Xen in a VM * tag 'for-linus-6.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/virtio: Fix NULL deref when a bridge of PCI root bus has no parent x86/Xen: tidy xen-head.S commit 9350cd0190c0d60915ec704112c864d858a0d31c Merge: 0099852f9d732 7c28a35e19faf Author: Linus Torvalds Date: Thu Jul 13 13:34:00 2023 -0700 Merge tag 'sh-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux Pull sh fixes from John Paul Adrian Glaubitz: "The sh updates introduced multiple regressions. In particular, the change a8ac2961148e ("sh: Avoid using IRQ0 on SH3 and SH4") causes several boards to hang during boot due to incorrect IRQ numbers. Geert Uytterhoeven has contributed patches that handle the virq offset in the IRQ code for the dreamcast, highlander and r2d boards while Artur Rojek has contributed a patch which handles the virq offset for the hd64461 companion chip" * tag 'sh-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux: sh: hd64461: Handle virq offset for offchip IRQ base and HD64461 IRQ sh: mach-dreamcast: Handle virq offset in cascaded IRQ demux sh: mach-highlander: Handle virq offset in cascaded IRL demux sh: mach-r2d: Handle virq offset in cascaded IRL demux commit 90b4622954d59078fa0cecad7e7baa48efd006e7 Merge: 5c17f45e91f50 b8f6446b68537 Author: Jens Axboe Date: Thu Jul 13 14:26:38 2023 -0600 Merge tag 'nvme-6.5-2023-07-13' of git://git.infradead.org/nvme into block-6.5 Pull NVMe fixes from Keith: "nvme fixes for Linux 6.5 - Don't require quirk to use duplicate namespace identifiers (Christoph, Sagi) - One more BOGUS_NID quirk (Pankaj) - IO timeout and error hanlding fixes for PCI (Keith) - Enhanced metadata format mask fix (Ankit) - Association race condition fix for fibre channel (Michael) - Correct debugfs error checks (Minjie) - Use PAGE_SECTORS_SHIFT where needed (Damien) - Reduce kernel logs for legacy nguid attribute (Keith) - Use correct dma direction when unmapping metadata (Ming)" * tag 'nvme-6.5-2023-07-13' of git://git.infradead.org/nvme: nvme-pci: fix DMA direction of unmapping integrity data nvme: don't reject probe due to duplicate IDs for single-ported PCIe devices nvme: ensure disabling pairs with unquiesce nvme-fc: fix race between error recovery and creating association nvme-fc: return non-zero status code when fails to create association nvme: fix parameter check in nvme_fault_inject_init() nvme: warn only once for legacy uuid attribute nvme: fix the NVME_ID_NS_NVM_STS_MASK definition nvmet: use PAGE_SECTORS_SHIFT nvme: add BOGUS_NID quirk for Samsung SM953 commit 97368254a08e2ca4766e7f84a45840230fe77fa3 Author: Marijn Suijten Date: Tue Jun 27 22:14:16 2023 +0200 drm/msm/dsi: Drop unused regulators from QCM2290 14nm DSI PHY config The regulator setup was likely copied from other SoCs by mistake. Just like SM6125 the DSI PHY on this platform is not getting power from a regulator but from the MX power domain. Fixes: 572e9fd6d14a ("drm/msm/dsi: Add phy configuration for QCM2290") Signed-off-by: Marijn Suijten Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/544536/ Link: https://lore.kernel.org/r/20230627-sm6125-dpu-v2-1-03e430a2078c@somainline.org Signed-off-by: Abhinav Kumar commit e8b03aef194c3c8597f4fb8e58ade1cc1f43001e Author: Minjie Du Date: Thu Jul 6 11:22:57 2023 +0800 tools: timers: fix freq average calculation Delete a duplicate assignment from this function implementation. The note means ppm is average of the two actual freq samples. But ppm have a duplicate assignment. Signed-off-by: Minjie Du Acked-by: John Stultz Signed-off-by: Shuah Khan commit e8383f5cf1b3573ce140a80bfbfd809278ab16d6 Author: Dmitry Baryshkov Date: Fri Jul 7 22:39:32 2023 +0300 drm/msm/dpu: drop enum dpu_core_perf_data_bus_id Drop the leftover of bus-client -> interconnect conversion, the enum dpu_core_perf_data_bus_id. Fixes: cb88482e2570 ("drm/msm/dpu: clean up references of DPU custom bus scaling") Reviewed-by: Konrad Dybcio Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/546048/ Link: https://lore.kernel.org/r/20230707193942.3806526-2-dmitry.baryshkov@linaro.org Signed-off-by: Abhinav Kumar commit ba7a94ea73120e3f72c4a9b7ed6fd5598d29c069 Author: Jonathan Marek Date: Tue Jul 4 12:01:04 2023 -0400 drm/msm/dpu: add missing flush and fetch bits for DMA4/DMA5 planes Note that with this, DMA4/DMA5 are still non-functional, but at least display *something* in modetest instead of nothing or underflow. Fixes: efcd0107727c ("drm/msm/dpu: add support for SM8550") Signed-off-by: Jonathan Marek Reviewed-by: Abhinav Kumar Tested-by: Neil Armstrong # on SM8550-QRD Patchwork: https://patchwork.freedesktop.org/patch/545548/ Link: https://lore.kernel.org/r/20230704160106.26055-1-jonathan@marek.ca Signed-off-by: Abhinav Kumar commit b33b8731566d50aae6e11bd02921452cf3a7e0e7 Author: Ricardo Cañuelo Date: Thu Jun 29 10:35:46 2023 +0200 selftests/mincore: fix skip condition for check_huge_pages test The check_huge_pages test was failing instead of skipping on qemu-armv7 because the skip condition wasn't handled properly. Add an additional check to fix it. Signed-off-by: Ricardo Cañuelo Reported-by: Naresh Kamboju Reported-by: Linux Kernel Functional Testing Reviewed-by: Muhammad Usama Anjum Tested-by: Anders Roxell Closes: https://lore.kernel.org/all/CA+G9fYuoB8Ug8PcTU-YGmemL7_eeEksXFihvxWF6OikD7sK7pA@mail.gmail.com Signed-off-by: Shuah Khan commit a85c238c5ccd64f8d4c4560702c65cb25dee791c Author: Dmitry Baryshkov Date: Wed Jul 12 15:11:39 2023 +0300 drm/msm/mdss: correct UBWC programming for SM8550 The SM8550 platform employs newer UBWC decoder, which requires slightly different programming. Fixes: a2f33995c19d ("drm/msm: mdss: add support for SM8550") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/546934/ Link: https://lore.kernel.org/r/20230712121145.1994830-3-dmitry.baryshkov@linaro.org Signed-off-by: Abhinav Kumar commit 5c17f45e91f5035c1b317e93b3dfb01088ac2902 Author: Chengming Zhou Date: Mon Jul 10 18:55:16 2023 +0800 blk-mq: fix start_time_ns and alloc_time_ns for pre-allocated rq The iocost rely on rq start_time_ns and alloc_time_ns to tell saturation state of the block device. Most of the time request is allocated after rq_qos_throttle() and its alloc_time_ns or start_time_ns won't be affected. But for plug batched allocation introduced by the commit 47c122e35d7e ("block: pre-allocate requests if plug is started and is a batch"), we can rq_qos_throttle() after the allocation of the request. This is what the blk_mq_get_cached_request() does. In this case, the cached request alloc_time_ns or start_time_ns is much ahead if blocked in any qos ->throttle(). Fix it by setting alloc_time_ns and start_time_ns to now when the allocated request is actually used. Signed-off-by: Chengming Zhou Acked-by: Tejun Heo Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230710105516.2053478-1-chengming.zhou@linux.dev Signed-off-by: Jens Axboe commit 37540db221e1ca94d9a57632238d1a62043205b3 Author: Krzysztof Wilczyński Date: Thu Jul 13 12:18:39 2023 -0500 MAINTAINERS: Add Manivannan Sadhasivam as DesignWare PCIe driver maintainer Manivannan has been actively reviewing patches and testing changes related to the DesignWare core driver and other DWC-based PCIe drivers for a while now. Add Manivannan as a maintainer for the Synopsys DesignWare driver to make his role and contributions official. Thank you Manivannan! For all the help with DWC! Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas Acked-by: Manivannan Sadhasivam commit ec7633de404e7ce704d8f79081b97bca5b616c23 Author: Arnd Bergmann Date: Wed Jun 28 11:49:18 2023 +0200 sparc: mark __arch_xchg() as __always_inline An otherwise correct change to the atomic operations uncovered an existing bug in the sparc __arch_xchg() function, which is calls __xchg_called_with_bad_pointer() when its arguments are unknown at compile time: ERROR: modpost: "__xchg_called_with_bad_pointer" [lib/atomic64_test.ko] undefined! This now happens because gcc determines that it's better to not inline the function. Avoid this by just marking the function as __always_inline to force the compiler to do the right thing here. Reported-by: Guenter Roeck Link: https://lore.kernel.org/all/c525adc9-6623-4660-8718-e0c9311563b8@roeck-us.net/ Fixes: d12157efc8e08 ("locking/atomic: make atomic*_{cmp,}xchg optional") Signed-off-by: Arnd Bergmann Acked-by: Palmer Dabbelt Acked-by: Mark Rutland Reviewed-by: Sam Ravnborg Acked-by: Guenter Roeck Acked-by: Andi Shyti Link: https://lore.kernel.org/r/20230628094938.2318171-1-arnd@kernel.org Signed-off-by: Kees Cook commit e0b7b2081233ac7fe55838ff68cbc7ca9887a91f Author: Kees Cook Date: Wed Jul 12 12:46:29 2023 -0700 MAINTAINERS: Foolishly claim maintainership of string routines Since the string API is tightly coupled with FORTIFY_SOURCE, I am offering myself up as maintainer for it. Thankfully Andy is already a reviewer and can keep me on the straight and narrow. Acked-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230712194625.never.252-kees@kernel.org Signed-off-by: Kees Cook commit 4ed8f337dee32df71435689c19d22e4ee846e15a Author: Masami Hiramatsu (Google) Date: Tue Jul 11 23:15:57 2023 +0900 Revert "tracing: Add "(fault)" name injection to kernel probes" This reverts commit 2e9906f84fc7c99388bb7123ade167250d50f1c0. It was turned out that commit 2e9906f84fc7 ("tracing: Add "(fault)" name injection to kernel probes") did not work correctly and probe events still show just '(fault)' (instead of '"(fault)"'). Also, current '(fault)' is more explicit that it faulted. This also moves FAULT_STRING macro to trace.h so that synthetic event can keep using it, and uses it in trace_probe.c too. Link: https://lore.kernel.org/all/168908495772.123124.1250788051922100079.stgit@devnote2/ Link: https://lore.kernel.org/all/20230706230642.3793a593@rorschach.local.home/ Cc: stable@vger.kernel.org Cc: Andrew Morton Cc: Tom Zanussi Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) commit e38e2c6a9efc435f9de344b7c91f7697e01b47d5 Author: Masami Hiramatsu (Google) Date: Tue Jul 11 23:15:48 2023 +0900 tracing/probes: Fix to update dynamic data counter if fetcharg uses it Fix to update dynamic data counter ('dyndata') and max length ('maxlen') only if the fetcharg uses the dynamic data. Also get out arg->dynamic from unlikely(). This makes dynamic data address wrong if process_fetch_insn() returns error on !arg->dynamic case. Link: https://lore.kernel.org/all/168908494781.123124.8160245359962103684.stgit@devnote2/ Suggested-by: Steven Rostedt Link: https://lore.kernel.org/all/20230710233400.5aaf024e@gandalf.local.home/ Fixes: 9178412ddf5a ("tracing: probeevent: Return consumed bytes of dynamic area") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) commit b41326b5e0f82e93592c4366359917b5d67b529f Author: Masami Hiramatsu (Google) Date: Tue Jul 11 23:15:38 2023 +0900 tracing/probes: Fix not to count error code to total length Fix not to count the error code (which is minus value) to the total used length of array, because it can mess up the return code of process_fetch_insn_bottom(). Also clear the 'ret' value because it will be used for calculating next data_loc entry. Link: https://lore.kernel.org/all/168908493827.123124.2175257289106364229.stgit@devnote2/ Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/8819b154-2ba1-43c3-98a2-cbde20892023@moroto.mountain/ Fixes: 9b960a38835f ("tracing: probeevent: Unify fetch_insn processing common part") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) commit 66bcf65d6cf0ca6540e2341e88ee7ef02dbdda08 Author: Masami Hiramatsu (Google) Date: Tue Jul 11 23:15:29 2023 +0900 tracing/probes: Fix to avoid double count of the string length on the array If an array is specified with the ustring or symstr, the length of the strings are accumlated on both of 'ret' and 'total', which means the length is double counted. Just set the length to the 'ret' value for avoiding double counting. Link: https://lore.kernel.org/all/168908492917.123124.15076463491122036025.stgit@devnote2/ Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/8819b154-2ba1-43c3-98a2-cbde20892023@moroto.mountain/ Fixes: 88903c464321 ("tracing/probe: Add ustring type for user-space string") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) commit d5f28bb1ce04636b285726ee2a5afa3a514025f4 Author: Masami Hiramatsu (Google) Date: Sat Jul 8 01:38:03 2023 +0900 fprobes: Add a comment why fprobe_kprobe_handler exits if kprobe is running Add a comment the reason why fprobe_kprobe_handler() exits if any other kprobe is running. Link: https://lore.kernel.org/all/168874788299.159442.2485957441413653858.stgit@devnote2/ Suggested-by: Steven Rostedt Link: https://lore.kernel.org/all/20230706120916.3c6abf15@gandalf.local.home/ Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) commit b8f6446b6853768cb99e7c201bddce69ca60c15e Author: Ming Lei Date: Thu Jul 13 17:26:20 2023 +0800 nvme-pci: fix DMA direction of unmapping integrity data DMA direction should be taken in dma_unmap_page() for unmapping integrity data. Fix this DMA direction, and reported in Guangwu's test. Reported-by: Guangwu Zhang Fixes: 4aedb705437f ("nvme-pci: split metadata handling from nvme_map_data / nvme_unmap_data") Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit ac522fc6c3165fd0daa2f8da7e07d5f800586daa Author: Christoph Hellwig Date: Thu Jul 13 15:30:42 2023 +0200 nvme: don't reject probe due to duplicate IDs for single-ported PCIe devices While duplicate IDs are still very harmful, including the potential to easily see changing devices in /dev/disk/by-id, it turn out they are extremely common for cheap end user NVMe devices. Relax our check for them for so that it doesn't reject the probe on single-ported PCIe devices, but prints a big warning instead. In doubt we'd still like to see quirk entries to disable the potential for changing supposed stable device identifier links, but this will at least allow users how have two (or more) of these devices to use them without having to manually add a new PCI ID entry with the quirk through sysfs or by patching the kernel. Fixes: 2079f41ec6ff ("nvme: check that EUI/GUID/UUID are globally unique") Cc: stable@vger.kernel.org # 6.0+ Co-developed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Keith Busch commit d5a821896360cc8b93a15bd888fabc858c038dc0 Author: Zheng Yejian Date: Thu Jul 13 22:14:35 2023 +0800 tracing: Fix memory leak of iter->temp when reading trace_pipe kmemleak reports: unreferenced object 0xffff88814d14e200 (size 256): comm "cat", pid 336, jiffies 4294871818 (age 779.490s) hex dump (first 32 bytes): 04 00 01 03 00 00 00 00 08 00 00 00 00 00 00 00 ................ 0c d8 c8 9b ff ff ff ff 04 5a ca 9b ff ff ff ff .........Z...... backtrace: [] __kmalloc+0x4f/0x140 [] trace_find_next_entry+0xbb/0x1d0 [] trace_print_lat_context+0xaf/0x4e0 [] print_trace_line+0x3e0/0x950 [] tracing_read_pipe+0x2d9/0x5a0 [] vfs_read+0x143/0x520 [] ksys_read+0xbd/0x160 [] do_syscall_64+0x3f/0x90 [] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 when reading file 'trace_pipe', 'iter->temp' is allocated or relocated in trace_find_next_entry() but not freed before 'trace_pipe' is closed. To fix it, free 'iter->temp' in tracing_release_pipe(). Link: https://lore.kernel.org/linux-trace-kernel/20230713141435.1133021-1-zhengyejian1@huawei.com Cc: stable@vger.kernel.org Fixes: ff895103a84ab ("tracing: Save off entry when peeking at next entry") Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit 2329cc7a101af1a844fbf706c0724c0baea38365 Author: Jocelyn Falempe Date: Tue Jul 11 11:20:44 2023 +0200 drm/client: Fix memory leak in drm_client_modeset_probe When a new mode is set to modeset->mode, the previous mode should be freed. This fixes the following kmemleak report: drm_mode_duplicate+0x45/0x220 [drm] drm_client_modeset_probe+0x944/0xf50 [drm] __drm_fb_helper_initial_config_and_unlock+0xb4/0x2c0 [drm_kms_helper] drm_fbdev_client_hotplug+0x2bc/0x4d0 [drm_kms_helper] drm_client_register+0x169/0x240 [drm] ast_pci_probe+0x142/0x190 [ast] local_pci_probe+0xdc/0x180 work_for_cpu_fn+0x4e/0xa0 process_one_work+0x8b7/0x1540 worker_thread+0x70a/0xed0 kthread+0x29f/0x340 ret_from_fork+0x1f/0x30 cc: Reported-by: Zhang Yi Signed-off-by: Jocelyn Falempe Reviewed-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230711092203.68157-3-jfalempe@redhat.com commit c2a88e8bdf5f6239948d75283d0ae7e0c7945b03 Author: Jocelyn Falempe Date: Tue Jul 11 11:20:43 2023 +0200 drm/client: Fix memory leak in drm_client_target_cloned dmt_mode is allocated and never freed in this function. It was found with the ast driver, but most drivers using generic fbdev setup are probably affected. This fixes the following kmemleak report: backtrace: [<00000000b391296d>] drm_mode_duplicate+0x45/0x220 [drm] [<00000000e45bb5b3>] drm_client_target_cloned.constprop.0+0x27b/0x480 [drm] [<00000000ed2d3a37>] drm_client_modeset_probe+0x6bd/0xf50 [drm] [<0000000010e5cc9d>] __drm_fb_helper_initial_config_and_unlock+0xb4/0x2c0 [drm_kms_helper] [<00000000909f82ca>] drm_fbdev_client_hotplug+0x2bc/0x4d0 [drm_kms_helper] [<00000000063a69aa>] drm_client_register+0x169/0x240 [drm] [<00000000a8c61525>] ast_pci_probe+0x142/0x190 [ast] [<00000000987f19bb>] local_pci_probe+0xdc/0x180 [<000000004fca231b>] work_for_cpu_fn+0x4e/0xa0 [<0000000000b85301>] process_one_work+0x8b7/0x1540 [<000000003375b17c>] worker_thread+0x70a/0xed0 [<00000000b0d43cd9>] kthread+0x29f/0x340 [<000000008d770833>] ret_from_fork+0x1f/0x30 unreferenced object 0xff11000333089a00 (size 128): cc: Fixes: 1d42bbc8f7f9 ("drm/fbdev: fix cloning on fbcon") Reported-by: Zhang Yi Signed-off-by: Jocelyn Falempe Reviewed-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230711092203.68157-2-jfalempe@redhat.com commit d42334578eba1390859012ebb91e1e556d51db49 Author: Namjae Jeon Date: Thu Jul 13 21:59:37 2023 +0900 exfat: check if filename entries exceeds max filename length exfat_extract_uni_name copies characters from a given file name entry into the 'uniname' variable. This variable is actually defined on the stack of the exfat_readdir() function. According to the definition of the 'exfat_uni_name' type, the file name should be limited 255 characters (+ null teminator space), but the exfat_get_uniname_from_ext_entry() function can write more characters because there is no check if filename entries exceeds max filename length. This patch add the check not to copy filename characters when exceeding max filename length. Cc: stable@vger.kernel.org Cc: Yuezhang Mo Reported-by: Maxim Suhanov Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit d088d6b648f47fc63e0f1d429c6eaddb426623a4 Author: Sudeep Holla Date: Thu Jul 6 09:55:34 2023 +0100 arm64: dts: arm: Remove the dangling vexpress-v2m-rs1.dtsi symlink Commit 724ba6751532 ("ARM: dts: Move .dts files to vendor sub-directories") moved all arm vendor specific DTS into the sub-directory and updated vexpress-v2f-1xv7-ca53x2.dts accordingly to include vexpress-v2m-rs1.dtsi from the right path. However the symlink was left dangling which is harmless and causes no issue for the build. Just remove the dangling symlink now that it is noticed and reported. Fixes: 724ba6751532 ("ARM: dts: Move .dts files to vendor sub-directories") Cc: Liviu Dudau Cc: Lorenzo Pieralisi Cc: Rob Herring Reported-by: Avram Lubkin Reported-by: Darren Kenny Acked-by: Liviu Dudau Link: https://lore.kernel.org/r/20230706085534.300828-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit a282a2f10539dce2aa619e71e1817570d557fc97 Author: Ilya Dryomov Date: Mon Jul 10 20:39:29 2023 +0200 libceph: harden msgr2.1 frame segment length checks ceph_frame_desc::fd_lens is an int array. decode_preamble() thus effectively casts u32 -> int but the checks for segment lengths are written as if on unsigned values. While reading in HELLO or one of the AUTH frames (before authentication is completed), arithmetic in head_onwire_len() can get duped by negative ctrl_len and produce head_len which is less than CEPH_PREAMBLE_LEN but still positive. This would lead to a buffer overrun in prepare_read_control() as the preamble gets copied to the newly allocated buffer of size head_len. Cc: stable@vger.kernel.org Fixes: cd1a677cad99 ("libceph, ceph: implement msgr2.1 protocol (crc and secure modes)") Reported-by: Thelford Williams Signed-off-by: Ilya Dryomov Reviewed-by: Xiubo Li commit d44263222134b5635932974c6177a5cba65a07e8 Author: Sergei Antonov Date: Tue Jun 27 15:05:49 2023 +0300 mmc: moxart: read scr register without changing byte order Conversion from big-endian to native is done in a common function mmc_app_send_scr(). Converting in moxart_transfer_pio() is extra. Double conversion on a LE system returns an incorrect SCR value, leads to errors: mmc0: unrecognised SCR structure version 8 Fixes: 1b66e94e6b99 ("mmc: moxart: Add MOXA ART SD/MMC driver") Signed-off-by: Sergei Antonov Cc: Jonas Jensen Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230627120549.2400325-1-saproj@gmail.com Signed-off-by: Ulf Hansson commit 55b87b74996383230586f4f9f801ae304c70e649 Author: Marc Zyngier Date: Mon Jul 3 14:04:16 2023 +0100 arm64: Fix HFGxTR_EL2 field naming The HFGxTR_EL2 fields do not always follow the naming described in the spec, nor do they match the name of the register they trap in the rest of the kernel. It is a bit sad that they were written by hand despite the availability of a machine readable version... Fixes: cc077e7facbe ("arm64/sysreg: Convert HFG[RW]TR_EL2 to automatic generation") Signed-off-by: Marc Zyngier Cc: Mark Brown Cc: Will Deacon Cc: Catalin Marinas Cc: Mark Rutland Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20230703130416.1495307-1-maz@kernel.org Signed-off-by: Will Deacon commit 9d23aac8a85f69239e585c8656c6fdb21be65695 Merge: b0b0ab6f01318 137f6219da599 Author: Paolo Abeni Date: Thu Jul 13 11:12:01 2023 +0200 Merge branch 'net-sched-fixes-for-sch_qfq' Pedro Tammela says: ==================== net/sched: fixes for sch_qfq Patch 1 fixes a regression introduced in 6.4 where the MTU size could be bigger than 'lmax'. Patch 3 fixes an issue where the code doesn't account for qdisc_pkt_len() returning a size bigger then 'lmax'. Patches 2 and 4 are selftests for the issues above. ==================== Link: https://lore.kernel.org/r/20230711210103.597831-1-pctammela@mojatatu.com Signed-off-by: Paolo Abeni commit 137f6219da59903f480a9032b01225e9062f7ae0 Author: Pedro Tammela Date: Tue Jul 11 18:01:03 2023 -0300 selftests: tc-testing: add test for qfq with stab overhead A packet with stab overhead greater than QFQ_MAX_LMAX should be dropped by the QFQ qdisc as it can't handle such lengths. Signed-off-by: Jamal Hadi Salim Signed-off-by: Pedro Tammela Reviewed-by: Simon Horman Tested-by: Zhengchao Shao Signed-off-by: Paolo Abeni commit 3e337087c3b5805fe0b8a46ba622a962880b5d64 Author: Pedro Tammela Date: Tue Jul 11 18:01:02 2023 -0300 net/sched: sch_qfq: account for stab overhead in qfq_enqueue Lion says: ------- In the QFQ scheduler a similar issue to CVE-2023-31436 persists. Consider the following code in net/sched/sch_qfq.c: static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free) { unsigned int len = qdisc_pkt_len(skb), gso_segs; // ... if (unlikely(cl->agg->lmax < len)) { pr_debug("qfq: increasing maxpkt from %u to %u for class %u", cl->agg->lmax, len, cl->common.classid); err = qfq_change_agg(sch, cl, cl->agg->class_weight, len); if (err) { cl->qstats.drops++; return qdisc_drop(skb, sch, to_free); } // ... } Similarly to CVE-2023-31436, "lmax" is increased without any bounds checks according to the packet length "len". Usually this would not impose a problem because packet sizes are naturally limited. This is however not the actual packet length, rather the "qdisc_pkt_len(skb)" which might apply size transformations according to "struct qdisc_size_table" as created by "qdisc_get_stab()" in net/sched/sch_api.c if the TCA_STAB option was set when modifying the qdisc. A user may choose virtually any size using such a table. As a result the same issue as in CVE-2023-31436 can occur, allowing heap out-of-bounds read / writes in the kmalloc-8192 cache. ------- We can create the issue with the following commands: tc qdisc add dev $DEV root handle 1: stab mtu 2048 tsize 512 mpu 0 \ overhead 999999999 linklayer ethernet qfq tc class add dev $DEV parent 1: classid 1:1 htb rate 6mbit burst 15k tc filter add dev $DEV parent 1: matchall classid 1:1 ping -I $DEV 1.1.1.2 This is caused by incorrectly assuming that qdisc_pkt_len() returns a length within the QFQ_MIN_LMAX < len < QFQ_MAX_LMAX. Fixes: 462dbc9101ac ("pkt_sched: QFQ Plus: fair-queueing service at DRR cost") Reported-by: Lion Reviewed-by: Eric Dumazet Signed-off-by: Jamal Hadi Salim Signed-off-by: Pedro Tammela Reviewed-by: Simon Horman Signed-off-by: Paolo Abeni commit c5a06fdc618d1d262fa0db3483f096936961588c Author: Pedro Tammela Date: Tue Jul 11 18:01:01 2023 -0300 selftests: tc-testing: add tests for qfq mtu sanity check QFQ only supports a certain bound of MTU size so make sure we check for this requirement in the tests. Acked-by: Jamal Hadi Salim Signed-off-by: Pedro Tammela Reviewed-by: Simon Horman Tested-by: Zhengchao Shao Signed-off-by: Paolo Abeni commit 158810b261d02fc7dd92ca9c392d8f8a211a2401 Author: Pedro Tammela Date: Tue Jul 11 18:01:00 2023 -0300 net/sched: sch_qfq: reintroduce lmax bound check for MTU 25369891fcef deletes a check for the case where no 'lmax' is specified which 3037933448f6 previously fixed as 'lmax' could be set to the device's MTU without any bound checking for QFQ_LMAX_MIN and QFQ_LMAX_MAX. Therefore, reintroduce the check. Fixes: 25369891fcef ("net/sched: sch_qfq: refactor parsing of netlink parameters") Acked-by: Jamal Hadi Salim Reviewed-by: Eric Dumazet Signed-off-by: Pedro Tammela Reviewed-by: Simon Horman Signed-off-by: Paolo Abeni commit 7c28a35e19fafa1d3b367bcd3ec4021427a9397b Author: Artur Rojek Date: Tue Jul 11 01:31:32 2023 +0200 sh: hd64461: Handle virq offset for offchip IRQ base and HD64461 IRQ A recent change to start counting SuperH IRQ #s from 16 breaks support for the Hitachi HD64461 companion chip. Move the offchip IRQ base and HD64461 IRQ # by 16 in order to accommodate for the new virq numbering rules. Fixes: a8ac2961148e ("sh: Avoid using IRQ0 on SH3 and SH4") Signed-off-by: Artur Rojek Reviewed-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230710233132.69734-1-contact@artur-rojek.eu Signed-off-by: John Paul Adrian Glaubitz commit 3d20f7a6eb76afdf9d4ad9cb864c2e2da9c38e1f Author: Geert Uytterhoeven Date: Sun Jul 9 15:10:43 2023 +0200 sh: mach-dreamcast: Handle virq offset in cascaded IRQ demux Take into account the virq offset when translating cascaded interrupts. Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4") Signed-off-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/7d0cb246c9f1cd24bb1f637ec5cb67e799a4c3b8.1688908227.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz commit a2601b8d8f077368c6d113b4d496559415c6d495 Author: Geert Uytterhoeven Date: Sun Jul 9 15:10:23 2023 +0200 sh: mach-highlander: Handle virq offset in cascaded IRL demux Take into account the virq offset when translating cascaded IRL interrupts. Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4") Signed-off-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/4fcb0d08a2b372431c41e04312742dc9e41e1be4.1688908186.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz commit ab8aa4f0956d2e0fb8344deadb823ef743581795 Author: Geert Uytterhoeven Date: Sun Jul 9 13:15:49 2023 +0200 sh: mach-r2d: Handle virq offset in cascaded IRL demux When booting rts7751r2dplus_defconfig on QEMU, the system hangs due to an interrupt storm on IRQ 20. IRQ 20 aka event 0x280 is a cascaded IRL interrupt, which maps to IRQ_VOYAGER, the interrupt used by the Silicon Motion SM501 multimedia companion chip. As rts7751r2d_irq_demux() does not take into account the new virq offset, the interrupt is no longer translated, leading to an unhandled interrupt. Fix this by taking into account the virq offset when translating cascaded IRL interrupts. Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4") Reported-by: Guenter Roeck Closes: https://lore.kernel.org/r/fbfea3ad-d327-4ad5-ac9c-648c7ca3fe1f@roeck-us.net Signed-off-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Tested-by: John Paul Adrian Glaubitz Tested-by: Guenter Roeck Link: https://lore.kernel.org/r/2c99d5df41c40691f6c407b7b6a040d406bc81ac.1688901306.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz commit 645e583d2689a1dd2163da28a7789b4d9febf316 Author: Colin Ian King Date: Wed Jul 12 15:01:22 2023 +0100 selftests: ALSA: Fix fclose on an already fclosed file pointer In the case where a sysfs file cannot be opened the error return path fcloses file pointer fpl, however, fpl has already been closed in the previous stanza. Fix the double fclose by removing it. Fixes: 10b98a4db11a ("selftests: ALSA: Add test for the 'pcmtest' driver") Signed-off-by: Colin Ian King Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20230712140122.457206-1-colin.i.king@gmail.com Signed-off-by: Takashi Iwai commit 7891d0a5ce6f627132d3068ba925cf86f29008b1 Author: Dan Carpenter Date: Tue Jun 27 08:42:10 2023 +0300 soundwire: amd: Fix a check for errors in probe() This code has two problems: 1) The devm_ioremap() function returns NULL, not error pointers. 2) It's checking the wrong variable. ->mmio instead of ->acp_mmio. Fixes: d8f48fbdfd9a ("soundwire: amd: Add support for AMD Manager driver") Suggested-by: "Mukunda,Vijendar" Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/9863b2bf-0de2-4bf8-8f09-fe24dc5c63ff@moroto.mountain Signed-off-by: Vinod Koul commit bf99f6be2d20146942bce6f9e90a0ceef12cbc1e Author: Paulo Alcantara Date: Tue Jul 11 14:15:10 2023 -0300 smb: client: fix missed ses refcounting Use new cifs_smb_ses_inc_refcount() helper to get an active reference of @ses and @ses->dfs_root_ses (if set). This will prevent @ses->dfs_root_ses of being put in the next call to cifs_put_smb_ses() and thus potentially causing an use-after-free bug. Fixes: 8e3554150d6c ("cifs: fix sharing of DFS connections") Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit f1f047bd7ce0d73788e04ac02268060a565f7ecb Author: Gustavo A. R. Silva Date: Tue Jul 11 17:12:31 2023 -0600 smb: client: Fix -Wstringop-overflow issues pSMB->hdr.Protocol is an array of size 4 bytes, hence when the compiler analyzes this line of code parm_data = ((char *) &pSMB->hdr.Protocol) + offset; it legitimately complains about the fact that offset points outside the bounds of the array. Notice that the compiler gives priority to the object as an array, rather than merely the address of one more byte in a structure to wich offset should be added (which seems to be the actual intention of the original implementation). Fix this by explicitly instructing the compiler to treat the code as a sequence of bytes in struct smb_com_transaction2_spi_req, and not as an array accessed through pointer notation. Notice that ((char *)pSMB) + sizeof(pSMB->hdr.smb_buf_length) points to the same address as ((char *) &pSMB->hdr.Protocol), therefore this results in no differences in binary output. Fixes the following -Wstringop-overflow warnings when built s390 architecture with defconfig (GCC 13): CC [M] fs/smb/client/cifssmb.o In function 'cifs_init_ace', inlined from 'posix_acl_to_cifs' at fs/smb/client/cifssmb.c:3046:3, inlined from 'cifs_do_set_acl' at fs/smb/client/cifssmb.c:3191:15: fs/smb/client/cifssmb.c:2987:31: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 2987 | cifs_ace->cifs_e_perm = local_ace->e_perm; | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ In file included from fs/smb/client/cifssmb.c:27: fs/smb/client/cifspdu.h: In function 'cifs_do_set_acl': fs/smb/client/cifspdu.h:384:14: note: at offset [7, 11] into destination object 'Protocol' of size 4 384 | __u8 Protocol[4]; | ^~~~~~~~ In function 'cifs_init_ace', inlined from 'posix_acl_to_cifs' at fs/smb/client/cifssmb.c:3046:3, inlined from 'cifs_do_set_acl' at fs/smb/client/cifssmb.c:3191:15: fs/smb/client/cifssmb.c:2988:30: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 2988 | cifs_ace->cifs_e_tag = local_ace->e_tag; | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ fs/smb/client/cifspdu.h: In function 'cifs_do_set_acl': fs/smb/client/cifspdu.h:384:14: note: at offset [6, 10] into destination object 'Protocol' of size 4 384 | __u8 Protocol[4]; | ^~~~~~~~ This helps with the ongoing efforts to globally enable -Wstringop-overflow. Link: https://github.com/KSPP/linux/issues/310 Fixes: dc1af4c4b472 ("cifs: implement set acl method") Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Steve French commit b0b0ab6f013185f25ad0fcd9111802d92d1631dc Merge: fec3ebb5ed299 2e06c57d66d3f Author: Jakub Kicinski Date: Wed Jul 12 18:13:57 2023 -0700 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Alexei Starovoitov says: ==================== pull-request: bpf 2023-07-12 We've added 5 non-merge commits during the last 7 day(s) which contain a total of 7 files changed, 93 insertions(+), 28 deletions(-). The main changes are: 1) Fix max stack depth check for async callbacks, from Kumar. 2) Fix inconsistent JIT image generation, from Björn. 3) Use trusted arguments in XDP hints kfuncs, from Larysa. 4) Fix memory leak in cpu_map_update_elem, from Pu. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: xdp: use trusted arguments in XDP hints kfuncs bpf: cpumap: Fix memory leak in cpu_map_update_elem riscv, bpf: Fix inconsistent JIT image generation selftests/bpf: Add selftest for check_stack_max_depth bug bpf: Fix max stack depth check for async callbacks ==================== Link: https://lore.kernel.org/r/20230712223045.40182-1-alexei.starovoitov@gmail.com Signed-off-by: Jakub Kicinski commit fec3ebb5ed299ac3a998f011c380f2ded47f4866 Author: Felix Fietkau Date: Tue Jul 11 13:50:52 2023 +0200 wifi: cfg80211: fix receiving mesh packets without RFC1042 header Fix ethernet header length field after stripping the mesh header Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/CT5GNZSK28AI.2K6M69OXM9RW5@syracuse/ Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces") Reported-and-tested-by: Nicolas Escande Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20230711115052.68430-1-nbd@nbd.name Signed-off-by: Jakub Kicinski commit 4f4626cd049576af1276c7568d5b44eb3f7bb1b1 Author: Zhang Shurong Date: Thu Jul 6 10:45:00 2023 +0800 wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set() If there is a failure during rtw89_fw_h2c_raw() rtw89_debug_priv_send_h2c should return negative error code instead of a positive value count. Fix this bug by returning correct error code. Fixes: e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver") Signed-off-by: Zhang Shurong Acked-by: Ping-Ke Shih Link: https://lore.kernel.org/r/tencent_AD09A61BC4DA92AD1EB0790F5C850E544D07@qq.com Signed-off-by: Jakub Kicinski commit aa846677a9fb19a0f2c58154c140398aa92a87ba Author: Jiawen Wu Date: Tue Jul 11 14:34:14 2023 +0800 net: txgbe: fix eeprom calculation error For some device types like TXGBE_ID_XAUI, *checksum computed in txgbe_calc_eeprom_checksum() is larger than TXGBE_EEPROM_SUM. Remove the limit on the size of *checksum. Fixes: 049fe5365324 ("net: txgbe: Add operations to interact with firmware") Fixes: 5e2ea7801fac ("net: txgbe: Fix unsigned comparison to zero in txgbe_calc_eeprom_checksum()") Signed-off-by: Jiawen Wu Link: https://lore.kernel.org/r/20230711063414.3311-1-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski commit 0099852f9d7322890636503146f303b41cd8663e Merge: eb26cbb1a754c dceaafd668812 Author: Linus Torvalds Date: Wed Jul 12 16:28:53 2023 -0700 Merge tag 'for-linus' of https://github.com/openrisc/linux Pull OpenRISC fix from Stafford Horne: - During the 6.4 cycle my fpu support work broke ABI compatibility in the sigcontext struct. This was noticed by musl libc developers after the release. This fix restores the ABI. * tag 'for-linus' of https://github.com/openrisc/linux: openrisc: Union fpcsr and oldmask in sigcontext to unbreak userspace ABI commit 6018b585e8c6fa7d85d4b38d9ce49a5b67be7078 Author: Mohamed Khalfella Date: Wed Jul 12 22:30:21 2023 +0000 tracing/histograms: Add histograms to hist_vars if they have referenced variables Hist triggers can have referenced variables without having direct variables fields. This can be the case if referenced variables are added for trigger actions. In this case the newly added references will not have field variables. Not taking such referenced variables into consideration can result in a bug where it would be possible to remove hist trigger with variables being refenced. This will result in a bug that is easily reproducable like so $ cd /sys/kernel/tracing $ echo 'synthetic_sys_enter char[] comm; long id' >> synthetic_events $ echo 'hist:keys=common_pid.execname,id.syscall:vals=hitcount:comm=common_pid.execname' >> events/raw_syscalls/sys_enter/trigger $ echo 'hist:keys=common_pid.execname,id.syscall:onmatch(raw_syscalls.sys_enter).synthetic_sys_enter($comm, id)' >> events/raw_syscalls/sys_enter/trigger $ echo '!hist:keys=common_pid.execname,id.syscall:vals=hitcount:comm=common_pid.execname' >> events/raw_syscalls/sys_enter/trigger [ 100.263533] ================================================================== [ 100.264634] BUG: KASAN: slab-use-after-free in resolve_var_refs+0xc7/0x180 [ 100.265520] Read of size 8 at addr ffff88810375d0f0 by task bash/439 [ 100.266320] [ 100.266533] CPU: 2 PID: 439 Comm: bash Not tainted 6.5.0-rc1 #4 [ 100.267277] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-20220807_005459-localhost 04/01/2014 [ 100.268561] Call Trace: [ 100.268902] [ 100.269189] dump_stack_lvl+0x4c/0x70 [ 100.269680] print_report+0xc5/0x600 [ 100.270165] ? resolve_var_refs+0xc7/0x180 [ 100.270697] ? kasan_complete_mode_report_info+0x80/0x1f0 [ 100.271389] ? resolve_var_refs+0xc7/0x180 [ 100.271913] kasan_report+0xbd/0x100 [ 100.272380] ? resolve_var_refs+0xc7/0x180 [ 100.272920] __asan_load8+0x71/0xa0 [ 100.273377] resolve_var_refs+0xc7/0x180 [ 100.273888] event_hist_trigger+0x749/0x860 [ 100.274505] ? kasan_save_stack+0x2a/0x50 [ 100.275024] ? kasan_set_track+0x29/0x40 [ 100.275536] ? __pfx_event_hist_trigger+0x10/0x10 [ 100.276138] ? ksys_write+0xd1/0x170 [ 100.276607] ? do_syscall_64+0x3c/0x90 [ 100.277099] ? entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 100.277771] ? destroy_hist_data+0x446/0x470 [ 100.278324] ? event_hist_trigger_parse+0xa6c/0x3860 [ 100.278962] ? __pfx_event_hist_trigger_parse+0x10/0x10 [ 100.279627] ? __kasan_check_write+0x18/0x20 [ 100.280177] ? mutex_unlock+0x85/0xd0 [ 100.280660] ? __pfx_mutex_unlock+0x10/0x10 [ 100.281200] ? kfree+0x7b/0x120 [ 100.281619] ? ____kasan_slab_free+0x15d/0x1d0 [ 100.282197] ? event_trigger_write+0xac/0x100 [ 100.282764] ? __kasan_slab_free+0x16/0x20 [ 100.283293] ? __kmem_cache_free+0x153/0x2f0 [ 100.283844] ? sched_mm_cid_remote_clear+0xb1/0x250 [ 100.284550] ? __pfx_sched_mm_cid_remote_clear+0x10/0x10 [ 100.285221] ? event_trigger_write+0xbc/0x100 [ 100.285781] ? __kasan_check_read+0x15/0x20 [ 100.286321] ? __bitmap_weight+0x66/0xa0 [ 100.286833] ? _find_next_bit+0x46/0xe0 [ 100.287334] ? task_mm_cid_work+0x37f/0x450 [ 100.287872] event_triggers_call+0x84/0x150 [ 100.288408] trace_event_buffer_commit+0x339/0x430 [ 100.289073] ? ring_buffer_event_data+0x3f/0x60 [ 100.292189] trace_event_raw_event_sys_enter+0x8b/0xe0 [ 100.295434] syscall_trace_enter.constprop.0+0x18f/0x1b0 [ 100.298653] syscall_enter_from_user_mode+0x32/0x40 [ 100.301808] do_syscall_64+0x1a/0x90 [ 100.304748] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 100.307775] RIP: 0033:0x7f686c75c1cb [ 100.310617] Code: 73 01 c3 48 8b 0d 65 3c 10 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 21 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 35 3c 10 00 f7 d8 64 89 01 48 [ 100.317847] RSP: 002b:00007ffc60137a38 EFLAGS: 00000246 ORIG_RAX: 0000000000000021 [ 100.321200] RAX: ffffffffffffffda RBX: 000055f566469ea0 RCX: 00007f686c75c1cb [ 100.324631] RDX: 0000000000000001 RSI: 0000000000000001 RDI: 000000000000000a [ 100.328104] RBP: 00007ffc60137ac0 R08: 00007f686c818460 R09: 000000000000000a [ 100.331509] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000009 [ 100.334992] R13: 0000000000000007 R14: 000000000000000a R15: 0000000000000007 [ 100.338381] We hit the bug because when second hist trigger has was created has_hist_vars() returned false because hist trigger did not have variables. As a result of that save_hist_vars() was not called to add the trigger to trace_array->hist_vars. Later on when we attempted to remove the first histogram find_any_var_ref() failed to detect it is being used because it did not find the second trigger in hist_vars list. With this change we wait until trigger actions are created so we can take into consideration if hist trigger has variable references. Also, now we check the return value of save_hist_vars() and fail trigger creation if save_hist_vars() fails. Link: https://lore.kernel.org/linux-trace-kernel/20230712223021.636335-1-mkhalfella@purestorage.com Cc: stable@vger.kernel.org Fixes: 067fe038e70f6 ("tracing: Add variable reference handling to hist triggers") Signed-off-by: Mohamed Khalfella Signed-off-by: Steven Rostedt (Google) commit 150e33e62c1fa4af5aaab02776b6c3812711d478 Author: Pedro Tammela Date: Mon Jul 10 23:16:34 2023 -0300 net/sched: make psched_mtu() RTNL-less safe Eric Dumazet says[1]: ------- Speaking of psched_mtu(), I see that net/sched/sch_pie.c is using it without holding RTNL, so dev->mtu can be changed underneath. KCSAN could issue a warning. ------- Annotate dev->mtu with READ_ONCE() so KCSAN don't issue a warning. [1] https://lore.kernel.org/all/CANn89iJoJO5VtaJ-2=_d2aOQhb0Xw8iBT_Cxqp2HyuS-zj6azw@mail.gmail.com/ v1 -> v2: Fix commit message Fixes: d4b36210c2e6 ("net: pkt_sched: PIE AQM scheme") Suggested-by: Eric Dumazet Signed-off-by: Pedro Tammela Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230711021634.561598-1-pctammela@mojatatu.com Signed-off-by: Jakub Kicinski commit 1e9cb763e9bacf0c932aa948f50dcfca6f519a26 Author: Krister Johansen Date: Mon Jul 10 18:36:21 2023 -0700 net: ena: fix shift-out-of-bounds in exponential backoff The ENA adapters on our instances occasionally reset. Once recently logged a UBSAN failure to console in the process: UBSAN: shift-out-of-bounds in build/linux/drivers/net/ethernet/amazon/ena/ena_com.c:540:13 shift exponent 32 is too large for 32-bit type 'unsigned int' CPU: 28 PID: 70012 Comm: kworker/u72:2 Kdump: loaded not tainted 5.15.117 Hardware name: Amazon EC2 c5d.9xlarge/, BIOS 1.0 10/16/2017 Workqueue: ena ena_fw_reset_device [ena] Call Trace: dump_stack_lvl+0x4a/0x63 dump_stack+0x10/0x16 ubsan_epilogue+0x9/0x36 __ubsan_handle_shift_out_of_bounds.cold+0x61/0x10e ? __const_udelay+0x43/0x50 ena_delay_exponential_backoff_us.cold+0x16/0x1e [ena] wait_for_reset_state+0x54/0xa0 [ena] ena_com_dev_reset+0xc8/0x110 [ena] ena_down+0x3fe/0x480 [ena] ena_destroy_device+0xeb/0xf0 [ena] ena_fw_reset_device+0x30/0x50 [ena] process_one_work+0x22b/0x3d0 worker_thread+0x4d/0x3f0 ? process_one_work+0x3d0/0x3d0 kthread+0x12a/0x150 ? set_kthread_struct+0x50/0x50 ret_from_fork+0x22/0x30 Apparently, the reset delays are getting so large they can trigger a UBSAN panic. Looking at the code, the current timeout is capped at 5000us. Using a base value of 100us, the current code will overflow after (1<<29). Even at values before 32, this function wraps around, perhaps unintentionally. Cap the value of the exponent used for this backoff at (1<<16) which is larger than currently necessary, but large enough to support bigger values in the future. Cc: stable@vger.kernel.org Fixes: 4bb7f4cf60e3 ("net: ena: reduce driver load time") Signed-off-by: Krister Johansen Reviewed-by: Leon Romanovsky Reviewed-by: Shay Agroskin Link: https://lore.kernel.org/r/20230711013621.GE1926@templeofstupid.com Signed-off-by: Jakub Kicinski commit 8cc32a9bbf2934d90762d9de0187adcb5ad46a11 Author: Yonghong Song Date: Wed Jun 28 11:19:26 2023 -0700 kallsyms: strip LTO-only suffixes from promoted global functions Commit 6eb4bd92c1ce ("kallsyms: strip LTO suffixes from static functions") stripped all function/variable suffixes started with '.' regardless of whether those suffixes are generated at LTO mode or not. In fact, as far as I know, in LTO mode, when a static function/variable is promoted to the global scope, '.llvm.<...>' suffix is added. The existing mechanism breaks live patch for a LTO kernel even if no .llvm.<...> symbols are involved. For example, for the following kernel symbols: $ grep bpf_verifier_vlog /proc/kallsyms ffffffff81549f60 t bpf_verifier_vlog ffffffff8268b430 d bpf_verifier_vlog._entry ffffffff8282a958 d bpf_verifier_vlog._entry_ptr ffffffff82e12a1f d bpf_verifier_vlog.__already_done 'bpf_verifier_vlog' is a static function. '_entry', '_entry_ptr' and '__already_done' are static variables used inside 'bpf_verifier_vlog', so llvm promotes them to file-level static with prefix 'bpf_verifier_vlog.'. Note that the func-level to file-level static function promotion also happens without LTO. Given a symbol name 'bpf_verifier_vlog', with LTO kernel, current mechanism will return 4 symbols to live patch subsystem which current live patching subsystem cannot handle it. With non-LTO kernel, only one symbol is returned. In [1], we have a lengthy discussion, the suggestion is to separate two cases: (1). new symbols with suffix which are generated regardless of whether LTO is enabled or not, and (2). new symbols with suffix generated only when LTO is enabled. The cleanup_symbol_name() should only remove suffixes for case (2). Case (1) should not be changed so it can work uniformly with or without LTO. This patch removed LTO-only suffix '.llvm.<...>' so live patching and tracing should work the same way for non-LTO kernel. The cleanup_symbol_name() in scripts/kallsyms.c is also changed to have the same filtering pattern so both kernel and kallsyms tool have the same expectation on the order of symbols. [1] https://lore.kernel.org/live-patching/20230615170048.2382735-1-song@kernel.org/T/#u Fixes: 6eb4bd92c1ce ("kallsyms: strip LTO suffixes from static functions") Reported-by: Song Liu Signed-off-by: Yonghong Song Reviewed-by: Zhen Lei Reviewed-by: Nick Desaulniers Acked-by: Song Liu Link: https://lore.kernel.org/r/20230628181926.4102448-1-yhs@fb.com Signed-off-by: Kees Cook commit dcf89d111199562fa5f31a1bb76f17bc4831f6da Author: Mostafa Saleh Date: Thu Jul 6 15:22:40 2023 +0000 KVM: arm64: Add missing BTI instructions Some bti instructions were missing from commit b53d4a272349 ("KVM: arm64: Use BTI for nvhe") 1) kvm_host_psci_cpu_entry kvm_host_psci_cpu_entry is called from __kvm_hyp_init_cpu through "br" instruction as __kvm_hyp_init_cpu resides in idmap section while kvm_host_psci_cpu_entry is in hyp .text so the offset is larger than 128MB range covered by "b". Which means that this function should start with "bti j" instruction. LLVM which is the only compiler supporting BTI for Linux, adds "bti j" for jump tables or by when taking the address of the block [1]. Same behaviour is observed with GCC. As kvm_host_psci_cpu_entry is a C function, this must be done in assembly. Another solution is to use X16/X17 with "br", as according to ARM ARM DDI0487I.a RLJHCL/IGMGRS, PACIASP has an implicit branch target identification instruction that is compatible with PSTATE.BTYPE 0b01 which includes "br X16/X17" And the kvm_host_psci_cpu_entry has PACIASP as it is an external function. Although, using explicit "bti" makes it more clear than relying on which register is used. A third solution is to clear SCTLR_EL2.BT, which would make PACIASP compatible PSTATE.BTYPE 0b11 ("br" to other registers). However this deviates from the kernel behaviour (in bti_enable()). 2) Spectre vector table "br" instructions are generated at runtime for the vector table (__bp_harden_hyp_vecs). These branches would land on vectors in __kvm_hyp_vector at offset 8. As all the macros are defined with valid_vect/invalid_vect, it is sufficient to add "bti j" at the correct offset. [1] https://reviews.llvm.org/D52867 Fixes: b53d4a272349 ("KVM: arm64: Use BTI for nvhe") Signed-off-by: Mostafa Saleh Reported-by: Sudeep Holla Acked-by: Marc Zyngier Tested-by: Sudeep Holla Link: https://lore.kernel.org/r/20230706152240.685684-1-smostafa@google.com Signed-off-by: Oliver Upton commit 04e601f2a71c804422a91df813e19fda5f4b845e Merge: 283c5ce7da0a6 bfc374a145ae1 Author: Linus Walleij Date: Thu Jul 13 00:05:52 2023 +0200 Merge tag 'renesas-pinctrl-fixes-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into fixes pinctrl: renesas: Fixes for v6.5 - Fix handling of non-unique pin control configuration subnode names on the RZ/V2M and RZ/G2L SoC families. Signed-off-by: Linus Walleij commit 283c5ce7da0a676f46539094d40067ad17c4f294 Author: Mario Limonciello Date: Wed Jul 5 08:30:05 2023 -0500 pinctrl: amd: Unify debounce handling into amd_pinconf_set() Debounce handling is done in two different entry points in the driver. Unify this to make sure that it's always handled the same. Tested-by: Jan Visser Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20230705133005.577-5-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit 3f62312d04d4c68aace9cd06fc135e09573325f3 Author: Mario Limonciello Date: Wed Jul 5 08:30:04 2023 -0500 pinctrl: amd: Drop pull up select configuration pinctrl-amd currently tries to program bit 19 of all GPIOs to select either a 4kΩ or 8hΩ pull up, but this isn't what bit 19 does. Bit 19 is marked as reserved, even in the latest platforms documentation. Drop this programming functionality. Tested-by: Jan Visser Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20230705133005.577-4-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit 635a750d958e158e17af0f524bedc484b27fbb93 Author: Mario Limonciello Date: Wed Jul 5 08:30:03 2023 -0500 pinctrl: amd: Use amd_pinconf_set() for all config options On ASUS TUF A16 it is reported that the ITE5570 ACPI device connected to GPIO 7 is causing an interrupt storm. This issue doesn't happen on Windows. Comparing the GPIO register configuration between Windows and Linux bit 20 has been configured as a pull up on Windows, but not on Linux. Checking GPIO declaration from the firmware it is clear it *should* have been a pull up on Linux as well. ``` GpioInt (Level, ActiveLow, Exclusive, PullUp, 0x0000, "\\_SB.GPIO", 0x00, ResourceConsumer, ,) { // Pin list 0x0007 } ``` On Linux amd_gpio_set_config() is currently only used for programming the debounce. Actually the GPIO core calls it with all the arguments that are supported by a GPIO, pinctrl-amd just responds `-ENOTSUPP`. To solve this issue expand amd_gpio_set_config() to support the other arguments amd_pinconf_set() supports, namely `PIN_CONFIG_BIAS_PULL_DOWN`, `PIN_CONFIG_BIAS_PULL_UP`, and `PIN_CONFIG_DRIVE_STRENGTH`. Reported-by: Nik P Reported-by: Nathan Schulte Reported-by: Friedrich Vock Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217336 Reported-by: dridri85@gmail.com Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217493 Link: https://lore.kernel.org/linux-input/20230530154058.17594-1-friedrich.vock@gmx.de/ Tested-by: Jan Visser Fixes: 2956b5d94a76 ("pinctrl / gpio: Introduce .set_config() callback for GPIO chips") Signed-off-by: Mario Limonciello Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230705133005.577-3-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit 0d5ace1a07f7e846d0f6d972af60d05515599d0b Author: Mario Limonciello Date: Wed Jul 5 08:30:02 2023 -0500 pinctrl: amd: Only use special debounce behavior for GPIO 0 It's uncommon to use debounce on any other pin, but technically we should only set debounce to 0 when working off GPIO0. Cc: stable@vger.kernel.org Tested-by: Jan Visser Fixes: 968ab9261627 ("pinctrl: amd: Detect internal GPIO0 debounce handling") Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20230705133005.577-2-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit bec3c25c247c4f88a33d79675a09e1644c9a3114 Author: Steven Rostedt (Google) Date: Wed Jul 12 10:52:35 2023 -0400 tracing: Stop FORTIFY_SOURCE complaining about stack trace caller The stack_trace event is an event created by the tracing subsystem to store stack traces. It originally just contained a hard coded array of 8 words to hold the stack, and a "size" to know how many entries are there. This is exported to user space as: name: kernel_stack ID: 4 format: field:unsigned short common_type; offset:0; size:2; signed:0; field:unsigned char common_flags; offset:2; size:1; signed:0; field:unsigned char common_preempt_count; offset:3; size:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:int size; offset:8; size:4; signed:1; field:unsigned long caller[8]; offset:16; size:64; signed:0; print fmt: "\t=> %ps\n\t=> %ps\n\t=> %ps\n" "\t=> %ps\n\t=> %ps\n\t=> %ps\n" "\t=> %ps\n\t=> %ps\n",i (void *)REC->caller[0], (void *)REC->caller[1], (void *)REC->caller[2], (void *)REC->caller[3], (void *)REC->caller[4], (void *)REC->caller[5], (void *)REC->caller[6], (void *)REC->caller[7] Where the user space tracers could parse the stack. The library was updated for this specific event to only look at the size, and not the array. But some older users still look at the array (note, the older code still checks to make sure the array fits inside the event that it read. That is, if only 4 words were saved, the parser would not read the fifth word because it will see that it was outside of the event size). This event was changed a while ago to be more dynamic, and would save a full stack even if it was greater than 8 words. It does this by simply allocating more ring buffer to hold the extra words. Then it copies in the stack via: memcpy(&entry->caller, fstack->calls, size); As the entry is struct stack_entry, that is created by a macro to both create the structure and export this to user space, it still had the caller field of entry defined as: unsigned long caller[8]. When the stack is greater than 8, the FORTIFY_SOURCE code notices that the amount being copied is greater than the source array and complains about it. It has no idea that the source is pointing to the ring buffer with the required allocation. To hide this from the FORTIFY_SOURCE logic, pointer arithmetic is used: ptr = ring_buffer_event_data(event); entry = ptr; ptr += offsetof(typeof(*entry), caller); memcpy(ptr, fstack->calls, size); Link: https://lore.kernel.org/all/20230612160748.4082850-1-svens@linux.ibm.com/ Link: https://lore.kernel.org/linux-trace-kernel/20230712105235.5fc441aa@gandalf.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Reported-by: Sven Schnelle Tested-by: Sven Schnelle Signed-off-by: Steven Rostedt (Google) commit 26efd79c4624294e553aeaa3439c646729bad084 Author: Zheng Yejian Date: Wed Jul 12 14:04:52 2023 +0800 ftrace: Fix possible warning on checking all pages used in ftrace_process_locs() As comments in ftrace_process_locs(), there may be NULL pointers in mcount_loc section: > Some architecture linkers will pad between > the different mcount_loc sections of different > object files to satisfy alignments. > Skip any NULL pointers. After commit 20e5227e9f55 ("ftrace: allow NULL pointers in mcount_loc"), NULL pointers will be accounted when allocating ftrace pages but skipped before adding into ftrace pages, this may result in some pages not being used. Then after commit 706c81f87f84 ("ftrace: Remove extra helper functions"), warning may occur at: WARN_ON(pg->next); To fix it, only warn for case that no pointers skipped but pages not used up, then free those unused pages after releasing ftrace_lock. Link: https://lore.kernel.org/linux-trace-kernel/20230712060452.3175675-1-zhengyejian1@huawei.com Cc: stable@vger.kernel.org Fixes: 706c81f87f84 ("ftrace: Remove extra helper functions") Suggested-by: Steven Rostedt Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit 835a65f51790e1f72b1ab106ec89db9ac15b47d6 Author: Karol Herbst Date: Fri May 26 11:10:52 2023 +0200 drm/nouveau: bring back blit subchannel for pre nv50 GPUs 1ba6113a90a0 removed a lot of the kernel GPU channel, but method 0x128 was important as otherwise the GPU spams us with `CACHE_ERROR` messages. We use the blit subchannel inside our vblank handling, so we should keep at least this part. v2: Only do it for NV11+ GPUs Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/201 Fixes: 4a16dd9d18a0 ("drm/nouveau/kms: switch to drm fbdev helpers") Signed-off-by: Karol Herbst Reviewed-by: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/20230526091052.2169044-1-kherbst@redhat.com commit 938a06c8b7913455073506c33ae3bff029c3c4ef Author: Karol Herbst Date: Mon May 22 22:18:38 2023 +0200 drm/nouveau/acr: Abort loading ACR if no firmware was found This fixes a NULL pointer access inside nvkm_acr_oneinit in case necessary firmware files couldn't be loaded. Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/212 Fixes: 4b569ded09fd ("drm/nouveau/acr/ga102: initial support") Signed-off-by: Karol Herbst Reviewed-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230522201838.1496622-1-kherbst@redhat.com commit df6556adf27b7372cfcd97e1c0afb0d516c8279f Author: Oliver Upton Date: Tue Jun 27 23:54:05 2023 +0000 KVM: arm64: Correctly handle page aging notifiers for unaligned memslot Userspace is allowed to select any PAGE_SIZE aligned hva to back guest memory. This is even the case with hugepages, although it is a rather suboptimal configuration as PTE level mappings are used at stage-2. The arm64 page aging handlers have an assumption that the specified range is exactly one page/block of memory, which in the aforementioned case is not necessarily true. All together this leads to the WARN() in kvm_age_gfn() firing. However, the WARN is only part of the issue as the table walkers visit at most a single leaf PTE. For hugepage-backed memory in a memslot that isn't hugepage-aligned, page aging entirely misses accesses to the hugepage beyond the first page in the memslot. Add a new walker dedicated to handling page aging MMU notifiers capable of walking a range of PTEs. Convert kvm(_test)_age_gfn() over to the new walker and drop the WARN that caught the issue in the first place. The implementation of this walker was inspired by the test_clear_young() implementation by Yu Zhao [*], but repurposed to address a bug in the existing aging implementation. Cc: stable@vger.kernel.org # v5.15 Fixes: 056aad67f836 ("kvm: arm/arm64: Rework gpa callback handlers") Link: https://lore.kernel.org/kvmarm/20230526234435.662652-6-yuzhao@google.com/ Co-developed-by: Yu Zhao Signed-off-by: Yu Zhao Reported-by: Reiji Watanabe Reviewed-by: Marc Zyngier Reviewed-by: Shaoqin Huang Link: https://lore.kernel.org/r/20230627235405.4069823-1-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit f72207a5c0dbaaf6921cf9a6c0d2fd0bc249ea78 Author: Dan Carpenter Date: Tue Jul 11 11:52:26 2023 +0300 netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write() The simple_write_to_buffer() function is designed to handle partial writes. It returns negatives on error, otherwise it returns the number of bytes that were able to be copied. This code doesn't check the return properly. We only know that the first byte is written, the rest of the buffer might be uninitialized. There is no need to use the simple_write_to_buffer() function. Partial writes are prohibited by the "if (*ppos != 0)" check at the start of the function. Just use memdup_user() and copy the whole buffer. Fixes: d3cbb907ae57 ("netdevsim: add ACL trap reporting cookie as a metadata") Signed-off-by: Dan Carpenter Reviewed-by: Pavan Chebbi Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/7c1f950b-3a7d-4252-82a6-876e53078ef7@moroto.mountain Signed-off-by: Jakub Kicinski commit eb26cbb1a754ccde5d4d74527dad5ba051808fad Merge: 9a3236ce48406 6b293a8c91bca Author: Linus Torvalds Date: Wed Jul 12 12:16:47 2023 -0700 Merge tag 'platform-drivers-x86-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "Misc small fixes and hw-id additions" * tag 'platform-drivers-x86-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: touchscreen_dmi: Add info for the Archos 101 Cesium Educ tablet platform/x86: dell-ddv: Fix mangled list in documentation platform/x86: dell-ddv: Improve error handling platform/x86/amd: pmf: Add new ACPI ID AMDI0103 platform/x86/amd: pmc: Add new ACPI ID AMDI000A platform/x86/amd: pmc: Apply nvme quirk to HP 15s-eq2xxx platform/x86: Move s2idle quirk from thinkpad-acpi to amd-pmc platform/x86: int3472/discrete: set variable skl_int3472_regulator_second_sensor storage-class-specifier to static platform/x86/intel/tpmi: Prevent overflow for cap_offset platform/x86: wmi: Replace open coded guid_parse_and_compare() platform/x86: wmi: Break possible infinite loop when parsing GUID commit 5b10c18d1bf9238d842db6c8e86cc0066185c391 Author: Ian Rogers Date: Tue Jul 11 23:52:50 2023 -0700 perf parse-events: Avoid SEGV if PMU lookup fails for legacy cache terms libfuzzer found the following command could SEGV: $ perf stat -e cpu/L2,L2/ true This is because the L2 term rewrites the perf_event_attr type to PERF_TYPE_HW_CACHE which then fails the PMU lookup for the second legacy cache term. The new failure is consistent with repeated hardware terms: $ perf stat -e cpu/L2,L2/ true event syntax error: 'cpu/L2,L2/' \___ Failed to find PMU for type 3 Initial error: event syntax error: 'cpu/L2,L2/' \___ Failed to find PMU for type 3 Run 'perf list' for a list of valid events Usage: perf stat [] [] -e, --event event selector. use 'perf list' to list available events $ perf stat -e cpu/cycles,cycles/ true event syntax error: 'cpu/cycles,cycles/' \___ Failed to find PMU for type 0 Initial error: event syntax error: 'cpu/cycles,cycles/' \___ Failed to find PMU for type 0 Run 'perf list' for a list of valid events Usage: perf stat [] [] -e, --event event selector. use 'perf list' to list available events Committer testing: Before: $ perf stat -e cpu/L2,L2/ true Segmentation fault (core dumped) $ After: $ perf stat -e cpu/L2,L2/ true event syntax error: 'cpu/L2,L2/' \___ Failed to find PMU for type 3 Initial error: event syntax error: 'cpu/L2,L2/' \___ Failed to find PMU for type 3 Run 'perf list' for a list of valid events Usage: perf stat [] [] -e, --event event selector. use 'perf list' to list available events $ Fixes: 6fd1e5191591f9d5 ("perf parse-events: Support PMUs for legacy cache events") Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230712065250.1450306-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 9a3236ce48406c3190dfa06137636525001b32f5 Merge: 1d7546042f8fd 195b9cb5b288f Author: Linus Torvalds Date: Wed Jul 12 12:01:16 2023 -0700 Merge tag 'probes-fixes-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull probes fixes from Masami Hiramatsu: - Fix fprobe's rethook release issues: - Release rethook after ftrace_ops is unregistered so that the rethook is not accessed after free. - Stop rethook before ftrace_ops is unregistered so that the rethook is NOT used after exiting unregister_fprobe() - Fix eprobe cleanup logic. If it attaches to multiple events and failes to enable one of them, rollback all enabled events correctly. - Fix fprobe to unlock ftrace recursion lock correctly when it missed by another running kprobe. - Cleanup kprobe to remove unnecessary NULL. - Cleanup kprobe to remove unnecessary 0 initializations. * tag 'probes-fixes-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: fprobe: Ensure running fprobe_exit_handler() finished before calling rethook_free() kernel: kprobes: Remove unnecessary ‘0’ values kprobes: Remove unnecessary ‘NULL’ values from correct_ret_addr fprobe: add unlock to match a succeeded ftrace_test_recursion_trylock kernel/trace: Fix cleanup logic of enable_trace_eprobe fprobe: Release rethook after the ftrace_ops is unregistered commit 1d7546042f8fdc4bc39ab91ec966203e2d64f8bd Merge: 3f01e9fed8454 8785436617640 Author: Linus Torvalds Date: Wed Jul 12 11:56:22 2023 -0700 Merge tag 'for-linus-2023071101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Benjamin Tissoires: - AMD SFH shift-out-of-bounds fix (Basavaraj Natikar) - avoid struct memcpy overrun warning in the hid-hyperv module (Arnd Bergmann) - a quick HID kselftests script fix for our CI to be happy (Benjamin Tissoires) - various fixes and additions of device IDs * tag 'for-linus-2023071101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: amd_sfh: Fix for shift-out-of-bounds HID: amd_sfh: Rename the float32 variable HID: input: fix mapping for camera access keys HID: logitech-hidpp: Add wired USB id for Logitech G502 Lightspeed HID: nvidia-shield: Pack inner/related declarations in HOSTCMD reports HID: hyperv: avoid struct memcpy overrun warning selftests: hid: fix vmtests.sh not running make headers commit f673b4f5bd13365c8bee2f38c9794b635c73a302 Author: Bart Van Assche Date: Wed Jul 12 10:33:43 2023 -0700 block/mq-deadline: Fix a bug in deadline_from_pos() A bug was introduced in deadline_from_pos() while implementing the suggestion to use round_down() in the following code: pos -= bdev_offset_from_zone_start(rq->q->disk->part0, pos); This patch makes deadline_from_pos() use round_down() such that 'pos' is rounded down. Reported-by: Shin'ichiro Kawasaki Closes: https://lore.kernel.org/all/5zthzi3lppvcdp4nemum6qck4gpqbdhvgy4k3qwguhgzxc4quj@amulvgycq67h/ Cc: Christoph Hellwig Cc: Damien Le Moal Fixes: 0effb390c4ba ("block: mq-deadline: Handle requeued requests correctly") Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230712173344.2994513-1-bvanassche@acm.org Signed-off-by: Jens Axboe commit ab2dbc7accedc2e98eb7d8b8878d337e3b36c95d Author: Palmer Dabbelt Date: Tue Jul 11 15:46:00 2023 -0700 RISC-V: Don't include Zicsr or Zifencei in I from ACPI ACPI ISA strings are based on a specification after Zicsr and Zifencei were split out of I, so we shouldn't be treating them as part of I. We haven't release an ACPI-based kernel yet, so we don't need to worry about compatibility with the old ISA strings. Fixes: 07edc32779e3 ("RISC-V: always report presence of extensions formerly part of the base ISA") Reviewed-by: Conor Dooley Reviewed-by: Sunil V L Link: https://lore.kernel.org/r/20230711224600.10879-1-palmer@rivosinc.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit f84d41b2a083b990cbdf70f3b24b6b108b9678ad Author: Srinivas Kandagatla Date: Thu May 25 14:38:09 2023 +0100 soundwire: qcom: update status correctly with mask SoundWire device status can be incorrectly updated without proper mask, fix this by adding a mask before updating the status. Fixes: c7d49c76d1d5 ("soundwire: qcom: add support to new interrupts") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230525133812.30841-2-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul commit c40d6b3249b11d60e09d81530588f56233d9aa44 Author: Johan Hovold Date: Wed Jul 5 14:30:11 2023 +0200 soundwire: fix enumeration completion The soundwire subsystem uses two completion structures that allow drivers to wait for soundwire device to become enumerated on the bus and initialised by their drivers, respectively. The code implementing the signalling is currently broken as it does not signal all current and future waiters and also uses the wrong reinitialisation function, which can potentially lead to memory corruption if there are still waiters on the queue. Not signalling future waiters specifically breaks sound card probe deferrals as codec drivers can not tell that the soundwire device is already attached when being reprobed. Some codec runtime PM implementations suffer from similar problems as waiting for enumeration during resume can also timeout despite the device already having been enumerated. Fixes: fb9469e54fa7 ("soundwire: bus: fix race condition with enumeration_complete signaling") Fixes: a90def068127 ("soundwire: bus: fix race condition with initialization_complete signaling") Cc: stable@vger.kernel.org # 5.7 Cc: Pierre-Louis Bossart Cc: Rander Wang Signed-off-by: Johan Hovold Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230705123018.30903-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 8932089b566c24ea19b57e37704c492678de1420 Author: Adrien Thierry Date: Thu Jun 29 10:45:40 2023 -0400 phy: qcom-snps-femto-v2: use qcom_snps_hsphy_suspend/resume error code The return value from qcom_snps_hsphy_suspend/resume is not used. Make sure qcom_snps_hsphy_runtime_suspend/resume return this value as well. Signed-off-by: Adrien Thierry Link: https://lore.kernel.org/r/20230629144542.14906-4-athierry@redhat.com Signed-off-by: Vinod Koul commit 8a0eb8f9b9a002291a3934acfd913660b905249e Author: Adrien Thierry Date: Thu Jun 29 10:45:39 2023 -0400 phy: qcom-snps-femto-v2: properly enable ref clock The driver is not enabling the ref clock, which thus gets disabled by the clk_disable_unused() initcall. This leads to the dwc3 controller failing to initialize if probed after clk_disable_unused() is called, for instance when the driver is built as a module. To fix this, switch to the clk_bulk API to handle both cfg_ahb and ref clocks at the proper places. Note that the cfg_ahb clock is currently not used by any device tree instantiation of the PHY. Work needs to be done separately to fix this. Link: https://lore.kernel.org/linux-arm-msm/ZEqvy+khHeTkC2hf@fedora/ Fixes: 51e8114f80d0 ("phy: qcom-snps: Add SNPS USB PHY driver for QCOM based SOCs") Signed-off-by: Adrien Thierry Link: https://lore.kernel.org/r/20230629144542.14906-3-athierry@redhat.com Signed-off-by: Vinod Koul commit 45d89a344eb46db9dce851c28e14f5e3c635c251 Author: Adrien Thierry Date: Thu Jun 29 10:45:38 2023 -0400 phy: qcom-snps-femto-v2: keep cfg_ahb_clk enabled during runtime suspend In the dwc3 core, both system and runtime suspend end up calling dwc3_suspend_common(). From there, what happens for the PHYs depends on the USB mode and whether the controller is entering system or runtime suspend. HOST mode: (1) system suspend on a non-wakeup-capable controller The [1] if branch is taken. dwc3_core_exit() is called, which ends up calling phy_power_off() and phy_exit(). Those two functions decrease the PM runtime count at some point, so they will trigger the PHY runtime sleep (assuming the count is right). (2) runtime suspend / system suspend on a wakeup-capable controller The [1] branch is not taken. dwc3_suspend_common() calls phy_pm_runtime_put_sync(). Assuming the ref count is right, the PHY runtime suspend op is called. DEVICE mode: dwc3_core_exit() is called on both runtime and system sleep unless the controller is already runtime suspended. OTG mode: (1) system suspend : dwc3_core_exit() is called (2) runtime suspend : do nothing In host mode, the code seems to make a distinction between 1) runtime sleep / system sleep for wakeup-capable controller, and 2) system sleep for non-wakeup-capable controller, where phy_power_off() and phy_exit() are only called for the latter. This suggests the PHY is not supposed to be in a fully powered-off state for runtime sleep and system sleep for wakeup-capable controller. Moreover, downstream, cfg_ahb_clk only gets disabled for system suspend. The clocks are disabled by phy->set_suspend() [2] which is only called in the system sleep path through dwc3_core_exit() [3]. With that in mind, don't disable the clocks during the femto PHY runtime suspend callback. The clocks will only be disabled during system suspend for non-wakeup-capable controllers, through dwc3_core_exit(). [1] https://elixir.bootlin.com/linux/v6.4/source/drivers/usb/dwc3/core.c#L1988 [2] https://git.codelinaro.org/clo/la/kernel/msm-5.4/-/blob/LV.AU.1.2.1.r2-05300-gen3meta.0/drivers/usb/phy/phy-msm-snps-hs.c#L524 [3] https://git.codelinaro.org/clo/la/kernel/msm-5.4/-/blob/LV.AU.1.2.1.r2-05300-gen3meta.0/drivers/usb/dwc3/core.c#L1915 Signed-off-by: Adrien Thierry Link: https://lore.kernel.org/r/20230629144542.14906-2-athierry@redhat.com Signed-off-by: Vinod Koul commit 95bd315f0a5ed7d7afe771776272c5b3cdb29bc8 Author: Guillaume Ranquet Date: Tue May 30 10:43:07 2023 +0200 phy: mediatek: hdmi: mt8195: fix prediv bad upper limit test The pll prediv calculus searchs for the smallest prediv that gets the ns_hdmipll_ck in the range of 5 GHz to 12 GHz. A typo in the upper bound test was testing for 5Ghz to 1Ghz Fixes: 45810d486bb44 ("phy: mediatek: add support for phy-mtk-hdmi-mt8195") Signed-off-by: Guillaume Ranquet Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230529-hdmi_phy_fix-v1-1-bf65f53af533@baylibre.com Signed-off-by: Vinod Koul commit 5782017cc4d0c8f3425d55b893675bb8a20c33e9 Author: Dan Carpenter Date: Tue Jul 11 09:13:25 2023 +0300 phy: phy-mtk-dp: Fix an error code in probe() Negative -EINVAL was intended instead of positive EINVAL. Fixes: 6a23afad443a ("phy: phy-mtk-dp: Add driver for DP phy") Signed-off-by: Dan Carpenter Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/3c699e00-2883-40d9-92c3-0da1dc38fdd4@moroto.mountain Signed-off-by: Vinod Koul commit a68b48afc050a9456ed4ed19d8755e0f925b44e6 Author: Minjie Du Date: Wed Jul 5 19:39:12 2023 +0800 dmaengine: xilinx: xdma: Fix Judgment of the return value Fix: make IS_ERR() judge the devm_ioremap_resource() function return. Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver") Signed-off-by: Minjie Du Acked-by: Michal Simek Link: https://lore.kernel.org/r/20230705113912.16247-1-duminjie@vivo.com Signed-off-by: Vinod Koul commit b1e213a9e31c20206f111ec664afcf31cbfe0dbb Author: Baoquan He Date: Fri Jul 7 21:58:45 2023 +0800 idmaengine: make FSL_EDMA and INTEL_IDMA64 depends on HAS_IOMEM On s390 systems (aka mainframes), it has classic channel devices for networking and permanent storage that are currently even more common than PCI devices. Hence it could have a fully functional s390 kernel with CONFIG_PCI=n, then the relevant iomem mapping functions [including ioremap(), devm_ioremap(), etc.] are not available. Here let FSL_EDMA and INTEL_IDMA64 depend on HAS_IOMEM so that it won't be built to cause below compiling error if PCI is unset. -------- ERROR: modpost: "devm_platform_ioremap_resource" [drivers/dma/fsl-edma.ko] undefined! ERROR: modpost: "devm_platform_ioremap_resource" [drivers/dma/idma64.ko] undefined! -------- Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306211329.ticOJCSv-lkp@intel.com/ Signed-off-by: Baoquan He Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Link: https://lore.kernel.org/r/20230707135852.24292-2-bhe@redhat.com Signed-off-by: Vinod Koul commit 71a5bb153be104d9175636e95166fd5e37466649 Author: Keith Busch Date: Wed Jul 12 08:36:47 2023 -0700 nvme: ensure disabling pairs with unquiesce If any error handling that disables the controller fails to queue the reset work, like if the state changed to disconnected inbetween, then the failed teardown needs to unquiesce the queues since it's no longer paired with reset_work. Just make sure that the controller can be put into a resetting state prior to starting the disable so that no other handling can change the queue states while recovery is happening. Reported-by: Ming Lei Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit ee6fdc5055e916b1dd497f11260d4901c4c1e55e Author: Michael Liang Date: Fri Jul 7 15:21:57 2023 -0600 nvme-fc: fix race between error recovery and creating association There is a small race window between nvme-fc association creation and error recovery. Fix this race condition by protecting accessing to controller state and ASSOC_FAILED flag under nvme-fc controller lock. Signed-off-by: Michael Liang Reviewed-by: Caleb Sander Reviewed-by: James Smart Signed-off-by: Keith Busch commit 60e445bdfccbb90c1bc13a92e128e50ba4357b3c Author: Michael Liang Date: Fri Jul 7 15:21:56 2023 -0600 nvme-fc: return non-zero status code when fails to create association Return non-zero status code(-EIO) when needed, so re-connecting or deleting controller will be triggered properly. Signed-off-by: Michael Liang Reviewed-by: Caleb Sander Reviewed-by: James Smart Signed-off-by: Keith Busch commit e701156ccc6c7a5f104a968dda74cd6434178712 Author: Mario Limonciello Date: Fri Jul 7 21:26:09 2023 -0500 drm/amd: Align SMU11 SMU_MSG_OverridePcieParameters implementation with SMU13 SMU13 overrides dynamic PCIe lane width and dynamic speed by when on certain hosts. commit 38e4ced80479 ("drm/amd/pm: conditionally disable pcie lane switching for some sienna_cichlid SKUs") worked around this issue by setting up certain SKUs to set up certain limits, but the same fundamental problem with those hosts affects all SMU11 implmentations as well, so align the SMU11 and SMU13 driver handling. Signed-off-by: Mario Limonciello Reviewed-by: Evan Quan Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.1.x commit 7e42907f3a7b4ce3a2d1757f6d78336984daf8f5 Author: Zheng Yejian Date: Sun Jul 9 06:51:44 2023 +0800 ring-buffer: Fix deadloop issue on reading trace_pipe Soft lockup occurs when reading file 'trace_pipe': watchdog: BUG: soft lockup - CPU#6 stuck for 22s! [cat:4488] [...] RIP: 0010:ring_buffer_empty_cpu+0xed/0x170 RSP: 0018:ffff88810dd6fc48 EFLAGS: 00000246 RAX: 0000000000000000 RBX: 0000000000000246 RCX: ffffffff93d1aaeb RDX: ffff88810a280040 RSI: 0000000000000008 RDI: ffff88811164b218 RBP: ffff88811164b218 R08: 0000000000000000 R09: ffff88815156600f R10: ffffed102a2acc01 R11: 0000000000000001 R12: 0000000051651901 R13: 0000000000000000 R14: ffff888115e49500 R15: 0000000000000000 [...] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f8d853c2000 CR3: 000000010dcd8000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __find_next_entry+0x1a8/0x4b0 ? peek_next_entry+0x250/0x250 ? down_write+0xa5/0x120 ? down_write_killable+0x130/0x130 trace_find_next_entry_inc+0x3b/0x1d0 tracing_read_pipe+0x423/0xae0 ? tracing_splice_read_pipe+0xcb0/0xcb0 vfs_read+0x16b/0x490 ksys_read+0x105/0x210 ? __ia32_sys_pwrite64+0x200/0x200 ? switch_fpu_return+0x108/0x220 do_syscall_64+0x33/0x40 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Through the vmcore, I found it's because in tracing_read_pipe(), ring_buffer_empty_cpu() found some buffer is not empty but then it cannot read anything due to "rb_num_of_entries() == 0" always true, Then it infinitely loop the procedure due to user buffer not been filled, see following code path: tracing_read_pipe() { ... ... waitagain: tracing_wait_pipe() // 1. find non-empty buffer here trace_find_next_entry_inc() // 2. loop here try to find an entry __find_next_entry() ring_buffer_empty_cpu(); // 3. find non-empty buffer peek_next_entry() // 4. but peek always return NULL ring_buffer_peek() rb_buffer_peek() rb_get_reader_page() // 5. because rb_num_of_entries() == 0 always true here // then return NULL // 6. user buffer not been filled so goto 'waitgain' // and eventually leads to an deadloop in kernel!!! } By some analyzing, I found that when resetting ringbuffer, the 'entries' of its pages are not all cleared (see rb_reset_cpu()). Then when reducing the ringbuffer, and if some reduced pages exist dirty 'entries' data, they will be added into 'cpu_buffer->overrun' (see rb_remove_pages()), which cause wrong 'overrun' count and eventually cause the deadloop issue. To fix it, we need to clear every pages in rb_reset_cpu(). Link: https://lore.kernel.org/linux-trace-kernel/20230708225144.3785600-1-zhengyejian1@huawei.com Cc: stable@vger.kernel.org Fixes: a5fb833172eca ("ring-buffer: Fix uninitialized read_stamp") Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit 188623076d0f1a500583d392b6187056bf7cc71a Author: Mario Limonciello Date: Fri Jul 7 21:26:08 2023 -0500 drm/amd: Move helper for dynamic speed switch check out of smu13 This helper is used for checking if the connected host supports the feature, it can be moved into generic code to be used by other smu implementations as well. Signed-off-by: Mario Limonciello Reviewed-by: Evan Quan Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.1.x commit 31c7a3b378a136adc63296a2ff17645896fcf303 Author: Mario Limonciello Date: Fri Jul 7 14:31:35 2023 -0500 drm/amd/pm: conditionally disable pcie lane/speed switching for SMU13 Intel platforms such as Sapphire Rapids and Raptor Lake don't support dynamic pcie lane or speed switching. This limitation seems to carry over from one generation to another. To be safer, disable dynamic pcie lane width and speed switching when running on an Intel platform. Link: https://edc.intel.com/content/www/us/en/design/products/platforms/details/raptor-lake-s/13th-generation-core-processors-datasheet-volume-1-of-2/005/pci-express-support/ Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2663 Co-developed-by: Evan Quan Signed-off-by: Evan Quan Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.1.x commit dcb489bae65d92cfd26da22c7a0d6665b06ecc63 Author: Evan Quan Date: Fri Jul 7 14:31:34 2023 -0500 drm/amd/pm: share the code around SMU13 pcie parameters update So that SMU13.0.0 and SMU13.0.7 do not need to have one copy each. Signed-off-by: Evan Quan Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.1.x commit 8a774fe912ff09e39c2d3a3589c729330113f388 Author: gaba Date: Thu Mar 2 19:03:56 2023 -0500 drm/amdgpu: avoid restore process run into dead loop. In restore process worker, pinned BO cause update PTE fail, then the function re-schedule the restore_work. This will generate dead loop. Signed-off-by: gaba Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit d934e537c14bfe1227ced6341472571f354383e8 Author: Yang Wang Date: Tue Jun 20 17:05:25 2023 +0800 drm/amd/pm: fix smu i2c data read risk the smu driver_table is used for all types of smu tables data transcation (e.g: PPtable, Metrics, i2c, Ecc..). it is necessary to hold this lock to avoiding data tampering during the i2c read operation. Signed-off-by: Yang Wang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 7d8b31b73c79835572611ed1eed649e4d2e14245 Author: Arnd Bergmann Date: Wed May 17 14:51:48 2023 +0200 tracing: arm64: Avoid missing-prototype warnings These are all tracing W=1 warnings in arm64 allmodconfig about missing prototypes: kernel/trace/trace_kprobe_selftest.c:7:5: error: no previous prototype for 'kprobe_trace_selftest_target' [-Werror=missing-pro totypes] kernel/trace/ftrace.c:329:5: error: no previous prototype for '__register_ftrace_function' [-Werror=missing-prototypes] kernel/trace/ftrace.c:372:5: error: no previous prototype for '__unregister_ftrace_function' [-Werror=missing-prototypes] kernel/trace/ftrace.c:4130:15: error: no previous prototype for 'arch_ftrace_match_adjust' [-Werror=missing-prototypes] kernel/trace/fgraph.c:243:15: error: no previous prototype for 'ftrace_return_to_handler' [-Werror=missing-prototypes] kernel/trace/fgraph.c:358:6: error: no previous prototype for 'ftrace_graph_sleep_time_control' [-Werror=missing-prototypes] arch/arm64/kernel/ftrace.c:460:6: error: no previous prototype for 'prepare_ftrace_return' [-Werror=missing-prototypes] arch/arm64/kernel/ptrace.c:2172:5: error: no previous prototype for 'syscall_trace_enter' [-Werror=missing-prototypes] arch/arm64/kernel/ptrace.c:2195:6: error: no previous prototype for 'syscall_trace_exit' [-Werror=missing-prototypes] Move the declarations to an appropriate header where they can be seen by the caller and callee, and make sure the headers are included where needed. Link: https://lore.kernel.org/linux-trace-kernel/20230517125215.930689-1-arnd@kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Will Deacon Cc: Kees Cook Cc: Florent Revest Signed-off-by: Arnd Bergmann Acked-by: Catalin Marinas [ Fixed ftrace_return_to_handler() to handle CONFIG_HAVE_FUNCTION_GRAPH_RETVAL case ] Signed-off-by: Steven Rostedt (Google) commit 769e637276c294c2254f698e6a57eda771deb3f7 Author: Beau Belgrave Date: Thu Jun 29 23:50:49 2023 +0000 selftests/user_events: Test struct size match cases The self tests for user_events currently does not ensure that the edge case for struct types work properly with size differences. Add cases for mis-matching struct names and sizes to ensure they work properly. Link: https://lkml.kernel.org/r/20230629235049.581-3-beaub@linux.microsoft.com Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit 733ba346d941d37e0814bac37b6a5c188ac3c9b2 Author: Minjie Du Date: Wed Jul 12 19:18:37 2023 +0800 nvme: fix parameter check in nvme_fault_inject_init() Make IS_ERR() judge the debugfs_create_dir() function return. Signed-off-by: Minjie Du Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit b718ae835bd5de891ff6fefa290940b7613d2b07 Author: Keith Busch Date: Wed Jul 12 07:54:59 2023 -0700 nvme: warn only once for legacy uuid attribute Report the legacy fallback behavior for uuid attributes just once instead of logging repeated warnings for the same condition every time the attribute is read. The old behavior is too spamy on the kernel logs. Cc: Johannes Thumshirn Reported-by: Breno Leitao Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit c177872cb056e0b499af4717d8d1977017fd53df Author: Karol Herbst Date: Fri Jun 30 18:06:45 2023 +0200 drm/nouveau/disp/g94: enable HDMI Cc: Ben Skeggs Cc: Lyude Paul Fixes: f530bc60a30b ("drm/nouveau/disp: move HDMI config into acquire + infoframe methods") Signed-off-by: Karol Herbst Reviewed-by: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/20230630160645.3984596-1-kherbst@redhat.com Signed-off-by: Karol Herbst commit d94303699921bda8141ad33554ae55b615ddd149 Author: Karol Herbst Date: Wed Jun 28 23:22:46 2023 +0200 drm/nouveau/disp: fix HDMI on gt215+ Cc: Ben Skeggs Cc: Lyude Paul Fixes: f530bc60a30b ("drm/nouveau/disp: move HDMI config into acquire + infoframe methods") Signed-off-by: Karol Herbst Reviewed-by: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/20230628212248.3798605-1-kherbst@redhat.com Signed-off-by: Karol Herbst commit 30ebf2ce70888d8fdd1986e8e6d509dd2d227985 Author: Randy Dunlap Date: Mon Jul 10 21:29:13 2023 -0700 kconfig: gconfig: correct program name in help text Change "gkc" to "gconfig" in 3 places since it is called "gconfig" and not "gkc". Add a period at the end of one sentence. Signed-off-by: Randy Dunlap Signed-off-by: Masahiro Yamada commit 390ef8c0a37751434d084a8226a1ad9c90ae5772 Author: Randy Dunlap Date: Mon Jul 10 21:28:59 2023 -0700 kconfig: gconfig: drop the Show Debug Info help text The Show Debug Info option was removed eons ago. Now finish the job by removing the help text for it also. Fixes: 7b5d87215b38 ("gconfig: remove show_debug option") Signed-off-by: Randy Dunlap Signed-off-by: Masahiro Yamada commit b690e266dae2f85f4dfea21fa6a05e3500a51054 Author: Jisheng Zhang Date: Mon Jul 10 01:10:36 2023 +0800 riscv: mm: fix truncation warning on RV32 lkp reports below sparse warning when building for RV32: arch/riscv/mm/init.c:1204:48: sparse: warning: cast truncates bits from constant value (100000000 becomes 0) IMO, the reason we didn't see this truncates bug in real world is "0" means MEMBLOCK_ALLOC_ACCESSIBLE in memblock and there's no RV32 HW with more than 4GB memory. Fix it anyway to make sparse happy. Fixes: decf89f86ecd ("riscv: try to allocate crashkern region from 32bit addressible memory") Signed-off-by: Jisheng Zhang Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306080034.SLiCiOMn-lkp@intel.com/ Link: https://lore.kernel.org/r/20230709171036.1906-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 66843b14fb71825fdd73ab12f6594f2243b402be Author: Eric Lin Date: Mon Jul 10 15:43:28 2023 +0000 perf: RISC-V: Remove PERF_HES_STOPPED flag checking in riscv_pmu_start() Since commit 096b52fd2bb4 ("perf: RISC-V: throttle perf events") the perf_sample_event_took() function was added to report time spent in overflow interrupts. If the interrupt takes too long, the perf framework will lower the sysctl_perf_event_sample_rate and max_samples_per_tick. When hwc->interrupts is larger than max_samples_per_tick, the hwc->interrupts will be set to MAX_INTERRUPTS, and events will be throttled within the __perf_event_account_interrupt() function. However, the RISC-V PMU driver doesn't call riscv_pmu_stop() to update the PERF_HES_STOPPED flag after perf_event_overflow() in pmu_sbi_ovf_handler() function to avoid throttling. When the perf framework unthrottled the event in the timer interrupt handler, it triggers riscv_pmu_start() function and causes a WARN_ON_ONCE() warning, as shown below: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 240 at drivers/perf/riscv_pmu.c:184 riscv_pmu_start+0x7c/0x8e Modules linked in: CPU: 0 PID: 240 Comm: ls Not tainted 6.4-rc4-g19d0788e9ef2 #1 Hardware name: SiFive (DT) epc : riscv_pmu_start+0x7c/0x8e ra : riscv_pmu_start+0x28/0x8e epc : ffffffff80aef864 ra : ffffffff80aef810 sp : ffff8f80004db6f0 gp : ffffffff81c83750 tp : ffffaf80069f9bc0 t0 : ffff8f80004db6c0 t1 : 0000000000000000 t2 : 000000000000001f s0 : ffff8f80004db720 s1 : ffffaf8008ca1068 a0 : 0000ffffffffffff a1 : 0000000000000000 a2 : 0000000000000001 a3 : 0000000000000870 a4 : 0000000000000000 a5 : 0000000000000000 a6 : 0000000000000840 a7 : 0000000000000030 s2 : 0000000000000000 s3 : ffffaf8005165800 s4 : ffffaf800424da00 s5 : ffffffffffffffff s6 : ffffffff81cc7590 s7 : 0000000000000000 s8 : 0000000000000006 s9 : 0000000000000001 s10: ffffaf807efbc340 s11: ffffaf807efbbf00 t3 : ffffaf8006a16028 t4 : 00000000dbfbb796 t5 : 0000000700000000 t6 : ffffaf8005269870 status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003 [] riscv_pmu_start+0x7c/0x8e [] perf_adjust_freq_unthr_context+0x15e/0x174 [] perf_event_task_tick+0x88/0x9c [] scheduler_tick+0xfe/0x27c [] update_process_times+0x9a/0xba [] tick_sched_handle+0x32/0x66 [] tick_sched_timer+0x64/0xb0 [] __hrtimer_run_queues+0x156/0x2f4 [] hrtimer_interrupt+0xe2/0x1fe [] riscv_timer_interrupt+0x38/0x42 [] handle_percpu_devid_irq+0x90/0x1d2 [] generic_handle_domain_irq+0x28/0x36 After referring other PMU drivers like Arm, Loongarch, Csky, and Mips, they don't call *_pmu_stop() to update with PERF_HES_STOPPED flag after perf_event_overflow() function nor do they add PERF_HES_STOPPED flag checking in *_pmu_start() which don't cause this warning. Thus, it's recommended to remove this unnecessary check in riscv_pmu_start() function to prevent this warning. Signed-off-by: Eric Lin Link: https://lore.kernel.org/r/20230710154328.19574-1-eric.lin@sifive.com Fixes: 096b52fd2bb4 ("perf: RISC-V: throttle perf events") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 0266a2f791294e0b4ba36f4a1d89b8615ea3cac0 Author: Wang Ming Date: Tue Jul 4 15:40:47 2023 +0800 ksmbd: Fix unsigned expression compared with zero The return value of the ksmbd_vfs_getcasexattr() is signed. However, the return value is being assigned to an unsigned variable and subsequently recasted, causing warnings. Use a signed type. Signed-off-by: Wang Ming Acked-by: Tom Talpey Acked-by: Namjae Jeon Signed-off-by: Steve French commit d64b1ee12a168030fbb3e0aebf7bce49e9a07589 Author: Dan Carpenter Date: Thu Jun 29 09:07:37 2023 +0300 RDMA/mlx4: Make check for invalid flags stricter This code is trying to ensure that only the flags specified in the list are allowed. The problem is that ucmd->rx_hash_fields_mask is a u64 and the flags are an enum which is treated as a u32 in this context. That means the test doesn't check whether the highest 32 bits are zero. Fixes: 4d02ebd9bbbd ("IB/mlx4: Fix RSS hash fields restrictions") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/233ed975-982d-422a-b498-410f71d8a101@moroto.mountain Signed-off-by: Leon Romanovsky commit 54ccc8758ef4d29de9e8fdb711c852abbdd4103a Author: Jonas Gorski Date: Sat Jul 8 21:53:09 2023 +0200 mailmap: add entry for Jonas Gorski The openwrt.org email address is long defunct, but still pop ups from time to time when asking get_maintainer.pl. So add an entry to my currently used address. Signed-off-by: Jonas Gorski Link: https://lore.kernel.org/r/20230708195309.72767-2-jonas.gorski@gmail.com Signed-off-by: Mark Brown commit 2bbc72ffc4de803f6265119963aa7aac6559960f Author: Jonas Gorski Date: Sat Jul 8 21:53:08 2023 +0200 MAINTAINERS: add myself for spi-bcm63xx I noticed the driver is unclaimed. Since I was the last one doing substantial work on it, add me as the maintainer. As it is only found in legacy products, mark it as "Odd Fixes" instead of "Maintained". Signed-off-by: Jonas Gorski Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20230708195309.72767-1-jonas.gorski@gmail.com Signed-off-by: Mark Brown commit 9ec3c5517e22a12d2ff1b71e844f7913641460c6 Author: Jaewon Kim Date: Tue Jul 11 17:20:20 2023 +0900 spi: s3c64xx: clear loopback bit after loopback test When SPI loopback transfer is performed, S3C64XX_SPI_MODE_SELF_LOOPBACK bit still remained. It works as loopback even if the next transfer is not spi loopback mode. If not SPI_LOOP, needs to clear S3C64XX_SPI_MODE_SELF_LOOPBACK bit. Signed-off-by: Jaewon Kim Fixes: ffb7bcd3b27e ("spi: s3c64xx: support loopback mode") Reviewed-by: Chanho Park Link: https://lore.kernel.org/r/20230711082020.138165-1-jaewon02.kim@samsung.com Signed-off-by: Mark Brown commit 7e6b04f9238eab0f684fafd158c1f32ea65b9eaa Author: Arseniy Krasnov Date: Wed Jul 5 09:52:10 2023 +0300 mtd: rawnand: meson: fix OOB available bytes for ECC It is incorrect to calculate number of OOB bytes for ECC engine using some "already known" ECC step size (1024 bytes here). Number of such bytes for ECC engine must be whole OOB except 2 bytes for bad block marker, while proper ECC step size and strength will be selected by ECC logic. Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") Cc: Signed-off-by: Arseniy Krasnov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230705065211.293500-1-AVKrasnov@sberdevices.ru commit d8403b9eeee66d5dd81ecb9445800b108c267ce3 Author: Roger Quadros Date: Sun Jun 25 00:10:21 2023 +0530 mtd: rawnand: omap_elm: Fix incorrect type in assignment Once the ECC word endianness is converted to BE32, we force cast it to u32 so we can use elm_write_reg() which in turn uses writel(). Fixes below sparse warnings: drivers/mtd/nand/raw/omap_elm.c:180:37: sparse: expected unsigned int [usertype] val drivers/mtd/nand/raw/omap_elm.c:180:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:185:37: sparse: expected unsigned int [usertype] val drivers/mtd/nand/raw/omap_elm.c:185:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:190:37: sparse: expected unsigned int [usertype] val drivers/mtd/nand/raw/omap_elm.c:190:37: sparse: got restricted __be32 [usertype] >> drivers/mtd/nand/raw/omap_elm.c:200:40: sparse: sparse: restricted __be32 degrades to integer drivers/mtd/nand/raw/omap_elm.c:206:39: sparse: sparse: restricted __be32 degrades to integer drivers/mtd/nand/raw/omap_elm.c:210:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:210:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:213:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:213:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:216:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:216:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:219:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:219:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:222:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:222:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:225:37: sparse: expected unsigned int [assigned] [usertype] val drivers/mtd/nand/raw/omap_elm.c:225:37: sparse: got restricted __be32 [usertype] drivers/mtd/nand/raw/omap_elm.c:228:39: sparse: sparse: restricted __be32 degrades to integer Fixes: bf22433575ef ("mtd: devices: elm: Add support for ELM error correction") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306212211.WDXokuWh-lkp@intel.com/ Signed-off-by: Roger Quadros Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230624184021.7740-1-rogerq@kernel.org commit f5a05060670a4d8d6523afc7963eb559c2e3615f Author: Olivier Maignial Date: Fri Jun 23 17:33:37 2023 +0200 mtd: spinand: winbond: Fix ecc_get_status Reading ECC status is failing. w25n02kv_ecc_get_status() is using on-stack buffer for SPINAND_GET_FEATURE_OP() output. It is not suitable for DMA needs of spi-mem. Fix this by using the spi-mem operations dedicated buffer spinand->scratchbuf. See spinand->scratchbuf: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/mtd/spinand.h?h=v6.3#n418 spi_mem_check_op(): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/spi/spi-mem.c?h=v6.3#n199 Fixes: 6154c7a58348 ("mtd: spinand: winbond: add Winbond W25N02KV flash support") Cc: stable@vger.kernel.org Signed-off-by: Olivier Maignial Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/DB4P250MB1032EDB9E36B764A33769039FE23A@DB4P250MB1032.EURP250.PROD.OUTLOOK.COM commit 8544cda94dae6be3f1359539079c68bb731428b1 Author: Olivier Maignial Date: Fri Jun 23 17:33:36 2023 +0200 mtd: spinand: toshiba: Fix ecc_get_status Reading ECC status is failing. tx58cxgxsxraix_ecc_get_status() is using on-stack buffer for SPINAND_GET_FEATURE_OP() output. It is not suitable for DMA needs of spi-mem. Fix this by using the spi-mem operations dedicated buffer spinand->scratchbuf. See spinand->scratchbuf: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/mtd/spinand.h?h=v6.3#n418 spi_mem_check_op(): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/spi/spi-mem.c?h=v6.3#n199 Fixes: 10949af1681d ("mtd: spinand: Add initial support for Toshiba TC58CVG2S0H") Cc: stable@vger.kernel.org Signed-off-by: Olivier Maignial Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/DB4P250MB1032553D05FBE36DEE0D311EFE23A@DB4P250MB1032.EURP250.PROD.OUTLOOK.COM commit 963b54df82b6d6206d7def273390bf3f7af558e1 Author: Isaac J. Manjarres Date: Tue Jul 11 12:30:58 2023 -0700 regmap-irq: Fix out-of-bounds access when allocating config buffers When allocating the 2D array for handling IRQ type registers in regmap_add_irq_chip_fwnode(), the intent is to allocate a matrix with num_config_bases rows and num_config_regs columns. This is currently handled by allocating a buffer to hold a pointer for each row (i.e. num_config_bases). After that, the logic attempts to allocate the memory required to hold the register configuration for each row. However, instead of doing this allocation for each row (i.e. num_config_bases allocations), the logic erroneously does this allocation num_config_regs number of times. This scenario can lead to out-of-bounds accesses when num_config_regs is greater than num_config_bases. Fix this by updating the terminating condition of the loop that allocates the memory for holding the register configuration to allocate memory only for each row in the matrix. Amit Pundir reported a crash that was occurring on his db845c device due to memory corruption (see "Closes" tag for Amit's report). The KASAN report below helped narrow it down to this issue: [ 14.033877][ T1] ================================================================== [ 14.042507][ T1] BUG: KASAN: invalid-access in regmap_add_irq_chip_fwnode+0x594/0x1364 [ 14.050796][ T1] Write of size 8 at addr 06ffff8081021850 by task init/1 [ 14.242004][ T1] The buggy address belongs to the object at ffffff8081021850 [ 14.242004][ T1] which belongs to the cache kmalloc-8 of size 8 [ 14.255669][ T1] The buggy address is located 0 bytes inside of [ 14.255669][ T1] 8-byte region [ffffff8081021850, ffffff8081021858) Fixes: faa87ce9196d ("regmap-irq: Introduce config registers for irq types") Reported-by: Amit Pundir Closes: https://lore.kernel.org/all/CAMi1Hd04mu6JojT3y6wyN2YeVkPR5R3qnkKJ8iR8if_YByCn4w@mail.gmail.com/ Tested-by: John Stultz Tested-by: Amit Pundir # tested on Dragonboard 845c Cc: stable@vger.kernel.org # v6.0+ Cc: Aidan MacDonald Cc: Saravana Kannan Cc: Catalin Marinas Signed-off-by: "Isaac J. Manjarres" Link: https://lore.kernel.org/r/20230711193059.2480971-1-isaacmanjarres@google.com Signed-off-by: Mark Brown commit bfb5ef2219b7b28a6e328860438eb55027807289 Author: Viresh Kumar Date: Wed Jul 12 09:28:43 2023 +0530 cpufreq: sparc: Don't mark cpufreq callbacks with __init These callbacks can be called again by the cpufreq core after the driver is initialized and must be kept around. We currently get section mismatch build warnings. Don't mark them with __init. Fixes: dcfce7c2cee4 ("cpufreq: sparc: Don't allocate cpufreq_driver dynamically") Reported-by: Geert Uytterhoeven Signed-off-by: Viresh Kumar Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Signed-off-by: Rafael J. Wysocki commit d3f87278bcb80bd7f9519669d928b43320363d4f Author: Ido Schimmel Date: Tue Jul 11 10:08:09 2023 +0300 net/sched: flower: Ensure both minimum and maximum ports are specified The kernel does not currently validate that both the minimum and maximum ports of a port range are specified. This can lead user space to think that a filter matching on a port range was successfully added, when in fact it was not. For example, with a patched (buggy) iproute2 that only sends the minimum port, the following commands do not return an error: # tc filter add dev swp1 ingress pref 1 proto ip flower ip_proto udp src_port 100-200 action pass # tc filter add dev swp1 ingress pref 1 proto ip flower ip_proto udp dst_port 100-200 action pass # tc filter show dev swp1 ingress filter protocol ip pref 1 flower chain 0 filter protocol ip pref 1 flower chain 0 handle 0x1 eth_type ipv4 ip_proto udp not_in_hw action order 1: gact action pass random type none pass val 0 index 1 ref 1 bind 1 filter protocol ip pref 1 flower chain 0 handle 0x2 eth_type ipv4 ip_proto udp not_in_hw action order 1: gact action pass random type none pass val 0 index 2 ref 1 bind 1 Fix by returning an error unless both ports are specified: # tc filter add dev swp1 ingress pref 1 proto ip flower ip_proto udp src_port 100-200 action pass Error: Both min and max source ports must be specified. We have an error talking to the kernel # tc filter add dev swp1 ingress pref 1 proto ip flower ip_proto udp dst_port 100-200 action pass Error: Both min and max destination ports must be specified. We have an error talking to the kernel Fixes: 5c72299fba9d ("net: sched: cls_flower: Classify packets using port ranges") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit b6c9ebde5a967f40fdc462b0c27eff7e31fe6c28 Merge: e522c1bd0ab4f 0bcc62858d6ba Author: David S. Miller Date: Wed Jul 12 10:07:24 2023 +0100 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== igc: Fix corner cases for TSN offload Florian Kauer says: The igc driver supports several different offloading capabilities relevant in the TSN context. Recent patches in this area introduced regressions for certain corner cases that are fixed in this series. Each of the patches (except the first one) addresses a different regression that can be separately reproduced. Still, they have overlapping code changes so they should not be separately applied. Especially #4 and #6 address the same observation, but both need to be applied to avoid TX hang occurrences in the scenario described in the patches. ==================== Signed-off-by: Florian Kauer Reviewed-by: Kurt Kanzenbach Acked-by: Vinicius Costa Gomes Reviewed-by: Muhammad Husaini Zulkifli Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller commit e522c1bd0ab4f645885a3eef4e1dd920cc9ac3b6 Author: Andrew Halaney Date: Mon Jul 10 14:50:57 2023 -0500 MAINTAINERS: Add another mailing list for QUALCOMM ETHQOS ETHERNET DRIVER linux-arm-msm is the list most people subscribe to in order to receive updates about Qualcomm related drivers. Make sure changes for the Qualcomm ethernet driver make it there. Signed-off-by: Andrew Halaney Acked-by: Vinod Koul Link: https://lore.kernel.org/r/20230710195240.197047-1-ahalaney@redhat.com Signed-off-by: Jakub Kicinski commit cf28792facaa9c1c4f5a246d6a364761f7835870 Author: Jakub Kicinski Date: Mon Jul 10 10:46:36 2023 -0700 docs: netdev: update the URL of the status page Move the status page from vger to the same server as mailbot. Link: https://lore.kernel.org/r/20230710174636.1174684-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 12a89f0177092dbc2a1cb1d05a9790adbcea2309 Author: Johannes Berg Date: Mon Jul 10 16:50:39 2023 +0200 wifi: iwlwifi: remove 'use_tfh' config to fix crash This is equivalent to 'gen2', and it was always confusing to have two identical config entries. The split config patch actually had been originally developed after removing 'use_tfh" and didn't add the use_tfh in the new configs as they'd later been copied to the new files. Thus the easiest way to fix the init crash here now is to just remove use_tfh (which is erroneously unset in most of the configs now) and use 'gen2' in the code instead. There's possibly still an unwind error in iwl_txq_gen2_init() as it crashes if TXQ 0 fails to initialize, but we can deal with it later since the original failure is due to the use_tfh confusion. Tested-by: Xi Ruoyao Reported-and-tested-by: Niklāvs Koļesņikovs Reported-and-tested-by: Jeff Chua Reported-and-tested-by: Zhang Rui Link: https://bugzilla.kernel.org/show_bug.cgi?id=217622 Link: https://lore.kernel.org/all/9274d9bd3d080a457649ff5addcc1726f08ef5b2.camel@xry111.site/ Link: https://lore.kernel.org/all/CAAJw_Zug6VCS5ZqTWaFSr9sd85k%3DtyPm9DEE%2BmV%3DAKoECZM%2BsQ@mail.gmail.com/ Fixes: 19898ce9cf8a ("wifi: iwlwifi: split 22000.c into multiple files") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20230710145038.84186-2-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit 2e06c57d66d3f6c26faa5f5b479fb3add34ce85a Author: Larysa Zaremba Date: Tue Jul 11 12:59:26 2023 +0200 xdp: use trusted arguments in XDP hints kfuncs Currently, verifier does not reject XDP programs that pass NULL pointer to hints functions. At the same time, this case is not handled in any driver implementation (including veth). For example, changing bpf_xdp_metadata_rx_timestamp(ctx, ×tamp); to bpf_xdp_metadata_rx_timestamp(ctx, NULL); in xdp_metadata test successfully crashes the system. Add KF_TRUSTED_ARGS flag to hints kfunc definitions, so driver code does not have to worry about getting invalid pointers. Fixes: 3d76a4d3d4e5 ("bpf: XDP metadata RX kfuncs") Reported-by: Stanislav Fomichev Closes: https://lore.kernel.org/bpf/ZKWo0BbpLfkZHbyE@google.com/ Signed-off-by: Larysa Zaremba Acked-by: Jesper Dangaard Brouer Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20230711105930.29170-1-larysa.zaremba@intel.com Signed-off-by: Alexei Starovoitov commit 4369016497319a9635702da010d02af1ebb1849d Author: Pu Lehui Date: Tue Jul 11 19:58:48 2023 +0800 bpf: cpumap: Fix memory leak in cpu_map_update_elem Syzkaller reported a memory leak as follows: BUG: memory leak unreferenced object 0xff110001198ef748 (size 192): comm "syz-executor.3", pid 17672, jiffies 4298118891 (age 9.906s) hex dump (first 32 bytes): 00 00 00 00 4a 19 00 00 80 ad e3 e4 fe ff c0 00 ....J........... 00 b2 d3 0c 01 00 11 ff 28 f5 8e 19 01 00 11 ff ........(....... backtrace: [] __cpu_map_entry_alloc+0xf7/0xb00 [] cpu_map_update_elem+0x2fe/0x3d0 [] bpf_map_update_value.isra.0+0x2bd/0x520 [] map_update_elem+0x4cb/0x720 [] __se_sys_bpf+0x8c3/0xb90 [] do_syscall_64+0x30/0x40 [] entry_SYSCALL_64_after_hwframe+0x61/0xc6 BUG: memory leak unreferenced object 0xff110001198ef528 (size 192): comm "syz-executor.3", pid 17672, jiffies 4298118891 (age 9.906s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] __cpu_map_entry_alloc+0x260/0xb00 [] cpu_map_update_elem+0x2fe/0x3d0 [] bpf_map_update_value.isra.0+0x2bd/0x520 [] map_update_elem+0x4cb/0x720 [] __se_sys_bpf+0x8c3/0xb90 [] do_syscall_64+0x30/0x40 [] entry_SYSCALL_64_after_hwframe+0x61/0xc6 BUG: memory leak unreferenced object 0xff1100010fd93d68 (size 8): comm "syz-executor.3", pid 17672, jiffies 4298118891 (age 9.906s) hex dump (first 8 bytes): 00 00 00 00 00 00 00 00 ........ backtrace: [] kvmalloc_node+0x11e/0x170 [] __cpu_map_entry_alloc+0x2f0/0xb00 [] cpu_map_update_elem+0x2fe/0x3d0 [] bpf_map_update_value.isra.0+0x2bd/0x520 [] map_update_elem+0x4cb/0x720 [] __se_sys_bpf+0x8c3/0xb90 [] do_syscall_64+0x30/0x40 [] entry_SYSCALL_64_after_hwframe+0x61/0xc6 In the cpu_map_update_elem flow, when kthread_stop is called before calling the threadfn of rcpu->kthread, since the KTHREAD_SHOULD_STOP bit of kthread has been set by kthread_stop, the threadfn of rcpu->kthread will never be executed, and rcpu->refcnt will never be 0, which will lead to the allocated rcpu, rcpu->queue and rcpu->queue->queue cannot be released. Calling kthread_stop before executing kthread's threadfn will return -EINTR. We can complete the release of memory resources in this state. Fixes: 6710e1126934 ("bpf: introduce new bpf cpu map type BPF_MAP_TYPE_CPUMAP") Signed-off-by: Pu Lehui Acked-by: Jesper Dangaard Brouer Acked-by: Hou Tao Link: https://lore.kernel.org/r/20230711115848.2701559-1-pulehui@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 9373771aaed17f5c2c38485f785568abe3a9f8c1 Author: Randy Dunlap Date: Sun Jul 9 06:31:54 2023 -0700 wifi: airo: avoid uninitialized warning in airo_get_rate() Quieten a gcc (11.3.0) build error or warning by checking the function call status and returning -EBUSY if the function call failed. This is similar to what several other wireless drivers do for the SIOCGIWRATE ioctl call when there is a locking problem. drivers/net/wireless/cisco/airo.c: error: 'status_rid.currentXmitRate' is used uninitialized [-Werror=uninitialized] Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Randy Dunlap Reported-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/39abf2c7-24a-f167-91da-ed4c5435d1c4@linux-m68k.org Link: https://lore.kernel.org/r/20230709133154.26206-1-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit 0bb8f49cd2cc8cb32ac51189ff9fcbe7ec3d9d65 Author: Rob Herring Date: Mon Jul 10 11:40:07 2023 -0600 of: Preserve "of-display" device name for compatibility Since commit 241d2fb56a18 ("of: Make OF framebuffer device names unique"), as spotted by Frédéric Bonnard, the historical "of-display" device is gone: the updated logic creates "of-display.0" instead, then as many "of-display.N" as required. This means that offb no longer finds the expected device, which prevents the Debian Installer from setting up its interface, at least on ppc64el. Fix this by keeping "of-display" for the first device and "of-display.N" for subsequent devices. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217328 Link: https://bugs.debian.org/1033058 Fixes: 241d2fb56a18 ("of: Make OF framebuffer device names unique") Cc: stable@vger.kernel.org Cc: Cyril Brulebois Cc: Thomas Zimmermann Cc: Helge Deller Acked-by: Helge Deller Acked-by: Thomas Zimmermann Reviewed-by: Michal Suchánek Link: https://lore.kernel.org/r/20230710174007.2291013-1-robh@kernel.org Signed-off-by: Rob Herring commit b2ec116aad38aa9c8b67fad4314e50823adf6949 Author: Geert Uytterhoeven Date: Tue Jul 11 12:38:20 2023 +0200 workqueue: Fix cpu_intensive_thresh_us name in help text There exists no parameter called "cpu_intensive_threshold_us". The actual parameter name is "cpu_intensive_thresh_us". Fixes: 6363845005202148 ("workqueue: Report work funcs that trigger automatic CPU_INTENSIVE mechanism") Signed-off-by: Geert Uytterhoeven Reviewed-by: Randy Dunlap Signed-off-by: Tejun Heo commit 5fc52248559802f0f1ac10b3c8729a1568216715 Author: Petr Pavlu Date: Tue Jul 11 14:50:54 2023 +0200 vmlinux.lds.h: Remove a reference to no longer used sections .text..refcount Sections .text..refcount were previously used to hold an error path code for fast refcount overflow protection on x86, see commit 7a46ec0e2f48 ("locking/refcounts, x86/asm: Implement fast refcount overflow protection") and commit 564c9cc84e2a ("locking/refcounts, x86/asm: Use unique .text section for refcount exceptions"). The code was replaced and removed in commit fb041bb7c0a9 ("locking/refcount: Consolidate implementations of refcount_t") and no sections .text..refcount are present since then. Remove then a relic referencing these sections from TEXT_TEXT to avoid confusing people, like me. This is a non-functional change. Signed-off-by: Petr Pavlu Link: https://lore.kernel.org/r/20230711125054.9000-1-petr.pavlu@suse.com Signed-off-by: Kees Cook commit db66795f61354c373ecdadbdae1ed253a96c47cb Author: Dinh Nguyen Date: Tue Jul 11 15:44:30 2023 -0500 arm64: dts: stratix10: fix incorrect I2C property for SCL signal The correct dts property for the SCL falling time is "i2c-scl-falling-time-ns". Fixes: c8da1d15b8a4 ("arm64: dts: stratix10: i2c clock running out of spec") Cc: stable@vger.kernel.org Signed-off-by: Dinh Nguyen commit 4b96679170c63be361d1b0fdeb81bb0ef207dbcb Author: Ian Rogers Date: Fri Jul 7 16:09:26 2023 -0700 libsubcmd: Avoid SEGV/use-after-free when commands aren't excluded The array shortening may perform unnecessary array copies. Before commit 657a3efee43a ("lib subcmd: Avoid memory leak in exclude_cmds") this was benign, but afterwards this could lead to a SEGV. Fixes: 657a3efee43a29d1 ("lib subcmd: Avoid memory leak in exclude_cmds") Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Chenyuan Mi Cc: Ian Rogers Link: https://lore.kernel.org/r/20230707230926.841086-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 970dee09b230895fe2230d2b32ad05a2826818c6 Author: Marc Zyngier Date: Mon Jul 3 17:35:48 2023 +0100 KVM: arm64: Disable preemption in kvm_arch_hardware_enable() Since 0bf50497f03b ("KVM: Drop kvm_count_lock and instead protect kvm_usage_count with kvm_lock"), hotplugging back a CPU whilst a guest is running results in a number of ugly splats as most of this code expects to run with preemption disabled, which isn't the case anymore. While the context is preemptable, it isn't migratable, which should be enough. But we have plenty of preemptible() checks all over the place, and our per-CPU accessors also disable preemption. Since this affects released versions, let's do the easy fix first, disabling preemption in kvm_arch_hardware_enable(). We can always revisit this with a more invasive fix in the future. Fixes: 0bf50497f03b ("KVM: Drop kvm_count_lock and instead protect kvm_usage_count with kvm_lock") Reported-by: Kristina Martsenko Tested-by: Kristina Martsenko Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/aeab7562-2d39-e78e-93b1-4711f8cc3fa5@arm.com Cc: stable@vger.kernel.org # v6.3, v6.4 Link: https://lore.kernel.org/r/20230703163548.1498943-1-maz@kernel.org Signed-off-by: Oliver Upton commit fa729bc7c9c8c17a2481358c841ef8ca920485d3 Author: Sudeep Holla Date: Tue Jul 4 20:32:43 2023 +0100 KVM: arm64: Handle kvm_arm_init failure correctly in finalize_pkvm Currently there is no synchronisation between finalize_pkvm() and kvm_arm_init() initcalls. The finalize_pkvm() proceeds happily even if kvm_arm_init() fails resulting in the following warning on all the CPUs and eventually a HYP panic: | kvm [1]: IPA Size Limit: 48 bits | kvm [1]: Failed to init hyp memory protection | kvm [1]: error initializing Hyp mode: -22 | | | | WARNING: CPU: 0 PID: 0 at arch/arm64/kvm/pkvm.c:226 _kvm_host_prot_finalize+0x30/0x50 | Modules linked in: | CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.4.0 #237 | Hardware name: FVP Base RevC (DT) | pstate: 634020c5 (nZCv daIF +PAN -UAO +TCO +DIT -SSBS BTYPE=--) | pc : _kvm_host_prot_finalize+0x30/0x50 | lr : __flush_smp_call_function_queue+0xd8/0x230 | | Call trace: | _kvm_host_prot_finalize+0x3c/0x50 | on_each_cpu_cond_mask+0x3c/0x6c | pkvm_drop_host_privileges+0x4c/0x78 | finalize_pkvm+0x3c/0x5c | do_one_initcall+0xcc/0x240 | do_initcall_level+0x8c/0xac | do_initcalls+0x54/0x94 | do_basic_setup+0x1c/0x28 | kernel_init_freeable+0x100/0x16c | kernel_init+0x20/0x1a0 | ret_from_fork+0x10/0x20 | Failed to finalize Hyp protection: -22 | dtb=fvp-base-revc.dtb | kvm [95]: nVHE hyp BUG at: arch/arm64/kvm/hyp/nvhe/mem_protect.c:540! | kvm [95]: nVHE call trace: | kvm [95]: [] __kvm_nvhe_hyp_panic+0xac/0xf8 | kvm [95]: [] __kvm_nvhe_handle_host_mem_abort+0x1a0/0x2ac | kvm [95]: [] __kvm_nvhe_handle_trap+0x4c/0x160 | kvm [95]: [] __kvm_nvhe___skip_pauth_save+0x4/0x4 | kvm [95]: ---[ end nVHE call trace ]--- | kvm [95]: Hyp Offset: 0xfffe8db00ffa0000 | Kernel panic - not syncing: HYP panic: | PS:a34023c9 PC:0000f250710b973c ESR:00000000f2000800 | FAR:ffff000800cb00d0 HPFAR:000000000880cb00 PAR:0000000000000000 | VCPU:0000000000000000 | CPU: 3 PID: 95 Comm: kworker/u16:2 Tainted: G W 6.4.0 #237 | Hardware name: FVP Base RevC (DT) | Workqueue: rpciod rpc_async_schedule | Call trace: | dump_backtrace+0xec/0x108 | show_stack+0x18/0x2c | dump_stack_lvl+0x50/0x68 | dump_stack+0x18/0x24 | panic+0x138/0x33c | nvhe_hyp_panic_handler+0x100/0x184 | new_slab+0x23c/0x54c | ___slab_alloc+0x3e4/0x770 | kmem_cache_alloc_node+0x1f0/0x278 | __alloc_skb+0xdc/0x294 | tcp_stream_alloc_skb+0x2c/0xf0 | tcp_sendmsg_locked+0x3d0/0xda4 | tcp_sendmsg+0x38/0x5c | inet_sendmsg+0x44/0x60 | sock_sendmsg+0x1c/0x34 | xprt_sock_sendmsg+0xdc/0x274 | xs_tcp_send_request+0x1ac/0x28c | xprt_transmit+0xcc/0x300 | call_transmit+0x78/0x90 | __rpc_execute+0x114/0x3d8 | rpc_async_schedule+0x28/0x48 | process_one_work+0x1d8/0x314 | worker_thread+0x248/0x474 | kthread+0xfc/0x184 | ret_from_fork+0x10/0x20 | SMP: stopping secondary CPUs | Kernel Offset: 0x57c5cb460000 from 0xffff800080000000 | PHYS_OFFSET: 0x80000000 | CPU features: 0x00000000,1035b7a3,ccfe773f | Memory Limit: none | ---[ end Kernel panic - not syncing: HYP panic: | PS:a34023c9 PC:0000f250710b973c ESR:00000000f2000800 | FAR:ffff000800cb00d0 HPFAR:000000000880cb00 PAR:0000000000000000 | VCPU:0000000000000000 ]--- Fix it by checking for the successfull initialisation of kvm_arm_init() in finalize_pkvm() before proceeding any futher. Fixes: 87727ba2bb05 ("KVM: arm64: Ensure CPU PMU probes before pKVM host de-privilege") Cc: Will Deacon Cc: Marc Zyngier Cc: Oliver Upton Cc: James Morse Cc: Suzuki K Poulose Cc: Zenghui Yu Signed-off-by: Sudeep Holla Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20230704193243.3300506-1-sudeep.holla@arm.com Signed-off-by: Oliver Upton commit fe769e6c1f80f542d6f4e7f7c8c6bf20c1307f99 Author: Marc Zyngier Date: Tue Jun 27 15:05:57 2023 +0100 KVM: arm64: timers: Use CNTHCTL_EL2 when setting non-CNTKCTL_EL1 bits It recently appeared that, when running VHE, there is a notable difference between using CNTKCTL_EL1 and CNTHCTL_EL2, despite what the architecture documents: - When accessed from EL2, bits [19:18] and [16:10] of CNTKCTL_EL1 have the same assignment as CNTHCTL_EL2 - When accessed from EL1, bits [19:18] and [16:10] are RES0 It is all OK, until you factor in NV, where the EL2 guest runs at EL1. In this configuration, CNTKCTL_EL11 doesn't trap, nor ends up in the VNCR page. This means that any write from the guest affecting CNTHCTL_EL2 using CNTKCTL_EL1 ends up losing some state. Not good. The fix it obvious: don't use CNTKCTL_EL1 if you want to change bits that are not part of the EL1 definition of CNTKCTL_EL1, and use CNTHCTL_EL2 instead. This doesn't change anything for a bare-metal OS, and fixes it when running under NV. The NV hypervisor will itself have to work harder to merge the two accessors. Note that there is a pending update to the architecture to address this issue by making the affected bits UNKNOWN when CNTKCTL_EL1 is used from EL2 with VHE enabled. Fixes: c605ee245097 ("KVM: arm64: timers: Allow physical offset without CNTPOFF_EL2") Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org # v6.4 Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20230627140557.544885-1-maz@kernel.org Signed-off-by: Oliver Upton commit 3a8395b565b5b4f019b3dc182be4c4541eb35ac8 Author: Chungkai Yang Date: Wed Jul 5 16:59:07 2023 +0800 PM: QoS: Restore support for default value on frequency QoS Commit 8d36694245f2 ("PM: QoS: Add check to make sure CPU freq is non-negative") makes sure CPU freq is non-negative to avoid negative value converting to unsigned data type. However, when the value is PM_QOS_DEFAULT_VALUE, pm_qos_update_target specifically uses c->default_value which is set to FREQ_QOS_MIN/MAX_DEFAULT_VALUE when cpufreq_policy_alloc is executed, for this case handling. Adding check for PM_QOS_DEFAULT_VALUE to let default setting work will fix this problem. Fixes: 8d36694245f2 ("PM: QoS: Add check to make sure CPU freq is non-negative") Link: https://lore.kernel.org/lkml/20230626035144.19717-1-Chung-kai.Yang@mediatek.com/ Link: https://lore.kernel.org/lkml/20230627071727.16646-1-Chung-kai.Yang@mediatek.com/ Link: https://lore.kernel.org/lkml/CAJZ5v0gxNOWhC58PHeUhW_tgf6d1fGJVZ1x91zkDdht11yUv-A@mail.gmail.com/ Signed-off-by: Chungkai Yang Cc: 6.0+ # 6.0+ Signed-off-by: Rafael J. Wysocki commit c9e4bf607d8c431452ef362c00e62ce999bbae93 Author: Azat Khuzhin Date: Tue Jul 11 13:48:12 2023 +0200 PM: hibernate: Fix writing maj:min to /sys/power/resume resume_store() first calls lookup_bdev() and after tries to handle maj:min, but it does not reset the error before, hence if you will write maj:min you will get ENOENT: # echo 259:2 >| /sys/power/resume bash: echo: write error: No such file or directory This also should fix hiberation via systemd, since it uses this way. Fixes: 1e8c813b083c4 ("PM: hibernate: don't use early_lookup_bdev in resume_store") Signed-off-by: Azat Khuzhin Reviewed-by: Christoph Hellwig [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki commit d6e724d3ef0b37aa425267921100c89e378eb4a9 Author: Palmer Dabbelt Date: Mon Jul 10 12:33:30 2023 -0700 Documentation: RISC-V: hwprobe: Fix a formatting error I'm not sure what I was trying to do with the ':'s, but they're just rendered to HTML which looks odd. This makes "fence.i" look like "mvendorid" and such, which is seems reasonable to me. Reviewed-by: Evan Green Link: https://lore.kernel.org/r/20230710193329.2742-1-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit 18bddc5b67038722cb88fcf51fbf41a0277092cb Author: Xin Yin Date: Tue Jul 11 14:21:30 2023 +0800 erofs: fix fsdax unavailability for chunk-based regular files DAX can be used to share page cache between VMs, reducing guest memory overhead. And chunk based data format is widely used for VM and container image. So enable dax support for it, make erofs better used for VM scenarios. Fixes: c5aa903a59db ("erofs: support reading chunk-based uncompressed files") Signed-off-by: Xin Yin Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20230711062130.7860-1-yinxin.x@bytedance.com Signed-off-by: Gao Xiang commit 8191213a5835b0317c5e4d0d337ae1ae00c75253 Author: Chunhai Guo Date: Mon Jul 10 17:34:10 2023 +0800 erofs: avoid infinite loop in z_erofs_do_read_page() when reading beyond EOF z_erofs_do_read_page() may loop infinitely due to the inappropriate truncation in the below statement. Since the offset is 64 bits and min_t() truncates the result to 32 bits. The solution is to replace unsigned int with a 64-bit type, such as erofs_off_t. cur = end - min_t(unsigned int, offset + end - map->m_la, end); - For example: - offset = 0x400160000 - end = 0x370 - map->m_la = 0x160370 - offset + end - map->m_la = 0x400000000 - offset + end - map->m_la = 0x00000000 (truncated as unsigned int) - Expected result: - cur = 0 - Actual result: - cur = 0x370 Signed-off-by: Chunhai Guo Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support") Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20230710093410.44071-1-guochunhai@vivo.com Signed-off-by: Gao Xiang commit 936aa701d82d397c2d1afcd18ce2c739471d978d Author: Chunhai Guo Date: Mon Jul 10 12:25:31 2023 +0800 erofs: avoid useless loops in z_erofs_pcluster_readmore() when reading beyond EOF z_erofs_pcluster_readmore() may take a long time to loop when the page offset is large enough, which is unnecessary should be prevented. For example, when the following case is encountered, it will loop 4691368 times, taking about 27 seconds: - offset = 19217289215 - inode_size = 1442672 Signed-off-by: Chunhai Guo Fixes: 386292919c25 ("erofs: introduce readmore decompression strategy") Reviewed-by: Gao Xiang Reviewed-by: Yue Hu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20230710042531.28761-1-guochunhai@vivo.com Signed-off-by: Gao Xiang commit c5539762f32e97c5e16215fa1336e32095b8b0fd Author: Gao Xiang Date: Wed Jun 28 00:12:40 2023 +0800 erofs: simplify z_erofs_transform_plain() Use memcpy_to_page() instead of open-coding them. In addition, add a missing flush_dcache_page() even though almost all modern architectures clear `PG_dcache_clean` flag for new file cache pages so that it doesn't change anything in practice. Signed-off-by: Gao Xiang Reviewed-by: Yue Hu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20230627161240.331-2-hsiangkao@linux.alibaba.com Signed-off-by: Gao Xiang commit 123ec246ebe323d468c5ca996700ea4739d20ddf Author: Gao Xiang Date: Wed Jun 28 00:12:39 2023 +0800 erofs: get rid of the remaining kmap_atomic() It's unnecessary to use kmap_atomic() compared with kmap_local_page(). In addition, kmap_atomic() is deprecated now. Signed-off-by: Gao Xiang Reviewed-by: Yue Hu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20230627161240.331-1-hsiangkao@linux.alibaba.com Signed-off-by: Gao Xiang commit f4d1a8e011909fee24643f84bd1196e1366c26f2 Author: Michael Kelley Date: Fri Jul 7 21:01:26 2023 -0700 scsi: storvsc: Handle SRB status value 0x30 In response to a disk I/O request, Hyper-V has been observed to return SRB status value 0x30. This indicates the request was not processed by Hyper-V because low memory conditions on the host caused an internal error. The 0x30 status is not recognized by storvsc, so the I/O operation is not flagged as an error. The request is treated as if it completed normally but with zero data transferred, causing a flood of retries. Add a definition for this SRB status value and handle it like other error statuses from the Hyper-V host. Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1688788886-94279-1-git-send-email-mikelley@microsoft.com Signed-off-by: Martin K. Petersen commit ad07149f34dbb3e0f4e25e19ef80bdd3216ba1cf Author: Arnaldo Carvalho de Melo Date: Tue Jul 11 13:23:02 2023 -0300 tools headers UAPI: Sync linux/prctl.h with the kernel sources To pick the changes in: 1fd96a3e9d5d4feb ("riscv: Add prctl controls for userspace vector management") That adds some RISC-V specific prctl options: $ tools/perf/trace/beauty/prctl_option.sh > before $ cp include/uapi/linux/prctl.h tools/include/uapi/linux/prctl.h $ tools/perf/trace/beauty/prctl_option.sh > after $ diff -u before after --- before 2023-07-11 13:22:01.928705942 -0300 +++ after 2023-07-11 13:22:36.342645970 -0300 @@ -63,6 +63,8 @@ [66] = "GET_MDWE", [67] = "SET_MEMORY_MERGE", [68] = "GET_MEMORY_MERGE", + [69] = "RISCV_V_SET_CONTROL", + [70] = "RISCV_V_GET_CONTROL", }; static const char *prctl_set_mm_options[] = { [1] = "START_CODE", $ That now will be used to decode the syscall option and also to compose filters, for instance: [root@five ~]# perf trace -e syscalls:sys_enter_prctl --filter option==SET_NAME 0.000 Isolated Servi/3474327 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23f13b7aee) 0.032 DOM Worker/3474327 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23deb25670) 7.920 :3474328/3474328 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23e24fbb10) 7.935 StreamT~s #374/3474328 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23e24fb970) 8.400 Isolated Servi/3474329 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23e24bab10) 8.418 StreamT~s #374/3474329 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23e24ba970) ^C[root@five ~]# This addresses this perf build warning: Warning: Kernel ABI header differences: diff -u tools/include/uapi/linux/prctl.h include/uapi/linux/prctl.h Cc: Adrian Hunter Cc: Andy Chiu Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Palmer Dabbelt Link: https://lore.kernel.org/lkml/ZK2DhOB6JJKu2A7M@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a87834d19aa2bf455e2fd9309ef4754eccd8459a Author: Thomas Richter Date: Tue Jul 11 15:53:38 2023 +0200 perf build: Fix broken feature check for libtracefs due to external lib changes The perf build process auto-detects features and packages already installed for its build. This is done in directory tools/build/feature. This directory contains small sample programs. When they successfully compile the necessary prereqs in form of libraries and header files are present. Such a check is also done for libtracefs. And this check fails: Output before: # rm -f test-libtracefs.bin; make test-libtracefs.bin gcc -MD -Wall -Werror -o test-libtracefs.bin test-libtracefs.c \ > test-libtracefs.make.output 2>&1 -ltracefs make: *** [Makefile:211: test-libtracefs.bin] Error 1 # cat test-libtracefs.make.output In file included from test-libtracefs.c:2: /usr/include/tracefs/tracefs.h:11:10: fatal error: \ event-parse.h: No such file or directory 11 | #include | ^~~~~~~~~~~~~~~ compilation terminated. # The root cause of this compile error is commit 880885d9c22e ("libtracefs: Remove "traceevent/" from referencing libtraceevent headers") in the libtracefs project hosted here: https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ That mentioned patch removes the traceevent/ directory name from the include statement, causing the file not to be included even when the libtraceevent-devel package is installed. This package contains the file referred to in tracefs/tracefs.h: # rpm -ql libtraceevent-devel /usr/include/traceevent /usr/include/traceevent/event-parse.h <----- here /usr/include/traceevent/event-utils.h /usr/include/traceevent/kbuffer.h /usr/include/traceevent/trace-seq.h /usr/lib64/libtraceevent.so /usr/lib64/pkgconfig/libtraceevent.pc # With this patch the compile succeeds. Output after: # rm -f test-libtracefs.bin; make test-libtracefs.bin gcc -MD -Wall -Werror -o test-libtracefs.bin test-libtracefs.c \ > test-libtracefs.make.output 2>&1 -I/usr/include/traceevent -ltracefs # Committer testing: $ make -k BUILD_BPF_SKEL=1 CORESIGHT=1 O=/tmp/build/perf-tools -C tools/perf install-bin Before: $ cat /tmp/build/perf-tools/feature/test-libtracefs.make.output In file included from test-libtracefs.c:2: /usr/include/tracefs/tracefs.h:11:10: fatal error: event-parse.h: No such file or directory 11 | #include | ^~~~~~~~~~~~~~~ compilation terminated. $ $ grep -i tracefs /tmp/build/perf-tools/FEATURE-DUMP feature-libtracefs=0 $ After: $ cat /tmp/build/perf-tools/feature/test-libtracefs.make.output $ $ grep -i tracefs /tmp/build/perf-tools/FEATURE-DUMP feature-libtracefs=1 $ Signed-off-by: Thomas Richter Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Jiri Olsa Cc: Steven Rostedt (VMware) Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Vasily Gorbik Link: https://lore.kernel.org/r/20230711135338.397473-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit e96277a570cda96f1363a051b6a1a321f2ec2d35 Merge: 06c2afb862f9d a97ccaa4f0439 Author: Martin K. Petersen Date: Tue Jul 11 12:15:15 2023 -0400 Merge branch '6.5/scsi-staging' into 6.5/scsi-fixes Pull in the currently staged SCSI fixes for 6.5. Signed-off-by: Martin K. Petersen commit 920b91d92702784f34b7c70b86ca051ba1c94430 Author: Arnaldo Carvalho de Melo Date: Tue Jul 11 12:51:37 2023 -0300 tools include UAPI: Sync linux/mount.h copy with the kernel sources To pick the changes from: 6ac392815628f317 ("fs: allow to mount beneath top mount") That, after a fix to the move_mount_flags.sh script, harvests the new MOVE_MOUNT_BENEATH move_mount flag: $ tools/perf/trace/beauty/move_mount_flags.sh > before $ cp include/uapi/linux/mount.h tools/include/uapi/linux/mount.h $ tools/perf/trace/beauty/move_mount_flags.sh > after $ $ diff -u before after --- before 2023-07-11 12:38:49.244886707 -0300 +++ after 2023-07-11 12:51:15.125255940 -0300 @@ -6,4 +6,5 @@ [ilog2(0x00000020) + 1] = "T_AUTOMOUNTS", [ilog2(0x00000040) + 1] = "T_EMPTY_PATH", [ilog2(0x00000100) + 1] = "SET_GROUP", + [ilog2(0x00000200) + 1] = "BENEATH", }; $ That will then be properly decoded when used in tools like: # perf trace -e move_mount This addresses this perf build warning: Warning: Kernel ABI header differences: diff -u tools/include/uapi/linux/mount.h include/uapi/linux/mount.h Cc: Christian Brauner Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ZK17kifP%2FiYl+Hcc@kernel.org/ Signed-off-by: Arnaldo Carvalho de Melo commit 225bbf44bffd30dfde7449c9e74b3ea238397113 Author: Arnaldo Carvalho de Melo Date: Tue Jul 11 12:33:30 2023 -0300 tools headers UAPI: Sync linux/kvm.h with the kernel sources To pick the changes in: 89d01306e34d6ace ("RISC-V: KVM: Implement device interface for AIA irqchip") 22725266bdf95bdd ("KVM: Fix comment for KVM_ENABLE_CAP") 2f440b72e852be42 ("KVM: arm64: Add KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE") That just rebuilds perf, as these patches don't add any new KVM ioctl to be harvested for the the 'perf trace' ioctl syscall argument beautifiers. This addresses this perf build warning: Warning: Kernel ABI header differences: diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h Cc: Adrian Hunter Cc: Anup Patel Cc: Binbin Wu Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Oliver Upton Cc: Ricardo Koller Cc: Sean Christopherson Link: https://lore.kernel.org/lkml/ZK12+virXMIXMysy@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0657b20c5a76c938612f8409735a8830d257866e Author: Filipe Manana Date: Wed Jun 28 17:13:37 2023 +0100 btrfs: fix use-after-free of new block group that became unused If a task creates a new block group and that block group becomes unused before we finish its creation, at btrfs_create_pending_block_groups(), then when btrfs_mark_bg_unused() is called against the block group, we assume that the block group is currently in the list of block groups to reclaim, and we move it out of the list of new block groups and into the list of unused block groups. This has two consequences: 1) We move it out of the list of new block groups associated to the current transaction. So the block group creation is not finished and if we attempt to delete the bg because it's unused, we will not find the block group item in the extent tree (or the new block group tree), its device extent items in the device tree etc, resulting in the deletion to fail due to the missing items; 2) We don't increment the reference count on the block group when we move it to the list of unused block groups, because we assumed the block group was on the list of block groups to reclaim, and in that case it already has the correct reference count. However the block group was on the list of new block groups, in which case no extra reference was taken because it's local to the current task. This later results in doing an extra reference count decrement when removing the block group from the unused list, eventually leading the reference count to 0. This second case was caught when running generic/297 from fstests, which produced the following assertion failure and stack trace: [589.559] assertion failed: refcount_read(&block_group->refs) == 1, in fs/btrfs/block-group.c:4299 [589.559] ------------[ cut here ]------------ [589.559] kernel BUG at fs/btrfs/block-group.c:4299! [589.560] invalid opcode: 0000 [#1] PREEMPT SMP PTI [589.560] CPU: 8 PID: 2819134 Comm: umount Tainted: G W 6.4.0-rc6-btrfs-next-134+ #1 [589.560] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014 [589.560] RIP: 0010:btrfs_free_block_groups+0x449/0x4a0 [btrfs] [589.561] Code: 68 62 da c0 (...) [589.561] RSP: 0018:ffffa55a8c3b3d98 EFLAGS: 00010246 [589.561] RAX: 0000000000000058 RBX: ffff8f030d7f2000 RCX: 0000000000000000 [589.562] RDX: 0000000000000000 RSI: ffffffff953f0878 RDI: 00000000ffffffff [589.562] RBP: ffff8f030d7f2088 R08: 0000000000000000 R09: ffffa55a8c3b3c50 [589.562] R10: 0000000000000001 R11: 0000000000000001 R12: ffff8f05850b4c00 [589.562] R13: ffff8f030d7f2090 R14: ffff8f05850b4cd8 R15: dead000000000100 [589.563] FS: 00007f497fd2e840(0000) GS:ffff8f09dfc00000(0000) knlGS:0000000000000000 [589.563] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [589.563] CR2: 00007f497ff8ec10 CR3: 0000000271472006 CR4: 0000000000370ee0 [589.563] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [589.564] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [589.564] Call Trace: [589.564] [589.565] ? __die_body+0x1b/0x60 [589.565] ? die+0x39/0x60 [589.565] ? do_trap+0xeb/0x110 [589.565] ? btrfs_free_block_groups+0x449/0x4a0 [btrfs] [589.566] ? do_error_trap+0x6a/0x90 [589.566] ? btrfs_free_block_groups+0x449/0x4a0 [btrfs] [589.566] ? exc_invalid_op+0x4e/0x70 [589.566] ? btrfs_free_block_groups+0x449/0x4a0 [btrfs] [589.567] ? asm_exc_invalid_op+0x16/0x20 [589.567] ? btrfs_free_block_groups+0x449/0x4a0 [btrfs] [589.567] ? btrfs_free_block_groups+0x449/0x4a0 [btrfs] [589.567] close_ctree+0x35d/0x560 [btrfs] [589.568] ? fsnotify_sb_delete+0x13e/0x1d0 [589.568] ? dispose_list+0x3a/0x50 [589.568] ? evict_inodes+0x151/0x1a0 [589.568] generic_shutdown_super+0x73/0x1a0 [589.569] kill_anon_super+0x14/0x30 [589.569] btrfs_kill_super+0x12/0x20 [btrfs] [589.569] deactivate_locked_super+0x2e/0x70 [589.569] cleanup_mnt+0x104/0x160 [589.570] task_work_run+0x56/0x90 [589.570] exit_to_user_mode_prepare+0x160/0x170 [589.570] syscall_exit_to_user_mode+0x22/0x50 [589.570] ? __x64_sys_umount+0x12/0x20 [589.571] do_syscall_64+0x48/0x90 [589.571] entry_SYSCALL_64_after_hwframe+0x72/0xdc [589.571] RIP: 0033:0x7f497ff0a567 [589.571] Code: af 98 0e (...) [589.572] RSP: 002b:00007ffc98347358 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 [589.572] RAX: 0000000000000000 RBX: 00007f49800b8264 RCX: 00007f497ff0a567 [589.572] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000557f558abfa0 [589.573] RBP: 0000557f558a6ba0 R08: 0000000000000000 R09: 00007ffc98346100 [589.573] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [589.573] R13: 0000557f558abfa0 R14: 0000557f558a6cb0 R15: 0000557f558a6dd0 [589.573] [589.574] Modules linked in: dm_snapshot dm_thin_pool (...) [589.576] ---[ end trace 0000000000000000 ]--- Fix this by adding a runtime flag to the block group to tell that the block group is still in the list of new block groups, and therefore it should not be moved to the list of unused block groups, at btrfs_mark_bg_unused(), until the flag is cleared, when we finish the creation of the block group at btrfs_create_pending_block_groups(). Fixes: a9f189716cf1 ("btrfs: move out now unused BG from the reclaim list") CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 4e7de35eb7d1a1d4f2dda15f39fbedd4798a0b8d Author: Christoph Hellwig Date: Tue Jun 27 08:13:23 2023 +0200 btrfs: be a bit more careful when setting mirror_num_ret in btrfs_map_block The mirror_num_ret is allowed to be NULL, although it has to be set when smap is set. Unfortunately that is not a well enough specifiable invariant for static type checkers, so add a NULL check to make sure they are fine. Fixes: 03793cbbc80f ("btrfs: add fast path for single device io in __btrfs_map_block") Reported-by: Dan Carpenter Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit b19c98f237cd76981aaded52c258ce93f7daa8cb Author: Josef Bacik Date: Fri Jun 23 01:05:41 2023 -0400 btrfs: fix race between balance and cancel/pause Syzbot reported a panic that looks like this: assertion failed: fs_info->exclusive_operation == BTRFS_EXCLOP_BALANCE_PAUSED, in fs/btrfs/ioctl.c:465 ------------[ cut here ]------------ kernel BUG at fs/btrfs/messages.c:259! RIP: 0010:btrfs_assertfail+0x2c/0x30 fs/btrfs/messages.c:259 Call Trace: btrfs_exclop_balance fs/btrfs/ioctl.c:465 [inline] btrfs_ioctl_balance fs/btrfs/ioctl.c:3564 [inline] btrfs_ioctl+0x531e/0x5b30 fs/btrfs/ioctl.c:4632 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The reproducer is running a balance and a cancel or pause in parallel. The way balance finishes is a bit wonky, if we were paused we need to save the balance_ctl in the fs_info, but clear it otherwise and cleanup. However we rely on the return values being specific errors, or having a cancel request or no pause request. If balance completes and returns 0, but we have a pause or cancel request we won't do the appropriate cleanup, and then the next time we try to start a balance we'll trip this ASSERT. The error handling is just wrong here, we always want to clean up, unless we got -ECANCELLED and we set the appropriate pause flag in the exclusive op. With this patch the reproducer ran for an hour without tripping, previously it would trip in less than a few minutes. Reported-by: syzbot+c0f3acf145cb465426d5@syzkaller.appspotmail.com CC: stable@vger.kernel.org # 6.1+ Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 48fa42c94547d80586db4eae8c1f5d0592f18ebd Author: Arnaldo Carvalho de Melo Date: Tue Jul 11 12:23:53 2023 -0300 tools headers uapi: Sync linux/fcntl.h with the kernel sources To get the changes in: 96b2b072ee62be8a ("exportfs: allow exporting non-decodeable file handles to userspace") That don't add anything that is handled by existing hard coded tables or table generation scripts. This silences this perf build warning: Warning: Kernel ABI header differences: diff -u tools/include/uapi/linux/fcntl.h include/uapi/linux/fcntl.h Cc: Adrian Hunter Cc: Amir Goldstein Cc: Ian Rogers Cc: Jan Kara Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ZK11P5AwRBUxxutI@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 8d40f74ebf217d3b9e9b7481721e6236b857cc55 Author: Sandipan Das Date: Thu Jul 6 12:04:40 2023 +0530 perf vendor events amd: Fix large metrics There are cases where a metric requires more events than the number of available counters. E.g. AMD Zen, Zen 2 and Zen 3 processors have four data fabric counters but the "nps1_die_to_dram" metric has eight events. By default, the constituent events are placed in a group and since the events cannot be scheduled at the same time, the metric is not computed. The "all metrics" test also fails because of this. Use the NO_GROUP_EVENTS constraint for such metrics which anyway expect the user to run perf with "--metric-no-group". E.g. $ sudo perf test -v 101 Before: 101: perf all metrics test : --- start --- test child forked, pid 37131 Testing branch_misprediction_ratio Testing all_remote_links_outbound Testing nps1_die_to_dram Metric 'nps1_die_to_dram' not printed in: Error: Invalid event (dram_channel_data_controller_4) in per-thread mode, enable system wide with '-a'. Testing macro_ops_dispatched Testing all_l2_cache_accesses Testing all_l2_cache_hits Testing all_l2_cache_misses Testing ic_fetch_miss_ratio Testing l2_cache_accesses_from_l2_hwpf Testing l2_cache_misses_from_l2_hwpf Testing op_cache_fetch_miss_ratio Testing l3_read_miss_latency Testing l1_itlb_misses test child finished with -1 ---- end ---- perf all metrics test: FAILED! After: 101: perf all metrics test : --- start --- test child forked, pid 43766 Testing branch_misprediction_ratio Testing all_remote_links_outbound Testing nps1_die_to_dram Testing macro_ops_dispatched Testing all_l2_cache_accesses Testing all_l2_cache_hits Testing all_l2_cache_misses Testing ic_fetch_miss_ratio Testing l2_cache_accesses_from_l2_hwpf Testing l2_cache_misses_from_l2_hwpf Testing op_cache_fetch_miss_ratio Testing l3_read_miss_latency Testing l1_itlb_misses test child finished with 0 ---- end ---- perf all metrics test: Ok Reported-by: Ayush Jain Suggested-by: Ian Rogers Signed-off-by: Sandipan Das Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ananth Narayan Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Santosh Shukla Link: https://lore.kernel.org/r/20230706063440.54189-1-sandipan.das@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 1feece2780ac2f8de45177fe53979726cee4b3d1 Author: James Clark Date: Fri Jul 7 16:45:46 2023 +0100 perf build: Fix library not found error when using CSLIBS -L only specifies the search path for libraries directly provided in the link line with -l. Because -lopencsd isn't specified, it's only linked because it's a dependency of -lopencsd_c_api. Dependencies like this are resolved using the default system search paths or -rpath-link=... rather than -L. This means that compilation only works if OpenCSD is installed to the system rather than provided with the CSLIBS (-L) option. This could be fixed by adding -Wl,-rpath-link=$(CSLIBS) but that is less conventional than just adding -lopencsd to the link line so that it uses -L. -lopencsd seems to have been removed in commit ed17b1914978eddb ("perf tools: Drop requirement for libstdc++.so for libopencsd check") because it was thought that there was a chance compilation would work even if it didn't exist, but I think that only applies to libstdc++ so there is no harm to add it back. libopencsd.so and libopencsd_c_api.so would always exist together. Testing ======= The following scenarios now all work: * Cross build with OpenCSD installed * Cross build using CSLIBS=... * Native build with OpenCSD installed * Native build using CSLIBS=... * Static cross build with OpenCSD installed * Static cross build with CSLIBS=... Committer testing: ⬢[acme@toolbox perf-tools]$ alias m alias m='make -k BUILD_BPF_SKEL=1 CORESIGHT=1 O=/tmp/build/perf-tools -C tools/perf install-bin && git status && perf test python ; perf record -o /dev/null sleep 0.01 ; perf stat --null sleep 0.01' ⬢[acme@toolbox perf-tools]$ ldd ~/bin/perf | grep csd libopencsd_c_api.so.1 => /lib64/libopencsd_c_api.so.1 (0x00007fd49c44e000) libopencsd.so.1 => /lib64/libopencsd.so.1 (0x00007fd49bd56000) ⬢[acme@toolbox perf-tools]$ cat /etc/redhat-release Fedora release 36 (Thirty Six) ⬢[acme@toolbox perf-tools]$ Fixes: ed17b1914978eddb ("perf tools: Drop requirement for libstdc++.so for libopencsd check") Reported-by: Radhey Shyam Pandey Signed-off-by: James Clark Tested-by: Arnaldo Carvalho de Melo Tested-by: Radhey Shyam Pandey Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Uwe Kleine-König Cc: coresight@lists.linaro.org Closes: https://lore.kernel.org/linux-arm-kernel/56905d7a-a91e-883a-b707-9d5f686ba5f1@arm.com/ Link: https://lore.kernel.org/all/36cc4dc6-bf4b-1093-1c0a-876e368af183@kleine-koenig.org/ Link: https://lore.kernel.org/r/20230707154546.456720-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 9350a917913321c69edbfdfd204e0d2855cddd06 Author: Arnaldo Carvalho de Melo Date: Tue Jul 11 10:11:12 2023 -0300 tools headers UAPI: Sync files changed by new cachestat syscall with the kernel sources To pick the changes in these csets: cf264e1329fb0307 ("cachestat: implement cachestat syscall") That add support for this new syscall in tools such as 'perf trace'. For instance, this is now possible: # perf trace -e cachestat ^C[root@five ~]# # perf trace -v -e cachestat Using CPUID AuthenticAMD-25-21-0 event qualifier tracepoint filter: (common_pid != 3163687 && common_pid != 3147) && (id == 451) mmap size 528384B ^C[root@five ~] # perf trace -v -e *stat* --max-events=10 Using CPUID AuthenticAMD-25-21-0 event qualifier tracepoint filter: (common_pid != 3163713 && common_pid != 3147) && (id == 4 || id == 5 || id == 6 || id == 136 || id == 137 || id == 138 || id == 262 || id == 332 || id == 451) mmap size 528384B 0.000 ( 0.009 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b60) = 0 0.012 ( 0.003 ms): Cache2 I/O/4544 newfstatat(dfd: CWD, filename: 0x45635288, statbuf: 0x7f874569d250) = 0 0.036 ( 0.002 ms): Cache2 I/O/4544 newfstatat(dfd: 138, filename: 0x541b7093, statbuf: 0x7f87457256f0, flag: 4096) = 0 0.372 ( 0.006 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b10) = 0 0.379 ( 0.003 ms): Cache2 I/O/4544 newfstatat(dfd: CWD, filename: 0x45635288, statbuf: 0x7f874569d250) = 0 0.390 ( 0.002 ms): Cache2 I/O/4544 newfstatat(dfd: 138, filename: 0x541b7093, statbuf: 0x7f87457256a0, flag: 4096) = 0 0.609 ( 0.005 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b60) = 0 0.615 ( 0.003 ms): Cache2 I/O/4544 newfstatat(dfd: CWD, filename: 0x45635288, statbuf: 0x7f874569d250) = 0 0.625 ( 0.002 ms): Cache2 I/O/4544 newfstatat(dfd: 138, filename: 0x541b7093, statbuf: 0x7f87457256f0, flag: 4096) = 0 0.826 ( 0.005 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b10) = 0 # That is the filter expression attached to the raw_syscalls:sys_{enter,exit} tracepoints. $ find tools/perf/arch/ -name "syscall*tbl" | xargs grep -w sys_cachestat tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl:451 n64 cachestat sys_cachestat tools/perf/arch/powerpc/entry/syscalls/syscall.tbl:451 common cachestat sys_cachestat tools/perf/arch/s390/entry/syscalls/syscall.tbl:451 common cachestat sys_cachestat sys_cachestat tools/perf/arch/x86/entry/syscalls/syscall_64.tbl:451 common cachestat sys_cachestat $ $ grep -w cachestat /tmp/build/perf-tools/arch/x86/include/generated/asm/syscalls_64.c [451] = "cachestat", $ This addresses these perf build warnings: Warning: Kernel ABI header differences: diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h diff -u tools/include/uapi/linux/mman.h include/uapi/linux/mman.h diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl Cc: Adrian Hunter Cc: Andrew Morton Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Nhat Pham Link: https://lore.kernel.org/lkml/ZK1pVBJpbjujJNJW@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 142256d2f41af6f7a9dbbe7db49eecc70858b1f7 Author: Arnaldo Carvalho de Melo Date: Tue Jul 11 09:53:10 2023 -0300 tools headers UAPI: Sync drm/i915_drm.h with the kernel sources 81b1b599dfd71c95 ("drm/i915: Allow user to set cache at BO creation") 98d2722a85c4ad5f ("drm/i915/huc: differentiate the 2 steps of the MTL HuC auth flow") bc4be0a38b63b6d4 ("drm/i915/pmu: Prepare for multi-tile non-engine counters") d1da138f245d4fb4 ("drm/i915/uapi/pxp: Add a GET_PARAM for PXP") That adds some ioctls but use the __I915_PMU_OTHER() macro, not supported yet in the tools/perf/trace/beauty/drm_ioctl.sh conversion script. This silences this perf build warning: Warning: Kernel ABI header differences: diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h Cc: Adrian Hunter Cc: Alan Previn Cc: Andi Shyti Cc: Daniele Ceraolo Spurio Cc: Fei Yang Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Radhakrishna Sripada Cc: Tvrtko Ursulin Cc: Umesh Nerlige Ramappa Link: https://lore.kernel.org/lkml/ZK1R%2FIyWcUKYQbQV@kernel.org/ Signed-off-by: Arnaldo Carvalho de Melo commit c66e1c68c13b872505f25ab641c44b77313ee7fe Author: Georg Müller Date: Wed Jun 28 10:45:51 2023 +0200 perf probe: Read DWARF files from the correct CU After switching from dwarf_decl_file() to die_get_decl_file(), it is not possible to add probes for certain functions: $ perf probe -x /usr/lib/systemd/systemd-logind match_unit_removed A function DIE doesn't have decl_line. Maybe broken DWARF? A function DIE doesn't have decl_line. Maybe broken DWARF? Probe point 'match_unit_removed' not found. Error: Failed to add events. The problem is that die_get_decl_file() uses the wrong CU to search for the file. elfutils commit e1db5cdc9f has some good explanation for this: dwarf_decl_file uses dwarf_attr_integrate to get the DW_AT_decl_file attribute. This means the attribute might come from a different DIE in a different CU. If so, we need to use the CU associated with the attribute, not the original DIE, to resolve the file name. This patch uses the same source of information as elfutils: use attribute DW_AT_decl_file and use this CU to search for the file. Fixes: dc9a5d2ccd5c823c ("perf probe: Fix to get declared file name from clang DWARF5") Signed-off-by: Georg Müller Acked-by: Masami Hiramatsu (Google) Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: regressions@lists.linux.dev Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230628084551.1860532-6-georgmueller@gmx.net Signed-off-by: Arnaldo Carvalho de Melo commit 56cbeacf143530576905623ac72ae0964f3293a6 Author: Georg Müller Date: Wed Jun 28 10:45:50 2023 +0200 perf probe: Add test for regression introduced by switch to die_get_decl_file() This patch adds a test to validate that 'perf probe' works for binaries where DWARF info is split into multiple CUs Signed-off-by: Georg Müller Acked-by: Masami Hiramatsu (Google) Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: regressions@lists.linux.dev Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230628084551.1860532-5-georgmueller@gmx.net Signed-off-by: Arnaldo Carvalho de Melo commit 3cb11fe244d516f757c1022cfa971528d525fe65 Author: Neil Armstrong Date: Fri Jun 23 14:50:45 2023 +0200 interconnect: qcom: sa8775p: add enable_mask for bcm nodes Set the proper enable_mask the ACV node requiring such value to be used instead of a bandwidth when voting. The masks was copied from the downstream implementation at [1]. [1] https://git.codelinaro.org/clo/la/kernel/msm-5.15/-/blob/kernel.lnx.5.15.r32-rel/drivers/interconnect/qcom/lemans.c Signed-off-by: Neil Armstrong Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230619-topic-sm8550-upstream-interconnect-mask-vote-v2-4-709474b151cc@linaro.org Fixes: 3655a63f9661 ("interconnect: qcom: add a driver for sa8775p") Signed-off-by: Georgi Djakov commit 0dc82bd9e4627065dbc6ac8468296aa18f13c840 Author: Neil Armstrong Date: Fri Jun 23 14:50:44 2023 +0200 interconnect: qcom: sm8550: add enable_mask for bcm nodes Set the proper enable_mask to nodes requiring such value to be used instead of a bandwidth when voting. The masks were copied from the downstream implementation at [1]. [1] https://git.codelinaro.org/clo/la/kernel/msm-5.15/-/blob/kernel.lnx.5.15.r1-rel/drivers/interconnect/qcom/kalama.c Reviewed-by: Konrad Dybcio Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20230619-topic-sm8550-upstream-interconnect-mask-vote-v2-3-709474b151cc@linaro.org Fixes: e6f0d6a30f73 ("interconnect: qcom: Add SM8550 interconnect provider driver") Signed-off-by: Georgi Djakov commit be02db24cf840bc0fdfbecc78ad803619dd143e6 Author: Neil Armstrong Date: Fri Jun 23 14:50:43 2023 +0200 interconnect: qcom: sm8450: add enable_mask for bcm nodes Set the proper enable_mask to nodes requiring such value to be used instead of a bandwidth when voting. The masks were copied from the downstream implementation at [1]. [1] https://git.codelinaro.org/clo/la/kernel/msm-5.10/-/blob/KERNEL.PLATFORM.1.0.r2-05600-WAIPIOLE.0/drivers/interconnect/qcom/waipio.c Signed-off-by: Neil Armstrong Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230619-topic-sm8550-upstream-interconnect-mask-vote-v2-2-709474b151cc@linaro.org Fixes: fafc114a468e ("interconnect: qcom: Add SM8450 interconnect provider driver") Signed-off-by: Georgi Djakov commit d8630f050d3fd2079f8617dd6c00c6509109c755 Author: Mike Tipton Date: Fri Jun 23 14:50:42 2023 +0200 interconnect: qcom: Add support for mask-based BCMs Some BCMs aren't directly associated with the data path (i.e. ACV) and therefore don't communicate using BW. Instead, they are simply enabled/disabled with a simple bit mask. Add support for these. Origin commit retrieved from: https://git.codelinaro.org/clo/la/kernel/msm-5.15/-/commit/2d1573e0206998151b342e6b52a4c0f7234d7e36 Signed-off-by: Mike Tipton [narmstrong: removed copyright change from original commit] Signed-off-by: Neil Armstrong Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230619-topic-sm8550-upstream-interconnect-mask-vote-v2-1-709474b151cc@linaro.org Fixes: fafc114a468e ("interconnect: qcom: Add SM8450 interconnect provider driver") Signed-off-by: Georgi Djakov commit daf60d6cca26e50d65dac374db92e58de745ad26 Author: gaoming Date: Wed Jul 5 15:15:15 2023 +0800 exfat: use kvmalloc_array/kvfree instead of kmalloc_array/kfree The call stack shown below is a scenario in the Linux 4.19 kernel. Allocating memory failed where exfat fs use kmalloc_array due to system memory fragmentation, while the u-disk was inserted without recognition. Devices such as u-disk using the exfat file system are pluggable and may be insert into the system at any time. However, long-term running systems cannot guarantee the continuity of physical memory. Therefore, it's necessary to address this issue. Binder:2632_6: page allocation failure: order:4, mode:0x6040c0(GFP_KERNEL|__GFP_COMP), nodemask=(null) Call trace: [242178.097582] dump_backtrace+0x0/0x4 [242178.097589] dump_stack+0xf4/0x134 [242178.097598] warn_alloc+0xd8/0x144 [242178.097603] __alloc_pages_nodemask+0x1364/0x1384 [242178.097608] kmalloc_order+0x2c/0x510 [242178.097612] kmalloc_order_trace+0x40/0x16c [242178.097618] __kmalloc+0x360/0x408 [242178.097624] load_alloc_bitmap+0x160/0x284 [242178.097628] exfat_fill_super+0xa3c/0xe7c [242178.097635] mount_bdev+0x2e8/0x3a0 [242178.097638] exfat_fs_mount+0x40/0x50 [242178.097643] mount_fs+0x138/0x2e8 [242178.097649] vfs_kern_mount+0x90/0x270 [242178.097655] do_mount+0x798/0x173c [242178.097659] ksys_mount+0x114/0x1ac [242178.097665] __arm64_sys_mount+0x24/0x34 [242178.097671] el0_svc_common+0xb8/0x1b8 [242178.097676] el0_svc_handler+0x74/0x90 [242178.097681] el0_svc+0x8/0x340 By analyzing the exfat code,we found that continuous physical memory is not required here,so kvmalloc_array is used can solve this problem. Cc: stable@vger.kernel.org Signed-off-by: gaoming Signed-off-by: Namjae Jeon commit 27655b9bb9f0d9c32b8de8bec649b676898c52d5 Author: Thomas Zimmermann Date: Mon Jul 10 11:10:17 2023 +0200 drm/client: Send hotplug event after registering a client Generate a hotplug event after registering a client to allow the client to configure its display. Remove the hotplug calls from the existing clients for fbdev emulation. This change fixes a concurrency bug between registering a client and receiving events from the DRM core. The bug is present in the fbdev emulation of all drivers. The fbdev emulation currently generates a hotplug event before registering the client to the device. For each new output, the DRM core sends an additional hotplug event to each registered client. If the DRM core detects first output between sending the artificial hotplug and registering the device, the output's hotplug event gets lost. If this is the first output, the fbdev console display remains dark. This has been observed with amdgpu and fbdev-generic. Fix this by adding hotplug generation directly to the client's register helper drm_client_register(). Registering the client and receiving events are serialized by struct drm_device.clientlist_mutex. So an output is either configured by the initial hotplug event, or the client has already been registered. The bug was originally added in commit 6e3f17ee73f7 ("drm/fb-helper: generic: Call drm_client_add() after setup is done"), in which adding a client and receiving a hotplug event switched order. It was hidden, as most hardware and drivers have at least on static output configured. Other drivers didn't use the internal DRM client or still had struct drm_mode_config_funcs.output_poll_changed set. That callback handled hotplug events as well. After not setting the callback in amdgpu in commit 0e3172bac3f4 ("drm/amdgpu: Don't set struct drm_driver.output_poll_changed"), amdgpu did not show a framebuffer console if output events got lost. The bug got copy-pasted from fbdev-generic into the other fbdev emulation. Reported-by: Moritz Duge Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2649 Fixes: 6e3f17ee73f7 ("drm/fb-helper: generic: Call drm_client_add() after setup is done") Fixes: 8ab59da26bc0 ("drm/fb-helper: Move generic fbdev emulation into separate source file") Fixes: b79fe9abd58b ("drm/fbdev-dma: Implement fbdev emulation for GEM DMA helpers") Fixes: 63c381552f69 ("drm/armada: Implement fbdev emulation as in-kernel client") Fixes: 49953b70e7d3 ("drm/exynos: Implement fbdev emulation as in-kernel client") Fixes: 8f1aaccb04b7 ("drm/gma500: Implement client-based fbdev emulation") Fixes: 940b869c2f2f ("drm/msm: Implement fbdev emulation as in-kernel client") Fixes: 9e69bcd88e45 ("drm/omapdrm: Implement fbdev emulation as in-kernel client") Fixes: e317a69fe891 ("drm/radeon: Implement client-based fbdev emulation") Fixes: 71ec16f45ef8 ("drm/tegra: Implement fbdev emulation as in-kernel client") Fixes: 0e3172bac3f4 ("drm/amdgpu: Don't set struct drm_driver.output_poll_changed") Signed-off-by: Thomas Zimmermann Tested-by: Moritz Duge Tested-by: Torsten Krah Tested-by: Paul Schyska Cc: Daniel Vetter Cc: David Airlie Cc: Noralf Trønnes Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Javier Martinez Canillas Cc: Russell King Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Krzysztof Kozlowski Cc: Patrik Jakobsson Cc: Rob Clark Cc: Abhinav Kumar Cc: Dmitry Baryshkov Cc: Tomi Valkeinen Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: Thierry Reding Cc: Mikko Perttunen Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Cc: linux-tegra@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: # v5.2+ Reviewed-by: Javier Martinez Canillas Reviewed-by: Dmitry Baryshkov # msm Link: https://patchwork.freedesktop.org/patch/msgid/20230710091029.27503-1-tzimmermann@suse.de commit 8278ee2a2646b9acf747317895e47a640ba933c9 Author: Suman Ghosh Date: Mon Jul 10 16:00:27 2023 +0530 octeontx2-pf: Add additional check for MCAM rules Due to hardware limitation, MCAM drop rule with ether_type == 802.1Q and vlan_id == 0 is not supported. Hence rejecting such rules. Fixes: dce677da57c0 ("octeontx2-pf: Add vlan-etype to ntuple filters") Signed-off-by: Suman Ghosh Link: https://lore.kernel.org/r/20230710103027.2244139-1-sumang@marvell.com Signed-off-by: Paolo Abeni commit 6b293a8c91bca52726448d03216e65da509e9bb7 Author: Thomas GENTY Date: Fri Jul 7 16:14:25 2023 +0200 platform/x86: touchscreen_dmi: Add info for the Archos 101 Cesium Educ tablet Add info for the Archos 101 Cesium Educ tablet It was tested using gslx680_ts_acpi module PR at https://github.com/onitake/gsl-firmware/pull/210 for the firmware Signed-off-by: Thomas GENTY Link: https://lore.kernel.org/r/20230707141425.21473-1-tomlohave@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d0050c2ef53f87561d8345cccf49927ade91cca6 Author: Armin Wolf Date: Fri Jul 7 03:03:33 2023 +0200 platform/x86: dell-ddv: Fix mangled list in documentation Add missing empty line necessary for sphinx to recognize the list. Also reword the first entry a little bit. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20230707010333.12954-2-W_Armin@gmx.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 8c4893837554687addae919998b0f3de23a514dc Author: Armin Wolf Date: Fri Jul 7 03:03:32 2023 +0200 platform/x86: dell-ddv: Improve error handling If for some reason a external function returns -ENODEV, no error message is being displayed because the driver assumes that -ENODEV can only be returned internally if no sensors, etc where found. Fix this by explicitly returning 0 in such a case since missing hardware is no error. Also remove the now obsolete check for -ENODEV. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20230707010333.12954-1-W_Armin@gmx.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 5d3acd9d7a44ad9902e98e57013f028d5f4fc86c Author: Shyam Sundar S K Date: Tue Jul 11 15:39:03 2023 +0530 platform/x86/amd: pmf: Add new ACPI ID AMDI0103 Add new ACPI ID AMDI0103 used by upcoming AMD platform to the PMF supported list of devices. Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20230711100903.384151-1-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 822507ca6affc8930a3919f326c79062354e8283 Author: Shyam Sundar S K Date: Tue Jul 11 15:33:44 2023 +0530 platform/x86/amd: pmc: Add new ACPI ID AMDI000A Add new ACPI ID AMDI000A used by upcoming AMD platform to the pmc supported list of devices Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20230711100344.383948-1-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 6e2acbfe59b83043bc7ae1bb39fac4fc9dcd5a18 Author: Dmitry Rokosov Date: Wed Jul 5 00:54:04 2023 +0300 clk: meson: change usleep_range() to udelay() for atomic context The function meson_clk_pll_enable() can be invoked under the enable_lock spinlock from the clk core logic, which risks a kernel panic during the usleep_range() call: BUG: scheduling while atomic: kworker/u4:2/36/0x00000002 Modules linked in: g_ffs usb_f_fs libcomposite CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273 Workqueue: events_unbound async_run_entry_fn Call trace: dump_backtrace+0x9c/0x128 show_stack+0x20/0x38 dump_stack_lvl+0x48/0x60 dump_stack+0x18/0x28 __schedule_bug+0x58/0x78 __schedule+0x828/0xa88 schedule+0x64/0xd8 schedule_hrtimeout_range_clock+0xd0/0x208 schedule_hrtimeout_range+0x1c/0x30 usleep_range_state+0x6c/0xa8 meson_clk_pll_enable+0x1f4/0x310 clk_core_enable+0x78/0x200 clk_core_enable+0x58/0x200 clk_core_enable+0x58/0x200 clk_core_enable+0x58/0x200 clk_enable+0x34/0x60 So it is required to use the udelay() function instead of usleep_range() for the atomic context safety. Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family") Reported-by: Jan Dakinevich Signed-off-by: Dmitry Rokosov Link: https://lore.kernel.org/r/20230704215404.11533-1-ddrokosov@sberdevices.ru Signed-off-by: Jerome Brunet commit d194803325150c53ad228aedb6f6a82ac9ea6360 Author: Mario Limonciello Date: Mon Jul 10 13:39:34 2023 -0500 platform/x86/amd: pmc: Apply nvme quirk to HP 15s-eq2xxx HP 15s-eq2xxx is an older Lucienne laptop that has a problem resuming from s2idle when IOMMU is enabled. The symptoms very closely resemble that of the Lenovo issues with NVME resume. Lucienne was released in a similar timeframe as the Renoir / Cezanne Lenovo laptops and they may have similar BIOS code. Applying the same quirk to this system allows the system to work with IOMMU enabled and s2idle resume to work. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2684 Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20230710183934.17315-3-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit e8ef8dd28c4c4b86cd3010ff42c79582f766862e Author: Mario Limonciello Date: Mon Jul 10 13:39:33 2023 -0500 platform/x86: Move s2idle quirk from thinkpad-acpi to amd-pmc It turns out that some-non Lenovo systems can benefit from the quirk introduced for Lenovo systems in commit 455cd867b85b5 ("platform/x86: thinkpad_acpi: Add a s2idle resume quirk for a number of laptops"). So move this quirk into running from the amd-pmc driver instead. No intended functional changes. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20230710183934.17315-2-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 6018a266279b1a75143c7c0804dd08a5fc4c3e0b Author: Zhengchao Shao Date: Mon Jul 10 17:40:53 2023 +0800 ip_vti: fix potential slab-use-after-free in decode_session6 When ip_vti device is set to the qdisc of the sfb type, the cb field of the sent skb may be modified during enqueuing. Then, slab-use-after-free may occur when ip_vti device sends IPv6 packets. As commit f855691975bb ("xfrm6: Fix the nexthdr offset in _decode_session6.") showed, xfrm_decode_session was originally intended only for the receive path. IP6CB(skb)->nhoff is not set during transmission. Therefore, set the cb field in the skb to 0 before sending packets. Fixes: f855691975bb ("xfrm6: Fix the nexthdr offset in _decode_session6.") Signed-off-by: Zhengchao Shao Signed-off-by: Steffen Klassert commit 9fd41f1ba638938c9a1195d09bc6fa3be2712f25 Author: Zhengchao Shao Date: Mon Jul 10 17:40:52 2023 +0800 ip6_vti: fix slab-use-after-free in decode_session6 When ipv6_vti device is set to the qdisc of the sfb type, the cb field of the sent skb may be modified during enqueuing. Then, slab-use-after-free may occur when ipv6_vti device sends IPv6 packets. The stack information is as follows: BUG: KASAN: slab-use-after-free in decode_session6+0x103f/0x1890 Read of size 1 at addr ffff88802e08edc2 by task swapper/0/0 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.4.0-next-20230707-00001-g84e2cad7f979 #410 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 04/01/2014 Call Trace: dump_stack_lvl+0xd9/0x150 print_address_description.constprop.0+0x2c/0x3c0 kasan_report+0x11d/0x130 decode_session6+0x103f/0x1890 __xfrm_decode_session+0x54/0xb0 vti6_tnl_xmit+0x3e6/0x1ee0 dev_hard_start_xmit+0x187/0x700 sch_direct_xmit+0x1a3/0xc30 __qdisc_run+0x510/0x17a0 __dev_queue_xmit+0x2215/0x3b10 neigh_connected_output+0x3c2/0x550 ip6_finish_output2+0x55a/0x1550 ip6_finish_output+0x6b9/0x1270 ip6_output+0x1f1/0x540 ndisc_send_skb+0xa63/0x1890 ndisc_send_rs+0x132/0x6f0 addrconf_rs_timer+0x3f1/0x870 call_timer_fn+0x1a0/0x580 expire_timers+0x29b/0x4b0 run_timer_softirq+0x326/0x910 __do_softirq+0x1d4/0x905 irq_exit_rcu+0xb7/0x120 sysvec_apic_timer_interrupt+0x97/0xc0 Allocated by task 9176: kasan_save_stack+0x22/0x40 kasan_set_track+0x25/0x30 __kasan_slab_alloc+0x7f/0x90 kmem_cache_alloc_node+0x1cd/0x410 kmalloc_reserve+0x165/0x270 __alloc_skb+0x129/0x330 netlink_sendmsg+0x9b1/0xe30 sock_sendmsg+0xde/0x190 ____sys_sendmsg+0x739/0x920 ___sys_sendmsg+0x110/0x1b0 __sys_sendmsg+0xf7/0x1c0 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 9176: kasan_save_stack+0x22/0x40 kasan_set_track+0x25/0x30 kasan_save_free_info+0x2b/0x40 ____kasan_slab_free+0x160/0x1c0 slab_free_freelist_hook+0x11b/0x220 kmem_cache_free+0xf0/0x490 skb_free_head+0x17f/0x1b0 skb_release_data+0x59c/0x850 consume_skb+0xd2/0x170 netlink_unicast+0x54f/0x7f0 netlink_sendmsg+0x926/0xe30 sock_sendmsg+0xde/0x190 ____sys_sendmsg+0x739/0x920 ___sys_sendmsg+0x110/0x1b0 __sys_sendmsg+0xf7/0x1c0 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88802e08ed00 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 194 bytes inside of freed 640-byte region [ffff88802e08ed00, ffff88802e08ef80) As commit f855691975bb ("xfrm6: Fix the nexthdr offset in _decode_session6.") showed, xfrm_decode_session was originally intended only for the receive path. IP6CB(skb)->nhoff is not set during transmission. Therefore, set the cb field in the skb to 0 before sending packets. Fixes: f855691975bb ("xfrm6: Fix the nexthdr offset in _decode_session6.") Signed-off-by: Zhengchao Shao Signed-off-by: Steffen Klassert commit 53223f2ed1ef5c90dad814daaaefea4e68a933c8 Author: Zhengchao Shao Date: Mon Jul 10 17:40:51 2023 +0800 xfrm: fix slab-use-after-free in decode_session6 When the xfrm device is set to the qdisc of the sfb type, the cb field of the sent skb may be modified during enqueuing. Then, slab-use-after-free may occur when the xfrm device sends IPv6 packets. The stack information is as follows: BUG: KASAN: slab-use-after-free in decode_session6+0x103f/0x1890 Read of size 1 at addr ffff8881111458ef by task swapper/3/0 CPU: 3 PID: 0 Comm: swapper/3 Not tainted 6.4.0-next-20230707 #409 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 04/01/2014 Call Trace: dump_stack_lvl+0xd9/0x150 print_address_description.constprop.0+0x2c/0x3c0 kasan_report+0x11d/0x130 decode_session6+0x103f/0x1890 __xfrm_decode_session+0x54/0xb0 xfrmi_xmit+0x173/0x1ca0 dev_hard_start_xmit+0x187/0x700 sch_direct_xmit+0x1a3/0xc30 __qdisc_run+0x510/0x17a0 __dev_queue_xmit+0x2215/0x3b10 neigh_connected_output+0x3c2/0x550 ip6_finish_output2+0x55a/0x1550 ip6_finish_output+0x6b9/0x1270 ip6_output+0x1f1/0x540 ndisc_send_skb+0xa63/0x1890 ndisc_send_rs+0x132/0x6f0 addrconf_rs_timer+0x3f1/0x870 call_timer_fn+0x1a0/0x580 expire_timers+0x29b/0x4b0 run_timer_softirq+0x326/0x910 __do_softirq+0x1d4/0x905 irq_exit_rcu+0xb7/0x120 sysvec_apic_timer_interrupt+0x97/0xc0 asm_sysvec_apic_timer_interrupt+0x1a/0x20 RIP: 0010:intel_idle_hlt+0x23/0x30 Code: 1f 84 00 00 00 00 00 f3 0f 1e fa 41 54 41 89 d4 0f 1f 44 00 00 66 90 0f 1f 44 00 00 0f 00 2d c4 9f ab 00 0f 1f 44 00 00 fb f4 44 89 e0 41 5c c3 66 0f 1f 44 00 00 f3 0f 1e fa 41 54 41 89 d4 RSP: 0018:ffffc90000197d78 EFLAGS: 00000246 RAX: 00000000000a83c3 RBX: ffffe8ffffd09c50 RCX: ffffffff8a22d8e5 RDX: 0000000000000001 RSI: ffffffff8d3f8080 RDI: ffffe8ffffd09c50 RBP: ffffffff8d3f8080 R08: 0000000000000001 R09: ffffed1026ba6d9d R10: ffff888135d36ceb R11: 0000000000000001 R12: 0000000000000001 R13: ffffffff8d3f8100 R14: 0000000000000001 R15: 0000000000000000 cpuidle_enter_state+0xd3/0x6f0 cpuidle_enter+0x4e/0xa0 do_idle+0x2fe/0x3c0 cpu_startup_entry+0x18/0x20 start_secondary+0x200/0x290 secondary_startup_64_no_verify+0x167/0x16b Allocated by task 939: kasan_save_stack+0x22/0x40 kasan_set_track+0x25/0x30 __kasan_slab_alloc+0x7f/0x90 kmem_cache_alloc_node+0x1cd/0x410 kmalloc_reserve+0x165/0x270 __alloc_skb+0x129/0x330 inet6_ifa_notify+0x118/0x230 __ipv6_ifa_notify+0x177/0xbe0 addrconf_dad_completed+0x133/0xe00 addrconf_dad_work+0x764/0x1390 process_one_work+0xa32/0x16f0 worker_thread+0x67d/0x10c0 kthread+0x344/0x440 ret_from_fork+0x1f/0x30 The buggy address belongs to the object at ffff888111145800 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 239 bytes inside of freed 640-byte region [ffff888111145800, ffff888111145a80) As commit f855691975bb ("xfrm6: Fix the nexthdr offset in _decode_session6.") showed, xfrm_decode_session was originally intended only for the receive path. IP6CB(skb)->nhoff is not set during transmission. Therefore, set the cb field in the skb to 0 before sending packets. Fixes: f855691975bb ("xfrm6: Fix the nexthdr offset in _decode_session6.") Signed-off-by: Zhengchao Shao Signed-off-by: Steffen Klassert commit 04499f28b40bfc24f20b0e2331008bb90a54a6cf Author: Lu Hongfei Date: Mon Jul 10 11:18:59 2023 +0800 net: dsa: Removed unneeded of_node_put in felix_parse_ports_node Remove unnecessary of_node_put from the continue path to prevent child node from being released twice, which could avoid resource leak or other unexpected issues. Signed-off-by: Lu Hongfei Reviewed-by: Vladimir Oltean Fixes: de879a016a94 ("net: dsa: felix: add functionality when not all ports are supported") Link: https://lore.kernel.org/r/20230710031859.36784-1-luhongfei@vivo.com Signed-off-by: Paolo Abeni commit 113899c2669dff148b2a5bea4780123811aecc13 Author: Tvrtko Ursulin Date: Fri Jul 7 13:55:03 2023 +0100 drm/i915: Fix one wrong caching mode enum usage Commit a4d86249c773 ("drm/i915/gt: Provide a utility to create a scratch buffer") mistakenly passed in uapi I915_CACHING_CACHED as argument to i915_gem_object_set_cache_coherency(), which actually takes internal enum i915_cache_level. No functional issue since the value matches I915_CACHE_LLC (1 == 1), which is the intended caching mode, but lets clean it up nevertheless. Signed-off-by: Tvrtko Ursulin Fixes: a4d86249c773 ("drm/i915/gt: Provide a utility to create a scratch buffer") Cc: Daniele Ceraolo Spurio Reviewed-by: Tejas Upadhyay Link: https://patchwork.freedesktop.org/patch/msgid/20230707125503.3965817-1-tvrtko.ursulin@linux.intel.com (cherry picked from commit 49c60b2f0867ac36fd54d513882a48431aeccae7) Signed-off-by: Tvrtko Ursulin commit 6bf0961a008ac74b085f1690fba8520ac3b253ee Author: Tvrtko Ursulin Date: Fri Jul 7 13:46:44 2023 +0100 drm/i915: Remove dead code from gen8_pte_encode Commit 9275277d5324 ("drm/i915: use pat_index instead of cache_level") added a dedicated gen12_pte_encode but forgot to remove the Gen12 specific bit from gen8_pte_encode. Signed-off-by: Tvrtko Ursulin Fixes: 9275277d5324 ("drm/i915: use pat_index instead of cache_level") Cc: Fei Yang Cc: Andi Shyti Cc: Matt Roper Reviewed-by: Rodrigo Vivi Reviewed-by: Fei Yang Link: https://patchwork.freedesktop.org/patch/msgid/20230707124644.3965281-1-tvrtko.ursulin@linux.intel.com (cherry picked from commit 08509377dd82ead98429785509f6b52a4b5f09f5) Signed-off-by: Tvrtko Ursulin commit dde4c3d477d834212947f38519407df404acde4a Author: Umesh Nerlige Ramappa Date: Fri Jun 16 10:34:02 2023 -0700 drm/i915/perf: Consider OA buffer boundary when zeroing out reports For reports that are not powers of 2, reports at the end of the OA buffer may get split across the buffer boundary. When zeroing out such reports, take the split into consideration. v2: Use OA_BUFFER_SIZE (Ashutosh) Fixes: 09a36015d9a0 ("drm/i915/perf: Clear out entire reports after reading if not power of 2 size") Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Signed-off-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230616173402.699776-1-umesh.nerlige.ramappa@intel.com (cherry picked from commit 40b1588a750240cbe8a83117aa785d778749a77c) Signed-off-by: Tvrtko Ursulin commit 5c413188c68da0e4bffc93de1c80257e20741e69 Author: Stanislav Lisovskiy Date: Wed Jun 28 17:10:17 2023 +0300 drm/i915: Don't preserve dpll_hw_state for slave crtc in Bigjoiner If we are using Bigjoiner dpll_hw_state is supposed to be exactly same as for master crtc, so no need to save it's state for slave crtc. Signed-off-by: Stanislav Lisovskiy Fixes: 0ff0e219d9b8 ("drm/i915: Compute clocks earlier") Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230628141017.18937-1-stanislav.lisovskiy@intel.com (cherry picked from commit cbaf758809952c95ec00e796695049babb08bb60) Signed-off-by: Tvrtko Ursulin commit 535d0ae39185a266536a1e97ff9a8956d7fbb9df Author: Ingo Molnar Date: Tue Jul 11 10:10:40 2023 +0200 x86/cfi: Only define poison_cfi() if CONFIG_X86_KERNEL_IBT=y poison_cfi() was introduced in: 9831c6253ace ("x86/cfi: Extend ENDBR sealing to kCFI") ... but it's only ever used under CONFIG_X86_KERNEL_IBT=y, and if that option is disabled, we get: arch/x86/kernel/alternative.c:1243:13: error: ‘poison_cfi’ defined but not used [-Werror=unused-function] Guard the definition with CONFIG_X86_KERNEL_IBT. Cc: Peter Zijlstra (Intel) Cc: Kees Cook Cc: Sami Tolvanen Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar commit 6fe5c68ee6a1aae0ef291a56001e7888de547fa2 Author: Lorenzo Pieralisi Date: Tue Jul 4 17:50:34 2023 +0200 irqchip/gic-v3: Workaround for GIC-700 erratum 2941627 GIC700 erratum 2941627 may cause GIC-700 missing SPIs wake requests when SPIs are deactivated while targeting a sleeping CPU - ie a CPU for which the redistributor: GICR_WAKER.ProcessorSleep == 1 This runtime situation can happen if an SPI that has been activated on a core is retargeted to a different core, it becomes pending and the target core subsequently enters a power state quiescing the respective redistributor. When this situation is hit, the de-activation carried out on the core that activated the SPI (through either ICC_EOIR1_EL1 or ICC_DIR_EL1 register writes) does not trigger a wake requests for the sleeping GIC redistributor even if the SPI is pending. Work around the erratum by de-activating the SPI using the redistributor GICD_ICACTIVER register if the runtime conditions require it (ie the IRQ was retargeted between activation and de-activation). Signed-off-by: Lorenzo Pieralisi Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230704155034.148262-1-lpieralisi@kernel.org commit c0dbbdf56f13c960aa6bedf61302f57411ae4865 Merge: 9d0aba98316d0 84a1094719879 Author: Paolo Abeni Date: Tue Jul 11 10:00:52 2023 +0200 Merge branch 'net-fec-fix-some-issues-of-ndo_xdp_xmit' Wei Fang says: ==================== net: fec: fix some issues of ndo_xdp_xmit() We encountered some issues when testing the ndo_xdp_xmit() interface of the fec driver on i.MX8MP and i.MX93 platforms. These issues are easy to reproduce, and the specific reproduction steps are as follows. step1: The ethernet port of a board (board A) is connected to the EQOS port of i.MX8MP/i.MX93, and the FEC port of i.MX8MP/i.MX93 is connected to another ethernet port, such as a switch port. step2: Board A uses the pktgen_sample03_burst_single_flow.sh to generate and send packets to i.MX8MP/i.MX93. The command is shown below. ./pktgen_sample03_burst_single_flow.sh -i eth0 -d 192.168.6.8 -m \ 56:bf:0d:68:b0:9e -s 1500 step3: i.MX8MP/i.MX93 use the xdp_redirect bfp program to redirect the XDP frames from EQOS port to FEC port. The command is shown below. ./xdp_redirect eth1 eth0 After a few moments, the warning or error logs will be printed in the console, for more details, please refer to the commit message of each patch. ==================== Link: https://lore.kernel.org/r/20230706081012.2278063-1-wei.fang@nxp.com Signed-off-by: Paolo Abeni commit 84a10947198792d038527af9c3994782ecb37c82 Author: Wei Fang Date: Thu Jul 6 16:10:12 2023 +0800 net: fec: use netdev_err_once() instead of netdev_err() In the case of heavy XDP traffic to be transmitted, the console will print the error log continuously if there are lack of enough BDs to accommodate the frames. The log looks like below. [ 160.013112] fec 30be0000.ethernet eth0: NOT enough BD for SG! [ 160.023116] fec 30be0000.ethernet eth0: NOT enough BD for SG! [ 160.028926] fec 30be0000.ethernet eth0: NOT enough BD for SG! [ 160.038946] fec 30be0000.ethernet eth0: NOT enough BD for SG! [ 160.044758] fec 30be0000.ethernet eth0: NOT enough BD for SG! Not only will this log be replicated and redundant, it will also degrade XDP performance. So we use netdev_err_once() instead of netdev_err() now. Fixes: 6d6b39f180b8 ("net: fec: add initial XDP support") Signed-off-by: Wei Fang Signed-off-by: Paolo Abeni commit 56b3c6ba53d0e9649ea5e4089b39cadde13aaef8 Author: Wei Fang Date: Thu Jul 6 16:10:11 2023 +0800 net: fec: increase the size of tx ring and update tx_wake_threshold When the XDP feature is enabled and with heavy XDP frames to be transmitted, there is a considerable probability that available tx BDs are insufficient. This will lead to some XDP frames to be discarded and the "NOT enough BD for SG!" error log will appear in the console (as shown below). [ 160.013112] fec 30be0000.ethernet eth0: NOT enough BD for SG! [ 160.023116] fec 30be0000.ethernet eth0: NOT enough BD for SG! [ 160.028926] fec 30be0000.ethernet eth0: NOT enough BD for SG! [ 160.038946] fec 30be0000.ethernet eth0: NOT enough BD for SG! [ 160.044758] fec 30be0000.ethernet eth0: NOT enough BD for SG! In the case of heavy XDP traffic, sometimes the speed of recycling tx BDs may be slower than the speed of sending XDP frames. There may be several specific reasons, such as the interrupt is not responsed in time, the efficiency of the NAPI callback function is too low due to all the queues (tx queues and rx queues) share the same NAPI, and so on. After trying various methods, I think that increase the size of tx BD ring is simple and effective. Maybe the best resolution is that allocate NAPI for each queue to improve the efficiency of the NAPI callback, but this change is a bit big and I didn't try this method. Perheps this method will be implemented in a future patch. This patch also updates the tx_wake_threshold of tx ring which is related to the size of tx ring in the previous logic. Otherwise, the tx_wake_threshold will be too high (403 BDs), which is more likely to impact the slow path in the case of heavy XDP traffic, because XDP path and slow path share the tx BD rings. According to Jakub's suggestion, the tx_wake_threshold is at least equal to tx_stop_threshold + 2 * MAX_SKB_FRAGS, if a queue of hundreds of entries is overflowing, we should be able to apply a hysteresis of a few tens of entries. Fixes: 6d6b39f180b8 ("net: fec: add initial XDP support") Signed-off-by: Wei Fang Signed-off-by: Paolo Abeni commit 20f797399035a8052dbd7297fdbe094079a9482e Author: Wei Fang Date: Thu Jul 6 16:10:10 2023 +0800 net: fec: recycle pages for transmitted XDP frames Once the XDP frames have been successfully transmitted through the ndo_xdp_xmit() interface, it's the driver responsibility to free the frames so that the page_pool can recycle the pages and reuse them. However, this action is not implemented in the fec driver. This leads to a user-visible problem that the console will print the following warning log. [ 157.568851] page_pool_release_retry() stalled pool shutdown 1389 inflight 60 sec [ 217.983446] page_pool_release_retry() stalled pool shutdown 1389 inflight 120 sec [ 278.399006] page_pool_release_retry() stalled pool shutdown 1389 inflight 181 sec [ 338.812885] page_pool_release_retry() stalled pool shutdown 1389 inflight 241 sec [ 399.226946] page_pool_release_retry() stalled pool shutdown 1389 inflight 302 sec Therefore, to solve this issue, we free XDP frames via xdp_return_frame() while cleaning the tx BD ring. Fixes: 6d6b39f180b8 ("net: fec: add initial XDP support") Signed-off-by: Wei Fang Signed-off-by: Paolo Abeni commit be7ecbe7ec7df7320db4b810fef438bf67144011 Author: Wei Fang Date: Thu Jul 6 16:10:09 2023 +0800 net: fec: dynamically set the NETDEV_XDP_ACT_NDO_XMIT feature of XDP When a XDP program is installed or uninstalled, fec_restart() will be invoked to reset MAC and buffer descriptor rings. It's reasonable not to transmit any packet during the process of reset. However, the NETDEV_XDP_ACT_NDO_XMIT bit of xdp_features is enabled by default, that is to say, it's possible that the fec_enet_xdp_xmit() will be invoked even if the process of reset is not finished. In this case, the redirected XDP frames might be dropped and available transmit BDs may be incorrectly deemed insufficient. So this patch disable the NETDEV_XDP_ACT_NDO_XMIT feature by default and dynamically configure this feature when the bpf program is installed or uninstalled. Fixes: e4ac7cc6e5a4 ("net: fec: turn on XDP features") Signed-off-by: Wei Fang Signed-off-by: Paolo Abeni commit 2f98e686ef59b5d19af5847d755798e2031bee3a Merge: a2848d08742c8 06c2afb862f9d Author: Maxime Ripard Date: Tue Jul 11 09:23:20 2023 +0200 Merge v6.5-rc1 into drm-misc-fixes Boris needs 6.5-rc1 in drm-misc-fixes to prevent a conflict. Signed-off-by: Maxime Ripard commit c56fb2aab23505bb7160d06097c8de100b82b851 Author: Björn Töpel Date: Mon Jul 10 09:41:31 2023 +0200 riscv, bpf: Fix inconsistent JIT image generation In order to generate the prologue and epilogue, the BPF JIT needs to know which registers that are clobbered. Therefore, the during pre-final passes, the prologue is generated after the body of the program body-prologue-epilogue. Then, in the final pass, a proper prologue-body-epilogue JITted image is generated. This scheme has worked most of the time. However, for some large programs with many jumps, e.g. the test_kmod.sh BPF selftest with hardening enabled (blinding constants), this has shown to be incorrect. For the final pass, when the proper prologue-body-epilogue is generated, the image has not converged. This will lead to that the final image will have incorrect jump offsets. The following is an excerpt from an incorrect image: | ... | 3b8: 00c50663 beq a0,a2,3c4 <.text+0x3c4> | 3bc: 0020e317 auipc t1,0x20e | 3c0: 49630067 jalr zero,1174(t1) # 20e852 <.text+0x20e852> | ... | 20e84c: 8796 c.mv a5,t0 | 20e84e: 6422 c.ldsp s0,8(sp) # Epilogue start | 20e850: 6141 c.addi16sp sp,16 | 20e852: 853e c.mv a0,a5 # Incorrect jump target | 20e854: 8082 c.jr ra The image has shrunk, and the epilogue offset is incorrect in the final pass. Correct the problem by always generating proper prologue-body-epilogue outputs, which means that the first pass will only generate the body to track what registers that are touched. Fixes: 2353ecc6f91f ("bpf, riscv: add BPF JIT for RV64G") Signed-off-by: Björn Töpel Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230710074131.19596-1-bjorn@kernel.org commit 53a90ae81a33437ff6ae907c75fd8a9902df2480 Author: Yangtao Li Date: Mon Jul 10 21:20:01 2023 +0800 fbdev: imxfb: remove unneeded labels These labels are now redundant and don't do anything, let's remove them. Signed-off-by: Yangtao Li Signed-off-by: Helge Deller commit 78dd4f415567a94fa134214f82b7966cbefde05c Author: Yangtao Li Date: Mon Jul 10 21:20:00 2023 +0800 fbdev: imxfb: Convert to devm_platform_ioremap_resource() Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li Signed-off-by: Helge Deller commit 55dd7378ba94afe389e7edec23510bad80d344ca Author: Yangtao Li Date: Mon Jul 10 21:19:59 2023 +0800 fbdev: imxfb: Convert to devm_kmalloc_array() No need for manual kfree in the error path and the remove function. Signed-off-by: Yangtao Li Signed-off-by: Helge Deller commit 45fcc058a75bf5d65cf4c32da44a252fbe873cd4 Author: Yangtao Li Date: Mon Jul 10 21:19:58 2023 +0800 fbdev: imxfb: Removed unneeded release_mem_region Remove unnecessary release_mem_region from the error path to prevent mem region from being released twice, which could avoid resource leak or other unexpected issues. Fixes: b083c22d5114 ("video: fbdev: imxfb: Convert request_mem_region + ioremap to devm_ioremap_resource") Signed-off-by: Yangtao Li Signed-off-by: Helge Deller commit 86a101023e7d4413f89d0a0a77693af952529260 Author: Martin Kaiser Date: Wed Jun 28 15:26:52 2023 +0200 fbdev: imxfb: switch to DEFINE_SIMPLE_DEV_PM_OPS SIMPLE_DEV_PM_OPS is deprecated, replace it with DEFINE_SIMPLE_DEV_PM_OPS and use pm_sleep_ptr for setting the driver's pm routines. We can now remove the __maybe_unused qualifier in the suspend and resume functions. Signed-off-by: Martin Kaiser Signed-off-by: Helge Deller commit 4e47382fbca916d7db95cbf9e2d7ca2e9d1ca3fe Author: Martin Kaiser Date: Wed Jun 28 15:24:37 2023 +0200 fbdev: imxfb: warn about invalid left/right margin Warn about invalid var->left_margin or var->right_margin. Their values are read from the device tree. We store var->left_margin-3 and var->right_margin-1 in register fields. These fields should be >= 0. Fixes: 7e8549bcee00 ("imxfb: Fix margin settings") Signed-off-by: Martin Kaiser Signed-off-by: Helge Deller commit a160e9414d8a1747225206558b24d7df513b3c8d Author: Max Filippov Date: Mon Jul 10 15:13:27 2023 -0700 xtensa: fix unaligned and load/store configuration interaction Unaligned exception handler is needed in configurations with hardware support for unaligned access when the load/store exception handler is enabled because such configurations would still raise an exception on unaligned access through the instruction bus. Fixes: f29cf77609cc ("xtensa: add load/store exception handler") Signed-off-by: Max Filippov commit bc8d5916541fa19ca5bc598eb51a5f78eb891a36 Author: Max Filippov Date: Mon Jul 3 11:01:42 2023 -0700 xtensa: ISS: fix call to split_if_spec split_if_spec expects a NULL-pointer as an end marker for the argument list, but tuntap_probe never supplied that terminating NULL. As a result incorrectly formatted interface specification string may cause a crash because of the random memory access. Fix that by adding NULL terminator to the split_if_spec argument list. Cc: stable@vger.kernel.org Fixes: 7282bee78798 ("[PATCH] xtensa: Architecture support for Tensilica Xtensa Part 8") Signed-off-by: Max Filippov commit c44e783e0b4539cb8296da9229202a9f9e6a3c8d Author: Max Filippov Date: Mon Jul 3 09:57:25 2023 -0700 xtensa: ISS: add comment about etherdev freeing iss_net_configure explicitly frees etherdev in all error return paths except one where register_netdevice fails. In that remaining error return path the etherdev is freed by the iss_net_pdev_release callback triggered by the platform_device_unregister call. Add a comment stating that. Signed-off-by: Max Filippov commit 3c55097c553c49deab60ac62c83ef17565004a97 Author: Zhang Yi Date: Tue Jun 6 21:59:28 2023 +0800 jbd2: remove __journal_try_to_free_buffer() __journal_try_to_free_buffer() has only one caller and it's logic is much simple now, so just remove it and open code in jbd2_journal_try_to_free_buffers(). Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230606135928.434610-7-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit 46f881b5b1758dc4a35fba4a643c10717d0cf427 Author: Zhang Yi Date: Tue Jun 6 21:59:27 2023 +0800 jbd2: fix a race when checking checkpoint buffer busy Before removing checkpoint buffer from the t_checkpoint_list, we have to check both BH_Dirty and BH_Lock bits together to distinguish buffers have not been or were being written back. But __cp_buffer_busy() checks them separately, it first check lock state and then check dirty, the window between these two checks could be raced by writing back procedure, which locks buffer and clears buffer dirty before I/O completes. So it cannot guarantee checkpointing buffers been written back to disk if some error happens later. Finally, it may clean checkpoint transactions and lead to inconsistent filesystem. jbd2_journal_forget() and __journal_try_to_free_buffer() also have the same problem (journal_unmap_buffer() escape from this issue since it's running under the buffer lock), so fix them through introducing a new helper to try holding the buffer lock and remove really clean buffer. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217490 Cc: stable@vger.kernel.org Suggested-by: Jan Kara Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230606135928.434610-6-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit e34c8dd238d0c9368b746480f313055f5bab5040 Author: Zhihao Cheng Date: Tue Jun 6 21:59:26 2023 +0800 jbd2: Fix wrongly judgement for buffer head removing while doing checkpoint Following process, jbd2_journal_commit_transaction // there are several dirty buffer heads in transaction->t_checkpoint_list P1 wb_workfn jbd2_log_do_checkpoint if (buffer_locked(bh)) // false __block_write_full_page trylock_buffer(bh) test_clear_buffer_dirty(bh) if (!buffer_dirty(bh)) __jbd2_journal_remove_checkpoint(jh) if (buffer_write_io_error(bh)) // false >> bh IO error occurs << jbd2_cleanup_journal_tail __jbd2_update_log_tail jbd2_write_superblock // The bh won't be replayed in next mount. , which could corrupt the ext4 image, fetch a reproducer in [Link]. Since writeback process clears buffer dirty after locking buffer head, we can fix it by try locking buffer and check dirtiness while buffer is locked, the buffer head can be removed if it is neither dirty nor locked. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217490 Fixes: 470decc613ab ("[PATCH] jbd2: initial copy of files from jbd") Signed-off-by: Zhihao Cheng Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230606135928.434610-5-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit b98dba273a0e47dbfade89c9af73c5b012a4eabb Author: Zhang Yi Date: Tue Jun 6 21:59:25 2023 +0800 jbd2: remove journal_clean_one_cp_list() journal_clean_one_cp_list() and journal_shrink_one_cp_list() are almost the same, so merge them into journal_shrink_one_cp_list(), remove the nr_to_scan parameter, always scan and try to free the whole checkpoint list. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230606135928.434610-4-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit be22255360f80d3af789daad00025171a65424a5 Author: Zhang Yi Date: Tue Jun 6 21:59:24 2023 +0800 jbd2: remove t_checkpoint_io_list Since t_checkpoint_io_list was stop using in jbd2_log_do_checkpoint() now, it's time to remove the whole t_checkpoint_io_list logic. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230606135928.434610-3-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit c2d6fd9d6f35079f1669f0100f05b46708c74b7f Author: Zhang Yi Date: Tue Jun 6 21:59:23 2023 +0800 jbd2: recheck chechpointing non-dirty buffer There is a long-standing metadata corruption issue that happens from time to time, but it's very difficult to reproduce and analyse, benefit from the JBD2_CYCLE_RECORD option, we found out that the problem is the checkpointing process miss to write out some buffers which are raced by another do_get_write_access(). Looks below for detail. jbd2_log_do_checkpoint() //transaction X //buffer A is dirty and not belones to any transaction __buffer_relink_io() //move it to the IO list __flush_batch() write_dirty_buffer() do_get_write_access() clear_buffer_dirty __jbd2_journal_file_buffer() //add buffer A to a new transaction Y lock_buffer(bh) //doesn't write out __jbd2_journal_remove_checkpoint() //finish checkpoint except buffer A //filesystem corrupt if the new transaction Y isn't fully write out. Due to the t_checkpoint_list walking loop in jbd2_log_do_checkpoint() have already handles waiting for buffers under IO and re-added new transaction to complete commit, and it also removing cleaned buffers, this makes sure the list will eventually get empty. So it's fine to leave buffers on the t_checkpoint_list while flushing out and completely stop using the t_checkpoint_io_list. Cc: stable@vger.kernel.org Suggested-by: Jan Kara Signed-off-by: Zhang Yi Tested-by: Zhihao Cheng Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230606135928.434610-2-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit d0a3022f30629a208e5944022caeca3568add9e7 Author: Beau Belgrave Date: Thu Jun 29 23:50:48 2023 +0000 tracing/user_events: Fix struct arg size match check When users register an event the name of the event and it's argument are checked to ensure they match if the event already exists. Normally all arguments are in the form of "type name", except for when the type starts with "struct ". In those cases, the size of the struct is passed in addition to the name, IE: "struct my_struct a 20" for an argument that is of type "struct my_struct" with a field name of "a" and has the size of 20 bytes. The current code does not honor the above case properly when comparing a match. This causes the event register to fail even when the same string was used for events that contain a struct argument within them. The example above "struct my_struct a 20" generates a match string of "struct my_struct a" omitting the size field. Add the struct size of the existing field when generating a comparison string for a struct field to ensure proper match checking. Link: https://lkml.kernel.org/r/20230629235049.581-2-beaub@linux.microsoft.com Cc: stable@vger.kernel.org Fixes: e6f89a149872 ("tracing/user_events: Ensure user provided strings are safely formatted") Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit b599b06544d87b0c7dcb7d3571c3473ab5abce72 Author: YueHaibing Date: Fri Jun 23 17:16:40 2023 +0800 x86/ftrace: Remove unsued extern declaration ftrace_regs_caller_ret() This is now unused, so can remove it. Link: https://lore.kernel.org/linux-trace-kernel/20230623091640.21952-1-yuehaibing@huawei.com Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Signed-off-by: YueHaibing Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 195b9cb5b288fec1c871ef89f78cc9a7461aad3a Author: Masami Hiramatsu (Google) Date: Fri Jul 7 23:03:19 2023 +0900 fprobe: Ensure running fprobe_exit_handler() finished before calling rethook_free() Ensure running fprobe_exit_handler() has finished before calling rethook_free() in the unregister_fprobe() so that caller can free the fprobe right after unregister_fprobe(). unregister_fprobe() ensured that all running fprobe_entry/exit_handler() have finished by calling unregister_ftrace_function() which synchronizes RCU. But commit 5f81018753df ("fprobe: Release rethook after the ftrace_ops is unregistered") changed to call rethook_free() after unregister_ftrace_function(). So call rethook_stop() to make rethook disabled before unregister_ftrace_function() and ensure it again. Here is the possible code flow that can call the exit handler after unregister_fprobe(). ------ CPU1 CPU2 call unregister_fprobe(fp) ... __fprobe_handler() rethook_hook() on probed function unregister_ftrace_function() return from probed function rethook hooks find rh->handler == fprobe_exit_handler call fprobe_exit_handler() rethook_free(): set rh->handler = NULL; return from unreigster_fprobe; call fp->exit_handler() <- (*) ------ (*) At this point, the exit handler is called after returning from unregister_fprobe(). This fixes it as following; ------ CPU1 CPU2 call unregister_fprobe() ... rethook_stop(): set rh->handler = NULL; __fprobe_handler() rethook_hook() on probed function unregister_ftrace_function() return from probed function rethook hooks find rh->handler == NULL return from rethook rethook_free() return from unreigster_fprobe; ------ Link: https://lore.kernel.org/all/168873859949.156157.13039240432299335849.stgit@devnote2/ Fixes: 5f81018753df ("fprobe: Release rethook after the ftrace_ops is unregistered") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) commit 8c3526fb86060cb53a1f4ca6cc44eb036afcf43e Author: Florent Revest Date: Thu Apr 27 16:07:00 2023 +0200 arm64: ftrace: Add direct call trampoline samples support The ftrace samples need per-architecture trampoline implementations to save and restore argument registers around the calls to my_direct_func* and to restore polluted registers (eg: x30). These samples also include which, on arm64, is not necessary and redefines previously defined macros (resulting in warnings) so these includes are guarded by !CONFIG_ARM64. Link: https://lkml.kernel.org/r/20230427140700.625241-3-revest@chromium.org Reviewed-by: Mark Rutland Tested-by: Mark Rutland Acked-by: Catalin Marinas Signed-off-by: Florent Revest Signed-off-by: Steven Rostedt (Google) commit 8564c315876ab86fcaf8e7f558d6a84cb2ce5590 Author: Florent Revest Date: Thu Apr 27 16:06:59 2023 +0200 samples: ftrace: Save required argument registers in sample trampolines The ftrace-direct-too sample traces the handle_mm_fault function whose signature changed since the introduction of the sample. Since: commit bce617edecad ("mm: do page fault accounting in handle_mm_fault") handle_mm_fault now has 4 arguments. Therefore, the sample trampoline should save 4 argument registers. s390 saves all argument registers already so it does not need a change but x86_64 needs an extra push and pop. This also evolves the signature of the tracing function to make it mirror the signature of the traced function. Link: https://lkml.kernel.org/r/20230427140700.625241-2-revest@chromium.org Cc: stable@vger.kernel.org Fixes: bce617edecad ("mm: do page fault accounting in handle_mm_fault") Reviewed-by: Steven Rostedt (Google) Reviewed-by: Mark Rutland Acked-by: Catalin Marinas Signed-off-by: Florent Revest Signed-off-by: Steven Rostedt (Google) commit dceaafd668812115037fc13a1893d068b7b880f5 Author: Stafford Horne Date: Wed Jun 28 17:54:40 2023 +0100 openrisc: Union fpcsr and oldmask in sigcontext to unbreak userspace ABI With commit 27267655c531 ("openrisc: Support floating point user api") I added an entry to the struct sigcontext which caused an unwanted change to the userspace ABI. To fix this we use the previously unused oldmask field space for the floating point fpcsr state. We do this with a union to restore the ABI back to the pre kernel v6.4 ABI and keep API compatibility. This does mean if there is some code somewhere that is setting oldmask in an OpenRISC specific userspace sighandler it would end up setting the floating point register status, but I think it's unlikely as oldmask was never functional before. Fixes: 27267655c531 ("openrisc: Support floating point user api") Reported-by: Szabolcs Nagy Closes: https://lore.kernel.org/openrisc/20230626213840.GA1236108@port70.net/ Signed-off-by: Stafford Horne commit 3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c Merge: 419caed6cc77f 2500df55a615f Author: Linus Torvalds Date: Mon Jul 10 10:04:26 2023 -0700 Merge tag 'linux-watchdog-6.5-rc2' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog update from Wim Van Sebroeck: - Add Loongson-1 watchdog dt-bindings * tag 'linux-watchdog-6.5-rc2' of git://www.linux-watchdog.org/linux-watchdog: dt-bindings: watchdog: Add Loongson-1 watchdog commit 419caed6cc77f19148faefe13515f8685ede219b Merge: 06c2afb862f9d 0b7ec177b5898 Author: Linus Torvalds Date: Mon Jul 10 09:53:11 2023 -0700 Merge tag 'v6.5-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: "Fix a couple of regressions in af_alg and incorrect return values in crypto/asymmetric_keys/public_key" * tag 'v6.5-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: algif_hash - Fix race between MORE and non-MORE sends KEYS: asymmetric: Fix error codes crypto: af_alg - Fix merging of written data into spliced pages commit dc8cbb65dc17b0daebca84375d35ce54ff730762 Author: Jens Axboe Date: Mon Jul 10 10:23:05 2023 -0600 block: remove dead struc request->completion_data field It's no longer used. While in there, also update the comment as to why it can coexist with the rb_node. Signed-off-by: Jens Axboe commit b938e6603660652dc3db66d3c915fbfed3bce21d Author: Ankit Kumar Date: Fri Jun 23 18:08:05 2023 +0530 nvme: fix the NVME_ID_NS_NVM_STS_MASK definition As per NVMe command set specification 1.0c Storage tag size is 7 bits. Fixes: 4020aad85c67 ("nvme: add support for enhanced metadata") Signed-off-by: Ankit Kumar Reviewed-by: Kanchan Joshi Signed-off-by: Keith Busch commit 0bcc62858d6ba62cbade957d69745e6adeed5f3d Author: Florian Kauer Date: Wed Jun 14 16:07:14 2023 +0200 igc: Fix inserting of empty frame for launchtime The insertion of an empty frame was introduced with commit db0b124f02ba ("igc: Enhance Qbv scheduling by using first flag bit") in order to ensure that the current cycle has at least one packet if there is some packet to be scheduled for the next cycle. However, the current implementation does not properly check if a packet is already scheduled for the current cycle. Currently, an empty packet is always inserted if and only if txtime >= end_of_cycle && txtime > last_tx_cycle but since last_tx_cycle is always either the end of the current cycle (end_of_cycle) or the end of a previous cycle, the second part (txtime > last_tx_cycle) is always true unless txtime == last_tx_cycle. What actually needs to be checked here is if the last_tx_cycle was already written within the current cycle, so an empty frame should only be inserted if and only if txtime >= end_of_cycle && end_of_cycle > last_tx_cycle. This patch does not only avoid an unnecessary insertion, but it can actually be harmful to insert an empty packet if packets are already scheduled in the current cycle, because it can lead to a situation where the empty packet is actually processed as the first packet in the upcoming cycle shifting the packet with the first_flag even one cycle into the future, finally leading to a TX hang. The TX hang can be reproduced on a i225 with: sudo tc qdisc replace dev enp1s0 parent root handle 100 taprio \ num_tc 1 \ map 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \ queues 1@0 \ base-time 0 \ sched-entry S 01 300000 \ flags 0x1 \ txtime-delay 500000 \ clockid CLOCK_TAI sudo tc qdisc replace dev enp1s0 parent 100:1 etf \ clockid CLOCK_TAI \ delta 500000 \ offload \ skip_sock_check and traffic generator sudo trafgen -i traffic.cfg -o enp1s0 --cpp -n0 -q -t1400ns with traffic.cfg #define ETH_P_IP 0x0800 { /* Ethernet Header */ 0x30, 0x1f, 0x9a, 0xd0, 0xf0, 0x0e, # MAC Dest - adapt as needed 0x24, 0x5e, 0xbe, 0x57, 0x2e, 0x36, # MAC Src - adapt as needed const16(ETH_P_IP), /* IPv4 Header */ 0b01000101, 0, # IPv4 version, IHL, TOS const16(1028), # IPv4 total length (UDP length + 20 bytes (IP header)) const16(2), # IPv4 ident 0b01000000, 0, # IPv4 flags, fragmentation off 64, # IPv4 TTL 17, # Protocol UDP csumip(14, 33), # IPv4 checksum /* UDP Header */ 10, 0, 48, 1, # IP Src - adapt as needed 10, 0, 48, 10, # IP Dest - adapt as needed const16(5555), # UDP Src Port const16(6666), # UDP Dest Port const16(1008), # UDP length (UDP header 8 bytes + payload length) csumudp(14, 34), # UDP checksum /* Payload */ fill('W', 1000), } and the observed message with that is for example igc 0000:01:00.0 enp1s0: Detected Tx Unit Hang Tx Queue <0> TDH <32> TDT <3c> next_to_use <3c> next_to_clean <32> buffer_info[next_to_clean] time_stamp next_to_watch <00000000632a1828> jiffies desc.status <1048000> Fixes: db0b124f02ba ("igc: Enhance Qbv scheduling by using first flag bit") Signed-off-by: Florian Kauer Reviewed-by: Kurt Kanzenbach Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit c1bca9ac0bcb355be11354c2e68bc7bf31f5ac5a Author: Florian Kauer Date: Wed Jun 14 16:07:13 2023 +0200 igc: Fix launchtime before start of cycle It is possible (verified on a running system) that frames are processed by igc_tx_launchtime with a txtime before the start of the cycle (baset_est). However, the result of txtime - baset_est is written into a u32, leading to a wrap around to a positive number. The following launchtime > 0 check will only branch to executing launchtime = 0 if launchtime is already 0. Fix it by using a s32 before checking launchtime > 0. Fixes: db0b124f02ba ("igc: Enhance Qbv scheduling by using first flag bit") Signed-off-by: Florian Kauer Reviewed-by: Kurt Kanzenbach Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 8b86f10ab64eca0287ea8f7c94e9ad8b2e101c01 Author: Florian Kauer Date: Wed Jun 14 16:07:12 2023 +0200 igc: No strict mode in pure launchtime/CBS offload The flags IGC_TXQCTL_STRICT_CYCLE and IGC_TXQCTL_STRICT_END prevent the packet transmission over slot and cycle boundaries. This is important for taprio offload where the slots and cycles correspond to the slots and cycles configured for the network. However, the Qbv offload feature of the i225 is also used for enabling TX launchtime / ETF offload. In that case, however, the cycle has no meaning for the network and is only used internally to adapt the base time register after a second has passed. Enabling strict mode in this case would unnecessarily prevent the transmission of certain packets (i.e. at the boundary of a second) and thus interferes with the ETF qdisc that promises transmission at a certain point in time. Similar to ETF, this also applies to CBS offload that also should not be influenced by strict mode unless taprio offload would be enabled at the same time. This fully reverts commit d8f45be01dd9 ("igc: Use strict cycles for Qbv scheduling") but its commit message only describes what was already implemented before that commit. The difference to a plain revert of that commit is that it now copes with the base_time = 0 case that was fixed with commit e17090eb2494 ("igc: allow BaseTime 0 enrollment for Qbv") In particular, enabling strict mode leads to TX hang situations under high traffic if taprio is applied WITHOUT taprio offload but WITH ETF offload, e.g. as in sudo tc qdisc replace dev enp1s0 parent root handle 100 taprio \ num_tc 1 \ map 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \ queues 1@0 \ base-time 0 \ sched-entry S 01 300000 \ flags 0x1 \ txtime-delay 500000 \ clockid CLOCK_TAI sudo tc qdisc replace dev enp1s0 parent 100:1 etf \ clockid CLOCK_TAI \ delta 500000 \ offload \ skip_sock_check and traffic generator sudo trafgen -i traffic.cfg -o enp1s0 --cpp -n0 -q -t1400ns with traffic.cfg #define ETH_P_IP 0x0800 { /* Ethernet Header */ 0x30, 0x1f, 0x9a, 0xd0, 0xf0, 0x0e, # MAC Dest - adapt as needed 0x24, 0x5e, 0xbe, 0x57, 0x2e, 0x36, # MAC Src - adapt as needed const16(ETH_P_IP), /* IPv4 Header */ 0b01000101, 0, # IPv4 version, IHL, TOS const16(1028), # IPv4 total length (UDP length + 20 bytes (IP header)) const16(2), # IPv4 ident 0b01000000, 0, # IPv4 flags, fragmentation off 64, # IPv4 TTL 17, # Protocol UDP csumip(14, 33), # IPv4 checksum /* UDP Header */ 10, 0, 48, 1, # IP Src - adapt as needed 10, 0, 48, 10, # IP Dest - adapt as needed const16(5555), # UDP Src Port const16(6666), # UDP Dest Port const16(1008), # UDP length (UDP header 8 bytes + payload length) csumudp(14, 34), # UDP checksum /* Payload */ fill('W', 1000), } and the observed message with that is for example igc 0000:01:00.0 enp1s0: Detected Tx Unit Hang Tx Queue <0> TDH TDT next_to_use next_to_clean buffer_info[next_to_clean] time_stamp next_to_watch <00000000245a4efb> jiffies desc.status <1048000> Fixes: d8f45be01dd9 ("igc: Use strict cycles for Qbv scheduling") Signed-off-by: Florian Kauer Reviewed-by: Kurt Kanzenbach Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit ed9492dfef8738ca68879f5690dda5a04f1897dc Author: Li zeming Date: Wed Jul 12 02:53:53 2023 +0800 kernel: kprobes: Remove unnecessary ‘0’ values it is assigned first, so it does not need to initialize the assignment. Link: https://lore.kernel.org/all/20230711185353.3218-1-zeming@nfschina.com/ Signed-off-by: Li zeming Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit e1164787f22b51010cfdc6a5e41b744435836b79 Author: Li zeming Date: Wed Jul 5 03:43:59 2023 +0800 kprobes: Remove unnecessary ‘NULL’ values from correct_ret_addr The 'correct_ret_addr' pointer is always set in the later code, no need to initialize it at definition time. Link: https://lore.kernel.org/all/20230704194359.3124-1-zeming@nfschina.com/ Signed-off-by: Li zeming Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 5f0c584daf7464f04114c65dd07269ee2bfedc13 Author: Ze Gao Date: Mon Jul 3 17:23:36 2023 +0800 fprobe: add unlock to match a succeeded ftrace_test_recursion_trylock Unlock ftrace recursion lock when fprobe_kprobe_handler() is failed because of some running kprobe. Link: https://lore.kernel.org/all/20230703092336.268371-1-zegao@tencent.com/ Fixes: 3cc4e2c5fbae ("fprobe: make fprobe_kprobe_handler recursion free") Reported-by: Yafang Closes: https://lore.kernel.org/linux-trace-kernel/CALOAHbC6UpfFOOibdDiC7xFc5YFUgZnk3MZ=3Ny6we=AcrNbew@mail.gmail.com/ Signed-off-by: Ze Gao Acked-by: Masami Hiramatsu (Google) Acked-by: Yafang Shao Reviewed-by: Steven Rostedt (Google) Signed-off-by: Masami Hiramatsu (Google) commit 9bcf156f5897e91e21be54960b46774f0682afad Author: Damien Le Moal Date: Fri Jul 7 09:32:22 2023 +0900 nvmet: use PAGE_SECTORS_SHIFT Replace occurences of the pattern "PAGE_SHIFT - 9" in the passthru and loop targets with PAGE_SECTORS_SHIFT. Signed-off-by: Damien Le Moal Reviewed-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit cf0a624dc706c306294c14e6b3e7694702f25191 Author: Tzvetomir Stoyanov (VMware) Date: Mon Jul 3 07:28:53 2023 +0300 kernel/trace: Fix cleanup logic of enable_trace_eprobe The enable_trace_eprobe() function enables all event probes, attached to given trace probe. If an error occurs in enabling one of the event probes, all others should be roll backed. There is a bug in that roll back logic - instead of all event probes, only the failed one is disabled. Link: https://lore.kernel.org/all/20230703042853.1427493-1-tz.stoyanov@gmail.com/ Reported-by: Dan Carpenter Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events") Signed-off-by: Tzvetomir Stoyanov (VMware) Acked-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) Signed-off-by: Masami Hiramatsu (Google) commit e5bb0988a5b622f58cc53dbdc044562229284d23 Author: Pankaj Raghav Date: Tue Jul 4 09:36:56 2023 +0200 nvme: add BOGUS_NID quirk for Samsung SM953 Add the quirk as SM953 is reporting bogus namespace ID. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217593 Reported-by: Clemens Springsguth Tested-by: Clemens Springsguth Signed-off-by: Pankaj Raghav Signed-off-by: Keith Busch commit e5d88c53d03f8df864776431175d08c053645f50 Author: Florian Kauer Date: Wed Jun 14 16:07:11 2023 +0200 igc: Handle already enabled taprio offload for basetime 0 Since commit e17090eb2494 ("igc: allow BaseTime 0 enrollment for Qbv") it is possible to enable taprio offload with a basetime of 0. However, the check if taprio offload is already enabled (and thus -EALREADY should be returned for igc_save_qbv_schedule) still relied on adapter->base_time > 0. This can be reproduced as follows: # TAPRIO offload (flags == 0x2) and base-time = 0 sudo tc qdisc replace dev enp1s0 parent root handle 100 stab overhead 24 taprio \ num_tc 1 \ map 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \ queues 1@0 \ base-time 0 \ sched-entry S 01 300000 \ flags 0x2 # The second call should fail with "Error: Device failed to setup taprio offload." # But that only happens if base-time was != 0 sudo tc qdisc replace dev enp1s0 parent root handle 100 stab overhead 24 taprio \ num_tc 1 \ map 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \ queues 1@0 \ base-time 0 \ sched-entry S 01 300000 \ flags 0x2 Fixes: e17090eb2494 ("igc: allow BaseTime 0 enrollment for Qbv") Signed-off-by: Florian Kauer Reviewed-by: Kurt Kanzenbach Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 82ff5f29b7377d614f0c01fd74b5d0cb225f0adc Author: Florian Kauer Date: Wed Jun 14 16:07:10 2023 +0200 igc: Do not enable taprio offload for invalid arguments Only set adapter->taprio_offload_enable after validating the arguments. Otherwise, it stays set even if the offload was not enabled. Since the subsequent code does not get executed in case of invalid arguments, it will not be read at first. However, by activating and then deactivating another offload (e.g. ETF/TX launchtime offload), taprio_offload_enable is read and erroneously keeps the offload feature of the NIC enabled. This can be reproduced as follows: # TAPRIO offload (flags == 0x2) and negative base-time leading to expected -ERANGE sudo tc qdisc replace dev enp1s0 parent root handle 100 stab overhead 24 taprio \ num_tc 1 \ map 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \ queues 1@0 \ base-time -1000 \ sched-entry S 01 300000 \ flags 0x2 # IGC_TQAVCTRL is 0x0 as expected (iomem=relaxed for reading register) sudo pcimem /sys/bus/pci/devices/0000:01:00.0/resource0 0x3570 w*1 # Activate ETF offload sudo tc qdisc replace dev enp1s0 parent root handle 6666 mqprio \ num_tc 3 \ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \ queues 1@0 1@1 2@2 \ hw 0 sudo tc qdisc add dev enp1s0 parent 6666:1 etf \ clockid CLOCK_TAI \ delta 500000 \ offload # IGC_TQAVCTRL is 0x9 as expected sudo pcimem /sys/bus/pci/devices/0000:01:00.0/resource0 0x3570 w*1 # Deactivate ETF offload again sudo tc qdisc delete dev enp1s0 parent 6666:1 # IGC_TQAVCTRL should now be 0x0 again, but is observed as 0x9 sudo pcimem /sys/bus/pci/devices/0000:01:00.0/resource0 0x3570 w*1 Fixes: e17090eb2494 ("igc: allow BaseTime 0 enrollment for Qbv") Signed-off-by: Florian Kauer Reviewed-by: Kurt Kanzenbach Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 8046063df887bee35c002224267ba46f41be7cf6 Author: Florian Kauer Date: Wed Jun 14 16:07:09 2023 +0200 igc: Rename qbv_enable to taprio_offload_enable In the current implementation the flags adapter->qbv_enable and IGC_FLAG_TSN_QBV_ENABLED have a similar name, but do not have the same meaning. The first one is used only to indicate taprio offload (i.e. when igc_save_qbv_schedule was called), while the second one corresponds to the Qbv mode of the hardware. However, the second one is also used to support the TX launchtime feature, i.e. ETF qdisc offload. This leads to situations where adapter->qbv_enable is false, but the flag IGC_FLAG_TSN_QBV_ENABLED is set. This is prone to confusion. The rename should reduce this confusion. Since it is a pure rename, it has no impact on functionality. Fixes: e17090eb2494 ("igc: allow BaseTime 0 enrollment for Qbv") Signed-off-by: Florian Kauer Reviewed-by: Kurt Kanzenbach Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit df9d70c18616760c6504b97fec66b6379c172dbb Author: Bharath SM Date: Fri Jul 7 15:29:01 2023 +0000 cifs: if deferred close is disabled then close files immediately If defer close timeout value is set to 0, then there is no need to include files in the deferred close list and utilize the delayed worker for closing. Instead, we can close them immediately. Signed-off-by: Bharath SM Reviewed-by: Shyam Prasad N Cc: stable@vger.kernel.org Signed-off-by: Steve French commit 7e08baf6a89c8758050a3593aedc949f44fe3413 Author: Baoquan He Date: Fri Jul 7 21:58:52 2023 +0800 of: make OF_EARLY_FLATTREE depend on HAS_IOMEM On s390 systems (aka mainframes), it has classic channel devices for networking and permanent storage that are currently even more common than PCI devices. Hence it could have a fully functional s390 kernel with CONFIG_PCI=n, then the relevant iomem mapping functions [including ioremap(), devm_ioremap(), etc.] are not available. In LKP error report at below on s390: ------ ld: kernel/dma/coherent.o: in function `dma_init_coherent_memory': coherent.c:(.text+0x102): undefined reference to `memremap' ld: coherent.c:(.text+0x226): undefined reference to `memunmap' ld: kernel/dma/coherent.o: in function `dma_declare_coherent_memory': coherent.c:(.text+0x8b8): undefined reference to `memunmap' ld: kernel/dma/coherent.o: in function `dma_release_coherent_memory': coherent.c:(.text+0x9aa): undefined reference to `memunmap' ------ In the config file, several Kconfig options are: ------ '# CONFIG_PCI is not set' CONFIG_OF_EARLY_FLATTREE=y CONFIG_DMA_DECLARE_COHERENT=y ------ So, enabling OF_EARLY_FLATTREE will select DMA_DECLARE_COHERENT and cause above building errors even though they are not needed because CONFIG_PCI is disabled. Here let OF_EARLY_FLATTREE depend on HAS_IOMEM so that it won't be built to cause compiling error if PCI is unset. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306211329.ticOJCSv-lkp@intel.com/ Signed-off-by: Baoquan He Cc: Rob Herring Cc: Frank Rowand Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20230707135852.24292-9-bhe@redhat.com Signed-off-by: Rob Herring commit f99a75f11f46a24dabb33e90893eebf61dca0566 Author: Krzysztof Kozlowski Date: Sun Jul 2 20:52:42 2023 +0200 arm64: dts: rockchip: minor whitespace cleanup around '=' The DTS code coding style expects exactly one space before and after '=' sign. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230702185242.44421-1-krzysztof.kozlowski@linaro.org Signed-off-by: Heiko Stuebner commit 2bd1d2dd808c60532283e9cf05110bf1bf2f9079 Author: Christopher Obbard Date: Wed Jul 5 15:42:55 2023 +0100 arm64: dts: rockchip: Disable HS400 for eMMC on ROCK 4C+ There is some instablity with some eMMC modules on ROCK Pi 4 SBCs running in HS400 mode. This ends up resulting in some block errors after a while or after a "heavy" operation utilising the eMMC (e.g. resizing a filesystem). An example of these errors is as follows: [ 289.171014] mmc1: running CQE recovery [ 290.048972] mmc1: running CQE recovery [ 290.054834] mmc1: running CQE recovery [ 290.060817] mmc1: running CQE recovery [ 290.061337] blk_update_request: I/O error, dev mmcblk1, sector 1411072 op 0x1:(WRITE) flags 0x800 phys_seg 36 prio class 0 [ 290.061370] EXT4-fs warning (device mmcblk1p1): ext4_end_bio:348: I/O error 10 writing to inode 29547 starting block 176466) [ 290.061484] Buffer I/O error on device mmcblk1p1, logical block 172288 [ 290.061531] Buffer I/O error on device mmcblk1p1, logical block 172289 [ 290.061551] Buffer I/O error on device mmcblk1p1, logical block 172290 [ 290.061574] Buffer I/O error on device mmcblk1p1, logical block 172291 [ 290.061592] Buffer I/O error on device mmcblk1p1, logical block 172292 [ 290.061615] Buffer I/O error on device mmcblk1p1, logical block 172293 [ 290.061632] Buffer I/O error on device mmcblk1p1, logical block 172294 [ 290.061654] Buffer I/O error on device mmcblk1p1, logical block 172295 [ 290.061673] Buffer I/O error on device mmcblk1p1, logical block 172296 [ 290.061695] Buffer I/O error on device mmcblk1p1, logical block 172297 Disabling the Command Queue seems to stop the CQE recovery from running, but doesn't seem to improve the I/O errors. Until this can be investigated further, disable HS400 mode on the ROCK Pi 4 SBCs to at least stop I/O errors from occurring. Fixes: 246450344dad ("arm64: dts: rockchip: rk3399: Radxa ROCK 4C+") Signed-off-by: Christopher Obbard Link: https://lore.kernel.org/r/20230705144255.115299-3-chris.obbard@collabora.com Signed-off-by: Heiko Stuebner commit cee572756aa2cb46e959e9797ad4b730b78a050b Author: Christopher Obbard Date: Wed Jul 5 15:42:54 2023 +0100 arm64: dts: rockchip: Disable HS400 for eMMC on ROCK Pi 4 There is some instablity with some eMMC modules on ROCK Pi 4 SBCs running in HS400 mode. This ends up resulting in some block errors after a while or after a "heavy" operation utilising the eMMC (e.g. resizing a filesystem). An example of these errors is as follows: [ 289.171014] mmc1: running CQE recovery [ 290.048972] mmc1: running CQE recovery [ 290.054834] mmc1: running CQE recovery [ 290.060817] mmc1: running CQE recovery [ 290.061337] blk_update_request: I/O error, dev mmcblk1, sector 1411072 op 0x1:(WRITE) flags 0x800 phys_seg 36 prio class 0 [ 290.061370] EXT4-fs warning (device mmcblk1p1): ext4_end_bio:348: I/O error 10 writing to inode 29547 starting block 176466) [ 290.061484] Buffer I/O error on device mmcblk1p1, logical block 172288 [ 290.061531] Buffer I/O error on device mmcblk1p1, logical block 172289 [ 290.061551] Buffer I/O error on device mmcblk1p1, logical block 172290 [ 290.061574] Buffer I/O error on device mmcblk1p1, logical block 172291 [ 290.061592] Buffer I/O error on device mmcblk1p1, logical block 172292 [ 290.061615] Buffer I/O error on device mmcblk1p1, logical block 172293 [ 290.061632] Buffer I/O error on device mmcblk1p1, logical block 172294 [ 290.061654] Buffer I/O error on device mmcblk1p1, logical block 172295 [ 290.061673] Buffer I/O error on device mmcblk1p1, logical block 172296 [ 290.061695] Buffer I/O error on device mmcblk1p1, logical block 172297 Disabling the Command Queue seems to stop the CQE recovery from running, but doesn't seem to improve the I/O errors. Until this can be investigated further, disable HS400 mode on the ROCK Pi 4 SBCs to at least stop I/O errors from occurring. While we are here, set the eMMC maximum clock frequency to 1.5MHz to follow the ROCK 4C+. Fixes: 1b5715c602fd ("arm64: dts: rockchip: add ROCK Pi 4 DTS support") Signed-off-by: Christopher Obbard Tested-By: Folker Schwesinger Link: https://lore.kernel.org/r/20230705144255.115299-2-chris.obbard@collabora.com Signed-off-by: Heiko Stuebner commit 5ce6971e5279c569defc2f2ac800692049bbaa90 Author: Krzysztof Kozlowski Date: Wed Jul 5 16:58:59 2023 +0200 arm64: dts: rockchip: add missing space before { on indiedroid nova Add missing whitespace between node name/label and opening {. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230705145859.293260-1-krzysztof.kozlowski@linaro.org Signed-off-by: Heiko Stuebner commit 2d6f7e3938a7aba154c8e8afaddc8b7f1e0a1b56 Author: Krzysztof Kozlowski Date: Fri Jul 7 08:33:35 2023 +0200 arm64: dts: rockchip: correct wifi interrupt flag in Box Demo GPIO_ACTIVE_x flags are not correct in the context of interrupt flags. These are simple defines so they could be used in DTS but they will not have the same meaning: GPIO_ACTIVE_HIGH = 0 = IRQ_TYPE_NONE. Correct the interrupt flags, assuming the author of the code wanted same logical behavior behind the name "ACTIVE_xxx", this is: ACTIVE_HIGH => IRQ_TYPE_LEVEL_HIGH Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230707063335.13317-3-krzysztof.kozlowski@linaro.org Signed-off-by: Heiko Stuebner commit cfa12c32b96fd5b12f77d880d6a1ddd2a502756e Author: Krzysztof Kozlowski Date: Fri Jul 7 08:33:34 2023 +0200 arm64: dts: rockchip: correct wifi interrupt flag in Rock Pi 4B GPIO_ACTIVE_x flags are not correct in the context of interrupt flags. These are simple defines so they could be used in DTS but they will not have the same meaning: GPIO_ACTIVE_HIGH = 0 = IRQ_TYPE_NONE. Correct the interrupt flags, assuming the author of the code wanted same logical behavior behind the name "ACTIVE_xxx", this is: ACTIVE_HIGH => IRQ_TYPE_LEVEL_HIGH Signed-off-by: Krzysztof Kozlowski Tested-by: Christopher Obbard Link: https://lore.kernel.org/r/20230707063335.13317-2-krzysztof.kozlowski@linaro.org Signed-off-by: Heiko Stuebner commit 8183bb7e291b7818f49ea39687c2fafa01a46e27 Author: Krzysztof Kozlowski Date: Fri Jul 7 08:33:33 2023 +0200 arm64: dts: rockchip: correct wifi interrupt flag in eaidk-610 GPIO_ACTIVE_x flags are not correct in the context of interrupt flags. These are simple defines so they could be used in DTS but they will not have the same meaning: GPIO_ACTIVE_HIGH = 0 = IRQ_TYPE_NONE. Correct the interrupt flags, assuming the author of the code wanted same logical behavior behind the name "ACTIVE_xxx", this is: ACTIVE_HIGH => IRQ_TYPE_LEVEL_HIGH Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230707063335.13317-1-krzysztof.kozlowski@linaro.org Signed-off-by: Heiko Stuebner commit 9ecedaf6f82acf9e0d68932da2a72aefcf0b7176 Author: Tom Rix Date: Sun Jul 2 09:44:19 2023 -0400 platform/x86: int3472/discrete: set variable skl_int3472_regulator_second_sensor storage-class-specifier to static smatch reports drivers/platform/x86/intel/int3472/clk_and_regulator.c:263:28: warning: symbol 'skl_int3472_regulator_second_sensor' was not declared. Should it be static? This variable is only used in its defining file, so it should be static. Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20230702134419.3438361-1-trix@redhat.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 5b2a4a4394ce96fb01a282dd58e263d02218db03 Author: Srinivas Pandruvada Date: Thu Jun 22 12:57:17 2023 -0700 platform/x86/intel/tpmi: Prevent overflow for cap_offset cap_offset is a u16 field, so multiplying with TPMI_CAP_OFFSET_UNIT (which is equal to 1024) to covert to bytes will cause overflow. This will be a problem once more TPMI features are added. This field is not used except for calculating pfs->vsec_offset. So, leave cap_offset field unchanged and multiply with TPMI_CAP_OFFSET_UNIT while calculating pfs->vsec_offset. Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20230622195717.3125088-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 95f41d87810083d8b3dedcce46a4e356cf4a9673 Author: Christophe JAILLET Date: Tue Apr 25 08:47:27 2023 +0200 fs/9p: Fix a datatype used with V9FS_DIRECT_IO The commit in Fixes has introduced some "enum p9_session_flags" values larger than a char. Such values are stored in "v9fs_session_info->flags" which is a char only. Turn it into an int so that the "enum p9_session_flags" values can fit in it. Fixes: 6deffc8924b5 ("fs/9p: Add new mount modes") Signed-off-by: Christophe JAILLET Reviewed-by: Dominique Martinet Reviewed-by: Christian Schoenebeck Signed-off-by: Eric Van Hensbergen commit 6bf06f14bf33d668ee0eb85b6c414d85a0f8e1a5 Author: Andy Shevchenko Date: Wed Jun 21 18:11:55 2023 +0300 platform/x86: wmi: Replace open coded guid_parse_and_compare() Even though we have no issues in the code, let's replace the open coded guid_parse_and_compare(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230621151155.78279-2-andriy.shevchenko@linux.intel.com Tested-by: Armin Wolf Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 028e6e204ace1f080cfeacd72c50397eb8ae8883 Author: Andy Shevchenko Date: Wed Jun 21 18:11:54 2023 +0300 platform/x86: wmi: Break possible infinite loop when parsing GUID The while-loop may break on one of the two conditions, either ID string is empty or GUID matches. The second one, may never be reached if the parsed string is not correct GUID. In such a case the loop will never advance to check the next ID. Break possible infinite loop by factoring out guid_parse_and_compare() helper which may be moved to the generic header for everyone later on and preventing from similar mistake in the future. Interestingly that firstly it appeared when WMI was turned into a bus driver, but later when duplicated GUIDs were checked, the while-loop has been replaced by for-loop and hence no mistake made again. Fixes: a48e23385fcf ("platform/x86: wmi: add context pointer field to struct wmi_device_id") Fixes: 844af950da94 ("platform/x86: wmi: Turn WMI into a bus driver") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230621151155.78279-1-andriy.shevchenko@linux.intel.com Tested-by: Armin Wolf Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit a2848d08742c8e8494675892c02c0d22acbe3cf8 Author: Christian König Date: Fri Jul 7 11:25:00 2023 +0200 drm/ttm: never consider pinned BOs for eviction&swap There is a small window where we have already incremented the pin count but not yet moved the bo from the lru to the pinned list. Signed-off-by: Christian König Reported-by: Pelloux-Prayer, Pierre-Eric Tested-by: Pelloux-Prayer, Pierre-Eric Acked-by: Alex Deucher Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20230707120826.3701-1-christian.koenig@amd.com commit 4d08b19629495b29601991d09d07865694c25199 Author: Cristian Ciocaltea Date: Fri Jul 7 19:22:17 2023 +0300 arm64: dts: rockchip: Drop invalid regulator-init-microvolt property The 'regulator-init-microvolt' property is not currently supported by any driver, it was simply carried on from downstream kernels. The problem is also indicated by the following dtbs_check warning: rk3588-rock-5b.dtb: pmic@0: regulators:dcdc-reg4: Unevaluated properties are not allowed ('regulator-init-microvolt' was unexpected) Remove the invalid property from all affected DTS files. Signed-off-by: Cristian Ciocaltea Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: David Heidelberg Link: https://lore.kernel.org/r/20230707162217.675390-1-cristian.ciocaltea@collabora.com Signed-off-by: Heiko Stuebner commit d1478aea649e739a0a0e4890cd8b049ae5d08c13 Author: Thierry Reding Date: Thu Jun 29 18:01:32 2023 +0200 memory: tegra: Add dummy implementation on Tegra194 With the introduction of commit 9365bf006f53 ("PCI: tegra194: Add interconnect support in Tegra234"), the PCI driver on Tegra194 and later requires an interconnect provider. However, a provider is currently only exposed on Tegra234 and this causes PCI on Tegra194 to defer probe indefinitely. Fix this by adding a dummy implementation on Tegra194. This allows nodes to be provided to interconnect consumers, but doesn't do any bandwidth accounting or frequency scaling. Fixes: 9365bf006f53 ("PCI: tegra194: Add interconnect support in Tegra234") Reported-by: Jon Hunter Signed-off-by: Thierry Reding Reviewed-by: Sumit Gupta Tested-by: Sumit Gupta Link: https://lore.kernel.org/r/20230629160132.768940-1-thierry.reding@gmail.com Signed-off-by: Krzysztof Kozlowski commit 57010b8ece2821a1fdfdba2197d14a022f3769db Author: Herbert Xu Date: Tue Jul 4 08:53:49 2023 +0800 xfrm: Silence warnings triggerable by bad packets After the elimination of inner modes, a couple of warnings that were previously unreachable can now be triggered by malformed inbound packets. Fix this by: 1. Moving the setting of skb->protocol into the decap functions. 2. Returning -EINVAL when unexpected protocol is seen. Reported-by: Maciej Żenczykowski Fixes: 5f24f41e8ea6 ("xfrm: Remove inner/outer modes from input path") Signed-off-by: Herbert Xu Reviewed-by: Maciej Żenczykowski Signed-off-by: Steffen Klassert commit 5158814cbb37bbb38344b3ecddc24ba2ed0365f2 Author: Jonas Gorski Date: Thu Jun 29 09:14:52 2023 +0200 spi: bcm63xx: fix max prepend length The command word is defined as following: /* Command */ #define SPI_CMD_COMMAND_SHIFT 0 #define SPI_CMD_DEVICE_ID_SHIFT 4 #define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8 #define SPI_CMD_ONE_BYTE_SHIFT 11 #define SPI_CMD_ONE_WIRE_SHIFT 12 If the prepend byte count field starts at bit 8, and the next defined bit is SPI_CMD_ONE_BYTE at bit 11, it can be at most 3 bits wide, and thus the max value is 7, not 15. Fixes: b17de076062a ("spi/bcm63xx: work around inability to keep CS up") Signed-off-by: Jonas Gorski Link: https://lore.kernel.org/r/20230629071453.62024-1-jonas.gorski@gmail.com Signed-off-by: Mark Brown commit c09168c9392ac9250d87d71fc5ca3156f7456ea4 Author: Ryan Wanner Date: Fri Jun 30 09:17:00 2023 -0700 MAINTAINERS: Add myself as a maintainer for Microchip SPI Tudor is not with Microchip anymore. I have worked lately with Microchip SPI drivers replacing Tudor with myself as this maintainer. Signed-off-by: Ryan Wanner Acked-by: Nicolas Ferre Acked-by: Tudor Ambarus Link: https://lore.kernel.org/r/20230630161700.448747-1-Ryan.Wanner@microchip.com Signed-off-by: Mark Brown commit bfc374a145ae133613e05b9b89be561f169cb58d Author: Biju Das Date: Tue Jul 4 12:18:58 2023 +0100 pinctrl: renesas: rzg2l: Handle non-unique subnode names Currently, sd1 and sd0 have unique subnode names 'sd1_mux' and 'sd0_mux'. If we change these to non-unique subnode names such as 'mux' this can lead to the below conflict as the RZ/G2L pin control driver considers only the names of the subnodes. pinctrl-rzg2l 11030000.pinctrl: pin P47_0 already requested by 11c00000.mmc; cannot claim for 11c10000.mmc pinctrl-rzg2l 11030000.pinctrl: pin-376 (11c10000.mmc) status -22 pinctrl-rzg2l 11030000.pinctrl: could not request pin 376 (P47_0) from group mux on device pinctrl-rzg2l renesas_sdhi_internal_dmac 11c10000.mmc: Error applying setting, reverse things back Fix this by constructing unique names from the node names of both the pin control configuration node and its child node, where appropriate. Based on the work done by Geert for the RZ/V2M pinctrl driver. Fixes: c4c4637eb57f ("pinctrl: renesas: Add RZ/G2L pin and gpio controller driver") Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230704111858.215278-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit f46a0b47cc0829acd050213194c5a77351e619b2 Author: Geert Uytterhoeven Date: Mon Jul 3 17:07:06 2023 +0200 pinctrl: renesas: rzv2m: Handle non-unique subnode names The eMMC and SDHI pin control configuration nodes in DT have subnodes with the same names ("data" and "ctrl"). As the RZ/V2M pin control driver considers only the names of the subnodes, this leads to conflicts: pinctrl-rzv2m b6250000.pinctrl: pin P8_2 already requested by 85000000.mmc; cannot claim for 85020000.mmc pinctrl-rzv2m b6250000.pinctrl: pin-130 (85020000.mmc) status -22 renesas_sdhi_internal_dmac 85020000.mmc: Error applying setting, reverse things back Fix this by constructing unique names from the node names of both the pin control configuration node and its child node, where appropriate. Reported by: Fabrizio Castro Fixes: 92a9b825257614af ("pinctrl: renesas: Add RZ/V2M pin and gpio controller driver") Signed-off-by: Geert Uytterhoeven Tested-by: Fabrizio Castro Link: https://lore.kernel.org/r/607bd6ab4905b0b1b119a06ef953fa1184505777.1688396717.git.geert+renesas@glider.be commit 87854366176403438d01f368b09de3ec2234e0f5 Author: Basavaraj Natikar Date: Fri Jul 7 12:27:22 2023 +0530 HID: amd_sfh: Fix for shift-out-of-bounds Shift operation of 'exp' and 'shift' variables exceeds the maximum number of shift values in the u32 range leading to UBSAN shift-out-of-bounds. ... [ 6.120512] UBSAN: shift-out-of-bounds in drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c:149:50 [ 6.120598] shift exponent 104 is too large for 64-bit type 'long unsigned int' [ 6.120659] CPU: 4 PID: 96 Comm: kworker/4:1 Not tainted 6.4.0amd_1-next-20230519-dirty #10 [ 6.120665] Hardware name: AMD Birman-PHX/Birman-PHX, BIOS SFH_with_HPD_SEN.FD 04/05/2023 [ 6.120667] Workqueue: events amd_sfh_work_buffer [amd_sfh] [ 6.120687] Call Trace: [ 6.120690] [ 6.120694] dump_stack_lvl+0x48/0x70 [ 6.120704] dump_stack+0x10/0x20 [ 6.120707] ubsan_epilogue+0x9/0x40 [ 6.120716] __ubsan_handle_shift_out_of_bounds+0x10f/0x170 [ 6.120720] ? psi_group_change+0x25f/0x4b0 [ 6.120729] float_to_int.cold+0x18/0xba [amd_sfh] [ 6.120739] get_input_rep+0x57/0x340 [amd_sfh] [ 6.120748] ? __schedule+0xba7/0x1b60 [ 6.120756] ? __pfx_get_input_rep+0x10/0x10 [amd_sfh] [ 6.120764] amd_sfh_work_buffer+0x91/0x180 [amd_sfh] [ 6.120772] process_one_work+0x229/0x430 [ 6.120780] worker_thread+0x4a/0x3c0 [ 6.120784] ? __pfx_worker_thread+0x10/0x10 [ 6.120788] kthread+0xf7/0x130 [ 6.120792] ? __pfx_kthread+0x10/0x10 [ 6.120795] ret_from_fork+0x29/0x50 [ 6.120804] ... Fix this by adding the condition to validate shift ranges. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Cc: stable@vger.kernel.org Tested-by: Kai-Heng Feng Signed-off-by: Basavaraj Natikar Signed-off-by: Akshata MukundShetty Link: https://lore.kernel.org/r/20230707065722.9036-3-Basavaraj.Natikar@amd.com Signed-off-by: Benjamin Tissoires commit c1685a862a4bea863537f06abaa37a123aef493c Author: Basavaraj Natikar Date: Fri Jul 7 12:27:21 2023 +0530 HID: amd_sfh: Rename the float32 variable As float32 is also used in other places as a data type, it is necessary to rename the float32 variable in order to avoid confusion. Cc: stable@vger.kernel.org Tested-by: Kai-Heng Feng Signed-off-by: Basavaraj Natikar Signed-off-by: Akshata MukundShetty Link: https://lore.kernel.org/r/20230707065722.9036-2-Basavaraj.Natikar@amd.com Signed-off-by: Benjamin Tissoires commit aff037078ecaecf34a7c2afab1341815f90fba5e Author: Suren Baghdasaryan Date: Thu Jun 29 17:56:12 2023 -0700 sched/psi: use kernfs polling functions for PSI trigger polling Destroying psi trigger in cgroup_file_release causes UAF issues when a cgroup is removed from under a polling process. This is happening because cgroup removal causes a call to cgroup_file_release while the actual file is still alive. Destroying the trigger at this point would also destroy its waitqueue head and if there is still a polling process on that file accessing the waitqueue, it will step on the freed pointer: do_select vfs_poll do_rmdir cgroup_rmdir kernfs_drain_open_files cgroup_file_release cgroup_pressure_release psi_trigger_destroy wake_up_pollfree(&t->event_wait) // vfs_poll is unblocked synchronize_rcu kfree(t) poll_freewait -> UAF access to the trigger's waitqueue head Patch [1] fixed this issue for epoll() case using wake_up_pollfree(), however the same issue exists for synchronous poll() case. The root cause of this issue is that the lifecycles of the psi trigger's waitqueue and of the file associated with the trigger are different. Fix this by using kernfs_generic_poll function when polling on cgroup-specific psi triggers. It internally uses kernfs_open_node->poll waitqueue head with its lifecycle tied to the file's lifecycle. This also renders the fix in [1] obsolete, so revert it. [1] commit c2dbe32d5db5 ("sched/psi: Fix use-after-free in ep_remove_wait_queue()") Fixes: 0e94682b73bf ("psi: introduce psi monitor") Closes: https://lore.kernel.org/all/20230613062306.101831-1-lujialin4@huawei.com/ Reported-by: Lu Jialin Signed-off-by: Suren Baghdasaryan Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230630005612.1014540-1-surenb@google.com commit ae2ad293d6be143ad223f5f947cca07bcbe42595 Author: Miaohe Lin Date: Tue Jun 20 16:07:47 2023 +0800 sched/fair: Use recent_used_cpu to test p->cpus_ptr When checking whether a recently used CPU can be a potential idle candidate, recent_used_cpu should be used to test p->cpus_ptr as p->recent_used_cpu is not equal to recent_used_cpu and candidate decision is made based on recent_used_cpu here. Fixes: 89aafd67f28c ("sched/fair: Use prev instead of new target as recent_used_cpu") Signed-off-by: Miaohe Lin Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Phil Auld Acked-by: Mel Gorman Link: https://lore.kernel.org/r/20230620080747.359122-1-linmiaohe@huawei.com commit 719a937b7003933de1298ffa4b881dd6a234e244 Author: Peter Zijlstra Date: Fri Jun 16 14:43:55 2023 +0200 iov_iter: Mark copy_iovec_from_user() noclone Extend commit 50f9a76ef127 ("iov_iter: Mark copy_compat_iovec_from_user() noinline") to also cover copy_iovec_from_user(). Different compiler versions cause the same problem on different functions. lib/iov_iter.o: warning: objtool: .altinstr_replacement+0x1f: redundant UACCESS disable lib/iov_iter.o: warning: objtool: iovec_from_user+0x84: call to copy_iovec_from_user.part.0() with UACCESS enabled lib/iov_iter.o: warning: objtool: __import_iovec+0x143: call to copy_iovec_from_user.part.0() with UACCESS enabled Fixes: 50f9a76ef127 ("iov_iter: Mark copy_compat_iovec_from_user() noinline") Signed-off-by: Peter Zijlstra (Intel) Tested-by: Borislav Petkov (AMD) Link: https://lkml.kernel.org/r/20230616124354.GD4253@hirez.programming.kicks-ass.net commit 9f71fbcde2820f2af4658313e808cf1e579190a4 Author: Michal Kubecek Date: Thu Jun 29 12:05:05 2023 +0200 objtool: initialize all of struct elf Function elf_open_read() only zero initializes the initial part of allocated struct elf; num_relocs member was recently added outside the zeroed part so that it was left uninitialized, resulting in build failures on some systems. The partial initialization is a relic of times when struct elf had large hash tables embedded. This is no longer the case so remove the trap and initialize the whole structure instead. Fixes: eb0481bbc4ce ("objtool: Fix reloc_hash size") Signed-off-by: Michal Kubecek Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20230629102051.42E8360467@lion.mk-sys.cz commit 04505bbbbb15da950ea0239e328a76a3ad2376e0 Author: Peter Zijlstra Date: Thu Jun 15 21:35:48 2023 +0200 x86/fineibt: Poison ENDBR at +0 Alyssa noticed that when building the kernel with CFI_CLANG+IBT and booting on IBT enabled hardware to obtain FineIBT, the indirect functions look like: __cfi_foo: endbr64 subl $hash, %r10d jz 1f ud2 nop 1: foo: endbr64 This is because the compiler generates code for kCFI+IBT. In that case the caller does the hash check and will jump to +0, so there must be an ENDBR there. The compiler doesn't know about FineIBT at all; also it is possible to actually use kCFI+IBT when booting with 'cfi=kcfi' on IBT enabled hardware. Having this second ENDBR however makes it possible to elide the CFI check. Therefore, we should poison this second ENDBR when switching to FineIBT mode. Fixes: 931ab63664f0 ("x86/ibt: Implement FineIBT") Reported-by: "Milburn, Alyssa" Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Reviewed-by: Sami Tolvanen Link: https://lore.kernel.org/r/20230615193722.194131053@infradead.org commit 3aec4ecb3d1f313a8ab985df7cab07c4af81f478 Author: Brian Gerst Date: Fri Jun 23 18:55:29 2023 -0400 x86: Rewrite ret_from_fork() in C When kCFI is enabled, special handling is needed for the indirect call to the kernel thread function. Rewrite the ret_from_fork() function in C so that the compiler can properly handle the indirect call. Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Brian Gerst Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Reviewed-by: Sami Tolvanen Link: https://lkml.kernel.org/r/20230623225529.34590-3-brgerst@gmail.com commit 81f755d561f365f544795fad92f05a085ea4f292 Author: Brian Gerst Date: Fri Jun 23 18:55:28 2023 -0400 x86/32: Remove schedule_tail_wrapper() The unwinder expects a return address at the very top of the kernel stack just below pt_regs and before any stack frame is created. Instead of calling a wrapper, set up a return address as if ret_from_fork() was called from the syscall entry code. Signed-off-by: Brian Gerst Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Reviewed-by: Sami Tolvanen Link: https://lkml.kernel.org/r/20230623225529.34590-2-brgerst@gmail.com commit 9831c6253ace48051189f6d18a15f658f94babc2 Author: Peter Zijlstra Date: Wed Jun 21 22:17:12 2023 +0200 x86/cfi: Extend ENDBR sealing to kCFI Kees noted that IBT sealing could be extended to kCFI. Fundamentally it is the list of functions that do not have their address taken and are thus never called indirectly. It doesn't matter that objtool uses IBT infrastructure to determine this list, once we have it it can also be used to clobber kCFI hashes and avoid kCFI indirect calls. Suggested-by: Kees Cook Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Reviewed-by: Sami Tolvanen Link: https://lkml.kernel.org/r/20230622144321.494426891%40infradead.org commit be0fffa5ca894a971a31c5e28aa77b633a97d1dc Author: Peter Zijlstra Date: Thu Jun 22 15:36:50 2023 +0200 x86/alternative: Rename apply_ibt_endbr() The current name doesn't reflect what it does very well. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Reviewed-by: Sami Tolvanen Link: https://lkml.kernel.org/r/20230622144321.427441595%40infradead.org commit 0479a42d4c15bd554f54d89d12bf68218e3e70da Author: Peter Zijlstra Date: Thu Jun 22 16:27:13 2023 +0200 x86/cfi: Extend {JMP,CAKK}_NOSPEC comment With the introduction of kCFI these helpers are no longer equivalent to C indirect calls and should be used with care. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Reviewed-by: Sami Tolvanen Link: https://lkml.kernel.org/r/20230622144321.360957723%40infradead.org commit 27c68c216ee1f1b086e789a64486e6511e380b8a Author: Namhyung Kim Date: Tue Jul 4 11:15:15 2023 -0700 perf/x86: Fix lockdep warning in for_each_sibling_event() on SPR On SPR, the load latency event needs an auxiliary event in the same group to work properly. There's a check in intel_pmu_hw_config() for this to iterate sibling events and find a mem-loads-aux event. The for_each_sibling_event() has a lockdep assert to make sure if it disabled hardirq or hold leader->ctx->mutex. This works well if the given event has a separate leader event since perf_try_init_event() grabs the leader->ctx->mutex to protect the sibling list. But it can cause a problem when the event itself is a leader since the event is not initialized yet and there's no ctx for the event. Actually I got a lockdep warning when I run the below command on SPR, but I guess it could be a NULL pointer dereference. $ perf record -d -e cpu/mem-loads/uP true The code path to the warning is: sys_perf_event_open() perf_event_alloc() perf_init_event() perf_try_init_event() x86_pmu_event_init() hsw_hw_config() intel_pmu_hw_config() for_each_sibling_event() lockdep_assert_event_ctx() We don't need for_each_sibling_event() when it's a standalone event. Let's return the error code directly. Fixes: f3c0eba28704 ("perf: Add a few assertions") Reported-by: Greg Thelen Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20230704181516.3293665-1-namhyung@kernel.org commit 9d0aba98316d00f9c0a4506fc15f5ed9241bc1fd Author: Junfeng Guo Date: Sat Jul 8 11:14:51 2023 +0800 gve: unify driver name usage Current codebase contained the usage of two different names for this driver (i.e., `gvnic` and `gve`), which is quite unfriendly for users to use, especially when trying to bind or unbind the driver manually. The corresponding kernel module is registered with the name of `gve`. It's more reasonable to align the name of the driver with the module. Fixes: 893ce44df565 ("gve: Add basic driver framework for Compute Engine Virtual NIC") Cc: csully@google.com Signed-off-by: Junfeng Guo Signed-off-by: David S. Miller commit 989b52cdc84955c2a35bc18f53e3a83edfa6f404 Author: Azeem Shaikh Date: Mon Jul 10 03:07:11 2023 +0000 net: sched: Replace strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since return value of -errno is used to check for truncation instead of sizeof(dest). [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Pavan Chebbi Signed-off-by: David S. Miller commit 87355b7c3da9bfd81935caba0ab763355147f7b0 Author: Jiasheng Jiang Date: Mon Jul 10 09:39:07 2023 +0800 net: dsa: qca8k: Add check for skb_copy Add check for the return value of skb_copy in order to avoid NULL pointer dereference. Fixes: 2cd548566384 ("net: dsa: qca8k: add support for phy read/write with mgmt Ethernet") Signed-off-by: Jiasheng Jiang Reviewed-by: Pavan Chebbi Signed-off-by: David S. Miller commit 35bc3efb3157cc5a9c3b5853591c4dcef40f6029 Author: Uwe Kleine-König Date: Fri Jul 7 09:50:58 2023 +0200 ALSA: pcmtest: Don't use static storage to track per device data While there is probably only ever a single instance of such a pcmtst device, it's still bad style to use a static variable to store per device data. Make use of platform_get_drvdata() and platform_set_drvdata() which fixes a data corruption if there should be two or more such devices (or this driver is used as a template for another driver). Signed-off-by: Uwe Kleine-König Acked-by: Ivan Orlov Link: https://lore.kernel.org/r/20230707075058.3402832-2-u.kleine-koenig@pengutronix.de Signed-off-by: Takashi Iwai commit cb2bffdea267efad8d03eb680890e5fa2e93411c Author: Uwe Kleine-König Date: Fri Jul 7 09:50:57 2023 +0200 ALSA: pcmtest: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Ivan Orlov Link: https://lore.kernel.org/r/20230707075058.3402832-1-u.kleine-koenig@pengutronix.de Signed-off-by: Takashi Iwai commit 798f1df86e5709b7b6aedf493cc04c7fedbf544a Author: Dmitry Baryshkov Date: Tue Jun 13 16:12:24 2023 +0300 arm64: dts: qcom: qrb5165-rb5: fix thermal zone conflict The commit 3a786086c6f8 ("arm64: dts: qcom: Add missing "-thermal" suffix for thermal zones") renamed the thermal zone in the pm8150l.dtsi file to comply with the schema. However this resulted in a clash with the RB5 board file, which already contained the pm8150l-thermal zone for the on-board sensor. This resulted in the board file definition overriding the thermal zone defined in the PMIC include file (and thus the on-die PMIC temp alarm was not probing at all). Rename the thermal zone in qcom/qrb5165-rb5.dts to remove this override. Fixes: 3a786086c6f8 ("arm64: dts: qcom: Add missing "-thermal" suffix for thermal zones") Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230613131224.666668-1-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 4d29db2043610dd70be00a61f26fd64256a2a6c5 Author: Krzysztof Kozlowski Date: Mon Jun 26 16:59:59 2023 +0200 arm64: dts: qcom: sm8350: fix BAM DMA crash and reboot SM8350 HDK and MTP boards were silently dying and rebooting during BAM DMA probe, probably during reading BAM_REVISION register: [ 1.574304] vreg_bob: Setting 3008000-3960000uV [ 1.576918] bam-dFormat: Log Type - Time(microsec) - Message - Optional Info Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic S - QC_IMAGE_VERSION_STRING=BOOT.MXF.1.0-00637.1-LAHAINA-1 S - IMAGE_VARIANT_STRING=SocLahainaLAA S - OEM_IMAGE_VERSION_STRING=crm-ubuntu77 S - Boot Interface: UFS It seems that BAM DMA is not yet operational, thus mark it as failed and disable also QCE because it won't work without BAM DMA. Fixes: f1040a7fe8f0 ("arm64: dts: qcom: sm8350: Add Crypto Engine support") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230626145959.646747-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 9ea2c3fba5c5b78a13bfc51d0999ff0be58baae8 Author: Krzysztof Kozlowski Date: Sat Jun 17 22:41:18 2023 +0200 arm64: dts: qcom: sc8180x: Fix OSM L3 compatible Since commit c70edc067739 ("dt-bindings: interconnect: Add sm8350, sc8280xp and generic OSM L3 compatibles") OSM L3 compatible should have generic fallback: sc8180x-primus.dtb: interconnect@18321000: compatible: 'oneOf' conditional failed, one must be fixed: Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230617204118.61959-3-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 6d526ee4bfe1b86af4d53bde20e1dbcdc1ee69f7 Author: Krzysztof Kozlowski Date: Sat Jun 17 22:41:17 2023 +0200 arm64: dts: qcom: sm8250: Fix EPSS L3 interconnect cells Qualcomm EPSS L3 Interconnect does not take path (third) argument. This was introduced by commit b5a12438325b ("arm64: dts: qcom: sm8250: Use 2 interconnect cells") which probably wanted to use 2 cells only for RPMh interconnects. sm8250-hdk.dtb: interconnect@18590000: #interconnect-cells:0:0: 1 was expected Fixes: b5a12438325b ("arm64: dts: qcom: sm8250: Use 2 interconnect cells") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230617204118.61959-2-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 8713c5e16698a5bda7f50e5c81799c419e0e2cb3 Author: Krzysztof Kozlowski Date: Sat Jun 17 22:41:16 2023 +0200 arm64: dts: qcom: sm8150: Fix OSM L3 interconnect cells Qualcomm Operating State Manager (OSM) L3 Interconnect does not take path (third) argument. This was introduced by commit 97c289026c62 ("arm64: dts: qcom: sm8150: Use 2 interconnect cells") which probably wanted to use 2 cells only for RPMh interconnects. sm8150-microsoft-surface-duo.dtb: interconnect@18321000: #interconnect-cells:0:0: 1 was expected Fixes: 97c289026c62 ("arm64: dts: qcom: sm8150: Use 2 interconnect cells") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230617204118.61959-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit cf53564b11cef5cdfafc548b172345c9aa753f89 Author: Aneesh Kumar K.V Date: Thu Jul 6 07:54:05 2023 +0530 powerpc/mm/book3s64/hash/4k: Add pmd_same callback for 4K page size With commit 0d940a9b270b ("mm/pgtable: allow pte_offset_map[_lock]() to fail") the kernel is now using pmd_same to compare pmd values that are pointing to a level 4 page table page. Move the functions out of #ifdef CONFIG_TRANSPARENT_HUGEPAGE and add a variant that can work with both 4K and 64K page size. kernel BUG at arch/powerpc/include/asm/book3s/64/hash-4k.h:141! Oops: Exception in kernel mode, sig: 5 [#1] LE PAGE_SIZE=4K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries ..... NIP [c00000000048aee0] __pte_offset_map_lock+0xf0/0x164 LR [c00000000048ae78] __pte_offset_map_lock+0x88/0x164 Call Trace: 0xc0003f000009a340 (unreliable) __handle_mm_fault+0x1340/0x1980 handle_mm_fault+0xbc/0x380 __get_user_pages+0x320/0x550 get_user_pages_remote+0x13c/0x520 get_arg_page+0x80/0x1d0 copy_string_kernel+0xc8/0x250 kernel_execve+0x11c/0x270 run_init_process+0xe4/0x10c kernel_init+0xbc/0x1a0 ret_from_kernel_user_thread+0x14/0x1c Reported-by: Michael Ellerman Signed-off-by: "Aneesh Kumar K.V" Acked-by: Hugh Dickins Signed-off-by: Michael Ellerman Link: https://msgid.link/20230706022405.798157-1-aneesh.kumar@linux.ibm.com commit cf65b12c17b4910d099d78f6ed6919ec040ecdbc Author: Michael Ellerman Date: Thu Jun 22 21:24:51 2023 +1000 powerpc/64e: Fix obtool warnings in exceptions-64e.S Since commit aec0ba7472a7 ("powerpc/64: Use -mprofile-kernel for big endian ELFv2 kernels"), this file is checked by objtool. Fix warnings such as: arch/powerpc/kernel/idle_64e.o: warning: objtool: .text+0x20: unannotated intra-function call arch/powerpc/kernel/exceptions-64e.o: warning: objtool: .text+0x218: unannotated intra-function call Signed-off-by: Michael Ellerman Link: https://msgid.link/20230622112451.735268-1-mpe@ellerman.id.au commit 5bcedc5931e7bd6928a2d8207078d4cb476b3b55 Author: Michael Ellerman Date: Wed May 17 17:49:45 2023 +1000 powerpc/security: Fix Speculation_Store_Bypass reporting on Power10 Nageswara reported that /proc/self/status was showing "vulnerable" for the Speculation_Store_Bypass feature on Power10, eg: $ grep Speculation_Store_Bypass: /proc/self/status Speculation_Store_Bypass: vulnerable But at the same time the sysfs files, and lscpu, were showing "Not affected". This turns out to simply be a bug in the reporting of the Speculation_Store_Bypass, aka. PR_SPEC_STORE_BYPASS, case. When SEC_FTR_STF_BARRIER was added, so that firmware could communicate the vulnerability was not present, the code in ssb_prctl_get() was not updated to check the new flag. So add the check for SEC_FTR_STF_BARRIER being disabled. Rather than adding the new check to the existing if block and expanding the comment to cover both cases, rewrite the three cases to be separate so they can be commented separately for clarity. Fixes: 84ed26fd00c5 ("powerpc/security: Add a security feature for STF barrier") Cc: stable@vger.kernel.org # v5.14+ Reported-by: Nageswara R Sastry Tested-by: Nageswara R Sastry Reviewed-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://msgid.link/20230517074945.53188-1-mpe@ellerman.id.au commit 8bbe9fee5848371d4af101be445303cac8d880c5 Author: Michael Ellerman Date: Wed May 17 22:30:33 2023 +1000 powerpc/64s: Fix native_hpte_remove() to be irq-safe Lockdep warns that the use of the hpte_lock in native_hpte_remove() is not safe against an IRQ coming in: ================================ WARNING: inconsistent lock state 6.4.0-rc2-g0c54f4d30ecc #1 Not tainted -------------------------------- inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. qemu-system-ppc/93865 [HC0[0]:SC0[0]:HE1:SE1] takes: c0000000021f5180 (hpte_lock){+.?.}-{0:0}, at: native_lock_hpte+0x8/0xd0 {IN-SOFTIRQ-W} state was registered at: lock_acquire+0x134/0x3f0 native_lock_hpte+0x44/0xd0 native_hpte_insert+0xd4/0x2a0 __hash_page_64K+0x218/0x4f0 hash_page_mm+0x464/0x840 do_hash_fault+0x11c/0x260 data_access_common_virt+0x210/0x220 __ip_select_ident+0x140/0x150 ... net_rx_action+0x3bc/0x440 __do_softirq+0x180/0x534 ... sys_sendmmsg+0x34/0x50 system_call_exception+0x128/0x320 system_call_common+0x160/0x2e4 ... Possible unsafe locking scenario: CPU0 ---- lock(hpte_lock); lock(hpte_lock); *** DEADLOCK *** ... Call Trace: dump_stack_lvl+0x98/0xe0 (unreliable) print_usage_bug.part.0+0x250/0x278 mark_lock+0xc9c/0xd30 __lock_acquire+0x440/0x1ca0 lock_acquire+0x134/0x3f0 native_lock_hpte+0x44/0xd0 native_hpte_remove+0xb0/0x190 kvmppc_mmu_map_page+0x650/0x698 [kvm_pr] kvmppc_handle_pagefault+0x534/0x6e8 [kvm_pr] kvmppc_handle_exit_pr+0x6d8/0xe90 [kvm_pr] after_sprg3_load+0x80/0x90 [kvm_pr] kvmppc_vcpu_run_pr+0x108/0x270 [kvm_pr] kvmppc_vcpu_run+0x34/0x48 [kvm] kvm_arch_vcpu_ioctl_run+0x340/0x470 [kvm] kvm_vcpu_ioctl+0x338/0x8b8 [kvm] sys_ioctl+0x7c4/0x13e0 system_call_exception+0x128/0x320 system_call_common+0x160/0x2e4 I suspect kvm_pr is the only caller that doesn't already have IRQs disabled, which is why this hasn't been reported previously. Fix it by disabling IRQs in native_hpte_remove(). Fixes: 35159b5717fa ("powerpc/64s: make HPTE lock and native_tlbie_lock irq-safe") Cc: stable@vger.kernel.org # v6.1+ Signed-off-by: Michael Ellerman Link: https://msgid.link/20230517123033.18430-1-mpe@ellerman.id.au commit c65b21f8aeac86768d387a86dfcbec5980480b6a Author: Rob Herring Date: Fri Jul 7 16:17:25 2023 -0600 ASoC: dt-bindings: audio-graph-card2: Drop incomplete example The example in audio-graph-card2 binding is incomplete, uses undocumented compatibles strings, and doesn't follow typical .dts formatting. Rather than try to fix with what would probably be a lengthy example, just drop the example. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230707221725.1071292-1-robh@kernel.org Signed-off-by: Mark Brown commit a1ff5802da3806e916de100130a7850b3f80c377 Author: Rohit kumar Date: Fri Jul 7 13:13:36 2023 +0530 ASoC: dt-bindings: Update maintainer email id Updated my mail id to latest quicinc id. Acked-by: Krzysztof Kozlowski Signed-off-by: Rohit kumar Link: https://lore.kernel.org/r/20230707074337.3120530-1-quic_rohkumar@quicinc.com Signed-off-by: Mark Brown commit cd710900ed2b96b1fbc26d711d562581afc385e2 Author: Mario Limonciello Date: Fri Jul 7 21:52:08 2023 -0500 ASoC: amd: ps: Fix extraneous error messages On Pink Sardine machines that don't have SdW controllers in use, the property `mipi-sdw-manager-list` won't exist. There is no point in showing an error to a user when this situation is encountered. Furthermore if the machine doesn't have a DMIC connected to the ACP, there may be no platform devices created either. Downgrade the associated message to debug. Fixes: d1351c30ac8a6 ("ASoC: amd: ps: create platform devices based on acp config") Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20230708025208.54272-1-mario.limonciello@amd.com Signed-off-by: Mark Brown commit 86867aca7330e4fbcfa2a117e20b48bbb6c758a9 Author: Fabio Estevam Date: Thu Jul 6 19:18:27 2023 -0300 ASoC: fsl_sai: Revert "ASoC: fsl_sai: Enable MCTL_MCLK_EN bit for master mode" This reverts commit ff87d619ac180444db297f043962a5c325ded47b. Andreas reports that on an i.MX8MP-based system where MCLK needs to be used as an input, the MCLK pin is actually an output, despite not having the 'fsl,sai-mclk-direction-output' property present in the devicetree. This is caused by commit ff87d619ac18 ("ASoC: fsl_sai: Enable MCTL_MCLK_EN bit for master mode") that sets FSL_SAI_MCTL_MCLK_EN unconditionally for imx8mm/8mn/8mp/93, causing the MCLK to always be configured as output. FSL_SAI_MCTL_MCLK_EN corresponds to the MOE (MCLK Output Enable) bit of register MCR and the drivers sets it when the 'fsl,sai-mclk-direction-output' devicetree property is present. Revert the commit to allow SAI to use MCLK as input as well. Cc: stable@vger.kernel.org Fixes: ff87d619ac18 ("ASoC: fsl_sai: Enable MCTL_MCLK_EN bit for master mode") Reported-by: Andreas Henriksson Signed-off-by: Fabio Estevam Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20230706221827.1938990-1-festevam@gmail.com Signed-off-by: Mark Brown commit 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 Author: Linus Torvalds Date: Sun Jul 9 13:53:13 2023 -0700 Linux 6.5-rc1 commit c192ac7357683f78c2e6d6e75adfcc29deb8c4ae Author: Linus Torvalds Date: Sun Jul 9 10:29:53 2023 -0700 MAINTAINERS 2: Electric Boogaloo We just sorted the entries and fields last release, so just out of a perverse sense of curiosity, I decided to see if we can keep things ordered for even just one release. The answer is "No. No we cannot". I suggest that all kernel developers will need weekly training sessions, involving a lot of Big Bird and Sesame Street. And at the yearly maintainer summit, we will all sing the alphabet song together. I doubt I will keep doing this. At some point "perverse sense of curiosity" turns into just a cold dark place filled with sadness and despair. Repeats: 80e62bc8487b ("MAINTAINERS: re-sort all entries and fields") Signed-off-by: Linus Torvalds commit f71f64210d698f603ab119740d1656f7bdfd3171 Merge: a9943ad3dddb0 8ac04063354a0 Author: Linus Torvalds Date: Sun Jul 9 10:24:22 2023 -0700 Merge tag 'dma-mapping-6.5-2023-07-09' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fixes from Christoph Hellwig: - swiotlb area sizing fixes (Petr Tesarik) * tag 'dma-mapping-6.5-2023-07-09' of git://git.infradead.org/users/hch/dma-mapping: swiotlb: reduce the number of areas to match actual memory pool size swiotlb: always set the number of areas before allocating the pool commit a9943ad3dddb04763e73649ade8ed726a17b5ec3 Merge: 51e3d7c27446c 67a4e1a3bf7c6 Author: Linus Torvalds Date: Sun Jul 9 10:16:04 2023 -0700 Merge tag 'irq_urgent_for_v6.5_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq update from Borislav Petkov: - Optimize IRQ domain's name assignment * tag 'irq_urgent_for_v6.5_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqdomain: Use return value of strreplace() commit 51e3d7c27446c3af97e8a467ecc99bc2936d885c Merge: e3da8db055318 fe3e0a13e597c Author: Linus Torvalds Date: Sun Jul 9 10:13:32 2023 -0700 Merge tag 'x86_urgent_for_v6.5_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fpu fix from Borislav Petkov: - Do FPU AP initialization on Xen PV too which got missed by the recent boot reordering work * tag 'x86_urgent_for_v6.5_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/xen: Fix secondary processors' FPU initialization commit e3da8db05531829cf64f922491be6f052acc5fba Merge: 74099e20348e8 b1472a60a5846 Author: Linus Torvalds Date: Sun Jul 9 10:08:38 2023 -0700 Merge tag 'x86-core-2023-07-09' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fix from Thomas Gleixner: "A single fix for the mechanism to park CPUs with an INIT IPI. On shutdown or kexec, the kernel tries to park the non-boot CPUs with an INIT IPI. But the same code path is also used by the crash utility. If the CPU which panics is not the boot CPU then it sends an INIT IPI to the boot CPU which resets the machine. Prevent this by validating that the CPU which runs the stop mechanism is the boot CPU. If not, leave the other CPUs in HLT" * tag 'x86-core-2023-07-09' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/smp: Don't send INIT to boot CPU commit 74099e20348e84e62b5ea6ef270f91db48bc1352 Merge: 76487845fd23b 3a6dbb691782e Author: Linus Torvalds Date: Sun Jul 9 10:02:49 2023 -0700 Merge tag 'mips_6.5_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fixes from Thomas Bogendoerfer: - fixes for KVM - fix for loongson build and cpu probing - DT fixes * tag 'mips_6.5_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: kvm: Fix build error with KVM_MIPS_DEBUG_COP0_COUNTERS enabled MIPS: dts: add missing space before { MIPS: Loongson: Fix build error when make modules_install MIPS: KVM: Fix NULL pointer dereference MIPS: Loongson: Fix cpu_probe_loongson() again commit 76487845fd23bc2346244fbf7c1a6eb1ed845d28 Merge: 4770353b660ab ed04a91f718e6 Author: Linus Torvalds Date: Sun Jul 9 09:50:42 2023 -0700 Merge tag 'xfs-6.5-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fix from Darrick Wong: "Nothing exciting here, just getting rid of a gcc warning that I got tired of seeing when I turn on gcov" * tag 'xfs-6.5-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: fix uninit warning in xfs_growfs_data commit 4770353b660abc8b1a5d2afc233b6061d48e7d80 Merge: cff0687396887 d14de8067e3f9 Author: Linus Torvalds Date: Sun Jul 9 09:45:32 2023 -0700 Merge tag '6.5-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 Pull more smb client updates from Steve French: - fix potential use after free in unmount - minor cleanup - add worker to cleanup stale directory leases * tag '6.5-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6: cifs: Add a laundromat thread for cached directories smb: client: remove redundant pointer 'server' cifs: fix session state transition to avoid use-after-free issue commit cff068739688791cf7a8f427b7ca6230d798914a Merge: 1c7873e336457 bff6efc54bd0e Author: Linus Torvalds Date: Sun Jul 9 09:35:51 2023 -0700 Merge tag 'ntb-6.5' of https://github.com/jonmason/ntb Pull NTB updates from Jon Mason: "Fixes for pci_clean_master, error handling in driver inits, and various other issues/bugs" * tag 'ntb-6.5' of https://github.com/jonmason/ntb: ntb: hw: amd: Fix debugfs_create_dir error checking ntb.rst: Fix copy and paste error ntb_netdev: Fix module_init problem ntb: intel: Remove redundant pci_clear_master ntb: epf: Remove redundant pci_clear_master ntb_hw_amd: Remove redundant pci_clear_master ntb: idt: drop redundant pci_enable_pcie_error_reporting() MAINTAINERS: git://github -> https://github.com for jonmason NTB: EPF: fix possible memory leak in pci_vntb_probe() NTB: ntb_tool: Add check for devm_kcalloc NTB: ntb_transport: fix possible memory leak while device_register() fails ntb: intel: Fix error handling in intel_ntb_pci_driver_init() NTB: amd: Fix error handling in amd_ntb_pci_driver_init() ntb: idt: Fix error handling in idt_pci_driver_init() commit e3ea6467f623b80906ff0c93b58755ab903ce12f Author: Dmitry Torokhov Date: Tue Jun 27 15:09:01 2023 -0700 HID: input: fix mapping for camera access keys Commit 9f4211bf7f81 ("HID: add mapping for camera access keys") added mapping for the camera access keys, but unfortunately used wrong usage codes for them. HUTRR72[1] specifies that camera access controls use 0x76, 0x077 and 0x78 usages in the consumer control page. Previously mapped 0xd5, 0xd6 and 0xd7 usages are actually defined in HUTRR64[2] as game recording controls. [1] https://www.usb.org/sites/default/files/hutrr72_-_usages_to_control_camera_access_0.pdf [2] https://www.usb.org/sites/default/files/hutrr64b_-_game_recording_controllers_0.pdf Fixes: 9f4211bf7f81 ("HID: add mapping for camera access keys") Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Link: https://lore.kernel.org/r/ZJtd/fMXRUgq20TW@google.com Signed-off-by: Benjamin Tissoires commit a343a7682acc56182d4b54777c358f5ec6d274e7 Author: Stuart Hayhurst Date: Fri Jun 30 12:38:20 2023 +0100 HID: logitech-hidpp: Add wired USB id for Logitech G502 Lightspeed Previously, support for the G502 had been attempted in commit '27fc32fd9417 ("HID: logitech-hidpp: add USB PID for a few more supported mice")' This caused some issues and was reverted by 'addf3382c47c ("Revert "HID: logitech-hidpp: add USB PID for a few more supported mice"")'. Since then, a new version of this mouse has been released (Lightpseed Wireless), and works correctly. This device has support for battery reporting with the driver Signed-off-by: Stuart Hayhurst Reviewed-by: Bastien Nocera Link: https://lore.kernel.org/r/20230630113818.13005-1-stuart.a.hayhurst@gmail.com Signed-off-by: Benjamin Tissoires commit 8bcf314b92ed923019206e0dbf198980f15a70e0 Author: Rahul Rameshbabu Date: Tue Jul 4 23:04:14 2023 -0700 HID: nvidia-shield: Pack inner/related declarations in HOSTCMD reports Match alignment information in composite type declarations used by packed HOSTCMD report structures. Compiler packing attribute is not recursive for inner declarations. Mismatched alignment information can cause undefined behavior in code generated for accessing composite type members. struct pointers passed to thunderstrike_parse_board_info_payload and thunderstrike_parse_haptics_payload are an example of this being potentially problematic since alignment information from the packed HOSTCMD report is lost. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307041500.6bKn7nCl-lkp@intel.com/ Link: https://github.com/llvm/llvm-project/issues/55520#issuecomment-1128617570 Link: https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Common-Type-Attributes.html#index-packed-type-attribute Signed-off-by: Rahul Rameshbabu Link: https://lore.kernel.org/r/20230705060414.581468-1-rrameshbabu@nvidia.com Signed-off-by: Benjamin Tissoires commit 5f151364b1da6bd217632fd4ee8cc24eaf66a497 Author: Arnd Bergmann Date: Wed Jul 5 16:02:24 2023 +0200 HID: hyperv: avoid struct memcpy overrun warning A previous patch addressed the fortified memcpy warning for most builds, but I still see this one with gcc-9: In file included from include/linux/string.h:254, from drivers/hid/hid-hyperv.c:8: In function 'fortify_memcpy_chk', inlined from 'mousevsc_on_receive' at drivers/hid/hid-hyperv.c:272:3: include/linux/fortify-string.h:583:4: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 583 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ My guess is that the WARN_ON() itself is what confuses gcc, so it no longer sees that there is a correct range check. Rework the code in a way that helps readability and avoids the warning. Fixes: 542f25a94471 ("HID: hyperv: Replace one-element array with flexible-array member") Signed-off-by: Arnd Bergmann Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20230705140242.844167-1-arnd@kernel.org Signed-off-by: Benjamin Tissoires commit 73c4d1b307aeb713e80ab03f90c7df9d417dc0f0 Author: Simon Horman Date: Sat Jul 8 15:06:25 2023 +0100 net: lan743x: select FIXED_PHY The blamed commit introduces usage of fixed_phy_register() but not a corresponding dependency on FIXED_PHY. This can result in a build failure. s390-linux-ld: drivers/net/ethernet/microchip/lan743x_main.o: in function `lan743x_phy_open': drivers/net/ethernet/microchip/lan743x_main.c:1514: undefined reference to `fixed_phy_register' Fixes: 624864fbff92 ("net: lan743x: add fixed phy support for LAN7431 device") Cc: stable@vger.kernel.org Reported-by: Randy Dunlap Closes: https://lore.kernel.org/netdev/725bf1c5-b252-7d19-7582-a6809716c7d6@infradead.org/ Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 06a0716949c22e2aefb648526580671197151acc Author: Ziyang Xuan Date: Sat Jul 8 14:59:10 2023 +0800 ipv6/addrconf: fix a potential refcount underflow for idev Now in addrconf_mod_rs_timer(), reference idev depends on whether rs_timer is not pending. Then modify rs_timer timeout. There is a time gap in [1], during which if the pending rs_timer becomes not pending. It will miss to hold idev, but the rs_timer is activated. Thus rs_timer callback function addrconf_rs_timer() will be executed and put idev later without holding idev. A refcount underflow issue for idev can be caused by this. if (!timer_pending(&idev->rs_timer)) in6_dev_hold(idev); <--------------[1] mod_timer(&idev->rs_timer, jiffies + when); To fix the issue, hold idev if mod_timer() return 0. Fixes: b7b1bfce0bb6 ("ipv6: split duplicate address detection and router solicitation timer") Suggested-by: Eric Dumazet Signed-off-by: Ziyang Xuan Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit f9abdcc617dad5f14bbc2ebe96ee99f3e6de0c4e Author: Benjamin Tissoires Date: Sun Jul 9 12:06:56 2023 +0200 selftests: hid: fix vmtests.sh not running make headers According to commit 01d6c48a828b ("Documentation: kselftest: "make headers" is a prerequisite"), running the kselftests requires to run "make headers" first. Do that in "vmtest.sh" as well to fix the HID CI. Link: https://lore.kernel.org/r/20230709-fix-selftests-v1-1-57d0878114cc@kernel.org Signed-off-by: Benjamin Tissoires commit 1c7873e3364570ec89343ff4877e0f27a7b21a61 Author: Hugh Dickins Date: Sat Jul 8 16:04:00 2023 -0700 mm: lock newly mapped VMA with corrected ordering Lockdep is certainly right to complain about (&vma->vm_lock->lock){++++}-{3:3}, at: vma_start_write+0x2d/0x3f but task is already holding lock: (&mapping->i_mmap_rwsem){+.+.}-{3:3}, at: mmap_region+0x4dc/0x6db Invert those to the usual ordering. Fixes: 33313a747e81 ("mm: lock newly mapped VMA which can be modified after it becomes visible") Cc: stable@vger.kernel.org Signed-off-by: Hugh Dickins Tested-by: Suren Baghdasaryan Signed-off-by: Linus Torvalds commit 946c6b59c56dc6e7d8364a8959cb36bf6d10bc37 Merge: fb49c455323ff 8ba388c06bc80 Author: Linus Torvalds Date: Sat Jul 8 14:30:25 2023 -0700 Merge tag 'mm-hotfixes-stable-2023-07-08-10-43' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull hotfixes from Andrew Morton: "16 hotfixes. Six are cc:stable and the remainder address post-6.4 issues" The merge undoes the disabling of the CONFIG_PER_VMA_LOCK feature, since it was all hopefully fixed in mainline. * tag 'mm-hotfixes-stable-2023-07-08-10-43' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: lib: dhry: fix sleeping allocations inside non-preemptable section kasan, slub: fix HW_TAGS zeroing with slub_debug kasan: fix type cast in memory_is_poisoned_n mailmap: add entries for Heiko Stuebner mailmap: update manpage link bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page MAINTAINERS: add linux-next info mailmap: add Markus Schneider-Pargmann writeback: account the number of pages written back mm: call arch_swap_restore() from do_swap_page() squashfs: fix cache race with migration mm/hugetlb.c: fix a bug within a BUG(): inconsistent pte comparison docs: update ocfs2-devel mailing list address MAINTAINERS: update ocfs2-devel mailing list address mm: disable CONFIG_PER_VMA_LOCK until its fixed fork: lock VMAs of the parent process when forking commit fb49c455323ff8319a123dd312be9082c49a23a5 Author: Suren Baghdasaryan Date: Sat Jul 8 12:12:12 2023 -0700 fork: lock VMAs of the parent process when forking When forking a child process, the parent write-protects anonymous pages and COW-shares them with the child being forked using copy_present_pte(). We must not take any concurrent page faults on the source vma's as they are being processed, as we expect both the vma and the pte's behind it to be stable. For example, the anon_vma_fork() expects the parents vma->anon_vma to not change during the vma copy. A concurrent page fault on a page newly marked read-only by the page copy might trigger wp_page_copy() and a anon_vma_prepare(vma) on the source vma, defeating the anon_vma_clone() that wasn't done because the parent vma originally didn't have an anon_vma, but we now might end up copying a pte entry for a page that has one. Before the per-vma lock based changes, the mmap_lock guaranteed exclusion with concurrent page faults. But now we need to do a vma_start_write() to make sure no concurrent faults happen on this vma while it is being processed. This fix can potentially regress some fork-heavy workloads. Kernel build time did not show noticeable regression on a 56-core machine while a stress test mapping 10000 VMAs and forking 5000 times in a tight loop shows ~5% regression. If such fork time regression is unacceptable, disabling CONFIG_PER_VMA_LOCK should restore its performance. Further optimizations are possible if this regression proves to be problematic. Suggested-by: David Hildenbrand Reported-by: Jiri Slaby Closes: https://lore.kernel.org/all/dbdef34c-3a07-5951-e1ae-e9c6e3cdf51b@kernel.org/ Reported-by: Holger Hoffstätte Closes: https://lore.kernel.org/all/b198d649-f4bf-b971-31d0-e8433ec2a34c@applied-asynchrony.com/ Reported-by: Jacob Young Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217624 Fixes: 0bff0aaea03e ("x86/mm: try VMA lock-based page fault handling first") Cc: stable@vger.kernel.org Signed-off-by: Suren Baghdasaryan Signed-off-by: Linus Torvalds commit 33313a747e81af9f31d0d45de78c9397fa3655eb Author: Suren Baghdasaryan Date: Sat Jul 8 12:12:11 2023 -0700 mm: lock newly mapped VMA which can be modified after it becomes visible mmap_region adds a newly created VMA into VMA tree and might modify it afterwards before dropping the mmap_lock. This poses a problem for page faults handled under per-VMA locks because they don't take the mmap_lock and can stumble on this VMA while it's still being modified. Currently this does not pose a problem since post-addition modifications are done only for file-backed VMAs, which are not handled under per-VMA lock. However, once support for handling file-backed page faults with per-VMA locks is added, this will become a race. Fix this by write-locking the VMA before inserting it into the VMA tree. Other places where a new VMA is added into VMA tree do not modify it after the insertion, so do not need the same locking. Cc: stable@vger.kernel.org Signed-off-by: Suren Baghdasaryan Signed-off-by: Linus Torvalds commit c137381f71aec755fbf47cd4e9bd4dce752c054c Author: Suren Baghdasaryan Date: Sat Jul 8 12:12:10 2023 -0700 mm: lock a vma before stack expansion With recent changes necessitating mmap_lock to be held for write while expanding a stack, per-VMA locks should follow the same rules and be write-locked to prevent page faults into the VMA being expanded. Add the necessary locking. Cc: stable@vger.kernel.org Signed-off-by: Suren Baghdasaryan Signed-off-by: Linus Torvalds commit 7fcd473a6455450428795d20db7afd2691c92336 Merge: 84dc5aa3f0d86 24033d71cc36a Author: Linus Torvalds Date: Sat Jul 8 12:35:18 2023 -0700 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull more SCSI updates from James Bottomley: "A few late arriving patches that missed the initial pull request. It's mostly bug fixes (the dt-bindings is a fix for the initial pull)" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: core: Remove unused function declaration scsi: target: docs: Remove tcm_mod_builder.py scsi: target: iblock: Quiet bool conversion warning with pr_preempt use scsi: dt-bindings: ufs: qcom: Fix ICE phandle scsi: core: Simplify scsi_cdl_check_cmd() scsi: isci: Fix comment typo scsi: smartpqi: Replace one-element arrays with flexible-array members scsi: target: tcmu: Replace strlcpy() with strscpy() scsi: ncr53c8xx: Replace strlcpy() with strscpy() scsi: lpfc: Fix lpfc_name struct packing commit 84dc5aa3f0d861281d353e4b7f4ea03da31e9aba Merge: 8fc3b8f082cc2 6537ed3904a3b Author: Linus Torvalds Date: Sat Jul 8 12:28:00 2023 -0700 Merge tag 'i2c-for-6.5-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull more i2c updates from Wolfram Sang: - xiic patch should have been in the original pull but slipped through - mpc patch fixes a build regression - nomadik cleanup * tag 'i2c-for-6.5-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: mpc: Drop unused variable i2c: nomadik: Remove a useless call in the remove function i2c: xiic: Don't try to handle more interrupt events after error commit 8fc3b8f082cc2f5faa6eae315b938bc5e79c332e Merge: c206353dfdf02 01f23c5f1526f Author: Linus Torvalds Date: Sat Jul 8 12:08:39 2023 -0700 Merge tag 'hardening-v6.5-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening fixes from Kees Cook: - Check for NULL bdev in LoadPin (Matthias Kaehlcke) - Revert unwanted KUnit FORTIFY build default - Fix 1-element array causing boot warnings with xhci-hub * tag 'hardening-v6.5-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: usb: ch9: Replace bmSublinkSpeedAttr 1-element array with flexible array Revert "fortify: Allow KUnit test to build without FORTIFY" dm: verity-loadpin: Add NULL pointer check for 'bdev' parameter commit bff6efc54bd0e27a332eb733525d7f698fd4a5b7 Author: Anup Sharma Date: Sat May 13 01:54:34 2023 +0530 ntb: hw: amd: Fix debugfs_create_dir error checking The debugfs_create_dir function returns ERR_PTR in case of error, and the only correct way to check if an error occurred is 'IS_ERR' inline function. This patch will replace the null-comparison with IS_ERR. Signed-off-by: Anup Sharma Suggested-by: Ivan Orlov Signed-off-by: Jon Mason commit c206353dfdf026dafd42679cf82d6f0a89781e36 Merge: ad8258e87729e bcd981db12e6d Author: Linus Torvalds Date: Sat Jul 8 10:21:51 2023 -0700 Merge tag 'perf-tools-for-v6.5-2-2023-07-06' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next Pull more perf tools updates from Namhyung Kim: "These are remaining changes and fixes for this cycle. Build: - Allow generating vmlinux.h from BTF using `make GEN_VMLINUX_H=1` and skip if the vmlinux has no BTF. - Replace deprecated clang -target xxx option by --target=xxx. perf record: - Print event attributes with well known type and config symbols in the debug output like below: # perf record -e cycles,cpu-clock -C0 -vv true ------------------------------------------------------------ perf_event_attr: type 0 (PERF_TYPE_HARDWARE) size 136 config 0 (PERF_COUNT_HW_CPU_CYCLES) { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 5 ------------------------------------------------------------ perf_event_attr: type 1 (PERF_TYPE_SOFTWARE) size 136 config 0 (PERF_COUNT_SW_CPU_CLOCK) { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 - Update AMD IBS event error message since it now support per-process profiling but no priviledge filters. $ sudo perf record -e ibs_op//k -C 0 Error: AMD IBS doesn't support privilege filtering. Try again without the privilege modifiers (like 'k') at the end. perf lock contention: - Support CSV style output using -x option $ sudo perf lock con -ab -x, sleep 1 # output: contended, total wait, max wait, avg wait, type, caller 19, 194232, 21415, 10222, spinlock, process_one_work+0x1f0 15, 162748, 23843, 10849, rwsem:R, do_user_addr_fault+0x40e 4, 86740, 23415, 21685, rwlock:R, ep_poll_callback+0x2d 1, 84281, 84281, 84281, mutex, iwl_mvm_async_handlers_wk+0x135 8, 67608, 27404, 8451, spinlock, __queue_work+0x174 3, 58616, 31125, 19538, rwsem:W, do_mprotect_pkey+0xff 3, 52953, 21172, 17651, rwlock:W, do_epoll_wait+0x248 2, 30324, 19704, 15162, rwsem:R, do_madvise+0x3ad 1, 24619, 24619, 24619, spinlock, rcu_core+0xd4 - Add --output option to save the data to a file not to be interfered by other debug messages. Test: - Fix event parsing test on ARM where there's no raw PMU nor supports PERF_PMU_CAP_EXTENDED_HW_TYPE. - Update the lock contention test case for CSV output. - Fix a segfault in the daemon command test. Vendor events (JSON): - Add has_event() to check if the given event is available on system at runtime. On Intel machines, some transaction events may not be present when TSC extensions are disabled. - Update Intel event metrics. Misc: - Sort symbols by name using an external array of pointers instead of a rbtree node in the symbol. This will save 16-bytes or 24-bytes per symbol whether the sorting is actually requested or not. - Fix unwinding DWARF callstacks using libdw when --symfs option is used" * tag 'perf-tools-for-v6.5-2-2023-07-06' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next: (38 commits) perf test: Fix event parsing test when PERF_PMU_CAP_EXTENDED_HW_TYPE isn't supported. perf test: Fix event parsing test on Arm perf evsel amd: Fix IBS error message perf: unwind: Fix symfs with libdw perf symbol: Fix uninitialized return value in symbols__find_by_name() perf test: Test perf lock contention CSV output perf lock contention: Add --output option perf lock contention: Add -x option for CSV style output perf lock: Remove stale comments perf vendor events intel: Update tigerlake to 1.13 perf vendor events intel: Update skylakex to 1.31 perf vendor events intel: Update skylake to 57 perf vendor events intel: Update sapphirerapids to 1.14 perf vendor events intel: Update icelakex to 1.21 perf vendor events intel: Update icelake to 1.19 perf vendor events intel: Update cascadelakex to 1.19 perf vendor events intel: Update meteorlake to 1.03 perf vendor events intel: Add rocketlake events/metrics perf vendor metrics intel: Make transaction metrics conditional perf jevents: Support for has_event function ... commit ad8258e87729e4337569c4b7d30cfdd4b299179d Merge: 8689f4f2ea561 2a3110e3f97dd Author: Linus Torvalds Date: Sat Jul 8 10:02:24 2023 -0700 Merge tag 'bitmap-6.5-rc1' of https://github.com/norov/linux Pull bitmap updates from Yury Norov: "Fixes for different bitmap pieces: - lib/test_bitmap: increment failure counter properly The tests that don't use expect_eq() macro to determine that a test is failured must increment failed_tests explicitly. - lib/bitmap: drop optimization of bitmap_{from,to}_arr64 bitmap_{from,to}_arr64() optimization is overly optimistic on 32-bit LE architectures when it's wired to bitmap_copy_clear_tail(). - nodemask: Drop duplicate check in for_each_node_mask() As the return value type of first_node() became unsigned, the node >= 0 became unnecessary. - cpumask: fix function description kernel-doc notation - MAINTAINERS: Add bits.h and bitfield.h to the BITMAP API record Add linux/bits.h and linux/bitfield.h for visibility" * tag 'bitmap-6.5-rc1' of https://github.com/norov/linux: MAINTAINERS: Add bitfield.h to the BITMAP API record MAINTAINERS: Add bits.h to the BITMAP API record cpumask: fix function description kernel-doc notation nodemask: Drop duplicate check in for_each_node_mask() lib/bitmap: drop optimization of bitmap_{from,to}_arr64 lib/test_bitmap: increment failure counter properly commit 8ba388c06bc8056935ec1814b2689bfb42f3b89a Author: Geert Uytterhoeven Date: Wed Jul 5 16:54:04 2023 +0200 lib: dhry: fix sleeping allocations inside non-preemptable section The Smatch static checker reports the following warnings: lib/dhry_run.c:38 dhry_benchmark() warn: sleeping in atomic context lib/dhry_run.c:43 dhry_benchmark() warn: sleeping in atomic context Indeed, dhry() does sleeping allocations inside the non-preemptable section delimited by get_cpu()/put_cpu(). Fix this by using atomic allocations instead. Add error handling, as atomic these allocations may fail. Link: https://lkml.kernel.org/r/bac6d517818a7cd8efe217c1ad649fffab9cc371.1688568764.git.geert+renesas@glider.be Fixes: 13684e966d46283e ("lib: dhry: fix unstable smp_processor_id(_) usage") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/0469eb3a-02eb-4b41-b189-de20b931fa56@moroto.mountain Signed-off-by: Geert Uytterhoeven Signed-off-by: Andrew Morton commit fdb54d96600aafe45951f549866cd6fc1af59954 Author: Andrey Konovalov Date: Wed Jul 5 14:44:02 2023 +0200 kasan, slub: fix HW_TAGS zeroing with slub_debug Commit 946fa0dbf2d8 ("mm/slub: extend redzone check to extra allocated kmalloc space than requested") added precise kmalloc redzone poisoning to the slub_debug functionality. However, this commit didn't account for HW_TAGS KASAN fully initializing the object via its built-in memory initialization feature. Even though HW_TAGS KASAN memory initialization contains special memory initialization handling for when slub_debug is enabled, it does not account for in-object slub_debug redzones. As a result, HW_TAGS KASAN can overwrite these redzones and cause false-positive slub_debug reports. To fix the issue, avoid HW_TAGS KASAN memory initialization when slub_debug is enabled altogether. Implement this by moving the __slub_debug_enabled check to slab_post_alloc_hook. Common slab code seems like a more appropriate place for a slub_debug check anyway. Link: https://lkml.kernel.org/r/678ac92ab790dba9198f9ca14f405651b97c8502.1688561016.git.andreyknvl@google.com Fixes: 946fa0dbf2d8 ("mm/slub: extend redzone check to extra allocated kmalloc space than requested") Signed-off-by: Andrey Konovalov Reported-by: Will Deacon Acked-by: Marco Elver Cc: Mark Rutland Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Feng Tang Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Joonsoo Kim Cc: kasan-dev@googlegroups.com Cc: Pekka Enberg Cc: Peter Collingbourne Cc: Roman Gushchin Cc: Vincenzo Frascino Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton commit 05c56e7b4319d7f6352f27da876a1acdc8fa5cc4 Author: Andrey Konovalov Date: Tue Jul 4 02:52:05 2023 +0200 kasan: fix type cast in memory_is_poisoned_n Commit bb6e04a173f0 ("kasan: use internal prototypes matching gcc-13 builtins") introduced a bug into the memory_is_poisoned_n implementation: it effectively removed the cast to a signed integer type after applying KASAN_GRANULE_MASK. As a result, KASAN started failing to properly check memset, memcpy, and other similar functions. Fix the bug by adding the cast back (through an additional signed integer variable to make the code more readable). Link: https://lkml.kernel.org/r/8c9e0251c2b8b81016255709d4ec42942dcaf018.1688431866.git.andreyknvl@google.com Fixes: bb6e04a173f0 ("kasan: use internal prototypes matching gcc-13 builtins") Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Arnd Bergmann Cc: Dmitry Vyukov Cc: Marco Elver Cc: Signed-off-by: Andrew Morton commit d3a808ec787e8cbfee053405f95105b3be3c7743 Author: Heiko Stuebner Date: Tue Jul 4 18:39:19 2023 +0200 mailmap: add entries for Heiko Stuebner I am going to lose my vrull.eu address at the end of july, and while adding it to mailmap I also realised that there are more old addresses from me dangling, so update .mailmap for all of them. Link: https://lkml.kernel.org/r/20230704163919.1136784-3-heiko@sntech.de Signed-off-by: Heiko Stuebner Signed-off-by: Heiko Stuebner Signed-off-by: Andrew Morton commit ddcd91f4cb42fcc833b0a5e00d4e9f034da95249 Author: Heiko Stuebner Date: Tue Jul 4 18:39:18 2023 +0200 mailmap: update manpage link Patch series "Update .mailmap for my work address and fix manpage". While updating mailmap for the going-away address, I also found that on current systems the manpage linked from the header comment changed. And in fact it looks like the git mailmap feature got its own manpage. This patch (of 2): On recent systems the git-shortlog manpage only tells people to See gitmailmap(5) So instead of sending people on a scavenger hunt, put that info into the header directly. Though keep the old reference around for older systems. Link: https://lkml.kernel.org/r/20230704163919.1136784-1-heiko@sntech.de Link: https://lkml.kernel.org/r/20230704163919.1136784-2-heiko@sntech.de Signed-off-by: Heiko Stuebner Signed-off-by: Andrew Morton commit 028725e73375a1ff080bbdf9fb503306d0116f28 Author: Liu Shixin Date: Tue Jul 4 18:19:42 2023 +0800 bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page commit dd0ff4d12dd2 ("bootmem: remove the vmemmap pages from kmemleak in put_page_bootmem") fix an overlaps existing problem of kmemleak. But the problem still existed when HAVE_BOOTMEM_INFO_NODE is disabled, because in this case, free_bootmem_page() will call free_reserved_page() directly. Fix the problem by adding kmemleak_free_part() in free_bootmem_page() when HAVE_BOOTMEM_INFO_NODE is disabled. Link: https://lkml.kernel.org/r/20230704101942.2819426-1-liushixin2@huawei.com Fixes: f41f2ed43ca5 ("mm: hugetlb: free the vmemmap pages associated with each HugeTLB page") Signed-off-by: Liu Shixin Acked-by: Muchun Song Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton commit 0d707cdefb3b7f52d23967e1473d24d591329e13 Author: Randy Dunlap Date: Mon Jul 3 22:44:10 2023 -0700 MAINTAINERS: add linux-next info Add linux-next info to MAINTAINERS for ease of finding this data. Link: https://lkml.kernel.org/r/20230704054410.12527-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Acked-by: Stephen Rothwell Signed-off-by: Andrew Morton commit 6dedd768f380a6977234891fc3c7e0df656f1908 Author: Markus Schneider-Pargmann Date: Wed Jun 28 10:13:41 2023 +0200 mailmap: add Markus Schneider-Pargmann Add my old mail address and update my name. Link: https://lkml.kernel.org/r/20230628081341.3470229-1-msp@baylibre.com Signed-off-by: Markus Schneider-Pargmann Signed-off-by: Andrew Morton commit 8344a3d44be3d18671e18c4ba23bb03dd21e14ad Author: Matthew Wilcox (Oracle) Date: Wed Jun 28 19:55:48 2023 +0100 writeback: account the number of pages written back nr_to_write is a count of pages, so we need to decrease it by the number of pages in the folio we just wrote, not by 1. Most callers specify either LONG_MAX or 1, so are unaffected, but writeback_sb_inodes() might end up writing 512x as many pages as it asked for. Dave added: : XFS is the only filesystem this would affect, right? AFAIA, nothing : else enables large folios and uses writeback through : write_cache_pages() at this point... : : In which case, I'd be surprised if much difference, if any, gets : noticed by anyone. Link: https://lkml.kernel.org/r/20230628185548.981888-1-willy@infradead.org Fixes: 793917d997df ("mm/readahead: Add large folio readahead") Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Cc: Jan Kara Cc: Dave Chinner Signed-off-by: Andrew Morton commit 6dca4ac6fc91fd41ea4d6c4511838d37f4e0eab2 Author: Peter Collingbourne Date: Mon May 22 17:43:08 2023 -0700 mm: call arch_swap_restore() from do_swap_page() Commit c145e0b47c77 ("mm: streamline COW logic in do_swap_page()") moved the call to swap_free() before the call to set_pte_at(), which meant that the MTE tags could end up being freed before set_pte_at() had a chance to restore them. Fix it by adding a call to the arch_swap_restore() hook before the call to swap_free(). Link: https://lkml.kernel.org/r/20230523004312.1807357-2-pcc@google.com Link: https://linux-review.googlesource.com/id/I6470efa669e8bd2f841049b8c61020c510678965 Fixes: c145e0b47c77 ("mm: streamline COW logic in do_swap_page()") Signed-off-by: Peter Collingbourne Reported-by: Qun-wei Lin Closes: https://lore.kernel.org/all/5050805753ac469e8d727c797c2218a9d780d434.camel@mediatek.com/ Acked-by: David Hildenbrand Acked-by: "Huang, Ying" Reviewed-by: Steven Price Acked-by: Catalin Marinas Cc: [6.1+] Signed-off-by: Andrew Morton commit 08bab74ae653b57bb2bfcec7d499bfe7ff0efe4f Author: Vincent Whitchurch Date: Thu Jun 29 16:17:57 2023 +0200 squashfs: fix cache race with migration Migration replaces the page in the mapping before copying the contents and the flags over from the old page, so check that the page in the page cache is really up to date before using it. Without this, stressing squashfs reads with parallel compaction sometimes results in squashfs reporting data corruption. Link: https://lkml.kernel.org/r/20230629-squashfs-cache-migration-v1-1-d50ebe55099d@axis.com Fixes: e994f5b677ee ("squashfs: cache partial compressed blocks") Signed-off-by: Vincent Whitchurch Cc: Christoph Hellwig Cc: Phillip Lougher Signed-off-by: Andrew Morton commit 191fcdb6c9cf8b738b1628cbcf3af63d545c825c Author: John Hubbard Date: Fri Jun 30 18:04:42 2023 -0700 mm/hugetlb.c: fix a bug within a BUG(): inconsistent pte comparison The following crash happens for me when running the -mm selftests (below). Specifically, it happens while running the uffd-stress subtests: kernel BUG at mm/hugetlb.c:7249! invalid opcode: 0000 [#1] PREEMPT SMP NOPTI CPU: 0 PID: 3238 Comm: uffd-stress Not tainted 6.4.0-hubbard-github+ #109 Hardware name: ASUS X299-A/PRIME X299-A, BIOS 1503 08/03/2018 RIP: 0010:huge_pte_alloc+0x12c/0x1a0 ... Call Trace: ? __die_body+0x63/0xb0 ? die+0x9f/0xc0 ? do_trap+0xab/0x180 ? huge_pte_alloc+0x12c/0x1a0 ? do_error_trap+0xc6/0x110 ? huge_pte_alloc+0x12c/0x1a0 ? handle_invalid_op+0x2c/0x40 ? huge_pte_alloc+0x12c/0x1a0 ? exc_invalid_op+0x33/0x50 ? asm_exc_invalid_op+0x16/0x20 ? __pfx_put_prev_task_idle+0x10/0x10 ? huge_pte_alloc+0x12c/0x1a0 hugetlb_fault+0x1a3/0x1120 ? finish_task_switch+0xb3/0x2a0 ? lock_is_held_type+0xdb/0x150 handle_mm_fault+0xb8a/0xd40 ? find_vma+0x5d/0xa0 do_user_addr_fault+0x257/0x5d0 exc_page_fault+0x7b/0x1f0 asm_exc_page_fault+0x22/0x30 That happens because a BUG() statement in huge_pte_alloc() attempts to check that a pte, if present, is a hugetlb pte, but it does so in a non-lockless-safe manner that leads to a false BUG() report. We got here due to a couple of bugs, each of which by itself was not quite enough to cause a problem: First of all, before commit c33c794828f2("mm: ptep_get() conversion"), the BUG() statement in huge_pte_alloc() was itself fragile: it relied upon compiler behavior to only read the pte once, despite using it twice in the same conditional. Next, commit c33c794828f2 ("mm: ptep_get() conversion") broke that delicate situation, by causing all direct pte reads to be done via READ_ONCE(). And so READ_ONCE() got called twice within the same BUG() conditional, leading to comparing (potentially, occasionally) different versions of the pte, and thus to false BUG() reports. Fix this by taking a single snapshot of the pte before using it in the BUG conditional. Now, that commit is only partially to blame here but, people doing bisections will invariably land there, so this will help them find a fix for a real crash. And also, the previous behavior was unlikely to ever expose this bug--it was fragile, yet not actually broken. So that's why I chose this commit for the Fixes tag, rather than the commit that created the original BUG() statement. Link: https://lkml.kernel.org/r/20230701010442.2041858-1-jhubbard@nvidia.com Fixes: c33c794828f2 ("mm: ptep_get() conversion") Signed-off-by: John Hubbard Acked-by: James Houghton Acked-by: Muchun Song Reviewed-by: Ryan Roberts Acked-by: Mike Kravetz Cc: Adrian Hunter Cc: Al Viro Cc: Alex Williamson Cc: Alexander Potapenko Cc: Alexander Shishkin Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Christian Brauner Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Dave Airlie Cc: Dimitri Sivanich Cc: Dmitry Vyukov Cc: Ian Rogers Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: Johannes Weiner Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Mark Rutland Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport (IBM) Cc: Namhyung Kim Cc: Naoya Horiguchi Cc: Oleksandr Tyshchenko Cc: Pavel Tatashin Cc: Roman Gushchin Cc: SeongJae Park Cc: Shakeel Butt Cc: Uladzislau Rezki (Sony) Cc: Vincenzo Frascino Cc: Yu Zhao Signed-off-by: Andrew Morton commit 5a569db68c6a961cf75993b16bdcc2fed087df9d Author: Anthony Iliopoulos Date: Wed Jun 28 03:34:37 2023 +0200 docs: update ocfs2-devel mailing list address The ocfs2-devel mailing list has been migrated to the kernel.org infrastructure, update all related documentation pointers to reflect the change. Link: https://lkml.kernel.org/r/20230628013437.47030-3-ailiop@suse.com Signed-off-by: Anthony Iliopoulos Acked-by: Joseph Qi Acked-by: Joel Becker Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Junxiao Bi Cc: Mark Fasheh Signed-off-by: Andrew Morton commit a57b4b7f0557be4fa40d57e2c5e71f17e4510248 Author: Anthony Iliopoulos Date: Wed Jun 28 03:34:36 2023 +0200 MAINTAINERS: update ocfs2-devel mailing list address The ocfs2-devel mailing list has been migrated to the kernel.org infrastructure, update the related entry to reflect the change. Link: https://lkml.kernel.org/r/20230628013437.47030-2-ailiop@suse.com Signed-off-by: Anthony Iliopoulos Acked-by: Joseph Qi Acked-by: Joel Becker Cc: Mark Fasheh Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton commit f96c48670319d685d18d50819ed0c1ef751ed2ac Author: Suren Baghdasaryan Date: Wed Jul 5 18:14:00 2023 -0700 mm: disable CONFIG_PER_VMA_LOCK until its fixed A memory corruption was reported in [1] with bisection pointing to the patch [2] enabling per-VMA locks for x86. Disable per-VMA locks config to prevent this issue until the fix is confirmed. This is expected to be a temporary measure. [1] https://bugzilla.kernel.org/show_bug.cgi?id=217624 [2] https://lore.kernel.org/all/20230227173632.3292573-30-surenb@google.com Link: https://lkml.kernel.org/r/20230706011400.2949242-3-surenb@google.com Reported-by: Jiri Slaby Closes: https://lore.kernel.org/all/dbdef34c-3a07-5951-e1ae-e9c6e3cdf51b@kernel.org/ Reported-by: Jacob Young Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217624 Fixes: 0bff0aaea03e ("x86/mm: try VMA lock-based page fault handling first") Signed-off-by: Suren Baghdasaryan Cc: David Hildenbrand Cc: Holger Hoffstätte Cc: Signed-off-by: Andrew Morton commit 2b4f3b4987b56365b981f44a7e843efa5b6619b9 Author: Suren Baghdasaryan Date: Wed Jul 5 18:13:59 2023 -0700 fork: lock VMAs of the parent process when forking Patch series "Avoid memory corruption caused by per-VMA locks", v4. A memory corruption was reported in [1] with bisection pointing to the patch [2] enabling per-VMA locks for x86. Based on the reproducer provided in [1] we suspect this is caused by the lack of VMA locking while forking a child process. Patch 1/2 in the series implements proper VMA locking during fork. I tested the fix locally using the reproducer and was unable to reproduce the memory corruption problem. This fix can potentially regress some fork-heavy workloads. Kernel build time did not show noticeable regression on a 56-core machine while a stress test mapping 10000 VMAs and forking 5000 times in a tight loop shows ~7% regression. If such fork time regression is unacceptable, disabling CONFIG_PER_VMA_LOCK should restore its performance. Further optimizations are possible if this regression proves to be problematic. Patch 2/2 disables per-VMA locks until the fix is tested and verified. This patch (of 2): When forking a child process, parent write-protects an anonymous page and COW-shares it with the child being forked using copy_present_pte(). Parent's TLB is flushed right before we drop the parent's mmap_lock in dup_mmap(). If we get a write-fault before that TLB flush in the parent, and we end up replacing that anonymous page in the parent process in do_wp_page() (because, COW-shared with the child), this might lead to some stale writable TLB entries targeting the wrong (old) page. Similar issue happened in the past with userfaultfd (see flush_tlb_page() call inside do_wp_page()). Lock VMAs of the parent process when forking a child, which prevents concurrent page faults during fork operation and avoids this issue. This fix can potentially regress some fork-heavy workloads. Kernel build time did not show noticeable regression on a 56-core machine while a stress test mapping 10000 VMAs and forking 5000 times in a tight loop shows ~7% regression. If such fork time regression is unacceptable, disabling CONFIG_PER_VMA_LOCK should restore its performance. Further optimizations are possible if this regression proves to be problematic. Link: https://lkml.kernel.org/r/20230706011400.2949242-1-surenb@google.com Link: https://lkml.kernel.org/r/20230706011400.2949242-2-surenb@google.com Fixes: 0bff0aaea03e ("x86/mm: try VMA lock-based page fault handling first") Signed-off-by: Suren Baghdasaryan Suggested-by: David Hildenbrand Reported-by: Jiri Slaby Closes: https://lore.kernel.org/all/dbdef34c-3a07-5951-e1ae-e9c6e3cdf51b@kernel.org/ Reported-by: Holger Hoffstätte Closes: https://lore.kernel.org/all/b198d649-f4bf-b971-31d0-e8433ec2a34c@applied-asynchrony.com/ Reported-by: Jacob Young Closes: https://bugzilla.kernel.org/show_bug.cgi?id=3D217624 Reviewed-by: Liam R. Howlett Acked-by: David Hildenbrand Tested-by: Holger Hoffsttte Cc: Signed-off-by: Andrew Morton commit 48063dfa4fbb4b5aac3d8aacbf1fd1170b51c5fa Author: Geoff Levand Date: Thu Jun 29 23:32:44 2023 +0000 ntb.rst: Fix copy and paste error It seems the text for the NTB MSI Test Client section was copied from the NTB Tool Test Client, but was not updated for the new section. Corrects the NTB MSI Test Client section text. Reviewed-by: Logan Gunthorpe Reviewed-by: Dave Jiang Signed-off-by: Geoff Levand Signed-off-by: Jon Mason commit ce946519f95fe8f74ee1dba25512a33895520f41 Author: Geoff Levand Date: Fri Jun 30 21:58:46 2023 +0000 ntb_netdev: Fix module_init problem With both the ntb_transport_init and the ntb_netdev_init_module routines in the module_init init group, the ntb_netdev_init_module routine can be called before the ntb_transport_init routine that it depends on is called. To assure the proper initialization order put ntb_netdev_init_module in the late_initcall group. Fixes runtime errors where the ntb_netdev_init_module call fails with ENODEV. Signed-off-by: Geoff Levand Reviewed-by: Dave Jiang Signed-off-by: Jon Mason commit d353fb4b70402f487c1c68bc0a86f526dc8384f3 Author: Cai Huoqing Date: Fri Mar 24 09:32:20 2023 +0800 ntb: intel: Remove redundant pci_clear_master Remove pci_clear_master to simplify the code, the bus-mastering is also cleared in do_pci_disable_device, like this: ./drivers/pci/pci.c:2197 static void do_pci_disable_device(struct pci_dev *dev) { u16 pci_command; pci_read_config_word(dev, PCI_COMMAND, &pci_command); if (pci_command & PCI_COMMAND_MASTER) { pci_command &= ~PCI_COMMAND_MASTER; pci_write_config_word(dev, PCI_COMMAND, pci_command); } pcibios_disable_device(dev); }. And dev->is_busmaster is set to 0 in pci_disable_device. Signed-off-by: Cai Huoqing Acked-by: Dave Jiang Signed-off-by: Jon Mason commit f2748c6d768bbf3448da883a69e254816d7408b4 Author: Cai Huoqing Date: Fri Mar 24 09:32:19 2023 +0800 ntb: epf: Remove redundant pci_clear_master Remove pci_clear_master to simplify the code, the bus-mastering is also cleared in do_pci_disable_device, like this: ./drivers/pci/pci.c:2197 static void do_pci_disable_device(struct pci_dev *dev) { u16 pci_command; pci_read_config_word(dev, PCI_COMMAND, &pci_command); if (pci_command & PCI_COMMAND_MASTER) { pci_command &= ~PCI_COMMAND_MASTER; pci_write_config_word(dev, PCI_COMMAND, pci_command); } pcibios_disable_device(dev); }. And dev->is_busmaster is set to 0 in pci_disable_device. Signed-off-by: Cai Huoqing Signed-off-by: Jon Mason commit da6b4dc49e3c10e13adfb79fc41c098bacf1dc09 Author: Cai Huoqing Date: Fri Mar 24 09:32:18 2023 +0800 ntb_hw_amd: Remove redundant pci_clear_master Remove pci_clear_master to simplify the code, the bus-mastering is also cleared in do_pci_disable_device, like this: ./drivers/pci/pci.c:2197 static void do_pci_disable_device(struct pci_dev *dev) { u16 pci_command; pci_read_config_word(dev, PCI_COMMAND, &pci_command); if (pci_command & PCI_COMMAND_MASTER) { pci_command &= ~PCI_COMMAND_MASTER; pci_write_config_word(dev, PCI_COMMAND, pci_command); } pcibios_disable_device(dev); }. And dev->is_busmaster is set to 0 in pci_disable_device. Signed-off-by: Cai Huoqing Signed-off-by: Jon Mason commit cb2a6d17353452e893194ce1b4e2699fcb24b955 Author: Bjorn Helgaas Date: Tue Mar 7 14:30:21 2023 -0600 ntb: idt: drop redundant pci_enable_pcie_error_reporting() pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Also remove the corresponding pci_disable_pcie_error_reporting() from the driver .remove() path. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Signed-off-by: Bjorn Helgaas Acked-by: Serge Semin Signed-off-by: Jon Mason commit ce2188acad4a7356551ba1ef4a3fbc2b24da15a2 Author: Palmer Dabbelt Date: Thu Oct 13 14:46:38 2022 -0700 MAINTAINERS: git://github -> https://github.com for jonmason Github deprecated the git:// links about a year ago, so let's move to the https:// URLs instead. Reported-by: Conor Dooley Link: https://github.blog/2021-09-01-improving-git-protocol-security-github/ Signed-off-by: Palmer Dabbelt Signed-off-by: Jon Mason commit 956578e3d397e00d6254dc7b5194d28587f98518 Author: ruanjinjie Date: Wed Nov 9 17:28:52 2022 +0800 NTB: EPF: fix possible memory leak in pci_vntb_probe() As ntb_register_device() don't handle error of device_register(), if ntb_register_device() returns error in pci_vntb_probe(), name of kobject which is allocated in dev_set_name() called in device_add() is leaked. As comment of device_add() says, it should call put_device() to drop the reference count that was set in device_initialize() when it fails, so the name can be freed in kobject_cleanup(). Signed-off-by: ruanjinjie Signed-off-by: Jon Mason commit 2790143f09938776a3b4f69685b380bae8fd06c7 Author: Jiasheng Jiang Date: Tue Nov 22 11:32:44 2022 +0800 NTB: ntb_tool: Add check for devm_kcalloc As the devm_kcalloc may return NULL pointer, it should be better to add check for the return value, as same as the others. Fixes: 7f46c8b3a552 ("NTB: ntb_tool: Add full multi-port NTB API support") Signed-off-by: Jiasheng Jiang Reviewed-by: Serge Semin Reviewed-by: Dave Jiang Signed-off-by: Jon Mason commit 8623ccbfc55d962e19a3537652803676ad7acb90 Author: Yang Yingliang Date: Thu Nov 10 23:19:17 2022 +0800 NTB: ntb_transport: fix possible memory leak while device_register() fails If device_register() returns error, the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup(), and client_dev is freed in ntb_transport_client_release(). Fixes: fce8a7bb5b4b ("PCI-Express Non-Transparent Bridge Support") Signed-off-by: Yang Yingliang Reviewed-by: Dave Jiang Signed-off-by: Jon Mason commit 4c3c796aca02883ad35bb117468938cc4022ca41 Author: Yuan Can Date: Sat Nov 5 09:43:22 2022 +0000 ntb: intel: Fix error handling in intel_ntb_pci_driver_init() A problem about ntb_hw_intel create debugfs failed is triggered with the following log given: [ 273.112733] Intel(R) PCI-E Non-Transparent Bridge Driver 2.0 [ 273.115342] debugfs: Directory 'ntb_hw_intel' with parent '/' already present! The reason is that intel_ntb_pci_driver_init() returns pci_register_driver() directly without checking its return value, if pci_register_driver() failed, it returns without destroy the newly created debugfs, resulting the debugfs of ntb_hw_intel can never be created later. intel_ntb_pci_driver_init() debugfs_create_dir() # create debugfs directory pci_register_driver() driver_register() bus_add_driver() priv = kzalloc(...) # OOM happened # return without destroy debugfs directory Fix by removing debugfs when pci_register_driver() returns error. Fixes: e26a5843f7f5 ("NTB: Split ntb_hw_intel and ntb_transport drivers") Signed-off-by: Yuan Can Acked-by: Dave Jiang Signed-off-by: Jon Mason commit 98af0a33c1101c29b3ce4f0cf4715fd927c717f9 Author: Yuan Can Date: Sat Nov 5 09:43:09 2022 +0000 NTB: amd: Fix error handling in amd_ntb_pci_driver_init() A problem about ntb_hw_amd create debugfs failed is triggered with the following log given: [ 618.431232] AMD(R) PCI-E Non-Transparent Bridge Driver 1.0 [ 618.433284] debugfs: Directory 'ntb_hw_amd' with parent '/' already present! The reason is that amd_ntb_pci_driver_init() returns pci_register_driver() directly without checking its return value, if pci_register_driver() failed, it returns without destroy the newly created debugfs, resulting the debugfs of ntb_hw_amd can never be created later. amd_ntb_pci_driver_init() debugfs_create_dir() # create debugfs directory pci_register_driver() driver_register() bus_add_driver() priv = kzalloc(...) # OOM happened # return without destroy debugfs directory Fix by removing debugfs when pci_register_driver() returns error. Fixes: a1b3695820aa ("NTB: Add support for AMD PCI-Express Non-Transparent Bridge") Signed-off-by: Yuan Can Signed-off-by: Jon Mason commit c012968259b451dc4db407f2310fe131eaefd800 Author: Yuan Can Date: Sat Nov 5 09:43:01 2022 +0000 ntb: idt: Fix error handling in idt_pci_driver_init() A problem about ntb_hw_idt create debugfs failed is triggered with the following log given: [ 1236.637636] IDT PCI-E Non-Transparent Bridge Driver 2.0 [ 1236.639292] debugfs: Directory 'ntb_hw_idt' with parent '/' already present! The reason is that idt_pci_driver_init() returns pci_register_driver() directly without checking its return value, if pci_register_driver() failed, it returns without destroy the newly created debugfs, resulting the debugfs of ntb_hw_idt can never be created later. idt_pci_driver_init() debugfs_create_dir() # create debugfs directory pci_register_driver() driver_register() bus_add_driver() priv = kzalloc(...) # OOM happened # return without destroy debugfs directory Fix by removing debugfs when pci_register_driver() returns error. Fixes: bf2a952d31d2 ("NTB: Add IDT 89HPESxNTx PCIe-switches support") Signed-off-by: Yuan Can Signed-off-by: Jon Mason commit 51d03e2f2203e76ed02d33fb5ffbb5fc85ffaf54 Author: Eric Dumazet Date: Sat Jul 8 08:29:58 2023 +0000 udp6: fix udp6_ehashfn() typo Amit Klein reported that udp6_ehash_secret was initialized but never used. Fixes: 1bbdceef1e53 ("inet: convert inet_ehash_secret and ipv6_hash_secret to net_get_random_once") Reported-by: Amit Klein Signed-off-by: Eric Dumazet Cc: Willy Tarreau Cc: Willem de Bruijn Cc: David Ahern Cc: Hannes Frederic Sowa Signed-off-by: David S. Miller commit 0b7ec177b589842c0abf9e91459c83ba28d32452 Author: David Howells Date: Fri Jul 7 10:12:38 2023 +0100 crypto: algif_hash - Fix race between MORE and non-MORE sends The 'MSG_MORE' state of the previous sendmsg() is fetched without the socket lock held, so two sendmsg calls can race. This can be seen with a large sendfile() as that now does a series of sendmsg() calls, and if a write() comes in on the same socket at an inopportune time, it can flip the state. Fix this by moving the fetch of ctx->more inside the socket lock. Fixes: c662b043cdca ("crypto: af_alg/hash: Support MSG_SPLICE_PAGES") Reported-by: syzbot+689ec3afb1ef07b766b2@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/000000000000554b8205ffdea64e@google.com/ Signed-off-by: David Howells Tested-by: syzbot+689ec3afb1ef07b766b2@syzkaller.appspotmail.com cc: Herbert Xu cc: Paolo Abeni cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org Signed-off-by: Herbert Xu commit 2aaa8a15de73874847d62eb595c6683bface80fd Author: Kuniyuki Iwashima Date: Fri Jul 7 18:43:27 2023 -0700 icmp6: Fix null-ptr-deref of ip6_null_entry->rt6i_idev in icmp6_dev(). With some IPv6 Ext Hdr (RPL, SRv6, etc.), we can send a packet that has the link-local address as src and dst IP and will be forwarded to an external IP in the IPv6 Ext Hdr. For example, the script below generates a packet whose src IP is the link-local address and dst is updated to 11::. # for f in $(find /proc/sys/net/ -name *seg6_enabled*); do echo 1 > $f; done # python3 >>> from socket import * >>> from scapy.all import * >>> >>> SRC_ADDR = DST_ADDR = "fe80::5054:ff:fe12:3456" >>> >>> pkt = IPv6(src=SRC_ADDR, dst=DST_ADDR) >>> pkt /= IPv6ExtHdrSegmentRouting(type=4, addresses=["11::", "22::"], segleft=1) >>> >>> sk = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW) >>> sk.sendto(bytes(pkt), (DST_ADDR, 0)) For such a packet, we call ip6_route_input() to look up a route for the next destination in these three functions depending on the header type. * ipv6_rthdr_rcv() * ipv6_rpl_srh_rcv() * ipv6_srh_rcv() If no route is found, ip6_null_entry is set to skb, and the following dst_input(skb) calls ip6_pkt_drop(). Finally, in icmp6_dev(), we dereference skb_rt6_info(skb)->rt6i_idev->dev as the input device is the loopback interface. Then, we have to check if skb_rt6_info(skb)->rt6i_idev is NULL or not to avoid NULL pointer deref for ip6_null_entry. BUG: kernel NULL pointer dereference, address: 0000000000000000 PF: supervisor read access in kernel mode PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 0 PID: 157 Comm: python3 Not tainted 6.4.0-11996-gb121d614371c #35 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 RIP: 0010:icmp6_send (net/ipv6/icmp.c:436 net/ipv6/icmp.c:503) Code: fe ff ff 48 c7 40 30 c0 86 5d 83 e8 c6 44 1c 00 e9 c8 fc ff ff 49 8b 46 58 48 83 e0 fe 0f 84 4a fb ff ff 48 8b 80 d0 00 00 00 <48> 8b 00 44 8b 88 e0 00 00 00 e9 34 fb ff ff 4d 85 ed 0f 85 69 01 RSP: 0018:ffffc90000003c70 EFLAGS: 00000286 RAX: 0000000000000000 RBX: 0000000000000001 RCX: 00000000000000e0 RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffff888006d72a18 RBP: ffffc90000003d80 R08: 0000000000000000 R09: 0000000000000001 R10: ffffc90000003d98 R11: 0000000000000040 R12: ffff888006d72a10 R13: 0000000000000000 R14: ffff8880057fb800 R15: ffffffff835d86c0 FS: 00007f9dc72ee740(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000000057b2000 CR4: 00000000007506f0 PKRU: 55555554 Call Trace: ip6_pkt_drop (net/ipv6/route.c:4513) ipv6_rthdr_rcv (net/ipv6/exthdrs.c:640 net/ipv6/exthdrs.c:686) ip6_protocol_deliver_rcu (net/ipv6/ip6_input.c:437 (discriminator 5)) ip6_input_finish (./include/linux/rcupdate.h:781 net/ipv6/ip6_input.c:483) __netif_receive_skb_one_core (net/core/dev.c:5455) process_backlog (./include/linux/rcupdate.h:781 net/core/dev.c:5895) __napi_poll (net/core/dev.c:6460) net_rx_action (net/core/dev.c:6529 net/core/dev.c:6660) __do_softirq (./arch/x86/include/asm/jump_label.h:27 ./include/linux/jump_label.h:207 ./include/trace/events/irq.h:142 kernel/softirq.c:554) do_softirq (kernel/softirq.c:454 kernel/softirq.c:441) __local_bh_enable_ip (kernel/softirq.c:381) __dev_queue_xmit (net/core/dev.c:4231) ip6_finish_output2 (./include/net/neighbour.h:544 net/ipv6/ip6_output.c:135) rawv6_sendmsg (./include/net/dst.h:458 ./include/linux/netfilter.h:303 net/ipv6/raw.c:656 net/ipv6/raw.c:914) sock_sendmsg (net/socket.c:725 net/socket.c:748) __sys_sendto (net/socket.c:2134) __x64_sys_sendto (net/socket.c:2146 net/socket.c:2142 net/socket.c:2142) do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120) RIP: 0033:0x7f9dc751baea Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f 00 f3 0f 1e fa 41 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 15 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 7e c3 0f 1f 44 00 00 41 54 48 83 ec 30 44 89 RSP: 002b:00007ffe98712c38 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007ffe98712cf8 RCX: 00007f9dc751baea RDX: 0000000000000060 RSI: 00007f9dc6460b90 RDI: 0000000000000003 RBP: 00007f9dc56e8be0 R08: 00007ffe98712d70 R09: 000000000000001c R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: ffffffffc4653600 R14: 0000000000000001 R15: 00007f9dc6af5d1b Modules linked in: CR2: 0000000000000000 ---[ end trace 0000000000000000 ]--- RIP: 0010:icmp6_send (net/ipv6/icmp.c:436 net/ipv6/icmp.c:503) Code: fe ff ff 48 c7 40 30 c0 86 5d 83 e8 c6 44 1c 00 e9 c8 fc ff ff 49 8b 46 58 48 83 e0 fe 0f 84 4a fb ff ff 48 8b 80 d0 00 00 00 <48> 8b 00 44 8b 88 e0 00 00 00 e9 34 fb ff ff 4d 85 ed 0f 85 69 01 RSP: 0018:ffffc90000003c70 EFLAGS: 00000286 RAX: 0000000000000000 RBX: 0000000000000001 RCX: 00000000000000e0 RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffff888006d72a18 RBP: ffffc90000003d80 R08: 0000000000000000 R09: 0000000000000001 R10: ffffc90000003d98 R11: 0000000000000040 R12: ffff888006d72a10 R13: 0000000000000000 R14: ffff8880057fb800 R15: ffffffff835d86c0 FS: 00007f9dc72ee740(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000000057b2000 CR4: 00000000007506f0 PKRU: 55555554 Kernel panic - not syncing: Fatal exception in interrupt Kernel Offset: disabled Fixes: 4832c30d5458 ("net: ipv6: put host and anycast routes on device with address") Reported-by: Wang Yufen Closes: https://lore.kernel.org/netdev/c41403a9-c2f6-3b7e-0c96-e1901e605cd0@huawei.com/ Signed-off-by: Kuniyuki Iwashima Reviewed-by: David Ahern Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit bbffab69d05dfbb7c60a811c7edc2bd57a03e89f Merge: c329b261afe71 266deeea34ffd Author: David S. Miller Date: Sat Jul 8 10:07:14 2023 +0100 Merge branch 's390-ism-fixes' Niklas Schnelle says: ==================== s390/ism: Fixes to client handling This is v2 of the patch previously titled "s390/ism: Detangle ISM client IRQ and event forwarding". As suggested by Paolo Abeni I split the patch up. While doing so I noticed another problem that was fixed by this patch concerning the way the workqueues access the client structs. This means the second patch turning the workqueues into simple direct calls also fixes a problem. Finally I split off a third patch just for fixing ism_unregister_client()s error path. The code after these 3 patches is identical to the result of the v1 patch except that I also turned the dev_err() for still registered DMBs into a WARN(). ==================== Signed-off-by: David S. Miller commit 266deeea34ffd28c6b6a63edf2af9b5a07161c24 Author: Niklas Schnelle Date: Fri Jul 7 12:56:22 2023 +0200 s390/ism: Do not unregister clients with registered DMBs When ism_unregister_client() is called but the client still has DMBs registered it returns -EBUSY and prints an error. This only happens after the client has already been unregistered however. This is unexpected as the unregister claims to have failed. Furthermore as this implies a client bug a WARN() is more appropriate. Thus move the deregistration after the check and use WARN(). Fixes: 89e7d2ba61b7 ("net/ism: Add new API for client registration") Signed-off-by: Niklas Schnelle Signed-off-by: David S. Miller commit 76631ffa2fd2d45bae5ad717eef716b94144e0e7 Author: Niklas Schnelle Date: Fri Jul 7 12:56:21 2023 +0200 s390/ism: Fix and simplify add()/remove() callback handling Previously the clients_lock was protecting the clients array against concurrent addition/removal of clients but was also accessed from IRQ context. This meant that it had to be a spinlock and that the add() and remove() callbacks in which clients need to do allocation and take mutexes can't be called under the clients_lock. To work around this these callbacks were moved to workqueues. This not only introduced significant complexity but is also subtly broken in at least one way. In ism_dev_init() and ism_dev_exit() clients[i]->tgt_ism is used to communicate the added/removed ISM device to the work function. While write access to client[i]->tgt_ism is protected by the clients_lock and the code waits that there is no pending add/remove work before and after setting clients[i]->tgt_ism this is not enough. The problem is that the wait happens based on per ISM device counters. Thus a concurrent ism_dev_init()/ism_dev_exit() for a different ISM device may overwrite a clients[i]->tgt_ism between unlocking the clients_lock and the subsequent wait for the work to finnish. Thankfully with the clients_lock no longer held in IRQ context it can be turned into a mutex which can be held during the calls to add()/remove() completely removing the need for the workqueues and the associated broken housekeeping including the per ISM device counters and the clients[i]->tgt_ism. Fixes: 89e7d2ba61b7 ("net/ism: Add new API for client registration") Signed-off-by: Niklas Schnelle Signed-off-by: David S. Miller commit 6b5c13b591d753c6022fbd12f8c0c0a9a07fc065 Author: Niklas Schnelle Date: Fri Jul 7 12:56:20 2023 +0200 s390/ism: Fix locking for forwarding of IRQs and events to clients The clients array references all registered clients and is protected by the clients_lock. Besides its use as general list of clients the clients array is accessed in ism_handle_irq() to forward ISM device events to clients. While the clients_lock is taken in the IRQ handler when calling handle_event() it is however incorrectly not held during the client->handle_irq() call and for the preceding clients[] access leaving it unprotected against concurrent client (un-)registration. Furthermore the accesses to ism->sba_client_arr[] in ism_register_dmb() and ism_unregister_dmb() are not protected by any lock. This is especially problematic as the client ID from the ism->sba_client_arr[] is not checked against NO_CLIENT and neither is the client pointer checked. Instead of expanding the use of the clients_lock further add a separate array in struct ism_dev which references clients subscribed to the device's events and IRQs. This array is protected by ism->lock which is already taken in ism_handle_irq() and can be taken outside the IRQ handler when adding/removing subscribers or the accessing ism->sba_client_arr[]. This also means that the clients_lock is no longer taken in IRQ context. Fixes: 89e7d2ba61b7 ("net/ism: Add new API for client registration") Signed-off-by: Niklas Schnelle Reviewed-by: Alexandra Winter Signed-off-by: David S. Miller commit c329b261afe71197d9da83c1f18eb45a7e97e089 Author: Paolo Abeni Date: Fri Jul 7 10:11:10 2023 +0200 net: prevent skb corruption on frag list segmentation Ian reported several skb corruptions triggered by rx-gro-list, collecting different oops alike: [ 62.624003] BUG: kernel NULL pointer dereference, address: 00000000000000c0 [ 62.631083] #PF: supervisor read access in kernel mode [ 62.636312] #PF: error_code(0x0000) - not-present page [ 62.641541] PGD 0 P4D 0 [ 62.644174] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 62.648629] CPU: 1 PID: 913 Comm: napi/eno2-79 Not tainted 6.4.0 #364 [ 62.655162] Hardware name: Supermicro Super Server/A2SDi-12C-HLN4F, BIOS 1.7a 10/13/2022 [ 62.663344] RIP: 0010:__udp_gso_segment (./include/linux/skbuff.h:2858 ./include/linux/udp.h:23 net/ipv4/udp_offload.c:228 net/ipv4/udp_offload.c:261 net/ipv4/udp_offload.c:277) [ 62.687193] RSP: 0018:ffffbd3a83b4f868 EFLAGS: 00010246 [ 62.692515] RAX: 00000000000000ce RBX: 0000000000000000 RCX: 0000000000000000 [ 62.699743] RDX: ffffa124def8a000 RSI: 0000000000000079 RDI: ffffa125952a14d4 [ 62.706970] RBP: ffffa124def8a000 R08: 0000000000000022 R09: 00002000001558c9 [ 62.714199] R10: 0000000000000000 R11: 00000000be554639 R12: 00000000000000e2 [ 62.721426] R13: ffffa125952a1400 R14: ffffa125952a1400 R15: 00002000001558c9 [ 62.728654] FS: 0000000000000000(0000) GS:ffffa127efa40000(0000) knlGS:0000000000000000 [ 62.736852] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 62.742702] CR2: 00000000000000c0 CR3: 00000001034b0000 CR4: 00000000003526e0 [ 62.749948] Call Trace: [ 62.752498] [ 62.779267] inet_gso_segment (net/ipv4/af_inet.c:1398) [ 62.787605] skb_mac_gso_segment (net/core/gro.c:141) [ 62.791906] __skb_gso_segment (net/core/dev.c:3403 (discriminator 2)) [ 62.800492] validate_xmit_skb (./include/linux/netdevice.h:4862 net/core/dev.c:3659) [ 62.804695] validate_xmit_skb_list (net/core/dev.c:3710) [ 62.809158] sch_direct_xmit (net/sched/sch_generic.c:330) [ 62.813198] __dev_queue_xmit (net/core/dev.c:3805 net/core/dev.c:4210) net/netfilter/core.c:626) [ 62.821093] br_dev_queue_push_xmit (net/bridge/br_forward.c:55) [ 62.825652] maybe_deliver (net/bridge/br_forward.c:193) [ 62.829420] br_flood (net/bridge/br_forward.c:233) [ 62.832758] br_handle_frame_finish (net/bridge/br_input.c:215) [ 62.837403] br_handle_frame (net/bridge/br_input.c:298 net/bridge/br_input.c:416) [ 62.851417] __netif_receive_skb_core.constprop.0 (net/core/dev.c:5387) [ 62.866114] __netif_receive_skb_list_core (net/core/dev.c:5570) [ 62.871367] netif_receive_skb_list_internal (net/core/dev.c:5638 net/core/dev.c:5727) [ 62.876795] napi_complete_done (./include/linux/list.h:37 ./include/net/gro.h:434 ./include/net/gro.h:429 net/core/dev.c:6067) [ 62.881004] ixgbe_poll (drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:3191) [ 62.893534] __napi_poll (net/core/dev.c:6498) [ 62.897133] napi_threaded_poll (./include/linux/netpoll.h:89 net/core/dev.c:6640) [ 62.905276] kthread (kernel/kthread.c:379) [ 62.913435] ret_from_fork (arch/x86/entry/entry_64.S:314) [ 62.917119] In the critical scenario, rx-gro-list GRO-ed packets are fed, via a bridge, both to the local input path and to an egress device (tun). The segmentation of such packets unsafely writes to the cloned skbs with shared heads. This change addresses the issue by uncloning as needed the to-be-segmented skbs. Reported-by: Ian Kumlien Tested-by: Ian Kumlien Fixes: 3a1296a38d0c ("net: Support GRO/GSO fraglist chaining.") Signed-off-by: Paolo Abeni Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit e7731194fdf085f46d58b1adccfddbd0dfee4873 Author: Rafał Miłecki Date: Fri Jul 7 08:53:25 2023 +0200 net: bgmac: postpone turning IRQs off to avoid SoC hangs Turning IRQs off is done by accessing Ethernet controller registers. That can't be done until device's clock is enabled. It results in a SoC hang otherwise. This bug remained unnoticed for years as most bootloaders keep all Ethernet interfaces turned on. It seems to only affect a niche SoC family BCM47189. It has two Ethernet controllers but CFE bootloader uses only the first one. Fixes: 34322615cbaa ("net: bgmac: Mask interrupts during probe") Signed-off-by: Rafał Miłecki Reviewed-by: Michal Kubiak Signed-off-by: David S. Miller commit ed04a91f718e6e1ab82d47a22b26e4b50c1666f6 Author: Darrick J. Wong Date: Thu Jul 6 18:00:59 2023 -0700 xfs: fix uninit warning in xfs_growfs_data Quiet down this gcc warning: fs/xfs/xfs_fsops.c: In function ‘xfs_growfs_data’: fs/xfs/xfs_fsops.c:219:21: error: ‘lastag_extended’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 219 | if (lastag_extended) { | ^~~~~~~~~~~~~~~ fs/xfs/xfs_fsops.c:100:33: note: ‘lastag_extended’ was declared here 100 | bool lastag_extended; | ^~~~~~~~~~~~~~~ By setting its value explicitly. From code analysis I don't think this is a real problem, but I have better things to do than analyse this closely. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 8689f4f2ea561dd080118eeb05c0255ac9542905 Merge: 4c8ab068bea2e fa700d73494ab Author: Linus Torvalds Date: Fri Jul 7 15:59:33 2023 -0700 Merge tag 'mmc-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull mmc fix from Ulf Hansson: - Fix regression of detection of eMMC/SD/SDIO cards * tag 'mmc-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: Revert "mmc: core: Allow mmc_start_host() synchronously detect a card" commit 4c8ab068bea2ed7b5b192cd66d436620a0b4f05e Merge: 3290badd1bb8c 5251605f4d297 Author: Linus Torvalds Date: Fri Jul 7 15:40:17 2023 -0700 Merge tag 'sound-fix-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small fixes that have been gathered recently: - Two code-typo fixes in the new UMP core - A fix in jack reporting to avoid the usage of mutex - A potential data race fix in HD-audio core regmap code - A potential data race fix in PCM allocation helper code - HD-audio quirks for ASUS, Clevo and Unis machines - Constifications in FireWire drivers" * tag 'sound-fix-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek: Add quirk for ASUS ROG GZ301V ALSA: jack: Fix mutex call in snd_jack_report() ALSA: seq: ump: fix typo in system_2p_ev_to_ump_midi1() ALSA: hda/realtek: Whitespace fix ALSA: hda/realtek: Add quirk for ASUS ROG G614Jx ALSA: hda/realtek: Amend G634 quirk to enable rear speakers ALSA: hda/realtek: Add quirk for ASUS ROG GA402X ALSA: hda/realtek: Add quirk for ASUS ROG GX650P ALSA: pcm: Fix potential data race at PCM memory allocation helpers ALSA: hda: fix a possible null-pointer dereference due to data race in snd_hdac_regmap_sync() ALSA: hda/realtek: Add quirks for Unis H3C Desktop B760 & Q760 ALSA: hda/realtek: Add quirk for Clevo NPx0SNx ALSA: ump: Correct wrong byte size at converting a UMP System message ALSA: fireface: make read-only const array for model names static ALSA: oxfw: make read-only const array models static commit 3290badd1bb8c9ea91db5c0b2e1a635178119856 Merge: 36b93aed9ec07 257e6172ab36e Author: Linus Torvalds Date: Fri Jul 7 15:07:20 2023 -0700 Merge tag 'ceph-for-6.5-rc1' of https://github.com/ceph/ceph-client Pull ceph updates from Ilya Dryomov: "A bunch of CephFS fixups from Xiubo, mostly around dropping caps, along with a fix for a regression in the readahead handling code which sneaked in with the switch to netfs helpers" * tag 'ceph-for-6.5-rc1' of https://github.com/ceph/ceph-client: ceph: don't let check_caps skip sending responses for revoke msgs ceph: issue a cap release immediately if no cap exists ceph: trigger to flush the buffer when making snapshot ceph: fix blindly expanding the readahead windows ceph: add a dedicated private data for netfs rreq ceph: voluntarily drop Xx caps for requests those touch parent mtime ceph: try to dump the msgs when decoding fails ceph: only send metrics when the MDS rank is ready commit 36b93aed9ec07607e26630ecf210e065662f6b0d Merge: 986ffe6070d66 44b4494d5c597 Author: Linus Torvalds Date: Fri Jul 7 14:59:38 2023 -0700 Merge tag 'ntfs3_for_6.5' of https://github.com/Paragon-Software-Group/linux-ntfs3 Pull ntfs3 updates from Konstantin Komarov: "Updates: - support /proc/fs/ntfs3//volinfo and label - alternative boot if primary boot is corrupted - small optimizations Fixes: - fix endian problems - fix logic errors - code refactoring and reformatting" * tag 'ntfs3_for_6.5' of https://github.com/Paragon-Software-Group/linux-ntfs3: fs/ntfs3: Correct mode for label entry inside /proc/fs/ntfs3/ fs/ntfs3: Add support /proc/fs/ntfs3//volinfo and /proc/fs/ntfs3//label fs/ntfs3: Fix endian problem fs/ntfs3: Add ability to format new mft records with bigger/smaller header fs/ntfs3: Code refactoring fs/ntfs3: Code formatting fs/ntfs3: Do not update primary boot in ntfs_init_from_boot() fs/ntfs3: Alternative boot if primary boot is corrupted fs/ntfs3: Mark ntfs dirty when on-disk struct is corrupted fs/ntfs3: Fix ntfs_atomic_open fs/ntfs3: Correct checking while generating attr_list fs/ntfs3: Use __GFP_NOWARN allocation at ntfs_load_attr_list() fs: ntfs3: Fix possible null-pointer dereferences in mi_read() fs/ntfs3: Return error for inconsistent extended attributes fs/ntfs3: Enhance sanity check while generating attr_list fs/ntfs3: Use wrapper i_blocksize() in ntfs_zero_range() ntfs: Fix panic about slab-out-of-bounds caused by ntfs_listxattr() commit 986ffe6070d661650f8198069f6f3c228e23bca0 Merge: 4f6b6c2b2f86b 69562eb0bd3e6 Author: Linus Torvalds Date: Fri Jul 7 14:51:37 2023 -0700 Merge tag 'fsnotify_for_v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify fix from Jan Kara: "A fix for fanotify to disallow creating of mount or superblock marks for kernel internal pseudo filesystems" * tag 'fsnotify_for_v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: disallow mount/sb marks on kernel internal pseudo fs commit 8a796565cec3601071cbbd27d6304e202019d014 Author: Andres Freund Date: Fri Jul 7 09:20:07 2023 -0700 io_uring: Use io_schedule* in cqring wait I observed poor performance of io_uring compared to synchronous IO. That turns out to be caused by deeper CPU idle states entered with io_uring, due to io_uring using plain schedule(), whereas synchronous IO uses io_schedule(). The losses due to this are substantial. On my cascade lake workstation, t/io_uring from the fio repository e.g. yields regressions between 20% and 40% with the following command: ./t/io_uring -r 5 -X0 -d 1 -s 1 -c 1 -p 0 -S$use_sync -R 0 /mnt/t2/fio/write.0.0 This is repeatable with different filesystems, using raw block devices and using different block devices. Use io_schedule_prepare() / io_schedule_finish() in io_cqring_wait_schedule() to address the difference. After that using io_uring is on par or surpassing synchronous IO (using registered files etc makes it reliably win, but arguably is a less fair comparison). There are other calls to schedule() in io_uring/, but none immediately jump out to be similarly situated, so I did not touch them. Similarly, it's possible that mutex_lock_io() should be used, but it's not clear if there are cases where that matters. Cc: stable@vger.kernel.org # 5.10+ Cc: Pavel Begunkov Cc: io-uring@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andres Freund Link: https://lore.kernel.org/r/20230707162007.194068-1-andres@anarazel.de [axboe: minor style fixup] Signed-off-by: Jens Axboe commit 4f6b6c2b2f86b7878a770736bf478d8a263ff0bc Merge: 22dcc7d77fa46 e8605e8fdf426 Author: Linus Torvalds Date: Fri Jul 7 10:07:19 2023 -0700 Merge tag 'riscv-for-linus-6.5-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull more RISC-V updates from Palmer Dabbelt: - A bunch of fixes/cleanups from the first part of the merge window, mostly related to ACPI and vector as those were large - Some documentation improvements, mostly related to the new code - The "riscv,isa" DT key is deprecated - Support for link-time dead code elimination - Support for minor fault registration in userfaultd - A handful of cleanups around CMO alternatives * tag 'riscv-for-linus-6.5-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (23 commits) riscv: mm: mark noncoherent_supported as __ro_after_init riscv: mm: mark CBO relate initialization funcs as __init riscv: errata: thead: only set cbom size & noncoherent during boot riscv: Select HAVE_ARCH_USERFAULTFD_MINOR RISC-V: Document the ISA string parsing rules for ACPI risc-v: Fix order of IPI enablement vs RCU startup mm: riscv: fix an unsafe pte read in huge_pte_alloc() dt-bindings: riscv: deprecate riscv,isa RISC-V: drop error print from riscv_hartid_to_cpuid() riscv: Discard vector state on syscalls riscv: move memblock_allow_resize() after linear mapping is ready riscv: Enable ARCH_SUSPEND_POSSIBLE for s2idle riscv: vdso: include vdso/vsyscall.h for vdso_data selftests: Test RISC-V Vector's first-use handler riscv: vector: clear V-reg in the first-use trap riscv: vector: only enable interrupts in the first-use trap RISC-V: Fix up some vector state related build failures RISC-V: Document that V registers are clobbered on syscalls riscv: disable HAVE_LD_DEAD_CODE_DATA_ELIMINATION for LLD riscv: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION ... commit 22dcc7d77fa463914bc2a2fb4580e6d183ca415d Merge: 70806ee18a871 abaa02fc944f2 Author: Linus Torvalds Date: Fri Jul 7 10:00:30 2023 -0700 Merge tag 'powerpc-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix PCIe MEM size for pci2 node on Turris 1.x boards - Two minor build fixes Thanks to Christophe Leroy, Douglas Anderson, Pali Rohár, Petr Mladek, and Randy Dunlap. * tag 'powerpc-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc: dts: turris1x.dts: Fix PCIe MEM size for pci2 node powerpc: Include asm/nmi.c in mobility.c for watchdog_hardlockup_set_timeout_pct() powerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y commit 70806ee18a871140a73a2524a29865e1d904348c Merge: 5133c9e51de41 3f069c4c64322 Author: Linus Torvalds Date: Fri Jul 7 09:55:31 2023 -0700 Merge tag 'apparmor-pr-2023-07-06' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor Pull apparmor updates from John Johansen: - fix missing error check for rhashtable_insert_fast - add missing failure check in compute_xmatch_perms - fix policy_compat permission remap with extended permissions - fix profile verification and enable it - fix kzalloc perms tables for shared dfas - Fix kernel-doc header for verify_dfa_accept_index - aa_buffer: Convert 1-element array to flexible array - Return directly after a failed kzalloc() in two functions - fix use of strcpy in policy_unpack_test - fix kernel-doc complaints - Fix some kernel-doc comments * tag 'apparmor-pr-2023-07-06' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor: apparmor: Fix kernel-doc header for verify_dfa_accept_index apparmor: fix: kzalloc perms tables for shared dfas apparmor: fix profile verification and enable it apparmor: fix policy_compat permission remap with extended permissions apparmor: aa_buffer: Convert 1-element array to flexible array apparmor: add missing failure check in compute_xmatch_perms apparmor: fix missing error check for rhashtable_insert_fast apparmor: Return directly after a failed kzalloc() in two functions AppArmor: Fix some kernel-doc comments apparmor: fix use of strcpy in policy_unpack_test apparmor: fix kernel-doc complaints commit b1472a60a584694875a05cf8bcba8bdf0dc1cd3a Author: Thomas Gleixner Date: Wed Jul 5 10:59:23 2023 +0200 x86/smp: Don't send INIT to boot CPU Parking CPUs in INIT works well, except for the crash case when the CPU which invokes smp_park_other_cpus_in_init() is not the boot CPU. Sending INIT to the boot CPU resets the whole machine. Prevent this by validating that this runs on the boot CPU. If not fall back and let CPUs hang in HLT. Fixes: 45e34c8af58f ("x86/smp: Put CPUs into INIT on shutdown if possible") Reported-by: Baokun Li Signed-off-by: Thomas Gleixner Tested-by: Baokun Li Link: https://lore.kernel.org/r/87ttui91jo.ffs@tglx commit 3a6dbb691782e88e07e5c70b327495dbd58a2e7f Author: Thomas Bogendoerfer Date: Thu Jul 6 18:36:10 2023 +0200 MIPS: kvm: Fix build error with KVM_MIPS_DEBUG_COP0_COUNTERS enabled Commit e4de20576986 ("MIPS: KVM: Fix NULL pointer dereference") missed converting one place accessing cop0 registers, which results in a build error, if KVM_MIPS_DEBUG_COP0_COUNTERS is enabled. Fixes: e4de20576986 ("MIPS: KVM: Fix NULL pointer dereference") Signed-off-by: Thomas Bogendoerfer Reviewed-by: Philippe Mathieu-Daudé commit 8139dccd464aaee4a2c351506ff883733c6ca5a3 Author: Ivan Babrou Date: Thu Jul 6 21:39:20 2023 -0700 udp6: add a missing call into udp_fail_queue_rcv_skb tracepoint The tracepoint has existed for 12 years, but it only covered udp over the legacy IPv4 protocol. Having it enabled for udp6 removes the unnecessary difference in error visibility. Signed-off-by: Ivan Babrou Fixes: 296f7ea75b45 ("udp: add tracepoints for queueing skb to rcvbuf") Acked-by: Paolo Abeni Signed-off-by: David S. Miller commit 3a7af34fb6ecd9fbeb4454fc03c654b26fab5f5e Author: Shannon Nelson Date: Thu Jul 6 13:59:24 2023 -0700 ionic: remove dead device fail path Remove the probe error path code that leaves the driver bound to the device, but with essentially a dead device. This was useful maybe twice early in the driver's life and no longer makes sense to keep. Fixes: 30a1e6d0f8e2 ("ionic: keep ionic dev on lif init fail") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit abfb2a58a5377ebab717d4362d6180f901b6e5c1 Author: Nitya Sunkad Date: Thu Jul 6 11:20:06 2023 -0700 ionic: remove WARN_ON to prevent panic_on_warn Remove unnecessary early code development check and the WARN_ON that it uses. The irq alloc and free paths have long been cleaned up and this check shouldn't have stuck around so long. Fixes: 77ceb68e29cc ("ionic: Add notifyq support") Signed-off-by: Nitya Sunkad Signed-off-by: Shannon Nelson Reviewed-by: Jacob Keller Signed-off-by: David S. Miller commit 7709fbd4922c197efabda03660d93e48a3e80323 Author: Sai Krishna Date: Thu Jul 6 13:59:36 2023 +0530 octeontx2-af: Move validation of ptp pointer before its usage Moved PTP pointer validation before its use to avoid smatch warning. Also used kzalloc/kfree instead of devm_kzalloc/devm_kfree. Fixes: 2ef4e45d99b1 ("octeontx2-af: Add PTP PPS Errata workaround on CN10K silicon") Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Goutham Signed-off-by: Sai Krishna Signed-off-by: David S. Miller commit af42088bdaf292060b8d8a00d8644ca7b2b3f2d1 Author: Ratheesh Kannoth Date: Thu Jul 6 09:57:05 2023 +0530 octeontx2-af: Promisc enable/disable through mbox In legacy silicon, promiscuous mode is only modified through CGX mbox messages. In CN10KB silicon, it is modified from CGX mbox and NIX. This breaks legacy application behaviour. Fix this by removing call from NIX. Fixes: d6c9784baf59 ("octeontx2-af: Invoke exact match functions if supported") Signed-off-by: Ratheesh Kannoth Reviewed-by: Leon Romanovsky Reviewed-by: Michal Kubiak Signed-off-by: David S. Miller commit 15008052b34efaa86c1d56190ac73c4bf8c462f9 Author: Geert Uytterhoeven Date: Thu Jul 6 17:30:31 2023 +0200 drm/fbdev-dma: Fix documented default preferred_bpp value As of commit 6c80a93be62d398e ("drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function"), the preferred_bpp parameter of drm_fb_helper_prepare() defaults to 32 instead of drm_mode_config.preferred_depth. Hence this also applies to drm_fbdev_dma_setup(), which just passes its own preferred_bpp parameter. Fixes: b79fe9abd58bab73 ("drm/fbdev-dma: Implement fbdev emulation for GEM DMA helpers") Signed-off-by: Geert Uytterhoeven Reviewed-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/91f093ffe436a9f94d58fb2bfbc1407f1ebe8bb0.1688656591.git.geert+renesas@glider.be commit b61aac027b019155199db1f8580c3d50d417c6d8 Merge: 0503efeadbf6b 84a192e461063 Author: David S. Miller Date: Fri Jul 7 08:56:12 2023 +0100 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-07-05 (igc) This series contains updates to igc driver only. Husaini adds check to increment Qbv change error counter only on taprio Qbvs. He also removes delay during Tx ring configuration and resolves Tx hang that could occur when transmitting on a gate to be closed. Prasad Koya reports ethtool link mode as TP (twisted pair). Tee Min corrects value for max SDU. Aravindhan ensures that registers for PPS are always programmed to occur in future. ==================== Signed-off-by: David S. Miller commit 5251605f4d297a0eb5d3b7f39f9dcee9e4d0115a Author: Luke D. Jones Date: Fri Jul 7 10:33:23 2023 +1200 ALSA: hda/realtek: Add quirk for ASUS ROG GZ301V Adds the required quirk to enable the Cirrus amp and correct pins on the ASUS ROG GZ301V series which uses an SPI connected Cirrus amp. While this works if the related _DSD properties are made available, these aren't included in the ACPI of these laptops (yet). Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20230706223323.30871-2-luke@ljones.dev Signed-off-by: Takashi Iwai commit 5133c9e51de41bfa902153888e11add3342ede18 Merge: 94e0d43e51ff8 6725f33228077 Author: Linus Torvalds Date: Thu Jul 6 22:42:54 2023 -0700 Merge tag 'drm-next-2023-07-07' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Lots of fixes, mostly i915 and amdgpu. It's two weeks of i915, and I think three weeks of amdgpu. fbdev: - Fix module infos on sparc panel: - Fix mode on Starry-ili9882t i915: - Allow DC states along with PW2 only for PWB functionality [adlp+] - Fix SSC selection for MPLLA [mtl] - Use hw.adjusted mode when calculating io/fast wake times [psr] - Apply min softlimit correctly [guc/slpc] - Assign correct hdcp content type [hdcp] - Add missing forward declarations/includes to display power headers - Fix BDW PSR AUX CH data register offsets [psr] - Use mock device info for creating mock device amdgpu: - Misc cleanups - GFX 9.4.3 fixes - DEBUGFS build fix - Fix LPDDR5 reporting - ASPM fixes - DCN 3.1.4 fixes - DP MST fixes - DCN 3.2.x fixes - Display PSR TCON fixes - SMU 13.x fixes - RAS fixes - Vega12/20 SMU fixes - PSP flashing cleanup - GFX9 MCBP fixes - SR-IOV fixes - GPUVM clear mappings fix for always valid BOs - Add FAMS quirk for problematic monitor - Fix possible UAF - Better handle monentary temperature fluctuations - SDMA 4.4.2 fixes - Fencing fix" * tag 'drm-next-2023-07-07' of git://anongit.freedesktop.org/drm/drm: (83 commits) drm/i915: use mock device info for creating mock device drm/i915/psr: Fix BDW PSR AUX CH data register offsets drm/amdgpu: Fix potential fence use-after-free v2 drm/amd/pm: avoid unintentional shutdown due to temperature momentary fluctuation drm/amd/pm: expose swctf threshold setting for legacy powerplay drm/amd/display: 3.2.241 drm/amd/display: Take full update path if number of planes changed drm/amd/display: Create debugging mechanism for Gaming FAMS drm/amd/display: Add monitor specific edid quirk drm/amd/display: For new fast update path, loop through each surface drm/amd/display: Remove Phantom Pipe Check When Calculating K1 and K2 drm/amd/display: Limit new fast update path to addr and gamma / color drm/amd/display: Fix the delta clamping for shaper LUT drm/amdgpu: Keep non-psp path for partition switch drm/amd/display: program DPP shaper and 3D LUT if updated Revert "drm/amd/display: edp do not add non-edid timings" drm/amdgpu: share drm device for pci amdgpu device with 1st partition device drm/amd/pm: Add GFX v9.4.3 unique id to sysfs drm/amd/pm: Enable pp_feature attribute drm/amdgpu/vcn: Need to unpause dpg before stop dpg ... commit 94e0d43e51ff8577ad273032bb1cacfd68e9297b Merge: 7210de3a328c4 2e178ee13b02d Author: Linus Torvalds Date: Thu Jul 6 22:25:06 2023 -0700 Merge tag 'acpi-6.5-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "These fix a couple of compiler warnings, refine an ACPI device enumeration quirk to address a driver regression and clean up code. Specifics: - Make acpi_companion_match() return a const pointer and update its callers accordingly (Andy Shevchenko) - Move the extern declaration of the acpi_root variable to a header file so as to address a compiler warning (Andy Shevchenko) - Address compiler warnings in the ACPI device enumeration code by adding a missing header file include to it (Ben Dooks) - Refine the SMB0001 quirk in the ACPI device enumeration code so as to address an i2c-scmi driver regression (Andy Shevchenko) - Clean up two pieces of the ACPI device enumeration code (Andy Shevchenko)" * tag 'acpi-6.5-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: scan: Use the acpi_match_acpi_device() helper ACPI: platform: Move SMB0001 HID to the header and reuse ACPI: platform: Ignore SMB0001 only when it has resources ACPI: bus: Introduce acpi_match_acpi_device() helper ACPI: scan: fix undeclared variable warnings by including sleep.h ACPI: bus: Constify acpi_companion_match() returned value ACPI: scan: Move acpi_root to internal header commit 7210de3a328c4df5cb8b25b2ef5703c72d8842e9 Merge: 1793eac148d01 e27cb89a22ada Author: Linus Torvalds Date: Thu Jul 6 22:15:38 2023 -0700 Merge tag 'docs-6.5-2' of git://git.lwn.net/linux Pull mode documentation updates from Jonathan Corbet: "A half-dozen late arriving docs patches. They are mostly fixes, but we also have a kernel-doc tweak for enums and the long-overdue removal of the outdated and redundant patch-submission comments at the top of the MAINTAINERS file" * tag 'docs-6.5-2' of git://git.lwn.net/linux: scripts: kernel-doc: support private / public marking for enums Documentation: KVM: SEV: add a missing backtick Documentation: ACPI: fix typo in ssdt-overlays.rst Fix documentation of panic_on_warn docs: remove the tips on how to submit patches from MAINTAINERS docs: fix typo in zh_TW and zh_CN translation commit 9e9311e04e63ede92be98425efd843f9836336bd Author: Dan Carpenter Date: Mon Jul 3 17:18:08 2023 +0300 KEYS: asymmetric: Fix error codes These error paths should return the appropriate error codes instead of returning success. Fixes: 63ba4d67594a ("KEYS: asymmetric: Use new crypto interface without scatterlists") Signed-off-by: Dan Carpenter Signed-off-by: Herbert Xu commit 1793eac148d0136f9afe877766b9d8f4458fbf21 Merge: 146d7ce3e01cb 879a879c216a4 Author: Linus Torvalds Date: Thu Jul 6 19:24:11 2023 -0700 Merge tag 'spi-fix-v6.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A few mostly minor fixes that came in during the merge window, plus one administrative update for Jonas' e-mail address. The spi-geni-qcom fix is more major than the others, fixing the newly added DMA support for large reads which trigger DMA" * tag 'spi-fix-v6.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: bcm{63xx,bca}-hsspi: update my email address spi: rzv2m-csi: Fix SoC product name spi: bcm-qspi: return error if neither hif_mspi nor mspi is available spi: spi-geni-qcom: enable SPI_CONTROLLER_MUST_TX for GPI DMA mode commit 146d7ce3e01cba1eae25dcdc6d39cec68347962e Merge: 8066178f53089 e9bd04e52d649 Author: Linus Torvalds Date: Thu Jul 6 19:20:23 2023 -0700 Merge tag 'regulator-fix-v6.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fix from Mark Brown: "A simple dependency fix for a newly added driver" * tag 'regulator-fix-v6.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: raa215300: Add build dependency with COMMON_CLK commit 0503efeadbf6bb8bf24397613a73b67e665eac5f Author: Junfeng Guo Date: Thu Jul 6 12:41:28 2023 +0800 gve: Set default duplex configuration to full Current duplex mode was unset in the driver, resulting in the default parameter being set to 0, which corresponds to half duplex. It might mislead users to have incorrect expectation about the driver's transmission capabilities. Set the default duplex configuration to full, as the driver runs in full duplex mode at this point. Fixes: 7e074d5a76ca ("gve: Enable Link Speed Reporting in the driver.") Signed-off-by: Junfeng Guo Reviewed-by: Leon Romanovsky Message-ID: <20230706044128.2726747-1-junfeng.guo@intel.com> Signed-off-by: Jakub Kicinski commit 41b9eff0ce2257958531e7cd38068845da38ac53 Merge: 4863b57bfdb47 479cdfe388a04 Author: Jakub Kicinski Date: Thu Jul 6 19:14:16 2023 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-07-05 (ice) This series contains updates to ice driver only. Sridhar fixes incorrect comparison of max Tx rate limit to occur against each TC value rather than the aggregate. He also resolves an issue with the wrong VSI being used when setting max Tx rate when TCs are enabled. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: Fix tx queue rate limit when TCs are configured ice: Fix max_rate check while configuring TX rate limits ==================== Link: https://lore.kernel.org/r/20230705201346.49370-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 4863b57bfdb471f50c6143fcca24f2b098a9eff1 Merge: 0323bce598eea 7abd955a58fb0 Author: Jakub Kicinski Date: Thu Jul 6 19:11:20 2023 -0700 Merge tag 'mlx5-fixes-2023-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2023-07-05 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2023-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: RX, Fix page_pool page fragment tracking for XDP net/mlx5: Query hca_cap_2 only when supported net/mlx5e: TC, CT: Offload ct clear only once net/mlx5e: Check for NOT_READY flag state after locking net/mlx5: Register a unique thermal zone per device net/mlx5e: RX, Fix flush and close release flow of regular rq for legacy rq net/mlx5e: fix memory leak in mlx5e_ptp_open net/mlx5e: fix memory leak in mlx5e_fs_tt_redirect_any_create net/mlx5e: fix double free in mlx5e_destroy_flow_table ==================== Link: https://lore.kernel.org/r/20230705175757.284614-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 0323bce598eea038714f941ce2b22541c46d488f Author: M A Ramdhan Date: Wed Jul 5 12:15:30 2023 -0400 net/sched: cls_fw: Fix improper refcount update leads to use-after-free In the event of a failure in tcf_change_indev(), fw_set_parms() will immediately return an error after incrementing or decrementing reference counter in tcf_bind_filter(). If attacker can control reference counter to zero and make reference freed, leading to use after free. In order to prevent this, move the point of possible failure above the point where the TC_FW_CLASSID is handled. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: M A Ramdhan Signed-off-by: M A Ramdhan Acked-by: Jamal Hadi Salim Reviewed-by: Pedro Tammela Message-ID: <20230705161530.52003-1-ramdhan@starlabs.sg> Signed-off-by: Jakub Kicinski commit 525c469e5de9bf7e53574396196e80fc716ac9eb Author: Quan Zhou Date: Wed Jul 5 23:26:38 2023 +0800 wifi: mt76: mt7921e: fix init command fail with enabled device For some cases as below, we may encounter the unpreditable chip stats in driver probe() * The system reboot flow do not work properly, such as kernel oops while rebooting, and then the driver do not go back to default status at this moment. * Similar to the flow above. If the device was enabled in BIOS or UEFI, the system may switch to Linux without driver fully shutdown. To avoid the problem, force push the device back to default in probe() * mt7921e_mcu_fw_pmctrl() : return control privilege to chip side. * mt7921_wfsys_reset() : cleanup chip config before resource init. Error log [59007.600714] mt7921e 0000:02:00.0: ASIC revision: 79220010 [59010.889773] mt7921e 0000:02:00.0: Message 00000010 (seq 1) timeout [59010.889786] mt7921e 0000:02:00.0: Failed to get patch semaphore [59014.217839] mt7921e 0000:02:00.0: Message 00000010 (seq 2) timeout [59014.217852] mt7921e 0000:02:00.0: Failed to get patch semaphore [59017.545880] mt7921e 0000:02:00.0: Message 00000010 (seq 3) timeout [59017.545893] mt7921e 0000:02:00.0: Failed to get patch semaphore [59020.874086] mt7921e 0000:02:00.0: Message 00000010 (seq 4) timeout [59020.874099] mt7921e 0000:02:00.0: Failed to get patch semaphore [59024.202019] mt7921e 0000:02:00.0: Message 00000010 (seq 5) timeout [59024.202033] mt7921e 0000:02:00.0: Failed to get patch semaphore [59027.530082] mt7921e 0000:02:00.0: Message 00000010 (seq 6) timeout [59027.530096] mt7921e 0000:02:00.0: Failed to get patch semaphore [59030.857888] mt7921e 0000:02:00.0: Message 00000010 (seq 7) timeout [59030.857904] mt7921e 0000:02:00.0: Failed to get patch semaphore [59034.185946] mt7921e 0000:02:00.0: Message 00000010 (seq 8) timeout [59034.185961] mt7921e 0000:02:00.0: Failed to get patch semaphore [59037.514249] mt7921e 0000:02:00.0: Message 00000010 (seq 9) timeout [59037.514262] mt7921e 0000:02:00.0: Failed to get patch semaphore [59040.842362] mt7921e 0000:02:00.0: Message 00000010 (seq 10) timeout [59040.842375] mt7921e 0000:02:00.0: Failed to get patch semaphore [59040.923845] mt7921e 0000:02:00.0: hardware init failed Cc: stable@vger.kernel.org Fixes: 5c14a5f944b9 ("mt76: mt7921: introduce mt7921e support") Tested-by: Kai-Heng Feng Tested-by: Juan Martinez Co-developed-by: Leon Yen Signed-off-by: Leon Yen Signed-off-by: Quan Zhou Signed-off-by: Deren Wu Message-ID: <39fcb7cee08d4ab940d38d82f21897483212483f.1688569385.git.deren.wu@mediatek.com> Signed-off-by: Jakub Kicinski commit 1ce1a745b3711322424134fe8f3986d7599c6961 Merge: ceb20a3cc5261 c6efb4ae387c7 Author: Jakub Kicinski Date: Thu Jul 6 19:10:25 2023 -0700 Merge branch 'fix-dropping-of-oversize-preemptible-frames-with-felix-dsa-driver' Vladimir Oltean says: ==================== Fix dropping of oversize preemptible frames with felix DSA driver It has been reported that preemptible traffic doesn't completely behave as expected. Namely, large packets should be able to be squeezed (through fragmentation) through taprio time slots smaller than the transmission time of the full frame. That does not happen due to logic in the driver (for oversize frame dropping with taprio) that was not updated in order for this use case to work. I am not sure whether it qualifies as "net" material, because some structural changes are involved, and it is a "never worked" scenario. OTOH, this is a complaint coming from users for a v6.4 kernel. It's up to maintainers to decide whether this series can be considered; I've submitted it as non-RFC in the optimistic case that it will be :) Demo script illustrating the issue below. add_taprio() { local ifname=$1 echo "Creating root taprio" tc qdisc replace dev $ifname handle 8001: parent root stab overhead 24 taprio \ num_tc 8 \ map 0 1 2 3 4 5 6 7 \ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \ base-time 0 \ sched-entry S 01 1216 \ sched-entry S fe 12368 \ fp P E E E E E E E \ flags 0x2 } remove_taprio() { local ifname=$1 echo "Removing taprio" tc qdisc del dev $ifname root } ip netns add ns0 ip link set eno0 netns ns0 && ip -n ns0 link set eno0 up && ip -n ns0 addr add 192.168.100.1/24 dev eno0 ip addr add 192.168.100.2/24 dev swp0 && ip link set swp0 up ip netns exec ns0 ethtool --set-mm eno0 pmac-enabled on verify-enabled off tx-enabled on ethtool --set-mm swp0 pmac-enabled on verify-enabled off tx-enabled on add_taprio swp0 ping 192.168.100.1 -s 1000 -c 5 # sent through TC0 ethtool -I --show-mm swp0 | grep MACMergeFragCountTx # should increase ip addr flush swp0 && ip link set swp0 down remove_taprio swp0 ethtool --set-mm swp0 pmac-enabled off verify-enabled off tx-enabled off ip netns exec ns0 ethtool --set-mm eno0 pmac-enabled off verify-enabled off tx-enabled off ip netns del ns0 ==================== Link: https://lore.kernel.org/r/20230705104422.49025-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit c6efb4ae387c79bf0d4da286108c810b7b40de3c Author: Vladimir Oltean Date: Wed Jul 5 13:44:22 2023 +0300 net: mscc: ocelot: fix oversize frame dropping for preemptible TCs This switch implements Hold/Release in a strange way, with no control from the user as required by IEEE 802.1Q-2018 through Set-And-Hold-MAC and Set-And-Release-MAC, but rather, it emits HOLD requests implicitly based on the schedule. Namely, when the gate of a preemptible TC is about to close (actually QSYS::PREEMPTION_CFG.HOLD_ADVANCE octet times in advance of this event), the QSYS seems to emit a HOLD request pulse towards the MAC which preempts the currently transmitted packet, and further packets are held back in the queue system. This allows large frames to be squeezed through small time slots, because HOLD requests initiated by the gate events result in the frame being segmented in multiple fragments, the bit time of which is equal to the size of the time slot. It has been reported that the vsc9959_tas_guard_bands_update() logic breaks this, because it doesn't take preemptible TCs into account, and enables oversized frame dropping when the time slot doesn't allow a full MTU to be sent, but it does allow 2*minFragSize to be sent (128B). Packets larger than 128B are dropped instead of being sent in multiple fragments. Confusingly, the manual says: | For guard band, SDU calculation of a traffic class of a port, if | preemption is enabled (through 'QSYS::PREEMPTION_CFG.P_QUEUES') then | QSYS::PREEMPTION_CFG.HOLD_ADVANCE is used, otherwise | QSYS::QMAXSDU_CFG_*.QMAXSDU_* is used. but this only refers to the static guard band durations, and the QMAXSDU_CFG_* registers have dual purpose - the other being oversized frame dropping, which takes place irrespective of whether frames are preemptible or express. So, to fix the problem, we need to call vsc9959_tas_guard_bands_update() from ocelot_port_update_active_preemptible_tcs(), and modify the guard band logic to consider a different (lower) oversize limit for preemptible traffic classes. Fixes: 403ffc2c34de ("net: mscc: ocelot: add support for preemptible traffic classes") Signed-off-by: Vladimir Oltean Message-ID: <20230705104422.49025-4-vladimir.oltean@nxp.com> Signed-off-by: Jakub Kicinski commit c60819149b637d0f9f7f66e110d2a0d90a3993ea Author: Vladimir Oltean Date: Wed Jul 5 13:44:21 2023 +0300 net: dsa: felix: make vsc9959_tas_guard_bands_update() visible to ocelot->ops In a future change we will need to make ocelot_port_update_active_preemptible_tcs() call vsc9959_tas_guard_bands_update(), but that is currently not possible, since the ocelot switch lib does not have access to functions private to the DSA wrapper. Move the pointer to vsc9959_tas_guard_bands_update() from felix->info (which is private to the DSA driver) to ocelot->ops (which is also visible to the ocelot switch lib). Signed-off-by: Vladimir Oltean Message-ID: <20230705104422.49025-3-vladimir.oltean@nxp.com> Signed-off-by: Jakub Kicinski commit 009d30f1a77795014f151ba317fcbfc2f17153c6 Author: Vladimir Oltean Date: Wed Jul 5 13:44:20 2023 +0300 net: mscc: ocelot: extend ocelot->fwd_domain_lock to cover ocelot->tas_lock In a future commit we will have to call vsc9959_tas_guard_bands_update() from ocelot_port_update_active_preemptible_tcs(), and that will be impossible due to the AB/BA locking dependencies between ocelot->tas_lock and ocelot->fwd_domain_lock. Just like we did in commit 3ff468ef987e ("net: mscc: ocelot: remove struct ocelot_mm_state :: lock"), the only solution is to expand the scope of ocelot->fwd_domain_lock for it to also serialize changes made to the Time-Aware Shaper, because those will have to result in a recalculation of cut-through TCs, which is something that depends on the forwarding domain. Signed-off-by: Vladimir Oltean Message-ID: <20230705104422.49025-2-vladimir.oltean@nxp.com> Signed-off-by: Jakub Kicinski commit 8066178f530898e4be07406a4c359a2cd14754e8 Merge: 7fdeb23f32d68 fddca7db4a4c1 Author: Linus Torvalds Date: Thu Jul 6 19:07:15 2023 -0700 Merge tag 'trace-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Fix bad git merge of #endif in arm64 code A merge of the arm64 tree caused #endif to go into the wrong place - Fix crash on lseek of write access to tracefs/error_log Opening error_log as write only, and then doing an lseek() causes a kernel panic, because the lseek() handle expects a "seq_file" to exist (which is not done on write only opens). Use tracing_lseek() that tests for this instead of calling the default seq lseek handler. - Check for negative instead of -E2BIG for error on strscpy() returns Instead of testing for -E2BIG from strscpy(), to be more robust, check for less than zero, which will make sure it catches any error that strscpy() may someday return. * tag 'trace-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing/boot: Test strscpy() against less than zero for error arm64: ftrace: fix build error with CONFIG_FUNCTION_GRAPH_TRACER=n tracing: Fix null pointer dereference in tracing_err_log_open() commit 7fdeb23f32d6843c34ad1a4200d04069ff339906 Merge: a452483508d7b 33ab231f83cc1 Author: Linus Torvalds Date: Thu Jul 6 19:01:38 2023 -0700 Merge tag 'v6.5/vfs.fixes.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull vfs fixes from Christian Brauner: "This contains two minor fixes for Jan's rename locking work: - Unlocking the source inode was guarded by a check whether source was non-NULL. This doesn't make sense because source must be non-NULL and the commit message explains in detail why - The lock_two_nondirectories() helper called WARN_ON_ONCE() and dereferenced the inodes unconditionally but the underlying lock_two_inodes() helper and the kernel documentation for that function are clear that it is valid to pass NULL arguments, so a non-NULL check is needed. No callers currently pass NULL arguments but let's not knowingly leave landmines around" * tag 'v6.5/vfs.fixes.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fs: don't assume arguments are non-NULL fs: no need to check source commit 6725f33228077902ddac2a05e0ab361dee36e4ba Merge: bd10668c5c68d 59bba51ec2a50 Author: Dave Airlie Date: Fri Jul 7 11:05:09 2023 +1000 Merge tag 'drm-misc-next-fixes-2023-07-06' of git://anongit.freedesktop.org/drm/drm-misc into drm-next Short summary of fixes pull: * panel: Fix mode on Starry-ili9882t Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230706112203.GA30555@linux-uq9g commit bd10668c5c68d8909526c591b57d75945026f529 Merge: 5874d11c29dbc f6cf3883df471 Author: Dave Airlie Date: Fri Jul 7 10:52:23 2023 +1000 Merge tag 'drm-intel-next-fixes-2023-07-06' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Fix BDW PSR AUX CH data register offsets [psr] (Ville Syrjälä) - Use mock device info for creating mock device (Jani Nikula) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZKZ6VIeInBYrBuph@tursulin-desk commit 5874d11c29dbc2e9f21896c2635d0866e946c049 Merge: 67ebda8cf4a9b 2e54154b9f272 Author: Dave Airlie Date: Fri Jul 7 10:14:26 2023 +1000 Merge tag 'amd-drm-fixes-6.5-2023-06-30-1' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-fixes-6.5-2023-06-30-1: amdgpu: - Misc cleanups - GFX 9.4.3 fixes - DEBUGFS build fix - Fix LPDDR5 reporting - ASPM fixes - DCN 3.1.4 fixes - DP MST fixes - DCN 3.2.x fixes - Display PSR TCON fixes - SMU 13.x fixes - RAS fixes - Vega12/20 SMU fixes - PSP flashing cleanup - GFX9 MCBP fixes - SR-IOV fixes - GPUVM clear mappings fix for always valid BOs - Add FAMS quirk for problematic monitor - Fix possible UAF - Better handle monentary temperature fluctuations - SDMA 4.4.2 fixes - Fencing fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20230630175757.8128-1-alexander.deucher@amd.com commit 67ebda8cf4a9b43036232ca883503a1088c112a6 Merge: d011f0c395c6f 5b7826355e5b9 Author: Dave Airlie Date: Fri Jul 7 09:53:01 2023 +1000 Merge tag 'drm-intel-next-fixes-2023-06-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Allow DC states along with PW2 only for PWB functionality [adlp+] (Imre Deak) - Fix SSC selection for MPLLA [mtl] (Radhakrishna Sripada) - Use hw.adjusted mode when calculating io/fast wake times [psr] (Jouni Högander) - Apply min softlimit correctly [guc/slpc] (Vinay Belgaumkar) - Assign correct hdcp content type [hdcp] (Suraj Kandpal) - Add missing forward declarations/includes to display power headers (Imre Deak) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZJ1WpY+GF9NcsWXp@tursulin-desk commit a452483508d7b70b0f6c69e249ec0b3ea2330b5c Merge: 7b82e90411826 54372cf043276 Author: Linus Torvalds Date: Thu Jul 6 13:18:30 2023 -0700 Merge tag 's390-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull more s390 updates from Alexander Gordeev: - Fix virtual vs physical address confusion in vmem_add_range() and vmem_remove_range() functions - Include instead of and throughout s390 code - Make all PSW related defines also available for assembler files. Remove PSW_DEFAULT_KEY define from uapi for that - When adding an undefined symbol the build still succeeds, but userspace crashes trying to execute VDSO, because the symbol is not resolved. Add undefined symbols check to prevent that - Use kvmalloc_array() instead of kzalloc() for allocaton of 256k memory when executing s390 crypto adapter IOCTL - Add -fPIE flag to prevent decompressor misaligned symbol build error with clang - Use .balign instead of .align everywhere. This is a no-op for s390, but with this there no mix in using .align and .balign anymore - Filter out -mno-pic-data-is-text-relative flag when compiling kernel to prevent VDSO build error - Rework entering of DAT-on mode on CPU restart to use PSW_KERNEL_BITS mask directly - Do not retry administrative requests to some s390 crypto cards, since the firmware assumes replay attacks - Remove most of the debug code, which is build in when kernel config option CONFIG_ZCRYPT_DEBUG is enabled - Remove CONFIG_ZCRYPT_MULTIDEVNODES kernel config option and switch off the multiple devices support for the s390 zcrypt device driver - With the conversion to generic entry machine checks are accounted to the current context instead of irq time. As result, the STCKF instruction at the beginning of the machine check handler and the lowcore member are no longer required, therefore remove it - Fix various typos found with codespell - Minor cleanups to CPU-measurement Counter and Sampling Facilities code - Revert patch that removes VMEM_MAX_PHYS macro, since it causes a regression * tag 's390-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (25 commits) Revert "s390/mm: get rid of VMEM_MAX_PHYS macro" s390/cpum_sf: remove check on CPU being online s390/cpum_sf: handle casts consistently s390/cpum_sf: remove unnecessary debug statement s390/cpum_sf: remove parameter in call to pr_err s390/cpum_sf: simplify function setup_pmu_cpu s390/cpum_cf: remove unneeded debug statements s390/entry: remove mcck clock s390: fix various typos s390/zcrypt: remove ZCRYPT_MULTIDEVNODES kernel config option s390/zcrypt: do not retry administrative requests s390/zcrypt: cleanup some debug code s390/entry: rework entering DAT-on mode on CPU restart s390/mm: fence off VM macros from asm and linker s390: include linux/io.h instead of asm/io.h s390/ptrace: make all psw related defines also available for asm s390/ptrace: remove PSW_DEFAULT_KEY from uapi s390/vdso: filter out mno-pic-data-is-text-relative cflag s390: consistently use .balign instead of .align s390/decompressor: fix misaligned symbol build error ... commit 6537ed3904a3b3720e5e238dd5d542448fcf94c2 Author: Guenter Roeck Date: Tue Jul 4 08:00:31 2023 -0700 i2c: mpc: Drop unused variable Fix the following build error. Error log: drivers/i2c/busses/i2c-mpc.c: In function 'mpc_i2c_setup_512x': drivers/i2c/busses/i2c-mpc.c:310:20: error: unused variable 'pval' Fixes: 9d178e00583e ("i2c: mpc: Use of_property_read_reg() to parse "reg"") Signed-off-by: Guenter Roeck Signed-off-by: Wolfram Sang commit 05f933d5f7318b03ff2028c1704dc867ac16f2c7 Author: Christophe JAILLET Date: Tue Jul 4 21:50:28 2023 +0200 i2c: nomadik: Remove a useless call in the remove function Since commit 235602146ec9 ("i2c-nomadik: turn the platform driver to an amba driver"), there is no more request_mem_region() call in this driver. So remove the release_mem_region() call from the remove function which is likely a left over. Fixes: 235602146ec9 ("i2c-nomadik: turn the platform driver to an amba driver") Cc: # v3.6+ Acked-by: Linus Walleij Reviewed-by: Andi Shyti Signed-off-by: Christophe JAILLET Signed-off-by: Wolfram Sang commit cb6e45c9a0ad9e0f8664fd06db0227d185dc76ab Author: Robert Hancock Date: Tue Jun 6 12:25:58 2023 -0600 i2c: xiic: Don't try to handle more interrupt events after error In xiic_process, it is possible that error events such as arbitration lost or TX error can be raised in conjunction with other interrupt flags such as TX FIFO empty or bus not busy. Error events result in the controller being reset and the error returned to the calling request, but the function could potentially try to keep handling the other events, such as by writing more messages into the TX FIFO. Since the transaction has already failed, this is not helpful and will just cause issues. This problem has been present ever since: commit 7f9906bd7f72 ("i2c: xiic: Service all interrupts in isr") which allowed non-error events to be handled after errors, but became more obvious after: commit 743e227a8959 ("i2c: xiic: Defer xiic_wakeup() and __xiic_start_xfer() in xiic_process()") which reworked the code to add a WARN_ON which triggers if both the xfer_more and wakeup_req flags were set, since this combination is not supposed to happen, but was occurring in this scenario. Skip further interrupt handling after error flags are detected to avoid this problem. Fixes: 7f9906bd7f72 ("i2c: xiic: Service all interrupts in isr") Signed-off-by: Robert Hancock Acked-by: Andi Shyti Signed-off-by: Wolfram Sang commit 3f069c4c643225f2b96b4b3f8c30e4445f079d2e Author: John Johansen Date: Wed Jun 21 02:04:58 2023 -0700 apparmor: Fix kernel-doc header for verify_dfa_accept_index Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306141934.UKmM9bFX-lkp@intel.com/ Signed-off-by: John Johansen commit ec6851ae0ab4587e610e260ddda75f92f3389f91 Author: John Johansen Date: Sat Apr 15 00:50:32 2023 -0700 apparmor: fix: kzalloc perms tables for shared dfas Currently the permstables of the shared dfas are not shared, and need to be allocated and copied. In the future this should be addressed with a larger rework on dfa and pdb ref counts and structure sharing. BugLink: http://bugs.launchpad.net/bugs/2017903 Fixes: 217af7e2f4de ("apparmor: refactor profile rules and attachments") Cc: stable@vger.kernel.org Signed-off-by: John Johansen Reviewed-by: Jon Tourville commit 6f442d42c0d89876994a4a135eadf82b0e6ff6e4 Author: John Johansen Date: Mon Apr 17 02:57:55 2023 -0700 apparmor: fix profile verification and enable it The transition table size was not being set by compat mappings resulting in the profile verification code not being run. Unfortunately the checks were also buggy not being correctly updated from the old accept perms, to the new layout. Also indicate to userspace that the kernel has the permstable verification fixes. BugLink: http://bugs.launchpad.net/bugs/2017903 Fixes: 670f31774ab6 ("apparmor: verify permission table indexes") Signed-off-by: John Johansen Reviewed-by: Jon Tourville commit 0bac2002b397fda7c9ea81ee0b06a02242958107 Author: John Johansen Date: Fri Mar 10 15:59:45 2023 -0800 apparmor: fix policy_compat permission remap with extended permissions If the extended permission table is present we should not be attempting to do a compat_permission remap as the compat_permissions are not stored in the dfa accept states. Fixes: fd1b2b95a211 ("apparmor: add the ability for policy to specify a permission table") Signed-off-by: John Johansen Reviewed-by: Jon Tourville commit ba808cb5edfdf032db9e849e194d28169b6efbcd Author: Kees Cook Date: Thu May 11 14:34:45 2023 -0700 apparmor: aa_buffer: Convert 1-element array to flexible array In the ongoing effort to convert all fake flexible arrays to proper flexible arrays, replace aa_buffer's 1-element "buffer" member with a flexible array. Signed-off-by: Kees Cook Signed-off-by: John Johansen commit 6600e9f692e36e265ef0828f08337fa294bb330f Author: John Johansen Date: Fri Apr 14 00:24:47 2023 -0700 apparmor: add missing failure check in compute_xmatch_perms Add check for failure to allocate the permission table. Fixes: caa9f579ca72 ("apparmor: isolate policy backwards compatibility to its own file") Signed-off-by: John Johansen commit 000518bc5aef25d3f703592a0296d578c98b1517 Author: Danila Chernetsov Date: Tue Apr 4 19:05:49 2023 +0000 apparmor: fix missing error check for rhashtable_insert_fast rhashtable_insert_fast() could return err value when memory allocation is failed. but unpack_profile() do not check values and this always returns success value. This patch just adds error check code. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: e025be0f26d5 ("apparmor: support querying extended trusted helper extra data") Signed-off-by: Danila Chernetsov Signed-off-by: John Johansen commit 6d7467957ecdc9018fb860bb60738e997abeaecb Author: Markus Elfring Date: Wed Mar 29 11:50:44 2023 +0200 apparmor: Return directly after a failed kzalloc() in two functions 1. Return directly after a call of the function “kzalloc” failed at the beginning in these function implementations. 2. Omit extra initialisations (for a few local variables) which became unnecessary with this refactoring. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: John Johansen commit 755a22c74345a7b4c18dbb86f553eeb7895a97c9 Author: Yang Li Date: Fri Mar 3 09:28:33 2023 +0800 AppArmor: Fix some kernel-doc comments Make the description of @table to @strs in function unpack_trans_table() to silence the warnings: security/apparmor/policy_unpack.c:456: warning: Function parameter or member 'strs' not described in 'unpack_trans_table' security/apparmor/policy_unpack.c:456: warning: Excess function parameter 'table' description in 'unpack_trans_table' Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4332 Signed-off-by: Yang Li Signed-off-by: John Johansen commit b54aebd4411134b525a82d663a26b2f135ecb7e8 Author: Rae Moar Date: Fri Jan 27 20:12:19 2023 +0000 apparmor: fix use of strcpy in policy_unpack_test Replace the use of strcpy() in build_aa_ext_struct() in policy_unpack_test.c with strscpy(). strscpy() is the safer method to use to ensure the buffer does not overflow. This was found by kernel test robot: https://lore.kernel.org/all/202301040348.NbfVsXO0-lkp@intel.com/. Reported-by: kernel test robot Signed-off-by: Rae Moar Signed-off-by: John Johansen commit e8605e8fdf42642048b7e59141deaf8e4cf06d71 Merge: a2492ca86c98f 8500808a991f0 Author: Palmer Dabbelt Date: Thu Jul 6 10:32:08 2023 -0700 Merge patch series "riscv: some CMO alternative related clean up" These cleanups came up as part of the discussion on the "riscv: Reduce ARCH_KMALLOC_MINALIGN to 8" patch set, but that needs additional work and thus will be delayed at least a cycle. * b4-shazam-merge: riscv: mm: mark noncoherent_supported as __ro_after_init riscv: mm: mark CBO relate initialization funcs as __init riscv: errata: thead: only set cbom size & noncoherent during boot Link: https://lore.kernel.org/linux-riscv/20230526165958.908-1-jszhang@kernel.org/ Link: https://lore.kernel.org/r/20230614165504.532-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 8500808a991f0e569b3d835a6223848c0717a6c7 Author: Jisheng Zhang Date: Thu Jun 15 00:55:04 2023 +0800 riscv: mm: mark noncoherent_supported as __ro_after_init The noncoherent_supported indicates whether the HW is coherent or not, it won't change after booting, mark it as __ro_after_init. Signed-off-by: Jisheng Zhang Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230614165504.532-4-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 3b472f860c5c73244a9b951c10c289cc9ee080f3 Author: Jisheng Zhang Date: Thu Jun 15 00:55:03 2023 +0800 riscv: mm: mark CBO relate initialization funcs as __init The two functions cbo_get_block_size() and riscv_init_cbo_blocksizes() are only called during booting, mark them as __init. Signed-off-by: Jisheng Zhang Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230614165504.532-3-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 31ca5d49264ba6197aa48a926f6a035ed08b3715 Author: Jisheng Zhang Date: Thu Jun 15 00:55:02 2023 +0800 riscv: errata: thead: only set cbom size & noncoherent during boot The CBOM size and whether the HW is noncoherent is known and determined during booting and won't change after that. Signed-off-by: Jisheng Zhang Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230614165504.532-2-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit a2492ca86c98f676561f7d318b1e2e1786af0caf Author: Samuel Holland Date: Fri Jun 23 23:03:20 2023 -0700 riscv: Select HAVE_ARCH_USERFAULTFD_MINOR This allocates the VM flag needed to support the userfaultfd minor fault functionality. Because the flag bit is >= bit 32, it can only be enabled for 64-bit kernels. See commit 7677f7fd8be7 ("userfaultfd: add minor fault registration mode") for more information. Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20230624060321.3401504-1-samuel.holland@sifive.com Signed-off-by: Palmer Dabbelt commit 5177978ee074d55577aabad7c42b431e8af68fcc Author: Palmer Dabbelt Date: Wed Jun 28 20:17:05 2023 -0700 RISC-V: Document the ISA string parsing rules for ACPI We've had a ton of issues around the ISA string parsing rules elsewhere in RISC-V, so let's at least be clear about what the rules are so we can try and avoid more issues. Link: https://lore.kernel.org/r/CAK9=C2Vy-4V9kgnga98tiC3TeHkR2LFPakyBbS8s_h3_Z=ieyQ@mail.gmail.com/ Link: https://lore.kernel.org/r/20230629031705.15575-1-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit 2e178ee13b02d95c7380f6a21149de535ccdfc7f Merge: b5539eb5ee702 86fca926c0421 59e8d4bb8d485 Author: Rafael J. Wysocki Date: Thu Jul 6 19:24:06 2023 +0200 Merge branches 'acpi-bus' and 'acpi-scan' Merge additional ACPI device enumeration code changes for 6.5-rc1. - Make acpi_companion_match() return a const pointer and update its callers accordingly (Andy Shevchenko). - Move the extern declaration of the acpi_root variable to a header file so as to address a compiler warning (Andy Shevchenko). - Address compiler warnings in the ACPI device enumeration code by adding a missing header file include to it (Ben Dooks). - Refine the SMB0001 quirk in the ACPI device enumeration code so as to address an i2c-scmi driver regression (Andy Shevchenko). - Clean up two pieces of the ACPI device enumeration code (Andy Shevchenko). * acpi-bus: ACPI: bus: Constify acpi_companion_match() returned value * acpi-scan: ACPI: scan: Use the acpi_match_acpi_device() helper ACPI: platform: Move SMB0001 HID to the header and reuse ACPI: platform: Ignore SMB0001 only when it has resources ACPI: bus: Introduce acpi_match_acpi_device() helper ACPI: scan: fix undeclared variable warnings by including sleep.h ACPI: scan: Move acpi_root to internal header commit 7b82e90411826deee07c180ec35f64d31051d154 Merge: 9f57c13f7ed70 4dd595c34c4bb Author: Linus Torvalds Date: Thu Jul 6 10:06:04 2023 -0700 Merge tag 'asm-generic-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic updates from Arnd Bergmann: "These are cleanups for architecture specific header files: - the comments in include/linux/syscalls.h have gone out of sync and are really pointless, so these get removed - The asm/bitsperlong.h header no longer needs to be architecture specific on modern compilers, so use a generic version for newer architectures that use new enough userspace compilers - A cleanup for virt_to_pfn/virt_to_bus to have proper type checking, forcing the use of pointers" * tag 'asm-generic-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: syscalls: Remove file path comments from headers tools arch: Remove uapi bitsperlong.h of hexagon and microblaze asm-generic: Unify uapi bitsperlong.h for arm64, riscv and loongarch m68k/mm: Make pfn accessors static inlines arm64: memory: Make virt_to_pfn() a static inline ARM: mm: Make virt_to_pfn() a static inline asm-generic/page.h: Make pfn accessors static inlines xen/netback: Pass (void *) to virt_to_page() netfs: Pass a pointer to virt_to_page() cifs: Pass a pointer to virt_to_page() in cifsglob cifs: Pass a pointer to virt_to_page() riscv: mm: init: Pass a pointer to virt_to_page() ARC: init: Pass a pointer to virt_to_pfn() in init m68k: Pass a pointer to virt_to_pfn() virt_to_page() fs/proc/kcore.c: Pass a pointer to virt_addr_valid() commit 9f57c13f7ed70a94ecc135645bc764efdd378acd Merge: 0b907305022be 6722e46513e0a Author: Linus Torvalds Date: Thu Jul 6 09:56:53 2023 -0700 Merge tag 'soc-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull SoC fixes from Arnd Bergmann: "There are three small fixes that came up sincie the past week: - an incorrect bit offset in ixp4xx bus driver - a riscv randconfig regression in the thead platform I merged - whitespace fixes for some dts files" * tag 'soc-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: bus: ixp4xx: fix IXP4XX_EXP_T1_MASK ARM: dts: st: add missing space before { RISC-V: make ARCH_THEAD preclude XIP_KERNEL commit 0b907305022beb1a4cf5b9f6d776483a2356c841 Merge: c91e587be8e26 907514a7dc4c5 Author: Linus Torvalds Date: Thu Jul 6 09:48:31 2023 -0700 Merge tag 'dmaengine-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine updates from Vinod Koul: "New support: - TI J721S2 CSI BCDMA support Updates: - Native HDMI support for dw edma driver - ste dma40 updates for supporting proper SRAM handle in DT - removal of dma device chancnt setting in drivers" * tag 'dmaengine-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (28 commits) dmaengine: sprd: Don't set chancnt dmaengine: hidma: Don't set chancnt dmaengine: plx_dma: Don't set chancnt dmaengine: axi-dmac: Don't set chancnt dmaengine: dw-axi-dmac: Don't set chancnt dmaengine: qcom: bam_dma: allow omitting num-{channels,ees} dmaengine: dw-edma: Add HDMA DebugFS support dmaengine: dw-edma: Add support for native HDMA dmaengine: dw-edma: Create a new dw_edma_core_ops structure to abstract controller operation dmaengine: dw-edma: Rename dw_edma_core_ops structure to dw_edma_plat_ops dmaengine: ste_dma40: use proper format string for resource_size_t dmaengine: make QCOM_HIDMA depend on HAS_IOMEM dmaengine: ste_dma40: fix typo in enum documentation dmaengine: ste_dma40: use correct print specfier for resource_size_t MAINTAINERS: Add myself as the DW eDMA driver reviewer MAINTAINERS: Add Manivannan to DW eDMA driver maintainers list MAINTAINERS: Demote Gustavo Pimentel to DW EDMA driver reviewer dmaengine: ti: k3-udma: Add support for J721S2 CSI BCDMA instance dt-bindings: dma: ti: Add J721S2 BCDMA dmaengine: ti: k3-psil-j721s2: Add PSI-L thread map for main CPSW2G ... commit c91e587be8e2680786cbf0b87fa7ae92c345857f Merge: c17414a273b81 009637de1f65c Author: Linus Torvalds Date: Thu Jul 6 09:44:33 2023 -0700 Merge tag 'linux-watchdog-6.5-rc1' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog updates from Wim Van Sebroeck: - add Xilinx Versal watchdog - support Hygon FCH/SCH (Server Controller Hub) - convert GPL notices to SPDX identifiers - other improvements * tag 'linux-watchdog-6.5-rc1' of git://www.linux-watchdog.org/linux-watchdog: watchdog: sp5100_tco: support Hygon FCH/SCH (Server Controller Hub) dt-bindings: watchdog: restrict node name suffixes MAINTAINERS: Add support for Xilinx versal watchdog watchdog: xilinx_wwdt: Add Versal window watchdog support dt-bindings: watchdog: xlnx,versal-wwdt: Add versal watchdog watchdog: ziirave_wdt: Switch i2c driver back to use .probe() watchdog: ibmasr: Replace GPL license notice with SPDX identifier watchdog: Convert GPL 2.0 notice to SPDX identifier watchdog: loongson1_wdt: Add DT support commit 89dbb335cb6a627a4067bc42caa09c8bc3326d40 Author: Takashi Iwai Date: Thu Jul 6 17:53:57 2023 +0200 ALSA: jack: Fix mutex call in snd_jack_report() snd_jack_report() is supposed to be callable from an IRQ context, too, and it's indeed used in that way from virtsnd driver. The fix for input_dev race in commit 1b6a6fc5280e ("ALSA: jack: Access input_dev under mutex"), however, introduced a mutex lock in snd_jack_report(), and this resulted in a potential sleep-in-atomic. For addressing that problem, this patch changes the relevant code to use the object get/put and removes the mutex usage. That is, snd_jack_report(), it takes input_get_device() and leaves with input_put_device() for assuring the input_dev being assigned. Although the whole mutex could be reduced, we keep it because it can be still a protection for potential races between creation and deletion. Fixes: 1b6a6fc5280e ("ALSA: jack: Access input_dev under mutex") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/cf95f7fe-a748-4990-8378-000491b40329@moroto.mountain Tested-by: Amadeusz Sławiński Cc: Link: https://lore.kernel.org/r/20230706155357.3470-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 980d97efdb30b8baa74b61fec086becb3aedbb90 Merge: e231cd833f646 f09b6e9679605 Author: Mark Brown Date: Thu Jul 6 16:03:07 2023 +0100 ASoC/soundwire/qdsp6/wcd: fix leaks and probe deferral Merge series from Johan Hovold : I've been hitting a race during boot which breaks probe of the sound card on the Lenovo ThinkPad X13s as I've previously reported here: https://lore.kernel.org/all/ZIHMMFtuDtvdpFAZ@hovoldconsulting.com/ The immediate issue appeared to be a probe deferral that was turned into a hard failure, but addressing that in itself only made things worse as it exposed further bugs. I was hoping someone more familiar with the code in question would look into this, but as this affects users of the X13s and breaks audio on my machine every fifth boot or so, I decided to investigate it myself. As expected, the Qualcomm codec drivers are broken and specifically leak resources on component remove, which in turn breaks sound card probe deferrals. The source of the deferral itself appears to be legitimate and was simply due to some audio component not yet having been registered due to random changes in timing during boot. These issues can most easily be reproduced by simply blacklisting the q6apm_dai module and loading it manually after boot. Included are also two patches that suppresses error messages on component probe deferral to avoid spamming the logs during boot. commit 00ae1491f970acc454be0df63f50942d94825860 Author: Dan Carpenter Date: Thu Jul 6 15:37:51 2023 +0300 dma-buf: fix an error pointer vs NULL bug Smatch detected potential error pointer dereference. drivers/gpu/drm/drm_syncobj.c:888 drm_syncobj_transfer_to_timeline() error: 'fence' dereferencing possible ERR_PTR() The error pointer comes from dma_fence_allocate_private_stub(). One caller expected error pointers and one expected NULL pointers. Change it to return NULL and update the caller which expected error pointers, drm_syncobj_assign_null_handle(), to check for NULL instead. Fixes: f781f661e8c9 ("dma-buf: keep the signaling time of merged fences v3") Signed-off-by: Dan Carpenter Reviewed-by: Christian König Reviewed-by: Sumit Semwal Signed-off-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/msgid/b09f1996-3838-4fa2-9193-832b68262e43@moroto.mountain commit e231cd833f6463e9a1d54acae9614b513c74d45e Author: Geert Uytterhoeven Date: Thu Jul 6 13:42:04 2023 +0200 ASoC: codecs: SND_SOC_WCD934X should select REGMAP_IRQ If CONFIG_SND_SOC_WCD934X=y, CONFIG_COMPILE_TEST=y, CONFIG_MFD_WCD934X=n, CONFIG_REGMAP_IRQ=n: aarch64-linux-gnu-ld: sound/soc/codecs/wcd934x.o: in function `wcd934x_codec_probe': wcd934x.c:(.text+0x33cc): undefined reference to `regmap_irq_get_virq' aarch64-linux-gnu-ld: sound/soc/codecs/wcd934x.o: in function `wcd934x_comp_probe': wcd934x.c:(.text+0x4cb0): undefined reference to `regmap_irq_get_virq' aarch64-linux-gnu-ld: wcd934x.c:(.text+0x4cc0): undefined reference to `regmap_irq_get_virq' aarch64-linux-gnu-ld: wcd934x.c:(.text+0x4cd0): undefined reference to `regmap_irq_get_virq' aarch64-linux-gnu-ld: wcd934x.c:(.text+0x4ce0): undefined reference to `regmap_irq_get_virq' aarch64-linux-gnu-ld: sound/soc/codecs/wcd934x.o:wcd934x.c:(.text+0x4cf0): more undefined references to `regmap_irq_get_virq' follow Fix this by making SND_SOC_WCD934X select REGMAP_IRQ. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/cafd878747e7951914a7d9fea33788a4a230d1f0.1688643442.git.geert@linux-m68k.org Signed-off-by: Mark Brown commit c1be62923d4d86e7c06b1224626e27eb8d9ab32e Author: Srinivas Kandagatla Date: Wed Jul 5 14:18:42 2023 +0100 ASoC: qcom: q6apm: do not close GPR port before closing graph Closing GPR port before graph close can result in un handled notifications from DSP, this results in spam of errors from GPR driver as there is no one to handle these notification at that point in time. Fix this by closing GPR port after graph close is finished. Fixes: 5477518b8a0e ("ASoC: qdsp6: audioreach: add q6apm support") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230705131842.41584-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit f09b6e96796056633453cb0d07b720d09f1efc68 Author: Johan Hovold Date: Wed Jul 5 14:30:18 2023 +0200 ASoC: core: suppress probe deferral errors Suppress probe deferral error messages when probing link components to avoid spamming the logs, for example, if a required component has not yet been registered: snd-sc8280xp sound: ASoC: failed to instantiate card -517 Note that dev_err_probe() is not used as the card can be unbound and rebound while the underlying platform device remains bound to its driver. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20230705123018.30903-9-johan+linaro@kernel.org Signed-off-by: Mark Brown commit b6c3bdda3a7e43acfcec711ce20e7cfe44744740 Author: Johan Hovold Date: Wed Jul 5 14:30:17 2023 +0200 ASoC: topology: suppress probe deferral errors Suppress probe deferral error messages when loading topologies and creating frontend links to avoid spamming the logs when a component has not yet been registered: snd-sc8280xp sound: ASoC: adding FE link failed snd-sc8280xp sound: ASoC: topology: could not load header: -517 Note that dev_err_probe() is not used as the topology component can be probed and removed while the underlying platform device remains bound to its driver. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20230705123018.30903-8-johan+linaro@kernel.org Signed-off-by: Mark Brown commit a5475829adcc600bc69ee9ff7c9e3e43fb4f8d30 Author: Johan Hovold Date: Wed Jul 5 14:30:16 2023 +0200 ASoC: codecs: wcd-mbhc-v2: fix resource leaks on component remove The MBHC resources must be released on component probe failure and removal so can not be tied to the lifetime of the component device. This is specifically needed to allow probe deferrals of the sound card which otherwise fails when reprobing the codec component: snd-sc8280xp sound: ASoC: failed to instantiate card -517 genirq: Flags mismatch irq 299. 00002001 (mbhc sw intr) vs. 00002001 (mbhc sw intr) wcd938x_codec audio-codec: Failed to request mbhc interrupts -16 wcd938x_codec audio-codec: mbhc initialization failed wcd938x_codec audio-codec: ASoC: error at snd_soc_component_probe on audio-codec: -16 snd-sc8280xp sound: ASoC: failed to instantiate card -16 Fixes: 0e5c9e7ff899 ("ASoC: codecs: wcd: add multi button Headset detection support") Cc: stable@vger.kernel.org # 5.14 Cc: Srinivas Kandagatla Signed-off-by: Johan Hovold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230705123018.30903-7-johan+linaro@kernel.org Signed-off-by: Mark Brown commit 798590cc7d3c2b5f3a7548d96dd4d8a081c1bc39 Author: Johan Hovold Date: Wed Jul 5 14:30:15 2023 +0200 ASoC: codecs: wcd934x: fix resource leaks on component remove Make sure to release allocated MBHC resources also on component remove. This is specifically needed to allow probe deferrals of the sound card which otherwise fails when reprobing the codec component. Fixes: 9fb9b1690f0b ("ASoC: codecs: wcd934x: add mbhc support") Cc: stable@vger.kernel.org # 5.14 Cc: Srinivas Kandagatla Signed-off-by: Johan Hovold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230705123018.30903-6-johan+linaro@kernel.org Signed-off-by: Mark Brown commit a3406f87775fee986876e03f93a84385f54d5999 Author: Johan Hovold Date: Wed Jul 5 14:30:14 2023 +0200 ASoC: codecs: wcd938x: fix resource leaks on component remove Make sure to release allocated resources on component probe failure and on remove. This is specifically needed to allow probe deferrals of the sound card which otherwise fails when reprobing the codec component: snd-sc8280xp sound: ASoC: failed to instantiate card -517 genirq: Flags mismatch irq 289. 00002001 (HPHR PDM WD INT) vs. 00002001 (HPHR PDM WD INT) wcd938x_codec audio-codec: Failed to request HPHR WD interrupt (-16) genirq: Flags mismatch irq 290. 00002001 (HPHL PDM WD INT) vs. 00002001 (HPHL PDM WD INT) wcd938x_codec audio-codec: Failed to request HPHL WD interrupt (-16) genirq: Flags mismatch irq 291. 00002001 (AUX PDM WD INT) vs. 00002001 (AUX PDM WD INT) wcd938x_codec audio-codec: Failed to request Aux WD interrupt (-16) genirq: Flags mismatch irq 292. 00002001 (mbhc sw intr) vs. 00002001 (mbhc sw intr) wcd938x_codec audio-codec: Failed to request mbhc interrupts -16 Fixes: 8d78602aa87a ("ASoC: codecs: wcd938x: add basic driver") Cc: stable@vger.kernel.org # 5.14 Cc: Srinivas Kandagatla Signed-off-by: Johan Hovold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230705123018.30903-5-johan+linaro@kernel.org Signed-off-by: Mark Brown commit ed0dd9205bf69593edb495cb4b086dbae96a3f05 Author: Johan Hovold Date: Wed Jul 5 14:30:13 2023 +0200 ASoC: codecs: wcd938x: fix missing clsh ctrl error handling Allocation of the clash control structure may fail so add the missing error handling to avoid dereferencing an error pointer. Fixes: 8d78602aa87a ("ASoC: codecs: wcd938x: add basic driver") Cc: stable@vger.kernel.org # 5.14 Cc: Srinivas Kandagatla Signed-off-by: Johan Hovold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230705123018.30903-4-johan+linaro@kernel.org Signed-off-by: Mark Brown commit 46ec420573cefa1fc98025e7e6841bdafd6f1e20 Author: Johan Hovold Date: Wed Jul 5 14:30:12 2023 +0200 ASoC: qdsp6: audioreach: fix topology probe deferral Propagate errors when failing to load the topology component so that probe deferrals can be handled. Fixes: 36ad9bf1d93d ("ASoC: qdsp6: audioreach: add topology support") Cc: stable@vger.kernel.org # 5.17 Cc: Srinivas Kandagatla Signed-off-by: Johan Hovold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230705123018.30903-3-johan+linaro@kernel.org Signed-off-by: Mark Brown commit 826eeaf68b03e5b96bdbc11e3e796f8b562bc0e3 Author: Krzysztof Kozlowski Date: Wed Jul 5 16:57:24 2023 +0200 MIPS: dts: add missing space before { Add missing whitespace between node name/label and opening {. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Thomas Bogendoerfer commit 2500df55a615f2f177bacf1a261f927790a137db Author: Keguang Zhang Date: Thu May 11 20:11:58 2023 +0800 dt-bindings: watchdog: Add Loongson-1 watchdog Add devicetree binding document for Loongson-1 watchdog. Signed-off-by: Keguang Zhang Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lkml.kernel.org/r/20230511121159.463645-2-keguang.zhang@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit ceb20a3cc52611cb84d164f03e466f64b4ed9fb4 Merge: 21327f81db633 caf3ef7468f75 Author: Paolo Abeni Date: Thu Jul 6 11:02:57 2023 +0200 Merge tag 'nf-23-07-06' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Fix missing overflow use refcount checks in nf_tables. 2) Do not set IPS_ASSURED for IPS_NAT_CLASH entries in GRE tracker, from Florian Westphal. 3) Bail out if nf_ct_helper_hash is NULL before registering helper, from Florent Revest. 4) Use siphash() instead siphash_4u64() to fix performance regression, also from Florian. 5) Do not allow to add rules to removed chains via ID, from Thadeu Lima de Souza Cascardo. 6) Fix oob read access in byteorder expression, also from Thadeu. netfilter pull request 23-07-06 ==================== Link: https://lore.kernel.org/r/20230705230406.52201-1-pablo@netfilter.org Signed-off-by: Paolo Abeni commit 21327f81db6337c8843ce755b01523c7d3df715b Author: Klaus Kudielka Date: Wed Jul 5 07:37:12 2023 +0200 net: mvneta: fix txq_map in case of txq_number==1 If we boot with mvneta.txq_number=1, the txq_map is set incorrectly: MVNETA_CPU_TXQ_ACCESS(1) refers to TX queue 1, but only TX queue 0 is initialized. Fix this. Fixes: 50bf8cb6fc9c ("net: mvneta: Configure XPS support") Signed-off-by: Klaus Kudielka Reviewed-by: Michal Kubiak Link: https://lore.kernel.org/r/20230705053712.3914-1-klaus.kudielka@gmail.com Signed-off-by: Paolo Abeni commit d011f0c395c6f59ae3d494b1beec0d101eab1115 Merge: 5ff2977b19769 861c249cd782c Author: Dave Airlie Date: Thu Jul 6 18:01:47 2023 +1000 Merge tag 'drm-misc-next-fixes-2023-06-29' of git://anongit.freedesktop.org/drm/drm-misc into drm-next Short summary of fixes pull: * fbdev: Fix module infos on sparc Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230629113814.GA10448@linux-uq9g commit c17414a273b81fe4e34e11d69fc30cc8b1431614 Merge: 7afb9d76bc513 7497840d462c8 Author: Linus Torvalds Date: Wed Jul 5 21:45:32 2023 -0700 Merge tag 'sh-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux Pull sh updates from Adrian Glaubitz: "Fix a compiler warning in the J2 probing code and a fix by Sergey Shtylyov to avoid using IRQ0 on SH3 and SH4 targets. Masahiro Yamada made some clean-up in the build system to address reports by the 0day bot. The most notable changes come from Artur Rojek who addressed a number of issues in the DMA code, in particular a fix for the DMA channel offset calculation that was introduced in in 7f47c7189b3e ("sh: dma: More legacy cpu dma chainsawing.") in 2012! Together with another change to correct the number of DMA channels for each SuperH SoC according to specification, Artur's series unbreaks the kernel on the SH7709 SoC allowing Linux to boot on the HP Jornada 680 handheld again. Summary: - Provide unxlate_dev_mem_ptr() in asm/io.h - dma: Correct the number of DMA channels for SH7709 - dma: Drop incorrect SH_DMAC_BASE1 definition for SH4 - dma: Fix DMA channel offset calculation - Remove compiler flag duplication - Refactor header include path addition - Move build rule for cchips/hd6446x/ to arch/sh/Kbuild - Fix -Wmissing-include-dirs warnings for various platforms - Avoid using IRQ0 on SH3 and SH4 - j2: Use ioremap() to translate device tree address into kernel memory" * tag 'sh-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux: sh: Provide unxlate_dev_mem_ptr() in asm/io.h sh: dma: Correct the number of DMA channels for SH7709 sh: dma: Drop incorrect SH_DMAC_BASE1 definition for SH4 sh: dma: Fix DMA channel offset calculation sh: Remove compiler flag duplication sh: Refactor header include path addition sh: Move build rule for cchips/hd6446x/ to arch/sh/Kbuild sh: Fix -Wmissing-include-dirs warnings for various platforms sh: Avoid using IRQ0 on SH3 and SH4 sh: j2: Use ioremap() to translate device tree address into kernel memory commit 7afb9d76bc513cb8a2409092dbd3610524a198fe Merge: 6843306689aff a454850a815e6 Author: Linus Torvalds Date: Wed Jul 5 21:38:13 2023 -0700 Merge tag 'phy-for-6.5_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy Pull phy updates from Vinod Koul: "New Support: - Debugfs support for phy core and mediatek driver - Hisilicon inno-usb2-phy driver supporting Hi3798MV100 - Qualcomm SGMII SerDes PHY driver, SM6115 & QCM2290 QMP-USB support, SA8775P USB PHY & USB3 UNI support, QUSB2 support for IPQ9574, IPQ9574 USB3 PHY UpdatesL - Sparx5 serdes phy power optimzation - cadence salvo usb properties and updates and torrent DP with PCIe & USB support - Yaml conversion for Broadcom kona USB bindings and MXS USB binding" * tag 'phy-for-6.5_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (67 commits) dt-bindings: phy: brcm,brcmstb-usb-phy: Fix error in "compatible" conditional schema dt-bindings: phy: mixel,mipi-dsi-phy: Remove assigned-clock* properties dt-bindings: phy: intel,combo-phy: restrict node name suffixes dt-bindings: phy: qcom,usb-hs-phy: Add compatible phy: tegra: xusb: check return value of devm_kzalloc() phy: qcom: qmp-combo: fix Display Port PHY configuration for SM8550 phy: qcom: add the SGMII SerDes PHY driver dt-bindings: phy: describe the Qualcomm SGMII PHY phy: qualcomm: fix indentation in Makefile phy: usb: suppress OC condition for 7439b2 phy: usb: Turn off phy when port is in suspend phy: tegra: xusb: Clear the driver reference in usb-phy dev dt-bindings: phy: mxs-usb-phy: add imx8ulp and imx8qm compatible dt-bindings: phy: mxs-usb-phy: convert to DT schema format dt-bindings: phy: qcom,qmp-usb: fix bindings error dt-bindings: phy: qcom,qmp-ufs: fix the sc8180x regs dt-bindings: phy: qcom,qmp-pcie: fix the sc8180x regs phy: mediatek: tphy: add debugfs files phy: core: add debugfs files phy: fsl-imx8mp-usb: add support for phy tuning ... commit d14de8067e3f9653cdef5a094176d00f3260ab20 Author: Ronnie Sahlberg Date: Thu Jul 6 12:32:24 2023 +1000 cifs: Add a laundromat thread for cached directories and drop cached directories after 30 seconds Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 496720b7cfb6574a8f6f4d434f23e3d1e6cfaeb9 Merge: 6843306689aff 906bd22a44c7c Author: Alexei Starovoitov Date: Wed Jul 5 19:14:54 2023 -0700 Merge branch 'Fix for check_max_stack_depth' Kumar Kartikeya Dwivedi says: ==================== Fix for a bug in check_max_stack_depth which allows bypassing the 512-byte stack limit. ==================== Signed-off-by: Alexei Starovoitov commit 906bd22a44c7c381ae92996129b075ea7beba8f6 Author: Kumar Kartikeya Dwivedi Date: Wed Jul 5 20:17:30 2023 +0530 selftests/bpf: Add selftest for check_stack_max_depth bug Use the bpf_timer_set_callback helper to mark timer_cb as an async callback, and put a direct call to timer_cb in the main subprog. As the check_stack_max_depth happens after the do_check pass, the order does not matter. Without the previous fix, the test passes successfully. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230705144730.235802-3-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 5415ccd50a8620c8cbaa32d6f18c946c453566f5 Author: Kumar Kartikeya Dwivedi Date: Wed Jul 5 20:17:29 2023 +0530 bpf: Fix max stack depth check for async callbacks The check_max_stack_depth pass happens after the verifier's symbolic execution, and attempts to walk the call graph of the BPF program, ensuring that the stack usage stays within bounds for all possible call chains. There are two cases to consider: bpf_pseudo_func and bpf_pseudo_call. In the former case, the callback pointer is loaded into a register, and is assumed that it is passed to some helper later which calls it (however there is no way to be sure), but the check remains conservative and accounts the stack usage anyway. For this particular case, asynchronous callbacks are skipped as they execute asynchronously when their corresponding event fires. The case of bpf_pseudo_call is simpler and we know that the call is definitely made, hence the stack depth of the subprog is accounted for. However, the current check still skips an asynchronous callback even if a bpf_pseudo_call was made for it. This is erroneous, as it will miss accounting for the stack usage of the asynchronous callback, which can be used to breach the maximum stack depth limit. Fix this by only skipping asynchronous callbacks when the instruction is not a pseudo call to the subprog. Fixes: 7ddc80a476c2 ("bpf: Teach stack depth check about async callbacks.") Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230705144730.235802-2-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit a97ccaa4f04396c594c25877fd2b78cc5baea4ed Merge: 24befa92ed47e 03e51c4a74b91 Author: Martin K. Petersen Date: Wed Jul 5 22:02:01 2023 -0400 Merge patch series "Improve checks in blk_revalidate_disk_zones()" Damien Le Moal says: blk_revalidate_disk_zones() implements checks of the zones of a zoned block device, verifying that the zone size is a power of 2 number of sectors, that all zones (except possibly the last one) have the same size and that zones cover the entire addressing space of the device. While these checks are appropriate to verify that well tested hardware devices have an adequate zone configurations, they lack in certain areas which may result in issues with potentially buggy emulated devices implemented with user drivers such as ublk or tcmu. Specifically, this function does not check if the device driver indicated support for the mandatory zone append writes, that is, if the device max_zone_append_sectors queue limit is set to a non-zero value. Additionally, invalid zones such as a zero length zone with a start sector equal to the device capacity will not be detected and result in out of bounds use of the zone bitmaps prepared with the callback function blk_revalidate_zone_cb(). This series address these issues by modifying the 4 block device drivers that currently support zoned block devices to ensure that they all set a zoned device zone size and max zone append sectors limit before executing blk_revalidate_disk_zones(). With these changes in place, patch 5 improves blk_revalidate_disk_zones() to address the missing checks, relying on the fact that the zone size and zone append limit are normally set when this function is called. Link: https://lore.kernel.org/r/20230703024812.76778-1-dlemoal@kernel.org Signed-off-by: Martin K. Petersen commit 03e51c4a74b91b0b1a9ca091029b0b58f014be81 Author: Damien Le Moal Date: Mon Jul 3 11:48:12 2023 +0900 scsi: block: Improve checks in blk_revalidate_disk_zones() blk_revalidate_disk_zones() implements checks of the zones of a zoned block device, verifying that the zone size is a power of 2 number of sectors, that all zones (except possibly the last one) have the same size and that zones cover the entire addressing space of the device. While these checks are appropriate to verify that well tested hardware devices have an adequate zone configurations, they lack in certain areas which may result in issues with emulated devices implemented with user drivers such as ublk or tcmu. Specifically, this function does not check if the device driver indicated support for the mandatory zone append writes, that is, if the device max_zone_append_sectors queue limit is set to a non-zero value. Additionally, invalid zones such as a zero length zone with a start sector equal to the device capacity will not be detected and result in out of bounds use of the zone bitmaps prepared with the callback function blk_revalidate_zone_cb(). Improve blk_revalidate_disk_zones() to address these inadequate checks, relying on the fact that all device drivers supporting zoned block devices must set the device zone size (chunk_sectors queue limit) and the max_zone_append_sectors queue limit before executing this function. The check for a non-zero max_zone_append_sectors value is done in blk_revalidate_disk_zones() before executing the zone report. The zone report callback function blk_revalidate_zone_cb() is also modified to add a check that a zone start is below the device capacity. The check that the zone size is a power of 2 number of sectors is moved to blk_revalidate_disk_zones() as the zone size is already known. Similarly, the number of zones of the device can be calculated in blk_revalidate_disk_zones() before executing the zone report. The kdoc comment for blk_revalidate_disk_zones() is also updated to mention that device drivers must set the device zone size and the max_zone_append_sectors queue limit before calling this function. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230703024812.76778-6-dlemoal@kernel.org Reviewed-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit a3d96ed21507e8d70ddab6c7abc93d5e56aaeeb0 Author: Damien Le Moal Date: Mon Jul 3 11:48:11 2023 +0900 scsi: block: virtio_blk: Set zone limits before revalidating zones In virtblk_probe_zoned_device(), execute blk_queue_chunk_sectors() and blk_queue_max_zone_append_sectors() to respectively set the zoned device zone size and maximum zone append sector limit before executing blk_revalidate_disk_zones(). This is to allow the block layer zone reavlidation to check these device characteristics prior to checking all zones of the device. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230703024812.76778-5-dlemoal@kernel.org Reviewed-by: Bart Van Assche Reviewed-by: Dmitry Fomichev Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit a442b899fe17118e672647f664bf7f1dd5d7fcb0 Author: Damien Le Moal Date: Mon Jul 3 11:48:10 2023 +0900 scsi: block: nullblk: Set zone limits before revalidating zones In null_register_zoned_dev(), execute blk_queue_chunk_sectors() and blk_queue_max_zone_append_sectors() to respectively set the zoned device zone size and maximum zone append sector limit before executing blk_revalidate_disk_zones(). This is to allow the block layer zone reavlidation to check these device characteristics prior to checking all zones of the device. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230703024812.76778-4-dlemoal@kernel.org Reviewed-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit d226b0a2b683e27fce060669dc7cb8d6917b785a Author: Damien Le Moal Date: Mon Jul 3 11:48:09 2023 +0900 scsi: nvme: zns: Set zone limits before revalidating zones In nvme_revalidate_zones(), execute blk_queue_chunk_sectors() and blk_queue_max_zone_append_sectors() to respectively set a ZNS namespace zone size and maximum zone append sector limit before executing blk_revalidate_disk_zones(). This is to allow the block layer zone reavlidation to check these device characteristics prior to checking all zones of the device. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230703024812.76778-3-dlemoal@kernel.org Reviewed-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit f79846ca2f04c9744627c24034d675c88f0da3a0 Author: Damien Le Moal Date: Mon Jul 3 11:48:08 2023 +0900 scsi: sd_zbc: Set zone limits before revalidating zones In sd_zbc_revalidate_zones(), execute blk_queue_chunk_sectors() and blk_queue_max_zone_append_sectors() to respectively set a ZBC device zone size and maximum zone append sector limit before executing blk_revalidate_disk_zones(). This is to allow the block layer zone reavlidation to check these device characteristics prior to checking all zones of the device. Since blk_queue_max_zone_append_sectors() already caps the device maximum zone append limit to the zone size and to the maximum command size, the max_append value passed to blk_queue_max_zone_append_sectors() is simplified to the maximum number of segments times the number of sectors per page. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230703024812.76778-2-dlemoal@kernel.org Reviewed-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 24befa92ed47ed2af25868412a1275602ca8f4ea Author: Arthur Simchaev Date: Mon Jun 26 13:33:19 2023 +0300 scsi: ufs: core: Add support for qTimestamp attribute The new qTimestamp attribute was added to UFS 4.0 spec, in order to synchronize timestamp between device logs and the host. The spec recommends to send this attribute upon device power-on Reset/HW reset or when switching to Active state (using SSU command). Due to this attribute, the attribute's max value was extended to 8 bytes. As a result, the new definition of struct utp_upiu_query_v4_0 was added. Signed-off-by: Arthur Simchaev ----------------- Changes to v2: - Adressed Bart's comments - Add missed response variable to ufshcd_set_timestamp_attr Link: https://lore.kernel.org/r/20230626103320.8737-1-arthur.simchaev@wdc.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 47699a2b63caaa0de4841d4402627c2fdf3452a6 Author: Arnd Bergmann Date: Mon Jul 3 13:48:46 2023 +0200 scsi: aacraid: Avoid -Warray-bounds warning The one-element array in aac_aifcmd is actually meant as a flexible array, and causes an overflow warning that can be avoided using the normal flex arrays: drivers/scsi/aacraid/commsup.c:1166:17: error: array index 1 is past the end of the array (that has type 'u8[1]' (aka 'unsigned char[1]'), cast to '__le32 *' (aka 'unsigned int *')) [-Werror,-Warray-bounds] (((__le32 *)aifcmd->data)[1] == cpu_to_le32(3)); ^ ~ Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230703114851.1194510-1-arnd@kernel.org Signed-off-by: Martin K. Petersen commit 89f7ef7f2b23b2a7b8ce346c23161916eae5b15c Author: Randy Dunlap Date: Fri Jun 30 22:23:48 2023 -0700 scsi: ufs: ufs-mediatek: Add dependency for RESET_CONTROLLER When RESET_CONTROLLER is not set, kconfig complains about missing dependencies for RESET_TI_SYSCON, so add the missing dependency just as is done above for SCSI_UFS_QCOM. Silences this kconfig warning: WARNING: unmet direct dependencies detected for RESET_TI_SYSCON Depends on [n]: RESET_CONTROLLER [=n] && HAS_IOMEM [=y] Selected by [m]: - SCSI_UFS_MEDIATEK [=m] && SCSI_UFSHCD [=y] && SCSI_UFSHCD_PLATFORM [=y] && ARCH_MEDIATEK [=y] Fixes: de48898d0cb6 ("scsi: ufs-mediatek: Create reset control device_link") Signed-off-by: Randy Dunlap Link: lore.kernel.org/r/202306020859.1wHg9AaT-lkp@intel.com Link: https://lore.kernel.org/r/20230701052348.28046-1-rdunlap@infradead.org Cc: Stanley Chu Cc: Peter Wang Cc: Paul Gazzillo Cc: Necip Fazil Yildiran Cc: linux-scsi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Reported-by: kernel test robot Signed-off-by: Martin K. Petersen commit ef470b862dc7e5e169167301b9862bed54d7f969 Author: Can Guo Date: Thu Jun 29 17:39:09 2023 -0700 scsi: ufs: core: Update contact email for monitor sysfs nodes Update contact email addresses for Can Guo and Asutosh Das, replace Subhash Jadavani's contact. Signed-off-by: Can Guo Link: https://lore.kernel.org/r/20230630003913.3713155-1-quic_cang@quicinc.com Signed-off-by: Martin K. Petersen commit 23815df5af5790c6e99b6bb1ffd39d509d0a7bdb Author: Maurizio Lombardi Date: Wed Jun 28 17:06:38 2023 +0200 scsi: scsi_debug: Remove dead code The ramdisk rwlocks are not used anymore. Fixes: 87c715dcde63 ("scsi: scsi_debug: Add per_host_store option") Signed-off-by: Maurizio Lombardi Link: https://lore.kernel.org/r/20230628150638.53218-1-mlombard@redhat.com Reviewed-by: Laurence Oberman Signed-off-by: Martin K. Petersen commit 04d91b783acf910ceda2af31fe969e4eb572110b Author: Julia Lawall Date: Tue Jun 27 16:43:39 2023 +0200 scsi: qla2xxx: Use vmalloc_array() and vcalloc() Use vmalloc_array() and vcalloc() to protect against multiplication overflows. The changes were done using the following Coccinelle semantic patch: // @initialize:ocaml@ @@ let rename alloc = match alloc with "vmalloc" -> "vmalloc_array" | "vzalloc" -> "vcalloc" | _ -> failwith "unknown" @@ size_t e1,e2; constant C1, C2; expression E1, E2, COUNT, x1, x2, x3; typedef u8; typedef __u8; type t = {u8,__u8,char,unsigned char}; identifier alloc = {vmalloc,vzalloc}; fresh identifier realloc = script:ocaml(alloc) { rename alloc }; @@ ( alloc(x1*x2*x3) | alloc(C1 * C2) | alloc((sizeof(t)) * (COUNT), ...) | - alloc((e1) * (e2)) + realloc(e1, e2) | - alloc((e1) * (COUNT)) + realloc(COUNT, e1) | - alloc((E1) * (E2)) + realloc(E1, E2) ) // Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20230627144339.144478-25-Julia.Lawall@inria.fr Signed-off-by: Martin K. Petersen commit b34c7dcaf311521f6a0edaffc157d115d386ed9c Author: Julia Lawall Date: Tue Jun 27 16:43:22 2023 +0200 scsi: fnic: Use vmalloc_array() and vcalloc() Use vmalloc_array() and vcalloc() to protect against multiplication overflows. The changes were done using the following Coccinelle semantic patch: // @initialize:ocaml@ @@ let rename alloc = match alloc with "vmalloc" -> "vmalloc_array" | "vzalloc" -> "vcalloc" | _ -> failwith "unknown" @@ size_t e1,e2; constant C1, C2; expression E1, E2, COUNT, x1, x2, x3; typedef u8; typedef __u8; type t = {u8,__u8,char,unsigned char}; identifier alloc = {vmalloc,vzalloc}; fresh identifier realloc = script:ocaml(alloc) { rename alloc }; @@ ( alloc(x1*x2*x3) | alloc(C1 * C2) | alloc((sizeof(t)) * (COUNT), ...) | - alloc((e1) * (e2)) + realloc(e1, e2) | - alloc((e1) * (COUNT)) + realloc(COUNT, e1) | - alloc((E1) * (E2)) + realloc(E1, E2) ) // Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20230627144339.144478-8-Julia.Lawall@inria.fr Signed-off-by: Martin K. Petersen commit e579b007eff3ff8d29d59d16214cd85fb9e573f7 Author: Dan Carpenter Date: Mon Jun 26 13:58:47 2023 +0300 scsi: qla2xxx: Fix error code in qla2x00_start_sp() This should be negative -EAGAIN instead of positive. The callers treat non-zero error codes the same so it doesn't really impact runtime beyond some trivial differences to debug output. Fixes: 80676d054e5a ("scsi: qla2xxx: Fix session cleanup hang") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/49866d28-4cfe-47b0-842b-78f110e61aab@moroto.mountain Signed-off-by: Martin K. Petersen commit 134f66959cd0bc90a745f2eed4c10a0519d455c4 Author: Dan Carpenter Date: Mon Jun 26 13:58:03 2023 +0300 scsi: qla2xxx: Silence a static checker warning Smatch and Clang both complain that LOGIN_TEMPLATE_SIZE is more than sizeof(ha->plogi_els_payld.fl_csp). Smatch warning: drivers/scsi/qla2xxx/qla_iocb.c:3075 qla24xx_els_dcmd2_iocb() warn: '&ha->plogi_els_payld.fl_csp' sometimes too small '16' size = 112 Clang warning: include/linux/fortify-string.h:592:4: error: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror,-Wattribute-warning] __read_overflow2_field(q_size_field, size); When I was reading this code I assumed the "- 4" meant that we were skipping the last 4 bytes but actually it turned out that we are skipping the first four bytes. I have re-written it remove the magic numbers, be more clear and silence the static checker warnings. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/4aa0485e-766f-4b02-8d5d-c6781ea8f511@moroto.mountain Signed-off-by: Martin K. Petersen commit 0e881c0a4b6146b7e856735226208f48251facd8 Author: Tuo Li Date: Fri Jun 30 10:47:48 2023 +0800 scsi: lpfc: Fix a possible data race in lpfc_unregister_fcf_rescan() The variable phba->fcf.fcf_flag is often protected by the lock phba->hbalock() when is accessed. Here is an example in lpfc_unregister_fcf_rescan(): spin_lock_irq(&phba->hbalock); phba->fcf.fcf_flag |= FCF_INIT_DISC; spin_unlock_irq(&phba->hbalock); However, in the same function, phba->fcf.fcf_flag is assigned with 0 without holding the lock, and thus can cause a data race: phba->fcf.fcf_flag = 0; To fix this possible data race, a lock and unlock pair is added when accessing the variable phba->fcf.fcf_flag. Reported-by: BassCheck Signed-off-by: Tuo Li Link: https://lore.kernel.org/r/20230630024748.1035993-1-islituo@gmail.com Reviewed-by: Justin Tee Reviewed-by: Laurence Oberman Signed-off-by: Martin K. Petersen commit caf3ef7468f7534771b5c44cd8dbd6f7f87c2cbd Author: Thadeu Lima de Souza Cascardo Date: Wed Jul 5 18:05:35 2023 -0300 netfilter: nf_tables: prevent OOB access in nft_byteorder_eval When evaluating byteorder expressions with size 2, a union with 32-bit and 16-bit members is used. Since the 16-bit members are aligned to 32-bit, the array accesses will be out-of-bounds. It may lead to a stack-out-of-bounds access like the one below: [ 23.095215] ================================================================== [ 23.095625] BUG: KASAN: stack-out-of-bounds in nft_byteorder_eval+0x13c/0x320 [ 23.096020] Read of size 2 at addr ffffc90000007948 by task ping/115 [ 23.096358] [ 23.096456] CPU: 0 PID: 115 Comm: ping Not tainted 6.4.0+ #413 [ 23.096770] Call Trace: [ 23.096910] [ 23.097030] dump_stack_lvl+0x60/0xc0 [ 23.097218] print_report+0xcf/0x630 [ 23.097388] ? nft_byteorder_eval+0x13c/0x320 [ 23.097577] ? kasan_addr_to_slab+0xd/0xc0 [ 23.097760] ? nft_byteorder_eval+0x13c/0x320 [ 23.097949] kasan_report+0xc9/0x110 [ 23.098106] ? nft_byteorder_eval+0x13c/0x320 [ 23.098298] __asan_load2+0x83/0xd0 [ 23.098453] nft_byteorder_eval+0x13c/0x320 [ 23.098659] nft_do_chain+0x1c8/0xc50 [ 23.098852] ? __pfx_nft_do_chain+0x10/0x10 [ 23.099078] ? __kasan_check_read+0x11/0x20 [ 23.099295] ? __pfx___lock_acquire+0x10/0x10 [ 23.099535] ? __pfx___lock_acquire+0x10/0x10 [ 23.099745] ? __kasan_check_read+0x11/0x20 [ 23.099929] nft_do_chain_ipv4+0xfe/0x140 [ 23.100105] ? __pfx_nft_do_chain_ipv4+0x10/0x10 [ 23.100327] ? lock_release+0x204/0x400 [ 23.100515] ? nf_hook.constprop.0+0x340/0x550 [ 23.100779] nf_hook_slow+0x6c/0x100 [ 23.100977] ? __pfx_nft_do_chain_ipv4+0x10/0x10 [ 23.101223] nf_hook.constprop.0+0x334/0x550 [ 23.101443] ? __pfx_ip_local_deliver_finish+0x10/0x10 [ 23.101677] ? __pfx_nf_hook.constprop.0+0x10/0x10 [ 23.101882] ? __pfx_ip_rcv_finish+0x10/0x10 [ 23.102071] ? __pfx_ip_local_deliver_finish+0x10/0x10 [ 23.102291] ? rcu_read_lock_held+0x4b/0x70 [ 23.102481] ip_local_deliver+0xbb/0x110 [ 23.102665] ? __pfx_ip_rcv+0x10/0x10 [ 23.102839] ip_rcv+0x199/0x2a0 [ 23.102980] ? __pfx_ip_rcv+0x10/0x10 [ 23.103140] __netif_receive_skb_one_core+0x13e/0x150 [ 23.103362] ? __pfx___netif_receive_skb_one_core+0x10/0x10 [ 23.103647] ? mark_held_locks+0x48/0xa0 [ 23.103819] ? process_backlog+0x36c/0x380 [ 23.103999] __netif_receive_skb+0x23/0xc0 [ 23.104179] process_backlog+0x91/0x380 [ 23.104350] __napi_poll.constprop.0+0x66/0x360 [ 23.104589] ? net_rx_action+0x1cb/0x610 [ 23.104811] net_rx_action+0x33e/0x610 [ 23.105024] ? _raw_spin_unlock+0x23/0x50 [ 23.105257] ? __pfx_net_rx_action+0x10/0x10 [ 23.105485] ? mark_held_locks+0x48/0xa0 [ 23.105741] __do_softirq+0xfa/0x5ab [ 23.105956] ? __dev_queue_xmit+0x765/0x1c00 [ 23.106193] do_softirq.part.0+0x49/0xc0 [ 23.106423] [ 23.106547] [ 23.106670] __local_bh_enable_ip+0xf5/0x120 [ 23.106903] __dev_queue_xmit+0x789/0x1c00 [ 23.107131] ? __pfx___dev_queue_xmit+0x10/0x10 [ 23.107381] ? find_held_lock+0x8e/0xb0 [ 23.107585] ? lock_release+0x204/0x400 [ 23.107798] ? neigh_resolve_output+0x185/0x350 [ 23.108049] ? mark_held_locks+0x48/0xa0 [ 23.108265] ? neigh_resolve_output+0x185/0x350 [ 23.108514] neigh_resolve_output+0x246/0x350 [ 23.108753] ? neigh_resolve_output+0x246/0x350 [ 23.109003] ip_finish_output2+0x3c3/0x10b0 [ 23.109250] ? __pfx_ip_finish_output2+0x10/0x10 [ 23.109510] ? __pfx_nf_hook+0x10/0x10 [ 23.109732] __ip_finish_output+0x217/0x390 [ 23.109978] ip_finish_output+0x2f/0x130 [ 23.110207] ip_output+0xc9/0x170 [ 23.110404] ip_push_pending_frames+0x1a0/0x240 [ 23.110652] raw_sendmsg+0x102e/0x19e0 [ 23.110871] ? __pfx_raw_sendmsg+0x10/0x10 [ 23.111093] ? lock_release+0x204/0x400 [ 23.111304] ? __mod_lruvec_page_state+0x148/0x330 [ 23.111567] ? find_held_lock+0x8e/0xb0 [ 23.111777] ? find_held_lock+0x8e/0xb0 [ 23.111993] ? __rcu_read_unlock+0x7c/0x2f0 [ 23.112225] ? aa_sk_perm+0x18a/0x550 [ 23.112431] ? filemap_map_pages+0x4f1/0x900 [ 23.112665] ? __pfx_aa_sk_perm+0x10/0x10 [ 23.112880] ? find_held_lock+0x8e/0xb0 [ 23.113098] inet_sendmsg+0xa0/0xb0 [ 23.113297] ? inet_sendmsg+0xa0/0xb0 [ 23.113500] ? __pfx_inet_sendmsg+0x10/0x10 [ 23.113727] sock_sendmsg+0xf4/0x100 [ 23.113924] ? move_addr_to_kernel.part.0+0x4f/0xa0 [ 23.114190] __sys_sendto+0x1d4/0x290 [ 23.114391] ? __pfx___sys_sendto+0x10/0x10 [ 23.114621] ? __pfx_mark_lock.part.0+0x10/0x10 [ 23.114869] ? lock_release+0x204/0x400 [ 23.115076] ? find_held_lock+0x8e/0xb0 [ 23.115287] ? rcu_is_watching+0x23/0x60 [ 23.115503] ? __rseq_handle_notify_resume+0x6e2/0x860 [ 23.115778] ? __kasan_check_write+0x14/0x30 [ 23.116008] ? blkcg_maybe_throttle_current+0x8d/0x770 [ 23.116285] ? mark_held_locks+0x28/0xa0 [ 23.116503] ? do_syscall_64+0x37/0x90 [ 23.116713] __x64_sys_sendto+0x7f/0xb0 [ 23.116924] do_syscall_64+0x59/0x90 [ 23.117123] ? irqentry_exit_to_user_mode+0x25/0x30 [ 23.117387] ? irqentry_exit+0x77/0xb0 [ 23.117593] ? exc_page_fault+0x92/0x140 [ 23.117806] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 23.118081] RIP: 0033:0x7f744aee2bba [ 23.118282] Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f 00 f3 0f 1e fa 41 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 15 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 7e c3 0f 1f 44 00 00 41 54 48 83 ec 30 44 89 [ 23.119237] RSP: 002b:00007ffd04a7c9f8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c [ 23.119644] RAX: ffffffffffffffda RBX: 00007ffd04a7e0a0 RCX: 00007f744aee2bba [ 23.120023] RDX: 0000000000000040 RSI: 000056488e9e6300 RDI: 0000000000000003 [ 23.120413] RBP: 000056488e9e6300 R08: 00007ffd04a80320 R09: 0000000000000010 [ 23.120809] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000040 [ 23.121219] R13: 00007ffd04a7dc38 R14: 00007ffd04a7ca00 R15: 00007ffd04a7e0a0 [ 23.121617] [ 23.121749] [ 23.121845] The buggy address belongs to the virtual mapping at [ 23.121845] [ffffc90000000000, ffffc90000009000) created by: [ 23.121845] irq_init_percpu_irqstack+0x1cf/0x270 [ 23.122707] [ 23.122803] The buggy address belongs to the physical page: [ 23.123104] page:0000000072ac19f0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24a09 [ 23.123609] flags: 0xfffffc0001000(reserved|node=0|zone=1|lastcpupid=0x1fffff) [ 23.123998] page_type: 0xffffffff() [ 23.124194] raw: 000fffffc0001000 ffffea0000928248 ffffea0000928248 0000000000000000 [ 23.124610] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 [ 23.125023] page dumped because: kasan: bad access detected [ 23.125326] [ 23.125421] Memory state around the buggy address: [ 23.125682] ffffc90000007800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 23.126072] ffffc90000007880: 00 00 00 00 00 f1 f1 f1 f1 f1 f1 00 00 f2 f2 00 [ 23.126455] >ffffc90000007900: 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2 00 00 00 [ 23.126840] ^ [ 23.127138] ffffc90000007980: 00 00 00 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 [ 23.127522] ffffc90000007a00: f3 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 [ 23.127906] ================================================================== [ 23.128324] Disabling lock debugging due to kernel taint Using simple s16 pointers for the 16-bit accesses fixes the problem. For the 32-bit accesses, src and dst can be used directly. Fixes: 96518518cc41 ("netfilter: add nftables") Cc: stable@vger.kernel.org Reported-by: Tanguy DUBROCA (@SidewayRE) from @Synacktiv working with ZDI Signed-off-by: Thadeu Lima de Souza Cascardo Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6843306689aff3aea608e4d2630b2a5a0137f827 Merge: 73a3fcdaa7320 cc7eab25b1cf3 Author: Linus Torvalds Date: Wed Jul 5 15:44:45 2023 -0700 Merge tag 'net-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bluetooth, bpf and wireguard. Current release - regressions: - nvme-tcp: fix comma-related oops after sendpage changes Current release - new code bugs: - ptp: make max_phase_adjustment sysfs device attribute invisible when not supported Previous releases - regressions: - sctp: fix potential deadlock on &net->sctp.addr_wq_lock - mptcp: - ensure subflow is unhashed before cleaning the backlog - do not rely on implicit state check in mptcp_listen() Previous releases - always broken: - net: fix net_dev_start_xmit trace event vs skb_transport_offset() - Bluetooth: - fix use-bdaddr-property quirk - L2CAP: fix multiple UaFs - ISO: use hci_sync for setting CIG parameters - hci_event: fix Set CIG Parameters error status handling - hci_event: fix parsing of CIS Established Event - MGMT: fix marking SCAN_RSP as not connectable - wireguard: queuing: use saner cpu selection wrapping - sched: act_ipt: various bug fixes for iptables <> TC interactions - sched: act_pedit: add size check for TCA_PEDIT_PARMS_EX - dsa: fixes for receiving PTP packets with 8021q and sja1105 tagging - eth: sfc: fix null-deref in devlink port without MAE access - eth: ibmvnic: do not reset dql stats on NON_FATAL err Misc: - xsk: honor SO_BINDTODEVICE on bind" * tag 'net-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (70 commits) nfp: clean mc addresses in application firmware when closing port selftests: mptcp: pm_nl_ctl: fix 32-bit support selftests: mptcp: depend on SYN_COOKIES selftests: mptcp: userspace_pm: report errors with 'remove' tests selftests: mptcp: userspace_pm: use correct server port selftests: mptcp: sockopt: return error if wrong mark selftests: mptcp: sockopt: use 'iptables-legacy' if available selftests: mptcp: connect: fail if nft supposed to work mptcp: do not rely on implicit state check in mptcp_listen() mptcp: ensure subflow is unhashed before cleaning the backlog s390/qeth: Fix vipa deletion octeontx-af: fix hardware timestamp configuration net: dsa: sja1105: always enable the send_meta options net: dsa: tag_sja1105: fix MAC DA patching from meta frames net: Replace strlcpy with strscpy pptp: Fix fib lookup calls. mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check net/sched: act_pedit: Add size check for TCA_PEDIT_PARMS_EX xsk: Honor SO_BINDTODEVICE on bind ptp: Make max_phase_adjustment sysfs device attribute invisible when not supported ... commit 2fb48d88e77f29bf9d278f25bcfe82cf59a0e09b Author: Eric Biggers Date: Fri Jun 9 23:11:39 2023 -0700 blk-crypto: use dynamic lock class for blk_crypto_profile::lock When a device-mapper device is passing through the inline encryption support of an underlying device, calls to blk_crypto_evict_key() take the blk_crypto_profile::lock of the device-mapper device, then take the blk_crypto_profile::lock of the underlying device (nested). This isn't a real deadlock, but it causes a lockdep report because there is only one lock class for all instances of this lock. Lockdep subclasses don't really work here because the hierarchy of block devices is dynamic and could have more than 2 levels. Instead, register a dynamic lock class for each blk_crypto_profile, and associate that with the lock. This avoids false-positive lockdep reports like the following: ============================================ WARNING: possible recursive locking detected 6.4.0-rc5 #2 Not tainted -------------------------------------------- fscryptctl/1421 is trying to acquire lock: ffffff80829ca418 (&profile->lock){++++}-{3:3}, at: __blk_crypto_evict_key+0x44/0x1c0 but task is already holding lock: ffffff8086b68ca8 (&profile->lock){++++}-{3:3}, at: __blk_crypto_evict_key+0xc8/0x1c0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&profile->lock); lock(&profile->lock); *** DEADLOCK *** May be due to missing lock nesting notation Fixes: 1b2628397058 ("block: Keyslot Manager for Inline Encryption") Reported-by: Bart Van Assche Signed-off-by: Eric Biggers Reviewed-by: Bart Van Assche Link: https://lore.kernel.org/r/20230610061139.212085-1-ebiggers@kernel.org Signed-off-by: Jens Axboe commit 7eb1e47696aa231b1a567846bbe3a1e1befe1854 Author: Michael Schmitz Date: Wed Jul 5 11:38:08 2023 +1200 block/partition: fix signedness issue for Amiga partitions Making 'blk' sector_t (i.e. 64 bit if LBD support is active) fails the 'blk>0' test in the partition block loop if a value of (signed int) -1 is used to mark the end of the partition block list. Explicitly cast 'blk' to signed int to allow use of -1 to terminate the partition block linked list. Fixes: b6f3f28f604b ("block: add overflow checks for Amiga partition support") Reported-by: Christian Zigotzky Link: https://lore.kernel.org/r/024ce4fa-cc6d-50a2-9aae-3701d0ebf668@xenosoft.de Signed-off-by: Michael Schmitz Reviewed-by: Martin Steigerwald Tested-by: Christian Zigotzky Signed-off-by: Jens Axboe commit 73a3fcdaa73200e38e38f7e8a32c9b901c5b95b5 Merge: bb8e7e9f0bc47 a6ec83786ab9f Author: Linus Torvalds Date: Wed Jul 5 14:14:37 2023 -0700 Merge tag 'f2fs-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs updates from Jaegeuk Kim: "In this cycle, we've mainly investigated the zoned block device support along with patches such as correcting write pointers between f2fs and storage, adding asynchronous zone reset flow, and managing the number of open zones. Other than them, f2fs adds another mount option, "errors=x" to specify how to handle when it detects an unexpected behavior at runtime. Enhancements: - support 'errors=remount-ro|continue|panic' mount option - enforce some inode flag policies - allow .tmp compression given extensions - add some ioctls to manage the f2fs compression - improve looped node chain flow - avoid issuing small-sized discard commands during checkpoint - implement an asynchronous zone reset Bug fixes: - fix deadlock in xattr and inode page lock - fix and add sanity check in some error paths - fix to avoid NULL pointer dereference f2fs_write_end_io() along with put_super - set proper flags to quota files - fix potential deadlock due to unpaired node_write lock use - fix over-estimating free section during FG GC - fix the wrong condition to determine atomic context As usual, also there are a number of patches with code refactoring and minor clean-ups" * tag 'f2fs-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (46 commits) f2fs: fix to do sanity check on direct node in truncate_dnode() f2fs: only set release for file that has compressed data f2fs: fix compile warning in f2fs_destroy_node_manager() f2fs: fix error path handling in truncate_dnode() f2fs: fix deadlock in i_xattr_sem and inode page lock f2fs: remove unneeded page uptodate check/set f2fs: update mtime and ctime in move file range method f2fs: compress tmp files given extension f2fs: refactor struct f2fs_attr macro f2fs: convert to use sbi directly f2fs: remove redundant assignment to variable err f2fs: do not issue small discard commands during checkpoint f2fs: check zone write pointer points to the end of zone f2fs: add f2fs_ioc_get_compress_blocks f2fs: cleanup MIN_INLINE_XATTR_SIZE f2fs: add helper to check compression level f2fs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method f2fs: do more sanity check on inode f2fs: compress: fix to check validity of i_compress_flag field f2fs: add sanity compress level check for compressed file ... commit 01f23c5f1526f5b6ff744887aa511b9e69d4401b Author: Kees Cook Date: Thu Jun 29 12:09:00 2023 -0700 usb: ch9: Replace bmSublinkSpeedAttr 1-element array with flexible array Since commit 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC"), UBSAN_BOUNDS no longer pretends 1-element arrays are unbounded. Walking bmSublinkSpeedAttr will trigger a warning, so make it a proper flexible array. Add a union to keep the struct size identical for userspace in case anything was depending on the old size. False positive warning was: UBSAN: array-index-out-of-bounds in drivers/usb/host/xhci-hub.c:231:31 index 1 is out of range for type '__le32 [1]' for this line of code: ssp_cap->bmSublinkSpeedAttr[offset++] = cpu_to_le32(attr); Reported-by: Borislav Petkov Closes: https://lore.kernel.org/lkml/2023062945-fencing-pebble-0411@gregkh/ Reported-by: Mirsad Todorovac Closes: https://lore.kernel.org/lkml/9a8e34ad-8a8b-3830-4878-3c2c82e69dd9@alu.unizg.hr/ Cc: Greg Kroah-Hartman Cc: "Gustavo A. R. Silva" Tested-by: "Borislav Petkov (AMD)" Tested-by: Mirsad Todorovac Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230629190900.never.787-kees@kernel.org Signed-off-by: Kees Cook commit bb8e7e9f0bc47d01bea310808ab8c27f6484d850 Merge: ace1ba1c9038b 34acceaa8818a Author: Linus Torvalds Date: Wed Jul 5 14:08:03 2023 -0700 Merge tag 'xfs-6.5-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull more xfs updates from Darrick Wong: - Fix some ordering problems with log items during log recovery - Don't deadlock the system by trying to flush busy freed extents while holding on to busy freed extents - Improve validation of log geometry parameters when reading the primary superblock - Validate the length field in the AGF header - Fix recordset filtering bugs when re-calling GETFSMAP to return more results when the resultset didn't previously fit in the caller's buffer - Fix integer overflows in GETFSMAP when working with rt volumes larger than 2^32 fsblocks - Fix GETFSMAP reporting the undefined space beyond the last rtextent - Fix filtering bugs in GETFSMAP's log device backend if the log ever becomes longer than 2^32 fsblocks - Improve validation of file offsets in the GETFSMAP range parameters - Fix an off by one bug in the pmem media failure notification computation - Validate the length field in the AGI header too * tag 'xfs-6.5-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: Remove unneeded semicolon xfs: AGI length should be bounds checked xfs: fix the calculation for "end" and "length" xfs: fix xfs_btree_query_range callers to initialize btree rec fully xfs: validate fsmap offsets specified in the query keys xfs: fix logdev fsmap query result filtering xfs: clean up the rtbitmap fsmap backend xfs: fix getfsmap reporting past the last rt extent xfs: fix integer overflows in the fsmap rtbitmap and logdev backends xfs: fix interval filtering in multi-step fsmap queries xfs: fix bounds check in xfs_defer_agfl_block() xfs: AGF length has never been bounds checked xfs: journal geometry is not properly bounds checked xfs: don't block in busy flushing when freeing extents xfs: allow extent free intents to be retried xfs: pass alloc flags through to xfs_extent_busy_flush() xfs: use deferred frees for btree block freeing xfs: don't reverse order of items in bulk AIL insertion xfs: remove redundant initializations of pointers drop_leaf and save_leaf commit 6722e46513e0af8e2fff4698f7cb78bc50a9f13f Author: Jonas Gorski Date: Sat Jun 24 14:21:39 2023 +0200 bus: ixp4xx: fix IXP4XX_EXP_T1_MASK The IXP4XX_EXP_T1_MASK was shifted one bit to the right, overlapping IXP4XX_EXP_T2_MASK and leaving bit 29 unused. The offset being wrong is also confirmed at least by the datasheet of IXP45X/46X [1]. Fix this by aligning it to IXP4XX_EXP_T1_SHIFT. [1] https://www.intel.com/content/dam/www/public/us/en/documents/manuals/ixp45x-ixp46x-developers-manual.pdf Cc: stable@vger.kernel.org Fixes: 1c953bda90ca ("bus: ixp4xx: Add a driver for IXP4xx expansion bus") Signed-off-by: Jonas Gorski Link: https://lore.kernel.org/r/20230624112958.27727-1-jonas.gorski@gmail.com Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230624122139.3229642-1-linus.walleij@linaro.org Signed-off-by: Arnd Bergmann commit 7fb75904d7ce8bb4ab98865918f41274b55942c0 Author: Krzysztof Kozlowski Date: Wed Jul 5 17:00:33 2023 +0200 ARM: dts: st: add missing space before { Add missing whitespace between node name/label and opening {. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230705150033.293832-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 2fa4139f3e4812de1b827b44ade35a406413f31f Author: Conor Dooley Date: Wed Jun 28 08:12:30 2023 +0100 RISC-V: make ARCH_THEAD preclude XIP_KERNEL Randy reported build errors in linux-next where XIP_KERNEL was enabled. ARCH_THEAD requires alternatives to support the non-standard ISA extensions used by the THEAD cores, which are mutually exclusive with XIP kernels. Clone the dependency list from the Allwinner entry, since Allwinner's D1 uses T-Head cores with the same non-standard extensions. Reported-by: Randy Dunlap Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Link: https://lore.kernel.org/all/ab38f6af-cb68-a918-1a63-2e7c927a8ffc@infradead.org/ Fixes: da47ce003963 ("riscv: Add the T-HEAD SoC family Kconfig option") Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20230628-left-attractor-94b7bd5fbb83@wendy Signed-off-by: Arnd Bergmann commit ace1ba1c9038b30f29c5759bc4726bbed7748f15 Merge: b986158164122 92554cdd428fc Author: Linus Torvalds Date: Wed Jul 5 12:55:06 2023 -0700 Merge tag 'pwm/for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm updates from Thierry Reding: "There's a little bit of everything in here: we've got various improvements and cleanups to drivers, some fixes across the board and a bit of new hardware support" * tag 'pwm/for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (22 commits) dt-bindings: pwm: convert pwm-bcm2835 bindings to YAML pwm: Add Renesas RZ/G2L MTU3a PWM driver pwm: mtk_disp: Fix the disable flow of disp_pwm dt-bindings: pwm: restrict node name suffixes pwm: pca9685: Switch i2c driver back to use .probe() pwm: ab8500: Fix error code in probe() MAINTAINERS: add pwm to PolarFire SoC entry pwm: add microchip soft ip corePWM driver pwm: sysfs: Do not apply state to already disabled PWMs pwm: imx-tpm: force 'real_period' to be zero in suspend pwm: meson: make full use of common clock framework pwm: meson: don't use hdmi/video clock as mux parent pwm: meson: switch to using struct clk_parent_data for mux parents pwm: meson: remove not needed check in meson_pwm_calc pwm: meson: fix handling of period/duty if greater than UINT_MAX pwm: meson: modify and simplify calculation in meson_pwm_get_state dt-bindings: pwm: Add R-Car V3U device tree bindings dt-bindings: pwm: imx: add i.MX8QXP compatible pwm: mediatek: Add support for MT7981 dt-bindings: pwm: mediatek: Add mediatek,mt7981 compatible ... commit b9861581641225262b836508ec2980e1c4fd0c91 Merge: fe1de55167963 31e9f406efae5 Author: Linus Torvalds Date: Wed Jul 5 12:50:27 2023 -0700 Merge tag 'devicetree-for-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull more devicetree updates from Rob Herring: - Whitespace clean-ups in binding examples - Restrict node name suffixes to "-[0-9]+" for cases of multiple instances which don't have unit-addresses - Convert brcm,kona-wdt and cdns,wdt-r1p2 watchdog bindings to DT schema * tag 'devicetree-for-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: soc: qcom: stats: Update maintainer email dt-bindings: cleanup DTS example whitespaces dt-bindings: timestamp: restrict node name suffixes dt-bindings: slimbus: restrict node name suffixes dt-bindings: watchdog: restrict node name suffixes dt-bindings: watchdog: brcm,kona-wdt: convert txt file to yaml dt-bindings: watchdog: cdns,wdt-r1p2: Convert cadence watchdog to yaml commit bcd981db12e6d26111609802fc7c358f30a8c72a Author: James Clark Date: Wed Jul 5 09:26:52 2023 +0100 perf test: Fix event parsing test when PERF_PMU_CAP_EXTENDED_HW_TYPE isn't supported. Arm has multiple PMU types for heterogeneous systems, but doesn't currently support PERF_PMU_CAP_EXTENDED_HW_TYPE. Make the tests support both scenarios so that they pass on Arm, and will still pass once PERF_PMU_CAP_EXTENDED_HW_TYPE support is added. Fixes: 27c9fcfc1e14 ("perf test: Update parse-events expectations to test for multiple events") Acked-by: Ian Rogers Signed-off-by: James Clark Cc: Mark Rutland Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230705082653.23566-3-james.clark@arm.com Signed-off-by: Namhyung Kim commit 808ce56e7d6bfc144b18ded8c11819c45a889520 Author: James Clark Date: Wed Jul 5 09:26:51 2023 +0100 perf test: Fix event parsing test on Arm The test looks for a PMU from sysfs with type = PERF_TYPE_RAW when opening a raw event. Arm doesn't have a real raw PMU, only core PMUs with unique types other than raw. Instead of looking for a matching PMU, just test that the event type was parsed as raw and skip the PMU search on Arm. The raw event type test should also apply to all platforms so add it outside of the ifdef. Fixes: aefde50a446b ("perf test: Fix parse-events tests for >1 core PMU") Acked-by: Ian Rogers Signed-off-by: James Clark Cc: Mark Rutland Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230705082653.23566-2-james.clark@arm.com Signed-off-by: Namhyung Kim commit 84a192e46106355de1a314d709e657231d4b1026 Author: Aravindhan Gunasekaran Date: Thu Jun 15 12:00:43 2023 +0530 igc: Handle PPS start time programming for past time values I225/6 hardware can be programmed to start PPS output once the time in Target Time registers is reached. The time programmed in these registers should always be into future. Only then PPS output is triggered when SYSTIM register reaches the programmed value. There are two modes in i225/6 hardware to program PPS, pulse and clock mode. There were issues reported where PPS is not generated when start time is in past. Example 1, "echo 0 0 0 2 0 > /sys/class/ptp/ptp0/period" In the current implementation, a value of '0' is programmed into Target time registers and PPS output is in pulse mode. Eventually an interrupt which is triggered upon SYSTIM register reaching Target time is not fired. Thus no PPS output is generated. Example 2, "echo 0 0 0 1 0 > /sys/class/ptp/ptp0/period" Above case, a value of '0' is programmed into Target time registers and PPS output is in clock mode. Here, HW tries to catch-up the current time by incrementing Target Time register. This catch-up time seem to vary according to programmed PPS period time as per the HW design. In my experiments, the delay ranged between few tens of seconds to few minutes. The PPS output is only generated after the Target time register reaches current time. In my experiments, I also observed PPS stopped working with below test and could not recover until module is removed and loaded again. 1) echo 0 0 1 0 > /sys/class/ptp/ptp1/period 2) echo 0 0 0 1 0 > /sys/class/ptp/ptp1/period 3) echo 0 0 0 1 0 > /sys/class/ptp/ptp1/period After this PPS did not work even if i re-program with proper values. I could only get this back working by reloading the driver. This patch takes care of calculating and programming appropriate future time value into Target Time registers. Fixes: 5e91c72e560c ("igc: Fix PPS delta between two synchronized end-points") Signed-off-by: Aravindhan Gunasekaran Reviewed-by: Muhammad Husaini Zulkifli Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 25102893e409bc02761ab82dbcfa092006404790 Author: Tan Tee Min Date: Fri Jun 9 11:28:42 2023 +0800 igc: Include the length/type field and VLAN tag in queueMaxSDU IEEE 802.1Q does not have clear definitions of what constitutes an SDU (Service Data Unit), but IEEE Std 802.3 clause 3.1.2 does define the MAC service primitives and clause 3.2.7 does define the MAC Client Data for Q-tagged frames. It shows that the mac_service_data_unit (MSDU) does NOT contain the preamble, destination and source address, or FCS. The MSDU does contain the length/type field, MAC client data, VLAN tag and any padding data (prior to the FCS). Thus, the maximum 802.3 frame size that is allowed to be transmitted should be QueueMaxSDU (MSDU) + 16 (6 byte SA + 6 byte DA + 4 byte FCS). Fixes: 92a0dcb8427d ("igc: offload queue max SDU from tc-taprio") Signed-off-by: Tan Tee Min Reviewed-by: Muhammad Husaini Zulkifli Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 9ac3fc2f42e5ffa1e927dcbffb71b15fa81459e2 Author: Prasad Koya Date: Mon Jun 5 11:09:01 2023 -0700 igc: set TP bit in 'supported' and 'advertising' fields of ethtool_link_ksettings set TP bit in the 'supported' and 'advertising' fields. i225/226 parts only support twisted pair copper. Fixes: 8c5ad0dae93c ("igc: Add ethtool support") Signed-off-by: Prasad Koya Acked-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit cc7eab25b1cf3f9594fe61142d3523ce4d14a788 Author: Yinjun Zhang Date: Wed Jul 5 07:28:18 2023 +0200 nfp: clean mc addresses in application firmware when closing port When moving devices from one namespace to another, mc addresses are cleaned in software while not removed from application firmware. Thus the mc addresses are remained and will cause resource leak. Now use `__dev_mc_unsync` to clean mc addresses when closing port. Fixes: e20aa071cd95 ("nfp: fix schedule in atomic context when sync mc address") Cc: stable@vger.kernel.org Signed-off-by: Yinjun Zhang Acked-by: Simon Horman Signed-off-by: Louis Peens Reviewed-by: Jacob Keller Message-ID: <20230705052818.7122-1-louis.peens@corigine.com> Signed-off-by: Jakub Kicinski commit fdaff05b4a67ae6789a8d45c10f891990329f85e Merge: c451410ca7e3d f7306acec9aae Author: Jakub Kicinski Date: Wed Jul 5 10:57:13 2023 -0700 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2023-07-05 We've added 2 non-merge commits during the last 1 day(s) which contain a total of 3 files changed, 16 insertions(+), 4 deletions(-). The main changes are: 1) Fix BTF to warn but not returning an error for a NULL BTF to still be able to load modules under CONFIG_DEBUG_INFO_BTF, from SeongJae Park. 2) Fix xsk sockets to honor SO_BINDTODEVICE in bind(), from Ilya Maximets. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: xsk: Honor SO_BINDTODEVICE on bind bpf, btf: Warn but return no error for NULL btf from __register_btf_kfunc_id_set() ==================== Link: https://lore.kernel.org/r/20230705171716.6494-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 7abd955a58fb0fcd4e756fa2065c03ae488fcfa7 Author: Dragos Tatulea Date: Wed May 31 21:18:49 2023 +0300 net/mlx5e: RX, Fix page_pool page fragment tracking for XDP Currently mlx5e releases pages directly to the page_pool for XDP_TX and does page fragment counting for XDP_REDIRECT. RX pages from the page_pool are leaking on XDP_REDIRECT because the xdp core will release only one fragment out of MLX5E_PAGECNT_BIAS_MAX and subsequently the page is marked as "skip release" which avoids the driver release. A fix would be to take an extra fragment for XDP_REDIRECT and not set the "skip release" bit so that the release on the driver side can handle the remaining bias fragments. But this would be a shortsighted solution. Instead, this patch converges the two XDP paths (XDP_TX and XDP_REDIRECT) to always do fragment tracking. The "skip release" bit is no longer necessary for XDP. Fixes: 6f5742846053 ("net/mlx5e: RX, Enable skb page recycling through the page_pool") Signed-off-by: Dragos Tatulea Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 6496357aa5f710eec96f91345b9da1b37c3231f6 Author: Maher Sanalla Date: Tue Jun 20 14:07:03 2023 +0300 net/mlx5: Query hca_cap_2 only when supported On vport enable, where fw's hca caps are queried, the driver queries hca_caps_2 without checking if fw truly supports them, causing a false failure of vfs vport load and blocking SRIOV enablement on old devices such as CX4 where hca_caps_2 support is missing. Thus, add a check for the said caps support before accessing them. Fixes: e5b9642a33be ("net/mlx5: E-Switch, Implement devlink port function cmds to control migratable") Signed-off-by: Maher Sanalla Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit f7a485115ad4cfc560833942014bf791abf1f827 Author: Yevgeny Kliteynik Date: Sun Jun 4 12:45:38 2023 +0300 net/mlx5e: TC, CT: Offload ct clear only once Non-clear CT action causes a flow rule split, while CT clear action doesn't and is just a header-rewrite to the current flow rule. But ct offload is done in post_parse and is per ct action instance, so ct clear offload is parsed multiple times, while its deleted once. Fix this by post_parsing the ct action only once per flow attribute (which is per flow rule) by using a offloaded ct_attr flag. Fixes: 08fe94ec5f77 ("net/mlx5e: TC, Remove special handling of CT action") Signed-off-by: Paul Blakey Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit 65e64640e97c0f223e77f9ea69b5a46186b93470 Author: Vlad Buslov Date: Thu Jun 8 09:32:10 2023 +0200 net/mlx5e: Check for NOT_READY flag state after locking Currently the check for NOT_READY flag is performed before obtaining the necessary lock. This opens a possibility for race condition when the flow is concurrently removed from unready_flows list by the workqueue task, which causes a double-removal from the list and a crash[0]. Fix the issue by moving the flag check inside the section protected by uplink_priv->unready_flows_lock mutex. [0]: [44376.389654] general protection fault, probably for non-canonical address 0xdead000000000108: 0000 [#1] SMP [44376.391665] CPU: 7 PID: 59123 Comm: tc Not tainted 6.4.0-rc4+ #1 [44376.392984] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [44376.395342] RIP: 0010:mlx5e_tc_del_fdb_flow+0xb3/0x340 [mlx5_core] [44376.396857] Code: 00 48 8b b8 68 ce 02 00 e8 8a 4d 02 00 4c 8d a8 a8 01 00 00 4c 89 ef e8 8b 79 88 e1 48 8b 83 98 06 00 00 48 8b 93 90 06 00 00 <48> 89 42 08 48 89 10 48 b8 00 01 00 00 00 00 ad de 48 89 83 90 06 [44376.399167] RSP: 0018:ffff88812cc97570 EFLAGS: 00010246 [44376.399680] RAX: dead000000000122 RBX: ffff8881088e3800 RCX: ffff8881881bac00 [44376.400337] RDX: dead000000000100 RSI: ffff88812cc97500 RDI: ffff8881242f71b0 [44376.401001] RBP: ffff88811cbb0940 R08: 0000000000000400 R09: 0000000000000001 [44376.401663] R10: 0000000000000001 R11: 0000000000000000 R12: ffff88812c944000 [44376.402342] R13: ffff8881242f71a8 R14: ffff8881222b4000 R15: 0000000000000000 [44376.402999] FS: 00007f0451104800(0000) GS:ffff88852cb80000(0000) knlGS:0000000000000000 [44376.403787] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [44376.404343] CR2: 0000000000489108 CR3: 0000000123a79003 CR4: 0000000000370ea0 [44376.405004] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [44376.405665] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [44376.406339] Call Trace: [44376.406651] [44376.406939] ? die_addr+0x33/0x90 [44376.407311] ? exc_general_protection+0x192/0x390 [44376.407795] ? asm_exc_general_protection+0x22/0x30 [44376.408292] ? mlx5e_tc_del_fdb_flow+0xb3/0x340 [mlx5_core] [44376.408876] __mlx5e_tc_del_fdb_peer_flow+0xbc/0xe0 [mlx5_core] [44376.409482] mlx5e_tc_del_flow+0x42/0x210 [mlx5_core] [44376.410055] mlx5e_flow_put+0x25/0x50 [mlx5_core] [44376.410529] mlx5e_delete_flower+0x24b/0x350 [mlx5_core] [44376.411043] tc_setup_cb_reoffload+0x22/0x80 [44376.411462] fl_reoffload+0x261/0x2f0 [cls_flower] [44376.411907] ? mlx5e_rep_indr_setup_ft_cb+0x160/0x160 [mlx5_core] [44376.412481] ? mlx5e_rep_indr_setup_ft_cb+0x160/0x160 [mlx5_core] [44376.413044] tcf_block_playback_offloads+0x76/0x170 [44376.413497] tcf_block_unbind+0x7b/0xd0 [44376.413881] tcf_block_setup+0x17d/0x1c0 [44376.414269] tcf_block_offload_cmd.isra.0+0xf1/0x130 [44376.414725] tcf_block_offload_unbind+0x43/0x70 [44376.415153] __tcf_block_put+0x82/0x150 [44376.415532] ingress_destroy+0x22/0x30 [sch_ingress] [44376.415986] qdisc_destroy+0x3b/0xd0 [44376.416343] qdisc_graft+0x4d0/0x620 [44376.416706] tc_get_qdisc+0x1c9/0x3b0 [44376.417074] rtnetlink_rcv_msg+0x29c/0x390 [44376.419978] ? rep_movs_alternative+0x3a/0xa0 [44376.420399] ? rtnl_calcit.isra.0+0x120/0x120 [44376.420813] netlink_rcv_skb+0x54/0x100 [44376.421192] netlink_unicast+0x1f6/0x2c0 [44376.421573] netlink_sendmsg+0x232/0x4a0 [44376.421980] sock_sendmsg+0x38/0x60 [44376.422328] ____sys_sendmsg+0x1d0/0x1e0 [44376.422709] ? copy_msghdr_from_user+0x6d/0xa0 [44376.423127] ___sys_sendmsg+0x80/0xc0 [44376.423495] ? ___sys_recvmsg+0x8b/0xc0 [44376.423869] __sys_sendmsg+0x51/0x90 [44376.424226] do_syscall_64+0x3d/0x90 [44376.424587] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [44376.425046] RIP: 0033:0x7f045134f887 [44376.425403] Code: 0a 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b9 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 [44376.426914] RSP: 002b:00007ffd63a82b98 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [44376.427592] RAX: ffffffffffffffda RBX: 000000006481955f RCX: 00007f045134f887 [44376.428195] RDX: 0000000000000000 RSI: 00007ffd63a82c00 RDI: 0000000000000003 [44376.428796] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000 [44376.429404] R10: 00007f0451208708 R11: 0000000000000246 R12: 0000000000000001 [44376.430039] R13: 0000000000409980 R14: 000000000047e538 R15: 0000000000485400 [44376.430644] [44376.430907] Modules linked in: mlx5_ib mlx5_core act_mirred act_tunnel_key cls_flower vxlan dummy sch_ingress openvswitch nsh rpcrdma rdma_ucm ib_iser libiscsi scsi_transport_iscsi ib_umad rdma_cm ib_ipoib iw_cm ib_cm ib_uverbs ib_core xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcsec_g ss_krb5 auth_rpcgss oid_registry overlay zram zsmalloc fuse [last unloaded: mlx5_core] [44376.433936] ---[ end trace 0000000000000000 ]--- [44376.434373] RIP: 0010:mlx5e_tc_del_fdb_flow+0xb3/0x340 [mlx5_core] [44376.434951] Code: 00 48 8b b8 68 ce 02 00 e8 8a 4d 02 00 4c 8d a8 a8 01 00 00 4c 89 ef e8 8b 79 88 e1 48 8b 83 98 06 00 00 48 8b 93 90 06 00 00 <48> 89 42 08 48 89 10 48 b8 00 01 00 00 00 00 ad de 48 89 83 90 06 [44376.436452] RSP: 0018:ffff88812cc97570 EFLAGS: 00010246 [44376.436924] RAX: dead000000000122 RBX: ffff8881088e3800 RCX: ffff8881881bac00 [44376.437530] RDX: dead000000000100 RSI: ffff88812cc97500 RDI: ffff8881242f71b0 [44376.438179] RBP: ffff88811cbb0940 R08: 0000000000000400 R09: 0000000000000001 [44376.438786] R10: 0000000000000001 R11: 0000000000000000 R12: ffff88812c944000 [44376.439393] R13: ffff8881242f71a8 R14: ffff8881222b4000 R15: 0000000000000000 [44376.439998] FS: 00007f0451104800(0000) GS:ffff88852cb80000(0000) knlGS:0000000000000000 [44376.440714] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [44376.441225] CR2: 0000000000489108 CR3: 0000000123a79003 CR4: 0000000000370ea0 [44376.441843] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [44376.442471] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Fixes: ad86755b18d5 ("net/mlx5e: Protect unready flows with dedicated lock") Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 631079e08aa4a20b73e70de4cf457886194f029f Author: Saeed Mahameed Date: Mon Jun 26 20:36:41 2023 -0700 net/mlx5: Register a unique thermal zone per device Prior to this patch only one "mlx5" thermal zone could have been registered regardless of the number of individual mlx5 devices in the system. To fix this setup a unique name per device to register its own thermal zone. In order to not register a thermal zone for a virtual device (VF/SF) add a check for PF device type. The new name is a concatenation between "mlx5_" and "", which will also help associating a thermal zone with its PCI device. $ lspci | grep ConnectX 00:04.0 Ethernet controller: Mellanox Technologies MT2892 Family [ConnectX-6 Dx] 00:05.0 Ethernet controller: Mellanox Technologies MT2892 Family [ConnectX-6 Dx] $ cat /sys/devices/virtual/thermal/thermal_zone0/type mlx5_0000:00:04.0 $ cat /sys/devices/virtual/thermal/thermal_zone1/type mlx5_0000:00:05.0 Fixes: c1fef618d611 ("net/mlx5: Implement thermal zone") CC: Sandipan Patra Signed-off-by: Saeed Mahameed commit 2e2d1965794d22fbe86df45bf4f933216743577d Author: Dragos Tatulea Date: Mon May 22 21:18:53 2023 +0300 net/mlx5e: RX, Fix flush and close release flow of regular rq for legacy rq Regular (non-XSK) RQs get flushed on XSK setup and re-activated on XSK close. If the same regular RQ is closed (a config change for example) soon after the XSK close, a double release occurs because the missing wqes get released a second time. Fixes: 3f93f82988bc ("net/mlx5e: RX, Defer page release in legacy rq for better recycling") Signed-off-by: Dragos Tatulea Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit d543b649ffe58a0cb4b6948b3305069c5980a1fa Author: Zhengchao Shao Date: Fri Jun 30 09:49:03 2023 +0800 net/mlx5e: fix memory leak in mlx5e_ptp_open When kvzalloc_node or kvzalloc failed in mlx5e_ptp_open, the memory pointed by "c" or "cparams" is not freed, which can lead to a memory leak. Fix by freeing the array in the error path. Fixes: 145e5637d941 ("net/mlx5e: Add TX PTP port object support") Signed-off-by: Zhengchao Shao Reviewed-by: Rahul Rameshbabu Reviewed-by: Gal Pressman Reviewed-by: Simon Horman Signed-off-by: Saeed Mahameed commit 3250affdc658557a41df9c5fb567723e421f8bf2 Author: Zhengchao Shao Date: Fri Jun 30 09:49:02 2023 +0800 net/mlx5e: fix memory leak in mlx5e_fs_tt_redirect_any_create The memory pointed to by the fs->any pointer is not freed in the error path of mlx5e_fs_tt_redirect_any_create, which can lead to a memory leak. Fix by freeing the memory in the error path, thereby making the error path identical to mlx5e_fs_tt_redirect_any_destroy(). Fixes: 0f575c20bf06 ("net/mlx5e: Introduce Flow Steering ANY API") Signed-off-by: Zhengchao Shao Reviewed-by: Simon Horman Reviewed-by: Rahul Rameshbabu Signed-off-by: Saeed Mahameed commit 884abe45a9014d0de2e6edb0630dfd64f23f1d1b Author: Zhengchao Shao Date: Wed Jun 28 08:59:34 2023 +0800 net/mlx5e: fix double free in mlx5e_destroy_flow_table In function accel_fs_tcp_create_groups(), when the ft->g memory is successfully allocated but the 'in' memory fails to be allocated, the memory pointed to by ft->g is released once. And in function accel_fs_tcp_create_table, mlx5e_destroy_flow_table is called to release the memory pointed to by ft->g again. This will cause double free problem. Fixes: c062d52ac24c ("net/mlx5e: Receive flow steering framework for accelerated TCP flows") Signed-off-by: Zhengchao Shao Signed-off-by: Saeed Mahameed commit fe1de55167963a1c0ebe1579e37a8a41495f0a81 Merge: 15ac468614e5e a4857d1afdd1f Author: Linus Torvalds Date: Wed Jul 5 10:54:43 2023 -0700 Merge tag 'soundwire-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire Pull soundwire updates from Vinod Koul: - Stream handling and slave alert handling - Qualcomm Soundwire v2.0.0 controller support - Intel ACE2.x initial support and code reorganization * tag 'soundwire-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: (55 commits) soundwire: stream: Make master_list ordered to prevent deadlocks soundwire: bus: Prevent lockdep asserts when stream has multiple buses soundwire: qcom: fix storing port config out-of-bounds soundwire: intel_ace2x: fix SND_SOC_SOF_HDA_MLINK dependency soundwire: debugfs: Add missing SCP registers soundwire: stream: Remove unnecessary gotos soundwire: stream: Invert logic on runtime alloc flags soundwire: stream: Remove unneeded checks for NULL bus soundwire: bandwidth allocation: Remove pointless variable soundwire: cadence: revisit parity injection soundwire: intel/cadence: update hardware reset sequence soundwire: intel_bus_common: enable interrupts last soundwire: intel_bus_common: update error log soundwire: amd: Improve error message in remove callback soundwire: debugfs: fix unbalanced pm_runtime_put() soundwire: qcom: fix unbalanced pm_runtime_put() soundwire: qcom: set clk stop need reset flag at runtime soundwire: qcom: add software workaround for bus clash interrupt assertion soundwire: qcom: wait for fifo to be empty before suspend soundwire: qcom: drop unused struct qcom_swrm_ctrl members ... commit 15ac468614e5e4fee82e1eb32568f427b0e51adc Merge: 2784d74bcc811 c61480a2ea5e5 Author: Linus Torvalds Date: Wed Jul 5 10:42:32 2023 -0700 Merge tag 'media/v6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - Lots of improvement at atomisp driver, which is starting to look in good shape - Mediatek vcodec driver has gained support for av1 and hevc stateless codecs - New sensor driver: ov01a10 - verisilicon driver has gained AV1 entropy helpers - tegra-video has gained support for Tegra20 parallel input - dvb core has gained an extra property to better support DVB-S2X - as usual, lots of cleanups, fixes and improvements on media drivers * tag 'media/v6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (253 commits) media: wl128x: fix a clang warning media: dvb: mb86a20s: get rid of a clang-15 warning media: cec: i2c: ch7322: also select REGMAP media: add HAS_IOPORT dependencies media: tc358746: select CONFIG_GENERIC_PHY media: mediatek: vcodec: Add dbgfs help function media: mediatek: vcodec: Add encode to support dbgfs media: mediatek: vcodec: Change dbgfs interface to support encode media: mediatek: vcodec: Get each instance format type media: mediatek: vcodec: Get each context resolution information media: mediatek: vcodec: Add a debugfs file to get different useful information media: mediatek: vcodec: Add debug params to control different log level media: mediatek: vcodec: Add debugfs interface to get debug information media: mediatek: vcodec: support stateless AV1 decoder media: verisilicon: Conditionally ignore native formats media: verisilicon: Enable AV1 decoder on rk3588 media: verisilicon: Add film grain feature to AV1 driver media: verisilicon: Add Rockchip AV1 decoder media: verisilicon: Add AV1 entropy helpers media: verisilicon: Compute motion vectors size for AV1 frames ... commit 175c241288c09f81eb7b44d65c1ef6045efa4d1a Author: Muhammad Husaini Zulkifli Date: Sat Jun 3 20:59:34 2023 +0800 igc: Fix TX Hang issue when QBV Gate is closed If a user schedules a Gate Control List (GCL) to close one of the QBV gates while also transmitting a packet to that closed gate, TX Hang will be happen. HW would not drop any packet when the gate is closed and keep queuing up in HW TX FIFO until the gate is re-opened. This patch implements the solution to drop the packet for the closed gate. This patch will also reset the adapter to perform SW initialization for each 1st Gate Control List (GCL) to avoid hang. This is due to the HW design, where changing to TSN transmit mode requires SW initialization. Intel Discrete I225/6 transmit mode cannot be changed when in dynamic mode according to Software User Manual Section 7.5.2.1. Subsequent Gate Control List (GCL) operations will proceed without a reset, as they already are in TSN Mode. Step to reproduce: DUT: 1) Configure GCL List with certain gate close. BASE=$(date +%s%N) tc qdisc replace dev $IFACE parent root handle 100 taprio \ num_tc 4 \ map 0 1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 \ queues 1@0 1@1 1@2 1@3 \ base-time $BASE \ sched-entry S 0x8 500000 \ sched-entry S 0x4 500000 \ flags 0x2 2) Transmit the packet to closed gate. You may use udp_tai application to transmit UDP packet to any of the closed gate. ./udp_tai -i -P 100000 -p 90 -c 1 -t <0/1> -u 30004 Fixes: ec50a9d437f0 ("igc: Add support for taprio offloading") Co-developed-by: Tan Tee Min Signed-off-by: Tan Tee Min Tested-by: Chwee Lin Choong Signed-off-by: Muhammad Husaini Zulkifli Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 2784d74bcc811e9d743398da38552e6f9c73e96b Merge: 2a95b03d4cf78 6127383217741 Author: Linus Torvalds Date: Wed Jul 5 10:34:30 2023 -0700 Merge tag 'trace-tools-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing tooling updates from Steven Rostedt: - Add cgroup support for rtla via the -C option - Add --house-keeping option that tells rtla where to place the housekeeping threads - Have rtla/timerlat have its own tracing instance instead of using the top level tracing instance that is the default for other tracing users to use - Add auto analysis to timerlat_hist - Have rtla start the tracers after creating the instances - Reduce rtla hwnoise down to 75% from 100% as it runs with preemption disabled and can cause system instability at 100% - Add support to run timerlat_top and timerlat_hist threads in user-space instead of just using the kernel tasks - Some minor clean ups and documentation changes * tag 'trace-tools-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: Documentation: Add tools/rtla timerlat -u option documentation rtla/timerlat_hist: Add timerlat user-space support rtla/timerlat_top: Add timerlat user-space support rtla/hwnoise: Reduce runtime to 75% rtla: Start the tracers after creating all instances rtla/timerlat_hist: Add auto-analysis support rtla/timerlat: Give timerlat auto analysis its own instance rtla: Automatically move rtla to a house-keeping cpu rtla: Change monitored_cpus from char * to cpu_set_t rtla: Add --house-keeping option rtla: Add -C cgroup support commit 2a95b03d4cf780611ac6903fddc79e6d9789966e Merge: 6cd06ab12d1af f8a473bf5db7a Author: Linus Torvalds Date: Wed Jul 5 10:28:38 2023 -0700 Merge tag 'parisc-for-6.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull more parisc architecture updates from Helge Deller: - Fix all compiler warnings in arch/parisc and drivers/parisc when compiled with W=1 * tag 'parisc-for-6.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: syscalls: Avoid compiler warnings with W=1 parisc: math-emu: Avoid compiler warnings with W=1 parisc: Raise minimal GCC version to 12.0.0 parisc: unwind: Avoid missing prototype warning for handle_interruption() parisc: smp: Add declaration for start_cpu_itimer() parisc: pdt: Get prototype for arch_report_meminfo() commit cca28ceac7c7857bc2d313777017585aef00bcc4 Author: Muhammad Husaini Zulkifli Date: Wed May 17 08:18:12 2023 +0800 igc: Remove delay during TX ring configuration Remove unnecessary delay during the TX ring configuration. This will cause delay, especially during link down and link up activity. Furthermore, old SKUs like as I225 will call the reset_adapter to reset the controller during TSN mode Gate Control List (GCL) setting. This will add more time to the configuration of the real-time use case. It doesn't mentioned about this delay in the Software User Manual. It might have been ported from legacy code I210 in the past. Fixes: 13b5b7fd6a4a ("igc: Add support for Tx/Rx rings") Signed-off-by: Muhammad Husaini Zulkifli Acked-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit ed89b74d2dc920cb61d3094e0e97ec8775b13086 Author: Muhammad Husaini Zulkifli Date: Mon May 15 14:03:36 2023 +0800 igc: Add condition for qbv_config_change_errors counter Add condition to increase the qbv counter during taprio qbv configuration only. There might be a case when TC already been setup then user configure the ETF/CBS qdisc and this counter will increase if no condition above. Fixes: ae4fe4698300 ("igc: Add qbv_config_change_errors counter") Signed-off-by: Muhammad Husaini Zulkifli Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 7497840d462c8f54c4888c22ab3726a8cde4b9a2 Author: Guenter Roeck Date: Tue Jul 4 12:01:44 2023 -0700 sh: Provide unxlate_dev_mem_ptr() in asm/io.h The unxlate_dev_mem_ptr() function has no prototype on the sh architecture which does not include asm-generic/io.h. This results in the following build failure: drivers/char/mem.c: In function 'read_mem': drivers/char/mem.c:164:25: error: implicit declaration of function 'unxlate_dev_mem_ptr' This compile error is now seen because commit 99b619b37ae1 ("mips: provide unxlate_dev_mem_ptr() in asm/io.h") removed the weak function which was previously in place to handle this problem. Add a trivial macro to the sh header to provide the now missing dummy function. Fixes: 99b619b37ae1 ("mips: provide unxlate_dev_mem_ptr() in asm/io.h") Cc: Arnd Bergmann Signed-off-by: Guenter Roeck Acked-by: Arnd Bergmann Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230704190144.2888679-1-linux@roeck-us.net Signed-off-by: John Paul Adrian Glaubitz commit 3ad4dcbc31d1a8860183cb01e507d75f296c661b Author: Artur Rojek Date: Sat May 27 18:44:52 2023 +0200 sh: dma: Correct the number of DMA channels for SH7709 According to the hardware manual [1], the DMAC found in the SH7709 SoC features only 4 channels. While at it, also sort the existing targets. [1] https://www.renesas.com/us/en/document/mah/sh7709s-group-hardware-manual (p. 373) Signed-off-by: Artur Rojek Reviewed-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230527164452.64797-4-contact@artur-rojek.eu Signed-off-by: John Paul Adrian Glaubitz commit d2f4a190b137b4a2e0ec3efe87905841dfdc8c66 Author: Artur Rojek Date: Sat May 27 18:44:51 2023 +0200 sh: dma: Drop incorrect SH_DMAC_BASE1 definition for SH4 None of the supported SH4 family SoCs features a second DMAC module. As this definition negatively impacts DMA channel calculation for the above targets, remove it from the code. Signed-off-by: Artur Rojek Reviewed-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230527164452.64797-3-contact@artur-rojek.eu Signed-off-by: John Paul Adrian Glaubitz commit e82e47584847129a20b8c9f4a1dcde09374fb0e0 Author: Artur Rojek Date: Sat May 27 18:44:50 2023 +0200 sh: dma: Fix DMA channel offset calculation Various SoCs of the SH3, SH4 and SH4A family, which use this driver, feature a differing number of DMA channels, which can be distributed between up to two DMAC modules. The existing implementation fails to correctly accommodate for all those variations, resulting in wrong channel offset calculations and leading to kernel panics. Rewrite dma_base_addr() in order to properly calculate channel offsets in a DMAC module. Fix dmaor_read_reg() and dmaor_write_reg(), so that the correct DMAC module base is selected for the DMAOR register. Fixes: 7f47c7189b3e8f19 ("sh: dma: More legacy cpu dma chainsawing.") Signed-off-by: Artur Rojek Reviewed-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230527164452.64797-2-contact@artur-rojek.eu Signed-off-by: John Paul Adrian Glaubitz commit 4bd04b2037423f11e6be03709d1fccdc6045c4a1 Author: Masahiro Yamada Date: Sun Feb 19 23:15:55 2023 +0900 sh: Remove compiler flag duplication Every compiler flag added by arch/sh/Makefile is passed to the compiler twice: $(KBUILD_CPPFLAGS) + $(KBUILD_CFLAGS) is used for compiling *.c $(KBUILD_CPPFLAGS) + $(KBUILD_AFLAGS) is used for compiling *.S Given the above, adding $(cflags-y) to all of KBUILD_{CPP/C/A}FLAGS ends up with duplication. Add -I options to $(KBUILD_CPPFLAGS), and the rest of $(cflags-y) to KBUILD_{C,A}FLAGS. Signed-off-by: Masahiro Yamada Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230219141555.2308306-4-masahiroy@kernel.org Signed-off-by: John Paul Adrian Glaubitz commit 01658fe3d6c02992846a038c8111e70ace169295 Author: Masahiro Yamada Date: Sun Feb 19 23:15:54 2023 +0900 sh: Refactor header include path addition Shorten the code. No functional change intended. Signed-off-by: Masahiro Yamada Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230219141555.2308306-3-masahiroy@kernel.org Signed-off-by: John Paul Adrian Glaubitz commit 9b4daf52b67b97ada589a0bd9bf127488f00925a Author: Masahiro Yamada Date: Sun Feb 19 23:15:53 2023 +0900 sh: Move build rule for cchips/hd6446x/ to arch/sh/Kbuild This is the last user of core-y in arch/sh. Use the standard obj-y syntax. Signed-off-by: Masahiro Yamada Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230219141555.2308306-2-masahiroy@kernel.org Signed-off-by: John Paul Adrian Glaubitz commit 706afcea16cd83fecb7c2229ccc31bb237ffdbef Author: Masahiro Yamada Date: Sun Feb 19 23:15:52 2023 +0900 sh: Fix -Wmissing-include-dirs warnings for various platforms The 0day bot reports a lot of warnings (or errors due to CONFIG_WERROR) like this: cc1: error: arch/sh/include/mach-hp6xx: No such file or directory [-Werror=missing-include-dirs] Indeed, arch/sh/include/mach-hp6xx does not exist. While -Wmissing-include-dirs is only a W=1 warning, it may be annoying when CONFIG_BTRFS_FS is enabled because fs/btrfs/Makefile unconditionally adds this warning option. arch/sh/Makefile defines machdir-y for two purposes: - Build platform code in arch/sh/boards/mach-*/ - Add arch/sh/include/mach-*/ to the header search path For the latter, some platforms use arch/sh/include/mach-common/ instead of having its own arch/sh/include/mach-*/. Drop unneeded machdir-y to omit non-existing include directories. To build arch/sh/boards/mach-*/, use the standard obj-y syntax in arch/sh/boards/Makefile. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202302190641.30VVXnPb-lkp@intel.com/ Signed-off-by: Masahiro Yamada Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230219141555.2308306-1-masahiroy@kernel.org Signed-off-by: John Paul Adrian Glaubitz commit 6cd06ab12d1afdab3847e7981f301bd0404aaa5c Author: Linus Torvalds Date: Wed Jul 5 09:33:31 2023 -0700 gup: make the stack expansion warning a bit more targeted I added a warning about about GUP no longer expanding the stack in commit a425ac5365f6 ("gup: add warning if some caller would seem to want stack expansion"), but didn't really expect anybody to hit it. And it's true that nobody seems to have hit a _real_ case yet, but we certainly have a number of reports of false positives. Which not only causes extra noise in itself, but might also end up hiding any real cases if they do exist. So let's tighten up the warning condition, and replace the simplistic vma = find_vma(mm, start); if (vma && (start < vma->vm_start)) { WARN_ON_ONCE(vma->vm_flags & VM_GROWSDOWN); with a vma = gup_vma_lookup(mm, start); helper function which works otherwise like just "vma_lookup()", but with some heuristics for when to warn about gup no longer causing stack expansion. In particular, don't just warn for "below the stack", but warn if it's _just_ below the stack (with "just below" arbitrarily defined as 64kB, because why not?). And rate-limit it to at most once per hour, which means that any false positives shouldn't completely hide subsequent reports, but we won't be flooding the logs about it either. The previous code triggered when some GUP user (chromium crashpad) accessing past the end of the previous vma, for example. That has never expanded the stack, it just causes GUP to return early, and as such we shouldn't be warning about it. This is still going trigger the randomized testers, but to mitigate the noise from that, use "dump_stack()" instead of "WARN_ON_ONCE()" to get the kernel call chain. We'll get the relevant information, but syzbot shouldn't get too upset about it. Also, don't even bother with the GROWSUP case, which would be using different heuristics entirely, but only happens on parisc. Reported-by: kernel test robot Reported-by: John Hubbard Reported-by: syzbot+6cf44e127903fdf9d929@syzkaller.appspotmail.com Signed-off-by: Linus Torvalds commit 479cdfe388a04a16fdd127f3e9e9e019e45e5573 Author: Sridhar Samudrala Date: Fri Jun 9 17:40:24 2023 -0700 ice: Fix tx queue rate limit when TCs are configured Configuring tx_maxrate via sysfs interface /sys/class/net/eth0/queues/tx-1/tx_maxrate was not working when TCs are configured because always main VSI was being used. Fix by using correct VSI in ice_set_tx_maxrate when TCs are configured. Fixes: 1ddef455f4a8 ("ice: Add NDO callback to set the maximum per-queue bitrate") Signed-off-by: Sridhar Samudrala Signed-off-by: Sudheer Mogilappagari Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen commit 5f16da6ee6ac32e6c8098bc4cfcc4f170694f9da Author: Sridhar Samudrala Date: Fri Jun 9 17:40:23 2023 -0700 ice: Fix max_rate check while configuring TX rate limits Remove incorrect check in ice_validate_mqprio_opt() that limits filter configuration when sum of max_rates of all TCs exceeds the link speed. The max rate of each TC is unrelated to value used by other TCs and is valid as long as it is less than link speed. Fixes: fbc7b27af0f9 ("ice: enable ndo_setup_tc support for mqprio_qdisc") Signed-off-by: Sridhar Samudrala Signed-off-by: Sudheer Mogilappagari Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen commit 31e9f406efae513156c129e9f7ad16b9f0ec7a65 Author: Maulik Shah Date: Mon Jul 3 14:50:26 2023 +0530 dt-bindings: soc: qcom: stats: Update maintainer email Replace my email. Cc: devicetree@vger.kernel.org Signed-off-by: Maulik Shah Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230703092026.4923-1-quic_mkshah@quicinc.com Signed-off-by: Rob Herring commit ad5d960168303a172b69bdf3708fecffb0810948 Author: Krzysztof Kozlowski Date: Sun Jul 2 20:23:08 2023 +0200 dt-bindings: cleanup DTS example whitespaces The DTS code coding style expects spaces around '=' sign. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Matthias Brugger Acked-by: Jonathan Cameron Reviewed-by: Conor Dooley Acked-by: Dmitry Baryshkov #display/msm Acked-by: Neil Armstrong Acked-by: Mike Leach Reviewed-by: Mathieu Poirier Acked-by: Vinod Koul Link: https://lore.kernel.org/r/20230702182308.7583-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit fddca7db4a4c17f7333793dfb5308d80c76d2896 Author: Steven Rostedt (Google) Date: Tue Jul 4 10:08:07 2023 -0400 tracing/boot: Test strscpy() against less than zero for error Instead of checking for -E2BIG, it is better to just check for less than zero of strscpy() for error. Testing for -E2BIG is not very robust, and the calling code does not really care about the error code, just that there was an error. One of the updates to convert strlcpy() to strscpy() had a v2 version that changed the test from testing against -E2BIG to less than zero, but I took the v1 version that still tested for -E2BIG. Link: https://lore.kernel.org/linux-trace-kernel/20230615180420.400769-1-azeemshaikh38@gmail.com/ Link: https://lore.kernel.org/linux-trace-kernel/20230704100807.707d1605@rorschach.local.home Cc: Mark Rutland Cc: Azeem Shaikh Cc: Kees Cook Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 6259f3443c6a376aa077816ac92e9ddeb0817d09 Author: Marc Zyngier Date: Mon Jul 3 19:31:26 2023 +0100 risc-v: Fix order of IPI enablement vs RCU startup Conor reports that risc-v tries to enable IPIs before telling the core code to enable RCU. With the introduction of the mapple tree as a backing store for the irq descriptors, this results in a very shouty boot sequence, as RCU is legitimately upset. Restore some sanity by moving the risc_ipi_enable() call after notify_cpu_starting(), which explicitly enables RCU on the calling CPU. Fixes: 832f15f42646 ("RISC-V: Treat IPIs as normal Linux IRQs") Reported-by: Conor Dooley Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230703-dupe-frying-79ae2ccf94eb@spud Cc: Anup Patel Cc: Palmer Dabbelt Cc: Linus Torvalds Tested-by: Conor Dooley Link: https://lore.kernel.org/r/20230703183126.1567625-1-maz@kernel.org Signed-off-by: Palmer Dabbelt commit 62ba41d2761206664a1fdc998051324457da2dd6 Author: John Hubbard Date: Mon Jul 3 12:00:44 2023 -0700 mm: riscv: fix an unsafe pte read in huge_pte_alloc() The WARN_ON_ONCE() statement in riscv's huge_pte_alloc() is susceptible to false positives, because the pte is read twice at the C language level, locklessly, within the same conditional statement. Depending on compiler behavior, this can lead to generated machine code that actually reads the pte just once, or twice. Reading twice will expose the code to changing pte values and cause incorrect behavior. In [1], similar code actually caused a kernel crash on 64-bit x86, when using clang to build the kernel, but only after the conversion from *pte reads, to ptep_get(pte). The latter uses READ_ONCE(), which forced a double read of *pte. Rather than waiting for the upcoming ptep_get() conversion, just convert this part of the code now, but in a way that avoids the above problem: take a single snapshot of the pte before using it in the WARN conditional. As expected, this preparatory step does not actually change the generated code ("make mm/hugetlbpage.s"), on riscv64, when using a gcc 12.2 cross compiler. [1] https://lore.kernel.org/20230630013203.1955064-1-jhubbard@nvidia.com Suggested-by: James Houghton Cc: Ryan Roberts Signed-off-by: John Hubbard Reviewed-by: Andrew Jones Reviewed-by: Ryan Roberts Link: https://lore.kernel.org/r/20230703190044.311730-1-jhubbard@nvidia.com Signed-off-by: Palmer Dabbelt commit aeb71e42caae2031ec849a858080d81462cacca9 Author: Conor Dooley Date: Sun Jul 2 00:10:01 2023 +0100 dt-bindings: riscv: deprecate riscv,isa intro ===== When the RISC-V dt-bindings were accepted upstream in Linux, the base ISA etc had yet to be ratified. By the ratification of the base ISA, incompatible changes had snuck into the specifications - for example the Zicsr and Zifencei extensions were spun out of the base ISA. Fast forward to today, and the reason for this patch. Currently the riscv,isa dt property permits only a specific subset of the ISA string - in particular it excludes version numbering. With the current constraints, it is not possible to discern whether "rv64i" means that the hart supports the fence.i instruction, for example. Future systems may choose to implement their own instruction fencing, perhaps using a vendor extension, or they may not implement the optional counter extensions. Software needs a way to determine this. versioning schemes ================== "Use the extension versions that are described in the ISA manual" you may say, and it's not like this has not been considered. Firstly, software that parses the riscv,isa property at runtime will need to contain a lookup table of some sort that maps arbitrary versions to versions it understands. There is not a consistent application of version number applied to extensions, with a higgledy-piggledy collection of tags, "bare" and versioned documents awaiting the reader on the "recently ratified extensions" page: https://wiki.riscv.org/display/HOME/Recently+Ratified+Extensions As an aside, and this is reflected in the patch too, since many extensions have yet to appear in a release of the ISA specs, they are defined by commits in their respective "working draft" repositories. Secondly, there is an issue of backwards compatibility, whereby allowing numbers in the ISA string, some parsers may be broken. This would require an additional property to be created to even use the versions in this manner. ~boolean properties~ string array property ========================================== If a new property is needed, the whole approach may as well be looked at from the bottom up. A string with limited character choices etc is hardly the best approach for communicating extension information to software. Switching to using properties that are defined on a per extension basis, allows us to define explicit meanings for the DT representation of each extension - rather than the current situation where different operating systems or other bits of software may impart different meanings to characters in the string. Clearly the best source of meanings is the specifications themselves, this just provides us the ability to choose at what point in time the meaning is set. If an extension changes incompatibility in the future, a new property will be required. Off-list, some of the RVI folks have committed to shoring up the wording in either the ISA specifications, the riscv-isa-manual or so that in the future, modifications to and additions or removals of features will require a new extension. Codifying that assertion somewhere would make it quite unlikely that compatibility would be broken, but we have the tools required to deal with it, if & when it crops up. It is in our collective interest, as consumers of extension meanings, to define a scheme that enforces compatibility. The use of individual elements, rather than a single string, will also permit validation that the properties have a meaning, as well as potentially reject mutually exclusive combinations, or enforce dependencies between extensions. That would not have be possible with the current dt-schema infrastructure for arbitrary strings, as we would need to add a riscv,isa parser to dt-validate! That's not implemented in this patch, but rather left as future work (for the brave, or the foolish). parser simplicity ================= Many systems that parse DT at runtime already implement an function that can check for the presence of a string in an array of string, as it is similar to the process for parsing a list of compatible strings, so a bunch of new, custom, DT parsing should not be needed. Getting rid of "riscv,isa" parsing would be a nice simplification, but unfortunately for backwards compatibility with old dtbs, existing parsers may not be removable - which may greatly simplify dt parsing code. In Linux, for example, checking for whether a hart supports an extension becomes as simple as: of_property_match_string(node, "riscv,isa-extensions", "zicbom") vendor extensions ================= Compared to riscv,isa, this proposed scheme promotes vendor extensions, oft touted as the strength of RISC-V, to first-class citizens. At present, extensions are defined as meaning what the RISC-V ISA specifications say they do. There is no realistic way of using that interface to provide cross-platform definitions for what vendor extensions mean. Vendor extensions may also have even less consistency than RVI do in terms of versioning, or no care about backwards compatibility. The new property allows us to assign explicit meanings on a per vendor extension basis, backed up by a description of their meanings. fin === Create a new file to store the extension meanings and a new riscv,isa-base property to replace the aspect of riscv,isa that is not represented by the new property - the base ISA implemented by a hart. As a starting point, add properties for extensions currently used in Linux. Finally, mark riscv,isa as deprecated, as removing support for it in existing programs would be an ABI break. CC: Palmer Dabbelt CC: Paul Walmsley CC: Rob Herring CC: Krzysztof Kozlowski CC: Alistair Francis CC: Andrew Jones CC: Anup Patel CC: Atish Patra CC: Jessica Clarke CC: Rick Chen CC: Leo CC: Oleksii CC: linux-riscv@lists.infradead.org CC: qemu-riscv@nongnu.org CC: u-boot@lists.denx.de CC: devicetree@vger.kernel.org CC: linux-kernel@vger.kernel.org Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Reviewed-by: Rob Herring Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20230702-eats-scorebook-c951f170d29f@spud Signed-off-by: Palmer Dabbelt commit c03226ba15fe3c42d13907ec7d8536396602557b Author: Srinivas Kandagatla Date: Wed Jul 5 13:57:23 2023 +0100 ASoC: codecs: wcd938x: fix dB range for HPHL and HPHR dB range for HPHL and HPHR gains are from +6dB to -30dB in steps of 1.5dB with register values range from 0 to 24. Current code maps these dB ranges incorrectly, fix them to allow proper volume setting. Fixes: e8ba1e05bdc0 ("ASoC: codecs: wcd938x: add basic controls") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230705125723.40464-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 4f3fcf5f6dc8ab561e152c8747fd7e502b32266c Author: Srinivas Kandagatla Date: Wed Jul 5 13:48:50 2023 +0100 ASoC: qcom: q6afe-dai: fix Display Port Playback stream name With recent changes to add more display ports did not change the Stream name in q6afe-dai. This results in below error "ASoC: Failed to add route DISPLAY_PORT_RX -> Display Port Playback(*)" and sound card fails to probe. Fix this by adding correct stream name. Fixes: 90848a2557fe ("ASoC: qcom: q6dsp: add support to more display ports") Reported-by: Amit Pundir Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230705124850.40069-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 931a2ca6a5ba4bfa6062aa9475d4e6a835d75e83 Author: Arnd Bergmann Date: Fri Jun 23 17:21:55 2023 +0200 arm64: ftrace: fix build error with CONFIG_FUNCTION_GRAPH_TRACER=n It appears that a merge conflict ended up hiding a newly added constant in some configurations: arch/arm64/kernel/entry-ftrace.S: Assembler messages: arch/arm64/kernel/entry-ftrace.S:59: Error: undefined symbol FTRACE_OPS_DIRECT_CALL used as an immediate value FTRACE_OPS_DIRECT_CALL is still used when CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS is enabled, even if CONFIG_FUNCTION_GRAPH_TRACER is disabled, so change the ifdef accordingly. Link: https://lkml.kernel.org/r/20230623152204.2216297-1-arnd@kernel.org Cc: Will Deacon Cc: Mark Rutland Cc: Donglin Peng Fixes: 3646970322464 ("arm64: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL") Signed-off-by: Arnd Bergmann Acked-by: Florent Revest Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Acked-by: Catalin Marinas Signed-off-by: Steven Rostedt (Google) commit 02b0095e2fbbc060560c1065f86a211d91e27b26 Author: Mateusz Stachyra Date: Tue Jul 4 12:27:06 2023 +0200 tracing: Fix null pointer dereference in tracing_err_log_open() Fix an issue in function 'tracing_err_log_open'. The function doesn't call 'seq_open' if the file is opened only with write permissions, which results in 'file->private_data' being left as null. If we then use 'lseek' on that opened file, 'seq_lseek' dereferences 'file->private_data' in 'mutex_lock(&m->lock)', resulting in a kernel panic. Writing to this node requires root privileges, therefore this bug has very little security impact. Tracefs node: /sys/kernel/tracing/error_log Example Kernel panic: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000038 Call trace: mutex_lock+0x30/0x110 seq_lseek+0x34/0xb8 __arm64_sys_lseek+0x6c/0xb8 invoke_syscall+0x58/0x13c el0_svc_common+0xc4/0x10c do_el0_svc+0x24/0x98 el0_svc+0x24/0x88 el0t_64_sync_handler+0x84/0xe4 el0t_64_sync+0x1b4/0x1b8 Code: d503201f aa0803e0 aa1f03e1 aa0103e9 (c8e97d02) ---[ end trace 561d1b49c12cf8a5 ]--- Kernel panic - not syncing: Oops: Fatal exception Link: https://lore.kernel.org/linux-trace-kernel/20230703155237eucms1p4dfb6a19caa14c79eb6c823d127b39024@eucms1p4 Link: https://lore.kernel.org/linux-trace-kernel/20230704102706eucms1p30d7ecdcc287f46ad67679fc8491b2e0f@eucms1p3 Cc: stable@vger.kernel.org Fixes: 8a062902be725 ("tracing: Add tracing error log") Signed-off-by: Mateusz Stachyra Suggested-by: Steven Rostedt Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 515ad530795c118f012539ed76d02bacfd426d89 Author: Thadeu Lima de Souza Cascardo Date: Wed Jul 5 09:12:55 2023 -0300 netfilter: nf_tables: do not ignore genmask when looking up chain by id When adding a rule to a chain referring to its ID, if that chain had been deleted on the same batch, the rule might end up referring to a deleted chain. This will lead to a WARNING like following: [ 33.098431] ------------[ cut here ]------------ [ 33.098678] WARNING: CPU: 5 PID: 69 at net/netfilter/nf_tables_api.c:2037 nf_tables_chain_destroy+0x23d/0x260 [ 33.099217] Modules linked in: [ 33.099388] CPU: 5 PID: 69 Comm: kworker/5:1 Not tainted 6.4.0+ #409 [ 33.099726] Workqueue: events nf_tables_trans_destroy_work [ 33.100018] RIP: 0010:nf_tables_chain_destroy+0x23d/0x260 [ 33.100306] Code: 8b 7c 24 68 e8 64 9c ed fe 4c 89 e7 e8 5c 9c ed fe 48 83 c4 08 5b 41 5c 41 5d 41 5e 41 5f 5d 31 c0 89 c6 89 c7 c3 cc cc cc cc <0f> 0b 48 83 c4 08 5b 41 5c 41 5d 41 5e 41 5f 5d 31 c0 89 c6 89 c7 [ 33.101271] RSP: 0018:ffffc900004ffc48 EFLAGS: 00010202 [ 33.101546] RAX: 0000000000000001 RBX: ffff888006fc0a28 RCX: 0000000000000000 [ 33.101920] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 33.102649] RBP: ffffc900004ffc78 R08: 0000000000000000 R09: 0000000000000000 [ 33.103018] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880135ef500 [ 33.103385] R13: 0000000000000000 R14: dead000000000122 R15: ffff888006fc0a10 [ 33.103762] FS: 0000000000000000(0000) GS:ffff888024c80000(0000) knlGS:0000000000000000 [ 33.104184] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 33.104493] CR2: 00007fe863b56a50 CR3: 00000000124b0001 CR4: 0000000000770ee0 [ 33.104872] PKRU: 55555554 [ 33.104999] Call Trace: [ 33.105113] [ 33.105214] ? show_regs+0x72/0x90 [ 33.105371] ? __warn+0xa5/0x210 [ 33.105520] ? nf_tables_chain_destroy+0x23d/0x260 [ 33.105732] ? report_bug+0x1f2/0x200 [ 33.105902] ? handle_bug+0x46/0x90 [ 33.106546] ? exc_invalid_op+0x19/0x50 [ 33.106762] ? asm_exc_invalid_op+0x1b/0x20 [ 33.106995] ? nf_tables_chain_destroy+0x23d/0x260 [ 33.107249] ? nf_tables_chain_destroy+0x30/0x260 [ 33.107506] nf_tables_trans_destroy_work+0x669/0x680 [ 33.107782] ? mark_held_locks+0x28/0xa0 [ 33.107996] ? __pfx_nf_tables_trans_destroy_work+0x10/0x10 [ 33.108294] ? _raw_spin_unlock_irq+0x28/0x70 [ 33.108538] process_one_work+0x68c/0xb70 [ 33.108755] ? lock_acquire+0x17f/0x420 [ 33.108977] ? __pfx_process_one_work+0x10/0x10 [ 33.109218] ? do_raw_spin_lock+0x128/0x1d0 [ 33.109435] ? _raw_spin_lock_irq+0x71/0x80 [ 33.109634] worker_thread+0x2bd/0x700 [ 33.109817] ? __pfx_worker_thread+0x10/0x10 [ 33.110254] kthread+0x18b/0x1d0 [ 33.110410] ? __pfx_kthread+0x10/0x10 [ 33.110581] ret_from_fork+0x29/0x50 [ 33.110757] [ 33.110866] irq event stamp: 1651 [ 33.111017] hardirqs last enabled at (1659): [] __up_console_sem+0x79/0xa0 [ 33.111379] hardirqs last disabled at (1666): [] __up_console_sem+0x5e/0xa0 [ 33.111740] softirqs last enabled at (1616): [] __irq_exit_rcu+0x9e/0xe0 [ 33.112094] softirqs last disabled at (1367): [] __irq_exit_rcu+0x9e/0xe0 [ 33.112453] ---[ end trace 0000000000000000 ]--- This is due to the nft_chain_lookup_byid ignoring the genmask. After this change, adding the new rule will fail as it will not find the chain. Fixes: 837830a4b439 ("netfilter: nf_tables: add NFTA_RULE_CHAIN_ID attribute") Cc: stable@vger.kernel.org Reported-by: Mingi Cho of Theori working with ZDI Signed-off-by: Thadeu Lima de Souza Cascardo Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit eaf9e7192ec9af2fbf1b6eb2299dd0feca6c5f7e Author: Florian Westphal Date: Tue Jul 4 12:25:23 2023 +0200 netfilter: conntrack: don't fold port numbers into addresses before hashing Originally this used jhash2() over tuple and folded the zone id, the pernet hash value, destination port and l4 protocol number into the 32bit seed value. When the switch to siphash was done, I used an on-stack temporary buffer to build a suitable key to be hashed via siphash(). But this showed up as performance regression, so I got rid of the temporary copy and collected to-be-hashed data in 4 u64 variables. This makes it easy to build tuples that produce the same hash, which isn't desirable even though chain lengths are limited. Switch back to plain siphash, but just like with jhash2(), take advantage of the fact that most of to-be-hashed data is already in a suitable order. Use an empty struct as annotation in 'struct nf_conntrack_tuple' to mark last member that can be used as hash input. The only remaining data that isn't present in the tuple structure are the zone identifier and the pernet hash: fold those into the key. Fixes: d2c806abcf0b ("netfilter: conntrack: use siphash_4u64") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6eef7a2b933885a17679eb8ed0796ddf0ee5309b Author: Florent Revest Date: Mon Jul 3 16:52:16 2023 +0200 netfilter: conntrack: Avoid nf_ct_helper_hash uses after free If nf_conntrack_init_start() fails (for example due to a register_nf_conntrack_bpf() failure), the nf_conntrack_helper_fini() clean-up path frees the nf_ct_helper_hash map. When built with NF_CONNTRACK=y, further netfilter modules (e.g: netfilter_conntrack_ftp) can still be loaded and call nf_conntrack_helpers_register(), independently of whether nf_conntrack initialized correctly. This accesses the nf_ct_helper_hash dangling pointer and causes a uaf, possibly leading to random memory corruption. This patch guards nf_conntrack_helper_register() from accessing a freed or uninitialized nf_ct_helper_hash pointer and fixes possible uses-after-free when loading a conntrack module. Cc: stable@vger.kernel.org Fixes: 12f7a505331e ("netfilter: add user-space connection tracking helper infrastructure") Signed-off-by: Florent Revest Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 8a9dc07ba92497a81f1ff65d25c2ba7b6f9a8bdc Author: Florian Westphal Date: Mon Jul 3 13:43:18 2023 +0200 netfilter: conntrack: gre: don't set assured flag for clash entries Now that conntrack core is allowd to insert clashing entries, make sure GRE won't set assured flag on NAT_CLASH entries, just like UDP. Doing so prevents early_drop logic for these entries. Fixes: d671fd82eaa9 ("netfilter: conntrack: allow insertion clash of gre protocol") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 1689f25924ada8fe14a4a82c38925d04994c7142 Author: Pablo Neira Ayuso Date: Wed Jun 28 16:24:27 2023 +0200 netfilter: nf_tables: report use refcount overflow Overflow use refcount checks are not complete. Add helper function to deal with object reference counter tracking. Report -EMFILE in case UINT_MAX is reached. nft_use_dec() splats in case that reference counter underflows, which should not ever happen. Add nft_use_inc_restore() and nft_use_dec_restore() which are used to restore reference counter from error and abort paths. Use u32 in nft_flowtable and nft_object since helper functions cannot work on bitfields. Remove the few early incomplete checks now that the helper functions are in place and used to check for refcount overflow. Fixes: 96518518cc41 ("netfilter: add nftables") Signed-off-by: Pablo Neira Ayuso commit bf62eec5cdecbe7eeab02407da98f36cd7b1dea7 Author: Shuming Fan Date: Wed Jul 5 12:29:14 2023 +0800 ASoC: rt5645: check return value after reading device id If the I2C controller encounters some problems like timed-out, the codec driver will report the error code for the first read. Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20230705042915.24932-1-shumingf@realtek.com Signed-off-by: Mark Brown commit d9ba2975e98a4bec0a9f8d4be4c1de8883fccb71 Author: Nathan Chancellor Date: Mon Jul 3 14:43:15 2023 -0700 ASoC: cs35l45: Select REGMAP_IRQ After commit 6085f9e6dc19 ("ASoC: cs35l45: IRQ support"), without any other configuration that selects CONFIG_REGMAP_IRQ, modpost errors out with: ERROR: modpost: "regmap_irq_get_virq" [sound/soc/codecs/snd-soc-cs35l45.ko] undefined! ERROR: modpost: "devm_regmap_add_irq_chip" [sound/soc/codecs/snd-soc-cs35l45.ko] undefined! Add the Kconfig selection to ensure these functions get built and included, which resolves the build failure. Cc: stable@vger.kernel.org Fixes: 6085f9e6dc19 ("ASoC: cs35l45: IRQ support") Reported-by: Marcus Seyfarth Closes: https://github.com/ClangBuiltLinux/linux/issues/1882 Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20230703-cs35l45-select-regmap_irq-v1-1-37d7e838b614@kernel.org Signed-off-by: Mark Brown commit 7f34e01f77f811ecb2ef83e60301b38cf89af466 Author: Karol Wachowski Date: Mon Jul 3 10:07:25 2023 +0200 accel/ivpu: Clear specific interrupt status bits on C0 MTL C0 stepping fixed issue related to butrress interrupt status clearing, to clear an interrupt status it is required to write 1 to specific status bit field. This allows to execute read, modify and write routine. Writing 0 will not clear the interrupt and will cause interrupt storm. Fixes: 35b137630f08 ("accel/ivpu: Introduce a new DRM driver for Intel VPU") Cc: stable@vger.kernel.org # 6.3.x Signed-off-by: Karol Wachowski Reviewed-by: Jacek Lawrynowicz Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230703080725.2065635-2-stanislaw.gruszka@linux.intel.com commit 020b527b556a35cf636015c1c3cbdfe7c7acd5f0 Author: Karol Wachowski Date: Mon Jul 3 10:07:24 2023 +0200 accel/ivpu: Fix VPU register access in irq disable Incorrect REGB_WR32() macro was used to access VPUIP register. Use correct REGV_WR32(). Fixes: 35b137630f08 ("accel/ivpu: Introduce a new DRM driver for Intel VPU") Cc: stable@vger.kernel.org # 6.3.x Signed-off-by: Karol Wachowski Reviewed-by: Jacek Lawrynowicz Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230703080725.2065635-1-stanislaw.gruszka@linux.intel.com commit c451410ca7e3d8eeb31d141fc20c200e21754ba4 Merge: 80de809bd35e2 61d9658050260 Author: David S. Miller Date: Wed Jul 5 10:51:14 2023 +0100 Merge branch 'mptcp-fixes' Matthieu Baerts says: ==================== mptcp: fixes for v6.5 Here is a first batch of fixes for v6.5 and older. The fixes are not linked to each others. Patch 1 ensures subflows are unhashed before cleaning the backlog to avoid races. This fixes another recent fix from v6.4. Patch 2 does not rely on implicit state check in mptcp_listen() to avoid races when receiving an MP_FASTCLOSE. A regression from v5.17. The rest fixes issues in the selftests. Patch 3 makes sure errors when setting up the environment are no longer ignored. For v5.17+. Patch 4 uses 'iptables-legacy' if available to be able to run on older kernels. A fix for v5.13 and newer. Patch 5 catches errors when issues are detected with packet marks. Also for v5.13+. Patch 6 uses the correct variable instead of an undefined one. Even if there was no visible impact, it can help to find regressions later. An issue visible in v5.19+. Patch 7 makes sure errors with some sub-tests are reported to have the selftest marked as failed as expected. Also for v5.19+. Patch 8 adds a kernel config that is required to execute MPTCP selftests. It is valid for v5.9+. Patch 9 fixes issues when validating the userspace path-manager with 32-bit arch, an issue affecting v5.19+. ==================== Signed-off-by: Matthieu Baerts commit 61d9658050260dbcbf9055479b7ac5bbbe1e8831 Author: Matthieu Baerts Date: Tue Jul 4 22:44:41 2023 +0200 selftests: mptcp: pm_nl_ctl: fix 32-bit support When using pm_nl_ctl to validate userspace path-manager's behaviours, it was failing on 32-bit architectures ~half of the time. pm_nl_ctl was not reporting any error but the command was not doing what it was expected to do. As a result, the expected linked event was not triggered after and the test failed. This is due to the fact the token given in argument to the application was parsed as an integer with atoi(): in a 32-bit arch, if the number was bigger than INT_MAX, 2147483647 was used instead. This can simply be fixed by using strtoul() instead of atoi(). The errors have been seen "by chance" when manually looking at the results from LKFT. Fixes: 9a0b36509df0 ("selftests: mptcp: support MPTCP_PM_CMD_ANNOUNCE") Cc: stable@vger.kernel.org Fixes: ecd2a77d672f ("selftests: mptcp: support MPTCP_PM_CMD_REMOVE") Fixes: cf8d0a6dfd64 ("selftests: mptcp: support MPTCP_PM_CMD_SUBFLOW_CREATE") Fixes: 57cc361b8d38 ("selftests: mptcp: support MPTCP_PM_CMD_SUBFLOW_DESTROY") Fixes: ca188a25d43f ("selftests: mptcp: userspace PM support for MP_PRIO signals") Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit 6c8880fcaa5c45355179b759c1d11737775e31fc Author: Matthieu Baerts Date: Tue Jul 4 22:44:40 2023 +0200 selftests: mptcp: depend on SYN_COOKIES MPTCP selftests are using TCP SYN Cookies for quite a while now, since v5.9. Some CIs don't have this config option enabled and this is causing issues in the tests: # ns1 MPTCP -> ns1 (10.0.1.1:10000 ) MPTCP (duration 167ms) sysctl: cannot stat /proc/sys/net/ipv4/tcp_syncookies: No such file or directory # [ OK ]./mptcp_connect.sh: line 554: [: -eq: unary operator expected There is no impact in the results but the test is not doing what it is supposed to do. Fixes: fed61c4b584c ("selftests: mptcp: make 2nd net namespace use tcp syn cookies unconditionally") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit 966c6c3adfb1257ea8a839cdfad2b74092cc5532 Author: Matthieu Baerts Date: Tue Jul 4 22:44:39 2023 +0200 selftests: mptcp: userspace_pm: report errors with 'remove' tests A message was mentioning an issue with the "remove" tests but the selftest was not marked as failed. Directly exit with an error like it is done everywhere else in this selftest. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: 259a834fadda ("selftests: mptcp: functional tests for the userspace PM type") Cc: stable@vger.kernel.org Acked-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit d8566d0e03922217f70d9be2d401fcb860986374 Author: Matthieu Baerts Date: Tue Jul 4 22:44:38 2023 +0200 selftests: mptcp: userspace_pm: use correct server port "server4_port" variable is not set but "app4_port" is the server port in v4 and the correct variable name to use. The port is optional so there was no visible impact. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: ca188a25d43f ("selftests: mptcp: userspace PM support for MP_PRIO signals") Cc: stable@vger.kernel.org Acked-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit 9ac4c28eb70cd5ea5472a5e1c495dcdd597d4597 Author: Matthieu Baerts Date: Tue Jul 4 22:44:37 2023 +0200 selftests: mptcp: sockopt: return error if wrong mark When an error was detected when checking the marks, a message was correctly printed mentioning the error but followed by another one saying everything was OK and the selftest was not marked as failed as expected. Now the 'ret' variable is directly set to 1 in order to make sure the exit is done with an error, similar to what is done in other functions. While at it, the error is correctly propagated to the caller. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: dc65fe82fb07 ("selftests: mptcp: add packet mark test case") Cc: stable@vger.kernel.org Acked-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit a5a5990c099dd354e05e89ee77cd2dbf6655d4a1 Author: Matthieu Baerts Date: Tue Jul 4 22:44:36 2023 +0200 selftests: mptcp: sockopt: use 'iptables-legacy' if available IPTables commands using 'iptables-nft' fail on old kernels, at least on v5.15 because it doesn't see the default IPTables chains: $ iptables -L iptables/1.8.2 Failed to initialize nft: Protocol not supported As a first step before switching to NFTables, we can use iptables-legacy if available. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: dc65fe82fb07 ("selftests: mptcp: add packet mark test case") Cc: stable@vger.kernel.org Acked-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit 221e4550454a822f9a11834e30694c7d1d65747c Author: Matthieu Baerts Date: Tue Jul 4 22:44:35 2023 +0200 selftests: mptcp: connect: fail if nft supposed to work In case of "external" errors when preparing the environment for the TProxy tests, the subtests were marked as skipped. This is fine but it means these errors are ignored. On MPTCP Public CI, we do want to catch such issues and mark the selftest as failed if there are such issues. We can then use mptcp_lib_fail_if_expected_feature() helper that has been recently added to fail if needed. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: 5fb62e9cd3ad ("selftests: mptcp: add tproxy test case") Cc: stable@vger.kernel.org Acked-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit 0226436acf2495cde4b93e7400e5a87305c26054 Author: Paolo Abeni Date: Tue Jul 4 22:44:34 2023 +0200 mptcp: do not rely on implicit state check in mptcp_listen() Since the blamed commit, closing the first subflow resets the first subflow socket state to SS_UNCONNECTED. The current mptcp listen implementation relies only on such state to prevent touching not-fully-disconnected sockets. Incoming mptcp fastclose (or paired endpoint removal) unconditionally closes the first subflow. All the above allows an incoming fastclose followed by a listen() call to successfully race with a blocking recvmsg(), potentially causing the latter to hit a divide by zero bug in cleanup_rbuf/__tcp_select_window(). Address the issue explicitly checking the msk socket state in mptcp_listen(). An alternative solution would be moving the first subflow socket state update into mptcp_disconnect(), but in the long term the first subflow socket should be removed: better avoid relaying on it for internal consistency check. Fixes: b29fcfb54cd7 ("mptcp: full disconnect implementation") Cc: stable@vger.kernel.org Reported-by: Christoph Paasch Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/414 Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit 3fffa15bfef48b0ad6424779c03e68ae8ace5acb Author: Paolo Abeni Date: Tue Jul 4 22:44:33 2023 +0200 mptcp: ensure subflow is unhashed before cleaning the backlog While tacking care of the mptcp-level listener I unintentionally moved the subflow level unhash after the subflow listener backlog cleanup. That could cause some nasty race and makes the code harder to read. Address the issue restoring the proper order of operations. Fixes: 57fc0f1ceaa4 ("mptcp: ensure listener is unhashed before updating the sk status") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit 5284876d82da4453df0e21f1d243b026281a6558 Merge: 72cea3a3175b5 983b9180db962 Author: Takashi Iwai Date: Wed Jul 5 11:50:51 2023 +0200 Merge branch 'topic/midi20' into for-linus Pull yet more a typo fix in the converter code. Signed-off-by: Takashi Iwai commit 983b9180db96255183c30f69fe43c0db75bf8502 Author: Minjie Du Date: Wed Jul 5 17:35:45 2023 +0800 ALSA: seq: ump: fix typo in system_2p_ev_to_ump_midi1() Fix data->system.parm2 typo. Fixes: e9e02819a98a ("ALSA: seq: Automatic conversion of UMP events") Signed-off-by: Minjie Du Link: https://lore.kernel.org/r/20230705093545.14695-1-duminjie@vivo.com Signed-off-by: Takashi Iwai commit 80de809bd35e2a8999edf9f5aaa2d8de18921f11 Author: Thorsten Winkler Date: Tue Jul 4 16:41:21 2023 +0200 s390/qeth: Fix vipa deletion Change boolean parameter of function "qeth_l3_vipa_store" inside the "qeth_l3_dev_vipa_del4_store" function from "true" to "false" because "true" is used for adding a virtual ip address and "false" for deleting. Fixes: 2390166a6b45 ("s390/qeth: clean up L3 sysfs code") Reviewed-by: Alexandra Winter Reviewed-by: Wenjia Zhang Signed-off-by: Thorsten Winkler Signed-off-by: Alexandra Winter Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit fe3e0a13e597c1c8617814bf9b42ab732db5c26e Author: Juergen Gross Date: Mon Jul 3 15:00:32 2023 +0200 x86/xen: Fix secondary processors' FPU initialization Moving the call of fpu__init_cpu() from cpu_init() to start_secondary() broke Xen PV guests, as those don't call start_secondary() for APs. Call fpu__init_cpu() in Xen's cpu_bringup(), which is the Xen PV replacement of start_secondary(). Fixes: b81fac906a8f ("x86/fpu: Move FPU initialization into arch_cpu_finalize_init()") Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Boris Ostrovsky Acked-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230703130032.22916-1-jgross@suse.com commit d3dccb0a487d065ce097e565d9ca8ae85d892a55 Author: David Howells Date: Tue Jul 4 16:56:24 2023 +0100 crypto: af_alg - Fix merging of written data into spliced pages af_alg_sendmsg() takes data-to-be-copied that's provided by write(), send(), sendmsg() and similar into pages that it allocates and will merge new data into the last page in the list, based on the value of ctx->merge. Now that af_alg_sendmsg() accepts MSG_SPLICE_PAGES, it adds spliced pages directly into the list and then incorrectly appends data to them if there's space left because ctx->merge says that it can. This was cleared by af_alg_sendpage(), but that got lost. Fix this by skipping the merge if MSG_SPLICE_PAGES is specified and clearing ctx->merge after MSG_SPLICE_PAGES has added stuff to the list. Fixes: bf63e250c4b1 ("crypto: af_alg: Support MSG_SPLICE_PAGES") Reported-by: Ondrej Mosnáček Link: https://lore.kernel.org/r/CAAUqJDvFuvms55Td1c=XKv6epfRnnP78438nZQ-JKyuCptGBiQ@mail.gmail.com/ Signed-off-by: David Howells cc: Herbert Xu cc: Paolo Abeni cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org Signed-off-by: Herbert Xu commit d528014517f2b0531862c02865b9d4c908019dc4 Author: Linus Torvalds Date: Tue Jul 4 15:05:12 2023 -0700 Revert ".gitignore: ignore *.cover and *.mbx" This reverts commit 534066a983df0935847061c844eb178f8a53a9e7. It's actively detrimental in that it hides files that shouldn't be hidden. If I have some b4 mbx file in my git directory, it either was already applied with "git am" and is now stale, or maybe it's waiting for that to happen. In neither case is "ignore it" the right option. Signed-off-by: Linus Torvalds commit 04f2933d375e3f90d4435b7b518d3065afd1fa25 Merge: 03275585cabd0 b5ec6fd286dfa Author: Linus Torvalds Date: Tue Jul 4 13:50:38 2023 -0700 Merge tag 'core_guards_for_6.5_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue Pull scope-based resource management infrastructure from Peter Zijlstra: "These are the first few patches in the Scope-based Resource Management series that introduce the infrastructure but not any conversions as of yet. Adding the infrastructure now allows multiple people to start using them. Of note is that Sparse will need some work since it doesn't yet understand this attribute and might have decl-after-stmt issues" * tag 'core_guards_for_6.5_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue: kbuild: Drop -Wdeclaration-after-statement locking: Introduce __cleanup() based infrastructure apparmor: Free up __cleanup() name dmaengine: ioat: Free up __cleanup() name commit 03275585cabd0240944f19f33d7584a1b099a3a8 Author: David Howells Date: Tue Jul 4 20:22:15 2023 +0100 afs: Fix accidental truncation when storing data When an AFS FS.StoreData RPC call is made, amongst other things it is given the resultant file size to be. On the server, this is processed by truncating the file to new size and then writing the data. Now, kafs has a lock (vnode->io_lock) that serves to serialise operations against a specific vnode (ie. inode), but the parameters for the op are set before the lock is taken. This allows two writebacks (say sync and kswapd) to race - and if writes are ongoing the writeback for a later write could occur before the writeback for an earlier one if the latter gets interrupted. Note that afs_writepages() cannot take i_mutex and only takes a shared lock on vnode->validate_lock. Also note that the server does the truncation and the write inside a lock, so there's no problem at that end. Fix this by moving the calculation for the proposed new i_size inside the vnode->io_lock. Also reset the iterator (which we might have read from) and update the mtime setting there. Fixes: bd80d8a80e12 ("afs: Use ITER_XARRAY for writing") Reported-by: Marc Dionne Signed-off-by: David Howells Reviewed-by: Jeffrey Altman Reviewed-by: Marc Dionne cc: linux-afs@lists.infradead.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/3526895.1687960024@warthog.procyon.org.uk/ Signed-off-by: Linus Torvalds commit 14bb236b29922c4f57d8c05bfdbcb82677f917c9 Author: Hariprasad Kelam Date: Tue Jul 4 09:56:53 2023 +0530 octeontx-af: fix hardware timestamp configuration MAC block on CN10K (RPM) supports hardware timestamp configuration. The previous patch which added timestamp configuration support has a bug. Though the netdev driver requests to disable timestamp configuration, the driver is always enabling it. This patch fixes the same. Fixes: d1489208681d ("octeontx2-af: cn10k: RPM hardware timestamp configuration") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Goutham Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 538140ca602b1c5f3870bef051c93b491045f70a Merge: 94c76955e86a5 7fb7998b599a2 Author: Linus Torvalds Date: Tue Jul 4 11:52:54 2023 -0700 Merge tag 'ovl-update-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs Pull more overlayfs updates from Amir Goldstein: "This is a small 'move code around' followup by Christian to his work on porting overlayfs to the new mount api for 6.5. It makes things a bit cleaner and simpler for the next development cycle when I hand overlayfs back over to Miklos" * tag 'ovl-update-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs: ovl: move all parameter handling into params.{c,h} commit 94c76955e86a5a4f16a1d690b66dcc268c156e6a Merge: ccf46d8531832 432928c937795 Author: Linus Torvalds Date: Tue Jul 4 11:45:16 2023 -0700 Merge tag 'gfs2-v6.4-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 updates from Andreas Gruenbacher: - Move the freeze/thaw logic from glock callback context to process / worker thread context to prevent deadlocks - Fix a quota reference couting bug in do_qc() - Carry on deallocating inodes even when gfs2_rindex_update() fails - Retry filesystem-internal reads when they are interruped by a signal - Eliminate kmap_atomic() in favor of kmap_local_page() / memcpy_{from,to}_page() - Get rid of noop_direct_IO - And a few more minor fixes and cleanups * tag 'gfs2-v6.4-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: (23 commits) gfs2: Add quota_change type gfs2: Use memcpy_{from,to}_page where appropriate gfs2: Convert remaining kmap_atomic calls to kmap_local_page gfs2: Replace deprecated kmap_atomic with kmap_local_page gfs: Get rid of unnucessary locking in inode_go_dump gfs2: gfs2_freeze_lock_shared cleanup gfs2: Replace sd_freeze_state with SDF_FROZEN flag gfs2: Rework freeze / thaw logic gfs2: Rename SDF_{FS_FROZEN => FREEZE_INITIATOR} gfs2: Reconfiguring frozen filesystem already rejected gfs2: Rename gfs2_freeze_lock{ => _shared } gfs2: Rename the {freeze,thaw}_super callbacks gfs2: Rename remaining "transaction" glock references gfs2: retry interrupted internal reads gfs2: Fix possible data races in gfs2_show_options() gfs2: Fix duplicate should_fault_in_pages() call gfs2: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method gfs2: Don't remember delete unless it's successful gfs2: Update rl_unlinked before releasing rgrp lock gfs2: Fix gfs2_qa_get imbalance in gfs2_quota_hold ... commit 95c41842bcbdeab8debda1a4285850bd8235fbbe Merge: ba7bdec3cbec7 a372d66af4850 Author: David S. Miller Date: Tue Jul 4 19:42:27 2023 +0100 Merge branch 'dsa-ll-fixes' Vladimir Oltean says: ==================== dsa: Fix mangled link-local MAC DAs with SJA1105 DSA The SJA1105 hardware tagging protocol is weird and will put DSA information (source port, switch ID) in the MAC DA of the packets sent to the CPU, and then send some additional (meta) packets which contain the original bytes from the previous packet's MAC DA. The tagging protocol driver contains logic to handle this, but the meta frames are optional functionality, and there are configurations when they aren't received (no PTP RX timestamping). Thus, the MAC DA from packets sent to the stack is not correct in all cases. Also, during testing it was found that the MAC DA patching procedure was incorrect. The investigation comes as a result of this discussion with Paolo: https://lore.kernel.org/netdev/f494387c8d55d9b1d5a3e88beedeeb448f2e6cc3.camel@redhat.com/ ==================== Signed-off-by: David S. Miller commit a372d66af48506d9f7aaae2a474cd18f14d98cb8 Author: Vladimir Oltean Date: Tue Jul 4 01:05:45 2023 +0300 net: dsa: sja1105: always enable the send_meta options incl_srcpt has the limitation, mentioned in commit b4638af8885a ("net: dsa: sja1105: always enable the INCL_SRCPT option"), that frames with a MAC DA of 01:80:c2:xx:yy:zz will be received as 01:80:c2:00:00:zz unless PTP RX timestamping is enabled. The incl_srcpt option was initially unconditionally enabled, then that changed with commit 42824463d38d ("net: dsa: sja1105: Limit use of incl_srcpt to bridge+vlan mode"), then again with b4638af8885a ("net: dsa: sja1105: always enable the INCL_SRCPT option"). Bottom line is that it now needs to be always enabled, otherwise the driver does not have a reliable source of information regarding source_port and switch_id for link-local traffic (tag_8021q VLANs may be imprecise since now they identify an entire bridging domain when ports are not standalone). If we accept that PTP RX timestamping (and therefore, meta frame generation) is always enabled in hardware, then that limitation could be avoided and packets with any MAC DA can be properly received, because meta frames do contain the original bytes from the MAC DA of their associated link-local packet. This change enables meta frame generation unconditionally, which also has the nice side effects of simplifying the switch control path (a switch reset is no longer required on hwtstamping settings change) and the tagger data path (it no longer needs to be informed whether to expect meta frames or not - it always does). Fixes: 227d07a07ef1 ("net: dsa: sja1105: Add support for traffic through standalone ports") Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 1dcf6efd5f0c1f4496b3ef7ec5a7db104a53b38c Author: Vladimir Oltean Date: Tue Jul 4 01:05:44 2023 +0300 net: dsa: tag_sja1105: fix MAC DA patching from meta frames The SJA1105 manual says that at offset 4 into the meta frame payload we have "MAC destination byte 2" and at offset 5 we have "MAC destination byte 1". These are counted from the LSB, so byte 1 is h_dest[ETH_HLEN-2] aka h_dest[4] and byte 2 is h_dest[ETH_HLEN-3] aka h_dest[3]. The sja1105_meta_unpack() function decodes these the other way around, so a frame with MAC DA 01:80:c2:11:22:33 is received by the network stack as having 01:80:c2:22:11:33. Fixes: e53e18a6fe4d ("net: dsa: sja1105: Receive and decode meta frames") Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ba7bdec3cbec7b0135f7ec0458073cbe9ae74de5 Author: Azeem Shaikh Date: Mon Jul 3 17:58:40 2023 +0000 net: Replace strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Simon Horman Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 84bef5b6037c15180ef88ac4216dc621d16df1a6 Author: Guillaume Nault Date: Mon Jul 3 19:14:46 2023 +0200 pptp: Fix fib lookup calls. PPTP uses pppox sockets (struct pppox_sock). These sockets don't embed an inet_sock structure, so it's invalid to call inet_sk() on them. Therefore, the ip_route_output_ports() call in pptp_connect() has two problems: * The tos variable is set with RT_CONN_FLAGS(sk), which calls inet_sk() on the pppox socket. * ip_route_output_ports() tries to retrieve routing flags using inet_sk_flowi_flags(), which is also going to call inet_sk() on the pppox socket. While PPTP doesn't use inet sockets, it's actually really layered on top of IP and therefore needs a proper way to do fib lookups. So let's define pptp_route_output() to get a struct rtable from a pptp socket. Let's also replace the ip_route_output_ports() call of pptp_xmit() for consistency. In practice, this means that: * pptp_connect() sets ->flowi4_tos and ->flowi4_flags to zero instead of using bits of unrelated struct pppox_sock fields. * pptp_xmit() now respects ->sk_mark and ->sk_uid. * pptp_xmit() now calls the security_sk_classify_flow() security hook, thus allowing to set ->flowic_secid. * pptp_xmit() now passes the pppox socket to xfrm_lookup_route(). Found by code inspection. Fixes: 00959ade36ac ("PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol)") Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 90a8007bbeb616e3ea57e2696190e57aa0329531 Author: Dan Carpenter Date: Mon Jul 3 18:24:52 2023 +0300 mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check The mlxsw_sp_crif_alloc() function returns NULL on error. It doesn't return error pointers. Fix the check. Fixes: 78126cfd5dc9 ("mlxsw: spectrum_router: Maintain CRIF for fallback loopback RIF") Signed-off-by: Dan Carpenter Reviewed-by: Alexander Lobakin Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit ccf46d85318327e5aebaae53f1fe33cc31ed1fd1 Merge: b869e9f49964a 40c565a429d70 Author: Linus Torvalds Date: Tue Jul 4 11:22:50 2023 -0700 Merge tag 'pm-6.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more power management updates from Rafael Wysocki: "These add support for new hardware (ap807 and AM62A7), fix several issues in cpufreq drivers and in the operating performance points (OPP) framework, fix up intel_idle after recent changes and add documentation. Specifics: - Add missing __init annotation to one function in the intel_idle drvier (Rafael Wysocki) - Make intel_pstate use a correct scaling factor when mapping HWP performance levels to frequency values on hybrid-capable systems with disabled E-cores (Srinivas Pandruvada) - Fix Kconfig dependencies of the cpufreq-dt-platform driver (Viresh Kumar) - Add support to build cpufreq-dt-platdev as a module (Zhipeng Wang) - Don't allocate Sparc's cpufreq_driver dynamically (Viresh Kumar) - Add support for TI's AM62A7 platform (Vibhore Vardhan) - Add support for Armada's ap807 platform (Russell King (Oracle)) - Add support for StarFive JH7110 SoC (Mason Huo) - Fix voltage selection for Mediatek Socs (Daniel Golle) - Fix error handling in Tegra's cpufreq driver (Christophe JAILLET) - Document Qualcomm's IPQ8074 in DT bindings (Robert Marko) - Don't warn for disabling a non-existing frequency for imx6q cpufreq driver (Christoph Niedermaier) - Use dev_err_probe() in Qualcomm's cpufreq driver (Andrew Halaney) - Simplify performance state related logic in the OPP core (Viresh Kumar) - Fix use-after-free and improve locking around lazy_opp_tables (Viresh Kumar, Stephan Gerhold) - Minor cleanups - using dev_err_probe() and rate-limiting debug messages (Andrew Halaney, Adrián Larumbe)" * tag 'pm-6.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (23 commits) cpufreq: intel_pstate: Fix scaling for hybrid-capable systems with disabled E-cores cpufreq: Make CONFIG_CPUFREQ_DT_PLATDEV depend on OF intel_idle: Add __init annotation to matchup_vm_state_with_baremetal() OPP: Properly propagate error along when failing to get icc_path OPP: Use dev_err_probe() when failing to get icc_path cpufreq: qcom-cpufreq-hw: Use dev_err_probe() when failing to get icc paths cpufreq: mediatek: correct voltages for MT7622 and MT7623 cpufreq: armada-8k: add ap807 support OPP: Simplify the over-designed pstate <-> level dance OPP: pstate is only valid for genpd OPP tables OPP: don't drop performance constraint on OPP table removal OPP: Protect `lazy_opp_tables` list with `opp_table_lock` OPP: Staticize `lazy_opp_tables` in of.c cpufreq: dt-platdev: Support building as module opp: Fix use-after-free in lazy_opp_tables after probe deferral dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ8074 cpufreq: dt-platdev: Blacklist ti,am62a7 SoC cpufreq: ti-cpufreq: Add support for AM62A7 OPP: rate-limit debug messages when no change in OPP is required cpufreq: imx6q: don't warn for disabling a non-existing frequency ... commit b869e9f49964aace737a5a3fadd958ea94e96288 Merge: 406fb9eb198a0 f679e89acdd3e Author: Linus Torvalds Date: Tue Jul 4 11:07:45 2023 -0700 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull more clk updates from Stephen Boyd: "Another set of clk driver updates and fixes for the merge window. The driver updates needed more time to bake in linux-next. Updates: - Support for more clk controllers in Qualcomm SoCs such as SM8350, SM8450, SDX75, SC8280XP, and IPQ9574 - Runtime PM enablement of some more Qualcomm clk controllers - Various fixes to Qualcomm clk driver data to use correct clk_ops and to check halt bits properly - AT91 updates to modernize with clk_parent_data structures Fixes: - Remove 'syscon' from dt binding fix for ti,j721e-system-controller - Fix determine rate in the Tegra driver that got wrecked by the refactorting of muxes this merge window" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (69 commits) clk: tegra: Avoid calling an uninitialized function dt-bindings: mfd: ti,j721e-system-controller: Remove syscon from example clk: at91: sama7g5: s/ep_chg_chg_id/ep_chg_id clk: at91: sama7g5: switch to parent_hw and parent_data clk: at91: sckc: switch to parent_data/parent_hw clk: at91: clk-sam9x60-pll: add support for parent_hw clk: at91: clk-utmi: add support for parent_hw clk: at91: clk-system: add support for parent_hw clk: at91: clk-programmable: add support for parent_hw clk: at91: clk-peripheral: add support for parent_hw clk: at91: clk-master: add support for parent_hw clk: at91: clk-generated: add support for parent_hw clk: at91: clk-main: add support for parent_data/parent_hw clk: qcom: gcc-sc8280xp: Add runtime PM clk: qcom: gpucc-sc8280xp: Add runtime PM clk: qcom: mmcc-msm8974: fix MDSS_GDSC power flags clk: qcom: gpucc-sm6375: Enable runtime pm dt-bindings: clock: sm6375-gpucc: Add VDD_GX clk: qcom: gcc-sm6115: Add missing PLL config properties clk: qcom: clk-alpha-pll: Add a way to update some bits of test_ctl(_hi) ... commit 406fb9eb198a05fa61c31ec8a6e667c8440749c8 Merge: f1962207150c8 3ff256751a285 Author: Linus Torvalds Date: Tue Jul 4 11:02:34 2023 -0700 Merge tag 'firewire-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 Pull firewire updates from Takashi Sakamoto: "This consist of three parts; UAPI update, OHCI driver update, and several bug fixes. Firstly, the 1394 OHCI specification defines method to retrieve hardware time stamps for asynchronous communication, which was previously unavailable in user space. This adds new events to the UAPI, allowing applications to retrieve the time when asynchronous packet are received and sent. The new events are tested in the bleeding edge of libhinawa and look to work well. The new version of libhinawa will be released after current merge window is closed: https://git.kernel.org/pub/scm/libs/ieee1394/libhinawa.git/ Secondly, the FireWire stack includes a PCM device driver for 1394 OHCI hardware, This change modernizes the driver by managed resource (devres) framework. Lastly, bug fixes for firewire-net and firewire-core" * tag 'firewire-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: (25 commits) firewire: net: fix use after free in fwnet_finish_incoming_packet() firewire: core: obsolete usage of GFP_ATOMIC at building node tree firewire: ohci: release buffer for AR req/resp contexts when managed resource is released firewire: ohci: use devres for content of configuration ROM firewire: ohci: use devres for IT, IR, AT/receive, and AT/request contexts firewire: ohci: use devres for list of isochronous contexts firewire: ohci: use devres for requested IRQ firewire: ohci: use devres for misc DMA buffer firewire: ohci: use devres for MMIO region mapping firewire: ohci: use devres for PCI-related resources firewire: ohci: use devres for memory object of ohci structure firewire: fix warnings to generate UAPI documentation firewire: fix build failure due to missing module license firewire: cdev: implement new event relevant to phy packet with time stamp firewire: cdev: add new event to notify phy packet with time stamp firewire: cdev: code refactoring to dispatch event for phy packet firewire: cdev: implement new event to notify response subaction with time stamp firewire: cdev: add new event to notify response subaction with time stamp firewire: cdev: code refactoring to operate event of response firewire: core: implement variations to send request and wait for response with time stamp ... commit 59e8d4bb8d485a3c125dc1c66439dde589b9d9cd Author: Andy Shevchenko Date: Mon Jul 3 15:14:10 2023 +0300 ACPI: scan: Use the acpi_match_acpi_device() helper Instead of doing two pass parsing of the table, replace acpi_match_device_ids() with acpi_match_acpi_device(). Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit bf6067a6caa6717c40156fd8dfa443fd568c193a Author: Andy Shevchenko Date: Mon Jul 3 15:14:09 2023 +0300 ACPI: platform: Move SMB0001 HID to the header and reuse There are at least two places in the kernel that are using the SMB0001 HID. Make it to be available via acpi_drivers.h header file. While at it, replace hard coded one with a definition. Reviewed-by: Andi Shyti Acked-by: Wolfram Sang # for I2C Link: https://lore.kernel.org/r/20230621151652.79579-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit cefbd80bf52c791fede129ab5cf8be6ed9e8ce38 Author: Andy Shevchenko Date: Mon Jul 3 15:14:08 2023 +0300 ACPI: platform: Ignore SMB0001 only when it has resources After switching i2c-scmi driver to be a platform one, it stopped being enumerated on number of Kontron platforms, because it's listed in the forbidden_id_list. To resolve the situation, add a flag to driver data to allow devices with no resources in _CRS to be enumerated via platform bus. Fixes: 03d4287add6e ("i2c: scmi: Convert to be a platform driver") Closes: https://lore.kernel.org/r/60c1756765b9a3f1eab0dcbd84f59f00fe1caf48.camel@kontron.com Link: https://lore.kernel.org/r/20230621151652.79579-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Reviewed-by: Andi Shyti [ rjw: Move has_resource definition to the block in which it is used and initialize it to 'false' ] Signed-off-by: Rafael J. Wysocki commit 2b5ae9604949391da6661eab0a854de4ecd140f6 Author: Andy Shevchenko Date: Mon Jul 3 15:14:07 2023 +0300 ACPI: bus: Introduce acpi_match_acpi_device() helper Match the ACPI device against a given list of ACPI IDs. Subsequent changes will make use of this. Signed-off-by: Andy Shevchenko [ rjw: Changelog edit ] Signed-off-by: Rafael J. Wysocki commit f1962207150c8b602e980616f04b37ea4e64bb9f Author: Linus Torvalds Date: Tue Jul 4 06:37:32 2023 -0700 module: fix init_module_from_file() error handling Vegard Nossum pointed out two different problems with the error handling in init_module_from_file(): (a) the idempotent loading code didn't clean up properly in some error cases, leaving the on-stack 'struct idempotent' element still in the hash table (b) failure to read the module file would nonsensically update the 'invalid_kread_bytes' stat counter with the error value The first error is quite nasty, in that it can then cause subsequent idempotent loads of that same file to access stale stack contents of the previous failure. The case may not happen in any normal situation (explaining all the "Tested-by's on the original change), and requires admin privileges, but syzkaller triggers random bad behavior as a result: BUG: soft lockup in sys_finit_module BUG: unable to handle kernel paging request in init_module_from_file general protection fault in init_module_from_file INFO: task hung in init_module_from_file KASAN: out-of-bounds Read in init_module_from_file KASAN: slab-out-of-bounds Read in init_module_from_file ... The second error is fairly benign and just leads to nonsensical stats (and has been around since the debug stats were added). Vegard also provided a patch for the idempotent loading issue, but I'd rather re-organize the code and make it more legible using another level of helper functions than add the usual "goto out" error handling. Link: https://lore.kernel.org/lkml/20230704100852.23452-1-vegard.nossum@oracle.com/ Fixes: 9b9879fc0327 ("modules: catch concurrent module loads, treat them as idempotent") Reported-by: Vegard Nossum Reported-by: Harshit Mogalapalli Reported-by: syzbot+9c2bdc9d24e4a7abe741@syzkaller.appspotmail.com Signed-off-by: Linus Torvalds commit 90f6af81604c7f831273c08ac9994d0d0724b553 Author: Ben Dooks Date: Mon Jul 3 13:48:31 2023 +0100 ACPI: scan: fix undeclared variable warnings by including sleep.h There are two pieces of data being exported from drivers/acpi/scan.c (acpi_device_lock and acpi_wakeup_device_list) that don't have their definitions declared in anything scan.c is including. Fix the following sparse warnings by including sleep.h to add the declarations of acpi_device_lock and acpi_wakeup_device_list to fix the followng sparse warnings: drivers/acpi/scan.c:42:1: warning: symbol 'acpi_device_lock' was not declared. Should it be static? drivers/acpi/scan.c:43:1: warning: symbol 'acpi_wakeup_device_list' was not declared. Should it be static? Signed-off-by: Ben Dooks Signed-off-by: Rafael J. Wysocki commit 40c565a429d706951f18fe07ccd9f6fded23a4dc Merge: bb814518bf7c2 0fcfc9e519902 b2918089d5cb4 Author: Rafael J. Wysocki Date: Tue Jul 4 18:26:44 2023 +0200 Merge branches 'pm-cpufreq' and 'pm-cpuidle' Merge CPU power management updates for 6.5-rc1: - Add missing __init annotation to one function in the intel_idle drvier (Rafael Wysocki). - Make intel_pstate use a correct scaling factor when mapping HWP performance levels to frequency values on hybrid-capable systems with disabled E-cores (Srinivas Pandruvada). - Fix Kconfig dependencies of the cpufreq-dt-platform driver (Viresh Kumar). - Add support to build cpufreq-dt-platdev as a module (Zhipeng Wang). - Don't allocate Sparc's cpufreq_driver dynamically (Viresh Kumar). - Add support for TI's AM62A7 platform (Vibhore Vardhan). - Add support for Armada's ap807 platform (Russell King (Oracle)). - Add support for StarFive JH7110 SoC (Mason Huo). - Fix voltage selection for Mediatek Socs (Daniel Golle). - Fix error handling in Tegra's cpufreq driver (Christophe JAILLET). - Document Qualcomm's IPQ8074 in DT bindings (Robert Marko). - Don't warn for disabling a non-existing frequency for imx6q cpufreq driver (Christoph Niedermaier). - Use dev_err_probe() in Qualcomm's cpufreq driver (Andrew Halaney). * pm-cpufreq: cpufreq: intel_pstate: Fix scaling for hybrid-capable systems with disabled E-cores cpufreq: Make CONFIG_CPUFREQ_DT_PLATDEV depend on OF cpufreq: qcom-cpufreq-hw: Use dev_err_probe() when failing to get icc paths cpufreq: mediatek: correct voltages for MT7622 and MT7623 cpufreq: armada-8k: add ap807 support cpufreq: dt-platdev: Support building as module dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ8074 cpufreq: dt-platdev: Blacklist ti,am62a7 SoC cpufreq: ti-cpufreq: Add support for AM62A7 cpufreq: imx6q: don't warn for disabling a non-existing frequency cpufreq: sparc: Don't allocate cpufreq_driver dynamically cpufreq: tegra194: Fix an error handling path in tegra194_cpufreq_probe() cpufreq: dt-platdev: Add JH7110 SOC to the allowlist * pm-cpuidle: intel_idle: Add __init annotation to matchup_vm_state_with_baremetal() commit 52909f1768023656d5c429873e2246a134289a95 Author: Conor Dooley Date: Thu Jun 29 12:33:34 2023 +0100 RISC-V: drop error print from riscv_hartid_to_cpuid() As of commit 2ac874343749 ("RISC-V: split early & late of_node to hartid mapping") my CI complains about newly added pr_err() messages during boot, for example: [ 0.000000] Couldn't find cpu id for hartid [0] [ 0.000000] riscv-intc: unable to find hart id for /cpus/cpu@0/interrupt-controller Before the split, riscv_of_processor_hartid() contained a check for whether the cpu was "available", before calling riscv_hartid_to_cpuid(), but after the split riscv_of_processor_hartid() can be called for cpus that are disabled. Most callers of riscv_hartid_to_cpuid() already report custom errors where it falls, making this print superfluous in those case. In other places, the print adds nothing - see riscv_intc_init() for example. Fixes: 2ac874343749 ("RISC-V: split early & late of_node to hartid mapping") Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20230629-paternity-grafted-b901b76d04a0@wendy Signed-off-by: Palmer Dabbelt commit 9657e9b7d2538dc73c24947aa00a8525dfb8062c Author: Björn Töpel Date: Thu Jun 29 16:22:28 2023 +0200 riscv: Discard vector state on syscalls The RISC-V vector specification states: Executing a system call causes all caller-saved vector registers (v0-v31, vl, vtype) and vstart to become unspecified. The vector registers are set to all 1s, vill is set (invalid), and the vector status is set to Dirty. That way we can prevent userspace from accidentally relying on the stated save. Rémi pointed out [1] that writing to the registers might be superfluous, and setting vill is sufficient. Link: https://lore.kernel.org/linux-riscv/12784326.9UPPK3MAeB@basile.remlab.net/ # [1] Suggested-by: Darius Rad Suggested-by: Palmer Dabbelt Suggested-by: Rémi Denis-Courmont Signed-off-by: Björn Töpel Link: https://lore.kernel.org/r/20230629142228.1125715-1-bjorn@kernel.org Signed-off-by: Palmer Dabbelt commit 85fadc0d04119c2fe4a20287767ab904c6d21ba1 Author: Woody Zhang Date: Wed Jun 14 21:19:07 2023 +0800 riscv: move memblock_allow_resize() after linear mapping is ready The initial memblock metadata is accessed from kernel image mapping. The regions arrays need to "reallocated" from memblock and accessed through linear mapping to cover more memblock regions. So the resizing should not be allowed until linear mapping is ready. Note that there are memblock allocations when building linear mapping. This patch is similar to 24cc61d8cb5a ("arm64: memblock: don't permit memblock resizing until linear mapping is up"). In following log, many memblock regions are reserved before create_linear_mapping_page_table(). And then it triggered reallocation of memblock.reserved.regions and memcpy the old array in kernel image mapping to the new array in linear mapping which caused a page fault. [ 0.000000] memblock_reserve: [0x00000000bf01f000-0x00000000bf01ffff] early_init_fdt_scan_reserved_mem+0x28c/0x2c6 [ 0.000000] memblock_reserve: [0x00000000bf021000-0x00000000bf021fff] early_init_fdt_scan_reserved_mem+0x28c/0x2c6 [ 0.000000] memblock_reserve: [0x00000000bf023000-0x00000000bf023fff] early_init_fdt_scan_reserved_mem+0x28c/0x2c6 [ 0.000000] memblock_reserve: [0x00000000bf025000-0x00000000bf025fff] early_init_fdt_scan_reserved_mem+0x28c/0x2c6 [ 0.000000] memblock_reserve: [0x00000000bf027000-0x00000000bf027fff] early_init_fdt_scan_reserved_mem+0x28c/0x2c6 [ 0.000000] memblock_reserve: [0x00000000bf029000-0x00000000bf029fff] early_init_fdt_scan_reserved_mem+0x28c/0x2c6 [ 0.000000] memblock_reserve: [0x00000000bf02b000-0x00000000bf02bfff] early_init_fdt_scan_reserved_mem+0x28c/0x2c6 [ 0.000000] memblock_reserve: [0x00000000bf02d000-0x00000000bf02dfff] early_init_fdt_scan_reserved_mem+0x28c/0x2c6 [ 0.000000] memblock_reserve: [0x00000000bf02f000-0x00000000bf02ffff] early_init_fdt_scan_reserved_mem+0x28c/0x2c6 [ 0.000000] memblock_reserve: [0x00000000bf030000-0x00000000bf030fff] early_init_fdt_scan_reserved_mem+0x28c/0x2c6 [ 0.000000] OF: reserved mem: 0x0000000080000000..0x000000008007ffff (512 KiB) map non-reusable mmode_resv0@80000000 [ 0.000000] memblock_reserve: [0x00000000bf000000-0x00000000bf001fed] paging_init+0x19a/0x5ae [ 0.000000] memblock_phys_alloc_range: 4096 bytes align=0x1000 from=0x0000000000000000 max_addr=0x0000000000000000 alloc_pmd_fixmap+0x14/0x1c [ 0.000000] memblock_reserve: [0x000000017ffff000-0x000000017fffffff] memblock_alloc_range_nid+0xb8/0x128 [ 0.000000] memblock: reserved is doubled to 256 at [0x000000017fffd000-0x000000017fffe7ff] [ 0.000000] Unable to handle kernel paging request at virtual address ff600000ffffd000 [ 0.000000] Oops [#1] [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 6.4.0-rc1-00011-g99a670b2069c #66 [ 0.000000] Hardware name: riscv-virtio,qemu (DT) [ 0.000000] epc : __memcpy+0x60/0xf8 [ 0.000000] ra : memblock_double_array+0x192/0x248 [ 0.000000] epc : ffffffff8081d214 ra : ffffffff80a3dfc0 sp : ffffffff81403bd0 [ 0.000000] gp : ffffffff814fbb38 tp : ffffffff8140dac0 t0 : 0000000001600000 [ 0.000000] t1 : 0000000000000000 t2 : 000000008f001000 s0 : ffffffff81403c60 [ 0.000000] s1 : ffffffff80c0bc98 a0 : ff600000ffffd000 a1 : ffffffff80c0bcd8 [ 0.000000] a2 : 0000000000000c00 a3 : ffffffff80c0c8d8 a4 : 0000000080000000 [ 0.000000] a5 : 0000000000080000 a6 : 0000000000000000 a7 : 0000000080200000 [ 0.000000] s2 : ff600000ffffd000 s3 : 0000000000002000 s4 : 0000000000000c00 [ 0.000000] s5 : ffffffff80c0bc60 s6 : ffffffff80c0bcc8 s7 : 0000000000000000 [ 0.000000] s8 : ffffffff814fd0a8 s9 : 000000017fffe7ff s10: 0000000000000000 [ 0.000000] s11: 0000000000001000 t3 : 0000000000001000 t4 : 0000000000000000 [ 0.000000] t5 : 000000008f003000 t6 : ff600000ffffd000 [ 0.000000] status: 0000000200000100 badaddr: ff600000ffffd000 cause: 000000000000000f [ 0.000000] [] __memcpy+0x60/0xf8 [ 0.000000] [] memblock_add_range.isra.14+0x12c/0x162 [ 0.000000] [] memblock_reserve+0x6e/0x8c [ 0.000000] [] memblock_alloc_range_nid+0xb8/0x128 [ 0.000000] [] memblock_phys_alloc_range+0x5e/0x6a [ 0.000000] [] alloc_pmd_fixmap+0x14/0x1c [ 0.000000] [] alloc_p4d_fixmap+0xc/0x14 [ 0.000000] [] create_pgd_mapping+0x98/0x17c [ 0.000000] [] create_linear_mapping_range.constprop.10+0xe4/0x112 [ 0.000000] [] paging_init+0x3ec/0x5ae [ 0.000000] [] setup_arch+0xb2/0x576 [ 0.000000] [] start_kernel+0x72/0x57e [ 0.000000] Code: b303 0285 b383 0305 be03 0385 be83 0405 bf03 0485 (b023) 00ef [ 0.000000] ---[ end trace 0000000000000000 ]--- [ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task! [ 0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]--- Fixes: 671f9a3e2e24 ("RISC-V: Setup initial page tables in two stages") Signed-off-by: Woody Zhang Tested-by: Song Shuai Link: https://lore.kernel.org/r/tencent_FBB94CE615C5CCE7701CD39C15CCE0EE9706@qq.com Signed-off-by: Palmer Dabbelt commit c1f048a6bd7d7cb42e9bfd79eff85b33894997fe Author: Song Shuai Date: Mon May 29 18:15:24 2023 +0800 riscv: Enable ARCH_SUSPEND_POSSIBLE for s2idle With this configuration opened, the basic platform-independent s2idle is provided by the sole "s2idle" string in `/sys/power/mem_sleep`. At the end of s2idle, harts will hit the `wfi` instruction or enter the SUSPENDED state through the sbi_cpuidle driver. The interrupt of possible wakeup devices will be kept to wake the system up. And platform-specific sleep states can be provided by future ACPI and SBI SUSP extension support. Signed-off-by: Song Shuai Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20230529101524.322076-1-songshuaishuai@tinylab.org Signed-off-by: Palmer Dabbelt commit f679e89acdd3e825995a84b1b07e2ea33ea882ee Author: Thierry Reding Date: Fri Jun 30 15:07:48 2023 +0200 clk: tegra: Avoid calling an uninitialized function Commit 493ffb046cf5 ("clk: tegra: super: Switch to determine_rate") replaced clk_super_round_rate() by clk_super_determine_rate(), but didn't update one callsite that was explicitly calling the old tegra_clk_super_ops.round_rate() function, which was now NULL. This resulted in a crash on Tegra30 systems during early boot. Switch this callsite over to the clk_super_determine_rate() equivalent to avoid the crash. Fixes: 493ffb046cf5 ("clk: tegra: super: Switch to determine_rate") Tested-by: Dmitry Osipenko Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20230630130748.840729-1-thierry.reding@gmail.com Signed-off-by: Stephen Boyd commit 54cdede08f2f4414629001b124110d656161080a Author: Ben Dooks Date: Fri Jun 16 12:43:57 2023 +0100 riscv: vdso: include vdso/vsyscall.h for vdso_data Add include of to pull in the defition of vdso_data to remove the following sparse warning: arch/riscv/kernel/vdso.c:39:18: warning: symbol 'vdso_data' was not declared. Should it be static? Signed-off-by: Ben Dooks Link: https://lore.kernel.org/r/20230616114357.159601-1-ben.dooks@codethink.co.uk Signed-off-by: Palmer Dabbelt commit e27cb89a22ada4e3e7bee1567a8daa1fb2260b78 Author: Jakub Kicinski Date: Wed Jun 21 15:35:25 2023 -0700 scripts: kernel-doc: support private / public marking for enums Enums benefit from private markings, too. For netlink attribute name enums always end with a pair of __$n_MAX and $n_MAX members. Documenting them feels a bit tedious. Signed-off-by: Jakub Kicinski Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Jonathan Corbet Message-ID: <20230621223525.2722703-1-kuba@kernel.org> commit 1e6115f50bca20417e9d4d95ce99e36d6f145fa4 Author: Changyuan Lyu Date: Sat Jun 24 09:58:57 2023 -0700 Documentation: KVM: SEV: add a missing backtick ``ENOTTY` -> ``ENOTTY``. Signed-off-by: Changyuan Lyu Signed-off-by: Jonathan Corbet Message-ID: <20230624165858.21777-1-changyuanl@google.com> commit 29e31a8ee811f5d85274f0381f13cd6fe650aea4 Author: David Heidelberg Date: Sun Jun 25 12:33:04 2023 +0200 Documentation: ACPI: fix typo in ssdt-overlays.rst Signed-off-by: David Heidelberg Signed-off-by: Jonathan Corbet Message-ID: <20230625103305.115484-1-david@ixit.cz> commit 57ada2358fae8c3df0f810c3a7196f074da01c98 Author: Olaf Hering Date: Fri Jun 30 16:53:02 2023 +0200 Fix documentation of panic_on_warn The kernel cmdline option panic_on_warn expects an integer, it is not a plain option as documented. A number of uses in the tree figured this already, and use panic_on_warn=1 for their purpose. Adjust a comment which otherwise may mislead people in the future. Fixes: 9e3961a09798 ("kernel: add panic_on_warn") Signed-off-by: Olaf Hering Reviewed-by: Randy Dunlap Signed-off-by: Jonathan Corbet commit b5641a5d8b8b14643bfe3d017d64da90a5c55479 Author: Linus Torvalds Date: Mon Jul 3 19:29:48 2023 -0700 mm: don't do validate_mm() unnecessarily and without mmap locking This is an addition to commit ae80b4041984 ("mm: validate the mm before dropping the mmap lock"), because it turns out there were two problems, but lockdep just stopped complaining after finding the first one. The do_vmi_align_munmap() function now drops the mmap lock after doing the validate_mm() call, but it turns out that one of the callers then immediately calls validate_mm() again. That's both a bit silly, and now (again) happens without the mmap lock held. So just remove that validate_mm() call from the caller, but make sure to not lose any coverage by doing that mm sanity checking in the error path of do_vmi_align_munmap() too. Reported-and-tested-by: kernel test robot Link: https://lore.kernel.org/lkml/ZKN6CdkKyxBShPHi@xsang-OptiPlex-9020/ Fixes: 408579cd627a ("mm: Update do_vmi_align_munmap() return semantics") Signed-off-by: Linus Torvalds commit 879a879c216a41f5403d8d3dbc204a48501912bf Author: Jonas Gorski Date: Fri Jun 30 22:22:55 2023 +0200 spi: bcm{63xx,bca}-hsspi: update my email address Update my email address to a working one, as the openwrt.org one is broken since ages. Signed-off-by: Jonas Gorski Acked-by: William Zhang Link: https://lore.kernel.org/r/20230630202257.8449-2-jonas.gorski@gmail.com Signed-off-by: Mark Brown commit 7dfae2631bfbdebecd35fe7b472ab3cc95c9ed66 Author: Johan Hovold Date: Mon Jul 3 14:47:01 2023 +0200 ASoC: codecs: wcd938x: fix missing mbhc init error handling MBHC initialisation can fail so add the missing error handling to avoid dereferencing an error pointer when later configuring the jack: Unable to handle kernel paging request at virtual address fffffffffffffff8 pc : wcd_mbhc_start+0x28/0x380 [snd_soc_wcd_mbhc] lr : wcd938x_codec_set_jack+0x28/0x48 [snd_soc_wcd938x] Call trace: wcd_mbhc_start+0x28/0x380 [snd_soc_wcd_mbhc] wcd938x_codec_set_jack+0x28/0x48 [snd_soc_wcd938x] snd_soc_component_set_jack+0x28/0x8c [snd_soc_core] qcom_snd_wcd_jack_setup+0x7c/0x19c [snd_soc_qcom_common] sc8280xp_snd_init+0x20/0x2c [snd_soc_sc8280xp] snd_soc_link_init+0x28/0x90 [snd_soc_core] snd_soc_bind_card+0x628/0xbfc [snd_soc_core] snd_soc_register_card+0xec/0x104 [snd_soc_core] devm_snd_soc_register_card+0x4c/0xa4 [snd_soc_core] sc8280xp_platform_probe+0xf0/0x108 [snd_soc_sc8280xp] Fixes: bcee7ed09b8e ("ASoC: codecs: wcd938x: add Multi Button Headset Control support") Cc: stable@vger.kernel.org # 5.15 Cc: Srinivas Kandagatla Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20230703124701.11734-1-johan+linaro@kernel.org Signed-off-by: Mark Brown commit 69562eb0bd3e6bb8e522a7b254334e0fb30dff0c Author: Amir Goldstein Date: Thu Jun 29 07:20:44 2023 +0300 fanotify: disallow mount/sb marks on kernel internal pseudo fs Hopefully, nobody is trying to abuse mount/sb marks for watching all anonymous pipes/inodes. I cannot think of a good reason to allow this - it looks like an oversight that dated back to the original fanotify API. Link: https://lore.kernel.org/linux-fsdevel/20230628101132.kvchg544mczxv2pm@quack3/ Fixes: 0ff21db9fcc3 ("fanotify: hooks the fanotify_mark syscall to the vfsmount code") Signed-off-by: Amir Goldstein Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Message-Id: <20230629042044.25723-1-amir73il@gmail.com> commit f6cf3883df471abbcf1553127681dc244c8ff8dd Author: Jani Nikula Date: Tue Jun 27 18:13:58 2023 +0300 drm/i915: use mock device info for creating mock device Instead of modifying the device info on the fly, use static const mock device info. It's not okay to modify device info at runtime; we've added separate runtime info for info that needs to be modified at runtime. We've added safeguards to device info to prevent it from being modified, but commit 5e352e32aec2 ("drm/i915: preparation for using PAT index") just cast the const away and modified it anyway. This prevents device info from being moved to rodata. Fixes: 5e352e32aec2 ("drm/i915: preparation for using PAT index") Suggested-by: Tvrtko Ursulin Cc: Fei Yang Cc: Andi Shyti Cc: Andrzej Hajda Cc: Matt Roper Signed-off-by: Jani Nikula Reviewed-by: Tvrtko Ursulin Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/b0db62045a96a3fd4cf123685da88cc777f9b485.1687878757.git.jani.nikula@intel.com (cherry picked from commit ecc7a3ce078a209a62af4c53ffb7370620f65c24) Signed-off-by: Tvrtko Ursulin commit fdffb7dbc74f48cb1d404d9ab0c9fd769a59caf0 Author: Ville Syrjälä Date: Fri Jun 9 17:13:53 2023 +0300 drm/i915/psr: Fix BDW PSR AUX CH data register offsets The multiplication got replaced by an addition in some cleanup. This means we never write the correct data to some of the BDW PSR data registers and thus we fail to actually wake up the panel from PSR. Fixes: 4ab4fa103217 ("drm/i915/psr: Make PSR registers relative to transcoders") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230609141404.12729-3-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander (cherry picked from commit 460dc4ba1442b3e5e543328d11db2702b98d3d7c) Signed-off-by: Tvrtko Ursulin commit 30c45b5361d39b4b793780ffac5538090b9e2eb1 Author: Lin Ma Date: Mon Jul 3 19:08:42 2023 +0800 net/sched: act_pedit: Add size check for TCA_PEDIT_PARMS_EX The attribute TCA_PEDIT_PARMS_EX is not be included in pedit_policy and one malicious user could fake a TCA_PEDIT_PARMS_EX whose length is smaller than the intended sizeof(struct tc_pedit). Hence, the dereference in tcf_pedit_init() could access dirty heap data. static int tcf_pedit_init(...) { // ... pattr = tb[TCA_PEDIT_PARMS]; // TCA_PEDIT_PARMS is included if (!pattr) pattr = tb[TCA_PEDIT_PARMS_EX]; // but this is not // ... parm = nla_data(pattr); index = parm->index; // parm is able to be smaller than 4 bytes // and this dereference gets dirty skb_buff // data created in netlink_sendmsg } This commit adds TCA_PEDIT_PARMS_EX length in pedit_policy which avoid the above case, just like the TCA_PEDIT_PARMS. Fixes: 71d0ed7079df ("net/act_pedit: Support using offset relative to the conventional network headers") Signed-off-by: Lin Ma Reviewed-by: Pedro Tammela Link: https://lore.kernel.org/r/20230703110842.590282-1-linma@zju.edu.cn Signed-off-by: Paolo Abeni commit 33ab231f83cc12d0157711bbf84e180c3be7d7bc Author: Christian Brauner Date: Mon Jul 3 16:49:12 2023 +0200 fs: don't assume arguments are non-NULL The helper is explicitly documented as locking zero, one, or two arguments. While all current callers do pass non-NULL arguments there's no need or requirement for them to do so according to the code and the unlock_two_nondirectories() helper is pretty clear about it as well. So only call WARN_ON_ONCE() if the checked inode is valid. Fixes: 2454ad83b90a ("fs: Restrict lock_two_nondirectories() to non-directory inodes") Reviewed-by: Jan Kara Cc: Jan Kara Message-Id: <20230703-vfs-rename-source-v1-2-37eebb29b65b@kernel.org> Signed-off-by: Christian Brauner commit 66d8fc0539b0d49941f313c9509a8384e4245ac1 Author: Jan Kara Date: Mon Jul 3 16:49:11 2023 +0200 fs: no need to check source The @source inode must be valid. It is even checked via IS_SWAPFILE() above making it pretty clear. So no need to check it when we unlock. What doesn't need to exist is the @target inode. The lock_two_inodes() helper currently swaps the @inode1 and @inode2 arguments if @inode1 is NULL to have consistent lock class usage. However, we know that at least for vfs_rename() that @inode1 is @source and thus is never NULL as per above. We also know that @source is a different inode than @target as that is checked right at the beginning of vfs_rename(). So we know that @source is valid and locked and that @target is locked. So drop the check whether @source is non-NULL. Fixes: 28eceeda130f ("fs: Lock moved directories") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202307030026.9sE2pk2x-lkp@intel.com Message-Id: <20230703-vfs-rename-source-v1-1-37eebb29b65b@kernel.org> [brauner: use commit message from patch I sent concurrently] Signed-off-by: Christian Brauner commit f7306acec9aae9893d15e745c8791124d42ab10a Author: Ilya Maximets Date: Mon Jul 3 19:53:29 2023 +0200 xsk: Honor SO_BINDTODEVICE on bind Initial creation of an AF_XDP socket requires CAP_NET_RAW capability. A privileged process might create the socket and pass it to a non-privileged process for later use. However, that process will be able to bind the socket to any network interface. Even though it will not be able to receive any traffic without modification of the BPF map, the situation is not ideal. Sockets already have a mechanism that can be used to restrict what interface they can be attached to. That is SO_BINDTODEVICE. To change the SO_BINDTODEVICE binding the process will need CAP_NET_RAW. Make xsk_bind() honor the SO_BINDTODEVICE in order to allow safer workflow when non-privileged process is using AF_XDP. The intended workflow is following: 1. First process creates a bare socket with socket(AF_XDP, ...). 2. First process loads the XSK program to the interface. 3. First process adds the socket fd to a BPF map. 4. First process ties socket fd to a particular interface using SO_BINDTODEVICE. 5. First process sends socket fd to a second process. 6. Second process allocates UMEM. 7. Second process binds socket to the interface with bind(...). 8. Second process sends/receives the traffic. All the steps above are possible today if the first process is privileged and the second one has sufficient RLIMIT_MEMLOCK and no capabilities. However, the second process will be able to bind the socket to any interface it wants on step 7 and send traffic from it. With the proposed change, the second process will be able to bind the socket only to a specific interface chosen by the first process at step 4. Fixes: 965a99098443 ("xsk: add support for bind for Rx") Signed-off-by: Ilya Maximets Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Acked-by: John Fastabend Acked-by: Jason Wang Link: https://lore.kernel.org/bpf/20230703175329.3259672-1-i.maximets@ovn.org commit 72cea3a3175b50a4875b3c112fb13df20c6218a5 Author: Luke D. Jones Date: Tue Jul 4 16:46:19 2023 +1200 ALSA: hda/realtek: Whitespace fix Remove an erroneous whitespace. Fixes: 31278997add6 ("ALSA: hda/realtek - Add headset quirk for Dell DT") Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20230704044619.19343-6-luke@ljones.dev Signed-off-by: Takashi Iwai commit 33d7c9c3bf70ed91191a2bedbbc03783b824b5de Author: Luke D. Jones Date: Tue Jul 4 16:46:18 2023 +1200 ALSA: hda/realtek: Add quirk for ASUS ROG G614Jx Adds the required quirk to enable the Cirrus amp and correct pins on the ASUS ROG G614J series which uses an SPI connected Cirrus amp. While this works if the related _DSD properties are made available, these aren't included in the ACPI of these laptops (yet). Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20230704044619.19343-5-luke@ljones.dev Signed-off-by: Takashi Iwai commit b759a5f097cd42c666f1ebca8da50ff507435fbe Author: Luke D. Jones Date: Tue Jul 4 16:46:17 2023 +1200 ALSA: hda/realtek: Amend G634 quirk to enable rear speakers Amends the last quirk for the G634 with 0x1caf subsys to enable the rear speakers via pincfg. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20230704044619.19343-4-luke@ljones.dev Signed-off-by: Takashi Iwai commit 9abc77fb144fe916fd2f592dc4b8c7bade02e58a Author: Luke D. Jones Date: Tue Jul 4 16:46:16 2023 +1200 ALSA: hda/realtek: Add quirk for ASUS ROG GA402X Adds the required quirk to enable the Cirrus amp and correct pins on the ASUS ROG GA402X series which uses an I2C connected Cirrus amp. While this works if the related _DSD properties are made available, these aren't included in the ACPI of these laptops (yet). Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20230704044619.19343-3-luke@ljones.dev Signed-off-by: Takashi Iwai commit 8cc87c055d28320e5fa5457922f43bc07dec58bd Author: Luke D. Jones Date: Tue Jul 4 16:46:15 2023 +1200 ALSA: hda/realtek: Add quirk for ASUS ROG GX650P Adds the required quirk to enable the Cirrus amp and correct pins on the ASUS ROG GV601V series which uses an I2C connected Cirrus amp. While this works if the related _DSD properties are made available, these aren't included in the ACPI of these laptops (yet). Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20230704044619.19343-2-luke@ljones.dev Signed-off-by: Takashi Iwai commit 21a235bce12361e64adfc2ef97e4ae2e51ad63d4 Author: Petr Pavlu Date: Wed Jun 21 15:12:13 2023 +0200 xen/virtio: Fix NULL deref when a bridge of PCI root bus has no parent When attempting to run Xen on a QEMU/KVM virtual machine with virtio devices (all x86_64), function xen_dt_get_node() crashes on accessing bus->bridge->parent->of_node because a bridge of the PCI root bus has no parent set: [ 1.694192][ T1] BUG: kernel NULL pointer dereference, address: 0000000000000288 [ 1.695688][ T1] #PF: supervisor read access in kernel mode [ 1.696297][ T1] #PF: error_code(0x0000) - not-present page [ 1.696297][ T1] PGD 0 P4D 0 [ 1.696297][ T1] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 1.696297][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.3.7-1-default #1 openSUSE Tumbleweed a577eae57964bb7e83477b5a5645a1781df990f0 [ 1.696297][ T1] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014 [ 1.696297][ T1] RIP: e030:xen_virtio_restricted_mem_acc+0xd9/0x1c0 [ 1.696297][ T1] Code: 45 0c 83 e8 c9 a3 ea ff 31 c0 eb d7 48 8b 87 40 ff ff ff 48 89 c2 48 8b 40 10 48 85 c0 75 f4 48 8b 82 10 01 00 00 48 8b 40 40 <48> 83 b8 88 02 00 00 00 0f 84 45 ff ff ff 66 90 31 c0 eb a5 48 89 [ 1.696297][ T1] RSP: e02b:ffffc90040013cc8 EFLAGS: 00010246 [ 1.696297][ T1] RAX: 0000000000000000 RBX: ffff888006c75000 RCX: 0000000000000029 [ 1.696297][ T1] RDX: ffff888005ed1000 RSI: ffffc900400f100c RDI: ffff888005ee30d0 [ 1.696297][ T1] RBP: ffff888006c75010 R08: 0000000000000001 R09: 0000000330000006 [ 1.696297][ T1] R10: ffff888005850028 R11: 0000000000000002 R12: ffffffff830439a0 [ 1.696297][ T1] R13: 0000000000000000 R14: ffff888005657900 R15: ffff888006e3e1e8 [ 1.696297][ T1] FS: 0000000000000000(0000) GS:ffff88804a000000(0000) knlGS:0000000000000000 [ 1.696297][ T1] CS: e030 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1.696297][ T1] CR2: 0000000000000288 CR3: 0000000002e36000 CR4: 0000000000050660 [ 1.696297][ T1] Call Trace: [ 1.696297][ T1] [ 1.696297][ T1] virtio_features_ok+0x1b/0xd0 [ 1.696297][ T1] virtio_dev_probe+0x19c/0x270 [ 1.696297][ T1] really_probe+0x19b/0x3e0 [ 1.696297][ T1] __driver_probe_device+0x78/0x160 [ 1.696297][ T1] driver_probe_device+0x1f/0x90 [ 1.696297][ T1] __driver_attach+0xd2/0x1c0 [ 1.696297][ T1] bus_for_each_dev+0x74/0xc0 [ 1.696297][ T1] bus_add_driver+0x116/0x220 [ 1.696297][ T1] driver_register+0x59/0x100 [ 1.696297][ T1] virtio_console_init+0x7f/0x110 [ 1.696297][ T1] do_one_initcall+0x47/0x220 [ 1.696297][ T1] kernel_init_freeable+0x328/0x480 [ 1.696297][ T1] kernel_init+0x1a/0x1c0 [ 1.696297][ T1] ret_from_fork+0x29/0x50 [ 1.696297][ T1] [ 1.696297][ T1] Modules linked in: [ 1.696297][ T1] CR2: 0000000000000288 [ 1.696297][ T1] ---[ end trace 0000000000000000 ]--- The PCI root bus is in this case created from ACPI description via acpi_pci_root_add() -> pci_acpi_scan_root() -> acpi_pci_root_create() -> pci_create_root_bus() where the last function is called with parent=NULL. It indicates that no parent is present and then bus->bridge->parent is NULL too. Fix the problem by checking bus->bridge->parent in xen_dt_get_node() for NULL first. Fixes: ef8ae384b4c9 ("xen/virtio: Handle PCI devices which Host controller is described in DT") Signed-off-by: Petr Pavlu Reviewed-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/20230621131214.9398-2-petr.pavlu@suse.com Signed-off-by: Juergen Gross commit 54372cf043276735e29045abf998895b2ac277cf Author: Alexander Gordeev Date: Tue Jul 4 07:46:26 2023 +0200 Revert "s390/mm: get rid of VMEM_MAX_PHYS macro" This reverts commit 456be42aa713e7f83b467db66ceae779431c7d9d. The assumption VMEM_MAX_PHYS should match ident_map_size is wrong. At least discontiguous saved segments (DCSS) could be loaded at addresses beyond ident_map_size and dcssblk device driver might fail as result. Reported-by: Gerald Schaefer Signed-off-by: Alexander Gordeev commit 6aca56c024e42577c28706a85979a6967b9b5e97 Author: Thomas Richter Date: Fri Jun 23 11:26:30 2023 +0200 s390/cpum_sf: remove check on CPU being online During sampling event initialization, a check is done if that particular CPU the event is to be installed on is actually online. This check is not necessary, as it is also performed in the system call entry point. Therefore remove this check. No functional change. Signed-off-by: Thomas Richter Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit b2534c28b23b099fc399021283ffaf9f40513abf Author: Thomas Richter Date: Fri Jun 23 11:22:40 2023 +0200 s390/cpum_sf: handle casts consistently The casts are written in two different notations: (cast) expression and (cast)expression Convert statements with the first notation to the second notation. No functional change. Signed-off-by: Thomas Richter Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit c13166bdb23976e2cde8f25dd669e2d8250492c9 Author: Thomas Richter Date: Mon Mar 27 14:02:10 2023 +0200 s390/cpum_sf: remove unnecessary debug statement Remove debug_sprint_event() statement right after an pr_err() statement. No additional debug information is generated. No functional change. Signed-off-by: Thomas Richter Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit b2ae4969497ee982fc9f30e53301d53e88ea5b65 Author: Thomas Richter Date: Thu Mar 23 15:14:35 2023 +0100 s390/cpum_sf: remove parameter in call to pr_err The op argument is hardcoded in the parameter list of function pr_err. Make the op code part of the text printed by pr_err. No functional change. Signed-off-by: Thomas Richter Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit eeeff534e9946f1db16eedd35acb9554ad77f4cd Author: Thomas Richter Date: Thu Mar 23 15:07:04 2023 +0100 s390/cpum_sf: simplify function setup_pmu_cpu Print the error message when the FAILURE flag is set. This saves on pr_err statement as the text of the error message is identical in both failures. Also observe reverse Xmas tree variable declarations in this function. No functional change. Signed-off-by: Thomas Richter Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit f4767f9f32b7b1abf43baf3beb077e554e35eea7 Author: Thomas Richter Date: Thu Jun 22 15:08:24 2023 +0200 s390/cpum_cf: remove unneeded debug statements Remove most debug statements which are not needed anymore from the CPU Measurement counter facility device driver. Signed-off-by: Thomas Richter Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 1cfd4ccb3014922c8516557d857b6bc83e7db980 Author: Jan Beulich Date: Fri Jun 16 08:36:00 2023 +0200 x86/Xen: tidy xen-head.S First of all move PV-only ELF notes inside the XEN_PV conditional; note that - HV_START_LOW is dropped altogether, as it was meaningful for 32-bit PV only, - the 32-bit instance of VIRT_BASE is dropped, as it would be dead code once inside the conditional, - while PADDR_OFFSET is not exactly unused for PVH, it defaults to zero there, and the hypervisor (or tool stack) complains if it is present but VIRT_BASE isn't. Then have the "supported features" note actually report reality: All three of the features there are supported and/or applicable only in certain cases. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/f99bacc6-2a2f-41b0-5c0b-e01b7051cb07@suse.com Signed-off-by: Juergen Gross commit 24be4d0b46bb0c3c1dc7bacd30957d6144a70dfc Author: SeongJae Park Date: Tue Jul 4 01:00:03 2023 +0000 arch/arm64/mm/fault: Fix undeclared variable error in do_page_fault() Commit ae870a68b5d1 ("arm64/mm: Convert to using lock_mm_and_find_vma()") made do_page_fault() to use 'vma' even if CONFIG_PER_VMA_LOCK is not defined, but the declaration is still in the ifdef. As a result, building kernel without the config fails with undeclared variable error as below: arch/arm64/mm/fault.c: In function 'do_page_fault': arch/arm64/mm/fault.c:624:2: error: 'vma' undeclared (first use in this function); did you mean 'vmap'? 624 | vma = lock_mm_and_find_vma(mm, addr, regs); | ^~~ | vmap Fix it by moving the declaration out of the ifdef. Fixes: ae870a68b5d1 ("arm64/mm: Convert to using lock_mm_and_find_vma()") Signed-off-by: SeongJae Park Signed-off-by: Linus Torvalds commit e50df24979fd02f920aa7baada714a58bc61bfd9 Merge: 4f52875366bfb 3c2f765c81be1 Author: Linus Torvalds Date: Mon Jul 3 18:48:38 2023 -0700 Merge tag 'block-6.5-2023-07-03' of git://git.kernel.dk/linux Pull more block updates from Jens Axboe: "Mostly items that came in a bit late for the initial pull request, wanted to make sure they had the appropriate amount of linux-next soak before going upstream. Outside of stragglers, just generic fixes for either merge window items, or longer standing bugs" * tag 'block-6.5-2023-07-03' of git://git.kernel.dk/linux: (25 commits) md/raid0: add discard support for the 'original' layout nvme: disable controller on reset state failure nvme: sync timeout work on failed reset nvme: ensure unquiesce on teardown cdrom/gdrom: Fix build error nvme: improved uring polling block: add request polling helper nvme-mpath: fix I/O failure with EAGAIN when failing over I/O nvme: host: fix command name spelling blk-sysfs: add a new attr_group for blk_mq blk-iocost: move wbt_enable/disable_default() out of spinlock blk-wbt: cleanup rwb_enabled() and wbt_disabled() blk-wbt: remove dead code to handle wbt enable/disable with io inflight blk-wbt: don't create wbt sysfs entry if CONFIG_BLK_WBT is disabled blk-mq: fix two misuses on RQF_USE_SCHED blk-throttle: Fix io statistics for cgroup v1 bcache: Fix bcache device claiming bcache: Alloc holder object before async registration raid10: avoid spin_lock from fastpath from raid10_unplug() md: fix 'delete_mutex' deadlock ... commit 4f52875366bfbd6ddc19c1045b603d853e0a889c Merge: 69c9f23070f8b dfbe5561ae933 Author: Linus Torvalds Date: Mon Jul 3 18:43:10 2023 -0700 Merge tag 'io_uring-6.5-2023-07-03' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: "The fix for the msghdr->msg_inq assigned value being wrong, using -1 instead of -1U for the signed type. Also a fix for ensuring when we're trying to run task_work on an exiting task, that we wait for it. This is not really a correctness thing as the work is being canceled, but it does help with ensuring file descriptors are closed when the task has exited." * tag 'io_uring-6.5-2023-07-03' of git://git.kernel.dk/linux: io_uring: flush offloaded and delayed task_work on exit io_uring: remove io_fallback_tw() forward declaration io_uring/net: use proper value for msg_inq commit 69c9f23070f8b4651b17557a0108d07b87437ede Merge: 0df241385b696 42877c38ac78e Author: Linus Torvalds Date: Mon Jul 3 17:31:36 2023 -0700 Merge tag 'hsi-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi Pull HSI updates from Sebastian Reichel: - fix build warning with W=1 - drop error handling for debugfs * tag 'hsi-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi: HSI: omap_ssi_port: Drop error checking for debugfs_create_dir HSI: fix ssi_waketest() declaration commit 0df241385b69616f5d7d41824348528b189ffd01 Merge: 02676ecca76ce ef8d95b4a3af4 Author: Linus Torvalds Date: Mon Jul 3 17:23:16 2023 -0700 Merge tag 'for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: - Add new Qualcomm PMI8998/PM660 SMB2 charger - bq256xx: support systems without thermistors - cros_pchg: fix peripheral device status after system resume - axp20x_usb_power: add support for AXP192 - qcom-pon: add support for pm8941 - at91-reset: prepare to expose reset reason to sysfs - switch all I2C drivers back to use .probe instead of .probe_new - convert some more DT bindings to YAML - misc cleanups * tag 'for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (28 commits) MAINTAINERS: add documentation file for Microchip SAMA5D2 shutdown controller dt-bindings: power: reset: atmel,sama5d2-shdwc: convert to yaml dt-bindings: power: reset: atmel,at91sam9260-shdwc: convert to yaml power: reset: at91-reset: change the power on reason prototype power: reset: qcom-pon: add support for pm8941-pon dt-bindings: power: reset: qcom-pon: define pm8941-pon power: supply: add Qualcomm PMI8998 SMB2 Charger driver dt-bindings: power: supply: qcom,pmi8998-charger: add bindings for smb2 driver power: supply: rt9467: Make charger-enable control as logic level power: supply: Switch i2c drivers back to use .probe() power: reset: add HAS_IOPORT dependencies dt-bindings: power: supply: axp20x: Add AXP192 compatible power: supply: axp20x_usb_power: Add support for AXP192 power: supply: axp20x_usb_power: Remove variant IDs from VBUS polling check power: supply: axp20x_usb_power: Use regmap field for VBUS disabling power: supply: axp20x_usb_power: Use regmap fields for USB BC feature power: supply: axp20x_usb_power: Use regmap fields for VBUS monitor feature power: supply: axp20x_usb_power: Simplify USB current limit handling power: supply: hwmon: constify pointers to hwmon_channel_info power: supply: twl4030_madc_battery: Refactor twl4030_madc_bat_ext_changed() ... commit 02676ecca76cea4316c8a1e867850d88f6149806 Merge: 6afb24a0fe729 181da4bcc3d4b Author: Linus Torvalds Date: Mon Jul 3 17:03:05 2023 -0700 Merge tag 'rproc-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc updates from Bjorn Andersson: "The bulk of these patches relates to the moving to a void-returning remove callback. The i.MX HiFi remoteproc driver gets its pm_ops helpers updated to resolve build warnings about 'defined but not used' variables in certain configurations. The ST STM32 remoteproc driver is extended to allow using a SCMI reset controller to hold boot, and has an error message corrected. The Qualcomm Q6V5 PAS driver gains a missing 'static' qualifier on adsp_segment_dump()" * tag 'rproc-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (23 commits) remoteproc: qcom_q6v5_pas: staticize adsp_segment_dump() remoteproc: stm32: Fix error code in stm32_rproc_parse_dt() remoteproc: stm32: Allow hold boot management by the SCMI reset controller dt-bindings: remoteproc: st,stm32-rproc: Rework reset declarations remoteproc: imx_dsp_rproc: use modern pm_ops remoteproc: wkup_m3: Convert to platform remove callback returning void remoteproc: stm32: Convert to platform remove callback returning void remoteproc: st: Convert to platform remove callback returning void remoteproc: virtio: Convert to platform remove callback returning void remoteproc: rcar: Convert to platform remove callback returning void remoteproc: qcom_wcnss: Convert to platform remove callback returning void remoteproc: qcom_q6v5_wcss: Convert to platform remove callback returning void remoteproc: qcom_q6v5_pas: Convert to platform remove callback returning void remoteproc: qcom_q6v5_mss: Convert to platform remove callback returning void remoteproc: qcom_q6v5_adsp: Convert to platform remove callback returning void remoteproc: pru: Convert to platform remove callback returning void remoteproc: omap: Convert to platform remove callback returning void remoteproc: mtk_scp: Convert to platform remove callback returning void remoteproc: meson_mx_ao_arc: Convert to platform remove callback returning void remoteproc: keystone: Convert to platform remove callback returning void ... commit 6afb24a0fe7294f004ee6c43b10251ff86218d56 Merge: b39aeb338a6f3 1b39e76071443 Author: Linus Torvalds Date: Mon Jul 3 16:59:51 2023 -0700 Merge tag 'hwlock-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull hwspinlock update from Bjorn Andersson: "This drops the last of_match_ptr() from the hwspinlock drivers, solving the resulting 'defined but not used' warning/error" * tag 'hwlock-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: hwspinlock: omap: drop of_match_ptr for ID table commit b39aeb338a6f3854fe52c7e669438731ec2138c9 Author: Arnd Bergmann Date: Mon Jul 3 13:30:06 2023 +0200 rdma: fix INFINIBAND_USER_ACCESS dependency After a change to the bnxt_re driver, it fails to link when CONFIG_INFINIBAND_USER_ACCESS is disabled: aarch64-linux-ld: drivers/infiniband/hw/bnxt_re/ib_verbs.o: in function `bnxt_re_handler_BNXT_RE_METHOD_ALLOC_PAGE': ib_verbs.c:(.text+0xd64): undefined reference to `ib_uverbs_get_ucontext_file' aarch64-linux-ld: drivers/infiniband/hw/bnxt_re/ib_verbs.o:(.rodata+0x168): undefined reference to `uverbs_idr_class' aarch64-linux-ld: drivers/infiniband/hw/bnxt_re/ib_verbs.o:(.rodata+0x1a8): undefined reference to `uverbs_destroy_def_handler' The problem is that the 'bnxt_re_uapi_defs' structure is built unconditionally and references a couple of functions that are never really called in this configuration but instead require other functions that are left out. Adding an #ifdef around the new code, or a Kconfig dependency would address this problem, but adding the compile-time check inside of the UAPI_DEF_CHAIN_OBJ_TREE_NAMED() macro seems best because that also addresses the problem in other drivers that may run into the same dependency. Fixes: 360da60d6c6ed ("RDMA/bnxt_re: Enable low latency push") Signed-off-by: Arnd Bergmann Acked-by: Leon Romanovsky Signed-off-by: Linus Torvalds commit a8d70602b186f3c347e62c59a418be802b71886d Merge: e8069f5a8e3bd 9e396a2f434f8 Author: Linus Torvalds Date: Mon Jul 3 15:38:26 2023 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio updates from Michael Tsirkin: - resume support in vdpa/solidrun - structure size optimizations in virtio_pci - new pds_vdpa driver - immediate initialization mechanism for vdpa/ifcvf - interrupt bypass for vdpa/mlx5 - multiple worker support for vhost - viirtio net in Intel F2000X-PL support for vdpa/ifcvf - fixes, cleanups all over the place * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (48 commits) vhost: Make parameter name match of vhost_get_vq_desc() vduse: fix NULL pointer dereference vhost: Allow worker switching while work is queueing vhost_scsi: add support for worker ioctls vhost: allow userspace to create workers vhost: replace single worker pointer with xarray vhost: add helper to parse userspace vring state/file vhost: remove vhost_work_queue vhost_scsi: flush IO vqs then send TMF rsp vhost_scsi: convert to vhost_vq_work_queue vhost_scsi: make SCSI cmd completion per vq vhost_sock: convert to vhost_vq_work_queue vhost: convert poll work to be vq based vhost: take worker or vq for flushing vhost: take worker or vq instead of dev for queueing vhost, vhost_net: add helper to check if vq has work vhost: add vhost_worker pointer to vhost_virtqueue vhost: dynamically allocate vhost_worker vhost: create worker at end of vhost_dev_set_owner virtio_bt: call scheduler when we free unused buffs ... commit e8069f5a8e3bdb5fdeeff895780529388592ee7a Merge: eded37770c9f8 255006adb3da7 Author: Linus Torvalds Date: Mon Jul 3 15:32:22 2023 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm updates from Paolo Bonzini: "ARM64: - Eager page splitting optimization for dirty logging, optionally allowing for a VM to avoid the cost of hugepage splitting in the stage-2 fault path. - Arm FF-A proxy for pKVM, allowing a pKVM host to safely interact with services that live in the Secure world. pKVM intervenes on FF-A calls to guarantee the host doesn't misuse memory donated to the hyp or a pKVM guest. - Support for running the split hypervisor with VHE enabled, known as 'hVHE' mode. This is extremely useful for testing the split hypervisor on VHE-only systems, and paves the way for new use cases that depend on having two TTBRs available at EL2. - Generalized framework for configurable ID registers from userspace. KVM/arm64 currently prevents arbitrary CPU feature set configuration from userspace, but the intent is to relax this limitation and allow userspace to select a feature set consistent with the CPU. - Enable the use of Branch Target Identification (FEAT_BTI) in the hypervisor. - Use a separate set of pointer authentication keys for the hypervisor when running in protected mode, as the host is untrusted at runtime. - Ensure timer IRQs are consistently released in the init failure paths. - Avoid trapping CTR_EL0 on systems with Enhanced Virtualization Traps (FEAT_EVT), as it is a register commonly read from userspace. - Erratum workaround for the upcoming AmpereOne part, which has broken hardware A/D state management. RISC-V: - Redirect AMO load/store misaligned traps to KVM guest - Trap-n-emulate AIA in-kernel irqchip for KVM guest - Svnapot support for KVM Guest s390: - New uvdevice secret API - CMM selftest and fixes - fix racy access to target CPU for diag 9c x86: - Fix missing/incorrect #GP checks on ENCLS - Use standard mmu_notifier hooks for handling APIC access page - Drop now unnecessary TR/TSS load after VM-Exit on AMD - Print more descriptive information about the status of SEV and SEV-ES during module load - Add a test for splitting and reconstituting hugepages during and after dirty logging - Add support for CPU pinning in demand paging test - Add support for AMD PerfMonV2, with a variety of cleanups and minor fixes included along the way - Add a "nx_huge_pages=never" option to effectively avoid creating NX hugepage recovery threads (because nx_huge_pages=off can be toggled at runtime) - Move handling of PAT out of MTRR code and dedup SVM+VMX code - Fix output of PIC poll command emulation when there's an interrupt - Add a maintainer's handbook to document KVM x86 processes, preferred coding style, testing expectations, etc. - Misc cleanups, fixes and comments Generic: - Miscellaneous bugfixes and cleanups Selftests: - Generate dependency files so that partial rebuilds work as expected" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (153 commits) Documentation/process: Add a maintainer handbook for KVM x86 Documentation/process: Add a label for the tip tree handbook's coding style KVM: arm64: Fix misuse of KVM_ARM_VCPU_POWER_OFF bit index RISC-V: KVM: Remove unneeded semicolon RISC-V: KVM: Allow Svnapot extension for Guest/VM riscv: kvm: define vcpu_sbi_ext_pmu in header RISC-V: KVM: Expose IMSIC registers as attributes of AIA irqchip RISC-V: KVM: Add in-kernel virtualization of AIA IMSIC RISC-V: KVM: Expose APLIC registers as attributes of AIA irqchip RISC-V: KVM: Add in-kernel emulation of AIA APLIC RISC-V: KVM: Implement device interface for AIA irqchip RISC-V: KVM: Skeletal in-kernel AIA irqchip support RISC-V: KVM: Set kvm_riscv_aia_nr_hgei to zero RISC-V: KVM: Add APLIC related defines RISC-V: KVM: Add IMSIC related defines RISC-V: KVM: Implement guest external interrupt line management KVM: x86: Remove PRIx* definitions as they are solely for user space s390/uv: Update query for secret-UVCs s390/uv: replace scnprintf with sysfs_emit s390/uvdevice: Add 'Lock Secret Store' UVC ... commit eded37770c9f80ecd5ba842359c4f1058d9812c3 Merge: 56cbceab928d7 b6464883f45ae Author: Linus Torvalds Date: Mon Jul 3 15:19:56 2023 -0700 Merge tag 'kgdb-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux Pull kgdb updates from Daniel Thompson: "Fairly small changes this cycle: - An additional static inline function when kgdb is not enabled to reduce boilerplate in arch files - kdb will now handle input with linefeeds more like carriage return. This will make little difference for interactive use but can make it script to use expect-like interaction with kdb - A couple of warning fixes" * tag 'kgdb-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux: kdb: move kdb_send_sig() declaration to a better header file kdb: Handle LF in the command parser kdb: include kdb_private.h for function prototypes kgdb: Provide a stub kgdb_nmicallback() if !CONFIG_KGDB commit 432928c9377959684c748a9bc6553ed2d3c2ea4f Author: Bob Peterson Date: Wed Jun 28 09:54:41 2023 -0500 gfs2: Add quota_change type Function do_qc has two main uses: (1) to re-sync the local quota changes (qd) to the master quotas, and (2) normal quota changes. In the case of normal quota changes, the change can be positive or negative, as the quota usage goes up and down. Before this patch function do_qc was distinguishing one from another by whether the resulting value is or isn't zero: In the case of a re-sync (called do_sync) the quota value is moved from the temporary value to a master value, so the amount is added to one and subtracted from the other. The problem is that since the values can be positive or negative we can occasionally run into situations where we are not doing a re-sync but the quota change just happens to cancel out the previous value. In the case of a re-sync extra references and locks are taken, and so do_qc needs to release them. In the case of a normal quota change, no extra references and locks are taken, so it must not try to release them. The problem is: if the quota change is not a re-sync but the value just happens to cancel out the original quota change, the resulting zero value fools do_qc into thinking this is a re-sync and therefore it must release the extra references. This results in problems, mainly having to do with slot reference numbers going smaller than zero. This patch introduces new constants, QC_SYNC and QC_CHANGE so do_qc can really tell the difference. For QC_SYNC calls it must release the extra references acquired by gfs2_quota_unlock's call to qd_check_sync. For QC_CHANGE calls it does not have extra references to put. Note that this allows quota changes back to a value of zero, and so I removed an assert warning related to that. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit d68d0c6c3fc781c8a130e6a4d0666dbbd69e917b Author: Andreas Gruenbacher Date: Tue Jun 27 15:34:36 2023 +0200 gfs2: Use memcpy_{from,to}_page where appropriate Replace kmap_local_page() + memcpy() + kunmap_local() sequences with memcpy_{from,to}_page() where we are not doing anything else with the mapped page. Signed-off-by: Andreas Gruenbacher commit b0c21c6d527491276b1f7c9580bd2bf08c081add Author: Andreas Gruenbacher Date: Tue Jun 27 00:22:54 2023 +0200 gfs2: Convert remaining kmap_atomic calls to kmap_local_page Replace the remaining instances of kmap_atomic() ... kunmap_atomic() with kmap_local_page() ... kunmap_local(). In gfs2_write_buf_to_page(), we can call flush_dcache_page() after unmapping the page. Signed-off-by: Andreas Gruenbacher commit 58721bd46c9aaa2d890b2d61cbb8740745455aa9 Author: Deepak R Varma Date: Mon Jun 26 12:21:09 2023 +0530 gfs2: Replace deprecated kmap_atomic with kmap_local_page kmap_atomic() is deprecated in favor of kmap_local_{folio,page}(). Therefore, replace kmap_atomic() with kmap_local_page() in gfs2_internal_read() and stuffed_readpage(). kmap_atomic() disables page-faults and preemption (the latter only for !PREEMPT_RT kernels), However, the code within the mapping/un-mapping in gfs2_internal_read() and stuffed_readpage() does not depend on the above-mentioned side effects. Therefore, a mere replacement of the old API with the new one is all that is required (i.e., there is no need to explicitly add any calls to pagefault_disable() and/or preempt_disable()). Signed-off-by: Deepak R Varma Signed-off-by: Andreas Gruenbacher commit f246dd4b78e0efda8aa3f93f831a44e12ef0e59e Author: Andreas Gruenbacher Date: Wed Jun 21 22:32:06 2023 +0200 gfs: Get rid of unnucessary locking in inode_go_dump Commit 27a2660f1ef9 ("gfs2: Dump nrpages for inodes and their glocks") added some locking around reading inode->i_data.nrpages. That locking doesn't do anything really, so get rid of it. With that, the glock argument to ->go_dump() can be made const again as well. Signed-off-by: Andreas Gruenbacher commit 6c7410f44961cf72d49a18e455ad4ae833f6fb7c Author: Andreas Gruenbacher Date: Mon Nov 28 02:30:35 2022 +0100 gfs2: gfs2_freeze_lock_shared cleanup All the remaining users of gfs2_freeze_lock_shared() set freeze_gh to &sdp->sd_freeze_gh and flags to 0, so remove those two parameters. Signed-off-by: Andreas Gruenbacher commit 5432af15f8772d5e1a44d59d6ffcd513da8436b4 Author: Andreas Gruenbacher Date: Thu Aug 18 16:12:24 2022 +0200 gfs2: Replace sd_freeze_state with SDF_FROZEN flag Replace sd_freeze_state with a new SDF_FROZEN flag. There no longer is a need for indicating that a freeze is in progress (SDF_STARTING_FREEZE); we are now protecting the critical sections with the sd_freeze_mutex. Signed-off-by: Andreas Gruenbacher commit b77b4a4815a9651d1d6e07b8e6548eee9531a5eb Author: Andreas Gruenbacher Date: Mon Nov 14 23:34:50 2022 +0100 gfs2: Rework freeze / thaw logic So far, at mount time, gfs2 would take the freeze glock in shared mode and then immediately drop it again, turning it into a cached glock that can be reclaimed at any time. To freeze the filesystem cluster-wide, the node initiating the freeze would take the freeze glock in exclusive mode, which would cause the freeze glock's freeze_go_sync() callback to run on each node. There, gfs2 would freeze the filesystem and schedule gfs2_freeze_func() to run. gfs2_freeze_func() would re-acquire the freeze glock in shared mode, thaw the filesystem, and drop the freeze glock again. The initiating node would keep the freeze glock held in exclusive mode. To thaw the filesystem, the initiating node would drop the freeze glock again, which would allow gfs2_freeze_func() to resume on all nodes, leaving the filesystem in the thawed state. It turns out that in freeze_go_sync(), we cannot reliably and safely freeze the filesystem. This is primarily because the final unmount of a filesystem takes a write lock on the s_umount rw semaphore before calling into gfs2_put_super(), and freeze_go_sync() needs to call freeze_super() which also takes a write lock on the same semaphore, causing a deadlock. We could work around this by trying to take an active reference on the super block first, which would prevent unmount from running at the same time. But that can fail, and freeze_go_sync() isn't actually allowed to fail. To get around this, this patch changes the freeze glock locking scheme as follows: At mount time, each node takes the freeze glock in shared mode. To freeze a filesystem, the initiating node first freezes the filesystem locally and then drops and re-acquires the freeze glock in exclusive mode. All other nodes notice that there is contention on the freeze glock in their go_callback callbacks, and they schedule gfs2_freeze_func() to run. There, they freeze the filesystem locally and drop and re-acquire the freeze glock before re-thawing the filesystem. This is happening outside of the glock state engine, so there, we are allowed to fail. From a cluster point of view, taking and immediately dropping a glock is indistinguishable from taking the glock and only dropping it upon contention, so this new scheme is compatible with the old one. Thanks to Li Dong for reporting a locking bug in gfs2_freeze_func() in a previous version of this commit. Signed-off-by: Andreas Gruenbacher commit 56cbceab928d7ac3702de172ff8dcc1da2a6aaeb Merge: 868a9fd948078 18af4b5c97915 Author: Linus Torvalds Date: Mon Jul 3 13:23:10 2023 -0700 Merge tag 'usb-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB / Thunderbolt driver updates from Greg KH: "Here is the big set of USB and Thunderbolt driver updates for 6.5-rc1. Included in here are: - Lots of USB4/Thunderbolt additions and updates for new hardware types and fixes as people are starting to get access to the hardware in the wild - new gadget controller driver, cdns2, added - new typec drivers added - xhci driver updates - typec driver updates - usbip driver fixes - usb-serial driver updates and fixes - lots of smaller USB driver updates All of these have been in linux-next for a while with no reported problems" * tag 'usb-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (265 commits) usb: host: xhci-plat: Set XHCI_STATE_REMOVING before resuming XHCI HC usb: host: xhci: Do not re-initialize the XHCI HC if being removed usb: typec: nb7vpq904m: fix CONFIG_DRM dependency usbip: usbip_host: Replace strlcpy with strscpy usb: dwc3: gadget: Propagate core init errors to UDC during pullup USB: serial: option: add LARA-R6 01B PIDs usb: ulpi: Make container_of() no-op in to_ulpi_dev() usb: gadget: legacy: fix error return code in gfs_bind usb: typec: fsa4480: add support for Audio Accessory Mode usb: typec: fsa4480: rework mux & switch setup to handle more states usb: typec: ucsi: call typec_set_mode on non-altmode partner change USB: gadget: f_hid: make hidg_class a static const structure USB: gadget: f_printer: make usb_gadget_class a static const structure USB: mon: make mon_bin_class a static const structure USB: gadget: udc: core: make udc_class a static const structure USB: roles: make role_class a static const structure dt-bindings: usb: dwc3: Add interrupt-names property support for wakeup interrupt dt-bindings: usb: Add StarFive JH7110 USB controller dt-bindings: usb: dwc3: Add IPQ9574 compatible usb: cdns2: Fix spelling mistake in a trace message "Wakupe" -> "Wakeup" ... commit 2c5d234d7f55e4ba7f3ee00fb9452ac7c97b4a46 Author: Rahul Rameshbabu Date: Tue Jun 27 16:21:39 2023 -0700 ptp: Make max_phase_adjustment sysfs device attribute invisible when not supported The .adjphase operation is an operation that is implemented only by certain PHCs. The sysfs device attribute node for querying the maximum phase adjustment supported should not be exposed on devices that do not support .adjphase. Fixes: c3b60ab7a4df ("ptp: Add .getmaxphase callback to ptp_clock_info") Signed-off-by: Rahul Rameshbabu Reported-by: Nathan Chancellor Reported-by: Naresh Kamboju Reported-by: Linux Kernel Functional Testing Link: https://lore.kernel.org/netdev/20230627162146.GA114473@dev-arch.thelio-3990X/ Link: https://lore.kernel.org/all/CA+G9fYtKCZeAUTtwe69iK8Xcz1mOKQzwcy49wd+imZrfj6ifXA@mail.gmail.com/ Tested-by: Nathan Chancellor Reviewed-by: Andrew Lunn Acked-by: Richard Cochran Reviewed-by: Petr Vorel Message-ID: <20230627232139.213130-1-rrameshbabu@nvidia.com> Signed-off-by: Jakub Kicinski commit 868a9fd9480785952336e5f119e1f75877c423a8 Merge: db9c6d1d7fcc6 e534755c9412b Author: Linus Torvalds Date: Mon Jul 3 13:14:58 2023 -0700 Merge tag 'tty-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver updates from Greg KH: "Here is the big set of tty/serial driver updates for 6.5-rc1. Included in here are: - tty_audit code cleanups from Jiri - more 8250 cleanups from Ilpo - samsung_tty driver bugfixes - 8250 lock port updates - usual fsl_lpuart driver updates and fixes - other small serial driver fixes and updates, full details in the shortlog All of these have been in linux-next for a while with no reported issues" * tag 'tty-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (58 commits) tty_audit: make data of tty_audit_log() const tty_audit: make tty pointers in exposed functions const tty_audit: make icanon a bool tty_audit: invert the condition in tty_audit_log() tty_audit: use kzalloc() in tty_audit_buf_alloc() tty_audit: use TASK_COMM_LEN for task comm Revert "8250: add support for ASIX devices with a FIFO bug" serial: atmel: don't enable IRQs prematurely tty: serial: Add Nuvoton ma35d1 serial driver support tty: serial: fsl_lpuart: add earlycon for imx8ulp platform tty: serial: imx: fix rs485 rx after tx selftests: tty: add selftest for tty timestamp updates tty: tty_io: update timestamps on all device nodes tty: fix hang on tty device with no_room set serial: core: fix -EPROBE_DEFER handling in init serial: 8250_omap: Use force_suspend and resume for system suspend tty: serial: samsung_tty: Use abs() to simplify some code tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() when iterating clk tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() in case of error serial: 8250: Apply FSL workarounds also without SERIAL_8250_CONSOLE ... commit db9c6d1d7fcc6dc803f042bf3d29bbff91837f57 Merge: fc75f21645935 4a22870cede37 Author: Linus Torvalds Date: Mon Jul 3 13:07:13 2023 -0700 Merge tag 'staging-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is a set of staging driver updates for 6.5-rc1. It's a small update this merge window, nothing major at all, overall just under 1000 lines of code removed, not a huge churn. Nothing major to highlight here either, just lots of small coding style fixes. All of these have been in linux-next for a while with no reported problems" * tag 'staging-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (62 commits) staging: rtl8192e: Remove whitespace and blank lines staging: rtl8192e: remove 5G related code staging: rtl8192e: remove comparison to true staging: rtl8192e: remove return statement from void function staging: rtl8192e: convert else if sequence to switch staging: rtl8192e: clean up brace coding style issues staging: rtl8723bs: Fix blank line issues staging: rtl8723bs: Fix block comment issue staging: rtl8723bs: Fix indentation issues staging: vchiq_arm: Remove extra struct vchiq_instance declaration staging: rtl8192e: Rename variable InitialGainHandler staging: rtl8192e: Rename variable LeisurePSLeave staging: rtl8192e: Rename variable SetBWModeHandler staging: rtl8192e: Rename variable SetWirelessMode staging: rtl8192e: Rename RTLLIB_LINKED_SCANNING staging: rtl8192e: Rename RTLLIB_LINKED to MAC80211_LINKED staging: rtl8192e: Rename RTLLIB_NOLINK to MAC80211_NOLINK staging: rtl8192e: Rename state to link_state staging: rtl8192e: Rename rtllib_state to rtl_link_state staging: rtl8192e: Remove unused enum led_ctl_mode ... commit fc75f2164593554e3ec36261cec0588c8ed32641 Merge: 44aeec836da88 a91845b9a8720 Author: Linus Torvalds Date: Mon Jul 3 12:56:23 2023 -0700 Merge tag 'driver-core-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here are a small set of changes for 6.5-rc1 for some driver core changes. Included in here are: - device property cleanups to make it easier to write "agnostic" drivers when regards to the firmware layer underneath them (DT vs. ACPI) - debugfs documentation updates - devres additions - sysfs documentation and changes to handle empty directory creation logic better - tiny kernfs optimizations - other tiny changes All of these have been in linux-next for a while with no reported problems" * tag 'driver-core-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: sysfs: Skip empty folders creation sysfs: Improve readability by following the kernel coding style drivers: fwnode: fix fwnode_irq_get[_byname]() ata: ahci_platform: Make code agnostic to OF/ACPI device property: Implement device_is_compatible() ACPI: Move ACPI_DEVICE_CLASS() to mod_devicetable.h base/node: Use 'property' to identify an access parameter driver core: device.h: add some missing kerneldocs kernfs: fix missing kernfs_idr_lock to remove an ID from the IDR isa: Remove unnecessary checks MAINTAINERS: add entry for auxiliary bus debugfs: Correct the 'debugfs_create_str' docs serial: qcom_geni: Comment use of devm_krealloc rather than devm_krealloc_array iio: adc: Use devm_krealloc_array hwmon: pmbus: Use devm_krealloc_array commit 5e2956ee46244ffba1d345bae8115aa5dc199adc Author: Kees Cook Date: Mon Jul 3 12:50:26 2023 -0700 Revert "fortify: Allow KUnit test to build without FORTIFY" This reverts commit a9dc8d0442294b426b1ebd4ec6097c82ebe282e0. The standard for KUnit is to not build tests at all when required functionality is missing, rather than doing test "skip". Restore this for the fortify tests, so that architectures without CONFIG_ARCH_HAS_FORTIFY_SOURCE do not emit unsolvable warnings. Reported-by: Geert Uytterhoeven Closes: https://lore.kernel.org/all/CAMuHMdUrxOEroHVUt7-mAnKSBjY=a-D3jr+XiAifuwv06Ob9Pw@mail.gmail.com Signed-off-by: Kees Cook commit 44aeec836da880c73a8deb2c7735c6e7c36f47c3 Merge: 0a8d6c9c7128a adfdaf81f9d48 Author: Linus Torvalds Date: Mon Jul 3 12:46:47 2023 -0700 Merge tag 'char-misc-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull Char/Misc updates from Greg KH: "Here is the big set of char/misc and other driver subsystem updates for 6.5-rc1. Lots of different, tiny, stuff in here, from a range of smaller driver subsystems, including pulls from some substems directly: - IIO driver updates and additions - W1 driver updates and fixes (and a new maintainer!) - FPGA driver updates and fixes - Counter driver updates - Extcon driver updates - Interconnect driver updates - Coresight driver updates - mfd tree tag merge needed for other updates on top of that, lots of small driver updates as patches, including: - static const updates for class structures - nvmem driver updates - pcmcia driver fix - lots of other small driver updates and fixes All of these have been in linux-next for a while with no reported problems" * tag 'char-misc-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (243 commits) bsr: fix build problem with bsr_class static cleanup comedi: make all 'class' structures const char: xillybus: make xillybus_class a static const structure xilinx_hwicap: make icap_class a static const structure virtio_console: make port class a static const structure ppdev: make ppdev_class a static const structure char: misc: make misc_class a static const structure /dev/mem: make mem_class a static const structure char: lp: make lp_class a static const structure dsp56k: make dsp56k_class a static const structure bsr: make bsr_class a static const structure oradax: make 'cl' a static const structure hwtracing: hisi_ptt: Fix potential sleep in atomic context hwtracing: hisi_ptt: Advertise PERF_PMU_CAP_NO_EXCLUDE for PTT PMU hwtracing: hisi_ptt: Export available filters through sysfs hwtracing: hisi_ptt: Add support for dynamically updating the filter list hwtracing: hisi_ptt: Factor out filter allocation and release operation samples: pfsm: add CC_CAN_LINK dependency misc: fastrpc: check return value of devm_kasprintf() coresight: dummy: Update type of mode parameter in dummy_{sink,source}_enable() ... commit 567f67acac94e7bbc4cb4b71ff9773555d02609a Author: Sebastian Reichel Date: Mon Jul 3 18:41:29 2023 +0200 irqchip/gic-v3: Enable Rockchip 3588001 erratum workaround for RK3588S Commit a8707f553884 ("irqchip/gic-v3: Add Rockchip 3588001 erratum workaround") mentioned RK3588S (the slimmed down variant of RK3588) being affected, but did not check for its compatible value. Thus the quirk is not applied on RK3588S. Since the GIC ITS node got added to the upstream DT, boards using RK3588S are no longer booting without this quirk being applied. Fixes: 06cdac8e8407 ("arm64: dts: rockchip: add GIC ITS support to rk3588") Signed-off-by: Sebastian Reichel Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230703164129.193991-1-sebastian.reichel@collabora.com commit 926846a703cbf5d0635cc06e67d34b228746554b Author: Marc Zyngier Date: Sat Jun 17 08:32:42 2023 +0100 irqchip/gic-v4.1: Properly lock VPEs when doing a directLPI invalidation We normally rely on the irq_to_cpuid_[un]lock() primitives to make sure nothing will change col->idx while performing a LPI invalidation. However, these primitives do not cover VPE doorbells, and we have some open-coded locking for that. Unfortunately, this locking is pretty bogus. Instead, extend the above primitives to cover VPE doorbells and convert the whole thing to it. Fixes: f3a059219bc7 ("irqchip/gic-v4.1: Ensure mutual exclusion between vPE affinity change and RD access") Reported-by: Kunkun Jiang Signed-off-by: Marc Zyngier Cc: Zenghui Yu Cc: wanghaibin.wang@huawei.com Tested-by: Kunkun Jiang Reviewed-by: Zenghui Yu Link: https://lore.kernel.org/r/20230617073242.3199746-1-maz@kernel.org commit 55ad24857341c36616ecc1d9580af5626c226cf1 Author: Jonas Gorski Date: Thu Jun 29 09:26:20 2023 +0200 irq-bcm6345-l1: Do not assume a fixed block to cpu mapping The irq to block mapping is fixed, and interrupts from the first block will always be routed to the first parent IRQ. But the parent interrupts themselves can be routed to any available CPU. This is used by the bootloader to map the first parent interrupt to the boot CPU, regardless wether the boot CPU is the first one or the second one. When booting from the second CPU, the assumption that the first block's IRQ is mapped to the first CPU breaks, and the system hangs because interrupts do not get routed correctly. Fix this by passing the appropriate bcm6434_l1_cpu to the interrupt handler instead of the chip itself, so the handler always has the right block. Fixes: c7c42ec2baa1 ("irqchips/bmips: Add bcm6345-l1 interrupt controller") Signed-off-by: Jonas Gorski Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Florian Fainelli Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230629072620.62527-1-jonas.gorski@gmail.com commit 0a8d6c9c7128a93689fba384cdd7f72b0ce19abd Merge: c156d4af43540 a33677b9211b6 Author: Linus Torvalds Date: Mon Jul 3 11:31:01 2023 -0700 Merge tag 'backlight-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "New Functionality: - Add lots of Device Tree bindings / support - Turn off LED strings when display is blank - Switch I2C drivers from .probe_new() to .probe() - Remove superfluous NULL checks - Only obtain PWM information once and do it in .probe() Fix-ups: - Ensure locks are obtained and held when required" * tag 'backlight-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: led_bl: Take led_access lock when required video: backlight: lp855x: Get PWM for PWM mode during probe dt-bindings: backlight: lp855x: Convert to YAML and modernize dt-bindings: backlight: pwm: Make power-supply not required backlight: pwm_bl: Remove unneeded checks for valid GPIOs backlight: Switch i2c drivers back to use .probe() backlight: lm3630a: Turn off both led strings when display is blank dt-bindings: leds: backlight: ktz8866: Add reg property and update example commit c156d4af4354091c38a1cbef62c0b1574e8c4394 Merge: b8ec70ab66b09 877e91191ccf0 Author: Linus Torvalds Date: Mon Jul 3 11:26:05 2023 -0700 Merge tag 'leds-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds Pull LED updates from Lee Jones: "New Drivers: - Add support for Intel Cherry Trail Whiskey Cove PMIC LEDs - Add support for Awinic AW20036/AW20054/AW20072 LEDs New Device Support: - Add support for PMI632 LPG to QCom LPG - Add support for PMI8998 to QCom Flash - Add support for MT6331, WLEDs and MT6332 to Mediatek MT6323 PMIC New Functionality: - Implement the LP55xx Charge Pump - Add support for suspend / resume to Intel Cherry Trail Whiskey Cove PMIC - Add support for breathing mode to Intel Cherry Trail Whiskey Cove PMIC - Enable per-pin resolution Pinctrl in LEDs GPIO Fix-ups: - Allow thread to sleep by switching from spinlock to mutex - Add lots of Device Tree bindings / support - Adapt relationships / dependencies driven by Kconfig - Switch I2C drivers from .probe_new() to .probe() - Remove superfluous / duplicate code - Replace strlcpy() with strscpy() for efficiency and overflow prevention - Staticify various functions - Trivial: Fixing coding style - Simplify / reduce code Bug Fixes: - Prevent NETDEV_LED_MODE_LINKUP from being cleared on rename - Repair race between led_set_brightness(LED_{OFF,FULL}) - Fix Oops relating to sleeping in critical sections - Clear LED_INIT_DEFAULT_TRIGGER flag when clearing the current trigger - Do not leak resources in error handling paths - Fix unsigned comparison which can never be negative - Provide missing NULL terminating entries in tables - Fix misnaming issues" * tag 'leds-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (53 commits) leds: leds-mt6323: Adjust return/parameter types in wled get/set callbacks leds: sgm3140: Add richtek,rt5033-led compatible dt-bindings: leds: sgm3140: Document richtek,rt5033 compatible dt-bindings: backlight: kinetic,ktz8866: Add missing type for "current-num-sinks" dt-bindings: leds: Drop unneeded quotes leds: Fix config reference for AW200xx driver leds: leds-mt6323: Add support for WLEDs and MT6332 leds: leds-mt6323: Add support for MT6331 leds leds: leds-mt6323: Open code and drop MT6323_CAL_HW_DUTY macro leds: leds-mt6323: Drop MT6323_ prefix from macros and defines leds: leds-mt6323: Specify registers and specs in platform data dt-bindings: leds: leds-mt6323: Document mt6332 compatible dt-bindings: leds: leds-mt6323: Document mt6331 compatible leds: simatic-ipc-leds-gpio: Introduce more Kconfig switches leds: simatic-ipc-leds-gpio: Split up into multiple drivers leds: simatic-ipc-leds-gpio: Move two extra gpio pins into another table leds: simatic-ipc-leds-gpio: Add terminating entries to gpio tables leds: flash: leds-qcom-flash: Fix an unsigned comparison which can never be negative leds: cht-wcove: Remove unneeded semicolon leds: cht-wcove: Fix an unsigned comparison which can never be negative ... commit b8ec70ab66b09ee9e081a38b8625b5accb388176 Merge: 99bdeae21d254 b05740d71bd2f Author: Linus Torvalds Date: Mon Jul 3 10:55:04 2023 -0700 Merge tag 'mfd-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Drivers: - Add support for TI TPS6594/TPS6593/LP8764 PMICs - Add support for Samsung RT5033 Battery Charger - Add support for Analog Devices MAX77540 and MAX77541 PMICs New Device Support: - Add support for SPI to Rockchip RK808 (and friends) - Add support for AXP192 PMIC to X-Powers AXP20X - Add support for AXP313a PMIC to X-Powers AXP20X - Add support for RK806 to Rockchip RK8XX Removed Device Support: - Removed MFD support for Richtek RT5033 Battery Fix-ups: - Remove superfluous code - Switch I2C drivers from .probe_new() to .probe() - Convert over to managed resources (devm_*(), etc) - Use dev_err_probe() for returning errors from .probe() - Add lots of Device Tree bindings / support - Improve cache efficiency by switching to Maple - Use own exported namespaces (NS) - Include missing and remove superfluous headers - Start using / convert to the new shutdown sys-off API - Trivial: variable / define renaming - Make use of of_property_read_reg() when requesting DT 'reg's Bug Fixes: - Fix chip revision readout due to incorrect data masking - Amend incorrect register and mask values used for charger state - Hide unused functionality at compile time - Fix resource leaks following error handling routines - Return correct error values and fix error handling in general - Repair incorrect device names - used for device matching - Remedy broken module auto-loading" * tag 'mfd-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (51 commits) dt-bindings: mfd: max77541: Add ADI MAX77541/MAX77540 iio: adc: max77541: Add ADI MAX77541 ADC Support regulator: max77541: Add ADI MAX77541/MAX77540 Regulator Support dt-bindings: regulator: max77541: Add ADI MAX77541/MAX77540 Regulator mfd: Switch two more drivers back to use struct i2c_driver::probe dt-bindings: mfd: samsung,s5m8767: Simplify excluding properties mfd: stmpe: Only disable the regulators if they are enabled mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support dt-bindings: mfd: gateworks-gsc: Remove unnecessary fan-controller nodes mfd: core: Use of_property_read_reg() to parse "reg" mfd: stmfx: Nullify stmfx->vdd in case of error mfd: stmfx: Fix error path in stmfx_chip_init mfd: intel-lpss: Add missing check for platform_get_resource mfd: stpmic1: Add PMIC poweroff via sys-off handler mfd: stpmic1: Fixup main control register and bits naming dt-bindings: mfd: qcom,tcsr: Add the compatible for IPQ8074 mfd: tps65219: Add support for soft shutdown via sys-off API mfd: pm8008: Drop bogus i2c module alias mfd: pm8008: Fix module autoloading mfd: tps65219: Add GPIO cell instance ... commit 99bdeae21d254056a1072cb6de19e6f9b7f52496 Merge: b349de4c91e6a 1b712f18c461b Author: Linus Torvalds Date: Mon Jul 3 10:47:21 2023 -0700 Merge tag 'mailbox-v6.5' of git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox updates from Jassi Brar: - tegra: support for Tegra264 - broadcom: convert bcm2835 bindings from txt to yaml bcm2835 - qcom: support for IPQ5018 - ti: always zero TX data fields * tag 'mailbox-v6.5' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 mailbox: tegra: add support for Tegra264 dt-bindings: mailbox: tegra: Document Tegra264 HSP dt-bindings: mailbox: convert bcm2835-mbox bindings to YAML dt-bindings: mailbox: qcom: Add IPQ5018 APCS compatible commit b349de4c91e6ad761c2beecc796615bcb64b36e6 Merge: a74195876b95f 1b733a9ebc3d8 Author: Linus Torvalds Date: Mon Jul 3 10:43:10 2023 -0700 Merge tag 'rtc-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "The isl1208 dirver was reworked tobe able to work as part of an MFD. All the Loongson chips are now supported through a new driver, the old one is removed. Summary: Subsystem: - Switch i2c drivers back to use .probe() - Constify pointers to hwmon_channel_info New driver: - Loongson on chip RTC, replacing the Loongson 1 only driver Drivers: - isl1208: cleanup and support for RAA215300 - st-lpc: cleanups - stm32: fix wakeup" * tag 'rtc-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (21 commits) rtc: Add rtc driver for the Loongson family chips rtc: Remove the Loongson-1 RTC driver dt-bindings: rtc: Split loongson,ls2x-rtc into SoC-based compatibles rtc: rv3028: make rv3028 probeable from userspace rtc: isl1208: Add support for the built-in RTC on the PMIC RAA215300 rtc: isl1208: Add isl1208_set_xtoscb() rtc: isl1208: Drop enum isl1208_id and split isl1208_configs[] rtc: isl1208: Make similar I2C and DT-based matching table rtc: isl1208: Drop name variable dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties dt-bindings: rtc: isl1208: Convert to json-schema rtc: st-lpc: Simplify clk handling in st_rtc_probe() rtc: st-lpc: Release some resources in st_rtc_probe() in case of error rtc: stm32: remove dedicated wakeup management dt-bindings: rtc: restrict node name suffixes rtc: add HAS_IOPORT dependencies rtc: Switch i2c drivers back to use .probe() rtc: rv3032: constify pointers to hwmon_channel_info rtc: isl12022: constify pointers to hwmon_channel_info rtc: ds3232: constify pointers to hwmon_channel_info ... commit a74195876b95fce5f1c5b051b8c3b01e1b18a83b Merge: ae80b40419843 49b472ebc61de Author: Linus Torvalds Date: Mon Jul 3 10:33:23 2023 -0700 Merge tag 'i3c/for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull i3c updates from Alexandre Belloni: - svc: fix suspend/resume on some platforms, fix locking issues * tag 'i3c/for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: master: svc: add NACK check after start byte sent i3c: master: svc: fix cpu schedule in spin lock i3c: master: svc: fix i3c suspend/resume issue commit ae80b404198434e49e903dc3b1ba83e2c7bb3ee2 Author: Linus Torvalds Date: Mon Jul 3 10:08:50 2023 -0700 mm: validate the mm before dropping the mmap lock Commit 408579cd627a ("mm: Update do_vmi_align_munmap() return semantics") made the return value and locking semantics of do_vmi_align_munmap() more straightforward, but in the process it ended up unlocking the mmap lock just a tad too early: the debug code doing the mmap layout validation still needs to run with the lock held, or things might change under it while it's trying to validate things. So just move the unlocking to after the validate_mm() call. Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/ZKIsoMOT71uwCIZX@xsang-OptiPlex-9020/ Fixes: 408579cd627a ("mm: Update do_vmi_align_munmap() return semantics") Signed-off-by: Linus Torvalds commit f8a473bf5db7a6abaa7cad40303e395dff702819 Author: Helge Deller Date: Mon Jul 3 18:43:13 2023 +0200 parisc: syscalls: Avoid compiler warnings with W=1 We do not want to add prototypes for all parisc specific syscalls, so simply drop such warnings when building the kernel. Signed-off-by: Helge Deller commit de53f3f7a9ffb8a24c3382aa41e24666c28f0368 Author: Helge Deller Date: Mon Jul 3 18:38:02 2023 +0200 parisc: math-emu: Avoid compiler warnings with W=1 The math-emu code is a snapshot from the HP-UX kernel. They've been modified as little as possible. See arch/parisc/math-emu/README. Signed-off-by: Helge Deller commit 28e113f89f33e0f1566045d2adc017e16a9bffb4 Author: Helge Deller Date: Mon Jul 3 16:02:04 2023 +0200 parisc: Raise minimal GCC version to 12.0.0 Raise the minimum gcc version for parisc64 to 12.0.0 (for __int128 type) and keep 5.1.0 as minimum for 32-bit parisc target. Fixes: 8664645ade97 ("parisc: Raise minimal GCC version") Signed-off-by: Helge Deller commit 6414b30b39f9d21fcd485aab6e20b7c65f4013d8 Author: Helge Deller Date: Mon Jul 3 18:23:39 2023 +0200 parisc: unwind: Avoid missing prototype warning for handle_interruption() Signed-off-by: Helge Deller commit f66066bc5136f25e36a2daff4896c768f18c211e Author: Linus Torvalds Date: Sun Jul 2 23:20:17 2023 -0700 execve: always mark stack as growing down during early stack setup While our user stacks can grow either down (all common architectures) or up (parisc and the ia64 register stack), the initial stack setup when we copy the argument and environment strings to the new stack at execve() time is always done by extending the stack downwards. But it turns out that in commit 8d7071af8907 ("mm: always expand the stack with the mmap write lock held"), as part of making the stack growing code more robust, 'expand_downwards()' was now made to actually check the vma flags: if (!(vma->vm_flags & VM_GROWSDOWN)) return -EFAULT; and that meant that this execve-time stack expansion started failing on parisc, because on that architecture, the stack flags do not contain the VM_GROWSDOWN bit. At the same time the new check in expand_downwards() is clearly correct, and simplified the callers, so let's not remove it. The solution is instead to just codify the fact that yes, during execve(), the stack grows down. This not only matches reality, it ends up being particularly simple: we already have special execve-time flags for the stack (VM_STACK_INCOMPLETE_SETUP) and use those flags to avoid page migration during this setup time (see vma_is_temporary_stack() and invalid_migration_vma()). So just add VM_GROWSDOWN to that set of temporary flags, and now our stack flags automatically match reality, and the parisc stack expansion works again. Note that the VM_STACK_INCOMPLETE_SETUP bits will be cleared when the stack is finalized, so we only add the extra VM_GROWSDOWN bit on CONFIG_STACK_GROWSUP architectures (ie parisc) rather than adding it in general. Link: https://lore.kernel.org/all/612eaa53-6904-6e16-67fc-394f4faa0e16@bell.net/ Link: https://lore.kernel.org/all/5fd98a09-4792-1433-752d-029ae3545168@gmx.de/ Fixes: 8d7071af8907 ("mm: always expand the stack with the mmap write lock held") Reported-by: John David Anglin Reported-and-tested-by: Helge Deller Reported-and-tested-by: Guenter Roeck Signed-off-by: Linus Torvalds commit 34acceaa8818a0ff4943ec5f2f8831cfa9d3fe7e Author: Yang Li Date: Mon Jul 3 09:38:50 2023 -0700 xfs: Remove unneeded semicolon ./fs/xfs/xfs_extfree_item.c:723:3-4: Unneeded semicolon Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5728 Signed-off-by: Yang Li Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2d7d1e7ea321b0b2810eb00183e21332ee9c4b6f Author: Darrick J. Wong Date: Thu Jun 29 10:15:45 2023 -0700 xfs: AGI length should be bounds checked Similar to the recent patch strengthening the AGF agf_length verification, the AGI verifier does not check that the AGI length field is within known good bounds. This isn't currently checked by runtime kernel code, yet we assume in many places that it is correct and verify other metadata against it. Add length verification to the AGI verifier. Just like the AGF length checking, the length of the AGI must be equal to the size of the AG specified in the superblock, unless it is the last AG in the filesystem. In that case, it must be less than or equal to sb->sb_agblocks and greater than XFS_MIN_AG_BLOCKS, which is the smallest AG a growfs operation will allow to exist. There's only one place in the filesystem that actually uses agi_length, but let's not leave it vulnerable to the same weird nonsense that generates syzbot bugs, eh? Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 3de4d22cc9ac7c9f38e10edcf54f9a8891a9c2aa Author: SeongJae Park Date: Sat Jul 1 17:14:47 2023 +0000 bpf, btf: Warn but return no error for NULL btf from __register_btf_kfunc_id_set() __register_btf_kfunc_id_set() assumes .BTF to be part of the module's .ko file if CONFIG_DEBUG_INFO_BTF is enabled. If that's not the case, the function prints an error message and return an error. As a result, such modules cannot be loaded. However, the section could be stripped out during a build process. It would be better to let the modules loaded, because their basic functionalities have no problem [0], though the BTF functionalities will not be supported. Make the function to lower the level of the message from error to warn, and return no error. [0] https://lore.kernel.org/bpf/20220219082037.ow2kbq5brktf4f2u@apollo.legion Fixes: c446fdacb10d ("bpf: fix register_btf_kfunc_id_set for !CONFIG_DEBUG_INFO_BTF") Reported-by: Alexander Egorenkov Suggested-by: Kumar Kartikeya Dwivedi Signed-off-by: SeongJae Park Signed-off-by: Daniel Borkmann Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/87y228q66f.fsf@oc8242746057.ibm.com Link: https://lore.kernel.org/bpf/20220219082037.ow2kbq5brktf4f2u@apollo.legion Link: https://lore.kernel.org/bpf/20230701171447.56464-1-sj@kernel.org commit 147e17e297563bce7c3acc82b41e24463d9d6a64 Author: Helge Deller Date: Mon Jul 3 18:14:39 2023 +0200 parisc: smp: Add declaration for start_cpu_itimer() Avoid gcc warning about missing prototype for start_cpu_itimer(). Signed-off-by: Helge Deller commit 954b41be640223c694b2fb163f511a372ff0c602 Author: Helge Deller Date: Mon Jul 3 18:09:24 2023 +0200 parisc: pdt: Get prototype for arch_report_meminfo() Include linux/proc_fs.h to avoid compiler warning about missing prototype for 'arch_report_meminfo' Signed-off-by: Helge Deller commit 9e396a2f434f829fb3b98a24bb8db5429320589d Author: Xianting Tian Date: Wed Jun 21 17:38:35 2023 +0800 vhost: Make parameter name match of vhost_get_vq_desc() The parameter name in the function declaration and definition should be the same. drivers/vhost/vhost.h, int vhost_get_vq_desc(..., unsigned int iov_count,...); drivers/vhost/vhost.c, int vhost_get_vq_desc(..., unsigned int iov_size,...) Signed-off-by: Xianting Tian Message-Id: <20230621093835.36878-1-xianting.tian@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin commit f06cf1e1a503169280467d12d2ec89bf2c30ace7 Author: Maxime Coquelin Date: Thu Jun 22 22:48:51 2023 +0200 vduse: fix NULL pointer dereference vduse_vdpa_set_vq_affinity callback can be called with NULL value as cpu_mask when deleting the vduse device. This patch resets virtqueue's IRQ affinity mask value to set all CPUs instead of dereferencing NULL cpu_mask. [ 4760.952149] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 4760.959110] #PF: supervisor read access in kernel mode [ 4760.964247] #PF: error_code(0x0000) - not-present page [ 4760.969385] PGD 0 P4D 0 [ 4760.971927] Oops: 0000 [#1] PREEMPT SMP PTI [ 4760.976112] CPU: 13 PID: 2346 Comm: vdpa Not tainted 6.4.0-rc6+ #4 [ 4760.982291] Hardware name: Dell Inc. PowerEdge R640/0W23H8, BIOS 2.8.1 06/26/2020 [ 4760.989769] RIP: 0010:memcpy_orig+0xc5/0x130 [ 4760.994049] Code: 16 f8 4c 89 07 4c 89 4f 08 4c 89 54 17 f0 4c 89 5c 17 f8 c3 cc cc cc cc 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 83 fa 08 72 1b <4c> 8b 06 4c 8b 4c 16 f8 4c 89 07 4c 89 4c 17 f8 c3 cc cc cc cc 66 [ 4761.012793] RSP: 0018:ffffb1d565abb830 EFLAGS: 00010246 [ 4761.018020] RAX: ffff9f4bf6b27898 RBX: ffff9f4be23969c0 RCX: ffff9f4bcadf6400 [ 4761.025152] RDX: 0000000000000008 RSI: 0000000000000000 RDI: ffff9f4bf6b27898 [ 4761.032286] RBP: 0000000000000000 R08: 0000000000000008 R09: 0000000000000000 [ 4761.039416] R10: 0000000000000000 R11: 0000000000000600 R12: 0000000000000000 [ 4761.046549] R13: 0000000000000000 R14: 0000000000000080 R15: ffffb1d565abbb10 [ 4761.053680] FS: 00007f64c2ec2740(0000) GS:ffff9f635f980000(0000) knlGS:0000000000000000 [ 4761.061765] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 4761.067513] CR2: 0000000000000000 CR3: 0000001875270006 CR4: 00000000007706e0 [ 4761.074645] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 4761.081775] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 4761.088909] PKRU: 55555554 [ 4761.091620] Call Trace: [ 4761.094074] [ 4761.096180] ? __die+0x1f/0x70 [ 4761.099238] ? page_fault_oops+0x171/0x4f0 [ 4761.103340] ? exc_page_fault+0x7b/0x180 [ 4761.107265] ? asm_exc_page_fault+0x22/0x30 [ 4761.111460] ? memcpy_orig+0xc5/0x130 [ 4761.115126] vduse_vdpa_set_vq_affinity+0x3e/0x50 [vduse] [ 4761.120533] virtnet_clean_affinity.part.0+0x3d/0x90 [virtio_net] [ 4761.126635] remove_vq_common+0x1a4/0x250 [virtio_net] [ 4761.131781] virtnet_remove+0x5d/0x70 [virtio_net] [ 4761.136580] virtio_dev_remove+0x3a/0x90 [ 4761.140509] device_release_driver_internal+0x19b/0x200 [ 4761.145742] bus_remove_device+0xc2/0x130 [ 4761.149755] device_del+0x158/0x3e0 [ 4761.153245] ? kernfs_find_ns+0x35/0xc0 [ 4761.157086] device_unregister+0x13/0x60 [ 4761.161010] unregister_virtio_device+0x11/0x20 [ 4761.165543] device_release_driver_internal+0x19b/0x200 [ 4761.170770] bus_remove_device+0xc2/0x130 [ 4761.174782] device_del+0x158/0x3e0 [ 4761.178276] ? __pfx_vdpa_name_match+0x10/0x10 [vdpa] [ 4761.183336] device_unregister+0x13/0x60 [ 4761.187260] vdpa_nl_cmd_dev_del_set_doit+0x63/0xe0 [vdpa] Fixes: 28f6288eb63d ("vduse: Support set_vq_affinity callback") Cc: xieyongji@bytedance.com Signed-off-by: Maxime Coquelin Message-Id: <20230622204851.318125-1-maxime.coquelin@redhat.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Xie Yongji commit 228a27cf78afc63a18f744a56740d26570ecaec0 Author: Mike Christie Date: Mon Jun 26 18:23:07 2023 -0500 vhost: Allow worker switching while work is queueing This patch drops the requirement that we can only switch workers if work has not been queued by using RCU for the vq based queueing paths and a mutex for the device wide flush. We can also use this to support SIGKILL properly in the future where we should exit almost immediately after getting that signal. With this patch, when get_signal returns true, we can set the vq->worker to NULL and do a synchronize_rcu to prevent new work from being queued to the vhost_task that has been killed. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-18-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit d74b55e6550225ad0a28f0faa590cc9f780ba392 Author: Mike Christie Date: Mon Jun 26 18:23:06 2023 -0500 vhost_scsi: add support for worker ioctls This has vhost-scsi support the worker ioctls by calling the vhost_worker_ioctl helper. With a single worker, the single thread becomes a bottlneck when trying to use 3 or more virtqueues like: fio --filename=/dev/sdb --direct=1 --rw=randrw --bs=4k \ --ioengine=libaio --iodepth=128 --numjobs=3 With the patches and doing a worker per vq, we can scale to at least 16 vCPUs/vqs (that's my system limit) with the same command fio command above with numjobs=16: fio --filename=/dev/sdb --direct=1 --rw=randrw --bs=4k \ --ioengine=libaio --iodepth=64 --numjobs=16 which gives around 2002K IOPs. Note that for testing I dropped depth to 64 above because the vhost/virt layer supports only 1024 total commands per device. And the only tuning I did was set LIO's emulate_pr to 0 to avoid LIO's PR lock in the main IO path which becomes an issue at around 12 jobs/virtqueues. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-17-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit c1ecd8e9500797748ae4f79657971955d452d69d Author: Mike Christie Date: Mon Jun 26 18:23:05 2023 -0500 vhost: allow userspace to create workers For vhost-scsi with 3 vqs or more and a workload that tries to use them in parallel like: fio --filename=/dev/sdb --direct=1 --rw=randrw --bs=4k \ --ioengine=libaio --iodepth=128 --numjobs=3 the single vhost worker thread will become a bottlneck and we are stuck at around 500K IOPs no matter how many jobs, virtqueues, and CPUs are used. To better utilize virtqueues and available CPUs, this patch allows userspace to create workers and bind them to vqs. You can have N workers per dev and also share N workers with M vqs on that dev. This patch adds the interface related code and the next patch will hook vhost-scsi into it. The patches do not try to hook net and vsock into the interface because: 1. multiple workers don't seem to help vsock. The problem is that with only 2 virtqueues we never fully use the existing worker when doing bidirectional tests. This seems to match vhost-scsi where we don't see the worker as a bottleneck until 3 virtqueues are used. 2. net already has a way to use multiple workers. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-16-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 1cdaafa1b8b4ef6052869c86ba2b41c0cff05957 Author: Mike Christie Date: Mon Jun 26 18:23:04 2023 -0500 vhost: replace single worker pointer with xarray The next patch allows userspace to create multiple workers per device, so this patch replaces the vhost_worker pointer with an xarray so we can store mupltiple workers and look them up. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-15-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit cef25866f41c45a01a933adb032b0dcfb25b847a Author: Mike Christie Date: Mon Jun 26 18:23:03 2023 -0500 vhost: add helper to parse userspace vring state/file The next patches add new vhost worker ioctls which will need to get a vhost_virtqueue from a userspace struct which specifies the vq's index. This moves the vhost_vring_ioctl code to do this to a helper so it can be shared. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-14-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 27eca189114235fde84980b8ee044f42c1d59519 Author: Mike Christie Date: Mon Jun 26 18:23:02 2023 -0500 vhost: remove vhost_work_queue vhost_work_queue is no longer used. Each driver is using the poll or vq based queueing, so remove vhost_work_queue. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-13-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 0a3eac5239d2ddcfef8cc5b0c40095981536db90 Author: Mike Christie Date: Mon Jun 26 18:23:01 2023 -0500 vhost_scsi: flush IO vqs then send TMF rsp With one worker we will always send the scsi cmd responses then send the TMF rsp, because LIO will always complete the scsi cmds first then call into us to send the TMF response. With multiple workers, the IO vq workers could be running while the TMF/ctl vq worker is running so this has us do a flush before completing the TMF to make sure cmds are completed when it's work is later queued and run. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-12-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 78af31cc4e147ddb8a7b0db800837ad5db3e2a58 Author: Mike Christie Date: Mon Jun 26 18:23:00 2023 -0500 vhost_scsi: convert to vhost_vq_work_queue Convert from vhost_work_queue to vhost_vq_work_queue so we can remove vhost_work_queue. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-11-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 48ae70dd4d9c448d1d628b4ccbdd1d912cc24215 Author: Mike Christie Date: Mon Jun 26 18:22:59 2023 -0500 vhost_scsi: make SCSI cmd completion per vq This patch separates the scsi cmd completion code paths so we can complete cmds based on their vq instead of having all cmds complete on the same worker/CPU. This will be useful with the next patches that allow us to create mulitple worker threads and bind them to different vqs, and we can have completions running on different threads/CPUs. Signed-off-by: Mike Christie Reviewed-by: Stefan Hajnoczi Message-Id: <20230626232307.97930-10-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 9e09d0ec2b8da6f776a1c8bc7adf6d5501d43a37 Author: Mike Christie Date: Mon Jun 26 18:22:58 2023 -0500 vhost_sock: convert to vhost_vq_work_queue Convert from vhost_work_queue to vhost_vq_work_queue, so we can drop vhost_work_queue. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-9-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 493b94bf5ae0f6d67bd3728e8c723800d99a13ad Author: Mike Christie Date: Mon Jun 26 18:22:57 2023 -0500 vhost: convert poll work to be vq based This has the drivers pass in their poll to vq mapping and then converts the core poll code to use the vq based helpers. In the next patches we will allow vqs to be handled by different workers, so to allow drivers to execute operations like queue, stop, flush, etc on specific polls/vqs we need to know the mappings. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-8-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit a6fc04739be7cd8a744658fd2734906a6a0eb400 Author: Mike Christie Date: Mon Jun 26 18:22:56 2023 -0500 vhost: take worker or vq for flushing This patch has the core work flush function take a worker. When we support multiple workers we can then flush each worker during device removal, stoppage, etc. It also adds a helper to flush specific virtqueues, so vhost-scsi can flush IO vqs from it's ctl vq. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-7-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 0921dddcb5898030f0951816ed685a958acfbde2 Author: Mike Christie Date: Mon Jun 26 18:22:55 2023 -0500 vhost: take worker or vq instead of dev for queueing This patch has the core work queueing function take a worker for when we support multiple workers. It also adds a helper that takes a vq during queueing so modules can control which vq/worker to queue work on. This temp leaves vhost_work_queue. It will be removed when the drivers are converted in the next patches. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-6-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 9784df151a601fa1d6d146f8a7f35a2d875e2976 Author: Mike Christie Date: Mon Jun 26 18:22:54 2023 -0500 vhost, vhost_net: add helper to check if vq has work In the next patches each vq might have different workers so one could have work but others do not. For net, we only want to check specific vqs, so this adds a helper to check if a vq has work pending and converts vhost-net to use it. Signed-off-by: Mike Christie Acked-by: Jason Wang Message-Id: <20230626232307.97930-5-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 737bdb643c4f488defd6c226eb40de2c8f6e3f75 Author: Mike Christie Date: Mon Jun 26 18:22:53 2023 -0500 vhost: add vhost_worker pointer to vhost_virtqueue This patchset allows userspace to map vqs to different workers. This patch adds a worker pointer to the vq so in later patches in this set we can queue/flush specific vqs and their workers. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-4-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit c011bb669ddc22b0374d747d90467d1b2f80bc05 Author: Mike Christie Date: Mon Jun 26 18:22:52 2023 -0500 vhost: dynamically allocate vhost_worker This patchset allows us to allocate multiple workers, so this has us move from the vhost_worker that's embedded in the vhost_dev to dynamically allocating it. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-3-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 3e11c6eb6ab07de36cde49594e16fed044bf276e Author: Mike Christie Date: Mon Jun 26 18:22:51 2023 -0500 vhost: create worker at end of vhost_dev_set_owner vsock can start queueing work after VHOST_VSOCK_SET_GUEST_CID, so after we have called vhost_worker_create it can be calling vhost_work_queue and trying to access the vhost worker/task. If vhost_dev_alloc_iovecs fails, then vhost_worker_free could free the worker/task from under vsock. This moves vhost_worker_create to the end of vhost_dev_set_owner where we know we can no longer fail in that path. If it fails after the VHOST_SET_OWNER and userspace closes the device, then the normal vsock release handling will do the right thing. Signed-off-by: Mike Christie Message-Id: <20230626232307.97930-2-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 3845308fc8b0bc6a9345df4f69ef56f9adc52218 Author: Xianting Tian Date: Fri Jun 9 21:18:17 2023 +0800 virtio_bt: call scheduler when we free unused buffs For virtio-net we were getting CPU stall warnings, and fixed it by calling the scheduler: see f8bb51043945 ("virtio_net: suppress cpu stall when free_unused_bufs"). This driver is similar so theoretically the same logic applies. Signed-off-by: Xianting Tian Message-Id: <20230609131817.712867-4-xianting.tian@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin commit 56b5e65efe0001fb5f95e412ee4167363debfc46 Author: Xianting Tian Date: Fri Jun 9 21:18:16 2023 +0800 virtio-console: call scheduler when we free unused buffs For virtio-net we were getting CPU stall warnings, and fixed it by calling the scheduler: see f8bb51043945 ("virtio_net: suppress cpu stall when free_unused_bufs"). This driver is similar so theoretically the same logic applies. Signed-off-by: Xianting Tian Message-Id: <20230609131817.712867-3-xianting.tian@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin commit 7a5103b81a9628b6b66fc710d9ccdd2f2d27a58c Author: Xianting Tian Date: Fri Jun 9 21:18:15 2023 +0800 virtio-crypto: call scheduler when we free unused buffs For virtio-net we were getting CPU stall warnings, and fixed it by calling the scheduler: see f8bb51043945 ("virtio_net: suppress cpu stall when free_unused_bufs"). This driver is similar so theoretically the same logic applies. Signed-off-by: Xianting Tian Message-Id: <20230609131817.712867-2-xianting.tian@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin commit 4cf8b6d051d955ff044ae61552ab0f7f91aad6b9 Author: Zhu Lingshan Date: Mon Jun 12 23:14:20 2023 +0800 vDPA/ifcvf: implement new accessors for vq_state This commit implements a better layout of the live migration bar, therefore the accessors for virtqueue state have been refactored. This commit also add a comment to the probing-ids list, indicating this driver drives F2000X-PL virtio-net Signed-off-by: Zhu Lingshan Message-Id: <20230612151420.1019504-4-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit ae904d9ce2cf8fec34cee72a67fcbee7640dd70f Author: Zhu Lingshan Date: Mon Jun 12 23:14:19 2023 +0800 vDPA/ifcvf: detect and report max allowed vq size Rather than a hardcode, this commit detects and reports the max value of allowed size of the virtqueues Signed-off-by: Zhu Lingshan Message-Id: <20230612151420.1019504-3-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit 7712832201eadb871c15ed96be1ec60d1e3ecacf Author: Zhu Lingshan Date: Mon Jun 12 23:14:18 2023 +0800 vDPA/ifcvf: dynamic allocate vq data stores This commit dynamically allocates the data stores for the virtqueues based on virtio_pci_common_cfg.num_queues. Signed-off-by: Zhu Lingshan Message-Id: <20230612151420.1019504-2-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit b45d8f3871574999002b79d551cac51a20bcfae6 Author: Jakub Kicinski Date: Fri Jun 30 10:15:50 2023 -0700 docs: remove the tips on how to submit patches from MAINTAINERS Having "how to submit patches" in MAINTAINTERS seems out of place. We have a whole section of documentation about it, duplication is harmful and a lot of the text looks really out of date. Sections 1, 2 and 4 look really, really old and not applicable to the modern process. Section 3 is obvious but also we have build bots now. Section 5 is a bit outdated (diff -u?!). But I like the part about factoring out shared code, so add that to process docs. Section 6 is unnecessary? Section 7 is covered by more appropriate docs. Signed-off-by: Jakub Kicinski Reviewed-by: Randy Dunlap Reviewed-by: Dan Williams Reviewed-by: Kees Cook Signed-off-by: Jonathan Corbet Message-ID: <20230630171550.128296-1-kuba@kernel.org> commit c398488dab7d731f942da9f34981b536fe187e3f Author: Xueshi Hu Date: Mon Jul 3 18:20:44 2023 +0800 docs: fix typo in zh_TW and zh_CN translation In zh_TW and zh_CN translation, "http://lwn.net/Articles" is incorrectly written as "http://lwn.net/Articles". This patch is generated by the following script: rg -l "lwn.net/Articles" | xargs sed -i 's/lwn.net\/articles/lwn.net\/Articles/g' Signed-off-by: Xueshi Hu Signed-off-by: Jonathan Corbet Message-ID: commit 531b3d1195d096f14e030c4b01ec3a53b80276bf Author: Huacai Chen Date: Wed Jun 28 19:08:47 2023 +0800 MIPS: Loongson: Fix build error when make modules_install After commit 0e96ea5c3eb5904e5dc2f ("MIPS: Loongson64: Clean up use of cc-ifversion") we get a build error when make modules_install: cc1: error: '-mloongson-mmi' must be used with '-mhard-float' The reason is when make modules_install, 'call cc-option' doesn't work in $(KBUILD_CFLAGS) of 'CHECKFLAGS'. Then there is no -mno-loongson-mmi applied and -march=loongson3a enable MMI instructions. To be detail, the error message comes from the CHECKFLAGS invocation of $(CC) but it has no impact on the final result of make modules_install, it is purely a cosmetic issue. The error occurs because cc-option is defined in scripts/Makefile.compiler, which is not included in Makefile when running 'make modules_install', as install targets are not supposed to require the compiler; see commit 805b2e1d427aab4b ("kbuild: include Makefile.compiler only when compiler is needed"). As a result, the call to check for '-mno-loongson-mmi' just never happens. Fix this by partially reverting to the old logic, use 'call cc-option' to conditionally apply -march=loongson3a and -march=mips64r2. By the way, Loongson-2E/2F is also broken in commit 13ceb48bc19c563e05f4 ("MIPS: Loongson2ef: Remove unnecessary {as,cc}-option calls") so fix it together. Fixes: 13ceb48bc19c563e05f4 ("MIPS: Loongson2ef: Remove unnecessary {as,cc}-option calls") Fixes: 0e96ea5c3eb5904e5dc2 ("MIPS: Loongson64: Clean up use of cc-ifversion") Cc: stable@vger.kernel.org Cc: Feiyang Chen Cc: Nathan Chancellor Cc: Nick Desaulniers Signed-off-by: Huacai Chen Reviewed-by: Nathan Chancellor Signed-off-by: Thomas Bogendoerfer commit e4de2057698636c0ee709e545d19b169d2069fa3 Author: Huacai Chen Date: Wed Jun 28 19:08:17 2023 +0800 MIPS: KVM: Fix NULL pointer dereference After commit 45c7e8af4a5e3f0bea4ac209 ("MIPS: Remove KVM_TE support") we get a NULL pointer dereference when creating a KVM guest: [ 146.243409] Starting KVM with MIPS VZ extensions [ 149.849151] CPU 3 Unable to handle kernel paging request at virtual address 0000000000000300, epc == ffffffffc06356ec, ra == ffffffffc063568c [ 149.849177] Oops[#1]: [ 149.849182] CPU: 3 PID: 2265 Comm: qemu-system-mip Not tainted 6.4.0-rc3+ #1671 [ 149.849188] Hardware name: THTF CX TL630 Series/THTF-LS3A4000-7A1000-ML4A, BIOS KL4.1F.TF.D.166.201225.R 12/25/2020 [ 149.849192] $ 0 : 0000000000000000 000000007400cce0 0000000000400004 ffffffff8119c740 [ 149.849209] $ 4 : 000000007400cce1 000000007400cce1 0000000000000000 0000000000000000 [ 149.849221] $ 8 : 000000240058bb36 ffffffff81421ac0 0000000000000000 0000000000400dc0 [ 149.849233] $12 : 9800000102a07cc8 ffffffff80e40e38 0000000000000001 0000000000400dc0 [ 149.849245] $16 : 0000000000000000 9800000106cd0000 9800000106cd0000 9800000100cce000 [ 149.849257] $20 : ffffffffc0632b28 ffffffffc05b31b0 9800000100ccca00 0000000000400000 [ 149.849269] $24 : 9800000106cd09ce ffffffff802f69d0 [ 149.849281] $28 : 9800000102a04000 9800000102a07cd0 98000001106a8000 ffffffffc063568c [ 149.849293] Hi : 00000335b2111e66 [ 149.849295] Lo : 6668d90061ae0ae9 [ 149.849298] epc : ffffffffc06356ec kvm_vz_vcpu_setup+0xc4/0x328 [kvm] [ 149.849324] ra : ffffffffc063568c kvm_vz_vcpu_setup+0x64/0x328 [kvm] [ 149.849336] Status: 7400cce3 KX SX UX KERNEL EXL IE [ 149.849351] Cause : 1000000c (ExcCode 03) [ 149.849354] BadVA : 0000000000000300 [ 149.849357] PrId : 0014c004 (ICT Loongson-3) [ 149.849360] Modules linked in: kvm nfnetlink_queue nfnetlink_log nfnetlink fuse sha256_generic libsha256 cfg80211 rfkill binfmt_misc vfat fat snd_hda_codec_hdmi input_leds led_class snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hda_core snd_pcm snd_timer snd serio_raw xhci_pci radeon drm_suballoc_helper drm_display_helper xhci_hcd ip_tables x_tables [ 149.849432] Process qemu-system-mip (pid: 2265, threadinfo=00000000ae2982d2, task=0000000038e09ad4, tls=000000ffeba16030) [ 149.849439] Stack : 9800000000000003 9800000100ccca00 9800000100ccc000 ffffffffc062cef4 [ 149.849453] 9800000102a07d18 c89b63a7ab338e00 0000000000000000 ffffffff811a0000 [ 149.849465] 0000000000000000 9800000106cd0000 ffffffff80e59938 98000001106a8920 [ 149.849476] ffffffff80e57f30 ffffffffc062854c ffffffff811a0000 9800000102bf4240 [ 149.849488] ffffffffc05b0000 ffffffff80e3a798 000000ff78000000 000000ff78000010 [ 149.849500] 0000000000000255 98000001021f7de0 98000001023f0078 ffffffff81434000 [ 149.849511] 0000000000000000 0000000000000000 9800000102ae0000 980000025e92ae28 [ 149.849523] 0000000000000000 c89b63a7ab338e00 0000000000000001 ffffffff8119dce0 [ 149.849535] 000000ff78000010 ffffffff804f3d3c 9800000102a07eb0 0000000000000255 [ 149.849546] 0000000000000000 ffffffff8049460c 000000ff78000010 0000000000000255 [ 149.849558] ... [ 149.849565] Call Trace: [ 149.849567] [] kvm_vz_vcpu_setup+0xc4/0x328 [kvm] [ 149.849586] [] kvm_arch_vcpu_create+0x184/0x228 [kvm] [ 149.849605] [] kvm_vm_ioctl+0x64c/0xf28 [kvm] [ 149.849623] [] sys_ioctl+0xc8/0x118 [ 149.849631] [] syscall_common+0x34/0x58 The root cause is the deletion of kvm_mips_commpage_init() leaves vcpu ->arch.cop0 NULL. So fix it by making cop0 from a pointer to an embedded object. Fixes: 45c7e8af4a5e3f0bea4ac209 ("MIPS: Remove KVM_TE support") Cc: stable@vger.kernel.org Reported-by: Yu Zhao Suggested-by: Thomas Bogendoerfer Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 65fee014dc41a774bcd94896f3fb380bc39d8dda Author: Huacai Chen Date: Mon Jun 26 15:50:14 2023 +0800 MIPS: Loongson: Fix cpu_probe_loongson() again Commit 7db5e9e9e5e6c10d7d ("MIPS: loongson64: fix FTLB configuration") move decode_configs() from the beginning of cpu_probe_loongson() to the end in order to fix FTLB configuration. However, it breaks the CPUCFG decoding because decode_configs() use "c->options = xxxx" rather than "c->options |= xxxx", all information get from CPUCFG by decode_cpucfg() is lost. This causes error when creating a KVM guest on Loongson-3A4000: Exception Code: 4 not handled @ PC: 0000000087ad5981, inst: 0xcb7a1898 BadVaddr: 0x0 Status: 0x0 Fix this by moving the c->cputype setting to the beginning and moving decode_configs() after that. Fixes: 7db5e9e9e5e6c10d7d ("MIPS: loongson64: fix FTLB configuration") Cc: stable@vger.kernel.org Cc: Huang Pei Signed-off-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 7fb7998b599a2e1f3744fbd34a3e7145da841ed1 Author: Christian Brauner Date: Mon Jun 26 12:23:36 2023 +0200 ovl: move all parameter handling into params.{c,h} While initially I thought that we couldn't move all new mount api handling into params.{c,h} it turns out it is possible. So this just moves a good chunk of code out of super.c and into params.{c,h}. Signed-off-by: Christian Brauner Signed-off-by: Amir Goldstein commit bd55842ed998a622ba6611fe59b3358c9f76773d Author: Takashi Iwai Date: Mon Jul 3 13:24:30 2023 +0200 ALSA: pcm: Fix potential data race at PCM memory allocation helpers The PCM memory allocation helpers have a sanity check against too many buffer allocations. However, the check is performed without a proper lock and the allocation isn't serialized; this allows user to allocate more memories than predefined max size. Practically seen, this isn't really a big problem, as it's more or less some "soft limit" as a sanity check, and it's not possible to allocate unlimitedly. But it's still better to address this for more consistent behavior. The patch covers the size check in do_alloc_pages() with the card->memory_mutex, and increases the allocated size there for preventing the further overflow. When the actual allocation fails, the size is decreased accordingly. Reported-by: BassCheck Reported-by: Tuo Li Link: https://lore.kernel.org/r/CADm8Tek6t0WedK+3Y6rbE5YEt19tML8BUL45N2ji4ZAz1KcN_A@mail.gmail.com Reviewed-by: Jaroslav Kysela Cc: Link: https://lore.kernel.org/r/20230703112430.30634-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit e1ef683c86d248e785499779156d9885fd4e85fc Author: Geert Uytterhoeven Date: Mon Jul 3 11:05:30 2023 +0200 spi: rzv2m-csi: Fix SoC product name The SoC product name is "RZ/V2M". Signed-off-by: Geert Uytterhoeven Reviewed-by: Fabrizio Castro Link: https://lore.kernel.org/r/89e9870a2c510387e4d7a863025f4d3639d4a261.1688375020.git.geert+renesas@glider.be Signed-off-by: Mark Brown commit 6f49256897083848ce9a59651f6b53fc80462397 Author: Johan Hovold Date: Sat Jul 1 11:47:23 2023 +0200 ASoC: codecs: wcd938x: fix soundwire initialisation race Make sure that the soundwire device used for register accesses has been enumerated and initialised before trying to read the codec variant during component probe. This specifically avoids interpreting (a masked and shifted) -EBUSY errno as the variant: wcd938x_codec audio-codec: ASoC: error at soc_component_read_no_lock on audio-codec for register: [0x000034b0] -16 in case the soundwire device has not yet been initialised, which in turn prevents some headphone controls from being registered. Fixes: 8d78602aa87a ("ASoC: codecs: wcd938x: add basic driver") Cc: stable@vger.kernel.org # 5.14 Cc: Srinivas Kandagatla Reported-by: Steev Klimaszewski Signed-off-by: Johan Hovold Tested-by: Steev Klimaszewski Link: https://lore.kernel.org/r/20230701094723.29379-1-johan+linaro@kernel.org Signed-off-by: Mark Brown commit f781f661e8c99b0cb34129f2e374234d61864e77 Author: Christian König Date: Tue Jun 13 10:09:20 2023 +0200 dma-buf: keep the signaling time of merged fences v3 Some Android CTS is testing if the signaling time keeps consistent during merges. v2: use the current time if the fence is still in the signaling path and the timestamp not yet available. v3: improve comment, fix one more case to use the correct timestamp Signed-off-by: Christian König Reviewed-by: Luben Tuikov Link: https://patchwork.freedesktop.org/patch/msgid/20230630120041.109216-1-christian.koenig@amd.com commit efccd4e0f3ab6d97dcb097d1ae4cf022b6487aa3 Author: Sven Schnelle Date: Thu Jun 29 08:59:43 2023 +0200 s390/entry: remove mcck clock In the past machine checks where accounted as irq time. With the conversion to generic entry, it was decided to account machine checks to the current context. The stckf at the beginning of the machine check handler and the lowcore member is no longer required, therefore remove it. Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit cada938a01586fc144902919e133354b1459db04 Author: Heiko Carstens Date: Wed Jun 28 16:23:20 2023 +0200 s390: fix various typos Fix various typos found with codespell. Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 2b70a11955366b0732fbb63562458c316e01384a Author: Harald Freudenberger Date: Wed Jun 21 16:40:41 2023 +0200 s390/zcrypt: remove ZCRYPT_MULTIDEVNODES kernel config option Remove ZCRYPT_MULTIDEVNODES kernel config option and make the dependent code always build. The last years showed, that this option is enabled on all distros and exploited by some features (for example CEX plugin for kubernetes). So remove this choice as it was never used to switch off the multiple devices support for the zcrypt device driver. Signed-off-by: Harald Freudenberger Reviewed-by: Holger Dengler Signed-off-by: Alexander Gordeev commit af40322e90d4e0093569eceb7d3a28ab635f3e75 Author: Harald Freudenberger Date: Mon Jun 12 11:13:39 2023 +0200 s390/zcrypt: do not retry administrative requests All kind of administrative requests should not been retried. Some card firmware detects this and assumes a replay attack. This patch checks on failure if the low level functions indicate a retry (EAGAIN) and checks for the ADMIN flag set on the request message. If this both are true, the response code for this message is changed to EIO to make sure the zcrypt API layer does not attempt to retry the request. As of now the ADMIN flag is set for a request message when - for EP11 the field 'flags' of the EP11 CPRB struct has the leftmost bit set. - for CCA when the CPRB minor version is 'T3', 'T5', 'T6' or 'T7'. Please note that the do-not-retry only applies to a request which has been sent to the card (= has been successfully enqueued) but the reply indicates some kind of failure and by default it would be replied. It is totally fine to retry a request if a previous attempt to enqueue the msg into the firmware queue had some kind of failure and thus the card has never seen this request. Reported-by: Frank Uhlig Signed-off-by: Harald Freudenberger Reviewed-by: Holger Dengler Cc: stable@vger.kernel.org Signed-off-by: Alexander Gordeev commit 0fdcc88bb93f8200386d5d3015115b747d3391ae Author: Harald Freudenberger Date: Mon Jun 19 16:55:07 2023 +0200 s390/zcrypt: cleanup some debug code This patch removes most of the debug code which is build in when CONFIG_ZCRYPT_DEBUG is enabled. There is no real exploiter for this code any more and at least one ioctl fails with this code enabled. The CONFIG_ZCRYPT_DEBUG kernel config option still makes sense as some debug sysfs entries can get enabled with this and maybe long term a new better designed debug and error injection way will get introduced. This patch only removes code surrounded by the named kernel config option. This option should by default always be off anyway. The structs and defines removed by the patch have been used only by code surrounded by a CONFIG_ZCRYPT_DEBUG ifdef and thus can be removed also. In the end this patch removes all the failure-injection possibilities which had been available when the kernel had been build with CONFIG_ZCRYPT_DEBUG. It has never been used that much and was too unflexible anyway. Signed-off-by: Harald Freudenberger Reviewed-by: Holger Dengler Signed-off-by: Alexander Gordeev commit edbe28989847308406101256e10fdfb567ca9eb1 Author: Alexander Gordeev Date: Tue Apr 18 17:40:37 2023 +0200 s390/entry: rework entering DAT-on mode on CPU restart Instead of enforcing PSW_MASK_DAT bit on previously stored in lowcore restart_psw.mask use the PSW_KERNEL_BITS mask (which contains PSW_MASK_DAT) directly. As result, the PSW mask stored in lowcore is only used to enter the CPU restart routine, while PSW_KERNEL_BITS is used to enter the kernel code - similarily to commit 64ea2977add2 ("s390/mm: start kernel with DAT enabled"). Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit b492425c7073c308503eea9a1eec4b03d6e42ef0 Author: Alexander Gordeev Date: Thu Oct 29 15:29:23 2020 +0100 s390/mm: fence off VM macros from asm and linker Prevent assembler and linker scripts compilation errors by fencing it off with __ASSEMBLY__ define. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit b378a982614360686f45c3e6b63fd5d1acd02d08 Author: Heiko Carstens Date: Thu Jun 22 10:46:32 2023 +0200 s390: include linux/io.h instead of asm/io.h Include linux/io.h instead of asm/io.h everywhere. linux/io.h includes asm/io.h, so this shouldn't cause any problems. Instead this might help for some randconfig build errors which were reported due to some undefined io related functions. Also move the changed include so it stays grouped together with other includes from the same directory. For ctcm_mpc.c also remove not needed comments (actually questions). Acked-by: Christian Borntraeger Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit b8af5999779d1225c82fcc960223625b279f5f0d Author: Heiko Carstens Date: Wed Jun 21 13:35:43 2023 +0200 s390/ptrace: make all psw related defines also available for asm Use the _AC() macro to make all psw related defines also available for assembler files. Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 6376402841e1fa6f1c5b7604abc9c746a84c715a Author: Heiko Carstens Date: Wed Jun 21 13:35:42 2023 +0200 s390/ptrace: remove PSW_DEFAULT_KEY from uapi Move PSW_DEFAULT_KEY from uapi/asm/ptrace.h to asm/ptrace.h. This is possible, since it depends on PAGE_DEFAULT_ACC which is not part of uapi. Or in other words: this define cannot be used without error. Therefore remove it from uapi. Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit d1e0e61d617ba17aa516db707aa871387566bbf7 Author: Lin Ma Date: Fri Jun 30 16:19:11 2023 +0800 net: xfrm: Amend XFRMA_SEC_CTX nla_policy structure According to all consumers code of attrs[XFRMA_SEC_CTX], like * verify_sec_ctx_len(), convert to xfrm_user_sec_ctx* * xfrm_state_construct(), call security_xfrm_state_alloc whose prototype is int security_xfrm_state_alloc(.., struct xfrm_user_sec_ctx *sec_ctx); * copy_from_user_sec_ctx(), convert to xfrm_user_sec_ctx * ... It seems that the expected parsing result for XFRMA_SEC_CTX should be structure xfrm_user_sec_ctx, and the current xfrm_sec_ctx is confusing and misleading (Luckily, they happen to have same size 8 bytes). This commit amend the policy structure to xfrm_user_sec_ctx to avoid ambiguity. Fixes: cf5cb79f6946 ("[XFRM] netlink: Establish an attribute policy") Signed-off-by: Lin Ma Signed-off-by: Steffen Klassert commit b6464883f45ae6412de33e53587974fd86ba811e Author: Daniel Thompson Date: Fri Jun 30 21:12:06 2023 +0100 kdb: move kdb_send_sig() declaration to a better header file kdb_send_sig() is defined in the signal code and called from kdb, but the declaration is part of the kdb internal code. Move the declaration to the shared header to avoid the warning: kernel/signal.c:4789:6: error: no previous prototype for 'kdb_send_sig' [-Werror=missing-prototypes] Reported-by: Arnd Bergmann Closes: https://lore.kernel.org/lkml/20230517125423.930967-1-arnd@kernel.org/ Signed-off-by: Daniel Thompson Link: https://lore.kernel.org/r/20230630201206.2396930-1-daniel.thompson@linaro.org commit acd9755894c96c27078b52e0bfd894e48b0b1508 Author: Subash Abhinov Kasiviswanathan Date: Fri Jun 30 01:20:20 2023 -0600 Documentation: ABI: sysfs-class-net-qmi: pass_through contact update Switch to the quicinc.com id. Fixes: bd1af6b5fffd ("Documentation: ABI: sysfs-class-net-qmi: document pass-through file") Signed-off-by: Subash Abhinov Kasiviswanathan Signed-off-by: David S. Miller commit 998127cdb4699b9d470a9348ffe9f1154346be5f Author: Eric Dumazet Date: Thu Jun 29 16:41:50 2023 +0000 tcp: annotate data races in __tcp_oow_rate_limited() request sockets are lockless, __tcp_oow_rate_limited() could be called on the same object from different cpus. This is harmless. Add READ_ONCE()/WRITE_ONCE() annotations to avoid a KCSAN report. Fixes: 4ce7e93cb3fe ("tcp: rate limit ACK sent by SYN_RECV request sockets") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit c94683ed35ec33775e982af45a54723b7ab05851 Merge: a27ac53909220 326534e837c73 Author: David S. Miller Date: Mon Jul 3 09:17:52 2023 +0100 Merge branch 'wireguard-fixes' Jason A. Donenfeld says: ==================== wireguard fixes for 6.4.2/6.5-rc1 Sorry to send these patches during the merge window, but they're net fixes, not netdev enhancements, and while I'd ordinarily wait anyway, I just got a first bug report for one of these fixes, which I originally had thought was mostly unlikely. So please apply the following three patches to net: 1) Make proper use of nr_cpu_ids with cpumask_next(), rather than awkwardly using modulo, to handle dynamic CPU topology changes. Linus noticed this a while ago and pointed it out, and today a user actually got hit by it. 2) Respect persistent keepalive and other staged packets when setting the private key after the interface is already up. 3) Use timer_delete_sync() instead of del_timer_sync(), per the documentation. ==================== Signed-off-by: David S. Miller commit 326534e837c731496bdf0e02a8a61e987eb3bed0 Author: Jason A. Donenfeld Date: Mon Jul 3 03:27:06 2023 +0200 wireguard: timers: move to using timer_delete_sync The documentation says that del_timer_sync is obsolete, and code should use the equivalent timer_delete_sync instead, so switch to it. Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit f58d0a9b4c6a7a5199c3af967e43cc8b654604d4 Author: Jason A. Donenfeld Date: Mon Jul 3 03:27:05 2023 +0200 wireguard: netlink: send staged packets when setting initial private key Packets bound for peers can queue up prior to the device private key being set. For example, if persistent keepalive is set, a packet is queued up to be sent as soon as the device comes up. However, if the private key hasn't been set yet, the handshake message never sends, and no timer is armed to retry, since that would be pointless. But, if a user later sets a private key, the expectation is that those queued packets, such as a persistent keepalive, are actually sent. So adjust the configuration logic to account for this edge case, and add a test case to make sure this works. Maxim noticed this with a wg-quick(8) config to the tune of: [Interface] PostUp = wg set %i private-key somefile [Peer] PublicKey = ... Endpoint = ... PersistentKeepalive = 25 Here, the private key gets set after the device comes up using a PostUp script, triggering the bug. Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Cc: stable@vger.kernel.org Reported-by: Maxim Cournoyer Tested-by: Maxim Cournoyer Link: https://lore.kernel.org/wireguard/87fs7xtqrv.fsf@gmail.com/ Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit 7387943fa35516f6f8017a3b0e9ce48a3bef9faa Author: Jason A. Donenfeld Date: Mon Jul 3 03:27:04 2023 +0200 wireguard: queueing: use saner cpu selection wrapping Using `% nr_cpumask_bits` is slow and complicated, and not totally robust toward dynamic changes to CPU topologies. Rather than storing the next CPU in the round-robin, just store the last one, and also return that value. This simplifies the loop drastically into a much more common pattern. Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Cc: stable@vger.kernel.org Reported-by: Linus Torvalds Tested-by: Manuel Leiner Signed-off-by: Jason A. Donenfeld Signed-off-by: David S. Miller commit a27ac5390922059867f645eefd978e533d7af902 Author: J.J. Martzki Date: Sat Jul 1 22:37:37 2023 +0800 samples: pktgen: fix append mode failed issue Each sample script sources functions.sh before parameters.sh which makes $APPEND undefined when trapping EXIT no matter in append mode or not. Due to this when sample scripts finished they always do "pgctrl reset" which resets pktgen config. So move trap to each script after sourcing parameters.sh and trap EXIT explicitly. Signed-off-by: J.J. Martzki Signed-off-by: David S. Miller commit f56d1eeaeabf3aa613157b26aa07215fcd2c5719 Author: Daniel Díaz Date: Fri Jun 30 22:41:03 2023 -0600 selftests/net: Add xt_policy config for xfrm_policy test When running Kselftests with the current selftests/net/config the following problem can be seen with the net:xfrm_policy.sh selftest: # selftests: net: xfrm_policy.sh [ 41.076721] IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready [ 41.094787] IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready [ 41.107635] IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready # modprobe: FATAL: Module ip_tables not found in directory /lib/modules/6.1.36 # iptables v1.8.7 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?) # Perhaps iptables or your kernel needs to be upgraded. # modprobe: FATAL: Module ip_tables not found in directory /lib/modules/6.1.36 # iptables v1.8.7 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?) # Perhaps iptables or your kernel needs to be upgraded. # SKIP: Could not insert iptables rule ok 1 selftests: net: xfrm_policy.sh # SKIP This is because IPsec "policy" match support is not available to the kernel. This patch adds CONFIG_NETFILTER_XT_MATCH_POLICY as a module to the selftests/net/config file, so that `make kselftest-merge` can take this into consideration. Signed-off-by: Daniel Díaz Signed-off-by: David S. Miller commit f88fcb1d7d961b4b402d675109726f94db87571c Author: Eric Dumazet Date: Sat Jul 1 02:48:24 2023 +0000 net: fix net_dev_start_xmit trace event vs skb_transport_offset() After blamed commit, we must be more careful about using skb_transport_offset(), as reminded us by syzbot: WARNING: CPU: 0 PID: 10 at include/linux/skbuff.h:2868 skb_transport_offset include/linux/skbuff.h:2977 [inline] WARNING: CPU: 0 PID: 10 at include/linux/skbuff.h:2868 perf_trace_net_dev_start_xmit+0x89a/0xce0 include/trace/events/net.h:14 Modules linked in: CPU: 0 PID: 10 Comm: kworker/u4:1 Not tainted 6.1.30-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Workqueue: bat_events batadv_iv_send_outstanding_bat_ogm_packet RIP: 0010:skb_transport_header include/linux/skbuff.h:2868 [inline] RIP: 0010:skb_transport_offset include/linux/skbuff.h:2977 [inline] RIP: 0010:perf_trace_net_dev_start_xmit+0x89a/0xce0 include/trace/events/net.h:14 Code: 8b 04 25 28 00 00 00 48 3b 84 24 c0 00 00 00 0f 85 4e 04 00 00 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc e8 56 22 01 fd <0f> 0b e9 f6 fc ff ff 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 86 f9 ff RSP: 0018:ffffc900002bf700 EFLAGS: 00010293 RAX: ffffffff8485d8ca RBX: 000000000000ffff RCX: ffff888100914280 RDX: 0000000000000000 RSI: 000000000000ffff RDI: 000000000000ffff RBP: ffffc900002bf818 R08: ffffffff8485d5b6 R09: fffffbfff0f8fb5e R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff110217d8f67 R13: ffff88810bec7b3a R14: dffffc0000000000 R15: dffffc0000000000 FS: 0000000000000000(0000) GS:ffff8881f6a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f96cf6d52f0 CR3: 000000012224c000 CR4: 0000000000350ef0 Call Trace: [] trace_net_dev_start_xmit include/trace/events/net.h:14 [inline] [] xmit_one net/core/dev.c:3643 [inline] [] dev_hard_start_xmit+0x705/0x980 net/core/dev.c:3660 [] __dev_queue_xmit+0x16b2/0x3370 net/core/dev.c:4324 [] dev_queue_xmit include/linux/netdevice.h:3030 [inline] [] batadv_send_skb_packet+0x3f3/0x680 net/batman-adv/send.c:108 [] batadv_send_broadcast_skb+0x24/0x30 net/batman-adv/send.c:127 [] batadv_iv_ogm_send_to_if net/batman-adv/bat_iv_ogm.c:393 [inline] [] batadv_iv_ogm_emit net/batman-adv/bat_iv_ogm.c:421 [inline] [] batadv_iv_send_outstanding_bat_ogm_packet+0x69a/0x840 net/batman-adv/bat_iv_ogm.c:1701 [] process_one_work+0x8ac/0x1170 kernel/workqueue.c:2289 [] worker_thread+0xaa8/0x12d0 kernel/workqueue.c:2436 Fixes: 66e4c8d95008 ("net: warn if transport header was not set") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit a398b9ea0c3b791b7a0f4c6029a62cf628f97f22 Author: Vladimir Oltean Date: Sat Jul 1 01:20:10 2023 +0300 net: dsa: tag_sja1105: fix source port decoding in vlan_filtering=0 bridge mode There was a regression introduced by the blamed commit, where pinging to a VLAN-unaware bridge would fail with the repeated message "Couldn't decode source port" coming from the tagging protocol driver. When receiving packets with a bridge_vid as determined by dsa_tag_8021q_bridge_join(), dsa_8021q_rcv() will decode: - source_port = 0 (which isn't really valid, more like "don't know") - switch_id = 0 (which isn't really valid, more like "don't know") - vbid = value in range 1-7 Since the blamed patch has reversed the order of the checks, we are now going to believe that source_port != -1 and switch_id != -1, so they're valid, but they aren't. The minimal solution to the problem is to only populate source_port and switch_id with what dsa_8021q_rcv() came up with, if the vbid is zero, i.e. the source port information is trustworthy. Fixes: c1ae02d87689 ("net: dsa: tag_sja1105: always prefer source port information from INCL_SRCPT") Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 6ca3c005d0604e8d2b439366e3923ea58db99641 Author: Vladimir Oltean Date: Fri Jun 30 19:41:18 2023 +0300 net: bridge: keep ports without IFF_UNICAST_FLT in BR_PROMISC mode According to the synchronization rules for .ndo_get_stats() as seen in Documentation/networking/netdevices.rst, acquiring a plain spin_lock() should not be illegal, but the bridge driver implementation makes it so. After running these commands, I am being faced with the following lockdep splat: $ ip link add link swp0 name macsec0 type macsec encrypt on && ip link set swp0 up $ ip link add dev br0 type bridge vlan_filtering 1 && ip link set br0 up $ ip link set macsec0 master br0 && ip link set macsec0 up ======================================================== WARNING: possible irq lock inversion dependency detected 6.4.0-04295-g31b577b4bd4a #603 Not tainted -------------------------------------------------------- swapper/1/0 just changed the state of lock: ffff6bd348724cd8 (&br->lock){+.-.}-{3:3}, at: br_forward_delay_timer_expired+0x34/0x198 but this lock took another, SOFTIRQ-unsafe lock in the past: (&ocelot->stats_lock){+.+.}-{3:3} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Chain exists of: &br->lock --> &br->hash_lock --> &ocelot->stats_lock Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ocelot->stats_lock); local_irq_disable(); lock(&br->lock); lock(&br->hash_lock); lock(&br->lock); *** DEADLOCK *** (details about the 3 locks skipped) swp0 is instantiated by drivers/net/dsa/ocelot/felix.c, and this only matters to the extent that its .ndo_get_stats64() method calls spin_lock(&ocelot->stats_lock). Documentation/locking/lockdep-design.rst says: | A lock is irq-safe means it was ever used in an irq context, while a lock | is irq-unsafe means it was ever acquired with irq enabled. (...) | Furthermore, the following usage based lock dependencies are not allowed | between any two lock-classes:: | | -> | -> Lockdep marks br->hash_lock as softirq-safe, because it is sometimes taken in softirq context (for example br_fdb_update() which runs in NET_RX softirq), and when it's not in softirq context it blocks softirqs by using spin_lock_bh(). Lockdep marks ocelot->stats_lock as softirq-unsafe, because it never blocks softirqs from running, and it is never taken from softirq context. So it can always be interrupted by softirqs. There is a call path through which a function that holds br->hash_lock: fdb_add_hw_addr() will call a function that acquires ocelot->stats_lock: ocelot_port_get_stats64(). This can be seen below: ocelot_port_get_stats64+0x3c/0x1e0 felix_get_stats64+0x20/0x38 dsa_slave_get_stats64+0x3c/0x60 dev_get_stats+0x74/0x2c8 rtnl_fill_stats+0x4c/0x150 rtnl_fill_ifinfo+0x5cc/0x7b8 rtmsg_ifinfo_build_skb+0xe4/0x150 rtmsg_ifinfo+0x5c/0xb0 __dev_notify_flags+0x58/0x200 __dev_set_promiscuity+0xa0/0x1f8 dev_set_promiscuity+0x30/0x70 macsec_dev_change_rx_flags+0x68/0x88 __dev_set_promiscuity+0x1a8/0x1f8 __dev_set_rx_mode+0x74/0xa8 dev_uc_add+0x74/0xa0 fdb_add_hw_addr+0x68/0xd8 fdb_add_local+0xc4/0x110 br_fdb_add_local+0x54/0x88 br_add_if+0x338/0x4a0 br_add_slave+0x20/0x38 do_setlink+0x3a4/0xcb8 rtnl_newlink+0x758/0x9d0 rtnetlink_rcv_msg+0x2f0/0x550 netlink_rcv_skb+0x128/0x148 rtnetlink_rcv+0x24/0x38 the plain English explanation for it is: The macsec0 bridge port is created without p->flags & BR_PROMISC, because it is what br_manage_promisc() decides for a VLAN filtering bridge with a single auto port. As part of the br_add_if() procedure, br_fdb_add_local() is called for the MAC address of the device, and this results in a call to dev_uc_add() for macsec0 while the softirq-safe br->hash_lock is taken. Because macsec0 does not have IFF_UNICAST_FLT, dev_uc_add() ends up calling __dev_set_promiscuity() for macsec0, which is propagated by its implementation, macsec_dev_change_rx_flags(), to the lower device: swp0. This triggers the call path: dev_set_promiscuity(swp0) -> rtmsg_ifinfo() -> dev_get_stats() -> ocelot_port_get_stats64() with a calling context that lockdep doesn't like (br->hash_lock held). Normally we don't see this, because even though many drivers that can be bridge ports don't support IFF_UNICAST_FLT, we need a driver that (a) doesn't support IFF_UNICAST_FLT, *and* (b) it forwards the IFF_PROMISC flag to another driver, and (c) *that* driver implements ndo_get_stats64() using a softirq-unsafe spinlock. Condition (b) is necessary because the first __dev_set_rx_mode() calls __dev_set_promiscuity() with "bool notify=false", and thus, the rtmsg_ifinfo() code path won't be entered. The same criteria also hold true for DSA switches which don't report IFF_UNICAST_FLT. When the DSA master uses a spin_lock() in its ndo_get_stats64() method, the same lockdep splat can be seen. I think the deadlock possibility is real, even though I didn't reproduce it, and I'm thinking of the following situation to support that claim: fdb_add_hw_addr() runs on a CPU A, in a context with softirqs locally disabled and br->hash_lock held, and may end up attempting to acquire ocelot->stats_lock. In parallel, ocelot->stats_lock is currently held by a thread B (say, ocelot_check_stats_work()), which is interrupted while holding it by a softirq which attempts to lock br->hash_lock. Thread B cannot make progress because br->hash_lock is held by A. Whereas thread A cannot make progress because ocelot->stats_lock is held by B. When taking the issue at face value, the bridge can avoid that problem by simply making the ports promiscuous from a code path with a saner calling context (br->hash_lock not held). A bridge port without IFF_UNICAST_FLT is going to become promiscuous as soon as we call dev_uc_add() on it (which we do unconditionally), so why not be preemptive and make it promiscuous right from the beginning, so as to not be taken by surprise. With this, we've broken the links between code that holds br->hash_lock or br->lock and code that calls into the ndo_change_rx_flags() or ndo_get_stats64() ops of the bridge port. Fixes: 2796d0c648c9 ("bridge: Automatically manage port promiscuous mode.") Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 1f4a08fed450db87fbb5ff5105354158bdbe1a22 Author: Tuo Li Date: Mon Jul 3 11:10:16 2023 +0800 ALSA: hda: fix a possible null-pointer dereference due to data race in snd_hdac_regmap_sync() The variable codec->regmap is often protected by the lock codec->regmap_lock when is accessed. However, it is accessed without holding the lock when is accessed in snd_hdac_regmap_sync(): if (codec->regmap) In my opinion, this may be a harmful race, because if codec->regmap is set to NULL right after the condition is checked, a null-pointer dereference can occur in the called function regcache_sync(): map->lock(map->lock_arg); --> Line 360 in drivers/base/regmap/regcache.c To fix this possible null-pointer dereference caused by data race, the mutex_lock coverage is extended to protect the if statement as well as the function call to regcache_sync(). [ Note: the lack of the regmap_lock itself is harmless for the current codec driver implementations, as snd_hdac_regmap_sync() is only for PM runtime resume that is prohibited during the codec probe. But the change makes the whole code more consistent, so it's merged as is -- tiwai ] Reported-by: BassCheck Signed-off-by: Tuo Li Link: https://lore.kernel.org/r/20230703031016.1184711-1-islituo@gmail.com Signed-off-by: Takashi Iwai commit 73f1c75d5e6bd8ce2a887ef493a66ad1b16ed704 Author: dengxiang Date: Mon Jul 3 10:17:51 2023 +0800 ALSA: hda/realtek: Add quirks for Unis H3C Desktop B760 & Q760 These models use NSIWAY amplifiers for internal speaker, but cannot put sound outside from these amplifiers. So eapd verbs are needed to initialize the amplifiers. They can be added during boot to get working sound out of internal speaker. Signed-off-by: dengxiang Link: https://lore.kernel.org/r/20230703021751.2945750-1-dengxiang@nfschina.com Signed-off-by: Takashi Iwai commit abaa02fc944f2f9f2c2e1925ddaceaf35c48528c Author: Pali Rohár Date: Fri May 5 19:28:18 2023 +0200 powerpc: dts: turris1x.dts: Fix PCIe MEM size for pci2 node Freescale PCIe controllers on their PCIe Root Ports do not have any mappable PCI BAR allocate from PCIe MEM. Information about 1MB window on BAR0 of PCIe Root Port was misleading because Freescale PCIe controllers have at BAR0 position different register PEXCSRBAR, and kernel correctly skipts BAR0 for these Freescale PCIe Root Ports. So update comment about P2020 PCIe Root Port and decrease PCIe MEM size required for PCIe controller (pci2 node) on which is on-board xHCI controller. lspci confirms that on P2020 PCIe Root Port is no PCI BAR and /proc/iomem sees that only c0000000-c000ffff and c0010000-c0011fff ranges are used. Fixes: 54c15ec3b738 ("powerpc: dts: Add DTS file for CZ.NIC Turris 1.x routers") Signed-off-by: Pali Rohár Signed-off-by: Michael Ellerman Link: https://msgid.link/20230505172818.18416-1-pali@kernel.org commit 6cb44bef35ac11724ef22c5ae4f1bc607e2ef3d8 Author: Douglas Anderson Date: Thu Jun 29 12:45:06 2023 -0700 powerpc: Include asm/nmi.c in mobility.c for watchdog_hardlockup_set_timeout_pct() The powerpc/platforms/pseries/mobility.c calls watchdog_hardlockup_set_timeout_pct(), which is declared in . We used to automatically get included, but that changed as of commit 7ca8fe94aa92 ("watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH"). Let's add the explicit include. Reported-by: Randy Dunlap Closes: https://lore.kernel.org/r/af19b76d-aa4b-6c88-9cac-eae4b2072497@infradead.org Fixes: 7ca8fe94aa92 ("watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH") Signed-off-by: Douglas Anderson Tested-by: Randy Dunlap # build-tested Reviewed-by: Petr Mladek Reviewed-by: Randy Dunlap Signed-off-by: Michael Ellerman Link: https://msgid.link/20230629124500.1.I55e2f4e7903d686c4484cb23c033c6a9e1a9d4c4@changeid commit 39f49684036d24af800ff194c33c7b2653c591d7 Author: Randy Dunlap Date: Fri Jun 30 22:47:12 2023 -0700 powerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y In a randconfig with CONFIG_SERIAL_CPM=m and CONFIG_PPC_EARLY_DEBUG_CPM=y, there is a build error: ERROR: modpost: "udbg_putc" [drivers/tty/serial/cpm_uart/cpm_uart.ko] undefined! Prevent the build error by allowing PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y. Fixes: c374e00e17f1 ("[POWERPC] Add early debug console for CPM serial ports.") Signed-off-by: Randy Dunlap Reviewed-by: Pali Rohár Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/20230701054714.30512-1-rdunlap@infradead.org commit 3fbff91afbf0148e937b8718ed865b073c587d9f Merge: 44f10dbefd5e4 a901a3568fd26 Author: Andrew Morton Date: Sun Jul 2 18:53:03 2023 -0700 Merge branch 'master' into mm-hotfixes-stable commit 44b4494d5c5971dc8f531c8783d90a637e862880 Author: Konstantin Komarov Date: Fri Jun 30 15:23:07 2023 +0400 fs/ntfs3: Correct mode for label entry inside /proc/fs/ntfs3/ Suggested-by: Dan Carpenter Signed-off-by: Konstantin Komarov commit 7832e123490ac39f85ab5befc2ceee7b25b03acb Author: Konstantin Komarov Date: Mon May 8 13:39:45 2023 +0400 fs/ntfs3: Add support /proc/fs/ntfs3//volinfo and /proc/fs/ntfs3//label Metafile /proc/fs/ntfs3//label allows to read/write current ntfs label. Signed-off-by: Konstantin Komarov commit d5ca77335846944d77d1e67ed841044074550943 Author: Konstantin Komarov Date: Mon May 8 13:41:24 2023 +0400 fs/ntfs3: Fix endian problem Signed-off-by: Konstantin Komarov commit 33e70701ed313fa4aca78cde89ef09c794584a9b Author: Konstantin Komarov Date: Mon May 8 13:37:22 2023 +0400 fs/ntfs3: Add ability to format new mft records with bigger/smaller header Just define in ntfs.h #define MFTRECORD_FIXUP_OFFSET MFTRECORD_FIXUP_OFFSET_1 or #define MFTRECORD_FIXUP_OFFSET MFTRECORD_FIXUP_OFFSET_3 Signed-off-by: Konstantin Komarov commit a81f47c4406e372ce47aff140f3876babac5f01e Author: Konstantin Komarov Date: Mon May 8 12:59:06 2023 +0400 fs/ntfs3: Code refactoring Check functions arguments. Use u8 instead of size_t for ntfs names, more consts and other. Signed-off-by: Konstantin Komarov commit f037776165b0643199f50fb105be1c3dcf8e8726 Author: Konstantin Komarov Date: Mon May 8 12:22:05 2023 +0400 fs/ntfs3: Code formatting clang-format-15 was used to format code according kernel's .clang-format. Signed-off-by: Konstantin Komarov commit f1d325b8c75e90487b1691fee0199669ea94fff1 Author: Konstantin Komarov Date: Mon May 8 12:09:10 2023 +0400 fs/ntfs3: Do not update primary boot in ntfs_init_from_boot() 'cause it may be faked boot. Let ntfs to be mounted and update boot later. Signed-off-by: Konstantin Komarov commit 6a4cd3ea7d771be17177d95ff67d22cfa2a38b50 Author: Konstantin Komarov Date: Mon May 8 11:56:13 2023 +0400 fs/ntfs3: Alternative boot if primary boot is corrupted Some code refactoring added also. Signed-off-by: Konstantin Komarov commit e0f363a98830e8d7d70fbaf91c07ae0b7c57aafe Author: Konstantin Komarov Date: Mon May 8 11:36:28 2023 +0400 fs/ntfs3: Mark ntfs dirty when on-disk struct is corrupted Signed-off-by: Konstantin Komarov commit d6cd7cecfd5e4a189db97876c317d96ebca075fa Author: Konstantin Komarov Date: Mon May 8 11:26:45 2023 +0400 fs/ntfs3: Fix ntfs_atomic_open This fixes xfstest 633/696. Signed-off-by: Konstantin Komarov commit 14f527d44de632c8d1d65b42ca1bee26bc426455 Author: Konstantin Komarov Date: Mon May 8 13:32:10 2023 +0400 fs/ntfs3: Correct checking while generating attr_list Correct slightly previous commit: Enhance sanity check while generating attr_list Signed-off-by: Konstantin Komarov commit ea303f72d70ce2f0b0aa94ab127085289768c5a6 Author: Tetsuo Handa Date: Tue Mar 28 20:05:16 2023 +0900 fs/ntfs3: Use __GFP_NOWARN allocation at ntfs_load_attr_list() syzbot is reporting too large allocation at ntfs_load_attr_list(), for a crafted filesystem can have huge data_size. Reported-by: syzbot Link: https://syzkaller.appspot.com/bug?extid=89dbb3a789a5b9711793 Signed-off-by: Tetsuo Handa Signed-off-by: Konstantin Komarov commit 97498cd610c0d030a7bd49a7efad974790661162 Author: Jia-Ju Bai Date: Tue Mar 21 21:22:11 2023 +0800 fs: ntfs3: Fix possible null-pointer dereferences in mi_read() In a previous commit 2681631c2973 ("fs/ntfs3: Add null pointer check to attr_load_runs_vcn"), ni can be NULL in attr_load_runs_vcn(), and thus it should be checked before being used. However, in the call stack of this commit, mft_ni in mi_read() is aliased with ni in attr_load_runs_vcn(), and it is also used in mi_read() at two places: mi_read() rw_lock = &mft_ni->file.run_lock -> No check attr_load_runs_vcn(mft_ni, ...) ni (namely mft_ni) is checked in the previous commit attr_load_runs_vcn(..., &mft_ni->file.run) -> No check Thus, to avoid possible null-pointer dereferences, the related checks should be added. These bugs are reported by a static analysis tool implemented by myself, and they are found by extending a known bug fixed in the previous commit. Thus, they could be theoretical bugs. Signed-off-by: Jia-Ju Bai Signed-off-by: Konstantin Komarov commit c9db0ff04649aa0b45f497183c957fe260f229f6 Author: Edward Lo Date: Fri Mar 17 18:23:03 2023 +0800 fs/ntfs3: Return error for inconsistent extended attributes ntfs_read_ea is called when we want to read extended attributes. There are some sanity checks for the validity of the EAs. However, it fails to return a proper error code for the inconsistent attributes, which might lead to unpredicted memory accesses after return. [ 138.916927] BUG: KASAN: use-after-free in ntfs_set_ea+0x453/0xbf0 [ 138.923876] Write of size 4 at addr ffff88800205cfac by task poc/199 [ 138.931132] [ 138.933016] CPU: 0 PID: 199 Comm: poc Not tainted 6.2.0-rc1+ #4 [ 138.938070] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 [ 138.947327] Call Trace: [ 138.949557] [ 138.951539] dump_stack_lvl+0x4d/0x67 [ 138.956834] print_report+0x16f/0x4a6 [ 138.960798] ? ntfs_set_ea+0x453/0xbf0 [ 138.964437] ? kasan_complete_mode_report_info+0x7d/0x200 [ 138.969793] ? ntfs_set_ea+0x453/0xbf0 [ 138.973523] kasan_report+0xb8/0x140 [ 138.976740] ? ntfs_set_ea+0x453/0xbf0 [ 138.980578] __asan_store4+0x76/0xa0 [ 138.984669] ntfs_set_ea+0x453/0xbf0 [ 138.988115] ? __pfx_ntfs_set_ea+0x10/0x10 [ 138.993390] ? kernel_text_address+0xd3/0xe0 [ 138.998270] ? __kernel_text_address+0x16/0x50 [ 139.002121] ? unwind_get_return_address+0x3e/0x60 [ 139.005659] ? __pfx_stack_trace_consume_entry+0x10/0x10 [ 139.010177] ? arch_stack_walk+0xa2/0x100 [ 139.013657] ? filter_irq_stacks+0x27/0x80 [ 139.017018] ntfs_setxattr+0x405/0x440 [ 139.022151] ? __pfx_ntfs_setxattr+0x10/0x10 [ 139.026569] ? kvmalloc_node+0x2d/0x120 [ 139.030329] ? kasan_save_stack+0x41/0x60 [ 139.033883] ? kasan_save_stack+0x2a/0x60 [ 139.037338] ? kasan_set_track+0x29/0x40 [ 139.040163] ? kasan_save_alloc_info+0x1f/0x30 [ 139.043588] ? __kasan_kmalloc+0x8b/0xa0 [ 139.047255] ? __kmalloc_node+0x68/0x150 [ 139.051264] ? kvmalloc_node+0x2d/0x120 [ 139.055301] ? vmemdup_user+0x2b/0xa0 [ 139.058584] __vfs_setxattr+0x121/0x170 [ 139.062617] ? __pfx___vfs_setxattr+0x10/0x10 [ 139.066282] __vfs_setxattr_noperm+0x97/0x300 [ 139.070061] __vfs_setxattr_locked+0x145/0x170 [ 139.073580] vfs_setxattr+0x137/0x2a0 [ 139.076641] ? __pfx_vfs_setxattr+0x10/0x10 [ 139.080223] ? __kasan_check_write+0x18/0x20 [ 139.084234] do_setxattr+0xce/0x150 [ 139.087768] setxattr+0x126/0x140 [ 139.091250] ? __pfx_setxattr+0x10/0x10 [ 139.094948] ? __virt_addr_valid+0xcb/0x140 [ 139.097838] ? __call_rcu_common.constprop.0+0x1c7/0x330 [ 139.102688] ? debug_smp_processor_id+0x1b/0x30 [ 139.105985] ? kasan_quarantine_put+0x5b/0x190 [ 139.109980] ? putname+0x84/0xa0 [ 139.113886] ? __kasan_slab_free+0x11e/0x1b0 [ 139.117961] ? putname+0x84/0xa0 [ 139.121316] ? preempt_count_sub+0x1c/0xd0 [ 139.124427] ? __mnt_want_write+0xae/0x100 [ 139.127836] ? mnt_want_write+0x8f/0x150 [ 139.130954] path_setxattr+0x164/0x180 [ 139.133998] ? __pfx_path_setxattr+0x10/0x10 [ 139.137853] ? __pfx_ksys_pwrite64+0x10/0x10 [ 139.141299] ? debug_smp_processor_id+0x1b/0x30 [ 139.145714] ? fpregs_assert_state_consistent+0x6b/0x80 [ 139.150796] __x64_sys_setxattr+0x71/0x90 [ 139.155407] do_syscall_64+0x3f/0x90 [ 139.159035] entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 139.163843] RIP: 0033:0x7f108cae4469 [ 139.166481] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 088 [ 139.183764] RSP: 002b:00007fff87588388 EFLAGS: 00000286 ORIG_RAX: 00000000000000bc [ 139.190657] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f108cae4469 [ 139.196586] RDX: 00007fff875883b0 RSI: 00007fff875883d1 RDI: 00007fff875883b6 [ 139.201716] RBP: 00007fff8758c530 R08: 0000000000000001 R09: 00007fff8758c618 [ 139.207940] R10: 0000000000000006 R11: 0000000000000286 R12: 00000000004004c0 [ 139.214007] R13: 00007fff8758c610 R14: 0000000000000000 R15: 0000000000000000 Signed-off-by: Edward Lo Signed-off-by: Konstantin Komarov commit fdec309c7672cbee4dc0229ee4cbb33c948a1bdd Author: Edward Lo Date: Thu Mar 16 10:56:55 2023 +0800 fs/ntfs3: Enhance sanity check while generating attr_list ni_create_attr_list uses WARN_ON to catch error cases while generating attribute list, which only prints out stack trace and may not be enough. This repalces them with more proper error handling flow. [ 59.666332] BUG: kernel NULL pointer dereference, address: 000000000000000e [ 59.673268] #PF: supervisor read access in kernel mode [ 59.678354] #PF: error_code(0x0000) - not-present page [ 59.682831] PGD 8000000005ff1067 P4D 8000000005ff1067 PUD 7dee067 PMD 0 [ 59.688556] Oops: 0000 [#1] PREEMPT SMP KASAN PTI [ 59.692642] CPU: 0 PID: 198 Comm: poc Tainted: G B W 6.2.0-rc1+ #4 [ 59.698868] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 [ 59.708795] RIP: 0010:ni_create_attr_list+0x505/0x860 [ 59.713657] Code: 7e 10 e8 5e d0 d0 ff 45 0f b7 76 10 48 8d 7b 16 e8 00 d1 d0 ff 66 44 89 73 16 4d 8d 75 0e 4c 89 f7 e8 3f d0 d0 ff 4c 8d8 [ 59.731559] RSP: 0018:ffff88800a56f1e0 EFLAGS: 00010282 [ 59.735691] RAX: 0000000000000001 RBX: ffff88800b7b5088 RCX: ffffffffb83079fe [ 59.741792] RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffffffbb7f9fc0 [ 59.748423] RBP: ffff88800a56f3a8 R08: ffff88800b7b50a0 R09: fffffbfff76ff3f9 [ 59.754654] R10: ffffffffbb7f9fc7 R11: fffffbfff76ff3f8 R12: ffff88800b756180 [ 59.761552] R13: 0000000000000000 R14: 000000000000000e R15: 0000000000000050 [ 59.768323] FS: 00007feaa8c96440(0000) GS:ffff88806d400000(0000) knlGS:0000000000000000 [ 59.776027] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 59.781395] CR2: 00007f3a2e0b1000 CR3: 000000000a5bc000 CR4: 00000000000006f0 [ 59.787607] Call Trace: [ 59.790271] [ 59.792488] ? __pfx_ni_create_attr_list+0x10/0x10 [ 59.797235] ? kernel_text_address+0xd3/0xe0 [ 59.800856] ? unwind_get_return_address+0x3e/0x60 [ 59.805101] ? __kasan_check_write+0x18/0x20 [ 59.809296] ? preempt_count_sub+0x1c/0xd0 [ 59.813421] ni_ins_attr_ext+0x52c/0x5c0 [ 59.817034] ? __pfx_ni_ins_attr_ext+0x10/0x10 [ 59.821926] ? __vfs_setxattr+0x121/0x170 [ 59.825718] ? __vfs_setxattr_noperm+0x97/0x300 [ 59.829562] ? __vfs_setxattr_locked+0x145/0x170 [ 59.833987] ? vfs_setxattr+0x137/0x2a0 [ 59.836732] ? do_setxattr+0xce/0x150 [ 59.839807] ? setxattr+0x126/0x140 [ 59.842353] ? path_setxattr+0x164/0x180 [ 59.845275] ? __x64_sys_setxattr+0x71/0x90 [ 59.848838] ? do_syscall_64+0x3f/0x90 [ 59.851898] ? entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 59.857046] ? stack_depot_save+0x17/0x20 [ 59.860299] ni_insert_attr+0x1ba/0x420 [ 59.863104] ? __pfx_ni_insert_attr+0x10/0x10 [ 59.867069] ? preempt_count_sub+0x1c/0xd0 [ 59.869897] ? _raw_spin_unlock_irqrestore+0x2b/0x50 [ 59.874088] ? __create_object+0x3ae/0x5d0 [ 59.877865] ni_insert_resident+0xc4/0x1c0 [ 59.881430] ? __pfx_ni_insert_resident+0x10/0x10 [ 59.886355] ? kasan_save_alloc_info+0x1f/0x30 [ 59.891117] ? __kasan_kmalloc+0x8b/0xa0 [ 59.894383] ntfs_set_ea+0x90d/0xbf0 [ 59.897703] ? __pfx_ntfs_set_ea+0x10/0x10 [ 59.901011] ? kernel_text_address+0xd3/0xe0 [ 59.905308] ? __kernel_text_address+0x16/0x50 [ 59.909811] ? unwind_get_return_address+0x3e/0x60 [ 59.914898] ? __pfx_stack_trace_consume_entry+0x10/0x10 [ 59.920250] ? arch_stack_walk+0xa2/0x100 [ 59.924560] ? filter_irq_stacks+0x27/0x80 [ 59.928722] ntfs_setxattr+0x405/0x440 [ 59.932512] ? __pfx_ntfs_setxattr+0x10/0x10 [ 59.936634] ? kvmalloc_node+0x2d/0x120 [ 59.940378] ? kasan_save_stack+0x41/0x60 [ 59.943870] ? kasan_save_stack+0x2a/0x60 [ 59.947719] ? kasan_set_track+0x29/0x40 [ 59.951417] ? kasan_save_alloc_info+0x1f/0x30 [ 59.955733] ? __kasan_kmalloc+0x8b/0xa0 [ 59.959598] ? __kmalloc_node+0x68/0x150 [ 59.963163] ? kvmalloc_node+0x2d/0x120 [ 59.966490] ? vmemdup_user+0x2b/0xa0 [ 59.969060] __vfs_setxattr+0x121/0x170 [ 59.972456] ? __pfx___vfs_setxattr+0x10/0x10 [ 59.976008] __vfs_setxattr_noperm+0x97/0x300 [ 59.981562] __vfs_setxattr_locked+0x145/0x170 [ 59.986100] vfs_setxattr+0x137/0x2a0 [ 59.989964] ? __pfx_vfs_setxattr+0x10/0x10 [ 59.993616] ? __kasan_check_write+0x18/0x20 [ 59.997425] do_setxattr+0xce/0x150 [ 60.000304] setxattr+0x126/0x140 [ 60.002967] ? __pfx_setxattr+0x10/0x10 [ 60.006471] ? __virt_addr_valid+0xcb/0x140 [ 60.010461] ? __call_rcu_common.constprop.0+0x1c7/0x330 [ 60.016037] ? debug_smp_processor_id+0x1b/0x30 [ 60.021008] ? kasan_quarantine_put+0x5b/0x190 [ 60.025545] ? putname+0x84/0xa0 [ 60.027910] ? __kasan_slab_free+0x11e/0x1b0 [ 60.031483] ? putname+0x84/0xa0 [ 60.033986] ? preempt_count_sub+0x1c/0xd0 [ 60.036876] ? __mnt_want_write+0xae/0x100 [ 60.040738] ? mnt_want_write+0x8f/0x150 [ 60.044317] path_setxattr+0x164/0x180 [ 60.048096] ? __pfx_path_setxattr+0x10/0x10 [ 60.052096] ? strncpy_from_user+0x175/0x1c0 [ 60.056482] ? debug_smp_processor_id+0x1b/0x30 [ 60.059848] ? fpregs_assert_state_consistent+0x6b/0x80 [ 60.064557] __x64_sys_setxattr+0x71/0x90 [ 60.068892] do_syscall_64+0x3f/0x90 [ 60.072868] entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 60.077523] RIP: 0033:0x7feaa86e4469 [ 60.080915] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 088 [ 60.097353] RSP: 002b:00007ffdbd8311e8 EFLAGS: 00000286 ORIG_RAX: 00000000000000bc [ 60.103386] RAX: ffffffffffffffda RBX: 9461c5e290baac00 RCX: 00007feaa86e4469 [ 60.110322] RDX: 00007ffdbd831fe0 RSI: 00007ffdbd831305 RDI: 00007ffdbd831263 [ 60.116808] RBP: 00007ffdbd836180 R08: 0000000000000001 R09: 00007ffdbd836268 [ 60.123879] R10: 000000000000007d R11: 0000000000000286 R12: 0000000000400500 [ 60.130540] R13: 00007ffdbd836260 R14: 0000000000000000 R15: 0000000000000000 [ 60.136553] [ 60.138818] Modules linked in: [ 60.141839] CR2: 000000000000000e [ 60.144831] ---[ end trace 0000000000000000 ]--- [ 60.149058] RIP: 0010:ni_create_attr_list+0x505/0x860 [ 60.153975] Code: 7e 10 e8 5e d0 d0 ff 45 0f b7 76 10 48 8d 7b 16 e8 00 d1 d0 ff 66 44 89 73 16 4d 8d 75 0e 4c 89 f7 e8 3f d0 d0 ff 4c 8d8 [ 60.172443] RSP: 0018:ffff88800a56f1e0 EFLAGS: 00010282 [ 60.176246] RAX: 0000000000000001 RBX: ffff88800b7b5088 RCX: ffffffffb83079fe [ 60.182752] RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffffffbb7f9fc0 [ 60.189949] RBP: ffff88800a56f3a8 R08: ffff88800b7b50a0 R09: fffffbfff76ff3f9 [ 60.196950] R10: ffffffffbb7f9fc7 R11: fffffbfff76ff3f8 R12: ffff88800b756180 [ 60.203671] R13: 0000000000000000 R14: 000000000000000e R15: 0000000000000050 [ 60.209595] FS: 00007feaa8c96440(0000) GS:ffff88806d400000(0000) knlGS:0000000000000000 [ 60.216299] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 60.222276] CR2: 00007f3a2e0b1000 CR3: 000000000a5bc000 CR4: 00000000000006f0 Signed-off-by: Edward Lo Signed-off-by: Konstantin Komarov commit f39244e2f21ee63dc26e57b2c909d9484924e24b Author: Yangtao Li Date: Fri Mar 10 11:08:19 2023 +0800 fs/ntfs3: Use wrapper i_blocksize() in ntfs_zero_range() Convert to use i_blocksize() for readability. Signed-off-by: Yangtao Li [almaz.alexandrovich@paragon-software.com: the patch has been partially accepted for performance reasons] Signed-off-by: Konstantin Komarov commit 3c675ddffb17a8b1e32efad5c983254af18b12c2 Author: Zeng Heng Date: Thu Dec 8 00:28:07 2022 +0800 ntfs: Fix panic about slab-out-of-bounds caused by ntfs_listxattr() Here is a BUG report from syzbot: BUG: KASAN: slab-out-of-bounds in ntfs_list_ea fs/ntfs3/xattr.c:191 [inline] BUG: KASAN: slab-out-of-bounds in ntfs_listxattr+0x401/0x570 fs/ntfs3/xattr.c:710 Read of size 1 at addr ffff888021acaf3d by task syz-executor128/3632 Call Trace: ntfs_list_ea fs/ntfs3/xattr.c:191 [inline] ntfs_listxattr+0x401/0x570 fs/ntfs3/xattr.c:710 vfs_listxattr fs/xattr.c:457 [inline] listxattr+0x293/0x2d0 fs/xattr.c:804 Fix the logic of ea_all iteration. When the ea->name_len is 0, return immediately, or Add2Ptr() would visit invalid memory in the next loop. Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations") Reported-by: syzbot+9fcea5ef6dc4dc72d334@syzkaller.appspotmail.com Signed-off-by: Zeng Heng [almaz.alexandrovich@paragon-software.com: lines of the patch have changed] Signed-off-by: Konstantin Komarov commit a901a3568fd26ca9c4a82d8bc5ed5b3ed844d451 Merge: 28c7980fa14a3 447a0bc108e4b Author: Linus Torvalds Date: Sun Jul 2 11:14:54 2023 -0700 Merge tag 'iomap-6.5-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull iomap updates from Darrick Wong: - Fix a type signature mismatch - Drop Christoph as maintainer * tag 'iomap-6.5-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: iomap: drop me [hch] from MAINTAINERS for iomap fs: iomap: Change the type of blocksize from 'int' to 'unsigned int' in iomap_file_buffered_write_punch_delalloc commit 28c7980fa14a3fbd8926686cfffb89b9542b0da1 Merge: 5def00ca25fa5 dff745c1221a4 Author: Linus Torvalds Date: Sun Jul 2 11:10:22 2023 -0700 Merge tag 'v6.5/vfs.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull vfs fix from Christian Brauner: "A fix for the backing file work from this cycle. When init_file() failed it would call file_free_rcu() on the file allocated by the caller of init_file(). It naively assumed that the correct cleanup operation would be called depending on whether it is a regular file or a backing file. However, that presupposes that the FMODE_BACKING flag would already be set which it won't be as that is done in the caller of init_file(). Fix that bug by moving the cleanup of the allocated file into the caller where it belongs in the first place. There's no good reason for init_file() to consume resources it didn't allocate. This is a mainline only fix and was reported by syzbot. The fix was validated by syzbot against the provided reproducer" * tag 'v6.5/vfs.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fs: move cleanup from init_file() into its callers commit 5def00ca25fa5697cfe352e675dc7c03116b2403 Merge: ed77ac92a17c5 6fb605c41d731 Author: Linus Torvalds Date: Sun Jul 2 10:22:38 2023 -0700 Merge tag 'i2c-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: - I2C has now a co-maintainer taking care of the host drivers. Welcome Andi Shyti and have fun! - platform remove callback converted to return void in drivers - simplify drivers by using devm_clk_get_enabled() - introduce i2c_get_match_data() to avoid more boilerplate code (especially since the core stopped delivering an i2c_device_id) - and the usual bunch of driver updates * tag 'i2c-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (38 commits) i2c: uniphier: Use devm_clk_get_enabled() i2c: uniphier-f: Use devm_clk_get_enabled() i2c: owl: Use devm_clk_get_enabled() i2c: lpc2k: Use devm_clk_get_enabled() i2c: hix5hd2: Use devm_clk_get_enabled() i2c: sun6i-p2wi: Use devm_clk_get_enabled() i2c: pasemi-platform: Use devm_clk_get_enabled() i2c: mt7621: Use devm_clk_get_enabled() i2c: xiic: Use devm_clk_get_enabled() i2c: davinci: Use platform table macro over module_alias i2c: ocores: use devm_ managed clks i2c: nomadik: Use dev_err_probe() whenever possible i2c: nomadik: Use devm_clk_get_enabled() i2c: nomadik: Remove unnecessary goto label usb: typec: ucsi: Mark dGPUs as DEVICE scope i2c: wmt: Use devm_platform_get_and_ioremap_resource() i2c: versatile: Use devm_platform_get_and_ioremap_resource() i2c: hix5hd2: Add I2C_M_STOP flag support for i2c-hix5hd2 driver. i2c: mpc: Use of_property_read_reg() to parse "reg" i2c: imx-lpi2c: Don't open-code DIV_ROUND_UP ... commit ed77ac92a17c5138c5b5d792ab226c3188217053 Merge: 995b406c7e972 4ad1218bed3d1 Author: Linus Torvalds Date: Sun Jul 2 10:02:35 2023 -0700 Merge tag 'parisc-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc updates from Helge Deller: - Add missing cacheflush() syscall - Fix STI console on 64-bit-only machines - Move kernel debug options to Kconfig.debug - Lots of warning fixes in arch/parisc/ and drivers/parisc/ when compiled with W=1 - Enable some more graphics drivers in refreshed defconfigs * tag 'parisc-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: (29 commits) parisc: Refresh defconfigs parisc: irq: Add irq-related function declarations parisc: Move init function declarations into header file parisc: dino: Make dino_init() returning void parisc: lba_pci: Mark two variables __maybe_unused parisc: unaligned: Include header file to avoid missing prototype warnings parisc: signal: Mark do_notify_resume() and sys_rt_sigreturn() asmlinkage parisc: unwind: Mark start and stop variables __maybe_unused parisc: init: Drop unused variable end_paddr parisc: traps: Mark functions static parisc: processor: Fix kdoc for init_cpu_profiler() parisc: sys_parisc: parisc_personality() is called from asm code parisc: ccio-dma: Fix kdoc and compiler warnings parisc: pdc_stable: Fix kdoc and compiler warnings parisc: pci-dma: Make pcxl_alloc_range() static parisc: Mark image_size __maybe_unused in perf_write() parisc: module: Mark symindex __maybe_unused parisc: pdc_chassis: Fix kdoc warnings parisc: firmware: Fix kdoc warnings parisc: drivers: Fix kdoc warnings ... commit 5cf32f63b0f4c520460c1a5dd915dc4f09085f29 Author: Shiyang Ruan Date: Thu Jun 29 17:40:30 2023 -0700 xfs: fix the calculation for "end" and "length" The value of "end" should be "start + length - 1". Signed-off-by: Shiyang Ruan Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 75dc0345312221971903b2e28279b7e24b7dbb1b Author: Darrick J. Wong Date: Thu Jun 29 17:39:46 2023 -0700 xfs: fix xfs_btree_query_range callers to initialize btree rec fully Use struct initializers to ensure that the xfs_btree_irecs passed into the query_range function are completely initialized. No functional changes, just closing some sloppy hygiene. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 3ee9351e74907fe3acb0721c315af25b05dc87da Author: Darrick J. Wong Date: Thu Jun 29 17:39:45 2023 -0700 xfs: validate fsmap offsets specified in the query keys Improve the validation of the fsmap offset fields in the query keys and move the validation to the top of the function now that we have pushed the low key adjustment code downwards. Also fix some indenting issues that aren't worth a separate patch. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit a949a1c2a198e048630a8b0741a99b85a5d88136 Author: Darrick J. Wong Date: Thu Jun 29 17:39:45 2023 -0700 xfs: fix logdev fsmap query result filtering The external log device fsmap backend doesn't have an rmapbt to query, so it's wasteful to spend time initializing the rmap_irec objects. Worse yet, the log could (someday) be longer than 2^32 fsblocks, so using the rmap irec structure will result in integer overflows. Fix this mess by computing the start address that we want from keys[0] directly, and use the daddr-based record filtering algorithm that we also use for rtbitmap queries. Fixes: e89c041338ed ("xfs: implement the GETFSMAP ioctl") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit f045dd00328d78f25d64913285f4547f772d13e2 Author: Darrick J. Wong Date: Thu Jun 29 17:39:44 2023 -0700 xfs: clean up the rtbitmap fsmap backend The rtbitmap fsmap backend doesn't query the rmapbt, so it's wasteful to spend time initializing the rmap_irec objects. Worse yet, the logic to query the rtbitmap is spread across three separate functions, which is unnecessarily difficult to follow. Compute the start rtextent that we want from keys[0] directly and combine the functions to avoid passing parameters around everywhere, and consolidate all the logic into a single function. At one point many years ago I intended to use __xfs_getfsmap_rtdev as the launching point for realtime rmapbt queries, but this hasn't been the case for a long time. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit d898137d789cac9ebe5eed9957e4cf25122ca524 Author: Darrick J. Wong Date: Thu Jun 29 17:39:44 2023 -0700 xfs: fix getfsmap reporting past the last rt extent The realtime section ends at the last rt extent. If the user configures the rt geometry with an extent size that is not an integer factor of the number of rt blocks, it's possible for there to be rt blocks past the end of the last rt extent. These tail blocks cannot ever be allocated and will cause corruption reports if the last extent coincides with the end of an rt bitmap block, so do not report consider them for the GETFSMAP output. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 7975aba19cba4eba7ff60410f9294c90edc96dcf Author: Darrick J. Wong Date: Thu Jun 29 17:39:43 2023 -0700 xfs: fix integer overflows in the fsmap rtbitmap and logdev backends It's not correct to use the rmap irec structure to hold query key information to query the rtbitmap because the realtime volume can be longer than 2^32 fsblocks in length. Because the rt volume doesn't have allocation groups, introduce a daddr-based record filtering algorithm and compute the rtextent values using 64-bit variables. The same problem exists in the external log device fsmap implementation, so use the same solution to fix it too. After this patch, all the code that touches info->low and info->high under xfs_getfsmap_logdev and __xfs_getfsmap_rtdev are unnecessary. Cleaning this up will be done in subsequent patches. Fixes: 4c934c7dd60c ("xfs: report realtime space information via the rtbitmap") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 63ef7a35912dd743cabd65d5bb95891625c0dd46 Author: Darrick J. Wong Date: Thu Jun 29 17:39:43 2023 -0700 xfs: fix interval filtering in multi-step fsmap queries I noticed a bug in ranged GETFSMAP queries: # xfs_io -c 'fsmap -vvvv' /opt EXT: DEV BLOCK-RANGE OWNER FILE-OFFSET AG AG-OFFSET TOTAL 0: 8:80 [0..7]: static fs metadata 0 (0..7) 8 9: 8:80 [192..223]: 137 0..31 0 (192..223) 32 # xfs_io -c 'fsmap -vvvv -d 208 208' /opt # That's not right -- we asked what block maps block 208, and we should've received a mapping for inode 137 offset 16. Instead, we get nothing. The root cause of this problem is a mis-interaction between the fsmap code and how btree ranged queries work. xfs_btree_query_range returns any btree record that overlaps with the query interval, even if the record starts before or ends after the interval. Similarly, GETFSMAP is supposed to return a recordset containing all records that overlap the range queried. However, it's possible that the recordset is larger than the buffer that the caller provided to convey mappings to userspace. In /that/ case, userspace is supposed to copy the last record returned to fmh_keys[0] and call GETFSMAP again. In this case, we do not want to return mappings that we have already supplied to the caller. The call to xfs_btree_query_range is the same, but now we ignore any records that start before fmh_keys[0]. Unfortunately, we didn't implement the filtering predicate correctly. The predicate should only be called when we're calling back for more records. Accomplish this by setting info->low.rm_blockcount to a nonzero value and ensuring that it is cleared as necessary. As a result, we no longer want to adjust dkeys[0] in the main setup function because that's confusing. This patch doesn't touch the logdev/rtbitmap backends because they have bigger problems that will be addressed by subsequent patches. Found via xfs/556 with parent pointers enabled. Fixes: e89c041338ed ("xfs: implement the GETFSMAP ioctl") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 1cbc11aaa01f80577b67ae02c73ee781112125fd Author: Benjamin Coddington Date: Fri Jun 30 09:18:13 2023 -0400 NFSv4: Fix dropped lock for racing OPEN and delegation return Commmit f5ea16137a3f ("NFSv4: Retry LOCK on OLD_STATEID during delegation return") attempted to solve this problem by using nfs4's generic async error handling, but introduced a regression where v4.0 lock recovery would hang. The additional complexity introduced by overloading that error handling is not necessary for this case. This patch expects that commit to be reverted. The problem as originally explained in the above commit is: There's a small window where a LOCK sent during a delegation return can race with another OPEN on client, but the open stateid has not yet been updated. In this case, the client doesn't handle the OLD_STATEID error from the server and will lose this lock, emitting: "NFS: nfs4_handle_delegation_recall_error: unhandled error -10024". Fix this by using the old_stateid refresh helpers if the server replies with OLD_STATEID. Suggested-by: Trond Myklebust Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit 97791d3c6d0a501109968cae769dc6256c2829e1 Merge: c97d3fb9e0e71 2e3e94c2f5dc9 Author: David S. Miller Date: Sun Jul 2 15:47:19 2023 +0100 Merge branch 'octeontx2-af-fixes' Hariprasad Kelam says: ==================== octeontx2-af: MAC block fixes for CN10KB This patch set contains fixes for the issues encountered in testing CN10KB MAC block RPM_USX. Patch1: firmware to kernel communication is not working due to wrong interrupt configuration. CSR addresses are corrected. Patch2: NIX to RVU PF mapping errors encountered due to wrong firmware config. Corrects this mapping error. Patch3: Driver is trying to access non exist cgx/lmac which is resulting in kernel panic. Address this issue by adding proper checks. Patch4: MAC features are not getting reset on FLR. Fix the issue by resetting the stale config. ==================== Signed-off-by: David S. Miller commit 2e3e94c2f5dc98a8a0e93850407064bc5389c306 Author: Hariprasad Kelam Date: Fri Jun 30 11:58:45 2023 +0530 octeontx2-af: Reset MAC features in FLR AF driver configures MAC features like internal loopback and PFC upon receiving the request from PF and its VF netdev. But these features are not getting reset in FLR. This patch fixes the issue by resetting the same. Fixes: 23999b30ae67 ("octeontx2-af: Enable or disable CGX internal loopback") Fixes: 1121f6b02e7a ("octeontx2-af: Priority flow control configuration support") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 79ebb53772c95d3a6ae51b3c65f9985fdd430df6 Author: Hariprasad Kelam Date: Fri Jun 30 11:58:44 2023 +0530 octeontx2-af: Add validation before accessing cgx and lmac with the addition of new MAC blocks like CN10K RPM and CN10KB RPM_USX, LMACs are noncontiguous and CGX blocks are also noncontiguous. But during RVU driver initialization, the driver is assuming they are contiguous and trying to access cgx or lmac with their id which is resulting in kernel panic. This patch fixes the issue by adding proper checks. [ 23.219150] pc : cgx_lmac_read+0x38/0x70 [ 23.219154] lr : rvu_program_channels+0x3f0/0x498 [ 23.223852] sp : ffff000100d6fc80 [ 23.227158] x29: ffff000100d6fc80 x28: ffff00010009f880 x27: 000000000000005a [ 23.234288] x26: ffff000102586768 x25: 0000000000002500 x24: fffffffffff0f000 Fixes: 91c6945ea1f9 ("octeontx2-af: cn10k: Add RPM MAC support") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Goutham Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 2e7bc57b976bb016c6569a54d95c1b8d88f9450a Author: Hariprasad Kelam Date: Fri Jun 30 11:58:43 2023 +0530 octeontx2-af: Fix mapping for NIX block from CGX connection Firmware configures NIX block mapping for all MAC blocks. The current implementation reads the configuration and creates the mapping between RVU PF and NIX blocks. But this configuration is only valid for silicons that support multiple blocks. For all other silicons, all MAC blocks map to NIX0. This patch corrects the mapping by adding a check for the same. Fixes: c5a73b632b90 ("octeontx2-af: Map NIX block from CGX connection") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Goutham Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 4c5a331cacda995e995a7857f0e44e8937d98d2c Author: Hariprasad Kelam Date: Fri Jun 30 11:58:42 2023 +0530 octeontx2-af: cn10kb: fix interrupt csr addresses The current design is that, for asynchronous events like link_up and link_down firmware raises the interrupt to kernel. The previous patch which added RPM_USX driver has a bug where it uses old csr addresses for configuring interrupts. Which is resulting in losing interrupts from source firmware. This patch fixes the issue by correcting csr addresses. Fixes: b9d0fedc6234 ("octeontx2-af: cn10kb: Add RPM_USX MAC support") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Goutham Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit c97d3fb9e0e716b77d5c0d3051d46e2f41dc6fe4 Author: David Howells Date: Thu Jun 29 22:47:53 2023 +0100 nvme-tcp: Fix comma-related oops Fix a comma that should be a semicolon. The comma is at the end of an if-body and thus makes the statement after (a bvec_set_page()) conditional too, resulting in an oops because we didn't fill out the bio_vec[]: BUG: kernel NULL pointer dereference, address: 0000000000000008 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page ... Workqueue: nvme_tcp_wq nvme_tcp_io_work [nvme_tcp] RIP: 0010:skb_splice_from_iter+0xf1/0x370 ... Call Trace: tcp_sendmsg_locked+0x3a6/0xdd0 tcp_sendmsg+0x31/0x50 inet_sendmsg+0x47/0x80 sock_sendmsg+0x99/0xb0 nvme_tcp_try_send_data+0x149/0x490 [nvme_tcp] nvme_tcp_try_send+0x1b7/0x300 [nvme_tcp] nvme_tcp_io_work+0x40/0xc0 [nvme_tcp] process_one_work+0x21c/0x430 worker_thread+0x54/0x3e0 kthread+0xf8/0x130 Fixes: 7769887817c3 ("nvme-tcp: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage") Reported-by: Aurelien Aptel Link: https://lore.kernel.org/r/253mt0il43o.fsf@mtr-vdi-124.i-did-not-set--mail-host-address--so-tickle-me/ Signed-off-by: David Howells cc: Sagi Grimberg cc: Willem de Bruijn cc: Keith Busch cc: Jens Axboe cc: Christoph Hellwig cc: Chaitanya Kulkarni cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Jens Axboe cc: Matthew Wilcox cc: linux-nvme@lists.infradead.org cc: netdev@vger.kernel.org Reviewed-by: Chaitanya Kulkarni Signed-off-by: David S. Miller commit dff745c1221a402b4921d54f292288373cff500c Author: Amir Goldstein Date: Sat Jul 1 20:11:34 2023 +0300 fs: move cleanup from init_file() into its callers The use of file_free_rcu() in init_file() to free the struct that was allocated by the caller was hacky and we got what we deserved. Let init_file() and its callers take care of cleaning up each after their own allocated resources on error. Fixes: 62d53c4a1dfe ("fs: use backing_file container for internal files with "fake" f_path") # mainline only Reported-and-tested-by: syzbot+ada42aab05cf51b00e98@syzkaller.appspotmail.com Signed-off-by: Amir Goldstein Message-Id: <20230701171134.239409-1-amir73il@gmail.com> Signed-off-by: Christian Brauner commit 995b406c7e972fab181a4bb57f3b95e59b8e5bf3 Merge: dfab92f27c600 dd64621a2a977 Author: Linus Torvalds Date: Sat Jul 1 21:12:32 2023 -0700 Merge tag 'csky-for-linus-6.5' of https://github.com/c-sky/csky-linux Pull arch/csky update from Guo Ren: - Correct thread.trap_no restore of uprobe * tag 'csky-for-linus-6.5' of https://github.com/c-sky/csky-linux: csky: uprobes: Restore thread.trap_no commit b2ad9549bfd0c1f74287492a9d9a31a03c97f088 Author: Ravi Bangoria Date: Fri Jun 30 14:22:30 2023 +0530 perf evsel amd: Fix IBS error message AMD IBS can do per-process profiling[1] and is no longer restricted to per-cpu or systemwide only. Remove stale error message. Also, checking just exclude_kernel is not sufficient since IBS does not support any privilege filters. So include all exclude_* checks. And finally, move these checks under tools/perf/arch/x86/ from generic code. Before: $ sudo ./perf record -e ibs_op//k -C 0 Error: AMD IBS may only be available in system-wide/per-cpu mode. Try using -a, or -C and workload affinity After: $ sudo ./perf record -e ibs_op//k -C 0 Error: AMD IBS doesn't support privilege filtering. Try again without the privilege modifiers (like 'k') at the end. [1] https://git.kernel.org/torvalds/c/30093056f7b2 Signed-off-by: Ravi Bangoria Acked-by: Namhyung Kim Cc: ananth.narayan@amd.com Cc: sandipan.das@amd.com Cc: santosh.shukla@amd.com Cc: irogers@google.com Cc: peterz@infradead.org Cc: adrian.hunter@intel.com Cc: acme@kernel.org Cc: jolsa@kernel.org Link: https://lore.kernel.org/r/20230630085230.437-1-ravi.bangoria@amd.com Signed-off-by: Namhyung Kim commit dfab92f27c600fea3cadc6e2cb39f092024e1fef Merge: f8566aa4f1766 5b4a82a0724af Author: Linus Torvalds Date: Sat Jul 1 14:38:25 2023 -0700 Merge tag 'nfs-for-6.5-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs Pull NFS client updates from Trond Myklebust: "Stable fixes and other bugfixes: - nfs: don't report STATX_BTIME in ->getattr - Revert 'NFSv4: Retry LOCK on OLD_STATEID during delegation return' since it breaks NFSv4 state recovery. - NFSv4.1: freeze the session table upon receiving NFS4ERR_BADSESSION - Fix the NFSv4.2 xattr cache shrinker_id - Force a ctime update after a NFSv4.2 SETXATTR call Features and cleanups: - NFS and RPC over TLS client code from Chuck Lever - Support for use of abstract unix socket addresses with the rpcbind daemon - Sysfs API to allow shutdown of the kernel RPC client and prevent umount() hangs if the server is known to be permanently down - XDR cleanups from Anna" * tag 'nfs-for-6.5-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (33 commits) Revert "NFSv4: Retry LOCK on OLD_STATEID during delegation return" NFS: Don't cleanup sysfs superblock entry if uninitialized nfs: don't report STATX_BTIME in ->getattr NFSv4.1: freeze the session table upon receiving NFS4ERR_BADSESSION NFSv4.2: fix wrong shrinker_id NFSv4: Clean up some shutdown loops NFS: Cancel all existing RPC tasks when shutdown NFS: add sysfs shutdown knob NFS: add a sysfs link to the acl rpc_client NFS: add a sysfs link to the lockd rpc_client NFS: Add sysfs links to sunrpc clients for nfs_clients NFS: add superblock sysfs entries NFS: Make all of /sys/fs/nfs network-namespace unique NFS: Open-code the nfs_kset kset_create_and_add() NFS: rename nfs_client_kobj to nfs_net_kobj NFS: rename nfs_client_kset to nfs_kset NFS: Add an "xprtsec=" NFS mount option NFS: Have struct nfs_client carry a TLS policy field SUNRPC: Add a TCP-with-TLS RPC transport class SUNRPC: Capture CMSG metadata on client-side receive ... commit f8566aa4f1766bb0267b7a0ed89c1d2c4a82ee1a Merge: ad2885979ea66 0303c9729afc4 Author: Linus Torvalds Date: Sat Jul 1 11:40:01 2023 -0700 Merge tag 'x86-urgent-2023-07-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fix from Thomas Gleixner: "A single regression fix for x86: Moving the invocation of arch_cpu_finalize_init() earlier in the boot process caused a boot regression on IBT enabled system. The root cause is not the move of arch_cpu_finalize_init() itself. The system fails to boot because the subsequent efi_enter_virtual_mode() code has a non-IBT safe EFI call inside. This was not noticed before because IBT was enabled after the EFI initialization. Switching the EFI call to use the IBT safe wrapper cures the problem" * tag 'x86-urgent-2023-07-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/efi: Make efi_set_virtual_address_map IBT safe commit 5f06267b6e6a10dd0cac4eb248fcc51f18c260cc Author: Vincent Whitchurch Date: Fri Jun 30 11:11:48 2023 +0200 perf: unwind: Fix symfs with libdw Pass the full path including the symfs (if any) to libdw. Without this unwinding fails with errors like this when a symfs is used: unwind: failed with 'No such file or directory'" Signed-off-by: Vincent Whitchurch Acked-by: Namhyung Kim Cc: Mark Rutland Cc: kernel@axis.com Cc: Ian Rogers Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230630-perf-libdw-symfs-v2-1-469760dd4d5b@axis.com Signed-off-by: Namhyung Kim commit 78a175c4623f66722709494295a0f6754b46f858 Author: James Clark Date: Fri Jun 30 16:38:39 2023 +0100 perf symbol: Fix uninitialized return value in symbols__find_by_name() found_idx and s aren't initialized, so if no symbol is found then the assert at the end will index off the end of the array causing a segfault. The function also doesn't return NULL when the symbol isn't found even if the assert passes. Fix it by initializing the values and only setting them when something is found. Fixes the following test failure: $ perf test 1 1: vmlinux symtab matches kallsyms : FAILED! Fixes: 259dce914e93 ("perf symbol: Remove symbol_name_rb_node") Signed-off-by: James Clark Acked-by: Ian Rogers Cc: Mark Rutland Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230630153840.858668-1-james.clark@arm.com Signed-off-by: Namhyung Kim commit 2aefb4cc904f17aad03acc3e05f44cef7801c497 Author: Namhyung Kim Date: Wed Jun 28 13:01:41 2023 -0700 perf test: Test perf lock contention CSV output To verify CSV output, just check the number of separators (",") using the tr and wc commands like this. grep -v "^#" ${result} | tr -d -c | wc -c Now it expects 6 columns (and 5 separators) in the output, but it may be changed later so count the field in the header first and compare it to the actual output lines. $ cat ${result} # output: contended, total wait, max wait, avg wait, type, caller 1, 28787, 28787, 28787, spinlock, raw_spin_rq_lock_nested+0x1b The test looks like below now: $ sudo ./perf test -v contention 86: kernel lock contention analysis test : --- start --- test child forked, pid 2705822 Testing perf lock record and perf lock contention Testing perf lock contention --use-bpf Testing perf lock record and perf lock contention at the same time Testing perf lock contention --threads Testing perf lock contention --lock-addr Testing perf lock contention --type-filter (w/ spinlock) Testing perf lock contention --lock-filter (w/ tasklist_lock) Testing perf lock contention --callstack-filter (w/ unix_stream) Testing perf lock contention --callstack-filter with task aggregation Testing perf lock contention CSV output test child finished with 0 ---- end ---- kernel lock contention analysis test: Ok Acked-by: Ian Rogers Cc: Hao Luo Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Ingo Molnar Cc: Song Liu Link: https://lore.kernel.org/r/20230628200141.2739587-5-namhyung@kernel.org Signed-off-by: Namhyung Kim commit f6027053f82c9b533bb306bff64e4e8c8f92e9e4 Author: Namhyung Kim Date: Wed Jun 28 13:01:40 2023 -0700 perf lock contention: Add --output option To avoid formatting failures for example in CSV output due to debug messages, add --output option to put the result in a file. Unfortunately the short -o option was taken by the --owner already. $ sudo ./perf lock con -ab --output lock-out.txt -v sleep 1 Looking at the vmlinux_path (8 entries long) symsrc__init: cannot get elf header. Using /proc/kcore for kernel data Using /proc/kallsyms for symbols $ head lock-out.txt contended total wait max wait avg wait type caller 3 76.79 us 26.89 us 25.60 us rwlock:R ep_poll_callback+0x2d 0xffffffff9a23f4b5 _raw_read_lock_irqsave+0x45 0xffffffff99bbd4dd ep_poll_callback+0x2d 0xffffffff999029f3 __wake_up_common+0x73 0xffffffff99902b82 __wake_up_common_lock+0x82 0xffffffff99fa5b1c sock_def_readable+0x3c 0xffffffff9a11521d unix_stream_sendmsg+0x18d 0xffffffff99f9fc9c sock_sendmsg+0x5c Suggested-by: Ian Rogers Acked-by: Ian Rogers Cc: Hao Luo Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Ingo Molnar Cc: Song Liu Link: https://lore.kernel.org/r/20230628200141.2739587-4-namhyung@kernel.org Signed-off-by: Namhyung Kim commit 69c5c9930d722dee4312a7427f89733bfb4bf984 Author: Namhyung Kim Date: Wed Jun 28 13:01:39 2023 -0700 perf lock contention: Add -x option for CSV style output Sometimes we want to process the output by external programs. Let's add the -x option to specify the field separator like perf stat. $ sudo ./perf lock con -ab -x, sleep 1 # output: contended, total wait, max wait, avg wait, type, caller 19, 194232, 21415, 10222, spinlock, process_one_work+0x1f0 15, 162748, 23843, 10849, rwsem:R, do_user_addr_fault+0x40e 4, 86740, 23415, 21685, rwlock:R, ep_poll_callback+0x2d 1, 84281, 84281, 84281, mutex, iwl_mvm_async_handlers_wk+0x135 8, 67608, 27404, 8451, spinlock, __queue_work+0x174 3, 58616, 31125, 19538, rwsem:W, do_mprotect_pkey+0xff 3, 52953, 21172, 17651, rwlock:W, do_epoll_wait+0x248 2, 30324, 19704, 15162, rwsem:R, do_madvise+0x3ad 1, 24619, 24619, 24619, spinlock, rcu_core+0xd4 The first line is a comment that shows the output format. Each line is separated by the given string ("," in this case). The time is printed in nsec without the unit so that it can be parsed easily. The characters can be used in the output like (":", "+" and ".") are not allowed for the -x option. $ ./perf lock con -x: Cannot use the separator that is already used Usage: perf lock contention [] -x, --field-separator print result in CSV format with custom separator The stacktraces are printed in the same line separated by ":". The header is updated to show the stacktrace. Also the debug output is added at the end as a comment. $ sudo ./perf lock con -abv -x, -F wait_total sleep 1 Looking at the vmlinux_path (8 entries long) symsrc__init: cannot get elf header. Using /proc/kcore for kernel data Using /proc/kallsyms for symbols # output: total wait, type, caller, stacktrace 37134, spinlock, rcu_core+0xd4, 0xffffffff9d0401e4 _raw_spin_lock_irqsave+0x44: 0xffffffff9c738114 rcu_core+0xd4: ... 21213, spinlock, raw_spin_rq_lock_nested+0x1b, 0xffffffff9d0407c0 _raw_spin_lock+0x30: 0xffffffff9c6d9cfb raw_spin_rq_lock_nested+0x1b: ... 20506, rwlock:W, ep_done_scan+0x2d, 0xffffffff9c9bc4dd ep_done_scan+0x2d: 0xffffffff9c9bd5f1 do_epoll_wait+0x6d1: ... 18044, rwlock:R, ep_poll_callback+0x2d, 0xffffffff9d040555 _raw_read_lock_irqsave+0x45: 0xffffffff9c9bc81d ep_poll_callback+0x2d: ... 17890, rwlock:W, do_epoll_wait+0x47b, 0xffffffff9c9bd39b do_epoll_wait+0x47b: 0xffffffff9c9be9ef __x64_sys_epoll_wait+0x6d1: ... 12114, spinlock, futex_wait_queue+0x60, 0xffffffff9d0407c0 _raw_spin_lock+0x30: 0xffffffff9d037cae __schedule+0xbe: ... # debug: total=7, bad=0, bad_task=0, bad_stack=0, bad_time=0, bad_data=0 Also note that some field (like lock symbols) can be empty. $ sudo ./perf lock con -abl -x, -E 10 sleep 1 # output: contended, total wait, max wait, avg wait, address, symbol, type 6, 275025, 61764, 45837, ffff9dcc9f7d60d0, , spinlock 18, 87716, 11196, 4873, ffff9dc540059000, , spinlock 2, 6472, 5499, 3236, ffff9dcc7f730e00, rq_lock, spinlock 3, 4429, 2341, 1476, ffff9dcc7f7b0e00, rq_lock, spinlock 3, 3974, 1635, 1324, ffff9dcc7f7f0e00, rq_lock, spinlock 4, 3290, 1326, 822, ffff9dc5f4e2cde0, , rwlock 3, 2894, 1023, 964, ffffffff9e0d7700, rcu_state, spinlock 1, 2567, 2567, 2567, ffff9dcc7f6b0e00, rq_lock, spinlock 4, 1259, 596, 314, ffff9dc69c2adde0, , rwlock 1, 934, 934, 934, ffff9dcc7f670e00, rq_lock, spinlock Acked-by: Ian Rogers Cc: Hao Luo Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Ingo Molnar Cc: Song Liu Link: https://lore.kernel.org/r/20230628200141.2739587-3-namhyung@kernel.org Signed-off-by: Namhyung Kim commit 7b83d597c8cab98caf18e2a3e2198c33068fcbad Author: Namhyung Kim Date: Wed Jun 28 13:01:38 2023 -0700 perf lock: Remove stale comments The comment was for symbol_conf.sort_by_name which was deleted already. Let's get rid of the stale comments as well. Acked-by: Ian Rogers Cc: Hao Luo Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Ingo Molnar Cc: Song Liu Link: https://lore.kernel.org/r/20230628200141.2739587-2-namhyung@kernel.org Signed-off-by: Namhyung Kim commit ad2885979ea6657fa8d3da51a301ec0e998ad8e7 Merge: e3c2b10d6f156 f5983dab0ead9 Author: Linus Torvalds Date: Sat Jul 1 09:24:31 2023 -0700 Merge tag 'kbuild-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - Remove the deprecated rule to build *.dtbo from *.dts - Refactor section mismatch detection in modpost - Fix bogus ARM section mismatch detections - Fix error of 'make gtags' with O= option - Add Clang's target triple to KBUILD_CPPFLAGS to fix a build error with the latest LLVM version - Rebuild the built-in initrd when KBUILD_BUILD_TIMESTAMP is changed - Ignore more compiler-generated symbols for kallsyms - Fix 'make local*config' to handle the ${CONFIG_FOO} form in Makefiles - Enable more kernel-doc warnings with W=2 - Refactor by generating KSYMTAB data by modpost - Deprecate and - Remove the EXPORT_DATA_SYMBOL macro - Move the check for static EXPORT_SYMBOL back to modpost, which makes the build faster - Re-implement CONFIG_TRIM_UNUSED_KSYMS with one-pass algorithm - Warn missing MODULE_DESCRIPTION when building modules with W=1 - Make 'make clean' robust against too long argument error - Exclude more objects from GCOV to fix CFI failures with GCOV - Allow 'make modules_install' to install modules.builtin and modules.builtin.modinfo even when CONFIG_MODULES is disabled - Include modules.builtin and modules.builtin.modinfo in the linux-image Debian package even when CONFIG_MODULES is disabled - Revive "Entering directory" logging for the latest Make version * tag 'kbuild-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (72 commits) modpost: define more R_ARM_* for old distributions kbuild: revive "Entering directory" for Make >= 4.4.1 kbuild: set correct abs_srctree and abs_objtree for package builds scripts/mksysmap: Ignore prefixed KCFI symbols kbuild: deb-pkg: remove the CONFIG_MODULES check in buildeb kbuild: builddeb: always make modules_install, to install modules.builtin* modpost: continue even with unknown relocation type modpost: factor out Elf_Sym pointer calculation to section_rel() modpost: factor out inst location calculation to section_rel() kbuild: Disable GCOV for *.mod.o kbuild: Fix CFI failures with GCOV kbuild: make clean rule robust against too long argument error script: modpost: emit a warning when the description is missing kbuild: make modules_install copy modules.builtin(.modinfo) linux/export.h: rename 'sec' argument to 'license' modpost: show offset from symbol for section mismatch warnings modpost: merge two similar section mismatch warnings kbuild: implement CONFIG_TRIM_UNUSED_KSYMS without recursion modpost: use null string instead of NULL pointer for default namespace modpost: squash sym_update_namespace() into sym_add_exported() ... commit e3c2b10d6f15640407bef3098accf10faa4ecf1b Merge: d25f002575146 893b24181b4c4 Author: Linus Torvalds Date: Sat Jul 1 09:18:25 2023 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fix from Catalin Marinas: "Fix memory corruption (overwriting the kmalloc redzone) when saving the SVE state while in SVE streaming mode" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: sme: Use STR P to clear FFR context field in streaming SVE mode commit d25f002575146d67b5ebea541e6db3696c957c25 Merge: 0a1c979c6b7df fe77cc2e5a6a7 Author: Linus Torvalds Date: Sat Jul 1 08:58:41 2023 -0700 Merge tag 'cxl-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl Pull CXL updates from Dan Williams: "The highlights in terms of new functionality are support for the standard CXL Performance Monitor definition that appeared in CXL 3.0, support for device sanitization (wiping all data from a device), secure-erase (re-keying encryption of user data), and support for firmware update. The firmware update support is notable as it reuses the simple sysfs_upload interface to just cat(1) a blob to a sysfs file and pipe that to the device. Additionally there are a substantial number of cleanups and reorganizations to get ready for RCH error handling (RCH == Restricted CXL Host == current shipping hardware generation / pre CXL-2.0 topologies) and type-2 (accelerator / vendor specific) devices. For vendor specific devices they implement a subset of what the generic type-3 (generic memory expander) driver expects. As a result the rework decouples optional infrastructure from the core driver context. For RCH topologies, where the specification working group did not want to confuse pre-CXL-aware operating systems, many of the standard registers are hidden which makes support standard bus features like AER (PCIe Advanced Error Reporting) difficult. The rework arranges for the driver to help the PCI-AER core. Bjorn is on board with this direction but a late regression disocvery means the completion of this functionality needs to cook a bit longer, so it is code reorganizations only for now. Summary: - Add infrastructure for supporting background commands along with support for device sanitization and firmware update - Introduce a CXL performance monitoring unit driver based on the common definition in the specification. - Land some preparatory cleanup and refactoring for the anticipated arrival of CXL type-2 (accelerator devices) and CXL RCH (CXL-v1.1 topology) error handling. - Rework CPU cache management with respect to region configuration (device hotplug or other dynamic changes to memory interleaving) - Fix region reconfiguration vs CXL decoder ordering rules" * tag 'cxl-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: (51 commits) cxl: Fix one kernel-doc comment cxl/pci: Use correct flag for sanitize polling docs: perf: Minimal introduction the the CXL PMU device and driver perf: CXL Performance Monitoring Unit driver tools/testing/cxl: add firmware update emulation to CXL memdevs tools/testing/cxl: Use named effects for the Command Effect Log tools/testing/cxl: Fix command effects for inject/clear poison cxl: add a firmware update mechanism using the sysfs firmware loader cxl/test: Add Secure Erase opcode support cxl/mem: Support Secure Erase cxl/test: Add Sanitize opcode support cxl/mem: Wire up Sanitization support cxl/mbox: Add sanitization handling machinery cxl/mem: Introduce security state sysfs file cxl/mbox: Allow for IRQ_NONE case in the isr Revert "cxl/port: Enable the HDM decoder capability for switch ports" cxl/memdev: Formalize endpoint port linkage cxl/pci: Unconditionally unmask 256B Flit errors cxl/region: Manage decoder target_type at decoder-attach time cxl/hdm: Default CXL_DEVTYPE_DEVMEM decoders to CXL_DECODER_DEVMEM ... commit 0a1c979c6b7dfe5b6c105d0f0f9f068b5eb07e25 Merge: be21a73edd5de 1ea7ca1b09014 Author: Linus Torvalds Date: Sat Jul 1 08:48:02 2023 -0700 Merge tag 'libnvdimm-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull nvdimm and DAX updates from Vishal Verma: "This is mostly small cleanups and fixes, with the biggest change being the change to the DAX fault handler allowing it to return VM_FAULT_HWPOISON. Summary: - DAX fixes and cleanups including a use after free, extra references, and device unregistration, and a redundant variable. - Allow the DAX fault handler to return VM_FAULT_HWPOISON - A few libnvdimm cleanups such as making some functions and variables static where sufficient. - Add a few missing prototypes for wrapped functions in tools/testing/nvdimm" * tag 'libnvdimm-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: dax: enable dax fault handler to report VM_FAULT_HWPOISON nvdimm: make security_show static nvdimm: make nd_class variable static dax/kmem: Pass valid argument to memory_group_register_static fsdax: remove redundant variable 'error' dax: Cleanup extra dax_region references dax: Introduce alloc_dev_dax_id() dax: Use device_unregister() in unregister_dax_mapping() dax: Fix dax_mapping_release() use after free tools/testing/nvdimm: Drop empty platform remove function libnvdimm: mark 'security_show' static again testing: nvdimm: add missing prototypes for wrapped functions dax: fix missing-prototype warnings commit be21a73edd5ded67524eabb9dad42799b42c0585 Merge: 170ab6c51a42a 7fffbc71075dc Author: Linus Torvalds Date: Sat Jul 1 08:40:56 2023 -0700 Merge tag 'sysctl-fixes-v2-v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull another sysctl fix from Luis Chamberlain: "Just one minor nit I forgot to merge" * tag 'sysctl-fixes-v2-v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: sysctl: set variable sysctl_mount_point storage-class-specifier to static commit 170ab6c51a42a8a1c1a7ce09367b578db6f2f383 Merge: dd546618ba704 40ca06d71d606 Author: Linus Torvalds Date: Sat Jul 1 08:31:07 2023 -0700 Merge tag 'flex-array-transformations-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux Pull flexible-array update from Gustavo Silva: "Transform a zero-length array into a C99 flexible-array member. This addresses a build failure with Clang by fixing multiple '-Warray-bounds' warnings in drivers/staging/ks7010/ks_wlan_net.c" * tag 'flex-array-transformations-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: uapi: wireless: Replace zero-length array with flexible-array member commit dd546618ba704be4f3724a11e5a194052c551f08 Author: Christian Brauner Date: Sat Jul 1 08:44:44 2023 +0200 pid: use struct_size_t() helper Before commit d67790ddf021 ("overflow: Add struct_size_t() helper") only struct_size() existed, which expects a valid pointer instance containing the flexible array. However, when we determine the default struct pid allocation size for the associated kmem cache of a pid namespace we need to take the nesting depth of the pid namespace into account without an variable instance necessarily being available. In commit b69f0aeb0689 ("pid: Replace struct pid 1-element array with flex-array") we used to handle this the old fashioned way and cast NULL to a struct pid pointer type. However, we do apparently have a dedicated struct_size_t() helper for exactly this case. So switch to that. Suggested-by: Kees Cook Suggested-by: Linus Torvalds Signed-off-by: Christian Brauner Signed-off-by: Linus Torvalds commit 408579cd627a15bd703fe3eeb8485fd02726e9d3 Author: Liam R. Howlett Date: Thu Jun 29 22:28:16 2023 -0400 mm: Update do_vmi_align_munmap() return semantics Since do_vmi_align_munmap() will always honor the downgrade request on the success, the callers no longer have to deal with confusing return codes. Since all callers that request downgrade actually want the lock to be dropped, change the downgrade to an unlock request. Note that the lock still needs to be held in read mode during the page table clean up to avoid races with a map request. Update do_vmi_align_munmap() to return 0 for success. Clean up the callers and comments to always expect the unlock to be honored on the success path. The error path will always leave the lock untouched. As part of the cleanup, the wrapper function do_vmi_munmap() and callers to the wrapper are also updated. Suggested-by: Linus Torvalds Link: https://lore.kernel.org/linux-mm/20230629191414.1215929-1-willy@infradead.org/ Signed-off-by: Liam R. Howlett Signed-off-by: Linus Torvalds commit e4bd84c069f212c01258e405f86e91f327888e41 Author: Matthew Wilcox (Oracle) Date: Thu Jun 29 20:14:14 2023 +0100 mm: Always downgrade mmap_lock if requested Now that stack growth must always hold the mmap_lock for write, we can always downgrade the mmap_lock to read and safely unmap pages from the page table, even if we're next to a stack. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Linus Torvalds commit 03f889378f33aa9a9d8e5f49ba94134cf6158090 Author: Max Filippov Date: Sat Jul 1 03:31:55 2023 -0700 xtensa: fix lock_mm_and_find_vma in case VMA not found MMU version of lock_mm_and_find_vma releases the mm lock before returning when VMA is not found. Do the same in noMMU version. This fixes hang on an attempt to handle protection fault. Fixes: d85a143b69ab ("xtensa: fix NOMMU build with lock_mm_and_find_vma() conversion") Signed-off-by: Max Filippov Signed-off-by: Linus Torvalds commit 5c93c4c72fbc69f0f1cdf43c9402b923314e67c8 Author: Andy Chiu Date: Tue Jun 27 01:55:55 2023 +0000 selftests: Test RISC-V Vector's first-use handler This add a test to check if the kernel zero-initializes all V registers after the first-use trap handler returns. If V registers are not zero-initialized, then the test should fail one out of several runs: ``` root@sifive-fpga:~# ./v_initval_nolibc # vl = 256 not ok 1 detect stale values on v-regesters 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4c 41 4e 47 3d 43 0 50 41 54 48 3d 2f 75 73 72 2f 6c 6f 63 61 6c 2f 73 62 69 6e 3a 2f 75 73 72 2f 6c 6f 63 61 6c 2f 62 69 6e 3a 2f 75 73 72 ff ff 81 0 0 0 0 0 0 0 0 0 0 0 0 0 ``` Otherwise, the test passes without errors each run. Signed-off-by: Andy Chiu Reviewed-by: Björn Töpel Link: https://lore.kernel.org/r/20230627015556.12329-3-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 75b59f2a90aa7ccac62e3dcb680dfb967b341431 Author: Andy Chiu Date: Tue Jun 27 01:55:54 2023 +0000 riscv: vector: clear V-reg in the first-use trap If there is no context switch happens after we enable V for a process, then we return to user space with whatever left on the CPU's V registers accessible to the process. The leaked data could belong to another process's V-context saved from last context switch, impacting process's confidentiality on the system. To prevent this from happening, we clear V registers by restoring zero'd V context after turining on V. Fixes: cd054837243b ("riscv: Allocate user's vector context in the first-use trap") Signed-off-by: Andy Chiu Reviewed-by: Björn Töpel Link: https://lore.kernel.org/r/20230627015556.12329-2-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 26c38cd802c947401cfbcc285b7d841256b5f17f Author: Andy Chiu Date: Sun Jun 25 15:54:15 2023 +0000 riscv: vector: only enable interrupts in the first-use trap The function irqentry_exit_to_user_mode() must be called with interrupt disabled. The caller of do_trap_insn_illegal() also assumes running without interrupts. So, we should turn off interrupts after riscv_v_first_use_handler() returns. Fixes: cd054837243b ("riscv: Allocate user's vector context in the first-use trap") Signed-off-by: Andy Chiu Reviewed-by: Björn Töpel Link: https://lore.kernel.org/r/20230625155416.18629-1-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 782aefb177e8932c558ae55f64206ded7fe1292f Merge: e50db34efdc8c f7584322e4fef Author: Palmer Dabbelt Date: Sun Jun 25 16:24:06 2023 -0700 Merge patch series "riscv: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION" Jisheng Zhang says: When trying to run linux with various opensource riscv core on resource limited FPGA platforms, for example, those FPGAs with less than 16MB SDRAM, I want to save mem as much as possible. One of the major technologies is kernel size optimizations, I found that riscv does not currently support HAVE_LD_DEAD_CODE_DATA_ELIMINATION, which passes -fdata-sections, -ffunction-sections to CFLAGS and passes the --gc-sections flag to the linker. This not only benefits my case on FPGA but also benefits defconfigs. Here are some notable improvements from enabling this with defconfigs: nommu_k210_defconfig: text data bss dec hex 1112009 410288 59837 1582134 182436 before 962838 376656 51285 1390779 1538bb after rv32_defconfig: text data bss dec hex 8804455 2816544 290577 11911576 b5c198 before 8692295 2779872 288977 11761144 b375f8 after defconfig: text data bss dec hex 9438267 3391332 485333 13314932 cb2b74 before 9285914 3350052 483349 13119315 c82f53 after patch1 and patch2 are clean ups. patch3 fixes a typo. patch4 finally enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION for riscv. * b4-shazam-merge: riscv: disable HAVE_LD_DEAD_CODE_DATA_ELIMINATION for LLD riscv: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION vmlinux.lds.h: use correct .init.data.* section name riscv: vmlinux-xip.lds.S: remove .alternative section riscv: move options to keep entries sorted riscv: Fix orphan section warnings caused by kernel/pi Link: https://lore.kernel.org/r/20230523165502.2592-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit e50db34efdc8cac2f17b8f5d32fddd7b58914ce6 Author: Palmer Dabbelt Date: Mon Jun 19 10:21:01 2023 -0700 RISC-V: Fix up some vector state related build failures I get a few build failures along the lines of ./arch/riscv/include/uapi/asm/sigcontext.h:19:36: error: field ‘v_state’ has incomplete type 19 | struct __riscv_v_ext_state v_state; | ^~~~~~~ ./arch/riscv/include/uapi/asm/sigcontext.h:32:49: error: field ‘sc_extdesc’ has incomplete type 32 | struct __riscv_extra_ext_header sc_extdesc; The V structures in question are defined for !assembly, so let's just do so for the others. Fixes: 8ee0b41898fa ("riscv: signal: Add sigcontext save/restore for vector") Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230619172101.18692-1-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit bcc8790057c1f02d20654f68d107973405c1f823 Author: Palmer Dabbelt Date: Mon Jun 19 12:01:43 2023 -0700 RISC-V: Document that V registers are clobbered on syscalls This is included in the ISA manual, but it's pretty common for bits of the ISA manual that are actually ABI to change. So let's document it explicitly. Reviewed-by: Björn Töpel Link: https://lore.kernel.org/r/20230619190142.26498-1-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit 26b32974ad2e82811706fd19c33c4ad6b9953663 Author: Subash Abhinov Kasiviswanathan Date: Fri Jun 30 10:26:17 2023 -0600 docs: networking: Update codeaurora references for rmnet source.codeaurora.org is no longer accessible and so the reference link in the documentation is not useful. Use iproute2 instead as it has a rmnet module for configuration. Fixes: ceed73a2cf4a ("drivers: net: ethernet: qualcomm: rmnet: Initial implementation") Signed-off-by: Sean Tranchetti Signed-off-by: Subash Abhinov Kasiviswanathan Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit d5dc39459bdafd18ff1e93e1a86eb3e814ff9f94 Author: Jakub Kicinski Date: Fri Jun 30 09:00:25 2023 -0700 docs: netdev: broaden mailbot to all MAINTAINERS Reword slightly now that all MAINTAINERS have access to the commands. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 1b0fce8c8e69485e49a7d34aac3d4c2a2aa15d62 Author: Davide Tronchin Date: Thu Jun 29 12:37:36 2023 +0200 net: usb: cdc_ether: add u-blox 0x1313 composition. Add CDC-ECM support for LARA-R6 01B. The new LARA-R6 product variant identified by the "01B" string can be configured (by AT interface) in three different USB modes: * Default mode (Vendor ID: 0x1546 Product ID: 0x1311) with 4 serial interfaces * RmNet mode (Vendor ID: 0x1546 Product ID: 0x1312) with 4 serial interfaces and 1 RmNet virtual network interface * CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1313) with 4 serial interface and 1 CDC-ECM virtual network interface The first 4 interfaces of all the 3 configurations (default, RmNet, ECM) are the same. In CDC-ECM mode LARA-R6 01B exposes the following interfaces: If 0: Diagnostic If 1: AT parser If 2: AT parser If 3: AT parset/alternative functions If 4: CDC-ECM interface Signed-off-by: Davide Tronchin Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 255006adb3da71bb75c334453786df781b415f54 Merge: 24975ce8b2f86 0a3869e14d4a5 Author: Paolo Bonzini Date: Sat Jul 1 07:20:04 2023 -0400 Merge tag 'kvm-x86-vmx-6.5' of https://github.com/kvm-x86/linux into HEAD KVM VMX changes for 6.5: - Fix missing/incorrect #GP checks on ENCLS - Use standard mmu_notifier hooks for handling APIC access page - Misc cleanups commit 24975ce8b2f863547d0b79a5a4552d5ea3522a3c Merge: bb05b0ef627f1 106ed2cad9f7b Author: Paolo Bonzini Date: Sat Jul 1 07:19:42 2023 -0400 Merge tag 'kvm-x86-svm-6.5' of https://github.com/kvm-x86/linux into HEAD KVM SVM changes for 6.5: - Drop manual TR/TSS load after VM-Exit now that KVM uses VMLOAD for host state - Fix a not-yet-problematic missing call to trace_kvm_exit() for VM-Exits that are handled in the fastpath - Print more descriptive information about the status of SEV and SEV-ES during module load - Assert that misc_cg_set_capacity() doesn't fail to avoid should-be-impossible memory leaks commit bb05b0ef627f1d43122cdd2f172f5fb789f77a99 Merge: 751d77fefaf46 5ed19528db8dd Author: Paolo Bonzini Date: Sat Jul 1 07:19:09 2023 -0400 Merge tag 'kvm-x86-selftests-6.5' of https://github.com/kvm-x86/linux into HEAD KVM selftests changes for 6.5: - Add a test for splitting and reconstituting hugepages during and after dirty logging - Add support for CPU pinning in demand paging test - Generate dependency files so that partial rebuilds work as expected - Misc cleanups and fixes commit 751d77fefaf46af17b5d9ce41d21e0e93cdd7d6e Merge: 88de4b94801aa 94cdeebd82111 Author: Paolo Bonzini Date: Sat Jul 1 07:18:51 2023 -0400 Merge tag 'kvm-x86-pmu-6.5' of https://github.com/kvm-x86/linux into HEAD KVM x86/pmu changes for 6.5: - Add support for AMD PerfMonV2, with a variety of cleanups and minor fixes included along the way commit 88de4b94801aa8d3a82fd89148330155acb904af Merge: 36b68d360a7a8 0b210faf33731 Author: Paolo Bonzini Date: Sat Jul 1 07:18:30 2023 -0400 Merge tag 'kvm-x86-mmu-6.5' of https://github.com/kvm-x86/linux into HEAD KVM x86/mmu changes for 6.5: - Add back a comment about the subtle side effect of try_cmpxchg64() in tdp_mmu_set_spte_atomic() - Add an assertion in __kvm_mmu_invalidate_addr() to verify that the target KVM MMU is the current MMU - Add a "never" option to effectively avoid creating NX hugepage recovery threads commit 36b68d360a7a893ba126d6ea6c1799e0b0726362 Merge: d74669ebaeb6e 63e2f55cabedf Author: Paolo Bonzini Date: Sat Jul 1 07:08:59 2023 -0400 Merge tag 'kvm-x86-misc-6.5' of https://github.com/kvm-x86/linux into HEAD KVM x86 changes for 6.5: * Move handling of PAT out of MTRR code and dedup SVM+VMX code * Fix output of PIC poll command emulation when there's an interrupt * Add a maintainer's handbook to document KVM x86 processes, preferred coding style, testing expectations, etc. * Misc cleanups commit d74669ebaeb6e5c786b939dc8c48cf7db9d44c84 Merge: cc744042d9080 cc77b95acf3c7 Author: Paolo Bonzini Date: Sat Jul 1 07:07:55 2023 -0400 Merge tag 'kvm-x86-generic-6.5' of https://github.com/kvm-x86/linux into HEAD Common KVM changes for 6.5: - Fix unprotected vcpu->pid dereference via debugfs - Fix KVM_BUG() and KVM_BUG_ON() macros with 64-bit conditionals - Refactor failure path in kvm_io_bus_unregister_dev() to simplify the code - Misc cleanups commit cc744042d90809ccb7cac7f9fb773f5c9cb9f835 Merge: b5396271eab4e 192df2aa0113d Author: Paolo Bonzini Date: Sat Jul 1 07:04:29 2023 -0400 Merge tag 'kvmarm-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 updates for 6.5 - Eager page splitting optimization for dirty logging, optionally allowing for a VM to avoid the cost of block splitting in the stage-2 fault path. - Arm FF-A proxy for pKVM, allowing a pKVM host to safely interact with services that live in the Secure world. pKVM intervenes on FF-A calls to guarantee the host doesn't misuse memory donated to the hyp or a pKVM guest. - Support for running the split hypervisor with VHE enabled, known as 'hVHE' mode. This is extremely useful for testing the split hypervisor on VHE-only systems, and paves the way for new use cases that depend on having two TTBRs available at EL2. - Generalized framework for configurable ID registers from userspace. KVM/arm64 currently prevents arbitrary CPU feature set configuration from userspace, but the intent is to relax this limitation and allow userspace to select a feature set consistent with the CPU. - Enable the use of Branch Target Identification (FEAT_BTI) in the hypervisor. - Use a separate set of pointer authentication keys for the hypervisor when running in protected mode, as the host is untrusted at runtime. - Ensure timer IRQs are consistently released in the init failure paths. - Avoid trapping CTR_EL0 on systems with Enhanced Virtualization Traps (FEAT_EVT), as it is a register commonly read from userspace. - Erratum workaround for the upcoming AmpereOne part, which has broken hardware A/D state management. As a consequence of the hVHE series reworking the arm64 software features framework, the for-next/module-alloc branch from the arm64 tree comes along for the ride. commit b5396271eab4ec28f0d27ff48e1b151b7b824295 Merge: a443e2609c014 07f225b584242 Author: Paolo Bonzini Date: Sat Jul 1 07:02:41 2023 -0400 Merge tag 'kvm-riscv-6.5-1' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv changes for 6.5 - Redirect AMO load/store misaligned traps to KVM guest - Trap-n-emulate AIA in-kernel irqchip for KVM guest - Svnapot support for KVM Guest commit a443e2609c01479c7c0c3367059d7b9f2e8a6697 Merge: 6995e2de6891c db54dfc9f71cd Author: Paolo Bonzini Date: Sat Jul 1 07:00:11 2023 -0400 Merge tag 'kvm-s390-next-6.5-1' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD * New uvdevice secret API * New CMM selftest * cmm fix * diag 9c racy access of target cpu fix commit dfbf0ee092a5d7a9301c81e815b5e50b7c0aeeda Author: Colin Ian King Date: Fri Jun 30 12:33:37 2023 +0100 smb: client: remove redundant pointer 'server' The pointer 'server' is assigned but never read, the pointer is redundant and can be removed. Cleans up clang scan build warning: fs/smb/client/dfs.c:217:3: warning: Value stored to 'server' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Steve French commit ff7d80a9f2711bf3d9fe1cfb70b3fd15c50584b7 Author: Winston Wen Date: Mon Jun 26 11:42:55 2023 +0800 cifs: fix session state transition to avoid use-after-free issue We switch session state to SES_EXITING without cifs_tcp_ses_lock now, it may lead to potential use-after-free issue. Consider the following execution processes: Thread 1: __cifs_put_smb_ses() spin_lock(&cifs_tcp_ses_lock) if (--ses->ses_count > 0) spin_unlock(&cifs_tcp_ses_lock) return spin_unlock(&cifs_tcp_ses_lock) ---> **GAP** spin_lock(&ses->ses_lock) if (ses->ses_status == SES_GOOD) ses->ses_status = SES_EXITING spin_unlock(&ses->ses_lock) Thread 2: cifs_find_smb_ses() spin_lock(&cifs_tcp_ses_lock) list_for_each_entry(ses, ...) spin_lock(&ses->ses_lock) if (ses->ses_status == SES_EXITING) spin_unlock(&ses->ses_lock) continue ... spin_unlock(&ses->ses_lock) if (ret) cifs_smb_ses_inc_refcount(ret) spin_unlock(&cifs_tcp_ses_lock) If thread 1 is preempted in the gap and thread 2 start executing, thread 2 will get the session, and soon thread 1 will switch the session state to SES_EXITING and start releasing it, even though thread 1 had increased the session's refcount and still uses it. So switch session state under cifs_tcp_ses_lock to eliminate this gap. Signed-off-by: Winston Wen Signed-off-by: Steve French commit a507db1d8fdc39802415e4d2ef6d1aecd67927fa Merge: 8976e9d003957 61986a58bc6ab Author: Linus Torvalds Date: Fri Jun 30 22:00:28 2023 -0700 Merge tag '6.5-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client updates from Steve French: - Deferred close fix - Debugging improvements: display missing mount option, dump rc on invalidate inode failures, print client_guid in DebugData, log session id when matching session not found in reconnect, new dynamic tracepoint for session not found - Mount fixes including: potential null dereference, and possible memory leak and path name parsing when double slashes - Fix potential use after free in compounding - Two crediting (flow control) fixes: fix for crediting leak (stress scenario with excess lease credits) and better locking around updating credits - Three cleanups from issues pointed out by the kernel test robot - Session state check improvements (including for potential use after free) - DFS fixes: Fix for getattr on link when DFS disabled, fix for DFS mounts to same share with different prefix paths, DFS mount error checking improvement * tag '6.5-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6: cifs: new dynamic tracepoint to track ses not found errors cifs: log session id when a matching ses is not found smb: client: improve DFS mount check smb: client: fix shared DFS root mounts with different prefixes smb: client: fix parsing of source mount option smb: client: fix broken file attrs with nodfs mounts cifs: print client_guid in DebugData cifs: fix session state check in smb2_find_smb_ses cifs: fix session state check in reconnect to avoid use-after-free issue cifs: do all necessary checks for credits within or before locking cifs: prevent use-after-free by freeing the cfile later smb: client: fix warning in generic_ip_connect() smb: client: fix warning in CIFSFindNext() smb: client: fix warning in CIFSFindFirst() smb3: do not reserve too many oplock credits cifs: print more detail when invalidate_inode_mapping fails smb: client: fix warning in cifs_smb3_do_mount() smb: client: fix warning in cifs_match_super() cifs: print nosharesock value while dumping mount options SMB3: Do not send lease break acknowledgment if all file handles have been closed commit 8976e9d0039574b2336044fa5e3adb717f3ba54b Merge: ee152be17ade1 9cedc58bdbe9f Author: Linus Torvalds Date: Fri Jun 30 21:53:33 2023 -0700 Merge tag '6.5-rc-ksmbd-server-fixes-part1' of git://git.samba.org/ksmbd Pull ksmbd server updates from Steve French: - two fixes for compounding bugs (make sure no out of bound reads with less common combinations of commands in the compound) - eight minor cleanup patches (e.g. simplifying return values, replace one element array, use of kzalloc where simpler) - fix for clang warning on possible overflow in filename conversion * tag '6.5-rc-ksmbd-server-fixes-part1' of git://git.samba.org/ksmbd: ksmbd: avoid field overflow warning ksmbd: Replace one-element array with flexible-array member ksmbd: Use struct_size() helper in ksmbd_negotiate_smb_dialect() ksmbd: add missing compound request handing in some commands ksmbd: fix out of bounds read in smb2_sess_setup ksmbd: Replace the ternary conditional operator with min() ksmbd: use kvzalloc instead of kvmalloc ksmbd: Change the return value of ksmbd_vfs_query_maximal_access to void ksmbd: return a literal instead of 'err' in ksmbd_vfs_kern_path_locked() ksmbd: use kzalloc() instead of __GFP_ZERO ksmbd: remove unused ksmbd_tree_conn_share function commit ee152be17ade10e8667ffa02de828bb955c40813 Merge: f4ce392b03722 d7dbed457c2ef Author: Linus Torvalds Date: Fri Jun 30 21:48:44 2023 -0700 Merge tag 'nfsd-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fix from Chuck Lever: - Fix ordering of attributes in NFSv4 GETATTR replies * tag 'nfsd-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: Fix creation time serialization order commit f4ce392b03722b62804909aadbce6ff4f9c50b91 Merge: 937d96d2d567f 42cffe980ce38 Author: Linus Torvalds Date: Fri Jun 30 21:40:44 2023 -0700 Merge tag 'livepatching-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching Pull livepatching update from Petr Mladek: - Make a variable static to fix a sparse warning * tag 'livepatching-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching: livepatch: Make 'klp_stack_entries' static commit 937d96d2d567fe0d86a2f39a7f988bf31c66d3e6 Merge: 5d95ff84e62be 2e28a798c3092 Author: Linus Torvalds Date: Fri Jun 30 21:35:52 2023 -0700 Merge tag 'efi-next-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI updates from Ard Biesheuvel: "Although some more stuff is brewing, the EFI changes that are ready for mainline are few this cycle: - improve the PCI DMA paranoia logic in the EFI stub - some constification changes - add statfs support to efivarfs - allow user space to enumerate updatable firmware resources without CAP_SYS_ADMIN" * tag 'efi-next-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi/libstub: Disable PCI DMA before grabbing the EFI memory map efi/esrt: Allow ESRT access without CAP_SYS_ADMIN efivarfs: expose used and total size efi: make kobj_type structure constant efi: x86: make kobj_type structure constant commit 5d95ff84e62be914b4a4dabfa814e4096b05b1b0 Merge: d85a143b69abb 486bfb05913ac Author: Linus Torvalds Date: Fri Jun 30 21:27:13 2023 -0700 Merge tag 'v6.5-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto updates from Herbert Xu: "API: - Add linear akcipher/sig API - Add tfm cloning (hmac, cmac) - Add statesize to crypto_ahash Algorithms: - Allow only odd e and restrict value in FIPS mode for RSA - Replace LFSR with SHA3-256 in jitter - Add interface for gathering of raw entropy in jitter Drivers: - Fix race on data_avail and actual data in hwrng/virtio - Add hash and HMAC support in starfive - Add RSA algo support in starfive - Add support for PCI device 0x156E in ccp" * tag 'v6.5-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (85 commits) crypto: akcipher - Do not copy dst if it is NULL crypto: sig - Fix verify call crypto: akcipher - Set request tfm on sync path crypto: sm2 - Provide sm2_compute_z_digest when sm2 is disabled hwrng: imx-rngc - switch to DEFINE_SIMPLE_DEV_PM_OPS hwrng: st - keep clock enabled while hwrng is registered hwrng: st - support compile-testing hwrng: imx-rngc - fix the timeout for init and self check KEYS: asymmetric: Use new crypto interface without scatterlists KEYS: asymmetric: Move sm2 code into x509_public_key KEYS: Add forward declaration in asymmetric-parser.h crypto: sig - Add interface for sign/verify crypto: akcipher - Add sync interface without SG lists crypto: cipher - On clone do crypto_mod_get() crypto: api - Add __crypto_alloc_tfmgfp crypto: api - Remove crypto_init_ops() crypto: rsa - allow only odd e and restrict value in FIPS mode crypto: geniv - Split geniv out of AEAD Kconfig option crypto: algboss - Add missing dependency on RNG2 crypto: starfive - Add RSA algo support ... commit d85a143b69abb4d7544227e26d12c4c7735ab27d Author: Linus Torvalds Date: Fri Jun 30 18:24:49 2023 -0700 xtensa: fix NOMMU build with lock_mm_and_find_vma() conversion It turns out that xtensa has a really odd configuration situation: you can do a no-MMU config, but still have the page fault code enabled. Which doesn't sound all that sensible, but it turns out that xtensa can have protection faults even without the MMU, and we have this: config PFAULT bool "Handle protection faults" if EXPERT && !MMU default y help Handle protection faults. MMU configurations must enable it. noMMU configurations may disable it if used memory map never generates protection faults or faults are always fatal. If unsure, say Y. which completely violated my expectations of the page fault handling. End result: Guenter reports that the xtensa no-MMU builds all fail with arch/xtensa/mm/fault.c: In function ‘do_page_fault’: arch/xtensa/mm/fault.c:133:8: error: implicit declaration of function ‘lock_mm_and_find_vma’ because I never exposed the new lock_mm_and_find_vma() function for the no-MMU case. Doing so is simple enough, and fixes the problem. Reported-and-tested-by: Guenter Roeck Fixes: a050ba1e7422 ("mm/fault: convert remaining simple cases to lock_mm_and_find_vma()") Signed-off-by: Linus Torvalds commit 3c2f765c81be1c85782ba09f492800a99f765a2c Merge: 6e34e784e7213 e836007089ba8 Author: Jens Axboe Date: Fri Jun 30 20:11:24 2023 -0600 Merge tag 'md-fixes-20230630' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-6.5 Pull MD fix from Song: "This patch fixes data corruption caused by discard on raid0 array with original layout." * tag 'md-fixes-20230630' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md/raid0: add discard support for the 'original' layout commit a6ec83786ab9f13f25fb18166dee908845713a95 Author: Chao Yu Date: Thu Jun 29 19:11:44 2023 +0800 f2fs: fix to do sanity check on direct node in truncate_dnode() syzbot reports below bug: BUG: KASAN: slab-use-after-free in f2fs_truncate_data_blocks_range+0x122a/0x14c0 fs/f2fs/file.c:574 Read of size 4 at addr ffff88802a25c000 by task syz-executor148/5000 CPU: 1 PID: 5000 Comm: syz-executor148 Not tainted 6.4.0-rc7-syzkaller-00041-ge660abd551f1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 f2fs_truncate_data_blocks_range+0x122a/0x14c0 fs/f2fs/file.c:574 truncate_dnode+0x229/0x2e0 fs/f2fs/node.c:944 f2fs_truncate_inode_blocks+0x64b/0xde0 fs/f2fs/node.c:1154 f2fs_do_truncate_blocks+0x4ac/0xf30 fs/f2fs/file.c:721 f2fs_truncate_blocks+0x7b/0x300 fs/f2fs/file.c:749 f2fs_truncate.part.0+0x4a5/0x630 fs/f2fs/file.c:799 f2fs_truncate include/linux/fs.h:825 [inline] f2fs_setattr+0x1738/0x2090 fs/f2fs/file.c:1006 notify_change+0xb2c/0x1180 fs/attr.c:483 do_truncate+0x143/0x200 fs/open.c:66 handle_truncate fs/namei.c:3295 [inline] do_open fs/namei.c:3640 [inline] path_openat+0x2083/0x2750 fs/namei.c:3791 do_filp_open+0x1ba/0x410 fs/namei.c:3818 do_sys_openat2+0x16d/0x4c0 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_creat fs/open.c:1448 [inline] __se_sys_creat fs/open.c:1442 [inline] __x64_sys_creat+0xcd/0x120 fs/open.c:1442 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The root cause is, inodeA references inodeB via inodeB's ino, once inodeA is truncated, it calls truncate_dnode() to truncate data blocks in inodeB's node page, it traverse mapping data from node->i.i_addr[0] to node->i.i_addr[ADDRS_PER_BLOCK() - 1], result in out-of-boundary access. This patch fixes to add sanity check on dnode page in truncate_dnode(), so that, it can help to avoid triggering such issue, and once it encounters such issue, it will record newly introduced ERROR_INVALID_NODE_REFERENCE error into superblock, later fsck can detect such issue and try repairing. Also, it removes f2fs_truncate_data_blocks() for cleanup due to the function has only one caller, and uses f2fs_truncate_data_blocks_range() instead. Reported-and-tested-by: syzbot+12cb4425b22169b52036@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-f2fs-devel/000000000000f3038a05fef867f8@google.com Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 87a91a155902f2b652e272ad3ba4de3486af9229 Author: Sheng Yong Date: Tue Jun 27 20:21:53 2023 +0800 f2fs: only set release for file that has compressed data If a file is not comprssed yet or does not have compressed data, for example, its data has a very low compression ratio, do not set FI_COMPRESS_RELEASED flag. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c31e49615762a5fa0d14ffcfd5e2f1c206213a14 Author: Chao Yu Date: Thu Jun 29 09:41:34 2023 +0800 f2fs: fix compile warning in f2fs_destroy_node_manager() fs/f2fs/node.c: In function ‘f2fs_destroy_node_manager’: fs/f2fs/node.c:3390:1: warning: the frame size of 1048 bytes is larger than 1024 bytes [-Wframe-larger-than=] 3390 | } Merging below pointer arrays into common one, and reuse it by cast type. struct nat_entry *natvec[NATVEC_SIZE]; struct nat_entry_set *setvec[SETVEC_SIZE]; Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 0135c482fa97e2fd8245cb462784112a00ed1211 Author: Chao Yu Date: Thu Jun 29 09:41:02 2023 +0800 f2fs: fix error path handling in truncate_dnode() If truncate_node() fails in truncate_dnode(), it missed to call f2fs_put_page(), fix it. Fixes: 7735730d39d7 ("f2fs: fix to propagate error from __get_meta_page()") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 5eda1ad1aaffdfebdecf7a164e586060a210f74f Author: Jaegeuk Kim Date: Wed Jun 28 01:00:56 2023 -0700 f2fs: fix deadlock in i_xattr_sem and inode page lock Thread #1: [122554.641906][ T92] f2fs_getxattr+0xd4/0x5fc -> waiting for f2fs_down_read(&F2FS_I(inode)->i_xattr_sem); [122554.641927][ T92] __f2fs_get_acl+0x50/0x284 [122554.641948][ T92] f2fs_init_acl+0x84/0x54c [122554.641969][ T92] f2fs_init_inode_metadata+0x460/0x5f0 [122554.641990][ T92] f2fs_add_inline_entry+0x11c/0x350 -> Locked dir->inode_page by f2fs_get_node_page() [122554.642009][ T92] f2fs_do_add_link+0x100/0x1e4 [122554.642025][ T92] f2fs_create+0xf4/0x22c [122554.642047][ T92] vfs_create+0x130/0x1f4 Thread #2: [123996.386358][ T92] __get_node_page+0x8c/0x504 -> waiting for dir->inode_page lock [123996.386383][ T92] read_all_xattrs+0x11c/0x1f4 [123996.386405][ T92] __f2fs_setxattr+0xcc/0x528 [123996.386424][ T92] f2fs_setxattr+0x158/0x1f4 -> f2fs_down_write(&F2FS_I(inode)->i_xattr_sem); [123996.386443][ T92] __f2fs_set_acl+0x328/0x430 [123996.386618][ T92] f2fs_set_acl+0x38/0x50 [123996.386642][ T92] posix_acl_chmod+0xc8/0x1c8 [123996.386669][ T92] f2fs_setattr+0x5e0/0x6bc [123996.386689][ T92] notify_change+0x4d8/0x580 [123996.386717][ T92] chmod_common+0xd8/0x184 [123996.386748][ T92] do_fchmodat+0x60/0x124 [123996.386766][ T92] __arm64_sys_fchmodat+0x28/0x3c Cc: Fixes: 27161f13e3c3 "f2fs: avoid race in between read xattr & write xattr" Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 7fffbc71075dcb733068d711c2593127cdce86f0 Author: Tom Rix Date: Fri Jun 30 16:19:47 2023 -0700 sysctl: set variable sysctl_mount_point storage-class-specifier to static smatch reports fs/proc/proc_sysctl.c:32:18: warning: symbol 'sysctl_mount_point' was not declared. Should it be static? This variable is only used in its defining file, so it should be static. Signed-off-by: Tom Rix Reviewed-by: Kees Cook Signed-off-by: Luis Chamberlain commit e836007089ba8fdf24e636ef2b007651fb4582e6 Author: Jason Baron Date: Fri Jun 23 14:05:23 2023 -0400 md/raid0: add discard support for the 'original' layout We've found that using raid0 with the 'original' layout and discard enabled with different disk sizes (such that at least two zones are created) can result in data corruption. This is due to the fact that the discard handling in 'raid0_handle_discard()' assumes the 'alternate' layout. We've seen this corruption using ext4 but other filesystems are likely susceptible as well. More specifically, while multiple zones are necessary to create the corruption, the corruption may not occur with multiple zones if they layout in such a way the layout matches what the 'alternate' layout would have produced. Thus, not all raid0 devices with the 'original' layout, different size disks and discard enabled will encounter this corruption. The 3.14 kernel inadvertently changed the raid0 disk layout for different size disks. Thus, running a pre-3.14 kernel and post-3.14 kernel on the same raid0 array could corrupt data. This lead to the creation of the 'original' layout (to match the pre-3.14 layout) and the 'alternate' layout (to match the post 3.14 layout) in the 5.4 kernel time frame and an option to tell the kernel which layout to use (since it couldn't be autodetected). However, when the 'original' layout was added back to 5.4 discard support for the 'original' layout was not added leading this issue. I've been able to reliably reproduce the corruption with the following test case: 1. create raid0 array with different size disks using original layout 2. mkfs 3. mount -o discard 4. create lots of files 5. remove 1/2 the files 6. fstrim -a (or just the mount point for the raid0 array) 7. umount 8. fsck -fn /dev/md0 (spews all sorts of corruptions) Let's fix this by adding proper discard support to the 'original' layout. The fix 'maps' the 'original' layout disks to the order in which they are read/written such that we can compare the disks in the same way that the current 'alternate' layout does. A 'disk_shift' field is added to 'struct strip_zone'. This could be computed on the fly in raid0_handle_discard() but by adding this field, we save some computation in the discard path. Note we could also potentially fix this by re-ordering the disks in the zones that follow the first one, and then always read/writing them using the 'alternate' layout. However, that is seen as a more substantial change, and we are attempting the least invasive fix at this time to remedy the corruption. I've verified the change using the reproducer mentioned above. Typically, the corruption is seen after less than 3 iterations, while the patch has run 500+ iterations. Cc: NeilBrown Cc: Song Liu Fixes: c84a1372df92 ("md/raid0: avoid RAID0 data corruption due to layout confusion.") Cc: stable@vger.kernel.org Signed-off-by: Jason Baron Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230623180523.1901230-1-jbaron@akamai.com commit 1b712f18c461bd75f018033a15cf381e712806b5 Author: Nishanth Menon Date: Tue Jun 20 20:00:22 2023 -0500 mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 Sec proxy/message manager data buffer is 60 bytes with the last of the registers indicating transmission completion. This however poses a bit of a challenge. The backing memory for sec_proxy / message manager is regular memory, and all sec proxy does is to trigger a burst of all 60 bytes of data over to the target thread backing ring accelerator. It doesn't do a memory scrub when it moves data out in the burst. When we transmit multiple messages, remnants of previous message is also transmitted which results in some random data being set in TISCI fields of messages that have been expanded forward. The entire concept of backward compatibility hinges on the fact that the unused message fields remain 0x0 allowing for 0x0 value to be specially considered when backward compatibility of message extension is done. So, instead of just writing the completion register, we continue to fill the message buffer up with 0x0 (note: for partial message involving completion, we already do this). This allows us to scale and introduce ABI changes back also work with other boot stages that may have left data in the internal memory. While at this, be consistent and explicit with the data_reg pointer increment. Fixes: aace66b170ce ("mailbox: Introduce TI message manager driver") Signed-off-by: Nishanth Menon Signed-off-by: Jassi Brar commit 602dbbacc3ef9b0a8102202bbde9a5f253677cf0 Author: Stefan Kristiansson Date: Mon May 29 16:50:45 2023 +0300 mailbox: tegra: add support for Tegra264 Tegra264 has a slightly different doorbell register layout than previous chips. Acked-by: Thierry Reding Signed-off-by: Stefan Kristiansson Signed-off-by: Peter De Schrijver Signed-off-by: Jassi Brar commit af9dbbbb4d30c4601a14c920c6ec9ae5cf0fdd22 Author: Peter De Schrijver Date: Mon May 29 16:50:43 2023 +0300 dt-bindings: mailbox: tegra: Document Tegra264 HSP Add the compatible string for the HSP block found on the Tegra264 SoC. The HSP block in Tegra264 is not register compatible with the one in Tegra194 or Tegra234 hence there is no fallback compatibility string. Acked-by: Krzysztof Kozlowski Acked-by: Thierry Reding Signed-off-by: Peter De Schrijver Signed-off-by: Jassi Brar commit ebb0130dad751e88c28ab94c71e46e8ee65427c9 Author: Stefan Wahren Date: Sat Jun 17 15:36:19 2023 +0200 dt-bindings: mailbox: convert bcm2835-mbox bindings to YAML Convert the DT binding document for bcm2835-mbox from .txt to YAML. Signed-off-by: Stefan Wahren Reviewed-by: Rob Herring Signed-off-by: Jassi Brar commit 13ad4b7ce612f215437a479e6efc74aac2d20c25 Author: Manikanta Mylavarapu Date: Mon May 22 03:58:41 2023 +0530 dt-bindings: mailbox: qcom: Add IPQ5018 APCS compatible Add compatible for the Qualcomm IPQ5018 APCS block. Signed-off-by: Manikanta Mylavarapu Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jassi Brar commit b25f62ccb490680a8cee755ac4528909395e0711 Merge: 9070577ae9d60 ff598081e5b9d Author: Linus Torvalds Date: Fri Jun 30 15:22:09 2023 -0700 Merge tag 'vfio-v6.5-rc1' of https://github.com/awilliam/linux-vfio Pull VFIO updates from Alex Williamson: - Adjust log levels for common messages (Oleksandr Natalenko, Alex Williamson) - Support for dynamic MSI-X allocation (Reinette Chatre) - Enable and report PCIe AtomicOp Completer capabilities (Alex Williamson) - Cleanup Kconfigs for vfio bus drivers (Alex Williamson) - Add support for CDX bus based devices (Nipun Gupta) - Fix race with concurrent mdev initialization (Eric Farman) * tag 'vfio-v6.5-rc1' of https://github.com/awilliam/linux-vfio: vfio/mdev: Move the compat_class initialization to module init vfio/cdx: add support for CDX bus vfio/fsl: Create Kconfig sub-menu vfio/platform: Cleanup Kconfig vfio/pci: Cleanup Kconfig vfio/pci-core: Add capability for AtomicOp completer support vfio/pci: Also demote hiding standard cap messages vfio/pci: Clear VFIO_IRQ_INFO_NORESIZE for MSI-X vfio/pci: Support dynamic MSI-X vfio/pci: Probe and store ability to support dynamic MSI-X vfio/pci: Use bitfield for struct vfio_pci_core_device flags vfio/pci: Update stale comment vfio/pci: Remove interrupt context counter vfio/pci: Use xarray for interrupt context storage vfio/pci: Move to single error path vfio/pci: Prepare for dynamic interrupt context storage vfio/pci: Remove negative check on unsigned vector vfio/pci: Consolidate irq cleanup on MSI/MSI-X disable vfio/pci: demote hiding ecap messages to debug level commit 9070577ae9d6065e447d422bdf85a09f89eaa9e8 Merge: 28968f384be3c 6ecac465eee88 Author: Linus Torvalds Date: Fri Jun 30 15:06:45 2023 -0700 Merge tag 'pci-v6.5-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci Pull pci updates from Bjorn Helgaas: "Enumeration: - Export pcie_retrain_link() for use outside ASPM - Add Data Link Layer Link Active Reporting as another way for pcie_retrain_link() to determine the link is up - Work around link training failures (especially on the ASMedia ASM2824 switch) by training first at 2.5GT/s and then attempting higher rates Resource management: - When we coalesce host bridge windows, remove invalidated resources from the resource tree so future allocations work correctly Hotplug: - Cancel bringup sequence if card is not present, to keep from blinking Power Indicator indefinitely - Reassign bridge resources if necessary for ACPI hotplug Driver binding: - Convert platform_device .remove() callbacks to return void instead of a mostly useless int Power management: - Reduce wait time for secondary bus to be ready to speed up resume - Avoid putting EloPOS E2/S2/H2 (as well as Elo i2) PCIe Ports in D3cold - Call _REG when transitioning D-states so AML that uses the PCI config space OpRegion works, which fixes some ASMedia GPIO controllers after resume Virtualization: - Delay extra 250ms after FLR of Solidigm P44 Pro NVMe to avoid KVM hang when guest is rebooted - Add function 1 DMA alias quirk for Marvell 88SE9235 Error handling: - Unexport pci_save_aer_state() since it's only used in drivers/pci/ - Drop recommendation for drivers to configure AER Capability, since the PCI core does this for all devices ASPM: - Disable ASPM on MFD function removal to avoid use-after-free - Tighten up pci_enable_link_state() and pci_disable_link_state() interfaces so they don't enable/disable states the driver didn't specify - Avoid link retraining race that can happen if ASPM sets link control parameters while the link is in the midst of training for some other reason Endpoint framework: - Change "PCI Endpoint Virtual NTB driver" Kconfig prompt to be different from "PCI Endpoint NTB driver" - Automatically create a function specific attributes group for endpoint drivers to avoid reference counting issues - Fix many EPC test issues - Return pci_epf_type_add_cfs() error if EPF has no driver - Add kernel-doc for pci_epc_raise_irq() and pci_epc_map_msi_irq() MSI vector parameters - Pass EPF device ID to driver probe functions - Return -EALREADY if EPC has already been started/stopped - Add linkdown notifier support and use it in qcom-ep - Add Bus Master Enable event support and use it in qcom-ep - Add Qualcomm Modem Host Interface (MHI) endpoint driver - Add Layerscape PME interrupt handling to manage link-up notification Cadence PCIe controller driver: - Wait for link retrain to complete when working around the J721E i2085 erratum with Gen2 mode Faraday FTPC100 PCI controller driver: - Release clock resources on error paths Freescale i.MX6 PCIe controller driver: - Save and restore Root Port MSI control to work around hardware defect Intel VMD host bridge driver: - Reset VMD config register between soft reboots - Capture pci_reset_bus() return value instead of printing junk when it fails Qualcomm PCIe controller driver: - Add SDX65 endpoint compatible string to DT binding - Disable register write access after init for IP v2.3.3, v2.9.0 - Use DWC helpers for enabling/disabling writes to DBI registers - Hide slot hotplug capability for IP v1.0.0, v1.9.0, v2.1.0, v2.3.2, v2.3.3, v2.7.0, v2.9.0 - Reuse v2.3.2 post-init sequence for v2.4.0 Renesas R-Car PCIe controller driver: - Remove unused static pcie_base and pcie_dev Rockchip PCIe controller driver: - Remove writes to unused registers - Write endpoint Device ID using correct register - Assert PCI Configuration Enable bit after probe so endpoint responds instead of generating Request Retry Status messages - Poll waiting for PHY PLLs to lock - Update RK3399 example DT binding to be valid - Use RK3399 PCIE_CLIENT_LEGACY_INT_CTRL to generate INTx instead of manually generating PCIe message - Use multiple windows to avoid address translation conflicts - Use u32 (not u16) when accessing 32-bit registers - Hide MSI-X Capability, since RK3399 can't generate MSI-X - Set endpoint controller required alignment to 256 Synopsys DesignWare PCIe controller driver: - Wait for link to come up only if we've initiated link training Miscellaneous: - Add pci_clear_master() stub for non-CONFIG_PCI" * tag 'pci-v6.5-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: (116 commits) Documentation: PCI: correct spelling PCI: vmd: Fix uninitialized variable usage in vmd_enable_domain() PCI: xgene-msi: Convert to platform remove callback returning void PCI: tegra: Convert to platform remove callback returning void PCI: rockchip-host: Convert to platform remove callback returning void PCI: mvebu: Convert to platform remove callback returning void PCI: mt7621: Convert to platform remove callback returning void PCI: mediatek-gen3: Convert to platform remove callback returning void PCI: mediatek: Convert to platform remove callback returning void PCI: iproc: Convert to platform remove callback returning void PCI: hisi-error: Convert to platform remove callback returning void PCI: dwc: Convert to platform remove callback returning void PCI: j721e: Convert to platform remove callback returning void PCI: brcmstb: Convert to platform remove callback returning void PCI: altera-msi: Convert to platform remove callback returning void PCI: altera: Convert to platform remove callback returning void PCI: aardvark: Convert to platform remove callback returning void PCI: rcar: Use correct product family name for Renesas R-Car PCI: layerscape: Add the endpoint linkup notifier support PCI: endpoint: pci-epf-vntb: Fix typo in comments ... commit 28968f384be3c064d66954aac4c534a5e76bf973 Merge: 9c3255a8f3946 9f0648f13e34a Author: Linus Torvalds Date: Fri Jun 30 14:57:19 2023 -0700 Merge tag 'pinctrl-v6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "No core changes this time New drivers: - Tegra234 support - Qualcomm IPQ5018 support - Intel Meteor Lake-S support - Qualcomm SDX75 subdriver - Qualcomm SPMI-based PM8953 support Improvements: - Fix up support for GPIO3 on the AXP209 - Push-pull drive configuration support for the AT91 PIO4 - Fix misc non-urgent bugs in the AMD driver - Misc non-urgent improved error handling - Misc janitorial and minor improvements" * tag 'pinctrl-v6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (75 commits) pinctrl: cherryview: Drop goto label pinctrl: baytrail: invert if condition pinctrl: baytrail: add warning for BYT_VAL_REG retrieval failure pinctrl: baytrail: reduce scope of spinlock in ->dbg_show() hook pinctrl: tegra: avoid duplicate field initializers dt-bindings: pinctrl: qcom,sdx65-tlmm: add pcie_clkreq function pinctrl: mlxbf3: remove broken Kconfig 'select' pinctrl: spear: Remove unused of_gpio.h inclusion pinctrl: lantiq: Remove unused of_gpio.h inclusion pinctrl: at91-pio4: check return value of devm_kasprintf() pinctrl: microchip-sgpio: check return value of devm_kasprintf() pinctrl: freescale: Fix a memory out of bounds when num_configs is 1 pinctrl: intel: refine ->irq_set_type() hook pinctrl: intel: refine ->set_mux() hook pinctrl: baytrail: Use str_hi_lo() helper lib/string_choices: Add str_high_low() helper lib/string_helpers: Split out string_choices.h lib/string_helpers: Add missing header files to MAINTAINERS database pinctrl: npcm7xx: Add missing check for ioremap pinctrl:sunplus: Add check for kmalloc ... commit 9c3255a8f3946a4c8844f1e2e093313f3b71cb30 Merge: 6cdbb0907a3c5 d2a7bd3690990 Author: Linus Torvalds Date: Fri Jun 30 14:50:00 2023 -0700 Merge tag 'platform-drivers-x86-v6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver updates from Hans de Goede: "AMD PMC and PMF drivers: - Various bugfixes - Improved debugging support Intel PMC: - Refactor to support hw with multiple PMCs - Various other improvements / new hw support Intel Speed Select Technology (ISST): - TPMI Uncore Frequency + Cluster Level Power Controls - Various bugfixes - tools/intel-speed-select: Misc improvements Dell-DDV: Add documentation INT3472 ACPI camera sensor glue code: - Evaluate device's _DSM method to control imaging clock - Drop the need to have a table with per sensor-model info Lenovo Yogabook: - Refactor / rework to also support Android models Think-LMI: - Multiple improvements and fixes WMI: - Add proper API documentation for the WMI bus x86-android-tablets: - Misc new hw support Miscellaneous other cleanups / fixes" * tag 'platform-drivers-x86-v6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (91 commits) platform/x86:intel/pmc: Add Meteor Lake IOE-M PMC related maps platform/x86:intel/pmc: Add Meteor Lake IOE-P PMC related maps platform/x86:intel/pmc: Use SSRAM to discover pwrm base address of primary PMC platform/x86:intel/pmc: Discover PMC devices platform/x86:intel/pmc: Enable debugfs multiple PMC support platform/x86:intel/pmc: Add support to handle multiple PMCs platform/x86:intel/pmc: Combine core_init() and core_configure() platform/x86:intel/pmc: Update maps for Meteor Lake P/M platforms platform/x86/intel: tpmi: Remove hardcoded unit and offset platform/x86: int3472: discrete: Log a warning if the pin-numbers don't match platform/x86: int3472: discrete: Use FIELD_GET() on the GPIO _DSM return value platform/x86: int3472: discrete: Add alternative "AVDD" regulator supply name platform/x86: int3472: discrete: Add support for 1 GPIO regulator shared between 2 sensors platform/x86: int3472: discrete: Remove sensor_config-s platform/x86: int3472: discrete: Drop GPIO remapping support platform/x86: apple-gmux: don't use be32_to_cpu and cpu_to_be32 platform/x86/dell/dell-rbtn: Fix resources leaking on error path platform/x86: ISST: Fix usage counter platform/x86: ISST: Reset default callback on unregister platform/x86: int3472: Switch back to use struct i2c_driver's .probe() ... commit 6e34e784e72132c91b03d4f2f85bd4725b1ad9e5 Merge: a587b046ce921 4e69d4dabd237 Author: Jens Axboe Date: Fri Jun 30 14:04:08 2023 -0600 Merge tag 'nvme-6.5-2023-06-30' of git://git.infradead.org/nvme into block-6.5 Pull NVMe fixes from Keith: "nvme fixes for Linux 6.5 - Reduce spamming kernel logs on repeated controller updates (Breno) - Improved struct packing (Christophe JAILLET) - Misspelled command name in error logging (Damien) - Failover fix for temporary frozen queue (Sagi) - Reset error handling fixes (Keith)" * tag 'nvme-6.5-2023-06-30' of git://git.infradead.org/nvme: nvme: disable controller on reset state failure nvme: sync timeout work on failed reset nvme: ensure unquiesce on teardown nvme-mpath: fix I/O failure with EAGAIN when failing over I/O nvme: host: fix command name spelling nvmet: Reorder fields in 'struct nvmet_ns' nvme: Print capabilities changes just once commit 6cdbb0907a3c562723455e351c940037bdec9b7a Merge: ca7ce08d6a063 e2c789cab60a4 Author: Linus Torvalds Date: Fri Jun 30 12:16:00 2023 -0700 Merge tag 'for-6.5/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - Update DM crypt to allocate compound pages if possible - Fix DM crypt target's crypt_ctr_cipher_new return value on invalid AEAD cipher - Fix DM flakey testing target's write bio corruption feature to corrupt the data of a cloned bio instead of the original - Add random_read_corrupt and random_write_corrupt features to DM flakey target - Fix ABBA deadlock in DM thin metadata by resetting associated bufio client rather than destroying and recreating it - A couple other small DM thinp cleanups - Update DM core to support disabling block core IO stats accounting and optimize away code that isn't needed if stats are disabled - Other small DM core cleanups - Improve DM integrity target to not require so much memory on 32 bit systems. Also only allocate the recalculate buffer as needed (and increasingly reduce its size on allocation failure) - Update DM integrity to use %*ph for printing hexdump of a small buffer. Also update DM integrity documentation - Various DM core ioctl interface hardening. Now more careful about alignment of structures and processing of input passed to the kernel from userspace. Also disallow the creation of DM devices named "control", "." or ".." - Eliminate GFP_NOIO workarounds for __vmalloc and kvmalloc in DM core's ioctl and bufio code * tag 'for-6.5/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (28 commits) dm: get rid of GFP_NOIO workarounds for __vmalloc and kvmalloc dm integrity: scale down the recalculate buffer if memory allocation fails dm integrity: only allocate recalculate buffer when needed dm integrity: reduce vmalloc space footprint on 32-bit architectures dm ioctl: Refuse to create device named "." or ".." dm ioctl: Refuse to create device named "control" dm ioctl: Avoid double-fetch of version dm ioctl: structs and parameter strings must not overlap dm ioctl: Avoid pointer arithmetic overflow dm ioctl: Check dm_target_spec is sufficiently aligned Documentation: dm-integrity: Document an example of how the tunables relate. Documentation: dm-integrity: Document default values. Documentation: dm-integrity: Document the meaning of "buffer". Documentation: dm-integrity: Fix minor grammatical error. dm integrity: Use %*ph for printing hexdump of a small buffer dm thin: disable discards for thin-pool if no_discard_passdown dm: remove stale/redundant dm_internal_{suspend,resume} prototypes in dm.h dm: skip dm-stats work in alloc_io() unless needed dm: avoid needless dm_io access if all IO accounting is disabled dm: support turning off block-core's io stats accounting ... commit ca7ce08d6a063e0ccb91dc57f9bc213120d0d1a7 Merge: 1546cd4bfda49 af92c02fb2090 Author: Linus Torvalds Date: Fri Jun 30 11:57:07 2023 -0700 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: "Updates to the usual drivers (ufs, pm80xx, libata-scsi, smartpqi, lpfc, qla2xxx). We have a couple of major core changes impacting other systems: - Command Duration Limits, which spills into block and ATA - block level Persistent Reservation Operations, which touches block, nvme, target and dm Both of these are added with merge commits containing a cover letter explaining what's going on" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (187 commits) scsi: core: Improve warning message in scsi_device_block() scsi: core: Replace scsi_target_block() with scsi_block_targets() scsi: core: Don't wait for quiesce in scsi_device_block() scsi: core: Don't wait for quiesce in scsi_stop_queue() scsi: core: Merge scsi_internal_device_block() and device_block() scsi: sg: Increase number of devices scsi: bsg: Increase number of devices scsi: qla2xxx: Remove unused nvme_ls_waitq wait queue scsi: ufs: ufs-pci: Add support for Intel Arrow Lake scsi: sd: sd_zbc: Use PAGE_SECTORS_SHIFT scsi: ufs: wb: Add explicit flush_threshold sysfs attribute scsi: ufs: ufs-qcom: Switch to the new ICE API scsi: ufs: dt-bindings: qcom: Add ICE phandle scsi: ufs: ufs-mediatek: Set UFSHCD_QUIRK_MCQ_BROKEN_RTC quirk scsi: ufs: ufs-mediatek: Set UFSHCD_QUIRK_MCQ_BROKEN_INTR quirk scsi: ufs: core: Add host quirk UFSHCD_QUIRK_MCQ_BROKEN_RTC scsi: ufs: core: Add host quirk UFSHCD_QUIRK_MCQ_BROKEN_INTR scsi: ufs: core: Remove dedicated hwq for dev command scsi: ufs: core: mcq: Fix the incorrect OCS value for the device command scsi: ufs: dt-bindings: samsung,exynos: Drop unneeded quotes ... commit 1546cd4bfda49fd6faad47eb30f4e744e2d79a8f Merge: b30d7a77c53ec fd3ac6e804979 Author: Linus Torvalds Date: Fri Jun 30 11:48:16 2023 -0700 Merge tag 'ata-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata updates from Damien Le Moal: - Add support for the .remove_new callback to the ata_platform code to simplify device removal interface (Uwe) - Code simplification in ata_dev_revalidate() (Yahu) - Fix code indentation and coding style in the pata_parport protocol modules to avoid warnings from static code analyzers (me) - Clarify ata_eh_qc_retry() behavior with better comments (Niklas) - Simplify and improve ata_change_queue_depth() behavior to have a consistent behavior between libsas managed devices and libata managed devices (e.g. AHCI connected devices) (me) - Cleanup libata-scsi and libata-eh code to use the ata_ncq_enabled() and ata_ncq_supported() helpers instead of open coding flags tests (me) - Cleanup ahci_reset_controller() code (me) - Change the pata_octeon_cf and sata_svw drivers to use of_property_read_reg() to simplify the code (Rob, me) - Remove unnecessary include files from ahci_octeon driver (me) - Modify the DesignWare ahci dt bindings to add support for the Rockchip RK3588 AHCI (Sebastian) * tag 'ata-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: (29 commits) dt-bindings: phy: rockchip: rk3588 has two reset lines dt-bindings: ata: dwc-ahci: add Rockchip RK3588 dt-bindings: ata: dwc-ahci: add PHY clocks ata: ahci_octeon: Remove unnecessary include ata: pata_octeon_cf: Add missing header include ata: ahci: Cleanup ahci_reset_controller() ata: Use of_property_read_reg() to parse "reg" ata: libata-scsi: Use ata_ncq_supported in ata_scsi_dev_config() ata: libata-eh: Use ata_ncq_enabled() in ata_eh_speed_down() ata: libata-sata: Improve ata_change_queue_depth() ata: libata-sata: Simplify ata_change_queue_depth() ata: libata-eh: Clarify ata_eh_qc_retry() behavior at call site ata: pata_parport: Fix on26 module code indentation and style ata: pata_parport: Fix on20 module code indentation and style ata: pata_parport: Fix ktti module code indentation and style ata: pata_parport: Fix kbic module code indentation and style ata: pata_parport: Fix friq module code indentation and style ata: pata_parport: Fix fit3 module code indentation and style ata: pata_parport: Fix fit2 module code indentation and style ata: pata_parport: Fix epia module code indentation and style ... commit b30d7a77c53ec04a6d94683d7680ec406b7f3ac8 Merge: d2a6fd45c5c4a 4d60e83dfcee7 Author: Linus Torvalds Date: Fri Jun 30 11:35:41 2023 -0700 Merge tag 'perf-tools-for-v6.5-1-2023-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next Pull perf tools updates from Namhyung Kim: "Internal cleanup: - Refactor PMU data management to handle hybrid systems in a generic way. Do more work in the lexer so that legacy event types parse more easily. A side-effect of this is that if a PMU is specified, scanning sysfs is avoided improving start-up time. - Fix hybrid metrics, for example, the TopdownL1 works for both performance and efficiency cores on Intel machines. To support this, sort and regroup events after parsing. - Add reference count checking for the 'thread' data structure. - Lots of fixes for memory leaks in various places thanks to the ASAN and Ian's refcount checker. - Reduce the binary size by replacing static variables with local or dynamically allocated memory. - Introduce shared_mutex for annotate data to reduce memory footprint. - Make filesystem access library functions more thread safe. Test: - Organize cpu_map tests into a single suite. - Add metric value validation test to check if the values are within correct value ranges. - Add perf stat stdio output test to check if event and metric names match. - Add perf data converter JSON output test. - Fix a lot of issues reported by shellcheck(1). This is a preparation to enable shellcheck by default. - Make the large x86 new instructions test optional at build time using EXTRA_TESTS=1. - Add a test for libpfm4 events. perf script: - Add 'dsoff' outpuf field to display offset from the DSO. $ perf script -F comm,pid,event,ip,dsoff ls 2695501 cycles: 152cc73ef4b5 (/usr/lib/x86_64-linux-gnu/ld-2.31.so+0x1c4b5) ls 2695501 cycles: ffffffff99045b3e ([kernel.kallsyms]) ls 2695501 cycles: ffffffff9968e107 ([kernel.kallsyms]) ls 2695501 cycles: ffffffffc1f54afb ([kernel.kallsyms]) ls 2695501 cycles: ffffffff9968382f ([kernel.kallsyms]) ls 2695501 cycles: ffffffff99e00094 ([kernel.kallsyms]) ls 2695501 cycles: 152cc718a8d0 (/usr/lib/x86_64-linux-gnu/libselinux.so.1+0x68d0) ls 2695501 cycles: ffffffff992a6db0 ([kernel.kallsyms]) - Adjust width for large PID/TID values. perf report: - Robustify reading addr2line output for srcline by checking sentinel output before the actual data and by using timeout of 1 second. - Allow config terms (like 'name=ABC') with breakpoint events. $ perf record -e mem:0x55feb98dd169:x/name=breakpoint/ -p 19646 -- sleep 1 perf annotate: - Handle x86 instruction suffix like 'l' in 'movl' generally. - Parse instruction operands properly even with a whitespace. This is needed for llvm-objdump output. - Support RISC-V binutils lookup using the triplet prefixes. - Add '<' and '>' key to navigate to prev/next symbols in TUI. - Fix instruction association and parsing for LoongArch. perf stat: - Add --per-cache aggregation option, optionally specify a cache level like `--per-cache=L2`. $ sudo perf stat --per-cache -a -e ls_dmnd_fills_from_sys.ext_cache_remote --\ taskset -c 0-15,64-79,128-143,192-207\ perf bench sched messaging -p -t -l 100000 -g 8 # Running 'sched/messaging' benchmark: # 20 sender and receiver threads per group # 8 groups == 320 threads run Total time: 7.648 [sec] Performance counter stats for 'system wide': S0-D0-L3-ID0 16 17,145,912 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID8 16 14,977,628 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID16 16 262,539 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID24 16 3,140 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID32 16 27,403 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID40 16 17,026 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID48 16 7,292 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID56 16 2,464 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID64 16 22,489,306 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID72 16 21,455,257 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID80 16 11,619 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID88 16 30,978 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID96 16 37,628 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID104 16 13,594 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID112 16 10,164 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID120 16 11,259 ls_dmnd_fills_from_sys.ext_cache_remote 7.779171484 seconds time elapsed - Change default (no event/metric) formatting for default metrics so that events are hidden and the metric and group appear. Performance counter stats for 'ls /': 1.85 msec task-clock # 0.594 CPUs utilized 0 context-switches # 0.000 /sec 0 cpu-migrations # 0.000 /sec 97 page-faults # 52.517 K/sec 2,187,173 cycles # 1.184 GHz 2,474,459 instructions # 1.13 insn per cycle 531,584 branches # 287.805 M/sec 13,626 branch-misses # 2.56% of all branches TopdownL1 # 23.5 % tma_backend_bound # 11.5 % tma_bad_speculation # 39.1 % tma_frontend_bound # 25.9 % tma_retiring - Allow --cputype option to have any PMU name (not just hybrid). - Fix output value not to added when it runs multiple times with -r option. perf list: - Show metricgroup description from JSON file called metricgroups.json. - Allow 'pfm' argument to list only libpfm4 events and check each event is supported before showing it. JSON vendor events: - Avoid event grouping using "NO_GROUP_EVENTS" constraints. The topdown events are correctly grouped even if no group exists. - Add "Default" metric group to print it in the default output. And use "DefaultMetricgroupName" to indicate the real metric group name. - Add AmpereOne core PMU events. Misc: - Define man page date correctly. - Track exception level properly on ARM CoreSight ETM. - Allow anonymous struct, union or enum when retrieving type names from DWARF. - Fix incorrect filename when calling `perf inject --jit`. - Handle PLT size correctly on LoongArch" * tag 'perf-tools-for-v6.5-1-2023-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next: (269 commits) perf test: Skip metrics w/o event name in stat STD output linter perf test: Reorder event name checks in stat STD output linter perf pmu: Remove a hard coded cpu PMU assumption perf pmus: Add notion of default PMU for JSON events perf unwind: Fix map reference counts perf test: Set PERF_EXEC_PATH for script execution perf script: Initialize buffer for regs_map() perf tests: Fix test_arm_callgraph_fp variable expansion perf symbol: Add LoongArch case in get_plt_sizes() perf test: Remove x permission from lib/stat_output.sh perf test: Rerun failed metrics with longer workload perf test: Add skip list for metrics known would fail perf test: Add metric value validation test perf jit: Fix incorrect file name in DWARF line table perf annotate: Fix instruction association and parsing for LoongArch perf annotation: Switch lock from a mutex to a sharded_mutex perf sharded_mutex: Introduce sharded_mutex tools: Fix incorrect calculation of object size by sizeof perf subcmd: Fix missing check for return value of malloc() in add_cmdname() perf parse-events: Remove unneeded semicolon ... commit 055509cdfd018cc6cd793593df916f1cf4f83d84 Merge: ac192c1a54f95 c93723ada378a Author: Mark Brown Date: Fri Jun 30 19:18:53 2023 +0100 ASoC: codecs: wcd938x/wcd934x: loglevel fix and Merge series from Johan Hovold : When investigating a race in the wcd938x driver I noticed that the MBHC impedance measurements where printed at error loglevel which is clearly wrong. Fix that, and clean up the logging somewhat by using dev_printk() and addressing some style issues. Included are also two patches that drop the bogus inline keywords from the functions involved. commit 4e69d4dabd2379af57b0b8fb9b0d62c23f9cd3b8 Author: Keith Busch Date: Wed Jun 28 07:51:02 2023 -0700 nvme: disable controller on reset state failure If the controller is not in a RESETTING state at the point of reset work, we have to conclude the controller is being deleted. Go to the cleanup on this condition to ensure proper pairing of request_queue quiesce state. Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit a2b5d5443fa7a0e9f26b31598bcc38c2b66300d9 Author: Keith Busch Date: Wed Jun 28 07:48:15 2023 -0700 nvme: sync timeout work on failed reset Timeouts during reset will set the controller for failure, preventing the state change to LIVE. Ensure all timeout work is synced after the controller disabling completes to ensure we don't have any other tasks messing with any namespace request_queue's. Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 2ab4e5f44a869eaf61d7520ad6296b91f67efeed Author: Keith Busch Date: Wed Jun 28 07:46:56 2023 -0700 nvme: ensure unquiesce on teardown The reset work is called on quiesced IO queues, so ensure these are unquiesced after a failed reset to flush out any pending requests. Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit d2a6fd45c5c4a5c5fdfe6c57f74f630e61d8d9a0 Merge: cccf0c2ee52d3 53431798f4bb6 Author: Linus Torvalds Date: Fri Jun 30 10:44:53 2023 -0700 Merge tag 'probes-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull probes updates from Masami Hiramatsu: - fprobe: Pass return address to the fprobe entry/exit callbacks so that the callbacks don't need to analyze pt_regs/stack to find the function return address. - kprobe events: cleanup usage of TPARG_FL_FENTRY and TPARG_FL_RETURN flags so that those are not set at once. - fprobe events: - Add a new fprobe events for tracing arbitrary function entry and exit as a trace event. - Add a new tracepoint events for tracing raw tracepoint as a trace event. This allows user to trace non user-exposed tracepoints. - Move eprobe's event parser code into probe event common file. - Introduce BTF (BPF type format) support to kernel probe (kprobe, fprobe and tracepoint probe) events so that user can specify traced function arguments by name. This also applies the type of argument when fetching the argument. - Introduce '$arg*' wildcard support if BTF is available. This expands the '$arg*' meta argument to all function argument automatically. - Check the return value types by BTF. If the function returns 'void', '$retval' is rejected. - Add some selftest script for fprobe events, tracepoint events and BTF support. - Update documentation about the fprobe events. - Some fixes for above features, document and selftests. - selftests for ftrace (in addition to the new fprobe events): - Add a test case for multiple consecutive probes in a function which checks if ftrace based kprobe, optimized kprobe and normal kprobe can be defined in the same target function. - Add a test case for optimized probe, which checks whether kprobe can be optimized or not. * tag 'probes-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing/probes: Fix tracepoint event with $arg* to fetch correct argument Documentation: Fix typo of reference file name tracing/probes: Fix to return NULL and keep using current argc selftests/ftrace: Add new test case which checks for optimized probes selftests/ftrace: Add new test case which adds multiple consecutive probes in a function Documentation: tracing/probes: Add fprobe event tracing document selftests/ftrace: Add BTF arguments test cases selftests/ftrace: Add tracepoint probe test case tracing/probes: Add BTF retval type support tracing/probes: Add $arg* meta argument for all function args tracing/probes: Support function parameters if BTF is available tracing/probes: Move event parameter fetching code to common parser tracing/probes: Add tracepoint support on fprobe_events selftests/ftrace: Add fprobe related testcases tracing/probes: Add fprobe events for tracing function entry and exit. tracing/probes: Avoid setting TPARG_FL_FENTRY and TPARG_FL_RETURN fprobe: Pass return address to the handlers commit f0ac3504960616c973e65c0a4e5488ad8de60d1c Author: Krzysztof Kozlowski Date: Tue May 30 16:48:50 2023 +0200 dt-bindings: timestamp: restrict node name suffixes Make the pattern matching node names a bit stricter to improve DTS consistency. The pattern is restricted to -N suffixes to decimal numbers. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Reviewed-by: Tony Lindgren Acked-by: Rob Herring Acked-by: Uwe Kleine-König Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230530144851.92059-7-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit fee34f7b6d379e8b9ad2081e7113b99edf445c17 Author: Krzysztof Kozlowski Date: Tue May 30 16:48:48 2023 +0200 dt-bindings: slimbus: restrict node name suffixes Make the pattern matching node names a bit stricter to improve DTS consistency. The pattern is restricted to: 1. Only one unit address or one -N suffix, 2. -N suffixes to decimal numbers. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Reviewed-by: Tony Lindgren Acked-by: Rob Herring Acked-by: Uwe Kleine-König Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230530144851.92059-5-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 6cca6cf3f5ab2c6f7ce48e2d958151580079a6d4 Author: Krzysztof Kozlowski Date: Tue May 30 16:48:51 2023 +0200 dt-bindings: watchdog: restrict node name suffixes Make the pattern matching node names a bit stricter to improve DTS consistency. The pattern is restricted to -N suffixes to decimal numbers. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Guenter Roeck Reviewed-by: Tony Lindgren Acked-by: Uwe Kleine-König Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230530144851.92059-8-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit cccf0c2ee52d3bd710be3a3f865df1b869a68f11 Merge: 533925cb76043 fc30ace06f250 Author: Linus Torvalds Date: Fri Jun 30 10:33:17 2023 -0700 Merge tag 'trace-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing updates from Steven Rostedt: - Add new feature to have function graph tracer record the return value. Adds a new option: funcgraph-retval ; when set, will show the return value of a function in the function graph tracer. - Also add the option: funcgraph-retval-hex where if it is not set, and the return value is an error code, then it will return the decimal of the error code, otherwise it still reports the hex value. - Add the file /sys/kernel/tracing/osnoise/per_cpu/cpu/timerlat_fd That when a application opens it, it becomes the task that the timer lat tracer traces. The application can also read this file to find out how it's being interrupted. - Add the file /sys/kernel/tracing/available_filter_functions_addrs that works just the same as available_filter_functions but also shows the addresses of the functions like kallsyms, except that it gives the address of where the fentry/mcount jump/nop is. This is used by BPF to make it easier to attach BPF programs to ftrace hooks. - Replace strlcpy with strscpy in the tracing boot code. * tag 'trace-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing: Fix warnings when building htmldocs for function graph retval riscv: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL tracing/boot: Replace strlcpy with strscpy tracing/timerlat: Add user-space interface tracing/osnoise: Skip running osnoise if all instances are off tracing/osnoise: Switch from PF_NO_SETAFFINITY to migrate_disable ftrace: Show all functions with addresses in available_filter_functions_addrs selftests/ftrace: Add funcgraph-retval test case LoongArch: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL x86/ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL arm64: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL tracing: Add documentation for funcgraph-retval and funcgraph-retval-hex function_graph: Support recording and printing the return value of function fgraph: Add declaration of "struct fgraph_ret_regs" commit c51251083ad6e9d2cc0fdf209de17b3009e6eccb Author: Nikita Bondarenko Date: Tue Apr 18 19:03:41 2023 +0200 dt-bindings: watchdog: brcm,kona-wdt: convert txt file to yaml Converted txt file to yaml. No additional changes. Signed-off-by: Nikita Bondarenko Link: https://lore.kernel.org/r/20230418170341.28805-1-n2h9z4@gmail.com Signed-off-by: Rob Herring commit 2e54154b9f27262efd0cb4f903cc7d5ad1fe9628 Author: shanzhulig Date: Tue Jun 27 18:10:47 2023 -0700 drm/amdgpu: Fix potential fence use-after-free v2 fence Decrements the reference count before exiting. Avoid Race Vulnerabilities for fence use-after-free. v2 (chk): actually fix the use after free and not just move it. Signed-off-by: shanzhulig Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b75efe88b20c2be28b67e2821a794cc183e32374 Author: Evan Quan Date: Thu May 4 17:09:39 2023 +0800 drm/amd/pm: avoid unintentional shutdown due to temperature momentary fluctuation An intentional delay is added on soft ctf triggered. Then there will be a double check for the GPU temperature before taking further action. This can avoid unintended shutdown due to temperature momentary fluctuation. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 064329c595da56eff6d7a7e7760660c726433139 Author: Evan Quan Date: Thu May 25 10:30:39 2023 +0800 drm/amd/pm: expose swctf threshold setting for legacy powerplay Preparation for coming optimization which eliminates the influence of GPU temperature momentary fluctuation. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit b877934e5efc1ffd4f8098bb245853b3738e103f Author: Aric Cyr Date: Mon Jun 19 01:11:09 2023 -0400 drm/amd/display: 3.2.241 This version brings along the following: - Improve debugging mechanism for Gaming FAMS - Add monitor specific edid quirks - Fixes for Phantom pipe - Fixes for Shapper LUT - Clean up asserts Acked-by: Rodrigo Siqueira Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c85c2c849ce776d5039a77d56936a216f9a07b57 Author: Alvin Lee Date: Mon Jun 19 11:55:57 2023 -0400 drm/amd/display: Take full update path if number of planes changed [Description] - A full update is required if the number of planes for a given stream changes - The new fast update path only checked for stream and plane updates, but there could be a plane addition or removal without one of the stream and plane updates triggering a full update - Add an explicit check for number of planes changing for a full update Reviewed-by: Samson Tam Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d5b5d6cb1d5ea7e2cf804aac40c23a860a2c28c3 Author: Gianna Binder Date: Sat Jun 17 17:17:40 2023 -0400 drm/amd/display: Create debugging mechanism for Gaming FAMS [WHY] To enable FAMS even during gaming sessions. [HOW] By leveraging a new dc.debug parameter. Reviewed-by: Felipe Clark Acked-by: Rodrigo Siqueira Signed-off-by: Gianna Binder Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 613a7956deb3b1ffa2810c6d4c90ee9c3d743dbb Author: Aurabindo Pillai Date: Mon Jun 12 12:44:00 2023 -0400 drm/amd/display: Add monitor specific edid quirk Disable FAMS on a Samsung Odyssey G9 monitor. Experiments show that this monitor does not work well under some use cases, and is likely implementation specific bug on the monitor's firmware. Cc: stable@vger.kernel.org Reviewed-by: Rodrigo Siqueira Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f2c58529eca6edecf9dc1cab41ab367a83bfba7a Author: Alvin Lee Date: Thu Jun 15 17:44:20 2023 -0400 drm/amd/display: For new fast update path, loop through each surface [Description] - Previous implementation didn't consider multiple surfaces in a flip - Loop through each surface in each flip to ensure the update path is correct Reviewed-by: Samson Tam Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1966bbfdfe476d271b338336254854c5edd5a907 Author: Austin Zheng Date: Thu Jun 15 16:41:08 2023 -0400 drm/amd/display: Remove Phantom Pipe Check When Calculating K1 and K2 [Why] K1 and K2 not being setting properly when subVP is active. [How] Have phantom pipes use the same programing as the main pipes without checking the paired stream Cc: stable@vger.kernel.org Tested-by: Daniel Wheeler Reviewed-by: Alvin Lee Acked-by: Rodrigo Siqueira Signed-off-by: Austin Zheng Signed-off-by: Alex Deucher commit 1a3148b5f21b771c0ed362960fc97c92c6f9fc26 Author: Alvin Lee Date: Thu Jun 15 14:26:46 2023 -0400 drm/amd/display: Limit new fast update path to addr and gamma / color [Description] - We want to limit the new fast update path to address and gamma updates only. - Add a check in dc_update_planes_and_stream to only take the new fast update path if we only have the specific fast updates defined. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 27fc10d1095f7a7de7c917638d7134033a190dd8 Author: Harry Wentland Date: Thu Apr 6 18:06:27 2023 -0400 drm/amd/display: Fix the delta clamping for shaper LUT The shaper LUT requires a 10-bit value of the delta between segments. We were using dc_fixpt_clamp_u0d10() to do that but it doesn't do what we want it to do. It will preserve 10-bit precision after the decimal point, but that's not quite what we want. We want 14-bit precision and discard the 4 most-significant bytes. To do that we'll do dc_fixpt_clamp_u0d14() & 0x3ff instead. Tested-by: Daniel Wheeler Reviewed-by: Krunoslav Kovac Acked-by: Rodrigo Siqueira Signed-off-by: Harry Wentland Signed-off-by: Alex Deucher commit a28eb4871acd4132a39a3e93b1e4f4bf500ffb41 Author: Lijo Lazar Date: Thu Jun 22 11:35:10 2023 +0530 drm/amdgpu: Keep non-psp path for partition switch When PSP block is not present, use direct programming. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Acked-by: Mangesh Gadre Tested-by: Mangesh Gadre Signed-off-by: Alex Deucher commit 2dc84508f8c692d455b991a2feee85aa5d647568 Author: Melissa Wen Date: Tue May 23 21:15:16 2023 -0100 drm/amd/display: program DPP shaper and 3D LUT if updated If shaper and 3D LUT data updates, lut_3d bit in update_flag is updated and we need to call set_input_transfer_func to program DPP shaper and 3D LUTs. Small cleanup of code style in the related if-condition. Tested-by: Daniel Wheeler Reviewed-by: Krunoslav Kovac Acked-by: Rodrigo Siqueira Signed-off-by: Melissa Wen Signed-off-by: Alex Deucher commit d6149086b45e150c170beaa4546495fd1880724c Author: Hersen Wu Date: Mon Jun 26 13:40:58 2023 -0400 Revert "drm/amd/display: edp do not add non-edid timings" This change causes regression when eDP and external display in mirror mode. When external display supports low resolution than eDP, use eDP timing to driver external display may cause corruption on external display. This reverts commit e749dd10e5f292061ad63d2b030194bf7d7d452c. Cc: stable@vger.kernel.org Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2655 Signed-off-by: Hersen Wu Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher commit 150c213139fe122c941e3990af7fbe9bd60c5ae3 Author: James Zhu Date: Thu Jun 22 09:58:09 2023 -0400 drm/amdgpu: share drm device for pci amdgpu device with 1st partition device To save render node resoure, share drm device setting for pci amdgpu device with 1st XCP partition device. Signed-off-by: James Zhu Reviewed-by: Christian König Signed-off-by: Alex Deucher commit baf65745aad33812fe151d5c9a77cf360775bca4 Author: Lijo Lazar Date: Wed Jun 21 18:45:37 2023 +0530 drm/amd/pm: Add GFX v9.4.3 unique id to sysfs Expose unique id of GFX v9.4.3 ASICs as device attribute. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit fc8e84a2408fd7bea6265e51545a8bfab1f4592d Author: Lijo Lazar Date: Mon Jun 26 17:37:47 2023 +0530 drm/amd/pm: Enable pp_feature attribute on APUs with GFX v9.4.3 Signed-off-by: Lijo Lazar Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 803f31814f017de50f285efe90fecbb1668391a7 Author: Emily Deng Date: Mon Jun 19 16:09:07 2023 +0800 drm/amdgpu/vcn: Need to unpause dpg before stop dpg Need to unpause dpg first, or it will hit follow error during stop dpg: "[drm] Register(1) [regUVD_POWER_STATUS] failed to reach value 0x00000001 != 0x00000000n" Signed-off-by: Emily Deng Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 67af691626425187822afe862614aefa304d3ff2 Author: Le Ma Date: Tue Jun 27 11:53:34 2023 +0800 drm/amdgpu: remove duplicated doorbell range init for sdma v4.4.2 Handled in earlier phase Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2c7cd280e5c4a626690315a6fbb70b49124d8354 Author: YiPeng Chai Date: Sun Jun 25 10:18:32 2023 +0800 drm/amdgpu: gpu recovers from fatal error in poison mode Fatal error occurs in ras poison mode, mode1 reset is used to recover gpu. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 50a7c8765ca69543ffdbf855de0fd69aea769ccf Author: Alex Deucher Date: Fri Jun 16 17:07:53 2023 -0400 drm/amdgpu: enable mcbp by default on gfx9 It's required for high priority queues. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2535 Reviewed-and-tested-by: Jiadong Zhu Signed-off-by: Alex Deucher commit 02ff519e99fc90f6c9aed50def1b6d65e20c1875 Author: Alex Deucher Date: Fri Jun 16 16:49:04 2023 -0400 drm/amdgpu: make mcbp a per device setting So we can selectively enable it on certain devices. No intended functional change. Reviewed-and-tested-by: Jiadong Zhu Signed-off-by: Alex Deucher commit 5efe0f3eed4f6eeb2a75285b48aee0a75399e6d8 Author: Mario Limonciello Date: Mon Jun 26 10:04:03 2023 -0500 drm/amd: Don't initialize PSP twice for Navi3x PSP functions are already set by psp_early_init() so initializing them a second time is unnecessary. No intended functional changes. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1e66a17ce546eabad753178bbd4175cb52bafca8 Author: Mario Limonciello Date: Fri Jun 23 10:05:22 2023 -0500 Revert "drm/amd: Disable PSR-SU on Parade 0803 TCON" This reverts commit 072030b1783056b5de8b0fac5303a5e9dbc6cfde. This is no longer necessary when using newer DMUB F/W. Cc: stable@vger.kernel.org Cc: Sean Wang Cc: Marc Rossi Cc: Hamza Mahfooz Cc: Tsung-hua (Ryan) Lin Reviewed-by: Leo Li Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit cd2e31a9ab93d13c412a36c6e26811e0f830985b Author: Mario Limonciello Date: Fri Jun 23 10:05:21 2023 -0500 drm/amd/display: Set minimum requirement for using PSR-SU on Phoenix The same parade TCON issue can potentially happen on Phoenix, and the same PSR resilience changes have been ported into the DMUB firmware. Don't allow running PSR-SU unless on the newer firmware. Cc: stable@vger.kernel.org Cc: Sean Wang Cc: Marc Rossi Cc: Hamza Mahfooz Cc: Tsung-hua (Ryan) Lin Signed-off-by: Mario Limonciello Reviewed-by: Leo Li Signed-off-by: Alex Deucher commit c35b6ea8f2ecfa9d775530b70d4e727869099a9c Author: Mario Limonciello Date: Fri Jun 23 10:05:20 2023 -0500 drm/amd/display: Set minimum requirement for using PSR-SU on Rembrandt A number of parade TCONs are causing system hangs when utilized with older DMUB firmware and PSR-SU. Some changes have been introduced into DMUB firmware to add resilience against these failures. Don't allow running PSR-SU unless on the newer firmware. Cc: stable@vger.kernel.org Cc: Sean Wang Cc: Marc Rossi Cc: Hamza Mahfooz Cc: Tsung-hua (Ryan) Lin Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2443 Signed-off-by: Mario Limonciello Reviewed-by: Leo Li Signed-off-by: Alex Deucher commit 274d205cb59f43815542e04b42a9e6d0b9b95eff Author: Mario Limonciello Date: Fri Jun 23 10:05:19 2023 -0500 drm/amd/display: Correct `DMUB_FW_VERSION` macro The `DMUB_FW_VERSION` macro has a mistake in that the revision field is off by one byte. The last byte is typically used for other purposes and not a revision. Cc: stable@vger.kernel.org Cc: Sean Wang Cc: Marc Rossi Cc: Hamza Mahfooz Cc: Tsung-hua (Ryan) Lin Reviewed-by: Leo Li Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit cfc7d8314b7e8fd6bcafa31deaa21ac9ad19494f Author: Evan Quan Date: Wed Jun 21 07:55:45 2023 +0800 drm/amd/pm: fulfill the missing enablement for vega12/vega20 L2H and H2L interrupts The feature mask bit was not correctly cleared. Without that, the L2H and H2L interrupts cannot be enabled. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 2aafcdd6a68f30c85ba6a9600e8a7447c0228e51 Author: Hong-lu Cheng Date: Mon Jun 12 13:48:53 2023 -0400 drm/amd/display: Remove asserts [why] Endless assert caused by LinesInDETChroma=0. [how] Don't floor for LinesInDETChroma=0 Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Hong-lu Cheng Signed-off-by: Alex Deucher commit 2faa3653d6657aedf357ca74c4e58c5768899269 Author: Ilya Bakoulin Date: Fri Jun 2 17:01:23 2023 -0400 drm/amd/display: Work around bad DPCD state on link loss [Why] This display doesn't properly indicate link loss through DPCD bits such as CR_DONE / CHANNEL_EQ_DONE / SYMBOL_LOCKED / INTERLANE_ALIGN_DONE, which all remain set. In addition, DPCD200Eh doesn't match the value of DPCD204h in all cases. For these reasons, we can miss re-training the link, since we don't properly detect link loss with this display. [Why] Add display-specific workaround to read DPCD204h, so that we can detect link loss based on 128b132b-specific status bits in this register. Tested-by: Daniel Wheeler Reviewed-by: Wenjing Liu Acked-by: Rodrigo Siqueira Signed-off-by: Ilya Bakoulin Signed-off-by: Alex Deucher commit 2036b34d4af9e09ed07f79c4e3f27952463e6f4e Author: Zhigang Luo Date: Thu May 18 16:10:00 2023 -0400 drm/amdgpu: port SRIOV VF missed changes port SRIOV VF missed changes from gfx_v9_0 to gfx_v9_4_3. Reviewed-by: Alex Deucher Signed-off-by: Zhigang Luo Signed-off-by: Alex Deucher commit 5c6d52ff4b61e5267b25be714eb5a9ba2a338199 Author: Mario Limonciello Date: Thu Jun 22 22:18:39 2023 -0500 drm/amd: Don't try to enable secure display TA multiple times If the securedisplay TA failed to load the first time, it's unlikely to work again after a suspend/resume cycle or reset cycle and it appears to be causing problems in futher attempts. Fixes: e42dfa66d592 ("drm/amdgpu: Add secure display TA load for Renoir") Reported-by: Filip Hejsek Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2633 Signed-off-by: Mario Limonciello Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit d4300362a66f2dacbf258e4ea233b79449821c24 Author: Mukul Joshi Date: Thu Jun 22 15:24:32 2023 -0400 drm/amdkfd: Update interrupt handling for GFX 9.4.3 For GFX 9.4.3, interrupt handling needs to be updated for: - Interrupt cookie will have a NodeId field. Each KFD node needs to check the NodeId before processing the interrupt. - For CPX mode, there are additional checks of client ID needed to process the interrupt. - Add NodeId to the process drain interrupt. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 570b295248b00c3cf4cf59e397de5cb2361e10c2 Author: Christian König Date: Tue Jun 20 13:18:13 2023 +0200 drm/amdgpu: fix number of fence calculations Since adding gang submit we need to take the gang size into account while reserving fences. Signed-off-by: Christian König Fixes: 4624459c84d7 ("drm/amdgpu: add gang submit frontend v6") Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit af22d6a869cc26b519bfdcd54293c53f2e491870 Author: Hamza Mahfooz Date: Wed Jun 21 15:19:05 2023 -0400 drm/amd/display: perform a bounds check before filling dirty rectangles Currently, it is possible for us to access memory that we shouldn't. Since, we acquire (possibly dangling) pointers to dirty rectangles before doing a bounds check to make sure we can actually accommodate the number of dirty rectangles userspace has requested to fill. This issue is especially evident if a compositor requests both MPO and damage clips at the same time, in which case I have observed a soft-hang. So, to avoid this issue, perform the bounds check before filling a single dirty rectangle and WARN() about it, if it is ever attempted in fill_dc_dirty_rect(). Cc: stable@vger.kernel.org # 6.1+ Fixes: 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support") Reviewed-by: Leo Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 8ef84c1a68a83440b62f78a24f64ab100f6bff7a Author: Lijo Lazar Date: Mon Jun 19 18:04:30 2023 +0530 drm/amd/pm: Provide energy data in 15.625mJ units Publish energy data in 15.625mJ unit for SMU v13.0.6. The same unit is used in Aldebaran also. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b579ea632fcab97986f60d55a161c3e8e94a61cb Author: Lijo Lazar Date: Thu Jun 15 16:23:07 2023 +0530 drm/amdgpu: Modify for_each_inst macro Modify it such that it doesn't change the instance mask parameter. Signed-off-by: Lijo Lazar Acked-by: Victor Skvortsov Signed-off-by: Alex Deucher commit 7f03b1d14d51371fcbb8acba2f8bf037cd8807fa Author: Mangesh Gadre Date: Wed Jun 21 16:55:05 2023 +0800 drm/amdgpu:Remove sdma halt/unhalt during frontdoor load sdma halt/unhalt is performed by psp when frontdoor loading used,so this can be skipped. v2: Instead of removing halt/unhalt completely, driver will do it only during backdoor load. Signed-off-by: Mangesh Gadre Reviewed-by: Lijo Lazar Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit 4ff96bcc0d40b66bf3ddd6010830e9a4f9b85d53 Author: Tao Zhou Date: Wed Jun 21 10:30:43 2023 +0800 drm/amdgpu: check RAS irq existence for VCN/JPEG No RAS irq is allowed. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2da0036ea99bccb27f7fe3cf2aa2900860e9be46 Author: Kenneth Feng Date: Tue Jun 20 11:41:40 2023 +0800 drm/amd/pm: add abnormal fan detection for smu 13.0.0 add abnormal fan detection for smu 13.0.0 Signed-off-by: Kenneth Feng Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 1d7776cc148b9f2f3ebaf1181662ba695a29f639 Author: Xiaogang Chen Date: Mon Jun 19 16:17:02 2023 -0500 drm/amdgpu: remove vm sanity check from amdgpu_vm_make_compute Since we allow kfd and graphic operate on same GPU VM to have interoperation between them GPU VM may have been used by graphic vm operations before kfd turns a GPU VM into a compute VM. Remove vm clean checking at amdgpu_vm_make_compute. Signed-off-by: Xiaogang Chen Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 072030b1783056b5de8b0fac5303a5e9dbc6cfde Author: Mario Limonciello Date: Mon Jun 19 15:04:24 2023 -0500 drm/amd: Disable PSR-SU on Parade 0803 TCON A number of users have reported that there are random hangs occurring caused by PSR-SU specifically on panels that contain the parade 0803 TCON. Users have been able to work around the issue by disabling PSR entirely. To avoid these hangs, disable PSR-SU when this TCON is found. Cc: stable@vger.kernel.org Cc: Sean Wang Cc: Marc Rossi Cc: Hamza Mahfooz Suggested-by: Tsung-hua (Ryan) Lin Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2443 Signed-off-by: Mario Limonciello Reviewed-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit fc133acc43728ad9777d2c4cc43f0cafcb92a461 Author: Mukul Joshi Date: Thu Jun 15 14:43:36 2023 -0400 drm/amdkfd: Enable GWS on GFX9.4.3 Enable GWS capable queue creation for forward progress gaurantee on GFX 9.4.3. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6592d29393e3201053d659248055f7f6e51a9f3c Author: Srinivas Neeli Date: Thu Jun 1 10:52:37 2023 +0530 dt-bindings: watchdog: cdns,wdt-r1p2: Convert cadence watchdog to yaml Convert cadence watchdog bindings to DT schema format using json-schema. Signed-off-by: Srinivas Neeli Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230601052237.2604997-1-srinivas.neeli@amd.com Signed-off-by: Rob Herring commit 533925cb760431cb496a8c965cfd765a1a21d37e Merge: d8b0bd57c2d68 488833ccdcac1 Author: Linus Torvalds Date: Fri Jun 30 09:37:26 2023 -0700 Merge tag 'riscv-for-linus-6.5-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V updates from Palmer Dabbelt: - Support for ACPI - Various cleanups to the ISA string parsing, including making them case-insensitive - Support for the vector extension - Support for independent irq/softirq stacks - Our CPU DT binding now has "unevaluatedProperties: false" * tag 'riscv-for-linus-6.5-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (78 commits) riscv: hibernate: remove WARN_ON in save_processor_state dt-bindings: riscv: cpus: switch to unevaluatedProperties: false dt-bindings: riscv: cpus: add a ref the common cpu schema riscv: stack: Add config of thread stack size riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK riscv: stack: Support HAVE_IRQ_EXIT_ON_IRQ_STACK RISC-V: always report presence of extensions formerly part of the base ISA dt-bindings: riscv: explicitly mention assumption of Zicntr & Zihpm support RISC-V: remove decrement/increment dance in ISA string parser RISC-V: rework comments in ISA string parser RISC-V: validate riscv,isa at boot, not during ISA string parsing RISC-V: split early & late of_node to hartid mapping RISC-V: simplify register width check in ISA string parsing perf: RISC-V: Limit the number of counters returned from SBI riscv: replace deprecated scall with ecall riscv: uprobes: Restore thread.bad_cause riscv: mm: try VMA lock-based page fault handling first riscv: mm: Pre-allocate PGD entries for vmalloc/modules area RISC-V: hwprobe: Expose Zba, Zbb, and Zbs RISC-V: Track ISA extensions per hart ... commit d8b0bd57c2d68eb500f356f0f9228e6183da94ae Merge: b69f0aeb06898 54a11654de163 Author: Linus Torvalds Date: Fri Jun 30 09:20:08 2023 -0700 Merge tag 'powerpc-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc updates from Michael Ellerman: - Extend KCSAN support to 32-bit and BookE. Add some KCSAN annotations - Make ELFv2 ABI the default for 64-bit big-endian kernel builds, and use the -mprofile-kernel option (kernel specific ftrace ABI) for big endian ELFv2 kernels - Add initial Dynamic Execution Control Register (DEXCR) support, and allow the ROP protection instructions to be used on Power 10 - Various other small features and fixes Thanks to Aditya Gupta, Aneesh Kumar K.V, Benjamin Gray, Brian King, Christophe Leroy, Colin Ian King, Dmitry Torokhov, Gaurav Batra, Jean Delvare, Joel Stanley, Marco Elver, Masahiro Yamada, Nageswara R Sastry, Nathan Chancellor, Naveen N Rao, Nayna Jain, Nicholas Piggin, Paul Gortmaker, Randy Dunlap, Rob Herring, Rohan McLure, Russell Currey, Sachin Sant, Timothy Pearson, Tom Rix, and Uwe Kleine-König. * tag 'powerpc-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (76 commits) powerpc: remove checks for binutils older than 2.25 powerpc: Fail build if using recordmcount with binutils v2.37 powerpc/iommu: TCEs are incorrectly manipulated with DLPAR add/remove of memory powerpc/iommu: Only build sPAPR access functions on pSeries powerpc: powernv: Annotate data races in opal events powerpc: Mark writes registering ipi to host cpu through kvm and polling powerpc: Annotate accesses to ipi message flags powerpc: powernv: Fix KCSAN datarace warnings on idle_state contention powerpc: Mark [h]ssr_valid accesses in check_return_regs_valid powerpc: qspinlock: Enforce qnode writes prior to publishing to queue powerpc: qspinlock: Mark accesses to qnode lock checks powerpc/powernv/pci: Remove last IODA1 defines powerpc/powernv/pci: Remove MVE code powerpc/powernv/pci: Remove ioda1 support powerpc: 52xx: Make immr_id DT match tables static powerpc: mpc512x: Remove open coded "ranges" parsing powerpc: fsl_soc: Use of_range_to_resource() for "ranges" parsing powerpc: fsl: Use of_property_read_reg() to parse "reg" powerpc: fsl_rio: Use of_range_to_resource() for "ranges" parsing macintosh: Use of_property_read_reg() to parse "reg" ... commit b69f0aeb068980af983d399deafc7477cec8bc04 Author: Kees Cook Date: Fri Jun 30 09:46:17 2023 +0200 pid: Replace struct pid 1-element array with flex-array For pid namespaces, struct pid uses a dynamically sized array member, "numbers". This was implemented using the ancient 1-element fake flexible array, which has been deprecated for decades. Replace it with a C99 flexible array, refactor the array size calculations to use struct_size(), and address elements via indexes. Note that the static initializer (which defines a single element) works as-is, and requires no special handling. Without this, CONFIG_UBSAN_BOUNDS (and potentially CONFIG_FORTIFY_SOURCE) will trigger bounds checks: https://lore.kernel.org/lkml/20230517-bushaltestelle-super-e223978c1ba6@brauner Cc: Christian Brauner Cc: Jan Kara Cc: Jeff Xu Cc: Andreas Gruenbacher Cc: Daniel Verkamp Cc: "Paul E. McKenney" Cc: Jeff Xu Cc: Andrew Morton Cc: Boqun Feng Cc: Luis Chamberlain Cc: Frederic Weisbecker Reported-by: syzbot+ac3b41786a2d0565b6d5@syzkaller.appspotmail.com [brauner: dropped unrelated changes and remove 0 with NULL cast] Signed-off-by: Kees Cook Signed-off-by: Christian Brauner Signed-off-by: Linus Torvalds commit c93723ada378a63929b3135b4f30483383e88e05 Author: Johan Hovold Date: Fri Jun 30 16:27:17 2023 +0200 ASoC: codecs: wcd934x: drop inline keywords The compiler is generally better at deciding what functions should be inlined than driver authors are. Drop the bogus inline keyword from two functions that were neither very small or used in a single place. Signed-off-by: Johan Hovold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230630142717.5314-6-johan+linaro@kernel.org Signed-off-by: Mark Brown commit cb7d60ab98cfe12fdd6052142176d42682f78540 Author: Johan Hovold Date: Fri Jun 30 16:27:16 2023 +0200 ASoC: codecs: wcd934x: demote impedance printk Demote the MBHC impedance measurement printk, which is only needed for development and debugging, to debug level. While at it, fix the capitalisation of "ohm" and add the missing space before the opening parenthesis. Signed-off-by: Johan Hovold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230630142717.5314-5-johan+linaro@kernel.org Signed-off-by: Mark Brown commit 17d59d9ed832742f9572fe5e77ed3a66f5ae404d Author: Johan Hovold Date: Fri Jun 30 16:27:15 2023 +0200 ASoC: codecs: wcd938x: use dev_printk() for impedance logging Pass the component structure also to the wcd938x_mbhc_get_result_params() helper so that the component device can be used for logging consistently. Signed-off-by: Johan Hovold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230630142717.5314-4-johan+linaro@kernel.org Signed-off-by: Mark Brown commit 5db9fe9562aaefca3c972401a9e3d6454707b1d5 Author: Johan Hovold Date: Fri Jun 30 16:27:14 2023 +0200 ASoC: codecs: wcd938x: drop inline keywords The compiler is generally better at deciding what functions should be inlined than driver authors are. Drop the bogus inline keyword from two functions that were neither very small or used in a single place. Signed-off-by: Johan Hovold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230630142717.5314-3-johan+linaro@kernel.org Signed-off-by: Mark Brown commit e5ce198bd5c6923b6a51e1493b1401f84c24b26d Author: Johan Hovold Date: Fri Jun 30 16:27:13 2023 +0200 ASoC: codecs: wcd938x: fix mbhc impedance loglevel Demote the MBHC impedance measurement printk, which is not an error message, from error to debug level. While at it, fix the capitalisation of "ohm" and add the missing space before the opening parenthesis. Fixes: bcee7ed09b8e ("ASoC: codecs: wcd938x: add Multi Button Headset Control support") Signed-off-by: Johan Hovold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230630142717.5314-2-johan+linaro@kernel.org Signed-off-by: Mark Brown commit 112e7e21519422b6f2bb0fa8061f5685e9757170 Merge: e55e5df193d24 5ee35c769663c Author: Linus Torvalds Date: Fri Jun 30 08:52:28 2023 -0700 Merge tag 'loongarch-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch updates from Huacai Chen: - preliminary ClangBuiltLinux enablement - add support to clone a time namespace - add vector extensions support - add SMT (Simultaneous Multi-Threading) support - support dbar with different hints - introduce hardware page table walker - add jump-label implementation - add rethook and uprobes support - some bug fixes and other small changes * tag 'loongarch-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: (28 commits) LoongArch: Remove five DIE_* definitions in kdebug.h LoongArch: Add uprobes support LoongArch: Use larch_insn_gen_break() for kprobes LoongArch: Add larch_insn_gen_break() to generate break insns LoongArch: Check for AMO instructions in insns_not_supported() LoongArch: Move three functions from kprobes.c to inst.c LoongArch: Replace kretprobe with rethook LoongArch: Add jump-label implementation LoongArch: Select HAVE_DEBUG_KMEMLEAK to support kmemleak LoongArch: Export some arch-specific pm interfaces LoongArch: Introduce hardware page table walker LoongArch: Support dbar with different hints LoongArch: Add SMT (Simultaneous Multi-Threading) support LoongArch: Add vector extensions support LoongArch: Add support to clone a time namespace Makefile: Add loongarch target flag for Clang compilation LoongArch: Mark Clang LTO as working LoongArch: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation LoongArch: vDSO: Use CLANG_FLAGS instead of filtering out '--target=' LoongArch: Tweak CFLAGS for Clang compatibility ... commit 1ed0555850cdaa3113a32891d273f7a859565264 Author: Douglas Anderson Date: Wed Jun 28 12:56:17 2023 -0700 kdb: Handle LF in the command parser The main kdb command parser only handles CR (ASCII 13 AKA '\r') today, but not LF (ASCII 10 AKA '\n'). That means that the kdb command parser can handle terminals that send just CR or that send CR+LF but can't handle terminals that send just LF. The fact that kdb didn't handle LF in the command parser tripped up a tool I tried to use with it. Specifically, I was trying to send a command to my device to resume it from kdb using a ChromeOS tool like: dut-control cpu_uart_cmd:"g" That tool only terminates lines with LF, not CR+LF. Arguably the ChromeOS tool should be fixed. After all, officially kdb seems to be designed such that CR+LF is the official line ending transmitted over the wire and that internally a line ending is just '\n' (LF). Some evidence: * uart_poll_put_char(), which is used by kdb, notices a '\n' and converts it to '\r\n'. * kdb functions specifically use '\r' to get a carriage return without a newline. You can see this in the pager where kdb will write a '\r' and then write over the pager prompt. However, all that being said there's no real harm in accepting LF as a command terminator in the kdb parser and doing so seems like it would improve compatibility. After this, I'd expect that things would work OK-ish with a remote terminal that used any of CR, CR+LF, or LF as a line ending. Someone using CR as a line ending might get some ugliness where kdb wasn't able to overwrite the last line, but basic commands would work. Someone using just LF as a line ending would probably also work OK. A few other notes: - It can be noted that "bash" running on an "agetty" handles LF as a line termination with no complaints. - Historically, kdb's "pager" actually handled either CR or LF fine. A very quick inspection would make one think that kdb's pager actually could have paged down two lines instead of one for anyone using CR+LF, but this is generally avoided because of kdb_input_flush(). - Conceivably one could argue that some of this special case logic belongs in uart_poll_get_char() since uart_poll_put_char() handles the '\n' => '\r\n' conversion. I would argue that perhaps we should eventually do the opposite and move the '\n' => '\r\n' out of uart_poll_put_char(). Having that conversion at such a low level could interfere if we ever want to transfer binary data. In addition, if we truly made uart_poll_get_char() the inverse of uart_poll_put_char() it would convert back to '\n' and (ironically) kdb's parser currently only looks for '\r' to find the end of a command. Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20230628125612.1.I5cc6c3d916195f5bcfdf5b75d823f2037707f5dc@changeid Signed-off-by: Daniel Thompson commit 44f10dbefd5e41b3385af91f855a57aa2afaf40e Merge: 0a30901b0732a e55e5df193d24 Author: Andrew Morton Date: Fri Jun 30 08:41:39 2023 -0700 Merge branch 'master' into mm-hotfixes-stable commit 0a30901b0732a59e038088d3de3e5611db1870d3 Merge: 814bc1de03ea4 6995e2de6891c Author: Andrew Morton Date: Fri Jun 30 08:37:44 2023 -0700 Merge branch 'master' into mm-hotfixes-stable commit 4ad1218bed3d1ea4c5fd28588f8628b92df30ad7 Author: Helge Deller Date: Sun Jun 25 16:06:12 2023 +0200 parisc: Refresh defconfigs Refresh defconfigs and enable some more graphic cards. Signed-off-by: Helge Deller commit bcfaf17f18f2ae956ec4ba831a9c68859e57cf72 Author: Helge Deller Date: Fri Jun 30 16:21:38 2023 +0200 parisc: irq: Add irq-related function declarations Move function declarations for do_cpu_irq_mask(), timer_interrupt() and ipi_interrupt() to header file. Signed-off-by: Helge Deller commit f310f8dd1414d284566ffe47fb8b4379a0d74a64 Author: Helge Deller Date: Fri Jun 30 13:31:48 2023 +0200 parisc: Move init function declarations into header file Clean up the code to not have external function declarations inside the C source files. Reduces warnings when compiled with W=1. Signed-off-by: Helge Deller commit c8080024e0f7654c162fc39d33d5c69e5205960f Author: Helge Deller Date: Fri Jun 30 13:12:58 2023 +0200 parisc: dino: Make dino_init() returning void Signed-off-by: Helge Deller commit 1d72e83d63c792b484ef14901385e06b06d5eda4 Author: Helge Deller Date: Fri Jun 30 13:11:12 2023 +0200 parisc: lba_pci: Mark two variables __maybe_unused Signed-off-by: Helge Deller commit 646d07461513b061fa4aacde47827fb6922db3fb Author: Helge Deller Date: Fri Jun 30 13:08:00 2023 +0200 parisc: unaligned: Include header file to avoid missing prototype warnings Signed-off-by: Helge Deller commit cfb25b82572e4d874eeda59e0d42126a3284c9a4 Author: Helge Deller Date: Fri Jun 30 12:50:26 2023 +0200 parisc: signal: Mark do_notify_resume() and sys_rt_sigreturn() asmlinkage Signed-off-by: Helge Deller commit a7fde0bf938d5839df6d89b39eb7f5d834c703ec Author: Helge Deller Date: Fri Jun 30 12:44:33 2023 +0200 parisc: unwind: Mark start and stop variables __maybe_unused Signed-off-by: Helge Deller commit b62b37d6c15ea785dc88f9c43949628230eba776 Author: Helge Deller Date: Fri Jun 30 12:42:36 2023 +0200 parisc: init: Drop unused variable end_paddr Signed-off-by: Helge Deller commit 7def4239e5eb17c7dee73f42f09b76d9b5f44e3f Author: Helge Deller Date: Fri Jun 30 12:39:03 2023 +0200 parisc: traps: Mark functions static Signed-off-by: Helge Deller commit 5f0c791dcd3c7d324f2fa14f228bdcd156730015 Author: Helge Deller Date: Fri Jun 30 12:37:50 2023 +0200 parisc: processor: Fix kdoc for init_cpu_profiler() Signed-off-by: Helge Deller commit b5d89408b9fb21258f7c371d6d48a674f60f7181 Author: Helge Deller Date: Fri Jun 30 12:36:09 2023 +0200 parisc: sys_parisc: parisc_personality() is called from asm code Signed-off-by: Helge Deller commit 8829428c1680c1ed7313be43b248d99d7123ed48 Author: Helge Deller Date: Fri Jun 30 12:34:25 2023 +0200 parisc: ccio-dma: Fix kdoc and compiler warnings Signed-off-by: Helge Deller commit f28a98779de97e24d5e6fde8fca1273056a14f80 Author: Helge Deller Date: Fri Jun 30 12:33:09 2023 +0200 parisc: pdc_stable: Fix kdoc and compiler warnings Signed-off-by: Helge Deller commit 658e10571231f2ee21fb40deed8a6e48d0220110 Author: Helge Deller Date: Fri Jun 30 12:31:56 2023 +0200 parisc: pci-dma: Make pcxl_alloc_range() static Signed-off-by: Helge Deller commit 9e142b728605dbfad337ed91c0ba374f232a1e04 Author: Helge Deller Date: Fri Jun 30 12:31:14 2023 +0200 parisc: Mark image_size __maybe_unused in perf_write() Signed-off-by: Helge Deller commit 0e466703d96a86d8bc9b6a02bee22a11332431ed Author: Helge Deller Date: Fri Jun 30 12:30:19 2023 +0200 parisc: module: Mark symindex __maybe_unused Signed-off-by: Helge Deller commit 9872fb13022788b7832616dea52a1feb3bcb4bf2 Author: Helge Deller Date: Fri Jun 30 12:28:40 2023 +0200 parisc: pdc_chassis: Fix kdoc warnings Signed-off-by: Helge Deller commit 427585224a866bf4cb3b3857d89d5de5f3518aca Author: Helge Deller Date: Fri Jun 30 12:26:53 2023 +0200 parisc: firmware: Fix kdoc warnings Signed-off-by: Helge Deller commit ac9fb7d2b71d8353603534a5e5cc92f54fd7e219 Author: Helge Deller Date: Fri Jun 30 12:24:37 2023 +0200 parisc: drivers: Fix kdoc warnings Signed-off-by: Helge Deller commit 7d653ad4ce6afd8dacca9deb43a9a9ea9d665444 Author: Helge Deller Date: Fri Jun 30 12:18:45 2023 +0200 parisc: Fold 32-bit compat code into audit_classify_syscall() No need to keep an extra 32-bit audit_classify_syscall() function. Signed-off-by: Helge Deller commit 226b8ab875e18375567fec4e1065a339b7b77c8e Author: Helge Deller Date: Fri Jun 30 12:15:06 2023 +0200 parisc: sba_iommu: Fix kdoc warnings Signed-off-by: Helge Deller commit 99ef0c67bc85e2ea547e2c6c9ed29480cd361446 Author: Helge Deller Date: Wed May 10 22:17:27 2023 +0200 sticon/parisc: Fix STI console on 64-bit only machines Fix the STI console to be able to execute either the 64-bit STI ROM code or the 32-bit STI ROM code. This is necessary on 64-bit only machines (e.g. C8000 workstation) which otherwise won't show the STI text console with HP graphic cards like Visualize-FX5/FX10/FXe. Note that when calling 32-bit code from a 64-bit kernel one needs to copy contents on the CPU stack from high memory down below the 4GB limit. Tested-by: John David Anglin Signed-off-by: Helge Deller commit ededd9d27834ad1f300436c1b78e58ad4fcf5dd7 Author: Helge Deller Date: Sun May 14 13:23:06 2023 +0200 sticon/parisc: Allow 64-bit STI calls in PDC firmware abstration Some 64-bit machines require us to call the STI ROM in 64-bit mode, e.g. with the VisFXe graphic card. This patch allows drivers to use such 64-bit calling conventions. Tested-by: John David Anglin Signed-off-by: Helge Deller commit c9cc4542e1db5a0402b6b95afb65182fd20f6455 Author: Helge Deller Date: Fri Jun 23 08:07:47 2023 +0200 parisc: Default to 8 CPUs for 64-bit kernel I've now seen a 6-way SMP rp4440 machine, so increase minimum number of CPUs to 8 for 64-bit kernels. Signed-off-by: Helge Deller commit c4551d1bddceb76aaaa5aefc236e10c91abfe197 Author: Helge Deller Date: Mon Jun 19 06:32:19 2023 +0200 parisc: Fix missing prototype warning for arch_report_meminfo() Signed-off-by: Helge Deller Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306122223.HHER4zOo-lkp@intel.com/ commit c6d96328fecdda16e12f3b3c33f3677f4bcef89f Author: Helge Deller Date: Fri May 26 10:59:15 2023 +0200 parisc: Add cacheflush() syscall Signed-off-by: Helge Deller commit 40c9c62c85a8b7e58350f2d00649f9e0060150b7 Author: Helge Deller Date: Fri May 26 08:33:02 2023 +0200 parisc: Check if IRQs are disabled when calling arch_local_irq_restore() A trivial check to check if IRQs are on although they should be off. Signed-off-by: Helge Deller commit 2255234460f0575603a171afd878e6a6083b23f1 Author: Helge Deller Date: Fri May 26 08:27:18 2023 +0200 parisc: Move TLB_PTLOCK option to Kconfig.debug Move this debug option to the Kconfig.debug file. Signed-off-by: Helge Deller commit 7c1f23ad34fcdace50275a6aa1e1969b41c6233f Author: Jonas Gorski Date: Thu Jun 29 15:43:05 2023 +0200 spi: bcm-qspi: return error if neither hif_mspi nor mspi is available If neither a "hif_mspi" nor "mspi" resource is present, the driver will just early exit in probe but still return success. Apart from not doing anything meaningful, this would then also lead to a null pointer access on removal, as platform_get_drvdata() would return NULL, which it would then try to dereference when trying to unregister the spi master. Fix this by unconditionally calling devm_ioremap_resource(), as it can handle a NULL res and will then return a viable ERR_PTR() if we get one. The "return 0;" was previously a "goto qspi_resource_err;" where then ret was returned, but since ret was still initialized to 0 at this place this was a valid conversion in 63c5395bb7a9 ("spi: bcm-qspi: Fix use-after-free on unbind"). The issue was not introduced by this commit, only made more obvious. Fixes: fa236a7ef240 ("spi: bcm-qspi: Add Broadcom MSPI driver") Signed-off-by: Jonas Gorski Reviewed-by: Kamal Dasu Link: https://lore.kernel.org/r/20230629134306.95823-1-jonas.gorski@gmail.com Signed-off-by: Mark Brown commit ac192c1a54f9562efe6bac910e6e7aae7b5fbea3 Author: Srinivas Kandagatla Date: Wed Jun 28 10:24:04 2023 +0100 ASoC: qdsp6: q6apm: use dai link pcm id as pcm device number For some reason we ended up with a setup without this flag. This resulted in inconsistent sound card devices numbers which are also not starting as expected at dai_link->id. (Ex: MultiMedia1 pcm ended up with device number 4 instead of 0) With this patch patch now the MultiMedia1 PCM ends up with device number 0 as expected. [This is causing unstable numbering in userspace as other changes go in, which in turn gets noticed by some userspace. There's been multiple values so we can't simply pick one and revert to it. Do not backport since it will introduce a change. -- broonie] Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230628092404.13927-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 85a61b1ce461a3f62f1019e5e6423c393c542bff Author: Johan Hovold Date: Fri Jun 30 14:03:18 2023 +0200 ASoC: codecs: wcd938x: fix codec initialisation race Make sure to resume the codec and soundwire device before trying to read the codec variant and configure the device during component probe. This specifically avoids interpreting (a masked and shifted) -EBUSY errno as the variant: wcd938x_codec audio-codec: ASoC: error at soc_component_read_no_lock on audio-codec for register: [0x000034b0] -16 when the soundwire device happens to be suspended, which in turn prevents some headphone controls from being registered. Fixes: 8d78602aa87a ("ASoC: codecs: wcd938x: add basic driver") Cc: stable@vger.kernel.org # 5.14 Cc: Srinivas Kandagatla Reported-by: Steev Klimaszewski Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20230630120318.6571-1-johan+linaro@kernel.org Signed-off-by: Mark Brown commit b1db244c716fe300e36428aeb0874913d2e0a91d Author: Mastan Katragadda Date: Fri Jun 30 12:35:42 2023 +0530 ASoC: SOF: amd: add revision check for sending sha dma completion command ACP driver should send SHA DMA completion command to PSP module for RN platform only. Add a revision check for RN platform. Signed-off-by: Mastan Katragadda Link: https://lore.kernel.org/r/20230630070544.2167421-1-Mastan.Katragadda@amd.com Signed-off-by: Mark Brown commit 0303c9729afc4094ef53e552b7b8cff7436028d6 Author: Thomas Gleixner Date: Thu Jun 29 21:35:19 2023 +0200 x86/efi: Make efi_set_virtual_address_map IBT safe Niklāvs reported a boot regression on an Alderlake machine and bisected it to commit 9df9d2f0471b ("init: Invoke arch_cpu_finalize_init() earlier"). By moving the invocation of arch_cpu_finalize_init() further down he identified that efi_enter_virtual_mode() is the function which causes the boot hang. The main difference of the earlier invocation is that the boot CPU is already fully initialized and mitigations and alternatives are applied. But the only really interesting change turned out to be IBT, which is now enabled before efi_enter_virtual_mode(). "ibt=off" on the kernel command line cured the problem. Inspection of the involved calls in efi_enter_virtual_mode() unearthed that efi_set_virtual_address_map() is the only place in the kernel which invokes an EFI call without the IBT safe wrapper. This went obviously unnoticed so far as IBT was enabled later. Use arch_efi_call_virt() instead of efi_call() to cure that. Fixes: fe379fa4d199 ("x86/ibt: Disable IBT around firmware") Fixes: 9df9d2f0471b ("init: Invoke arch_cpu_finalize_init() earlier") Reported-by: Niklāvs Koļesņikovs Signed-off-by: Thomas Gleixner Reviewed-by: Ard Biesheuvel Link: https://bugzilla.kernel.org/show_bug.cgi?id=217602 Link: https://lore.kernel.org/r/87jzvm12q0.ffs@tglx commit fa700d73494abbd343c47c6f54837c9874c61bbe Author: Ulf Hansson Date: Fri Jun 30 14:00:15 2023 +0200 mmc: Revert "mmc: core: Allow mmc_start_host() synchronously detect a card" It has turned out that some mmc host drivers were not ready to deal with this change. Let's fix those host drivers first, then we can give this a new try. Fixes: 2cc83bf7d411 (mmc: core: Allow mmc_start_host() synchronously detect a card) Cc: Dennis Zhou Reported-by: Geert Uytterhoeven Reported-by: Biju Das Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20230630120015.363982-1-ulf.hansson@linaro.org commit 257e6172ab36ebbe295a6c9ee9a9dd0fe54c1dc2 Author: Xiubo Li Date: Wed Jun 28 07:57:09 2023 +0800 ceph: don't let check_caps skip sending responses for revoke msgs If a client sends out a cap update dropping caps with the prior 'seq' just before an incoming cap revoke request, then the client may drop the revoke because it believes it's already released the requested capabilities. This causes the MDS to wait indefinitely for the client to respond to the revoke. It's therefore always a good idea to ack the cap revoke request with the bumped up 'seq'. Cc: stable@vger.kernel.org Link: https://tracker.ceph.com/issues/61782 Signed-off-by: Xiubo Li Reviewed-by: Milind Changire Reviewed-by: Patrick Donnelly Signed-off-by: Ilya Dryomov commit ce72d4e0f179340cece90d5b826eb63bbf9fefc0 Author: Xiubo Li Date: Tue Jun 13 12:49:59 2023 +0800 ceph: issue a cap release immediately if no cap exists In case: mds client - Releases cap and put Inode - Increase cap->seq and sends revokes req to the client - Receives release req and - Receives & drops the revoke req skip removing the cap and then eval the CInode and issue or revoke caps again. - Receives & drops the caps update or revoke req - Health warning for client isn't responding to mclientcaps(revoke) All the IMPORT/REVOKE/GRANT cap ops will increase the session seq in MDS side and then the client need to issue a cap release to unblock MDS to remove the corresponding cap to unblock possible waiters. Link: https://tracker.ceph.com/issues/61332 Signed-off-by: Xiubo Li Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit 2d12ad950b0c2a89d82f5d258309ad23aa70fc38 Author: Xiubo Li Date: Thu May 11 13:19:45 2023 +0800 ceph: trigger to flush the buffer when making snapshot The 'i_wr_ref' is used to track the 'Fb' caps, while whenever the 'Fb' caps is took the kclient will always take the 'Fw' caps at the same time. That means it will always be a false check in __ceph_finish_cap_snap(). When writing to buffer the kclient will take both 'Fb|Fw' caps and then write the contents to the buffer pages by increasing the 'i_wrbuffer_ref' and then just release both 'Fb|Fw'. This is different with the user space libcephfs, which will keep the 'Fb' being took and use 'i_wr_ref' instead of 'i_wrbuffer_ref' to track this until the buffer is flushed to Rados. We need to defer flushing the capsnap until the corresponding buffer pages are all flushed to Rados, and at the same time just trigger to flush the buffer pages immediately. Link: https://tracker.ceph.com/issues/48640 Link: https://tracker.ceph.com/issues/59343 Signed-off-by: Xiubo Li Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit dc94bb8f271c079f69583d0f12a489aaf5202751 Author: Xiubo Li Date: Thu May 4 19:00:42 2023 +0800 ceph: fix blindly expanding the readahead windows Blindly expanding the readahead windows will cause unneccessary pagecache thrashing and also will introduce the network workload. We should disable expanding the windows if the readahead is disabled and also shouldn't expand the windows too much. Expanding forward firstly instead of expanding backward for possible sequential reads. Bound `rreq->len` to the actual file size to restore the previous page cache usage. The posix_fadvise may change the maximum size of a file readahead. Cc: stable@vger.kernel.org Fixes: 49870056005c ("ceph: convert ceph_readpages to ceph_readahead") Link: https://lore.kernel.org/ceph-devel/20230504082510.247-1-sehuww@mail.scut.edu.cn Link: https://www.spinics.net/lists/ceph-users/msg76183.html Signed-off-by: Xiubo Li Reviewed-and-tested-by: Hu Weiwen Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit 23ee27dce30e7d3091d6c3143b79f48dab6f9a3e Author: Xiubo Li Date: Wed May 10 19:55:46 2023 +0800 ceph: add a dedicated private data for netfs rreq We need to save the 'f_ra.ra_pages' to expand the readahead window later. Cc: stable@vger.kernel.org Fixes: 49870056005c ("ceph: convert ceph_readpages to ceph_readahead") Link: https://lore.kernel.org/ceph-devel/20230504082510.247-1-sehuww@mail.scut.edu.cn Link: https://www.spinics.net/lists/ceph-users/msg76183.html Signed-off-by: Xiubo Li Reviewed-and-tested-by: Hu Weiwen Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit d9d00f71ab5a2b5a47b228f678a8817e8687387f Author: Xiubo Li Date: Mon Jun 5 14:58:18 2023 +0800 ceph: voluntarily drop Xx caps for requests those touch parent mtime For write requests the parent's mtime will be updated correspondingly. And if the 'Xx' caps is issued and when releasing other caps together with the write requests the MDS Locker will try to eval the xattr lock, which need to change the locker state excl --> sync and need to do Xx caps revocation. Just voluntarily dropping CEPH_CAP_XATTR_EXCL caps to avoid a cap revoke message, which could cause the mtime will be overwrote by stale one. [ idryomov: break unnecessarily long lines ] Link: https://tracker.ceph.com/issues/61584 Signed-off-by: Xiubo Li Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit 8b0da5c549ae63ba1debd92a350f90773cb4bfe7 Author: Xiubo Li Date: Thu May 18 09:40:14 2023 +0800 ceph: try to dump the msgs when decoding fails When the msgs are corrupted we need to dump them and then it will be easier to dig what has happened and where the issue is. Signed-off-by: Xiubo Li Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit f7c2f4f6ce16fb58f7d024f3e1b40023c4b43ff9 Author: Xiubo Li Date: Wed May 31 16:06:55 2023 +0800 ceph: only send metrics when the MDS rank is ready When the MDS rank is in clientreplay state, the metrics requests will be discarded directly. Also, when there are a lot of known client requests to recover from, the metrics requests will slow down the MDS rank from getting to the active state sooner. With this patch, we will send the metrics requests only when the MDS rank is in active state. Link: https://tracker.ceph.com/issues/61524 Signed-off-by: Xiubo Li Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit 1c519980aced3da1fae37c1339cf43b24eccdee7 Author: Marek Vasut Date: Thu Jun 15 22:16:02 2023 +0200 drm/panel: simple: Add Powertip PH800480T013 drm_display_mode flags Add missing drm_display_mode DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC flags. Those are used by various bridges in the pipeline to correctly configure its sync signals polarity. Fixes: d69de69f2be1 ("drm/panel: simple: Add Powertip PH800480T013 panel") Signed-off-by: Marek Vasut Reviewed-by: Sam Ravnborg Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230615201602.565948-1-marex@denx.de commit 67a4e1a3bf7c68ed3fbefc4213648165d912cabb Author: Andy Shevchenko Date: Wed Jun 28 18:02:51 2023 +0300 irqdomain: Use return value of strreplace() Since strreplace() returns the pointer to the string itself, use it directly. Signed-off-by: Andy Shevchenko Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230628150251.17832-1-andriy.shevchenko@linux.intel.com commit 0fcfc9e51990246a9813475716746ff5eb98c6aa Author: Srinivas Pandruvada Date: Thu Jun 29 12:45:09 2023 -0700 cpufreq: intel_pstate: Fix scaling for hybrid-capable systems with disabled E-cores Some system BIOS configuration may provide option to disable E-cores. As part of this change, CPUID feature for hybrid (Leaf 7 sub leaf 0, EDX[15] = 0) may not be set. But HWP performance limits will still be using a scaling factor like any other hybrid enabled system. The current check for applying scaling factor will fail when hybrid CPUID feature is not set and the only way to make sure that scaling should be applied by checking CPPC nominal frequency and nominal performance. First, or systems predating Alder Lake, the CPPC nominal frequency and nominal performance are 0, which can be used to distinguish those systems from hybrid systems with disabled E-cores. Second, if the CPPC nominal frequency and nominal performance are defined, which indicates the need to use a special scaling factor, and the nominal performance value multiplied by 100 is not equal to the nominal frequency one, use hybrid scaling factor. This can be done for all HWP systems without additional CPU model check. Signed-off-by: Srinivas Pandruvada [ rjw: Subject and changelog edits, removal of unneeded parens, comment edits ] Signed-off-by: Rafael J. Wysocki commit 0b76cc3e9081216918d5e7e907cf9efc7a5fa7db Author: Viresh Kumar Date: Fri Jun 30 11:35:41 2023 +0530 cpufreq: Make CONFIG_CPUFREQ_DT_PLATDEV depend on OF The cpufreq-dt-platform.c driver requires CONFIG_OF to be selected. Mark it as a dependency. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306250025.savpMM8L-lkp@intel.com/ Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit e55e5df193d247a38a5e1ac65a5316a0adcc22fa Author: Linus Torvalds Date: Thu Jun 29 23:34:29 2023 -0700 csky: fix up lock_mm_and_find_vma() conversion As already mentioned in my merge message for the 'expand-stack' branch, we have something like 24 different versions of the page fault path for all our different architectures, all just _slightly_ different due to various historical reasons (usually related to exactly when they branched off the original i386 version, and the details of the other architectures they had in their history). And a few of them had some silly mistake in the conversion. Most of the architectures call the faulting address 'address' in the fault path. But not all. Some just call it 'addr'. And if you end up doing a bit too much copy-and-paste, you end up with the wrong version in the places that do it differently. In this case it was csky. Fixes: a050ba1e7422 ("mm/fault: convert remaining simple cases to lock_mm_and_find_vma()") Reported-by: Guenter Roeck Signed-off-by: Linus Torvalds commit 075e333591e6aee7b0008dd6c14c361bb1509821 Merge: ea3f8272876f2 de649e7f5edb2 Author: Linus Torvalds Date: Thu Jun 29 23:21:20 2023 -0700 Merge tag 'memblock-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock Pull memblock updates from Mike Rapoport: - add test for memblock_alloc_node() - minor coding style fixes - add flags and nid info in memblock debugfs * tag 'memblock-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: memblock: Update nid info in memblock debugfs memblock: Add flags and nid info in memblock debugfs Fix some coding style errors in memblock.c Add tests for memblock_alloc_node() commit ea3f8272876f2958463992f6736ab690fde7fa9c Author: Linus Torvalds Date: Thu Jun 29 23:04:57 2023 -0700 parisc: fix expand_stack() conversion In commit 8d7071af8907 ("mm: always expand the stack with the mmap write lock held") I tried to deal with the remaining odd page fault handling cases. The oddest one is ia64, which has stacks that grow both up and down. And because ia64 was _so_ odd, I asked people to verify the end result. But a close second oddity is parisc, which is the only one that has a main stack growing up (our "CONFIG_STACK_GROWSUP" config option). But it looked obvious enough that I didn't worry about it. I should have worried a bit more. Not because it was particularly complex, but because I just used the wrong variable name. The previous vma isn't called "prev", it's called "prev_vma". Blush. Fixes: 8d7071af8907 ("mm: always expand the stack with the mmap write lock held") Signed-off-by: Linus Torvalds commit 887e845f8c1ce5b031dbad95d22e56f2e61bb35c Author: Ian Rogers Date: Fri Jun 23 08:10:16 2023 -0700 perf vendor events intel: Update tigerlake to 1.13 Updates were released in: https://github.com/intel/perfmon/commit/9a3cd5ad68aee46078c663fe0cd9484e3956fd88 Adds the events ICACHE_DATA.STALLS, ICACHE_TAG.STALLS and DECODE.LCP. Descriptions are also updated. Signed-off-by: Ian Rogers Tested-by: Namhyung Kim Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623151016.4193660-13-irogers@google.com Signed-off-by: Namhyung Kim commit b5d2644da65cfc249e4caf820943dfbfb559bce1 Author: Ian Rogers Date: Fri Jun 23 08:10:15 2023 -0700 perf vendor events intel: Update skylakex to 1.31 Updates were released in: https://github.com/intel/perfmon/commit/cdaa69afe7a48a217b1d89320a27efc6e650cec3 Adds the events IDQ.DSB_CYCLES_OK, IDQ.DSB_CYCLES_ANY, ICACHE_TAG.STALLS, DECODE.LCP, LSD.CYCLES_OK. Descriptions are also updated. Signed-off-by: Ian Rogers Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623151016.4193660-12-irogers@google.com Signed-off-by: Namhyung Kim commit ea3eafa08aa73800a095f974ee4bc230ee055083 Author: Ian Rogers Date: Fri Jun 23 08:10:14 2023 -0700 perf vendor events intel: Update skylake to 57 Updates were released in: https://github.com/intel/perfmon/commit/1c3042c13bbfea05abe1ebb6910ae58b2172e9ef Adds the events IDQ.DSB_CYCLES_OK, IDQ.DSB_CYCLES_ANY, ICACHE_TAG.STALLS, DECODE.LCP, LSD.CYCLES_OK. Descriptions are also updated. Signed-off-by: Ian Rogers Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623151016.4193660-11-irogers@google.com Signed-off-by: Namhyung Kim commit 938e4ad3101160481e5502186f95c7469d6bbcbc Author: Ian Rogers Date: Fri Jun 23 08:10:13 2023 -0700 perf vendor events intel: Update sapphirerapids to 1.14 Updates were released in: https://github.com/intel/perfmon/commit/a84850f1fec633002c35838ed34e51e1f0d6a2dd Adds a large number of CXL events like UNC_CHA_TOR_OCCUPANCY.IA_MISS_RFO_CXL_ACC, UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_CXL_ACC, UNC_CHA_TOR_INSERTS.IA_MISS_DRD_CXL_ACC, UNC_CHA_TOR_INSERTS.IA_MISS_RFO_CXL_ACC, UNC_CHA_TOR_INSERTS.IA_MISS_LLCPREFRFO_CXL_ACC, UNC_CHA_TOR_INSERTS.IA_MISS_RFO_PREF_CXL_ACC, UNC_CHA_TOR_INSERTS.IA_MISS_DRD_PREF_CXL_ACC, UNC_CHA_TOR_INSERTS.IA_MISS_LLCPREFDATA_CXL_ACC, UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_PREF_CXL_ACC, UNC_CHA_TOR_OCCUPANCY.IA_MISS_LLCPREFDATA_CXL_ACC, UNC_CHA_TOR_OCCUPANCY.IA_MISS_LLCPREFRFO_CXL_ACC, UNC_CHA_TOR_OCCUPANCY.IA_MISS_RFO_PREF_CXL_ACC, UNC_CHA_TOR_INSERTS.IA_MISS_CXL_ACC, UNC_CHA_TOR_INSERTS.IA_HIT_CXL_ACC, UNC_CHA_TOR_OCCUPANCY.IA_MISS_CXL_ACC, UNC_CHA_TOR_OCCUPANCY.IA_HIT_CXL_ACC. Signed-off-by: Ian Rogers Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623151016.4193660-10-irogers@google.com Signed-off-by: Namhyung Kim commit 663655c91ce195f912957157d7aaa3e8c06e8b14 Author: Ian Rogers Date: Fri Jun 23 08:10:12 2023 -0700 perf vendor events intel: Update icelakex to 1.21 Updates were released in: https://github.com/intel/perfmon/commit/78d47cbbae48a0297a507ae4fea234ff37ff9960 Adds the events ICACHE_DATA.STALLS, ICACHE_TAG.STALLS and DECODE.LCP. Descriptions are also updated. Signed-off-by: Ian Rogers Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623151016.4193660-9-irogers@google.com Signed-off-by: Namhyung Kim commit d1363b9454a32cf615d1a4df920e88cb73763af9 Author: Ian Rogers Date: Fri Jun 23 08:10:11 2023 -0700 perf vendor events intel: Update icelake to 1.19 Updates were released in: https://github.com/intel/perfmon/commit/f3d841189f8964bc240c86301f4c849845630b5b A number of events are deprecated and event descriptions updated. Adds events ICACHE_DATA.STALLS, ICACHE_TAG.STALLS and DECODE.LCP. Signed-off-by: Ian Rogers Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Namhyung Kim Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623151016.4193660-8-irogers@google.com Signed-off-by: Namhyung Kim commit 0c9e39421cd00258f7cd17b25ee5fe177a3088dd Author: Ian Rogers Date: Fri Jun 23 08:10:10 2023 -0700 perf vendor events intel: Update cascadelakex to 1.19 Updates were released in: https://github.com/intel/perfmon/commit/e4f83534f23a69e6da55c672c4d929919688c9b6 Adds the events IDQ.DSB_CYCLES_OK, IDQ.DSB_CYCLES_ANY, ICACHE_TAG.STALLS, DECODE.LCP, LSD.CYCLES_OK. Descriptions are also updated. Signed-off-by: Ian Rogers Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623151016.4193660-7-irogers@google.com Signed-off-by: Namhyung Kim commit dfc83cc8776917fbb8452328b56bb2192421a809 Author: Ian Rogers Date: Fri Jun 23 08:10:09 2023 -0700 perf vendor events intel: Update meteorlake to 1.03 1.03 events were released in: https://github.com/intel/perfmon/commit/501a29e88b57e8b01d610168d0101d6181b15e28 It added a lot of events and all uncore events. Signed-off-by: Ian Rogers Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Namhyung Kim Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623151016.4193660-6-irogers@google.com Signed-off-by: Namhyung Kim commit 7e74ece31af7f701d2cf8c3529633e3620a61c70 Author: Ian Rogers Date: Fri Jun 23 08:10:08 2023 -0700 perf vendor events intel: Add rocketlake events/metrics Add RocketLake events added to Intel perfmon in: https://github.com/intel/perfmon/commit/f5f47dc938d81d5cc491cf8ac1f90bee18e238cf mapfile.csv is updated accordingly with the CPUID matching one previously associated with icelake. Signed-off-by: Ian Rogers Link: https://lore.kernel.org/r/20230623151016.4193660-5-irogers@google.com Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Signed-off-by: Namhyung Kim commit 8076dc8c6818eebbb5029bd77eea9848a3c32f3c Author: Ian Rogers Date: Fri Jun 23 08:10:07 2023 -0700 perf vendor metrics intel: Make transaction metrics conditional Make the transaction metrics conditional on the cycles-tx event being present. This event may not be present when TSX extensions have been disabled. Signed-off-by: Ian Rogers Tested-by: Namhyung Kim Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623151016.4193660-4-irogers@google.com Signed-off-by: Namhyung Kim commit eadc0040a9ebfa2ad6debe6df087c549e6e49bd4 Author: Ian Rogers Date: Fri Jun 23 08:10:06 2023 -0700 perf jevents: Support for has_event function Support for the new has_event function in metrics. Signed-off-by: Ian Rogers Tested-by: Namhyung Kim Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623151016.4193660-3-irogers@google.com Signed-off-by: Namhyung Kim commit 4a4a9bf9075fbc753ab20f05347fd1482d4801e4 Author: Ian Rogers Date: Fri Jun 23 08:10:05 2023 -0700 perf expr: Add has_event function Some events are dependent on firmware/kernel enablement. Allow such events to be detected when the metric is parsed so that the metric's event parsing doesn't fail. Signed-off-by: Ian Rogers Tested-by: Namhyung Kim Cc: Mark Rutland Cc: Eduard Zingerman Cc: Sohom Datta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Edward Baker Cc: Perry Taylor Cc: Samantha Alt Cc: Weilin Wang Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Jing Zhang Cc: Kajol Jain Cc: Alexander Shishkin Cc: Kan Liang Cc: Zhengjun Xing Cc: John Garry Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623151016.4193660-2-irogers@google.com Signed-off-by: Namhyung Kim commit 36cee69f572c72610da2681a358318d0dc9740b0 Author: Namhyung Kim Date: Mon Jun 26 17:02:27 2023 -0700 perf tools: Do not remove addr_location.thread in thread__find_map() The thread__find_map() is to find a map for a given address in the given thread's address space. It searches maps based on the cpu mode and fills various information in the addr_location data structure. It might change al->maps and al->map, but not al->thread. Then I think no reason to not set the al->thread at the beginning. Also get rid of the duplicate 'al->map = NULL' part. Fixes: 0dd5041c9a0ea ("perf addr_location: Add init/exit/copy functions") Acked-by: Ian Rogers Acked-by: James Clark Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Adrian Hunter Cc: Suzuki K Poulose Cc: Mike Leach Cc: Leo Yan Cc: John Garry Cc: Will Deacon Signed-off-by: Namhyung Kim commit 1e6d5dea34325df8dc204575cd0726cd5f2b864f Merge: 7ede5f78a0d74 0a2f6372a43ff Author: Linus Torvalds Date: Thu Jun 29 21:12:20 2023 -0700 Merge tag 'dma-mapping-6.5-2023-06-28' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping updates from Christoph Hellwig: - swiotlb cleanups (Petr Tesarik) - use kvmalloc_array (gaoxu) - a small step towards removing is_swiotlb_active (Christoph Hellwig) - fix a Kconfig typo Sui Jingfeng) * tag 'dma-mapping-6.5-2023-06-28' of git://git.infradead.org/users/hch/dma-mapping: drm/nouveau: stop using is_swiotlb_active swiotlb: use the atomic counter of total used slabs if available swiotlb: remove unused field "used" from struct io_tlb_mem dma-remap: use kvmalloc_array/kvfree for larger dma memory remap dma-mapping: fix a Kconfig typo commit 7ede5f78a0d74b574791c7eb0e2ca6e54b80c93c Merge: 31929ae00890d 5f004bcaee4cb Author: Linus Torvalds Date: Thu Jun 29 21:01:17 2023 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma updates from Jason Gunthorpe: "This cycle saw a focus on rxe and bnxt_re drivers: - Code cleanups for irdma, rxe, rtrs, hns, vmw_pvrdma - rxe uses workqueues instead of tasklets - rxe has better compliance around access checks for MRs and rereg_mr - mana supportst he 'v2' FW interface for RX coalescing - hfi1 bug fix for stale cache entries in its MR cache - mlx5 buf fix to handle FW failures when destroying QPs - erdma HW has a new doorbell allocation mechanism for uverbs that is secure - Lots of small cleanups and rework in bnxt_re: - Use the common mmap functions - Support disassociation - Improve FW command flow - support for 'low latency push'" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (71 commits) RDMA/bnxt_re: Fix an IS_ERR() vs NULL check RDMA/bnxt_re: Fix spelling mistake "priviledged" -> "privileged" RDMA/bnxt_re: Remove duplicated include in bnxt_re/main.c RDMA/bnxt_re: Refactor code around bnxt_qplib_map_rc() RDMA/bnxt_re: Remove incorrect return check from slow path RDMA/bnxt_re: Enable low latency push RDMA/bnxt_re: Reorg the bar mapping RDMA/bnxt_re: Move the interface version to chip context structure RDMA/bnxt_re: Query function capabilities from firmware RDMA/bnxt_re: Optimize the bnxt_re_init_hwrm_hdr usage RDMA/bnxt_re: Add disassociate ucontext support RDMA/bnxt_re: Use the common mmap helper functions RDMA/bnxt_re: Initialize opcode while sending message RDMA/cma: Remove NULL check before dev_{put, hold} RDMA/rxe: Simplify cq->notify code RDMA/rxe: Fixes mr access supported list RDMA/bnxt_re: optimize the parameters passed to helper functions RDMA/bnxt_re: remove redundant cmdq_bitmap RDMA/bnxt_re: use firmware provided max request timeout RDMA/bnxt_re: cancel all control path command waiters upon error ... commit 31929ae00890d921618b0b449722dcdf4a4416cc Merge: d35ac6ac0e80e dbe245cdf5189 Author: Linus Torvalds Date: Thu Jun 29 20:57:27 2023 -0700 Merge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd Pull iommufd updates from Jason Gunthorpe: "Just two syzkaller fixes, both for the same basic issue: using the area pointer during an access forced unmap while the locks protecting it were let go" * tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd: iommufd: Call iopt_area_contig_done() under the lock iommufd: Do not access the area pointer after unlocking commit d35ac6ac0e80e55bcea79af18d935f19a3e8554c Merge: 0b26eadbf200a a7a334076dd72 Author: Linus Torvalds Date: Thu Jun 29 20:51:03 2023 -0700 Merge tag 'iommu-updates-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu updates from Joerg Roedel: "Core changes: - iova_magazine_alloc() optimization - Make flush-queue an IOMMU driver capability - Consolidate the error handling around device attachment AMD IOMMU changes: - AVIC Interrupt Remapping Improvements - Some minor fixes and cleanups Intel VT-d changes from Lu Baolu: - Small and misc cleanups ARM-SMMU changes from Will Deacon: - Device-tree binding updates: - Add missing clocks for SC8280XP and SA8775 Adreno SMMUs - Add two new Qualcomm SMMUs in SDX75 and SM6375 - Workarounds for Arm MMU-700 errata: - 1076982: Avoid use of SEV-based cmdq wakeup - 2812531: Terminate command batches with a CMD_SYNC - Enforce single-stage translation to avoid nesting-related errata - Set the correct level hint for range TLB invalidation on teardown .. and some other minor fixes and cleanups (including Freescale PAMU and virtio-iommu changes)" * tag 'iommu-updates-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (50 commits) iommu/vt-d: Remove commented-out code iommu/vt-d: Remove two WARN_ON in domain_context_mapping_one() iommu/vt-d: Handle the failure case of dmar_reenable_qi() iommu/vt-d: Remove unnecessary (void*) conversions iommu/amd: Remove extern from function prototypes iommu/amd: Use BIT/BIT_ULL macro to define bit fields iommu/amd: Fix DTE_IRQ_PHYS_ADDR_MASK macro iommu/amd: Fix compile error for unused function iommu/amd: Improving Interrupt Remapping Table Invalidation iommu/amd: Do not Invalidate IRT when IRTE caching is disabled iommu/amd: Introduce Disable IRTE Caching Support iommu/amd: Remove the unused struct amd_ir_data.ref iommu/amd: Switch amd_iommu_update_ga() to use modify_irte_ga() iommu/arm-smmu-v3: Set TTL invalidation hint better iommu/arm-smmu-v3: Document nesting-related errata iommu/arm-smmu-v3: Add explicit feature for nesting iommu/arm-smmu-v3: Document MMU-700 erratum 2812531 iommu/arm-smmu-v3: Work around MMU-600 erratum 1076982 dt-bindings: arm-smmu: Add SDX75 SMMU compatible dt-bindings: arm-smmu: Add SM6375 GPU SMMU ... commit 0b26eadbf200abf6c97c6d870286c73219cdac65 Author: Linus Torvalds Date: Thu Jun 29 20:41:24 2023 -0700 sparc32: fix lock_mm_and_find_vma() conversion The sparc32 conversion to lock_mm_and_find_vma() in commit a050ba1e7422 ("mm/fault: convert remaining simple cases to lock_mm_and_find_vma()") missed the fact that we didn't actually have a 'regs' pointer available in the 'force_user_fault()' case. It's there in the regular page fault path ("do_sparc_fault()"), but not the window underflow/overflow paths. Which is all fine - we can just pass in a NULL pointer. The register state is only used to avoid deadlock with kernel faults, which is not the case for any of these register window faults. Reported-by: Stephen Rothwell Fixes: a050ba1e7422 ("mm/fault: convert remaining simple cases to lock_mm_and_find_vma()") Signed-off-by: Linus Torvalds commit 08fc75735fda3be97194bfbf3c899c87abb3d0fe Author: Zhengchao Shao Date: Fri Jun 30 09:26:47 2023 +0800 mlxsw: minimal: fix potential memory leak in mlxsw_m_linecards_init The line cards array is not freed in the error path of mlxsw_m_linecards_init(), which can lead to a memory leak. Fix by freeing the array in the error path, thereby making the error path identical to mlxsw_m_linecards_fini(). Fixes: 01328e23a476 ("mlxsw: minimal: Extend module to port mapping with slot index") Signed-off-by: Zhengchao Shao Reviewed-by: Petr Machata Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20230630012647.1078002-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit 82a2a51055895f419a3aaba15ffad419063191f0 Merge: 43ec8a620b382 554588e8e932e Author: Linus Torvalds Date: Thu Jun 29 17:44:56 2023 -0700 Merge tag 'sysctl-6.5-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull sysctl fix from Luis Chamberlain: "A missed minor fix which Matthieu Baerts noted I had not picked up" * tag 'sysctl-6.5-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: sysctl: fix unused proc_cap_handler() function warning commit 43ec8a620b38291c959afb47816cf2de6207125a Merge: 3ad7b12c72ae6 6c26bd4384da2 Author: Linus Torvalds Date: Thu Jun 29 17:38:54 2023 -0700 Merge tag 'unmap-fix-20230629' of git://git.infradead.org/users/dwmw2/linux Pull mm fix from David Woodhouse: "Fix error return from do_vmi_align_munmap()" * tag 'unmap-fix-20230629' of git://git.infradead.org/users/dwmw2/linux: mm/mmap: Fix error return in do_vmi_align_munmap() commit 3ad7b12c72ae6ba34d452e88a60c37c9fb368fbb Merge: 2eb15b42482bb d34a271accf8f Author: Linus Torvalds Date: Thu Jun 29 17:36:00 2023 -0700 Merge tag 'trace-v6.4-rc7-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fix from Steven Rostedt: "Fix user event write on buffer disabled. The user events write currently returns the size of what was supposed to be written when tracing is disabled and nothing was written. Instead, behave like trace_marker and return -EBADF, as that is what is returned if a file is opened for read only, and a write is performed on it. Writing to the buffer that is disabled is like trying to write to a file opened for read only, as the buffer still can be read, but just not written to. This also includes test cases for this use case" * tag 'trace-v6.4-rc7-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: selftests/user_events: Add test cases when event is disabled selftests/user_events: Enable the event before write_fault test in ftrace self-test tracing/user_events: Fix incorrect return value for writing operation when events are disabled commit 59bba51ec2a50e3dc5c3ee80f0a23207346303ff Author: Cong Yang Date: Tue Jun 27 13:01:48 2023 +0800 drm/panel: Fine tune Starry-ili9882t panel HFP and HBP Because the setting of hporch is too small, there will be warning in kernel log[1]. After fine tune the HFP and HBP, this warning can be solved. The actual measurement frame rate is 60.1Hz. [1]: WARNING kernel:[drm] HFP + HBP less than d-phy, FPS will under 60Hz Fixes: 8716a6473e6c ("drm/panel: Support for Starry-ili9882t TDDI MIPI-DSI panel") Signed-off-by: Cong Yang Reviewed-by: Neil Armstrong Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230627050148.2045691-1-yangcong5@huaqin.corp-partner.google.com commit 3cf62c8177adb0db9e15c8b898c44f997acf3ebf Author: Pawel Dembicki Date: Wed Jun 28 21:43:27 2023 +0200 net: dsa: vsc73xx: fix MTU configuration Switch in MAXLEN register stores the maximum size of a data frame. The MTU size is 18 bytes smaller than the frame size. The current settings are causing problems with packet forwarding. This patch fixes the MTU settings to proper values. Fixes: fb77ffc6ec86 ("net: dsa: vsc73xx: make the MTU configurable") Reviewed-by: Linus Walleij Signed-off-by: Pawel Dembicki Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20230628194327.1765644-1-paweldembicki@gmail.com Signed-off-by: Jakub Kicinski commit 2eb15b42482bbbaa0fd611741e687c2feee21f2c Merge: 06697ca69bcaa b5539eb5ee702 Author: Linus Torvalds Date: Thu Jun 29 17:32:59 2023 -0700 Merge tag 'acpi-6.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Fix suspend-to-idle breakage on multiple systems introduced by one of the recent commits that may cause the affected systems to overheat while suspended" * tag 'acpi-6.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: EC: Fix acpi_ec_dispatch_gpe() commit 06697ca69bcaa76046be14684f513a89d2c7a240 Author: Ingo Molnar Date: Wed Jun 28 11:16:03 2023 +0200 objtool: Remove btrfs_assertfail() from the noreturn exceptions list The objtool merge in commit 6f612579be9d ("Merge tag 'objtool-core ...") generated a semantic conflict that was not resolved. The btrfs_assertfail() entry was removed from the noreturn list in commit b831306b3b7d ("btrfs: print assertion failure report and stack trace from the same line") because btrfs_assertfail() was changed from a noreturn function into a macro. The noreturn list was then moved from check.c to noreturns.h in commit 6245ce4ab670 ("objtool: Move noreturn function list to separate file"), and should be removed from that post-merge as well. Do it explicitly. Cc: David Sterba Cc: Josh Poimboeuf Cc: Peter Zijlstra Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar Signed-off-by: Linus Torvalds commit 632f54b4d60bfe0701f43d0bc387928de6e3dcfb Merge: bf1fa6f15553d 7bc162d5cc4de Author: Linus Torvalds Date: Thu Jun 29 16:34:12 2023 -0700 Merge tag 'slab-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab Pull slab updates from Vlastimil Babka: - SLAB deprecation: Following the discussion at LSF/MM 2023 [1] and no objections, the SLAB allocator is deprecated by renaming the config option (to make its users notice) to CONFIG_SLAB_DEPRECATED with updated help text. SLUB should be used instead. Existing defconfigs with CONFIG_SLAB are also updated. - SLAB_NO_MERGE kmem_cache flag (Jesper Dangaard Brouer): There are (very limited) cases where kmem_cache merging is undesirable, and existing ways to prevent it are hacky. Introduce a new flag to do that cleanly and convert the existing hacky users. Btrfs plans to use this for debug kernel builds (that use case is always fine), networking for performance reasons (that should be very rare). - Replace the usage of weak PRNGs (David Keisar Schmidt): In addition to using stronger RNGs for the security related features, the code is a bit cleaner. - Misc code cleanups (SeongJae Parki, Xiongwei Song, Zhen Lei, and zhaoxinchao) Link: https://lwn.net/Articles/932201/ [1] * tag 'slab-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: mm/slab_common: use SLAB_NO_MERGE instead of negative refcount mm/slab: break up RCU readers on SLAB_TYPESAFE_BY_RCU example code mm/slab: add a missing semicolon on SLAB_TYPESAFE_BY_RCU example code mm/slab_common: reduce an if statement in create_cache() mm/slab: introduce kmem_cache flag SLAB_NO_MERGE mm/slab: rename CONFIG_SLAB to CONFIG_SLAB_DEPRECATED mm/slab: remove HAVE_HARDENED_USERCOPY_ALLOCATOR mm/slab_common: Replace invocation of weak PRNG mm/slab: Replace invocation of weak PRNG slub: Don't read nr_slabs and total_objects directly slub: Remove slabs_node() function slub: Remove CONFIG_SMP defined check slub: Put objects_show() into CONFIG_SLUB_DEBUG enabled block slub: Correct the error code when slab_kset is NULL mm/slab: correct return values in comment for _kmem_cache_create() commit fe77cc2e5a6a7c85f5c6ef8a39d7694ffc7f41c9 Author: Yang Li Date: Thu Jun 29 10:11:18 2023 +0800 cxl: Fix one kernel-doc comment Fix a merge error that updated the argument to cxl_mem_get_fw_info() but not the kernel-doc. drivers/cxl/core/memdev.c:678: warning: Function parameter or member 'mds' not described in 'cxl_mem_get_fw_info' drivers/cxl/core/memdev.c:678: warning: Excess function parameter 'cxlds' description in 'cxl_mem_get_fw_info' Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20230629021118.102744-1-yang.lee@linux.alibaba.com Signed-off-by: Dan Williams commit bf1fa6f15553df04f2bdd06190ccd5f388ab0777 Merge: 0873694a33982 c1d57ee6eb996 Author: Linus Torvalds Date: Thu Jun 29 15:28:33 2023 -0700 Merge tag 'soc-arm-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC updates from Arnd Bergmann: "These are mostly minor cleanups and bugfixes that address harmless problems. The largest branch is a conversion of the omap platform to use GPIO descriptors throughout the tree, for any devices that are not fully converted to devicetree. The Samsung Exynos platform gains back support for the Exynos4212 chip that was previously unused and removed but is now used for the Samsung Galaxy Tab3" * tag 'soc-arm-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (24 commits) ARM: omap2: Fix copy/paste bug MAINTAINERS: Replace my email address Input: ads7846 - fix pointer cast warning Input: ads7846 - Fix usage of match data ARM: omap2: Fix checkpatch issues arm: omap1: replace printk() with pr_err macro ARM: omap: Fix checkpatch issues ARM: s3c: Switch i2c drivers back to use .probe() ARM: versatile: mark mmc_status() static ARM: spear: include "pl080.h" for pl080_get_signal() prototype ARM: sa1100: address missing prototype warnings ARM: pxa: fix missing-prototypes warnings ARM: orion5x: fix d2net gpio initialization ARM: omap2: fix missing tick_broadcast() prototype ARM: omap1: add missing include ARM: lpc32xx: add missing include ARM: imx: add missing include ARM: highbank: add missing include ARM: ep93xx: fix missing-prototype warnings ARM: davinci: fix davinci_cpufreq_init() declaration ... commit 0873694a339821277d9f2cae7ef981a1283b44f5 Merge: e4c8d01865118 2b24391767ae6 Author: Linus Torvalds Date: Thu Jun 29 15:26:45 2023 -0700 Merge tag 'soc-defconfig-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC defconfig updates from Arnd Bergmann: "The arm64 defconfig file gets the usual updates to enable addition device drivers as well as the sparx5 and realtek SoC platforms. For arm32, there are only a couple of cleanup patches for imx, renesas and rockchips" * tag 'soc-defconfig-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (23 commits) arm64: defconfig: Enable Rockchip I2S TDM and ES8316 drivers arm64: defconfig: update RK8XX MFD config ARM: multi_v7_defconfig: update MFD_RK808 name arm64: defconfig: Enable UBIFS arm64: defconfig: enable drivers for Verdin AM62 arm64: defconfig: Build SM6115 display and GPU clock controller drivers arm64: defconfig: Build display clock controller driver for QCM2290 arm64: defconfig: Build interconnect driver for QCM2290 arm64: defconfig: Build Global Clock Controller driver for QCM2290 arm64: defconfig: Build MSM power manager driver arm64: defconfig: Enable sc828x0xp lpasscc clock controller arm64: defconfig: Enable the TI SN65DSI83 driver arm64: defconfig: Enable Renesas MTU3a counter config arm64: defconfig: enable Mediatek PMIC key arm64: defconfig: enable MT6357 regulator ARM: imx_v6_v7_defconfig: Remove KERNEL_LZO config arm64: defconfig: Enable ipq6018 apss clock and PLL controller arm64: defconfig: Enable ARCH_SPARX5 and ARCH_REALTEK arm64: defconfig: enable FSA4480 driver as module ARM: shmobile: defconfig: Refresh for v6.4-rc1 ... commit e4c8d01865118ab148f77bdb54ec9c0c181d90a3 Merge: a9025a5f16ed6 356fa4975950d Author: Linus Torvalds Date: Thu Jun 29 15:22:19 2023 -0700 Merge tag 'soc-drivers-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC driver updates from Arnd Bergmann: "Nothing surprising in the SoC specific drivers, with the usual updates: - Added or improved SoC driver support for Tegra234, Exynos4121, RK3588, as well as multiple Mediatek and Qualcomm chips - SCMI firmware gains support for multiple SMC/HVC transport and version 3.2 of the protocol - Cleanups amd minor changes for the reset controller, memory controller, firmware and sram drivers - Minor changes to amd/xilinx, samsung, tegra, nxp, ti, qualcomm, amlogic and renesas SoC specific drivers" * tag 'soc-drivers-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (118 commits) dt-bindings: interrupt-controller: Convert Amlogic Meson GPIO interrupt controller binding MAINTAINERS: add PHY-related files to Amlogic SoC file list drivers: meson: secure-pwrc: always enable DMA domain tee: optee: Use kmemdup() to replace kmalloc + memcpy soc: qcom: geni-se: Do not bother about enable/disable of interrupts in secondary sequencer dt-bindings: sram: qcom,imem: document qdu1000 soc: qcom: icc-bwmon: Fix MSM8998 count unit dt-bindings: soc: qcom,rpmh-rsc: Require power-domains soc: qcom: socinfo: Add Soc ID for IPQ5300 dt-bindings: arm: qcom,ids: add SoC ID for IPQ5300 soc: qcom: Fix a IS_ERR() vs NULL bug in probe soc: qcom: socinfo: Add support for new fields in revision 19 soc: qcom: socinfo: Add support for new fields in revision 18 dt-bindings: firmware: scm: Add compatible for SDX75 soc: qcom: mdt_loader: Fix split image detection dt-bindings: memory-controllers: drop unneeded quotes soc: rockchip: dtpm: use C99 array init syntax firmware: tegra: bpmp: Add support for DRAM MRQ GSCs soc/tegra: pmc: Use devm_clk_notifier_register() soc/tegra: pmc: Simplify debugfs initialization ... commit 554588e8e932e7a0fac7d3ae2132f2b727d9acfe Author: Arnd Bergmann Date: Wed Jun 7 14:08:54 2023 +0200 sysctl: fix unused proc_cap_handler() function warning Since usermodehelper_table() is marked static now, we get a warning about it being unused when SYSCTL is disabled: kernel/umh.c:497:12: error: 'proc_cap_handler' defined but not used [-Werror=unused-function] Just move it inside of the same #ifdef. Signed-off-by: Arnd Bergmann Tested-by: Matthieu Baerts Fixes: 861dc0b46432 ("sysctl: move umh sysctl registration to its own file") Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested [mcgrof: adjust new commit ID for Fixes tag] Signed-off-by: Luis Chamberlain commit a9025a5f16ed610ea28a188cb0946cb71fafff17 Merge: 6c1561fb90052 f50a000b42195 Author: Linus Torvalds Date: Thu Jun 29 15:11:17 2023 -0700 Merge tag 'soc-newsoc-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull new ARM SoC support from Arnd Bergmann: "There are two new SoC families this time, and both appear fairly similar: The Nuvoton MA35D1 and the STMicroelectronics STM32MP2 are both dual-core Cortex-A35 based chips for the low-power industrial embedded market, and they mark the first 64-bit product in a widely used family of 32-bit Arm MCUs and SoCs. The way into the kernel is completely different here: The team at ST has a long history of working upstream with their STM32MP1 and other SoCs, and they produced a complete port to arm64 together with the initial announcement. Nuvoton also has multiple SoC product lines with current or previous upstream support, but those are maintained by third parties and are unrelated. The patch series from Nuvoton's Jacky Huang had to go through many revisisions to get to this point and is still missing a few drivers including the serial port for the moment. The branch contains the devicetree files as well as all the code changes, in order to have something that can be tested standalone" * tag 'soc-newsoc-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (25 commits) clk: nuvoton: Use clk_parent_data instead of string for parent clock clk: nuvoton: Update all constant hex values to lowercase clk: nuvoton: Add clk-ma35d1.h for driver extern functions remoteproc: stm32: use correct format strings on 64-bit MAINTAINERS: add entry for ARM/STM32 ARCHITECTURE arm64: defconfig: enable ARCH_STM32 and STM32 serial driver arm64: dts: st: add stm32mp257f-ev1 board support dt-bindings: stm32: document stm32mp257f-ev1 board arm64: dts: st: introduce stm32mp25 pinctrl files arm64: dts: st: introduce stm32mp25 SoCs family arm64: introduce STM32 family on Armv8 architecture dt-bindings: stm32: add st,stm32mp25-syscfg compatible for syscon pinctrl: stm32: add stm32mp257 pinctrl support dt-bindings: pinctrl: stm32: support for stm32mp257 and additional packages Documentation/process: add soc maintainer handbook reset: RESET_NUVOTON_MA35D1 should depend on ARCH_MA35 reset: Add Nuvoton ma35d1 reset driver support clk: nuvoton: Add clock driver for ma35d1 clock controller arm64: dts: nuvoton: Add initial ma35d1 device tree dt-bindings: serial: Document ma35d1 uart controller ... commit 6c1561fb900524c5bceb924071b3e9b8a67ff3da Merge: b775d6c5859af 46448b36ff8c8 Author: Linus Torvalds Date: Thu Jun 29 15:07:06 2023 -0700 Merge tag 'soc-dt-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC devicetree updates from Arnd Bergmann: "The biggest change this time is for the 32-bit devicetree files, which are all moved to a new location, using separate subdirectories for each SoC vendor, following the same scheme that is used on arm64, mips and riscv. This has been discussed for many years, but so far we never did this as there was a plan to move the files out of the kernel entirely, which has never happened. The impact of this will be that all external patches no longer apply, and anything depending on the location of the dtb files in the build directory will have to change. The installed files after 'make dtbs_install' keep the current location. There are six added SoCs here that are largely variants of previously added chips. Two other chips are added in a separate branch along with their device drivers. - The Samsung Exynos 4212 makes its return after the Samsung Galaxy Express phone is addded at last. The SoC support was originally added in 2012 but removed again in 2017 as it was unused at the time. - Amlogic C3 is a Cortex-A35 based smart IP camera chip - Qualcomm MSM8939 (Snapdragon 615) is a more featureful variant of the still common MSM8916 (Snapdragon 410) phone chip that has been supported for a long time. - Qualcomm SC8180x (Snapdragon 8cx) is one of their earlier high-end laptop chips, used in the Lenovo Flex 5G, which is added along with the reference board. - Qualcomm SDX75 is the latest generation modem chip that is used as a peripherial in phones but can also run a standalone Linux. Unlike the prior 32-bit SDX65 and SDX55, this now has a 64-bit Cortex-A55. - Alibaba T-Head TH1520 is a quad-core RISC-V chip based on the Xuantie C910 core, a step up from all previously added rv64 chips. All of the above come with reference board implementations, those included there are 39 new board files, but only five more 32-bit this time, probably a new low: - Marantec Maveo board based on dhcor imx6ull module - Endian 4i Edge 200, based on the armv5 Marvell Kirkwood chip - Epson Moverio BT-200 AR glasses based on TI OMAP4 - PHYTEC STM32MP1-3 Dev board based on STM32MP15 PHYTEC SOM - ICnova ADB4006 board based on Allwinner A20 On the 64-bit side, there are also fewer addded machines than we had in the recent releases: - Three boards based on NXP i.MX8: Emtop SoM & Baseboard, NXP i.MX8MM EVKB board and i.MX8MP based Gateworks Venice gw7905-2x device. - NVIDIA IGX Orin and Jetson Orin Nano boards, both based on tegra234 - Qualcomm gains support for 6 reference boards on various members of their IPQ networking SoC series, as well as the Sony Xperia M4 Aqua phone, the Acer Aspire 1 laptop, and the Fxtec Pro1X board on top of the various reference platforms for their new chips. - Rockchips support for several newer boards: Indiedroid Nova (rk3588), Edgeble Neural Compute Module 6B (rk3588), FriendlyARM NanoPi R2C Plus (rk3328), Anbernic RG353PS (rk3566), Lunzn Fastrhino R66S/R68S (rk3568) - TI K3/AM625 based PHYTEC phyBOARD-Lyra-AM625 board and Toradex Verdin family with AM62 COM, carrier and dev boards Other changes to existing boards contain the usual minor improvements along with - continued updates to clean up dts files based on dtc warnings and binding checks, in particular cache properties and node names - support for devicetree overlays on at91, bcm283x - significant additions to existing SoC support on mediatek, qualcomm, ti k3 family, starfive jh71xx, NXP i.MX6 and i.MX8, ST STM32MP1 As usual, a lot more detail is available in the individual merge commits" * tag 'soc-dt-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (926 commits) ARM: mvebu: fix unit address on armada-390-db flash ARM: dts: Move .dts files to vendor sub-directories kbuild: Support flat DTBs install ARM: dts: Add .dts files missing from the build ARM: dts: allwinner: Use quoted #include ARM: dts: lan966x: kontron-d10: add PHY interrupts ARM: dts: lan966x: kontron-d10: fix SPI CS ARM: dts: lan966x: kontron-d10: fix board reset ARM: dts: at91: Enable device-tree overlay support for AT91 boards arm: dts: Enable device-tree overlay support for AT91 boards arm64: dts: exynos: Remove clock from Exynos850 pmu_system_controller ARM: dts: at91: use generic name for shutdown controller ARM: dts: BCM5301X: Add cells sizes to PCIe nodes dt-bindings: firmware: brcm,kona-smc: convert to YAML riscv: dts: sort makefile entries by directory riscv: defconfig: enable T-HEAD SoC MAINTAINERS: add entry for T-HEAD RISC-V SoC riscv: dts: thead: add sipeed Lichee Pi 4A board device tree riscv: dts: add initial T-HEAD TH1520 SoC device tree riscv: Add the T-HEAD SoC family Kconfig option ... commit b775d6c5859affe00527cbe74263de05cfe6b9f9 Merge: 18f38fedfa71b e47084e116fcc Author: Linus Torvalds Date: Thu Jun 29 15:01:51 2023 -0700 Merge tag 'mips_6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS updates from Thomas Bogendoerfer: - add support for TP-Link HC220 G5 v1 - add support for Wifi/Bluetooth on CI20 - rework Ralink clock and reset handling - cleanups and fixes * tag 'mips_6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (58 commits) MIPS: Loongson64: DTS: Add RTC support to Loongson-2K1000 MIPS: Loongson64: DTS: Add RTC support to LS7A PCH MIPS: OCTEON: octeon-usb: cleanup divider calculation MIPS: OCTEON: octeon-usb: introduce dwc3_octeon_{read,write}q MIPS: OCTEON: octeon-usb: move gpio config to separate function MIPS: OCTEON: octeon-usb: use bitfields for shim register MIPS: OCTEON: octeon-usb: use bitfields for host config register MIPS: OCTEON: octeon-usb: use bitfields for control register MIPS: OCTEON: octeon-usb: add all register offsets mips: ralink: match all supported system controller compatible strings MIPS: dec: prom: Address -Warray-bounds warning MIPS: DTS: CI20: Raise VDDCORE voltage to 1.125 volts clk: ralink: mtmips: Fix uninitialized use of ret in mtmips_register_{fixed,factor}_clocks() mips: ralink: introduce commonly used remap node function mips: pci-mt7620: use dev_info() to log PCIe device detection result mips: pci-mt7620: do not print NFTS register value as error log MAINTAINERS: add Mediatek MTMIPS Clock maintainer mips: ralink: get cpu rate from new driver code mips: ralink: remove reset related code mips: ralink: mt7620: remove clock related code ... commit 18f38fedfa71b5b7e954fc8f1e31bda75d8f1d7c Merge: c6b0271053e7a ecdb004843ed9 Author: Linus Torvalds Date: Thu Jun 29 14:58:26 2023 -0700 Merge tag 'devicetree-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: "Bindings: - Add some missing type definitions to properties - Drop unneeded quotes and use absolute paths in bindings - Remove redundant "binding" or "schema" in binding titles - Add bindings for Ralink SoCs interrupt controller, QCA2066 Bluetooth, infineon,irps5401, new NXP i.MX GPT variants, shineworld lh133k MIPI SPI panel, Socionext Synquacer platforms, RK3588 PCIe, ST M95640 EEPROM, and FSL DCP crypto variants, and Arm Cortex-R52 DT core: - Improve the reserved-memory range allocation to maximize contiguous space - Use device_set_node() helper in place of open coding" * tag 'devicetree-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (40 commits) dt-bindings: interrupt-controller: add Ralink SoCs interrupt controller dt-bindings: PCI: dwc: rockchip: Update for RK3588 dt-bindings: auxdisplay: holtek: Add missing type for "linux,no-autorepeat" dt-bindings: input: mediatek,pmic-keys: Fix typo in "linux,keycodes" property name dt-bindings: pwm: drop unneeded quotes dt-bindings: crypto: drop unneeded quotes dt-bindings: arm: socionext: add Synquacer platforms dt-bindings: connector: usb: allow a single HS port dt-bindings: bus: ti-sysc: fix typo of: reserved_mem: Use stable allocation order of: reserved_mem: Try to keep range allocations contiguous dt-bindings: arm: drop unneeded quotes and use absolute /schemas path dt-bindings: firmware: arm,scmi: drop unneeded quotes and use absolute /schemas path dt-bindings: dvfs: drop unneeded quotes dt-bindings: gpu: drop unneeded quotes dt-bindings: i3c: silvaco,i3c-master: drop unneeded quotes dt-bindings: rockchip: grf: drop unneeded quotes dt-bindings: spmi: mtk,spmi-mtk-pmif: drop unneeded quotes dt-bindings: Remove last usage of "binding" or "schema" in titles dt-bindings: display: panel: mipi-dbi-spi: add spi-3wire property ... commit c6b0271053e7a5ae57511363213777f706b60489 Merge: 18c9901d7435b 028f6055c9125 Author: Linus Torvalds Date: Thu Jun 29 13:39:51 2023 -0700 Merge tag 'fs_for_v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull misc filesystem updates from Jan Kara: - Rewrite kmap_local() handling in ext2 - Convert ext2 direct IO path to iomap (with some infrastructure tweaks associated with that) - Convert two boilerplate licenses in udf to SPDX identifiers - Other small udf, ext2, and quota fixes and cleanups * tag 'fs_for_v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: udf: Fix uninitialized array access for some pathnames ext2: Drop fragment support quota: fix warning in dqgrab() quota: Properly disable quotas when add_dquot_ref() fails fs: udf: udftime: Replace LGPL boilerplate with SPDX identifier fs: udf: Replace GPL 2.0 boilerplate license notice with SPDX identifier fs: Drop wait_unfrozen wait queue ext2_find_entry()/ext2_dotdot(): callers don't need page_addr anymore ext2_{set_link,delete_entry}(): don't bother with page_addr ext2_put_page(): accept any pointer within the page ext2_get_page(): saner type ext2: use offset_in_page() instead of open-coding it as subtraction ext2_rename(): set_link and delete_entry may fail ext2: Add direct-io trace points ext2: Move direct-io to use iomap ext2: Use generic_buffers_fsync() implementation ext4: Use generic_buffers_fsync_noflush() implementation fs/buffer.c: Add generic_buffers_fsync*() implementation ext2/dax: Fix ext2_setsize when len is page aligned commit 18c9901d7435b20b13357907bac2c0e3b0fd4cd6 Merge: 0a37714f96d57 7b8c9d7bb4570 Author: Linus Torvalds Date: Thu Jun 29 13:31:44 2023 -0700 Merge tag 'fsnotify_for_v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify updates from Jan Kara: - Support for fanotify events returning file handles for filesystems not exportable via NFS - Improved error handling exportfs functions - Add missing FS_OPEN events when unusual open helpers are used * tag 'fsnotify_for_v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fsnotify: move fsnotify_open() hook into do_dentry_open() exportfs: check for error return value from exportfs_encode_*() fanotify: support reporting non-decodeable file handles exportfs: allow exporting non-decodeable file handles to userspace exportfs: add explicit flag to request non-decodeable file handles exportfs: change connectable argument to bit flags commit 0a37714f96d5746268dc09bdd400a215f180ba9b Merge: 9e06150d3c04d fc4ea4229c2b2 Author: Linus Torvalds Date: Thu Jun 29 13:27:50 2023 -0700 Merge tag 'dlm-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm Pull dlm updates from David Teigland: "The dlm posix lock handling (for gfs2) has three notable changes: - Local pids returned from GETLK are no longer negated. A previous patch negating remote pids mistakenly changed local pids also. - SETLKW operations can now be interrupted only when the process is killed, and not from other signals. General interruption was resulting in previously acquired locks being cleared, not just the in-progress lock. Handling this correctly will require extending a cancel capability to user space (a future feature.) - If multiple threads are requesting posix locks (with SETLKW), fix incorrect matching of results to the requests. The dlm networking has several minor cleanups, and one notable change: - Avoid delaying ack messages for too long (used for message reliability), resulting in a backlog of un-acked messages. These could previously be delayed as a result of either too many or too few other messages being sent. Now an upper and lower threshold is used to determine when an ack should be sent" * tag 'dlm-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: fs: dlm: remove filter local comms on close fs: dlm: add send ack threshold and append acks to msgs fs: dlm: handle sequence numbers as atomic fs: dlm: handle lkb wait count as atomic_t fs: dlm: filter ourself midcomms calls fs: dlm: warn about messages from left nodes fs: dlm: move dlm_purge_lkb_callbacks to user module fs: dlm: cleanup STOP_IO bitflag set when stop io fs: dlm: don't check othercon twice fs: dlm: unregister memory at the very last fs: dlm: fix missing pending to false fs: dlm: clear pending bit when queue was empty fs: dlm: revert check required context while close fs: dlm: fix mismatch of plock results from userspace fs: dlm: make F_SETLK use unkillable wait_event fs: dlm: interrupt posix locks only when process is killed fs: dlm: fix cleanup pending ops when interrupted fs: dlm: return positive pid value for F_GETLK dlm: Replace all non-returning strlcpy with strscpy commit 9e06150d3c04d1a5028a485263912ea892545d2f Merge: 53ea167b212f6 c3b880acadc95 Author: Linus Torvalds Date: Thu Jun 29 13:23:32 2023 -0700 Merge tag 'xfs-6.5-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs updates from Darrick Wong: "There's not much going on this cycle -- the large extent counts feature graduated, so now users can create more extremely fragmented files! :P The rest are bug fixes; and I'll be sending more next week. - Fix a problem where shrink would blow out the space reserve by declining to shrink the filesystem - Drop the EXPERIMENTAL tag for the large extent counts feature - Set FMODE_CAN_ODIRECT and get rid of an address space op - Fix an AG count overflow bug in growfs if the new device size is redonkulously large" * tag 'xfs-6.5-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: fix ag count overflow during growfs xfs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method xfs: drop EXPERIMENTAL tag for large extent counts xfs: don't deplete the reserve pool when trying to shrink the fs commit 53ea167b212f675e40420498e46fa31553b406ac Merge: b9d02c224d00a 2ef6c32a914b8 Author: Linus Torvalds Date: Thu Jun 29 13:18:36 2023 -0700 Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 updates from Ted Ts'o: "Various cleanups and bug fixes in ext4's extent status tree, journalling, and block allocator subsystems. Also improve performance for parallel DIO overwrites" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (55 commits) ext4: avoid updating the superblock on a r/o mount if not needed jbd2: skip reading super block if it has been verified ext4: fix to check return value of freeze_bdev() in ext4_shutdown() ext4: refactoring to use the unified helper ext4_quotas_off() ext4: turn quotas off if mount failed after enabling quotas ext4: update doc about journal superblock description ext4: add journal cycled recording support jbd2: continue to record log between each mount jbd2: remove j_format_version jbd2: factor out journal initialization from journal_get_superblock() jbd2: switch to check format version in superblock directly jbd2: remove unused feature macros ext4: ext4_put_super: Remove redundant checking for 'sbi->s_journal_bdev' ext4: Fix reusing stale buffer heads from last failed mounting ext4: allow concurrent unaligned dio overwrites ext4: clean up mballoc criteria comments ext4: make ext4_zeroout_es() return void ext4: make ext4_es_insert_extent() return void ext4: make ext4_es_insert_delayed_block() return void ext4: make ext4_es_remove_extent() return void ... commit b9d02c224d00a412d9c7fb1f92c358604038a783 Merge: be3c213150dc4 95e2b352c03b0 Author: Linus Torvalds Date: Thu Jun 29 13:10:32 2023 -0700 Merge tag 'jfs-6.5' of github.com:kleikamp/linux-shaggy Pull jfs updates from David Kleikamp: "Minor bug fixes and cleanups" * tag 'jfs-6.5' of github.com:kleikamp/linux-shaggy: FS: JFS: Check for read-only mounted filesystem in txBegin FS: JFS: Fix null-ptr-deref Read in txBegin fs: jfs: Fix UBSAN: array-index-out-of-bounds in dbAllocDmapLev fs: jfs: (trivial) Fix typo in dbInitTree function jfs: jfs_dmap: Validate db_l2nbperpage while mounting commit be3c213150dc4370ef211a78d78457ff166eba4e Merge: eee9c708cc89b 62149a745eee0 Author: Linus Torvalds Date: Thu Jun 29 13:01:27 2023 -0700 Merge tag 'ovl-update-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs Pull overlayfs update from Amir Goldstein: - fix two NULL pointer deref bugs (Zhihao Cheng) - add support for "data-only" lower layers destined to be used by composefs - port overlayfs to the new mount api (Christian Brauner) * tag 'ovl-update-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs: (26 commits) ovl: add Amir as co-maintainer ovl: reserve ability to reconfigure mount options with new mount api ovl: modify layer parameter parsing ovl: port to new mount api ovl: factor out ovl_parse_options() helper ovl: store enum redirect_mode in config instead of a string ovl: pass ovl_fs to xino helpers ovl: clarify ovl_get_root() semantics ovl: negate the ofs->share_whiteout boolean ovl: check type and offset of struct vfsmount in ovl_entry ovl: implement lazy lookup of lowerdata in data-only layers ovl: prepare for lazy lookup of lowerdata inode ovl: prepare to store lowerdata redirect for lazy lowerdata lookup ovl: implement lookup in data-only layers ovl: introduce data-only lower layers ovl: remove unneeded goto instructions ovl: deduplicate lowerdata and lowerstack[] ovl: deduplicate lowerpath and lowerstack[] ovl: move ovl_entry into ovl_inode ovl: factor out ovl_free_entry() and ovl_stack_*() helpers ... commit eee9c708cc89b4600c6e6cdda5bc2b8b4dad96cb Author: Linus Torvalds Date: Thu Jun 29 12:36:47 2023 -0700 gup: avoid stack expansion warning for known-good case In commit a425ac5365f6 ("gup: add warning if some caller would seem to want stack expansion") I added a temporary warning to catch any strange GUP users that would be impacted by the fact that GUP no longer extends the stack. But it turns out that the warning is most easily triggered through __access_remote_vm(), that already knows to expand the stack - it just does it *after* calling GUP. So the warning is easy to trigger by just running gdb (or similar) and accessing things remotely under the stack. This just adds a temporary extra "expand stack early" to avoid the warning for the already converted case - not because the warning is bad, but because getting the warning for this known good case would then hide any subsequent warnings for any actually interesting cases. Let's try to remember to revert this change when we remove the warnings. Signed-off-by: Linus Torvalds commit 5b4a82a0724af1dfd1320826e0266117b6a57fbd Author: Benjamin Coddington Date: Tue Jun 27 14:31:49 2023 -0400 Revert "NFSv4: Retry LOCK on OLD_STATEID during delegation return" Olga Kornievskaia reports that this patch breaks NFSv4.0 state recovery. It also introduces additional complexity in the error paths for cases not related to the original problem. Let's revert it for now, and address the original problem in another manner. This reverts commit f5ea16137a3fa2858620dc9084466491c128535f. Fixes: f5ea16137a3f ("NFSv4: Retry LOCK on OLD_STATEID during delegation return") Reported-by: Kornievskaia, Olga Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit e901f17b0742e36c9d79885a912b666cc1deb210 Author: Benjamin Coddington Date: Tue Jun 27 06:12:11 2023 -0400 NFS: Don't cleanup sysfs superblock entry if uninitialized Its possible to end up in nfs_free_server() before the server's superblock sysfs entry has been initialized, in which case calling kobject_put() will emit a WARNING. Check if the kobject has been initialized before cleaning it up. Fixes: 1c7251187dc0 ("NFS: add superblock sysfs entries") Reported-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit 48538ccb825b05544ec308a509e2cc9c013402db Author: Nick Child Date: Wed Jun 28 13:22:44 2023 -0500 ibmvnic: Do not reset dql stats on NON_FATAL err All ibmvnic resets, make a call to netdev_tx_reset_queue() when re-opening the device. netdev_tx_reset_queue() resets the num_queued and num_completed byte counters. These stats are used in Byte Queue Limit (BQL) algorithms. The difference between these two stats tracks the number of bytes currently sitting on the physical NIC. ibmvnic increases the number of queued bytes though calls to netdev_tx_sent_queue() in the drivers xmit function. When, VIOS reports that it is done transmitting bytes, the ibmvnic device increases the number of completed bytes through calls to netdev_tx_completed_queue(). It is important to note that the driver batches its transmit calls and num_queued is increased every time that an skb is added to the next batch, not necessarily when the batch is sent to VIOS for transmission. Unlike other reset types, a NON FATAL reset will not flush the sub crq tx buffers. Therefore, it is possible for the batched skb array to be partially full. So if there is call to netdev_tx_reset_queue() when re-opening the device, the value of num_queued (0) would not account for the skb's that are currently batched. Eventually, when the batch is sent to VIOS, the call to netdev_tx_completed_queue() would increase num_completed to a value greater than the num_queued. This causes a BUG_ON crash: ibmvnic 30000002: Firmware reports error, cause: adapter problem. Starting recovery... ibmvnic 30000002: tx error 600 ibmvnic 30000002: tx error 600 ibmvnic 30000002: tx error 600 ibmvnic 30000002: tx error 600 ------------[ cut here ]------------ kernel BUG at lib/dynamic_queue_limits.c:27! Oops: Exception in kernel mode, sig: 5 [....] NIP dql_completed+0x28/0x1c0 LR ibmvnic_complete_tx.isra.0+0x23c/0x420 [ibmvnic] Call Trace: ibmvnic_complete_tx.isra.0+0x3f8/0x420 [ibmvnic] (unreliable) ibmvnic_interrupt_tx+0x40/0x70 [ibmvnic] __handle_irq_event_percpu+0x98/0x270 ---[ end trace ]--- Therefore, do not reset the dql stats when performing a NON_FATAL reset. Fixes: 0d973388185d ("ibmvnic: Introduce xmit_more support using batched subCRQ hcalls") Signed-off-by: Nick Child Signed-off-by: Jakub Kicinski commit 915057ae79692d47f9fb3504785855be49abaea4 Author: Martin Habets Date: Wed Jun 28 13:32:20 2023 +0100 sfc: support for devlink port requires MAE access On systems without MAE permission efx->mae is not initialised, and trying to lookup an mport results in a NULL pointer dereference. Fixes: 25414b2a64ae ("sfc: add devlink port support for ef100") Signed-off-by: Martin Habets Reviewed-by: Jacob Keller Signed-off-by: Jakub Kicinski commit 1b722407a13b7f8658d2e26917791f32805980a2 Merge: f8824e151fbfa 5ff2977b19769 Author: Linus Torvalds Date: Thu Jun 29 11:00:17 2023 -0700 Merge tag 'drm-next-2023-06-29' of git://anongit.freedesktop.org/drm/drm Pull drm updates from Dave Airlie: "There is one set of patches to misc for a i915 gsc/mei proxy driver. Otherwise it's mostly amdgpu/i915/msm, lots of hw enablement and lots of refactoring. core: - replace strlcpy with strscpy - EDID changes to support further conversion to struct drm_edid - Move i915 DSC parameter code to common DRM helpers - Add Colorspace functionality aperture: - ignore framebuffers with non-primary devices fbdev: - use fbdev i/o helpers - add Kconfig options for fb_ops helpers - use new fb io helpers directly in drivers sysfs: - export DRM connector ID scheduler: - Avoid an infinite loop ttm: - store function table in .rodata - Add query for TTM mem limit - Add NUMA awareness to pools - Export ttm_pool_fini() bridge: - fsl-ldb: support i.MX6SX - lt9211, lt9611: remove blanking packets - tc358768: implement input bus formats, devm cleanups - ti-snd65dsi86: implement wait_hpd_asserted - analogix: fix endless probe loop - samsung-dsim: support swapped clock, fix enabling, support var clock - display-connector: Add support for external power supply - imx: Fix module linking - tc358762: Support reset GPIO panel: - nt36523: Support Lenovo J606F - st7703: Support Anbernic RG353V-V2 - InnoLux G070ACE-L01 support - boe-tv101wum-nl6: Improve initialization - sharp-ls043t1le001: Mode fixes - simple: BOE EV121WXM-N10-1850, S6D7AA0 - Ampire AM-800480L1TMQW-T00H - Rocktech RK043FN48H - Starry himax83102-j02 - Starry ili9882t amdgpu: - add new ctx query flag to handle reset better - add new query/set shadow buffer for rdna3 - DCN 3.2/3.1.x/3.0.x updates - Enable DC_FP on loongarch - PCIe fix for RDNA2 - improve DC FAMS/SubVP support for better power management - partition support for lots of engines - Take NUMA into account when allocating memory - Add new DRM_AMDGPU_WERROR config parameter to help with CI - Initial SMU13 overdrive support - Add support for new colorspace KMS API - W=1 fixes amdkfd: - Query TTM mem limit rather than hardcoding it - GC 9.4.3 partition support - Handle NUMA for partitions - Add debugger interface for enabling gdb - Add KFD event age tracking radeon: - Fix possible UAF i915: - new getparam for PXP support - GSC/MEI proxy driver - Meteorlake display enablement - avoid clearing preallocated framebuffers with TTM - implement framebuffer mmap support - Disable sampler indirect state in bindless heap - Enable fdinfo for GuC backends - GuC loading and firmware table handling fixes - Various refactors for multi-tile enablement - Define MOCS and PAT tables for MTL - GSC/MEI support for Meteorlake - PMU multi-tile support - Large driver kernel doc cleanup - Allow VRR toggling and arbitrary refresh rates - Support async flips on linear buffers on display ver 12+ - Expose CRTC CTM property on ILK/SNB/VLV - New debugfs for display clock frequencies - Hotplug refactoring - Display refactoring - I915_GEM_CREATE_EXT_SET_PAT for Mesa on Meteorlake - Use large rings for compute contexts - HuC loading for MTL - Allow user to set cache at BO creation - MTL powermanagement enhancements - Switch to dedicated workqueues to stop using flush_scheduled_work() - Move display runtime init under display/ - Remove 10bit gamma on desktop gen3 parts, they don't support it habanalabs: - uapi: return 0 for user queries if there was a h/w or f/w error - Add pci health check when we lose connection with the firmware. This can be used to distinguish between pci link down and firmware getting stuck. - Add more info to the error print when TPC interrupt occur. - Firmware fixes msm: - Adreno A660 bindings - SM8350 MDSS bindings fix - Added support for DPU on sm6350 and sm6375 platforms - Implemented tearcheck support to support vsync on SM150 and newer platforms - Enabled missing features (DSPP, DSC, split display) on sc8180x, sc8280xp, sm8450 - Added support for DSI and 28nm DSI PHY on MSM8226 platform - Added support for DSI on sm6350 and sm6375 platforms - Added support for display controller on MSM8226 platform - A690 GPU support - Move cmdstream dumping out of fence signaling path - a610 support - Support for a6xx devices without GMU nouveau: - NULL ptr before deref fixes armada: - implement fbdev emulation as client sun4i: - fix mipi-dsi dotclock - release clocks vc4: - rgb range toggle property - BT601 / BT2020 HDMI support vkms: - convert to drmm helpers - add reflection and rotation support - fix rgb565 conversion gma500: - fix iomem access shmobile: - support renesas soc platform - enable fbdev mxsfb: - Add support for i.MX93 LCDIF stm: - dsi: Use devm_ helper - ltdc: Fix potential invalid pointer deref renesas: - Group drivers in renesas subdirectory to prepare for new platform - Drop deprecated R-Car H3 ES1.x support meson: - Add support for MIPI DSI displays virtio: - add sync object support mediatek: - Add display binding document for MT6795" * tag 'drm-next-2023-06-29' of git://anongit.freedesktop.org/drm/drm: (1791 commits) drm/i915: Fix a NULL vs IS_ERR() bug drm/i915: make i915_drm_client_fdinfo() reference conditional again drm/i915/huc: Fix missing error code in intel_huc_init() drm/i915/gsc: take a wakeref for the proxy-init-completion check drm/msm/a6xx: Add A610 speedbin support drm/msm/a6xx: Add A619_holi speedbin support drm/msm/a6xx: Use adreno_is_aXYZ macros in speedbin matching drm/msm/a6xx: Use "else if" in GPU speedbin rev matching drm/msm/a6xx: Fix some A619 tunables drm/msm/a6xx: Add A610 support drm/msm/a6xx: Add support for A619_holi drm/msm/adreno: Disable has_cached_coherent in GMU wrapper configurations drm/msm/a6xx: Introduce GMU wrapper support drm/msm/a6xx: Move CX GMU power counter enablement to hw_init drm/msm/a6xx: Extend and explain UBWC config drm/msm/a6xx: Remove both GBIF and RBBM GBIF halt on hw init drm/msm/a6xx: Add a helper for software-resetting the GPU drm/msm/a6xx: Improve a6xx_bus_clear_pending_transactions() drm/msm/a6xx: Move a6xx_bus_clear_pending_transactions to a6xx_gpu drm/msm/a6xx: Move force keepalive vote removal to a6xx_gmu_force_off() ... commit 56f66ce1fd41c8eb063b550581d664af1e576b55 Merge: 046f753da6143 2be22f1941d5f Author: Jakub Kicinski Date: Thu Jun 29 10:49:38 2023 -0700 Merge branch 'bluetooth-fixes-from-next' Cherry-pick what looks like safe fixes from the bluetooth net-next PR. The other changes will have to wait for 6.6 Link: https://lore.kernel.org/all/20230627191004.2586540-1-luiz.dentz@gmail.com/ Signed-off-by: Jakub Kicinski commit 2be22f1941d5f661aa8043261d1bae5b6696c749 Author: Luiz Augusto von Dentz Date: Tue Jun 20 15:41:11 2023 -0700 Bluetooth: hci_event: Fix parsing of CIS Established Event The ISO Interval on CIS Established Event uses 1.25 ms slots: BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2304: Time = N * 1.25 ms In addition to that this always update the QoS settings based on CIS Established Event. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit 5b6d345d1b65d67624349e5de22227492c637576 Author: Jiapeng Chong Date: Sun Jun 25 16:45:13 2023 +0800 Bluetooth: hci_conn: Use kmemdup() to replace kzalloc + memcpy Use kmemdup rather than duplicating its implementation. ./net/bluetooth/hci_conn.c:1880:7-14: WARNING opportunity for kmemdup. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5597 Signed-off-by: Jiapeng Chong Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit fa01eba11f0e57c767a5eab5291c7a01407a00be Author: Matthew Anderson Date: Sat Jun 24 12:08:10 2023 -0500 Bluetooth: btusb: Add MT7922 bluetooth ID for the Asus Ally Adding the device ID from the Asus Ally gets the bluetooth working on the device. Signed-off-by: Matthew Anderson Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit d40d6f52d5bbbd7aa7092ba9fa793ad7dc253a35 Author: Ivan Orlov Date: Tue Jun 20 16:40:52 2023 +0200 Bluetooth: hci_sysfs: make bt_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the bt_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Cc: Marcel Holtmann Cc: Johan Hedberg Cc: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Signed-off-by: Greg Kroah-Hartman Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit 14f0dceca60b2fc4f2388505b25f9e6f71785e05 Author: Luiz Augusto von Dentz Date: Thu Jun 8 11:12:18 2023 -0700 Bluetooth: ISO: Rework sync_interval to be sync_factor This rework sync_interval to be sync_factor as having sync_interval in the order of seconds is sometimes not disarable. Wit sync_factor the application can tell how many SDU intervals it wants to send an announcement with PA, the EA interval is set to 2 times that so a factor of 24 of BIG SDU interval of 10ms would look like the following: < HCI Command: LE Set Extended Advertising Parameters (0x08|0x0036) plen 25 Handle: 0x01 Properties: 0x0000 Min advertising interval: 480.000 msec (0x0300) Max advertising interval: 480.000 msec (0x0300) Channel map: 37, 38, 39 (0x07) Own address type: Random (0x01) Peer address type: Public (0x00) Peer address: 00:00:00:00:00:00 (OUI 00-00-00) Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00) TX power: Host has no preference (0x7f) Primary PHY: LE 1M (0x01) Secondary max skip: 0x00 Secondary PHY: LE 2M (0x02) SID: 0x00 Scan request notifications: Disabled (0x00) < HCI Command: LE Set Periodic Advertising Parameters (0x08|0x003e) plen 7 Handle: 1 Min interval: 240.00 msec (0x00c0) Max interval: 240.00 msec (0x00c0) Properties: 0x0000 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit 73f55453ea5236a586a7f1b3d5e2ee051d655351 Author: Luiz Augusto von Dentz Date: Wed Jun 7 12:33:47 2023 -0700 Bluetooth: MGMT: Fix marking SCAN_RSP as not connectable When receiving a scan response there is no way to know if the remote device is connectable or not, so when it cannot be merged don't make any assumption and instead just mark it with a new flag defined as MGMT_DEV_FOUND_SCAN_RSP so userspace can tell it is a standalone SCAN_RSP. Link: https://lore.kernel.org/linux-bluetooth/CABBYNZ+CYMsDSPTxBn09Js3BcdC-x7vZFfyLJ3ppZGGwJKmUTw@mail.gmail.com/ Fixes: c70a7e4cc8d2 ("Bluetooth: Add support for Not Connectable flag for Device Found events") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit db9cbcadc16e8b9f0b3ef5870f3a38ebafcbe8e0 Author: Pauli Virtanen Date: Sat Jun 3 00:28:12 2023 +0300 Bluetooth: hci_event: fix Set CIG Parameters error status handling If the event has error status, return right error code and don't show incorrect "response malformed" messages. Signed-off-by: Pauli Virtanen Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit 6b9545dc9f8ff01d8bc1229103960d9cd265343f Author: Pauli Virtanen Date: Thu Jun 1 09:34:43 2023 +0300 Bluetooth: ISO: use hci_sync for setting CIG parameters When reconfiguring CIG after disconnection of the last CIS, LE Remove CIG shall be sent before LE Set CIG Parameters. Otherwise, it fails because CIG is in the inactive state and not configurable (Core v5.3 Vol 6 Part B Sec. 4.5.14.3). This ordering is currently wrong under suitable timing conditions, because LE Remove CIG is sent via the hci_sync queue and may be delayed, but Set CIG Parameters is via hci_send_cmd. Make the ordering well-defined by sending also Set CIG Parameters via hci_sync. Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections") Signed-off-by: Pauli Virtanen Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit 56b7f325db139c9255b1eb1d1e741576d5f8fa34 Author: Johan Hovold Date: Fri Jun 2 10:19:12 2023 +0200 Bluetooth: hci_bcm: do not mark valid bd_addr as invalid A recent commit restored the original (and still documented) semantics for the HCI_QUIRK_USE_BDADDR_PROPERTY quirk so that the device address is considered invalid unless an address is provided by firmware. This specifically means that this flag must only be set for devices with invalid addresses, but the Broadcom driver has so far been setting this flag unconditionally. Fortunately the driver already checks for invalid addresses during setup and sets the HCI_QUIRK_INVALID_BDADDR flag. Use this flag to indicate when the address can be overridden by firmware (long term, this should probably just always be allowed). Fixes: 6945795bc81a ("Bluetooth: fix use-bdaddr-property quirk") Reported-by: Marek Szyprowski Link: https://lore.kernel.org/lkml/ecef83c8-497f-4011-607b-a63c24764867@samsung.com Signed-off-by: Johan Hovold Tested-by: Marek Szyprowski Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit 1728137b33c00d5a2b5110ed7aafb42e7c32e4a1 Author: Sungwoo Kim Date: Wed May 31 01:39:56 2023 -0400 Bluetooth: L2CAP: Fix use-after-free in l2cap_sock_ready_cb l2cap_sock_release(sk) frees sk. However, sk's children are still alive and point to the already free'd sk's address. To fix this, l2cap_sock_release(sk) also cleans sk's children. ================================================================== BUG: KASAN: use-after-free in l2cap_sock_ready_cb+0xb7/0x100 net/bluetooth/l2cap_sock.c:1650 Read of size 8 at addr ffff888104617aa8 by task kworker/u3:0/276 CPU: 0 PID: 276 Comm: kworker/u3:0 Not tainted 6.2.0-00001-gef397bd4d5fb-dirty #59 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Workqueue: hci2 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x72/0x95 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:306 [inline] print_report+0x175/0x478 mm/kasan/report.c:417 kasan_report+0xb1/0x130 mm/kasan/report.c:517 l2cap_sock_ready_cb+0xb7/0x100 net/bluetooth/l2cap_sock.c:1650 l2cap_chan_ready+0x10e/0x1e0 net/bluetooth/l2cap_core.c:1386 l2cap_config_req+0x753/0x9f0 net/bluetooth/l2cap_core.c:4480 l2cap_bredr_sig_cmd net/bluetooth/l2cap_core.c:5739 [inline] l2cap_sig_channel net/bluetooth/l2cap_core.c:6509 [inline] l2cap_recv_frame+0xe2e/0x43c0 net/bluetooth/l2cap_core.c:7788 l2cap_recv_acldata+0x6ed/0x7e0 net/bluetooth/l2cap_core.c:8506 hci_acldata_packet net/bluetooth/hci_core.c:3813 [inline] hci_rx_work+0x66e/0xbc0 net/bluetooth/hci_core.c:4048 process_one_work+0x4ea/0x8e0 kernel/workqueue.c:2289 worker_thread+0x364/0x8e0 kernel/workqueue.c:2436 kthread+0x1b9/0x200 kernel/kthread.c:376 ret_from_fork+0x2c/0x50 arch/x86/entry/entry_64.S:308 Allocated by task 288: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x82/0x90 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:968 [inline] __kmalloc+0x5a/0x140 mm/slab_common.c:981 kmalloc include/linux/slab.h:584 [inline] sk_prot_alloc+0x113/0x1f0 net/core/sock.c:2040 sk_alloc+0x36/0x3c0 net/core/sock.c:2093 l2cap_sock_alloc.constprop.0+0x39/0x1c0 net/bluetooth/l2cap_sock.c:1852 l2cap_sock_create+0x10d/0x220 net/bluetooth/l2cap_sock.c:1898 bt_sock_create+0x183/0x290 net/bluetooth/af_bluetooth.c:132 __sock_create+0x226/0x380 net/socket.c:1518 sock_create net/socket.c:1569 [inline] __sys_socket_create net/socket.c:1606 [inline] __sys_socket_create net/socket.c:1591 [inline] __sys_socket+0x112/0x200 net/socket.c:1639 __do_sys_socket net/socket.c:1652 [inline] __se_sys_socket net/socket.c:1650 [inline] __x64_sys_socket+0x40/0x50 net/socket.c:1650 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc Freed by task 288: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x50 mm/kasan/generic.c:523 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free mm/kasan/common.c:200 [inline] __kasan_slab_free+0x10a/0x190 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0x88/0x1f0 mm/slub.c:3800 sk_prot_free net/core/sock.c:2076 [inline] __sk_destruct+0x347/0x430 net/core/sock.c:2168 sk_destruct+0x9c/0xb0 net/core/sock.c:2183 __sk_free+0x82/0x220 net/core/sock.c:2194 sk_free+0x7c/0xa0 net/core/sock.c:2205 sock_put include/net/sock.h:1991 [inline] l2cap_sock_kill+0x256/0x2b0 net/bluetooth/l2cap_sock.c:1257 l2cap_sock_release+0x1a7/0x220 net/bluetooth/l2cap_sock.c:1428 __sock_release+0x80/0x150 net/socket.c:650 sock_close+0x19/0x30 net/socket.c:1368 __fput+0x17a/0x5c0 fs/file_table.c:320 task_work_run+0x132/0x1c0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x113/0x120 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x21/0x50 kernel/entry/common.c:296 do_syscall_64+0x4c/0x90 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x72/0xdc The buggy address belongs to the object at ffff888104617800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 680 bytes inside of 1024-byte region [ffff888104617800, ffff888104617c00) The buggy address belongs to the physical page: page:00000000dbca6a80 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888104614000 pfn:0x104614 head:00000000dbca6a80 order:2 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0 flags: 0x200000000010200(slab|head|node=0|zone=2) raw: 0200000000010200 ffff888100041dc0 ffffea0004212c10 ffffea0004234b10 raw: ffff888104614000 0000000000080002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888104617980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888104617a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888104617a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888104617b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888104617b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Ack: This bug is found by FuzzBT with a modified Syzkaller. Other contributors are Ruoyu Wu and Hui Peng. Signed-off-by: Sungwoo Kim Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit 6945795bc81ab7be22750ecfb365056688f2fada Author: Johan Hovold Date: Wed May 31 11:04:24 2023 +0200 Bluetooth: fix use-bdaddr-property quirk Devices that lack persistent storage for the device address can indicate this by setting the HCI_QUIRK_INVALID_BDADDR which causes the controller to be marked as unconfigured until user space has set a valid address. The related HCI_QUIRK_USE_BDADDR_PROPERTY was later added to similarly indicate that the device lacks a valid address but that one may be specified in the devicetree. As is clear from commit 7a0e5b15ca45 ("Bluetooth: Add quirk for reading BD_ADDR from fwnode property") that added and documented this quirk and commits like de79a9df1692 ("Bluetooth: btqcomsmd: use HCI_QUIRK_USE_BDADDR_PROPERTY"), the device address of controllers with this flag should be treated as invalid until user space has had a chance to configure the controller in case the devicetree property is missing. As it does not make sense to allow controllers with invalid addresses, restore the original semantics, which also makes sure that the implementation is consistent (e.g. get_missing_options() indicates that the address must be set) and matches the documentation (including comments in the code, such as, "In case any of them is set, the controller has to start up as unconfigured."). Fixes: e668eb1e1578 ("Bluetooth: hci_core: Don't stop BT if the BD address missing in dts") Signed-off-by: Johan Hovold Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit 0cb7365850bacb8c2a9975cae672d65714d8daa1 Author: Johan Hovold Date: Wed May 31 11:04:23 2023 +0200 Bluetooth: fix invalid-bdaddr quirk for non-persistent setup Devices that lack persistent storage for the device address can indicate this by setting the HCI_QUIRK_INVALID_BDADDR which causes the controller to be marked as unconfigured until user space has set a valid address. Once configured, the device address must be set on every setup for controllers with HCI_QUIRK_NON_PERSISTENT_SETUP to avoid marking the controller as unconfigured and requiring the address to be set again. Fixes: 740011cfe948 ("Bluetooth: Add new quirk for non-persistent setup settings") Signed-off-by: Johan Hovold Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit f752a0b334bb95fe9b42ecb511e0864e2768046f Author: Zhengping Jiang Date: Wed May 24 17:04:15 2023 -0700 Bluetooth: L2CAP: Fix use-after-free Fix potential use-after-free in l2cap_le_command_rej. Signed-off-by: Zhengping Jiang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit 8153b738bc547878a017889d2b1cf8dd2de0e0c6 Author: Min-Hua Chen Date: Fri May 19 18:43:23 2023 +0800 Bluetooth: btqca: use le32_to_cpu for ver.soc_id Use le32_to_cpu for ver.soc_id to fix the following sparse warning. drivers/bluetooth/btqca.c:640:24: sparse: warning: restricted __le32 degrades to integer Signed-off-by: Min-Hua Chen Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit 022b6101c28a33fa8073b284423b88dc46b03d87 Author: Dan Gora Date: Tue May 9 12:45:24 2023 -0700 Bluetooth: btusb: Add device 6655:8771 to device tables This device is an Inspire branded BT 5.1 USB dongle with a Realtek RTL8761BU chip using the "Best Buy China" vendor ID. The device table is as follows: T: Bus=01 Lev=01 Prnt=02 Port=09 Cnt=01 Dev#= 7 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=6655 ProdID=8771 Rev=02.00 S: Manufacturer=Realtek S: Product=Bluetooth Radio S: SerialNumber=00E04C239987 C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms Signed-off-by: Dan Gora Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit bb23f07cb63975968bbabe314486e2b087234fc5 Author: Dan Gora Date: Tue May 9 12:51:19 2023 -0700 Bluetooth: btrtl: Add missing MODULE_FIRMWARE declarations Add missing MODULE_FIRMWARE declarations for firmware referenced in btrtl.c. Signed-off-by: Dan Gora Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Jakub Kicinski commit f8824e151fbfa0ac0a258015d606ea6f4a10251b Merge: 86e203edf24bb d6048fdc87024 Author: Linus Torvalds Date: Thu Jun 29 10:46:47 2023 -0700 Merge tag 'sound-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "Lots of changes as usual, but the only significant stuff in ALSA core part is the MIDI 2.0 support, while ASoC core kept receiving the code refactoring. The majority of changes are seen rather in device drivers, and quite a few new drivers can be found there. Here we go, some highlights: ALSA and ASoC Core: - Support of MIDI 2.0 devices: rawmidi and sequencer API have been extended for the support of the new UMP (Universal MIDI Packet) protocol, USB audio driver got the USB MIDI 2.0 interface support - Continued refactoring around ASoC DAI links and the ordering of trigger callbacks - PCM ABI extension for better drain support ASoC Drivers: - Conversions of many drivers to use maple tree based caches - Everlasting improvement works on ASoC Intel drivers - Compressed audio support for Qualcomm - Support for AMD SoundWire, Analog Devices SSM3515, Google Chameleon, Ingenic X1000, Intel systems with various CODECs, Loongson platforms, Maxim MAX98388, Mediatek MT8188, Nuvoton NAU8825C, NXP platforms with NAU8822, Qualcomm WSA884x, StarFive JH7110, Texas Instruments TAS2781 HD-audio: - Quirks for HP and ASUS machines - CS35L41 HD-audio codec fixes - Loongson HD-audio support Misc: - A new virtual PCM test driver for kselftests - Continued refactoring and improvements on the legacy emu10k1 driver" * tag 'sound-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (556 commits) ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on EliteBook ASoC: hdmi-codec: fix channel info for compressed formats ALSA: pcm: fix ELD constraints for (E)AC3, DTS(-HD) and MLP formats ASoC: core: Always store of_node when getting DAI link component ASoC: tas2781: Fix error code in tas2781_load_calibration() ASoC: amd: update pm_runtime enable sequence ALSA: ump: Export MIDI1 / UMP conversion helpers ASoC: tas2781: fix Kconfig dependencies ASoC: amd: acp: remove acp poweroff function ASoC: amd: acp: clear pdm dma interrupt mask ASoC: codecs: max98090: Allow dsp_a mode ASoC: qcom: common: add default jack dapm pins ASoC: loongson: fix address space confusion ASoC: dt-bindings: microchip,sama7g5-pdmc: Simplify "microchip,mic-pos" constraints ASoC: tegra: Remove stale comments in AHUB ASoC: tegra: Use normal system sleep for ASRC ALSA: hda/realtek: Add quirks for ROG ALLY CS35l41 audio ASoC: fsl-asoc-card: Allow passing the number of slots in use ASoC: codecs: wsa884x: Add WSA884x family of speakers ASoC: dt-bindings: qcom,wsa8840: Add WSA884x family of speakers ... commit 86e203edf24bb327ce8fcd3c5c8c6bf530a846df Merge: 0e382fa72bbf0 bf4ed21778f29 Author: Linus Torvalds Date: Thu Jun 29 10:29:46 2023 -0700 Merge tag 'input-for-v6.5-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - improvements to PS/2 handling for case when EC has already latched a scancode in the data register, but the kernel expects to receive an ACK to a command it sent to a device (such as keyboard LED toggle) - input drivers for devices connected over I2C bus have been switched back to using [new] .probe() - uinput allows userspace to inject timestamps for input events - support for capacitive keys in Atmel touch controller driver - assorted fixes to drv260x, pwm-vibra, ili210x, adxl34x, and other drivers * tag 'input-for-v6.5-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (40 commits) Input: pm8941-powerkey - fix debounce on gen2+ PMICs MAINTAINERS: Adjust Qualcomm driver globbing Input: gameport - provide default trigger() and read() Input: tps65219-pwrbutton - use regmap_set_bits() Input: tps65219-pwrbutton - convert to .remove_new() Input: tests - add test to cover all input_grab_device() function Input: gpio-keys - use input_report_key() Input: xpad - spelling fixes for "Xbox" Input: add HAS_IOPORT dependencies Input: libps2 - do not discard non-ack bytes when controlling LEDs Input: libps2 - introduce common interrupt handler Input: libps2 - fix aborting PS/2 commands Input: libps2 - fix NAK handling Input: libps2 - rework handling of command response Input: libps2 - remove special handling of ACK for command byte Input: libps2 - attach ps2dev instances as serio port's drvdata Input: Switch i2c drivers back to use .probe() dt-bindings: input: cypress,cyapa: convert to dtschema Input: adxl34x - do not hardcode interrupt trigger type Input: pwm-vibra - add support for enable GPIO ... commit 0e382fa72bbf0610be40af9af9b03b0cd149df82 Merge: 675285ad81929 b571809ec3b0a Author: Linus Torvalds Date: Thu Jun 29 10:24:40 2023 -0700 Merge tag 'for-linus-2023062701' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Jiri Kosina: - more bullet-proof handling of devres-managed resources in HID core (Dmitry Torokhov) - conversion of hid-wacom to use ktime_t (Jason Gerecke) - touch selftests for hid-wacom (Joshua Dickens) - support for nVidia Thunderstrike (SHIELD 2017) controller (Rahul Rameshbabu) - power management reset-during-suspend fix for goodix Chromebook devices (Fei Shao) - assorted device ID additions, device-specific quirks and code cleanups * tag 'for-linus-2023062701' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (27 commits) HID: wacom: Use ktime_t rather than int when dealing with timestamps HID: hidraw: fix data race on device refcount HID: intel-ish-hid: ipc: Add Arrow Lake PCI device ID HID: logitech-hidpp: add HIDPP_QUIRK_DELAYED_INIT for the T651. HID: add quirk for 03f0:464a HP Elite Presenter Mouse HID: nvidia-shield: Support LED functionality for Thunderstrike HID: nvidia-shield: Add mappings for consumer HID USAGE buttons HID: nvidia-shield: Initial driver implementation with Thunderstrike support HID: apple: Option to swap only left side mod keys HID: uclogic: Modular KUnit tests should not depend on KUNIT=y HID: fix an error code in hid_check_device_match() HID: logitech-hidpp: Add USB and Bluetooth IDs for the Logitech G915 TKL Keyboard HID: i2c-hid: Switch i2c drivers back to use .probe() HID: i2c-hid: goodix: Add support for "goodix,no-reset-during-suspend" property dt-bindings: input: goodix: Add "goodix,no-reset-during-suspend" property HID: microsoft: Add rumble support to latest xbox controllers selftests: hid: Add touch tests for Wacom devices HID: ensure timely release of driver-allocated resources HID: split apart hid_device_probe to make logic more apparent HID: amd_sfh: Split sensor and HID initialization for SFH1.1 ... commit 675285ad819293844018aa8096ba9a6d7c77b90b Merge: e5476f57b3262 c2d22806aecb2 Author: Linus Torvalds Date: Thu Jun 29 10:20:38 2023 -0700 Merge tag 'fbdev-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev updates from Helge Deller: "Some fbdev fixes & cleanups. Includes is a fix for a potential out-of-bound memory access in fast_imageblit() and the switch of the VIA fbdev driver to use GPIO descriptors. Summary: - fix potential OOB read in fast_imageblit() - fbdev/media: Use GPIO descriptors for VIA GPIO - broadsheetfb & metronomefb: Add MODULE_FIRMWARE macro - omapfb: error handling fix in mipid_spi_probe() - sh_mobile_lcdcfb, sh7760fb: Typo and warning fixes - hitfb: code cleanups" * tag 'fbdev-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbdev: fix potential OOB read in fast_imageblit() MAINTAINERS: adjust entry in VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER fbdev: sh7760fb: Fix -Wimplicit-fallthrough warnings fbdev: sh_mobile_lcdcfb: Fix ARGB32 overlay format typo fbdev: hitfb: Use NULL for pointers fbdev: hitfb: Fix integer-to-pointer cast fbdev/media: Use GPIO descriptors for VIA GPIO video/hdmi: Reorder fields in 'struct hdmi_avi_infoframe' fbdev: broadsheetfb: Add MODULE_FIRMWARE macro fbdev: metronomefb: Add MODULE_FIRMWARE macro fbdev: hitfb: Declare hitfb_blank() as static fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe() commit e5476f57b32621eb8eab892a908df4d0b4808835 Merge: ff7ddcf0db48a 0ff9f5e57c5bb Author: Linus Torvalds Date: Thu Jun 29 10:11:10 2023 -0700 Merge tag 'gpio-updates-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "We have two new drivers, some improvements to the core code, lots of different updates to existing GPIO drivers and some dt-bindings on top. There's nothing controversial in here and almost everything has been in next for more than a week (95% a lot longer than this). The only thing that has spent less time in next is a new driver so no risk of regressions. The single merge pulls in changes that remove all usage of global GPIO numbers from arch/arm/mach-omap. Core GPIO library: - remove unused symbols - don't spam the kernel log with messages about hogs - remove old sysfs API cruft - improve handling of GPIO masks New drivers: - add a driver for the BlueField-3 GPIO controller - add GPIO support for the TPS65219 PMIC Driver improvements: - extend the gpio-aggregator driver to support ramp-up/ramp-down delay - remove unnecessary CONFIG_OF guards from gpio-aggregator - readability improvements in gpio-tangier - switch i2c drivers back to using probe() now that it's been converted in the i2c subsystem to not taking the id parameter - remove unused inclusions of of_gpio.h in several drivers - make pm ops static in gpio-davinci and fix a comment - use more devres in drivers to shrink and simplify the code - add missing include in gpio-sa1100 - add HAS_IOPORT KConfig dependency where needed - add permissions checks before accessing pins in gpio-tegra186 - convert the gpio-zynq driver to using immutable irqchips - preserve output settings set by the bootloader in gpio-mpc8xxx Selftests: - tweak the variable naming in script tests Device tree updates: - convert gpio-mmio and gpio-stmpe to YAML - add parsing of GPIO hogs to gpio-vf610 - add bindings for the Cirrus EP93xx GPIO controller - add gpio-line-names property to the gpio-pca9570 bindings - extend the binding for x-powers,axp209 with another block" * tag 'gpio-updates-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (58 commits) of: unittest: drop assertions for GPIO hog messages gpiolib: Drop unused domain_ops memeber of GPIO IRQ chip gpio: synq: remove unused zynq_gpio_irq_reqres/zynq_gpio_irq_relres dt-bindings: gpio: gpio-vf610: Add parsing of hogs gpio: lpc18xx: Remove unused of_gpio.h inclusion gpio: xra1403: Remove unused of_gpio.h inclusion gpio: mpc8xxx: Remove unused of_gpio.h inclusion dt-bindings: gpio: Add Cirrus EP93xx gpio: mpc8xxx: latch GPIOs state on module load when configured as output selftests: gpio: gpio-sim: Use same variable name for sysfs pathname gpio: mlxbf3: Add gpio driver support gpio: delay: Remove duplicative functionality gpio: aggregator: Set up a parser of delay line parameters gpio: aggregator: Support delay for setting up individual GPIOs gpio: aggregator: Remove CONFIG_OF and of_match_ptr() protections dt-bindings: gpio: pca9570: add gpio-line-names property gpiolib: remove unused gpio_cansleep() gpio: tps65219: add GPIO support for TPS65219 PMIC gpio: zynq: fix zynqmp_gpio not an immutable chip warning gpio: davinci: make davinci_gpio_dev_pm_ops static ... commit ff7ddcf0db48a7d9ae536eb0875428117be1d1f1 Merge: acd1d46b0ddec b9a40506a2cb6 Author: Linus Torvalds Date: Thu Jun 29 10:05:47 2023 -0700 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk updates from Stephen Boyd: "This batch of clk driver updates contains almost no new SoC support. Instead there's a treewide patch series from Maxime that makes clk_ops::determine_rate mandatory for muxes. Beyond that core framework change we have the usual pile of clk driver updates such as migrating i2c drivers to use .probe() again or YAMLfication of clk DT bindings so we can validate DTBs. Overall the SoCs that got the most updates this time around in terms of diffstat are the Amlogic and Mediatek drivers because they added new SoC support or fixed up various drivers to have proper data. In general things look kinda quiet. I suspect the core framework change may still shake out some problems after the merge window, mostly because not everyone tests linux-next where that series has been for some number of weeks. I saw that there's at least one pending fix for Tegra that needs to be wrapped up into a proper patch. I'll try to catch those bits before the window closes so that -rc1 is bootable. More details below. Core: - Make clk_ops::determine_rate mandatory for muxes New Drivers: - Add amlogic a1 SoC family PLL and peripheral clock controller support Updates: - Handle allocation failures from kasprintf() and friends - Migrate platform clk drivers to .remove_new() - Migrate i2c clk drivers to .probe() instead of .probe_new() - Remove CLK_SET_PARENT from all Mediatek MSDC core clocks - Add infra_ao reset support for Mediatek MT8188 SoCs - Align driver_data to i2c_device_id tables in some i2c clk drivers - Use device_get_match_data() in vc5 clk driver - New Kconfig symbol name (SOC_MICROCHIP_POLARFIRE) for Microchip FPGA clock drivers - Use of_property_read_bool() to read "microchip,pic32mzda-sosc" boolean DT property in clk-pic32mzda - Convert AT91 clock dt-bindings to YAML - Remove CLK_SET_RATE_PARENT flag from LDB clocks on i.MX6SX - Keep i.MX UART clocks enabled during kernel boot if earlycon is set - Drop imx_unregister_clocks() as there are no users anymore - Switch to _safe iterator on imx_clk_scu_unregister() to avoid use after free - Add determine_rate op to the imx8m composite clock - Use device managed API for iomap and kzalloc for i.MXRT1050, i.MX8MN, i.MX8MP and i.MX93 clock controller drivers - Add missing interrupt DT property for the i.MX8M clock controller - Re-add support for Exynos4212 clock controller because we are re-introducing the SoC in the mainline - Add CONFIG_OF dependency to Samsung clk Kconfig symbols to solve some objtool warnings - Preselect PLL MIPI as TCON0 parent for Allwinner A64 SoC - Convert the Renesas clock drivers to readl_poll_timeout_atomic() - Add PWM clock on Renesas R-Car V3U - Fix PLL5 on Renesas RZ/G2L and RZ/V2L" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (149 commits) clk: fix typo in clk_hw_register_fixed_rate_parent_data() macro clk: Fix memory leak in devm_clk_notifier_register() clk: mvebu: Iterate over possible CPUs instead of DT CPU nodes clk: mvebu: Use of_get_cpu_hwid() to read CPU ID MAINTAINERS: Add Marvell mvebu clock drivers clk: clocking-wizard: check return value of devm_kasprintf() clk: ti: clkctrl: check return value of kasprintf() clk: keystone: sci-clk: check return value of kasprintf() clk: si5341: free unused memory on probe failure clk: si5341: check return value of {devm_}kasprintf() clk: si5341: return error if one synth clock registration fails clk: cdce925: check return value of kasprintf() clk: vc5: check memory returned by kasprintf() clk: mediatek: clk-mt8173-apmixedsys: Fix iomap not released issue clk: mediatek: clk-mt8173-apmixedsys: Fix return value for of_iomap() error clk: mediatek: clk-mtk: Grab iomem pointer for divider clocks clk: keystone: syscon-clk: Add support for audio refclk dt-bindings: clock: Add binding documentation for TI Audio REFCLK dt-bindings: clock: ehrpwm: Remove unneeded syscon compatible clk: keystone: syscon-clk: Allow the clock node to not be of type syscon ... commit acd1d46b0ddec686d4170b2205bc08c88d5d4d74 Merge: e8c716bc68122 90fc660e8479c Author: Linus Torvalds Date: Thu Jun 29 10:01:25 2023 -0700 Merge tag 'hwmon-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers: - Driver for MAX31827 - Driver to support HP WMI Sensors Added support to existing drivers: - aht10: Support for AHT20 - aquacomputer_d5next: Support for Aquacomputer Leakshield - asus-ec-sensors: Support for ROG Crosshair X670E Hero - corsair-psu: Cleanups and support for series 2022 and 2023 - it87: Various improvements and support for IT8732F - nct6683: Support customer ID of some MSI boards. - nct6755: Support for NCT6799D - oxp-sensors: Various cleanups; support for AYANEO 2, Geek, OXP Mini, and AOKZOE A1 PRO - pmbus/max16601: Support for new revisions of MAX16508 - pmbus/adm1275: Disable ADC while updating PMON_CONFIG, and fix problems with temperature monitoring on ADM1272 - sht3x: Various cleanups; support for medium repeatability Other notable changes: - Switched regmap drivers to Maple tree support where appropriate Various other minor fixes and improvements" * tag 'hwmon-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (54 commits) hwmon: max31827: Switch back to use struct i2c_driver::probe hwmon: (oxp-sensors) Add support for AOKZOE A1 PRO hwmon: (corsair-psu) update Series 2022 and 2023 support hwmon: (corsair-psu) various cleanups hwmon: (corsair-psu) add support for reading PWM values and mode hwmon: (pmbus/adm1275) Disable ADC while updating PMON_CONFIG hwmon: (pmbus/adm1275) Prepare for protected write to PMON_CONFIG hwmon: (oxp-sensors) Simplify logic of error return hwmon: (oxp-sensors) Remove unused header hwmon: (nct6755) Add support for NCT6799D hwmon: (oxp-sensors) Add tt_toggle attribute on supported boards hwmon: (sht3x) complement sysfs interface for sts3x hwmon: (sht3x) Add new non-stardard sysfs attribute hwmon: (sht3x) add medium repeatability support hwmon: (sht3x)replace "high-precision" property to "repeatability" hwmon: (sht3x) remove blocking_io property hwmon: (sht3x) remove sht3x_platform_data hwmon: (pmbus/max16601) Add support for new revisions of MAX16508 Documentation/hwmon: Fix description of devm_hwmon_device_unregister() hwmon: (tmp464) Use maple tree register cache ... commit 046f753da6143ee16452966915087ec8b0de3c70 Author: Tobias Heider Date: Wed Jun 28 02:13:32 2023 +0200 Add MODULE_FIRMWARE() for FIRMWARE_TG357766. Fixes a bug where on the M1 mac mini initramfs-tools fails to include the necessary firmware into the initrd. Fixes: c4dab50697ff ("tg3: Download 57766 EEE service patch firmware") Signed-off-by: Tobias Heider Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/ZJt7LKzjdz8+dClx@tobhe.de Signed-off-by: Jakub Kicinski commit e8c716bc6812202ccf4ce0f0bad3428b794fb39c Author: Hugh Dickins Date: Wed Jun 28 21:31:35 2023 -0700 mm/khugepaged: fix regression in collapse_file() There is no xas_pause(&xas) in collapse_file()'s main loop, at the points where it does xas_unlock_irq(&xas) and then continues. That would explain why, once two weeks ago and twice yesterday, I have hit the VM_BUG_ON_PAGE(page != xas_load(&xas), page) since "mm/khugepaged: fix iteration in collapse_file" removed the xas_set(&xas, index) just before it: xas.xa_node could be left pointing to a stale node, if there was concurrent activity on the file which transformed its xarray. I tried inserting xas_pause()s, but then even bootup crashed on that VM_BUG_ON_PAGE(): there appears to be a subtle "nextness" implicit in xas_pause(). xas_next() and xas_pause() are good for use in simple loops, but not in this one: xas_set() worked well until now, so use xas_set(&xas, index) explicitly at the head of the loop; and change that VM_BUG_ON_PAGE() not to need its own xas_set(), and not to interfere with the xa_state (which would probably stop the crashes from xas_pause(), but I trust that less). The user-visible effects of this bug (if VM_BUG_ONs are configured out) would be data loss and data leak - potentially - though in practice I expect it is more likely that a subsequent check (e.g. on mapping or on nr_none) would notice an inconsistency, and just abandon the collapse. Link: https://lore.kernel.org/linux-mm/f18e4b64-3f88-a8ab-56cc-d1f5f9c58d4@google.com/ Fixes: c8a8f3b4a95a ("mm/khugepaged: fix iteration in collapse_file") Signed-off-by: Hugh Dickins Cc: stable@kernel.org Cc: Andrew Morton Cc: Matthew Wilcox Cc: David Stevens Cc: Peter Xu Signed-off-by: Linus Torvalds commit 2bed0d82c2f78b91a0a9a5a73da57ee883a0c070 Author: Dave Chinner Date: Wed Jun 28 11:04:34 2023 -0700 xfs: fix bounds check in xfs_defer_agfl_block() Need to happen before we allocate and then leak the xefi. Found by coverity via an xfsprogs libxfs scan. [djwong: This also fixes the type of the @agbno argument.] Fixes: 7dfee17b13e5 ("xfs: validate block number being freed before adding to xefi") Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit edd8276dd70279c29d412d99b99c2c0cac1b2cdd Author: Dave Chinner Date: Wed Jun 28 19:43:55 2023 -0700 xfs: AGF length has never been bounds checked The AGF verifier does not check that the AGF length field is within known good bounds. This has never been checked by runtime kernel code (i.e. the lack of verification goes back to 1993) yet we assume in many places that it is correct and verify other metdata against it. Add length verification to the AGF verifier. The length of the AGF must be equal to the size of the AG specified in the superblock, unless it is the last AG in the filesystem. In that case, it must be less than or equal to sb->sb_agblocks and greater than XFS_MIN_AG_BLOCKS, which is the smallest AG a growfs operation will allow to exist. This requires a bit of rework of the verifier function. We want to verify metadata before we use it to verify other metadata. Hence we need to verify the AGF sequence numbers before using them to verify the length of the AGF. Then we can verify the AGF length before we verify AGFL fields. Then we can verifier other fields that are bounds limited by the AGF length. And, finally, by calculating agf_length only once into a local variable, we can collapse repeated "if (xfs_has_foo() &&" conditionaly checks into single checks. This makes the code much easier to follow as all the checks for a given feature are obviously in the same place. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit f1e1765aad7de7a8b8102044fc6a44684bc36180 Author: Dave Chinner Date: Wed Jun 28 11:04:33 2023 -0700 xfs: journal geometry is not properly bounds checked If the journal geometry results in a sector or log stripe unit validation problem, it indicates that we cannot set the log up to safely write to the the journal. In these cases, we must abort the mount because the corruption needs external intervention to resolve. Similarly, a journal that is too large cannot be written to safely, either, so we shouldn't allow those geometries to mount, either. If the log is too small, we risk having transaction reservations overruning the available log space and the system hanging waiting for space it can never provide. This is purely a runtime hang issue, not a corruption issue as per the first cases listed above. We abort mounts of the log is too small for V5 filesystems, but we must allow v4 filesystems to mount because, historically, there was no log size validity checking and so some systems may still be out there with undersized logs. The problem is that on V4 filesystems, when we discover a log geometry problem, we skip all the remaining checks and then allow the log to continue mounting. This mean that if one of the log size checks fails, we skip the log stripe unit check. i.e. we allow the mount because a "non-fatal" geometry is violated, and then fail to check the hard fail geometries that should fail the mount. Move all these fatal checks to the superblock verifier, and add a new check for the two log sector size geometry variables having the same values. This will prevent any attempt to mount a log that has invalid or inconsistent geometries long before we attempt to mount the log. However, for the minimum log size checks, we can only do that once we've setup up the log and calculated all the iclog sizes and roundoffs. Hence this needs to remain in the log mount code after the log has been initialised. It is also the only case where we should allow a v4 filesystem to continue running, so leave that handling in place, too. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 8ebbf262d4684e035af5e7aa2a71cab636673a9b Author: Dave Chinner Date: Wed Jun 28 11:04:33 2023 -0700 xfs: don't block in busy flushing when freeing extents If the current transaction holds a busy extent and we are trying to allocate a new extent to fix up the free list, we can deadlock if the AG is entirely empty except for the busy extent held by the transaction. This can occur at runtime processing an XEFI with multiple extents in this path: __schedule+0x22f at ffffffff81f75e8f schedule+0x46 at ffffffff81f76366 xfs_extent_busy_flush+0x69 at ffffffff81477d99 xfs_alloc_ag_vextent_size+0x16a at ffffffff8141711a xfs_alloc_ag_vextent+0x19b at ffffffff81417edb xfs_alloc_fix_freelist+0x22f at ffffffff8141896f xfs_free_extent_fix_freelist+0x6a at ffffffff8141939a __xfs_free_extent+0x99 at ffffffff81419499 xfs_trans_free_extent+0x3e at ffffffff814a6fee xfs_extent_free_finish_item+0x24 at ffffffff814a70d4 xfs_defer_finish_noroll+0x1f7 at ffffffff81441407 xfs_defer_finish+0x11 at ffffffff814417e1 xfs_itruncate_extents_flags+0x13d at ffffffff8148b7dd xfs_inactive_truncate+0xb9 at ffffffff8148bb89 xfs_inactive+0x227 at ffffffff8148c4f7 xfs_fs_destroy_inode+0xb8 at ffffffff81496898 destroy_inode+0x3b at ffffffff8127d2ab do_unlinkat+0x1d1 at ffffffff81270df1 do_syscall_64+0x40 at ffffffff81f6b5f0 entry_SYSCALL_64_after_hwframe+0x44 at ffffffff8200007c This can also happen in log recovery when processing an EFI with multiple extents through this path: context_switch() kernel/sched/core.c:3881 __schedule() kernel/sched/core.c:5111 schedule() kernel/sched/core.c:5186 xfs_extent_busy_flush() fs/xfs/xfs_extent_busy.c:598 xfs_alloc_ag_vextent_size() fs/xfs/libxfs/xfs_alloc.c:1641 xfs_alloc_ag_vextent() fs/xfs/libxfs/xfs_alloc.c:828 xfs_alloc_fix_freelist() fs/xfs/libxfs/xfs_alloc.c:2362 xfs_free_extent_fix_freelist() fs/xfs/libxfs/xfs_alloc.c:3029 __xfs_free_extent() fs/xfs/libxfs/xfs_alloc.c:3067 xfs_trans_free_extent() fs/xfs/xfs_extfree_item.c:370 xfs_efi_recover() fs/xfs/xfs_extfree_item.c:626 xlog_recover_process_efi() fs/xfs/xfs_log_recover.c:4605 xlog_recover_process_intents() fs/xfs/xfs_log_recover.c:4893 xlog_recover_finish() fs/xfs/xfs_log_recover.c:5824 xfs_log_mount_finish() fs/xfs/xfs_log.c:764 xfs_mountfs() fs/xfs/xfs_mount.c:978 xfs_fs_fill_super() fs/xfs/xfs_super.c:1908 mount_bdev() fs/super.c:1417 xfs_fs_mount() fs/xfs/xfs_super.c:1985 legacy_get_tree() fs/fs_context.c:647 vfs_get_tree() fs/super.c:1547 do_new_mount() fs/namespace.c:2843 do_mount() fs/namespace.c:3163 ksys_mount() fs/namespace.c:3372 __do_sys_mount() fs/namespace.c:3386 __se_sys_mount() fs/namespace.c:3383 __x64_sys_mount() fs/namespace.c:3383 do_syscall_64() arch/x86/entry/common.c:296 entry_SYSCALL_64() arch/x86/entry/entry_64.S:180 To avoid this deadlock, we should not block in xfs_extent_busy_flush() if we hold a busy extent in the current transaction. Now that the EFI processing code can handle requeuing a partially completed EFI, we can detect this situation in xfs_extent_busy_flush() and return -EAGAIN rather than going to sleep forever. The -EAGAIN get propagated back out to the xfs_trans_free_extent() context, where the EFD is populated and the transaction is rolled, thereby moving the busy extents into the CIL. At this point, we can retry the extent free operation again with a clean transaction. If we hit the same "all free extents are busy" situation when trying to fix up the free list, we can safely call xfs_extent_busy_flush() and wait for the busy extents to resolve and wake us. At this point, the allocation search can make progress again and we can fix up the free list. This deadlock was first reported by Chandan in mid-2021, but I couldn't make myself understood during review, and didn't have time to fix it myself. It was reported again in March 2023, and again I have found myself unable to explain the complexities of the solution needed during review. As such, I don't have hours more time to waste trying to get the fix written the way it needs to be written, so I'm just doing it myself. This patchset is largely based on Wengang Wang's last patch, but with all the unnecessary stuff removed, split up into multiple patches and cleaned up somewhat. Reported-by: Chandan Babu R Reported-by: Wengang Wang Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 0853b5de42b471a92f4ff128a8757b87427d2431 Author: Dave Chinner Date: Wed Jun 28 11:04:33 2023 -0700 xfs: allow extent free intents to be retried Extent freeing neeeds to be able to avoid a busy extent deadlock when the transaction itself holds the only busy extents in the allocation group. This may occur if we have an EFI that contains multiple extents to be freed, and the freeing the second intent requires the space the first extent free released to expand the AGFL. If we block on the busy extent at this point, we deadlock. We hold a dirty transaction that contains a entire atomic extent free operations within it, so if we can abort the extent free operation and commit the progress that we've made, the busy extent can be resolved by a log force. Hence we can restart the aborted extent free with a new transaction and continue to make progress without risking deadlocks. To enable this, we need the EFI processing code to be able to handle an -EAGAIN error to tell it to commit the current transaction and retry again. This mechanism is already built into the defer ops processing (used bythe refcount btree modification intents), so there's relatively little handling we need to add to the EFI code to enable this. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R commit 6a2a9d776c4ae24a797e25eed2b9f7f33f756296 Author: Dave Chinner Date: Wed Jun 28 11:04:32 2023 -0700 xfs: pass alloc flags through to xfs_extent_busy_flush() To avoid blocking in xfs_extent_busy_flush() when freeing extents and the only busy extents are held by the current transaction, we need to pass the XFS_ALLOC_FLAG_FREEING flag context all the way into xfs_extent_busy_flush(). Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R commit b742d7b4f0e03df25c2a772adcded35044b625ca Author: Dave Chinner Date: Wed Jun 28 11:04:32 2023 -0700 xfs: use deferred frees for btree block freeing Btrees that aren't freespace management trees use the normal extent allocation and freeing routines for their blocks. Hence when a btree block is freed, a direct call to xfs_free_extent() is made and the extent is immediately freed. This puts the entire free space management btrees under this path, so we are stacking btrees on btrees in the call stack. The inobt, finobt and refcount btrees all do this. However, the bmap btree does not do this - it calls xfs_free_extent_later() to defer the extent free operation via an XEFI and hence it gets processed in deferred operation processing during the commit of the primary transaction (i.e. via intent chaining). We need to change xfs_free_extent() to behave in a non-blocking manner so that we can avoid deadlocks with busy extents near ENOSPC in transactions that free multiple extents. Inserting or removing a record from a btree can cause a multi-level tree merge operation and that will free multiple blocks from the btree in a single transaction. i.e. we can call xfs_free_extent() multiple times, and hence the btree manipulation transaction is vulnerable to this busy extent deadlock vector. To fix this, convert all the remaining callers of xfs_free_extent() to use xfs_free_extent_later() to queue XEFIs and hence defer processing of the extent frees to a context that can be safely restarted if a deadlock condition is detected. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R commit 939bd50dfbe7c17d958a62208e8b584442759bf5 Author: Dave Chinner Date: Wed Jun 28 11:04:31 2023 -0700 xfs: don't reverse order of items in bulk AIL insertion XFS has strict metadata ordering requirements. One of the things it does is maintain the commit order of items from transaction commit through the CIL and into the AIL. That is, if a transaction logs item A before item B in a modification, then they will be inserted into the CIL in the order {A, B}. These items are then written into the iclog during checkpointing in the order {A, B}. When the checkpoint commits, they are supposed to be inserted into the AIL in the order {A, B}, and when they are pushed from the AIL, they are pushed in the order {A, B}. If we crash, log recovery then replays the two items from the checkpoint in the order {A, B}, resulting in the objects the items apply to being queued for writeback at the end of the checkpoint in the order {A, B}. This means recovery behaves the same way as the runtime code. In places, we have subtle dependencies on this ordering being maintained. One of this place is performing intent recovery from the log. It assumes that recovering an intent will result in a non-intent object being the first thing that is modified in the recovery transaction, and so when the transaction commits and the journal flushes, the first object inserted into the AIL beyond the intent recovery range will be a non-intent item. It uses the transistion from intent items to non-intent items to stop the recovery pass. A recent log recovery issue indicated that an intent was appearing as the first item in the AIL beyond the recovery range, hence breaking the end of recovery detection that exists. Tracing indicated insertion of the items into the AIL was apparently occurring in the right order (the intent was last in the commit item list), but the intent was appearing first in the AIL. IOWs, the order of items in the AIL was {D,C,B,A}, not {A,B,C,D}, and bulk insertion was reversing the order of the items in the batch of items being inserted. Lucky for us, all the items fed to bulk insertion have the same LSN, so the reversal of order does not affect the log head/tail tracking that is based on the contents of the AIL. It only impacts on code that has implicit, subtle dependencies on object order, and AFAICT only the intent recovery loop is impacted by it. Make sure bulk AIL insertion does not reorder items incorrectly. Fixes: 0e57f6a36f9b ("xfs: bulk AIL insertion during transaction commit") Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R commit 347eb95b27eb97bebdc3ea7de23558216f4e2c90 Author: Colin Ian King Date: Wed Jun 28 10:59:37 2023 -0700 xfs: remove redundant initializations of pointers drop_leaf and save_leaf Pointers drop_leaf and save_leaf are initialized with values that are never read, they are being re-assigned later on just before they are used. Remove the redundant early initializations and keep the later assignments at the point where they are used. Cleans up two clang scan build warnings: fs/xfs/libxfs/xfs_attr_leaf.c:2288:29: warning: Value stored to 'drop_leaf' during its initialization is never read [deadcode.DeadStores] fs/xfs/libxfs/xfs_attr_leaf.c:2289:29: warning: Value stored to 'save_leaf' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 447a0bc108e4bae4c1ea845aacf43c10c28814e8 Author: Christoph Hellwig Date: Thu Jun 29 09:22:51 2023 -0700 iomap: drop me [hch] from MAINTAINERS for iomap As Darrick prefers to micro-manage this without looking at my input for code I wrote and then complain about getting burned out by that I might as well drop myself from the maintainers file. [djwong: and I don't like it when you all bikeshed a single-patch submission to the point that new bugs are being introduced in the scope creep that wasn't part of V1-V7!] Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 302efbef9d77a170a94dd81f4076814142dc5a31 Author: Lu Hongfei Date: Thu Jun 29 09:22:50 2023 -0700 fs: iomap: Change the type of blocksize from 'int' to 'unsigned int' in iomap_file_buffered_write_punch_delalloc The return value type of i_blocksize() is 'unsigned int', so the type of blocksize has been modified from 'int' to 'unsigned int' to ensure data type consistency. Signed-off-by: Lu Hongfei Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 61986a58bc6abbb1aea26e52bd269f49e5bacf19 Author: Shyam Prasad N Date: Tue Jun 27 06:22:20 2023 +0000 cifs: new dynamic tracepoint to track ses not found errors It is perfectly valid to not find session not found errors when a reconnect of a session happens when requests for the same session are happening in parallel. We had these log messages as VFS logs. My last change dumped these logs as FYI logs. This change just creates a new dynamic tracepoint to capture events of this type, just in case it is useful while debugging issues in the future. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit ac615db03ba508d42d240612262f21f2e5836b67 Author: Shyam Prasad N Date: Tue Jun 20 02:56:06 2023 +0000 cifs: log session id when a matching ses is not found We do not log the session id in crypt_setup when a matching session is not found. Printing the session id helps debugging here. This change does just that. This change also changes this log to FYI, since it is normal to see then during a reconnect. Doing the same for a similar log in case of signed connections. The plan is to have a tracepoint for this event, so that we will be able to see this event if need be. That will be done as another change. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 0914e4d3cda853471a72b2c26a516c7619658b87 Author: Arnd Bergmann Date: Wed May 17 14:47:53 2023 +0200 kdb: include kdb_private.h for function prototypes The kdb_kbd_cleanup_state() is called from another file through the kdb_private.h file, but that is not included before the definition, causing a W=1 warning: kernel/debug/kdb/kdb_keyboard.c:198:6: error: no previous prototype for 'kdb_kbd_cleanup_state' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230517124802.929751-1-arnd@kernel.org Signed-off-by: Daniel Thompson commit a587b046ce921cc1805de6f0f000209b3644cadd Author: Guenter Roeck Date: Thu Jun 29 01:30:47 2023 -0700 cdrom/gdrom: Fix build error Commit 7ae24fcee992 ("cdrom: remove the unused mode argument to cdrom_release") was supposed to remove an unused argument from cdrom_release(). but instead removed a used argument from cdrom_open(). This results in the following build error. drivers/cdrom/gdrom.c: In function 'gdrom_bdops_open': drivers/cdrom/gdrom.c:484:15: error: too few arguments to function 'cdrom_open' drivers/cdrom/gdrom.c: In function 'gdrom_bdops_release': drivers/cdrom/gdrom.c:492:35: error: 'mode' undeclared Fix it up. Fixes: 7ae24fcee992 ("cdrom: remove the unused mode argument to cdrom_release") Cc: Christoph Hellwig Cc: Phillip Potter Cc: Hannes Reinecke Cc: Christian Brauner Cc: Jens Axboe Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20230629083047.3487172-1-linux@roeck-us.net Signed-off-by: Jens Axboe commit 8117f948f12bc559edf40916e7693512c8c9a50b Author: Douglas Anderson Date: Thu Jun 1 14:31:50 2023 -0700 kgdb: Provide a stub kgdb_nmicallback() if !CONFIG_KGDB To save architectures from needing to wrap the call in #ifdefs, add a stub no-op version of kgdb_nmicallback(), which returns 1 if it didn't handle anything. Reviewed-by: Daniel Thompson Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20230601143109.v9.6.Ia3aeac89bb6751b682237e76e5ba594318e4b1aa@changeid Signed-off-by: Daniel Thompson commit 5ee35c769663cb1c5f26e12cad84904dc3002de8 Author: Tiezhu Yang Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Remove five DIE_* definitions in kdebug.h For now, DIE_PAGE_FAULT, DIE_BREAK, DIE_SSTEPBP, DIE_UPROBE and DIE_UPROBE_XOL are not used by any code, remove them. Tested-by: Jeff Xie Suggested-by: Youling Tang Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 19bc6cb6409289106d38f9ad1b2ecf73980df6b5 Author: Tiezhu Yang Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Add uprobes support Uprobes is the user-space counterpart to kprobes, this patch adds uprobes support for LoongArch. Here is a simple example with CONFIG_UPROBE_EVENTS=y: # cat test.c #include int add(int a, int b) { return a + b; } int main() { return add(2, 7); } # gcc test.c -o /tmp/test # nm /tmp/test | grep add 0000000120004194 T add # cd /sys/kernel/debug/tracing # echo > uprobe_events # echo "p:myuprobe /tmp/test:0x4194 %r4 %r5" > uprobe_events # echo "r:myuretprobe /tmp/test:0x4194 %r4" >> uprobe_events # echo 1 > events/uprobes/enable # echo 1 > tracing_on # /tmp/test # cat trace ... # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | test-1060 [001] DNZff 1015.770620: myuprobe: (0x120004194) arg1=0x2 arg2=0x7 test-1060 [001] DNZff 1015.770930: myuretprobe: (0x1200041f0 <- 0x120004194) arg1=0x9 Tested-by: Jeff Xie Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 6e320363339b585a36bf40d74592db3db021e017 Author: Tiezhu Yang Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Use larch_insn_gen_break() for kprobes For now, we can use larch_insn_gen_break() to define KPROBE_BP_INSN and KPROBE_SSTEPBP_INSN. Because larch_insn_gen_break() returns instruction word, define kprobe_opcode_t as u32, then do some small changes related with type conversion, no functional change intended. Tested-by: Jeff Xie Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 49ed320da5f52ec729e7f2f9edbc6e79848455bd Author: Tiezhu Yang Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Add larch_insn_gen_break() to generate break insns There exist various break insns such as BRK_KPROBE_BP, BRK_KPROBE_SSTEPBP, BRK_UPROBE_BP and BRK_UPROBE_XOLBP, add larch_insn_gen_break() to generate break insns simpler, this is preparation for later patch. Tested-by: Jeff Xie Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit b82fad4d5deb2c2a15fdb581a1e6725dcea666e7 Author: Tiezhu Yang Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Check for AMO instructions in insns_not_supported() Like llsc instructions, the atomic memory access instructions shouldn't be supported for probing, so check for them in insns_not_supported(). Closes: https://lore.kernel.org/all/SY4P282MB351877A70A0333C790FE85A5C09C9@SY4P282MB3518.AUSP282.PROD.OUTLOOK.COM/ Tested-by: Jeff Xie Reported-by: Hengqi Chen Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 3d2c3daf82544283c5597028a8a3efc9ac0fb02b Author: Tiezhu Yang Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Move three functions from kprobes.c to inst.c The three functions insns_not_supported(), insns_need_simulation() and arch_simulate_insn() will be used for uprobes, move them from kprobes.c to inst.c, this is preparation for later patch, no functionality change. Tested-by: Jeff Xie Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 7b0a096436c2dac6de77d132e751a8a3328798d5 Author: Haoran Jiang Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Replace kretprobe with rethook This is an adaptation of commit f3a112c0c40d ("x86,rethook,kprobes: Replace kretprobe with rethook on x86") and commit b57c2f124098 ("riscv: add riscv rethook implementation") to LoongArch. Mainly refer to commit b57c2f124098 ("riscv: add riscv rethook implementation"). Replaces the kretprobe code with rethook on LoongArch. With this patch, kretprobe on LoongArch uses the rethook instead of kretprobe specific trampoline code. Signed-off-by: Haoran Jiang Signed-off-by: Huacai Chen commit f02644e32c9e4bd1a9b286dc0b84f9cbe294f4e2 Author: Youling Tang Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Add jump-label implementation Add support for jump labels based on the ARM64 version. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Youling Tang Signed-off-by: Huacai Chen commit 5d553770409de4a98a8c4f8c014559725dcfaa37 Author: Tiezhu Yang Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Select HAVE_DEBUG_KMEMLEAK to support kmemleak We can see that DEBUG_KMEMLEAK depends on HAVE_DEBUG_KMEMLEAK after commit b69ec42b1b19 ("Kconfig: clean up the long arch list for the DEBUG_KMEMLEAK config option"), just select HAVE_DEBUG_KMEMLEAK to support kmemleak on LoongArch. Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 31f1a8b0ec66cf21d83807243c3a54469a7018c3 Author: Yinbo Zhu Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Export some arch-specific pm interfaces Some PMC (Power Management Controllers) need to support DTS and will use the suspend interfaces thus this patch was to export such interfaces for their use. Signed-off-by: Yinbo Zhu Signed-off-by: Huacai Chen commit 01158487af60cd3915e8c31924144caf29cb0767 Author: Huacai Chen Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Introduce hardware page table walker Loongson-3A6000 and newer processors have hardware page table walker (PTW) support. PTW can handle all fastpaths of TLBI/TLBL/TLBS/TLBM exceptions by hardware, software only need to handle slowpaths (page faults). BTW, PTW doesn't append _PAGE_MODIFIED for page table entries, so we change pmd_dirty() and pte_dirty() to also check _PAGE_DIRTY for the "dirty" attribute. Signed-off-by: Liang Gao Signed-off-by: Jun Yi Signed-off-by: Huacai Chen commit e031a5f3f1eddb961a6ded8a21ab8189d8760860 Author: Huacai Chen Date: Thu Jun 29 20:58:44 2023 +0800 LoongArch: Support dbar with different hints Traditionally, LoongArch uses "dbar 0" (full completion barrier) for everything. But the full completion barrier is a performance killer, so Loongson-3A6000 and newer processors have made finer granularity hints available: Bit4: ordering or completion (0: completion, 1: ordering) Bit3: barrier for previous read (0: true, 1: false) Bit2: barrier for previous write (0: true, 1: false) Bit1: barrier for succeeding read (0: true, 1: false) Bit0: barrier for succeeding write (0: true, 1: false) Hint 0x700: barrier for "read after read" from the same address, which is needed by LL-SC loops on old models (dbar 0x700 behaves the same as nop if such reordering is disabled on new models). This patch makes use of the various new hints for different kinds of memory barriers. It brings performance improvements on Loongson-3A6000 series, while not affecting the existing models because all variants are treated as 'dbar 0' there. Why override queued_spin_unlock()? After commit 01e3b958efe85a26d9b ("drivers: Remove explicit invocations of mmiowb()") we need a completion barrier in queued_spin_unlock(), but the generic implementation use smp_store_release() which only provide an ordering barrier. Signed-off-by: Jun Yi Signed-off-by: Huacai Chen commit f6f0c9a74a48448583c3cb0f3f067bc3fe0f13c6 Author: Huacai Chen Date: Thu Jun 29 20:58:43 2023 +0800 LoongArch: Add SMT (Simultaneous Multi-Threading) support Loongson-3A6000 has SMT (Simultaneous Multi-Threading) support, each physical core has two logical cores (threads). This patch add SMT probe and scheduler support via ACPI PPTT. If SCHED_SMT enabled, Loongson-3A6000 is treated as 4 cores, 8 threads; If SCHED_SMT disabled, Loongson-3A6000 is treated as 8 cores, 8 threads. Remove smp_num_siblings to support HMP (Heterogeneous Multi-Processing). Signed-off-by: Liupu Wang Signed-off-by: Huacai Chen commit 616500232e632dba8b03981eeccadacf2fbf1c30 Author: Huacai Chen Date: Thu Jun 29 20:58:43 2023 +0800 LoongArch: Add vector extensions support Add LoongArch's vector extensions support, which including 128bit LSX (i.e., Loongson SIMD eXtension) and 256bit LASX (i.e., Loongson Advanced SIMD eXtension). Linux kernel doesn't use vector itself, it only handle exceptions and context save/restore. So it only needs a subset of these instructions: * Vector load/store: vld vst vldx vstx xvld xvst xvldx xvstx * 8bit-elements move: vpickve2gr.b xvpickve2gr.b vinsgr2vr.b xvinsgr2vr.b * 16bit-elements move: vpickve2gr.h xvpickve2gr.h vinsgr2vr.h xvinsgr2vr.h * 32bit-elements move: vpickve2gr.w xvpickve2gr.w vinsgr2vr.w xvinsgr2vr.w * 64bit-elements move: vpickve2gr.d xvpickve2gr.d vinsgr2vr.d xvinsgr2vr.d * Elements permute: vpermi.w vpermi.d xvpermi.w xvpermi.d xvpermi.q Introduce AS_HAS_LSX_EXTENSION and AS_HAS_LASX_EXTENSION to avoid non- vector toolchains complains unsupported instructions. Signed-off-by: Huacai Chen commit aa5e65dc0818bbf676bf06927368ec46867778fd Author: Tiezhu Yang Date: Thu Jun 29 20:58:43 2023 +0800 LoongArch: Add support to clone a time namespace We can see that "Time namespaces are not supported" on LoongArch: (1) clone3 test # cd tools/testing/selftests/clone3 && make && ./clone3 ... # Time namespaces are not supported ok 18 # SKIP Skipping clone3() with CLONE_NEWTIME # Totals: pass:17 fail:0 xfail:0 xpass:0 skip:1 error:0 (2) timens test # cd tools/testing/selftests/timens && make && ./timens ... 1..0 # SKIP Time namespaces are not supported On LoongArch the current kernel does not support CONFIG_TIME_NS which depends on GENERIC_VDSO_TIME_NS, select GENERIC_VDSO_TIME_NS to enable CONFIG_TIME_NS to build kernel/time/namespace.c. Additionally, it needs to define some arch-dependent functions for the timens, such as __arch_get_timens_vdso_data(), arch_get_vdso_data() and vdso_join_timens(). At the same time, modify the layout of vvar to use one page size for generic vdso data, expand another page size for timens vdso data and assign LOONGARCH_VDSO_DATA_SIZE (maybe exceeds a page size if expand in the future) for loongarch vdso data, at last add the callback function vvar_fault() and modify stack_top(). With this patch under CONFIG_TIME_NS: (1) clone3 test # cd tools/testing/selftests/clone3 && make && ./clone3 ... ok 18 [739] Result (0) matches expectation (0) # Totals: pass:18 fail:0 xfail:0 xpass:0 skip:0 error:0 (2) timens test # cd tools/testing/selftests/timens && make && ./timens ... # Totals: pass:10 fail:0 xfail:0 xpass:0 skip:0 error:0 Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 65eea6b44a5dd332c50390fdaeda7e197802c484 Author: WANG Xuerui Date: Thu Jun 29 20:58:43 2023 +0800 Makefile: Add loongarch target flag for Clang compilation The LoongArch kernel is 64-bit and built with the soft-float ABI, hence the loongarch64-linux-gnusf target. (The "libc" part can affect the codegen of libcalls: other arches do not use a bare-metal target, and currently the only fully supported libc on LoongArch is glibc anyway.) See: https://lore.kernel.org/loongarch/CAKwvOdnimxv8oJ4mVY74zqtt1x7KTMrWvn2_T9x22SFDbU6rHQ@mail.gmail.com/ Reviewed-by: Nick Desaulniers Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 5a31ed4678e0b09f8c4c8b2e711c6cc112082dd4 Author: WANG Xuerui Date: Thu Jun 29 20:58:43 2023 +0800 LoongArch: Mark Clang LTO as working Confirmed working with QEMU system emulation. Acked-by: Nick Desaulniers Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 5ddc7a3794ddd3470635ebd325fa1dffea5b18c0 Author: WANG Xuerui Date: Thu Jun 29 20:58:43 2023 +0800 LoongArch: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation This is a port of commit 08f6554ff90e ("mips: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation") to arch/loongarch, for fixing cross-compilation of Linux/LoongArch with Clang, where previously the `--target` flag would no longer be present for the CHECKFLAGS cc invocation leading to build failure. Reported-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Link: https://github.com/ClangBuiltLinux/linux/issues/1787#issuecomment-1608306002 Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit b89673a91a31710a4a957114b0195cfd45feb122 Author: WANG Xuerui Date: Thu Jun 29 20:58:43 2023 +0800 LoongArch: vDSO: Use CLANG_FLAGS instead of filtering out '--target=' This is a port of commit 76d7fff22be3e ("MIPS: VDSO: Use CLANG_FLAGS instead of filtering out '--target='") to arch/loongarch, for fixing cross-compilation with Clang. Reported-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Link: https://github.com/ClangBuiltLinux/linux/issues/1787#issuecomment-1608306002 Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 38b10b269d04540aee05c34a059dcf304cfce0a8 Author: WANG Xuerui Date: Thu Jun 29 20:58:43 2023 +0800 LoongArch: Tweak CFLAGS for Clang compatibility Now the arch code is mostly ready for LLVM/Clang consumption, it is time to re-organize the CFLAGS a little to actually enable the LLVM build. Namely, all -G0 switches from CFLAGS are removed, and -mexplicit-relocs and -mdirect-extern-access are now wrapped with cc-option (with the related asm/percpu.h definition guarded against toolchain combos that are known to not work). A build with !RELOCATABLE && !MODULE is confirmed working within a QEMU environment; support for the two features are currently blocked on LLVM/Clang, and will come later. Why -G0 can be removed: In GCC, -G stands for "small data threshold", that instructs the compiler to put data smaller than the specified threshold in a dedicated "small data" section (called .sdata on LoongArch and several other arches). However, benefiting from this would require ABI cooperation, which is not the case for LoongArch; and current GCC behave the same whether -G0 (equal to disabling this optimization) is given or not. So, remove -G0 from CFLAGS altogether for one less thing to care about. This also benefits LLVM/Clang compatibility where the -G switch is not supported. Why -mexplicit-relocs can now be conditionally applied without regressions: Originally -mexplicit-relocs is unconditionally added to CFLAGS in case of CONFIG_AS_HAS_EXPLICIT_RELOCS, because not having it (i.e. old GCC + new binutils) would not work: modules will have R_LARCH_ABS_* relocs inside, but given the rarity of such toolchain combo in the wild, it may not be worthwhile to support it, so support for such relocs in modules were not added back when explicit relocs support was upstreamed, and -mexplicit-relocs is unconditionally added to fail the build early. Now that Clang compatibility is desired, given Clang is behaving like -mexplicit-relocs from day one but without support for the CLI flag, we must ensure the flag is not passed in case of Clang. However, explicit compiler flavor checks can be more brittle than feature detection: in this case what actually matters is support for __attribute__((model)) when building modules. Given neither older GCC nor current Clang support this attribute, probing for the attribute support and #error'ing out would allow proper UX without checking for Clang, and also automatically work when Clang support for the attribute is to be added in the future. Why -mdirect-extern-access is now conditionally applied: This is actually a nice-to-have optimization that can reduce GOT accesses, but not having it is harmless either. Because Clang does not support the option currently, but might do so in the future, conditional application via cc-option ensures compatibility with both current and future Clang versions. Suggested-by: Xi Ruoyao # cc-option changes Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 83d8b38967d253942d9172b0c4d69b7d844d5f06 Author: WANG Xuerui Date: Thu Jun 29 20:58:43 2023 +0800 LoongArch: Simplify the invtlb wrappers The invtlb instruction has been supported by upstream LoongArch toolchains from day one, so ditch the raw opcode trickery and just use plain inline asm for it. While at it, also make the invtlb asm statements barriers, for proper modeling of the side effects. The functions are also marked as __always_inline instead of just "inline", because they cannot work at all if not inlined: the op argument will not be compile-time const in that case, thus failing to satisfy the "i" constraint. The signature of the other more specific invtlb wrappers contain unused arguments right now, but these are not removed right away in order for the patch to be focused. In the meantime, assertions are added to ensure no accidental misuse happens before the refactor. (The more specific wrappers cannot re-use the generic invtlb wrapper, because the ISA manual says $zero shall be used in case a particular op does not take the respective argument: re-using the generic wrapper would mean losing control over the register usage.) Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 53a4858ccd0d27538f9ab1ac2bead002fca97edc Author: WANG Xuerui Date: Thu Jun 29 20:58:43 2023 +0800 LoongArch: Make the CPUCFG&CSR ops simple aliases of compiler built-ins In addition to less visual clutter, this also makes Clang happy regarding the const-ness of arguments. In the original approach, all Clang gets to see is the incoming arguments whose const-ness cannot be proven without first being inlined; so Clang errors out here while GCC is fine. While at it, tweak several printk format strings because the return type of csr_read64 becomes effectively unsigned long, instead of unsigned long long. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 38bb46f94544c5385bc35aa2bfc776dcf53a7b5d Author: WANG Xuerui Date: Thu Jun 29 20:58:43 2023 +0800 LoongArch: Prepare for assemblers with proper FCSR class support The GNU assembler (as of 2.40) mis-treats FCSR operands as GPRs, but the LLVM IAS does not. Probe for this and refer to FCSRs as "$fcsrNN" if support is present. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 24da0249d950bbf97a8513daf414b48548b8bbe9 Author: WANG Rui Date: Thu Jun 29 20:58:43 2023 +0800 LoongArch: extable: Also recognize ABI names of registers When the kernel is compiled with LLVM, the register names being handled during exception fixup building are ABI names instead of bare $rNN style. Add mapping for the ABI names for LLVM compatibility. Signed-off-by: WANG Rui Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 414cefc798a30895d61e9d5b010fcf350af782d6 Author: WANG Rui Date: Thu Jun 29 20:58:42 2023 +0800 LoongArch: Calculate various sizes in the linker script Taking the address delta between symbols in different sections is not supported by the LLVM IAS. Instead, do this in the linker script, so the same data can be properly referenced in assembly. Signed-off-by: WANG Rui Signed-off-by: WANG Xuerui [chenhuacai: Fix build with !CONFIG_EFI_STUB] Signed-off-by: Huacai Chen commit 0d03e9dce5c91d841a35af05ca61a5cf318f5064 Author: WANG Rui Date: Thu Jun 29 20:58:42 2023 +0800 LoongArch: Add guard for the larch_insn_gen_xxx functions Add guard for the larch_insn_gen_xxx functions to verify whether the immediate operand is within the acceptable range. Signed-off-by: WANG Rui Signed-off-by: Huacai Chen commit d7c24960975b02211c53afe97c36acde5c8ff933 Author: Dan Carpenter Date: Thu Jun 29 20:58:42 2023 +0800 LoongArch: Delete unnecessary debugfs checking Debugfs functions are not supposed to be checked for errors. This is sort of unusual but it is described in the comments for the debugfs_create_dir() function. Also debugfs_create_dir() can never return NULL. Reviewed-by: WANG Xuerui Signed-off-by: Dan Carpenter Signed-off-by: Huacai Chen commit 872b368b2282604aafbc8af1275e0b28a73b8636 Author: Huacai Chen Date: Thu Jun 29 20:58:42 2023 +0800 LoongArch: Set CPU#0 as the io master for FDT ACPI systems set io masters by parsing ACPI MADT, FDT systems have no MADT so we explicitly set CPU#0 as the io master. Otherwise CPU#0 will be considered as hotpluggable. Signed-off-by: Huacai Chen commit 5998bb7642bfc984b2305dd4e37e085a2f654477 Merge: e999c897cd626 c1ae02d876898 Author: Paolo Abeni Date: Thu Jun 29 14:41:28 2023 +0200 Merge branch 'fix-ptp-received-on-wrong-port-with-bridged-sja1105-dsa' Vladimir Oltean says: ==================== Fix PTP received on wrong port with bridged SJA1105 DSA Since the changes were made to tag_8021q to support imprecise RX for bridged ports, the tag_sja1105 driver still prefers the source port information deduced from the VLAN headers for link-local traffic, even though the switch can theoretically do better and report the precise source port. The problem is that the tagger doesn't know when to trust one source of information over another, because the INCL_SRCPT option (to "tag" link local frames) is sometimes enabled and sometimes it isn't. The first patch makes the switch provide the hardware tag for link local traffic under all circumstances, and the second patch makes the tagger always use that hardware tag as primary source of information for link local packets. ==================== Link: https://lore.kernel.org/r/20230627094207.3385231-1-vladimir.oltean@nxp.com Signed-off-by: Paolo Abeni commit c1ae02d876898b1b8ca1e12c6f84d7b406263800 Author: Vladimir Oltean Date: Tue Jun 27 12:42:07 2023 +0300 net: dsa: tag_sja1105: always prefer source port information from INCL_SRCPT Currently the sja1105 tagging protocol prefers using the source port information from the VLAN header if that is available, falling back to the INCL_SRCPT option if it isn't. The VLAN header is available for all frames except for META frames initiated by the switch (containing RX timestamps), and thus, the "if (is_link_local)" branch is practically dead. The tag_8021q source port identification has become more loose ("imprecise") and will report a plausible rather than exact bridge port, when under a bridge (be it VLAN-aware or VLAN-unaware). But link-local traffic always needs to know the precise source port. With incorrect source port reporting, for example PTP traffic over 2 bridged ports will all be seen on sockets opened on the first such port, which is incorrect. Now that the tagging protocol has been changed to make link-local frames always contain source port information, we can reverse the order of the checks so that we always give precedence to that information (which is always precise) in lieu of the tag_8021q VID which is only precise for a standalone port. Fixes: d7f9787a763f ("net: dsa: tag_8021q: add support for imprecise RX based on the VBID") Fixes: 91495f21fcec ("net: dsa: tag_8021q: replace the SVL bridging with VLAN-unaware IVL bridging") Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman Signed-off-by: Paolo Abeni commit b4638af8885af93cd70351081da1909c59342440 Author: Vladimir Oltean Date: Tue Jun 27 12:42:06 2023 +0300 net: dsa: sja1105: always enable the INCL_SRCPT option Link-local traffic on bridged SJA1105 ports is sometimes tagged by the hardware with source port information (when the port is under a VLAN aware bridge). The tag_8021q source port identification has become more loose ("imprecise") and will report a plausible rather than exact bridge port, when under a bridge (be it VLAN-aware or VLAN-unaware). But link-local traffic always needs to know the precise source port. Modify the driver logic (and therefore: the tagging protocol itself) to always include the source port information with link-local packets, regardless of whether the port is standalone, under a VLAN-aware or VLAN-unaware bridge. This makes it possible for the tagging driver to give priority to that information over the tag_8021q VLAN header. The big drawback with INCL_SRCPT is that it makes it impossible to distinguish between an original MAC DA of 01:80:C2:XX:YY:ZZ and 01:80:C2:AA:BB:ZZ, because the tagger just patches MAC DA bytes 3 and 4 with zeroes. Only if PTP RX timestamping is enabled, the switch will generate a META follow-up frame containing the RX timestamp and the original bytes 3 and 4 of the MAC DA. Those will be used to patch up the original packet. Nonetheless, in the absence of PTP RX timestamping, we have to live with this limitation, since it is more important to have the more precise source port information for link-local traffic. Fixes: d7f9787a763f ("net: dsa: tag_8021q: add support for imprecise RX based on the VBID") Fixes: 91495f21fcec ("net: dsa: tag_8021q: replace the SVL bridging with VLAN-unaware IVL bridging") Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman Signed-off-by: Paolo Abeni commit 861c249cd782cb9f2d5a881bbb32e8da7f0c1192 Author: Thomas Zimmermann Date: Tue Jun 27 16:58:20 2023 +0200 arch/sparc: Add module license and description for fbdev helpers Add MODULE_LICENSE() and MODULE_DESCRIPTION() for fbdev helpers on sparc. Fixes the following error: ERROR: modpost: missing MODULE_LICENSE() in arch/sparc/video/fbdev.o Reported-by: Guenter Roeck Closes: https://lore.kernel.org/dri-devel/c525adc9-6623-4660-8718-e0c9311563b8@roeck-us.net/ Suggested-by: Arnd Bergmann Fixes: 4eec0b3048fc ("arch/sparc: Implement fb_is_primary_device() in source file") Cc: "David S. Miller" Cc: Helge Deller Cc: Sam Ravnborg Cc: sparclinux@vger.kernel.org Signed-off-by: Thomas Zimmermann Reviewed-by: Randy Dunlap Reviewed-by: Arnd Bergmann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230627145843.31794-1-tzimmermann@suse.de commit e999c897cd626c05f5d68ab02028a210ceca3545 Merge: 3c4bb45ab2930 2edcfcbb3c594 Author: Paolo Abeni Date: Thu Jun 29 12:40:29 2023 +0200 Merge branch 'fix-ptp-packet-drops-with-ocelot-8021q-dsa-tag-protocol' Vladimir Oltean says: ==================== Fix PTP packet drops with ocelot-8021q DSA tag protocol Changes in v2: - Distinguish between L2 and L4 PTP packets v1 at: https://lore.kernel.org/netdev/20230626154003.3153076-1-vladimir.oltean@nxp.com/ Patch 3/3 fixes an issue with the ocelot/felix driver, where it would drop PTP traffic on RX unless hardware timestamping for that packet type was enabled. Fixing that requires the driver to know whether it had previously configured the hardware to timestamp PTP packets on that port. But it cannot correctly determine that today using the existing code structure, so patches 1/3 and 2/3 fix the control path of the code such that ocelot->ports[port]->trap_proto faithfully reflects whether that configuration took place. ==================== Link: https://lore.kernel.org/r/20230627163114.3561597-1-vladimir.oltean@nxp.com Signed-off-by: Paolo Abeni commit 70a6404ff610aa4889d98977da131c37f9ff9d1f Author: Sameer Pujar Date: Thu Jun 29 10:42:15 2023 +0530 ASoC: rt5640: Fix sleep in atomic context Following prints are observed while testing audio on Jetson AGX Orin which has onboard RT5640 audio codec: BUG: sleeping function called from invalid context at kernel/workqueue.c:3027 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 0, name: swapper/0 preempt_count: 10001, expected: 0 RCU nest depth: 0, expected: 0 ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at kernel/irq/handle.c:159 __handle_irq_event_percpu+0x1e0/0x270 ---[ end trace ad1c64905aac14a6 ]- The IRQ handler rt5640_irq() runs in interrupt context and can sleep during cancel_delayed_work_sync(). Fix this by running IRQ handler, rt5640_irq(), in thread context. Hence replace request_irq() calls with devm_request_threaded_irq(). Fixes: 051dade34695 ("ASoC: rt5640: Fix the wrong state of JD1 and JD2") Cc: stable@vger.kernel.org Cc: Oder Chiou Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/1688015537-31682-4-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown commit 2edcfcbb3c5946609be1d8875473a240b170673b Author: Vladimir Oltean Date: Tue Jun 27 19:31:14 2023 +0300 net: dsa: felix: don't drop PTP frames with tag_8021q when RX timestamping is disabled The driver implements a workaround for the fact that it doesn't have an IRQ source to tell it whether PTP frames are available through the extraction registers, for those frames to be processed and passed towards the network stack. That workaround is to configure the switch, through felix_hwtstamp_set() -> felix_update_trapping_destinations(), to create two copies of PTP packets: one sent over Ethernet to the DSA master, and one to be consumed through the aforementioned CPU extraction queue registers. The reason why we want PTP packets to be consumed through the CPU extraction registers in the first place is because we want to see their hardware RX timestamp. With tag_8021q, that is only visible that way, and it isn't visible with the copy of the packet that's transmitted over Ethernet. The problem with the workaround implementation is that it drops the packet received over Ethernet, in expectation of its copy being present in the CPU extraction registers. However, if felix_hwtstamp_set() hasn't run (aka PTP RX timestamping is disabled), the driver will drop the original PTP frame and there will be no copy of it in the CPU extraction registers. So, the network stack will simply not see any PTP frame. Look at the port's trapping configuration to see whether the driver has previously enabled the CPU extraction registers. If it hasn't, just don't RX timestamp the frame and let it be passed up the stack by DSA, which is perfectly fine. Fixes: 0a6f17c6ae21 ("net: dsa: tag_ocelot_8021q: add support for PTP timestamping") Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 6dfe70be0b0dec0f9297811501bec26c05fd96ad Author: Sheetal Date: Thu Jun 29 10:42:14 2023 +0530 ASoC: tegra: Fix ADX byte map Byte mask for channel-1 of stream-1 is not getting enabled and this causes failures during ADX use cases. This happens because the byte map value 0 matches the byte map array and put() callback returns without enabling the corresponding bits in the byte mask. ADX supports 4 output streams and each stream can have a maximum of 16 channels. Each byte in the input frame is uniquely mapped to a byte in one of these 4 outputs. This mapping is done with the help of byte map array via user space control setting. The byte map array size in the driver is 16 and each array element is of size 4 bytes. This corresponds to 64 byte map values. Each byte in the byte map array can have any value between 0 to 255 to enable the corresponding bits in the byte mask. The value 256 is used as a way to disable the byte map. However the byte map array element cannot store this value. The put() callback disables the byte mask for 256 value and byte map value is reset to 0 for this case. This causes problems during subsequent runs since put() callback, for value of 0, just returns without enabling the byte mask. In short, the problem is coming because 0 and 256 control values are stored as 0 in the byte map array. Right now fix the put() callback by actually looking at the byte mask array state to identify if any change is needed and update the fields accordingly. The get() callback needs an update as well to return the correct control value that user has set before. Note that when user set 256, the value is stored as 0 and byte mask is disabled. So byte mask state is used to either return 256 or the value from byte map array. Given above, this looks bit complicated and all this happens because the byte map array is tightly packed and cannot actually store the 256 value. Right now the priority is to fix the existing failure and a TODO item is put to improve this logic. Fixes: 3c97881b8c8a ("ASoC: tegra: Fix kcontrol put callback in ADX") Cc: stable@vger.kernel.org Signed-off-by: Sheetal Reviewed-by: Mohan Kumar D Reviewed-by: Sameer Pujar Link: https://lore.kernel.org/r/1688015537-31682-3-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown commit 45d0fcb5bc9558d0bf3d2fa7fabc5d8a88d35439 Author: Vladimir Oltean Date: Tue Jun 27 19:31:13 2023 +0300 net: mscc: ocelot: don't keep PTP configuration of all ports in single structure In a future change, the driver will need to determine whether PTP RX timestamping is enabled on a port (including whether traps were set up on that port in particular) and that is currently not possible. The driver supports different RX filters (L2, L4) and kinds of TX timestamping (one-step, two-step) on its ports, but it saves all configuration in a single struct hwtstamp_config that is global to the switch. So, the latest timestamping configuration on one port (including a request to disable timestamping) affects what gets reported for all ports, even though the configuration itself is still individual to each port. The port timestamping configurations are only coupled because of the common structure, so replace the hwtstamp_config with a mask of trapped protocols saved per port. We also have the ptp_cmd to distinguish between one-step and two-step PTP timestamping, so with those 2 bits of information we can fully reconstruct a descriptive struct hwtstamp_config for each port, during the SIOCGHWTSTAMP ioctl. Fixes: 4e3b0468e6d7 ("net: mscc: PTP Hardware Clock (PHC) support") Fixes: 96ca08c05838 ("net: mscc: ocelot: set up traps for PTP packets") Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 4fd44b82b7aceaa35c2901c6546d2c4198e0799d Author: Vladimir Oltean Date: Tue Jun 27 19:31:12 2023 +0300 net: mscc: ocelot: don't report that RX timestamping is enabled by default PTP RX timestamping should be enabled when the user requests it, not by default. If it is enabled by default, it can be problematic when the ocelot driver is a DSA master, and it sidesteps what DSA tries to avoid through __dsa_master_hwtstamp_validate(). Additionally, after the change which made ocelot trap PTP packets only to the CPU at ocelot_hwtstamp_set() time, it is no longer even true that RX timestamping is enabled by default, because until ocelot_hwtstamp_set() is called, the PTP traps are actually not set up. So the rx_filter field of ocelot->hwtstamp_config reflects an incorrect reality. Fixes: 96ca08c05838 ("net: mscc: ocelot: set up traps for PTP packets") Fixes: 4e3b0468e6d7 ("net: mscc: PTP Hardware Clock (PHC) support") Signed-off-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 49bd7b08149417a30aa7d92c8c85b3518de44a76 Author: Sheetal Date: Thu Jun 29 10:42:13 2023 +0530 ASoC: tegra: Fix AMX byte map Byte mask for channel-1 of stream-1 is not getting enabled and this causes failures during AMX use cases. This happens because the byte map value 0 matches the byte map array and put() callback returns without enabling the corresponding bits in the byte mask. AMX supports 4 input streams and each stream can take a maximum of 16 channels. Each byte in the output frame is uniquely mapped to a byte in one of these 4 inputs. This mapping is done with the help of byte map array via user space control setting. The byte map array size in the driver is 16 and each array element is of size 4 bytes. This corresponds to 64 byte map values. Each byte in the byte map array can have any value between 0 to 255 to enable the corresponding bits in the byte mask. The value 256 is used as a way to disable the byte map. However the byte map array element cannot store this value. The put() callback disables the byte mask for 256 value and byte map value is reset to 0 for this case. This causes problems during subsequent runs since put() callback, for value of 0, just returns without enabling the byte mask. In short, the problem is coming because 0 and 256 control values are stored as 0 in the byte map array. Right now fix the put() callback by actually looking at the byte mask array state to identify if any change is needed and update the fields accordingly. The get() callback needs an update as well to return the correct control value that user has set before. Note that when user sets 256, the value is stored as 0 and byte mask is disabled. So byte mask state is used to either return 256 or the value from byte map array. Given above, this looks bit complicated and all this happens because the byte map array is tightly packed and cannot actually store the 256 value. Right now the priority is to fix the existing failure and a TODO item is put to improve this logic. Fixes: 8db78ace1ba8 ("ASoC: tegra: Fix kcontrol put callback in AMX") Cc: stable@vger.kernel.org Signed-off-by: Sheetal Reviewed-by: Mohan Kumar D Reviewed-by: Sameer Pujar Link: https://lore.kernel.org/r/1688015537-31682-2-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown commit d10005837be83906bbd2078c3b4f9dfcbd6c95b6 Author: Dmitry Baryshkov Date: Thu Jun 29 12:58:47 2023 +0300 spi: spi-geni-qcom: enable SPI_CONTROLLER_MUST_TX for GPI DMA mode The GPI DMA mode requires for TX DMA to be prepared. Force SPI core to provide TX buffer even if the caller didn't provide one by setting the SPI_CONTROLLER_MUST_TX flag. Fixes: b59c122484ec ("spi: spi-geni-qcom: Add support for GPI dma") Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230629095847.3648597-1-dmitry.baryshkov@linaro.org Signed-off-by: Mark Brown commit 893b24181b4c4bf1fa2841b1ed192e5413a97cb1 Author: Will Deacon Date: Wed Jun 28 16:56:05 2023 +0100 arm64: sme: Use STR P to clear FFR context field in streaming SVE mode The FFR is a predicate register which can vary between 16 and 256 bits in size depending upon the configured vector length. When saving the SVE state in streaming SVE mode, the FFR register is inaccessible and so commit 9f5848665788 ("arm64/sve: Make access to FFR optional") simply clears the FFR field of the in-memory context structure. Unfortunately, it achieves this using an unconditional 8-byte store and so if the SME vector length is anything other than 64 bytes in size we will either fail to clear the entire field or, worse, we will corrupt memory immediately following the structure. This has led to intermittent kfence splats in CI [1] and can trigger kmalloc Redzone corruption messages when running the 'fp-stress' kselftest: | ============================================================================= | BUG kmalloc-1k (Not tainted): kmalloc Redzone overwritten | ----------------------------------------------------------------------------- | | 0xffff000809bf1e22-0xffff000809bf1e27 @offset=7714. First byte 0x0 instead of 0xcc | Allocated in do_sme_acc+0x9c/0x220 age=2613 cpu=1 pid=531 | __kmalloc+0x8c/0xcc | do_sme_acc+0x9c/0x220 | ... Replace the 8-byte store with a store of a predicate register which has been zero-initialised with PFALSE, ensuring that the entire field is cleared in memory. [1] https://lore.kernel.org/r/CA+G9fYtU7HsV0R0dp4XEH5xXHSJFw8KyDf5VQrLLfMxWfxQkag@mail.gmail.com Cc: Mark Brown Cc: Mark Rutland Cc: Naresh Kamboju Fixes: 9f5848665788 ("arm64/sve: Make access to FFR optional") Reported-by: Linux Kernel Functional Testing Signed-off-by: Will Deacon Reviewed-by: Mark Brown Tested-by: Anders Roxell Link: https://lore.kernel.org/r/20230628155605.22296-1-will@kernel.org Signed-off-by: Catalin Marinas commit 3c4bb45ab29303265a8c6d7099e00c824503c586 Merge: 6feb37b3b06e9 93d75d475c5dc Author: Paolo Abeni Date: Thu Jun 29 12:10:39 2023 +0200 Merge branch 'net-sched-act_ipt-bug-fixes' Florian Westphal says: ==================== net/sched: act_ipt bug fixes v3: prefer skb_header() helper in patch 2. No other changes. I've retained Acks and RvB-Tags of v2. While checking if netfilter could be updated to replace selected instances of NF_DROP with kfree_skb_reason+NF_STOLEN to improve debugging info via drop monitor I found that act_ipt is incompatible with such an approach. Moreover, it lacks multiple sanity checks to avoid certain code paths that make assumptions that the tc layer doesn't meet, such as header sanity checks, availability of skb_dst, skb_nfct() and so on. act_ipt test in the tc selftest still pass with this applied. I think that we should consider removal of this module, while this should take care of all problems, its ipv4 only and I don't think there are any netfilter targets that lack a native tc equivalent, even when ignoring bpf. ==================== Link: https://lore.kernel.org/r/20230627123813.3036-1-fw@strlen.de Signed-off-by: Paolo Abeni commit 93d75d475c5dc3404292976147d063ee4d808592 Author: Florian Westphal Date: Tue Jun 27 14:38:13 2023 +0200 net/sched: act_ipt: zero skb->cb before calling target xtables relies on skb being owned by ip stack, i.e. with ipv4 check in place skb->cb is supposed to be IPCB. I don't see an immediate problem (REJECT target cannot be used anymore now that PRE/POSTROUTING hook validation has been fixed), but better be safe than sorry. A much better patch would be to either mark act_ipt as "depends on BROKEN" or remove it altogether. I plan to do this for -next in the near future. This tc extension is broken in the sense that tc lacks an equivalent of NF_STOLEN verdict. With NF_STOLEN, target function takes complete ownership of skb, caller cannot dereference it anymore. ACT_STOLEN cannot be used for this: it has a different meaning, caller is allowed to dereference the skb. At this time NF_STOLEN won't be returned by any targets as far as I can see, but this may change in the future. It might be possible to work around this via list of allowed target extensions known to only return DROP or ACCEPT verdicts, but this is error prone/fragile. Existing selftest only validates xt_LOG and act_ipt is restricted to ipv4 so I don't think this action is used widely. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Florian Westphal Reviewed-by: Simon Horman Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni commit b2dc32dcba08bf55cec600caa76f4afd2e3614df Author: Florian Westphal Date: Tue Jun 27 14:38:12 2023 +0200 net/sched: act_ipt: add sanity checks on skb before calling target Netfilter targets make assumptions on the skb state, for example iphdr is supposed to be in the linear area. This is normally done by IP stack, but in act_ipt case no such checks are made. Some targets can even assume that skb_dst will be valid. Make a minimum effort to check for this: - Don't call the targets eval function for non-ipv4 skbs. - Don't call the targets eval function for POSTROUTING emulation when the skb has no dst set. v3: use skb_protocol helper (Davide Caratti) Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Florian Westphal Reviewed-by: Simon Horman Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni commit b4ee93380b3c891fea996af8d1d3ca0e36ad31f0 Author: Florian Westphal Date: Tue Jun 27 14:38:11 2023 +0200 net/sched: act_ipt: add sanity checks on table name and hook locations Looks like "tc" hard-codes "mangle" as the only supported table name, but on kernel side there are no checks. This is wrong. Not all xtables targets are safe to call from tc. E.g. "nat" targets assume skb has a conntrack object assigned to it. Normally those get called from netfilter nat core which consults the nat table to obtain the address mapping. "tc" userspace either sets PRE or POSTROUTING as hook number, but there is no validation of this on kernel side, so update netlink policy to reject bogus numbers. Some targets may assume skb_dst is set for input/forward hooks, so prevent those from being used. act_ipt uses the hook number in two places: 1. the state hook number, this is fine as-is 2. to set par.hook_mask The latter is a bit mask, so update the assignment to make xt_check_target() to the right thing. Followup patch adds required checks for the skb/packet headers before calling the targets evaluation function. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Florian Westphal Reviewed-by: Simon Horman Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni commit 6feb37b3b06e9049e20dcf7e23998f92c9c5be9a Author: Chengfeng Ye Date: Tue Jun 27 12:03:40 2023 +0000 sctp: fix potential deadlock on &net->sctp.addr_wq_lock As &net->sctp.addr_wq_lock is also acquired by the timer sctp_addr_wq_timeout_handler() in protocal.c, the same lock acquisition at sctp_auto_asconf_init() seems should disable irq since it is called from sctp_accept() under process context. Possible deadlock scenario: sctp_accept() -> sctp_sock_migrate() -> sctp_auto_asconf_init() -> spin_lock(&net->sctp.addr_wq_lock) -> sctp_addr_wq_timeout_handler() -> spin_lock_bh(&net->sctp.addr_wq_lock); (deadlock here) This flaw was found using an experimental static analysis tool we are developing for irq-related deadlock. The tentative patch fix the potential deadlock by spin_lock_bh(). Signed-off-by: Chengfeng Ye Fixes: 34e5b0118685 ("sctp: delay auto_asconf init until binding the first addr") Acked-by: Xin Long Link: https://lore.kernel.org/r/20230627120340.19432-1-dg573847474@gmail.com Signed-off-by: Paolo Abeni commit 86fca926c042138c7defc94e1b55b5f29ca4fa13 Author: Andy Shevchenko Date: Mon Jun 26 14:00:23 2023 +0300 ACPI: bus: Constify acpi_companion_match() returned value acpi_companion_match() doesn't alter the contents of the passed parameter, so we don't expect that returned value can be altered either. So constify it. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 7a8227b2e76be506b2ac64d2beac950ca04892a5 Author: Moritz Fischer Date: Tue Jun 27 03:50:00 2023 +0000 net: lan743x: Don't sleep in atomic context dev_set_rx_mode() grabs a spin_lock, and the lan743x implementation proceeds subsequently to go to sleep using readx_poll_timeout(). Introduce a helper wrapping the readx_poll_timeout_atomic() function and use it to replace the calls to readx_polL_timeout(). Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver") Cc: stable@vger.kernel.org Cc: Bryan Whitehead Cc: UNGLinuxDriver@microchip.com Signed-off-by: Moritz Fischer Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230627035000.1295254-1-moritzf@google.com Signed-off-by: Paolo Abeni commit 7ba6b73db3dbe6cf365a8122e4ce36559a7714cc Author: Andy Shevchenko Date: Mon Jun 26 13:55:27 2023 +0300 ACPI: scan: Move acpi_root to internal header Compiler is not happy about handling of acpi_root variable: ...drivers/acpi/bus.c:37:20: warning: symbol 'acpi_root' was not declared. Should it be static? Move it's definition to the internal header. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 75065a8929069bc93181848818e23f147a73f83a Author: Lin Ma Date: Tue Jun 27 11:39:54 2023 +0800 net: af_key: fix sadb_x_filter validation When running xfrm_state_walk_init(), the xfrm_address_filter being used is okay to have a splen/dplen that equals to sizeof(xfrm_address_t)<<3. This commit replaces >= to > to make sure the boundary checking is correct. Fixes: 37bd22420f85 ("af_key: pfkey_dump needs parameter validation") Signed-off-by: Lin Ma Signed-off-by: Steffen Klassert commit dfa73c17d55b921e1d4e154976de35317e43a93a Author: Lin Ma Date: Tue Jun 27 11:31:38 2023 +0800 net: xfrm: Fix xfrm_address_filter OOB read We found below OOB crash: [ 44.211730] ================================================================== [ 44.212045] BUG: KASAN: slab-out-of-bounds in memcmp+0x8b/0xb0 [ 44.212045] Read of size 8 at addr ffff88800870f320 by task poc.xfrm/97 [ 44.212045] [ 44.212045] CPU: 0 PID: 97 Comm: poc.xfrm Not tainted 6.4.0-rc7-00072-gdad9774deaf1-dirty #4 [ 44.212045] Call Trace: [ 44.212045] [ 44.212045] dump_stack_lvl+0x37/0x50 [ 44.212045] print_report+0xcc/0x620 [ 44.212045] ? __virt_addr_valid+0xf3/0x170 [ 44.212045] ? memcmp+0x8b/0xb0 [ 44.212045] kasan_report+0xb2/0xe0 [ 44.212045] ? memcmp+0x8b/0xb0 [ 44.212045] kasan_check_range+0x39/0x1c0 [ 44.212045] memcmp+0x8b/0xb0 [ 44.212045] xfrm_state_walk+0x21c/0x420 [ 44.212045] ? __pfx_dump_one_state+0x10/0x10 [ 44.212045] xfrm_dump_sa+0x1e2/0x290 [ 44.212045] ? __pfx_xfrm_dump_sa+0x10/0x10 [ 44.212045] ? __kernel_text_address+0xd/0x40 [ 44.212045] ? kasan_unpoison+0x27/0x60 [ 44.212045] ? mutex_lock+0x60/0xe0 [ 44.212045] ? __pfx_mutex_lock+0x10/0x10 [ 44.212045] ? kasan_save_stack+0x22/0x50 [ 44.212045] netlink_dump+0x322/0x6c0 [ 44.212045] ? __pfx_netlink_dump+0x10/0x10 [ 44.212045] ? mutex_unlock+0x7f/0xd0 [ 44.212045] ? __pfx_mutex_unlock+0x10/0x10 [ 44.212045] __netlink_dump_start+0x353/0x430 [ 44.212045] xfrm_user_rcv_msg+0x3a4/0x410 [ 44.212045] ? __pfx__raw_spin_lock_irqsave+0x10/0x10 [ 44.212045] ? __pfx_xfrm_user_rcv_msg+0x10/0x10 [ 44.212045] ? __pfx_xfrm_dump_sa+0x10/0x10 [ 44.212045] ? __pfx_xfrm_dump_sa_done+0x10/0x10 [ 44.212045] ? __stack_depot_save+0x382/0x4e0 [ 44.212045] ? filter_irq_stacks+0x1c/0x70 [ 44.212045] ? kasan_save_stack+0x32/0x50 [ 44.212045] ? kasan_save_stack+0x22/0x50 [ 44.212045] ? kasan_set_track+0x25/0x30 [ 44.212045] ? __kasan_slab_alloc+0x59/0x70 [ 44.212045] ? kmem_cache_alloc_node+0xf7/0x260 [ 44.212045] ? kmalloc_reserve+0xab/0x120 [ 44.212045] ? __alloc_skb+0xcf/0x210 [ 44.212045] ? netlink_sendmsg+0x509/0x700 [ 44.212045] ? sock_sendmsg+0xde/0xe0 [ 44.212045] ? __sys_sendto+0x18d/0x230 [ 44.212045] ? __x64_sys_sendto+0x71/0x90 [ 44.212045] ? do_syscall_64+0x3f/0x90 [ 44.212045] ? entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 44.212045] ? netlink_sendmsg+0x509/0x700 [ 44.212045] ? sock_sendmsg+0xde/0xe0 [ 44.212045] ? __sys_sendto+0x18d/0x230 [ 44.212045] ? __x64_sys_sendto+0x71/0x90 [ 44.212045] ? do_syscall_64+0x3f/0x90 [ 44.212045] ? entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 44.212045] ? kasan_save_stack+0x22/0x50 [ 44.212045] ? kasan_set_track+0x25/0x30 [ 44.212045] ? kasan_save_free_info+0x2e/0x50 [ 44.212045] ? __kasan_slab_free+0x10a/0x190 [ 44.212045] ? kmem_cache_free+0x9c/0x340 [ 44.212045] ? netlink_recvmsg+0x23c/0x660 [ 44.212045] ? sock_recvmsg+0xeb/0xf0 [ 44.212045] ? __sys_recvfrom+0x13c/0x1f0 [ 44.212045] ? __x64_sys_recvfrom+0x71/0x90 [ 44.212045] ? do_syscall_64+0x3f/0x90 [ 44.212045] ? entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 44.212045] ? copyout+0x3e/0x50 [ 44.212045] netlink_rcv_skb+0xd6/0x210 [ 44.212045] ? __pfx_xfrm_user_rcv_msg+0x10/0x10 [ 44.212045] ? __pfx_netlink_rcv_skb+0x10/0x10 [ 44.212045] ? __pfx_sock_has_perm+0x10/0x10 [ 44.212045] ? mutex_lock+0x8d/0xe0 [ 44.212045] ? __pfx_mutex_lock+0x10/0x10 [ 44.212045] xfrm_netlink_rcv+0x44/0x50 [ 44.212045] netlink_unicast+0x36f/0x4c0 [ 44.212045] ? __pfx_netlink_unicast+0x10/0x10 [ 44.212045] ? netlink_recvmsg+0x500/0x660 [ 44.212045] netlink_sendmsg+0x3b7/0x700 [ 44.212045] ? __pfx_netlink_sendmsg+0x10/0x10 [ 44.212045] ? __pfx_netlink_sendmsg+0x10/0x10 [ 44.212045] sock_sendmsg+0xde/0xe0 [ 44.212045] __sys_sendto+0x18d/0x230 [ 44.212045] ? __pfx___sys_sendto+0x10/0x10 [ 44.212045] ? rcu_core+0x44a/0xe10 [ 44.212045] ? __rseq_handle_notify_resume+0x45b/0x740 [ 44.212045] ? _raw_spin_lock_irq+0x81/0xe0 [ 44.212045] ? __pfx___rseq_handle_notify_resume+0x10/0x10 [ 44.212045] ? __pfx_restore_fpregs_from_fpstate+0x10/0x10 [ 44.212045] ? __pfx_blkcg_maybe_throttle_current+0x10/0x10 [ 44.212045] ? __pfx_task_work_run+0x10/0x10 [ 44.212045] __x64_sys_sendto+0x71/0x90 [ 44.212045] do_syscall_64+0x3f/0x90 [ 44.212045] entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 44.212045] RIP: 0033:0x44b7da [ 44.212045] RSP: 002b:00007ffdc8838548 EFLAGS: 00000246 ORIG_RAX: 000000000000002c [ 44.212045] RAX: ffffffffffffffda RBX: 00007ffdc8839978 RCX: 000000000044b7da [ 44.212045] RDX: 0000000000000038 RSI: 00007ffdc8838770 RDI: 0000000000000003 [ 44.212045] RBP: 00007ffdc88385b0 R08: 00007ffdc883858c R09: 000000000000000c [ 44.212045] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 44.212045] R13: 00007ffdc8839968 R14: 00000000004c37d0 R15: 0000000000000001 [ 44.212045] [ 44.212045] [ 44.212045] Allocated by task 97: [ 44.212045] kasan_save_stack+0x22/0x50 [ 44.212045] kasan_set_track+0x25/0x30 [ 44.212045] __kasan_kmalloc+0x7f/0x90 [ 44.212045] __kmalloc_node_track_caller+0x5b/0x140 [ 44.212045] kmemdup+0x21/0x50 [ 44.212045] xfrm_dump_sa+0x17d/0x290 [ 44.212045] netlink_dump+0x322/0x6c0 [ 44.212045] __netlink_dump_start+0x353/0x430 [ 44.212045] xfrm_user_rcv_msg+0x3a4/0x410 [ 44.212045] netlink_rcv_skb+0xd6/0x210 [ 44.212045] xfrm_netlink_rcv+0x44/0x50 [ 44.212045] netlink_unicast+0x36f/0x4c0 [ 44.212045] netlink_sendmsg+0x3b7/0x700 [ 44.212045] sock_sendmsg+0xde/0xe0 [ 44.212045] __sys_sendto+0x18d/0x230 [ 44.212045] __x64_sys_sendto+0x71/0x90 [ 44.212045] do_syscall_64+0x3f/0x90 [ 44.212045] entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 44.212045] [ 44.212045] The buggy address belongs to the object at ffff88800870f300 [ 44.212045] which belongs to the cache kmalloc-64 of size 64 [ 44.212045] The buggy address is located 32 bytes inside of [ 44.212045] allocated 36-byte region [ffff88800870f300, ffff88800870f324) [ 44.212045] [ 44.212045] The buggy address belongs to the physical page: [ 44.212045] page:00000000e4de16ee refcount:1 mapcount:0 mapping:000000000 ... [ 44.212045] flags: 0x100000000000200(slab|node=0|zone=1) [ 44.212045] page_type: 0xffffffff() [ 44.212045] raw: 0100000000000200 ffff888004c41640 dead000000000122 0000000000000000 [ 44.212045] raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000 [ 44.212045] page dumped because: kasan: bad access detected [ 44.212045] [ 44.212045] Memory state around the buggy address: [ 44.212045] ffff88800870f200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 44.212045] ffff88800870f280: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc [ 44.212045] >ffff88800870f300: 00 00 00 00 04 fc fc fc fc fc fc fc fc fc fc fc [ 44.212045] ^ [ 44.212045] ffff88800870f380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 44.212045] ffff88800870f400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 44.212045] ================================================================== By investigating the code, we find the root cause of this OOB is the lack of checks in xfrm_dump_sa(). The buggy code allows a malicious user to pass arbitrary value of filter->splen/dplen. Hence, with crafted xfrm states, the attacker can achieve 8 bytes heap OOB read, which causes info leak. if (attrs[XFRMA_ADDRESS_FILTER]) { filter = kmemdup(nla_data(attrs[XFRMA_ADDRESS_FILTER]), sizeof(*filter), GFP_KERNEL); if (filter == NULL) return -ENOMEM; // NO MORE CHECKS HERE !!! } This patch fixes the OOB by adding necessary boundary checks, just like the code in pfkey_dump() function. Fixes: d3623099d350 ("ipsec: add support of limited SA dump") Signed-off-by: Lin Ma Signed-off-by: Steffen Klassert commit c61480a2ea5e5b997d10dfda556d3a63e31f87cd Author: Mauro Carvalho Chehab Date: Wed Jun 28 21:48:53 2023 +0200 media: wl128x: fix a clang warning Clang-16 produces this warning, which is fatal with CONFIG_WERROR: ../drivers/media/radio/wl128x/fmdrv_common.c:1237:19: error: variable 'cmd_cnt' set but not used [-Werror,-Wunused-but-set-variable] int ret, fw_len, cmd_cnt; ^ 1 error generated. What happens is that cmd_cnt tracks the amount of firmware data packets were transfered, which is printed only when debug is used. Switch to use the firmware count, as the message is all about reporting a partial firmware transfer. Link: https://lore.kernel.org/linux-media/6badd27ebfa718d5737f517f18b29a3e0f6e43f8.1687981726.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 22065e4214c1196b54fc164892c2e193a743caf3 Author: Werner Sembach Date: Wed Jun 28 17:54:34 2023 +0200 ALSA: hda/realtek: Add quirk for Clevo NPx0SNx This applies a SND_PCI_QUIRK(...) to the Clevo NPx0SNx barebones fixing the microphone not being detected on the headset combo port. Signed-off-by: Werner Sembach Cc: Link: https://lore.kernel.org/r/20230628155434.584159-1-wse@tuxedocomputers.com Signed-off-by: Takashi Iwai commit 8ac04063354a01a484d2e55d20ed1958aa0d3392 Author: Petr Tesarik Date: Mon Jun 26 15:01:04 2023 +0200 swiotlb: reduce the number of areas to match actual memory pool size Although the desired size of the SWIOTLB memory pool is increased in swiotlb_adjust_nareas() to match the number of areas, the actual allocation may be smaller, which may require reducing the number of areas. For example, Xen uses swiotlb_init_late(), which in turn uses the page allocator. On x86, page size is 4 KiB and MAX_ORDER is 10 (1024 pages), resulting in a maximum memory pool size of 4 MiB. This corresponds to 2048 slots of 2 KiB each. The minimum area size is 128 (IO_TLB_SEGSIZE), allowing at most 2048 / 128 = 16 areas. If num_possible_cpus() is greater than the maximum number of areas, areas are smaller than IO_TLB_SEGSIZE and contiguous groups of free slots will span multiple areas. When allocating and freeing slots, only one area will be properly locked, causing race conditions on the unlocked slots and ultimately data corruption, kernel hangs and crashes. Fixes: 20347fca71a3 ("swiotlb: split up the global swiotlb lock") Signed-off-by: Petr Tesarik Reviewed-by: Roberto Sassu Signed-off-by: Christoph Hellwig commit aabd12609f91155f26584508b01f548215cc3c0c Author: Petr Tesarik Date: Mon Jun 26 15:01:03 2023 +0200 swiotlb: always set the number of areas before allocating the pool The number of areas defaults to the number of possible CPUs. However, the total number of slots may have to be increased after adjusting the number of areas. Consequently, the number of areas must be determined before allocating the memory pool. This is even explained with a comment in swiotlb_init_remap(), but swiotlb_init_late() adjusts the number of areas after slots are already allocated. The areas may end up being smaller than IO_TLB_SEGSIZE, which breaks per-area locking. While fixing swiotlb_init_late(), move all relevant comments before the definition of swiotlb_adjust_nareas() and convert them to kernel-doc. Fixes: 20347fca71a3 ("swiotlb: split up the global swiotlb lock") Signed-off-by: Petr Tesarik Reviewed-by: Roberto Sassu Signed-off-by: Christoph Hellwig commit 9cedc58bdbe9fff9aacd0ca19ee5777659f28fd7 Author: Arnd Bergmann Date: Mon Jun 19 10:19:38 2023 +0200 ksmbd: avoid field overflow warning clang warns about a possible field overflow in a memcpy: In file included from fs/smb/server/smb_common.c:7: include/linux/fortify-string.h:583:4: error: call to '__write_overflow_field' declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror,-Wattribute-warning] __write_overflow_field(p_size_field, size); It appears to interpret the "&out[baselen + 4]" as referring to a single byte of the character array, while the equivalen "out + baselen + 4" is seen as an offset into the array. I don't see that kind of warning elsewhere, so just go with the simple rework. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Signed-off-by: Arnd Bergmann Acked-by: Namjae Jeon Signed-off-by: Steve French commit 9471f1f2f50282b9e8f59198ec6bb738b4ccc009 Merge: 3a8a670eeeaa4 a425ac5365f6c Author: Linus Torvalds Date: Wed Jun 28 20:35:21 2023 -0700 Merge branch 'expand-stack' This modifies our user mode stack expansion code to always take the mmap_lock for writing before modifying the VM layout. It's actually something we always technically should have done, but because we didn't strictly need it, we were being lazy ("opportunistic" sounds so much better, doesn't it?) about things, and had this hack in place where we would extend the stack vma in-place without doing the proper locking. And it worked fine. We just needed to change vm_start (or, in the case of grow-up stacks, vm_end) and together with some special ad-hoc locking using the anon_vma lock and the mm->page_table_lock, it all was fairly straightforward. That is, it was all fine until Ruihan Li pointed out that now that the vma layout uses the maple tree code, we *really* don't just change vm_start and vm_end any more, and the locking really is broken. Oops. It's not actually all _that_ horrible to fix this once and for all, and do proper locking, but it's a bit painful. We have basically three different cases of stack expansion, and they all work just a bit differently: - the common and obvious case is the page fault handling. It's actually fairly simple and straightforward, except for the fact that we have something like 24 different versions of it, and you end up in a maze of twisty little passages, all alike. - the simplest case is the execve() code that creates a new stack. There are no real locking concerns because it's all in a private new VM that hasn't been exposed to anybody, but lockdep still can end up unhappy if you get it wrong. - and finally, we have GUP and page pinning, which shouldn't really be expanding the stack in the first place, but in addition to execve() we also use it for ptrace(). And debuggers do want to possibly access memory under the stack pointer and thus need to be able to expand the stack as a special case. None of these cases are exactly complicated, but the page fault case in particular is just repeated slightly differently many many times. And ia64 in particular has a fairly complicated situation where you can have both a regular grow-down stack _and_ a special grow-up stack for the register backing store. So to make this slightly more manageable, the bulk of this series is to first create a helper function for the most common page fault case, and convert all the straightforward architectures to it. Thus the new 'lock_mm_and_find_vma()' helper function, which ends up being used by x86, arm, powerpc, mips, riscv, alpha, arc, csky, hexagon, loongarch, nios2, sh, sparc32, and xtensa. So we not only convert more than half the architectures, we now have more shared code and avoid some of those twisty little passages. And largely due to this common helper function, the full diffstat of this series ends up deleting more lines than it adds. That still leaves eight architectures (ia64, m68k, microblaze, openrisc, parisc, s390, sparc64 and um) that end up doing 'expand_stack()' manually because they are doing something slightly different from the normal pattern. Along with the couple of special cases in execve() and GUP. So there's a couple of patches that first create 'locked' helper versions of the stack expansion functions, so that there's a obvious path forward in the conversion. The execve() case is then actually pretty simple, and is a nice cleanup from our old "grow-up stackls are special, because at execve time even they grow down". The #ifdef CONFIG_STACK_GROWSUP in that code just goes away, because it's just more straightforward to write out the stack expansion there manually, instead od having get_user_pages_remote() do it for us in some situations but not others and have to worry about locking rules for GUP. And the final step is then to just convert the remaining odd cases to a new world order where 'expand_stack()' is called with the mmap_lock held for reading, but where it might drop it and upgrade it to a write, only to return with it held for reading (in the success case) or with it completely dropped (in the failure case). In the process, we remove all the stack expansion from GUP (where dropping the lock wouldn't be ok without special rules anyway), and add it in manually to __access_remote_vm() for ptrace(). Thanks to Adrian Glaubitz and Frank Scheiner who tested the ia64 cases. Everything else here felt pretty straightforward, but the ia64 rules for stack expansion are really quite odd and very different from everything else. Also thanks to Vegard Nossum who caught me getting one of those odd conditions entirely the wrong way around. Anyway, I think I want to actually move all the stack expansion code to a whole new file of its own, rather than have it split up between mm/mmap.c and mm/memory.c, but since this will have to be backported to the initial maple tree vma introduction anyway, I tried to keep the patches _fairly_ minimal. Also, while I don't think it's valid to expand the stack from GUP, the final patch in here is a "warn if some crazy GUP user wants to try to expand the stack" patch. That one will be reverted before the final release, but it's left to catch any odd cases during the merge window and release candidates. Reported-by: Ruihan Li * branch 'expand-stack': gup: add warning if some caller would seem to want stack expansion mm: always expand the stack with the mmap write lock held execve: expand new process stack manually ahead of time mm: make find_extend_vma() fail if write lock not held powerpc/mm: convert coprocessor fault to lock_mm_and_find_vma() mm/fault: convert remaining simple cases to lock_mm_and_find_vma() arm/mm: Convert to using lock_mm_and_find_vma() riscv/mm: Convert to using lock_mm_and_find_vma() mips/mm: Convert to using lock_mm_and_find_vma() powerpc/mm: Convert to using lock_mm_and_find_vma() arm64/mm: Convert to using lock_mm_and_find_vma() mm: make the page fault mmap locking killable mm: introduce new 'lock_mm_and_find_vma()' page fault helper commit 24033d71cc36ae8af02b56ec22c7490779a9e39f Author: Keoseong Park Date: Tue Jun 27 10:29:31 2023 +0900 scsi: ufs: core: Remove unused function declaration Commit 2468da61ea09 ("scsi: ufs: core: mcq: Configure operation and runtime interface") added ufshcd_mcq_select_mcq_mode(), but it's not used anywhere. So remove it. Signed-off-by: Keoseong Park Link: https://lore.kernel.org/r/20230627012931epcms2p76f458e0b2ce8a591b56bbcc6a2f1a3bb@epcms2p7 Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 7bcf57782503b7025941372863a20e2587483baf Author: Rong Tao Date: Mon Jun 26 08:51:47 2023 +0800 scsi: target: docs: Remove tcm_mod_builder.py This script is not used and requires additional development to sync with the SCSI target code. Signed-off-by: Rong Tao Link: https://lore.kernel.org/r/tencent_58D7935159C421036421B42CD04B0A959207@qq.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 40863cb945c93a55aeaf8a2fd2bef1c7507ee8f2 Author: Mike Christie Date: Fri Jun 23 11:11:36 2023 -0500 scsi: target: iblock: Quiet bool conversion warning with pr_preempt use We want to pass in true for pr_preempt's argument if we are doing a PRO_PREEMPT_AND_ABORT, so just test sa against PRO_PREEMPT_AND_ABORT, and pass the result directly to pr_preempt. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306221655.Kwtqi1gI-lkp@intel.com/ Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230623161136.6270-1-michael.christie@oracle.com Reviewed-by: Maurizio Lombardi Signed-off-by: Martin K. Petersen commit 9b7c13b83c1dedb79a746eae9dfabc10a2673049 Author: Abel Vesa Date: Fri Jun 23 14:30:05 2023 +0300 scsi: dt-bindings: ufs: qcom: Fix ICE phandle The check for 'qcom,ice' property is wrong. Fix it by checking using if-required clause and expand the clocks minItems and maxItems for platforms where 'qcom,ice' is not required so that it includes platforms with single reg entry and clocks that do not provide an ICE one. Fixes: 29a6d1215b7c ("scsi: ufs: dt-bindings: qcom: Add ICE phandle") Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20230623113009.2512206-2-abel.vesa@linaro.org Reviewed-by: Krzysztof Kozlowski Signed-off-by: Martin K. Petersen commit 71e3e85ccf2b816e612c94b7460309dc5007caef Author: Damien Le Moal Date: Fri Jun 23 16:30:57 2023 +0900 scsi: core: Simplify scsi_cdl_check_cmd() Reading the 800+ pages of SPC often leads to a brain shutdown and to less than ideal code... This resulted in the checks of the rwcdlp and cdlp fields in scsi_cdl_check_cmd() to have identical if-else branches. Replace this with a comment describing the cases we are interested in and replace the if-else code block with a simple test of the cdlp field that is used as the function return value. Reported-by: kernel test robot Reported-by: Julia Lawall Closes: https://lore.kernel.org/r/202306221657.BJHEADkz-lkp@intel.com/ Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230623073057.816199-1-dlemoal@kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 4e45236982bcc3ce8a0ea719e1159cc5c935eb94 Author: Yueh-Shun Li Date: Thu Jun 22 01:26:29 2023 +0000 scsi: isci: Fix comment typo Spell "transmitting" properly. Found by searching for keyword "tranm". Signed-off-by: Yueh-Shun Li Link: https://lore.kernel.org/r/20230622012627.15050-5-shamrocklee@posteo.net Signed-off-by: Martin K. Petersen commit 3a8a670eeeaa40d87bd38a587438952741980c18 Merge: 6a8cbd9253abc ae230642190a5 Author: Linus Torvalds Date: Wed Jun 28 16:43:10 2023 -0700 Merge tag 'net-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next Pull networking changes from Jakub Kicinski: "WiFi 7 and sendpage changes are the biggest pieces of work for this release. The latter will definitely require fixes but I think that we got it to a reasonable point. Core: - Rework the sendpage & splice implementations Instead of feeding data into sockets page by page extend sendmsg handlers to support taking a reference on the data, controlled by a new flag called MSG_SPLICE_PAGES Rework the handling of unexpected-end-of-file to invoke an additional callback instead of trying to predict what the right combination of MORE/NOTLAST flags is Remove the MSG_SENDPAGE_NOTLAST flag completely - Implement SCM_PIDFD, a new type of CMSG type analogous to SCM_CREDENTIALS, but it contains pidfd instead of plain pid - Enable socket busy polling with CONFIG_RT - Improve reliability and efficiency of reporting for ref_tracker - Auto-generate a user space C library for various Netlink families Protocols: - Allow TCP to shrink the advertised window when necessary, prevent sk_rcvbuf auto-tuning from growing the window all the way up to tcp_rmem[2] - Use per-VMA locking for "page-flipping" TCP receive zerocopy - Prepare TCP for device-to-device data transfers, by making sure that payloads are always attached to skbs as page frags - Make the backoff time for the first N TCP SYN retransmissions linear. Exponential backoff is unnecessarily conservative - Create a new MPTCP getsockopt to retrieve all info (MPTCP_FULL_INFO) - Avoid waking up applications using TLS sockets until we have a full record - Allow using kernel memory for protocol ioctl callbacks, paving the way to issuing ioctls over io_uring - Add nolocalbypass option to VxLAN, forcing packets to be fully encapsulated even if they are destined for a local IP address - Make TCPv4 use consistent hash in TIME_WAIT and SYN_RECV. Ensure in-kernel ECMP implementation (e.g. Open vSwitch) select the same link for all packets. Support L4 symmetric hashing in Open vSwitch - PPPoE: make number of hash bits configurable - Allow DNS to be overwritten by DHCPACK in the in-kernel DHCP client (ipconfig) - Add layer 2 miss indication and filtering, allowing higher layers (e.g. ACL filters) to make forwarding decisions based on whether packet matched forwarding state in lower devices (bridge) - Support matching on Connectivity Fault Management (CFM) packets - Hide the "link becomes ready" IPv6 messages by demoting their printk level to debug - HSR: don't enable promiscuous mode if device offloads the proto - Support active scanning in IEEE 802.15.4 - Continue work on Multi-Link Operation for WiFi 7 BPF: - Add precision propagation for subprogs and callbacks. This allows maintaining verification efficiency when subprograms are used, or in fact passing the verifier at all for complex programs, especially those using open-coded iterators - Improve BPF's {g,s}setsockopt() length handling. Previously BPF assumed the length is always equal to the amount of written data. But some protos allow passing a NULL buffer to discover what the output buffer *should* be, without writing anything - Accept dynptr memory as memory arguments passed to helpers - Add routing table ID to bpf_fib_lookup BPF helper - Support O_PATH FDs in BPF_OBJ_PIN and BPF_OBJ_GET commands - Drop bpf_capable() check in BPF_MAP_FREEZE command (used to mark maps as read-only) - Show target_{obj,btf}_id in tracing link fdinfo - Addition of several new kfuncs (most of the names are self-explanatory): - Add a set of new dynptr kfuncs: bpf_dynptr_adjust(), bpf_dynptr_is_null(), bpf_dynptr_is_rdonly(), bpf_dynptr_size() and bpf_dynptr_clone(). - bpf_task_under_cgroup() - bpf_sock_destroy() - force closing sockets - bpf_cpumask_first_and(), rework bpf_cpumask_any*() kfuncs Netfilter: - Relax set/map validation checks in nf_tables. Allow checking presence of an entry in a map without using the value - Increase ip_vs_conn_tab_bits range for 64BIT builds - Allow updating size of a set - Improve NAT tuple selection when connection is closing Driver API: - Integrate netdev with LED subsystem, to allow configuring HW "offloaded" blinking of LEDs based on link state and activity (i.e. packets coming in and out) - Support configuring rate selection pins of SFP modules - Factor Clause 73 auto-negotiation code out of the drivers, provide common helper routines - Add more fool-proof helpers for managing lifetime of MDIO devices associated with the PCS layer - Allow drivers to report advanced statistics related to Time Aware scheduler offload (taprio) - Allow opting out of VF statistics in link dump, to allow more VFs to fit into the message - Split devlink instance and devlink port operations New hardware / drivers: - Ethernet: - Synopsys EMAC4 IP support (stmmac) - Marvell 88E6361 8 port (5x1GE + 3x2.5GE) switches - Marvell 88E6250 7 port switches - Microchip LAN8650/1 Rev.B0 PHYs - MediaTek MT7981/MT7988 built-in 1GE PHY driver - WiFi: - Realtek RTL8192FU, 2.4 GHz, b/g/n mode, 2T2R, 300 Mbps - Realtek RTL8723DS (SDIO variant) - Realtek RTL8851BE - CAN: - Fintek F81604 Drivers: - Ethernet NICs: - Intel (100G, ice): - support dynamic interrupt allocation - use meta data match instead of VF MAC addr on slow-path - nVidia/Mellanox: - extend link aggregation to handle 4, rather than just 2 ports - spawn sub-functions without any features by default - OcteonTX2: - support HTB (Tx scheduling/QoS) offload - make RSS hash generation configurable - support selecting Rx queue using TC filters - Wangxun (ngbe/txgbe): - add basic Tx/Rx packet offloads - add phylink support (SFP/PCS control) - Freescale/NXP (enetc): - report TAPRIO packet statistics - Solarflare/AMD: - support matching on IP ToS and UDP source port of outer header - VxLAN and GENEVE tunnel encapsulation over IPv4 or IPv6 - add devlink dev info support for EF10 - Virtual NICs: - Microsoft vNIC: - size the Rx indirection table based on requested configuration - support VLAN tagging - Amazon vNIC: - try to reuse Rx buffers if not fully consumed, useful for ARM servers running with 16kB pages - Google vNIC: - support TCP segmentation of >64kB frames - Ethernet embedded switches: - Marvell (mv88e6xxx): - enable USXGMII (88E6191X) - Microchip: - lan966x: add support for Egress Stage 0 ACL engine - lan966x: support mapping packet priority to internal switch priority (based on PCP or DSCP) - Ethernet PHYs: - Broadcom PHYs: - support for Wake-on-LAN for BCM54210E/B50212E - report LPI counter - Microsemi PHYs: support RGMII delay configuration (VSC85xx) - Micrel PHYs: receive timestamp in the frame (LAN8841) - Realtek PHYs: support optional external PHY clock - Altera TSE PCS: merge the driver into Lynx PCS which it is a variant of - CAN: Kvaser PCIEcan: - support packet timestamping - WiFi: - Intel (iwlwifi): - major update for new firmware and Multi-Link Operation (MLO) - configuration rework to drop test devices and split the different families - support for segmented PNVM images and power tables - new vendor entries for PPAG (platform antenna gain) feature - Qualcomm 802.11ax (ath11k): - Multiple Basic Service Set Identifier (MBSSID) and Enhanced MBSSID Advertisement (EMA) support in AP mode - support factory test mode - RealTek (rtw89): - add RSSI based antenna diversity - support U-NII-4 channels on 5 GHz band - RealTek (rtl8xxxu): - AP mode support for 8188f - support USB RX aggregation for the newer chips" * tag 'net-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1602 commits) net: scm: introduce and use scm_recv_unix helper af_unix: Skip SCM_PIDFD if scm->pid is NULL. net: lan743x: Simplify comparison netlink: Add __sock_i_ino() for __netlink_diag_dump(). net: dsa: avoid suspicious RCU usage for synced VLAN-aware MAC addresses Revert "af_unix: Call scm_recv() only after scm_set_cred()." phylink: ReST-ify the phylink_pcs_neg_mode() kdoc libceph: Partially revert changes to support MSG_SPLICE_PAGES net: phy: mscc: fix packet loss due to RGMII delays net: mana: use vmalloc_array and vcalloc net: enetc: use vmalloc_array and vcalloc ionic: use vmalloc_array and vcalloc pds_core: use vmalloc_array and vcalloc gve: use vmalloc_array and vcalloc octeon_ep: use vmalloc_array and vcalloc net: usb: qmi_wwan: add u-blox 0x1312 composition perf trace: fix MSG_SPLICE_PAGES build error ipvlan: Fix return value of ipvlan_queue_xmit() netfilter: nf_tables: fix underflow in chain reference counter netfilter: nf_tables: unbind non-anonymous set if rule construction fails ... commit 6a8cbd9253abc1bd0df4d60c4c24fa555190376d Merge: 4e3c09e95499e 2f2665c13af48 Author: Linus Torvalds Date: Wed Jun 28 16:05:21 2023 -0700 Merge tag 'v6.5-rc1-sysctl-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull sysctl updates from Luis Chamberlain: "The changes for sysctl are in line with prior efforts to stop usage of deprecated routines which incur recursion and also make it hard to remove the empty array element in each sysctl array declaration. The most difficult user to modify was parport which required a bit of re-thinking of how to declare shared sysctls there, Joel Granados has stepped up to the plate to do most of this work and eventual removal of register_sysctl_table(). That work ended up saving us about 1465 bytes according to bloat-o-meter. Since we gained a few bloat-o-meter karma points I moved two rather small sysctl arrays from kernel/sysctl.c leaving us only two more sysctl arrays to move left. Most changes have been tested on linux-next for about a month. The last straggler patches are a minor parport fix, changes to the sysctl kernel selftest so to verify correctness and prevent regressions for the future change he made to provide an alternative solution for the special sysctl mount point target which was using the now deprecated sysctl child element. This is all prep work to now finally be able to remove the empty array element in all sysctl declarations / registrations which is expected to save us a bit of bytes all over the kernel. That work will be tested early after v6.5-rc1 is out" * tag 'v6.5-rc1-sysctl-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: sysctl: replace child with an enumeration sysctl: Remove debugging dump_stack test_sysclt: Test for registering a mount point test_sysctl: Add an option to prevent test skip test_sysctl: Add an unregister sysctl test test_sysctl: Group node sysctl test under one func test_sysctl: Fix test metadata getters parport: plug a sysctl register leak sysctl: move security keys sysctl registration to its own file sysctl: move umh sysctl registration to its own file signal: move show_unhandled_signals sysctl to its own file sysctl: remove empty dev table sysctl: Remove register_sysctl_table sysctl: Refactor base paths registrations sysctl: stop exporting register_sysctl_table parport: Removed sysctl related defines parport: Remove register_sysctl_table from parport_default_proc_register parport: Remove register_sysctl_table from parport_device_proc_register parport: Remove register_sysctl_table from parport_proc_register parport: Move magic number "15" to a define commit 4e3c09e95499e83dafc93860d56070a76d20e830 Merge: 9b9879fc03275 0eeaf1eb40a34 Author: Linus Torvalds Date: Wed Jun 28 15:51:08 2023 -0700 Merge tag 'v6.5-rc1-modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull module updates from Luis Chamberlain: "The changes queued up for modules are pretty tame, mostly code removal of moving of code. Only two minor functional changes are made, the only one which stands out is Sebastian Andrzej Siewior's simplification of module reference counting by removing preempt_disable() and that has been tested on linux-next for well over a month without no regressions. I'm now, I guess, also a kitchen sink for some kallsyms changes" [ There was a mis-communication about the concurrent module load changes that I had expected to come through Luis despite me authoring the patch. So some of the module updates were left hanging in the email ether, and I just committed them separately. It's my bad - I should have made it more clear that I expected my own patches to come through the module tree too. Now they missed linux-next, but hopefully that won't cause any issues - Linus ] * tag 'v6.5-rc1-modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: kallsyms: make kallsyms_show_value() as generic function kallsyms: move kallsyms_show_value() out of kallsyms.c kallsyms: remove unsed API lookup_symbol_attrs kallsyms: remove unused arch_get_kallsym() helper module: Remove preempt_disable() from module reference counting. commit 9b9879fc03275ffe0da328cf5b864d9e694167c8 Author: Linus Torvalds Date: Mon May 29 21:39:51 2023 -0400 modules: catch concurrent module loads, treat them as idempotent This is the new-and-improved attempt at avoiding huge memory load spikes when the user space boot sequence tries to load hundreds (or even thousands) of redundant duplicate modules in parallel. See commit 9828ed3f695a ("module: error out early on concurrent load of the same module file") for background and an earlier failed attempt that was reverted. That earlier attempt just said "concurrently loading the same module is silly, just open the module file exclusively and return -ETXTBSY if somebody else is already loading it". While it is true that concurrent module loads of the same module is silly, the reason that earlier attempt then failed was that the concurrently loaded module would often be a prerequisite for another module. Thus failing to load the prerequisite would then cause cascading failures of the other modules, rather than just short-circuiting that one unnecessary module load. At the same time, we still really don't want to load the contents of the same module file hundreds of times, only to then wait for an eventually successful load, and have everybody else return -EEXIST. As a result, this takes another approach, and treats concurrent module loads from the same file as "idempotent" in the inode. So if one module load is ongoing, we don't start a new one, but instead just wait for the first one to complete and return the same return value as it did. So unlike the first attempt, this does not return early: the intent is not to speed up the boot, but to avoid a thundering herd problem in allocating memory (both physical and virtual) for a module more than once. Also note that this does change behavior: it used to be that when you had concurrent loads, you'd have one "winner" that would return success, and everybody else would return -EEXIST. In contrast, this idempotent logic goes all Oprah on the problem, and says "You are a winner! And you are a winner! We are ALL winners". But since there's no possible actual real semantic difference between "you loaded the module" and "somebody else already loaded the module", this is more of a feel-good change than an actual honest-to-goodness semantic change. Of course, any true Johnny-come-latelies that don't get caught in the concurrency filter will still return -EEXIST. It's no different from not even getting a seat at an Oprah taping. That's life. See the long thread on the kernel mailing list about this all, which includes some numbers for memory use before and after the patch. Link: https://lore.kernel.org/lkml/20230524213620.3509138-1-mcgrof@kernel.org/ Reviewed-by: Johan Hovold Tested-by: Johan Hovold Tested-by: Luis Chamberlain Tested-by: Dan Williams Tested-by: Rudi Heitbaum Tested-by: David Hildenbrand Signed-off-by: Linus Torvalds commit 054a73009c22a5fb8bbeee5394980809276bc9fe Author: Linus Torvalds Date: Mon May 29 20:55:13 2023 -0400 module: split up 'finit_module()' into init_module_from_file() helper This will simplify the next step, where we can then key off the inode to do one idempotent module load. Let's do the obvious re-organization in one step, and then the new code in another. Signed-off-by: Linus Torvalds commit 9408d8a37e6cce8803681ab816383450a056c3a9 Author: Keith Busch Date: Mon Jun 12 12:03:43 2023 -0700 nvme: improved uring polling Drivers can poll requests directly, so use that. We just need to ensure the driver's request was allocated from a polled hctx, so a special driver flag is added to struct io_uring_cmd. The allows unshared and multipath namespaces to use the same polling callback, and multipath is guaranteed to get the same queue as the command was submitted on. Previously multipath polling might check a different path and poll the wrong info. The other bonus is we don't need a bio payload in order to poll, allowing commands like 'flush' and 'write zeroes' to be submitted on the same high priority queue as read and write commands. Finally, using the request based polling skips the unnecessary bio overhead. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230612190343.2087040-3-kbusch@meta.com Signed-off-by: Jens Axboe commit f6c80cffcd47a2d41943e3a41fbe9034d9f6d7b0 Author: Keith Busch Date: Mon Jun 12 12:03:42 2023 -0700 block: add request polling helper Provide a direct request polling will for drivers. The interface does not require a bio, and can skip the overhead associated with polling those. The biggest gain from skipping the relatively expensive xarray lookup unnecessary when you already have the request. With this, the simple rq/qc conversion functions have only one caller each, so open code this and remove the helpers. Signed-off-by: Keith Busch Reviewed-by: Kanchan Joshi Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230612190343.2087040-2-kbusch@meta.com Signed-off-by: Jens Axboe commit 3a08284ff22080e742814dad1dbabb4b66349642 Merge: 89181f544ffa4 6d85ebf95c44e Author: Jens Axboe Date: Wed Jun 28 16:08:19 2023 -0600 Merge branch 'for-6.5/block-late' into block-6.5 * for-6.5/block-late: blk-sysfs: add a new attr_group for blk_mq blk-iocost: move wbt_enable/disable_default() out of spinlock blk-wbt: cleanup rwb_enabled() and wbt_disabled() blk-wbt: remove dead code to handle wbt enable/disable with io inflight blk-wbt: don't create wbt sysfs entry if CONFIG_BLK_WBT is disabled blk-mq: fix two misuses on RQF_USE_SCHED blk-throttle: Fix io statistics for cgroup v1 bcache: Fix bcache device claiming bcache: Alloc holder object before async registration raid10: avoid spin_lock from fastpath from raid10_unplug() md: fix 'delete_mutex' deadlock md: use mddev->external to select holder in export_rdev() md/raid1-10: fix casting from randomized structure in raid1_submit_write() md/raid10: fix the condition to call bio_end_io_acct() commit 89181f544ffa4da682b0145738342f9b78b9e8dc Merge: 1364b4068a421 06b5d4fea89cd Author: Linus Torvalds Date: Wed Jun 28 14:06:39 2023 -0700 Merge tag 'mmc-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC updates from Ulf Hansson: "MMC core: - Allow synchronous detection of (e)MMC/SD/SDIO cards - Fixup error check for ioctls for SPI hosts - Disable broken SD-Cache support for Kingston Canvas Go Plus from 2019 - Disable broken eMMC-Trim support for Kingston EMMC04G-M627 - Disable broken eMMC-Trim support for Micron MTFC4GACAJCN-1M MMC host: - bcm2835: Convert DT bindings to YAML - mmci: - Enable asynchronous probe - Transform the ux500 HW-busy detection into a proper state machine - Add support for SW busy-end timeouts for the ux500 variants - mmci_stm32: - Add support for sdm32 variant revision v3.0 used on STM32MP25 - Improve the tuning sequence - mtk-sd: Tune polling-period to improve performance - sdhci: Fixup DMA configuration for 64-bit DMA mode - sdhci-bcm-kona: Convert DT bindings to YAML - sdhci-msm: - Switch to use the new ICE API - Add support for the SC8280XP/IPQ6018/QDU1000/QRU1000 variants - sdhci-pci-gli: - Add support SD Express cards for GL9767 - Add support for the Genesys Logic GL9767 variant" * tag 'mmc-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (42 commits) dt-bindings: mmc: fsl-imx-esdhc: Add imx6ul support mmc: mmci: Add support for SW busy-end timeouts mmc: Add MMC_QUIRK_BROKEN_SD_CACHE for Kingston Canvas Go Plus from 11/2019 mmc: core: disable TRIM on Kingston EMMC04G-M627 mmc: mmci: stm32: add delay block support for STM32MP25 mmc: mmci: stm32: prepare other delay block support mmc: mmci: stm32: manage block gap hardware flow control mmc: mmci: Add support for sdmmc variant revision v3.0 mmc: mmci: add stm32_idmabsize_align parameter dt-bindings: mmc: mmci: Add st,stm32mp25-sdmmc2 compatible mmc: core: disable TRIM on Micron MTFC4GACAJCN-1M mmc: mmci: Break out a helper function mmc: mmci: Use a switch statement machine mmc: mmci: Use state machine state as exit condition mmc: mmci: Retry the busy start condition mmc: mmci: Make busy complete state machine explicit mmc: mmci: Break out error check in busy detect mmc: mmci: Stash status while waiting for busy mmc: mmci: Unwind big if() clause mmc: mmci: Clear busy_status when starting command ... commit 1364b4068a421d99fb4da8b570e54525096b1cef Merge: 84fccbba93103 cf431a5998326 Author: Linus Torvalds Date: Wed Jun 28 14:02:03 2023 -0700 Merge tag 'mtd/for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull mtd updates from "Core MTD changes: - otp: - Put factory OTP/NVRAM into the entropy pool - Clean up on error in mtd_otp_nvmem_add() MTD devices changes: - sm_ftl: Fix typos in comments - Use SPDX license headers - pismo: Switch back to use i2c_driver's .probe() - mtdpart: Drop useless LIST_HEAD - st_spi_fsm: Use the devm_clk_get_enabled() helper function DT binding changes: - partitions: - Include TP-Link SafeLoader in allowed list - Add missing type for "linux,rootfs" - Extend the nand node names filter - Create a file for raw NAND chip properties - Mark nand-ecc-placement deprecated - Describe nand-ecc-mode - Prevent NAND chip unevaluated properties in all NAND bindings with a NAND chip reference. - Qcom: Fix a property position - Marvell: Convert to YAML DT schema Raw NAND chip drivers changes: - Macronix: OTP access for MX30LFxG18AC - Add basic Sandisk manufacturer ops - Add support for Sandisk SDTNQGAMA Raw NAND controller driver changes: - Meson: - Replace integer consts with proper defines - Allow waiting w/o wired ready/busy pin - Check buffer length validity - Fix unaligned DMA buffers handling - dt-bindings: Fix 'nand-rb' property - Arasan: Revert "mtd: rawnand: arasan: Prevent an unsupported configuration" as this limitation is no longer true thanks to the recent efforts in improving the clocks support in this driver SPI-NAND changes: - Gigadevice: add support for GD5F2GQ5xExxH - Macronix: Add support for serial NAND flashes" * tag 'mtd/for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (38 commits) dt-bindings: mtd: marvell-nand: Convert to YAML DT scheme dt-bindings: mtd: ti,am654: Prevent unevaluated properties dt-bindings: mtd: mediatek: Prevent NAND chip unevaluated properties dt-bindings: mtd: mediatek: Reference raw-nand-chip.yaml dt-bindings: mtd: stm32: Prevent NAND chip unevaluated properties dt-bindings: mtd: rockchip: Prevent NAND chip unevaluated properties dt-bindings: mtd: intel: Prevent NAND chip unevaluated properties dt-bindings: mtd: denali: Prevent NAND chip unevaluated properties dt-bindings: mtd: brcmnand: Prevent NAND chip unevaluated properties dt-bindings: mtd: meson: Prevent NAND chip unevaluated properties dt-bindings: mtd: sunxi: Prevent NAND chip unevaluated properties dt-bindings: mtd: ingenic: Prevent NAND chip unevaluated properties dt-bindings: mtd: qcom: Prevent NAND chip unevaluated properties dt-bindings: mtd: qcom: Fix a property position dt-bindings: mtd: Describe nand-ecc-mode dt-bindings: mtd: Mark nand-ecc-placement deprecated dt-bindings: mtd: Create a file for raw NAND chip properties dt-bindings: mtd: Accept nand related node names mtd: sm_ftl: Fix typos in comments mtd: otp: clean up on error in mtd_otp_nvmem_add() ... commit 5f2a0afa9890e728428db2ed9281bddca242e90b Author: Paulo Alcantara Date: Tue Jun 27 21:24:50 2023 -0300 smb: client: improve DFS mount check Some servers may return error codes from REQ_GET_DFS_REFERRAL requests that are unexpected by the client, so to make it easier, assume non-DFS mounts when the client can't get the initial DFS referral of @ctx->UNC in dfs_mount_share(). Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 3ae872de410751fe5e629e04da491a632d95201c Author: Paulo Alcantara Date: Mon Jun 26 16:04:17 2023 -0300 smb: client: fix shared DFS root mounts with different prefixes When having two DFS root mounts that are connected to same namespace, same mount options but different prefix paths, we can't really use the shared @server->origin_fullpath when chasing DFS links in them. Move the origin_fullpath field to cifs_tcon structure so when having shared DFS root mounts with different prefix paths, and we need to chase any DFS links, dfs_get_automount_devname() will pick up the correct full path out of the @tcon that will be used for the new mount. Before patch mount.cifs //dom/dfs/dir /mnt/1 -o ... mount.cifs //dom/dfs /mnt/2 -o ... # shared server, ses, tcon # server: origin_fullpath=//dom/dfs/dir # @server->origin_fullpath + '/dir/link1' $ ls /mnt/2/dir/link1 ls: cannot open directory '/mnt/2/dir/link1': No such file or directory After patch mount.cifs //dom/dfs/dir /mnt/1 -o ... mount.cifs //dom/dfs /mnt/2 -o ... # shared server & ses # tcon_1: origin_fullpath=//dom/dfs/dir # tcon_2: origin_fullpath=//dom/dfs # @tcon_2->origin_fullpath + '/dir/link1' $ ls /mnt/2/dir/link1 dir0 dir1 dir10 dir3 dir5 dir6 dir7 dir9 target2_file.txt tsub Fixes: 8e3554150d6c ("cifs: fix sharing of DFS connections") Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 84fccbba93103b22044617e419ba20e1403b4a65 Merge: 362067b6d5ca5 e884a133340a4 Author: Linus Torvalds Date: Wed Jun 28 13:48:42 2023 -0700 Merge tag 'spi-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "One small core feature this time around but mostly driver improvements and additions for SPI: - Add support for controlling the idle state of MOSI, some systems can support this and depending on the system integration may need it to avoid glitching in some situations - Support for polling mode in the S3C64xx driver and DMA on the Qualcomm QSPI driver - Support for several Allwinner SoCs, AMD Pensando Elba, Intel Mount Evans, Renesas RZ/V2M, and ST STM32H7" * tag 'spi-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (66 commits) spi: dt-bindings: atmel,at91rm9200-spi: fix broken sam9x7 compatible spi: dt-bindings: atmel,at91rm9200-spi: add sam9x7 compatible spi: Add support for Renesas CSI spi: dt-bindings: Add bindings for RZ/V2M CSI spi: sun6i: Use the new helper to derive the xfer timeout value spi: atmel: Prevent false timeouts on long transfers spi: dt-bindings: stm32: do not disable spi-slave property for stm32f4-f7 spi: Create a helper to derive adaptive timeouts spi: spi-geni-qcom: correctly handle -EPROBE_DEFER from dma_request_chan() spi: stm32: disable spi-slave property for stm32f4-f7 spi: stm32: introduction of stm32h7 SPI device mode support spi: stm32: use dmaengine_terminate_{a}sync instead of _all spi: stm32: renaming of spi_master into spi_controller spi: dw: Remove misleading comment for Mount Evans SoC spi: dt-bindings: snps,dw-apb-ssi: Add compatible for Intel Mount Evans SoC spi: dw: Add compatible for Intel Mount Evans SoC spi: s3c64xx: Use dev_err_probe() spi: s3c64xx: Use the managed spi master allocation function spi: spl022: Probe defer is no error spi: spi-imx: fix mixing of native and gpio chipselects for imx51/imx53/imx6 variants ... commit 362067b6d5ca5b59a849a8e1183fb51d616fcf19 Merge: 4171a9aa23598 54e47eade7304 Author: Linus Torvalds Date: Wed Jun 28 13:32:47 2023 -0700 Merge tag 'regulator-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "This release is almost all drivers, there's some small improvements in the core but otherwise everything is updates to drivers, mostly the addition of new ones. There's also a bunch of changes pulled in from the MFD subsystem as dependencies, Rockchip and TI core MFD code that the regulator drivers depend on. I've also yet again managed to put a SPI commit in the regulator tree, I don't know what it is about those two trees (this for spi-geni-qcom). Summary: - Support for Renesas RAA215300, Rockchip RK808, Texas Instruments TPS6594 and TPS6287x, and X-Powers AXP15060 and AXP313a" * tag 'regulator-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (43 commits) regulator: Add Renesas PMIC RAA215300 driver regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings regulator: ltc3676: Use maple tree register cache regulator: ltc3589: Use maple tree register cache regulator: helper: Document ramp_delay parameter of regulator_set_ramp_delay_regmap() regulator: mt6358: Use linear voltage helpers for single range regulators regulator: mt6358: Const-ify mt6358_regulator_info data structures regulator: mt6358: Drop *_SSHUB regulators regulator: mt6358: Merge VCN33_* regulators regulator: dt-bindings: mt6358: Drop *_sshub regulators regulator: dt-bindings: mt6358: Merge ldo_vcn33_* regulators regulator: dt-bindings: pwm-regulator: Add missing type for "pwm-dutycycle-unit" regulator: Switch two more i2c drivers back to use .probe() spi: spi-geni-qcom: Do not do DMA map/unmap inside driver, use framework instead soc: qcom: geni-se: Add interfaces geni_se_tx_init_dma() and geni_se_rx_init_dma() regulator: tps6594-regulator: Add driver for TI TPS6594 regulators regulator: axp20x: Add AXP15060 support regulator: axp20x: Add support for AXP313a variant dt-bindings: pfuze100.yaml: Add an entry for interrupts regulator: stm32-pwr: Fix regulator disabling ... commit e9bd04e52d649c3cfd713b594c5db35cab03c42b Author: Biju Das Date: Wed Jun 28 18:40:04 2023 +0100 regulator: raa215300: Add build dependency with COMMON_CLK The COMMON_CLK config is not enabled in some of the architectures. This causes build issues. Fix these issues by adding build dependency. ERROR: modpost: "clk_unregister_fixed_rate" [drivers/regulator/raa215300.ko] undefined! ERROR: modpost: "clk_register_fixed_rate" [drivers/regulator/raa215300.ko] undefined! Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306282012.sPQAuAN7-lkp@intel.com/ Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230628174004.63984-1-biju.das.jz@bp.renesas.com Reviewed-by: Geert Uytterhoeven Signed-off-by: Mark Brown commit 4171a9aa235988fc5cb19d84d493496cb73e6988 Merge: 1b2c92a1cb246 d0c99ffe21267 Author: Linus Torvalds Date: Wed Jun 28 13:26:19 2023 -0700 Merge tag 'regmap-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap updates from Mark Brown: "Another busy release for regmap with the second half of the maple tree register cache implementation, there's some smaller optimisations that could be done but this should now be able to replace the rbtree cache for most devices. We also had a followup from Aidan MacDonald's refactoring of some of the regmap-irq interfaces, the conversion is complete so the old interfaces are removed. This means that even with the new features for the maple tree cache we'd have a nice negative diffstat were it not for the addition of a bunch more KUnit coverage. There's one GPIO patch in here, it was a dependency for a cleanup of an API in the regmap-irq code for which the gpio-104-dio-48e driver was the only user. Highlights: - The maple tree cache can now load in default values more efficiently, and is capabale of syncing multiple registers in a single write during cache sync - More KUnit coverage, including some coverage for raw I/O and a dummy RAM backed cache to support it - Removal of several old interfaces in regmap-irq now all users have been modernised" * tag 'regmap-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: (23 commits) regmap: Allow reads from write only registers with the flat cache regmap: Drop early readability check regmap: Check for register readability before checking cache during read regmap: Add test to make sure we don't sync to read only registers regmap: Add a test case for write only registers regmap: Add test that writes to write only registers are prevented regmap: Add debugfs file for forcing field writes regmap: Don't check for changes in regcache_set_val() regmap: maple: Implement block sync for the maple tree cache regmap: Provide basic KUnit coverage for the raw register I/O regmap: Provide a ram backed regmap with raw support regmap: Add missing cache_only checks regmap: regmap-irq: Move handle_post_irq to before pm_runtime_put regmap: Load register defaults in blocks rather than register by register regmap: mmio: Allow passing an empty config->reg_stride regmap-irq: Drop backward compatibility for inverted mask/unmask regmap-irq: Minor adjustments to .handle_mask_sync() regmap-irq: Remove support for not_fixed_stride regmap-irq: Remove type registers regmap-irq: Remove virtual registers ... commit 5ff2977b19769fd24b0cfbe7cbe4d5114b6106af Merge: 2222dcb0775d3 274d4b96b12f7 Author: Dave Airlie Date: Thu Jun 29 06:25:25 2023 +1000 Merge tag 'drm-intel-next-fixes-2023-06-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-next One fix for incorrect error handling in the frame buffer mmap callback, HuC init error handling fix, missing wakeref during GSC init and a build fix when !CONFIG_PROC_FS. Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZJLI8ON96ApPTl8H@tursulin-desk commit 1b2c92a1cb2469d8c0079dbf496ab86e22e1cb7c Author: Linus Torvalds Date: Wed Jun 28 12:47:30 2023 -0700 x86/mem_encrypt: Remove stale mem_encrypt_init() declaration The memory encryption initialization logic was moved from init/main.c into arch_cpu_finalize_init() in commit 439e17576eb4 ("init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init()"), but a stale declaration for the init function was left in . And didn't cause any problems if you had X86_MEM_ENCRYPT enabled, which apparently everybody involved did have. See also commit 0a9567ac5e6a ("x86/mem_encrypt: Unbreak the AMD_MEM_ENCRYPT=n build") in this whole sad saga of conflicting declarations for different situations. Reported-by: Matthew Wilcox Fixes: 439e17576eb4 init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init() Cc: Thomas Gleixner Signed-off-by: Linus Torvalds commit 6581ccf03e717926be97dc3d27182ce351232f3c Author: Linus Torvalds Date: Wed Jun 28 12:20:24 2023 -0700 mm: fix __access_remote_vm() GUP failure case Commit ca5e863233e8 ("mm/gup: remove vmas parameter from get_user_pages_remote()") removed the vma argument from GUP handling, and instead added a helper function (get_user_page_vma_remote()) that looks it up separately using 'vma_lookup()'. And then converted existing users that needed a vma to use the helper instead. However, the helper function intentionally acts exactly like the old get_user_pages_remote() did, and only fills in 'vma' on successful page lookup. Fine so far. However, __access_remote_vm() wants the vma even for the unsuccessful case, and used to do a vma = vma_lookup(mm, addr); explicitly to look it up when the get_user_page() failed. However, that conversion commit incorrectly removed that vma lookup, thinking that get_user_page_vma_remote() would have done it. Not so. So add the vma_lookup() back in. Fixes: ca5e863233e8 ("mm/gup: remove vmas parameter from get_user_pages_remote()") Cc: Lorenzo Stoakes Cc: David Hildenbrand Cc: Christoph Hellwig Cc: Andrew Morton Signed-off-by: Linus Torvalds commit 77b1a7f7a05c673c187894b4ae898a8c0cdc776c Merge: 6e17c6de3ddf3 4afc9a402aa38 Author: Linus Torvalds Date: Wed Jun 28 10:59:38 2023 -0700 Merge tag 'mm-nonmm-stable-2023-06-24-19-23' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull non-mm updates from Andrew Morton: - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in top-level directories - Douglas Anderson has added a new "buddy" mode to the hardlockup detector. It permits the detector to work on architectures which cannot provide the required interrupts, by having CPUs periodically perform checks on other CPUs - Zhen Lei has enhanced kexec's ability to support two crash regions - Petr Mladek has done a lot of cleanup on the hard lockup detector's Kconfig entries - And the usual bunch of singleton patches in various places * tag 'mm-nonmm-stable-2023-06-24-19-23' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (72 commits) kernel/time/posix-stubs.c: remove duplicated include ocfs2: remove redundant assignment to variable bit_off watchdog/hardlockup: fix typo in config HARDLOCKUP_DETECTOR_PREFER_BUDDY powerpc: move arch_trigger_cpumask_backtrace from nmi.h to irq.h devres: show which resource was invalid in __devm_ioremap_resource() watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH watchdog/sparc64: define HARDLOCKUP_DETECTOR_SPARC64 watchdog/hardlockup: make HAVE_NMI_WATCHDOG sparc64-specific watchdog/hardlockup: declare arch_touch_nmi_watchdog() only in linux/nmi.h watchdog/hardlockup: make the config checks more straightforward watchdog/hardlockup: sort hardlockup detector related config values a logical way watchdog/hardlockup: move SMP barriers from common code to buddy code watchdog/buddy: simplify the dependency for HARDLOCKUP_DETECTOR_PREFER_BUDDY watchdog/buddy: don't copy the cpumask in watchdog_next_cpu() watchdog/buddy: cleanup how watchdog_buddy_check_hardlockup() is called watchdog/hardlockup: remove softlockup comment in touch_nmi_watchdog() watchdog/hardlockup: in watchdog_hardlockup_check() use cpumask_copy() watchdog/hardlockup: don't use raw_cpu_ptr() in watchdog_hardlockup_kick() watchdog/hardlockup: HAVE_NMI_WATCHDOG must implement watchdog_hardlockup_probe() watchdog/hardlockup: keep kernel.nmi_watchdog sysctl as 0444 if probe fails ... commit 55e544e1a922d272b62ec576a3de92329f838ce9 Author: Nischala Yelchuri Date: Tue Jun 20 11:40:38 2023 -0700 x86/hyperv: Improve code for referencing hyperv_pcpu_input_arg Several places in code for Hyper-V reference the per-CPU variable hyperv_pcpu_input_arg. Older code uses a multi-line sequence to reference the variable, and usually includes a cast. Newer code does a much simpler direct assignment. The latter is preferable as the complexity of the older code is unnecessary. Update older code to use the simpler direct assignment. Signed-off-by: Nischala Yelchuri Link: https://lore.kernel.org/r/1687286438-9421-1-git-send-email-niyelchu@linux.microsoft.com Signed-off-by: Wei Liu commit a6fe043880820981f6e4918240f967ea79bb063e Author: Kameron Carr Date: Fri Jun 23 15:09:49 2023 -0700 Drivers: hv: Change hv_free_hyperv_page() to take void * argument Currently hv_free_hyperv_page() takes an unsigned long argument, which is inconsistent with the void * return value from the corresponding hv_alloc_hyperv_page() function and variants. This creates unnecessary extra casting. Change the hv_free_hyperv_page() argument type to void *. Also remove redundant casts from invocations of hv_alloc_hyperv_page() and variants. Signed-off-by: Kameron Carr Reviewed-by: Nuno Das Neves Reviewed-by: Dexuan Cui Link: https://lore.kernel.org/r/1687558189-19734-1-git-send-email-kameroncarr@linux.microsoft.com Signed-off-by: Wei Liu commit 47f04616f2c9b2f4f0c9127e30ca515a078db591 Author: Matthias Kaehlcke Date: Tue Jun 27 20:28:01 2023 +0000 dm: verity-loadpin: Add NULL pointer check for 'bdev' parameter Add a NULL check for the 'bdev' parameter of dm_verity_loadpin_is_bdev_trusted(). The function is called by loadpin_check(), which passes the block device that corresponds to the super block of the file system from which a file is being loaded. Generally a super_block structure has an associated block device, however that is not always the case (e.g. tmpfs). Cc: stable@vger.kernel.org # v6.0+ Fixes: b6c1c5745ccc ("dm: Add verity helpers for LoadPin") Signed-off-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/20230627202800.1.Id63f7f59536d20f1ab83e1abdc1fda1471c7d031@changeid Signed-off-by: Kees Cook commit 6e17c6de3ddf3073741d9c91a796ee696914d8a0 Merge: 6aeadf7896bff acc72d59c7509 Author: Linus Torvalds Date: Wed Jun 28 10:28:11 2023 -0700 Merge tag 'mm-stable-2023-06-24-19-15' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull mm updates from Andrew Morton: - Yosry Ahmed brought back some cgroup v1 stats in OOM logs - Yosry has also eliminated cgroup's atomic rstat flushing - Nhat Pham adds the new cachestat() syscall. It provides userspace with the ability to query pagecache status - a similar concept to mincore() but more powerful and with improved usability - Mel Gorman provides more optimizations for compaction, reducing the prevalence of page rescanning - Lorenzo Stoakes has done some maintanance work on the get_user_pages() interface - Liam Howlett continues with cleanups and maintenance work to the maple tree code. Peng Zhang also does some work on maple tree - Johannes Weiner has done some cleanup work on the compaction code - David Hildenbrand has contributed additional selftests for get_user_pages() - Thomas Gleixner has contributed some maintenance and optimization work for the vmalloc code - Baolin Wang has provided some compaction cleanups, - SeongJae Park continues maintenance work on the DAMON code - Huang Ying has done some maintenance on the swap code's usage of device refcounting - Christoph Hellwig has some cleanups for the filemap/directio code - Ryan Roberts provides two patch series which yield some rationalization of the kernel's access to pte entries - use the provided APIs rather than open-coding accesses - Lorenzo Stoakes has some fixes to the interaction between pagecache and directio access to file mappings - John Hubbard has a series of fixes to the MM selftesting code - ZhangPeng continues the folio conversion campaign - Hugh Dickins has been working on the pagetable handling code, mainly with a view to reducing the load on the mmap_lock - Catalin Marinas has reduced the arm64 kmalloc() minimum alignment from 128 to 8 - Domenico Cerasuolo has improved the zswap reclaim mechanism by reorganizing the LRU management - Matthew Wilcox provides some fixups to make gfs2 work better with the buffer_head code - Vishal Moola also has done some folio conversion work - Matthew Wilcox has removed the remnants of the pagevec code - their functionality is migrated over to struct folio_batch * tag 'mm-stable-2023-06-24-19-15' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (380 commits) mm/hugetlb: remove hugetlb_set_page_subpool() mm: nommu: correct the range of mmap_sem_read_lock in task_mem() hugetlb: revert use of page_cache_next_miss() Revert "page cache: fix page_cache_next/prev_miss off by one" mm/vmscan: fix root proactive reclaim unthrottling unbalanced node mm: memcg: rename and document global_reclaim() mm: kill [add|del]_page_to_lru_list() mm: compaction: convert to use a folio in isolate_migratepages_block() mm: zswap: fix double invalidate with exclusive loads mm: remove unnecessary pagevec includes mm: remove references to pagevec mm: rename invalidate_mapping_pagevec to mapping_try_invalidate mm: remove struct pagevec net: convert sunrpc from pagevec to folio_batch i915: convert i915_gpu_error to use a folio_batch pagevec: rename fbatch_count() mm: remove check_move_unevictable_pages() drm: convert drm_gem_put_pages() to use a folio_batch i915: convert shmem_sg_free_table() to use a folio_batch scatterlist: add sg_set_folio() ... commit b2918089d5cb452e928ad9f86c5ee601c592cee3 Author: Rafael J. Wysocki Date: Tue Jun 27 19:50:48 2023 +0200 intel_idle: Add __init annotation to matchup_vm_state_with_baremetal() The caller of (recently added) matchup_vm_state_with_baremetal() is an __init function and it uses some __initdata data structures, so add the __init annotation to it for consistency. This addresses the following build warnings: WARNING: modpost: vmlinux: section mismatch in reference: matchup_vm_state_with_baremetal+0x51 (section: .text) -> intel_idle_max_cstate_reached (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: matchup_vm_state_with_baremetal+0x62 (section: .text) -> cpuidle_state_table (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: matchup_vm_state_with_baremetal+0x79 (section: .text) -> icpu (section: .init.data) Fixes: 0fac214bb75e ("intel_idle: Add a "Long HLT" C1 state for the VM guest mode") Reported-by: Randy Dunlap Signed-off-by: Rafael J. Wysocki Tested-by: Randy Dunlap # build-tested Reviewed-by: Randy Dunlap commit dfbe5561ae9339516a3742a3fbd678609ad59fd0 Author: Jens Axboe Date: Wed Jun 28 11:06:05 2023 -0600 io_uring: flush offloaded and delayed task_work on exit io_uring offloads task_work for cancelation purposes when the task is exiting. This is conceptually fine, but we should be nicer and actually wait for that work to complete before returning. Add an argument to io_fallback_tw() telling it to flush the deferred work when it's all queued up, and have it flush a ctx behind whenever the ctx changes. Signed-off-by: Jens Axboe commit 49024ec8795ed2bd7217c249ef50a70c4e25d662 Author: Paulo Alcantara Date: Tue Jun 27 21:24:47 2023 -0300 smb: client: fix parsing of source mount option Handle trailing and leading separators when parsing UNC and prefix paths in smb3_parse_devname(). Then, store the sanitised paths in smb3_fs_context::source. This fixes the following cases $ mount //srv/share// /mnt/1 -o ... $ cat /mnt/1/d0/f0 cat: /mnt/1/d0/f0: Invalid argument The -EINVAL was returned because the client sent SMB2_CREATE "\\d0\f0" rather than SMB2_CREATE "\d0\f0". $ mount //srv//share /mnt/1 -o ... mount: Invalid argument The -EINVAL was returned correctly although the client only realised it after sending a couple of bad requests rather than bailing out earlier when parsing mount options. Signed-off-by: Paulo Alcantara (SUSE) Cc: stable@vger.kernel.org Signed-off-by: Steve French commit d439b29057e26464120fc6c18f97433aa003b5fe Author: Paulo Alcantara Date: Tue Jun 27 21:24:49 2023 -0300 smb: client: fix broken file attrs with nodfs mounts *_get_inode_info() functions expect -EREMOTE when query path info calls find a DFS link, regardless whether !CONFIG_CIFS_DFS_UPCALL or 'nodfs' mount option. Otherwise, those files will miss the fake DFS file attributes. Before patch $ mount.cifs //srv/dfs /mnt/1 -o ...,nodfs $ ls -l /mnt/1 ls: cannot access '/mnt/1/link': Operation not supported total 0 -rwxr-xr-x 1 root root 0 Jul 26 2022 dfstest2_file1.txt drwxr-xr-x 2 root root 0 Aug 8 2022 dir1 d????????? ? ? ? ? ? link After patch $ mount.cifs //srv/dfs /mnt/1 -o ...,nodfs $ ls -l /mnt/1 total 0 -rwxr-xr-x 1 root root 0 Jul 26 2022 dfstest2_file1.txt drwxr-xr-x 2 root root 0 Aug 8 2022 dir1 drwx--x--x 2 root root 0 Jun 26 20:29 link Fixes: c877ce47e137 ("cifs: reduce roundtrips on create/qinfo requests") Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 380958ac4f93cca18b0d5775b4682ad1dff87f79 Author: Shyam Prasad N Date: Tue Jun 27 12:09:43 2023 +0000 cifs: print client_guid in DebugData Having the ClientGUID info makes it easier to debug issues related to a client on a server that serves a number of clients. This change prints the ClientGUID in DebugData. Signed-off-by: Shyam Prasad N Acked-by: Tom Talpey Signed-off-by: Steve French commit 66be5c48ee1b5b8c919cc329fe6d32e16badaa40 Author: Winston Wen Date: Mon Jun 26 11:42:57 2023 +0800 cifs: fix session state check in smb2_find_smb_ses Chech the session state and skip it if it's exiting. Signed-off-by: Winston Wen Reviewed-by: Shyam Prasad N Cc: stable@vger.kernel.org Signed-off-by: Steve French commit 99f280700b4cc02d5f141b8d15f8e9fad0418f65 Author: Winston Wen Date: Mon Jun 26 11:42:56 2023 +0800 cifs: fix session state check in reconnect to avoid use-after-free issue Don't collect exiting session in smb2_reconnect_server(), because it will be released soon. Note that the exiting session will stay in server->smb_ses_list until it complete the cifs_free_ipc() and logoff() and then delete itself from the list. Signed-off-by: Winston Wen Reviewed-by: Shyam Prasad N Signed-off-by: Steve French commit 326a8d04f147e2bf393f6f9cdb74126ee6900607 Author: Shyam Prasad N Date: Thu Jun 22 18:16:04 2023 +0000 cifs: do all necessary checks for credits within or before locking All the server credits and in-flight info is protected by req_lock. Once the req_lock is held, and we've determined that we have enough credits to continue, this lock cannot be dropped till we've made the changes to credits and in-flight count. However, we used to drop the lock in order to avoid deadlock with the recent srv_lock. This could cause the checks already made to be invalidated. Fixed it by moving the server status check to before locking req_lock. Fixes: d7d7a66aacd6 ("cifs: avoid use of global locks for high contention data") Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 33f736187d08f6bc822117629f263b97d3df4165 Author: Shyam Prasad N Date: Thu Jun 22 18:16:03 2023 +0000 cifs: prevent use-after-free by freeing the cfile later In smb2_compound_op we have a possible use-after-free which can cause hard to debug problems later on. This was revealed during stress testing with KASAN enabled kernel. Fixing it by moving the cfile free call to a few lines below, after the usage. Fixes: 76894f3e2f71 ("cifs: improve symlink handling for smb2+") Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit f5983dab0ead92dc2690d147f0604a0badcac6a8 Author: Masahiro Yamada Date: Wed Jun 28 01:32:05 2023 +0900 modpost: define more R_ARM_* for old distributions On CentOS 7, the following build error occurs. scripts/mod/modpost.c: In function 'addend_arm_rel': scripts/mod/modpost.c:1312:7: error: 'R_ARM_MOVW_ABS_NC' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'? case R_ARM_MOVW_ABS_NC: ^~~~~~~~~~~~~~~~~ R_ARM_THM_ABS5 scripts/mod/modpost.c:1312:7: note: each undeclared identifier is reported only once for each function it appears in scripts/mod/modpost.c:1313:7: error: 'R_ARM_MOVT_ABS' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'? case R_ARM_MOVT_ABS: ^~~~~~~~~~~~~~ R_ARM_THM_ABS5 scripts/mod/modpost.c:1326:7: error: 'R_ARM_THM_MOVW_ABS_NC' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'? case R_ARM_THM_MOVW_ABS_NC: ^~~~~~~~~~~~~~~~~~~~~ R_ARM_THM_ABS5 scripts/mod/modpost.c:1327:7: error: 'R_ARM_THM_MOVT_ABS' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'? case R_ARM_THM_MOVT_ABS: ^~~~~~~~~~~~~~~~~~ R_ARM_THM_ABS5 Fixes: 12ca2c67d742 ("modpost: detect section mismatch for R_ARM_{MOVW_ABS_NC,MOVT_ABS}") Fixes: cd1824fb7a37 ("modpost: detect section mismatch for R_ARM_THM_{MOVW_ABS_NC,MOVT_ABS}") Reported-by: Tetsuo Handa Signed-off-by: Masahiro Yamada commit d34a271accf8fad00e05aad2cecb9fb53a840a94 Author: sunliming Date: Mon Jun 26 19:13:44 2023 +0800 selftests/user_events: Add test cases when event is disabled When user_events are disabled, it's write operation should return -EBADF. Add this test cases. Link: https://lkml.kernel.org/r/20230626111344.19136-4-sunliming@kylinos.cn Acked-by: Beau Belgrave Signed-off-by: sunliming Signed-off-by: Steven Rostedt (Google) commit c27b40cf919254459698d6622828152b509b9980 Author: sunliming Date: Mon Jun 26 19:13:43 2023 +0800 selftests/user_events: Enable the event before write_fault test in ftrace self-test The user_event has not be enabled in write_fault test in ftrace self-test, Just enable it. Link: https://lkml.kernel.org/r/20230626111344.19136-3-sunliming@kylinos.cn Acked-by: Beau Belgrave Signed-off-by: sunliming Signed-off-by: Steven Rostedt (Google) commit f6d026eea390d59787a6cdc2ef5c983d02e029d0 Author: sunliming Date: Mon Jun 26 19:13:42 2023 +0800 tracing/user_events: Fix incorrect return value for writing operation when events are disabled The writing operation return the count of writes regardless of whether events are enabled or disabled. Switch it to return -EBADF to indicates that the event is disabled. Link: https://lkml.kernel.org/r/20230626111344.19136-2-sunliming@kylinos.cn Cc: stable@vger.kernel.org 7f5a08c79df35 ("user_events: Add minimal support for trace_event into ftrace") Acked-by: Beau Belgrave Signed-off-by: sunliming Signed-off-by: Steven Rostedt (Google) commit b05740d71bd2f8b2261930944bfe95f529190b8b Author: Okan Sahin Date: Wed Apr 12 14:12:45 2023 +0300 dt-bindings: mfd: max77541: Add ADI MAX77541/MAX77540 Add ADI MAX77541/MAX77540 devicetree document. Signed-off-by: Okan Sahin Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230412111256.40013-5-okan.sahin@analog.com Signed-off-by: Lee Jones commit 04c9a8eb722ff6ebafd95217bed4faf6193e7e46 Author: Okan Sahin Date: Wed Apr 12 14:12:44 2023 +0300 iio: adc: max77541: Add ADI MAX77541 ADC Support The MAX77541 has an 8-bit Successive Approximation Register (SAR) ADC with four multiplexers for supporting the telemetry feature. Signed-off-by: Okan Sahin Reviewed-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230412111256.40013-4-okan.sahin@analog.com Signed-off-by: Lee Jones commit c2b2afe6c8811290e4207dcb1d627def32a970f8 Author: Okan Sahin Date: Wed Apr 12 14:12:43 2023 +0300 regulator: max77541: Add ADI MAX77541/MAX77540 Regulator Support Regulator driver for both MAX77541 and MAX77540. The MAX77541 is a high-efficiency step-down converter with two 3A switching phases for single-cell Li+ battery and 5VDC systems. The MAX77540 is a high-efficiency step-down converter with two 3A switching phases. Signed-off-by: Okan Sahin Reviewed-by: Andy Shevchenko Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20230412111256.40013-3-okan.sahin@analog.com Signed-off-by: Lee Jones commit 8640b38234cf295a6b548fc303e93322464155ad Author: Okan Sahin Date: Wed Apr 12 14:12:42 2023 +0300 dt-bindings: regulator: max77541: Add ADI MAX77541/MAX77540 Regulator Add ADI MAX77541/MAX77540 Regulator devicetree document. Signed-off-by: Okan Sahin Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230412111256.40013-2-okan.sahin@analog.com Signed-off-by: Lee Jones commit 6c26bd4384da24841bac4f067741bbca18b0fb74 Author: David Woodhouse Date: Wed Jun 28 10:55:03 2023 +0100 mm/mmap: Fix error return in do_vmi_align_munmap() If mas_store_gfp() in the gather loop failed, the 'error' variable that ultimately gets returned was not being set. In many cases, its original value of -ENOMEM was still in place, and that was fine. But if VMAs had been split at the start or end of the range, then 'error' could be zero. Change to the 'error = foo(); if (error) goto …' idiom to fix the bug. Also clean up a later case which avoided the same bug by *explicitly* setting error = -ENOMEM right before calling the function that might return -ENOMEM. In a final cosmetic change, move the 'Point of no return' comment to *after* the goto. That's been in the wrong place since the preallocation was removed, and this new error path was added. Fixes: 606c812eb1d5 ("mm/mmap: Fix error path in do_vmi_align_munmap()") Signed-off-by: David Woodhouse Cc: stable@vger.kernel.org Reviewed-by: Greg Kroah-Hartman Reviewed-by: Liam R. Howlett commit 190e2e1177010ab9ffccd5f968500099c247e8e5 Author: Mauro Carvalho Chehab Date: Wed Jun 28 15:03:39 2023 +0200 media: dvb: mb86a20s: get rid of a clang-15 warning When building with clang-15: this warning is produced: ../drivers/media/dvb-frontends/mb86a20s.c:1572:6: error: variable 'active_layers' set but not used [-Werror,-Wunused-but-set-variable] int active_layers = 0, pre_ber_layers = 0, post_ber_layers = 0; ^ 1 error generated. Link: https://lore.kernel.org/linux-media/20230628130339.206261-1-mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit d15e4314abec83e4f910659437bc809b0889e3a5 Author: Sumanth Korikkar Date: Fri Jun 23 15:12:05 2023 +0200 s390/vdso: filter out mno-pic-data-is-text-relative cflag cmd_vdso_check checks if there are any dynamic relocations in vdso64.so.dbg. When kernel is compiled with -mno-pic-data-is-text-relative, R_390_RELATIVE relocs are generated and this results in kernel build error. kpatch uses -mno-pic-data-is-text-relative option when building the kernel to prevent relative addressing between code and data. The flag avoids relocation error when klp text and data are too far apart kpatch does not patch vdso code and hence the mno-pic-data-is-text-relative flag is not essential. Signed-off-by: Sumanth Korikkar Acked-by: Ilya Leoshkevich Signed-off-by: Alexander Gordeev commit 27d45655faa83bde1545251b8a576ab4f1a9e731 Author: Heiko Carstens Date: Thu Jun 22 13:24:40 2023 +0200 s390: consistently use .balign instead of .align The .align directive has inconsistent behavior across architectures. Use .balign instead everywhere. This is a no-op for s390, but with this there is no mix in using .align and .balign anymore. Future code is supposed to use only .balign. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 938f0c35d7d93a822ab9c9728e3205e8e57409d0 Author: Heiko Carstens Date: Thu Jun 22 14:55:08 2023 +0200 s390/decompressor: fix misaligned symbol build error Nathan Chancellor reported a kernel build error on Fedora 39: $ clang --version | head -1 clang version 16.0.5 (Fedora 16.0.5-1.fc39) $ s390x-linux-gnu-ld --version | head -1 GNU ld version 2.40-1.fc39 $ make -skj"$(nproc)" ARCH=s390 CC=clang CROSS_COMPILE=s390x-linux-gnu- olddefconfig all s390x-linux-gnu-ld: arch/s390/boot/startup.o(.text+0x5b4): misaligned symbol `_decompressor_end' (0x35b0f) for relocation R_390_PC32DBL make[3]: *** [.../arch/s390/boot/Makefile:78: arch/s390/boot/vmlinux] Error 1 It turned out that the problem with misaligned symbols on s390 was fixed with commit 80ddf5ce1c92 ("s390: always build relocatable kernel") for the kernel image, but did not take into account that the decompressor uses its own set of CFLAGS, which come without -fPIE. Add the -fPIE flag also to the decompresser CFLAGS to fix this. Reported-by: Nathan Chancellor Tested-by: Nathan Chancellor Reported-by: CKI Suggested-by: Ulrich Weigand Link: https://github.com/ClangBuiltLinux/linux/issues/1747 Link: https://lore.kernel.org/32935.123062114500601371@us-mta-9.us.mimecast.lan/ Link: https://lore.kernel.org/r/20230622125508.1068457-1-hca@linux.ibm.com Cc: Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 13cf06d57fa8d2313d53ac19fbc8f1f7c751a4c4 Author: Heiko Carstens Date: Wed Jun 21 10:31:23 2023 +0200 s390/zcrypt: use kvmalloc_array() instead of kzalloc() zcrypt_unlocked_ioctl() allocates 256k with kzalloc() which is likely to fail if memory is fragmented. To avoid that use kvmalloc_array() instead, like it is done at several other places for the same reason. Reviewed-by: Harald Freudenberger Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 0dd0bbc2003a33a0e4705f8eec6ba6535b1e49d1 Author: Sven Schnelle Date: Wed Jun 21 09:18:52 2023 +0200 s390/vdso: check for undefined symbols after build When adding an undefined symbol the build still succeeds, but userspace is crashing trying to execute vdso because the undefined symbol is not resolved. Add the check for undefined symbols to prevent this. Signed-off-by: Sven Schnelle Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 51f513fd9659faf00976071a9525474b08764ccb Author: Baoquan He Date: Sun Jun 11 18:37:43 2023 +0800 s390/mm: do not include directly We should always include in ARCH, but not directly. Otherwise, macro defined by ARCH won't be seen and could cause building error. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306100105.8GHnoMCP-lkp@intel.com/ Link: https://lore.kernel.org/all/ZIWrtFMUnRfVP5h0@MiWiFi-R3L-srv/ Signed-off-by: Baoquan He [agordeev@linux.ibm.com changed patch description] Signed-off-by: Alexander Gordeev commit 688fcbbb9c0b023b54cf306cbac54300cef7fa5b Author: Alexander Gordeev Date: Sat Jun 17 22:04:26 2023 +0200 s390/vmem: fix virtual vs physical address confusion Fix virtual vs physical address confusion (which currently are the same). Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 456be42aa713e7f83b467db66ceae779431c7d9d Author: Alexander Gordeev Date: Sat Jun 17 20:58:18 2023 +0200 s390/mm: get rid of VMEM_MAX_PHYS macro VMEM_MAX_PHYS is supposed to be the highest physical address that can be added to the identity mapping. It should match ident_map_size, which has the same meaning. However, unlike ident_map_size it is not adjusted against various limiting factors (see the comment to setup_ident_map_size() function). That renders all checks against VMEM_MAX_PHYS invalid. Further, VMEM_MAX_PHYS is currently set to vmemmap, which is an address in virtual memory space. However, it gets compared against physical addresses in various locations. That works, because both address spaces are the same on s390, but otherwise it is wrong. Instead of fixing VMEM_MAX_PHYS misuse and semantics just remove it. Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 4926a34b1b4e568edcd47b7215718dc187147780 Merge: a64db0b9dfac2 4eecae44a51a1 Author: Takashi Iwai Date: Wed Jun 28 11:44:39 2023 +0200 Merge branch 'topic/midi20' into for-linus Pull a typo fix in MIDI 2.0 helper code. Signed-off-by: Takashi Iwai commit 4eecae44a51a13be2d017cebc4f760173253d238 Author: Takashi Iwai Date: Wed Jun 28 11:43:52 2023 +0200 ALSA: ump: Correct wrong byte size at converting a UMP System message A wrong size for UMP_SYSTEM_STATUS_MIDI_TIME_CODE and case UMP_SYSTEM_STATUS_SONG_SELECT was reported at converting to the legacy MIDI 1.0 stream. This patch corrects the value. Fixes: 0b5288f5fe63 ("ALSA: ump: Add legacy raw MIDI support") Link: https://lore.kernel.org/r/20230628094352.15754-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit a64db0b9dfac2011e14e88faf59847baac1dad5a Author: Takashi Sakamoto Date: Wed Jun 28 08:54:06 2023 +0900 ALSA: fireface: make read-only const array for model names static It is preferable not to populate the constant array for constant strings on the stack. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20230627235406.289970-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit d17f0ce9a9ee1372b9c71b4dc9bd6c8fbe73790f Author: Colin Ian King Date: Tue Jun 27 12:32:53 2023 +0100 ALSA: oxfw: make read-only const array models static Don't populate the const array on the stack, instead make it static. Signed-off-by: Colin Ian King Reviewed-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20230627113253.700065-1-colin.i.king@gmail.com Signed-off-by: Takashi Iwai commit 29f96ac23648b2259f42d40703c47dd18fd172ca Author: Randy Dunlap Date: Thu Jun 8 04:54:35 2023 +0200 media: cec: i2c: ch7322: also select REGMAP Selecting only REGMAP_I2C can leave REGMAP unset, causing build errors, so also select REGMAP to prevent the build errors. ../drivers/media/cec/i2c/ch7322.c:158:21: error: variable 'ch7322_regmap' has initializer but incomplete type 158 | static const struct regmap_config ch7322_regmap = { ../drivers/media/cec/i2c/ch7322.c:159:10: error: 'const struct regmap_config' has no member named 'reg_bits' 159 | .reg_bits = 8, ../drivers/media/cec/i2c/ch7322.c:159:21: warning: excess elements in struct initializer 159 | .reg_bits = 8, ../drivers/media/cec/i2c/ch7322.c:160:10: error: 'const struct regmap_config' has no member named 'val_bits' 160 | .val_bits = 8, ../drivers/media/cec/i2c/ch7322.c:160:21: warning: excess elements in struct initializer 160 | .val_bits = 8, ../drivers/media/cec/i2c/ch7322.c:161:10: error: 'const struct regmap_config' has no member named 'max_register' 161 | .max_register = 0x7f, ../drivers/media/cec/i2c/ch7322.c:161:25: warning: excess elements in struct initializer 161 | .max_register = 0x7f, ../drivers/media/cec/i2c/ch7322.c:162:10: error: 'const struct regmap_config' has no member named 'disable_locking' 162 | .disable_locking = true, ../drivers/media/cec/i2c/ch7322.c:162:28: warning: excess elements in struct initializer 162 | .disable_locking = true, ../drivers/media/cec/i2c/ch7322.c: In function 'ch7322_probe': ../drivers/media/cec/i2c/ch7322.c:468:26: error: implicit declaration of function 'devm_regmap_init_i2c' [-Werror=implicit-function-declaration] 468 | ch7322->regmap = devm_regmap_init_i2c(client, &ch7322_regmap); ../drivers/media/cec/i2c/ch7322.c:468:24: warning: assignment to 'struct regmap *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 468 | ch7322->regmap = devm_regmap_init_i2c(client, &ch7322_regmap); ../drivers/media/cec/i2c/ch7322.c: At top level: ../drivers/media/cec/i2c/ch7322.c:158:35: error: storage size of 'ch7322_regmap' isn't known 158 | static const struct regmap_config ch7322_regmap = { Link: https://lore.kernel.org/linux-media/20230608025435.29249-1-rdunlap@infradead.org Fixes: 21b9a47e0ec7 ("media: cec: i2c: ch7322: Add ch7322 CEC controller driver") Signed-off-by: Randy Dunlap Cc: Jeff Chase Cc: Hans Verkuil Cc: Joe Tessler Cc: Arnd Bergmann Cc: Mark Brown Cc: Masahiro Yamada Signed-off-by: Mauro Carvalho Chehab commit 7997604bc90bbb367396dd406ecb50645ab406ef Author: Niklas Schnelle Date: Mon May 22 12:50:23 2023 +0200 media: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Link: https://lore.kernel.org/linux-media/20230522105049.1467313-19-schnelle@linux.ibm.com Reviewed-by: Sean Young # media/rc Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Signed-off-by: Mauro Carvalho Chehab commit 582d4ad468cbc6ef2db4689ff3bd5868d95402c9 Author: Arnd Bergmann Date: Fri Jun 23 17:23:09 2023 +0200 media: tc358746: select CONFIG_GENERIC_PHY The tc358746 driver selects CONFIG_GENERIC_PHY_MIPI_DPHY and links to that, but this fails when CONFIG_GENERIC_PHY is disabled, because Kbuild then never enters the drivers/phy directory for building object files: ERROR: modpost: "phy_mipi_dphy_get_default_config_for_hsclk" [drivers/media/i2c/tc358746.ko] undefined! Add an explicit 'select GENERIC_PHY' here to ensure that the directory is entered, and add another dependency on that symbol so make it more obvious what is going on if another driver has the same problem, as this will produce a Kconfig warning. Link: https://lore.kernel.org/linux-media/20230623152318.2276816-1-arnd@kernel.org Fixes: 80a21da360516 ("media: tc358746: add Toshiba TC358746 Parallel to CSI-2 bridge driver") Signed-off-by: Arnd Bergmann Reviewed-by: Marco Felsch Signed-off-by: Mauro Carvalho Chehab commit 628eaa4e877af8230ef7326d378e15d511c506ba Author: Ian Rogers Date: Tue Jun 27 11:28:34 2023 -0700 perf pmus: Add placeholder core PMU If loading a core PMU fails, legacy hardware/cache events may segv due to there being no PMU. Create a placeholder empty PMU for this case. This was discussed in: https://lore.kernel.org/lkml/20230614151625.2077-1-yangjihong1@huawei.com/ Reported-by: Yang Jihong Tested-by: Yang Jihong Signed-off-by: Ian Rogers Cc: Ravi Bangoria Cc: James Clark Cc: Mark Rutland Cc: Suzuki Poulouse Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Rob Herring Cc: Alexander Shishkin Cc: Kan Liang Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230627182834.117565-1-irogers@google.com Signed-off-by: Namhyung Kim commit 6aeadf7896bff4ca230702daba8788455e6b866e Merge: 582c161cf38cf f40f97aaf7fa6 Author: Linus Torvalds Date: Tue Jun 27 21:52:15 2023 -0700 Merge tag 'docs-arm64-move' of git://git.lwn.net/linux Pull arm64 documentation move from Jonathan Corbet: "Move the arm64 architecture documentation under Documentation/arch/. This brings some order to the documentation directory, declutters the top-level directory, and makes the documentation organization more closely match that of the source" * tag 'docs-arm64-move' of git://git.lwn.net/linux: perf arm-spe: Fix a dangling Documentation/arm64 reference mm: Fix a dangling Documentation/arm64 reference arm64: Fix dangling references to Documentation/arm64 dt-bindings: fix dangling Documentation/arm64 reference docs: arm64: Move arm64 documentation under Documentation/arch/ commit 582c161cf38cf016cd573af6f087fa5fa786949b Merge: 8ad78685ffa6e acf15e07eb065 Author: Linus Torvalds Date: Tue Jun 27 21:24:18 2023 -0700 Merge tag 'hardening-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening updates from Kees Cook: "There are three areas of note: A bunch of strlcpy()->strscpy() conversions ended up living in my tree since they were either Acked by maintainers for me to carry, or got ignored for multiple weeks (and were trivial changes). The compiler option '-fstrict-flex-arrays=3' has been enabled globally, and has been in -next for the entire devel cycle. This changes compiler diagnostics (though mainly just -Warray-bounds which is disabled) and potential UBSAN_BOUNDS and FORTIFY _warning_ coverage. In other words, there are no new restrictions, just potentially new warnings. Any new FORTIFY warnings we've seen have been fixed (usually in their respective subsystem trees). For more details, see commit df8fc4e934c12b. The under-development compiler attribute __counted_by has been added so that we can start annotating flexible array members with their associated structure member that tracks the count of flexible array elements at run-time. It is possible (likely?) that the exact syntax of the attribute will change before it is finalized, but GCC and Clang are working together to sort it out. Any changes can be made to the macro while we continue to add annotations. As an example of that last case, I have a treewide commit waiting with such annotations found via Coccinelle: https://git.kernel.org/linus/adc5b3cb48a049563dc673f348eab7b6beba8a9b Also see commit dd06e72e68bcb4 for more details. Summary: - Fix KMSAN vs FORTIFY in strlcpy/strlcat (Alexander Potapenko) - Convert strreplace() to return string start (Andy Shevchenko) - Flexible array conversions (Arnd Bergmann, Wyes Karny, Kees Cook) - Add missing function prototypes seen with W=1 (Arnd Bergmann) - Fix strscpy() kerndoc typo (Arne Welzel) - Replace strlcpy() with strscpy() across many subsystems which were either Acked by respective maintainers or were trivial changes that went ignored for multiple weeks (Azeem Shaikh) - Remove unneeded cc-option test for UBSAN_TRAP (Nick Desaulniers) - Add KUnit tests for strcat()-family - Enable KUnit tests of FORTIFY wrappers under UML - Add more complete FORTIFY protections for strlcat() - Add missed disabling of FORTIFY for all arch purgatories. - Enable -fstrict-flex-arrays=3 globally - Tightening UBSAN_BOUNDS when using GCC - Improve checkpatch to check for strcpy, strncpy, and fake flex arrays - Improve use of const variables in FORTIFY - Add requested struct_size_t() helper for types not pointers - Add __counted_by macro for annotating flexible array size members" * tag 'hardening-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: (54 commits) netfilter: ipset: Replace strlcpy with strscpy uml: Replace strlcpy with strscpy um: Use HOST_DIR for mrproper kallsyms: Replace all non-returning strlcpy with strscpy sh: Replace all non-returning strlcpy with strscpy of/flattree: Replace all non-returning strlcpy with strscpy sparc64: Replace all non-returning strlcpy with strscpy Hexagon: Replace all non-returning strlcpy with strscpy kobject: Use return value of strreplace() lib/string_helpers: Change returned value of the strreplace() jbd2: Avoid printing outside the boundary of the buffer checkpatch: Check for 0-length and 1-element arrays riscv/purgatory: Do not use fortified string functions s390/purgatory: Do not use fortified string functions x86/purgatory: Do not use fortified string functions acpi: Replace struct acpi_table_slit 1-element array with flex-array clocksource: Replace all non-returning strlcpy with strscpy string: use __builtin_memcpy() in strlcpy/strlcat staging: most: Replace all non-returning strlcpy with strscpy drm/i2c: tda998x: Replace all non-returning strlcpy with strscpy ... commit 8ad78685ffa6e3836b5b32197bffb03ee3389bec Merge: d416a46c954ef d97038d5ec206 Author: Linus Torvalds Date: Tue Jun 27 21:21:32 2023 -0700 Merge tag 'pstore-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull pstore updates from Kees Cook: - Check for out-of-memory condition (Jiasheng Jiang) - Convert to platform remove callback returning void (Uwe Kleine-König) * tag 'pstore-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: pstore/ram: Add check for kstrdup pstore/ram: Convert to platform remove callback returning void commit d416a46c954ef0b753595ebfe6bb0988a24c2a57 Merge: 98be618ad0301 aa88054b70905 Author: Linus Torvalds Date: Tue Jun 27 21:12:41 2023 -0700 Merge tag 'execve-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull execve updates from Kees Cook: - Fix a few comments for correctness and typos (Baruch Siach) - Small simplifications for binfmt (Christophe JAILLET) - Set p_align to 4 for PT_NOTE in core dump (Fangrui Song) * tag 'execve-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: binfmt_elf: fix comment typo s/reset/regset/ elf: correct note name comment binfmt: Slightly simplify elf_fdpic_map_file() binfmt: Use struct_size() coredump, vmcore: Set p_align to 4 for PT_NOTE commit 98be618ad03010b1173fc3c35f6cbb4447ee2b07 Merge: b4c7f2e6ef40f 2c085f3a8f23c Author: Linus Torvalds Date: Tue Jun 27 17:58:06 2023 -0700 Merge tag 'Smack-for-6.5' of https://github.com/cschaufler/smack-next Pull smack updates from Casey Schaufler: "There are two patches, both of which change how Smack initializes the SMACK64TRANSMUTE extended attribute. The first corrects the behavior of overlayfs, which creates inodes differently from other filesystems. The second ensures that transmute attributes specified by mount options are correctly assigned" * tag 'Smack-for-6.5' of https://github.com/cschaufler/smack-next: smack: Record transmuting in smk_transmuted smack: Retrieve transmuting information in smack_inode_getsecurity() commit b4c7f2e6ef40f545054a902e4708ed908d562318 Merge: 21953eb16c2a6 95526d13038c2 Author: Linus Torvalds Date: Tue Jun 27 17:32:34 2023 -0700 Merge tag 'integrity-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull integrity subsystem updates from Mimi Zohar: "An i_version change, one bug fix, and three kernel doc fixes: - instead of IMA detecting file change by directly accesssing i_version, it now calls vfs_getattr_nosec(). - fix a race condition when inserting a new node in the iint rb-tree" * tag 'integrity-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: ima: Fix build warnings evm: Fix build warnings evm: Complete description of evm_inode_setattr() integrity: Fix possible multiple allocation in integrity_inode_get() IMA: use vfs_getattr_nosec to get the i_version commit 21953eb16c2a6ebc039126d63acf84b286a58a02 Merge: 729b39ec1bdb7 4be22f16a4a1a Author: Linus Torvalds Date: Tue Jun 27 17:24:26 2023 -0700 Merge tag 'lsm-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm Pull lsm updates from Paul Moore: - A SafeSetID patch to correct what appears to be a cut-n-paste typo in the code causing a UID to be printed where a GID was desired. This is coming via the LSM tree because we haven't been able to get a response from the SafeSetID maintainer (Micah Morton) in several months. Hopefully we are able to get in touch with Micah, but until we do I'm going to pick them up in the LSM tree. - A small fix to the reiserfs LSM xattr code. We're continuing to work through some issues with the reiserfs code as we try to fixup the LSM xattr handling, but in the process we're uncovering some ugly problems in reiserfs and we may just end up removing the LSM xattr support in reiserfs prior to reiserfs' removal. For better or worse, this shouldn't impact any of the reiserfs users, as we discovered that LSM xattrs on reiserfs were completely broken, meaning no one is currently using the combo of reiserfs and a file labeling LSM. - A tweak to how the cap_user_data_t struct/typedef is declared in the header file to appease the Sparse gods. - In the process of trying to sort out the SafeSetID lost-maintainer problem I realized that I needed to update the labeled networking entry to "Supported". - Minor comment/documentation and spelling fixes. * tag 'lsm-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm: device_cgroup: Fix kernel-doc warnings in device_cgroup SafeSetID: fix UID printed instead of GID MAINTAINERS: move labeled networking to "supported" capability: erase checker warnings about struct __user_cap_data_struct lsm: fix a number of misspellings reiserfs: Initialize sec->length in reiserfs_security_init(). capability: fix kernel-doc warnings in capability.c commit 729b39ec1bdb7e1ca594e14069d05f682d9ab868 Merge: cae72026b5ecf 447a5688005e5 Author: Linus Torvalds Date: Tue Jun 27 17:18:48 2023 -0700 Merge tag 'selinux-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux updates from Paul Moore: - Thanks to help from the MPTCP folks, it looks like we have finally sorted out a proper solution to the MPTCP socket labeling issue, see the new security_mptcp_add_subflow() LSM hook. - Fix the labeled NFS handling such that a labeled NFS share mounted prior to the initial SELinux policy load is properly labeled once a policy is loaded; more information in the commit description. - Two patches to security/selinux/Makefile, the first took the cleanups in v6.4 a bit further and the second removed the grouped targets support as that functionality doesn't appear to be properly supported prior to make v4.3. - Deprecate the "fs" object context type in SELinux policies. The fs object context type was an old vestige that was introduced back in v2.6.12-rc2 but never really used. - A number of small changes that remove dead code, clean up some awkward bits, and generally improve the quality of the code. See the individual commit descriptions for more information. * tag 'selinux-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: avoid bool as identifier name selinux: fix Makefile for versions of make < v4.3 selinux: make labeled NFS work when mounted before policy load selinux: cleanup exit_sel_fs() declaration selinux: deprecated fs ocon selinux: make header files self-including selinux: keep context struct members in sync selinux: Implement mptcp_add_subflow hook security, lsm: Introduce security_mptcp_add_subflow() selinux: small cleanups in selinux_audit_rule_init() selinux: declare read-only data arrays const selinux: retain const qualifier on string literal in avtab_hash_eval() selinux: drop return at end of void function avc_insert() selinux: avc: drop unused function avc_disable() selinux: adjust typos in comments selinux: do not leave dangling pointer behind selinux: more Makefile tweaks commit cae72026b5ecf059687ccb431cb0e5965e863fea Merge: 26642864f8b21 e455ca40dbcf2 Author: Linus Torvalds Date: Tue Jun 27 17:15:35 2023 -0700 Merge tag 'audit-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit update from Paul Moore: "A single audit patch that resolves two compiler warnings regarding missing function prototypes" * tag 'audit-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: avoid missing-prototype warnings commit 26642864f8b212964f80fbd69685eb850ced5f45 Merge: 6e2332e0ab532 35ca423992973 Author: Linus Torvalds Date: Tue Jun 27 17:10:27 2023 -0700 Merge tag 'landlock-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux Pull landlock updates from Mickaël Salaün: "Add support for Landlock to UML. To do this, this fixes the way hostfs manages inodes according to the underlying filesystem [1]. They are now properly handled as for other filesystems, which enables Landlock support (and probably other features). This also extends Landlock's tests with 6 pseudo filesystems, including hostfs" [1] https://lore.kernel.org/all/20230612191430.339153-1-mic@digikod.net/ * tag 'landlock-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux: selftests/landlock: Add hostfs tests selftests/landlock: Add tests for pseudo filesystems selftests/landlock: Make mounts configurable selftests/landlock: Add supports_filesystem() helper selftests/landlock: Don't create useless file layouts hostfs: Fix ephemeral inodes commit 6e2332e0ab532eb01f1fde39080dbfa9bf65c4cf Merge: 72dc6db7e3b69 81621430c81bb Author: Linus Torvalds Date: Tue Jun 27 16:54:21 2023 -0700 Merge tag 'cgroup-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup updates from Tejun Heo: - Whenever cpuset needs to rebuild sched_domain, it walked all tasks looking for DEADLINE tasks as they need to be accounted on the new domain. Walking all tasks can be expensive and there may not be any DEADLINE tasks at all. Task iteration is now omitted if there are no DEADLINE tasks - Fixes DEADLINE bandwidth misaccounting after task migration failures - When no controller is enabled, -Wstringop-overflow warning is triggered. The fix patch added an early exit which is too eager and got reverted for now. Will fix later - Everything else is minor cleanups * tag 'cgroup-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: Revert "cgroup: Avoid -Wstringop-overflow warnings" cgroup/misc: Expose misc.current on cgroup v2 root cgroup: Avoid -Wstringop-overflow warnings cgroup: remove obsolete comment on cgroup_on_dfl() cgroup: remove unused task_cgroup_path() cgroup/cpuset: remove unneeded header files cgroup: make cgroup_is_threaded() and cgroup_is_thread_root() static rdmacg: fix kernel-doc warnings in rdmacg cgroup: Replace the css_set call with cgroup_get cgroup: remove unused macro for_each_e_css() cgroup: Update out-of-date comment in cgroup_migrate() cgroup: Replace all non-returning strlcpy with strscpy cgroup/cpuset: remove unneeded header files cgroup/cpuset: Free DL BW in case can_attach() fails sched/deadline: Create DL BW alloc, free & check overflow interface cgroup/cpuset: Iterate only if DEADLINE tasks are present sched/cpuset: Keep track of SCHED_DEADLINE task in cpusets sched/cpuset: Bring back cpuset_mutex cgroup/cpuset: Rename functions dealing with DEADLINE accounting commit 72dc6db7e3b692f46f3386b8dd5101d3f431adef Merge: 7ab044a4f42ae 78ef970385ea4 Author: Linus Torvalds Date: Tue Jun 27 16:46:06 2023 -0700 Merge tag 'wq-for-6.5-cleanup-ordered' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull ordered workqueue creation updates from Tejun Heo: "For historical reasons, unbound workqueues with max concurrency limit of 1 are considered ordered, even though the concurrency limit hasn't been system-wide for a long time. This creates ambiguity around whether ordered execution is actually required for correctness, which was actually confusing for e.g. btrfs (btrfs updates are being routed through the btrfs tree). There aren't that many users in the tree which use the combination and there are pending improvements to unbound workqueue affinity handling which will make inadvertent use of ordered workqueue a bigger loss. This clarifies the situation for most of them by updating the ones which require ordered execution to use alloc_ordered_workqueue(). There are some conversions being routed through subsystem-specific trees and likely a few stragglers. Once they're all converted, workqueue can trigger a warning on unbound + @max_active==1 usages and eventually drop the implicit ordered behavior" * tag 'wq-for-6.5-cleanup-ordered' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: rxrpc: Use alloc_ordered_workqueue() to create ordered workqueues net: qrtr: Use alloc_ordered_workqueue() to create ordered workqueues net: wwan: t7xx: Use alloc_ordered_workqueue() to create ordered workqueues dm integrity: Use alloc_ordered_workqueue() to create ordered workqueues media: amphion: Use alloc_ordered_workqueue() to create ordered workqueues scsi: NCR5380: Use default @max_active for hostdata->work_q media: coda: Use alloc_ordered_workqueue() to create ordered workqueues crypto: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues wifi: ath10/11/12k: Use alloc_ordered_workqueue() to create ordered workqueues wifi: mwifiex: Use default @max_active for workqueues wifi: iwlwifi: Use default @max_active for trans_pcie->rba.alloc_wq xen/pvcalls: Use alloc_ordered_workqueue() to create ordered workqueues virt: acrn: Use alloc_ordered_workqueue() to create ordered workqueues net: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues net: thunderx: Use alloc_ordered_workqueue() to create ordered workqueues greybus: Use alloc_ordered_workqueue() to create ordered workqueues powerpc, workqueue: Use alloc_ordered_workqueue() to create ordered workqueues commit 7ab044a4f42aecba23db5ce96e763e5ec807bf42 Merge: 18eb3b6dff007 18c8ae813156a Author: Linus Torvalds Date: Tue Jun 27 16:32:52 2023 -0700 Merge tag 'wq-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue updates from Tejun Heo: - Concurrency-managed per-cpu work items that hog CPUs and delay the execution of other work items are now automatically detected and excluded from concurrency management. Reporting on such work items can also be enabled through a config option. - Added tools/workqueue/wq_monitor.py which improves visibility into workqueue usages and behaviors. - Arnd's minimal fix for gcc-13 enum warning on 32bit compiles, superseded by commit afa4bb778e48 in mainline. * tag 'wq-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Disable per-cpu CPU hog detection when wq_cpu_intensive_thresh_us is 0 workqueue: Fix WARN_ON_ONCE() triggers in worker_enter_idle() workqueue: fix enum type for gcc-13 workqueue: Track and monitor per-workqueue CPU time usage workqueue: Report work funcs that trigger automatic CPU_INTENSIVE mechanism workqueue: Automatically mark CPU-hogging work items CPU_INTENSIVE workqueue: Improve locking rule description for worker fields workqueue: Move worker_set/clr_flags() upwards workqueue: Re-order struct worker fields workqueue: Add pwq->stats[] and a monitoring script Further upgrade queue_work_on() comment commit 18eb3b6dff007f2e4ef4f0d8567dfb5cdb6086fc Merge: 6a46676994607 fb9b7b4b2b82d Author: Linus Torvalds Date: Tue Jun 27 16:03:20 2023 -0700 Merge tag 'for-linus-6.5-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: - three patches adding missing prototypes - a fix for finding the iBFT in a Xen dom0 for supporting diskless iSCSI boot * tag 'for-linus-6.5-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86: xen: add missing prototypes x86/xen: add prototypes for paravirt mmu functions iscsi_ibft: Fix finding the iBFT under Xen Dom 0 xen: xen_debug_interrupt prototype to global header commit 71baec7b8500c92f9723f39d06a7ae465483da1f Author: Davidlohr Bueso Date: Tue Jun 27 01:02:02 2023 -0700 cxl/pci: Use correct flag for sanitize polling This is a bogus value, left behind from a previous version. Fixes: 0c36b6ad436a ("cxl/mbox: Add sanitization handling machinery") Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/7q3vcjqidtmxmys4n34g6b3mygvhaen7yikzxanpz56lw43fz7@7subbtbfkmyx Signed-off-by: Dan Williams commit 6a46676994607a1bde51cba71c1b0d373a555f45 Merge: 8d8026f376c8e 9b9cf3c77e7e0 Author: Linus Torvalds Date: Tue Jun 27 15:49:10 2023 -0700 Merge tag 's390-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Alexander Gordeev: - Fix the style of protected key API driver source: use x-mas tree for all local variable declarations - Rework protected key API driver to not use the struct pkey_protkey and pkey_clrkey anymore. Both structures have a fixed size buffer, but with the support of ECC protected key these buffers are not big enough. Use dynamic buffers internally and transparently for userspace - Add support for a new 'non CCA clear key token' with ECC clear keys supported: ECC P256, ECC P384, ECC P521, ECC ED25519 and ECC ED448. This makes it possible to derive a protected key from the ECC clear key input via PKEY_KBLOB2PROTK3 ioctl, while currently the only way to derive is via PCKMO instruction - The s390 PMU of PAI crypto and extension 1 NNPA counters use atomic_t for reference counting. Replace this with the proper data type refcount_t - Select ARCH_SUPPORTS_INT128, but limit this to clang for now, since gcc generates inefficient code, which may lead to stack overflows - Replace one-element array with flexible-array member in struct vfio_ccw_parent and refactor the rest of the code accordingly. Also, prefer struct_size() over sizeof() open- coded versions - Introduce OS_INFO_FLAGS_ENTRY pointing to a flags field and OS_INFO_FLAG_REIPL_CLEAR flag that informs a dumper whether the system memory should be cleared or not once dumped - Fix a hang when a user attempts to remove a VFIO-AP mediated device attached to a guest: add VFIO_DEVICE_GET_IRQ_INFO and VFIO_DEVICE_SET_IRQS IOCTLs and wire up the VFIO bus driver callback to request a release of the device - Fix calculation for R_390_GOTENT relocations for modules - Allow any user space process with CAP_PERFMON capability read and display the CPU Measurement facility counter sets - Rework large statically-defined per-CPU cpu_cf_events data structure and replace it with dynamically allocated structures created when a perf_event_open() system call is invoked or /dev/hwctr device is accessed * tag 's390-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/cpum_cf: rework PER_CPU_DEFINE of struct cpu_cf_events s390/cpum_cf: open access to hwctr device for CAP_PERFMON privileged process s390/module: fix rela calculation for R_390_GOTENT s390/vfio-ap: wire in the vfio_device_ops request callback s390/vfio-ap: realize the VFIO_DEVICE_SET_IRQS ioctl s390/vfio-ap: realize the VFIO_DEVICE_GET_IRQ_INFO ioctl s390/pkey: add support for ecc clear key s390/pkey: do not use struct pkey_protkey s390/pkey: introduce reverse x-mas trees s390/zcore: conditionally clear memory on reipl s390/ipl: add REIPL_CLEAR flag to os_info vfio/ccw: use struct_size() helper vfio/ccw: replace one-element array with flexible-array member s390: select ARCH_SUPPORTS_INT128 s390/pai_ext: replace atomic_t with refcount_t s390/pai_crypto: replace atomic_t with refcount_t commit 8d8026f376c8e46cc90c59de91256d8ee4322ad8 Merge: 0ae612299621b f7667ca106df5 Author: Linus Torvalds Date: Tue Jun 27 15:44:11 2023 -0700 Merge tag 'xtensa-20230627' of https://github.com/jcmvbkbc/linux-xtensa Pull xtensa updates from Max Filippov: - clean up platform_* interface of the xtensa architecture - enable HAVE_ASM_MODVERSIONS - drop ARCH_WANT_FRAME_POINTERS - clean up unaligned access exception handler - provide handler for load/store exceptions - various small fixes and cleanups * tag 'xtensa-20230627' of https://github.com/jcmvbkbc/linux-xtensa: xtensa: dump userspace code around the exception PC xtensa: rearrange show_stack output xtensa: add load/store exception handler xtensa: rearrange unaligned exception handler xtensa: always install slow handler for unaligned access exception xtensa: move early_trap_init from kasan_early_init to init_arch xtensa: drop ARCH_WANT_FRAME_POINTERS xtensa: report trax and perf counters in cpuinfo xtensa: add asm-prototypes.h xtensa: only build __strncpy_user with CONFIG_ARCH_HAS_STRNCPY_FROM_USER xtensa: drop bcopy implementation xtensa: drop EXPORT_SYMBOL for common_exception_return xtensa: boot-redboot: clean up Makefile xtensa: clean up default platform functions xtensa: drop platform_halt and platform_power_off xtensa: drop platform_restart xtensa: drop platform_heartbeat xtensa: xt2000: drop empty platform_init commit 0ae612299621b5ae76bec55cc92503b6ed3f554b Author: Dinh Nguyen Date: Tue Jun 27 17:14:30 2023 -0500 Revert "nios2: Convert __pte_free_tlb() to use ptdescs" This reverts commit 6ebe94baa2b9ddf3ccbb7f94df6ab26234532734. The patch "nios2: Convert __pte_free_tlb() to use ptdescs" was supposed to go together with a patchset that Vishal Moola had planned taking it through the mm tree. By just having this patch, all NIOS2 builds are broken. Signed-off-by: Dinh Nguyen Signed-off-by: Linus Torvalds commit 10e1c0d59006c6492d380602aa0a6c4eb9441426 Author: Jens Axboe Date: Tue Jun 27 11:57:53 2023 -0600 io_uring: remove io_fallback_tw() forward declaration It's used just one function higher up, get rid of the declaration and just move it up a bit. Signed-off-by: Jens Axboe commit b65db9211ecb7f8383e02dcf71b8c1e9c7043a40 Author: Jens Axboe Date: Tue Jun 27 12:05:01 2023 -0600 io_uring/net: use proper value for msg_inq struct msghdr->msg_inq is a signed type, yet we attempt to store what is essentially an unsigned bitmask in there. We only really need to know if the field was stored or not, but let's use the proper type to avoid any misunderstandings on what is being attempted here. Link: https://lore.kernel.org/io-uring/CAHk-=wjKb24aSe6fE4zDH-eh8hr-FB9BbukObUVSMGOrsBHCRQ@mail.gmail.com/ Reported-by: Linus Torvalds Signed-off-by: Jens Axboe commit 6f612579be9d0ff527ca2e517e10bfaf08cc1860 Merge: 4d6751815b1d3 301cf77e21317 Author: Linus Torvalds Date: Tue Jun 27 15:05:41 2023 -0700 Merge tag 'objtool-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool updates from Ingo Molar: "Build footprint & performance improvements: - Reduce memory usage with CONFIG_DEBUG_INFO=y In the worst case of an allyesconfig+CONFIG_DEBUG_INFO=y kernel, DWARF creates almost 200 million relocations, ballooning objtool's peak heap usage to 53GB. These patches reduce that to 25GB. On a distro-type kernel with kernel IBT enabled, they reduce objtool's peak heap usage from 4.2GB to 2.8GB. These changes also improve the runtime significantly. Debuggability improvements: - Add the unwind_debug command-line option, for more extend unwinding debugging output - Limit unreachable warnings to once per function - Add verbose option for disassembling affected functions - Include backtrace in verbose mode - Detect missing __noreturn annotations - Ignore exc_double_fault() __noreturn warnings - Remove superfluous global_noreturns entries - Move noreturn function list to separate file - Add __kunit_abort() to noreturns Unwinder improvements: - Allow stack operations in UNWIND_HINT_UNDEFINED regions - drm/vmwgfx: Add unwind hints around RBP clobber Cleanups: - Move the x86 entry thunk restore code into thunk functions - x86/unwind/orc: Use swap() instead of open coding it - Remove unnecessary/unused variables Fixes for modern stack canary handling" * tag 'objtool-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (42 commits) x86/orc: Make the is_callthunk() definition depend on CONFIG_BPF_JIT=y objtool: Skip reading DWARF section data objtool: Free insns when done objtool: Get rid of reloc->rel[a] objtool: Shrink elf hash nodes objtool: Shrink reloc->sym_reloc_entry objtool: Get rid of reloc->jump_table_start objtool: Get rid of reloc->addend objtool: Get rid of reloc->type objtool: Get rid of reloc->offset objtool: Get rid of reloc->idx objtool: Get rid of reloc->list objtool: Allocate relocs in advance for new rela sections objtool: Add for_each_reloc() objtool: Don't free memory in elf_close() objtool: Keep GElf_Rel[a] structs synced objtool: Add elf_create_section_pair() objtool: Add mark_sec_changed() objtool: Fix reloc_hash size objtool: Consolidate rel/rela handling ... commit 4d6751815b1d3057423b3feb156bd1525b7183e2 Merge: a193cc7506fde 78841cd185aa7 Author: Linus Torvalds Date: Tue Jun 27 14:47:17 2023 -0700 Merge tag 'x86-mm-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 mm updates from Ingo Molnar: - Remove Xen-PV leftovers from init_32.c - Fix __swp_entry_to_pte() warning splat for Xen PV guests, triggered on CONFIG_DEBUG_VM_PGTABLE=y * tag 'x86-mm-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Remove Xen-PV leftovers from init_32.c x86/mm: Fix __swp_entry_to_pte() for Xen PV guests commit a193cc7506fde23185a7c0d99474a03a8ec5ee4c Merge: bc6cb4d5bc3a4 228020b490eda Author: Linus Torvalds Date: Tue Jun 27 14:43:02 2023 -0700 Merge tag 'perf-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf events updates from Ingo Molnar: - Rework & fix the event forwarding logic by extending the core interface. This fixes AMD PMU events that have to be forwarded from the core PMU to the IBS PMU. - Add self-tests to test AMD IBS invocation via core PMU events - Clean up Intel FixCntrCtl MSR encoding & handling * tag 'perf-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Re-instate the linear PMU search perf/x86/intel: Define bit macros for FixCntrCtl MSR perf test: Add selftest to test IBS invocation via core pmu events perf/core: Remove pmu linear searching code perf/ibs: Fix interface via core pmu events perf/core: Rework forwarding of {task|cpu}-clock events commit bc6cb4d5bc3a44197de30784eae71d8ba28483eb Merge: ed3b7923a816d b33eb50a92b0a Author: Linus Torvalds Date: Tue Jun 27 14:14:30 2023 -0700 Merge tag 'locking-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking updates from Ingo Molnar: - Introduce cmpxchg128() -- aka. the demise of cmpxchg_double() The cmpxchg128() family of functions is basically & functionally the same as cmpxchg_double(), but with a saner interface. Instead of a 6-parameter horror that forced u128 - u64/u64-halves layout details on the interface and exposed users to complexity, fragility & bugs, use a natural 3-parameter interface with u128 types. - Restructure the generated atomic headers, and add kerneldoc comments for all of the generic atomic{,64,_long}_t operations. The generated definitions are much cleaner now, and come with documentation. - Implement lock_set_cmp_fn() on lockdep, for defining an ordering when taking multiple locks of the same type. This gets rid of one use of lockdep_set_novalidate_class() in the bcache code. - Fix raw_cpu_generic_try_cmpxchg() bug due to an unintended variable shadowing generating garbage code on Clang on certain ARM builds. * tag 'locking-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (43 commits) locking/atomic: scripts: fix ${atomic}_dec_if_positive() kerneldoc percpu: Fix self-assignment of __old in raw_cpu_generic_try_cmpxchg() locking/atomic: treewide: delete arch_atomic_*() kerneldoc locking/atomic: docs: Add atomic operations to the driver basic API documentation locking/atomic: scripts: generate kerneldoc comments docs: scripts: kernel-doc: accept bitwise negation like ~@var locking/atomic: scripts: simplify raw_atomic*() definitions locking/atomic: scripts: simplify raw_atomic_long*() definitions locking/atomic: scripts: split pfx/name/sfx/order locking/atomic: scripts: restructure fallback ifdeffery locking/atomic: scripts: build raw_atomic_long*() directly locking/atomic: treewide: use raw_atomic*_() locking/atomic: scripts: add trivial raw_atomic*_() locking/atomic: scripts: factor out order template generation locking/atomic: scripts: remove leftover "${mult}" locking/atomic: scripts: remove bogus order parameter locking/atomic: xtensa: add preprocessor symbols locking/atomic: x86: add preprocessor symbols locking/atomic: sparc: add preprocessor symbols locking/atomic: sh: add preprocessor symbols ... commit ed3b7923a816ded62dccef377c9ee346c7d3b1b4 Merge: e8f75c0270d93 ebb83d84e49b5 Author: Linus Torvalds Date: Tue Jun 27 14:03:21 2023 -0700 Merge tag 'sched-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler updates from Ingo Molnar: "Scheduler SMP load-balancer improvements: - Avoid unnecessary migrations within SMT domains on hybrid systems. Problem: On hybrid CPU systems, (processors with a mixture of higher-frequency SMT cores and lower-frequency non-SMT cores), under the old code lower-priority CPUs pulled tasks from the higher-priority cores if more than one SMT sibling was busy - resulting in many unnecessary task migrations. Solution: The new code improves the load balancer to recognize SMT cores with more than one busy sibling and allows lower-priority CPUs to pull tasks, which avoids superfluous migrations and lets lower-priority cores inspect all SMT siblings for the busiest queue. - Implement the 'runnable boosting' feature in the EAS balancer: consider CPU contention in frequency, EAS max util & load-balance busiest CPU selection. This improves CPU utilization for certain workloads, while leaves other key workloads unchanged. Scheduler infrastructure improvements: - Rewrite the scheduler topology setup code by consolidating it into the build_sched_topology() helper function and building it dynamically on the fly. - Resolve the local_clock() vs. noinstr complications by rewriting the code: provide separate sched_clock_noinstr() and local_clock_noinstr() functions to be used in instrumentation code, and make sure it is all instrumentation-safe. Fixes: - Fix a kthread_park() race with wait_woken() - Fix misc wait_task_inactive() bugs unearthed by the -rt merge: - Fix UP PREEMPT bug by unifying the SMP and UP implementations - Fix task_struct::saved_state handling - Fix various rq clock update bugs, unearthed by turning on the rq clock debugging code. - Fix the PSI WINDOW_MIN_US trigger limit, which was easy to trigger by creating enough cgroups, by removing the warnign and restricting window size triggers to PSI file write-permission or CAP_SYS_RESOURCE. - Propagate SMT flags in the topology when removing degenerate domain - Fix grub_reclaim() calculation bug in the deadline scheduler code - Avoid resetting the min update period when it is unnecessary, in psi_trigger_destroy(). - Don't balance a task to its current running CPU in load_balance(), which was possible on certain NUMA topologies with overlapping groups. - Fix the sched-debug printing of rq->nr_uninterruptible Cleanups: - Address various -Wmissing-prototype warnings, as a preparation to (maybe) enable this warning in the future. - Remove unused code - Mark more functions __init - Fix shadow-variable warnings" * tag 'sched-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (50 commits) sched/core: Avoid multiple calling update_rq_clock() in __cfsb_csd_unthrottle() sched/core: Avoid double calling update_rq_clock() in __balance_push_cpu_stop() sched/core: Fixed missing rq clock update before calling set_rq_offline() sched/deadline: Update GRUB description in the documentation sched/deadline: Fix bandwidth reclaim equation in GRUB sched/wait: Fix a kthread_park race with wait_woken() sched/topology: Mark set_sched_topology() __init sched/fair: Rename variable cpu_util eff_util arm64/arch_timer: Fix MMIO byteswap sched/fair, cpufreq: Introduce 'runnable boosting' sched/fair: Refactor CPU utilization functions cpuidle: Use local_clock_noinstr() sched/clock: Provide local_clock_noinstr() x86/tsc: Provide sched_clock_noinstr() clocksource: hyper-v: Provide noinstr sched_clock() clocksource: hyper-v: Adjust hv_read_tsc_page_tsc() to avoid special casing U64_MAX x86/vdso: Fix gettimeofday masking math64: Always inline u128 version of mul_u64_u64_shr() s390/time: Provide sched_clock_noinstr() loongarch: Provide noinstr sched_clock_read() ... commit 356fa4975950d48d12b6ee9f9050ad429db25852 Merge: 3f711c249032f fb9c384625dd6 Author: Arnd Bergmann Date: Tue Jun 27 22:54:28 2023 +0200 Merge tag 'soc-fsl-next-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into soc/drivers NXP/FSL SoC driver updates for v6.5 - fsl-mc: Make remove function return void - QE USB: fix build issue caused by missing dependency * tag 'soc-fsl-next-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux: bus: fsl-mc: fsl-mc-allocator: Drop a write-only variable bus: fsl-mc: fsl-mc-allocator: Initialize mc_bus_dev before use soc/fsl/qe: fix usb.c build errors bus: fsl-mc: Make remove function return void soc: fsl: dpio: Suppress duplicated error reporting on device remove bus: fsl-mc: fsl-mc-allocator: Improve error reporting bus: fsl-mc: fsl-mc-allocator: Drop if block with always wrong condition bus: fsl-mc: dprc: Push down error message from fsl_mc_driver_remove() bus: fsl-mc: Only warn once about errors on device unbind Link: https://lore.kernel.org/r/20230621222503.12402-1-leoyang.li@nxp.com Signed-off-by: Arnd Bergmann commit e8f75c0270d930ef675fee22d74d1a3250e96962 Merge: 12dc010071131 1e327963cfab0 Author: Linus Torvalds Date: Tue Jun 27 13:49:33 2023 -0700 Merge tag 'x86_sgx_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull SGX update from Borislav Petkov: - A fix to avoid using a list iterator variable after the loop it is used in * tag 'x86_sgx_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/sgx: Avoid using iterator after loop in sgx_mmu_notifier_release() commit b571809ec3b0af1a93d46bb09fece4ddeafe5a97 Merge: ef4ca0517c860 9a6c0e28e2155 Author: Jiri Kosina Date: Tue Jun 27 22:43:39 2023 +0200 Merge branch 'for-6.5/wacom' into for-linus - touch selftests for hid-wacom (Joshua Dickens) - conversion of hid-wacom to use ktime_t (Jason Gerecke) commit ef4ca0517c860b34fe4f112960ef40c4e3e9f39b Merge: f5e3e50b7df8c f88af60e74a5b Author: Jiri Kosina Date: Tue Jun 27 22:42:48 2023 +0200 Merge branch 'for-6.5/nvidia' into for-linus - support for nVidia Thunderstrike (SHIELD 2017) controller (Rahul Rameshbabu) commit f5e3e50b7df8c3dbb79a17eebc10da5f5133f2a6 Merge: 278cc2f13d803 e4b880758a918 Author: Jiri Kosina Date: Tue Jun 27 22:42:28 2023 +0200 Merge branch 'for-6.5/i2c-hid' into for-linus commit 278cc2f13d8031e23b04744de739310257eaf6b2 Merge: 1639f986e37ad 7607f12ba735f Author: Jiri Kosina Date: Tue Jun 27 22:41:03 2023 +0200 Merge branch 'for-6.5/goodix' into for-linus - power management reset-during-suspend fix for goodix Chromebook devices (Fei Shao) commit 1639f986e37ada6407f21825dd079ca3c17141b7 Merge: e80b500370e71 49904a0ebf23b Author: Jiri Kosina Date: Tue Jun 27 22:38:37 2023 +0200 Merge branch 'for-6.5/core' into for-linus - more bullet-proof handling of devres-managed resources in HID core (Dmitry Torokhov) - kunit test Kconfig dependency fix (Geert Uytterhoeven) commit e80b500370e71b8cd7dd64be4080cee0a3e5068f Merge: 177d591aba383 72e49cadea390 Author: Jiri Kosina Date: Tue Jun 27 22:37:24 2023 +0200 Merge branch 'for-6.5/apple' into for-linus - improved support for Keychron K8 keyboard (Lasse Brun) commit 177d591aba3838abc13968a25a3b339b420d97ca Merge: e7de761b027ed 19b60accb67b6 Author: Jiri Kosina Date: Tue Jun 27 22:32:06 2023 +0200 Merge branch 'for-6.5/amd-sfh' into for-linus - amd-sfh driver code cleanups (Basavaraj Natikar) commit e7de761b027ed92bf7cef45cb3880e94c3f2bc75 Merge: 944ee77dc6ec7 e6c7e2711df65 Author: Jiri Kosina Date: Tue Jun 27 22:30:34 2023 +0200 Merge branch 'for-6.5/acer' into for-linus - ASUS ROG Z13 keyboard support and other assorted fixes to hid-asus (Luke D. Jones) commit 12dc010071131aeabd6626a14809e6d3af266bd4 Merge: dc43fc753bb59 da86eb9611840 Author: Linus Torvalds Date: Tue Jun 27 13:26:30 2023 -0700 Merge tag 'x86_sev_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 SEV updates from Borislav Petkov: - Some SEV and CC platform helpers cleanup and simplifications now that the usage patterns are becoming apparent [ I'm sure I'm the only one that has gets confused by all the TLAs, but in case there are others: here SEV is AMD's "Secure Encrypted Virtualization" and CC is generic "Confidential Computing". There's also Intel SGX (Software Guard Extensions) and TDX (Trust Domain Extensions), along with all the vendor memory encryption extensions (SME, TSME, TME, and WTF). And then we have arm64 with RMA and CCA, and I probably forgot another dozen or so related acronyms - Linus ] * tag 'x86_sev_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/coco: Get rid of accessor functions x86/sev: Get rid of special sev_es_enable_key x86/coco: Mark cc_platform_has() and descendants noinstr commit dc43fc753bb5946e91ccdce9f393074675379a00 Merge: 4baa098a147d7 30d65d1b19850 Author: Linus Torvalds Date: Tue Jun 27 13:11:32 2023 -0700 Merge tag 'x86_mtrr_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 mtrr updates from Borislav Petkov: "A serious scrubbing of the MTRR code including adding a new map mechanism in order to look up the memory type of a region easily. Also address memory range lookup issues like returning an invalid memory type. Furthermore, this handles the decoupling of PAT from MTRR more naturally. All work by Juergen Gross" * tag 'x86_mtrr_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/xen: Set default memory type for PV guests to WB x86/mtrr: Unify debugging printing x86/mtrr: Remove unused code x86/mm: Only check uniform after calling mtrr_type_lookup() x86/mtrr: Don't let mtrr_type_lookup() return MTRR_TYPE_INVALID x86/mtrr: Use new cache_map in mtrr_type_lookup() x86/mtrr: Add mtrr=debug command line option x86/mtrr: Construct a memory map with cache modes x86/mtrr: Add get_effective_type() service function x86/mtrr: Allocate mtrr_value array dynamically x86/mtrr: Move 32-bit code from mtrr.c to legacy.c x86/mtrr: Have only one set_mtrr() variant x86/mtrr: Replace vendor tests in MTRR code x86/xen: Set MTRR state when running as Xen PV initial domain x86/hyperv: Set MTRR state when running as SEV-SNP Hyper-V guest x86/mtrr: Support setting MTRR state for software defined MTRRs x86/mtrr: Replace size_or_mask and size_and_mask with a much easier concept x86/mtrr: Remove physical address size calculation commit e2c789cab60a493a72b42cb53eb5fbf96d5f1ae3 Author: Mikulas Patocka Date: Mon Jun 26 16:48:40 2023 +0200 dm: get rid of GFP_NOIO workarounds for __vmalloc and kvmalloc In the past, the function __vmalloc didn't respect the GFP flags - it allocated memory with the provided gfp flags, but it allocated page tables with GFP_KERNEL. This was fixed in commit 451769ebb7e7 ("mm/vmalloc: alloc GFP_NO{FS,IO} for vmalloc") so the memalloc_noio_{save,restore} workaround is no longer needed. The function kvmalloc didn't like flags different from GFP_KERNEL. This was fixed in commit a421ef303008 ("mm: allow !GFP_KERNEL allocations for kvmalloc"), so kvmalloc can now be called with GFP_NOIO. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 3be1622895af25101f7046ed0b2286bead2219d4 Author: Mikulas Patocka Date: Mon Jun 26 16:46:57 2023 +0200 dm integrity: scale down the recalculate buffer if memory allocation fails If memory allocation fails, try to reduce the size of the recalculate buffer and continue with that smaller buffer. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit da8b4fc1f63a01a0eca9338ae338b804c437b51f Author: Mikulas Patocka Date: Mon Jun 26 16:46:00 2023 +0200 dm integrity: only allocate recalculate buffer when needed dm-integrity preallocated 8MiB buffer for recalculating in the constructor and freed it in the destructor. This wastes memory when the user has many dm-integrity devices. Fix dm-integrity so that the buffer is only allocated when recalculation is in progress; allocate the buffer at the beginning of integrity_recalc() and free it at the end. Note that integrity_recalc() doesn't hold any locks when allocating the buffer, so it shouldn't cause low-memory deadlock. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 6d50eb4725934fd22f5eeccb401000687c790fd0 Author: Mikulas Patocka Date: Mon Jun 26 16:44:34 2023 +0200 dm integrity: reduce vmalloc space footprint on 32-bit architectures It was reported that dm-integrity runs out of vmalloc space on 32-bit architectures. On x86, there is only 128MiB vmalloc space and dm-integrity consumes it quickly because it has a 64MiB journal and 8MiB recalculate buffer. Fix this by reducing the size of the journal to 4MiB and the size of the recalculate buffer to 1MiB, so that multiple dm-integrity devices can be created and activated on 32-bit architectures. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 4baa098a147d76a9ad1a6867fa14286db52085b6 Merge: 4aacacee86174 5516c89d58283 Author: Linus Torvalds Date: Tue Jun 27 12:25:42 2023 -0700 Merge tag 'x86_misc_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull misc x86 updates from Borislav Petkov: - Remove the local symbols prefix of the get/put_user() exception handling symbols so that tools do not get confused by the presence of code belonging to the wrong symbol/not belonging to any symbol - Improve csum_partial()'s performance - Some improvements to the kcpuid tool * tag 'x86_misc_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/lib: Make get/put_user() exception handling a visible symbol x86/csum: Fix clang -Wuninitialized in csum_partial() x86/csum: Improve performance of `csum_partial` tools/x86/kcpuid: Add .gitignore tools/x86/kcpuid: Dump the correct CPUID function in error commit ad5f604e186ac08d12c401e34ea96c09c38ddbc5 Author: Namhyung Kim Date: Mon Jun 26 23:32:57 2023 -0700 perf test: Fix a compile error on pe-file-parsing.c The dso__find_symbol_by_name() should be have idx pointer argument. Found during the build-test. $ make build-test ... CC /tmp/tmp.6JwPK1xbWG/tests/pe-file-parsing.o tests/pe-file-parsing.c: In function ‘run_dir’: tests/pe-file-parsing.c:64:15: error: too few arguments to function ‘dso__find_symbol_by_name’ 64 | sym = dso__find_symbol_by_name(dso, "main"); | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from tests/pe-file-parsing.c:16: /usr/local/google/home/namhyung/project/linux/tools/perf/util/symbol.h:135:16: note: declared here 135 | struct symbol *dso__find_symbol_by_name(struct dso *dso, const char *name, size_t *idx); | ^~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 259dce914e93 ("perf symbol: Remove symbol_name_rb_node") Acked-by: Ian Rogers Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230627063257.549005-1-namhyung@kernel.org Signed-off-by: Namhyung Kim commit 78987bb02ad29161a75d7c512822232321250d1d Author: Fangrui Song Date: Sat Jun 24 00:27:08 2023 +0000 perf: Replace deprecated -target with --target= for Clang -target has been deprecated since Clang 3.4 in 2013. Use the preferred --target=bpf form instead. This matches how we use --target= in scripts/Makefile.clang. Signed-off-by: Fangrui Song Acked-by: Yonghong Song Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: llvm@lists.linux.dev Cc: Ingo Molnar Cc: bpf@vger.kernel.org Link: https://github.com/llvm/llvm-project/commit/274b6f0c87a6a1798de0a68135afc7f95def6277 Link: https://lore.kernel.org/r/20230624002708.1907962-1-maskray@google.com [ resolved a conflict with GEN_VMLINUX_H changes ] Signed-off-by: Namhyung Kim commit 710dffc969023315c3c32717dc08b543012e60d8 Author: Ian Rogers Date: Sun Jun 25 22:30:48 2023 -0700 perf pmu: Correct auto_merge_stats test The original logic was to check is_pmu_hybrid() like in the below. It just checks the name of PMU specifically for Intel hybrid systems which means uncore PMU events should return false. https://lore.kernel.org/all/20230527072210.2900565-35-irogers@google.com/ The is_pmu_hybrid() was replaced by arch-agnostic way but with the incorrect condition which was fixed for core PMUs but not uncore. This change fixes both. Fixes: e23421426e13 ("perf pmu: Correct perf_pmu__auto_merge_stats() affecting hybrid") Signed-off-by: Ian Rogers Tested-by: Namhyung Kim Cc: James Clark Cc: Mark Rutland Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Andi Kleen Cc: Alexander Shishkin Cc: Kan Liang Cc: Ingo Molnar Link: https://lore.kernel.org/all/CAP-5=fXOi=xQ4=j5xAq+jWLR9n7uvfsWK+PzXkY1MZ3Fz-xccw@mail.gmail.com/ Link: https://lore.kernel.org/r/20230626053048.257959-1-irogers@google.com [ rephrase the commit log a bit ] Signed-off-by: Namhyung Kim commit 49a5e3edd35352833270dd18b0d5ca414fcc9406 Author: Jiri Olsa Date: Mon Jun 26 22:16:05 2023 +0200 perf tools: Add missing else to cmd_daemon subcommand condition Namhyung reported segfault in perf daemon start command. It's caused by extra check on argv[0] which is set to NULL by previous __cmd_start call. Adding missing else to skip the extra check. Fixes: 92294b906e6c ("perf daemon: Dynamically allocate path to perf") Reported-and-Tested-by: Namhyung Kim Reported-by: Thomas Richter Signed-off-by: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Ian Rogers Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Ingo Molnar Cc: Alexander Shishkin Link: https://lore.kernel.org/r/20230626201606.2514679-1-jolsa@kernel.org Signed-off-by: Namhyung Kim commit 4aacacee8617424e1dacead8d830e5b768eb3e53 Merge: 04fc8904d5d18 a32b0f0db3f39 Author: Linus Torvalds Date: Tue Jun 27 12:03:44 2023 -0700 Merge tag 'x86_microcode_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 microcode loader updates from Borislav Petkov: - Load late on both SMT threads on AMD, just like it is being done in the early loading procedure - Cleanups * tag 'x86_microcode_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/microcode/AMD: Load late on both threads too x86/microcode/amd: Remove unneeded pointer arithmetic x86/microcode/AMD: Get rid of __find_equiv_id() commit 04fc8904d5d18a132f5ad67b79ee980b6602c8c6 Merge: a3540495324af f8c25662028b3 Author: Linus Torvalds Date: Tue Jun 27 11:58:16 2023 -0700 Merge tag 'docs-arm-move' of git://git.lwn.net/linux Pull arm documentation move from Jonathan Corbet: "Move the Arm architecture documentation under Documentation/arch/. This brings some order to the documentation directory, declutters the top-level directory, and makes the documentation organization more closely match that of the source" * tag 'docs-arm-move' of git://git.lwn.net/linux: dt-bindings: Update Documentation/arm references docs: update some straggling Documentation/arm references crypto: update some Arm documentation references mips: update a reference to a moved Arm Document arm64: Update Documentation/arm references arm: update in-source documentation references arm: docs: Move Arm documentation to Documentation/arch/ commit a3540495324af9b7fa95b62da2ccbf7cdb4e3622 Merge: dedbf31ac8a57 a1e72bb00a486 Author: Linus Torvalds Date: Tue Jun 27 11:33:47 2023 -0700 Merge tag 'docs-6.5' of git://git.lwn.net/linux Pull documentation updates from Jonathan Corbet: "It's been a relatively calm cycle in docsland. We do have: - Some initial page-table documentation from Linus (the other Linus) - Regression-handling documentation improvements from Thorsten - Addition of kerneldoc documentation for the ERR_PTR() and related macros from James Seo ... and the usual collection of fixes and updates" * tag 'docs-6.5' of git://git.lwn.net/linux: docs: consolidate storage interfaces Documentation: update git configuration for Link: tag Documentation: KVM: make corrections to vcpu-requests.rst Documentation: KVM: make corrections to ppc-pv.rst Documentation: KVM: make corrections to locking.rst Documentation: KVM: make corrections to halt-polling.rst Documentation: virt: correct location of haltpoll module params Documentation/mm: Initial page table documentation docs: crypto: async-tx-api: fix typo in struct name docs/doc-guide: Clarify how to write tables docs: handling-regressions: rework section about fixing procedures docs: process: fix a typoed cross-reference docs: submitting-patches: Discuss interleaved replies MAINTAINERS: direct process doc changes to a dedicated ML Documentation: core-api: Add error pointer functions to kernel-api err.h: Add missing kerneldocs for error pointer functions Documentation: conf.py: Add __force to c_id_attributes docs: clarify KVM related kernel parameters' descriptions docs: consolidate human interface subsystems docs: admin-guide: Add information about intel_pstate active mode commit dedbf31ac8a57eaa29b6e4f9745dadffa83dd947 Merge: 9ba92dc1de0a2 8cd0d8633e2de Author: Linus Torvalds Date: Tue Jun 27 11:28:56 2023 -0700 Merge tag 'linux-kselftest-next-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull kselftest updates from Shuah Khan: - allow runners to override the timeout This change is made to avoid future increases of long timeouts - several other spelling and cleanups - a new subtest to video_device_test - enhancements to test coverage in clone3 test - other fixes to ftrace and cpufreq tests * tag 'linux-kselftest-next-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/ftace: Fix KTAP output ordering selftests/cpufreq: Don't enable generic lock debugging options kselftests: Sort the collections list to avoid duplicate tests selftest: pidfd: Omit long and repeating outputs selftests: allow runners to override the timeout selftests/ftrace: Add new test case which checks for optimized probes selftests/clone3: test clone3 with exit signal in flags kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined selftests: prctl: Fix spelling mistake "anonynous" -> "anonymous" selftests: media_tests: Add new subtest to video_device_test commit bb814518bf7c2d6c0468a39153de222e0400e3a4 Merge: 40e8e98f512fc 5fb2864cbd50a Author: Rafael J. Wysocki Date: Tue Jun 27 20:15:17 2023 +0200 Merge tag 'opp-updates-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull OPP (Operating Performance Points) updates for 6.5 from Viresh Kumar: "- Simplify performance state related logic in the OPP core (Viresh Kumar). - Fix use-after-free and improve locking around lazy_opp_tables (Viresh Kumar and Stephan Gerhold). - Minor cleanups - using dev_err_probe() and rate-limiting debug messages (Andrew Halaney and Adrián Larumbe)." * tag 'opp-updates-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: OPP: Properly propagate error along when failing to get icc_path OPP: Use dev_err_probe() when failing to get icc_path OPP: Simplify the over-designed pstate <-> level dance OPP: pstate is only valid for genpd OPP tables OPP: don't drop performance constraint on OPP table removal OPP: Protect `lazy_opp_tables` list with `opp_table_lock` OPP: Staticize `lazy_opp_tables` in of.c opp: Fix use-after-free in lazy_opp_tables after probe deferral OPP: rate-limit debug messages when no change in OPP is required commit 9ba92dc1de0a25e72b0cddb30386bf611e6cb46e Merge: b19edac5992da 2e66833579ed7 Author: Linus Torvalds Date: Tue Jun 27 11:12:55 2023 -0700 Merge tag 'linux-kselftest-kunit-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit updates from Shuah Khan: - kunit_add_action() API to defer a call until test exit - Update document to add kunit_add_action() usage notes - Changes to always run cleanup from a test kthread - Documentation updates to clarify cleanup usage (assertions should not be used in cleanup) - Documentation update to clearly indicate that exit functions should run even if init fails - Several fixes and enhancements to existing tests * tag 'linux-kselftest-kunit-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: MAINTAINERS: Add source tree entry for kunit Documentation: kunit: Rename references to kunit_abort() kunit: Move kunit_abort() call out of kunit_do_failed_assertion() kunit: Fix obsolete name in documentation headers (func->action) Documentation: Kunit: add MODULE_LICENSE to sample code kunit: Update kunit_print_ok_not_ok function kunit: Fix reporting of the skipped parameterized tests kunit/test: Add example test showing parameterized testing Documentation: kunit: Add usage notes for kunit_add_action() kunit: kmalloc_array: Use kunit_add_action() kunit: executor_test: Use kunit_add_action() kunit: Add kunit_add_action() to defer a call until test exit kunit: example: Provide example exit functions Documentation: kunit: Warn that exit functions run even if init fails Documentation: kunit: Note that assertions should not be used in cleanup kunit: Always run cleanup from a test kthread Documentation: kunit: Modular tests should not depend on KUNIT=y kunit: tool: undo type subscripts for subprocess.Popen commit 813ce98178b1f723de813949a5dd2d50690a95e7 Merge: 40e8e98f512fc 5ee64250286e8 Author: Rafael J. Wysocki Date: Tue Jun 27 20:10:57 2023 +0200 Merge tag 'cpufreq-arm-updates-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull ARM cpufreq updates for 6.5 from Viresh Kumar: "- Add support to build cpufreq-dt-platdev as module (Zhipeng Wang). - Don't allocate Sparc's cpufreq_driver dynamically (Viresh Kumar). - Add support for TI's AM62A7 platform (Vibhore Vardhan). - Add support for Armada's ap807 platform (Russell King (Oracle)). - Add support for StarFive JH7110 SoC (Mason Huo). - Fix voltage selection for Mediatek Socs (Daniel Golle). - Fix error handling in Tegra's cpufreq driver (Christophe JAILLET). - Document Qualcomm's IPQ8074 in DT bindings (Robert Marko). - Don't warn for disabling a non-existing frequency for imx6q cpufreq driver (Christoph Niedermaier). - Use dev_err_probe() in Qualcomm's cpufreq driver (Andrew Halaney)." commit ff598081e5b9d0bdd6874bfe340811bbb75b35e4 Author: Eric Farman Date: Mon Jun 26 15:36:42 2023 +0200 vfio/mdev: Move the compat_class initialization to module init The pointer to mdev_bus_compat_class is statically defined at the top of mdev_core, and was originally (commit 7b96953bc640 ("vfio: Mediated device Core driver") serialized by the parent_list_lock. The blamed commit removed this mutex, leaving the pointer initialization unserialized. As a result, the creation of multiple MDEVs in parallel (such as during boot) can encounter errors during the creation of the sysfs entries, such as: [ 8.337509] sysfs: cannot create duplicate filename '/class/mdev_bus' [ 8.337514] vfio_ccw 0.0.01d8: MDEV: Registered [ 8.337516] CPU: 13 PID: 946 Comm: driverctl Not tainted 6.4.0-rc7 #20 [ 8.337522] Hardware name: IBM 3906 M05 780 (LPAR) [ 8.337525] Call Trace: [ 8.337528] [<0000000162b0145a>] dump_stack_lvl+0x62/0x80 [ 8.337540] [<00000001622aeb30>] sysfs_warn_dup+0x78/0x88 [ 8.337549] [<00000001622aeca6>] sysfs_create_dir_ns+0xe6/0xf8 [ 8.337552] [<0000000162b04504>] kobject_add_internal+0xf4/0x340 [ 8.337557] [<0000000162b04d48>] kobject_add+0x78/0xd0 [ 8.337561] [<0000000162b04e0a>] kobject_create_and_add+0x6a/0xb8 [ 8.337565] [<00000001627a110e>] class_compat_register+0x5e/0x90 [ 8.337572] [<000003ff7fd815da>] mdev_register_parent+0x102/0x130 [mdev] [ 8.337581] [<000003ff7fdc7f2c>] vfio_ccw_sch_probe+0xe4/0x178 [vfio_ccw] [ 8.337588] [<0000000162a7833c>] css_probe+0x44/0x80 [ 8.337599] [<000000016279f4da>] really_probe+0xd2/0x460 [ 8.337603] [<000000016279fa08>] driver_probe_device+0x40/0xf0 [ 8.337606] [<000000016279fb78>] __device_attach_driver+0xc0/0x140 [ 8.337610] [<000000016279cbe0>] bus_for_each_drv+0x90/0xd8 [ 8.337618] [<00000001627a00b0>] __device_attach+0x110/0x190 [ 8.337621] [<000000016279c7c8>] bus_rescan_devices_helper+0x60/0xb0 [ 8.337626] [<000000016279cd48>] drivers_probe_store+0x48/0x80 [ 8.337632] [<00000001622ac9b0>] kernfs_fop_write_iter+0x138/0x1f0 [ 8.337635] [<00000001621e5e14>] vfs_write+0x1ac/0x2f8 [ 8.337645] [<00000001621e61d8>] ksys_write+0x70/0x100 [ 8.337650] [<0000000162b2bdc4>] __do_syscall+0x1d4/0x200 [ 8.337656] [<0000000162b3c828>] system_call+0x70/0x98 [ 8.337664] kobject: kobject_add_internal failed for mdev_bus with -EEXIST, don't try to register things with the same name in the same directory. [ 8.337668] kobject: kobject_create_and_add: kobject_add error: -17 [ 8.337674] vfio_ccw: probe of 0.0.01d9 failed with error -12 [ 8.342941] vfio_ccw_mdev aeb9ca91-10c6-42bc-a168-320023570aea: Adding to iommu group 2 Move the initialization of the mdev_bus_compat_class pointer to the init path, to match the cleanup in module exit. This way the code in mdev_register_parent() can simply link the new parent to it, rather than determining whether initialization is required first. Fixes: 89345d5177aa ("vfio/mdev: embedd struct mdev_parent in the parent data structure") Reported-by: Alexander Egorenkov Signed-off-by: Eric Farman Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Reviewed-by: Tony Krowiak Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230626133642.2939168-1-farman@linux.ibm.com Signed-off-by: Alex Williamson commit b19edac5992da0188be98454ca592621d3d89844 Merge: af96134dc8562 dd58d666ac08e Author: Linus Torvalds Date: Tue Jun 27 10:56:41 2023 -0700 Merge tag 'nolibc.2023.06.22a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull nolibc updates from Paul McKenney: - Add stackprotector support - Fix RISC-V load-store instruction syntax to support 32-bit binaries, plus fixes for generic 32-bit support - Fix use of s390 sys_fork() - Add my_syscall6() for ARM - Support different platforms having different errno definitions - Fix ppoll/ppoll_time64 arguments (add the fifth argument) - Force use of little endian on MIPS - Improved testing, for example, better handling of different compilers and compiler versions, comparing nolibc behavior to that of libc, and additional test cases - Improve syntax and header ordering - Use existing instead of redefining constants - Add syscall() * tag 'nolibc.2023.06.22a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (53 commits) selftests/nolibc: make sure gcc always use little endian on MIPS selftests/nolibc: also count skipped and failed tests in output selftests/nolibc: add new gettimeofday test cases selftests/nolibc: remove gettimeofday_bad1/2 completely selftests/nolibc: support two errnos with EXPECT_SYSER2() tools/nolibc: open: fix up compile warning for arm tools/nolibc: arm: add missing my_syscall6 selftests/nolibc: use INT_MAX instead of __INT_MAX__ selftests/nolibc: not include limits.h for nolibc selftests/nolibc: fix up compile warning with glibc on x86_64 selftests/nolibc: allow specify extra arguments for qemu selftests/nolibc: remove test gettimeofday_null tools/nolibc: ensure fast64 integer types have 64 bits selftests/nolibc: test_fork: fix up duplicated print tools/nolibc: ppoll/ppoll_time64: add a missing argument selftests/nolibc: remove the duplicated gettimeofday_bad2 selftests/nolibc: print name instead of number for EOVERFLOW tools/nolibc: support nanoseconds in stat() selftests/nolibc: prevent coredumps during test execution tools/nolibc: add support for prctl() ... commit ae230642190a51b85656d6da2df744d534d59544 Merge: 30ac666a2fcca a9c49cc2f5b57 Author: Jakub Kicinski Date: Tue Jun 27 10:50:24 2023 -0700 Merge branch 'af_unix-followup-fixes-for-so_passpidfd' Kuniyuki Iwashima says: ==================== af_unix: Followup fixes for SO_PASSPIDFD. This series fixes 2 issues introduced by commit 5e2ff6704a27 ("scm: add SO_PASSPIDFD and SCM_PIDFD"). The 1st patch fixes a warning in scm_pidfd_recv() reported by syzkaller. The 2nd patch fixes a regression that bluetooth can't be built as module. ==================== Link: https://lore.kernel.org/r/20230627174314.67688-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit a9c49cc2f5b578c4ffa0ee135aa552d06dec0e82 Author: Alexander Mikhalitsyn Date: Tue Jun 27 10:43:14 2023 -0700 net: scm: introduce and use scm_recv_unix helper Recently, our friends from bluetooth subsystem reported [1] that after commit 5e2ff6704a27 ("scm: add SO_PASSPIDFD and SCM_PIDFD") scm_recv() helper become unusable in kernel modules (because it uses unexported pidfd_prepare() API). We were aware of this issue and workarounded it in a hard way by commit 97154bcf4d1b ("af_unix: Kconfig: make CONFIG_UNIX bool"). But recently a new functionality was added in the scope of commit 817efd3cad74 ("Bluetooth: hci_sock: Forward credentials to monitor") and after that bluetooth can't be compiled as a kernel module. After some discussion in [1] we decided to split scm_recv() into two helpers, one won't support SCM_PIDFD (used for unix sockets), and another one will be completely the same as it was before commit 5e2ff6704a27 ("scm: add SO_PASSPIDFD and SCM_PIDFD"). Link: https://lore.kernel.org/lkml/CAJqdLrpFcga4n7wxBhsFqPQiN8PKFVr6U10fKcJ9W7AcZn+o6Q@mail.gmail.com/ [1] Fixes: 5e2ff6704a27 ("scm: add SO_PASSPIDFD and SCM_PIDFD") Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230627174314.67688-3-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit 603fc57ab70c306fa483ca66152223e861455e09 Author: Kuniyuki Iwashima Date: Tue Jun 27 10:43:13 2023 -0700 af_unix: Skip SCM_PIDFD if scm->pid is NULL. syzkaller hit a WARN_ON_ONCE(!scm->pid) in scm_pidfd_recv(). In unix_stream_read_generic(), if there is no skb in the queue, we could bail out the do-while loop without calling scm_set_cred(): 1. No skb in the queue 2. sk is non-blocking or shutdown(sk, RCV_SHUTDOWN) is called concurrently or peer calls close() If the socket is configured with SO_PASSPIDFD, scm_pidfd_recv() would populate cmsg with garbage emitting the warning. Let's skip SCM_PIDFD if scm->pid is NULL in scm_pidfd_recv(). Note another way would be skip calling scm_recv() in such cases, but this caused a regression resulting in commit 9d797ee2dce1 ("Revert "af_unix: Call scm_recv() only after scm_set_cred().""). WARNING: CPU: 1 PID: 3245 at include/net/scm.h:138 scm_pidfd_recv include/net/scm.h:138 [inline] WARNING: CPU: 1 PID: 3245 at include/net/scm.h:138 scm_recv.constprop.0+0x754/0x850 include/net/scm.h:177 Modules linked in: CPU: 1 PID: 3245 Comm: syz-executor.1 Not tainted 6.4.0-rc5-01219-gfa0e21fa4443 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 RIP: 0010:scm_pidfd_recv include/net/scm.h:138 [inline] RIP: 0010:scm_recv.constprop.0+0x754/0x850 include/net/scm.h:177 Code: 67 fd e9 55 fd ff ff e8 4a 70 67 fd e9 7f fd ff ff e8 40 70 67 fd e9 3e fb ff ff e8 36 70 67 fd e9 02 fd ff ff e8 8c 3a 20 fd <0f> 0b e9 fe fb ff ff e8 50 70 67 fd e9 2e f9 ff ff e8 46 70 67 fd RSP: 0018:ffffc90009af7660 EFLAGS: 00010216 RAX: 00000000000000a1 RBX: ffff888041e58a80 RCX: ffffc90003852000 RDX: 0000000000040000 RSI: ffffffff842675b4 RDI: 0000000000000007 RBP: ffffc90009af7810 R08: 0000000000000007 R09: 0000000000000013 R10: 00000000000000f8 R11: 0000000000000001 R12: ffffc90009af7db0 R13: 0000000000000000 R14: ffff888041e58a88 R15: 1ffff9200135eecc FS: 00007f6b7113f640(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6b7111de38 CR3: 0000000012a6e002 CR4: 0000000000770ee0 PKRU: 55555554 Call Trace: unix_stream_read_generic+0x5fe/0x1f50 net/unix/af_unix.c:2830 unix_stream_recvmsg+0x194/0x1c0 net/unix/af_unix.c:2880 sock_recvmsg_nosec net/socket.c:1019 [inline] sock_recvmsg+0x188/0x1d0 net/socket.c:1040 ____sys_recvmsg+0x210/0x610 net/socket.c:2712 ___sys_recvmsg+0xff/0x190 net/socket.c:2754 do_recvmmsg+0x25d/0x6c0 net/socket.c:2848 __sys_recvmmsg net/socket.c:2927 [inline] __do_sys_recvmmsg net/socket.c:2950 [inline] __se_sys_recvmmsg net/socket.c:2943 [inline] __x64_sys_recvmmsg+0x224/0x290 net/socket.c:2943 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f6b71da2e5d Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 73 9f 1b 00 f7 d8 64 89 01 48 RSP: 002b:00007f6b7113ecc8 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: ffffffffffffffda RBX: 00000000004bc050 RCX: 00007f6b71da2e5d RDX: 0000000000000007 RSI: 0000000020006600 RDI: 000000000000000b RBP: 00000000004bc050 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000120 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f6b71e03530 R15: 0000000000000000 Fixes: 5e2ff6704a27 ("scm: add SO_PASSPIDFD and SCM_PIDFD") Reported-by: syzkaller Signed-off-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230627174314.67688-2-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit af96134dc8562f9fcbb8358af36f6086619a29ab Merge: 1ef6663a587ba 2e31da752c6d0 Author: Linus Torvalds Date: Tue Jun 27 10:37:01 2023 -0700 Merge tag 'rcu.2023.06.22a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull RCU updates from Paul McKenney: "Documentation updates Miscellaneous fixes, perhaps most notably: - Remove RCU_NONIDLE(). The new visibility of most of the idle loop to RCU has obsoleted this API. - Make the RCU_SOFTIRQ callback-invocation time limit also apply to the rcuc kthreads that invoke callbacks for CONFIG_PREEMPT_RT. - Add a jiffies-based callback-invocation time limit to handle long-running callbacks. (The local_clock() function is only invoked once per 32 callbacks due to its high overhead.) - Stop rcu_tasks_invoke_cbs() from using never-onlined CPUs, which fixes a bug that can occur on systems with non-contiguous CPU numbering. kvfree_rcu updates: - Eliminate the single-argument variant of k[v]free_rcu() now that all uses have been converted to k[v]free_rcu_mightsleep(). - Add WARN_ON_ONCE() checks for k[v]free_rcu*() freeing callbacks too soon. Yes, this is closing the barn door after the horse has escaped, but Murphy says that there will be more horses. Callback-offloading updates: - Fix a number of bugs involving the shrinker and lazy callbacks. Tasks RCU updates Torture-test updates" * tag 'rcu.2023.06.22a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (32 commits) torture: Remove duplicated argument -enable-kvm for ppc64 doc/rcutorture: Add description of rcutorture.stall_cpu_block rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale rcu/rcuscale: Move rcu_scale_*() after kfree_scale_cleanup() rcutorture: Correct name of use_softirq module parameter locktorture: Add long_hold to adjust lock-hold delays rcu/nocb: Make shrinker iterate only over NOCB CPUs rcu-tasks: Stop rcu_tasks_invoke_cbs() from using never-onlined CPUs rcu: Make rcu_cpu_starting() rely on interrupts being disabled rcu: Mark rcu_cpu_kthread() accesses to ->rcu_cpu_has_work rcu: Mark additional concurrent load from ->cpu_no_qs.b.exp rcu: Employ jiffies-based backstop to callback time limit rcu: Check callback-invocation time limit for rcuc kthreads rcu: Remove RCU_NONIDLE() rcu: Add more RCU files to kernel-api.rst rcu-tasks: Clarify the cblist_init_generic() function's pr_info() output rcu-tasks: Avoid pr_info() with spin lock in cblist_init_generic() rcu/nocb: Recheck lazy callbacks under the ->nocb_lock from shrinker rcu/nocb: Fix shrinker race against callback enqueuer rcu/nocb: Protect lazy shrinker against concurrent (de-)offloading ... commit 5f004bcaee4cb552cf1b46a505f18f08777db7e5 Merge: 4251f631fdfba 6995e2de6891c Author: Jason Gunthorpe Date: Tue Jun 27 14:06:29 2023 -0300 Merge tag 'v6.4' into rdma.git for-next Linux 6.4 Resolve conflicts between rdma rc and next in rxe_cq matching linux-next: drivers/infiniband/sw/rxe/rxe_cq.c: https://lore.kernel.org/r/20230622115246.365d30ad@canb.auug.org.au Signed-off-by: Jason Gunthorpe commit 4251f631fdfba0b38e4634510c5950ee157cc069 Author: Dan Carpenter Date: Tue Jun 27 10:20:13 2023 +0300 RDMA/bnxt_re: Fix an IS_ERR() vs NULL check The bnxt_re_mmap_entry_insert() function returns NULL, not error pointers. Update the check for errors accordingly. Fixes: 360da60d6c6e ("RDMA/bnxt_re: Enable low latency push") Link: https://lore.kernel.org/r/8d92e85f-626b-4eca-8501-ca7024cfc0ee@moroto.mountain Signed-off-by: Dan Carpenter Acked-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 30ac666a2fccaa8c164199ea8844dc28aa714453 Author: Moritz Fischer Date: Tue Jun 27 03:54:32 2023 +0000 net: lan743x: Simplify comparison Simplify comparison, no functional changes. Cc: Bryan Whitehead Cc: UNGLinuxDriver@microchip.com Suggested-by: Jakub Kicinski Signed-off-by: Moritz Fischer Link: https://lore.kernel.org/r/20230627035432.1296760-1-moritzf@google.com Signed-off-by: Jakub Kicinski commit 3674fbf0451df0395f9fa18df3122927006a3829 Merge: 9d797ee2dce1e 25a9c8a4431c3 Author: Jakub Kicinski Date: Tue Jun 27 09:45:22 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Merge in late fixes to prepare for the 6.5 net-next PR. Signed-off-by: Jakub Kicinski commit a425ac5365f6cb3cc47bf83e6bff0213c10445f7 Author: Linus Torvalds Date: Sun Jun 25 14:02:25 2023 -0700 gup: add warning if some caller would seem to want stack expansion It feels very unlikely that anybody would want to do a GUP in an unmapped area under the stack pointer, but real users sometimes do some really strange things. So add a (temporary) warning for the case where a GUP fails and expanding the stack might have made it work. It's trivial to do the expansion in the caller as part of getting the mm lock in the first place - see __access_remote_vm() for ptrace, for example - it's just that it's unnecessarily painful to do it deep in the guts of the GUP lookup when we might have to drop and re-take the lock. I doubt anybody actually does anything quite this strange, but let's be proactive: adding these warnings is simple, and will make debugging it much easier if they trigger. Signed-off-by: Linus Torvalds commit 8d7071af890768438c14db6172cc8f9f4d04e184 Author: Linus Torvalds Date: Sat Jun 24 13:45:51 2023 -0700 mm: always expand the stack with the mmap write lock held This finishes the job of always holding the mmap write lock when extending the user stack vma, and removes the 'write_locked' argument from the vm helper functions again. For some cases, we just avoid expanding the stack at all: drivers and page pinning really shouldn't be extending any stacks. Let's see if any strange users really wanted that. It's worth noting that architectures that weren't converted to the new lock_mm_and_find_vma() helper function are left using the legacy "expand_stack()" function, but it has been changed to drop the mmap_lock and take it for writing while expanding the vma. This makes it fairly straightforward to convert the remaining architectures. As a result of dropping and re-taking the lock, the calling conventions for this function have also changed, since the old vma may no longer be valid. So it will now return the new vma if successful, and NULL - and the lock dropped - if the area could not be extended. Tested-by: Vegard Nossum Tested-by: John Paul Adrian Glaubitz # ia64 Tested-by: Frank Scheiner # ia64 Signed-off-by: Linus Torvalds commit 25a9c8a4431c364f97f75558cb346d2ad3f53fbb Author: Kuniyuki Iwashima Date: Mon Jun 26 09:43:13 2023 -0700 netlink: Add __sock_i_ino() for __netlink_diag_dump(). syzbot reported a warning in __local_bh_enable_ip(). [0] Commit 8d61f926d420 ("netlink: fix potential deadlock in netlink_set_err()") converted read_lock(&nl_table_lock) to read_lock_irqsave() in __netlink_diag_dump() to prevent a deadlock. However, __netlink_diag_dump() calls sock_i_ino() that uses read_lock_bh() and read_unlock_bh(). If CONFIG_TRACE_IRQFLAGS=y, read_unlock_bh() finally enables IRQ even though it should stay disabled until the following read_unlock_irqrestore(). Using read_lock() in sock_i_ino() would trigger a lockdep splat in another place that was fixed in commit f064af1e500a ("net: fix a lockdep splat"), so let's add __sock_i_ino() that would be safe to use under BH disabled. [0]: WARNING: CPU: 0 PID: 5012 at kernel/softirq.c:376 __local_bh_enable_ip+0xbe/0x130 kernel/softirq.c:376 Modules linked in: CPU: 0 PID: 5012 Comm: syz-executor487 Not tainted 6.4.0-rc7-syzkaller-00202-g6f68fc395f49 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 RIP: 0010:__local_bh_enable_ip+0xbe/0x130 kernel/softirq.c:376 Code: 45 bf 01 00 00 00 e8 91 5b 0a 00 e8 3c 15 3d 00 fb 65 8b 05 ec e9 b5 7e 85 c0 74 58 5b 5d c3 65 8b 05 b2 b6 b4 7e 85 c0 75 a2 <0f> 0b eb 9e e8 89 15 3d 00 eb 9f 48 89 ef e8 6f 49 18 00 eb a8 0f RSP: 0018:ffffc90003a1f3d0 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 0000000000000201 RCX: 1ffffffff1cf5996 RDX: 0000000000000000 RSI: 0000000000000201 RDI: ffffffff8805c6f3 RBP: ffffffff8805c6f3 R08: 0000000000000001 R09: ffff8880152b03a3 R10: ffffed1002a56074 R11: 0000000000000005 R12: 00000000000073e4 R13: dffffc0000000000 R14: 0000000000000002 R15: 0000000000000000 FS: 0000555556726300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000045ad50 CR3: 000000007c646000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: sock_i_ino+0x83/0xa0 net/core/sock.c:2559 __netlink_diag_dump+0x45c/0x790 net/netlink/diag.c:171 netlink_diag_dump+0xd6/0x230 net/netlink/diag.c:207 netlink_dump+0x570/0xc50 net/netlink/af_netlink.c:2269 __netlink_dump_start+0x64b/0x910 net/netlink/af_netlink.c:2374 netlink_dump_start include/linux/netlink.h:329 [inline] netlink_diag_handler_dump+0x1ae/0x250 net/netlink/diag.c:238 __sock_diag_cmd net/core/sock_diag.c:238 [inline] sock_diag_rcv_msg+0x31e/0x440 net/core/sock_diag.c:269 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2547 sock_diag_rcv+0x2a/0x40 net/core/sock_diag.c:280 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1914 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 ____sys_sendmsg+0x71c/0x900 net/socket.c:2503 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2557 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2586 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f5303aaabb9 Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc7506e548 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5303aaabb9 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 00007f5303a6ed60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f5303a6edf0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Fixes: 8d61f926d420 ("netlink: fix potential deadlock in netlink_set_err()") Reported-by: syzbot+5da61cf6a9bc1902d422@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=5da61cf6a9bc1902d422 Suggested-by: Eric Dumazet Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20230626164313.52528-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit d06f925f13976ab82167c93467c70a337a0a3cda Author: Vladimir Oltean Date: Mon Jun 26 18:44:02 2023 +0300 net: dsa: avoid suspicious RCU usage for synced VLAN-aware MAC addresses When using the felix driver (the only one which supports UC filtering and MC filtering) as a DSA master for a random other DSA switch, one can see the following stack trace when the downstream switch ports join a VLAN-aware bridge: ============================= WARNING: suspicious RCU usage ----------------------------- net/8021q/vlan_core.c:238 suspicious rcu_dereference_protected() usage! stack backtrace: Workqueue: dsa_ordered dsa_slave_switchdev_event_work Call trace: lockdep_rcu_suspicious+0x170/0x210 vlan_for_each+0x8c/0x188 dsa_slave_sync_uc+0x128/0x178 __hw_addr_sync_dev+0x138/0x158 dsa_slave_set_rx_mode+0x58/0x70 __dev_set_rx_mode+0x88/0xa8 dev_uc_add+0x74/0xa0 dsa_port_bridge_host_fdb_add+0xec/0x180 dsa_slave_switchdev_event_work+0x7c/0x1c8 process_one_work+0x290/0x568 What it's saying is that vlan_for_each() expects rtnl_lock() context and it's not getting it, when it's called from the DSA master's ndo_set_rx_mode(). The caller of that - dsa_slave_set_rx_mode() - is the slave DSA interface's dsa_port_bridge_host_fdb_add() which comes from the deferred dsa_slave_switchdev_event_work(). We went to great lengths to avoid the rtnl_lock() context in that call path in commit 0faf890fc519 ("net: dsa: drop rtnl_lock from dsa_slave_switchdev_event_work"), and calling rtnl_lock() is simply not an option due to the possibility of deadlocking when calling dsa_flush_workqueue() from the call paths that do hold rtnl_lock() - basically all of them. So, when the DSA master calls vlan_for_each() from its ndo_set_rx_mode(), the state of the 8021q driver on this device is really not protected from concurrent access by anything. Looking at net/8021q/, I don't think that vlan_info->vid_list was particularly designed with RCU traversal in mind, so introducing an RCU read-side form of vlan_for_each() - vlan_for_each_rcu() - won't be so easy, and it also wouldn't be exactly what we need anyway. In general I believe that the solution isn't in net/8021q/ anyway; vlan_for_each() is not cut out for this task. DSA doesn't need rtnl_lock() to be held per se - since it's not a netdev state change that we're blocking, but rather, just concurrent additions/removals to a VLAN list. We don't even need sleepable context - the callback of vlan_for_each() just schedules deferred work. The proposed escape is to remove the dependency on vlan_for_each() and to open-code a non-sleepable, rtnl-free alternative to that, based on copies of the VLAN list modified from .ndo_vlan_rx_add_vid() and .ndo_vlan_rx_kill_vid(). Fixes: 64fdc5f341db ("net: dsa: sync unicast and multicast addresses for VLAN filters too") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20230626154402.3154454-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 9d797ee2dce1e3e243bcc18dad7728df72fd11a4 Author: Kuniyuki Iwashima Date: Mon Jun 26 13:58:37 2023 -0700 Revert "af_unix: Call scm_recv() only after scm_set_cred()." This reverts commit 3f5f118bb657f94641ea383c7c1b8c09a5d46ea2. Konrad reported that desktop environment below cannot be reached after commit 3f5f118bb657 ("af_unix: Call scm_recv() only after scm_set_cred().") - postmarketOS (Alpine Linux w/ musl 1.2.4) - busybox 1.36.1 - GNOME 44.1 - networkmanager 1.42.6 - openrc 0.47 Regarding to the warning of SO_PASSPIDFD, I'll post another patch to suppress it by skipping SCM_PIDFD if scm->pid == NULL in scm_pidfd_recv(). Reported-by: Konrad Dybcio Link: https://lore.kernel.org/netdev/8c7f9abd-4f84-7296-2788-1e130d6304a0@kernel.org/ Signed-off-by: Kuniyuki Iwashima Tested-by: Ido Schimmel Tested-by: Gal Pressman Link: https://lore.kernel.org/r/20230626205837.82086-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit 5fc10e76fa2a96d0207ed4d0cc9d16fb61371f71 Author: Masahiro Yamada Date: Tue Jun 27 08:30:13 2023 +0900 kbuild: revive "Entering directory" for Make >= 4.4.1 With commit 9da0763bdd82 ("kbuild: Use relative path when building in a subdir of the source tree"), compiler messages in out-of-tree builds include relative paths, which are relative to the build directory, not the directory where make was started. To help IDEs/editors find the source files, Kbuild lets GNU Make print "Entering directory ..." when it changes the working directory. It has been working fine for a long time, but David reported it is broken with the latest GNU Make. The behavior was changed by GNU Make commit 8f9e7722ff0f ("[SV 63537] Fix setting -w in makefiles"). Previously, setting --no-print-directory to MAKEFLAGS only affected child makes, but it is now interpreted in the current make as soon as it is set. [test code] $ cat /tmp/Makefile ifneq ($(SUBMAKE),1) MAKEFLAGS += --no-print-directory all: ; $(MAKE) SUBMAKE=1 else all: ; : endif [before 8f9e7722ff0f] $ make -C /tmp make: Entering directory '/tmp' make SUBMAKE=1 : make: Leaving directory '/tmp' [after 8f9e7722ff0f] $ make -C /tmp make SUBMAKE=1 : Previously, the effect of --no-print-directory was delayed until Kbuild started the directory descending, but it is no longer true with GNU Make 4.4.1. This commit adds one more recursion to cater to GNU Make >= 4.4.1. When Kbuild needs to change the working directory, __submake will be executed twice. __submake without --no-print-directory --> show "Entering directory ..." __submake with --no-print-directory --> parse the rest of Makefile We end up with one more recursion than needed for GNU Make < 4.4.1, but I do not want to complicate the version check. Reported-by: David Howells Closes: https://lore.kernel.org/all/2427604.1686237298@warthog.procyon.org.uk/ Signed-off-by: Masahiro Yamada Tested-by: Nicolas Schier commit 5fa94ceb793e93870541dc5a1235aec87b0871bc Author: Masahiro Yamada Date: Tue Jun 27 08:30:12 2023 +0900 kbuild: set correct abs_srctree and abs_objtree for package builds When you run 'make rpm-pkg', the rpmbuild tool builds the kernel in rpmbuild/BUILD, but $(abs_srctree) and $(abs_objtree) point to the directory path where make was started, not the kernel is actually being built. The same applies to 'make snap-pkg'. Fix it. Signed-off-by: Masahiro Yamada commit 1a3f6fc430ed220889c7fb1a63bc2a30267ebc2a Author: Jakub Kicinski Date: Mon Jun 26 14:46:40 2023 -0700 phylink: ReST-ify the phylink_pcs_neg_mode() kdoc Stephen reports warnings when rendering phylink kdocs as HTML: include/linux/phylink.h:110: ERROR: Unexpected indentation. include/linux/phylink.h:111: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/phylink.h:614: WARNING: Inline literal start-string without end-string. include/linux/phylink.h:644: WARNING: Inline literal start-string without end-string. Make phylink_pcs_neg_mode() use a proper list format to fix the first two warnings. The last two warnings, AFAICT, come from the use of shorthand like phylink_mode_*(). Perhaps those should be special-cased at the Sphinx level. Reported-by: Stephen Rothwell Link: https://lore.kernel.org/all/20230626162908.2f149f98@canb.auug.org.au/ Link: https://lore.kernel.org/r/20230626214640.3142252-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 5da4d7b8e6dfd5bd7d61f7fe1338b1e5d5b4f76c Author: David Howells Date: Tue Jun 27 14:49:48 2023 +0100 libceph: Partially revert changes to support MSG_SPLICE_PAGES Fix the mishandling of MSG_DONTWAIT and also reinstates the per-page checking of the source pages (which might have come from a DIO write by userspace) by partially reverting the changes to support MSG_SPLICE_PAGES and doing things a little differently. In messenger_v1: (1) The ceph_tcp_sendpage() is resurrected and the callers reverted to use that. (2) The callers now pass MSG_MORE unconditionally. Previously, they were passing in MSG_MORE|MSG_SENDPAGE_NOTLAST and then degrading that to just MSG_MORE on the last call to ->sendpage(). (3) Make ceph_tcp_sendpage() a wrapper around sendmsg() rather than sendpage(), setting MSG_SPLICE_PAGES if sendpage_ok() returns true on the page. In messenger_v2: (4) Bring back do_try_sendpage() and make the callers use that. (5) Make do_try_sendpage() use sendmsg() for both cases and set MSG_SPLICE_PAGES if sendpage_ok() is set. Fixes: 40a8c17aa770 ("ceph: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage") Fixes: fa094ccae1e7 ("ceph: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage()") Reported-by: Ilya Dryomov Link: https://lore.kernel.org/r/CAOi1vP9vjLfk3W+AJFeexC93jqPaPUn2dD_4NrzxwoZTbYfOnw@mail.gmail.com/ Link: https://lore.kernel.org/r/CAOi1vP_Bn918j24S94MuGyn+Gxk212btw7yWeDrRcW1U8pc_BA@mail.gmail.com/ Signed-off-by: David Howells cc: Xiubo Li cc: Jeff Layton cc: Jens Axboe cc: Matthew Wilcox Link: https://lore.kernel.org/r/3101881.1687801973@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/3111635.1687813501@warthog.procyon.org.uk/ # v2 Reviewed-by: Ilya Dryomov Link: https://lore.kernel.org/r/3199652.1687873788@warthog.procyon.org.uk Signed-off-by: Jakub Kicinski commit 528a08bcd820d07887edeae706df88ceb06db109 Author: Vladimir Oltean Date: Tue Jun 27 16:42:35 2023 +0300 net: phy: mscc: fix packet loss due to RGMII delays Two deadly typos break RX and TX traffic on the VSC8502 PHY using RGMII if phy-mode = "rgmii-id" or "rgmii-txid", and no "tx-internal-delay-ps" override exists. The negative error code from phy_get_internal_delay() does not get overridden with the delay deduced from the phy-mode, and later gets committed to hardware. Also, the rx_delay gets overridden by what should have been the tx_delay. Fixes: dbb050d2bfc8 ("phy: mscc: Add support for RGMII delay configuration") Signed-off-by: Vladimir Oltean Reviewed-by: Harini Katakam Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230627134235.3453358-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit d9b1a5a60ac33da3a2921c41ef26b84bfdf67044 Merge: 2553a5270d6c2 e9c74f8b8a31f Author: Jakub Kicinski Date: Tue Jun 27 09:28:25 2023 -0700 Merge branch 'use-vmalloc_array-and-vcalloc' Julia Lawall says: ==================== use vmalloc_array and vcalloc The functions vmalloc_array and vcalloc were introduced in commit a8749a35c399 ("mm: vmalloc: introduce array allocation functions") but are not used much yet. This series introduces uses of these functions, to protect against multiplication overflows. The changes were done using the following Coccinelle semantic patch. @initialize:ocaml@ @@ let rename alloc = match alloc with "vmalloc" -> "vmalloc_array" | "vzalloc" -> "vcalloc" | _ -> failwith "unknown" @@ size_t e1,e2; constant C1, C2; expression E1, E2, COUNT, x1, x2, x3; typedef u8; typedef __u8; type t = {u8,__u8,char,unsigned char}; identifier alloc = {vmalloc,vzalloc}; fresh identifier realloc = script:ocaml(alloc) { rename alloc }; @@ ( alloc(x1*x2*x3) | alloc(C1 * C2) | alloc((sizeof(t)) * (COUNT), ...) | - alloc((e1) * (e2)) + realloc(e1, e2) | - alloc((e1) * (COUNT)) + realloc(COUNT, e1) | - alloc((E1) * (E2)) + realloc(E1, E2) ) v2: This series uses vmalloc_array and vcalloc instead of array_size. It also leaves a multiplication of a constant by a sizeof as is. Two patches are thus dropped from the series. ==================== Link: https://lore.kernel.org/r/20230627144339.144478-1-Julia.Lawall@inria.fr Signed-off-by: Jakub Kicinski commit e9c74f8b8a31f77f8e9d7bbed5fc9f2eacbf32a5 Author: Julia Lawall Date: Tue Jun 27 16:43:37 2023 +0200 net: mana: use vmalloc_array and vcalloc Use vmalloc_array and vcalloc to protect against multiplication overflows. The changes were done using the following Coccinelle semantic patch: // @initialize:ocaml@ @@ let rename alloc = match alloc with "vmalloc" -> "vmalloc_array" | "vzalloc" -> "vcalloc" | _ -> failwith "unknown" @@ size_t e1,e2; constant C1, C2; expression E1, E2, COUNT, x1, x2, x3; typedef u8; typedef __u8; type t = {u8,__u8,char,unsigned char}; identifier alloc = {vmalloc,vzalloc}; fresh identifier realloc = script:ocaml(alloc) { rename alloc }; @@ ( alloc(x1*x2*x3) | alloc(C1 * C2) | alloc((sizeof(t)) * (COUNT), ...) | - alloc((e1) * (e2)) + realloc(e1, e2) | - alloc((e1) * (COUNT)) + realloc(COUNT, e1) | - alloc((E1) * (E2)) + realloc(E1, E2) ) // Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20230627144339.144478-23-Julia.Lawall@inria.fr Signed-off-by: Jakub Kicinski commit fa87c54693ae248db9ff867baa28b792db671b24 Author: Julia Lawall Date: Tue Jun 27 16:43:33 2023 +0200 net: enetc: use vmalloc_array and vcalloc Use vmalloc_array and vcalloc to protect against multiplication overflows. The changes were done using the following Coccinelle semantic patch: // @initialize:ocaml@ @@ let rename alloc = match alloc with "vmalloc" -> "vmalloc_array" | "vzalloc" -> "vcalloc" | _ -> failwith "unknown" @@ size_t e1,e2; constant C1, C2; expression E1, E2, COUNT, x1, x2, x3; typedef u8; typedef __u8; type t = {u8,__u8,char,unsigned char}; identifier alloc = {vmalloc,vzalloc}; fresh identifier realloc = script:ocaml(alloc) { rename alloc }; @@ ( alloc(x1*x2*x3) | alloc(C1 * C2) | alloc((sizeof(t)) * (COUNT), ...) | - alloc((e1) * (e2)) + realloc(e1, e2) | - alloc((e1) * (COUNT)) + realloc(COUNT, e1) | - alloc((E1) * (E2)) + realloc(E1, E2) ) // Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20230627144339.144478-19-Julia.Lawall@inria.fr Signed-off-by: Jakub Kicinski commit f712c8297e0a4dadc14ba2094c92e3e99a0ff871 Author: Julia Lawall Date: Tue Jun 27 16:43:26 2023 +0200 ionic: use vmalloc_array and vcalloc Use vmalloc_array and vcalloc to protect against multiplication overflows. The changes were done using the following Coccinelle semantic patch: // @initialize:ocaml@ @@ let rename alloc = match alloc with "vmalloc" -> "vmalloc_array" | "vzalloc" -> "vcalloc" | _ -> failwith "unknown" @@ size_t e1,e2; constant C1, C2; expression E1, E2, COUNT, x1, x2, x3; typedef u8; typedef __u8; type t = {u8,__u8,char,unsigned char}; identifier alloc = {vmalloc,vzalloc}; fresh identifier realloc = script:ocaml(alloc) { rename alloc }; @@ ( alloc(x1*x2*x3) | alloc(C1 * C2) | alloc((sizeof(t)) * (COUNT), ...) | - alloc((e1) * (e2)) + realloc(e1, e2) | - alloc((e1) * (COUNT)) + realloc(COUNT, e1) | - alloc((E1) * (E2)) + realloc(E1, E2) ) // Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20230627144339.144478-12-Julia.Lawall@inria.fr Signed-off-by: Jakub Kicinski commit 906a76cc764541bdb7f602a01e3b4cdd93dea96a Author: Julia Lawall Date: Tue Jun 27 16:43:24 2023 +0200 pds_core: use vmalloc_array and vcalloc Use vmalloc_array and vcalloc to protect against multiplication overflows. The changes were done using the following Coccinelle semantic patch: // @initialize:ocaml@ @@ let rename alloc = match alloc with "vmalloc" -> "vmalloc_array" | "vzalloc" -> "vcalloc" | _ -> failwith "unknown" @@ size_t e1,e2; constant C1, C2; expression E1, E2, COUNT, x1, x2, x3; typedef u8; typedef __u8; type t = {u8,__u8,char,unsigned char}; identifier alloc = {vmalloc,vzalloc}; fresh identifier realloc = script:ocaml(alloc) { rename alloc }; @@ ( alloc(x1*x2*x3) | alloc(C1 * C2) | alloc((sizeof(t)) * (COUNT), ...) | - alloc((e1) * (e2)) + realloc(e1, e2) | - alloc((e1) * (COUNT)) + realloc(COUNT, e1) | - alloc((E1) * (E2)) + realloc(E1, E2) ) // Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20230627144339.144478-10-Julia.Lawall@inria.fr Signed-off-by: Jakub Kicinski commit a13de901e8d590a7d26a6d4a1c4c7e9eebbb6ca6 Author: Julia Lawall Date: Tue Jun 27 16:43:19 2023 +0200 gve: use vmalloc_array and vcalloc Use vmalloc_array and vcalloc to protect against multiplication overflows. The changes were done using the following Coccinelle semantic patch: // @initialize:ocaml@ @@ let rename alloc = match alloc with "vmalloc" -> "vmalloc_array" | "vzalloc" -> "vcalloc" | _ -> failwith "unknown" @@ size_t e1,e2; constant C1, C2; expression E1, E2, COUNT, x1, x2, x3; typedef u8; typedef __u8; type t = {u8,__u8,char,unsigned char}; identifier alloc = {vmalloc,vzalloc}; fresh identifier realloc = script:ocaml(alloc) { rename alloc }; @@ ( alloc(x1*x2*x3) | alloc(C1 * C2) | alloc((sizeof(t)) * (COUNT), ...) | - alloc((e1) * (e2)) + realloc(e1, e2) | - alloc((e1) * (COUNT)) + realloc(COUNT, e1) | - alloc((E1) * (E2)) + realloc(E1, E2) ) // Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20230627144339.144478-5-Julia.Lawall@inria.fr Signed-off-by: Jakub Kicinski commit 32d462a5c3e5b312e7dcd886e20e71b0c33abf10 Author: Julia Lawall Date: Tue Jun 27 16:43:17 2023 +0200 octeon_ep: use vmalloc_array and vcalloc Use vmalloc_array and vcalloc to protect against multiplication overflows. The changes were done using the following Coccinelle semantic patch: // @initialize:ocaml@ @@ let rename alloc = match alloc with "vmalloc" -> "vmalloc_array" | "vzalloc" -> "vcalloc" | _ -> failwith "unknown" @@ size_t e1,e2; constant C1, C2; expression E1, E2, COUNT, x1, x2, x3; typedef u8; typedef __u8; type t = {u8,__u8,char,unsigned char}; identifier alloc = {vmalloc,vzalloc}; fresh identifier realloc = script:ocaml(alloc) { rename alloc }; @@ ( alloc(x1*x2*x3) | alloc(C1 * C2) | alloc((sizeof(t)) * (COUNT), ...) | - alloc((e1) * (e2)) + realloc(e1, e2) | - alloc((e1) * (COUNT)) + realloc(COUNT, e1) | - alloc((E1) * (E2)) + realloc(E1, E2) ) // Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20230627144339.144478-3-Julia.Lawall@inria.fr Signed-off-by: Jakub Kicinski commit d7dbed457c2ef83709a2a2723a2d58de43623449 Author: Tavian Barnes Date: Fri Jun 23 17:09:06 2023 -0400 nfsd: Fix creation time serialization order In nfsd4_encode_fattr(), TIME_CREATE was being written out after all other times. However, they should be written out in an order that matches the bit flags in bmval1, which in this case are #define FATTR4_WORD1_TIME_ACCESS (1UL << 15) #define FATTR4_WORD1_TIME_CREATE (1UL << 18) #define FATTR4_WORD1_TIME_DELTA (1UL << 19) #define FATTR4_WORD1_TIME_METADATA (1UL << 20) #define FATTR4_WORD1_TIME_MODIFY (1UL << 21) so TIME_CREATE should come second. I noticed this on a FreeBSD NFSv4.2 client, which supports creation times. On this client, file times were weirdly permuted. With this patch applied on the server, times looked normal on the client. Fixes: e377a3e698fb ("nfsd: Add support for the birth time attribute") Link: https://unix.stackexchange.com/q/749605/56202 Signed-off-by: Tavian Barnes Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 99160af413b4ff1c3b4741e8a7583f8e7197f201 Author: Sagi Grimberg Date: Tue Jun 20 16:07:36 2023 +0300 nvme-mpath: fix I/O failure with EAGAIN when failing over I/O It is possible that the next available path we failover to, happens to be frozen (for example if it is during connection establishment). If the original I/O was set with NOWAIT, this cause the I/O to unnecessarily fail because the request queue cannot be entered, hence the I/O fails with EAGAIN. The NOWAIT restriction that was originally set for the I/O is no longer relevant or needed because this is the nvme requeue context. Hence we clear the REQ_NOWAIT flag when failing over I/O. This fix a simple test case of nvme controller reset during I/O when the multipath device that has only a single path and I/O fails with "Resource temporarily unavailable" errno. Note that this reproduces with io_uring which by default sets IOCB_NOWAIT by default. Signed-off-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 86da1bae4c64ab3dcbdda0c77ce37c9bf47a501f Author: Damien Le Moal Date: Thu Jun 22 16:53:07 2023 +0900 nvme: host: fix command name spelling Correctly spell "Zeroes" in nvme_cmd_write_zeroes command name. Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Signed-off-by: Keith Busch commit b5539eb5ee70257520e40bb636a295217c329a50 Author: Rafael J. Wysocki Date: Tue Jun 27 16:35:52 2023 +0200 ACPI: EC: Fix acpi_ec_dispatch_gpe() Commit 896e97bf99ec ("ACPI: EC: Clear GPE on interrupt handling only") broke suspend-to-idle at least on Dell XPS13 9360 and 9380. The problem is that acpi_ec_dispatch_gpe() must clear the EC GPE, because the EC GPE handler never runs when the system is in the suspend-to-idle state and if the EC GPE is not cleared by the suspend- to-idle loop, it is never cleared at all which leads to a GPE storm. This causes suspend-to-idle to burn energy instead of saving it which is potentially dangerous (the affected machines heat up rather badly when that happens). Addess this by making acpi_ec_dispatch_gpe() clear the EC GPE as it did before. Fixes: 896e97bf99ec ("ACPI: EC: Clear GPE on interrupt handling only") Tested-by: Rafael J. Wysocki Signed-off-by: Rafael J. Wysocki commit bc9a2b3e686e32ebd764d92e66e21c01e23ffb16 Author: Eli Cohen Date: Wed Jun 7 22:00:06 2023 +0300 vdpa/mlx5: Support interrupt bypassing Add support for generation of interrupts from the device directly to the VM to the VCPU thus avoiding the overhead on the host CPU. When supported, the driver will attempt to allocate vectors for each data virtqueue. If a vector for a virtqueue cannot be provided it will use the QP mode where notifications go through the driver. In addition, we add a shutdown callback to make sure allocated interrupts are released in case of shutdown to allow clean shutdown. Signed-off-by: Eli Cohen Signed-off-by: Saeed Mahameed Message-Id: <20230607190007.290505-1-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin commit 33bd91fd24367ad664de6c05d0e0206d0b149767 Author: Simon Horman Date: Thu May 25 16:35:42 2023 +0200 virtio: Add missing documentation for structure fields Add missing documentation for the vqs_list_lock field of struct virtio_device, and the validate field of struct virtio_driver. ./scripts/kernel-doc says: .../virtio.h:131: warning: Function parameter or member 'vqs_list_lock' not described in 'virtio_device' .../virtio.h:192: warning: Function parameter or member 'validate' not described in 'virtio_driver' 2 warnings as Errors No functional changes intended. Signed-off-by: Simon Horman Message-Id: <20230510-virtio-kdoc-v3-1-e2681ed7a425@kernel.org> Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella commit 9a8864d2a8dc5c49acd66284fd382871d99b5db8 Author: Shannon Nelson Date: Fri May 19 14:56:32 2023 -0700 pds_vdpa: pds_vdps.rst and Kconfig Add the documentation and Kconfig entry for pds_vdpa driver. Signed-off-by: Shannon Nelson Acked-by: Jason Wang Message-Id: <20230519215632.12343-12-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin commit 67f27b8b3a342b988b97b2a4b81e9e894eb502ba Author: Shannon Nelson Date: Fri May 19 14:56:31 2023 -0700 pds_vdpa: subscribe to the pds_core events Register for the pds_core's notification events, primarily to find out when the FW has been reset so we can pass this on back up the chain. Signed-off-by: Shannon Nelson Acked-by: Jason Wang Message-Id: <20230519215632.12343-11-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin commit 151cc834f3ddafec869269fe48036460d920d08a Author: Shannon Nelson Date: Fri May 19 14:56:30 2023 -0700 pds_vdpa: add support for vdpa and vdpamgmt interfaces This is the vDPA device support, where we advertise that we can support the virtio queues and deal with the configuration work through the pds_core's adminq. Signed-off-by: Shannon Nelson Message-Id: <20230519215632.12343-10-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit c16d5a412ed4e0e6e0b02f69c2c65187869659f2 Author: Shannon Nelson Date: Fri May 19 14:56:29 2023 -0700 pds_vdpa: add vdpa config client commands These are the adminq commands that will be needed for setting up and using the vDPA device. There are a number of commands defined in the FW's API, but by making use of the FW's virtio BAR we only need a few of these commands for vDPA support. Signed-off-by: Shannon Nelson Acked-by: Jason Wang Message-Id: <20230519215632.12343-9-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin commit 94591894df81ce443b0696440b9198fda6615c45 Author: Shannon Nelson Date: Fri May 19 14:56:28 2023 -0700 pds_vdpa: virtio bar setup for vdpa Prep and use the "modern" virtio bar utilities to get our virtio config space ready. Signed-off-by: Shannon Nelson Acked-by: Jason Wang Message-Id: <20230519215632.12343-8-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin commit 25d1270b6e9ea893c2fe19a4bd52ebfde22812f4 Author: Shannon Nelson Date: Fri May 19 14:56:27 2023 -0700 pds_vdpa: get vdpa management info Find the vDPA management information from the DSC in order to advertise it to the vdpa subsystem. Signed-off-by: Shannon Nelson Acked-by: Jason Wang Message-Id: <20230519215632.12343-7-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin commit e0c6de13ff87b917407e8c817c1007c3dc7ece6f Author: Shannon Nelson Date: Fri May 19 14:56:26 2023 -0700 pds_vdpa: new adminq entries Add new adminq definitions in support for vDPA operations. Signed-off-by: Shannon Nelson Acked-by: Jason Wang Message-Id: <20230519215632.12343-6-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin commit a8492cd8cde0906b93c819992d50ac6d79a5cad1 Author: Shannon Nelson Date: Fri May 19 14:56:25 2023 -0700 pds_vdpa: move enum from common to adminq header The pds_core_logical_qtype enum and IFNAMSIZ are not needed in the common PDS header, only needed when working with the adminq, so move them to the adminq header. Note: This patch might conflict with pds_vfio patches that are in review, depending on which patchset gets pulled first. Signed-off-by: Shannon Nelson Acked-by: Jason Wang Message-Id: <20230519215632.12343-5-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin commit a16291b5bcbbd75586c8396555a0ee9fd4183372 Author: Shannon Nelson Date: Fri May 19 14:56:24 2023 -0700 pds_vdpa: Add new vDPA driver for AMD/Pensando DSC This is the initial auxiliary driver framework for a new vDPA device driver, an auxiliary_bus client of the pds_core driver. The pds_core driver supplies the PCI services for the VF device and for accessing the adminq in the PF device. This patch adds the very basics of registering for the auxiliary device and setting up debugfs entries. Signed-off-by: Shannon Nelson Acked-by: Jason Wang Message-Id: <20230519215632.12343-4-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin commit 5d7d82d39eb4cab2c7d0d85baaee0fc45d2c7900 Author: Shannon Nelson Date: Fri May 19 14:56:23 2023 -0700 virtio: allow caller to override device DMA mask in vp_modern To add a bit of vendor flexibility with various virtio based devices, allow the caller to specify a different DMA mask. This adds a dma_mask field to struct virtio_pci_modern_device. If defined by the driver, this mask will be used in a call to dma_set_mask_and_coherent() instead of the traditional DMA_BIT_MASK(64). This allows limiting the DMA space on vendor devices with address limitations. Signed-off-by: Shannon Nelson Acked-by: Jason Wang Message-Id: <20230519215632.12343-3-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin commit a37c0191acbd58efab4da43372585207f30e3102 Author: Shannon Nelson Date: Fri May 19 14:56:22 2023 -0700 virtio: allow caller to override device id in vp_modern To add a bit of vendor flexibility with various virtio based devices, allow the caller to check for a different device id. This adds a function pointer field to struct virtio_pci_modern_device to specify an override device id check. If defined by the driver, this function will be called to check that the PCI device is the vendor's expected device, and will return the found device id to be stored in mdev->id.device. This allows vendors with alternative vendor device ids to use this library on their own device BAR. Note: A lot of the diff in this is simply indenting the existing code into an else block. Signed-off-by: Shannon Nelson Acked-by: Jason Wang Message-Id: <20230519215632.12343-2-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin commit 4f0fc22534e3d81ebd470e899fed3c0dbb4aeb56 Author: Feng Liu Date: Tue May 16 09:54:46 2023 -0400 virtio_pci: Optimize virtio_pci_device structure size Improve the size of the virtio_pci_device structure, which is commonly used to represent a virtio PCI device. A given virtio PCI device can either of legacy type or modern type, with the struct virtio_pci_legacy_device occupying 32 bytes and the struct virtio_pci_modern_device occupying 88 bytes. Make them a union, thereby save 32 bytes of memory as shown by the pahole tool. This improvement is particularly beneficial when dealing with numerous devices, as it helps conserve memory resources. Before the modification, pahole tool reported the following: struct virtio_pci_device { [...] struct virtio_pci_legacy_device ldev; /* 824 32 */ /* --- cacheline 13 boundary (832 bytes) was 24 bytes ago --- */ struct virtio_pci_modern_device mdev; /* 856 88 */ /* XXX last struct has 4 bytes of padding */ [...] /* size: 1056, cachelines: 17, members: 19 */ [...] }; After the modification, pahole tool reported the following: struct virtio_pci_device { [...] union { struct virtio_pci_legacy_device ldev; /* 824 32 */ struct virtio_pci_modern_device mdev; /* 824 88 */ }; /* 824 88 */ [...] /* size: 1024, cachelines: 16, members: 18 */ [...] }; Signed-off-by: Feng Liu Reviewed-by: Jiri Pirko Message-Id: <20230516135446.16266-1-feliu@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo Acked-by: Jason Wang commit 77b894f220cbd04301b3d941df8247106e67f8e4 Author: Peng Fan Date: Thu Mar 23 12:00:24 2023 +0800 tools/virtio: fix build break for aarch64 "-mfunction-return=thunk -mindirect-branch-register" are only valid for x86. So introduce compiler operation check to avoid such issues Fixes: 0d0ed4006127 ("tools/virtio: enable to build with retpoline") Signed-off-by: Peng Fan Message-Id: <20230323040024.3809108-1-peng.fan@oss.nxp.com> Signed-off-by: Michael S. Tsirkin commit fe37efba475375caa2dbc71cb06f53f7086277ef Author: Dragos Tatulea Date: Thu May 4 16:50:52 2023 +0300 virtio-vdpa: Fix unchecked call to NULL set_vq_affinity The referenced patch calls set_vq_affinity without checking if the op is valid. This patch adds the check. Fixes: 3dad56823b53 ("virtio-vdpa: Support interrupt affinity spreading mechanism") Reviewed-by: Gal Pressman Signed-off-by: Dragos Tatulea Message-Id: <20230504135053.2283816-1-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Feng Liu commit ef9da01c121120f89d89b2bdde59a23bf507a39f Author: Alvaro Karsz Date: Tue May 2 16:10:48 2023 +0300 vdpa/snet: implement the resume vDPA callback The callback sends a resume command to the DPU through the control mechanism. Signed-off-by: Alvaro Karsz Message-Id: <20230502131048.61134-1-alvaro.karsz@solid-run.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 47b60ec7ba22a6359379bce9643bfff7a1ffe9ed Author: Krzysztof Kozlowski Date: Thu May 11 19:54:51 2023 +0200 vdpa: solidrun: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Acked-by: Michael S. Tsirkin Reviewed-by: Alvaro Karsz Signed-off-by: Krzysztof Kozlowski Message-Id: <20230511175451.282096-1-krzysztof.kozlowski@linaro.org> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 49a64c6dbcd3b8289e3b6f8e9a42049e23c243c1 Author: Zhu Lingshan Date: Fri May 26 22:52:54 2023 +0800 vDPA/ifcvf: a vendor driver should not set _CONFIG_S_FAILED VIRTIO_CONFIG_S_FAILED indicates the guest driver has given up the device due to fatal errors. So it is the guest decision, the vendor driver should not set this status to the device. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Message-Id: <20230526145254.39537-6-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit 386a26208524dc9db5d6b01be4b8358a551dda42 Author: Zhu Lingshan Date: Fri May 26 22:52:53 2023 +0800 vDPA/ifcvf: synchronize irqs in the reset routine This commit synchronize irqs of the virtqueues and config space in the reset routine. Thus ifcvf_stop() and reset() are refactored as well. This commit renames ifcvf_stop_hw() to ifcvf_stop() Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Message-Id: <20230526145254.39537-5-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit aeb5ef30bbcc2a4c605f7d44f088113a073c0224 Author: Zhu Lingshan Date: Fri May 26 22:52:52 2023 +0800 vDPA/ifcvf: retire ifcvf_start_datapath and ifcvf_add_status Rather than former lazy-initialization mechanism, now the virtqueue operations and driver_features related ops access the virtio registers directly to take immediate actions. So ifcvf_start_datapath() should retire. ifcvf_add_status() is retierd because we should not change device status by a vendor driver's decision, this driver should only set device status which is from virito drivers upon vdpa_ops.set_status() Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Message-Id: <20230526145254.39537-4-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit 1a252f0391d48733174276247c3d22b8a85a4406 Author: Zhu Lingshan Date: Fri May 26 22:52:51 2023 +0800 vDPA/ifcvf: get_driver_features from virtio registers This commit implements a new function ifcvf_get_driver_feature() which read driver_features from virtio registers. To be less ambiguous, ifcvf_set_features() is renamed to ifcvf_set_driver_features(), and ifcvf_get_features() is renamed to ifcvf_get_dev_features() which returns the provisioned vDPA device features. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Message-Id: <20230526145254.39537-3-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit a4751306bf696785b7446503c287010e667d002b Author: Zhu Lingshan Date: Fri May 26 22:52:50 2023 +0800 vDPA/ifcvf: virt queue ops take immediate actions In this commit, virtqueue operations including: set_vq_num(), set_vq_address(), set_vq_ready() and get_vq_ready() access PCI registers directly to take immediate actions. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang Message-Id: <20230526145254.39537-2-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin commit 5f81018753dfd4989e33ece1f0cb6b8aae498b82 Author: Jiri Olsa Date: Thu Jun 15 13:52:36 2023 +0200 fprobe: Release rethook after the ftrace_ops is unregistered While running bpf selftests it's possible to get following fault: general protection fault, probably for non-canonical address \ 0x6b6b6b6b6b6b6b6b: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC NOPTI ... Call Trace: fprobe_handler+0xc1/0x270 ? __pfx_bpf_testmod_init+0x10/0x10 ? __pfx_bpf_testmod_init+0x10/0x10 ? bpf_fentry_test1+0x5/0x10 ? bpf_fentry_test1+0x5/0x10 ? bpf_testmod_init+0x22/0x80 ? do_one_initcall+0x63/0x2e0 ? rcu_is_watching+0xd/0x40 ? kmalloc_trace+0xaf/0xc0 ? do_init_module+0x60/0x250 ? __do_sys_finit_module+0xac/0x120 ? do_syscall_64+0x37/0x90 ? entry_SYSCALL_64_after_hwframe+0x72/0xdc In unregister_fprobe function we can't release fp->rethook while it's possible there are some of its users still running on another cpu. Moving rethook_free call after fp->ops is unregistered with unregister_ftrace_function call. Link: https://lore.kernel.org/all/20230615115236.3476617-1-jolsa@kernel.org/ Fixes: 5b0ab78998e3 ("fprobe: Add exit_handler support") Cc: stable@vger.kernel.org Reviewed-by: Steven Rostedt (Google) Signed-off-by: Jiri Olsa Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit ecdb004843ed91222be38ed838e7ce7167018222 Author: Sergio Paracuellos Date: Fri Jun 23 05:59:01 2023 +0200 dt-bindings: interrupt-controller: add Ralink SoCs interrupt controller Add YAML doc for the interrupt controller which is present on Ralink SoCs. Reviewed-by: Conor Dooley Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20230623035901.1514341-1-sergio.paracuellos@gmail.com Signed-off-by: Rob Herring commit 3216ceeb708b816ffacb19ae2387ac68bb872631 Author: Sebastian Reichel Date: Fri Jun 16 19:00:21 2023 +0200 dt-bindings: PCI: dwc: rockchip: Update for RK3588 The PCIe 2.0 controllers on RK3588 need one additional clock, one additional reset line and one for ranges entry. Signed-off-by: Sebastian Reichel Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230616170022.76107-4-sebastian.reichel@collabora.com Signed-off-by: Rob Herring commit eaaacb085144e7e950061bfd6d097eb87f7513d7 Author: Davide Tronchin Date: Mon Jun 26 14:53:36 2023 +0200 net: usb: qmi_wwan: add u-blox 0x1312 composition Add RmNet support for LARA-R6 01B. The new LARA-R6 product variant identified by the "01B" string can be configured (by AT interface) in three different USB modes: * Default mode (Vendor ID: 0x1546 Product ID: 0x1311) with 4 serial interfaces * RmNet mode (Vendor ID: 0x1546 Product ID: 0x1312) with 4 serial interfaces and 1 RmNet virtual network interface * CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1313) with 4 serial interface and 1 CDC-ECM virtual network interface The first 4 interfaces of all the 3 configurations (default, RmNet, ECM) are the same. In RmNet mode LARA-R6 01B exposes the following interfaces: If 0: Diagnostic If 1: AT parser If 2: AT parser If 3: AT parset/alternative functions If 4: RMNET interface Signed-off-by: Davide Tronchin Link: https://lore.kernel.org/r/20230626125336.3127-1-davide.tronchin.94@gmail.com Signed-off-by: Paolo Abeni commit 2553a5270d6c281b8fc43bd34611197bff67d715 Author: Matthieu Baerts Date: Mon Jun 26 11:02:39 2023 +0200 perf trace: fix MSG_SPLICE_PAGES build error Our MPTCP CI and Stephen got this error: In file included from builtin-trace.c:907: trace/beauty/msg_flags.c: In function 'syscall_arg__scnprintf_msg_flags': trace/beauty/msg_flags.c:28:21: error: 'MSG_SPLICE_PAGES' undeclared (first use in this function) 28 | if (flags & MSG_##n) { | ^~~~ trace/beauty/msg_flags.c:50:9: note: in expansion of macro 'P_MSG_FLAG' 50 | P_MSG_FLAG(SPLICE_PAGES); | ^~~~~~~~~~ trace/beauty/msg_flags.c:28:21: note: each undeclared identifier is reported only once for each function it appears in 28 | if (flags & MSG_##n) { | ^~~~ trace/beauty/msg_flags.c:50:9: note: in expansion of macro 'P_MSG_FLAG' 50 | P_MSG_FLAG(SPLICE_PAGES); | ^~~~~~~~~~ The fix is similar to what was done with MSG_FASTOPEN: the new macro is defined if it is not defined in the system headers. Fixes: b848b26c6672 ("net: Kill MSG_SENDPAGE_NOTLAST") Reported-by: Stephen Rothwell Closes: https://lore.kernel.org/r/20230626112847.2ef3d422@canb.auug.org.au/ Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20230626090239.899672-1-matthieu.baerts@tessares.net Signed-off-by: Paolo Abeni commit 1a7d09a737a09297e77d9cd575cfe7d1bd14aad9 Merge: 8a9922e7be6d0 b389139f12f28 Author: Paolo Abeni Date: Tue Jun 27 12:47:43 2023 +0200 Merge tag 'nf-23-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Reset shift on Boyer-Moore string match for each block, from Jeremy Sowden. 2) Fix acccess to non-linear area in DCCP conntrack helper, from Florian Westphal. 3) Fix kernel-doc warnings, by Randy Dunlap. 4) Bail out if expires= does not show in SIP helper message, or make ct_sip_parse_numerical_param() tristate and report error if expires= cannot be parsed. 5) Unbind non-anonymous set in case rule construction fails. 6) Fix underflow in chain reference counter in case set element already exists or it cannot be created. netfilter pull request 23-06-27 ==================== Link: https://lore.kernel.org/r/20230627065304.66394-1-pablo@netfilter.org Signed-off-by: Paolo Abeni commit 2e28a798c3092ea42b968fa16ac835969d124898 Author: Ard Biesheuvel Date: Tue Jun 27 09:33:09 2023 +0200 efi/libstub: Disable PCI DMA before grabbing the EFI memory map Currently, the EFI stub will disable PCI DMA as the very last thing it does before calling ExitBootServices(), to avoid interfering with the firmware's normal operation as much as possible. However, the stub will invoke DisconnectController() on all endpoints downstream of the PCI bridges it disables, and this may affect the layout of the EFI memory map, making it substantially more likely that ExitBootServices() will fail the first time around, and that the EFI memory map needs to be reloaded. This, in turn, increases the likelihood that the slack space we allocated is insufficient (and we can no longer allocate memory via boot services after having called ExitBootServices() once), causing the second call to GetMemoryMap (and therefore the boot) to fail. This makes the PCI DMA disable feature a bit more fragile than it already is, so let's make it more robust, by allocating the space for the EFI memory map after disabling PCI DMA. Fixes: 4444f8541dad16fe ("efi: Allow disabling PCI busmastering on bridges during boot") Reported-by: Glenn Washburn Acked-by: Matthew Garrett Signed-off-by: Ard Biesheuvel commit 486bfb05913ac9969a3a71a4dc48f17f31cb162d Author: Herbert Xu Date: Tue Jun 27 17:59:32 2023 +0800 crypto: akcipher - Do not copy dst if it is NULL As signature verification has a NULL destination buffer, the pointer needs to be checked before the memcpy is done. Fixes: addde1f2c966 ("crypto: akcipher - Add sync interface without SG lists") Signed-off-by: Herbert Xu commit 8a9922e7be6d042fa00f894c376473b17a162b66 Author: Cambda Zhu Date: Mon Jun 26 17:33:47 2023 +0800 ipvlan: Fix return value of ipvlan_queue_xmit() ipvlan_queue_xmit() should return NET_XMIT_XXX, but ipvlan_xmit_mode_l2/l3() returns rx_handler_result_t or NET_RX_XXX in some cases. ipvlan_rcv_frame() will only return RX_HANDLER_CONSUMED in ipvlan_xmit_mode_l2/l3() because 'local' is true. It's equal to NET_XMIT_SUCCESS. But dev_forward_skb() can return NET_RX_SUCCESS or NET_RX_DROP, and returning NET_RX_DROP(NET_XMIT_DROP) will increase both ipvlan and ipvlan->phy_dev drops counter. The skb to forward can be treated as xmitted successfully. This patch makes ipvlan_queue_xmit() return NET_XMIT_SUCCESS for forward skb. Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.") Signed-off-by: Cambda Zhu Link: https://lore.kernel.org/r/20230626093347.7492-1-cambda@linux.alibaba.com Signed-off-by: Paolo Abeni commit 5b7826355e5b9f48eea29275215fc55165cd17c3 Author: Imre Deak Date: Fri Jun 16 21:51:01 2023 +0300 drm/i915: Add missing forward declarations/includes to display power headers Add the seq_file struct forward declaration to intel_display_power.h fixing the build error below. While at it add the rest of missing forward declarations/includes to the display power header files. In file included from : ./../drivers/gpu/drm/i915/display/intel_display_power.h:255:70: error: 'struct seq_file' declared inside parameter list will not be visible outside of this definition or declaration [-Werror] 255 | void intel_display_power_debug(struct drm_i915_private *i915, struct seq_file *m); | ^~~~~~~~ Closes: https://lore.kernel.org/intel-gfx/89adc1ac-25a0-6eb6-4cc9-ab6cc8d49730@infradead.org/ Reported-by: Randy Dunlap Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Reviewed-by: Jouni Högander Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230616185104.2502003-1-imre.deak@intel.com (cherry picked from commit f4fab137dd2bc7dfdf8d17f8c53c472a5316109c) Signed-off-by: Tvrtko Ursulin commit 891ebfdfa3d08bf55ebec523c99bb68ac9c34cf7 Author: Herbert Xu Date: Mon Jun 26 18:33:44 2023 +0800 crypto: sig - Fix verify call The dst SG list needs to be set to NULL for verify calls. Do this as otherwise the underlying algorithm may fail. Furthermore the digest needs to be copied just like the source. Fixes: 6cb8815f41a9 ("crypto: sig - Add interface for sign/verify") Signed-off-by: Herbert Xu commit 767cfee8368f43c6d6c58cdf8c2d143a027fa55f Author: Herbert Xu Date: Mon Jun 26 18:20:25 2023 +0800 crypto: akcipher - Set request tfm on sync path The request tfm needs to be set. Fixes: addde1f2c966 ("crypto: akcipher - Add sync interface without SG lists") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202306261421.2ac744fa-oliver.sang@intel.com Signed-off-by: Herbert Xu commit 84d21f13af40f35e2e658f046d0c1e508e8a82ee Merge: 6995e2de6891c a3f1132c4c6be Author: Huacai Chen Date: Tue Jun 27 14:56:51 2023 +0800 Merge 'irq/loongarch-fixes-6.5' into loongarch-next LoongArch architecture changes for 6.5 depend on the irq changes to work on both ACPI and FDT systems, so merge them to create a base. commit 54a11654de163994e32b24e3aa90ef81f4a3184d Author: Masahiro Yamada Date: Thu Jan 19 17:22:50 2023 +0900 powerpc: remove checks for binutils older than 2.25 Commit e4412739472b ("Documentation: raise minimum supported version of binutils to 2.25") allows us to remove the checks for old binutils. There is no more user for ld-ifversion. Remove it as well. Signed-off-by: Masahiro Yamada Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230119082250.151485-1-masahiroy@kernel.org commit a590f03d8de7c4cb7ce4916dc7f2fd10711faabe Author: Thomas Hellström Date: Mon Jun 26 11:14:50 2023 +0200 drm/ttm: Don't leak a resource on swapout move error If moving the bo to system for swapout failed, we were leaking a resource. Fix. Fixes: bfa3357ef9ab ("drm/ttm: allocate resource object instead of embedding it v2") Cc: Christian König Cc: "Christian König" Cc: dri-devel@lists.freedesktop.org Cc: # v5.14+ Signed-off-by: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Andi Shyti Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230626091450.14757-5-thomas.hellstrom@linux.intel.com commit e8188c461ee015ba0b9ab2fc82dbd5ebca5a5532 Author: Thomas Hellström Date: Mon Jun 26 11:14:49 2023 +0200 drm/ttm: Don't leak a resource on eviction error On eviction errors other than -EMULTIHOP we were leaking a resource. Fix. v2: - Avoid yet another goto (Andi Shyti) Fixes: 403797925768 ("drm/ttm: Fix multihop assert on eviction.") Cc: Andrey Grodzovsky Cc: Christian König Cc: Christian Koenig Cc: Huang Rui Cc: dri-devel@lists.freedesktop.org Cc: # v5.15+ Signed-off-by: Thomas Hellström Reviewed-by: Nirmoy Das #v1 Reviewed-by: Andi Shyti Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230626091450.14757-4-thomas.hellstrom@linux.intel.com commit 25ea739ea1d4d3de41acc4f4eb2d1a97eee0eb75 Author: Naveen N Rao Date: Tue May 30 11:44:36 2023 +0530 powerpc: Fail build if using recordmcount with binutils v2.37 binutils v2.37 drops unused section symbols, which prevents recordmcount from capturing mcount locations in sections that have no non-weak symbols. This results in a build failure with a message such as: Cannot find symbol for section 12: .text.perf_callchain_kernel. kernel/events/callchain.o: failed The change to binutils was reverted for v2.38, so this behavior is specific to binutils v2.37: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c09c8b42021180eee9495bd50d8b35e683d3901b Objtool is able to cope with such sections, so this issue is specific to recordmcount. Fail the build and print a warning if binutils v2.37 is detected and if we are using recordmcount. Cc: stable@vger.kernel.org Suggested-by: Joel Stanley Signed-off-by: Naveen N Rao Signed-off-by: Michael Ellerman Link: https://msgid.link/20230530061436.56925-1-naveen@kernel.org commit 1ef6663a587ba3e57dc5065a477db1c64481eedd Merge: 8d7868c41df58 2b8cc5858a07a Author: Linus Torvalds Date: Mon Jun 26 20:12:07 2023 -0700 Merge tag 'tag-chrome-platform-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Tzung-Bi Shih: "Improvements: - Support Pin Assignment D in getting mux state - Emit an uevent when EC panics so that userland programs get chance to capture EC coredumps (LPC interface only) - Send EC_CMD_HOST_SLEEP_EVENT to EC at the very beginning/end of system suspend/resume so that EC can watch the duration more accurately (LPC interface only) Misc: - Switch back from I2C .probe_new() to .probe() - Use %*ph for printing hexdump of small buffers" * tag 'tag-chrome-platform-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_ec_spi: Use %*ph for printing hexdump of a small buffer platform/chrome: Switch i2c drivers back to use .probe() platform/chrome: cros_ec_lpc: Move host command to prepare/complete platform/chrome: cros_ec: Report EC panic as uevent platform/chrome: cros_typec_switch: Add Pin D support commit 8d7868c41df58edabc4e408d119a1aef58a54d9d Merge: 40e8e98f512fc a8460ba59464c Author: Linus Torvalds Date: Mon Jun 26 19:41:26 2023 -0700 Merge tag 'thermal-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control updates from Rafael Wysocki: "These extend the int340x thermal driver, add thermal DT bindings for some Qcom platforms, add DT bindings and support for Armada AP807 and MSM8909, allow selecting the bang-bang thermal governor as the default one, address issues in several thermal drivers for ARM platforms and clean up code. Specifics: - Add new IOCTLs to the int340x thermal driver to allow user space to retrieve the Passive v2 thermal table (Srinivas Pandruvada) - Add DT bindings for SM6375, MSM8226 and QCM2290 Qcom platforms (Konrad Dybcio) - Add DT bindings and support for QCom MSM8226 (Matti Lehtimäki) - Add DT bindings for QCom ipq9574 (Praveenkumar I) - Convert bcm2835 DT bindings to the yaml schema (Stefan Wahren) - Allow selecting the bang-bang governor as default (Thierry Reding) - Refactor and prepare the code to set the scene for RCar Gen4 (Wolfram Sang) - Clean up and fix the QCom tsens drivers. Add DT bindings and calibration for the MSM8909 platform (Stephan Gerhold) - Revert a patch introducing a wrong usage of devm_of_iomap() on the Mediatek platform (Ricardo Cañuelo) - Fix the clock vs reset ordering in order to conform to the documentation on the sun8i (Christophe JAILLET) - Prevent setting up undocumented registers, enable the only described sensors and add the version 2.1 on the Qoriq sensor (Peng Fan) - Add DT bindings and support for the Armada AP807 (Alex Leibovich) - Update the mlx5 driver with the recent thermal changes (Daniel Lezcano) - Convert to platform remove callback returning void on STM32 (Uwe Kleine-König) - Add an error information printing for devm_thermal_add_hwmon_sysfs() and remove the error from the Sun8i, Amlogic, i.MX, TI, K3, Tegra, Qoriq, Mediateka and QCom (Yangtao Li) - Register as hwmon sensor for the Generic ADC (Chen-Yu Tsai) - Use the dev_err_probe() function in the QCom tsens alarm driver (Luca Weiss)" * tag 'thermal-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (39 commits) thermal/drivers/qcom/temp-alarm: Use dev_err_probe thermal/drivers/generic-adc: Register thermal zones as hwmon sensors thermal/drivers/mediatek/lvts_thermal: Remove redundant msg in lvts_ctrl_start() thermal/drivers/qcom: Remove redundant msg at probe time thermal/drivers/ti-soc: Remove redundant msg in ti_thermal_expose_sensor() thermal/drivers/qoriq: Remove redundant msg in qoriq_tmu_register_tmu_zone() thermal/drivers/tegra: Remove redundant msg in tegra_tsensor_register_channel() drivers/thermal/k3: Remove redundant msg in k3_bandgap_probe() thermal/drivers/imx: Remove redundant msg in imx8mm_tmu_probe() and imx_sc_thermal_probe() thermal/drivers/amlogic: Remove redundant msg in amlogic_thermal_probe() thermal/drivers/sun8i: Remove redundant msg in sun8i_ths_register() thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() thermal/drivers/stm32: Convert to platform remove callback returning void net/mlx5: Update the driver with the recent thermal changes thermal/drivers/armada: Add support for AP807 thermal data dt-bindings: armada-thermal: Add armada-ap807-thermal compatible thermal/drivers/qoriq: Support version 2.1 thermal/drivers/qoriq: Only enable supported sensors thermal/drivers/qoriq: No need to program site adjustment register thermal/drivers/mediatek/lvts_thermal: Register thermal zones as hwmon sensors ... commit 40e8e98f512fc76891ae2328a63e2e4ffdbe3010 Merge: bb6950556d4b1 c89a27f4f8fbf Author: Linus Torvalds Date: Mon Jun 26 19:36:30 2023 -0700 Merge tag 'pm-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "These add Intel TPMI (Topology Aware Register and PM Capsule Interface) support to the power capping subsystem, extend the intel_idle driver to work in VM guests where MWAIT is not available, extend the system-wide power management diagnostics, fix bugs and clean up code. Specifics: - Introduce power capping core support for Intel TPMI (Topology Aware Register and PM Capsule Interface) and a TPMI interface driver for Intel RAPL (Zhang Rui, Dan Carpenter) - Fix CONFIG_IOSF_MBI dependency in the Intel RAPL power capping driver (Zhang Rui) - Fix invalid initialization for pl4_supported field in the Intel RAPL power capping driver (Sumeet Pawnikar) - Clean up the intel_idle driver, make it work with VM guests that cannot use the MWAIT instruction and address the case in which the host may enter a deep idle state when the guest is idle (Arjan van de Ven) - Prevent cpufreq drivers that provide the ->adjust_perf() callback without a ->fast_switch() one which is used as a fallback from the former in some cases (Wyes Karny) - Fix some issues related to the AMD P-state cpufreq driver (Mario Limonciello, Wyes Karny) - Fix the energy_performance_preference attribute handling in the intel_pstate driver in passive mode (Tero Kristo) - Fix the handling of pm_suspend_target_state when CONFIG_PM is unset (Kai-Heng Feng) - Correct spelling mistake in a comment in the hibernation code (Wang Honghui) - Add arch_resume_nosmt() prototype to avoid a "missing prototypes" build warning (Arnd Bergmann) - Restrict pm_pr_dbg() to system-wide power transitions and use it in a few additional places (Mario Limonciello) - Drop verification of in-params from genpd_add_device() and ensure that all of its callers will do it (Ulf Hansson) - Prevent possible integer overflows from occurring in genpd_parse_state() (Nikita Zhandarovich) - Reorder fieldls in 'struct devfreq_dev_status' to reduce its size somewhat (Christophe JAILLET) - Ensure that the Exynos PPMU driver is already loaded before the Exynos Bus driver starts probing so as to avoid a possible freeze loading of the kernel modules (Marek Szyprowski) - Fix variable deferencing before NULL check in the mtk-cci devfreq driver (Sukrut Bellary)" * tag 'pm-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (42 commits) intel_idle: Add a "Long HLT" C1 state for the VM guest mode cpufreq: intel_pstate: Fix energy_performance_preference for passive cpufreq: amd-pstate: Add a kernel config option to set default mode cpufreq: amd-pstate: Set a fallback policy based on preferred_profile ACPI: CPPC: Add definition for undefined FADT preferred PM profile value cpufreq: amd-pstate: Set default governor to schedutil PM: domains: Move the verification of in-params from genpd_add_device() cpufreq: amd-pstate: Make amd-pstate EPP driver name hyphenated cpufreq: amd-pstate: Write CPPC enable bit per-socket intel_idle: Add support for using intel_idle in a VM guest using just hlt cpufreq: Fail driver register if it has adjust_perf without fast_switch intel_idle: clean up the (new) state_update_enter_method function intel_idle: refactor state->enter manipulation into its own function platform/x86/amd: pmc: Use pm_pr_dbg() for suspend related messages pinctrl: amd: Use pm_pr_dbg to show debugging messages ACPI: x86: Add pm_debug_messages for LPS0 _DSM state tracking include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume powercap: RAPL: Fix a NULL vs IS_ERR() bug powercap: RAPL: Fix CONFIG_IOSF_MBI dependency powercap: RAPL: fix invalid initialization for pl4_supported field ... commit bb6950556d4b1dd1226c1f09e84b53cb37e5340f Merge: 2605e80d3438c 01fee479846bb Author: Linus Torvalds Date: Mon Jun 26 19:30:19 2023 -0700 Merge tag 'acpi-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These rework the handling of notifications in ACPI button drivers (to enable future simplifications and cleanups), clean up the ACPI thermal driver, update the ACPI backlight driver, add quirks working around AML bugs on some systems, fix some assorted issues and clean up code. Specifics: - Reduce ACPI device enumeration overhead related to devices with dependencies (Rafael Wysocki) - Fix the handling of Microsoft LPS0 _DSM for suspend-to-idle (Mario Limonciello) - Fix section mismatch warning in the ACPI suspend-to-idle code (Arnd Bergmann) - Drop several ACPI resource management quirks related to IRQ ovverides on AMD "Zen" systems (Mario Limonciello) - Modify the ACPI EC driver to make it only clear the EC GPE status when handling the GPE (Jeremy Compostella) - Add quirks to work around ACPI tables defects on Lenovo Yoga Book yb1-x90f/l and Nextbook Ares 8A (Hans de Goede) - Add ACPi backlight quirks for Dell Studio 1569, Lenovo ThinkPad X131e (3371 AMD version) and Apple iMac11,3 and stop trying to use vendor backlight control on relatively recent systems (Hans de Goede) - Add pwm_lookup_table entry for second PWM on CHT/BSW devices in the ACPI LPSS (Intel SoC) driver (Hans de Goede) - Add nfit_intel_shutdown_status() declaration to a local header to avoid a "missing prototypes" build warning (Arnd Bergmann) - Clean up the ACPI thermal driver and drop some dead or otherwise unneded code from it (Rafael Wysocki) - Rework the handling of notifications in the ACPI button drivers so as to allow the common notification handling code for devices to be simplified (Rafael Wysocki) - Make ghes_get_devices() return NULL to indicate that there are no GHES devices so as to allow vendor-specific EDAC drivers to probe then (Li Yang) - Mark bert_disable() as __initdata and drop an unused function from the APEI GHES code (Miaohe Lin) - Make the ACPI PAD (Processor Aggregator Device) driver realize that Zhaoxin CPUs support nonstop TSC (Tony W Wang-oc) - Drop the certainly unnecessary and likely incorrect inclusion of linux/arm-smccc.h from acpi_ffh.c (Sudeep Holla)" * tag 'acpi-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (30 commits) ACPI: video: Add backlight=native DMI quirk for Dell Studio 1569 ACPI: thermal: Drop struct acpi_thermal_flags ACPI: thermal: Drop struct acpi_thermal_state ACPI: bus: Simplify installation and removal of notify callback ACPI: tiny-power-button: Eliminate the driver notify callback ACPI: button: Use different notify handlers for lid and buttons ACPI: button: Eliminate the driver notify callback ACPI: thermal: Eliminate struct acpi_thermal_state_flags ACPI: thermal: Move acpi_thermal_driver definition ACPI: thermal: Move symbol definitions to one place ACPI: thermal: Drop redundant ACPI_TRIPS_REFRESH_DEVICES symbol ACPI: thermal: Use BIT() macro for defining flags APEI: GHES: correctly return NULL for ghes_get_devices() ACPI: FFH: Drop the inclusion of linux/arm-smccc.h ACPI: PAD: mark Zhaoxin CPUs NONSTOP TSC correctly ACPI: APEI: mark bert_disable as __initdata ACPI: EC: Clear GPE on interrupt handling only ACPI: video: Stop trying to use vendor backlight control on laptops from after ~2012 ACPI: x86: s2idle: Adjust Microsoft LPS0 _DSM handling sequence ACPI: resource: Remove "Zen" specific match and quirks ... commit 5fb2864cbd50a84a73af4fdd900b31f2daddea34 Author: Andrew Halaney Date: Mon Jun 26 08:46:46 2023 -0500 OPP: Properly propagate error along when failing to get icc_path fa155f4f8348 ("OPP: Use dev_err_probe() when failing to get icc_path") failed to actually use the error it was trying to log: smatch warnings: drivers/opp/of.c:516 dev_pm_opp_of_find_icc_paths() warn: passing zero to 'dev_err_probe' Make sure to use the right error and pass it along. Fixes: fa155f4f8348 ("OPP: Use dev_err_probe() when failing to get icc_path") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202306262008.guNLgjt6-lkp@intel.com/ Signed-off-by: Andrew Halaney Signed-off-by: Viresh Kumar commit 2605e80d3438c77190f55b821c6575048c68268e Merge: 2b603cd5b78fe abc17128c81ae Author: Linus Torvalds Date: Mon Jun 26 17:11:53 2023 -0700 Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 updates from Catalin Marinas: "Notable features are user-space support for the memcpy/memset instructions and the permission indirection extension. - Support for the Armv8.9 Permission Indirection Extensions. While this feature doesn't add new functionality, it enables future support for Guarded Control Stacks (GCS) and Permission Overlays - User-space support for the Armv8.8 memcpy/memset instructions - arm64 perf: support the HiSilicon SoC uncore PMU, Arm CMN sysfs identifier, support for the NXP i.MX9 SoC DDRC PMU, fixes and cleanups - Removal of superfluous ISBs on context switch (following retrospective architecture tightening) - Decode the ISS2 register during faults for additional information to help with debugging - KPTI clean-up/simplification of the trampoline exit code - Addressing several -Wmissing-prototype warnings - Kselftest improvements for signal handling and ptrace - Fix TPIDR2_EL0 restoring on sigreturn - Clean-up, robustness improvements of the module allocation code - More sysreg conversions to the automatic register/bitfields generation - CPU capabilities handling cleanup - Arm documentation updates: ACPI, ptdump" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (124 commits) kselftest/arm64: Add a test case for TPIDR2 restore arm64/signal: Restore TPIDR2 register rather than memory state arm64: alternatives: make clean_dcache_range_nopatch() noinstr-safe Documentation/arm64: Add ptdump documentation arm64: hibernate: remove WARN_ON in save_processor_state kselftest/arm64: Log signal code and address for unexpected signals docs: perf: Fix warning from 'make htmldocs' in hisi-pmu.rst arm64/fpsimd: Exit streaming mode when flushing tasks docs: perf: Add new description for HiSilicon UC PMU drivers/perf: hisi: Add support for HiSilicon UC PMU driver drivers/perf: hisi: Add support for HiSilicon H60PA and PAv3 PMU driver perf: arm_cspmu: Add missing MODULE_DEVICE_TABLE perf/arm-cmn: Add sysfs identifier perf/arm-cmn: Revamp model detection perf/arm_dmc620: Add cpumask arm64: mm: fix VA-range sanity check arm64/mm: remove now-superfluous ISBs from TTBR writes Documentation/arm64: Update ACPI tables from BBR Documentation/arm64: Update references in arm-acpi Documentation/arm64: Update ARM and arch reference ... commit 2b603cd5b78fe79af0498824fbd9281b1fba6a75 Merge: f810c182366ac 85e18ed32e260 Author: Linus Torvalds Date: Mon Jun 26 17:07:53 2023 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM updates from Russell King: - lots of build cleanups from Arnd spread throughout the arch/arm tree - replace strlcpy() with the preferred strscpy() - use sign_extend32() in the module linker - drop handle_irq() machine descriptor method * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9315/1: fiq: include asm/mach/irq.h for prototypes ARM: 9314/1: tcm: move tcm_init() prototype to asm/tcm.h ARM: 9313/1: vdso: add missing prototypes ARM: 9312/1: vfp: include asm/neon.h in vfpmodule.c ARM: 9311/1: decompressor: move function prototypes to misc.h ARM: 9310/1: xip-kernel: add __inflate_kernel_data prototype ARM: 9309/1: add missing syscall prototypes ARM: 9308/1: move setup functions to header ARM: 9307/1: nommu: include asm/idmap.h ARM: 9306/1: cacheflush: avoid __flush_anon_page() missing-prototype warning ARM: 9305/1: add clear/copy_user_highpage declarations ARM: 9304/1: add prototype for function called only from asm ARM: 9303/1: kprobes: avoid missing-declaration warnings ARM: 9302/1: traps: hide unused functions on NOMMU ARM: 9301/1: dma-mapping: hide unused dma_contiguous_early_fixup function ARM: 9300/1: Replace all non-returning strlcpy with strscpy ARM: 9299/1: module: use sign_extend32() to extend the signedness ARM: 9298/1: Drop custom mdesc->handle_irq() commit f810c182366acd2eb7eb5efb3c06b1fc9f719835 Merge: 19300488c9d9c 4055eabe04a26 Author: Linus Torvalds Date: Mon Jun 26 17:04:03 2023 -0700 Merge tag 'm68k-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k updates from Geert Uytterhoeven: - miscellaneous NuBus fixes and improvements - defconfig updates * tag 'm68k-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: defconfig: Update defconfigs for v6.4-rc1 nubus: Don't list slot resources by default nubus: Remove proc entries before adding them nubus: Partially revert proc_create_single_data() conversion commit 19300488c9d9c9ed539ab3f4f1bfc0050c9a4482 Merge: 5dfe7a7e52ccd b360cbd254fde Author: Linus Torvalds Date: Mon Jun 26 16:43:54 2023 -0700 Merge tag 'x86_cleanups_for_6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cleanups from Dave Hansen: "As usual, these are all over the map. The biggest cluster is work from Arnd to eliminate -Wmissing-prototype warnings: - Address -Wmissing-prototype warnings - Remove repeated 'the' in comments - Remove unused current_untag_mask() - Document urgent tip branch timing - Clean up MSR kernel-doc notation - Clean up paravirt_ops doc - Update Srivatsa S. Bhat's maintained areas - Remove unused extern declaration acpi_copy_wakeup_routine()" * tag 'x86_cleanups_for_6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits) x86/acpi: Remove unused extern declaration acpi_copy_wakeup_routine() Documentation: virt: Clean up paravirt_ops doc x86/mm: Remove unused current_untag_mask() x86/mm: Remove repeated word in comments x86/lib/msr: Clean up kernel-doc notation x86/platform: Avoid missing-prototype warnings for OLPC x86/mm: Add early_memremap_pgprot_adjust() prototype x86/usercopy: Include arch_wb_cache_pmem() declaration x86/vdso: Include vdso/processor.h x86/mce: Add copy_mc_fragile_handle_tail() prototype x86/fbdev: Include asm/fb.h as needed x86/hibernate: Declare global functions in suspend.h x86/entry: Add do_SYSENTER_32() prototype x86/quirks: Include linux/pnp.h for arch_pnpbios_disabled() x86/mm: Include asm/numa.h for set_highmem_pages_init() x86: Avoid missing-prototype warnings for doublefault code x86/fpu: Include asm/fpu/regset.h x86: Add dummy prototype for mk_early_pgtbl_32() x86/pci: Mark local functions as 'static' x86/ftrace: Move prepare_ftrace_return prototype to header ... commit 2ef6c32a914b85217b44a0a2418e830e520b085e Author: Theodore Ts'o Date: Fri Jun 23 10:18:51 2023 -0400 ext4: avoid updating the superblock on a r/o mount if not needed This was noticed by a user who noticied that the mtime of a file backing a loopback device was getting bumped when the loopback device is mounted read/only. Note: This doesn't show up when doing a loopback mount of a file directly, via "mount -o ro /tmp/foo.img /mnt", since the loop device is set read-only when mount automatically creates loop device. However, this is noticeable for a LUKS loop device like this: % cryptsetup luksOpen /tmp/foo.img test % mount -o ro /dev/loop0 /mnt ; umount /mnt or, if LUKS is not in use, if the user manually creates the loop device like this: % losetup /dev/loop0 /tmp/foo.img % mount -o ro /dev/loop0 /mnt ; umount /mnt The modified mtime causes rsync to do a rolling checksum scan of the file on the local and remote side, incrementally increasing the time to rsync the not-modified-but-touched image file. Fixes: eee00237fa5e ("ext4: commit super block if fs record error when journal record without error") Cc: stable@kernel.org Link: https://lore.kernel.org/r/ZIauBR7YiV3rVAHL@glitch Reported-by: Sean Greenslade Signed-off-by: Theodore Ts'o commit 31464ab01fff910cb88376384e2b6824f7bf713f Author: Zhang Yi Date: Fri Jun 16 09:55:47 2023 +0800 jbd2: skip reading super block if it has been verified We got a NULL pointer dereference issue below while running generic/475 I/O failure pressure test. BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT SMP PTI CPU: 1 PID: 15600 Comm: fsstress Not tainted 6.4.0-rc5-xfstests-00055-gd3ab1bca26b4 #190 RIP: 0010:jbd2_journal_set_features+0x13d/0x430 ... Call Trace: ? __die+0x23/0x60 ? page_fault_oops+0xa4/0x170 ? exc_page_fault+0x67/0x170 ? asm_exc_page_fault+0x26/0x30 ? jbd2_journal_set_features+0x13d/0x430 jbd2_journal_revoke+0x47/0x1e0 __ext4_forget+0xc3/0x1b0 ext4_free_blocks+0x214/0x2f0 ext4_free_branches+0xeb/0x270 ext4_ind_truncate+0x2bf/0x320 ext4_truncate+0x1e4/0x490 ext4_handle_inode_extension+0x1bd/0x2a0 ? iomap_dio_complete+0xaf/0x1d0 The root cause is the journal super block had been failed to write out due to I/O fault injection, it's uptodate bit was cleared by end_buffer_write_sync() and didn't reset yet in jbd2_write_superblock(). And it raced by journal_get_superblock()->bh_read(), unfortunately, the read IO is also failed, so the error handling in journal_fail_superblock() unexpectedly clear the journal->j_sb_buffer, finally lead to above NULL pointer dereference issue. If the journal super block had been read and verified, there is no need to call bh_read() read it again even if it has been failed to written out. So the fix could be simply move buffer_verified(bh) in front of bh_read(). Also remove a stale comment left in jbd2_journal_check_used_features(). Fixes: 51bacdba23d8 ("jbd2: factor out journal initialization from journal_get_superblock()") Reported-by: Theodore Ts'o Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230616015547.3155195-1-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit c4d13222afd8a64bf11bc7ec68645496ee8b54b9 Author: Chao Yu Date: Tue Jun 6 15:32:03 2023 +0800 ext4: fix to check return value of freeze_bdev() in ext4_shutdown() freeze_bdev() can fail due to a lot of reasons, it needs to check its reason before later process. Fixes: 783d94854499 ("ext4: add EXT4_IOC_GOINGDOWN ioctl") Cc: stable@kernel.org Signed-off-by: Chao Yu Link: https://lore.kernel.org/r/20230606073203.1310389-1-chao@kernel.org Signed-off-by: Theodore Ts'o commit f3c1c42e0c40656e73f12ab5dcb1110f83ef8e65 Author: Baokun Li Date: Mon Mar 27 22:16:30 2023 +0800 ext4: refactoring to use the unified helper ext4_quotas_off() Rename ext4_quota_off_umount() to ext4_quotas_off(), and add type parameter to replace open code in ext4_enable_quotas(). Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230327141630.156875-3-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit d13f99632748462c32fc95d729f5e754bab06064 Author: Baokun Li Date: Mon Mar 27 22:16:29 2023 +0800 ext4: turn quotas off if mount failed after enabling quotas Yi found during a review of the patch "ext4: don't BUG on inconsistent journal feature" that when ext4_mark_recovery_complete() returns an error value, the error handling path does not turn off the enabled quotas, which triggers the following kmemleak: ================================================================ unreferenced object 0xffff8cf68678e7c0 (size 64): comm "mount", pid 746, jiffies 4294871231 (age 11.540s) hex dump (first 32 bytes): 00 90 ef 82 f6 8c ff ff 00 00 00 00 41 01 00 00 ............A... c7 00 00 00 bd 00 00 00 0a 00 00 00 48 00 00 00 ............H... backtrace: [<00000000c561ef24>] __kmem_cache_alloc_node+0x4d4/0x880 [<00000000d4e621d7>] kmalloc_trace+0x39/0x140 [<00000000837eee74>] v2_read_file_info+0x18a/0x3a0 [<0000000088f6c877>] dquot_load_quota_sb+0x2ed/0x770 [<00000000340a4782>] dquot_load_quota_inode+0xc6/0x1c0 [<0000000089a18bd5>] ext4_enable_quotas+0x17e/0x3a0 [ext4] [<000000003a0268fa>] __ext4_fill_super+0x3448/0x3910 [ext4] [<00000000b0f2a8a8>] ext4_fill_super+0x13d/0x340 [ext4] [<000000004a9489c4>] get_tree_bdev+0x1dc/0x370 [<000000006e723bf1>] ext4_get_tree+0x1d/0x30 [ext4] [<00000000c7cb663d>] vfs_get_tree+0x31/0x160 [<00000000320e1bed>] do_new_mount+0x1d5/0x480 [<00000000c074654c>] path_mount+0x22e/0xbe0 [<0000000003e97a8e>] do_mount+0x95/0xc0 [<000000002f3d3736>] __x64_sys_mount+0xc4/0x160 [<0000000027d2140c>] do_syscall_64+0x3f/0x90 ================================================================ To solve this problem, we add a "failed_mount10" tag, and call ext4_quota_off_umount() in this tag to release the enabled qoutas. Fixes: 11215630aada ("ext4: don't BUG on inconsistent journal feature") Cc: stable@kernel.org Signed-off-by: Zhang Yi Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230327141630.156875-2-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit b21154256dbfc63778e4f235b9ae452e3c1c575e Author: Andrew Davis Date: Fri Jun 23 15:15:19 2023 -0500 dt-bindings: mfd: ti,j721e-system-controller: Remove syscon from example The binding for ti,am654-ehrpwm-tbclk was updated to remove the syscon compatible hint. Remove the same from the example in this binding. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230623201519.194269-1-afd@ti.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 82e58e69d7007260e2513ceec9fb31fcbed1d02d Merge: b9a40506a2cb6 7ed1cefbf1693 ff1c6c904c8dd Author: Stephen Boyd Date: Mon Jun 26 16:36:14 2023 -0700 Merge branches 'clk-qcom' and 'clk-microchip' into clk-next * clk-qcom: (63 commits) clk: qcom: gcc-sc8280xp: Add runtime PM clk: qcom: gpucc-sc8280xp: Add runtime PM clk: qcom: mmcc-msm8974: fix MDSS_GDSC power flags clk: qcom: gpucc-sm6375: Enable runtime pm dt-bindings: clock: sm6375-gpucc: Add VDD_GX clk: qcom: gcc-sm6115: Add missing PLL config properties clk: qcom: clk-alpha-pll: Add a way to update some bits of test_ctl(_hi) clk: qcom: gcc-ipq6018: remove duplicate initializers clk: qcom: gcc-ipq9574: Enable crypto clocks dt-bindings: clock: Add crypto clock and reset definitions clk: qcom: Add lpass audio clock controller driver for SC8280XP clk: qcom: Add lpass clock controller driver for SC8280XP dt-bindings: clock: Add LPASS AUDIOCC and reset controller for SC8280XP dt-bindings: clock: Add LPASSCC and reset controller for SC8280XP dt-bindings: clock: qcom,mmcc: define clocks/clock-names for MSM8226 clk: qcom: gpucc-sm8550: Add support for graphics clock controller clk: qcom: Add support for SM8450 GPUCC clk: qcom: gcc-sm8450: Enable hw_clk_ctrl clk: qcom: rcg2: Make hw_clk_ctrl toggleable dt-bindings: clock: qcom: Add SM8550 graphics clock controller ... * clk-microchip: clk: at91: sama7g5: s/ep_chg_chg_id/ep_chg_id clk: at91: sama7g5: switch to parent_hw and parent_data clk: at91: sckc: switch to parent_data/parent_hw clk: at91: clk-sam9x60-pll: add support for parent_hw clk: at91: clk-utmi: add support for parent_hw clk: at91: clk-system: add support for parent_hw clk: at91: clk-programmable: add support for parent_hw clk: at91: clk-peripheral: add support for parent_hw clk: at91: clk-master: add support for parent_hw clk: at91: clk-generated: add support for parent_hw clk: at91: clk-main: add support for parent_data/parent_hw commit 71025b8565a383223ea2d94325db37cdabbcc453 Author: Pierre-Clément Tosi Date: Mon Jun 26 12:29:46 2023 +0000 scripts/mksysmap: Ignore prefixed KCFI symbols The (relatively) new KCFI feature in LLVM/Clang encodes type information for C functions by generating symbols named __kcfi_typeid_, which can then be referenced from assembly. However, some custom build rules (e.g. nVHE or early PIE on arm64) use objcopy to add a prefix to all the symbols in their object files, making mksysmap's ignore filter miss those KCFI symbols. Therefore, explicitly list those twice-prefixed KCFI symbols as ignored. Alternatively, this could also be achieved in a less verbose way by ignoring any symbol containing the string "__kcfi_typeid_". However, listing the combined prefixes explicitly saves us from running the small risk of ignoring symbols that should be kept. Signed-off-by: Pierre-Clément Tosi Reviewed-by: Sami Tolvanen Signed-off-by: Masahiro Yamada commit bd5a594b5b1cfa14646bc29e6c7745c961025055 Author: Zhang Yi Date: Wed Mar 22 09:33:53 2023 +0800 ext4: update doc about journal superblock description Update the description in doc about the s_head parameter in the journal superblock. Signed-off-by: Zhang Yi Link: https://lore.kernel.org/r/20230322013353.1843306-4-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit 7294505824254da9cb5ee6cb12d783c9eeea030e Author: Zhang Yi Date: Wed Mar 22 09:33:52 2023 +0800 ext4: add journal cycled recording support Always enable 'JBD2_CYCLE_RECORD' journal option on ext4, letting the jbd2 continue to record new journal transactions from the recovered journal head or the checkpointed transactions in the previous mount. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230322013353.1843306-3-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit c7fc60555864c0e67f5e5754a9053986f8fb8491 Author: Zhang Yi Date: Wed Mar 22 09:33:51 2023 +0800 jbd2: continue to record log between each mount For a newly mounted file system, the journal committing thread always record new transactions from the start of the journal area, no matter whether the journal was clean or just has been recovered. So the logdump code in debugfs cannot dump continuous logs between each mount, it is disadvantageous to analysis corrupted file system image and locate the file system inconsistency bugs. If we get a corrupted file system in the running products and want to find out what has happened, besides lookup the system log, one effective way is to backtrack the journal log. But we may not always run e2fsck before each mount and the default fsck -a mode also cannot always checkout all inconsistencies, so it could left over some inconsistencies into the next mount until we detect it. Finally, transactions in the journal may probably discontinuous and some relatively new transactions has been covered, it becomes hard to analyse. If we could record transactions continuously between each mount, we could acquire more useful info from the journal. Like this: |Previous mount checkpointed/recovered logs|Current mount logs | |{------}{---}{--------} ... {------}| ... |{======}{========}...000000| And yes the journal area is limited and cannot record everything, the problematic transaction may also be covered even if we do this, but this is still useful for fuzzy tests and short-running products. This patch save the head blocknr in the superblock after flushing the journal or unmounting the file system, let the next mount could continue to record new transaction behind it. This change is backward compatible because the old kernel does not care about the head blocknr of the journal. It is also fine if we mount a clean old image without valid head blocknr, we fail back to set it to s_first just like before. Finally, for the case of mount an unclean file system, we could also get the journal head easily after scanning/replaying the journal, it will continue to record new transaction after the recovered transactions. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230322013353.1843306-2-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit 04c2e98179658d223665661f12c5043224e8f8d3 Author: Zhang Yi Date: Wed Mar 15 09:31:28 2023 +0800 jbd2: remove j_format_version journal->j_format_version is no longer used, remove it. Signed-off-by: Zhang Yi Signed-off-by: Zhihao Cheng Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230315013128.3911115-7-chengzhihao1@huawei.com Signed-off-by: Theodore Ts'o commit 3e5cf02cfa3fa9cc9f568930624faed6d3a53ff4 Author: Zhang Yi Date: Wed Mar 15 09:31:27 2023 +0800 jbd2: factor out journal initialization from journal_get_superblock() Current journal_get_superblock() couple journal superblock checking and partial journal initialization, factor out initialization part from it to make things clear. Signed-off-by: Zhang Yi Signed-off-by: Zhihao Cheng Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230315013128.3911115-6-chengzhihao1@huawei.com Signed-off-by: Theodore Ts'o commit 5cf036d4f1489d7ba04b948e415f662521902c30 Author: Zhang Yi Date: Wed Mar 15 09:31:26 2023 +0800 jbd2: switch to check format version in superblock directly We should only check and set extented features if journal format version is 2, and now we check the in memory copy of the superblock 'journal->j_format_version', which relys on the parameter initialization sequence, switch to use the h_blocktype in superblock cloud be more clear. Signed-off-by: Zhang Yi Signed-off-by: Zhihao Cheng Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230315013128.3911115-5-chengzhihao1@huawei.com Signed-off-by: Theodore Ts'o commit 5c5bd1fef3ec913f9c597c6f61a9b903096415bf Author: Zhang Yi Date: Wed Mar 15 09:31:25 2023 +0800 jbd2: remove unused feature macros JBD2_HAS_[IN|RO_]COMPAT_FEATURE macros are no longer used, just remove them. Signed-off-by: Zhang Yi Signed-off-by: Zhihao Cheng Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230315013128.3911115-4-chengzhihao1@huawei.com Signed-off-by: Theodore Ts'o commit 93e92cfcc1977b2b914c75333aa4b629b2fa7ca2 Author: Zhihao Cheng Date: Wed Mar 15 09:31:24 2023 +0800 ext4: ext4_put_super: Remove redundant checking for 'sbi->s_journal_bdev' As discussed in [1], 'sbi->s_journal_bdev != sb->s_bdev' will always become true if sbi->s_journal_bdev exists. Filesystem block device and journal block device are both opened with 'FMODE_EXCL' mode, so these two devices can't be same one. Then we can remove the redundant checking 'sbi->s_journal_bdev != sb->s_bdev' if 'sbi->s_journal_bdev' exists. [1] https://lore.kernel.org/lkml/f86584f6-3877-ff18-47a1-2efaa12d18b2@huawei.com/ Signed-off-by: Zhihao Cheng Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230315013128.3911115-3-chengzhihao1@huawei.com Signed-off-by: Theodore Ts'o commit 26fb5290240dc31cae99b8b4dd2af7f46dfcba6b Author: Zhihao Cheng Date: Wed Mar 15 09:31:23 2023 +0800 ext4: Fix reusing stale buffer heads from last failed mounting Following process makes ext4 load stale buffer heads from last failed mounting in a new mounting operation: mount_bdev ext4_fill_super | ext4_load_and_init_journal | ext4_load_journal | jbd2_journal_load | load_superblock | journal_get_superblock | set_buffer_verified(bh) // buffer head is verified | jbd2_journal_recover // failed caused by EIO | goto failed_mount3a // skip 'sb->s_root' initialization deactivate_locked_super kill_block_super generic_shutdown_super if (sb->s_root) // false, skip ext4_put_super->invalidate_bdev-> // invalidate_mapping_pages->mapping_evict_folio-> // filemap_release_folio->try_to_free_buffers, which // cannot drop buffer head. blkdev_put blkdev_put_whole if (atomic_dec_and_test(&bdev->bd_openers)) // false, systemd-udev happens to open the device. Then // blkdev_flush_mapping->kill_bdev->truncate_inode_pages-> // truncate_inode_folio->truncate_cleanup_folio-> // folio_invalidate->block_invalidate_folio-> // filemap_release_folio->try_to_free_buffers will be skipped, // dropping buffer head is missed again. Second mount: ext4_fill_super ext4_load_and_init_journal ext4_load_journal ext4_get_journal jbd2_journal_init_inode journal_init_common bh = getblk_unmovable bh = __find_get_block // Found stale bh in last failed mounting journal->j_sb_buffer = bh jbd2_journal_load load_superblock journal_get_superblock if (buffer_verified(bh)) // true, skip journal->j_format_version = 2, value is 0 jbd2_journal_recover do_one_pass next_log_block += count_tags(journal, bh) // According to journal_tag_bytes(), 'tag_bytes' calculating is // affected by jbd2_has_feature_csum3(), jbd2_has_feature_csum3() // returns false because 'j->j_format_version >= 2' is not true, // then we get wrong next_log_block. The do_one_pass may exit // early whenoccuring non JBD2_MAGIC_NUMBER in 'next_log_block'. The filesystem is corrupted here, journal is partially replayed, and new journal sequence number actually is already used by last mounting. The invalidate_bdev() can drop all buffer heads even racing with bare reading block device(eg. systemd-udev), so we can fix it by invalidating bdev in error handling path in __ext4_fill_super(). Fetch a reproducer in [Link]. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217171 Fixes: 25ed6e8a54df ("jbd2: enable journal clients to enable v2 checksumming") Cc: stable@vger.kernel.org # v3.5 Signed-off-by: Zhihao Cheng Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230315013128.3911115-2-chengzhihao1@huawei.com Signed-off-by: Theodore Ts'o commit 310ee0902b8d9d0a13a5a13e94688a5863fa29c2 Author: Brian Foster Date: Tue Mar 14 09:07:59 2023 -0400 ext4: allow concurrent unaligned dio overwrites We've had reports of significant performance regression of sub-block (unaligned) direct writes due to the added exclusivity restrictions in ext4. The purpose of the exclusivity requirement for unaligned direct writes is to avoid data corruption caused by unserialized partial block zeroing in the iomap dio layer across overlapping writes. XFS has similar requirements for the same underlying reasons, yet doesn't suffer the extreme performance regression that ext4 does. The reason for this is that XFS utilizes IOMAP_DIO_OVERWRITE_ONLY mode, which allows for optimistic submission of concurrent unaligned I/O and kicks back writes that require partial block zeroing such that they can be submitted in a safe, exclusive context. Since ext4 already performs most of these checks pre-submission, it can support something similar without necessarily relying on the iomap flag and associated retry mechanism. Update the dio write submission path to allow concurrent submission of unaligned direct writes that are purely overwrite and so will not require block zeroing. To improve readability of the various related checks, move the unaligned I/O handling down into ext4_dio_write_checks(), where the dio draining and force wait logic can immediately follow the locking requirement checks. Finally, the IOMAP_DIO_OVERWRITE_ONLY flag is set to enable a warning check as a precaution should the ext4 overwrite logic ever become inconsistent with the zeroing expectations of iomap dio. The performance improvement of sub-block direct write I/O is shown in the following fio test on a 64xcpu guest vm: Test: fio --name=test --ioengine=libaio --direct=1 --group_reporting --overwrite=1 --thread --size=10G --filename=/mnt/fio --readwrite=write --ramp_time=10s --runtime=60s --numjobs=8 --blocksize=2k --iodepth=256 --allow_file_create=0 v6.2: write: IOPS=4328, BW=8724KiB/s v6.2 (patched): write: IOPS=801k, BW=1565MiB/s Signed-off-by: Brian Foster Reviewed-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230314130759.642710-1-bfoster@redhat.com Signed-off-by: Theodore Ts'o commit 4c0cfebdf3c34c9cd2c55844f549fa46b1da3164 Author: Theodore Ts'o Date: Thu Jun 8 10:39:35 2023 -0400 ext4: clean up mballoc criteria comments Line wrap and slightly clarify the comments describing mballoc's cirtiera. Define EXT4_MB_NUM_CRS as part of the enum, so that it will automatically get updated when criteria is added or removed. Also fix a potential unitialized use of 'cr' variable if CONFIG_EXT4_DEBUG is enabled. Signed-off-by: Theodore Ts'o commit ab8627e104696b8c1c6953ad5255def5b0821e06 Author: Baokun Li Date: Mon Apr 24 11:38:46 2023 +0800 ext4: make ext4_zeroout_es() return void After ext4_es_insert_extent() returns void, the return value in ext4_zeroout_es() is also unnecessary, so make it return void too. Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-13-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 6c120399cde6b1b5cf65ce403765c579fb3d3e50 Author: Baokun Li Date: Mon Apr 24 11:38:45 2023 +0800 ext4: make ext4_es_insert_extent() return void Now ext4_es_insert_extent() never return error, so make it return void. Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-12-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 8782b020ccbef6c4b62f00c86423f4d37ec60932 Author: Baokun Li Date: Mon Apr 24 11:38:44 2023 +0800 ext4: make ext4_es_insert_delayed_block() return void Now it never fails when inserting a delay extent, so the return value in ext4_es_insert_delayed_block is no longer necessary, let it return void. [ Fixed bug which caused system hangs during bigalloc test runs. See https://lore.kernel.org/r/20230612030405.GH1436857@mit.edu for more details. -- TYT ] Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-11-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit ed5d285b3f2a9a37ff778c5e440daf49351fcc4d Author: Baokun Li Date: Mon Apr 24 11:38:43 2023 +0800 ext4: make ext4_es_remove_extent() return void Now ext4_es_remove_extent() never fails, so make it return void. Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-10-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 2a69c450083db164596c75c0f5b4d9c4c0e18eba Author: Baokun Li Date: Mon Apr 24 11:38:42 2023 +0800 ext4: using nofail preallocation in ext4_es_insert_extent() Similar to in ext4_es_insert_delayed_block(), we use preallocations that do not fail to avoid inconsistencies, but we do not care about es that are not must be kept, and we return 0 even if such es memory allocation fails. Suggested-by: Jan Kara Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-9-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 4a2d98447b37bcb68a7f06a1078edcb4f7e6ce7e Author: Baokun Li Date: Mon Apr 24 11:38:41 2023 +0800 ext4: using nofail preallocation in ext4_es_insert_delayed_block() Similar to in ext4_es_remove_extent(), we use a no-fail preallocation to avoid inconsistencies, except that here we may have to preallocate two extent_status. Suggested-by: Jan Kara Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-8-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit e9fe2b882bd5b26b987c9ba110c2222796f72af5 Author: Baokun Li Date: Mon Apr 24 11:38:40 2023 +0800 ext4: using nofail preallocation in ext4_es_remove_extent() If __es_remove_extent() returns an error it means that when splitting extent, allocating an extent that must be kept failed, where returning an error directly would cause the extent tree to be inconsistent. So we use GFP_NOFAIL to pre-allocate an extent_status and pass it to __es_remove_extent() to avoid this problem. In addition, since the allocated memory is outside the i_es_lock, the extent_status tree may change and the pre-allocated extent_status is no longer needed, so we release the pre-allocated extent_status when es->es_len is not initialized. Suggested-by: Jan Kara Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-7-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit bda3efaf774fb687c2b7a555aaec3006b14a8857 Author: Baokun Li Date: Mon Apr 24 11:38:39 2023 +0800 ext4: use pre-allocated es in __es_remove_extent() When splitting extent, if the second extent can not be dropped, we return -ENOMEM and use GFP_NOFAIL to preallocate an extent_status outside of i_es_lock and pass it to __es_remove_extent() to be used as the second extent. This ensures that __es_remove_extent() is executed successfully, thus ensuring consistency in the extent status tree. If the second extent is not undroppable, we simply drop it and return 0. Then retry is no longer necessary, remove it. Now, __es_remove_extent() will always remove what it should, maybe more. Suggested-by: Jan Kara Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-6-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 95f0b320339a977cf69872eac107122bf536775d Author: Baokun Li Date: Mon Apr 24 11:38:38 2023 +0800 ext4: use pre-allocated es in __es_insert_extent() Pass a extent_status pointer prealloc to __es_insert_extent(). If the pointer is non-null, it is used directly when a new extent_status is needed to avoid memory allocation failures. Suggested-by: Jan Kara Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-5-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 73a2f033656be11298912201ad50615307b4477a Author: Baokun Li Date: Mon Apr 24 11:38:37 2023 +0800 ext4: factor out __es_alloc_extent() and __es_free_extent() Factor out __es_alloc_extent() and __es_free_extent(), which only allocate and free extent_status in these two helpers. The ext4_es_alloc_extent() function is split into __es_alloc_extent() and ext4_es_init_extent(). In __es_alloc_extent() we allocate memory using GFP_KERNEL | __GFP_NOFAIL | __GFP_ZERO if the memory allocation cannot fail, otherwise we use GFP_ATOMIC. and the ext4_es_init_extent() is used to initialize extent_status and update related variables after a successful allocation. This is to prepare for the use of pre-allocated extent_status later. Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-4-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 9649eb18c6288f514cacffdd699d5cd999c2f8f6 Author: Baokun Li Date: Mon Apr 24 11:38:36 2023 +0800 ext4: add a new helper to check if es must be kept In the extent status tree, we have extents which we can just drop without issues and extents we must not drop - this depends on the extent's status - currently ext4_es_is_delayed() extents must stay, others may be dropped. A helper function is added to help determine if the current extent can be dropped, although only ext4_es_is_delayed() extents cannot be dropped currently. Suggested-by: Jan Kara Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-3-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit de25d6e9610a8b30cce9bbb19b50615d02ebca02 Author: Baokun Li Date: Mon Apr 24 11:38:35 2023 +0800 ext4: only update i_reserved_data_blocks on successful block allocation In our fault injection test, we create an ext4 file, migrate it to non-extent based file, then punch a hole and finally trigger a WARN_ON in the ext4_da_update_reserve_space(): EXT4-fs warning (device sda): ext4_da_update_reserve_space:369: ino 14, used 11 with only 10 reserved data blocks When writing back a non-extent based file, if we enable delalloc, the number of reserved blocks will be subtracted from the number of blocks mapped by ext4_ind_map_blocks(), and the extent status tree will be updated. We update the extent status tree by first removing the old extent_status and then inserting the new extent_status. If the block range we remove happens to be in an extent, then we need to allocate another extent_status with ext4_es_alloc_extent(). use old to remove to add new |----------|------------|------------| old extent_status The problem is that the allocation of a new extent_status failed due to a fault injection, and __es_shrink() did not get free memory, resulting in a return of -ENOMEM. Then do_writepages() retries after receiving -ENOMEM, we map to the same extent again, and the number of reserved blocks is again subtracted from the number of blocks in that extent. Since the blocks in the same extent are subtracted twice, we end up triggering WARN_ON at ext4_da_update_reserve_space() because used > ei->i_reserved_data_blocks. For non-extent based file, we update the number of reserved blocks after ext4_ind_map_blocks() is executed, which causes a problem that when we call ext4_ind_map_blocks() to create a block, it doesn't always create a block, but we always reduce the number of reserved blocks. So we move the logic for updating reserved blocks to ext4_ind_map_blocks() to ensure that the number of reserved blocks is updated only after we do succeed in allocating some new blocks. Fixes: 5f634d064c70 ("ext4: Fix quota accounting error with fallocate") Cc: stable@kernel.org Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230424033846.4732-2-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit f52f3d2b9fbab73c776f4d3386393e9bbc83b87d Author: Ojaswin Mujoo Date: Tue May 30 18:03:50 2023 +0530 ext4: Give symbolic names to mballoc criterias mballoc criterias have historically been called by numbers like CR0, CR1... however this makes it confusing to understand what each criteria is about. Change these criterias from numbers to symbolic names and add relevant comments. While we are at it, also reformat and add some comments to ext4_seq_mb_stats_show() for better readability. Additionally, define CR_FAST which signifies the criteria below which we can make quicker decisions like: * quitting early if (free block < requested len) * avoiding to scan free extents smaller than required len. * avoiding to initialize buddy cache and work with existing cache * limiting prefetches Suggested-by: Jan Kara Signed-off-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/a2dc6ec5aea5e5e68cf8e788c2a964ffead9c8b0.1685449706.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 7e170922f06bf46effa7c57f6035fc463d6edc7e Author: Ojaswin Mujoo Date: Tue May 30 18:03:49 2023 +0530 ext4: Add allocation criteria 1.5 (CR1_5) CR1_5 aims to optimize allocations which can't be satisfied in CR1. The fact that we couldn't find a group in CR1 suggests that it would be difficult to find a continuous extent to compleltely satisfy our allocations. So before falling to the slower CR2, in CR1.5 we proactively trim the the preallocations so we can find a group with (free / fragments) big enough. This speeds up our allocation at the cost of slightly reduced preallocation. The patch also adds a new sysfs tunable: * /sys/fs/ext4//mb_cr1_5_max_trim_order This controls how much CR1.5 can trim a request before falling to CR2. For example, for a request of order 7 and max trim order 2, CR1.5 can trim this upto order 5. Suggested-by: Ritesh Harjani (IBM) Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/150fdf65c8e4cc4dba71e020ce0859bcf636a5ff.1685449706.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 856d865c178b4fbf4c629d5a7d0df9352d123280 Author: Ojaswin Mujoo Date: Tue May 30 18:03:48 2023 +0530 ext4: Abstract out logic to search average fragment list Make the logic of searching average fragment list of a given order reusable by abstracting it out to a differnet function. This will also avoid code duplication in upcoming patches. No functional changes. Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/028c11d95b17ce0285f45456709a0ca922df1b83.1685449706.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 4f3d1e4533b0982034f316ace85415d3bc57e3da Author: Ojaswin Mujoo Date: Tue May 30 18:03:47 2023 +0530 ext4: Ensure ext4_mb_prefetch_fini() is called for all prefetched BGs Before this patch, the call stack in ext4_run_li_request is as follows: /* * nr = no. of BGs we want to fetch (=s_mb_prefetch) * prefetch_ios = no. of BGs not uptodate after * ext4_read_block_bitmap_nowait() */ next_group = ext4_mb_prefetch(sb, group, nr, prefetch_ios); ext4_mb_prefetch_fini(sb, next_group prefetch_ios); ext4_mb_prefetch_fini() will only try to initialize buddies for BGs in range [next_group - prefetch_ios, next_group). This is incorrect since sometimes (prefetch_ios < nr), which causes ext4_mb_prefetch_fini() to incorrectly ignore some of the BGs that might need initialization. This issue is more notable now with the previous patch enabling "fetching" of BLOCK_UNINIT BGs which are marked buffer_uptodate by default. Fix this by passing nr to ext4_mb_prefetch_fini() instead of prefetch_ios so that it considers the right range of groups. Similarly, make sure we don't pass nr=0 to ext4_mb_prefetch_fini() in ext4_mb_regular_allocator() since we might have prefetched BLOCK_UNINIT groups that would need buddy initialization. Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/05e648ae04ec5b754207032823e9c1de9a54f87a.1685449706.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 3c6296046c85333bc52555a670a9093d9e2657bb Author: Ojaswin Mujoo Date: Tue May 30 18:03:46 2023 +0530 ext4: Don't skip prefetching BLOCK_UNINIT groups Currently, ext4_mb_prefetch() and ext4_mb_prefetch_fini() skip BLOCK_UNINIT groups since fetching their bitmaps doesn't need disk IO. As a consequence, we end not initializing the buddy structures and CR0/1 lists for these BGs, even though it can be done without any disk IO overhead. Hence, don't skip such BGs during prefetch and prefetch_fini. This improves the accuracy of CR0/1 allocation as earlier, we could have essentially empty BLOCK_UNINIT groups being ignored by CR0/1 due to their buddy not being initialized, leading to slower CR2 allocations. With this patch CR0/1 will be able to discover these groups as well, thus improving performance. Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/dc3130b8daf45ffe63d8a3c1edcf00eb8ba70e1f.1685449706.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 1b420011210802a7a1b1e99f30bc1d62c352ac71 Author: Ojaswin Mujoo Date: Tue May 30 18:03:45 2023 +0530 ext4: Avoid scanning smaller extents in BG during CR1 When we are inside ext4_mb_complex_scan_group() in CR1, we can be sure that this group has atleast 1 big enough continuous free extent to satisfy our request because (free / fragments) > goal length. Hence, instead of wasting time looping over smaller free extents, only try to consider the free extent if we are sure that it has enough continuous free space to satisfy goal length. This is particularly useful when scanning highly fragmented BGs in CR1 as, without this patch, the allocator might stop scanning early before reaching the big enough free extent (due to ac_found > mb_max_to_scan) which causes us to uncessarily trim the request. Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/a5473df4517c53ec940bc9b603ef83a547032a32.1685449706.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 3ef5d263879696027c70548532a94418aad3bd95 Author: Ojaswin Mujoo Date: Tue May 30 18:03:44 2023 +0530 ext4: Add counter to track successful allocation of goal length Track number of allocations where the length of blocks allocated is equal to the length of goal blocks (post normalization). This metric could be useful if making changes to the allocator logic in the future as it could give us visibility into how often do we trim our requests. PS: ac_b_ex.fe_len might get modified due to preallocation efforts and hence we use ac_f_ex.fe_len instead since we want to compare how much the allocator was able to actually find. Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/343620e2be8a237239ea2613a7a866ee8607e973.1685449706.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit fdd9a00943a5f6687937628e01506dad697c9140 Author: Ojaswin Mujoo Date: Tue May 30 18:03:43 2023 +0530 ext4: Add per CR extent scanned counter This gives better visibility into the number of extents scanned in each particular CR. For example, this information can be used to see how out block group scanning logic is performing when the BG is fragmented. Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/55bb6d80f6e22ed2a5a830aa045572bdffc8b1b9.1685449706.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 4eb7a4a1a33bdaf259fca8528f2546c90ad18f0d Author: Ojaswin Mujoo Date: Tue May 30 18:03:42 2023 +0530 ext4: Convert mballoc cr (criteria) to enum Convert criteria to be an enum so it easier to maintain and update the tracefiles to use enum names. This change also makes it easier to insert new criterias in the future. There is no functional change in this patch. Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/5d82fd467bdf70ea45bdaef810af3b146013946c.1685449706.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 5730cce35344fba94e2c329d2bc0a170333a059f Author: Ritesh Harjani Date: Tue May 30 18:03:41 2023 +0530 ext4: Remove unused extern variables declaration ext4_mb_stats & ext4_mb_max_to_scan are never used. We use sbi->s_mb_stats and sbi->s_mb_max_to_scan instead. Hence kill these extern declarations. Signed-off-by: Ritesh Harjani (IBM) Signed-off-by: Ojaswin Mujoo Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/928b3142062172533b6d1b5a94de94700590fef3.1685449706.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 569f196f1e7a14472f21734170411f75a3179db0 Author: Ritesh Harjani Date: Tue May 30 18:03:40 2023 +0530 ext4: mballoc: Remove useless setting of ac_criteria There will be changes coming in future patches which will introduce a new criteria for block allocation. This removes the useless setting of ac_criteria. AFAIU, this might be only used to differentiate between whether a preallocated blocks was allocated or was regular allocator called for allocating blocks. Hence this also adds the debug prints to identify what type of block allocation was done in ext4_mb_show_ac(). Signed-off-by: Ritesh Harjani (IBM) Signed-off-by: Ojaswin Mujoo Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/1dbae05617519cb6202f1b299c9d1be3e7cda763.1685449706.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit 2ec6d0a5ea72689a79e6f725fd8b443a788ae279 Author: Kemeng Shi Date: Sat Jun 3 23:03:19 2023 +0800 ext4: fix wrong unit use in ext4_mb_new_blocks Function ext4_free_blocks_simple needs count in cluster. Function ext4_free_blocks accepts count in block. Convert count to cluster to fix the mismatch. Signed-off-by: Kemeng Shi Cc: stable@kernel.org Reviewed-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230603150327.3596033-12-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 247c3d214c23dfeeeb892e91a82ac1188bdaec9f Author: Kemeng Shi Date: Sat Jun 3 23:03:18 2023 +0800 ext4: fix wrong unit use in ext4_mb_clear_bb Function ext4_issue_discard need count in cluster. Pass count_clusters instead of count to fix the mismatch. Signed-off-by: Kemeng Shi Cc: stable@kernel.org Reviewed-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230603150327.3596033-11-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit ad78b5efe4246e5deba8d44a6ed172b8a00d3113 Author: Kemeng Shi Date: Sat Jun 3 23:03:17 2023 +0800 ext4: remove unused parameter from ext4_mb_new_blocks_simple() Two cleanups for ext4_mb_new_blocks_simple: Remove unused parameter handle of ext4_mb_new_blocks_simple. Move ext4_mb_new_blocks_simple definition before ext4_mb_new_blocks to remove unnecessary forward declaration of ext4_mb_new_blocks_simple. Signed-off-by: Kemeng Shi Reviewed-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230603150327.3596033-10-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 5dfe7a7e52ccdf60dfd11ccbe509e4365ea721ca Merge: 36db314440502 94142c9d1bdf1 Author: Linus Torvalds Date: Mon Jun 26 16:32:47 2023 -0700 Merge tag 'x86_tdx_for_6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 tdx updates from Dave Hansen: - Fix a race window where load_unaligned_zeropad() could cause a fatal shutdown during TDX private<=>shared conversion The race has never been observed in practice but might allow load_unaligned_zeropad() to catch a TDX page in the middle of its conversion process which would lead to a fatal and unrecoverable guest shutdown. - Annotate sites where VM "exit reasons" are reused as hypercall numbers. * tag 'x86_tdx_for_6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Fix enc_status_change_finish_noop() x86/tdx: Fix race between set_memory_encrypted() and load_unaligned_zeropad() x86/mm: Allow guest.enc_status_change_prepare() to fail x86/tdx: Wrap exit reason with hcall_func() commit 1240dabe8d58b4eff09e7edf1560da0360f997aa Author: Masahiro Yamada Date: Mon Jun 26 03:16:23 2023 +0900 kbuild: deb-pkg: remove the CONFIG_MODULES check in buildeb When CONFIG_MODULES is disabled for ARCH=um, 'make (bin)deb-pkg' fails with an error like follows: cp: cannot create regular file 'debian/linux-image/usr/lib/uml/modules/6.4.0-rc2+/System.map': No such file or directory Remove the CONFIG_MODULES check completely so ${pdir}/usr/lib/uml/modules will always be created and modules.builtin.(modinfo) will be installed under it for ARCH=um. Fixes: b611daae5efc ("kbuild: deb-pkg: split image and debug objects staging out into functions") Signed-off-by: Masahiro Yamada commit 4243afdb932677a03770753be8c54b3190a512e8 Author: Josh Triplett Date: Thu Jun 22 12:19:53 2023 -0700 kbuild: builddeb: always make modules_install, to install modules.builtin* Even for a non-modular kernel, the kernel builds modules.builtin and modules.builtin.modinfo, with information about the built-in modules. Tools such as initramfs-tools need these files to build a working initramfs on some systems, such as those requiring firmware. Now that `make modules_install` works even in non-modular kernels and installs these files, unconditionally invoke it when building a Debian package. Signed-off-by: Josh Triplett Reviewed-by: Nicolas Schier Signed-off-by: Masahiro Yamada commit ff1c6c904c8dd265e62abd8adf301bf755e203de Merge: 3973bcc95e744 5619c2ddaf3ff Author: Stephen Boyd Date: Mon Jun 26 16:29:58 2023 -0700 Merge tag 'clk-microchip-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into clk-microchip Pull Microchip clk driver updates from Claudiu Beznea: It contains support for parent_data, parent_hw in AT91 clock drivers used by SAMA7G5 SoC (e.g. main, master, generic, peripheral, programmable, system, utmi, slow clocks) and also the update of SAMA7G5 to use this new support. * tag 'clk-microchip-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: clk: at91: sama7g5: s/ep_chg_chg_id/ep_chg_id clk: at91: sama7g5: switch to parent_hw and parent_data clk: at91: sckc: switch to parent_data/parent_hw clk: at91: clk-sam9x60-pll: add support for parent_hw clk: at91: clk-utmi: add support for parent_hw clk: at91: clk-system: add support for parent_hw clk: at91: clk-programmable: add support for parent_hw clk: at91: clk-peripheral: add support for parent_hw clk: at91: clk-master: add support for parent_hw clk: at91: clk-generated: add support for parent_hw clk: at91: clk-main: add support for parent_data/parent_hw commit 36db314440502c1a3a283ba5a16cb5075c19f3d9 Merge: a3d763f0b34d9 73b3108dfd9d5 Author: Linus Torvalds Date: Mon Jun 26 16:26:44 2023 -0700 Merge tag 'x86_platform_for_6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 platform updates from Dave Hansen: "Allow CPUs in SGX/HPE Ultraviolet to start using Sub-NUMA clustering (SNC) mode. SNC has been around outside the UV world for a while but evidently never worked on UV systems. SNC is rather notorious for breaking bad assumptions of a 1:1 relationship between physical sockets and NUMA nodes. The UV code was rather prolific with these assumptions and took quite a bit of refactoring to remove them" * tag 'x86_platform_for_6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/platform/uv: Update UV[23] platform code for SNC x86/platform/uv: Remove remaining BUG_ON() and BUG() calls x86/platform/uv: UV support for sub-NUMA clustering x86/platform/uv: Helper functions for allocating and freeing conversion tables x86/platform/uv: When searching for minimums, start at INT_MAX not 99999 x86/platform/uv: Fix printed information in calc_mmioh_map x86/platform/uv: Introduce helper function uv_pnode_to_socket. x86/platform/uv: Add platform resolving #defines for misc GAM_MMIOH_REDIRECT* commit a3d763f0b34d94a4f2b2e3075350a19d589630f3 Merge: 941d77c77339d 504dba50b0c3f Author: Linus Torvalds Date: Mon Jun 26 16:24:40 2023 -0700 Merge tag 'x86_irq_for_6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 irq updates from Dave Hansen: "Add Hyper-V interrupts to /proc/stat" * tag 'x86_irq_for_6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/irq: Add hardcoded hypervisor interrupts to /proc/stat commit 941d77c77339d2dd1cda8911da63da3c67e90860 Merge: 2c96136a3f8da f220125b999b2 Author: Linus Torvalds Date: Mon Jun 26 15:42:34 2023 -0700 Merge tag 'x86_cpu_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cpu updates from Borislav Petkov: - Compute the purposeful misalignment of zen_untrain_ret automatically and assert __x86_return_thunk's alignment so that future changes to the symbol macros do not accidentally break them. - Remove CONFIG_X86_FEATURE_NAMES Kconfig option as its existence is pointless * tag 'x86_cpu_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/retbleed: Add __x86_return_thunk alignment checks x86/cpu: Remove X86_FEATURE_NAMES x86/Kconfig: Make X86_FEATURE_NAMES non-configurable in prompt commit 2c96136a3f8dad6bfe35b003fb8b312f13a107e8 Merge: 3e5822e0f99e4 84b9b44b99780 Author: Linus Torvalds Date: Mon Jun 26 15:32:39 2023 -0700 Merge tag 'x86_cc_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 confidential computing update from Borislav Petkov: - Add support for unaccepted memory as specified in the UEFI spec v2.9. The gist of it all is that Intel TDX and AMD SEV-SNP confidential computing guests define the notion of accepting memory before using it and thus preventing a whole set of attacks against such guests like memory replay and the like. There are a couple of strategies of how memory should be accepted - the current implementation does an on-demand way of accepting. * tag 'x86_cc_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: virt: sevguest: Add CONFIG_CRYPTO dependency x86/efi: Safely enable unaccepted memory in UEFI x86/sev: Add SNP-specific unaccepted memory support x86/sev: Use large PSC requests if applicable x86/sev: Allow for use of the early boot GHCB for PSC requests x86/sev: Put PSC struct on the stack in prep for unaccepted memory support x86/sev: Fix calculation of end address based on number of pages x86/tdx: Add unaccepted memory support x86/tdx: Refactor try_accept_one() x86/tdx: Make _tdx_hypercall() and __tdx_module_call() available in boot stub efi/unaccepted: Avoid load_unaligned_zeropad() stepping into unaccepted memory efi: Add unaccepted memory support x86/boot/compressed: Handle unaccepted memory efi/libstub: Implement support for unaccepted memory efi/x86: Get full memory map in allocate_e820() mm: Add support for unaccepted memory commit 3e5822e0f99e429fa8b03c956dad890179b5b3b1 Merge: 59035135b3228 e0a6ede2dd884 Author: Linus Torvalds Date: Mon Jun 26 15:29:21 2023 -0700 Merge tag 'x86_cache_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 resource control updates from Borislav Petkov: - Implement a rename operation in resctrlfs to facilitate handling of application containers with dynamically changing task lists - When reading the tasks file, show the tasks' pid which are only in the current namespace as opposed to showing the pids from the init namespace too - Other fixes and improvements * tag 'x86_cache_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Documentation/x86: Documentation for MON group move feature x86/resctrl: Implement rename op for mon groups x86/resctrl: Factor rdtgroup lock for multi-file ops x86/resctrl: Only show tasks' pid in current pid namespace commit 59035135b32280fd394ba5765c6f4de24f48353e Merge: 8c69e7afe9588 9d9173e9ceb63 Author: Linus Torvalds Date: Mon Jun 26 15:25:07 2023 -0700 Merge tag 'x86_build_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 build update from Borislav Petkov: - Remove relocation information from vmlinux as it is not needed by other tooling and thus a slimmer binary is generated. This is important for distros who have to distribute vmlinux blobs with their kernel packages too and that extraneous unnecessary data bloats them for no good reason * tag 'x86_build_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/build: Avoid relocation information in final vmlinux commit bf4ed21778f2920ca91a32fd3a1e1130e843e98f Merge: feee70f456865 8c9cce9cb81b5 Author: Dmitry Torokhov Date: Mon Jun 26 15:18:13 2023 -0700 Merge branch 'next' into for-linus Prepare input updates for 6.5 merge window. commit 8c69e7afe9588f9259a6422c6619d7643c76d12c Merge: aa35a4835e4f4 2bd4aa9325821 Author: Linus Torvalds Date: Mon Jun 26 15:14:55 2023 -0700 Merge tag 'x86_alternatives_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 instruction alternatives updates from Borislav Petkov: - Up until now the Fast Short Rep Mov optimizations implied the presence of the ERMS CPUID flag. AMD decoupled them with a BIOS setting so decouple that dependency in the kernel code too - Teach the alternatives machinery to handle relocations - Make debug_alternative accept flags in order to see only that set of patching done one is interested in - Other fixes, cleanups and optimizations to the patching code * tag 'x86_alternatives_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/alternative: PAUSE is not a NOP x86/alternatives: Add cond_resched() to text_poke_bp_batch() x86/nospec: Shorten RESET_CALL_DEPTH x86/alternatives: Add longer 64-bit NOPs x86/alternatives: Fix section mismatch warnings x86/alternative: Optimize returns patching x86/alternative: Complicate optimize_nops() some more x86/alternative: Rewrite optimize_nops() some x86/lib/memmove: Decouple ERMS from FSRM x86/alternative: Support relocations in alternatives x86/alternative: Make debug-alternative selective commit 11b6890be0084ad4df0e06d89a9fdcc948472c65 Author: Kemeng Shi Date: Sat Jun 3 23:03:16 2023 +0800 ext4: get block from bh in ext4_free_blocks for fast commit replay ext4_free_blocks will retrieve block from bh if block parameter is zero. Retrieve block before ext4_free_blocks_simple to avoid potentially passing wrong block to ext4_free_blocks_simple. Signed-off-by: Kemeng Shi Cc: stable@kernel.org Reviewed-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230603150327.3596033-9-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit aa35a4835e4f4c113c29bc7ea64cfecb951d51b8 Merge: e5ce2f196fb9a 4251566ebc1cf Author: Linus Torvalds Date: Mon Jun 26 15:09:18 2023 -0700 Merge tag 'ras_core_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull RAS updates from Borislav Petkov: - Add initial support for RAS hardware found on AMD server GPUs (MI200). Those GPUs and CPUs are connected together through the coherent fabric and the GPU memory controllers report errors through x86's MCA so EDAC needs to support them. The amd64_edac driver supports now HBM (High Bandwidth Memory) and thus such heterogeneous memory controller systems - Other small cleanups and improvements * tag 'ras_core_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: EDAC/amd64: Cache and use GPU node map EDAC/amd64: Add support for AMD heterogeneous Family 19h Model 30h-3Fh EDAC/amd64: Document heterogeneous system enumeration x86/MCE/AMD, EDAC/mce_amd: Decode UMC_V2 ECC errors x86/amd_nb: Re-sort and re-indent PCI defines x86/amd_nb: Add MI200 PCI IDs ras/debugfs: Fix error checking for debugfs_create_dir() x86/MCE: Check a hw error's address to determine proper recovery action commit e5ce2f196fb9ab35fe18dcfd2bc17883db7bbe33 Merge: 88afbb21d4b36 852667c317ae2 Author: Linus Torvalds Date: Mon Jun 26 15:06:42 2023 -0700 Merge tag 'edac_updates_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC updates from Borislav Petkov: - amd64_edac: Add support for Zen4 client hardware - amd64_edac: Remove the version string as it is useless and actively confusing when looking at backported versions of the driver - Add a driver for the Nuvoton NPCM memory controller - A debugfs error checking cleanup * tag 'edac_updates_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/npcm: Add NPCM memory controller driver dt-bindings: memory-controllers: nuvoton: Add NPCM memory controller EDAC/thunderx: Check debugfs file creation retval properly EDAC/amd64: Add support for ECC on family 19h model 60h-7Fh EDAC/amd64: Remove module version string commit 7ed1cefbf169367bae5b356ecd15928b040aeafc Merge: ac9a78681b921 e5d10d1d1aa4c Author: Stephen Boyd Date: Mon Jun 26 14:56:06 2023 -0700 Merge tag 'qcom-clk-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom Pull Qualcomm clk driver updates from Bjorn Andersson: This introduces Global Clock Controller for SDX75, LPASS clock controllers for SC8280XP, video clock controller for SM8350, SM8450 and SM8550, GPU clock controller for SM8450 and SM8550, RPMH clock support for SDX75 and IPQ9574 support in APSS IPQ PLL driver. Support for branch2 clocks with inverted off-bit is introduced and a couple of fixes to Alpha PLLs handling of TEST_CTL updates. The handling of active-only clocks in SMD RPM is improved, to ensure votes are appropriately placed. SC7180 camera GDSCs are made children of the titan_top GDSC. A couple of fixes to the display clocks on QCM2290 and shared RCGs in GCC are marked as such. SDCC clocks for IPQ6018 and IPQ5332 are corrected to use floor ops, and network-related resets on IPQ6018 are updated to cover all bits of each reset. Crypto clocks are added to IPQ9574 global clock controller, together with a few cleanups. Runtime PM is enabeld for SC8280XP GCC and GPUCC, and SM6375 GPUCC. A few fixes for MSM8974 multi-media clock controller. Support for some RCG clocks to be automatically controlled by downstream branches, and added to SM8450 GCC clocks. Further Kconfig depdenencies are introduce to avoid building Qualcomm clock drivers on unrelated architectures. Lastly, related DeviceTree binding updates are made. The tail of this is not bisectable, due to the missing DeviceTree binding include files. Rebase at this point in time is not desirable. * tag 'qcom-clk-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (63 commits) clk: qcom: gcc-sc8280xp: Add runtime PM clk: qcom: gpucc-sc8280xp: Add runtime PM clk: qcom: mmcc-msm8974: fix MDSS_GDSC power flags clk: qcom: gpucc-sm6375: Enable runtime pm dt-bindings: clock: sm6375-gpucc: Add VDD_GX clk: qcom: gcc-sm6115: Add missing PLL config properties clk: qcom: clk-alpha-pll: Add a way to update some bits of test_ctl(_hi) clk: qcom: gcc-ipq6018: remove duplicate initializers clk: qcom: gcc-ipq9574: Enable crypto clocks dt-bindings: clock: Add crypto clock and reset definitions clk: qcom: Add lpass audio clock controller driver for SC8280XP clk: qcom: Add lpass clock controller driver for SC8280XP dt-bindings: clock: Add LPASS AUDIOCC and reset controller for SC8280XP dt-bindings: clock: Add LPASSCC and reset controller for SC8280XP dt-bindings: clock: qcom,mmcc: define clocks/clock-names for MSM8226 clk: qcom: gpucc-sm8550: Add support for graphics clock controller clk: qcom: Add support for SM8450 GPUCC clk: qcom: gcc-sm8450: Enable hw_clk_ctrl clk: qcom: rcg2: Make hw_clk_ctrl toggleable dt-bindings: clock: qcom: Add SM8550 graphics clock controller ... commit 88afbb21d4b36fee6acaa167641f9f0fc122f01b Merge: cd336f6562d3d 45e34c8af58f2 Author: Linus Torvalds Date: Mon Jun 26 14:45:53 2023 -0700 Merge tag 'x86-core-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 core updates from Thomas Gleixner: "A set of fixes for kexec(), reboot and shutdown issues: - Ensure that the WBINVD in stop_this_cpu() has been completed before the control CPU proceedes. stop_this_cpu() is used for kexec(), reboot and shutdown to park the APs in a HLT loop. The control CPU sends an IPI to the APs and waits for their CPU online bits to be cleared. Once they all are marked "offline" it proceeds. But stop_this_cpu() clears the CPU online bit before issuing WBINVD, which means there is no guarantee that the AP has reached the HLT loop. This was reported to cause intermittent reboot/shutdown failures due to some dubious interaction with the firmware. This is not only a problem of WBINVD. The code to actually "stop" the CPU which runs between clearing the online bit and reaching the HLT loop can cause large enough delays on its own (think virtualization). That's especially dangerous for kexec() as kexec() expects that all APs are in a safe state and not executing code while the boot CPU jumps to the new kernel. There are more issues vs kexec() which are addressed separately. Cure this by implementing an explicit synchronization point right before the AP reaches HLT. This guarantees that the AP has completed the full stop proceedure. - Fix the condition for WBINVD in stop_this_cpu(). The WBINVD in stop_this_cpu() is required for ensuring that when switching to or from memory encryption no dirty data is left in the cache lines which might cause a write back in the wrong more later. This checks CPUID directly because the feature bit might have been cleared due to a command line option. But that CPUID check accesses leaf 0x8000001f::EAX unconditionally. Intel CPUs return the content of the highest supported leaf when a non-existing leaf is read, while AMD CPUs return all zeros for unsupported leafs. So the result of the test on Intel CPUs is lottery and on AMD its just correct by chance. While harmless it's incorrect and causes the conditional wbinvd() to be issued where not required, which caused the above issue to be unearthed. - Make kexec() robust against AP code execution Ashok observed triple faults when doing kexec() on a system which had been booted with "nosmt". It turned out that the SMT siblings which had been brought up partially are parked in mwait_play_dead() to enable power savings. mwait_play_dead() is monitoring the thread flags of the AP's idle task, which has been chosen as it's unlikely to be written to. But kexec() can overwrite the previous kernel text and data including page tables etc. When it overwrites the cache lines monitored by an AP that AP resumes execution after the MWAIT on eventually overwritten text, stack and page tables, which obviously might end up in a triple fault easily. Make this more robust in several steps: 1) Use an explicit per CPU cache line for monitoring. 2) Write a command to these cache lines to kick APs out of MWAIT before proceeding with kexec(), shutdown or reboot. The APs confirm the wakeup by writing status back and then enter a HLT loop. 3) If the system uses INIT/INIT/STARTUP for AP bringup, park the APs in INIT state. HLT is not a guarantee that an AP won't wake up and resume execution. HLT is woken up by NMI and SMI. SMI puts the CPU back into HLT (+/- firmware bugs), but NMI is delivered to the CPU which executes the NMI handler. Same issue as the MWAIT scenario described above. Sending an INIT/INIT sequence to the APs puts them into wait for STARTUP state, which is safe against NMI. There is still an issue remaining which can't be fixed: #MCE If the AP sits in HLT and receives a broadcast #MCE it will try to handle it with the obvious consequences. INIT/INIT clears CR4.MCE in the AP which will cause a broadcast #MCE to shut down the machine. So there is a choice between fire (HLT) and frying pan (INIT). Frying pan has been chosen as it's at least preventing the NMI issue. On systems which are not using INIT/INIT/STARTUP there is not much which can be done right now, but at least the obvious and easy to trigger MWAIT issue has been addressed" * tag 'x86-core-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/smp: Put CPUs into INIT on shutdown if possible x86/smp: Split sending INIT IPI out into a helper function x86/smp: Cure kexec() vs. mwait_play_dead() breakage x86/smp: Use dedicated cache-line for mwait_play_dead() x86/smp: Remove pointless wmb()s from native_stop_other_cpus() x86/smp: Dont access non-existing CPUID leaf x86/smp: Make stop_other_cpus() more robust commit cd336f6562d3d7646a9cf071b902db200a1dd77b Merge: 9244724fbf8ab d2b32be7debd6 Author: Linus Torvalds Date: Mon Jun 26 14:10:45 2023 -0700 Merge tag 'timers-core-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer updates from Thomas Gleixner: "Time, timekeeping and related device driver updates: Core: - A set of fixes, cleanups and enhancements to the posix timer code: - Prevent another possible live lock scenario in the exit() path, which affects POSIX_CPU_TIMERS_TASK_WORK enabled architectures. - Fix a loop termination issue which was reported syzcaller/KSAN in the posix timer ID allocation code. That triggered a deeper look into the posix-timer code which unearthed more small issues. - Add missing READ/WRITE_ONCE() annotations - Fix or remove completely outdated comments - Document places which are subtle and completely undocumented. - Add missing hrtimer modes to the trace event decoder - Small cleanups and enhancements all over the place Drivers: - Rework the Hyper-V clocksource and sched clock setup code - Remove a deprecated clocksource driver - Small fixes and enhancements all over the place" * tag 'timers-core-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits) clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe dt-bindings: timers: Add Ralink SoCs timer clocksource/drivers/hyper-v: Rework clocksource and sched clock setup dt-bindings: timer: brcm,kona-timer: convert to YAML clocksource/drivers/imx-gpt: Fold into its only user clk: imx: Drop inclusion of unused header hrtimer: Add missing sparse annotations to hrtimer locking clocksource/drivers/imx-gpt: Use only a single name for functions clocksource/drivers/loongson1: Move PWM timer to clocksource framework dt-bindings: timer: Add Loongson-1 clocksource MIPS: Loongson32: Remove deprecated PWM timer clocksource clocksource/drivers/ingenic-timer: Use pm_sleep_ptr() macro tracing/timer: Add missing hrtimer modes to decode_hrtimer_mode(). posix-timers: Add sys_ni_posix_timers() prototype tick/rcu: Fix bogus ratelimit condition alarmtimer: Remove unnecessary (void *) cast alarmtimer: Remove unnecessary initialization of variable 'ret' posix-timers: Refer properly to CONFIG_HIGH_RES_TIMERS posix-timers: Polish coding style in a few places posix-timers: Remove pointless comments ... commit 9244724fbf8ab394a7210e8e93bf037abc859514 Merge: 7cffdbe3607a6 bf5a8c26ad7ca Author: Linus Torvalds Date: Mon Jun 26 13:59:56 2023 -0700 Merge tag 'smp-core-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull SMP updates from Thomas Gleixner: "A large update for SMP management: - Parallel CPU bringup The reason why people are interested in parallel bringup is to shorten the (kexec) reboot time of cloud servers to reduce the downtime of the VM tenants. The current fully serialized bringup does the following per AP: 1) Prepare callbacks (allocate, intialize, create threads) 2) Kick the AP alive (e.g. INIT/SIPI on x86) 3) Wait for the AP to report alive state 4) Let the AP continue through the atomic bringup 5) Let the AP run the threaded bringup to full online state There are two significant delays: #3 The time for an AP to report alive state in start_secondary() on x86 has been measured in the range between 350us and 3.5ms depending on vendor and CPU type, BIOS microcode size etc. #4 The atomic bringup does the microcode update. This has been measured to take up to ~8ms on the primary threads depending on the microcode patch size to apply. On a two socket SKL server with 56 cores (112 threads) the boot CPU spends on current mainline about 800ms busy waiting for the APs to come up and apply microcode. That's more than 80% of the actual onlining procedure. This can be reduced significantly by splitting the bringup mechanism into two parts: 1) Run the prepare callbacks and kick the AP alive for each AP which needs to be brought up. The APs wake up, do their firmware initialization and run the low level kernel startup code including microcode loading in parallel up to the first synchronization point. (#1 and #2 above) 2) Run the rest of the bringup code strictly serialized per CPU (#3 - #5 above) as it's done today. Parallelizing that stage of the CPU bringup might be possible in theory, but it's questionable whether required surgery would be justified for a pretty small gain. If the system is large enough the first AP is already waiting at the first synchronization point when the boot CPU finished the wake-up of the last AP. That reduces the AP bringup time on that SKL from ~800ms to ~80ms, i.e. by a factor ~10x. The actual gain varies wildly depending on the system, CPU, microcode patch size and other factors. There are some opportunities to reduce the overhead further, but that needs some deep surgery in the x86 CPU bringup code. For now this is only enabled on x86, but the core functionality obviously works for all SMP capable architectures. - Enhancements for SMP function call tracing so it is possible to locate the scheduling and the actual execution points. That allows to measure IPI delivery time precisely" * tag 'smp-core-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip: (45 commits) trace,smp: Add tracepoints for scheduling remotelly called functions trace,smp: Add tracepoints around remotelly called functions MAINTAINERS: Add CPU HOTPLUG entry x86/smpboot: Fix the parallel bringup decision x86/realmode: Make stack lock work in trampoline_compat() x86/smp: Initialize cpu_primary_thread_mask late cpu/hotplug: Fix off by one in cpuhp_bringup_mask() x86/apic: Fix use of X{,2}APIC_ENABLE in asm with older binutils x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it x86/smpboot: Support parallel startup of secondary CPUs x86/smpboot: Implement a bit spinlock to protect the realmode stack x86/apic: Save the APIC virtual base address cpu/hotplug: Allow "parallel" bringup up to CPUHP_BP_KICK_AP_STATE x86/apic: Provide cpu_primary_thread mask x86/smpboot: Enable split CPU startup cpu/hotplug: Provide a split up CPUHP_BRINGUP mechanism cpu/hotplug: Reset task stack state in _cpu_up() cpu/hotplug: Remove unused state functions riscv: Switch to hotplug core state synchronization parisc: Switch to hotplug core state synchronization ... commit 7cffdbe3607a6cc2dc02d135e13732ec36bc4e28 Merge: 0017387938993 0a9567ac5e6a4 Author: Linus Torvalds Date: Mon Jun 26 13:39:10 2023 -0700 Merge tag 'x86-boot-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 boot updates from Thomas Gleixner: "Initialize FPU late. Right now FPU is initialized very early during boot. There is no real requirement to do so. The only requirement is to have it done before alternatives are patched. That's done in check_bugs() which does way more than what the function name suggests. So first rename check_bugs() to arch_cpu_finalize_init() which makes it clear what this is about. Move the invocation of arch_cpu_finalize_init() earlier in start_kernel() as it has to be done before fork_init() which needs to know the FPU register buffer size. With those prerequisites the FPU initialization can be moved into arch_cpu_finalize_init(), which removes it from the early and fragile part of the x86 bringup" * tag 'x86-boot-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mem_encrypt: Unbreak the AMD_MEM_ENCRYPT=n build x86/fpu: Move FPU initialization into arch_cpu_finalize_init() x86/fpu: Mark init functions __init x86/fpu: Remove cpuinfo argument from init functions x86/init: Initialize signal frame size late init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init() init: Invoke arch_cpu_finalize_init() earlier init: Remove check_bugs() leftovers um/cpu: Switch to arch_cpu_finalize_init() sparc/cpu: Switch to arch_cpu_finalize_init() sh/cpu: Switch to arch_cpu_finalize_init() mips/cpu: Switch to arch_cpu_finalize_init() m68k/cpu: Switch to arch_cpu_finalize_init() loongarch/cpu: Switch to arch_cpu_finalize_init() ia64/cpu: Switch to arch_cpu_finalize_init() ARM: cpu: Switch to arch_cpu_finalize_init() x86/cpu: Switch to arch_cpu_finalize_init() init: Provide arch_cpu_finalize_init() commit 0017387938993553fe8e08bd9bcf398fb609d136 Merge: cef2dd76531fd f121ab7f4ac32 Author: Linus Torvalds Date: Mon Jun 26 13:34:39 2023 -0700 Merge tag 'irq-core-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq updates from Thomas Gleixner: "Updates for the interrupt subsystem: Core: - Convert the interrupt descriptor storage to a maple tree to overcome the limitations of the radixtree + fixed size bitmap. This allows us to handle very large servers with a huge number of guests without imposing a huge memory overhead on everyone - Implement optional retriggering of interrupts which utilize the fasteoi handler to work around a GICv3 architecture issue Drivers: - A set of fixes and updates for the Loongson/Loongarch related drivers - Workaound for an ASR8601 integration hickup which ends up with CPU numbering which can't be represented in the GIC implementation - The usual set of boring fixes and updates all over the place" * tag 'irq-core-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits) Revert "irqchip/mxs: Include linux/irqchip/mxs.h" irqchip/jcore-aic: Fix missing allocation of IRQ descriptors irqchip/stm32-exti: Fix warning on initialized field overwritten irqchip/stm32-exti: Add STM32MP15xx IWDG2 EXTI to GIC map irqchip/gicv3: Add a iort_pmsi_get_dev_id() prototype irqchip/mxs: Include linux/irqchip/mxs.h irqchip/clps711x: Remove unused clps711x_intc_init() function irqchip/mmp: Remove non-DT codepath irqchip/ftintc010: Mark all function static irqdomain: Include internals.h for function prototypes irqchip/loongson-eiointc: Add DT init support dt-bindings: interrupt-controller: Add Loongson EIOINTC irqchip/loongson-eiointc: Fix irq affinity setting during resume irqchip/loongson-liointc: Add IRQCHIP_SKIP_SET_WAKE flag irqchip/loongson-liointc: Fix IRQ trigger polarity irqchip/loongson-pch-pic: Fix potential incorrect hwirq assignment irqchip/loongson-pch-pic: Fix initialization of HT vector register irqchip/gic-v3-its: Enable RESEND_WHEN_IN_PROGRESS for LPIs genirq: Allow fasteoi handler to resend interrupts on concurrent handling genirq: Expand doc for PENDING and REPLAY flags ... commit cef2dd76531fda106fa698b6b7ee3e87b1622c08 Merge: a0433f8cae3ac 8b64d420fe245 Author: Linus Torvalds Date: Mon Jun 26 13:33:00 2023 -0700 Merge tag 'core-debugobjects-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull debugobjects update from Thomas Gleixner: "A single update for debug objects: - Recheck whether debug objects is enabled before reporting a problem to avoid spamming the logs with messages which are caused by a concurrent OOM" * tag 'core-debugobjects-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip: debugobjects: Recheck debug_objects_enabled before reporting commit 61dc651cdfe85066e1371dd1bd8aee685bd6ec75 Merge: 771ca3de25028 a412dbf40ff37 Author: Jakub Kicinski Date: Mon Jun 26 12:59:18 2023 -0700 Merge tag 'nf-next-23-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Pablo Neira Ayuso says: ==================== Netfilter/IPVS updates for net-next 1) Allow slightly larger IPVS connection table size from Kconfig for 64-bit arch, from Abhijeet Rastogi. 2) Since IPVS connection table might be larger than 2^20 after previous patch, allow to limit it depending on the available memory. Moreover, use kvmalloc. From Julian Anastasov. 3) Do not rebuild VLAN header in nft_payload when matching source and destination MAC address. 4) Remove nested rcu read lock side in ip_set_test(), from Florian Westphal. 5) Allow to update set size, also from Florian. 6) Improve NAT tuple selection when connection is closing, from Florian Westphal. 7) Support for resetting set element stateful expression, from Phil Sutter. 8) Use NLA_POLICY_MAX to narrow down maximum attribute value in nf_tables, from Florian Westphal. * tag 'nf-next-23-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next: netfilter: nf_tables: limit allowed range via nla_policy netfilter: nf_tables: Introduce NFT_MSG_GETSETELEM_RESET netfilter: snat: evict closing tcp entries on reply tuple collision netfilter: nf_tables: permit update of set size netfilter: ipset: remove rcu_read_lock_bh pair from ip_set_test netfilter: nft_payload: rebuild vlan header when needed ipvs: dynamically limit the connection hash table ipvs: increase ip_vs_conn_tab_bits range for 64BIT ==================== Link: https://lore.kernel.org/r/20230626064749.75525-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit a0433f8cae3ac51f59b4b1863032822aaa2d8164 Merge: 0aa69d53ac7c3 fcaa174a9c995 Author: Linus Torvalds Date: Mon Jun 26 12:47:20 2023 -0700 Merge tag 'for-6.5/block-2023-06-23' of git://git.kernel.dk/linux Pull block updates from Jens Axboe: - NVMe pull request via Keith: - Various cleanups all around (Irvin, Chaitanya, Christophe) - Better struct packing (Christophe JAILLET) - Reduce controller error logs for optional commands (Keith) - Support for >=64KiB block sizes (Daniel Gomez) - Fabrics fixes and code organization (Max, Chaitanya, Daniel Wagner) - bcache updates via Coly: - Fix a race at init time (Mingzhe Zou) - Misc fixes and cleanups (Andrea, Thomas, Zheng, Ye) - use page pinning in the block layer for dio (David) - convert old block dio code to page pinning (David, Christoph) - cleanups for pktcdvd (Andy) - cleanups for rnbd (Guoqing) - use the unchecked __bio_add_page() for the initial single page additions (Johannes) - fix overflows in the Amiga partition handling code (Michael) - improve mq-deadline zoned device support (Bart) - keep passthrough requests out of the IO schedulers (Christoph, Ming) - improve support for flush requests, making them less special to deal with (Christoph) - add bdev holder ops and shutdown methods (Christoph) - fix the name_to_dev_t() situation and use cases (Christoph) - decouple the block open flags from fmode_t (Christoph) - ublk updates and cleanups, including adding user copy support (Ming) - BFQ sanity checking (Bart) - convert brd from radix to xarray (Pankaj) - constify various structures (Thomas, Ivan) - more fine grained persistent reservation ioctl capability checks (Jingbo) - misc fixes and cleanups (Arnd, Azeem, Demi, Ed, Hengqi, Hou, Jan, Jordy, Li, Min, Yu, Zhong, Waiman) * tag 'for-6.5/block-2023-06-23' of git://git.kernel.dk/linux: (266 commits) scsi/sg: don't grab scsi host module reference ext4: Fix warning in blkdev_put() block: don't return -EINVAL for not found names in devt_from_devname cdrom: Fix spectre-v1 gadget block: Improve kernel-doc headers blk-mq: don't insert passthrough request into sw queue bsg: make bsg_class a static const structure ublk: make ublk_chr_class a static const structure aoe: make aoe_class a static const structure block/rnbd: make all 'class' structures const block: fix the exclusive open mask in disk_scan_partitions block: add overflow checks for Amiga partition support block: change all __u32 annotations to __be32 in affs_hardblocks.h block: fix signed int overflow in Amiga partition support block: add capacity validation in bdev_add_partition() block: fine-granular CAP_SYS_ADMIN for Persistent Reservation block: disallow Persistent Reservation on partitions reiserfs: fix blkdev_put() warning from release_journal_dev() block: fix wrong mode for blkdev_get_by_dev() from disk_scan_partitions() block: document the holder argument to blkdev_get_by_path ... commit 0aa69d53ac7c30f6184f88f2e310d808b32b35a5 Merge: 3eccc0c886b17 c98c81a4ac37b Author: Linus Torvalds Date: Mon Jun 26 12:30:26 2023 -0700 Merge tag 'for-6.5/io_uring-2023-06-23' of git://git.kernel.dk/linux Pull io_uring updates from Jens Axboe: "Nothing major in this release, just a bunch of cleanups and some optimizations around networking mostly. - clean up file request flags handling (Christoph) - clean up request freeing and CQ locking (Pavel) - support for using pre-registering the io_uring fd at setup time (Josh) - Add support for user allocated ring memory, rather than having the kernel allocate it. Mostly for packing rings into a huge page (me) - avoid an unnecessary double retry on receive (me) - maintain ordering for task_work, which also improves performance (me) - misc cleanups/fixes (Pavel, me)" * tag 'for-6.5/io_uring-2023-06-23' of git://git.kernel.dk/linux: (39 commits) io_uring: merge conditional unlock flush helpers io_uring: make io_cq_unlock_post static io_uring: inline __io_cq_unlock io_uring: fix acquire/release annotations io_uring: kill io_cq_unlock() io_uring: remove IOU_F_TWQ_FORCE_NORMAL io_uring: don't batch task put on reqs free io_uring: move io_clean_op() io_uring: inline io_dismantle_req() io_uring: remove io_free_req_tw io_uring: open code io_put_req_find_next io_uring: add helpers to decode the fixed file file_ptr io_uring: use io_file_from_index in io_msg_grab_file io_uring: use io_file_from_index in __io_sync_cancel io_uring: return REQ_F_ flags from io_file_get_flags io_uring: remove io_req_ffs_set io_uring: remove a confusing comment above io_file_get_flags io_uring: remove the mode variable in io_file_get_flags io_uring: remove __io_file_supports_nowait io_uring: wait interruptibly for request completions on exit ... commit 3eccc0c886b1796f95a289c9d127c8ca1a254bd5 Merge: cc423f6337d0a 9eee8bd81421c Author: Linus Torvalds Date: Mon Jun 26 11:52:12 2023 -0700 Merge tag 'for-6.5/splice-2023-06-23' of git://git.kernel.dk/linux Pull splice updates from Jens Axboe: "This kills off ITER_PIPE to avoid a race between truncate, iov_iter_revert() on the pipe and an as-yet incomplete DMA to a bio with unpinned/unref'ed pages from an O_DIRECT splice read. This causes memory corruption. Instead, we either use (a) filemap_splice_read(), which invokes the buffered file reading code and splices from the pagecache into the pipe; (b) copy_splice_read(), which bulk-allocates a buffer, reads into it and then pushes the filled pages into the pipe; or (c) handle it in filesystem-specific code. Summary: - Rename direct_splice_read() to copy_splice_read() - Simplify the calculations for the number of pages to be reclaimed in copy_splice_read() - Turn do_splice_to() into a helper, vfs_splice_read(), so that it can be used by overlayfs and coda to perform the checks on the lower fs - Make vfs_splice_read() jump to copy_splice_read() to handle direct-I/O and DAX - Provide shmem with its own splice_read to handle non-existent pages in the pagecache. We don't want a ->read_folio() as we don't want to populate holes, but filemap_get_pages() requires it - Provide overlayfs with its own splice_read to call down to a lower layer as overlayfs doesn't provide ->read_folio() - Provide coda with its own splice_read to call down to a lower layer as coda doesn't provide ->read_folio() - Direct ->splice_read to copy_splice_read() in tty, procfs, kernfs and random files as they just copy to the output buffer and don't splice pages - Provide wrappers for afs, ceph, ecryptfs, ext4, f2fs, nfs, ntfs3, ocfs2, orangefs, xfs and zonefs to do locking and/or revalidation - Make cifs use filemap_splice_read() - Replace pointers to generic_file_splice_read() with pointers to filemap_splice_read() as DIO and DAX are handled in the caller; filesystems can still provide their own alternate ->splice_read() op - Remove generic_file_splice_read() - Remove ITER_PIPE and its paraphernalia as generic_file_splice_read was the only user" * tag 'for-6.5/splice-2023-06-23' of git://git.kernel.dk/linux: (31 commits) splice: kdoc for filemap_splice_read() and copy_splice_read() iov_iter: Kill ITER_PIPE splice: Remove generic_file_splice_read() splice: Use filemap_splice_read() instead of generic_file_splice_read() cifs: Use filemap_splice_read() trace: Convert trace/seq to use copy_splice_read() zonefs: Provide a splice-read wrapper xfs: Provide a splice-read wrapper orangefs: Provide a splice-read wrapper ocfs2: Provide a splice-read wrapper ntfs3: Provide a splice-read wrapper nfs: Provide a splice-read wrapper f2fs: Provide a splice-read wrapper ext4: Provide a splice-read wrapper ecryptfs: Provide a splice-read wrapper ceph: Provide a splice-read wrapper afs: Provide a splice-read wrapper 9p: Add splice_read wrapper net: Make sock_splice_read() use copy_splice_read() by default tty, proc, kernfs, random: Use copy_splice_read() ... commit cc423f6337d0a5ff1906f3b3d465d28c0d1705f6 Merge: e940efa936be6 8a4a0b2a3eaf7 Author: Linus Torvalds Date: Mon Jun 26 11:41:38 2023 -0700 Merge tag 'for-6.5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs updates from David Sterba: "Mainly core changes, refactoring and optimizations. Performance is improved in some areas, overall there may be a cumulative improvement due to refactoring that removed lookups in the IO path or simplified IO submission tracking. Core: - submit IO synchronously for fast checksums (crc32c and xxhash), remove high priority worker kthread - read extent buffer in one go, simplify IO tracking, bio submission and locking - remove additional tracking of redirtied extent buffers, originally added for zoned mode but actually not needed - track ordered extent pointer in bio to avoid rbtree lookups during IO - scrub, use recovered data stripes as cache to avoid unnecessary read - in zoned mode, optimize logical to physical mappings of extents - remove PageError handling, not set by VFS nor writeback - cleanups, refactoring, better structure packing - lots of error handling improvements - more assertions, lockdep annotations - print assertion failure with the exact line where it happens - tracepoint updates - more debugging prints Performance: - speedup in fsync(), better tracking of inode logged status can avoid transaction commit - IO path structures track logical offsets in data structures and does not need to look it up User visible changes: - don't commit transaction for every created subvolume, this can reduce time when many subvolumes are created in a batch - print affected files when relocation fails - trigger orphan file cleanup during START_SYNC ioctl Notable fixes: - fix crash when disabling quota and relocation - fix crashes when removing roots from drity list - fix transacion abort during relocation when converting from newer profiles not covered by fallback - in zoned mode, stop reclaiming block groups if filesystem becomes read-only - fix rare race condition in tree mod log rewind that can miss some btree node slots - with enabled fsverity, drop up-to-date page bit in case the verification fails" * tag 'for-6.5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (194 commits) btrfs: fix race between quota disable and relocation btrfs: add comment to struct btrfs_fs_info::dirty_cowonly_roots btrfs: fix race when deleting free space root from the dirty cow roots list btrfs: fix race when deleting quota root from the dirty cow roots list btrfs: tracepoints: also show actual number of the outstanding extents btrfs: update i_version in update_dev_time btrfs: make btrfs_compressed_bioset static btrfs: add handling for RAID1C23/DUP to btrfs_reduce_alloc_profile btrfs: scrub: remove btrfs_fs_info::scrub_wr_completion_workers btrfs: scrub: remove scrub_ctx::csum_list member btrfs: do not BUG_ON after failure to migrate space during truncation btrfs: do not BUG_ON on failure to get dir index for new snapshot btrfs: send: do not BUG_ON() on unexpected symlink data extent btrfs: do not BUG_ON() when dropping inode items from log root btrfs: replace BUG_ON() at split_item() with proper error handling btrfs: do not BUG_ON() on tree mod log failures at btrfs_del_ptr() btrfs: do not BUG_ON() on tree mod log failures at insert_ptr() btrfs: do not BUG_ON() on tree mod log failure at insert_new_root() btrfs: do not BUG_ON() on tree mod log failures at push_nodes_for_insert() btrfs: abort transaction at update_ref_for_cow() when ref count is zero ... commit e940efa936be65866db9ce20798b13fdc6b3891a Merge: 098c5dd9cf96f 8812387d05695 Author: Linus Torvalds Date: Mon Jun 26 11:29:29 2023 -0700 Merge tag 'zonefs-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs Pull zonefs updates from Damien Le Moal: - Modify the synchronous direct write path to use iomap instead of manually coding issuing zone append write BIOs (me) - Use the FMODE_CAN_ODIRECT file flag to indicate support from direct IO instead of using the old way with noop direct_io methods (Christoph) * tag 'zonefs-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: zonefs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method zonefs: use iomap for synchronous direct writes commit 7aa83fbd712a6f08ffa67890061f26d140c2a84f Author: Douglas Anderson Date: Tue Jun 13 06:58:13 2023 -0700 drm/bridge: ti-sn65dsi86: Fix auxiliary bus lifetime Memory for the "struct device" for any given device isn't supposed to be released until the device's release() is called. This is important because someone might be holding a kobject reference to the "struct device" and might try to access one of its members even after any other cleanup/uninitialization has happened. Code analysis of ti-sn65dsi86 shows that this isn't quite right. When the code was written, it was believed that we could rely on the fact that the child devices would all be freed before the parent devices and thus we didn't need to worry about a release() function. While I still believe that the parent's "struct device" is guaranteed to outlive the child's "struct device" (because the child holds a kobject reference to the parent), the parent's "devm" allocated memory is a different story. That appears to be freed much earlier. Let's make this better for ti-sn65dsi86 by allocating each auxiliary with kzalloc and then free that memory in the release(). Fixes: bf73537f411b ("drm/bridge: ti-sn65dsi86: Break GPIO and MIPI-to-eDP bridge into sub-drivers") Suggested-by: Stephen Boyd Reviewed-by: Stephen Boyd Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230613065812.v2.1.I24b838a5b4151fb32bccd6f36397998ea2df9fbb@changeid commit 098c5dd9cf96fc6d7f35429561ef58cd7c5fcecf Merge: 74774e243c5ff 8241fdd3cdfe8 Author: Linus Torvalds Date: Mon Jun 26 11:00:18 2023 -0700 Merge tag 'erofs-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs updates from Gao Xiang: "No outstanding new feature for this cycle. Most of these commits are decompression cleanups which are part of the ongoing development for subpage/folio compression support as well as xattr cleanups for the upcoming xattr bloom filter optimization [1]. In addition, there are bugfixes to address some corner cases of compressed images due to global data de-duplication and arm64 16k pages. Summary: - Fix rare I/O hang on deduplicated compressed images due to loop hooked chains - Fix compact compression layout of 16k blocks on arm64 devices - Fix atomic context detection of async decompression - Decompression/Xattr code cleanups" Link: https://lore.kernel.org/r/20230621083209.116024-1-jefflexu@linux.alibaba.com [1] * tag 'erofs-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: clean up zmap.c erofs: remove unnecessary goto erofs: Fix detection of atomic context erofs: use separate xattr parsers for listxattr/getxattr erofs: unify inline/shared xattr iterators for listxattr/getxattr erofs: make the size of read data stored in buffer_ofs erofs: unify xattr_iter structures erofs: use absolute position in xattr iterator erofs: fix compact 4B support for 16k block size erofs: convert erofs_read_metabuf() to erofs_bread() for xattr erofs: use poison pointer to replace the hard-coded address erofs: use struct lockref to replace handcrafted approach erofs: adapt managed inode operations into folios erofs: kill hooked chains to avoid loops on deduplicated compressed images erofs: avoid on-stack pagepool directly passed by arguments erofs: allocate extra bvec pages directly instead of retrying erofs: clean up z_erofs_pcluster_readmore() erofs: remove the member readahead from struct z_erofs_decompress_frontend erofs: fold in z_erofs_decompress() commit 6ecac465eee887de7ceda7ffe3bccf538eb786bc Merge: d8c226ac1f748 afbb9130d2bf0 Author: Bjorn Helgaas Date: Mon Jun 26 13:00:00 2023 -0500 Merge branch 'pci/controller/remove-void-callbacks' - Convert platform_device .remove() callbacks to return void instead of a mostly useless int (Uwe Kleine-König) * pci/controller/remove-void-callbacks: PCI: xgene-msi: Convert to platform remove callback returning void PCI: tegra: Convert to platform remove callback returning void PCI: rockchip-host: Convert to platform remove callback returning void PCI: mvebu: Convert to platform remove callback returning void PCI: mt7621: Convert to platform remove callback returning void PCI: mediatek-gen3: Convert to platform remove callback returning void PCI: mediatek: Convert to platform remove callback returning void PCI: iproc: Convert to platform remove callback returning void PCI: hisi-error: Convert to platform remove callback returning void PCI: dwc: Convert to platform remove callback returning void PCI: j721e: Convert to platform remove callback returning void PCI: brcmstb: Convert to platform remove callback returning void PCI: altera-msi: Convert to platform remove callback returning void PCI: altera: Convert to platform remove callback returning void PCI: aardvark: Convert to platform remove callback returning void commit d8c226ac1f748d0eac54ef869a4f41b26bc4f825 Merge: b5abb12cdd297 061cbfab09fb3 Author: Bjorn Helgaas Date: Mon Jun 26 13:00:00 2023 -0500 Merge branch 'pci/controller/endpoint' - Change "PCI Endpoint Virtual NTB driver" Kconfig prompt to be different from "PCI Endpoint NTB driver" (Shunsuke Mie) - Automatically create a function specific attributes group for endpoint drivers to avoid reference counting issues (Damien Le Moal) - Move and unexport pci_epf_type_add_cfs() (Damien Le Moal) - Reinitialize EPF test DMA transfer completion before submitting it to avoid losing the completion notification (Damien Le Moal) - Fix EPF test DMA transfer completion detection (Damien Le Moal) - Submit EPF test DMA transfers with dmaengine_submit(), not tx_submit() (Damien Le Moal) - Simplify EPF test read/write/copy functions (Damien Le Moal) - Simplify EPF test "raise IRQ" interface (Damien Le Moal) - Simplify EPF test IRQ command execution (Damien Le Moal) - Improve EPF test command/status register handling (Damien Le Moal) - Free IRQs before removing device (Damien Le Moal) - Reinitialize IRQ completions for every test (Damien Le Moal) - Don't write status in IRQ handler to avoid race (Damien Le Moal) - Fix dma_chan direction in data transfer test (Yoshihiro Shimoda) - Return pci_epf_type_add_cfs() error if EPF has no driver (Damien Le Moal) - Add kernel-doc for pci_epc_raise_irq() and pci_epc_map_msi_irq() MSI vector parameters (Manivannan Sadhasivam) - Pass EPF device ID to driver probe functions (Manivannan Sadhasivam) - Return -EALREADY if EPC has already been started/stopped (Manivannan Sadhasivam) - Add linkdown notifier support and use it in qcom-ep (Manivannan Sadhasivam) - Add Bus Master Enable event support and use it in qcom-ep (Manivannan Sadhasivam) - Add Qualcomm Modem Host Interface (MHI) endpoint driver (Manivannan Sadhasivam) - Add Layerscape PME interrupt handling to manage link-up notification (Frank Li) * pci/controller/endpoint: PCI: layerscape: Add the endpoint linkup notifier support PCI: endpoint: pci-epf-vntb: Fix typo in comments MAINTAINERS: Add PCI MHI endpoint function driver under MHI bus PCI: endpoint: Add PCI Endpoint function driver for MHI bus PCI: qcom-ep: Add support for BME notification PCI: qcom-ep: Add support for Link down notification PCI: endpoint: Add BME notifier support PCI: endpoint: Add linkdown notifier support PCI: endpoint: Return error if EPC is started/stopped multiple times PCI: endpoint: Pass EPF device ID to the probe function PCI: endpoint: Add missing documentation about the MSI/MSI-X range PCI: endpoint: Improve pci_epf_type_add_cfs() PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction misc: pci_endpoint_test: Simplify pci_endpoint_test_msi_irq() misc: pci_endpoint_test: Do not write status in IRQ handler misc: pci_endpoint_test: Re-init completion for every test misc: pci_endpoint_test: Free IRQs before removing the device PCI: epf-test: Simplify transfers result print PCI: epf-test: Simplify DMA support checks PCI: epf-test: Cleanup request result handling PCI: epf-test: Cleanup pci_epf_test_cmd_handler() PCI: epf-test: Improve handling of command and status registers PCI: epf-test: Simplify IRQ test commands execution PCI: epf-test: Simplify pci_epf_test_raise_irq() PCI: epf-test: Simplify read/write/copy test functions PCI: epf-test: Use dmaengine_submit() to initiate DMA transfer PCI: epf-test: Fix DMA transfer completion detection PCI: epf-test: Fix DMA transfer completion initialization PCI: endpoint: Move pci_epf_type_add_cfs() code PCI: endpoint: Automatically create a function specific attributes group PCI: endpoint: Fix a Kconfig prompt of vNTB driver commit b5abb12cdd297339b30e95bc3e5e8e26723cf923 Merge: 9f5eb1bf55121 0c0206dc4f5ba Author: Bjorn Helgaas Date: Mon Jun 26 12:59:59 2023 -0500 Merge branch 'pci/controller/vmd' - Reset VMD config register between soft reboots (Nirmal Patel) - Capture pci_reset_bus() return value instead of printing junk when it fails (Xinghui Li) * pci/controller/vmd: PCI: vmd: Fix uninitialized variable usage in vmd_enable_domain() PCI: vmd: Reset VMD config register between soft reboots commit 9f5eb1bf55121a5729c7ca27b4276b51d4ae3048 Merge: 9cd5f2cec7e51 7e6689b34a815 Author: Bjorn Helgaas Date: Mon Jun 26 12:59:59 2023 -0500 Merge branch 'pci/controller/rockchip' - Remove writes to unused registers (Rick Wertenbroek) - Write endpoint Device ID using correct register (Rick Wertenbroek) - Assert PCI Configuration Enable bit after probe so endpoint responds instead of generating Request Retry Status messages (Rick Wertenbroek) - Poll waiting for PHY PLLs to lock (Rick Wertenbroek) - Update RK3399 example DT binding to be valid (Rick Wertenbroek) - Use RK3399 PCIE_CLIENT_LEGACY_INT_CTRL to generate INTx instead of manually generating PCIe message (Rick Wertenbroek) - Use multiple windows to avoid address translation conflicts (Rick Wertenbroek) - Use u32 (not u16) when accessing 32-bit registers (Rick Wertenbroek) - Hide MSI-X Capability, since RK3399 can't generate MSI-X (Rick Wertenbroek) - Set endpoint controller required alignment to 256 (Damien Le Moal) * pci/controller/rockchip: PCI: rockchip: Set address alignment for endpoint mode PCI: rockchip: Don't advertise MSI-X in PCIe capabilities PCI: rockchip: Use u32 variable to access 32-bit registers PCI: rockchip: Fix window mapping and address translation for endpoint PCI: rockchip: Fix legacy IRQ generation for RK3399 PCIe endpoint core dt-bindings: PCI: Update the RK3399 example to a valid one PCI: rockchip: Add poll and timeout to wait for PHY PLLs to be locked PCI: rockchip: Assert PCI Configuration Enable bit after probe PCI: rockchip: Write PCI Device ID to correct register PCI: rockchip: Remove writes to unused registers commit 9cd5f2cec7e51c7254cda228e6b9950e994be401 Merge: 5c13b3c19a726 e28e75e9f5893 Author: Bjorn Helgaas Date: Mon Jun 26 12:59:59 2023 -0500 Merge branch 'pci/controller/rcar' - Remove unused static pcie_base and pcie_dev (Geert Uytterhoeven) * pci/controller/rcar: PCI: rcar: Use correct product family name for Renesas R-Car PCI: rcar-host: Remove unused static pcie_base and pcie_dev commit 5c13b3c19a726fc0918ef221759bd225dadb1923 Merge: 69fa3ef3d2699 1fdecc5bc8e81 Author: Bjorn Helgaas Date: Mon Jun 26 12:59:59 2023 -0500 Merge branch 'pci/controller/qcom' - Disable register write access after init for IP v2.3.3, v2.9.0 (Manivannan Sadhasivam) - Use DWC helpers for enabling/disabling writes to DBI registers (Manivannan Sadhasivam) - Hide slot hotplug capability for IP v1.0.0, v1.9.0, v2.1.0, v2.3.2, v2.3.3, v2.7.0, v2.9.0 (Manivannan Sadhasivam) - Reuse v2.3.2 post-init sequence for v2.4.0 (Manivannan Sadhasivam) - * pci/controller/qcom: PCI: qcom: Do not advertise hotplug capability for IP v2.1.0 PCI: qcom: Do not advertise hotplug capability for IP v1.0.0 PCI: qcom: Use post init sequence of IP v2.3.2 for v2.4.0 PCI: qcom: Do not advertise hotplug capability for IP v2.3.2 PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0 PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0 PCI: qcom: Disable write access to read only registers for IP v2.9.0 PCI: qcom: Use DWC helpers for modifying the read-only DBI registers PCI: qcom: Disable write access to read only registers for IP v2.3.3 commit 69fa3ef3d2699acdf0ac917cc070c0e9cfd61b74 Merge: 99f7b809067be c60738de85f40 Author: Bjorn Helgaas Date: Mon Jun 26 12:59:58 2023 -0500 Merge branch 'pci/pci/ftpci100' - Release clock resources on error paths (Junyan Ye) * pci/pci/ftpci100: PCI: ftpci100: Release the clock resources commit 99f7b809067be43141027f4bbb6af7b55f854554 Merge: 375328faa2c54 3bbc3c72c4b89 Author: Bjorn Helgaas Date: Mon Jun 26 12:59:58 2023 -0500 Merge branch 'pci/controller/dwc' - Wait for link to come up only if we've initiated link training (Ajay Agarwal) - Save and restore imx6 Root Port MSI control to work around hardware defect (Richard Zhu) * pci/controller/dwc: PCI: imx6: Save and restore root port MSI control in suspend and resume PCI: dwc: Wait for link up only if link is started commit 375328faa2c546f28719c68a3d88e043e878debd Merge: 41370553c01b4 0e12f83023692 Author: Bjorn Helgaas Date: Mon Jun 26 12:59:58 2023 -0500 Merge branch 'pci/controller/cadence' - Wait for link retrain to complete when working around the J721E i2085 erratum with Gen2 mode (Siddharth Vadapalli) * pci/controller/cadence: PCI: cadence: Fix Gen2 Link Retraining process commit 41370553c01b4a0ff8663db9badc9232262c55ea Merge: 30fec3b884589 c0aba9f328019 Author: Bjorn Helgaas Date: Mon Jun 26 12:59:57 2023 -0500 Merge branch 'pci/controller/dt' - Add Qualcomm SDX65 endpoint DT compatible string (Rohit Agarwal) * pci/controller/dt: dt-bindings: PCI: qcom: Add SDX65 SoC commit 30fec3b884589b6cd9f441c139220c5eb2ed55d3 Merge: 283810ac54a2b b58d6d89ae020 Author: Bjorn Helgaas Date: Mon Jun 26 12:59:57 2023 -0500 Merge branch 'pci/misc' - Add pci_clear_master() stub for non-CONFIG_PCI (Sui Jingfeng) - Correct documentation typos (Randy Dunlap) * pci/misc: Documentation: PCI: correct spelling PCI: Add pci_clear_master() stub for non-CONFIG_PCI PCI: Expand comment about sorting pci_ids.h entries commit 283810ac54a2b8a179fd4f30fd9f05907b397fcd Merge: d0b7b3a422f1f 88d341716b83a Author: Bjorn Helgaas Date: Mon Jun 26 12:59:57 2023 -0500 Merge branch 'pci/virtualization' - Delay extra 250ms after FLR of Solidigm P44 Pro NVMe to avoid KVM hang when guest is rebooted (Mike Pastore) - Add function 1 DMA alias quirk for Marvell 88SE9235 (Robin Murphy) * pci/virtualization: PCI: Add function 1 DMA alias quirk for Marvell 88SE9235 PCI: Delay after FLR of Solidigm P44 Pro NVMe commit d0b7b3a422f1f550a1bac9fc3404196c10232d14 Merge: 7e229f0e054b1 e54223275ba1b Author: Bjorn Helgaas Date: Mon Jun 26 12:59:57 2023 -0500 Merge branch 'pci/resource' - When we coalesce host bridge windows, remove invalidated resources from the resource tree so future allocations work correctly (Ross Lagerwall) * pci/resource: PCI: Release resource invalidated by coalescing commit 7e229f0e054b148f9bf8eb9f70b8b18ee4677936 Merge: db5ccb2eda47a 112a7f9c8edbf Author: Bjorn Helgaas Date: Mon Jun 26 12:59:56 2023 -0500 Merge branch 'pci/pm' - Reduce wait time for secondary bus to be ready to speed up resume (Mika Westerberg) - Avoid putting EloPOS E2/S2/H2 (as well as Elo i2) PCIe Ports in D3cold (Ondrej Zary) - Call _REG when transitioning D-states so AML that uses the PCI config space OpRegion works, which fixes some ASMedia GPIO controllers (Mario Limonciello) * pci/pm: PCI/ACPI: Call _REG when transitioning D-states PCI/ACPI: Validate acpi_pci_set_power_state() parameter PCI/PM: Avoid putting EloPOS E2/S2/H2 PCIe Ports in D3cold PCI/PM: Shorten pci_bridge_wait_for_secondary_bus() wait time for slow links commit db5ccb2eda47ab4ec5ac6cece0032d75a995d5a4 Merge: 1abb47390350a 40613da52b13f Author: Bjorn Helgaas Date: Mon Jun 26 12:59:56 2023 -0500 Merge branch 'pci/hotplug' - Simplify Attention Button logging (Bjorn Helgaas) - Cancel bringup sequence if card is not present, to keep from blinking Power Indicator indefinitely (Rongguang Wei) - Reassign bridge resources if necessary for ACPI hotplug (Igor Mammedov) * pci/hotplug: PCI: acpiphp: Reassign resources on bridge if necessary PCI: pciehp: Cancel bringup sequence if card is not present PCI: pciehp: Simplify Attention Button logging commit 1abb47390350a1bd5430390e296492e6248865b2 Merge: 0f32114ea0747 08e3ed12ca861 Author: Bjorn Helgaas Date: Mon Jun 26 12:59:56 2023 -0500 Merge branch 'pci/enumeration' - Add PCI_EXT_CAP_ID_PL_32GT define (Ben Dooks) - Propagate firmware node by calling device_set_node() for better modularity (Andy Shevchenko) - Discover Data Link Layer Link Active Reporting earlier so quirks can take advantage of it (Maciej W. Rozycki) - Use cached Data Link Layer Link Active Reporting capability in pciehp, powerpc/eeh, and mlx5 (Maciej W. Rozycki) - Run quirk for devices that require OS to clear Retrain Link earlier, so later quirks can rely on it (Maciej W. Rozycki) - Export pcie_retrain_link() for use outside ASPM (Maciej W. Rozycki) - Add Data Link Layer Link Active Reporting as another way for pcie_retrain_link() to determine the link is up (Maciej W. Rozycki) - Work around link training failures (especially on the ASMedia ASM2824 switch) by training first at 2.5GT/s and then attempting higher rates (Maciej W. Rozycki) * pci/enumeration: PCI: Add failed link recovery for device reset events PCI: Work around PCIe link training failures PCI: Use pcie_wait_for_link_status() in pcie_wait_for_link_delay() PCI: Add support for polling DLLLA to pcie_retrain_link() PCI: Export pcie_retrain_link() for use outside ASPM PCI: Export PCIe link retrain timeout PCI: Execute quirk_enable_clear_retrain_link() earlier PCI/ASPM: Factor out waiting for link training to complete PCI/ASPM: Avoid unnecessary pcie_link_state use PCI/ASPM: Use distinct local vars in pcie_retrain_link() net/mlx5: Rely on dev->link_active_reporting powerpc/eeh: Rely on dev->link_active_reporting PCI: pciehp: Rely on dev->link_active_reporting PCI: Initialize dev->link_active_reporting earlier PCI: of: Propagate firmware node by calling device_set_node() PCI: Add PCI_EXT_CAP_ID_PL_32GT define # Conflicts: # drivers/pci/pcie/aspm.c commit 0f32114ea0747ed94be2618cdfd073a90a026550 Merge: a274a4e65f78c e7e39756363ad Author: Bjorn Helgaas Date: Mon Jun 26 12:59:55 2023 -0500 Merge branch 'pci/aspm' - Disable ASPM on MFD function removal to avoid use-after-free (Ding Hui) - Tighten up pci_enable_link_state() and pci_disable_link_state() interfaces so they don't enable/disable states the driver didn't specify (Ajay Agarwal) - Avoid link retraining race that can happen if ASPM sets link control parameters while the link is in the midst of training for some other reason (Ilpo Järvinen) * pci/aspm: PCI/ASPM: Avoid link retraining race PCI/ASPM: Factor out pcie_wait_for_retrain() PCI/ASPM: Return 0 or -ETIMEDOUT from pcie_retrain_link() PCI/ASPM: Remove unnecessary ASPM_STATE_L1SS check PCI/ASPM: Rename L1.2-specific functions from 'l1ss' to 'l12' PCI/ASPM: Set ASPM_STATE_L1 when driver enables L1.1 or L1.2 PCI/ASPM: Set only ASPM_STATE_L1 when driver enables L1 PCI/ASPM: Disable only ASPM_STATE_L1 when driver disables L1 PCI/ASPM: Disable ASPM on MFD function removal to avoid use-after-free commit a274a4e65f78cc892c207780b9d3a4fc560e88f1 Merge: ac9a78681b921 11502feab423c Author: Bjorn Helgaas Date: Mon Jun 26 12:59:55 2023 -0500 Merge branch 'pci/aer' - Unexport pci_save_aer_state() since it's only used in drivers/pci/ (Bjorn Helgaas) - Drop recommendation for drivers to configure AER Capability, since the PCI core does this for all devices (Dave Jiang, Bjorn Helgaas) * pci/aer: Documentation: PCI: Tidy AER documentation Documentation: PCI: Update cross references to .rst files Documentation: PCI: Drop recommendation to configure AER Capability PCI: Unexport pci_save_aer_state() commit 74774e243c5ff0903df22dff67be01f2d4a7f00c Merge: 4d483ab702c5c 672d6ef4c775c Author: Linus Torvalds Date: Mon Jun 26 10:56:13 2023 -0700 Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux Pull fsverity updates from Eric Biggers: "Several updates for fs/verity/: - Do all hashing with the shash API instead of with the ahash API. This simplifies the code and reduces API overhead. It should also make things slightly easier for XFS's upcoming support for fsverity. It does drop fsverity's support for off-CPU hash accelerators, but that support was incomplete and not known to be used - Update and export fsverity_get_digest() so that it's ready for overlayfs's upcoming support for fsverity checking of lowerdata - Improve the documentation for builtin signature support - Fix a bug in the large folio support" * tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux: fsverity: improve documentation for builtin signature support fsverity: rework fsverity_get_digest() again fsverity: simplify error handling in verify_data_block() fsverity: don't use bio_first_page_all() in fsverity_verify_bio() fsverity: constify fsverity_hash_alg fsverity: use shash API instead of ahash API commit 4d483ab702c5cd5e8953a123e0aab734af09cc77 Merge: f7976a6493b3f d617ef039fb8e Author: Linus Torvalds Date: Mon Jun 26 10:54:55 2023 -0700 Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux Pull fscrypt update from Eric Biggers: "Just one flex array conversion patch" * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux: fscrypt: Replace 1-element array with flexible array commit f7976a6493b3f00c4d057a37d9e63c322154ef8c Merge: c0a572d9d32fe 75bfb70457a4c Author: Linus Torvalds Date: Mon Jun 26 10:48:57 2023 -0700 Merge tag 'nfsd-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd updates from Chuck Lever: - Clean-ups in the READ path in anticipation of MSG_SPLICE_PAGES - Better NUMA awareness when allocating pages and other objects - A number of minor clean-ups to XDR encoding - Elimination of a race when accepting a TCP socket - Numerous observability enhancements * tag 'nfsd-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (46 commits) nfsd: remove redundant assignments to variable len svcrdma: Fix stale comment NFSD: Distinguish per-net namespace initialization nfsd: move init of percpu reply_cache_stats counters back to nfsd_init_net SUNRPC: Address RCU warning in net/sunrpc/svc.c SUNRPC: Use sysfs_emit in place of strlcpy/sprintf SUNRPC: Remove transport class dprintk call sites SUNRPC: Fix comments for transport class registration svcrdma: Remove an unused argument from __svc_rdma_put_rw_ctxt() svcrdma: trace cc_release calls svcrdma: Convert "might sleep" comment into a code annotation NFSD: Add an nfsd4_encode_nfstime4() helper SUNRPC: Move initialization of rq_stime SUNRPC: Optimize page release in svc_rdma_sendto() svcrdma: Prevent page release when nothing was received svcrdma: Revert 2a1e4f21d841 ("svcrdma: Normalize Send page handling") SUNRPC: Revert 579900670ac7 ("svcrdma: Remove unused sc_pages field") SUNRPC: Revert cc93ce9529a6 ("svcrdma: Retain the page backing rq_res.head[0].iov_base") NFSD: add encoding of op_recall flag for write delegation NFSD: Add "official" reviewers for this subsystem ... commit c0a572d9d32fe1e95672f24e860776dba0750a38 Merge: 1f2300a738211 6ac392815628f Author: Linus Torvalds Date: Mon Jun 26 10:27:04 2023 -0700 Merge tag 'v6.5/vfs.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull vfs mount updates from Christian Brauner: "This contains the work to extend move_mount() to allow adding a mount beneath the topmost mount of a mount stack. There are two LWN articles about this. One covers the original patch series in [1]. The other in [2] summarizes the session and roughly the discussion between Al and me at LSFMM. The second article also goes into some good questions from attendees. Since all details are found in the relevant commit with a technical dive into semantics and locking at the end I'm only adding the motivation and core functionality for this from commit message and leave out the invasive details. The code is also heavily commented and annotated as well which was explicitly requested. TL;DR: > mount -t ext4 /dev/sda /mnt | └─/mnt /dev/sda ext4 > mount --beneath -t xfs /dev/sdb /mnt | └─/mnt /dev/sdb xfs └─/mnt /dev/sda ext4 > umount /mnt | └─/mnt /dev/sdb xfs The longer motivation is that various distributions are adding or are in the process of adding support for system extensions and in the future configuration extensions through various tools. A more detailed explanation on system and configuration extensions can be found on the manpage which is listed below at [3]. System extension images may – dynamically at runtime — extend the /usr/ and /opt/ directory hierarchies with additional files. This is particularly useful on immutable system images where a /usr/ and/or /opt/ hierarchy residing on a read-only file system shall be extended temporarily at runtime without making any persistent modifications. When one or more system extension images are activated, their /usr/ and /opt/ hierarchies are combined via overlayfs with the same hierarchies of the host OS, and the host /usr/ and /opt/ overmounted with it ("merging"). When they are deactivated, the mount point is disassembled — again revealing the unmodified original host version of the hierarchy ("unmerging"). Merging thus makes the extension's resources suddenly appear below the /usr/ and /opt/ hierarchies as if they were included in the base OS image itself. Unmerging makes them disappear again, leaving in place only the files that were shipped with the base OS image itself. System configuration images are similar but operate on directories containing system or service configuration. On nearly all modern distributions mount propagation plays a crucial role and the rootfs of the OS is a shared mount in a peer group (usually with peer group id 1): TARGET SOURCE FSTYPE PROPAGATION MNT_ID PARENT_ID / / ext4 shared:1 29 1 On such systems all services and containers run in a separate mount namespace and are pivot_root()ed into their rootfs. A separate mount namespace is almost always used as it is the minimal isolation mechanism services have. But usually they are even much more isolated up to the point where they almost become indistinguishable from containers. Mount propagation again plays a crucial role here. The rootfs of all these services is a slave mount to the peer group of the host rootfs. This is done so the service will receive mount propagation events from the host when certain files or directories are updated. In addition, the rootfs of each service, container, and sandbox is also a shared mount in its separate peer group: TARGET SOURCE FSTYPE PROPAGATION MNT_ID PARENT_ID / / ext4 shared:24 master:1 71 47 For people not too familiar with mount propagation, the master:1 means that this is a slave mount to peer group 1. Which as one can see is the host rootfs as indicated by shared:1 above. The shared:24 indicates that the service rootfs is a shared mount in a separate peer group with peer group id 24. A service may run other services. Such nested services will also have a rootfs mount that is a slave to the peer group of the outer service rootfs mount. For containers things are just slighly different. A container's rootfs isn't a slave to the service's or host rootfs' peer group. The rootfs mount of a container is simply a shared mount in its own peer group: TARGET SOURCE FSTYPE PROPAGATION MNT_ID PARENT_ID /home/ubuntu/debian-tree / ext4 shared:99 61 60 So whereas services are isolated OS components a container is treated like a separate world and mount propagation into it is restricted to a single well known mount that is a slave to the peer group of the shared mount /run on the host: TARGET SOURCE FSTYPE PROPAGATION MNT_ID PARENT_ID /propagate/debian-tree /run/host/incoming tmpfs master:5 71 68 Here, the master:5 indicates that this mount is a slave to the peer group with peer group id 5. This allows to propagate mounts into the container and served as a workaround for not being able to insert mounts into mount namespaces directly. But the new mount api does support inserting mounts directly. For the interested reader the blogpost in [4] might be worth reading where I explain the old and the new approach to inserting mounts into mount namespaces. Containers of course, can themselves be run as services. They often run full systems themselves which means they again run services and containers with the exact same propagation settings explained above. The whole system is designed so that it can be easily updated, including all services in various fine-grained ways without having to enter every single service's mount namespace which would be prohibitively expensive. The mount propagation layout has been carefully chosen so it is possible to propagate updates for system extensions and configurations from the host into all services. The simplest model to update the whole system is to mount on top of /usr, /opt, or /etc on the host. The new mount on /usr, /opt, or /etc will then propagate into every service. This works cleanly the first time. However, when the system is updated multiple times it becomes necessary to unmount the first update on /opt, /usr, /etc and then propagate the new update. But this means, there's an interval where the old base system is accessible. This has to be avoided to protect against downgrade attacks. The vfs already exposes a mechanism to userspace whereby mounts can be mounted beneath an existing mount. Such mounts are internally referred to as "tucked". The patch series exposes the ability to mount beneath a top mount through the new MOVE_MOUNT_BENEATH flag for the move_mount() system call. This allows userspace to seamlessly upgrade mounts. After this series the only thing that will have changed is that mounting beneath an existing mount can be done explicitly instead of just implicitly. The crux is that the proposed mechanism already exists and that it is so powerful as to cover cases where mounts are supposed to be updated with new versions. Crucially, it offers an important flexibility. Namely that updates to a system may either be forced or can be delayed and the umount of the top mount be left to a service if it is a cooperative one" Link: https://lwn.net/Articles/927491 [1] Link: https://lwn.net/Articles/934094 [2] Link: https://man7.org/linux/man-pages/man8/systemd-sysext.8.html [3] Link: https://brauner.io/2023/02/28/mounting-into-mount-namespaces.html [4] Link: https://github.com/flatcar/sysext-bakery Link: https://fedoraproject.org/wiki/Changes/Unified_Kernel_Support_Phase_1 Link: https://fedoraproject.org/wiki/Changes/Unified_Kernel_Support_Phase_2 Link: https://github.com/systemd/systemd/pull/26013 * tag 'v6.5/vfs.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fs: allow to mount beneath top mount fs: use a for loop when locking a mount fs: properly document __lookup_mnt() fs: add path_mounted() commit 1f2300a7382119a857cc09e95db6e5d6fd813163 Merge: 2eedfa9e27ed7 bc2473c90fca5 Author: Linus Torvalds Date: Mon Jun 26 10:14:36 2023 -0700 Merge tag 'v6.5/vfs.file' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull vfs file handling updates from Christian Brauner: "This contains Amir's work to fix a long-standing problem where an unprivileged overlayfs mount can be used to avoid fanotify permission events that were requested for an inode or superblock on the underlying filesystem. Some background about files opened in overlayfs. If a file is opened in overlayfs @file->f_path will refer to a "fake" path. What this means is that while @file->f_inode will refer to inode of the underlying layer, @file->f_path refers to an overlayfs {dentry,vfsmount} pair. The reasons for doing this are out of scope here but it is the reason why the vfs has been providing the open_with_fake_path() helper for overlayfs for very long time now. So nothing new here. This is for sure not very elegant and everyone including the overlayfs maintainers agree. Improving this significantly would involve more fragile and potentially rather invasive changes. In various codepaths access to the path of the underlying filesystem is needed for such hybrid file. The best example is fsnotify where this becomes security relevant. Passing the overlayfs @file->f_path->dentry will cause fsnotify to skip generating fsnotify events registered on the underlying inode or superblock. To fix this we extend the vfs provided open_with_fake_path() concept for overlayfs to create a backing file container that holds the real path and to expose a helper that can be used by relevant callers to get access to the path of the underlying filesystem through the new file_real_path() helper. This pattern is similar to what we do in d_real() and d_real_inode(). The first beneficiary is fsnotify and fixes the security sensitive problem mentioned above. There's a couple of nice cleanups included as well. Over time, the old open_with_fake_path() helper added specifically for overlayfs a long time ago started to get used in other places such as cachefiles. Even though cachefiles have nothing to do with hybrid files. The only reason cachefiles used that concept was that files opened with open_with_fake_path() aren't charged against the caller's open file limit by raising FMODE_NOACCOUNT. It's just mere coincidence that both overlayfs and cachefiles need to ensure to not overcharge the caller for their internal open calls. So this work disentangles FMODE_NOACCOUNT use cases and backing file use-cases by adding the FMODE_BACKING flag which indicates that the file can be used to retrieve the backing file of another filesystem. (Fyi, Jens will be sending you a really nice cleanup from Christoph that gets rid of 3 FMODE_* flags otherwise this would be the last fmode_t bit we'd be using.) So now overlayfs becomes the sole user of the renamed open_with_fake_path() helper which is now named backing_file_open(). For internal kernel users such as cachefiles that are only interested in FMODE_NOACCOUNT but not in FMODE_BACKING we add a new kernel_file_open() helper which opens a file without being charged against the caller's open file limit. All new helpers are properly documented and clearly annotated to mention their special uses. We also rename vfs_tmpfile_open() to kernel_tmpfile_open() to clearly distinguish it from vfs_tmpfile() and align it the other kernel_*() internal helpers" * tag 'v6.5/vfs.file' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: ovl: enable fsnotify events on underlying real files fs: use backing_file container for internal files with "fake" f_path fs: move kmem_cache_zalloc() into alloc_empty_file*() helpers fs: use a helper for opening kernel internal files fs: rename {vfs,kernel}_tmpfile_open() commit 2eedfa9e27ed7b22d9c06d8d072ad2dbce4fd635 Merge: 64bf6ae93e087 2454ad83b90af Author: Linus Torvalds Date: Mon Jun 26 10:01:26 2023 -0700 Merge tag 'v6.5/vfs.rename.locking' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull vfs rename locking updates from Christian Brauner: "This contains the work from Jan to fix problems with cross-directory renames originally reported in [1]. To quickly sum it up some filesystems (so far we know at least about ext4, udf, f2fs, ocfs2, likely also reiserfs, gfs2 and others) need to lock the directory when it is being renamed into another directory. This is because we need to update the parent pointer in the directory in that case and if that races with other operations on the directory, in particular a conversion from one directory format into another, bad things can happen. So far we've done the locking in the filesystem code but recently Darrick pointed out in [2] that the RENAME_EXCHANGE case was missing. That one is particularly nasty because RENAME_EXCHANGE can arbitrarily mix regular files and directories and proper lock ordering is not achievable in the filesystems alone. This patch set adds locking into vfs_rename() so that not only parent directories but also moved inodes, regardless of whether they are directories or not, are locked when calling into the filesystem. This means establishing a locking order for unrelated directories. New helpers are added for this purpose and our documentation is updated to cover this in detail. The locking is now actually easier to follow as we now always lock source and target. We've always locked the target independent of whether it was a directory or file and we've always locked source if it was a regular file. The exact details for why this came about can be found in [3] and [4]" Link: https://lore.kernel.org/all/20230117123735.un7wbamlbdihninm@quack3 [1] Link: https://lore.kernel.org/all/20230517045836.GA11594@frogsfrogsfrogs [2] Link: https://lore.kernel.org/all/20230526-schrebergarten-vortag-9cd89694517e@brauner [3] Link: https://lore.kernel.org/all/20230530-seenotrettung-allrad-44f4b00139d4@brauner [4] * tag 'v6.5/vfs.rename.locking' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fs: Restrict lock_two_nondirectories() to non-directory inodes fs: Lock moved directories fs: Establish locking order for unrelated directories Revert "f2fs: fix potential corruption when moving a directory" Revert "udf: Protect rename against modification of moved directory" ext4: Remove ext4 locking of moved directory commit a8460ba59464c038c817844f67a74fe847b56613 Merge: f46117bf9d641 57c9eaa4de537 Author: Rafael J. Wysocki Date: Mon Jun 26 18:56:58 2023 +0200 Merge tag 'thermal-v6.5-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux into thermal Pull thermal control updates for 6.5-rc1 from Daniel Lezcano: "- Add DT bindings for SM6375, MSM8226 and QCM2290 Qcom platforms (Konrad Dybcio) - Add DT bindings and support for QCom MSM8226 (Matti Lehtimäki) - Add DT bindings for QCom ipq9574 (Praveenkumar I) - Convert bcm2835 DT bindings to the yaml schema (Stefan Wahren) - Allow selecting the bang-bang governor as default (Thierry Reding) - Refactor and prepare the code to set the scene for RCar Gen4 (Wolfram Sang) - Cleanup and fixes for the QCom tsens drivers. Add DT bindings and calibration for the MSM8909 platform (Stephan Gerhold) - Revert a patch introducing a wrong usage of devm_of_iomap() on the Mediatek platform (Ricardo Cañuelo) - Fix the clock vs reset ordering in order to conform to the documentation on the sun8i (Christophe JAILLET) - Prevent setting up undocumented registers, enable the only described sensors and add the version 2.1 on the Qoriq sensor (Peng Fan) - Add DT bindings and support for the Armada AP807 (Alex Leibovich) - Update the mlx5 driver with the recent thermal changes (Daniel Lezcano) - Convert to platform remove callback returning void on STM32 (Uwe Kleine-König) - Add an error information printing for devm_thermal_add_hwmon_sysfs() and remove the error from the Sun8i, Amlogic, i.MX, TI, K3, Tegra, Qoriq, Mediateka and QCom (Yangtao Li) - Register as hwmon sensor for the Generic ADC (Chen-Yu Tsai) - Use the dev_err_probe() function in the QCom tsens alarm driver (Luca Weiss)" * tag 'thermal-v6.5-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (38 commits) thermal/drivers/qcom/temp-alarm: Use dev_err_probe thermal/drivers/generic-adc: Register thermal zones as hwmon sensors thermal/drivers/mediatek/lvts_thermal: Remove redundant msg in lvts_ctrl_start() thermal/drivers/qcom: Remove redundant msg at probe time thermal/drivers/ti-soc: Remove redundant msg in ti_thermal_expose_sensor() thermal/drivers/qoriq: Remove redundant msg in qoriq_tmu_register_tmu_zone() thermal/drivers/tegra: Remove redundant msg in tegra_tsensor_register_channel() drivers/thermal/k3: Remove redundant msg in k3_bandgap_probe() thermal/drivers/imx: Remove redundant msg in imx8mm_tmu_probe() and imx_sc_thermal_probe() thermal/drivers/amlogic: Remove redundant msg in amlogic_thermal_probe() thermal/drivers/sun8i: Remove redundant msg in sun8i_ths_register() thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() thermal/drivers/stm32: Convert to platform remove callback returning void net/mlx5: Update the driver with the recent thermal changes thermal/drivers/armada: Add support for AP807 thermal data dt-bindings: armada-thermal: Add armada-ap807-thermal compatible thermal/drivers/qoriq: Support version 2.1 thermal/drivers/qoriq: Only enable supported sensors thermal/drivers/qoriq: No need to program site adjustment register thermal/drivers/mediatek/lvts_thermal: Register thermal zones as hwmon sensors ... commit 64bf6ae93e08787f4a6db8dddf671fd3a9c43916 Merge: 5c1c88cddb79d 2507135e4ff23 Author: Linus Torvalds Date: Mon Jun 26 09:50:21 2023 -0700 Merge tag 'v6.5/vfs.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull misc vfs updates from Christian Brauner: "Miscellaneous features, cleanups, and fixes for vfs and individual fs Features: - Use mode 0600 for file created by cachefilesd so it can be run by unprivileged users. This aligns them with directories which are already created with mode 0700 by cachefilesd - Reorder a few members in struct file to prevent some false sharing scenarios - Indicate that an eventfd is used a semaphore in the eventfd's fdinfo procfs file - Add a missing uapi header for eventfd exposing relevant uapi defines - Let the VFS protect transitions of a superblock from read-only to read-write in addition to the protection it already provides for transitions from read-write to read-only. Protecting read-only to read-write transitions allows filesystems such as ext4 to perform internal writes, keeping writers away until the transition is completed Cleanups: - Arnd removed the architecture specific arch_report_meminfo() prototypes and added a generic one into procfs.h. Note, we got a report about a warning in amdpgpu codepaths that suggested this was bisectable to this change but we concluded it was a false positive - Remove unused parameters from split_fs_names() - Rename put_and_unmap_page() to unmap_and_put_page() to let the name reflect the order of the cleanup operation that has to unmap before the actual put - Unexport buffer_check_dirty_writeback() as it is not used outside of block device aops - Stop allocating aio rings from highmem - Protecting read-{only,write} transitions in the VFS used open-coded barriers in various places. Replace them with proper little helpers and document both the helpers and all barrier interactions involved when transitioning between read-{only,write} states - Use flexible array members in old readdir codepaths Fixes: - Use the correct type __poll_t for epoll and eventfd - Replace all deprecated strlcpy() invocations, whose return value isn't checked with an equivalent strscpy() call - Fix some kernel-doc warnings in fs/open.c - Reduce the stack usage in jffs2's xattr codepaths finally getting rid of this: fs/jffs2/xattr.c:887:1: error: the frame size of 1088 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] royally annoying compilation warning - Use __FMODE_NONOTIFY instead of FMODE_NONOTIFY where an int and not fmode_t is required to avoid fmode_t to integer degradation warnings - Create coredumps with O_WRONLY instead of O_RDWR. There's a long explanation in that commit how O_RDWR is actually a bug which we found out with the help of Linus and git archeology - Fix "no previous prototype" warnings in the pipe codepaths - Add overflow calculations for remap_verify_area() as a signed addition overflow could be triggered in xfstests - Fix a null pointer dereference in sysv - Use an unsigned variable for length calculations in jfs avoiding compilation warnings with gcc 13 - Fix a dangling pipe pointer in the watch queue codepath - The legacy mount option parser provided as a fallback by the VFS for filesystems not yet converted to the new mount api did prefix the generated mount option string with a leading ',' causing issues for some filesystems - Fix a repeated word in a comment in fs.h - autofs: Update the ctime when mtime is updated as mandated by POSIX" * tag 'v6.5/vfs.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (27 commits) readdir: Replace one-element arrays with flexible-array members fs: Provide helpers for manipulating sb->s_readonly_remount fs: Protect reconfiguration of sb read-write from racing writes eventfd: add a uapi header for eventfd userspace APIs autofs: set ctime as well when mtime changes on a dir eventfd: show the EFD_SEMAPHORE flag in fdinfo fs/aio: Stop allocating aio rings from HIGHMEM fs: Fix comment typo fs: unexport buffer_check_dirty_writeback fs: avoid empty option when generating legacy mount string watch_queue: prevent dangling pipe pointer fs.h: Optimize file struct to prevent false sharing highmem: Rename put_and_unmap_page() to unmap_and_put_page() cachefiles: Allow the cache to be non-root init: remove unused names parameter in split_fs_names() jfs: Use unsigned variable for length calculations fs/sysv: Null check to prevent null-ptr-deref bug fs: use UB-safe check for signed addition overflow in remap_verify_area procfs: consolidate arch_report_meminfo declaration fs: pipe: reveal missing function protoypes ... commit 5c1c88cddb79d3ed3fb1d02a3eaf529eded76f05 Merge: 1f268d6d2c244 aa4b92c523487 Author: Linus Torvalds Date: Mon Jun 26 09:47:39 2023 -0700 Merge tag 'v6.5/fs.ntfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull ntfs updates from Christian Brauner: "A pile of various smaller fixes for ntfs" * tag 'v6.5/fs.ntfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: ntfs: do not dereference a null ctx on error ntfs: Remove unneeded semicolon ntfs: Correct spelling ntfs: remove redundant initialization to pointer cb_sb_start commit 1f268d6d2c244baf2c7769f33782ca532717723d Merge: a1257b5e3b7f8 def85dce1451e Author: Linus Torvalds Date: Mon Jun 26 09:42:03 2023 -0700 Merge tag 'auxdisplay-6.5' of https://github.com/ojeda/linux Pull auxdisplay update from Miguel Ojeda: "A single cleanup for i2c drivers to switch them back to use '.probe()'" * tag 'auxdisplay-6.5' of https://github.com/ojeda/linux: auxdisplay: Switch i2c drivers back to use .probe() commit a1257b5e3b7f8a21faf462d0118067fe31e71ffb Merge: 9d9a9bf07ed9b d2e3115d71719 Author: Linus Torvalds Date: Mon Jun 26 09:35:50 2023 -0700 Merge tag 'rust-6.5' of https://github.com/Rust-for-Linux/linux Pull rust updates from Miguel Ojeda: "A fairly small one in terms of feature additions. Most of the changes in terms of lines come from the upgrade to the new version of the toolchain (which in turn is big due to the vendored 'alloc' crate). Upgrade to Rust 1.68.2: - This is the first such upgrade, and we will try to update it often from now on, in order to remain close to the latest release, until a minimum version (which is "in the future") can be established. The upgrade brings the stabilization of 4 features we used (and 2 more that we used in our old 'rust' branch). Commit 3ed03f4da06e ("rust: upgrade to Rust 1.68.2") contains the details and rationale. pin-init API: - Several internal improvements and fixes to the pin-init API, e.g. allowing to use 'Self' in a struct definition with '#[pin_data]'. 'error' module: - New 'name()' method for the 'Error' type (with 'errname()' integration), used to implement the 'Debug' trait for 'Error'. - Add error codes from 'include/linux/errno.h' to the list of Rust 'Error' constants. - Allow specifying error type on the 'Result' type (with the default still being our usual 'Error' type). 'str' module: - 'TryFrom' implementation for 'CStr', and new 'to_cstring()' method based on it. 'sync' module: - Implement 'AsRef' trait for 'Arc', allowing to use 'Arc' in code that is generic over smart pointer types. - Add 'ptr_eq' method to 'Arc' for easier, less error prone comparison between two 'Arc' pointers. - Reword the 'Send' safety comment for 'Arc', and avoid referencing it from the 'Sync' one. 'task' module: - Implement 'Send' marker for 'Task'. 'types' module: - Implement 'Send' and 'Sync' markers for 'ARef' when 'T' is 'AlwaysRefCounted', 'Send' and 'Sync'. Other changes: - Documentation improvements and '.gitattributes' change to start using the Rust diff driver" * tag 'rust-6.5' of https://github.com/Rust-for-Linux/linux: rust: error: `impl Debug` for `Error` with `errname()` integration rust: task: add `Send` marker to `Task` rust: specify when `ARef` is thread safe rust: sync: reword the `Arc` safety comment for `Sync` rust: sync: reword the `Arc` safety comment for `Send` rust: sync: implement `AsRef` for `Arc` rust: sync: add `Arc::ptr_eq` rust: error: add missing error codes rust: str: add conversion from `CStr` to `CString` rust: error: allow specifying error type on `Result` rust: init: update macro expansion example in docs rust: macros: replace Self with the concrete type in #[pin_data] rust: macros: refactor generics parsing of `#[pin_data]` into its own function rust: macros: fix usage of `#[allow]` in `quote!` docs: rust: point directly to the standalone installers .gitattributes: set diff driver for Rust source code files rust: upgrade to Rust 1.68.2 rust: arc: fix intra-doc link in `Arc::init` rust: alloc: clarify what is the upstream version commit 9d9a9bf07ed9b09af3696997f02a557b428be092 Merge: be5b52dc14441 ad3d770b83aff Author: Linus Torvalds Date: Mon Jun 26 09:31:06 2023 -0700 Merge tag 's390-6.4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Alexander Gordeev: - Use correct type for size of memory allocated for ELF core header on kernel crash. - Fix insecure W+X mapping warning when KASAN shadow memory range is not aligned on page boundary. - Avoid allocation of short by one page KASAN shadow memory when the original memory range is less than (PAGE_SIZE << 3). - Fix virtual vs physical address confusion in physical memory enumerator. It is not a real issue, since virtual and physical addresses are currently the same. - Set CONFIG_NET_TC_SKB_EXT=y in s390 config files as it is required for offloading TC as well as bridges on switchdev capable ConnectX devices. * tag 's390-6.4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/defconfigs: set CONFIG_NET_TC_SKB_EXT=y s390/boot: fix physmem_info virtual vs physical address confusion s390/kasan: avoid short by one page shadow memory s390/kasan: fix insecure W+X mapping warning s390/crash: use the correct type for memory allocation commit 74f02dd73906f5a0e48dfc39b8f3adc03ad86274 Author: Rob Herring Date: Tue Jun 13 14:10:49 2023 -0600 dt-bindings: auxdisplay: holtek: Add missing type for "linux,no-autorepeat" "linux,no-autorepeat" is missing a type, add it. Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230613201049.2824028-1-robh@kernel.org Signed-off-by: Rob Herring commit f30e04303f3dd23e3adf175f7257c4fc504f73cf Author: Rob Herring Date: Tue Jun 13 14:10:40 2023 -0600 dt-bindings: input: mediatek,pmic-keys: Fix typo in "linux,keycodes" property name "linux-keycodes" is the wrong property name and is unused. It should be "linux,keycodes" instead. Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230613201040.2823802-1-robh@kernel.org Signed-off-by: Rob Herring commit e5d10d1d1aa4c7274bf7ff54660832004800655a Merge: 2a541abd98370 83da70da40c93 Author: Bjorn Andersson Date: Mon Jun 26 09:26:48 2023 -0700 Merge branch '20230608125315.11454-2-srinivas.kandagatla@linaro.org' into clk-for-6.5 Merge the missing SC8280XP LPASS DeviceTree changes, which where brought in through a topic branch in order to be shared with the DeviceTree source files, but not merged into the clock tree until now. commit be5b52dc144415a88ce785575ec9b6d989fc5ac6 Merge: 6995e2de6891c 6a22e017f952e Author: Linus Torvalds Date: Mon Jun 26 09:25:45 2023 -0700 Merge tag 'nios2_updates_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux Pull nios2 updates from Dinh Nguyen: - Convert pgtable constructor/destructors to ptdesc - Replace strlcpy with strscpy * tag 'nios2_updates_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: nios2: Replace all non-returning strlcpy with strscpy nios2: Convert __pte_free_tlb() to use ptdescs commit f46117bf9d641aec96866bb6add83b4f34ee20e9 Merge: 0bb619f9227aa ea197ea2ba572 Author: Rafael J. Wysocki Date: Mon Jun 26 18:03:07 2023 +0200 Merge back earlier Intel thermal control material for 6.5. commit c89a27f4f8fbf4dcbaf1738b42b8c68e160d7cda Merge: 9b8f36398e528 49776c712eb6d Author: Rafael J. Wysocki Date: Mon Jun 26 17:56:05 2023 +0200 Merge branch 'powercap' Merge power capping updates for 6.5-rc1: - Introduce power capping core support for Intel TPMI (Topology Aware Register and PM Capsule Interface) and a TPMI interface driver for Intel RAPL (Zhang Rui, Dan Carpenter). - Fix CONFIG_IOSF_MBI dependency in the Intel RAPL power capping driver (Zhang Rui). - Fix invalid initialization for pl4_supported field in the Intel RAPL power capping driver (Sumeet Pawnikar). * powercap: powercap: RAPL: Fix a NULL vs IS_ERR() bug powercap: RAPL: Fix CONFIG_IOSF_MBI dependency powercap: RAPL: fix invalid initialization for pl4_supported field powercap: intel_rapl: Introduce RAPL TPMI interface driver powercap: intel_rapl: Introduce core support for TPMI interface powercap: intel_rapl: Introduce RAPL I/F type powercap: intel_rapl: Make cpu optional for rapl_package powercap: intel_rapl: Remove redundant cpu parameter powercap: intel_rapl: Add support for lock bit per Power Limit powercap: intel_rapl: Cleanup Power Limits support powercap: intel_rapl: Use bitmap for Power Limits powercap: intel_rapl: Change primitive order powercap: intel_rapl: Use index to initialize primitive information powercap: intel_rapl: Support per domain energy/power/time unit powercap: intel_rapl: Support per Interface primitive information powercap: intel_rapl: Support per Interface rapl_defaults powercap: intel_rapl: Allow probing without CPUID match powercap: intel_rapl: Remove unused field in struct rapl_if_priv commit b9a40506a2cb626da3f21c6d494a76879e3141d7 Merge: 6e11940ab392c 989e4659dc51b 3973bcc95e744 ebf51575c8418 f562514174a04 6acab96ee3370 b1356ed1a4461 Author: Stephen Boyd Date: Mon Jun 26 08:55:22 2023 -0700 Merge branches 'clk-imx', 'clk-microchip', 'clk-cleanup', 'clk-bindings', 'clk-ti' and 'clk-kasprintf' into clk-next - Handle allocation failures from kasprintf() and friends * clk-imx: clk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe() clk: imx93: fix memory leak and missing unwind goto in imx93_clocks_probe clk: imx: clk-imx8mn: fix memory leak in imx8mn_clocks_probe dt-bindings: clock: imx8m: Add missing interrupt property clk: imx: clk-imxrt1050: fix memory leak in imxrt1050_clocks_probe clk: imx: composite-8m: Add imx8m_divider_determine_rate clk: imx: scu: use _safe list iterator to avoid a use after free clk: imx: drop imx_unregister_clocks clk: imx6ul: retain early UART clocks during kernel init clk: imx: imx6sx: Remove CLK_SET_RATE_PARENT from the LDB clocks * clk-microchip: dt-bindings: clocks: at91sam9x5-sckc: convert to yaml dt-bindings: clocks: atmel,at91rm9200-pmc: convert to yaml clk: microchip: Use of_property_read_bool() for boolean properties clk: microchip: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIRE * clk-cleanup: clk: fix typo in clk_hw_register_fixed_rate_parent_data() macro clk: Fix memory leak in devm_clk_notifier_register() clk: mvebu: Iterate over possible CPUs instead of DT CPU nodes clk: mvebu: Use of_get_cpu_hwid() to read CPU ID MAINTAINERS: Add Marvell mvebu clock drivers clk: mvebu: Use of_address_to_resource() clk: tegra: tegra124-emc: Fix potential memory leak clk: clocking-wizard: Fix Oops in clk_wzrd_register_divider() clk: bcm: rpi: Fix off by one in raspberrypi_discover_clocks() clk: sifive: Use devm_platform_ioremap_resource() * clk-bindings: dt-bindings: clock: drop unneeded quotes and use absolute /schemas path dt-bindings: rcc: stm32: Sync with u-boot copy for STM32MP13 SoC * clk-ti: clk: keystone: syscon-clk: Add support for audio refclk dt-bindings: clock: Add binding documentation for TI Audio REFCLK dt-bindings: clock: ehrpwm: Remove unneeded syscon compatible clk: keystone: syscon-clk: Allow the clock node to not be of type syscon * clk-kasprintf: clk: clocking-wizard: check return value of devm_kasprintf() clk: ti: clkctrl: check return value of kasprintf() clk: keystone: sci-clk: check return value of kasprintf() clk: si5341: free unused memory on probe failure clk: si5341: check return value of {devm_}kasprintf() clk: si5341: return error if one synth clock registration fails clk: cdce925: check return value of kasprintf() clk: vc5: check memory returned by kasprintf() commit 6e11940ab392cf804c1f124cae960f2a3a5e079c Merge: e155a3660784b e90f15be2447d 587dd448d9fcf 29d7088810099 59374d08b2b0b 9390860900a30 Author: Stephen Boyd Date: Mon Jun 26 08:55:04 2023 -0700 Merge branches 'clk-renesas', 'clk-determine-rate', 'clk-allwinner', 'clk-samsung' and 'clk-amlogic' into clk-next - Make clk_ops::determine_rate mandatory for muxes * clk-renesas: clk: renesas: rzg2l: Convert to readl_poll_timeout_atomic() clk: renesas: mstp: Convert to readl_poll_timeout_atomic() clk: renesas: cpg-mssr: Convert to readl_poll_timeout_atomic() iopoll: Do not use timekeeping in read_poll_timeout_atomic() iopoll: Call cpu_relax() in busy loops clk: renesas: rzg2l: Fix CPG_SIPLL5_CLK1 register write clk: renesas: r8a779a0: Add PWM clock * clk-determine-rate: (71 commits) clk: sprd: composite: Simplify determine_rate implementation ASoC: tlv320aic32x4: pll: Remove impossible condition in clk_aic32x4_pll_determine_rate() clk: Fix best_parent_rate after moving code into a separate function clk: Forbid to register a mux without determine_rate ASoC: tlv320aic32x4: div: Switch to determine_rate ASoC: tlv320aic32x4: pll: Switch to determine_rate clk: tegra: super: Switch to determine_rate clk: tegra: periph: Switch to determine_rate clk: stm32: composite: Switch to determine_rate clk: st: flexgen: Switch to determine_rate clk: sprd: composite: Switch to determine_rate clk: ingenic: tcu: Switch to determine_rate clk: ingenic: cgu: Switch to determine_rate clk: imx: scu: Switch to determine_rate clk: da8xx: clk48: Switch to determine_rate clk: si5351: clkout: Switch to determine_rate clk: si5351: msynth: Switch to determine_rate clk: si5351: pll: Switch to determine_rate clk: si5341: Switch to determine_rate clk: cdce706: clkout: Switch to determine_rate ... * clk-allwinner: clk: sunxi-ng: a64: force select PLL_MIPI in TCON0 mux * clk-samsung: clk: samsung: add CONFIG_OF dependency clk: samsung: Re-add support for Exynos4212 CPU clock clk: samsung: Add Exynos4212 compatible to CLKOUT driver dt-bindings: clock: samsung,exynos: add Exynos4212 clock compatible * clk-amlogic: MAINTAINERS: repair pattern in ARM/Amlogic Meson SoC CLOCK FRAMEWORK clk: meson: pll: remove unneeded semicolon clk: meson: a1: Staticize rtc clk clk: meson: a1: add Amlogic A1 Peripherals clock controller driver clk: meson: a1: add Amlogic A1 PLL clock controller driver clk: meson: introduce new pll power-on sequence for A1 SoC family clk: meson: make pll rst bit as optional dt-bindings: clock: meson: add A1 Peripherals clock controller bindings dt-bindings: clock: meson: add A1 PLL clock controller bindings commit e155a3660784badaa48bd7bb868dd7da9e45ae7d Merge: a65615df5b458 16d4f5378d964 b270ae61730e0 ad527ca87e4ea 893911e657365 Author: Stephen Boyd Date: Mon Jun 26 08:54:19 2023 -0700 Merge branches 'clk-platform', 'clk-i2c', 'clk-mediatek', 'clk-i2cid' and 'clk-vc5' into clk-next - Migrate platform clk drivers to .remove_new() - Migrate i2c clk drivers to .probe() instead of .probe_new() - Remove CLK_SET_PARENT from all Mediatek MSDC core clocks - Add infra_ao reset support for Mediatek MT8188 SoCs - Align driver_data to i2c_device_id tables in some i2c clk drivers - Use device_get_match_data() in vc5 clk driver * clk-platform: clk: mediatek: Convert all remaining drivers to platform_driver's .remove_new() clk: mediatek: Make mtk_clk_pdev_remove() return void clk: mediatek: Make mtk_clk_simple_remove() return void * clk-i2c: clk: si521xx: Switch i2c driver back to use .probe() clk: Switch i2c drivers back to use .probe() * clk-mediatek: clk: mediatek: clk-mt8173-apmixedsys: Fix iomap not released issue clk: mediatek: clk-mt8173-apmixedsys: Fix return value for of_iomap() error clk: mediatek: clk-mtk: Grab iomem pointer for divider clocks clk: mediatek: fix of_iomap memory leak clk: mediatek: reset: add infra_ao reset support for MT8188 dt-bindings: reset: mt8188: add thermal reset control bit clk: mediatek: Remove CLK_SET_PARENT from all MSDC core clocks clk: mediatek: mux: Stop forcing CLK_SET_RATE_PARENT flag clk: mediatek: Enable all MT8192 clocks by default * clk-i2cid: clk: rs9: Fix .driver_data content in i2c_device_id clk: vc7: Fix .driver_data content in i2c_device_id clk: vc5: Fix .driver_data content in i2c_device_id * clk-vc5: clk: vc7: Use device_get_match_data() instead of of_device_get_match_data() clk: vc5: Use device_get_match_data() instead of of_device_get_match_data() commit 6d85ebf95c44e52337ca1d07f0db4b435d1e6762 Author: Yu Kuai Date: Sat May 27 09:06:44 2023 +0800 blk-sysfs: add a new attr_group for blk_mq Currently wbt sysfs entry is created for bio based device, and wbt can be enabled for such device through sysfs while it doesn't make sense because wbt can only work for rq based device. In the meantime, there are other similar sysfs entries. Fix this by adding a new attr_group for blk_mq, and sysfs entries will only be created when the device is rq based. Suggested-by: Christoph Hellwig Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230527010644.647900-6-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit eebc21d12f56c1e09a163abf91e351fa2a55a938 Author: Yu Kuai Date: Sat May 27 09:06:43 2023 +0800 blk-iocost: move wbt_enable/disable_default() out of spinlock There are following smatch warning: block/blk-wbt.c:843 wbt_init() warn: sleeping in atomic context ioc_qos_write() <- disables preempt -> wbt_enable_default() -> wbt_init() wbt_init() will be called from wbt_enable_default() if wbt is not initialized, currently this is only possible in blk_register_queue(), hence wbt_init() will never be called from iocost and this warning is false positive. However, we might support rq_qos destruction dynamically in the future, and it's better to prevent that, hence move wbt_enable_default() outside 'ioc->lock'. This is safe because queue is still freezed. Reported-by: Dan Carpenter Link: https://lore.kernel.org/lkml/Y+Ja5SRs886CEz7a@kadam/ Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230527010644.647900-5-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 06257fda83ebfd1c33fb992e41dba7be4e1184d4 Author: Yu Kuai Date: Sat May 27 09:06:42 2023 +0800 blk-wbt: cleanup rwb_enabled() and wbt_disabled() 'wb_normal' will set to 0 if 'min_lat_nsec' is 0, and 'min_lat_nsec' can only be set to 0 through sysfs configuration where 'WBT_STATE_OFF_MANUAL' is set together, in the meantime, they can only be cleared together through sysfs afterwards. Hence 'wb_normal != 0' is the same as 'rwb->enable_state != WBT_STATE_OFF_MANUAL'. The code is redundan, hence replace the checking of 'wb_normal' to 'enable_state' in rwb_enabled() and reuse rwb_enabled() for wbt_disabled(). Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230527010644.647900-4-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 71b8642e79f277459555629f2bea1a8d1fed307e Author: Yu Kuai Date: Sat May 27 09:06:41 2023 +0800 blk-wbt: remove dead code to handle wbt enable/disable with io inflight enable or disable wbt is always called with queue freezed, so that wbt can never be enabled or disabled while io is still inflight, and this behaviour should always hold to avoid io hang(There have been reported several times). Therefor, the code to handle wbt enable/diskble with io inflight is not and never will be used, hence remove such dead code. Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230527010644.647900-3-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 645a829e03384a235b3760959d4ebe420a0f2027 Author: Yu Kuai Date: Sat May 27 09:06:40 2023 +0800 blk-wbt: don't create wbt sysfs entry if CONFIG_BLK_WBT is disabled sysfs entry /sys/block/[device]/queue/wbt_lat_usec will be created even if CONFIG_BLK_WBT is disabled, while read and write will always fail. It doesn't make sense to create a sysfs entry that can't be accessed, so don't create such entry. Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230527010644.647900-2-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 9b8f36398e52840a6fe3a56d65be5f45bad4525a Merge: 4af191d60d221 b77505ed8a885 4384a70c8813e Author: Rafael J. Wysocki Date: Mon Jun 26 17:44:50 2023 +0200 Merge branches 'pm-sleep' and 'pm-domains' Merge updates related to system-wide power management and generic power domains (genpd) updates for 6.5-rc1: - Fix the handling of pm_suspend_target_state when CONFIG_PM is unset (Kai-Heng Feng). - Correct spelling mistake in a comment in the hibernation code (Wang Honghui). - Add arch_resume_nosmt() prototype to avoid a "missing prototypes" build warning (Arnd Bergmann). - Restrict pm_pr_dbg() to system-wide power transitions and use it in a few additional places (Mario Limonciello). - Drop verification of in-params from genpd_add_device() and ensure that all of its callers will do it (Ulf Hansson). - Prevent possible integer overflows from occurring in genpd_parse_state() (Nikita Zhandarovich). * pm-sleep: platform/x86/amd: pmc: Use pm_pr_dbg() for suspend related messages pinctrl: amd: Use pm_pr_dbg to show debugging messages ACPI: x86: Add pm_debug_messages for LPS0 _DSM state tracking include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume PM: suspend: add a arch_resume_nosmt() prototype PM: hibernate: Correct spelling mistake in a comment PM: suspend: Fix pm_suspend_target_state handling for !CONFIG_PM * pm-domains: PM: domains: Move the verification of in-params from genpd_add_device() PM: domains: fix integer overflow issues in genpd_parse_state() commit a6b6790c020a01cc3e9353059d98bbe60c2fd105 Author: Uwe Kleine-König Date: Mon Jun 26 11:19:41 2023 +0200 mfd: Switch two more drivers back to use struct i2c_driver::probe struct i2c_driver::probe_new is about to go away. Switch the driver to use the probe callback with the same prototype. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230626091941.557733-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones commit 4af191d60d22184e8c529068a8e9a6c77eee1706 Merge: 5d83a2b18b988 03f44ffb3d5be 0fac214bb75ee Author: Rafael J. Wysocki Date: Mon Jun 26 17:34:01 2023 +0200 Merge branches 'pm-cpufreq' and 'pm-cpuidle' Merge cpufreq and cpuidle updates for 6.5-rc1: - Prevent cpufreq drivers that provide the ->adjust_perf() callback without a ->fast_switch() one which is used as a fallback from the former in some cases (Wyes Karny). - Fix some issues related to the AMD P-state cpufreq driver (Mario Limonciello, Wyes Karny). - Fix the energy_performance_preference attribute handling in the intel_pstate driver in passive mode (Tero Kristo). - Clean up the intel_idle driver, make it work with VM guests that cannot use the MWAIT instruction and address the case in which the host may enter a deep idle state when the guest is idle (Arjan van de Ven). * pm-cpufreq: cpufreq: intel_pstate: Fix energy_performance_preference for passive cpufreq: amd-pstate: Add a kernel config option to set default mode cpufreq: amd-pstate: Set a fallback policy based on preferred_profile ACPI: CPPC: Add definition for undefined FADT preferred PM profile value cpufreq: amd-pstate: Set default governor to schedutil cpufreq: amd-pstate: Make amd-pstate EPP driver name hyphenated cpufreq: amd-pstate: Write CPPC enable bit per-socket cpufreq: Fail driver register if it has adjust_perf without fast_switch * pm-cpuidle: intel_idle: Add a "Long HLT" C1 state for the VM guest mode intel_idle: Add support for using intel_idle in a VM guest using just hlt intel_idle: clean up the (new) state_update_enter_method function intel_idle: refactor state->enter manipulation into its own function commit a33677b9211b6c328ad359b072043af94f7c9592 Author: Mans Rullgard Date: Mon Jun 19 17:02:49 2023 +0100 backlight: led_bl: Take led_access lock when required The led_access lock must be held when calling led_sysfs_enable() and led_sysfs_disable(). This fixes warnings such as this: [ 2.432495] ------------[ cut here ]------------ [ 2.437316] WARNING: CPU: 0 PID: 22 at drivers/leds/led-core.c:349 led_sysfs_disable+0x54/0x58 [ 2.446105] Modules linked in: [ 2.449218] CPU: 0 PID: 22 Comm: kworker/u2:1 Not tainted 6.3.8+ #1 [ 2.456268] Hardware name: Generic AM3517 (Flattened Device Tree) [ 2.462402] Workqueue: events_unbound deferred_probe_work_func [ 2.468353] unwind_backtrace from show_stack+0x10/0x14 [ 2.473632] show_stack from dump_stack_lvl+0x24/0x2c [ 2.478759] dump_stack_lvl from __warn+0x9c/0xc4 [ 2.483551] __warn from warn_slowpath_fmt+0x64/0xc0 [ 2.488586] warn_slowpath_fmt from led_sysfs_disable+0x54/0x58 [ 2.494567] led_sysfs_disable from led_bl_probe+0x20c/0x3b0 [ 2.500305] led_bl_probe from platform_probe+0x5c/0xb8 [ 2.505615] platform_probe from really_probe+0xc8/0x2a0 [ 2.510986] really_probe from __driver_probe_device+0x88/0x19c [ 2.516967] __driver_probe_device from driver_probe_device+0x30/0xcc [ 2.523498] driver_probe_device from __device_attach_driver+0x94/0xc4 [ 2.530090] __device_attach_driver from bus_for_each_drv+0x80/0xcc [ 2.536437] bus_for_each_drv from __device_attach+0xf8/0x19c [ 2.542236] __device_attach from bus_probe_device+0x8c/0x90 [ 2.547973] bus_probe_device from deferred_probe_work_func+0x80/0xb0 [ 2.554504] deferred_probe_work_func from process_one_work+0x228/0x4c0 [ 2.561187] process_one_work from worker_thread+0x1fc/0x4d0 [ 2.566925] worker_thread from kthread+0xb4/0xd0 [ 2.571685] kthread from ret_from_fork+0x14/0x2c [ 2.576446] Exception stack(0xd0079fb0 to 0xd0079ff8) [ 2.581573] 9fa0: 00000000 00000000 00000000 00000000 [ 2.589813] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 2.598052] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 2.604888] ---[ end trace 0000000000000000 ]--- Signed-off-by: Mans Rullgard Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20230619160249.10414-1-mans@mansr.com Signed-off-by: Lee Jones commit 01fee479846bb13139d339b11e04bf327200cac9 Merge: 0586d26339ed4 9368aa1882ac7 b72f301c5bdce 097e727b585a9 Author: Rafael J. Wysocki Date: Mon Jun 26 17:24:19 2023 +0200 Merge branches 'acpi-apei', 'acpi-pad' and 'acpi-misc' Merge ACPI APEI changes, an ACPI PAD driver update and an ACPI FFH handling cleanup related to ARM64 for 6.5-rc1: - Make ghes_get_devices() return NULL to indicate that there are no GHES devices so as to allow vendor-specific EDAC drivers to probe then (Li Yang). - Mark bert_disable() as __initdata and drop an unused function from the APEI GHES code (Miaohe Lin). - Make the ACPI PAD (Processor Aggregator Device) driver realize that Zhaoxin CPUs support nonstop TSC (Tony W Wang-oc). - Drop the certainly unnecessary and likely incorrect inclusion of linux/arm-smccc.h from acpi_ffh.c (Sudeep Holla). * acpi-apei: APEI: GHES: correctly return NULL for ghes_get_devices() ACPI: APEI: mark bert_disable as __initdata ACPI: APEI: GHES: Remove unused ghes_estatus_pool_size_request() * acpi-pad: ACPI: PAD: mark Zhaoxin CPUs NONSTOP TSC correctly * acpi-misc: ACPI: FFH: Drop the inclusion of linux/arm-smccc.h commit 0586d26339ed4a84cfd60333daadb853663066fd Merge: 9fc520a6fe14c c31b3a1b004c1 365eac5ef2feb Author: Rafael J. Wysocki Date: Mon Jun 26 17:20:28 2023 +0200 Merge branches 'acpi-thermal' and 'acpi-button' Merge ACPI thermal driver cleanups and ACPI button drivers rework for 6.5-rc1: - Clean up the ACPI thermal driver and drop some dead or otherwise unneded code from it (Rafael Wysocki). - Rework the handling of notifications in the ACPI button drivers so as to allow the common notification handling code for devices to be simplified (Rafael Wysocki). * acpi-thermal: ACPI: thermal: Drop struct acpi_thermal_flags ACPI: thermal: Drop struct acpi_thermal_state ACPI: thermal: Eliminate struct acpi_thermal_state_flags ACPI: thermal: Move acpi_thermal_driver definition ACPI: thermal: Move symbol definitions to one place ACPI: thermal: Drop redundant ACPI_TRIPS_REFRESH_DEVICES symbol ACPI: thermal: Use BIT() macro for defining flags * acpi-button: ACPI: bus: Simplify installation and removal of notify callback ACPI: tiny-power-button: Eliminate the driver notify callback ACPI: button: Use different notify handlers for lid and buttons ACPI: button: Eliminate the driver notify callback commit b389139f12f287b8ed2e2628b72df89a081f0b59 Author: Pablo Neira Ayuso Date: Mon Jun 26 00:42:19 2023 +0200 netfilter: nf_tables: fix underflow in chain reference counter Set element addition error path decrements reference counter on chains twice: once on element release and again via nft_data_release(). Then, d6b478666ffa ("netfilter: nf_tables: fix underflow in object reference counter") incorrectly fixed this by removing the stateful object reference count decrement. Restore the stateful object decrement as in b91d90368837 ("netfilter: nf_tables: fix leaking object reference count") and let nft_data_release() decrement the chain reference counter, so this is done only once. Fixes: d6b478666ffa ("netfilter: nf_tables: fix underflow in object reference counter") Fixes: 628bd3e49cba ("netfilter: nf_tables: drop map element references from preparation phase") Signed-off-by: Pablo Neira Ayuso commit 3e70489721b6c870252c9082c496703677240f53 Author: Pablo Neira Ayuso Date: Mon Jun 26 00:42:18 2023 +0200 netfilter: nf_tables: unbind non-anonymous set if rule construction fails Otherwise a dangling reference to a rule object that is gone remains in the set binding list. Fixes: 26b5a5712eb8 ("netfilter: nf_tables: add NFT_TRANS_PREPARE_ERROR to deal with bound set/chain") Signed-off-by: Pablo Neira Ayuso commit f188d30087480eab421cd8ca552fb15f55d57f4d Author: Ilia.Gavrilov Date: Fri Jun 23 11:23:46 2023 +0000 netfilter: nf_conntrack_sip: fix the ct_sip_parse_numerical_param() return value. ct_sip_parse_numerical_param() returns only 0 or 1 now. But process_register_request() and process_register_response() imply checking for a negative value if parsing of a numerical header parameter failed. The invocation in nf_nat_sip() looks correct: if (ct_sip_parse_numerical_param(...) > 0 && ...) { ... } Make the return value of the function ct_sip_parse_numerical_param() a tristate to fix all the cases a) return 1 if value is found; *val is set b) return 0 if value is not found; *val is unchanged c) return -1 on error; *val is undefined Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 0f32a40fc91a ("[NETFILTER]: nf_conntrack_sip: create signalling expectations") Signed-off-by: Ilia.Gavrilov Reviewed-by: Simon Horman Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 9fc520a6fe14cb7fadd64718375da1572f5acf6a Merge: 87b5374b49c3d f91280f35895d 23d28cc0444be fa578bf50e0b5 8f0e8597a7fa1 Author: Rafael J. Wysocki Date: Mon Jun 26 17:05:10 2023 +0200 Merge branches 'acpi-x86', 'acpi-video', 'acpi-soc' and 'acpi-tables' Merge x86-related ACPI changes, backlight-related ACPI changes, an Intel SoC (LPSS) ACPI driver update and a missing prototype warning fix related to ACPI NFIT for 6.5-rc1: - Add quirks to work around ACPI tables defects on Lenovo Yoga Book yb1-x90f/l and Nextbook Ares 8A (Hans de Goede). - Add ACPi backlight quirks for Dell Studio 1569, Lenovo ThinkPad X131e (3371 AMD version) and Apple iMac11,3 and stop trying to use vendor backlight control on relatively recent systems (Hans de Goede). - Add pwm_lookup_table entry for second PWM on CHT/BSW devices in the ACPI LPSS (Intel SoC) driver (Hans de Goede). - Add nfit_intel_shutdown_status() declaration to a local header to avoid a "missing prototypes" build warning (Arnd Bergmann). * acpi-x86: ACPI: x86: Add ACPI_QUIRK_UART1_SKIP for Lenovo Yoga Book yb1-x90f/l ACPI: button: Add lid disable DMI quirk for Nextbook Ares 8A ACPI: x86: Add skip i2c clients quirk for Nextbook Ares 8A * acpi-video: ACPI: video: Add backlight=native DMI quirk for Dell Studio 1569 ACPI: video: Stop trying to use vendor backlight control on laptops from after ~2012 ACPI: video: Add backlight=native DMI quirk for Lenovo ThinkPad X131e (3371 AMD version) ACPI: video: Add backlight=native DMI quirk for Apple iMac11,3 * acpi-soc: ACPI: LPSS: Add pwm_lookup_table entry for second PWM on CHT/BSW devices * acpi-tables: ACPI: NFIT: Add declaration in a local header commit 87b5374b49c3d99f9c581c59e5ad47d13294b66d Merge: e660abd551f11 3ba12d8de3faa f198478cfdc81 a9c4a912b7dc7 896e97bf99ecf Author: Rafael J. Wysocki Date: Mon Jun 26 16:54:10 2023 +0200 Merge branches 'acpi-scan', 'acpi-pm', 'acpi-resource' and 'acpi-ec' Merge ACPI device enumeration changes, ACPI power management update, ACPI resources management updates and an EC driver update for 6.5-rc1: - Reduce ACPI device enumeration overhead related to devices with dependencies (Rafael Wysocki). - Fix the handling of Microsoft LPS0 _DSM for suspend-to-idle (Mario Limonciello). - Fix section mismatch warning in the ACPI suspend-to-idle code (Arnd Bergmann). - Drop several ACPI resource management quirks related to IRQ ovverides on AMD "Zen" systems (Mario Limonciello). - Modify the ACPI EC driver to make it only clear the EC GPE status when handling the GPE (Jeremy Compostella). * acpi-scan: ACPI: scan: Reduce overhead related to devices with dependencies * acpi-pm: ACPI: x86: s2idle: Adjust Microsoft LPS0 _DSM handling sequence ACPI: PM: s2idle: fix section mismatch warning * acpi-resource: ACPI: resource: Remove "Zen" specific match and quirks * acpi-ec: ACPI: EC: Clear GPE on interrupt handling only commit 9a6c0e28e215535b2938c61ded54603b4e5814c5 Author: Jason Gerecke Date: Thu Jun 8 14:38:28 2023 -0700 HID: wacom: Use ktime_t rather than int when dealing with timestamps Code which interacts with timestamps needs to use the ktime_t type returned by functions like ktime_get. The int type does not offer enough space to store these values, and attempting to use it is a recipe for problems. In this particular case, overflows would occur when calculating/storing timestamps leading to incorrect values being reported to userspace. In some cases these bad timestamps cause input handling in userspace to appear hung. Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/901 Fixes: 17d793f3ed53 ("HID: wacom: insert timestamp to packed Bluetooth (BT) events") CC: stable@vger.kernel.org Signed-off-by: Jason Gerecke Reviewed-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20230608213828.2108-1-jason.gerecke@wacom.com Signed-off-by: Benjamin Tissoires commit 1ea7ca1b090145519aad998679222f0a14ab8fce Author: Jane Chu Date: Thu Jun 15 12:13:25 2023 -0600 dax: enable dax fault handler to report VM_FAULT_HWPOISON When multiple processes mmap() a dax file, then at some point, a process issues a 'load' and consumes a hwpoison, the process receives a SIGBUS with si_code = BUS_MCEERR_AR and with si_lsb set for the poison scope. Soon after, any other process issues a 'load' to the poisoned page (that is unmapped from the kernel side by memory_failure), it receives a SIGBUS with si_code = BUS_ADRERR and without valid si_lsb. This is confusing to user, and is different from page fault due to poison in RAM memory, also some helpful information is lost. Channel dax backend driver's poison detection to the filesystem such that instead of reporting VM_FAULT_SIGBUS, it could report VM_FAULT_HWPOISON. If user level block IO syscalls fail due to poison, the errno will be converted to EIO to maintain block API consistency. Signed-off-by: Jane Chu Link: https://lore.kernel.org/r/20230615181325.1327259-2-jane.chu@oracle.com Reviewed-by: Dan Williams Signed-off-by: Vishal Verma commit 90fc660e8479c5da5bb99a4fb3e0d266fa041b15 Author: Uwe Kleine-König Date: Mon Jun 26 10:51:45 2023 +0200 hwmon: max31827: Switch back to use struct i2c_driver::probe struct i2c_driver::probe_new is about to go away. Switch the driver to use the probe callback with the same prototype. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230626085145.554616-1-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit d6048fdc870240e5020343f8af0c825829c232bd Merge: a15b51375684c 2d0cad0473bd1 Author: Takashi Iwai Date: Mon Jun 26 15:38:02 2023 +0200 Merge tag 'asoc-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v6.5 A fairly quiet release from a core and framework point of view, but a very big one from the point of view of new drivers: - More refectoring from Morimoto-san, this time mainly around DAI links and how we control the ordering of trigger() callbacks. - Convert a lot of drivers to use maple tree based caches. - Lots of work on the x86 driver stack. - Compressed audio support for Qualcomm. - Support for AMD SoundWire, Analog Devices SSM3515, Google Chameleon, Ingenic X1000, Intel systems with various CODECs, Longsoon platforms, Maxim MAX98388, Mediatek MT8188, Nuvoton NAU8825C, NXP platforms with NAU8822, Qualcomm WSA884x, StarFive JH7110, Texas Instruments TAS2781. commit d1d7fc3bf6d2e6fb5d81a24dbb4120779a447b33 Author: Colin Ian King Date: Mon Jun 26 09:35:35 2023 +0100 RDMA/bnxt_re: Fix spelling mistake "priviledged" -> "privileged" There is a spelling mistake in a comment and in a dev_err error message. Fix them. Link: https://lore.kernel.org/r/20230626083535.53303-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Jason Gunthorpe commit 0ab83a6459604c566a745875c4df1aec8e8866c0 Author: Yang Li Date: Mon Jun 26 08:36:32 2023 +0800 RDMA/bnxt_re: Remove duplicated include in bnxt_re/main.c ./drivers/infiniband/hw/bnxt_re/main.c: ib_verbs.h is included more than once. Link: https://lore.kernel.org/r/20230626003632.60435-1-yang.lee@linux.alibaba.com Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5588 Signed-off-by: Yang Li Acked-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit a15b51375684c2bfa6017bb185139477e7a3b96c Merge: e94f1f96f108b 4e0871333661d Author: Takashi Iwai Date: Mon Jun 26 15:23:15 2023 +0200 Merge branch 'for-next' into for-linus Pull the 6.5-devel branch for upstreaming. Signed-off-by: Takashi Iwai commit e94f1f96f108ba96c0ed8bf3fbdd8ee6a6703880 Author: Andy Chi Date: Mon Jun 26 21:03:00 2023 +0800 ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on EliteBook On HP EliteBook 835/845/845W G10, the audio LEDs can be enabled by ALC285_FIXUP_HP_MUTE_LED. So use it accordingly. Signed-off-by: Andy Chi Cc: Fixes: 3e10f6ca76c4 ("ALSA: hda/realtek: Add quirk for HP EliteBook G10 laptops") Link: https://lore.kernel.org/r/20230626130301.301712-1-andy.chi@canonical.com Signed-off-by: Takashi Iwai commit cf2423a7555c4b012576c7282fb495ce739d50d4 Author: Yunlei He Date: Mon Jun 19 23:13:53 2023 +0800 f2fs: remove unneeded page uptodate check/set This patch remove unneeded page uptodate check/set in f2fs_vm_page_mkwrite, which already done in set_page_dirty. Signed-off-by: Yunlei He Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 396d0a28836d42bef595a8843533285abaf64ff7 Author: Yunlei He Date: Fri Jun 23 00:16:46 2023 +0800 f2fs: update mtime and ctime in move file range method Mtime and ctime stay old value without update after move file range ioctl. This patch add time update. Signed-off-by: Yunlei He Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2724daf6c24c58099a758d1e842d39b10133b065 Author: Jaegeuk Kim Date: Tue Jun 6 10:17:47 2023 -0700 f2fs: compress tmp files given extension Let's compress tmp files for the given extension list. This patch does not change the previous behavior, but allow the cases as below. Extention example: "ext" - abc.ext : allow - abc.ext.abc : allow - abc.extm : not allow Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 6201c478dedcf7c50361b23b5c4d4f41a68921ac Author: Yangtao Li Date: Sat May 6 23:16:03 2023 +0800 f2fs: refactor struct f2fs_attr macro This patch provides a large number of variants of F2FS_RW_ATTR and F2FS_RO_ATTR macros, reducing the number of parameters required to initialize the f2fs_attr structure. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304152234.wjaY3IYm-lkp@intel.com/ Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c3355ea9d82fe6b1a4226c9a7d311f9c5715b456 Author: Yangtao Li Date: Tue Jun 13 15:51:57 2023 +0800 f2fs: convert to use sbi directly F2FS_I_SB(inode) is redundant. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 3f8ac7da8c6efd72908e0a16d4a149e79f356a00 Author: Colin Ian King Date: Fri Jun 16 15:20:09 2023 +0100 f2fs: remove redundant assignment to variable err The assignment to variable err is redundant since the code jumps to label next and err is then re-assigned a new value on the call to sanity_check_node_chain. Remove the assignment. Cleans up clang scan build warning: fs/f2fs/recovery.c:464:6: warning: Value stored to 'err' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Jaegeuk Kim commit 9ac00e7cef106b66611e131f59f61f5ae35cf726 Author: Jaegeuk Kim Date: Tue Jun 13 13:35:31 2023 -0700 f2fs: do not issue small discard commands during checkpoint If there're huge # of small discards, this will increase checkpoint latency insanely. Let's issue small discards only by trim. Signed-off-by: Jaegeuk Kim commit c9667b19e2cf13735fe2620f9d97b788897cd4af Author: Daeho Jeong Date: Mon Jun 12 16:32:03 2023 -0700 f2fs: check zone write pointer points to the end of zone We don't need to report an issue, when the zone write pointer already points to the end of the zone, since the zone mismatch is already taken care. Signed-off-by: Daeho Jeong Signed-off-by: Jaegeuk Kim commit ac1ee161dec5801d9bbd874ef69cd0ff1e8053b6 Author: Sheng Yong Date: Mon Jun 12 11:01:19 2023 +0800 f2fs: add f2fs_ioc_get_compress_blocks This patch adds f2fs_ioc_get_compress_blocks() to provide a common f2fs_get_compress_blocks(). Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit dde38c03b351749f682db087df5202b55c7c1b40 Author: Sheng Yong Date: Mon Jun 12 11:01:17 2023 +0800 f2fs: cleanup MIN_INLINE_XATTR_SIZE Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c571fbb5b59a3741e48014faa92c2f14bc59fe50 Author: Sheng Yong Date: Mon Jun 12 11:01:16 2023 +0800 f2fs: add helper to check compression level This patch adds a helper function to check if compression level is valid. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 94c8431fb46bfbe51bd3eb68687334797af0a221 Author: Christoph Hellwig Date: Mon Jun 12 07:37:11 2023 +0200 f2fs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file systems can just set the FMODE_CAN_ODIRECT flag at open time instead of wiring up a dummy direct_IO method to indicate support for direct I/O. Do that for f2fs so that noop_direct_IO can eventually be removed. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f240d3aaf5a1552ecb75445b47b1ca957d5151d2 Author: Chao Yu Date: Wed May 31 09:40:55 2023 +0800 f2fs: do more sanity check on inode There are several issues in sanity_check_inode(): - The code looks not clean, it checks extra_attr related condition dispersively. - It missed to check i_extra_isize w/ lower boundary - It missed to check feature dependency: prjquota, inode_chksum, inode_crtime, compression features rely on extra_attr feature. - It's not necessary to check i_extra_isize due to it will only be assigned to non-zero value if f2fs_has_extra_attr() is true in do_read_inode(). Fix them all in this patch. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 64ee9163fe1b911aa0476af06ee0afd23fdf7388 Author: Chao Yu Date: Wed May 17 11:41:39 2023 +0800 f2fs: compress: fix to check validity of i_compress_flag field The last valid compress related field is i_compress_flag, check its validity instead of i_log_cluster_size. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 698a5c8c8e05590d92629ad5796a421e14218e20 Author: Yangtao Li Date: Sat Apr 8 02:31:47 2023 +0800 f2fs: add sanity compress level check for compressed file Commit 3fde13f817e2 ("f2fs: compress: support compress level") forgot to do basic compress level check, let's add it. Signed-off-by: Yangtao Li Signed-off-by: Jaegeuk Kim commit 00e120b5e4b5638cf19eee96d4332f2d100746ba Author: Jaegeuk Kim Date: Mon Jun 12 12:58:34 2023 -0700 f2fs: assign default compression level Let's avoid any confusion from assigning compress_level=0 for LZ4HC and ZSTD. Signed-off-by: Jaegeuk Kim commit ccf3ff2b30edd52fb54e239da25758fb22acfb78 Author: Chao Yu Date: Tue Jun 6 14:18:22 2023 +0800 f2fs: introduce F2FS_QUOTA_DEFAULT_FL for cleanup This patch adds F2FS_QUOTA_DEFAULT_FL to include two default flags: F2FS_NOATIME_FL and F2FS_IMMUTABLE_FL, and use it to clean up codes. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 8bec7dd1b3f7d7769d433d67bde404de948a2d95 Author: Chao Yu Date: Tue Jun 6 14:19:01 2023 +0800 f2fs: check return value of freeze_super() freeze_super() can fail, it needs to check its return value and do error handling in f2fs_resize_fs(). Fixes: 04f0b2eaa3b3 ("f2fs: ioctl for removing a range from F2FS") Fixes: b4b10061ef98 ("f2fs: refactor resize_fs to avoid meta updates in progress") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 25ed2d409f5ff73f1bde8e9b2863f686364cbc7f Author: Kashyap Desai Date: Fri Jun 16 11:47:00 2023 +0530 RDMA/bnxt_re: Refactor code around bnxt_qplib_map_rc() Update function comment of bnxt_qplib_map_rc() Remove intermediate return value ENXIO and directly called bnxt_qplib_map_rc() from __send_message_basic_sanity(). Link: https://lore.kernel.org/r/20230616061700.741769-2-kashyap.desai@broadcom.com Reported-by: Dan Carpenter Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit c8dce4e7438be24be7a5b8477555ba03c0fb16ae Author: Kashyap Desai Date: Fri Jun 16 11:46:59 2023 +0530 RDMA/bnxt_re: Remove incorrect return check from slow path The commit 691eb7c6110f ("RDMA/bnxt_re: handle command completions after driver detect a timedout") introduced code resulting in below warning issued by the smatch static checker. drivers/infiniband/hw/bnxt_re/qplib_rcfw.c:513 __bnxt_qplib_rcfw_send_message() warn: duplicate check 'rc' (previous on line 506) Fix the warning by removing incorrect code block. Fixes: 691eb7c6110f ("RDMA/bnxt_re: handle command completions after driver detect a timedout") Link: https://lore.kernel.org/r/20230616061700.741769-1-kashyap.desai@broadcom.com Reported-by: Dan Carpenter Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 009637de1f65cff452ad49554d1e8ef9fda99e43 Author: Yuechao Zhao Date: Mon Jun 12 11:19:07 2023 +0800 watchdog: sp5100_tco: support Hygon FCH/SCH (Server Controller Hub) Add PCI_VENDOR_ID_HYGON(Hygon vendor id [0x1d94]) in this driver Signed-off-by: Yuechao Zhao Reviewed-by: Guenter Roeck Link: https://lkml.kernel.org/r/20230612031907.796461-1-a345351830@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f4dc5290c0289d6958e185deeba47ea91c2c9cfb Author: Krzysztof Kozlowski Date: Tue May 30 16:48:51 2023 +0200 dt-bindings: watchdog: restrict node name suffixes Make the pattern matching node names a bit stricter to improve DTS consistency. The pattern is restricted to -N suffixes to decimal numbers. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Reviewed-by: Tony Lindgren Acked-by: Rob Herring Link: https://lkml.kernel.org/r/20230530144851.92059-8-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e62c63ffd06c376fcfd885c610d5228425627d7a Author: Srinivas Neeli Date: Thu Apr 20 16:12:31 2023 +0530 MAINTAINERS: Add support for Xilinx versal watchdog Added entry for Xilinx versal watchdog driver. Signed-off-by: Srinivas Neeli Reviewed-by: Guenter Roeck Link: https://lkml.kernel.org/r/20230420104231.2243079-5-srinivas.neeli@amd.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 12984cea1b8c54104f8ac7f5609dfcc0752ad741 Author: Srinivas Neeli Date: Thu Apr 20 16:12:30 2023 +0530 watchdog: xilinx_wwdt: Add Versal window watchdog support Versal watchdog driver uses window watchdog mode. Window watchdog timer(WWDT) contains closed(first) and open(second) window with 32 bit width. Write to the watchdog timer within predefined window periods of time. This means a period that is not too soon and a period that is not too late. The WWDT has to be restarted within the open window time. If software tries to restart WWDT outside of the open window time period, it generates a reset. Signed-off-by: Srinivas Neeli Reviewed-by: Guenter Roeck Link: https://lkml.kernel.org/r/20230420104231.2243079-4-srinivas.neeli@amd.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit be0d0ab1c704c8f93ee6c6d4b13a1e54ae927e3a Author: Srinivas Neeli Date: Thu Apr 20 16:12:29 2023 +0530 dt-bindings: watchdog: xlnx,versal-wwdt: Add versal watchdog Versal watchdog IP uses window watchdog mode. Window watchdog timer(WWDT) contains closed(first) and open(second) window with 32 bit width. Write to the watchdog timer within predefined window periods of time. This means a period that is not too soon and a period that is not too late. Add devicetree bindings for versal window watchdog device. Signed-off-by: Srinivas Neeli Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lkml.kernel.org/r/20230420104231.2243079-3-srinivas.neeli@amd.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 6cf2cc304fd9c37ea1a09b5c10279074e940f5f1 Author: Uwe Kleine-König Date: Thu May 25 23:08:37 2023 +0200 watchdog: ziirave_wdt: Switch i2c driver back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Guenter Roeck Link: https://lkml.kernel.org/r/20230525210837.735447-1-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 8d2e149ed61f5c0a49c36a81a09ff5808f4f17ad Author: Bagas Sanjaya Date: Wed May 17 14:21:40 2023 +0700 watchdog: ibmasr: Replace GPL license notice with SPDX identifier Replace unversioned GPL license notice with appropriate SPDX license identifier, which is GPL 1.0+. Cc: Andrey Panin Signed-off-by: Bagas Sanjaya Reviewed-by: Guenter Roeck Link: https://lkml.kernel.org/r/20230517072140.1086660-3-bagasdotme@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit a0d261ccd7eeb93accb4784e153315814a7656aa Author: Bagas Sanjaya Date: Wed May 17 14:21:39 2023 +0700 watchdog: Convert GPL 2.0 notice to SPDX identifier Convert the boilerplate to SPDX license identifier. While at it, also move SPDX identifier for drivers/watchdog/rtd119x_wdt.c to the top of file (as in other files). Cc: Ray Lehtiniemi , Cc: Alessandro Zummo Cc: H Hartley Sweeten Cc: Deepak Saxena Cc: Marc Zyngier Cc: Jonas Jensen Cc: Sylver Bruneau Cc: Denis Turischev Cc: Mika Westerberg Acked-by: Andreas Färber Signed-off-by: Bagas Sanjaya Acked-by: Mika Westerberg Acked-by: Ray Lehtiniemi Reviewed-by: Guenter Roeck Link: https://lkml.kernel.org/r/20230517072140.1086660-2-bagasdotme@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 20fbe6291e54739beb905e0b7fc45ba534cf644d Author: Keguang Zhang Date: Thu May 11 20:11:59 2023 +0800 watchdog: loongson1_wdt: Add DT support This patch adds the of_match_table to enable DT support of Loongson-1 watchdog driver. And modify the parameter of devm_clk_get_enabled() accordingly. Signed-off-by: Keguang Zhang Reviewed-by: Guenter Roeck Link: https://lkml.kernel.org/r/20230511121159.463645-3-keguang.zhang@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 85aeab362201cf52c34cd429e4f6c75a0b42f9a3 Author: Vijendar Mukunda Date: Mon Jun 26 16:23:54 2023 +0530 ASoC: amd: acp: fix for invalid dai id handling in acp_get_byte_count() For invalid dai id, instead of returning -EINVAL return bytes count as zero in acp_get_byte_count() function. Fixes: 623621a9f9e1 ("ASoC: amd: Add common framework to support I2S on ACP SOC") Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230626105356.2580125-6-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 68a653ab864ccf7874fe622f3af20fe7345c39be Author: Vijendar Mukunda Date: Mon Jun 26 16:23:53 2023 +0530 ASoC: amd: ps: fix byte count return value for invalid SoundWire manager instance acp_get_byte_count() function should return zero bytes instead of -EINVAL for invalid SoundWire manager instance. Fixes: f722917350ee ("ASoC: amd: ps: add SoundWire dma driver dma ops") Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230626105356.2580125-5-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 46b50e514b191ae15789cccabace5b6040c9278e Author: Vijendar Mukunda Date: Mon Jun 26 16:23:52 2023 +0530 ASoC: amd: ps: add comments for DMA register mapping Add comments for DMA register mapping for both the SoundWire manager instances. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230626105356.2580125-4-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit f15f6b294dde506bd4902db3262e9b4ab7e9e5a9 Author: Vijendar Mukunda Date: Mon Jun 26 16:23:51 2023 +0530 ASoC: amd: ps: fix for position register set for AUDIO0 RX stream For AUDIO0 RX stream, AUDIO0_RX position registers should be used. DMA error is reported due to referring wrong position register set for AUDIO0 RX stream. Correct the position register set for AUDIO0 RX stream. Fixes: f722917350ee ("ASoC: amd: ps: add SoundWire dma driver dma ops") Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230626105356.2580125-3-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 322a163ea6a38f63555d824c5b66c7df5a595c2d Author: Vijendar Mukunda Date: Mon Jun 26 16:23:50 2023 +0530 ASoC: amd: ps: add fix for dma irq mask for rx streams for SDW0 instance Correct the DMA irq mask macro to program DMA irq bits correctly for SDW0 instance rx streams. Fixes: 298d4f7b1765 ("ASoC: amd: ps: add support for SoundWire DMA interrupts") Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230626105356.2580125-2-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 7beda6a256ed10e74dc00fcd0fc8da0ad8fea78d Author: Vijendar Mukunda Date: Mon Jun 26 16:23:49 2023 +0530 ASoC: amd: ps: add comments for DMA irq bits mapping Add comments for DMA stream id and IRQ bit mapping in ACP_EXTERNAL_CNTL & ACP_EXTERNAL_CNTL1 registers for SDW0 and SDW1 manager instances. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230626105356.2580125-1-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 7b5162080174ae50e8288574379d339b0fcd1760 Author: Matthias Reichl Date: Sat Jun 24 18:52:32 2023 +0200 ASoC: hdmi-codec: fix channel info for compressed formats According to CTA 861 the channel/speaker allocation info in the audio infoframe only applies to uncompressed (PCM) audio streams. The channel count info should indicate the number of channels in the transmitted audio, which usually won't match the number of channels used to transmit the compressed bitstream. Some devices (eg some Sony TVs) will refuse to decode compressed audio if these values are not set correctly. To fix this we can simply set the channel count to 0 (which means "refer to stream header") and set the channel/speaker allocation to 0 as well (which would mean stereo FL/FR for PCM, a safe value all sinks will support) when transmitting compressed audio. Signed-off-by: Matthias Reichl Link: https://lore.kernel.org/r/20230624165232.5751-1-hias@horus.com Signed-off-by: Mark Brown commit dbe245cdf5189e88d680379ed13901356628b650 Author: Jason Gunthorpe Date: Tue Jun 20 11:11:24 2023 -0300 iommufd: Call iopt_area_contig_done() under the lock The iter internally holds a pointer to the area and iopt_area_contig_done() will dereference it. The pointer is not valid outside the iova_rwsem. syzkaller reports: BUG: KASAN: slab-use-after-free in iommufd_access_unpin_pages+0x363/0x370 Read of size 8 at addr ffff888022286e20 by task syz-executor669/5771 CPU: 0 PID: 5771 Comm: syz-executor669 Not tainted 6.4.0-rc5-syzkaller-00313-g4c605260bc60 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Call Trace: dump_stack_lvl+0xd9/0x150 print_address_description.constprop.0+0x2c/0x3c0 kasan_report+0x11c/0x130 iommufd_access_unpin_pages+0x363/0x370 iommufd_test_access_unmap+0x24b/0x390 iommufd_access_notify_unmap+0x24c/0x3a0 iopt_unmap_iova_range+0x4c4/0x5f0 iopt_unmap_all+0x27/0x50 iommufd_ioas_unmap+0x3d0/0x490 iommufd_fops_ioctl+0x317/0x4b0 __x64_sys_ioctl+0x197/0x210 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fec1dae3b19 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fec1da74308 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fec1db6b438 RCX: 00007fec1dae3b19 RDX: 0000000020000100 RSI: 0000000000003b86 RDI: 0000000000000003 RBP: 00007fec1db6b430 R08: 00007fec1da74700 R09: 0000000000000000 R10: 00007fec1da74700 R11: 0000000000000246 R12: 00007fec1db6b43c R13: 00007fec1db39074 R14: 6d6f692f7665642f R15: 0000000000022000 Allocated by task 5770: kasan_save_stack+0x22/0x40 kasan_set_track+0x25/0x30 __kasan_kmalloc+0xa2/0xb0 iopt_alloc_area_pages+0x94/0x560 iopt_map_user_pages+0x205/0x4e0 iommufd_ioas_map+0x329/0x5f0 iommufd_fops_ioctl+0x317/0x4b0 __x64_sys_ioctl+0x197/0x210 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5770: kasan_save_stack+0x22/0x40 kasan_set_track+0x25/0x30 kasan_save_free_info+0x2e/0x40 ____kasan_slab_free+0x160/0x1c0 slab_free_freelist_hook+0x8b/0x1c0 __kmem_cache_free+0xaf/0x2d0 iopt_unmap_iova_range+0x288/0x5f0 iopt_unmap_all+0x27/0x50 iommufd_ioas_unmap+0x3d0/0x490 iommufd_fops_ioctl+0x317/0x4b0 __x64_sys_ioctl+0x197/0x210 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd The parallel unmap free'd iter->area the instant the lock was released. Fixes: 51fe6141f0f6 ("iommufd: Data structure to provide IOVA to PFN mapping") Link: https://lore.kernel.org/r/2-v2-9a03761d445d+54-iommufd_syz2_jgg@nvidia.com Reviewed-by: Kevin Tian Reported-by: syzbot+6c8d756f238a75fc3eb8@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/000000000000905eba05fe38e9f2@google.com Signed-off-by: Jason Gunthorpe commit 804ca14d04df09bf7924bacc5ad22a4bed80c94f Author: Jason Gunthorpe Date: Tue Jun 20 11:11:23 2023 -0300 iommufd: Do not access the area pointer after unlocking A concurrent unmap can trigger freeing of the area pointers while we are generating an unmapping notification for accesses. syzkaller reports: BUG: KASAN: slab-use-after-free in iopt_unmap_iova_range+0x5ba/0x5f0 Read of size 4 at addr ffff888075996184 by task syz-executor.2/31160 CPU: 1 PID: 31160 Comm: syz-executor.2 Not tainted 6.4.0-rc5-syzkaller-00313-g4c605260bc60 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Call Trace: dump_stack_lvl+0xd9/0x150 print_address_description.constprop.0+0x2c/0x3c0 kasan_report+0x11c/0x130 iopt_unmap_iova_range+0x5ba/0x5f0 iopt_unmap_all+0x27/0x50 iommufd_ioas_unmap+0x3d0/0x490 iommufd_fops_ioctl+0x317/0x4b0 __x64_sys_ioctl+0x197/0x210 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0812c8c169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0813914168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f0812dabf80 RCX: 00007f0812c8c169 RDX: 0000000020000100 RSI: 0000000000003b86 RDI: 0000000000000005 RBP: 00007f0812ce7ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f0812ecfb1f R14: 00007f0813914300 R15: 0000000000022000 Allocated by task 31160: kasan_save_stack+0x22/0x40 kasan_set_track+0x25/0x30 __kasan_kmalloc+0xa2/0xb0 iopt_alloc_area_pages+0x94/0x560 iopt_map_user_pages+0x205/0x4e0 iommufd_ioas_map+0x329/0x5f0 iommufd_fops_ioctl+0x317/0x4b0 __x64_sys_ioctl+0x197/0x210 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 31161: kasan_save_stack+0x22/0x40 kasan_set_track+0x25/0x30 kasan_save_free_info+0x2e/0x40 ____kasan_slab_free+0x160/0x1c0 slab_free_freelist_hook+0x8b/0x1c0 __kmem_cache_free+0xaf/0x2d0 iopt_unmap_iova_range+0x288/0x5f0 iopt_unmap_all+0x27/0x50 iommufd_ioas_unmap+0x3d0/0x490 iommufd_fops_ioctl+0x317/0x4b0 __x64_sys_ioctl+0x197/0x210 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888075996100 which belongs to the cache kmalloc-cg-192 of size 192 The buggy address is located 132 bytes inside of freed 192-byte region [ffff888075996100, ffff8880759961c0) The buggy address belongs to the physical page: page:ffffea0001d66580 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x75996 memcg:ffff88801f1c2701 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff88801244ddc0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080100010 00000001ffffffff ffff88801f1c2701 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 31157, tgid 31154 (syz-executor.0), ts 1984547323469, free_ts 1983933451331 post_alloc_hook+0x2db/0x350 get_page_from_freelist+0xf41/0x2c00 __alloc_pages+0x1cb/0x4a0 alloc_pages+0x1aa/0x270 allocate_slab+0x25f/0x390 ___slab_alloc+0xa91/0x1400 __slab_alloc.constprop.0+0x56/0xa0 __kmem_cache_alloc_node+0x136/0x320 kmalloc_trace+0x26/0xe0 iommufd_test+0x1328/0x2c20 iommufd_fops_ioctl+0x317/0x4b0 __x64_sys_ioctl+0x197/0x210 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: free_unref_page_prepare+0x62e/0xcb0 free_unref_page_list+0xe3/0xa70 release_pages+0xcd8/0x1380 tlb_batch_pages_flush+0xa8/0x1a0 tlb_finish_mmu+0x14b/0x7e0 exit_mmap+0x2b2/0x930 __mmput+0x128/0x4c0 mmput+0x60/0x70 do_exit+0x9b0/0x29b0 do_group_exit+0xd4/0x2a0 get_signal+0x2318/0x25b0 arch_do_signal_or_restart+0x79/0x5c0 exit_to_user_mode_prepare+0x11f/0x240 syscall_exit_to_user_mode+0x1d/0x50 do_syscall_64+0x46/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd Precompute what is needed to call the access function and do not check the area's num_accesses again as the pointer may not be valid anymore. Use a counter instead. Fixes: 51fe6141f0f6 ("iommufd: Data structure to provide IOVA to PFN mapping") Link: https://lore.kernel.org/r/1-v2-9a03761d445d+54-iommufd_syz2_jgg@nvidia.com Reviewed-by: Kevin Tian Reported-by: syzbot+1ad12d16afca0e7d2dde@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/0000000000001d40fc05fe385332@google.com Signed-off-by: Jason Gunthorpe commit f18e7122cc73d9218930156fa38f050a2e37de57 Author: Randy Dunlap Date: Thu Jun 22 23:11:01 2023 -0700 linux/netfilter.h: fix kernel-doc warnings kernel-doc does not support DECLARE_PER_CPU(), so don't mark it with kernel-doc notation. One comment block is not kernel-doc notation, so just use "/*" to begin the comment. Quietens these warnings: netfilter.h:493: warning: Function parameter or member 'bool' not described in 'DECLARE_PER_CPU' netfilter.h:493: warning: Function parameter or member 'nf_skb_duplicated' not described in 'DECLARE_PER_CPU' netfilter.h:493: warning: expecting prototype for nf_skb_duplicated(). Prototype was for DECLARE_PER_CPU() instead netfilter.h:496: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Contains bitmask of ctnetlink event subscribers, if any. Fixes: e7c8899f3e6f ("netfilter: move tee_active to core") Fixes: fdf6491193e4 ("netfilter: ctnetlink: make event listener tracking global") Signed-off-by: Randy Dunlap Reviewed-by: Simon Horman Signed-off-by: Pablo Neira Ayuso commit ff0a3a7d52ff7282dbd183e7fc29a1fe386b0c30 Author: Florian Westphal Date: Wed Jun 21 17:56:53 2023 +0200 netfilter: conntrack: dccp: copy entire header to stack buffer, not just basic one Eric Dumazet says: nf_conntrack_dccp_packet() has an unique: dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh); And nothing more is 'pulled' from the packet, depending on the content. dh->dccph_doff, and/or dh->dccph_x ...) So dccp_ack_seq() is happily reading stuff past the _dh buffer. BUG: KASAN: stack-out-of-bounds in nf_conntrack_dccp_packet+0x1134/0x11c0 Read of size 4 at addr ffff000128f66e0c by task syz-executor.2/29371 [..] Fix this by increasing the stack buffer to also include room for the extra sequence numbers and all the known dccp packet type headers, then pull again after the initial validation of the basic header. While at it, mark packets invalid that lack 48bit sequence bit but where RFC says the type MUST use them. Compile tested only. v2: first skb_header_pointer() now needs to adjust the size to only pull the generic header. (Eric) Heads-up: I intend to remove dccp conntrack support later this year. Fixes: 2bc780499aa3 ("[NETFILTER]: nf_conntrack: add DCCP protocol support") Reported-by: Eric Dumazet Signed-off-by: Florian Westphal Reviewed-by: Eric Dumazet Signed-off-by: Pablo Neira Ayuso commit 6f67fbf8192da80c4db01a1800c7fceaca9cf1f9 Author: Jeremy Sowden Date: Mon Jun 19 20:06:57 2023 +0100 lib/ts_bm: reset initial match offset for every block of text The `shift` variable which indicates the offset in the string at which to start matching the pattern is initialized to `bm->patlen - 1`, but it is not reset when a new block is retrieved. This means the implemen- tation may start looking at later and later positions in each successive block and miss occurrences of the pattern at the beginning. E.g., consider a HTTP packet held in a non-linear skb, where the HTTP request line occurs in the second block: [... 52 bytes of packet headers ...] GET /bmtest HTTP/1.1\r\nHost: www.example.com\r\n\r\n and the pattern is "GET /bmtest". Once the first block comprising the packet headers has been examined, `shift` will be pointing to somewhere near the end of the block, and so when the second block is examined the request line at the beginning will be missed. Reinitialize the variable for each new block. Fixes: 8082e4ed0a61 ("[LIB]: Boyer-Moore extension for textsearch infrastructure strike #2") Link: https://bugzilla.netfilter.org/show_bug.cgi?id=1390 Signed-off-by: Jeremy Sowden Signed-off-by: Pablo Neira Ayuso commit 57c9eaa4de537e6f08819d9214de502cac5a989c Author: Luca Weiss Date: Sun Jun 25 13:11:33 2023 +0200 thermal/drivers/qcom/temp-alarm: Use dev_err_probe Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230625-spmi-temp-alarm-defer-v1-1-2d57acf36855@z3ntu.xyz commit 85b21fdec906ecd46856618910f8762afecbf1e9 Author: Chen-Yu Tsai Date: Tue Jun 20 17:07:32 2023 +0800 thermal/drivers/generic-adc: Register thermal zones as hwmon sensors Register thermal zones as hwmon sensors to let userspace read temperatures using standard hwmon interface. Signed-off-by: Chen-Yu Tsai [Yangtao: only keep devm_thermal_add_hwmon_sysfs] Signed-off-by: Yangtao Li Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620090732.50025-11-frank.li@vivo.com commit 27cc5be110fe76666bb1902d473b302dd09b6cbb Author: Yangtao Li Date: Tue Jun 20 17:07:31 2023 +0800 thermal/drivers/mediatek/lvts_thermal: Remove redundant msg in lvts_ctrl_start() The upper-layer devm_thermal_add_hwmon_sysfs() function can directly print error information. Signed-off-by: Yangtao Li Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620090732.50025-10-frank.li@vivo.com commit 7adbbb3b7b2a5bc413425fe001f8e237163c435f Author: Yangtao Li Date: Tue Jun 20 17:07:30 2023 +0800 thermal/drivers/qcom: Remove redundant msg at probe time The upper-layer devm_thermal_add_hwmon_sysfs() function can directly print error information. Signed-off-by: Yangtao Li Reviewed-by: Dmitry Baryshkov Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620090732.50025-9-frank.li@vivo.com commit a4ebd423749f4d5660533e451adf20585a236b1a Author: Yangtao Li Date: Tue Jun 20 17:07:29 2023 +0800 thermal/drivers/ti-soc: Remove redundant msg in ti_thermal_expose_sensor() The upper-layer devm_thermal_add_hwmon_sysfs() function can directly print error information. Signed-off-by: Yangtao Li Acked-by: Keerthy Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620090732.50025-8-frank.li@vivo.com commit f13582a42de70e5acf72c6ccd2b1472fb764d1d9 Author: Yangtao Li Date: Tue Jun 20 17:07:28 2023 +0800 thermal/drivers/qoriq: Remove redundant msg in qoriq_tmu_register_tmu_zone() The upper-layer devm_thermal_add_hwmon_sysfs() function can directly print error information. Signed-off-by: Yangtao Li Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620090732.50025-7-frank.li@vivo.com commit 2279e8f9275cb6e440c432716a1a29899c8d27c8 Author: Yangtao Li Date: Tue Jun 20 17:07:27 2023 +0800 thermal/drivers/tegra: Remove redundant msg in tegra_tsensor_register_channel() The upper-layer devm_thermal_add_hwmon_sysfs() function can directly print error information. Signed-off-by: Yangtao Li Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620090732.50025-6-frank.li@vivo.com commit 7c673ef5199dddb83d2b778cf6e71c1d183506e7 Author: Yangtao Li Date: Tue Jun 20 17:07:26 2023 +0800 drivers/thermal/k3: Remove redundant msg in k3_bandgap_probe() The upper-layer devm_thermal_add_hwmon_sysfs() function can directly print error information. Signed-off-by: Yangtao Li Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620090732.50025-5-frank.li@vivo.com commit b0526e02c60467b7f2b3b7660deba595d6d3d3d8 Author: Yangtao Li Date: Tue Jun 20 17:07:25 2023 +0800 thermal/drivers/imx: Remove redundant msg in imx8mm_tmu_probe() and imx_sc_thermal_probe() The upper-layer devm_thermal_add_hwmon_sysfs() function can directly print error information. Signed-off-by: Yangtao Li Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620090732.50025-4-frank.li@vivo.com commit c32719ace7909ae18547fa5a12e9dac2c92911d1 Author: Yangtao Li Date: Tue Jun 20 17:07:24 2023 +0800 thermal/drivers/amlogic: Remove redundant msg in amlogic_thermal_probe() The upper-layer devm_thermal_add_hwmon_sysfs() function can directly print error information. Signed-off-by: Yangtao Li Reviewed-by: Martin Blumenstingl Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620090732.50025-3-frank.li@vivo.com commit 07130d1da81138bd15b6b25cb8527a8191c73033 Author: Yangtao Li Date: Tue Jun 20 17:07:23 2023 +0800 thermal/drivers/sun8i: Remove redundant msg in sun8i_ths_register() The upper-layer devm_thermal_add_hwmon_sysfs() function can directly print error information. Signed-off-by: Yangtao Li Acked-by: Jernej Skrabec Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620090732.50025-2-frank.li@vivo.com commit 8416ecfb3292321c55719c7c1a69dec7769bfbc1 Author: Yangtao Li Date: Tue Jun 20 17:07:22 2023 +0800 thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Ensure that all error handling branches print error information. In this way, when this function fails, the upper-layer functions can directly return an error code without missing debugging information. Otherwise, the error message will be printed redundantly or missing. Signed-off-by: Yangtao Li Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620090732.50025-1-frank.li@vivo.com commit 2ef9533134fe8e0011e6d3532aa8ef071c34c5e4 Author: Uwe Kleine-König Date: Fri Jun 16 18:56:41 2023 +0200 thermal/drivers/stm32: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. st_thermal_unregister() always returned zero, so convert it to return void without any loss and then just drop the return from st_mmap_remove(). Signed-off-by: Uwe Kleine-König Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230616165641.1055854-1-u.kleine-koenig@pengutronix.de commit a5639fade0cfe5a45584f2770811034dab43baaa Author: Daniel Lezcano Date: Thu May 25 16:01:28 2023 +0200 net/mlx5: Update the driver with the recent thermal changes The thermal framework is migrating to the generic trip points. The set of changes also implies a self-encapsulation of the thermal zone device structure where the internals are no longer directly accessible but with accessors. Use the new API instead, so the next changes can be pushed in the thermal framework without this driver failing to compile. No functional changes intended. Cc: Sandipan Patra Cc: Gal Pressman Cc: Saeed Mahameed Cc: Jakub Kicinski Signed-off-by: Daniel Lezcano Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230525140135.3589917-2-daniel.lezcano@linaro.org commit 62a094e757a75b5d0a63dfe17a7c17ab2da330fd Author: Alex Leibovich Date: Fri Jun 16 12:50:42 2023 +0100 thermal/drivers/armada: Add support for AP807 thermal data Add support for the AP807 die thermal data. This is the same as AP806, except for the coefficients. ap807 values taken from TSENSE_ADC_16FFC spec, which says: T(in Celsius) = T(code)*TSENE_GAIN+TSENE_OFFSET where in default: TSENE_OFFSET = 128.9 TSENE_GAIN = 0.394 Signed-off-by: Alex Leibovich Tested-by: sa_ip-sw-jenkins Reviewed-by: Stefan Chulski Signed-off-by: Russell King (Oracle) Reviewed-by: Miquel Raynal Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/E1qA7yU-00Ea4u-Je@rmk-PC.armlinux.org.uk commit 705fd8f189124eae20f746a374d1cb63856d06b7 Author: Alex Leibovich Date: Fri Jun 16 12:50:37 2023 +0100 dt-bindings: armada-thermal: Add armada-ap807-thermal compatible Add marvell,armada-ap807-thermal compatible for the AP807 die. Signed-off-by: Alex Leibovich Reviewed-by: Stefan Chulski Signed-off-by: Russell King (Oracle) Acked-by: Krzysztof Kozlowski Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/E1qA7yP-00Ea4o-FS@rmk-PC.armlinux.org.uk commit f12d60c81fceccddc012c746085f6cd87832d6ff Author: Peng Fan Date: Tue May 16 16:37:46 2023 +0800 thermal/drivers/qoriq: Support version 2.1 i.MX93 use TMU version 2.1, which supports: - TRITSR_TP5(When this field is 1, you must add 0.5 K to the temperature that TEMP reports. For example, if TEMP is 300 K and TP5=1, then the final temperature is 300.5 K.) - Has 16 TTRCR register: Temperature Range Control (TTRCR0 - TTRCR15) This patch is to add this support. Signed-off-by: Peng Fan Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230516083746.63436-4-peng.fan@oss.nxp.com commit 9301575df2509ecf8bd66f601046afaff606b1d5 Author: Peng Fan Date: Tue May 16 16:37:45 2023 +0800 thermal/drivers/qoriq: Only enable supported sensors There are MAX 16 sensors, but not all of them supported. Such as i.MX8MQ, there are only 3 sensors. Enabling all 16 sensors will touch reserved bits from i.MX8MQ reference mannual, and TMU will stuck, temperature will not update anymore. Fixes: 45038e03d633 ("thermal: qoriq: Enable all sensors before registering them") Signed-off-by: Peng Fan Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230516083746.63436-3-peng.fan@oss.nxp.com commit 5474e98b3e28918f77c10787f6ce9e1937e4fb78 Author: Pankit Garg Date: Tue May 16 16:37:44 2023 +0800 thermal/drivers/qoriq: No need to program site adjustment register No need to program site adjustment register, as programming these registers do not give accurate value and also these registers are not mentioned in Reference Manual. Signed-off-by: Pankit Garg Signed-off-by: Peng Fan Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230516083746.63436-2-peng.fan@oss.nxp.com commit 51c8e119335a2a0c7fa6156ecd18a729e2aa3693 Author: Chen-Yu Tsai Date: Tue Jun 13 17:13:16 2023 +0800 thermal/drivers/mediatek/lvts_thermal: Register thermal zones as hwmon sensors Register thermal zones as hwmon sensors to let userspace read temperatures using standard hwmon interface. Signed-off-by: Chen-Yu Tsai Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230613091317.1691247-1-wenst@chromium.org commit 89382022b370dfd34eaae9c863baa123fcd4d132 Author: Christophe JAILLET Date: Sun May 14 20:46:05 2023 +0200 thermal/drivers/sun8i: Fix some error handling paths in sun8i_ths_probe() Should an error occur after calling sun8i_ths_resource_init() in the probe function, some resources need to be released, as already done in the .remove() function. Switch to the devm_clk_get_enabled() helper and add a new devm_action to turn sun8i_ths_resource_init() into a fully managed function. Move the place where reset_control_deassert() is called so that the recommended order of reset release/clock enable steps is kept. A64 manual states that: 3.3.6.4. Gating and reset Make sure that the reset signal has been released before the release of module clock gating; This fixes the issue and removes some LoC at the same time. Fixes: dccc5c3b6f30 ("thermal/drivers/sun8i: Add thermal driver for H6/H5/H3/A64/A83T/R40") Signed-off-by: Christophe JAILLET Acked-by: Maxime Ripard Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/a8ae84bd2dc4b55fe428f8e20f31438bf8bb6762.1684089931.git.christophe.jaillet@wanadoo.fr commit 86edac7d3888c715fe3a81bd61f3617ecfe2e1dd Author: Ricardo Cañuelo Date: Thu May 25 14:18:11 2023 +0200 Revert "thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe" This reverts commit f05c7b7d9ea9477fcc388476c6f4ade8c66d2d26. That change was causing a regression in the generic-adc-thermal-probed bootrr test as reported in the kernelci-results list [1]. A proper rework will take longer, so revert it for now. [1] https://groups.io/g/kernelci-results/message/42660 Fixes: f05c7b7d9ea9 ("thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe") Signed-off-by: Ricardo Cañuelo Suggested-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230525121811.3360268-1-ricardo.canuelo@collabora.com commit 4af164c1c11895adcf0181a6c627fbcacf439107 Author: Stephan Gerhold Date: Wed Jun 7 12:47:49 2023 +0200 thermal/drivers/qcom/tsens-v0_1: Add MSM8909 data The MSM8909 SoC has 5 thermal sensors in a TSENS v0.1 block. Like MDM9607 it uses a non-standard default slope value of 3000 [1] and needs per-sensor "correction factors" to workaround issues with the factory calibration [2]. [1]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/blob/LA.UM.7.7.c26-09100-8x09.0/arch/arm/boot/dts/qcom/msm8909.dtsi#L476 [2]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/commit/6df022c6d0c2c1b4a5a6c2124dba4d57910c0911 Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Signed-off-by: Stephan Gerhold Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230508-msm8909-tsens-v5-6-5eb632235ba7@kernkonzept.com commit ba3bcfebea97311a0f1f9167f584c0df32409d90 Author: Stephan Gerhold Date: Wed Jun 7 12:47:48 2023 +0200 dt-bindings: thermal: qcom-tsens: Add MSM8909 compatible MSM8909 uses the TSENS v0.1 block similar to other SoCs like MDM9607. Document the "qcom,msm8909-tsens" compatible in the existing schema. Acked-by: Krzysztof Kozlowski Signed-off-by: Stephan Gerhold Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230508-msm8909-tsens-v5-5-5eb632235ba7@kernkonzept.com commit a06027820da7d480cc24b82a977953a5c4e01df4 Author: Stephan Gerhold Date: Wed Jun 7 12:47:47 2023 +0200 dt-bindings: thermal: qcom-tsens: Drop redundant compatibles Since the SoC compatibles must be followed by the IP version compatible (e.g. compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";) it is redundant to list all the SoC compatibles again in the if statement. It will already match the IP-version compatible. The list has already become inconsistent since for example "qcom,msm8939-tsens" is covered by the if statement but is not listed there explicitly like the other SoCs. Simplify this by dropping the redundant SoC compatibles. ipq8064 and msm8960 are still needed because they do not have an IP-version compatible. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Stephan Gerhold Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230508-msm8909-tsens-v5-4-5eb632235ba7@kernkonzept.com commit b6f739da0070c36655118618a173a59fa14c7adc Author: Stephan Gerhold Date: Wed Jun 7 12:47:46 2023 +0200 thermal/drivers/qcom/tsens-v0_1: Add mdm9607 correction offsets According to the msm-3.18 vendor kernel from Qualcomm, mdm9607 needs "correction factors" to adjust for additional offsets observed after the factory calibration values in the fuses [1, 2]. The fixed offsets should be applied unless there is a special calibration mode value that indicates that no offsets are needed [3]. Note that the new calibration mode values are called differently in this patch compared to the vendor kernel: - TSENS_TWO_POINT_CALIB_N_WA -> ONE_PT_CALIB2_NO_OFFSET - TSENS_TWO_POINT_CALIB_N_OFFSET_WA -> TWO_PT_CALIB_NO_OFFSET This is because close inspection of the calibration function [3] reveals that TSENS_TWO_POINT_CALIB_N_WA is actually a "one point" calibration because the if statements skip all "point2" related code for it. [1]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/commit/d9d2db1b82bf3f72f5de0803d55e6849eb5b671e [2]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/commit/d75aef53a760e8ff7bac54049d00c8b2ee1b193e [3]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/blob/LE.UM.4.3.2.r1-04200-9x07/drivers/thermal/msm-tsens.c#L2987-3136 Fixes: a2149ab815fc ("thermal/drivers/qcom/tsens-v0_1: Add support for MDM9607") Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Signed-off-by: Stephan Gerhold Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230508-msm8909-tsens-v5-3-5eb632235ba7@kernkonzept.com commit 6812d1dfbca99cd5032683354bf50e0002b2aa02 Author: Stephan Gerhold Date: Wed Jun 7 12:47:45 2023 +0200 thermal/drivers/qcom/tsens-v0_1: Fix mdm9607 slope values According to the msm-3.18 vendor kernel from Qualcomm [1], mdm9607 uses a non-standard slope value of 3000 (instead of 3200) for all sensors. Fill it properly similar to the 8939 code added recently. [1]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/blob/LE.UM.4.3.2.r1-04200-9x07/arch/arm/boot/dts/qcom/mdm9607.dtsi#L875 Fixes: a2149ab815fc ("thermal/drivers/qcom/tsens-v0_1: Add support for MDM9607") Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Signed-off-by: Stephan Gerhold Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230508-msm8909-tsens-v5-2-5eb632235ba7@kernkonzept.com commit c631da1f19263969fcdc04a98b14401466756e8d Author: Stephan Gerhold Date: Wed Jun 7 12:47:44 2023 +0200 thermal/drivers/qcom/tsens: Drop unused legacy structs The old single-cell parsing code was removed for MSM8939, MDM9607 and MSM8976 but for some reason the structs defining the bit positions etc were kept around (unused). Drop them now. Cc: Dmitry Baryshkov Fixes: 51d78b8b1beb ("thermal/drivers/tsens: Drop single-cell code for mdm9607") Fixes: dfadb4599ab0 ("thermal/drivers/tsens: Drop single-cell code for msm8939") Fixes: 3a908971f7cb ("thermal/drivers/tsens: Drop single-cell code for msm8976/msm8956") Reviewed-by: Konrad Dybcio Signed-off-by: Stephan Gerhold Reviewed-by: Dmitry Baryshkov Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230508-msm8909-tsens-v5-1-5eb632235ba7@kernkonzept.com commit 074ccf8d6ce9f344d3099d9a24d762e0e2ef8b99 Author: Praveenkumar I Date: Wed Jun 7 14:23:08 2023 +0530 dt-bindings: thermal: tsens: Add ipq9574 compatible Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Praveenkumar I Signed-off-by: Varadarajan Narayanan Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/ec9799504fe5a141e107bb78955d8d427f00553f.1686125196.git.quic_varada@quicinc.com commit e74491dee6216144ef1d25b0ad5d028cadfcf8c1 Author: Stefan Wahren Date: Sun Jun 4 14:12:22 2023 +0200 dt-bindings: thermal: convert bcm2835-thermal bindings to YAML Convert the DT binding document for bcm2835-thermal from .txt to YAML. Signed-off-by: Stefan Wahren Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230604121223.9625-10-stefan.wahren@i2se.com commit 04bf1fe478d81868308bc91b4a1bce50d693f203 Author: Thierry Reding Date: Fri Jun 9 14:44:08 2023 +0200 thermal: Allow selecting the bang-bang governor as default For many setups the bang-bang governor is exactly what we want. Many ARM SoC-based devices use fans to cool down the entire SoC and that works well only with the bang-bang governor because it uses the hysteresis in order to let the fan run for a while to cool the SoC down below the trip point before switching it off again. The step-wise governor will behave strangely in these situations. It doesn't use the hysteresis, so it can lead to situations where the fan is turned on for only a very brief period and then is switched back off, only to get switched back on again very quickly because the SoC hasn't cooled down very much. Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20230609124408.3788680-1-thierry.reding@gmail.com Signed-off-by: Daniel Lezcano commit 598e1afca47fdbb302ce8d288b06bcc8728efc6c Author: Matti Lehtimäki Date: Sun May 7 23:12:21 2023 +0300 thermal/drivers/qcom/tsens-v0_1: Add support for MSM8226 The MSM8226 TSENS IP has 6 thermal sensors in a TSENS v0.1 block. The thermal sensors use non-standard slope values. Signed-off-by: Matti Lehtimäki Reviewed-by: Dmitry Baryshkov Reviewed-by: Luca Weiss Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230507201225.89694-4-matti.lehtimaki@gmail.com commit 065ab3abf97a3f26fdd2e05bc6b09e41ced36826 Author: Matti Lehtimäki Date: Sun May 7 23:12:20 2023 +0300 dt-bindings: thermal: tsens: Add compatible for MSM8226 Qualcomm MSM8226 has tsens v0.1 block. Signed-off-by: Matti Lehtimäki Reviewed-by: Krzysztof Kozlowski Reviewed-by: Luca Weiss Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230507201225.89694-3-matti.lehtimaki@gmail.com commit edeab75b13c0d4c7373c9624ab35361a5c9b3f0c Author: Wolfram Sang Date: Thu May 11 21:22:19 2023 +0200 drivers/thermal/rcar_gen3_thermal: add reading fuses for Gen4 The registers are differently named and at different offsets, but their functionality is the same as for Gen3. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230511192220.7523-4-wsa+renesas@sang-engineering.com commit a216261d2495c4539ddff3740f3a2c0932981d4d Author: Wolfram Sang Date: Thu May 11 21:22:18 2023 +0200 drivers/thermal/rcar_gen3_thermal: refactor reading fuses into seprarate function Gen4 will be very different, so refactor Gen3 access into separate call first. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230511192220.7523-3-wsa+renesas@sang-engineering.com commit fe3bfa7539b834f38487f8b5a8c350f99721e7b8 Author: Wolfram Sang Date: Thu May 11 21:22:17 2023 +0200 drivers/thermal/rcar_gen3_thermal: introduce 'info' structure More items to describe the TSCs are needed soon, so encapsulate the current 'ths_tj_1' item into a struct. Signed-off-by: Wolfram Sang Reviewed-by: Niklas Söderlund Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230511192220.7523-2-wsa+renesas@sang-engineering.com commit 0849027b093b370f4b2b91e36f5fb2ce2051b1b5 Author: Konrad Dybcio Date: Tue May 16 13:53:59 2023 +0200 dt-bindings: thermal: tsens: Add compatible for SM6375 The Qualcomm SM6375 platform has two instances of the tsens v2.8.0 block, add a compatible for these instances. Acked-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230516-topic-lost_tsens_bindings-v1-2-99715746ddb1@linaro.org commit 05570560d2d43381861f704e648ab88d3960e46f Author: Konrad Dybcio Date: Tue May 16 13:53:58 2023 +0200 dt-bindings: thermal: tsens: Add QCM2290 Add the TSENS v2.x controller found on QCM2290. Acked-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230516-topic-lost_tsens_bindings-v1-1-99715746ddb1@linaro.org commit 6709d4b7bc2e079241fdef15d1160581c5261c10 Author: Lin Ma Date: Sun Jun 25 17:10:07 2023 +0800 net: nfc: Fix use-after-free caused by nfc_llcp_find_local This commit fixes several use-after-free that caused by function nfc_llcp_find_local(). For example, one UAF can happen when below buggy time window occurs. // nfc_genl_llc_get_params | // nfc_unregister_device | dev = nfc_get_device(idx); | device_lock(...) if (!dev) | dev->shutting_down = true; return -ENODEV; | device_unlock(...); | device_lock(...); | // nfc_llcp_unregister_device | nfc_llcp_find_local() nfc_llcp_find_local(...); | | local_cleanup() if (!local) { | rc = -ENODEV; | // nfc_llcp_local_put goto exit; | kref_put(.., local_release) } | | // local_release | list_del(&local->list) // nfc_genl_send_params | kfree() local->dev->idx !!!UAF!!! | | and the crash trace for the one of the discussed UAF like: BUG: KASAN: slab-use-after-free in nfc_genl_llc_get_params+0x72f/0x780 net/nfc/netlink.c:1045 Read of size 8 at addr ffff888105b0e410 by task 20114 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x72/0xa0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:319 [inline] print_report+0xcc/0x620 mm/kasan/report.c:430 kasan_report+0xb2/0xe0 mm/kasan/report.c:536 nfc_genl_send_params net/nfc/netlink.c:999 [inline] nfc_genl_llc_get_params+0x72f/0x780 net/nfc/netlink.c:1045 genl_family_rcv_msg_doit.isra.0+0x1ee/0x2e0 net/netlink/genetlink.c:968 genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline] genl_rcv_msg+0x503/0x7d0 net/netlink/genetlink.c:1065 netlink_rcv_skb+0x161/0x430 net/netlink/af_netlink.c:2548 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1076 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x644/0x900 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x934/0xe70 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0x1b6/0x200 net/socket.c:747 ____sys_sendmsg+0x6e9/0x890 net/socket.c:2501 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2555 __sys_sendmsg+0xf7/0x1d0 net/socket.c:2584 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f34640a2389 RSP: 002b:00007f3463415168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f34641c1f80 RCX: 00007f34640a2389 RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000006 RBP: 00007f34640ed493 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe38449ecf R14: 00007f3463415300 R15: 0000000000022000 Allocated by task 20116: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x7f/0x90 mm/kasan/common.c:383 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] nfc_llcp_register_device+0x49/0xa40 net/nfc/llcp_core.c:1567 nfc_register_device+0x61/0x260 net/nfc/core.c:1124 nci_register_device+0x776/0xb20 net/nfc/nci/core.c:1257 virtual_ncidev_open+0x147/0x230 drivers/nfc/virtual_ncidev.c:148 misc_open+0x379/0x4a0 drivers/char/misc.c:165 chrdev_open+0x26c/0x780 fs/char_dev.c:414 do_dentry_open+0x6c4/0x12a0 fs/open.c:920 do_open fs/namei.c:3560 [inline] path_openat+0x24fe/0x37e0 fs/namei.c:3715 do_filp_open+0x1ba/0x410 fs/namei.c:3742 do_sys_openat2+0x171/0x4c0 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0x143/0x200 fs/open.c:1383 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc Freed by task 20115: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x50 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free mm/kasan/common.c:200 [inline] __kasan_slab_free+0x10a/0x190 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0x7a/0x190 mm/slub.c:3800 local_release net/nfc/llcp_core.c:174 [inline] kref_put include/linux/kref.h:65 [inline] nfc_llcp_local_put net/nfc/llcp_core.c:182 [inline] nfc_llcp_local_put net/nfc/llcp_core.c:177 [inline] nfc_llcp_unregister_device+0x206/0x290 net/nfc/llcp_core.c:1620 nfc_unregister_device+0x160/0x1d0 net/nfc/core.c:1179 virtual_ncidev_close+0x52/0xa0 drivers/nfc/virtual_ncidev.c:163 __fput+0x252/0xa20 fs/file_table.c:321 task_work_run+0x174/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x108/0x110 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x21/0x50 kernel/entry/common.c:297 do_syscall_64+0x4c/0x90 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x72/0xdc Last potentially related work creation: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x95/0xb0 mm/kasan/generic.c:491 kvfree_call_rcu+0x29/0xa80 kernel/rcu/tree.c:3328 drop_sysctl_table+0x3be/0x4e0 fs/proc/proc_sysctl.c:1735 unregister_sysctl_table.part.0+0x9c/0x190 fs/proc/proc_sysctl.c:1773 unregister_sysctl_table+0x24/0x30 fs/proc/proc_sysctl.c:1753 neigh_sysctl_unregister+0x5f/0x80 net/core/neighbour.c:3895 addrconf_notify+0x140/0x17b0 net/ipv6/addrconf.c:3684 notifier_call_chain+0xbe/0x210 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x150 net/core/dev.c:1937 call_netdevice_notifiers_extack net/core/dev.c:1975 [inline] call_netdevice_notifiers net/core/dev.c:1989 [inline] dev_change_name+0x3c3/0x870 net/core/dev.c:1211 dev_ifsioc+0x800/0xf70 net/core/dev_ioctl.c:376 dev_ioctl+0x3d9/0xf80 net/core/dev_ioctl.c:542 sock_do_ioctl+0x160/0x260 net/socket.c:1213 sock_ioctl+0x3f9/0x670 net/socket.c:1316 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x19e/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc The buggy address belongs to the object at ffff888105b0e400 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 16 bytes inside of freed 1024-byte region [ffff888105b0e400, ffff888105b0e800) The buggy address belongs to the physical page: head:ffffea000416c200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x200000000010200(slab|head|node=0|zone=2) raw: 0200000000010200 ffff8881000430c0 ffffea00044c7010 ffffea0004510e10 raw: 0000000000000000 00000000000a000a 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888105b0e300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888105b0e380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888105b0e400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888105b0e480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888105b0e500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb In summary, this patch solves those use-after-free by 1. Re-implement the nfc_llcp_find_local(). The current version does not grab the reference when getting the local from the linked list. For example, the llcp_sock_bind() gets the reference like below: // llcp_sock_bind() local = nfc_llcp_find_local(dev); // A ..... \ | raceable ..... / llcp_sock->local = nfc_llcp_local_get(local); // B There is an apparent race window that one can drop the reference and free the local object fetched in (A) before (B) gets the reference. 2. Some callers of the nfc_llcp_find_local() do not grab the reference at all. For example, the nfc_genl_llc_{{get/set}_params/sdreq} functions. We add the nfc_llcp_local_put() for them. Moreover, we add the necessary error handling function to put the reference. 3. Add the nfc_llcp_remove_local() helper. The local object is removed from the linked list in local_release() when all reference is gone. This patch removes it when nfc_llcp_unregister_device() is called. Therefore, every caller of nfc_llcp_find_local() will get a reference even when the nfc_llcp_unregister_device() is called. This promises no use-after-free for the local object is ever possible. Fixes: 52feb444a903 ("NFC: Extend netlink interface for LTO, RW, and MIUX parameters support") Fixes: c7aa12252f51 ("NFC: Take a reference on the LLCP local pointer when creating a socket") Signed-off-by: Lin Ma Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 771ca3de25028c477332bf8b8c2db3a4dd769de2 Merge: 9ae440b8fdd67 1186c6b31ee14 Author: David S. Miller Date: Mon Jun 26 10:36:48 2023 +0100 Merge branch 'sfc-next' Edward Cree says: ==================== sfc: fix unaligned access in loopback selftests Arnd reported that the sfc drivers each define a packed loopback_payload structure with an ethernet header followed by an IP header, whereas the kernel definition of iphdr specifies that this is 4-byte aligned, causing a W=1 warning. Fix this in each case by adding two bytes of leading padding to the struct, taking care that these are not sent on the wire. Tested on EF10; build-tested on Siena and Falcon. Changed in v2: * added __aligned(4) to payload struct definitions (Arnd) * fixed dodgy whitespace (checkpatch) ==================== Signed-off-by: David S. Miller commit 1186c6b31ee14fa1e83f5a94be0daa9bc99f9b30 Author: Edward Cree Date: Fri Jun 23 19:38:06 2023 +0100 sfc: falcon: use padding to fix alignment in loopback test Add two bytes of padding to the start of struct ef4_loopback_payload, which are not sent on the wire. This ensures the 'ip' member is 4-byte aligned, preventing the following W=1 warning: net/ethernet/sfc/falcon/selftest.c:43:15: error: field ip within 'struct ef4_loopback_payload' is less aligned than 'struct iphdr' and is usually due to 'struct ef4_loopback_payload' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] struct iphdr ip; Reported-by: Arnd Bergmann Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 30c24dd87f3f4640ee3dc693230f343023227c1c Author: Edward Cree Date: Fri Jun 23 19:38:05 2023 +0100 sfc: siena: use padding to fix alignment in loopback test Add two bytes of padding to the start of struct efx_loopback_payload, which are not sent on the wire. This ensures the 'ip' member is 4-byte aligned, preventing the following W=1 warning: net/ethernet/sfc/siena/selftest.c:46:15: error: field ip within 'struct efx_loopback_payload' is less aligned than 'struct iphdr' and is usually due to 'struct efx_loopback_payload' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] struct iphdr ip; Reported-by: Arnd Bergmann Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit cf60ed469629927fe43c2f4b4ef28a563d991935 Author: Edward Cree Date: Fri Jun 23 19:38:04 2023 +0100 sfc: use padding to fix alignment in loopback test Add two bytes of padding to the start of struct efx_loopback_payload, which are not sent on the wire. This ensures the 'ip' member is 4-byte aligned, preventing the following W=1 warning: net/ethernet/sfc/selftest.c:46:15: error: field ip within 'struct efx_loopback_payload' is less aligned than 'struct iphdr' and is usually due to 'struct efx_loopback_payload' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] struct iphdr ip; Reported-by: Arnd Bergmann Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit b5ec6fd286dfa466f64cb0e56ed768092d0342ae Author: Peter Zijlstra Date: Fri Jun 9 11:28:30 2023 +0200 kbuild: Drop -Wdeclaration-after-statement With the advent on scope-based resource management it comes really tedious to abide by the contraints of -Wdeclaration-after-statement. It will still be recommeneded to place declarations at the start of a scope where possible, but it will no longer be enforced. Suggested-by: Linus Torvalds Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/CAHk-%3Dwi-RyoUhbChiVaJZoZXheAwnJ7OO%3DGxe85BkPAd93TwDA%40mail.gmail.com commit 54da6a0924311c7cf5015533991e44fb8eb12773 Author: Peter Zijlstra Date: Fri May 26 12:23:48 2023 +0200 locking: Introduce __cleanup() based infrastructure Use __attribute__((__cleanup__(func))) to build: - simple auto-release pointers using __free() - 'classes' with constructor and destructor semantics for scope-based resource management. - lock guards based on the above classes. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230612093537.614161713%40infradead.org commit 9a1f37ebcfe061721564042254719dc8fd5c9fa0 Author: Peter Zijlstra Date: Fri Jun 9 09:48:59 2023 +0200 apparmor: Free up __cleanup() name In order to use __cleanup for __attribute__((__cleanup__(func))) the name must not be used for anything else. Avoid the conflict. Signed-off-by: Peter Zijlstra (Intel) Acked-by: John Johansen Link: https://lkml.kernel.org/r/20230612093537.536441207%40infradead.org commit f62141ac730d6fe73a05750cb4482aabb681cfb9 Author: Peter Zijlstra Date: Tue Sep 27 11:32:41 2022 +0200 dmaengine: ioat: Free up __cleanup() name In order to use __cleanup for __attribute__((__cleanup__(func))) the name must not be used for anything else. Avoid the conflict. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Dave Jiang Link: https://lkml.kernel.org/r/20230612093537.467120754%40infradead.org commit f121ab7f4ac32ed2aa51035534926f9507a8308b Merge: 721255b9826bd a82f3119d5434 Author: Thomas Gleixner Date: Mon Jun 26 11:05:49 2023 +0200 Merge tag 'irqchip-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core Pull irqchip updates from Marc Zyngier: - A number of Loogson/Loogarch fixes - Allow the core code to retrigger an interrupt that has fired while the same interrupt is being handled on another CPU, papering over a GICv3 architecture issue - Work around an integration problem on ASR8601, where the CPU numbering isn't representable in the GIC implementation... - Add some missing interrupt to the STM32 irqchip - A bunch of warning squashing triggered by W=1 builds Link: https://lore.kernel.org/r/20230623224345.3577134-1-maz@kernel.org commit adfdaf81f9d48d8618a4d8296567248170fe7bcc Author: Greg Kroah-Hartman Date: Mon Jun 26 11:03:21 2023 +0200 bsr: fix build problem with bsr_class static cleanup In commit e55ce9fd3d8f ("bsr: make bsr_class a static const structure"), the bsr_init function was converted to handle a static class structure, but the conversion got a variable name wrong, which caused build errors so fix that up. Cc: Arnd Bergmann Cc: Ivan Orlov Reported-by: Stephen Rothwell Link: https://lore.kernel.org/r/20230626142537.755ec782@canb.auug.org.au Fixes: e55ce9fd3d8f ("bsr: make bsr_class a static const structure") Signed-off-by: Greg Kroah-Hartman commit d2b32be7debd6c0deeae95844997bd89fbe4769d Merge: ccaa4926c2264 8b5bf64c89c71 Author: Thomas Gleixner Date: Mon Jun 26 11:04:01 2023 +0200 Merge tag 'timers-v6.5-rc1' of https://git.linaro.org/people/daniel.lezcano/linux into timers/core Pull clockevent/source updates from Daniel Lezcano: - Fix memory leak on Cadence TTC at probe time (Feng Mingxi) - Use the pm_sleep_ptr macro for the Ingenic driver (Paul Cercueil) - Relocate the PMW timer Loongson from the mips arch directory to the drivers/clocksource (Keguang Zhang) - Use the same function names instead of using aliases and move data defined in the header to the driver directly as this one is the only user of the header file and remove this one on i.MX GPT (Uwe Kleine-König) - Convert Broadcom Kona family timer bindings to DT schema (Michael Kelley) - Add DT bindings for Ralink SoCs timer (Sergio Paracuellos) commit d1b355438b8325a486f087e506d412c4e852f37b Author: Edward Cree Date: Fri Jun 23 15:34:48 2023 +0100 sfc: fix crash when reading stats while NIC is resetting efx_net_stats() (.ndo_get_stats64) can be called during an ethtool selftest, during which time nic_data->mc_stats is NULL as the NIC has been fini'd. In this case do not attempt to fetch the latest stats from the hardware, else we will crash on a NULL dereference: BUG: kernel NULL pointer dereference, address: 0000000000000038 RIP efx_nic_update_stats abridged calltrace: efx_ef10_update_stats_pf efx_net_stats dev_get_stats dev_seq_printf_stats Skipping the read is safe, we will simply give out stale stats. To ensure that the free in efx_ef10_fini_nic() does not race against efx_ef10_update_stats_pf(), which could cause a TOCTTOU bug, take the efx->stats_lock in fini_nic (it is already held across update_stats). Fixes: d3142c193dca ("sfc: refactor EF10 stats handling") Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 49ad6e913786fad6dd6209ef812437dc3009ebc4 Author: Suraj Kandpal Date: Thu Jun 22 14:02:53 2023 +0530 drm/i915/hdcp: Assign correct hdcp content type Currently hdcp->content_type is being assigned the content_type field in drm_connector_state which is wrong and instead it needs to be assigned hdcp_content_type field from drm_connector_state Fixes: 4c4279a8d58d ("drm/i915/hdcp: add intel_atomic_state argument to hdcp_enable function") Cc: Jani Nikula Cc: Ankit Nautiyal Cc: Animesh Manna Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Ankit Nautiyal Link: https://patchwork.freedesktop.org/patch/msgid/20230622083254.2057102-1-suraj.kandpal@intel.com (cherry picked from commit 86a124424efce353778c4fab355e185e4781b63e) Signed-off-by: Tvrtko Ursulin commit 3e49de73fb89272dea01ba420c7ccbcf6b96aed7 Author: Vinay Belgaumkar Date: Tue Jun 20 18:42:57 2023 -0700 drm/i915/guc/slpc: Apply min softlimit correctly The scenario being fixed here is depicted in the following sequence- modprobe i915 echo 1 > /sys/class/drm/card0/gt/gt0/slpc_ignore_eff_freq echo 300 > /sys/class/drm/card0/gt_min_freq_mhz (RPn) cat /sys/class/drm/card0/gt_cur_freq_mhz --> cur == RPn as expected echo 1 > /sys/kernel/debug/dri/0/gt0/reset --> reset cat /sys/class/drm/card0/gt_min_freq_mhz --> cached freq is RPn cat /sys/class/drm/card0/gt_cur_freq_mhz --> it's not RPn, but RPe!! When SLPC reinitializes, it sets SLPC min freq to efficient frequency. Even if we disable efficient freq post that, we should restore the cached min freq (via H2G) for it to take effect. v2: Clarify commit message (Ashutosh) Fixes: 95ccf312a1e4 ("drm/i915/guc/slpc: Allow SLPC to use efficient frequency") Reviewed-by: Ashutosh Dixit Signed-off-by: Vinay Belgaumkar Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230621014257.1769564-1-vinay.belgaumkar@intel.com (cherry picked from commit da86b2b13f1d1ca26745b951ac94421f3137539a) Signed-off-by: Tvrtko Ursulin commit 5311892a0ad1d301aafd53ca0154091b3eb407ea Author: Jouni Högander Date: Tue Jun 20 14:17:45 2023 +0300 drm/i915/psr: Use hw.adjusted mode when calculating io/fast wake times Encoder compute config is changing hw.adjusted mode. Uapi.adjusted mode doesn't get updated before psr compute config gets called. This causes io and fast wake line calculation using adjusted mode containing values before encoder adjustments. Fix this by using hw.adjusted mode instead of uapi.adjusted mode. Cc: Stanislav Lisovskiy Signed-off-by: Jouni Högander Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8475 Fixes: cb42e8ede5b4 ("drm/i915/psr: Use calculated io and fast wake lines") Reviewed-by: Mika Kahola Link: https://patchwork.freedesktop.org/patch/msgid/20230620111745.2870706-1-jouni.hogander@intel.com (cherry picked from commit ef0af9db2a21257885116949f471fe5565b2f0ab) Signed-off-by: Tvrtko Ursulin commit 86b53032b180cc2cb6ec1460885f0769c47bff3f Author: Radhakrishna Sripada Date: Thu Jun 15 21:39:50 2023 -0700 drm/i915/mtl: Fix SSC selection for MPLLA Driver does not clear the default SSC for MPLLA. This causes link training failure when trying to use 10G and 20G rates. Fix the behaviour and enable ssc only when we really want. Fixes: 237e7be0bf57 ("drm/i915/mtl: For DP2.0 10G and 20G rates use MPLLA") Cc: Mika Kahola Cc: Clint Taylor Cc: Khaled Almahallawy Cc: Arun R Murthy Signed-off-by: Radhakrishna Sripada Tested-by: Khaled Almahallawy Reviewed-by: Mika Kahola Link: https://patchwork.freedesktop.org/patch/msgid/20230616043950.1576836-1-radhakrishna.sripada@intel.com (cherry picked from commit 7e8d87e2da3b359ad73246233673a84c4dabfa07) Signed-off-by: Tvrtko Ursulin commit a6b4229d858ed4db6ad68854bb8a2f7d5ac9f138 Author: Imre Deak Date: Tue Jun 6 20:28:22 2023 +0300 drm/i915/adlp+: Allow DC states along with PW2 only for PWB functionality A recent bspec update added a restriction on when DC states can be enabled: [Before enabling DC states:] """ PG2 can be kept enabled only because PGB requires PG2. Do not use PG2 functions, such as type-C DDIs. DMC will dynamically control PG1, PGA, PG2, PGB. """ Accordingly prevent DC states if PW2 (aka PG2) is enabled for any other functionality. Bpsec: 49193 Fixes: 88c487938414 ("drm/i915: Use separate "DC off" power well for ADL-P and DG2") Reported-by: Kai Vehmanen Tested-by: Ambica Pramod Reviewed-by: Uma Shankar Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230606172822.1891897-1-imre.deak@intel.com (cherry picked from commit f4e498eb1247d25231198856b57bbae00f403c85) Signed-off-by: Tvrtko Ursulin commit 3867caee497edf6ce6b6117aac1c0b87c0a2cb5f Author: Herbert Xu Date: Sat Jun 24 13:19:56 2023 +0800 crypto: sm2 - Provide sm2_compute_z_digest when sm2 is disabled When sm2 is disabled we need to provide an implementation of sm2_compute_z_digest. Fixes: e5221fa6a355 ("KEYS: asymmetric: Move sm2 code into x509_public_key") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306231917.utO12sx8-lkp@intel.com/ Signed-off-by: Herbert Xu commit db8b4968a8d0e86c0f8bd7541359a4111a5b39ad Author: Boris Brezillon Date: Fri Jun 23 09:52:04 2023 +0200 drm/sched: Call drm_sched_fence_set_parent() from drm_sched_fence_scheduled() Drivers that can delegate waits to the firmware/GPU pass the scheduled fence to drm_sched_job_add_dependency(), and issue wait commands to the firmware/GPU at job submission time. For this to be possible, they need all their 'native' dependencies to have a valid parent since this is where the actual HW fence information are encoded. In drm_sched_main(), we currently call drm_sched_fence_set_parent() after drm_sched_fence_scheduled(), leaving a short period of time during which the job depending on this fence can be submitted. Since setting parent and signaling the fence are two things that are kinda related (you can't have a parent if the job hasn't been scheduled), it probably makes sense to pass the parent fence to drm_sched_fence_scheduled() and let it call drm_sched_fence_set_parent() before it signals the scheduled fence. Here is a detailed description of the race we are fixing here: Thread A Thread B - calls drm_sched_fence_scheduled() - signals s_fence->scheduled which wakes up thread B - entity dep signaled, checking the next dep - no more deps waiting - entity is picked for job submission by drm_gpu_scheduler - run_job() is called - run_job() tries to collect native fence info from s_fence->parent, but it's NULL => BOOM, we can't do our native wait - calls drm_sched_fence_set_parent() v2: * Fix commit message v3: * Add a detailed description of the race to the commit message * Add Luben's R-b Signed-off-by: Boris Brezillon Cc: Frank Binns Cc: Sarah Walker Cc: Donald Robson Cc: Luben Tuikov Cc: David Airlie Cc: Daniel Vetter Cc: Sumit Semwal Cc: "Christian König" Reviewed-by: Luben Tuikov Link: https://patchwork.freedesktop.org/patch/msgid/20230623075204.382350-1-boris.brezillon@collabora.com commit e47084e116fccaa43644360d7c0b997979abce3e Author: Binbin Zhou Date: Fri Jun 2 17:50:50 2023 +0800 MIPS: Loongson64: DTS: Add RTC support to Loongson-2K1000 The module is now supported, enable it. Acked-by: Jiaxun Yang Signed-off-by: Binbin Zhou Signed-off-by: WANG Xuerui Signed-off-by: Thomas Bogendoerfer commit 8a649e33f48e08be20c51541d9184645892ec370 Author: Binbin Zhou Date: Fri Jun 2 17:50:49 2023 +0800 MIPS: Loongson64: DTS: Add RTC support to LS7A PCH The RTC module is now supported, enable it. Acked-by: Jiaxun Yang Signed-off-by: Binbin Zhou Signed-off-by: WANG Xuerui Signed-off-by: Thomas Bogendoerfer commit b58d6d89ae020b107b2afa945a873dcadab44062 Author: Randy Dunlap Date: Wed Feb 8 23:13:49 2023 -0800 Documentation: PCI: correct spelling Correct spelling problems for Documentation/PCI/ as reported by codespell. Link: https://lore.kernel.org/linux-pci/20230209071400.31476-14-rdunlap@infradead.org Signed-off-by: Randy Dunlap Signed-off-by: Krzysztof Wilczyński Acked-by: Bjorn Helgaas commit fa155f4f834882a79788218aea4914568b41dd0f Author: Andrew Halaney Date: Fri Jun 23 10:53:38 2023 -0500 OPP: Use dev_err_probe() when failing to get icc_path This, in tandem with dynamic debug, can print useful information about -EPROBE_DEFFER like below, and keeps similar behavior for other errors: [ 16.561072] cpu cpu0: error -EPROBE_DEFER: dev_pm_opp_of_find_icc_paths: Unable to get path0 [ 16.575777] platform 18591000.cpufreq: deferred probe pending Signed-off-by: Andrew Halaney Signed-off-by: Viresh Kumar commit 5ee64250286e8c5162808667a9a8668488d9f577 Author: Andrew Halaney Date: Fri Jun 23 10:57:07 2023 -0500 cpufreq: qcom-cpufreq-hw: Use dev_err_probe() when failing to get icc paths This way, if there's an issue (in this case a -EPROBE_DEFER), you can get useful output: [root@dhcp19-243-150 ~]# cat /sys/kernel/debug/devices_deferred 18591000.cpufreq qcom-cpufreq-hw: Failed to find icc paths Signed-off-by: Andrew Halaney Reviewed-by: Bjorn Andersson Signed-off-by: Viresh Kumar commit a412dbf40ff37515acca4bba666f5386aa37246e Author: Florian Westphal Date: Wed Jun 21 21:11:03 2023 +0200 netfilter: nf_tables: limit allowed range via nla_policy These NLA_U32 types get stored in u8 fields, reject invalid values instead of silently casting to u8. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 079cd633219d7298d087cd115c17682264244c18 Author: Phil Sutter Date: Thu Jun 15 16:31:40 2023 +0200 netfilter: nf_tables: Introduce NFT_MSG_GETSETELEM_RESET Analogous to NFT_MSG_GETOBJ_RESET, but for set elements with a timeout or attached stateful expressions like counters or quotas - reset them all at once. Respect a per element timeout value if present to reset the 'expires' value to. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 4589725502871e77d06464f731f92fd9173e2be6 Author: Florian Westphal Date: Tue Jun 6 22:59:30 2023 +0200 netfilter: snat: evict closing tcp entries on reply tuple collision When all tried source tuples are in use, the connection request (skb) and the new conntrack will be dropped in nf_confirm() due to the non-recoverable clash. Make it so that the last 32 attempts are allowed to evict a colliding entry if this connection is already closing and the new sequence number has advanced past the old one. Such "all tuples taken" secenario can happen with tcp-rpc workloads where same dst:dport gets queried repeatedly. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 96b2ef9b16cb302d0b47c5670d30a05963e0e1e3 Author: Florian Westphal Date: Tue Jun 6 14:08:49 2023 +0200 netfilter: nf_tables: permit update of set size Now that set->nelems is always updated permit update of the sets max size. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 78aa23d0081b2029a5763c4f7d396bf2666c0c87 Author: Florian Westphal Date: Tue Jun 6 13:58:27 2023 +0200 netfilter: ipset: remove rcu_read_lock_bh pair from ip_set_test Callers already hold rcu_read_lock. Prior to RCU conversion this used to be a read_lock_bh(), but now the bh-disable isn't needed anymore. Cc: Jozsef Kadlecsik Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit de6843be3082d416eaf2a00b72dad95c784ca980 Author: Pablo Neira Ayuso Date: Tue Jun 6 09:38:42 2023 +0200 netfilter: nft_payload: rebuild vlan header when needed Skip rebuilding the vlan header when accessing destination and source mac address. Signed-off-by: Pablo Neira Ayuso commit fb9b7b4b2b82d72031bff6d615215c1c74064bb3 Author: Arnd Bergmann Date: Wed Jun 14 09:35:01 2023 +0200 x86: xen: add missing prototypes These function are all called from assembler files, or from inline assembler, so there is no immediate need for a prototype in a header, but if -Wmissing-prototypes is enabled, the compiler warns about them: arch/x86/xen/efi.c:130:13: error: no previous prototype for 'xen_efi_init' [-Werror=missing-prototypes] arch/x86/platform/pvh/enlighten.c:120:13: error: no previous prototype for 'xen_prepare_pvh' [-Werror=missing-prototypes] arch/x86/xen/enlighten_pv.c:1233:34: error: no previous prototype for 'xen_start_kernel' [-Werror=missing-prototypes] arch/x86/xen/irq.c:22:14: error: no previous prototype for 'xen_force_evtchn_callback' [-Werror=missing-prototypes] arch/x86/entry/common.c:302:24: error: no previous prototype for 'xen_pv_evtchn_do_upcall' [-Werror=missing-prototypes] Declare all of them in an appropriate header file to avoid the warnings. For consistency, also move the asm_cpu_bringup_and_idle() declaration out of smp_pv.c. Signed-off-by: Arnd Bergmann Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20230614073501.10101-3-jgross@suse.com Signed-off-by: Juergen Gross commit 3d013424de1efc2c9e68c6c06e76159e467c7ba8 Author: Juergen Gross Date: Wed Jun 14 09:35:00 2023 +0200 x86/xen: add prototypes for paravirt mmu functions The paravirt MMU functions called via the PV_CALLEE_SAVE_REGS_THUNK() macro can't be defined to be static, as the macro is generating a function via asm() statement calling the paravirt MMU function. In order to avoid warnings when specifying "-Wmissing-prototypes" for the build, add local prototypes (there should never be any external caller of those functions). Reported-by: Arnd Bergmann Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20230614073501.10101-2-jgross@suse.com Signed-off-by: Juergen Gross commit 9338c2233b97f97aa68bc42f53b06e90def129d7 Author: Ross Lagerwall Date: Mon Jun 5 11:28:40 2023 +0100 iscsi_ibft: Fix finding the iBFT under Xen Dom 0 To facilitate diskless iSCSI boot, the firmware can place a table of configuration details in memory called the iBFT. The presence of this table is not specified, nor is the precise location (and it's not in the E820) so the kernel has to search for a magic marker to find it. When running under Xen, Dom 0 does not have access to the entire host's memory, only certain regions which are identity-mapped which means that the pseudo-physical address in Dom0 == real host physical address. Add the iBFT search bounds as a reserved region which causes it to be identity-mapped in xen_set_identity_and_remap_chunk() which allows Dom0 access to the specific physical memory to correctly search for the iBFT magic marker (and later access the full table). This necessitates moving the call to reserve_ibft_region() somewhat later so that it is called after e820__memory_setup() which is when the Xen identity mapping adjustments are applied. The precise location of the call is not too important so I've put it alongside dmi_setup() which does similar scanning of memory for configuration tables. Finally in the iBFT find code, instead of using isa_bus_to_virt() which doesn't do the right thing under Xen, use early_memremap() like the dmi_setup() code does. The result of these changes is that it is possible to boot a diskless Xen + Dom0 running off an iSCSI disk whereas previously it would fail to find the iBFT and consequently, the iSCSI root disk. Signed-off-by: Ross Lagerwall Reviewed-by: Juergen Gross Acked-by: Konrad Rzeszutek Wilk Acked-by: Dave Hansen # for x86 Link: https://lore.kernel.org/r/20230605102840.1521549-1-ross.lagerwall@citrix.com Signed-off-by: Juergen Gross commit 04d684875b30393c3e5cd0daf2fa737b562a7ad9 Author: Arnd Bergmann Date: Wed May 17 14:45:07 2023 +0200 xen: xen_debug_interrupt prototype to global header The xen_debug_interrupt() function is only called on x86, which has a prototype in an architecture specific header, but the definition also exists on others, where the lack of a prototype causes a W=1 warning: drivers/xen/events/events_2l.c:264:13: error: no previous prototype for 'xen_debug_interrupt' [-Werror=missing-prototypes] Move the prototype into a global header instead to avoid this warning. Signed-off-by: Arnd Bergmann Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/20230517124525.929201-1-arnd@kernel.org Signed-off-by: Juergen Gross commit 11d5e2061e973a8d4ff2b95a114b4b8ef8652633 Author: Gustavo A. R. Silva Date: Wed Jun 21 15:12:42 2023 -0600 ksmbd: Replace one-element array with flexible-array member One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct smb_negotiate_req. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/317 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Acked-by: Namjae Jeon Reviewed-by: Sergey Senozhatsky Signed-off-by: Steve French commit 5211cc8727ed9701b04976ab47602955e5641bda Author: Gustavo A. R. Silva Date: Wed Jun 21 15:29:22 2023 -0600 ksmbd: Use struct_size() helper in ksmbd_negotiate_smb_dialect() Prefer struct_size() over open-coded versions. Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Acked-by: Namjae Jeon Reviewed-by: Sergey Senozhatsky Signed-off-by: Steve French commit 7b7d709ef7cf285309157fb94c33f625dd22c5e1 Author: Namjae Jeon Date: Sat Jun 24 12:35:39 2023 +0900 ksmbd: add missing compound request handing in some commands This patch add the compound request handling to the some commands. Existing clients do not send these commands as compound requests, but ksmbd should consider that they may come. Cc: stable@vger.kernel.org Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 98422bdd4cb3ca4d08844046f6507d7ec2c2b8d8 Author: Namjae Jeon Date: Sat Jun 24 12:33:09 2023 +0900 ksmbd: fix out of bounds read in smb2_sess_setup ksmbd does not consider the case of that smb2 session setup is in compound request. If this is the second payload of the compound, OOB read issue occurs while processing the first payload in the smb2_sess_setup(). Cc: stable@vger.kernel.org Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21355 Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f65fadb0422537d73f9a6472861852dc2f7a6a5b Author: Lu Hongfei Date: Fri Jun 9 13:06:36 2023 +0800 ksmbd: Replace the ternary conditional operator with min() It would be better to replace the traditional ternary conditional operator with min() in compare_sids. Signed-off-by: Lu Hongfei Acked-by: Namjae Jeon Signed-off-by: Steve French commit 81a94b27847f7d2e499415db14dd9dc7c22b19b0 Author: Namjae Jeon Date: Wed May 31 15:23:19 2023 +0900 ksmbd: use kvzalloc instead of kvmalloc Use kvzalloc instead of kvmalloc. Reported-by: kernel test robot Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ccb5889af97c03c67a83fcd649602034578c0d61 Author: Lu Hongfei Date: Wed May 31 10:10:43 2023 +0800 ksmbd: Change the return value of ksmbd_vfs_query_maximal_access to void The return value of ksmbd_vfs_query_maximal_access is meaningless, it is better to modify it to void. Signed-off-by: Lu Hongfei Acked-by: Namjae Jeon Signed-off-by: Steve French commit cf5e7f734f445588a30350591360bca2f6bf016f Author: Namjae Jeon Date: Tue May 30 21:43:17 2023 +0900 ksmbd: return a literal instead of 'err' in ksmbd_vfs_kern_path_locked() Return a literal instead of 'err' in ksmbd_vfs_kern_path_locked(). Reported-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f87d4f85f43f0d4b12ef64b015478d8053e1a33e Author: Namjae Jeon Date: Sat May 6 00:07:45 2023 +0900 ksmbd: use kzalloc() instead of __GFP_ZERO Use kzalloc() instead of __GFP_ZERO. Reported-by: Dan Carpenter Signed-off-by: Namjae Jeon Reviewed-by: Sergey Senozhatsky Signed-off-by: Steve French commit 7bd9f0876fdef00f4e155be35e6b304981a53f80 Author: Namjae Jeon Date: Sat May 6 00:06:56 2023 +0900 ksmbd: remove unused ksmbd_tree_conn_share function Remove unused ksmbd_tree_conn_share function. Signed-off-by: Namjae Jeon Reviewed-by: Sergey Senozhatsky Signed-off-by: Steve French commit d61cd13e732c0eaa7d66b45edb2d0de8eab65a1e Author: Gaurav Batra Date: Tue Jun 13 12:16:41 2023 -0500 powerpc/iommu: TCEs are incorrectly manipulated with DLPAR add/remove of memory When memory is dynamically added/removed, iommu_mem_notifier() is invoked. This routine traverses through all the DMA windows (DDW only, not default windows) to add/remove "direct" TCE mappings. The routines for this purpose are tce_clearrange_multi_pSeriesLP() and tce_clearrange_multi_pSeriesLP(). Both these routines are designed for Direct mapped DMA windows only. The issue is that there could be some DMA windows in the list which are not "direct" mapped. Calling these routines will either, 1) remove some dynamically mapped TCEs, Or 2) try to add TCEs which are out of bounds and HCALL returns H_PARAMETER Here are the side affects when these routines are incorrectly invoked for "dynamically" mapped DMA windows. tce_setrange_multi_pSeriesLP() This adds direct mapped TCEs. Now, this could invoke HCALL to add TCEs with out-of-bound range. In this scenario, HCALL will return H_PARAMETER and DLAR ADD of memory will fail. tce_clearrange_multi_pSeriesLP() This will remove range of TCEs. The TCE range that is calculated, depending on the memory range being added, could infact be mapping some other memory address (for dynamic DMA window scenario). This will wipe out those TCEs. The solution is for iommu_mem_notifier() to only invoke these routines for "direct" mapped DMA windows. Signed-off-by: Gaurav Batra Reviewed-by: Brian King [mpe: Initialise direct at allocation time in ddw_list_new_entry()] Signed-off-by: Michael Ellerman Link: https://msgid.link/20230613171641.15641-1-gbatra@linux.vnet.ibm.com commit 0c0df63177e37ae826d803280eb2c5b6b6a7a9a4 Merge: d2f9fe695313b 5d2ffbe4b81a3 Author: Dan Williams Date: Sun Jun 25 18:56:13 2023 -0700 Merge branch 'for-6.5/cxl-rch-eh' into for-6.5/cxl Pick up the first half of the RCH error handling series. The back half needs some fixups for test regressions. Small conflicts with the PMU work around register enumeration and setup helpers. commit d2f9fe695313b1e50028c1ec4cd09bea67152a60 Merge: e2c18eb50c7bb c2b34d442226b Author: Dan Williams Date: Sun Jun 25 17:53:18 2023 -0700 Merge branch 'for-6.5/cxl-perf' into for-6.5/cxl Pick up initial support for the CXL 3.0 performance monitoring definition. Small conflicts with the firmware update work as they both placed their init code in the same location. commit c2b34d442226b69e519eb0ba61939a74d91712d4 Author: Jonathan Cameron Date: Fri May 26 10:58:24 2023 +0100 docs: perf: Minimal introduction the the CXL PMU device and driver Very basic introduction to the device and the current driver support provided. I expect to expand on this in future versions of this patch set. Reviewed-by: Dave Jiang Reviewed-by: Kan Liang Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230526095824.16336-6-Jonathan.Cameron@huawei.com Signed-off-by: Dan Williams commit 5d7107c72796df3be2ba574f1cf6eca75c60d5ef Author: Jonathan Cameron Date: Fri May 26 10:58:23 2023 +0100 perf: CXL Performance Monitoring Unit driver CXL rev 3.0 introduces a standard performance monitoring hardware block to CXL. Instances are discovered using CXL Register Locator DVSEC entries. Each CXL component may have multiple PMUs. This initial driver supports a subset of types of counter. It supports counters that are either fixed or configurable, but requires that they support the ability to freeze and write value whilst frozen. Development done with QEMU model which will be posted shortly. Example: $ perf stat -a -e cxl_pmu_mem0.0/h2d_req_snpcur/ -e cxl_pmu_mem0.0/h2d_req_snpdata/ -e cxl_pmu_mem0.0/clock_ticks/ sleep 1 Performance counter stats for 'system wide': 96,757,023,244,321 cxl_pmu_mem0.0/h2d_req_snpcur/ 96,757,023,244,365 cxl_pmu_mem0.0/h2d_req_snpdata/ 193,514,046,488,653 cxl_pmu_mem0.0/clock_ticks/ 1.090539600 seconds time elapsed Reviewed-by: Dave Jiang Reviewed-by: Kan Liang Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230526095824.16336-5-Jonathan.Cameron@huawei.com Signed-off-by: Dan Williams commit e2c18eb50c7bb191d1ebfed973c2ec3e0066ad37 Merge: aeaefabc59ec3 adfe19738b71a Author: Dan Williams Date: Sun Jun 25 17:23:50 2023 -0700 Merge branch 'for-6.5/cxl-region-fixes' into for-6.5/cxl Pick up the recent fixes to how CPU caches are managed relative to region setup / teardown, and make sure that all decoders transition successfully before updating the region state from COMMIT => ACTIVE. commit aeaefabc59ec3c7edd6d0ca7add7aff2ff6f59d0 Merge: 867eab655d3b3 8f0220af58c3b Author: Dan Williams Date: Sun Jun 25 17:16:51 2023 -0700 Merge branch 'for-6.5/cxl-type-2' into for-6.5/cxl Pick up the driver cleanups identified in preparation for CXL "type-2" (accelerator) device support. The major change here from a conflict generation perspective is the split of 'struct cxl_memdev_state' from the core 'struct cxl_dev_state'. Since an accelerator may not care about all the optional features that are standard on a CXL "type-3" (host-only memory expander) device. A silent conflict also occurs with the move of the endpoint port to be a formal property of a 'struct cxl_memdev' rather than drvdata. commit f7584322e4fef794b290e5fdb290fa92a925236e Author: Nick Desaulniers Date: Fri Jun 23 10:06:17 2023 -0700 riscv: disable HAVE_LD_DEAD_CODE_DATA_ELIMINATION for LLD Linking allyesconfig with ld.lld-17 with CONFIG_DEAD_CODE_ELIMINATION=y takes hours. Assuming this is a performance regression that can be fixed, tentatively disable this for now so that allyesconfig builds don't start timing out. If and when there's a fix to ld.lld, this can be converted to a version check instead so that users of older but still supported versions of ld.lld don't hurt themselves by enabling CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y. Link: https://github.com/ClangBuiltLinux/linux/issues/1881 Link: https://lore.kernel.org/linux-riscv/ZJXTwqZIkXLxXaSi@google.com/ Reported-by: Palmer Dabbelt Suggested-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Signed-off-by: Palmer Dabbelt commit c828856b51bb4180c0803c12ffaeb86c41336c11 Author: Zhangjin Wu Date: Wed May 24 00:55:02 2023 +0800 riscv: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION Select CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION for RISC-V, allowing the user to enable dead code elimination. In order for this to work, ensure that we keep the alternative table by annotating them with KEEP. This boots well on qemu with both rv32_defconfig & rv64 defconfig, but it only shrinks their builds by ~1%, a smaller config is thereforce customized to test this feature: | rv32 | rv64 --------|------------------------|--------------------- No DCE | 4460684 | 4893488 DCE | 3986716 | 4376400 Shrink | 473968 (~10.6%) | 517088 (~10.5%) The config used above only reserves necessary options to boot on qemu with serial console, more like the size-critical embedded scenes: - rv64 config: https://pastebin.com/crz82T0s - rv32 config: rv64 config + 32-bit.config Here is Jisheng's original commit-msg: When trying to run linux with various opensource riscv core on resource limited FPGA platforms, for example, those FPGAs with less than 16MB SDRAM, I want to save mem as much as possible. One of the major technologies is kernel size optimizations, I found that riscv does not currently support HAVE_LD_DEAD_CODE_DATA_ELIMINATION, which passes -fdata-sections, -ffunction-sections to CFLAGS and passes the --gc-sections flag to the linker. This not only benefits my case on FPGA but also benefits defconfigs. Here are some notable improvements from enabling this with defconfigs: nommu_k210_defconfig: text data bss dec hex 1112009 410288 59837 1582134 182436 before 962838 376656 51285 1390779 1538bb after rv32_defconfig: text data bss dec hex 8804455 2816544 290577 11911576 b5c198 before 8692295 2779872 288977 11761144 b375f8 after defconfig: text data bss dec hex 9438267 3391332 485333 13314932 cb2b74 before 9285914 3350052 483349 13119315 c82f53 after Signed-off-by: Zhangjin Wu Co-developed-by: Jisheng Zhang Signed-off-by: Jisheng Zhang Reviewed-by: Guo Ren Tested-by: Bin Meng Reviewed-by: Kefeng Wang Tested-by: Nick Desaulniers # build Link: https://lore.kernel.org/r/20230523165502.2592-5-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit d4035ff16bfa73915f74cb3d28f878aff1da510a Author: Jisheng Zhang Date: Wed May 24 00:55:01 2023 +0800 vmlinux.lds.h: use correct .init.data.* section name If building with -fdata-sections on riscv, LD_ORPHAN_WARN will warn similar as below: riscv64-linux-gnu-ld: warning: orphan section `.init.data.efi_loglevel' from `./drivers/firmware/efi/libstub/printk.stub.o' being placed in section `.init.data.efi_loglevel' I believe this is caused by a a typo: init.data.* should be .init.data.* Signed-off-by: Jisheng Zhang Reviewed-by: Kefeng Wang Tested-by: Nick Desaulniers # build Link: https://lore.kernel.org/r/20230523165502.2592-4-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit cead443a306262a16056d84d63b5a6a10908eb62 Author: Jisheng Zhang Date: Wed May 24 00:55:00 2023 +0800 riscv: vmlinux-xip.lds.S: remove .alternative section ALTERNATIVE mechanism can't work on XIP, and this is also reflected by below Kconfig dependency: RISCV_ALTERNATIVE ... depends on !XIP_KERNEL ... So there's no .alternative section at all for XIP case, remove it. Signed-off-by: Jisheng Zhang Reviewed-by: Conor Dooley Reviewed-by: Guo Ren Tested-by: Nick Desaulniers # build Link: https://lore.kernel.org/r/20230523165502.2592-3-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit ab7fa6b05ebbe2a8cc07114014f14fd2326fb80a Author: Jisheng Zhang Date: Wed May 24 00:54:59 2023 +0800 riscv: move options to keep entries sorted Recently, some commits break the entries order. Properly move their locations to keep entries sorted. Signed-off-by: Jisheng Zhang Reviewed-by: Conor Dooley Acked-by: Guo Ren Tested-by: Nick Desaulniers # build Link: https://lore.kernel.org/r/20230523165502.2592-2-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 1b733a9ebc3d8011ca66ec6ff17f55a440358794 Author: Binbin Zhou Date: Fri Jun 2 17:50:48 2023 +0800 rtc: Add rtc driver for the Loongson family chips The Loongson family chips use an on-chip counter 0 (Time Of Year counter) as the RTC. We will refer to them as rtc-loongson. Cc: Keguang Zhang Cc: Yang Ling Cc: Jiaxun Yang Signed-off-by: Binbin Zhou Signed-off-by: Huacai Chen Signed-off-by: WANG Xuerui Reviewed-by: Keguang Zhang Tested-by: Keguang Zhang Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang # LS7A Link: https://lore.kernel.org/r/0c5171156390f614d72f36ceb04a20f432ca639e.1685693501.git.zhoubinbin@loongson.cn Signed-off-by: Alexandre Belloni commit 9fb23090658adbd7f8f44bf5c38aa3fc4b1699bd Author: Binbin Zhou Date: Fri Jun 2 17:50:21 2023 +0800 rtc: Remove the Loongson-1 RTC driver Remove the ls1x-rtc driver as it is obsolete. We will continue to support the ls1x RTC in the upcoming Loongson unified RTC driver rtc-loongson. Cc: Keguang Zhang Cc: zhao zhang Cc: Yang Ling Signed-off-by: Binbin Zhou Acked-by: Keguang Zhang Link: https://lore.kernel.org/r/c38c666015a162d7031b20a48209ce577bab62cd.1685693501.git.zhoubinbin@loongson.cn Signed-off-by: Alexandre Belloni commit 487ef32caebe010f0ff0f17267230ebaf2177e67 Author: Binbin Zhou Date: Fri Jun 2 17:50:20 2023 +0800 dt-bindings: rtc: Split loongson,ls2x-rtc into SoC-based compatibles Move Loongson RTC bindings from trivial-rtc.yaml into loongson,rtc.yaml. The architectures associated with this driver use the built-in DTB, so we can just drop the compatible(rtc-ls2x) with wildcards. Also, soc-based compatible is more accurate for hardware differences between chips. Signed-off-by: Binbin Zhou Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/1b0bb443bd74647c17b7902f3d719700f81a1dba.1685693501.git.zhoubinbin@loongson.cn Signed-off-by: Alexandre Belloni commit 867eab655d3b38740d8d6c24705af25e0b1dbdb6 Merge: dcfb70610d407 f6448cb5f2f37 Author: Dan Williams Date: Sun Jun 25 16:12:26 2023 -0700 Merge branch 'for-6.5/cxl-fwupd' into for-6.5/cxl Add the first typical (non-sanitization) consumer of the new background command infrastructure, firmware update. Given both firmware-update and sanitization were developed in parallel from the common background-command baseline, resolve some minor context conflicts. commit 7e2a60efab8ad901c4743137857c1c5e18e27ed8 Author: Johannes Kirchmair Date: Mon Mar 27 10:55:50 2023 +0200 rtc: rv3028: make rv3028 probeable from userspace With this commit, it will be possible to bind a rv3028 device from userspace This is done by: echo rtc-rv3028 0x52 > /sys/bus/i2c/devices/i2c-XX/new_device Signed-off-by: Johannes Kirchmair Link: https://lore.kernel.org/r/20230327085550.1721861-1-johannes.kirchmair@sigmatek.at Signed-off-by: Alexandre Belloni commit dcfb70610d40704d929d824db36b1444c8f37f7a Merge: 858fd168a95c5 f337043b56e0e Author: Dan Williams Date: Sun Jun 25 16:01:45 2023 -0700 Merge branch 'for-6.5/cxl-background' into for-6.5/cxl Pick up the sanitization work and the infrastructure for other background commands for 6.5. Sanitization has a different completion path than typical background commands so it was important to have both thought out and implemented before either went upstream. commit f6448cb5f2f378c70d280581590e062f13ff52b3 Author: Vishal Verma Date: Wed Jun 14 11:17:43 2023 -0600 tools/testing/cxl: add firmware update emulation to CXL memdevs Add emulation for the 'Get FW Info', 'Transfer FW', and 'Activate FW' CXL mailbox commands to the cxl_test emulated memdevs to enable end-to-end unit testing of a firmware update flow. For now, only advertise an 'offline activation' capability as that is all the CXL memdev driver currently implements. Add some canned values for the serial number fields, and create a platform device sysfs knob to calculate the sha256sum of the firmware image that was received, so a unit test can compare it with the original file that was uploaded. Cc: Davidlohr Bueso Cc: Jonathan Cameron Cc: Russ Weight Cc: Alison Schofield Cc: Ira Weiny Cc: Dave Jiang Cc: Ben Widawsky Cc: Dan Williams Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20230602-vv-fw_update-v4-4-c6265bd7343b@intel.com Signed-off-by: Dan Williams commit 6e4ca04af73e689bcfdad9047cd248ed93491e95 Author: Vishal Verma Date: Wed Jun 14 11:17:42 2023 -0600 tools/testing/cxl: Use named effects for the Command Effect Log As more emulated mailbox commands are added to cxl_test, it is a pain point to look up command effect numbers for each effect. Replace the bare numbers in the mock driver with an enum that lists all possible effects. Cc: Davidlohr Bueso Cc: Jonathan Cameron Cc: Russ Weight Cc: Alison Schofield Cc: Ira Weiny Cc: Dave Jiang Cc: Ben Widawsky Cc: Dan Williams Suggested-by: Jonathan Cameron Reviewed-by: Alison Schofield Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20230602-vv-fw_update-v4-3-c6265bd7343b@intel.com Signed-off-by: Dan Williams commit b46c5fa57cc60692412f616ac66ab624a941fdb3 Author: Vishal Verma Date: Wed Jun 14 11:17:41 2023 -0600 tools/testing/cxl: Fix command effects for inject/clear poison The CXL spec (3.0, section 8.2.9.8.4) Lists Inject Poison and Clear Poison as having the effects of "Immediate Data Change". Fix this in the mock driver so that the command effect log is populated correctly. Fixes: 371c16101ee8 ("tools/testing/cxl: Mock the Inject Poison mailbox command") Cc: Alison Schofield Cc: Dan Williams Reviewed-by: Alison Schofield Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20230602-vv-fw_update-v4-2-c6265bd7343b@intel.com Signed-off-by: Dan Williams commit 9521875bbe0055805557fff0b08fd9a29d02b7bc Author: Vishal Verma Date: Wed Jun 14 11:17:40 2023 -0600 cxl: add a firmware update mechanism using the sysfs firmware loader The sysfs based firmware loader mechanism was created to easily allow userspace to upload firmware images to FPGA cards. This also happens to be pretty suitable to create a user-initiated but kernel-controlled firmware update mechanism for CXL devices, using the CXL specified mailbox commands. Since firmware update commands can be long-running, and can be processed in the background by the endpoint device, it is desirable to have the ability to chunk the firmware transfer down to smaller pieces, so that one operation does not monopolize the mailbox, locking out any other long running background commands entirely - e.g. security commands like 'sanitize' or poison scanning operations. The firmware loader mechanism allows a natural way to perform this chunking, as after each mailbox command, that is restricted to the maximum mailbox payload size, the cxl memdev driver relinquishes control back to the fw_loader system and awaits the next chunk of data to transfer. This opens opportunities for other background commands to access the mailbox and send their own slices of background commands. Add the necessary helpers and state tracking to be able to perform the 'Get FW Info', 'Transfer FW', and 'Activate FW' mailbox commands as described in the CXL spec. Wire these up to the firmware loader callbacks, and register with that system to create the memX/firmware/ sysfs ABI. Cc: Davidlohr Bueso Cc: Jonathan Cameron Cc: Russ Weight Cc: Alison Schofield Cc: Ira Weiny Cc: Dave Jiang Cc: Ben Widawsky Cc: Dan Williams Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20230602-vv-fw_update-v4-1-c6265bd7343b@intel.com Signed-off-by: Dan Williams commit fdd63f65ac25d0851dade4c7ba94a7a882b8d9c2 Author: Biju Das Date: Fri Jun 23 15:09:48 2023 +0100 rtc: isl1208: Add support for the built-in RTC on the PMIC RAA215300 The built-in RTC found on PMIC RAA215300 is the same as ISL1208. However, the external oscillator bit is inverted on PMIC version 0x11. The PMIC driver detects PMIC version and instantiates the RTC device based on i2c_device_id. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230623140948.384762-11-biju.das.jz@bp.renesas.com Signed-off-by: Alexandre Belloni commit 262f72b4656e182eefaab91ab24a7575dda5524f Author: Biju Das Date: Fri Jun 23 15:09:47 2023 +0100 rtc: isl1208: Add isl1208_set_xtoscb() As per the HW manual, set the XTOSCB bit as follows: If using an external clock signal, set the XTOSCB bit as 1 to disable the crystal oscillator. If using an external crystal, the XTOSCB bit needs to be set at 0 to enable the crystal oscillator. Add isl1208_set_xtoscb() to set XTOSCB bit based on the clock-names property. Fallback is enabling the internal crystal oscillator. While at it, introduce a variable "sr" for reading the status register in probe() as it is reused for writing and also remove the unnecessary blank line. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230623140948.384762-10-biju.das.jz@bp.renesas.com Signed-off-by: Alexandre Belloni commit 5923fc75d0dfcebce53894ddada7e2440d756f8b Author: Biju Das Date: Fri Jun 23 15:09:46 2023 +0100 rtc: isl1208: Drop enum isl1208_id and split isl1208_configs[] Drop enum isl1208_id and split the array isl1208_configs[] as individual variables, and make lines shorter by referring to e.g. &config_isl1219 instead of &isl1208_configs[TYPE_ISL1219]. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230623140948.384762-9-biju.das.jz@bp.renesas.com Signed-off-by: Alexandre Belloni commit fbc06a53561c64ec6d7f9a1b3bc04597de4cbb2d Author: Biju Das Date: Fri Jun 23 15:09:45 2023 +0100 rtc: isl1208: Make similar I2C and DT-based matching table The isl1208_id[].driver_data could store a pointer to the config, like for DT-based matching, making I2C and DT-based matching more similar. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230623140948.384762-8-biju.das.jz@bp.renesas.com Signed-off-by: Alexandre Belloni commit 380960c40a1d106bba3476c9a010eaf28195115d Author: Biju Das Date: Fri Jun 23 15:09:44 2023 +0100 rtc: isl1208: Drop name variable Drop unused name variable from struct isl1208_config. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230623140948.384762-7-biju.das.jz@bp.renesas.com Signed-off-by: Alexandre Belloni commit 138f352556d791d7e0ca3ac9a4f4815123af8c82 Author: Biju Das Date: Fri Jun 23 15:09:43 2023 +0100 dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties As per the HW manual, XTOSCB bit setting is as follows If using an external clock signal, set the XTOSCB bit as 1 to disable the crystal oscillator. If using an external crystal, the XTOSCB bit needs to be set at 0 to enable the crystal oscillator. Document clock and clock-names properties. Signed-off-by: Biju Das Reviewed-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230623140948.384762-6-biju.das.jz@bp.renesas.com Signed-off-by: Alexandre Belloni commit ac739bac5201d4308cba2525dacb5da654b3ff31 Author: Biju Das Date: Fri Jun 23 15:09:42 2023 +0100 dt-bindings: rtc: isl1208: Convert to json-schema Convert the isl1208 RTC device tree binding documentation to json-schema. Update the example to match reality. Signed-off-by: Biju Das Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230623140948.384762-5-biju.das.jz@bp.renesas.com Signed-off-by: Alexandre Belloni commit 0e6f36cca1bd3f5257315b55d9f31519ea4cc059 Author: Christophe JAILLET Date: Thu Jun 8 21:12:00 2023 +0200 rtc: st-lpc: Simplify clk handling in st_rtc_probe() Use devm_clk_get_enabled() instead of hand writing it. This simplifies error handling and removes some lines of code. Also use dev_err_probe() which filters -EPROBE_DEFER. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/992dd8c31be0bb5b8a9d8b5e8e94807ab0848a66.1686251455.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alexandre Belloni commit 06c6e1b01d9261f03629cefd1f3553503291e6cf Author: Christophe JAILLET Date: Thu Jun 8 21:11:42 2023 +0200 rtc: st-lpc: Release some resources in st_rtc_probe() in case of error If an error occurs after clk_get(), the corresponding resources should be released. Use devm_clk_get() to fix it. Fixes: b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/866af6adbc7454a7b4505eb6c28fbdc86ccff39e.1686251455.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alexandre Belloni commit f337043b56e0e97c5c67b95ea32886b95b049181 Author: Davidlohr Bueso Date: Mon Jun 12 11:10:38 2023 -0700 cxl/test: Add Secure Erase opcode support Add support to emulate the CXL the "Secure Erase" operation. Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20230612181038.14421-8-dave@stgolabs.net Signed-off-by: Dan Williams commit 180ffd338c35057c3e8521d55555ae3b36b67fa6 Author: Davidlohr Bueso Date: Mon Jun 12 11:10:37 2023 -0700 cxl/mem: Support Secure Erase Implement support for the non-pmem exclusive secure erase, per CXL specs. Create a write-only 'security/erase' sysfs file to perform the requested operation. As with the sanitation this requires the device being offline and thus no active HPA-DPA decoding. The expectation is that userspace can use it such as: cxl disable-memdev memX echo 1 > /sys/bus/cxl/devices/memX/security/erase cxl enable-memdev memX Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Reviewed-by: Fan Ni Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20230612181038.14421-7-dave@stgolabs.net Signed-off-by: Dan Williams commit c5c39217ff49ffb8494a671c9521c43006f87f1a Author: Davidlohr Bueso Date: Mon Jun 12 11:10:36 2023 -0700 cxl/test: Add Sanitize opcode support Add support to emulate the "Sanitize" operation, without incurring in the background. Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20230612181038.14421-6-dave@stgolabs.net Signed-off-by: Dan Williams commit 48dcdbb16e5dc0947f949ce17bc2d09a625a0d5c Author: Davidlohr Bueso Date: Mon Jun 12 11:10:35 2023 -0700 cxl/mem: Wire up Sanitization support Implement support for CXL 3.0 8.2.9.8.5.1 Sanitize. This is done by adding a security/sanitize' memdev sysfs file to trigger the operation and extend the status file to make it poll(2)-capable for completion. Unlike all other background commands, this is the only operation that is special and monopolizes the device for long periods of time. In addition to the traditional pmem security requirements, all regions must also be offline in order to perform the operation. This permits avoiding explicit global CPU cache management, relying instead on the implict cache management when a region transitions between CXL_CONFIG_ACTIVE and CXL_CONFIG_COMMIT. The expectation is that userspace can use it such as: cxl disable-memdev memX echo 1 > /sys/bus/cxl/devices/memX/security/sanitize cxl wait-sanitize memX cxl enable-memdev memX Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20230612181038.14421-5-dave@stgolabs.net Signed-off-by: Dan Williams commit 0c36b6ad436a38b167af16e6c690c890b8b2df62 Author: Davidlohr Bueso Date: Mon Jun 12 11:10:34 2023 -0700 cxl/mbox: Add sanitization handling machinery Sanitization is by definition a device-monopolizing operation, and thus the timeslicing rules for other background commands do not apply. As such handle this special case asynchronously and return immediately. Subsequent changes will allow completion to be pollable from userspace via a sysfs file interface. For devices that don't support interrupts for notifying background command completion, self-poll with the caveat that the poller can be out of sync with the ready hardware, and therefore care must be taken to not allow any new commands to go through until the poller sees the hw completion. The poller takes the mbox_mutex to stabilize the flagging, minimizing any runtime overhead in the send path to check for 'sanitize_tmo' for uncommon poll scenarios. The irq case is much simpler as hardware will serialize/error appropriately. Reviewed-by: Dave Jiang Signed-off-by: Davidlohr Bueso Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230612181038.14421-4-dave@stgolabs.net Signed-off-by: Dan Williams commit 9968c9dd568e83f57fdc1f6127f8b369a0594991 Author: Davidlohr Bueso Date: Mon Jun 12 11:10:33 2023 -0700 cxl/mem: Introduce security state sysfs file Add a read-only sysfs file to display the security state of a device (currently only pmem): /sys/bus/cxl/devices/memX/security/state This introduces a cxl_security_state structure that is to be the placeholder for common CXL security features. Reviewed-by: Jonathan Cameron Reviewed-by: Fan Ni Signed-off-by: Davidlohr Bueso Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20230612181038.14421-3-dave@stgolabs.net Signed-off-by: Dan Williams commit 8ea9c33d48f20479e87b5fc3a97cd25e656d30dc Author: Davidlohr Bueso Date: Mon Jun 12 11:10:32 2023 -0700 cxl/mbox: Allow for IRQ_NONE case in the isr For cases when the mailbox background operation is not complete, do not "handle" the interrupt, as it was not from this device. And furthermore there are no racy scenarios such as the hw being out of sync with the driver and starting a new background op behind its back. Reported-by: Jonathan Cameron Fixes: ccadf1310fb (cxl/mbox: Add background cmd handling machinery) Signed-off-by: Davidlohr Bueso Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230612181038.14421-2-dave@stgolabs.net Signed-off-by: Dan Williams commit 8f0220af58c3b73e9041377a23708d37600b33c1 Author: Dan Williams Date: Thu Jun 15 12:53:40 2023 -0700 Revert "cxl/port: Enable the HDM decoder capability for switch ports" commit eb0764b822b9 ("cxl/port: Enable the HDM decoder capability for switch ports") ...was added on the observation of CXL memory not being accessible after setting up a region on a "cold-plugged" device. A "cold-plugged" CXL device is one that was not present at boot, so platform-firmware/BIOS has no chance to set it up. While it is true that the debug found the enable bit clear in the host-bridge's instance of the global control register (CXL 3.0 8.2.4.19.2 CXL HDM Decoder Global Control Register), that bit is described as: "This bit is only applicable to CXL.mem devices and shall return 0 on CXL Host Bridges and Upstream Switch Ports." So it is meant to be zero, and further testing confirmed that this "fix" had no effect on the failure. Revert it, and be more vigilant about proposed fixes in the future. Since the original copied stable@, flag this revert for stable@ as well. Cc: Fixes: eb0764b822b9 ("cxl/port: Enable the HDM decoder capability for switch ports") Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168685882012.3475336.16733084892658264991.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 516b300c4ca86aa7953b75ce79b5c5eea5779b22 Author: Dan Williams Date: Wed Jun 14 18:30:43 2023 -0700 cxl/memdev: Formalize endpoint port linkage Move the endpoint port that the cxl_mem driver establishes from drvdata to a first class attribute. This is in preparation for device-memory drivers reusing the CXL core for memory region management. Those drivers need a type-safe method to retrieve their CXL port linkage. Leave drvdata for private usage of the cxl_mem driver not external consumers of a 'struct cxl_memdev' object. Reviewed-by: Fan Ni Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168679264292.3436160.3901392135863405807.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit f3c8a37a432e65dda1384929198dd12c1df3ea38 Author: Dan Williams Date: Wed Jun 14 18:30:31 2023 -0700 cxl/pci: Unconditionally unmask 256B Flit errors The current check for 256B Flit mode is incomplete and unnecessary. It is incomplete because it fails to consider the link speed, or check for CXL link capabilities. It is unnecessary because unconditionally unmasking 256B Flit errors is a nop when 256B Flit operation is not available. Remove this check in preparation for creating a cxl_probe_link() helper to centralize this detection. Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168679263124.3436160.6228910132469454346.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 8c897b366cda9c7e5ebbb6e8e3da238ecec84535 Author: Dan Williams Date: Wed Jun 14 18:30:25 2023 -0700 cxl/region: Manage decoder target_type at decoder-attach time Switch-level (mid-level) decoders between the platform root and an endpoint can dynamically switch modes between HDM-H and HDM-D[B] depending on which region they target. Use the region type to fixup each decoder that gets allocated to map the given region. Note that endpoint decoders are meant to determine the region type, so warn if those ever need to be fixed up, but since it is possible to continue do so. Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168679262543.3436160.13053831955768440312.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit cecbb5da921231aa0933667fba85bea5b91d6a46 Author: Dan Williams Date: Wed Jun 14 18:30:19 2023 -0700 cxl/hdm: Default CXL_DEVTYPE_DEVMEM decoders to CXL_DECODER_DEVMEM In preparation for device-memory region creation, arrange for decoders of CXL_DEVTYPE_DEVMEM memdevs to default to CXL_DECODER_DEVMEM for their target type. Revisit this if a device ever shows up that wants to offer mixed HDM-H (Host-Only Memory) and HDM-DB support, or an CXL_DEVTYPE_DEVMEM device that supports HDM-H. Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168679261945.3436160.11673393474107374595.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 5aa39a9165cfc80d37f1db8ba8fee798a3ecf74f Author: Dan Williams Date: Wed Jun 14 18:30:13 2023 -0700 cxl/port: Rename CXL_DECODER_{EXPANDER, ACCELERATOR} => {HOSTONLYMEM, DEVMEM} In preparation for support for HDM-D and HDM-DB configuration (device-memory, and device-memory with back-invalidate). Rename the current type designators to use HOSTONLYMEM and DEVMEM as a suffix. HDM-DB can be supported by devices that are not accelerators, so DEVMEM is a more generic term for that case. Fixup one location where this type value was open coded. Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168679261369.3436160.7042443847605280593.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit f6b8ab32e3ec48ecc02d1b4a42ee03576040ddd2 Author: Dan Williams Date: Wed Jun 14 18:30:07 2023 -0700 cxl/memdev: Make mailbox functionality optional In support of the Linux CXL core scaling for a wider set of CXL devices, allow for the creation of memdevs with some memory device capabilities disabled. Specifically, allow for CXL devices outside of those claiming to be compliant with the generic CXL memory device class code, like vendor specific Type-2/3 devices that host CXL.mem. This implies, allow for the creation of memdevs that only support component-registers, not necessarily memory-device-registers (like mailbox registers). A memdev derived from a CXL endpoint that does not support generic class code expectations is tagged "CXL_DEVTYPE_DEVMEM", while a memdev derived from a class-code compliant endpoint is tagged "CXL_DEVTYPE_CLASSMEM". The primary assumption of a CXL_DEVTYPE_DEVMEM memdev is that it optionally may not host a mailbox. Disable the command passthrough ioctl for memdevs that are not CXL_DEVTYPE_CLASSMEM, and return empty strings from memdev attributes associated with data retrieved via the class-device-standard IDENTIFY command. Note that empty strings were chosen over attribute visibility to maintain compatibility with shipping versions of cxl-cli that expect those attributes to always be present. Once cxl-cli has dropped that requirement this workaround can be deprecated. Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168679260782.3436160.7587293613945445365.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 59f8d1510739e92135df62d52e8c29bc075c46ad Author: Dan Williams Date: Wed Jun 14 18:30:02 2023 -0700 cxl/mbox: Move mailbox related driver state to its own data structure 'struct cxl_dev_state' makes too many assumptions about the capabilities of a CXL device. In particular it assumes a CXL device has a mailbox and all of the infrastructure and state that comes along with that. In preparation for supporting accelerator / Type-2 devices that may not have a mailbox and in general maintain a minimal core context structure, make mailbox functionality a super-set of 'struct cxl_dev_state' with 'struct cxl_memdev_state'. With this reorganization it allows for CXL devices that support HDM decoder mapping, but not other general-expander / Type-3 capabilities, to only enable that subset without the rest of the mailbox infrastructure coming along for the ride. Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168679260240.3436160.15520641540463704524.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 3fe7feb0f37e4dcbd51b9a4019866dc55b965a55 Author: Dan Williams Date: Wed Jun 14 18:29:57 2023 -0700 cxl: Remove leftover attribute documentation in 'struct cxl_dev_state' commit 14d788740774 ("cxl/mem: Consolidate CXL DVSEC Range enumeration in the core") ...removed @info from 'struct cxl_dev_state', but neglected to remove the corresponding kernel-doc entry. Complete the removal. Reported-by: Jonathan Cameron Closes: http://lore.kernel.org/r/20230606121054.000069e1@Huawei.com Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168679259703.3436160.12583306507362357946.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit c192e5432f2519c8016af126076a5be1e5befbf5 Author: Dan Williams Date: Wed Jun 14 18:29:51 2023 -0700 cxl: Fix kernel-doc warnings After Jonathan noticed [1] that 'struct cxl_dev_state' had a kernel-doc entry without a corresponding struct attribute I ran the kernel-doc script to see what else might be broken. Fix these warnings: drivers/cxl/cxlmem.h:199: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Event Interrupt Policy drivers/cxl/cxlmem.h:224: warning: Function parameter or member 'buf' not described in 'cxl_event_state' drivers/cxl/cxlmem.h:224: warning: Function parameter or member 'log_lock' not described in 'cxl_event_state' Note that scripts/kernel-doc only finds missing kernel-doc entries. It does not warn on too many kernel-doc entries, i.e. it did not catch the fact that @info refers to a not present member. Link: http://lore.kernel.org/r/20230606121054.000069e1@Huawei.com [1] Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168679259170.3436160.3686460404739136336.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 4c77cfcfe1afd1d8f5247cd26e53fa2e30c4c23f Author: Dan Williams Date: Wed Jun 14 18:29:46 2023 -0700 tools/testing/cxl: Remove unused @cxlds argument In preparation for plumbing a 'struct cxl_memdev_state' as a superset of a 'struct cxl_dev_state' cleanup the usage of @cxlds in the unit test infrastructure. Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168679258640.3436160.7641308222525246728.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 688baac1097d30a51d6469efdc8707fdac80eab6 Author: Dan Williams Date: Wed Jun 14 18:29:41 2023 -0700 cxl/regs: Clarify when a 'struct cxl_register_map' is input vs output The @map parameter to cxl_probe_X_registers() is filled in with the mapping parameters of the register block. The @map parameter to cxl_map_X_registers() only reads that information to perform the mapping. Mark @map const for cxl_map_X_registers() to clarify that it is only an input to those helpers. Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168679258103.3436160.4941603739448763855.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit adfe19738b71a893da62cb2e30bd6bdb4299ea67 Author: Dan Williams Date: Fri Jun 16 18:24:39 2023 -0700 cxl/region: Fix state transitions after reset failure Jonathan reports that failed attempts to reset a region (teardown its HDM decoder configuration) mistakenly advance the state of the region to "not committed". Revert to the previous state of the region on reset failure so that the reset can be re-attempted. Reported-by: Jonathan Cameron Closes: http://lore.kernel.org/r/20230316171441.0000205b@Huawei.com Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware") Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168696507968.3590522.14484000711718573626.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 2ab47045ac96a605e3037d479a7d5854570ee5bf Author: Dan Williams Date: Fri Jun 16 18:24:34 2023 -0700 cxl/region: Flag partially torn down regions as unusable cxl_region_decode_reset() walks all the decoders associated with a given region and disables them. Due to decoder ordering rules it is possible that a switch in the topology notices that a given decoder can not be shutdown before another region with a higher HPA is shutdown first. That can leave the region in a partially committed state. Capture that state in a new CXL_REGION_F_NEEDS_RESET flag and require that a successful cxl_region_decode_reset() attempt must be completed before cxl_region_probe() accepts the region. This is a corollary for the bug that Jonathan identified in "CXL/region : commit reset of out of order region appears to succeed." [1]. Cc: Jonathan Cameron Link: http://lore.kernel.org/r/20230316171441.0000205b@Huawei.com [1] Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware") Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168696507423.3590522.16254212607926684429.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit d1257d098a5a38753a0736a50db0a26a62377ad7 Author: Dan Williams Date: Fri Jun 16 18:24:28 2023 -0700 cxl/region: Move cache invalidation before region teardown, and before setup Vikram raised a concern with the theoretical case of a CPU sending MemClnEvict to a device that is not prepared to receive. MemClnEvict is a message that is sent after a CPU has taken ownership of a cacheline from accelerator memory (HDM-DB). In the case of hotplug or HDM decoder reconfiguration it is possible that the CPU is holding old contents for a new device that has taken over the physical address range being cached by the CPU. To avoid this scenario, invalidate caches prior to tearing down an HDM decoder configuration. Now, this poses another problem that it is possible for something to speculate into that space while the decode configuration is still up, so to close that gap also invalidate prior to establish new contents behind a given physical address range. With this change the cache invalidation is now explicit and need not be checked in cxl_region_probe(), and that obviates the need for CXL_REGION_F_INCOHERENT. Cc: Jonathan Cameron Fixes: d18bc74aced6 ("cxl/region: Manage CPU caches relative to DPA invalidation events") Reported-by: Vikram Sethi Closes: http://lore.kernel.org/r/BYAPR12MB33364B5EB908BF7239BB996BBD53A@BYAPR12MB3336.namprd12.prod.outlook.com Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/168696506886.3590522.4597053660991916591.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit 5d2ffbe4b81a3b6353bf888a523e7e5d4fec47ad Author: Robert Richter Date: Thu Jun 22 15:55:11 2023 -0500 cxl/port: Store the downstream port's Component Register mappings in struct cxl_dport Same as for ports, also store the downstream port's Component Register mappings, use struct cxl_dport for that. Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-16-terry.bowman@amd.com Signed-off-by: Dan Williams commit 19ab69a60e3ba58b4942b9ab5095cf90477a54ce Author: Robert Richter Date: Thu Jun 22 15:55:10 2023 -0500 cxl/port: Store the port's Component Register mappings in struct cxl_port CXL capabilities are stored in the Component Registers. To use them, the specific I/O ranges of the capabilities must be determined by probing the registers. For this, the whole Component Register range needs to be mapped temporarily to detect the offset and length of a capability range. In order to use more than one capability of a component (e.g. RAS and HDM) the Component Register are probed and its mappings created multiple times. This also causes overlapping I/O ranges as the whole Component Register range must be mapped again while a capability's I/O range is already mapped. Different capabilities cannot be setup at the same time. E.g. the RAS capability must be made available as soon as the PCI driver is bound, the HDM decoder is setup later during port enumeration. Moreover, during early setup it is still unknown if a certain capability is needed. A central capability setup is therefore not possible, capabilities must be individually enabled once needed during initialization. To avoid a duplicate register probe and overlapping I/O mappings, only probe the Component Registers one time and store the Component Register mapping in struct port. The stored mappings can be used later to iomap the capability register range when enabling the capability, which will be implemented in a follow-on patch. Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-15-terry.bowman@amd.com Signed-off-by: Dan Williams commit 733b57f262b0e9f05ffeac102fe5bd729e263170 Author: Robert Richter Date: Thu Jun 22 15:55:09 2023 -0500 cxl/pci: Early setup RCH dport component registers from RCRB CXL RAS capabilities must be enabled and accessible as soon as the CXL endpoint is detected in the PCI hierarchy and bound to the cxl_pci driver. This needs to be independent of other modules such as cxl_port or cxl_mem. CXL RAS capabilities reside in the Component Registers. For an RCH this is determined by probing RCRB which is implemented very late once the CXL Memory Device is created. Change this by moving the RCRB probe to the cxl_pci driver. Do this by using a new introduced function cxl_pci_find_port() similar to cxl_mem_find_port() to determine the involved dport by the endpoint's PCI handle. Plug this into the existing cxl_pci_setup_regs() function to setup Component Registers. Probe the RCRB in case the Component Registers cannot be located through the CXL Register Locator capability. This unifies code and early sets up the Component Registers at the same time for both, VH and RCH mode. Only the cxl_pci driver is involved for this. This allows an early mapping of the CXL RAS capability registers. Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-14-terry.bowman@amd.com Signed-off-by: Dan Williams commit 86917c560dcf29270093768d947387ca00f729b4 Author: Robert Richter Date: Thu Jun 22 15:55:08 2023 -0500 cxl/mem: Prepare for early RCH dport component register setup In order to move the RCH dport component register setup to cxl_pci the base address must be stored in CXL device state (cxlds) for both modes, RCH and VH. Store it in cxlds->component_reg_phys and use it for endpoint creation. Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-13-terry.bowman@amd.com Signed-off-by: Dan Williams commit f1d0525effc4fffe821905671ea24c30a4bfa393 Author: Robert Richter Date: Thu Jun 22 15:55:07 2023 -0500 cxl/regs: Remove early capability checks in Component Register setup When probing the Component Registers in function cxl_probe_regs() there are also checks for the existence of the HDM and RAS capabilities. The checks may fail for components that do not implement the HDM capability causing the Component Registers setup to fail too. Remove the checks for a generalized use of cxl_probe_regs() and check them directly before mapping the RAS or HDM capabilities. This allows it to setup other Component Registers esp. of an RCH Downstream Port, which will be implemented in a follow-on patch. Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-12-terry.bowman@amd.com Signed-off-by: Dan Williams commit d8bffff2016f7aef1c1dbe01125720475507b6f2 Author: Robert Richter Date: Thu Jun 22 15:55:06 2023 -0500 cxl/port: Remove Component Register base address from struct cxl_dport The Component Register base address @component_reg_phys is no longer used after the rework of the Component Register setup which now uses struct member @comp_map instead. Remove the base address. Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-11-terry.bowman@amd.com Signed-off-by: Dan Williams commit d02034b4025a086b1294bfd4a2e77525e816cea4 Author: Robert Richter Date: Thu Jun 22 15:55:05 2023 -0500 cxl/acpi: Directly bind the CEDT detected CHBCR to the Host Bridge's port During a Host Bridge's downstream port enumeration the CHBS entries in the CEDT table are parsed, its Component Register base address extracted and then stored in struct cxl_dport. The CHBS may contain either the RCRB (RCH mode) or the Host Bridge's Component Registers (CHBCR, VH mode). The RCRB further contains the CXL downstream port register base address, while in VH mode the CXL Downstream Switch Ports are visible in the PCI hierarchy and the DP's component regs are disovered using the CXL DVSEC register locator capability. The Component Registers derived from the CHBS for both modes are different and thus also must be treated differently. That is, in RCH mode, the component regs base should be bound to the dport, but in VH mode to the CXL host bridge's port object. The current implementation stores the CHBCR in addition in struct cxl_dport and copies it later from there to struct cxl_port. As a result, the dport contains the wrong Component Registers base address and, e.g. the RAS capability of a CXL Root Port cannot be detected. To fix the CHBCR binding, attach it directly to the Host Bridge's @cxl_port structure. Do this during port creation of the Host Bridge in add_host_bridge_uport(). Factor out CHBS parsing code in add_host_bridge_dport() and use it in both functions. Co-developed-by: Dan Williams Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-10-terry.bowman@amd.com Signed-off-by: Dan Williams commit f44c7b7ad9b8def769ba709e369fe92906250c02 Author: Robert Richter Date: Thu Jun 22 15:55:04 2023 -0500 cxl/acpi: Move add_host_bridge_uport() after cxl_get_chbs() Just moving code to reorder functions to later share cxl_get_chbs() with add_host_bridge_uport(). This makes changes in the next patch visible. No other changes at all. Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-9-terry.bowman@amd.com Signed-off-by: Dan Williams commit d076bb8c4cee23fa1ddeae36f72a4695529c9198 Author: Terry Bowman Date: Thu Jun 22 15:55:03 2023 -0500 cxl/pci: Refactor component register discovery for reuse The endpoint implements component register setup code. Refactor it for reuse with RCRB, downstream port, and upstream port setup. Move PCI specifics from cxl_setup_regs() into cxl_pci_setup_regs(). Move cxl_setup_regs() into cxl/core/regs.c and export it. This also includes supporting static functions cxl_map_registerblock(), cxl_unmap_register_block() and cxl_probe_regs(). Co-developed-by: Robert Richter Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-8-terry.bowman@amd.com Signed-off-by: Dan Williams commit 573408049b7598a7c4ef6981b70b1275447d28e4 Author: Robert Richter Date: Thu Jun 22 15:55:02 2023 -0500 cxl/core/regs: Add @dev to cxl_register_map The corresponding device of a register mapping is used for devm operations and logging. For operations with struct cxl_register_map the device needs to be kept track separately. To simpify the involved function interfaces, add @dev to cxl_register_map. While at it also reorder function arguments of cxl_map_device_regs() and cxl_map_component_regs() to have the object @cxl_register_map first. As a result a bunch of functions are available to be used with a @cxl_register_map object. This patch is in preparation of reworking the component register setup code. Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-7-terry.bowman@amd.com Signed-off-by: Dan Williams commit 7481653deef24fb9a030339430d2f5723e0ccf78 Author: Dan Williams Date: Thu Jun 22 15:55:01 2023 -0500 cxl: Rename 'uport' to 'uport_dev' For symmetry with the recent rename of ->dport_dev for a 'struct cxl_dport', add the "_dev" suffix to the ->uport property of a 'struct cxl_port'. These devices represent the downstream-port-device and upstream-port-device respectively in the CXL/PCIe topology. Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-6-terry.bowman@amd.com Signed-off-by: Dan Williams commit 227db57459e8b6dce33c071020b0c05b1f9fa8d6 Author: Robert Richter Date: Thu Jun 22 15:55:00 2023 -0500 cxl: Rename member @dport of struct cxl_dport to @dport_dev Reading code like dport->dport does not immediately suggest that this points to the corresponding device structure of the dport. Rename struct member @dport to @dport_dev. While at it, also rename @new argument of add_dport() to @dport. This better describes the variable as a dport (e.g. new->dport becomes to dport->dport_dev). Co-developed-by: Terry Bowman Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-5-terry.bowman@amd.com Signed-off-by: Dan Williams commit 0619337856c9a1cb999417be38c4049a6b0235a0 Author: Dan Williams Date: Thu Jun 22 15:54:59 2023 -0500 cxl/rch: Prepare for caching the MMIO mapped PCIe AER capability Prepare cxl_probe_rcrb() for retrieving more than just the component register block. The RCH AER handling code wants to get back to the AER capability that happens to be MMIO mapped rather then configuration cycles. Move RCRB specific downstream port data, like the RCRB base and the AER capability offset, into its own data structure ('struct cxl_rcrb_info') for cxl_probe_rcrb() to fill. Extend 'struct cxl_dport' to include a 'struct cxl_rcrb_info' attribute. This centralizes all RCRB scanning in one routine. Co-developed-by: Robert Richter Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-4-terry.bowman@amd.com Signed-off-by: Dan Williams commit eb4663b07e13bc138aad9e2a93ee9893c7139f51 Author: Robert Richter Date: Sun Jun 25 11:35:20 2023 -0700 cxl/acpi: Probe RCRB later during RCH downstream port creation The RCRB is extracted already during ACPI CEDT table parsing while the data of this is needed not earlier than dport creation. This implementation comes with drawbacks: During ACPI table scan there is already MMIO access including mapping and unmapping, but only ACPI data should be collected here. The collected data must be transferred through a couple of interfaces until it is finally consumed when creating the dport. This causes complex data structures and function interfaces. Additionally, RCRB parsing will be extended to also extract AER data, it would be much easier do this at a later point during port and dport creation when the data structures are available to hold that data. To simplify all that, probe the RCRB at a later point during RCH downstream port creation. Change ACPI table parser to only extract the base address of either the component registers or the RCRB. Parse and extract the RCRB in devm_cxl_add_rch_dport(). This is in preparation to centralize all RCRB scanning. Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230622205523.85375-2-terry.bowman@amd.com Co-developed-by: Dan Williams Link: https://lore.kernel.org/r/20230622205523.85375-3-terry.bowman@amd.com Signed-off-by: Dan Williams commit 8e86ebefdd5ca15458fcb3a03da89ab9cad6382b Author: Masahiro Yamada Date: Tue Jun 20 21:05:21 2023 +0900 modpost: continue even with unknown relocation type Currently, unknown relocation types are just skipped. The value of r_addend is only needed to get the symbol name in case is_valid_name(elf, sym) returns false. Even if we do not know how to calculate r_addend, we should continue. At worst, we will get "(unknown)" as the symbol name, but it is better than failing to detect section mismatches. Signed-off-by: Masahiro Yamada commit 8aa00e2c3da470c82148f64b6a3cac2d79bb9d16 Author: Masahiro Yamada Date: Tue Jun 20 21:05:20 2023 +0900 modpost: factor out Elf_Sym pointer calculation to section_rel() Pass the Elf_Sym pointer to addend_arm_rel() as well as to check_section_mismatch(). Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit b31db651f745604371e4d3304f5b16fc3d9d0110 Author: Masahiro Yamada Date: Tue Jun 20 21:05:19 2023 +0900 modpost: factor out inst location calculation to section_rel() All the addend_*_rel() functions calculate the instruction location in the same way. Factor out the similar code to the caller. Squash reloc_location() too. Signed-off-by: Masahiro Yamada commit 25a21fbb934a0d989e1858f83c2ddf4cfb2ebe30 Author: Sami Tolvanen Date: Fri Jun 23 00:11:43 2023 +0000 kbuild: Disable GCOV for *.mod.o With GCOV_PROFILE_ALL, Clang injects __llvm_gcov_* functions to each object file, including the *.mod.o. As we filter out CC_FLAGS_CFI for *.mod.o, the compiler won't generate type hashes for the injected functions, and therefore indirectly calling them during module loading trips indirect call checking. Enabling CFI for *.mod.o isn't sufficient to fix this issue after commit 0c3e806ec0f9 ("x86/cfi: Add boot time hash randomization"), as *.mod.o aren't processed by objtool, which means any hashes emitted there won't be randomized. Therefore, in addition to disabling CFI for *.mod.o, also disable GCOV, as the object files don't otherwise contain any executable code. Fixes: cf68fffb66d6 ("add support for Clang CFI") Reported-by: Joe Fradley Signed-off-by: Sami Tolvanen Acked-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit ddf56288eebd1fe82c46fc9f693b5b18045cddb6 Author: Sami Tolvanen Date: Fri Jun 23 00:11:42 2023 +0000 kbuild: Fix CFI failures with GCOV With GCOV_PROFILE_ALL, Clang injects __llvm_gcov_* functions to each object file, and the functions are indirectly called during boot. However, when code is injected to object files that are not part of vmlinux.o, it's also not processed by objtool, which breaks CFI hash randomization as the hashes in these files won't be included in the .cfi_sites section and thus won't be randomized. Similarly to commit 42633ed852de ("kbuild: Fix CFI hash randomization with KASAN"), disable GCOV for .vmlinux.export.o and init/version-timestamp.o to avoid emitting unnecessary functions to object files that don't otherwise have executable code. Fixes: 0c3e806ec0f9 ("x86/cfi: Add boot time hash randomization") Reported-by: Joe Fradley Signed-off-by: Sami Tolvanen Acked-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 3602906019a68c340b69991bb4020e10374fb0d0 Author: Masahiro Yamada Date: Sun Jun 18 00:30:25 2023 +0900 kbuild: make clean rule robust against too long argument error Commit cd968b97c492 ("kbuild: make built-in.a rule robust against too long argument error") made a build rule robust against "Argument list too long" error. Eugeniu Rosca reported the same error occurred when cleaning an external module. The $(obj)/ prefix can be a very long path for external modules. Apply a similar solution to 'make clean'. Reported-by: Eugeniu Rosca Signed-off-by: Masahiro Yamada Reviewed-by: Eugeniu Rosca Tested-by: Eugeniu Rosca commit c6b7a3a26e809c9d2a51ae303764c1d2994f31cf Author: Ming Lei Date: Sat Jun 24 21:01:05 2023 +0800 blk-mq: fix two misuses on RQF_USE_SCHED Request allocated from sched tags can't be issued via ->queue_rqs() directly, since driver tag isn't allocated yet. This is the 1st misuse of RQF_USE_SCHED for figuring out plug->has_elevator. Request allocated from sched tags can't be ended by blk_mq_end_request_batch() too, fix the 2nd RQF_USE_SCHED misuse in blk_mq_add_to_batch(). Without this patch, NVMe uring cmd passthrough IO workload can run into hang easily with real io scheduler. Fixes: dd6216bb16e8 ("blk-mq: make sure elevator callbacks aren't called for passthrough request") Reported-by: Guangwu Zhang Closes: https://lore.kernel.org/linux-block/CAGS2=YrBjpLPOKa-gzcKuuOG60AGth5794PNCDwatdnnscB9ug@mail.gmail.com/ Cc: Christoph Hellwig Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230624130105.1443879-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit ad7c3b41e86b59943a903d23c7b037d820e6270c Author: Jinke Han Date: Mon May 8 01:06:31 2023 +0800 blk-throttle: Fix io statistics for cgroup v1 After commit f382fb0bcef4 ("block: remove legacy IO schedulers"), blkio.throttle.io_serviced and blkio.throttle.io_service_bytes become the only stable io stats interface of cgroup v1, and these statistics are done in the blk-throttle code. But the current code only counts the bios that are actually throttled. When the user does not add the throttle limit, the io stats for cgroup v1 has nothing. I fix it according to the statistical method of v2, and made it count all ios accurately. Fixes: a7b36ee6ba29 ("block: move blk-throtl fast path inline") Tested-by: Andrea Righi Signed-off-by: Jinke Han Acked-by: Muchun Song Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230507170631.89607-1-hanjinke.666@bytedance.com Signed-off-by: Jens Axboe commit 4e0871333661d2ec0ed3dc00a945c2160eccae77 Author: Matthias Reichl Date: Sat Jun 24 18:52:32 2023 +0200 ASoC: hdmi-codec: fix channel info for compressed formats According to CTA 861 the channel/speaker allocation info in the audio infoframe only applies to uncompressed (PCM) audio streams. The channel count info should indicate the number of channels in the transmitted audio, which usually won't match the number of channels used to transmit the compressed bitstream. Some devices (eg some Sony TVs) will refuse to decode compressed audio if these values are not set correctly. To fix this we can simply set the channel count to 0 (which means "refer to stream header") and set the channel/speaker allocation to 0 as well (which would mean stereo FL/FR for PCM, a safe value all sinks will support) when transmitting compressed audio. Signed-off-by: Matthias Reichl Link: https://lore.kernel.org/r/20230624165232.5751-1-hias@horus.com Signed-off-by: Takashi Iwai commit 04b49b90caeed0b5544ff616d654900d27d403b6 Author: Matthias Reichl Date: Sat Jun 24 18:52:16 2023 +0200 ALSA: pcm: fix ELD constraints for (E)AC3, DTS(-HD) and MLP formats The SADs of compressed formats contain the channel and sample rate info of the audio data inside the compressed stream, but when building constraints we must use the rates and channels used to transport the compressed streams. eg 48kHz 6ch EAC3 needs to be transmitted as a 2ch 192kHz stream. This patch fixes the constraints for the common AC3 and DTS formats, the constraints for the less common MPEG, DSD etc formats are copied directly from the info in the SADs as before as I don't have the specs and equipment to test those. Signed-off-by: Matthias Reichl Link: https://lore.kernel.org/r/20230624165216.5719-1-hias@horus.com Signed-off-by: Takashi Iwai commit 4dbbaf8fbdbd13adc80731b2452257857e4c2d8b Author: Jerrod Frost Date: Sat Jun 24 22:23:44 2023 -0300 hwmon: (oxp-sensors) Add support for AOKZOE A1 PRO This device is an iteration over the AOKZOE A1 with the same EC mapping and features. It also has support for tt_toggle. Signed-off-by: Jerrod Frost Signed-off-by: Joaquín Ignacio Aramendía Link: https://lore.kernel.org/r/20230625012347.121352-2-samsagax@gmail.com Signed-off-by: Guenter Roeck commit 9ae440b8fdd6772b6c007fa3d3766530a09c9045 Merge: b545a13ca9b20 b848b26c6672c Author: Jakub Kicinski Date: Sat Jun 24 15:50:21 2023 -0700 Merge branch 'splice-net-switch-over-users-of-sendpage-and-remove-it' David Howells says: ==================== splice, net: Switch over users of sendpage() and remove it Here's the final set of patches towards the removal of sendpage. All the drivers that use sendpage() get switched over to using sendmsg() with MSG_SPLICE_PAGES. The following changes are made: (1) Make the protocol drivers behave according to MSG_MORE, not MSG_SENDPAGE_NOTLAST. The latter is restricted to turning on MSG_MORE in the sendpage() wrappers. (2) Fix ocfs2 to allocate its global protocol buffers with folio_alloc() rather than kzalloc() so as not to invoke the !sendpage_ok warning in skb_splice_from_iter(). (3) Make ceph/rds, skb_send_sock, dlm, nvme, smc, ocfs2, drbd and iscsi use sendmsg(), not sendpage and make them specify MSG_MORE instead of MSG_SENDPAGE_NOTLAST. (4) Kill off sendpage and clean up MSG_SENDPAGE_NOTLAST. Link: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=51c78a4d532efe9543a4df019ff405f05c6157f6 # part 1 Link: https://lore.kernel.org/r/20230616161301.622169-1-dhowells@redhat.com/ # v1 Link: https://lore.kernel.org/r/20230617121146.716077-1-dhowells@redhat.com/ # v2 Link: https://lore.kernel.org/r/20230620145338.1300897-1-dhowells@redhat.com/ # v3 ==================== Link: https://lore.kernel.org/r/20230623225513.2732256-1-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit b848b26c6672c9b977890ba85f5a155e5eb221f0 Author: David Howells Date: Fri Jun 23 23:55:13 2023 +0100 net: Kill MSG_SENDPAGE_NOTLAST Now that ->sendpage() has been removed, MSG_SENDPAGE_NOTLAST can be cleaned up. Things were converted to use MSG_MORE instead, but the protocol sendpage stubs still convert MSG_SENDPAGE_NOTLAST to MSG_MORE, which is now unnecessary. Signed-off-by: David Howells cc: Jens Axboe cc: Matthew Wilcox cc: linux-afs@lists.infradead.org cc: mptcp@lists.linux.dev cc: rds-devel@oss.oracle.com cc: tipc-discussion@lists.sourceforge.net cc: virtualization@lists.linux-foundation.org Link: https://lore.kernel.org/r/20230623225513.2732256-17-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit dc97391e661009eab46783030d2404c9b6e6f2e7 Author: David Howells Date: Fri Jun 23 23:55:12 2023 +0100 sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES) Remove ->sendpage() and ->sendpage_locked(). sendmsg() with MSG_SPLICE_PAGES should be used instead. This allows multiple pages and multipage folios to be passed through. Signed-off-by: David Howells Acked-by: Marc Kleine-Budde # for net/can cc: Jens Axboe cc: Matthew Wilcox cc: linux-afs@lists.infradead.org cc: mptcp@lists.linux.dev cc: rds-devel@oss.oracle.com cc: tipc-discussion@lists.sourceforge.net cc: virtualization@lists.linux-foundation.org Link: https://lore.kernel.org/r/20230623225513.2732256-16-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit e52828cc0109f511bba1dfb41292833c2fd3b6e6 Author: David Howells Date: Fri Jun 23 23:55:11 2023 +0100 ocfs2: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage() Switch ocfs2 from using sendpage() to using sendmsg() + MSG_SPLICE_PAGES so that sendpage can be phased out. Signed-off-by: David Howells cc: Mark Fasheh cc: Joel Becker cc: Joseph Qi cc: ocfs2-devel@oss.oracle.com Link: https://lore.kernel.org/r/20230623225513.2732256-15-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit 86d7bd6e66e9925f0f04a7bcf3c92c05fdfefb5a Author: David Howells Date: Fri Jun 23 23:55:10 2023 +0100 ocfs2: Fix use of slab data with sendpage ocfs2 uses kzalloc() to allocate buffers for o2net_hand, o2net_keep_req and o2net_keep_resp and then passes these to sendpage. This isn't really allowed as the lifetime of slab objects is not controlled by page ref - though in this case it will probably work. sendmsg() with MSG_SPLICE_PAGES will, however, print a warning and give an error. Fix it to use folio_alloc() instead to allocate a buffer for the handshake message, keepalive request and reply messages. Fixes: 98211489d414 ("[PATCH] OCFS2: The Second Oracle Cluster Filesystem") Signed-off-by: David Howells cc: Mark Fasheh cc: Kurt Hackel cc: Joel Becker cc: Joseph Qi cc: ocfs2-devel@oss.oracle.com Link: https://lore.kernel.org/r/20230623225513.2732256-14-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit d2fe21077d6d4687ecab642ffe97c2e4acf3a547 Author: David Howells Date: Fri Jun 23 23:55:09 2023 +0100 scsi: target: iscsi: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage Use sendmsg() with MSG_SPLICE_PAGES rather than sendpage. This allows multiple pages and multipage folios to be passed through. TODO: iscsit_fe_sendpage_sg() should perhaps set up a bio_vec array for the entire set of pages it's going to transfer plus two for the header and trailer and page fragments to hold the header and trailer - and then call sendmsg once for the entire message. Signed-off-by: David Howells cc: Mike Christie cc: Maurizio Lombardi cc: "James E.J. Bottomley" cc: "Martin K. Petersen" cc: Jens Axboe cc: Matthew Wilcox cc: Al Viro cc: open-iscsi@googlegroups.com Link: https://lore.kernel.org/r/20230623225513.2732256-13-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit fa8df3435727a7b398760ef5e2ac95457a62ae1b Author: David Howells Date: Fri Jun 23 23:55:08 2023 +0100 scsi: iscsi_tcp: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage Use sendmsg() with MSG_SPLICE_PAGES rather than sendpage. This allows multiple pages and multipage folios to be passed through. Signed-off-by: David Howells Reviewed-by: Mike Christie cc: Lee Duncan cc: Chris Leech cc: "James E.J. Bottomley" cc: "Martin K. Petersen" cc: Jens Axboe cc: Matthew Wilcox cc: Al Viro cc: open-iscsi@googlegroups.com Link: https://lore.kernel.org/r/20230623225513.2732256-12-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit eeac7405c735acde8ec78869489a5aa25a141c13 Author: David Howells Date: Fri Jun 23 23:55:07 2023 +0100 drbd: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage() Use sendmsg() conditionally with MSG_SPLICE_PAGES in _drbd_send_page() rather than calling sendpage() or _drbd_no_send_page(). Signed-off-by: David Howells cc: Philipp Reisner cc: Lars Ellenberg cc: "Christoph Böhmwalder" cc: Jens Axboe cc: drbd-dev@lists.linbit.com Link: https://lore.kernel.org/r/20230623225513.2732256-11-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit 2f8bc2bbb0fa87bcf7fb9eeb65eb6d79c5a08895 Author: David Howells Date: Fri Jun 23 23:55:06 2023 +0100 smc: Drop smc_sendpage() in favour of smc_sendmsg() + MSG_SPLICE_PAGES Drop the smc_sendpage() code as smc_sendmsg() just passes the call down to the underlying TCP socket and smc_tx_sendpage() is just a wrapper around its sendmsg implementation. Signed-off-by: David Howells cc: Karsten Graul cc: Wenjia Zhang cc: Jan Karcher cc: "D. Wythe" cc: Tony Lu cc: Wen Gu cc: Jens Axboe cc: Matthew Wilcox Link: https://lore.kernel.org/r/20230623225513.2732256-10-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit c336a79983c7e67a0a163ab4feafa3c273d915be Author: David Howells Date: Fri Jun 23 23:55:05 2023 +0100 nvmet-tcp: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage When transmitting data, call down into TCP using a single sendmsg with MSG_SPLICE_PAGES to indicate that content should be spliced rather than copied instead of calling sendpage. Signed-off-by: David Howells Tested-by: Sagi Grimberg Acked-by: Willem de Bruijn cc: Keith Busch cc: Jens Axboe cc: Christoph Hellwig cc: Chaitanya Kulkarni cc: Jens Axboe cc: Matthew Wilcox cc: linux-nvme@lists.infradead.org Link: https://lore.kernel.org/r/20230623225513.2732256-9-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit 7769887817c3dc49b55957badcbd515cf925728b Author: David Howells Date: Fri Jun 23 23:55:04 2023 +0100 nvme-tcp: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage When transmitting data, call down into TCP using a sendmsg with MSG_SPLICE_PAGES instead of sendpage. Signed-off-by: David Howells Tested-by: Sagi Grimberg Acked-by: Willem de Bruijn cc: Keith Busch cc: Jens Axboe cc: Christoph Hellwig cc: Chaitanya Kulkarni cc: Jens Axboe cc: Matthew Wilcox cc: linux-nvme@lists.infradead.org Link: https://lore.kernel.org/r/20230623225513.2732256-8-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit a1a5e8752786b2f7c5699fb99e3a641936297d69 Author: David Howells Date: Fri Jun 23 23:55:03 2023 +0100 dlm: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage When transmitting data, call down a layer using a single sendmsg with MSG_SPLICE_PAGES to indicate that content should be spliced rather using sendpage. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Christine Caulfield cc: David Teigland cc: Jens Axboe cc: Matthew Wilcox cc: cluster-devel@redhat.com Link: https://lore.kernel.org/r/20230623225513.2732256-7-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit 572efade27c55f11436ed10bbb59ef10c6d83d93 Author: David Howells Date: Fri Jun 23 23:55:02 2023 +0100 rds: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage When transmitting data, call down into TCP using a single sendmsg with MSG_SPLICE_PAGES to indicate that content should be spliced. To make this work, the data is assembled in a bio_vec array and attached to a BVEC-type iterator. Signed-off-by: David Howells cc: Santosh Shilimkar cc: Jens Axboe cc: Matthew Wilcox cc: rds-devel@oss.oracle.com Link: https://lore.kernel.org/r/20230623225513.2732256-6-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit fa094ccae1e7904d9fa7bb1bc44c9873eec7baf4 Author: David Howells Date: Fri Jun 23 23:55:01 2023 +0100 ceph: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage() Use sendmsg() and MSG_SPLICE_PAGES rather than sendpage in ceph when transmitting data. For the moment, this can only transmit one page at a time because of the architecture of net/ceph/, but if write_partial_message_data() can be given a bvec[] at a time by the iteration code, this would allow pages to be sent in a batch. Signed-off-by: David Howells cc: Ilya Dryomov cc: Xiubo Li cc: Jeff Layton cc: Jens Axboe cc: Matthew Wilcox Link: https://lore.kernel.org/r/20230623225513.2732256-5-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit 40a8c17aa7709caaeb9c6945297a98fe8699ca1b Author: David Howells Date: Fri Jun 23 23:55:00 2023 +0100 ceph: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage Use sendmsg() and MSG_SPLICE_PAGES rather than sendpage in ceph when transmitting data. For the moment, this can only transmit one page at a time because of the architecture of net/ceph/, but if write_partial_message_data() can be given a bvec[] at a time by the iteration code, this would allow pages to be sent in a batch. Signed-off-by: David Howells cc: Ilya Dryomov cc: Xiubo Li cc: Jeff Layton cc: Jens Axboe cc: Matthew Wilcox Link: https://lore.kernel.org/r/20230623225513.2732256-4-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit c729ed6f5be57b4d164dbbc415554c066e29306b Author: David Howells Date: Fri Jun 23 23:54:59 2023 +0100 net: Use sendmsg(MSG_SPLICE_PAGES) not sendpage in skb_send_sock() Use sendmsg() with MSG_SPLICE_PAGES rather than sendpage in skb_send_sock(). This causes pages to be spliced from the source iterator if possible. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Note that this could perhaps be improved to fill out a bvec array with all the frags and then make a single sendmsg call, possibly sticking the header on the front also. Signed-off-by: David Howells cc: Jens Axboe cc: Matthew Wilcox Link: https://lore.kernel.org/r/20230623225513.2732256-3-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit f8dd95b29d7ef08c19ec9720564acf72243ddcf6 Author: David Howells Date: Fri Jun 23 23:54:58 2023 +0100 tcp_bpf, smc, tls, espintcp, siw: Reduce MSG_SENDPAGE_NOTLAST usage As MSG_SENDPAGE_NOTLAST is being phased out along with sendpage(), don't use it further in than the sendpage methods, but rather translate it to MSG_MORE and use that instead. Signed-off-by: David Howells cc: Willem de Bruijn cc: Bernard Metzler cc: Jason Gunthorpe cc: Leon Romanovsky cc: John Fastabend cc: Jakub Sitnicki cc: David Ahern cc: Karsten Graul cc: Wenjia Zhang cc: Jan Karcher cc: "D. Wythe" cc: Tony Lu cc: Wen Gu cc: Boris Pismenny cc: Steffen Klassert cc: Herbert Xu Link: https://lore.kernel.org/r/20230623225513.2732256-2-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit b545a13ca9b203eacce1e52ae2e32f99b860347c Merge: 35bf34b07808e 29e4c95faee52 Author: Jakub Kicinski Date: Sat Jun 24 15:48:04 2023 -0700 Merge tag 'mlx5-updates-2023-06-21' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2023-06-21 mlx5 driver minor cleanup and fixes to net-next * tag 'mlx5-updates-2023-06-21' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5: Remove pointless vport lookup from mlx5_esw_check_port_type() net/mlx5: Remove redundant check from mlx5_esw_query_vport_vhca_id() net/mlx5: Remove redundant is_mdev_switchdev_mode() check from is_ib_rep_supported() net/mlx5: Remove redundant MLX5_ESWITCH_MANAGER() check from is_ib_rep_supported() net/mlx5e: E-Switch, Fix shared fdb error flow net/mlx5e: Remove redundant comment net/mlx5e: E-Switch, Pass other_vport flag if vport is not 0 net/mlx5e: E-Switch, Use xarray for devcom paired device index net/mlx5e: E-Switch, Add peer fdb miss rules for vport manager or ecpf net/mlx5e: Use vhca_id for device index in vport rx rules net/mlx5: Lag, Remove duplicate code checking lag is supported net/mlx5: Fix error code in mlx5_is_reset_now_capable() net/mlx5: Fix reserved at offset in hca_cap register net/mlx5: Fix SFs kernel documentation error net/mlx5: Fix UAF in mlx5_eswitch_cleanup() ==================== Link: https://lore.kernel.org/r/20230623192907.39033-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 35bf34b07808e4ff405b8c87aae049d5ca4219c6 Merge: 2ffecf1a42ccd 334f39ce17eff Author: Jakub Kicinski Date: Sat Jun 24 15:45:51 2023 -0700 Merge branch 'netlink-add-display-hint-to-ynl' Donald Hunter says: ==================== netlink: add display-hint to ynl Add a display-hint property to the netlink schema, to be used by generic netlink clients as hints about how to display attribute values. A display-hint on an attribute definition is intended for letting a client such as ynl know that, for example, a u32 should be rendered as an ipv4 address. The display-hint enumeration includes a small number of networking domain-specific value types. ==================== Link: https://lore.kernel.org/r/20230623201928.14275-1-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski commit 334f39ce17eff255f243ab5998af27ae40f9f04c Author: Donald Hunter Date: Fri Jun 23 21:19:28 2023 +0100 netlink: specs: add display hints to ovs_flow Add display hints for mac, ipv4, ipv6, hex and uuid to the ovs_flow schema. Signed-off-by: Donald Hunter Link: https://lore.kernel.org/r/20230623201928.14275-4-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski commit d8eea68d913c20aabb3a97bc1e9ba61407a9e872 Author: Donald Hunter Date: Fri Jun 23 21:19:27 2023 +0100 tools: ynl: add display-hint support to ynl Add support to the ynl tool for rendering output based on display-hint properties. Signed-off-by: Donald Hunter Link: https://lore.kernel.org/r/20230623201928.14275-3-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski commit 737eab775d367b0ba6575d8aa2073c607a9bcf9e Author: Donald Hunter Date: Fri Jun 23 21:19:26 2023 +0100 netlink: specs: add display-hint to schema definitions Add a display-hint property to the netlink schema that is for providing optional hints to generic netlink clients about how to display attribute values. A display-hint on an attribute definition is intended for letting a client such as ynl know that, for example, a u32 should be rendered as an ipv4 address. The display-hint enumeration includes a small number of networking domain-specific value types. Signed-off-by: Donald Hunter Link: https://lore.kernel.org/r/20230623201928.14275-2-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski commit 2ffecf1a42ccd67e4b2fec7a613e375014869d60 Merge: 14fd5e0d484a0 18b849f12dcc3 Author: Jakub Kicinski Date: Sat Jun 24 15:41:46 2023 -0700 Merge tag 'ieee802154-for-net-next-2023-06-23' of gitolite.kernel.org:pub/scm/linux/kernel/git/wpan/wpan-next Miquel Raynal says: ==================== Core WPAN changes: - Support for active scans - Support for answering BEACON_REQ - Specific MLME handling for limited devices WPAN driver changes: - ca8210: - Flag the devices as limited - Remove stray gpiod_unexport() call * tag 'ieee802154-for-net-next-2023-06-23' of gitolite.kernel.org:pub/scm/linux/kernel/git/wpan/wpan-next: ieee802154: ca8210: Remove stray gpiod_unexport() call ieee802154: ca8210: Flag the driver as being limited net: ieee802154: Handle limited devices with only datagram support mac802154: Handle received BEACON_REQ ieee802154: Add support for allowing to answer BEACON_REQ mac802154: Handle active scanning ieee802154: Add support for user active scan requests ==================== Link: https://lore.kernel.org/r/20230623195506.40b87b5f@xps-13 Signed-off-by: Jakub Kicinski commit f1bc9fc4a06de0108e0dca2a9a7e99ba1fc632f9 Author: Maxim Kochetkov Date: Thu Jun 22 22:22:45 2023 +0300 net: axienet: Move reset before 64-bit DMA detection 64-bit DMA detection will fail if axienet was started before (by boot loader, boot ROM, etc). In this state axienet will not start properly. XAXIDMA_TX_CDESC_OFFSET + 4 register (MM2S_CURDESC_MSB) is used to detect 64-bit DMA capability here. But datasheet says: When DMACR.RS is 1 (axienet is in enabled state), CURDESC_PTR becomes Read Only (RO) and is used to fetch the first descriptor. So iowrite32()/ioread32() trick to this register to detect 64-bit DMA will not work. So move axienet reset before 64-bit DMA detection. Fixes: f735c40ed93c ("net: axienet: Autodetect 64-bit DMA capability") Signed-off-by: Maxim Kochetkov Reviewed-by: Robert Hancock Reviewed-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/20230622192245.116864-1-fido_max@inbox.ru Signed-off-by: Jakub Kicinski commit 14fd5e0d484a0e17e8e012d44b5af80d76ac8672 Merge: c4015bbee9c09 e6b8a78ea266a Author: Jakub Kicinski Date: Sat Jun 24 15:38:02 2023 -0700 Merge branch 'selftests-mptcp-refactoring-and-minor-fixes' Mat Martineau says: ==================== selftests: mptcp: Refactoring and minor fixes Patch 1 moves code around for clarity and improved code reuse. Patch 2 makes use of new MPTCP info that consolidates MPTCP-level and subflow-level information. Patches 3-7 refactor code to favor limited-scope environment vars over optional parameters. Patch 8: typo fix ==================== Link: https://lore.kernel.org/r/20230623-send-net-next-20230623-v1-0-a883213c8ba9@kernel.org Signed-off-by: Jakub Kicinski commit e6b8a78ea266a2feeb3ac8cc6ed45bf667f6e405 Author: Yueh-Shun Li Date: Fri Jun 23 10:34:14 2023 -0700 selftests: mptcp: connect: fix comment typo Spell "transmissions" properly. Found by searching for keyword "tranm". Reviewed-by: Matthieu Baerts Signed-off-by: Yueh-Shun Li Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20230623-send-net-next-20230623-v1-8-a883213c8ba9@kernel.org Signed-off-by: Jakub Kicinski commit 9e9d176df8e9aa74c9efc09ac1b4d348261cb630 Author: Geliang Tang Date: Fri Jun 23 10:34:13 2023 -0700 selftests: mptcp: add pm_nl_set_endpoint helper This patch moves endpoint settings out of do_transfer() into a new helper pm_nl_set_endpoint(). And invoke this helper in do_transfer(). This makes the code much more clearer. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20230623-send-net-next-20230623-v1-7-a883213c8ba9@kernel.org Signed-off-by: Jakub Kicinski commit 1534f87ee0dc1328043f7d0872fbf34937185682 Author: Geliang Tang Date: Fri Jun 23 10:34:12 2023 -0700 selftests: mptcp: drop sflags parameter run_tests() accepts too many optional parameters. Before this modification, it was required to set all of then when only the last one had to be changed. That's not clear to see all these 0 and it makes the maintenance harder: run_tests $ns1 $ns2 10.0.1.1 1 2 3 slow Instead, the parameter can be set as an env var with a limited scope: foo=1 bar=2 next=3 \ run_tests $ns1 $ns2 10.0.1.1 slow This patch switches to key/value "sflags=*" instead of positional parameter sflags of do_transfer() and run_tests(). Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20230623-send-net-next-20230623-v1-6-a883213c8ba9@kernel.org Signed-off-by: Jakub Kicinski commit 595ef566a2ef9af9e799491580e57c09c64c4e6d Author: Geliang Tang Date: Fri Jun 23 10:34:11 2023 -0700 selftests: mptcp: drop addr_nr_ns1/2 parameters run_tests() accepts too many optional parameters. Before this modification, it was required to set all of then when only the last one had to be changed. That's not clear to see all these 0 and it makes the maintenance harder: run_tests $ns1 $ns2 10.0.1.1 1 2 3 slow Instead, the parameter can be set as an env var with a limited scope: foo=1 bar=2 next=3 \ run_tests $ns1 $ns2 10.0.1.1 slow This patch switches to key/value "addr_nr_ns1=*, addr_nr_ns2=*" instead of positional parameters addr_nr_ns1 and addr_nr_ns2 of do_transfer() and run_tests(). Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20230623-send-net-next-20230623-v1-5-a883213c8ba9@kernel.org Signed-off-by: Jakub Kicinski commit 0c93af1f8907902692014fd7072d54e275034800 Author: Geliang Tang Date: Fri Jun 23 10:34:10 2023 -0700 selftests: mptcp: drop test_linkfail parameter run_tests() accepts too many optional parameters. Before this modification, it was required to set all of then when only the last one had to be changed. That's not clear to see all these 0 and it makes the maintenance harder: run_tests $ns1 $ns2 10.0.1.1 1 2 3 slow Instead, the parameter can be set as an env var with a limited scope: foo=1 bar=2 next=3 \ run_tests $ns1 $ns2 10.0.1.1 slow This patch switches to key/value "test_linkfail=*" instead of positional parameter test_linkfail of do_transfer() and run_tests(). Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20230623-send-net-next-20230623-v1-4-a883213c8ba9@kernel.org Signed-off-by: Jakub Kicinski commit be7e9786c9155c2942cd53b813e4723be67e07c4 Author: Geliang Tang Date: Fri Jun 23 10:34:09 2023 -0700 selftests: mptcp: set FAILING_LINKS in run_tests Set FAILING_LINKS as an env var with a limited scope only when calling run_tests(). Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20230623-send-net-next-20230623-v1-3-a883213c8ba9@kernel.org Signed-off-by: Jakub Kicinski commit d7ced753aa851f54735d20ca49ddf4710e43f1d1 Author: Geliang Tang Date: Fri Jun 23 10:34:08 2023 -0700 selftests: mptcp: check subflow and addr infos New MPTCP info are being checked in multiple places to improve the code coverage when using the userspace PM. This patch makes chk_mptcp_info() more generic to be able to check subflows, add_addr_signal and add_addr_accepted info (and even more later). New arguments are now required to get different infos from the two namespaces because some counters are specific to the client or the server. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20230623-send-net-next-20230623-v1-2-a883213c8ba9@kernel.org Signed-off-by: Jakub Kicinski commit 4369c198e5990ee077b97c979d678b5abd8a91ba Author: Geliang Tang Date: Fri Jun 23 10:34:07 2023 -0700 selftests: mptcp: test userspace pm out of transfer This patch moves userspace pm tests out of do_transfer(). Move add address test into a new function userspace_pm_add_addr(), and remove address test into userspace_pm_rm_sf_addr_ns1(). Move add subflow test into userspace_pm_add_sf() and remove subflow into userspace_pm_rm_sf_addr_ns2(). Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20230623-send-net-next-20230623-v1-1-a883213c8ba9@kernel.org Signed-off-by: Jakub Kicinski commit c4015bbee9c0973fb98e2f357a20d1f8266bdf27 Merge: cfd40b82a50f8 4194f32a4b2b1 Author: Jakub Kicinski Date: Sat Jun 24 15:36:05 2023 -0700 Merge branch 'net-stmmac-introduce-devres-helpers-for-stmmac-platform-drivers' Bartosz Golaszewski says: ==================== net: stmmac: introduce devres helpers for stmmac platform drivers The goal of this series is two-fold: to make the API for stmmac platforms more logically correct (by providing functions that acquire resources with release counterparts that undo only their actions and nothing more) and to provide devres variants of commonly use registration functions that allows to significantly simplify the platform drivers. The current pattern for stmmac platform drivers is to call stmmac_probe_config_dt(), possibly the platform's init() callback and then call stmmac_drv_probe(). The resources allocated by these calls will then be released by calling stmmac_pltfr_remove(). This goes against the commonly accepted way of providing each function that allocated a resource with a function that frees it. First: provide wrappers around platform's init() and exit() callbacks that allow users to skip checking if the callbacks exist manually. Second: provide stmmac_pltfr_probe() which calls the platform init() callback and then calls stmmac_drv_probe() together with a variant of stmmac_pltfr_remove() that DOES NOT call stmmac_remove_config_dt(). For now this variant is called stmmac_pltfr_remove_no_dt() but once all users of the old stmmac_pltfr_remove() are converted to the devres helper, it will be renamed back to stmmac_pltfr_remove() and the no_dt function removed. Finally use the devres helpers in dwmac-qco-ethqos to show how much simplier the driver's probe() becomes. This series obviously just starts the conversion process and other platform drivers will need to be converted once the helpers land in net/. ==================== Link: https://lore.kernel.org/r/20230623100417.93592-1-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit 4194f32a4b2b1e41c00fac7a1f5f63375a94ba11 Author: Bartosz Golaszewski Date: Fri Jun 23 12:04:17 2023 +0200 net: stmmac: dwmac-qcom-ethqos: use devm_stmmac_pltfr_probe() Use the devres variant of stmmac_pltfr_probe() and finally drop the remove() callback entirely. Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230623100417.93592-12-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit fc9ee2ac4f9c366d92e6bb4c89f316c47d3a8de6 Author: Bartosz Golaszewski Date: Fri Jun 23 12:04:16 2023 +0200 net: stmmac: platform: provide devm_stmmac_pltfr_probe() Provide a devres variant of stmmac_pltfr_probe() which allows users to skip calling stmmac_pltfr_remove() at driver detach. Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230623100417.93592-11-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit 061425d933ef9259dbe3789a3a3c63063f53202d Author: Bartosz Golaszewski Date: Fri Jun 23 12:04:15 2023 +0200 net: stmmac: dwmac-qco-ethqos: use devm_stmmac_probe_config_dt() Significantly simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). This allows to drop the goto jumps entirely. The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230623100417.93592-10-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit d74065427374da6659a2d7fad4ec55c8926d43c4 Author: Bartosz Golaszewski Date: Fri Jun 23 12:04:14 2023 +0200 net: stmmac: platform: provide devm_stmmac_probe_config_dt() Provide a devres variant of stmmac_probe_config_dt() that allows users to skip calling stmmac_remove_config_dt() at driver detach. Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230623100417.93592-9-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit 1be0c9d65e17684865d9ed039ac20eeb21019652 Author: Bartosz Golaszewski Date: Fri Jun 23 12:04:13 2023 +0200 net: stmmac: platform: provide stmmac_pltfr_remove_no_dt() Add a variant of stmmac_pltfr_remove() that only frees resources allocated by stmmac_pltfr_probe() and - unlike stmmac_pltfr_remove() - does not call stmmac_remove_config_dt(). Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230623100417.93592-8-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit 0a68a59493e043170be1a064558bae6a30fea39d Author: Bartosz Golaszewski Date: Fri Jun 23 12:04:12 2023 +0200 net: stmmac: dwmac-generic: use stmmac_pltfr_probe() Shrink the code and remove labels by using the new stmmac_pltfr_probe() function. Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230623100417.93592-7-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit 3d5bf75d76ea8c6bfcffd1b6aa76686d86f9ea34 Author: Bartosz Golaszewski Date: Fri Jun 23 12:04:11 2023 +0200 net: stmmac: platform: provide stmmac_pltfr_probe() Implement stmmac_pltfr_probe() which is the logical API counterpart for stmmac_pltfr_remove(). It calls the platform's init() callback and then probes the stmmac device. Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230623100417.93592-6-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit 40db9f1ddfcc97425433a609e1f829dde74aa157 Author: Bartosz Golaszewski Date: Fri Jun 23 12:04:10 2023 +0200 net: stmmac: dwmac-generic: use stmmac_pltfr_exit() Shrink the code in dwmac-generic by using the new stmmac_pltfr_exit() helper. Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230623100417.93592-5-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit 5b0acf8dd2c1bf3349257daad36dc34a8b62571e Author: Bartosz Golaszewski Date: Fri Jun 23 12:04:09 2023 +0200 net: stmmac: platform: provide stmmac_pltfr_exit() Provide a helper wrapper around calling the platform's exit() callback. This allows users to skip checking if the callback exists. Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230623100417.93592-4-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit 4450e7d4231af63027009967b01c8e258966801c Author: Bartosz Golaszewski Date: Fri Jun 23 12:04:08 2023 +0200 net: stmmac: dwmac-generic: use stmmac_pltfr_init() Shrink the code in dwmac-generic by using the new stmmac_pltfr_init() helper. Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230623100417.93592-3-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit 97117eb51ec8e9c397a0baa0b9d62acb51250a83 Author: Bartosz Golaszewski Date: Fri Jun 23 12:04:07 2023 +0200 net: stmmac: platform: provide stmmac_pltfr_init() Provide a helper wrapper around calling the platform's init() callback. This allows users to skip checking if the callback exists. Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230623100417.93592-2-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit cfd40b82a50f8c7af7e18c4b207521f7bfce01dc Merge: 2fe11c9d36ee2 b7a0345723385 Author: Jakub Kicinski Date: Sat Jun 24 15:32:18 2023 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-06-22 (ice) This series contains updates to ice driver only. Jake adds a slight wait on control queue send to reduce wait time for responses that occur within normal times. Maciej allows for hot-swapping XDP programs. Przemek removes unnecessary checks when enabling SR-IOV and freeing allocated memory. Christophe Jaillet converts a managed memory allocation to a regular one. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ice: use ice_down_up() where applicable ice: Remove managed memory usage in ice_get_fw_log_cfg() ice: remove null checks before devm_kfree() calls ice: clean up freeing SR-IOV VFs ice: allow hot-swapping XDP programs ice: reduce initial wait for control queue messages ==================== Link: https://lore.kernel.org/r/20230622183601.2406499-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 2fe11c9d36ee2f3dc3c642588c5d9a22190674c9 Author: Pavel Begunkov Date: Fri Jun 23 13:38:55 2023 +0100 net/tcp: optimise locking for blocking splice Even when tcp_splice_read() reads all it was asked for, for blocking sockets it'll release and immediately regrab the socket lock, loop around and break on the while check. Check tss.len right after we adjust it, and return if we're done. That saves us one release_sock(); lock_sock(); pair per successful blocking splice read. Signed-off-by: Pavel Begunkov Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/80736a2cc6d478c383ea565ba825eaf4d1abd876.1687523671.git.asml.silence@gmail.com Signed-off-by: Jakub Kicinski commit ce3aee7114c575fab32a5e9e939d4bbb3dcca79f Author: Kuniyuki Iwashima Date: Thu Jun 22 14:32:31 2023 -0700 gtp: Fix use-after-free in __gtp_encap_destroy(). syzkaller reported use-after-free in __gtp_encap_destroy(). [0] It shows the same process freed sk and touched it illegally. Commit e198987e7dd7 ("gtp: fix suspicious RCU usage") added lock_sock() and release_sock() in __gtp_encap_destroy() to protect sk->sk_user_data, but release_sock() is called after sock_put() releases the last refcnt. [0]: BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline] BUG: KASAN: slab-use-after-free in queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock include/linux/spinlock.h:186 [inline] BUG: KASAN: slab-use-after-free in __raw_spin_lock_bh include/linux/spinlock_api_smp.h:127 [inline] BUG: KASAN: slab-use-after-free in _raw_spin_lock_bh+0x75/0xe0 kernel/locking/spinlock.c:178 Write of size 4 at addr ffff88800dbef398 by task syz-executor.2/2401 CPU: 1 PID: 2401 Comm: syz-executor.2 Not tainted 6.4.0-rc5-01219-gfa0e21fa4443 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x72/0xa0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:351 [inline] print_report+0xcc/0x620 mm/kasan/report.c:462 kasan_report+0xb2/0xe0 mm/kasan/report.c:572 check_region_inline mm/kasan/generic.c:181 [inline] kasan_check_range+0x39/0x1c0 mm/kasan/generic.c:187 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline] queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] do_raw_spin_lock include/linux/spinlock.h:186 [inline] __raw_spin_lock_bh include/linux/spinlock_api_smp.h:127 [inline] _raw_spin_lock_bh+0x75/0xe0 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:355 [inline] release_sock+0x1f/0x1a0 net/core/sock.c:3526 gtp_encap_disable_sock drivers/net/gtp.c:651 [inline] gtp_encap_disable+0xb9/0x220 drivers/net/gtp.c:664 gtp_dev_uninit+0x19/0x50 drivers/net/gtp.c:728 unregister_netdevice_many_notify+0x97e/0x1520 net/core/dev.c:10841 rtnl_delete_link net/core/rtnetlink.c:3216 [inline] rtnl_dellink+0x3c0/0xb30 net/core/rtnetlink.c:3268 rtnetlink_rcv_msg+0x450/0xb10 net/core/rtnetlink.c:6423 netlink_rcv_skb+0x15d/0x450 net/netlink/af_netlink.c:2548 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x700/0x930 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x91c/0xe30 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0x1b7/0x200 net/socket.c:747 ____sys_sendmsg+0x75a/0x990 net/socket.c:2493 ___sys_sendmsg+0x11d/0x1c0 net/socket.c:2547 __sys_sendmsg+0xfe/0x1d0 net/socket.c:2576 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f1168b1fe5d Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 73 9f 1b 00 f7 d8 64 89 01 48 RSP: 002b:00007f1167edccc8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00000000004bbf80 RCX: 00007f1168b1fe5d RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 0000000000000003 RBP: 00000000004bbf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f1168b80530 R15: 0000000000000000 Allocated by task 1483: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x59/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slub.c:3451 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc+0x16d/0x340 mm/slub.c:3475 sk_prot_alloc+0x5f/0x280 net/core/sock.c:2073 sk_alloc+0x34/0x6c0 net/core/sock.c:2132 inet6_create net/ipv6/af_inet6.c:192 [inline] inet6_create+0x2c7/0xf20 net/ipv6/af_inet6.c:119 __sock_create+0x2a1/0x530 net/socket.c:1535 sock_create net/socket.c:1586 [inline] __sys_socket_create net/socket.c:1623 [inline] __sys_socket_create net/socket.c:1608 [inline] __sys_socket+0x137/0x250 net/socket.c:1651 __do_sys_socket net/socket.c:1664 [inline] __se_sys_socket net/socket.c:1662 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1662 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc Freed by task 2401: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x50 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free mm/kasan/common.c:200 [inline] __kasan_slab_free+0x10c/0x1b0 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3786 [inline] kmem_cache_free+0xb4/0x490 mm/slub.c:3808 sk_prot_free net/core/sock.c:2113 [inline] __sk_destruct+0x500/0x720 net/core/sock.c:2207 sk_destruct+0xc1/0xe0 net/core/sock.c:2222 __sk_free+0xed/0x3d0 net/core/sock.c:2233 sk_free+0x7c/0xa0 net/core/sock.c:2244 sock_put include/net/sock.h:1981 [inline] __gtp_encap_destroy+0x165/0x1b0 drivers/net/gtp.c:634 gtp_encap_disable_sock drivers/net/gtp.c:651 [inline] gtp_encap_disable+0xb9/0x220 drivers/net/gtp.c:664 gtp_dev_uninit+0x19/0x50 drivers/net/gtp.c:728 unregister_netdevice_many_notify+0x97e/0x1520 net/core/dev.c:10841 rtnl_delete_link net/core/rtnetlink.c:3216 [inline] rtnl_dellink+0x3c0/0xb30 net/core/rtnetlink.c:3268 rtnetlink_rcv_msg+0x450/0xb10 net/core/rtnetlink.c:6423 netlink_rcv_skb+0x15d/0x450 net/netlink/af_netlink.c:2548 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x700/0x930 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x91c/0xe30 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0x1b7/0x200 net/socket.c:747 ____sys_sendmsg+0x75a/0x990 net/socket.c:2493 ___sys_sendmsg+0x11d/0x1c0 net/socket.c:2547 __sys_sendmsg+0xfe/0x1d0 net/socket.c:2576 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc The buggy address belongs to the object at ffff88800dbef300 which belongs to the cache UDPv6 of size 1344 The buggy address is located 152 bytes inside of freed 1344-byte region [ffff88800dbef300, ffff88800dbef840) The buggy address belongs to the physical page: page:00000000d31bfed5 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88800dbeed40 pfn:0xdbe8 head:00000000d31bfed5 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888008ee0801 flags: 0x100000000010200(slab|head|node=0|zone=1) page_type: 0xffffffff() raw: 0100000000010200 ffff88800c7a3000 dead000000000122 0000000000000000 raw: ffff88800dbeed40 0000000080160015 00000001ffffffff ffff888008ee0801 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88800dbef280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88800dbef300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88800dbef380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88800dbef400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88800dbef480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb Fixes: e198987e7dd7 ("gtp: fix suspicious RCU usage") Reported-by: syzkaller Signed-off-by: Kuniyuki Iwashima Reviewed-by: Pablo Neira Ayuso Link: https://lore.kernel.org/r/20230622213231.24651-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit 5f789f103671fec3733ebe756e56adf15c90c21d Author: Sabrina Dubroca Date: Thu Jun 22 23:03:34 2023 +0200 selftests: rtnetlink: remove netdevsim device after ipsec offload test On systems where netdevsim is built-in or loaded before the test starts, kci_test_ipsec_offload doesn't remove the netdevsim device it created during the test. Fixes: e05b2d141fef ("netdevsim: move netdev creation/destruction to dev probe") Signed-off-by: Sabrina Dubroca Reviewed-by: Simon Horman Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/e1cb94f4f82f4eca4a444feec4488a1323396357.1687466906.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski commit 3f5f118bb657f94641ea383c7c1b8c09a5d46ea2 Author: Kuniyuki Iwashima Date: Thu Jun 22 11:43:51 2023 -0700 af_unix: Call scm_recv() only after scm_set_cred(). syzkaller hit a WARN_ON_ONCE(!scm->pid) in scm_pidfd_recv(). In unix_stream_read_generic(), if there is no skb in the queue, we could bail out the do-while loop without calling scm_set_cred(): 1. No skb in the queue 2. sk is non-blocking or shutdown(sk, RCV_SHUTDOWN) is called concurrently or peer calls close() If the socket is configured with SO_PASSCRED or SO_PASSPIDFD, scm_recv() would populate cmsg with garbage. Let's not call scm_recv() unless there is skb to receive. WARNING: CPU: 1 PID: 3245 at include/net/scm.h:138 scm_pidfd_recv include/net/scm.h:138 [inline] WARNING: CPU: 1 PID: 3245 at include/net/scm.h:138 scm_recv.constprop.0+0x754/0x850 include/net/scm.h:177 Modules linked in: CPU: 1 PID: 3245 Comm: syz-executor.1 Not tainted 6.4.0-rc5-01219-gfa0e21fa4443 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 RIP: 0010:scm_pidfd_recv include/net/scm.h:138 [inline] RIP: 0010:scm_recv.constprop.0+0x754/0x850 include/net/scm.h:177 Code: 67 fd e9 55 fd ff ff e8 4a 70 67 fd e9 7f fd ff ff e8 40 70 67 fd e9 3e fb ff ff e8 36 70 67 fd e9 02 fd ff ff e8 8c 3a 20 fd <0f> 0b e9 fe fb ff ff e8 50 70 67 fd e9 2e f9 ff ff e8 46 70 67 fd RSP: 0018:ffffc90009af7660 EFLAGS: 00010216 RAX: 00000000000000a1 RBX: ffff888041e58a80 RCX: ffffc90003852000 RDX: 0000000000040000 RSI: ffffffff842675b4 RDI: 0000000000000007 RBP: ffffc90009af7810 R08: 0000000000000007 R09: 0000000000000013 R10: 00000000000000f8 R11: 0000000000000001 R12: ffffc90009af7db0 R13: 0000000000000000 R14: ffff888041e58a88 R15: 1ffff9200135eecc FS: 00007f6b7113f640(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6b7111de38 CR3: 0000000012a6e002 CR4: 0000000000770ee0 PKRU: 55555554 Call Trace: unix_stream_read_generic+0x5fe/0x1f50 net/unix/af_unix.c:2830 unix_stream_recvmsg+0x194/0x1c0 net/unix/af_unix.c:2880 sock_recvmsg_nosec net/socket.c:1019 [inline] sock_recvmsg+0x188/0x1d0 net/socket.c:1040 ____sys_recvmsg+0x210/0x610 net/socket.c:2712 ___sys_recvmsg+0xff/0x190 net/socket.c:2754 do_recvmmsg+0x25d/0x6c0 net/socket.c:2848 __sys_recvmmsg net/socket.c:2927 [inline] __do_sys_recvmmsg net/socket.c:2950 [inline] __se_sys_recvmmsg net/socket.c:2943 [inline] __x64_sys_recvmmsg+0x224/0x290 net/socket.c:2943 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f6b71da2e5d Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 73 9f 1b 00 f7 d8 64 89 01 48 RSP: 002b:00007f6b7113ecc8 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: ffffffffffffffda RBX: 00000000004bc050 RCX: 00007f6b71da2e5d RDX: 0000000000000007 RSI: 0000000020006600 RDI: 000000000000000b RBP: 00000000004bc050 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000120 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f6b71e03530 R15: 0000000000000000 Fixes: 5e2ff6704a27 ("scm: add SO_PASSPIDFD and SCM_PIDFD") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzkaller Signed-off-by: Kuniyuki Iwashima Reviewed-by: Alexander Mikhalitsyn Link: https://lore.kernel.org/r/20230622184351.91544-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit 11b73313c12403f617b47752db0ab3deef201af7 Author: Eric Dumazet Date: Thu Jun 22 18:15:03 2023 +0000 sch_netem: fix issues in netem_change() vs get_dist_table() In blamed commit, I missed that get_dist_table() was allocating memory using GFP_KERNEL, and acquiring qdisc lock to perform the swap of newly allocated table with current one. In this patch, get_dist_table() is allocating memory and copy user data before we acquire the qdisc lock. Then we perform swap operations while being protected by the lock. Note that after this patch netem_change() no longer can do partial changes. If an error is returned, qdisc conf is left unchanged. Fixes: 2174a08db80d ("sch_netem: acquire qdisc lock in netem_change()") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Stephen Hemminger Acked-by: Jamal Hadi Salim Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230622181503.2327695-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 1c78eb8760c46e5dc2c43937196f745075953428 Merge: 6a11af7c21da0 a4aadf0f59056 Author: Jakub Kicinski Date: Sat Jun 24 15:12:05 2023 -0700 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-06-22 (iavf) This series contains updates to iavf driver only. Przemek defers removing, previous, primary MAC address until after getting result of adding its replacement. He also does some cleanup by removing unused functions and making applicable functions static. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: iavf: make functions static where possible iavf: remove some unused functions and pointless wrappers iavf: fix err handling for MAC replace ==================== Link: https://lore.kernel.org/r/20230622165914.2203081-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 6a11af7c21da0fdbba101452ddeec2dbe289b174 Author: Randy Dunlap Date: Thu Jun 22 08:54:09 2023 -0700 revert "s390/net: lcs: use IS_ENABLED() for kconfig detection" The referenced patch is causing build errors when ETHERNET=y and FDDI=m. While we work out the preferred patch(es), revert this patch to make the pain go away. Fixes: 128272336120 ("s390/net: lcs: use IS_ENABLED() for kconfig detection") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Link: lore.kernel.org/r/202306202129.pl0AqK8G-lkp@intel.com Cc: Alexandra Winter Cc: Wenjia Zhang Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230622155409.27311-1-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit 28e219aea0b9ec374de27179c3d45b2d86bfe562 Author: Giulio Benetti Date: Thu Jun 22 20:47:21 2023 +0200 net: phy: broadcom: drop brcm_phy_setbits() and use phy_set_bits() instead Linux provides phy_set_bits() helper so let's drop brcm_phy_setbits() and use phy_set_bits() in its place. Signed-off-by: Giulio Benetti Reviewed-by: Simon Horman Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20230622184721.24368-1-giulio.benetti@benettiengineering.com Signed-off-by: Jakub Kicinski commit eb441289f940c86df47db95044820fa5cf90c21f Merge: 6a940abdef316 c789ad7cbebca Author: Jakub Kicinski Date: Sat Jun 24 15:04:12 2023 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== igc: TX timestamping fixes This is the fixes part of the series intended to add support for using the 4 timestamp registers present in i225/i226. Moving the timestamp handling to be inline with the interrupt handling has the advantage of improving the TX timestamping retrieval latency, here are some numbers using ntpperf: Before: $ sudo ./ntpperf -i enp3s0 -m 10:22:22:22:22:21 -d 192.168.1.3 -s 172.18.0.0/16 -I -H -o -37 | responses | TX timestamp offset (ns) rate clients | lost invalid basic xleave | min mean max stddev 1000 100 0.00% 0.00% 0.00% 100.00% -56 +9 +52 19 1500 150 0.00% 0.00% 0.00% 100.00% -40 +30 +75 22 2250 225 0.00% 0.00% 0.00% 100.00% -11 +29 +72 15 3375 337 0.00% 0.00% 0.00% 100.00% -18 +40 +88 22 5062 506 0.00% 0.00% 0.00% 100.00% -19 +23 +77 15 7593 759 0.00% 0.00% 0.00% 100.00% +7 +47 +5168 43 11389 1138 0.00% 0.00% 0.00% 100.00% -11 +41 +5240 39 17083 1708 0.00% 0.00% 0.00% 100.00% +19 +60 +5288 50 25624 2562 0.00% 0.00% 0.00% 100.00% +1 +56 +5368 58 38436 3843 0.00% 0.00% 0.00% 100.00% -84 +12 +8847 66 57654 5765 0.00% 0.00% 100.00% 0.00% 86481 8648 0.00% 0.00% 100.00% 0.00% 129721 12972 0.00% 0.00% 100.00% 0.00% 194581 16384 0.00% 0.00% 100.00% 0.00% 291871 16384 27.35% 0.00% 72.65% 0.00% 437806 16384 50.05% 0.00% 49.95% 0.00% After: $ sudo ./ntpperf -i enp3s0 -m 10:22:22:22:22:21 -d 192.168.1.3 -s 172.18.0.0/16 -I -H -o -37 | responses | TX timestamp offset (ns) rate clients | lost invalid basic xleave | min mean max stddev 1000 100 0.00% 0.00% 0.00% 100.00% -44 +0 +61 19 1500 150 0.00% 0.00% 0.00% 100.00% -6 +39 +81 16 2250 225 0.00% 0.00% 0.00% 100.00% -22 +25 +69 15 3375 337 0.00% 0.00% 0.00% 100.00% -28 +15 +56 14 5062 506 0.00% 0.00% 0.00% 100.00% +7 +78 +143 27 7593 759 0.00% 0.00% 0.00% 100.00% -54 +24 +144 47 11389 1138 0.00% 0.00% 0.00% 100.00% -90 -33 +28 21 17083 1708 0.00% 0.00% 0.00% 100.00% -50 -2 +35 14 25624 2562 0.00% 0.00% 0.00% 100.00% -62 +7 +66 23 38436 3843 0.00% 0.00% 0.00% 100.00% -33 +30 +5395 36 57654 5765 0.00% 0.00% 100.00% 0.00% 86481 8648 0.00% 0.00% 100.00% 0.00% 129721 12972 0.00% 0.00% 100.00% 0.00% 194581 16384 19.50% 0.00% 80.50% 0.00% 291871 16384 35.81% 0.00% 64.19% 0.00% 437806 16384 55.40% 0.00% 44.60% 0.00% During this series, and to show that as is always the case, things are never easy as they should be, a hardware issue was found, and it took some time to find the workaround(s). The bug and workaround are better explained in patch 4/4. Note: the workaround has a simpler alternative, but it would involve adding support for the other timestamp registers, and only using the TXSTMP{H/L}_0 as a way to clear the interrupt. But I feel bad about throwing this kind of resources away. Didn't test this extensively but it should work. Also, as Marc Kleine-Budde suggested, after some consensus is reached on this series, most parts of it will be proposed for igb. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: igc: Work around HW bug causing missing timestamps igc: Retrieve TX timestamp during interrupt handling igc: Check if hardware TX timestamping is enabled earlier igc: Fix race condition in PTP tx code ==================== Link: https://lore.kernel.org/r/20230622165244.2202786-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit a685d0df75b0357bf0720cafa30c27634063be0a Merge: d1d29a42f7acd fbc5669de62a4 Author: Jakub Kicinski Date: Sat Jun 24 14:52:28 2023 -0700 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2023-06-23 We've added 49 non-merge commits during the last 24 day(s) which contain a total of 70 files changed, 1935 insertions(+), 442 deletions(-). The main changes are: 1) Extend bpf_fib_lookup helper to allow passing the route table ID, from Louis DeLosSantos. 2) Fix regsafe() in verifier to call check_ids() for scalar registers, from Eduard Zingerman. 3) Extend the set of cpumask kfuncs with bpf_cpumask_first_and() and a rework of bpf_cpumask_any*() kfuncs. Additionally, add selftests, from David Vernet. 4) Fix socket lookup BPF helpers for tc/XDP to respect VRF bindings, from Gilad Sever. 5) Change bpf_link_put() to use workqueue unconditionally to fix it under PREEMPT_RT, from Sebastian Andrzej Siewior. 6) Follow-ups to address issues in the bpf_refcount shared ownership implementation, from Dave Marchevsky. 7) A few general refactorings to BPF map and program creation permissions checks which were part of the BPF token series, from Andrii Nakryiko. 8) Various fixes for benchmark framework and add a new benchmark for BPF memory allocator to BPF selftests, from Hou Tao. 9) Documentation improvements around iterators and trusted pointers, from Anton Protopopov. 10) Small cleanup in verifier to improve allocated object check, from Daniel T. Lee. 11) Improve performance of bpf_xdp_pointer() by avoiding access to shared_info when XDP packet does not have frags, from Jesper Dangaard Brouer. 12) Silence a harmless syzbot-reported warning in btf_type_id_size(), from Yonghong Song. 13) Remove duplicate bpfilter_umh_cleanup in favor of umd_cleanup_helper, from Jarkko Sakkinen. 14) Fix BPF selftests build for resolve_btfids under custom HOSTCFLAGS, from Viktor Malik. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (49 commits) bpf, docs: Document existing macros instead of deprecated bpf, docs: BPF Iterator Document selftests/bpf: Fix compilation failure for prog vrf_socket_lookup selftests/bpf: Add vrf_socket_lookup tests bpf: Fix bpf socket lookup from tc/xdp to respect socket VRF bindings bpf: Call __bpf_sk_lookup()/__bpf_skc_lookup() directly via TC hookpoint bpf: Factor out socket lookup functions for the TC hookpoint. selftests/bpf: Set the default value of consumer_cnt as 0 selftests/bpf: Ensure that next_cpu() returns a valid CPU number selftests/bpf: Output the correct error code for pthread APIs selftests/bpf: Use producer_cnt to allocate local counter array xsk: Remove unused inline function xsk_buff_discard() bpf: Keep BPF_PROG_LOAD permission checks clear of validations bpf: Centralize permissions checks for all BPF map types bpf: Inline map creation logic in map_create() function bpf: Move unprivileged checks into map_create() and bpf_prog_load() bpf: Remove in_atomic() from bpf_link_put(). selftests/bpf: Verify that check_ids() is used for scalars in regsafe() bpf: Verify scalar ids mapping in regsafe() using check_ids() selftests/bpf: Check if mark_chain_precision() follows scalar ids ... ==================== Link: https://lore.kernel.org/r/20230623211256.8409-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit f313c51d26aa87e69633c9b46efb37a930faca71 Author: Linus Torvalds Date: Mon Jun 19 11:34:15 2023 -0700 execve: expand new process stack manually ahead of time This is a small step towards a model where GUP itself would not expand the stack, and any user that needs GUP to not look up existing mappings, but actually expand on them, would have to do so manually before-hand, and with the mm lock held for writing. It turns out that execve() already did almost exactly that, except it didn't take the mm lock at all (it's single-threaded so no locking technically needed, but it could cause lockdep errors). And it only did it for the CONFIG_STACK_GROWSUP case, since in that case GUP has obviously never expanded the stack downwards. So just make that CONFIG_STACK_GROWSUP case do the right thing with locking, and enable it generally. This will eventually help GUP, and in the meantime avoids a special case and the lockdep issue. Signed-off-by: Linus Torvalds commit f440fa1ac955e2898893f9301568435eb5cdfc4b Author: Liam R. Howlett Date: Fri Jun 16 15:58:54 2023 -0700 mm: make find_extend_vma() fail if write lock not held Make calls to extend_vma() and find_extend_vma() fail if the write lock is required. To avoid making this a flag-day event, this still allows the old read-locking case for the trivial situations, and passes in a flag to say "is it write-locked". That way write-lockers can say "yes, I'm being careful", and legacy users will continue to work in all the common cases until they have been fully converted to the new world order. Co-Developed-by: Matthew Wilcox (Oracle) Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett Signed-off-by: Linus Torvalds commit 2cd76c50d0b41cec5c87abfcdf25b236a2793fb6 Author: Linus Torvalds Date: Sat Jun 24 11:17:05 2023 -0700 powerpc/mm: convert coprocessor fault to lock_mm_and_find_vma() This is one of the simple cases, except there's no pt_regs pointer. Which is fine, as lock_mm_and_find_vma() is set up to work fine with a NULL pt_regs. Powerpc already enabled LOCK_MM_AND_FIND_VMA for the main CPU faulting, so we can just use the helper without any extra work. Signed-off-by: Linus Torvalds commit a050ba1e7422f2cc60ff8bfde3f96d34d00cb585 Author: Linus Torvalds Date: Sat Jun 24 10:55:38 2023 -0700 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() This does the simple pattern conversion of alpha, arc, csky, hexagon, loongarch, nios2, sh, sparc32, and xtensa to the lock_mm_and_find_vma() helper. They all have the regular fault handling pattern without odd special cases. The remaining architectures all have something that keeps us from a straightforward conversion: ia64 and parisc have stacks that can grow both up as well as down (and ia64 has special address region checks). And m68k, microblaze, openrisc, sparc64, and um end up having extra rules about only expanding the stack down a limited amount below the user space stack pointer. That is something that x86 used to do too (long long ago), and it probably could just be skipped, but it still makes the conversion less than trivial. Note that this conversion was done manually and with the exception of alpha without any build testing, because I have a fairly limited cross- building environment. The cases are all simple, and I went through the changes several times, but... Signed-off-by: Linus Torvalds commit 8b35ca3e45e35a26a21427f35d4093606e93ad0a Author: Ben Hutchings Date: Thu Jun 22 21:24:30 2023 +0200 arm/mm: Convert to using lock_mm_and_find_vma() arm has an additional check for address < FIRST_USER_ADDRESS before expanding the stack. Since FIRST_USER_ADDRESS is defined everywhere (generally as 0), move that check to the generic expand_downwards(). Signed-off-by: Ben Hutchings Signed-off-by: Linus Torvalds commit 7267ef7b0b77f4ed23b7b3c87d8eca7bd9c2d007 Author: Ben Hutchings Date: Thu Jun 22 20:18:18 2023 +0200 riscv/mm: Convert to using lock_mm_and_find_vma() Signed-off-by: Ben Hutchings Signed-off-by: Linus Torvalds commit 4bce37a68ff884e821a02a731897a8119e0c37b7 Author: Ben Hutchings Date: Thu Jun 22 18:47:40 2023 +0200 mips/mm: Convert to using lock_mm_and_find_vma() Signed-off-by: Ben Hutchings Signed-off-by: Linus Torvalds commit e6fe228c4ffafdfc970cf6d46883a1f481baf7ea Author: Michael Ellerman Date: Fri Jun 16 15:51:29 2023 +1000 powerpc/mm: Convert to using lock_mm_and_find_vma() Signed-off-by: Michael Ellerman Signed-off-by: Linus Torvalds commit ae870a68b5d13d67cf4f18d47bb01ee3fee40acb Author: Linus Torvalds Date: Thu Jun 15 17:11:44 2023 -0700 arm64/mm: Convert to using lock_mm_and_find_vma() This converts arm64 to use the new page fault helper. It was very straightforward, but still needed a fix for the "obvious" conversion I initially did. Thanks to Suren for the fix and testing. Fixed-and-tested-by: Suren Baghdasaryan Unnecessary-code-removal-by: Liam R. Howlett Signed-off-by: Linus Torvalds commit eda0047296a16d65a7f2bc60a408f70d178b2014 Author: Linus Torvalds Date: Thu Jun 15 16:17:48 2023 -0700 mm: make the page fault mmap locking killable This is done as a separate patch from introducing the new lock_mm_and_find_vma() helper, because while it's an obvious change, it's not what x86 used to do in this area. We already abort the page fault on fatal signals anyway, so why should we wait for the mmap lock only to then abort later? With the new helper function that returns without the lock held on failure anyway, this is particularly easy and straightforward. Signed-off-by: Linus Torvalds commit c2508ec5a58db67093f4fb8bf89a9a7c53a109e9 Author: Linus Torvalds Date: Thu Jun 15 15:17:36 2023 -0700 mm: introduce new 'lock_mm_and_find_vma()' page fault helper .. and make x86 use it. This basically extracts the existing x86 "find and expand faulting vma" code, but extends it to also take the mmap lock for writing in case we actually do need to expand the vma. We've historically short-circuited that case, and have some rather ugly special logic to serialize the stack segment expansion (since we only hold the mmap lock for reading) that doesn't match the normal VM locking. That slight violation of locking worked well, right up until it didn't: the maple tree code really does want proper locking even for simple extension of an existing vma. So extract the code for "look up the vma of the fault" from x86, fix it up to do the necessary write locking, and make it available as a helper function for other architectures that can use the common helper. Note: I say "common helper", but it really only handles the normal stack-grows-down case. Which is all architectures except for PA-RISC and IA64. So some rare architectures can't use the helper, but if they care they'll just need to open-code this logic. It's also worth pointing out that this code really would like to have an optimistic "mmap_upgrade_trylock()" to make it quicker to go from a read-lock (for the common case) to taking the write lock (for having to extend the vma) in the normal single-threaded situation where there is no other locking activity. But that _is_ all the very uncommon special case, so while it would be nice to have such an operation, it probably doesn't matter in reality. I did put in the skeleton code for such a possible future expansion, even if it only acts as pseudo-documentation for what we're doing. Signed-off-by: Linus Torvalds commit c2d22806aecb24e2de55c30a06e5d6eb297d161d Author: Zhang Shurong Date: Sun Jun 25 00:16:49 2023 +0800 fbdev: fix potential OOB read in fast_imageblit() There is a potential OOB read at fast_imageblit, for "colortab[(*src >> 4)]" can become a negative value due to "const char *s = image->data, *src". This change makes sure the index for colortab always positive or zero. Similar commit: https://patchwork.kernel.org/patch/11746067 Potential bug report: https://groups.google.com/g/syzkaller-bugs/c/9ubBXKeKXf4/m/k-QXy4UgAAAJ Signed-off-by: Zhang Shurong Cc: stable@vger.kernel.org Signed-off-by: Helge Deller commit 0c0206dc4f5ba2d18b15e24d2047487d6f73916b Author: Xinghui Li Date: Thu Apr 20 17:43:31 2023 +0800 PCI: vmd: Fix uninitialized variable usage in vmd_enable_domain() The ret variable in the vmd_enable_domain() function was used uninitialized when printing a warning message upon failure of the pci_reset_bus() function. Thus, fix the issue by assigning ret with the value returned from pci_reset_bus() before referencing it in the warning message. This was detected by Smatch: drivers/pci/controller/vmd.c:931 vmd_enable_domain() error: uninitialized symbol 'ret'. [kwilczynski: drop the second patch from the series, add missing reported by tag, commit log] Fixes: 0a584655ef89 ("PCI: vmd: Fix secondary bus reset for Intel bridges") Link: https://lore.kernel.org/all/202305270219.B96IiIfv-lkp@intel.com Link: https://lore.kernel.org/linux-pci/20230420094332.1507900-2-korantwork@gmail.com Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Xinghui Li Signed-off-by: Krzysztof Wilczyński Reviewed-by: Nirmal Patel commit 741ed0856d5ef94c2dbdbf58cb13d262d89505bb Author: Wilken Gottwalt Date: Sat Jun 24 10:14:07 2023 +0000 hwmon: (corsair-psu) update Series 2022 and 2023 support The series 2022/2023 reports slightly longer vendor/product strings and shares USB ids. Technically the reply size is the USB HID packet size (64 bytes) but all the supported commands do not use more than 8 bytes and replies reporting back strings do not use more then 24 bytes (vendor and product are in one string in the newer devices now). The rest of the reply is always filled with '\0'. Also update comments and documentation accordingly. Signed-off-by: Wilken Gottwalt Link: https://lore.kernel.org/r/ZJbB72CAPmLflhHG@monster.localdomain Signed-off-by: Guenter Roeck commit afbb9130d2bf04888e91bddc4127d7121b9aee3d Author: Uwe Kleine-König Date: Tue Mar 21 20:32:08 2023 +0100 PCI: xgene-msi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-16-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński commit c7fd95cda648a0df45b9748bbbef1a62099f3f32 Author: Uwe Kleine-König Date: Tue Mar 21 20:32:07 2023 +0100 PCI: tegra: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-15-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński commit 2998efcd8e73e5ab0ac82b79a087fc3747cd4d03 Author: Uwe Kleine-König Date: Tue Mar 21 20:32:06 2023 +0100 PCI: rockchip-host: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-14-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński commit 4c3bc1b41b8f9f96a75eacff8582ee811aeda83c Author: Uwe Kleine-König Date: Tue Mar 21 20:32:05 2023 +0100 PCI: mvebu: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-13-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński commit 8c47ac2a66c4a8372ecee4a5f0cc7c03c14de353 Author: Uwe Kleine-König Date: Tue Mar 21 20:32:04 2023 +0100 PCI: mt7621: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-12-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński Reviewed-by: Sergio Paracuellos commit 22626c46bb32a7953995637a3f062b0f0d74cc80 Author: Uwe Kleine-König Date: Tue Mar 21 20:32:03 2023 +0100 PCI: mediatek-gen3: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-11-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński commit 5e0005409427ec7ca988c6315ebf746f8fb24139 Author: Uwe Kleine-König Date: Tue Mar 21 20:32:02 2023 +0100 PCI: mediatek: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-10-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński commit 6f1c0a046048ec647299c5f9a135002393941c99 Author: Uwe Kleine-König Date: Tue Mar 21 20:32:01 2023 +0100 PCI: iproc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. The iproc driver always returns 0, it's just a bit hidden. So make iproc_pcie_remove() return void instead of always zero and convert the platform driver to the alternative remove callback that returns void and eventually replaces the int returning callback. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-9-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński Acked-by: Florian Fainelli commit 9a285fbbb591428de0cde7f553130e7c728a2e19 Author: Uwe Kleine-König Date: Tue Mar 21 20:32:00 2023 +0100 PCI: hisi-error: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-8-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński commit 221879c986980c04923cd6a202a1aafb51e0bc7d Author: Uwe Kleine-König Date: Tue Mar 21 20:31:59 2023 +0100 PCI: dwc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert the dwc drivers from always returning zero in the remove callback to the void returning variant. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20230321193208.366561-7-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński Acked-by: Serge Semin commit c86f4bd6008e7e9bd561e1f1ec3889cc0a5925e8 Author: Uwe Kleine-König Date: Tue Mar 21 20:31:58 2023 +0100 PCI: j721e: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20230321193208.366561-6-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński commit b169c576ad0cd341badb866d0808ae32c7bf8c2c Author: Uwe Kleine-König Date: Tue Mar 21 20:31:57 2023 +0100 PCI: brcmstb: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-5-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński Acked-by: Florian Fainelli commit 60d03f70455c7704cb76737ff947b75391934954 Author: Uwe Kleine-König Date: Tue Mar 21 20:31:56 2023 +0100 PCI: altera-msi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-4-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński commit 3a610560aa4fc8f2afe606d3314aeb20c167ff26 Author: Uwe Kleine-König Date: Tue Mar 21 20:31:55 2023 +0100 PCI: altera: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-3-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński commit b11c76db97e76f2160c0f7d523e788c0327521b7 Author: Uwe Kleine-König Date: Tue Mar 21 20:31:54 2023 +0100 PCI: aardvark: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/20230321193208.366561-2-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Krzysztof Wilczyński commit f7667ca106df50ff8b776db54f85074dc9c52e1b Author: Max Filippov Date: Sun May 7 16:18:17 2023 -0700 xtensa: dump userspace code around the exception PC In the absence of other debug facilities dumping user code around the unhandled exception address may help debugging the issue. Signed-off-by: Max Filippov commit e28e75e9f589324a76bf31e2b2bbdc264549f86b Author: Wolfram Sang Date: Wed Jun 7 22:47:50 2023 +0200 PCI: rcar: Use correct product family name for Renesas R-Car Renesas uses "R-Car" as the name for their product family and development platform. Thus, correct other variants such as "rcar", "RCar", "Rcar", etc., to the preferred spelling. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20230607204750.27837-1-wsa+renesas@sang-engineering.com Signed-off-by: Wolfram Sang Signed-off-by: Krzysztof Wilczyński Reviewed-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven commit e884a133340a470070b2c59833c9ff87aa6517ba Author: Krzysztof Kozlowski Date: Sat Jun 24 10:20:54 2023 +0200 spi: dt-bindings: atmel,at91rm9200-spi: fix broken sam9x7 compatible Commit a3eb95484f27 ("spi: dt-bindings: atmel,at91rm9200-spi: add sam9x7 compatible") adding sam9x7 compatible did not make any sense as it added new compatible into middle of existing compatible list. The intention was probably to add new set of compatibles with sam9x7 as first one. Fixes: a3eb95484f27 ("spi: dt-bindings: atmel,at91rm9200-spi: add sam9x7 compatible") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/Message-Id: <20230624082054.37697-1-krzysztof.kozlowski@linaro.org> Signed-off-by: Mark Brown commit 1fffe7a34c89b12b58f88b280bc10ce034477c3a Author: Vincenzo Palazzo Date: Fri Jun 16 01:40:37 2023 +0200 script: modpost: emit a warning when the description is missing Emit a warning when the mod description is missed and only when the W=1 is enabled. Reported-by: Roland Kletzing Link: https://bugzilla.kernel.org/show_bug.cgi?id=10770 Signed-off-by: Vincenzo Palazzo Tested-by: Nicolas Schier Signed-off-by: Masahiro Yamada commit 8ae071fc216a25f4f797f33c56857f4dd6b4408e Author: Masahiro Yamada Date: Thu Jun 15 20:17:43 2023 +0900 kbuild: make modules_install copy modules.builtin(.modinfo) Josh Triplett reports that initramfs-tools needs modules.builtin and modules.builtin.modinfo to create a working initramfs for a non-modular kernel. If this is a general tooling issue not limited to Debian, I think it makes sense to change modules_install. This commit changes the targets as follows when CONFIG_MODULES=n. In-tree builds: make modules -> no-op make modules_install -> install modules.builtin(.modinfo) External module builds: make modules -> show error message like before make modules_install -> show error message like before Link: https://lore.kernel.org/lkml/36a4014c73a52af27d930d3ca31d362b60f4461c.1686356364.git.josh@joshtriplett.org/ Reported-by: Josh Triplett Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nicolas Schier Reviewed-by: Josh Triplett Tested-by: Josh Triplett commit 29c171de52bcef23a7593a890cbcb6761be0123c Author: Lukas Bulwahn Date: Fri Jun 23 06:07:36 2023 +0200 MAINTAINERS: adjust entry in VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER Commit d4313a68ec91 ("fbdev/media: Use GPIO descriptors for VIA GPIO") moves via-gpio.h from include/linux to drivers/video/fbdev/via, but misses to adjust the file entry for the VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER section. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Remove the file entry in VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER, as the new location of the header is already covered by the file entry drivers/video/fbdev/via/. Signed-off-by: Lukas Bulwahn Fixes: d4313a68ec91 ("fbdev/media: Use GPIO descriptors for VIA GPIO") Signed-off-by: Helge Deller commit 929ff679b694f0f9656aec38b3a7d5c440c5ca24 Author: Yang Jihong Date: Fri Jun 23 05:44:16 2023 +0000 perf tools: Add printing perf_event_attr config symbol in perf_event_attr__fprintf() When printing perf_event_attr, always display perf_event_attr config and its symbol to improve the readability of debugging information. Before: # perf --debug verbose=2 record -e cycles,cpu-clock,sched:sched_switch,branch-load-misses,r101,mem:0x0 -C 0 true ------------------------------------------------------------ perf_event_attr: size 136 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 5 ------------------------------------------------------------ perf_event_attr: type 1 size 136 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 6 ------------------------------------------------------------ perf_event_attr: type 2 size 136 config 0x143 { sample_period, sample_freq } 1 sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER read_format ID disabled 1 inherit 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 7 ------------------------------------------------------------ perf_event_attr: type 3 size 136 config 0x10005 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 9 ------------------------------------------------------------ perf_event_attr: type 4 size 136 config 0x101 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 10 ------------------------------------------------------------ perf_event_attr: type 5 size 136 { sample_period, sample_freq } 1 sample_type IP|TID|TIME|CPU|IDENTIFIER read_format ID disabled 1 inherit 1 sample_id_all 1 exclude_guest 1 bp_type 3 { bp_len, config2 } 0x4 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 11 After: # perf --debug verbose=2 record -e cycles,cpu-clock,sched:sched_switch,branch-load-misses,r101,mem:0x0 -C 0 true ------------------------------------------------------------ perf_event_attr: type 0 (PERF_TYPE_HARDWARE) size 136 config 0 (PERF_COUNT_HW_CPU_CYCLES) { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 5 ------------------------------------------------------------ perf_event_attr: type 1 (PERF_TYPE_SOFTWARE) size 136 config 0 (PERF_COUNT_SW_CPU_CLOCK) { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 6 ------------------------------------------------------------ perf_event_attr: type 2 (PERF_TYPE_TRACEPOINT) size 136 config 0x143 (sched:sched_switch) { sample_period, sample_freq } 1 sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER read_format ID disabled 1 inherit 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 7 ------------------------------------------------------------ perf_event_attr: type 3 (PERF_TYPE_HW_CACHE) size 136 config 0x10005 (PERF_COUNT_HW_CACHE_RESULT_MISS | PERF_COUNT_HW_CACHE_OP_READ | PERF_COUNT_HW_CACHE_BPU) { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 9 ------------------------------------------------------------ perf_event_attr: type 4 (PERF_TYPE_RAW) size 136 config 0x101 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 10 ------------------------------------------------------------ perf_event_attr: type 5 (PERF_TYPE_BREAKPOINT) size 136 config 0 { sample_period, sample_freq } 1 sample_type IP|TID|TIME|CPU|IDENTIFIER read_format ID disabled 1 inherit 1 sample_id_all 1 exclude_guest 1 bp_type 3 { bp_len, config2 } 0x4 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 11 ------------------------------------------------------------ perf_event_attr: type 1 (PERF_TYPE_SOFTWARE) size 136 config 0x9 (PERF_COUNT_SW_DUMMY) { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID inherit 1 mmap 1 comm 1 freq 1 task 1 sample_id_all 1 mmap2 1 comm_exec 1 ksymbol 1 bpf_event 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 12 Signed-off-by: Yang Jihong Acked-by: Adrian Hunter Cc: anshuman.khandual@arm.com Cc: mark.rutland@arm.com Cc: irogers@google.com Cc: jesussanp@google.com Cc: peterz@infradead.org Cc: acme@kernel.org Cc: jolsa@kernel.org Cc: alexander.shishkin@linux.intel.com Cc: mingo@redhat.com Link: https://lore.kernel.org/r/20230623054416.160858-5-yangjihong1@huawei.com [ fix perf import test by adding a dummy tracepoint_id__to_name() ] Signed-off-by: Namhyung Kim commit 2e4dd65d7d0c73451e2f8b575884b35c90ba058a Author: Yang Jihong Date: Fri Jun 23 05:44:15 2023 +0000 perf tools: Add printing perf_event_attr type symbol in perf_event_attr__fprintf() When printing perf_event_attr, always display perf_event_attr type and its symbol to improve the readability of debugging information. Before: # perf --debug verbose=2 record -e cycles,cpu-clock,sched:sched_switch,branch-load-misses,r101,mem:0x0 -C 0 true ------------------------------------------------------------ perf_event_attr: size 136 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 5 ------------------------------------------------------------ perf_event_attr: type 1 size 136 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 6 ------------------------------------------------------------ perf_event_attr: type 2 size 136 config 0x143 { sample_period, sample_freq } 1 sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER read_format ID disabled 1 inherit 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 7 ------------------------------------------------------------ perf_event_attr: type 3 size 136 config 0x10005 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 9 ------------------------------------------------------------ perf_event_attr: type 4 size 136 config 0x101 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 10 ------------------------------------------------------------ perf_event_attr: type 5 size 136 { sample_period, sample_freq } 1 sample_type IP|TID|TIME|CPU|IDENTIFIER read_format ID disabled 1 inherit 1 sample_id_all 1 exclude_guest 1 bp_type 3 { bp_len, config2 } 0x4 ------------------------------------------------------------ After: # perf --debug verbose=2 record -e cycles,cpu-clock,sched:sched_switch,branch-load-misses,r101,mem:0x0 -C 0 true ------------------------------------------------------------ perf_event_attr: type 0 (PERF_TYPE_HARDWARE) size 136 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 5 ------------------------------------------------------------ perf_event_attr: type 1 (PERF_TYPE_SOFTWARE) size 136 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 6 ------------------------------------------------------------ perf_event_attr: type 2 (PERF_TYPE_TRACEPOINT) size 136 config 0x143 { sample_period, sample_freq } 1 sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER read_format ID disabled 1 inherit 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 7 ------------------------------------------------------------ perf_event_attr: type 3 (PERF_TYPE_HW_CACHE) size 136 config 0x10005 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 9 ------------------------------------------------------------ perf_event_attr: type 4 (PERF_TYPE_RAW) size 136 config 0x101 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 10 ------------------------------------------------------------ perf_event_attr: type 5 (PERF_TYPE_BREAKPOINT) size 136 { sample_period, sample_freq } 1 sample_type IP|TID|TIME|CPU|IDENTIFIER read_format ID disabled 1 inherit 1 sample_id_all 1 exclude_guest 1 bp_type 3 { bp_len, config2 } 0x4 ------------------------------------------------------------ Signed-off-by: Yang Jihong Acked-by: Adrian Hunter Cc: anshuman.khandual@arm.com Cc: mark.rutland@arm.com Cc: irogers@google.com Cc: jesussanp@google.com Cc: peterz@infradead.org Cc: acme@kernel.org Cc: jolsa@kernel.org Cc: alexander.shishkin@linux.intel.com Cc: mingo@redhat.com Link: https://lore.kernel.org/r/20230623054416.160858-4-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit 5492e72500646170cd409b14fe273e6d067b9fae Author: Yang Jihong Date: Fri Jun 23 05:44:14 2023 +0000 perf tools: Extend PRINT_ATTRf to support printing of members with a value of 0 When printing attr, members whose value is 0 will not be printed, we want to print the case where attr->type is 0(PERF_TYPE_HARDWARE), add `_a` param to PRINT_ATTRf macro to always print member when it is true No functional change. Signed-off-by: Yang Jihong Acked-by: Adrian Hunter Cc: anshuman.khandual@arm.com Cc: mark.rutland@arm.com Cc: irogers@google.com Cc: jesussanp@google.com Cc: peterz@infradead.org Cc: acme@kernel.org Cc: jolsa@kernel.org Cc: alexander.shishkin@linux.intel.com Cc: mingo@redhat.com Link: https://lore.kernel.org/r/20230623054416.160858-3-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit 220f88b5a11a88539fbc44d2740c41bf995ecb45 Author: Yang Jihong Date: Fri Jun 23 05:44:13 2023 +0000 perf trace-event-info: Add tracepoint_id_to_name() helper Add tracepoint_id_to_name() helper to search for the trace events directory by given event id and return the corresponding tracepoint. Signed-off-by: Yang Jihong Acked-by: Adrian Hunter Cc: anshuman.khandual@arm.com Cc: mark.rutland@arm.com Cc: irogers@google.com Cc: jesussanp@google.com Cc: peterz@infradead.org Cc: acme@kernel.org Cc: jolsa@kernel.org Cc: alexander.shishkin@linux.intel.com Cc: mingo@redhat.com Link: https://lore.kernel.org/r/20230623054416.160858-2-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit 3ff256751a2853e1ffaa36958ff933ccc98c6cb5 Author: Zhang Shurong Date: Fri Jun 23 13:39:35 2023 +0800 firewire: net: fix use after free in fwnet_finish_incoming_packet() The netif_rx() function frees the skb so we can't dereference it to save the skb->len. Signed-off-by: Zhang Shurong Link: https://lore.kernel.org/r/tencent_3B3D24B66ED66A6BB73CC0E63C6A14E45109@qq.com Signed-off-by: Takashi Sakamoto commit d82257d7f604ba6e714c9f1087a6dc599ccb1879 Author: Ian Rogers Date: Thu Jun 22 22:45:20 2023 -0700 perf symbol: Remove now unused symbol_conf.sort_by_name Previously used to specify symbol_name_rb_node was in use. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Carsten Haitzler Cc: Mark Rutland Cc: Jason Wang Cc: Changbin Du Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: Kan Liang Cc: Athira Rajeev Cc: Ingo Molnar Cc: Christophe JAILLET Link: https://lore.kernel.org/r/20230623054520.4118442-4-irogers@google.com Signed-off-by: Namhyung Kim commit 259dce914e93482a0e25a6ddef88f5b6d85df9bd Author: Ian Rogers Date: Thu Jun 22 22:45:19 2023 -0700 perf symbol: Remove symbol_name_rb_node Most perf commands want to sort symbols by name and this is done via an invasive rbtree that on 64-bit systems costs 24 bytes. Sorting the symbols in a DSO by name is optional and not done by default, however, if sorting is requested the 24 bytes is allocated for every symbol. This change removes the rbtree and uses a sorted array of symbol pointers instead (costing 8 bytes per symbol). As the array is created on demand then there are further memory savings. The complexity of sorting the array and using the rbtree are the same. To support going to the next symbol, the index of the current symbol needs to be passed around as a pair with the current symbol. This requires some API changes. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Carsten Haitzler Cc: Mark Rutland Cc: Jason Wang Cc: Changbin Du Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: Kan Liang Cc: Athira Rajeev Cc: Ingo Molnar Cc: Christophe JAILLET Link: https://lore.kernel.org/r/20230623054520.4118442-3-irogers@google.com [ minimize change in symbols__sort_by_name() ] Signed-off-by: Namhyung Kim commit ce5b293405fda0f80c803b6c838f51ec7f618f90 Author: Ian Rogers Date: Thu Jun 22 22:45:18 2023 -0700 perf dso: Sort symbols under lock Determine if symbols are sorted, set the sorted flag and sort under the dso lock. Done in the interest of thread safety. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Carsten Haitzler Cc: Mark Rutland Cc: Jason Wang Cc: Changbin Du Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: Kan Liang Cc: Athira Rajeev Cc: Ingo Molnar Cc: Christophe JAILLET Link: https://lore.kernel.org/r/20230623054520.4118442-2-irogers@google.com [ handle the similar code in util/probe-event.c ] Signed-off-by: Namhyung Kim commit ae7eb5baad3fd5f9ff69a3721fdaa0324731cf8d Author: Ian Rogers Date: Thu Jun 22 21:14:05 2023 -0700 perf build: Filter out BTF sources without a .BTF section If generating vmlinux.h, make the code to generate it more tolerant by filtering out paths to kernels that lack a .BTF section. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Acked-by: Jiri Olsa Cc: James Clark Cc: Mark Rutland Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Tiezhu Yang Cc: Ingo Molnar Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230623041405.4039475-5-irogers@google.com Signed-off-by: Namhyung Kim commit 06c39e742d46eb0a360563f0888ac8c3a9539f47 Author: Ian Rogers Date: Thu Jun 22 21:14:04 2023 -0700 perf test: Add build tests for BUILD_BPF_SKEL Add tests with and without generating vmlinux.h. Signed-off-by: Ian Rogers Acked-by: Andrii Nakryiko Acked-by: Namhyung Kim Acked-by: Jiri Olsa Cc: James Clark Cc: Mark Rutland Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Tiezhu Yang Cc: Ingo Molnar Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230623041405.4039475-4-irogers@google.com Signed-off-by: Namhyung Kim commit 5c45b210479bffe068d38902fcdcb52c4c60a264 Author: Ian Rogers Date: Thu Jun 22 21:14:03 2023 -0700 perf bpf: Move the declaration of struct rq struct rq is defined in vmlinux.h when the vmlinux.h is generated, this causes a redefinition failure if it is declared in lock_contention.bpf.c. Move the definition to vmlinux.h for consistency with the generated version. Fixes: 760ebc45746b ("perf lock contention: Add empty 'struct rq' to satisfy libbpf 'runqueue' type verification") Signed-off-by: Ian Rogers Acked-by: Andrii Nakryiko Acked-by: Namhyung Kim Acked-by: Jiri Olsa Cc: James Clark Cc: Mark Rutland Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Tiezhu Yang Cc: Ingo Molnar Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230623041405.4039475-3-irogers@google.com Signed-off-by: Namhyung Kim commit 4d60e83dfcee794213878155463d8f7353a80864 Author: Namhyung Kim Date: Fri Jun 23 16:01:39 2023 -0700 perf test: Skip metrics w/o event name in stat STD output linter This test checks if the output of perf stat to match event names and metrics. So it wants the output lines to have both event name and metric. Otherwise it should skip the line. On AMD machines, the instruction event has two metrics and they are printed in separate lines. It makes the line without event name like below: # perf stat -a sleep 1 Performance counter stats for 'system wide': 64,383.34 msec cpu-clock # 64.048 CPUs utilized 14,526 context-switches # 225.617 /sec 112 cpu-migrations # 1.740 /sec 190 page-faults # 2.951 /sec 807,558,652 cycles # 0.013 GHz (83.30%) 69,809,799 stalled-cycles-frontend # 8.64% frontend cycles idle (83.30%) 196,983,266 stalled-cycles-backend # 24.39% backend cycles idle (83.30%) 424,876,008 instructions # 0.53 insn per cycle (here) ---> # 0.46 stalled cycles per insn (83.30%) 97,788,321 branches # 1.519 M/sec (83.34%) 4,147,377 branch-misses # 4.24% of all branches (83.46%) 1.005241409 seconds time elapsed Also modern Intel machines have TopDown metrics which also don't have event names. # perf stat -a sleep 1 Performance counter stats for 'system wide': 8,015.39 msec cpu-clock # 7.996 CPUs utilized 5,823 context-switches # 726.477 /sec 189 cpu-migrations # 23.580 /sec 139 page-faults # 17.342 /sec 435,139,308 cycles # 0.054 GHz 193,891,345 instructions # 0.45 insn per cycle 42,773,028 branches # 5.336 M/sec 2,298,113 branch-misses # 5.37% of all branches TopdownL1 # 25.5 % tma_backend_bound /--> # 7.9 % tma_bad_speculation (here) --+ # 55.7 % tma_frontend_bound \--> # 10.9 % tma_retiring 1.002395924 seconds time elapsed There is a check to skip TopdownL1 and TopdownL2 specifically but it does not cover every affected lines. So there is another check to skip the line if it has nothing on the left side of # sign. Well.. it seems ok but that's not enough too. When aggregation mode (like --per-socket or --per-thread) is used, it adds some prefix (e.g. CPU socket, task name and PID) in the output line. So the test code ignores them to normalize result. A problem can happen for per-thread mode when task name contains one or more spaces. It'd only ignore the first part of the task name, and it thinks there's something more in the line so it would not skip. # perf stat -a --perf-thread sleep 1 ... perf-21276 # 70.2 % tma_backend_bound perf-21276 # 3.9 % tma_bad_speculation perf-21276 # 10.5 % tma_frontend_bound perf-21276 # 15.3 % tma_retiring ^^^^^^^^^^ (ignored) my task-21328 # 70.2 % tma_backend_bound my task-21328 # 3.9 % tma_bad_speculation my task-21328 # 10.5 % tma_frontend_bound my task-21328 # 15.3 % tma_retiring ^^ (ignored) So I think it should look at the metric names instead. Add skip_metric to hold the list of names to skip. It would contain 'stalled cycles per insn' and metrics started by 'tma_'. Fixes: 99a04a48f225 ("perf test: Add test case for the standard 'perf stat' output") Acked-by: Ian Rogers Cc: Kan Liang Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623230139.985594-2-namhyung@kernel.org Signed-off-by: Namhyung Kim commit b7a2d774c9c5a9a3228c6169ecf32f05b96609cf Author: Ian Rogers Date: Thu Jun 22 21:14:02 2023 -0700 perf build: Add ability to build with a generated vmlinux.h Commit a887466562b4 ("perf bpf skels: Stop using vmlinux.h generated from BTF, use subset of used structs + CO-RE") made it so that vmlinux.h was uncondtionally included from tools/perf/util/vmlinux.h. This change reverts part of that change (so that vmlinux.h is once again generated) and makes it so that the vmlinux.h used at build time is selected from the VMLINUX_H variable. By default the VMLINUX_H variable is set to the vmlinux.h added in change a887466562b4, but if GEN_VMLINUX_H=1 is passed on the build command line then the previous generation behavior kicks in. The build with GEN_VMLINUX_H=1 currently fails with: util/bpf_skel/lock_contention.bpf.c:419:8: error: redefinition of 'rq' struct rq {}; ^ /tmp/perf/util/bpf_skel/.tmp/../vmlinux.h:45630:8: note: previous definition is here struct rq { ^ 1 error generated. Signed-off-by: Ian Rogers Acked-by: Andrii Nakryiko Acked-by: Namhyung Kim Acked-by: Jiri Olsa Cc: James Clark Cc: Mark Rutland Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Tiezhu Yang Cc: Ingo Molnar Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230623041405.4039475-2-irogers@google.com [ Format the error message and add a comment for GEN_VMLINUX_H ] Signed-off-by: Namhyung Kim commit 8d3df7c39b10d4ff24a605f7b80bb6fefb990798 Author: Namhyung Kim Date: Fri Jun 23 16:01:38 2023 -0700 perf test: Reorder event name checks in stat STD output linter On AMD machines, the perf stat STD output test failed like below: $ sudo ./perf test -v 98 98: perf stat STD output linter : --- start --- test child forked, pid 1841901 Checking STD output: no argswrong event metric. expected 'GHz' in 108,121 stalled-cycles-frontend # 10.88% frontend cycles idle test child finished with -1 ---- end ---- perf stat STD output linter: FAILED! This is because there are stalled-cycles-{frontend,backend} events are used by default. The current logic checks the event_name array to find which event it's running. But 'cycles' event comes before those stalled cycles event and it matches first. So it tries to find 'GHz' metric in the output (which is for the 'cycles') and fails. Move the stalled-cycles-{frontend,backend} events before 'cycles' so that it can find the stalled cycles events first. Also add a space after 'no args' test name for consistency. Fixes: 99a04a48f225 ("perf test: Add test case for the standard 'perf stat' output") Acked-by: Ian Rogers Cc: Kan Liang Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623230139.985594-1-namhyung@kernel.org Signed-off-by: Namhyung Kim commit d1d29a42f7acde2fe618cf66b6bfbe047dc51b6b Merge: faaa5fd30344f 9464a3d68ea99 Author: Jakub Kicinski Date: Fri Jun 23 18:59:16 2023 -0700 Merge branch 'mlxsw-maintain-candidate-rifs' Petr Machata says: ==================== mlxsw: Maintain candidate RIFs The mlxsw driver currently makes the assumption that the user applies configuration in a bottom-up manner. Thus netdevices need to be added to the bridge before IP addresses are configured on that bridge or SVI added on top of it. Enslaving a netdevice to another netdevice that already has uppers is in fact forbidden by mlxsw for this reason. Despite this safety, it is rather easy to get into situations where the offloaded configuration is just plain wrong. As an example, take a front panel port, configure an IP address: it gets a RIF. Now enslave the port to the bridge, and the RIF is gone. Remove the port from the bridge again, but the RIF never comes back. There is a number of similar situations, where changing the configuration there and back utterly breaks the offload. The situation is going to be made better by implementing a range of replays and post-hoc offloads. This patch set lays the ground for replay of next hops. The particular issue that it deals with is that currently, driver-specific bookkeeping for next hops is hooked off RIF objects, which come and go across the lifetime of a netdevice. We would rather keep these objects at an entity that mirrors the lifetime of the netdevice itself. That way they are at hand and can be offloaded when a RIF is eventually created. To that end, with this patchset, mlxsw keeps a hash table of CRIFs: candidate RIFs, persistent handles for netdevices that mlxsw deems potentially interesting. The lifetime of a CRIF matches that of the underlying netdevice, and thus a RIF can always assume a CRIF exists. A CRIF is where next hops are kept, and when RIF is created, these next hops can be easily offloaded. (Previously only the next hops created after the RIF was created were offloaded.) - Patches #1 and #2 are minor adjustments. - In patches #3 and #4, add CRIF bookkeeping. - In patch #5, link CRIFs to RIFs such that given a netdevice-backed RIF, the corresponding CRIF is easy to look up. - Patch #6 is a clean-up allowed by the previous patches - Patches #7 and #8 move next hop tracking to CRIFs No observable effects are intended as of yet. This will be useful once there is support for RIF creation for netdevices that become mlxsw uppers, which will come in following patch sets. ==================== Link: https://lore.kernel.org/r/cover.1687438411.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 9464a3d68ea99ccac7e3518e1dfd366ac80bbc90 Author: Petr Machata Date: Thu Jun 22 15:33:09 2023 +0200 mlxsw: spectrum_router: Track next hops at CRIFs Move the list of next hops from struct mlxsw_sp_rif to mlxsw_sp_crif. The reason is that eventually, next hops for mlxsw uppers should be offloaded and unoffloaded on demand as a netdevice becomes an upper, or stops being one. Currently, next hops are tracked at RIFs, but RIFs do not exist when a netdevice is not an mlxsw uppers. CRIFs are kept track of throughout the netdevice lifetime. Correspondingly, track at each next hop not its RIF, but its CRIF (from which a RIF can always be deduced). Note that now that next hops are tracked at a CRIF, it is not necessary to move each over to a new RIF when it is necessary to edit a RIF. Therefore drop mlxsw_sp_nexthop_rif_migrate() and have mlxsw_sp_rif_migrate_destroy() call mlxsw_sp_nexthop_rif_update() directly. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Link: https://lore.kernel.org/r/e7c1c0a7dd13883b0f09aeda12c4fcf4d63a70e3.1687438411.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit a285d664236eb0655eea0ceb97095ad4b07fcbae Author: Petr Machata Date: Thu Jun 22 15:33:08 2023 +0200 mlxsw: spectrum_router: Split nexthop finalization to two stages Nexthop finalization consists of two steps: the part where the offload is removed, because the backing RIF is now gone; and the part where the association to the RIF is severed. Extract from mlxsw_sp_nexthop_type_fini() a helper that covers the unoffloading part, mlxsw_sp_nexthop_type_rif_gone(), so that it can later be called independently. Note that this swaps around the ordering of mlxsw_sp_nexthop_ipip_fini() vs. mlxsw_sp_nexthop_rif_fini(). The current ordering is more of a historical happenstance than a conscious decision. The two cleanups do not depend on each other, and this change should have no observable effects. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Link: https://lore.kernel.org/r/7134559534c5f5c4807c3a1569fae56f8887e763.1687438411.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit bdc0b78e79a641fbbb928a9e5da56dbdd42ff674 Author: Petr Machata Date: Thu Jun 22 15:33:07 2023 +0200 mlxsw: spectrum_router: Use router.lb_crif instead of .lb_rif_index A previous patch added a pointer to loopback CRIF to the router data structure. That makes the loopback RIF index redundant, as everything necessary can be derived from the CRIF. Drop the field and adjust the code accordingly. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Link: https://lore.kernel.org/r/8637bf959bc5b6c9d5184b9bd8a0cd53c5132835.1687438411.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit aa21242b07a8cde689bb6aedcbc224eda9646d9f Author: Petr Machata Date: Thu Jun 22 15:33:06 2023 +0200 mlxsw: spectrum_router: Link CRIFs to RIFs When a RIF is about to be created, the registration of the netdevice that it should be associated with must have been seen in the past, and a CRIF created. Therefore make this a hard requirement by looking up the CRIF during RIF creation, and complaining loudly when there isn't one. This then allows to keep a link between a RIF and its corresponding CRIF (and back, as the relationship is one-to-at-most-one), which do. The CRIF will later be useful as the objects tracked there will be offloaded lazily as a result of RIF creation. CRIFs are created when an "interesting" netdevice is registered, and destroyed after such device is unregistered. CRIFs are supposed to already exist when a RIF creation request arises, and exist at least as long as that RIF exists. This makes for a simple invariant: it is always safe to dereference CRIF pointer from "its" RIF. To guarantee this, CRIFs cannot be removed immediately when the UNREGISTER event is delivered. The reason is that if a RIF's netdevices has an IPv6 address, removal of this address is notified in an atomic block. To remove the RIF, the IPv6 removal handler schedules a work item. It must be safe for this work item to access the associated CRIF as well. Thus when a netdevice that backs the CRIF is removed, if it still has a RIF, do not actually free the CRIF, only toggle its can_destroy flag, which this patch adds. Later on, mlxsw_sp_rif_destroy() collects the CRIF. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Link: https://lore.kernel.org/r/68c8e33afa6b8c03c431b435e1685ffdff752e63.1687438411.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 78126cfd5dc97da7baf66415374452e3f8805faf Author: Petr Machata Date: Thu Jun 22 15:33:05 2023 +0200 mlxsw: spectrum_router: Maintain CRIF for fallback loopback RIF CRIFs are generally not maintained for loopback RIFs. However, the RIF for the default VRF is used for offloading of blackhole nexthops. Nexthops expect to have a valid CRIF. Therefore in this patch, add code to maintain CRIF for the loopback RIF as well. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Link: https://lore.kernel.org/r/7f2b2fcc98770167ed1254a904c3f7f585ba43f0.1687438411.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 4796c287b70a0f60fbc6a5df2ab33d92e8971732 Author: Petr Machata Date: Thu Jun 22 15:33:04 2023 +0200 mlxsw: spectrum_router: Maintain a hash table of CRIFs CRIFs are objects that mlxsw maintains for netdevices that may not have an associated RIF (i.e. they may not have been instantiated in the ASIC), but if indeed they do not, it is quite possible they will in the future. These netdevices are candidate RIFs, hence CRIFs. Netdevices for which CRIFs are created include e.g. bridges, LAGs, or front panel ports. The idea is that next hops would be kept at CRIFs, not RIFs, and thus it would be easier to offload and unoffload the entities that have been added before the RIF was created. In this patch, add the code for low-level CRIF maintenance: create and destroy, and keep in a table keyed by the netdevice pointer for easy recall. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Link: https://lore.kernel.org/r/186d44e399c475159da20689f2c540719f2d1ed0.1687438411.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit f3c85eed1ac364ae2cb2729959c6150813cc9c20 Author: Petr Machata Date: Thu Jun 22 15:33:03 2023 +0200 mlxsw: spectrum_router: Use mlxsw_sp_ul_rif_get() to get main VRF LB RIF The current function, mlxsw_sp_router_ul_rif_get(), is a wrapper around the function mentioned in the subject. As such it forms an external interface of the router code. In future patches we will want to maintain connection between RIFs and the CRIFs (introduced in the next patch) that back them. That will not hold for the VRF-based loopback netdevices, so the whole CRIF business can be kept hidden from the rest of mlxsw. But for the main VRF loopback RIF we do want to keep the RIF-CRIF connection, because that RIF is used for blackhole next hops, and the next hop code can be kept simpler for assuming rif->crif is valid. Hence, instead, call mlxsw_sp_ul_rif_get() to create the main VRF loopback RIF. This being an internal function will take the CRIF argument anyway. Furthermore, the function does not lock, which is not necessary at this point in code yet. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Link: https://lore.kernel.org/r/7a39a011a02a84164cd7f5da7985ec5b2ae01ba5.1687438411.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit ebbd17ce297a3f367ca20058272063eaeeced63a Author: Petr Machata Date: Thu Jun 22 15:33:02 2023 +0200 mlxsw: spectrum_router: Add extack argument to mlxsw_sp_lb_rif_init() The extack will be handy in later patches. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Link: https://lore.kernel.org/r/e87ba300121010d580b80a281877573a7b1377ca.1687438411.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 6a940abdef3162e5723f1495b8a49859d1708f79 Author: Eric Dumazet Date: Thu Jun 22 15:23:04 2023 +0000 bonding: do not assume skb mac_header is set Drivers must not assume in their ndo_start_xmit() that skbs have their mac_header set. skb->data is all what is needed. bonding seems to be one of the last offender as caught by syzbot: WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 skb_mac_offset include/linux/skbuff.h:2913 [inline] WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 bond_xmit_hash drivers/net/bonding/bond_main.c:4170 [inline] WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 bond_xmit_3ad_xor_slave_get drivers/net/bonding/bond_main.c:5149 [inline] WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 bond_3ad_xor_xmit drivers/net/bonding/bond_main.c:5186 [inline] WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 __bond_start_xmit drivers/net/bonding/bond_main.c:5442 [inline] WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 bond_start_xmit+0x14ab/0x19d0 drivers/net/bonding/bond_main.c:5470 Modules linked in: CPU: 1 PID: 12155 Comm: syz-executor.3 Not tainted 6.1.30-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 RIP: 0010:skb_mac_header include/linux/skbuff.h:2907 [inline] RIP: 0010:skb_mac_offset include/linux/skbuff.h:2913 [inline] RIP: 0010:bond_xmit_hash drivers/net/bonding/bond_main.c:4170 [inline] RIP: 0010:bond_xmit_3ad_xor_slave_get drivers/net/bonding/bond_main.c:5149 [inline] RIP: 0010:bond_3ad_xor_xmit drivers/net/bonding/bond_main.c:5186 [inline] RIP: 0010:__bond_start_xmit drivers/net/bonding/bond_main.c:5442 [inline] RIP: 0010:bond_start_xmit+0x14ab/0x19d0 drivers/net/bonding/bond_main.c:5470 Code: 8b 7c 24 30 e8 76 dd 1a 01 48 85 c0 74 0d 48 89 c3 e8 29 67 2e fe e9 15 ef ff ff e8 1f 67 2e fe e9 10 ef ff ff e8 15 67 2e fe <0f> 0b e9 45 f8 ff ff e8 09 67 2e fe e9 dc fa ff ff e8 ff 66 2e fe RSP: 0018:ffffc90002fff6e0 EFLAGS: 00010283 RAX: ffffffff835874db RBX: 000000000000ffff RCX: 0000000000040000 RDX: ffffc90004dcf000 RSI: 00000000000000b5 RDI: 00000000000000b6 RBP: ffffc90002fff8b8 R08: ffffffff83586d16 R09: ffffffff83586584 R10: 0000000000000007 R11: ffff8881599fc780 R12: ffff88811b6a7b7e R13: 1ffff110236d4f6f R14: ffff88811b6a7ac0 R15: 1ffff110236d4f76 FS: 00007f2e9eb47700(0000) GS:ffff8881f6b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2e421000 CR3: 000000010e6d4000 CR4: 00000000003526e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: [] netdev_start_xmit include/linux/netdevice.h:4925 [inline] [] __dev_direct_xmit+0x4ef/0x850 net/core/dev.c:4380 [] dev_direct_xmit include/linux/netdevice.h:3043 [inline] [] packet_direct_xmit+0x18b/0x300 net/packet/af_packet.c:284 [] packet_snd net/packet/af_packet.c:3112 [inline] [] packet_sendmsg+0x4a22/0x64d0 net/packet/af_packet.c:3143 [] sock_sendmsg_nosec net/socket.c:716 [inline] [] sock_sendmsg net/socket.c:736 [inline] [] __sys_sendto+0x472/0x5f0 net/socket.c:2139 [] __do_sys_sendto net/socket.c:2151 [inline] [] __se_sys_sendto net/socket.c:2147 [inline] [] __x64_sys_sendto+0xe5/0x100 net/socket.c:2147 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x2f/0x50 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 7b8fc0103bb5 ("bonding: add a vlan+srcmac tx hashing option") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Jarod Wilson Cc: Moshe Tal Cc: Jussi Maki Cc: Jay Vosburgh Cc: Andy Gospodarek Cc: Vladimir Oltean Link: https://lore.kernel.org/r/20230622152304.2137482-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 1b5ea7ffb7a3bdfffb4b7f40ce0d20a3372ee405 Author: Florian Fainelli Date: Thu Jun 22 03:31:07 2023 -0700 net: bcmgenet: Ensure MDIO unregistration has clocks enabled With support for Ethernet PHY LEDs having been added, while unregistering a MDIO bus and its child device liks PHYs there may be "late" accesses to the MDIO bus. One typical use case is setting the PHY LEDs brightness to OFF for instance. We need to ensure that the MDIO bus controller remains entirely functional since it runs off the main GENET adapter clock. Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/20230617155500.4005881-1-andrew@lunn.ch/ Fixes: 9a4e79697009 ("net: bcmgenet: utilize generic Broadcom UniMAC MDIO controller driver") Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230622103107.1760280-1-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski commit 54e47eade73046e860634736d2651ddc118ca694 Merge: ce44a03db73f7 7bce16630837c Author: Mark Brown Date: Sat Jun 24 01:57:59 2023 +0100 Add Renesas PMIC RAA215300 and built-in RTC Merge series from Biju Das : This patch series aims to add support for Renesas PMIC RAA215300 and built-in RTC found on this PMIC device. The details of PMIC can be found here[1]. Renesas PMIC RAA215300 exposes two separate i2c devices, one for the main device and another for rtc device. commit 4afc9a402aa3890885747b396c1adcd45f127665 Author: Yang Li Date: Thu Jun 8 16:23:12 2023 +0800 kernel/time/posix-stubs.c: remove duplicated include ./kernel/time/posix-stubs.c: linux/syscalls.h is included more than once. Link: https://lkml.kernel.org/r/20230608082312.123939-1-yang.lee@linux.alibaba.com Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5463 Fixes: c1956519cd7e ("syscalls: add sys_ni_posix_timers prototype") Signed-off-by: Yang Li Cc: Arnd Bergmann Signed-off-by: Andrew Morton commit 7982f975600d59ae3a3d98831f703e55243aba7c Author: Colin Ian King Date: Thu Jun 22 11:27:36 2023 +0100 ocfs2: remove redundant assignment to variable bit_off Variable bit_off is being assigned a value that is never read, it is being re-assigned a new value in the following while loop. Remove the assignment. Cleans up clang scan build warning: fs/ocfs2/localalloc.c:976:18: warning: Although the value stored to 'bit_off' is used in the enclosing expression, the value is never actually read from 'bit_off' [deadcode.DeadStores] Link: https://lkml.kernel.org/r/20230622102736.2831126-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton commit a8992d8ad7775860594d3d981ef93fc423185fa4 Author: Lukas Bulwahn Date: Fri Jun 23 06:07:17 2023 +0200 watchdog/hardlockup: fix typo in config HARDLOCKUP_DETECTOR_PREFER_BUDDY Commit a5fcc2367e22 ("watchdog/hardlockup: make HAVE_NMI_WATCHDOG sparc64-specific") accidentially introduces a typo in one of the config dependencies of HARDLOCKUP_DETECTOR_PREFER_BUDDY. Fix this accidental typo. Link: https://lkml.kernel.org/r/20230623040717.8645-1-lukas.bulwahn@gmail.com Fixes: a5fcc2367e22 ("watchdog/hardlockup: make HAVE_NMI_WATCHDOG sparc64-specific") Signed-off-by: Lukas Bulwahn Reviewed-by: Petr Mladek Cc: Douglas Anderson Signed-off-by: Andrew Morton commit df8b78e1630fa6cff82fdc33ce04000e3ed065f7 Author: Douglas Anderson Date: Wed Jun 21 16:48:19 2023 -0700 powerpc: move arch_trigger_cpumask_backtrace from nmi.h to irq.h The powerpc architecture was the only one that defined arch_trigger_cpumask_backtrace() in asm/nmi.h instead of asm/irq.h. Move it to be consistent. This fixes compile time errors introduced by commit 7ca8fe94aa92 ("watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH"). That commit caused to stop being included if the hardlockup detector wasn't enabled. The specific errors were: error: implicit declaration of function `nmi_cpu_backtrace' error: implicit declaration of function `nmi_trigger_cpumask_backtrace' NOTE: when moving this into irq.h, we also change the guards from just checking if "CONFIG_NMI_IPI" is defined to also checking if "CONFIG_PPC_BOOK3S_64" is defined. This matches the code in arch/powerpc/kernel/stacktrace.c. Previously this worked because was included if "CONFIG_HAVE_HARDLOCKUP_DETECTOR_ARCH" was defined. For powerpc that's only selected if "CONFIG_PPC_BOOK3S_64" is defined. [dianders@chromium.org: change the guards to include CONFIG_PPC_BOOK3S_64] Link: https://lkml.kernel.org/r/20230622202816.v2.1.Ice67126857506712559078e7de26d32d26e64631@changeid Link: https://lkml.kernel.org/r/20230621164809.1.Ice67126857506712559078e7de26d32d26e64631@changeid Fixes: 7ca8fe94aa92 ("watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH") Signed-off-by: Douglas Anderson Reported-by: Michael Ellerman Closes: https://lore.kernel.org/r/871qi5otdh.fsf@mail.lhotse Reviewed-by: Petr Mladek Cc: Arnd Bergmann Cc: Christophe Leroy Cc: Douglas Anderson Cc: Laurent Dufour Cc: Nicholas Piggin Cc: Stephen Rothwell Cc: Tom Rix Signed-off-by: Andrew Morton commit 875e0c31f84cb264d4d7b1569a1966cedcc4d459 Author: Ben Dooks Date: Wed Jun 21 17:30:50 2023 +0100 devres: show which resource was invalid in __devm_ioremap_resource() The other error prints in this call show the resource which wsan't valid, so add this to the first print when it checks for basic validity of the resource. Link: https://lkml.kernel.org/r/20230621163050.477668-1-ben.dooks@codethink.co.uk Signed-off-by: Ben Dooks Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton commit acc72d59c7509540c27c49625cb4b5a8db1f1a84 Author: Sidhartha Kumar Date: Thu Jun 22 22:49:48 2023 -0700 mm/hugetlb: remove hugetlb_set_page_subpool() All users have been converted to hugetlb_set_folio_subpool() so we can safely remove this function. Link: https://lkml.kernel.org/r/20230623054948.280627-1-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Cc: Mike Kravetz Cc: Muchun Song Cc: Tarun Sahu Signed-off-by: Andrew Morton commit 341d51c8861fe05a8b3ea317f03f26aa0fb30710 Author: lipeifeng Date: Thu Jun 22 12:01:52 2023 +0800 mm: nommu: correct the range of mmap_sem_read_lock in task_mem() During the seq_printf,the mmap_sem_read_lock protection is not required. Link: https://lkml.kernel.org/r/20230622040152.1173-1-lipeifeng@oppo.com Signed-off-by: lipeifeng Cc: David Hildenbrand Cc: Liam R. Howlett Cc: Matthew Wilcox Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit fd4aed8d985a3236d0877ff6d0c80ad39d4ce81a Author: Mike Kravetz Date: Wed Jun 21 14:24:03 2023 -0700 hugetlb: revert use of page_cache_next_miss() Ackerley Tng reported an issue with hugetlbfs fallocate as noted in the Closes tag. The issue showed up after the conversion of hugetlb page cache lookup code to use page_cache_next_miss. User visible effects are: - hugetlbfs fallocate incorrectly returns -EEXIST if pages are presnet in the file. - hugetlb pages will not be included in core dumps if they need to be brought in via GUP. - userfaultfd UFFDIO_COPY will not notice pages already present in the cache. It may try to allocate a new page and potentially return ENOMEM as opposed to EEXIST. Revert the use page_cache_next_miss() in hugetlb code. IMPORTANT NOTE FOR STABLE BACKPORTS: This patch will apply cleanly to v6.3. However, due to the change of filemap_get_folio() return values, it will not function correctly. This patch must be modified for stable backports. [dan.carpenter@linaro.org: fix hugetlbfs_pagecache_present()] Link: https://lkml.kernel.org/r/efa86091-6a2c-4064-8f55-9b44e1313015@moroto.mountain Link: https://lkml.kernel.org/r/20230621212403.174710-2-mike.kravetz@oracle.com Fixes: d0ce0e47b323 ("mm/hugetlb: convert hugetlb fault paths to use alloc_hugetlb_folio()") Signed-off-by: Mike Kravetz Signed-off-by: Dan Carpenter Reported-by: Ackerley Tng Closes: https://lore.kernel.org/linux-mm/cover.1683069252.git.ackerleytng@google.com Reviewed-by: Sidhartha Kumar Cc: Erdem Aktas Cc: Greg Kroah-Hartman Cc: Matthew Wilcox Cc: Muchun Song Cc: Vishal Annapurve Signed-off-by: Andrew Morton commit 16f8eb3eea9eb2a1568279d64ca4dc977e7aa538 Author: Mike Kravetz Date: Wed Jun 21 14:24:02 2023 -0700 Revert "page cache: fix page_cache_next/prev_miss off by one" This reverts commit 9425c591e06a9ab27a145ba655fb50532cf0bcc9 The reverted commit fixed up routines primarily used by readahead code such that they could also be used by hugetlb. Unfortunately, this caused a performance regression as pointed out by the Closes: tag. The hugetlb code which uses page_cache_next_miss will be addressed in a subsequent patch. Link: https://lkml.kernel.org/r/20230621212403.174710-1-mike.kravetz@oracle.com Fixes: 9425c591e06a ("page cache: fix page_cache_next/prev_miss off by one") Signed-off-by: Mike Kravetz Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202306211346.1e9ff03e-oliver.sang@intel.com Reviewed-by: Sidhartha Kumar Cc: Ackerley Tng Cc: Erdem Aktas Cc: Greg Kroah-Hartman Cc: Matthew Wilcox Cc: Muchun Song Cc: Vishal Annapurve Signed-off-by: Andrew Morton commit 1bc545bff45ce9eefc176ccf663074462a209cb6 Author: Yosry Ahmed Date: Wed Jun 21 02:31:01 2023 +0000 mm/vmscan: fix root proactive reclaim unthrottling unbalanced node When memory.reclaim was introduced, it became the first case where cgroup_reclaim() is true for the root cgroup. Johannes concluded [1] that for most cases this is okay, except for one case. Historically, kswapd would throttle reclaim on a node if a lot of pages marked for reclaim are under writeback (aka the node is congested). This occurred by setting LRUVEC_CONGESTED bit in lruvec->flags. The bit would be cleared when the node is balanced. Similarly, cgroup reclaim would set the same bit when an lruvec is congested, and clear it on the way out of reclaim (to throttle local reclaimers). Before the introduction of memory.reclaim, the root memcg was the only target of kswapd reclaim, and non-root memcgs were the only targets of cgroup reclaim, so they would never interfere. Using the same bit for both was fine. After memory.reclaim, it is possible for cgroup reclaim on the root cgroup to clear the bit set by kswapd. This would result in reclaim on the node to be unthrottled before the node is balanced. Fix this by introducing separate bits for cgroup-level and node-level congestion. kswapd can unthrottle an lruvec that is marked as congested by cgroup reclaim (as the entire node should no longer be congested), but not vice versa (to prevent premature unthrottling before the entire node is balanced). [1]https://lore.kernel.org/lkml/20230405200150.GA35884@cmpxchg.org/ Link: https://lkml.kernel.org/r/20230621023101.432780-1-yosryahmed@google.com Signed-off-by: Yosry Ahmed Reported-by: Johannes Weiner Closes: https://lore.kernel.org/lkml/20230405200150.GA35884@cmpxchg.org/ Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Muchun Song Cc: Yu Zhao Signed-off-by: Andrew Morton commit 7a704474b3022dabbb68f72bf18a3d89ec1c0a24 Author: Yosry Ahmed Date: Wed Jun 21 02:30:53 2023 +0000 mm: memcg: rename and document global_reclaim() Evidently, global_reclaim() can be a confusing name. Especially that it used to exist before with a subtly different definition (removed by commit b5ead35e7e1d ("mm: vmscan: naming fixes: global_reclaim() and sane_reclaim()"). It can be interpreted as non-cgroup reclaim, even though it returns true for cgroup reclaim on the root memcg (through memory.reclaim). Rename it to root_reclaim() in an attempt to make it less ambiguous, and add documentation to it as well as cgroup_reclaim. Link: https://lkml.kernel.org/r/20230621023053.432374-1-yosryahmed@google.com Signed-off-by: Yosry Ahmed Reported-by: Johannes Weiner Closes: https://lore.kernel.org/lkml/20230405200150.GA35884@cmpxchg.org/ Acked-by: Yu Zhao Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 7302338a14f97eb44cd13f34aab0dc6596f1632c Author: Kefeng Wang Date: Mon Jun 19 19:07:18 2023 +0800 mm: kill [add|del]_page_to_lru_list() Now no one call [add|del]_page_to_lru_list(), let's drop unused page interfaces. Link:https://lkml.kernel.org/r/20230619110718.65679-2-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Yu Zhao Reviewed-by: Baolin Wang Cc: James Gowans Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 56ae0bb349b4eeb172674d4876f2b6290d505a25 Author: Kefeng Wang Date: Mon Jun 19 19:07:17 2023 +0800 mm: compaction: convert to use a folio in isolate_migratepages_block() Directly use a folio instead of page_folio() when page successfully isolated (hugepage and movable page) and after folio_get_nontail_page(), which removes several calls to compound_head(). Link: https://lkml.kernel.org/r/20230619110718.65679-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: Baolin Wang Cc: James Gowans Cc: Matthew Wilcox Cc: Yu Zhao Signed-off-by: Andrew Morton commit 18a937076c6991a21b88d99af95b779b5027b29b Author: Yosry Ahmed Date: Wed Jun 21 09:30:09 2023 +0000 mm: zswap: fix double invalidate with exclusive loads If exclusive loads are enabled for zswap, we invalidate the entry before returning from zswap_frontswap_load(), after dropping the local reference. However, the tree lock is dropped during decompression after the local reference is acquired, so the entry could be invalidated before we drop the local ref. If this happens, the entry is freed once we drop the local ref, and zswap_invalidate_entry() tries to invalidate an already freed entry. Fix this by: (a) Making sure zswap_invalidate_entry() is always called with a local ref held, to avoid being called on a freed entry. (b) Making sure zswap_invalidate_entry() only drops the ref if the entry was actually on the rbtree. Otherwise, another invalidation could have already happened, and the initial ref is already dropped. With these changes, there is no need to check that there is no need to make sure the entry still exists in the tree in zswap_reclaim_entry() before invalidating it, as zswap_reclaim_entry() will make this check internally. Link: https://lkml.kernel.org/r/20230621093009.637544-1-yosryahmed@google.com Fixes: b9c91c43412f ("mm: zswap: support exclusive loads") Signed-off-by: Yosry Ahmed Reported-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Dan Streetman Cc: Domenico Cerasuolo Cc: Johannes Weiner Cc: Konrad Rzeszutek Wilk Cc: Nhat Pham Cc: Seth Jennings Cc: Vitaly Wool Cc: Yu Zhao Signed-off-by: Andrew Morton commit 994ec4e29b3de188d11fe60d17403285fcc8917a Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:57 2023 +0100 mm: remove unnecessary pagevec includes These files no longer need pagevec.h, mostly due to function declarations being moved out of it. Link: https://lkml.kernel.org/r/20230621164557.3510324-14-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 1fec6890bf2247ecc93f5491c2d3f33c333d5c6e Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:56 2023 +0100 mm: remove references to pagevec Most of these should just refer to the LRU cache rather than the data structure used to implement the LRU cache. Link: https://lkml.kernel.org/r/20230621164557.3510324-13-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 1a0fc811f5f5addf54499826bd1b6e34e917491c Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:55 2023 +0100 mm: rename invalidate_mapping_pagevec to mapping_try_invalidate We don't use pagevecs for the LRU cache any more, and we don't know that the failed invalidations were due to the folio being in an LRU cache. So rename it to be more accurate. Link: https://lkml.kernel.org/r/20230621164557.3510324-12-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 1e0877d58b1e22517d8939b22b963c043e6c63fd Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:54 2023 +0100 mm: remove struct pagevec All users are now converted to use the folio_batch so we can get rid of this data structure. Link: https://lkml.kernel.org/r/20230621164557.3510324-11-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 76fa88429075667fe76d4905f2f471e0ac3d543c Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:53 2023 +0100 net: convert sunrpc from pagevec to folio_batch Remove the last usage of pagevecs. There is a slight change here; we now free the folio_batch as soon as it fills up instead of freeing the folio_batch when we try to add a page to a full batch. This should have no effect in practice. Link: https://lkml.kernel.org/r/20230621164557.3510324-10-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Chuck Lever Signed-off-by: Andrew Morton commit f8a101ff09a70ec708b66b3f5bd4e7405283d14a Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:52 2023 +0100 i915: convert i915_gpu_error to use a folio_batch Remove one of the last remaining users of pagevec. Link: https://lkml.kernel.org/r/20230621164557.3510324-9-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit ce06442812fc584337c5b23a43bd2be7d037041d Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:51 2023 +0100 pagevec: rename fbatch_count() This should always have been called folio_batch_count(). Link: https://lkml.kernel.org/r/20230621164557.3510324-8-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit e0b72c14d8dcc9477e580c261041dae86d4906fe Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:50 2023 +0100 mm: remove check_move_unevictable_pages() All callers have now been converted to call check_move_unevictable_folios(). Link: https://lkml.kernel.org/r/20230621164557.3510324-7-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 3291e09a463870610b8227f32b16b19a587edf33 Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:49 2023 +0100 drm: convert drm_gem_put_pages() to use a folio_batch Remove a few hidden compound_head() calls by converting the returned page to a folio once and using the folio APIs. Link: https://lkml.kernel.org/r/20230621164557.3510324-6-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 0b62af28f249b9c4036a05acfb053058dc02e2e2 Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:48 2023 +0100 i915: convert shmem_sg_free_table() to use a folio_batch Remove a few hidden compound_head() calls by converting the returned page to a folio once and using the folio APIs. We also only increment the refcount on the folio once instead of once for each page. Ideally, we would have a for_each_sgt_folio macro, but until then this will do. Link: https://lkml.kernel.org/r/20230621164557.3510324-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit bdadc6d83156016d2b5eed582c1458c881c53a1e Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:47 2023 +0100 scatterlist: add sg_set_folio() This wrapper for sg_set_page() lets drivers add folios to a scatterlist more easily. We could, perhaps, do better by using a different page in the folio if offset is larger than UINT_MAX, but let's hope we get a better data structure than this before we need to care about such large folios. Link: https://lkml.kernel.org/r/20230621164557.3510324-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 982a7194afc9a58ec55ed174c61869c2722bb918 Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:46 2023 +0100 mm: add __folio_batch_release() This performs the same role as __pagevec_release(), ie skipping the check for batch length of 0. Link: https://lkml.kernel.org/r/20230621164557.3510324-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit f5f288a023193dddbc612d00abaa8f7353b44c5f Author: Matthew Wilcox (Oracle) Date: Wed Jun 21 17:45:45 2023 +0100 afs: convert pagevec to folio_batch in afs_extend_writeback() Patch series "Remove pagevecs". Removes a folio->page->folio conversion for each folio that's involved. More importantly, removes one of the last few uses of a pagevec. Link: https://lkml.kernel.org/r/20230621164557.3510324-1-willy@infradead.org Link: https://lkml.kernel.org/r/20230621164557.3510324-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 1bf61092bc90a9054d01cfdf35b42c1bf6fe47c7 Author: Baolin Wang Date: Wed Jun 21 16:14:28 2023 +0800 mm: page_alloc: use the correct type of list for free pages Commit bf75f200569d ("mm/page_alloc: add page->buddy_list and page->pcp_list") introduces page->buddy_list and page->pcp_list as a union with page->lru, but missed to change get_page_from_free_area() to use page->buddy_list to clarify the correct type of list for a free page. Link: https://lkml.kernel.org/r/7e7ab533247d40c0ea0373c18a6a48e5667f9e10.1687333557.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Mel Gorman Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton commit b5665cf936bf3955fec18c09a6aa53c8a57ea8b7 Author: Ivan Orlov Date: Tue Jun 20 20:33:15 2023 +0200 mm: backing-dev: make bdi_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the bdi_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Link: https://lkml.kernel.org/r/20230620183314.682822-2-gregkh@linuxfoundation.org Signed-off-by: Ivan Orlov Signed-off-by: Greg Kroah-Hartman Suggested-by: Greg Kroah-Hartman Cc: Jens Axboe Cc: Christoph Hellwig Signed-off-by: Andrew Morton commit 3fda49e89f1702df6bb6a2470076b1a7bf3a29de Author: Hugh Dickins Date: Mon Jun 19 23:50:00 2023 -0700 mm/swapfile: delete outdated pte_offset_map() comment Delete a triply out-of-date comment from add_swap_count_continuation(): 1. vmalloc_to_page() changed from pte_offset_map() to pte_offset_kernel() 2. pte_offset_map() changed from using kmap_atomic() to kmap_local_page() 3. kmap_atomic() changed from using fixed FIX_KMAP addresses in 2.6.37. Link: https://lkml.kernel.org/r/9022632b-ba9d-8cb0-c25-4be9786481b5@google.com Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton commit 61167ad5fecdeaa037f3df1ba354dddd5f66a1ed Author: Yajun Deng Date: Mon Jun 19 10:34:06 2023 +0800 mm: pass nid to reserve_bootmem_region() early_pfn_to_nid() is called frequently in init_reserved_page(), it returns the node id of the PFN. These PFN are probably from the same memory region, they have the same node id. It's not necessary to call early_pfn_to_nid() for each PFN. Pass nid to reserve_bootmem_region() and drop the call to early_pfn_to_nid() in init_reserved_page(). Also, set nid on all reserved pages before doing this, as some reserved memory regions may not be set nid. The most beneficial function is memmap_init_reserved_pages() if CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled. The following data was tested on an x86 machine with 190GB of RAM. before: memmap_init_reserved_pages() 67ms after: memmap_init_reserved_pages() 20ms Link: https://lkml.kernel.org/r/20230619023406.424298-1-yajun.deng@linux.dev Signed-off-by: Yajun Deng Reviewed-by: Mike Rapoport (IBM) Signed-off-by: Andrew Morton commit 9883c7f84053cec2826ca3c56254601b5ce9cdbe Author: Jason Gunthorpe Date: Mon Jun 19 15:27:25 2023 -0300 mm/gup: do not return 0 from pin_user_pages_fast() for bad args These routines are not intended to return zero, the callers cannot do anything sane with a 0 return. They should return an error which means future calls to GUP will not succeed, or they should return some non-zero number of pinned pages which means GUP should be called again. If start + nr_pages overflows it should return -EOVERFLOW to signal the arguments are invalid. Syzkaller keeps tripping on this when fuzzing GUP arguments. Link: https://lkml.kernel.org/r/0-v1-3d5ed1f20d50+104-gup_overflow_jgg@nvidia.com Signed-off-by: Jason Gunthorpe Reported-by: syzbot+353c7be4964c6253f24a@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/000000000000094fdd05faa4d3a4@google.com Reviewed-by: John Hubbard Reviewed-by: Lorenzo Stoakes Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton commit 0b52c420350e8f9873ba62768cd8246827184408 Author: Jan Glauber Date: Mon Jun 19 12:33:51 2023 +0200 mm: fix shmem THP counters on migration The per node numa_stat values for shmem don't change on page migration for THP: grep shmem /sys/fs/cgroup/machine.slice/.../memory.numa_stat: shmem N0=1092616192 N1=10485760 shmem_thp N0=1092616192 N1=10485760 migratepages 9181 0 1: shmem N0=0 N1=1103101952 shmem_thp N0=1092616192 N1=10485760 Fix that by updating shmem_thp counters likewise to shmem counters on page migration. [jglauber@digitalocean.com: use folio_test_pmd_mappable instead of folio_test_transhuge] Link: https://lkml.kernel.org/r/20230622094720.510540-1-jglauber@digitalocean.com Link: https://lkml.kernel.org/r/20230619103351.234837-1-jglauber@digitalocean.com Signed-off-by: Jan Glauber Reviewed-by: Baolin Wang Cc: "Huang, Ying" Signed-off-by: Andrew Morton commit 3360cd30a4c569eb601e737e2c10b7bd153210ca Author: Haifeng Xu Date: Mon Jun 19 12:47:35 2023 +0000 selftests: cgroup: fix unexpected failure on test_memcg_sock Before server got a client connection, there were some memory allocations in the test memcg, such as user stack. So do not count those allocations which are not related to socket when checking socket memory accounting. Link: https://lkml.kernel.org/r/20230619124735.2124-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Cc: Johannes Weiner Cc: Michal Hocko Cc: Michal Koutný Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 91f0dccef141483f8399299c39ce9114d19bb147 Author: Haifeng Xu Date: Mon Jun 19 13:04:42 2023 +0000 mm/memcontrol: do not tweak node in mem_cgroup_init() mem_cgroup_init() request for allocations from each possible node, and it's used to be a problem because NODE_DATA is not allocated for offline node. Things have already changed since commit 09f49dca570a9 ("mm: handle uninitialized numa nodes gracefully"), so it's unnecessary to check for !node_online nodes here. How to test? qemu-system-x86_64 \ -kernel vmlinux \ -initrd full.rootfs.cpio.gz \ -append "console=ttyS0,115200 root=/dev/ram0 nokaslr earlyprintk=serial oops=panic panic_on_warn" \ -drive format=qcow2,file=vm_disk.qcow2,media=disk,if=ide \ -enable-kvm \ -cpu host \ -m 8G,slots=2,maxmem=16G \ -smp cores=4,threads=1,sockets=2 \ -object memory-backend-ram,id=mem0,size=4G \ -object memory-backend-ram,id=mem1,size=4G \ -numa node,memdev=mem0,cpus=0-3,nodeid=0 \ -numa node,memdev=mem1,cpus=4-7,nodeid=1 \ -numa node,nodeid=2 \ -net nic,model=virtio,macaddr=52:54:00:12:34:58 \ -net user \ -nographic \ -rtc base=localtime \ -gdb tcp::6000 Guest state when booting: [ 0.048881] NUMA: Node 0 [mem 0x00000000-0x0009ffff] + [mem 0x00100000-0xbfffffff] -> [mem 0x00000000-0xbfffffff] [ 0.050489] NUMA: Node 0 [mem 0x00000000-0xbfffffff] + [mem 0x100000000-0x13fffffff] -> [mem 0x00000000-0x13fffffff] [ 0.052173] NODE_DATA(0) allocated [mem 0x13fffc000-0x13fffffff] [ 0.053164] NODE_DATA(1) allocated [mem 0x23fffa000-0x23fffdfff] [ 0.054187] Zone ranges: [ 0.054587] DMA [mem 0x0000000000001000-0x0000000000ffffff] [ 0.055551] DMA32 [mem 0x0000000001000000-0x00000000ffffffff] [ 0.056515] Normal [mem 0x0000000100000000-0x000000023fffffff] [ 0.057484] Movable zone start for each node [ 0.058149] Early memory node ranges [ 0.058705] node 0: [mem 0x0000000000001000-0x000000000009efff] [ 0.059679] node 0: [mem 0x0000000000100000-0x00000000bffdffff] [ 0.060659] node 0: [mem 0x0000000100000000-0x000000013fffffff] [ 0.061649] node 1: [mem 0x0000000140000000-0x000000023fffffff] [ 0.062638] Initmem setup node 0 [mem 0x0000000000001000-0x000000013fffffff] [ 0.063745] Initmem setup node 1 [mem 0x0000000140000000-0x000000023fffffff] [ 0.064855] DMA zone: 158 reserved pages exceeds freesize 0 [ 0.065746] Initializing node 2 as memoryless [ 0.066437] Initmem setup node 2 as memoryless [ 0.067132] DMA zone: 158 reserved pages exceeds freesize 0 [ 0.068037] On node 0, zone DMA: 1 pages in unavailable ranges [ 0.068265] On node 0, zone DMA: 97 pages in unavailable ranges [ 0.124755] On node 0, zone Normal: 32 pages in unavailable ranges cat /sys/devices/system/node/online 0-1 cat /sys/devices/system/node/possible 0-2 Link: https://lkml.kernel.org/r/20230619130442.2487-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 726ccdba1521007fab4b2b7565d255fa0f2b770c Author: Tetsuo Handa Date: Sun May 28 00:25:31 2023 +0900 kasan,kmsan: remove __GFP_KSWAPD_RECLAIM usage from kasan/kmsan syzbot is reporting lockdep warning in __stack_depot_save(), for the caller of __stack_depot_save() (i.e. __kasan_record_aux_stack() in this report) is responsible for masking __GFP_KSWAPD_RECLAIM flag in order not to wake kswapd which in turn wakes kcompactd. Since kasan/kmsan functions might be called with arbitrary locks held, mask __GFP_KSWAPD_RECLAIM flag from all GFP_NOWAIT/GFP_ATOMIC allocations in kasan/kmsan. Note that kmsan_save_stack_with_flags() is changed to mask both __GFP_DIRECT_RECLAIM flag and __GFP_KSWAPD_RECLAIM flag, for wakeup_kswapd() from wake_all_kswapds() from __alloc_pages_slowpath() calls wakeup_kcompactd() if __GFP_KSWAPD_RECLAIM flag is set and __GFP_DIRECT_RECLAIM flag is not set. Link: https://lkml.kernel.org/r/656cb4f5-998b-c8d7-3c61-c2d37aa90f9a@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa Reported-by: syzbot Closes: https://syzkaller.appspot.com/bug?extid=ece2915262061d6e0ac1 Reviewed-by: "Huang, Ying" Reviewed-by: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Cc: Mel Gorman Cc: Vincenzo Frascino Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 9721fd82351d47a37ba982272e128101f24efd7c Author: Baolin Wang Date: Wed Jun 14 16:40:20 2023 +0800 mm: compaction: skip memory hole rapidly when isolating migratable pages On some machines, the normal zone can have a large memory hole like below memory layout, and we can see the range from 0x100000000 to 0x1800000000 is a hole. So when isolating some migratable pages, the scanner can meet the hole and it will take more time to skip the large hole. From my measurement, I can see the isolation scanner will take 80us ~ 100us to skip the large hole [0x100000000 - 0x1800000000]. So adding a new helper to fast search next online memory section to skip the large hole can help to find next suitable pageblock efficiently. With this patch, I can see the large hole scanning only takes < 1us. [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000040000000-0x00000000ffffffff] [ 0.000000] DMA32 empty [ 0.000000] Normal [mem 0x0000000100000000-0x0000001fa7ffffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000040000000-0x0000000fffffffff] [ 0.000000] node 0: [mem 0x0000001800000000-0x0000001fa3c7ffff] [ 0.000000] node 0: [mem 0x0000001fa3c80000-0x0000001fa3ffffff] [ 0.000000] node 0: [mem 0x0000001fa4000000-0x0000001fa402ffff] [ 0.000000] node 0: [mem 0x0000001fa4030000-0x0000001fa40effff] [ 0.000000] node 0: [mem 0x0000001fa40f0000-0x0000001fa73cffff] [ 0.000000] node 0: [mem 0x0000001fa73d0000-0x0000001fa745ffff] [ 0.000000] node 0: [mem 0x0000001fa7460000-0x0000001fa746ffff] [ 0.000000] node 0: [mem 0x0000001fa7470000-0x0000001fa758ffff] [ 0.000000] node 0: [mem 0x0000001fa7590000-0x0000001fa7ffffff] [baolin.wang@linux.alibaba.com: limit next_ptn to not exceed cc->free_pfn] Link: https://lkml.kernel.org/r/a1d859c28af0c7e85e91795e7473f553eb180a9d.1686813379.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/75b4c8ca36bf44ad8c42bf0685ac19d272e426ec.1686705221.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Suggested-by: David Hildenbrand Acked-by: David Hildenbrand Acked-by: "Huang, Ying" Cc: Mel Gorman Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 8c293a6353d663879ec0e5db1db052319ca2100f Author: Marco Elver Date: Tue Jun 20 19:17:35 2023 +0200 kasan, doc: note kasan.fault=panic_on_write behaviour for async modes Note the behaviour of kasan.fault=panic_on_write for async modes, since all asynchronous faults will result in panic (even if they are reads). Link: https://lkml.kernel.org/r/ZJHfL6vavKUZ3Yd8@elver.google.com Fixes: 452c03fdbed0 ("kasan: add support for kasan.fault=panic_on_write") Signed-off-by: Marco Elver Reviewed-by: Andrey Konovalov Cc: Aleksandr Nogikh Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Jonathan Corbet Cc: Taras Madan Cc: Vincenzo Frascino Signed-off-by: Andrew Morton commit 63773d2b593d86440c3b96fd300ed80d00cd06ef Merge: cf01724e2d73a 814bc1de03ea4 Author: Andrew Morton Date: Fri Jun 23 16:58:19 2023 -0700 Merge mm-hotfixes-stable into mm-stable to pick up depended-upon changes. commit 814bc1de03ea4361101408e63a68e4b82aef22cb Author: Yu Zhao Date: Mon Jun 19 13:38:21 2023 -0600 mm/mglru: make memcg_lru->lock irq safe lru_gen_rotate_memcg() can happen in softirq if memory.soft_limit_in_bytes is set. This requires memcg_lru->lock to be irq safe. Lockdep warns on this. This problem only affects memcg v1. Link: https://lkml.kernel.org/r/20230619193821.2710944-1-yuzhao@google.com Fixes: e4dde56cd208 ("mm: multi-gen LRU: per-node lru_gen_folio lists") Signed-off-by: Yu Zhao Reported-by: syzbot+87c490fd2be656269b6a@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=87c490fd2be656269b6a Reviewed-by: Yosry Ahmed Cc: Signed-off-by: Andrew Morton commit a7ab84a5915fc67697131b8e5eba96c278bbe785 Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:09 2023 +0200 dt-bindings: pwm: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230609140709.64655-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit f6814f6f3fb2802d8808749b9abead2756f57402 Author: Krzysztof Kozlowski Date: Wed Jun 21 08:44:03 2023 +0200 dt-bindings: crypto: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230621064403.9221-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 2c5555983bd27d24162534b682b10654639a5576 Author: Jan Kara Date: Thu Jun 22 18:46:55 2023 +0200 bcache: Fix bcache device claiming Commit 2736e8eeb0cc ("block: use the holder as indication for exclusive opens") introduced a change that blkdev_put() has to get exclusive holder of the bdev as an argument. However it overlooked that register_bdev() and register_cache() overwrite the bdev->bd_holder field in the block device to point to the real owning object which was not available at the time we called blkdev_get_by_path(). Messing with bdev internals like this is a layering violation and it also causes blkdev_put() to issue warning about mismatching holders. Fix bcache to reopen the block device with appropriate holder once it is available which also restores the behavior that multiple bcache caches cannot claim the same device which was broken by commit 29499ab060fe ("bcache: don't pass a stack address to blkdev_get_by_path"). Fixes: 2736e8eeb0cc ("block: use the holder as indication for exclusive opens") Signed-off-by: Jan Kara Reviewed-by: Kent Overstreet Acked-by: Coly Li Link: https://lore.kernel.org/r/20230622164658.12861-2-jack@suse.cz Signed-off-by: Jens Axboe commit abcc0cbd49283fccd20420e86416b2475b00819c Author: Jan Kara Date: Thu Jun 22 18:46:54 2023 +0200 bcache: Alloc holder object before async registration Allocate holder object (cache or cached_dev) before offloading the rest of the startup to async work. This will allow us to open the block block device with proper holder. Signed-off-by: Jan Kara Acked-by: Coly Li Reviewed-by: Kent Overstreet Link: https://lore.kernel.org/r/20230622164658.12861-1-jack@suse.cz Signed-off-by: Jens Axboe commit 95bf6df03d412f678a7b558da186c2ef797ac40c Merge: 0e796e3eafc5b 46e66dab8565f Author: Vishal Verma Date: Fri Jun 23 15:20:00 2023 -0600 Merge branch 'for-6.5/dax-cleanups' into nvdimm-for-next The reference counting of dax_region objects is needlessly complicated, has lead to confusion [1], and has hidden a bug [2]. While testing the cleanup for those issues, a CONFIG_DEBUG_KOBJECT_RELEASE test run uncovered a use-after-free in dax_mapping_release(). Clean all of that up. Thanks to Yongqiang, Paul, and Ira for their analysis. Additionally, clean up a redundant variable in fsdax, and fix memory hotplug registration in the kmem driver. [1]: http://lore.kernel.org/r/20221203095858.612027-1-liuyongqiang13@huawei.com [2]: http://lore.kernel.org/r/3cf0890b-4eb0-e70e-cd9c-2ecc3d496263@hpe.com commit a3eb95484f276488e3d59cffa8eec29f79be416e Author: Varshini Rajendran Date: Sat Jun 24 02:00:43 2023 +0530 spi: dt-bindings: atmel,at91rm9200-spi: add sam9x7 compatible Add sam9x7 compatible to DT bindings documentation. Signed-off-by: Varshini Rajendran Link: https://lore.kernel.org/r/Message-Id: <20230623203056.689705-33-varshini.rajendran@microchip.com> Signed-off-by: Mark Brown commit 2d0cad0473bd1ffbc5842be0b9f2546265acb011 Author: Mark Brown Date: Fri Jun 23 22:04:39 2023 +0100 ASoC: core: Always store of_node when getting DAI link component The generic snd_soc_dai_get_dlc() contains a default translation function for DAI names which has factored out common code in a number of card drivers, resolving the dai_name and of_node either using a driver provided translation function or with a generic implementation. Unfortunately the of_node can't be set by the translation function since it currently doesn't have an interface to do that but snd_soc_dai_get_dlc() only initialises the of_node in the case where there is no translation function. This breaks the Meson support after conversion to use the generic helpers since the DPCM cards for it check which component of the SoC is connected to each link by checking the compatible for the component and the Meson components provide a custom operation so don't use the generic code. Fix this and potentially other cards by unconditionally storing the node in the dai_link_component, there shouldn't be a binding specific of_node selected since that's how we determine the translation function. Fixes: 2e1dbea1f8a3 ("ASoC: meson: use snd_soc_{of_}get_dlc()") Fixes: 3c8b5861850c ("ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()") Link: https://lore.kernel.org/r/Message-Id: <20230623-asoc-fix-meson-probe-v1-1-82b2c2ec5ca4@kernel.org> Signed-off-by: Mark Brown commit 0e796e3eafc5ba450a1f479f22aef4c8a4c7d686 Author: Ben Dooks Date: Fri Jun 16 17:09:25 2023 +0100 nvdimm: make security_show static The security_show function is not used outside of drivers/nvdimm/dimm_devs.c and the attribute it is for is also already static. Silence the sparse warning for this not being declared by making it static. Fixes: drivers/nvdimm/dimm_devs.c:352:9: warning: symbol 'security_show' was not declared. Should it be static? Signed-off-by: Ben Dooks Link: https://lore.kernel.org/r/20230616160925.17687-1-ben.dooks@codethink.co.uk Reviewed-by: Dave Jiang Signed-off-by: Vishal Verma commit 191a9f3a611175b3e8e8c9e700fb8bce12ad7aa3 Author: Ben Dooks Date: Fri Jun 16 17:06:28 2023 +0100 nvdimm: make nd_class variable static The nd_class is not used outside of drivers/nvdimm/bus.c and thus sparse is generating the following warning. Remove this by making it static: drivers/nvdimm/bus.c:28:14: warning: symbol 'nd_class' was not declared. Should it be static? Signed-off-by: Ben Dooks Link: https://lore.kernel.org/r/20230616160628.11801-1-ben.dooks@codethink.co.uk Reviewed-by: Ira Weiny Signed-off-by: Vishal Verma commit 8fb3e25c3dd1a2755c848ce7488c2f06a9fb9f97 Author: Lyude Paul Date: Tue Jun 13 17:05:28 2023 -0400 drm/nouveau/kms/nv50-: Fix drm_dp_remove_payload() invocation We changed the semantics for this in: commit e761cc20946a ("drm/display/dp_mst: Handle old/new payload states in drm_dp_remove_payload()") But I totally forgot to update this properly in nouveau. So, let's do that. Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20230613210529.552098-1-lyude@redhat.com commit 061cbfab09fb35898f2907d42f936cf9ae271d93 Author: Frank Li Date: Mon May 15 11:10:49 2023 -0400 PCI: layerscape: Add the endpoint linkup notifier support Layerscape has PME interrupt, which can be used as linkup notifier. Set CFG_READY bit of PEX_PF0_CONFIG to enable accesses from root complex when linkup detected. Link: https://lore.kernel.org/r/20230515151049.2797105-1-Frank.Li@nxp.com Signed-off-by: Xiaowei Bao Signed-off-by: Frank Li Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Acked-by: Manivannan Sadhasivam commit 4ab91207fe37cb0b17d73aa7b042218a83908971 Author: Frank Li Date: Wed Dec 14 12:22:54 2022 -0500 PCI: endpoint: pci-epf-vntb: Fix typo in comments Replace "Span" with "Spad". Link: https://lore.kernel.org/r/20221214172254.668282-1-Frank.Li@nxp.com Signed-off-by: Frank Li Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 39cce0875121ce31b90467811de807c46aed9f0f Author: Manivannan Sadhasivam Date: Fri Jun 2 17:17:56 2023 +0530 MAINTAINERS: Add PCI MHI endpoint function driver under MHI bus Add PCI endpoint driver for MHI bus under the MHI bus entry in MAINTAINERS file. Link: https://lore.kernel.org/r/20230602114756.36586-10-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Damien Le Moal commit 1bf5f25324f7f6a52c3eb566ec5f78f6a901db96 Author: Manivannan Sadhasivam Date: Fri Jun 2 17:17:55 2023 +0530 PCI: endpoint: Add PCI Endpoint function driver for MHI bus Add PCI Endpoint driver for the Qualcomm MHI (Modem Host Interface) bus. The driver implements the MHI function over PCI in the endpoint device such as SDX55 modem. The MHI endpoint function driver acts as a controller driver for the MHI Endpoint stack and carries out all PCI related functionality. Link: https://lore.kernel.org/r/20230602114756.36586-9-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Kishon Vijay Abraham I Reviewed-by: Damien Le Moal commit 8f05cd35c73b97b9df759dd70e3ad26bc7482a7d Author: Manivannan Sadhasivam Date: Fri Jun 2 17:17:54 2023 +0530 PCI: qcom-ep: Add support for BME notification Add support to pass BME (Bus Master Enable) notification to Endpoint function driver so that the BME event can be processed by the function. Link: https://lore.kernel.org/r/20230602114756.36586-8-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Kishon Vijay Abraham I Reviewed-by: Damien Le Moal commit c47c74b7217a3a142d6c7f0371d8e0240acb21a0 Author: Manivannan Sadhasivam Date: Fri Jun 2 17:17:53 2023 +0530 PCI: qcom-ep: Add support for Link down notification Add support to pass Link down notification to Endpoint function driver so that the LINK_DOWN event can be processed by the function. Link: https://lore.kernel.org/r/20230602114756.36586-7-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Kishon Vijay Abraham I Reviewed-by: Damien Le Moal commit 6360efb96b19d89990b2a5bf3a73c689a429f5da Author: Manivannan Sadhasivam Date: Fri Jun 2 17:17:52 2023 +0530 PCI: endpoint: Add BME notifier support Add support to notify the EPF device about the Bus Master Enable (BME) event received by the EPC device from the Root complex. Link: https://lore.kernel.org/r/20230602114756.36586-6-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Kishon Vijay Abraham I Reviewed-by: Damien Le Moal commit a1f6c3d7d3a2fdcb7bf77da17a17944c81ca13de Author: Manivannan Sadhasivam Date: Fri Jun 2 17:17:51 2023 +0530 PCI: endpoint: Add linkdown notifier support Add support to notify the EPF device about the linkdown event from the EPC device. Link: https://lore.kernel.org/r/20230602114756.36586-5-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Kishon Vijay Abraham I Reviewed-by: Damien Le Moal commit a504c965588b781f864364e897917a2c7b48ea5b Author: Manivannan Sadhasivam Date: Fri Jun 2 17:17:50 2023 +0530 PCI: endpoint: Return error if EPC is started/stopped multiple times When the EPC is started or stopped multiple times from configfs, just return -EALREADY. There is no need to call the EPC start/stop functions in those cases. Link: https://lore.kernel.org/r/20230602114756.36586-4-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Kishon Vijay Abraham I Reviewed-by: Damien Le Moal commit 081c715dfd50542e89df5ee12a8e32e7ed936cd1 Author: Manivannan Sadhasivam Date: Fri Jun 2 17:17:49 2023 +0530 PCI: endpoint: Pass EPF device ID to the probe function Currently, the EPF probe function doesn't get the device ID argument needed to correctly identify the device table ID of the EPF device. When multiple entries are added to the "struct pci_epf_device_id" table, the probe function needs to identify the correct one. This is achieved by modifying the pci_epf_match_id() function to return the match ID pointer and passing it to the driver's probe function. pci_epf_device_match() function can return bool based on the return value of pci_epf_match_id(). Link: https://lore.kernel.org/r/20230602114756.36586-3-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Kishon Vijay Abraham I Reviewed-by: Damien Le Moal commit ff2f19d6f1fcb6128950263c3ea46ff1aefec54f Author: Manivannan Sadhasivam Date: Fri Jun 2 17:17:48 2023 +0530 PCI: endpoint: Add missing documentation about the MSI/MSI-X range Both pci_epc_raise_irq() and pci_epc_map_msi_irq() APIs expect the MSI/MSI-X vectors to start from 1 but it is not documented. Add the range info to the kdoc of the APIs to make it clear. Link: https://lore.kernel.org/r/20230602114756.36586-2-manivannan.sadhasivam@linaro.org Fixes: 5e8cb4033807 ("PCI: endpoint: Add EP core layer to enable EP controller and EP functions") Fixes: 87d5972e476f ("PCI: endpoint: Add pci_epc_ops to map MSI IRQ") Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Damien Le Moal commit b6a6e0331fad61e38316a00e14ef6381d9f03161 Author: Damien Le Moal Date: Mon May 15 16:43:47 2023 +0900 PCI: endpoint: Improve pci_epf_type_add_cfs() pci_epf_type_add_cfs() should not be called with an unbound EPF device, that is, an epf device with epf->driver not set. For such case, replace the NULL return in pci_epf_type_add_cfs() with a clear ERR_PTR(-ENODEV) pointer error return. Link: https://lore.kernel.org/r/20230515074348.595704-2-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivami commit 880d51c729a3fa944794feb19f605eefe55916fc Author: Yoshihiro Shimoda Date: Wed Apr 12 15:34:47 2023 +0900 PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction In pci_epf_test_init_dma_chan() epf_test->dma_chan_rx is assigned from dma_request_channel() with DMA_DEV_TO_MEM as filter.dma_mask. However, in pci_epf_test_data_transfer() if the dir is DMA_DEV_TO_MEM, epf->dma_chan_rx should be used but instead we are using epf_test->dma_chan_tx. Fix it. Link: https://lore.kernel.org/r/20230412063447.2841177-1-yoshihiro.shimoda.uh@renesas.com Fixes: 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities") Tested-by: Kunihiko Hayashi Signed-off-by: Yoshihiro Shimoda Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Frank Li commit 4c50f933f50e018653a11bd77eb872d46d67c193 Author: Damien Le Moal Date: Sat Apr 15 11:35:42 2023 +0900 misc: pci_endpoint_test: Simplify pci_endpoint_test_msi_irq() Simplify the code of pci_endpoint_test_msi_irq() by correctly using booleans: remove the msix comparison to false as that variable is already a boolean, and directly return the result of the comparison of the raised interrupt number. Link: https://lore.kernel.org/r/20230415023542.77601-18-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 168e6f62e4298815125591ff9c85d374b2a93c6c Author: Damien Le Moal Date: Sat Apr 15 11:35:41 2023 +0900 misc: pci_endpoint_test: Do not write status in IRQ handler pci_endpoint_test_irqhandler() always rewrites the status register when an IRQ is raised, either as-is if STATUS_IRQ_RAISED is not set, or with STATUS_IRQ_RAISED cleared if that flag is set. The first case creates a race window with the endpoint side, meaning that the host side test driver may end up reading what it just wrote, thus losing the real status as set by the endpoint side before raising the next interrupt. This can prevent detecting that the STATUS_IRQ_RAISED flag was set by the endpoint. Remove this race window by not clearing the STATUS_IRQ_RAISED status flag and not rewriting that register for every IRQ received. Link: https://lore.kernel.org/r/20230415023542.77601-17-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit fb620ae73b70c2f57b9d3e911fc24c024ba2324f Author: Damien Le Moal Date: Sat Apr 15 11:35:40 2023 +0900 misc: pci_endpoint_test: Re-init completion for every test The irq_raised completion used to detect the end of a test case is initialized when the test device is probed, but never reinitialized again before a test case. As a result, the irq_raised completion synchronization is effective only for the first ioctl test case executed. Any subsequent call to wait_for_completion() by another ioctl() call will immediately return, potentially too early, leading to false positive failures. Fix this by reinitializing the irq_raised completion before starting a new ioctl() test command. Link: https://lore.kernel.org/r/20230415023542.77601-16-dlemoal@kernel.org Fixes: 2c156ac71c6b ("misc: Add host side PCI driver for PCI test function device") Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam Cc: stable@vger.kernel.org commit f61b7634a3249d12b9daa36ffbdb9965b6f24c6c Author: Damien Le Moal Date: Sat Apr 15 11:35:39 2023 +0900 misc: pci_endpoint_test: Free IRQs before removing the device In pci_endpoint_test_remove(), freeing the IRQs after removing the device creates a small race window for IRQs to be received with the test device memory already released, causing the IRQ handler to access invalid memory, resulting in an oops. Free the device IRQs before removing the device to avoid this issue. Link: https://lore.kernel.org/r/20230415023542.77601-15-dlemoal@kernel.org Fixes: e03327122e2c ("pci_endpoint_test: Add 2 ioctl commands") Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam Cc: stable@vger.kernel.org commit 1754dfd2e7931f60d199a9cb044991ab80cdfe0b Author: Damien Le Moal Date: Sat Apr 15 11:35:38 2023 +0900 PCI: epf-test: Simplify transfers result print In pci_epf_test_print_rate(), instead of open coding a reduction loop to allow for a division by a 32-bits ns value, simply use div64_u64() to calculate the transfer rate. To match the printed unit of KB/s, this calculation divides the rate by 1000 instead of 1024 (that would be KiB/s unit). Change the format of the results printed by pci_epf_test_print_rate() to be more compact without the double new line. Also use dev_info() instead of pr_info(). Link: https://lore.kernel.org/r/20230415023542.77601-14-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 2566cbea69ab8dad4996ab4b4840fd952e62e5b4 Author: Damien Le Moal Date: Sat Apr 15 11:35:37 2023 +0900 PCI: epf-test: Simplify DMA support checks There is no need to have each read, write and copy test functions check for the FLAG_USE_DMA flag against the DMA support status indicated by epf_test->dma_supported. Move this test to the command handler function pci_epf_test_cmd_handler() to check once for all cases. Link: https://lore.kernel.org/r/20230415023542.77601-13-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 2eec4bec3574ce1a8b0fcf568cebc82c1ad7ec80 Author: Damien Le Moal Date: Sat Apr 15 11:35:36 2023 +0900 PCI: epf-test: Cleanup request result handling Each of the test functions pci_epf_test_write(), pci_epf_test_read() and pci_epf_test_copy() return an int result which is used by pci_epf_test_cmd_handler() to set a success or error bit in the request status. In the spirit of keeping the processing of each test case self-contained within its own test function, move the request status field update from pci_epf_test_cmd_handler() to each of these test functions and change these functions declaration to returning void. Link: https://lore.kernel.org/r/20230415023542.77601-12-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 96d513f5ed4cafafa31ed99f74ad527f6b0ff47b Author: Damien Le Moal Date: Sat Apr 15 11:35:35 2023 +0900 PCI: epf-test: Cleanup pci_epf_test_cmd_handler() Command codes are never combined together as flags into a single value. Thus we can replace the series of "if" tests in pci_epf_test_cmd_handler() with a cleaner switch-case statement. This also allows checking that we got a valid command and print an error message if we did not. Link: https://lore.kernel.org/r/20230415023542.77601-11-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit fc97f5f7c23735da0c7314533203306d96a038fb Author: Damien Le Moal Date: Sat Apr 15 11:35:34 2023 +0900 PCI: epf-test: Improve handling of command and status registers The pci-epf-test driver uses the test register BAR memory directly to get and execute a test registers set by the RC side and defined using a struct pci_epf_test_reg. This direct use relies on using the register BAR address as a pointer to a struct pci_epf_test_reg to execute the test case and to send back the test result through the status field of struct pci_epf_test_reg. In practice, the status field is always updated before an interrupt is raised in pci_epf_test_raise_irq(), to ensure that the RC side sees the updated status when receiving an interrupt. However, such assignment direct access does not ensure that changes to the status register make it to memory, and so visible to the host, before an interrupt is raised, thus potentially resulting in the RC host not seeing the correct status result for a test. Avoid this potential problem by using READ_ONCE()/WRITE_ONCE() when accessing the command and status fields of a pci_epf_test_reg structure. This ensure that a test start (pci_epf_test_cmd_handler() function) and completion (with the function pci_epf_test_raise_irq()) achieve a correct synchronization with the MMIO register accesses on the RC host. Link: https://lore.kernel.org/r/20230415023542.77601-10-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 48d19fc6e4a74e8f7d395f0186cd9e6f93c6ee26 Author: Damien Le Moal Date: Sat Apr 15 11:35:33 2023 +0900 PCI: epf-test: Simplify IRQ test commands execution For the commands COMMAND_RAISE_LEGACY_IRQ, COMMAND_RAISE_MSI_IRQ and COMMAND_RAISE_MSIX_IRQ, the function pci_epf_test_cmd_handler() sets the STATUS_IRQ_RAISED status flag and calls the epc function pci_epc_raise_irq() directly. However, this is also exactly what the pci_epf_test_raise_irq() function does. Avoid duplicating these operations by directly using pci_epf_test_raise_irq() for the IRQ test commands. It is OK to do so as the host side endpoint test driver always set the correct IRQ type for the IRQ test commands. At the same time, move the IRQ number check done for the COMMAND_RAISE_MSI_IRQ and COMMAND_RAISE_MSIX_IRQ commands to pci_epf_test_raise_irq(), to also check the IRQ number requested by the host for other test commands. This significantly simplifies pci_epf_test_cmd_handler(). Link: https://lore.kernel.org/r/20230415023542.77601-9-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 5444737e16402db4a62fdf521a02c68fa84153a6 Author: Damien Le Moal Date: Sat Apr 15 11:35:32 2023 +0900 PCI: epf-test: Simplify pci_epf_test_raise_irq() Change the interface of the function pci_epf_test_raise_irq() to directly pass a pointer to the struct pci_epf_test_reg defining the test being executed. This avoids the need for grabbing this pointer using the register BAR address and simplifies the call sites as the IRQ type and IRQ numbers do not have to be passed as arguments. Link: https://lore.kernel.org/r/20230415023542.77601-8-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 62d48ec7ef87d65723e3efcbfa6178cf2f7d8156 Author: Damien Le Moal Date: Sat Apr 15 11:35:31 2023 +0900 PCI: epf-test: Simplify read/write/copy test functions The function pci_epf_test_cmd_handler() uses the register BAR address as a pointer to a struct pci_epf_test_reg to determine the command sent by the host and to execute the test function accordingly. There is no need for doing this assignment again in each of the read, write and copy test functions. We can simply pass the reg pointer as an argument to the functions pci_epf_test_write(), pci_epf_test_read() and pci_epf_test_copy(). Link: https://lore.kernel.org/r/20230415023542.77601-7-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 349d5c840a5d2608bc910261a176a6bd355fcc73 Author: Damien Le Moal Date: Sat Apr 15 11:35:30 2023 +0900 PCI: epf-test: Use dmaengine_submit() to initiate DMA transfer Instead of an open coded call to the tx_submit() operation of struct dma_async_tx_descriptor, use the helper function dmaengine_submit(). No functional change is introduced with this. Link: https://lore.kernel.org/r/20230415023542.77601-6-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 933f31a2fe1f20e5b1ee065579f652cd1b317183 Author: Damien Le Moal Date: Sat Apr 15 11:35:29 2023 +0900 PCI: epf-test: Fix DMA transfer completion detection pci_epf_test_data_transfer() and pci_epf_test_dma_callback() are not handling DMA transfer completion correctly, leading to completion notifications to the RC side that are too early. This problem can be detected when the RC side is running an IOMMU with messages such as: pci-endpoint-test 0000:0b:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x001c address=0xfff00000 flags=0x0000] When running the pcitest.sh tests: the address used for a previous test transfer generates the above error while the next test transfer is running. Fix this by testing the DMA transfer status in pci_epf_test_dma_callback() and notifying the completion only when the transfer status is DMA_COMPLETE or DMA_ERROR. Furthermore, in pci_epf_test_data_transfer(), be paranoid and check again the transfer status and always call dmaengine_terminate_sync() before returning. Link: https://lore.kernel.org/r/20230415023542.77601-5-dlemoal@kernel.org Fixes: 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities") Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam Cc: stable@vger.kernel.org commit 4aca56f8eae8aa44867ddd6aa107e06f7613226f Author: Damien Le Moal Date: Sat Apr 15 11:35:28 2023 +0900 PCI: epf-test: Fix DMA transfer completion initialization Reinitialize the transfer_complete DMA transfer completion before calling tx_submit(), to avoid seeing the DMA transfer complete before the completion is initialized, thus potentially losing the completion notification. Link: https://lore.kernel.org/r/20230415023542.77601-4-dlemoal@kernel.org Fixes: 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities") Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam Cc: stable@vger.kernel.org commit f6ec33979e9ae7fcc2b5582bd3bfdfaa1fc98a78 Author: Damien Le Moal Date: Sat Apr 15 11:35:27 2023 +0900 PCI: endpoint: Move pci_epf_type_add_cfs() code pci_epf_type_add_cfs() is called only from pci_ep_cfs_add_type_group() in drivers/pci/endpoint/pci-ep-cfs.c, so there is no need to export this function. Move its code from pci-epf-core.c to pci-ep-cfs.c as a static function. Link: https://lore.kernel.org/r/20230415023542.77601-3-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 70b3740f2c1941e2006d61539131b70d20cba9a6 Author: Damien Le Moal Date: Sat Apr 15 11:35:26 2023 +0900 PCI: endpoint: Automatically create a function specific attributes group A PCI endpoint function driver can define function specific attributes under its function configfs directory using the add_cfs() endpoint driver operation. This is done by tying up the mkdir operation for the function configfs directory to a call to the add_cfs() operation. However, there are no checks preventing the user from repeatedly creating function specific attribute directories with different names, resulting in the same endpoint specific attributes group being added multiple times, which also result in an invalid reference counting for the attribute groups. E.g., using the pci-epf-ntb function driver as an example, the user creates the function as follows: $ modprobe pci-epf-ntb $ cd /sys/kernel/config/pci_ep/functions/pci_epf_ntb $ mkdir func0 $ tree func0 func0/ |-- baseclass_code |-- cache_line_size |-- ... `-- vendorid $ mkdir func0/attrs $ tree func0 func0/ |-- attrs | |-- db_count | |-- mw1 | |-- mw2 | |-- mw3 | |-- mw4 | |-- num_mws | `-- spad_count |-- baseclass_code |-- cache_line_size |-- ... `-- vendorid At this point, the function can be started by linking the EP controller. However, if the user mistakenly creates again a directory: $ mkdir func0/attrs2 $ tree func0 func0/ |-- attrs | |-- db_count | |-- mw1 | |-- mw2 | |-- mw3 | |-- mw4 | |-- num_mws | `-- spad_count |-- attrs2 | |-- db_count | |-- mw1 | |-- mw2 | |-- mw3 | |-- mw4 | |-- num_mws | `-- spad_count |-- baseclass_code |-- cache_line_size |-- ... `-- vendorid The endpoint function specific attributes are duplicated and cause a crash when the endpoint function device is torn down: refcount_t: addition on 0; use-after-free. WARNING: CPU: 2 PID: 834 at lib/refcount.c:25 refcount_warn_saturate+0xc8/0x144 CPU: 2 PID: 834 Comm: rmdir Not tainted 6.3.0-rc1 #1 Hardware name: Pine64 RockPro64 v2.1 (DT) pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) ... Call trace: refcount_warn_saturate+0xc8/0x144 config_item_get+0x7c/0x80 configfs_rmdir+0x17c/0x30c vfs_rmdir+0x8c/0x204 do_rmdir+0x158/0x184 __arm64_sys_unlinkat+0x64/0x80 invoke_syscall+0x48/0x114 ... Fix this by modifying pci_epf_cfs_work() to execute the new function pci_ep_cfs_add_type_group() which itself calls pci_epf_type_add_cfs() to obtain the function specific attribute group and the group name (directory name) from the endpoint function driver. If the function driver defines an attribute group, pci_ep_cfs_add_type_group() then proceeds to register this group using configfs_register_group(), thus automatically exposing the function type specific configfs attributes to the user. E.g.: $ modprobe pci-epf-ntb $ cd /sys/kernel/config/pci_ep/functions/pci_epf_ntb $ mkdir func0 $ tree func0 func0/ |-- baseclass_code |-- cache_line_size |-- ... |-- pci_epf_ntb.0 | |-- db_count | |-- mw1 | |-- mw2 | |-- mw3 | |-- mw4 | |-- num_mws | `-- spad_count |-- primary |-- ... `-- vendorid With this change, there is no need for the user to create or delete directories in the endpoint function attributes directory. The pci_epf_type_group_ops group operations are thus removed. Also update the documentation for the pci-epf-ntb and pci-epf-vntb function drivers to reflect this change, removing the explanations showing the need to manually create the sub-directory for the function specific attributes. Link: https://lore.kernel.org/r/20230415023542.77601-2-dlemoal@kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 37587673cda963ec950e4983db5023802f9b5ff2 Author: Shunsuke Mie Date: Thu Feb 2 19:38:32 2023 +0900 PCI: endpoint: Fix a Kconfig prompt of vNTB driver vNTB driver and NTB driver have same Kconfig prompt. Changed to make it distinguishable. Link: https://lore.kernel.org/r/20230202103832.2038286-1-mie@igel.co.jp Fixes: e35f56bb0330 ("PCI: endpoint: Support NTB transfer between RC and EP") Signed-off-by: Shunsuke Mie Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 1af3d0a8e8b8db855ee3c98d210f8ee01b2bb80f Author: Evan Quan Date: Thu Jun 15 11:03:49 2023 +0800 drm/amd/pm: update the LC_L1_INACTIVITY setting to address possible noise issue It is proved that insufficient LC_L1_INACTIVITY setting can cause audio noise on some platform. With the LC_L1_INACTIVITY increased to 4ms, the issue can be resolved. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 111c1813a1ab70d5422594aec0fd5a5ba914c25e Author: Aric Cyr Date: Sun Jun 11 20:14:20 2023 -0400 drm/amd/display: 3.2.240 This version brings along the following: - DCN314 fixes - DCN32x fixes - New fast update sequence enablement - DC mode clock switching enablement for DCN32x - DP link loss fix - New debugfs entry to set MST link settings Acked-by: Hamza Mahfooz Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 12a6e62bfdcad8be49644b6dcf70c15e0e6bab6b Author: Alvin Lee Date: Fri Jun 9 20:32:57 2023 -0400 drm/amd/display: Enable dc mode clock switching for DCN32x - DC mode clock switch interface was previously only executed for DCN303. Enable it for DCN32x so that the interface is called correctly - Assign function pointers for DCN32x that are used in the dc mode interface - Update the dc mode interface to work generically for each ASIC - In update_clocks, make sure to consider softmax if we're in DC mode Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit ed83fe2abcace898fdec5c2ba0455703178ac9a3 Author: Ilya Bakoulin Date: Wed Jun 7 16:49:45 2023 -0400 drm/amd/display: Fix 128b132b link loss handling [Why] We don't check 128b132b-specific bits in LANE_ALIGN_STATUS_UPDATED DPCD registers when parsing link loss status, which can cause us to miss a link loss notification from some sinks. [How] Add a 128b132b-specific status bit check. Cc: stable@vger.kernel.org # 6.3+ Reviewed-by: Wenjing Liu Acked-by: Hamza Mahfooz Signed-off-by: Ilya Bakoulin Signed-off-by: Alex Deucher commit effee878a8661d7f4f497304ecf256e4b1790d1e Author: Dmytro Laktyushkin Date: Thu Jun 8 10:44:42 2023 -0400 drm/amd/display: fix odm k2 div calculation Correct setting is div by 2 for odm. Seamless odm transitions are enabled with enable_dp_dig_pixel_rate_div_policy debug flag. Fixes: a2c7356f526d ("drm/amd/display: fix pixel rate update sequence") Reviewed-by: Nicholas Kazlauskas Acked-by: Hamza Mahfooz Signed-off-by: Dmytro Laktyushkin Signed-off-by: Alex Deucher commit 0250a7145e9c44c9f60d14aed7b66ed3a9de07f9 Author: Fangzhi Zuo Date: Tue Jun 6 09:57:30 2023 -0400 drm/amd/display: Add MST Preferred Link Setting Entry When using debugfs to change MST link settings, we need to wait until the next stream update to apply the preferred link setting. So, trigger a hotplug event right after the preferred link setting is applied. Reviewed-by: Wayne Lin Acked-by: Hamza Mahfooz Signed-off-by: Fangzhi Zuo Signed-off-by: Alex Deucher commit 26518b39181876064850209ecdab48c0ee5924b1 Author: Leo Chen Date: Thu Jun 8 16:37:38 2023 -0400 drm/amd/display: disable seamless boot if force_odm_combine is enabled [Why & How] Having seamless boot on while forcing debug option ODM combine 2 to 1 will cause some corruptions because of some missing programmings. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Nicholas Kazlauskas Acked-by: Hamza Mahfooz Signed-off-by: Leo Chen Signed-off-by: Alex Deucher commit 2bf0ce3bec8b22e4bac828aeaeade15884fa0f5c Author: Austin Zheng Date: Wed Jun 7 12:20:38 2023 -0400 drm/amd/display: Disable DC Mode Capping On DCN321 Why: Limiting clocks to DC mode max results in some display modes to no longer be supported How: Disable the path that limits the clock values Fixes: 3b718dcaf163 ("drm/amd/display: Filter out AC mode frequencies on DC mode systems") Reviewed-by: Martin Leung Acked-by: Hamza Mahfooz Signed-off-by: Austin Zheng Signed-off-by: Alex Deucher commit 724617b94bd657d71f980c5bfe2d429fc0acc27b Author: Alvin Lee Date: Tue Jun 6 17:51:32 2023 -0400 drm/amd/display: enable the new fast update path for supported ASICs The new fast update sequence is now supported on some ASICs. So, enable it by default for all applicable ASICs. Reviewed-by: Samson Tam Acked-by: Hamza Mahfooz Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 873bbf2da278f253df9fa78acb8df83fb05c7c52 Author: Alvin Lee Date: Wed Jun 7 17:17:59 2023 -0400 drm/amd/display: Clear update flags at end of flip Clear update flags so the next flip does not have any redundant programming (if a subsequent flip does not have a stream or plane update, the update flags are not cleared). Fixes: 0baae6246307 ("drm/amd/display: Refactor fast update to use new HWSS build sequence") Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit c8f293541810e2542c5cbf082b7f7c2c2eaa47a8 Author: Alvin Lee Date: Wed Jun 7 16:30:28 2023 -0400 drm/amd/display: Fix pipe check condition for manual trigger Condition for programming manually trigger used the wrong pipe (always used top pipe instead of the one we are iterating through). Fixes: 0baae6246307 ("drm/amd/display: Refactor fast update to use new HWSS build sequence") Reviewed-by: Samson Tam Acked-by: Hamza Mahfooz Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 4a87495a82add04d57bef1d58dd0b55f10684ee0 Author: Sridevi Arvindekar Date: Tue May 30 17:41:12 2023 -0400 drm/amd/display: add missing ABM registers [Why] We are currently missing some ABM registers. [How] Add the missing registers to dce_abm.h. Reviewed-by: Jun Lei Reviewed-by: Chris Park Acked-by: Hamza Mahfooz Signed-off-by: Sridevi Arvindekar Signed-off-by: Alex Deucher commit c5f78ea8d768ce6f4471b0921728c2bd2dd95d93 Author: Austin Zheng Date: Mon Jun 5 18:17:23 2023 -0400 drm/amd/display: Add Clock Table Entry With Max DC Values Why: Certain display configs resulted in underflow How: Add an entry containing all max DC clock timings Reviewed-by: Alvin Lee Acked-by: Hamza Mahfooz Signed-off-by: Austin Zheng Signed-off-by: Alex Deucher commit 0f48a4b83610cb0e4e0bc487800ab69f51b4aca6 Author: Sung-huai Wang Date: Tue Jun 6 14:28:38 2023 +0800 drm/amd/display: add a NULL pointer check [Why & How] We have to check if stream is properly initialized before calling find_matching_pll(), otherwise we might end up trying to deferecence a NULL pointer. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Nicholas Kazlauskas Acked-by: Hamza Mahfooz Signed-off-by: Sung-huai Wang Signed-off-by: Alex Deucher commit a99a4ff6ef205d125002fc7e0857074e4e6597b6 Author: Daniel Miess Date: Wed May 31 11:47:35 2023 -0400 Partially revert "drm/amd/display: Fix possible underflow for displays with large vblank" This partially reverts commit de231189e7bf ("drm/amd/display: Fix possible underflow for displays with large vblank"). [Why] The increased value of VBlankNomDefaultUS causes underflow at the desktop of an IP KVM setup [How] Change the value from 800 back to 668 Reviewed-by: Nicholas Kazlauskas Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Daniel Miess Signed-off-by: Alex Deucher commit bf0097c5c9aec528da75e2b5fcede472165322bb Author: Daniel Miess Date: Wed Jun 7 16:24:08 2023 +0800 Revert "drm/amd/display: Move DCN314 DOMAIN power control to DMCUB" This reverts commit e383b12709e32d6494c948422070c2464b637e44. Controling hubp power gating using the DMCUB isn't stable so we are reverting this change to move control back into the driver. Cc: stable@vger.kernel.org # 6.3+ Reviewed-by: Nicholas Kazlauskas Acked-by: Hamza Mahfooz Signed-off-by: Daniel Miess Signed-off-by: Alex Deucher commit 85e41f1ed5d94a26fe4e57003c399936d291ed70 Author: Daniel Miess Date: Wed Jun 7 11:11:44 2023 -0400 drm/amd/display: disable RCO for DCN314 [Why] RCO is causing error messages on some DCN314 systems [How] Force disable RCO for DCN314 Fixes: 17fbdbda9cc8 ("drm/amd/display: Enable dcn314 DPP RCO") Reviewed-by: Nicholas Kazlauskas Acked-by: Hamza Mahfooz Signed-off-by: Daniel Miess Signed-off-by: Alex Deucher commit 65dae8ff4c7d5dde1016d1736c6740a0f80e68e3 Author: Daniel Miess Date: Wed Jun 14 13:09:14 2023 -0400 drm/amd/display: disable power gating for DCN314 [Why] Power gating is causing error messages on some DCN314 systems [How] Force disable power gating for DCN314 Fixes: 4cc1cebe08bf ("drm/amd/display: Re-enable DPP/HUBP Power Gating") Reviewed-by: Nicholas Kazlauskas Acked-by: Hamza Mahfooz Signed-off-by: Daniel Miess Signed-off-by: Alex Deucher commit acbe761046628cbd5da03a4af84e8831c2afb8f2 Author: Zhigang Luo Date: Thu May 18 16:01:31 2023 -0400 drm/amdgpu: Skip TMR for MP0_HWIP 13.0.6 For SRIOV VF, no TMR needed. Reviewed-by: Alex Deucher Signed-off-by: Zhigang Luo Signed-off-by: Alex Deucher commit 44762718b391b5ad7bd226a7a3badfb93248ad3b Author: Nathan Chancellor Date: Thu Jun 15 10:06:09 2023 -0700 drm/amdgpu: Move clocks closer to its only usage in amdgpu_parse_cg_state() After commit 8020f0f9316b ("drm/amd/amdgpu: enable W=1 for amdgpu"), there is an instance of -Wunused-const-variable when CONFIG_DEBUG_FS is disabled: drivers/gpu/drm/amd/amdgpu/../pm/amdgpu_pm.c:38:34: error: unused variable 'clocks' [-Werror,-Wunused-const-variable] 38 | static const struct cg_flag_name clocks[] = { | ^ 1 error generated. clocks is only used when CONFIG_DEBUG_FS is set, so move the definition into the CONFIG_DEBUG_FS block right above its only usage to clear up the warning. Signed-off-by: Nathan Chancellor Signed-off-by: Alex Deucher commit fd21987274463a439c074b8f3c93d3b132e4c031 Author: Evan Quan Date: Thu Jun 15 10:56:55 2023 +0800 drm/amd/pm: revise the ASPM settings for thunderbolt attached scenario Also, correct the comment for NAVI10_PCIE__LC_L1_INACTIVITY_TBT_DEFAULT as 0x0000000E stands for 400ms instead of 4ms. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ea2c3c08554601b051d91403a241266e1cf490a5 Author: Samuel Pitoiset Date: Fri Jun 16 15:14:07 2023 +0200 drm/amdgpu: fix clearing mappings for BOs that are always valid in VM Per VM BOs must be marked as moved or otherwise their ranges are not updated on use which might be necessary when the replace operation splits mappings. This fixes random GPU hangs when replacing sparse mappings from the userspace, while OP_MAP/OP_UNMAP works fine because always valid BOs are correctly handled there. Cc: stable@vger.kernel.org Signed-off-by: Samuel Pitoiset Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 03d400e7605e3d36abd3f949b25ba806cccff0cb Author: Alex Sierra Date: Thu Jun 15 10:37:21 2023 -0500 drm/amdkfd: set coherent host access capability flag This flag determines whether the host possesses coherent access to the memory of the device. Signed-off-by: Alex Sierra Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 184d83848242b2465b466a0a8e6eb58f1df10407 Author: Lijo Lazar Date: Thu Jun 15 14:13:23 2023 +0530 drm/amdgpu: Add vbios attribute only if supported Not all devices carry VBIOS version information. Add the device attribute only if supported. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit c09b3bf7363db982b17950b8e4f27b0564817301 Author: Alex Deucher Date: Wed Jun 7 12:43:30 2023 -0400 drm/amdgpu/atomfirmware: fix LPDDR5 width reporting LPDDR5 channels are 32 bit rather than 64, report the width properly in the log. v2: Only LPDDR5 are 32 bits per channel. DDR5 is 64 bits per channel Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2468 Acked-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4e3f85d1c071ed174aa5a7477d499d576412df3b Author: Nathan Chancellor Date: Thu Jun 15 10:06:08 2023 -0700 drm/amdgpu: Remove CONFIG_DEBUG_FS guard around body of amdgpu_rap_debugfs_init() After commit 8020f0f9316b ("drm/amd/amdgpu: enable W=1 for amdgpu"), there is an instance of -Wunused-const-variable when CONFIG_DEBUG_FS is disabled: drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c:110:37: error: unused variable 'amdgpu_rap_debugfs_ops' [-Werror,-Wunused-const-variable] 110 | static const struct file_operations amdgpu_rap_debugfs_ops = { | ^ 1 error generated. There is no reason for the body of this function to be guarded when CONFIG_DEBUG_FS is disabled, as debugfs_create_file() is a stub that just returns an error pointer in that situation. Remove the preprocessor guards so that the variable never appears unused, while not changing anything at run time. Signed-off-by: Nathan Chancellor Signed-off-by: Alex Deucher commit 3ec61983aae0acbffbd5c22d83b2019f5c0eb516 Author: Mingtong Bao Date: Wed Jun 14 10:19:08 2023 +0800 drm/amd/pm: remove unneeded variable fix the following coccicheck warning: drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c:1657:14-18: Unneeded variable: "size". Signed-off-by: Mingtong Bao Signed-off-by: Alex Deucher commit 025654ae429112aabf6875870c06d6a7ee475104 Author: Lijo Lazar Date: Wed Jun 14 09:46:49 2023 +0530 drm/amdgpu: Move calculation of xcp per memory node Its value is required for finding the memory id of xcp. Fixes: d26ea1b346e7 ("drm/amdgpu: Add xcp manager num_xcp_per_mem_partition") Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ef3c36a6e025e9b16ca3321479ba016841fa17a0 Author: Jiadong Zhu Date: Thu Jun 15 19:10:57 2023 +0800 drm/amdgpu: Skip mark offset for high priority rings Only low priority rings are using chunks to save the offset. Bypass the mark offset callings from high priority rings. Signed-off-by: Jiadong Zhu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 1ff310b97f82437237a1d779195b0d90b90da070 Author: Wang Ming Date: Wed Jun 14 11:49:23 2023 +0800 amd/display/dc: remove repeating expression Identify issues that arise by using the tests/doubletest.cocci semantic patch. Need to remove duplicate expression in if statement. Signed-off-by: Wang Ming Reviewed-by: Ammar Faizi Signed-off-by: Alex Deucher commit 29e4c95faee52a9b7a4f1293cb92cd17a0b5fd91 Author: Jiri Pirko Date: Thu Jun 1 09:17:17 2023 +0200 net/mlx5: Remove pointless vport lookup from mlx5_esw_check_port_type() As xa_get_mark() returns false in case the entry is not present, no need to redundantly check if vport is present. Remove the lookup. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 899862b653d74ed5fc3a61cd5e14a88b824a71d7 Author: Jiri Pirko Date: Wed May 31 15:11:07 2023 +0200 net/mlx5: Remove redundant check from mlx5_esw_query_vport_vhca_id() Since mlx5_esw_query_vport_vhca_id() could be called either from mlx5_esw_vport_enable() or mlx5_esw_vport_disable() where the the check is done, this is always false here. Remove the redundant check. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 0d0946d6488e785c30a0c4fce4cf21dc7da6dc1f Author: Jiri Pirko Date: Thu Jun 1 13:15:12 2023 +0200 net/mlx5: Remove redundant is_mdev_switchdev_mode() check from is_ib_rep_supported() is_mdev_switchdev_mode() check is done in is_eth_rep_supported(). Function is_ib_rep_supported() calls is_eth_rep_supported(). Remove the redundant check from it. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 61955da523d93b4d89f45f84dc6ce9d44ced7bae Author: Jiri Pirko Date: Thu Jun 1 13:12:37 2023 +0200 net/mlx5: Remove redundant MLX5_ESWITCH_MANAGER() check from is_ib_rep_supported() MLX5_ESWITCH_MANAGER() check is done in is_eth_rep_supported(). Function is_ib_rep_supported() calls is_eth_rep_supported(). Remove the redundant check from it. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 15ddd72ee323cf4b7012dc8e002ebb812f92e11f Author: Roi Dayan Date: Mon May 29 09:32:57 2023 +0300 net/mlx5e: E-Switch, Fix shared fdb error flow On error flow resources being freed in esw_master_egress_destroy_resources() but pointers not being set to null if error flow is from creating a bounce rule. Then in esw_acl_egress_ofld_cleanup() we try to access already freed pointers. Fix it by resetting the pointers to null. Also if error is from creating a second or later bounce rule then the flow group and table being used and cannot and should not be freed. Add a check to destroy the flow group and table if there are no bounce rules. mlx5_core.sf mlx5_core.sf.2: mlx5_destroy_flow_group:2306:(pid 2235): Flow group 4 wasn't destroyed, refcount > 1 mlx5_core.sf mlx5_core.sf.2: mlx5_destroy_flow_table:2295:(pid 2235): Flow table 3 wasn't destroyed, refcount > 1 Fixes: 5e0202eb49ed ("net/mlx5: E-switch, Handle multiple master egress rules") Signed-off-by: Roi Dayan Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit ae4de894931d37ff12405db29ca3a2395d3a0449 Author: Roi Dayan Date: Mon May 29 09:24:54 2023 +0300 net/mlx5e: Remove redundant comment The function comment says what it is and the comment is redundant. Signed-off-by: Roi Dayan Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 4575ab3b7de04813400acf989ca7f26dd7e29c59 Author: Roi Dayan Date: Sun May 28 17:10:43 2023 +0300 net/mlx5e: E-Switch, Pass other_vport flag if vport is not 0 When creating flow table for shared fdb resources, there is only need to pass other_vport flag if vport is not 0 or if the port is ECPF in BlueField. Signed-off-by: Roi Dayan Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 70c36438393546be0bbfd001d043a08e8ff611e9 Author: Roi Dayan Date: Sun May 28 12:11:47 2023 +0300 net/mlx5e: E-Switch, Use xarray for devcom paired device index To allow devcom events on E-Switch that is not a vport group manager, use vhca id as an index instead of device index which might be shared between several E-Switches. for example SF and its PF. Signed-off-by: Roi Dayan Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 1552e9b51810761881f7438d26c9b2dad171e423 Author: Roi Dayan Date: Sun May 28 12:10:26 2023 +0300 net/mlx5e: E-Switch, Add peer fdb miss rules for vport manager or ecpf Add peer fdb rules for E-Switch that are vport managers or ecpf device. It is not needed for other devices. Signed-off-by: Roi Dayan Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 1da9f36252d4852205a1990f003549d753320e8c Author: Roi Dayan Date: Sun May 28 10:58:03 2023 +0300 net/mlx5e: Use vhca_id for device index in vport rx rules Device index is like PF index and limited to max physical ports. For example, SFs created under PF the device index is the PF device index. Use vhca_id which gets the FW index per vport, for vport rx rules and vport pair events. Signed-off-by: Roi Dayan Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 8ec91f5d077c09e72e4e11d701a83eb1f1504ea3 Author: Roi Dayan Date: Tue May 23 12:02:06 2023 +0300 net/mlx5: Lag, Remove duplicate code checking lag is supported Remove duplicate function for checking if device has lag support. Signed-off-by: Roi Dayan Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 690ad62fc6e445cc371e625fe2016e62c3793a0f Author: Dan Carpenter Date: Tue Jun 20 16:43:07 2023 +0300 net/mlx5: Fix error code in mlx5_is_reset_now_capable() The mlx5_is_reset_now_capable() function returns bool, not negative error codes. So if fast teardown is not supported it should return false instead of -EOPNOTSUPP. Fixes: 92501fa6e421 ("net/mlx5: Ack on sync_reset_request only if PF can do reset_now") Signed-off-by: Dan Carpenter Reviewed-by: Kalesh AP Signed-off-by: Saeed Mahameed commit 9ee473c259de393718ae1c6fdd51271d5d087c4b Author: Lama Kayal Date: Mon Jun 12 16:34:43 2023 +0300 net/mlx5: Fix reserved at offset in hca_cap register A member of struct mlx5_ifc_cmd_hca_cap_bits has been mistakenly assigned the wrong reserved_at offset value. Correct it to align to the right value, thus avoid future miscalculation. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Reviewed-by: Rahul Rameshbabu Signed-off-by: Saeed Mahameed commit 25c24801d7da8f9cb088bc0ad5947d2e84035411 Author: Shay Drory Date: Mon Jun 19 07:42:07 2023 +0300 net/mlx5: Fix SFs kernel documentation error Indent SFs probe code example in order to fix the below error: Documentation/networking/device_drivers/ethernet/mellanox/mlx5/switchdev.rst:57: ERROR: Unexpected indentation. Documentation/networking/device_drivers/ethernet/mellanox/mlx5/switchdev.rst:61: ERROR: Unexpected indentation. Fixes: e71383fb9cd1 ("net/mlx5: Light probe local SFs") Signed-off-by: Shay Drory Reviewed-by: Rahul Rameshbabu Signed-off-by: Saeed Mahameed Reviewed-by: Moshe Shemesh Reviewed-by: Automatic Verification Reviewed-by: Gal Pressman commit da744fd1362cd8ccf71043c62825cb88cb946886 Author: Shay Drory Date: Wed Jun 14 16:26:07 2023 +0300 net/mlx5: Fix UAF in mlx5_eswitch_cleanup() mlx5_eswitch_cleanup() is using esw right after freeing it for releasing devlink_param. Fix it by releasing the devlink_param before freeing the esw, and adjust the create function accordingly. Fixes: 3f90840305e2 ("net/mlx5: Move esw multiport devlink param to eswitch code") Reported-by: Dan Carpenter Signed-off-by: Shay Drory Reviewed-by: Automatic Verification Reviewed-by: Gal Pressman Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit c36591f6828b00f01e0b54ccacd603e55cdc45d0 Merge: fcaa174a9c995 a8d5fdd4d2702 Author: Jens Axboe Date: Fri Jun 23 11:59:05 2023 -0600 Merge tag 'md-next-20230623' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-6.5/block-late Pull MD fixes from Song. * tag 'md-next-20230623' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: raid10: avoid spin_lock from fastpath from raid10_unplug() md: fix 'delete_mutex' deadlock md: use mddev->external to select holder in export_rdev() md/raid1-10: fix casting from randomized structure in raid1_submit_write() md/raid10: fix the condition to call bio_end_io_acct() commit abc17128c81ae8d6a091f24348c63cbe8fe59724 Merge: f42039d10b0f1 5f0419a0083b3 Author: Catalin Marinas Date: Fri Jun 23 18:34:16 2023 +0100 Merge branch 'for-next/feat_s1pie' into for-next/core * for-next/feat_s1pie: : Support for the Armv8.9 Permission Indirection Extensions (stage 1 only) KVM: selftests: get-reg-list: add Permission Indirection registers KVM: selftests: get-reg-list: support ID register features arm64: Document boot requirements for PIE arm64: transfer permission indirection settings to EL2 arm64: enable Permission Indirection Extension (PIE) arm64: add encodings of PIRx_ELx registers arm64: disable EL2 traps for PIE arm64: reorganise PAGE_/PROT_ macros arm64: add PTE_WRITE to PROT_SECT_NORMAL arm64: add PTE_UXN/PTE_WRITE to SWAPPER_*_FLAGS KVM: arm64: expose ID_AA64MMFR3_EL1 to guests KVM: arm64: Save/restore PIE registers KVM: arm64: Save/restore TCR2_EL1 arm64: cpufeature: add Permission Indirection Extension cpucap arm64: cpufeature: add TCR2 cpucap arm64: cpufeature: add system register ID_AA64MMFR3 arm64/sysreg: add PIR*_ELx registers arm64/sysreg: update HCRX_EL2 register arm64/sysreg: add system registers TCR2_ELx arm64/sysreg: Add ID register ID_AA64MMFR3 commit f42039d10b0f1d0075568df1d64df31f5cc90e92 Merge: dea0f4146f66a 211ceca377f40 c152aed4dcc21 1f9d4ba6839cc 833b0f07b915f 39138093f139c d8a324f102cc8 3e35d303ab7d2 f0d4627f64592 7dae5f086fceb fcea0ccf4fd7f 389ce21b622b0 3927eaff464f1 a0238ada560fc f7a5d72edc522 Author: Catalin Marinas Date: Fri Jun 23 18:32:20 2023 +0100 Merge branches 'for-next/kpti', 'for-next/missing-proto-warn', 'for-next/iss2-decode', 'for-next/kselftest', 'for-next/misc', 'for-next/feat_mops', 'for-next/module-alloc', 'for-next/sysreg', 'for-next/cpucap', 'for-next/acpi', 'for-next/kdump', 'for-next/acpi-doc', 'for-next/doc' and 'for-next/tpidr2-fix', remote-tracking branch 'arm64/for-next/perf' into for-next/core * arm64/for-next/perf: docs: perf: Fix warning from 'make htmldocs' in hisi-pmu.rst docs: perf: Add new description for HiSilicon UC PMU drivers/perf: hisi: Add support for HiSilicon UC PMU driver drivers/perf: hisi: Add support for HiSilicon H60PA and PAv3 PMU driver perf: arm_cspmu: Add missing MODULE_DEVICE_TABLE perf/arm-cmn: Add sysfs identifier perf/arm-cmn: Revamp model detection perf/arm_dmc620: Add cpumask dt-bindings: perf: fsl-imx-ddr: Add i.MX93 compatible drivers/perf: imx_ddr: Add support for NXP i.MX9 SoC DDRC PMU driver perf/arm_cspmu: Decouple APMT dependency perf/arm_cspmu: Clean up ACPI dependency ACPI/APMT: Don't register invalid resource perf/arm_cspmu: Fix event attribute type perf: arm_cspmu: Set irq affinitiy only if overflow interrupt is used drivers/perf: hisi: Don't migrate perf to the CPU going to teardown drivers/perf: apple_m1: Force 63bit counters for M2 CPUs perf/arm-cmn: Fix DTC reset perf: qcom_l2_pmu: Make l2_cache_pmu_probe_cluster() more robust perf/arm-cci: Slightly optimize cci_pmu_sync_counters() * for-next/kpti: : Simplify KPTI trampoline exit code arm64: entry: Simplify tramp_alias macro and tramp_exit routine arm64: entry: Preserve/restore X29 even for compat tasks * for-next/missing-proto-warn: : Address -Wmissing-prototype warnings arm64: add alt_cb_patch_nops prototype arm64: move early_brk64 prototype to header arm64: signal: include asm/exception.h arm64: kaslr: add kaslr_early_init() declaration arm64: flush: include linux/libnvdimm.h arm64: module-plts: inline linux/moduleloader.h arm64: hide unused is_valid_bugaddr() arm64: efi: add efi_handle_corrupted_x18 prototype arm64: cpuidle: fix #ifdef for acpi functions arm64: kvm: add prototypes for functions called in asm arm64: spectre: provide prototypes for internal functions arm64: move cpu_suspend_set_dbg_restorer() prototype to header arm64: avoid prototype warnings for syscalls arm64: add scs_patch_vmlinux prototype arm64: xor-neon: mark xor_arm64_neon_*() static * for-next/iss2-decode: : Add decode of ISS2 to data abort reports arm64/esr: Add decode of ISS2 to data abort reporting arm64/esr: Use GENMASK() for the ISS mask * for-next/kselftest: : Various arm64 kselftest improvements kselftest/arm64: Log signal code and address for unexpected signals kselftest/arm64: Add a smoke test for ptracing hardware break/watch points * for-next/misc: : Miscellaneous patches arm64: alternatives: make clean_dcache_range_nopatch() noinstr-safe arm64: hibernate: remove WARN_ON in save_processor_state arm64/fpsimd: Exit streaming mode when flushing tasks arm64: mm: fix VA-range sanity check arm64/mm: remove now-superfluous ISBs from TTBR writes arm64: consolidate rox page protection logic arm64: set __exception_irq_entry with __irq_entry as a default arm64: syscall: unmask DAIF for tracing status arm64: lockdep: enable checks for held locks when returning to userspace arm64/cpucaps: increase string width to properly format cpucaps.h arm64/cpufeature: Use helper for ECV CNTPOFF cpufeature * for-next/feat_mops: : Support for ARMv8.8 memcpy instructions in userspace kselftest/arm64: add MOPS to hwcap test arm64: mops: allow disabling MOPS from the kernel command line arm64: mops: detect and enable FEAT_MOPS arm64: mops: handle single stepping after MOPS exception arm64: mops: handle MOPS exceptions KVM: arm64: hide MOPS from guests arm64: mops: don't disable host MOPS instructions from EL2 arm64: mops: document boot requirements for MOPS KVM: arm64: switch HCRX_EL2 between host and guest arm64: cpufeature: detect FEAT_HCX KVM: arm64: initialize HCRX_EL2 * for-next/module-alloc: : Make the arm64 module allocation code more robust (clean-up, VA range expansion) arm64: module: rework module VA range selection arm64: module: mandate MODULE_PLTS arm64: module: move module randomization to module.c arm64: kaslr: split kaslr/module initialization arm64: kasan: remove !KASAN_VMALLOC remnants arm64: module: remove old !KASAN_VMALLOC logic * for-next/sysreg: (21 commits) : More sysreg conversions to automatic generation arm64/sysreg: Convert TRBIDR_EL1 register to automatic generation arm64/sysreg: Convert TRBTRG_EL1 register to automatic generation arm64/sysreg: Convert TRBMAR_EL1 register to automatic generation arm64/sysreg: Convert TRBSR_EL1 register to automatic generation arm64/sysreg: Convert TRBBASER_EL1 register to automatic generation arm64/sysreg: Convert TRBPTR_EL1 register to automatic generation arm64/sysreg: Convert TRBLIMITR_EL1 register to automatic generation arm64/sysreg: Rename TRBIDR_EL1 fields per auto-gen tools format arm64/sysreg: Rename TRBTRG_EL1 fields per auto-gen tools format arm64/sysreg: Rename TRBMAR_EL1 fields per auto-gen tools format arm64/sysreg: Rename TRBSR_EL1 fields per auto-gen tools format arm64/sysreg: Rename TRBBASER_EL1 fields per auto-gen tools format arm64/sysreg: Rename TRBPTR_EL1 fields per auto-gen tools format arm64/sysreg: Rename TRBLIMITR_EL1 fields per auto-gen tools format arm64/sysreg: Convert OSECCR_EL1 to automatic generation arm64/sysreg: Convert OSDTRTX_EL1 to automatic generation arm64/sysreg: Convert OSDTRRX_EL1 to automatic generation arm64/sysreg: Convert OSLAR_EL1 to automatic generation arm64/sysreg: Standardise naming of bitfield constants in OSL[AS]R_EL1 arm64/sysreg: Convert MDSCR_EL1 to automatic register generation ... * for-next/cpucap: : arm64 cpucap clean-up arm64: cpufeature: fold cpus_set_cap() into update_cpu_capabilities() arm64: cpufeature: use cpucap naming arm64: alternatives: use cpucap naming arm64: standardise cpucap bitmap names * for-next/acpi: : Various arm64-related ACPI patches ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init() * for-next/kdump: : Simplify the crashkernel reservation behaviour of crashkernel=X,high on arm64 arm64: add kdump.rst into index.rst Documentation: add kdump.rst to present crashkernel reservation on arm64 arm64: kdump: simplify the reservation behaviour of crashkernel=,high * for-next/acpi-doc: : Update ACPI documentation for Arm systems Documentation/arm64: Update ACPI tables from BBR Documentation/arm64: Update references in arm-acpi Documentation/arm64: Update ARM and arch reference * for-next/doc: : arm64 documentation updates Documentation/arm64: Add ptdump documentation * for-next/tpidr2-fix: : Fix the TPIDR2_EL0 register restoring on sigreturn kselftest/arm64: Add a test case for TPIDR2 restore arm64/signal: Restore TPIDR2 register rather than memory state commit f7a5d72edc522b9210521d9b3969eac221eb6ecb Author: Mark Brown Date: Thu Jun 22 14:39:46 2023 +0100 kselftest/arm64: Add a test case for TPIDR2 restore Due to the fact that TPIDR2 is intended to be managed by libc we don't currently test modifying it via the signal context since that might disrupt libc's usage of it and cause instability. We can however test the opposite case with less risk, modifying TPIDR2 in a signal handler and making sure that the original value is restored after returning from the signal handler. Add a test which does this. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230621-arm64-fix-tpidr2-signal-restore-v2-2-c8e8fcc10302@kernel.org Signed-off-by: Catalin Marinas commit 616cb2f4b141852cac3dfffe8354c8bf19e9999d Author: Mark Brown Date: Thu Jun 22 14:39:45 2023 +0100 arm64/signal: Restore TPIDR2 register rather than memory state Currently when restoring the TPIDR2 signal context we set the new value from the signal frame in the thread data structure but not the register, following the pattern for the rest of the data we are restoring. This does not work in the case of TPIDR2, the register always has the value for the current task. This means that either we return to userspace and ignore the new value or we context switch and save the register value on top of the newly restored value. Load the value from the signal context into the register instead. Fixes: 39e54499280f ("arm64/signal: Include TPIDR2 in the signal context") Signed-off-by: Mark Brown Cc: # 6.3.x Link: https://lore.kernel.org/r/20230621-arm64-fix-tpidr2-signal-restore-v2-1-c8e8fcc10302@kernel.org Signed-off-by: Catalin Marinas commit 112a7f9c8edbf76f7cb83856a6cb6b60a210b659 Author: Mario Limonciello Date: Tue Jun 20 09:04:51 2023 -0500 PCI/ACPI: Call _REG when transitioning D-states ACPI r6.5, sec 6.5.4, describes how AML is unable to access an OperationRegion unless _REG has been called to connect a handler: The OS runs _REG control methods to inform AML code of a change in the availability of an operation region. When an operation region handler is unavailable, AML cannot access data fields in that region. (Operation region writes will be ignored and reads will return indeterminate data.) The PCI core does not call _REG at any time, leading to the undefined behavior mentioned in the spec. The spec explains that _REG should be executed to indicate whether a given region can be accessed: Once _REG has been executed for a particular operation region, indicating that the operation region handler is ready, a control method can access fields in the operation region. Conversely, control methods must not access fields in operation regions when _REG method execution has not indicated that the operation region handler is ready. An example included in the spec demonstrates calling _REG when devices are turned off: "when the host controller or bridge controller is turned off or disabled, PCI Config Space Operation Regions for child devices are no longer available. As such, ETH0’s _REG method will be run when it is turned off and will again be run when PCI1 is turned off." It is reported that ASMedia PCIe GPIO controllers fail functional tests after the system has returning from suspend (S3 or s2idle). This is because the BIOS checks whether the OSPM has called the _REG method to determine whether it can interact with the OperationRegion assigned to the device as part of the other AML called for the device. To fix this issue, call acpi_evaluate_reg() when devices are transitioning to D3cold or D0. [bhelgaas: split pci_power_t checking to preliminary patch] Link: https://uefi.org/specs/ACPI/6.5/06_Device_Configuration.html#reg-region Link: https://lore.kernel.org/r/20230620140451.21007-1-mario.limonciello@amd.com Signed-off-by: Mario Limonciello Signed-off-by: Bjorn Helgaas Reviewed-by: Rafael J. Wysocki commit 5557b62634abbd55bab7b154ce4bca348ad7f96f Author: Bjorn Helgaas Date: Wed Jun 21 16:36:12 2023 -0500 PCI/ACPI: Validate acpi_pci_set_power_state() parameter Previously acpi_pci_set_power_state() assumed the requested power state was valid (PCI_D0 ... PCI_D3cold). If a caller supplied something else, we could index outside the state_conv[] array and pass junk to acpi_device_set_power(). Validate the pci_power_t parameter and return -EINVAL if it's invalid. Link: https://lore.kernel.org/r/20230621222857.GA122930@bhelgaas Signed-off-by: Bjorn Helgaas Reviewed-by: Mario Limonciello commit 9e30fd26f43b89cb6b4e850a86caa2e50dedb454 Author: Ondrej Zary Date: Wed Jun 14 09:42:53 2023 +0200 PCI/PM: Avoid putting EloPOS E2/S2/H2 PCIe Ports in D3cold The quirk for Elo i2 introduced in commit 92597f97a40b ("PCI/PM: Avoid putting Elo i2 PCIe Ports in D3cold") is also needed by EloPOS E2/S2/H2 which uses the same Continental Z2 board. Change the quirk to match the board instead of system. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215715 Link: https://lore.kernel.org/r/20230614074253.22318-1-linux@zary.sk Signed-off-by: Ondrej Zary Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 488833ccdcac118da16701f4ee0673b20ba47fe3 Merge: 91afbaafd6b1f 1ffe6ddc5c64f Author: Palmer Dabbelt Date: Thu Jun 22 14:23:56 2023 -0700 Merge patch series "dt-bindings: riscv: cpus: switch to unevaluatedProperties: false" Conor Dooley says: From: Conor Dooley Do the various bits needed to drop the additionalProperties: true that we currently have in riscv/cpu.yaml, to permit actually enforcing what people put in cpus nodes. * b4-shazam-merge: dt-bindings: riscv: cpus: switch to unevaluatedProperties: false dt-bindings: riscv: cpus: add a ref the common cpu schema Link: https://lore.kernel.org/r/20230615-creamer-emu-ade0fa0bdb68@spud Signed-off-by: Palmer Dabbelt commit 91afbaafd6b1f1846520efd2b158066a25a1a316 Author: Song Shuai Date: Fri Jun 9 15:50:48 2023 +0800 riscv: hibernate: remove WARN_ON in save_processor_state During hibernation or restoration, freeze_secondary_cpus checks num_online_cpus via BUG_ON, and the subsequent save_processor_state also does the checking with WARN_ON. In the case of CONFIG_PM_SLEEP_SMP=n, freeze_secondary_cpus is not defined, but the sole possible condition to disable CONFIG_PM_SLEEP_SMP is !SMP where num_online_cpus is always 1. We also don't have to check it in save_processor_state. So remove the unnecessary checking in save_processor_state. Fixes: c0317210012e ("RISC-V: Add arch functions to support hibernation/suspend-to-disk") Signed-off-by: Song Shuai Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230609075049.2651723-4-songshuaishuai@tinylab.org Signed-off-by: Palmer Dabbelt commit b5e13f3ace78a8159dbad92bb005090a431e36d7 Merge: 42b89447b6586 a7555f6b62e7f Author: Palmer Dabbelt Date: Thu Jun 22 10:38:39 2023 -0700 Merge patch series "riscv: Add independent irq/softirq stacks support" guoren@kernel.org says: From: Guo Ren This patch series adds independent irq/softirq stacks to decrease the press of the thread stack. Also, add a thread STACK_SIZE config for users to adjust the proper size during compile time. * b4-shazam-merge: riscv: stack: Add config of thread stack size riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK riscv: stack: Support HAVE_IRQ_EXIT_ON_IRQ_STACK Link: https://lore.kernel.org/r/20230614013018.2168426-1-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 42b89447b65863904eaf802ee05b55a238eac538 Merge: ee95b88d71b9c 07edc32779e3d Author: Palmer Dabbelt Date: Wed Jun 21 07:49:09 2023 -0700 Merge patch series "ISA string parser cleanups" Conor Dooley says: From: Conor Dooley Here are some bits that were discussed with Drew on the "should we allow caps" threads that I have now created patches for: - splitting of riscv_of_processor_hartid() into two distinct functions, one for use purely during early boot, prior to the establishment of the possible-cpus mask & another to fit the other current use-cases - that then allows us to then completely skip some validation of the hartid in the parser - the biggest diff in the series is a rework of the comments in the parser, as I have mostly found the existing (sparse) ones to not be all that helpful whenever I have to go back and look at it - from writing the comments, I found a conditional doing a bit of a dance that I found counter-intuitive, so I've had a go at making that match what I would expect a little better - `i` implies 4 other extensions, so add them as extensions and set them for the craic. Sure why not like... * b4-shazam-merge: RISC-V: always report presence of extensions formerly part of the base ISA dt-bindings: riscv: explicitly mention assumption of Zicntr & Zihpm support RISC-V: remove decrement/increment dance in ISA string parser RISC-V: rework comments in ISA string parser RISC-V: validate riscv,isa at boot, not during ISA string parsing RISC-V: split early & late of_node to hartid mapping RISC-V: simplify register width check in ISA string parsing Link: https://lore.kernel.org/r/20230607-audacity-overhaul-82bb867a825f@spud Signed-off-by: Palmer Dabbelt commit cf431a5998326a0468532a188a188ac2c8e9c55d Merge: efd2ed9351efe ad5c18c75d2a1 Author: Miquel Raynal Date: Fri Jun 23 19:02:09 2023 +0200 Merge branch 'nand/next' into mtd/next commit a8d5fdd4d2702d0c7ec125bd3bbce3fc589afa67 Author: Yu Kuai Date: Wed Jun 21 18:57:28 2023 +0800 raid10: avoid spin_lock from fastpath from raid10_unplug() Commit 0c0be98bbe67 ("md/raid10: prevent unnecessary calls to wake_up() in fast path") missed one place, for example, with: fio -direct=1 -rw=write/randwrite -iodepth=1 ... Plug and unplug are called for each io, then wake_up() from raid10_unplug() will cause lock contention as well. Avoid this contention by using wake_up_barrier() instead of wake_up(), where spin_lock is not held if waitqueue is empty. Fio test script: [global] name=random reads and writes ioengine=libaio direct=1 readwrite=randrw rwmixread=70 iodepth=64 buffered=0 filename=/dev/md0 size=1G runtime=30 time_based randrepeat=0 norandommap refill_buffers ramp_time=10 bs=4k numjobs=400 group_reporting=1 [job1] Test result with ramdisk raid10(By Ali): Before this patch With this patch READ IOPS=2033k IOPS=3642k WRITE IOPS=871k IOPS=1561K By the way, in this scenario, blk_plug_cb() will be allocated and freed for each io, this seems need to be optimized as well. Reported-and-tested-by: Ali Gholami Rudi Closes: https://lore.kernel.org/all/20231606122233@laper.mirepesht/ Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230621105728.1268542-1-yukuai1@huaweicloud.com commit 4934b6401a812f9fe368e7d2d091cd1d120ea262 Author: Yu Kuai Date: Wed Jun 21 22:29:33 2023 +0800 md: fix 'delete_mutex' deadlock Commit 3ce94ce5d05a ("md: fix duplicate filename for rdev") introduce a new lock 'delete_mutex', and trigger a new deadlock: t1: remove rdev t2: sysfs writer rdev_attr_store rdev_attr_store mddev_lock state_store md_kick_rdev_from_array lock delete_mutex list_add mddev->deleting unlock delete_mutex mddev_unlock mddev_lock ... lock delete_mutex kobject_del // wait for sysfs writers to be done mddev_unlock lock delete_mutex // wait for delete_mutex, deadlock 'delete_mutex' is used to protect the list 'mddev->deleting', turns out that this list can be protected by 'reconfig_mutex' directly, and this lock can be removed. Fix this problem by removing the lock, and use 'reconfig_mutex' to protect the list. mddev_unlock() will move this list to a local list to be handled after 'reconfig_mutex' is dropped. Fixes: 3ce94ce5d05a ("md: fix duplicate filename for rdev") Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230621142933.1395629-1-yukuai1@huaweicloud.com commit a1d7671910965ca9f8f0377e7e3bfd1179fba4d8 Author: Song Liu Date: Fri Jun 16 22:24:04 2023 -0700 md: use mddev->external to select holder in export_rdev() mdadm test "10ddf-create-fail-rebuild" triggers warnings like the following [ 215.526357] ------------[ cut here ]------------ [ 215.527243] WARNING: CPU: 18 PID: 1264 at block/bdev.c:617 blkdev_put+0x269/0x350 [ 215.528334] Modules linked in: [ 215.528806] CPU: 18 PID: 1264 Comm: mdmon Not tainted 6.4.0-rc2+ #768 [ 215.529863] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS [ 215.531464] RIP: 0010:blkdev_put+0x269/0x350 [ 215.532167] Code: ff ff 49 8d 7d 10 e8 56 bf b8 ff 4d 8b 65 10 49 8d bc 24 58 05 00 00 e8 05 be b8 ff 41 83 ac 24 58 05 00 00 01 e9 44 ff ff ff <0f> 0b e9 52 fe ff ff 0f 0b e9 6b fe ff ff1 [ 215.534780] RSP: 0018:ffffc900040bfbf0 EFLAGS: 00010283 [ 215.535635] RAX: ffff888174001000 RBX: ffff88810b1c3b00 RCX: ffffffff819a4061 [ 215.536645] RDX: dffffc0000000000 RSI: dffffc0000000000 RDI: ffff88810b1c3ba0 [ 215.537657] RBP: ffff88810dbde800 R08: fffffbfff0fca983 R09: fffffbfff0fca983 [ 215.538674] R10: ffffc900040bfbf0 R11: fffffbfff0fca982 R12: ffff88810b1c3b38 [ 215.539687] R13: ffff88810b1c3b10 R14: ffff88810dbdecb8 R15: ffff88810b1c3b00 [ 215.540833] FS: 00007f2aabdff700(0000) GS:ffff888dfb400000(0000) knlGS:0000000000000000 [ 215.541961] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 215.542775] CR2: 00007fa19a85d934 CR3: 000000010c076006 CR4: 0000000000370ee0 [ 215.543814] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 215.544840] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 215.545885] Call Trace: [ 215.546257] [ 215.546608] export_rdev.isra.63+0x71/0xe0 [ 215.547338] mddev_unlock+0x1b1/0x2d0 [ 215.547898] array_state_store+0x28d/0x450 [ 215.548519] md_attr_store+0xd7/0x150 [ 215.549059] ? __pfx_sysfs_kf_write+0x10/0x10 [ 215.549702] kernfs_fop_write_iter+0x1b9/0x260 [ 215.550351] vfs_write+0x491/0x760 [ 215.550863] ? __pfx_vfs_write+0x10/0x10 [ 215.551445] ? __fget_files+0x156/0x230 [ 215.552053] ksys_write+0xc0/0x160 [ 215.552570] ? __pfx_ksys_write+0x10/0x10 [ 215.553141] ? ktime_get_coarse_real_ts64+0xec/0x100 [ 215.553878] do_syscall_64+0x3a/0x90 [ 215.554403] entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 215.555125] RIP: 0033:0x7f2aade11847 [ 215.555696] Code: c3 66 90 41 54 49 89 d4 55 48 89 f5 53 89 fb 48 83 ec 10 e8 1b fd ff ff 4c 89 e2 48 89 ee 89 df 41 89 c0 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 48 89 448 [ 215.558398] RSP: 002b:00007f2aabdfeba0 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 [ 215.559516] RAX: ffffffffffffffda RBX: 0000000000000010 RCX: 00007f2aade11847 [ 215.560515] RDX: 0000000000000005 RSI: 0000000000438b8b RDI: 0000000000000010 [ 215.561512] RBP: 0000000000438b8b R08: 0000000000000000 R09: 00007f2aaecf0060 [ 215.562511] R10: 000000000e3ba40b R11: 0000000000000293 R12: 0000000000000005 [ 215.563647] R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000c70750 [ 215.564693] [ 215.565029] irq event stamp: 15979 [ 215.565584] hardirqs last enabled at (15991): [] __up_console_sem+0x52/0x60 [ 215.566806] hardirqs last disabled at (16000): [] __up_console_sem+0x37/0x60 [ 215.568022] softirqs last enabled at (15716): [] __do_softirq+0x3eb/0x531 [ 215.569239] softirqs last disabled at (15711): [] irq_exit_rcu+0x115/0x160 [ 215.570434] ---[ end trace 0000000000000000 ]--- This means export_rdev() calls blkdev_put with a different holder than the one used by blkdev_get_by_dev(). This is because mddev->major_version == -2 is not a good check for external metadata. Fix this by using mddev->external instead. Also, do not clear mddev->external in md_clean(), as the flag might be used later in export_rdev(). Fixes: 2736e8eeb0cc ("block: use the holder as indication for exclusive opens") Cc: Christoph Hellwig Cc: Jens Axboe Signed-off-by: Song Liu Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230617052405.305871-1-song@kernel.org commit aa88054b70905069d1cf706aa5e9a3418d1d341d Author: Baruch Siach Date: Fri Jun 23 08:56:44 2023 +0300 binfmt_elf: fix comment typo s/reset/regset/ Signed-off-by: Baruch Siach Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/0b2967c4a4141875c493e835d5a6f8f2d19ae2d6.1687499804.git.baruch@tkos.co.il commit 0b3d412798a4763aaf39213a279e453e1fddc81d Author: Baruch Siach Date: Fri Jun 23 08:50:11 2023 +0300 elf: correct note name comment NT_PRFPREG note is named "CORE". Correct the comment accordingly. Fixes: 00e19ceec80b ("ELF: Add ELF program property parsing support") Signed-off-by: Baruch Siach Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/455b22b986de4d3bc6d9bfd522378e442943de5f.1687499411.git.baruch@tkos.co.il commit b5a99602b74bbfa655be509c615181dd95b0719e Author: Yu Kuai Date: Fri Jun 16 09:21:36 2023 +0800 md/raid1-10: fix casting from randomized structure in raid1_submit_write() Following build error triggered while build with clang version 17.0.0 with W=1(this can't be reporduced with gcc 13.1.0): drivers/md/raid1-10.c:117:25: error: casting from randomized structure pointer type 'struct block_device *' to 'struct md_rdev *' 117 | struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev; | ^ Fix this by casting 'bio->bi_bdev' to 'void *', as it used to be. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306142042.fmjfmTF8-lkp@intel.com/ Fixes: 8295efbe68c0 ("md/raid1-10: factor out a helper to submit normal write") Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230616012136.3047071-1-yukuai1@huaweicloud.com commit 125bfc7cd750e68c99f1d446e2c22abea08c237f Author: Li Nan Date: Fri Jun 9 17:43:20 2023 +0800 md/raid10: fix the condition to call bio_end_io_acct() /sys/block/[device]/queue/iostats is used to control whether to count io stat. Write 0 to it will clear queue_flags QUEUE_FLAG_IO_STAT which means iostats is disabled. If we disable iostats and later endable it, the io issued during this period will be counted incorrectly, inflight will be decreased to -1. //T1 set iostats echo 0 > /sys/block/md0/queue/iostats clear QUEUE_FLAG_IO_STAT //T2 issue io if (QUEUE_FLAG_IO_STAT) -> false bio_start_io_acct inflight++ echo 1 > /sys/block/md0/queue/iostats set QUEUE_FLAG_IO_STAT //T3 io end if (QUEUE_FLAG_IO_STAT) -> true bio_end_io_acct inflight-- -> -1 Also, if iostats is enabled while issuing io but disabled while io end, inflight will never be decreased. Fix it by checking start_time when io end. If start_time is not 0, call bio_end_io_acct(). Fixes: 528bc2cf2fcc ("md/raid10: enable io accounting") Signed-off-by: Li Nan Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230609094320.2397604-1-linan666@huaweicloud.com commit 7bce16630837c705f72e8fd53a11ae8c236236f4 Author: Biju Das Date: Fri Jun 23 15:09:40 2023 +0100 regulator: Add Renesas PMIC RAA215300 driver The RAA215300 is a 9-channel PMIC that consists of * Internally compensated regulators * built-in Real Time Clock (RTC) * 32kHz crystal oscillator * coin cell battery charger The RTC on RAA215300 is similar to the IP found in the ISL1208. The existing driver for the ISL1208 works for this PMIC too, however the RAA215300 exposes two devices via I2C, one for the RTC IP, and one for everything else. The RTC IP has to be enabled by the other I2C device, therefore this driver is necessary to get the RTC to work. The external oscillator bit is inverted on PMIC version 0x11. Add PMIC RAA215300 driver for enabling RTC block and instantiating RTC device based on PMIC version. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/Message-Id: <20230623140948.384762-3-biju.das.jz@bp.renesas.com> Signed-off-by: Mark Brown commit fff8f6b0723159f09eb2c067e626fb96402c0e53 Author: Biju Das Date: Fri Jun 23 15:09:39 2023 +0100 regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings Document Renesas RAA215300 PMIC bindings. The RAA215300 is a high Performance 9-Channel PMIC supporting DDR Memory, with Built-In Charger and RTC. It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements. The internally compensated regulators, built-in Real-Time Clock (RTC), 32kHz crystal oscillator, and coin cell battery charger provide a highly integrated, small footprint power solution ideal for System-On-Module (SOM) applications. A spread spectrum feature provides an ease-of-use solution for noise-sensitive audio or RF applications. Signed-off-by: Biju Das Reviewed-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/Message-Id: <20230623140948.384762-2-biju.das.jz@bp.renesas.com> Signed-off-by: Mark Brown commit ed959833db7bdb4e57fa8f4076babf3810296f5b Author: Dan Carpenter Date: Fri Jun 23 15:09:48 2023 +0300 ASoC: tas2781: Fix error code in tas2781_load_calibration() Return -EINVAL instead of success on this error path. Fixes: 915f5eadebd2 ("ASoC: tas2781: firmware lib") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/Message-Id: <729bb6b3-bc1d-4b3d-8b65-077a492c753c@moroto.mountain> Signed-off-by: Mark Brown commit 0c3855ba8dad41c4113e73f77eb926e44577e4af Author: Christian König Date: Fri Jun 23 09:08:00 2023 +0200 drm/ttm: fix warning that we shouldn't mix && and || Trivial warning fix. Signed-off-by: Christian König Fixes: 4481913607e5 ("drm/ttm: fix bulk_move corruption when adding a entry") Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20230623070935.65102-1-christian.koenig@amd.com commit b54c4b02abd1578132712eae5b294a9c77e7422b Author: Wilken Gottwalt Date: Fri Jun 23 13:36:28 2023 +0000 hwmon: (corsair-psu) various cleanups Fix some typos, adjust documentation and comments to current state of knowledge and update coding style to be more uniform. Signed-off-by: Wilken Gottwalt Link: https://lore.kernel.org/r/ZJWf3H972hGgLK-8@monster.localdomain Signed-off-by: Guenter Roeck commit fc30ace06f250f79381a8e3f6ed92dd68e25a9f5 Author: Donglin Peng Date: Fri Jun 23 15:17:28 2023 +0800 tracing: Fix warnings when building htmldocs for function graph retval When building htmldocs, the following warnings appear: Documentation/trace/ftrace.rst:2797: WARNING: Literal block expected; none found. Documentation/trace/ftrace.rst:2816: WARNING: Literal block expected; none found. So fix it. Link: https://lore.kernel.org/all/20230623143517.19ffc6c0@canb.auug.org.au/ Link: https://lkml.kernel.org/r/20230623071728.25688-1-pengdonglin@sangfor.com.cn Fixes: 21c094d3f8a6 ("tracing: Add documentation for funcgraph-retval and funcgraph-retval-hex") Signed-off-by: Donglin Peng Acked-by: Masami Hiramatsu (Google) Reported-by: Stephen Rothwell Signed-off-by: Steven Rostedt (Google) commit 81ca2dbefaabe1a2ca1c7cfc84dfd45c072c82a6 Author: Demi Marie Obenour Date: Sat Jun 3 10:52:44 2023 -0400 dm ioctl: Refuse to create device named "." or ".." Using either of these is going to greatly confuse userspace, as they are not valid symlink names and so creating the usual /dev/mapper/NAME symlink will not be possible. As creating a device with either of these names is almost certainly a userspace bug, just error out. Signed-off-by: Demi Marie Obenour Signed-off-by: Mike Snitzer commit a85f1a9de91a59cd9b12d60f631cbda9c56a1c3c Author: Demi Marie Obenour Date: Sat Jun 3 10:52:43 2023 -0400 dm ioctl: Refuse to create device named "control" Typical userspace setups create a symlink under /dev/mapper with the name of the device, but /dev/mapper/control is reserved for DM's control device. Therefore, trying to create such a device is almost certain to be a userspace bug. Signed-off-by: Demi Marie Obenour Signed-off-by: Mike Snitzer commit 249bed821b4db6d95a99160f7d6d236ea5fe6362 Author: Demi Marie Obenour Date: Sat Jun 3 10:52:42 2023 -0400 dm ioctl: Avoid double-fetch of version The version is fetched once in check_version(), which then does some validation and then overwrites the version in userspace with the API version supported by the kernel. copy_params() then fetches the version from userspace *again*, and this time no validation is done. The result is that the kernel's version number is completely controllable by userspace, provided that userspace can win a race condition. Fix this flaw by not copying the version back to the kernel the second time. This is not exploitable as the version is not further used in the kernel. However, it could become a problem if future patches start relying on the version field. Cc: stable@vger.kernel.org Signed-off-by: Demi Marie Obenour Signed-off-by: Mike Snitzer commit 10655c7a48570315343fdd9cc6acb261d57c2c7a Author: Demi Marie Obenour Date: Sat Jun 3 10:52:41 2023 -0400 dm ioctl: structs and parameter strings must not overlap The NUL terminator for each target parameter string must precede the following 'struct dm_target_spec'. Otherwise, dm_split_args() might corrupt this struct. Furthermore, the first 'struct dm_target_spec' must come after the 'struct dm_ioctl', as if it overlaps too much dm_split_args() could corrupt the 'struct dm_ioctl'. Signed-off-by: Demi Marie Obenour Reviewed-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 13f4a697f8b4feb705569f9336127e9e2f9ac596 Author: Demi Marie Obenour Date: Sat Jun 3 10:52:40 2023 -0400 dm ioctl: Avoid pointer arithmetic overflow Especially on 32-bit systems, it is possible for the pointer arithmetic to overflow and cause a userspace pointer to be dereferenced in the kernel. Signed-off-by: Demi Marie Obenour Reviewed-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit b60528d9e68113e2c297c3a45102332cb1d3e608 Author: Demi Marie Obenour Date: Sat Jun 3 10:52:39 2023 -0400 dm ioctl: Check dm_target_spec is sufficiently aligned Otherwise subsequent code, if given malformed input, could dereference a misaligned 'struct dm_target_spec *'. Signed-off-by: Demi Marie Obenour Signed-off-by: Stephen Rothwell # use %zu Reviewed-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit fcaa174a9c995cf0af3967e55644a1543ea07e36 Author: Yu Kuai Date: Thu Jun 22 00:01:11 2023 +0800 scsi/sg: don't grab scsi host module reference In order to prevent request_queue to be freed before cleaning up blktrace debugfs entries, commit db59133e9279 ("scsi: sg: fix blktrace debugfs entries leakage") use scsi_device_get(), however, scsi_device_get() will also grab scsi module reference and scsi module can't be removed. It's reported that blktests can't unload scsi_debug after block/001: blktests (master) # ./check block block/001 (stress device hotplugging) [failed] +++ /root/blktests/results/nodev/block/001.out.bad 2023-06-19 Running block/001 Stressing sd +modprobe: FATAL: Module scsi_debug is in use. Fix this problem by grabbing request_queue reference directly, so that scsi host module can still be unloaded while request_queue will be pinged by sg device. Reported-by: Chaitanya Kulkarni Link: https://lore.kernel.org/all/1760da91-876d-fc9c-ab51-999a6f66ad50@nvidia.com/ Fixes: db59133e9279 ("scsi: sg: fix blktrace debugfs entries leakage") Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230621160111.1433521-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit c98c81a4ac37b651be7eb9d16f562fc4acc5f867 Author: Pavel Begunkov Date: Fri Jun 23 12:23:31 2023 +0100 io_uring: merge conditional unlock flush helpers There is no reason not to use __io_cq_unlock_post_flush for intermediate aux CQE flushing, all ->task_complete should apply there, i.e. if set it should be the submitter task. Combine them, get rid of of __io_cq_unlock_post() and rename the left function. This place was also taking a couple percents of CPU according to profiles for max throughput net benchmarks due to multishot recv flooding it with completions. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/bbed60734cbec2e833d9c7bdcf9741aada5d8aab.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 0fdb9a196c6728b51e0e7a4f6fa292d9fd5793de Author: Pavel Begunkov Date: Fri Jun 23 12:23:30 2023 +0100 io_uring: make io_cq_unlock_post static io_cq_unlock_post() is exclusively used in io_uring/io_uring.c, mark it static and don't expose to other files. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/3dc8127dda4514e1dd24bb32035faac887c5fa37.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit ff12617728fa5c7fb5325e164503ca4e936b80bd Author: Pavel Begunkov Date: Fri Jun 23 12:23:29 2023 +0100 io_uring: inline __io_cq_unlock __io_cq_unlock is not very helpful, and users should be calling flush variants anyway. Open code the function. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d875c4cfb69f38ccecb58a57111446c77a614caa.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 55b6a69fed5df6f88ef0b2ace562b422162beb61 Author: Pavel Begunkov Date: Fri Jun 23 12:23:28 2023 +0100 io_uring: fix acquire/release annotations We do conditional locking, so __io_cq_lock() and friends not always actually grab/release the lock, so kill misleading annotations. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/2a098f9144c24cab622f8bf90b39f44da5d0401e.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit f432b76bcc93f36edb3d371f7b8d7881261dd6e7 Author: Pavel Begunkov Date: Fri Jun 23 12:23:27 2023 +0100 io_uring: kill io_cq_unlock() We're abusing ->completion_lock helpers. io_cq_unlock() neither locking conditionally nor doing CQE flushing, which means that callers must have some side reason of taking the lock and should do it directly. Open code io_cq_unlock() into io_cqring_overflow_kill() and clean it up. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/7dabb36856db2b562e78780480396c52c29b2bf4.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 91c7884ac9a92ffbf78af7fc89603daf24f448a9 Author: Pavel Begunkov Date: Fri Jun 23 12:23:26 2023 +0100 io_uring: remove IOU_F_TWQ_FORCE_NORMAL Extract a function for non-local task_work_add, and use it directly from io_move_task_work_from_local(). Now we don't use IOU_F_TWQ_FORCE_NORMAL and it can be killed. As a small positive side effect we don't grab task->io_uring in io_req_normal_work_add anymore, which is not needed for io_req_local_work_add(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/2e55571e8ff2927ae3cc12da606d204e2485525b.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 2fdd6fb5ff958a0f6b403e3f3ffd645b60b2a2b2 Author: Pavel Begunkov Date: Fri Jun 23 12:23:25 2023 +0100 io_uring: don't batch task put on reqs free We're trying to batch io_put_task() in io_free_batch_list(), but considering that the hot path is a simple inc, it's most cerainly and probably faster to just do io_put_task() instead of task tracking. We don't care about io_put_task_remote() as it's only for IOPOLL where polling/waiting is done by not the submitter task. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/4a7ef7dce845fe2bd35507bf389d6bd2d5c1edf0.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 5a754dea27fb91a418f7429e24479e4184dee2e3 Author: Pavel Begunkov Date: Fri Jun 23 12:23:24 2023 +0100 io_uring: move io_clean_op() Move io_clean_op() up in the source file and remove the forward declaration, as the function doesn't have tricky dependencies anymore. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/1b7163b2ba7c3a8322d972c79c1b0a9301b3057e.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 3b7a612fd0dbd321e15a308b8ac1f8bbf81432bd Author: Pavel Begunkov Date: Fri Jun 23 12:23:23 2023 +0100 io_uring: inline io_dismantle_req() io_dismantle_req() is only used in __io_req_complete_post(), open code it there. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ba8f20cb2c914eefa2e7d120a104a198552050db.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 6ec9afc7f4cba58ab740c59d4c964d9422e2ea82 Author: Pavel Begunkov Date: Fri Jun 23 12:23:22 2023 +0100 io_uring: remove io_free_req_tw Request completion is a very hot path in general, but there are 3 places that can be doing it: io_free_batch_list(), io_req_complete_post() and io_free_req_tw(). io_free_req_tw() is used rather marginally and we don't care about it. Killing it can help to clean up and optimise the left two, do that by replacing it with io_req_task_complete(). There are two things to consider: 1) io_free_req() is called when all refs are put, so we need to reinit references. The easiest way to do that is to clear REQ_F_REFCOUNT. 2) We also don't need a cqe from it, so silence it with REQ_F_CQE_SKIP. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/434a2be8f33d474ad888ce1c17fe5ea7bbcb2a55.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 247f97a5f19b642eba5f5c1cf95fc3169326b3fb Author: Pavel Begunkov Date: Fri Jun 23 12:23:21 2023 +0100 io_uring: open code io_put_req_find_next There is only one user of io_put_req_find_next() and it doesn't make much sense to have it. Open code the function. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/38b5c5e48e4adc8e6a0cd16fdd5c1531d7ff81a9.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a42fb5a75ccc37dfd69aa9bde5ba2866e802ff3c Author: Jan Kara Date: Thu Jun 22 18:51:07 2023 +0200 ext4: Fix warning in blkdev_put() ext4_blkdev_remove() passes a wrong holder pointer to blkdev_put() which triggers a warning there. Fix it. Fixes: 2736e8eeb0cc ("block: use the holder as indication for exclusive opens") Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230622165107.13687-1-jack@suse.cz Signed-off-by: Jens Axboe commit 95e2b352c03b0a86c5717ba1d24ea20969abcacc Author: Immad Mir Date: Fri Jun 23 19:17:08 2023 +0530 FS: JFS: Check for read-only mounted filesystem in txBegin This patch adds a check for read-only mounted filesystem in txBegin before starting a transaction potentially saving from NULL pointer deref. Signed-off-by: Immad Mir Signed-off-by: Dave Kleikamp commit 47cfdc338d674d38f4b2f22b7612cc6a2763ba27 Author: Immad Mir Date: Fri Jun 23 19:14:01 2023 +0530 FS: JFS: Fix null-ptr-deref Read in txBegin Syzkaller reported an issue where txBegin may be called on a superblock in a read-only mounted filesystem which leads to NULL pointer deref. This could be solved by checking if the filesystem is read-only before calling txBegin, and returning with appropiate error code. Reported-By: syzbot+f1faa20eec55e0c8644c@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?id=be7e52c50c5182cc09a09ea6fc456446b2039de3 Signed-off-by: Immad Mir Signed-off-by: Dave Kleikamp commit 92554cdd428fce212d2a71a06939e7cab90f7c77 Author: Stefan Wahren Date: Sat Jun 17 15:36:17 2023 +0200 dt-bindings: pwm: convert pwm-bcm2835 bindings to YAML Convert the DT binding document for pwm-bcm2835 from .txt to YAML. Signed-off-by: Stefan Wahren Reviewed-by: Rob Herring Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 254d3a727421ccc935f085eaa9bae51cb6c9df25 Author: Biju Das Date: Fri Jun 2 11:11:21 2023 +0100 pwm: Add Renesas RZ/G2L MTU3a PWM driver The RZ/G2L Multi-Function Timer Pulse Unit 3 (a.k.a MTU3a) uses one counter and two match components to configure duty_cycle and period to generate PWM output waveform. Add basic support for RZ/G2L MTU3a PWM driver by creating separate PWM channels for each IOs. Signed-off-by: Biju Das Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit bc13d60e4e1e945b34769a4a4c2b172e8552abe5 Author: Shuijing Li Date: Wed May 31 11:10:01 2023 +0800 pwm: mtk_disp: Fix the disable flow of disp_pwm There is a flow error in the original mtk_disp_pwm_apply() function. If this function is called when the clock is disabled, there will be a chance to operate the disp_pwm register, resulting in disp_pwm exception. Fix this accordingly. Fixes: 888a623db5d0 ("pwm: mtk-disp: Implement atomic API .apply()") Signed-off-by: Shuijing Li Reviewed-by: Matthias Brugger Tested-by: Fei Shao Acked-by: Uwe Kleine-König Reviewed-by: Alexandre Mergnat Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Thierry Reding commit 05b743db9d8cc4e51b3eb77889d24ab9aa2bf169 Author: Krzysztof Kozlowski Date: Tue May 30 16:48:46 2023 +0200 dt-bindings: pwm: restrict node name suffixes Make the pattern matching node names a bit stricter to improve DTS consistency. The pattern is restricted to: 1. Only one unit address or one -N suffix, 2. -N suffixes to decimal numbers. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Uwe Kleine-König Reviewed-by: Tony Lindgren Signed-off-by: Thierry Reding commit 8bfc651a28ceaab5334d7284a31fce7cb1615348 Author: Uwe Kleine-König Date: Thu May 25 23:13:05 2023 +0200 pwm: pca9685: Switch i2c driver back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit cdcffafc4d845cc0c6392cba168c7a942734cce7 Author: Dan Carpenter Date: Mon May 22 14:07:42 2023 +0300 pwm: ab8500: Fix error code in probe() This code accidentally return positive EINVAL instead of negative -EINVAL. Fixes: eb41f334589d ("pwm: ab8500: Fix register offset calculation to not depend on probe order") Signed-off-by: Dan Carpenter Reviewed-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Thierry Reding commit de0bb6a8883342c19a5d20f28d5430169f87373e Author: Conor Dooley Date: Thu May 18 13:29:21 2023 +0100 MAINTAINERS: add pwm to PolarFire SoC entry Add the newly introduced pwm driver to the existing PolarFire SoC entry. Signed-off-by: Conor Dooley Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 2bf7ecf7b4fffd87d8eb5c072395239d6ff54728 Author: Conor Dooley Date: Thu May 18 13:29:20 2023 +0100 pwm: add microchip soft ip corePWM driver Add a driver that supports the Microchip FPGA "soft" PWM IP core. Signed-off-by: Conor Dooley Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 38ba83598633373f47951384cfc389181c8d1bed Author: Marek Vasut Date: Fri May 12 18:47:36 2023 +0200 pwm: sysfs: Do not apply state to already disabled PWMs If the PWM is exported but not enabled, do not call pwm_class_apply_state(). First of all, in this case, period may still be unconfigured and this would make pwm_class_apply_state() return -EINVAL, and then suspend would fail. Second, it makes little sense to apply state onto PWM that is not enabled before suspend. Failing case: " $ echo 1 > /sys/class/pwm/pwmchip4/export $ echo mem > /sys/power/state ... pwm pwmchip4: PM: dpm_run_callback(): pwm_class_suspend+0x1/0xa8 returns -22 pwm pwmchip4: PM: failed to suspend: error -22 PM: Some devices failed to suspend, or early wake event detected " Working case: " $ echo 1 > /sys/class/pwm/pwmchip4/export $ echo 100 > /sys/class/pwm/pwmchip4/pwm1/period $ echo 10 > /sys/class/pwm/pwmchip4/pwm1/duty_cycle $ echo mem > /sys/power/state ... " Do not call pwm_class_apply_state() in case the PWM is disabled to fix this issue. Fixes: 7fd4edc57bbae ("pwm: sysfs: Add suspend/resume support") Signed-off-by: Marek Vasut Fixes: ef2bf4997f7d ("pwm: Improve args checking in pwm_apply_state()") Reviewed-by: Brian Norris Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 661dfb7f46298e53f6c3deaa772fa527aae86193 Author: Fancy Fang Date: Fri May 5 14:58:39 2023 +0800 pwm: imx-tpm: force 'real_period' to be zero in suspend During suspend, all the tpm registers will lose values. So the 'real_period' value of struct 'imx_tpm_pwm_chip' should be forced to be zero to force the period update code can be executed after system resume back. Signed-off-by: Fancy Fang Signed-off-by: Clark Wang Acked-by: Uwe Kleine-König Fixes: 738a1cfec2ed ("pwm: Add i.MX TPM PWM driver support") Signed-off-by: Thierry Reding commit 329db102a26da0ba876974dbe04308d08acfad94 Author: Heiner Kallweit Date: Wed May 24 21:52:21 2023 +0200 pwm: meson: make full use of common clock framework Newer versions of the PWM block use a core clock with external mux, divider, and gate. These components either don't exist any longer in the PWM block, or they are bypassed. To minimize needed changes for supporting the new version, the internal divider and gate should be handled by CCF too. I didn't see a good way to split the patch, therefore it's somewhat bigger. What it does: - The internal mux is handled by CCF already. Register also internal divider and gate with CCF, so that we have one representation of the input clock: [mux] parent of [divider] parent of [gate] - Now that CCF selects an appropriate mux parent, we don't need the DT-provided default parent any longer. Accordingly we can also omit setting the mux parent directly in the driver. - Instead of manually handling the pre-div divider value, let CCF set the input clock. Targeted input clock frequency is 0xffff * 1/period for best precision. - For the "inverted pwm disabled" scenario target an input clock frequency of ULONG_MAX. This ensures that the remaining low pulses have minimum length. I don't have hw with the old PWM block, therefore I couldn't test this patch. With the not yet included extension for the new PWM block (channel->clk coming directly from get_clk(external_clk)) I didn't notice any problem. My system uses PWM for the CPU voltage regulator and for the SDIO 32kHz clock. Note: The clock gate in the old PWM block is permanently disabled. This seems to indicate that it's not used by the new PWM block. Signed-off-by: Heiner Kallweit Signed-off-by: Thierry Reding commit 3bddf73285d578a1798189e0eed2e7f82ebf0e11 Author: Heiner Kallweit Date: Wed May 24 21:51:31 2023 +0200 pwm: meson: don't use hdmi/video clock as mux parent The meson_vclk code from the display driver may change the rate of the video clock. Therefore better don't use it as pwm mux parent. After removing this clock from the parent list pwm_gxbb_data and pwm_g12a_ee_data are the same as pwm_meson8b_data. So we can remove them. Reported-by: Martin Blumenstingl Reviewed-by: Martin Blumenstingl Signed-off-by: Heiner Kallweit Signed-off-by: Thierry Reding commit ed73300326ec67d2a0c35fb7f911314cc6d7d918 Author: Heiner Kallweit Date: Wed May 24 21:50:47 2023 +0200 pwm: meson: switch to using struct clk_parent_data for mux parents We'll use struct clk_parent_data for mux/div/gate initialization in the follow-up patches. As a first step switch the mux from using parent_names to clk_parent_data. Suggested-by: Martin Blumenstingl Reviewed-by: Martin Blumenstingl Tested-by: Martin Blumenstingl Signed-off-by: Heiner Kallweit Signed-off-by: Thierry Reding commit bafa23b6c07caac63a9637e83a605c26771b43ee Author: Heiner Kallweit Date: Wed May 24 21:49:56 2023 +0200 pwm: meson: remove not needed check in meson_pwm_calc period >= duty implies that cnt >= duty_cnt. We verified before that cnt <= 0xffff, therefore we can omit the check here. Suggested-by: Uwe Kleine-König Signed-off-by: Heiner Kallweit Signed-off-by: Thierry Reding commit 87a2cbf02d7701255f9fcca7e5bd864a7bb397cf Author: Heiner Kallweit Date: Wed May 24 21:48:36 2023 +0200 pwm: meson: fix handling of period/duty if greater than UINT_MAX state->period/duty are of type u64, and if their value is greater than UINT_MAX, then the cast to uint will cause problems. Fix this by changing the type of the respective local variables to u64. Fixes: b79c3670e120 ("pwm: meson: Don't duplicate the polarity internally") Cc: stable@vger.kernel.org Suggested-by: Uwe Kleine-König Reviewed-by: Martin Blumenstingl Signed-off-by: Heiner Kallweit Signed-off-by: Thierry Reding commit 6b9352f3f8a1a35faf0efc1ad1807ee303467796 Author: Heiner Kallweit Date: Wed May 24 21:47:43 2023 +0200 pwm: meson: modify and simplify calculation in meson_pwm_get_state I don't see a reason why we should treat the case lo < hi differently and return 0 as period and duty_cycle. The current logic was added with c375bcbaabdb ("pwm: meson: Read the full hardware state in meson_pwm_get_state()"), Martin as original author doesn't remember why it was implemented this way back then. So let's handle it as normal use case and also remove the optimization for lo == 0. I think the improved readability is worth it. Fixes: c375bcbaabdb ("pwm: meson: Read the full hardware state in meson_pwm_get_state()") Reviewed-by: Uwe Kleine-König Reviewed-by: Dmitry Rokosov Acked-by: Martin Blumenstingl Cc: stable@vger.kernel.org Signed-off-by: Heiner Kallweit Signed-off-by: Thierry Reding commit 5442c33f218b1aabbe699db978e407317a231d10 Author: Wolfram Sang Date: Tue May 2 18:53:29 2023 +0200 dt-bindings: pwm: Add R-Car V3U device tree bindings Tested-by: Kieran Bingham Signed-off-by: Wolfram Sang Acked-by: Rob Herring Acked-by: Uwe Kleine-König Reviewed-by: Kieran Bingham Reviewed-by: Geert Uytterhoeven Signed-off-by: Thierry Reding commit c799ad062a75858e10a7626e20233e6e94dbf554 Author: Alexander Stein Date: Mon Apr 24 10:21:07 2023 +0200 dt-bindings: pwm: imx: add i.MX8QXP compatible i.MX8QXP compatible is missing in the list, add it. Signed-off-by: Alexander Stein Acked-by: Uwe Kleine-König Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 967da67a745fb73fd0fc7aa61fd197b76fceb273 Author: Daniel Golle Date: Fri Apr 21 00:23:21 2023 +0100 pwm: mediatek: Add support for MT7981 The PWM unit on MT7981 uses different register offsets than previous MediaTek PWM units. Add support for these new offsets and add support for PWM on MT7981 which has 3 PWM channels, one of them is typically used for a temperature controlled fan. While at it, also reorder pwm_mediatek_of_data entries to restore alphabetic order. Signed-off-by: Daniel Golle Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Signed-off-by: Thierry Reding commit 88c66e018aa8b5a15d7fdba9908c01260c657bff Author: Daniel Golle Date: Fri Apr 21 00:22:49 2023 +0100 dt-bindings: pwm: mediatek: Add mediatek,mt7981 compatible Add compatible string for the PWM unit found of the MediaTek MT7981 SoC. This is in preparation to adding support in the pwm-mediatek.c driver. Signed-off-by: Daniel Golle Reviewed-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 55e644b840baf7a884a27be81b7582794f54a808 Author: Uwe Kleine-König Date: Tue Apr 18 22:21:02 2023 +0200 pwm: sifive: Simplify using devm_clk_get_prepared() Instead of preparing the clk after it was requested and unpreparing in .probe()'s error path and .remove(), use devm_clk_get_prepared() which copes for unpreparing automatically. Signed-off-by: Uwe Kleine-König Reviewed-by: Emil Renner Berthing Signed-off-by: Thierry Reding commit 2b8e30b1bd500df67554f1c183caf333de82f8d2 Author: Christophe JAILLET Date: Sun Apr 16 11:02:13 2023 +0200 pwm: clk: Use the devm_clk_get_prepared() helper function Use the devm_clk_get_prepared() helper function instead of hand-writing it. It saves some line of codes. Signed-off-by: Christophe JAILLET Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit dc917ea7a2c95545dd41572a5685a95566ff9985 Author: Ladislav Michl Date: Mon Jun 19 22:14:03 2023 +0200 MIPS: OCTEON: octeon-usb: cleanup divider calculation Simple self-contained function is easier to review. Signed-off-by: Ladislav Michl Signed-off-by: Thomas Bogendoerfer commit 2257c6c90e9223e00d0e37ec721c86f45d8ba1d9 Author: Ladislav Michl Date: Mon Jun 19 22:13:38 2023 +0200 MIPS: OCTEON: octeon-usb: introduce dwc3_octeon_{read,write}q Move all register access code into separate functions and provide their no-op version for non Octeon platforms. Later it might be possible to replace them with standard Linux functions, however datasheets are not publicly available and I have only one Octeon board to test, so lets stay on safe side for now. Signed-off-by: Ladislav Michl Signed-off-by: Thomas Bogendoerfer commit 793bef570951431cdf257b637fcb21356d7faec9 Author: Ladislav Michl Date: Mon Jun 19 22:13:14 2023 +0200 MIPS: OCTEON: octeon-usb: move gpio config to separate function Power gpio configuration is using Octeon specific code, so move it to separate function, that can later be guarded with ifdefs. Signed-off-by: Ladislav Michl Signed-off-by: Thomas Bogendoerfer commit 940692c6ccf51277d6cbdb069c38141e4ed9eb31 Author: Ladislav Michl Date: Mon Jun 19 22:12:34 2023 +0200 MIPS: OCTEON: octeon-usb: use bitfields for shim register Use Linux standard bitfield access macros to manipulate shim register. Signed-off-by: Ladislav Michl Signed-off-by: Thomas Bogendoerfer commit 74ac367c9c851a1a896291ef5cf292541cdf17c0 Author: Ladislav Michl Date: Mon Jun 19 22:12:10 2023 +0200 MIPS: OCTEON: octeon-usb: use bitfields for host config register Use Linux standard bitfield access macros to manipulate host config register. Signed-off-by: Ladislav Michl Signed-off-by: Thomas Bogendoerfer commit ce942c0f69c2e492f3d2be27b1a42cdbf59f6b1c Author: Ladislav Michl Date: Mon Jun 19 22:11:43 2023 +0200 MIPS: OCTEON: octeon-usb: use bitfields for control register Code needs to compile for all platforms in order to move it to drivers/usb/dwc3. Use Linux standard bitfield access macros to manipulate control register. Signed-off-by: Ladislav Michl Signed-off-by: Thomas Bogendoerfer commit c7b6a1eb2f85a8d10f3bb93a57e7b91a3dc58693 Author: Ladislav Michl Date: Mon Jun 19 22:11:19 2023 +0200 MIPS: OCTEON: octeon-usb: add all register offsets Glue code uses a mix of offset and absolute address register definition. Define all of them as offsets and use them consistently. Signed-off-by: Ladislav Michl Signed-off-by: Thomas Bogendoerfer commit 670f77f76f650b1b341d31d009cc2fb03a4d1fcf Author: Shiji Yang Date: Fri Jun 23 08:17:48 2023 +0800 mips: ralink: match all supported system controller compatible strings Recently, A new clock and reset controller driver has been introduced to the ralink mips target[1]. It provides proper system control and adds more SoC specific compatible strings. In order to better initialize CPUs, this patch removes the outdated "ralink,mt7620a-sysc" and add all dt-binding documented compatible strings to the system controller match table. [1] https://lore.kernel.org/all/20230619040941.1340372-1-sergio.paracuellos@gmail.com/ Signed-off-by: Shiji Yang Reviewed-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 7b191b9b55df2a844bd32d1d380f47a7df1c2896 Author: Gustavo A. R. Silva Date: Thu Jun 22 17:43:57 2023 -0600 MIPS: dec: prom: Address -Warray-bounds warning Zero-length arrays are deprecated, and we are replacing them with flexible array members instead. So, replace zero-length array with flexible-array member in struct memmap. Address the following warning found after building (with GCC-13) mips64 with decstation_64_defconfig: In function 'rex_setup_memory_region', inlined from 'prom_meminit' at arch/mips/dec/prom/memory.c:91:3: arch/mips/dec/prom/memory.c:72:31: error: array subscript i is outside array bounds of 'unsigned char[0]' [-Werror=array-bounds=] 72 | if (bm->bitmap[i] == 0xff) | ~~~~~~~~~~^~~ In file included from arch/mips/dec/prom/memory.c:16: ./arch/mips/include/asm/dec/prom.h: In function 'prom_meminit': ./arch/mips/include/asm/dec/prom.h:73:23: note: while referencing 'bitmap' 73 | unsigned char bitmap[0]; This helps with the ongoing efforts to globally enable -Warray-bounds. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/323 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Thomas Bogendoerfer commit 944520f85d5b1fb2f9ea243be41f9c9af3d4cef3 Author: Paul Cercueil Date: Thu Jun 22 19:59:34 2023 +0200 MIPS: DTS: CI20: Raise VDDCORE voltage to 1.125 volts Commit 08384e80a70f ("MIPS: DTS: CI20: Fix ACT8600 regulator node names") caused the VDDCORE power supply (regulated by the ACT8600's DCDC1 output) to drop from a voltage of 1.2V configured by the bootloader, to the 1.1V set in the Device Tree. According to the documentation, the VDDCORE supply should be between 0.99V and 1.21V; both values are therefore within the supported range. However, VDDCORE being 1.1V results in the CI20 being very unstable, with corrupted memory, failures to boot, or reboots at random. The reason might be succint drops of the voltage below the minimum required. Raising the minimum voltage to 1.125 volts seems to be enough to address this issue, while still keeping a relatively low core voltage which helps for power consumption and thermals. Fixes: 08384e80a70f ("MIPS: DTS: CI20: Fix ACT8600 regulator node names") Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 6e68dae946e3a0333fbde5487ce163142ca10ae0 Author: Nathan Chancellor Date: Thu Jun 22 15:56:19 2023 +0000 clk: ralink: mtmips: Fix uninitialized use of ret in mtmips_register_{fixed,factor}_clocks() Clang warns: drivers/clk/ralink/clk-mtmips.c:309:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized] 309 | return ret; | ^~~ drivers/clk/ralink/clk-mtmips.c:285:9: note: initialize the variable 'ret' to silence this warning 285 | int ret, i; | ^ | = 0 drivers/clk/ralink/clk-mtmips.c:359:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized] 359 | return ret; | ^~~ drivers/clk/ralink/clk-mtmips.c:335:9: note: initialize the variable 'ret' to silence this warning 335 | int ret, i; | ^ | = 0 2 errors generated. Set ret to the return value of clk_hw_register_fixed_rate() using the PTR_ERR() macro, which ensures ret is not used uninitialized, clearing up the warning. Fixes: 6f3b15586eef ("clk: ralink: add clock and reset driver for MTMIPS SoCs") Closes: https://github.com/ClangBuiltLinux/linux/issues/1879 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Acked-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 6fb605c41d731d511b33045d0cd713d706970b6d Merge: 8a86133e06e6a a3c10035d12f5 Author: Wolfram Sang Date: Fri Jun 23 12:59:46 2023 +0200 Merge tag 'at24-updates-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-mergewindow at24 updates for v6.5 - use dev_err_probe() where applicable commit faaa5fd30344f9a7b3816ae7a6b58ccd5a34998f Author: Rob Herring Date: Wed Jun 21 17:10:12 2023 -0600 dt-bindings: net: altr,tse: Fix error in "compatible" conditional schema The conditional if/then schema has an error as the "enum" values have "const" in them. Drop the "const". Signed-off-by: Rob Herring Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230621231012.3816139-1-robh@kernel.org Signed-off-by: Paolo Abeni commit 8a86133e06e6a4f8797a8cc611a99785c05d8183 Author: Andi Shyti Date: Mon Jun 12 00:57:02 2023 +0200 i2c: uniphier: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Signed-off-by: Wolfram Sang commit ff896ef401866c0eb0d07c0c279b5382e2d9e3cf Author: Andi Shyti Date: Mon Jun 12 00:57:01 2023 +0200 i2c: uniphier-f: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Signed-off-by: Wolfram Sang commit 7e8e6677a8f70deb14482b70bef59dbf094d4321 Author: Andi Shyti Date: Mon Jun 12 00:56:56 2023 +0200 i2c: owl: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Signed-off-by: Wolfram Sang commit 9d8b7b6102d9cefb9e95c7ba764121182f696943 Author: Andi Shyti Date: Mon Jun 12 00:56:54 2023 +0200 i2c: lpc2k: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Signed-off-by: Wolfram Sang commit 0ff9f5e57c5bb45b6b807a4d466228de39d8cd2f Author: Bartosz Golaszewski Date: Fri Jun 9 16:36:09 2023 +0200 of: unittest: drop assertions for GPIO hog messages These have now been demoted to debug and are normally hidden. Drop the assertions entirely. Suggested-by: Rob Herring Signed-off-by: Bartosz Golaszewski Acked-by: Andy Shevchenko Acked-by: Rob Herring commit 2153244b641031654d2dd534dfa3f9b4a820c572 Author: Andi Shyti Date: Mon Jun 12 00:56:52 2023 +0200 i2c: hix5hd2: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Signed-off-by: Wolfram Sang commit 154756319cc6f8b8b86241da02da6a8fcc6abd1f Author: Arun Gopal Kondaveeti Date: Sat Jun 24 03:11:40 2023 +0530 ASoC: amd: update pm_runtime enable sequence pm_runtime_allow() is not needed for ACP child platform devices. Replace pm_runtime_allow() with pm_runtime_mark_last_busy() & pm_runtime_set_active() in pm_runtime enable sequence for ACP child platform drivers. Signed-off-by: Arun Gopal Link: https://lore.kernel.org/r/Message-Id: <20230623214150.4058721-1-arungopal.kondaveeti@amd.com> Signed-off-by: Mark Brown commit 83c624d8842d7f6c0780bc7658cb8fa67c0501f1 Author: Fabrizio Castro Date: Thu Jun 22 12:33:39 2023 +0100 spi: Add support for Renesas CSI The RZ/V2M SoC comes with the Clocked Serial Interface (CSI) IP, which is a master/slave SPI controller. This commit adds a driver to support CSI master mode. Signed-off-by: Fabrizio Castro Link: https://lore.kernel.org/r/Message-Id: <20230622113341.657842-4-fabrizio.castro.jz@renesas.com> Signed-off-by: Mark Brown commit 14dde0746e67588524d8dd464ac5e4afd3478bb3 Author: Fabrizio Castro Date: Thu Jun 22 12:33:37 2023 +0100 spi: dt-bindings: Add bindings for RZ/V2M CSI Add dt-bindings for the CSI IP found inside the RZ/V2M SoC. Signed-off-by: Fabrizio Castro Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/Message-Id: <20230622113341.657842-2-fabrizio.castro.jz@renesas.com> Signed-off-by: Mark Brown commit 75ff8a340a81252b71611ca3a60c03cf86310955 Author: Andi Shyti Date: Mon Jun 12 00:57:00 2023 +0200 i2c: sun6i-p2wi: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Reviewed-by: Jernej Skrabec Signed-off-by: Wolfram Sang commit 877e91191ccf0782ae18c5dfa7522fb1e5bfba8c Author: Nathan Chancellor Date: Thu Jun 22 16:12:41 2023 +0000 leds: leds-mt6323: Adjust return/parameter types in wled get/set callbacks Clang's kernel Control Flow Integrity (kCFI) is a compiler-based security mitigation that ensures the target of an indirect function call matches the expected type of the call and trapping if they do not match exactly. The warning -Wincompatible-function-pointer-types-strict aims to catch these issues at compile time, which reveals: drivers/leds/leds-mt6323.c:598:49: error: incompatible function pointer types assigning to 'int (*)(struct led_classdev *, enum led_brightness)' from 'int (struct led_classdev *, unsigned int)' [-Werror,-Wincompatible-function-pointer-types-strict] 598 | leds->led[reg]->cdev.brightness_set_blocking = | ^ 599 | mt6323_wled_set_brightness; | ~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/leds/leds-mt6323.c:600:40: error: incompatible function pointer types assigning to 'enum led_brightness (*)(struct led_classdev *)' from 'unsigned int (struct led_classdev *)' [-Werror,-Wincompatible-function-pointer-types-strict] 600 | leds->led[reg]->cdev.brightness_get = | ^ 601 | mt6323_get_wled_brightness; | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. While 'unsigned int' is ABI compatible with 'enum led_brightness' (hence no warning from -Wincompatible-function-pointer-types) and the callers of these callbacks use/pass the values as 'unsigned int', the mismatch between the prototype and the called function will trip kCFI at runtime. Change the types in the implementations to match the prototypes, clearing up the warning and avoiding kCFI failures. Fixes: 9bb0a9e0626c ("leds: leds-mt6323: Add support for WLEDs and MT6332") Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230622-mt6323-wled-wincompatible-function-pointer-types-strict-v1-1-6ad256f220e8@kernel.org Signed-off-by: Lee Jones commit 9aaccc6565fcbfe1fc062878009f5e8efa979d11 Author: Andi Shyti Date: Mon Jun 12 00:56:57 2023 +0200 i2c: pasemi-platform: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Reviewed-by: Alyssa Rosenzweig Signed-off-by: Wolfram Sang commit 2158566b4413c8d6fd9b498b4f3daa27d73e22db Author: Andi Shyti Date: Mon Jun 12 00:56:55 2023 +0200 i2c: mt7621: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Reviewed-by: Matthias Brugger Reviewed-by: Stefan Roese Signed-off-by: Wolfram Sang commit 6656ba754d0630ae0af770f71b4fb012ff9a075a Merge: ebe14dad2d033 1471d85ffba7d Author: Paolo Abeni Date: Fri Jun 23 11:55:56 2023 +0200 Merge branch 's390-net-updates-2023-06-10' Alexandra Winter says: ==================== s390/net: updates 2023-06-10 Please apply the following patch series for s390's ctcm and lcs drivers to netdev's net-next tree. Just maintenance patches, no functional changes. ==================== Link: https://lore.kernel.org/r/20230621134921.904217-1-wintera@linux.ibm.com Signed-off-by: Paolo Abeni commit 1471d85ffba7d17456670afa1b75e50234caa2c6 Author: Thorsten Winkler Date: Wed Jun 21 15:49:21 2023 +0200 s390/ctcm: Convert sprintf/snprintf to scnprintf This LWN article explains the why scnprintf is preferred over snprintf in general https://lwn.net/Articles/69419/ Ie. snprintf() returns what *would* be the resulting length, while scnprintf() returns the actual length. Note that ctcm_print_statistics() writes the data into the kernel log and is therefore not suitable for sysfs_emit(). Observable behavior is not changed, as there may be dependencies. Reviewed-by: Alexandra Winter Signed-off-by: Thorsten Winkler Signed-off-by: Alexandra Winter Signed-off-by: Paolo Abeni commit d585e4b7480615031f798ef25e4012bfe53ff135 Author: Thorsten Winkler Date: Wed Jun 21 15:49:20 2023 +0200 s390/ctcm: Convert sysfs sprintf to sysfs_emit Following the advice of the Documentation/filesystems/sysfs.rst. All sysfs related show()-functions should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Reviewed-by: Alexandra Winter Reviewed-by: Simon Horman Signed-off-by: Thorsten Winkler Signed-off-by: Alexandra Winter Signed-off-by: Paolo Abeni commit 1a079f3e95295c3534c89f008e5e961a386e25e9 Author: Thorsten Winkler Date: Wed Jun 21 15:49:19 2023 +0200 s390/lcs: Convert sprintf to scnprintf This LWN article explains the why scnprintf is preferred over snprintf in general https://lwn.net/Articles/69419/ Ie. snprintf() returns what *would* be the resulting length, while scnprintf() returns the actual length. Reported-by: Jules Irenge Reviewed-by: Alexandra Winter Signed-off-by: Thorsten Winkler Signed-off-by: Alexandra Winter Signed-off-by: Paolo Abeni commit d3f0c7fa09932d34bbf5548a156316927a099f25 Author: Thorsten Winkler Date: Wed Jun 21 15:49:18 2023 +0200 s390/lcs: Convert sysfs sprintf to sysfs_emit Following the advice of the Documentation/filesystems/sysfs.rst. All sysfs related show()-functions should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. While at it, follow Linux kernel coding style and unify indentation Reported-by: Jules Irenge Reported-by: Joe Perches Reviewed-by: Alexandra Winter Reviewed-by: Simon Horman Signed-off-by: Thorsten Winkler Signed-off-by: Alexandra Winter Signed-off-by: Paolo Abeni commit 8390dc7477e49e4acc9e553f385f4ff59d186efe Author: Andi Shyti Date: Mon Jun 12 00:56:49 2023 +0200 i2c: xiic: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Acked-by: Michal Simek Signed-off-by: Wolfram Sang commit ebe14dad2d033ec91c2c4b13e7fe7f1e54a65489 Merge: e6988447c15d6 ed1c6f35b73ec Author: Paolo Abeni Date: Fri Jun 23 10:59:21 2023 +0200 Merge branch 'net-hns3-there-are-some-cleanup-for-the-hns3-ethernet-driver' Hao Lan says: ==================== net: hns3: There are some cleanup for the HNS3 ethernet driver There are some cleanup for the HNS3 ethernet driver. ==================== Link: https://lore.kernel.org/r/20230621123309.34381-1-lanhao@huawei.com Signed-off-by: Paolo Abeni commit ed1c6f35b73ec9249c07ebbd300423155c7baac3 Author: Peiyang Wang Date: Wed Jun 21 20:33:09 2023 +0800 net: hns3: clear hns unused parameter alarm Several functions in the hns3 driver have unused parameters. The compiler will warn about them when building with -Wunused-parameter option of hns3. Signed-off-by: Peiyang Wang Signed-off-by: Hao Lan Signed-off-by: Paolo Abeni commit 1cf3d5567f273a8746d1bade00633a93204f80f0 Author: Hao Chen Date: Wed Jun 21 20:33:08 2023 +0800 net: hns3: fix strncpy() not using dest-buf length as length issue Now, strncpy() in hns3_dbg_fill_content() use src-length as copy-length, it may result in dest-buf overflow. This patch is to fix intel compile warning for csky-linux-gcc (GCC) 12.1.0 compiler. The warning reports as below: hclge_debugfs.c:92:25: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-truncation] strncpy(pos, items[i].name, strlen(items[i].name)); hclge_debugfs.c:90:25: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] strncpy(pos, result[i], strlen(result[i])); strncpy() use src-length as copy-length, it may result in dest-buf overflow. So,this patch add some values check to avoid this issue. Signed-off-by: Hao Chen Reported-by: kernel test robot Closes: https://lore.kernel.org/lkml/202207170606.7WtHs9yS-lkp@intel.com/T/ Signed-off-by: Hao Lan Signed-off-by: Paolo Abeni commit 9b476494da1aad70f4f083e853eb817bcb292d08 Author: Jian Shen Date: Wed Jun 21 20:33:07 2023 +0800 net: hns3: refine the tcam key convert handle The result of expression '(k ^ ~v) & k' is exactly the same with 'k & v', so simplify it. (k ^ ~v) & k == k & v The truth table (in non table form): k == 0, v == 0: (k ^ ~v) & k == (0 ^ ~0) & 0 == (0 ^ 1) & 0 == 1 & 0 == 0 k & v == 0 & 0 == 0 k == 0, v == 1: (k ^ ~v) & k == (0 ^ ~1) & 0 == (0 ^ 0) & 0 == 1 & 0 == 0 k & v == 0 & 1 == 0 k == 1, v == 0: (k ^ ~v) & k == (1 ^ ~0) & 1 == (1 ^ 1) & 1 == 0 & 1 == 0 k & v == 1 & 0 == 0 k == 1, v == 1: (k ^ ~v) & k == (1 ^ ~1) & 1 == (1 ^ 0) & 1 == 1 & 1 == 1 k & v == 1 & 1 == 1 Signed-off-by: Jian Shen Signed-off-by: Hao Lan Signed-off-by: Paolo Abeni commit 53431798f4bb60d214ae1ec4a79eefdd414f577b Author: Masami Hiramatsu (Google) Date: Mon Jun 12 20:58:57 2023 +0900 tracing/probes: Fix tracepoint event with $arg* to fetch correct argument To hide the first dummy 'data' argument on the tracepoint probe events, the BTF argument array was modified (skip the first argument for tracepoint), but the '$arg*' meta argument parser missed that. Fix to increment the argument index if it is tracepoint probe. And decrement the index when searching the type of the argument. Link: https://lore.kernel.org/all/168657113778.3038017.12245893750241701312.stgit@mhiramat.roam.corp.google.com/ Reviewed-by: Steven Rostedt (Google) Signed-off-by: Masami Hiramatsu (Google) commit a2bd0c08a459b4cb8da57cc9c754de5e45d7a61e Author: Masami Hiramatsu (Google) Date: Sun Jun 4 11:29:11 2023 +0900 Documentation: Fix typo of reference file name Fix a typo of Documentation/trace/fprobe.rst. Link: https://lore.kernel.org/all/168584575125.2056209.5771945721143181243.stgit@mhiramat.roam.corp.google.com/ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306040144.aD72UzkF-lkp@intel.com/ Reviewed-by: Steven Rostedt (Google) Signed-off-by: Masami Hiramatsu (Google) commit ed5f297802fca41d88fbfa6f9c13b218e7c6f5cb Author: Masami Hiramatsu (Google) Date: Sun Jun 4 11:29:00 2023 +0900 tracing/probes: Fix to return NULL and keep using current argc Fix to return NULL and keep using current argc when there is $argN and the BTF is not available. Link: https://lore.kernel.org/all/168584574094.2056209.2694238431743782342.stgit@mhiramat.roam.corp.google.com/ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306030940.Cej2JoUx-lkp@intel.com/ Reviewed-by: Steven Rostedt (Google) Signed-off-by: Masami Hiramatsu (Google) commit 5985329c7073924afc19132456d212e1e8b57b1f Author: Akanksha J N Date: Tue Jun 6 21:39:57 2023 +0900 selftests/ftrace: Add new test case which checks for optimized probes Add new test case kprobe_opt_types.tc which enables and checks if each probe has been optimized in order to test potential issues with optimized probes. The '|| continue' is added with the echo statement to ignore errors that are caused by trying to add kprobes to non probeable lines and continue with the test. Link: Link: https://lore.kernel.org/linux-trace-kernel/20230428163842.95118-3-akanksha@linux.ibm.com Signed-off-by: Akanksha J N Acked-by: Masami Hiramatsu (Google) Acked-by: Shuah Khan Acked-by: Steven Rostedt (Google) Signed-off-by: Masami Hiramatsu (Google) commit 3b7a628decfb3b385ca5169d7c415752bf40e536 Author: Ivan Orlov Date: Tue Jun 20 16:41:38 2023 +0200 comedi: make all 'class' structures const Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Cc: Ian Abbott Cc: H Hartley Sweeten Cc: Benjamin Tissoires Cc: Ivan Orlov Cc: Xuezhi Zhang Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620144137.581406-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 9ee202e69e29470e3a0a2406493538378d4e9a85 Author: Ivan Orlov Date: Tue Jun 20 16:38:00 2023 +0200 char: xillybus: make xillybus_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the xillybus_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Cc: Eli Billauer Cc: Arnd Bergmann Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Acked-by: Eli Billauer Link: https://lore.kernel.org/r/20230620143751.578239-18-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 936cb492a13e767c63b75ab84fd321682a18f9a5 Author: Ivan Orlov Date: Tue Jun 20 16:37:59 2023 +0200 xilinx_hwicap: make icap_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the icap_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Cc: Arnd Bergmann Cc: Michal Simek Cc: Benjamin Tissoires Cc: Ivan Orlov Cc: linux-arm-kernel@lists.infradead.org Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620143751.578239-17-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 11680fdf29cec560987fc8f6d290a5bfdb73e4e4 Author: Ivan Orlov Date: Tue Jun 20 16:37:58 2023 +0200 virtio_console: make port class a static const structure Now that the driver core allows for struct class to be in read-only memory, remove the class field of the ports_driver_data structure and create the port_class static class structure declared at build time which places it into read-only memory, instead of having it to be dynamically allocated at load time. Cc: Amit Shah Cc: Arnd Bergmann Cc: virtualization@lists.linux-foundation.org Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620143751.578239-16-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 98ab58a7a0b08be3f5ebdcb44fdf49127f749970 Author: Ivan Orlov Date: Tue Jun 20 16:37:57 2023 +0200 ppdev: make ppdev_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the ppdev_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Cc: Sudip Mukherjee Cc: Arnd Bergmann Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620143751.578239-15-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit eafd52e6971ab63dd9294df1e363951148f292cf Author: Ivan Orlov Date: Tue Jun 20 16:37:56 2023 +0200 char: misc: make misc_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the misc_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Cc: Arnd Bergmann Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620143751.578239-14-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 7671284b6c77df93b7dad8be40fe354dd4243a5d Author: Ivan Orlov Date: Tue Jun 20 16:37:55 2023 +0200 /dev/mem: make mem_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the mem_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Cc: Arnd Bergmann Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620143751.578239-13-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 03bcd4d8e9e6da7521b1bdff4116bfed9050cfa9 Author: Ivan Orlov Date: Tue Jun 20 16:37:54 2023 +0200 char: lp: make lp_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the lp_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Cc: Arnd Bergmann Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620143751.578239-12-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit bd31ef88361a1ca8435bf81551b2bba2d1e07457 Author: Ivan Orlov Date: Tue Jun 20 16:37:53 2023 +0200 dsp56k: make dsp56k_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the dsp56k_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Arnd Bergmann Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620143751.578239-11-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit e55ce9fd3d8fbf4e94fd5d0c72eb5b7d01fc4574 Author: Ivan Orlov Date: Tue Jun 20 16:37:52 2023 +0200 bsr: make bsr_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the bsr_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Arnd Bergmann Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620143751.578239-10-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 02fa4bcf4d15d7c93e6bb09d000d291dc2eb410e Author: Ivan Orlov Date: Tue Jun 20 20:34:47 2023 +0200 oradax: make 'cl' a static const structure Now that the driver core allows for struct class to be in read-only memory, move the 'cl' structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Cc: "David S. Miller" Cc: Andrew Morton Cc: Jonathan Corbet Cc: Benjamin Tissoires Cc: "Mike Rapoport (IBM)" Cc: Suren Baghdasaryan Cc: Ivan Orlov Cc: sparclinux@vger.kernel.org Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Acked-by: Sam Ravnborg Link: https://lore.kernel.org/r/20230620183446.684061-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit dcb31e8df8cf6e80ccfaad9d9c1fa286d38a87e9 Author: Andrew Davis Date: Mon May 15 12:50:41 2023 -0500 i2c: davinci: Use platform table macro over module_alias Generates the same platform module alias. More standard usage. Signed-off-by: Andrew Davis Reviewed-by: Bartosz Golaszewski [wsa: rebased to i2c/for-mergewindow] Signed-off-by: Wolfram Sang commit 9e1a1ee93f6b08aad5ee645073f7c7b115f71e15 Author: Wang Zhang Date: Fri May 26 15:05:33 2023 +0800 i2c: ocores: use devm_ managed clks Smatch complains that: drivers/i2c/busses/i2c-ocores.c:704 ocores_i2c_probe() warn: missing unwind goto? If any wrong occurs in ocores_i2c_of_probe, the i2c->clk needs to be released. But the function returns directly without freeing the clock. Fix this by updating the code to use devm_clk_get_optional_enabled() instead. Use dev_err_probe() where appropriate as well since we are changing those statements. Fixes: f5f35a92e44a ("i2c: ocores: Add irq support for sparc") Signed-off-by: Wang Zhang Reviewed-by: Andi Shyti Reviewed-by: Andrew Lunn Signed-off-by: Wolfram Sang commit 4a22870cede374d80c5d2f9c5b79253a5a667832 Author: Tree Davies Date: Wed Jun 21 16:09:35 2023 -0700 staging: rtl8192e: Remove whitespace and blank lines This patch cleans up extraneous whitespace for the struct rt_hi_throughput definition. Signed-off-by: Tree Davies Message-ID: Signed-off-by: Greg Kroah-Hartman commit b335f258e8ddafec0e8ae2201ca78d29ed8f85eb Author: Martin Kaiser Date: Fri Jun 16 16:59:21 2023 +0100 hwrng: imx-rngc - switch to DEFINE_SIMPLE_DEV_PM_OPS SIMPLE_DEV_PM_OPS is deprecated, replace it with DEFINE_SIMPLE_DEV_PM_OPS and use pm_sleep_ptr for setting the driver's pm routines. We can now remove the __maybe_unused qualifier in the suspend and resume functions. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit 501e197a02d4aef157f53ba3a0b9049c3e52fedc Author: Martin Kaiser Date: Fri Jun 16 09:58:13 2023 +0100 hwrng: st - keep clock enabled while hwrng is registered The st-rng driver uses devres to register itself with the hwrng core, the driver will be unregistered from hwrng when its device goes out of scope. This happens after the driver's remove function is called. However, st-rng's clock is disabled in the remove function. There's a short timeframe where st-rng is still registered with the hwrng core although its clock is disabled. I suppose the clock must be active to access the hardware and serve requests from the hwrng core. Switch to devm_clk_get_enabled and let devres disable the clock and unregister the hwrng. This avoids the race condition. Fixes: 3e75241be808 ("hwrng: drivers - Use device-managed registration API") Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit afa9d00ee0fda2387ad598d0b106e96a7ed360ae Author: Martin Kaiser Date: Fri Jun 16 09:58:12 2023 +0100 hwrng: st - support compile-testing Allow compile-testing the st-rng driver if we're not running on an ST chipset. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit d744ae7477190967a3ddc289e2cd4ae59e8b1237 Author: Martin Kaiser Date: Thu Jun 15 15:49:59 2023 +0100 hwrng: imx-rngc - fix the timeout for init and self check Fix the timeout that is used for the initialisation and for the self test. wait_for_completion_timeout expects a timeout in jiffies, but RNGC_TIMEOUT is in milliseconds. Call msecs_to_jiffies to do the conversion. Cc: stable@vger.kernel.org Fixes: 1d5449445bd0 ("hwrng: mx-rngc - add a driver for Freescale RNGC") Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit 63ba4d67594ad05b2c899b5a3a8cc7581052dd13 Author: Herbert Xu Date: Thu Jun 15 18:28:55 2023 +0800 KEYS: asymmetric: Use new crypto interface without scatterlists Use the new akcipher and sig interfaces which no longer have scatterlists in them. Signed-off-by: Herbert Xu commit e5221fa6a355112ddcc29dc82a94f7c3a1aacc0b Author: Herbert Xu Date: Thu Jun 15 18:28:53 2023 +0800 KEYS: asymmetric: Move sm2 code into x509_public_key The sm2 certificate requires a modified digest. Move the code for the hashing from the signature verification path into the code where we generate the digest. Signed-off-by: Herbert Xu commit b6d0695bb3c24ebe8dbaaaf61de791d5821a00ac Author: Herbert Xu Date: Thu Jun 15 18:28:50 2023 +0800 KEYS: Add forward declaration in asymmetric-parser.h Add forward declaration for struct key_preparsed_payload so that this header file is self-contained. Signed-off-by: Herbert Xu commit 6cb8815f41a966b217c0d9826c592254d72dcc31 Author: Herbert Xu Date: Thu Jun 15 18:28:48 2023 +0800 crypto: sig - Add interface for sign/verify Split out the sign/verify functionality from the existing akcipher interface. Most algorithms in akcipher either support encryption and decryption, or signing and verify. Only one supports both. As a signature algorithm may not support encryption at all, these two should be spearated. For now sig is simply a wrapper around akcipher as all algorithms remain unchanged. This is a first step and allows users to start allocating sig instead of akcipher. Signed-off-by: Herbert Xu commit addde1f2c966833f210e9318b17050293086b8c6 Author: Herbert Xu Date: Thu Jun 15 18:28:46 2023 +0800 crypto: akcipher - Add sync interface without SG lists The only user of akcipher does not use SG lists. Therefore forcing users to use SG lists only results unnecessary overhead. Add a new interface that supports arbitrary kernel pointers. For the time being the copy will be performed unconditionally. But this will go away once the underlying interface is updated. Note also that only encryption and decryption is addressed by this patch as sign/verify will go into a new interface (sig). Signed-off-by: Herbert Xu commit 9979c6e55d2b54ed6e0ce69b6f7faa7889549402 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Wed Jun 14 18:46:43 2023 +0100 crypto: cipher - On clone do crypto_mod_get() The refcounter of underlying algorithm should be incremented, otherwise it'll be destroyed with the cloned cipher, wrecking the original cipher. Signed-off-by: Dmitry Safonov Signed-off-by: Herbert Xu commit fa3b3565f3ac5a468e3efebca00e10db5db3d6bb Author: Herbert Xu Date: Thu Jun 15 17:00:51 2023 +0800 crypto: api - Add __crypto_alloc_tfmgfp Use it straight away in crypto_clone_cipher(), as that is not meant to sleep. Fixes: 51d8d6d0f4be ("crypto: cipher - Add crypto_clone_cipher") Signed-off-by: Dmitry Safonov Signed-off-by: Herbert Xu commit fa919f9e8857bfe230891a8b7ea6d7f69396cdc5 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Wed Jun 14 18:46:41 2023 +0100 crypto: api - Remove crypto_init_ops() Purge crypto_type::init() as well. The last user seems to be gone with commit d63007eb954e ("crypto: ablkcipher - remove deprecated and unused ablkcipher support"). Signed-off-by: Dmitry Safonov Reviewed-by: Eric Biggers Signed-off-by: Herbert Xu commit 6637e11e4ad22ff03183da0dbd36d65c98b81cf7 Author: Mahmoud Adam Date: Tue Jun 13 16:17:31 2023 +0000 crypto: rsa - allow only odd e and restrict value in FIPS mode check if rsa public exponent is odd and check its value is between 2^16 < e < 2^256. FIPS 186-5 DSS (page 35)[1] specify that: 1. The public exponent e shall be selected with the following constraints: (a) The public verification exponent e shall be selected prior to generating the primes, p and q, and the private signature exponent d. (b) The exponent e shall be an odd positive integer such that: 2^16 < e < 2^256. [1] https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf Signed-off-by: Mahmoud Adam Reviewed-by: Stephan Mueller Signed-off-by: Herbert Xu commit ba51738fa78972fb446b49b6b9ddda4058a272e0 Author: Herbert Xu Date: Tue Jun 13 17:13:35 2023 +0800 crypto: geniv - Split geniv out of AEAD Kconfig option Give geniv its own Kconfig option so that its dependencies are distinct from that of the AEAD API code. This also allows it to be disabled if no IV generators (seqiv/echainiv) are enabled. Remove the obsolete select on RNG2 by SKCIPHER2 as skcipher IV generators disappeared long ago. Signed-off-by: Herbert Xu commit fb28fabfad332a731423ffdd2be122b73ea90f1e Author: Herbert Xu Date: Tue Jun 13 16:49:24 2023 +0800 crypto: algboss - Add missing dependency on RNG2 The testmgr code uses crypto_rng without depending on it. Add an explicit dependency to Kconfig. Also sort the MANAGER2 dependencies alphabetically. Signed-off-by: Herbert Xu commit 445a4aaf5842073e4130b1d6dbe3785284d9615f Author: Jia Jie Ho Date: Mon Jun 12 16:52:30 2023 +0800 crypto: starfive - Add RSA algo support Adding RSA enc/dec and sign/verify feature for StarFive cryptographic module. The module only supports mod sizes up to 2048, therefore calculations more than that will use fallback algo. Co-developed-by: Huan Feng Signed-off-by: Huan Feng Signed-off-by: Jia Jie Ho Signed-off-by: Herbert Xu commit df12284ad3dc1db11bdc784265a4947d3db29c06 Author: Jia Jie Ho Date: Mon Jun 12 16:52:29 2023 +0800 crypto: starfive - Update hash module irq handling Hash driver needs to check the value of irq mask register before writing as it will mask irq of other modules. Co-developed-by: Huan Feng Signed-off-by: Huan Feng Signed-off-by: Jia Jie Ho Signed-off-by: Herbert Xu commit 1abc89661ad3cd18d8c6af5c2584bcc63df43bf2 Author: Meenakshi Aggarwal Date: Mon Jun 12 10:30:42 2023 +0200 crypto: caam - optimize RNG sample size TRNG "sample size" (the total number of entropy samples that will be taken during entropy generation) default / POR value is very conservatively set to 2500. Let's set it to 512, the same as the caam driver in U-boot (drivers/crypto/fsl_caam.c) does. This solves the issue of RNG performance dropping after a suspend/resume cycle on parts where caam loses power, since the initial U-boot setttings are lost and kernel does not restore them when resuming. Note: when changing the sample size, the self-test parameters need to be updated accordingly. Signed-off-by: Horia Geantă Signed-off-by: Meenakshi Aggarwal Reviewed-by: Gaurav Jain Signed-off-by: Herbert Xu commit 2be0d806e25e7b068113187f9245575914daf0dc Author: Victoria Milhoan (b42089) Date: Mon Jun 12 10:28:42 2023 +0200 crypto: caam - add a test for the RNG CAAM includes a Random Number Generator. This change adds a kernel configuration option to test the RNG's capabilities via the hw_random framework. Signed-off-by: Victoria Milhoan Signed-off-by: Dan Douglass Signed-off-by: Vipul Kumar Signed-off-by: Horia Geantă Signed-off-by: Meenakshi Aggarwal Reviewed-by: Gaurav Jain Signed-off-by: Herbert Xu commit ef492d080302913e85122a2d92efa2ca174930f8 Author: Victoria Milhoan Date: Mon Jun 12 10:26:15 2023 +0200 crypto: caam - adjust RNG timing to support more devices Adjust RNG timing parameters to support more i.MX6 devices. Signed-off-by: Victoria Milhoan Signed-off-by: Dan Douglass Signed-off-by: Vipul Kumar Signed-off-by: Horia Geantă Reviewed-by: Gaurav Jain Signed-off-by: Herbert Xu commit 4a1b5ba16e27cdfa71310393673d5799d8c02af1 Merge: 724418b84e624 33cd7630782df Author: Takashi Iwai Date: Fri Jun 23 09:56:19 2023 +0200 Merge branch 'topic/midi20' into for-next Pull one more API update for UMP core. Signed-off-by: Takashi Iwai commit 33cd7630782df2230529c3e8f1a6d0ae9cd6ab49 Author: Takashi Iwai Date: Fri Jun 23 09:55:30 2023 +0200 ALSA: ump: Export MIDI1 / UMP conversion helpers Yet more preliminary work for the upcoming USB gadget support. Now export the helpers to convert between legacy MIDI1 and UMP data for handling the MIDI 1.0 USB interface. The header file is moved to include/sound. The API functions are slightly changed, so that they can be used without the direct access to snd_ump object. The allocation is done in ump.c itself as it's a simple kcalloc(). Link: https://lore.kernel.org/r/20230623075530.10976-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 18af4b5c97915a6daef9de28a30ae1d3786bc2ac Author: Wesley Cheng Date: Wed May 31 15:27:19 2023 -0700 usb: host: xhci-plat: Set XHCI_STATE_REMOVING before resuming XHCI HC There are situations during the xhci_resume() sequence, which allows for re-initializing of the XHCI HC. However, in case the HCD is being removed, these operations may not be needed. Set the removal state before issuing the runtime PM get on the XHCI device, so that the XHCI resume routine will know when to bypass the re-init logic. Signed-off-by: Wesley Cheng Message-ID: <20230531222719.14143-3-quic_wcheng@quicinc.com> Signed-off-by: Greg Kroah-Hartman commit fb2ce17874cf3c3c183e5fd75144ffbe2313bf31 Author: Wesley Cheng Date: Wed May 31 15:27:18 2023 -0700 usb: host: xhci: Do not re-initialize the XHCI HC if being removed During XHCI resume, if there was a host controller error detected the routine will attempt to re-initialize the XHCI HC, so that it can return back to an operational state. If the XHCI host controller is being removed, this sequence would be already handled within the XHCI halt path, leading to a duplicate set of reg ops/calls. In addition, since the XHCI bus is being removed, the overhead added in restarting the HCD is unnecessary. Check for the XHC state before setting the reinit_xhc parameter, which is responsible for triggering the restart. Signed-off-by: Wesley Cheng Message-ID: <20230531222719.14143-2-quic_wcheng@quicinc.com> Signed-off-by: Greg Kroah-Hartman commit 256a02e2caa3c606b84a40e8035e240beb93e67b Author: Neil Armstrong Date: Thu Jun 22 18:16:26 2023 +0200 usb: typec: nb7vpq904m: fix CONFIG_DRM dependency With the following config set: CONFIG_DRM=m CONFIG_DRM_PANEL=y CONFIG_DRM_BRIDGE=y CONFIG_DRM_PANEL_BRIDGE=y CONFIG_TYPEC_MUX_NB7VPQ904M=y vmlinux fails on the following symbols: ld.lld: error: undefined symbol: devm_drm_bridge_add ld.lld: error: undefined symbol: devm_drm_of_get_bridge Add dependendy on DRM || DRM=no since CONFIG_DRM dependency is optional and guarded by: IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE) in the drive. Also add "select DRM_PANEL_BRIDGE if DRM" to clarify DRM_PANEL_BRIDGE is required if CONFIG_DRM is enabled. Fixes: 88d8f3ac9c67 ("usb: typec: add support for the nb7vpq904m Type-C Linear Redriver") Reported-by: Arnd Bergmann Suggested-by: Arnd Bergmann Signed-off-by: Neil Armstrong Message-ID: <20230622-topic-sm8x50-upstream-redriver-config-fix-v1-1-005ab6f4d1f5@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 61d52f64ac58f917e47175cbc5bb54ee9a672209 Author: Azeem Shaikh Date: Thu Jun 15 18:05:04 2023 +0000 usbip: usbip_host: Replace strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since return value of -errno is used to check for truncation instead of sizeof(dest). [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Acked-by: Shuah Khan Message-ID: <20230615180504.401169-1-azeemshaikh38@gmail.com> Signed-off-by: Greg Kroah-Hartman commit c0aabed9cabe057309779a9e26fe86a113d24dad Author: Krishna Kurapati Date: Sun Jun 18 17:39:49 2023 +0530 usb: dwc3: gadget: Propagate core init errors to UDC during pullup In scenarios where pullup relies on resume (get sync) to initialize the controller and set the run stop bit, then core_init is followed by gadget_resume which will eventually set run stop bit. But in cases where the core_init fails, the return value is not sent back to udc appropriately. So according to UDC the controller has started but in reality we never set the run stop bit. On systems like Android, there are uevents sent to HAL depending on whether the configfs_bind / configfs_disconnect were invoked. In the above mentioned scnenario, if the core init fails, the run stop won't be set and the cable plug-out won't result in generation of any disconnect event and userspace would never get any uevent regarding cable plug out and we never call pullup(0) again. Furthermore none of the next Plug-In/Plug-Out's would be known to configfs. Return back the appropriate result to UDC to let the userspace/ configfs know that the pullup failed so they can take appropriate action. Fixes: 77adb8bdf422 ("usb: dwc3: gadget: Allow runtime suspend if UDC unbinded") Cc: stable Signed-off-by: Krishna Kurapati Acked-by: Thinh Nguyen Message-ID: <20230618120949.14868-1-quic_kriskura@quicinc.com> Signed-off-by: Greg Kroah-Hartman commit 0e5342f634b26eed0a0fb21daa53a45449396c3f Merge: e6ecc0414c871 ffa5f7a3bf28c Author: Greg Kroah-Hartman Date: Fri Jun 23 09:43:31 2023 +0200 Merge tag 'usb-serial-6.5-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for 6.5-rc1 Here are the USB-serial updates for 6.5-rc1, including: - improved error handling for break signalling - report to user space when a device does not support break signalling Included are also some new modem device ids. All have been in linux-next with no reported issues. * tag 'usb-serial-6.5-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add LARA-R6 01B PIDs USB: serial: report unsupported break signalling USB: serial: cp210x: disable break signalling on CP2105 SCI USB: serial: return errors from break handling commit 8b5bf64c89c7100c921bd807ba39b2eb003061ab Author: Feng Mingxi Date: Tue Apr 25 06:56:11 2023 +0000 clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe Smatch reports: drivers/clocksource/timer-cadence-ttc.c:529 ttc_timer_probe() warn: 'timer_baseaddr' from of_iomap() not released on lines: 498,508,516. timer_baseaddr may have the problem of not being released after use, I replaced it with the devm_of_iomap() function and added the clk_put() function to cleanup the "clk_ce" and "clk_cs". Fixes: e932900a3279 ("arm: zynq: Use standard timer binding") Fixes: 70504f311d4b ("clocksource/drivers/cadence_ttc: Convert init function to return error") Signed-off-by: Feng Mingxi Reviewed-by: Dongliang Mu Acked-by: Michal Simek Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230425065611.702917-1-m202271825@hust.edu.cn commit 6d0d4df8e7e1fe22d961d667c2bfa40c3d5022e8 Author: Sergio Paracuellos Date: Tue Jun 20 12:02:31 2023 +0200 dt-bindings: timers: Add Ralink SoCs timer Add YAML documentation for the timer which is present on Ralink SoCs. Signed-off-by: Sergio Paracuellos Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230620100231.1412582-1-sergio.paracuellos@gmail.com commit e5313f1c540434b18ea57927633b1584c534b14a Author: Michael Kelley Date: Mon Jun 19 12:02:40 2023 -0700 clocksource/drivers/hyper-v: Rework clocksource and sched clock setup Current code assigns either the Hyper-V TSC page or MSR-based ref counter as the sched clock. This may be sub-optimal in two cases. First, if there is hardware support to ensure consistent TSC frequency across live migrations and Hyper-V is using that support, the raw TSC is a faster source of time than the Hyper-V TSC page. Second, the MSR-based ref counter is relatively slow because reads require a trap to the hypervisor. As such, it should never be used as the sched clock. The native sched clock based on the raw TSC or jiffies is much better. Rework the sched clock setup so it is set to the TSC page only if Hyper-V indicates that the TSC may have inconsistent frequency across live migrations. Also, remove the code that sets the sched clock to the MSR-based ref counter. In the cases where it is not set, the sched clock will then be the native sched clock. As part of the rework, always enable both the TSC page clocksource and the MSR-based ref counter clocksource. Set the ratings so the TSC page clocksource is preferred. While the MSR-based ref counter clocksource is unlikely to ever be the default, having it available for manual selection is convenient for development purposes. Signed-off-by: Michael Kelley Reviewed-by: Dexuan Cui Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1687201360-16003-1-git-send-email-mikelley@microsoft.com commit 038d454ad996a5e275d46188d65d890d2a243f36 Author: Stanislav Jakubek Date: Sun Jun 18 16:46:35 2023 +0200 dt-bindings: timer: brcm,kona-timer: convert to YAML Convert Broadcom Kona family timer bindings to DT schema. Changes during conversion: - drop deprecated compatible (it's been deprecated for ~10 years) Signed-off-by: Stanislav Jakubek Reviewed-by: Krzysztof Kozlowski Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230618144635.GA22166@standask-GA-A55M-S2HP commit 281bf6b94aec092096d788b56c106a8c9c2a432a Author: Uwe Kleine-König Date: Tue Mar 28 12:05:31 2023 +0200 clocksource/drivers/imx-gpt: Fold into its only user Only the imx-gpt timer driver makes use of enum imx_gpt_type that is otherwise unused. Move its definition into the timer-imx-gpt driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230328100531.879485-3-u.kleine-koenig@pengutronix.de commit 011da162da2f915989a571b557867f7eea699000 Author: Uwe Kleine-König Date: Tue Mar 28 12:05:30 2023 +0200 clk: imx: Drop inclusion of unused header The clk drivers use none of the symbols defined in . Signed-off-by: Uwe Kleine-König Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230328100531.879485-2-u.kleine-koenig@pengutronix.de commit 46e66dab8565f742374e9cc4ff7d35f344d774e2 Author: Tarun Sahu Date: Wed Jun 21 21:20:25 2023 +0530 dax/kmem: Pass valid argument to memory_group_register_static memory_group_register_static takes maximum number of pages as the argument while dev_dax_kmem_probe passes total_len (in bytes) as the argument. IIUC, I don't see any crash/panic impact as such. As, memory_group_register_static just set the max_pages limit which is used in auto_movable_zone_for_pfn to determine the zone. which might cause these condition to behave differently, This will be true always so jump will happen to kernel_zone ... if (!auto_movable_can_online_movable(NUMA_NO_NODE, group, nr_pages)) goto kernel_zone; ... kernel_zone: return default_kernel_zone_for_pfn(nid, pfn, nr_pages); Here, In below, zone_intersects compare range will be larger as nr_pages will be higher (derived from total_len passed in dev_dax_kmem_probe). ... static struct zone *default_kernel_zone_for_pfn(int nid, unsigned long start_pfn, unsigned long nr_pages) { struct pglist_data *pgdat = NODE_DATA(nid); int zid; for (zid = 0; zid < ZONE_NORMAL; zid++) { struct zone *zone = &pgdat->node_zones[zid]; if (zone_intersects(zone, start_pfn, nr_pages)) return zone; } return &pgdat->node_zones[ZONE_NORMAL]; } Incorrect zone will be returned here, which in later time might cause bigger problem. Fixes: eedf634aac3b ("dax/kmem: use a single static memory group for a single probed unit") Signed-off-by: Tarun Sahu Link: https://lore.kernel.org/r/20230621155025.370672-1-tsahu@linux.ibm.com Reviewed-by: Vishal Verma Signed-off-by: Vishal Verma commit dd0c64258a9d9e74b4896f05c7e77fa3365b5f12 Author: Colin Ian King Date: Wed Jun 21 14:02:56 2023 +0100 fsdax: remove redundant variable 'error' The variable 'error' is being assigned a value that is never read, the assignment and the variable and redundant and can be removed. Cleans up clang scan build warning: fs/dax.c:1880:10: warning: Although the value stored to 'error' is used in the enclosing expression, the value is never actually read from 'error' [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20230621130256.2676126-1-colin.i.king@gmail.com Reviewed-by: Jan Kara Signed-off-by: Vishal Verma commit 2532f41607c4308733239dd43278f8a5540f3ec7 Author: Dan Williams Date: Fri Jun 2 23:14:11 2023 -0700 dax: Cleanup extra dax_region references Now that free_dev_dax_id() internally manages the references it needs the extra references taken by the dax_region drivers are not needed. Reported-by: Ira Weiny Signed-off-by: Dan Williams Link: https://lore.kernel.org/r/168577285161.1672036.8111253437794419696.stgit@dwillia2-xfh.jf.intel.com Reviewed-by: Dave Jiang Reviewed-by: Fan Ni Reviewed-by: Ira Weiny Signed-off-by: Vishal Verma commit 70aab281e18c68a1284bc387de127c2fc0bed3f8 Author: Dan Williams Date: Fri Jun 2 23:14:05 2023 -0700 dax: Introduce alloc_dev_dax_id() The reference counting of dax_region objects is needlessly complicated, has lead to confusion [1], and has hidden a bug [2]. Towards cleaning up that mess introduce alloc_dev_dax_id() to minimize the holding of a dax_region reference to only what dev_dax_release() needs, the dax_region->ida. Part of the reason for the mess was the design to dereference a dax_region in all cases in free_dev_dax_id() even if the id was statically assigned by the upper level dax_region driver. Remove the need to call "is_static(dax_region)" by tracking whether the id is dynamic directly in the dev_dax instance itself. With that flag the dax_region pinning and release per dev_dax instance can move to alloc_dev_dax_id() and free_dev_dax_id() respectively. A follow-on cleanup address the unnecessary references in the dax_region setup and drivers. Fixes: 0f3da14a4f05 ("device-dax: introduce 'seed' devices") Link: http://lore.kernel.org/r/20221203095858.612027-1-liuyongqiang13@huawei.com [1] Link: http://lore.kernel.org/r/3cf0890b-4eb0-e70e-cd9c-2ecc3d496263@hpe.com [2] Reported-by: Yongqiang Liu Reported-by: Paul Cassella Reported-by: Ira Weiny Signed-off-by: Dan Williams Link: https://lore.kernel.org/r/168577284563.1672036.13493034988900989554.stgit@dwillia2-xfh.jf.intel.com Reviewed-by: Ira Weiny Signed-off-by: Vishal Verma commit 82b4ceeccb89cfd0b03706f1b15e31a7db6a027d Author: Dan Williams Date: Fri Jun 2 23:13:59 2023 -0700 dax: Use device_unregister() in unregister_dax_mapping() Replace an open-coded device_unregister() sequence with the helper. Signed-off-by: Dan Williams Link: https://lore.kernel.org/r/168577283989.1672036.7777592498865470652.stgit@dwillia2-xfh.jf.intel.com Reviewed-by: Dave Jiang Reviewed-by: Fan Ni Reviewed-by: Ira Weiny Signed-off-by: Vishal Verma commit 6d24b170a9db0456f577b1ab01226a2254c016a8 Author: Dan Williams Date: Fri Jun 2 23:13:54 2023 -0700 dax: Fix dax_mapping_release() use after free A CONFIG_DEBUG_KOBJECT_RELEASE test of removing a device-dax region provider (like modprobe -r dax_hmem) yields: kobject: 'mapping0' (ffff93eb460e8800): kobject_release, parent 0000000000000000 (delayed 2000) [..] DEBUG_LOCKS_WARN_ON(1) WARNING: CPU: 23 PID: 282 at kernel/locking/lockdep.c:232 __lock_acquire+0x9fc/0x2260 [..] RIP: 0010:__lock_acquire+0x9fc/0x2260 [..] Call Trace: [..] lock_acquire+0xd4/0x2c0 ? ida_free+0x62/0x130 _raw_spin_lock_irqsave+0x47/0x70 ? ida_free+0x62/0x130 ida_free+0x62/0x130 dax_mapping_release+0x1f/0x30 device_release+0x36/0x90 kobject_delayed_cleanup+0x46/0x150 Due to attempting ida_free() on an ida object that has already been freed. Devices typically only hold a reference on their parent while registered. If a child needs a parent object to complete its release it needs to hold a reference that it drops from its release callback. Arrange for a dax_mapping to pin its parent dev_dax instance until dax_mapping_release(). Fixes: 0b07ce872a9e ("device-dax: introduce 'mapping' devices") Signed-off-by: Dan Williams Link: https://lore.kernel.org/r/168577283412.1672036.16111545266174261446.stgit@dwillia2-xfh.jf.intel.com Reviewed-by: Dave Jiang Reviewed-by: Fan Ni Reviewed-by: Ira Weiny Signed-off-by: Vishal Verma commit d06593aa00b2bb1cc1ac9d88157bb8db0ac17872 Author: Ian Rogers Date: Thu Jun 22 21:38:43 2023 -0700 perf pmu: Remove a hard coded cpu PMU assumption The property of "cpu" when it has no cpu map is true on S390 with the PMU cpum_cf. Rather than maintain a list of such PMUs, reuse the is_core test result from the caller. Signed-off-by: Ian Rogers Tested-by: Thomas Richter Cc: Ravi Bangoria Cc: James Clark Cc: Mark Rutland Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: Kan Liang Cc: Ingo Molnar Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Link: https://lore.kernel.org/r/20230623043843.4080180-2-irogers@google.com Signed-off-by: Namhyung Kim commit d685819b40affd39d2fbc937e93b2eee7fc63dd5 Author: Ian Rogers Date: Thu Jun 22 21:38:42 2023 -0700 perf pmus: Add notion of default PMU for JSON events JSON events created in pmu-events.c by jevents.py may not specify a PMU they are associated with, in which case it is implied that it is the first core PMU. Care is needed to select this for regular 'cpu', s390 'cpum_cf' and ARMs many names as at the point the name is first needed the core PMUs list hasn't been initialized. Add a helper in perf_pmus to create this value, in the worst case by scanning sysfs. v2. Add missing close if fdopendir fails. Signed-off-by: Ian Rogers Tested-by: Thomas Richter Cc: Ravi Bangoria Cc: James Clark Cc: Mark Rutland Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Thomas Richter Cc: Alexander Shishkin Cc: Kan Liang Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623043843.4080180-1-irogers@google.com Signed-off-by: Namhyung Kim commit 33941dbd14da4eac40a26ac5fd5f84e1842ffc3a Author: Ian Rogers Date: Thu Jun 22 21:31:07 2023 -0700 perf unwind: Fix map reference counts The result of thread__find_map is the map in the passed in addr_location. Calling addr_location__exit puts that map and so copies need to do a map__get. Add in the corresponding map__puts. v2. Add missing map__put when dso is missing. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Mark Rutland Cc: Ivan Babrou Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230623043107.4077510-1-irogers@google.com Signed-off-by: Namhyung Kim commit e4ef3ef1bc0a3d2535427da78b8095ef657eb474 Author: Namhyung Kim Date: Thu Jun 22 16:53:57 2023 -0700 perf test: Set PERF_EXEC_PATH for script execution The task-analyzer.py script (actually every other scripts too) requires PERF_EXEC_PATH env to find dependent libraries and scripts. For scripts test to run correctly, it needs to set PERF_EXEC_PATH to the perf tool source directory. Instead of blindly update the env, let's check the directory structure to make sure it points to the correct location. Fixes: e8478b84d6ba ("perf test: add new task-analyzer tests") Cc: Petar Gligoric Cc: Hagen Paul Pfeifer Cc: Aditya Gupta Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Ingo Molnar Acked-by: Ian Rogers Signed-off-by: Namhyung Kim commit 2d7f5540b8696b855adf4121ce4a9bf77938848f Author: Namhyung Kim Date: Thu Jun 22 16:53:56 2023 -0700 perf script: Initialize buffer for regs_map() The buffer is used to save register mapping in a sample. Normally perf samples don't have any register so the string should be empty. But it missed to initialize the buffer when the size is 0. And it's passed to PyUnicode_FromString() with a garbage data. So it returns NULL due to invalid input (instead of an empty unicode string object) which causes a segfault like below: Thread 2.1 "perf" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff7c83780 (LWP 193775)] 0x00007ffff6dbca2e in PyDict_SetItem () from /lib/x86_64-linux-gnu/libpython3.11.so.1.0 (gdb) bt #0 0x00007ffff6dbca2e in PyDict_SetItem () from /lib/x86_64-linux-gnu/libpython3.11.so.1.0 #1 0x00007ffff6dbf848 in PyDict_SetItemString () from /lib/x86_64-linux-gnu/libpython3.11.so.1.0 #2 0x000055555575824d in pydict_set_item_string_decref (val=0x0, key=0x5555557f96e3 "iregs", dict=0x7ffff5f7f780) at util/scripting-engines/trace-event-python.c:145 #3 set_regs_in_dict (evsel=0x555555efc370, sample=0x7fffffffb870, dict=0x7ffff5f7f780) at util/scripting-engines/trace-event-python.c:776 #4 get_perf_sample_dict (sample=sample@entry=0x7fffffffb870, evsel=evsel@entry=0x555555efc370, al=al@entry=0x7fffffffb2e0, addr_al=addr_al@entry=0x0, callchain=callchain@entry=0x7ffff63ef440) at util/scripting-engines/trace-event-python.c:923 #5 0x0000555555758ec1 in python_process_tracepoint (sample=0x7fffffffb870, evsel=0x555555efc370, al=0x7fffffffb2e0, addr_al=0x0) at util/scripting-engines/trace-event-python.c:1044 #6 0x00005555555c5db8 in process_sample_event (tool=, event=, sample=, evsel=0x555555efc370, machine=0x555555ef4d68) at builtin-script.c:2421 #7 0x00005555556b7793 in perf_session__deliver_event (session=0x555555ef4b60, event=0x7ffff62ff7d0, tool=0x7fffffffc150, file_offset=30672, file_path=0x555555efb8a0 "perf.data") at util/session.c:1639 #8 0x00005555556bc864 in do_flush (show_progress=true, oe=0x555555efb700) at util/ordered-events.c:245 #9 __ordered_events__flush (oe=oe@entry=0x555555efb700, how=how@entry=OE_FLUSH__FINAL, timestamp=timestamp@entry=0) at util/ordered-events.c:324 #10 0x00005555556bd06e in ordered_events__flush (oe=oe@entry=0x555555efb700, how=how@entry=OE_FLUSH__FINAL) at util/ordered-events.c:342 #11 0x00005555556b9d63 in __perf_session__process_events (session=0x555555ef4b60) at util/session.c:2465 #12 perf_session__process_events (session=0x555555ef4b60) at util/session.c:2627 #13 0x00005555555cb1d0 in __cmd_script (script=0x7fffffffc150) at builtin-script.c:2839 #14 cmd_script (argc=, argv=) at builtin-script.c:4365 #15 0x0000555555650811 in run_builtin (p=p@entry=0x555555ed8948 , argc=argc@entry=4, argv=argv@entry=0x7fffffffe240) at perf.c:323 #16 0x0000555555597eb3 in handle_internal_command (argv=0x7fffffffe240, argc=4) at perf.c:377 #17 run_argv (argv=, argcp=) at perf.c:421 #18 main (argc=4, argv=0x7fffffffe240) at perf.c:537 Fixes: 51cfe7a3e87e ("perf python: Avoid 2 leak sanitizer issues") Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Ingo Molnar Acked-by: Ian Rogers Signed-off-by: Namhyung Kim commit 33fe7c08446af6dda0ff08ff4fa9c921e574477f Author: James Clark Date: Thu Jun 22 11:18:09 2023 +0100 perf tests: Fix test_arm_callgraph_fp variable expansion $TEST_PROGRAM is a command with spaces so it's supposed to be word split. The referenced fix to fix the shellcheck warnings incorrectly quoted this string so unquote it to fix the test. At the same time silence the shellcheck warning for that line and fix two more shellcheck errors at the end of the script. Fixes: 1bb17b4c6c91 ("perf tests arm_callgraph_fp: Address shellcheck warnings about signal names and adding double quotes for expression") Signed-off-by: James Clark Acked-by: Namhyung Kim Cc: Mark Rutland Cc: Ian Rogers Cc: spoorts2@in.ibm.com Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Kajol Jain Cc: Alexander Shishkin Cc: Athira Rajeev Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230622101809.2431897-1-james.clark@arm.com Signed-off-by: Namhyung Kim commit e6988447c15d622d11c68250a33f47b3cacb66eb Merge: 08eeccb2491a3 31b5a547622b3 Author: Jakub Kicinski Date: Thu Jun 22 20:09:13 2023 -0700 Merge tag 'wireless-next-2023-06-22' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Johannes Berg says: ==================== Notable changes this time around: MAINTAINERS - add missing driver git trees ath11k - factory test mode support iwlwifi - config rework to drop test devices and split the different families - major update for new firmware and MLO stack - initial multi-link reconfiguration suppor - multi-BSSID and MLO improvements other - fix the last few W=1 warnings from GCC 13 - merged wireless tree to avoid conflicts * tag 'wireless-next-2023-06-22' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (245 commits) wifi: ieee80211: fix erroneous NSTR bitmap size checks wifi: rtlwifi: cleanup USB interface wifi: rtlwifi: simplify LED management wifi: ath10k: improve structure padding wifi: ath9k: convert msecs to jiffies where needed wifi: iwlwifi: mvm: Add support for IGTK in D3 resume flow wifi: iwlwifi: mvm: update two most recent GTKs on D3 resume flow wifi: iwlwifi: mvm: Refactor security key update after D3 wifi: mac80211: mark keys as uploaded when added by the driver wifi: iwlwifi: remove support of A0 version of FM RF wifi: iwlwifi: cfg: clean up Bz module firmware lines wifi: iwlwifi: pcie: add device id 51F1 for killer 1675 wifi: iwlwifi: bump FW API to 83 for AX/BZ/SC devices wifi: iwlwifi: cfg: remove trailing dash from FW_PRE constants wifi: iwlwifi: also unify Ma device configurations wifi: iwlwifi: also unify Sc device configurations wifi: iwlwifi: unify Bz/Gl device configurations wifi: iwlwifi: pcie: also drop jacket from info macro wifi: iwlwifi: remove support for *nJ devices wifi: iwlwifi: don't load old firmware for 22000 ... ==================== Link: https://lore.kernel.org/r/20230622185602.147650-2-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit 08eeccb2491a3198f4adcba63adeace6e2499ea3 Merge: 0ec92a8f56ff0 790ef3901f18b Author: Jakub Kicinski Date: Thu Jun 22 20:05:25 2023 -0700 Merge tag 'linux-can-next-for-6.5-20230622' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2023-06-22 The first patch is by Carsten Schmidt, targets the kvaser_usb driver and adds len8_dlc support. Marcel Hellwig's patch for the xilinx_can driver adds support for CAN transceivers via the PHY framework. Frank Jungclaus contributes 6+2 patches for the esd_usb driver in preparation for the upcoming CAN-USB/3 support. The 2 patches by Miquel Raynal for the sja1000 driver work around overruns stalls on the Renesas SoCs. The next 3 patches are by me and fix the coding style in the rx-offload helper and in the m_can and ti_hecc driver. Vincent Mailhol contributes 3 patches to fix and update the calculation of the length of CAN frames on the wire. Oliver Hartkopp's patch moves the CAN_RAW_FILTER_MAX definition into the correct header. The remaining 14 patches are by Jimmy Assarsson, target the kvaser_pciefd driver and bring various updates and improvements. * tag 'linux-can-next-for-6.5-20230622' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: (33 commits) can: kvaser_pciefd: Use TX FIFO size read from CAN controller can: kvaser_pciefd: Refactor code can: kvaser_pciefd: Add len8_dlc support can: kvaser_pciefd: Use FIELD_{GET,PREP} and GENMASK where appropriate can: kvaser_pciefd: Sort register definitions can: kvaser_pciefd: Change return type for kvaser_pciefd_{receive,transmit,set_tx}_irq() can: kvaser_pciefd: Rename device ID defines can: kvaser_pciefd: Sort includes in alphabetic order can: kvaser_pciefd: Remove SPI flash parameter read functionality can: uapi: move CAN_RAW_FILTER_MAX definition to raw.h can: kvaser_pciefd: Define unsigned constants with type suffix 'U' can: kvaser_pciefd: Set hardware timestamp on transmitted packets can: kvaser_pciefd: Add function to set skb hwtstamps can: kvaser_pciefd: Remove handler for unused KVASER_PCIEFD_PACK_TYPE_EFRAME_ACK can: kvaser_pciefd: Remove useless write to interrupt register can: length: refactor frame lengths definition to add size in bits can: length: fix bitstuffing count can: length: fix description of the RRS field can: m_can: fix coding style can: ti_hecc: fix coding style ... ==================== Link: https://lore.kernel.org/r/20230622082658.571150-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit 6f68fc395f49fb43f6ae801c340953ee4f793e98 Merge: fc0649395dca8 e38910c0072b5 Author: Jakub Kicinski Date: Thu Jun 22 20:02:11 2023 -0700 Merge tag 'linux-can-fixes-for-6.4-20230622' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2023-06-22 Oliver Hartkopp's patch fixes the return value in the error path of isotp_sendmsg() in the CAN ISOTP protocol. * tag 'linux-can-fixes-for-6.4-20230622' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: isotp: isotp_sendmsg(): fix return error fix on TX path ==================== Link: https://lore.kernel.org/r/20230622090122.574506-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit 0ec92a8f56ff07237dbe8af7c7a72aba7f957baf Author: Piotr Gardocki Date: Wed Jun 21 15:21:06 2023 +0200 net: fix net device address assign type Commit ad72c4a06acc introduced optimization to return from function quickly if the MAC address is not changing at all. It was reported that such change causes dev->addr_assign_type to not change to NET_ADDR_SET from _PERM or _RANDOM. Restore the old behavior and skip only call to ndo_set_mac_address. Fixes: ad72c4a06acc ("net: add check for current MAC address in dev_set_mac_address") Reported-by: Gal Pressman Signed-off-by: Piotr Gardocki Reviewed-by: Simon Horman Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20230621132106.991342-1-piotrx.gardocki@intel.com Signed-off-by: Jakub Kicinski commit 9a14f2e3dab106df7f27d1730cc540247317d4b9 Author: Edward Cree Date: Wed Jun 21 13:15:04 2023 +0100 sfc: keep alive neighbour entries while a TC encap action is using them When processing counter updates, if any action set using the newly incremented counter includes an encap action, prod the corresponding neighbouring entry to indicate to the neighbour cache that the entry is still in use and passing traffic. Signed-off-by: Edward Cree Link: https://lore.kernel.org/r/20230621121504.17004-1-edward.cree@amd.com Signed-off-by: Jakub Kicinski commit 2555f35a4f428a9bfdf09aa0459dbfdf59a24a9a Author: Christian Marangi Date: Wed Jun 21 11:54:09 2023 +0200 net: dsa: qca8k: add support for additional modes for netdev trigger The QCA8K switch supports additional modes that can be handled in hardware for the LED netdev trigger. Add these additional modes to further support the Switch LEDs and offload more blink modes. Add additional modes: - link_10 - link_100 - link_1000 - half_duplex - full_duplex Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20230621095409.25859-1-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski commit 2ffb8d02a9b60d9190a871cb8466cd0721bc0a49 Author: Christian Marangi Date: Wed Jun 21 11:26:53 2023 +0200 docs: ABI: sysfs-class-led-trigger-netdev: add new modes and entry Document newly introduced modes and entry for the LED netdev trigger. Add documentation for new modes: - link_10 - link_100 - link_1000 - half_duplex - full_duplex Add documentation for new entry: - hw_control Also add additional info for the interval entry and the tx/rx modes with the special case of hw_control ON. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230621092653.23172-1-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski commit 004d25060c78fc31f66da0fa439c544dda1ac9d5 Author: Ying Hsu Date: Tue Jun 20 10:47:32 2023 -0700 igb: Fix igb_down hung on surprise removal In a setup where a Thunderbolt hub connects to Ethernet and a display through USB Type-C, users may experience a hung task timeout when they remove the cable between the PC and the Thunderbolt hub. This is because the igb_down function is called multiple times when the Thunderbolt hub is unplugged. For example, the igb_io_error_detected triggers the first call, and the igb_remove triggers the second call. The second call to igb_down will block at napi_synchronize. Here's the call trace: __schedule+0x3b0/0xddb ? __mod_timer+0x164/0x5d3 schedule+0x44/0xa8 schedule_timeout+0xb2/0x2a4 ? run_local_timers+0x4e/0x4e msleep+0x31/0x38 igb_down+0x12c/0x22a [igb 6615058754948bfde0bf01429257eb59f13030d4] __igb_close+0x6f/0x9c [igb 6615058754948bfde0bf01429257eb59f13030d4] igb_close+0x23/0x2b [igb 6615058754948bfde0bf01429257eb59f13030d4] __dev_close_many+0x95/0xec dev_close_many+0x6e/0x103 unregister_netdevice_many+0x105/0x5b1 unregister_netdevice_queue+0xc2/0x10d unregister_netdev+0x1c/0x23 igb_remove+0xa7/0x11c [igb 6615058754948bfde0bf01429257eb59f13030d4] pci_device_remove+0x3f/0x9c device_release_driver_internal+0xfe/0x1b4 pci_stop_bus_device+0x5b/0x7f pci_stop_bus_device+0x30/0x7f pci_stop_bus_device+0x30/0x7f pci_stop_and_remove_bus_device+0x12/0x19 pciehp_unconfigure_device+0x76/0xe9 pciehp_disable_slot+0x6e/0x131 pciehp_handle_presence_or_link_change+0x7a/0x3f7 pciehp_ist+0xbe/0x194 irq_thread_fn+0x22/0x4d ? irq_thread+0x1fd/0x1fd irq_thread+0x17b/0x1fd ? irq_forced_thread_fn+0x5f/0x5f kthread+0x142/0x153 ? __irq_get_irqchip_state+0x46/0x46 ? kthread_associate_blkcg+0x71/0x71 ret_from_fork+0x1f/0x30 In this case, igb_io_error_detected detaches the network interface and requests a PCIE slot reset, however, the PCIE reset callback is not being invoked and thus the Ethernet connection breaks down. As the PCIE error in this case is a non-fatal one, requesting a slot reset can be avoided. This patch fixes the task hung issue and preserves Ethernet connection by ignoring non-fatal PCIE errors. Signed-off-by: Ying Hsu Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230620174732.4145155-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit b2fef875aa6f78dfa89a943282d6dbeaf0dd2095 Merge: 0c3d6fd4b89c1 5c844d57aa789 Author: Jakub Kicinski Date: Thu Jun 22 19:48:40 2023 -0700 Merge branch 'net-dsa-microchip-fix-writes-to-phy-registers-0x10' Rasmus Villemoes says: ==================== net: dsa: microchip: fix writes to phy registers >= 0x10 Patch 1 is just a simplification, technically unrelated to the other two patches. But it would be a bit inconsistent to have the new ksz_prmw32() introduced in patch 2 use ksz_rmw32() while leaving ksz_prmw8() as-is. The actual fix is of course patch 3. I can definitely see some weird behaviour on our ksz9567 when writing to phy registers 0x1e and 0x1f (with phytool from userspace), though it does not seem that the effect is always to write zeroes to the buddy register as the errata sheet says would be the case. In our case, the switch is connected via i2c; I hope somebody with other switches and/or the SPI variants can test this. ==================== Link: https://lore.kernel.org/r/20230620113855.733526-1-linux@rasmusvillemoes.dk Signed-off-by: Jakub Kicinski commit 5c844d57aa7894154e49cf2fc648bfe2f1aefc1c Author: Rasmus Villemoes Date: Tue Jun 20 13:38:54 2023 +0200 net: dsa: microchip: fix writes to phy registers >= 0x10 According to the errata sheets for ksz9477 and ksz9567, writes to the PHY registers 0x10-0x1f (i.e. those located at addresses 0xN120 to 0xN13f) must be done as a 32 bit write to the 4-byte aligned address containing the register, hence requires a RMW in order not to change the adjacent PHY register. Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Horman Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230620113855.733526-4-linux@rasmusvillemoes.dk Signed-off-by: Jakub Kicinski commit ece28ecbec9f63e3f722d7c9a99fb965cbeafc1b Author: Rasmus Villemoes Date: Tue Jun 20 13:38:53 2023 +0200 net: dsa: microchip: add ksz_prmw32() helper This will be used in a subsequent patch fixing an errata for writes to certain PHY registers. Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Horman Acked-by: Arun Ramadoss Link: https://lore.kernel.org/r/20230620113855.733526-3-linux@rasmusvillemoes.dk Signed-off-by: Jakub Kicinski commit 3b42fbd5951171bce5ecd22ad72d6a16fefaa704 Author: Rasmus Villemoes Date: Tue Jun 20 13:38:52 2023 +0200 net: dsa: microchip: simplify ksz_prmw8() Implement ksz_prmw8() in terms of ksz_rmw8(), just as all the other ksz_pX are implemented in terms of ksz_X. No functional change. Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Horman Acked-by: Arun Ramadoss Link: https://lore.kernel.org/r/20230620113855.733526-2-linux@rasmusvillemoes.dk Signed-off-by: Jakub Kicinski commit 0c3d6fd4b89c1a6393283249cdd0bd484ad8f2e5 Author: Jakub Kicinski Date: Wed Jun 21 16:17:19 2023 -0700 tools: ynl: improve the direct-include header guard logic Przemek suggests that I shouldn't accuse GCC of witchcraft, there is a simpler explanation for why we need manual define. scripts/headers_install.sh modifies the guard, removing _UAPI. That's why including a kernel header from the tree and from /usr leads to duplicate definitions. This also solves the mystery of why I needed to include the header conditionally. I had the wrong guards for most cases but ethtool. Suggested-by: Przemek Kitszel Reviewed-by: Przemek Kitszel Link: https://lore.kernel.org/r/20230621231719.2728928-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 2a441a3dbe84be61be502142a2fb8ea633fcc528 Author: Zhengchao Shao Date: Tue Jun 20 14:25:19 2023 +0800 net: txgbe: remove unused buffer in txgbe_calc_eeprom_checksum Half a year passed since commit 049fe5365324c ("net: txgbe: Add operations to interact with firmware") was submitted, the buffer in txgbe_calc_eeprom_checksum was not used. So remove it and the related branch codes. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306200242.FXsHokaJ-lkp@intel.com/ Reviewed-by: Jiawen Wu Signed-off-by: Zhengchao Shao Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230620062519.1575298-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit fc0649395dca81f2b3b02d9b248acb38cbcee55c Author: Oleksij Rempel Date: Wed Jun 21 06:38:48 2023 +0200 net: phy: dp83td510: fix kernel stall during netboot in DP83TD510E PHY driver Fix an issue where the kernel would stall during netboot, showing the "sched: RT throttling activated" message. This stall was triggered by the behavior of the mii_interrupt bit (Bit 7 - DP83TD510E_STS_MII_INT) in the DP83TD510E's PHY_STS Register (Address = 0x10). The DP83TD510E datasheet (2020) states that the bit clears on write, however, in practice, the bit clears on read. This discrepancy had significant implications on the driver's interrupt handling. The PHY_STS Register was used by handle_interrupt() to check for pending interrupts and by read_status() to get the current link status. The call to read_status() was unintentionally clearing the mii_interrupt status bit without deasserting the IRQ pin, causing handle_interrupt() to miss other pending interrupts. This issue was most apparent during netboot. The fix refrains from using the PHY_STS Register for interrupt handling. Instead, we now solely rely on the INTERRUPT_REG_1 Register (Address = 0x12) and INTERRUPT_REG_2 Register (Address = 0x13) for this purpose. These registers directly influence the IRQ pin state and are latched high until read. Note: The INTERRUPT_REG_2 Register (Address = 0x13) exists and can also be used for interrupt handling, specifically for "Aneg page received interrupt" and "Polarity change interrupt". However, these features are currently not supported by this driver. Fixes: 165cd04fe253 ("net: phy: dp83td510: Add support for the DP83TD510 Ethernet PHY") Cc: Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230621043848.3806124-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 018c00dd4e88d78b0e97d4bcc413dd727497128f Merge: 84ef94d9421d3 f40df95d375dc Author: Jakub Kicinski Date: Thu Jun 22 19:41:13 2023 -0700 Merge branch 'add-and-use-helper-for-pcs-negotiation-modes' Russell King says: ==================== Add and use helper for PCS negotiation modes Earlier this month, I proposed a helper for deciding whether a PCS should use inband negotiation modes or not. There was some discussion around this topic, and I believe there was no disagreement about providing the helper. The initial discussion can be found at: https://lore.kernel.org/r/ZGIkGmyL8yL1q1zp@shell.armlinux.org.uk Subsequently, I posted a RFC series back in May: https://lore.kernel.org/r/ZGzhvePzPjJ0v2En@shell.armlinux.org.uk that added a helper, phylink_pcs_neg_mode() which PCS drivers could use to parse the state, and updated a bunch of drivers to use it. I got a couple of bits of feedback to it, including some ACKs. However, I've decided to take this slightly further and change the "mode" parameter to both the pcs_config() and pcs_link_up() methods when a PCS driver opts in to this (by setting "neg_mode" in the phylink_pcs structure.) If this is not set, we default to the old behaviour. That said, this series converts all the PCS implementations I can find currently in net-next. Doing this has the added benefit that the negotiation mode parameter is also available to the pcs_link_up() function, which can now know whether inband negotiation was in fact enabled or not at pcs_config() time. It has been posted as RFC at: https://lore.kernel.org/r/ZIh/CLQ3z89g0Ua0@shell.armlinux.org.uk and received one reply, thanks Elad, which is a similar amount of interest to previous postings. Let's post it as non-RFC and see whether we get more reaction. ==================== Link: https://lore.kernel.org/r/ZIxQIBfO9dH5xFlg@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit f40df95d375dc9c96da541a2c4ac0ce1e630309d Author: Russell King (Oracle) Date: Fri Jun 16 13:07:34 2023 +0100 net: macb: update PCS driver to use neg_mode Update macb's embedded PCS drivers to use neg_mode, even though it makes no use of it or the "mode" argument. This makes the driver consistent with converted drivers. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8Eo-00EaGX-KJ@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 6c1e4eca0b4e4ec6a67a10e69cc0d936d0d9c19c Author: Russell King (Oracle) Date: Fri Jun 16 13:07:29 2023 +0100 net: dsa: mt7530: update PCS driver to use neg_mode Update mt7530's embedded PCS driver to use neg_mode, even though it makes no use of it or the "mode" argument. This makes the driver consistent with converted drivers. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8Ej-00EaGR-Fk@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 772c476dd1d43546ac8123c9a7060557d06dfe7c Author: Russell King (Oracle) Date: Fri Jun 16 13:07:24 2023 +0100 net: dsa: b53: update PCS driver to use neg_mode Update B53's embedded PCS driver to use neg_mode, even though it makes no use of it or the "mode" argument. This makes the driver consistent with converted drivers. Signed-off-by: Russell King (Oracle) Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/E1qA8Ee-00EaGL-Az@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 6e5bb3da9842950a161625b4ab2743d1d5c64715 Author: Russell King (Oracle) Date: Fri Jun 16 13:07:19 2023 +0100 net: sparx5: update PCS driver to use neg_mode Update Sparx5's embedded PCS driver to use neg_mode rather than the mode argument. As there is no pcs_link_up() method, this only affects the pcs_config() method. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8EZ-00EaGF-6F@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit bfa0a3ac05b69842aaee7c60a8ceffd734f2e2b9 Author: Russell King (Oracle) Date: Fri Jun 16 13:07:14 2023 +0100 net: qca8k: update PCS driver to use neg_mode Update qca8k's embedded PCS driver to use neg_mode rather than the mode argument. As there is no pcs_link_up() method, this only affects the pcs_config() method. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8EU-00EaG9-1l@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit d5a05299306227d73b0febba9cecedf88931c507 Author: Russell King (Oracle) Date: Fri Jun 16 13:07:08 2023 +0100 net: prestera: update PCS driver to use neg_mode Update prestera's embedded PCS driver to use neg_mode rather than the mode argument. As there is no pcs_link_up() method, this only affects the pcs_config() method. Acked-by: Elad Nachman Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8EO-00EaG3-TR@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit d5b16264fffe1e6a9ccad7b1cf311ea2fd5e2e79 Author: Russell King (Oracle) Date: Fri Jun 16 13:07:03 2023 +0100 net: mvpp2: update PCS driver to use neg_mode Update mvpp2's embedded PCS drivers to use neg_mode rather than the mode argument, remembering to update the ACPI path as well. As there are no pcs_link_up() methods, this only affects the two pcs_config() methods. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8EJ-00EaFx-P6@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 140d1002e2a30db0df58d18c07df3f72dc0659fa Author: Russell King (Oracle) Date: Fri Jun 16 13:06:58 2023 +0100 net: mvneta: update PCS driver to use neg_mode Update mvneta's embedded PCS driver to use neg_mode rather than the mode argument. As there is no pcs_link_up() method, this only affects the pcs_config() method. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8EE-00EaFr-Kx@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit a0e93cfdac4c91b73f79a4bfbfcf74b0911c1ad3 Author: Russell King (Oracle) Date: Fri Jun 16 13:06:53 2023 +0100 net: lan966x: update PCS driver to use neg_mode Update lan966x's embedded PCS driver to use neg_mode rather than the mode argument. As there is no pcs_link_up() method, this only affects the pcs_config() method. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8E9-00EaFl-GN@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit c689a6528c22b20565bd14d5a7fb8e827d6faa7c Author: Russell King (Oracle) Date: Fri Jun 16 13:06:48 2023 +0100 net: pcs: lynx: update PCS driver to use neg_mode Update the Lynx PCS driver to use neg_mode rather than the mode argument. This ensures that the link_up() method will always program the speed and duplex when negotiation is disabled. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8E4-00EaFf-Bf@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 3b2de56a146f34e3f70a84cc3a1897064e445d16 Author: Russell King (Oracle) Date: Fri Jun 16 13:06:43 2023 +0100 net: pcs: lynxi: update PCS driver to use neg_mode Update the Lynxi PCS driver to use neg_mode rather than the mode argument. This ensures that the link_up() method will always program the speed and duplex when negotiation is disabled. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8Dz-00EaFY-5A@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit a3a47cfb88fcdf862594eae417611ef533ed8bae Author: Russell King (Oracle) Date: Fri Jun 16 13:06:37 2023 +0100 net: pcs: xpcs: update PCS driver to use neg_mode Update xpcs to use neg_mode to configure whether inband negotiation should be used. We need to update sja1105 as well as that directly calls into the XPCS driver's config function. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8Dt-00EaFS-W9@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit febf2aaf05641f3258cc30e072aff65cffc7c82c Author: Russell King (Oracle) Date: Fri Jun 16 13:06:32 2023 +0100 net: phylink: pass neg_mode into phylink_mii_c22_pcs_config() Convert fman_dtsec, xilinx_axienet and pcs-lynx to pass the neg_mode into phylink_mii_c22_pcs_config(). Where appropriate, drivers are updated to have neg_mode passed into their pcs_config() and pcs_link_up() functions. For other drivers, we just hoist the call to phylink_pcs_neg_mode() to their pcs_config() method out of phylink_mii_c22_pcs_config(). Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8Do-00EaFM-Ra@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit cdb08aa0473730315dbc088d5394e59622314034 Author: Russell King (Oracle) Date: Fri Jun 16 13:06:27 2023 +0100 net: phylink: convert phylink_mii_c22_pcs_config() to neg_mode Use phylink_pcs_neg_mode() for phylink_mii_c22_pcs_config(). This results in no functional change. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8Dj-00EaFG-Mt@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit f99d471afa03f770149f1cc60a288b9a08285903 Author: Russell King (Oracle) Date: Fri Jun 16 13:06:22 2023 +0100 net: phylink: add PCS negotiation mode PCS have to work out whether they should enable PCS negotiation by looking at the "mode" and "interface" arguments, and the Autoneg bit in the advertising mask. This leads to some complex logic, so lets pull that out into phylink and instead pass a "neg_mode" argument to the PCS configuration and link up methods, instead of the "mode" argument. In order to transition drivers, add a "neg_mode" flag to the phylink PCS structure to PCS can indicate whether they want to be passed the neg_mode or the old mode argument. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qA8De-00EaFA-Ht@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 84ef94d9421d39b9148f2f4fd4cca2888deb6103 Merge: a7384f3918756 a0e128ef88e4a Author: Jakub Kicinski Date: Thu Jun 22 19:38:46 2023 -0700 Merge branch 'fix-comment-typos-about-transmit' Yueh-Shun Li says: ==================== Fix comment typos about "transmit" Fix typos about "transmit" missing the first "s" found by searching with keyword "tram" in the first 7 patches. ==================== Link: https://lore.kernel.org/r/20230622012627.15050-1-shamrocklee@posteo.net Signed-off-by: Jakub Kicinski commit a0e128ef88e4a033a52963ec4ad94d96a17f8179 Author: Yueh-Shun Li Date: Thu Jun 22 01:26:33 2023 +0000 net/tls: fix comment typo Spell "retransmit" properly. Found by searching for keyword "tranm". Signed-off-by: Yueh-Shun Li Link: https://lore.kernel.org/r/20230622012627.15050-7-shamrocklee@posteo.net Signed-off-by: Jakub Kicinski commit 304b1875ba02022f2504952a32e5e90482bbdb39 Author: Yueh-Shun Li Date: Thu Jun 22 01:26:31 2023 +0000 tcp: fix comment typo Spell "transmissions" properly. Found by searching for keyword "tranm". Signed-off-by: Yueh-Shun Li Link: https://lore.kernel.org/r/20230622012627.15050-6-shamrocklee@posteo.net Signed-off-by: Jakub Kicinski commit b028813ac97370e61351b1190c1860a1bd24fe56 Author: Yueh-Shun Li Date: Thu Jun 22 01:26:25 2023 +0000 i40e, xsk: fix comment typo Spell "transmission" properly. Found by searching for keyword "tranm". Signed-off-by: Yueh-Shun Li Link: https://lore.kernel.org/r/20230622012627.15050-3-shamrocklee@posteo.net Signed-off-by: Jakub Kicinski commit aa5406950726e336c5c9585b09799a734b6e77bf Author: Eric Dumazet Date: Wed Jun 21 17:47:20 2023 +0000 netlink: do not hard code device address lenth in fdb dumps syzbot reports that some netdev devices do not have a six bytes address [1] Replace ETH_ALEN by dev->addr_len. [1] (Case of a device where dev->addr_len = 4) BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline] BUG: KMSAN: kernel-infoleak in copyout+0xb8/0x100 lib/iov_iter.c:169 instrument_copy_to_user include/linux/instrumented.h:114 [inline] copyout+0xb8/0x100 lib/iov_iter.c:169 _copy_to_iter+0x6d8/0x1d00 lib/iov_iter.c:536 copy_to_iter include/linux/uio.h:206 [inline] simple_copy_to_iter+0x68/0xa0 net/core/datagram.c:513 __skb_datagram_iter+0x123/0xdc0 net/core/datagram.c:419 skb_copy_datagram_iter+0x5c/0x200 net/core/datagram.c:527 skb_copy_datagram_msg include/linux/skbuff.h:3960 [inline] netlink_recvmsg+0x4ae/0x15a0 net/netlink/af_netlink.c:1970 sock_recvmsg_nosec net/socket.c:1019 [inline] sock_recvmsg net/socket.c:1040 [inline] ____sys_recvmsg+0x283/0x7f0 net/socket.c:2722 ___sys_recvmsg+0x223/0x840 net/socket.c:2764 do_recvmmsg+0x4f9/0xfd0 net/socket.c:2858 __sys_recvmmsg net/socket.c:2937 [inline] __do_sys_recvmmsg net/socket.c:2960 [inline] __se_sys_recvmmsg net/socket.c:2953 [inline] __x64_sys_recvmmsg+0x397/0x490 net/socket.c:2953 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Uninit was stored to memory at: __nla_put lib/nlattr.c:1009 [inline] nla_put+0x1c6/0x230 lib/nlattr.c:1067 nlmsg_populate_fdb_fill+0x2b8/0x600 net/core/rtnetlink.c:4071 nlmsg_populate_fdb net/core/rtnetlink.c:4418 [inline] ndo_dflt_fdb_dump+0x616/0x840 net/core/rtnetlink.c:4456 rtnl_fdb_dump+0x14ff/0x1fc0 net/core/rtnetlink.c:4629 netlink_dump+0x9d1/0x1310 net/netlink/af_netlink.c:2268 netlink_recvmsg+0xc5c/0x15a0 net/netlink/af_netlink.c:1995 sock_recvmsg_nosec+0x7a/0x120 net/socket.c:1019 ____sys_recvmsg+0x664/0x7f0 net/socket.c:2720 ___sys_recvmsg+0x223/0x840 net/socket.c:2764 do_recvmmsg+0x4f9/0xfd0 net/socket.c:2858 __sys_recvmmsg net/socket.c:2937 [inline] __do_sys_recvmmsg net/socket.c:2960 [inline] __se_sys_recvmmsg net/socket.c:2953 [inline] __x64_sys_recvmmsg+0x397/0x490 net/socket.c:2953 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Uninit was created at: slab_post_alloc_hook+0x12d/0xb60 mm/slab.h:716 slab_alloc_node mm/slub.c:3451 [inline] __kmem_cache_alloc_node+0x4ff/0x8b0 mm/slub.c:3490 kmalloc_trace+0x51/0x200 mm/slab_common.c:1057 kmalloc include/linux/slab.h:559 [inline] __hw_addr_create net/core/dev_addr_lists.c:60 [inline] __hw_addr_add_ex+0x2e5/0x9e0 net/core/dev_addr_lists.c:118 __dev_mc_add net/core/dev_addr_lists.c:867 [inline] dev_mc_add+0x9a/0x130 net/core/dev_addr_lists.c:885 igmp6_group_added+0x267/0xbc0 net/ipv6/mcast.c:680 ipv6_mc_up+0x296/0x3b0 net/ipv6/mcast.c:2754 ipv6_mc_remap+0x1e/0x30 net/ipv6/mcast.c:2708 addrconf_type_change net/ipv6/addrconf.c:3731 [inline] addrconf_notify+0x4d3/0x1d90 net/ipv6/addrconf.c:3699 notifier_call_chain kernel/notifier.c:93 [inline] raw_notifier_call_chain+0xe4/0x430 kernel/notifier.c:461 call_netdevice_notifiers_info net/core/dev.c:1935 [inline] call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers+0x1ee/0x2d0 net/core/dev.c:1987 bond_enslave+0xccd/0x53f0 drivers/net/bonding/bond_main.c:1906 do_set_master net/core/rtnetlink.c:2626 [inline] rtnl_newlink_create net/core/rtnetlink.c:3460 [inline] __rtnl_newlink net/core/rtnetlink.c:3660 [inline] rtnl_newlink+0x378c/0x40e0 net/core/rtnetlink.c:3673 rtnetlink_rcv_msg+0x16a6/0x1840 net/core/rtnetlink.c:6395 netlink_rcv_skb+0x371/0x650 net/netlink/af_netlink.c:2546 rtnetlink_rcv+0x34/0x40 net/core/rtnetlink.c:6413 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0xf28/0x1230 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x122f/0x13d0 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] ____sys_sendmsg+0x999/0xd50 net/socket.c:2503 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2557 __sys_sendmsg net/socket.c:2586 [inline] __do_sys_sendmsg net/socket.c:2595 [inline] __se_sys_sendmsg net/socket.c:2593 [inline] __x64_sys_sendmsg+0x304/0x490 net/socket.c:2593 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Bytes 2856-2857 of 3500 are uninitialized Memory access of size 3500 starts at ffff888018d99104 Data copied to user address 0000000020000480 Fixes: d83b06036048 ("net: add fdb generic dump routine") Reported-by: syzbot Signed-off-by: Eric Dumazet Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20230621174720.1845040-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 8d61f926d42045961e6b65191c09e3678d86a9cf Author: Eric Dumazet Date: Wed Jun 21 15:43:37 2023 +0000 netlink: fix potential deadlock in netlink_set_err() syzbot reported a possible deadlock in netlink_set_err() [1] A similar issue was fixed in commit 1d482e666b8e ("netlink: disable IRQs for netlink_lock_table()") in netlink_lock_table() This patch adds IRQ safety to netlink_set_err() and __netlink_diag_dump() which were not covered by cited commit. [1] WARNING: possible irq lock inversion dependency detected 6.4.0-rc6-syzkaller-00240-g4e9f0ec38852 #0 Not tainted syz-executor.2/23011 just changed the state of lock: ffffffff8e1a7a58 (nl_table_lock){.+.?}-{2:2}, at: netlink_set_err+0x2e/0x3a0 net/netlink/af_netlink.c:1612 but this lock was taken by another, SOFTIRQ-safe lock in the past: (&local->queue_stop_reason_lock){..-.}-{2:2} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(nl_table_lock); local_irq_disable(); lock(&local->queue_stop_reason_lock); lock(nl_table_lock); lock(&local->queue_stop_reason_lock); *** DEADLOCK *** Fixes: 1d482e666b8e ("netlink: disable IRQs for netlink_lock_table()") Reported-by: syzbot+a7d200a347f912723e5c@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=a7d200a347f912723e5c Link: https://lore.kernel.org/netdev/000000000000e38d1605fea5747e@google.com/T/#u Signed-off-by: Eric Dumazet Cc: Johannes Berg Link: https://lore.kernel.org/r/20230621154337.1668594-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit c4fc88ad2a765224a648db8ab35f125e120fe41b Author: Bartosz Golaszewski Date: Wed Jun 21 15:55:37 2023 +0200 net: stmmac: fix double serdes powerdown Commit 49725ffc15fc ("net: stmmac: power up/down serdes in stmmac_open/release") correctly added a call to the serdes_powerdown() callback to stmmac_release() but did not remove the one from stmmac_remove() which leads to a doubled call to serdes_powerdown(). This can lead to all kinds of problems: in the case of the qcom ethqos driver, it caused an unbalanced regulator disable splat. Fixes: 49725ffc15fc ("net: stmmac: power up/down serdes in stmmac_open/release") Signed-off-by: Bartosz Golaszewski Reviewed-by: Jiri Pirko Acked-by: Junxiao Chang Reviewed-by: Andrew Halaney Tested-by: Andrew Halaney Link: https://lore.kernel.org/r/20230621135537.376649-1-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit b9ec61be2d91cc09b5e7302e65442e6d71f0ed93 Author: Sathesh Edara Date: Wed Jun 21 03:16:49 2023 -0700 MAINTAINERS: update email addresses of octeon_ep driver maintainers Update email addresses of Marvell octeon_ep driver maintainers. Also remove a former maintainer. As a maintainer below are the responsibilities: - Pushing the bug fixes and new features to upstream. - Responsible for reviewing the external changes submitted for the octeon_ep driver. - Reply to maintainers questions in a timely manner. Signed-off-by: Sathesh Edara Signed-off-by: Jakub Kicinski commit 533bbc7ce562e476ac381e8ddcb27c46279a44f9 Author: Krzysztof Kozlowski Date: Wed Jun 21 08:09:49 2023 +0200 Bluetooth: MAINTAINERS: add Devicetree bindings to Bluetooth drivers The Devicetree bindings should be picked up by subsystem maintainers, but respective pattern for Bluetooth drivers was missing. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Simon Horman Signed-off-by: Jakub Kicinski commit a7384f3918756c193e3fcd7e3111fc4bd3686013 Merge: 98e95872f2b81 8a28a0b6f1a1d Author: Jakub Kicinski Date: Thu Jun 22 18:40:38 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. Conflicts: tools/testing/selftests/net/fcnal-test.sh d7a2fc1437f7 ("selftests: net: fcnal-test: check if FIPS mode is enabled") dd017c72dde6 ("selftests: fcnal: Test SO_DONTROUTE on TCP sockets.") https://lore.kernel.org/all/5007b52c-dd16-dbf6-8d64-b9701bfa498b@tessares.net/ https://lore.kernel.org/all/20230619105427.4a0df9b3@canb.auug.org.au/ No adjacent changes. Signed-off-by: Jakub Kicinski commit fd3ac6e8049799ca7dbd2738de8e149536e92a5e Author: Sebastian Reichel Date: Mon Jun 12 19:13:35 2023 +0200 dt-bindings: phy: rockchip: rk3588 has two reset lines The RK3588 has two reset lines for the combphy. One for the APB interface and one for the actual PHY. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel Signed-off-by: Damien Le Moal commit 85b0e13b19c23f0ee71b2bacb43ccd6b0e6e31dd Author: Sebastian Reichel Date: Mon Jun 12 19:13:34 2023 +0200 dt-bindings: ata: dwc-ahci: add Rockchip RK3588 This adds Rockchip RK3588 AHCI binding. In order to narrow down the allowed clocks without bloating the generic binding, the description of Rockchip's AHCI controllers has been moved to its own file. Signed-off-by: Sebastian Reichel Reviewed-by: Serge Semin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Damien Le Moal commit 2b3665b2971d2c67dd7a7a9171b06cb48fa393db Author: Sebastian Reichel Date: Mon Jun 12 19:13:33 2023 +0200 dt-bindings: ata: dwc-ahci: add PHY clocks Add PHY transmit and receive clocks as described by the DW SATA AHCI HW manual. Suggested-by: Serge Semin Reviewed-by: Serge Semin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel Signed-off-by: Damien Le Moal commit b3f993c7e7a29d1e119c3d8ec6cdeeaae25afba7 Author: Damien Le Moal Date: Thu Jun 15 09:51:46 2023 +0900 ata: ahci_octeon: Remove unnecessary include asm/octeon/octeon.h already includes asm/bitfield.h, so there is no need to include this latter file in ahci_octeon.c as the code does not directly use the __BITFIELD_FIELD macro defined in it. Signed-off-by: Damien Le Moal commit a77541cab0be8c8a68f70cdeb68359fbe15e4612 Merge: 01fa9edd8bcf1 6eef895581c9b Author: Mark Brown Date: Fri Jun 23 01:31:11 2023 +0100 spi: Helper for deriving timeout values Merge series from Miquel Raynal : I recently came across an issue with the Atmel spi controller driver which would stop my transfers after a too small timeout when performing big transfers (reading a 4MiB flash in one transfer). My initial idea was to derive a the maximum amount of time a transfer would take depending on its size and use that as value to avoid erroring-out when not relevant. Mark wanted to go further by creating a core helper doing that, based on the heuristics from the sun6i driver. Here is a small series of 3 patches doing exactly that. commit 2971c058746319e9853919553259cef7fe280c94 Author: Russell Harmon Date: Sun Jun 4 22:08:53 2023 -0700 Documentation: dm-integrity: Document an example of how the tunables relate. Signed-off-by: Russell Harmon Signed-off-by: Mike Snitzer commit 52145f284c66b9de5be7b054444dd0da066079d6 Author: Russell Harmon Date: Sun Jun 4 22:08:52 2023 -0700 Documentation: dm-integrity: Document default values. Signed-off-by: Russell Harmon Signed-off-by: Mike Snitzer commit 3b671459e687e6b7d3f87d39a0b242bbebf871be Author: Russell Harmon Date: Sun Jun 4 22:08:51 2023 -0700 Documentation: dm-integrity: Document the meaning of "buffer". "Buffers" are buffers of the metadata/checksum area of dm-integrity. They are always at most as large as a single metadata area on-disk, but may be smaller. Signed-off-by: Russell Harmon Reviewed-by: Bagas Sanjaya Signed-off-by: Mike Snitzer commit c3ba5aa6f789097364398ad38fe541841bade17d Author: Russell Harmon Date: Sun Jun 4 22:08:50 2023 -0700 Documentation: dm-integrity: Fix minor grammatical error. "where dm-integrity uses bitmap" becomes "where dm-integrity uses a bitmap" Signed-off-by: Russell Harmon Reviewed-by: Bagas Sanjaya Signed-off-by: Mike Snitzer commit 25c9a4ab4d73d251886e6b317181cfc433e011f9 Author: Andy Shevchenko Date: Tue Jun 13 00:47:51 2023 +0300 dm integrity: Use %*ph for printing hexdump of a small buffer The kernel already has a helper to print a hexdump of a small buffer via pointer extension. Use that instead of open coded variant. In long term it helps to kill pr_cont() or at least narrow down its use. Note, the format is slightly changed, i.e. the trailing space is always printed. Also the IV dump is limited by 64 bytes which seems fine. Signed-off-by: Andy Shevchenko Signed-off-by: Mike Snitzer commit 765be32b97fe69f67164cc7772a74c6a10562e0b Author: Tiezhu Yang Date: Tue May 23 17:57:53 2023 +0800 perf symbol: Add LoongArch case in get_plt_sizes() We can see the following definitions in bfd/elfnn-loongarch.c: #define PLT_HEADER_INSNS 8 #define PLT_HEADER_SIZE (PLT_HEADER_INSNS * 4) #define PLT_ENTRY_INSNS 4 #define PLT_ENTRY_SIZE (PLT_ENTRY_INSNS * 4) so plt header size is 32 and plt entry size is 16 on LoongArch, let us add LoongArch case in get_plt_sizes(). Signed-off-by: Tiezhu Yang Acked-by: Huacai Chen Reviewed-by: Leo Yan Cc: Mark Rutland Cc: Ian Rogers Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: loongarch@lists.linux.dev Cc: loongson-kernel@lists.loongnix.cn Cc: Ingo Molnar Link: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elfnn-loongarch.c Link: https://lore.kernel.org/r/1684835873-15956-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Namhyung Kim commit fcb66ee8d16aa0f88efcc9cb41083c0412e9db8a Author: Arnd Bergmann Date: Thu Jun 22 12:11:23 2023 +0200 ASoC: tas2781: fix Kconfig dependencies The new driver has two modules that both get enabled for build testing when all codecs are selected. The comlib part has an i2c dependency, so this remains disabled on builds without i2c, but then the other one fails to link: ERROR: modpost: "tasdevice_dev_bulk_write" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined! ERROR: modpost: "tasdevice_dev_update_bits" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined! ERROR: modpost: "tasdevice_dev_bulk_read" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined! ERROR: modpost: "tasdevice_dev_read" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined! ERROR: modpost: "tasdevice_dev_write" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined! There are many ways to address this, adding an explicit dependency seems to be the clearest method that keeps the structure of the driver otherwise unchanged. Fixes: ef3bcde75d06d ("ASoC: tas2781: Add tas2781 driver") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/Message-Id: <20230622101205.3180938-1-arnd@kernel.org> Signed-off-by: Mark Brown commit 3eb96217c16cb7be0fe6e1d416ff4fe47f686bea Author: Syed Saba Kareem Date: Thu Jun 22 20:53:41 2023 +0530 ASoC: amd: acp: remove acp poweroff function BIOS invokes ACP Power off sequence based on ACP device state. Remove redundant code from ACP PCI driver for ACP Power off sequence. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/Message-Id: <20230622152406.3709231-4-Syed.SabaKareem@amd.com> Signed-off-by: Mark Brown commit ad60672394bd1f95c58d3d9336902f47e05126fc Author: Syed Saba Kareem Date: Thu Jun 22 20:53:38 2023 +0530 ASoC: amd: acp: clear pdm dma interrupt mask Clear pdm dma interrupt mask in acp_dmic_shutdown(). 'Fixes: c32bd332ce5c9 ("ASoC: amd: acp: Add generic support for PDM controller on ACP")' Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/Message-Id: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> Signed-off-by: Mark Brown commit fb180283c00b435019bd9500ae027872da9faa3b Author: Maxim Kochetkov Date: Thu Jun 22 17:20:36 2023 +0300 ASoC: codecs: max98090: Allow dsp_a mode TDM mode for max98090 is dsp_a compatible with such limitations: 1) Up to four timeslots supported. 2) Only 16 bits timeslots supported. 3) Only 2 active timeslots (L/R) supported. We want to setup TDM mode only when dsp_a mode is selected. So move M98090_REG_TDM_FORMAT/M98090_REG_TDM_CONTROL registers setup from max98090_set_tdm_slot() to the max98090_dai_set_fmt(). Also extend max98090_set_tdm_slot() with all TDM limitations check. Signed-off-by: Maxim Kochetkov Link: https://lore.kernel.org/r/Message-Id: <20230622142038.63388-1-fido_max@inbox.ru> Signed-off-by: Mark Brown commit d7c2d34d72bfeffca4983c4dcba55d1dd31012be Author: Namhyung Kim Date: Wed Jun 21 22:58:32 2023 -0700 perf test: Remove x permission from lib/stat_output.sh The commit fc51fc87b1b8 factored out the helper functions to a library but the new file had execute permission. Due to the way it detects the shell test scripts, it showed up in the perf test list unexpectedly. $ ./perf test list 2>&1 | grep 86 76: x86 bp modify 77: x86 Sample parsing 78: x86 hybrid 86: <---- (here) $ ./perf test -v 86 86: : --- start --- test child forked, pid 1932207 test child finished with 0 ---- end ---- : Ok As it's a collection of library functions, it should not run as is. Let's remove the execute permission. Fixes: fc51fc87b1b8 ("perf test: Move all the check functions of stat CSV output to lib") Acked-by: Ian Rogers Cc: Kan Liang Cc: Andi Kleen Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230622055832.83476-1-namhyung@kernel.org Signed-off-by: Namhyung Kim commit 63e2f55cabedf8a7ede928f7cf3ab028af44b9e9 Author: Sean Christopherson Date: Tue Apr 11 10:16:51 2023 -0700 Documentation/process: Add a maintainer handbook for KVM x86 Add a KVM x86 doc to the subsystem/maintainer handbook section to explain how KVM x86 (currently) operates as a sub-subsystem, and to soapbox on the rules and expectations for contributing to KVM x86. Reviewed-by: Like Xu Link: https://lore.kernel.org/r/20230411171651.1067966-3-seanjc@google.com Signed-off-by: Sean Christopherson commit b7dac767c9356fe94fe345f907adf573cf745d8d Author: Sean Christopherson Date: Tue Apr 11 10:16:50 2023 -0700 Documentation/process: Add a label for the tip tree handbook's coding style Add a label for the tip tree's "Coding style notes" so that a forthcoming KVM x86 handbook can reference/piggyback the tip tree's preferred coding style. Link: https://lore.kernel.org/r/20230411171651.1067966-2-seanjc@google.com Signed-off-by: Sean Christopherson commit 1ffe6ddc5c64f88b1ec2e250327defb5446a7904 Author: Conor Dooley Date: Thu Jun 15 23:50:15 2023 +0100 dt-bindings: riscv: cpus: switch to unevaluatedProperties: false To permit validation of cpu nodes, swap "additionalProperties: true" out for "unevaluatedProperties: false". Signed-off-by: Conor Dooley Reviewed-by: Rob Herring Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230615-viper-stoic-1ff8efd7d51d@spud Signed-off-by: Palmer Dabbelt commit 3c1b4758a9544cbaf38d052ad66a69618e920ceb Author: Conor Dooley Date: Thu Jun 15 23:50:14 2023 +0100 dt-bindings: riscv: cpus: add a ref the common cpu schema To permit validation of RISC-V cpu nodes, "additionalProperties: true" needs to be swapped for "unevaluatedProperties: false". To facilitate this in a way that passes dt_binding_check, a reference to the cpu schema is required. Disallow the generic cache-op-block-size property that that drags in, since the RISC-V CBO extensions do not require a common size, and have individual properties. Signed-off-by: Conor Dooley Reviewed-by: Rob Herring Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230615-dubiously-parasail-79d34cefedce@spud Signed-off-by: Palmer Dabbelt commit 6eef895581c9b5fcd002ff77837e0c3a4b1eecf6 Author: Miquel Raynal Date: Thu Jun 22 11:06:34 2023 +0200 spi: sun6i: Use the new helper to derive the xfer timeout value A helper was recently added to the core to factorize common code between drivers, like the amount of time a driver should wait for a transfer to happen. It is of course possible to use a default value (like eg. 1s) but it is way stronger to adapt this amount of time to the transfer. Indeed, long transfers (eg. 4MiB) on a slow single-spi bus might take more than the usual second of timeout and prevent lengthy transfers. The core helper was heavily inspired by the logic applied in this driver, the only difference being the minimum amount of time which was enlarged from 0.1s to 0.5s. Use this helper instead of open-coding it. Signed-off-by: Miquel Raynal Acked-by: Jernej Škrabec Link: https://lore.kernel.org/r/Message-Id: <20230622090634.3411468-4-miquel.raynal@bootlin.com> Signed-off-by: Mark Brown commit e0205d6203c2ce598ae26d4b2707ca4224a9c90b Author: Miquel Raynal Date: Thu Jun 22 11:06:33 2023 +0200 spi: atmel: Prevent false timeouts on long transfers A slow SPI bus clocks at ~20MHz, which means it would transfer about 2500 bytes per second with a single data line. Big transfers, like when dealing with flashes can easily reach a few MiB. The current DMA timeout is set to 1 second, which means any working transfer of about 4MiB will always be cancelled. With the above derivations, on a slow bus, we can assume every byte will take at most 0.4ms. Said otherwise, we could add 4ms to the 1-second timeout delay every 10kiB. On a 4MiB transfer, it would bring the timeout delay up to 2.6s which still seems rather acceptable for a timeout. The consequence of this is that long transfers might be allowed, which hence requires the need to interrupt the transfer if wanted by the user. We can hence switch to the _interruptible variant of wait_for_completion. This leads to a little bit more handling to also handle the interrupted case but looks really acceptable overall. While at it, we drop the useless, noisy and redundant WARN_ON() call. Signed-off-by: Miquel Raynal Acked-by: Ryan Wanner Link: https://lore.kernel.org/r/Message-Id: <20230622090634.3411468-3-miquel.raynal@bootlin.com> Signed-off-by: Mark Brown commit ad5c18c75d2a1de9eeaed60e417d308217f35e73 Author: Vadym Kochan Date: Mon Jun 19 16:07:42 2023 +1200 dt-bindings: mtd: marvell-nand: Convert to YAML DT scheme Switch the DT binding to a YAML schema to enable the DT validation. There was also an incorrect reference to dma-names being "rxtx" where the driver and existing device trees actually use dma-names = "data" so this is corrected in the conversion. Signed-off-by: Vadym Kochan Signed-off-by: Chris Packham Reviewed-by: Rob Herring Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230619040742.1108172-2-chris.packham@alliedtelesis.co.nz commit bae825ccfd4b49695466c81eed5bb51c00eebd54 Author: Miquel Raynal Date: Mon Jun 19 11:29:16 2023 +0200 dt-bindings: mtd: ti,am654: Prevent unevaluated properties Reference mtd-physmap.yaml which contains all the relevant properties for this device. Add "unevaluatedProperties: false" to avoid any spurious addition of random properties. Cc: Vignesh Raghavendra Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-18-miquel.raynal@bootlin.com commit 2beb46f04bd7a857f4994dd1085a49254d6c6602 Author: Miquel Raynal Date: Mon Jun 19 11:29:15 2023 +0200 dt-bindings: mtd: mediatek: Prevent NAND chip unevaluated properties nand-on-flash-bbt is a generic property which may apply to any raw NAND chip, it does not need to be listed in each controller description. The raw NAND chip description file which contains the property is already referenced, so no need to mention the property here again. Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno Cc: Xiangsheng Hou Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-17-miquel.raynal@bootlin.com commit 18d07864e54654b38ba7612c96c0282982a71a41 Author: Miquel Raynal Date: Mon Jun 19 11:29:14 2023 +0200 dt-bindings: mtd: mediatek: Reference raw-nand-chip.yaml The mediatek NAND controller should reference the new raw-nand-chip.yaml binding instead of the original nand-chip.yaml which does not contain *all* the properties that may be used to fully describe the NAND devices, certain properties being actually described under nand-controller.yaml. Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno Cc: Xiangsheng Hou Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-16-miquel.raynal@bootlin.com commit be907ba6c5195579f8bdc506c5b34ea00a9fb358 Author: Miquel Raynal Date: Mon Jun 19 11:29:13 2023 +0200 dt-bindings: mtd: stm32: Prevent NAND chip unevaluated properties List all the possible properties in the NAND chip as per the example and set unevaluatedProperties to false in the NAND chip section. Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: Christophe Kerello Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-15-miquel.raynal@bootlin.com commit d028c1cf2c56317cb7e34fd5e37c45db48fe498a Author: Miquel Raynal Date: Mon Jun 19 11:29:12 2023 +0200 dt-bindings: mtd: rockchip: Prevent NAND chip unevaluated properties List all the possible properties in the NAND chip as per the example and set unevaluatedProperties to false in the NAND chip section. Cc: Heiko Stuebner Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-14-miquel.raynal@bootlin.com commit 1dcd314282957c3ed8e5faba1641b6382fe13b90 Author: Miquel Raynal Date: Mon Jun 19 11:29:11 2023 +0200 dt-bindings: mtd: intel: Prevent NAND chip unevaluated properties nand-ecc-mode is a generic property which may apply to any raw NAND chip, it does not need to be listed in each controller description. Instead, let's reference the raw NAND chip description file which contains the property. The description contained "additionalProperties: false" which is wrong as other properties such as partitions might very well be added in the final .dts, and anyway needs to be converted into "unexpectedProperties: false" to fit the property change new requirements. Cc: Vadivel Murugan Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-13-miquel.raynal@bootlin.com commit 129a70a17cfc4140fd4f1dd6e1f5e767248c8c74 Author: Miquel Raynal Date: Mon Jun 19 11:29:10 2023 +0200 dt-bindings: mtd: denali: Prevent NAND chip unevaluated properties Ensure all raw NAND chip properties are valid by referencing the relevant schema and set unevaluatedProperties to false in the NAND chip section to avoid spurious additions of random properties. Doing this in one location also saves us from dupplicating the description of the NAND chip object. Cc: Masahiro Yamada Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-12-miquel.raynal@bootlin.com commit 74b7e3bd289b02b80abcfc71f03dfac1f4fc937e Author: Miquel Raynal Date: Mon Jun 19 11:29:09 2023 +0200 dt-bindings: mtd: brcmnand: Prevent NAND chip unevaluated properties Ensure all raw NAND chip properties are valid by referencing the relevant schema and set unevaluatedProperties to false in the NAND chip section to avoid spurious additions of random properties. Cc: Brian Norris Cc: Kamal Dasu Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-11-miquel.raynal@bootlin.com commit e37eaf5ebc5be693f76f9d53ea55828fe5af5ffb Author: Miquel Raynal Date: Mon Jun 19 11:29:08 2023 +0200 dt-bindings: mtd: meson: Prevent NAND chip unevaluated properties Ensure all raw NAND chip properties are valid by referencing the relevant schema and set unevaluatedProperties to false in the NAND chip section to avoid spurious additions of random properties. Cc: Liang Yang Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-10-miquel.raynal@bootlin.com commit d58d29623a8aa3f6b34f4c4fadf4c0de821fcbff Author: Miquel Raynal Date: Mon Jun 19 11:29:07 2023 +0200 dt-bindings: mtd: sunxi: Prevent NAND chip unevaluated properties nand-ecc-mode is a generic property which may apply to any raw NAND chip, it does not need to be listed in each controller description. Instead, let's reference the raw NAND chip description file which contains the property. The description contained "additionalProperties: false" which is wrong as other properties such as partitions might very well be added in the final .dts, and anyway needs to be converted into "unexpectedProperties: false" to fit the property change new requirements. Cc: Maxime Ripard Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Samuel Holland Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-9-miquel.raynal@bootlin.com commit 711be9c35a1a6c3d1303f9cbacb98580bcabbb71 Author: Miquel Raynal Date: Mon Jun 19 11:29:06 2023 +0200 dt-bindings: mtd: ingenic: Prevent NAND chip unevaluated properties List all the possible properties in the NAND chip as per the example and set unevaluatedProperties to false in the NAND chip section. Cc: Paul Cercueil Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-8-miquel.raynal@bootlin.com commit 7578bb1f9273aa47d540f71fef446118821784b1 Author: Miquel Raynal Date: Mon Jun 19 11:29:05 2023 +0200 dt-bindings: mtd: qcom: Prevent NAND chip unevaluated properties List all the possible properties in the NAND chip as per the example and set unevaluatedProperties to false in the NAND chip section. Cc: Manivannan Sadhasivam Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-7-miquel.raynal@bootlin.com commit 411a1215a07904cafbea683f4b2908f1310946a1 Author: Miquel Raynal Date: Mon Jun 19 11:29:04 2023 +0200 dt-bindings: mtd: qcom: Fix a property position qcom,boot-partitions is a NAND chip property, not a NAND controller property. Move the description of the property into the NAND chip section and just enable the property in the if/else block. Fixes: 5278cc93a97f ("dt-bindings: mtd: qcom_nandc: document qcom,boot-partitions binding") Cc: Manivannan Sadhasivam Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-6-miquel.raynal@bootlin.com commit efdd296323cdf6303a034ec85086c4b0b2234a71 Author: Miquel Raynal Date: Mon Jun 19 11:29:03 2023 +0200 dt-bindings: mtd: Describe nand-ecc-mode This property has been extensively used for almost two decades already, a lot of device trees use it, this is not the preferred way to configure the ECC engines but we cannot just ignore it. Describe the property, list the exact strings which have once been supported and mark it deprecated. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-5-miquel.raynal@bootlin.com commit 17241a02a84ef748d4ab7386c5a25771b1fa7cc7 Author: Miquel Raynal Date: Mon Jun 19 11:29:02 2023 +0200 dt-bindings: mtd: Mark nand-ecc-placement deprecated The nand-ecc-placement property has been deprecated for a long time already, it does not really mean something useful for the ECC engines and is anyway in the vast majority of cases totally useless. Just mark it deprecated to avoid appealing people to use it. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-4-miquel.raynal@bootlin.com commit 46721a1c9f829fe934eb1ec03e19b9e2896b995a Author: Miquel Raynal Date: Mon Jun 19 11:29:01 2023 +0200 dt-bindings: mtd: Create a file for raw NAND chip properties In an effort to constrain as much as we can the existing binding, we want to add "unevaluatedProperties: false" in all the NAND chip descriptions part of NAND controller bindings. But in order to do that properly, we also need to reference a file which contains all the "allowed" properties. Right now this file is nand-chip.yaml but in practice raw NAND controllers may use additional properties in their NAND chip children node. These properties are listed under nand-controller.yaml, which makes the "unevaluatedProperties" checks fail while the description are valid. We need to move these NAND chip related properties into another file, because we do not want to pollute nand-chip.yaml which is also referenced by eg. SPI-NAND devices. Let's create a raw-nand-chip.yaml file to reference all the properties a raw NAND chip description can contain. The chain of inheritance becomes: nand-controller.yaml <- raw-nand-chip.yaml raw-nand-chip.yaml <- nand-chip.yaml spi-nand.yaml <- nand-chip.yaml Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-3-miquel.raynal@bootlin.com commit da787688a5a08ece05a2f752d38b281fab8df846 Author: Miquel Raynal Date: Mon Jun 19 11:29:00 2023 +0200 dt-bindings: mtd: Accept nand related node names There is no addition there, but the mtd.yaml file is so generic, it can be referenced by a wide variety of devices, including nand ones which already define the node name to "nand@". Right now it does not lead to any failure but when we will constrain more the schema, this will become a problem because we want the mtd-wide properties like label or partitions to be available for the callers. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-2-miquel.raynal@bootlin.com commit efd2ed9351efefe40cbcca36a527adf38ffe1b4d Author: Bo Liu Date: Tue Jun 20 22:03:31 2023 -0400 mtd: sm_ftl: Fix typos in comments Fix typo in the description of the 'succesfull'. Signed-off-by: Bo Liu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230621020331.1508-1-wangdeming@inspur.com commit 2a3110e3f97ddc0f53bb766797b926a35edd07e6 Author: Andy Shevchenko Date: Wed Jun 21 19:26:26 2023 +0300 MAINTAINERS: Add bitfield.h to the BITMAP API record From time to time changes are tending to go to bitfield.h header while it may affect other bit operataions. Add bitfiled.h to the BITMAP API record. Signed-off-by: Andy Shevchenko Acked-by: Yury Norov Acked-by: Rasmus Villemoes Signed-off-by: Yury Norov commit f4bc6c12b0280077f799f2d50719ca52370ecb20 Author: Andy Shevchenko Date: Wed Jun 21 19:26:25 2023 +0300 MAINTAINERS: Add bits.h to the BITMAP API record >From time to time changes are tending to go to the bits.h headers while it may affect other bit operataions. Add the bits.h to the BITMAP API record. Signed-off-by: Andy Shevchenko Acked-by: Yury Norov Acked-by: Rasmus Villemoes Signed-off-by: Yury Norov commit 839cad5fa54bd6e4aad137f695ec6f90acb78728 Author: Randy Dunlap Date: Mon Jan 2 13:18:30 2023 -0800 cpumask: fix function description kernel-doc notation Use kernel-doc notation for the function description to prevent a warning: lib/cpumask.c:160: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Returns an arbitrary cpu within srcp1 & srcp2. Signed-off-by: Randy Dunlap Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov commit cdd2d06fbc0a58297f782c8eb7e2f3c0b1dc367e Author: Gavin Shan Date: Tue Jan 24 08:02:43 2023 +0800 nodemask: Drop duplicate check in for_each_node_mask() The return value type is changed from 'int' to 'unsigned int' since commit 0dfe54071d7c8 ("nodemask: Fix return values to be unsigned"). Besides, the conversion between 'int' and 'unsigned int' on the parameter @node is guaranteed to be safe due to the limited range of MAX_NUMNODES and CONFIG_NODES_SHIFT. By the way, '(node >= 0)' should have been '(node) >= 0' actually. It's unnecessary to check if their return values are greater or equal to 0 in for_each_node_mask(). Remove it. No functional change intended. Signed-off-by: Gavin Shan Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov commit c1d2ba10f594046831d14b03f194e8d05e78abad Author: Yury Norov Date: Mon Feb 27 11:24:36 2023 -0800 lib/bitmap: drop optimization of bitmap_{from,to}_arr64 bitmap_{from,to}_arr64() optimization is overly optimistic on 32-bit LE architectures when it's wired to bitmap_copy_clear_tail(). bitmap_copy_clear_tail() takes care of unused bits in the bitmap up to the next word boundary. But on 32-bit machines when copying bits from bitmap to array of 64-bit words, it's expected that the unused part of a recipient array must be cleared up to 64-bit boundary, so the last 4 bytes may stay untouched when nbits % 64 <= 32. While the copying part of the optimization works correct, that clear-tail trick makes corresponding tests reasonably fail: test_bitmap: bitmap_to_arr64(nbits == 1): tail is not safely cleared: 0xa5a5a5a500000001 (must be 0x0000000000000001) Fix it by removing bitmap_{from,to}_arr64() optimization for 32-bit LE arches. Reported-by: Guenter Roeck Link: https://lore.kernel.org/lkml/20230225184702.GA3587246@roeck-us.net/ Fixes: 0a97953fd221 ("lib: add bitmap_{from,to}_arr64") Signed-off-by: Yury Norov Tested-by: Guenter Roeck Reviewed-by: Andy Shevchenko Reviewed-by: Alexander Lobakin commit c4c14c290682e080da5cee81f4998062e1be274a Author: Yury Norov Date: Sat Feb 25 16:19:30 2023 -0800 lib/test_bitmap: increment failure counter properly The tests that don't use expect_eq() macro to determine that a test is failured must increment failed_tests explicitly. Reported-by: Guenter Roeck Link: https://lore.kernel.org/lkml/20230225184702.GA3587246@roeck-us.net/ Signed-off-by: Yury Norov Reviewed-by: Andy Shevchenko Reviewed-by: Alexander Lobakin commit 81621430c81bb7965c3d5807039bc2b5b3ec87ca Author: Tejun Heo Date: Thu Jun 22 08:51:14 2023 -1000 Revert "cgroup: Avoid -Wstringop-overflow warnings" This reverts commit 36de5f303ca1bd6fce74815ef17ef3d8ff8737b5. The commit caused boot failures on some configurations due to cgroup hierarchies not being created at all. Signed-off-by: Tejun Heo commit b7a0345723385c3cc0438cf4266ccc110dc7b583 Author: Maciej Fijalkowski Date: Tue Jun 13 13:35:52 2023 +0200 ice: use ice_down_up() where applicable ice_change_mtu() is currently using a separate ice_down() and ice_up() calls to reflect changed MTU. ice_down_up() serves this purpose, so do the refactoring here. Signed-off-by: Maciej Fijalkowski Reviewed-by: Przemek Kitszel Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 1dacc49782e67d4316b46329e416c24473c0369c Author: Christophe JAILLET Date: Sun Jun 11 22:44:13 2023 +0200 ice: Remove managed memory usage in ice_get_fw_log_cfg() There is no need to use managed memory allocation here. The memory is released at the end of the function. Use kzalloc()/kfree() to simplify the code. Signed-off-by: Christophe JAILLET Reviewed-by: Pavan Chebbi Reviewed-by: Jacob Keller Signed-off-by: Tony Nguyen commit 31b5a547622b3782388eb676081da1eefe5b98d2 Author: Johannes Berg Date: Thu Jun 22 19:44:22 2023 +0200 wifi: ieee80211: fix erroneous NSTR bitmap size checks The complete profile bit together with the NSTR link pair present bit indicate whether or not the NSTR bitmap is, the NSTR bitmap size just indicates how big it is. Fixes: 7b6f08771bf6 ("wifi: ieee80211: Support validating ML station profile length") Fixes: 5c1f97537bfb ("wifi: mac80211: store BSS param change count from assoc response") Reported-by: Dan Carpenter Signed-off-by: Johannes Berg commit fbc5669de62a452fb3a26a4560668637d5c9e7b5 Author: Anton Protopopov Date: Thu Jun 22 09:54:24 2023 +0000 bpf, docs: Document existing macros instead of deprecated The BTF_TYPE_SAFE_NESTED macro was replaced by the BTF_TYPE_SAFE_TRUSTED, BTF_TYPE_SAFE_RCU, and BTF_TYPE_SAFE_RCU_OR_NULL macros. Fix the docs correspondingly. Fixes: 6fcd486b3a0a ("bpf: Refactor RCU enforcement in the verifier.") Signed-off-by: Anton Protopopov Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20230622095424.1024244-1-aspsk@isovalent.com commit 2404dd01b53430e4ab78fc9ca069e9e93fd22059 Author: Anton Protopopov Date: Thu Jun 22 09:54:07 2023 +0000 bpf, docs: BPF Iterator Document Fix the description of the seq_info field of the bpf_iter_reg structure which was wrong due to an accidental copy/paste of the previous field's description. Fixes: 8972e18a439d ("bpf, docs: BPF Iterator Document") Signed-off-by: Anton Protopopov Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20230622095407.1024053-1-aspsk@isovalent.com commit 0d67bbc48c7397bc97fa91c9b9c66c6570451131 Author: Wilken Gottwalt Date: Thu Jun 22 17:09:28 2023 +0000 hwmon: (corsair-psu) add support for reading PWM values and mode Add support for reading PWM values and mode, and update documentation accordingly. Signed-off-by: Wilken Gottwalt Link: https://lore.kernel.org/r/ZJSASByXpzoZ0XyH@monster.localdomain Signed-off-by: Guenter Roeck commit dd5219ce4f295a129ee38baff308f9c1e4f0761b Author: Guenter Roeck Date: Wed Jun 14 09:36:05 2023 -0700 hwmon: (pmbus/adm1275) Disable ADC while updating PMON_CONFIG According to ADI, changing PMON_CONFIG while the ADC is running can have unexpected results. ADI recommends halting the ADC with PMON_CONTROL before setting PMON_CONFIG and then resume after. Follow ADI recommendation and disable ADC while PMON_CONFIG is updated. Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20230614163605.3688964-3-linux@roeck-us.net Signed-off-by: Guenter Roeck commit 98ac8af4e7b2f260236cf468762450630e73eb67 Author: Guenter Roeck Date: Wed Jun 14 09:36:04 2023 -0700 hwmon: (pmbus/adm1275) Prepare for protected write to PMON_CONFIG According to ADI, changing PMON_CONFIG while ADC is running can have unexpected results. ADI recommends halting the ADC with PMON_CONTROL before setting PMON_CONFIG and then resume after. To prepare for this change, rename adm1275_read_pmon_config() and adm1275_write_pmon_config() to adm1275_read_samples() and adm1275_write_samples() to more accurately reflect the functionality of the code. Introduce new function adm1275_write_pmon_config() and use it for all code writing into the PMON_CONFIG register. Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20230614163605.3688964-2-linux@roeck-us.net Signed-off-by: Guenter Roeck commit a7555f6b62e7f5b3a3b783cc6d4c4dafcb8527c8 Author: Guo Ren Date: Tue Jun 13 21:30:18 2023 -0400 riscv: stack: Add config of thread stack size The commit 0cac21b02ba5 ("riscv: use 16KB kernel stack on 64-bit") increases the thread size mandatory, but some scenarios, such as D1 with a small memory footprint, would suffer from that. After independent irq stack support, let's give users a choice to determine their custom stack size. Link: https://lore.kernel.org/linux-riscv/5f6e6c39-b846-4392-b468-02202404de28@www.fastmail.com/ Suggested-by: Arnd Bergmann Tested-by: Jisheng Zhang Signed-off-by: Guo Ren Signed-off-by: Guo Ren Link: https://lore.kernel.org/r/20230614013018.2168426-4-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit dd69d07a5a6c5a9ada85321ab0695e7978fc6f3e Author: Guo Ren Date: Tue Jun 13 21:30:17 2023 -0400 riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK Add the HAVE_SOFTIRQ_ON_OWN_STACK feature for the IRQ_STACKS config, and the irq and softirq use the same irq_stack of percpu. Tested-by: Jisheng Zhang Signed-off-by: Guo Ren Signed-off-by: Guo Ren Link: https://lore.kernel.org/r/20230614013018.2168426-3-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 163e76cc6ef43b7a5e9b6e245a6d6667c9d9b4a7 Author: Guo Ren Date: Tue Jun 13 21:30:16 2023 -0400 riscv: stack: Support HAVE_IRQ_EXIT_ON_IRQ_STACK Add independent irq stacks for percpu to prevent kernel stack overflows. It is also compatible with VMAP_STACK by arch_alloc_vmap_stack. Tested-by: Jisheng Zhang Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Clément Léger Link: https://lore.kernel.org/r/20230614013018.2168426-2-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 7947540d1d1e76297869921ed601e2f47fa6f27d Author: Gustavo A. R. Silva Date: Thu Jun 22 10:46:33 2023 -0600 fbdev: sh7760fb: Fix -Wimplicit-fallthrough warnings Fix the following fallthrough warnings seen after building sh architecture with sh7763rdp_defconfig configuration: drivers/video/fbdev/sh7760fb.c: In function 'sh7760fb_get_color_info': drivers/video/fbdev/sh7760fb.c:138:23: warning: this statement may fall through [-Wimplicit-fallthrough=] 138 | lgray = 1; | ~~~~~~^~~ drivers/video/fbdev/sh7760fb.c:139:9: note: here 139 | case LDDFR_4BPP: | ^~~~ drivers/video/fbdev/sh7760fb.c:143:23: warning: this statement may fall through [-Wimplicit-fallthrough=] 143 | lgray = 1; | ~~~~~~^~~ drivers/video/fbdev/sh7760fb.c:144:9: note: here 144 | case LDDFR_8BPP: | ^~~~ Signed-off-by: Gustavo A. R. Silva Signed-off-by: Helge Deller commit 47fa0fac9bb5e525c5fa67bf06f3f663cf999841 Author: Geert Uytterhoeven Date: Thu Jun 22 11:28:48 2023 +0200 fbdev: sh_mobile_lcdcfb: Fix ARGB32 overlay format typo When configurating a CHn Source Image Format Register (LDBBSIFR), one should use the corresponding LDBBSIFR_RPKF_* definition for overlay planes, not the DDFR_PKF_* definition for the primary plane. Fortunately both definitions resolve to the same value, so this bug did not cause any harm. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Signed-off-by: Helge Deller commit ad667d626825383b626ad6ed38d6205618abb115 Author: Przemek Kitszel Date: Wed May 31 14:38:40 2023 +0200 ice: remove null checks before devm_kfree() calls We all know they are redundant. Reviewed-by: Michal Swiatkowski Reviewed-by: Michal Wilczynski Reviewed-by: Simon Horman Signed-off-by: Przemek Kitszel Tested-by: Arpana Arland (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit f98277479ad85ff1398e11c1e944ba97c3917393 Author: Przemek Kitszel Date: Wed May 31 14:36:42 2023 +0200 ice: clean up freeing SR-IOV VFs The check for existing VFs was redundant since very inception of SR-IOV sysfs interface in the kernel, see commit 1789382a72a5 ("PCI: SRIOV control and status via sysfs"). Reviewed-by: Michal Swiatkowski Reviewed-by: Simon Horman Signed-off-by: Przemek Kitszel Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 469748429ac81f0a6a344637fc9d3b1d16a9f3d8 Author: Maciej Fijalkowski Date: Thu Jun 15 13:33:26 2023 +0200 ice: allow hot-swapping XDP programs Currently ice driver's .ndo_bpf callback brings interface down and up independently of XDP resources' presence. This is only needed when either these resources have to be configured or removed. It means that if one is switching XDP programs on-the-fly with running traffic, packets will be dropped. To avoid this, compare early on ice_xdp_setup_prog() state of incoming bpf_prog pointer vs the bpf_prog pointer that is already assigned to VSI. Do the swap in case VSI has bpf_prog and incoming one are non-NULL. Lastly, while at it, put old bpf_prog *after* the update of Rx ring's bpf_prog pointer. In theory previous code could expose us to a state where Rx ring's bpf_prog would still be referring to old_prog that got released with earlier bpf_prog_put(). Signed-off-by: Maciej Fijalkowski Acked-by: Toke Høiland-Jørgensen Reviewed-by: Alexander Lobakin Tested-by: Chandan Kumar Rout (A Contingent Worker at Intel) Signed-off-by: Tony Nguyen commit a734c43caa4d9a08da521be1a2135cadf1510e75 Author: Jacob Keller Date: Tue Jun 13 13:40:53 2023 -0700 ice: reduce initial wait for control queue messages The ice_sq_send_cmd() function is used to send messages to the control queues used to communicate with firmware, virtual functions, and even some hardware. When sending a control queue message, the driver is designed to synchronously wait for a response from the queue. Currently it waits between checks for 100 to 150 microseconds. Commit f86d6f9c49f6 ("ice: sleep, don't busy-wait, for ICE_CTL_Q_SQ_CMD_TIMEOUT") did recently change the behavior from an unnecessary delay into a sleep which is a significant improvement over the old behavior of polling using udelay. Because of the nature of PCIe transactions, the hardware won't be informed about a new message until the write to the tail register posts. This is only guaranteed to occur at the next register read. In ice_sq_send_cmd(), this happens at the ice_sq_done() call. Because of this, the driver essentially forces a minimum of one full wait time regardless of how fast the response is. For the hardware-based sideband queue, this is especially slow. It is expected that the hardware will respond within 2 or 3 microseconds, an order of magnitude faster than the 100-150 microsecond sleep. Allow such fast completions to occur without delay by introducing a small 5 microsecond delay first before entering the sleeping timeout loop. Ensure the tail write has been posted by using ice_flush(hw) first. While at it, lets also remove the ICE_CTL_Q_SQ_CMD_USEC macro as it obscures the sleep time in the inner loop. It was likely introduced to avoid "magic numbers", but in practice sleep and delay values are easier to read and understand when using actual numbers instead of a named constant. This change should allow the fast hardware based control queue messages to complete quickly without delay, while slower firmware queue response times will sleep while waiting for the response. Signed-off-by: Jacob Keller Reviewed-by: Michal Schmidt Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 192df2aa0113ddddee2a93e453ff46610807b425 Author: Oliver Upton Date: Thu Jun 22 16:09:22 2023 +0000 KVM: arm64: Fix misuse of KVM_ARM_VCPU_POWER_OFF bit index KVM_ARM_VCPU_POWER_OFF is as bit index, _not_ a literal bitmask. Nonetheless, commit e3c1c0cae31e ("KVM: arm64: Relax invariance of KVM_ARM_VCPU_POWER_OFF") started using it that way, meaning that powering off a vCPU with the KVM_ARM_VCPU_INIT ioctl is completely broken. Fix it by using a shifted bit for the bitwise operations instead. Reported-by: Dan Carpenter Fixes: e3c1c0cae31e ("KVM: arm64: Relax invariance of KVM_ARM_VCPU_POWER_OFF") Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20230622160922.1925530-1-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 01fa9edd8bcf1c4fe330ea000c3da9ecf76c76a0 Author: Valentin Caron Date: Wed Jun 21 13:55:23 2023 +0200 spi: dt-bindings: stm32: do not disable spi-slave property for stm32f4-f7 STM32F4-F7 are, from hardware point of view, capable to handle device mode. So this property should not be forced at false in dt-bindings. Signed-off-by: Valentin Caron Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/Message-Id: <20230621115523.923176-3-valentin.caron@foss.st.com> Signed-off-by: Mark Brown commit 82f76ac26c601c5b0c0db7f69500efc42f2ee7ed Author: Srinivas Kandagatla Date: Thu Mar 2 12:03:27 2023 +0000 ASoC: qcom: common: add default jack dapm pins If the soundcard does not specify the dapm pins, let the common code add these pins for jack. Signed-off-by: Srinivas Kandagatla Tested-by: Johan Hovold Link: https://lore.kernel.org/r/Message-Id: <20230302120327.10823-1-srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown commit 012fa2622e30675f61413485785e708ba02be78b Author: Arnd Bergmann Date: Thu Jun 22 12:12:22 2023 +0200 ASoC: loongson: fix address space confusion The i2s driver uses the mapped __iomem address of the FIFO as the DMA address for the device. This apparently works on loongarch because of the way it handles __iomem pointers as aliases of physical addresses, but this is not portable to other architectures and causes a compiler warning when dma addresses are not the same size as pointers: sound/soc/loongson/loongson_i2s_pci.c: In function 'loongson_i2s_pci_probe': sound/soc/loongson/loongson_i2s_pci.c:110:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 110 | tx_data->dev_addr = (dma_addr_t)i2s->reg_base + LS_I2S_TX_DATA; | ^ sound/soc/loongson/loongson_i2s_pci.c:113:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 113 | rx_data->dev_addr = (dma_addr_t)i2s->reg_base + LS_I2S_RX_DATA; | ^ Change the driver to instead use the physical address as stored in the PCI BAR resource directly. Since 'dev_addr' is a 32-bit address, I think this results in the same truncated address on loongarch but is otherwise closer to portable code and avoids the warning. Fixes: d84881e06836d ("ASoC: Add support for Loongson I2S controller") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/Message-Id: <20230622101235.3230941-1-arnd@kernel.org> Signed-off-by: Mark Brown commit b2c28785b125acb28a681462510297410cbbabd7 Author: Rob Herring Date: Wed Jun 21 17:10:44 2023 -0600 ASoC: dt-bindings: microchip,sama7g5-pdmc: Simplify "microchip,mic-pos" constraints "enum" values should be integers or strings, not arrays (though json-schema does allow arrays, we do not). In this case, all possible combinations are allowed anyways, so there's little point in expressing as an array. Signed-off-by: Rob Herring Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/Message-Id: <20230621231044.3816914-1-robh@kernel.org> Signed-off-by: Mark Brown commit f47d43283a4233528683deaaba95f0ee2cfe862d Author: Sameer Pujar Date: Thu Jun 22 17:04:14 2023 +0530 ASoC: tegra: Remove stale comments in AHUB Remove stale comments in AHUB driver which is related to DAPM widgets and routes. This is misleading otherwise. Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/Message-Id: <1687433656-7892-7-git-send-email-spujar@nvidia.com> Signed-off-by: Mark Brown commit 2cc41db71a434844ca97b6e30c9a30a2464a996e Author: Sameer Pujar Date: Thu Jun 22 17:04:13 2023 +0530 ASoC: tegra: Use normal system sleep for ASRC Align with other AHUB module drivers and use normal system sleep for ASRC as well. Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/Message-Id: <1687433656-7892-6-git-send-email-spujar@nvidia.com> Signed-off-by: Mark Brown commit a4aadf0f5905661cd25c366b96cc1c840f05b756 Author: Przemek Kitszel Date: Wed Jun 21 08:54:05 2023 -0700 iavf: make functions static where possible Make all possible functions static. Move iavf_force_wb() up to avoid forward declaration. Suggested-by: Maciej Fijalkowski Reviewed-by: Maciej Fijalkowski Signed-off-by: Przemek Kitszel Signed-off-by: Tony Nguyen commit b855bcdeb89777ff255bedf8f1330aac9b26b405 Author: Przemek Kitszel Date: Thu Jun 15 07:03:08 2023 -0400 iavf: remove some unused functions and pointless wrappers Remove iavf_aq_get_rss_lut(), iavf_aq_get_rss_key(), iavf_vf_reset(). Remove some "OS specific memory free for shared code" wrappers ;) Signed-off-by: Przemek Kitszel Signed-off-by: Tony Nguyen commit 61f723e6f3d20f3276c678cd346de5ea86b8e5d3 Author: Przemek Kitszel Date: Mon Jun 19 04:06:35 2023 -0400 iavf: fix err handling for MAC replace Defer removal of current primary MAC until a replacement is successfully added. Previous implementation would left filter list with no primary MAC. This was found while reading the code. The patch takes advantage of the fact that there can only be a single primary MAC filter at any time ([1] by Piotr) Piotr has also applied some review suggestions during our internal patch submittal process. [1] https://lore.kernel.org/netdev/20230614145302.902301-2-piotrx.gardocki@intel.com/ Reviewed-by: Michal Swiatkowski Tested-by: Rafal Romanowski Signed-off-by: Piotr Gardocki Signed-off-by: Przemek Kitszel Reviewed-by: Maciej Fijalkowski Signed-off-by: Tony Nguyen commit 4e302336d5ca1767a06beee7596a72d3bdc8d983 Author: Yogesh Date: Thu Jun 22 00:07:03 2023 +0530 fs: jfs: Fix UBSAN: array-index-out-of-bounds in dbAllocDmapLev Syzkaller reported the following issue: UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dmap.c:1965:6 index -84 is out of range for type 's8[341]' (aka 'signed char[341]') CPU: 1 PID: 4995 Comm: syz-executor146 Not tainted 6.4.0-rc6-syzkaller-00037-gb6dad5178cea #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 ubsan_epilogue lib/ubsan.c:217 [inline] __ubsan_handle_out_of_bounds+0x11c/0x150 lib/ubsan.c:348 dbAllocDmapLev+0x3e5/0x430 fs/jfs/jfs_dmap.c:1965 dbAllocCtl+0x113/0x920 fs/jfs/jfs_dmap.c:1809 dbAllocAG+0x28f/0x10b0 fs/jfs/jfs_dmap.c:1350 dbAlloc+0x658/0xca0 fs/jfs/jfs_dmap.c:874 dtSplitUp fs/jfs/jfs_dtree.c:974 [inline] dtInsert+0xda7/0x6b00 fs/jfs/jfs_dtree.c:863 jfs_create+0x7b6/0xbb0 fs/jfs/namei.c:137 lookup_open fs/namei.c:3492 [inline] open_last_lookups fs/namei.c:3560 [inline] path_openat+0x13df/0x3170 fs/namei.c:3788 do_filp_open+0x234/0x490 fs/namei.c:3818 do_sys_openat2+0x13f/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1383 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f1f4e33f7e9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc21129578 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f1f4e33f7e9 RDX: 000000000000275a RSI: 0000000020000040 RDI: 00000000ffffff9c RBP: 00007f1f4e2ff080 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1f4e2ff110 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The bug occurs when the dbAllocDmapLev()function attempts to access dp->tree.stree[leafidx + LEAFIND] while the leafidx value is negative. To rectify this, the patch introduces a safeguard within the dbAllocDmapLev() function. A check has been added to verify if leafidx is negative. If it is, the function immediately returns an I/O error, preventing any further execution that could potentially cause harm. Tested via syzbot. Reported-by: syzbot+853a6f4dfa3cf37d3aea@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=ae2f5a27a07ae44b0f17 Signed-off-by: Yogesh Signed-off-by: Dave Kleikamp commit 23d28cc0444be3f694eb986cd653b6888b78431d Author: Hans de Goede Date: Tue Jun 20 20:45:04 2023 +0200 ACPI: video: Add backlight=native DMI quirk for Dell Studio 1569 The Dell Studio 1569 predates Windows 8, so it defaults to using acpi_video# for backlight control, but this is non functional on this model. Add a DMI quirk to use the native intel_backlight interface which does work properly. Reported-by: raycekarneal Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 3f711c249032fee954e92e4d04c8cd2744994291 Merge: 57cf6633f3853 6a8b7e8010541 Author: Arnd Bergmann Date: Thu Jun 22 17:35:09 2023 +0200 Merge tag 'optee-use-kmemdup-for-6.5' of https://git.linaro.org/people/jens.wiklander/linux-tee into soc/drivers Use kmemdup() in OP-TEE driver * tag 'optee-use-kmemdup-for-6.5' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: Use kmemdup() to replace kmalloc + memcpy Link: https://lore.kernel.org/r/20230615130049.GA979203@rayden Signed-off-by: Arnd Bergmann commit 57cf6633f3853591b92019533e19bca543ec619f Merge: 2d0d3a1004076 6a66fb9ffe7b4 Author: Arnd Bergmann Date: Thu Jun 22 17:34:02 2023 +0200 Merge tag 'memory-controller-drv-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers Memory controller drivers for v6.5 1. Renesas RPC IF: correct the Strobe Timing Adjustment. 2. Broadcom DPFE: fix smatch warning for testing array offset after use. 3. Atmel SDRAMC: drop driver because it was just a wrapper over enabling clock which is not handled by its clock controller. 4. Minor bindings cleanup. * tag 'memory-controller-drv-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: dt-bindings: memory-controllers: drop unneeded quotes memory: atmel-sdramc: remove the driver memory: brcmstb_dpfe: fix testing array offset after use memory: renesas-rpc-if: Fix PHYCNT.STRTIM setting Link: https://lore.kernel.org/r/20230612175508.288775-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 2d0d3a1004076b97627f5910f6a4600c52434bd1 Merge: 618d12930905e aaffb4cacd4c5 Author: Arnd Bergmann Date: Thu Jun 22 17:33:11 2023 +0200 Merge tag 'scmi-updates-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers Arm SCMI updates for v6.5 Couple of main additions :- 1. Support for multiple SMC/HVC transports for SCMI: Some platforms need to support multiple SCMI instances within a platform(more commonly in a VM). The same SMC/HVC FID is used with all the instances. The platform or the hypervisor needs a way to distinguish among SMC/HVC calls made from different instances. This change adds support for passing shmem channel address as the parameters in the SMC/HVC call. The address is split into 4KB-page and offset for simiplicity. 2. Addition od SCMI v3.2 explicit powercap enable/disable support: SCMI v3.2 specification introduces support to disable powercapping as a whole on the desired zones. This change adds the needed support to the core SCMI powercap protocol, exposing enable/disable protocol operations and then wiring up the new operartions in the related powercap framework helpers. * tag 'scmi-updates-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: powercap: arm_scmi: Add support for disabling powercaps on a zone firmware: arm_scmi: Add Powercap protocol enable support firmware: arm_scmi: Refactor the internal powercap get/set helpers firmware: arm_scmi: Augment SMC/HVC to allow optional parameters dt-bindings: firmware: arm,scmi: support for parameter in smc/hvc call Link: https://lore.kernel.org/r/20230612121017.4108104-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 618d12930905eb237383dcbc3b7113688dc414c0 Merge: 3a00b1c40626c a10b3841f9017 Author: Arnd Bergmann Date: Thu Jun 22 17:32:19 2023 +0200 Merge tag 'v6.5-rockchip-drivers1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into soc/drivers An addition to the rk3588 power-domains, some new syscon compatibles for rk3588-based "General-register-files" register areas and a move to C99 array inits for the dtpm driver to fix sparse warnings. * tag 'v6.5-rockchip-drivers1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: soc: rockchip: dtpm: use C99 array init syntax dt-bindings: soc: rockchip: add rk3588 pipe-phy syscon dt-bindings: soc: rockchip: add rk3588 usb2phy syscon soc: rockchip: power-domain: add rk3588 mem module support Link: https://lore.kernel.org/r/10286366.nUPlyArG6x@phil Signed-off-by: Arnd Bergmann commit c1d57ee6eb99699f5ccd92fc6e8c5a79103dcaae Author: Linus Walleij Date: Wed Jun 14 11:30:32 2023 +0200 ARM: omap2: Fix copy/paste bug I mistyped one of the SD/MMC GPIO lines on the Nokia n810 which was supposed to be "vio" as "vsd". Fix it up. Reported-by: Peter Vasil Signed-off-by: Linus Walleij Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230614093032.403982-1-linus.walleij@linaro.org Signed-off-by: Arnd Bergmann commit 00896810337e73f40af31f9818bfaa3e46fef917 Merge: 11ca605653480 825edae7d1c39 Author: Arnd Bergmann Date: Thu Jun 22 17:28:18 2023 +0200 Merge tag 'arm-soc/for-6.5/maintainers' of https://github.com/Broadcom/stblinux into soc/arm This pull request contains MAINTAINERS file updates for 6.5, please pull the following: - Justin, Kamal and Florian update their email to use their corporate Broadcom email address * tag 'arm-soc/for-6.5/maintainers' of https://github.com/Broadcom/stblinux: MAINTAINERS: Replace my email address MAINTAINERS: Replace my email address MAINTAINERS: Replace my email address Signed-off-by: Arnd Bergmann commit c789ad7cbebcac5d5f417296c140a1252c689524 Author: Vinicius Costa Gomes Date: Wed Jun 7 14:32:32 2023 -0700 igc: Work around HW bug causing missing timestamps There's an hardware issue that can cause missing timestamps. The bug is that the interrupt is only cleared if the IGC_TXSTMPH_0 register is read. The bug can cause a race condition if a timestamp is captured at the wrong time, and we will miss that timestamp. To reduce the time window that the problem is able to happen, in case no timestamp was ready, we read the "previous" value of the timestamp registers, and we compare with the "current" one, if it didn't change we can be reasonably sure that no timestamp was captured. If they are different, we use the new value as the captured timestamp. The HW bug is not easy to reproduce, got to reproduce it when smashing the NIC with timestamping requests from multiple applications (e.g. multiple ntpperf instances + ptp4l), after 10s of minutes. This workaround has more impact when multiple timestamp registers are used, and the IGC_TXSTMPH_0 register always need to be read, so the interrupt is cleared. Fixes: 2c344ae24501 ("igc: Add support for TX timestamping") Signed-off-by: Vinicius Costa Gomes Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit afa141583d82725f682b2fa762cb36a07f58b3f3 Author: Vinicius Costa Gomes Date: Wed Jun 7 14:32:31 2023 -0700 igc: Retrieve TX timestamp during interrupt handling When the interrupt is handled, the TXTT_0 bit in the TSYNCTXCTL register should already be set and the timestamp value already loaded in the appropriate register. This simplifies the handling, and reduces the latency for retrieving the TX timestamp, which increase the amount of TX timestamps that can be handled in a given time period. As the "work" function doesn't run in a workqueue anymore, rename it to something more sensible, a event handler. Using ntpperf[1] we can see the following performance improvements: Before: $ sudo ./ntpperf -i enp3s0 -m 10:22:22:22:22:21 -d 192.168.1.3 -s 172.18.0.0/16 -I -H -o -37 | responses | TX timestamp offset (ns) rate clients | lost invalid basic xleave | min mean max stddev 1000 100 0.00% 0.00% 0.00% 100.00% -56 +9 +52 19 1500 150 0.00% 0.00% 0.00% 100.00% -40 +30 +75 22 2250 225 0.00% 0.00% 0.00% 100.00% -11 +29 +72 15 3375 337 0.00% 0.00% 0.00% 100.00% -18 +40 +88 22 5062 506 0.00% 0.00% 0.00% 100.00% -19 +23 +77 15 7593 759 0.00% 0.00% 0.00% 100.00% +7 +47 +5168 43 11389 1138 0.00% 0.00% 0.00% 100.00% -11 +41 +5240 39 17083 1708 0.00% 0.00% 0.00% 100.00% +19 +60 +5288 50 25624 2562 0.00% 0.00% 0.00% 100.00% +1 +56 +5368 58 38436 3843 0.00% 0.00% 0.00% 100.00% -84 +12 +8847 66 57654 5765 0.00% 0.00% 100.00% 0.00% 86481 8648 0.00% 0.00% 100.00% 0.00% 129721 12972 0.00% 0.00% 100.00% 0.00% 194581 16384 0.00% 0.00% 100.00% 0.00% 291871 16384 27.35% 0.00% 72.65% 0.00% 437806 16384 50.05% 0.00% 49.95% 0.00% After: $ sudo ./ntpperf -i enp3s0 -m 10:22:22:22:22:21 -d 192.168.1.3 -s 172.18.0.0/16 -I -H -o -37 | responses | TX timestamp offset (ns) rate clients | lost invalid basic xleave | min mean max stddev 1000 100 0.00% 0.00% 0.00% 100.00% -44 +0 +61 19 1500 150 0.00% 0.00% 0.00% 100.00% -6 +39 +81 16 2250 225 0.00% 0.00% 0.00% 100.00% -22 +25 +69 15 3375 337 0.00% 0.00% 0.00% 100.00% -28 +15 +56 14 5062 506 0.00% 0.00% 0.00% 100.00% +7 +78 +143 27 7593 759 0.00% 0.00% 0.00% 100.00% -54 +24 +144 47 11389 1138 0.00% 0.00% 0.00% 100.00% -90 -33 +28 21 17083 1708 0.00% 0.00% 0.00% 100.00% -50 -2 +35 14 25624 2562 0.00% 0.00% 0.00% 100.00% -62 +7 +66 23 38436 3843 0.00% 0.00% 0.00% 100.00% -33 +30 +5395 36 57654 5765 0.00% 0.00% 100.00% 0.00% 86481 8648 0.00% 0.00% 100.00% 0.00% 129721 12972 0.00% 0.00% 100.00% 0.00% 194581 16384 19.50% 0.00% 80.50% 0.00% 291871 16384 35.81% 0.00% 64.19% 0.00% 437806 16384 55.40% 0.00% 44.60% 0.00% [1] https://github.com/mlichvar/ntpperf Signed-off-by: Vinicius Costa Gomes Reviewed-by: Kurt Kanzenbach Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit ce58c7cc8b9910f2bc1d038d7ba60c3f011b2cb2 Author: Vinicius Costa Gomes Date: Wed Jun 7 14:32:30 2023 -0700 igc: Check if hardware TX timestamping is enabled earlier Before requesting a packet transmission to be hardware timestamped, check if the user has TX timestamping enabled. Fixes an issue that if a packet was internally forwarded to the NIC, and it had the SKBTX_HW_TSTAMP flag set, the driver would mark that timestamp as skipped. In reality, that timestamp was "not for us", as TX timestamp could never be enabled in the NIC. Checking if the TX timestamping is enabled earlier has a secondary effect that when TX timestamping is disabled, there's no need to check for timestamp timeouts. We should only take care to free any pending timestamp when TX timestamping is disabled, as that skb would never be released otherwise. Fixes: 2c344ae24501 ("igc: Add support for TX timestamping") Suggested-by: Vladimir Oltean Signed-off-by: Vinicius Costa Gomes Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 9c50e2b150c8ee0eee5f8154e2ad168cdd748877 Author: Vinicius Costa Gomes Date: Wed Jun 7 14:32:29 2023 -0700 igc: Fix race condition in PTP tx code Currently, the igc driver supports timestamping only one tx packet at a time. During the transmission flow, the skb that requires hardware timestamping is saved in adapter->ptp_tx_skb. Once hardware has the timestamp, an interrupt is delivered, and adapter->ptp_tx_work is scheduled. In igc_ptp_tx_work(), we read the timestamp register, update adapter->ptp_tx_skb, and notify the network stack. While the thread executing the transmission flow (the user process running in kernel mode) and the thread executing ptp_tx_work don't access adapter->ptp_tx_skb concurrently, there are two other places where adapter->ptp_tx_skb is accessed: igc_ptp_tx_hang() and igc_ptp_suspend(). igc_ptp_tx_hang() is executed by the adapter->watchdog_task worker thread which runs periodically so it is possible we have two threads accessing ptp_tx_skb at the same time. Consider the following scenario: right after __IGC_PTP_TX_IN_PROGRESS is set in igc_xmit_frame_ring(), igc_ptp_tx_hang() is executed. Since adapter->ptp_tx_start hasn't been written yet, this is considered a timeout and adapter->ptp_tx_skb is cleaned up. This patch fixes the issue described above by adding the ptp_tx_lock to protect access to ptp_tx_skb and ptp_tx_start fields from igc_adapter. Since igc_xmit_frame_ring() called in atomic context by the networking stack, ptp_tx_lock is defined as a spinlock, and the irq safe variants of lock/unlock are used. With the introduction of the ptp_tx_lock, the __IGC_PTP_TX_IN_PROGRESS flag doesn't provide much of a use anymore so this patch gets rid of it. Fixes: 2c344ae24501 ("igc: Add support for TX timestamping") Signed-off-by: Andre Guedes Signed-off-by: Vinicius Costa Gomes Reviewed-by: Kurt Kanzenbach Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 4dd595c34c4bb22c16a76206a18c13e4e194335d Author: Sohil Mehta Date: Wed Jun 21 22:36:00 2023 +0000 syscalls: Remove file path comments from headers Source file locations for syscall definitions can change over a period of time. File paths in comments get stale and are hard to maintain long term. Also, their usefulness is questionable since it would be easier to locate a syscall definition using the SYSCALL_DEFINEx() macro. Remove all source file path comments from the syscall headers. Also, equalize the uneven line spacing (some of which is introduced due to the deletions). Signed-off-by: Sohil Mehta Signed-off-by: Arnd Bergmann commit 648fa60fa7de3ca6f6303e1721591ad73def9cf0 Author: Christoph Hellwig Date: Thu Jun 22 17:06:44 2023 +0200 block: don't return -EINVAL for not found names in devt_from_devname When we didn't find a device and didn't guess it might be a partition, it might still show up later, so don't disable rootwait for it by returning -EINVAL. Fixes: 079caa35f786 ("init: clear root_wait on all invalid root= strings") Reported-by: Guenter Roeck Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230622150644.600327-1-hch@lst.de Signed-off-by: Jens Axboe commit 0526b56cbc3c489642bd6a5fe4b718dea7ef0ee8 Author: Tiezhu Yang Date: Thu Jun 22 22:13:39 2023 +0800 tools arch: Remove uapi bitsperlong.h of hexagon and microblaze After the following two commits: commit 872e24d5c698 ("hexagon: remove asm/bitsperlong.h") commit 83f0124ad81e ("microblaze: remove asm-generic wrapper headers") the arch-specific headers of hexagon and microblaze have been removed, the tools arch uapi headers are useless too, remove them. Signed-off-by: Tiezhu Yang Signed-off-by: Arnd Bergmann commit 8386f58f8deda81110283798a387fb53ec21957c Author: Tiezhu Yang Date: Thu Jun 22 22:13:38 2023 +0800 asm-generic: Unify uapi bitsperlong.h for arm64, riscv and loongarch Now we specify the minimal version of GCC as 5.1 and Clang/LLVM as 11.0.0 in Documentation/process/changes.rst, __CHAR_BIT__ and __SIZEOF_LONG__ are usable, it is probably fine to unify the definition of __BITS_PER_LONG as (__CHAR_BIT__ * __SIZEOF_LONG__) in asm-generic uapi bitsperlong.h. In order to keep safe and avoid regression, only unify uapi bitsperlong.h for some archs such as arm64, riscv and loongarch which are using newer toolchains that have the definitions of __CHAR_BIT__ and __SIZEOF_LONG__. Suggested-by: Xi Ruoyao Link: https://lore.kernel.org/all/d3e255e4746de44c9903c4433616d44ffcf18d1b.camel@xry111.site/ Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/linux-arch/a3a4f48a-07d4-4ed9-bc53-5d383428bdd2@app.fastmail.com/ Signed-off-by: Tiezhu Yang Signed-off-by: Arnd Bergmann commit f50a000b42195a0e0d22c34c16b7c488b22063a2 Author: Jacky Huang Date: Thu Jun 22 14:13:43 2023 +0000 clk: nuvoton: Use clk_parent_data instead of string for parent clock For the declaration of parent clocks, use struct clk_parent_data instead of a string. Due to the change in the passed arguments, replace the usage of devm_clk_hw_register_mux() with clk_hw_register_mux_parent_data() for all cases. Signed-off-by: Jacky Huang Signed-off-by: Arnd Bergmann commit ebd617b675438a75d773833f5d87b70fbdb88e96 Author: Jacky Huang Date: Thu Jun 22 14:13:42 2023 +0000 clk: nuvoton: Update all constant hex values to lowercase The constant hex values used to define register offsets were written in uppercase. This patch update all these constant hex values to be lowercase. Signed-off-by: Jacky Huang Signed-off-by: Arnd Bergmann commit a5e3f37217b7b028c87f7bb73b199e65d346e51a Author: Jacky Huang Date: Thu Jun 22 14:13:41 2023 +0000 clk: nuvoton: Add clk-ma35d1.h for driver extern functions Moved the declaration of extern functions ma35d1_reg_clk_pll() and ma35d1_reg_adc_clkdiv() from the .c files to the newly created header file clk-ma35d1.h. Signed-off-by: Jacky Huang Signed-off-by: Arnd Bergmann commit 4481913607e58196c48a4fef5e6f45350684ec3c Author: Yunxiang Li Date: Thu Jun 22 10:18:03 2023 -0400 drm/ttm: fix bulk_move corruption when adding a entry When the resource is the first in the bulk_move range, adding it again (thus moving it to the tail) will corrupt the list since the first pointer is not moved. This eventually lead to null pointer deref in ttm_lru_bulk_move_del() Fixes: fee2ede15542 ("drm/ttm: rework bulk move handling v5") Signed-off-by: Yunxiang Li Reviewed-by: Christian König CC: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20230622141902.28718-3-Yunxiang.Li@amd.com Signed-off-by: Christian König commit b97aec082b51a0728adc9f69494826d32e0d1f8f Author: Donglin Peng Date: Sat Apr 8 05:42:19 2023 -0700 riscv: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL The previous patch ("function_graph: Support recording and printing the return value of function") has laid the groundwork for the for the funcgraph-retval, and this modification makes it available on the RISC-V platform. We introduce a new structure called fgraph_ret_regs for the RISC-V platform to hold return registers and the frame pointer. We then fill its content in the return_to_handler and pass its address to the function ftrace_return_to_handler to record the return value. Link: https://lore.kernel.org/linux-trace-kernel/a8d71b12259f90e7e63d0ea654fcac95b0232bbc.1680954589.git.pengdonglin@sangfor.com.cn Signed-off-by: Donglin Peng Acked-by: Palmer Dabbelt Signed-off-by: Steven Rostedt (Google) commit 38638ffa6059049334b4d87bd4d85cf3418b5e27 Author: Azeem Shaikh Date: Tue Jun 13 00:41:25 2023 +0000 tracing/boot: Replace strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since return value of -E2BIG is used to check for truncation instead of sizeof(dest). [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Link: https://lore.kernel.org/linux-trace-kernel/20230613004125.3539934-1-azeemshaikh38@gmail.com Cc: Masami Hiramatsu Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Steven Rostedt (Google) commit e88ed227f639ebcb31ed4e5b88756b47d904584b Author: Daniel Bristot de Oliveira Date: Tue Jun 6 17:12:27 2023 +0200 tracing/timerlat: Add user-space interface Going a step further, we propose a way to use any user-space workload as the task waiting for the timerlat timer. This is done via a per-CPU file named osnoise/cpu$id/timerlat_fd file. The tracef_fd allows a task to open at a time. When a task reads the file, the timerlat timer is armed for future osnoise/timerlat_period_us time. When the timer fires, it prints the IRQ latency and wakes up the user-space thread waiting in the timerlat_fd. The thread then starts to run, executes the timerlat measurement, prints the thread scheduling latency and returns to user-space. When the thread rereads the timerlat_fd, the tracer will print the user-ret(urn) latency, which is an additional metric. This additional metric is also traced by the tracer and can be used, for example of measuring the context switch overhead from kernel-to-user and user-to-kernel, or the response time for an arbitrary execution in user-space. The tracer supports one thread per CPU, the thread must be pinned to the CPU, and it cannot migrate while holding the timerlat_fd. The reason is that the tracer is per CPU (nothing prohibits the tracer from allowing migrations in the future). The tracer monitors the migration of the thread and disables the tracer if detected. The timerlat_fd is only available for opening/reading when timerlat tracer is enabled, and NO_OSNOISE_WORKLOAD is set. The simplest way to activate this feature from user-space is: -------------------------------- %< ----------------------------------- int main(void) { char buffer[1024]; int timerlat_fd; int retval; long cpu = 0; /* place in CPU 0 */ cpu_set_t set; CPU_ZERO(&set); CPU_SET(cpu, &set); if (sched_setaffinity(gettid(), sizeof(set), &set) == -1) return 1; snprintf(buffer, sizeof(buffer), "/sys/kernel/tracing/osnoise/per_cpu/cpu%ld/timerlat_fd", cpu); timerlat_fd = open(buffer, O_RDONLY); if (timerlat_fd < 0) { printf("error opening %s: %s\n", buffer, strerror(errno)); exit(1); } for (;;) { retval = read(timerlat_fd, buffer, 1024); if (retval < 0) break; } close(timerlat_fd); exit(0); } -------------------------------- >% ----------------------------------- When disabling timerlat, if there is a workload holding the timerlat_fd, the SIGKILL will be sent to the thread. Link: https://lkml.kernel.org/r/69fe66a863d2792ff4c3a149bf9e32e26468bb3a.1686063934.git.bristot@kernel.org Cc: Juri Lelli Cc: William White Cc: Daniel Bristot de Oliveira Cc: Masami Hiramatsu Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit cb7ca871c883eed5132e106cda44b2b060e6f52e Author: Daniel Bristot de Oliveira Date: Tue Jun 6 17:12:26 2023 +0200 tracing/osnoise: Skip running osnoise if all instances are off In the case of all tracing instances being off, sleep for the entire period. Q: Why not kill all threads so? A: It is valid and useful to start the threads with tracing off. For example, rtla disables tracing, starts the tracer, applies the scheduling setup to the threads, e.g., sched priority and cgroup, and then begin tracing with all set. Skipping the period helps to speed up rtla setup and save the trace after a stop tracing. Link: https://lkml.kernel.org/r/aa4dd9b7e76fcb63901fe5407e15ec002b318599.1686063934.git.bristot@kernel.org Cc: Juri Lelli Cc: William White Cc: Daniel Bristot de Oliveira Cc: Masami Hiramatsu Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 4998e7fda149d2392ea6aa9879299d8a32019dbe Author: Daniel Bristot de Oliveira Date: Tue Jun 6 17:12:25 2023 +0200 tracing/osnoise: Switch from PF_NO_SETAFFINITY to migrate_disable Currently, osnoise/timerlat threads run with PF_NO_SETAFFINITY set. It works well, however, cgroups do not allow PF_NO_SETAFFINITY threads to be accepted, and this creates a limitation to osnoise/timerlat. To avoid this limitation, disable migration of the threads as soon as they start to run, and then clean the PF_NO_SETAFFINITY flag (still) used during thread creation. If for some reason a thread migration is requested, e.g., via sched_settafinity, the tracer thread will notice and exit. Link: https://lkml.kernel.org/r/8ba8bc9c15b3ea40cf73cf67a9bc061a264609f0.1686063934.git.bristot@kernel.org Cc: Juri Lelli Cc: William White Cc: Daniel Bristot de Oliveira Cc: Masami Hiramatsu Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 83f74441bcb16c324b7bdba0ab4261a44cb1ac21 Author: Jiri Olsa Date: Sun Jun 11 15:00:29 2023 +0200 ftrace: Show all functions with addresses in available_filter_functions_addrs Adding new available_filter_functions_addrs file that shows all available functions (same as available_filter_functions) together with addresses, like: # cat available_filter_functions_addrs | head ffffffff81000770 __traceiter_initcall_level ffffffff810007c0 __traceiter_initcall_start ffffffff81000810 __traceiter_initcall_finish ffffffff81000860 trace_initcall_finish_cb ... Note displayed address is the patch-site address and can differ from /proc/kallsyms address. It's useful to have address avilable for traceable symbols, so we don't need to allways cross check kallsyms with available_filter_functions (or the other way around) and have all the data in single file. For backwards compatibility reasons we can't change the existing available_filter_functions file output, but we need to add new file. The problem is that we need to do 2 passes: - through available_filter_functions and find out if the function is traceable - through /proc/kallsyms to get the address for traceable function Having available_filter_functions symbols together with addresses allow us to skip the kallsyms step and we are ok with the address in available_filter_functions_addr not being the function entry, because kprobe_multi uses fprobe and that handles both entry and patch-site address properly. We have 2 interfaces how to create kprobe_multi link: a) passing symbols to kernel 1) user gathers symbols and need to ensure that they are trace-able -> pass through available_filter_functions file 2) kernel takes those symbols and translates them to addresses through kallsyms api 3) addresses are passed to fprobe/ftrace through: register_fprobe_ips -> ftrace_set_filter_ips b) passing addresses to kernel 1) user gathers symbols and needs to ensure that they are trace-able -> pass through available_filter_functions file 2) user takes those symbols and translates them to addresses through /proc/kallsyms 3) addresses are passed to the kernel and kernel calls: register_fprobe_ips -> ftrace_set_filter_ips The new available_filter_functions_addrs file helps us with option b), because we can make 'b 1' and 'b 2' in one step - while filtering traceable functions, we get the address directly. Link: https://lore.kernel.org/linux-trace-kernel/20230611130029.1202298-1-jolsa@kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Andrii Nakryiko Tested-by: Jackie Liu # x86 Suggested-by: Steven Rostedt (Google) Suggested-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Signed-off-by: Steven Rostedt (Google) commit 3a00b1c40626cec57fbe93669c4094b180aa97f8 Merge: 0feedcaa0a272 6b0139b372d40 Author: Arnd Bergmann Date: Thu Jun 22 16:37:07 2023 +0200 Merge tag 'amlogic-drivers-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into soc/drivers Amlogic Drivers changes for v6.5: - tag some powers domains as always-on for secure-pwrc - fix MAINTAINERS entry for PHY drivers & bindings - Amlogic Meson GPIO interrupt controller binding to yaml conversion * tag 'amlogic-drivers-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: dt-bindings: interrupt-controller: Convert Amlogic Meson GPIO interrupt controller binding MAINTAINERS: add PHY-related files to Amlogic SoC file list drivers: meson: secure-pwrc: always enable DMA domain Link: https://lore.kernel.org/r/a10ea420-7599-3f41-dfd8-1742ef436ca0@linaro.org Signed-off-by: Arnd Bergmann commit d8e4ebf87018736c0c29e2eb4afe3915156483cd Author: Miquel Raynal Date: Thu Jun 22 11:06:32 2023 +0200 spi: Create a helper to derive adaptive timeouts Big transfers might take a bit of time, too constraining timeouts might lead to false positives. In order to simplify the drivers work and with the goal of factorizing code in mind, let's add a helper that can be used by any spi controller driver to derive a relevant per-transfer timeout value. The logic is simple: we know how much time it would take to transfer a byte, we can easily derive the total theoretical amount of time involved for each transfer. We multiply it by two to have a bit of margin and enforce a minimum of 500ms. Suggested-by: Mark Brown Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/Message-Id: <20230622090634.3411468-2-miquel.raynal@bootlin.com> Signed-off-by: Mark Brown commit 8270cb10c0681d52fce508f827dfa1688d3acc3a Author: Jordy Zomer Date: Sat Jun 17 12:38:28 2023 +0100 cdrom: Fix spectre-v1 gadget This patch fixes a spectre-v1 gadget in cdrom. The gadget could be triggered by speculatively bypassing the cdi->capacity check. Signed-off-by: Jordy Zomer Link: https://lore.kernel.org/all/20230612110040.849318-2-jordyzomer@google.com Reviewed-by: Phillip Potter Link: https://lore.kernel.org/all/ZI1+1OG9Ut1MqsUC@equinox Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20230617113828.1230-2-phil@philpotter.co.uk Signed-off-by: Jens Axboe commit 8241fdd3cdfe88e31a3de09a72b5bff661e4534a Author: Gao Xiang Date: Thu Jun 15 14:44:21 2023 +0800 erofs: clean up zmap.c Several trivial cleanups which aren't quite necessary to split: - Rename lcluster load functions as well as justify full indexes since they are typically used for global deduplication for compressed data; - Avoid unnecessary lines, comments for simplicity. No logic changes. Reviewed-by: Guo Xuenan Reviewed-by: Yue Hu Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20230615064421.103178-1-hsiangkao@linux.alibaba.com commit 1990595547976baa922285b999612cc3549874d6 Author: Yangtao Li Date: Thu Jun 15 11:45:38 2023 +0800 erofs: remove unnecessary goto It's redundant, let's remove it. Signed-off-by: Yangtao Li Reviewed-by: Gao Xiang Reviewed-by: Jingbo Xu Link: https://lore.kernel.org/r/20230615034539.14286-1-frank.li@vivo.com Signed-off-by: Gao Xiang commit 12d0a24afd9ea58e581ea64d64e066f2027b28d9 Author: Sandeep Dhavale Date: Wed Jun 21 15:08:47 2023 -0700 erofs: Fix detection of atomic context Current check for atomic context is not sufficient as z_erofs_decompressqueue_endio can be called under rcu lock from blk_mq_flush_plug_list(). See the stacktrace [1] In such case we should hand off the decompression work for async processing rather than trying to do sync decompression in current context. Patch fixes the detection by checking for rcu_read_lock_any_held() and while at it use more appropriate !in_task() check than in_atomic(). Background: Historically erofs would always schedule a kworker for decompression which would incur the scheduling cost regardless of the context. But z_erofs_decompressqueue_endio() may not always be in atomic context and we could actually benefit from doing the decompression in z_erofs_decompressqueue_endio() if we are in thread context, for example when running with dm-verity. This optimization was later added in patch [2] which has shown improvement in performance benchmarks. ============================================== [1] Problem stacktrace [name:core&]BUG: sleeping function called from invalid context at kernel/locking/mutex.c:291 [name:core&]in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 1615, name: CpuMonitorServi [name:core&]preempt_count: 0, expected: 0 [name:core&]RCU nest depth: 1, expected: 0 CPU: 7 PID: 1615 Comm: CpuMonitorServi Tainted: G S W OE 6.1.25-android14-5-maybe-dirty-mainline #1 Hardware name: MT6897 (DT) Call trace: dump_backtrace+0x108/0x15c show_stack+0x20/0x30 dump_stack_lvl+0x6c/0x8c dump_stack+0x20/0x48 __might_resched+0x1fc/0x308 __might_sleep+0x50/0x88 mutex_lock+0x2c/0x110 z_erofs_decompress_queue+0x11c/0xc10 z_erofs_decompress_kickoff+0x110/0x1a4 z_erofs_decompressqueue_endio+0x154/0x180 bio_endio+0x1b0/0x1d8 __dm_io_complete+0x22c/0x280 clone_endio+0xe4/0x280 bio_endio+0x1b0/0x1d8 blk_update_request+0x138/0x3a4 blk_mq_plug_issue_direct+0xd4/0x19c blk_mq_flush_plug_list+0x2b0/0x354 __blk_flush_plug+0x110/0x160 blk_finish_plug+0x30/0x4c read_pages+0x2fc/0x370 page_cache_ra_unbounded+0xa4/0x23c page_cache_ra_order+0x290/0x320 do_sync_mmap_readahead+0x108/0x2c0 filemap_fault+0x19c/0x52c __do_fault+0xc4/0x114 handle_mm_fault+0x5b4/0x1168 do_page_fault+0x338/0x4b4 do_translation_fault+0x40/0x60 do_mem_abort+0x60/0xc8 el0_da+0x4c/0xe0 el0t_64_sync_handler+0xd4/0xfc el0t_64_sync+0x1a0/0x1a4 [2] Link: https://lore.kernel.org/all/20210317035448.13921-1-huangjianan@oppo.com/ Reported-by: Will Shiu Suggested-by: Gao Xiang Signed-off-by: Sandeep Dhavale Reviewed-by: Gao Xiang Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230621220848.3379029-1-dhavale@google.com Signed-off-by: Gao Xiang commit ad3d770b83afffd10abf624ec80c408254343a20 Author: Niklas Schnelle Date: Fri Jun 2 16:09:27 2023 +0200 s390/defconfigs: set CONFIG_NET_TC_SKB_EXT=y As made explicit by commit 03a283cdc8c8 ("net/mlx5: Kconfig: Make tc offload depend on tc skb extension") tc skb extension is required for offloading tc as well as bridges on switchdev capable ConnectX devices. Signed-off-by: Niklas Schnelle Signed-off-by: Alexander Gordeev commit 98703e4e061fb8715c7613cd227e32cdfd136b23 Author: Adrián Larumbe Date: Thu Jun 1 13:31:53 2023 +0100 drm: bridge: dw_hdmi: fix connector access for scdc Commit 5d844091f237 ("drm/scdc-helper: Pimp SCDC debugs") changed the scdc interface to pick up an i2c adapter from a connector instead. However, in the case of dw-hdmi, the wrong connector was being used to pass i2c adapter information, since dw-hdmi's embedded connector structure is only populated when the bridge attachment callback explicitly asks for it. drm-meson is handling connector creation, so this won't happen, leading to a NULL pointer dereference. Fix it by having scdc functions access dw-hdmi's current connector pointer instead, which is assigned during the bridge enablement stage. Fixes: 5d844091f237 ("drm/scdc-helper: Pimp SCDC debugs") Signed-off-by: Adrián Larumbe Reported-by: Lukas F. Hartmann Acked-by: Neil Armstrong [narmstrong: moved Fixes tag before first S-o-b and added Reported-by tag] Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230601123153.196867-1-adrian.larumbe@collabora.com commit 9b9cf3c77e7e090b30657b3d2c288deb58dfb4f2 Author: Thomas Richter Date: Thu Jun 15 13:31:58 2023 +0200 s390/cpum_cf: rework PER_CPU_DEFINE of struct cpu_cf_events Struct cpu_cf_events is a large data structure and is statically defined for each possible CPU. Rework this and replace it by dynamically allocated data structures created when a perf_event_open() system call is invoked or an access via character device /dev/hwctr takes place. It is replaced by an array of pointers to all possible CPUs and reference counting. The array of pointers is allocated when the first event is created. For each online CPU an event is installed on, a struct cpu_cf_events is allocated and a pointer to struct cpu_cf_events is stored in the array: CPU 0 1 2 3 ... N +---+---+---+---+---+---+ cpu_cf_root::cpucf--> | * | | | |...| | +-|-+---+---+---+---+---+ | | \|/ +-------------+ |cpu_cf_events| | | +-------------+ With this approach the large data structure is only allocated when an event is actually installed and used. Also implement proper reference counting for allocation and removal. During interrupt processing make sure the pointer to cpu_cf_events is valid. The interrupt handler is shared and might be called when no event is active. This requires checking for a valid pointer to struct cpu_cf_events. When the pointer to the per-cpu cpu_cf_events is NULL, simply return. Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 8ed7e33a685a679c04cfe5ffdbb3b4c396ac8076 Author: Masahiro Yamada Date: Mon Jun 12 00:51:00 2023 +0900 linux/export.h: rename 'sec' argument to 'license' Now, EXPORT_SYMBOL() is populated in two stages. In the first stage, all of EXPORT_SYMBOL/EXPORT_SYMBOL_GPL go into the same section, '.export_symbol'. 'sec' does not make sense any more. Rename it to 'license'. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit f234627898d7644998e28938390fa3d63efeefb7 Author: Masahiro Yamada Date: Mon Jun 12 00:50:59 2023 +0900 modpost: show offset from symbol for section mismatch warnings Currently, modpost only shows the symbol names and section names, so it repeats the same message if there are multiple relocations in the same symbol. It is common the relocation spans across multiple instructions. It is better to show the offset from the symbol. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 78dac1a22944910ba5c1475c384309d30c99afaa Author: Masahiro Yamada Date: Mon Jun 12 00:50:58 2023 +0900 modpost: merge two similar section mismatch warnings In case of section mismatch, modpost shows slightly different messages. For extable section mismatch: "%s(%s+0x%lx): Section mismatch in reference to the %s:%s\n" For the other cases: "%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n" They are similar. Merge them. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 5e9e95cc9148b82074a5eae283e63bce3f1aacfe Author: Masahiro Yamada Date: Mon Jun 12 00:50:57 2023 +0900 kbuild: implement CONFIG_TRIM_UNUSED_KSYMS without recursion When CONFIG_TRIM_UNUSED_KSYMS is enabled, Kbuild recursively traverses the directory tree to determine which EXPORT_SYMBOL to trim. If an EXPORT_SYMBOL turns out to be unused by anyone, Kbuild begins the second traverse, where some source files are recompiled with their EXPORT_SYMBOL() tuned into a no-op. Linus stated negative opinions about this slowness in commits: - 5cf0fd591f2e ("Kbuild: disable TRIM_UNUSED_KSYMS option") - a555bdd0c58c ("Kbuild: enable TRIM_UNUSED_KSYMS again, with some guarding") We can do this better now. The final data structures of EXPORT_SYMBOL are generated by the modpost stage, so modpost can selectively emit KSYMTAB entries that are really used by modules. Commit f73edc8951b2 ("kbuild: unify two modpost invocations") is another ground-work to do this in a one-pass algorithm. With the list of modules, modpost sets sym->used if it is used by a module. modpost emits KSYMTAB only for symbols with sym->used==true. BTW, Nicolas explained why the trimming was implemented with recursion: https://lore.kernel.org/all/2o2rpn97-79nq-p7s2-nq5-8p83391473r@syhkavp.arg/ Actually, we never achieved that level of optimization where the chain reaction of trimming comes into play because: - CONFIG_LTO_CLANG cannot remove any unused symbols - CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is enabled only for vmlinux, but not modules If deeper trimming is required, we need to revisit this, but I guess that is unlikely to happen. Signed-off-by: Masahiro Yamada commit 700c48b439921b67715e25380e0f67e6e490d7b8 Author: Masahiro Yamada Date: Mon Jun 12 00:50:56 2023 +0900 modpost: use null string instead of NULL pointer for default namespace The default namespace is the null string, "". When set, the null string "" is converted to NULL: s->namespace = namespace[0] ? NOFAIL(strdup(namespace)) : NULL; When printed, the NULL pointer is get back to the null string: sym->namespace ?: "" This saves 1 byte memory allocated for "", but loses the readability. In kernel-space, we strive to save memory, but modpost is a userspace tool used to build the kernel. On modern systems, such small piece of memory is not a big deal. Handle the namespace string as is. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 6e7611c485315a0e4e36c763d0810677e1f26ecd Author: Masahiro Yamada Date: Mon Jun 12 00:50:55 2023 +0900 modpost: squash sym_update_namespace() into sym_add_exported() Pass a set of the name, license, and namespace to sym_add_exported(). sym_update_namespace() is unneeded. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 6d62b1c46b1e6e1686a0cf6617c96c80d4ab5cd5 Author: Masahiro Yamada Date: Mon Jun 12 00:50:54 2023 +0900 modpost: check static EXPORT_SYMBOL* by modpost again Commit 31cb50b5590f ("kbuild: check static EXPORT_SYMBOL* by script instead of modpost") moved the static EXPORT_SYMBOL* check from the mostpost to a shell script because I thought it must be checked per compilation unit to avoid false negatives. I came up with an idea to do this in modpost, against combined ELF files. The relocation entries in ELF will find the correct exported symbol even if there exist symbols with the same name in different compilation units. Again, the same sample code. Makefile: obj-y += foo1.o foo2.o foo1.c: #include static void foo(void) {} EXPORT_SYMBOL(foo); foo2.c: void foo(void) {} Then, modpost can catch it correctly. MODPOST Module.symvers ERROR: modpost: vmlinux: local symbol 'foo' was exported Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 7d59313f19df0b55db6b31c5e4d4e828aa77d584 Author: Masahiro Yamada Date: Mon Jun 12 00:50:53 2023 +0900 ia64,export.h: replace EXPORT_DATA_SYMBOL* with EXPORT_SYMBOL* With the previous refactoring, you can always use EXPORT_SYMBOL*. Replace two instances in ia64, then remove EXPORT_DATA_SYMBOL*. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit ddb5cdbafaaad6b99d7007ae1740403124502d03 Author: Masahiro Yamada Date: Mon Jun 12 00:50:52 2023 +0900 kbuild: generate KSYMTAB entries by modpost Commit 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS") made modpost output CRCs in the same way whether the EXPORT_SYMBOL() is placed in *.c or *.S. For further cleanups, this commit applies a similar approach to the entire data structure of EXPORT_SYMBOL(). The EXPORT_SYMBOL() compilation is split into two stages. When a source file is compiled, EXPORT_SYMBOL() will be converted into a dummy symbol in the .export_symbol section. For example, EXPORT_SYMBOL(foo); EXPORT_SYMBOL_NS_GPL(bar, BAR_NAMESPACE); will be encoded into the following assembly code: .section ".export_symbol","a" __export_symbol_foo: .asciz "" /* license */ .asciz "" /* name space */ .balign 8 .quad foo /* symbol reference */ .previous .section ".export_symbol","a" __export_symbol_bar: .asciz "GPL" /* license */ .asciz "BAR_NAMESPACE" /* name space */ .balign 8 .quad bar /* symbol reference */ .previous They are mere markers to tell modpost the name, license, and namespace of the symbols. They will be dropped from the final vmlinux and modules because the *(.export_symbol) will go into /DISCARD/ in the linker script. Then, modpost extracts all the information about EXPORT_SYMBOL() from the .export_symbol section, and generates the final C code: KSYMTAB_FUNC(foo, "", ""); KSYMTAB_FUNC(bar, "_gpl", "BAR_NAMESPACE"); KSYMTAB_FUNC() (or KSYMTAB_DATA() if it is data) is expanded to struct kernel_symbol that will be linked to the vmlinux or a module. With this change, EXPORT_SYMBOL() works in the same way for *.c and *.S files, providing the following benefits. [1] Deprecate EXPORT_DATA_SYMBOL() In the old days, EXPORT_SYMBOL() was only available in C files. To export a symbol in *.S, EXPORT_SYMBOL() was placed in a separate *.c file. arch/arm/kernel/armksyms.c is one example written in the classic manner. Commit 22823ab419d8 ("EXPORT_SYMBOL() for asm") removed this limitation. Since then, EXPORT_SYMBOL() can be placed close to the symbol definition in *.S files. It was a nice improvement. However, as that commit mentioned, you need to use EXPORT_DATA_SYMBOL() for data objects on some architectures. In the new approach, modpost checks symbol's type (STT_FUNC or not), and outputs KSYMTAB_FUNC() or KSYMTAB_DATA() accordingly. There are only two users of EXPORT_DATA_SYMBOL: EXPORT_DATA_SYMBOL_GPL(empty_zero_page) (arch/ia64/kernel/head.S) EXPORT_DATA_SYMBOL(ia64_ivt) (arch/ia64/kernel/ivt.S) They are transformed as follows and output into .vmlinux.export.c KSYMTAB_DATA(empty_zero_page, "_gpl", ""); KSYMTAB_DATA(ia64_ivt, "", ""); The other EXPORT_SYMBOL users in ia64 assembly are output as KSYMTAB_FUNC(). EXPORT_DATA_SYMBOL() is now deprecated. [2] merge and There are two similar header implementations: include/linux/export.h for .c files include/asm-generic/export.h for .S files Ideally, the functionality should be consistent between them, but they tend to diverge. Commit 8651ec01daed ("module: add support for symbol namespaces.") did not support the namespace for *.S files. This commit shifts the essential implementation part to C, which supports EXPORT_SYMBOL_NS() for *.S files. and will remain as a wrapper of for a while. They will be removed after #include directives are all replaced with #include . [3] Implement CONFIG_TRIM_UNUSED_KSYMS in one-pass algorithm (by a later commit) When CONFIG_TRIM_UNUSED_KSYMS is enabled, Kbuild recursively traverses the directory tree to determine which EXPORT_SYMBOL to trim. If an EXPORT_SYMBOL turns out to be unused by anyone, Kbuild begins the second traverse, where some source files are recompiled with their EXPORT_SYMBOL() tuned into a no-op. We can do this better now; modpost can selectively emit KSYMTAB entries that are really used by modules. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit ffa5f7a3bf28c1306eef85d4056539c2d4b8eb09 Author: Davide Tronchin Date: Thu Jun 22 11:29:21 2023 +0200 USB: serial: option: add LARA-R6 01B PIDs The new LARA-R6 product variant identified by the "01B" string can be configured (by AT interface) in three different USB modes: * Default mode (Vendor ID: 0x1546 Product ID: 0x1311) with 4 serial interfaces * RmNet mode (Vendor ID: 0x1546 Product ID: 0x1312) with 4 serial interfaces and 1 RmNet virtual network interface * CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1313) with 4 serial interface and 1 CDC-ECM virtual network interface The first 4 interfaces of all the 3 USB configurations (default, RmNet, CDC-ECM) are the same. In default mode LARA-R6 01B exposes the following interfaces: If 0: Diagnostic If 1: AT parser If 2: AT parser If 3: AT parser/alternative functions In RmNet mode LARA-R6 01B exposes the following interfaces: If 0: Diagnostic If 1: AT parser If 2: AT parser If 3: AT parser/alternative functions If 4: RMNET interface In CDC-ECM mode LARA-R6 01B exposes the following interfaces: If 0: Diagnostic If 1: AT parser If 2: AT parser If 3: AT parser/alternative functions If 4: CDC-ECM interface Signed-off-by: Davide Tronchin Link: https://lore.kernel.org/r/20230622092921.12651-1-davide.tronchin.94@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit e30cb0599799aac099209e3b045379613c80730e Author: Boris Brezillon Date: Mon Jun 19 09:19:21 2023 +0200 drm/sched: Make sure we wait for all dependencies in kill_jobs_cb() drm_sched_entity_kill_jobs_cb() logic is omitting the last fence popped from the dependency array that was waited upon before drm_sched_entity_kill() was called (drm_sched_entity::dependency field), so we're basically waiting for all dependencies except one. In theory, this wait shouldn't be needed because resources should have their users registered to the dma_resv object, thus guaranteeing that future jobs wanting to access these resources wait on all the previous users (depending on the access type, of course). But we want to keep these explicit waits in the kill entity path just in case. Let's make sure we keep all dependencies in the array in drm_sched_job_dependency(), so we can iterate over the array and wait in drm_sched_entity_kill_jobs_cb(). We also make sure we wait on drm_sched_fence::finished if we were originally asked to wait on drm_sched_fence::scheduled. In that case, we assume the intent was to delegate the wait to the firmware/GPU or rely on the pipelining done at the entity/scheduler level, but when killing jobs, we really want to wait for completion not just scheduling. v2: - Don't evict deps in drm_sched_job_dependency() v3: - Always wait for drm_sched_fence::finished fences in drm_sched_entity_kill_jobs_cb() when we see a sched_fence v4: - Fix commit message - Fix a use-after-free bug v5: - Flag deps on which we should only wait for the scheduled event at insertion time v6: - Back to v4 implementation - Add Christian's R-b Cc: Frank Binns Cc: Sarah Walker Cc: Donald Robson Cc: Luben Tuikov Cc: David Airlie Cc: Daniel Vetter Cc: Sumit Semwal Cc: "Christian König" Signed-off-by: Boris Brezillon Suggested-by: "Christian König" Reviewed-by: "Christian König" Acked-by: Luben Tuikov Link: https://patchwork.freedesktop.org/patch/msgid/20230619071921.3465992-1-boris.brezillon@collabora.com commit ee77f3d602b0116203151fee372817c194970213 Author: Yonghong Song Date: Wed Jun 21 23:19:21 2023 -0700 selftests/bpf: Fix compilation failure for prog vrf_socket_lookup When building the latest kernel/selftest with clang17 compiler: make LLVM=1 -j <== for kernel make -C tools/testing/selftests/bpf LLVM=1 -j <== for selftest I hit the following compilation error: [...] In file included from progs/vrf_socket_lookup.c:3: In file included from /usr/include/linux/ip.h:21: In file included from /usr/include/asm/byteorder.h:5: In file included from /usr/include/linux/byteorder/little_endian.h:13: /usr/include/linux/swab.h:136:8: error: unknown type name '__always_inline' 136 | static __always_inline unsigned long __swab(const unsigned long y) | ^ /usr/include/linux/swab.h:171:8: error: unknown type name '__always_inline' 171 | static __always_inline __u16 __swab16p(const __u16 *p) | ^ /usr/include/linux/swab.h:171:29: error: expected ';' after top level declarator 171 | static __always_inline __u16 __swab16p(const __u16 *p) | ^ [...] Basically, with header files in my local host which is based on 5.12 kernel, __always_inline is not defined and this caused compilation failure. Since __always_inline is defined in bpf_helpers.h, let us move bpf_helpers.h to an early position which fixed the problem. Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230622061921.816772-1-yhs@fb.com commit 06b5d4fea89cd699408af12c14b6915d77ceffb0 Author: Oleksij Rempel Date: Wed Jun 21 11:32:41 2023 +0200 dt-bindings: mmc: fsl-imx-esdhc: Add imx6ul support Add the 'fsl,imx6ul-usdhc' value to the compatible properties list in the fsl-imx-esdhc.yaml file. This is required to match the compatible strings present in the 'mmc@2190000' node of 'imx6ul-prti6g.dtb'. This commit addresses the following dtbs_check warning: imx6ul-prti6g.dtb:0:0: /soc/bus@2100000/mmc@2190000: failed to match any schema with compatible: ['fsl,imx6ul-usdhc', 'fsl,imx6sx-usdhc'] Signed-off-by: Oleksij Rempel Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230621093245.78130-2-o.rempel@pengutronix.de Signed-off-by: Ulf Hansson commit b1a665932dc23cad0b8af2745cd9713f9e930d63 Author: Ulf Hansson Date: Tue Jun 20 11:11:13 2023 +0200 mmc: mmci: Add support for SW busy-end timeouts The ux500 variant doesn't have a HW based timeout to use for busy-end IRQs. To avoid hanging and waiting for the card to stop signaling busy, let's schedule a delayed work, according to the corresponding cmd->busy_timeout for the command. If the work gets to run, let's kick the IRQ handler to complete the currently running request/command. Reviewed-by: Linus Walleij Tested-by: Linus Walleij Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20230620091113.33393-1-ulf.hansson@linaro.org commit e38910c0072b541a91954682c8b074a93e57c09b Author: Oliver Hartkopp Date: Wed Jun 7 09:27:08 2023 +0200 can: isotp: isotp_sendmsg(): fix return error fix on TX path With commit d674a8f123b4 ("can: isotp: isotp_sendmsg(): fix return error on FC timeout on TX path") the missing correct return value in the case of a protocol error was introduced. But the way the error value has been read and sent to the user space does not follow the common scheme to clear the error after reading which is provided by the sock_error() function. This leads to an error report at the following write() attempt although everything should be working. Fixes: d674a8f123b4 ("can: isotp: isotp_sendmsg(): fix return error on FC timeout on TX path") Reported-by: Carsten Schmidt Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20230607072708.38809-1-socketcan@hartkopp.net Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde commit 46448b36ff8c807194d5884a6efce00891e4bd02 Author: Arnd Bergmann Date: Thu Jun 22 10:14:02 2023 +0200 ARM: mvebu: fix unit address on armada-390-db flash The unit address needs to be changed to match the reg property: arch/arm/boot/dts/marvell/armada-390-db.dts:84.10-106.4: Warning (spi_bus_reg): /soc/spi@10680/flash@1: SPI bus unit address format error, expected "0" Reported-by: Stephen Rothwell Reviewed-by: Krzysztof Kozlowski Signed-off-by: Arnd Bergmann commit ccaa4926c2264ca2a2fcad4b3511fe435d7d4d15 Author: Ben Dooks Date: Wed Jun 21 08:59:28 2023 +0100 hrtimer: Add missing sparse annotations to hrtimer locking Sparse warns about lock imbalance vs. the hrtimer_base lock due to missing sparse annotations: kernel/time/hrtimer.c:175:33: warning: context imbalance in 'lock_hrtimer_base' - wrong count at exit kernel/time/hrtimer.c:1301:28: warning: context imbalance in 'hrtimer_start_range_ns' - unexpected unlock kernel/time/hrtimer.c:1336:28: warning: context imbalance in 'hrtimer_try_to_cancel' - unexpected unlock kernel/time/hrtimer.c:1457:9: warning: context imbalance in '__hrtimer_get_remaining' - unexpected unlock Add the annotations to the relevant functions. Signed-off-by: Ben Dooks Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230621075928.394481-1-ben.dooks@codethink.co.uk commit 2c56a751845ddfd3078ebe79981aaaa182629163 Author: Fabio Estevam Date: Tue Jun 20 08:22:02 2023 -0300 drm/panel: simple: Add connector_type for innolux_at043tn24 The innolux at043tn24 display is a parallel LCD. Pass the 'connector_type' information to avoid the following warning: panel-simple panel: Specify missing connector_type Signed-off-by: Fabio Estevam Fixes: 41bcceb4de9c ("drm/panel: simple: Add support for Innolux AT043TN24") Reviewed-by: Sam Ravnborg Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230620112202.654981-1-festevam@gmail.com commit a454850a815e62fa5d7c1eded0e8d56742613b94 Author: Rob Herring Date: Wed Jun 21 17:09:58 2023 -0600 dt-bindings: phy: brcm,brcmstb-usb-phy: Fix error in "compatible" conditional schema The conditional if/then schema has an error as the "enum" values have "const" in them. Drop the "const". Signed-off-by: Rob Herring Fixes: 46b616c1574d ("dt-bindings: phy: brcm, brcmstb-usb-phy: add BCM4908 binding") Acked-by: Rafał Miłecki Message-ID: <20230621230958.3815818-1-robh@kernel.org> Signed-off-by: Vinod Koul commit 03bd158e1535e68bcd2b1e095b0ebcad7c84bd20 Author: Arnd Bergmann Date: Fri Jun 9 12:45:42 2023 +0200 remoteproc: stm32: use correct format strings on 64-bit With CONFIG_ARCH_STM32 making it into arch/arm64, a couple of format strings no longer work, since they rely on size_t being compatible with %x, or they print an 'int' using %z: drivers/remoteproc/stm32_rproc.c: In function 'stm32_rproc_mem_alloc': drivers/remoteproc/stm32_rproc.c:122:22: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=] drivers/remoteproc/stm32_rproc.c:122:40: note: format string is defined here 122 | dev_dbg(dev, "map memory: %pa+%x\n", &mem->dma, mem->len); | ~^ | | | unsigned int | %lx drivers/remoteproc/stm32_rproc.c:125:30: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=] drivers/remoteproc/stm32_rproc.c:125:65: note: format string is defined here 125 | dev_err(dev, "Unable to map memory region: %pa+%x\n", | ~^ | | | unsigned int | %lx drivers/remoteproc/stm32_rproc.c: In function 'stm32_rproc_get_loaded_rsc_table': drivers/remoteproc/stm32_rproc.c:646:30: error: format '%zx' expects argument of type 'size_t', but argument 4 has type 'int' [-Werror=format=] drivers/remoteproc/stm32_rproc.c:646:66: note: format string is defined here 646 | dev_err(dev, "Unable to map memory region: %pa+%zx\n", | ~~^ | | | long unsigned int | %x Fix up all three instances to work across architectures, and enable compile testing for this driver to ensure it builds everywhere. Reviewed-by: Arnaud Pouliquen Acked-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Arnd Bergmann commit 790ef3901f18be794f5b246f990f305bbd08ffd7 Merge: 735d86a8aaf66 6fdcd64ec34dc Author: Marc Kleine-Budde Date: Thu Jun 22 09:53:03 2023 +0200 Merge patch series "can: kvaser_pciefd: Fixes and improvements" Jimmy Assarsson says: This patch series contains various non critical fixes and improvements for the kvaser_pciefd driver. Link: https://lore.kernel.org/all/20230529134248.752036-1-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 6fdcd64ec34dc896335718299c348de99b29a605 Author: Jimmy Assarsson Date: Mon May 29 15:42:48 2023 +0200 can: kvaser_pciefd: Use TX FIFO size read from CAN controller Use the TX FIFO size read from CAN controller register, instead of using hard coded value. Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-15-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit f4845741e4220eecf96aa157cbb5ba34aaed995e Author: Jimmy Assarsson Date: Mon May 29 15:42:47 2023 +0200 can: kvaser_pciefd: Refactor code Refactor code; - Format code - Rename variables and macros - Remove intermediate variables - Add/remove blank lines - Reduce scope of variables - Add helper functions Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-14-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit f07008a213640ba5389d924ad0e9e08ea3beed4a Author: Jimmy Assarsson Date: Mon May 29 15:42:46 2023 +0200 can: kvaser_pciefd: Add len8_dlc support Add support for the Classical CAN raw DLC functionality to send and receive DLC values from 9 .. 15. Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-13-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 954fb21268dd59a911dd0b493249eabfa03d0567 Author: Jimmy Assarsson Date: Mon May 29 15:42:45 2023 +0200 can: kvaser_pciefd: Use FIELD_{GET,PREP} and GENMASK where appropriate Replace opencoded masking and shifting, with GENMASK, FIELD_GET and FIELD_PREP macros. Suggested-by: Vincent MAILHOL Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-12-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 69335013c4511cf99d3e338d369ccb37d30d6fee Author: Jimmy Assarsson Date: Mon May 29 15:42:44 2023 +0200 can: kvaser_pciefd: Sort register definitions Sort the registers defines, in the same order as the register bits/fields are defined. Sort register bits/fields in MSB-to-LSB order. Update and add comments. Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-11-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 24aecf55370103cc2d1e3cbb1b8fffcb00482b74 Author: Jimmy Assarsson Date: Mon May 29 15:42:43 2023 +0200 can: kvaser_pciefd: Change return type for kvaser_pciefd_{receive,transmit,set_tx}_irq() Change return type to void for kvaser_pciefd_transmit_irq(), kvaser_pciefd_receive_irq() and kvaser_pciefd_set_tx_irq(). These functions always return zero. Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-10-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 488c07b441f95e0d0d8df0ede4c67319f0f35787 Author: Jimmy Assarsson Date: Mon May 29 15:42:42 2023 +0200 can: kvaser_pciefd: Rename device ID defines Rename device ID defines to better match the product name of the supported device. Use 16 bit hexadecimal values for device IDs. And format kvaser_pciefd_id_table using clang-format. Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-9-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 1b83d0ba1c11d51342d390db19d8e53128a80b40 Author: Jimmy Assarsson Date: Mon May 29 15:42:41 2023 +0200 can: kvaser_pciefd: Sort includes in alphabetic order Sort the includes in alphabetic order. Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-8-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit c496adafee686246fdc803183c2506043f99b3af Author: Jimmy Assarsson Date: Mon May 29 15:42:40 2023 +0200 can: kvaser_pciefd: Remove SPI flash parameter read functionality Remove SPI flash parameter read functionality, since it's only used for reading the interface CAN controller count. This information is already read from a register, making the information redundant. Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-7-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 735d86a8aaf660e2a5fd5d711ee05fa817e8d567 Author: Oliver Hartkopp Date: Fri Jun 9 14:10:51 2023 +0200 can: uapi: move CAN_RAW_FILTER_MAX definition to raw.h CAN_RAW_FILTER_MAX is only relevant for CAN_RAW sockets and used in linux/can/raw.c or in userspace applications that include the raw.h file anyway. Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20230609121051.9631-1-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde commit 2c470dbbd32ff7f864e77397269cbb7dc453cfa2 Author: Jimmy Assarsson Date: Mon May 29 15:42:39 2023 +0200 can: kvaser_pciefd: Define unsigned constants with type suffix 'U' Define unsigned constants with type suffix 'U' Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-6-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit ec681b91befa982477e24a150dd6452427fe6473 Author: Jimmy Assarsson Date: Mon May 29 15:42:38 2023 +0200 can: kvaser_pciefd: Set hardware timestamp on transmitted packets Set hardware timestamp on transmitted packets. Fixes: 26ad340e582d ("can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices") Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-5-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 2d55e9f9b4427e1ad59b974f2267767aac3788d3 Author: Jimmy Assarsson Date: Mon May 29 15:42:37 2023 +0200 can: kvaser_pciefd: Add function to set skb hwtstamps Add new function, kvaser_pciefd_set_skb_timestamp(), to set skb hwtstamps. Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-4-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 76c66ddf7f899b6a9cbd9098990b90f77a8bea9c Author: Jimmy Assarsson Date: Mon May 29 15:42:36 2023 +0200 can: kvaser_pciefd: Remove handler for unused KVASER_PCIEFD_PACK_TYPE_EFRAME_ACK The Kvaser KCAN controller got a feature to send error frames on request. The packet KVASER_PCIEFD_PACK_TYPE_EFRAME_ACK signals that the requested error frame was transmitted. Since this feature is not supported by the driver, drop the handler and add KVASER_PCIEFD_PACK_TYPE_EFRAME_ACK to the list of unexpected packet types. Fixes: 26ad340e582d ("can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices") Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-3-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 7c921556c04f1907e68e57610f315d8873320ad7 Author: Jimmy Assarsson Date: Mon May 29 15:42:35 2023 +0200 can: kvaser_pciefd: Remove useless write to interrupt register The PCI interrupt register, KVASER_PCIEFD_IRQ_REG, is level triggered. Writing to the register doesn't affect it. Fixes: 26ad340e582d ("can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices") Signed-off-by: Jimmy Assarsson Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230529134248.752036-2-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit dc7dabab8c819558998cf2874e1d99c2b3dead6d Merge: 9fde4c557f78e 80a2fbce456e3 Author: Marc Kleine-Budde Date: Thu Jun 22 09:44:22 2023 +0200 Merge patch series "can: length: fix definitions and add bit length calculation" Vincent Mailhol says: When created in [1], frames length definitions were added to implement byte queue limits (bql). Because bql expects lengths in bytes, bit length definitions were not considered back then. Recently, a need to refer to the exact frame length in bits, with CAN bit stuffing, appeared in [2]. This series introduces can_frame_bits(): a function-like macro that can calculate the exact size of a CAN(-FD) frame in bits with or without bitsuffing. [1] commit 85d99c3e2a13 ("can: length: can_skb_get_frame_len(): introduce function to get data length of frame in data link layer") Link: https://git.kernel.org/torvalds/c/85d99c3e2a13 [2] RE: [PATCH] can: mcp251xfd: Increase poll timeout Link: https://lore.kernel.org/linux-can/BL3PR11MB64846C83ACD04E9330B0FE66FB729@BL3PR11MB6484.namprd11.prod.outlook.com * Changelog * v4 -> v5: * In __can_cc_frame_bits() and __can_fd_frame_bits(), enclose data_len in brackets to prevent operator precedence issues. * Add a note in can_frame_bits() documentation to explain that data_len shall have no side effects. * While at it, make CAN(FD)_FRAME_LEN_MAX definition fit on a single line. * A few typo/grammar small fixes in the commit descriptions. Link: https://lore.kernel.org/linux-can/20230601165625.100040-1-mailhol.vincent@wanadoo.fr v3 -> v4: * No functional changes. * as reported by Simon Horman, fix typo in the documentation of can_bitstuffing_len(): "bitstream_len" -> "destuffed_len". * as reported by Thomas Kopp, fix several other typos: - "indicatior" -> "indicator" - "in on the wire" -> "on the wire" - "bitsuffing" -> "bitstuffing". * in CAN_FRAME_LEN_MAX comment: specify that only the dynamic bitstuffing gets ignored but that the intermission is included. * move the Suggested-by: Thomas Kopp tag from patch 2 to patch 3. * add Reviewed-by: Thomas Kopp tag on the full series. * add an additional line of comment for the @intermission argument of can_frame_bits(). Link: https://lore.kernel.org/linux-can/20230530144637.4746-1-mailhol.vincent@wanadoo.fr v2 -> v3: * turn can_frame_bits() and can_frame_bytes() into function-like macros. The fact that inline functions can not be used to initialize constant struct fields was bothering me. I did my best to make the macro look as less ugly as possible. * as reported by Simon Horman, add missing document for the is_fd argument of can_frame_bits(). Link: https://lore.kernel.org/linux-can/20230523065218.51227-1-mailhol.vincent@wanadoo.fr v1 -> v2: * as suggested by Thomas Kopp, add a new patch to the series to fix the stuff bit count and the fixed stuff bits definitions * and another patch to fix documentation of the Remote Request Substitution (RRS). * refactor the length definition. Instead of using individual macro, rely on an inline function. One reason is to minimize the number of definitions. Another reason is that because the dynamic bit stuff is calculated differently for CAN and CAN-FD, it is just not possible to multiply the existing CANFD_FRAME_OVERHEAD_SFF/EFF by the overhead ratio to get the bitsuffing: for CAN-FD, the CRC field is already stuffed by the fixed stuff bits and is out of scope of the dynamic bitstuffing. Link: https://lore.kernel.org/linux-can/20230507155506.3179711-1-mailhol.vincent@wanadoo.fr Link: https://lore.kernel.org/all/20230611025728.450837-1-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde commit 80a2fbce456e3f73b4f49ce12fefa3215a3d0773 Author: Vincent Mailhol Date: Sun Jun 11 11:57:28 2023 +0900 can: length: refactor frame lengths definition to add size in bits Introduce a method to calculate the exact size in bits of a CAN(-FD) frame with or without dynamic bitstuffing. These are all the possible combinations taken into account: - Classical CAN or CAN-FD - Standard or Extended frame format - CAN-FD CRC17 or CRC21 - Include or not intermission Instead of doing several individual macro definitions, declare the can_frame_bits() function-like macro. To this extent, do a full refactoring of the length definitions. In addition add the can_frame_bytes(). This function-like macro replaces the existing macro: - CAN_FRAME_OVERHEAD_SFF: can_frame_bytes(false, false, 0) - CAN_FRAME_OVERHEAD_EFF: can_frame_bytes(false, true, 0) - CANFD_FRAME_OVERHEAD_SFF: can_frame_bytes(true, false, 0) - CANFD_FRAME_OVERHEAD_EFF: can_frame_bytes(true, true, 0) Function-like macros were chosen over inline functions because they can be used to initialize const struct fields. The different maximum frame lengths (maximum data length, including intermission) are as follow: Frame type bits bytes ------------------------------------------------------- Classic CAN SFF no bitstuffing 111 14 Classic CAN EFF no bitstuffing 131 17 Classic CAN SFF bitstuffing 135 17 Classic CAN EFF bitstuffing 160 20 CAN-FD SFF no bitstuffing 579 73 CAN-FD EFF no bitstuffing 598 75 CAN-FD SFF bitstuffing 712 89 CAN-FD EFF bitstuffing 736 92 The macro CAN_FRAME_LEN_MAX and CANFD_FRAME_LEN_MAX are kept as an alias to, respectively, can_frame_bytes(false, true, CAN_MAX_DLEN) and can_frame_bytes(true, true, CANFD_MAX_DLEN). In addition to the above: - Use ISO 11898-1:2015 definitions for the names of the CAN frame fields. - Include linux/bits.h for use of BITS_PER_BYTE. - Include linux/math.h for use of mult_frac() and DIV_ROUND_UP(). N.B: the use of DIV_ROUND_UP() is not new to this patch, but the include was previously omitted. - Add copyright 2023 for myself. Suggested-by: Thomas Kopp Signed-off-by: Vincent Mailhol Reviewed-by: Thomas Kopp Link: https://lore.kernel.org/all/20230611025728.450837-4-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde commit 9fde4c557f78ee2f3626e92b4089ce9d54a2573a Author: Vincent Mailhol Date: Sun Jun 11 11:57:26 2023 +0900 can: length: fix bitstuffing count The Stuff Bit Count is always coded on 4 bits [1]. Update the Stuff Bit Count size accordingly. In addition, the CRC fields of CAN FD Frames contain stuff bits at fixed positions called fixed stuff bits [2]. The CRC field starts with a fixed stuff bit and then has another fixed stuff bit after each fourth bit [2], which allows us to derive this formula: FSB count = 1 + round_down(len(CRC field)/4) The length of the CRC field is [1]: len(CRC field) = len(Stuff Bit Count) + len(CRC) = 4 + len(CRC) with len(CRC) either 17 or 21 bits depending of the payload length. In conclusion, for CRC17: FSB count = 1 + round_down((4 + 17)/4) = 6 and for CRC 21: FSB count = 1 + round_down((4 + 21)/4) = 7 Add a Fixed Stuff bits (FSB) field with above values and update CANFD_FRAME_OVERHEAD_SFF and CANFD_FRAME_OVERHEAD_EFF accordingly. [1] ISO 11898-1:2015 section 10.4.2.6 "CRC field": The CRC field shall contain the CRC sequence followed by a recessive CRC delimiter. For FD Frames, the CRC field shall also contain the stuff count. Stuff count If FD Frames, the stuff count shall be at the beginning of the CRC field. It shall consist of the stuff bit count modulo 8 in a 3-bit gray code followed by a parity bit [...] [2] ISO 11898-1:2015 paragraph 10.5 "Frame coding": In the CRC field of FD Frames, the stuff bits shall be inserted at fixed positions; they are called fixed stuff bits. There shall be a fixed stuff bit before the first bit of the stuff count, even if the last bits of the preceding field are a sequence of five consecutive bits of identical value, there shall be only the fixed stuff bit, there shall not be two consecutive stuff bits. A further fixed stuff bit shall be inserted after each fourth bit of the CRC field [...] Fixes: 85d99c3e2a13 ("can: length: can_skb_get_frame_len(): introduce function to get data length of frame in data link layer") Suggested-by: Thomas Kopp Signed-off-by: Vincent Mailhol Reviewed-by: Thomas Kopp Link: https://lore.kernel.org/all/20230611025728.450837-2-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde commit 10711b11102bfc351240982d46a51d4eecc28c10 Author: Vincent Mailhol Date: Sun Jun 11 11:57:27 2023 +0900 can: length: fix description of the RRS field The CAN-FD frames only have one reserved bit. The bit corresponding to Classical CAN frame's RTR bit is called the "Remote Request Substitution (RRS)" [1]. N.B. The RRS is not to be confused with the Substitute Remote Request (SRR). Fix the description in the CANFD_FRAME_OVERHEAD_SFF/EFF macros. The total remains unchanged, so this is just a documentation fix. In addition to the above add myself as copyright owner for 2020 (as coauthor of the initial version, c.f. Fixes tag). [1] ISO 11898-1:2015 paragraph 10.4.2.3 "Arbitration field": RSS bit [only in FD Frames] The RRS bit shall be transmitted in FD Frames at the position of the RTR bit in Classical Frames. The RRS bit shall be transmitted dominant, but receivers shall accept recessive and dominant RRS bits. Fixes: 85d99c3e2a13 ("can: length: can_skb_get_frame_len(): introduce function to get data length of frame in data link layer") Signed-off-by: Vincent Mailhol Reviewed-by: Thomas Kopp Link: https://lore.kernel.org/all/20230611025728.450837-3-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde commit 9c8d17f931f18482657503291b2737a0f4a79c7e Merge: 3d68f116ccdfe 8a9d8a3c8a05f Author: Marc Kleine-Budde Date: Thu Jun 22 09:43:31 2023 +0200 Merge patch series "can: fix coding style" Marc Kleine-Budde says: here are 2 coding style fixes for rx-offload and the ti_hecc driver. Link: https://lore.kernel.org/all/20230620131130.240180-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 3d68f116ccdfe8cd3a4923b47ae55401fd85d74b Author: Marc Kleine-Budde Date: Tue May 23 08:11:16 2023 +0200 can: m_can: fix coding style This patch aligns code to match open parenthesis and removes a trailing whitespace. Fixes: eb38c2053b67 ("can: rx-offload: rename can_rx_offload_queue_sorted() -> can_rx_offload_queue_timestamp()") Fixes: f5071d9e729d ("can: m_can: m_can_handle_bus_errors(): add support for handling DLEC error on CAN-FD frames") Reported-by: Judith Mendez Link: https://lore.kernel.org/all/20230523062410.1984098-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 8a9d8a3c8a05fdb9d076905855bc0d5b5ee8c881 Author: Marc Kleine-Budde Date: Tue Jun 20 15:11:30 2023 +0200 can: ti_hecc: fix coding style This patch aligns code to match open parenthesis. Link: https://lore.kernel.org/all/20230620131130.240180-3-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit fe6027fe097a173d12067e781143bc1cd2fb1a57 Author: Marc Kleine-Budde Date: Tue Jun 20 15:11:29 2023 +0200 can: rx-offload: fix coding style This patch aligns code to match open parenthesis. Link: https://lore.kernel.org/all/20230620131130.240180-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 047698023267d2655da3ac81f2fb448746b61951 Merge: cf8462a8008a0 717c6ec241b55 Author: Marc Kleine-Budde Date: Thu Jun 22 09:42:17 2023 +0200 Merge patch series "can: sja1000: Prepare the use of a threaded handler" Miquel Raynal provides a series for the sja1000 driver to work around overrun stalls with a soft reset on Renesas SoCs. Link: https://lore.kernel.org/all/20230616134553.2786391-1-miquel.raynal@bootlin.com Signed-off-by: Marc Kleine-Budde commit 717c6ec241b5524400acc0f6009b89e2c59527f9 Author: Miquel Raynal Date: Fri Jun 16 15:45:53 2023 +0200 can: sja1000: Prevent overrun stalls with a soft reset on Renesas SoCs In their RZN1 SoC, Renesas put a CAN controller supposed to act very similarly to the original Philips sja1000. In practice, while flooding the bus with another device, we discovered that the controller very often after an overrun situation would just refuse any new frame, drop them all and trigger over and over again the overrun interrupt, even though the buffer would have been totally emptied. The controller acts like if its internal buffer offsets (where it writes and where the host reads) where totally screwed-up. Renesas manual mentions a single action to perform in order to resynchronize the read and write offsets within the buffer: performing a soft reset. Performing a soft reset takes a bit of time and involves small delays, so better do that in a threaded handler rather than inside the hard IRQ handler. Add platform data to recognize the platforms which need this workaround, and when the faulty situation is diagnosed, stop what is being performed and request the threaded handler to be executed in order to perform the reset. Tested-by: Jérémie Dautheribes # 5.10 Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/all/20230616134553.2786391-2-miquel.raynal@bootlin.com Signed-off-by: Marc Kleine-Budde commit af7647a0b4b50c3f988a76b05dea5e6bf20c858a Author: Miquel Raynal Date: Fri Jun 16 15:45:52 2023 +0200 can: sja1000: Prepare the use of a threaded handler In order to support a flavor of the sja1000 which sometimes freezes, it will be needed upon certain interrupts to perform a soft reset. The soft reset operation takes a bit of time, so better not do it within the hard interrupt handler but rather in a threaded handler. Let's prepare the possibility for sja1000_err() to request "interrupting" the current flow and request the threaded handler to be run while keeping the interrupt line low. There is no functional change. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/all/20230616134553.2786391-1-miquel.raynal@bootlin.com Signed-off-by: Marc Kleine-Budde commit cf8462a8008a0dec9580f939d1b3bd11ab5c3a53 Merge: b74c3abf99804 8a99f2ada0b80 Author: Marc Kleine-Budde Date: Thu Jun 22 09:41:23 2023 +0200 Merge patch series "can: esd_usb: More preparation before supporting esd CAN-USB/3 (addendum)" Frank Jungclaus says: While trying to again merge my code changes for CAN-USB/3, I came across some more places where it could make sense to change them analogous to the previous clean-up patch series [1]. [1] [PATCH v2 0/6] can: esd_usb: More preparation before supporting esd CAN-USB/3 Link: https://lore.kernel.org/all/20230519195600.420644-1-frank.jungclaus@esd.eu Link: https://lore.kernel.org/r/20230523173105.3175086-1-frank.jungclaus@esd.eu Signed-off-by: Marc Kleine-Budde commit 8a99f2ada0b808aaaa3e2f13c15e623c7fe329bd Author: Frank Jungclaus Date: Tue May 23 19:31:05 2023 +0200 can: esd_usb: Use consistent prefix ESD_USB_ for macros Rename the following macros: - ESD_RTR to ESD_USB_RTR - ESD_EV_CAN_ERROR_EXT to ESD_USB_EV_CAN_ERROR_EXT Additionally remove the double newline trailing to definition of ESD_USB_RTR. Signed-off-by: Frank Jungclaus Link: https://lore.kernel.org/r/20230523173105.3175086-3-frank.jungclaus@esd.eu Signed-off-by: Marc Kleine-Budde commit 33665fdbd7ff825f2c7369524f0d985707e9f029 Author: Frank Jungclaus Date: Tue May 23 19:31:04 2023 +0200 can: esd_usb: Make use of kernel macros BIT() and GENMASK() Make use of kernel macros BIT() and GENMASK(). Signed-off-by: Frank Jungclaus Link: https://lore.kernel.org/r/20230523173105.3175086-2-frank.jungclaus@esd.eu Signed-off-by: Marc Kleine-Budde commit b74c3abf99804620c44a7623fd4d89396c87a064 Merge: d7588f02e8d8a 1336ca2d46017 Author: Marc Kleine-Budde Date: Thu Jun 22 09:39:36 2023 +0200 Merge patch series "can: esd_usb: More preparation before supporting esd CAN-USB/3" Frank Jungclaus says: Apply another small batch of patches as preparation for adding support of the newly available esd CAN-USB/3 to esd_usb.c. v1 -> v2: * Make use of GENMASK() macro for ESD_USB_NO_BAUDRATE and ESD_USB_IDMASK * Also use the BIT() macro for ESD_USB2_3_SAMPLES * Removed comments with redundant hexadecimal values from BIT()-constants * Reworded (shortened) the commit messages * Changed the macro ESD_USB_3_SAMPLES to ESD_USB_TRIPLE_SAMPLES v1: * Link: https://lore.kernel.org/all/20230517192251.2405290-1-frank.jungclaus@esd.eu Link: https://lore.kernel.org/r/20230519195600.420644-1-frank.jungclaus@esd.eu Signed-off-by: Marc Kleine-Budde commit 1336ca2d46017d4249a9bd6a9a403d1e86109751 Author: Frank Jungclaus Date: Fri May 19 21:56:00 2023 +0200 can: esd_usb: Don't bother the user with nonessential log message Replace a netdev_info(), emitting an informational message about the BTR value to be send to the controller, with a debug message by means of netdev_dbg(). Link: https://lore.kernel.org/all/20230509-superglue-hazy-38108aa66bfa-mkl@pengutronix.de/ Suggested-by: Marc Kleine-Budde Suggested-by: Vincent MAILHOL Signed-off-by: Frank Jungclaus Link: https://lore.kernel.org/r/20230519195600.420644-7-frank.jungclaus@esd.eu Signed-off-by: Marc Kleine-Budde commit 299a557651d7847c2acb5c43674e2a1c85d38d16 Author: Frank Jungclaus Date: Fri May 19 21:55:59 2023 +0200 can: esd_usb: Replace hardcoded message length given to USB commands Replace all hardcoded values supplied to the len element of esd_usb_msg (and its siblings) by more readable expressions, based on sizeof(), offsetof(), etc. Also spend documentation / comments that the len element of esd_usb_msg is in multiples of 32bit words and not in bytes. Link: https://lore.kernel.org/all/CAMZ6RqLaDNy-fZ2G0+QMhUEckkXLL+ZyELVSDFmqpd++aBzZQg@mail.gmail.com/ Suggested-by: Vincent MAILHOL Signed-off-by: Frank Jungclaus Link: https://lore.kernel.org/r/20230519195600.420644-6-frank.jungclaus@esd.eu Signed-off-by: Marc Kleine-Budde commit 8ef426e1f605cea86f9375ca75b59b3e7afab5f7 Author: Frank Jungclaus Date: Fri May 19 21:55:58 2023 +0200 can: esd_usb: Prefix all structures with the device name Prefix all the structures with the device name. For commonly used structures make use of (the module name) esd_usb_. For esd CAN-USB/2 and CAN-USB/Micro specific structures use esd_usb_2_ and esd_usb_m. Link: https://lore.kernel.org/all/CAMZ6RqLaDNy-fZ2G0+QMhUEckkXLL+ZyELVSDFmqpd++aBzZQg@mail.gmail.com/ Suggested-by: Vincent MAILHOL Signed-off-by: Frank Jungclaus Link: https://lore.kernel.org/r/20230519195600.420644-5-frank.jungclaus@esd.eu Signed-off-by: Marc Kleine-Budde commit 7e6689b34a815bd379dfdbe9855d36f395ef056c Author: Damien Le Moal Date: Tue Apr 18 09:46:58 2023 +0200 PCI: rockchip: Set address alignment for endpoint mode The address translation unit of the rockchip EP controller does not use the lower 8 bits of a PCIe-space address to map local memory. Thus we must set the align feature field to 256 to let the user know about this constraint. Link: https://lore.kernel.org/r/20230418074700.1083505-12-rick.wertenbroek@gmail.com Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Signed-off-by: Damien Le Moal Signed-off-by: Rick Wertenbroek Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org commit a52587e0bee14cbeeadf48a24013828cb04b8df8 Author: Rick Wertenbroek Date: Tue Apr 18 09:46:57 2023 +0200 PCI: rockchip: Don't advertise MSI-X in PCIe capabilities The RK3399 PCIe endpoint controller cannot generate MSI-X IRQs. This is documented in the RK3399 technical reference manual (TRM) section 17.5.9 "Interrupt Support". MSI-X capability should therefore not be advertised. Remove the MSI-X capability by editing the capability linked-list. The previous entry is the MSI capability, therefore get the next entry from the MSI-X capability entry and set it as next entry for the MSI capability. This in effect removes MSI-X from the list. Linked list before : MSI cap -> MSI-X cap -> PCIe Device cap -> ... Linked list now : MSI cap -> PCIe Device cap -> ... Link: https://lore.kernel.org/r/20230418074700.1083505-11-rick.wertenbroek@gmail.com Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Tested-by: Damien Le Moal Signed-off-by: Rick Wertenbroek Signed-off-by: Lorenzo Pieralisi Reviewed-by: Damien Le Moal Cc: stable@vger.kernel.org commit 8962b2cb39119cbda4fc69a1f83957824f102f81 Author: Rick Wertenbroek Date: Tue Apr 18 09:46:56 2023 +0200 PCI: rockchip: Use u32 variable to access 32-bit registers Previously u16 variables were used to access 32-bit registers, this resulted in not all of the data being read from the registers. Also the left shift of more than 16-bits would result in moving data out of the variable. Use u32 variables to access 32-bit registers Link: https://lore.kernel.org/r/20230418074700.1083505-10-rick.wertenbroek@gmail.com Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Tested-by: Damien Le Moal Signed-off-by: Rick Wertenbroek Signed-off-by: Lorenzo Pieralisi Reviewed-by: Damien Le Moal Cc: stable@vger.kernel.org commit dc73ed0f1b8bddd7f2bf70d123e68ffc99ad71ce Author: Rick Wertenbroek Date: Tue Apr 18 09:46:55 2023 +0200 PCI: rockchip: Fix window mapping and address translation for endpoint The RK3399 PCI endpoint core has 33 windows for PCIe space, now in the driver up to 32 fixed size (1M) windows are used and pages are allocated and mapped accordingly. The driver first used a single window and allocated space inside which caused translation issues (between CPU space and PCI space) because a window can only have a single translation at a given time, which if multiple pages are allocated inside will cause conflicts. Now each window is a single region of 1M which will always guarantee that the translation is not in conflict. Set the translation register addresses for physical function. As documented in the technical reference manual (TRM) section 17.5.5 "PCIe Address Translation" and section 17.6.8 "Address Translation Registers Description" Link: https://lore.kernel.org/r/20230418074700.1083505-9-rick.wertenbroek@gmail.com Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Tested-by: Damien Le Moal Signed-off-by: Rick Wertenbroek Signed-off-by: Lorenzo Pieralisi Reviewed-by: Damien Le Moal Cc: stable@vger.kernel.org commit 166e89d99dd85a856343cca51eee781b793801f2 Author: Rick Wertenbroek Date: Tue Apr 18 09:46:54 2023 +0200 PCI: rockchip: Fix legacy IRQ generation for RK3399 PCIe endpoint core Fix legacy IRQ generation for RK3399 PCIe endpoint core according to the technical reference manual (TRM). Assert and deassert legacy interrupt (INTx) through the legacy interrupt control register ("PCIE_CLIENT_LEGACY_INT_CTRL") instead of manually generating a PCIe message. The generation of the legacy interrupt was tested and validated with the PCIe endpoint test driver. Link: https://lore.kernel.org/r/20230418074700.1083505-8-rick.wertenbroek@gmail.com Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Tested-by: Damien Le Moal Signed-off-by: Rick Wertenbroek Signed-off-by: Lorenzo Pieralisi Reviewed-by: Damien Le Moal Cc: stable@vger.kernel.org commit 21a2960d5ea2e70c15256b73fce1a14999071090 Author: Rick Wertenbroek Date: Tue Apr 18 09:46:53 2023 +0200 dt-bindings: PCI: Update the RK3399 example to a valid one Update the example in the documentation to a valid example. Address for mem-base was invalid, it pointed to address 0x8000'0000 which is the upper region of the DDR which is not necessarily populated depending on the board. This address should point to the base of the memory window region of the controller which is 0xfa00'0000. Add missing pinctrl. Link: https://lore.kernel.org/r/20230418074700.1083505-7-rick.wertenbroek@gmail.com Signed-off-by: Rick Wertenbroek Signed-off-by: Lorenzo Pieralisi Acked-by: Krzysztof Kozlowski commit 9dd3c7c4c8c3f7f010d9cdb7c3f42506d93c9527 Author: Rick Wertenbroek Date: Tue Apr 18 09:46:51 2023 +0200 PCI: rockchip: Add poll and timeout to wait for PHY PLLs to be locked The RK3399 PCIe controller should wait until the PHY PLLs are locked. Add poll and timeout to wait for PHY PLLs to be locked. If they cannot be locked generate error message and jump to error handler. Accessing registers in the PHY clock domain when PLLs are not locked causes hang The PHY PLLs status is checked through a side channel register. This is documented in the TRM section 17.5.8.1 "PCIe Initialization Sequence". Link: https://lore.kernel.org/r/20230418074700.1083505-5-rick.wertenbroek@gmail.com Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Tested-by: Damien Le Moal Signed-off-by: Rick Wertenbroek Signed-off-by: Lorenzo Pieralisi Reviewed-by: Damien Le Moal Cc: stable@vger.kernel.org commit f397fd4ac1fa3afcabd8cee030f953ccaed2a364 Author: Rick Wertenbroek Date: Tue Apr 18 09:46:50 2023 +0200 PCI: rockchip: Assert PCI Configuration Enable bit after probe Assert PCI Configuration Enable bit after probe. When this bit is left to 0 in the endpoint mode, the RK3399 PCIe endpoint core will generate configuration request retry status (CRS) messages back to the root complex. Assert this bit after probe to allow the RK3399 PCIe endpoint core to reply to configuration requests from the root complex. This is documented in section 17.5.8.1.2 of the RK3399 TRM. Link: https://lore.kernel.org/r/20230418074700.1083505-4-rick.wertenbroek@gmail.com Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Tested-by: Damien Le Moal Signed-off-by: Rick Wertenbroek Signed-off-by: Lorenzo Pieralisi Reviewed-by: Damien Le Moal Cc: stable@vger.kernel.org commit 1f1c42ece18de365c976a060f3c8eb481b038e3a Author: Rick Wertenbroek Date: Tue Apr 18 09:46:49 2023 +0200 PCI: rockchip: Write PCI Device ID to correct register Write PCI Device ID (DID) to the correct register. The Device ID was not updated through the correct register. Device ID was written to a read-only register and therefore did not work. The Device ID is now set through the correct register. This is documented in the RK3399 TRM section 17.6.6.1.1 Link: https://lore.kernel.org/r/20230418074700.1083505-3-rick.wertenbroek@gmail.com Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Tested-by: Damien Le Moal Signed-off-by: Rick Wertenbroek Signed-off-by: Lorenzo Pieralisi Reviewed-by: Damien Le Moal Cc: stable@vger.kernel.org commit 92a9c57c325dd51682d428ba960d961fec3c8a08 Author: Rick Wertenbroek Date: Tue Apr 18 09:46:48 2023 +0200 PCI: rockchip: Remove writes to unused registers Remove write accesses to registers that are marked "unused" (and therefore read-only) in the technical reference manual (TRM) (see RK3399 TRM 17.6.8.1) Link: https://lore.kernel.org/r/20230418074700.1083505-2-rick.wertenbroek@gmail.com Tested-by: Damien Le Moal Signed-off-by: Rick Wertenbroek Signed-off-by: Lorenzo Pieralisi Reviewed-by: Damien Le Moal commit 9dc3a695da58f69ce580797a2fccea8262faa9cd Author: Frank Jungclaus Date: Fri May 19 21:55:57 2023 +0200 can: esd_usb: Use consistent prefixes for macros Add the consistent prefix ESD_USB_ to all macros defined within esd_usb.c. For macros specific to esd CAN-USB/2 use ESD_USB_2_ as prefix. For macros specific to esd CAN-USB/Micro use ESD_USB_M_ as prefix. Change the macro ESD_USB_3_SAMPLES to ESD_USB_TRIPLE_SAMPLES to not mix up with the prefix ESD_USB_3_ which will be introduced for the CAN-USB/3 device. Link: https://lore.kernel.org/all/CAMZ6RqLaDNy-fZ2G0+QMhUEckkXLL+ZyELVSDFmqpd++aBzZQg@mail.gmail.com/ Suggested-by: Vincent MAILHOL Signed-off-by: Frank Jungclaus Link: https://lore.kernel.org/r/20230519195600.420644-4-frank.jungclaus@esd.eu Signed-off-by: Marc Kleine-Budde commit 5a4dd8796d772252d7f31b547673d03d3a40df75 Author: Frank Jungclaus Date: Fri May 19 21:55:56 2023 +0200 can: esd_usb: Replace initializer macros used for struct can_bittiming_const Replace the macros used to initialize the members of struct can_bittiming_const with direct values. Then also use those struct members to do the calculations in esd_usb2_set_bittiming(). Link: https://lore.kernel.org/all/CAMZ6RqLaDNy-fZ2G0+QMhUEckkXLL+ZyELVSDFmqpd++aBzZQg@mail.gmail.com/ Suggested-by: Vincent MAILHOL Signed-off-by: Frank Jungclaus Link: https://lore.kernel.org/r/20230519195600.420644-3-frank.jungclaus@esd.eu [mkl: esd_usb2_set_bittiming() use esd_usb2_bittiming_const instead of priv->can.bittiming_const] Signed-off-by: Marc Kleine-Budde commit e6ecc0414c87126836d04b46cce8942e778226bb Author: Andy Shevchenko Date: Wed Jun 21 19:31:22 2023 +0300 usb: ulpi: Make container_of() no-op in to_ulpi_dev() Move embedded struct device member to make container_of() noop Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230621163122.5693-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 98e95872f2b818c74872d073eaa4c937579d41fc Merge: 5dfbbaa208f54 528cb5f2a1e85 Author: Jakub Kicinski Date: Wed Jun 21 22:45:59 2023 -0700 Merge branch 'mptcp-expose-more-info-and-small-improvements' Matthieu Baerts says: ==================== mptcp: expose more info and small improvements Patch 1-3/9 track and expose some aggregated data counters at the MPTCP level: the number of retransmissions and the bytes that have been transferred. The first patch prepares the work by moving where snd_una is updated for fallback sockets while the last patch adds some tests to cover the new code. Patch 4-6/9 introduce a new getsockopt for SOL_MPTCP: MPTCP_FULL_INFO. This new socket option allows to combine info from MPTCP_INFO, MPTCP_TCPINFO and MPTCP_SUBFLOW_ADDRS socket options into one. It can be needed to have all info in one because the path-manager can close and re-create subflows between getsockopt() and fooling the accounting. The first patch introduces a unique subflow ID to easily detect when subflows are being re-created with the same 5-tuple while the last patch adds some tests to cover the new code. Please note that patch 5/9 ("mptcp: introduce MPTCP_FULL_INFO getsockopt") can reveal a bug that were there for a bit of time, see [1]. A fix has recently been fixed to netdev for the -net tree: "mptcp: ensure listener is unhashed before updating the sk status", see [2]. There is no conflicts between the two patches but it might be better to apply this series after the one for -net and after having merged "net" into "net-next". Patch 7/9 is similar to commit 47867f0a7e83 ("selftests: mptcp: join: skip check if MIB counter not supported") recently applied in the -net tree but here it adapts the new code that is only in net-next (and it fixes a merge conflict resolution which didn't have any impact). Patch 8 and 9/9 are two simple refactoring. One to consolidate the transition to TCP_CLOSE in mptcp_do_fastclose() and avoid duplicated code. The other one reduces the scope of an argument passed to mptcp_pm_alloc_anno_list() function. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/407 [1] Link: https://lore.kernel.org/netdev/20230620-upstream-net-20230620-misc-fixes-for-v6-4-v1-0-f36aa5eae8b9@tessares.net/ [2] ==================== Link: https://lore.kernel.org/r/20230620-upstream-net-next-20230620-mptcp-expose-more-info-and-misc-v1-0-62b9444bfd48@tessares.net Signed-off-by: Jakub Kicinski commit 528cb5f2a1e859522f36f091f29f5c81ec6d4a4c Author: Geliang Tang Date: Tue Jun 20 18:30:22 2023 +0200 mptcp: pass addr to mptcp_pm_alloc_anno_list Pass addr parameter to mptcp_pm_alloc_anno_list() instead of entry. We can reduce the scope, e.g. in mptcp_pm_alloc_anno_list(), we only access "entry->addr", we can then restrict to the pointer to "addr" then. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Jakub Kicinski commit bbd49d114d5790a2dc3f67926cec3fc48b2d5d81 Author: Paolo Abeni Date: Tue Jun 20 18:30:21 2023 +0200 mptcp: consolidate transition to TCP_CLOSE in mptcp_do_fastclose() The MPTCP code always set the msk state to TCP_CLOSE before calling performing the fast-close. Move such state transition in mptcp_do_fastclose() to avoid some code duplication. Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Jakub Kicinski commit 00079f18c24f373797cc38273c1bc0b475469d2b Author: Matthieu Baerts Date: Tue Jun 20 18:30:20 2023 +0200 selftests: mptcp: join: skip check if MIB counter not supported (part 2) Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the MPTCP MIB counters introduced in commit fc518953bc9c ("mptcp: add and use MIB counter infrastructure") and more later. The MPTCP Join selftest heavily relies on these counters. If a counter is not supported by the kernel, it is not displayed when using 'nstat -z'. We can then detect that and skip the verification. A new helper (get_counter()) has been added recently in the -net tree to do the required checks and return an error if the counter is not available. This commit is similar to the one with the same title applied in the -net tree but it modifies code only present in net-next for the moment, see the Fixes commit below. While at it, we can also remove the use of ${extra_msg} variable which is never assigned in chk_rm_tx_nr() function and use 'echo' without '-n' parameter. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: 0639fa230a21 ("selftests: mptcp: add explicit check for new mibs") Signed-off-by: Matthieu Baerts Signed-off-by: Jakub Kicinski commit aa723d5b3541bfcf9b7493fc1c47e6af6a11b765 Author: Paolo Abeni Date: Tue Jun 20 18:30:19 2023 +0200 selftests: mptcp: add MPTCP_FULL_INFO testcase Add a testcase explicitly triggering the newly introduce MPTCP_FULL_INFO getsockopt. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/388 Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Co-developed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Jakub Kicinski commit 492432074e4fce4f8880213bf009b47adbf94a3a Author: Paolo Abeni Date: Tue Jun 20 18:30:18 2023 +0200 mptcp: introduce MPTCP_FULL_INFO getsockopt Some user-space applications want to monitor the subflows utilization. Dumping the per subflow tcp_info is not enough, as the PM could close and re-create the subflows under-the-hood, fooling the accounting. Even checking the src/dst addresses used by each subflow could not be enough, because new subflows could re-use the same address/port of the just closed one. This patch introduces a new socket option, allow dumping all the relevant information all-at-once (everything, everywhere...), in a consistent manner. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/388 Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Jakub Kicinski commit 6f06b4d4d1cc676a3f9d947f931ec3866b6c4f6c Author: Paolo Abeni Date: Tue Jun 20 18:30:17 2023 +0200 mptcp: add subflow unique id The user-space need to properly account the data received/sent by individual subflows. When additional subflows are created and/or closed during the MPTCP socket lifetime, the information currently exposed via MPTCP_TCPINFO are not enough: subflows are identified only by the sequential position inside the info dumps, and that will change with the above mentioned events. To solve the above problem, this patch introduces a new subflow identifier that is unique inside the given MPTCP socket scope. The initial subflow get the id 1 and the other subflows get incremental values at join time. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/388 Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Jakub Kicinski commit 5dcff89e14555a4ee6cfa132b82f7d13dcb1e80a Author: Paolo Abeni Date: Tue Jun 20 18:30:16 2023 +0200 selftests: mptcp: explicitly tests aggregate counters Update the existing sockopt test-case to do some basic checks on the newly added counters. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/385 Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Jakub Kicinski commit 38967f424b5be79c4c676712e5640d846efd07e3 Author: Paolo Abeni Date: Tue Jun 20 18:30:15 2023 +0200 mptcp: track some aggregate data counters Currently there are no data transfer counters accounting for all the subflows used by a given MPTCP socket. The user-space can compute such figures aggregating the subflow info, but that is inaccurate if any subflow is closed before the MPTCP socket itself. Add the new counters in the MPTCP socket itself and expose them via the existing diag and sockopt. While touching mptcp_diag_fill_info(), acquire the relevant locks before fetching the msk data, to ensure better data consistency Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/385 Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Jakub Kicinski commit c026d33b8f5081969503e322ea30d7c1a6b17dda Author: Paolo Abeni Date: Tue Jun 20 18:30:14 2023 +0200 mptcp: move snd_una update earlier for fallback socket That will avoid an unneeded conditional in both the fast-path and in the fallback case and will simplify a bit the next patch. Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Jakub Kicinski commit 5dfbbaa208f5429a02ccb410ae3515222bbe64ef Author: David Arinzon Date: Tue Jun 20 13:35:44 2023 +0000 net: ena: Fix rst format issues in readme This patch fixes a warning in the ena documentation file identified by the kernel automatic tools. The patch also adds a missing newline between sections. Signed-off-by: David Arinzon Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306171804.U7E92zoE-lkp@intel.com/ Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230620133544.32584-1-darinzon@amazon.com Signed-off-by: Jakub Kicinski commit 1203a63da0461d0081ea6e3d5e52893985bfed42 Author: Weilin Wang Date: Tue Jun 20 10:00:27 2023 -0700 perf test: Rerun failed metrics with longer workload Rerun failed metrics with longer workload to avoid false failure because sometimes metric value test fails when running in very short amount of time. Skip rerun if equal to or more than 20 metrics fail. Signed-off-by: Weilin Wang Tested-by: Namhyung Kim Cc: ravi.bangoria@amd.com Cc: Ian Rogers Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Perry Taylor Cc: Samantha Alt Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Kan Liang Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230620170027.1861012-4-weilin.wang@intel.com Signed-off-by: Namhyung Kim commit a0f1cc18f91faf75a321135ac08385a4f260a87d Author: Weilin Wang Date: Tue Jun 20 10:00:26 2023 -0700 perf test: Add skip list for metrics known would fail Add skip list for metrics known would fail because some of the metrics are very likely to fail due to multiplexing or other errors. So add all of the flaky tests into the skip list. Signed-off-by: Weilin Wang Tested-by: Namhyung Kim Cc: ravi.bangoria@amd.com Cc: Ian Rogers Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Perry Taylor Cc: Samantha Alt Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Kan Liang Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230620170027.1861012-3-weilin.wang@intel.com Signed-off-by: Namhyung Kim commit 3ad7092f5145aab4118f575b57f0ab1707b1cd36 Author: Weilin Wang Date: Tue Jun 20 10:00:25 2023 -0700 perf test: Add metric value validation test Add metric value validation test to check if metric values are with in correct value ranges. There are three types of tests included: 1) positive-value test checks if all the metrics collected are non-negative; 2) single-value test checks if the list of metrics have values in given value ranges; 3) relationship test checks if multiple metrics follow a given relationship, e.g. memory_bandwidth_read + memory_bandwidth_write = memory_bandwidth_total. Signed-off-by: Weilin Wang Tested-by: Namhyung Kim Cc: ravi.bangoria@amd.com Cc: Ian Rogers Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Caleb Biggers Cc: Perry Taylor Cc: Samantha Alt Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Kan Liang Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230620170027.1861012-2-weilin.wang@intel.com Signed-off-by: Namhyung Kim commit e591c47f2c2ab11e2faf853f1646ecb9f0f61a7b Author: Jassi Brar Date: Wed Jun 21 10:36:58 2023 -0500 dt-bindings: arm: socionext: add Synquacer platforms Socionext's DeveloperBox is based on the SC2A11B SoC (Synquacer). Specify bindings for the platform and boards based on that. Signed-off-by: Jassi Brar Link: https://lore.kernel.org/r/20230621153658.60646-1-jaswinder.singh@linaro.org Signed-off-by: Rob Herring commit 876c38eb7b1e3de83ef824d34fd7ac416e350eb0 Author: Fabrice Gasnier Date: Tue Jun 20 10:56:33 2023 +0200 dt-bindings: connector: usb: allow a single HS port Allow a single HS port to be used e.g. without reg property and a unit address. OF graph allows a single port node, without 'reg' property. This removes a couple of Warnings or errors on STM32MP boards. When using single HS port currently, when doing building with W=1: arch/arm/boot/dts/stm32mp157c-dk2.dtb: stusb1600@28: connector: Unevaluated properties are not allowed ('port' was unexpected) Signed-off-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20230620085633.533187-1-fabrice.gasnier@foss.st.com Signed-off-by: Rob Herring commit 6f0a92fd7db1507b203111ee53632eeeba2daca5 Author: Gustavo A. R. Silva Date: Wed Jun 21 14:27:20 2023 -0600 scsi: smartpqi: Replace one-element arrays with flexible-array members One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array members in a couple of structures, and refactor the rest of the code, accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy(). This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/204 Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/ZJNdKDkuRbFZpASS@work Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 4b2e28758dafeeaa34819296821686addfddaa6a Author: Azeem Shaikh Date: Wed Jun 21 03:00:33 2023 +0000 scsi: target: tcmu: Replace strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230621030033.3800351-3-azeemshaikh38@gmail.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit d1e8a9fbb39292e6666192565b51bbda781f9f04 Author: Azeem Shaikh Date: Wed Jun 21 03:00:32 2023 +0000 scsi: ncr53c8xx: Replace strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230621030033.3800351-2-azeemshaikh38@gmail.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 00c2cae6b66a913e8d9a39073988e4aa5baff0d8 Author: Arnd Bergmann Date: Fri Jun 16 11:06:56 2023 +0200 scsi: lpfc: Fix lpfc_name struct packing clang points out that the lpfc_name structure has an 8-byte alignment requirement on most architectures, but is embedded in a number of other structures that are forced to be only 1-byte aligned: drivers/scsi/lpfc/lpfc_hw.h:1516:30: error: field pe within 'struct lpfc_fdmi_reg_port_list' is less aligned than 'struct lpfc_fdmi_port_entry' and is usually due to 'struct lpfc_fdmi_reg_port_list' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] struct lpfc_fdmi_port_entry pe; drivers/scsi/lpfc/lpfc_hw.h:850:19: error: field portName within 'struct _ADISC' is less aligned than 'struct lpfc_name' and is usually due to 'struct _ADISC' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] drivers/scsi/lpfc/lpfc_hw.h:851:19: error: field nodeName within 'struct _ADISC' is less aligned than 'struct lpfc_name' and is usually due to 'struct _ADISC' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] drivers/scsi/lpfc/lpfc_hw.h:922:19: error: field portName within 'struct _RNID' is less aligned than 'struct lpfc_name' and is usually due to 'struct _RNID' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] drivers/scsi/lpfc/lpfc_hw.h:923:19: error: field nodeName within 'struct _RNID' is less aligned than 'struct lpfc_name' and is usually due to 'struct _RNID' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] From the git history, I can see that all the __packed annotations were done specifically to avoid introducing implicit padding around the lpfc_name instances, though this was probably the wrong approach. To improve this, only annotate the one uint64_t field inside of lpfc_name as packed, with an explicit 4-byte alignment, as is the default already on the 32-bit x86 ABI but not on most others. With this, the other __packed annotations can be removed again, as this avoids the incorrect padding. Two other structures change their layout as a result of this change: - struct _LOGO never gained a __packed annotation even though it has the same alignment problem as the others but is not used anywhere in the driver today. - struct serv_param similarly has this issue, and it is used, my guess is that this is only an internal structure rather than part of a binary interface, so the padding has no negative effect here. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230616090705.2623408-1-arnd@kernel.org Reviewed-by: Justin Tee Signed-off-by: Martin K. Petersen commit 53bf91641ae19fe51fb24422de6d07565a3536d0 Author: Abel Wu Date: Tue Jun 20 17:27:11 2023 +0800 inet: Cleanup on charging memory for newly accepted sockets If there is no net-memcg associated with the sock, don't bother calculating its memory usage for charge. Signed-off-by: Abel Wu Link: https://lore.kernel.org/r/20230620092712.16217-1-wuyun.abel@bytedance.com Signed-off-by: Jakub Kicinski commit ca4fa87435370747cac535cecfd08672bb679487 Author: renmingshuai Date: Tue Jun 20 09:49:39 2023 +0800 selftests: tc-testing: add one test for flushing explicitly created chain Add the test for additional reference to chains that are explicitly created by RTM_NEWCHAIN message. The test result: 1..1 ok 1 c2b4 - soft lockup alarm will be not generated after delete the prio 0 filter of the chain This is a follow up to commit c9a82bec02c3 ("net/sched: cls_api: Fix lockup on flushing explicitly created chain"). Signed-off-by: Mingshuai Ren Acked-by: Pedro Tammela Acked-by: Victor Nogueira Link: https://lore.kernel.org/r/20230620014939.2034054-1-renmingshuai@huawei.com Signed-off-by: Jakub Kicinski commit 1ca09f5746edd5e483d144118497f622af9dbe60 Author: Krzysztof Kozlowski Date: Mon Jun 19 19:01:34 2023 +0200 dt-bindings: net: micrel,ks8851: allow SPI device properties The Micrel KS8851 can be attached to SPI or parallel bus and the difference is expressed in compatibles. Allow common SPI properties when this is a SPI variant and narrow the parallel memory bus properties to the second case. This fixes dtbs_check warning: qcom-msm8960-cdp.dtb: ethernet@0: Unevaluated properties are not allowed ('spi-max-frequency' was unexpected) Signed-off-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230619170134.65395-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jakub Kicinski commit 6a0a6dd8df9b6e9c0ed8d99bbfb4e5e2f8c9834f Author: Krzysztof Kozlowski Date: Sat Jun 17 18:57:16 2023 +0200 dt-bindings: net: bluetooth: qualcomm: document VDD_CH1 WCN3990 comes with two chains - CH0 and CH1 - where each takes VDD regulator. It seems VDD_CH1 is optional (Linux driver does not care about it), so document it to fix dtbs_check warnings like: sdm850-lenovo-yoga-c630.dtb: bluetooth: 'vddch1-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230617165716.279857-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jakub Kicinski commit e748d0fd66abc4b1c136022e4e053004fce2b792 Author: Ravi Gunasekaran Date: Wed Jun 14 17:17:10 2023 +0530 net: hsr: Disable promiscuous mode in offload mode When port-to-port forwarding for interfaces in HSR node is enabled, disable promiscuous mode since L2 frame forward happens at the offloaded hardware. Signed-off-by: Ravi Gunasekaran Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230614114710.31400-1-r-gunasekaran@ti.com Signed-off-by: Jakub Kicinski commit 3d5786ea472c3aff14e931d52ba05627c075d432 Author: Gilad Sever Date: Wed Jun 21 13:42:11 2023 +0300 selftests/bpf: Add vrf_socket_lookup tests Verify that socket lookup via TC/XDP with all BPF APIs is VRF aware. Signed-off-by: Gilad Sever Signed-off-by: Daniel Borkmann Reviewed-by: Eyal Birger Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20230621104211.301902-5-gilad9366@gmail.com commit 9a5cb79762e0eda17ca15c2a6eaca4622383c21c Author: Gilad Sever Date: Wed Jun 21 13:42:10 2023 +0300 bpf: Fix bpf socket lookup from tc/xdp to respect socket VRF bindings When calling bpf_sk_lookup_tcp(), bpf_sk_lookup_udp() or bpf_skc_lookup_tcp() from tc/xdp ingress, VRF socket bindings aren't respoected, i.e. unbound sockets are returned, and bound sockets aren't found. VRF binding is determined by the sdif argument to sk_lookup(), however when called from tc the IP SKB control block isn't initialized and thus inet{,6}_sdif() always returns 0. Fix by calculating sdif for the tc/xdp flows by observing the device's l3 enslaved state. The cg/sk_skb hooking points which are expected to support inet{,6}_sdif() pass sdif=-1 which makes __bpf_skc_lookup() use the existing logic. Fixes: 6acc9b432e67 ("bpf: Add helper to retrieve socket in BPF") Signed-off-by: Gilad Sever Signed-off-by: Daniel Borkmann Reviewed-by: Shmulik Ladkani Reviewed-by: Eyal Birger Acked-by: Stanislav Fomichev Cc: David Ahern Link: https://lore.kernel.org/bpf/20230621104211.301902-4-gilad9366@gmail.com commit 97fbfeb86917bdbe9c41d5143e335a929147f405 Author: Gilad Sever Date: Wed Jun 21 13:42:09 2023 +0300 bpf: Call __bpf_sk_lookup()/__bpf_skc_lookup() directly via TC hookpoint skb->dev always exists in the tc flow. There is no need to use bpf_skc_lookup(), bpf_sk_lookup() from this code path. This change facilitates fixing the tc flow to be VRF aware. Signed-off-by: Gilad Sever Signed-off-by: Daniel Borkmann Reviewed-by: Shmulik Ladkani Reviewed-by: Eyal Birger Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20230621104211.301902-3-gilad9366@gmail.com commit 6e98730bc0b44acaf86eccc75f823128aa9c9e79 Author: Gilad Sever Date: Wed Jun 21 13:42:08 2023 +0300 bpf: Factor out socket lookup functions for the TC hookpoint. Change BPF helper socket lookup functions to use TC specific variants: bpf_tc_sk_lookup_tcp() / bpf_tc_sk_lookup_udp() / bpf_tc_skc_lookup_tcp() instead of sharing implementation with the cg / sk_skb hooking points. This allows introducing a separate logic for the TC flow. The tc functions are identical to the original code. Signed-off-by: Gilad Sever Signed-off-by: Daniel Borkmann Reviewed-by: Shmulik Ladkani Reviewed-by: Eyal Birger Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20230621104211.301902-2-gilad9366@gmail.com commit ff9b63c80b087bac495b337882a5880b130401c0 Merge: 7ad7b7023fcb1 b655892ffd6d8 Author: Jakub Kicinski Date: Wed Jun 21 14:30:48 2023 -0700 Merge branch 'leds-trigger-netdev-add-additional-modes' Christian Marangi says: ==================== leds: trigger: netdev: add additional modes This is a continue of [1]. It was decided to take a more gradual approach to implement LEDs support for switch and phy starting with basic support and then implementing the hw control part when we have all the prereq done. This should be the final part for the netdev trigger. I added net-next tag and added netdev mailing list since I was informed that this should be merged with netdev branch. We collect some info around and we found a good set of modes that are common in almost all the PHY and Switch. These modes are: - Modes for dedicated link speed(10, 100, 1000 mbps). Additional mode can be added later following this example. - Modes for half and full duplex. The original idea was to add hw control only modes. While the concept makes sense in practice it would results in lots of additional code and extra check to make sure we are setting correct modes. With the suggestion from Andrew it was pointed out that using the ethtool APIs we can actually get the current link speed and duplex and this effectively removed the problem of having hw control only modes since we can fallback to software. Since these modes are supported by software, we can skip providing an user for this in the LED driver to support hw control for these new modes (that will come right after this is merged) and prevent this to be another multi subsystem series. For link speed and duplex we use ethtool APIs. To call ethtool APIs, rtnl lock is needed but this can be skipped on handling netdev events as the lock is already held. [1] https://lore.kernel.org/lkml/20230216013230.22978-1-ansuelsmth@gmail.com/ ==================== Link: https://lore.kernel.org/r/20230619204700.6665-1-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski commit b655892ffd6d89b0c7407e099c40dbde82ee3f03 Author: Christian Marangi Date: Mon Jun 19 22:47:00 2023 +0200 leds: trigger: netdev: expose hw_control status via sysfs Expose hw_control status via sysfs for the netdev trigger to give userspace better understanding of the current state of the trigger and the LED. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Reviewed-by: Kalesh AP Acked-by: Lee Jones Signed-off-by: Jakub Kicinski commit f22f95b9ff1551c9bab13104131929f33d51f23f Author: Christian Marangi Date: Mon Jun 19 22:46:59 2023 +0200 leds: trigger: netdev: add additional specific link duplex mode Add additional modes for specific link duplex. Use ethtool APIs to get the current link duplex and enable the LED accordingly. Under netdev event handler the rtnl lock is already held and is not needed to be set to access ethtool APIs. This is especially useful for PHY and Switch that supports LEDs hw control for specific link duplex. Add additional modes: - half_duplex: Turn on LED when link is half duplex - full_duplex: Turn on LED when link is full duplex Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Acked-by: Lee Jones Signed-off-by: Jakub Kicinski commit d5e01266e7f5fa12400d4c8aa4e86fe89dcc61e9 Author: Christian Marangi Date: Mon Jun 19 22:46:58 2023 +0200 leds: trigger: netdev: add additional specific link speed mode Add additional modes for specific link speed. Use ethtool APIs to get the current link speed and enable the LED accordingly. Under netdev event handler the rtnl lock is already held and is not needed to be set to access ethtool APIs. This is especially useful for PHY and Switch that supports LEDs hw control for specific link speed. (example scenario a PHY that have 2 LED connected one green and one orange where the green is turned on with 1000mbps speed and orange is turned on with 10mpbs speed) On mode set from sysfs we check if we have enabled split link speed mode and reject enabling generic link mode to prevent wrong and redundant configuration. Rework logic on the set baseline state to support these new modes to select if we need to turn on or off the LED. Add additional modes: - link_10: Turn on LED when link speed is 10mbps - link_100: Turn on LED when link speed is 100mbps - link_1000: Turn on LED when link speed is 1000mbps Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Acked-by: Lee Jones Signed-off-by: Jakub Kicinski commit 7ad7b7023fcb1efdd71406ff7670ef6130de65a6 Author: Ivan Vecera Date: Tue Jun 20 16:48:55 2023 +0200 bnxt_en: Link representors to PCI device Link VF representors to parent PCI device to benefit from systemd defined naming scheme. Without this change the representor is visible as ethN. Signed-off-by: Ivan Vecera Reviewed-by: Simon Horman Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20230620144855.288443-1-ivecera@redhat.com Signed-off-by: Jakub Kicinski commit f31b6c649ef34b3636d74484bf4c4cd77f23aeeb Merge: cc75549548482 664bc72dd2007 Author: Jakub Kicinski Date: Wed Jun 21 14:02:57 2023 -0700 Merge branch 'selftests-preparations-for-out-of-order-operations-patches-in-mlxsw' Petr Machata says: ==================== selftests: Preparations for out-of-order-operations patches in mlxsw The mlxsw driver currently makes the assumption that the user applies configuration in a bottom-up manner. Thus netdevices need to be added to the bridge before IP addresses are configured on that bridge or SVI added on top of it. Enslaving a netdevice to another netdevice that already has uppers is in fact forbidden by mlxsw for this reason. Despite this safety, it is rather easy to get into situations where the offloaded configuration is just plain wrong. Over the course of the following several patchsets, mlxsw code is going to be adjusted to diminish the space of wrongly offloaded configurations. Ideally the offload state will reflect the actual state, regardless of the sequence of operation used to construct that state. Several selftests build configurations that will not be offloadable in the future on some systems. The reason is that what will get offloaded is the actual configuration, not the configuration steps. For example, when a port is added to a bridge that has an IP address, that bridge will get a RIF, which it would not have with the current code. But on Nvidia Spectrum-1 machines, MAC addresses of all RIFs need to have the same prefix, which the bridge will violate. The RIF thus couldn't be created, and the enslavement is therefore canceled, because it would lead to an unoffloadable configuration. This breaks some selftests. In this patchset, adjust selftests to avoid the configurations that mlxsw would be incapable of offloading, while maintaining relevance with regards to the feature that is being tested. There are generally two cases of fixes: - Disabling IPv6 autogen on bridges that do not participate in routing, either because of the abovementioned requirement to keep the same MAC prefix on all in-HW router interfaces, or, on 802.1ad bridges, because in-HW router interfaces are not supported at all. - Setting the bridge MAC address to what it will become after the first member port is attached, so that the in-HW router interface is created with a supported MAC address. The patchset is then split thus: - Patches #1-#7 adjust generic selftests - Patches #8-#16 adjust mlxsw-specific selftests ==================== Link: https://lore.kernel.org/r/cover.1687265905.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 664bc72dd20073be227f9e68b3db75313c6926f8 Author: Petr Machata Date: Tue Jun 20 15:56:02 2023 +0200 selftests: mlxsw: one_armed_router: Use port MAC for bridge address In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge, the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The bridge eventually inherits MAC address from its first member, after the enslavement is acked. A number of (mainly VXLAN) selftests already work around the problem by setting the MAC address to whatever it will eventually be anyway. Do the same for this selftest. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit 5541577521cc2e22bc84ba92be24959671006283 Author: Petr Machata Date: Tue Jun 20 15:56:01 2023 +0200 selftests: mlxsw: vxlan: Disable IPv6 autogen on bridges In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge (this holds for all bridges used here), the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The selftest itself however checks various aspects of VXLAN offloading and the bridges do not need to participate in routing traffic. The IP addresses or the RIFs are irrelevant. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridges in this selftest, thus exempting them from mlxsw router attention. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit 08035d8e354d9fc652c9d12668e89d83edc8f974 Author: Petr Machata Date: Tue Jun 20 15:56:00 2023 +0200 selftests: mlxsw: spectrum: q_in_vni_veto: Disable IPv6 autogen on a bridge In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge, the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The selftest itself however checks vetoing of a different aspect of the configuration and the bridge does not need to participate in routing traffic. The IP address or the RIF are irrelevant. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridge in this selftest, thus exempting it from mlxsw router attention. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit ea2d5f757e914fa0f82949e130ee9da0ee931e59 Author: Petr Machata Date: Tue Jun 20 15:55:59 2023 +0200 selftests: mlxsw: qos_mc_aware: Disable IPv6 autogen on bridges In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge (this holds for both bridges used here), the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The selftest itself however checks traffic prioritization and scheduling, and the bridges serve for their L2 forwarding capabilities, and do not need to participate in routing traffic. The IP addresses or the RIFs are irrelevant. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridges in this selftest, thus exempting them from mlxsw router attention. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit ec7023e6745e6fb34cd855522cb8f995194bdbf1 Author: Petr Machata Date: Tue Jun 20 15:55:58 2023 +0200 selftests: mlxsw: qos_ets_strict: Disable IPv6 autogen on bridges In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge (this holds for both bridges used here), the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The selftest itself however checks traffic prioritization and scheduling, and the bridges serve for their L2 forwarding capabilities, and do not need to participate in routing traffic. The IP addresses or the RIFs are irrelevant. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridges in this selftest, thus exempting them from mlxsw router attention. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit 6349f9bbbfb2bda12c0a633965d03435d18d930f Author: Petr Machata Date: Tue Jun 20 15:55:57 2023 +0200 selftests: mlxsw: qos_dscp_bridge: Disable IPv6 autogen on a bridge In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge, the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The selftest itself however checks DCB DSCP-based prioritization, and the bridge serves for its L2 forwarding capabilities, and does not need to participate in routing traffic. The IP address or the RIF are irrelevant. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridge in this selftest, thus exempting it from mlxsw router attention. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit 32b3a7bf8570d24b30d1961fb3eaddb9f1c3250a Author: Petr Machata Date: Tue Jun 20 15:55:56 2023 +0200 selftests: mlxsw: mirror_gre_scale: Disable IPv6 autogen on a bridge In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge, the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The selftest itself however checks how many mirroring sessions a machine is capable of offloading. The IP address or the RIF are irrelevant. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridge in this selftest, thus exempting it from mlxsw router attention. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit a758dc469a9caf958c0f02426aa76162c89faa97 Author: Petr Machata Date: Tue Jun 20 15:55:55 2023 +0200 selftests: mlxsw: extack: Disable IPv6 autogen on bridges In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge (this holds for all bridges used here), the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The selftest itself however checks whether a different vetoed aspect of the configuration provides an extack. The IP address or the RIF are irrelevant. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridges in this selftest, thus exempting them from mlxsw router attention. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit 8cfdd300a5e95fea14050cd86259bafb35244a2f Author: Petr Machata Date: Tue Jun 20 15:55:54 2023 +0200 selftests: mlxsw: q_in_q_veto: Disable IPv6 autogen on bridges In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. The swp enslavement to the 802.1ad bridge is not allowed, because RIFs are not allowed to be created for 802.1ad bridges, but the address indicates one needs to be created. Thus the veto selftests fail already during the port enslavement. Then the attempt to create a VLAN on top of the same bridge is not vetoed, because the bridge is not related to mlxsw, and the selftest fails. Fix by disabling automatic IPv6 address generation for the bridges in this selftest, thus exempting them from the mlxsw router attention. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Jakub Kicinski commit 5e71bf50c2e284e4b287d55336a1b2f47027624c Author: Petr Machata Date: Tue Jun 20 15:55:53 2023 +0200 selftests: forwarding: router_bridge: Use port MAC for bridge address In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge, the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The bridge eventually inherits MAC address from its first member, after the enslavement is acked. A number of (mainly VXLAN) selftests already work around the problem by setting the MAC address to whatever it will eventually be anyway. Do the same here. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit 8fd32576e650efe88e396febd494f12adf18262a Author: Petr Machata Date: Tue Jun 20 15:55:52 2023 +0200 selftests: forwarding: mirror_gre_*: Use port MAC for bridge address In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge, the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The bridge eventually inherits MAC address from its first member, after the enslavement is acked. A number of (mainly VXLAN) selftests already work around the problem by setting the MAC address to whatever it will eventually be anyway. Do the same for several mirror_gre selftests. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit 92c3bb5393db2f36e6a23ba7bb50b34c18c523f5 Author: Petr Machata Date: Tue Jun 20 15:55:51 2023 +0200 selftests: forwarding: mirror_gre_*: Disable IPv6 autogen on bridges In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge, the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. These two selftests however check mirroring traffic to a gretap netdevice. The bridge here does not participate in routing traffic and the IP address or the RIF are irrelevant. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridges in these selftests, thus exempting them from mlxsw router attention. Since the bridges are only used for L2 forwarding, this change should not hinder usefulness of this selftest for testing SW datapath or HW datapaths in other devices. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit f61018dc3e21ba0bee9caadf3015a65a7b4ce09f Author: Petr Machata Date: Tue Jun 20 15:55:50 2023 +0200 selftests: forwarding: pedit_dsfield: Disable IPv6 autogen on a bridge In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge, the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The selftest itself however checks whether skbedit changes packet priority as appropriate. The bridge thus does not need to participate in routing traffic and the IP address or the RIF are irrelevant. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridge in this selftest, thus exempting it from mlxsw router attention. Since the bridge is only used for L2 forwarding, this change should not hinder usefulness of this selftest for testing SW datapath or HW datapaths in other devices. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit d7442b7d288e8a00290808623f77bc5ed87ba8e6 Author: Petr Machata Date: Tue Jun 20 15:55:49 2023 +0200 selftests: forwarding: skbedit_priority: Disable IPv6 autogen on a bridge In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. At the time that the front panel port is enslaved to the bridge, the bridge MAC address does not have the same prefix as other interfaces in the system. On Nvidia Spectrum-1 machines all the RIFs have to have the same 38-bit MAC address prefix. Since the bridge does not obey this limitation, the RIF cannot be created, and the enslavement attempt is vetoed on the grounds of the configuration not being offloadable. The selftest itself however checks operation of pedit on IPv4 and IPv6 dsfield and its parts. The bridge thus does not need to participate in routing traffic and the IP address or the RIF are irrelevant. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridge in this selftest, thus exempting it from mlxsw router attention. Since the bridge is only used for L2 forwarding, this change should not hinder usefulness of this selftest for testing SW datapath or HW datapaths in other devices. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: Jakub Kicinski commit c801533304ca87e314ecc6fc43b9a7822f159f18 Author: Petr Machata Date: Tue Jun 20 15:55:48 2023 +0200 selftests: forwarding: dual_vxlan_bridge: Disable IPv6 autogen on bridges In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. This will cause this selftest to fail spuriously. The swp enslavement to the 802.1ad bridge is not allowed, because RIFs are not allowed to be created for 802.1ad bridges, but the address indicates one needs to be created. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridge in this selftest, thus exempting it from mlxsw router attention. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Jakub Kicinski commit 8c3736ce595bccb6322c44a1f853216e278aa635 Author: Petr Machata Date: Tue Jun 20 15:55:47 2023 +0200 selftests: forwarding: q_in_vni: Disable IPv6 autogen on bridges In a future patch, mlxsw will start adding RIFs to uppers of front panel port netdevices, if they have an IP address. This will cause this selftest to fail spuriously. The swp enslavement to the 802.1ad bridge is not allowed, because RIFs are not allowed to be created for 802.1ad bridges, but the address indicates one needs to be created. Fix by disabling automatic IPv6 address generation for the HW-offloaded bridge in this selftest, thus exempting it from mlxsw router attention. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Jakub Kicinski commit e973dfe9299441ad263efedf094897fbb31e6a87 Author: LeiZhou-97 Date: Tue Jun 13 18:59:29 2023 +0800 cgroup/misc: Expose misc.current on cgroup v2 root Hello, This patch is to expose misc.current on cgroup v2 root for tracking how much of the resource has been consumed in total on the system. Most of the cloud infrastucture use cgroup to fetch the host information for scheduling purpose. Currently, the misc controller can be used by Intel TDX HKIDs and AMD SEV ASIDs, which are both used for creating encrypted VMs. Intel TDX and AMD SEV are mostly be used by the cloud providers for providing confidential VMs. In actual use of a server, these confidential VMs may be launched in different ways. For the cloud solution, there are kubvirt and coco (tracked by kubepods.slice); on host, they can be booted directly through qemu by end user (tracked by user.slice), etc. In this complex environment, when wanting to know how many resource is used in total it has to iterate through all existing slices to get the value of each misc.current and add them up to calculate the total number of consumed keys. So exposing misc.current to root cgroup tends to give much easier when calculates how much resource has been used in total, which helps to schedule and count resources for the cloud infrastucture. Signed-off-by: LeiZhou-97 Signed-off-by: Tejun Heo commit 36de5f303ca1bd6fce74815ef17ef3d8ff8737b5 Author: Gustavo A. R. Silva Date: Wed Jun 14 19:18:22 2023 -0600 cgroup: Avoid -Wstringop-overflow warnings Address the following -Wstringop-overflow warnings seen when built with ARM architecture and aspeed_g4_defconfig configuration (notice that under this configuration CGROUP_SUBSYS_COUNT == 0): kernel/cgroup/cgroup.c:1208:16: warning: 'find_existing_css_set' accessing 4 bytes in a region of size 0 [-Wstringop-overflow=] kernel/cgroup/cgroup.c:1258:15: warning: 'css_set_hash' accessing 4 bytes in a region of size 0 [-Wstringop-overflow=] kernel/cgroup/cgroup.c:6089:18: warning: 'css_set_hash' accessing 4 bytes in a region of size 0 [-Wstringop-overflow=] kernel/cgroup/cgroup.c:6153:18: warning: 'css_set_hash' accessing 4 bytes in a region of size 0 [-Wstringop-overflow=] These changes are based on commit d20d30ebb199 ("cgroup: Avoid compiler warnings with no subsystems"). Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Tejun Heo commit 0feedcaa0a2723da191a2aad8526de92442448fc Merge: 37d1fc51dd20e b11403c93b7cd Author: Arnd Bergmann Date: Wed Jun 21 22:17:54 2023 +0200 Merge tag 'ti-driver-soc-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/drivers TI SoC driver updates for v6.5 * pruss: Add helper functions for ethernet client driver usage, add compile-testing, fixup function pointer casts * smartreflex: Cosmetic optimization for using devm_ioremap_resource * wkup_m3_ipc: Fix error checking around debugfs_create_dir * tag 'ti-driver-soc-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: wkup_m3_ipc.c: Fix error checking for debugfs_create_dir soc: ti: pruss: Add helper functions to set GPI mode, MII_RT_event and XFR soc: ti: pruss: Add pruss_cfg_read()/update(), pruss_cfg_get_gpmux()/set_gpmux() APIs soc: ti: pruss: Add pruss_{request,release}_mem_region() API soc: ti: pruss: Add pruss_get()/put() API soc: ti: pruss: Allow compile-testing soc: ti: pruss: Avoid cast to incompatible function type soc: ti: smartreflex: Use devm_platform_ioremap_resource() Link: https://lore.kernel.org/r/20230615164134.6sd5hudyadq3fvk4@garage Signed-off-by: Arnd Bergmann commit e8b4858b158eb31c0c3699280af78f34cdc9d993 Author: Mans Rullgard Date: Tue Jun 20 21:09:17 2023 +0100 dt-bindings: bus: ti-sysc: fix typo Fix typo (period vs comma) in list of valid clock names. Signed-off-by: Mans Rullgard Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230620200917.24958-1-mans@mansr.com Signed-off-by: Rob Herring commit 37d1fc51dd20e92263f35a63adbdd6da0cc7e4ca Merge: aaeb1b6367632 5d85ea2c87978 Author: Arnd Bergmann Date: Wed Jun 21 22:15:10 2023 +0200 Merge tag 'qcom-drivers-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers More Qualcomm driver updates for v6.5 The detection of split/non-split firmware files in the MDT loader is corrected. The Geni driver is updated to not enable unused interrupts, in some configurations. The count unit for MSM8998 in BWMON is corrected. RPM master stats driver is corrected to check for the right return value of devm_ioremap(). Support for socinfo version 18 and 19 are aded, and IPQ5300 is added to the list of platforms. * tag 'qcom-drivers-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: soc: qcom: geni-se: Do not bother about enable/disable of interrupts in secondary sequencer dt-bindings: sram: qcom,imem: document qdu1000 soc: qcom: icc-bwmon: Fix MSM8998 count unit dt-bindings: soc: qcom,rpmh-rsc: Require power-domains soc: qcom: socinfo: Add Soc ID for IPQ5300 dt-bindings: arm: qcom,ids: add SoC ID for IPQ5300 soc: qcom: Fix a IS_ERR() vs NULL bug in probe soc: qcom: socinfo: Add support for new fields in revision 19 soc: qcom: socinfo: Add support for new fields in revision 18 dt-bindings: firmware: scm: Add compatible for SDX75 soc: qcom: mdt_loader: Fix split image detection Link: https://lore.kernel.org/r/20230615163104.1461905-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit aaeb1b63676324168f7e854bb327512a94bea833 Merge: a08000d5e04d7 21d4631eedb13 Author: Arnd Bergmann Date: Wed Jun 21 22:13:29 2023 +0200 Merge tag 'v6.4-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into soc/drivers PMIC wrapper - support companion device - add support for MT6795 SPMI: - add support for MT8186 SVS: - change gpu node name to match binding * tag 'v6.4-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: soc: mediatek: remove DDP_DOMPONENT_DITHER from enum soc: mediatek: SVS: Fix MT8192 GPU node name soc: mediatek: mtk-mutex: Remove unnecessary .owner dt-bindings: phy: mediatek,dsi-phy: Add compatible for MT6795 Helio X10 dt-bindings: pwm: Add compatible for MediaTek MT6795 dt-bindings: spmi: spmi-mtk-pmif: Document mediatek,mt8195-spmi as fallback of mediatek,mt8186-spmi soc: mediatek: pwrap: Add support for MT6795 Helio X10 soc: mediatek: mtk-pmic-wrap: Add support for MT6331 w/ MT6332 companion soc: mediatek: mtk-pmic-wrap: Add support for companion PMICs soc: mediatek: pwrap: Add kerneldoc for struct pwrap_slv_type soc: mediatek: pwrap: Move PMIC read test sequence in function dt-bindings: soc: mediatek: pwrap: Add compatible for MT6795 Helio X10 Link: https://lore.kernel.org/r/1ed1e5ae-6305-e63a-84a0-3c43f69c8f8b@gmail.com Signed-off-by: Arnd Bergmann commit a08000d5e04d7a56bfdd864c145ba0f04765cb38 Merge: 09f4406a02ba5 e81a16e772592 Author: Arnd Bergmann Date: Wed Jun 21 21:58:32 2023 +0200 Merge tag 'qcom-drivers-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers Qualcomm driver updates for v6.5 Konrad Dybcio is promoted, from reviewer, to co-maintainer. The mdt_loader gets a fix to the detection of split binaries, where the previous logic sometimes concluded that the first segments was not split, in a split image. The unconditional calling of scm_pas_mem_setup() turns out to cause a regression and is reverted. The altmode subfunction of pmic_glink is enabled for SM8450. A new driver for exposing power statistics from the RPM, for debugging purposes, is introduced. OCMEM gets a debug prints of the hardware version, QMI helpers are transitioned to alloc_ordered_workqueue() and an error message in ramp_controller is improved. An API is introduced to the SMEM driver to allow other drivers to query the SoC id, rather than open-coding the parsing of the relevant SMEM item. This is then used to clean up the Qualcomm NVMEM-based cpufreq driver. Socinfo is extended with knowledge about IPQ5018, IPQ5312 and IPQ5302. * tag 'qcom-drivers-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (23 commits) soc: qcom: ocmem: Add OCMEM hardware version print cpufreq: qcom-nvmem: use helper to get SMEM SoC ID cpufreq: qcom-nvmem: use SoC ID-s from bindings soc: qcom: smem: introduce qcom_smem_get_soc_id() soc: qcom: smem: Switch to EXPORT_SYMBOL_GPL() soc: qcom: socinfo: move SMEM item struct and defines to a header soc: qcom: mdt_loader: Fix unconditional call to scm_pas_mem_setup MAINTAINERS: Add Konrad Dybcio as linux-arm-msm co-maintainer dt-bindings: sram: qcom,imem: Document MSM8226 soc: qcom: socinfo: Add Soc ID for IPQ5312 and IPQ5302 dt-bindings: arm: qcom,ids: add SoC ID for IPQ5312 and IPQ5302 soc: qcom: socinfo: Add IDs for IPQ5018 family dt-bindings: arm: qcom,ids: Add IDs for IPQ5018 family soc: qcom: Introduce RPM master stats driver dt-bindings: soc: qcom: Add RPM Master stats soc: qcom: qmi: Use alloc_ordered_workqueue() to create ordered workqueues soc: qcom: ramp_controller: Improve error message for failure in .remove() dt-bindings: soc: qcom: smd-rpm: allow MSM8226 over SMD soc: qcom: rpmpd: use correct __le32 type dt-bindings: soc: qcom: eud: Fix compatible string in the example ... Link: https://lore.kernel.org/r/20230611010044.2481875-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 09f4406a02ba57361e64825fac53e91e260a61b7 Merge: 095ee35a336de 9365bf006f53d Author: Arnd Bergmann Date: Wed Jun 21 21:49:59 2023 +0200 Merge tag 'tegra-for-6.5-pci' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers PCI: tegra: Changes for v6.5-rc1 This contains updates to the PCI driver for Tegra194 and later devices that depend on the memory controller interconnect changes. * tag 'tegra-for-6.5-pci' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: PCI: tegra194: Add interconnect support in Tegra234 PCI: tegra194: Fix possible array out of bounds access Link: https://lore.kernel.org/r/20230609193620.2275240-5-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 095ee35a336de61c96790d7dd0cb083e0b35cb6f Merge: b161ec3d3820f e852af72a7f21 Author: Arnd Bergmann Date: Wed Jun 21 21:49:00 2023 +0200 Merge tag 'tegra-for-6.5-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers memory: tegra: Changes for v6.5-rc1 This introduces an interconnect provider for the memory controller and external memory controller found on Tegra234 chips that will eventually be used to dynamically scale the EMC frequency based on a device's bandwidth needs. * tag 'tegra-for-6.5-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: memory: tegra: Make CPU cluster BW request a multiple of MC channels memory: tegra: Add software memory clients in Tegra234 memory: tegra: Add memory clients for Tegra234 memory: tegra: Add interconnect support for DRAM scaling in Tegra234 dt-bindings: tegra: Add ICC IDs for dummy memory clients dt-bindings: tegra: Document compatible for IGX Link: https://lore.kernel.org/r/20230609193620.2275240-4-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit b161ec3d3820f4b79fa12a02451295a70ded13fa Merge: bc889e870e62c 2abd484ca48f2 Author: Arnd Bergmann Date: Wed Jun 21 21:47:02 2023 +0200 Merge tag 'tegra-for-6.5-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers firmware: tegra: Changes for v6.5-rc1 This adds support for using system memory as shared memory between the CPU and the BPMP, which will be needed for Tegra264 support. * tag 'tegra-for-6.5-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: firmware: tegra: bpmp: Add support for DRAM MRQ GSCs Link: https://lore.kernel.org/r/20230609193620.2275240-2-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit bc889e870e62c13ddbbd363e30c854d358b90c4d Merge: b79dec951a5ed c954cd7ad0412 Author: Arnd Bergmann Date: Wed Jun 21 21:39:18 2023 +0200 Merge tag 'tegra-for-6.5-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers soc/tegra: Changes for v6.5-rc1 This adds initial support for identifying the Tegra264 SoC family and fixes potential issues when reading from the FUSE block. A new software wake event for the AON cluster is added on Tegra234 and the debugfs initialization is drastically simplified. * tag 'tegra-for-6.5-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: pmc: Use devm_clk_notifier_register() soc/tegra: pmc: Simplify debugfs initialization soc/tegra: fuse: Fix Tegra234 fuse size soc/tegra: pmc: Add AON SW Wake support for Tegra234 soc/tegra: fuse: Add support for Tegra264 Link: https://lore.kernel.org/r/20230609193620.2275240-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 017fb83ee0612595ec70c65ddd83472706b02a50 Author: Bart Van Assche Date: Wed Jun 21 09:50:54 2023 -0700 block: Improve kernel-doc headers Fix the documentation of the devt_from_partuuid() return value. Fix the following two recently introduced kernel-doc warnings: block/bdev.c:570: warning: Function parameter or member 'hops' not described in 'bd_finish_claiming' block/early-lookup.c:46: warning: Function parameter or member 'devt' not described in 'devt_from_partuuid' Cc: Christoph Hellwig Fixes: 0718afd47f70 ("block: introduce holder ops") Fixes: cf056a431215 ("init: improve the name_to_dev_t interface") Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230621165054.743815-1-bvanassche@acm.org Signed-off-by: Jens Axboe commit fa50d6b8a5f762c62dc0049d3ede9f1e47cc47d3 Merge: 92852219a397b 6c50384ef8b94 Author: Greg Kroah-Hartman Date: Wed Jun 21 21:15:06 2023 +0200 Merge tag 'coresight-next-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-next Suzuki writes: coresight: Updates for v6.5 CoreSight and hwtracing subsystem updates for v6.5 includes: - Fixes to the CTI module reference leaks. This involves, redesign of how the helper devices are tracked and CTI devices have been converted to helper devices. - Fix removal of the trctraceidr file from sysfs for ETMs. - Match all ETMv4 instances based on the ETMv4 architected registers and the CoreSight Component ID (CID), than having to add individual PIDs for CPUs. - Add support for Dummy CoreSight source and sink drivers. - Add James Clark as Reviewer for the CoreSight kernel drivers - Fixes to HiSilicon PCIe Tune and Trace Device driver Signed-off-by: Suzuki K Poulose * tag 'coresight-next-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux: (27 commits) hwtracing: hisi_ptt: Fix potential sleep in atomic context hwtracing: hisi_ptt: Advertise PERF_PMU_CAP_NO_EXCLUDE for PTT PMU hwtracing: hisi_ptt: Export available filters through sysfs hwtracing: hisi_ptt: Add support for dynamically updating the filter list hwtracing: hisi_ptt: Factor out filter allocation and release operation coresight: dummy: Update type of mode parameter in dummy_{sink,source}_enable() Documentation: trace: Add documentation for Coresight Dummy Trace dt-bindings: arm: Add support for Coresight dummy trace Coresight: Add coresight dummy driver MAINTAINERS: coresight: Add James Clark as Reviewer coresight: etm4x: Match all ETM4 instances based on DEVARCH and DEVTYPE coresight: etm4x: Make etm4_remove_dev() return void coresight: etm4x: Fix missing trctraceidr file in sysfs coresight: Fix CTI module refcount leak by making it a helper device coresight: Enable and disable helper devices adjacent to the path coresight: Refactor out buffer allocation function for ETR coresight: Make refcount a property of the connection coresight: Store in-connections as well as out-connections coresight: Simplify connection fixup mechanism coresight: Store pointers to connections rather than an array of them ... commit 92852219a397b894255a91868d2cc7fd80e318ff Merge: a5052c85b9def 1400725e45152 Author: Greg Kroah-Hartman Date: Wed Jun 21 21:12:43 2023 +0200 Merge tag 'icc-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next Georgi writes: interconnect changes for 6.5 This pull request contains the interconnect changes for the 6.5-rc1 merge window which is a mix of core and driver changes with the following highlights: - Support for configuring QoS on the Qualcomm's RPM-based platforms, that required special handling of some interface (non-scaling) clocks. - Support for clock-based interconnect providers for cases when clock corresponds to bus bandwidth. This is used to enable CPU cluster bandwidth scaling on MSM8996 platforms. One patch is touching a file in the clock subsystem that has been acked by the maintainer. Core changes: interconnect: add clk-based icc provider support interconnect: icc-clk: fix modular build interconnect: drop unused icc_get() interface Driver changes: interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks interconnect: qcom: rpm: Rename icc provider num_clocks to num_bus_clocks interconnect: qcom: rpm: Drop unused parameters interconnect: qcom: rpm: Set QoS registers only once interconnect: qcom: rpm: Handle interface clocks interconnect: qcom: icc-rpm: Enforce 2 or 0 bus clocks interconnect: qcom: rpm: Don't use clk_get_optional for bus clocks anymore interconnect: qcom: msm8996: Promote to core_initcall interconnect: qcom: rpm: allocate enough data in probe() dt-bindings: interconnect/msm8996-cbf: add defines to be used by CBF clk: qcom: cbf-msm8996: scale CBF clock according to the CPUfreq dt-bindings: interconnect: fsl,imx8m-noc: drop unneeded quotes Signed-off-by: Georgi Djakov * tag 'icc-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: dt-bindings: interconnect: fsl,imx8m-noc: drop unneeded quotes interconnect: icc-clk: fix modular build clk: qcom: cbf-msm8996: scale CBF clock according to the CPUfreq interconnect: drop unused icc_get() interface interconnect: qcom: rpm: allocate enough data in probe() interconnect: qcom: msm8996: Promote to core_initcall interconnect: qcom: rpm: Don't use clk_get_optional for bus clocks anymore interconnect: qcom: icc-rpm: Enforce 2 or 0 bus clocks interconnect: qcom: rpm: Handle interface clocks interconnect: add clk-based icc provider support dt-bindings: interconnect/msm8996-cbf: add defines to be used by CBF interconnect: qcom: rpm: Set QoS registers only once interconnect: qcom: rpm: Drop unused parameters interconnect: qcom: rpm: Rename icc provider num_clocks to num_bus_clocks interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks commit a4bd03e7cb78ff743d811a09273b40d31e861def Merge: ee44484c12edc 724ba67515320 Author: Arnd Bergmann Date: Wed Jun 21 21:07:01 2023 +0200 Merge tag 'arm-dts-mv-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux into soc/dt ARM: dts: Move .dts files to vendor sub-directories The arm dts directory has grown to 1559 boards which makes it a bit unwieldy to maintain and use. Past attempts stalled out due to plans to move .dts files out of the kernel tree. Doing that is no longer planned (any time soon at least), so let's go ahead and group .dts files by vendors. This move aligns arm with arm64 .dts file structure. * tag 'arm-dts-mv-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: ARM: dts: Move .dts files to vendor sub-directories kbuild: Support flat DTBs install ARM: dts: Add .dts files missing from the build ARM: dts: allwinner: Use quoted #include Link: https://lore.kernel.org/r/20230621185025.GA3197738-robh@kernel.org Signed-off-by: Arnd Bergmann commit 75bfb70457a4c4c9f0095e39885382fc5049c5ce Author: Colin Ian King Date: Wed Jun 21 15:52:05 2023 +0100 nfsd: remove redundant assignments to variable len There are a few assignments to variable len where the value is not being read and so the assignments are redundant and can be removed. In one case, the variable len can be removed completely. Cleans up 4 clang scan warnings of the form: fs/nfsd/export.c:100:7: warning: Although the value stored to 'len' is used in the enclosing expression, the value is never actually read from 'len' [deadcode.DeadStores] Signed-off-by: Colin Ian King Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit a04de42460e271e532b43ad40e9fb07a9a09fe5c Author: Miaohe Lin Date: Sat Jun 17 15:48:09 2023 +0800 cgroup: remove obsolete comment on cgroup_on_dfl() The debug feature is supported since commit 8cc38fa7fa31 ("cgroup: make debug an implicit controller on cgroup2"), update corresponding comment. Signed-off-by: Miaohe Lin Signed-off-by: Tejun Heo commit 5f743f576d3f9ac08ed28fe8e65bdbc8d49b8034 Author: Dmitry Antipov Date: Wed Jun 14 09:18:32 2023 +0300 wifi: rtlwifi: cleanup USB interface Drop unused '_usb_writen_sync()' and relevant pointer from 'struct rtl_io', handle possible write error in '_usb_write_async()', adjust related code. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230614061832.40882-2-dmantipov@yandex.ru commit 084f1f552f8dd8e8b993d14a30720b7484d77020 Author: Dmitry Antipov Date: Wed Jun 14 09:18:31 2023 +0300 wifi: rtlwifi: simplify LED management Introduce 'rtl_init_sw_leds()' to replace per-chip LED initialization code (and so drop 'struct rtl_led' as no longer used), drop 'init_sw_leds' and 'deinit_sw_leds' fields from 'struct rtl_hal_ops', adjust related code. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230614061832.40882-1-dmantipov@yandex.ru commit 9b53a13422162feac7c7ee58e5bc0e0a80a41963 Author: William Breathitt Gray Date: Tue Jun 20 13:01:59 2023 -0400 counter: Fix menuconfig "Counter support" submenu entries disappearance The current placement of the I8254 Kconfig entry results in the disappearance of the "Counter support" submenu items in menuconfig. Move the I8254 above the menuconfig COUNTER entry to restore the intended submenu behavior. Fixes: d428487471ba ("counter: i8254: Introduce the Intel 8254 interface library module") Reported-by: Jarkko Nikula Closes: https://lore.kernel.org/all/32ddaa7b-53a8-d61f-d526-b545bd561337@linux.intel.com/ Reviewed-by: Randy Dunlap Tested-by: Jarkko Nikula Reviewed-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230620170159.556788-1-william.gray@linaro.org/ Signed-off-by: William Breathitt Gray commit d8aa21235d0342e6d0cc99f37d0771749e742e5a Merge: 04f78e242fffe 12ec37be3faf9 Author: Kalle Valo Date: Wed Jun 21 21:18:08 2023 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v6.5. Major changes: ath11k * factory test mode support commit 7bd932d9adbcc5c5370d968bdb0b00385606bf3a Author: Raymond Hackley Date: Fri Jun 2 13:11:14 2023 +0000 leds: sgm3140: Add richtek,rt5033-led compatible Richtek's rt5033-led has pin configurations similar to sgm3140. Add it to the compatible list. Signed-off-by: Raymond Hackley Link: https://lore.kernel.org/r/20230602131024.260297-1-raymondhackley@protonmail.com Signed-off-by: Lee Jones commit 2a5724a0a7c6374905b26f2f24caeab038608953 Author: Raymond Hackley Date: Fri Jun 2 13:11:02 2023 +0000 dt-bindings: leds: sgm3140: Document richtek,rt5033 compatible Add devicetree binding for Richtek RT5033 Flash LED charge pump used for camera flash LEDs. Signed-off-by: Raymond Hackley Link: https://lore.kernel.org/r/20230602131009.260239-1-raymondhackley@protonmail.com Signed-off-by: Lee Jones commit 12ec37be3faf9df7831ce210947f111b3417baf3 Author: Arnd Bergmann Date: Fri Jun 16 11:04:21 2023 +0200 wifi: ath10k: improve structure padding Including an aligned structure inside of a packed one is ambiguous and can lead to misaligned data, as pointed out by this clang warning: drivers/net/wireless/ath/ath10k/htt.h:715:34: error: field prefix within 'struct htt_rx_indication' is less aligned than 'struct htt_rx_indication_prefix' and is usually due to 'struct htt_rx_indication' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] struct htt_rx_indication_prefix prefix; ^ drivers/net/wireless/ath/ath10k/htt.h:736:34: error: field prefix within 'struct htt_rx_indication_hl' is less aligned than 'struct htt_rx_indication_prefix' and is usually due to 'struct htt_rx_indication_hl' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] struct htt_rx_indication_prefix prefix; ^ drivers/net/wireless/ath/ath10k/htt.h:1564:2: error: field within 'struct htt_tx_fetch_ind' is less aligned than 'union htt_tx_fetch_ind::(anonymous at drivers/net/wireless/ath/ath10k/htt.h:1564:2)' and is usually due to 'struct htt_tx_fetch_ind' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] union { ^ drivers/net/wireless/ath/ath10k/htt.h:1702:2: error: field within 'struct htt_resp' is less aligned than 'union htt_resp::(anonymous at drivers/net/wireless/ath/ath10k/htt.h:1702:2)' and is usually due to 'struct htt_resp' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] These structures appear to actually need the packing since they are embedded at misaligned offsets. Add even more such annotations here to enforce bytewise access throughout the driver. Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230616090439.2484857-1-arnd@kernel.org commit 2aa083acea9f61be3280184384551178f510ff51 Author: Dmitry Antipov Date: Tue Jun 13 16:46:55 2023 +0300 wifi: ath9k: convert msecs to jiffies where needed Since 'ieee80211_queue_delayed_work()' expects timeout in jiffies and not milliseconds, 'msecs_to_jiffies()' should be used in 'ath_restart_work()' and '__ath9k_flush()'. Fixes: d63ffc45c5d3 ("ath9k: rename tx_complete_work to hw_check_work") Signed-off-by: Dmitry Antipov Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230613134655.248728-1-dmantipov@yandex.ru commit cb60fdf6e23068e0954b2a66855b7dc5d6019a87 Author: Alexander Stein Date: Fri Jun 9 09:15:38 2023 +0200 dt-bindings: phy: mixel,mipi-dsi-phy: Remove assigned-clock* properties With dt-schema v2021.02 these properties are added by default. Some SoC (e.g. imx8mq) configure more than just one clock using these properties. Fixes: f9b0593dd4fc6 ("dt-bindings: phy: Convert mixel,mipi-dsi-phy to json-schema") Signed-off-by: Alexander Stein Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230609071538.149712-1-alexander.stein@ew.tq-group.com Signed-off-by: Vinod Koul commit 0eac9e977283d1573aa8c1f614afbe807aae62d1 Author: Krzysztof Kozlowski Date: Tue May 30 16:48:45 2023 +0200 dt-bindings: phy: intel,combo-phy: restrict node name suffixes Make the pattern matching node names a bit stricter to improve DTS consistency. The pattern is restricted to: 1. Only one unit address or one -N suffix, 2. -N suffixes to decimal numbers. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Tony Lindgren Reviewed-by: Conor Dooley Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230530144851.92059-2-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit bc958b3adf9f83fd80e81fa723de955bb90c8eca Author: Rudraksha Gupta Date: Wed Jun 7 01:00:21 2023 -0400 dt-bindings: phy: qcom,usb-hs-phy: Add compatible Adds qcom,usb-hs-phy-msm8960 compatible Signed-off-by: Rudraksha Gupta Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230607050025.86636-3-guptarud@gmail.com Signed-off-by: Vinod Koul commit 44faada0f38fc333d392af04c343b0e23f8f5d81 Author: Claudiu Beznea Date: Wed May 31 10:39:50 2023 +0300 phy: tegra: xusb: check return value of devm_kzalloc() devm_kzalloc() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: f67213cee2b3 ("phy: tegra: xusb: Add usb-role-switch support") Signed-off-by: Claudiu Beznea Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20230531073950.145339-1-claudiu.beznea@microchip.com Signed-off-by: Vinod Koul commit b360cbd254fde61cb500a4a3ca2e65dff3dfa039 Author: YueHaibing Date: Tue Jun 20 17:45:19 2023 +0800 x86/acpi: Remove unused extern declaration acpi_copy_wakeup_routine() This is now unused, so can be removed. Signed-off-by: YueHaibing Signed-off-by: Dave Hansen Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/all/20230620094519.15300-1-yuehaibing%40huawei.com commit 7c8cb341fd6667bf2a3dc19c801500af2c92f3f0 Author: Krzysztof Kozlowski Date: Mon Jun 19 12:14:24 2023 +0200 dt-bindings: mfd: samsung,s5m8767: Simplify excluding properties Mutually exclusive s5m8767,pmic-buck[234]-uses-gpio-dvs properties can be written simpler, with half of the lines of code. Signed-off-by: Krzysztof Kozlowski Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230619101424.25897-1-krzysztof.kozlowski@linaro.org Signed-off-by: Lee Jones commit 0fac214bb75ee64d7b9e6521d53f8251a4d324ea Author: Arjan van de Ven Date: Tue Jun 20 18:03:54 2023 +0000 intel_idle: Add a "Long HLT" C1 state for the VM guest mode intel_idle will, for the bare metal case, usually have one or more deep power states that have the CPUIDLE_FLAG_TLB_FLUSHED flag set. When a state with this flag is selected by the cpuidle framework, it will also flush the TLBs as part of entering this state. The benefit of doing this is that the kernel does not need to wake the cpu out of this deep power state just to flush the TLBs... for which the latency can be very high due to the exit latency of deep power states. In a VM guest currently, this benefit of avoiding the wakeup does not exist, while the problem (long exit latency) is even more severe. Linux will need to wake up a vCPU (causing the host to either come out of a deep C state, or the VMM to have to deschedule something else to schedule the vCPU) which can take a very long time.. adding a lot of latency to tlb flush operations (including munmap and others). To solve this, add a "Long HLT" C state to the state table for the VM guest case that has the CPUIDLE_FLAG_TLB_FLUSHED flag set. The result of that is that for long idle periods (where the VMM is likely to do things that cause large latency) the cpuidle framework will flush the TLBs (and avoid the wakeups), while for short/quick idle durations, the existing behavior is retained. Now, there is still only "hlt" available in the guest, but for long idle, the host can go to a deeper state (say C6). There is a reasonable debate one can have to what to set for the exit_latency and break even point for this "Long HLT" state. The good news is that intel_idle has these values available for the underlying CPU (even when mwait is not exposed). The solution thus is to just use the latency and break even of the deepest state from the bare metal CPU. This is under the assumption that this is a pretty reasonable estimate of what the VMM would do to cause latency. Signed-off-by: Arjan van de Ven Signed-off-by: Rafael J. Wysocki commit 104d32bd81f620bb9f67fbf7d1159c414e89f05f Author: Christophe JAILLET Date: Sat Jun 17 12:43:16 2023 +0200 mfd: stmpe: Only disable the regulators if they are enabled In stmpe_probe(), if some regulator_enable() calls fail, probing continues and there is only a dev_warn(). So, if stmpe_probe() is called the regulator may not be enabled. It is cleaner to test it before calling regulator_disable() in the remove function. Fixes: 9c9e321455fb ("mfd: stmpe: add optional regulators") Signed-off-by: Christophe JAILLET Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/8de3aaf297931d655b9ad6aed548f4de8b85425a.1686998575.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones commit 03f44ffb3d5be2fceda375d92c70ab6de4df7081 Author: Tero Kristo Date: Wed Jun 21 09:58:39 2023 +0300 cpufreq: intel_pstate: Fix energy_performance_preference for passive If the intel_pstate driver is set to passive mode, then writing the same value to the energy_performance_preference sysfs twice will fail. This is caused by the wrong return value used (index of the matched energy_perf_string), instead of the length of the passed in parameter. Fix by forcing the internal return value to zero when the same preference is passed in by user. This same issue is not present when active mode is used for the driver. Fixes: f6ebbcf08f37 ("cpufreq: intel_pstate: Implement passive mode with HWP enabled") Reported-by: Niklas Neronin Signed-off-by: Tero Kristo Signed-off-by: Rafael J. Wysocki commit 724ba6751532055db75992fc6ae21c3e322e94a7 Author: Rob Herring Date: Thu May 4 18:38:52 2023 -0500 ARM: dts: Move .dts files to vendor sub-directories The arm dts directory has grown to 1559 boards which makes it a bit unwieldy to maintain and use. Past attempts stalled out due to plans to move .dts files out of the kernel tree. Doing that is no longer planned (any time soon at least), so let's go ahead and group .dts files by vendors. This move aligns arm with arm64 .dts file structure. There's no change to dtbs_install as the flat structure is maintained on install. The naming of vendor directories is roughly in this order of preference: - Matching original and current SoC vendor prefix/name (e.g. ti, qcom) - Current vendor prefix/name if still actively sold (SoCs which have been aquired) (e.g. nxp/imx) - Existing platform name for older platforms not sold/maintained by any company (e.g. gemini, nspire) The whole move was scripted with the exception of MAINTAINERS and a few makefile fixups. Acked-by: Viresh Kumar Acked-by: Michal Simek #Xilinx Acked-by: Krzysztof Kozlowski Acked-by: Neil Armstrong Acked-by: Paul Barker Acked-by: Tony Lindgren Acked-by: Gregory CLEMENT Acked-by: Heiko Stuebner Acked-by: Wei Xu #hisilicon Acked-by: Geert Uytterhoeven Acked-by: Nick Hawkins Acked-by: Baruch Siach Reviewed-by: Linus Walleij Reviewed-by: Andre Przywara Acked-by: Andre Przywara Reviewed-by: Claudiu Beznea Acked-by: Peter Rosin Acked-by: Jesper Nilsson Acked-by: Sudeep Holla Acked-by: Florian Fainelli #broadcom Acked-by: Manivannan Sadhasivam Reviewed-by: Jisheng Zhang Acked-by: Patrice Chotard Acked-by: Romain Perier Acked-by: Alexandre TORGUE Acked-by: Shawn Guo Acked-by: Kunihiko Hayashi Acked-by: Enric Balletbo i Serra Signed-off-by: Rob Herring commit f0fb7651ba847df52638f5d47cb98b379dca58a2 Author: Rob Herring Date: Tue Jun 13 14:10:22 2023 -0600 dt-bindings: backlight: kinetic,ktz8866: Add missing type for "current-num-sinks" "current-num-sinks" is missing a type, add it. Signed-off-by: Rob Herring Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230613201022.2823392-1-robh@kernel.org Signed-off-by: Lee Jones commit e0cbc202388af454eb771043b20db6dfe68199ec Author: Okan Sahin Date: Wed Apr 12 14:12:46 2023 +0300 mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support MFD driver for MAX77541/MAX77540 to enable its sub devices. The MAX77541 is a multi-function devices. It includes buck converter and ADC. The MAX77540 is a high-efficiency buck converter with two 3A switching phases. They have same regmap except for ADC part of MAX77541. Signed-off-by: Okan Sahin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230412111256.40013-6-okan.sahin@analog.com Signed-off-by: Lee Jones commit 360da60d6c6edb9740de7a8e6d8969d62ceff956 Author: Selvin Xavier Date: Tue Jun 13 11:12:23 2023 -0700 RDMA/bnxt_re: Enable low latency push Introduce driver specific uapi functionalites. Added a alloc_page functionality for user library to allocate specific pages. Currently added support for allocating write combine pages for push functinality. This interface shall be extended for other page allocations. Allocate a WC page using the uapi hook for enabling the low latency push in Gen P5 adapters for small packets. This is supported only for the user space QPs. Link: https://lore.kernel.org/r/1686679943-17117-8-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 0ac20faf5d837b59fb4c041ea320932ed47fd67f Author: Selvin Xavier Date: Tue Jun 13 11:12:22 2023 -0700 RDMA/bnxt_re: Reorg the bar mapping Reorganize the code for allocation and mapping of Doorbell pages. Implements new HW command to get the BAR length used by L2 driver. These changes are used by the future patch which maps the WC Doorbell pages. Also, introduced a new lock dpi_tbl_lock for synchronize the DB page allocation from users. Link: https://lore.kernel.org/r/1686679943-17117-7-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 3fe9882fbb50eeb724504df5979e9140f8842f76 Author: Selvin Xavier Date: Tue Jun 13 11:12:21 2023 -0700 RDMA/bnxt_re: Move the interface version to chip context structure FW interface version check is required for multiple features. Moving the interface version to chip context structure. Link: https://lore.kernel.org/r/1686679943-17117-6-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit ba75fe7b500e71aff8bc3b7096c4ce1dcc649eb3 Author: Selvin Xavier Date: Tue Jun 13 11:12:20 2023 -0700 RDMA/bnxt_re: Query function capabilities from firmware Query Function capabilities to enable advanced features. Link: https://lore.kernel.org/r/1686679943-17117-5-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 7d3115eba3e3eef6e0cbe65f05285c5ab28360d7 Author: Selvin Xavier Date: Tue Jun 13 11:12:19 2023 -0700 RDMA/bnxt_re: Optimize the bnxt_re_init_hwrm_hdr usage As of now bnxt_re_init_hwrm_hdr is taking only the opcode from the caller. compl_ring and target_id field is always -1. These fields might be changed when newer features are added. For now, removing these parameters as they are hard coded. Also, remove the rdev field which is not used. Also, initialize the structure bnxt_fw_msg during declaration itself. Link: https://lore.kernel.org/r/1686679943-17117-4-git-send-email-selvin.xavier@broadcom.com Suggested-by: Leon Romanovsky Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 390bf429cc6ce6844f834b1d9ddfbc1125aff1fc Author: Selvin Xavier Date: Tue Jun 13 11:12:18 2023 -0700 RDMA/bnxt_re: Add disassociate ucontext support Add driver disassociation support. Driver uses the APIs rdma_user_mmap_io api while mapping the IO pages to user space. Add empty stub for disassociate ucontext. Link: https://lore.kernel.org/r/1686679943-17117-3-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 24ce94782c4878fe25ff15d8c08088a6ca5810e1 Author: Selvin Xavier Date: Tue Jun 13 11:12:17 2023 -0700 RDMA/bnxt_re: Use the common mmap helper functions Replace the mmap handling function with common code in IB core. Create rdma_user_mmap_entry for each mmap resource and add to the ib_core mmap list. Add mmap_free verb support. Also, use rdma_user_mmap_io while mapping Doorbell pages. Link: https://lore.kernel.org/r/1686679943-17117-2-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 147394dbe1237ef1f2da528c238633215f7193e1 Author: Leon Romanovsky Date: Tue Jun 13 11:15:57 2023 +0300 RDMA/bnxt_re: Initialize opcode while sending message Fix compilation warning: drivers/infiniband/hw/bnxt_re/qplib_rcfw.c:325:18: error: variable 'opcode' is uninitialized when used here [-Werror,-Wuninitialized] crsqe->opcode = opcode; ^~~~~~ drivers/infiniband/hw/bnxt_re/qplib_rcfw.c:291:11: note: initialize the variable 'opcode' to silence this warning u8 opcode; ^ = '\0' Fixes: bcfee4ce3e01 ("RDMA/bnxt_re: remove redundant cmdq_bitmap") Link: https://lore.kernel.org/r/6ad1e44be2b560986da6fdc6b68da606413e9026.1686644105.git.leonro@nvidia.com Acked-by: Selvin Xavier Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit c88ad30e3f861c7be4e3b4995554e2b0754059b7 Author: Mario Limonciello Date: Tue Jun 20 12:24:33 2023 -0500 cpufreq: amd-pstate: Add a kernel config option to set default mode Users are having more success with amd-pstate since the introduction of EPP and Guided modes. To expose the driver to more users by default introduce a kernel configuration option for setting the default mode. Users can use an integer to map out which default mode they want to use in lieu of a kernel command line option. This will default to EPP, but only if: 1) The CPU supports an MSR. 2) The system profile is identified 3) The system profile is identified as a non-server by the FADT. Link: https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/merge_requests/121 Acked-by: Huang Rui Reviewed-by: Gautham R. Shenoy Co-developed-by: Perry Yuan Signed-off-by: Perry Yuan Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 32f80b9adfdb43f8af248596724f59dde938a190 Author: Mario Limonciello Date: Tue Jun 20 12:24:32 2023 -0500 cpufreq: amd-pstate: Set a fallback policy based on preferred_profile If a user's configuration doesn't explicitly specify the cpufreq scaling governor then the code currently explicitly falls back to 'powersave'. This default is fine for notebooks and desktops, but servers and undefined machines should default to 'performance'. Look at the 'preferred_profile' field from the FADT to set this policy accordingly. Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#fixed-acpi-description-table-fadt Acked-by: Huang Rui Suggested-by: Wyes Karny Reviewed-by: Gautham R. Shenoy Signed-off-by: Mario Limonciello Reviewed-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit 965262ef71c475857d0984a5eee57694b207a113 Author: Mario Limonciello Date: Tue Jun 20 12:24:31 2023 -0500 ACPI: CPPC: Add definition for undefined FADT preferred PM profile value In the event a new preferred PM profile value is introduced it's best for code to be able to defensively guard against it so that the wrong settings don't get applied on a new system that uses this profile but ancient kernels. Acked-by: Huang Rui Suggested-by: Gautham Ranjal Shenoy Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#fixed-acpi-description-table-fadt Signed-off-by: Mario Limonciello Reviewed-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit 9d16d264775b9a10f3f5b5db768d7f51294b2a63 Author: Christophe JAILLET Date: Thu Apr 27 21:47:45 2023 +0200 nvmet: Reorder fields in 'struct nvmet_ns' Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nvmet_ns' from 520 to 512 bytes. When such a structure is allocated in nvmet_ns_alloc(), because of the way memory allocation works, when 520 bytes were requested, 1024 bytes were allocated. So, on x86_64, this change saves 512 bytes per allocation. Signed-off-by: Christophe JAILLET Reviewed-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Reviewed-by: Jens Axboe Signed-off-by: Keith Busch commit d0dd594bedc57f9be2af2af170bf56f9c3f2376e Author: Breno Leitao Date: Thu Jun 15 02:49:03 2023 -0700 nvme: Print capabilities changes just once This current dev_info() could be very verbose and being printed very frequently depending on some userspace application sending some specific commands. Just print this message once and skip it until the controller resets. Use a controller flag (NVME_CTRL_DIRTY_CAPABILITY) to track if the capability needs a reset. Signed-off-by: Breno Leitao Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Keith Busch commit 724418b84e6248cd27599607b7e5fac365b8e3f5 Author: Matthew Anderson Date: Wed Jun 21 11:17:14 2023 -0500 ALSA: hda/realtek: Add quirks for ROG ALLY CS35l41 audio This requires a patched ACPI table or a firmware from ASUS to work because the system does not come with the _DSD field for the CSC3551. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217550 Signed-off-by: Matthew Anderson Tested-by: Philip Mueller Link: https://lore.kernel.org/r/20230621161714.9442-1-ruinairas1992@gmail.com Signed-off-by: Takashi Iwai commit ff399bab86382c896c3922a570884bba287eb465 Author: Wei Chen Date: Wed Jun 21 12:43:23 2023 +0000 usb: gadget: legacy: fix error return code in gfs_bind We must return negative error code -ENOMEM if function 'usb_otg_descriptor_alloc()' fails. Signed-off-by: Wei Chen Link: https://lore.kernel.org/r/20230621124323.47183-1-harperchen1110@gmail.com Signed-off-by: Greg Kroah-Hartman commit ef1e29c6f6ad1e327d07b078e37a1eddd832e8e4 Author: Neil Armstrong Date: Wed Jun 14 15:10:41 2023 +0200 usb: typec: fsa4480: add support for Audio Accessory Mode The FSA4480 Type-C switch supports switching the Audio R/L, AGND and MIC signals to the USB-C DP/DM and SBU1/2 to support the Audio Accessory Mode. The FSA4480 has an integrated Audio jack detection mechanism to automatically mux the AGND, MIX and Sense to the correct SBU lines to support 3 pole and both 4 pole TRRS pinouts. Signed-off-by: Neil Armstrong Tested-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230614-topic-sm8550-upstream-type-c-audio-v1-3-15a92565146b@linaro.org Signed-off-by: Greg Kroah-Hartman commit c7054c31c1c94dbfe0ddf7c327f72f020d47c6c9 Author: Neil Armstrong Date: Wed Jun 14 15:10:40 2023 +0200 usb: typec: fsa4480: rework mux & switch setup to handle more states In order to handle the Audio Accessory mode, refactor the mux and switch setup in a single function. The refactor will help add new states and make the process simpler to understand. Signed-off-by: Neil Armstrong Tested-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230614-topic-sm8550-upstream-type-c-audio-v1-2-15a92565146b@linaro.org Signed-off-by: Greg Kroah-Hartman commit 25a2bc21c86392223142dcbd5bc92e598a950678 Author: Neil Armstrong Date: Wed Jun 14 15:10:39 2023 +0200 usb: typec: ucsi: call typec_set_mode on non-altmode partner change Add support for calling typec_set_mode() for the DEBUG, AUDIO accessory modes. Let's also call typec_set_mode() for USB as default and SAFE when partner is disconnected. The USB state is only called when ALT mode is specifically not specified by the partner status flags in order to leave the altmode handlers setup the proper mode to switches, muxes and retimers. Signed-off-by: Neil Armstrong Tested-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230614-topic-sm8550-upstream-type-c-audio-v1-1-15a92565146b@linaro.org Signed-off-by: Greg Kroah-Hartman commit aed1a2a5a6a2aa67095c103b497d05cd322c8713 Merge: 99f2d956e1fa3 481012b479fe6 Author: Greg Kroah-Hartman Date: Wed Jun 21 18:02:00 2023 +0200 Merge tag 'thunderbolt-for-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next Mika writes: thunderbolt: Changes for v6.5 merge window This includes following Thunderbolt/USB4 changes for the v6.5 merge window: - Improve debug logging - Rework for TMU and CL states handling - Retimer access improvements - Initial support for USB4 v2 features: * 80G symmetric link support * New notifications * PCIe extended encapsulation * enhanced uni-directional TMU mode * CL2 link low power state * DisplayPort 2.x tunneling - Support for Intel Barlow Ridge Thunderbolt/USB4 controller - Minor fixes and improvements. All these have been in linux-next with no reported issues. * tag 'thunderbolt-for-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: (55 commits) thunderbolt: Add test case for 3 DisplayPort tunnels thunderbolt: Add DisplayPort 2.x tunneling support thunderbolt: Make bandwidth allocation mode function names consistent thunderbolt: Enable CL2 low power state thunderbolt: Add support for enhanced uni-directional TMU mode thunderbolt: Increase NVM_MAX_SIZE to support Intel Barlow Ridge controller thunderbolt: Move constants related to NVM into nvm.c thunderbolt: Limit Intel Barlow Ridge USB3 bandwidth thunderbolt: Add Intel Barlow Ridge PCI ID thunderbolt: Fix PCIe adapter capability length for USB4 v2 routers thunderbolt: Fix DisplayPort IN adapter capability length for USB4 v2 routers thunderbolt: Add two additional double words for adapters TMU for USB4 v2 routers thunderbolt: Enable USB4 v2 PCIe TLP/DLLP extended encapsulation thunderbolt: Announce USB4 v2 connection manager support thunderbolt: Reset USB4 v2 host router thunderbolt: Add the new USB4 v2 notification types thunderbolt: Add support for USB4 v2 80 Gb/s link thunderbolt: Identify USB4 v2 routers thunderbolt: Do not touch lane 1 adapter path config space thunderbolt: Ignore data CRC mismatch for USB4 routers ... commit e534755c9412be07f579acd2947401a9f87a33c8 Author: Jiri Slaby Date: Wed Jun 21 12:16:11 2023 +0200 tty_audit: make data of tty_audit_log() const 'data' are only read (passed down to audit_log_n_hex()), so they can be const -- the same what is expected in audit_log_n_hex(). Only a minor cleanup to be consistent. Signed-off-by: Jiri Slaby (SUSE) Link: https://lore.kernel.org/r/20230621101611.10580-7-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit e64ed44bce43e003dd154c0bc418a431c15bdf77 Author: Jiri Slaby Date: Wed Jun 21 12:16:10 2023 +0200 tty_audit: make tty pointers in exposed functions const Both tty_audit_add_data() and tty_audit_tiocsti() need only to read from the tty struct, so make the tty parameters of them both const. This aids the compiler a bit. Signed-off-by: Jiri Slaby (SUSE) Link: https://lore.kernel.org/r/20230621101611.10580-6-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 3e540a7bad8534a9b8845defa051834c9694d86c Author: Jiri Slaby Date: Wed Jun 21 12:16:09 2023 +0200 tty_audit: make icanon a bool Use bool for tty_audit_buf::icanon in favor of ugly bitfields. And get rid of "!!" as that is completely unnecessary. Signed-off-by: Jiri Slaby (SUSE) Link: https://lore.kernel.org/r/20230621101611.10580-5-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 94f94810efc4b4b337c9f2abc8b0188cef5ccb9b Author: Jiri Slaby Date: Wed Jun 21 12:16:08 2023 +0200 tty_audit: invert the condition in tty_audit_log() If we cannot obtain an audit buffer in tty_audit_log(), simply return from the function. Apart this is mostly preferred in the kernel, it allows to merge the split audit string while still keeping it readable. Signed-off-by: Jiri Slaby (SUSE) Link: https://lore.kernel.org/r/20230621101611.10580-4-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit e1488513abee9f34a7d0f3bd57ee65d2a7e13426 Author: Jiri Slaby Date: Wed Jun 21 12:16:07 2023 +0200 tty_audit: use kzalloc() in tty_audit_buf_alloc() tty_audit_buf_alloc() manually erases most of the entries after kmalloc(). So use kzalloc() and remove the manual sets to zero. That way, we are sure that we do not omit anything. Signed-off-by: Jiri Slaby (SUSE) Link: https://lore.kernel.org/r/20230621101611.10580-3-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 777e456852f729fa2942187a43a8eafbaecc6876 Author: Jiri Slaby Date: Wed Jun 21 12:16:06 2023 +0200 tty_audit: use TASK_COMM_LEN for task comm This is the preferred way of declaring an array for get_task_comm(). Signed-off-by: Jiri Slaby (SUSE) Link: https://lore.kernel.org/r/20230621101611.10580-2-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit a82d62f708545d22859584e0e0620da8e3759bbc Author: Jiaqing Zhao Date: Mon Jun 19 15:57:44 2023 +0000 Revert "8250: add support for ASIX devices with a FIFO bug" This reverts commit eb26dfe8aa7eeb5a5aa0b7574550125f8aa4c3b3. Commit eb26dfe8aa7e ("8250: add support for ASIX devices with a FIFO bug") merged on Jul 13, 2012 adds a quirk for PCI_VENDOR_ID_ASIX (0x9710). But that ID is the same as PCI_VENDOR_ID_NETMOS defined in 1f8b061050c7 ("[PATCH] Netmos parallel/serial/combo support") merged on Mar 28, 2005. In pci_serial_quirks array, the NetMos entry always takes precedence over the ASIX entry even since it was initially merged, code in that commit is always unreachable. In my tests, adding the FIFO workaround to pci_netmos_init() makes no difference, and the vendor driver also does not have such workaround. Given that the code was never used for over a decade, it's safe to revert it. Also, the real PCI_VENDOR_ID_ASIX should be 0x125b, which is used on their newer AX99100 PCIe serial controllers released on 2016. The FIFO workaround should not be intended for these newer controllers, and it was never implemented in vendor driver. Fixes: eb26dfe8aa7e ("8250: add support for ASIX devices with a FIFO bug") Cc: stable Signed-off-by: Jiaqing Zhao Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230619155743.827859-1-jiaqing.zhao@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 27a826837ec9a3e94cc44bd9328b8289b0fcecd7 Author: Dan Carpenter Date: Mon Jun 19 12:45:17 2023 +0300 serial: atmel: don't enable IRQs prematurely The atmel_complete_tx_dma() function disables IRQs at the start of the function by calling spin_lock_irqsave(&port->lock, flags); There is no need to disable them a second time using the spin_lock_irq() function and, in fact, doing so is a bug because it will enable IRQs prematurely when we call spin_unlock_irq(). Just use spin_lock/unlock() instead without disabling or enabling IRQs. Fixes: 08f738be88bb ("serial: at91: add tx dma support") Signed-off-by: Dan Carpenter Reviewed-by: Jiri Slaby Acked-by: Richard Genoud Link: https://lore.kernel.org/r/cb7c39a9-c004-4673-92e1-be4e34b85368@moroto.mountain Cc: stable Signed-off-by: Greg Kroah-Hartman commit a1e72bb00a48687a1dc1c2e549eaf4ba09e802be Author: Costa Shulyupin Date: Sun Jun 18 09:29:37 2023 +0300 docs: consolidate storage interfaces to make the page more organized as requested Signed-off-by: Costa Shulyupin Acked-by: Randy Dunlap Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230618062937.481280-1-costa.shul@redhat.com commit 944ee77dc6ec7b0afd8ec70ffc418b238c92f12b Author: Ludvig Michaelsson Date: Wed Jun 21 13:17:43 2023 +0200 HID: hidraw: fix data race on device refcount The hidraw_open() function increments the hidraw device reference counter. The counter has no dedicated synchronization mechanism, resulting in a potential data race when concurrently opening a device. The race is a regression introduced by commit 8590222e4b02 ("HID: hidraw: Replace hidraw device table mutex with a rwsem"). While minors_rwsem is intended to protect the hidraw_table itself, by instead acquiring the lock for writing, the reference counter is also protected. This is symmetrical to hidraw_release(). Link: https://github.com/systemd/systemd/issues/27947 Fixes: 8590222e4b02 ("HID: hidraw: Replace hidraw device table mutex with a rwsem") Cc: stable@vger.kernel.org Signed-off-by: Ludvig Michaelsson Link: https://lore.kernel.org/r/20230621-hidraw-race-v1-1-a58e6ac69bab@yubico.com Signed-off-by: Benjamin Tissoires commit 2bb19e740e9b3eb42e5effcb0ad52a85433c1258 Author: Johannes Berg Date: Mon Jun 19 11:55:34 2023 +0200 Documentation: update git configuration for Link: tag The latest version of git (2.41.0) changed the spelling of Message-Id to Message-ID. Adjust the perl script here to accept both spellings. Signed-off-by: Johannes Berg Tested-by: Greg Kroah-Hartman Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230619115533.981f6abaca01.I1960c39b1d61e8514afcef4806a450a209133187@changeid commit 9a096a813ac29ea6a92f21b8519e36e15fe5843f Author: Tim Harvey Date: Mon Jun 12 09:24:44 2023 -0700 dt-bindings: mfd: gateworks-gsc: Remove unnecessary fan-controller nodes Remove the unnecessary #address-cells and #size-cells nodes from the fan-controller. These are not needed as the fan controller does not have any children. Signed-off-by: Tim Harvey Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230612162444.3936302-1-tharvey@gateworks.com Signed-off-by: Lee Jones commit 39138093f139c5d03e852c49cc52339543922308 Author: Mark Rutland Date: Fri Jun 16 11:31:50 2023 +0100 arm64: alternatives: make clean_dcache_range_nopatch() noinstr-safe When patching kernel alternatives, we need to be careful not to execute kernel code which is itself subject to patching. In general, if code is executed after the instructions in memory have been patched but prior to the cache maintenance and barriers completing, it could lead to UNPREDICTABLE results. As our regular cache maintenance routines are patched with alternatives, we have a clean_dcache_range_nopatch() function which is *intended* to avoid patchable code and therefore supposed to be safe in the middle of patching alternatives. Unfortunately, it's not marked as 'noinstr', and so can be instrumented with patchable code. Additionally, it calls read_sanitised_ftr_reg() (which may be instrumented with patchable code) to find the sanitized value of CTR_EL0.DminLine, and is therefore not safe to call during patching. Luckily, since commit: 675b0563d6b26aa9 ("arm64: cpufeature: expose arm64_ftr_reg struct for CTR_EL0") ... we can read the sanitised CTR_EL0 value directly, and avoid the call to read_sanitised_ftr_reg(). This patch marks clean_dcache_range_nopatch() as noinstr, and has it read the sanitized CTR_EL0 value directly, avoiding the issues above. As a bonus, this is also an optimization. As read_sanitised_ftr_reg() performs a binary search to find the CTR_EL0 value, reading the value directly avoids this binary search per applied alternative, avoiding some unnecessary work. Signed-off-by: Mark Rutland Cc: Will Deacon Link: https://lore.kernel.org/r/20230616103150.1238132-1-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit f40f97aaf7fa6222f4ec073c24fb14f04ffb6f80 Author: Jonathan Corbet Date: Mon Jun 12 06:13:47 2023 -0600 perf arm-spe: Fix a dangling Documentation/arm64 reference The arm64 documentation has moved under Documentation/arch/. Fix up a dangling reference to match. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Acked-by: Catalin Marinas Acked-by: Arnaldo Carvalho de Melo Signed-off-by: Jonathan Corbet commit c30034054a1ad394273f3fffe14752f83251600a Author: Jonathan Corbet Date: Mon Jun 12 06:12:24 2023 -0600 mm: Fix a dangling Documentation/arm64 reference The arm64 documentation has moved under Documentation/arch/. Fix up a reference in mm/mremap.c to match. Cc: Andrew Morton Cc: linux-mm@kvack.org Acked-by: Mike Rapoport (IBM) Acked-by: Catalin Marinas Signed-off-by: Jonathan Corbet commit 6e4596c4038adfcf52d0dc37ba9cb505c4afaa65 Author: Jonathan Corbet Date: Mon Jun 12 06:10:53 2023 -0600 arm64: Fix dangling references to Documentation/arm64 The arm64 documentation has moved under Documentation/arch/; fix up references in the arm64 subtree to match. Cc: Will Deacon Cc: Ard Biesheuvel Cc: linux-efi@vger.kernel.org Acked-by: Catalin Marinas Signed-off-by: Jonathan Corbet commit a0468d4efc0e9f268e362d6840c84107703bd24e Author: Jonathan Corbet Date: Mon Jun 12 06:08:41 2023 -0600 dt-bindings: fix dangling Documentation/arm64 reference The arm64 documentation has move under Documentation/arch/ fix a reference to match. Cc: Krzysztof Kozlowski Cc: Conor Dooley Cc: devicetree@vger.kernel.org Acked-by: Catalin Marinas Acked-by: Rob Herring Signed-off-by: Jonathan Corbet commit e4624435f38b34e7ce827070aa0f8b533a37c07e Author: Jonathan Corbet Date: Mon Jun 12 06:06:39 2023 -0600 docs: arm64: Move arm64 documentation under Documentation/arch/ Architecture-specific documentation is being moved into Documentation/arch/ as a way of cleaning up the top-level documentation directory and making the docs hierarchy more closely match the source hierarchy. Move Documentation/arm64 into arch/ (along with the Chinese equvalent translations) and fix up documentation references. Cc: Will Deacon Cc: Alex Shi Cc: Hu Haowen Cc: Paolo Bonzini Acked-by: Catalin Marinas Reviewed-by: Yantengsi Signed-off-by: Jonathan Corbet commit 07edc32779e3dfe164970fc254291258277219c9 Author: Conor Dooley Date: Wed Jun 7 21:28:31 2023 +0100 RISC-V: always report presence of extensions formerly part of the base ISA Of these four extensions, two were part of the base ISA when the port was written and are required by the kernel. The other two are implied when `i` is in riscv,isa on DT systems. There's not much that userspace can do with this extra information, but there is no harm in reporting an ISA string that closer resembles the current versions of the specifications either. Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20230607-nest-collision-5796b6be8be6@spud Signed-off-by: Palmer Dabbelt commit 1e5cae98e46d15f4dc7c675e1bd0ed2172ea181c Author: Conor Dooley Date: Wed Jun 7 21:28:30 2023 +0100 dt-bindings: riscv: explicitly mention assumption of Zicntr & Zihpm support Similar to commit 41ebfc91f785 ("dt-bindings: riscv: explicitly mention assumption of Zicsr & Zifencei support"), the Zicntr and Zihpm extensions also used to be part of the base ISA but were removed after the bindings were merged. Document the assumption of their presence in the base ISA. Suggested-by: Palmer Dabbelt Signed-off-by: Conor Dooley Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230607-rerun-retinal-5e8ba89e98f1@spud Signed-off-by: Palmer Dabbelt commit 7816ebc1ddd16b5cc95febb75f778bf88411a365 Author: Conor Dooley Date: Wed Jun 7 21:28:29 2023 +0100 RISC-V: remove decrement/increment dance in ISA string parser While expanding on the comments in the ISA string parsing code, I noticed that the conditional decrement of `isa` at the end of the loop was a bit odd. The parsing code expects that at the start of the for loop, `isa` will point to the first character of the next unparsed extension. However, depending on what the next extension is, this may not be true. Unless the next extension is a multi-letter extension preceded by an underscore, `isa` will either point to the string's null-terminator or to the first character of the next extension, once the switch statement has been evaluated. Obviously incrementing `isa` at the end of the loop could cause it to increment past the null terminator or miss a single letter extension, so `isa` is conditionally decremented, just so that the loop can increment it again. It's easier to understand the code if, instead of this decrement + increment dance, we instead use a while loop & rely on the handling of individual extension types to leave `isa` pointing to the first character of the next extension. As already mentioned, this won't be the case where the following extension is multi-letter & preceded by an underscore. To handle that, invert the check and increment rather than decrement. Hopefully this eliminates a "huh?!?" moment the next time somebody tries to understand this code. Reviewed-by: Andrew Jones Signed-off-by: Conor Dooley Reviewed-by: Sunil V L Link: https://lore.kernel.org/r/20230607-estate-left-f20faabefb89@spud Signed-off-by: Palmer Dabbelt commit 6b913e3da87da1be57096c068b4d2e7d4b31f457 Author: Conor Dooley Date: Wed Jun 7 21:28:28 2023 +0100 RISC-V: rework comments in ISA string parser I have found these comments to not be at all helpful whenever I look at the parser. Further, the comments in the default case (single letter parser) are not quite right either. Group the comments into a larger one at the start of each case, that attempts to explain things at a higher level. Reviewed-by: Andrew Jones Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20230607-headpiece-tannery-83ed5cc4856a@spud Signed-off-by: Palmer Dabbelt commit 069b0d51707721d5ab2001df866b66b82e4c1c35 Author: Conor Dooley Date: Wed Jun 7 21:28:27 2023 +0100 RISC-V: validate riscv,isa at boot, not during ISA string parsing Since riscv_fill_hwcap() now only iterates over possible cpus, the basic validation of whether riscv,isa contains "rv" can be moved to riscv_early_of_processor_hartid(). Further, "ima" support is required by the kernel, so reject any CPU not fitting the bill. Reviewed-by: Andrew Jones Signed-off-by: Conor Dooley Reviewed-by: Sunil V L Link: https://lore.kernel.org/r/20230607-guts-blurry-67e711acf328@spud Signed-off-by: Palmer Dabbelt commit 2ac874343749b76e069cff5fea09c49e0bd365a0 Author: Conor Dooley Date: Wed Jun 7 21:28:26 2023 +0100 RISC-V: split early & late of_node to hartid mapping Some back and forth with Drew [1] about riscv_fill_hwcap() resulted in the realisation that it is not very useful to parse the DT & perform validation of riscv,isa every time we would like to get the id for a hart. Although it is no longer called in riscv_fill_hwcap(), riscv_of_processor_hartid() is called in several other places. Notably in setup_smp() it forms part of the logic for filling the mask of possible CPUs. Since a possible CPU must have passed this basic validation of riscv,isa, a repeat validation is not required. Rename riscv_of_processor_id() to riscv_early_of_processor_id(), which will be called from setup_smp() & introduce a new riscv_of_processor_id() which makes use of the pre-populated mask of possible cpus. Link: https://lore.kernel.org/linux-riscv/xvdswl3iyikwvamny7ikrxo2ncuixshtg3f6uucjahpe3xpc5c@ud4cz4fkg5dj/ [1] Reviewed-by: Andrew Jones Signed-off-by: Conor Dooley Reviewed-by: Sunil V L Link: https://lore.kernel.org/r/20230607-glade-pastel-d8cbd9d9f3c6@spud Signed-off-by: Palmer Dabbelt commit fed14be476f075a523fd4addfee07cb2f8dc1971 Author: Conor Dooley Date: Wed Jun 7 21:28:25 2023 +0100 RISC-V: simplify register width check in ISA string parsing Saving off the `isa` pointer to a temp variable, followed by checking if it has been incremented is a bit of an odd pattern. Perhaps it was done to avoid a funky looking if statement mixed with the ifdeffery. Now that we use IS_ENABLED() here just return from the parser as soon as we detect a mismatch between the string and the currently running kernel. Reviewed-by: Andrew Jones Signed-off-by: Conor Dooley Reviewed-by: Sunil V L Link: https://lore.kernel.org/r/20230607-splatter-bacterium-a75bb9f0d0b7@spud Signed-off-by: Palmer Dabbelt commit cc75549548482ed653c23f212544e58cb38ea980 Author: Horatiu Vultur Date: Thu Jun 15 11:47:40 2023 +0200 net: micrel: Change to receive timestamp in the frame for lan8841 Currently for each timestamp frame, the SW needs to go and read the received timestamp over the MDIO bus. But the HW has the capability to store the received nanoseconds part and the least significant two bits of the seconds in the reserved field of the PTP header. In this way we could save few MDIO transactions (actually a little more transactions because the access to the PTP registers are indirect) for each received frame. Instead of reading the rest of seconds part of the timestamp of the frame using MDIO transactions schedule PTP worker thread to read the seconds part every 500ms and then for each of the received frames use this information. Because if for example running with 512 frames per second, there is no point to read 512 times the second part. Doing all these changes will give a great CPU usage performance. Running ptp4l with logSyncInterval of -9 will give a ~60% CPU improvement. Signed-off-by: Horatiu Vultur Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 6a1d798feb65d2a67e6e2cafb0b0e4f430603226 Author: Rob Herring Date: Thu Dec 6 10:29:51 2018 -0600 kbuild: Support flat DTBs install In preparation to move Arm .dts files into sub-directories grouped by vendor/family, the current flat tree of DTBs generated by dtbs_install needs to be maintained. Moving the installed DTBs to sub-directories would break various consumers using 'make dtbs_install'. This is a NOP until sub-directories are introduced. Signed-off-by: Rob Herring commit 86684c2481b6e6a46c2282acee13554e34e66071 Author: Rob Herring Date: Tue May 2 12:25:29 2023 -0500 ARM: dts: Add .dts files missing from the build Comparing .dts files to built .dtb files yielded a few .dts files which are never built. Add them to the build. Signed-off-by: Rob Herring commit ca2fb05cb7e41d7f8b7399adbc2e71016483efad Author: Rob Herring Date: Tue May 2 12:02:42 2023 -0500 ARM: dts: allwinner: Use quoted #include In preparation to move .dts files into subdirectories, include sunxi-h3-h5-emlid-neutis.dtsi from the current directory rather than the symlinked include path. Reviewed-by: Andre Przywara Signed-off-by: Rob Herring commit 2293cae703cda162684ae966db6b1b4a11b5e88f Author: Ming Lei Date: Wed Jun 21 21:22:08 2023 +0800 blk-mq: don't insert passthrough request into sw queue In case of real io scheduler, q->elevator is set, so blk_mq_run_hw_queue() may just check if scheduler queue has request to dispatch, see __blk_mq_sched_dispatch_requests(). Then IO hang may be caused because all passthorugh requests may stay in sw queue. And any passthrough request should have been inserted to hctx->dispatch always. Reported-by: Guangwu Zhang Fixes: d97217e7f024 ("blk-mq: don't queue plugged passthrough requests into scheduler") Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230621132208.1142318-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 72ef02b8dfa009029fa713e8a731a92d27d14e35 Author: Ivan Orlov Date: Tue Jun 20 20:01:33 2023 +0200 bsg: make bsg_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the bsg_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: FUJITA Tomonori Cc: Jens Axboe Cc: linux-scsi@vger.kernel.org Cc: linux-block@vger.kernel.org Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230620180129.645646-8-gregkh@linuxfoundation.org Signed-off-by: Jens Axboe commit 2eefd399d28a52739fdbeebe84775275f016171c Author: Ivan Orlov Date: Tue Jun 20 20:01:32 2023 +0200 ublk: make ublk_chr_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the ublk_chr_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Ming Lei Cc: Jens Axboe Cc: linux-block@vger.kernel.org Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230620180129.645646-7-gregkh@linuxfoundation.org Signed-off-by: Jens Axboe commit 65d7a37d4e3e226bb4a4ddf73a827d0dbc77f530 Author: Ivan Orlov Date: Tue Jun 20 20:01:31 2023 +0200 aoe: make aoe_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the aoe_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Justin Sanders Cc: Jens Axboe Cc: linux-block@vger.kernel.org Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230620180129.645646-6-gregkh@linuxfoundation.org Signed-off-by: Jens Axboe commit 137380c0ec40710cbaf57c7878726c41a6da81cd Author: Ivan Orlov Date: Tue Jun 20 20:01:30 2023 +0200 block/rnbd: make all 'class' structures const Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Cc: "Md. Haris Iqbal" Cc: Jack Wang Cc: Jens Axboe Cc: linux-block@vger.kernel.org Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Signed-off-by: Greg Kroah-Hartman Acked-by: Jack Wang Link: https://lore.kernel.org/r/20230620180129.645646-5-gregkh@linuxfoundation.org Signed-off-by: Jens Axboe commit 56e71bdf324d6ab263eba1fc3fa1f3fd8bb5678e Author: Christoph Hellwig Date: Wed Jun 21 14:49:14 2023 +0200 block: fix the exclusive open mask in disk_scan_partitions FMODE_EXEC has nothing to do with exclusive opens, and even is of the wrong type. We need to check for BLK_OPEN_EXCL here. Fixes: 985958b8584c ("block: fix wrong mode for blkdev_get_by_dev() from disk_scan_partitions()") Reported-by: kernel test robot Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230621124914.185992-1-hch@lst.de Signed-off-by: Jens Axboe commit 4be22f16a4a1a1667e79b52b56cca2c64b3747e2 Author: Gaosheng Cui Date: Wed Jun 21 15:44:18 2023 +0800 device_cgroup: Fix kernel-doc warnings in device_cgroup Fix kernel-doc warnings in device_cgroup: security/device_cgroup.c:835: warning: Excess function parameter 'dev_cgroup' description in 'devcgroup_legacy_check_permission'. Signed-off-by: Gaosheng Cui Signed-off-by: Paul Moore commit a0238ada560fce7fa1b5fb3ace60c0a575d3131a Author: Chaitanya S Prakash Date: Mon Jun 19 14:08:02 2023 +0530 Documentation/arm64: Add ptdump documentation ptdump is a debugfs interface used to dump the kernel page tables. It provides a comprehensive overview about the kernel's virtual memory layout, page table entries and associated page attributes. A document detailing how to enable ptdump in the kernel and analyse its output has been added. Changes in V2: - Corrected command to cat /sys/kernel/debug/kernel_page_tables Changes in V1: https://lore.kernel.org/all/20230613064845.1882177-1-chaitanyas.prakash@arm.com/ Cc: Will Deacon Cc: Jonathan Corbet CC: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Chaitanya S Prakash Link: https://lore.kernel.org/r/20230619083802.76092-1-chaitanyas.prakash@arm.com [catalin.marinas@arm.com: various minor fixups; sorted index.rst in alphabetical order] Signed-off-by: Catalin Marinas commit ee44484c12edcf9ad81c816d383f28b63c712fdb Merge: d8ece8b832276 33c01ff3b1003 Author: Arnd Bergmann Date: Wed Jun 21 15:15:10 2023 +0200 Merge tag 'at91-dt-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into soc/dt AT91 DT for 6.5 #2 It contains: - generic names for shutdown controller nodes - enablement of DT overlay support for some AT91 boards - fix reset and SPI CS for lan966x-kontron-kswitch-d10-mmt based boards - addition of PHY interrupts for lan966x-kontron-kswitch-d10-mmt-8g board * tag 'at91-dt-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: lan966x: kontron-d10: add PHY interrupts ARM: dts: lan966x: kontron-d10: fix SPI CS ARM: dts: lan966x: kontron-d10: fix board reset ARM: dts: at91: Enable device-tree overlay support for AT91 boards ARM: dts: at91: use generic name for shutdown controller Link: https://lore.kernel.org/r/20230621093853.1575312-1-claudiu.beznea@microchip.com Signed-off-by: Arnd Bergmann commit 2b24391767ae6897dff6eeb521f01d495bc27b55 Author: Cristian Ciocaltea Date: Thu May 4 23:19:16 2023 +0300 arm64: defconfig: Enable Rockchip I2S TDM and ES8316 drivers The Rockchip I2S TDM driver and the Everest Semi ES8316 codec are used to provide analog audio support on the RK3588 SoC based Rock 5B board. Enable both of them as modules. Signed-off-by: Cristian Ciocaltea Signed-off-by: Arnd Bergmann commit ffd791349859c47c50e1e423295b4f8912c45ee0 Author: Sebastian Reichel Date: Thu May 18 06:05:40 2023 +0200 arm64: defconfig: update RK8XX MFD config Update the defconfig for the new RK8XX MFD config name, which got split to add SPI support. Reported-by: Marek Szyprowski Fixes: c20e8c5b1203a ("mfd: rk808: Split into core and i2c") Signed-off-by: Sebastian Reichel Signed-off-by: Arnd Bergmann commit cf971df2cb464efcb27b943e9caa53a8097c72e4 Author: Sebastian Reichel Date: Thu May 18 06:05:41 2023 +0200 ARM: multi_v7_defconfig: update MFD_RK808 name MFD_RK808 got split into an I2C and SPI part named MFD_RK8XX_I2C and MFD_RK8XX_SPI. Since there are no known ARMv7 boards using the SPI connected RK8XX chips (which are new), it is enough to just enable the I2C option. Reported-by: Marek Szyprowski Fixes: c20e8c5b1203a ("mfd: rk808: Split into core and i2c") Signed-off-by: Sebastian Reichel Signed-off-by: Arnd Bergmann commit fd99ac5055d4705e91c73d1adba18bc71c8511a8 Author: Shiji Yang Date: Tue Jun 20 19:44:32 2023 +0800 mips: ralink: introduce commonly used remap node function The ralink_of_remap() function is repeated several times on SoC specific source files. They have the same structure, but just differ in compatible strings. In order to make commonly use of these codes, this patch introduces a newly designed mtmips_of_remap_node() function to match and remap all supported system controller and memory controller nodes. Build and run tested on MT7620 and MT7628. Signed-off-by: Shiji Yang Reviewed-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 89ec9bbe60b61cc6ae3eddd6d4f43e128f8a88de Author: Shiji Yang Date: Tue Jun 20 18:43:23 2023 +0800 mips: pci-mt7620: use dev_info() to log PCIe device detection result Usually, We only need to print the error log when there is a PCIe card but initialization fails. Whether the driver finds the PCIe card or not is the expected behavior. So it's better to log these information with dev_info(). Tested on MT7628AN router Motorola MWR03. Signed-off-by: Shiji Yang Reviewed-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit a82f3119d543406ed5b242deabf83cdecb9fe523 Merge: e0b78e9fa3410 d93c221999666 Author: Marc Zyngier Date: Wed Jun 21 13:53:41 2023 +0100 Merge branch irq/misc-6.5 into irq/irqchip-next * irq/misc-6.5: : . : Misc cleanups: : : - Add a number of missing prototypes : - Mark global symbol as static where needed : - Drop some now useless non-DT code paths : - Add a missing interrupt mapping to the STM32 irqchip : - Silence another STM32 warning when building with W=1 : - Fix the jcore-aic driver that actually never worked... : . Revert "irqchip/mxs: Include linux/irqchip/mxs.h" irqchip/jcore-aic: Fix missing allocation of IRQ descriptors irqchip/stm32-exti: Fix warning on initialized field overwritten irqchip/stm32-exti: Add STM32MP15xx IWDG2 EXTI to GIC map irqchip/gicv3: Add a iort_pmsi_get_dev_id() prototype irqchip/mxs: Include linux/irqchip/mxs.h irqchip/clps711x: Remove unused clps711x_intc_init() function irqchip/mmp: Remove non-DT codepath irqchip/ftintc010: Mark all function static irqdomain: Include internals.h for function prototypes Signed-off-by: Marc Zyngier commit 9f9a035e6156a57d9da062b26d2a48d031744a1e Author: Shiji Yang Date: Tue Jun 20 18:43:22 2023 +0800 mips: pci-mt7620: do not print NFTS register value as error log These codes are used to read NFTS_TIMEOUT_DELAY register value and write it into kernel log after writing the register. they are only used for debugging during driver development, so there is no need to keep them now. Tested on MT7628AN router Motorola MWR03. Signed-off-by: Shiji Yang Reviewed-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit fc15a7193a4d37d79e873fa06cc423180ddd2ddf Author: Sergio Paracuellos Date: Mon Jun 19 06:09:41 2023 +0200 MAINTAINERS: add Mediatek MTMIPS Clock maintainer Adding myself as maintainer for Mediatek MTMIPS clock driver. Signed-off-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit d93c22199966696cfb76c6942797de2fbb22da24 Author: Marc Zyngier Date: Wed Jun 21 13:46:25 2023 +0100 Revert "irqchip/mxs: Include linux/irqchip/mxs.h" This reverts commit 5b7e5676209120814dbb9fec8bc3769f0f7a7958. Although including linux/irqchip/mxs.h is technically correct, this clashes with the parallel removal of this include file with 32bit ARM modernizing the low level irq handling as part of 5bb578a0c1b8 ("ARM: 9298/1: Drop custom mdesc->handle_irq()"). As such, this patch is not only unnecessary, it also breaks compilation in -next. Revert it. Signed-off-by: Marc Zyngier Cc: Arnd Bergmann Cc: Shawn Guo commit ad38c17b0c26ae2108b50ac1eb0281a2e1ce08e9 Author: Sergio Paracuellos Date: Mon Jun 19 06:09:40 2023 +0200 mips: ralink: get cpu rate from new driver code At very early stage on boot, there is a need to set 'mips_hpt_frequency'. This timer frequency is a half of the CPU frequency. To get clocks properly set we need to call to 'of_clk_init()' and properly get cpu clock frequency afterwards. Depending on the SoC, CPU clock index and compatible differs, so use them to get the proper clock frm the clock provider. Hence, adapt code to be aligned with new clock driver. Signed-off-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 201ddc05777cd8e084b508bcdda22214bfe2895e Author: Sergio Paracuellos Date: Mon Jun 19 06:09:39 2023 +0200 mips: ralink: remove reset related code A proper clock driver for ralink SoCs has been added. This driver is also a reset provider for the SoC. Hence there is no need to have reset related code in 'arch/mips/ralink' folder anymore. The only code that remains is the one related with mips_reboot_setup where a PCI reset is performed. We maintain this because I cannot test old ralink board with PCI to be sure all works if we remove also this code. Signed-off-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 04b153abdfcbaba70ceef5a846067d4447fd0078 Author: Sergio Paracuellos Date: Mon Jun 19 06:09:38 2023 +0200 mips: ralink: mt7620: remove clock related code A proper clock driver for ralink SoCs has been added. Hence there is no need to have clock related code in 'arch/mips/ralink' folder anymore. Since this is the last clock related code removal, remove also remaining prototypes in 'common.h' header file. Signed-off-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 7cd1bb48885449a9323c7ff0f10012925e93b4e1 Author: Sergio Paracuellos Date: Mon Jun 19 06:09:37 2023 +0200 mips: ralink: rt3883: remove clock related code A properly clock driver for ralink SoCs has been added. Hence there is no need to have clock related code in 'arch/mips/ralink' folder anymore. Signed-off-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit daf73c70f69386fb15960526772ef584a4efcaf2 Author: Sergio Paracuellos Date: Mon Jun 19 06:09:36 2023 +0200 mips: ralink: rt305x: remove clock related code A properly clock driver for ralink SoCs has been added. Hence there is no need to have clock related code in 'arch/mips/ralink' folder anymore. Signed-off-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit ffcdf47379eae86dc8f8f02c62994dacf2c9038e Author: Sergio Paracuellos Date: Mon Jun 19 06:09:35 2023 +0200 mips: ralink: rt288x: remove clock related code A properly clock driver for ralink SoCs has been added. Hence there is no need to have clock related code in 'arch/mips/ralink' folder anymore. Signed-off-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 6f3b15586eef736831abe6a14f2a6906bc0dc074 Author: Sergio Paracuellos Date: Mon Jun 19 06:09:34 2023 +0200 clk: ralink: add clock and reset driver for MTMIPS SoCs Until now, clock related code for old ralink SoCs was based in fixed clocks using 'clk_register_fixed_rate' and 'clkdev_create' directly doing in code and not using device tree at all for their definition. Including this driver is an effort to be able to define proper clocks using device tree and also cleaning all the clock and reset related code from 'arch/mips/ralink' dir. This clock and reset driver covers all the ralink SoCs but MT7621 which is the newest and provides gating and some differences that make it different from its predecesors. It has its own driver since some time ago. The ralink SoCs we are taking about are RT2880, RT3050, RT3052, RT3350, RT3352, RT3883, RT5350, MT7620, MT7628 and MT7688. Mostly the code in this new driver has been extracted from 'arch/mips/ralink' and cleanly put using kernel clock driver APIs. The clock plans for this SoCs only talks about relation between CPU frequency and BUS frequency. This relation is different depending on the particular SoC. CPU clock is derived from XTAL frequencies. Depending on the SoC we have the following frequencies: * RT2880 SoC: - XTAL: 40 MHz. - CPU: 250, 266, 280 or 300 MHz. - BUS: CPU / 2 MHz. * RT3050, RT3052, RT3350: - XTAL: 40 MHz. - CPU: 320 or 384 MHz. - BUS: CPU / 3 MHz. * RT3352: - XTAL: 40 MHz. - CPU: 384 or 400 MHz. - BUS: CPU / 3 MHz. - PERIPH: 40 MHz. * RT3383: - XTAL: 40 MHz. - CPU: 250, 384, 480 or 500 MHz. - BUS: Depends on RAM Type and CPU: + RAM DDR2: 125. ELSE 83 MHz. + RAM DDR2: 128. ELSE 96 MHz. + RAM DDR2: 160. ELSE 120 MHz. + RAM DDR2: 166. ELSE 125 MHz. * RT5350: - XTAL: 40 MHz. - CPU: 300, 320 or 360 MHz. - BUS: CPU / 3, CPU / 4, CPU / 3 MHz. - PERIPH: 40 MHz. * MT7628 and MT7688: - XTAL: 20 MHz or 40 MHz. - CPU: 575 or 580 MHz. - BUS: CPU / 3. - PCMI2S: 480 MHz. - PERIPH: 40 MHz. * MT7620: - XTAL: 20 MHz or 40 MHz. - PLL: XTAL, 480, 600 MHz. - CPU: depends on PLL and some mult and dividers. - BUS: depends on PLL and some mult and dividers. - PERIPH: 40 or XTAL MHz. MT7620 is a bit more complex deriving CPU clock from a PLL and an bunch of register reads and predividers. To derive CPU and BUS frequencies in the MT7620 SoC 'mt7620_calc_rate()' helper is used. In the case XTAL can have different frequencies and we need a different clock frequency for peripherals 'periph' clock in introduced. The rest of the peripherals present in the SoC just follow their parent frequencies. With this information the clk driver will provide all the clock and reset functionality from a set of hardcoded clocks allowing to define a nice device tree without fixed clocks. Acked-by: Stephen Boyd Signed-off-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 612616e6381929e7f9e303f8b8ad3655cc101516 Author: Sergio Paracuellos Date: Mon Jun 19 06:09:33 2023 +0200 dt-bindings: clock: add mtmips SoCs system controller Adds device tree binding documentation for system controller node present in Mediatek MIPS and Ralink SOCs. This node is a clock and reset provider for the rest of the world. This covers RT2880, RT3050, RT3052, RT3350, RT3883, RT5350, MT7620, MT7628 and MT7688 SoCs. Reviewed-by: Rob Herring Acked-by: Stephen Boyd Signed-off-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 6ab11462c68499933bd9b5d52a710f4e18a9e43e Author: Fabio Estevam Date: Fri Jun 16 17:39:13 2023 -0300 ASoC: fsl-asoc-card: Allow passing the number of slots in use Currently, fsl-asoc-card supports passing the width of the TDM slot, but not the number of slots in use, as it harcodes it as two slots. Add support for passing the number of slots in use. Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20230616203913.551183-1-festevam@gmail.com Signed-off-by: Mark Brown commit aa21a7d4f68a0a5067578cbb93c136ab5ac09cfa Author: Krzysztof Kozlowski Date: Fri Jun 16 13:57:51 2023 +0200 ASoC: codecs: wsa884x: Add WSA884x family of speakers Add drivers for Qualcomm WSA8840/WSA8845/WSA8845H smart speaker amplifiers. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230616115751.392886-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 97ae6f4e5dd3bc7873ee70c864ab2ba2e8bff0c3 Author: Krzysztof Kozlowski Date: Fri Jun 16 13:57:50 2023 +0200 ASoC: dt-bindings: qcom,wsa8840: Add WSA884x family of speakers Add binding for WSA8840/WSA8845/WSA8845H smart speaker amplifiers used in Qualcomm QRD8550 board with SM8550 SoC. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230616115751.392886-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit b20c81371a96b87478d2430d80615df189d17cd8 Author: Mac Chiang Date: Fri Jun 16 02:36:17 2023 -0400 ASoC: Intel: sof_rt5682: Add mtl support RT1019P speaker This patch support below hardware configuration: SSP2: 10EC5682/RTL5682 codec SSP0: RTL1019 amplifier Signed-off-by: Mac Chiang Signed-off-by: Rui Zhou Link: https://lore.kernel.org/r/20230616063617.25900-2-mac.chiang@intel.com Signed-off-by: Mark Brown commit 1f583cbdc342e15bfbde61ba142480c70e7694b4 Author: Terry Cheong Date: Fri Jun 16 02:36:16 2023 -0400 ASoC: Intel: sof_rt5682: reorder quirk table Reorder the entries in quirk table to group entries with same platform. Signed-off-by: Terry Cheong Signed-off-by: Mac Chiang Link: https://lore.kernel.org/r/20230616063617.25900-1-mac.chiang@intel.com Signed-off-by: Mark Brown commit 615af0021a612ea66312a5deddd39cc0d8b70e78 Author: Song Shuai Date: Fri Jun 9 15:50:47 2023 +0800 arm64: hibernate: remove WARN_ON in save_processor_state During hibernation or restoration, freeze_secondary_cpus checks num_online_cpus via BUG_ON, and the subsequent save_processor_state also does the checking with WARN_ON. In the case of CONFIG_PM_SLEEP_SMP=n, freeze_secondary_cpus is not defined, but the sole possible condition to disable CONFIG_PM_SLEEP_SMP is !SMP where num_online_cpus is always 1. We also don't have to check it in save_processor_state. So remove the unnecessary checking in save_processor_state. Signed-off-by: Song Shuai Acked-by: Will Deacon Link: https://lore.kernel.org/r/20230609075049.2651723-3-songshuaishuai@tinylab.org Signed-off-by: Catalin Marinas commit 6cd52a2a06774c6c454ffef084c3d9b17618ca23 Author: Neil Armstrong Date: Thu Jun 1 11:39:58 2023 +0200 phy: qcom: qmp-combo: fix Display Port PHY configuration for SM8550 The SM8550 PHY also uses a different offset for the CMN_STATUS reg, use the right one for the v6 Display Port configuration. Fixes: 49742e9edab3 ("phy: qcom-qmp-combo: Add support for SM8550") Signed-off-by: Neil Armstrong Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230601-topic-sm8550-upstream-dp-phy-init-fix-v1-1-4e9da9f97991@linaro.org Signed-off-by: Vinod Koul commit 601d06277007e850615b86358bf9c0a143d20faa Author: Bartosz Golaszewski Date: Mon Jun 19 11:13:36 2023 +0200 phy: qcom: add the SGMII SerDes PHY driver Implement support for the SGMII/SerDes PHY present on various Qualcomm platforms. Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230619091336.194914-4-brgl@bgdev.pl Signed-off-by: Vinod Koul commit 97b795125704046e0c6708f1079d9c5ca3f2ecfd Author: Bartosz Golaszewski Date: Mon Jun 19 11:13:35 2023 +0200 dt-bindings: phy: describe the Qualcomm SGMII PHY Describe the SGMII/SerDes PHY present on the sa8775p platforms. Signed-off-by: Bartosz Golaszewski Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230619091336.194914-3-brgl@bgdev.pl Signed-off-by: Vinod Koul commit 37bd215fc48ef2a399f836d62d2e4a166efb31be Author: Bartosz Golaszewski Date: Mon Jun 19 11:13:34 2023 +0200 phy: qualcomm: fix indentation in Makefile Align all entries in Makefile. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20230619091336.194914-2-brgl@bgdev.pl Signed-off-by: Vinod Koul commit 04f78e242fffe6994f7662fb00aaa398dda41d3a Author: Yedidya Benshimol Date: Wed Jun 21 14:49:52 2023 +0300 wifi: iwlwifi: mvm: Add support for IGTK in D3 resume flow As part of the new security API in the FW, all security keys are to be removed before station removal. Until now IGTK rekey wasn't supported in the D3 resume flow, and thus the driver might not know the right key to remove. If an IGTK was rekeyed during D3 the old IGTK is removed and the new key is updated. If not, the old key's IPN is updated. As opposed to GTK, which both the FW and the driver hold it's two most recent keys, only one IGTK is held. Signed-off-by: Yedidya Benshimol Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621144844.b53c301c07e6.I375277a10a1f756b93d4a343f6664351a80189c5@changeid Signed-off-by: Johannes Berg commit fa4e48fb3ee5757d8e0ed1c5079e472687e2c667 Author: Yedidya Benshimol Date: Wed Jun 21 14:49:51 2023 +0300 wifi: iwlwifi: mvm: update two most recent GTKs on D3 resume flow When resuming from D3 the two most recent GTKs are passed from the FW with wowlan_info_notif. Both keys should be updated as they both might be needed upon FW restart and they both should be removed upon station removal. Signed-off-by: Yedidya Benshimol Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621144844.3ea3a9f52ec2.I7cedfa2bb0eafb83e7c77363673560acf05bff74@changeid Signed-off-by: Johannes Berg commit 60555ea4085a956adaa58bcd24f418a631b575a2 Author: Yedidya Benshimol Date: Wed Jun 21 14:49:50 2023 +0300 wifi: iwlwifi: mvm: Refactor security key update after D3 In the D3 resume flow, use two different iterating functions to go over the old keys and update the new ones Signed-off-by: Yedidya Benshimol Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621144844.a2442844c224.I598ed742c7aaa5414702f03f694f2dc0874bc077@changeid Signed-off-by: Johannes Berg commit f52a0b408ed144afa42b45f078a28542e711551b Author: Yedidya Benshimol Date: Wed Jun 21 14:44:36 2023 +0300 wifi: mac80211: mark keys as uploaded when added by the driver When the driver has some form of GTK rekeying offload, e.g. during WoWLAN, mac80211 can assume that keys that the driver adds for that are already present in the hardware acceleration. Mark them accordingly. Signed-off-by: Yedidya Benshimol Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621144414.bc78c7ff2a3d.I5e313d69e2b6a7a4766ef82d0faa122dd4c1c46d@changeid Signed-off-by: Johannes Berg commit 4536fe9640b6a4ef07b1ec77c5dd7bbc62dc0d3d Author: Justin Chen Date: Thu Jun 15 13:06:17 2023 -0700 phy: usb: suppress OC condition for 7439b2 We hit a false positive OC for 7439b2 in DRD/device mode for the second port. So disable the OC check for this use case. Add capability to suppress OC condition for specific ports. Signed-off-by: Justin Chen Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/1686859578-45242-3-git-send-email-justin.chen@broadcom.com Signed-off-by: Vinod Koul commit 5095d045a96235687199015ca94a03c00d68234f Author: Justin Chen Date: Thu Jun 15 13:06:16 2023 -0700 phy: usb: Turn off phy when port is in suspend The COMMONONN bit turns off the PHY when the host controller puts it into suspend state. This can happen during the following... - Nothing is connected to the port - The host controller goes into low power mode whatever due to auto suspend or system suspend. With COMMONONN we also must unset U2_FREECLK_EXISTS since the UTMI clock is fed by the PHY. With these changes we see a power savings of ~12mW when port is in suspend. Reviewed-by: Florian Fainelli Signed-off-by: Justin Chen Link: https://lore.kernel.org/r/1686859578-45242-2-git-send-email-justin.chen@broadcom.com Signed-off-by: Vinod Koul commit fd006d60e83389f806d8a215c78ae608b9070bbb Author: Mukesh Sisodiya Date: Wed Jun 21 13:12:22 2023 +0300 wifi: iwlwifi: remove support of A0 version of FM RF Remove the support for A0 step of latest wifi-7 FM RF as it is no longer supported. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130444.269d55ffbc8e.I4740f32c3d95d4474a82cc153891c92b9bc465db@changeid Signed-off-by: Johannes Berg commit a701177bd4bc37b9775da8daf255864da3fecaf9 Author: Johannes Berg Date: Wed Jun 21 13:12:21 2023 +0300 wifi: iwlwifi: cfg: clean up Bz module firmware lines Remove module firmware lines for images that don't exist as well as some unused macros, and add gl-a-fm-a that (still) exists. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130444.b399b0072d72.Ie7ca1b3dcdebc929ce96a739e0d557fac2c8aeeb@changeid Signed-off-by: Johannes Berg commit f4daceae4087bbb3e9a56044b44601d520d009d2 Author: Yi Kuo Date: Wed Jun 21 13:12:20 2023 +0300 wifi: iwlwifi: pcie: add device id 51F1 for killer 1675 Intel Killer AX1675i/s with device id 51f1 would show "No config found for PCI dev 51f1/1672" in dmesg and refuse to work. Add the new device id 51F1 for 1675i/s to fix the issue. Signed-off-by: Yi Kuo Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130444.ee224675380b.I921c905e21e8d041ad808def8f454f27b5ebcd8b@changeid Signed-off-by: Johannes Berg commit 399762de769c4ec7d82220feb83de9bca30e5ef0 Author: Gregory Greenman Date: Wed Jun 21 13:12:19 2023 +0300 wifi: iwlwifi: bump FW API to 83 for AX/BZ/SC devices Start supporting API version 83 for new devices. Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130444.267a136ea57f.Iaef9f04b9655c5c1b8bdee3b89cc3361ab621bcf@changeid Signed-off-by: Johannes Berg commit 31aeae2446d50665b6ec51d564f5e7fe751d53d4 Author: Johannes Berg Date: Wed Jun 21 13:12:18 2023 +0300 wifi: iwlwifi: cfg: remove trailing dash from FW_PRE constants We have the trailing dash here, but that complicates all the code. Simplify this by removing the dashes, adding them to the *_MODULE_FIRMWARE macros, and adjusting the code using this accordingly. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.72240ca13b83.I1f4ed547f0964719ed98a3ef928080462d594491@changeid Signed-off-by: Johannes Berg commit ecf11f4e4950defa89ca9d813ba9684c19d85f6e Author: Johannes Berg Date: Wed Jun 21 13:12:17 2023 +0300 wifi: iwlwifi: also unify Ma device configurations Again, they're all the same except for the radio and steps, so use the new logic to unify them. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.676887cc8180.I29994dec43bfb29aad5e4ab0126c06a9ea4670cb@changeid Signed-off-by: Johannes Berg commit bfed356b4fc4e24d0cc73a81d51d193353629e73 Author: Johannes Berg Date: Wed Jun 21 13:12:16 2023 +0300 wifi: iwlwifi: also unify Sc device configurations Again, they're all the same except for the radio and steps, so use the new logic to unify them. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.3bc1191f883f.If1e6f73a164b0794ac65372b72673ce8ddf9e571@changeid Signed-off-by: Johannes Berg commit 3fd31289d5de8392c914db4f8cb36e0999afdac2 Author: Johannes Berg Date: Wed Jun 21 13:12:15 2023 +0300 wifi: iwlwifi: unify Bz/Gl device configurations All the configurations for the various Bz/Gl devices are basically identical, except for Gl A-step and the firmware filename prefixes. Add some infrastructure to auto-generate the firmware filename prefix based on the detected MAC step and RF name/step, and remove all the unneeded configs. This reduces the size of the iwlwifi module by ~9k: 517582 27111 560 545253 851e5 drivers/net/wireless/intel/iwlwifi/iwlwifi.ko 526885 27083 560 554528 87620 drivers/net/wireless/intel/iwlwifi/iwlwifi.ko Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.1dc121ba338f.I07d651516eb82cbaded4724ef30558a50f2fa866@changeid Signed-off-by: Johannes Berg commit e3597e28a2fab5e260dcbfde20c12025ee250b72 Author: Johannes Berg Date: Wed Jun 21 13:12:14 2023 +0300 wifi: iwlwifi: pcie: also drop jacket from info macro We don't need this here anymore, ANY is just fine. Still keep the rest of the infrastructure so we can more easily add back support for testing. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.168c714cbb83.I0721ce86a042c4d8004914129bab46d7ccc8cb00@changeid Signed-off-by: Johannes Berg commit 0f21d7d56083f7069ff1180b40235228f3ce5b1e Author: Johannes Berg Date: Wed Jun 21 13:12:13 2023 +0300 wifi: iwlwifi: remove support for *nJ devices These are test chips that will never reach anyone outside of Intel, so remove support for them. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.d9f4e0356ae4.If9eccc22eb500dfff8973a70a649d94af7a60841@changeid Signed-off-by: Johannes Berg commit c648e926d021f9c6bdeef782df06f5111904fe7e Author: Johannes Berg Date: Wed Jun 21 13:12:12 2023 +0300 wifi: iwlwifi: don't load old firmware for 22000 The earliest firmware released for these products is with API version 50, so there's no point in trying to load any versions before that. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.768186c0475d.I7de717072221712176a3085d71c8018ae0348db8@changeid Signed-off-by: Johannes Berg commit a7de384c93996f8cdf8e7b5304bf7963161241a6 Author: Johannes Berg Date: Wed Jun 21 13:12:11 2023 +0300 wifi: iwlwifi: don't load old firmware for ax210 The earliest firmware released for these products is with API version 59 (for 'ty' only), so no point trying to go back in time even further than that. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.ebe02b5dbddb.I51484ebb6c89256b0e6e7f9bb24f597c4ebead67@changeid Signed-off-by: Johannes Berg commit a13707f7c8456022d9b4b764d1ad3f2252db2154 Author: Johannes Berg Date: Wed Jun 21 13:12:10 2023 +0300 wifi: iwlwifi: don't load old firmware for Bz This is a future product, don't try to load ancient firmware images for it, they don't exist anyway. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.a6961592f258.Ib7afecd46b1963164481c2acf35d2582691ef0bc@changeid Signed-off-by: Johannes Berg commit 508b4a1baeb3da3f0bcf3ab4c94dd2c21cc5d395 Author: Johannes Berg Date: Wed Jun 21 13:12:09 2023 +0300 wifi: iwlwifi: don't load old firmware for Sc This is a future product, don't try to load ancient firmware images for it, they don't exist anyway. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.a15e7bf936cb.I68c3c71fda62c837e4da885a42471bf772ac1202@changeid Signed-off-by: Johannes Berg commit 5afe98b2e2995aa17ef77a29e57b1d98ccd6cd25 Author: Johannes Berg Date: Wed Jun 21 13:12:08 2023 +0300 wifi: iwlwifi: give Sc devices their own family They're not the same as Bz or any prior ones, and there's already one place in the driver that would erroneously assign a workaround to A-step Sc devices if they're just treated as a version of Bz. Fix that. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.e98272ddb808.If18577b2393f631d1bfaa931287cae106fa32438@changeid Signed-off-by: Johannes Berg commit 19898ce9cf8a33e0ac35cb4c7f68de297cc93cb2 Author: Johannes Berg Date: Wed Jun 21 13:12:07 2023 +0300 wifi: iwlwifi: split 22000.c into multiple files Split the configuration list in 22000.c into four new files, per new device family, so we don't have this huge unusable file. Yes, this duplicates a few small things, but that's still much better than what we have now. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.7543603b2ee7.Ia8dd54216d341ef1ddc0531f2c9aa30d30536a5d@changeid Signed-off-by: Johannes Berg commit e1374ed25324e87d675bda735841d8424d83c81d Author: Mukesh Sisodiya Date: Wed Jun 21 13:12:06 2023 +0300 wifi: iwlwifi: Add support for new CNVi (SC) Add support for the new Integrated Connectivity (CNVi) and Companion RF (CRF) versions and their combinations to handle new devices. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.716fd707e847.I34f6ffd61e3210c926868a3e961b16d1742bba29@changeid Signed-off-by: Johannes Berg commit 8a18d46b7507553bdf40f48d3cd7d2be5f6aa7b8 Author: Mukesh Sisodiya Date: Wed Jun 21 13:12:05 2023 +0300 wifi: iwlwifi: Add support for new Bz version Add support for the new version of the Bz CNVI device. Signed-off-by: Mukesh Sisodiya Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230621130443.82d436d5f346.I0154c202c5d895cb002a2b7c827b9536e81a84b5@changeid Signed-off-by: Johannes Berg commit 69f778271f3ea4bd3d8b523c985aeea10d6b6f1a Author: Ilan Peer Date: Tue Jun 20 13:04:05 2023 +0300 wifi: iwlwifi: mvm: Add support for scan version 17 Add support for scan request command version 17, which supports specifying the maximal EIRP PSD value that can be used for probe request transmission on a given channel. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.0a41c847d450.I0c9b45cc3eb39d44c75d3bdca84f0a91fdad1fa1@changeid Signed-off-by: Johannes Berg commit 4eca0fd5da06c084a60f9a6626df6343293bfecb Author: Johannes Berg Date: Tue Jun 20 13:04:04 2023 +0300 wifi: iwlwifi: mvm: adjust skip-over-dtim in D3 The current formula can skip both too much and not enough time, given the +1 (where the comment about firmware is wrong). Adjust the formula accordingly. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.32406b6828ae.I88c315b85f7c56ac6109f84580b95a3dd104ff6c@changeid Signed-off-by: Johannes Berg commit de1076008148460fe273e6d39158faffcc954991 Author: Johannes Berg Date: Tue Jun 20 13:04:03 2023 +0300 wifi: iwlwifi: mvm: check only affected links When hostapd starts up, it may start up with only one link while the other is still scanning for overlapping BSSes. A station might start to connect at this point, but we run into this warning instead. Since there's no need to check for _all_ links, restrict the check to just the affected links that the STA will be using. Fixes: 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()") Reported-by: Miri Korenblit Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.c3d5a006ec21.Ib4715381f598f4c18d67cd9598ebd5cdbe7d2b09@changeid Signed-off-by: Johannes Berg commit 1a528ab1da324d078ec60283c34c17848580df24 Author: Johannes Berg Date: Tue Jun 20 13:04:02 2023 +0300 wifi: iwlwifi: mvm: avoid baid size integer overflow Roee reported various hard-to-debug crashes with pings in EHT aggregation scenarios. Enabling KASAN showed that we access the BAID allocation out of bounds, and looking at the code a bit shows that since the reorder buffer entry (struct iwl_mvm_reorder_buf_entry) is 128 bytes if debug such as lockdep is enabled, then staring from an agg size 512 we overflow the size calculation, and allocate a much smaller structure than we should, causing slab corruption once we initialize this. Fix this by simply using u32 instead of u16. Reported-by: Roee Goldfiner Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.f428c856030d.I2c2bb808e945adb71bc15f5b2bac2d8957ea90eb@changeid Signed-off-by: Johannes Berg commit 2db72b8a700943aa54dce0aabe6ff1b72b615162 Author: Johannes Berg Date: Tue Jun 20 13:04:01 2023 +0300 wifi: iwlwifi: mvm: indicate HW decrypt for beacon protection We've already done the 'decryption' here, so tell mac80211 it need not do it again. Fixes: b1fdc2505abc ("iwlwifi: mvm: advertise BIGTK client support if available") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.a50cf68fbf2e.Ieceacbe3789d81ea02ae085ad8d1f8813a33c31b@changeid Signed-off-by: Johannes Berg commit a6cc6ccb1c8ae9cbabd3dc4cf98c2b835bed2f6d Author: Johannes Berg Date: Tue Jun 20 13:04:00 2023 +0300 wifi: iwlwifi: mvm: support new flush_sta method For iwlwifi this is simple to implement, and on newer hardware it's an improvement since we have per-station queues. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.a1f8ec20b727.I48594b708b41aa55dc2b8c3d346b4412ad3a5ba3@changeid Signed-off-by: Johannes Berg commit 35bd6f1d043d089fcb60450e1287cc65f0095787 Author: Mukesh Sisodiya Date: Tue Jun 20 13:03:59 2023 +0300 wifi: iwlwifi: Add support for new PCI Id Add support for the PCI Id 51F1 without IMR support. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.9800e652e789.Ic06a085832ac3f988c8ef07d856c8e281563295d@changeid Signed-off-by: Johannes Berg commit c0a2f8194456af2759050a10f6d3111ad2b321da Author: Benjamin Berg Date: Tue Jun 20 13:03:58 2023 +0300 wifi: iwlwifi: mvm: send LARI configuration earlier Sending the LARI configuration may trigger calibration, which can have undesired side effects. Move the command to be send earlier (before the phy contexts are registered) to avoid unintended side effects. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.80742497eb3f.I3e599a796290082e6d331ea495a5591d55de4726@changeid Signed-off-by: Johannes Berg commit c6b9d5664bc41f187b3c5327613569743e006154 Author: Johannes Berg Date: Tue Jun 20 13:03:57 2023 +0300 wifi: iwlwifi: remove disable_dummy_notification This struct member is read-only, so can never change away from the default value of zero. Remove the code that's in an if on the value, since it's effectively dead code. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.e7c96d0aa805.I5b158ce15e48393d2896c0bff9f644d983f0e92d@changeid Signed-off-by: Johannes Berg commit 3a9690d030d8572736e07b912deea5547dd94db3 Author: Johannes Berg Date: Tue Jun 20 13:03:56 2023 +0300 wifi: iwlwifi: limit EHT capabilities based on PCIe link speed If a discrete NIC is connected to a PCIe link hat isn't at least Gen3 (8.0 GT/s), then we cannot sustain 320 MHz traffic, so remove that from EHT capabilities in that case. While at it, also move setting 320 MHz beamformee to the right place in the code so it's not set while not supporting 320 MHz. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.b77a1574a0a7.Id4120c161fb7df6dedc70d5f3e3829e9117b8cb1@changeid Signed-off-by: Johannes Berg commit 00e482010dfb5879fc9e8601d5819641fe4ae925 Author: Johannes Berg Date: Tue Jun 20 13:03:55 2023 +0300 wifi: iwlwifi: mvm: add EHT A-MPDU size exponent support Add support for reading the EHT MAC capabilities A-MPDU size exponent field, as indicated by the draft spec. Also clarify the existing code a bit and add comments so it's clearer to understand what's going on here. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.c5e00045d90f.I7520787fca8f8430a564adedf975d069ad8c5417@changeid Signed-off-by: Johannes Berg commit d51173c13b24925553489dff77c8cee136c7bfb1 Author: Johannes Berg Date: Tue Jun 20 13:03:54 2023 +0300 wifi: iwlwifi: mvm: use min_t() for agg_size We can use min_t() for the agg_size and avoid spelling out the (firmware) limit twice. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.211768036c1f.I78b7eea32eaae20cc9f32869aa3f42814634ce9a@changeid Signed-off-by: Johannes Berg commit c7fa5e682842dc55a0885c67edd289018a64fffd Author: Johannes Berg Date: Tue Jun 20 13:03:53 2023 +0300 wifi: iwlwifi: mvm: use EHT maximum MPDU length on 2.4 GHz On 2.4 GHz there's no VHT, so EHT defines its own bits for the maximum MPDU length. Use them when telling firmware about the maximum. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.fd5322bb48a4.Ic471045f83229ceaacce25edcf992d3ce2c75de5@changeid Signed-off-by: Johannes Berg commit 592fef3eb6a576eb453c94b5ee1801cfb13c8dc8 Author: Johannes Berg Date: Tue Jun 20 13:03:52 2023 +0300 wifi: iwlwifi: nvm: handle EHT/320 MHz regulatory flag Handle the regulatory EHT/320 MHz flags from firmware just like any other flags before it. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.2c5e886c08f3.Ibc5c27d973d0590e2dea1f50435f9cf3ba8c2c09@changeid Signed-off-by: Johannes Berg commit e119e740b1899169a19cf3cd43993a7d88c63bc6 Author: Emmanuel Grumbach Date: Tue Jun 20 13:03:51 2023 +0300 wifi: iwlwifi: mvm: make iwl_mvm_set_fw_mu_edca_params mld aware We need to work on the right link there. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.8762a90e8857.Ic5b8e96140a449fd1ed7008907d67fc36fe98506@changeid Signed-off-by: Johannes Berg commit eeef0168e3255732650ee81771e0d7e26e06a534 Author: Miri Korenblit Date: Tue Jun 20 13:03:50 2023 +0300 wifi: iwlwifi: fw: send marker cmd before suspend cmd This is needed to sync the times in the FW and driver logs Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.9c84322c41b5.Id13816b3ece103f88514a7523b22bb2b9dcc8ab7@changeid Signed-off-by: Johannes Berg commit 26aa35e2c5a1cbb05e939c92464437e205dd0087 Author: Emmanuel Grumbach Date: Tue Jun 20 13:03:49 2023 +0300 wifi: iwlwifi: mvm: check the right csa_active When the firmware says that the channel switch is happening, we check that we know about that switch by checking the csa_active bit. Until now, we checked the bss_conf from the vif instead of taking the bss_conf of the link. Fix that. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.63f835a4f578.I0bb2a231e4da506b7c751dc23a428558f9ecfa75@changeid Signed-off-by: Johannes Berg commit 1caa3a5e921c146cc82a674e7ef01633a142c475 Author: Johannes Berg Date: Tue Jun 20 13:03:48 2023 +0300 wifi: iwlwifi: pcie: add size assertions Ensure that the TX command scratch fits into the buffer provided by the first TB. It does, of course, but add some build-time validations in case we touch this code. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.8f54f2990b92.If19a038dfd633d4601e3d44dd0ff678bc0a851e9@changeid Signed-off-by: Johannes Berg commit 4742c732624bd2609aeb0acee38c0a126e61ed47 Author: Johannes Berg Date: Tue Jun 20 13:03:47 2023 +0300 wifi: iwlwifi: pcie: refactor RB status size calculation We have three places doing this check, and even in slightly different ways (with/without an intermediate). Refactor that to a new small inline function. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230620125813.f3e87ddd5bce.Ifefba753043b68c394590a35bc6914a0f6497fd3@changeid Signed-off-by: Johannes Berg commit c0c2fcb1325d0d4f3b322b5ee49385f8eca2560d Author: EJ Hsu Date: Fri Jun 9 14:29:32 2023 +0800 phy: tegra: xusb: Clear the driver reference in usb-phy dev For the dual-role port, it will assign the phy dev to usb-phy dev and use the port dev driver as the dev driver of usb-phy. When we try to destroy the port dev, it will destroy its dev driver as well. But we did not remove the reference from usb-phy dev. This might cause the use-after-free issue in KASAN. Fixes: e8f7d2f409a1 ("phy: tegra: xusb: Add usb-phy support") Cc: stable@vger.kernel.org Signed-off-by: EJ Hsu Signed-off-by: Haotien Hsu Acked-by: Thierry Reding Acked-by: Jon Hunter Link: https://lore.kernel.org/r/20230609062932.3276509-1-haotienh@nvidia.com Signed-off-by: Vinod Koul commit 6c5b9a3296e146cc74b1d006c6a546ea92534ade Author: Johannes Berg Date: Mon Jun 19 16:26:53 2023 +0300 wifi: nl80211/reg: add no-EHT regulatory flag This just propagates to the channel flags, like no-HE and similar other flags before it. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230619161906.74ce2983aed8.Ifa343ba89c11760491daad5aee5a81209d5735a7@changeid Signed-off-by: Johannes Berg commit 4ef2f53e50cba9780057b51357ef45cb5f49859d Author: Ilan Peer Date: Mon Jun 19 16:26:52 2023 +0300 wifi: cfg80211: Retrieve PSD information from RNR AP information Retrieve the Power Spectral Density (PSD) value from RNR AP information entry and store it so it could be used by the drivers. PSD value is explained in Section 9.4.2.170 of Draft P802.11Revme_D2.0. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230619161906.067ded2b8fc3.I9f407ab5800cbb07045a0537a513012960ced740@changeid Signed-off-by: Johannes Berg commit 2829b2fc8910984daa89be8005adbd9fb6205024 Author: Johannes Berg Date: Mon Jun 19 16:26:51 2023 +0300 wifi: mac80211: fix CRC calculation for extended elems For extended elements, we currently only calculate the CRC for some of them, but really we should do it also for the rest that we care about, such as EHT operation and multi- link. Also, while at it, it seems we should do it even if they aren't well-formed, so we notice if that changes. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230619161906.93235d5c8651.I6615cb3c1244bc9618066baa2bdad7982e9abd1f@changeid Signed-off-by: Johannes Berg commit b8b80770b26c4591f20f1cde3328e5f1489c4488 Author: Benjamin Berg Date: Mon Jun 19 16:26:50 2023 +0300 wifi: mac80211: avoid lockdep checking when removing deflink struct sta_info may be removed without holding sta_mtx if it has not yet been inserted. To support this, only assert that the lock is held for links other than the deflink. This fixes lockdep issues that may be triggered in error cases. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230619161906.cdd81377dea0.If5a6734b4b85608a2275a09b4f99b5564d82997f@changeid Signed-off-by: Johannes Berg commit 4484de23ba22e3023e9cbe4246a927ffb00db56f Author: Johannes Berg Date: Mon Jun 19 16:26:49 2023 +0300 wifi: mac80211: always hold sdata lock in chanctx assign/unassign Due to all the multi-link handling, we now expose the fact that the sdata/vif is locked to drivers, e.g. when the driver uses ieee80211_set_monitor_channel(). This was true when a chanctx is added to or removed from a link, _except_ in monitor mode with the virtual sdata/vif. Change that, so that drivers can make that assumption. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230619161906.a5cf7534beda.I5b51664231abee27e02f222083df7ccf88722929@changeid Signed-off-by: Johannes Berg commit 5c1f97537bfb9f358e0ecc88c3c8a913c51944cb Author: Johannes Berg Date: Mon Jun 19 16:26:48 2023 +0300 wifi: mac80211: store BSS param change count from assoc response When receiving a multi-link association response, make sure to track the BSS parameter change count for each link, including the assoc link. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230619161906.1799c164e7e9.I8e2c1f5eec6eec3fab525ae2dead9f6f099a2427@changeid Signed-off-by: Johannes Berg commit 76a3059cf1246a71f242822c6d605e5baa8924a3 Author: Johannes Berg Date: Mon Jun 19 16:26:47 2023 +0300 wifi: mac80211: drop some unprotected action frames We should not receive/handle unicast protected dual or public action frames that aren't protected, so drop them - in the latter case of course only if MFP is used. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230619161906.eb4461108129.I3c2223cf29d8a3586dfc74b2dda3f6fa2a4eea7c@changeid Signed-off-by: Johannes Berg commit 2cc7add345ea0e3d28a2fae29b93884909753c63 Author: Johannes Berg Date: Mon Jun 19 16:26:46 2023 +0300 wifi: mac80211: move action length check up We'd like to add more checks to the function here for action frames, so move up the length check from the action processing. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230619161906.e799254e923f.I0a1de5f6bbdc1b2ef5efaa0ac80c7c3f39415538@changeid Signed-off-by: Johannes Berg commit 7339e0f2e1bcb732b922a1c40a01b6002bec1ee5 Author: Alon Giladi Date: Mon Jun 19 18:37:38 2023 +0300 wifi: mac80211: drop unprotected robust mgmt before 4-way-HS When MFP is used, drop unprotected robust management frames also before the 4-way handshake has been completed, i.e. no key has been installed yet. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230619183718.cfbefddccd0c.Ife369dbb61c87e311ce15739d5b2b4763bfdfbae@changeid Signed-off-by: Johannes Berg commit 1abd3127bde7b67d3e57c02a10b8d77a67decc84 Author: Xu Yang Date: Tue Jun 13 16:34:45 2023 +0800 dt-bindings: phy: mxs-usb-phy: add imx8ulp and imx8qm compatible The imx8ulp and imx8qm are compatible with imx8dxl. This will add such compatible. Signed-off-by: Xu Yang Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230613083445.1129137-2-xu.yang_2@nxp.com Signed-off-by: Vinod Koul commit bbbfd0329014e61ccce1161fafb858da2901b49e Author: Xu Yang Date: Tue Jun 13 16:34:44 2023 +0800 dt-bindings: phy: mxs-usb-phy: convert to DT schema format Convert the binding to DT schema format. Besides, this also add clocks, '#phy-cells', phy-3p0-supply and power-domains properties which are not contained in txt file due to txt file lack updates. Signed-off-by: Xu Yang Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230613083445.1129137-1-xu.yang_2@nxp.com Signed-off-by: Vinod Koul commit 833b0f07b915f40db352063df0e13bc91fb0f42f Author: Mark Brown Date: Wed Jun 21 02:36:06 2023 +0100 kselftest/arm64: Log signal code and address for unexpected signals If we get an unexpected signal during a signal test log a bit more data to aid diagnostics. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230620-arm64-selftest-log-wrong-signal-v1-1-3fe29bdaaf38@kernel.org Signed-off-by: Catalin Marinas commit 6b164eaecd154930532afe8dce0d0562f629d23d Merge: 8d0cf150d2991 4dce2f076b7d0 Author: Takashi Iwai Date: Wed Jun 21 13:06:39 2023 +0200 Merge branch 'topic/midi20' into for-next This is a small patch set to change the UMP core for the upcoming gadget driver support. Basically exporting a couple of helper functions and adding a flag to suppress the internal UMP handling. No functional changes by those alone. Link: https://lore.kernel.org/r/20230621110241.4751-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4dce2f076b7d0a0a99867b58eea7c212ff4e2be5 Author: Takashi Iwai Date: Wed Jun 21 13:02:41 2023 +0200 ALSA: ump: Export snd_ump_receive_ump_val() This is another preliminary patch for USB MIDI 2.0 gadget driver. Export the currently local snd_ump_receive_ump_val(). It can be used by the gadget driver for processing the UMP data. Link: https://lore.kernel.org/r/20230621110241.4751-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit eacd9c7f1d3ab8381a99b98b36652b5cf6ae8387 Author: Takashi Iwai Date: Wed Jun 21 13:02:40 2023 +0200 ALSA: ump: Add no_process_stream flag This is another preliminary patch for USB MIDI 2.0 gadget driver. Add a new flag, no_process_stream, to snd_ump for suppressing the UMP Stream message handling in UMP core. Link: https://lore.kernel.org/r/20230621110241.4751-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit a79807683781d3f215e9d958494e52ed70f4ad27 Author: Takashi Iwai Date: Wed Jun 21 13:02:39 2023 +0200 ALSA: ump: Add helper to change MIDI protocol This is a preliminary patch for MIDI 2.0 USB gadget driver. Export a new helper to allow changing the current MIDI protocol from the outside. Link: https://lore.kernel.org/r/20230621110241.4751-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit a4857d1afdd1fa7ff763e1d07b1c2db521a5f9b1 Author: Richard Fitzgerald Date: Thu Jun 15 15:12:08 2023 +0100 soundwire: stream: Make master_list ordered to prevent deadlocks Always add buses to the stream->master_list in a fixed order. The unique bus->id is used to order the adding of buses to the list. This prevents lockdep asserts and possible deadlocks on streams that have multiple buses. sdw_acquire_bus_lock() takes bus_lock in the order that buses are listed in stream->master_list. do_bank_switch() takes all the msg_lock in the same order. To prevent a lockdep assert, and a possible real deadlock, the relative order of taking these mutexes must always be the same. For example, if a stream takes the mutexes in the order (bus0, bus1) lockdep will assert if another stream takes them in the order (bus1, bus0). More complex relative ordering will also assert, for example if two streams take (bus0, bus1) and (bus1, bus2), then a third stream takes (bus2, bus0). Previously sdw_stream_add_master() simply added the given bus to the end of the list, requiring the caller to guarantee that buses are added in a fixed order. This isn't reasonable or necessary - it's an internal implementation detail that should not be exposed by the API. It doesn't really make sense when there could be multiple independent calling drivers, to say "you must add your buses in the same order as a different driver, that you don't know about, added them". Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230615141208.679011-2-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit 256a9978eb2be53d9d17705707a69ce0b65b4727 Author: Richard Fitzgerald Date: Thu Jun 15 15:12:07 2023 +0100 soundwire: bus: Prevent lockdep asserts when stream has multiple buses Give the bus_lock and msg_lock of each bus a different unique key so that it is possible to acquire the locks of multiple buses without lockdep asserting a possible deadlock. Using mutex_init() to initialize a mutex gives all those mutexes the same lock class. Lockdep checking treats it as an error to attempt to take a mutex while already holding a mutex of the same class. This causes a lockdep assert when sdw_acquire_bus_lock() attempts to lock multiple buses, and when do_bank_switch() takes multiple msg_lock. [ 138.697350] WARNING: possible recursive locking detected [ 138.697366] 6.3.0-test #1 Tainted: G E [ 138.697380] -------------------------------------------- [ 138.697394] play/903 is trying to acquire lock: [ 138.697409] ffff99b8c41aa8c8 (&bus->bus_lock){+.+.}-{3:3}, at: sdw_prepare_stream+0x52/0x2e0 [ 138.697443] but task is already holding lock: [ 138.697468] ffff99b8c41af8c8 (&bus->bus_lock){+.+.}-{3:3}, at: sdw_prepare_stream+0x52/0x2e0 [ 138.697493] other info that might help us debug this: [ 138.697521] Possible unsafe locking scenario: [ 138.697540] CPU0 [ 138.697550] ---- [ 138.697559] lock(&bus->bus_lock); [ 138.697570] lock(&bus->bus_lock); [ 138.697581] *** DEADLOCK *** Giving each mutex a unique key allows multiple to be held without triggering a lockdep assert. But note that it does not allow them to be taken in one order then a different order. If two mutexes are taken in the order A, B then they must always be taken in that order otherwise they could deadlock. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230615141208.679011-1-rf@opensource.cirrus.com Signed-off-by: Vinod Koul commit 490937d479abe5f6584e69b96df066bc87be92e9 Author: Krzysztof Kozlowski Date: Thu Jun 1 12:25:25 2023 +0200 soundwire: qcom: fix storing port config out-of-bounds The 'qcom_swrm_ctrl->pconfig' has size of QCOM_SDW_MAX_PORTS (14), however we index it starting from 1, not 0, to match real port numbers. This can lead to writing port config past 'pconfig' bounds and overwriting next member of 'qcom_swrm_ctrl' struct. Reported also by smatch: drivers/soundwire/qcom.c:1269 qcom_swrm_get_port_config() error: buffer overflow 'ctrl->pconfig' 14 <= 14 Fixes: 9916c02ccd74 ("soundwire: qcom: cleanup internal port config indexing") Cc: Reported-by: kernel test robot Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/202305201301.sCJ8UDKV-lkp@intel.com/ Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230601102525.609627-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 6c50384ef8b94a527445e3694ae6549e1f15d859 Author: Yicong Yang Date: Wed Jun 21 17:28:04 2023 +0800 hwtracing: hisi_ptt: Fix potential sleep in atomic context We're using pci_irq_vector() to obtain the interrupt number and then bind it to the CPU start perf under the protection of spinlock in pmu::start(). pci_irq_vector() might sleep since [1] because it will call msi_domain_get_virq() to get the MSI interrupt number and it needs to acquire dev->msi.data->mutex. Getting a mutex will sleep on contention. So use pci_irq_vector() in an atomic context is problematic. This patch cached the interrupt number in the probe() and uses the cached data instead to avoid potential sleep. [1] commit 82ff8e6b78fc ("PCI/MSI: Use msi_get_virq() in pci_get_vector()") Fixes: ff0de066b463 ("hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device") Reviewed-by: Jonathan Cameron Signed-off-by: Yicong Yang Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230621092804.15120-6-yangyicong@huawei.com commit 45c90292ad0e275ef4b870838b3b5273b3ef8ade Author: Yicong Yang Date: Wed Jun 21 17:28:03 2023 +0800 hwtracing: hisi_ptt: Advertise PERF_PMU_CAP_NO_EXCLUDE for PTT PMU The PTT trace collects PCIe TLP headers from the PCIe link and don't have the ability to exclude certain context. It doesn't support itrace as well. So replace PERF_PMU_CAP_ITRACE with PERF_PMU_CAP_NO_EXCLUDE. This will greatly save the storage of final data. Tested tracing idle link for ~15s, without this patch we'll collect ~28.682MB data for additional information and with this patch it reduced to ~0.226MB. Reviewed-by: Jonathan Cameron Signed-off-by: Yicong Yang Tested-by: Junhao He Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230621092804.15120-5-yangyicong@huawei.com commit 6373c463ac894e41cab24469d1947ff91aaea486 Author: Yicong Yang Date: Wed Jun 21 17:28:02 2023 +0800 hwtracing: hisi_ptt: Export available filters through sysfs The PTT can only filter the traced TLP headers by the Root Ports or the Requester ID of the Endpoint, which are located on the same PCIe core of the PTT device. The filter value used is derived from the BDF number of the supported Root Port or the Endpoint. It's not friendly enough for the users since it requires the user to be familiar enough with the platform and calculate the filter value manually. This patch export the available filters through sysfs. Each available filters is presented as an individual file with the name of the BDF number of the related PCIe device. The files are created under $(PTT PMU dir)/available_root_port_filters and $(PTT PMU dir)/available_requester_filters respectively. The filter value can be known by reading the related file. Then the users can easily know the available filters for trace and get the filter values without calculating. Reviewed-by: Jonathan Cameron Signed-off-by: Yicong Yang Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230621092804.15120-4-yangyicong@huawei.com commit 556ef09392dbc2d0b9aad5fd880d5d11addfc40d Author: Yicong Yang Date: Wed Jun 21 17:28:01 2023 +0800 hwtracing: hisi_ptt: Add support for dynamically updating the filter list The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can block the invalid filters of which related devices no longer exist in the system. Reviewed-by: Jonathan Cameron Signed-off-by: Yicong Yang Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230621092804.15120-3-yangyicong@huawei.com commit a3ecaba7017f5d02d1ad60229cc14d5f0cda0c20 Author: Yicong Yang Date: Wed Jun 21 17:28:00 2023 +0800 hwtracing: hisi_ptt: Factor out filter allocation and release operation Factor out the allocation and release of filters. This will make it easier to extend and manage the function of the filter. Reviewed-by: Jonathan Cameron Signed-off-by: Yicong Yang Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230621092804.15120-2-yangyicong@huawei.com commit a1b828f202ae45b4fce4d21e83679605feb87862 Author: Arnd Bergmann Date: Fri Jun 16 11:09:24 2023 +0200 soundwire: intel_ace2x: fix SND_SOC_SOF_HDA_MLINK dependency The ace2x driver can be build with or without mlink support, but when SND_SOC_SOF_HDA_MLINK is set to =m and soundwire is built-in, it fails with a link error: ld.lld: error: undefined symbol: hdac_bus_eml_sdw_wait_syncpu_unlocked >>> referenced by intel_ace2x.c >>> drivers/soundwire/intel_ace2x.o:(intel_link_power_up) in archive vmlinux.a ld.lld: error: undefined symbol: hdac_bus_eml_sdw_sync_arm_unlocked >>> referenced by intel_ace2x.c >>> drivers/soundwire/intel_ace2x.o:(intel_sync_arm) in archive vmlinux.a Add a Kconfig dependency that prevents that broken configuration but still allows soundwire to be a loadable module instead. Fixes: 4d1e2464a1104 ("soundwire: intel_ace2x: add sync_arm/sync_go helpers") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230616090932.2714714-1-arnd@kernel.org Signed-off-by: Vinod Koul commit 8d0c7e1901d6083756b7530d348cb0af6b25ded8 Author: Juerg Haefliger Date: Fri Jun 16 14:19:17 2023 +0200 wifi: p54: Add missing MODULE_FIRMWARE macro Add the missing MODULE_FIRMWARE macro for "3826.eeprom". Signed-off-by: Juerg Haefliger Acked-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230616121917.1034761-1-juerg.haefliger@canonical.com commit 028f6055c912588e6f72722d89c30b401bbcf013 Author: Jan Kara Date: Wed Jun 21 11:32:35 2023 +0200 udf: Fix uninitialized array access for some pathnames For filenames that begin with . and are between 2 and 5 characters long, UDF charset conversion code would read uninitialized memory in the output buffer. The only practical impact is that the name may be prepended a "unification hash" when it is not actually needed but still it is good to fix this. Reported-by: syzbot+cd311b1e43cc25f90d18@syzkaller.appspotmail.com Link: https://lore.kernel.org/all/000000000000e2638a05fe9dc8f9@google.com Signed-off-by: Jan Kara commit d5b9a2102075923f5f74e890661421f94a9e6177 Author: Kalle Valo Date: Wed Jun 14 17:47:04 2023 +0300 MAINTAINERS: ath11k: add wiki and bugreport page ath11k has a wiki and a separate page about reporting bugs, add those so hopefully people find them easier. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230614144704.505553-3-kvalo@kernel.org commit 30e67ed6e1d7686b215ec521cfdb9274101c8ece Author: Kalle Valo Date: Wed Jun 14 17:47:03 2023 +0300 MAINTAINERS: ath9k: add git tree ath9k patches go to my ath.git tree, document that. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230614144704.505553-2-kvalo@kernel.org commit 5fdaeca73eb2bc944bb509b3cdd1520188ed2285 Author: Kalle Valo Date: Wed Jun 14 17:47:02 2023 +0300 MAINTAINERS: mt76: add git tree Felix has a git tree for mt76 patches, document that. Signed-off-by: Kalle Valo Acked-by: Lorenzo Bianconi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230614144704.505553-1-kvalo@kernel.org commit f072eb39e4f2c1df60d8641f6260f11a42366abc Author: Ping-Ke Shih Date: Fri Jun 16 14:06:01 2023 +0800 wifi: rtw89: use struct to parse firmware header A firmware contains basic header, sections and optional dynamic header. Define them by a struct, so it will be easier to understand the layout, and also simply access these elements. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230616060601.28460-1-pkshih@realtek.com commit b4a283fb6227fa01cdfb4bec891ded3e32b4a287 Author: Zong-Zhe Yang Date: Fri Jun 16 14:05:23 2023 +0800 wifi: rtw89: TX power stuffs replace confusing naming of _max with _num Some old declarations about TX power stuffs were named with confusing `_max`. But, they mean "the number of". So we change them to be named with `_num`. (No logic is changed.) Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230616060523.28396-1-pkshih@realtek.com commit 076031a09ae9e9394a56805aab92973612763d7e Author: Ping-Ke Shih Date: Thu Jun 15 21:04:42 2023 +0800 wifi: rtw89: 8851b: configure to force 1 TX power value RTL8851B is a chip with only single RF path, and it must use 1 TX power value for transmission, so force 1 TX power value to prevent hardware logic gets wrong TX power values randomly in certain samples. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230615130442.18116-6-pkshih@realtek.com commit 76a7c7acaa78b1a4ab59868808fadbeb7a939b81 Author: Ping-Ke Shih Date: Thu Jun 15 21:04:41 2023 +0800 wifi: rtw89: 8851b: rfk: update IQK to version 0x8 The main change is to adjust RX calibration groups from {0,1,2,3} to {0,2} in 5 GHz, so reduce elements from 4 to 2, and use index to iterate them. Meanwhile, always do RX narrowband calibration (ID_NBRXK) for each group. NCTL is used to assist IQK, so also update NCTL to 0x6 along with internal tag HALRF_029_00_103. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230615130442.18116-5-pkshih@realtek.com commit b686bc67e0437eb5791bca6ec89479470ef40513 Author: Ping-Ke Shih Date: Thu Jun 15 21:04:40 2023 +0800 wifi: rtw89: 8851b: rfk: add LCK track LCK is short for LC Tank calibration. To keep RF performance, do this calibration if difference of thermal value is over a threshold. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230615130442.18116-4-pkshih@realtek.com commit b067acb1325abe06159768c351f149b8b621392c Author: Zong-Zhe Yang Date: Thu Jun 15 21:04:39 2023 +0800 wifi: rtw89: 8851b: update TX power tables to R28 Update 8851B TX power tables to RF version R28. TX power tables' changes: * TX power limit and TX power shape: update 5 GHz configurations for FCC and IC Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230615130442.18116-3-pkshih@realtek.com commit f5993f39f3a734ba8e84913dfd69d56d997e0aa1 Author: Ping-Ke Shih Date: Thu Jun 15 21:04:38 2023 +0800 wifi: rtw89: 8851b: update RF radio A parameters to R28 Update 8851b radio A parameters to R28 along with internal HALRF_029_00_103 Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230615130442.18116-2-pkshih@realtek.com commit 28c11c29494f1b34e39641eead9c60a8bd26170d Author: Po-Hao Huang Date: Fri Jun 16 20:55:40 2023 +0800 wifi: rtw88: fix not entering PS mode after AP stops Without this patch, firmware only track beacons for port 0 and since we will always start AP on port 0, this results in misbehavior of power saving mode on other ports after AP stops. The "default port" H2C command is used to notify which port should firmware track. Update the correct settings to firmware so power saving mode can work properly. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230616125540.36877-7-pkshih@realtek.com commit 455afa45edb3f1dbc1371201c5ee486bb9a8cd1a Author: Po-Hao Huang Date: Fri Jun 16 20:55:39 2023 +0800 wifi: rtw88: refine register based H2C command Since register based H2C commands don't need endian conversion. Introduce a new API that don't do conversion and send it directly. New caller are expected to encode with cpu order and gradually replace the old ones. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230616125540.36877-6-pkshih@realtek.com commit ad6741b1e0449ba8f4eb41dc28e269dc20ab9219 Author: Po-Hao Huang Date: Fri Jun 16 20:55:38 2023 +0800 wifi: rtw88: Stop high queue during scan When traversing channel list, TX in high queue should be disabled along with beacon function, so packets won't be sent to incorrect channels. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230616125540.36877-5-pkshih@realtek.com commit 9e09fbc5e90247fc6e77fb6ba72dcbf8088cf59a Author: Po-Hao Huang Date: Fri Jun 16 20:55:37 2023 +0800 wifi: rtw88: Skip high queue in hci_flush The flush period may not always intersect with DTIM and when that happens, an error log "timed out to flush pci TX ring[6]" is shown. Bypass this since hardware will do proper transmission on the next DTIM period for broadcast/multicast packets in high queue. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230616125540.36877-4-pkshih@realtek.com commit 076f786a0ae14a81f40314b96a2d815e264bc213 Author: Po-Hao Huang Date: Fri Jun 16 20:55:36 2023 +0800 wifi: rtw88: Fix AP mode incorrect DTIM behavior Broadcast and multicast packets in high queue should be transmitted all at once during DTIM. But without proper settings, hardware fails to recognize that there are multiple packets and fetches only one. Fix this by signaling hardware with more data bit set when there are packets in the high queue. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230616125540.36877-3-pkshih@realtek.com commit 88b9d8e6cf9cf89be50ca2ee6cb9b3180b432172 Author: Po-Hao Huang Date: Fri Jun 16 20:55:35 2023 +0800 wifi: rtw88: use struct instead of macros to set TX desc Remove macros that set TX descriptors. Use struct and le32_encode_bits() with mask definitions. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230616125540.36877-2-pkshih@realtek.com commit 67d7f24b194e6e8e82540aa4fe97580f6cfa0902 Author: Chih-Kang Chang Date: Fri Jun 16 11:17:13 2023 +0800 wifi: rtw88: process VO packets without workqueue to avoid PTK rekey failed In the wpa_supplicant rekey flow, it sends an EAPOL packet 4/4 through nl80211_tx_control_port() and triggers wake_tx_queue() in the driver. Then, it sends nl80211_new_key() to configure a new key in mac80211. However, in wake_tx_queue(), a workqueue is used to process the tx packet, which might cause the driver to process the EAPOL packet later than nl80211_new_key(). As a result, the EAPOL 4/4 packet is dropped by mac80211 due to the rekey configuration being finished. The EAPOL packets belongs to VO packets that need high priority. Therefore, we process VO packets directly without workqueue to ensure that packets can process immediately. VO is normally used by voice application that is low traffic load and low latency, that doesn't affect user experience. We test iperf with VO packets(iperf3 -P4 -u -b 10000M -S 0xdf) before after TX throughput 162M 162M ping RTT 3.8ms 3.7ms Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230616031713.16769-1-pkshih@realtek.com commit 2ce9a91fe8bfb0c8e647a6b7b88055881faf7502 Author: Po-Hao Huang Date: Thu Jun 15 19:43:48 2023 +0800 wifi: rtw88: Fix action frame transmission fail before association For combo chips, antennas were controlled by bluetooth only during power on. If WiFi wish to do transmission, notification to the coexistence module are required. Previously we only do this before authentication. To allow transmission before auth, such as management TX, now we start the initiation of coexistence earlier so antennas are shared between WiFi and bluetooth after set_channel(), and frames could then be sent. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230615114348.7193-1-pkshih@realtek.com commit 6a567e920fd0451bf29abc418df96c3365925770 Author: Miklos Szeredi Date: Wed Jun 7 17:49:21 2023 +0200 fuse: ioctl: translate ENOSYS in outarg Fuse shouldn't return ENOSYS from its ioctl implementation. If userspace responds with ENOSYS it should be translated to ENOTTY. There are two ways to return an error from the IOCTL request: - fuse_out_header.error - fuse_ioctl_out.result Commit 02c0cab8e734 ("fuse: ioctl: translate ENOSYS") already fixed this issue for the first case, but missed the second case. This patch fixes the second case. Reported-by: Jonathan Katz Closes: https://lore.kernel.org/all/CALKgVmcC1VUV_gJVq70n--omMJZUb4HSh_FqvLTHgNBc+HCLFQ@mail.gmail.com/ Fixes: 02c0cab8e734 ("fuse: ioctl: translate ENOSYS") Cc: Signed-off-by: Miklos Szeredi commit 94a599c8ee7bd14895a060dcb3837bd6b185e240 Merge: 3e1a7433fed25 b17f3a3ef5ee2 Author: Arnd Bergmann Date: Wed Jun 21 11:05:15 2023 +0200 Merge tag 'v6.4-next-defconfig' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into soc/defconfig - Enable mt6357 PMIC needed for mt8365 EVK - Enable device for power button on several PMICs * tag 'v6.4-next-defconfig' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: arm64: defconfig: enable Mediatek PMIC key arm64: defconfig: enable MT6357 regulator Link: https://lore.kernel.org/r/92e336ca-bbbb-6d6c-297a-13deaae4138b@gmail.com Signed-off-by: Arnd Bergmann commit 3e1a7433fed25c6a493bc36b2c317c626d7a37f0 Merge: 168269abf5394 95b4d23907f29 Author: Arnd Bergmann Date: Wed Jun 21 11:04:48 2023 +0200 Merge tag 'ti-k3-config-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/defconfig TI K3 defconfig updates Enable AM62 Verdin board peripherals Enable UBIFS support for OSPI NOR/NAND Filesystem on K3 platforms * tag 'ti-k3-config-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: arm64: defconfig: Enable UBIFS arm64: defconfig: enable drivers for Verdin AM62 Link: https://lore.kernel.org/r/97a49740-32e7-f899-d153-743b5a57eba7@ti.com Signed-off-by: Arnd Bergmann commit 168269abf5394bf0eca334e1c2478bc51cec3077 Merge: c0ab597fa2060 a19a3dcb0d190 Author: Arnd Bergmann Date: Wed Jun 21 11:04:00 2023 +0200 Merge tag 'qcom-arm64-defconfig-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/defconfig More Qualcomm ARM64 defconfig updates for v6.5 This enables various clock drivers for QCM2290, SM6115 and SC8280XP. Furhter, the interconnect and the MSM power manageer (MPM) drivers are enabled to allow QCM2290 to boot. * tag 'qcom-arm64-defconfig-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: defconfig: Build SM6115 display and GPU clock controller drivers arm64: defconfig: Build display clock controller driver for QCM2290 arm64: defconfig: Build interconnect driver for QCM2290 arm64: defconfig: Build Global Clock Controller driver for QCM2290 arm64: defconfig: Build MSM power manager driver arm64: defconfig: Enable sc828x0xp lpasscc clock controller Link: https://lore.kernel.org/r/20230615154119.1460952-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit c0ab597fa2060823cf727dd56bf8a3a0efba88ef Merge: 6d34aab3b59b9 3098f34977480 Author: Arnd Bergmann Date: Wed Jun 21 11:03:08 2023 +0200 Merge tag 'qcom-arm64-defconfig-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/defconfig Qualcomm ARM64 defconfig updates for v6.5 Enable the FSA4480 driver to enable USB Type-C altmode on devices such as SM8350 and SM8450 HDK. Enable the IPQ6018 APSS clock and PLL controller for CPU scaling, and enable GPU clock river for SA8775P. * tag 'qcom-arm64-defconfig-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: defconfig: Enable ipq6018 apss clock and PLL controller arm64: defconfig: enable FSA4480 driver as module arm64: defconfig: enable the SA8775P GPUCC driver Link: https://lore.kernel.org/r/20230610170955.2478831-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 6d34aab3b59b9b0f8e26c735532d7d1fe30129c7 Merge: 0403565132a54 773887a41b9c2 Author: Arnd Bergmann Date: Wed Jun 21 11:02:01 2023 +0200 Merge tag 'imx-defconfig-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/defconfig i.MX defconfig changes for 6.5: - Remove KERNEL_LZO and FW_LOADER_USER_HELPER from imx_v6_v7_defconfig. - Enable i.MX8M video capture drivers and TI SN65DSI83 driver for arm64 defconfig. * tag 'imx-defconfig-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: defconfig: Enable the TI SN65DSI83 driver ARM: imx_v6_v7_defconfig: Remove KERNEL_LZO config arm64: defconfig: Enable video capture drivers on imx8mm/imx8mn ARM: imx_v6_v7_defconfig: Remove firmware loader helper Link: https://lore.kernel.org/r/20230610072530.418847-4-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 5619c2ddaf3ff77ce393716a6fed3267cb906344 Author: Claudiu Beznea Date: Thu Jun 15 12:32:27 2023 +0300 clk: at91: sama7g5: s/ep_chg_chg_id/ep_chg_id s/ep_chg_chg_id/ep_chg_id in documentation of master clock structure. Signed-off-by: Claudiu Beznea Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/20230615093227.576102-12-claudiu.beznea@microchip.com commit de3383e993a588acdb5b276adbd32cc7e21fd38b Author: Claudiu Beznea Date: Thu Jun 15 12:32:26 2023 +0300 clk: at91: sama7g5: switch to parent_hw and parent_data Switch SAMA7G5 clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Extra time saved on registration is ~250us when running at 800MHz. Signed-off-by: Claudiu Beznea Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/20230615093227.576102-11-claudiu.beznea@microchip.com commit 8aa1db9ccee0edc5c48e460329ac725b6e337a4e Author: Claudiu Beznea Date: Thu Jun 15 12:32:25 2023 +0300 clk: at91: sckc: switch to parent_data/parent_hw Switch slow clock drivers to use parent_data and parent_hw. With this parent-child relation is described with pointers rather than strings. Signed-off-by: Claudiu Beznea Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/20230615093227.576102-10-claudiu.beznea@microchip.com commit a673dae8c4ad9ee02a80617c6569ac66991c6c82 Author: Claudiu Beznea Date: Thu Jun 15 12:32:24 2023 +0300 clk: at91: clk-sam9x60-pll: add support for parent_hw Add support for parent_hw in SAM9X60 PLL clock drivers. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-sam9x60-pll were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/20230615093227.576102-9-claudiu.beznea@microchip.com commit 077782e3f2f34003fb8d13f8becfeab69c4f6570 Author: Claudiu Beznea Date: Thu Jun 15 12:32:23 2023 +0300 clk: at91: clk-utmi: add support for parent_hw Add support for parent_hw in utmi clock drivers. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-utmi were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/20230615093227.576102-8-claudiu.beznea@microchip.com commit 1a537f625773fe3e5f124a933b2dffdfc947f9e0 Author: Claudiu Beznea Date: Thu Jun 15 12:32:22 2023 +0300 clk: at91: clk-system: add support for parent_hw Add support for parent_hw in system clock drivers. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-system were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/20230615093227.576102-7-claudiu.beznea@microchip.com commit 1a2669df3c1fcef1e212fc9fe39b37b0b67a97f0 Author: Claudiu Beznea Date: Thu Jun 15 12:32:21 2023 +0300 clk: at91: clk-programmable: add support for parent_hw Add support for parent_hw in programmable clock driver. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-programmable were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/20230615093227.576102-6-claudiu.beznea@microchip.com commit c2f2ca0be8a62ce61a6878cd3dddd8fc6d622999 Author: Claudiu Beznea Date: Thu Jun 15 12:32:20 2023 +0300 clk: at91: clk-peripheral: add support for parent_hw Add support for parent_hw in peripheral clock drivers. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-peripheral were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/20230615093227.576102-5-claudiu.beznea@microchip.com commit 171e502c6a1fee63ab6f3fc685d38960398ce6d5 Author: Claudiu Beznea Date: Thu Jun 15 12:32:19 2023 +0300 clk: at91: clk-master: add support for parent_hw Add support for parent_hw in master clock drivers. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-master were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/20230615093227.576102-4-claudiu.beznea@microchip.com commit 00bd581b52f77ea2a51846a4d43d75eccf322cb2 Author: Claudiu Beznea Date: Thu Jun 15 12:32:18 2023 +0300 clk: at91: clk-generated: add support for parent_hw Add support for parent_hw in generic clock drivers. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-generated were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/20230615093227.576102-3-claudiu.beznea@microchip.com commit b5105e377df929dd7d96628122c13e6852f2fe80 Author: Claudiu Beznea Date: Thu Jun 15 12:32:17 2023 +0300 clk: at91: clk-main: add support for parent_data/parent_hw Add support for parent_data and parent_hw in main oscillator clock drivers. With this parent-child relations are described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-main were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea Reviewed-by: Maxime Ripard Link: https://lore.kernel.org/r/20230615093227.576102-2-claudiu.beznea@microchip.com commit 9f0648f13e34a01f2e1a7a0d5801988a7bca6988 Merge: d18b2a0f1a788 9314d0530276a Author: Linus Walleij Date: Wed Jun 21 09:37:43 2023 +0200 Merge tag 'intel-pinctrl-v6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel intel-pinctrl for v6.5-1 * Fix of OPEN DRAIN pin mode setting in a few drivers * Reduce a scope of spin lock in the Bay Trail driver * Decrease a code footprint by refactoring in a few drivers * Expand string choices and reuse that in the Bay Trail driver The following is an automated git shortlog grouped by driver: baytrail: - invert if condition - add warning for BYT_VAL_REG retrieval failure - reduce scope of spinlock in ->dbg_show() hook - Use str_hi_lo() helper - Use BIT() in BYT_PULL_ASSIGN_* definitions - Unify style of error and debug messages cherryview: - Drop goto label - Return correct value if pin in push-pull mode - Don't use IRQ core constanst for invalid IRQ intel: - refine ->irq_set_type() hook - refine ->set_mux() hook - Add Intel Meteor Lake-S pin controller support lib/string_helpers: - Add str_high_low() helper - Split out string_choices.h - Add missing header files to MAINTAINERS database merrifield: - Use BUFCFG_PINMODE_GPIO in ->pin_dbg_show() - Fix open-drain pin mode configuration moorefield: - Use BUFCFG_PINMODE_GPIO in ->pin_dbg_show() - Fix open-drain pin mode configuration commit 33c01ff3b1003aea11288f2bf7924ada5b5b8327 Author: Michael Walle Date: Fri Jun 16 15:18:41 2023 +0200 ARM: dts: lan966x: kontron-d10: add PHY interrupts With interrupt handling fixed in the MaxLinear PHY driver, see commit 97a89ed101bb ("net: phy: mxl-gpy: disable interrupts on GPY215 by default"), we can finally add the correct interrupt description to the device tree. Signed-off-by: Michael Walle Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230616-feature-d10-dt-cleanups-v1-3-50dd0452b8fe@kernel.org commit fcb79ee3f0b15ed15f35eca5f24e952fdced9c61 Author: Michael Walle Date: Fri Jun 16 15:18:40 2023 +0200 ARM: dts: lan966x: kontron-d10: fix SPI CS The pinctrl node was missing which change the pin mux to GPIO mode. Add it so we don't have to rely on the bootloader to set the correct mode. Fixes: 79d83b3a458e ("ARM: dts: lan966x: add basic Kontron KSwitch D10 support") Signed-off-by: Michael Walle Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230616-feature-d10-dt-cleanups-v1-2-50dd0452b8fe@kernel.org commit bfcd5714f6424c03e385e0e9296dcd69855cfea7 Author: Michael Walle Date: Fri Jun 16 15:18:39 2023 +0200 ARM: dts: lan966x: kontron-d10: fix board reset The pinctrl node was missing which change the pin mux to GPIO mode. Add it. Fixes: 79d83b3a458e ("ARM: dts: lan966x: add basic Kontron KSwitch D10 support") Signed-off-by: Michael Walle [claudiu.beznea: moved pinctrl-* bindings after compatible] Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230616-feature-d10-dt-cleanups-v1-1-50dd0452b8fe@kernel.org commit 15e2d241d160a1a0816588d96b56e54c306fc1da Author: Cristian Birsan Date: Fri Jun 16 18:29:32 2023 +0300 ARM: dts: at91: Enable device-tree overlay support for AT91 boards Add the '-@' DTC option for AT91 boards that have device-tree overlays. This option populates the '__symbols__' node that contains all the necessary symbols for supporting device-tree overlays (from bootloader) on these devices. This change increases the size of the resulting DTB with ~30%-40%. Below are the measurements performed v6.4-rc6: at91-sam9x60_curiosity.dtb 28499 -> 36641 bytes at91-sam9x60ek.dtb 30867 -> 39609 bytes at91-sama5d27_som1_ek.dtb 26086 -> 34166 bytes at91-sama5d27_wlsom1_ek.dtb 26045 -> 33184 bytes at91-sama5d2_icp.dtb 27521 -> 36155 bytes at91-sama5d2_ptc_ek.dtb 23237 -> 29612 bytes at91-sama5d2_xplained.dtb 27262 -> 35326 bytes at91-sama5d3_eds.dtb 27924 -> 39939 bytes at91-sama5d3_xplained.dtb 28400 -> 40650 bytes at91-sama5d4_xplained.dtb 26456 -> 36107 bytes at91-sama7g5ek.dtb 29212 -> 37289 bytes Signed-off-by: Cristian Birsan [claudiu.beznea: s/arm: dts/ARM: dts: at91/ in commit title] Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230616152932.1484154-1-cristian.birsan@microchip.com commit d33ed97dcab3efd7baebfb68cd19ff12f6211448 Author: Johannes Berg Date: Wed Jun 21 09:16:26 2023 +0200 wifi: mac80211: fix documentation config reference We shouldn't refer to CPTCFG_, that's for backports, in mainline that's just CONFIG_. Fix it. Signed-off-by: Johannes Berg commit 2507135e4ff231a368eae38000a501da0b96c662 Author: Gustavo A. R. Silva Date: Tue Jun 20 11:30:36 2023 -0600 readdir: Replace one-element arrays with flexible-array members One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array members in multiple structures. Address the following -Wstringop-overflow warnings seen when built m68k architecture with m5307c3_defconfig configuration: In function '__put_user_fn', inlined from 'fillonedir' at fs/readdir.c:170:2: include/asm-generic/uaccess.h:49:35: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 49 | *(u8 __force *)to = *(u8 *)from; | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ fs/readdir.c: In function 'fillonedir': fs/readdir.c:134:25: note: at offset 1 into destination object 'd_name' of size 1 134 | char d_name[1]; | ^~~~~~ In function '__put_user_fn', inlined from 'filldir' at fs/readdir.c:257:2: include/asm-generic/uaccess.h:49:35: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 49 | *(u8 __force *)to = *(u8 *)from; | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ fs/readdir.c: In function 'filldir': fs/readdir.c:211:25: note: at offset 1 into destination object 'd_name' of size 1 211 | char d_name[1]; | ^~~~~~ This helps with the ongoing efforts to globally enable -Wstringop-overflow. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/312 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Message-Id: Signed-off-by: Christian Brauner commit 672d6ef4c775cfcd2e00172e23df34e77e495e85 Author: Eric Biggers Date: Mon Jun 19 21:19:37 2023 -0700 fsverity: improve documentation for builtin signature support fsverity builtin signatures (CONFIG_FS_VERITY_BUILTIN_SIGNATURES) aren't the only way to do signatures with fsverity, and they have some major limitations. Yet, more users have tried to use them, e.g. recently by https://github.com/ostreedev/ostree/pull/2640. In most cases this seems to be because users aren't sufficiently familiar with the limitations of this feature and what the alternatives are. Therefore, make some updates to the documentation to try to clarify the properties of this feature and nudge users in the right direction. Note that the Integrity Policy Enforcement (IPE) LSM, which is not yet upstream, is planned to use the builtin signatures. (This differs from IMA, which uses its own signature mechanism.) For that reason, my earlier patch "fsverity: mark builtin signatures as deprecated" (https://lore.kernel.org/r/20221208033548.122704-1-ebiggers@kernel.org), which marked builtin signatures as "deprecated", was controversial. This patch therefore stops short of marking the feature as deprecated. I've also revised the language to focus on better explaining the feature and what its alternatives are. Link: https://lore.kernel.org/r/20230620041937.5809-1-ebiggers@kernel.org Reviewed-by: Colin Walters Reviewed-by: Luca Boccassi Signed-off-by: Eric Biggers commit 8d0cf150d299148a97653610c256f10c42f85ce0 Author: Ivan Orlov Date: Tue Jun 20 19:56:34 2023 +0200 sound: make all 'class' structures const Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Ivan Orlov Cc: Greg Kroah-Hartman Cc: Geoff Levand Cc: Thierry Reding Cc: "Uwe Kleine-König" Cc: alsa-devel@alsa-project.org Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230620175633.641141-2-gregkh@linuxfoundation.org Signed-off-by: Takashi Iwai commit 7ea9ee0064281ef630e038f8dd2f6e8f4030a696 Author: Srinivas Kandagatla Date: Mon Jun 19 10:28:05 2023 +0100 ALSA: compress: allow setting codec params after next track For gapless playback it is possible that each track can have different codec profile with same decoder, for example we have WMA album, we may have different tracks as WMA v9, WMA v10 and so on Or if DSP's like QDSP have abililty to switch decoders on single stream for each track, then this call could be used to set new codec parameters. Existing code does not allow to change this profile while doing gapless playback. Reuse existing SNDRV_COMPRESS_SET_PARAMS to set this new track params along some additional checks to enforce proper state machine. With this new changes now the user can call SNDRV_COMPRESS_SET_PARAMS anytime after setting next track and additional check in write should also ensure that params are set before writing new data. Signed-off-by: Srinivas Kandagatla Acked-by: Vinod Koul Link: https://lore.kernel.org/r/20230619092805.21649-1-srinivas.kandagatla@linaro.org Signed-off-by: Takashi Iwai commit 362f9c907fd8c2be3d5c5686ea787bca25443cdc Author: elisabeth Date: Fri Jun 2 14:38:15 2023 +0200 perf jit: Fix incorrect file name in DWARF line table Fixes an issue where an incorrect filename was added in the DWARF line table of an ELF object file when calling 'perf inject --jit' due to not checking the filename of a debug entry against the repeated name marker (/xff/0). The marker is mentioned in the tools/perf/util/jitdump.h header, which describes the jitdump binary format, and indicitates that the filename in a debug entry is the same as the previous enrty. In the function emit_lineno_info(), in the file tools/perf/util/genelf-debug.c, the debug entry filename gets compared to the previous entry filename. If they are not the same, a new filename is added to the DWARF line table. However, since there is no check against '\xff\0', in some cases '\xff\0' is inserted as the filename into the DWARF line table. This can be seen with `objdump --dwarf=line` on the ELF file after `perf inject --jit`. It also makes no source code information show up in 'perf annotate'. Signed-off-by: Elisabeth Panholzer Acked-by: Namhyung Kim Link: https://lore.kernel.org/r/20230602123815.255001-1-paniii94@gmail.com [ Fixed a trailing white space, removed a subject prefix ] Signed-off-by: Namhyung Kim commit bfd8d989210cb6bb1c8e87b7c525831dceb91418 Author: Timothy Pearson Date: Mon Jun 5 13:48:56 2023 -0500 powerpc/iommu: Only build sPAPR access functions on pSeries and PowerNV A build failure with CONFIG_HAVE_PCI=y set without PSERIES or POWERNV set was caught by the random configuration checker. Guard the sPAPR specific IOMMU functions on CONFIG_PPC_PSERIES || CONFIG_PPC_POWERNV. Signed-off-by: Timothy Pearson Signed-off-by: Michael Ellerman Link: https://msgid.link/2015925968.3546872.1685990936823.JavaMail.zimbra@raptorengineeringinc.com commit 331e2cad6d168ac5ccb25ae34bdc305b8b731bc0 Author: Rohan McLure Date: Wed May 10 13:31:15 2023 +1000 powerpc: powernv: Annotate data races in opal events The kopald thread handles opal events as they appear, but by polling a static bit-vector in last_outstanding_events. Annotate these data races accordingly. We are not at risk of missing events, but use of READ_ONCE, WRITE_ONCE will assist readers in seeing that kopald only consumes the events it is aware of when it is scheduled. Also removes extraneous KCSAN warnings. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230510033117.1395895-10-rmclure@linux.ibm.com commit 86dacd967b80114c0c6cf0648ed1dcaea8853937 Author: Rohan McLure Date: Wed May 10 13:31:14 2023 +1000 powerpc: Mark writes registering ipi to host cpu through kvm and polling Mark writes to hypervisor ipi state so that KCSAN recognises these asynchronous issue of kvmppc_{set,clear}_host_ipi to be intended, with atomic writes. Mark asynchronous polls to this variable in kvm_ppc_read_one_intr(). Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230510033117.1395895-9-rmclure@linux.ibm.com commit 8608f14b49a0a3f8644a326d32dc1bf7ed78836a Author: Rohan McLure Date: Wed May 10 13:31:13 2023 +1000 powerpc: Annotate accesses to ipi message flags IPI message flags are observed and consequently consumed in the smp_ipi_demux_relaxed function, which handles these message sources until it observes none more arriving. Mark the checked loop guard with READ_ONCE, to signal to KCSAN that the read is known to be volatile, and that non-determinism is expected. Mark write for message source in smp_muxed_ipi_set_message(). Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230510033117.1395895-8-rmclure@linux.ibm.com commit b0c5b4f1ee3687c57dab65ac0729a4d61967f032 Author: Rohan McLure Date: Wed May 10 13:31:12 2023 +1000 powerpc: powernv: Fix KCSAN datarace warnings on idle_state contention The idle_state entry in the PACA on PowerNV features a bit which is atomically tested and set through ldarx/stdcx. to be used as a spinlock. This lock then guards access to other bit fields of idle_state. KCSAN cannot differentiate between any of these bitfield accesses as they all are implemented by 8-byte store/load instructions, thus cores contending on the bit-lock appear to data race with modifications to idle_state. Separate the bit-lock entry from the data guarded by the lock to avoid the possibility of data races being detected by KCSAN. Suggested-by: Nicholas Piggin Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230510033117.1395895-7-rmclure@linux.ibm.com commit be286b8637d417a7d7eb25dc3a509c10d0afef66 Author: Rohan McLure Date: Wed May 10 13:31:10 2023 +1000 powerpc: Mark [h]ssr_valid accesses in check_return_regs_valid Checks to see if the [H]SRR registers have been clobbered by (soft) NMI interrupts imply the possibility for a data race on the [h]srr_valid entries in the PACA. Annotate accesses to these fields with READ_ONCE, removing the need for the barrier. The diagnostic can use plain-access reads and writes, but annotate with data_race. Signed-off-by: Rohan McLure Reported-by: Michael Ellerman Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230510033117.1395895-5-rmclure@linux.ibm.com commit 6f3136326ee47ae2dd5dac9306c9b08ccbc7e81e Author: Rohan McLure Date: Wed May 10 13:31:08 2023 +1000 powerpc: qspinlock: Enforce qnode writes prior to publishing to queue Annotate the release barrier and memory clobber (in effect, producing a compiler barrier) in the publish_tail_cpu call. These barriers have the effect of ensuring that qnode attributes are all written to prior to publish the node to the waitqueue. Even while the initial write to the 'locked' attribute is guaranteed to terminate prior to the node being visible, KCSAN still complains that the write is reorderable by the compiler. Issue a kcsan_release() to inform KCSAN of the release barrier contained in publish_tail_cpu(). Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230510033117.1395895-3-rmclure@linux.ibm.com commit 03d44ee80eac980a869ed3d5637ed85de6fb957f Author: Rohan McLure Date: Wed May 10 13:31:07 2023 +1000 powerpc: qspinlock: Mark accesses to qnode lock checks The powerpc implementation of qspinlocks will both poll and spin on the bitlock guarding a qnode. Mark these accesses with READ_ONCE to convey to KCSAN that polling is intentional here. Signed-off-by: Rohan McLure Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230510033117.1395895-2-rmclure@linux.ibm.com commit 98e61df570f06e8a2a2152bb3485c60fe1b148cb Author: Joel Stanley Date: Tue Jun 13 14:22:02 2023 +0930 powerpc/powernv/pci: Remove last IODA1 defines Signed-off-by: Joel Stanley Signed-off-by: Michael Ellerman Link: https://msgid.link/20230613045202.294451-4-joel@jms.id.au commit 326b3f8c6efca7ddc95f164bc0c8fa1c57d7a84f Author: Joel Stanley Date: Tue Jun 13 14:22:01 2023 +0930 powerpc/powernv/pci: Remove MVE code With IODA1 support gone the OPAL calls to set MVE are dead code. Remove them. Signed-off-by: Joel Stanley Signed-off-by: Michael Ellerman Link: https://msgid.link/20230613045202.294451-3-joel@jms.id.au commit 5ac129cdb50b4efda59ee5ea7c711996a3637b34 Author: Joel Stanley Date: Tue Jun 13 14:22:00 2023 +0930 powerpc/powernv/pci: Remove ioda1 support The final "VPL" Power7 boxes that were used for powernv bringup have been scrapped, meaning there are no machines with ioda1 left. This patch removes the obvious unused code. Signed-off-by: Joel Stanley Signed-off-by: Michael Ellerman Link: https://msgid.link/20230613045202.294451-2-joel@jms.id.au commit d65305bfa6f797712b928bd8f4781380726b70a0 Author: Rob Herring Date: Wed Jun 14 11:17:23 2023 -0600 powerpc: 52xx: Make immr_id DT match tables static In some builds, the mpc52xx_pm_prepare()/lite5200_pm_prepare() functions generate stack size warnings. The addition of 'struct resource' in commit 2500763dd3db ("powerpc: Use of_address_to_resource()") grew the stack size and is blamed for the warnings. However, the real issue is there's no reason the 'struct of_device_id immr_ids' DT match tables need to be on the stack as they are constant. Declare them as static to move them off the stack. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306130405.uTv5yOZD-lkp@intel.com/ Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman Link: https://msgid.link/20230614171724.2403982-1-robh@kernel.org commit ef8e341075330b3d0e06d4b026d971e7e4ce378b Author: Rob Herring Date: Fri Jun 9 12:32:32 2023 -0600 powerpc: mpc512x: Remove open coded "ranges" parsing "ranges" is a standard property, and we have common helper functions for parsing it, so let's use the for_each_of_range() iterator. Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman Link: https://msgid.link/20230609183232.1767050-1-robh@kernel.org commit be0f9ca024b3ae17fac6b15c04519840f3418269 Author: Rob Herring Date: Fri Jun 9 12:32:38 2023 -0600 powerpc: fsl_soc: Use of_range_to_resource() for "ranges" parsing "ranges" is a standard property with common parsing functions. Users shouldn't be implementing their own parsing of it. Refactor the FSL RapidIO "ranges" parsing to use of_range_to_resource() instead. Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman Link: https://msgid.link/20230609183238.1767186-1-robh@kernel.org commit f892ac774b34a769318030f5febe5ce41d6e122e Author: Rob Herring Date: Fri Jun 9 12:31:50 2023 -0600 powerpc: fsl: Use of_property_read_reg() to parse "reg" Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Signed-off-by: Rob Herring [mpe: Add required include of of_address.h] Signed-off-by: Michael Ellerman Link: https://msgid.link/20230609183151.1766261-1-robh@kernel.org commit c4ae1799a5a358388acb610512c68666f8758364 Author: Rob Herring Date: Fri Jun 9 12:32:44 2023 -0600 powerpc: fsl_rio: Use of_range_to_resource() for "ranges" parsing "ranges" is a standard property with common parsing functions. Users shouldn't be implementing their own parsing of it. Refactor the FSL RapidIO "ranges" parsing to use of_range_to_resource() instead. One change is the original code would look for "#size-cells" and "#address-cells" in the parent node if not found in the port child nodes. That is non-standard behavior and not necessary AFAICT. In 2011 in commit 54986964c13c ("powerpc/85xx: Update SRIO device tree nodes") there was an ABI break. The upstream .dts files have been correct since at least that point. Signed-off-by: Rob Herring [mpe: Remove now unused "cell" variable] Signed-off-by: Michael Ellerman Link: https://msgid.link/20230609183244.1767325-1-robh@kernel.org "ranges" is a standard property with common parsing functions. Users shouldn't be implementing their own parsing of it. Refactor the FSL RapidIO "ranges" parsing to use of_range_to_resource() instead. One change is the original code would look for "#size-cells" and "#address-cells" in the parent node if not found in the port child nodes. That is non-standard behavior and not necessary AFAICT. In 2011 in commit 54986964c13c ("powerpc/85xx: Update SRIO device tree nodes") there was an ABI break. The upstream .dts files have been correct since at least that point. Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman Link: https://msgid.link/20230609183244.1767325-1-robh@kernel.org commit 4ca0d340ce206985d9b9956993d7c81eeb1d3198 Author: WANG Rui Date: Tue Jun 20 21:20:25 2023 +0800 perf annotate: Fix instruction association and parsing for LoongArch In the perf annotate view for LoongArch, there is no arrowed line pointing to the target from the branch instruction. This issue is caused by incorrect instruction association and parsing. $ perf record alloc-6276705c94ad1398 # rust benchmark $ perf report 0.28 │ ori $a1, $zero, 0x63 │ move $a2, $zero 10.55 │ addi.d $a3, $a2, 1(0x1) │ sltu $a4, $a3, $s7 9.53 │ masknez $a4, $s7, $a4 │ sub.d $a3, $a3, $a4 12.12 │ st.d $a1, $fp, 24(0x18) │ st.d $a3, $fp, 16(0x10) 16.29 │ slli.d $a2, $a2, 0x2 │ ldx.w $a2, $s8, $a2 12.77 │ st.w $a2, $sp, 724(0x2d4) │ st.w $s0, $sp, 720(0x2d0) 7.03 │ addi.d $a2, $sp, 720(0x2d0) │ addi.d $a1, $a1, -1(0xfff) 12.03 │ move $a2, $a3 │ → bne $a1, $s3, -52(0x3ffcc) # 82ce8 2.50 │ addi.d $a0, $a0, 1(0x1) This patch fixes instruction association issues, such as associating branch instructions with jump_ops instead of call_ops, and corrects false instruction matches. It also implements branch instruction parsing specifically for LoongArch. With this patch, we will be able to see the arrowed line. 0.79 │3ec: ori $a1, $zero, 0x63 │ move $a2, $zero 10.32 │3f4:┌─→addi.d $a3, $a2, 1(0x1) │ │ sltu $a4, $a3, $s7 10.44 │ │ masknez $a4, $s7, $a4 │ │ sub.d $a3, $a3, $a4 14.17 │ │ st.d $a1, $fp, 24(0x18) │ │ st.d $a3, $fp, 16(0x10) 13.15 │ │ slli.d $a2, $a2, 0x2 │ │ ldx.w $a2, $s8, $a2 11.00 │ │ st.w $a2, $sp, 724(0x2d4) │ │ st.w $s0, $sp, 720(0x2d0) 8.00 │ │ addi.d $a2, $sp, 720(0x2d0) │ │ addi.d $a1, $a1, -1(0xfff) 11.99 │ │ move $a2, $a3 │ └──bne $a1, $s3, 3f4 3.17 │ addi.d $a0, $a0, 1(0x1) Signed-off-by: WANG Rui Acked-by: Namhyung Kim Cc: Mark Rutland Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: loongarch@lists.linux.dev Cc: loongson-kernel@lists.loongnix.cn Cc: Huacai Chen Cc: Tiezhu Yang Cc: Ingo Molnar Cc: WANG Xuerui Link: https://lore.kernel.org/r/20230620132025.105563-1-wangrui@loongson.cn Signed-off-by: Namhyung Kim commit 6f3bdbbeafbbcb1a6540307e4eaee10ecae4f9a5 Author: Rob Herring Date: Fri Jun 9 12:29:25 2023 -0600 macintosh: Use of_property_read_reg() to parse "reg" Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman Link: https://msgid.link/20230609182926.1763589-1-robh@kernel.org commit 93cfa6fb9f78f472862240208ef6e5a65f58f775 Author: Rob Herring Date: Sun Mar 19 11:32:26 2023 -0500 macintosh: Use of_address_to_resource() Replace open coded reading of "reg" and of_translate_address() calls with single call to of_address_to_resource(). Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman Link: https://msgid.link/20230319163226.226583-1-robh@kernel.org commit bc1cf75027585f8d87f94e464ee5909acf885a8c Author: Rob Herring Date: Sun Mar 19 09:59:31 2023 -0500 powerpc: powermac: Use of_get_cpu_hwid() to read CPU node 'reg' Replace open coded reading of CPU nodes' "reg" properties with of_get_cpu_hwid() dedicated for this purpose. Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman Link: https://msgid.link/20230319145931.65499-1-robh@kernel.org commit b751ed04bc5e1b76f2885b846ea8289792a37166 Author: Paul Gortmaker Date: Tue Jun 20 00:33:00 2023 -0400 powerpc: drop MPC85xx_CDS platform support The MPC8541/8548/8555 Configurable Development System (CDS) were the vehicle used to provide evaluation of the 1st e500-v2 CPUs around 2007. Similar to the earlier MPC83xx-MDS systems we removed, the "brains" exist on a PCI-X card, but additional connectors exist to the right of the PCI-X slot, two structural metal pins are used to provide stability in a vertical ATX mounting, and the CPU is now on a daughter-card vs. a clamped down BGA. Given the extra complexity and risk of connector damage, the 8548CDS I had access to came pre-assembled in a basic white Antec case common for that era, and I'm inclined to assume that was the default. Power was typical "Pentium4" 2005 ATX - the main 20 pin connector went to the PCI ATX form factor backplane, and the 4 pin black/yellow went to the CPU card. Like previous evaluation boards, they attempted to provide break-out connectors for as many features as possible, and that made for a fairly complex looking system. In any case, these are over 15 years old, and fairly complex systems, originally made for a small group of industry related people, and made for use where quiet fan operation wasn't important. Given that, it makes sense to remove support from them in 2023. Signed-off-by: Paul Gortmaker Signed-off-by: Michael Ellerman Link: https://msgid.link/20230620043300.197546-3-paul.gortmaker@windriver.com commit 384e338a9187e479349c97c9cfb36f6060708db8 Author: Paul Gortmaker Date: Tue Jun 20 00:32:59 2023 -0400 powerpc: drop MPC8540_ADS and MPC8560_ADS platform support Based on the revision history in the manual(s), these e500-v1 platforms were first available around 2002. Like a lot of evaluation boards, they attempted to provide break-out connectors for all possible features, and that combined with four PCI-X slots (and the age/era) meant for a considerably large board. As I recall it, from a Linux point of view, the biggest difference between 8540 and 8560 was in the UART implementation, and that is reflected in a diff of the defconfigs. In any case, these are over 20 years old, and by today's standards only have a small amount of DDR1 memory, and were not widely available. Given that, it makes sense to remove support from them in 2023. Signed-off-by: Paul Gortmaker Signed-off-by: Michael Ellerman Link: https://msgid.link/20230620043300.197546-2-paul.gortmaker@windriver.com commit e66effaf61ffb1dc6088492ca3a0e98dcbf1c10d Author: Nayna Jain Date: Thu Jun 8 08:04:44 2023 -0400 security/integrity: fix pointer to ESL data and its size on pseries On PowerVM guest, variable data is prefixed with 8 bytes of timestamp. Extract ESL by stripping off the timestamp before passing to ESL parser. Fixes: 4b3e71e9a34c ("integrity/powerpc: Support loading keys from PLPKS") Cc: stable@vger.kenrnel.org # v6.3 Signed-off-by: Nayna Jain Tested-by: Nageswara R Sastry Acked-by: Jarkko Sakkinen Signed-off-by: Michael Ellerman Link: https://msgid.link/20230608120444.382527-1-nayna@linux.ibm.com commit c8eebc4a99f15280654f23e914e746c40a516e50 Author: Aneesh Kumar K.V Date: Fri Jun 16 16:38:15 2023 +0530 powerpc/mm/dax: Fix the condition when checking if altmap vmemap can cross-boundary Without this fix, the last subsection vmemmap can end up in memory even if the namespace is created with -M mem and has sufficient space in the altmap area. Fixes: cf387d9644d8 ("libnvdimm/altmap: Track namespace boundaries in altmap") Signed-off-by: Aneesh Kumar K.V Tested-by: Sachin Sant > Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616110826.344417-6-aneesh.kumar@linux.ibm.com commit d933557b858f78d7b702e70614b469a84b72e56c Author: Aneesh Kumar K.V Date: Fri Jun 16 16:38:14 2023 +0530 powerpc/book3s64/mm: Use PAGE_KERNEL instead of opencoding No functional change in this patch. Signed-off-by: Aneesh Kumar K.V Tested-by: Sachin Sant > Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616110826.344417-5-aneesh.kumar@linux.ibm.com commit 0da90af431abc3f497a38ec9ef6e43b0d0dabe80 Author: Aneesh Kumar K.V Date: Fri Jun 16 16:38:13 2023 +0530 powerpc/book3s64/mm: Fix DirectMap stats in /proc/meminfo On memory unplug reduce DirectMap page count correctly. root@ubuntu-guest:# grep Direct /proc/meminfo DirectMap4k: 0 kB DirectMap64k: 0 kB DirectMap2M: 115343360 kB DirectMap1G: 0 kB Before fix: root@ubuntu-guest:# ndctl disable-namespace all disabled 1 namespace root@ubuntu-guest:# grep Direct /proc/meminfo DirectMap4k: 0 kB DirectMap64k: 0 kB DirectMap2M: 115343360 kB DirectMap1G: 0 kB After fix: root@ubuntu-guest:# ndctl disable-namespace all disabled 1 namespace root@ubuntu-guest:# grep Direct /proc/meminfo DirectMap4k: 0 kB DirectMap64k: 0 kB DirectMap2M: 104857600 kB DirectMap1G: 0 kB Fixes: a2dc009afa9a ("powerpc/mm/book3s/radix: Add mapping statistics") Signed-off-by: Aneesh Kumar K.V Tested-by: Sachin Sant > Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616110826.344417-4-aneesh.kumar@linux.ibm.com commit f0b6a834a8f0d267a112b150827bb65d4fdc471c Author: Paulo Alcantara Date: Mon Jun 19 19:23:13 2023 -0300 smb: client: fix warning in generic_ip_connect() This fixes the following warning reported by kernel test robot fs/smb/client/connect.c:2974 generic_ip_connect() error: we previously assumed 'socket' could be null (see line 2962) Link: https://lore.kernel.org/all/202306170124.CtQqzf0I-lkp@intel.com/ Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 215533f888dcf18f7cfbbf520bdd52e67ac6265a Author: Paulo Alcantara Date: Mon Jun 19 18:41:00 2023 -0300 smb: client: fix warning in CIFSFindNext() This fixes the following warning reported by kernel test robot fs/smb/client/cifssmb.c:4216 CIFSFindNext() warn: missing error code? 'rc' Link: https://lore.kernel.org/all/202306170124.CtQqzf0I-lkp@intel.com/ Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 032137fe136a6073dcc699ee15fa3fd05fd77f21 Author: Paulo Alcantara Date: Mon Jun 19 17:58:52 2023 -0300 smb: client: fix warning in CIFSFindFirst() This fixes the following warning reported by kernel test robot fs/smb/client/cifssmb.c:4089 CIFSFindFirst() warn: missing error code? 'rc' Link: https://lore.kernel.org/all/202306170124.CtQqzf0I-lkp@intel.com/ Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit e8eeca0bf4466ee1b196346d3a247535990cf44d Author: Steve French Date: Mon Jun 19 22:32:38 2023 -0500 smb3: do not reserve too many oplock credits There were cases reported where servers will sometimes return more credits than requested on oplock break responses, which can lead to most of the credits being allocated for oplock breaks (instead of for normal operations like read and write) if number of SMB3 requests in flight always stays above 0 (the oplock and echo credits are rebalanced when in flight requests goes down to zero). If oplock credits gets unexpectedly large (e.g. three is more than it would ever be expected to be) and in flight requests are greater than zero, then rebalance the oplock credits and regular credits (go back to reserving just one oplock credit). Signed-off-by: Steve French commit acf35d79ee8c1cce0f879efe6446cf81e5491c36 Author: Steve French Date: Mon Jun 19 20:45:33 2023 -0500 cifs: print more detail when invalidate_inode_mapping fails We had seen cases where cifs_invalidate_mapping was logging: "Could not invalidate inode ..." if invalidate_inode_pages2 fails but this message does not show what the rc is. Update the logged message to also log the return code. Suggested-by: Shyam Prasad N Reviewed-by: Shyam Prasad N Signed-off-by: Steve French commit 12c30f33cc6769bf411088a2872843c4f9ea32f9 Author: Paulo Alcantara Date: Mon Jun 19 16:24:37 2023 -0300 smb: client: fix warning in cifs_smb3_do_mount() This fixes the following warning reported by kernel test robot fs/smb/client/cifsfs.c:982 cifs_smb3_do_mount() warn: possible memory leak of 'cifs_sb' Link: https://lore.kernel.org/all/202306170124.CtQqzf0I-lkp@intel.com/ Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 4cb13ff1437e21a698cae15154e75f1825f9394b Merge: f61d2d5cf1424 8c4d92e82d500 Author: Jakub Kicinski Date: Tue Jun 20 20:44:39 2023 -0700 Merge branch 'net-stmmac-dwmac-qcom-ethqos-add-support-for-emac4' Bartosz Golaszewski says: ==================== net: stmmac: dwmac-qcom-ethqos: add support for EMAC4 Extend the dwmac-qcom-ethqos driver to support EMAC4. While at it: rework the code somewhat. The bindings have been reviewed by DT maintainers. This is a sub-series of [1] with only the patches targetting the net subsystem as they can go in independently. [1] https://lore.kernel.org/lkml/20230617001644.4e093326@kernel.org/T/ ==================== Link: https://lore.kernel.org/r/20230619092402.195578-1-brgl@bgdev.pl Signed-off-by: Jakub Kicinski commit 8c4d92e82d500a65e7dba101ea38e4f3499dc428 Author: Bartosz Golaszewski Date: Mon Jun 19 11:24:02 2023 +0200 net: stmmac: dwmac-qcom-ethqos: add support for emac4 on sa8775p platforms sa8775p uses EMAC version 4, add the relevant defines, rename the has_emac3 switch to has_emac_ge_3 (has emac greater-or-equal than 3) and add the new compatible. Signed-off-by: Bartosz Golaszewski Signed-off-by: Jakub Kicinski commit d0e3d29f8771068a6f8df2a148080c449bc5b046 Author: Bartosz Golaszewski Date: Mon Jun 19 11:24:01 2023 +0200 dt-bindings: net: qcom,ethqos: add description for sa8775p Add the compatible for the MAC controller on sa8775p platforms. This MAC works with a single interrupt so add minItems to the interrupts property. The fourth clock's name is different here so change it. Enable relevant PHY properties. Add the relevant compatibles to the binding document for snps,dwmac as well. Signed-off-by: Bartosz Golaszewski Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit aa571b6275fb60da443c490ebeef021a6897d332 Author: Bartosz Golaszewski Date: Mon Jun 19 11:24:00 2023 +0200 net: stmmac: add new switch to struct plat_stmmacenet_data On some platforms, the PCS can be integrated in the MAC so the driver will not see any PCS link activity. Add a switch that allows the platform drivers to let the core code know. Signed-off-by: Bartosz Golaszewski Reviewed-by: Jose Abreu Signed-off-by: Jakub Kicinski commit 463120c31c58bbca0237dd6ae73d20f77609c749 Author: Bartosz Golaszewski Date: Mon Jun 19 11:23:59 2023 +0200 net: stmmac: dwmac-qcom-ethqos: add support for SGMII On sa8775p the MAC is connected to the external PHY over SGMII so add support for it to the driver. Signed-off-by: Bartosz Golaszewski Signed-off-by: Jakub Kicinski commit 25c4a0769443d77c74fe73c80a978e28b08dc976 Author: Bartosz Golaszewski Date: Mon Jun 19 11:23:58 2023 +0200 net: stmmac: dwmac-qcom-ethqos: prepare the driver for more PHY modes In preparation for supporting SGMII, let's make the code a bit more generic. Add a new callback for MAC configuration so that we can assign a different variant of it in the future. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Signed-off-by: Jakub Kicinski commit feeb27165c46c1956c9ee002d306a2ed196fa5f0 Author: Bartosz Golaszewski Date: Mon Jun 19 11:23:57 2023 +0200 net: stmmac: dwmac-qcom-ethqos: add support for the phyaux clock On sa8775p, the EMAC revision is 4 and we use SGMII instead of RGMII. There's no "rgmii" clock but there's a fourth clock under a different name: "phyaux". Add a new field to the chip data struct that specifies the link clock name. Default to "rgmii" for backward compatibility. Signed-off-by: Bartosz Golaszewski Signed-off-by: Jakub Kicinski commit 0dec3b48aa4edb653ba8ed8a62970bc0698f5bc1 Author: Bartosz Golaszewski Date: Mon Jun 19 11:23:56 2023 +0200 net: stmmac: dwmac-qcom-ethqos: add support for the optional serdes phy On sa8775p platforms, there's a SGMII SerDes PHY between the MAC and external PHY that we need to enable and configure. Signed-off-by: Bartosz Golaszewski Signed-off-by: Jakub Kicinski commit f2b1758554eb026939407ed03e38dd5d43978cb4 Author: Bartosz Golaszewski Date: Mon Jun 19 11:23:55 2023 +0200 net: stmmac: dwmac-qcom-ethqos: remove stray space There's an unnecessary space in the rgmii_updatel() function, remove it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Signed-off-by: Jakub Kicinski commit 97f73bc59e1620c70635be68ab7ee91779bdf03e Author: Bartosz Golaszewski Date: Mon Jun 19 11:23:54 2023 +0200 net: stmmac: dwmac-qcom-ethqos: add a newline between headers Typically we use a newline between global and local headers so add it here as well. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Signed-off-by: Jakub Kicinski commit ee8dacca2fd3ff437b787f83fb569197a89894fd Author: Bartosz Golaszewski Date: Mon Jun 19 11:23:53 2023 +0200 net: stmmac: dwmac-qcom-ethqos: add missing include device_get_phy_mode() is declared in linux/property.h but this header is not included. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Signed-off-by: Jakub Kicinski commit 302555a0ae3362b38eddd1df9b8d4b176050fc92 Author: Bartosz Golaszewski Date: Mon Jun 19 11:23:52 2023 +0200 net: stmmac: dwmac-qcom-ethqos: use a helper variable for &pdev->dev Shrink code and avoid line breaks by using a helper variable for &pdev->dev. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Signed-off-by: Jakub Kicinski commit 7b5e64a9382528d5e3db0fe714b03090a4b1433b Author: Bartosz Golaszewski Date: Mon Jun 19 11:23:51 2023 +0200 net: stmmac: dwmac-qcom-ethqos: tweak the order of local variables Make sure we follow the reverse-xmas tree convention. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Signed-off-by: Jakub Kicinski commit 9bc580609139cfc1f559cdc4bfb2f4862b38503d Author: Bartosz Golaszewski Date: Mon Jun 19 11:23:50 2023 +0200 net: stmmac: dwmac-qcom-ethqos: rename a label in probe() The err_mem label's name is unclear. It actually should be reached on any error after stmmac_probe_config_dt() succeeds. Name it after the cleanup action that needs to be called before exiting. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Signed-off-by: Jakub Kicinski commit 9fc68f23a6d3729ccbeb6ca7da6de0bc399f9ddb Author: Bartosz Golaszewski Date: Mon Jun 19 11:23:49 2023 +0200 net: stmmac: dwmac-qcom-ethqos: shrink clock code with devres We can use a devm action to completely drop the remove callback and use stmmac_pltfr_remove() directly for remove. We can also drop one of the goto labels. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Signed-off-by: Jakub Kicinski commit f61d2d5cf142436cd1a02ddc78425e91116b8b0d Author: Arnd Bergmann Date: Mon Jun 19 11:12:10 2023 +0200 sfc: fix uninitialized variable use The new efx_bind_neigh() function contains a broken code path when IPV6 is disabled: drivers/net/ethernet/sfc/tc_encap_actions.c:144:7: error: variable 'n' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (encap->type & EFX_ENCAP_FLAG_IPV6) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sfc/tc_encap_actions.c:184:8: note: uninitialized use occurs here if (!n) { ^ drivers/net/ethernet/sfc/tc_encap_actions.c:144:3: note: remove the 'if' if its condition is always false if (encap->type & EFX_ENCAP_FLAG_IPV6) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sfc/tc_encap_actions.c:141:22: note: initialize the variable 'n' to silence this warning struct neighbour *n; ^ = NULL Change it to use the existing error handling path here. Fixes: 7e5e7d800011a ("sfc: neighbour lookup for TC encap action offload") Suggested-by: Edward Cree Signed-off-by: Arnd Bergmann Reviewed-by: Edward Cree Link: https://lore.kernel.org/r/20230619091215.2731541-2-arnd@kernel.org Signed-off-by: Jakub Kicinski commit 40cba83370c2c97fd970cb0e273e76f99f0f2db6 Author: Arnd Bergmann Date: Mon Jun 19 11:12:09 2023 +0200 sfc: add CONFIG_INET dependency for TC offload The driver now fails to link when CONFIG_INET is disabled, so add an explicit Kconfig dependency: ld.lld: error: undefined symbol: ip_route_output_flow >>> referenced by tc_encap_actions.c >>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_flower_create_encap_md) in archive vmlinux.a ld.lld: error: undefined symbol: ip_send_check >>> referenced by tc_encap_actions.c >>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_gen_encap_header) in archive vmlinux.a >>> referenced by tc_encap_actions.c >>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_gen_encap_header) in archive vmlinux.a ld.lld: error: undefined symbol: arp_tbl >>> referenced by tc_encap_actions.c >>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_netevent_event) in archive vmlinux.a >>> referenced by tc_encap_actions.c >>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_netevent_event) in archive vmlinux.a Fixes: a1e82162af0b8 ("sfc: generate encap headers for TC offload") Reviewed-by: Edward Cree Reviewed-by: Simon Horman Closes: https://lore.kernel.org/oe-kbuild-all/202306151656.yttECVTP-lkp@intel.com/ Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230619091215.2731541-1-arnd@kernel.org Signed-off-by: Jakub Kicinski commit b7c31ccd60d1df4634670e3eb9902baa19b9517b Author: Andrew Lunn Date: Tue Jun 20 00:03:32 2023 +0200 net: phy-c45: Fix genphy_c45_ethtool_set_eee description The text has been cut/paste from genphy_c45_ethtool_get_eee but not changed to reflect it performs set. Additionally, extend the comment. This function implements the logic that eee_enabled has global control over EEE. When eee_enabled is false, no link modes will be advertised, and as a result, the MAC should not transmit LPI. Signed-off-by: Andrew Lunn Link: https://lore.kernel.org/r/20230619220332.4038924-1-andrew@lunn.ch Signed-off-by: Jakub Kicinski commit 634236b34d7a8c9e11c12b0746b83b8942fc8f2e Author: Eric Dumazet Date: Mon Jun 19 12:43:35 2023 +0000 net: remove sk_is_ipmr() and sk_is_icmpv6() helpers Blamed commit added these helpers for sake of detecting RAW sockets specific ioctl. syzbot complained about it [1]. Issue here is that RAW sockets could pretend there was no need to call ipmr_sk_ioctl() Regardless of inet_sk(sk)->inet_num, we must be prepared for ipmr_ioctl() being called later. This must happen from ipmr_sk_ioctl() context only. We could add a safety check in ipmr_ioctl() at the risk of breaking applications. Instead, remove sk_is_ipmr() and sk_is_icmpv6() because their name would be misleading, once we change their implementation. [1] BUG: KASAN: stack-out-of-bounds in ipmr_ioctl+0xb12/0xbd0 net/ipv4/ipmr.c:1654 Read of size 4 at addr ffffc90003aefae4 by task syz-executor105/5004 CPU: 0 PID: 5004 Comm: syz-executor105 Not tainted 6.4.0-rc6-syzkaller-01304-gc08afcdcf952 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 ipmr_ioctl+0xb12/0xbd0 net/ipv4/ipmr.c:1654 raw_ioctl+0x4e/0x1e0 net/ipv4/raw.c:881 sock_ioctl_out net/core/sock.c:4186 [inline] sk_ioctl+0x151/0x440 net/core/sock.c:4214 inet_ioctl+0x18c/0x380 net/ipv4/af_inet.c:1001 sock_do_ioctl+0xcc/0x230 net/socket.c:1189 sock_ioctl+0x1f8/0x680 net/socket.c:1306 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f2944bf6ad9 Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd8897a028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f2944bf6ad9 RDX: 0000000000000000 RSI: 00000000000089e1 RDI: 0000000000000003 RBP: 00007f2944bbac80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f2944bbad10 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to stack of task syz-executor105/5004 and is located at offset 36 in frame: sk_ioctl+0x0/0x440 net/core/sock.c:4172 This frame has 2 objects: [32, 36) 'karg' [48, 88) 'buffer' Fixes: e1d001fa5b47 ("net: ioctl: Use kernel memory on protocol ioctl callbacks") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Breno Leitao Cc: Kuniyuki Iwashima Reviewed-by: Jiri Pirko Reviewed-by: David Ahern Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/20230619124336.651528-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 3a4f0edbb7939a16abb54668642ceed1decdbf4a Author: Eric Dumazet Date: Mon Jun 19 07:27:40 2023 +0000 ipv6: fix a typo in ip6mr_sk_ioctl() SIOCGETSGCNT_IN6 uses a "struct sioc_sg_req6 buffer". Unfortunately the blamed commit made hard to ensure type safety. syzbot reported: BUG: KASAN: stack-out-of-bounds in ip6mr_ioctl+0xba3/0xcb0 net/ipv6/ip6mr.c:1917 Read of size 16 at addr ffffc900039afb68 by task syz-executor937/5008 CPU: 1 PID: 5008 Comm: syz-executor937 Not tainted 6.4.0-rc6-syzkaller-01304-gc08afcdcf952 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 ip6mr_ioctl+0xba3/0xcb0 net/ipv6/ip6mr.c:1917 rawv6_ioctl+0x4e/0x1e0 net/ipv6/raw.c:1143 sock_ioctl_out net/core/sock.c:4186 [inline] sk_ioctl+0x151/0x440 net/core/sock.c:4214 inet6_ioctl+0x1b8/0x290 net/ipv6/af_inet6.c:582 sock_do_ioctl+0xcc/0x230 net/socket.c:1189 sock_ioctl+0x1f8/0x680 net/socket.c:1306 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f255849bad9 Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd06792778 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f255849bad9 RDX: 0000000000000000 RSI: 00000000000089e1 RDI: 0000000000000003 RBP: 00007f255845fc80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f255845fd10 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to stack of task syz-executor937/5008 and is located at offset 40 in frame: sk_ioctl+0x0/0x440 net/core/sock.c:4172 This frame has 2 objects: [32, 36) 'karg' [48, 88) 'buffer' Fixes: e1d001fa5b47 ("net: ioctl: Use kernel memory on protocol ioctl callbacks") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Cc: David Ahern Cc: Kuniyuki Iwashima Reviewed-by: Breno Leitao Link: https://lore.kernel.org/r/20230619072740.464528-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 365eb32e4b456064aea4db61adc0a65b8a09bc80 Author: Ratheesh Kannoth Date: Mon Jun 19 11:36:38 2023 +0530 octeontx2-pf: TC flower offload support for rxqueue mapping TC rule support to offload rx queue mapping rules. Eg: tc filter add dev eth2 ingress protocol ip flower \ dst_ip 192.168.8.100 \ action skbedit queue_mapping 4 skip_sw action mirred ingress redirect dev eth5 Packets destined to 192.168.8.100 will be forwarded to rx queue 4 of eth5 interface. tc filter add dev eth2 ingress protocol ip flower \ dst_ip 192.168.8.100 \ action skbedit queue_mapping 9 skip_sw Packets destined to 192.168.8.100 will be forwarded to rx queue 4 of eth2 interface. Signed-off-by: Ratheesh Kannoth Link: https://lore.kernel.org/r/20230619060638.1032304-1-rkannoth@marvell.com Signed-off-by: Jakub Kicinski commit f0d952646bcf186d6d1bea6ec89f96b7e57f3b83 Author: Christophe JAILLET Date: Sun Jun 18 12:16:41 2023 +0200 netlabel: Reorder fields in 'struct netlbl_domaddr6_map' Group some variables based on their sizes to reduce hole and avoid padding. On x86_64, this shrinks the size of 'struct netlbl_domaddr6_map' from 72 to 64 bytes. It saves a few bytes of memory and is more cache-line friendly. Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Reviewed-by: Jiri Pirko Acked-by: Paul Moore Link: https://lore.kernel.org/r/aa109847260e51e174c823b6d1441f75be370f01.1687083361.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 92b08290859b09a2ead2dc553aaaadb015748536 Author: Christophe JAILLET Date: Sun Jun 18 11:46:46 2023 +0200 mptcp: Reorder fields in 'struct mptcp_pm_add_entry' Group some variables based on their sizes to reduce hole and avoid padding. On x86_64, this shrinks the size of 'struct mptcp_pm_add_entry' from 136 to 128 bytes. It saves a few bytes of memory and is more cache-line friendly. Signed-off-by: Christophe JAILLET Reviewed-by: Matthieu Baerts Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/e47b71de54fd3e580544be56fc1bb2985c77b0f4.1687081558.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 066768b7305b1524d261fdc543d25fd60d955254 Author: Christophe JAILLET Date: Sun Jun 18 11:33:55 2023 +0200 mctp: Reorder fields in 'struct mctp_route' Group some variables based on their sizes to reduce hole and avoid padding. On x86_64, this shrinks the size of 'struct mctp_route' from 72 to 64 bytes. It saves a few bytes of memory and is more cache-line friendly. Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Acked-by: Jeremy Kerr Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/393ad1a5aef0aa28d839eeb3d7477da0e0eeb0b0.1687080803.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 1afc383a17001b93fd1e5c749b0f6a668412b85b Merge: 9bd1f9dbbf9b3 1f1ef7e5bbe2d Author: Mark Brown Date: Wed Jun 21 01:32:31 2023 +0100 ASoC: Merge up fixes for CI Some of the fixes merged should be relevant for my CI stability. commit 970ebb8a26a120340dcbb4e6c2fb4ecfbad0d190 Author: Alexander Mikhalitsyn Date: Wed May 3 08:43:44 2023 +0200 SafeSetID: fix UID printed instead of GID pr_warn message clearly says that GID should be printed, but we have UID there. Let's fix that. Found accidentally during the work on isolated user namespaces. Signed-off-by: Alexander Mikhalitsyn [PM: fix spelling errors in description, subject tweak] Signed-off-by: Paul Moore commit 2e9f9d4a729f12b4bc3fa60406374327b1809abe Author: Ian Rogers Date: Wed Jun 14 21:07:15 2023 -0700 perf annotation: Switch lock from a mutex to a sharded_mutex Remove the "struct mutex lock" variable from annotation that is allocated per symbol. This removes in the region of 40 bytes per symbol allocation. Use a sharded mutex where the number of shards is set to the number of CPUs. Assuming good hashing of the annotation (done based on the pointer), this means in order to contend there needs to be more threads than CPUs, which is not currently true in any perf command. Were contention an issue it is straightforward to increase the number of shards in the mutex. On my Debian/glibc based machine, this reduces the size of struct annotation from 136 bytes to 96 bytes, or nearly 30%. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Andres Freund Cc: Mark Rutland Cc: Yuan Can Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Huacai Chen Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Alexander Shishkin Cc: Kan Liang Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230615040715.2064350-2-irogers@google.com Signed-off-by: Namhyung Kim commit 0650b2b2e62edfa9510ba0c80f42d98c4a748b12 Author: Ian Rogers Date: Wed Jun 14 21:07:14 2023 -0700 perf sharded_mutex: Introduce sharded_mutex Per object mutexes may come with significant memory cost while a global mutex can suffer from unnecessary contention. A sharded mutex is a compromise where objects are hashed and then a particular mutex for the hash of the object used. Contention can be controlled by the number of shards. v2. Use hashmap.h's hash_bits in case of contention from alignment of objects. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Andres Freund Cc: Mark Rutland Cc: Yuan Can Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Huacai Chen Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Alexander Shishkin Cc: Kan Liang Cc: Ingo Molnar Link: https://lore.kernel.org/r/20230615040715.2064350-1-irogers@google.com Signed-off-by: Namhyung Kim commit 5e37ef5c2a5303d41842b8277770064632533318 Author: Li Dong Date: Mon Jun 19 16:20:10 2023 +0800 tools: Fix incorrect calculation of object size by sizeof What we need to calculate is the size of the object, not the size of the pointer. Fixed: 51cfe7a3e87e ("perf python: Avoid 2 leak sanitizer issues") Signed-off-by: Li Dong Acked-by: Namhyung Kim Cc: Mark Rutland Cc: Ian Rogers Cc: Sean Christopherson Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Cc: opensource.kernel@vivo.com Link: https://lore.kernel.org/r/20230619082036.410-1-lidong@vivo.com Signed-off-by: Namhyung Kim commit 9bd1f9dbbf9b395e0f18661850fc923d129729af Merge: 3067e020d361e 198c93e2fc0b7 Author: Mark Brown Date: Wed Jun 21 00:56:07 2023 +0100 ASoC: amd: ps: add SoundWire support Merge series from Vijendar Mukunda : This patch series add support for - Platform device creation for SoundWire Manager instances and PDM controller. - SoundWire DMA driver. - Interrupt handling for SoundWire manager related interrupts, SoundWire DMA interrupts and ACP error interrupts. - ACP PCI driver PM ops modification with respect to SoundWire Power modes. commit 3067e020d361ed346957eb5e253911f7a3e18f59 Merge: 0a08778126284 0baa2c3abc525 Author: Mark Brown Date: Wed Jun 21 00:56:00 2023 +0100 add snd_soc_{of_}get_dlc() Merge series from Kuninori Morimoto : Current soc-core.c has snd_soc_{of_}get_dai_name() to get DAI name for dlc (snd_soc_dai_link_component). It gets .dai_name, but we need .of_node too. Therefor user need to arrange. It will be more useful if it gets both .dai_name and .of_node. This patch adds snd_soc_{of_}get_dlc() for it, and convert to use it. commit 53fc25b7f557089aff101235152ae4bff15c428a Author: Chenyuan Mi Date: Wed Jun 14 08:01:18 2023 -0700 perf subcmd: Fix missing check for return value of malloc() in add_cmdname() The malloc() function may return NULL when it fails, which may cause null pointer deference in add_cmdname(), add Null check for return value of malloc(). Found by our static analysis tool. Signed-off-by: Chenyuan Mi Acked-by: Ian Rogers Cc: Leo Yan Cc: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/20230614150118.115208-1-cymi20@fudan.edu.cn Signed-off-by: Namhyung Kim commit 240de691dd6684d15f63613aa7fbc64e6098d6c9 Author: baomingtong001@208suo.com Date: Wed Jun 14 16:13:53 2023 +0800 perf parse-events: Remove unneeded semicolon ./tools/perf/util/parse-events.c:1466:2-3: Unneeded semicolon Signed-off-by: Mingtong Bao Link: https://lore.kernel.org/r/2c733a91717eae93119ba2226420fd8f@208suo.com Signed-off-by: Namhyung Kim commit bc06026d1420e006503c69dc6829cc45590db106 Author: Yang Jihong Date: Fri Jun 16 02:45:15 2023 +0000 perf parse: Add missing newline to pr_debug message in evsel__compute_group_pmu_name() The newline is missing for pr_debug message in evsel__compute_group_pmu_name(), fix it. Before: # perf --debug verbose=2 record -e cpu-clock true No PMU found for 'cycles:u'No PMU found for 'instructions:u'------------------------------------------------------------ perf_event_attr: type 1 size 136 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|PERIOD read_format ID|LOST disabled 1 inherit 1 mmap 1 comm 1 freq 1 enable_on_exec 1 task 1 sample_id_all 1 exclude_guest 1 mmap2 1 comm_exec 1 ksymbol 1 bpf_event 1 ------------------------------------------------------------ After: # perf --debug verbose=2 record -e cpu-clock true No PMU found for 'cycles:u' No PMU found for 'instructions:u' ------------------------------------------------------------ perf_event_attr: type 1 size 136 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|PERIOD read_format ID|LOST disabled 1 inherit 1 mmap 1 comm 1 freq 1 enable_on_exec 1 task 1 sample_id_all 1 exclude_guest 1 mmap2 1 comm_exec 1 ksymbol 1 bpf_event 1 ------------------------------------------------------------ Signed-off-by: Yang Jihong Acked-by: Namhyung Kim Cc: mark.rutland@arm.com Cc: irogers@google.com Cc: peterz@infradead.org Cc: adrian.hunter@intel.com Cc: acme@kernel.org Cc: jolsa@kernel.org Cc: alexander.shishkin@linux.intel.com Cc: kan.liang@linux.intel.com Cc: mingo@redhat.com Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Link: https://lore.kernel.org/r/20230616024515.80814-1-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit 2a541abd98370f9931c889c187eef7458720b57b Author: Konrad Dybcio Date: Mon Jun 19 18:13:18 2023 +0200 clk: qcom: gcc-sc8280xp: Add runtime PM The GCC block on SC8280XP is powered by the CX rail. We need to ensure that it's enabled to prevent unwanted power collapse. Enable runtime PM to keep the power flowing only when necessary. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230619-topic-sc8280xp-clk-rpm-v1-2-1e5e1064cdb2@linaro.org Signed-off-by: Bjorn Andersson commit 9bbcb892a7cd06c8156e6de211a8d7d45ee48086 Author: Konrad Dybcio Date: Mon Jun 19 18:13:17 2023 +0200 clk: qcom: gpucc-sc8280xp: Add runtime PM The GPU_CC block on SC8280XP is powered by the GFX rail. We need to ensure that it's enabled to prevent unwanted power collapse. Enable runtime PM to keep the power flowing only when necessary. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230619-topic-sc8280xp-clk-rpm-v1-1-1e5e1064cdb2@linaro.org Signed-off-by: Bjorn Andersson commit db1f5f1038a2df67f549e2657f56327e28127c27 Author: Yang Jihong Date: Wed Jun 14 02:15:05 2023 +0000 perf stat: Add missing newline in pr_err messages The newline is missing for error messages in add_default_attributes() Before: # perf stat --topdown Topdown requested but the topdown metric groups aren't present. (See perf list the metric groups have names like TopdownL1)# After: # perf stat --topdown Topdown requested but the topdown metric groups aren't present. (See perf list the metric groups have names like TopdownL1) # In addition, perf_stat_init_aggr_mode() and perf_stat_init_aggr_mode_file() have the same problem, fixed by the way. Signed-off-by: Yang Jihong Acked-by: Ian Rogers Reviewed-by: James Clark Link: https://lore.kernel.org/r/20230614021505.59856-1-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit 6009177fd9ec7b5ca9b93ecdbadd4bc7e9c48141 Author: Donglin Peng Date: Sat Apr 8 05:42:22 2023 -0700 selftests/ftrace: Add funcgraph-retval test case Add a test case for the funcgraph-retval and funcgraph-retval-hex trace options. Link: https://lkml.kernel.org/r/9fedbd25e63f012cade5dad13be21225fec2fb5d.1680954589.git.pengdonglin@sangfor.com.cn Signed-off-by: Donglin Peng Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 5779e3c0f5aed8a3239839ad55ad017e1278ecd7 Author: Donglin Peng Date: Sat Apr 8 05:42:21 2023 -0700 LoongArch: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL The previous patch ("function_graph: Support recording and printing the return value of function") has laid the groundwork for the for the funcgraph-retval, and this modification makes it available on the LoongArch platform. We introduce a new structure called fgraph_ret_regs for the LoongArch platform to hold return registers and the frame pointer. We then fill its content in the return_to_handler and pass its address to the function ftrace_return_to_handler to record the return value. Link: https://lkml.kernel.org/r/c5462255e435fab363895c2d7433bc0f5a140411.1680954589.git.pengdonglin@sangfor.com.cn Reviewed-by: Huacai Chen Signed-off-by: Donglin Peng Signed-off-by: Steven Rostedt (Google) commit d938ba17683effd95b44400d30df16fe541f40fd Author: Donglin Peng Date: Sat Apr 8 05:42:20 2023 -0700 x86/ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL The previous patch ("function_graph: Support recording and printing the return value of function") has laid the groundwork for the for the funcgraph-retval, and this modification makes it available on the x86 platform. We introduce a new structure called fgraph_ret_regs for the x86 platform to hold return registers and the frame pointer. We then fill its content in the return_to_handler and pass its address to the function ftrace_return_to_handler to record the return value. Link: https://lkml.kernel.org/r/53a506f0f18ff4b7aeb0feb762f1c9a5e9b83ee9.1680954589.git.pengdonglin@sangfor.com.cn Signed-off-by: Donglin Peng Signed-off-by: Steven Rostedt (Google) commit 3646970322464c21e69dcb9a2e37d461c5834bf5 Author: Donglin Peng Date: Sat Apr 8 05:42:18 2023 -0700 arm64: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL The previous patch ("function_graph: Support recording and printing the return value of function") has laid the groundwork for the for the funcgraph-retval, and this modification makes it available on the ARM64 platform. We introduce a new structure called fgraph_ret_regs for the ARM64 platform to hold return registers and the frame pointer. We then fill its content in the return_to_handler and pass its address to the function ftrace_return_to_handler to record the return value. Link: https://lkml.kernel.org/r/c78366416ce93f704ae7000c4ee60eb4258c38f7.1680954589.git.pengdonglin@sangfor.com.cn Reviewed-by: Mark Rutland Tested-by: Mark Rutland Acked-by: Catalin Marinas Signed-off-by: Donglin Peng Signed-off-by: Steven Rostedt (Google) commit 21c094d3f8a6c88dedbd9831631a263d5c49775f Author: Donglin Peng Date: Sat Apr 8 05:42:16 2023 -0700 tracing: Add documentation for funcgraph-retval and funcgraph-retval-hex Add documentation for the two newly introduced options for the function_graph tracer. The funcgraph-retval option is used to control whether or not to display the return value, while the funcgraph-retval-hex option is used to control the display format of the return value. Link: https://lkml.kernel.org/r/2b5635f05146161b54c9ea6307e25efe5ccebdad.1680954589.git.pengdonglin@sangfor.com.cn Acked-by: Masami Hiramatsu (Google) Signed-off-by: Donglin Peng Signed-off-by: Steven Rostedt (Google) commit a1be9ccc57f07d54278be34eed6bd679bc941c97 Author: Donglin Peng Date: Sat Apr 8 05:42:15 2023 -0700 function_graph: Support recording and printing the return value of function Analyzing system call failures with the function_graph tracer can be a time-consuming process, particularly when locating the kernel function that first returns an error in the trace logs. This change aims to simplify the process by recording the function return value to the 'retval' member of 'ftrace_graph_ret' and printing it when outputting the trace log. We have introduced new trace options: funcgraph-retval and funcgraph-retval-hex. The former controls whether to display the return value, while the latter controls the display format. Please note that even if a function's return type is void, a return value will still be printed. You can simply ignore it. This patch only establishes the fundamental infrastructure. Subsequent patches will make this feature available on some commonly used processor architectures. Here is an example: I attempted to attach the demo process to a cpu cgroup, but it failed: echo `pidof demo` > /sys/fs/cgroup/cpu/test/tasks -bash: echo: write error: Invalid argument The strace logs indicate that the write system call returned -EINVAL(-22): ... write(1, "273\n", 4) = -1 EINVAL (Invalid argument) ... To capture trace logs during a write system call, use the following commands: cd /sys/kernel/debug/tracing/ echo 0 > tracing_on echo > trace echo *sys_write > set_graph_function echo *spin* > set_graph_notrace echo *rcu* >> set_graph_notrace echo *alloc* >> set_graph_notrace echo preempt* >> set_graph_notrace echo kfree* >> set_graph_notrace echo $$ > set_ftrace_pid echo function_graph > current_tracer echo 1 > options/funcgraph-retval echo 0 > options/funcgraph-retval-hex echo 1 > tracing_on echo `pidof demo` > /sys/fs/cgroup/cpu/test/tasks echo 0 > tracing_on cat trace > ~/trace.log To locate the root cause, search for error code -22 directly in the file trace.log and identify the first function that returned -22. Once you have identified this function, examine its code to determine the root cause. For example, in the trace log below, cpu_cgroup_can_attach returned -22 first, so we can focus our analysis on this function to identify the root cause. ... 1) | cgroup_migrate() { 1) 0.651 us | cgroup_migrate_add_task(); /* = 0xffff93fcfd346c00 */ 1) | cgroup_migrate_execute() { 1) | cpu_cgroup_can_attach() { 1) | cgroup_taskset_first() { 1) 0.732 us | cgroup_taskset_next(); /* = 0xffff93fc8fb20000 */ 1) 1.232 us | } /* cgroup_taskset_first = 0xffff93fc8fb20000 */ 1) 0.380 us | sched_rt_can_attach(); /* = 0x0 */ 1) 2.335 us | } /* cpu_cgroup_can_attach = -22 */ 1) 4.369 us | } /* cgroup_migrate_execute = -22 */ 1) 7.143 us | } /* cgroup_migrate = -22 */ ... Link: https://lkml.kernel.org/r/1fc502712c981e0e6742185ba242992170ac9da8.1680954589.git.pengdonglin@sangfor.com.cn Tested-by: Florian Kauer Acked-by: Masami Hiramatsu (Google) Signed-off-by: Donglin Peng Signed-off-by: Steven Rostedt (Google) commit f3d40e6545594c22733d091c5ec6b8ff345cbd57 Author: Steven Rostedt (Google) Date: Tue Jun 20 18:34:55 2023 -0400 fgraph: Add declaration of "struct fgraph_ret_regs" In final testing of: https://patchwork.kernel.org/project/linux-trace-kernel/patch/1fc502712c981e0e6742185ba242992170ac9da8.1680954589.git.pengdonglin@sangfor.com.cn/ "function_graph: Support recording and printing the return value of function" The test failed due to a new warning found in the build: kernel/trace/fgraph.c:243:56: warning: ‘struct fgraph_ret_regs’ declared inside parameter list will not be visible outside of this definition or declaration Instead of asking to send another patch series, just add it and then apply the updates. Signed-off-by: Steven Rostedt (Google) commit 198c93e2fc0b74ae520393118d7cb02762c04bf3 Author: Vijendar Mukunda Date: Mon Jun 12 15:29:03 2023 +0530 ASoC: amd: ps: add acp_reset flag check in acp pci driver pm ops. AMD SoundWire manager supports different power modes. acp_reset flag will be set to false only when SoundWire manager power mode is selected as ClockStop Mode. For rest of the combinations (ACP PDM + SDW), acp_reset flag will be set to true. When acp_reset flag is set, acp de-init and acp init sequence should be invoked during suspend/resume callbacks. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230612095903.2113464-10-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 6e8f7cb4cbae8e2b03190d26674a14be22d7df53 Author: Vijendar Mukunda Date: Mon Jun 12 15:29:02 2023 +0530 ASoC: amd: update comments in Kconfig file Update comments in Kconfig file for Pink Sardine platform. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230612095903.2113464-9-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 7b33594130405cbcfdef2a4c582f9c67aef8d292 Author: Vijendar Mukunda Date: Mon Jun 12 15:29:01 2023 +0530 ASoC: amd: ps: enable SoundWire dma driver build Enable SoundWire dma driver build for PS platform. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230612095903.2113464-8-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 5a06c3ac4cf9a8ca5edf99a07a1129ae25ab581e Author: Vijendar Mukunda Date: Mon Jun 12 15:29:00 2023 +0530 ASoC: amd: ps: add pm ops support for SoundWire dma driver Add support pm ops support for SoundWire dma driver. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230612095903.2113464-7-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 298d4f7b176538d41356d145c044442b8456a14e Author: Vijendar Mukunda Date: Mon Jun 12 15:28:59 2023 +0530 ASoC: amd: ps: add support for SoundWire DMA interrupts Move to request_threaded_irq and use thread for handling SoundWire DMA interrupts. Whenever audio data equal to the SoundWire FIFO watermark level are produced/consumed, interrupt is generated. Acknowledge the interrupt and wake up the irq thread. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230612095903.2113464-6-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit f722917350ee0b802a62d888f4e8b23bd5f1f641 Author: Vijendar Mukunda Date: Mon Jun 12 15:28:58 2023 +0530 ASoC: amd: ps: add SoundWire dma driver dma ops Add SoundWire DMA driver dma ops for Pink Sardine platform. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230612095903.2113464-5-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 665dd181a97ff9588060f76887c3b61fd4ccb8b0 Author: Vijendar Mukunda Date: Mon Jun 12 15:28:57 2023 +0530 ASoC: amd: ps: add SoundWire dma driver SoundWire DMA platform driver binds to the platform device created by ACP PCI device. SoundWire DMA driver registers ALSA DMA component with ASoC framework. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230612095903.2113464-4-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit e1cb350610ce88d9995b8b287930d3ba821d9f2b Author: Vijendar Mukunda Date: Mon Jun 12 15:28:56 2023 +0530 ASoC: amd: ps: handle SoundWire interrupts in acp pci driver Handle SoundWire manager related interrupts in ACP PCI driver interrupt handler and schedule SoundWire manager work queue for further processing. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230612095903.2113464-3-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit d1351c30ac8a6cf61b0bbe9fcbc8d2851cd44f3c Author: Vijendar Mukunda Date: Mon Jun 12 15:28:55 2023 +0530 ASoC: amd: ps: create platform devices based on acp config Based on ACP pin configuration and scanning child devices under ACP pci device ACPI scope, platform device configuration (pdev_config) and platform device count(pdev_count) will be calculated. Using pdev_config and pdev_count values, ACP PCI driver will create platform devices for Pink Sardine platform. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20230612095903.2113464-2-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit d8ece8b832276756d32c310fdd76835f8046071a Merge: d704f1fe9f4a4 2bd9e07140ae7 Author: Arnd Bergmann Date: Tue Jun 20 23:06:54 2023 +0200 Merge tag 'riscv-dt-for-v6.5-pt2' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into soc/dt RISC-V Devicetrees for v6.5 Part 2 T-Head: Add a basic dtsi, Kconfig bits & trivial binding additions for the T-Head 1520 SoC (codename "light"). This SoC can be found on the Lichee Pi 4a, for which a minimal dts is added. Misc: Re-sort the dts Makefile to be in alphanumerical order by directory. Signed-off-by: Conor Dooley * tag 'riscv-dt-for-v6.5-pt2' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: riscv: dts: sort makefile entries by directory riscv: defconfig: enable T-HEAD SoC MAINTAINERS: add entry for T-HEAD RISC-V SoC riscv: dts: thead: add sipeed Lichee Pi 4A board device tree riscv: dts: add initial T-HEAD TH1520 SoC device tree riscv: Add the T-HEAD SoC family Kconfig option dt-bindings: riscv: Add T-HEAD TH1520 board compatibles dt-bindings: timer: Add T-HEAD TH1520 clint dt-bindings: interrupt-controller: Add T-HEAD's TH1520 PLIC Link: https://lore.kernel.org/r/20230620-fidelity-variety-60b47c889e31@spud Signed-off-by: Arnd Bergmann commit d704f1fe9f4a4ae9c9f1f9fac1e4194c34dd035b Merge: 313c22bb31953 3cdba279c5e92 Author: Arnd Bergmann Date: Tue Jun 20 23:05:56 2023 +0200 Merge tag 'arm-soc/for-6.5/devicetree-arm64' of https://github.com/Broadcom/stblinux into soc/dt This pull request contains Broadcom ARM64-based SoCs changes for 6.5, please pull the following: - Krzysztof fixes the BCMBCA DTS files to have correct cache properties - Tony unifies the pinctrl-single pin group(s) for the Stingray SoCs - Aurelien enables the BCM283x DTS files to be built with relocation information to make them usable with DT overlays * tag 'arm-soc/for-6.5/devicetree-arm64' of https://github.com/Broadcom/stblinux: arm64: dts: broadcom: Enable device-tree overlay support for RPi devices arm64: dts: broadcom: Unify pinctrl-single pin group nodes for stingray arm64: dts: broadcom: add missing cache properties Link: https://lore.kernel.org/r/20230619134920.3384844-2-florian.fainelli@broadcom.com Signed-off-by: Arnd Bergmann commit 313c22bb31953c5ac7f3be94279126307dd5865c Merge: 11d5441cde740 b67cad33176e4 Author: Arnd Bergmann Date: Tue Jun 20 23:04:37 2023 +0200 Merge tag 'arm-soc/for-6.5/devicetree' of https://github.com/Broadcom/stblinux into soc/dt This pull request contains Broadcom ARM-based SoCs Device Tree changes for 6.5, please pull the following: - Krzysztof adds missing cache properties for the BCM63xx DSL routers - Rafal relicenses a number of the BCM5301X DTS files to the GPL 2.0+ / MIT license, and he fixes a number of Device Tree nodes warnings, adds MAC address for all Luxul routers and adds Netgear R8000 Wi-Fi regulatory information to the DTS - Stanislav updates the "BCM mobile" SoCs DTS files to fix various warnings - Aurelien enables the BCM283x DTS files to be built with relocation information to make them usable with DT overlays - Christian fixes the Meraki DTS to have correct NAND ECC properties, correct partition numbers and fixed-link node(s) properties * tag 'arm-soc/for-6.5/devicetree' of https://github.com/Broadcom/stblinux: (33 commits) ARM: dts: BCM5301X: Add cells sizes to PCIe nodes dt-bindings: firmware: brcm,kona-smc: convert to YAML ARM: dts: BCM5301X: Add Netgear R8000 WiFi regulator mappings dt-bindings: net: wireless: brcm,bcm4329-fmac: allow generic properties dt-bindings: net: wireless: brcm,bcm4329-fmac: add BCM4366 binding ARM: dts: BCM5301X: fix duplex-full => full-duplex ARM: dts: BCM5301X: MR32: remove partition index numbers ARM: dts: BCM5301X: MR26: MR32: remove bogus nand-ecc-algo property dt-bindings: power: reset: bcm21664-resetmgr: convert to YAML ARM: dts: bcm21664-garnet: use node labels ARM: dts: bcm11351/21664: add UART, I2C node labels ARM: dts: bcm-mobile: move status properties to the end of nodes ARM: dts: bcm21664/23550: use CCU compatibles directly ARM: dts: bcm-mobile: change "" includes to <> where applicable ARM: dts: BCM5301X: Describe switch ports in the main DTS ARM: dts: BCM5301X: Relicense Christian's code to the GPL 2.0+ / MIT ARM: dts: BCM5301X: Drop invalid properties from Meraki MR32 keys ARM: dts: BCM5301X: Drop invalid #usb-cells dt-bindings: arm: bcm: Add bindings for Buffalo WZR-1166DHP(2) ARM: dts: BCM5301X: Use updated "spi-gpio" binding properties ... Link: https://lore.kernel.org/r/20230619134920.3384844-1-florian.fainelli@broadcom.com Signed-off-by: Arnd Bergmann commit 11d5441cde740c89252290e04ad79f133c366bdb Author: Cristian Birsan Date: Fri Jun 16 18:29:32 2023 +0300 arm: dts: Enable device-tree overlay support for AT91 boards Add the '-@' DTC option for AT91 boards that have device-tree overlays. This option populates the '__symbols__' node that contains all the necessary symbols for supporting device-tree overlays (from bootloader) on these devices. This change increases the size of the resulting DTB with ~30%-40%. Below are the measurements performed v6.4-rc6: at91-sam9x60_curiosity.dtb 28499 -> 36641 bytes at91-sam9x60ek.dtb 30867 -> 39609 bytes at91-sama5d27_som1_ek.dtb 26086 -> 34166 bytes at91-sama5d27_wlsom1_ek.dtb 26045 -> 33184 bytes at91-sama5d2_icp.dtb 27521 -> 36155 bytes at91-sama5d2_ptc_ek.dtb 23237 -> 29612 bytes at91-sama5d2_xplained.dtb 27262 -> 35326 bytes at91-sama5d3_eds.dtb 27924 -> 39939 bytes at91-sama5d3_xplained.dtb 28400 -> 40650 bytes at91-sama5d4_xplained.dtb 26456 -> 36107 bytes at91-sama7g5ek.dtb 29212 -> 37289 bytes Signed-off-by: Cristian Birsan Link: https://lore.kernel.org/r/20230616152932.1484154-1-cristian.birsan@microchip.com Signed-off-by: Arnd Bergmann commit 982e6e1966ace3aa70cbe45822eb848eace78ade Merge: e86147a28a152 0ee03b8c8576b Author: Arnd Bergmann Date: Tue Jun 20 23:01:57 2023 +0200 Merge tag 'mvebu-dt64-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into soc/dt mvebu dt64 for 6.5 (part 1) Few improvements following the dt bindings: - add missing cache properties - fix nand_controller node name according to YAML - fix pca954x i2c-mux node names Fix espressobin-ultra boot failure and wifi for EspressoBIN Ultra (Armada 3720) * tag 'mvebu-dt64-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: arm64: dts: marvell: Fix espressobin-ultra boot failure and wifi arm64: dts: marvell: Fix pca954x i2c-mux node names arm64: dts: marvell: cp11x: Fix nand_controller node name according to YAML arm64: dts: marvell: add missing cache properties Link: https://lore.kernel.org/r/877cs3h87m.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit e86147a28a152cf683538a98653a126754bf8d8b Merge: 5bfea833dd8f9 dc393f1fdf22e Author: Arnd Bergmann Date: Tue Jun 20 23:00:37 2023 +0200 Merge tag 'mvebu-dt-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into soc/dt mvebu dt for 6.5 (part 1) Add Endian 4i Edge 200 board (kirkwood based) Add missing phy-modes on Armada 388 clearfog board Replace deprecated spi-gpio properties on Armada XP Align MTD partition nodes to dtschema for all mvebu boards * tag 'mvebu-dt-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: ARM: dts: mvebu: align MTD partition nodes to dtschema ARM: dts: armada-xp: Replace deprecated spi-gpio properties ARM: dts: armada388-clearfog: add missing phy-modes ARM: dts: kirkwood: Add Endian 4i Edge 200 board Link: https://lore.kernel.org/r/87a5wzh8b1.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit 5bfea833dd8f972ce3435359f12f61bdbf01b147 Merge: ce207be3e2949 3bfbff9b461e3 Author: Arnd Bergmann Date: Tue Jun 20 22:59:05 2023 +0200 Merge tag 'v6.4-next-dts64' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into soc/dt MT6795: - add GCE, MMSYS, IOMMU and PMIC wrapper nodes - Enable PMIC combo, eMMC and SDIO support to the Sony Xperia M5 MT7622: - add SPI-NAND chip and interrupt support for switch node to the BPI-R64 MT7986: - add PWM, thermal, efuse, auxadc and thermal zone nodes - BPI-R3 enable WiFi leds and enable PWM - BPI-R3 reserve more space on NOR and NOR flash to be able to store bl2 uncompressed - BPI-R3 add PWM fan for cpu cooling MT8173: - fine tune the regulator of the eDP pannel - use EDID for eDP panel instead of hard coded type MT8183: - add quirk for GIC problem for Kukui based boards to make "pseudo NMIs" work - provide fimrware name to SCP MT8186: - add USB, SPMI, ADSP, Global Command Engine (GCE) nodes - add nodes to enable display support - add cache coherent interconnect - add dynamic voltage scaling for CPU and GPU MT8192: - enable Bluetooth on the Hayato board - add quirk for GIC problem for Kukui based boards to make "pseudo NMIs" work - add cpufreq node and video decoder - add dma-ranges needed by the IOMMU rework - Fine tune capacity-dmips-mhz MT8195: - add thermal zones and video decoder - enable PCI ports on cherry (e.g. Acer Chromebook Spin 513 CP513-2H) to enable WiFi and Bluetooth combo. - add quirk for GIC problem for Kukui based boards to make "pseudo NMIs" work MT8365: - add watchdog, PMIC, MMC, USB OTG, ethernet nodes - add Operation Performance Points - PSCI node and CPU idle support Several SoCs: - advertise L2 and L3 cache as unified - add chasss-type * tag 'v6.4-next-dts64' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: (51 commits) arm64: dts: mt7986: increase bl2 partition on NAND of Bananapi R3 arm64: dts: mediatek: mt8186: Wire up GPU voltage/frequency scaling arm64: dts: mediatek: mt8186: Add GPU speed bin NVMEM cells arm64: dts: mediatek: mt8186: Wire up CPU frequency/voltage scaling arm64: dts: mediatek: mt8186: Add CCI node and CCI OPP table arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts arm64: dts: mt7986: add thermal-zones arm64: dts: mt7986: add thermal and efuse arm64: dts: mediatek: mt8192: Fix CPUs capacity-dmips-mhz arm64: dts: mediatek: mt8192: Add missing dma-ranges to soc node arm64: dts: mediatek: mt8183: kukui: Add scp firmware-name arm64: dts: mt8195: Add video decoder node arm64: dts: mt8192: Add video-codec nodes arm64: dts: mediatek: Add cpufreq nodes for MT8192 arm64: dts: mediatek: mt8173-elm: remove panel model number in DT arm64: dts: mt7986: use size of reserved partition for bl2 arm64: dts: mt8173: Power on panel regulator on boot arm64: dts: mt7986: set Wifi Leds low-active for BPI-R3 arm64: dts: mt7986: add PWM to BPI-R3 arm64: dts: mt7986: add PWM ... Link: https://lore.kernel.org/r/27843c96-142e-930e-33b2-b634182e7cfa@gmail.com Signed-off-by: Arnd Bergmann commit ce207be3e2949925a89f57f7b3f1ac546a3dbbfa Merge: d09d747ee5cb0 2d62aab57d2ac Author: Arnd Bergmann Date: Tue Jun 20 22:58:19 2023 +0200 Merge tag 'ti-keystone-dt-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/dt Keystone2 device tree updates for v6.5 Cosmetic cleanups: * Do not capitalize hex digits * Unify pinctrl-single pin group nodes for keystone * Fix eeprom node names * tag 'ti-keystone-dt-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: ARM: dts: keystone: Do not capitalize hex digits ARM: dts: keystone: Remove ti,keystone from soc node compatible ARM: dts: keystone: Fix EEPROM node names ARM: dts: Unify pinctrl-single pin group nodes for keystone Link: https://lore.kernel.org/r/20230615164127.qcgwrbwpmclx5wlm@landscape Signed-off-by: Arnd Bergmann commit d09d747ee5cb0727a9f0588bc166c3a79fa3bc3d Merge: f07c96511d001 831b802a7727b Author: Arnd Bergmann Date: Tue Jun 20 22:57:29 2023 +0200 Merge tag 'qcom-dts-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/dt More Qualcomm ARM32 DeviceTree updates for v6.5 On MSM8960, support for USB is added and the Samsung Galaxy Express is added. GPIO keys and on-board LEDs are described for the APQ8074 Dragonboard. On MSM8226, QFPROM, tsens and thermal zones are defined, and the description of the clock hierarchy is improved. The PCIe endpoint controller on SDX55 gains a interconnect path to DDR defined. Sony Xperia X2 Tablet and Samsung Galaxy Tab 4 are updated following changes in the LP855X DeviceTree binding. * tag 'qcom-dts-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm: dts: qcom: sdx55: Add interconnect path ARM: dts: qcom: msm8226: Add thermal zones node ARM: dts: qcom: msm8226: Add tsens node and related nvmem cells ARM: dts: qcom: msm8226: Add qfprom node ARM: dts: qcom: pm8941: Add thermal zone config ARM: dts: qcom: pm8841: Add thermal zone config ARM: dts: qcom: pm8226: Add thermal sensor and thermal zone config ARM: dts: qcom: msm8974: rename labels for DSI nodes ARM: dts: qcom: apq8074-dragonboard: add gpio keys ARM: dts: qcom: apq8074-dragonboard: add onboard leds ARM: dts: qcom: Add Samsung Galaxy Express support ARM: dts: qcom: msm8960: Add USB node ARM: dts: qcom: adapt to LP855X bindings changes ARM: dts: qcom: msm8226: Provide clocks to mmcc node ARM: dts: qcom: msm8226: Use XO from rpmcc where possible Link: https://lore.kernel.org/r/20230615163926.1462225-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit f07c96511d00138171130d43a50a377489cd87de Merge: 055fdcac930b1 115ee470e5d24 Author: Arnd Bergmann Date: Tue Jun 20 22:56:19 2023 +0200 Merge tag 'v6.4-next-dts32' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into soc/dt MT7530 (e.g. BPI R2): - several DT clean-ups - add port5 as CPU port * tag 'v6.4-next-dts32' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: arm: dts: mt7623: add port@5 as CPU port arm: dts: mt7623: enable flow control on port@6 arm: dts: mt7623: change mt7530 switch address arm: dts: mt7623: add mt7530 switch to mt7623a.dtsi arm: dts: mt7623: add gmacs to mt7623.dtsi Link: https://lore.kernel.org/r/98e21acb-d792-6a8c-2de6-12d5af8a8111@gmail.com Signed-off-by: Arnd Bergmann commit 055fdcac930b103372ea19a25de6c406fc245be2 Merge: af3c684721cf6 c2951581e69c8 Author: Arnd Bergmann Date: Tue Jun 20 22:54:14 2023 +0200 Merge tag 'qcom-arm64-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/dt More Qualcomm ARM64 DTS changes for v6.5 This introduces support for the Qualcomm SDX75 platform, with the IDP reference board. On IPQ5332 the RDP474 board is added and on IPQ9574 the RDP454 is introduced. On SC8280XP, and hence Lenovo ThinkPad X13s, GPU support is added. For QDU1000, SDM845, SM670, SC8180X, SM6350 and SM8550 the RSC is added to the CPU cluster power-domain to flush sleep & wake votes as the cluster goes down. On IPQ5332 additional reserved-memory regions to improve post mortem debugging. UART1 is added. The MI01.2 board is renamed RDP441 and the RDP474 is added. On IPQ8074 critical thermal trip points are defined. As with IPQ5332 additional reserved-memory regions are used to improve post mortem debugging. Thermal sensors (tsens) are added and zones defined. The crypto engine is added, and support for the RDP454 board is added. Across MSM8916 and MSM8939 pinctrl state definitions are cleaned up and the purpose of msm8939-pm8916 is documented. MSM8939 has regulator definitions cleaned up, following to the previous effort on MSM8916. CPU Bus Fabric scaling support is added to MSM8996 Pro. On QCM2290 CPU idle states are added. For QDU1000 SDHCI is introduced and enabled on the IDP to gain eMMC support. IMEM and PIL information regions are defined for improved post mortem debugging. The Qualcomm Robotics RB2 kit gets its on-board buttons described. A few fixes are introduced for the newly merged SC8180X, in particluar the DisplayPort blocks are moved to the MMCX power domain to avoid power being reduced prematurely during boot. The SC8280XP GPU is added and enabled for the Lenovo Thinkpad X13s, and resets for the soundwire controllers are added. The OUI is specified for ethernet phys on SA8540P Ride platform, to avoid reset issues. Charger description is added to the PMI8998 PMIC and enabled across OnePlus 6/6T, SHIFT SHIFT6mq and Xiaomi Pocophone F1. On SM6350 CPU idle states and UART1 are added. And SM6375 gains GPU clock controller and IOMMU definitions. The Fairphone FP4 gains Bluetooth support. SM8150 is transitioned to use 2 interconnect-cells, and the USB interconnect path is described to ensure buses are adequately voted for. The same changes are done for SM8250, and the resolution of the static framebuffer on Sony Xperia 1 II and 5 II are corrected. The USB bus paths are also added to SM8350, SM8450 and SM8550. On SM8550 DisplayPort nodes are added, as is the PWM controller for driving the notification LED and the RTC is enabled. For the MTP and QRD boards, the soundcard and audio codecs are defined. A Tegra change, related to LP855X binding changes, was accidentally picked up and dropped again later. A number of DeviceTree fixes identified through validation was introduced as well. Additionally a few nodes got their default status changed to avoid unnecessarily having to enable them (e.g. the mdp/dpu node). * tag 'qcom-arm64-for-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (94 commits) Revert "arm64: dts: adapt to LP855X bindings changes" arm64: dts: qcom: sc8280xp: Enable GPU related nodes arm64: dts: qcom: sc8280xp: Add GPU related nodes arm64: dts: qcom: msm8939-pm8916: Mark always-on regulators arm64: dts: qcom: msm8939: Define regulator constraints next to usage arm64: dts: qcom: msm8939-pm8916: Clarify purpose arm64: dts: qcom: msm8939: Fix regulator constraints arm64: dts: qcom: msm8939-sony-tulip: Allow disabling pm8916_l6 arm64: dts: qcom: msm8939-sony-tulip: Fix l10-l12 regulator voltages arm64: dts: qcom: msm8939: Disable lpass_codec by default arm64: dts: qcom: msm8939-pm8916: Add missing pm8916_codec supplies arm64: dts: qcom: qrb4210-rb2: Enable on-board buttons arm64: dts: qcom: msm8916: Drop msm8916-pins.dtsi arm64: dts: qcom: msm8916/39: Rename wcnss pinctrl arm64: dts: qcom: msm8916/39: Cleanup audio pinctrl arm64: dts: qcom: apq8016-sbc: Drop unneeded MCLK pinctrl arm64: dts: qcom: msm8916/39: Consolidate SDC pinctrl arm64: dts: qcom: msm8916/39: Fix SD card detect pinctrl arm64: dts: qcom: msm8996: rename labels for HDMI nodes arm64: dts: qcom: sm8250: rename labels for DSI nodes ... Link: https://lore.kernel.org/r/20230615162043.1461624-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit af3c684721cf69ff662c53a58f02261fa2f8efbe Merge: 5e64ee4204479 a495681151434 Author: Arnd Bergmann Date: Tue Jun 20 22:51:55 2023 +0200 Merge tag 'ti-k3-dt-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/dt TI K3 device tree updates for v6.5 New Boards: phyBOARD-Lyra-AM625 Board support Toradex Verdin AM62 COM, carrier and dev boards New features: Across K3 SoCs: - Error Signaling Module(ESM) and Secproxy IPC modules - On board I2C EEPROM - Voltage Temp Monitoring (VTM) module - DM timers (GP Timers) J784s4: - R5 and C7x DSP remoteproc, ADC, QSPI AM69: - Addition of more peripherals: CPSW, eMMC, UARTs, I2C et al J721s2: - USB, Serdes, OSPI, PCIe AM62a: - Watchdog J721e: - HyperFlash/HyperBus AM62: - Type-C USB0 port Cleanups and non-urgent fixes Particularly large set of cleanups to get rid of dtbs_check errors and dtc warnings: - Addition of missing pinmux and uart nodes for AM64, AM62x, AM62A, J721e, J7200 that are used by bootloader - Split Pinmux regions/range to avoid holes for J721s2, J7200, J784s4 - Drop bootargs and unneeded aliases across all K3 SoCs - Move aliases to board dts files from SoC dtsi files - Move to generic node name for can, rtc nodes on am65 - s/-pins-default/default-pins/ to match upcoming pinctrl.yaml update - Fix pinctrl phandle references to use <> as separator where multiple entries are present * tag 'ti-k3-dt-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: (153 commits) arm64: dts: ti: Unify pin group node names for make dtbs checks arm64: dts: ti: add verdin am62 yavia arm64: dts: ti: add verdin am62 dahlia arm64: dts: ti: add verdin am62 dt-bindings: arm: ti: add toradex,verdin-am62 et al. arm64: dts: ti: Add basic support for phyBOARD-Lyra-AM625 dt-bindings: arm: ti: Add bindings for PHYTEC AM62x based hardware arm64: dts: ti: k3-j7200-mcu-wakeup: Remove 0x unit address prefix from nodename arm64: dts: ti: k3-j721e-som-p0: Enable wakeup_i2c0 and eeprom arm64: dts: ti: k3-am64: Add ESM support arm64: dts: ti: k3-am62: Add ESM support arm64: dts: ti: k3-j7200: Add ESM support arm64: dts: ti: k3-j721e: Add ESM support dt-bindings: misc: esm: Add ESM support for TI K3 devices arm64: dts: ti: k3-j721s2-som-p0: Enable wakeup_i2c0 and eeprom arm64: dts: ti: k3-j721s2-common-proc-board: Add uart pinmux arm64: dts: ti: k3-am68-sk-som: Enable wakeup_i2c0 and eeprom arm64: dts: ti: k3-am68-sk-base-board: Add uart pinmux arm64: dts: ti: k3-am68-sk-base-board: Add pinmux for RPi Header arm64: dts: ti: k3-j721s2: Fix wkup pinmux range ... Link: https://lore.kernel.org/r/7fe0c6de-cb99-9c89-8583-b3855fde16f8@ti.com Signed-off-by: Arnd Bergmann commit 5e64ee4204479ed2bf2abd7d6095686288ea008f Merge: c9a5aa0e53d07 067bf44de11ce Author: Arnd Bergmann Date: Tue Jun 20 22:50:16 2023 +0200 Merge tag 'zynqmp-dt-for-v6.5' of https://github.com/Xilinx/linux-xlnx into soc/dt arm64: ZynqMP DT changes for v6.5 Various small fixes and cleanups to be aligned with the latest dt-schema. Other major changes are: - Wire mali-400 gpu - Change board name for zcu1275 - Use ethernet-phy-id to handle ETH phy reset properly - Switch to amd.com emails - Update people in DT bindings * tag 'zynqmp-dt-for-v6.5' of https://github.com/Xilinx/linux-xlnx: (33 commits) dt-bindings: usb: xilinx: Replace Manish by Piyush dt-bindings: xilinx: Remove Rajan, Jolly and Manish arm64: zynqmp: Used fixed-partitions for QSPI in k26 arm64: zynqmp: Add pmu interrupt-affinity arm64: zynqmp: Set qspi tx-buswidth to 4 arm64: zynqmp: Fix usb node drive strength and slew rate arm64: zynqmp: Describe TI phy as ethernet-phy-id arm64: zynqmp: Switch to amd.com emails arm64: zynqmp: Convert kv260-revA overlay to ASCII text dt-bindings: xilinx: Switch xilinx.com emails to amd.com arm64: xilinx: Use zynqmp prefix for SOM dt overlays arm64: zynqmp: Add phase tags marking arm64: zynqmp: Describe bus-width for SD card on KV260 arm64: zynqmp: Enable AMS on SOM and other zcu10x boards arm64: zynqmp: Enable DP driver for SOMs arm64: zynqmp: Setup clock for DP and DPDMA arm64: zynqmp: Switch to ethernet-phy-id in kv260 arm64: zynqmp: Disable USB3.0 for zc1751-xm016-dc2 arm64: zynqmp: Add pinctrl emmc description to SM-K26 arm64: zynqmp: Add gpio labels for modepin gpio ... Link: https://lore.kernel.org/r/CAHTX3d+2s_KmCnd=x5hydGb+LYoznAzYGTizvqqN2NFmrBurfw@mail.gmail.com Signed-off-by: Arnd Bergmann commit c9a5aa0e53d073d99559aedba9725c4220aafe11 Merge: 12109610a5ce5 e2c510d6d630f Author: Arnd Bergmann Date: Tue Jun 20 22:49:35 2023 +0200 Merge tag 'riscv-dt-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into soc/dt RISC-V Devicetrees for v6.5 StarFive: Watchdog nodes for both the JH7110 & its forerunner, the JH7100. PMU, P being power, support for the JH7110. PMIC and frequency scaling support for the JH7110 equipped VisionFive 2. Most of the DT bits for the JH7110, and the SBCs using it, are pending support for one of the clock controllers, so it's a smaller set of changes than I would have hoped for. Misc: Pick up some dt-binding cleanup that Palmer assigned to me & had no uptake from the respective maintainers. My powers of estimation failed me again, with part of my motivation for picking them up being the addition of new platforms that ended up not making it. Hopefully next window for those, as they were relatively close. Exclude the Allwinner and Renesas subdirectories from the Misc. MAINTAINERS entry, since I do not take care of those. Signed-off-by: Conor Dooley * tag 'riscv-dt-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: riscv: dts: starfive: Add cpu scaling for JH7110 SoC riscv: dts: starfive: Enable axp15060 pmic for cpufreq dt-bindings: interrupt-controller: sifive,plic: Sort compatible values dt-bindings: timer: sifive,clint: Clean up compatible value section riscv: dts: starfive: jh7110: Add watchdog node riscv: dts: starfive: jh7100: Add watchdog node riscv: dts: starfive: Add PMU controller node MAINTAINERS: exclude maintained subdirs in RISC-V misc DT entry Link: https://lore.kernel.org/r/20230612-fasting-floss-0bc05a08bc7a@spud Signed-off-by: Arnd Bergmann commit 12109610a5ce5fe257a1ab6132234d6c9346044d Author: Sam Protsenko Date: Mon Jun 12 20:01:02 2023 +0200 arm64: dts: exynos: Remove clock from Exynos850 pmu_system_controller As described in the corresponding binding documentation for "samsung,exynos850-pmu", the "clocks" property should be used for specifying CLKOUT mux inputs. Therefore, the clock provided to exynos850 pmu_system_controller is incorrect and should be removed. Instead of making syscon regmap keep that clock running for PMU accesses, it should be made always running in the clock driver, because the kernel is not the only software accessing PMU registers on Exynos850 platform. Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20230308233822.31180-8-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230612180102.289745-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit d0b5886bee4bee72bad40523d04a800db0a0a02b Merge: 6db92533d6a39 a68e1aec587a7 Author: Arnd Bergmann Date: Tue Jun 20 22:46:45 2023 +0200 Merge tag 'v6.5-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into soc/dt New boards are - Indiedroid Nova (rk3588) - Add Edgeble Neural Compute Module 6B (rk3588) - FriendlyARM NanoPi R2C Plus (rk3328) - Anbernic RG353PS (rk3566) - Lunzn Fastrhino R66S / R68S (rk3568) The rk3588 got a lot of attention and gained support for the GIC ITS (needed an errata from Rockchip), timers, otp memory, saradc and sdio. The rk356x got support for its RGA block With all the core improvements to rk3588 support, the Rock5b got a lot improvements from that too, namely support for its PMIC, sd-card and saradc, as well as a clock-rate fix for its es8316 codec. Similarly the rk3588-evb1 also got support for its PMIC. The Anberic RGxx3 series got a better bluetooth compatible and updates to its LEDs to make them use the PWM blocks they're connected to. * tag 'v6.5-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: (29 commits) arm64: dts: rockchip: Add saradc node to rock5b arm64: dts: rockchip: Fix compatible for Bluetooth on rk3566-anbernic arm64: dts: rockchip: Add SD card support to rock-5b arm64: dts: rockchip: add PMIC to rock-5b arm64: dts: rockchip: Assign ES8316 MCLK rate on rk3588-rock-5b arm64: dts: rockchip: Add Indiedroid Nova board dt-bindings: arm: rockchip: Add Indiedroid Nova dt-bindings: vendor-prefixes: add Indiedroid arm64: dts: rockchip: Add sdio node to rk3588 arm64: dts: rockchip: add default pinctrl for rk3588 emmc arm64: dts: rockchip: Add DT node for ADC support in RK3588 arm64: dts: rockchip: add PMIC to rk3588-evb1 arm64: dts: rockchip: Add rk3588 Edgeble Neu6 Model B IO arm64: dts: rockchip: Add rk3588 Edgeble Neu6 Model B SoM arm64: dts: rockchip: Add Rockchip RK3588J dt-bindings: arm: rockchip: Add Edgeble Neural Compute Module 6B arm64: dts: rockchip: Add RGA2 support to rk356x media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga arm64: dts: rockchip: Add rk3588 OTP node arm64: dts: rockchip: Add FriendlyARM NanoPi R2C Plus ... Link: https://lore.kernel.org/r/3239799.44csPzL39Z@phil Signed-off-by: Arnd Bergmann commit 6db92533d6a392cdddcc7291865d02d94fe56956 Merge: 60c2f542a7ada 925bac3caa46c Author: Arnd Bergmann Date: Tue Jun 20 22:45:40 2023 +0200 Merge tag 'qcom-dts-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/dt Qualcomm ARM32 DeviceTree updates for v6.5 NAND support on IPQ4019 boards is restored, after a faulty node rename. On MSM8226 IMEM, PMU and RPM stats are introduced. The Huawei Watch gains vibrator support. On MSM8974, the LGE Nexus 5 gains vibrator support. The APQ8074 Dragonboard marks BLSP2 BAM controlled remotely, DSI panel, audio and modem DSPs are enabled. On SDX65 PCIe controller and PHY are introduced, to provide endpoint functionality. This is enabled on the related MTP. A range of DeviceTree cleanups are also included. * tag 'qcom-dts-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (27 commits) ARM: dts: qcom: apq8074-dragonboard: enable DSI panel ARM: dts: qcom: apq8074-dragonboard: enable adsp and MSS ARM: dts: qcom: apq8074-dragonboard: Set DMA as remotely controlled ARM: dts: qcom: apq8026-huawei-sturgeon: Add vibrator ARM: dts: qcom: msm8226: Add IMEM node ARM: dts: qcom: msm8226: Add rpm-stats device node ARM: dts: qcom: msm8226: Add PMU node ARM: dts: qcom: sdx65-mtp: Enable PCIe EP ARM: dts: qcom: sdx65-mtp: Enable PCIe PHY ARM: dts: qcom: sdx65: Add support for PCIe EP ARM: dts: qcom: sdx65: Add support for PCIe PHY ARM: dts: qcom: msm8974: align WCNSS Bluetooth node name with bindings ARM: dts: qcom: apq8084: correct thermal sensor unit-address ARM: dts: qcom: msm8960-cdp: move regulator out of simple-bus ARM: dts: qcom: apq8060-dragonboard: move regulators out of simple-bus ARM: dts: qcom: ipq8064: align USB node names with bindings ARM: dts: qcom: ipq8064: correct LED node names ARM: dts: qcom: ipq8064: drop invalid GCC thermal-sensor unit-address ARM: dts: qcom: ipq8064: drop leading 0 from unit-address ARM: dts: qcom: msm8974: correct pronto unit-address ... Link: https://lore.kernel.org/r/20230611010843.2482142-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 60c2f542a7ada6bce82ce8e9d50e05eea74fe472 Merge: 70cdf5e28c080 20dea72a393c6 Author: Arnd Bergmann Date: Tue Jun 20 22:43:04 2023 +0200 Merge tag 'qcom-arm64-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/dt Qualcomm ARM64 DeviceTree updates for v6.5 This introduces the RDP442 and RDP433 reference devices on IPQ5332 and IPQ9574, respectively. RDP418, RDP433, RDP449 and RDP453 on the IPQ9574 are added. On MSM8939 the Square T2 board and the Sony Xperia M4 Aqua is added. Support for Acer Apire 1, built on the Snapdragon 7c platform is introduced. Fxtec Pro1X on SM6115 is added. Lastly long floating support for SC8180X and the Lenovo Flex 5G, and the Primus reference device, has been added. On IPQ5332 and IPQ6018 QFPROM support is introduced, and as described above the RDP442 board on the prior. Download mode support and various reserved-memory regions are also introduced on IPQ6018. IPQ8074 gains another SPI controller. On IPQ9574 CPU frequency scaling, low speed busses, RNG, Watchdog, qfprom, SMEM and RPM are introduced. As are support for four new board, mentioned above. MSM8916 gains a range of structural improvements, to better suite the various boards supported. Regulator constraints are corrected and their states are adjusted to match reality (e.g. always-on regulators marked as always-on). BQ Aquaris X5 gains support for front flash LED. As mentioned above, MSM8939 support is introduced with support for boards from Sony and Square. MSM8953 gains DMA support in I2C masters. MSM8996-based Sony Xperia boards gains description of their RGB notification LED. On SA8775P support for UFS, USB, GPU clock and iommu controllers, PMU, AOSS, watchdog and missing low-speed controllers are added. On the Ride platform UFS, USB and an i2c bus are enabled. iommu properties are added to QSPI on both SC7180 and SC7280. LPASS clocks are adjusted and MDP node cleaned up slightly, on SC7180. As mentioned above, support for Acer Aspire 1 is introduced. Long lingering patches introducing SC8180X, the Lenovo Flex 5G and the Primus reference device has been merged. On SC8280XP ethernet is added and enabled on the automotive ride platform. An SDC controller is introduced and enabled on the SC8280XP CRD. On the Lenovo Thinkpad X13s and the CRD reference device the USB SuperSpeed phy is added to the Type-C graph, to enable support for orientation switching. Fairphone 3 gains support for its notification LED. On SDM845 the iommu stream for QSPI is defined, SHIFT SHIFT6mq gains support for flash LED and the RB3 (DB845c) board gains support for bonded/dual DSI-mode, to allow 4k output. On SM6115 CPU idle-states, crypto engine support and SuperSpeed USB PHY are introduced. As mentioned above Fxtec Pro1X is introduced. On the QRB4210 Robotics Platform RB2 USB, Audio and Compute DSPs, display, CAN-bus and GPIO LEDs are introduced, fixed regulators are described and the SD-card description is corrected. Support for crypto engine is added to SM8150, while Sony Xperia 1 and 5 gains SD-card support, camera regulators and GPIO line names sorted out. SM8250 also gets support for crypto engine, and Sony Xperia 1 II and 5 II gains support for hardware video accelerator. Crypto engine is introduced for SM8350 as well. The HDK gets the USB Type-C graph described for Superspeed orientation switching and DisplayPort output. On SM8450 video clock controller and crypto engine are added, missing opp levels are introduced and the USB Type-C graph is defined for orientation switching and altmode. SM8550 gains GPU and video clock controllers and missing opp levels are added. The WCD9385 audio codec is added for the SM8550 MTP and on the QRD PCIe, USB, audio display and flash LED are added. * tag 'qcom-arm64-for-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (195 commits) arm64: dts: qcom: sc8180x: Introduce Lenovo Flex 5G arm64: dts: qcom: sc8180x: Introduce Primus arm64: dts: qcom: sc8180x: Add pmics arm64: dts: qcom: sc8180x: Add display and gpu nodes arm64: dts: qcom: sc8180x: Add remoteprocs, wifi and usb nodes arm64: dts: qcom: sc8180x: Add PCIe instances arm64: dts: qcom: sc8180x: Add QUPs arm64: dts: qcom: sc8180x: Add thermal zones arm64: dts: qcom: sc8180x: Add interconnects and lmh arm64: dts: qcom: Introduce the SC8180x platform arm64: dts: qcom: msm8916: Move aliases to boards arm64: dts: qcom: pm8916: Rename &wcd_codec -> &pm8916_codec arm64: dts: qcom: msm8916/39: Clean up MDSS labels arm64: dts: qcom: msm8916/39: Use consistent name for I2C/SPI pinctrl arm64: dts: qcom: msm8916/39: Rename &blsp1_uartN -> &blsp_uartN arm64: dts: qcom: msm8916: Rename &msmgpio -> &tlmm arm64: dts: qcom: qrb4210-rb2: Enable USB node arm64: dts: qcom: sm6115: Add USB SS qmp phy node arm64: dts: qcom: ipq5332: add support for the RDP442 variant dt-bindings: arm: qcom: document MI01.3 board based on IPQ5332 family ... Link: https://lore.kernel.org/r/20230611004944.2481596-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 70cdf5e28c08020caf1e6f97ca2b1e03de424917 Merge: f50a4e594db87 8e2facfe904a2 Author: Arnd Bergmann Date: Tue Jun 20 22:40:43 2023 +0200 Merge tag 'imx-dt64-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt i.MX arm64 device tree for 6.5: - New board support: i.MX8MM based Emtop SoM & Baseboard, NXP i.MX8MM EVKB board, i.MX8MP based Gateworks Venice gw7905-2x device. - A series from Adam Ford to add Camera and Audio support for i.MX8M based Beacon boards. - Add Audio output support for i.MX8MP TQMa8MPxL/MBa8MPxL board. - Add HDMI and display support for imx8mm-evk and imx8mm-phg board. - Add coresight trace devices support for i.MX8MP SoC. - A couple of changes from Krzysztof Kozlowski to add missing cache properties. - A couple of changes from Laurent Pinchart to add CSIS and ISI devices for i.MX8MP SoC. - A series from Marek Vasut to add more devices for i.MX8MP, and enable SAI audio on i.MX8MP DHCOM PDK2 and PDK3. - Correct GSC vdd_bat data size for Gateworks Venice devices. - Add more device support for i.MX93, Watchdog, OCOTP, idle states, DDR performance monitor, etc. - Small and random clean-ups and device node additions. * tag 'imx-dt64-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (47 commits) arm64: dts: imx8mq: Pass address-cells/size-cells to mipi_dsi arm64: dts: imx8mq: Use 'dsi' as node name arm64: dts: imx8mp-venice-gw702x: fix GSC vdd_bat data size arm64: dts: imx8mq-tqma8mq-mba8mx: Remove invalid properties arm64: dts: imx8mq: Add missing pci property arm64: dts: imx8mq: Fix lcdif clocks arm64: dts: imx8mq: Fix lcdif compatible arm64: dts: imx8mp: don't initialize audio clocks from CCM node arm64: dts: imx8mm-venice: Fix GSC vdd_bat data size. arm64: dts: imx8mp: Add coresight trace components arm64: dts: imx93: add ddr performance monitor node arm64: dts: imx8mm-phg: Add display support arm64: dts: tqma8mqml: Add vcc supply to i2c eeproms arm64: dts: imx8mm-evk: Add HDMI support arm64: dts: imx8mn-var-som-symphony: adapt FEC pinctrl for SOMs with onboard PHY arm64: dts: imx8mn-var-som: add 20ms delay to ethernet regulator enable arm64: dts: imx8mp-msc-sm2s: Add sound card arm64: dts: imx8mn-beacon: Migrate sound card to simple-audio-card arm64: dts: imx8mp-beacon-kit: Enable WM8962 Audio CODEC arm64: dts: imx93: add fsl,stop-mode property to support WOL ... Link: https://lore.kernel.org/r/20230610072530.418847-3-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit f50a4e594db87ad8beed9bb42a067224724d07de Merge: 3230271930ad9 5ef0f31fb9285 Author: Arnd Bergmann Date: Tue Jun 20 22:38:10 2023 +0200 Merge tag 'imx-dt-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt i.MX ARM device tree for 6.5: - New board support: Marantec Maveo Box. - Add HDMI support for TQMa6x/MBa6 board. - A series from Andrew Lunn to add phy-mode and fixed links for Ethernet devices on imx51, imx6qdl and vf610. - A bunch of changes from Fabio Estevam to clean up deprecated and invalid properies, fix up node names to remove dt-schema warnings. - A series of maintenance updates for Protonic Holland boards, mostly on the USB subsystem configuration, thermal zones, and the naming of GPIO keys. - Update dma-apbh device node name to remove dtbs_check warnings. - Remove invalid nodes from fan-controller for a couple of Gateworks boards. - Small random updates and clean-ups on various boards. * tag 'imx-dt-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (53 commits) ARM: dts: imx6qdl: vicut1: rename power to power-button ARM: dts: imx6dl: prtrvt, prtvt7, prti6q, prtwd2: fix USB related warnings ARM: dts: imx6dl: plybas: fix USB over-current detection on USB OTG port ARM: dts: imx6ul: prti6g: fix USB over-current detection on USB OTG port ARM: dts: imx6qp: prtwd3: Enable USB over current detection on USB OTG port ARM: dts: imx6dl: prtmvt: fix different USB related warnings ARM: dts: imx6dl: alti6p: fix different USB related warnings ARM: dts: imx6dl: vicut1: Address USB related warnings ARM: dts: imx6dl: Add trip points to thermal zones on several devices ARM: dts: imx6dl: lanmcu: Configure over-current polarity for USB OTG node ARM: dts: imx6dl: lanmcu: Disable unused USB PHY nodes ARM: dts: imx6q: prtwd2: Correct iomux configuration for ENET MDIO and MDC ARM: dts: imx6dl: prtvt7: Remove touchscreen inversion ARM: dts: imx6dl: prtvt7: Adjust default backlight brightness to 65 ARM: dts: imx6qdl: vicut1: The sgtl5000 uses i2s not ac97 ARM: dts: imx: Use 'eeprom' as node name ARM: dts: imx6ul-ccimx6ulsom: Fix the "coin" regulator name ARM: dts: imx: Use 'pmic' as node name ARM: dts: imx6: Use the mux- prefix ARM: dts: imx7d-sdb: Allow UHS modes ... Link: https://lore.kernel.org/r/20230610072530.418847-2-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 3230271930ad9fb8c82de7b0c5cc41c87da7bc15 Merge: 52d38cff94f8d 50b1e9ece16c5 Author: Arnd Bergmann Date: Tue Jun 20 22:37:32 2023 +0200 Merge tag 'imx-bindings-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt i.MX dt-bindings for 6.5: - Add vendor prefix for Emtop - Compatibles for Marantec Maveo Box, i.MX8MM-EVKB and GW7905-2x board. - Replace tab indent with spaces in fsl.yaml. * tag 'imx-bindings-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: dt-bindings: arm: Add Gateworks i.MX8M GW7905-2x board dt-bindings: arm: fsl: Fix syntax error dt-bindings: vendor-prefixes: Add Emtop dt-bindings: arm: fsl: Add Emtop SoM & Baseboard dt-bindings: arm: fsl: Add i.MX8MM-EVKB dt-bindings: arm: fsl: Add Marantec maveo box as a DHCOR i.MX6ULL SoM based board Link: https://lore.kernel.org/r/20230610072530.418847-1-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 52d38cff94f8d601493774dfe0b161de1adba7e1 Merge: a9c7f8d0cfb79 09d199b6dcb6b Author: Arnd Bergmann Date: Tue Jun 20 22:36:26 2023 +0200 Merge tag 'sunxi-dt-for-6.5-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into soc/dt - fix DCLK clock names - new board ICnova A20 ADB4006 - add D1 SPI node - add bluetooth node for chip board - add extra mmc2 pinmux to sun5i - add axp209 iio-hwmon node * tag 'sunxi-dt-for-6.5-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: ARM: dts: axp209: Add iio-hwmon node for internal temperature ARM: dts: sun5i: Add port E pinmux settings for mmc2 ARM: dts: sun5i: chip: Enable bluetooth riscv: dts: allwinner: d1: Add SPI controllers node arm: dts: sunxi: Add ICnova A20 ADB4006 board dt-bindings: arm: sunxi: add ICnova A20 ADB4006 binding ARM: dts: sunxi: rename tcon's clock output Link: https://lore.kernel.org/r/20230609210452.GA17638@jernej-laptop Signed-off-by: Arnd Bergmann commit acf15e07eb06507c69f92394c36052677029b0a8 Author: Azeem Shaikh Date: Tue Jun 13 00:34:37 2023 +0000 netfilter: ipset: Replace strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since return value from all callers of STRLCPY macro were ignored. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Acked-by: Jozsef Kadlecsik Reviewed-by: Kees Cook Reviewed-by: Simon Horman Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230613003437.3538694-1-azeemshaikh38@gmail.com commit f0a6b5831cfb17381ada015778448b12c1c6179e Author: Azeem Shaikh Date: Wed Jun 14 00:36:04 2023 +0000 uml: Replace strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230614003604.1021205-1-azeemshaikh38@gmail.com commit a9c7f8d0cfb79dd96958d6845b6f0b3c4b57dd07 Merge: 79e47607205aa 6312e57b32500 Author: Arnd Bergmann Date: Tue Jun 20 22:34:46 2023 +0200 Merge tag 'tegra-for-6.5-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/dt arm64: tegra: Device tree changes for v6.5-rc1 This introduces support for the IGX Orin and Jetson Orin Nano devices and enables various additional features on the Jetson AGX Orin and Jetson Orin NX. This also enables some basic thermal support to prevent the devices from overheating. Support for the GPU on the Google Pixel C is enabled and various minor issues are fixed and cleaned up. * tag 'tegra-for-6.5-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: arm64: tegra: Enable thermal support on Jetson Orin Nano arm64: tegra: Enable thermal support on Jetson Orin NX arm64: tegra: Enable thermal support on Jetson AGX Orin arm64: tegra: Add Tegra234 thermal support arm64: tegra: Add a few blank lines for better readability arm64: tegra: Sort properties more logically arm64: tegra: Enable GPU on Smaug arm64: tegra: Add GPU power rail regulator on Smaug arm64: tegra: Update USB phy-name for Jetson Orin NX arm64: tegra: Enable USB device for Jetson AGX Orin arm64: tegra: Add Tegra234 pin controllers arm64: tegra: Support Jetson Orin Nano Developer Kit arm64: tegra: Add missing cache properties on Tegra210 arm64: tegra: Fix PCIe regulator for Orin Jetson AGX arm64: tegra: Add CPU OPP tables and interconnects property arm64: tegra: Add support for IGX Orin Link: https://lore.kernel.org/r/20230609193620.2275240-6-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 79e47607205aa5a39c6aa96a3bcf6ebeac77f042 Merge: b1062d1971ff3 5f027147e4796 Author: Arnd Bergmann Date: Tue Jun 20 22:33:45 2023 +0200 Merge tag 'tegra-for-6.5-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/dt dt-bindings: Changes for v6.5-rc1 Several new modules and devices are documented and fixes incorporated for the Tegra234 GPIO controller pin mappings as well as the possible Tegra XUDC PHY connections. * tag 'tegra-for-6.5-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: dt-bindings: tegra: Document Jetson Orin Nano Developer Kit dt-bindings: tegra: Document Jetson Orin Nano dt-bindings: gpio: Remove FSI domain ports on Tegra234 dt-bindings: usb: tegra-xudc: Remove extraneous PHYs dt-bindings: tegra: Add ICC IDs for dummy memory clients dt-bindings: tegra: Document compatible for IGX Link: https://lore.kernel.org/r/20230609193620.2275240-3-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit b1062d1971ff389e5ebc1f52334f444dd24da86c Merge: 7b87c164e179d 076c74c592cab Author: Arnd Bergmann Date: Tue Jun 20 22:31:22 2023 +0200 Merge tag 'stm32-dt-for-v6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into soc/dt STM32 DT for v6.5, round 1 Highlights: ---------- - MCU/MPU: - Replace deprecated st,hw-flow-ctrl by uart-has-rtscts. - Fix LTDC/DSI warnings. - MPU: - STMP32MP15: - Add OTP part number and Vrefint calibration in bsec. - M4 hold management updated. As SMC call is deprecated, the service is moved on a SCMI service. - Add ADC internal channels (VREFINT/VDDCORE). - ST: - Enable ADC1&2 on STM32MP15 DKx boards. - Adopt generic IIO bindings on STM32MP157C ED1 - Add supplies for OV5640 in STM32MP157C EV1 to fix yaml validation. - Fix i2s bindings to match with the YAML validation (DKx boards). - DH: - Rearrange MAC EEPROM. - Rename AV96 sound card. - Adopt generic IIo bindings. - Fix audio routing. -PHYTEC: - Add PHYTEC STM32MP1-3 Dev board based on STM32MP15 PHYTEC SOM. This SOM embeds up to 1GB DDR3LP RAM, up to 1GB eMMC, up to 16 MB QSPI and up to 128 GB NAND flash. * tag 'stm32-dt-for-v6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32: (34 commits) ARM: dts: stm32: fix i2s endpoint format property for stm32mp15xx-dkx ARM: dts: stm32: Fix audio routing on STM32MP15xx DHCOM PDK2 ARM: dts: stm32: add required supplies of ov5640 in stm32mp157c-ev1 ARM: dts: stm32: Update to generic ADC channel binding on DHSOM systems ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1 ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards ARM: dts: stm32: add vrefint support to adc2 on stm32mp15 ARM: dts: stm32: add vrefint calibration on stm32mp15 ARM: dts: stm32: add adc internal channels to stm32mp15 ARM: dts: stm32: fix ltdc warnings in stm32mp15 boards ARM: dts: stm32: fix dsi warnings on stm32mp15 boards dt-bindings: display: st,stm32-dsi: Remove unnecessary fields ARM: dts: stm32: fix warnings on stm32f469-disco board ARM: dts: stm32: Shorten the AV96 HDMI sound card name ARM: dts: stm32: fix m4_rproc references to use SCMI for stm32mp15 ARM: dts: stm32: Update Cortex-M4 reset declarations on stm32mp15 ARM: dts: stm32: add STM32MP1-based Phytec board ... Link: https://lore.kernel.org/r/08d711de-bb6d-a976-735b-5e18b19818ea@foss.st.com Signed-off-by: Arnd Bergmann commit 868a11b602cfa5159aab0403cc088009b59c074e Merge: 425d827ef91ec c9cb7e72e2931 Author: Arnd Bergmann Date: Tue Jun 20 22:28:39 2023 +0200 Merge tag 'stm32-mp25-for-v6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into soc/newsoc STM32 STM32MP25 for v6.5, round 1 Highlights: ---------- STM32MP25 family is composed of 4 SoCs defined as following: -STM32MP251: common part composed of 1*Cortex-A35, common peripherals like SDMMC, UART, SPI, I2C, PCIe, USB3, parallel and DSI display, 1*ETH ... -STM32MP253: STM32MP251 + 1*Cortex-A35 (dual CPU), a second ETH, CAN-FD and LVDS display. -STM32MP255: STM32MP253 + GPU/AI and video encode/decode. -STM32MP257: STM32MP255 + ETH TSN switch (2+1 ports). A second diversity layer exists for security features/A35 frequency: -STM32MP25xY, "Y" gives information: -Y = A means A35@1.2GHz + no cryp IP and no secure boot. -Y = C means A35@1.2GHz + cryp IP and secure boot. -Y = D means A35@1.5GHz + no cryp IP and no secure boot. -Y = F means A35@1.5GHz + cryp IP and secure boot. This PR adds the STM32MP257F EV1 board support. This board embeds a STM32MP257FAI SoC, with 4GB of DDR4, TSN switch (2+1 ports), 2*USB typeA, 1*USB2 typeC, SNOR OctoSPI, mini PCIe, STPMIC2 for power distribution ... * tag 'stm32-mp25-for-v6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32: (44 commits) MAINTAINERS: add entry for ARM/STM32 ARCHITECTURE arm64: defconfig: enable ARCH_STM32 and STM32 serial driver arm64: dts: st: add stm32mp257f-ev1 board support dt-bindings: stm32: document stm32mp257f-ev1 board arm64: dts: st: introduce stm32mp25 pinctrl files arm64: dts: st: introduce stm32mp25 SoCs family arm64: introduce STM32 family on Armv8 architecture dt-bindings: stm32: add st,stm32mp25-syscfg compatible for syscon pinctrl: stm32: add stm32mp257 pinctrl support dt-bindings: pinctrl: stm32: support for stm32mp257 and additional packages ARM: dts: stm32: fix i2s endpoint format property for stm32mp15xx-dkx ARM: dts: stm32: Fix audio routing on STM32MP15xx DHCOM PDK2 ARM: dts: stm32: add required supplies of ov5640 in stm32mp157c-ev1 ARM: dts: stm32: Update to generic ADC channel binding on DHSOM systems ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1 ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards ARM: dts: stm32: add vrefint support to adc2 on stm32mp15 ... Link: https://lore.kernel.org/r/080fc303-45c1-6cc0-4c5e-694e730896a6@foss.st.com Signed-off-by: Arnd Bergmann commit b6f3f28f604ba3de4724ad82bea6adb1300c0b5f Author: Michael Schmitz Date: Wed Jun 21 08:17:25 2023 +1200 block: add overflow checks for Amiga partition support The Amiga partition parser module uses signed int for partition sector address and count, which will overflow for disks larger than 1 TB. Use u64 as type for sector address and size to allow using disks up to 2 TB without LBD support, and disks larger than 2 TB with LBD. The RBD format allows to specify disk sizes up to 2^128 bytes (though native OS limitations reduce this somewhat, to max 2^68 bytes), so check for u64 overflow carefully to protect against overflowing sector_t. Bail out if sector addresses overflow 32 bits on kernels without LBD support. This bug was reported originally in 2012, and the fix was created by the RDB author, Joanne Dow . A patch had been discussed and reviewed on linux-m68k at that time but never officially submitted (now resubmitted as patch 1 in this series). This patch adds additional error checking and warning messages. Reported-by: Martin Steigerwald Closes: https://bugzilla.kernel.org/show_bug.cgi?id=43511 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Message-ID: <201206192146.09327.Martin@lichtvoll.de> Cc: # 5.2 Signed-off-by: Michael Schmitz Reviewed-by: Geert Uytterhoeven Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620201725.7020-4-schmitzmic@gmail.com Signed-off-by: Jens Axboe commit 95a55437dc49fb3342c82e61f5472a71c63d9ed0 Author: Michael Schmitz Date: Wed Jun 21 08:17:24 2023 +1200 block: change all __u32 annotations to __be32 in affs_hardblocks.h The Amiga partition parser module uses signed int for partition sector address and count, which will overflow for disks larger than 1 TB. Use u64 as type for sector address and size to allow using disks up to 2 TB without LBD support, and disks larger than 2 TB with LBD. The RBD format allows to specify disk sizes up to 2^128 bytes (though native OS limitations reduce this somewhat, to max 2^68 bytes), so check for u64 overflow carefully to protect against overflowing sector_t. This bug was reported originally in 2012, and the fix was created by the RDB author, Joanne Dow . A patch had been discussed and reviewed on linux-m68k at that time but never officially submitted (now resubmitted as patch 1 of this series). Patch 3 (this series) adds additional error checking and warning messages. One of the error checks now makes use of the previously unused rdb_CylBlocks field, which causes a 'sparse' warning (cast to restricted __be32). Annotate all 32 bit fields in affs_hardblocks.h as __be32, as the on-disk format of RDB and partition blocks is always big endian. Reported-by: Martin Steigerwald Closes: https://bugzilla.kernel.org/show_bug.cgi?id=43511 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Message-ID: <201206192146.09327.Martin@lichtvoll.de> Cc: # 5.2 Signed-off-by: Michael Schmitz Reviewed-by: Christoph Hellwig Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230620201725.7020-3-schmitzmic@gmail.com Signed-off-by: Jens Axboe commit fc3d092c6bb48d5865fec15ed5b333c12f36288c Author: Michael Schmitz Date: Wed Jun 21 08:17:23 2023 +1200 block: fix signed int overflow in Amiga partition support The Amiga partition parser module uses signed int for partition sector address and count, which will overflow for disks larger than 1 TB. Use sector_t as type for sector address and size to allow using disks up to 2 TB without LBD support, and disks larger than 2 TB with LBD. This bug was reported originally in 2012, and the fix was created by the RDB author, Joanne Dow . A patch had been discussed and reviewed on linux-m68k at that time but never officially submitted. This patch differs from Joanne's patch only in its use of sector_t instead of unsigned int. No checking for overflows is done (see patch 3 of this series for that). Reported-by: Martin Steigerwald Closes: https://bugzilla.kernel.org/show_bug.cgi?id=43511 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Message-ID: <201206192146.09327.Martin@lichtvoll.de> Cc: # 5.2 Signed-off-by: Michael Schmitz Tested-by: Martin Steigerwald Reviewed-by: Geert Uytterhoeven Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620201725.7020-2-schmitzmic@gmail.com Signed-off-by: Jens Axboe commit e7e39756363ad5bd83ddeae1063193d0f13870fd Author: Ilpo Järvinen Date: Tue May 2 11:39:23 2023 +0300 PCI/ASPM: Avoid link retraining race PCIe r6.0.1, sec 7.5.3.7, recommends setting the link control parameters, then waiting for the Link Training bit to be clear before setting the Retrain Link bit. This avoids a race where the LTSSM may not use the updated parameters if it is already in the midst of link training because of other normal link activity. Wait for the Link Training bit to be clear before toggling the Retrain Link bit to ensure that the LTSSM uses the updated link control parameters. [bhelgaas: commit log, return 0 (success)/-ETIMEDOUT instead of bool for both pcie_wait_for_retrain() and the existing pcie_retrain_link()] Suggested-by: Lukas Wunner Fixes: 7d715a6c1ae5 ("PCI: add PCI Express ASPM support") Link: https://lore.kernel.org/r/20230502083923.34562-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas Reviewed-by: Lukas Wunner Cc: stable@vger.kernel.org commit 9c7f136433d26592cb4d9cd00b4e15c33d9797c6 Author: Ilpo Järvinen Date: Tue Jun 20 14:49:33 2023 -0500 PCI/ASPM: Factor out pcie_wait_for_retrain() Factor pcie_wait_for_retrain() out from pcie_retrain_link(). No functional change intended. [bhelgaas: split out from https://lore.kernel.org/r/20230502083923.34562-1-ilpo.jarvinen@linux.intel.com] Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit f5297a01ee805d7fa569d288ed65fc0f9ac9b03d Author: Bjorn Helgaas Date: Tue Jun 20 14:44:55 2023 -0500 PCI/ASPM: Return 0 or -ETIMEDOUT from pcie_retrain_link() "pcie_retrain_link" is not a question with a true/false answer, so "bool" isn't quite the right return type. Return 0 for success or -ETIMEDOUT if the retrain failed. No functional change intended. [bhelgaas: based on Ilpo's patch below] Link: https://lore.kernel.org/r/20230502083923.34562-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Bjorn Helgaas commit f3fb462443a5e150599fa6692e660e25c974e7be Author: Wonguk Lee Date: Fri May 5 23:05:16 2023 +0900 fs: jfs: (trivial) Fix typo in dbInitTree function While trying to fix the jfs UBSAN problem reported in syzkaller, (https://syzkaller.appspot.com/bug?id=01abadbd6ae6a08b1f1987aa61554c6b3ac19ff2) I found the typo in the comment of dbInitTree function and fix it. Signed-off-by: Wonguk Lee Signed-off-by: Dave Kleikamp commit ee95b88d71b9cf7ac1085ebc014f161971e1be9a Author: Viacheslav Mitrofanov Date: Fri May 5 07:20:57 2023 +0000 perf: RISC-V: Limit the number of counters returned from SBI Perf gets the number of supported counters from SBI. If it happens that the number of returned counters more than RISCV_MAX_COUNTERS the code trusts it. It does not lead to an immediate problem but can potentially lead to it. Prevent getting more than RISCV_MAX_COUNTERS from SBI. Signed-off-by: Viacheslav Mitrofanov Reviewed-by: Andrew Jones Reviewed-by: Atish Patra Link: https://lore.kernel.org/r/20230505072058.1049732-1-v.v.mitrofanov@yadro.com Signed-off-by: Palmer Dabbelt commit ebf51575c8418fcbabe489b3b4a4227c34ed256a Author: Claudiu Beznea Date: Thu Jun 15 13:19:31 2023 +0300 clk: fix typo in clk_hw_register_fixed_rate_parent_data() macro clk_hw_register_fixed_rate_parent_data() 3rd parameter is parent_data not parent_hw. Inner function (__clk_hw_register_fixed_rate()) is called with parent_data parameter as valid. To have this parameter taken into account update the name of the 3rd parameter of clk_hw_register_fixed_rate_parent_data() macro to parent_data. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230615101931.581060-1-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd commit 857922b16bb893d26d5ecd83acf9f20cb28eaea2 Author: Lucas Stach Date: Fri Jun 16 21:18:32 2023 +0200 net: fec: allow to build without PAGE_POOL_STATS Commit 6970ef27ff7f ("net: fec: add xdp and page pool statistics") selected CONFIG_PAGE_POOL_STATS from the FEC driver symbol, making it impossible to build without the page pool statistics when this driver is enabled. The help text of those statistics mentions increased overhead. Allow the user to choose between usefulness of the statistics and the added overhead. Signed-off-by: Lucas Stach Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230616191832.2944130-1-l.stach@pengutronix.de Signed-off-by: Jakub Kicinski commit b6d972f6898308fbe7e693bf8d44ebfdb1cd2dc4 Author: David Howells Date: Fri Jun 16 12:10:32 2023 +0100 crypto: af_alg/hash: Fix recvmsg() after sendmsg(MSG_MORE) If an AF_ALG socket bound to a hashing algorithm is sent a zero-length message with MSG_MORE set and then recvmsg() is called without first sending another message without MSG_MORE set to end the operation, an oops will occur because the crypto context and result doesn't now get set up in advance because hash_sendmsg() now defers that as long as possible in the hope that it can use crypto_ahash_digest() - and then because the message is zero-length, it the data wrangling loop is skipped. Fix this by handling zero-length sends at the top of the hash_sendmsg() function. If we're not continuing the previous sendmsg(), then just ignore the send (hash_recvmsg() will invent something when called); if we are continuing, then we finalise the request at this point if MSG_MORE is not set to get any error here, otherwise the send is of no effect and can be ignored. Whilst we're at it, remove the code to create a kvmalloc'd scatterlist if we get more than ALG_MAX_PAGES - this shouldn't happen. Fixes: c662b043cdca ("crypto: af_alg/hash: Support MSG_SPLICE_PAGES") Reported-by: syzbot+13a08c0bf4d212766c3c@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/000000000000b928f705fdeb873a@google.com/ Reported-by: syzbot+14234ccf6d0ef629ec1a@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/000000000000c047db05fdeb8790@google.com/ Reported-by: syzbot+4e2e47f32607d0f72d43@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/000000000000bcca3205fdeb87fb@google.com/ Reported-by: syzbot+472626bb5e7c59fb768f@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/000000000000b55d8805fdeb8385@google.com/ Signed-off-by: David Howells Reported-and-tested-by: syzbot+6efc50cc1f8d718d6cb7@syzkaller.appspotmail.com cc: Jens Axboe cc: Matthew Wilcox Acked-by: Herbert Xu Link: https://lore.kernel.org/r/427646.1686913832@warthog.procyon.org.uk Signed-off-by: Jakub Kicinski commit 7fb933e56f77a57ef7cfc59fc34cbbf1b1fa31ff Author: Fei Shao Date: Mon Jun 19 11:22:53 2023 +0800 clk: Fix memory leak in devm_clk_notifier_register() devm_clk_notifier_register() allocates a devres resource for clk notifier but didn't register that to the device, so the notifier didn't get unregistered on device detach and the allocated resource was leaked. Fix the issue by registering the resource through devres_add(). This issue was found with kmemleak on a Chromebook. Fixes: 6d30d50d037d ("clk: add devm variant of clk_notifier_register") Signed-off-by: Fei Shao Link: https://lore.kernel.org/r/20230619112253.v2.1.I13f060c10549ef181603e921291bdea95f83033c@changeid Reviewed-by: Dan Carpenter Signed-off-by: Stephen Boyd commit 462a3daad679406eed5d31b6bed8a19c236e1352 Author: Arnd Bergmann Date: Fri Jun 16 11:29:54 2023 +0200 net: phy: mediatek: fix compile-test dependencies The new phy driver attempts to select a driver from another subsystem, but that fails when the NVMEM subsystem is disabled: WARNING: unmet direct dependencies detected for NVMEM_MTK_EFUSE Depends on [n]: NVMEM [=n] && (ARCH_MEDIATEK [=n] || COMPILE_TEST [=y]) && HAS_IOMEM [=y] Selected by [y]: - MEDIATEK_GE_SOC_PHY [=y] && NETDEVICES [=y] && PHYLIB [=y] && (ARM64 && ARCH_MEDIATEK [=n] || COMPILE_TEST [=y]) I could not see an actual compile time dependency, so presumably this is only needed for for working correctly but not technically a dependency on that particular nvmem driver implementation, so it would likely be safe to remove the select for compile testing. To keep the spirit of the original 'select', just replace this with a 'depends on' that ensures that the driver will work but does not get in the way of build testing. Fixes: 98c485eaf509b ("net: phy: add driver for MediaTek SoC built-in GE PHYs") Signed-off-by: Arnd Bergmann Reviewed-by: Simon Horman Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Reviewed-by: Daniel Golle Link: https://lore.kernel.org/r/20230616093009.3511692-1-arnd@kernel.org Signed-off-by: Jakub Kicinski commit bd73d1fd63d4f67dc78640c9ae4f83e20a021d76 Author: Rob Herring Date: Fri Jun 9 12:13:47 2023 -0600 clk: mvebu: Iterate over possible CPUs instead of DT CPU nodes Rework iterating over DT CPU nodes to iterate over possible CPUs instead. There's no need to walk the DT CPU nodes again. Possible CPUs is equal to the number of CPUs defined in the DT. Using the "reg" value for an array index is fragile as it assumes "reg" is 0-N which often is not the case. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230327-mvebu-clk-fixes-v2-3-8333729ee45d@kernel.org Signed-off-by: Stephen Boyd commit 1949c0ebc8d660d35ea968ed609c528076b7d44f Author: Rob Herring Date: Fri Jun 9 12:13:46 2023 -0600 clk: mvebu: Use of_get_cpu_hwid() to read CPU ID Use of_get_cpu_hwid() rather than the open coded reading of the CPU nodes "reg" property. The existing code is in fact wrong as the "reg" address cells size is 2 cells for arm64. The existing code happens to work because the DTS files are wrong as well. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230327-mvebu-clk-fixes-v2-2-8333729ee45d@kernel.org Signed-off-by: Stephen Boyd commit 1ab391684c9e195c05834def0d08779500b0b319 Author: Rob Herring Date: Fri Jun 9 12:13:45 2023 -0600 MAINTAINERS: Add Marvell mvebu clock drivers drivers/clk/mvebu/ is missing a maintainers entry. Add it to the existing entry for the Marvell mvebu platforms. Reviewed-by: Andrew Lunn Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230327-mvebu-clk-fixes-v2-1-8333729ee45d@kernel.org Signed-off-by: Stephen Boyd commit 6d4e80db4ebe76c4a4b6ffb6547cb168275204ef Author: Min Li Date: Mon Jun 19 09:12:14 2023 +0000 block: add capacity validation in bdev_add_partition() In the function bdev_add_partition(),there is no check that the start and end sectors exceed the size of the disk before calling add_partition. When we call the block's ioctl interface directly to add a partition, and the capacity of the disk is set to 0 by driver,the command will continue to execute. Signed-off-by: Min Li Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230619091214.31615-1-min15.li@samsung.com Signed-off-by: Jens Axboe commit 9a72a02456a839676fe8f220a44ef00951596047 Author: Jingbo Xu Date: Tue Jun 13 16:40:08 2023 +0800 block: fine-granular CAP_SYS_ADMIN for Persistent Reservation Allow of unprivileged Persistent Reservation operations on devices if the write permission check on the device node has passed. brw-rw---- 1 root disk 259, 0 Jun 13 07:09 /dev/nvme0n1 In the example above, the "disk" group of nvme0n1 is also allowed to make reservations on the device even without CAP_SYS_ADMIN. Signed-off-by: Jingbo Xu Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230613084008.93795-3-jefflexu@linux.alibaba.com Signed-off-by: Jens Axboe commit 12629621669b239445727256d1a5dab616b30deb Author: Jingbo Xu Date: Tue Jun 13 16:40:07 2023 +0800 block: disallow Persistent Reservation on partitions Refuse Persistent Reservation operations on partitions as reservation on partitions doesn't make sense. Besides, introduce blkdev_pr_allowed() helper, where more policies could be placed here later. Signed-off-by: Jingbo Xu Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230613084008.93795-2-jefflexu@linux.alibaba.com Signed-off-by: Jens Axboe commit d0d3e218d50bc93282df7bded9193e6fc9ccda48 Author: Thomas Richter Date: Wed Jun 14 09:37:42 2023 +0200 s390/cpum_cf: open access to hwctr device for CAP_PERFMON privileged process The device /dev/hwctr was introduced to access complete CPU Measurement facility counter sets via an ioctl system call. The access the to device is limited to privileged processes running as root or superuser. The capability CAP_SYS_ADMIN is required. The device permissions are read/write for the device owner root. There is no need for this restriction. Make the device access permission read/write for all and reduce the capabilities to CAP_PERFMON. Any user space program with the CAP_PERFMON capability assigned to it can now read and display the CPU Measurement facility counter sets. For more details on perf tool usage and security, see linux documentation in Documentation/admin-guide/perf-security.rst. Signed-off-by: Thomas Richter Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 11458e2b3ffa0e3798f392695d7aec210ac14efd Author: Sumanth Korikkar Date: Mon Jun 5 09:55:27 2023 +0200 s390/module: fix rela calculation for R_390_GOTENT During module load, module layout allocation occurs by initially allowing the architecture to frob the sections. This is performed via module_frob_arch_sections(). However, the size of each module memory types like text,data,rodata etc are updated correctly only after layout_sections(). After calculation of required module memory sizes for each types, move_module() is responsible for allocating the module memory for each type from modules vaddr range. Considering the sequence above, module_frob_arch_sections() updates the module mod_arch_specific got_offset before module memory text type size is fully updated in layout_sections(). Hence mod_arch_specific got_offset points to currently zero. As per s390 ABI, R_390_GOTENT : (G + O + A - P) >> 1 where G=me->mem[MOD_TEXT].base+me->arch.got_offset O=info->got_offset A=rela->r_addend P=loc fix R_390_GOTENT calculation in apply_rela(). Note: currently this doesn't break anything because me->arch.got_offset is zero. However, reordering of functions in the future could break it. Signed-off-by: Sumanth Korikkar Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit c70505434c8defb111326a143e2dd2be09778593 Author: Alexander Gordeev Date: Tue Jun 6 15:30:56 2023 +0200 s390/boot: fix physmem_info virtual vs physical address confusion Fix virtual vs physical address confusion (which currently are the same). Reviewed-by: Vasily Gorbik Signed-off-by: Alexander Gordeev commit 3e8261003bd28208986d3c42004510083c086e24 Author: Alexander Gordeev Date: Fri May 26 14:30:30 2023 +0200 s390/kasan: avoid short by one page shadow memory Kernel Address Sanitizer uses 3 bits per byte to encode memory. That is the number of bits the start and end address of a memory range is shifted right when the corresponding shadow memory is created for that memory range. The used memory mapping routine expects page-aligned addresses, while the above described 3-bit shift might turn the shadow memory range start and end boundaries into non-page-aligned in case the size of the original memory range is less than (PAGE_SIZE << 3). As result, the resulting shadow memory range could be short on one page. Align on page boundary the start and end addresses when mapping a shadow memory range and avoid the described issue in the future. Note, that does not fix a real problem, since currently no virtual regions of size less than (PAGE_SIZE << 3) exist. Reviewed-by: Vasily Gorbik Signed-off-by: Alexander Gordeev commit 2ed8b509753a0454b52b2d72e982265472c8d861 Author: Alexander Gordeev Date: Fri May 26 14:30:29 2023 +0200 s390/kasan: fix insecure W+X mapping warning Since commit 3b5c3f000c2e ("s390/kasan: move shadow mapping to decompressor") the decompressor establishes mappings for the shadow memory and sets initial protection attributes to RWX. The decompressed kernel resets protection to RW+NX later on. In case a shadow memory range is not aligned on page boundary (e.g. as result of mem= kernel command line parameter use), the "Checked W+X mappings: FAILED, 1 W+X pages found" warning hits. Reported-by: Vasily Gorbik Fixes: 557b19709da9 ("s390/kasan: move shadow mapping to decompressor") Reviewed-by: Vasily Gorbik Signed-off-by: Alexander Gordeev commit f471c6585c7f2f168b8eb2d19e2d6e5f22a6645f Author: Christophe JAILLET Date: Tue Jun 13 22:30:28 2023 +0200 s390/crash: use the correct type for memory allocation get_elfcorehdr_size() returns a size_t, so there is no real point to store it in a u32. Turn 'alloc_size' into a size_t. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/0756118c9058338f3040edb91971d0bfd100027b.1686688212.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alexander Gordeev commit 4e13c7a55cf752887f2b8d8008711dbbc64ea796 Author: Dmitry Baryshkov Date: Sun May 7 20:53:35 2023 +0300 clk: qcom: mmcc-msm8974: fix MDSS_GDSC power flags Using PWRSTS_RET on msm8974's MDSS_GDSC causes display to stop working. The gdsc doesn't fully come out of retention mode. Change it's pwrsts flags to PWRSTS_OFF_ON. Fixes: d399723950c4 ("clk: qcom: gdsc: Fix the handling of PWRSTS_RET support") Signed-off-by: Dmitry Baryshkov Reviewed-by: Rajendra Nayak Tested-by: Luca Weiss Link: https://lore.kernel.org/r/20230507175335.2321503-2-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 11509910c599cbd04585ec35a6d5e1a0053d84c1 Author: Siddh Raman Pant Date: Tue Jun 20 22:17:00 2023 +0530 jfs: jfs_dmap: Validate db_l2nbperpage while mounting In jfs_dmap.c at line 381, BLKTODMAP is used to get a logical block number inside dbFree(). db_l2nbperpage, which is the log2 number of blocks per page, is passed as an argument to BLKTODMAP which uses it for shifting. Syzbot reported a shift out-of-bounds crash because db_l2nbperpage is too big. This happens because the large value is set without any validation in dbMount() at line 181. Thus, make sure that db_l2nbperpage is correct while mounting. Max number of blocks per page = Page size / Min block size => log2(Max num_block per page) = log2(Page size / Min block size) = log2(Page size) - log2(Min block size) => Max db_l2nbperpage = L2PSIZE - L2MINBLOCKSIZE Reported-and-tested-by: syzbot+d2cd27dcf8e04b232eb2@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?id=2a70a453331db32ed491f5cbb07e81bf2d225715 Cc: stable@vger.kernel.org Suggested-by: Dave Kleikamp Signed-off-by: Siddh Raman Pant Signed-off-by: Dave Kleikamp commit 4681dacadeefa5ca6017e00736adc1d7dc963c6a Author: Fangrui Song Date: Sun Apr 23 22:32:10 2023 +0000 riscv: replace deprecated scall with ecall scall is a deprecated alias for ecall. ecall is used in several places, so there is no assembler compatibility concern. Signed-off-by: Fangrui Song Link: https://lore.kernel.org/r/20230423223210.126948-1-maskray@google.com Signed-off-by: Palmer Dabbelt commit 08e3ed12ca8615b078ea19488fb45b084e5de16b Author: Maciej W. Rozycki Date: Sun Jun 11 18:20:06 2023 +0100 PCI: Add failed link recovery for device reset events Request failed link recovery with any upstream PCIe bridge where a device has not come back after reset within PCI_RESET_WAIT time. Reset the polling interval if recovery succeeded, otherwise continue as usual. [bhelgaas: inline pcie_parent_link_retrain()] Link: https://lore.kernel.org/r/alpine.DEB.2.21.2306111631050.64925@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit a89c82249c3763780522f763dd2e615e2ea114de Author: Maciej W. Rozycki Date: Sun Jun 11 18:20:10 2023 +0100 PCI: Work around PCIe link training failures Attempt to handle cases such as with a downstream port of the ASMedia ASM2824 PCIe switch where link training never completes and the link continues switching between speeds indefinitely with the data link layer never reaching the active state. It has been observed with a downstream port of the ASMedia ASM2824 Gen 3 switch wired to the upstream port of the Pericom PI7C9X2G304 Gen 2 switch, using a Delock Riser Card PCI Express x1 > 2 x PCIe x1 device, P/N 41433, wired to a SiFive HiFive Unmatched board. In this setup the switches should negotiate a link speed of 5.0GT/s, falling back to 2.5GT/s if necessary. Instead the link continues oscillating between the two speeds, at the rate of 34-35 times per second, with link training reported repeatedly active ~84% of the time. Limiting the target link speed to 2.5GT/s with the upstream ASM2824 device makes the two switches communicate correctly. Removing the speed restriction afterwards makes the two devices switch to 5.0GT/s then. Make use of these observations and detect the inability to train the link by checking for the Data Link Layer Link Active status bit being off while the Link Bandwidth Management Status indicating that hardware has changed the link speed or width in an attempt to correct unreliable link operation. Restrict the speed to 2.5GT/s then with the Target Link Speed field, request a retrain and wait 200ms for the data link to go up. If this is successful, lift the restriction, letting the devices negotiate a higher speed. Also check for a 2.5GT/s speed restriction the firmware may have already arranged and lift it too with ports of devices known to continue working afterwards (currently only ASM2824), that already report their data link being up. [bhelgaas: reorder and squash stubs from https://lore.kernel.org/r/alpine.DEB.2.21.2306111619570.64925@angie.orcam.me.uk to avoid adding stubs that do nothing] Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203022037020.56670@angie.orcam.me.uk/ Link: https://source.denx.de/u-boot/u-boot/-/commit/a398a51ccc68 Link: https://lore.kernel.org/r/alpine.DEB.2.21.2305310038540.59226@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit 7604bc294c19fe70fb7d9091731a950b16249c51 Author: Maciej W. Rozycki Date: Sun Jun 11 18:19:57 2023 +0100 PCI: Use pcie_wait_for_link_status() in pcie_wait_for_link_delay() Remove a DLLLA status bit polling loop from pcie_wait_for_link_delay() and call almost identical code in pcie_wait_for_link_status() instead. This reduces the lower bound on the polling interval from 10ms to 1ms, possibly increasing the CPU load on the system in favour to reducing the wait time. Link: https://lore.kernel.org/r/alpine.DEB.2.21.2306111611170.64925@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit 680e9c47a2293bcc6a67a6f13f3b23d4c456885b Author: Maciej W. Rozycki Date: Sun Jun 11 18:19:53 2023 +0100 PCI: Add support for polling DLLLA to pcie_retrain_link() Let the caller of pcie_retrain_link() specify whether they want to use the LT bit or the DLLLA bit of the Link Status Register to determine if link training has completed. It is up to the caller to verify whether the use of the DLLLA bit, the implementation of which is optional, is valid for the device requested. Link: https://lore.kernel.org/r/alpine.DEB.2.21.2306110310540.64925@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit 37edd87eb621a96d33ee4eefe4b54cfc5a7e03df Author: Maciej W. Rozycki Date: Sun Jun 11 18:19:41 2023 +0100 PCI: Export pcie_retrain_link() for use outside ASPM Export pcie_retrain_link() for link retrain needs outside ASPM. Struct pcie_link_state is local to ASPM and only used by pcie_retrain_link() to get at the associated PCI device, so change the operand and adjust the lone call site accordingly. Document the interface. No functional change at this point. Link: https://lore.kernel.org/r/alpine.DEB.2.21.2306110229010.64925@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit 33a176abcc4cd4ed3d65512ed96d7b73f2565ed7 Author: Maciej W. Rozycki Date: Sun Jun 11 18:19:19 2023 +0100 PCI: Export PCIe link retrain timeout Convert LINK_RETRAIN_TIMEOUT from jiffies to milliseconds, accordingly rename to PCIE_LINK_RETRAIN_TIMEOUT_MS, and make available via "pci.h" for the PCI core to use. Use in pcie_wait_for_link_delay(). Link: https://lore.kernel.org/r/alpine.DEB.2.21.2305310030280.59226@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit 07a8d698de50c4740ac6f709c43e23a6da6e4dbc Author: Maciej W. Rozycki Date: Sun Jun 11 18:19:23 2023 +0100 PCI: Execute quirk_enable_clear_retrain_link() earlier Make quirk_enable_clear_retrain_link() an early quirk so that any later fixups can rely on dev->clear_retrain_link to have been already initialised. [bhelgaas: reorder to just before it becomes possible to call pcie_retrain_link() earlier] Link: https://lore.kernel.org/r/alpine.DEB.2.21.2305310049000.59226@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit 3c0ec896a4b42bc4751c71cac5996d23d3b648ae Author: Maciej W. Rozycki Date: Sun Jun 11 18:19:49 2023 +0100 PCI/ASPM: Factor out waiting for link training to complete Move code polling for the Link Training bit to clear into a function of its own. [bhelgaas: reorder to clean up before exposing to PCI core] Link: https://lore.kernel.org/r/alpine.DEB.2.21.2306111605060.64925@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit fd6e6e38ebe5db99b8eeab0abef8cc930301a677 Author: Maciej W. Rozycki Date: Wed Jun 14 15:09:06 2023 -0500 PCI/ASPM: Avoid unnecessary pcie_link_state use [bhelgaas: extract from expose patch, reorder to clean up before exposing] Link: https://lore.kernel.org/r/alpine.DEB.2.21.2306110229010.64925@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit 6735041fd8460a94ae367830ece8ef65f191227a Author: Yang Li Date: Wed Jun 14 09:43:28 2023 +0800 RDMA/cma: Remove NULL check before dev_{put, hold} The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there is no need to check before using dev_{put, hold}, remove it to silence the warning: ./drivers/infiniband/core/cma.c:4812:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed. Link: https://lore.kernel.org/r/20230614014328.14007-1-yang.lee@linux.alibaba.com Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5521 Signed-off-by: Yang Li Signed-off-by: Jason Gunthorpe commit 350b6dd4b2f876f1aa0d45a422b17b8377517762 Author: Bob Pearson Date: Mon Jun 12 11:22:45 2023 -0500 RDMA/rxe: Simplify cq->notify code The flags parameter to the request notify verb is a bitmask. But, rxe driver treats cq->notify as an int. If someone ever set both the IB_CQ_SOLICITED and the IB_CQ_NEXT_COMP bits rxe_cq_post could fail to generate a completion event. This patch treats the notify flags as a bit mask consistently and can handle the above case correctly. Link: https://lore.kernel.org/r/20230612162244.20038-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 4bfb0c9af832a182a54e549123a634e0070c8d4f Author: Christoph Hellwig Date: Tue Jun 20 13:32:35 2023 +0200 io_uring: add helpers to decode the fixed file file_ptr Remove all the open coded magic on slot->file_ptr by introducing two helpers that return the file pointer and the flags instead. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620113235.920399-9-hch@lst.de Signed-off-by: Jens Axboe commit f432c8c8c12b84c5465b1ffddb6feb7d6b19c1ca Author: Christoph Hellwig Date: Tue Jun 20 13:32:34 2023 +0200 io_uring: use io_file_from_index in io_msg_grab_file Use io_file_from_index instead of open coding it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620113235.920399-8-hch@lst.de Signed-off-by: Jens Axboe commit 60a666f097a8d722a3907925d21e363add289c8c Author: Christoph Hellwig Date: Tue Jun 20 13:32:33 2023 +0200 io_uring: use io_file_from_index in __io_sync_cancel Use io_file_from_index instead of open coding it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620113235.920399-7-hch@lst.de Signed-off-by: Jens Axboe commit 8487f083c6ff6e02b2ec14f22ef2b0079a1b6425 Author: Christoph Hellwig Date: Tue Jun 20 13:32:32 2023 +0200 io_uring: return REQ_F_ flags from io_file_get_flags Two of the three callers want them, so return the more usual format, and shift into the FFS_ form only for the fixed file table. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620113235.920399-6-hch@lst.de Signed-off-by: Jens Axboe commit 3beed235d1a1d0a4ab093ab67ea6b2841e9d4fa2 Author: Christoph Hellwig Date: Tue Jun 20 13:32:31 2023 +0200 io_uring: remove io_req_ffs_set Just checking the flag directly makes it a lot more obvious what is going on here. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620113235.920399-5-hch@lst.de Signed-off-by: Jens Axboe commit b57c7cd1c17616ae9db5614525ba703f384afd05 Author: Christoph Hellwig Date: Tue Jun 20 13:32:30 2023 +0200 io_uring: remove a confusing comment above io_file_get_flags The SCM inflight mechanism has nothing to do with the fact that a file might be a regular file or not and if it supports non-blocking operations. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620113235.920399-4-hch@lst.de Signed-off-by: Jens Axboe commit 53cfd5cea7f36bac7f3d45de4fea77e0c8d57aee Author: Christoph Hellwig Date: Tue Jun 20 13:32:29 2023 +0200 io_uring: remove the mode variable in io_file_get_flags The variable is only once now, so don't bother with it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620113235.920399-3-hch@lst.de Signed-off-by: Jens Axboe commit b9a6c9459a5aec7bfd9b763554d15148367f1806 Author: Christoph Hellwig Date: Tue Jun 20 13:32:28 2023 +0200 io_uring: remove __io_file_supports_nowait Now that this only checks O_NONBLOCK and FMODE_NOWAIT, the helper is complete overkilļ, and the comments are confusing bordering to wrong. Just inline the check into the caller. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620113235.920399-2-hch@lst.de Signed-off-by: Jens Axboe commit 4cea2821882b06cd2c9c896d501f58746c16a90b Author: Stephan Gerhold Date: Wed Jun 14 21:20:43 2023 +0200 of: reserved_mem: Use stable allocation order sort() in Linux is based on heapsort which is not a stable sort algorithm - equal elements are being reordered. For reserved memory in the device tree this happens mainly for dynamic allocations: They do not have an address to sort with, so they are reordered somewhat randomly when adding/removing other unrelated reserved memory nodes. Functionally this is not a big problem, but it's confusing during development when all the addresses change after adding unrelated reserved memory nodes. Make the order stable by sorting dynamic allocations according to the node order in the device tree. Static allocations are not affected by this because they are still sorted by their (fixed) address. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230510-dt-resv-bottom-up-v2-2-aeb2afc8ac25@gerhold.net Signed-off-by: Rob Herring commit 83ba7361e168cd7b24aa95d2aefb4e31e3cc6cd0 Author: Stephan Gerhold Date: Wed Jun 14 21:20:42 2023 +0200 of: reserved_mem: Try to keep range allocations contiguous Right now dynamic reserved memory regions are allocated either bottom-up or top-down, depending on the memblock setting of the architecture. This is fine when the address is arbitrary. However, when using "alloc-ranges" the regions are often placed somewhere in the middle of (free) RAM, even if the range starts or ends next to another (static) reservation. Try to detect this situation, and choose explicitly between bottom-up or top-down to allocate the memory close to the other reservations: 1. If the "alloc-range" starts at the end or inside an existing reservation, use bottom-up. 2. If the "alloc-range" ends at the start or inside an existing reservation, use top-down. 3. If both or none is the case, keep the current (architecture-specific) behavior. There are plenty of edge cases where only a more complex algorithm would help, but even this simple approach helps in many cases to keep the reserved memory (and therefore also the free memory) contiguous. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230510-dt-resv-bottom-up-v2-1-aeb2afc8ac25@gerhold.net Signed-off-by: Rob Herring commit 62149a745eee03194f025021640c80b84353089b Author: Miklos Szeredi Date: Tue Jun 20 10:57:49 2023 +0200 ovl: add Amir as co-maintainer Amir has implemented lots of features in overlayfs and is very active in maintenance. Make this official in the MAINTAINERS file. Signed-off-by: Miklos Szeredi Signed-off-by: Amir Goldstein commit ceecc2d87f007f9fc34e847401282111c0c29786 Author: Christian Brauner Date: Tue Jun 20 13:42:38 2023 +0200 ovl: reserve ability to reconfigure mount options with new mount api Using the old mount api to remount an overlayfs superblock via mount(MS_REMOUNT) all mount options will be silently ignored. For example, if you create an overlayfs mount: mount -t overlay overlay -o lowerdir=/mnt/a:/mnt/b,upperdir=/mnt/upper,workdir=/mnt/work /mnt/merged and then issue a remount via: # force mount(8) to use mount(2) export LIBMOUNT_FORCE_MOUNT2=always mount -t overlay overlay -o remount,WOOTWOOT,lowerdir=/DOESNT-EXIST /mnt/merged with completely nonsensical mount options whatsoever it will succeed nonetheless. This prevents us from every changing any mount options we might introduce in the future that could reasonably be changed during a remount. We don't need to carry this issue into the new mount api port. Similar to FUSE we can use the fs_context::oldapi member to figure out that this is a request coming through the legacy mount api. If we detect it we continue silently ignoring all mount options. But for the new mount api we simply report that mount options cannot currently be changed. This will allow us to potentially alter mount properties for new or even old properties. It any case, silently ignoring everything is not something new apis should do. Signed-off-by: Christian Brauner Signed-off-by: Amir Goldstein commit 58b1294dd1d65bb62f08dddbf418f954210c2057 Author: Tiezhu Yang Date: Sun Apr 23 09:42:26 2023 +0800 riscv: uprobes: Restore thread.bad_cause thread.bad_cause is saved in arch_uprobe_pre_xol(), it should be restored in arch_uprobe_{post,abort}_xol() accordingly, otherwise the save operation is meaningless, this change is similar with x86 and powerpc. Signed-off-by: Tiezhu Yang Acked-by: Oleg Nesterov Reviewed-by: Guo Ren Fixes: 74784081aac8 ("riscv: Add uprobes supported") Link: https://lore.kernel.org/r/1682214146-3756-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Palmer Dabbelt commit 648321fa0d970c04b4327ac1a053abf43d285931 Author: Jisheng Zhang Date: Wed May 24 00:59:42 2023 +0800 riscv: mm: try VMA lock-based page fault handling first Attempt VMA lock-based page fault handling first, and fall back to the existing mmap_lock-based handling if that fails. A simple running the ebizzy benchmark on Lichee Pi 4A shows that PER_VMA_LOCK can improve the ebizzy benchmark by about 32.68%. In theory, the more CPUs, the bigger improvement, but I don't have any HW platform which has more than 4 CPUs. This is the riscv variant of "x86/mm: try VMA lock-based page fault handling first". Signed-off-by: Jisheng Zhang Reviewed-by: Guo Ren Reviewed-by: Suren Baghdasaryan Link: https://lore.kernel.org/r/20230523165942.2630-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 02478c98f2c2da448e2cb3fd95b209a84850e09b Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:54 2023 +0200 dt-bindings: arm: drop unneeded quotes and use absolute /schemas path Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Also absolute path starting with /schemas is preferred. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230609140754.65158-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 7123c05c06aa312fa25bcadf42c7c66b14e9b479 Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:49 2023 +0200 dt-bindings: firmware: arm,scmi: drop unneeded quotes and use absolute /schemas path Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Also absolute path starting with /schemas is preferred. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230609140749.65102-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit e746c79c1881b3c8d5e160f2e3dc1537643e7edb Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:42 2023 +0200 dt-bindings: dvfs: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230609140742.65018-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit a835321b3c2e822f362ee33a79e44667e98c5028 Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:38 2023 +0200 dt-bindings: gpu: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230609140738.64958-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit e099083e7f8f25ae05364b3d8f6e0f1a59fd60c0 Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:35 2023 +0200 dt-bindings: i3c: silvaco,i3c-master: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230609140735.64855-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit ee678e5dffc0b0d63b4a2ec6129063339435bfc5 Author: Bob Pearson Date: Tue Jun 13 12:16:55 2023 -0500 RDMA/rxe: Fixes mr access supported list A recent patch incorrectly did not include IB_ACCESS_RELAXED_ORDERING in the list of supported access flags for the rxe driver. The driver actually does nothing related to relaxed ordering but it causes no problems to include it as supported but with no effect. This change caused ib_send_bw and friends to not run correctly. The correct approach is for the driver to allow any of the optional access flags and otherwise ignore them. This patch adds IB_ACCESS_OPTIONAL to the list of rxe supported flags. Fixes: 02ed253770fb ("RDMA/rxe: Introduce rxe access supported flags") Link: https://lore.kernel.org/r/20230613171654.19334-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 0d36b50ef775c42a6e58fca417d8d8ddc618fcdd Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:02 2023 +0200 dt-bindings: rockchip: grf: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230609140702.64589-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 97cc0337dd744b46600298e1bc001729c3ce1d05 Author: Krzysztof Kozlowski Date: Fri Jun 9 16:06:54 2023 +0200 dt-bindings: spmi: mtk,spmi-mtk-pmif: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230609140655.64529-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit fc4ea4229c2b2dca0bffc12eee6973e353c20086 Author: Alexander Aring Date: Tue Jun 20 10:15:57 2023 -0400 fs: dlm: remove filter local comms on close The current way how lowcomms is configured is due configfs entries. Each comms configfs entry will create a lowcomms connection. Even the local connection itself will be stored as a lowcomms connection, although most functionality for a local lowcomms connection struct is not necessary. Now in some scenarios we will see that dlm_controld reports a -EEXIST when configure a node via configfs: ... /sys/kernel/config/dlm/cluster/comms/1/addr: write failed: 17 -1 Doing a: cat /sys/kernel/config/dlm/cluster/comms/1/addr_list reported nothing. This was being seen on cluster with nodeid 1 and it's local configuration. To be sure the configfs entries are in sync with lowcomms connection structures we always call dlm_midcomms_close() to be sure the lowcomms connection gets removed when the configfs entry gets dropped. Before commit 07ee38674a0b ("fs: dlm: filter ourself midcomms calls") it was just doing this by accident and the filter by doing: if (nodeid == dlm_our_nodeid()) return 0; inside dlm_midcomms_close() was never been hit because drop_comm() sets local_comm to NULL and cause that dlm_our_nodeid() returns always the invalid nodeid 0. Fixes: 07ee38674a0b ("fs: dlm: filter ourself midcomms calls") Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 0a08778126284481c300336f1ba3d7b1906851a5 Author: Colin Ian King Date: Tue Jun 20 10:56:20 2023 +0100 ASoC: tas2781: Fix spelling mistake "calibraiton" -> "calibration" There is a spelling mistake in a dev_err message. Fix it. Also fix grammar and add space between last word and (%d)". Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20230620095620.2522058-1-colin.i.king@gmail.com Signed-off-by: Mark Brown commit d4b2aee1be41adbbbe9132104620dfc70032a044 Merge: 29735f6fb0f57 c317d148a2b02 Author: Mark Brown Date: Tue Jun 20 15:24:06 2023 +0100 ASoC: qcom: audioreach: add compress offload Merge series from Srinivas Kandagatla : This patchset adds compressed offload support to Qualcomm audioreach drivers. Currently it supports AAC, MP3 and FALC along with gapless. Tested this on SM8450 and sc7280. commit 29735f6fb0f57c8010c9486216361c0f68c90226 Merge: 246c9f586c7c8 9321015a5f408 Author: Mark Brown Date: Tue Jun 20 15:23:56 2023 +0100 ASoC: Use maple tree register cache for Everest Semi Merge series from Mark Brown : Several of the Everest Semi CODECs only support single register read and write operations and therefore do not benefit from using the rbtree cache over the maple tree cache, convert them to the more modern maple tree cache. commit 246c9f586c7c840b88efc874c949706d3f7df30c Merge: 6f80197f40515 eefc27ea14ad6 Author: Mark Brown Date: Tue Jun 20 15:23:47 2023 +0100 ASoC: Convert Realtek I2C drivers to use maple tree Merge series from Mark Brown : Many of the Realtek I2C/SPI devices only support single register read and write operations so don't benefit from using the rbtree cache instead of the more modern maple tree cache, convert them to maple tree. commit 99f2d956e1fa3ead355cde4fd1a914e54cfe0a40 Author: Ivan Orlov Date: Tue Jun 20 11:44:17 2023 +0200 USB: gadget: f_hid: make hidg_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the hidg_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620094412.508580-11-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 2c10e7a049dad73503da41c7754add91cb7b35d9 Author: Ivan Orlov Date: Tue Jun 20 11:44:16 2023 +0200 USB: gadget: f_printer: make usb_gadget_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the usb_gadget_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620094412.508580-10-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit e571e843f0ce005503471707fa02e892ba2a6f35 Author: Ivan Orlov Date: Tue Jun 20 11:44:15 2023 +0200 USB: mon: make mon_bin_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the mon_bin_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620094412.508580-9-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 8e99143649ad4838d58aeac9da43a5726b841366 Author: Ivan Orlov Date: Tue Jun 20 11:44:14 2023 +0200 USB: gadget: udc: core: make udc_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the udc_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620094412.508580-8-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 044a61158b9e00ee4b69bc4fa0f3e720b5dd669a Author: Ivan Orlov Date: Tue Jun 20 11:44:13 2023 +0200 USB: roles: make role_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the role_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at load time. Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230620094412.508580-7-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 34d401a1910dde53356fa5ac03649085fd20e5e3 Author: Piyush Mehta Date: Mon Jun 19 16:20:32 2023 +0530 dt-bindings: usb: dwc3: Add interrupt-names property support for wakeup interrupt The hibernation feature enabled for Xilinx Versal NET SoC in DWC3 IP. As the DWC3 IP supports the hibernation feature, to handle the wakeup or hibernation interrupt, add host mode "wakeup" interrupt-names optional property in the binding schema to capture remote-wakeup and connect/ disconnect event in the hibernation state and increased maxItems to 4 for the interrupts and interrupt-names property. We have a dedicated IRQ line specifically for the hibernation feature. When the "wakeup" IRQ line is triggered, it initiates a hibernation interrupt, causing the system to wake up from the hibernation state. Signed-off-by: Piyush Mehta Acked-by: Conor Dooley Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230619105032.2888128-1-piyush.mehta@amd.com Signed-off-by: Greg Kroah-Hartman commit 32db98b92c8a204dcf3e178a1368f8320589c56e Author: Michael Straube Date: Mon Jun 19 17:52:03 2023 +0200 staging: rtl8192e: remove 5G related code In previous patches we removed 5G code since the hardware that uses this driver does not support 5G. There is still some 5G related code, remove it. All the removed defines are unused and we can safely remove "N-5G" from the rtllib_modes array. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230619155203.6039-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 910b5ee9b33a1acf91a6e4bbcc7861a19fb9603c Author: Michael Straube Date: Mon Jun 19 17:09:53 2023 +0200 staging: rtl8192e: remove comparison to true Remove a comparison to true reported by checkpatch. CHECK: Using comparison to true is error prone Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230619150953.22484-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d9902ac3a7cd3008057e8e4cde2688fcddecd68b Author: Michael Straube Date: Mon Jun 19 17:09:52 2023 +0200 staging: rtl8192e: remove return statement from void function Remove unnecessary return statement from the void function rtl92e_config_mac(). Issue found by checkpatch. WARNING: void function return statements are not generally useful Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230619150953.22484-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 18b89d19238242147c3d00134329bb39b4ed33d1 Author: Michael Straube Date: Mon Jun 19 17:09:51 2023 +0200 staging: rtl8192e: convert else if sequence to switch Convert a sequence of else if statements that all check the same variable to a single switch statement. With a switch statement it is easier to see what is going on. Additionally this clears a checkpatch warning. WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230619150953.22484-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 56424246bbdcc358c3de3906a2a45fa37a559bb0 Author: Michael Straube Date: Mon Jun 19 17:09:50 2023 +0200 staging: rtl8192e: clean up brace coding style issues Clean up brace coding style in if/else statements to improve readability and clear checkpatch issues. CHECK: braces {} should be used on all arms of this statement CHECK: Unbalanced braces around else statement Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230619150953.22484-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 13904f991b3ab5a48342693e29a6b58fa8f20675 Author: Franziska Naepelt Date: Mon Jun 19 20:12:46 2023 +0200 staging: rtl8723bs: Fix blank line issues Fix the following checkpatch blank line issues: - CHECK: Please don't use multiple blank lines - CHECK: Blank lines aren't necessary before a close brace '}' - CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: Franziska Naepelt Link: https://lore.kernel.org/r/20230619181246.19112-1-franziska.naepelt@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3b6401444b7b4e8aec0e1c3e069d24fd4baf3586 Author: Franziska Naepelt Date: Mon Jun 19 20:12:30 2023 +0200 staging: rtl8723bs: Fix block comment issue Fix the following checkpatch block comment issue: - WARNING: Block comments use * on subsequent lines Signed-off-by: Franziska Naepelt Link: https://lore.kernel.org/r/20230619181230.19070-1-franziska.naepelt@gmail.com Signed-off-by: Greg Kroah-Hartman commit b59cba2309b16fa364df03e3693b8d45c3fadbd6 Author: Franziska Naepelt Date: Mon Jun 19 20:03:51 2023 +0200 staging: rtl8723bs: Fix indentation issues Fix the following checkpatch indentation issues: - WARNING: suspect code indent for conditional statements (32, 48) - WARNING: suspect code indent for conditional statements (24, 24) - ERROR: code indent should use tabs where possible Signed-off-by: Franziska Naepelt Link: https://lore.kernel.org/r/20230619180351.18925-1-franziska.naepelt@gmail.com Signed-off-by: Greg Kroah-Hartman commit 73bacecfb7dcd064814ee044ec3f1f3d8632bd6a Author: Umang Jain Date: Wed Dec 21 13:10:47 2022 +0530 staging: vchiq_arm: Remove extra struct vchiq_instance declaration Additional declaration of struct vchiq_instance was introduced in the commit 726e79f8a648 ("staging: vchiq_arm: pass vchiq instance to service callbacks"). Drop the extra declaration. Fixes: 726e79f8a648 ("staging: vchiq_arm: pass vchiq instance to service callbacks") Signed-off-by: Umang Jain Reviewed-by: Stefan Wahren Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20221221074047.233473-1-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit c576c4bf9ecfa3fb9f7b11681cc2f60aba5276c4 Author: Yu Kuai Date: Tue Jun 20 19:13:22 2023 +0800 reiserfs: fix blkdev_put() warning from release_journal_dev() In journal_init_dev(), if super bdev is used as 'j_dev_bd', then blkdev_get_by_dev() is called with NULL holder, otherwise, holder will be journal. However, later in release_journal_dev(), blkdev_put() is called with journal unconditionally, cause following warning: WARNING: CPU: 1 PID: 5034 at block/bdev.c:617 bd_end_claim block/bdev.c:617 [inline] WARNING: CPU: 1 PID: 5034 at block/bdev.c:617 blkdev_put+0x562/0x8a0 block/bdev.c:901 RIP: 0010:blkdev_put+0x562/0x8a0 block/bdev.c:901 Call Trace: release_journal_dev fs/reiserfs/journal.c:2592 [inline] free_journal_ram+0x421/0x5c0 fs/reiserfs/journal.c:1896 do_journal_release fs/reiserfs/journal.c:1960 [inline] journal_release+0x276/0x630 fs/reiserfs/journal.c:1971 reiserfs_put_super+0xe4/0x5c0 fs/reiserfs/super.c:616 generic_shutdown_super+0x158/0x480 fs/super.c:499 kill_block_super+0x64/0xb0 fs/super.c:1422 deactivate_locked_super+0x98/0x160 fs/super.c:330 deactivate_super+0xb1/0xd0 fs/super.c:361 cleanup_mnt+0x2ae/0x3d0 fs/namespace.c:1247 task_work_run+0x16f/0x270 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xadc/0x2a30 kernel/exit.c:874 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 __do_sys_exit_group kernel/exit.c:1035 [inline] __se_sys_exit_group kernel/exit.c:1033 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1033 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fix this problem by passing in NULL holder in this case. Reported-by: syzbot+04625c80899f4555de39@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=04625c80899f4555de39 Fixes: 2736e8eeb0cc ("block: use the holder as indication for exclusive opens") Signed-off-by: Yu Kuai Reviewed-by: Christian Brauner Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620111322.1014775-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 985958b8584cc143555f1bd735e7ab5066c944a7 Author: Yu Kuai Date: Sun Jun 18 22:04:02 2023 +0800 block: fix wrong mode for blkdev_get_by_dev() from disk_scan_partitions() After commit 2736e8eeb0cc ("block: use the holder as indication for exclusive opens"), blkdev_get_by_dev() will warn if holder is NULL and mode contains 'FMODE_EXCL'. holder from blkdev_get_by_dev() from disk_scan_partitions() is always NULL, hence it should not use 'FMODE_EXCL', which is broben by the commit. For consequence, WARN_ON_ONCE() will be triggered from blkdev_get_by_dev() if user scan partitions with device opened exclusively. Fix this problem by removing 'FMODE_EXCL' from disk_scan_partitions(), as it used to be. Reported-by: syzbot+00cd27751f78817f167b@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=00cd27751f78817f167b Fixes: 2736e8eeb0cc ("block: use the holder as indication for exclusive opens") Signed-off-by: Yu Kuai Reviewed-by: Christian Brauner Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230618140402.7556-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit e89e001f24bf7bc558d9ebccb97fd559443021da Author: Christoph Hellwig Date: Tue Jun 20 06:35:36 2023 +0200 block: document the holder argument to blkdev_get_by_path Reported-by: Stephen Rothwell Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620043536.707249-1-hch@lst.de Signed-off-by: Jens Axboe commit b90ecc0379eb7bbe79337b0c7289390a98752646 Author: Demi Marie Obenour Date: Wed Jun 7 13:08:37 2023 -0400 block: increment diskseq on all media change events Currently, associating a loop device with a different file descriptor does not increment its diskseq. This allows the following race condition: 1. Program X opens a loop device 2. Program X gets the diskseq of the loop device. 3. Program X associates a file with the loop device. 4. Program X passes the loop device major, minor, and diskseq to something. 5. Program X exits. 6. Program Y detaches the file from the loop device. 7. Program Y attaches a different file to the loop device. 8. The opener finally gets around to opening the loop device and checks that the diskseq is what it expects it to be. Even though the diskseq is the expected value, the result is that the opener is accessing the wrong file. From discussions with Christoph Hellwig, it appears that disk_force_media_change() was supposed to call inc_diskseq(), but in fact it does not. Adding a Fixes: tag to indicate this. Christoph's Reported-by is because he stated that disk_force_media_change() calls inc_diskseq(), which is what led me to discover that it should but does not. Reported-by: Christoph Hellwig Signed-off-by: Demi Marie Obenour Fixes: e6138dc12de9 ("block: add a helper to raise a media changed event") Cc: stable@vger.kernel.org # 5.15+ Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230607170837.1559-1-demi@invisiblethingslab.com Signed-off-by: Jens Axboe commit 9a7933f3aca9d3b77235953996126f0e87c1d496 Author: Christoph Hellwig Date: Tue Jun 20 06:30:51 2023 +0200 swim: fix a missing FMODE_ -> BLK_OPEN_ conversion in floppy_open Fix a missing conversion to the new BLK_OPEN constant in swim. Fixes: 05bdb9965305 ("block: replace fmode_t with a block-specific type for block open flags") Reported-by: kernel test robot Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230620043051.707196-1-hch@lst.de Signed-off-by: Jens Axboe commit 45e34c8af58f23db4474e2bfe79183efec09a18b Author: Thomas Gleixner Date: Thu Jun 15 22:34:00 2023 +0200 x86/smp: Put CPUs into INIT on shutdown if possible Parking CPUs in a HLT loop is not completely safe vs. kexec() as HLT can resume execution due to NMI, SMI and MCE, which has the same issue as the MWAIT loop. Kicking the secondary CPUs into INIT makes this safe against NMI and SMI. A broadcast MCE will take the machine down, but a broadcast MCE which makes HLT resume and execute overwritten text, pagetables or data will end up in a disaster too. So chose the lesser of two evils and kick the secondary CPUs into INIT unless the system has installed special wakeup mechanisms which are not using INIT. Signed-off-by: Thomas Gleixner Reviewed-by: Ashok Raj Reviewed-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230615193330.608657211@linutronix.de commit 327ca228e58be498446244eb7cf39b892adda5d7 Author: Claudiu Beznea Date: Fri Jun 16 13:16:43 2023 +0300 ARM: dts: at91: use generic name for shutdown controller Use poweroff generic name for shdwc node to cope with device tree specifications. Signed-off-by: Claudiu Beznea Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20230616101646.879480-2-claudiu.beznea@microchip.com commit 6087dd5e86ff03a8cd4cffdf463a7f457e65cbff Author: Thomas Gleixner Date: Thu Jun 15 22:33:58 2023 +0200 x86/smp: Split sending INIT IPI out into a helper function Putting CPUs into INIT is a safer place during kexec() to park CPUs. Split the INIT assert/deassert sequence out so it can be reused. Signed-off-by: Thomas Gleixner Reviewed-by: Ashok Raj Link: https://lore.kernel.org/r/20230615193330.551157083@linutronix.de commit d7893093a7417527c0d73c9832244e65c9d0114f Author: Thomas Gleixner Date: Thu Jun 15 22:33:57 2023 +0200 x86/smp: Cure kexec() vs. mwait_play_dead() breakage TLDR: It's a mess. When kexec() is executed on a system with offline CPUs, which are parked in mwait_play_dead() it can end up in a triple fault during the bootup of the kexec kernel or cause hard to diagnose data corruption. The reason is that kexec() eventually overwrites the previous kernel's text, page tables, data and stack. If it writes to the cache line which is monitored by a previously offlined CPU, MWAIT resumes execution and ends up executing the wrong text, dereferencing overwritten page tables or corrupting the kexec kernels data. Cure this by bringing the offlined CPUs out of MWAIT into HLT. Write to the monitored cache line of each offline CPU, which makes MWAIT resume execution. The written control word tells the offlined CPUs to issue HLT, which does not have the MWAIT problem. That does not help, if a stray NMI, MCE or SMI hits the offlined CPUs as those make it come out of HLT. A follow up change will put them into INIT, which protects at least against NMI and SMI. Fixes: ea53069231f9 ("x86, hotplug: Use mwait to offline a processor, fix the legacy case") Reported-by: Ashok Raj Signed-off-by: Thomas Gleixner Tested-by: Ashok Raj Reviewed-by: Ashok Raj Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230615193330.492257119@linutronix.de commit f9c9987bf52f4e42e940ae217333ebb5a4c3b506 Author: Thomas Gleixner Date: Thu Jun 15 22:33:55 2023 +0200 x86/smp: Use dedicated cache-line for mwait_play_dead() Monitoring idletask::thread_info::flags in mwait_play_dead() has been an obvious choice as all what is needed is a cache line which is not written by other CPUs. But there is a use case where a "dead" CPU needs to be brought out of MWAIT: kexec(). This is required as kexec() can overwrite text, pagetables, stacks and the monitored cacheline of the original kernel. The latter causes MWAIT to resume execution which obviously causes havoc on the kexec kernel which results usually in triple faults. Use a dedicated per CPU storage to prepare for that. Signed-off-by: Thomas Gleixner Reviewed-by: Ashok Raj Reviewed-by: Borislav Petkov (AMD) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230615193330.434553750@linutronix.de commit 2affa6d6db28855e6340b060b809c23477aa546e Author: Thomas Gleixner Date: Thu Jun 15 22:33:54 2023 +0200 x86/smp: Remove pointless wmb()s from native_stop_other_cpus() The wmb()s before sending the IPIs are not synchronizing anything. If at all then the apic IPI functions have to provide or act as appropriate barriers. Remove these cargo cult barriers which have no explanation of what they are synchronizing. Signed-off-by: Thomas Gleixner Reviewed-by: Borislav Petkov (AMD) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230615193330.378358382@linutronix.de commit 9b040453d4440659f33dc6f0aa26af418ebfe70b Author: Tony Battersby Date: Thu Jun 15 22:33:52 2023 +0200 x86/smp: Dont access non-existing CPUID leaf stop_this_cpu() tests CPUID leaf 0x8000001f::EAX unconditionally. Intel CPUs return the content of the highest supported leaf when a non-existing leaf is read, while AMD CPUs return all zeros for unsupported leafs. So the result of the test on Intel CPUs is lottery. While harmless it's incorrect and causes the conditional wbinvd() to be issued where not required. Check whether the leaf is supported before reading it. [ tglx: Adjusted changelog ] Fixes: 08f253ec3767 ("x86/cpu: Clear SME feature flag when not in use") Signed-off-by: Tony Battersby Signed-off-by: Thomas Gleixner Reviewed-by: Mario Limonciello Reviewed-by: Borislav Petkov (AMD) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/3817d810-e0f1-8ef8-0bbd-663b919ca49b@cybernetics.com Link: https://lore.kernel.org/r/20230615193330.322186388@linutronix.de commit 1f5e7eb7868e42227ac426c96d437117e6e06e8e Author: Thomas Gleixner Date: Wed Apr 26 18:37:00 2023 +0200 x86/smp: Make stop_other_cpus() more robust Tony reported intermittent lockups on poweroff. His analysis identified the wbinvd() in stop_this_cpu() as the culprit. This was added to ensure that on SME enabled machines a kexec() does not leave any stale data in the caches when switching from encrypted to non-encrypted mode or vice versa. That wbinvd() is conditional on the SME feature bit which is read directly from CPUID. But that readout does not check whether the CPUID leaf is available or not. If it's not available the CPU will return the value of the highest supported leaf instead. Depending on the content the "SME" bit might be set or not. That's incorrect but harmless. Making the CPUID readout conditional makes the observed hangs go away, but it does not fix the underlying problem: CPU0 CPU1 stop_other_cpus() send_IPIs(REBOOT); stop_this_cpu() while (num_online_cpus() > 1); set_online(false); proceed... -> hang wbinvd() WBINVD is an expensive operation and if multiple CPUs issue it at the same time the resulting delays are even larger. But CPU0 already observed num_online_cpus() going down to 1 and proceeds which causes the system to hang. This issue exists independent of WBINVD, but the delays caused by WBINVD make it more prominent. Make this more robust by adding a cpumask which is initialized to the online CPU mask before sending the IPIs and CPUs clear their bit in stop_this_cpu() after the WBINVD completed. Check for that cpumask to become empty in stop_other_cpus() instead of watching num_online_cpus(). The cpumask cannot plug all holes either, but it's better than a raw counter and allows to restrict the NMI fallback IPI to be sent only the CPUs which have not reported within the timeout window. Fixes: 08f253ec3767 ("x86/cpu: Clear SME feature flag when not in use") Reported-by: Tony Battersby Signed-off-by: Thomas Gleixner Reviewed-by: Borislav Petkov (AMD) Reviewed-by: Ashok Raj Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/3817d810-e0f1-8ef8-0bbd-663b919ca49b@cybernetics.com Link: https://lore.kernel.org/r/87h6r770bv.ffs@tglx commit ae4423d596dbc641747e7c4c552792474c6e1c2a Author: Yu Zhao Date: Sat Jun 17 12:53:35 2023 -0600 kvm/mips: update MAINTAINERS Aleksandar Markovic was last seen in Oct 2020 [1] and cannot be reached for multiple days because of "Recipient inbox full". [1] https://lore.kernel.org/all/1602103041-32017-4-git-send-email-aleksandar.qemu.devel@gmail.com/ Signed-off-by: Yu Zhao Acked-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit f7396eefd6204f790a5d71cbc89701c9da780a05 Author: Uwe Kleine-König Date: Fri Jun 16 18:51:27 2023 +0200 MIPS: PCI: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. While destroying alignment of the assignments in bridge_driver, do it consistently and use a single space before =. Signed-off-by: Uwe Kleine-König Signed-off-by: Thomas Bogendoerfer commit 1caeb99ba832459e8c1c6db281f9c548fcec079e Author: Sui Jingfeng Date: Sun Jun 11 13:59:03 2023 +0800 MIPS: Loongson64: loongson3_defconfig: Enable amdgpu drm driver As it's usuable on LS3A4000 platform. Tested with RX550, glmark2 got about 4235 score. Signed-off-by: Sui Jingfeng Signed-off-by: Thomas Bogendoerfer commit 6e6251317c962b7c15ad2d8591f3103990c80701 Author: Nathan Chancellor Date: Thu Jun 15 09:21:18 2023 -0700 MIPS: Mark core_vpe_count() as __init After commit 96cb8ae28c65 ("MIPS: Rework smt cmdline parameters"), modpost complains when building with clang: WARNING: modpost: vmlinux.o: section mismatch in reference: core_vpe_count (section: .text) -> smp_max_threads (section: .init.data) This warning occurs when core_vpe_count() is not inlined, as it appears that a non-init function is referring to an init symbol. However, this is not a problem in practice because core_vpe_count() is only called from __init functions, cps_smp_setup() and cps_prepare_cpus(). Resolve the warning by marking core_vpe_count() as __init, as it is only called in an init context so it can refer to init functions and symbols and have its memory freed on boot. Fixes: 96cb8ae28c65 ("MIPS: Rework smt cmdline parameters") Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Thomas Bogendoerfer commit 13e6b8122d448b07d16a3d9c0d0ab41d00a3f284 Author: Thomas Bogendoerfer Date: Thu Jun 15 11:39:33 2023 +0200 MIPS: mm: Remove special handling for OCTEON CPUs Macro cpu_has_mips_r2_exec_hazard correctly handles OCTEON CPUs, so we don't need the extra switch cases for them. Signed-off-by: Thomas Bogendoerfer commit 040ec6202bb89d51e2d8d4c848d8160c0e5e3fe8 Author: Aneesh Kumar K.V Date: Fri Jun 16 16:38:11 2023 +0530 powerpc/mm/book3s64: Use pmdp_ptep helper instead of typecasting. No functional change in this patch. Signed-off-by: Aneesh Kumar K.V Tested-by: Sachin Sant > Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616110826.344417-2-aneesh.kumar@linux.ibm.com commit 0baa2c3abc525c79c21ce64a1722f4034d042ac9 Author: Kuninori Morimoto Date: Tue Jun 20 02:14:51 2023 +0000 ASoC: simple-card.c: use snd_soc_{of_}get_dlc() Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name for dlc (snd_soc_dai_link_component). But we now can use snd_soc_{of_}get_dlc() for it. Let's use it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87fs6mdgmc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 14c9b25f632b561be33af99942833a618811ac3d Author: Kuninori Morimoto Date: Tue Jun 20 02:14:46 2023 +0000 ASoC: soc-core.c: use snd_soc_{of_}get_dlc() Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name for dlc (snd_soc_dai_link_component). But we now can use snd_soc_{of_}get_dlc() for it. Let's use it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87h6r2dgmi.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit db588ea1a352df9673464b1bc6d4acb83f5e8256 Author: Kuninori Morimoto Date: Tue Jun 20 02:14:40 2023 +0000 ASoC: loongson: use snd_soc_{of_}get_dlc() Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name for dlc (snd_soc_dai_link_component). But we now can use snd_soc_{of_}get_dlc() for it. Let's use it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87ilbidgmn.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 50233f28f9a2c06140a7bf539ef569ba1ad58ff6 Author: Kuninori Morimoto Date: Tue Jun 20 02:14:35 2023 +0000 ASoC: samsung: use snd_soc_{of_}get_dlc() Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name for dlc (snd_soc_dai_link_component). But we now can use snd_soc_{of_}get_dlc() for it. Let's use it. - note: need deep check Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87jzvydgms.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 2e1dbea1f8a3584399ff15b1f1773dbbb1f0d10f Author: Kuninori Morimoto Date: Tue Jun 20 02:14:30 2023 +0000 ASoC: meson: use snd_soc_{of_}get_dlc() Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name for dlc (snd_soc_dai_link_component). But we now can use snd_soc_{of_}get_dlc() for it. Let's use it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87legedgmy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 6cf881b7f1608fd5625d916380ed57d45c2879e9 Author: Kuninori Morimoto Date: Tue Jun 20 02:14:24 2023 +0000 ASoC: qcom: use snd_soc_{of_}get_dlc() Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name for dlc (snd_soc_dai_link_component). But we now can use snd_soc_{of_}get_dlc() for it. Let's use it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87mt0udgn3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit aa560f5e796ce63074942251197c7161db2392d3 Author: Kuninori Morimoto Date: Tue Jun 20 02:14:18 2023 +0000 ASoC: fsl: use snd_soc_{of_}get_dlc() Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name for dlc (snd_soc_dai_link_component). But we now can use snd_soc_{of_}get_dlc() for it. Let's use it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87o7ladgn9.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 3c8b5861850c734add65233e538d4a8c2dff95d9 Author: Kuninori Morimoto Date: Tue Jun 20 02:14:11 2023 +0000 ASoC: soc-core.c: add index on snd_soc_of_get_dai_name() Current snd_soc_of_get_dai_name() doesn't accept index for #sound-dai-cells. It is not useful for user. This patch adds it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87pm5qdgng.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 05722a0ce6fbd1c603ec0f0ecb5ed839dd561ac7 Author: Kuninori Morimoto Date: Tue Jun 20 02:14:06 2023 +0000 ASoC: soc-core.c: add snd_soc_{of_}get_dlc() Current soc-core.c has snd_soc_{of_}get_dai_name() to get DAI name for dlc (snd_soc_dai_link_component). It gets .dai_name, but we need .of_node too. Therefor user need to arrange. It will be more useful if it gets both .dai_name and .of_node. This patch adds snd_soc_{of_}get_dlc() for it, and existing functions uses it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r0q6dgnm.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit d7439fb1f4338fffd0bc68bb62d78f7712725f26 Author: Jan Kara Date: Tue Jun 20 13:28:32 2023 +0200 fs: Provide helpers for manipulating sb->s_readonly_remount Provide helpers to set and clear sb->s_readonly_remount including appropriate memory barriers. Also use this opportunity to document what the barriers pair with and why they are needed. Suggested-by: Dave Chinner Signed-off-by: Jan Kara Reviewed-by: Dave Chinner Message-Id: <20230620112832.5158-1-jack@suse.cz> Signed-off-by: Christian Brauner commit c467c8f081859d4f4ca4eee4fba54bb5d85d6c97 Author: Marek Vasut Date: Tue Jun 20 12:27:13 2023 +0200 mmc: Add MMC_QUIRK_BROKEN_SD_CACHE for Kingston Canvas Go Plus from 11/2019 This microSD card never clears Flush Cache bit after cache flush has been started in sd_flush_cache(). This leads e.g. to failure to mount file system. Add a quirk which disables the SD cache for this specific card from specific manufacturing date of 11/2019, since on newer dated cards from 05/2023 the cache flush works correctly. Fixes: 08ebf903af57 ("mmc: core: Fixup support for writeback-cache for eMMC and SD") Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230620102713.7701-1-marex@denx.de Signed-off-by: Ulf Hansson commit b36a5780cb44a16d4384639740d87e08d4cee627 Author: Christian Brauner Date: Fri Jun 16 16:54:19 2023 +0300 ovl: modify layer parameter parsing We ran into issues where mount(8) passed multiple lower layers as one big string through fsconfig(). But the fsconfig() FSCONFIG_SET_STRING option is limited to 256 bytes in strndup_user(). While this would be fixable by extending the fsconfig() buffer I'd rather encourage users to append layers via multiple fsconfig() calls as the interface allows nicely for this. This has also been requested as a feature before. With this port to the new mount api the following will be possible: fsconfig(fs_fd, FSCONFIG_SET_STRING, "lowerdir", "/lower1", 0); /* set upper layer */ fsconfig(fs_fd, FSCONFIG_SET_STRING, "upperdir", "/upper", 0); /* append "/lower2", "/lower3", and "/lower4" */ fsconfig(fs_fd, FSCONFIG_SET_STRING, "lowerdir", ":/lower2:/lower3:/lower4", 0); /* turn index feature on */ fsconfig(fs_fd, FSCONFIG_SET_STRING, "index", "on", 0); /* append "/lower5" */ fsconfig(fs_fd, FSCONFIG_SET_STRING, "lowerdir", ":/lower5", 0); Specifying ':' would have been rejected so this isn't a regression. And we can't simply use "lowerdir=/lower" to append on top of existing layers as "lowerdir=/lower,lowerdir=/other-lower" would make "/other-lower" the only lower layer so we'd break uapi if we changed this. So the ':' prefix seems a good compromise. Users can choose to specify multiple layers at once or individual layers. A layer is appended if it starts with ":". This requires that the user has already added at least one layer before. If lowerdir is specified again without a leading ":" then all previous layers are dropped and replaced with the new layers. If lowerdir is specified and empty than all layers are simply dropped. An additional change is that overlayfs will now parse and resolve layers right when they are specified in fsconfig() instead of deferring until super block creation. This allows users to receive early errors. It also allows users to actually use up to 500 layers something which was theoretically possible but ended up not working due to the mount option string passed via mount(2) being too large. This also allows a more privileged process to set config options for a lesser privileged process as the creds for fsconfig() and the creds for fsopen() can differ. We could restrict that they match by enforcing that the creds of fsopen() and fsconfig() match but I don't see why that needs to be the case and allows for a good delegation mechanism. Plus, in the future it means we're able to extend overlayfs mount options and allow users to specify layers via file descriptors instead of paths: fsconfig(FSCONFIG_SET_PATH{_EMPTY}, "lowerdir", "lower1", dirfd); /* append */ fsconfig(FSCONFIG_SET_PATH{_EMPTY}, "lowerdir", "lower2", dirfd); /* append */ fsconfig(FSCONFIG_SET_PATH{_EMPTY}, "lowerdir", "lower3", dirfd); /* clear all layers specified until now */ fsconfig(FSCONFIG_SET_STRING, "lowerdir", NULL, 0); This would be especially nice if users create an overlayfs mount on top of idmapped layers or just in general private mounts created via open_tree(OPEN_TREE_CLONE). Those mounts would then never have to appear anywhere in the filesystem. But for now just do the minimal thing. We should probably aim to move more validation into ovl_fs_parse_param() so users get errors before fsconfig(FSCONFIG_CMD_CREATE). But that can be done in additional patches later. This is now also rebased on top of the lazy lowerdata lookup which allows the specificatin of data only layers using the new "::" syntax. The rules are simple. A data only layers cannot be followed by any regular layers and data layers must be preceeded by at least one regular layer. Parsing the lowerdir mount option must change because of this. The original patchset used the old lowerdir parsing function to split a lowerdir mount option string such as: lowerdir=/lower1:/lower2::/lower3::/lower4 simply replacing each non-escaped ":" by "\0". So sequences of non-escaped ":" were counted as layers. For example, the previous lowerdir mount option above would've counted 6 layers instead of 4 and a lowerdir mount option such as: lowerdir="/lower1:/lower2::/lower3::/lower4:::::::::::::::::::::::::::" would be counted as 33 layers. Other than being ugly this didn't matter much because kern_path() would reject the first "\0" layer. However, this overcounting of layers becomes problematic when we base allocations on it where we very much only want to allocate space for 4 layers instead of 33. So the new parsing function rejects non-escaped sequences of colons other than ":" and "::" immediately instead of relying on kern_path(). Link: https://github.com/util-linux/util-linux/issues/2287 Link: https://github.com/util-linux/util-linux/issues/1992 Link: https://bugs.archlinux.org/task/78702 Link: https://lore.kernel.org/linux-unionfs/20230530-klagen-zudem-32c0908c2108@brauner Signed-off-by: Christian Brauner Signed-off-by: Amir Goldstein commit d2a7bd3690990ab8a8239096ee432ad51985d5b6 Author: Xi Pardee Date: Tue Jun 13 15:53:47 2023 -0700 platform/x86:intel/pmc: Add Meteor Lake IOE-M PMC related maps Add device ID and register maps for the PMC in IO expansion die M in Meteor Lake. Signed-off-by: Xi Pardee Signed-off-by: Rajvi Jingar Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230613225347.2720665-9-rajvi.jingar@linux.intel.com Signed-off-by: Hans de Goede commit 9f17728d96483dad1cbb3de2a4adcf59d1a04b37 Author: Xi Pardee Date: Tue Jun 13 15:53:46 2023 -0700 platform/x86:intel/pmc: Add Meteor Lake IOE-P PMC related maps Add device ID and register maps for the PMC in IO expansion die P in Meteor Lake. Signed-off-by: Xi Pardee Signed-off-by: Rajvi Jingar Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230613225347.2720665-8-rajvi.jingar@linux.intel.com Signed-off-by: Hans de Goede commit 23e74e3ca6b56d12c14c7369d940187713c85d43 Author: Xi Pardee Date: Tue Jun 13 15:53:45 2023 -0700 platform/x86:intel/pmc: Use SSRAM to discover pwrm base address of primary PMC On older platforms, the base address for PMC was hardcoded in the driver. Newer platforms can now retrieve the base address from SSRAM. Use SSRAM to discover pwrm base address on Meteor Lake platform. If this method fails, it will fall back to the hardcoded value. Signed-off-by: Xi Pardee Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230613225347.2720665-7-rajvi.jingar@linux.intel.com Signed-off-by: Hans de Goede commit 1b8c7b843c0043dd1b81e162e5b5fbed4b256896 Author: David E. Box Date: Tue Jun 13 15:53:44 2023 -0700 platform/x86:intel/pmc: Discover PMC devices On platforms with multiple PMCs, additional PMC devices are discovered in the SSRAM device associated with the primary PMC. Add support for discovering PMC devices from SSRAM. Use PMC devid to assign the corresponding register map. Signed-off-by: Xi Pardee Signed-off-by: David E. Box Signed-off-by: Rajvi Jingar Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230613225347.2720665-6-rajvi.jingar@linux.intel.com Signed-off-by: Hans de Goede commit 2bcef4529222424559ac9b45948ee9d82c09d9b5 Author: Xi Pardee Date: Tue Jun 13 15:53:43 2023 -0700 platform/x86:intel/pmc: Enable debugfs multiple PMC support Enable debugfs support for multiple PMC. These debugfs attributes show information for all enabled PMCs. pch_ip_power_gating_status substate_status_registers substate_live_status_registers ltr_show ltr_ignore Signed-off-by: Xi Pardee Signed-off-by: Rajvi Jingar Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230613225347.2720665-5-rajvi.jingar@linux.intel.com Signed-off-by: Hans de Goede commit 1c709ae12dad6f7e2dd5becfbac0f5141c2e15fd Author: Xi Pardee Date: Tue Jun 13 15:53:42 2023 -0700 platform/x86:intel/pmc: Add support to handle multiple PMCs To support platforms with multiple PMCs, add a PMC device structure to support each PMC instance. Signed-off-by: Xi Pardee Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230613225347.2720665-4-rajvi.jingar@linux.intel.com Signed-off-by: Hans de Goede commit 804951203aa541ad6720c9726c173d18aeb3ab6b Author: Xi Pardee Date: Tue Jun 13 15:53:41 2023 -0700 platform/x86:intel/pmc: Combine core_init() and core_configure() Combine core_init() and core_configure() functions to have a cleaner setup for platforms. Signed-off-by: Xi Pardee Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230613225347.2720665-3-rajvi.jingar@linux.intel.com Signed-off-by: Hans de Goede commit 9682cfd1973d01e43c2764c662e6d3291ddf770d Author: Xi Pardee Date: Tue Jun 13 15:53:40 2023 -0700 platform/x86:intel/pmc: Update maps for Meteor Lake P/M platforms Fix the IP name errors in the register maps used by the following debugfs attributes in the Meteor Lake SOC-M PMC. pfear_sts lpm_sts ltr_show Fixes: c5ad454a12c6 ("platform/x86: intel/pmc/core: Add Meteor Lake support to pmc core driver") Signed-off-by: Xi Pardee Signed-off-by: Rajvi Jingar Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230613225347.2720665-2-rajvi.jingar@linux.intel.com Signed-off-by: Hans de Goede commit 95de91483c22e90bb520655f8e6f1c70dd82ed3c Author: Srinivas Pandruvada Date: Fri Jun 16 18:44:47 2023 -0700 platform/x86/intel: tpmi: Remove hardcoded unit and offset Use sizeof(u32) for TPMI entry size units. Also add a define for capability offset unit size. Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20230617014447.2543592-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 899c7b18ef01bcc5c01bd9cfbd6ae837bc5aad5b Author: Hans de Goede Date: Fri Jun 16 19:21:32 2023 +0200 platform/x86: int3472: discrete: Log a warning if the pin-numbers don't match The INT3472 discrete code assumes that the ACPI GPIO resources are in the same order as the pin-info _DSM entries. The returned pin-info includes the pin-number in bits 15-8. Add a check that this matches with the ACPI GPIO resource pin-number in case the assumption is not true with some ACPI tables. Reviewed-by: Daniel Scally Reviewed-by: Ilpo Järvinen Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230616172132.37859-7-hdegoede@redhat.com commit 45eaf2e2b8bc9bf4beaa30918a25690ae105a913 Author: Hans de Goede Date: Fri Jun 16 19:21:31 2023 +0200 platform/x86: int3472: discrete: Use FIELD_GET() on the GPIO _DSM return value Add defines for the various fields encoded in the GPIO _DSM integer return value and then use FIELD_GET() to get field values. Suggested-by: Ilpo Järvinen Reviewed-by: Ilpo Järvinen Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230616172132.37859-6-hdegoede@redhat.com commit ebeb3fff9cd197a8890733e0af4eb06d8114cdff Author: Hans de Goede Date: Fri Jun 16 19:21:30 2023 +0200 platform/x86: int3472: discrete: Add alternative "AVDD" regulator supply name Add an "AVDD" regulator supply name alias to the supply-map which gets registered for the INT3472 GPIO regulator. This is necessary for the ov2680 driver which expects "AVDD" rather then "avdd". Updating the ov2680 driver to use "avdd" is not possible because that will break compatibility with existing DT / DTB files. Tested-by: Hao Yao Signed-off-by: Hans de Goede Reviewed-by: Daniel Scally Link: https://lore.kernel.org/r/20230616172132.37859-5-hdegoede@redhat.com commit f1a582502cdd8c5931a9c4a14ec239470d3a13fa Author: Hans de Goede Date: Fri Jun 16 19:21:29 2023 +0200 platform/x86: int3472: discrete: Add support for 1 GPIO regulator shared between 2 sensors On the Lenovo Miix 510-12IKB there is 1 GPIO regulator, with its GPIO listed in the INT3472 device belonging to the OV5648 back sensor. But this regulator also needs to be enabled for the OV2680 front sensor to work. Add support to skl_int3472_register_regulator() to add supply map entries pointing to both sensors based on a DMI quirk table which gives the dev_name part of the supply map for the second sensor (the sensor without the GPIO listed in its matching INT3472 ACPI device). Tested-by: Hao Yao Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230616172132.37859-4-hdegoede@redhat.com commit d4381dcf34fcde7b10f0fa9f1195a95db96639fb Author: Hans de Goede Date: Fri Jun 16 19:21:28 2023 +0200 platform/x86: int3472: discrete: Remove sensor_config-s Currently the only 2 sensor_config-s both specify "avdd" as supply-id. The INT3472 device is going to be the only supplier of a regulator for the sensor device. So there is no chance of collisions with other regulator suppliers and it is undesirable to need to manually add new entries to int3472_sensor_configs[] for each new sensor module which uses a GPIO regulator. Instead just always use "avdd" as supply-id when registering the GPIO regulator. If necessary for specific sensor drivers then other supply-ids can be added as aliases in the future, adding aliases will be safe since INT3472 will be the only regulator supplier for the sensor. Cc: Bingbu Cao Tested-by: Hao Yao Signed-off-by: Hans de Goede Reviewed-by: Daniel Scally Link: https://lore.kernel.org/r/20230616172132.37859-3-hdegoede@redhat.com commit b52798a86af02776e627b457c2c4c9c49774498f Author: Hans de Goede Date: Fri Jun 16 19:21:27 2023 +0200 platform/x86: int3472: discrete: Drop GPIO remapping support The only sensor driver which needs GPIO remapping support is the ov2680 driver and ACPI enumeration support + other necessary changes to the ov2680 driver were never upstreamed. A new series updating the ov2680 driver is pending upstream now and in this series the ov2680 driver is patched to look for "powerdown" as con-id, instead of relying on GPIO remapping in the int3472 code, so the GPIO remapping is no longer necessary. Tested-by: Hao Yao Reviewed-by: Daniel Scally Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230616172132.37859-2-hdegoede@redhat.com commit a4ba10bf6855bf9381fe2365ec9c3af84c1fa7db Author: Mario Limonciello Date: Mon Jun 12 09:26:48 2023 -0400 cpufreq: amd-pstate: Set default governor to schedutil The Kconfig currently defaults the governor to schedutil on x86_64 only when intel-pstate and SMP have been selected. If the kernel is built only with amd-pstate, the default governor should also be schedutil. Signed-off-by: Mario Limonciello Reviewed-by: Leo Li Acked-by: Huang Rui Tested-by: Perry Yuan Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 1fdecc5bc8e81b0afba17876ff99b4131d0e03aa Author: Manivannan Sadhasivam Date: Mon Jun 19 20:34:08 2023 +0530 PCI: qcom: Do not advertise hotplug capability for IP v2.1.0 SoCs making use of Qcom PCIe controller IP v2.1.0 do not support hotplug functionality. But the hotplug capability bit is set by default in the hardware. This causes the kernel PCI core to register hotplug service for the controller and send hotplug commands to it. But those commands will timeout generating messages as below during boot and suspend/resume. [ 5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago) [ 5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago) [ 7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago) [ 7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago) This not only spams the console output but also induces a delay of a couple of seconds. To fix this issue, let's clear the HPC bit in PCI_EXP_SLTCAP register as a part of the post init sequence to not advertise the hotplug capability for the controller. Link: https://lore.kernel.org/r/20230619150408.8468-10-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi commit fa2dc252868403d3de9f3589f725a026b51c6f72 Author: Manivannan Sadhasivam Date: Mon Jun 19 20:34:07 2023 +0530 PCI: qcom: Do not advertise hotplug capability for IP v1.0.0 SoCs making use of Qcom PCIe controller IP v1.0.0 do not support hotplug functionality. But the hotplug capability bit is set by default in the hardware. This causes the kernel PCI core to register hotplug service for the controller and send hotplug commands to it. But those commands will timeout generating messages as below during boot and suspend/resume. [ 5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago) [ 5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago) [ 7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago) [ 7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago) This not only spams the console output but also induces a delay of a couple of seconds. To fix this issue, let's clear the HPC bit in PCI_EXP_SLTCAP register as a part of the post init sequence to not advertise the hotplug capability for the controller. Link: https://lore.kernel.org/r/20230619150408.8468-9-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi commit e35d13a5ff372244c9f9d1ea01532d26698cb046 Author: Manivannan Sadhasivam Date: Mon Jun 19 20:34:06 2023 +0530 PCI: qcom: Use post init sequence of IP v2.3.2 for v2.4.0 The post init sequence of IP v2.4.0 is same as v2.3.2. So let's reuse the v2.3.2 sequence which now also disables hotplug capability of the controller as it is not at all supported on any SoCs making use of this IP. Link: https://lore.kernel.org/r/20230619150408.8468-8-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Reviewed-by: Dmitry Baryshkov commit 25966e78d3035b6356d9284ad07b3033212c691b Author: Manivannan Sadhasivam Date: Mon Jun 19 20:34:05 2023 +0530 PCI: qcom: Do not advertise hotplug capability for IP v2.3.2 SoCs making use of Qcom PCIe controller IP v2.3.2 do not support hotplug functionality. But the hotplug capability bit is set by default in the hardware. This causes the kernel PCI core to register hotplug service for the controller and send hotplug commands to it. But those commands will timeout generating messages as below during boot and suspend/resume. [ 5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago) [ 5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago) [ 7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago) [ 7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago) This not only spams the console output but also induces a delay of a couple of seconds. To fix this issue, let's clear the HPC bit in PCI_EXP_SLTCAP register as a part of the post init sequence to not advertise the hotplug capability for the controller. Link: https://lore.kernel.org/r/20230619150408.8468-7-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi commit 11bce06b21a0d5f002156b2bc6573329f285a927 Author: Manivannan Sadhasivam Date: Mon Jun 19 20:34:04 2023 +0530 PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0 SoCs making use of Qcom PCIe controller IPs v2.3.3 and v2.9.0 do not support hotplug functionality. But the hotplug capability bit is set by default in the hardware. This causes the kernel PCI core to register hotplug service for the controller and send hotplug commands to it. But those commands will timeout generating messages as below during boot and suspend/resume. [ 5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago) [ 5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago) [ 7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago) [ 7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago) This not only spams the console output but also induces a delay of a couple of seconds. To fix this issue, let's not set the HPC bit in PCI_EXP_SLTCAP register as a part of the post init sequence to not advertise the hotplug capability for the controller. Link: https://lore.kernel.org/r/20230619150408.8468-6-manivannan.sadhasivam@linaro.org Tested-by: Sricharan Ramabadhran Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Reviewed-by: Dmitry Baryshkov commit a54db86ddc153484e36266aa2da458a3d9ba0d64 Author: Manivannan Sadhasivam Date: Mon Jun 19 20:34:03 2023 +0530 PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0 SoCs making use of Qcom PCIe controller IPs v2.7.0 and v1.9.0 do not support hotplug functionality. But the hotplug capability bit is set by default in the hardware. This causes the kernel PCI core to register hotplug service for the controller and send hotplug commands to it. But those commands will timeout generating messages as below during boot and suspend/resume. [ 5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago) [ 5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago) [ 7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago) [ 7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago) This not only spams the console output but also induces a delay of a couple of seconds. To fix this issue, let's clear the HPC bit in PCI_EXP_SLTCAP register as a part of the post init sequence to not advertise the hotplug capability for the controller. Link: https://lore.kernel.org/r/20230619150408.8468-5-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Reviewed-by: Dmitry Baryshkov commit 200b8f85f2021362adcc8efb575652a2aa44c099 Author: Manivannan Sadhasivam Date: Mon Jun 19 20:34:02 2023 +0530 PCI: qcom: Disable write access to read only registers for IP v2.9.0 In the post init sequence of v2.9.0, write access to read only registers are not disabled after updating the registers. Fix it by disabling the access after register update. While at it, let's also add a newline after existing dw_pcie_dbi_ro_wr_en() guard function to align with rest of the driver. Link: https://lore.kernel.org/r/20230619150408.8468-4-manivannan.sadhasivam@linaro.org Fixes: 0cf7c2efe8ac ("PCI: qcom: Add IPQ60xx support") Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Reviewed-by: Dmitry Baryshkov commit 60f0072d7fb7996b9a524ef0d152e21205473192 Author: Manivannan Sadhasivam Date: Mon Jun 19 20:34:01 2023 +0530 PCI: qcom: Use DWC helpers for modifying the read-only DBI registers DWC core already exposes dw_pcie_dbi_ro_wr_{en/dis} helper APIs for enabling and disabling the write access to read only DBI registers. So let's use them instead of doing it manually. Also, the existing code doesn't disable the write access when it's done. This is also fixed now. Link: https://lore.kernel.org/r/20230619150408.8468-3-manivannan.sadhasivam@linaro.org Fixes: 5d76117f070d ("PCI: qcom: Add support for IPQ8074 PCIe controller") Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Reviewed-by: Dmitry Baryshkov commit a33d700e8eea76c62120cb3dbf5e01328f18319a Author: Manivannan Sadhasivam Date: Mon Jun 19 20:34:00 2023 +0530 PCI: qcom: Disable write access to read only registers for IP v2.3.3 In the post init sequence of v2.9.0, write access to read only registers are not disabled after updating the registers. Fix it by disabling the access after register update. Link: https://lore.kernel.org/r/20230619150408.8468-2-manivannan.sadhasivam@linaro.org Fixes: 5d76117f070d ("PCI: qcom: Add support for IPQ8074 PCIe controller") Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Cc: commit f1738a1f816233e6dfc2407f24a31d596643fd90 Author: Robert Marko Date: Mon Jun 19 21:35:58 2023 +0200 mmc: core: disable TRIM on Kingston EMMC04G-M627 It seems that Kingston EMMC04G-M627 despite advertising TRIM support does not work when the core is trying to use REQ_OP_WRITE_ZEROES. We are seeing I/O errors in OpenWrt under 6.1 on Zyxel NBG7815 that we did not previously have and tracked it down to REQ_OP_WRITE_ZEROES. Trying to use fstrim seems to also throw errors like: [93010.835112] I/O error, dev loop0, sector 16902 op 0x3:(DISCARD) flags 0x800 phys_seg 1 prio class 2 Disabling TRIM makes the error go away, so lets add a quirk for this eMMC to disable TRIM. Signed-off-by: Robert Marko Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230619193621.437358-1-robimarko@gmail.com Signed-off-by: Ulf Hansson commit b5c3eb3857976050cde3d7300015f3ab40bf27b1 Author: Yann Gautier Date: Mon Jun 19 13:51:20 2023 +0200 mmc: mmci: stm32: add delay block support for STM32MP25 On STM32MP25, the delay block is inside the SoC, and configured through the SYSCFG registers. The algorithm is also different from what was in STM32MP1 chip. Signed-off-by: Yann Gautier Link: https://lore.kernel.org/r/20230619115120.64474-7-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit 83efc782dcb74a1289b2f390e1ab134d1e90085d Author: Yann Gautier Date: Mon Jun 19 13:51:19 2023 +0200 mmc: mmci: stm32: prepare other delay block support Create an sdmmc_tuning_ops struct to ease support for another delay block peripheral. Signed-off-by: Yann Gautier Link: https://lore.kernel.org/r/20230619115120.64474-6-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit 27bdc37c390af01af72ad3750cafe19b459bdf93 Author: Yann Gautier Date: Mon Jun 19 13:51:18 2023 +0200 mmc: mmci: stm32: manage block gap hardware flow control In stm32 sdmmc variant revision v3.0, a block gap hardware flow control should be used with bus speed modes SDR104 and HS200. It is enabled by writing a non-null value to the new added register MMCI_STM32_FIFOTHRR. The threshold will be 2^(N-1) bytes, so we can use the ffs() function to compute the value N to be written to the register. The threshold used should be the data block size, but must not be bigger than the FIFO size. Signed-off-by: Yann Gautier Link: https://lore.kernel.org/r/20230619115120.64474-5-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit ea9ca04119734c2b84691276fef2c018e9fd68ae Author: Yann Gautier Date: Mon Jun 19 13:51:17 2023 +0200 mmc: mmci: Add support for sdmmc variant revision v3.0 This is an update of the SDMMC revision v2.2, with just an increased FIFO size, from 64B to 1kB. Signed-off-by: Yann Gautier Link: https://lore.kernel.org/r/20230619115120.64474-4-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit 88167e6c2e8e5d99f83a4d1d466e1d9c35c8f596 Author: Yann Gautier Date: Mon Jun 19 13:51:16 2023 +0200 mmc: mmci: add stm32_idmabsize_align parameter The alignment for the IDMA size depends on the peripheral version, it should then be configurable. Add stm32_idmabsize_align in the variant structure. And remove now unused (and wrong) MMCI_STM32_IDMABNDT_* macros. Signed-off-by: Yann Gautier Link: https://lore.kernel.org/r/20230619115120.64474-3-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit 1f9f2cf3145e67dc5bbc0ac25b52bfa11b17a882 Author: Yann Gautier Date: Mon Jun 19 13:51:15 2023 +0200 dt-bindings: mmc: mmci: Add st,stm32mp25-sdmmc2 compatible For STM32MP25, we'll need to distinguish how is managed the delay block. This is done through a new comptible dedicated for this SoC, as the delay block registers are located in SYSCFG peripheral. Signed-off-by: Yann Gautier Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230619115120.64474-2-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit 5d83a2b18b988c55e2271332e88186242c86b9f2 Merge: 45a3e24f65e90 a83bfdca8b209 Author: Rafael J. Wysocki Date: Tue Jun 20 11:27:44 2023 +0200 Merge tag 'devfreq-next-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux Merge devfreq updates for v6.5 from Chanwoo Choi: "1. Reorder fieldls in 'struct devfreq_dev_status' in order to shrink the size of 'struct devfreqw_dev_status' without any behavior changes. 2. Add exynos-ppmu.c driver as a soft module dependency in order to prevent the freeze issue between exynos-bus.c devfreq driver and exynos-ppmu.c devfreq event driver. 3. Fix variable deferencing before NULL check on mtk-cci-devfreq.c" * tag 'devfreq-next-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux: PM / devfreq: mtk-cci: Fix variable deferencing before NULL check PM / devfreq: exynos: add Exynos PPMU as a soft module dependency PM / devfreq: Reorder fields in 'struct devfreq_dev_status' commit 712557f210723101717570844c95ac0913af74d7 Merge: 4931062492c5d d8ee5ca845b4f Author: David S. Miller Date: Tue Jun 20 09:02:33 2023 +0100 Merge branch 'ptp-adjphase-cleanups' Rahul Rameshbabu says: ==================== ptp .adjphase cleanups The goal of this patch series is to improve documentation of .adjphase, add a new callback .getmaxphase to enable advertising the max phase offset a device PHC can support, and support invoking .adjphase from the testptp kselftest. Changes: v2->v1: * Removes arbitrary rule that the PHC servo must restore the frequency to the value used in the last .adjfine call if any other PHC operation is used after a .adjphase operation. * Removes a macro introduced in v1 for adding PTP sysfs device attribute nodes using a callback for populating the data. Link: https://lore.kernel.org/netdev/20230120160609.19160723@kernel.org/ Link: https://lore.kernel.org/netdev/20230510205306.136766-1-rrameshbabu@nvidia.com/ ==================== Signed-off-by: David S. Miller commit d8ee5ca845b4f96cc2e74fb5dd1465c8ea3f5fa3 Author: Rahul Rameshbabu Date: Mon Jun 12 14:15:00 2023 -0700 ptp: ocp: Add .getmaxphase ptp_clock_info callback Add a function that advertises a maximum offset of zero supported by ptp_clock_info .adjphase in the OCP null ptp implementation. Cc: Richard Cochran Cc: Jonathan Lemon Cc: Vadim Fedorenko Signed-off-by: Rahul Rameshbabu Acked-by: Vadim Fedorenko Signed-off-by: David S. Miller commit e156e4d2e43f8b57696ee155f8c3d026419d3363 Author: Rahul Rameshbabu Date: Mon Jun 12 14:14:59 2023 -0700 ptp: idt82p33: Add .getmaxphase ptp_clock_info callback Advertise the maximum offset the .adjphase callback is capable of supporting in nanoseconds for IDT devices. Refactor the negation of the offset stored in the register to be after the boundary check of the offset value rather than before. Boundary check based on the intended value rather than its device-specific representation. Depend on ptp_clock_adjtime for handling out-of-range offsets. ptp_clock_adjtime returns -ERANGE instead of clamping out-of-range offsets. Cc: Richard Cochran Cc: Min Li Signed-off-by: Rahul Rameshbabu Signed-off-by: David S. Miller commit c066e74f34bc464bc1a077a688d7fa31a742d2d5 Author: Rahul Rameshbabu Date: Mon Jun 12 14:14:58 2023 -0700 ptp: ptp_clockmatrix: Add .getmaxphase ptp_clock_info callback Advertise the maximum offset the .adjphase callback is capable of supporting in nanoseconds for IDT ClockMatrix devices. Depend on ptp_clock_adjtime for handling out-of-range offsets. ptp_clock_adjtime returns -ERANGE instead of clamping out-of-range offsets. Cc: Richard Cochran Cc: Vincent Cheng Signed-off-by: Rahul Rameshbabu Signed-off-by: David S. Miller commit 67ac72a599d833ff7d9b210186a66d46c13f0a18 Author: Rahul Rameshbabu Date: Mon Jun 12 14:14:57 2023 -0700 net/mlx5: Add .getmaxphase ptp_clock_info callback Implement .getmaxphase callback of ptp_clock_info in mlx5 driver. No longer do a range check in .adjphase callback implementation. Handled by the ptp stack. Cc: Saeed Mahameed Signed-off-by: Rahul Rameshbabu Acked-by: Richard Cochran Signed-off-by: David S. Miller commit c3b60ab7a4dff6e6e608e685b70ddc3d6b2aca81 Author: Rahul Rameshbabu Date: Mon Jun 12 14:14:56 2023 -0700 ptp: Add .getmaxphase callback to ptp_clock_info Enables advertisement of the maximum offset supported by the phase control functionality of PHCs. The callback is used to return an error if an offset not supported by the PHC is used in ADJ_OFFSET. The ioctls PTP_CLOCK_GETCAPS and PTP_CLOCK_GETCAPS2 now advertise the maximum offset a PHC's phase control functionality is capable of supporting. Introduce new sysfs node, max_phase_adjustment. Cc: Jakub Kicinski Cc: Shuah Khan Cc: Richard Cochran Cc: Maciek Machnikowski Signed-off-by: Rahul Rameshbabu Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 3a9a9a6139286584d1199f555fa4f96f592a3217 Author: Rahul Rameshbabu Date: Mon Jun 12 14:14:55 2023 -0700 testptp: Add support for testing ptp_clock_info .adjphase callback Invoke clock_adjtime syscall with tx.modes set with ADJ_OFFSET when testptp is invoked with a phase adjustment offset value. Support seconds and nanoseconds for the offset value. Cc: Jakub Kicinski Cc: Shuah Khan Cc: Richard Cochran Cc: Maciek Machnikowski Signed-off-by: Rahul Rameshbabu Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 048f6d998eacabed143d6524395573f8868a4f34 Author: Rahul Rameshbabu Date: Mon Jun 12 14:14:54 2023 -0700 testptp: Remove magic numbers related to nanosecond to second conversion Use existing NSEC_PER_SEC declaration in place of hardcoded magic numbers. Cc: Jakub Kicinski Cc: Shuah Khan Cc: Richard Cochran Cc: Maciek Machnikowski Signed-off-by: Rahul Rameshbabu Acked-by: Richard Cochran Signed-off-by: David S. Miller commit fe3834cd0cf74b06847a1001ac44b7e2c035b5bc Author: Rahul Rameshbabu Date: Mon Jun 12 14:14:53 2023 -0700 docs: ptp.rst: Add information about NVIDIA Mellanox devices The mlx5_core driver has implemented ptp clock driver functionality but lacked documentation about the PTP devices. This patch adds information about the Mellanox device family. Signed-off-by: Rahul Rameshbabu Acked-by: Richard Cochran Signed-off-by: David S. Miller commit a05d070a6164bd0578991e42181a52b9c7cf630c Author: Rahul Rameshbabu Date: Mon Jun 12 14:14:52 2023 -0700 ptp: Clarify ptp_clock_info .adjphase expects an internal servo to be used .adjphase expects a PHC to use an internal servo algorithm to correct the provided phase offset target in the callback. Implementation of the internal servo algorithm are defined by the individual devices. Cc: Jakub Kicinski Cc: Richard Cochran Signed-off-by: Rahul Rameshbabu Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 274d4b96b12f78cef4f72a97a4967032233f6cae Author: Dan Carpenter Date: Tue Jun 6 11:23:56 2023 +0300 drm/i915: Fix a NULL vs IS_ERR() bug The mmap_offset_attach() function returns error pointers, it doesn't return NULL. Fixes: eaee1c085863 ("drm/i915: Add a function to mmap framebuffer obj") Signed-off-by: Dan Carpenter Reviewed-by: Nirmoy Das Reviewed-by: Andi Shyti Signed-off-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/ZH7tHLRZ9oBjedjN@moroto (cherry picked from commit 3a89311387cde27da8e290458b2d037133c1f7b5) Signed-off-by: Tvrtko Ursulin commit d57ba095e4f170963ec420d6cd780aa19459bc65 Author: Arnd Bergmann Date: Fri Jun 16 11:31:47 2023 +0200 drm/i915: make i915_drm_client_fdinfo() reference conditional again The function is only defined if CONFIG_PROC_FS is enabled: ld.lld: error: undefined symbol: i915_drm_client_fdinfo >>> referenced by i915_driver.c >>> drivers/gpu/drm/i915/i915_driver.o:(i915_drm_driver) in archive vmlinux.a Use the PTR_IF() helper to make the reference NULL otherwise. Fixes: e894b724c316d ("drm/i915: Use the fdinfo helper") Signed-off-by: Arnd Bergmann Reviewed-by: Andi Shyti Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20230616093158.3568480-1-arnd@kernel.org (cherry picked from commit 8084c63743a88472af0a34ba209eebf9caea1dae) Signed-off-by: Tvrtko Ursulin commit cb359c639dc099ce4316cec9013fd4b2ebeb990c Author: Harshit Mogalapalli Date: Wed Jun 14 15:36:46 2023 -0700 drm/i915/huc: Fix missing error code in intel_huc_init() Smatch warns: drivers/gpu/drm/i915/gt/uc/intel_huc.c:388 intel_huc_init() warn: missing error code 'err' When the allocation of VMAs fail: The value of err is zero at this point and it is passed to PTR_ERR and also finally returning zero which is success instead of failure. Fix this by adding the missing error code when VMA allocation fails. Fixes: 08872cb13a71 ("drm/i915/mtl/huc: auth HuC via GSC") Signed-off-by: Harshit Mogalapalli Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230614223646.2583633-1-daniele.ceraolospurio@intel.com (cherry picked from commit ce432fd34cc6c7b7af06d1403ec0be19d1e518dc) Signed-off-by: Tvrtko Ursulin commit 21f773515902d8b303df650674ad1c5243beb245 Author: Alan Previn Date: Thu Jun 8 16:07:16 2023 -0700 drm/i915/gsc: take a wakeref for the proxy-init-completion check Ensure intel_gsc_uc_fw_init_done and intel_gsc_uc_fw_proxy_init takes a wakeref before reading GSC Shim registers. NOTE: another patch in review also adds a call from selftest to this same function. (https://patchwork.freedesktop.org/series/117713/) which is why i am adding the wakeref inside the callee, not the caller. v2: - add a helper, 'gsc_uc_get_fw_status' for both callers (Daniele Ceraolo) Fixes: 99afb7cc8c44 ("drm/i915/pxp: Add ARB session creation and cleanup") Signed-off-by: Alan Previn Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230608230716.3079594-1-alan.previn.teres.alexis@intel.com (cherry picked from commit 8c33c3755b75c98d8eb490df345b4187a295a1a8) Signed-off-by: Tvrtko Ursulin commit 6b0139b372d40bd5dafc140b6618b57d13211168 Author: Heiner Kallweit Date: Sun Mar 12 22:29:07 2023 +0100 dt-bindings: interrupt-controller: Convert Amlogic Meson GPIO interrupt controller binding Convert Amlogic Meson GPIO interrupt controller binding to yaml. Reviewed-by: Martin Blumenstingl Reviewed-by: Rob Herring Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/e06e9f26-cf55-5596-c799-d698e9d7b409@gmail.com Signed-off-by: Neil Armstrong commit 9e70e49474bb37ba8f43336d8a775d503b20aebc Author: Heiner Kallweit Date: Sun Jan 15 15:26:05 2023 +0100 MAINTAINERS: add PHY-related files to Amlogic SoC file list Add PHY-related files to the Amlogic SoC file list. Signed-off-by: Heiner Kallweit Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/38f87b22-d9a8-b8d8-ba7b-a2c2d7311b04@gmail.com Signed-off-by: Neil Armstrong commit 07f225b5842420ae9c18cba17873fc71ed69c28e Author: Yang Li Date: Tue Jun 20 08:40:36 2023 +0800 RISC-V: KVM: Remove unneeded semicolon ./arch/riscv/kvm/aia_imsic.c:94:2-3: Unneeded semicolon ./arch/riscv/kvm/aia_imsic.c:134:2-3: Unneeded semicolon ./arch/riscv/kvm/aia_imsic.c:173:2-3: Unneeded semicolon ./arch/riscv/kvm/aia_imsic.c:210:2-3: Unneeded semicolon ./arch/riscv/kvm/aia_imsic.c:296:2-3: Unneeded semicolon ./arch/riscv/kvm/aia_imsic.c:354:2-3: Unneeded semicolon ./arch/riscv/kvm/aia_device.c:105:4-5: Unneeded semicolon ./arch/riscv/kvm/aia_device.c:166:2-3: Unneeded semicolon Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5569 Signed-off-by: Yang Li Signed-off-by: Anup Patel commit d75b336225789fb967442feb6cdf9cfc0357b252 Author: Anup Patel Date: Mon Jun 12 16:40:44 2023 +0530 RISC-V: KVM: Allow Svnapot extension for Guest/VM We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Svnapot extension for Guest/VM. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 7d3332be011e4ed061c1403b30b5e54ebccb4fa2 Author: Björn Töpel Date: Wed May 31 11:38:17 2023 +0200 riscv: mm: Pre-allocate PGD entries for vmalloc/modules area The RISC-V port requires that kernel PGD entries are to be synchronized between MMs. This is done via the vmalloc_fault() function, that simply copies the PGD entries from init_mm to the faulting one. Historically, faulting in PGD entries have been a source for both bugs [1], and poor performance. One way to get rid of vmalloc faults is by pre-allocating the PGD entries. Pre-allocating the entries potientially wastes 64 * 4K (65 on SV39). The pre-allocation function is pulled from Jörg Rödel's x86 work, with the addition of 3-level page tables (PMD allocations). The pmd_alloc() function needs the ptlock cache to be initialized (when split page locks is enabled), so the pre-allocation is done in a RISC-V specific pgtable_cache_init() implementation. Pre-allocate the kernel PGD entries for the vmalloc/modules area, but only for 64b platforms. Link: https://lore.kernel.org/lkml/20200508144043.13893-1-joro@8bytes.org/ # [1] Signed-off-by: Björn Töpel Reviewed-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20230531093817.665799-1-bjorn@kernel.org Signed-off-by: Palmer Dabbelt commit 7ca8fe94aa92d9adcd7dcdf64371fc78eb2da3f9 Author: Petr Mladek Date: Fri Jun 16 17:06:18 2023 +0200 watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH The HAVE_ prefix means that the code could be enabled. Add another variable for HAVE_HARDLOCKUP_DETECTOR_ARCH without this prefix. It will be set when it should be built. It will make it compatible with the other hardlockup detectors. The change allows to clean up dependencies of PPC_WATCHDOG and HAVE_HARDLOCKUP_DETECTOR_PERF definitions for powerpc. As a result HAVE_HARDLOCKUP_DETECTOR_PERF has the same dependencies on arm, x86, powerpc architectures. Link: https://lkml.kernel.org/r/20230616150618.6073-7-pmladek@suse.com Signed-off-by: Petr Mladek Reviewed-by: Douglas Anderson Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 47f4cb433923a08d81f1e5c065cb680215109db9 Author: Petr Mladek Date: Fri Jun 16 17:06:17 2023 +0200 watchdog/sparc64: define HARDLOCKUP_DETECTOR_SPARC64 The HAVE_ prefix means that the code could be enabled. Add another variable for HAVE_HARDLOCKUP_DETECTOR_SPARC64 without this prefix. It will be set when it should be built. It will make it compatible with the other hardlockup detectors. Before, it is far from obvious that the SPARC64 variant is actually used: $> make ARCH=sparc64 defconfig $> grep HARDLOCKUP_DETECTOR .config CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y CONFIG_HAVE_HARDLOCKUP_DETECTOR_SPARC64=y After, it is more clear: $> make ARCH=sparc64 defconfig $> grep HARDLOCKUP_DETECTOR .config CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y CONFIG_HAVE_HARDLOCKUP_DETECTOR_SPARC64=y CONFIG_HARDLOCKUP_DETECTOR_SPARC64=y Link: https://lkml.kernel.org/r/20230616150618.6073-6-pmladek@suse.com Signed-off-by: Petr Mladek Reviewed-by: Douglas Anderson Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit a5fcc2367e223c45c78a882438c2b8e13fe0f580 Author: Petr Mladek Date: Fri Jun 16 17:06:16 2023 +0200 watchdog/hardlockup: make HAVE_NMI_WATCHDOG sparc64-specific There are several hardlockup detector implementations and several Kconfig values which allow selection and build of the preferred one. CONFIG_HARDLOCKUP_DETECTOR was introduced by the commit 23637d477c1f53acb ("lockup_detector: Introduce CONFIG_HARDLOCKUP_DETECTOR") in v2.6.36. It was a preparation step for introducing the new generic perf hardlockup detector. The existing arch-specific variants did not support the to-be-created generic build configurations, sysctl interface, etc. This distinction was made explicit by the commit 4a7863cc2eb5f98 ("x86, nmi_watchdog: Remove ARCH_HAS_NMI_WATCHDOG and rely on CONFIG_HARDLOCKUP_DETECTOR") in v2.6.38. CONFIG_HAVE_NMI_WATCHDOG was introduced by the commit d314d74c695f967e105 ("nmi watchdog: do not use cpp symbol in Kconfig") in v3.4-rc1. It replaced the above mentioned ARCH_HAS_NMI_WATCHDOG. At that time, it was still used by three architectures, namely blackfin, mn10300, and sparc. The support for blackfin and mn10300 architectures has been completely dropped some time ago. And sparc is the only architecture with the historic NMI watchdog at the moment. And the old sparc implementation is really special. It is always built on sparc64. It used to be always enabled until the commit 7a5c8b57cec93196b ("sparc: implement watchdog_nmi_enable and watchdog_nmi_disable") added in v4.10-rc1. There are only few locations where the sparc64 NMI watchdog interacts with the generic hardlockup detectors code: + implements arch_touch_nmi_watchdog() which is called from the generic touch_nmi_watchdog() + implements watchdog_hardlockup_enable()/disable() to support /proc/sys/kernel/nmi_watchdog + is always preferred over other generic watchdogs, see CONFIG_HARDLOCKUP_DETECTOR + includes asm/nmi.h into linux/nmi.h because some sparc-specific functions are needed in sparc-specific code which includes only linux/nmi.h. The situation became more complicated after the commit 05a4a95279311c3 ("kernel/watchdog: split up config options") and commit 2104180a53698df5 ("powerpc/64s: implement arch-specific hardlockup watchdog") in v4.13-rc1. They introduced HAVE_HARDLOCKUP_DETECTOR_ARCH. It was used for powerpc specific hardlockup detector. It was compatible with the perf one regarding the general boot, sysctl, and programming interfaces. HAVE_HARDLOCKUP_DETECTOR_ARCH was defined as a superset of HAVE_NMI_WATCHDOG. It made some sense because all arch-specific detectors had some common requirements, namely: + implemented arch_touch_nmi_watchdog() + included asm/nmi.h into linux/nmi.h + defined the default value for /proc/sys/kernel/nmi_watchdog But it actually has made things pretty complicated when the generic buddy hardlockup detector was added. Before the generic perf detector was newer supported together with an arch-specific one. But the buddy detector could work on any SMP system. It means that an architecture could support both the arch-specific and buddy detector. As a result, there are few tricky dependencies. For example, CONFIG_HARDLOCKUP_DETECTOR depends on: ((HAVE_HARDLOCKUP_DETECTOR_PERF || HAVE_HARDLOCKUP_DETECTOR_BUDDY) && !HAVE_NMI_WATCHDOG) || HAVE_HARDLOCKUP_DETECTOR_ARCH The problem is that the very special sparc implementation is defined as: HAVE_NMI_WATCHDOG && !HAVE_HARDLOCKUP_DETECTOR_ARCH Another problem is that the meaning of HAVE_NMI_WATCHDOG is far from clear without reading understanding the history. Make the logic less tricky and more self-explanatory by making HAVE_NMI_WATCHDOG specific for the sparc64 implementation. And rename it to HAVE_HARDLOCKUP_DETECTOR_SPARC64. Note that HARDLOCKUP_DETECTOR_PREFER_BUDDY, HARDLOCKUP_DETECTOR_PERF, and HARDLOCKUP_DETECTOR_BUDDY may conflict only with HAVE_HARDLOCKUP_DETECTOR_ARCH. They depend on HARDLOCKUP_DETECTOR and it is not longer enabled when HAVE_NMI_WATCHDOG is set. Link: https://lkml.kernel.org/r/20230616150618.6073-5-pmladek@suse.com Signed-off-by: Petr Mladek Reviewed-by: Douglas Anderson Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 0c68bda69665307bf835b0c433363e5073608c95 Author: Petr Mladek Date: Fri Jun 16 17:06:15 2023 +0200 watchdog/hardlockup: declare arch_touch_nmi_watchdog() only in linux/nmi.h arch_touch_nmi_watchdog() needs a different implementation for various hardlockup detector implementations. And it does nothing when any hardlockup detector is not built at all. arch_touch_nmi_watchdog() is declared via linux/nmi.h. And it must be defined as an empty function when there is no hardlockup detector. It is done directly in this header file for the perf and buddy detectors. And it is done in the included asm/linux.h for arch specific detectors. The reason probably is that the arch specific variants build the code using another conditions. For example, powerpc64/sparc64 builds the code when CONFIG_PPC_WATCHDOG is enabled. Another reason might be that these architectures define more functions in asm/nmi.h anyway. However the generic code actually knows when the function will be implemented. It happens when some full featured or the sparc64-specific hardlockup detector is built. In particular, CONFIG_HARDLOCKUP_DETECTOR can be enabled only when a generic or arch-specific full featured hardlockup detector is available. The only exception is sparc64 which can be built even when the global HARDLOCKUP_DETECTOR switch is disabled. The information about sparc64 is a bit complicated. The hardlockup detector is built there when CONFIG_HAVE_NMI_WATCHDOG is set and CONFIG_HAVE_HARDLOCKUP_DETECTOR_ARCH is not set. People might wonder whether this change really makes things easier. The motivation is: + The current logic in linux/nmi.h is far from obvious. For example, arch_touch_nmi_watchdog() is defined as {} when neither CONFIG_HARDLOCKUP_DETECTOR_COUNTS_HRTIMER nor CONFIG_HAVE_NMI_WATCHDOG is defined. + The change synchronizes the checks in lib/Kconfig.debug and in the generic code. + It is a step that will help cleaning HAVE_NMI_WATCHDOG related checks. The change should not change the existing behavior. Link: https://lkml.kernel.org/r/20230616150618.6073-4-pmladek@suse.com Signed-off-by: Petr Mladek Reviewed-by: Douglas Anderson Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 1356d0b966e7ed81832af35478b913495cf7792e Author: Petr Mladek Date: Fri Jun 16 17:06:14 2023 +0200 watchdog/hardlockup: make the config checks more straightforward There are four possible variants of hardlockup detectors: + buddy: available when SMP is set. + perf: available when HAVE_HARDLOCKUP_DETECTOR_PERF is set. + arch-specific: available when HAVE_HARDLOCKUP_DETECTOR_ARCH is set. + sparc64 special variant: available when HAVE_NMI_WATCHDOG is set and HAVE_HARDLOCKUP_DETECTOR_ARCH is not set. The check for the sparc64 variant is more complicated because HAVE_NMI_WATCHDOG is used to #ifdef code used by both arch-specific and sparc64 specific variant. Therefore it is automatically selected with HAVE_HARDLOCKUP_DETECTOR_ARCH. This complexity is partly hidden in HAVE_HARDLOCKUP_DETECTOR_NON_ARCH. It reduces the size of some checks but it makes them harder to follow. Finally, the other temporary variable HARDLOCKUP_DETECTOR_NON_ARCH is used to re-compute HARDLOCKUP_DETECTOR_PERF/BUDDY when the global HARDLOCKUP_DETECTOR switch is enabled/disabled. Make the logic more straightforward by the following changes: + Better explain the role of HAVE_HARDLOCKUP_DETECTOR_ARCH and HAVE_NMI_WATCHDOG in comments. + Add HAVE_HARDLOCKUP_DETECTOR_BUDDY so that there is separate HAVE_* for all four hardlockup detector variants. Use it in the other conditions instead of SMP. It makes it clear that it is about the buddy detector. + Open code HAVE_HARDLOCKUP_DETECTOR_NON_ARCH in HARDLOCKUP_DETECTOR and HARDLOCKUP_DETECTOR_PREFER_BUDDY. It helps to understand the conditions between the four hardlockup detector variants. + Define the exact conditions when HARDLOCKUP_DETECTOR_PERF/BUDDY can be enabled. It explains the dependency on the other hardlockup detector variants. Also it allows to remove HARDLOCKUP_DETECTOR_NON_ARCH by using "imply". It triggers re-evaluating HARDLOCKUP_DETECTOR_PERF/BUDDY when the global HARDLOCKUP_DETECTOR switch is changed. + Add dependency on HARDLOCKUP_DETECTOR so that the affected variables disappear when the hardlockup detectors are disabled. Another nice side effect is that HARDLOCKUP_DETECTOR_PREFER_BUDDY value is not preserved when the global switch is disabled. The user has to make the decision again when it gets re-enabled. Link: https://lkml.kernel.org/r/20230616150618.6073-3-pmladek@suse.com Signed-off-by: Petr Mladek Reviewed-by: Douglas Anderson Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 4917a25f83a8dc95eafd0107be87d4340f48d265 Author: Petr Mladek Date: Fri Jun 16 17:06:13 2023 +0200 watchdog/hardlockup: sort hardlockup detector related config values a logical way Patch series "watchdog/hardlockup: Cleanup configuration of hardlockup detectors", v2. Clean up watchdog Kconfig after introducing the buddy detector. This patch (of 6): There are four possible variants of hardlockup detectors: + buddy: available when SMP is set. + perf: available when HAVE_HARDLOCKUP_DETECTOR_PERF is set. + arch-specific: available when HAVE_HARDLOCKUP_DETECTOR_ARCH is set. + sparc64 special variant: available when HAVE_NMI_WATCHDOG is set and HAVE_HARDLOCKUP_DETECTOR_ARCH is not set. Only one hardlockup detector can be compiled in. The selection is done using quite complex dependencies between several CONFIG variables. The following patches will try to make it more straightforward. As a first step, reorder the definitions of the various CONFIG variables. The logical order is: 1. HAVE_* variables define available variants. They are typically defined in the arch/ config files. 2. HARDLOCKUP_DETECTOR y/n variable defines whether the hardlockup detector is enabled at all. 3. HARDLOCKUP_DETECTOR_PREFER_BUDDY y/n variable defines whether the buddy detector should be preferred over the perf one. Note that the arch specific variants are always preferred when available. 4. HARDLOCKUP_DETECTOR_PERF/BUDDY variables define whether the given detector is enabled in the end. 5. HAVE_HARDLOCKUP_DETECTOR_NON_ARCH and HARDLOCKUP_DETECTOR_NON_ARCH are temporary variables that are going to be removed in a followup patch. This is a preparation step for further cleanup. It will change the logic without shuffling the definitions. This change temporary breaks the C-like ordering where the variables are declared or defined before they are used. It is not really needed for Kconfig. Also the following patches will rework the logic so that the ordering will be C-like in the end. The patch just shuffles the definitions. It should not change the existing behavior. Link: https://lkml.kernel.org/r/20230616150618.6073-1-pmladek@suse.com Link: https://lkml.kernel.org/r/20230616150618.6073-2-pmladek@suse.com Signed-off-by: Petr Mladek Reviewed-by: Douglas Anderson Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 28168eca3297d68faa8a9433ec93cb6acf06d2f4 Author: Douglas Anderson Date: Fri May 26 18:41:39 2023 -0700 watchdog/hardlockup: move SMP barriers from common code to buddy code It's been suggested that since the SMP barriers are only potentially useful for the buddy hardlockup detector, not the perf hardlockup detector, that the barriers belong in the buddy code. Let's move them and add clearer comments about why they're needed. Link: https://lkml.kernel.org/r/20230526184139.9.I5ab0a0eeb0bd52fb23f901d298c72fa5c396e22b@changeid Signed-off-by: Douglas Anderson Suggested-by: Petr Mladek Reviewed-by: Petr Mladek Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 7ece48b7b4a22c1b2d59d7ab8ebcbacbfcaa7872 Author: Douglas Anderson Date: Fri May 26 18:41:38 2023 -0700 watchdog/buddy: simplify the dependency for HARDLOCKUP_DETECTOR_PREFER_BUDDY The dependency for HARDLOCKUP_DETECTOR_PREFER_BUDDY was more complicated than it needed to be. If the "perf" detector is available and we have SMP then we have a choice, so enable the config based on just those two config items. Link: https://lkml.kernel.org/r/20230526184139.8.I49d5b483336b65b8acb1e5066548a05260caf809@changeid Signed-off-by: Douglas Anderson Suggested-by: Petr Mladek Reviewed-by: Petr Mladek Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 813efda23934edcad96343fc96727017378c3fe9 Author: Douglas Anderson Date: Fri May 26 18:41:37 2023 -0700 watchdog/buddy: don't copy the cpumask in watchdog_next_cpu() There's no reason to make a copy of the "watchdog_cpus" locally in watchdog_next_cpu(). Making a copy wouldn't make things any more race free and we're just reading the value so there's no need for a copy. Link: https://lkml.kernel.org/r/20230526184139.7.If466f9a2b50884cbf6a1d8ad05525a2c17069407@changeid Signed-off-by: Douglas Anderson Suggested-by: Petr Mladek Reviewed-by: Petr Mladek Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit d3b62ace0f097f1d863fb6c41df3c61503e4ec9e Author: Douglas Anderson Date: Fri May 26 18:41:36 2023 -0700 watchdog/buddy: cleanup how watchdog_buddy_check_hardlockup() is called In the patch ("watchdog/hardlockup: detect hard lockups using secondary (buddy) CPUs"), we added a call from the common watchdog.c file into the buddy. That call could be done more cleanly. Specifically: 1. If we move the call into watchdog_hardlockup_kick() then it keeps watchdog_timer_fn() simpler. 2. We don't need to pass an "unsigned long" to the buddy for the timer count. In the patch ("watchdog/hardlockup: add a "cpu" param to watchdog_hardlockup_check()") the count was changed to "atomic_t" which is backed by an int, so we should match types. Link: https://lkml.kernel.org/r/20230526184139.6.I006c7d958a1ea5c4e1e4dc44a25596d9bb5fd3ba@changeid Signed-off-by: Douglas Anderson Suggested-by: Petr Mladek Reviewed-by: Petr Mladek Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 05e7b558766114aa9c3d5d3af188a5c574809661 Author: Douglas Anderson Date: Fri May 26 18:41:35 2023 -0700 watchdog/hardlockup: remove softlockup comment in touch_nmi_watchdog() In the patch ("watchdog/hardlockup: add comments to touch_nmi_watchdog()") we adjusted some comments for touch_nmi_watchdog(). The comment about the softlockup had a typo and were also felt to be too obvious. Remove it. Link: https://lkml.kernel.org/r/20230526184139.5.Ia593afc9eb12082d55ea6681dc2c5a89677f20a8@changeid Signed-off-by: Douglas Anderson Suggested-by: Petr Mladek Reviewed-by: Petr Mladek Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 7a71d8e650b06833095e7a0d4206585e8585c00f Author: Douglas Anderson Date: Fri May 26 18:41:34 2023 -0700 watchdog/hardlockup: in watchdog_hardlockup_check() use cpumask_copy() In the patch ("watchdog/hardlockup: add a "cpu" param to watchdog_hardlockup_check()") we started using a cpumask to keep track of which CPUs to backtrace. When setting up this cpumask, it's better to use cpumask_copy() than to just copy the structure directly. Fix this. Link: https://lkml.kernel.org/r/20230526184139.4.Iccee2d1ea19114dafb6553a854ea4d8ab2a3f25b@changeid Signed-off-by: Douglas Anderson Suggested-by: Petr Mladek Reviewed-by: Petr Mladek Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 2711e4adef4fac2eeaee66e3c22a2f75ee86e7b3 Author: Douglas Anderson Date: Fri May 26 18:41:33 2023 -0700 watchdog/hardlockup: don't use raw_cpu_ptr() in watchdog_hardlockup_kick() In the patch ("watchdog/hardlockup: add a "cpu" param to watchdog_hardlockup_check()") there was no reason to use raw_cpu_ptr(). Using this_cpu_ptr() works fine. Link: https://lkml.kernel.org/r/20230526184139.3.I660e103077dcc23bb29aaf2be09cb234e0495b2d@changeid Signed-off-by: Douglas Anderson Suggested-by: Petr Mladek Reviewed-by: Petr Mladek Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 6426e8d1f27417834ea37e75a9ead832d1cf7713 Author: Douglas Anderson Date: Fri May 26 18:41:32 2023 -0700 watchdog/hardlockup: HAVE_NMI_WATCHDOG must implement watchdog_hardlockup_probe() Right now there is one arch (sparc64) that selects HAVE_NMI_WATCHDOG without selecting HAVE_HARDLOCKUP_DETECTOR_ARCH. Because of that one architecture, we have some special case code in the watchdog core to handle the fact that watchdog_hardlockup_probe() isn't implemented. Let's implement watchdog_hardlockup_probe() for sparc64 and get rid of the special case. As a side effect of doing this, code inspection tells us that we could fix a minor bug where the system won't properly realize that NMI watchdogs are disabled. Specifically, on powerpc if CONFIG_PPC_WATCHDOG is turned off the arch might still select CONFIG_HAVE_HARDLOCKUP_DETECTOR_ARCH which selects CONFIG_HAVE_NMI_WATCHDOG. Since CONFIG_PPC_WATCHDOG was off then nothing will override the "weak" watchdog_hardlockup_probe() and we'll fallback to looking at CONFIG_HAVE_NMI_WATCHDOG. Link: https://lkml.kernel.org/r/20230526184139.2.Ic6ebbf307ca0efe91f08ce2c1eb4a037ba6b0700@changeid Signed-off-by: Douglas Anderson Suggested-by: Petr Mladek Reviewed-by: Petr Mladek Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 9ec272c586b07d1abf73438524bd12b1df9c5f9b Author: Douglas Anderson Date: Fri May 26 18:41:31 2023 -0700 watchdog/hardlockup: keep kernel.nmi_watchdog sysctl as 0444 if probe fails Patch series "watchdog: Cleanup / fixes after buddy series v5 reviews". This patch series attempts to finish resolving the feedback received from Petr Mladek on the v5 series I posted. Probably the only thing that wasn't fully as clean as Petr requested was the Kconfig stuff. I couldn't find a better way to express it without a more major overhaul. In the very least, I renamed "NON_ARCH" to "PERF_OR_BUDDY" in the hopes that will make it marginally better. Nothing in this series is terribly critical and even the bugfixes are small. However, it does cleanup a few things that were pointed out in review. This patch (of 10): The permissions for the kernel.nmi_watchdog sysctl have always been set at compile time despite the fact that a watchdog can fail to probe. Let's fix this and set the permissions based on whether the hardlockup detector actually probed. Link: https://lkml.kernel.org/r/20230527014153.2793931-1-dianders@chromium.org Link: https://lkml.kernel.org/r/20230526184139.1.I0d75971cc52a7283f495aac0bd5c3041aadc734e@changeid Fixes: a994a3147e4c ("watchdog/hardlockup/perf: Implement init time detection of perf") Signed-off-by: Douglas Anderson Reported-by: Petr Mladek Closes: https://lore.kernel.org/r/ZHCn4hNxFpY5-9Ki@alley Reviewed-by: Petr Mladek Cc: Christophe Leroy Cc: "David S. Miller" Cc: Michael Ellerman Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit cf01724e2d73a90524450e3dd8798cfb9d7aca05 Author: Miaohe Lin Date: Sat Jun 17 11:46:22 2023 +0800 mm: page_alloc: make compound_page_dtors static It's only used inside page_alloc.c now. So make it static and remove the declaration in mm.h. Link: https://lkml.kernel.org/r/20230617034622.1235913-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton commit ff71f26f9774267bcdfa4759ea8879562f079da4 Author: SeongJae Park Date: Fri Jun 16 19:17:42 2023 +0000 Docs/admin-guide/mm/damon/usage: update the ways for getting monitoring results The recommended ways for getting DAMON monitoring results are using tried_regions sysfs directory for partial snapshot of the results, and DAMON tracepoint for full record of the results. However, the tried_regions sysfs directory usage has not sufficiently updated on some sections of the DAMON usage document. Update those. Link: https://lkml.kernel.org/r/20230616191742.87531-8-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 67c34f6c6af8f3bdf794a6b91d9f063faeac0575 Author: SeongJae Park Date: Fri Jun 16 19:17:41 2023 +0000 Docs/admin-guide/mm/damon/usage: clarify quotas and watermarks sysfs interface Explanation of DAMOS quotas and watermarks are not clearly explaining the meaning and expectation of each file. Add more clarification for those. Link: https://lkml.kernel.org/r/20230616191742.87531-7-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 01e08737daed0135c20c0844272a358d63a9cafe Author: SeongJae Park Date: Fri Jun 16 19:17:40 2023 +0000 Docs/admin-guide/mm/damon/usage: link design document for DAMOS The background and concept of DAMOS is redundantly documented, in the design document and the usage document. Replace the duplicated ones in usage document with links to the design document. Link: https://lkml.kernel.org/r/20230616191742.87531-6-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit ddb7d012b1018c820848be051f84e962fd30dd78 Author: SeongJae Park Date: Fri Jun 16 19:17:39 2023 +0000 Docs/admin-guide/mm/damon/usage: remove unnecessary sentences about supported address spaces Brief explanation of DAMON user space tool and sysfs interface are unnecessarily and repeatedly mentioning the list of address spaces that DAMON is supporting. Remove those. Link: https://lkml.kernel.org/r/20230616191742.87531-5-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit cc5ece5979dadc76ff9b9c7ac1795327a4f1ecb1 Author: SeongJae Park Date: Fri Jun 16 19:17:38 2023 +0000 Docs/admin-guide/mm/damon/usage: fix typos in references and commas Fix typos including a unnecessary comma and incomplete ':ref:' keywords. Link: https://lkml.kernel.org/r/20230616191742.87531-4-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 60eb644b012799562d1f7b9238434fe89ed3a940 Author: SeongJae Park Date: Fri Jun 16 19:17:37 2023 +0000 Docs/admin-guide/mm/damon/start: update DAMOS example command DAMON user-space tool, damo, has deprecated[1] its old DAMOS schemes specification format. However, an example of DAMON documentation is still using it. Update the example to use one of the alternative options. [1] https://github.com/awslabs/damo/commit/e9950ae68f6c Link: https://lkml.kernel.org/r/20230616191742.87531-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit b16b54c9db8bb4ed34a489ed56cb33d08a12da1a Author: SeongJae Park Date: Fri Jun 16 19:17:36 2023 +0000 Docs/mm/damon/design: document 'age' of region Patch series "Docs/{mm,admin-guide}damon: update design and usage docs". Update DAMON design and usage documents for outdated and unnecessarily duplicated parts. This patch (of 7): The 'age' of each region in DAMON monitoring results is an important concept for both monitoring part and DAMOS. And DAMOS section of the design document is mentioning it. However, the age itself is not explained in the document. Add a section for that. Link: https://lkml.kernel.org/r/20230616191742.87531-1-sj@kernel.org Link: https://lkml.kernel.org/r/20230616191742.87531-2-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit c1753fd02a0058ea43cbb31ab26d25be2f6cfe08 Author: Mathieu Desnoyers Date: Mon May 15 10:35:36 2023 -0400 mm: move mm_count into its own cache line The mm_struct mm_count field is frequently updated by mmgrab/mmdrop performed by context switch. This causes false-sharing for surrounding mm_struct fields which are read-mostly. This has been observed on a 2sockets/112core/224cpu Intel Sapphire Rapids server running hackbench, and by the kernel test robot will-it-scale testcase. Move the mm_count field into its own cache line to prevent false-sharing with other mm_struct fields. Move mm_count to the first field of mm_struct to minimize the amount of padding required: rather than adding padding before and after the mm_count field, padding is only added after mm_count. Note that I noticed this odd comment in mm_struct: commit 2e3025434a6b ("mm: relocate 'write_protect_seq' in struct mm_struct") /* * With some kernel config, the current mmap_lock's offset * inside 'mm_struct' is at 0x120, which is very optimal, as * its two hot fields 'count' and 'owner' sit in 2 different * cachelines, and when mmap_lock is highly contended, both * of the 2 fields will be accessed frequently, current layout * will help to reduce cache bouncing. * * So please be careful with adding new fields before * mmap_lock, which can easily push the 2 fields into one * cacheline. */ struct rw_semaphore mmap_lock; This comment is rather odd for a few reasons: - It requires addition/removal of mm_struct fields to carefully consider field alignment of _other_ fields, - It expresses the wish to keep an "optimal" alignment for a specific kernel config. I suspect that the author of this comment may want to revisit this topic and perhaps introduce a split-struct approach for struct rw_semaphore, if the need is to place various fields of this structure in different cache lines. Link: https://lkml.kernel.org/r/20230515143536.114960-1-mathieu.desnoyers@efficios.com Fixes: 223baf9d17f2 ("sched: Fix performance regression introduced by mm_cid") Fixes: af7f588d8f73 ("sched: Introduce per-memory-map concurrency ID") Link: https://lore.kernel.org/lkml/7a0c1db1-103d-d518-ed96-1584a28fbf32@efficios.com Reported-by: kernel test robot Link: https://lore.kernel.org/oe-lkp/202305151017.27581d75-yujie.liu@intel.com Signed-off-by: Mathieu Desnoyers Reviewed-by: Aaron Lu Reviewed-by: John Hubbard Cc: Peter Zijlstra Cc: Olivier Dion Cc: Cc: Feng Tang Cc: Jason Gunthorpe Cc: Peter Xu Signed-off-by: Andrew Morton commit 025b7799b35d32e46988ba0614ea2f91b85d6375 Author: ZhangPeng Date: Fri Jun 16 14:30:30 2023 +0800 mm/memcg: remove return value of mem_cgroup_scan_tasks() No user checks the return value of mem_cgroup_scan_tasks(). Make the return value void. Link: https://lkml.kernel.org/r/20230616063030.977586-1-zhangpeng362@huawei.com Signed-off-by: ZhangPeng Cc: Johannes Weiner Cc: Kefeng Wang Cc: Michal Hocko Cc: Muchun Song Cc: Nanyong Sun Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit aa13779be6b7d1ce0e6ba96b400b351de6f1a326 Author: SeongJae Park Date: Thu Jun 15 18:33:22 2023 +0000 mm/damon/core-test: add a test for damon_set_attrs() Commit 5ff6e2fff88e ("mm/damon/core: fix divide error in damon_nr_accesses_to_accesses_bp()") fixed a bug by adding arguments validation in damon_set_attrs(). Add a unit test for the added validation to ensure the bug cannot occur again. Link: https://lkml.kernel.org/r/20230615183323.87561-1-sj@kernel.org Signed-off-by: SeongJae Park Reviewed-by: Kefeng Wang Signed-off-by: Andrew Morton commit 5d949953f841fd661a2a49df188426d5930ed723 Author: Vishal Moola (Oracle) Date: Tue Jun 13 19:13:12 2023 -0700 mm: remove is_longterm_pinnable_page() and reimplement folio_is_longterm_pinnable() folio_is_longterm_pinnable() already exists as a wrapper function. Now that the whole implementation of is_longterm_pinnable_page() can be implemented using folios, folio_is_longterm_pinnable() can be made its own standalone function - and we can remove is_longterm_pinnable_page(). Link: https://lkml.kernel.org/r/20230614021312.34085-6-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Lorenzo Stoakes Signed-off-by: Andrew Morton commit 503670ee6d0670e114a66b8cf2bcd3f71f53c2f7 Author: Vishal Moola (Oracle) Date: Tue Jun 13 19:13:11 2023 -0700 mm/gup.c: reorganize try_get_folio() try_get_folio() takes in a page, then chooses to do some folio operations based on the flags (either FOLL_GET or FOLL_PIN). We can rewrite this function to be more purpose oriented. After calling try_get_folio(), if neither FOLL_GET nor FOLL_PIN are set, warn and fail. If FOLL_GET is set we can return the result. If FOLL_GET is not set then FOLL_PIN is set, so we pin the folio. This change assists with folio conversions, and makes the function more readable. Link: https://lkml.kernel.org/r/20230614021312.34085-5-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit c9223a4aede774b0cea2a9944bc5dac48683e802 Author: Vishal Moola (Oracle) Date: Tue Jun 13 19:13:10 2023 -0700 mm/gup_test.c: convert verify_dma_pinned() to us folios verify_dma_pinned() checks that pages are dma-pinned. We can convert this to use folios. Link: https://lkml.kernel.org/r/20230614021312.34085-4-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Lorenzo Stoakes Signed-off-by: Andrew Morton commit 28fb54f6a2fd6cc471165cce1650a57dfbf49746 Author: Vishal Moola (Oracle) Date: Tue Jun 13 19:13:09 2023 -0700 mmzone: introduce folio_migratetype() Introduce folio_migratetype() as a folio equivalent for get_pageblock_migratetype(). This function intends to return the migratetype the folio is located in, hence the name choice. Link: https://lkml.kernel.org/r/20230614021312.34085-3-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 708ff4914dfb410761227a219c17c3e9dbd68c05 Author: Vishal Moola (Oracle) Date: Tue Jun 13 19:13:08 2023 -0700 mmzone: introduce folio_is_zone_movable() Patch series "Replace is_longterm_pinnable_page()", v2. This patchset introduces some more helper functions for the folio conversions, and converts all callers of is_longterm_pinnable_page() to use folios. This patch (of 5): Introduce folio_is_zone_movable() to act as a folio equivalent for is_zone_movable_page(). This is to assist in later folio conversions. Link: https://lkml.kernel.org/r/20230614021312.34085-1-vishal.moola@gmail.com Link: https://lkml.kernel.org/r/20230614021312.34085-2-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 452c03fdbed0d19f907c877a6a9edd226b1ebad9 Author: Marco Elver Date: Wed Jun 14 11:51:16 2023 +0200 kasan: add support for kasan.fault=panic_on_write KASAN's boot time kernel parameter 'kasan.fault=' currently supports 'report' and 'panic', which results in either only reporting bugs or also panicking on reports. However, some users may wish to have more control over when KASAN reports result in a kernel panic: in particular, KASAN reported invalid _writes_ are of special interest, because they have greater potential to corrupt random kernel memory or be more easily exploited. To panic on invalid writes only, introduce 'kasan.fault=panic_on_write', which allows users to choose to continue running on invalid reads, but panic only on invalid writes. Link: https://lkml.kernel.org/r/20230614095158.1133673-1-elver@google.com Signed-off-by: Marco Elver Reviewed-by: Alexander Potapenko Cc: Aleksandr Nogikh Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Jonathan Corbet Cc: Taras Madan Cc: Vincenzo Frascino Signed-off-by: Andrew Morton commit cb0551adf92dac140d0e0958b4aaa860348bedbb Author: Sergey Senozhatsky Date: Wed Jun 14 23:13:12 2023 +0900 zram: further limit recompression threshold Recompression threshold should be below huge-size-class watermark. Any object larger than huge-size-class is a "huge object" and occupies a whole physical page on the zsmalloc side, in other words it's incompressible, as far as zsmalloc is concerned. Link: https://lkml.kernel.org/r/20230614141338.3480029-1-senozhatsky@chromium.org Signed-off-by: Sergey Senozhatsky Suggested-by: Brian Geffon Acked-by: Brian Geffon Cc: Jens Axboe Cc: Minchan Kim Cc: Sergey Senozhatsky Signed-off-by: Andrew Morton commit 418fd29d9de53b143e28a07430e08dd414b74c3d Author: Domenico Cerasuolo Date: Wed Jun 14 16:31:22 2023 +0200 mm: zswap: invaldiate entry after writeback When an entry started writeback, it used to be invalidated with ref count logic alone, meaning that it would stay on the tree until all references were put. The problem with this behavior is that as soon as the writeback started, the ownership of the data held by the entry is passed to the swapcache and should not be left in zswap too. Currently there are no known issues because of this, but this change explicitly invalidates an entry that started writeback to reduce opportunities for future bugs. This patch is a follow up on the series titled "mm: zswap: move writeback LRU from zpool to zswap" + commit f090b7949768("mm: zswap: support exclusive loads"). Link: https://lkml.kernel.org/r/20230614143122.74471-1-cerasuolodomenico@gmail.com Signed-off-by: Domenico Cerasuolo Suggested-by: Johannes Weiner Acked-by: Johannes Weiner Cc: Dan Streetman Cc: Nhat Pham Cc: Seth Jennings Cc: Vitaly Wool Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 6c77b607ee26472fb945aa41734281c39d06d68f Author: Kefeng Wang Date: Wed Jun 14 22:36:12 2023 +0800 mm: kill lock|unlock_page_memcg() Since commit c7c3dec1c9db ("mm: rmap: remove lock_page_memcg()"), no more user, kill lock_page_memcg() and unlock_page_memcg(). Link: https://lkml.kernel.org/r/20230614143612.62575-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Johannes Weiner Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 399fd496c49b399ff9b6fc87fefadb66e156aa5e Author: Kassey Li Date: Tue Jun 13 17:25:33 2023 +0800 mm/page_owner/cma: show pfn in cma/page_owner with hex format cma: display pfn as well as pfn_to_page(pfn) page_owner: display pfn in hex rather than decimal Link: https://lkml.kernel.org/r/20230613092533.15449-1-quic_yingangl@quicinc.com Signed-off-by: Kassey Li Cc: Joonsoo Kim Cc: Minchan Kim Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 6d68f644b97c30c0d030696dfcbb375b07753ad3 Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:41 2023 +0100 buffer: convert block_truncate_page() to use a folio Support large folios in block_truncate_page() and avoid three hidden calls to compound_head(). [willy@infradead.org: fix check of filemap_grab_folio() return value] Link: https://lkml.kernel.org/r/ZItZOt+XxV12HtzL@casper.infradead.org Link: https://lkml.kernel.org/r/20230612210141.730128-15-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Bob Peterson Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit eee25182a80a8c86ed14af9b38205dc83ed274b5 Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:40 2023 +0100 buffer: use a folio in __find_get_block_slow() Saves a call to compound_head() and may be needed to support block size > PAGE_SIZE. Link: https://lkml.kernel.org/r/20230612210141.730128-14-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Bob Peterson Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit 08d84add43179db632869ad39daff1b99f0e667c Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:39 2023 +0100 buffer: convert link_dev_buffers to take a folio Its one caller already has a folio, so switch it to use the folio API. Removes a hidden call to compound_head(). Link: https://lkml.kernel.org/r/20230612210141.730128-13-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Bob Peterson Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit 6f24ce6bec835bef84dcd9490ffb2bca61d9f359 Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:38 2023 +0100 buffer: convert init_page_buffers() to folio_init_buffers() Use the folio API and pass the folio from both callers. Saves a hidden call to compound_head(). Link: https://lkml.kernel.org/r/20230612210141.730128-12-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Bob Peterson Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit 3c98a41cc2c03b7570fb3affb310b5123d2e9cbc Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:37 2023 +0100 buffer: convert grow_dev_page() to use a folio Get a folio from the page cache instead of a page, then use the folio API throughout. Removes a few calls to compound_head() and may be needed to support block size > PAGE_SIZE. Link: https://lkml.kernel.org/r/20230612210141.730128-11-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Bob Peterson Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit 4a9622f2fdaee84c373f3f285d898a3ea60ee9f2 Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:36 2023 +0100 buffer: convert page_zero_new_buffers() to folio_zero_new_buffers() Most of the callers already have a folio; convert reiserfs_write_end() to have a folio. Removes a couple of hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20230612210141.730128-10-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Bob Peterson Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit 8c6cb3e3d57ef3656716f1855be3dd810b518eab Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:35 2023 +0100 buffer: convert __block_commit_write() to take a folio This removes a hidden call to compound_head() inside __block_commit_write() and moves it to those callers which are still page based. Also make block_write_end() safe for large folios. Link: https://lkml.kernel.org/r/20230612210141.730128-9-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Bob Peterson Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit fe181377a23cce5987fc32f1877cfcd223561609 Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:34 2023 +0100 buffer: convert block_page_mkwrite() to use a folio If any page in a folio is dirtied, dirty the entire folio. Removes a number of hidden calls to compound_head() and references to page->mapping and page->index. Fixes a pre-existing bug where we could mark a folio as dirty if the file is truncated to a multiple of the page size just as we take the page fault. I don't believe this bug has any bad effect, it's just inefficient. Link: https://lkml.kernel.org/r/20230612210141.730128-8-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Bob Peterson Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit bb0ea5989c093c14b6d6af03eed4a4fd85c50a0b Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:33 2023 +0100 buffer: make block_write_full_page() handle large folios correctly Keep the interface as struct page, but work entirely on the folio internally. Removes several PAGE_SIZE assumptions and removes some references to page->index and page->mapping. Link: https://lkml.kernel.org/r/20230612210141.730128-7-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson Cc: Andreas Gruenbacher Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit 285e0fc95ab122285c123c41cdb198fff9bbb3b8 Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:32 2023 +0100 gfs2: support ludicrously large folios in gfs2_trans_add_databufs() We may someday support folios larger than 4GB, so use a size_t for the byte count within a folio to prevent unpleasant truncations. Link: https://lkml.kernel.org/r/20230612210141.730128-6-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson Reviewed-by: Andreas Gruenbacher Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit 53418a18fcbbb086dbfacbdd9b853c1071d3ec16 Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:31 2023 +0100 buffer: convert __block_write_full_page() to __block_write_full_folio() Remove nine hidden calls to compound_head() by using a folio instead of a page. Link: https://lkml.kernel.org/r/20230612210141.730128-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson Cc: Andreas Gruenbacher Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit c1401fd18ff874761b268dee669da0a3565aa99d Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:30 2023 +0100 gfs2: convert gfs2_write_jdata_page() to gfs2_write_jdata_folio() Add support for large folios and remove some accesses to page->mapping and page->index. Link: https://lkml.kernel.org/r/20230612210141.730128-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson Reviewed-by: Andreas Gruenbacher Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit d0cfcaee0aa52cc476918d50d0c9715a603a7e3e Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:29 2023 +0100 gfs2: pass a folio to __gfs2_jdata_write_folio() Remove a couple of folio->page conversions in the callers, and two calls to compound_head() in the function itself. Rename it from __gfs2_jdata_writepage() to __gfs2_jdata_write_folio(). Link: https://lkml.kernel.org/r/20230612210141.730128-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson Reviewed-by: Andreas Gruenbacher Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit c0ba597db9040797197e6472d90c9dcbd28daf55 Author: Matthew Wilcox (Oracle) Date: Mon Jun 12 22:01:28 2023 +0100 gfs2: use a folio inside gfs2_jdata_writepage() Patch series "gfs2/buffer folio changes for 6.5", v3. This kind of started off as a gfs2 patch series, then became entwined with buffer heads once I realised that gfs2 was the only remaining caller of __block_write_full_page(). For those not in the gfs2 world, the big point of this series is that block_write_full_page() should now handle large folios correctly. This patch (of 14): Replace a few implicit calls to compound_head() with one explicit one. Link: https://lkml.kernel.org/r/20230612210141.730128-1-willy@infradead.org Link: https://lkml.kernel.org/r/20230612210141.730128-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson Reviewed-by: Andreas Gruenbacher Cc: Andreas Gruenbacher Cc: Hannes Reinecke Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit e1ad3e66676479d6a0af6be953767f865c902111 Author: Nick Desaulniers Date: Fri Jun 9 16:44:45 2023 -0700 mm/khugepaged: use DEFINE_READ_MOSTLY_HASHTABLE macro These are equivalent, but DEFINE_READ_MOSTLY_HASHTABLE exists to define a hashtable in the .data..read_mostly section. Link: https://lkml.kernel.org/r/20230609-khugepage-v1-1-dad4e8382298@google.com Signed-off-by: Nick Desaulniers Reviewed-by: Yang Shi Signed-off-by: Andrew Morton commit 3a6358c0dbe6a286a4f4504ba392a6039a9fbd12 Author: Yu Ma Date: Fri Jun 9 23:07:30 2023 -0400 percpu-internal/pcpu_chunk: re-layout pcpu_chunk structure to reduce false sharing When running UnixBench/Execl throughput case, false sharing is observed due to frequent read on base_addr and write on free_bytes, chunk_md. UnixBench/Execl represents a class of workload where bash scripts are spawned frequently to do some short jobs. It will do system call on execl frequently, and execl will call mm_init to initialize mm_struct of the process. mm_init will call __percpu_counter_init for percpu_counters initialization. Then pcpu_alloc is called to read the base_addr of pcpu_chunk for memory allocation. Inside pcpu_alloc, it will call pcpu_alloc_area to allocate memory from a specified chunk. This function will update "free_bytes" and "chunk_md" to record the rest free bytes and other meta data for this chunk. Correspondingly, pcpu_free_area will also update these 2 members when free memory. Call trace from perf is as below: + 57.15% 0.01% execl [kernel.kallsyms] [k] __percpu_counter_init + 57.13% 0.91% execl [kernel.kallsyms] [k] pcpu_alloc - 55.27% 54.51% execl [kernel.kallsyms] [k] osq_lock - 53.54% 0x654278696e552f34 main __execve entry_SYSCALL_64_after_hwframe do_syscall_64 __x64_sys_execve do_execveat_common.isra.47 alloc_bprm mm_init __percpu_counter_init pcpu_alloc - __mutex_lock.isra.17 In current pcpu_chunk layout, `base_addr' is in the same cache line with `free_bytes' and `chunk_md', and `base_addr' is at the last 8 bytes. This patch moves `bound_map' up to `base_addr', to let `base_addr' locate in a new cacheline. With this change, on Intel Sapphire Rapids 112C/224T platform, based on v6.4-rc4, the 160 parallel score improves by 24%. The pcpu_chunk struct is a backing data structure per chunk, so the additional memory should not be dramatic. A chunk covers ballpark between 64kb and 512kb memory depending on some config and boot time stuff, so I believe the additional memory used here is nominal at best. Working the #s on my desktop: Percpu: 58624 kB 28 cores -> ~2.1MB of percpu memory. At say ~128KB per chunk -> 33 chunks, generously 40 chunks. Adding alignment might bump the chunk size ~64 bytes, so in total ~2KB of overhead? I believe we can do a little better to avoid eating that full padding, so likely less than that. [dennis@kernel.org: changelog details] Link: https://lkml.kernel.org/r/20230610030730.110074-1-yu.ma@intel.com Signed-off-by: Yu Ma Reviewed-by: Tim Chen Acked-by: Dennis Zhou Cc: Dan Williams Cc: Dave Hansen Cc: Liam R. Howlett Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 33ee4f185827d99fd0957ab3cea00b2266fc5abc Author: Miaohe Lin Date: Sat Jun 10 11:41:14 2023 +0800 memory tier: remove unneeded !IS_ENABLED(CONFIG_MIGRATION) check establish_demotion_targets() is defined while CONFIG_MIGRATION is enabled. There's no need to check it again. Link: https://lkml.kernel.org/r/20230610034114.981861-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Yang Shi Signed-off-by: Andrew Morton commit 833dfc0090b3f8017ddac82d818b2d8e5ceb61db Author: Miaohe Lin Date: Sat Jun 10 11:46:15 2023 +0800 mm: compaction: mark kcompactd_run() and kcompactd_stop() __meminit Add __meminit to kcompactd_run() and kcompactd_stop() to ensure they're default to __init when memory hotplug is not enabled. Link: https://lkml.kernel.org/r/20230610034615.997813-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Baolin Wang Signed-off-by: Andrew Morton commit e4d86756159b5794edad5b0d0d19c6f3d9888240 Author: YueHaibing Date: Sat Jun 10 18:19:56 2023 +0800 mm: remove unused vma_init_lock() commit c7f8f31c00d1 ("mm: separate vma->lock from vm_area_struct") left this behind. Link: https://lkml.kernel.org/r/20230610101956.20592-1-yuehaibing@huawei.com Signed-off-by: YueHaibing Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton commit 3efd33b75358185ac9f45cfc189e20712be3570b Author: YueHaibing Date: Sat Jun 10 18:28:58 2023 +0800 kernel: pid_namespace: remove unused set_memfd_noexec_scope() This inline function is unused, remove it. Link: https://lkml.kernel.org/r/20230610102858.31488-1-yuehaibing@huawei.com Signed-off-by: YueHaibing Cc: Jeff Xu Cc: Kees Cook Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit 65ac132027a884c411b8f9f96d240ba2dde34dec Author: Liam R. Howlett Date: Wed May 31 21:54:02 2023 -0400 userfaultfd: fix regression in userfaultfd_unmap_prep() Android reported a performance regression in the userfaultfd unmap path. A closer inspection on the userfaultfd_unmap_prep() change showed that a second tree walk would be necessary in the reworked code. Fix the regression by passing each VMA that will be unmapped through to the userfaultfd_unmap_prep() function as they are added to the unmap list, instead of re-walking the tree for the VMA. Link: https://lkml.kernel.org/r/20230601015402.2819343-1-Liam.Howlett@oracle.com Fixes: 69dbe6daf104 ("userfaultfd: use maple tree iterator to iterate VMAs") Signed-off-by: Liam R. Howlett Reported-by: Suren Baghdasaryan Suggested-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 1e3be4856f49d55c60b6cd500297b06acfe216a9 Author: Tarun Sahu Date: Mon Jun 12 15:05:14 2023 +0530 mm/folio: replace set_compound_order with folio_set_order The patch ("mm/folio: Avoid special handling for order value 0 in folio_set_order") [1] removed the need for special handling of order = 0 in folio_set_order. Now, folio_set_order and set_compound_order becomes similar function. This patch removes the set_compound_order and uses folio_set_order instead. [1] https://lore.kernel.org/all/20230609183032.13E08C433D2@smtp.kernel.org/ Link: https://lkml.kernel.org/r/20230612093514.689846-1-tsahu@linux.ibm.com Signed-off-by: Tarun Sahu Reviewed-by Sidhartha Kumar Reviewed-by: Muchun Song Cc: Aneesh Kumar K.V Cc: Gerald Schaefer Cc: Matthew Wilcox Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 0bb488498c989e0d912d38b624df31922027c8c5 Author: Domenico Cerasuolo Date: Mon Jun 12 11:38:15 2023 +0200 mm: zswap: remove zswap_header Previously, zswap_header served the purpose of storing the swpentry within zpool pages. This allowed zpool implementations to pass relevant information to the writeback function. However, with the current implementation, writeback is directly handled within zswap. Consequently, there is no longer a necessity for zswap_header, as the swp_entry_t can be stored directly in zswap_entry. Link: https://lkml.kernel.org/r/20230612093815.133504-8-cerasuolodomenico@gmail.com Signed-off-by: Domenico Cerasuolo Tested-by: Yosry Ahmed Suggested-by: Yosry Ahmed Acked-by: Johannes Weiner Cc: Dan Streetman Cc: Minchan Kim Cc: Nhat Pham Cc: Sergey Senozhatsky Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton commit ff9d5ba202f98db53da98330b46b68a9228c63e4 Author: Domenico Cerasuolo Date: Mon Jun 12 11:38:14 2023 +0200 mm: zswap: simplify writeback function zswap_writeback_entry() used to be a callback for the backends, which don't know about struct zswap_entry. Now that the only user is the generic zswap LRU reclaimer, it can be simplified: pass the pinned zswap_entry directly, and consolidate the refcount management in the shrink function. Link: https://lkml.kernel.org/r/20230612093815.133504-7-cerasuolodomenico@gmail.com Signed-off-by: Domenico Cerasuolo Tested-by: Yosry Ahmed Acked-by: Johannes Weiner Cc: Dan Streetman Cc: Minchan Kim Cc: Nhat Pham Cc: Sergey Senozhatsky Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton commit 35499e2b79ffc51ea704c3268a5830164825a43e Author: Domenico Cerasuolo Date: Mon Jun 12 11:38:13 2023 +0200 mm: zswap: remove shrink from zpool interface Now that all three zswap backends have removed their shrink code, it is no longer necessary for the zpool interface to include shrink/writeback endpoints. Link: https://lkml.kernel.org/r/20230612093815.133504-6-cerasuolodomenico@gmail.com Signed-off-by: Domenico Cerasuolo Reviewed-by: Yosry Ahmed Acked-by: Nhat Pham Acked-by: Johannes Weiner Reviewed-by: Sergey Senozhatsky Cc: Dan Streetman Cc: Minchan Kim Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton commit b3067742ae36b36b959835a33937c4dc458f8183 Author: Domenico Cerasuolo Date: Mon Jun 12 11:38:12 2023 +0200 mm: zswap: remove page reclaim logic from zsmalloc Switch zsmalloc to the new generic zswap LRU and remove its custom implementation. Link: https://lkml.kernel.org/r/20230612093815.133504-5-cerasuolodomenico@gmail.com Signed-off-by: Domenico Cerasuolo Acked-by: Johannes Weiner Acked-by: Nhat Pham Acked-by: Minchan Kim Tested-by: Yosry Ahmed Acked-by: Sergey Senozhatsky Cc: Dan Streetman Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton commit e774a7bc7f0adba785d814ce9a329b6c5c32706a Author: Domenico Cerasuolo Date: Mon Jun 12 11:38:11 2023 +0200 mm: zswap: remove page reclaim logic from z3fold Switch z3fold to the new generic zswap LRU and remove its custom implementation. Link: https://lkml.kernel.org/r/20230612093815.133504-4-cerasuolodomenico@gmail.com Signed-off-by: Domenico Cerasuolo Acked-by: Johannes Weiner Cc: Dan Streetman Cc: Minchan Kim Cc: Nhat Pham Cc: Sergey Senozhatsky Cc: Seth Jennings Cc: Vitaly Wool Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 1be537c6451b7203776063a8655c9096ebc50790 Author: Domenico Cerasuolo Date: Mon Jun 12 11:38:10 2023 +0200 mm: zswap: remove page reclaim logic from zbud Switch zbud to the new generic zswap LRU and remove its custom implementation. Link: https://lkml.kernel.org/r/20230612093815.133504-3-cerasuolodomenico@gmail.com Signed-off-by: Domenico Cerasuolo Acked-by: Johannes Weiner Cc: Dan Streetman Cc: Minchan Kim Cc: Nhat Pham Cc: Sergey Senozhatsky Cc: Seth Jennings Cc: Vitaly Wool Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit f999f38b4e6f6fd444acdc289a156ad781919a9c Author: Domenico Cerasuolo Date: Mon Jun 12 11:38:09 2023 +0200 mm: zswap: add pool shrinking mechanism Patch series "mm: zswap: move writeback LRU from zpool to zswap", v3. This series aims to improve the zswap reclaim mechanism by reorganizing the LRU management. In the current implementation, the LRU is maintained within each zpool driver, resulting in duplicated code across the three drivers. The proposed change consists in moving the LRU management from the individual implementations up to the zswap layer. The primary objective of this refactoring effort is to simplify the codebase. By unifying the reclaim loop and consolidating LRU handling within zswap, we can eliminate redundant code and improve maintainability. Additionally, this change enables the reclamation of stored pages in their actual LRU order. Presently, the zpool drivers link backing pages in an LRU, causing compressed pages with different LRU positions to be written back simultaneously. The series consists of several patches. The first patch implements the LRU and the reclaim loop in zswap, but it is not used yet because all three driver implementations are marked as zpool_evictable. The following three commits modify each zpool driver to be not zpool_evictable, allowing the use of the reclaim loop in zswap. As the drivers removed their shrink functions, the zpool interface is then trimmed by removing zpool_evictable, zpool_ops, and zpool_shrink. Finally, the code in zswap is further cleaned up by simplifying the writeback function and removing the now unnecessary zswap_header. This patch (of 7): Each zpool driver (zbud, z3fold and zsmalloc) implements its own shrink function, which is called from zpool_shrink. However, with this commit, a unified shrink function is added to zswap. The ultimate goal is to eliminate the need for zpool_shrink once all zpool implementations have dropped their shrink code. To ensure the functionality of each commit, this change focuses solely on adding the mechanism itself. No modifications are made to the backends, meaning that functionally, there are no immediate changes. The zswap mechanism will only come into effect once the backends have removed their shrink code. The subsequent commits will address the modifications needed in the backends. Link: https://lkml.kernel.org/r/20230612093815.133504-1-cerasuolodomenico@gmail.com Link: https://lkml.kernel.org/r/20230612093815.133504-2-cerasuolodomenico@gmail.com Signed-off-by: Domenico Cerasuolo Acked-by: Nhat Pham Tested-by: Yosry Ahmed Acked-by: Johannes Weiner Reviewed-by: Yosry Ahmed Reviewed-by: Sergey Senozhatsky Cc: Dan Streetman Cc: Minchan Kim Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton commit 0183d777c29ab12c2b0c19f3d4f5c6df016815fb Author: Muhammad Usama Anjum Date: Mon Jun 12 14:53:47 2023 +0500 selftests: mm: remove duplicate unneeded defines Remove all defines which aren't needed after correctly including the kernel header files. Link: https://lkml.kernel.org/r/20230612095347.996335-2-usama.anjum@collabora.com Signed-off-by: Muhammad Usama Anjum Cc: David Hildenbrand Cc: Shuah Khan Cc: Stefan Roesch Signed-off-by: Andrew Morton commit 1e6d1e3645603bc9c9985dd6a437f22d06960b2d Author: Muhammad Usama Anjum Date: Mon Jun 12 14:53:46 2023 +0500 selftests: mm: remove wrong kernel header inclusion It is wrong to include unprocessed user header files directly. They are processed to "/usr/include" by running "make headers" and they are included in selftests by kselftest makefiles automatically with help of KHDR_INCLUDES variable. These headers should always bulilt first before building kselftests. Link: https://lkml.kernel.org/r/20230612095347.996335-1-usama.anjum@collabora.com Fixes: 07115fcc15b4 ("selftests/mm: add new selftests for KSM") Signed-off-by: Muhammad Usama Anjum Acked-by: David Hildenbrand Cc: Shuah Khan Cc: Stefan Roesch Signed-off-by: Andrew Morton commit c33c794828f21217f72ce6fc140e0d34e0d56bff Author: Ryan Roberts Date: Mon Jun 12 16:15:45 2023 +0100 mm: ptep_get() conversion Convert all instances of direct pte_t* dereferencing to instead use ptep_get() helper. This means that by default, the accesses change from a C dereference to a READ_ONCE(). This is technically the correct thing to do since where pgtables are modified by HW (for access/dirty) they are volatile and therefore we should always ensure READ_ONCE() semantics. But more importantly, by always using the helper, it can be overridden by the architecture to fully encapsulate the contents of the pte. Arch code is deliberately not converted, as the arch code knows best. It is intended that arch code (arm64) will override the default with its own implementation that can (e.g.) hide certain bits from the core code, or determine young/dirty status by mixing in state from another source. Conversion was done using Coccinelle: ---- // $ make coccicheck \ // COCCI=ptepget.cocci \ // SPFLAGS="--include-headers" \ // MODE=patch virtual patch @ depends on patch @ pte_t *v; @@ - *v + ptep_get(v) ---- Then reviewed and hand-edited to avoid multiple unnecessary calls to ptep_get(), instead opting to store the result of a single call in a variable, where it is correct to do so. This aims to negate any cost of READ_ONCE() and will benefit arch-overrides that may be more complex. Included is a fix for an issue in an earlier version of this patch that was pointed out by kernel test robot. The issue arose because config MMU=n elides definition of the ptep helper functions, including ptep_get(). HUGETLB_PAGE=n configs still define a simple huge_ptep_clear_flush() for linking purposes, which dereferences the ptep. So when both configs are disabled, this caused a build error because ptep_get() is not defined. Fix by continuing to do a direct dereference when MMU=n. This is safe because for this config the arch code cannot be trying to virtualize the ptes because none of the ptep helpers are defined. Link: https://lkml.kernel.org/r/20230612151545.3317766-4-ryan.roberts@arm.com Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202305120142.yXsNEo6H-lkp@intel.com/ Signed-off-by: Ryan Roberts Cc: Adrian Hunter Cc: Alexander Potapenko Cc: Alexander Shishkin Cc: Alex Williamson Cc: Al Viro Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Christian Brauner Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Dave Airlie Cc: Dimitri Sivanich Cc: Dmitry Vyukov Cc: Ian Rogers Cc: Jason Gunthorpe Cc: Jérôme Glisse Cc: Jiri Olsa Cc: Johannes Weiner Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Mark Rutland Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Muchun Song Cc: Namhyung Kim Cc: Naoya Horiguchi Cc: Oleksandr Tyshchenko Cc: Pavel Tatashin Cc: Roman Gushchin Cc: SeongJae Park Cc: Shakeel Butt Cc: Uladzislau Rezki (Sony) Cc: Vincenzo Frascino Cc: Yu Zhao Signed-off-by: Andrew Morton commit 6c1d2a073a1d850e79026411e79dff7ef997c90d Author: Ryan Roberts Date: Mon Jun 12 16:15:44 2023 +0100 mm: move ptep_get() and pmdp_get() helpers There are many call sites that directly dereference a pte_t pointer. This makes it very difficult to properly encapsulate a page table in the arch code without having to allocate shadow page tables. We will shortly solve this by replacing all the call sites with ptep_get() calls. But there are call sites above the function definition in the header file, so let's move ptep_get() to an earlier location to solve that problem. And move pmdp_get() at the same time to keep it close to ptep_get(). Link: https://lkml.kernel.org/r/20230612151545.3317766-3-ryan.roberts@arm.com Signed-off-by: Ryan Roberts Cc: Adrian Hunter Cc: Alexander Potapenko Cc: Alexander Shishkin Cc: Alex Williamson Cc: Al Viro Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Christian Brauner Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Dave Airlie Cc: Dimitri Sivanich Cc: Dmitry Vyukov Cc: Ian Rogers Cc: Jason Gunthorpe Cc: Jérôme Glisse Cc: Jiri Olsa Cc: Johannes Weiner Cc: kernel test robot Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Mark Rutland Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Muchun Song Cc: Namhyung Kim Cc: Naoya Horiguchi Cc: Oleksandr Tyshchenko Cc: Pavel Tatashin Cc: Roman Gushchin Cc: SeongJae Park Cc: Shakeel Butt Cc: Uladzislau Rezki (Sony) Cc: Vincenzo Frascino Cc: Yu Zhao Signed-off-by: Andrew Morton commit 426931e7e5d96664616794c7c36efc748a7497e2 Author: Ryan Roberts Date: Mon Jun 12 16:15:43 2023 +0100 mm: ptdump should use ptep_get_lockless() Patch series "Encapsulate PTE contents from non-arch code", v3. A series to improve the encapsulation of pte entries by disallowing non-arch code from directly dereferencing pte_t pointers. This means that by default, the accesses change from a C dereference to a READ_ONCE(). This is technically the correct thing to do since where pgtables are modified by HW (for access/dirty) they are volatile and therefore we should always ensure READ_ONCE() semantics. But more importantly, by always using the helper, it can be overridden by the architecture to fully encapsulate the contents of the pte. Arch code is deliberately not converted, as the arch code knows best. It is intended that arch code (arm64) will override the default with its own implementation that can (e.g.) hide certain bits from the core code, or determine young/dirty status by mixing in state from another source. This patch (of 3): The page table dumper uses walk_page_range_novma() to walk the page tables, which does not lock the PTL before calling the pte_entry() callback. Therefore, the page table dumper's callback must use ptep_get_lockless() rather than ptep_get() to ensure that the pte it reads is not torn or otherwise corrupt when racing with writers. Link: https://lkml.kernel.org/r/20230612151545.3317766-1-ryan.roberts@arm.com Link: https://lkml.kernel.org/r/20230612151545.3317766-2-ryan.roberts@arm.com Signed-off-by: Ryan Roberts Cc: Adrian Hunter Cc: Alexander Potapenko Cc: Alexander Shishkin Cc: Alex Williamson Cc: Al Viro Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Christian Brauner Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Dave Airlie Cc: Dimitri Sivanich Cc: Dmitry Vyukov Cc: Ian Rogers Cc: Jason Gunthorpe Cc: Jérôme Glisse Cc: Jiri Olsa Cc: Johannes Weiner Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Mark Rutland Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Muchun Song Cc: Namhyung Kim Cc: Naoya Horiguchi Cc: Oleksandr Tyshchenko Cc: Pavel Tatashin Cc: Roman Gushchin Cc: SeongJae Park Cc: Shakeel Butt Cc: Uladzislau Rezki (Sony) Cc: Vincenzo Frascino Cc: Yu Zhao Cc: kernel test robot Signed-off-by: Andrew Morton commit e6926a4d1c9bfe12814c7c81acd57346285cd7ba Author: Catalin Marinas Date: Tue Jun 13 16:52:45 2023 +0100 sh: move the ARCH_DMA_MINALIGN definition to asm/cache.h The sh architecture defines ARCH_DMA_MINALIGN in asm/page.h. Move it to asm/cache.h to allow a generic ARCH_DMA_MINALIGN definition in linux/cache.h without redefine errors/warnings. Link: https://lkml.kernel.org/r/20230613155245.1228274-4-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Cc: Yoshinori Sato Cc: Rich Felker Cc: John Paul Adrian Glaubitz Cc: Christophe Leroy Cc: kernel test robot Cc: Michael Ellerman Cc: Michal Simek Cc: Nicholas Piggin Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 4ea57ce42886adb0129605f23a0cf0809271a524 Author: Catalin Marinas Date: Tue Jun 13 16:52:44 2023 +0100 microblaze: move the ARCH_{DMA,SLAB}_MINALIGN definitions to asm/cache.h The microblaze architecture defines ARCH_DMA_MINALIGN in asm/page.h. Move it to asm/cache.h to allow a generic ARCH_DMA_MINALIGN definition in linux/cache.h without redefine errors/warnings. While at it, also move ARCH_SLAB_MINALIGN to asm/cache.h for consistency. Link: https://lkml.kernel.org/r/20230613155245.1228274-3-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Cc: Michal Simek Cc: Christophe Leroy Cc: John Paul Adrian Glaubitz Cc: kernel test robot Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Rich Felker Cc: Vlastimil Babka Cc: Yoshinori Sato Signed-off-by: Andrew Morton commit 78615c4ddb73bd4a7f13ec4bab60b974b8fc6faa Author: Catalin Marinas Date: Tue Jun 13 16:52:43 2023 +0100 powerpc: move the ARCH_DMA_MINALIGN definition to asm/cache.h Patch series "Move the ARCH_DMA_MINALIGN definition to asm/cache.h". The ARCH_KMALLOC_MINALIGN reduction series defines a generic ARCH_DMA_MINALIGN in linux/cache.h: https://lore.kernel.org/r/20230612153201.554742-2-catalin.marinas@arm.com/ Unfortunately, this causes a duplicate definition warning for microblaze, powerpc (32-bit only) and sh as these architectures define ARCH_DMA_MINALIGN in a different file than asm/cache.h. Move the macro to asm/cache.h to avoid this issue and also bring them in line with the other architectures. This patch (of 3): The powerpc architecture defines ARCH_DMA_MINALIGN in asm/page_32.h and only if CONFIG_NOT_COHERENT_CACHE is enabled (32-bit platforms only). Move this macro to asm/cache.h to allow a generic ARCH_DMA_MINALIGN definition in linux/cache.h without redefine errors/warnings. Link: https://lkml.kernel.org/r/20230613155245.1228274-1-catalin.marinas@arm.com Link: https://lkml.kernel.org/r/20230613155245.1228274-2-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306131053.1ybvRRhO-lkp@intel.com/ Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: John Paul Adrian Glaubitz Cc: Michal Simek Cc: Rich Felker Cc: Vlastimil Babka Cc: Yoshinori Sato Signed-off-by: Andrew Morton commit 1c1a429efd4ee8ca244cc2401365c983cda4ed76 Author: Catalin Marinas Date: Mon Jun 12 16:32:01 2023 +0100 arm64: enable ARCH_WANT_KMALLOC_DMA_BOUNCE for arm64 With the DMA bouncing of unaligned kmalloc() buffers now in place, enable it for arm64 to allow the kmalloc-{8,16,32,48,96} caches. In addition, always create the swiotlb buffer even when the end of RAM is within the 32-bit physical address range (the swiotlb buffer can still be disabled on the kernel command line). Link: https://lkml.kernel.org/r/20230612153201.554742-18-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Tested-by: Isaac J. Manjarres Cc: Will Deacon Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Robin Murphy Cc: Saravana Kannan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit b035f5a6d8521bc77448d1c61db6244d91da3325 Author: Catalin Marinas Date: Mon Jun 12 16:32:00 2023 +0100 mm: slab: reduce the kmalloc() minimum alignment if DMA bouncing possible If an architecture opted in to DMA bouncing of unaligned kmalloc() buffers (ARCH_WANT_KMALLOC_DMA_BOUNCE), reduce the minimum kmalloc() cache alignment below cache-line size to ARCH_KMALLOC_MINALIGN. Link: https://lkml.kernel.org/r/20230612153201.554742-17-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Reviewed-by: Vlastimil Babka Tested-by: Isaac J. Manjarres Cc: Christoph Hellwig Cc: Robin Murphy Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Saravana Kannan Cc: Will Deacon Signed-off-by: Andrew Morton commit 861370f49ce484cd6ef2e9b3ad06d137f3cb0ca3 Author: Catalin Marinas Date: Mon Jun 12 16:31:59 2023 +0100 iommu/dma: force bouncing if the size is not cacheline-aligned Similarly to the direct DMA, bounce small allocations as they may have originated from a kmalloc() cache not safe for DMA. Unlike the direct DMA, iommu_dma_map_sg() cannot call iommu_dma_map_sg_swiotlb() for all non-coherent devices as this would break some cases where the iova is expected to be contiguous (dmabuf). Instead, scan the scatterlist for any small sizes and only go the swiotlb path if any element of the list needs bouncing (note that iommu_dma_map_page() would still only bounce those buffers which are not DMA-aligned). To avoid scanning the scatterlist on the 'sync' operations, introduce an SG_DMA_SWIOTLB flag set by iommu_dma_map_sg_swiotlb(). The dev_use_swiotlb() function together with the newly added dev_use_sg_swiotlb() now check for both untrusted devices and unaligned kmalloc() buffers (suggested by Robin Murphy). Link: https://lkml.kernel.org/r/20230612153201.554742-16-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Reviewed-by: Robin Murphy Tested-by: Isaac J. Manjarres Cc: Joerg Roedel Cc: Christoph Hellwig Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Saravana Kannan Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 370645f41e6e2fdd2fb6f6982530b04612c9793c Author: Catalin Marinas Date: Mon Jun 12 16:31:58 2023 +0100 dma-mapping: force bouncing if the kmalloc() size is not cache-line-aligned For direct DMA, if the size is small enough to have originated from a kmalloc() cache below ARCH_DMA_MINALIGN, check its alignment against dma_get_cache_alignment() and bounce if necessary. For larger sizes, it is the responsibility of the DMA API caller to ensure proper alignment. At this point, the kmalloc() caches are properly aligned but this will change in a subsequent patch. Architectures can opt in by selecting DMA_BOUNCE_UNALIGNED_KMALLOC. Link: https://lkml.kernel.org/r/20230612153201.554742-15-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Reviewed-by: Christoph Hellwig Reviewed-by: Robin Murphy Tested-by: Isaac J. Manjarres Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Saravana Kannan Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit cb147bbe22d2be9b49021c2e5dacdf2935745d1c Author: Robin Murphy Date: Mon Jun 12 16:31:57 2023 +0100 dma-mapping: name SG DMA flag helpers consistently sg_is_dma_bus_address() is inconsistent with the naming pattern of its corresponding setters and its own kerneldoc, so take the majority vote and rename it sg_dma_is_bus_address() (and fix up the missing underscores in the kerneldoc too). This gives us a nice clear pattern where SG DMA flags are SG_DMA_, and the helpers for acting on them are sg_dma__(). Link: https://lkml.kernel.org/r/20230612153201.554742-14-catalin.marinas@arm.com Signed-off-by: Robin Murphy Signed-off-by: Catalin Marinas Reviewed-by: Christoph Hellwig Reviewed-by: Jerry Snitselaar Reviewed-by: Logan Gunthorpe Link: https://lore.kernel.org/r/fa2eca2862c7ffc41b50337abffb2dfd2864d3ea.1685036694.git.robin.murphy@arm.com Tested-by: Isaac J. Manjarres Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Saravana Kannan Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit af2880ec44021d32cc72a5aa7c5d7d7beaa722d3 Author: Robin Murphy Date: Mon Jun 12 16:31:56 2023 +0100 scatterlist: add dedicated config for DMA flags The DMA flags field will be useful for users beyond PCI P2P, so upgrade to its own dedicated config option. [catalin.marinas@arm.com: use #ifdef CONFIG_NEED_SG_DMA_FLAGS in scatterlist.h] [catalin.marinas@arm.com: update PCI_P2PDMA dma_flags comment in scatterlist.h] Link: https://lkml.kernel.org/r/20230612153201.554742-13-catalin.marinas@arm.com Signed-off-by: Robin Murphy Signed-off-by: Catalin Marinas Reviewed-by: Christoph Hellwig Tested-by: Isaac J. Manjarres Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Saravana Kannan Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 9382bc44b5f58ccee375f08f518e53c0280051dc Author: Catalin Marinas Date: Mon Jun 12 16:31:55 2023 +0100 arm64: allow kmalloc() caches aligned to the smaller cache_line_size() On arm64, ARCH_DMA_MINALIGN is 128, larger than the cache line size on most of the current platforms (typically 64). Define ARCH_KMALLOC_MINALIGN to 8 (the default for architectures without their own ARCH_DMA_MINALIGN) and override dma_get_cache_alignment() to return cache_line_size(), probed at run-time. The kmalloc() caches will be limited to the cache line size. This will allow the additional kmalloc-{64,192} caches on most arm64 platforms. Link: https://lkml.kernel.org/r/20230612153201.554742-12-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Tested-by: Isaac J. Manjarres Cc: Will Deacon Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Robin Murphy Cc: Saravana Kannan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 88b216d339691888ef98644a5eae62c3d9c8ddf0 Author: Catalin Marinas Date: Mon Jun 12 16:31:54 2023 +0100 iio: core: use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN represents the minimum (static) alignment for safe DMA operations while ARCH_KMALLOC_MINALIGN is the minimum kmalloc() objects alignment. Link: https://lkml.kernel.org/r/20230612153201.554742-11-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Acked-by: Jonathan Cameron Tested-by: Isaac J. Manjarres Cc: Lars-Peter Clausen Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Robin Murphy Cc: Saravana Kannan Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 7bc757140f07ee28cfc70767f5d5bf9f78c621fe Author: Catalin Marinas Date: Mon Jun 12 16:31:53 2023 +0100 dm-crypt: use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN represents the minimum (static) alignment for safe DMA operations while ARCH_KMALLOC_MINALIGN is the minimum kmalloc() objects alignment. Link: https://lkml.kernel.org/r/20230612153201.554742-10-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Tested-by: Isaac J. Manjarres Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: "Rafael J. Wysocki" Cc: Robin Murphy Cc: Saravana Kannan Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 3cbbb41049accbf2f6f6e79f6870f39b116cd585 Author: Catalin Marinas Date: Mon Jun 12 16:31:52 2023 +0100 drivers/spi: use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN represents the minimum (static) alignment for safe DMA operations while ARCH_KMALLOC_MINALIGN is the minimum kmalloc() objects alignment. Link: https://lkml.kernel.org/r/20230612153201.554742-9-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Acked-by: Mark Brown Tested-by: Isaac J. Manjarres Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Robin Murphy Cc: Saravana Kannan Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 075efe7c1656932f60384fed36ed05a79c6b114b Author: Catalin Marinas Date: Mon Jun 12 16:31:51 2023 +0100 drivers/usb: use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN represents the minimum (static) alignment for safe DMA operations while ARCH_KMALLOC_MINALIGN is the minimum kmalloc() objects alignment. Link: https://lkml.kernel.org/r/20230612153201.554742-8-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Acked-by: Greg Kroah-Hartman Tested-by: Isaac J. Manjarres Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Robin Murphy Cc: Saravana Kannan Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 6716ccaf43e0fe2e759b84eb1cef4c684873a847 Author: Catalin Marinas Date: Mon Jun 12 16:31:50 2023 +0100 drivers/gpu: use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN represents the minimum (static) alignment for safe DMA operations while ARCH_KMALLOC_MINALIGN is the minimum kmalloc() objects alignment. Link: https://lkml.kernel.org/r/20230612153201.554742-7-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Tested-by: Isaac J. Manjarres Cc: Daniel Vetter Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Robin Murphy Cc: Saravana Kannan Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit be6a5b5e9e47a7402083d931e18d594338f1849a Author: Catalin Marinas Date: Mon Jun 12 16:31:49 2023 +0100 drivers/base: use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN represents the minimum (static) alignment for safe DMA operations while ARCH_KMALLOC_MINALIGN is the minimum kmalloc() objects alignment. Link: https://lkml.kernel.org/r/20230612153201.554742-6-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Acked-by: Greg Kroah-Hartman Tested-by: Isaac J. Manjarres Cc: "Rafael J. Wysocki" Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: Robin Murphy Cc: Saravana Kannan Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 963e84b0f262297466dff440ccfbb868ecb971b3 Author: Catalin Marinas Date: Mon Jun 12 16:31:48 2023 +0100 mm/slab: limit kmalloc() minimum alignment to dma_get_cache_alignment() Do not create kmalloc() caches which are not aligned to dma_get_cache_alignment(). There is no functional change since for current architectures defining ARCH_DMA_MINALIGN, ARCH_KMALLOC_MINALIGN equals ARCH_DMA_MINALIGN (and dma_get_cache_alignment()). On architectures without a specific ARCH_DMA_MINALIGN, dma_get_cache_alignment() is 1, so no change to the kmalloc() caches. Link: https://lkml.kernel.org/r/20230612153201.554742-5-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Reviewed-by: Vlastimil Babka Tested-by: Isaac J. Manjarres Cc: Christoph Hellwig Cc: Robin Murphy Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Saravana Kannan Cc: Will Deacon Signed-off-by: Andrew Morton commit 0c474d31a6378f20cbe83f62d4177ebdc099c7fc Author: Catalin Marinas Date: Mon Jun 12 16:31:47 2023 +0100 mm/slab: simplify create_kmalloc_cache() args and make it static In the slab variant of kmem_cache_init(), call new_kmalloc_cache() instead of initialising the kmalloc_caches array directly. With this, create_kmalloc_cache() is now only called from new_kmalloc_cache() in the same file, so make it static. In addition, the useroffset argument is always 0 while usersize is the same as size. Remove them. Link: https://lkml.kernel.org/r/20230612153201.554742-4-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Reviewed-by: Vlastimil Babka Tested-by: Isaac J. Manjarres Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Robin Murphy Cc: Saravana Kannan Cc: Will Deacon Signed-off-by: Andrew Morton commit 8c57da28dc3df4e091474a004b5596c9b88a3be0 Author: Catalin Marinas Date: Mon Jun 12 16:31:46 2023 +0100 dma: allow dma_get_cache_alignment() to be overridden by the arch code On arm64, ARCH_DMA_MINALIGN is larger than most cache line size configurations deployed. Allow an architecture to override dma_get_cache_alignment() in order to return a run-time probed value (e.g. cache_line_size()). Link: https://lkml.kernel.org/r/20230612153201.554742-3-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Reviewed-by: Christoph Hellwig Tested-by: Isaac J. Manjarres Cc: Robin Murphy Cc: Will Deacon Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Jerry Snitselaar Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: "Rafael J. Wysocki" Cc: Saravana Kannan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 4ab5f8ec7d71aea5fe13a48248242130f84ac6bb Author: Catalin Marinas Date: Mon Jun 12 16:31:45 2023 +0100 mm/slab: decouple ARCH_KMALLOC_MINALIGN from ARCH_DMA_MINALIGN Patch series "mm, dma, arm64: Reduce ARCH_KMALLOC_MINALIGN to 8", v7. A series reducing the kmalloc() minimum alignment on arm64 to 8 (from 128). This patch (of 17): In preparation for supporting a kmalloc() minimum alignment smaller than the arch DMA alignment, decouple the two definitions. This requires that either the kmalloc() caches are aligned to a (run-time) cache-line size or the DMA API bounces unaligned kmalloc() allocations. Subsequent patches will implement both options. After this patch, ARCH_DMA_MINALIGN is expected to be used in static alignment annotations and defined by an architecture to be the maximum alignment for all supported configurations/SoCs in a single Image. Architectures opting in to a smaller ARCH_KMALLOC_MINALIGN will need to define its value in the arch headers. Since ARCH_DMA_MINALIGN is now always defined, adjust the #ifdef in dma_get_cache_alignment() so that there is no change for architectures not requiring a minimum DMA alignment. Link: https://lkml.kernel.org/r/20230612153201.554742-1-catalin.marinas@arm.com Link: https://lkml.kernel.org/r/20230612153201.554742-2-catalin.marinas@arm.com Signed-off-by: Catalin Marinas Tested-by: Isaac J. Manjarres Cc: Vlastimil Babka Cc: Christoph Hellwig Cc: Robin Murphy Cc: Alasdair Kergon Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Joerg Roedel Cc: Jonathan Cameron Cc: Marc Zyngier Cc: Mark Brown Cc: Mike Snitzer Cc: Rafael J. Wysocki Cc: Saravana Kannan Cc: Will Deacon Cc: Jerry Snitselaar Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Logan Gunthorpe Signed-off-by: Andrew Morton commit 349d1670008d3dab99a11b015bef51ad3f26fb4f Author: Peter Xu Date: Mon Jun 12 12:04:20 2023 -0400 mm/hugetlb: fix pgtable lock on pmd sharing Huge pmd sharing operates on PUD not PMD, huge_pte_lock() is not suitable in this case because it should only work for last level pte changes, while pmd sharing is always one level higher. Meanwhile, here we're locking over the spte pgtable lock which is even not a lock for current mm but someone else's. It seems even racy on operating on the lock, as after put_page() of the spte pgtable page logically the page can be released, so at least the spin_unlock() needs to be done after the put_page(). No report I am aware, I'm not even sure whether it'll just work on taking the spte pmd lock, because while we're holding i_mmap read lock it probably means the vma interval tree is frozen, all pte allocators over this pud entry could always find the specific svma and spte page, so maybe they'll serialize on this spte page lock? Even so, doesn't seem to be expected. It just seems to be an accident of cb900f412154. Fix it with the proper pud lock (which is the mm's page_table_lock). Link: https://lkml.kernel.org/r/20230612160420.809818-1-peterx@redhat.com Fixes: cb900f412154 ("mm, hugetlb: convert hugetlbfs to use split pmd lock") Signed-off-by: Peter Xu Reviewed-by: Mike Kravetz Cc: Naoya Horiguchi Signed-off-by: Andrew Morton commit b95826c9aa48b2997b3973b42a8716ba132b920e Author: Sidhartha Kumar Date: Mon Jun 12 09:34:05 2023 -0700 mm: remove set_compound_page_dtor() All users can use the folio equivalent so this function can be safely removed. Link: https://lkml.kernel.org/r/20230612163405.99345-1-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Cc: Aneesh Kumar K.V Cc: Matthew Wilcox Cc: Tarun Sahu Signed-off-by: Andrew Morton commit a92cbb82c8d375d47fbaf0e1ad3fd4074a7cb156 Author: Hugh Dickins Date: Thu Jun 8 18:53:23 2023 -0700 perf/core: allow pte_offset_map() to fail In rare transient cases, not yet made possible, pte_offset_map() and pte_offet_map_lock() may not find a page table: handle appropriately. [hughd@google.com: __wp_page_copy_user(): don't call update_mmu_tlb() with NULL] Link: https://lkml.kernel.org/r/1a4db221-7872-3594-57ce-42369945ec8d@google.com Link: https://lkml.kernel.org/r/a194441b-63f3-adb6-5964-7ca3171ae7c2@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 4f8fcf4ced0b7184149045818dcc2f9e2689b775 Author: Hugh Dickins Date: Thu Jun 8 18:52:17 2023 -0700 mm/swap: swap_vma_readahead() do the pte_offset_map() swap_vma_readahead() has been proceeding in an unconventional way, its preliminary swap_ra_info() doing the pte_offset_map() and pte_unmap(), then relying on that pte pointer even after the pte_unmap() - in its CONFIG_64BIT case (I think !CONFIG_HIGHPTE was intended; whereas 32-bit copied ptes to stack while they were mapped, but had to limit how many). Though it would be difficult to construct a failing testcase, accessing page table after pte_unmap() will become bad practice, even on 64-bit: an rcu_read_unlock() in pte_unmap() will allow page table to be freed. Move relevant definitions from include/linux/swap.h to mm/swap_state.c, nothing else used them. Delete the CONFIG_64BIT distinction and buffer, delete all reference to ptes from swap_ra_info(), use pte_offset_map() repeatedly in swap_vma_readahead(), breaking from the loop if it fails. (Will the repeated "map" and "unmap" show up as a slowdown anywhere? If so, maybe modify __read_swap_cache_async() to do the pte_unmap() only when it does not find the page already in the swapcache.) Use ptep_get_lockless(), mainly for its READ_ONCE(). Correctly advance the address passed down to each call of __read__swap_cache_async(). Link: https://lkml.kernel.org/r/b7c64ab3-9e44-aac0-d2b-c57de578af1c@google.com Signed-off-by: Hugh Dickins Reviewed-by: "Huang, Ying" Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit feda5c393a6c843c7bf1fc49e1381e2d3822b564 Author: Hugh Dickins Date: Thu Jun 8 18:50:37 2023 -0700 mm/pgtable: delete pmd_trans_unstable() and friends Delete pmd_trans_unstable, pmd_none_or_trans_huge_or_clear_bad() and pmd_devmap_trans_unstable(), all now unused. With mixed feelings, delete all the comments on pmd_trans_unstable(). That was very good documentation of a subtle state, and this series does not even eliminate that state: but rather, normalizes and extends it, asking pte_offset_map[_lock]() callers to anticipate failure, without regard for whether mmap_read_lock() or mmap_write_lock() is held. Retain pud_trans_unstable(), which has one use in __handle_mm_fault(), but delete its equivalent pud_none_or_trans_huge_or_dev_or_clear_bad(). While there, move the default arch_needs_pgtable_deposit() definition up near where pgtable_trans_huge_deposit() and withdraw() are declared. Link: https://lkml.kernel.org/r/5abdab3-3136-b42e-274d-9c6281bfb79@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit c7ad08804fae5baa7f71c0790038e8259e1066a5 Author: Hugh Dickins Date: Thu Jun 8 18:45:05 2023 -0700 mm/memory: handle_pte_fault() use pte_offset_map_nolock() handle_pte_fault() use pte_offset_map_nolock() to get the vmf.ptl which corresponds to vmf.pte, instead of pte_lockptr() being used later, when there's a chance that the pmd entry might have changed, perhaps to none, or to a huge pmd, with no split ptlock in its struct page. Remove its pmd_devmap_trans_unstable() call: pte_offset_map_nolock() will handle that case by failing. Update the "morph" comment above, looking forward to when shmem or file collapse to THP may not take mmap_lock for write (or not at all). do_numa_page() use the vmf->ptl from handle_pte_fault() at first, but refresh it when refreshing vmf->pte. do_swap_page()'s pte_unmap_same() (the thing that takes ptl to verify a two-part PAE orig_pte) use the vmf->ptl from handle_pte_fault() too; but do_swap_page() is also used by anon THP's __collapse_huge_page_swapin(), so adjust that to set vmf->ptl by pte_offset_map_nolock(). Link: https://lkml.kernel.org/r/c1107654-3929-60ac-223e-6877cbb86065@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 3db82b9374ca921b8b820a75e83809d5c4133d8f Author: Hugh Dickins Date: Thu Jun 8 18:43:38 2023 -0700 mm/memory: allow pte_offset_map[_lock]() to fail copy_pte_range(): use pte_offset_map_nolock(), and allow for it to fail; but with a comment on some further assumptions that are being made there. zap_pte_range() and zap_pmd_range(): adjust their interaction so that a pte_offset_map_lock() failure in zap_pte_range() leads to a retry in zap_pmd_range(); remove call to pmd_none_or_trans_huge_or_clear_bad(). Allow pte_offset_map_lock() to fail in many functions. Update comment on calling pte_alloc() in do_anonymous_page(). Remove redundant calls to pmd_trans_unstable(), pmd_devmap_trans_unstable(), pmd_none() and pmd_bad(); but leave pmd_none_or_clear_bad() calls in free_pmd_range() and copy_pmd_range(), those do simplify the next level down. Link: https://lkml.kernel.org/r/bb548d50-e99a-f29e-eab1-a43bef2a1287@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 895f5ee464cc90a5f38163720431c849e93ead97 Author: Hugh Dickins Date: Thu Jun 8 18:42:40 2023 -0700 mm/khugepaged: allow pte_offset_map[_lock]() to fail __collapse_huge_page_swapin(): don't drop the map after every pte, it only has to be dropped by do_swap_page(); give up if pte_offset_map() fails; trace_mm_collapse_huge_page_swapin() at the end, with result; fix comment on returned result; fix vmf.pgoff, though it's not used. collapse_huge_page(): use pte_offset_map_lock() on the _pmd returned from clearing; allow failure, but it should be impossible there. hpage_collapse_scan_pmd() and collapse_pte_mapped_thp() allow for pte_offset_map_lock() failure. Link: https://lkml.kernel.org/r/6513e85-d798-34ec-3762-7c24ffb9329@google.com Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit c9c1ee20ee84b1a827437ca6dba2f06fe475d9b1 Author: Hugh Dickins Date: Thu Jun 8 18:41:31 2023 -0700 mm/huge_memory: split huge pmd under one pte_offset_map() __split_huge_zero_page_pmd() use a single pte_offset_map() to sweep the extent: it's already under pmd_lock(), so this is no worse for latency; and since it's supposed to have full control of the just-withdrawn page table, here choose to VM_BUG_ON if it were to fail. And please don't increment haddr by PAGE_SIZE, that should remain huge aligned: declare a separate addr (not a bugfix, but it was deceptive). __split_huge_pmd_locked() likewise (but it had declared a separate addr); and change its BUG_ON(!pte_none) to VM_BUG_ON, for consistency with zero (those deposited page tables are sometimes victims of random corruption). Link: https://lkml.kernel.org/r/90cbed7f-90d9-b779-4a46-d2485baf9595@google.com Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 2378118bd9da1d96d8569ff675183e2cf8973799 Author: Hugh Dickins Date: Thu Jun 8 18:39:59 2023 -0700 mm/gup: remove FOLL_SPLIT_PMD use of pmd_trans_unstable() There is now no reason for follow_pmd_mask()'s FOLL_SPLIT_PMD block to distinguish huge_zero_page from a normal THP: follow_page_pte() handles any instability, and here it's a good idea to replace any pmd_none(*pmd) by a page table a.s.a.p, in the huge_zero_page case as for a normal THP; and this removes an unnecessary possibility of -EBUSY failure. (Hmm, couldn't the normal THP case have hit an unstably refaulted THP before? But there are only two, exceptional, users of FOLL_SPLIT_PMD.) Link: https://lkml.kernel.org/r/59fd15dd-4d39-5ec-2043-1d5117f7f85@google.com Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 4b56069c95d69bfce0c0ffb2531d08216268a972 Author: Hugh Dickins Date: Thu Jun 8 18:38:17 2023 -0700 mm/migrate_device: allow pte_offset_map_lock() to fail migrate_vma_collect_pmd(): remove the pmd_trans_unstable() handling after splitting huge zero pmd, and the pmd_none() handling after successfully splitting huge page: those are now managed inside pte_offset_map_lock(), and by "goto again" when it fails. But the skip after unsuccessful split_huge_page() must stay: it avoids an endless loop. The skip when pmd_bad()? Remove that: it will be treated as a hole rather than a skip once cleared by pte_offset_map_lock(), but with different timing that would be so anyway; and it's arguably best to leave the pmd_bad() handling centralized there. migrate_vma_insert_page(): remove comment on the old pte_offset_map() and old locking limitations; remove the pmd_trans_unstable() check and just proceed to pte_offset_map_lock(), aborting when it fails (page has been charged to memcg, but as in other cases, it's uncharged when freed). Link: https://lkml.kernel.org/r/1131be62-2e84-da2f-8f45-807b2cbeeec5@google.com Signed-off-by: Hugh Dickins Reviewed-by: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 52fc048320adf1b1c07a2627461dca9f7d7956ff Author: Hugh Dickins Date: Thu Jun 8 18:37:12 2023 -0700 mm/mglru: allow pte_offset_map_nolock() to fail MGLRU's walk_pte_range() use the safer pte_offset_map_nolock(), rather than pte_lockptr(), to get the ptl for its trylock. Just return false and move on to next extent if it fails, like when the trylock fails. Remove the VM_WARN_ON_ONCE(pmd_leaf) since that will happen, rarely. Link: https://lkml.kernel.org/r/51ece73e-7398-2e4a-2384-56708c87844f@google.com Signed-off-by: Hugh Dickins Acked-by: Yu Zhao Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Zack Rusin Signed-off-by: Andrew Morton commit d850fa729873787a4030eed5fd875d00eb63946b Author: Hugh Dickins Date: Thu Jun 8 18:36:11 2023 -0700 mm/swapoff: allow pte_offset_map[_lock]() to fail Adjust unuse_pte() and unuse_pte_range() to allow pte_offset_map_lock() and pte_offset_map() failure; remove pmd_none_or_trans_huge_or_clear_bad() from unuse_pmd_range() now that pte_offset_map() does all that itself. Link: https://lkml.kernel.org/r/c4d831-13c3-9dfd-70c2-64514ad951fd@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 179d3e4f3bfa5947821c1b1bc6aa49a4797b7f21 Author: Hugh Dickins Date: Thu Jun 8 18:35:14 2023 -0700 mm/madvise: clean up force_shm_swapin_readahead() Some nearby MADV_WILLNEED cleanup unrelated to pte_offset_map_lock(). shmem_swapin_range() is a better name than force_shm_swapin_readahead(). Fix unimportant off-by-one on end_index. Call the swp_entry_t "entry" rather than "swap": either is okay, but entry is the name used elsewhere in mm/madvise.c. Do not assume GFP_HIGHUSER_MOVABLE: that's right for anon swap, but shmem should take gfp from mapping. Pass the actual vma and address to read_swap_cache_async(), in case a NUMA mempolicy applies. lru_add_drain() at outer level, like madvise_willneed()'s other branch. Link: https://lkml.kernel.org/r/67e18875-ffb3-ec27-346-f350e07bed87@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit f3cd4ab0aabf0c7f25ad438b37954db970174731 Author: Hugh Dickins Date: Thu Jun 8 18:34:03 2023 -0700 mm/madvise: clean up pte_offset_map_lock() scans Came here to make madvise's several pte_offset_map_lock() scans advance to next extent on failure, and remove superfluous pmd_trans_unstable() and pmd_none_or_trans_huge_or_clear_bad() calls. But also did some nearby cleanup. swapin_walk_pmd_entry(): don't name an address "index"; don't drop the lock after every pte, only when calling out to read_swap_cache_async(). madvise_cold_or_pageout_pte_range() and madvise_free_pte_range(): prefer "start_pte" for pointer, orig_pte usually denotes a saved pte value; leave lazy MMU mode before unlocking; merge the success and failure paths after split_folio(). Link: https://lkml.kernel.org/r/cc4d9a88-9da6-362-50d9-6735c2b125c6@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit a5be621ee2925b6ee2db455c45c2af2d8a195b0c Author: Hugh Dickins Date: Thu Jun 8 18:32:47 2023 -0700 mm/mremap: retry if either pte_offset_map_*lock() fails move_ptes() return -EAGAIN if pte_offset_map_lock() of old fails, or if pte_offset_map_nolock() of new fails: move_page_tables() retry if so. But that does need a pmd_none() check inside, to stop endless loop when huge shmem is truncated (thank you to syzbot); and move_huge_pmd() must tolerate that a page table might have been allocated there just before (of course it would be more satisfying to remove the empty page table, but this is not a path worth optimizing). Link: https://lkml.kernel.org/r/65e5e84a-f04-947-23f2-b97d3462e1e@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 670ddd8cdcbd1d07a4571266ae3517f821728c3a Author: Hugh Dickins Date: Thu Jun 8 18:30:48 2023 -0700 mm/mprotect: delete pmd_none_or_clear_bad_unless_trans_huge() change_pmd_range() had special pmd_none_or_clear_bad_unless_trans_huge(), required to avoid "bad" choices when setting automatic NUMA hinting under mmap_read_lock(); but most of that is already covered in pte_offset_map() now. change_pmd_range() just wants a pmd_none() check before wasting time on MMU notifiers, then checks on the read-once _pmd value to work out what's needed for huge cases. If change_pte_range() returns -EAGAIN to retry if pte_offset_map_lock() fails, nothing more special is needed. Link: https://lkml.kernel.org/r/725a42a9-91e9-c868-925-e3a5fd40bb4f@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 04dee9e85cf50a2f24738e456d66b88de109b806 Author: Hugh Dickins Date: Thu Jun 8 18:29:22 2023 -0700 mm/various: give up if pte_offset_map[_lock]() fails Following the examples of nearby code, various functions can just give up if pte_offset_map() or pte_offset_map_lock() fails. And there's no need for a preliminary pmd_trans_unstable() or other such check, since such cases are now safely handled inside. Link: https://lkml.kernel.org/r/7b9bd85d-1652-cbf2-159d-f503b45e5b@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 9f2bad096d2f84751fd4559fcd4cdda1a2af1976 Author: Hugh Dickins Date: Thu Jun 8 18:27:52 2023 -0700 mm/debug_vm_pgtable,page_table_check: warn pte map fails Failures here would be surprising: pte_advanced_tests() and pte_clear_tests() and __page_table_check_pte_clear_range() each issue a warning if pte_offset_map() or pte_offset_map_lock() fails. Link: https://lkml.kernel.org/r/3ea9e4f-e5cf-d7d9-4c2-291b3c5a3636@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 3622d3cde30898c1b6eafde281c122b994718c58 Author: Hugh Dickins Date: Thu Jun 8 18:26:04 2023 -0700 mm/userfaultfd: allow pte_offset_map_lock() to fail mfill_atomic_install_pte() and mfill_atomic_pte_zeropage() treat failed pte_offset_map_lock() as -EAGAIN, which mfill_atomic() already returns to user for a similar race. Link: https://lkml.kernel.org/r/50cf3930-1bfa-4de9-a079-3da47b7ce17b@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 2b683a4ff6ee091d5764ad867fbfae65f80cfefb Author: Hugh Dickins Date: Thu Jun 8 18:24:38 2023 -0700 mm/userfaultfd: retry if pte_offset_map() fails Instead of worrying whether the pmd is stable, userfaultfd_must_wait() call pte_offset_map() as before, but go back to try again if that fails. Risk of endless loop? It already broke out if pmd_none(), !pmd_present() or pmd_trans_huge(), and pte_offset_map() would have cleared pmd_bad(): which leaves pmd_devmap(). Presumably pmd_devmap() is inappropriate in a vma subject to userfaultfd (it would have been mistreated before), but add a check just to avoid all possibility of endless loop there. Link: https://lkml.kernel.org/r/54423f-3dff-fd8d-614a-632727cc4cfb@google.com Signed-off-by: Hugh Dickins Acked-by: Peter Xu Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 6ec1905f6ec7f9f79ca3eaeaf04584b4dcddd743 Author: Hugh Dickins Date: Thu Jun 8 18:23:19 2023 -0700 mm/hmm: retry if pte_offset_map() fails hmm_vma_walk_pmd() is called through mm_walk, but already has a goto again loop of its own, so take part in that if pte_offset_map() fails. Link: https://lkml.kernel.org/r/d6c6dd68-25d4-653b-f94b-a45c53ee04b@google.com Signed-off-by: Hugh Dickins Reviewed-by: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 0d1c81edc61e553ed7a5db18fb8074c8b78e1538 Author: Hugh Dickins Date: Thu Jun 8 18:21:41 2023 -0700 mm/vmalloc: vmalloc_to_page() use pte_offset_kernel() vmalloc_to_page() was using pte_offset_map() (followed by pte_unmap()), but it's intended for userspace page tables: prefer pte_offset_kernel(). Link: https://lkml.kernel.org/r/696386a-84f8-b33c-82e5-f865ed6eb39@google.com Signed-off-by: Hugh Dickins Reviewed-by: Lorenzo Stoakes Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit e5ad581c7f1c32d309ae4e895eea0cd1a3d9f363 Author: Hugh Dickins Date: Thu Jun 8 18:20:04 2023 -0700 mm/vmwgfx: simplify pmd & pud mapping dirty helpers wp_clean_pmd_entry() need not check pmd_trans_unstable() or pmd_none(), wp_clean_pud_entry() need not check pud_trans_unstable() or pud_none(): it's just the ACTION_CONTINUE when trans_huge or devmap that's needed to prevent splitting, and we're hoping to remove pmd_trans_unstable(). Is that PUD #ifdef necessary? Maybe some configs are missing a stub. Link: https://lkml.kernel.org/r/d3379c7-65db-26d3-1764-8e866490925f@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit be872f83bf571f4f9a0ac25e2c9c36e905a36619 Author: Hugh Dickins Date: Thu Jun 8 18:18:49 2023 -0700 mm/pagewalk: walk_pte_range() allow for pte_offset_map() walk_pte_range() has a no_vma option to serve walk_page_range_novma(). I don't know of any problem, but it looks safer to check for init_mm, and use pte_offset_kernel() rather than pte_offset_map() in that case: pte_offset_map()'s pmdval validation is intended for userspace. Allow for its pte_offset_map() or pte_offset_map_lock() to fail, and retry with ACTION_AGAIN if so. Add a second check for ACTION_AGAIN in walk_pmd_range(), to catch it after return from walk_pte_range(). Remove the pmd_trans_unstable() check after split_huge_pmd() in walk_pmd_range(): walk_pte_range() now handles those cases safely (and they must fail powerpc's is_hugepd() check). Link: https://lkml.kernel.org/r/3eba6f0-2b-fb66-6bb6-2ee8533e221@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 7780d04046a2288ab85d88bedacc60fa4fad9971 Author: Hugh Dickins Date: Thu Jun 8 18:17:26 2023 -0700 mm/pagewalkers: ACTION_AGAIN if pte_offset_map_lock() fails Simple walk_page_range() users should set ACTION_AGAIN to retry when pte_offset_map_lock() fails. No need to check pmd_trans_unstable(): that was precisely to avoid the possiblity of calling pte_offset_map() on a racily removed or inserted THP entry, but such cases are now safely handled inside it. Likewise there is no need to check pmd_none() or pmd_bad() before calling it. Link: https://lkml.kernel.org/r/c77d9d10-3aad-e3ce-4896-99e91c7947f3@google.com Signed-off-by: Hugh Dickins Reviewed-by: SeongJae Park for mm/damon part Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 2798bbe75b9c2752b46d292e5c2a49f49da36418 Author: Hugh Dickins Date: Thu Jun 8 18:15:43 2023 -0700 mm/page_vma_mapped: pte_offset_map_nolock() not pte_lockptr() map_pte() use pte_offset_map_nolock(), to make sure of the ptl belonging to pte, even if pmd entry is then changed racily: page_vma_mapped_walk() use that instead of getting pte_lockptr() later, or restart if map_pte() found no page table. Link: https://lkml.kernel.org/r/cba186e0-5ed7-e81b-6cd-dade4c33c248@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 90f43b0a13cddb09e2686f4d976751c0a9b8b197 Author: Hugh Dickins Date: Thu Jun 8 18:14:12 2023 -0700 mm/page_vma_mapped: reformat map_pte() with less indentation No functional change here, but adjust the format of map_pte() so that the following commit will be easier to read: separate out the PVMW_SYNC case first, and remove two levels of indentation from the ZONE_DEVICE case. Link: https://lkml.kernel.org/r/bf723f59-e3fc-6839-1cc3-c0631ee248bc@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 45fe85e9811ede2d65b21724cae50d6a0563e452 Author: Hugh Dickins Date: Thu Jun 8 18:12:52 2023 -0700 mm/page_vma_mapped: delete bogosity in page_vma_mapped_walk() Revert commit a7a69d8ba88d ("mm/thp: another PVMW_SYNC fix in page_vma_mapped_walk()"): I was proud of that "Aha!" commit at the time, but in revisiting page_vma_mapped_walk() for pte_offset_map() failure, that block raised a doubt: and it now seems utterly bogus. The prior map_pte() has taken ptl unconditionally when PVMW_SYNC: I must have forgotten that when making the change. It did no harm, but could not have fixed a BUG or WARN, and is hard to reconcile with coming changes. Link: https://lkml.kernel.org/r/87475a22-e59e-2d8b-d78a-df376d314bd@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 65747aaf42b7db6acb8e57a2b8e9959928f404dd Author: Hugh Dickins Date: Thu Jun 8 18:11:29 2023 -0700 mm/filemap: allow pte_offset_map_lock() to fail filemap_map_pages() allow pte_offset_map_lock() to fail; and remove the pmd_devmap_trans_unstable() check from filemap_map_pmd(), which can safely return to filemap_map_pages() and let pte_offset_map_lock() discover that. Link: https://lkml.kernel.org/r/54607cf4-ddb6-7ef3-043-1d2de1a9a71@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 0d940a9b270b9220dcff74d8e9123c9788365751 Author: Hugh Dickins Date: Thu Jun 8 18:10:32 2023 -0700 mm/pgtable: allow pte_offset_map[_lock]() to fail Make pte_offset_map() a wrapper for __pte_offset_map() (optionally outputs pmdval), pte_offset_map_lock() a sparse __cond_lock wrapper for __pte_offset_map_lock(): those __funcs added in mm/pgtable-generic.c. __pte_offset_map() do pmdval validation (including pmd_clear_bad() when pmd_bad()), returning NULL if pmdval is not for a page table. __pte_offset_map_lock() verify pmdval unchanged after getting the lock, trying again if it changed. No #ifdef CONFIG_TRANSPARENT_HUGEPAGE around them: that could be done to cover the imminent case, but we expect to generalize it later, and it makes a mess of where to do the pmd_bad() clearing. Add pte_offset_map_nolock(): outputs ptl like pte_offset_map_lock(), without actually taking the lock. This will be preferred to open uses of pte_lockptr(), because (when split ptlock is in page table's struct page) it points to the right lock for the returned pte pointer, even if *pmd gets changed racily afterwards. Update corresponding Documentation. Do not add the anticipated rcu_read_lock() and rcu_read_unlock()s yet: they have to wait until all architectures are balancing pte_offset_map()s with pte_unmap()s (as in the arch series posted earlier). But comment where they will go, so that it's easy to add them for experiments. And only when those are in place can transient racy failure cases be enabled. Add more safety for the PAE mismatched pmd_low pmd_high case at that time. Link: https://lkml.kernel.org/r/2929bfd-9893-a374-e463-4c3127ff9b9d@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 46c475bd676bb05077c8a38b37f175552f035406 Author: Hugh Dickins Date: Thu Jun 8 18:09:25 2023 -0700 mm/pgtable: kmap_local_page() instead of kmap_atomic() pte_offset_map() was still using kmap_atomic(): update it to the preferred kmap_local_page() before making further changes there, in case we need this as a bisection point; but I doubt it can cause any trouble. Link: https://lkml.kernel.org/r/d74dc4b3-6a76-446f-8f5-52ae271fa07d@google.com Signed-off-by: Hugh Dickins Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 0cb8fd4d14165a7e654048e43983d86f75b90879 Author: Hugh Dickins Date: Thu Jun 8 18:08:20 2023 -0700 mm/migrate: remove cruft from migration_entry_wait()s migration_entry_wait_on_locked() does not need to take a mapped pte pointer, its callers can do the unmap first. Annotate it with __releases(ptl) to reduce sparse warnings. Fold __migration_entry_wait_huge() into migration_entry_wait_huge(). Fold __migration_entry_wait() into migration_entry_wait(), preferring the tighter pte_offset_map_lock() to pte_offset_map() and pte_lockptr(). Link: https://lkml.kernel.org/r/b0e2a532-cdf2-561b-e999-f3b13b8d6d3@google.com Signed-off-by: Hugh Dickins Reviewed-by: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Xu Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Yu Zhao Cc: Zack Rusin Signed-off-by: Andrew Morton commit 26e1a0c3277d7f43856ec424902423be212cc178 Author: Hugh Dickins Date: Thu Jun 8 18:06:53 2023 -0700 mm: use pmdp_get_lockless() without surplus barrier() Patch series "mm: allow pte_offset_map[_lock]() to fail", v2. What is it all about? Some mmap_lock avoidance i.e. latency reduction. Initially just for the case of collapsing shmem or file pages to THPs; but likely to be relied upon later in other contexts e.g. freeing of empty page tables (but that's not work I'm doing). mmap_write_lock avoidance when collapsing to anon THPs? Perhaps, but again that's not work I've done: a quick attempt was not as easy as the shmem/file case. I would much prefer not to have to make these small but wide-ranging changes for such a niche case; but failed to find another way, and have heard that shmem MADV_COLLAPSE's usefulness is being limited by that mmap_write_lock it currently requires. These changes (though of course not these exact patches) have been in Google's data centre kernel for three years now: we do rely upon them. What is this preparatory series about? The current mmap locking will not be enough to guard against that tricky transition between pmd entry pointing to page table, and empty pmd entry, and pmd entry pointing to huge page: pte_offset_map() will have to validate the pmd entry for itself, returning NULL if no page table is there. What to do about that varies: sometimes nearby error handling indicates just to skip it; but in many cases an ACTION_AGAIN or "goto again" is appropriate (and if that risks an infinite loop, then there must have been an oops, or pfn 0 mistaken for page table, before). Given the likely extension to freeing empty page tables, I have not limited this set of changes to a THP config; and it has been easier, and sets a better example, if each site is given appropriate handling: even where deeper study might prove that failure could only happen if the pmd table were corrupted. Several of the patches are, or include, cleanup on the way; and by the end, pmd_trans_unstable() and suchlike are deleted: pte_offset_map() and pte_offset_map_lock() then handle those original races and more. Most uses of pte_lockptr() are deprecated, with pte_offset_map_nolock() taking its place. This patch (of 32): Use pmdp_get_lockless() in preference to READ_ONCE(*pmdp), to get a more reliable result with PAE (or READ_ONCE as before without PAE); and remove the unnecessary extra barrier()s which got left behind in its callers. HOWEVER: Note the small print in linux/pgtable.h, where it was designed specifically for fast GUP, and depends on interrupts being disabled for its full guarantee: most callers which have been added (here and before) do NOT have interrupts disabled, so there is still some need for caution. Link: https://lkml.kernel.org/r/f35279a9-9ac0-de22-d245-591afbfb4dc@google.com Signed-off-by: Hugh Dickins Acked-by: Yu Zhao Acked-by: Peter Xu Cc: Alistair Popple Cc: Anshuman Khandual Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox Cc: Mel Gorman Cc: Miaohe Lin Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Qi Zheng Cc: Ralph Campbell Cc: Ryan Roberts Cc: SeongJae Park Cc: Song Liu Cc: Steven Price Cc: Suren Baghdasaryan Cc: Thomas Hellström Cc: Will Deacon Cc: Yang Shi Cc: Zack Rusin Signed-off-by: Andrew Morton commit 7b1798ec9836670d221dcc162dc18f8b64e959e5 Author: Anders Roxell Date: Wed Apr 12 11:28:54 2023 +0200 selftests: damon: add config file Building and running the subsuite 'damon' of kselftest, shows the following issues: selftests: damon: debugfs_attrs.sh /sys/kernel/debug/damon not found By creating a config file enabling DAMON fragments in the selftests/damon/ directory the tests pass. Link: https://lkml.kernel.org/r/20230412092854.3306197-1-anders.roxell@linaro.org Fixes: b348eb7abd09 ("mm/damon: add user space selftests") Signed-off-by: Anders Roxell Reported-by: Naresh Kamboju Reviewed-by: SeongJae Park Acked-by: Shuah Khan Signed-off-by: Andrew Morton commit 0e4bc271110e0c58c010071a9bbf150f39851dac Author: Lu Hongfei Date: Fri Jun 9 17:30:57 2023 +0800 mm/vmalloc: replace the ternary conditional operator with min() It would be better to replace the traditional ternary conditional operator with min() in zero_iter Link: https://lkml.kernel.org/r/20230609093057.27777-1-luhongfei@vivo.com Signed-off-by: Lu Hongfei Reviewed-by: Lorenzo Stoakes Reviewed-by: David Hildenbrand Cc: Christoph Hellwig Cc: Uladzislau Rezki (Sony) Signed-off-by: Andrew Morton commit e3b7bf972d632288ccad95b116628e3141be676e Author: Tarun Sahu Date: Fri Jun 9 21:59:07 2023 +0530 mm/folio: avoid special handling for order value 0 in folio_set_order folio_set_order(folio, 0) is used in kernel at two places __destroy_compound_gigantic_folio and __prep_compound_gigantic_folio. Currently, It is called to clear out the folio->_folio_nr_pages and folio->_folio_order. For __destroy_compound_gigantic_folio: In past, folio_set_order(folio, 0) was needed because page->mapping used to overlap with _folio_nr_pages and _folio_order. So if these fields were left uncleared during freeing gigantic hugepages, they were causing "BUG: bad page state" due to non-zero page->mapping. Now, After Commit a01f43901cfb ("hugetlb: be sure to free demoted CMA pages to CMA") page->mapping has explicitly been cleared out for tail pages. Also, _folio_order and _folio_nr_pages no longer overlaps with page->mapping. So, folio_set_order(folio, 0) can be removed from freeing gigantic folio path (__destroy_compound_gigantic_folio). Another place, folio_set_order(folio, 0) is called inside __prep_compound_gigantic_folio during error path. Here, folio_set_order(folio, 0) can also be removed if we move folio_set_order(folio, order) after for loop. The patch also moves _folio_set_head call in __prep_compound_gigantic_folio() such that we avoid clearing them in the error path. Also, as Mike pointed out: "It would actually be better to move the calls _folio_set_head and folio_set_order in __prep_compound_gigantic_folio() as suggested here. Why? In the current code, the ref count on the 'head page' is still 1 (or more) while those calls are made. So, someone could take a speculative ref on the page BEFORE the tail pages are set up." This way, folio_set_order(folio, 0) is no more needed. And it will also helps removing the confusion of folio order being set to 0 (as _folio_order field is part of first tail page). Testing: I have run LTP tests, which all passes. and also I have written the test in LTP which tests the bug caused by compound_nr and page->mapping overlapping. https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c Running on older kernel ( < 5.10-rc7) with the above bug this fails while on newer kernel and, also with this patch it passes. Link: https://lkml.kernel.org/r/20230609162907.111756-1-tsahu@linux.ibm.com Signed-off-by: Tarun Sahu Reviewed-by: Mike Kravetz Cc: Aneesh Kumar K.V Cc: Gerald Schaefer Cc: Matthew Wilcox Cc: Muchun Song Cc: Sidhartha Kumar Signed-off-by: Andrew Morton commit be5e015d107d5336f298b74ea5a4f0b1773bc6f9 Author: Marcelo Tosatti Date: Wed Jun 7 17:28:07 2023 -0300 vmstat: skip periodic vmstat update for isolated CPUs Problem: The interruption caused by vmstat_update is undesirable for certain applications. With workloads that are running on isolated cpus with nohz full mode to shield off any kernel interruption. For example, a VM running a time sensitive application with a 50us maximum acceptable interruption (use case: soft PLC). oslat 1094.456862: sys_mlock(start: 7f7ed0000b60, len: 1000) oslat 1094.456971: workqueue_queue_work: ... function=vmstat_update ... oslat 1094.456974: sched_switch: prev_comm=oslat ... ==> next_comm=kworker/5:1 ... kworker 1094.456978: sched_switch: prev_comm=kworker/5:1 ==> next_comm=oslat ... The example above shows an additional 7us for the oslat -> kworker -> oslat switches. In the case of a virtualized CPU, and the vmstat_update interruption in the host (of a qemu-kvm vcpu), the latency penalty observed in the guest is higher than 50us, violating the acceptable latency threshold. The isolated vCPU can perform operations that modify per-CPU page counters, for example to complete I/O operations: CPU 11/KVM-9540 [001] dNh1. 2314.248584: mod_zone_page_state <-__folio_end_writeback CPU 11/KVM-9540 [001] dNh1. 2314.248585: => 0xffffffffc042b083 => mod_zone_page_state => __folio_end_writeback => folio_end_writeback => iomap_finish_ioend => blk_mq_end_request_batch => nvme_irq => __handle_irq_event_percpu => handle_irq_event => handle_edge_irq => __common_interrupt => common_interrupt => asm_common_interrupt => vmx_do_interrupt_nmi_irqoff => vmx_handle_exit_irqoff => vcpu_enter_guest => vcpu_run => kvm_arch_vcpu_ioctl_run => kvm_vcpu_ioctl => __x64_sys_ioctl => do_syscall_64 => entry_SYSCALL_64_after_hwframe In kernel users of vmstat counters either require the precise value and they are using zone_page_state_snapshot interface or they can live with an imprecision as the regular flushing can happen at arbitrary time and cumulative error can grow (see calculate_normal_threshold). From that POV the regular flushing can be postponed for CPUs that have been isolated from the kernel interference without critical infrastructure ever noticing. Skip regular flushing from vmstat_shepherd for all isolated CPUs to avoid interference with the isolated workload. Suggested by Michal Hocko. Link: https://lkml.kernel.org/r/ZIDoV/zxFKVmQl7W@tpad Signed-off-by: Marcelo Tosatti Acked-by: Michal Hocko Cc: Frederic Weisbecker Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 56e0d1cb1689da0db8cc383dc3c25e569437bec1 Author: Hugh Dickins Date: Thu Jun 8 12:37:48 2023 -0700 xtensa: add pte_unmap() to balance pte_offset_map() To keep balance in future, remember to pte_unmap() after a successful pte_offset_map(). And act as if get_pte_for_vaddr() really needs a map there, to read the pteval before "unmapping", to be sure page table is not removed. Link: https://lkml.kernel.org/r/ab2581eb-daa6-894e-4aa6-97c81de3b8c@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 653ba8108debd54c318afbf738cf7d231011380d Author: Hugh Dickins Date: Thu Jun 8 12:36:26 2023 -0700 x86: sme_populate_pgd() use pte_offset_kernel() sme_populate_pgd() is an __init function for sme_encrypt_kernel(): it should use pte_offset_kernel() instead of pte_offset_map(), to avoid the question of whether a pte_unmap() will be needed to balance. Link: https://lkml.kernel.org/r/497d7777-736e-85f2-c37-aa6bcf155e4@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 975ca3986bec8ebd6d8b45f4a7f77c730e424ac4 Author: Hugh Dickins Date: Thu Jun 8 12:35:09 2023 -0700 x86: allow get_locked_pte() to fail In rare transient cases, not yet made possible, pte_offset_map() and pte_offset_map_lock() may not find a page table: handle appropriately. Link: https://lkml.kernel.org/r/b7fa8547-4f28-ec82-9893-1b2eb58e40b4@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 7a19c361b1fac7fbe2d21fc0268902150edb059a Author: Hugh Dickins Date: Thu Jun 8 12:33:40 2023 -0700 sparc: iounit and iommu use pte_offset_kernel() iounit_alloc() and sbus_iommu_alloc() are working from pmd_off_k(), so should use pte_offset_kernel() instead of pte_offset_map(), to avoid the question of whether a pte_unmap() will be needed to balance. Link: https://lkml.kernel.org/r/99962272-12ff-975d-bf7f-7fd5d95a2df5@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 4be14ec02ee12b807f5f66ee165df948409465bb Author: Hugh Dickins Date: Thu Jun 8 12:32:36 2023 -0700 sparc: allow pte_offset_map() to fail In rare transient cases, not yet made possible, pte_offset_map() and pte_offset_map_lock() may not find a page table: handle appropriately. Link: https://lkml.kernel.org/r/22165adb-581c-9ce1-8aa6-a3385cd39055@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit c65d09fd2c280f8b8e79655f7c011e25e5b45568 Author: Hugh Dickins Date: Thu Jun 8 12:31:10 2023 -0700 sparc/hugetlb: pte_alloc_huge() pte_offset_huge() pte_alloc_map() expects to be followed by pte_unmap(), but hugetlb omits that: to keep balance in future, use the recently added pte_alloc_huge() instead; with pte_offset_huge() a better name for pte_offset_kernel(). Link: https://lkml.kernel.org/r/c2aeb62f-58f9-d014-ddcd-266267bd97b@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit b7b7ef6b448513e41796a160efab320755b835c2 Author: Hugh Dickins Date: Thu Jun 8 12:30:14 2023 -0700 sh/hugetlb: pte_alloc_huge() pte_offset_huge() pte_alloc_map() expects to be followed by pte_unmap(), but hugetlb omits that: to keep balance in future, use the recently added pte_alloc_huge() instead; with pte_offset_huge() a better name for pte_offset_kernel(). Link: https://lkml.kernel.org/r/ee885978-7355-624b-cfe2-c3d75672b842@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit b2f58941adcbdb736df1686289619719961691ff Author: Hugh Dickins Date: Thu Jun 8 12:29:13 2023 -0700 s390: gmap use pte_unmap_unlock() not spin_unlock() pte_alloc_map_lock() expects to be followed by pte_unmap_unlock(): to keep balance in future, pass ptep as well as ptl to gmap_pte_op_end(), and use pte_unmap_unlock() instead of direct spin_unlock() (even though ptep ends up unused inside the macro). Link: https://lkml.kernel.org/r/78873af-e1ec-4f9-47ac-483940ac6daa@google.com Signed-off-by: Hugh Dickins Acked-by: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 5c7f3bf04a6cf266567fdea1ae4987875e92619f Author: Hugh Dickins Date: Thu Jun 8 12:27:22 2023 -0700 s390: allow pte_offset_map_lock() to fail In rare transient cases, not yet made possible, pte_offset_map() and pte_offset_map_lock() may not find a page table: handle appropriately. Add comment on mm's contract with s390 above __zap_zero_pages(), and fix old comment there: must be called after THP was disabled. Link: https://lkml.kernel.org/r/3ff29363-336a-9733-12a1-5c31a45c8aeb@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 893f667f744014ebb10d0609c17bee729b0eac57 Author: Hugh Dickins Date: Thu Jun 8 12:25:42 2023 -0700 riscv/hugetlb: pte_alloc_huge() pte_offset_huge() pte_alloc_map() expects to be followed by pte_unmap(), but hugetlb omits that: to keep balance in future, use the recently added pte_alloc_huge() instead; with pte_offset_huge() a better name for pte_offset_kernel(). Link: https://lkml.kernel.org/r/291f20-5947-9f5f-ec7f-96a18df336d9@google.com Signed-off-by: Hugh Dickins Reviewed-by: Alexandre Ghiti Acked-by: Palmer Dabbelt Cc: Alexander Gordeev Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 5d991378d1e5b5d4c5b8c0f72e426a94ff340a88 Author: Hugh Dickins Date: Thu Jun 8 12:24:32 2023 -0700 powerpc/hugetlb: pte_alloc_huge() pte_alloc_map() expects to be followed by pte_unmap(), but hugetlb omits that: to keep balance in future, use the recently added pte_alloc_huge() instead. huge_pte_offset() is using __find_linux_pte(), which is using pte_offset_kernel() - don't rename that to _huge, it's more complicated. Link: https://lkml.kernel.org/r/36b4e5d-954b-8569-4fe2-bd1797362441@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 0c31f29b0cbc11e5bef73681e7e9cbf03ce1acbe Author: Hugh Dickins Date: Thu Jun 8 12:23:35 2023 -0700 powerpc: allow pte_offset_map[_lock]() to fail In rare transient cases, not yet made possible, pte_offset_map() and pte_offset_map_lock() may not find a page table: handle appropriately. Balance successful pte_offset_map() with pte_unmap() where omitted. Link: https://lkml.kernel.org/r/54c8b578-ca9-a0f-bfd2-d72976f8d73a@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit d00ae31fa2fc7ce5ed8d60b9fb10adb5c99a792b Author: Hugh Dickins Date: Thu Jun 8 12:22:39 2023 -0700 powerpc: kvmppc_unmap_free_pmd() pte_offset_kernel() kvmppc_unmap_free_pmd() use pte_offset_kernel(), like everywhere else in book3s_64_mmu_radix.c: instead of pte_offset_map(), which will come to need a pte_unmap() to balance it. But note that this is a more complex case than most: see those -EAGAINs in kvmppc_create_pte(), which is coping with kvmppc races beween page table and huge entry, of the kind which we are expecting to address in pte_offset_map() - this might want to be revisited in future. Link: https://lkml.kernel.org/r/c76aa421-aec3-4cc8-cc61-4130f2e27e1@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit def1cd433f8a83d7fe0bef8fa3bafdb3756ba1b2 Author: Hugh Dickins Date: Thu Jun 8 12:21:07 2023 -0700 parisc/hugetlb: pte_alloc_huge() pte_offset_huge() pte_alloc_map() expects to be followed by pte_unmap(), but hugetlb omits that: to keep balance in future, use the recently added pte_alloc_huge() instead; with pte_offset_huge() a better name for pte_offset_kernel(). Link: https://lkml.kernel.org/r/7963aeed-f7d2-e0-f3c6-3680c5572444@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit ffd3e90a8fda600e37f60e6b648e9252927c5e8b Author: Hugh Dickins Date: Thu Jun 8 12:20:00 2023 -0700 parisc: unmap_uncached_pte() use pte_offset_kernel() unmap_uncached_pte() is working from pgd_offset_k(vaddr), so it should use pte_offset_kernel() instead of pte_offset_map(), to avoid the question of whether a pte_unmap() will be needed to balance. Link: https://lkml.kernel.org/r/358dfe21-a47f-9d3-bf21-9c454735944@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 6a2561f92e7d74536b6eba3ffdcf66d60d44031c Author: Hugh Dickins Date: Thu Jun 8 12:18:35 2023 -0700 parisc: add pte_unmap() to balance get_ptep() To keep balance in future, remember to pte_unmap() after a successful get_ptep(). And act as if flush_cache_pages() really needs a map there, to read the pfn before "unmapping", to be sure page table is not removed. Link: https://lkml.kernel.org/r/653369-95ef-acd2-d6ea-e95f5a997493@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 17b25a3801d11c28374a37cc672823cedb0f10d3 Author: Hugh Dickins Date: Thu Jun 15 16:02:43 2023 -0700 mips: add pte_unmap() to balance pte_offset_map() To keep balance in future, __update_tlb() remember to pte_unmap() after pte_offset_map(). This is an odd case, since the caller has already done pte_offset_map_lock(), then mips forgets the address and recalculates it; but my two naive attempts to clean that up did more harm than good. Link: https://lkml.kernel.org/r/addfcb3-b5f4-976e-e050-a2508e589cfe@google.com Signed-off-by: Hugh Dickins Tested-by: Nathan Chancellor Tested-by: Yu Zhao Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 505a23a5f8934175d2b66fb5ea03a8c519a28e44 Author: Hugh Dickins Date: Thu Jun 8 12:16:14 2023 -0700 microblaze: allow pte_offset_map() to fail In rare transient cases, not yet made possible, pte_offset_map() and pte_offset_map_lock() may not find a page table: handle appropriately. Link: https://lkml.kernel.org/r/eab66faf-c0ab-3a8f-47bf-8a7c5af638f@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit e67b37c368b7cc24b8c0fe5ab6c44422312eab37 Author: Hugh Dickins Date: Thu Jun 8 12:15:16 2023 -0700 m68k: allow pte_offset_map[_lock]() to fail In rare transient cases, not yet made possible, pte_offset_map() and pte_offset_map_lock() may not find a page table: handle appropriately. Restructure cf_tlb_miss() with a pte_unmap() (previously omitted) at label out, followed by one local_irq_restore() for all. Link: https://lkml.kernel.org/r/795f6a7-bcca-cdf-ad2a-fbdaa232998c@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 0db639f768e6b6296bbc64689dd8823b7bdb765a Author: Hugh Dickins Date: Thu Jun 8 12:14:26 2023 -0700 ia64/hugetlb: pte_alloc_huge() pte_offset_huge() pte_alloc_map() expects to be followed by pte_unmap(), but hugetlb omits that: to keep balance in future, use the recently added pte_alloc_huge() instead; with pte_offset_huge() a better name for pte_offset_kernel(). Link: https://lkml.kernel.org/r/1c2c7837-bfea-9640-a74-985379fcc5a@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit cafcb9ca5a56f393019200cd072cbb57d0ed7dd4 Author: Hugh Dickins Date: Thu Jun 8 12:13:13 2023 -0700 arm64/hugetlb: pte_alloc_huge() pte_offset_huge() pte_alloc_map() expects to be followed by pte_unmap(), but hugetlb omits that: to keep balance in future, use the recently added pte_alloc_huge() instead; with pte_offset_huge() a better name for pte_offset_kernel(). Link: https://lkml.kernel.org/r/5849464-7191-40c5-c55f-fba9c3802e5d@google.com Signed-off-by: Hugh Dickins Acked-by: Catalin Marinas Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 52924726f4c06b3f77de75fb665e6efd8e777d07 Author: Hugh Dickins Date: Thu Jun 8 12:11:59 2023 -0700 arm64: allow pte_offset_map() to fail In rare transient cases, not yet made possible, pte_offset_map() and pte_offset_map_lock() may not find a page table: handle appropriately. Link: https://lkml.kernel.org/r/35e46485-8499-4337-c51f-b8fa495a1a93@google.com Signed-off-by: Hugh Dickins Acked-by: Catalin Marinas Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 766b59e876505852e1571142bd57dfe20fca383e Author: Hugh Dickins Date: Thu Jun 8 12:10:57 2023 -0700 arm: allow pte_offset_map[_lock]() to fail Patch series "arch: allow pte_offset_map[_lock]() to fail", v2. What is it all about? Some mmap_lock avoidance i.e. latency reduction. Initially just for the case of collapsing shmem or file pages to THPs; but likely to be relied upon later in other contexts e.g. freeing of empty page tables (but that's not work I'm doing). mmap_write_lock avoidance when collapsing to anon THPs? Perhaps, but again that's not work I've done: a quick attempt was not as easy as the shmem/file case. I would much prefer not to have to make these small but wide-ranging changes for such a niche case; but failed to find another way, and have heard that shmem MADV_COLLAPSE's usefulness is being limited by that mmap_write_lock it currently requires. These changes (though of course not these exact patches, and not all of these architectures!) have been in Google's data centre kernel for three years now: we do rely upon them. What are the per-arch changes about? Generally, two things. One: the current mmap locking may not be enough to guard against that tricky transition between pmd entry pointing to page table, and empty pmd entry, and pmd entry pointing to huge page: pte_offset_map() will have to validate the pmd entry for itself, returning NULL if no page table is there. What to do about that varies: often the nearby error handling indicates just to skip it; but in some cases a "goto again" looks appropriate (and if that risks an infinite loop, then there must have been an oops, or pfn 0 mistaken for page table, before). Deeper study of each site might show that 90% of them here in arch code could only fail if there's corruption e.g. a transition to THP would be surprising on an arch without HAVE_ARCH_TRANSPARENT_HUGEPAGE. But given the likely extension to freeing empty page tables, I have not limited this set of changes to THP; and it has been easier, and sets a better example, if each site is given appropriate handling. Two: pte_offset_map() will need to do an rcu_read_lock(), with the corresponding rcu_read_unlock() in pte_unmap(). But most architectures never supported CONFIG_HIGHPTE, so some don't always call pte_unmap() after pte_offset_map(), or have used userspace pte_offset_map() where pte_offset_kernel() is more correct. No problem in the current tree, but a problem once an rcu_read_unlock() will be needed to keep balance. A common special case of that comes in arch/*/mm/hugetlbpage.c, if the architecture supports hugetlb pages down at the lowest PTE level. huge_pte_alloc() uses pte_alloc_map(), but generic hugetlb code does no corresponding pte_unmap(); similarly for huge_pte_offset(). In rare transient cases, not yet made possible, pte_offset_map() and pte_offset_map_lock() may not find a page table: handle appropriately. Link: https://lkml.kernel.org/r/a4963be9-7aa6-350-66d0-2ba843e1af44@google.com Link: https://lkml.kernel.org/r/813429a1-204a-1844-eeae-7fd72826c28@google.com Signed-off-by: Hugh Dickins Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Aneesh Kumar K.V Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Chris Zankel Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Greg Ungerer Cc: Heiko Carstens Cc: Helge Deller Cc: John David Anglin Cc: John Paul Adrian Glaubitz Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Max Filippov Cc: Michael Ellerman Cc: Michal Simek Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Qi Zheng Cc: Russell King Cc: Suren Baghdasaryan Cc: Thomas Bogendoerfer Cc: Will Deacon Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit b9c91c43412f2e07a5287dfe7027acdd8fb0b1ef Author: Yosry Ahmed Date: Wed Jun 7 19:51:43 2023 +0000 mm: zswap: support exclusive loads Commit 71024cb4a0bf ("frontswap: remove frontswap_tmem_exclusive_gets") removed support for exclusive loads from frontswap as it was not used. Bring back exclusive loads support to frontswap by adding an "exclusive" output parameter to frontswap_ops->load. On the zswap side, add a module parameter to enable/disable exclusive loads, and a config option to control the boot default value. Refactor zswap entry invalidation in zswap_frontswap_invalidate_page() into zswap_invalidate_entry() to reuse it in zswap_frontswap_load() if exclusive loads are enabled. With exclusive loads, we avoid having two copies of the same page in memory (compressed & uncompressed) after faulting it in from zswap. On the other hand, if the page is to be reclaimed again without being dirtied, it will be re-compressed. Compression is not usually slow, and a page that was just faulted in is less likely to be reclaimed again soon. Link: https://lkml.kernel.org/r/20230607195143.1473802-1-yosryahmed@google.com Signed-off-by: Yosry Ahmed Suggested-by: Yu Zhao Acked-by: Johannes Weiner Cc: Dan Streetman Cc: Domenico Cerasuolo Cc: Konrad Rzeszutek Wilk Cc: Nhat Pham Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton commit 32b6a4a1745a46918f748f6fb7641e588fbec6f2 Author: Haifeng Xu Date: Wed Jun 7 02:50:56 2023 +0000 mm/mm_init.c: remove reset_node_present_pages() reset_node_present_pages() only get called in hotadd_init_pgdat(), move the action that clear present pages to free_area_init_core_hotplug(), so the helper can be removed. Link: https://lkml.kernel.org/r/20230607025056.1348-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Suggested-by: David Hildenbrand Cc: Michal Hocko Cc: Mike Rapoport (IBM) Cc: Oscar Salvador Signed-off-by: Andrew Morton commit a668968f84265e698a122656c433809ab9f023fa Author: Haifeng Xu Date: Wed Jun 7 02:45:48 2023 +0000 mm/memory_hotplug: remove reset_node_managed_pages() in hotadd_init_pgdat() managed pages has already been set to 0 in free_area_init_core_hotplug(), via zone_init_internals() on each zone. It's pointless to reset again. Furthermore, reset_node_managed_pages() no longer needs to be exposed outside of mm/memblock.c. Remove declaration in include/linux/memblock.h and define it as static. In addtion to this, the only caller of reset_node_managed_pages() is reset_all_zones_managed_pages(), which is annotated with __init, so it should be safe to also mark reset_node_managed_pages() as __init. Link: https://lkml.kernel.org/r/20230607024548.1240-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Suggested-by: David Hildenbrand Cc: Michal Hocko Cc: Mike Rapoport (IBM) Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 36ce9d76b0a93bae799e27e4f5ac35478c676592 Author: Roberto Sassu Date: Wed Jun 7 18:15:23 2023 +0200 shmem: use ramfs_kill_sb() for kill_sb method of ramfs-based tmpfs As the ramfs-based tmpfs uses ramfs_init_fs_context() for the init_fs_context method, which allocates fc->s_fs_info, use ramfs_kill_sb() to free it and avoid a memory leak. Link: https://lkml.kernel.org/r/20230607161523.2876433-1-roberto.sassu@huaweicloud.com Fixes: c3b1b1cbf002 ("ramfs: add support for "mode=" mount option") Signed-off-by: Roberto Sassu Cc: Hugh Dickins Cc: David Howells Cc: Al Viro Cc: Signed-off-by: Andrew Morton commit 91ff4d754a1895feb4216e94028edd76cbbc0770 Author: Haifeng Xu Date: Wed Jun 7 03:24:02 2023 +0000 mm/mm_init.c: drop 'nid' parameter from check_for_memory() The node_id in pgdat has already been set in free_area_init_node(), so use it internally instead of passing a redundant parameter. Link: https://lkml.kernel.org/r/20230607032402.4679-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Reviewed-by: Mike Rapoport (IBM) Acked-by: Michal Hocko Signed-off-by: Andrew Morton commit bd5f79ab39367665f40e10c2486aa15e7a841490 Author: Yajun Deng Date: Wed Jun 7 10:39:52 2023 +0800 mm/sparse: remove unused parameters in sparse_remove_section() These parameters ms and map_offset are not used in sparse_remove_section(), so remove them. The __remove_section() is only called by __remove_pages(), remove it. And put the WARN_ON_ONCE() in sparse_remove_section(). Link: https://lkml.kernel.org/r/20230607023952.2247489-1-yajun.deng@linux.dev Signed-off-by: Yajun Deng Reviewed-by: David Hildenbrand Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 061e62e8180d3fab378a52d868e29ceebe2fe1d2 Author: ZhangPeng Date: Tue Jun 6 14:20:13 2023 +0800 mm/hugetlb: use a folio in hugetlb_fault() We can replace seven implicit calls to compound_head() with one by using folio. [akpm@linux-foundation.org: update comment, per Sidhartha] Link: https://lkml.kernel.org/r/20230606062013.2947002-4-zhangpeng362@huawei.com Signed-off-by: ZhangPeng Reviewed-by Sidhartha Kumar Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Muchun Song Cc: Kefeng Wang Cc: Mike Kravetz Cc: Nanyong Sun Cc: Vishal Moola (Oracle) Signed-off-by: Andrew Morton commit 959a78b6dd4526fb11d3cacf2de909479b06a4f4 Author: ZhangPeng Date: Tue Jun 6 14:20:12 2023 +0800 mm/hugetlb: use a folio in hugetlb_wp() We can replace nine implict calls to compound_head() with one by using old_folio. The page we get back is always a head page, so we just convert old_page to old_folio. Link: https://lkml.kernel.org/r/20230606062013.2947002-3-zhangpeng362@huawei.com Signed-off-by: ZhangPeng Suggested-by: Matthew Wilcox (Oracle) Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Muchun Song Reviewed-by: Sidhartha Kumar Cc: Kefeng Wang Cc: Mike Kravetz Cc: Nanyong Sun Cc: Vishal Moola (Oracle) Signed-off-by: Andrew Morton commit ad27ce206af731f6854b3d8a1760c573b217e363 Author: ZhangPeng Date: Tue Jun 6 14:20:11 2023 +0800 mm/hugetlb: use a folio in copy_hugetlb_page_range() Patch series "Convert several functions in hugetlb.c to use a folio", v2. This patch series converts three functions in hugetlb.c to use a folio, which can remove several implicit calls to compound_head(). This patch (of 3): We can replace five implict calls to compound_head() with one by using pte_folio. The page we get back is always a head page, so we just convert ptepage to pte_folio. Link: https://lkml.kernel.org/r/20230606062013.2947002-1-zhangpeng362@huawei.com Link: https://lkml.kernel.org/r/20230606062013.2947002-2-zhangpeng362@huawei.com Signed-off-by: ZhangPeng Suggested-by: Matthew Wilcox (Oracle) Reviewed-by: Muchun Song Reviewed-by: Sidhartha Kumar Reviewed-by: Matthew Wilcox (Oracle) Cc: Kefeng Wang Cc: Mike Kravetz Cc: Nanyong Sun Cc: Vishal Moola (Oracle) Signed-off-by: Andrew Morton commit 9fc96c7c19dfab67bf81b25fbc4f49b7752d5060 Author: John Hubbard Date: Tue Jun 6 00:16:37 2023 -0700 selftests: error out if kernel header files are not yet built As per a discussion with Muhammad Usama Anjum [1], the following is how one is supposed to build selftests: make headers && make -C tools/testing/selftests/mm Change the selftest build system's lib.mk to fail out with a helpful message if that prerequisite "make headers" has not been done yet. [1] https://lore.kernel.org/all/bf910fa5-0c96-3707-cce4-5bcc656b6274@collabora.com/ [jhubbard@nvidia.com: abort the make process the first time headers aren't detected] Link: https://lkml.kernel.org/r/14573e7e-f2ad-ff34-dfbd-3efdebee51ed@nvidia.com [anders.roxell@linaro.org: fix out-of-tree builds] Link: https://lkml.kernel.org/r/20230613074931.666966-1-anders.roxell@linaro.org Link: https://lkml.kernel.org/r/20230606071637.267103-12-jhubbard@nvidia.com Signed-off-by: John Hubbard Signed-off-by: Anders Roxell Reviewed-by: Muhammad Usama Anjum Tested-by: Muhammad Usama Anjum Cc: David Hildenbrand Cc: Peter Xu Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Shuah Khan Signed-off-by: Andrew Morton commit 01d6c48a828b4c1cda2fadcb811b432b757bdf8e Author: John Hubbard Date: Tue Jun 6 00:16:36 2023 -0700 Documentation: kselftest: "make headers" is a prerequisite As per a discussion with Muhammad Usama Anjum [1], the following is how one is supposed to build selftests: make headers && make -C tools/testing/selftests/mm However, that's not yet documented anywhere. So add it to Documentation/dev-tools/kselftest.rst . [1] https://lore.kernel.org/all/bf910fa5-0c96-3707-cce4-5bcc656b6274@collabora.com/ Link: https://lkml.kernel.org/r/20230606071637.267103-11-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: David Hildenbrand Tested-by: Muhammad Usama Anjum Cc: Peter Xu Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Shuah Khan Signed-off-by: Andrew Morton commit 56d2afff13834020b91a81220684be946a4e1ef3 Author: John Hubbard Date: Tue Jun 6 00:16:35 2023 -0700 selftests/mm: move certain uffd*() routines from vm_util.c to uffd-common.c There are only three uffd*() routines that are used outside of the uffd selftests. Leave these in vm_util.c, where they are available to any mm selftest program: uffd_register() uffd_unregister() uffd_register_with_ioctls(). A few other uffd*() routines, however, are only used by the uffd-focused tests found in uffd-stress.c and uffd-unit-tests.c. Move those routines into uffd-common.c. Link: https://lkml.kernel.org/r/20230606071637.267103-10-jhubbard@nvidia.com Signed-off-by: John Hubbard Acked-by: David Hildenbrand Tested-by: Muhammad Usama Anjum Cc: Peter Xu Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Shuah Khan Signed-off-by: Andrew Morton commit 3972ea2469385777d0ebc67794f30cdb0cdbffd9 Author: John Hubbard Date: Tue Jun 6 00:16:34 2023 -0700 selftests/mm: fix build failures due to missing MADV_COLLAPSE MADV_PAGEOUT, MADV_POPULATE_READ, MADV_COLLAPSE are conditionally defined as necessary. However, that was being done in .c files, and a new build failure came up that would have been automatically avoided had these been in a common header file. So consolidate and move them all to vm_util.h, which fixes the build failure. An alternative approach from Muhammad Usama Anjum was: rely on "make headers" being required, and include asm-generic/mman-common.h. This works in the sense that it builds, but it still generates warnings about duplicate MADV_* symbols, and the goal here is to get a fully clean (no warnings) build here. Link: https://lkml.kernel.org/r/20230606071637.267103-9-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: David Hildenbrand Tested-by: Muhammad Usama Anjum Cc: Peter Xu Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Shuah Khan Signed-off-by: Andrew Morton commit 97deb66ed4f9390fd585210fe6d72088000d9110 Author: John Hubbard Date: Tue Jun 6 00:16:33 2023 -0700 selftests/mm: fix a "possibly uninitialized" warning in pkey-x86.h This fixes a real bug, too, because xstate_size() was assuming that the stack variable xstate_size was initialized to zero. That's not guaranteed nor even especially likely. Link: https://lkml.kernel.org/r/20230606071637.267103-8-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: David Hildenbrand Tested-by: Muhammad Usama Anjum Cc: Peter Xu Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Shuah Khan Signed-off-by: Andrew Morton commit 0e14e7e9f16ffe8f0761bc627829e8bd1cb32793 Author: John Hubbard Date: Tue Jun 6 00:16:32 2023 -0700 selftests/mm: fix two -Wformat-security warnings in uffd builds The uffd tests generate two compile time warnings from clang's -Wformat-security setting. These trigger at the call sites for uffd_test_start() and uffd_test_skip(). 1) Fix the uffd_test_start() issue by removing the intermediate test_name variable (thanks to David Hildenbrand for showing how to do this). 2) Fix the uffd_test_skip() issue by observing that there is no need for a macro and a variable args approach, because all callers of uffd_test_skip() pass in a simple char* string, without any format specifiers. So just change uffd_test_skip() into a regular C function. Link: https://lkml.kernel.org/r/20230606071637.267103-7-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Peter Xu Tested-by: Muhammad Usama Anjum Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Shuah Khan Signed-off-by: Andrew Morton commit 7bddd2263e3781429f72f05e59fdf5e531e0bf26 Author: John Hubbard Date: Tue Jun 6 00:16:31 2023 -0700 selftests/mm: .gitignore: add mkdirty, va_high_addr_switch These new build products were left out of .gitignore, so add them now. Link: https://lkml.kernel.org/r/20230606071637.267103-6-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Peter Xu Tested-by: Muhammad Usama Anjum Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Shuah Khan Signed-off-by: Andrew Morton commit 3ff47a5837ef00121fe880338255f8e2d1a5621f Author: John Hubbard Date: Tue Jun 6 00:16:30 2023 -0700 selftests/mm: fix invocation of tests that are run via shell scripts We cannot depend upon git to reliably retain the executable bit on shell scripts, or so I was told several years ago while working on this same run_vmtests.sh script. And sure enough, things such as test_hmm.sh are lately failing to run, due to lacking execute permissions. Fix this by explicitly adding "bash" to each of the shell script invocations. Leave fixing the overall approach to another day. Link: https://lkml.kernel.org/r/20230606071637.267103-5-jhubbard@nvidia.com Signed-off-by: John Hubbard Acked-by: David Hildenbrand Tested-by: Muhammad Usama Anjum Cc: Peter Xu Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Shuah Khan Signed-off-by: Andrew Morton commit b764253c18821da31c49a260f92f5d093cf1637e Author: John Hubbard Date: Tue Jun 6 00:16:29 2023 -0700 selftests/mm: fix "warning: expression which evaluates to zero..." in mlock2-tests.c The stop variable is a char*, and the code was assigning a char value to it. This was generating a warning when compiling with clang. However, as both David and Peter pointed out, stop is not even used after the problematic assignment to a char type. So just delete that line entirely. Link: https://lkml.kernel.org/r/20230606071637.267103-4-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Peter Xu Tested-by: Muhammad Usama Anjum Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Shuah Khan Signed-off-by: Andrew Morton commit 2f29d16c9d30357a27432e2b35fe70833b5c7762 Author: John Hubbard Date: Tue Jun 6 00:16:28 2023 -0700 selftests/mm: fix unused variable warnings in hugetlb-madvise.c, migration.c Dummy variables are required in order to make these two (similar) routines work, so in both cases, declare the variables as volatile in order to avoid the clang compiler warning. Furthermore, in order to ensure that each test actually does what is intended, add an asm volatile invocation (thanks to David Hildenbrand for the suggestion), with a clarifying comment so that it survives future maintenance. Link: https://lkml.kernel.org/r/20230606071637.267103-3-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Peter Xu Tested-by: Muhammad Usama Anjum Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Shuah Khan Signed-off-by: Andrew Morton commit 9a61100e686eaa2229343505f0183f8ea790d120 Author: John Hubbard Date: Tue Jun 6 00:16:27 2023 -0700 selftests/mm: fix uffd-stress unused function warning Patch series "A minor flurry of selftest/mm fixes", v3. A series that fixes up build errors and warnings for at least the 64-bit builds on x86 with clang. The series also includes an optional "improvement" of moving some uffd code into uffd-common.[ch], which is proving to be somewhat controversial, and so if that doesn't get resolved, then patches 9 and 10 may just get dropped. They are not required in order to get a clean build, now that "make headers" is happening. [1]: https://lore.kernel.org/all/20230602013358.900637-1-jhubbard@nvidia.com/ This patch (of 11): uffd_minor_feature() was unused. Remove it in order to fix the associated clang build warning. Link: https://lkml.kernel.org/r/20230606071637.267103-1-jhubbard@nvidia.com Link: https://lkml.kernel.org/r/20230606071637.267103-2-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Peter Xu Cc: Jonathan Corbet Cc: Muhammad Usama Anjum Cc: Nathan Chancellor Cc: Shuah Khan Signed-off-by: Andrew Morton commit e6c715abb4ee0ffe291c83e2e3d22866f387cda9 Author: Miaohe Lin Date: Tue Jun 6 20:07:24 2023 +0800 memory tier: remove unneeded disable_all_demotion_targets() when !CONFIG_MIGRATION There's no caller of disable_all_demotion_targets() when CONFIG_MIGRATION is disabled. Remove it. Link: https://lkml.kernel.org/r/20230606120724.208552-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton commit e5797dc011182f8b25420bc977f37cd92fc6e755 Author: Miaohe Lin Date: Tue Jun 6 20:18:13 2023 +0800 mm: vmscan: mark kswapd_run() and kswapd_stop() __meminit Add __meminit to kswapd_run() and kswapd_stop() to ensure they're default to __init when memory hotplug is not enabled. Link: https://lkml.kernel.org/r/20230606121813.242163-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Yu Zhao Acked-by: David Hildenbrand Signed-off-by: Andrew Morton commit e52ee4cc8fa87a75ab0cfc7bf51c0715a880a08e Author: Miaohe Lin Date: Sat Jun 3 22:25:13 2023 +0800 mm: remove obsolete alloc_migrate_target() There's only declaration left in the header file. Remove it. Link: https://lkml.kernel.org/r/20230603142513.787000-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Cc: Johannes Weiner Signed-off-by: Andrew Morton commit 5da226dbfce3a2f44978c2c7cf88166e69a6788b Author: Zhaoyang Huang Date: Wed May 31 10:51:01 2023 +0800 mm: skip CMA pages when they are not available This patch fixes unproductive reclaiming of CMA pages by skipping them when they are not available for current context. It arises from the below OOM issue, which was caused by a large proportion of MIGRATE_CMA pages among free pages. [ 36.172486] [03-19 10:05:52.172] ActivityManager: page allocation failure: order:0, mode:0xc00(GFP_NOIO), nodemask=(null),cpuset=foreground,mems_allowed=0 [ 36.189447] [03-19 10:05:52.189] DMA32: 0*4kB 447*8kB (C) 217*16kB (C) 124*32kB (C) 136*64kB (C) 70*128kB (C) 22*256kB (C) 3*512kB (C) 0*1024kB 0*2048kB 0*4096kB = 35848kB [ 36.193125] [03-19 10:05:52.193] Normal: 231*4kB (UMEH) 49*8kB (MEH) 14*16kB (H) 13*32kB (H) 8*64kB (H) 2*128kB (H) 0*256kB 1*512kB (H) 0*1024kB 0*2048kB 0*4096kB = 3236kB ... [ 36.234447] [03-19 10:05:52.234] SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC) [ 36.234455] [03-19 10:05:52.234] cache: ext4_io_end, object size: 64, buffer size: 64, default order: 0, min order: 0 [ 36.234459] [03-19 10:05:52.234] node 0: slabs: 53,objs: 3392, free: 0 This change further decreases the chance for wrong OOMs in the presence of a lot of CMA memory. [david@redhat.com: changelog addition] Link: https://lkml.kernel.org/r/1685501461-19290-1-git-send-email-zhaoyang.huang@unisoc.com Signed-off-by: Zhaoyang Huang Acked-by: David Hildenbrand Cc: ke.wang Cc: Matthew Wilcox Cc: Minchan Kim Cc: Suren Baghdasaryan Signed-off-by: Andrew Morton commit ce5df7764b3b2abaf3687c460a9a1922daaed5b7 Author: Johannes Weiner Date: Fri May 19 13:16:52 2023 +0200 mm: page_isolation: write proper kerneldoc And remove the incorrect header comments. [akpm@linux-foundation.org: s/lower/first/, s/upper/last/, per Mike] Link: https://lkml.kernel.org/r/20230519111652.40658-1-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Cc: Mike Rapoport Signed-off-by: Andrew Morton commit fc1bd51d110e206da5bee07e889d285c267a6874 Author: Paulo Alcantara Date: Mon Jun 19 16:52:01 2023 -0300 smb: client: fix warning in cifs_match_super() Fix potential dereference of ERR_PTR @tlink as reported by kernel test robot fs/smb/client/connect.c:2775 cifs_match_super() error: 'tlink' dereferencing possible ERR_PTR() Link: https://lore.kernel.org/all/202306170124.CtQqzf0I-lkp@intel.com/ Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit dc765027ed2941985fbb8ef86139e6289b36fc43 Author: Shyam Prasad N Date: Fri Jun 16 10:37:45 2023 +0000 cifs: print nosharesock value while dumping mount options We print most other mount options for a mount when dumping the mount entries. But miss out the nosharesock value. This change will print that in addition to the other options. Signed-off-by: Shyam Prasad N Reviewed-by: Bharath SM Signed-off-by: Steve French commit da787d5b74983f7525d1eb4b9c0b4aff2821511a Author: Bharath SM Date: Sun Jun 18 19:02:24 2023 +0000 SMB3: Do not send lease break acknowledgment if all file handles have been closed In case if all existing file handles are deferred handles and if all of them gets closed due to handle lease break then we dont need to send lease break acknowledgment to server, because last handle close will be considered as lease break ack. After closing deferred handels, we check for openfile list of inode, if its empty then we skip sending lease break ack. Fixes: 59a556aebc43 ("SMB3: drop reference to cfile before sending oplock break") Reviewed-by: Tom Talpey Signed-off-by: Bharath SM Signed-off-by: Steve French commit 6f80197f40515853814d0f22e5209d53f899ab91 Author: Maxim Kochetkov Date: Tue Jun 13 22:15:51 2023 +0300 ASoC: dwc: don't assign addr_width for dt configs For proper DMA operation addr_width must corresponds with audio format (S16, S24, S32, etc). Proper bus width calculations is performed by snd_hwparams_to_dma_slave_config(). So drop wrong addr_width asignment for dt configs and let snd_hwparams_to_dma_slave_config() do the job. Signed-off-by: Maxim Kochetkov Link: https://lore.kernel.org/r/20230613191552.724748-1-fido_max@inbox.ru Signed-off-by: Mark Brown commit a42e988b6265dcd489feb1adab8551b40c988f43 Author: Maxim Kochetkov Date: Tue Jun 13 22:19:08 2023 +0300 ASoC: dwc: add DMA handshake control DMA mode uses hardware handshake signals. DMACR register is used to enable the DMA Controller interface operation. So add DMA enable/disable to i2s_start()/i2s_stop() functions if using DMA mode. Signed-off-by: Maxim Kochetkov Link: https://lore.kernel.org/r/20230613191910.725049-1-fido_max@inbox.ru Signed-off-by: Mark Brown commit ef8d95b4a3af4ebfe47e3563c3bc5767dda28207 Author: Claudiu Beznea Date: Fri Jun 16 13:16:46 2023 +0300 MAINTAINERS: add documentation file for Microchip SAMA5D2 shutdown controller Add documentation file for SAMA5D2 shutdown controller. Signed-off-by: Claudiu Beznea Acked-by: Nicolas Ferre Signed-off-by: Sebastian Reichel commit 3adaa36e488665b828416a41eb1be425bcb8fc50 Author: Claudiu Beznea Date: Fri Jun 16 13:16:45 2023 +0300 dt-bindings: power: reset: atmel,sama5d2-shdwc: convert to yaml Convert Microchip AT91 SAMA5D2 shutdown controller to YAML. SAMA7G5 SHDWC DT node (available in arch/arm/boot/dts/sama7g5.dtsi) has syscon along with its compatible. There is no usage of this syscon in the current code but it may be necessary in future as some registers of SHDWC are accessed in different drivers (at91-sama5d2_shdwc.c and arch/arm/mach-at91/pm.c). Thus update the YAML with it to make DT checkers happy. Signed-off-by: Claudiu Beznea Reviewed-by: Conor Dooley Acked-by: Nicolas Ferre Signed-off-by: Sebastian Reichel commit c15329bb376be57a949af7624d77a3d65f5ce604 Author: Claudiu Beznea Date: Fri Jun 16 13:16:44 2023 +0300 dt-bindings: power: reset: atmel,at91sam9260-shdwc: convert to yaml Convert Microchip AT91 shutdown controller to YAML. Signed-off-by: Claudiu Beznea Reviewed-by: Conor Dooley Acked-by: Nicolas Ferre Signed-off-by: Sebastian Reichel commit 16252e018a30486eedcfec81fc313445cac25bea Merge: f20233852ae29 c0baf321038d5 Author: Palmer Dabbelt Date: Mon Jun 19 14:34:40 2023 -0700 Merge patch series "RISC-V: Export Zba, Zbb to usermode via hwprobe" Evan Green says: This change detects the presence of Zba, Zbb, and Zbs extensions and exports them per-hart to userspace via the hwprobe mechanism. Glibc can then use these in setting up hwcaps-based library search paths. There's a little bit of extra housekeeping here: the first change adds Zba and Zbs to the set of extensions the kernel recognizes, and the second change starts tracking ISA features per-hart (in addition to the ANDed mask of features across all harts which the kernel uses to make decisions). Now that we track the ISA information per-hart, we could even fix up /proc/cpuinfo to accurately report extension per-hart, though I've left that out of this series for now. * b4-shazam-merge: RISC-V: hwprobe: Expose Zba, Zbb, and Zbs RISC-V: Track ISA extensions per hart RISC-V: Add Zba, Zbs extension probing Link: https://lore.kernel.org/r/20230509182504.2997252-1-evan@rivosinc.com Signed-off-by: Palmer Dabbelt commit cba266a4f62bcf82528c45cf569412c542c007c9 Author: Miquel Raynal Date: Fri Jun 16 15:52:51 2023 +0200 power: reset: at91-reset: change the power on reason prototype It is quite uncommon to use a driver helper with parameters like *pdev and __iomem *base. It is much cleaner and close to today's standards to provide the per-device driver structure and then access its internals. Let's do this with the helper which returns the power on reason. While we change the parameters, we can as well rename the function from at91_reset_status() to at91_reset_reason() to be more accurate with what the helper actually does, and finally because we don't really need the pdev argument in this helper besides for printing the reset reason, we can move the dev_info() call into the probe. All these modifications prepare the introduction of a sysfs entry to access this information. This way the diff will be much smaller. Thus, there is no intended functional change. Signed-off-by: Miquel Raynal Acked-by: Nicolas Ferre Signed-off-by: Sebastian Reichel commit cded49ba366220ae7009d71c5804baa01acfb860 Author: Jeff Layton Date: Mon Jun 12 09:34:04 2023 -0400 nfs: don't report STATX_BTIME in ->getattr NFS doesn't properly support reporting the btime in getattr (yet), but 61a968b4f05e mistakenly added it to the request_mask. This causes statx for STATX_BTIME to report a zeroed out btime instead of properly clearing the flag. Cc: stable@vger.kernel.org # v6.3+ Fixes: 61a968b4f05e ("nfs: report the inode version in getattr if requested") Signed-off-by: Jeff Layton Link: https://bugzilla.redhat.com/show_bug.cgi?id=2214134 Reported-by: Boyang Xue Signed-off-by: Trond Myklebust commit 970308a7b544fa1c7ee98a2721faba3765be8dd8 Author: Hou Tao Date: Tue Jun 13 16:09:20 2023 +0800 selftests/bpf: Set the default value of consumer_cnt as 0 Considering that only bench_ringbufs.c supports consumer, just set the default value of consumer_cnt as 0. After that, update the validity check of consumer_cnt, remove unused consumer_thread code snippets and set consumer_cnt as 1 in run_bench_ringbufs.sh accordingly. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20230613080921.1623219-5-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit da77ae2b27ec73a644624a6d4bffc206e2df6bb8 Author: Hou Tao Date: Tue Jun 13 16:09:19 2023 +0800 selftests/bpf: Ensure that next_cpu() returns a valid CPU number When using option -a without --prod-affinity or --cons-affinity, if the number of producers and consumers is greater than the number of online CPUs, the benchmark will fail to run as shown below: $ getconf _NPROCESSORS_ONLN 8 $ ./bench bpf-loop -a -p9 Setting up benchmark 'bpf-loop'... setting affinity to CPU #8 failed: -22 Fix it by returning the remainder of next_cpu divided by the number of online CPUs in next_cpu(). Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20230613080921.1623219-4-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit ea400d13fc92ec66578b068e661a162e01d4b641 Author: Hou Tao Date: Tue Jun 13 16:09:18 2023 +0800 selftests/bpf: Output the correct error code for pthread APIs The return value of pthread API is the error code when the called API fails, so output the return value instead of errno. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20230613080921.1623219-3-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 8ad663d3dfac95cbcc4121d0655bd18ad9de826f Author: Hou Tao Date: Tue Jun 13 16:09:17 2023 +0800 selftests/bpf: Use producer_cnt to allocate local counter array For count-local benchmark, use producer_cnt instead of consumer_cnt when allocating local counter array. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20230613080921.1623219-2-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit c907e72f58ed979a24a9fdcadfbc447c51d5e509 Author: Olga Kornievskaia Date: Sun Jun 18 17:32:25 2023 -0400 NFSv4.1: freeze the session table upon receiving NFS4ERR_BADSESSION When the client received NFS4ERR_BADSESSION, it schedules recovery and start the state manager thread which in turn freezes the session table and does not allow for any new requests to use the no-longer valid session. However, it is possible that before the state manager thread runs, a new operation would use the released slot that received BADSESSION and was therefore not updated its sequence number. Such re-use of the slot can lead the application errors. Fixes: 5c441544f045 ("NFSv4.x: Handle bad/dead sessions correctly in nfs41_sequence_process()") Signed-off-by: Olga Kornievskaia Signed-off-by: Trond Myklebust commit 7f7ab336898f281e58540ef781a8fb375acc32a9 Author: Qi Zheng Date: Thu Jun 15 11:19:46 2023 +0000 NFSv4.2: fix wrong shrinker_id Currently, the list_lru::shrinker_id corresponding to the nfs4_xattr shrinkers is wrong: >>> prog["nfs4_xattr_cache_lru"].shrinker_id (int)0 >>> prog["nfs4_xattr_entry_lru"].shrinker_id (int)0 >>> prog["nfs4_xattr_large_entry_lru"].shrinker_id (int)0 >>> prog["nfs4_xattr_cache_shrinker"].id (int)18 >>> prog["nfs4_xattr_entry_shrinker"].id (int)19 >>> prog["nfs4_xattr_large_entry_shrinker"].id (int)20 This is not what we expect, which will cause these shrinkers not to be found in shrink_slab_memcg(). We should assign shrinker::id before calling list_lru_init_memcg(), so that the corresponding list_lru::shrinker_id will be assigned the correct value like below: >>> prog["nfs4_xattr_cache_lru"].shrinker_id (int)16 >>> prog["nfs4_xattr_entry_lru"].shrinker_id (int)17 >>> prog["nfs4_xattr_large_entry_lru"].shrinker_id (int)18 >>> prog["nfs4_xattr_cache_shrinker"].id (int)16 >>> prog["nfs4_xattr_entry_shrinker"].id (int)17 >>> prog["nfs4_xattr_large_entry_shrinker"].id (int)18 So just do it. Fixes: 95ad37f90c33 ("NFSv4.2: add client side xattr caching.") Signed-off-by: Qi Zheng Signed-off-by: Trond Myklebust commit 6ad477a69ad81bcdd515559fba2887ae71c9c0cc Author: Benjamin Coddington Date: Thu Jun 15 14:07:32 2023 -0400 NFSv4: Clean up some shutdown loops If a SEQUENCE call receives -EIO for a shutdown client, it will retry the RPC call. Instead of doing that for a shutdown client, just bail out. Likewise, if the state manager decides to perform recovery for a shutdown client, it will continuously retry. As above, just bail out. Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit 7d3e26a054c88477b26adda3542d66271a943968 Author: Benjamin Coddington Date: Thu Jun 15 14:07:31 2023 -0400 NFS: Cancel all existing RPC tasks when shutdown Walk existing RPC tasks and cancel them with -EIO when the client is shutdown. Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit 4982126e3029cd59fbd1da0d9cc0365a0585fe64 Author: Even Xu Date: Thu Jun 15 08:26:41 2023 +0800 HID: intel-ish-hid: ipc: Add Arrow Lake PCI device ID Add device ID of Arrow Lake-H into ishtp support list. Signed-off-by: Even Xu Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina commit d9615d166c7ede67bf16bdd0772e35e124f305f5 Author: Benjamin Coddington Date: Thu Jun 15 14:07:30 2023 -0400 NFS: add sysfs shutdown knob Within each nfs_server sysfs tree, add an entry named "shutdown". Writing 1 to this file will set the cl_shutdown bit on the rpc_clnt structs associated with that mount. If cl_shutdown is set, the task scheduler immediately returns -EIO for new tasks. Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit f4057ffd0e134e54a727e00c3c9b0d9a5051eadf Author: Benjamin Coddington Date: Thu Jun 15 14:07:29 2023 -0400 NFS: add a sysfs link to the acl rpc_client Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit d97c05897757a5d7fa131073d04a2fb29b5836ee Author: Benjamin Coddington Date: Thu Jun 15 14:07:28 2023 -0400 NFS: add a sysfs link to the lockd rpc_client After lockd is started, add a symlink for lockd's rpc_client under NFS' superblock sysfs. Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit e13b549319a684dd80c4cc25e9567a5c84007e32 Author: Benjamin Coddington Date: Thu Jun 15 14:07:27 2023 -0400 NFS: Add sysfs links to sunrpc clients for nfs_clients For the general and state management nfs_client under each mount, create symlinks to their respective rpc_client sysfs entries. Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit 1c7251187dc067a6d460cf33ca67da9c1dd87807 Author: Benjamin Coddington Date: Thu Jun 15 14:07:26 2023 -0400 NFS: add superblock sysfs entries Create a sysfs directory for each mount that corresponds to the mount's nfs_server struct. As the mount is being constructed, use the name "server-n", but rename it to the "MAJOR:MINOR" of the mount after assigning a device_id. The rename approach allows us to populate the mount's directory with links to the various rpc_client objects during the mount's construction. The naming convention (MAJOR:MINOR) can be used to reference a particular NFS mount's sysfs tree. Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit e96f9268eea626126021641eefeed02f8669f584 Author: Benjamin Coddington Date: Thu Jun 15 14:07:25 2023 -0400 NFS: Make all of /sys/fs/nfs network-namespace unique Expand the NFS network-namespaced sysfs from /sys/fs/nfs/net down one level into /sys/fs/nfs by moving the "net" kobject onto struct nfs_netns_client and setting it up during network namespace init. This prepares the way for superblock kobjects within /sys/fs/nfs that will only be visible to matching network namespaces. Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit 943aef2dbcf75f81c4574903131bd9559cee4fd1 Author: Benjamin Coddington Date: Thu Jun 15 14:07:24 2023 -0400 NFS: Open-code the nfs_kset kset_create_and_add() In preparation to make objects below /sys/fs/nfs namespace aware, we need to define our own kobj_type for the nfs kset so that we can add the .child_ns_type member in a following patch. No functional change here, only the unrolling of kset_create_and_add(). Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit d5082ace6c8ddefd19b8f7b7164580d972fdb103 Author: Benjamin Coddington Date: Thu Jun 15 14:07:23 2023 -0400 NFS: rename nfs_client_kobj to nfs_net_kobj Match the variable names to the sysfs structure. Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit 8b18a2edecc0741b0eecf8b18fdb356a0f8682de Author: Benjamin Coddington Date: Thu Jun 15 14:07:22 2023 -0400 NFS: rename nfs_client_kset to nfs_kset Be brief and match the subsystem name. There's no need to distinguish this kset variable from the server. Signed-off-by: Benjamin Coddington Signed-off-by: Trond Myklebust commit 4931062492c5dab06bcfd829b716f1d7de0be7f5 Merge: 9a94d764e9bc6 6db5dd2bf4817 Author: Jakub Kicinski Date: Mon Jun 19 11:33:08 2023 -0700 Merge branch 'ipv6-random-cleanup-for-extension-header' Kuniyuki Iwashima says: ==================== ipv6: Random cleanup for Extension Header. This series (1) cleans up pskb_may_pull() in some functions, where needed data are already pulled by their caller, (2) removes redundant multicast test, and (3) optimises reload timing of the header. ==================== Link: https://lore.kernel.org/r/20230614230107.22301-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit 6db5dd2bf4817a415daaf6a0226beadef1473d30 Author: Kuniyuki Iwashima Date: Wed Jun 14 16:01:07 2023 -0700 ipv6: exthdrs: Remove redundant skb_headlen() check in ip6_parse_tlv(). ipv6_destopt_rcv() and ipv6_parse_hopopts() pulls these data - Hop-by-Hop/Destination Options Header : 8 - Hdr Ext Len : skb_transport_header(skb)[1] << 3 and calls ip6_parse_tlv(), so it need not check if skb_headlen() is less than skb_transport_offset(skb) + (skb_transport_header(skb)[1] << 3). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit b83d50f43165e8c21d580f40c57d8f6fe85adb59 Author: Kuniyuki Iwashima Date: Wed Jun 14 16:01:06 2023 -0700 ipv6: exthdrs: Reload hdr only when needed in ipv6_srh_rcv(). We need not reload hdr in ipv6_srh_rcv() unless we call pskb_expand_head(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 0d2e27b858503472f8ed66910498205824b02f8a Author: Kuniyuki Iwashima Date: Wed Jun 14 16:01:05 2023 -0700 ipv6: exthdrs: Replace pskb_pull() with skb_pull() in ipv6_srh_rcv(). ipv6_rthdr_rcv() pulls these data - Segment Routing Header : 8 - Hdr Ext Len : skb_transport_header(skb)[1] << 3 needed by ipv6_srh_rcv(), so pskb_pull() in ipv6_srh_rcv() never fails and can be replaced with skb_pull(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 6facbca52da2c209ddffa0c9547769cbcaa268ef Author: Kuniyuki Iwashima Date: Wed Jun 14 16:01:04 2023 -0700 ipv6: rpl: Remove redundant multicast tests in ipv6_rpl_srh_rcv(). ipv6_rpl_srh_rcv() checks if ipv6_hdr(skb)->daddr or ohdr->rpl_segaddr[i] is the multicast address with ipv6_addr_type(). We have the same check for ipv6_hdr(skb)->daddr in ipv6_rthdr_rcv(), so we need not recheck it in ipv6_rpl_srh_rcv(). Also, we should use ipv6_addr_is_multicast() for ohdr->rpl_segaddr[i] instead of ipv6_addr_type(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit ac9d8a66e41d553bf57fdffe88f59f1b1443191b Author: Kuniyuki Iwashima Date: Wed Jun 14 16:01:03 2023 -0700 ipv6: rpl: Remove pskb(_may)?_pull() in ipv6_rpl_srh_rcv(). As Eric Dumazet pointed out [0], ipv6_rthdr_rcv() pulls these data - Segment Routing Header : 8 - Hdr Ext Len : skb_transport_header(skb)[1] << 3 needed by ipv6_rpl_srh_rcv(). We can remove pskb_may_pull() and replace pskb_pull() with skb_pull() in ipv6_rpl_srh_rcv(). Link: https://lore.kernel.org/netdev/CANn89iLboLwLrHXeHJucAqBkEL_S0rJFog68t7wwwXO-aNf5Mg@mail.gmail.com/ [0] Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 8a4a0b2a3eaf75ca8854f856ef29690c12b2f531 Author: Filipe Manana Date: Mon Jun 19 17:21:50 2023 +0100 btrfs: fix race between quota disable and relocation If we disable quotas while we have a relocation of a metadata block group that has extents belonging to the quota root, we can cause the relocation to fail with -ENOENT. This is because relocation builds backref nodes for extents of the quota root and later needs to walk the backrefs and access the quota root - however if in between a task disables quotas, it results in deleting the quota root from the root tree (with btrfs_del_root(), called from btrfs_quota_disable(). This can be sporadically triggered by test case btrfs/255 from fstests: $ ./check btrfs/255 FSTYP -- btrfs PLATFORM -- Linux/x86_64 debian0 6.4.0-rc6-btrfs-next-134+ #1 SMP PREEMPT_DYNAMIC Thu Jun 15 11:59:28 WEST 2023 MKFS_OPTIONS -- /dev/sdc MOUNT_OPTIONS -- /dev/sdc /home/fdmanana/btrfs-tests/scratch_1 btrfs/255 6s ... _check_dmesg: something found in dmesg (see /home/fdmanana/git/hub/xfstests/results//btrfs/255.dmesg) - output mismatch (see /home/fdmanana/git/hub/xfstests/results//btrfs/255.out.bad) --- tests/btrfs/255.out 2023-03-02 21:47:53.876609426 +0000 +++ /home/fdmanana/git/hub/xfstests/results//btrfs/255.out.bad 2023-06-16 10:20:39.267563212 +0100 @@ -1,2 +1,4 @@ QA output created by 255 +ERROR: error during balancing '/home/fdmanana/btrfs-tests/scratch_1': No such file or directory +There may be more info in syslog - try dmesg | tail Silence is golden ... (Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/btrfs/255.out /home/fdmanana/git/hub/xfstests/results//btrfs/255.out.bad' to see the entire diff) Ran: btrfs/255 Failures: btrfs/255 Failed 1 of 1 tests To fix this make the quota disable operation take the cleaner mutex, as relocation of a block group also takes this mutex. This is also what we do when deleting a subvolume/snapshot, we take the cleaner mutex in the cleaner kthread (at cleaner_kthread()) and then we call btrfs_del_root() at btrfs_drop_snapshot() while under the protection of the cleaner mutex. Fixes: bed92eae26cc ("Btrfs: qgroup implementation and prototypes") CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 08eb2ad9db0a1f65786ab9133d6fe1683c0647c8 Author: Filipe Manana Date: Mon Jun 19 17:21:49 2023 +0100 btrfs: add comment to struct btrfs_fs_info::dirty_cowonly_roots Add a comment to struct btrfs_fs_info::dirty_cowonly_roots to mention that struct btrfs_fs_info::trans_lock is the lock that protects that list. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit babebf023e661b90b1c78b2baa384fb03a226879 Author: Filipe Manana Date: Mon Jun 19 17:21:48 2023 +0100 btrfs: fix race when deleting free space root from the dirty cow roots list When deleting the free space tree we are deleting the free space root from the list fs_info->dirty_cowonly_roots without taking the lock that protects it, which is struct btrfs_fs_info::trans_lock. This unsynchronized list manipulation may cause chaos if there's another concurrent manipulation of this list, such as when adding a root to it with ctree.c:add_root_to_dirty_list(). This can result in all sorts of weird failures caused by a race, such as the following crash: [337571.278245] general protection fault, probably for non-canonical address 0xdead000000000108: 0000 [#1] PREEMPT SMP PTI [337571.278933] CPU: 1 PID: 115447 Comm: btrfs Tainted: G W 6.4.0-rc6-btrfs-next-134+ #1 [337571.279153] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [337571.279572] RIP: 0010:commit_cowonly_roots+0x11f/0x250 [btrfs] [337571.279928] Code: 85 38 06 00 (...) [337571.280363] RSP: 0018:ffff9f63446efba0 EFLAGS: 00010206 [337571.280582] RAX: ffff942d98ec2638 RBX: ffff9430b82b4c30 RCX: 0000000449e1c000 [337571.280798] RDX: dead000000000100 RSI: ffff9430021e4900 RDI: 0000000000036070 [337571.281015] RBP: ffff942d98ec2000 R08: ffff942d98ec2000 R09: 000000000000015b [337571.281254] R10: 0000000000000009 R11: 0000000000000001 R12: ffff942fe8fbf600 [337571.281476] R13: ffff942dabe23040 R14: ffff942dabe20800 R15: ffff942d92cf3b48 [337571.281723] FS: 00007f478adb7340(0000) GS:ffff94349fa40000(0000) knlGS:0000000000000000 [337571.281950] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [337571.282184] CR2: 00007f478ab9a3d5 CR3: 000000001e02c001 CR4: 0000000000370ee0 [337571.282416] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [337571.282647] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [337571.282874] Call Trace: [337571.283101] [337571.283327] ? __die_body+0x1b/0x60 [337571.283570] ? die_addr+0x39/0x60 [337571.283796] ? exc_general_protection+0x22e/0x430 [337571.284022] ? asm_exc_general_protection+0x22/0x30 [337571.284251] ? commit_cowonly_roots+0x11f/0x250 [btrfs] [337571.284531] btrfs_commit_transaction+0x42e/0xf90 [btrfs] [337571.284803] ? _raw_spin_unlock+0x15/0x30 [337571.285031] ? release_extent_buffer+0x103/0x130 [btrfs] [337571.285305] reset_balance_state+0x152/0x1b0 [btrfs] [337571.285578] btrfs_balance+0xa50/0x11e0 [btrfs] [337571.285864] ? __kmem_cache_alloc_node+0x14a/0x410 [337571.286086] btrfs_ioctl+0x249a/0x3320 [btrfs] [337571.286358] ? mod_objcg_state+0xd2/0x360 [337571.286577] ? refill_obj_stock+0xb0/0x160 [337571.286798] ? seq_release+0x25/0x30 [337571.287016] ? __rseq_handle_notify_resume+0x3ba/0x4b0 [337571.287235] ? percpu_counter_add_batch+0x2e/0xa0 [337571.287455] ? __x64_sys_ioctl+0x88/0xc0 [337571.287675] __x64_sys_ioctl+0x88/0xc0 [337571.287901] do_syscall_64+0x38/0x90 [337571.288126] entry_SYSCALL_64_after_hwframe+0x72/0xdc [337571.288352] RIP: 0033:0x7f478aaffe9b So fix this by locking struct btrfs_fs_info::trans_lock before deleting the free space root from that list. Fixes: a5ed91828518 ("Btrfs: implement the free space B-tree") CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit b31cb5a6eb7a48b0a7bfdf06832b1fd5088d8c79 Author: Filipe Manana Date: Mon Jun 19 17:21:47 2023 +0100 btrfs: fix race when deleting quota root from the dirty cow roots list When disabling quotas we are deleting the quota root from the list fs_info->dirty_cowonly_roots without taking the lock that protects it, which is struct btrfs_fs_info::trans_lock. This unsynchronized list manipulation may cause chaos if there's another concurrent manipulation of this list, such as when adding a root to it with ctree.c:add_root_to_dirty_list(). This can result in all sorts of weird failures caused by a race, such as the following crash: [337571.278245] general protection fault, probably for non-canonical address 0xdead000000000108: 0000 [#1] PREEMPT SMP PTI [337571.278933] CPU: 1 PID: 115447 Comm: btrfs Tainted: G W 6.4.0-rc6-btrfs-next-134+ #1 [337571.279153] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [337571.279572] RIP: 0010:commit_cowonly_roots+0x11f/0x250 [btrfs] [337571.279928] Code: 85 38 06 00 (...) [337571.280363] RSP: 0018:ffff9f63446efba0 EFLAGS: 00010206 [337571.280582] RAX: ffff942d98ec2638 RBX: ffff9430b82b4c30 RCX: 0000000449e1c000 [337571.280798] RDX: dead000000000100 RSI: ffff9430021e4900 RDI: 0000000000036070 [337571.281015] RBP: ffff942d98ec2000 R08: ffff942d98ec2000 R09: 000000000000015b [337571.281254] R10: 0000000000000009 R11: 0000000000000001 R12: ffff942fe8fbf600 [337571.281476] R13: ffff942dabe23040 R14: ffff942dabe20800 R15: ffff942d92cf3b48 [337571.281723] FS: 00007f478adb7340(0000) GS:ffff94349fa40000(0000) knlGS:0000000000000000 [337571.281950] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [337571.282184] CR2: 00007f478ab9a3d5 CR3: 000000001e02c001 CR4: 0000000000370ee0 [337571.282416] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [337571.282647] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [337571.282874] Call Trace: [337571.283101] [337571.283327] ? __die_body+0x1b/0x60 [337571.283570] ? die_addr+0x39/0x60 [337571.283796] ? exc_general_protection+0x22e/0x430 [337571.284022] ? asm_exc_general_protection+0x22/0x30 [337571.284251] ? commit_cowonly_roots+0x11f/0x250 [btrfs] [337571.284531] btrfs_commit_transaction+0x42e/0xf90 [btrfs] [337571.284803] ? _raw_spin_unlock+0x15/0x30 [337571.285031] ? release_extent_buffer+0x103/0x130 [btrfs] [337571.285305] reset_balance_state+0x152/0x1b0 [btrfs] [337571.285578] btrfs_balance+0xa50/0x11e0 [btrfs] [337571.285864] ? __kmem_cache_alloc_node+0x14a/0x410 [337571.286086] btrfs_ioctl+0x249a/0x3320 [btrfs] [337571.286358] ? mod_objcg_state+0xd2/0x360 [337571.286577] ? refill_obj_stock+0xb0/0x160 [337571.286798] ? seq_release+0x25/0x30 [337571.287016] ? __rseq_handle_notify_resume+0x3ba/0x4b0 [337571.287235] ? percpu_counter_add_batch+0x2e/0xa0 [337571.287455] ? __x64_sys_ioctl+0x88/0xc0 [337571.287675] __x64_sys_ioctl+0x88/0xc0 [337571.287901] do_syscall_64+0x38/0x90 [337571.288126] entry_SYSCALL_64_after_hwframe+0x72/0xdc [337571.288352] RIP: 0033:0x7f478aaffe9b So fix this by locking struct btrfs_fs_info::trans_lock before deleting the quota root from that list. Fixes: bed92eae26cc ("Btrfs: qgroup implementation and prototypes") CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 6442550027f77a76efa7873b946c34c4a733febd Author: Naohiro Aota Date: Mon Jun 19 11:15:31 2023 +0900 btrfs: tracepoints: also show actual number of the outstanding extents The btrfs_inode_mod_outstanding_extents trace event only shows the modified number to the number of outstanding extents. It would be helpful if we can see the resulting extent number as well. Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit 377f71f6d68d13cf2f5c6c9011ce762224a57b82 Author: Ben Dooks Date: Fri Jun 16 15:22:03 2023 +0100 riscv: kvm: define vcpu_sbi_ext_pmu in header Sparse is giving a warning about vcpu_sbi_ext_pmu not being defined, so add a definition to the relevant header to fix the following: arch/riscv/kvm/vcpu_sbi_pmu.c:81:37: warning: symbol 'vcpu_sbi_ext_pmu' was not declared. Should it be static? Fixes: cbddc4c4cb9e ("RISC-V: KVM: Add SBI PMU extension support") Signed-off-by: Ben Dooks Reviewed-by: Anup Patel Reviewed-by: Conor Dooley Signed-off-by: Anup Patel commit 5463091a51cfaab8922ac94e5178a05dfa836dbb Author: Anup Patel Date: Thu Jun 15 13:03:53 2023 +0530 RISC-V: KVM: Expose IMSIC registers as attributes of AIA irqchip We expose IMSIC registers as KVM device attributes of the in-kernel AIA irqchip device. This will allow KVM user-space to save/restore IMISC state of each VCPU using KVM device ioctls(). Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit db8b7e97d6137a28b2bfc07e591d54da268f0c36 Author: Anup Patel Date: Thu Jun 15 13:03:52 2023 +0530 RISC-V: KVM: Add in-kernel virtualization of AIA IMSIC We can have AIA IMSIC support for both HS-level and VS-level but the VS-level IMSICs are optional. We use the VS-level IMSICs for Guest/VM whenever available otherwise we fallback to software emulation of AIA IMSIC. This patch adds in-kernel virtualization of AIA IMSIC. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit c0baf321038d5fa4273c0dc495d78f39848dd8fc Author: Evan Green Date: Tue May 9 11:25:03 2023 -0700 RISC-V: hwprobe: Expose Zba, Zbb, and Zbs Add two new bits to the IMA_EXT_0 key for ZBA, ZBB, and ZBS extensions. These are accurately reported per CPU. Signed-off-by: Evan Green Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20230509182504.2997252-4-evan@rivosinc.com Signed-off-by: Palmer Dabbelt commit 82e9c66e81c814e20ee2a3aafb60a9012c79fb40 Author: Evan Green Date: Tue May 9 11:25:02 2023 -0700 RISC-V: Track ISA extensions per hart The kernel maintains a mask of ISA extensions ANDed together across all harts. Let's also keep a bitmap of ISA extensions for each CPU. Although the kernel is currently unlikely to enable a feature that exists only on some CPUs, we want the ability to report asymmetric CPU extensions accurately to usermode. Note that riscv_fill_hwcaps() runs before the per_cpu_offsets are built, which is why I've used a [NR_CPUS] array rather than per_cpu() data. Signed-off-by: Evan Green Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230509182504.2997252-3-evan@rivosinc.com Signed-off-by: Palmer Dabbelt commit c6699baf10647b87b075bf6c65d25b4cd52d4830 Author: Evan Green Date: Tue May 9 11:25:01 2023 -0700 RISC-V: Add Zba, Zbs extension probing Add the Zba address bit manipulation extension and Zbs single bit instructions extension into those the kernel is aware of and maintains in its riscv_isa bitmap. Signed-off-by: Evan Green Reviewed-by: Andrew Jones Reviewed-by: Palmer Dabbelt Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20230509182504.2997252-2-evan@rivosinc.com Signed-off-by: Palmer Dabbelt commit c8407f2e560c53c4c73e77cb5604c8a408dbe7f7 Author: Chuck Lever Date: Wed Jun 7 10:00:09 2023 -0400 NFS: Add an "xprtsec=" NFS mount option After some discussion, we decided that controlling transport layer security policy should be separate from the setting for the user authentication flavor. To accomplish this, add a new NFS mount option to select a transport layer security policy for RPC operations associated with the mount point. xprtsec=none - Transport layer security is forced off. xprtsec=tls - Establish an encryption-only TLS session. If the initial handshake fails, the mount fails. If TLS is not available on a reconnect, drop the connection and try again. xprtsec=mtls - Both sides authenticate and an encrypted session is created. If the initial handshake fails, the mount fails. If TLS is not available on a reconnect, drop the connection and try again. To support client peer authentication (mtls), the handshake daemon will have configurable default authentication material (certificate or pre-shared key). In the future, mount options can be added that can provide this material on a per-mount basis. Updates to mount.nfs (to support xprtsec=auto) and nfs(5) will be sent under separate cover. Signed-off-by: Chuck Lever Signed-off-by: Trond Myklebust commit 6c0a8c5fcf7158e889dbdd077f67c81984704710 Author: Chuck Lever Date: Wed Jun 7 09:59:42 2023 -0400 NFS: Have struct nfs_client carry a TLS policy field The new field is used to match struct nfs_clients that have the same TLS policy setting. Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Trond Myklebust commit 75eb6af7acdf566c68d61e98e67ee2f235201c02 Author: Chuck Lever Date: Wed Jun 7 09:59:15 2023 -0400 SUNRPC: Add a TCP-with-TLS RPC transport class Use the new TLS handshake API to enable the SunRPC client code to request a TLS handshake. This implements support for RFC 9289, only on TCP sockets. Upper layers such as NFS use RPC-with-TLS to protect in-transit traffic. Signed-off-by: Chuck Lever Signed-off-by: Trond Myklebust commit f20233852ae295fde59c9a28c4a2087d693de3fb Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:06 2023 +0200 dt-bindings: riscv: cpus: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Acked-by: Rob Herring Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230609140706.64623-1-krzysztof.kozlowski@linaro.org Signed-off-by: Palmer Dabbelt commit ca7473cb8312232d8e03808004c54528e9446b73 Author: Sunil V L Date: Wed Jun 7 16:54:17 2023 +0530 RISC-V/perf: Use standard interface to get INTC domain Currently the PMU driver is using DT based lookup to find the INTC node for sscofpmf extension. This will not work for ACPI based systems causing the driver to fail to register the PMU overflow interrupt handler. Hence, change the code to use the standard interface to find the INTC node which works irrespective of DT or ACPI. Signed-off-by: Sunil V L Reviewed-by: Conor Dooley Reviewed-by: Atish Patra Link: https://lore.kernel.org/r/20230607112417.782085-3-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 3b426d4b5b1462b8da31d4e631ac4f3c6270e9e1 Author: Sunil V L Date: Wed Jun 7 16:54:16 2023 +0530 RISC-V: ACPI : Fix for usage of pointers in different address space The arch specific __acpi_map_table can be wrapper around either early_memremap or early_ioremap. But early_memremap routine works with normal pointers whereas __acpi_map_table expects pointers in iomem address space. This causes kernel test bot to fail while using the sparse tool. Fix the issue by using early_ioremap and similar fix done for __acpi_unmap_table. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/ Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core") Signed-off-by: Sunil V L Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230607112417.782085-2-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit c6399b893043a5bb634de8677362f96684f1c0c8 Author: Song Shuai Date: Mon May 22 10:50:20 2023 +0800 riscv: hibernation: Remove duplicate call of suspend_restore_csrs The suspend_restore_csrs is called in both __hibernate_cpu_resume and the `else` of subsequent swsusp_arch_suspend. Removing the first call makes both suspend_{save,restore}_csrs left in swsusp_arch_suspend for clean code. Fixes: c0317210012e ("RISC-V: Add arch functions to support hibernation/suspend-to-disk") Reviewed-by: Conor Dooley Reviewed-by: JeeHeng Sia Signed-off-by: Song Shuai Link: https://lore.kernel.org/r/20230522025020.285042-1-songshuaishuai@tinylab.org Signed-off-by: Palmer Dabbelt commit 650ea2a1dd964ca0a9c55f68dcb614d359c6b7d7 Author: Song Shuai Date: Fri May 19 14:08:54 2023 +0800 riscv: hibernation: Replace jalr with jr before suspend_restore_regs No need to link the x1/ra reg via jalr before suspend_restore_regs So it's better to replace jalr with jr. Signed-off-by: Song Shuai Reviewed-by: JeeHeng Sia Link: https://lore.kernel.org/r/20230519060854.214138-1-suagrfillet@gmail.com Signed-off-by: Palmer Dabbelt commit dea034b963c8901bdcc3d3880c04f0d75c95112f Author: Chuck Lever Date: Wed Jun 7 09:58:49 2023 -0400 SUNRPC: Capture CMSG metadata on client-side receive kTLS sockets use CMSG to report decryption errors and the need for session re-keying. For RPC-with-TLS, an "application data" message contains a ULP payload, and that is passed along to the RPC client. An "alert" message triggers connection reset. Everything else is discarded. Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Trond Myklebust commit 0d3ca07ffda9291843bb0b4b39dea43535bb1f13 Author: Chuck Lever Date: Wed Jun 7 09:58:22 2023 -0400 SUNRPC: Ignore data_ready callbacks during TLS handshakes The RPC header parser doesn't recognize TLS handshake traffic, so it will close the connection prematurely with an error. To avoid that, shunt the transport's data_ready callback when there is a TLS handshake in progress. The XPRT_SOCK_IGNORE_RECV flag will be toggled by code added in a subsequent patch. Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Trond Myklebust commit 120726526e5ee3dfac11bd417e266a7e411f3315 Author: Chuck Lever Date: Wed Jun 7 09:58:04 2023 -0400 SUNRPC: Add RPC client support for the RPC_AUTH_TLS auth flavor The new authentication flavor is used only to discover peer support for RPC-over-TLS. Signed-off-by: Chuck Lever Signed-off-by: Trond Myklebust commit bc2473c90fca55bf95b2ab6af1dacee26a4f92f6 Author: Amir Goldstein Date: Thu Jun 15 14:22:29 2023 +0300 ovl: enable fsnotify events on underlying real files Overlayfs creates the real underlying files with fake f_path, whose f_inode is on the underlying fs and f_path on overlayfs. Those real files were open with FMODE_NONOTIFY, because fsnotify code was not prapared to handle fsnotify hooks on files with fake path correctly and fanotify would report unexpected event->fd with fake overlayfs path, when the underlying fs was being watched. Teach fsnotify to handle events on the real files, and do not set real files to FMODE_NONOTIFY to allow operations on real file (e.g. open, access, modify, close) to generate async and permission events. Because fsnotify does not have notifications on address space operations, we do not need to worry about ->vm_file not reporting events to a watched overlayfs when users are accessing a mapped overlayfs file. Acked-by: Jan Kara Signed-off-by: Amir Goldstein Message-Id: <20230615112229.2143178-6-amir73il@gmail.com> Signed-off-by: Christian Brauner commit 97d1c83c3ff40759f64784210da21ca6225d8422 Author: Chuck Lever Date: Wed Jun 7 09:57:37 2023 -0400 SUNRPC: Trace the rpc_create_args Pass the upper layer's rpc_create_args to the rpc_clnt_new() tracepoint so additional parts of the upper layer's request can be recorded. Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Trond Myklebust commit 500053191297fcf73023ff057da6d2aa35f738e0 Author: Chuck Lever Date: Wed Jun 7 09:57:10 2023 -0400 SUNRPC: Plumb an API for setting transport layer security Add an initial set of policies along with fields for upper layers to pass the requested policy down to the transport layer. Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Trond Myklebust commit 62d53c4a1dfe347bd87ede46ffad38c9a3870338 Author: Amir Goldstein Date: Thu Jun 15 14:22:28 2023 +0300 fs: use backing_file container for internal files with "fake" f_path Overlayfs uses open_with_fake_path() to allocate internal kernel files, with a "fake" path - whose f_path is not on the same fs as f_inode. Allocate a container struct backing_file for those internal files, that is used to hold the "fake" ovl path along with the real path. backing_file_real_path() can be used to access the stored real path. Signed-off-by: Amir Goldstein Message-Id: <20230615112229.2143178-5-amir73il@gmail.com> Signed-off-by: Christian Brauner commit 9e8ab85a7ea74b0698f14df9b828927b6db03bd2 Author: Chuck Lever Date: Wed Jun 7 09:56:43 2023 -0400 NFS: Improvements for fs_context-related tracepoints Add some missing observability to the fs_context tracepoints added by commit 33ce83ef0bb0 ("NFS: Replace fs_context-related dprintk() call sites with tracepoints"). Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Trond Myklebust commit 626590ea4c93814808a8c4e5ffd2aa0d27f05d4b Author: NeilBrown Date: Thu May 11 08:06:24 2023 +1000 SUNRPC: attempt to reach rpcbind with an abstract socket name NFS is primarily name-spaced using network namespaces. However it contacts rpcbind (and gss_proxy) using AF_UNIX sockets which are name-spaced using the mount namespaces. This requires a container using NFSv3 (the form that requires rpcbind) to manage both network and mount namespaces, which can seem an unnecessary burden. As NFS is primarily a network service it makes sense to use network namespaces as much as possible, and to prefer to communicate with an rpcbind running in the same network namespace. This can be done, while preserving the benefits of AF_UNIX sockets, by using an abstract socket address. An abstract address has a nul at the start of sun_path, and a length that is exactly the complete size of the sockaddr_un up to the end of the name, NOT including any trailing nul (which is not part of the address). Abstract addresses are local to a network namespace - regular AF_UNIX path names a resolved in the mount namespace ignoring the network namespace. This patch causes rpcb to first try an abstract address before continuing with regular AF_UNIX and then IP addresses. This ensures backwards compatibility. Choosing the name needs some care as the same address will be configured for rpcbind, and needs to be built in to libtirpc for this enhancement to be fully successful. There is no formal standard for choosing abstract addresses. The defacto standard appears to be to use a path name similar to what would be used for a filesystem AF_UNIX address - but with a leading nul. In that case "\0/var/run/rpcbind.sock" seems like the best choice. However at this time /var/run is deprecated in favour of /run, so "\0/run/rpcbind.sock" might be better. Though as we are deliberately moving away from using the filesystem it might seem more sensible to explicitly break the connection and just have "\0rpcbind.socket" using the same name as the systemd unit file.. This patch chooses the second option, which seems least likely to raise objections. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust commit 4388ce05fa38b17e7d9ddabffcb16ed778ee417c Author: NeilBrown Date: Thu May 11 08:06:24 2023 +1000 SUNRPC: support abstract unix socket addresses An "abtract" address for an AF_UNIX socket start with a nul and can contain any bytes for the given length, but traditionally doesn't contain other nuls. When reported, the leading nul is replaced by '@'. sunrpc currently rejects connections to these addresses and reports them as an empty string. To provide support for future use of these addresses, allow them for outgoing connections and report them more usefully. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust commit 8a05a8c31d06c5d0d67b273a4a00f87269adde82 Author: Amir Goldstein Date: Thu Jun 15 14:22:27 2023 +0300 fs: move kmem_cache_zalloc() into alloc_empty_file*() helpers Use a common helper init_file() instead of __alloc_file() for alloc_empty_file*() helpers and improrve the documentation. This is needed for a follow up patch that allocates a backing_file container. Suggested-by: Christoph Hellwig Signed-off-by: Amir Goldstein Reviewed-by: Christoph Hellwig Message-Id: <20230615112229.2143178-4-amir73il@gmail.com> Signed-off-by: Christian Brauner commit cbb0b9d4bbcfa96e7872808a63be03202536f1bc Author: Amir Goldstein Date: Thu Jun 15 14:22:26 2023 +0300 fs: use a helper for opening kernel internal files cachefiles uses kernel_open_tmpfile() to open kernel internal tmpfile without accounting for nr_files. cachefiles uses open_with_fake_path() for the same reason without the need for a fake path. Fork open_with_fake_path() to kernel_file_open() which only does the noaccount part and use it in cachefiles. Signed-off-by: Amir Goldstein Reviewed-by: Christoph Hellwig Message-Id: <20230615112229.2143178-3-amir73il@gmail.com> Signed-off-by: Christian Brauner commit 86e2e1f6d9215bfec88b82c16936ba0f3ddaeb00 Author: Anna Schumaker Date: Thu May 4 16:47:16 2023 -0400 NFSv4.2: SETXATTR should update ctime Otherwise, `stat` will report a stale value to users. Signed-off-by: Anna Schumaker Signed-off-by: Trond Myklebust commit 64edd55d0f1908220f6a4a53ff40c2b42b1bbfd5 Author: Anna Schumaker Date: Thu May 4 16:47:15 2023 -0400 NFSv4.2: Clean up xattr size macros Fold them into the other NFS v4.2 operations in the right spots and adjust spacing to keep the same style. Signed-off-by: Anna Schumaker Signed-off-by: Trond Myklebust commit d56e0ddb8fc35a7aa13ab8f21c499a34f45dda05 Author: Amir Goldstein Date: Thu Jun 15 14:22:25 2023 +0300 fs: rename {vfs,kernel}_tmpfile_open() Overlayfs and cachefiles use vfs_open_tmpfile() to open a tmpfile without accounting for nr_files. Rename this helper to kernel_tmpfile_open() to better reflect this helper is used for kernel internal users. Signed-off-by: Amir Goldstein Reviewed-by: Christoph Hellwig Message-Id: <20230615112229.2143178-2-amir73il@gmail.com> Signed-off-by: Christian Brauner commit d594097367b836482db291a4bec54f67cfda2374 Author: Anna Schumaker Date: Thu May 4 16:47:14 2023 -0400 NFSv4.2: Clean up nfs4_xdr_dec_*xattr() functions I add commends above each function to match the style of the other nfs4_xdr_dec_*() functions. I also remove the unnecessary #ifdef CONFIG_NFS_V4_2 that was added around this code, since we are already in a v4.2-only file. Signed-off-by: Anna Schumaker Signed-off-by: Trond Myklebust commit 31f1bd8f89f5903583ca544c7700b141062aea9d Author: Anna Schumaker Date: Thu May 4 16:47:13 2023 -0400 NFSv4.2: Clean up: Move nfs4_xdr_enc_*xattr() functions They should be in the nfs4_xdr_enc_*() section, and not at the bottom of the file. Signed-off-by: Anna Schumaker Signed-off-by: Trond Myklebust commit 04b4c9fb07bfb196378fd449f6125dfeadb9acc5 Author: Anna Schumaker Date: Thu May 4 16:47:12 2023 -0400 NFSv4.2: Clean up: move decode_*xattr() functions Move them out of the encode_*() section and into the decode_*() section where it belongs. Signed-off-by: Anna Schumaker Signed-off-by: Trond Myklebust commit fd42ba8223fd698ea4e48407e5d5cc99f6befdb9 Author: Anna Schumaker Date: Thu May 4 16:47:11 2023 -0400 NFSv4.2: Clean up: Move the encode_copy_commit() function Move the function to be with the other encode_*() functions, instead of in the middle of the nfs4_xdr_enc_*() section. Signed-off-by: Anna Schumaker Signed-off-by: Trond Myklebust commit c9e561c4753c8c561452393762b957241e74e820 Author: Jeff Layton Date: Thu Jun 15 08:49:45 2023 -0400 btrfs: update i_version in update_dev_time When updating the ctime, we also want to update i_version. This is just something I noticed by inspection. There is probably no way to test this today unless you can somehow get to this inode via nfsd. Still, I think it's the right thing to do for consistency's sake. David Sterba's comment: I don't see anything wrong with setting the iversion bit, however I also don't see where this would be useful. Agreed with the consistency, otherwise the time is updated when device super block is wiped or a device initialized, both are big events so missing that due to lack of iversion update seems unlikely. I'll add it to the queue, thanks. Signed-off-by: Jeff Layton [ add comments ] Signed-off-by: David Sterba commit 5a0702aac020b2e81f778e3477095d8ed39ce523 Author: Ben Greear Date: Wed May 17 11:44:28 2023 -0700 wifi: mac80211: add eht_capa debugfs field Output looks like this: [root@ct523c-0b29 ~]# cat /debug/ieee80211/wiphy6/netdev\:wlan6/stations/50\:28\:4a\:bd\:f4\:a7/eht_capa EHT supported MAC-CAP: 0x82 0x00 PHY-CAP: 0x0c 0x00 0x00 0x00 0x00 0x48 0x00 0x00 0x00 OM-CONTROL MAX-MPDU-LEN: 11454 242-TONE-RU-GT20MHZ NDP-4-EHT-LFT-32-GI BEAMFORMEE-80-NSS: 0 BEAMFORMEE-160-NSS: 0 BEAMFORMEE-320-NSS: 0 SOUNDING-DIM-80-NSS: 0 SOUNDING-DIM-160-NSS: 0 SOUNDING-DIM-320-NSS: 0 MAX_NC: 0 PPE_THRESHOLD_PRESENT NOMINAL_PKT_PAD: 0us MAX-NUM-SUPP-EHT-LTF: 1 SUPP-EXTRA-EHT-LTF MCS15-SUPP-MASK: 0 EHT bw <= 80 MHz, max NSS for MCS 8-9: Rx=2, Tx=2 EHT bw <= 80 MHz, max NSS for MCS 10-11: Rx=2, Tx=2 EHT bw <= 80 MHz, max NSS for MCS 12-13: Rx=2, Tx=2 EHT bw <= 160 MHz, max NSS for MCS 8-9: Rx=0, Tx=0 EHT bw <= 160 MHz, max NSS for MCS 10-11: Rx=0, Tx=0 EHT bw <= 160 MHz, max NSS for MCS 12-13: Rx=0, Tx=0 EHT bw <= 320 MHz, max NSS for MCS 8-9: Rx=0, Tx=0 EHT bw <= 320 MHz, max NSS for MCS 10-11: Rx=0, Tx=0 EHT bw <= 320 MHz, max NSS for MCS 12-13: Rx=0, Tx=0 EHT PPE Thresholds: 0xc1 0x0e 0xe0 0x00 0x00 Signed-off-by: Ben Greear Link: https://lore.kernel.org/r/20230517184428.999384-1-greearb@candelatech.com Signed-off-by: Johannes Berg commit 95aded1b1c409fb2e902c6bd455068700ac38878 Author: Uwe Kleine-König Date: Tue Mar 28 11:15:14 2023 +0200 clocksource/drivers/imx-gpt: Use only a single name for functions When looking at the data structs defining the different behaviours of the GPT blocks in different SoCs it's not helpful that the same functions are used with different names. So drop the cpp defines and use the original names. This commit was generated using: perl -i -e 'my %m; while (<>) { if (/^#define (imx[a-zA-Z0-6_]*)\s(imx[a-zA-Z0-6_]*)/) {$m{$1} = $2; } else { foreach my $f (keys %m) {s/$f/$m{$f}/; } print; } }' drivers/clocksource/timer-imx-gpt.c This patch has no effect on the generated code. Signed-off-by: Uwe Kleine-König Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230328091514.874724-1-u.kleine-koenig@pengutronix.de commit 1e302984616bb8e547347ac62beaaca2ad5db053 Author: Yogesh Hegde Date: Mon Jun 19 19:48:57 2023 +0530 staging: rtl8192e: Rename variable InitialGainHandler Rename variable InitialGainHandler to init_gain_handler to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Link: https://lore.kernel.org/r/a2f37a6cb962e9775978ae5f4fde958b74806a4e.1687183827.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit a6efe935c7f8670496622156ae424d2acf6eef7d Author: Yogesh Hegde Date: Mon Jun 19 19:48:36 2023 +0530 staging: rtl8192e: Rename variable LeisurePSLeave Rename variable LeisurePSLeave to leisure_ps_leave to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Link: https://lore.kernel.org/r/3c63f4d750b7365f233c35c676325c5e4ca54a4c.1687183827.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0ec908bc792c02b9ecf6c9f1b218be363d398b1c Author: Yogesh Hegde Date: Mon Jun 19 19:48:15 2023 +0530 staging: rtl8192e: Rename variable SetBWModeHandler Rename variable SetBWModeHandler to set_bw_mode_handler to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Link: https://lore.kernel.org/r/fe6c16cfe1d8f7ff41b5fce90fc63383fbfec4f5.1687183827.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 413cc33f2742ea8a542a6841393f15a2db62aa20 Author: Yogesh Hegde Date: Mon Jun 19 19:47:46 2023 +0530 staging: rtl8192e: Rename variable SetWirelessMode Rename variable SetWirelessMode to set_wireless_mode to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Link: https://lore.kernel.org/r/c0a65d217d272bf457917c89462c49e67bbfedb2.1687183827.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit a5052c85b9def55cf1c6d13bbed0ae07ffb1c6a1 Author: Arnd Bergmann Date: Fri Jun 16 16:50:10 2023 +0200 samples: pfsm: add CC_CAN_LINK dependency When no libc for the target architecture is available, cross-compiling the same cannot work: samples/pfsm/pfsm-wakeup.c:12:10: fatal error: fcntl.h: No such file or directory Fixes: 9e66fb5244953 ("samples: Add userspace example for TI TPS6594 PFSM") Reported-by: Guenter Roeck Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230616145013.3889906-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit af2e19d82a116bc622eea84c9faadd5f7e20bec4 Author: Claudiu Beznea Date: Thu Jun 15 13:25:46 2023 +0300 misc: fastrpc: check return value of devm_kasprintf() devm_kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: 3abe3ab3cdab ("misc: fastrpc: add secure domain support") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230615102546.581899-1-claudiu.beznea@microchip.com Signed-off-by: Greg Kroah-Hartman commit afc5fddd3937959b646011fe901360598f826a05 Merge: 74a81c4854a8c 94da3da96c357 Author: Greg Kroah-Hartman Date: Mon Jun 19 17:08:18 2023 +0200 Merge tag 'extcon-next-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Chanwoo writes: Update extcon next for v6.5 Detailed description for this pull request: 1. Clean-up extcon core without any behavior changes - Add extcon_alloc_cables/muex/groups to improve the readability of extcon_dev_register. - Fix kernel doc of property and property capability fields to aovid warnings and add missing description of struct extcon_dev. - Use DECLARE_BITMAP macro and sysfs_emit instead of sprintf - Use device_match_of_node helper instead of accessing the .of_node - Use ida_alloc/free to get the unique id for extcon device 2. Update extcon-usbc-tusb320.c to support usb_role_switch and accessory detection - Add usb_role_switch support on extcon-usbsc-tusb320. - Add additional accessory detection for audio/debug accessory and then pass the deteced accessory information to typec subsystem on extcon-usbsc-tusb320.c. - Add the support of unregistration of typec port on both error handling and driver removal step on 3. Update extcon provider drivers (apx288/qcom-spmi-misc/palmas) - Replace put_device with acpi_dev_put on extcon-axp288.c - Use platform_get_irq_byname_optional for getting irq of usb_id and usb_vbus on extcon-qcom-spmi-misc.c. - Remove unused of_gpio.h on extcon-palmas.c. 4. Fix the devicetree binding document - Rename misc node name to 'usb-dect@900' on pm8941-misc.yam - Fix usb-id and usb_vbus defintion on pm8941-misc.yaml - Drop unneeded quotes from extcon-arizona.c devicetree documentation * tag 'extcon-next-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: (26 commits) dt-bindings: extcon: wlf,arizona: drop unneeded quotes extcon: Switch i2c drivers back to use .probe() extcon: Drop unneeded assignments extcon: Use sizeof(*pointer) instead of sizeof(type) extcon: Use unique number for the extcon device ID extcon: Remove dup device name in the message and unneeded error check extcon: Use dev_of_node(dev) instead of dev->of_node extcon: Use device_match_of_node() helper extcon: Amend kernel documentation of struct extcon_dev extcon: Use sysfs_emit() to instead of sprintf() extcon: Use DECLARE_BITMAP() to declare bit arrays extcon: Fix kernel doc of property capability fields to avoid warnings extcon: Fix kernel doc of property fields to avoid warnings extcon: usbc-tusb320: add USB_ROLE_SWITCH dependency extcon: usbc-tusb320: add usb_role_switch support extcon: usbc-tusb320: add accessory detection support extcon: Add extcon_alloc_groups to simplify extcon register function extcon: Add extcon_alloc_muex to simplify extcon register function extcon: Add extcon_alloc_cables to simplify extcon register function extcon: Remove redundant null checking for class ... commit e738521a11f13e40af89f66527e59306c4169782 Author: Keguang Zhang Date: Fri May 12 18:37:24 2023 +0800 clocksource/drivers/loongson1: Move PWM timer to clocksource framework This patch moves most part of arch/mips/loongson32/common/time.c into drivers/clocksource. Adapt the driver to clocksource framework with devicetree support and updates Kconfig/Makefile options. Signed-off-by: Keguang Zhang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230512103724.587760-4-keguang.zhang@gmail.com commit b25efff2a63f0d573f409f22e82904db9cc7d577 Author: Keguang Zhang Date: Fri May 12 18:37:23 2023 +0800 dt-bindings: timer: Add Loongson-1 clocksource Add devicetree binding document for Loongson-1 clocksource. Signed-off-by: Keguang Zhang Reviewed-by: Krzysztof Kozlowski Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230512103724.587760-3-keguang.zhang@gmail.com commit 9e130e2be4e7ac54de1ecc3fa424ca7ddfb1a748 Author: Keguang Zhang Date: Fri May 12 18:37:22 2023 +0800 MIPS: Loongson32: Remove deprecated PWM timer clocksource The Loongson1 PWM timer will be moved to clocksource framework. Then, the old driver is no longer needed. Remove the deprecated code and update the Kconfig. Signed-off-by: Keguang Zhang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230512103724.587760-2-keguang.zhang@gmail.com commit e794203e9d2d610faf6c5926345091193b202af5 Author: Ben Dooks Date: Fri Jun 16 18:24:43 2023 +0100 btrfs: make btrfs_compressed_bioset static The 'btrfs_compressed_bioset' struct isn't exported outside of the fs/btrfs/compression.c file, so make it static to fix the following sparse warning: fs/btrfs/compression.c:40:16: warning: symbol 'btrfs_compressed_bioset' was not declared. Should it be static? Reviewed-by: Christoph Hellwig Signed-off-by: Ben Dooks Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5fe251112646d8626818ea90f7af325bab243efa Author: Mike Hommey Date: Sun Jun 18 08:09:57 2023 +0900 HID: logitech-hidpp: add HIDPP_QUIRK_DELAYED_INIT for the T651. commit 498ba2069035 ("HID: logitech-hidpp: Don't restart communication if not necessary") put restarting communication behind that flag, and this was apparently necessary on the T651, but the flag was not set for it. Fixes: 498ba2069035 ("HID: logitech-hidpp: Don't restart communication if not necessary") Cc: stable@vger.kernel.org Signed-off-by: Mike Hommey Link: https://lore.kernel.org/r/20230617230957.6mx73th4blv7owqk@glandium.org Signed-off-by: Benjamin Tissoires commit ea95051063f95bf612683f5697e44604d0cbd0f1 Author: Paul Cercueil Date: Sun Jun 18 17:39:37 2023 +0200 clocksource/drivers/ingenic-timer: Use pm_sleep_ptr() macro The use of the pm_sleep_ptr() macro allows the compiler to always see the dev_pm_ops structure and related functions, while still allowing the unused code to be removed, without the need for the __maybe_unused markings. Signed-off-by: Paul Cercueil Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230618153937.96649-1-paul@crapouillou.net commit 9314d0530276aba19fd7b1c62b04eccb8e5327bc Author: Andy Shevchenko Date: Mon Jun 19 16:20:12 2023 +0300 pinctrl: cherryview: Drop goto label We do not use goto labels in the Intel pin control drivers, so drop the only one in the entire folder. Signed-off-by: Andy Shevchenko commit 930cbf92db0184e327293d5e7089be0b08d46371 Author: Jacky Huang Date: Mon Jun 19 03:23:29 2023 +0000 tty: serial: Add Nuvoton ma35d1 serial driver support This adds UART and console driver for Nuvoton ma35d1 Soc. It supports full-duplex communication, FIFO control, and hardware flow control. Command line set "console=ttyNVT0,115200", NVT means Nuvoton MA35 UART port. The UART driver probe will create path named "/dev/ttyNVTx". Signed-off-by: Jacky Huang Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230619032330.233796-2-ychuang570808@gmail.com Signed-off-by: Greg Kroah-Hartman commit e0edfdc15863ec80a1d9ac6e174dbccc00206dd0 Author: Sherry Sun Date: Mon Jun 19 16:06:13 2023 +0800 tty: serial: fsl_lpuart: add earlycon for imx8ulp platform Add earlycon support for imx8ulp platform. Signed-off-by: Sherry Sun Cc: stable Link: https://lore.kernel.org/r/20230619080613.16522-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit 639949a7031e04c59ec91614eceb9543e9120f43 Author: Martin Fuzzey Date: Fri Jun 16 12:47:23 2023 +0200 tty: serial: imx: fix rs485 rx after tx Since commit 79d0224f6bf2 ("tty: serial: imx: Handle RS485 DE signal active high") RS485 reception no longer works after a transmission. The following scenario shows the problem: 1) Open a port in RS485 mode 2) Receive data from remote (OK) 3) Transmit data to remote (OK) 4) Receive data from remote (Nothing received) In RS485 mode, imx_uart_start_tx() calls imx_uart_stop_rx() and, when the transmission is complete, imx_uart_stop_tx() calls imx_uart_start_rx(). Since the above commit imx_uart_stop_rx() now sets the loopback bit but imx_uart_start_rx() does not clear it causing the hardware to remain in loopback mode and not receive external data. Fix this by moving the existing loopback disable code to a helper function and calling it from imx_uart_start_rx() too. Fixes: 79d0224f6bf2 ("tty: serial: imx: Handle RS485 DE signal active high") Cc: stable@vger.kernel.org Signed-off-by: Martin Fuzzey Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230616104838.2729694-1-martin.fuzzey@flowbird.group Signed-off-by: Greg Kroah-Hartman commit 5aa735a4742c5ffff2fe34f764cbcbd917e100ae Author: Minda Chen Date: Thu May 18 19:27:48 2023 +0800 dt-bindings: usb: Add StarFive JH7110 USB controller StarFive JH7110 platforms USB have a wrapper module around the Cadence USBSS-DRD controller. Add binding information doc for that. Signed-off-by: Minda Chen Reviewed-by: Peter Chen Reviewed-by: Hal Feng Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230518112750.57924-6-minda.chen@starfivetech.com Signed-off-by: Greg Kroah-Hartman commit 6059d8124388c123f61a1affd1ebe04083dac588 Author: Varadarajan Narayanan Date: Fri Jun 9 11:26:30 2023 +0530 dt-bindings: usb: dwc3: Add IPQ9574 compatible * Document the IPQ9574 dwc3 compatible. * Make power-domains as optional since IPQ9574 doesn't have GDSCs Reviewed-by: Rob Herring Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/27fc578e549e12a4d689cdd434107964b529c4f4.1686289721.git.quic_varada@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 55f90c3f83c5d26ce6b1a6a01a4f435860376be4 Author: Colin Ian King Date: Thu Jun 15 15:40:52 2023 +0100 usb: cdns2: Fix spelling mistake in a trace message "Wakupe" -> "Wakeup" There is a spelling mistake in a trace message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20230615144052.2254528-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman commit ee400a1be11527e1ea58b716b338b9fb6665b8d6 Author: Azeem Shaikh Date: Thu Jun 15 18:03:18 2023 +0000 usb: gadget: function: printer: Replace strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since return value of -errno is used to check for truncation instead of PAGE_SIZE. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230615180318.400639-1-azeemshaikh38@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8be558dcffe69b078b34b1fa93b82acaf4ce4957 Author: Frank Wang Date: Fri Jun 16 15:52:41 2023 +0800 usb: typec: tcpm: add get max power support Traverse fixed pdos to calculate the maximum power that the charger can provide, and it can be get by POWER_SUPPLY_PROP_INPUT_POWER_LIMIT property. Signed-off-by: Frank Wang Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230616075241.27690-2-frank.wang@rock-chips.com Signed-off-by: Greg Kroah-Hartman commit 1e35f074399dece73d5df11847d4a0d7a6f49434 Author: Frank Wang Date: Fri Jun 16 15:52:40 2023 +0800 usb: typec: tcpm: fix cc role at port reset In the current implementation, the tcpm set CC1/CC2 role to open when it do port reset would cause the VBUS removed by the Type-C partner. This sets CC1/CC2 according to the default state of port to fix it. Signed-off-by: Frank Wang Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230616075241.27690-1-frank.wang@rock-chips.com Signed-off-by: Greg Kroah-Hartman commit a48b3f7be9c5e507ca07bd93d769798f4e5e68b1 Author: Andy Shevchenko Date: Fri Jun 16 16:53:13 2023 +0300 gpiolib: Drop unused domain_ops memeber of GPIO IRQ chip It seems there is no driver that requires custom IRQ chip domain options. Drop the member and respective code. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Acked-by: Marc Zyngier Signed-off-by: Bartosz Golaszewski commit 57e2936e22ed166734e011abcd755dfce87aefbc Author: Philipp Hortmann Date: Sat Jun 17 15:57:36 2023 +0200 staging: rtl8192e: Rename RTLLIB_LINKED_SCANNING Rename RTLLIB_LINKED_SCANNING to MAC80211_LINKED_SCANNING to align with rtlwifi driver. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/25b97cd436c636e750c50f0c03386fcc46e56610.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2445e3a5822b70354764835380022a5b9d26afb0 Author: Philipp Hortmann Date: Sat Jun 17 15:57:29 2023 +0200 staging: rtl8192e: Rename RTLLIB_LINKED to MAC80211_LINKED Rename RTLLIB_LINKED to MAC80211_LINKED to align with rtlwifi driver. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/532bd98301657b2a8329e95eccb993540ae9ba3f.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit fff6e8699345c853440df4a66650a95f67809bda Author: Philipp Hortmann Date: Sat Jun 17 15:57:23 2023 +0200 staging: rtl8192e: Rename RTLLIB_NOLINK to MAC80211_NOLINK Rename RTLLIB_NOLINK to MAC80211_NOLINK to align with rtlwifi driver. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/74feefdf800304deaf918efbc04344865f7aa01d.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 52ac3ff9d6418bb61ac9785d93cf0a8c8aacc1cd Author: Philipp Hortmann Date: Sat Jun 17 15:57:17 2023 +0200 staging: rtl8192e: Rename state to link_state Rename state to link_state to align with rtlwifi driver and to increase readability as state is to general. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/9cf4d0b01c6a84a11939099b628754d4c6d54839.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit f6689808492d191b534e844a7db4890ca9ac4afe Author: Philipp Hortmann Date: Sat Jun 17 15:57:10 2023 +0200 staging: rtl8192e: Rename rtllib_state to rtl_link_state Rename rtllib_state to rtl_link_state to align with rtlwifi driver and to increase readability as state is to general. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/f21541c16c83356e3cd1e08059847ef9a9eb2ef8.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0392ac23a943e7eb01a31844a1757e844c1720ce Author: Philipp Hortmann Date: Sat Jun 17 15:57:02 2023 +0200 staging: rtl8192e: Remove unused enum led_ctl_mode Remove unused enum led_ctl_mode to shorten code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/554729dba4d9358bdd6146ebd8fa17a0f525702e.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5cac011cf1e8aab1e43156dbb323818189c3fb90 Author: Philipp Hortmann Date: Sat Jun 17 15:56:56 2023 +0200 staging: rtl8192e: Rename constant IEEE_x to WIRELESS_MODE_x Rename constant IEEE_B to WIRELESS_MODE_B, IEEE_G -> WIRELESS_MODE_G and IEEE_N_24G -> WIRELESS_MODE_N_24G to align with rtlwifi driver as requested in TODO. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/37d81ab3cbb0231868d75b11eaa2f65a0e6a9379.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 26cdc2b7bdc9dd201b4920e598c5889aabde4691 Author: Philipp Hortmann Date: Sat Jun 17 15:56:49 2023 +0200 staging: rtl8192e: Remove unsupported modes IEEE_N_5G and IEEE_A Remove unsupported modes IEEE_N_5G and IEEE_A as those are not supported by hardware and are not offered by user software. Remove resulting dead code and unused defines. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/40c5b21654376348144280dbe45203140c6e6807.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 90262a95b060b40684192acf3944084cf0ead7fd Author: Philipp Hortmann Date: Sat Jun 17 15:56:41 2023 +0200 staging: rtl8192e: Remove variable stats->freq as it is constant stats->freq is initialized with 1 and then unchanged. All evaluations will result accordingly. Remove resulting dead code and unused defines. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4d8801d37889e6af4f43dff10d1426fc7918f562.1687007788.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5dfc6a8ae297800e1edebc76163b0868d5314a4e Author: Philipp Hortmann Date: Sun Jun 18 21:44:54 2023 +0200 staging: rtl8192e: Add missing entry CFG80211 in Kconfig Add missing entry CFG80211 in Kconfig to ensure that CFG80211 is available when selecting hardware rtl8192e. Fixes: d88b46ce5ab8 ("staging: rtl8192e: Add cfg80211.h and remove defined variables") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306180620.Ew55XtKJ-lkp@intel.com/ Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230618194454.GA10653@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman commit c07ce33a1ddd5a2e74ddcfc8cfcf7f94c3ee2347 Author: Arnd Bergmann Date: Fri Jun 16 16:50:33 2023 +0200 gpio: synq: remove unused zynq_gpio_irq_reqres/zynq_gpio_irq_relres The driver now uses the generic request/release callbacks, so the custom ones are no longer called. When building with -Woverride-init, gcc produces a warning about the duplicate entries: In file included from drivers/gpio/gpio-zynq.c:10: include/linux/gpio/driver.h:621:43: error: initialized field overwritten [-Werror=override-init] 621 | .irq_request_resources = gpiochip_irq_reqres, \ | ^~~~~~~~~~~~~~~~~~~ drivers/gpio/gpio-zynq.c:611:9: note: in expansion of macro 'GPIOCHIP_IRQ_RESOURCE_HELPERS' 611 | GPIOCHIP_IRQ_RESOURCE_HELPERS, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/gpio/driver.h:621:43: note: (near initialization for 'zynq_gpio_level_irqchip.irq_request_resources') 621 | .irq_request_resources = gpiochip_irq_reqres, \ | ^~~~~~~~~~~~~~~~~~~ drivers/gpio/gpio-zynq.c:625:9: note: in expansion of macro 'GPIOCHIP_IRQ_RESOURCE_HELPERS' 625 | GPIOCHIP_IRQ_RESOURCE_HELPERS, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/gpio/driver.h:622:43: error: initialized field overwritten [-Werror=override-init] 622 | .irq_release_resources = gpiochip_irq_relres | ^~~~~~~~~~~~~~~~~~~ Removing the old ones has no effect on the driver but avoids the warnings. Fixes: f569143935378 ("gpio: zynq: fix zynqmp_gpio not an immutable chip warning") Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 0ea22c4669e323817f8405416a09f6f52cc2ad2c Author: Alexander Stein Date: Mon Jun 19 08:39:07 2023 +0200 dt-bindings: gpio: gpio-vf610: Add parsing of hogs Allow parsing GPIO controller children nodes with GPIO hogs. Signed-off-by: Alexander Stein Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit 03a5233a8231baf4f717d0349e76d2b1f7d40e2d Author: Andy Shevchenko Date: Thu Jun 15 19:25:19 2023 +0300 gpio: lpc18xx: Remove unused of_gpio.h inclusion of_gpio.h shouldn't be used in GPIO drivers. Remove it. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Acked-by: Vladimir Zapolskiy Signed-off-by: Bartosz Golaszewski commit 5475e5141f3d1ddbbba6e5d931d9f48b691a0655 Author: Andy Shevchenko Date: Thu Jun 15 19:26:12 2023 +0300 gpio: xra1403: Remove unused of_gpio.h inclusion of_gpio.h shouldn't be used in GPIO drivers. Remove it. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit dc33d13c5e5d84fe4d0a929da332f3f7319ba4db Author: Andy Shevchenko Date: Thu Jun 15 19:25:14 2023 +0300 gpio: mpc8xxx: Remove unused of_gpio.h inclusion of_gpio.h shouldn't be used in GPIO drivers. Remove it. Signed-off-by: Andy Shevchenko Reviewed-by: Pali Rohár Signed-off-by: Bartosz Golaszewski commit 7ec2e4499e378768a985cd4679144713edb37035 Author: Dmitry Antipov Date: Mon Jun 19 13:38:56 2023 +0300 wifi: iwlwifi: dvm: fix -Wunused-const-variable gcc warning Fix the following gcc 13.1 warning observed with W=1: drivers/net/wireless/intel/iwlwifi/dvm/rs.c:207:39: warning: ‘iwl_rate_mcs’ defined but not used [-Wunused-const-variable=] This table is actually used in 'rs_sta_dbgfs_scale_table_read()' only if CONFIG_MAC80211_DEBUGFS is enabled, so the whole thing may be moved close to its actual use. Signed-off-by: Dmitry Antipov Link: https://lore.kernel.org/r/20230619103900.300628-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg commit e2fa5c2068fbea59e648d1637040ba8494f45104 Author: YueHaibing Date: Fri Jun 16 14:28:00 2023 +0800 xsk: Remove unused inline function xsk_buff_discard() commit f2f167583601 ("xsk: Remove unused xsk_buff_discard") left behind this, remove it. Signed-off-by: YueHaibing Signed-off-by: Daniel Borkmann Reviewed-by: Simon Horman Acked-by: Maciej Fijalkowski Link: https://lore.kernel.org/bpf/20230616062800.30780-1-yuehaibing@huawei.com commit 7f6719f7a8662a40afed367a685516f9f34e7bc2 Author: Andrii Nakryiko Date: Tue Jun 13 15:35:33 2023 -0700 bpf: Keep BPF_PROG_LOAD permission checks clear of validations Move out flags validation and license checks out of the permission checks. They were intermingled, which makes subsequent changes harder. Clean this up: perform straightforward flag validation upfront, and fetch and check license later, right where we use it. Also consolidate capabilities check in one block, right after basic attribute sanity checks. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20230613223533.3689589-5-andrii@kernel.org commit 6c3eba1c5e283fd2bb1c076dbfcb47f569c3bfde Author: Andrii Nakryiko Date: Tue Jun 13 15:35:32 2023 -0700 bpf: Centralize permissions checks for all BPF map types This allows to do more centralized decisions later on, and generally makes it very explicit which maps are privileged and which are not (e.g., LRU_HASH and LRU_PERCPU_HASH, which are privileged HASH variants, as opposed to unprivileged HASH and HASH_PERCPU; now this is explicit and easy to verify). Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20230613223533.3689589-4-andrii@kernel.org commit 22db41226b679768df8f0a4ff5de8e58f625f45b Author: Andrii Nakryiko Date: Tue Jun 13 15:35:31 2023 -0700 bpf: Inline map creation logic in map_create() function Currently find_and_alloc_map() performs two separate functions: some argument sanity checking and partial map creation workflow hanling. Neither of those functions are self-sufficient and are augmented by further checks and initialization logic in the caller (map_create() function). So unify all the sanity checks, permission checks, and creation and initialization logic in one linear piece of code in map_create() instead. This also make it easier to further enhance permission checks and keep them located in one place. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20230613223533.3689589-3-andrii@kernel.org commit 1d28635abcf1914425d6516e641978011984c58a Author: Andrii Nakryiko Date: Tue Jun 13 15:35:30 2023 -0700 bpf: Move unprivileged checks into map_create() and bpf_prog_load() Make each bpf() syscall command a bit more self-contained, making it easier to further enhance it. We move sysctl_unprivileged_bpf_disabled handling down to map_create() and bpf_prog_load(), two special commands in this regard. Also swap the order of checks, calling bpf_capable() only if sysctl_unprivileged_bpf_disabled is true, avoiding unnecessary audit messages. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20230613223533.3689589-2-andrii@kernel.org commit 337207408f74a8374beacf232ec1e08742c1d98f Author: Neil Armstrong Date: Thu Jun 15 14:51:45 2023 +0200 spi: spi-geni-qcom: correctly handle -EPROBE_DEFER from dma_request_chan() Now spi_geni_grab_gpi_chan() errors are correctly reported, the -EPROBE_DEFER error should be returned from probe in case the GPI dma driver is built as module and/or not probed yet. Fixes: b59c122484ec ("spi: spi-geni-qcom: Add support for GPI dma") Fixes: 6532582c353f ("spi: spi-geni-qcom: fix error handling in spi_geni_grab_gpi_chan()") Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20230615-topic-sm8550-upstream-fix-spi-geni-qcom-probe-v2-1-670c3d9e8c9c@linaro.org Signed-off-by: Mark Brown commit ce44a03db73f7ce7cca152e07bd9cbfc3c10a0ba Author: Mark Brown Date: Sat Jun 10 14:59:54 2023 +0100 regulator: ltc3676: Use maple tree register cache The ltc3676 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-regulator-ltc-maple-v1-2-08c15181f8b2@kernel.org Signed-off-by: Mark Brown commit 29890a15865deaf7f446119bcb5617b0cc76be03 Author: Mark Brown Date: Sat Jun 10 14:59:53 2023 +0100 regulator: ltc3589: Use maple tree register cache The ltc3589 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-regulator-ltc-maple-v1-1-08c15181f8b2@kernel.org Signed-off-by: Mark Brown commit d0c99ffe212679b338d12fe283964e6e43ce1501 Author: Mark Brown Date: Sat Jun 17 21:11:07 2023 +0100 regmap: Allow reads from write only registers with the flat cache The flat cache is intended for devices that need the lowest overhead so doesn't track any sparseness. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230617-regmap-kunit-read-writeonly-flat-v1-1-efd3ed66dec6@kernel.org Signed-off-by: Mark Brown commit 160fe8f6fdb13da6111677be6263e5d65e875987 Author: Matt Corallo Date: Mon Jun 5 16:49:45 2023 -0700 btrfs: add handling for RAID1C23/DUP to btrfs_reduce_alloc_profile Callers of `btrfs_reduce_alloc_profile` expect it to return exactly one allocation profile flag, and failing to do so may ultimately result in a WARN_ON and remount-ro when allocating new blocks, like the below transaction abort on 6.1. `btrfs_reduce_alloc_profile` has two ways of determining the profile, first it checks if a conversion balance is currently running and uses the profile we're converting to. If no balance is currently running, it returns the max-redundancy profile which at least one block in the selected block group has. This works by simply checking each known allocation profile bit in redundancy order. However, `btrfs_reduce_alloc_profile` has not been updated as new flags have been added - first with the `DUP` profile and later with the RAID1C34 profiles. Because of the way it checks, if we have blocks with different profiles and at least one is known, that profile will be selected. However, if none are known we may return a flag set with multiple allocation profiles set. This is currently only possible when a balance from one of the three unhandled profiles to another of the unhandled profiles is canceled after allocating at least one block using the new profile. In that case, a transaction abort like the below will occur and the filesystem will need to be mounted with -o skip_balance to get it mounted rw again (but the balance cannot be resumed without a similar abort). [770.648] ------------[ cut here ]------------ [770.648] BTRFS: Transaction aborted (error -22) [770.648] WARNING: CPU: 43 PID: 1159593 at fs/btrfs/extent-tree.c:4122 find_free_extent+0x1d94/0x1e00 [btrfs] [770.648] CPU: 43 PID: 1159593 Comm: btrfs Tainted: G W 6.1.0-0.deb11.7-powerpc64le #1 Debian 6.1.20-2~bpo11+1a~test [770.648] Hardware name: T2P9D01 REV 1.00 POWER9 0x4e1202 opal:skiboot-bc106a0 PowerNV [770.648] NIP: c00800000f6784fc LR: c00800000f6784f8 CTR: c000000000d746c0 [770.648] REGS: c000200089afe9a0 TRAP: 0700 Tainted: G W (6.1.0-0.deb11.7-powerpc64le Debian 6.1.20-2~bpo11+1a~test) [770.648] MSR: 9000000002029033 CR: 28848282 XER: 20040000 [770.648] CFAR: c000000000135110 IRQMASK: 0 GPR00: c00800000f6784f8 c000200089afec40 c00800000f7ea800 0000000000000026 GPR04: 00000001004820c2 c000200089afea00 c000200089afe9f8 0000000000000027 GPR08: c000200ffbfe7f98 c000000002127f90 ffffffffffffffd8 0000000026d6a6e8 GPR12: 0000000028848282 c000200fff7f3800 5deadbeef0000122 c00000002269d000 GPR16: c0002008c7797c40 c000200089afef17 0000000000000000 0000000000000000 GPR20: 0000000000000000 0000000000000001 c000200008bc5a98 0000000000000001 GPR24: 0000000000000000 c0000003c73088d0 c000200089afef17 c000000016d3a800 GPR28: c0000003c7308800 c00000002269d000 ffffffffffffffea 0000000000000001 [770.648] NIP [c00800000f6784fc] find_free_extent+0x1d94/0x1e00 [btrfs] [770.648] LR [c00800000f6784f8] find_free_extent+0x1d90/0x1e00 [btrfs] [770.648] Call Trace: [770.648] [c000200089afec40] [c00800000f6784f8] find_free_extent+0x1d90/0x1e00 [btrfs] (unreliable) [770.648] [c000200089afed30] [c00800000f681398] btrfs_reserve_extent+0x1a0/0x2f0 [btrfs] [770.648] [c000200089afeea0] [c00800000f681bf0] btrfs_alloc_tree_block+0x108/0x670 [btrfs] [770.648] [c000200089afeff0] [c00800000f66bd68] __btrfs_cow_block+0x170/0x850 [btrfs] [770.648] [c000200089aff100] [c00800000f66c58c] btrfs_cow_block+0x144/0x288 [btrfs] [770.648] [c000200089aff1b0] [c00800000f67113c] btrfs_search_slot+0x6b4/0xcb0 [btrfs] [770.648] [c000200089aff2a0] [c00800000f679f60] lookup_inline_extent_backref+0x128/0x7c0 [btrfs] [770.648] [c000200089aff3b0] [c00800000f67b338] lookup_extent_backref+0x70/0x190 [btrfs] [770.648] [c000200089aff470] [c00800000f67b54c] __btrfs_free_extent+0xf4/0x1490 [btrfs] [770.648] [c000200089aff5a0] [c00800000f67d770] __btrfs_run_delayed_refs+0x328/0x1530 [btrfs] [770.648] [c000200089aff740] [c00800000f67ea2c] btrfs_run_delayed_refs+0xb4/0x3e0 [btrfs] [770.648] [c000200089aff800] [c00800000f699aa4] btrfs_commit_transaction+0x8c/0x12b0 [btrfs] [770.648] [c000200089aff8f0] [c00800000f6dc628] reset_balance_state+0x1c0/0x290 [btrfs] [770.648] [c000200089aff9a0] [c00800000f6e2f7c] btrfs_balance+0x1164/0x1500 [btrfs] [770.648] [c000200089affb40] [c00800000f6f8e4c] btrfs_ioctl+0x2b54/0x3100 [btrfs] [770.648] [c000200089affc80] [c00000000053be14] sys_ioctl+0x794/0x1310 [770.648] [c000200089affd70] [c00000000002af98] system_call_exception+0x138/0x250 [770.648] [c000200089affe10] [c00000000000c654] system_call_common+0xf4/0x258 [770.648] --- interrupt: c00 at 0x7fff94126800 [770.648] NIP: 00007fff94126800 LR: 0000000107e0b594 CTR: 0000000000000000 [770.648] REGS: c000200089affe80 TRAP: 0c00 Tainted: G W (6.1.0-0.deb11.7-powerpc64le Debian 6.1.20-2~bpo11+1a~test) [770.648] MSR: 900000000000d033 CR: 24002848 XER: 00000000 [770.648] IRQMASK: 0 GPR00: 0000000000000036 00007fffc9439da0 00007fff94217100 0000000000000003 GPR04: 00000000c4009420 00007fffc9439ee8 0000000000000000 0000000000000000 GPR08: 00000000803c7416 0000000000000000 0000000000000000 0000000000000000 GPR12: 0000000000000000 00007fff9467d120 0000000107e64c9c 0000000107e64d0a GPR16: 0000000107e64d06 0000000107e64cf1 0000000107e64cc4 0000000107e64c73 GPR20: 0000000107e64c31 0000000107e64bf1 0000000107e64be7 0000000000000000 GPR24: 0000000000000000 00007fffc9439ee0 0000000000000003 0000000000000001 GPR28: 00007fffc943f713 0000000000000000 00007fffc9439ee8 0000000000000000 [770.648] NIP [00007fff94126800] 0x7fff94126800 [770.648] LR [0000000107e0b594] 0x107e0b594 [770.648] --- interrupt: c00 [770.648] Instruction dump: [770.648] 3b00ffe4 e8898828 481175f5 60000000 4bfff4fc 3be00000 4bfff570 3d220000 [770.648] 7fc4f378 e8698830 4811cd95 e8410018 <0fe00000> f9c10060 f9e10068 fa010070 [770.648] ---[ end trace 0000000000000000 ]--- [770.648] BTRFS: error (device dm-2: state A) in find_free_extent_update_loop:4122: errno=-22 unknown [770.648] BTRFS info (device dm-2: state EA): forced readonly [770.648] BTRFS: error (device dm-2: state EA) in __btrfs_free_extent:3070: errno=-22 unknown [770.648] BTRFS error (device dm-2: state EA): failed to run delayed ref for logical 17838685708288 num_bytes 24576 type 184 action 2 ref_mod 1: -22 [770.648] BTRFS: error (device dm-2: state EA) in btrfs_run_delayed_refs:2144: errno=-22 unknown [770.648] BTRFS: error (device dm-2: state EA) in reset_balance_state:3599: errno=-22 unknown Fixes: 47e6f7423b91 ("btrfs: add support for 3-copy replication (raid1c3)") Fixes: 8d6fac0087e5 ("btrfs: add support for 4-copy replication (raid1c4)") CC: stable@vger.kernel.org # 5.10+ Signed-off-by: Matt Corallo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 81db6ae842b3c07edd67278e3693f53a28d694cf Author: Qu Wenruo Date: Mon Jun 12 15:23:29 2023 +0800 btrfs: scrub: remove btrfs_fs_info::scrub_wr_completion_workers Since the scrub rework introduced by commit 2af2aaf98205 ("btrfs: scrub: introduce structure for new BTRFS_STRIPE_LEN based interface") and later commits, scrub only needs one single workqueue, fs_info::scrub_worker. That scrub_wr_completion_workers is initially to handle the delay work after write bios finished. But the new scrub code goes submit-and-wait for write bios, thus all the work are done inside the scrub_worker. The last user of fs_info::scrub_wr_completion_workers is removed in commit 16f93993498b ("btrfs: scrub: remove the old writeback infrastructure"), so we can safely remove the workqueue. Reviewed-by: Christoph Hellwig Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit c2bbc0bab0bb3cdd38914fe714f9b6c3f7544e88 Author: Qu Wenruo Date: Mon Jun 12 14:14:29 2023 +0800 btrfs: scrub: remove scrub_ctx::csum_list member Since the rework of scrub introduced by commit 2af2aaf98205 ("btrfs: scrub: introduce structure for new BTRFS_STRIPE_LEN based interface") and later commits, scrub no longer keeps its data checksum inside sctx. Instead we have scrub_stripe::csums for the checksum of the stripe. Thus we can remove the unused scrub_ctx::csum_list member. Reviewed-by: Christoph Hellwig Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6822b3f708608d74820cd69e76de16d42899a230 Author: Filipe Manana Date: Tue Jun 13 17:07:54 2023 +0100 btrfs: do not BUG_ON after failure to migrate space during truncation During truncation we reserve 2 metadata units when starting a transaction (reserved space goes to fs_info->trans_block_rsv) and then attempt to migrate 1 unit (min_size bytes) from fs_info->trans_block_rsv into the local block reserve. If we ever fail we trigger a BUG_ON(), which should never happen, because we reserved 2 units. However if we happen to fail for some reason, we don't need to be so dire and hit a BUG_ON(), we can just error out the truncation and, since this is highly unexpected, surround the error check with WARN_ON(), to get an informative stack trace and tag the branh as 'unlikely'. Also make the 'min_size' variable const, since it's not supposed to ever change and any accidental change could possibly make the space migration not so unlikely to fail. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit df9f278239046719c91aeb59ec0afb1a99ee8b2b Author: Filipe Manana Date: Tue Jun 13 16:42:16 2023 +0100 btrfs: do not BUG_ON on failure to get dir index for new snapshot During the transaction commit path, at create_pending_snapshot(), there is no need to BUG_ON() in case we fail to get a dir index for the snapshot in the parent directory. This should fail very rarely because the parent inode should be loaded in memory already, with the respective delayed inode created and the parent inode's index_cnt field already initialized. However if it fails, it may be -ENOMEM like the comment at create_pending_snapshot() says or any error returned by btrfs_search_slot() through btrfs_set_inode_index_count(), which can be pretty much anything such as -EIO or -EUCLEAN for example. So the comment is not correct when it says it can only be -ENOMEM. However doing a BUG_ON() here is overkill, since we can instead abort the transaction and return the error. Note that any error returned by create_pending_snapshot() will eventually result in a transaction abort at cleanup_transaction(), called from btrfs_commit_transaction(), but we can explicitly abort the transaction at this point instead so that we get a stack trace to tell us that the call to btrfs_set_inode_index() failed. So just abort the transaction and return in case btrfs_set_inode_index() returned an error at create_pending_snapshot(). Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6f3eb72a1f26ee84ed9de99ffa9edb1a3748c33b Author: Filipe Manana Date: Mon Jun 12 11:40:59 2023 +0100 btrfs: send: do not BUG_ON() on unexpected symlink data extent There's really no need to BUG_ON() if we find a symlink with an extent that is not inline or is compressed. We can just make send fail with an error (-EUCLEAN) and log an informative error message, so just do that instead of BUG_ON(). Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit fc4026e26b3383b896af5c0923ada8ae7064ca07 Author: Filipe Manana Date: Mon Jun 12 11:40:17 2023 +0100 btrfs: do not BUG_ON() when dropping inode items from log root When dropping inode items from a log tree at drop_inode_items(), we this BUG_ON() on the result of btrfs_search_slot() because we don't expect an exact match since having a key with an offset of (u64)-1 is unexpected. That is generally true, but for dir index keys for example, we can get a key with such an offset value, even though it's very unlikely and it would take ages to increase the sequence counter for a dir index up to (u64)-1. We can deal with an exact match, we just have to delete the key at that slot, so there is really no need to BUG_ON(), error out or trigger any warning. So remove the BUG_ON(). Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 7569141e8fa855b509e674456132b83bca5f087c Author: Filipe Manana Date: Fri Jun 9 11:49:07 2023 +0100 btrfs: replace BUG_ON() at split_item() with proper error handling There's no need to BUG_ON() at split_item() if the leaf does not have enough free space for the new item, we can just return -ENOSPC since the caller can deal with errors from split_item(). Also, as this is a very unlikely condition to happen, because the caller has invoked setup_leaf_for_split() before calling split_item(), surround the condition with a WARN_ON() which makes it easier to notice this unexpected condition and tags the if branch with 'unlikely' as well. I've actually once hit this BUG_ON() with some incorrect code changes I had, which was very inconvenient as it required rebooting the VM. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 751a27615ddaaf95519565d83bac65b8aafab9e8 Author: Filipe Manana Date: Thu Jun 8 11:27:49 2023 +0100 btrfs: do not BUG_ON() on tree mod log failures at btrfs_del_ptr() At btrfs_del_ptr(), instead of doing a BUG_ON() in case we fail to record tree mod log operations, do a transaction abort and return the error to the callers. There's really no need for the BUG_ON() as we can release all resources in the context of all callers, and we have to abort because other future tree searches that use the tree mod log (btrfs_search_old_slot()) may get inconsistent results if other operations modify the tree after that failure and before the tree mod log based search. This implies btrfs_del_ptr() return an int instead of void, and making all callers check for returned errors. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 50b5d1fc41da21a4ecf219f37fbca23c79020b08 Author: Filipe Manana Date: Thu Jun 8 11:27:48 2023 +0100 btrfs: do not BUG_ON() on tree mod log failures at insert_ptr() At insert_ptr(), instead of doing a BUG_ON() in case we fail to record tree mod log operations, do a transaction abort and return the error to the callers. There's really no need for the BUG_ON() as we can release all resources in the context of all callers, and we have to abort because other future tree searches that use the tree mod log (btrfs_search_old_slot()) may get inconsistent results if other operations modify the tree after that failure and before the tree mod log based search. This implies making insert_ptr() return an int instead of void, and making all callers check for returned errors. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit f61aa7ba08abc09eaf8eb766d9469e9393c22dbf Author: Filipe Manana Date: Thu Jun 8 11:27:47 2023 +0100 btrfs: do not BUG_ON() on tree mod log failure at insert_new_root() At insert_new_root(), instead of doing a BUG_ON() in case we fail to record the tree mod log operation, just return the error to the callers after releasing the allocated tree block. At this point we haven't made any changes to the b+tree, so we haven't left it in an inconsistent state and therefore have no need to abort the transaction. All we need to do is to unlock and free the extent buffer we just allocated with the purpose of making it the new root. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 11d6ae03557e34dd2bc9e57d1a5139ab3c7be54f Author: Filipe Manana Date: Thu Jun 8 11:27:46 2023 +0100 btrfs: do not BUG_ON() on tree mod log failures at push_nodes_for_insert() At push_nodes_for_insert(), instead of doing a BUG_ON() in case we fail to record tree mod log operations, do a transaction abort and return the error to the caller. There's really no need for the BUG_ON() as we can release all resources in this context, and we have to abort because other future tree searches that use the tree mod log (btrfs_search_old_slot()) may get inconsistent results if other operations modify the tree after that failure and before the tree mod log based search. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit eced687e224eb3cc5a501cf53ad9291337c8dbc5 Author: Filipe Manana Date: Thu Jun 8 11:27:45 2023 +0100 btrfs: abort transaction at update_ref_for_cow() when ref count is zero At update_ref_for_cow() we are calling btrfs_handle_fs_error() if we find that the extent buffer has an unexpected ref count of zero, however we can simply use btrfs_abort_transaction(), which achieves the same purposes: to turn the fs to error state, abort the current transaction and turn the fs to RO mode as well. Besides that, btrfs_abort_transaction() also prints a stack trace which makes it more useful. Also, as this is a very unexpected situation, indicating a serious corruption/inconsistency, tag the if branch as 'unlikely', set the error code to -EUCLEAN instead of -EROFS, and log an explicit message. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 725026ed593f1b6da66fe7e3777cd891dbf7343f Author: Filipe Manana Date: Thu Jun 8 11:27:44 2023 +0100 btrfs: abort transaction at balance_level() when left child is missing At balance_level() we are calling btrfs_handle_fs_error() when the middle child only has 1 item and the left child is missing, however we can simply use btrfs_abort_transaction(), which achieves the same purposes: to turn the fs to error state, abort the current transaction and turn the fs to RO mode. Besides that, btrfs_abort_transaction() also prints a stack trace which makes it more useful. Also, as this is a highly unexpected case and it's about a b+tree inconsistency, change the error code from -EROFS to -EUCLEAN, tag the if branch as 'unlikely' and log an explicit error message. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 87b8e9d06e3315c6f8d478fc8fc0dc4d25cf0e09 Author: Filipe Manana Date: Thu Jun 8 11:27:43 2023 +0100 btrfs: avoid unnecessarily setting the fs to RO and error state at balance_level() At balance_level(), when trying to promote a child node to a root node, if we fail to read the child we call btrfs_handle_fs_error(), which turns the fs to RO mode and sets it to error state as well, causing any ongoing transaction to abort. This however is not necessary because at that point we have not made any change yet at balance_level(), so any error reading the child node does not leaves us in any inconsistent state. Therefore we can just return the error to the caller. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit daefe4d435d75118af302dae650547b8b760da0b Author: Filipe Manana Date: Thu Jun 8 11:27:42 2023 +0100 btrfs: rename enospc label to out at balance_level() At balance_level() we have this 'enospc' label where we jump to in case we get an error at several places. However that error is certainly not -ENOSPC in call cases, it can be -EIO or -ENOMEM when reading a child extent buffer for example, or -ENOMEM when trying to record tree mod log operations. So to make this less confusing, rename the label to 'out'. Reviewed-by: Qu Wenruo Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 39020d8abc7ec62c4de9b260e3d10d4a1c2478ce Author: Filipe Manana Date: Thu Jun 8 11:27:41 2023 +0100 btrfs: do not BUG_ON() on tree mod log failure at balance_level() At balance_level(), instead of doing a BUG_ON() in case we fail to record tree mod log operations, do a transaction abort and return the error to the callers. There's really no need for the BUG_ON() as we can release all resources in this context, and we have to abort because other future tree searches that use the tree mod log (btrfs_search_old_slot()) may get inconsistent results if other operations modify the tree after that failure and before the tree mod log based search. CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 40b0a749388517de244643c09bdbb98f7dcb6ef1 Author: Filipe Manana Date: Thu Jun 8 11:27:40 2023 +0100 btrfs: do not BUG_ON() on tree mod log failure at __btrfs_cow_block() At __btrfs_cow_block(), instead of doing a BUG_ON() in case we fail to record a tree mod log root insertion operation, do a transaction abort instead. There's really no need for the BUG_ON(), we can properly release all resources in this context and turn the filesystem to RO mode and in an error state instead. CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8793ed87b376844af96ae0e367a9bcdb0035312f Author: Filipe Manana Date: Thu Jun 8 11:27:39 2023 +0100 btrfs: avoid tree mod log ENOMEM failures when we don't need to log When logging tree mod log operations we start by checking, in a lockless manner, if we need to log - if we don't, we just return and do nothing, otherwise we will allocate one or more tree mod log operations and then check again if we need to log. This second check will take the tree mod log lock in write mode if we need to log, otherwise it will do nothing and we just free the allocated memory and return success. We can improve on this by not returning an error in case the memory allocations fail, unless the second check tells us that we actually need to log. That is, if we fail to allocate memory and the second check tells use that we don't need to log, we can just return success and avoid returning -ENOMEM to the caller. Currently tree mod log failures are dealt with either a BUG_ON() or a transaction abort, as tree mod log operations are logged in code paths that modify a b+tree. So just avoid failing with -ENOMEM if we fail to allocate a tree mod log operation unless we actually need to log the operations, that is, if tree_mod_dont_log() returns true. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit ede600e497b1461d06d22a7d17703d9096868bc3 Author: Filipe Manana Date: Thu Jun 8 11:27:38 2023 +0100 btrfs: fix extent buffer leak after tree mod log failure at split_node() At split_node(), if we fail to log the tree mod log copy operation, we return without unlocking the split extent buffer we just allocated and without decrementing the reference we own on it. Fix this by unlocking it and decrementing the ref count before returning. Fixes: 5de865eebb83 ("Btrfs: fix tree mod logging") CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit d09c51521f22f9cbdfb1cf63e5c456077c622c84 Author: Filipe Manana Date: Thu Jun 8 11:27:37 2023 +0100 btrfs: add missing error handling when logging operation while COWing extent buffer When COWing an extent buffer that is not the root node, we need to log in the tree mod log that we replaced a pointer in the parent node, otherwise a tree mod log user doing a search on the b+tree can return incorrect results (that miss something). We are doing the call to btrfs_tree_mod_log_insert_key() but we totally ignore its return value. So fix this by adding the missing error handling, resulting in a transaction abort and freeing the COWed extent buffer. Fixes: f230475e62f7 ("Btrfs: put all block modifications into the tree mod log") CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit f02c75e630f09ff4906b0839ed0eaa37c2316132 Author: Christoph Hellwig Date: Thu Jun 8 11:11:33 2023 +0200 btrfs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file systems can just set the FMODE_CAN_ODIRECT flag at open time instead of wiring up a dummy direct_IO method to indicate support for direct I/O. Do that for btrfs so that noop_direct_IO can eventually be removed. Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit aadb164bdd5cd7e6c139f2fd5c696ee470cd95d4 Author: Filipe Manana Date: Tue Jun 6 15:26:03 2023 +0100 btrfs: update documentation for a block group's bg_list member Currently we are only documenting two uses of the bg_list member of a block group, but there two more: 1) To track deleted block groups for discard purposes, introduced in commit e33e17ee1098 ("btrfs: add missing discards when unpinning extents with -o discard"); 2) To track block groups for automatic reclaim, introduced more recently by commit 18bb8bbf13c1 ("btrfs: zoned: automatically reclaim zones") So document those two other use cases. Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7e27180994383b7c741ad87749db01e4989a02ba Author: Naohiro Aota Date: Tue Jun 6 14:36:36 2023 +0900 btrfs: reinsert BGs failed to reclaim The reclaim process can temporarily fail. For example, if the space is getting tight, it fails to make the block group read-only. If there are no further writes on that block group, the block group will never get back to the reclaim list, and the BG never gets reclaimed. In a certain workload, we can leave many such block groups never reclaimed. So, let's get it back to the list and give it a chance to be reclaimed. Fixes: 18bb8bbf13c1 ("btrfs: zoned: automatically reclaim zones") CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 93463ff7b54626f8276c0bd3d3f968fbf8d5d380 Author: Naohiro Aota Date: Tue Jun 6 14:36:35 2023 +0900 btrfs: bail out reclaim process if filesystem is read-only When a filesystem is read-only, we cannot reclaim a block group as it cannot rewrite the data. Just bail out in that case. Note that it can drop block groups in this case. As we did sb_start_write(), read-only filesystem means we got a fatal error and forced read-only. There is no chance to reclaim them again. Fixes: 18bb8bbf13c1 ("btrfs: zoned: automatically reclaim zones") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Filipe Manana Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit a9f189716cf15913c453299d72f69c51a9b0f86b Author: Naohiro Aota Date: Tue Jun 6 14:36:34 2023 +0900 btrfs: move out now unused BG from the reclaim list An unused block group is easy to remove to free up space and should be reclaimed fast. Such block group can often already be a target of the reclaim process. As we check list_empty(&bg->bg_list), we keep it in the reclaim list. That block group is never reclaimed until the file system is filled e.g. up to 75%. Instead, we can move unused block group to the unused list and delete it fast. Fixes: 18bb8bbf13c1 ("btrfs: zoned: automatically reclaim zones") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Filipe Manana Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 3ed01616bad6c7e3de196676b542ae3df8058592 Author: Naohiro Aota Date: Tue Jun 6 14:36:33 2023 +0900 btrfs: delete unused BGs while reclaiming BGs The reclaiming process only starts after the filesystem volumes are allocated to a certain level (75% by default). Thus, the list of reclaiming target block groups can build up so huge at the time the reclaim process kicks in. On a test run, there were over 1000 BGs in the reclaim list. As the reclaim involves rewriting the data, it takes really long time to reclaim the BGs. While the reclaim is running, btrfs_delete_unused_bgs() won't proceed because the reclaim side is holding fs_info->reclaim_bgs_lock. As a result, we will have a large number of unused BGs kept in the unused list. On my test run, I got 1057 unused BGs. Since deleting a block group is relatively easy and fast work, we can call btrfs_delete_unused_bgs() while it reclaims BGs, to avoid building up unused BGs. Fixes: 18bb8bbf13c1 ("btrfs: zoned: automatically reclaim zones") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Filipe Manana Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 0d394cca8435045f909bd2bb099575b11452e19a Author: Christoph Hellwig Date: Wed May 31 09:54:10 2023 +0200 btrfs: use btrfs_finish_ordered_extent to complete buffered writes Use the btrfs_finish_ordered_extent helper to complete compressed writes using the bbio->ordered pointer instead of requiring an rbtree lookup in the otherwise equivalent btrfs_mark_ordered_io_finished called from btrfs_writepage_endio_finish_ordered. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit b41b6f6937dc89e072b334e8d814487cb4692770 Author: Christoph Hellwig Date: Wed May 31 09:54:09 2023 +0200 btrfs: use btrfs_finish_ordered_extent to complete direct writes Use the btrfs_finish_ordered_extent helper to complete compressed writes using the bbio->ordered pointer instead of requiring an rbtree lookup in the otherwise equivalent btrfs_mark_ordered_io_finished called from btrfs_writepage_endio_finish_ordered. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7dd4395490369cfc6b3fe87e4ec2b5dd26259e08 Author: Christoph Hellwig Date: Wed May 31 09:54:08 2023 +0200 btrfs: use btrfs_finish_ordered_extent to complete compressed writes Use the btrfs_finish_ordered_extent helper to complete compressed writes using the bbio->ordered pointer instead of requiring an rbtree lookup in the otherwise equivalent btrfs_mark_ordered_io_finished called from btrfs_writepage_endio_finish_ordered. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4ba8223d3d0124894578554b473bd7cc680dfd5b Author: Christoph Hellwig Date: Wed May 31 09:54:07 2023 +0200 btrfs: open code end_extent_writepage in end_bio_extent_writepage This prepares for switching to more efficient ordered_extent processing and already removes the forth and back conversion from len to end back to len. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 122e9ede5355071359c10a8ebca138b162ef176b Author: Christoph Hellwig Date: Wed May 31 09:54:06 2023 +0200 btrfs: add a btrfs_finish_ordered_extent helper Add a helper to complete an ordered_extent without first doing a lookup. The tracepoint cannot use the ordered_extent class as we also want to print the range. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2d6f107ea6875792607fbc40313a990fe3ea522b Author: Christoph Hellwig Date: Wed May 31 09:54:05 2023 +0200 btrfs: factor out a btrfs_queue_ordered_fn helper Factor out a helper to queue up an ordered_extent completion in a work queue. This new helper will later be used complete an ordered_extent without first doing a lookup. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 53df25869a5659506cb35185997176eed49e125e Author: Christoph Hellwig Date: Wed May 31 09:54:04 2023 +0200 btrfs: factor out a can_finish_ordered_extent helper Factor out a helper from btrfs_mark_ordered_io_finished that does the actual per-ordered_extent work to check if we want to schedule an I/O completion. This new helper will later be used complete an ordered_extent without first doing a lookup. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit c59360f61aebf173442c2a128910876b3e41bfd0 Author: Christoph Hellwig Date: Wed May 31 09:54:03 2023 +0200 btrfs: use bbio->ordered in btrfs_csum_one_bio Use the ordered_extent pointer in the btrfs_bio instead of looking it up manually. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit ec63b84d4611b2f07e9242080f3e8de4a011820b Author: Christoph Hellwig Date: Wed May 31 09:54:02 2023 +0200 btrfs: add an ordered_extent pointer to struct btrfs_bio Add a pointer to the ordered_extent to the existing union in struct btrfs_bio, so all code dealing with data write bios can just use a pointer dereference to retrieve the ordered_extent instead of doing multiple rbtree lookups per I/O. The reference to this ordered_extent is dropped at end I/O time, which implies that an extra one must be acquired when the bio is split. This also requires moving the btrfs_extract_ordered_extent call into btrfs_split_bio so that the invariant of always having a valid ordered_extent reference for the btrfs_bio is kept. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 112397acc358883a90bb32b9597724dfbc3ccb41 Author: Christoph Hellwig Date: Wed May 31 09:54:01 2023 +0200 btrfs: open code btrfs_bio_end_io in btrfs_dio_submit_io btrfs_dio_submit_io is the only place that uses btrfs_bio_end_io to end a bio that hasn't been submitted using btrfs_submit_bio yet, and this invariant will become a problem with upcoming changes to the btrfs bio layer. Just open code the assignment of bi_status and the call to btrfs_dio_end_io. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit fbe960877b6f434525cc38e44334157223058e09 Author: Christoph Hellwig Date: Wed May 31 09:54:00 2023 +0200 btrfs: add a is_data_bbio helper Add a helper to check for that a btrfs_bio has a valid inode, and that it is a data inode to key off all the special handling for data path checksumming. Note that this uses is_data_inode instead of REQ_META as REQ_META is only set directly before submission in submit_one_bio and we'll also want to use this helper for error handling where REQ_META isn't set yet. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit ebfe4d4eb6ef6bd0f80293936808b77c1fc931b4 Author: Christoph Hellwig Date: Wed May 31 09:53:59 2023 +0200 btrfs: remove btrfs_add_ordered_extent All callers are gone now. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit d611935b5d434a697757463e77632ac1501cfd1e Author: Christoph Hellwig Date: Wed May 31 09:53:58 2023 +0200 btrfs: pass an ordered_extent to btrfs_submit_compressed_write btrfs_submit_compressed_write always operates on a single ordered_extent. Make that explicit by using btrfs_alloc_ordered_extent in the callers and passing the ordered_extent to btrfs_submit_compressed_write. This will help with storing and ordered_extent pointer in the btrfs_bio in subsequent patches. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 34bfaf15304b10e9c9e2fbd3012fa72710929b32 Author: Christoph Hellwig Date: Wed May 31 09:53:57 2023 +0200 btrfs: pass an ordered_extent to btrfs_reloc_clone_csums Both callers of btrfs_reloc_clone_csums allocate the ordered_extent that btrfs_reloc_clone_csums operates on. Switch them to use btrfs_alloc_ordered_extent instead of btrfs_add_ordered_extent and pass the ordered_extent to btrfs_reloc_clone_csums instead of doing an extra lookup. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3daea5fda1cdd74829d0306ab88b4798c38254ea Author: Christoph Hellwig Date: Wed May 31 09:53:56 2023 +0200 btrfs: merge the two calls to btrfs_add_ordered_extent in run_delalloc_nocow Refactor run_delalloc_nocow a little bit so that there is only a single call to btrfs_add_ordered_extent instead of two. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit a39da514eba81e687db05efb1e8b7cb393e2cb71 Author: Christoph Hellwig Date: Wed May 31 09:53:55 2023 +0200 btrfs: limit write bios to a single ordered extent Currently buffered writeback bios are allowed to span multiple ordered_extents, although that basically never actually happens since commit 4a445b7b6178 ("btrfs: don't merge pages into bio if their page offset is not contiguous"). Supporting bios than span ordered_extents complicates the file checksumming code, and prevents us from adding an ordered_extent pointer to the btrfs_bio structure. Use the existing code to limit a bio to single ordered_extent for zoned device writes for all writes. This allows to remove the REQ_BTRFS_ONE_ORDERED flags, and the handling of multiple ordered_extents in btrfs_csum_one_bio. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit c731cd0b6d255e4855a7cac9f276864032ab2387 Author: Christoph Hellwig Date: Wed May 31 09:53:54 2023 +0200 btrfs: fix file_offset for REQ_BTRFS_ONE_ORDERED bios that get split If a bio gets split, it needs to have a proper file_offset for checksum validation and repair to work properly. Based on feedback from Josef, commit 852eee62d31a ("btrfs: allow btrfs_submit_bio to split bios") skipped this adjustment for ONE_ORDERED bios. But if we actually ever need to split a ONE_ORDERED read bio, this will lead to a wrong file offset in the repair code. Right now the only user of the file_offset is logging of an error message so this is mostly harmless, but the wrong offset might be more problematic for additional users in the future. Fixes: 852eee62d31a ("btrfs: allow btrfs_submit_bio to split bios") Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1a1b0e729d227f9f758f7b5f1c997e874e94156e Author: David Sterba Date: Thu Jun 1 00:33:01 2023 +0200 btrfs: add block-group tree to lockdep classes The block group tree was not present among the lockdep classes. We could get potentially lockdep warnings but so far none has been seen, also because block-group-tree is a relatively new feature. CC: stable@vger.kernel.org # 6.1+ Signed-off-by: David Sterba commit 7027f87108ce3d23ea542e1a9a79056530db4a87 Author: Christoph Hellwig Date: Wed May 31 08:05:02 2023 +0200 btrfs: don't treat zoned writeback as being from an async helper thread When extent_write_locked_range was originally added, it was only used writing back compressed pages from an async helper thread. But it is now also used for writing back pages on zoned devices, where it is called directly from the ->writepage context. In this case we want to be able to pass on the writeback_control instead of creating a new one, and more importantly want to use all the normal cgroup interaction instead of potentially deferring writeback to another helper. Fixes: 898793d992c2 ("btrfs: zoned: write out partially allocated region") Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit eb34dceace983e304e00d4bf711cec0a603959ac Author: Christoph Hellwig Date: Wed May 31 08:05:01 2023 +0200 btrfs: only call __extent_writepage_io from extent_write_locked_range __extent_writepage does a lot of things that make no sense for extent_write_locked_range, given that extent_write_locked_range itself is called from __extent_writepage either directly or through a workqueue, and all this work has already been done in the first invocation and the pages haven't been unlocked since. Call __extent_writepage_io directly instead and open code the logic tracked in btrfs_bio_ctrl::extent_locked. Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9ecdbee819ca90589bf2efccfb90d5dabc0de057 Author: Christoph Hellwig Date: Wed May 31 08:05:00 2023 +0200 btrfs: move writeback_control::nr_to_write update to __extent_writepage Move the nr_to_write accounting from __extent_writepage_io to __extent_writepage_io as we'll grow another __extent_writepage_io that doesn't want this accounting soon. Also drop the obsolete comment - decrementing a counter in the on-stack writeback_control data structure doesn't need the page lock. Reviewed-by: Anand Jain Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit f22b5dcbd71edea087946511554956591557de9a Author: Christoph Hellwig Date: Wed May 31 08:04:59 2023 +0200 btrfs: remove non-standard extent handling in __extent_writepage_io __extent_writepage_io is never called for compressed or inline extents, or holes. Remove the not quite working code for them and replace it with asserts that these cases don't happen. Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit a994310aa26fcb6bd7529714ea713b6792630f67 Author: Christoph Hellwig Date: Wed May 31 08:04:58 2023 +0200 btrfs: remove PAGE_SET_ERROR Now that the btrfs writeback code has stopped using PageError, using PAGE_SET_ERROR to just set the per-address_space error flag is confusing. Open code the mapping_set_error calls in the callers and remove the PAGE_SET_ERROR flag. Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2b2553f12355577d8de3eaedfa25fce3368d652c Author: Christoph Hellwig Date: Wed May 31 08:04:57 2023 +0200 btrfs: stop setting PageError in the data I/O path PageError is not used by the VFS/MM and deprecated because it uses up a page bit and has no coherent rules. Instead read errors are usually propagated by not setting or clearing the uptodate bit, and write errors are propagated through the address_space. Btrfs now only sets the flag and never clears it for data pages, so just remove all places setting it, and the subpage error bit. Note that the error propagation for superblock writes that work on the block device mapping still uses PageError for now, but that will be addressed in a separate series. Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3e92499e3b004baffb479d61e191b41b604ece9a Author: Christoph Hellwig Date: Wed May 31 08:04:56 2023 +0200 btrfs: don't check PageError in __extent_writepage __extent_writepage currenly sets PageError whenever any error happens, and the also checks for PageError to decide if to call error handling. This leads to very unclear responsibility for cleaning up on errors. In the VM and generic writeback helpers the basic idea is that once I/O is fired off all error handling responsibility is delegated to the end I/O handler. But if that end I/O handler sets the PageError bit, and the submitter checks it, the bit could in some cases leak into the submission context for fast enough I/O. Fix this by simply not checking PageError and just using the local ret variable to check for submission errors. This also fundamentally solves the long problem documented in a comment in __extent_writepage by never leaking the error bit into the submission context. Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit bb7b05fe1b51e2ae529cbbd4c582ec83503f121a Author: Christoph Hellwig Date: Wed May 31 08:04:55 2023 +0200 btrfs: rename cow_file_range_async to run_delalloc_compressed cow_file_range_async is only used for compressed writeback. Rename it to run_delalloc_compressed, which also fits in with run_delalloc_nocow and run_delalloc_zoned. Reviewed-by: Anand Jain Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 973fb26e81a9f59dfe45b079a698c0e238f7bf69 Author: Christoph Hellwig Date: Wed May 31 08:04:54 2023 +0200 btrfs: don't fail writeback when allocating the compression context fails If cow_file_range_async fails to allocate the asynchronous writeback context, it currently returns an error and entirely fails the writeback. This is not a good idea as a writeback failure is a non-temporary error condition that will make the file system unusable. Just fall back to synchronous uncompressed writeback instead. This requires us to delay setting the BTRFS_INODE_HAS_ASYNC_EXTENT flag until we've committed to the async writeback. The compression checks INODE_NOCOMPRESS and FORCE_COMPRESS are moved from cow_file_range_async to the preceding checks btrfs_run_delalloc_range(). Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 57201dddd6f820de9ff94472da9b9cda88973c8f Author: Christoph Hellwig Date: Wed May 31 08:04:53 2023 +0200 btrfs: don't check PageError in btrfs_verify_page btrfs_verify_page is called from the readpage completion handler, which is only used to read pages, or parts of pages that aren't uptodate yet. The only case where PageError could be set on a page in btrfs is if we had a previous writeback error, but in that case we won't called readpage on it, as it has previously been marked uptodate. Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 02474880e8fdd8533f21da4264a7ebfce8196be7 Author: Dan Carpenter Date: Mon Jun 19 12:46:48 2023 +0300 ASoC: max98388: fix error code in probe() This seems like a copy and paste bug. Return the correct variable. It should be "ret" instead of PTR_ERR(max98388->regmap). Fixes: 6a8e1d46f062 ("ASoC: max98388: add amplifier driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/d44c8388-b12b-4045-95de-0d4bc7b428ac@moroto.mountain Signed-off-by: Mark Brown commit 2c14f0ffdd30bd3d321ad5fe76fcf701746e1df6 Author: Christoph Hellwig Date: Wed May 31 08:04:52 2023 +0200 btrfs: fix fsverify read error handling in end_page_read Also clear the uptodate bit to make sure the page isn't seen as uptodate in the page cache if fsverity verification fails. Fixes: 146054090b08 ("btrfs: initial fsverity support") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit ed9ee98ecb4fdbdfe043ee3eec0a65c0745d8669 Author: Christoph Hellwig Date: Wed May 31 08:04:51 2023 +0200 btrfs: factor out a btrfs_verify_page helper Split all the conditionals for the fsverity calls in end_page_read into a btrfs_verify_page helper to keep the code readable and make additional refactoring easier. Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 36614a3beba33a05ad78d4dcb9aa1d00e8a7d01f Author: Christoph Hellwig Date: Wed May 31 08:04:50 2023 +0200 btrfs: fix range_end calculation in extent_write_locked_range The range_end field in struct writeback_control is inclusive, just like the end parameter passed to extent_write_locked_range. Not doing this could cause extra writeout, which is harmless but suboptimal. Fixes: 771ed689d2cd ("Btrfs: Optimize compressed writeback and reads") CC: stable@vger.kernel.org # 5.9+ Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5cead5422a0e3d13b0bcee986c0f5c4ebb94100b Author: Boris Burkov Date: Thu Jun 1 11:55:14 2023 -0700 btrfs: insert tree mod log move in push_node_left There is a fairly unlikely race condition in tree mod log rewind that can result in a kernel panic which has the following trace: [530.569] BTRFS critical (device sda3): unable to find logical 0 length 4096 [530.585] BTRFS critical (device sda3): unable to find logical 0 length 4096 [530.602] BUG: kernel NULL pointer dereference, address: 0000000000000002 [530.618] #PF: supervisor read access in kernel mode [530.629] #PF: error_code(0x0000) - not-present page [530.641] PGD 0 P4D 0 [530.647] Oops: 0000 [#1] SMP [530.654] CPU: 30 PID: 398973 Comm: below Kdump: loaded Tainted: G S O K 5.12.0-0_fbk13_clang_7455_gb24de3bdb045 #1 [530.680] Hardware name: Quanta Mono Lake-M.2 SATA 1HY9U9Z001G/Mono Lake-M.2 SATA, BIOS F20_3A15 08/16/2017 [530.703] RIP: 0010:__btrfs_map_block+0xaa/0xd00 [530.755] RSP: 0018:ffffc9002c2f7600 EFLAGS: 00010246 [530.767] RAX: ffffffffffffffea RBX: ffff888292e41000 RCX: f2702d8b8be15100 [530.784] RDX: ffff88885fda6fb8 RSI: ffff88885fd973c8 RDI: ffff88885fd973c8 [530.800] RBP: ffff888292e410d0 R08: ffffffff82fd7fd0 R09: 00000000fffeffff [530.816] R10: ffffffff82e57fd0 R11: ffffffff82e57d70 R12: 0000000000000000 [530.832] R13: 0000000000001000 R14: 0000000000001000 R15: ffffc9002c2f76f0 [530.848] FS: 00007f38d64af000(0000) GS:ffff88885fd80000(0000) knlGS:0000000000000000 [530.866] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [530.880] CR2: 0000000000000002 CR3: 00000002b6770004 CR4: 00000000003706e0 [530.896] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [530.912] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [530.928] Call Trace: [530.934] ? btrfs_printk+0x13b/0x18c [530.943] ? btrfs_bio_counter_inc_blocked+0x3d/0x130 [530.955] btrfs_map_bio+0x75/0x330 [530.963] ? kmem_cache_alloc+0x12a/0x2d0 [530.973] ? btrfs_submit_metadata_bio+0x63/0x100 [530.984] btrfs_submit_metadata_bio+0xa4/0x100 [530.995] submit_extent_page+0x30f/0x360 [531.004] read_extent_buffer_pages+0x49e/0x6d0 [531.015] ? submit_extent_page+0x360/0x360 [531.025] btree_read_extent_buffer_pages+0x5f/0x150 [531.037] read_tree_block+0x37/0x60 [531.046] read_block_for_search+0x18b/0x410 [531.056] btrfs_search_old_slot+0x198/0x2f0 [531.066] resolve_indirect_ref+0xfe/0x6f0 [531.076] ? ulist_alloc+0x31/0x60 [531.084] ? kmem_cache_alloc_trace+0x12e/0x2b0 [531.095] find_parent_nodes+0x720/0x1830 [531.105] ? ulist_alloc+0x10/0x60 [531.113] iterate_extent_inodes+0xea/0x370 [531.123] ? btrfs_previous_extent_item+0x8f/0x110 [531.134] ? btrfs_search_path_in_tree+0x240/0x240 [531.146] iterate_inodes_from_logical+0x98/0xd0 [531.157] ? btrfs_search_path_in_tree+0x240/0x240 [531.168] btrfs_ioctl_logical_to_ino+0xd9/0x180 [531.179] btrfs_ioctl+0xe2/0x2eb0 This occurs when logical inode resolution takes a tree mod log sequence number, and then while backref walking hits a rewind on a busy node which has the following sequence of tree mod log operations (numbers filled in from a specific example, but they are somewhat arbitrary) REMOVE_WHILE_FREEING slot 532 REMOVE_WHILE_FREEING slot 531 REMOVE_WHILE_FREEING slot 530 ... REMOVE_WHILE_FREEING slot 0 REMOVE slot 455 REMOVE slot 454 REMOVE slot 453 ... REMOVE slot 0 ADD slot 455 ADD slot 454 ADD slot 453 ... ADD slot 0 MOVE src slot 0 -> dst slot 456 nritems 533 REMOVE slot 455 REMOVE slot 454 REMOVE slot 453 ... REMOVE slot 0 When this sequence gets applied via btrfs_tree_mod_log_rewind, it allocates a fresh rewind eb, and first inserts the correct key info for the 533 elements, then overwrites the first 456 of them, then decrements the count by 456 via the add ops, then rewinds the move by doing a memmove from 456:988->0:532. We have never written anything past 532, so that memmove writes garbage into the 0:532 range. In practice, this results in a lot of fully 0 keys. The rewind then puts valid keys into slots 0:455 with the last removes, but 456:532 are still invalid. When search_old_slot uses this eb, if it uses one of those invalid slots, it can then read the extent buffer and issue a bio for offset 0 which ultimately panics looking up extent mappings. This bad tree mod log sequence gets generated when the node balancing code happens to do a balance_node_right followed by a push_node_left while logging in the tree mod log. Illustrated for ebs L and R (left and right): L R start: [XXX|YYY|...] [ZZZ|...|...] balance_node_right: [XXX|YYY|...] [...|ZZZ|...] move Z to make room for Y [XXX|...|...] [YYY|ZZZ|...] copy Y from L to R push_node_left: [XXX|YYY|...] [...|ZZZ|...] copy Y from R to L [XXX|YYY|...] [ZZZ|...|...] move Z into emptied space (NOT LOGGED!) This is because balance_node_right logs a move, but push_node_left explicitly doesn't. That is because logging the move would remove the overwritten src < dst range in the right eb, which was already logged when we called btrfs_tree_mod_log_eb_copy. The correct sequence would include a move from 456:988 to 0:532 after remove 0:455 and before removing 0:532. Reversing that sequence would entail creating keys for 0:532, then moving those keys out to 456:988, then creating more keys for 0:455. i.e., REMOVE_WHILE_FREEING slot 532 REMOVE_WHILE_FREEING slot 531 REMOVE_WHILE_FREEING slot 530 ... REMOVE_WHILE_FREEING slot 0 MOVE src slot 456 -> dst slot 0 nritems 533 REMOVE slot 455 REMOVE slot 454 REMOVE slot 453 ... REMOVE slot 0 ADD slot 455 ADD slot 454 ADD slot 453 ... ADD slot 0 MOVE src slot 0 -> dst slot 456 nritems 533 REMOVE slot 455 REMOVE slot 454 REMOVE slot 453 ... REMOVE slot 0 Fix this to log the move but avoid the double remove by putting all the logging logic in btrfs_tree_mod_log_eb_copy which has enough information to detect these cases and properly log moves, removes, and adds. Leave btrfs_tree_mod_log_insert_move to handle insert_ptr and delete_ptr's tree mod logging. (Un)fortunately, this is quite difficult to reproduce, and I was only able to reproduce it by adding sleeps in btrfs_search_old_slot that would encourage more log rewinding during ino_to_logical ioctls. I was able to hit the warning in the previous patch in the series without the fix quite quickly, but not after this patch. CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Filipe Manana Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 95c8e349d8e8f190e28854e7ca96de866d2dc5a4 Author: Boris Burkov Date: Thu Jun 1 11:55:13 2023 -0700 btrfs: warn on invalid slot in tree mod log rewind The way that tree mod log tracks the ultimate length of the eb, the variable 'n', eventually turns up the correct value, but at intermediate steps during the rewind, n can be inaccurate as a representation of the end of the eb. For example, it doesn't get updated on move rewinds, and it does get updated for add/remove in the middle of the eb. To detect cases with invalid moves, introduce a separate variable called max_slot which tries to track the maximum valid slot in the rewind eb. We can then warn if we do a move whose src range goes beyond the max valid slot. There is a commented caveat that it is possible to have this value be an overestimate due to the challenge of properly handling 'add' operations in the middle of the eb, but in practice it doesn't cause enough of a problem to throw out the max idea in favor of tracking every valid slot. CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Filipe Manana Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 8ab546bb30bdf975e5ca6024ec6c4f7d324cb11a Author: David Sterba Date: Mon May 22 16:51:10 2023 +0200 btrfs: disable allocation warnings for compression workspaces The workspaces for compression are typically much larger than a page and for high zstd levels in the range of megabytes. There's a fallback to vmalloc but this can still fail (see the report). Some of the workspaces are preallocated at module load time so we have a safe fallback, otherwise when a new workspace is needed it's allocated but if this fails then the process waits. Which means the warning is only causing noise and we can use the GFP flag to disable it. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=217466 Signed-off-by: David Sterba commit 8680e58761eba8ea3552146ea005be30dfed2948 Author: Christoph Hellwig Date: Wed May 31 06:17:39 2023 +0200 btrfs: open code need_full_stripe conditions need_full_stripe is just a somewhat complicated way to say "op != BTRFS_MAP_READ". Just spell that explicit check out, which makes a lot of the code currently using the helper easier to understand. Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 723b8bb17e2e680934f59823ab1e72c1000d88d6 Author: Christoph Hellwig Date: Wed May 31 06:17:38 2023 +0200 btrfs: open code btrfs_map_sblock btrfs_map_sblock just hard codes three arguments and calls btrfs_map_sblock. Remove it as it doesn't provide any real value, but makes following the btrfs_map_block call chains harder. Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit cd4efd210edfb34f8cec3a0184899af751dc2d71 Author: Christoph Hellwig Date: Wed May 31 06:17:37 2023 +0200 btrfs: rename __btrfs_map_block to btrfs_map_block Now that the old btrfs_map_block is gone, drop the leading underscores from __btrfs_map_block. Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit d69d7ffc26f10d7be3768a6762809c57f6443a43 Author: Christoph Hellwig Date: Wed May 31 06:17:36 2023 +0200 btrfs: remove unused btrfs_map_block There are no users of btrfs_map_block left, so remove it. Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1650e8a8818d516219b2c0cbc203f53cc6cd77a0 Author: YingKun Meng Date: Mon Jun 19 15:46:49 2023 +0800 ASoC: loongson: change the type of variable irq to int We use variable 'irq' to store the return value of fwnode_get_irq_byname(). A negative value indicates that the operation failed. If the type of 'irq' is unsigned int, we never know if the operation failed. Reported-by: Harshit Mogalapalli Closes: https://lore.kernel.org/loongarch/325dd825-6fa5-0ebc-4b7e-7acf2d2840e4@loongson.cn/ Signed-off-by: YingKun Meng Link: https://lore.kernel.org/r/20230619074649.3608726-1-mengyingkun@loongson.cn Signed-off-by: Mark Brown commit 78a213a05df3510200331bfcc232bf0278c6ed50 Author: Christoph Hellwig Date: Wed May 31 06:17:35 2023 +0200 btrfs: optimize simple reads in btrfsic_map_block Pass a smap into __btrfs_map_block so that the usual case of a read that doesn't require parity raid recovery doesn't need an extra memory allocation for the btrfs_io_context. Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3965a4c793d3b031119ff455c4773441584aee30 Author: Christoph Hellwig Date: Wed May 31 06:17:34 2023 +0200 btrfs: remove unused BTRFS_MAP_DISCARD BTRFS_MAP_DISCARD is never set, as REQ_OP_DISCARD is never passed to btrfs_op() only only checked in two ASSERTS. Remove it and let the catchall WARN_ON in btrfs_op() deal with accidental REQ_OP_DISCARDs leaked into btrfs_op(). Last use was in a4012f06f188 ("btrfs: split discard handling out of btrfs_map_block"). Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit efcfcbc6a36195c42d98e0ee697baba36da94dc8 Author: David Sterba Date: Tue Apr 4 00:06:02 2023 +0200 btrfs: add xxhash to fast checksum implementations The implementation of XXHASH is now CPU only but still fast enough to be considered for the synchronous checksumming, like non-generic crc32c. A userspace benchmark comparing it to various implementations (patched hash-speedtest from btrfs-progs): Block size: 4096 Iterations: 1000000 Implementation: builtin Units: CPU cycles NULL-NOP: cycles: 73384294, cycles/i 73 NULL-MEMCPY: cycles: 228033868, cycles/i 228, 61664.320 MiB/s CRC32C-ref: cycles: 24758559416, cycles/i 24758, 567.950 MiB/s CRC32C-NI: cycles: 1194350470, cycles/i 1194, 11773.433 MiB/s CRC32C-ADLERSW: cycles: 6150186216, cycles/i 6150, 2286.372 MiB/s CRC32C-ADLERHW: cycles: 626979180, cycles/i 626, 22427.453 MiB/s CRC32C-PCL: cycles: 466746732, cycles/i 466, 30126.699 MiB/s XXHASH: cycles: 860656400, cycles/i 860, 16338.188 MiB/s Comparing purely software implementation (ref), current outdated accelerated using crc32q instruction (NI), optimized implementations by M. Adler (https://stackoverflow.com/questions/17645167/implementing-sse-4-2s-crc32c-in-software/17646775#17646775) and the best one that was taken from kernel using the PCLMULQDQ instruction (PCL). Reviewed-by: Christoph Hellwig Signed-off-by: David Sterba commit f000bc6fe43ce66c55fa1691000115b14ba95b33 Author: Christoph Hellwig Date: Wed May 24 17:03:17 2023 +0200 btrfs: pass the new logical address to split_extent_map split_extent_map splits off the first chunk of an extent map into a new one. One of the two users is the zoned I/O completion code that wants to rewrite the logical block start address right after this split. Pass in the logical address to be set in the split off first extent_map as an argument to avoid an extra extent tree lookup for this case. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit 71df088c1cc090d232eb691d8f42284a2c6409eb Author: Christoph Hellwig Date: Wed May 24 17:03:16 2023 +0200 btrfs: defer splitting of ordered extents until I/O completion The btrfs zoned completion code currently needs an ordered_extent and extent_map per bio so that it can account for the non-predictable write location from Zone Append. To archive that it currently splits the ordered_extent and extent_map at I/O submission time, and then records the actual physical address in the ->physical field of the ordered_extent. This patch instead switches to record the "original" physical address that the btrfs allocator assigned in spare space in the btrfs_bio, and then rewrites the logical address in the btrfs_ordered_sum structure at I/O completion time. This allows the ordered extent completion handler to simply walk the list of ordered csums and split the ordered extent as needed. This removes an extra ordered extent and extent_map lookup and manipulation during the I/O submission path, and instead batches it in the I/O completion path where we need to touch these anyway. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit 52b1fdca23ac0fbcad363a1a5b426bf0d56b715a Author: Christoph Hellwig Date: Wed May 24 17:03:15 2023 +0200 btrfs: handle completed ordered extents in btrfs_split_ordered_extent To delay splitting ordered_extents to I/O completion time we need to be able to handle fully completed ordered extents in btrfs_split_ordered_extent. Besides a bit of accounting this primarily involved moving over the csums to the split bio for the range that it covers, which is simple enough because we always have one btrfs_ordered_sum per bio. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit 816f589b8d43f7c258b0c10a5ce29daf01614651 Author: Christoph Hellwig Date: Wed May 24 17:03:14 2023 +0200 btrfs: atomically insert the new extent in btrfs_split_ordered_extent Currently there is a small race window in btrfs_split_ordered_extent, where the reduced old extent can be looked up on the per-inode rbtree or the per-root list while the newly split out one isn't visible yet. Fix this by open coding btrfs_alloc_ordered_extent in btrfs_split_ordered_extent, and holding the tree lock and root->ordered_extent_lock over the entire tree and extent manipulation. Note that this introduces new lock ordering because previously ordered_extent_lock was never held over the tree lock. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 53d9981ca20efcded0f6cf6b480d713f490ca9f1 Author: Christoph Hellwig Date: Wed May 24 17:03:13 2023 +0200 btrfs: split btrfs_alloc_ordered_extent to allocation and insertion helpers Split two low-level helpers out of btrfs_alloc_ordered_extent to allocate and insert the logic extent. The pure alloc helper will be used to improve btrfs_split_ordered_extent. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit b0307e28642efa3bcc6353b9af213711f6d3848e Author: Christoph Hellwig Date: Wed May 24 17:03:11 2023 +0200 btrfs: return the new ordered_extent from btrfs_split_ordered_extent Return the ordered_extent split from the passed in one. This will be needed to be able to store an ordered_extent in the btrfs_bio. Reviewed-by: Naohiro Aota Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit ebdb44a00e257641a398fe2484ba9c65a03beea1 Author: Christoph Hellwig Date: Wed May 24 17:03:10 2023 +0200 btrfs: reorder conditions in btrfs_extract_ordered_extent There is no good reason for doing one before the other in terms of failure implications, but doing the extent_map split first will simplify some upcoming refactoring. Reviewed-by: Naohiro Aota Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit a6f3e205e4916e4f29ce2c4c38d520616e6b0080 Author: Christoph Hellwig Date: Wed May 24 17:03:09 2023 +0200 btrfs: move split_extent_map to extent_map.c split_extent_map doesn't have anything to do with the other code in inode.c, so move it to extent_map.c. This also allows marking replace_extent_mapping static. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3e4ecd6c4e14e1eff8f52bd89240399e7dac881c Author: Shenghao Ding <13916275206@139.com> Date: Sun Jun 18 20:28:19 2023 +0800 ASoC: dt-bindings: Add tas2781 amplifier Create tas2781.yaml for tas2781 driver. Signed-off-by: Shenghao Ding <13916275206@139.com> Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230618122819.23143-4-13916275206@139.com Signed-off-by: Mark Brown commit 3887653c44ec1de089b8624bd53af05b946939e9 Author: Christoph Hellwig Date: Fri Jun 9 07:27:04 2023 +0200 btrfs: record orig_physical only for the original bio btrfs_submit_dev_bio is also called for clone bios that aren't embedded into a btrfs_bio structure, but previous commit "btrfs: optimize the logical to physical mapping for zoned writes" added code to assign btrfs_bio.orig_physical in it. This is harmless right now as only the single data profile can be used on zoned devices, but will blow up when the RAID stripe tree is added. Move it out into the single I/O specific branch in the caller. Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit cbfce4c7fbde23cc8bcba44822a58c728caf6ec9 Author: Christoph Hellwig Date: Wed May 24 17:03:08 2023 +0200 btrfs: optimize the logical to physical mapping for zoned writes The current code to store the final logical to physical mapping for a zone append write in the extent tree is rather inefficient. It first has to split the ordered extent so that there is one ordered extent per bio, so that it can look up the ordered extent on I/O completion in btrfs_record_physical_zoned and store the physical LBA returned by the block driver in the ordered extent. btrfs_rewrite_logical_zoned then has to do a lookup in the chunk tree to see what physical address the logical address for this bio / ordered extent is mapped to, and then rewrite it in the extent tree. To optimize this process, we can store the physical address assigned in the chunk tree to the original logical address and a pointer to btrfs_ordered_sum structure the in the btrfs_bio structure, and then use this information to rewrite the logical address in the btrfs_ordered_sum structure directly at I/O completion time in btrfs_record_physical_zoned. btrfs_rewrite_logical_zoned then simply updates the logical address in the extent tree and the ordered_extent itself. The code in btrfs_rewrite_logical_zoned now runs for all data I/O completions in zoned file systems, which is fine as there is no remapping to do for non-append writes to conventional zones or for relocation, and the overhead for quickly breaking out of the loop is very low. Because zoned file systems now need the ordered_sums structure to record the actual write location returned by zone append, allocate dummy structures without the csum array for them when the I/O doesn't use checksums, and free them when completing the ordered_extent. Note that the btrfs_bio doesn't grow as the new field are places into a union that is so far not used for data writes and has plenty of space left in it. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5cfe76f846d5034058c0c4813259d5d831757c36 Author: Christoph Hellwig Date: Wed May 24 17:03:07 2023 +0200 btrfs: rename the bytenr field in struct btrfs_ordered_sum to logical btrfs_ordered_sum::bytendr stores a logical address. Make that clear by renaming it to ->logical. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6e4b2479ab38b3f949a85964da212295d32102f0 Author: Christoph Hellwig Date: Wed May 24 17:03:06 2023 +0200 btrfs: mark the len field in struct btrfs_ordered_sum as unsigned len can't ever be negative, so mark it as an u32 instead of int. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit e9cb93b9fbd0bfcef2774e82d095362ad16acf6e Author: Christoph Hellwig Date: Wed May 24 17:03:05 2023 +0200 btrfs: don't call btrfs_record_physical_zoned for failed append When a zoned append command fails there is no written address reported, so don't try to record it. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit dd8b7b0416704efb0dcd74801a1a48aa221f1cf5 Author: Christoph Hellwig Date: Wed May 24 17:03:04 2023 +0200 btrfs: optimize out btrfs_is_zoned for !CONFIG_BLK_DEV_ZONED Add an IS_ENABLED check for CONFIG_BLK_DEV_ZONED in addition to the run-time check for the zone size. This will allow to make use of compiler dead code elimination for code guarded by btrfs_is_zoned, and for example provide just a dangling prototype for a function instead of adding a stub. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 99f09ce309b8307ce8dca209f936e99a7c332214 Author: Filipe Manana Date: Fri Jun 2 12:19:42 2023 +0100 btrfs: make btrfs_destroy_delayed_refs() return void btrfs_destroy_delayed_refs() always returns 0 and its single caller does not check its return value, as it also returns void, and so does the callers' caller and so on. This is because we are in the transaction abort path, where we have no way to deal with errors (we are in a critical situation) and all cleanup of resources works in a best effort fashion. So make btrfs_destroy_delayed_refs() return void. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 184533e3618f4d0b382c1ef3de0ce34e849005d7 Author: Filipe Manana Date: Mon May 29 16:17:06 2023 +0100 btrfs: remove unnecessary prototype declarations at disk-io.c We have a few static functions at disk-io.c for which we have a forward declaration of their prototype, but it's not needed because all those functions are defined before they are called, so remove them. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit f1ed785a5b9ca944771a08d0a2cdca961ac24329 Author: Filipe Manana Date: Mon May 29 16:17:05 2023 +0100 btrfs: use a single switch statement when initializing delayed ref head At init_delayed_ref_head(), we are using two separate if statements to check the delayed ref head action, and initializing 'must_insert_reserved' to false twice, once when the variable is declared and once again in an else branch. Make this simpler and more straightforward by having a single switch statement, also moving the comment about a drop action to the corresponding switch case to make it more clear and eliminating the duplicated initialization of 'must_insert_reserved' to false. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 61c681fef7dd44521070fd4198abede2077afb8e Author: Filipe Manana Date: Mon May 29 16:17:04 2023 +0100 btrfs: use bool type for delayed ref head fields that are used as booleans There's no point in have several fields defined as 1 bit unsigned int in struct btrfs_delayed_ref_head, we can instead use a bool type, it makes the code a bit more readable and it doesn't change the structure size. So switch them to proper booleans. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit ef3bcde75d06d65f78ba38a30d5a87fb83a5cdae Author: Shenghao Ding <13916275206@139.com> Date: Sun Jun 18 20:28:18 2023 +0800 ASoC: tas2781: Add tas2781 driver Create tas2781 driver. Signed-off-by: Shenghao Ding <13916275206@139.com> Link: https://lore.kernel.org/r/20230618122819.23143-3-13916275206@139.com Signed-off-by: Mark Brown commit 1e6b71c34bbbbde920357265abd161cb727487b8 Author: Filipe Manana Date: Mon May 29 16:17:03 2023 +0100 btrfs: assert correct lock is held at btrfs_select_ref_head() The function btrfs_select_ref_head() iterates over the red black tree of delayed reference heads, which is protected by the spinlock in the delayed refs root. The function doesn't take the lock, it's taken by its single caller, btrfs_obtain_ref_head(), because it needs to call that function and btrfs_delayed_ref_lock() in the same critical section (delimited by that spinlock). So assert at btrfs_select_ref_head() that we are holding the expected lock. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 798f4d95db0d71a2803c61b5e1fd5b739569c3da Author: Filipe Manana Date: Mon May 29 16:17:02 2023 +0100 btrfs: get rid of label and goto at insert_delayed_ref() At insert_delayed_ref() there's no point of having a label and goto in the case we were able to insert the delayed ref head. We can just add the code under label to the if statement's body and return immediately, and also there is no need to track the return value in a variable, we can just return a literal true or false value directly. So do those changes. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit f38462c4476cc57ef0e739bc8b8bc8f0a5754b3b Author: Filipe Manana Date: Mon May 29 16:17:01 2023 +0100 btrfs: make insert_delayed_ref() return a bool instead of an int insert_delayed_ref() can only return 0 or 1, to indicate if the given delayed reference was added to the head reference or if it was merged into an existing delayed ref, respectively. So just make it return a boolean instead. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 293f8197a4902227e39e7288aa06f7f2b0e29cc8 Author: Filipe Manana Date: Mon May 29 16:17:00 2023 +0100 btrfs: use a bool to track qgroup record insertion when adding ref head We are using an integer as a boolean to track the qgroup record insertion status when adding a delayed reference head. Since all we need is a boolean, switch the type from int to bool to make it more obvious. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4d34ad34d7cc5390ec03b25f2a7f2fd5041cb7d8 Author: Filipe Manana Date: Mon May 29 16:16:59 2023 +0100 btrfs: remove pointless in_tree field from struct btrfs_delayed_ref_node The 'in_tree' field is really not needed in struct btrfs_delayed_ref_node, as we can check whether a reference is in the tree or not simply by checking its red black tree node member with RB_EMPTY_NODE(), as when we remove it from the tree we always call RB_CLEAR_NODE(). So remove that field and use RB_EMPTY_NODE(). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 53499d5f6b68766317a62b1513e9386c2584e97c Author: Filipe Manana Date: Mon May 29 16:16:58 2023 +0100 btrfs: remove unused is_head field from struct btrfs_delayed_ref_node The 'is_head' field of struct btrfs_delayed_ref_node is no longer after commit d278850eff30 ("btrfs: remove delayed_ref_node from ref_head"), so remove it. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 315dd5cc75ddccb6ebd863366b7a7d0488057637 Author: Filipe Manana Date: Mon May 29 16:16:57 2023 +0100 btrfs: reorder some members of struct btrfs_delayed_ref_head Currently struct delayed_ref_head has its 'bytenr' and 'href_node' members in different cache lines (even on a release, non-debug, kernel). This is not optimal because when iterating the red black tree of delayed ref heads for inserting a new delayed ref head (htree_insert()) we have to pull in 2 cache lines of delayed ref heads we find in a patch, one for the tree node (struct rb_node) and another one for the 'bytenr' field. The same applies when searching for an existing delayed ref head (find_ref_head()). On a release (non-debug) kernel, the structure also has two 4 bytes holes, which makes it 8 bytes longer than necessary. Its current layout is the following: struct btrfs_delayed_ref_head { u64 bytenr; /* 0 8 */ u64 num_bytes; /* 8 8 */ refcount_t refs; /* 16 4 */ /* XXX 4 bytes hole, try to pack */ struct mutex mutex; /* 24 32 */ spinlock_t lock; /* 56 4 */ /* XXX 4 bytes hole, try to pack */ /* --- cacheline 1 boundary (64 bytes) --- */ struct rb_root_cached ref_tree; /* 64 16 */ struct list_head ref_add_list; /* 80 16 */ struct rb_node href_node __attribute__((__aligned__(8))); /* 96 24 */ struct btrfs_delayed_extent_op * extent_op; /* 120 8 */ /* --- cacheline 2 boundary (128 bytes) --- */ int total_ref_mod; /* 128 4 */ int ref_mod; /* 132 4 */ unsigned int must_insert_reserved:1; /* 136: 0 4 */ unsigned int is_data:1; /* 136: 1 4 */ unsigned int is_system:1; /* 136: 2 4 */ unsigned int processing:1; /* 136: 3 4 */ /* size: 144, cachelines: 3, members: 15 */ /* sum members: 128, holes: 2, sum holes: 8 */ /* sum bitfield members: 4 bits (0 bytes) */ /* padding: 4 */ /* bit_padding: 28 bits */ /* forced alignments: 1 */ /* last cacheline: 16 bytes */ } __attribute__((__aligned__(8))); This change reorders the 'href_node' and 'refs' members so that we have the 'href_node' in the same cache line as the 'bytenr' field, while also eliminating the two holes and reducing the structure size from 144 bytes down to 136 bytes, so we can now have 30 ref heads per 4K page (on x86_64) instead of 28. The new structure layout after this change is now: struct btrfs_delayed_ref_head { u64 bytenr; /* 0 8 */ u64 num_bytes; /* 8 8 */ struct rb_node href_node __attribute__((__aligned__(8))); /* 16 24 */ struct mutex mutex; /* 40 32 */ /* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */ refcount_t refs; /* 72 4 */ spinlock_t lock; /* 76 4 */ struct rb_root_cached ref_tree; /* 80 16 */ struct list_head ref_add_list; /* 96 16 */ struct btrfs_delayed_extent_op * extent_op; /* 112 8 */ int total_ref_mod; /* 120 4 */ int ref_mod; /* 124 4 */ /* --- cacheline 2 boundary (128 bytes) --- */ unsigned int must_insert_reserved:1; /* 128: 0 4 */ unsigned int is_data:1; /* 128: 1 4 */ unsigned int is_system:1; /* 128: 2 4 */ unsigned int processing:1; /* 128: 3 4 */ /* size: 136, cachelines: 3, members: 15 */ /* padding: 4 */ /* bit_padding: 28 bits */ /* forced alignments: 1 */ /* last cacheline: 8 bytes */ } __attribute__((__aligned__(8))); Running the following fs_mark test shows some significant improvement. $ cat test.sh #!/bin/bash # 15G null block device DEV=/dev/nullb0 MNT=/mnt/nullb0 FILES=100000 THREADS=$(nproc --all) FILE_SIZE=0 echo "performance" | \ tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor mkfs.btrfs -f $DEV mount -o ssd $DEV $MNT OPTS="-S 0 -L 5 -n $FILES -s $FILE_SIZE -t $THREADS -k" for ((i = 1; i <= $THREADS; i++)); do OPTS="$OPTS -d $MNT/d$i" done fs_mark $OPTS umount $MNT Before this change: FSUse% Count Size Files/sec App Overhead 10 1200000 0 112631.3 11928055 16 2400000 0 189943.8 12140777 23 3600000 0 150719.2 13178480 50 4800000 0 99137.3 12504293 53 6000000 0 111733.9 12670836 Total files/sec: 664165.5 After this change: FSUse% Count Size Files/sec App Overhead 10 1200000 0 148589.5 11565889 16 2400000 0 227743.8 11561596 23 3600000 0 191590.5 12550755 30 4800000 0 179812.3 12629610 53 6000000 0 92471.4 12352383 Total files/sec: 840207.5 Measuring the execution times of htree_insert(), in nanoseconds, during those fs_mark runs: Before this change: Range: 0.000 - 940647.000; Mean: 619.733; Median: 548.000; Stddev: 1834.231 Percentiles: 90th: 980.000; 95th: 1208.000; 99th: 2090.000 0.000 - 6.384: 257 | 6.384 - 26.259: 977 | 26.259 - 99.635: 4963 | 99.635 - 370.526: 136800 ############# 370.526 - 1370.603: 566110 ##################################################### 1370.603 - 5062.704: 24945 ## 5062.704 - 18693.248: 944 | 18693.248 - 69014.670: 211 | 69014.670 - 254791.959: 30 | 254791.959 - 940647.000: 4 | After this change: Range: 0.000 - 299200.000; Mean: 587.754; Median: 542.000; Stddev: 1030.422 Percentiles: 90th: 918.000; 95th: 1113.000; 99th: 1987.000 0.000 - 5.585: 163 | 5.585 - 20.678: 452 | 20.678 - 70.369: 1806 | 70.369 - 233.965: 26268 #### 233.965 - 772.564: 333519 ##################################################### 772.564 - 2545.771: 91820 ############### 2545.771 - 8383.615: 2238 | 8383.615 - 27603.280: 170 | 27603.280 - 90879.297: 68 | 90879.297 - 299200.000: 12 | Mean, percentiles, maximum times are all better, as well as a lower standard deviation. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 31dd8c81ddfa142dab53a0837eed88e8febe7b1e Author: Qu Wenruo Date: Tue May 30 09:45:28 2023 +0800 btrfs: use the same uptodate variable for end_bio_extent_readpage() In function end_bio_extent_readpage() we call endio_readpage_release_extent() to unlock the extent io tree. However we pass PageUptodate(page) as @uptodate parameter for it, while for previous end_page_read() call, we use a dedicated @uptodate local variable. This is not a big deal, as even for subpage cases, either the bio only covers part of the page, then the @uptodate is always false, and the subpage ranges can still be merged. But for the sake of consistency, always use @uptodate variable when possible. Reviewed-by: Christoph Hellwig Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5a96341927b097601e1fefc292f0a6e5273e7554 Author: Qu Wenruo Date: Tue May 30 09:45:27 2023 +0800 btrfs: subpage: make alloc_extent_buffer() handle previously uptodate range efficiently Currently alloc_extent_buffer() would make the extent buffer uptodate if the corresponding pages are also uptodate. But this check is only checking PageUptodate, which is fine for regular cases, but not for subpage cases, as we can have multiple extent buffers in the same page. So here we go btrfs_page_test_uptodate() instead. The old code doesn't cause any problem, but is not efficient, as it would cause extra metadata read even if the range is already uptodate. Reviewed-by: Christoph Hellwig Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit b831306b3b7d9202b300f7f6ec32f5be2b4926a3 Author: David Sterba Date: Wed May 3 21:08:16 2023 +0200 btrfs: print assertion failure report and stack trace from the same line Assertions reports are split into two parts, the exact file and location of the condition and then the stack trace printed from btrfs_assertfail(). This means all the stack traces report the same line and this is what's typically reported by various tools, making it harder to distinguish the reports. [403.2467] assertion failed: refcount_read(&block_group->refs) == 1, in fs/btrfs/block-group.c:4259 [403.2479] ------------[ cut here ]------------ [403.2484] kernel BUG at fs/btrfs/messages.c:259! [403.2488] invalid opcode: 0000 [#1] PREEMPT SMP KASAN [403.2493] CPU: 2 PID: 23202 Comm: umount Not tainted 6.2.0-rc4-default+ #67 [403.2499] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552-rebuilt.opensuse.org 04/01/2014 [403.2509] RIP: 0010:btrfs_assertfail+0x19/0x1b [btrfs] ... [403.2595] Call Trace: [403.2598] [403.2601] btrfs_free_block_groups.cold+0x52/0xae [btrfs] [403.2608] close_ctree+0x6c2/0x761 [btrfs] [403.2613] ? __wait_for_common+0x2b8/0x360 [403.2618] ? btrfs_cleanup_one_transaction.cold+0x7a/0x7a [btrfs] [403.2626] ? mark_held_locks+0x6b/0x90 [403.2630] ? lockdep_hardirqs_on_prepare+0x13d/0x200 [403.2636] ? __call_rcu_common.constprop.0+0x1ea/0x3d0 [403.2642] ? trace_hardirqs_on+0x2d/0x110 [403.2646] ? __call_rcu_common.constprop.0+0x1ea/0x3d0 [403.2652] generic_shutdown_super+0xb0/0x1c0 [403.2657] kill_anon_super+0x1e/0x40 [403.2662] btrfs_kill_super+0x25/0x30 [btrfs] [403.2668] deactivate_locked_super+0x4c/0xc0 By making btrfs_assertfail a macro we'll get the same line number for the BUG output: [63.5736] assertion failed: 0, in fs/btrfs/super.c:1572 [63.5758] ------------[ cut here ]------------ [63.5782] kernel BUG at fs/btrfs/super.c:1572! [63.5807] invalid opcode: 0000 [#2] PREEMPT SMP KASAN [63.5831] CPU: 0 PID: 859 Comm: mount Tainted: G D 6.3.0-rc7-default+ #2062 [63.5868] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a-rebuilt.opensuse.org 04/01/2014 [63.5905] RIP: 0010:btrfs_mount+0x24/0x30 [btrfs] [63.5964] RSP: 0018:ffff88800e69fcd8 EFLAGS: 00010246 [63.5982] RAX: 000000000000002d RBX: ffff888008fc1400 RCX: 0000000000000000 [63.6004] RDX: 0000000000000000 RSI: ffffffffb90fd868 RDI: ffffffffbcc3ff20 [63.6026] RBP: ffffffffc081b200 R08: 0000000000000001 R09: ffff88800e69fa27 [63.6046] R10: ffffed1001cd3f44 R11: 0000000000000001 R12: ffff888005a3c370 [63.6062] R13: ffffffffc058e830 R14: 0000000000000000 R15: 00000000ffffffff [63.6081] FS: 00007f7b3561f800(0000) GS:ffff88806c600000(0000) knlGS:0000000000000000 [63.6105] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [63.6120] CR2: 00007fff83726e10 CR3: 0000000002a9e000 CR4: 00000000000006b0 [63.6137] Call Trace: [63.6143] [63.6148] legacy_get_tree+0x80/0xd0 [63.6158] vfs_get_tree+0x43/0x120 [63.6166] do_new_mount+0x1f3/0x3d0 [63.6176] ? do_add_mount+0x140/0x140 [63.6187] ? cap_capable+0xa4/0xe0 [63.6197] path_mount+0x223/0xc10 This comes at a cost of bloating the final btrfs.ko module due all the inlining, as long as assertions are compiled in. This is a must for debugging builds but this is often enabled on release builds too. Release build: text data bss dec hex filename 1251676 20317 16088 1288081 13a791 pre/btrfs.ko 1260612 29473 16088 1306173 13ee3d post/btrfs.ko DELTA: +8936 CC: Josh Poimboeuf Signed-off-by: David Sterba commit 915f5eadebd29ba185ac506766a90120153b7e14 Author: Shenghao Ding <13916275206@139.com> Date: Sun Jun 18 20:28:17 2023 +0800 ASoC: tas2781: firmware lib Create tas2781 firmware lib. Signed-off-by: Shenghao Ding <13916275206@139.com> Link: https://lore.kernel.org/r/20230618122819.23143-2-13916275206@139.com Signed-off-by: Mark Brown commit 75258f20fb70ce9e1fa4fa0cb27c0bdee05b2701 Author: Qu Wenruo Date: Fri May 26 20:30:53 2023 +0800 btrfs: subpage: dump extra subpage bitmaps for debug There is a bug report that assert_eb_page_uptodate() gets triggered for free space tree metadata. Without proper dump for the subpage bitmaps it's much harder to debug. Thus this patch would dump all the subpage bitmaps (split them into their own bitmaps) for a easier debugging. The output would look like this: (Dumped after a tree block got read from disk) page:000000006e34bf49 refcount:4 mapcount:0 mapping:0000000067661ac4 index:0x1d1 pfn:0x110e9 memcg:ffff0000d7d62000 aops:btree_aops [btrfs] ino:1 flags: 0x8000000000002002(referenced|private|zone=2) page_type: 0xffffffff() raw: 8000000000002002 0000000000000000 dead000000000122 ffff00000188bed0 raw: 00000000000001d1 ffff0000c7992700 00000004ffffffff ffff0000d7d62000 page dumped because: btrfs subpage dump BTRFS warning (device dm-1): start=30490624 len=16384 page=30474240 bitmaps: uptodate=4-7 error= dirty= writeback= ordered= checked= Reviewed-by: Christoph Hellwig Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 58e814fcacc1f652d2b794c82b7c9d96ee3c3bab Author: Tejun Heo Date: Thu May 25 13:33:08 2023 -1000 btrfs: use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all call sites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. BTRFS ===== * fs_info->scrub_workers initialized in scrub_workers_get() was setting @max_active to 1 when @is_dev_replace is set and it seems that the workqueue actually needs to be ordered if @is_dev_replace. Update the code so that alloc_ordered_workqueue() is used if @is_dev_replace. * fs_info->discard_ctl.discard_workers initialized in btrfs_init_workqueues() was directly using alloc_workqueue() w/ @max_active==1. Converted to alloc_ordered_workqueue(). * fs_info->fixup_workers and fs_info->qgroup_rescan_workers initialized in btrfs_queue_work() use the btrfs's workqueue wrapper, btrfs_workqueue, which are allocated with btrfs_alloc_workqueue(). btrfs_workqueue implements automatic @max_active adjustment which is disabled when the specified max limit is below a certain threshold, so calling btrfs_alloc_workqueue() with @limit_active==1 yields an ordered workqueue whose @max_active won't be changed as the auto-tuning is disabled. This is rather brittle in that nothing clearly indicates that the two workqueues should be ordered or btrfs_alloc_workqueue() must disable auto-tuning when @limit_active==1. This patch factors out the common btrfs_workqueue init code into btrfs_init_workqueue() and add explicit btrfs_alloc_ordered_workqueue(). The two workqueues are converted to use the new ordered allocation interface. Signed-off-by: Tejun Heo Signed-off-by: David Sterba commit 1d12680044301760485b7f056812cd0d33dca2c6 Author: David Sterba Date: Thu May 25 01:04:39 2023 +0200 btrfs: drop gfp from parameter extent state helpers Now that all extent state bit helpers effectively take the GFP_NOFS mask (and GFP_NOWAIT is encoded in the bits) we can remove the parameter. This reduces stack consumption in many functions and simplifies a lot of code. Net effect on module on a release build: text data bss dec hex filename 1250432 20985 16088 1287505 13a551 pre/btrfs.ko 1247074 20985 16088 1284147 139833 post/btrfs.ko DELTA: -3358 Signed-off-by: David Sterba commit 62bc60473ad202aa414edf304a78ddd7bc10ac49 Author: David Sterba Date: Thu May 25 01:04:37 2023 +0200 btrfs: pass NOWAIT for set/clear extent bits as another bit The only flags we now pass to set_extent_bit/__clear_extent_bit are GFP_NOFS and GFP_NOWAIT (a few functions handling mappings). This requires an extra parameter to be passed everywhere but is almost always the same. Encode the GFP_NOWAIT as an artificial extent bit and extract the real bits and gfp mask in the lowest level helpers. Now the passed gfp mask is not actually used and can be removed. Signed-off-by: David Sterba commit 7dde7a8ab32417f28c4ac0111f8a8389fc0501ff Author: David Sterba Date: Thu May 25 01:04:34 2023 +0200 btrfs: drop NOFAIL from set_extent_bit allocation masks The __GFP_NOFAIL passed to set_extent_bit first appeared in 2010 (commit f0486c68e4bd9a ("Btrfs: Introduce contexts for metadata reservation")), without any explanation why it would be needed. Meanwhile we've updated the semantics of set_extent_bit to handle failed allocations and do unlock, sleep and retry if needed. The use of the NOFAIL flag is also an outlier, we never want any of the set/clear extent bit helpers to fail, they're used for many critical changes like extent locking, besides the extent state bit changes. Signed-off-by: David Sterba commit 0acd32c294cf51e22ecf31a5b9065047568e5d0d Author: David Sterba Date: Thu May 25 01:04:32 2023 +0200 btrfs: open code set_extent_bits This helper calls set_extent_bit with two more parameters set to default values, but otherwise it's purpose is not clear. Reviewed-by: Christoph Hellwig Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit e85de967bca42070aa841b1ae41f7702120a0e97 Author: David Sterba Date: Thu May 25 01:04:30 2023 +0200 btrfs: open code set_extent_bits_nowait The helper only passes GFP_NOWAIT as gfp flags and is used two times. Reviewed-by: Christoph Hellwig Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit fe1a598c42a02eb9b3efec0001369d3153eb6ef2 Author: David Sterba Date: Thu May 25 01:04:28 2023 +0200 btrfs: open code set_extent_dirty The helper is used a few times, that it's setting the DIRTY extent bit is still clear. Reviewed-by: Christoph Hellwig Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit eea8686e6830a487d9f09dd12673ac374351f803 Author: David Sterba Date: Thu May 25 01:04:26 2023 +0200 btrfs: open code set_extent_new The helper is used only once. Reviewed-by: Christoph Hellwig Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 66240ab115907677a9b9954e936a9d6211783cbe Author: David Sterba Date: Thu May 25 01:04:23 2023 +0200 btrfs: open code set_extent_delalloc The helper is used once in fs code and a few times in the self test code. Reviewed-by: Christoph Hellwig Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 678f38eba1f2fe33ff700e85390ac98393e609ef Author: Shenghao Ding <13916275206@139.com> Date: Sun Jun 18 20:28:16 2023 +0800 ASoC: tas2781: Add Header file for tas2781 driver Create Header file for tas2781 driver. Signed-off-by: Shenghao Ding <13916275206@139.com> Link: https://lore.kernel.org/r/20230618122819.23143-1-13916275206@139.com Signed-off-by: Mark Brown commit dc5646c15cd6f320b8881781336041fcdb58ff97 Author: David Sterba Date: Thu May 25 01:04:21 2023 +0200 btrfs: open code set_extent_defrag The helper is used only once. Reviewed-by: Christoph Hellwig Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 25ac047c9d3df373de35ba4ee3f0c902874a1fab Author: Christoph Hellwig Date: Tue May 23 10:40:20 2023 +0200 btrfs: remove a pointless NULL check in btrfs_lookup_fs_root btrfs_grab_root already checks for a NULL root itself. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit e91909aace336a182da20bcbe507995ac24f74bb Author: Christoph Hellwig Date: Tue May 23 10:40:19 2023 +0200 btrfs: convert btrfs_get_global_root to use a switch statement Use a switch statement instead of an endless chain of if statements to make the code a little cleaner. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 85724171b302914bb8999b9df091fd4616a36eb7 Author: Christoph Hellwig Date: Tue May 23 10:40:18 2023 +0200 btrfs: fix the btrfs_get_global_root return value btrfs_grab_root returns either the root or NULL, and the callers of btrfs_get_global_root expect it to return the same. But all the more recently added roots instead return an ERR_PTR, so fix this. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit d85512d54e15c3b8f17dbab44b3d41c1d956902a Author: Anand Jain Date: Wed May 24 20:02:43 2023 +0800 btrfs: add and fix comments in btrfs_fs_devices Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 25984a5ae8f144e823468d39e483face534e45d1 Author: Anand Jain Date: Wed May 24 20:02:42 2023 +0800 btrfs: consolidate uuid comparisons in btrfs_validate_super There are three ways the fsid is validated in btrfs_validate_super(): - verify that super_copy::fsid is the same as fs_devices::fsid - if the metadata_uuid flag is set, verify if super_copy::metadata_uuid and fs_devices::metadata_uuid are the same. - a few lines below, often missed out, verify if dev_item::fsid is the same as fs_devices::metadata_uuid. The function btrfs_validate_super() contains multiple if-statements with memcmp() to check UUIDs. This patch consolidates them into a single location. Signed-off-by: Anand Jain Signed-off-by: David Sterba commit a3c54b0be1a218bdd8e42abf9ecfd9bddf1eadee Author: Anand Jain Date: Wed May 24 20:02:41 2023 +0800 btrfs: simplify how changed fsid and metadata_uuid is checked We often check if the metadata_uuid is not the same as fsid, and then we check if the given fsid matches the metadata_uuid. This patch refactors this logic into function match_fsid_changed and utilize it. Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 1a8983450090c97bdc498d021fd74fc7e42cc38c Author: Anand Jain Date: Wed May 24 20:02:40 2023 +0800 btrfs: simplify fsid and metadata_uuid comparisons Refactor the functions find_fsid() and find_fsid_with_metadata_uuid(), as they currently share a common set of code to compare the fsid and metadata_uuid. Create a common helper function, match_fsid_fs_devices(). Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 413fb1bc1d3224e508c698cd82e5ff1dc7d16d64 Author: Anand Jain Date: Wed May 24 20:02:39 2023 +0800 btrfs: return bool from check_tree_block_fsid instead of int Simplify the return type of check_tree_block_fsid() from int (1 or 0) to bool. Its only user is interested in knowing the success or failure. Signed-off-by: Anand Jain Signed-off-by: David Sterba commit f62c302e6dfe7bb03b35157e1c1b7cdaeabd54f9 Author: Anand Jain Date: Wed May 24 20:02:38 2023 +0800 btrfs: add comment about metadata_uuid in btrfs_fs_devices Add comment about metadata_uuid in btrfs_fs_devices. No functional change. Signed-off-by: Anand Jain Signed-off-by: David Sterba commit c6930d7d11e30f55dee1e306bc3a3105fde56f93 Author: Anand Jain Date: Wed May 24 20:02:37 2023 +0800 btrfs: merge calls to alloc_fs_devices in device_list_add Simplify has_metadata_uuid checks - by localizing the has_metadata_uuid checked within alloc_fs_devices()'s second argument, it improves the code readability. Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 8fba13f02c85b90deeba65a398f55d4b43a79595 Author: Dan Carpenter Date: Mon Jun 19 12:46:21 2023 +0300 ASoC: loongson: fix error codes in loongson_card_parse_acpi() The acpi_node_get_property_reference() function returns kernel error codes and not ACPI error codes. So, although it does not affect the compiled code, using the ACPI_FAILURE() macro is wrong. Secondly, if the is_acpi_device_node() function returns false, then we should return -ENOENT instead of returning success. Fixes: d24028606e76 ("ASoC: loongson: Add Loongson ASoC Sound Card Support") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/fb14815d-2f9a-4b42-b193-cec61e7417ca@moroto.mountain Signed-off-by: Mark Brown commit 19c4c49ca9d0eb14987386598e44a533a367f745 Author: Anand Jain Date: Wed May 24 20:02:36 2023 +0800 btrfs: streamline fsid checks in alloc_fs_devices We currently have redundant checks for the non-null value of fsid simplify it. And, no one is using alloc_fs_devices() with a NULL metadata_uuid while fsid is not NULL, add an assert() to verify this condition. Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 4693893bf8d01c37a8952a3ea2a1bdfeb4106277 Author: Anand Jain Date: Wed May 24 20:02:35 2023 +0800 btrfs: reduce struct btrfs_fs_devices size by moving fsid_change Pack bool fsid_change and bool seeding with other bool declarations in the struct btrfs_fs_devices, approximately 6 bytes is saved, depending on the config. before: 512 bytes after: 496 bytes Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 46672a44b023461d13f063bc95bf832f8124177f Author: Christoph Hellwig Date: Wed May 3 17:24:41 2023 +0200 btrfs: merge write_one_subpage_eb into write_one_eb Most of the code in write_one_subpage_eb and write_one_eb is shared, so merge the two functions into one. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit d7172f52e9933b6ec9305e7fe6e829e3939dba04 Author: Christoph Hellwig Date: Wed May 3 17:24:40 2023 +0200 btrfs: use per-buffer locking for extent_buffer reading Instead of locking and unlocking every page or the extent, just add a new EXTENT_BUFFER_READING bit that mirrors EXTENT_BUFFER_WRITEBACK for synchronizing threads trying to read an extent_buffer and to wait for I/O completion. Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9e2aff90fc2ad2b94933762f5442fef9ee7a692e Author: Christoph Hellwig Date: Wed May 3 17:24:39 2023 +0200 btrfs: stop using lock_extent in btrfs_buffer_uptodate The only other place that locks extents on the btree inode is read_extent_buffer_subpage while reading in the partial page for a buffer. This means locking the extent in btrfs_buffer_uptodate does not synchronize with anything on non-subpage file systems, and on subpage file systems it only waits for a parallel read(-ahead) to finish, which seems to be counter to what the callers actually expect. Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit f3d315eb9372868bce92e7b24f2b92e061fe6fcd Author: Christoph Hellwig Date: Wed May 3 17:24:38 2023 +0200 btrfs: don't check for uptodate pages in read_extent_buffer_pages The only place that reads in pages and thus marks them uptodate for the btree inode is read_extent_buffer_pages. Which means that either pages are already uptodate from an old buffer when creating a new one in alloc_extent_buffer, or they will be updated by ca call to read_extent_buffer_pages. This means the checks for uptodate pages in read_extent_buffer_pages and read_extent_buffer_subpage are superfluous and can be removed. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 011134f444dcc4192b9945b963d4b8340db3667d Author: Christoph Hellwig Date: Wed May 3 17:24:37 2023 +0200 btrfs: stop using PageError for extent_buffers PageError is only used to limit the uptodate check in assert_eb_page_uptodate. But we have a much more useful flag indicating the exact condition we are about with the EXTENT_BUFFER_WRITE_ERR flag, so use that instead and help the kernel toward eventually removing PageError. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 113fa05c2fa1a9ee45a31909e6d78666e426adca Author: Christoph Hellwig Date: Wed May 3 17:24:36 2023 +0200 btrfs: remove the io_pages field in struct extent_buffer No need to track the number of pages under I/O now that each extent_buffer is read and written using a single bio. For the read side we need to grab an extra reference for the duration of the I/O to prevent eviction, though. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 31d89399dad0cf5524bd0e4e2c2827ae7004b2ca Author: Christoph Hellwig Date: Wed May 3 17:24:35 2023 +0200 btrfs: remove the extent_buffer lookup in btree block checksumming The checksumming of btree blocks always operates on the entire extent_buffer, and because btree blocks are always allocated contiguously on disk they are never split by btrfs_submit_bio. Simplify the checksumming code by finding the extent_buffer in the btrfs_bio private data instead of trying to search through the bio_vec. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit cd88a4fdbf1e3d55d852dd67c38155ee3ee3469f Author: Christoph Hellwig Date: Wed May 3 17:24:34 2023 +0200 btrfs: use a separate end_io handler for extent_buffer writing Now that we always use a single bio to write an extent_buffer, the buffer can be passed to the end_io handler as private data. This allows to simplify the metadata write end I/O handler, and merge the subpage end_io handler into the main one. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit b51e6b4bda5bddbd002ace239eb5eadd4d729039 Author: Christoph Hellwig Date: Wed May 3 17:24:33 2023 +0200 btrfs: don't use btrfs_bio_ctrl for extent buffer writing The btrfs_bio_ctrl machinery is overkill for writing extent_buffers as we always operate on PAGE_SIZE chunks (or one smaller one for the subpage case) that are contiguous and are guaranteed to fit into a single bio. Replace it with open coded btrfs_bio_alloc, __bio_add_page and btrfs_submit_bio calls. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 81a79b6ae4519a97c5924d68e1fb77d283cb051d Author: Christoph Hellwig Date: Wed May 3 17:24:32 2023 +0200 btrfs: move page locking from lock_extent_buffer_for_io to write_one_eb Locking the pages in lock_extent_buffer_for_io only for the non-subpage case is very confusing. Move it to write_one_eb to mirror the subpage case and simplify the code. Now lock_extent_buffer_for_io does not leave all the pages locked and each is individually locked/unlocked in write_one_eb. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2f76e1d6ca524a888d29aafe29f2ad2003857971 Author: Claudiu Beznea Date: Wed Jun 14 15:15:09 2023 +0300 ASoC: imx-audmix: check return value of devm_kasprintf() devm_kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: b86ef5367761 ("ASoC: fsl: Add Audio Mixer machine driver") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230614121509.443926-1-claudiu.beznea@microchip.com Signed-off-by: Mark Brown commit 50b21d7a066f9a702b1d54ca11fc577302e875cb Author: Christoph Hellwig Date: Wed May 3 17:24:31 2023 +0200 btrfs: submit a writeback bio per extent_buffer Stop trying to cluster writes of multiple extent_buffers into a single bio. There is no need for that as the blk_plug mechanism used all the way up in writeback_inodes_wb gives us the same I/O pattern even with multiple bios. Removing the clustering simplifies lock_extent_buffer_for_io a lot and will also allow passing the eb as private data to the end I/O handler. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9fdd160160f002ac2604c5b8f90598febad44ae7 Author: Christoph Hellwig Date: Wed May 3 17:24:30 2023 +0200 btrfs: return bool from lock_extent_buffer_for_io lock_extent_buffer_for_io never returns a negative error value, so switch the return value to a simple bool. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba [ keep noinline_for_stack ] Signed-off-by: David Sterba commit 3d66b4b27d2b7f5e74071256acea38108f9dbeb5 Author: Christoph Hellwig Date: Wed May 3 17:24:29 2023 +0200 btrfs: do not try to unlock the extent for non-subpage metadata reads Only subpage metadata reads lock the extent. Don't try to unlock it and waste cycles in the extent tree lookup for PAGE_SIZE or larger metadata. Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit 046b562b20a5cfe205fb78c6f8a1a8b74f01d303 Author: Christoph Hellwig Date: Wed May 3 17:24:28 2023 +0200 btrfs: use a separate end_io handler for read_extent_buffer Now that we always use a single bio to read an extent_buffer, the buffer can be passed to the end_io handler as private data. This allows implementing a much simplified dedicated end I/O handler for metadata reads. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit e19493107675d48eb207b91d9a775c811f247e27 Author: Christoph Hellwig Date: Wed May 3 17:24:27 2023 +0200 btrfs: remove the mirror_num argument to btrfs_submit_compressed_read Given that read recovery for data I/O is handled in the storage layer, the mirror_num argument to btrfs_submit_compressed_read is always 0, so remove it. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit b78b98e06fb7f9860da5a7c28e1edbaefc2f7be1 Author: Christoph Hellwig Date: Wed May 3 17:24:26 2023 +0200 btrfs: don't use btrfs_bio_ctrl for extent buffer reading The btrfs_bio_ctrl machinery is overkill for reading extent_buffers as we always operate on PAGE_SIZE chunks (or one smaller one for the subpage case) that are contiguous and are guaranteed to fit into a single bio. Replace it with open coded btrfs_bio_alloc, __bio_add_page and btrfs_submit_bio calls in a helper function shared between the subpage and node size >= PAGE_SIZE cases. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit e95382834cf885b478dbe14a66451b863eb35c94 Author: Christoph Hellwig Date: Wed May 3 17:24:25 2023 +0200 btrfs: always read the entire extent_buffer Currently read_extent_buffer_pages skips pages that are already uptodate when reading in an extent_buffer. While this reduces the amount of data read, it increases the number of I/O operations as we now need to do multiple I/Os when reading an extent buffer with one or more uptodate pages in the middle of it. On any modern storage device, be that hard drives or SSDs this actually decreases I/O performance. Fortunately this case is pretty rare as the pages are always initially read together and then aged the same way. Besides simplifying the code a bit as-is this will allow for major simplifications to the I/O completion handler later on. Note that the case where all pages are uptodate is still handled by an optimized fast path that does not read any data from disk. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit d87e6575e9d1c9d43e223c3fe858e4e453265707 Author: Christoph Hellwig Date: Wed May 3 17:24:24 2023 +0200 btrfs: merge verify_parent_transid and btrfs_buffer_uptodate verify_parent_transid is only called by btrfs_buffer_uptodate, which confusingly inverts the return value. Merge the two functions and reflow the parent_transid so that error handling is in a branch. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit aebcc1596b5c37095385ecd930cf335254828538 Author: Christoph Hellwig Date: Wed May 3 17:24:23 2023 +0200 btrfs: move setting the buffer uptodate out of validate_extent_buffer Setting the buffer uptodate in a function that is named as a validation helper is a it confusing. Move the call from validate_extent_buffer to the one of its two callers that didn't already have a duplicate call to set_extent_buffer_uptodate. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 243984b3b99199678b6ec74787f8fed60c58042d Author: Christoph Hellwig Date: Wed May 3 17:24:22 2023 +0200 btrfs: subpage: fix error handling in end_bio_subpage_eb_writepage Call btrfs_page_clear_uptodate instead of ClearPageUptodate to properly manage the uptodate bit for the subpage case. Reported-by: Qu Wenruo Reviewed-by: Qu Wenruo Reviewed-by: Josef Bacik Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7f26fb1c13f7445adf7890bf27458081655c9a4c Author: Christoph Hellwig Date: Wed May 3 17:24:21 2023 +0200 btrfs: mark extent_buffer_under_io static extent_buffer_under_io is only used in extent_io.c, so mark it static. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 997905d523fb85ba1a45159cbb9ae3910275bada Author: Mark Brown Date: Sat Jun 10 00:58:44 2023 +0100 ASoC: max98363: Remove cache defaults for volatile registers The max98363 driver provides cache defaults for a number of volatile registers. This is not meaningful, the cache values will never be used so at best they will just consume memory and at worst they will be used in preference to real values from the device, remove them. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-mx98363-volatile-v1-1-7acad55f5dd6@kernel.org Signed-off-by: Mark Brown commit edc728814f9a73cec501e4e5dd677dc9d65841cb Author: Qu Wenruo Date: Fri May 12 07:42:05 2023 +0800 btrfs: trigger orphan inode cleanup during START_SYNC ioctl There is an internal error report that scrub found an error in an orphan inode's data. However there are very limited ways to cleanup such orphan inodes: - btrfs_start_pre_rw_mount() This happens at either mount, or RO->RW switch. This is not a viable solution for root fs which may not be unmounted or RO mounted. Furthermore this doesn't cover every subvolume, it only covers the currently cached subvolumes. - btrfs_lookup_dentry() This happens when we first lookup the subvolume dentry. But dentry can be cached thus it's not ensured to be triggered every time. - create_snapshot() This only happens for the created snapshot, not the source one. This means if we didn't trigger orphan items cleanup, there is really no other way to manually trigger it. Add this step to the START_SYNC ioctl. This is a slight change in the semantics of the ioctl but as sync can be potentially slow and is usually paired with WAIT_SYNC ioctl. The errors are not handled because the main point of the ioctl is the async commit, orphan cleanup is a side effect. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 618d1d7da587b44e60922103ee2dc36949641d4d Author: Filipe Manana Date: Wed May 17 12:03:44 2023 +0100 btrfs: fix comment referring to no longer existing btrfs_clean_tree_block() There's a comment at btrfs_init_new_buffer() that refers to a function named btrfs_clean_tree_block(), however the function was renamed to btrfs_clear_buffer_dirty() in commit 190a83391bc4 ("btrfs: rename btrfs_clean_tree_block to btrfs_clear_buffer_dirty"). So update the comment to refer to the current name. Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 59fcf388172dc4e00a8a98b8b720c063af398bda Author: Filipe Manana Date: Wed May 17 12:02:16 2023 +0100 btrfs: change for_rename argument of btrfs_record_unlink_dir() to bool The for_rename argument of btrfs_record_unlink_dir() is defined as an integer, but the argument is in fact used as a boolean. So change it to a boolean to make its use more clear. Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit acfb5a4f1109a4f477f816d572b4f8f65b645bee Author: Filipe Manana Date: Wed May 17 12:02:15 2023 +0100 btrfs: remove pointless label and goto at btrfs_record_unlink_dir() There's no point of having a label and goto at btrfs_record_unlink_dir() because the function is trivial and can just return early if we are not in a rename context. So remove the label and goto and instead return early if we are not in a rename. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1e75ef039d1a13afd0abd794dee9df462d5b7990 Author: Filipe Manana Date: Wed May 17 12:02:14 2023 +0100 btrfs: update comments at btrfs_record_unlink_dir() to be more clear Update the comments at btrfs_record_unlink_dir() so that they mention where new names are logged and where old names are removed. Also, while at it make the width of the comments closer to 80 columns and capitalize the sentences and finish them with punctuation. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit d67ba263f4add857ac2a02088c08e1dc2fe1171b Author: Filipe Manana Date: Wed May 17 12:02:13 2023 +0100 btrfs: use inode_logged() at btrfs_record_unlink_dir() At btrfs_record_unlink_dir() we directly check the logged_trans field of the given inodes to check if they were previously logged in the current transaction, and if any of them were, then we can avoid setting the field last_unlink_trans of the directory to the id of the current transaction if we are in a rename path. Avoiding that can later prevent falling back to a transaction commit if anyone attempts to log the directory. However the logged_trans field, store in struct btrfs_inode, is transient, not persisted in the inode item on its subvolume b+tree, so that means that if an inode is evicted and then loaded again, its original value is lost and it's reset to 0. So directly checking the logged_trans field can lead to some false negative, and that only results in a performance impact as mentioned before. Instead of directly checking the logged_trans field of the inodes, use the inode_logged() helper, which will check in the log tree if an inode was logged before in case its logged_trans field has a value of 0. This way we can avoid setting the directory inode's last_unlink_trans and cause future logging attempts of it to fallback to transaction commits. The following test script shows one example where this happens without this patch: $ cat test.sh #!/bin/bash DEV=/dev/nullb0 MNT=/mnt/nullb0 num_init_files=10000 num_new_files=10000 mkfs.btrfs -f $DEV mount -o ssd $DEV $MNT mkdir $MNT/testdir for ((i = 1; i <= $num_init_files; i++)); do echo -n > $MNT/testdir/file_$i done echo -n > $MNT/testdir/foo sync # Add some files so that there's more work in the transaction other # than just renaming file foo. for ((i = 1; i <= $num_new_files; i++)); do echo -n > $MNT/testdir/new_file_$i done # Change the file, fsync it. setfattr -n user.x1 -v 123 $MNT/testdir/foo xfs_io -c "fsync" $MNT/testdir/foo # Now triggger eviction of file foo but no eviction for our test # directory, since it is being used by the process below. This will # set logged_trans of the file's inode to 0 once it is loaded again. ( cd $MNT/testdir while true; do : done ) & pid=$! echo 2 > /proc/sys/vm/drop_caches kill $pid wait $pid # Move foo out of our testdir. This will set last_unlink_trans # of the directory inode to the current transaction, because # logged_trans of both the directory and the file are set to 0. mv $MNT/testdir/foo $MNT/foo # Change file foo again and fsync it. # This fsync will result in a transaction commit because the rename # above has set last_unlink_trans of the parent directory to the id # of the current transaction and because our inode for file foo has # last_unlink_trans set to the current transaction, since it was # evicted and reloaded and it was previously modified in the current # transaction (the xattr addition). xfs_io -c "pwrite 0 64K" $MNT/foo start=$(date +%s%N) xfs_io -c "fsync" $MNT/foo end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "file fsync took: $dur milliseconds" umount $MNT Before this patch: fsync took 19 milliseconds After this patch: fsync took 5 milliseconds Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit bf1f4fd3fadb8dd4337ad46d63eb6ebcce3366f5 Author: Filipe Manana Date: Wed May 17 12:02:12 2023 +0100 btrfs: use inode_logged() at need_log_inode() At need_log_inode() we directly check the ->logged_trans field of the given inode to check if it was previously logged in the transaction, with the goal of skipping logging the inode again when it's not necessary. The ->logged_trans field in not persisted in the inode item or elsewhere, it's only stored in memory (struct btrfs_inode), so it's transient and lost once the inode is evicted and then loaded again. Once an inode is loaded, we are conservative and set ->logged_trans to 0, which may mean that either the inode was never logged in the current transaction or it was logged but evicted before being loaded again. Instead of checking the inode's ->logged_trans field directly, we can use instead the helper inode_logged(), which will really check if the inode was logged before in the current transaction in case we have a ->logged_trans field with a value of 0. This will prevent unnecessarily logging an inode when it's not needed, and in some cases preventing a transaction commit, in case the logging requires a fallback to a transaction commit. The following test script shows a scenario where due to eviction we fallback a transaction commit when trying to fsync a file that was renamed: $ cat test.sh #!/bin/bash DEV=/dev/nullb0 MNT=/mnt/nullb0 num_init_files=10000 num_new_files=10000 mkfs.btrfs -f $DEV mount -o ssd $DEV $MNT mkdir $MNT/testdir for ((i = 1; i <= $num_init_files; i++)); do echo -n > $MNT/testdir/file_$i done echo -n > $MNT/testdir/foo sync # Add some files so that there's more work in the transaction other # than just renaming file foo. for ((i = 1; i <= $num_new_files; i++)); do echo -n > $MNT/testdir/new_file_$i done # Fsync the directory first. xfs_io -c "fsync" $MNT/testdir # Rename file foo. mv $MNT/testdir/foo $MNT/testdir/bar # Now trigger eviction of the test directory's inode. # Once loaded again, it will have logged_trans set to 0 and # last_unlink_trans set to the current transaction. echo 2 > /proc/sys/vm/drop_caches # Fsync file bar (ex-foo). # Before the patch the fsync would result in a transaction commit # because the inode for file bar has last_unlink_trans set to the # current transaction, so it will attempt to log the parent directory # as well, which will fallback to a full transaction commit because # it also has its last_unlink_trans set to the current transaction, # due to the inode eviction. start=$(date +%s%N) xfs_io -c "fsync" $MNT/testdir/bar end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "file fsync took: $dur milliseconds" umount $MNT Before this patch: fsync took 22 milliseconds After this patch: fsync took 8 milliseconds Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit b9cb105e737f32b9cc18c4f47edabdb0ae66d569 Author: Jiapeng Chong Date: Fri May 12 13:44:57 2023 +0800 btrfs: scrub: remove more unused functions These functions are defined in the scrub.c file, but last callers were removed in e9255d6c4054 ("btrfs: scrub: remove the old scrub recheck code"). fs/btrfs/scrub.c:553:20: warning: unused function 'scrub_stripe_index_and_offset'. fs/btrfs/scrub.c:543:19: warning: unused function 'scrub_nr_raid_mirrors'. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4937 Signed-off-by: Jiapeng Chong Reviewed-by: David Sterba Signed-off-by: David Sterba commit b7f9945a1479a97a7aa2cc2b9d36e72f33fcb174 Author: Qu Wenruo Date: Thu May 11 16:01:44 2023 +0800 btrfs: handle tree backref walk error properly [BUG] Smatch reports the following errors related to commit ("btrfs: output affected files when relocation fails"): fs/btrfs/inode.c:283 print_data_reloc_error() error: uninitialized symbol 'ref_level'. [CAUSE] That part of code is mostly copied from scrub, but unfortunately scrub code from the beginning is not doing the error handling properly. The offending code looks like this: do { ret = tree_backref_for_extent(); btrfs_warn_rl(); } while (ret != 1); There are several problems involved: - No error handling If that tree_backref_for_extent() failed, we would output the same error again and again, never really exit as it requires ret == 1 to exit. - Always do one extra output As tree_backref_for_extent() only return > 0 if there is no more backref item. This means after the last item we hit, we would output an invalid error message for ret > 0 case. [FIX] Fix the old code by: - Move @ref_root and @ref_level into the if branch And do not initialize them, so we can catch such uninitialized values just like what we do in the inode.c - Explicitly check the return value of tree_backref_for_extent() And handle ret < 0 and ret > 0 cases properly. - No more do {} while () loop Instead go while (true) {} loop since we will handle @ret manually. Reported-by: Dan Carpenter Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit f880fe6e0b4b127d6e2a007fe68bdf5651677ae2 Author: Christoph Hellwig Date: Mon May 8 07:58:39 2023 -0700 btrfs: don't hold an extra reference for redirtied buffers When btrfs_redirty_list_add redirties a buffer, it also acquires an extra reference that is released on transaction commit. But this is not required as buffers that are dirty or under writeback are never freed (look for calls to extent_buffer_under_io())). Remove the extra reference and the infrastructure used to drop it again. History behind redirty logic: In the first place, it used releasing_list to hold all the to-be-released extent buffers, and decided which buffers to re-dirty at the commit time. Then, in a later version, the behaviour got changed to re-dirty a necessary buffer and add re-dirtied one to the list in btrfs_free_tree_block(). In short, the list was there mostly for the patch series' historical reason. Reviewed-by: Naohiro Aota Signed-off-by: Christoph Hellwig [ add Naohiro's comment regarding history ] Signed-off-by: David Sterba commit f18cc97845aa4ae0e795c088c979fe1642b3b8e5 Author: Christoph Hellwig Date: Mon May 8 07:58:38 2023 -0700 btrfs: fix dirty_metadata_bytes for redirtied buffers dirty_metadata_bytes is decremented in both places that clear the dirty bit in a buffer, but only incremented in btrfs_mark_buffer_dirty, which means that a buffer that is redirtied using btrfs_redirty_list_add won't be added to dirty_metadata_bytes, but it will be subtracted when written out, leading an inconsistency in the counter. Move the dirty_metadata_bytes from btrfs_mark_buffer_dirty into set_extent_buffer_dirty to also account for the redirty case, and remove the now unused set_extent_buffer_dirty return value. Fixes: d3575156f662 ("btrfs: zoned: redirty released extent buffers") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Naohiro Aota Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba commit bb5167e6197b73a38cf35bee788e5cbb6d3f8bfa Author: Johannes Thumshirn Date: Tue May 9 10:12:01 2023 -0700 btrfs: unexport btrfs_run_discard_work and make it static Mark btrfs_run_discard_work static and move it above its callers. Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 016f9d0b744202eb170ed91e995fc757dd4adeeb Author: Josef Bacik Date: Sat Apr 29 16:07:21 2023 -0400 btrfs: rename del_ptr to btrfs_del_ptr and export it This exists internal to ctree.c, however btrfs check needs to use it for some of its operations. I'd rather not duplicate that code inside of btrfs check as this is low level and I want to keep this code in one place, so rename the function to btrfs_del_ptr and export it so that it can be used inside of btrfs-progs safely. Add a comment to make sure this doesn't get removed by a future cleanup. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit b3cbfb0dd4a80c359701280f6acfa37131d8ee8b Author: Josef Bacik Date: Sat Apr 29 16:07:20 2023 -0400 btrfs: add a btrfs_csum_type_size helper This is needed in btrfs-progs for the tools that convert the checksum types for file systems and a few other things. We don't have it in the kernel as we just want to get the size for the super blocks type. However I don't want to have to manually add this every time we sync ctree.c into btrfs-progs, so add the helper in the kernel with a note so it doesn't get removed by a later cleanup. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit a95b7f93602e41f680096106935a76667a8763f1 Author: Josef Bacik Date: Sat Apr 29 16:07:19 2023 -0400 btrfs: add __KERNEL__ check for btrfs_no_printk We want to override this in btrfs-progs, so wrap this in the __KERNEL__ check so we can easily sync this to btrfs-progs and have our local version of btrfs_no_printk do the work. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit f541833c8eea17e3779e0fce81d3c92a3604d80a Author: Josef Bacik Date: Sat Apr 29 16:07:18 2023 -0400 btrfs: move split_flags/combine_flags helpers to inode-item.h These are more related to the inode item flags on disk than the in-memory btrfs_inode, move the helpers to inode-item.h. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 2cac5af16537f8eafaba5e525fbb5a93160ebaff Author: Josef Bacik Date: Sat Apr 29 16:07:17 2023 -0400 btrfs: move btrfs_verify_level_key into tree-checker.c This is more a buffer validation helper, move it into the tree-checker files where it makes more sense. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit c26fa931eb186a748608b4155fe2f4821738b140 Author: Josef Bacik Date: Sat Apr 29 16:07:16 2023 -0400 btrfs: add __btrfs_check_node helper This helper returns a btrfs_tree_block_status for the various errors, and then btrfs_check_node() will return -EUCLEAN if it gets anything other than BTRFS_TREE_BLOCK_CLEAN which will be used by the kernel. In the future btrfs-progs will use this helper instead. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 924452c80e81ba96bfc64847e983862016345381 Author: Josef Bacik Date: Sat Apr 29 16:07:15 2023 -0400 btrfs: extend btrfs_leaf_check to return btrfs_tree_block_status Instead of blanket returning -EUCLEAN for all the failures in btrfs_check_leaf, use btrfs_tree_block_status and return the appropriate status for each failure. Rename the helper to __btrfs_check_leaf and then make a wrapper of btrfs_check_leaf that will return -EUCLEAN to non-clean error codes. This will allow us to have the __btrfs_check_leaf variant in btrfs-progs while keeping the behavior in the kernel consistent. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit c8d5421563547a4b4ba6fcb9dae6b323dd02b75f Author: Josef Bacik Date: Sat Apr 29 16:07:14 2023 -0400 btrfs: use btrfs_tree_block_status for leaf item errors We have a variety of item specific errors that can occur. For now simply put these under the umbrella of BTRFS_TREE_BLOCK_INVALID_ITEM, this can be fleshed out as we need in the future. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit a7b4e6c7aa66632d776cf2b991ff2def076e34b8 Author: Josef Bacik Date: Sat Apr 29 16:07:13 2023 -0400 btrfs: add btrfs_tree_block_status definitions to tree-checker.h We use this in btrfs-progs to determine if we can fix different types of corruptions. We don't care about this in the kernel, however it would be good to share this code between the kernel and btrfs-progs, so add the status definitions so we can start converting the tree-checker code over to using these status flags instead of blanket returning -EUCLEAN. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 85d8a826c7cde17f9cca9c4debecb4538bdb6573 Author: Josef Bacik Date: Sat Apr 29 16:07:12 2023 -0400 btrfs: simplify btrfs_check_leaf_* helpers into a single helper We have two helpers for checking leaves, because we have an extra check for debugging in btrfs_mark_buffer_dirty(), and at that stage we may have item data that isn't consistent yet. However we can handle this case internally in the helper, if BTRFS_HEADER_FLAG_WRITTEN is set we know the buffer should be internally consistent, otherwise we need to skip checking the item data. Simplify this helper down a single helper and handle the item data checking logic internally to the helper. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 4aec05fa5a190d641664c2bca8ad270cf8190b8c Author: Josef Bacik Date: Sat Apr 29 16:07:11 2023 -0400 btrfs: remove level argument from btrfs_set_block_flags We just pass in btrfs_header_level(eb) for the level, and we're passing in the eb already, so simply get the level from the eb inside of btrfs_set_block_flags. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 54d687c13aef3194ea1490cf6d4b5016da1cf0bb Author: Josef Bacik Date: Sat Apr 29 16:07:10 2023 -0400 btrfs: move btrfs_check_trunc_cache_free_space into block-rsv.c This is completely related to block rsv's, move it out of the free space cache code and into block-rsv.c. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 94ead93e63758f2c7cbe0c68ca232fff812ca33e Author: Qu Wenruo Date: Thu Apr 13 13:57:18 2023 +0800 btrfs: scrub: use recovered data stripes as cache to avoid unnecessary read For P/Q stripe scrub, we have quite some duplicated read IO: - Data stripes read for verification This is triggered by the scrub_submit_initial_read() inside scrub_raid56_parity_stripe(). - Data stripes read (again) for P/Q stripe verification This is triggered by scrub_assemble_read_bios() from scrub_rbio(). Although we can have hit rbio cache and avoid unnecessary read, the chance is very low, as scrub would easily flush the whole rbio cache. This means, even we're just scrubbing a single P/Q stripe, we would read the data stripes twice for the best case scenario. If we need to recover some data stripes, it would cause more reads on the same data stripes, again and again. However before we call raid56_parity_submit_scrub_rbio() we already have all data stripes repaired and their contents ready to use. But RAID56 cache is unaware about the scrub cache, thus RAID56 layer itself still needs to re-read the data stripes. To avoid such cache miss, this patch would: - Introduce a new helper, raid56_parity_cache_data_pages() This function would grab the pages from an array, and copy the content to the rbio, marking all the involved sectors uptodate. The page copy is unavoidable because of the cache pages of rbio are all self managed, thus can not utilize outside pages without screwing up the lifespan. - Use the repaired data stripes as cache inside scrub_raid56_parity_stripe() By this, we ensure all the data sectors of the scrub rbio are already uptodate, and no need to read them again from disk. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 7e5ba559941f011389936d49641304ed45e8b6a7 Author: Filipe Manana Date: Thu May 4 12:04:26 2023 +0100 btrfs: assert tree lock is held when removing free space entries Removing a free space entry from an in memory space cache requires having the corresponding btrfs_free_space_ctl's 'tree_lock' held. We have several code paths that remove an entry, so add assertions where appropriate to verify we are holding the lock, as the lock is acquired by some other function up in the call chain, which makes it easy to miss in the future. Note: for this to work we need to lock the local btrfs_free_space_ctl at load_free_space_cache(), which was not being done because it's local, declared on the stack, so no other task has access to it. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 9649bd9a29a7da97eca456befd275ee16e3a2291 Author: Filipe Manana Date: Thu May 4 12:04:25 2023 +0100 btrfs: assert tree lock is held when linking free space When linking a free space entry, at link_free_space(), the caller should be holding the spinlock 'tree_lock' of the given btrfs_free_space_ctl argument, which is necessary for manipulating the red black tree of free space entries (done by tree_insert_offset(), which already asserts the lock is held) and for manipulating the 'free_space', 'free_extents', 'discardable_extents' and 'discardable_bytes' counters of the given struct btrfs_free_space_ctl. So assert that the spinlock 'tree_lock' of the given btrfs_free_space_ctl is held by the current task. We have multiple code paths that end up calling link_free_space(), and all currently take the lock before calling it. Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 91de9e978d1c32c477e14f44a7e945f17863c66e Author: Filipe Manana Date: Thu May 4 12:04:24 2023 +0100 btrfs: assert tree lock is held when searching for free space entries When searching for a free space entry by offset, at tree_search_offset(), we are supposed to have the btrfs_free_space_ctl's 'tree_lock' held, so assert that. We have multiple callers of tree_search_offset(), and all currently hold the necessary lock before calling it. Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 13c2018fcc27b0e2cebf0d3732c36b3ecfddc34c Author: Filipe Manana Date: Thu May 4 12:04:23 2023 +0100 btrfs: assert proper locks are held at tree_insert_offset() There are multiple code paths leading to tree_insert_offset(), and each path takes the necessary locks before tree_insert_offset() is called, since they do other things that require those locks to be held. This makes it easy to miss the locking somewhere, so make tree_insert_offset() assert that the required locks are being held by the calling task. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0d6bac4d30b8bdefd1cb97296620141953f409d6 Author: Filipe Manana Date: Thu May 4 12:04:22 2023 +0100 btrfs: simplify arguments to tree_insert_offset() For the in-memory component of space caching (free space cache and free space tree), three of the arguments passed to tree_insert_offset() can always be taken from the new free space entry that we are about to add. So simplify tree_insert_offset() to take the new entry instead of the 'offset', 'node' and 'bitmap' arguments. This will also allow to make further changes simpler. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit b77433b144621ebd5d0a6a3b6a3d454fa45b9309 Author: Filipe Manana Date: Thu May 4 12:04:21 2023 +0100 btrfs: use precomputed end offsets at do_trimming() The are two computations of end offsets at do_trimming() that are not necessary, as they were previously computed and stored in local const variables. So just use the variables instead, to make the source code shorter and easier to read. Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9085f42571e53b56b0087237d2e6258f47424938 Author: Filipe Manana Date: Thu May 4 12:04:20 2023 +0100 btrfs: avoid searching twice for previous node when merging free space entries At try_merge_free_space(), avoid calling twice rb_prev() to find the previous node, as that requires looping through the red black tree, so store the result of the rb_prev() call and then use it. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit fbb2e654d898f141a2cde37074535d9cec10b03a Author: Filipe Manana Date: Thu May 4 12:04:19 2023 +0100 btrfs: avoid extra memory allocation when copying free space cache At copy_free_space_cache(), we add a new entry to the block group's ctl before we free the entry from the temporary ctl. Adding a new entry requires the allocation of a new struct btrfs_free_space, so we can avoid a temporary extra allocation by freeing the entry from the temporary ctl before we add a new entry to the main ctl, which possibly also reduces the chances for a memory allocation failure in case of very high memory pressure. So just do that. Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 12df6a622ed8f0cd14470c6d76fe1b85f621f230 Author: Tom Rix Date: Tue May 2 10:51:29 2023 -0400 btrfs: simplify transid initialization in btrfs_ioctl_wait_sync A small code simplification, move the default value of transid to its initialization and remove the else-statement. Signed-off-by: Tom Rix Reviewed-by: David Sterba Signed-off-by: David Sterba commit b9a9a85059cde9bcc66effe0da9f1b6fb342a700 Author: Qu Wenruo Date: Wed May 3 12:40:01 2023 +0800 btrfs: output affected files when relocation fails [PROBLEM] When relocation fails (mostly due to checksum mismatch), we only got very cryptic error messages like: BTRFS info (device dm-4): relocating block group 13631488 flags data BTRFS warning (device dm-4): csum failed root -9 ino 257 off 0 csum 0x373e1ae3 expected csum 0x98757625 mirror 1 BTRFS error (device dm-4): bdev /dev/mapper/test-scratch1 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0 BTRFS info (device dm-4): balance: ended with status: -5 The end user has to decipher the above messages and use various tools to locate the affected files and find a way to fix the problem (mostly deleting the file). This is not an easy work even for experienced developer, not to mention the end users. [SCRUB IS DOING BETTER] By contrast, scrub is providing much better error messages: BTRFS error (device dm-4): unable to fixup (regular) error at logical 13631488 on dev /dev/mapper/test-scratch1 physical 13631488 BTRFS warning (device dm-4): checksum error at logical 13631488 on dev /dev/mapper/test-scratch1, physical 13631488, root 5, inode 257, offset 0, length 4096, links 1 (path: file) BTRFS info (device dm-4): scrub: finished on devid 1 with status: 0 Which provides the affected files directly to the end user. [IMPROVEMENT] Instead of the generic data checksum error messages, which is not doing a good job for data reloc inodes, this patch introduce a scrub like backref walking based solution. When a sector fails its checksum for data reloc inode, we go the following workflow: - Get the real logical bytenr For data reloc inode, the file offset is the offset inside the block group. Thus the real logical bytenr is @file_off + @block_group->start. - Do an extent type check If it's tree blocks it's much easier to handle, just go through all the tree block backref. - Do a backref walk and inode path resolution for data extents This is mostly the same as scrub. But unfortunately we can not reuse the same function as the output format is different. Now the new output would be more user friendly: BTRFS info (device dm-4): relocating block group 13631488 flags data BTRFS warning (device dm-4): csum failed root -9 ino 257 off 0 logical 13631488 csum 0x373e1ae3 expected csum 0x98757625 mirror 1 BTRFS warning (device dm-4): checksum error at logical 13631488 mirror 1 root 5 inode 257 offset 0 length 4096 links 1 (path: file) BTRFS error (device dm-4): bdev /dev/mapper/test-scratch1 errs: wr 0, rd 0, flush 0, corrupt 2, gen 0 BTRFS info (device dm-4): balance: ended with status: -5 Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8bfec2e426e40597d594db07de4e53def38c8879 Author: Christoph Hellwig Date: Wed May 3 09:06:15 2023 +0200 btrfs: remove hipri_workers workqueue Now that btrfs_wq_submit_bio is never called for synchronous I/O, the hipri_workers workqueue is not used anymore and can be removed. Reviewed-by: Chris Mason Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit e917ff56c8e7b117b590632fa40a08e36577d31f Author: Christoph Hellwig Date: Wed May 3 09:06:14 2023 +0200 btrfs: determine synchronous writers from bio or writeback control The writeback_control structure already passes down the information about a writeback being synchronous from the core VM code, and thus information is propagated into the bio REQ_SYNC flag through the wbc_to_write_flags helper. Use that information to decide if checksums calculation is offloaded to a workqueue instead of btrfs_inode::sync_writers field that not only bloats the inode but also has too wide scope, being inode wide instead of limited to the actual writeback request. The sync writes were set in: - btrfs_do_write_iter - regular IO, sync status is set - start_ordered_ops - ordered write start, writeback with WB_SYNC_ALL mode - btrfs_write_marked_extents - write marked extents, writeback with WB_SYNC_ALL mode Reviewed-by: Chris Mason Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba [ update changelog ] Signed-off-by: David Sterba commit da023618076a13c35bcde1a49a87b7da64761f1d Author: Christoph Hellwig Date: Wed May 3 09:06:13 2023 +0200 btrfs: submit IO synchronously for fast checksum implementations Most modern hardware supports very fast accelerated crc32c calculation. If that is supported the CPU overhead of the checksum calculation is very limited, and offloading the calculation to special worker threads has a lot of overhead for no gain. E.g. on an Intel Optane device is actually very much slows down even 1M buffered writes with fio: Unpatched: write: IOPS=3316, BW=3316MiB/s (3477MB/s)(200GiB/61757msec); 0 zone resets With synchronous CRCs: write: IOPS=4882, BW=4882MiB/s (5119MB/s)(200GiB/41948msec); 0 zone resets With a lot of variation during the unpatched run going down as low as 1100MB/s, while the synchronous CRC version has about the same peak write speed but much lower dips, and fewer kworkers churning around. Both tests had fio saturated at 100% CPU. (thanks to Jens Axboe via Chris Mason for the benchmarking) Reviewed-by: Chris Mason Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit adbe7e388e4239d9c1754d475aea791136927137 Author: Anand Jain Date: Sat Apr 15 19:32:38 2023 +0800 btrfs: use SECTOR_SHIFT to convert LBA to physical offset Using SECTOR_SHIFT to convert LBA to physical address makes it more readable. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 29e70be261d92829af26fda16769784710f45503 Author: Anand Jain Date: Sat Apr 15 17:51:23 2023 +0800 btrfs: use SECTOR_SHIFT to convert physical offset to LBA Use SECTOR_SHIFT while converting a physical address to an LBA, makes it more readable. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit eee3b811784e52f06ccb3e1c4518a9907627d4fe Author: Qu Wenruo Date: Thu Apr 27 20:16:28 2023 +0800 btrfs: improve leaf dump and error handling Improve the leaf dump behavior by: - Always dump the leaf first, then the error message - Output the slot number if possible Especially in __btrfs_free_extent() the leaf dump of extent tree can be pretty large. With an extra slot number it's much easier to locate the problem. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6c75a589cb35b8ea5cf9a22f389981acf687ab85 Author: Qu Wenruo Date: Thu Apr 27 20:16:27 2023 +0800 btrfs: print-tree: pass const extent buffer pointer Since print-tree infrastructure only prints the content of a tree block, we can make them to accept const extent buffer pointer. This removes a forced type convert in extent-tree, where we convert a const extent buffer pointer to regular one, just to avoid compiler warning. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit b5345d6ceeee3ef378e4800f538c8fc06bf9de48 Author: Naohiro Aota Date: Wed Apr 26 00:19:40 2023 +0900 btrfs: export bitmap_test_range_all_{set,zero} bitmap_test_range_all_{set,zero} defined in subpage.c are useful for other components. Move them to misc.h and use them in zoned.c. Also, as find_next{,_zero}_bit take/return "unsigned long" instead of "unsigned int", convert the type to "unsigned long". While at it, also rewrite the "if (...) return true; else return false;" pattern and add const to the input bitmap. Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit 88ad95b055764e4c74fb6b8201f794f4e531753d Author: Filipe Manana Date: Wed Apr 26 11:51:37 2023 +0100 btrfs: tag as unlikely the key comparison when checking sibling keys When checking siblings keys, before moving keys from one node/leaf to a sibling node/leaf, it's very unexpected to have the last key of the left sibling greater than or equals to the first key of the right sibling, as that means we have a (serious) corruption that breaks the key ordering properties of a b+tree. Since this is unexpected, surround the comparison with the unlikely macro, which helps the compiler generate better code for the most expected case (no existing b+tree corruption). This is also what we do for other unexpected cases of invalid key ordering (like at btrfs_set_item_key_safe()). Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit f2db4d5cb457b7da439d5509bdb6f7b01054c11b Author: Filipe Manana Date: Wed Apr 26 18:13:01 2023 +0100 btrfs: make btrfs_free_device() static The function btrfs_free_device() is never used outside of volumes.c, so make it static and remove its prototype declaration at volumes.h. Reviewed-by: Qu Wenruo Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1b53e51a4a8f870da194bcdaec9eb8865ee89386 Author: Sweet Tea Dorminy Date: Tue Apr 11 15:10:53 2023 -0400 btrfs: don't commit transaction for every subvol create Recently a Meta-internal workload encountered subvolume creation taking up to 2s each, significantly slower than directory creation. As they were hoping to be able to use subvolumes instead of directories, and were looking to create hundreds, this was a significant issue. After Josef investigated, it turned out to be due to the transaction commit currently performed at the end of subvolume creation. This change improves the workload by not doing transaction commit for every subvolume creation, and merely requiring a transaction commit on fsync. In the worst case, of doing a subvolume create and fsync in a loop, this should require an equal amount of time to the current scheme; and in the best case, the internal workload creating hundreds of subvolumes before fsyncing is greatly improved. While it would be nice to be able to use the log tree and use the normal fsync path, log tree replay can't deal with new subvolume inodes presently. It's possible that there's some reason that the transaction commit is necessary for correctness during subvolume creation; however, git logs indicate that the commit dates back to the beginning of subvolume creation, and there are no notes on why it would be necessary. Reviewed-by: Qu Wenruo Reviewed-by: Josef Bacik Reviewed-by: Neal Gompa Signed-off-by: Sweet Tea Dorminy Reviewed-by: David Sterba Signed-off-by: David Sterba commit f469c8bd90b7d595414e4b1876983dc94d0df47e Author: Filipe Manana Date: Wed Apr 12 11:33:10 2023 +0100 btrfs: unexport btrfs_prev_leaf() btrfs_prev_leaf() is not used outside ctree.c, so there's no need to export it at ctree.h - just make it static at ctree.c and move its definition above btrfs_search_slot_for_read(), since that function calls it. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit c317d148a2b02c4756832fb4bd00a6480d874606 Author: Srinivas Kandagatla Date: Mon Jun 19 11:16:53 2023 +0100 ASoC: q6dsp: q6apm-dai: Add mmap and copy compress DAI callbacks Add q6apm mmap and copy compress DAI callbacks to support compress offload playback. Co-developed-by: Mohammad Rafi Shaik Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230619101653.9750-12-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit b3f736d126d69ef3f3cc4f6b68795478954b2cf4 Author: Srinivas Kandagatla Date: Mon Jun 19 11:16:52 2023 +0100 ASoC: q6dsp: q6apm-dai: Add compress set params and metadata DAI callbacks Add q6apm compress DAI callbacks for setting params and metadata to support compress offload playback. Co-developed-by: Mohammad Rafi Shaik Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230619101653.9750-11-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit c337bf33c41de423fa4d7353bd66d3c14df92445 Author: Srinivas Kandagatla Date: Mon Jun 19 11:16:51 2023 +0100 ASoC: q6dsp: q6apm-dai: Add trigger/pointer compress DAI callbacks Add q6apm trigger and pointer compress DAI callbacks to support compress offload playback. Co-developed-by: Mohammad Rafi Shaik Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230619101653.9750-10-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit c0c87738a19d3e6d15dac4174d4b90c38a615112 Author: Srinivas Kandagatla Date: Mon Jun 19 11:16:50 2023 +0100 ASoC: q6dsp: q6apm-dai: Add compress DAI and codec caps get callbacks Add q6apm get compress DAI capabilities and codec capabilities callbacks to support compress offload playback. Co-developed-by: Mohammad Rafi Shaik Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230619101653.9750-9-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 88b60bf047fd15b75a0d7b78322ad53f917976ce Author: Srinivas Kandagatla Date: Mon Jun 19 11:16:49 2023 +0100 ASoC: q6dsp: q6apm-dai: Add open/free compress DAI callbacks Add q6apm open and free compress DAI callbacks to support compress offload playback. Include compress event handler callback also. Co-developed-by: Mohammad Rafi Shaik Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230619101653.9750-8-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 2c954a3714b3b0d98354cb6801f88b0ef7c1249d Author: Mohammad Rafi Shaik Date: Mon Jun 19 11:16:48 2023 +0100 ASoC: q6dsp: audioreach: Add gapless feature support Add support for setting EOS delay command and receive the EOS response from ADSP, for seamless compress offload playback feature. Co-developed-by: Mohammad Rafi Shaik Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230619101653.9750-7-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit e41521b6e2b3c965c64ff3dcd69042db003c3ef4 Author: Mohammad Rafi Shaik Date: Mon Jun 19 11:16:47 2023 +0100 ASoC: q6dsp: audioreach: Add support to set compress format params Add function for setting compress params. Signed-off-by: Mohammad Rafi Shaik Co-developed-by: Srinivas Kandagatla Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230619101653.9750-6-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit c7548f5990fb35ccf2bd731570d3cff7df9e1d2e Author: Srinivas Kandagatla Date: Mon Jun 19 11:16:46 2023 +0100 ASoC: q6dsp: audioreach: Add placeholder decoder for compress playback Add placeholder decoder graph module for compressed playback feature. Co-developed-by: Mohammad Rafi Shaik Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230619101653.9750-5-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 69bff594592b0582c36b3aae819deaad0e09eafd Author: Srinivas Kandagatla Date: Mon Jun 19 11:16:45 2023 +0100 ASoC: q6dsp: audioreach: add helper function to set u32 param Some of the Audioreach commands take a u32 value, ex: PARAM_ID_MODULE_ENABLE. It makes more sense to provide a helper function so that other new commands can reuse this. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230619101653.9750-4-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 9d11a5431c929c5057e06ff86002f337980caa9e Author: Mohammad Rafi Shaik Date: Mon Jun 19 11:16:44 2023 +0100 ASoC: q6dsp: q6apm: add end of stream events EOS event from dsp is currently not sent to the dai drivers, add the missing callback. Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230619101653.9750-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 5b7e984e22c43d217b3224b3118e5c8c88a5b708 Author: Mohammad Rafi Shaik Date: Mon Jun 19 11:16:43 2023 +0100 ASoC: qcom: SC7280: audioreach: Add sc7280 hardware param fixup callback Add support to set backend params such as sampling rate and number of channels using backend params fixup callback. Also add no pcm check for hardware params constraints setting. Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230619101653.9750-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit eefc27ea14ad6f5aa4656cf302dec366e1fd62f1 Author: Mark Brown Date: Sat Jun 10 14:58:02 2023 +0100 ASoC: rt5682: Use maple tree register cache The rt5682 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-16-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 11cce87f6453270ed63924ac55da764e060f8588 Author: Mark Brown Date: Sat Jun 10 14:58:01 2023 +0100 ASoC: rt5670: Use maple tree register cache The rt5670 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-15-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 470cb1d9b605557696791ca0ef6c151c3d92212d Author: Mark Brown Date: Sat Jun 10 14:58:00 2023 +0100 ASoC: rt5668: Use maple tree register cache The rt5668 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-14-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 487c9129c9d856eb8dd0dfa6e09c646649c91399 Author: Mark Brown Date: Sat Jun 10 14:57:59 2023 +0100 ASoC: rt5665: Use maple tree register cache The rt5665 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-13-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 72cd25891828072cb9726f90a0e8ba537a366221 Author: Mark Brown Date: Sat Jun 10 14:57:58 2023 +0100 ASoC: rt5665: Use maple tree register cache The rt5663 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-12-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 1fe38835d51f5cb977ddc02f8d7d5327a2a9f2b2 Author: Mark Brown Date: Sat Jun 10 14:57:57 2023 +0100 ASoC: rt5660: Use maple tree register cache The rt5660 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-11-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 899585d5781e1709fe6ed0e6f56d1419b66780cb Author: Mark Brown Date: Sat Jun 10 14:57:56 2023 +0100 ASoC: rt5651: Use maple tree register cache The rt5651 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-10-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit ea3945cdf0a34e2418eb1bb56c79a10f2a2e8093 Author: Mark Brown Date: Sat Jun 10 14:57:55 2023 +0100 ASoC: rt5645: Use maple tree register cache The rt5645 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-9-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 1ba8448b34b17755b873a42d5ebba499cb2feff7 Author: Mark Brown Date: Sat Jun 10 14:57:54 2023 +0100 ASoC: rt5640: Use maple tree register cache The rt5640 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-8-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 8a7384907e3f9ac380290414d7fd72df952757ba Author: Mark Brown Date: Sat Jun 10 14:57:53 2023 +0100 ASoC: rt5631: Use maple tree register cache The rt5631 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-7-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit eef0d85d964f21ec1817d397ab151b78f29ed047 Author: Mark Brown Date: Sat Jun 10 14:57:52 2023 +0100 ASoC: rt5616: Use maple tree register cache The rt5616 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-6-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 77b5d6e98f452445bdc82096a992b8d05f54f5d3 Author: Mark Brown Date: Sat Jun 10 14:57:51 2023 +0100 ASoC: rt5514: Use maple tree register cache The rt5514 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-5-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 5bd8a567aaea5d2e79b024bb4ad42d88bbe8f7c2 Author: Mark Brown Date: Sat Jun 10 14:57:50 2023 +0100 ASoC: rt1308: Use maple tree register cache The rt1308 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-4-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit d2306faefa25b47fa133f39ffaef12b11f175585 Author: Mark Brown Date: Sat Jun 10 14:57:49 2023 +0100 ASoC: rt1305: Use maple tree register cache The rt1305 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-3-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit f8abeb31c2a9dae470350487857d4b0c95ad316d Author: Mark Brown Date: Sat Jun 10 14:57:48 2023 +0100 ASoC: rt1019: Use maple tree register cache The rt1019 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-2-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 39da3e152dc664ef13c0b8c1064cba5415767aa3 Author: Mark Brown Date: Sat Jun 10 14:57:47 2023 +0100 ASoC: rt1011: Use maple tree register cache The rt1011 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-maple-v1-1-729c6553cdcf@kernel.org Signed-off-by: Mark Brown commit 9321015a5f40891e7cb094c6f68f6d4f67b5f3dc Author: Mark Brown Date: Sat Jun 10 12:16:38 2023 +0100 ASoC: es8328: Use maple tree register cache The es8328 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-es-maple-v1-2-45ada77f5643@kernel.org Signed-off-by: Mark Brown commit 7ae8039f87918e2f108d352f228e2ccee03994bc Author: Mark Brown Date: Sat Jun 10 12:16:37 2023 +0100 ASoC: es8316: Use maple tree register cache The es8316 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-es-maple-v1-1-45ada77f5643@kernel.org Signed-off-by: Mark Brown commit b67cad33176e472df6d16a24ee7624299bdcd5d5 Author: Rafał Miłecki Date: Fri Jun 16 12:58:27 2023 +0200 ARM: dts: BCM5301X: Add cells sizes to PCIe nodes This fixes: arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: pcie@12000: '#address-cells' is a required property From schema: /lib/python3.10/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: pcie@12000: '#size-cells' is a required property From schema: /lib/python3.10/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: pcie@13000: '#address-cells' is a required property From schema: /lib/python3.10/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: pcie@13000: '#size-cells' is a required property From schema: /lib/python3.10/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: pcie@14000: '#address-cells' is a required property From schema: /lib/python3.10/site-packages/dtschema/schemas/pci/pci-bus.yaml arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: pcie@14000: '#size-cells' is a required property From schema: /lib/python3.10/site-packages/dtschema/schemas/pci/pci-bus.yaml Two properties that need to be added later are "device_type" and "ranges". Adding "device_type" on its own causes a new warning and the value of "ranges" needs to be determined yet. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20230616105827.21656-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit bf3ca248714b663455d0894557efd3a268797739 Author: Stanislav Jakubek Date: Sun Jun 18 17:13:08 2023 +0200 dt-bindings: firmware: brcm,kona-smc: convert to YAML Convert Broadcom Kona family Secure Monitor bounce buffer bindings to DT schema. Changes during conversion: - move from misc to firmware subdirectory - add used, but previously undocumented SoC-specific compatibles - drop deprecated compatibles (they've been deprecated for ~10 years) Reviewed-by: Krzysztof Kozlowski Signed-off-by: Stanislav Jakubek Link: https://lore.kernel.org/r/20230618151308.GA23586@standask-GA-A55M-S2HP Signed-off-by: Florian Fainelli commit 825edae7d1c39171634253203f03cf6c6cf380bc Author: Justin Chen Date: Fri Jun 16 15:20:44 2023 -0700 MAINTAINERS: Replace my email address Switch to corporate email address for Broadcom related entries. Signed-off-by: Justin Chen Link: https://lore.kernel.org/r/1686954044-48410-1-git-send-email-justin.chen@broadcom.com Signed-off-by: Florian Fainelli commit dbfbddcddcebc9ce8a08757708d4e4a99d238e44 Author: Robert Marko Date: Tue May 30 23:32:59 2023 +0200 mmc: core: disable TRIM on Micron MTFC4GACAJCN-1M It seems that Micron MTFC4GACAJCN-1M despite advertising TRIM support does not work when the core is trying to use REQ_OP_WRITE_ZEROES. We are seeing the following errors in OpenWrt under 6.1 on Qnap Qhora 301W that we did not previously have and tracked it down to REQ_OP_WRITE_ZEROES: [ 18.085950] I/O error, dev loop0, sector 596 op 0x9:(WRITE_ZEROES) flags 0x800 phys_seg 0 prio class 2 Disabling TRIM makes the error go away, so lets add a quirk for this eMMC to disable TRIM. Signed-off-by: Robert Marko Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230530213259.1776512-1-robimarko@gmail.com Signed-off-by: Ulf Hansson commit 40e46f88a2e1c4e2d144cfbe8749ca55d4c0b1a1 Merge: 4711c6ab585ea 413db49973024 Author: Ulf Hansson Date: Mon Jun 19 13:41:58 2023 +0200 mmc: Merge branch fixes into next Merge the mmc fixes for v6.4-rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.5. Signed-off-by: Ulf Hansson commit 4711c6ab585ea627560a4878917aeaa1178878c2 Author: Linus Walleij Date: Fri Jun 16 22:42:27 2023 +0200 mmc: mmci: Break out a helper function These four lines clearing, masking and resetting the state of the busy detect state machine is repeated five times in the code so break this out to a small helper so things are easier to read. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-9-69a7164f2a61@linaro.org Signed-off-by: Ulf Hansson commit ddb5a92da5f32779958303716429d50a46c3177d Author: Linus Walleij Date: Fri Jun 16 22:42:26 2023 +0200 mmc: mmci: Use a switch statement machine As is custom, use a big switch statement to transition between the edges of the state machine inside the ux500 ->busy_complete callback. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-8-69a7164f2a61@linaro.org Signed-off-by: Ulf Hansson commit e85fecc386b98db890b869780573b33af49a7a7c Author: Linus Walleij Date: Fri Jun 16 22:42:25 2023 +0200 mmc: mmci: Use state machine state as exit condition Return true if and only if we reached the state MMCI_BUSY_DONE in the ux500 ->busy_complete() callback. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-7-69a7164f2a61@linaro.org Signed-off-by: Ulf Hansson commit 7892497f1f2d38b786cd80980c9f340988f662b5 Author: Linus Walleij Date: Fri Jun 16 22:42:24 2023 +0200 mmc: mmci: Retry the busy start condition This makes the ux500 ->busy_complete() callback re-read the status register 10 times while waiting for the busy signal to assert in the status register. If this does not happen, we bail out regarding the command completed already, i.e. before we managed to start to check the busy status. There is a comment in the code about this, let's just implement it to be certain that we can catch this glitch if it happens. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-6-69a7164f2a61@linaro.org Signed-off-by: Ulf Hansson commit 7be5ac5f7a4890422920d6d91f94fff5d114d076 Author: Linus Walleij Date: Fri Jun 16 22:42:23 2023 +0200 mmc: mmci: Make busy complete state machine explicit This refactors the ->busy_complete() callback currently only used by Ux500 and STM32 to handle busy detection on hardware where one and the same IRQ is fired whether we get a start or an end signal on busy detect. The code is currently using the cached status from the command IRQ in ->busy_status as a state to select what to do next: if this state is non-zero we are waiting for IRQs and if it is zero we treat the state as the starting point for a busy detect wait cycle. Make this explicit by creating a state machine where the ->busy_complete callback moves between three states. The Ux500 busy detect code currently assumes this order: we enable the busy detect IRQ, get a busy start IRQ, then a busy end IRQ, and then we clear and mask this IRQ and proceed. We insert debug prints for unexpected states. This works as before on most cards, however on a problematic card that is not working with busy detect, and which I have been debugging, the following happens a lot: [ 3.380554] mmci-pl18x 80005000.mmc: no busy signalling in time [ 3.387420] mmci-pl18x 80005000.mmc: no busy signalling in time [ 3.394561] mmci-pl18x 80005000.mmc: lost busy status when waiting for busy start IRQ This probably means that the busy detect start IRQ has already occurred when we start executing the ->busy_complete() callbacks, and the busy detect end IRQ is counted as the start IRQ, and this is what is causing the card to not be detected properly. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-5-69a7164f2a61@linaro.org Signed-off-by: Ulf Hansson commit e1a2485cc367cd0efe6821e2d8deef863c4ba250 Author: Linus Walleij Date: Fri Jun 16 22:42:22 2023 +0200 mmc: mmci: Break out error check in busy detect The busy detect callback for Ux500 checks for an error in the status in the first if() clause. The only practical reason is that if an error occurs, the if()-clause is not executed, and the code falls through to the last if()-clause if (host->busy_status) which will clear and disable the irq. Make this explicit instead: it is easier to read. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-4-69a7164f2a61@linaro.org Signed-off-by: Ulf Hansson commit 8a6a9e79720a51f40835a8a7dc94cf02a58f0600 Author: Linus Walleij Date: Fri Jun 16 22:42:21 2023 +0200 mmc: mmci: Stash status while waiting for busy Some interesting flags can arrive while we are waiting for the first busy detect IRQ so OR then onto the stashed flags so they are not missed. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-3-69a7164f2a61@linaro.org Signed-off-by: Ulf Hansson commit 479d8e61f6244286e629e157ea831e8c4f783826 Author: Linus Walleij Date: Fri Jun 16 22:42:20 2023 +0200 mmc: mmci: Unwind big if() clause This does two things: firsr replace the hard-to-read long if-expression: if (!host->busy_status && !(status & err_msk) && (readl(base + MMCISTATUS) & host->variant->busy_detect_flag)) { With the more readable: if (!host->busy_status && !(status & err_msk)) { status = readl(base + MMCISTATUS); if (status & host->variant->busy_detect_flag) { Second notice that the re-read MMCISTATUS register is now stored into the status variable, using logic OR because what if something else changed too? While we are at it, explain what the function is doing. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-2-69a7164f2a61@linaro.org Signed-off-by: Ulf Hansson commit 2673493fdfe78a1a8df1f802755cc2448ca98df6 Author: Linus Walleij Date: Fri Jun 16 22:42:19 2023 +0200 mmc: mmci: Clear busy_status when starting command If we are starting a command which can generate a busy response, then clear the variable host->busy_status if the variant is using a ->busy_complete callback. We are lucky that the member is zero by default and hopefully always gets cleared in the ->busy_complete callback even on errors, but it's just fragile so make sure it is always initialized to zero. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-1-69a7164f2a61@linaro.org Signed-off-by: Ulf Hansson commit cf0b045ebf6bba7764151e1759c874c43964445a Author: Johannes Berg Date: Sun Jun 18 21:50:02 2023 +0300 wifi: mac80211: check EHT basic MCS/NSS set Check that all the NSS in the EHT basic MCS/NSS set are actually supported, otherwise disable EHT for the connection. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.737827c906c9.I0c11a3cd46ab4dcb774c11a5bbc30aecfb6fce11@changeid Signed-off-by: Johannes Berg commit 5461707a529c94f6f556847c25c21da5990488ba Author: Benjamin Berg Date: Sun Jun 18 21:50:01 2023 +0300 wifi: cfg80211: search all RNR elements for colocated APs An AP reporting colocated APs may send more than one reduced neighbor report element. As such, iterate all elements instead of only parsing the first one when looking for colocated APs. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.ffe2c014f478.I372a4f96c88f7ea28ac39e94e0abfc465b5330d4@changeid Signed-off-by: Johannes Berg commit 8dcc91c446687727f88997a2e177cdab740ef092 Author: Benjamin Berg Date: Sun Jun 18 21:50:00 2023 +0300 wifi: cfg80211: stop parsing after allocation failure The error handling code would break out of the loop incorrectly, causing the rest of the message to be misinterpreted. Fix this by also jumping out of the surrounding while loop, which will trigger the error detection code. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.0ffac98475cf.I6f5c08a09f5c9fced01497b95a9841ffd1b039f8@changeid Signed-off-by: Johannes Berg commit c870d66f1b7f51fa3401771ff6c41fd78adb869e Author: Johannes Berg Date: Sun Jun 18 21:49:59 2023 +0300 wifi: update multi-link element STA reconfig Update the MLE STA reconfig sub-type to 802.11be D3.0 format, which includes the operation update field. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.2e1383b31f07.I8055a111c8fcf22e833e60f5587a4d8d21caca5b@changeid Signed-off-by: Johannes Berg commit 92bf4dd35801b4e3e73d3cc4beb5c929f75e0da6 Author: Johannes Berg Date: Sun Jun 18 21:49:58 2023 +0300 wifi: mac80211: agg-tx: prevent start/stop race There were crashes reported in this code, and the timer_shutdown() warning in one of the previous patches indicates that the timeout timer for the AP response (addba_resp_timer) is still armed while we're stopping the aggregation session. After a very long deliberation of the code, so far the only way I could find that might cause this would be the following sequence: - session start requested - session start indicated to driver, but driver returns IEEE80211_AMPDU_TX_START_DELAY_ADDBA - session stop requested, sets HT_AGG_STATE_WANT_STOP - session stop worker runs ___ieee80211_stop_tx_ba_session(), sets HT_AGG_STATE_STOPPING From here on, the order doesn't matter exactly, but: 1. driver calls ieee80211_start_tx_ba_cb_irqsafe(), setting HT_AGG_STATE_START_CB 2. driver calls ieee80211_stop_tx_ba_cb_irqsafe(), setting HT_AGG_STATE_STOP_CB 3. the worker will run ieee80211_start_tx_ba_cb() for HT_AGG_STATE_START_CB 4. the worker will run ieee80211_stop_tx_ba_cb() for HT_AGG_STATE_STOP_CB (the order could also be 1./3./2./4.) This will cause ieee80211_start_tx_ba_cb() to send out the AddBA request frame to the AP and arm the timer, but we're already in the middle of stopping and so the ieee80211_stop_tx_ba_cb() will no longer assume it needs to stop anything. Prevent this by checking for WANT_STOP/STOPPING in the start CB, and warn if we're sending a frame on a stopping session. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.e5b52777462a.I0b2ed6658e81804279f5d7c9c1918cb1f6626bf2@changeid Signed-off-by: Johannes Berg commit 6f2db6588b8189caeeb8249727b8344eba991250 Author: Johannes Berg Date: Sun Jun 18 21:49:57 2023 +0300 wifi: mac80211: agg-tx: add a few locking assertions This is all true today, but difficult to understand since the callers are in other files etc. Add two new lockdep assertions to make things easier to read. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.7f03dec6a90b.I762c11e95da005b80fa0184cb1173b99ec362acf@changeid Signed-off-by: Johannes Berg commit 888a325fe0a7d149828600c663869636ffdbe81f Author: Johannes Berg Date: Sun Jun 18 21:49:56 2023 +0300 wifi: ieee80211: reorder presence checks in MLE per-STA profile In ieee80211_mle_sta_prof_size_ok(), the presence checks aren't ordered by field order, so that's a bit confusing. Reorder them. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.fdbf17320a37.I517cf27fdc3f6e5d6a2615182da47ba4bdf14039@changeid Signed-off-by: Johannes Berg commit 8eb8dd2ffbbb6b0b8843b66754ee9f129f1b2d6c Author: Ilan Peer Date: Sun Jun 18 21:49:55 2023 +0300 wifi: mac80211: Support link removal using Reconfiguration ML element Add support for handling link removal indicated by the Reconfiguration Multi-Link element. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.d8a046dc0c1a.I4dcf794da2a2d9f4e5f63a4b32158075d27c0660@changeid [use cfg80211_links_removed() API instead] Signed-off-by: Johannes Berg commit 79973d5cfdc15134d08036796a372d7ec8a1d51e Author: Benjamin Berg Date: Thu May 11 13:13:21 2023 +0200 wifi: mac80211: add set_active_links variant not locking sdata There are cases where keeping sdata locked for an operation. Add a variant that does not take sdata lock to permit these usecases. Signed-off-by: Benjamin Berg Signed-off-by: Johannes Berg commit ff32b4506f3ef2228aab601f6d4b37840d05ffaf Author: Benjamin Berg Date: Tue Jun 6 17:43:26 2023 +0200 wifi: mac80211: add ___ieee80211_disconnect variant not locking sdata There are cases where keeping sdata locked for an operation. Add a variant that does not take sdata lock to permit these usecases. Signed-off-by: Benjamin Berg Signed-off-by: Johannes Berg commit 1784fbc2ed9c888ea4e895f30a53207ed7ee8208 Author: Christian Brauner Date: Fri Jun 16 15:53:58 2023 +0300 ovl: port to new mount api We recently ported util-linux to the new mount api. Now the mount(8) tool will by default use the new mount api. While trying hard to fall back to the old mount api gracefully there are still cases where we run into issues that are difficult to handle nicely. Now with mount(8) and libmount supporting the new mount api I expect an increase in the number of bug reports and issues we're going to see with filesystems that don't yet support the new mount api. So it's time we rectify this. When ovl_fill_super() fails before setting sb->s_root, we need to cleanup sb->s_fs_info. The logic is a bit convoluted but tl;dr: If sget_fc() has succeeded fc->s_fs_info will have been transferred to sb->s_fs_info. So by the time ->fill_super()/ovl_fill_super() is called fc->s_fs_info is NULL consequently fs_context->free() won't call ovl_free_fs(). If we fail before sb->s_root() is set then ->put_super() won't be called which would call ovl_free_fs(). IOW, if we fail in ->fill_super() before sb->s_root we have to clean it up. Signed-off-by: Christian Brauner Signed-off-by: Amir Goldstein commit ac519625edf2004fd34f6deec3110b154f621780 Author: Amir Goldstein Date: Sat Jun 17 09:05:52 2023 +0300 ovl: factor out ovl_parse_options() helper For parsing a single mount option. Signed-off-by: Amir Goldstein commit af5f2396b671c9857b113584d4bd43413b39cfdb Author: Amir Goldstein Date: Sat Jun 17 09:42:36 2023 +0300 ovl: store enum redirect_mode in config instead of a string Do all the logic to set the mode during mount options parsing and do not keep the option string around. Use a constant_table to translate from enum redirect mode to string in preperation for new mount api option parsing. The mount option "off" is translated to either "follow" or "nofollow", depending on the "redirect_always_follow" build/module config, so in effect, there are only three possible redirect modes. This results in a minor change to the string that is displayed in show_options() - when redirect_dir is enabled by default and the user mounts with the option "redirect_dir=off", instead of displaying the mode "redirect_dir=off" in show_options(), the displayed mode will be either "redirect_dir=follow" or "redirect_dir=nofollow", depending on the value of "redirect_always_follow" build/module config. The displayed mode reflects the effective mode, so mounting overlayfs again with the dispalyed redirect_dir option will result with the same effective and displayed mode. Signed-off-by: Amir Goldstein commit dcb399de1e404f48b07ebdcc434ec600568c90eb Author: Amir Goldstein Date: Thu May 25 08:40:54 2023 +0300 ovl: pass ovl_fs to xino helpers Internal ovl methods should use ovl_fs and not sb as much as possible. Use a constant_table to translate from enum xino mode to string in preperation for new mount api option parsing. Signed-off-by: Amir Goldstein commit 367d002d6cd21b8f0afe710cd9276fffe7b56d69 Author: Amir Goldstein Date: Sat Jun 17 11:00:24 2023 +0300 ovl: clarify ovl_get_root() semantics Change the semantics to take a reference on upperdentry instead of transferrig the reference. This is needed for upcoming port to new mount api. Signed-off-by: Amir Goldstein commit e4599d4b1aeff031d5764b25b37100b4f98148fc Author: Amir Goldstein Date: Sat Jun 17 09:12:50 2023 +0300 ovl: negate the ofs->share_whiteout boolean The default common case is that whiteout sharing is enabled. Change to storing the negated no_shared_whiteout state, so we will not need to initialize it. This is the first step towards removing all config and feature initializations out of ovl_fill_super(). Signed-off-by: Amir Goldstein commit f723edb8a532cd26e1ff0a2b271d73762d48f762 Author: Christian Brauner Date: Tue Jun 13 10:13:37 2023 +0200 ovl: check type and offset of struct vfsmount in ovl_entry Porting overlayfs to the new amount api I started experiencing random crashes that couldn't be explained easily. So after much debugging and reasoning it became clear that struct ovl_entry requires the point to struct vfsmount to be the first member and of type struct vfsmount. During the port I added a new member at the beginning of struct ovl_entry which broke all over the place in the form of random crashes and cache corruptions. While there's a comment in ovl_free_fs() to the effect of "Hack! Reuse ofs->layers as a vfsmount array before freeing it" there's no such comment on struct ovl_entry which makes this easy to trip over. Add a comment and two static asserts for both the offset and the type of pointer in struct ovl_entry. Signed-off-by: Christian Brauner Signed-off-by: Amir Goldstein commit 4251566ebc1cf95ae26a1e5a24cdac1ac25e942f Author: Yazen Ghannam Date: Mon May 15 11:35:37 2023 +0000 EDAC/amd64: Cache and use GPU node map AMD systems have historically provided an "AMD Node ID" that is a unique identifier for each die in a multi-die package. This was associated with a unique instance of the AMD Northbridge on a legacy system. And now it is associated with a unique instance of the AMD Data Fabric on modern systems. Each instance is referred to as a "Node"; this is an AMD-specific term not to be confused with NUMA nodes. The data fabric provides a number of interfaces accessible through a set of functions in a single PCI device. There is one PCI device per Data Fabric (AMD Node), and multi-die systems will see multiple such PCI devices. The AMD Node ID matches a Node's position in the PCI hierarchy. For example, the Node 0 is accessed using the first PCI device, Node 1 is accessed using the second, and so on. A logical CPU can find its AMD Node ID using CPUID. Furthermore, the AMD Node ID is used within the hardware fabric, so it is not purely a logical value. Heterogeneous AMD systems, with a CPU Data Fabric connected to GPU data fabrics, follow a similar convention. Each CPU and GPU die has a unique AMD Node ID value, and each Node ID corresponds to PCI devices in sequential order. However, there are two caveats: 1) GPUs are not x86, and they don't have CPUID to read their AMD Node ID like on CPUs. This means the value is more implicit and based on PCI enumeration and hardware-specifics. 2) There is a gap in the hardware values for AMD Node IDs. Values 0-7 are for CPUs and values 8-15 are for GPUs. For example, a system with one CPU die and two GPUs dies will have the following values: CPU0 -> AMD Node 0 GPU0 -> AMD Node 8 GPU1 -> AMD Node 9 EDAC is the only subsystem where this has a practical effect. Memory errors on AMD systems are commonly reported through MCA to a CPU on the local AMD Node. The error information is passed along to EDAC where the AMD EDAC modules use the AMD Node ID of reporting logical CPU to access AMD Node information. However, memory errors from a GPU die will be reported to the CPU die. Therefore, the logical CPU's AMD Node ID can't be used since it won't match the AMD Node ID of the GPU die. The AMD Node ID of the GPU die is provided as part of the MCA information, and the value will match the hardware enumeration (e.g. 8-15). Handle this situation by discovering GPU dies the same way as CPU dies in the AMD NB code. But do a "node id" fixup in AMD64 EDAC where it's needed. The GPU data fabrics provide a register with the base AMD Node ID for their local "type", i.e. GPU data fabric. This value is the same for all fabrics of the same type in a system. Read and cache the base AMD Node ID from one of the GPU devices during module initialization. Use this to fixup the "node id" when reporting memory errors at runtime. [ bp: Squash a fix making gpu_node_map static as reported by Tom Rix . Link: https://lore.kernel.org/r/20230610210930.174074-1-trix@redhat.com ] Signed-off-by: Yazen Ghannam Co-developed-by: Muralidhara M K Signed-off-by: Muralidhara M K Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230515113537.1052146-6-muralimk@amd.com commit 42dd69ae1af42cf72d167e63a039b8c63653eb7f Author: Amir Goldstein Date: Thu Apr 27 13:39:09 2023 +0300 ovl: implement lazy lookup of lowerdata in data-only layers Defer lookup of lowerdata in the data-only layers to first data access or before copy up. We perform lowerdata lookup before copy up even if copy up is metadata only copy up. We can further optimize this lookup later if needed. We do best effort lazy lookup of lowerdata for d_real_inode(), because this interface does not expect errors. The only current in-tree caller of d_real_inode() is trace_uprobe and this caller is likely going to be followed reading from the file, before placing uprobes on offset within the file, so lowerdata should be available when setting the uprobe. Tested-by: kernel test robot Reviewed-by: Alexander Larsson Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 416656447864ef0fc2430525499f52a4a370a0ab Author: Amir Goldstein Date: Sun Apr 2 21:56:49 2023 +0300 ovl: prepare for lazy lookup of lowerdata inode Make the code handle the case of numlower > 1 and missing lowerdata dentry gracefully. Missing lowerdata dentry is an indication for lazy lookup of lowerdata and in that case the lowerdata_redirect path is stored in ovl_inode. Following commits will defer lookup and perform the lazy lookup on access. Reviewed-by: Alexander Larsson Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 2b21da920866ad20b5e3119f3b8d2267774b7b0a Author: Amir Goldstein Date: Thu Apr 27 12:21:46 2023 +0300 ovl: prepare to store lowerdata redirect for lazy lowerdata lookup Prepare to allow ovl_lookup() to leave the last entry in a non-dir lowerstack empty to signify lazy lowerdata lookup. In this case, ovl_lookup() stores the redirect path from metacopy to lowerdata in ovl_inode, which is going to be used later to perform the lazy lowerdata lookup. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 5436ab0a864e8bb263919e51c26395a67bde17ca Author: Amir Goldstein Date: Thu Apr 27 14:52:13 2023 +0300 ovl: implement lookup in data-only layers Lookup in data-only layers only for a lower metacopy with an absolute redirect xattr. The metacopy xattr is not checked on files found in the data-only layers and redirect xattr are not followed in the data-only layers. Reviewed-by: Alexander Larsson Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 37ebf056d6cfc6638c821386bc33a9602bbc0d28 Author: Amir Goldstein Date: Thu Apr 27 12:48:46 2023 +0300 ovl: introduce data-only lower layers Introduce the format lowerdir=lower1:lower2::lowerdata1::lowerdata2 where the lower layers on the right of the :: separators are not merged into the overlayfs merge dirs. Data-only lower layers are only allowed at the bottom of the stack. The files in those layers are only meant to be accessible via absolute redirect from metacopy files in lower layers. Following changes will implement lookup in the data layers. This feature was requested for composefs ostree use case, where the lower data layer should only be accessiable via absolute redirects from metacopy inodes. The lower data layers are not required to a have a unique uuid or any uuid at all, because they are never used to compose the overlayfs inode st_ino/st_dev. Reviewed-by: Alexander Larsson Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 9e88f9052415289f2789abb6ae68a40a4701b8e1 Author: Amir Goldstein Date: Sat Apr 1 12:51:55 2023 +0300 ovl: remove unneeded goto instructions There is nothing in the out goto target of ovl_get_layers(). Reviewed-by: Alexander Larsson Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit ab1eb5ffb7d2a69c9b24083026a63cbdd758d96b Author: Amir Goldstein Date: Sat Apr 1 10:29:19 2023 +0300 ovl: deduplicate lowerdata and lowerstack[] The ovl_inode contains a copy of lowerdata in lowerstack[], so the lowerdata inode member can be removed. Use accessors ovl_lowerdata*() to get the lowerdata whereever the member was accessed directly. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit ac900ed4f253434e099a025fc1da3d04bc741bd3 Author: Amir Goldstein Date: Sat Apr 1 10:29:19 2023 +0300 ovl: deduplicate lowerpath and lowerstack[] The ovl_inode contains a copy of lowerpath in lowerstack[0], so the lowerpath member can be removed. Use accessor ovl_lowerpath() to get the lowerpath whereever the member was accessed directly. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 0af950f57fefabab628f1963af881e6b9bfe7f38 Author: Amir Goldstein Date: Sat Apr 8 12:31:13 2023 +0300 ovl: move ovl_entry into ovl_inode The lower stacks of all the ovl inode aliases should be identical and there is redundant information in ovl_entry and ovl_inode. Move lowerstack into ovl_inode and keep only the OVL_E_FLAGS per overlay dentry. Following patches will deduplicate redundant ovl_inode fields. Note that for pure upper and negative dentries, OVL_E(dentry) may be NULL now, so it is imporatnt to use the ovl_numlower() accessor. Reviewed-by: Alexander Larsson Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 163db0da3515d1d32343906a2fb7854492191d19 Author: Amir Goldstein Date: Mon Apr 3 20:36:16 2023 +0300 ovl: factor out ovl_free_entry() and ovl_stack_*() helpers In preparation for moving lowerstack into ovl_inode. Note that in ovl_lookup() the temp stack dentry refs are now cloned into the final ovl_lowerstack instead of being transferred, so cleanup always needs to call ovl_stack_free(stack). Reviewed-by: Alexander Larsson Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 5522c9c7cbd2ab4e886fa1c70896f0bdd483ce0b Author: Amir Goldstein Date: Mon Apr 3 11:51:47 2023 +0300 ovl: use ovl_numlower() and ovl_lowerstack() accessors This helps fortify against dereferencing a NULL ovl_entry, before we move the ovl_entry reference into ovl_inode. Reviewed-by: Alexander Larsson Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit a6ff2bc0be179eea72832b5396481a08ccd22d5a Author: Amir Goldstein Date: Wed Mar 15 04:31:37 2023 +0200 ovl: use OVL_E() and OVL_E_FLAGS() accessors Instead of open coded instances, because we are about to split the two apart. Reviewed-by: Alexander Larsson Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit b07d5cc93e1b28df47a72c519d09d0a836043613 Author: Amir Goldstein Date: Mon Apr 3 11:29:59 2023 +0300 ovl: update of dentry revalidate flags after copy up After copy up, we may need to update d_flags if upper dentry is on a remote fs and lower dentries are not. Add helpers to allow incremental update of the revalidate flags. Fixes: bccece1ead36 ("ovl: allow remote upper") Reviewed-by: Gao Xiang Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit f4e19e595cc2e76a8a58413eb19d3d9c51328b53 Author: Zhihao Cheng Date: Tue May 16 22:16:19 2023 +0800 ovl: fix null pointer dereference in ovl_get_acl_rcu() Following process: P1 P2 path_openat link_path_walk may_lookup inode_permission(rcu) ovl_permission acl_permission_check check_acl get_cached_acl_rcu ovl_get_inode_acl realinode = ovl_inode_real(ovl_inode) drop_cache __dentry_kill(ovl_dentry) iput(ovl_inode) ovl_destroy_inode(ovl_inode) dput(oi->__upperdentry) dentry_kill(upperdentry) dentry_unlink_inode upperdentry->d_inode = NULL ovl_inode_upper upperdentry = ovl_i_dentry_upper(ovl_inode) d_inode(upperdentry) // returns NULL IS_POSIXACL(realinode) // NULL pointer dereference , will trigger an null pointer dereference at realinode: [ 205.472797] BUG: kernel NULL pointer dereference, address: 0000000000000028 [ 205.476701] CPU: 2 PID: 2713 Comm: ls Not tainted 6.3.0-12064-g2edfa098e750-dirty #1216 [ 205.478754] RIP: 0010:do_ovl_get_acl+0x5d/0x300 [ 205.489584] Call Trace: [ 205.489812] [ 205.490014] ovl_get_inode_acl+0x26/0x30 [ 205.490466] get_cached_acl_rcu+0x61/0xa0 [ 205.490908] generic_permission+0x1bf/0x4e0 [ 205.491447] ovl_permission+0x79/0x1b0 [ 205.491917] inode_permission+0x15e/0x2c0 [ 205.492425] link_path_walk+0x115/0x550 [ 205.493311] path_lookupat.isra.0+0xb2/0x200 [ 205.493803] filename_lookup+0xda/0x240 [ 205.495747] vfs_fstatat+0x7b/0xb0 Fetch a reproducer in [Link]. Use the helper ovl_i_path_realinode() to get realinode and then do non-nullptr checking. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217404 Fixes: 332f606b32b6 ("ovl: enable RCU'd ->get_acl()") Cc: # v5.15 Signed-off-by: Zhihao Cheng Suggested-by: Christian Brauner Suggested-by: Amir Goldstein Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 1a73f5b8f079fd42a544c1600beface50c63af7c Author: Zhihao Cheng Date: Tue May 16 22:16:18 2023 +0800 ovl: fix null pointer dereference in ovl_permission() Following process: P1 P2 path_lookupat link_path_walk inode_permission ovl_permission ovl_i_path_real(inode, &realpath) path->dentry = ovl_i_dentry_upper(inode) drop_cache __dentry_kill(ovl_dentry) iput(ovl_inode) ovl_destroy_inode(ovl_inode) dput(oi->__upperdentry) dentry_kill(upperdentry) dentry_unlink_inode upperdentry->d_inode = NULL realinode = d_inode(realpath.dentry) // return NULL inode_permission(realinode) inode->i_sb // NULL pointer dereference , will trigger an null pointer dereference at realinode: [ 335.664979] BUG: kernel NULL pointer dereference, address: 0000000000000002 [ 335.668032] CPU: 0 PID: 2592 Comm: ls Not tainted 6.3.0 [ 335.669956] RIP: 0010:inode_permission+0x33/0x2c0 [ 335.678939] Call Trace: [ 335.679165] [ 335.679371] ovl_permission+0xde/0x320 [ 335.679723] inode_permission+0x15e/0x2c0 [ 335.680090] link_path_walk+0x115/0x550 [ 335.680771] path_lookupat.isra.0+0xb2/0x200 [ 335.681170] filename_lookup+0xda/0x240 [ 335.681922] vfs_statx+0xa6/0x1f0 [ 335.682233] vfs_fstatat+0x7b/0xb0 Fetch a reproducer in [Link]. Use the helper ovl_i_path_realinode() to get realinode and then do non-nullptr checking. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217405 Fixes: 4b7791b2e958 ("ovl: handle idmappings in ovl_permission()") Cc: # v5.19 Signed-off-by: Zhihao Cheng Suggested-by: Christian Brauner Suggested-by: Amir Goldstein Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit b2dd05f107b11966e26fe52a313b418364cf497b Author: Zhihao Cheng Date: Tue May 16 22:16:17 2023 +0800 ovl: let helper ovl_i_path_real() return the realinode Let helper ovl_i_path_real() return the realinode to prepare for checking non-null realinode in RCU walking path. [msz] Use d_inode_rcu() since we are depending on the consitency between dentry and inode being non-NULL in an RCU setting. Signed-off-by: Zhihao Cheng Signed-off-by: Amir Goldstein Fixes: ffa5723c6d25 ("ovl: store lower path in ovl_inode") Cc: # v5.19 Signed-off-by: Miklos Szeredi commit 605ba2564437b088243b5f5cdf65b182a10220a1 Author: Raag Jadav Date: Sat Jun 17 02:03:56 2023 +0530 pinctrl: baytrail: invert if condition Invert if condition and get rid of redundant else. Signed-off-by: Raag Jadav Acked-by: Mika Westerberg Link: https://lore.kernel.org/r/20230616203356.27343-4-raag.jadav@intel.com Signed-off-by: Andy Shevchenko commit 9d49882e439efde737dbd65d6319123dbf91d42d Author: Raag Jadav Date: Sat Jun 17 02:03:55 2023 +0530 pinctrl: baytrail: add warning for BYT_VAL_REG retrieval failure Add warning for BYT_VAL_REG retrieval failure and continue such case to avoid unintended reads/writes in pm_ops. Signed-off-by: Raag Jadav Acked-by: Mika Westerberg Link: https://lore.kernel.org/r/20230616203356.27343-3-raag.jadav@intel.com Signed-off-by: Andy Shevchenko commit 5a9fa4c2cd538fe7e244e33aca1a2c87dd0c2471 Author: Raag Jadav Date: Sat Jun 17 02:03:54 2023 +0530 pinctrl: baytrail: reduce scope of spinlock in ->dbg_show() hook Reduce scope of spinlock to IO operations in ->dbg_show() hook and save a few bytes. add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-12 (-12) Function old new delta byt_gpio_dbg_show 890 878 -12 Total: Before=17029, After=17017, chg -0.07% Signed-off-by: Raag Jadav Acked-by: Mika Westerberg Link: https://lore.kernel.org/r/20230616203356.27343-2-raag.jadav@intel.com Signed-off-by: Andy Shevchenko commit 6f7f812f54b46da88ec6e98b4a10e501d0d7164c Author: Randy Dunlap Date: Fri Jun 9 22:43:10 2023 -0700 Documentation: virt: Clean up paravirt_ops doc Clarify language. Clean up grammar. Hyphenate some words. Change "low-ops" to "low-level" since "low-ops" isn't defined or even mentioned anywhere else in the kernel source tree. Signed-off-by: Randy Dunlap Signed-off-by: Borislav Petkov (AMD) Acked-by: Juergen Gross Link: https://lore.kernel.org/r/20230610054310.6242-1-rdunlap@infradead.org commit 065563b20a664a6575dc158688dfb0e121c25b38 Author: Veerendranath Jakkam Date: Fri Mar 17 19:51:53 2023 +0530 wifi: cfg80211/nl80211: Add support to indicate STA MLD setup links removal STA MLD setup links may get removed if AP MLD remove the corresponding affiliated APs with Multi-Link reconfiguration as described in P802.11be_D3.0, section 35.3.6.2.2 Removing affiliated APs. Currently, there is no support to notify such operation to cfg80211 and userspace. Add support for the drivers to indicate STA MLD setup links removal to cfg80211 and notify the same to userspace. Upon receiving such indication from the driver, clear the MLO links information of the removed links in the WDEV. Signed-off-by: Veerendranath Jakkam Link: https://lore.kernel.org/r/20230317142153.237900-1-quic_vjakkam@quicinc.com [rename function and attribute, fix kernel-doc] Signed-off-by: Johannes Berg commit a0ed50112b98fa8e9bc85dbeafc82fd97ee06716 Author: Benjamin Berg Date: Sun Jun 18 21:49:54 2023 +0300 wifi: cfg80211: do not scan disabled links on 6GHz If a link is disabled on 6GHz, we should not send a probe request on the channel to resolve it. Simply skip such RNR entries so that the link is ignored. Userspace can still see the link in the RNR and may generate an ML probe request in order to associate to the (currently) disabled link. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.4f7384006471.Iff8f1081e76a298bd25f9468abb3a586372cddaa@changeid Signed-off-by: Johannes Berg commit 2481b5da9c6b2ee1fde55a1c29eb2ca377145a10 Author: Benjamin Berg Date: Sun Jun 18 21:49:53 2023 +0300 wifi: cfg80211: handle BSS data contained in ML probe responses The basic multi-link element within an multi-link probe response will contain full information about BSSes that are part of an MLD AP. This BSS information may be used to associate with a link of an MLD AP without having received a beacon from the BSS itself. This patch adds parsing of the data and adding/updating the BSS using the received elements. Doing this means that userspace can discover the BSSes using an ML probe request and request association on these links. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.29593bd0ae1f.Ic9a67b8f022360aa202b870a932897a389171b14@changeid [swap loop conditions smatch complained about] Signed-off-by: Johannes Berg commit dc92e54c30c4bc9d30e674a445dfe1afdca991cf Author: Benjamin Berg Date: Sun Jun 18 21:49:52 2023 +0300 wifi: cfg80211: use structs for TBTT information access Make the data access a bit nicer overall by using structs. There is a small change here to also accept a TBTT information length of eight bytes as we do not require the 20 MHz PSD information. This also fixes a bug reading the short SSID on big endian machines. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.4c3f8901c1bc.Ic3e94fd6e1bccff7948a252ad3bb87e322690a17@changeid Signed-off-by: Johannes Berg commit 50181fe4f59dcfae391523def6f62e32d86c46b1 Author: Benjamin Berg Date: Sun Jun 18 21:49:51 2023 +0300 wifi: ieee80211: add structs for TBTT information access The TBTT information can have various lengths with different elements thare are present. Add definitions for the two types that we are interested in (i.e. the ones that contain the BSSID). Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.2a6f8766a3ec.Ic962e28492212cc8ee1eb602b8f07a4ea172fc4a@changeid Signed-off-by: Johannes Berg commit eb142608e2c4ea0acefefb00025af523195d30d3 Author: Benjamin Berg Date: Sun Jun 18 21:49:50 2023 +0300 wifi: cfg80211: use a struct for inform_single_bss data The argument is getting quite large, so use a struct internally to pass around the information. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.831ab8a87b6f.I3bcc83d90f41d6f8a47b39528575dad0a9ec3564@changeid Signed-off-by: Johannes Berg commit 66d9c573fbb992f11d29a907c339792ee0de82ee Author: Benjamin Berg Date: Sun Jun 18 21:49:49 2023 +0300 wifi: ieee80211: add definitions for RNR MLD params Add the definitions necessary to parse the MLD parameters included in an RNR element. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214436.9999842237c0.I80f00a90cb4e43071432b4158f206c73ba799618@changeid Signed-off-by: Johannes Berg commit 891d4d5831ee4c5e45a3ccba11577cdc6e57a726 Author: Benjamin Berg Date: Sun Jun 18 21:49:48 2023 +0300 wifi: cfg80211: Always ignore ML element The element should never be inherited, so always exclude it. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214435.c0e17989b4ed.I7cecb5ab7cd6919e61839b50ce5156904b41d7d8@changeid Signed-off-by: Johannes Berg commit 39bcc5b8e16e75cfccc36fca3d425c64eef3df04 Author: Benjamin Berg Date: Sun Jun 18 21:49:47 2023 +0300 wifi: ieee80211: use default for medium synchronization delay Default values are defined for the information included in the Medium Synchronization Delay Information subfield. The spec says to initialize the values to these defaults and only change them when included. Return the default value instead of zero so that the defaults are used when the field is not included in the association response. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214435.a7725bef3795.I2d3528cf4af021c5b37f97fbe64ae9116ce9bef1@changeid Signed-off-by: Johannes Berg commit eeec7574ec3c03c69adc99492df74dc1cc0ebd63 Author: Benjamin Berg Date: Sun Jun 18 21:49:46 2023 +0300 wifi: ieee80211: add helper to validate ML element type and size The helper functions to retrieve the EML capabilities and medium synchronization delay both assume that the type is correct. Instead of assuming the length is correct and still checking the type, add a new helper to check both and don't do any verification. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214435.1b50e7a3b3cf.I9385514d8eb6d6d3c82479a6fa732ef65313e554@changeid Signed-off-by: Johannes Berg commit ce6e1f600b0cfc563a7d607de702262a58cd835d Author: Ilan Peer Date: Sun Jun 18 21:49:45 2023 +0300 wifi: ieee80211: Fix the common size calculation for reconfiguration ML The common information length is found in the first octet of the common information. Fixes: 0f48b8b88aa9 ("wifi: ieee80211: add definitions for multi-link element") Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214435.3c7ed4817338.I42ef706cb827b4dade6e4ffbb6e7f341eaccd398@changeid Signed-off-by: Johannes Berg commit dbd396636870b30c2c11c098bfc30e124198d29f Author: Ilan Peer Date: Sun Jun 18 21:49:44 2023 +0300 wifi: mac80211: Include Multi-Link in CRC calculation Include the Multi-Link elements found in beacon frames in the CRC calculation, as these elements are intended to reflect changes in the AP MLD state. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230618214435.ae8246b93d85.Ia64b45198de90ff7f70abcc997841157f148ea40@changeid Signed-off-by: Johannes Berg commit e8c2af660ba0790afd14d5cbc2fd05c6dc85e207 Author: Johannes Berg Date: Fri Jun 16 22:28:45 2023 +0200 wifi: cfg80211: fix regulatory disconnect with OCB/NAN Since regulatory disconnect was added, OCB and NAN interface types were added, which made it completely unusable for any driver that allowed OCB/NAN. Add OCB/NAN (though NAN doesn't do anything, we don't have any info) and also remove all the logic that opts out, so it won't be broken again if/when new interface types are added. Fixes: 6e0bd6c35b02 ("cfg80211: 802.11p OCB mode handling") Fixes: cb3b7d87652a ("cfg80211: add start / stop NAN commands") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20230616222844.2794d1625a26.I8e78a3789a29e6149447b3139df724a6f1b46fc3@changeid Signed-off-by: Johannes Berg commit b22552fcaf1970360005c805d7fba4046cf2ab4a Author: Johannes Berg Date: Fri Jun 16 22:28:44 2023 +0200 wifi: cfg80211: fix regulatory disconnect for non-MLO The multi-link loop here broke disconnect when multi-link operation (MLO) isn't active for a given interface, since in that case valid_links is 0 (indicating no links, i.e. no MLO.) Fix this by taking that into account properly and skipping the link only if there are valid_links in the first place. Cc: stable@vger.kernel.org Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20230616222844.eb073d650c75.I72739923ef80919889ea9b50de9e4ba4baa836ae@changeid Signed-off-by: Johannes Berg commit e2efec97c3ad503042db27baaf7c8cb5d1348a83 Author: Ilan Peer Date: Fri Jun 16 09:54:09 2023 +0300 wifi: mac80211: Rename ieee80211_mle_sta_prof_size_ok() Rename it to ieee80211_mle_basic_sta_prof_size_ok() as it validates the size of the station profile included in Basic Multi-Link element. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094949.9bdfd263974f.I7bebd26894f33716e93cc7da576ef3215e0ba727@changeid Signed-off-by: Johannes Berg commit cf36cdef10e28df52d500a4829263d1b4d24bc44 Author: Ilan Peer Date: Fri Jun 16 09:54:08 2023 +0300 wifi: mac80211: Add support for parsing Reconfiguration Multi Link element Parse Reconfiguration Multi Link IE. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094949.6eeb6c9a4a6e.I1cb137da9b3c712fc7c7949a6dec9e314b5d7f63@changeid Signed-off-by: Johannes Berg commit a286de1aa38f7ea6605c770278a1ebf4096c03a2 Author: Ilan Peer Date: Fri Jun 16 09:54:07 2023 +0300 wifi: mac80211: Rename multi_link As a preparation to support Reconfiguration Multi Link element, rename 'multi_link' and 'multi_link_len' fields in 'struct ieee802_11_elems' to 'ml_basic' and 'ml_basic_len'. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094949.b11370d3066a.I34280ae3728597056a6a2f313063962206c0d581@changeid Signed-off-by: Johannes Berg commit a76236de584ac15b2e495a613034a9e031449f7e Author: Benjamin Berg Date: Fri Jun 16 09:54:06 2023 +0300 wifi: mac80211: use cfg80211 defragmentation helper Use the shared functionality rather than copying it into mac80211. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094949.7dcbf82baade.Ic68d1f547cb75d66037abdbb0f066db20ff41ba3@changeid Signed-off-by: Johannes Berg commit f837a653a09700daa136a3db49c0c97d7295ca30 Author: Benjamin Berg Date: Fri Jun 16 09:54:05 2023 +0300 wifi: cfg80211: add element defragmentation helper This is already needed within mac80211 and support is also needed by cfg80211 to parse ML elements. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094949.29c3ebeed10d.I009c049289dd0162c2e858ed8b68d2875a672ed6@changeid Signed-off-by: Johannes Berg commit 39432f8a3752a87a53fd8d5e51824a43aaae5cab Author: Benjamin Berg Date: Fri Jun 16 09:54:04 2023 +0300 wifi: cfg80211: drop incorrect nontransmitted BSS update code The removed code ran for any BSS that was not included in the MBSSID element in order to update it. However, instead of using the correct inheritance rules, it would simply copy the elements from the transmitting AP. The result is that we would report incorrect elements in this case. After some discussions, it seems that there are likely not even APs actually using this feature. Either way, removing the code decreases complexity and makes the cfg80211 behaviour more correct. Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning") Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094949.cfd6d8db1f26.Ia1044902b86cd7d366400a4bfb93691b8f05d68c@changeid Signed-off-by: Johannes Berg commit dfd9aa3e7a456d57b18021d66472ab7ff8373ab7 Author: Benjamin Berg Date: Fri Jun 16 09:54:03 2023 +0300 wifi: cfg80211: rewrite merging of inherited elements The cfg80211_gen_new_ie function merges the IEs using inheritance rules. Rewrite this function to fix issues around inheritance rules. In particular, vendor elements do not require any special handling, as they are either all inherited or overridden by the subprofile. Also, add fragmentation handling as this may be needed in some cases. This also changes the function to not require making a copy. The new version could be optimized a bit by explicitly tracking which IEs have been handled already rather than looking that up again every time. Note that a small behavioural change is the removal of the SSID special handling. This should be fine for the MBSSID element, as the SSID must be included in the subelement. Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning") Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094949.bc6152e146db.I2b5f3bc45085e1901e5b5192a674436adaf94748@changeid Signed-off-by: Johannes Berg commit 03e7e493f1a3697eba115f3f69e296f7e47500ee Author: Benjamin Berg Date: Fri Jun 16 09:54:02 2023 +0300 wifi: cfg80211: ignore invalid TBTT info field types The TBTT information field type must be zero. This is only changed in the 802.11be draft specification where the value 1 is used to indicate that only the MLD parameters are included. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094949.7865606ffe94.I7ff28afb875d1b4c39acd497df8490a7d3628e3f@changeid Signed-off-by: Johannes Berg commit 108d202298bf03ce8d7e28bb94d23555c8385582 Author: Benjamin Berg Date: Fri Jun 16 09:54:01 2023 +0300 wifi: mac80211: use new inform_bss callback Doing this simplifies the code somewhat, as iteration over the nontransmitted BSSs is not required anymore. Also, mac80211 should not be iterating over the nontrans_list as it should only be accessed while the bss_lock is held. It also simplifies parsing of the IEs somewhat, as cfg80211 already extracts the IEs and passes them to the callback. Note that the only user left requiring parsing a specific BSS is the association code if a beacon is required by the hardware. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094949.39ebfe2f9e59.Ia012b08e0feed8ec431b666888b459f6366f7bd1@changeid Signed-off-by: Johannes Berg commit 5db25290b77b4efcf26c2b25f288ca3f13ff2fc5 Author: Benjamin Berg Date: Fri Jun 16 09:54:00 2023 +0300 wifi: cfg80211: add inform_bss op to update BSS This new function is called from within the inform_bss(_frame)_data functions in order for the driver to update data that it is tracking. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094949.8d7781b0f965.I80041183072b75c081996a1a5a230b34aff5c668@changeid Signed-off-by: Johannes Berg commit 6b7c93c1439c8833ada9068f612df2de0571fd00 Author: Benjamin Berg Date: Fri Jun 16 09:53:59 2023 +0300 wifi: cfg80211: keep bss_lock held when informing It is reasonable to hold bss_lock for a little bit longer after cfg80211_bss_update is done. Right now, this does not make any big difference, but doing so in preparation for the next patch which adds a call to the driver. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094948.61701884ff0d.I3358228209eb6766202aff04d1bae0b8fdff611f@changeid Signed-off-by: Johannes Berg commit c2edd3013266801d9c8595433c6eea462511f872 Author: Benjamin Berg Date: Fri Jun 16 09:53:58 2023 +0300 wifi: cfg80211: move regulatory_hint_found_beacon to be earlier These calls do not require any locking, so move them in preparation for the next patches. A minor change/bugfix is to not hint a beacon for nontransmitted BSSes Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094948.a5bf3558eae9.I33c7465d983c8bef19deb7a533ee475a16f91774@changeid Signed-off-by: Johannes Berg commit 40e38c8dfce1cf543c8bd06e2c1c03a36bc22fe4 Author: Emmanuel Grumbach Date: Fri Jun 16 09:53:57 2023 +0300 wifi: mac80211: feed the link_id to cfg80211_ch_switch_started_notify For now, fix this only in station mode. We'll need to fix the AP mode later. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094948.41e662ba1d68.I8faae5acb45c58cfeeb6bc6247aedbdaf9249d32@changeid Signed-off-by: Johannes Berg commit 05050a2bc0c1599e95ef15a6ae34cb68ceabb06a Author: Anjaneyulu Date: Fri Jun 16 09:53:56 2023 +0300 wifi: mac80211: add consistency check for compat chandef Add NULL check for compat variable to avoid crash in cfg80211_chandef_compatible() if it got called with some mixed up channel context where not all the users compatible with each other, which shouldn't happen. Signed-off-by: Anjaneyulu Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094948.ae0f10dfd36b.Iea98c74aeb87bf6ef49f6d0c8687bba0dbea2abd@changeid Signed-off-by: Johannes Berg commit 276311d5814f98b113b68302c96500fd316c2cbf Author: Benjamin Berg Date: Fri Jun 16 09:53:55 2023 +0300 wifi: mac80211: stop passing cbss to parser In both of these cases (config_link, prep_channel) it is not needed to parse the MBSSID data for a nontransmitted BSS. In the config_link case the frame does not contain any MBSSID element and inheritance rules are only needed for the ML STA profile. While in the prep_channel case the IEs have already been processed by cfg80211 and are already exploded. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094948.66d2605ff0ad.I7cdd1d390e7b0735c46204231a9e636d45b7f1e4@changeid Signed-off-by: Johannes Berg commit 05995d05aab399fcb1fba579397bff216dbf3e86 Author: Mukesh Sisodiya Date: Fri Jun 16 09:53:54 2023 +0300 wifi: mac80211: Extend AID element addition for TDLS frames Extend AID element addition in TDLS setup request and response frames to add it when HE or EHT capabilities are supported. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094948.483bf44ce684.Ia2387eb24c06fa41febc213923160bedafce2085@changeid Signed-off-by: Johannes Berg commit 71b3b7ac3eb8ceae582608dda0566e95c1108708 Author: Abhishek Naik Date: Fri Jun 16 09:53:53 2023 +0300 wifi: mac80211: Add HE and EHT capa elements in TDLS frames Add HE and EHT capabilities IE in TDLS setup request, response, confirm and discovery response frames. Signed-off-by: Abhishek Naik Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094948.c77128828b0d.Ied2d8800847c759718c2c35e8f6c0902afd6bca1@changeid Signed-off-by: Johannes Berg commit 8cc07265b69141f8ed9597d0f27185239c241c80 Author: Abhishek Naik Date: Fri Jun 16 09:53:52 2023 +0300 wifi: mac80211: handle TDLS data frames with MLO If the device is associated with an AP MLD, then TDLS data frames should have - A1 = peer address, - A2 = own MLD address (since the peer may now know about MLO), and - A3 = BSSID. Change the code to do that. Signed-off-by: Abhishek Naik Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094948.4bf648b63dfd.I98ef1dabd14b74a92120750f7746a7a512011701@changeid Signed-off-by: Johannes Berg commit 78a7ea370d5f0eb6f3e774e7f6afece1c3a6860f Author: Mukesh Sisodiya Date: Fri Jun 16 09:53:51 2023 +0300 wifi: mac80211: handle TDLS negotiation with MLO Userspace can now select the link to use for TDLS management frames (indicating e.g. which BSSID should be used), use the link_id received from cfg80211 to build the frames. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094948.ce1fc230b505.Ie773c5679805001f5a52680d68d9ce0232c57648@changeid [Benjamin fixed some locking] Co-developed-by: Benjamin Berg Signed-off-by: Benjamin Berg [fix sta mutex locking too] Signed-off-by: Johannes Berg commit c6112046b1a9c130c455ab0bbe74c3f41138693c Author: Mukesh Sisodiya Date: Fri Jun 16 09:53:50 2023 +0300 wifi: cfg80211: make TDLS management link-aware For multi-link operation(MLO) TDLS management frames need to be transmitted on a specific link. The TDLS setup request will add BSSID along with peer address and userspace will pass the link-id based on BSSID value to the driver(or mac80211). Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230616094948.cb3d87c22812.Ia3d15ac4a9a182145bf2d418bcb3ddf4539cd0a7@changeid Signed-off-by: Johannes Berg commit 71e7552c90db2a2767f5c17c7ec72296b0d92061 Author: Gustavo A. R. Silva Date: Thu Jun 15 12:04:07 2023 -0600 wifi: wext-core: Fix -Wstringop-overflow warning in ioctl_standard_iw_point() -Wstringop-overflow is legitimately warning us about extra_size pontentially being zero at some point, hence potenially ending up _allocating_ zero bytes of memory for extra pointer and then trying to access such object in a call to copy_from_user(). Fix this by adding a sanity check to ensure we never end up trying to allocate zero bytes of data for extra pointer, before continue executing the rest of the code in the function. Address the following -Wstringop-overflow warning seen when built m68k architecture with allyesconfig configuration: from net/wireless/wext-core.c:11: In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:183:7, inlined from 'ioctl_standard_iw_point' at net/wireless/wext-core.c:825:7: arch/m68k/include/asm/string.h:48:25: warning: '__builtin_memset' writing 1 or more bytes into a region of size 0 overflows the destination [-Wstringop-overflow=] 48 | #define memset(d, c, n) __builtin_memset(d, c, n) | ^~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/uaccess.h:153:17: note: in expansion of macro 'memset' 153 | memset(to + (n - res), 0, res); | ^~~~~~ In function 'kmalloc', inlined from 'kzalloc' at include/linux/slab.h:694:9, inlined from 'ioctl_standard_iw_point' at net/wireless/wext-core.c:819:10: include/linux/slab.h:577:16: note: at offset 1 into destination object of size 0 allocated by '__kmalloc' 577 | return __kmalloc(size, flags); | ^~~~~~~~~~~~~~~~~~~~~~ This help with the ongoing efforts to globally enable -Wstringop-overflow. Link: https://github.com/KSPP/linux/issues/315 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/ZItSlzvIpjdjNfd8@work Signed-off-by: Johannes Berg commit dd5ff2aa84170d3b55874385ca54ee5715b56cbb Author: Gregory Greenman Date: Thu Jun 15 09:47:20 2023 +0300 wifi: iwlwifi: bump FW API to 81 for AX devices Start supporting API version 81 for AX devices. Signed-off-by: Gregory Greenman Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230615094410.e61fdc474d89.I3d9823231fa7fc47158b8aa3561b43822c8c86cd@changeid Signed-off-by: Johannes Berg commit e98b23d0d7b85e883216e44b12b2a8fe9a8264ff Author: Ilan Peer Date: Thu Jun 15 09:47:19 2023 +0300 wifi: iwlwifi: mvm: Add support for SCAN API version 16 Scan API version 16 use link ID for reporting the TSF of scan results (instead of MAC ID used in previous versions). Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230615094410.05bf3e612297.Ie3075f7068af38c335d26778ab7d0ec4b1c026c3@changeid Signed-off-by: Johannes Berg commit 98d8a00327b2b651f2a00d6d16c6df886fdbf101 Author: Ilan Peer Date: Thu Jun 15 09:47:18 2023 +0300 wifi: iwlwifi: mvm: Don't access vif valid links directly And instead use the vif getter functions, as a preparation for supporting disabled/dormant links. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230615094410.61ca688cbbf1.Ic1b4049cf156238ff16e6c57959004da911cb5c8@changeid Signed-off-by: Johannes Berg commit 12bacfc2c065319d87a0580cd65375cea8204aba Author: Miri Korenblit Date: Thu Jun 15 09:47:17 2023 +0300 wifi: iwlwifi: handle eSR transitions There several transitions to handle in eSR mode: * SMPS should be disabled when in eSR mode * indicate to the fw whether the new added link should use the listen lmac or the main lmac * RLC is offloaded when in eSR mode; adjust RLC command accordingly Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230615094410.fb6409f44aca.I502460dec15e0b76035ad3cd809afa4ac16e9fe1@changeid Signed-off-by: Johannes Berg commit 823a970831c73ca2910da1f5c827c9ce4efa0c02 Author: Miri Korenblit Date: Thu Jun 15 09:47:16 2023 +0300 wifi: iwlwifi: fix max number of fw active links The max active links that are supported by the FW is hard coded. This is wrong since this value is HW-dependent. Fix this by determining according to the actual HW. Also remove a redundant check that the number of active links doesn't exceeds the maximum. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230615094410.e78ad74c6715.I68b26911c0a312d72eaf25344b448d03b1c61f4e@changeid Signed-off-by: Johannes Berg commit 6e21e7b8cd897193cee3c2649640efceb3004ba5 Author: Nicolas Cavallari Date: Wed Jun 14 15:26:48 2023 +0200 wifi: mac80211: Remove "Missing iftype sband data/EHT cap" spam In mesh mode, ieee80211_chandef_he_6ghz_oper() is called by mesh_matches_local() for every received mesh beacon. On a 6 GHz mesh of a HE-only phy, this spams that the hardware does not have EHT capabilities, even if the received mesh beacon does not have an EHT element. Unlike HE, not supporting EHT in the 6 GHz band is not an error so do not print anything in this case. Fixes: 5dca295dd767 ("mac80211: Add initial support for EHT and 320 MHz channels") Signed-off-by: Nicolas Cavallari Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230614132648.28995-1-nicolas.cavallari@green-communications.fr Signed-off-by: Johannes Berg commit efbe8f81952fe469d38655744627d860879dcde8 Author: Anjaneyulu Date: Wed Jun 14 12:41:37 2023 +0300 wifi: iwlwifi: add a few rate index validity checks Validate index before access iwl_rate_mcs to keep rate->index inside the valid boundaries. Use MCS_0_INDEX if index is less than MCS_0_INDEX and MCS_9_INDEX if index is greater then MCS_9_INDEX. Signed-off-by: Anjaneyulu Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123447.79f16b3aef32.If1137f894775d6d07b78cbf3a6163ffce6399507@changeid Signed-off-by: Johannes Berg commit 2e0ce1de206f8ad27bf07d08238f14c1c2c9ebe8 Author: Anjaneyulu Date: Wed Jun 14 12:41:36 2023 +0300 wifi: iwlwifi: Validate slots_num before allocating memory Verify slots_num is valid in iwl_txq_alloc() Signed-off-by: Anjaneyulu Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123447.90be48017c1b.I880e451e137c5cd688d5f38b573b0dbf352762b3@changeid Signed-off-by: Johannes Berg commit aedb2b38adf4d9f4f30ebd8b507051498ad4a1f2 Author: Anjaneyulu Date: Wed Jun 14 12:41:35 2023 +0300 wifi: iwlwifi: mvm: Validate tid is in valid range before using it Validate tid is less then MAX TID when it is used to access corresponding arrays. Signed-off-by: Anjaneyulu Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123447.cea75e1f57e7.I03bc0a81d2c1bdbf4784c12c4c62b8538892ccba@changeid Signed-off-by: Johannes Berg commit 4670d8dca8af0824b82010b7ad478fd505572006 Author: Johannes Berg Date: Wed Jun 14 12:41:34 2023 +0300 wifi: iwlwifi: mvm: track u-APSD misbehaving AP by AP address If the AP is an AP MLD, then we shouldn't track just the BSSID but the MLD address. Just generally use ap_addr since it has the BSSID in the non-MLD case. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123447.b6a4f7edd10c.Ie5a8029ed686b9441620ba06596d430432f65559@changeid Signed-off-by: Johannes Berg commit c4c954547755927807aaca981025847821dd2d0c Author: Johannes Berg Date: Wed Jun 14 12:41:33 2023 +0300 wifi: iwlwifi: implement WPFC ACPI table loading We skipped this in the past, but now we will need it for some platforms. Implement loading the PHY filter configuration IDs from the WPFC ACPI table. Note that the firmware must also be aware of the right filter configuration IDs (they're just the IDs of a filter configuration, not the actual configuration). Remove the useless hardcoded zeroes while at it. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123447.035026ea3169.I3a1fc1fe644fefa0d818ee1926c5fc331d68e8a3@changeid Signed-off-by: Johannes Berg commit 1902f1953b8ba100ee8705cb8a6f1a9795550eca Author: Anjaneyulu Date: Wed Jun 14 12:41:32 2023 +0300 wifi: iwlwifi: pcie: fix NULL pointer dereference in iwl_pcie_irq_rx_msix_handler() rxq can be NULL only when trans_pcie->rxq is NULL and entry->entry is zero. For the case when entry->entry is not equal to 0, rxq won't be NULL even if trans_pcie->rxq is NULL. Modify checker to check for trans_pcie->rxq. Fixes: abc599efa67b ("iwlwifi: pcie: don't crash when rx queues aren't allocated in interrupt") Signed-off-by: Anjaneyulu Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.5a5eb3889a4a.I375a1d58f16b48cd2044e7b7caddae512d7c86fd@changeid Signed-off-by: Johannes Berg commit 568db7fd27fad183d186742dc7ae6ca211ba51ff Author: Johannes Berg Date: Wed Jun 14 12:41:31 2023 +0300 wifi: iwlwifi: add some FW misbehaviour check infrastructure When the firmware misbehaves (according to the driver), we often either ignore that, or WARN_ON, which is very noisy but doesn't really help. Add a little helper macro IWL_FW_CHECK() that can be used in place of WARN_ON() in conditions, and make it take a message that's printed in this case. We can also add more behaviour to this in the future. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.2e12ac670cea.Ia0198036b7a626876d836bd41a4b2d2b1e65c5ca@changeid Signed-off-by: Johannes Berg commit ed0c34333dfb2e4a6bd9e25613040aaf9d48fb9d Author: Johannes Berg Date: Wed Jun 14 12:41:30 2023 +0300 wifi: iwlwifi: mvm: always send spec link ID in link commands The firmware technically only needs this when the link is newly added, but it's much easier for debugging if it's always available, so include it. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.daecd0e626f7.I0f8a16a6d80a283c9f947c9bb0fc50a7c6853948@changeid Signed-off-by: Johannes Berg commit 77e1f3f369e5f89235d539059bf6c7fa1645f350 Author: Johannes Berg Date: Wed Jun 14 12:41:29 2023 +0300 wifi: iwlwifi: use array as array argument When calling iwl_mvm_set_fw_qos_params() we explicitly pass a pointer to the first array element, but the function will treat it as an array. Simplify and clarify the code and pass the array instead. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.6fb4a9743b1b.I801007d207f6539a9e0996366ec593e2038b1f90@changeid Signed-off-by: Johannes Berg commit 33acbe6aa459feb8c765944e2e78a7b0338108e2 Author: Johannes Berg Date: Wed Jun 14 12:41:28 2023 +0300 wifi: iwlwifi: mvm: store WMM params per link We have the data structure set up to store the parameters per link, but weren't using them. Fix that and store them in the right link. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.332c4949a1be.Icae03975d578b0cc82279911a1ea7cbc313046d6@changeid Signed-off-by: Johannes Berg commit df6791e74fe7baafe3c9ec1eabfd45a5b0b62595 Author: Johannes Berg Date: Wed Jun 14 12:41:26 2023 +0300 wifi: iwlwifi: mvm: check link during TX Again, during some (botched) FW restart scenarios we can end up with a NULL link in the driver but mac80211 thinking all is still going OK. If we try to TX at the same time, we can crash there. Fix that by checking for a NULL link during TX. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.cee48479deec.I4eef58f7b67afafb7b3294adbeb6e0067b68419d@changeid Signed-off-by: Johannes Berg commit 38e721009d302f39ad5c744560a3f96ecbae6bfc Author: Johannes Berg Date: Wed Jun 14 12:41:25 2023 +0300 wifi: iwlwifi: mvm: add a NULL pointer check We've observed that in some botched firmware restart scenarios when the firmware crashes again while we're reconfiguring, we can hit NULL pointer crashes here. The underlying issue is the botched restart which we need to fix separately, but until we can do that, don't crash hard here. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.e47b0192c78f.I67fa9f07cd1c8b3bdc8db25f5e31c1c680c49745@changeid Signed-off-by: Johannes Berg commit c53c339d9a337732193c3b783f7bd80539fea259 Author: Ariel Malamud Date: Wed Jun 14 12:41:24 2023 +0300 wifi: iwlwifi: fw: Add new FSEQ defines to fw dump On fw error dump, dmesg prints FSEQ register data. Add 4 additional prints in order to match those being dumped by Windows driver. Allows fw infra to correctly detect version mismatch. Signed-off-by: Ariel Malamud Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.f40dc9c810a8.I26227900d0b7e9a71fefe5cbf57cf6b46ee44413@changeid Signed-off-by: Johannes Berg commit c2a1c8c10f18e9416013db3dbfa67808d7ab03d8 Author: Johannes Berg Date: Wed Jun 14 12:41:23 2023 +0300 wifi: iwlwifi: pcie: double-check ACK interrupt after timeout There are evidently cases where the firmware completes the reset but the interrupt isn't received correctly, so check for the interrupt again after the timeout, and don't dump the firmware error log if the right bit is set. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.00cc2d9b88c3.I429bfe800f17c624e50c0b0c10dd2cd7d885f199@changeid Signed-off-by: Johannes Berg commit 96fb6f47db24a712d650b0a9b9074873f273fb0e Author: Johannes Berg Date: Wed Jun 14 12:41:22 2023 +0300 wifi: iwlwifi: pull from TXQs with softirqs disabled In mac80211, it's required that we pull from TXQs by calling ieee80211_tx_dequeue() only with softirqs disabled. However, in iwl_mvm_queue_state_change() we're often called with them enabled, e.g. from flush if anything was flushed, triggering a mac80211 warning. Fix that by disabling the softirqs across the TX call. Fixes: cfbc6c4c5b91 ("iwlwifi: mvm: support mac80211 TXQs model") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.0feef7fa81db.I4dd62542d955b40dd8f0af34fa4accb9d0d17c7e@changeid Signed-off-by: Johannes Berg commit c4fbf6537ab0204904c43eac8eb877aaadd93e2c Author: Johannes Berg Date: Wed Jun 14 12:41:21 2023 +0300 wifi: iwlwifi: mvm: use iwl_mvm_is_vendor_in_approved_list() We have this helper now instead of open-coding the check for the dmi_tas_approved_list, so use it even here. It was added for debugfs use, but it's better to be consistent. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.f3741f5cdef4.I5e0bf522189dc595ee38d05e93994211d32ec0f4@changeid Signed-off-by: Johannes Berg commit 09396a4f68f08fc1b31f7cf9a1e429fbdbde3c46 Author: Johannes Berg Date: Wed Jun 14 12:41:20 2023 +0300 wifi: iwlwifi: fw: make some ACPI functions static iwl_acpi_get_wifi_pkg_range(), iwl_acpi_get_wifi_pkg() and iwl_acpi_get_object() need not be exported etc., they're used only within the same file. Make them static. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.e866032e4106.Ifede7f7c25b17a8215b154ce01da513b75384325@changeid Signed-off-by: Johannes Berg commit 84969e0fc801fe72fe9f5d523b0e897ff640c583 Author: Ilan Peer Date: Wed Jun 14 12:41:19 2023 +0300 wifi: iwlwifi: Correctly indicate support for VHT TX STBC If HT STBC is not supported, do not indicate support for VHT TX STBC. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.b24b5fba6fab.I116617875eb4a9d520df23a8c49a6594f9d8b2c6@changeid Signed-off-by: Johannes Berg commit f912959875761084fda351e1257dcfa9d1fa3037 Author: Johannes Berg Date: Wed Jun 14 12:41:18 2023 +0300 wifi: iwlwifi: mvm: correctly access HE/EHT sband capa We can't just dereference the sband->iftype_data pointer, that's an array so we need to access the right entry. Use the previously introduced helper functions to do that. There are also cases, e.g. when loading with disable_11ax=1, where the pointer might be NULL but we still attempt to use it, causing a crash. Fixes: 529281bdf0fc ("iwlwifi: mvm: limit TLC according to our HE capabilities") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614123446.a1f2b17ee39b.I8808120be744be8804815ce9e3e24ce6d2b424e3@changeid Signed-off-by: Johannes Berg commit 7dd50fd5478056929a012c6bf8b3c6f87c7e9e87 Author: Mukesh Sisodiya Date: Wed Jun 14 15:50:08 2023 +0300 wifi: iwlwifi: mvm: Add NULL check before dereferencing the pointer While vif pointers are protected by the corresponding "*active" fields, static checkers can get confused sometimes. Add an explicit check. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614154951.78749ae91fb5.Id3c05d13eeee6638f0930f750e93fb928d5c9dee@changeid Signed-off-by: Johannes Berg commit edcda51d99a7ae67d1cb4019b2d33d8d5defc6fe Author: Johannes Berg Date: Wed Jun 14 14:59:05 2023 +0300 wifi: iwlwifi: mvm: remove new checksum code The hardware isn't going to get fixed, so this mode cannot work in the foreseeable future. Remove it. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230614145722.ddbc16c4affe.Ia6921e4b8a9624d4f57489ac775105ed0e400313@changeid [restore original subject] Signed-off-by: Johannes Berg commit a8df1f580ff24d2d00bf7839551697a0235d16dc Author: Ilan Peer Date: Sun Jun 11 12:14:26 2023 +0300 wifi: mac80211: Add debugfs entry to report dormant links Add debugfs entry to report dormant (valid but disabled) links. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230611121219.7fa5f022adfb.Iff6fa3e1a3b00ae726612f9d5a31f7fe2fcbfc68@changeid Signed-off-by: Johannes Berg commit 6d543b34dbcf6ec30064ae62a88faf60dbff4f8a Author: Ilan Peer Date: Thu Jun 8 16:36:11 2023 +0300 wifi: mac80211: Support disabled links during association When the association is complete, do not configure disabled links, and track them as part of the interface data. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230608163202.c194fabeb81a.Iaefdef5ba0492afe9a5ede14c68060a4af36e444@changeid Signed-off-by: Johannes Berg commit d5a17cfb9875a873474985f630b5061a4f2142b2 Merge: 707a13c7e4887 f1a0898b5d6a7 Author: Johannes Berg Date: Mon Jun 19 12:03:51 2023 +0200 Merge wireless into wireless-next There are some locking changes that will later otherwise cause conflicts, so merge wireless into wireless-next to avoid those. Signed-off-by: Johannes Berg commit dea0f4146f66a242450b29fae4d643bd5318c511 Author: Will Deacon Date: Mon Jun 19 11:02:18 2023 +0100 docs: perf: Fix warning from 'make htmldocs' in hisi-pmu.rst Building the 'htmldocs' target results in the following warning when processing 'hisi-pmu.rst': | Documentation/admin-guide/perf/hisi-pmu.rst:107: ERROR: Unexpected indentation. Fix the warning by converting all of the register bitfield lists into proper bulleted lists and adjusting the indentation of the wrapping line accordingly. At the same time, use an enumerated list to describe the new PMUv2 functions. Fixes: ea8d1c062a0e ("docs: perf: Add new description for HiSilicon UC PMU") Reported-by: Stephen Rothwell Signed-off-by: Will Deacon commit 185891f03f712639c082e08fc9986ff214b5d617 Author: Nathan Chancellor Date: Fri Jun 16 09:41:30 2023 -0700 coresight: dummy: Update type of mode parameter in dummy_{sink,source}_enable() Clang's kernel Control Flow Integrity (kCFI) is a compiler-based security mitigation that ensures the target of an indirect function call matches the expected type of the call and trapping if they do not match exactly. The warning -Wincompatible-function-pointer-types-strict aims to catch these issues at compile time, which reveals: drivers/hwtracing/coresight/coresight-dummy.c:53:12: error: incompatible function pointer types initializing 'int (*)(struct coresight_device *, struct perf_event *, enum cs_mode)' with an expression of type 'int (struct coresight_device *, struct perf_event *, u32)' (aka 'int (struct coresight_device *, struct perf_event *, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict] 53 | .enable = dummy_source_enable, | ^~~~~~~~~~~~~~~~~~~ drivers/hwtracing/coresight/coresight-dummy.c:62:12: error: incompatible function pointer types initializing 'int (*)(struct coresight_device *, enum cs_mode, void *)' with an expression of type 'int (struct coresight_device *, u32, void *)' (aka 'int (struct coresight_device *, unsigned int, void *)') [-Werror,-Wincompatible-function-pointer-types-strict] 62 | .enable = dummy_sink_enable, | ^~~~~~~~~~~~~~~~~ 2 errors generated. Commit 9fa3682869d4 ("coresight: Use enum type for cs_mode wherever possible") updated the type of the mode parameter in the prototype but this driver was not introduced until commit 9d3ba0b6c056 ("Coresight: Add coresight dummy driver") and 'int' is ABI compatible with 'enum cs_mode', so there is no warning from regular -Wincompatible-function-pointer-types. Adjust the type of the mode parameter in the callback implementations in the coresight dummy driver to match the prototype, clearing up the warning and avoiding kCFI failures at runtime. Fixes: 9d3ba0b6c056 ("Coresight: Add coresight dummy driver") Signed-off-by: Nathan Chancellor Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230616-coresight-dummy-fix-kcfi-warnings-v1-1-c55c64f8f0f5@kernel.org commit 3bbc3c72c4b8982ecb719df6685dc7067def0904 Author: Richard Zhu Date: Thu Dec 8 14:05:34 2022 +0800 PCI: imx6: Save and restore root port MSI control in suspend and resume The imx6 PCI host controller suffers from a HW integration bug whereby the MSI enable bit in the root port MSI capability enables/disables MSIs interrupts for all downstream components in the PCI tree. This requires, as implemented in 75cb8d20c112 ("PCI: imx: Enable MSI from downstream components") that the root port MSI enable bit should be set in order for downstream PCI devices MSIs to function. The MSI enable bit programming might be lost during the suspend and should be re-stored during resume. Save the MSI control during suspend and restore it in resume. Link: https://lore.kernel.org/r/1670479534-22154-1-git-send-email-hongxing.zhu@nxp.com Signed-off-by: Richard Zhu [lpieralisi@kernel.org: commit log] Signed-off-by: Lorenzo Pieralisi commit 0bb4644d583789c97e74d3e3047189f0c59c4742 Author: Alexey Romanov Date: Sat Jun 10 12:04:14 2023 +0300 drivers: meson: secure-pwrc: always enable DMA domain Starting from commit e45f243409db ("firmware: meson_sm: populate platform devices from sm device tree data") pwrc is probed successfully and disables unused pwr domains. By A1 SoC family design, any TEE requires DMA pwr domain always enabled. Fixes: b3dde5013e13 ("soc: amlogic: Add support for Secure power domains controller") Signed-off-by: Alexey Romanov Acked-by: Neil Armstrong Link: https://lore.kernel.org/r/20230610090414.90529-1-avromanov@sberdevices.ru [narmstrong: added fixes tag] Signed-off-by: Neil Armstrong commit d18b2a0f1a78871104695ba9d3b03274bf8e07a1 Author: Arnd Bergmann Date: Fri Jun 16 18:15:55 2023 +0200 pinctrl: tegra: avoid duplicate field initializers The drv_reg field is initialized both in the DRV_PINGROUP_ENTRY_N/DRV_PINGROUP_ENTRY_Y macros and in DRV_PINGROUP_Y. Since each pingroup expands both macros, the are always duplicate and turning on -Woverride-init (which is disabled by default) causes a huge amount of warnings like: drivers/pinctrl/tegra/pinctrl-tegra234.c:1384:27: error: initialized field overwritten [-Werror=override-init] 1384 | #define DRV_PINGROUP_Y(r) ((r)) | ^ drivers/pinctrl/tegra/pinctrl-tegra234.c:1397:28: note: in expansion of macro 'DRV_PINGROUP_Y' 1397 | .drv_reg = DRV_PINGROUP_Y(r), \ | ^~~~~~~~~~~~~~ drivers/pinctrl/tegra/pinctrl-tegra234.c:1447:49: note: in expansion of macro 'DRV_PINGROUP_ENTRY_Y' 1447 | #define drive_soc_gpio08_pb0 DRV_PINGROUP_ENTRY_Y(0x500c, 12, 5, 20, 5, -1, -1, -1, -1, 0) | ^~~~~~~~~~~~~~~~~~~~ ... Remove the intialization that is never used here. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230616161603.1127687-1-arnd@kernel.org Signed-off-by: Linus Walleij commit d3a0d116f8704a4dc3b1798483adaca74952afd7 Author: Krzysztof Kozlowski Date: Sat Jun 17 13:18:09 2023 +0200 dt-bindings: pinctrl: qcom,sdx65-tlmm: add pcie_clkreq function DTS and driver already support pcie_clkreq function for a pin. Add it to fix dtbs_check warning: qcom-sdx65-mtp.dtb: pinctrl@f100000: pcie-ep-clkreq-default-state: 'oneOf' conditional failed, one must be fixed: 'bias-disable', 'drive-strength', 'function', 'pins' do not match any of the regexes: '-pins$', 'pinctrl-[0-9]+' 'pcie_clkreq' is not one of ['blsp_uart1', 'blsp_spi1', ... 'gpio'] Signed-off-by: Krzysztof Kozlowski Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230617111809.129232-1-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 40ed50cc3d1f27522bc84724decbf117e9563f8e Author: Arnd Bergmann Date: Mon Jun 19 10:20:50 2023 +0200 pinctrl: mlxbf3: remove broken Kconfig 'select' The new pinctrl driver selects GPIO_MLXBF3, but that can not be enabled yet because the MELLANOX_PLATFORM symbol does not exist in the tree: WARNING: unmet direct dependencies detected for GPIO_MLXBF3 Depends on [n]: GPIOLIB [=y] && PCI [=n] && (MELLANOX_PLATFORM [=n] && ARM64 [=y] || COMPILE_TEST [=y]) Selected by [y]: - PINCTRL_MLXBF3 [=y] && PINCTRL [=y] && (MELLANOX_PLATFORM [=n] && ARM64 [=y] || COMPILE_TEST [=y]) As it turns out, the pinctlr driver still builds fine without this, so just remove the select statement. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230619082104.699331-1-arnd@kernel.org Signed-off-by: Linus Walleij commit 85e18ed32e2602c6985c85eec9da717b8daaf6b0 Author: Arnd Bergmann Date: Fri Jun 2 19:28:59 2023 +0100 ARM: 9315/1: fiq: include asm/mach/irq.h for prototypes There are two global functions in fiq.c that get called from other files through an extern declaration, but a W=1 build warns about the header not being included before the definition: arch/arm/kernel/fiq.c:85:5: error: no previous prototype for 'show_fiq_list' [-Werror=missing-prototypes] arch/arm/kernel/fiq.c:159:13: error: no previous prototype for 'init_FIQ' [-Werror=missing-prototypes] Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit aecc83e5064b397f125585ba703ac74a695c2d73 Author: Arnd Bergmann Date: Fri Jun 2 19:28:43 2023 +0100 ARM: 9314/1: tcm: move tcm_init() prototype to asm/tcm.h The function definition is in a file that does not include the header with the declaration: arch/arm/kernel/tcm.c:256:13: error: no previous prototype for 'tcm_init' Move the declaration to a global header where it can actually be included. Fixes: de40614e92bf ("ARM: 7694/1: ARM, TCM: initialize TCM in paging_init(), instead of setup_arch()") Reviewed-by: Linus Walleij Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit a12f8586afd6ee0af72c3ee93a4bccc065f37e0e Author: Arnd Bergmann Date: Fri Jun 2 19:28:41 2023 +0100 ARM: 9313/1: vdso: add missing prototypes The __vdso_clock_* functions have no prototype, and the __eabi_unwind_cpp_pr* functions have a prototype in a header that is not included before the definition: arch/arm/vdso/vgettimeofday.c:10:5: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes] arch/arm/vdso/vgettimeofday.c:16:5: error: no previous prototype for '__vdso_clock_gettime64' [-Werror=missing-prototypes] arch/arm/vdso/vgettimeofday.c:22:5: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes] arch/arm/vdso/vgettimeofday.c:28:5: error: no previous prototype for '__vdso_clock_getres' [-Werror=missing-prototypes] arch/arm/vdso/vgettimeofday.c:36:6: error: no previous prototype for '__aeabi_unwind_cpp_pr0' [-Werror=missing-prototypes] arch/arm/vdso/vgettimeofday.c:40:6: error: no previous prototype for '__aeabi_unwind_cpp_pr1' [-Werror=missing-prototypes] arch/arm/vdso/vgettimeofday.c:44:6: error: no previous prototype for '__aeabi_unwind_cpp_pr2' [-Werror=missing-prototypes] Add the prototypes in an appropriate header and ensure that both are included here. Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 2332c61592396f37ea1f7dcb6869e5a4905c6136 Author: Arnd Bergmann Date: Fri Jun 2 19:28:40 2023 +0100 ARM: 9312/1: vfp: include asm/neon.h in vfpmodule.c Two functions defined here need the declaration in a header to avoid W=1 warnings: arch/arm/vfp/vfpmodule.c:735:6: error: no previous prototype for 'kernel_neon_begin' [-Werror=missing-prototypes] arch/arm/vfp/vfpmodule.c:768:6: error: no previous prototype for 'kernel_neon_end' [-Werror=missing-prototypes] Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 9d1f3aa63c65f8fefe050d91b3f599e8e320eeb0 Author: Arnd Bergmann Date: Fri Jun 2 19:29:01 2023 +0100 ARM: 9311/1: decompressor: move function prototypes to misc.h A number of prototypes are missing for the decompressor, some of them are in the .c files that contain the callers, but are invisible at the function definition: arch/arm/boot/compressed/misc.c:129:17: error: no previous prototype for '__div0' [-Werror=missing-prototypes] arch/arm/boot/compressed/misc.c:138:1: error: no previous prototype for 'decompress_kernel' [-Werror=missing-prototypes] arch/arm/boot/compressed/misc.c:163:6: error: no previous prototype for 'fortify_panic' [-Werror=missing-prototypes] arch/arm/boot/compressed/decompress.c:63:5: error: no previous prototype for 'do_decompress' [-Werror=missing-prototypes] arch/arm/boot/compressed/fdt_check_mem_start.c:63:10: error: no previous prototype for 'fdt_check_mem_start' [-Werror=missing-prototypes] Move these all to misc.h so they are visible by the callee as well. Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit c9a1d4f672173b1d0235c5c11b9fb9b030381219 Author: Arnd Bergmann Date: Fri Jun 2 19:29:02 2023 +0100 ARM: 9310/1: xip-kernel: add __inflate_kernel_data prototype The kernel .data decompression is called from assembler, so it does not need a prototype, but adding one avoids this W=1 warning: arch/arm/kernel/head-inflate-data.c:35:12: error: no previous prototype for '__inflate_kernel_data' [-Werror=missing-prototypes] The same file contains a few extern declarations for assembler symbols, move those into the header as well for consistency. Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit be0796b07ba845f40ab90bc3fead01f757a6d98a Author: Arnd Bergmann Date: Fri Jun 2 19:29:00 2023 +0100 ARM: 9309/1: add missing syscall prototypes All architecture-independent system calls have prototypes in include/linux/syscalls.h, but there are a few that only exist on arm or that take the pt_regs directly. These cause a W=1 warning such as: arch/arm/kernel/signal.c:186:16: error: no previous prototype for 'sys_sigreturn' [-Werror=missing-prototypes] arch/arm/kernel/signal.c:216:16: error: no previous prototype for 'sys_rt_sigreturn' [-Werror=missing-prototypes] arch/arm/kernel/sys_arm.c:32:17: error: no previous prototype for 'sys_arm_fadvise64_64' [-Werror=missing-prototypes] Add prototypes for all custom syscalls on arm and add them to asm/syscalls.h. Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit ad1cfe62b818f5995c047c54248ff98c3623e1f8 Author: Arnd Bergmann Date: Fri Jun 2 19:28:58 2023 +0100 ARM: 9308/1: move setup functions to header A couple of functions are declared in arch/arm/mm/mmu.c rather than in a header, which causes W=1 build warnings: arch/arm/mm/init.c:97:13: error: no previous prototype for 'setup_dma_zone' [-Werror=missing-prototypes] arch/arm/mm/mmu.c:118:13: error: no previous prototype for 'init_default_cache_policy' [-Werror=missing-prototypes] arch/arm/mm/mmu.c:1195:13: error: no previous prototype for 'adjust_lowmem_bounds' [-Werror=missing-prototypes] arch/arm/mm/mmu.c:1761:13: error: no previous prototype for 'paging_init' [-Werror=missing-prototypes] arch/arm/mm/mmu.c:1794:13: error: no previous prototype for 'early_mm_init' [-Werror=missing-prototypes] Move the declaratsion to asm/setup.h so they can be seen by the compiler while building the definition. Reviewed-by: Linus Walleij Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 3665f85e1c9a6a1133a9b0b173d8cd42874290f1 Author: Arnd Bergmann Date: Fri Jun 2 19:28:57 2023 +0100 ARM: 9307/1: nommu: include asm/idmap.h setup_mm_for_reboot() is declared in asm/idmap.h but that is not included for the definition, causing a W=1 warning: arch/arm/mm/nommu.c:178:6: error: no previous prototype for 'setup_mm_for_reboot' [-Werror=missing-prototypes] Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 57ea76fd1ca072b3024f55cb461628d982acf873 Author: Arnd Bergmann Date: Fri Jun 2 19:28:46 2023 +0100 ARM: 9306/1: cacheflush: avoid __flush_anon_page() missing-prototype warning The prototype for __flush_anon_page() is intentionally hidden inside the flush_anon_page() inline function to prevent it from being called from drivers. When building with 'W=1', this causes a warning: arch/arm/mm/flush.c:358:6: error: no previous prototype for '__flush_anon_page' [-Werror=missing-prototypes] Work around this by adding a prototype directly next to the function definition. Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 34bde7f271c4b885d0fdaf49509fcea711ac0bd9 Author: Arnd Bergmann Date: Fri Jun 2 19:28:45 2023 +0100 ARM: 9305/1: add clear/copy_user_highpage declarations The CPU specific helpers have to be global functions when building a kernel for just one CPU, but are called through indirect function pointers in a multi-CPU kernel. This config currently lacks the declarations for the individual helpers, e.g.: arch/arm/mm/copypage-v4wb.c:47:6: error: no previous prototype for 'v4wb_copy_user_highpage' [-Werror=missing-prototypes] arch/arm/mm/copypage-v4wb.c:65:6: error: no previous prototype for 'v4wb_clear_user_highpage' [-Werror=missing-prototypes] Add the complete set of prototypes in asm/page.h to allow building iwth -Wmissing-prototypes. Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit ae1f8d793a19a63263d6a30a311a2db4e86d8785 Author: Arnd Bergmann Date: Fri Jun 2 19:28:44 2023 +0100 ARM: 9304/1: add prototype for function called only from asm When building with 'make W=1', the compiler warns about any function definition that does not come with a prototype in a header, to ensure it matches what the caller expects. This includes functions that are only ever caller from assembly code and don't technically need a declaration: arch/arm/kernel/ftrace.c:227:6: error: no previous prototype for 'prepare_ftrace_return' arch/arm/kernel/ptrace.c:850:16: error: no previous prototype for 'syscall_trace_enter' arch/arm/kernel/ptrace.c:878:17: error: no previous prototype for 'syscall_trace_exit' arch/arm/kernel/signal.c:601:1: error: no previous prototype for 'do_work_pending' arch/arm/kernel/signal.c:672:17: error: no previous prototype for 'do_rseq_syscall' arch/arm/kernel/suspend.c:75:6: error: no previous prototype for '__cpu_suspend_save' arch/arm/kernel/traps.c:451:17: error: no previous prototype for 'do_undefinstr' arch/arm/kernel/traps.c:516:39: error: no previous prototype for 'handle_fiq_as_nmi' arch/arm/kernel/traps.c:535:17: error: no previous prototype for 'bad_mode' arch/arm/kernel/traps.c:608:16: error: no previous prototype for 'arm_syscall' arch/arm/kernel/traps.c:734:1: error: no previous prototype for 'baddataabort' arch/arm/kernel/traps.c:774:17: error: no previous prototype for '__div0' arch/arm/kernel/traps.c:97:6: error: no previous prototype for 'dump_backtrace_stm' arch/arm/kernel/unwind.c:40:6: error: no previous prototype for '__aeabi_unwind_cpp_pr0' arch/arm/kernel/unwind.c:45:6: error: no previous prototype for '__aeabi_unwind_cpp_pr1' arch/arm/kernel/unwind.c:50:6: error: no previous prototype for '__aeabi_unwind_cpp_pr2' arch/arm/mm/fault.c:554:1: error: no previous prototype for 'do_DataAbort' arch/arm/mm/fault.c:584:1: error: no previous prototype for 'do_PrefetchAbort' arch/arm/mm/proc-v7-bugs.c:280:6: error: no previous prototype for 'cpu_v7_ca8_ibe' arch/arm/mm/proc-v7-bugs.c:293:6: error: no previous prototype for 'cpu_v7_bugs_init' arch/arm/vdso/vgettimeofday.c:36:6: error: no previous prototype for '__aeabi_unwind_cpp_pr0' arch/arm/vdso/vgettimeofday.c:40:6: error: no previous prototype for '__aeabi_unwind_cpp_pr1' arch/arm/vdso/vgettimeofday.c:44:6: error: no previous prototype for '__aeabi_unwind_cpp_pr2' arch/arm/vfp/vfpmodule.c:323:6: error: no previous prototype for 'VFP_bounce' Add the prototypes anyway, to allow enabling this warning by default in the future. Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 1b9c3ddcec6a55e15d3e38e7405e2d078db02020 Author: Arnd Bergmann Date: Fri Jun 2 19:28:42 2023 +0100 ARM: 9303/1: kprobes: avoid missing-declaration warnings checker_stack_use_t32strd() and kprobe_handler() can be made static since they are not used from other files, while coverage_start_registers() and __kprobes_test_case() are used from assembler code, and just need a declaration to avoid a warning with the global definition. arch/arm/probes/kprobes/checkers-common.c:43:18: error: no previous prototype for 'checker_stack_use_t32strd' arch/arm/probes/kprobes/core.c:236:16: error: no previous prototype for 'kprobe_handler' arch/arm/probes/kprobes/test-core.c:723:10: error: no previous prototype for 'coverage_start_registers' arch/arm/probes/kprobes/test-core.c:918:14: error: no previous prototype for '__kprobes_test_case_start' arch/arm/probes/kprobes/test-core.c:952:14: error: no previous prototype for '__kprobes_test_case_end_16' arch/arm/probes/kprobes/test-core.c:967:14: error: no previous prototype for '__kprobes_test_case_end_32' Fixes: 6624cf651f1a ("ARM: kprobes: collects stack consumption for store instructions") Fixes: 454f3e132d05 ("ARM/kprobes: Remove jprobe arm implementation") Acked-by: Masami Hiramatsu (Google) Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 4b026ca3e2eeceec1b8cbc9d2a5e01f345e19322 Author: Arnd Bergmann Date: Fri Jun 2 19:28:39 2023 +0100 ARM: 9302/1: traps: hide unused functions on NOMMU A couple of functions in this file are only used on MMU-enabled builds, and never even declared otherwise, causing these build warnings: arch/arm/kernel/traps.c:759:6: error: no previous prototype for '__pte_error' [-Werror=missing-prototypes] arch/arm/kernel/traps.c:764:6: error: no previous prototype for '__pmd_error' [-Werror=missing-prototypes] arch/arm/kernel/traps.c:769:6: error: no previous prototype for '__pgd_error' [-Werror=missing-prototypes] Protect these in an #ifdef to avoid the warnings and save a little bit of .text space. Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit a9f8f2b2877ccb478e8e36607b00361cc5038eea Author: Arnd Bergmann Date: Fri Jun 2 19:26:55 2023 +0100 ARM: 9301/1: dma-mapping: hide unused dma_contiguous_early_fixup function The dma_contiguous_early_fixup() function is a global __weak stub with an arm specific override, but the declaration is in an #ifdef. If CONFIG_DMA_CMA is disabled, there is no caller and no prototype, which adds a warning for the definition: arm/mm/dma-mapping.c:261:13: error: no previous prototype for 'dma_contiguous_early_fixup' [-Werror=missing-prototypes] Enclose the definition in the same #ifdef as the prototype to avoid that and save a few bytes of .init.text. Reviewed-by: Kees Cook Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 7611b3358acbe9b95990ad63d66dd11efcac4594 Author: Azeem Shaikh Date: Thu Jun 1 09:34:26 2023 +0100 ARM: 9300/1: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 [ardb: submitting to the patch tracker on behalf of Azeem] Signed-off-by: Azeem Shaikh Reviewed-by: Linus Walleij Reviewed-by: Kees Cook Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit ddbb7ea96a609335837d0579b7e0cc5e6dbaabce Author: Masahiro Yamada Date: Tue May 30 19:03:08 2023 +0100 ARM: 9299/1: module: use sign_extend32() to extend the signedness The function name clarifies the intention. Signed-off-by: Masahiro Yamada Signed-off-by: Russell King (Oracle) commit 5bb578a0c1b86d6eb95f8d08ed6444b227fb674c Author: Linus Walleij Date: Tue May 9 13:57:28 2023 +0100 ARM: 9298/1: Drop custom mdesc->handle_irq() ARM exclusively uses GENERIC_IRQ_MULTI_HANDLER, so at some point set_handle_irq() needs to be called to handle system-wide interrupts. For all DT-enabled boards, this call happens down in the drivers/irqchip subsystem, after locating the target irqchip driver from the device tree. We still have a few instances of the boardfiles with machine descriptors passing a machine-specific .handle_irq() to the ARM kernel core. Get rid of this by letting the few remaining machines consistently call set_handle_irq() from the end of the .init_irq() callback instead and diet down one member from the machine descriptor. Cc: Marc Zyngier Reviewed-by: Arnd Bergmann Acked-by: Mark Rutland Signed-off-by: Linus Walleij Signed-off-by: Russell King (Oracle) commit cefa1aaa31bd7bb73a37c15ec66a9353753b2abc Author: Dan Carpenter Date: Thu Jun 15 09:09:20 2023 +0300 mtd: otp: clean up on error in mtd_otp_nvmem_add() Smatch complains that these error paths are missing cleanup: drivers/mtd/mtdcore.c:983 mtd_otp_nvmem_add() warn: missing unwind goto? This needs to call nvmem_unregister(mtd->otp_user_nvmem) before returning. Fixes: 3b270fac8443 ("mtd: otp: Put factory OTP/NVRAM into the entropy pool") Signed-off-by: Dan Carpenter Reviewed-by: Linus Walleij Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/fe7ef901-9571-4c6e-a40e-449046efe2c6@moroto.mountain commit a5e393c1e8760cd66b3f3860a8aede185733cd6d Author: Rob Herring Date: Tue Jun 13 14:10:14 2023 -0600 dt-bindings: mtd: partition: Add missing type for "linux,rootfs" "linux,rootfs" is missing a type, add it. Signed-off-by: Rob Herring Reviewed-by: Conor Dooley Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230613201014.2823185-1-robh@kernel.org commit 812a20df6048ba2945b1bda74c45143bbc3e4cda Author: Uwe Kleine-König Date: Sun Jun 11 22:43:27 2023 +0200 mtd: maps: pismo: Switch back to use i2c_driver's .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230611204327.828122-1-u.kleine-koenig@pengutronix.de commit e87161321a4081d36c4af95af7f0950137569dfe Author: Arseniy Krasnov Date: Thu Jun 15 12:40:06 2023 +0300 mtd: rawnand: macronix: OTP access for MX30LFxG18AC Support for OTP area access on MX30LFxG18AC chip series. Signed-off-by: Arseniy Krasnov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230615094015.3780078-1-AVKrasnov@sberdevices.ru commit 98480a181a08ceeede417e5b28f6d0429d8ae156 Author: Arseniy Krasnov Date: Thu Jun 15 11:08:15 2023 +0300 mtd: rawnand: meson: fix unaligned DMA buffers handling Meson NAND controller requires 8 bytes alignment for DMA addresses, otherwise it "aligns" passed address by itself thus accessing invalid location in the provided buffer. This patch makes unaligned buffers to be reallocated to become valid. Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") Cc: Signed-off-by: Arseniy Krasnov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230615080815.3291006-1-AVKrasnov@sberdevices.ru commit a6a8a1e16c14b5c93bec202ba2f1c8d7c9173571 Author: Johan Jonker Date: Tue Jun 13 23:21:06 2023 +0200 mtd: rawnand: add support for the Sandisk SDTNQGAMA chip Sandisk SDTNQGAMA is a 8GB size, 3.3V 8 bit chip with 16KB page size, 1KB write size and 40 bit ecc support Co-developed-by: Paweł Jarosz Signed-off-by: Paweł Jarosz Signed-off-by: Johan Jonker Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/98811c98-4681-6ddc-8287-bd9b77559c51@gmail.com commit 12ac188b9355618dbaa892eb795f48845cf7b1af Author: Johan Jonker Date: Tue Jun 13 23:19:58 2023 +0200 mtd: rawnand: add basic sandisk manufacturer ops Add basic Sandisk manufacturer ops support to get SDTNQGAMA timing data with the nand_get_sdr_timings() function. Signed-off-by: Johan Jonker Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/aaf4580a-a368-8f70-c9c4-21b5ed4dd599@gmail.com commit a7a334076dd725b8c3b5d64f68e3992ffcfd1d25 Merge: 45a3e24f65e90 5b00369fcf6d1 ac3c456382e8f 139a57a9918ed 7061b6af34686 b4da4e112ade4 5957c19305b10 78db2985c2f66 Author: Joerg Roedel Date: Mon Jun 19 10:12:42 2023 +0200 Merge branches 'iommu/fixes', 'arm/smmu', 'ppc/pamu', 'virtio', 'x86/vt-d', 'core' and 'x86/amd' into next commit b684c09f09e7a6af3794d4233ef785819e72db79 Author: Aditya Gupta Date: Thu Jun 15 14:40:47 2023 +0530 powerpc: update ppc_save_regs to save current r1 in pt_regs ppc_save_regs() skips one stack frame while saving the CPU register states. Instead of saving current R1, it pulls the previous stack frame pointer. When vmcores caused by direct panic call (such as `echo c > /proc/sysrq-trigger`), are debugged with gdb, gdb fails to show the backtrace correctly. On further analysis, it was found that it was because of mismatch between r1 and NIP. GDB uses NIP to get current function symbol and uses corresponding debug info of that function to unwind previous frames, but due to the mismatching r1 and NIP, the unwinding does not work, and it fails to unwind to the 2nd frame and hence does not show the backtrace. GDB backtrace with vmcore of kernel without this patch: --------- (gdb) bt #0 0xc0000000002a53e8 in crash_setup_regs (oldregs=, newregs=0xc000000004f8f8d8) at ./arch/powerpc/include/asm/kexec.h:69 #1 __crash_kexec (regs=) at kernel/kexec_core.c:974 #2 0x0000000000000063 in ?? () #3 0xc000000003579320 in ?? () --------- Further analysis revealed that the mismatch occurred because "ppc_save_regs" was saving the previous stack's SP instead of the current r1. This patch fixes this by storing current r1 in the saved pt_regs. GDB backtrace with vmcore of patched kernel: -------- (gdb) bt #0 0xc0000000002a53e8 in crash_setup_regs (oldregs=0x0, newregs=0xc00000000670b8d8) at ./arch/powerpc/include/asm/kexec.h:69 #1 __crash_kexec (regs=regs@entry=0x0) at kernel/kexec_core.c:974 #2 0xc000000000168918 in panic (fmt=fmt@entry=0xc000000001654a60 "sysrq triggered crash\n") at kernel/panic.c:358 #3 0xc000000000b735f8 in sysrq_handle_crash (key=) at drivers/tty/sysrq.c:155 #4 0xc000000000b742cc in __handle_sysrq (key=key@entry=99, check_mask=check_mask@entry=false) at drivers/tty/sysrq.c:602 #5 0xc000000000b7506c in write_sysrq_trigger (file=, buf=, count=2, ppos=) at drivers/tty/sysrq.c:1163 #6 0xc00000000069a7bc in pde_write (ppos=, count=, buf=, file=, pde=0xc00000000362cb40) at fs/proc/inode.c:340 #7 proc_reg_write (file=, buf=, count=, ppos=) at fs/proc/inode.c:352 #8 0xc0000000005b3bbc in vfs_write (file=file@entry=0xc000000006aa6b00, buf=buf@entry=0x61f498b4f60 , count=count@entry=2, pos=pos@entry=0xc00000000670bda0) at fs/read_write.c:582 #9 0xc0000000005b4264 in ksys_write (fd=, buf=0x61f498b4f60 , count=2) at fs/read_write.c:637 #10 0xc00000000002ea2c in system_call_exception (regs=0xc00000000670be80, r0=) at arch/powerpc/kernel/syscall.c:171 #11 0xc00000000000c270 in system_call_vectored_common () at arch/powerpc/kernel/interrupt_64.S:192 -------- Nick adds: So this now saves regs as though it was an interrupt taken in the caller, at the instruction after the call to ppc_save_regs, whereas previously the NIP was there, but R1 came from the caller's caller and that mismatch is what causes gdb's dwarf unwinder to go haywire. Signed-off-by: Aditya Gupta Fixes: d16a58f8854b1 ("powerpc: Improve ppc_save_regs()") Reivewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230615091047.90433-1-adityag@linux.ibm.com commit d24da1f85530a5b47590c0febd1395dd8fc73124 Author: Naveen N Rao Date: Fri Jun 9 09:15:01 2023 +0530 powerpc/ftrace: Disable ftrace on ppc32 if using clang Ftrace on ppc32 expects a three instruction sequence at the beginning of each function when specifying -pg: mflr r0 stw r0,4(r1) bl _mcount This is the case with all supported versions of gcc. Clang however emits a branch to _mcount after the function prologue, similar to the pre -mprofile-kernel ABI on ppc64. This is not supported. Disable ftrace on ppc32 if using clang for now. This can be re-enabled later if clang picks up support for -fpatchable-function-entry on ppc32. Signed-off-by: Naveen N Rao Acked-by: Nick Desaulniers Link: https://github.com/llvm/llvm-project/issues/63220 Signed-off-by: Michael Ellerman Link: https://msgid.link/20230609034501.407971-1-naveen@kernel.org commit f4f913c980bc6abe0ccfe88fe3909c125afe4a2d Author: Colin Ian King Date: Thu Jun 8 10:58:49 2023 +0100 powerpc/powernv/sriov: perform null check on iov before dereferencing iov Currently pointer iov is being dereferenced before the null check of iov which can lead to null pointer dereference errors. Fix this by moving the iov null check before the dereferencing. Detected using cppcheck static analysis: linux/arch/powerpc/platforms/powernv/pci-sriov.c:597:12: warning: Either the condition '!iov' is redundant or there is possible null pointer dereference: iov. [nullPointerRedundantCheck] num_vfs = iov->num_vfs; ^ Fixes: 052da31d45fc ("powerpc/powernv/sriov: De-indent setup and teardown") Signed-off-by: Colin Ian King Signed-off-by: Michael Ellerman Link: https://msgid.link/20230608095849.1147969-1-colin.i.king@gmail.com commit a16e472c3546ba0b8a4be265c008d02ef6aed899 Author: Benjamin Gray Date: Mon Jun 19 17:36:28 2023 +1000 selftests/powerpc/dexcr: Add DEXCR status utility lsdexcr Add a utility 'lsdexcr' to print the current DEXCR status. Useful for quickly checking the status such as when debugging test failures or verifying the new default DEXCR does what you want (for userspace at least). Example output: # ./lsdexcr uDEXCR: 04000000 (NPHIE) HDEXCR: 00000000 Effective: 04000000 (NPHIE) SBHE (0): clear (Speculative branch hint enable) IBRTPD (3): clear (Indirect branch recurrent target ...) SRAPD (4): clear (Subroutine return address ...) NPHIE * (5): set (Non-privileged hash instruction enable) PHIE (6): clear (Privileged hash instruction enable) DEXCR[NPHIE] enabled: hashst/hashchk working Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616034846.311705-12-bgray@linux.ibm.com commit bdb07f35a52f40c461c7da06ddcbaca1950fb9e0 Author: Benjamin Gray Date: Mon Jun 19 17:36:27 2023 +1000 selftests/powerpc/dexcr: Add hashst/hashchk test Test the kernel DEXCR[NPHIE] interface and hashchk exception handling. Introduces with it a DEXCR utils library for common DEXCR operations. Volatile is used to prevent the compiler optimising away the signal tests. Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616034846.311705-11-bgray@linux.ibm.com commit b9125c9aa043a7556626e1aafb3190c61c1e2b2b Author: Benjamin Gray Date: Mon Jun 19 17:36:27 2023 +1000 selftests/powerpc: Add more utility macros Adds _MSG assertion variants to provide more context behind why a failure occurred. Also include unistd.h for _exit() and stdio.h for fprintf(), and move ARRAY_SIZE macro to utils.h. The _MSG variants and ARRAY_SIZE will be used by the following DEXCR selftests. Signed-off-by: Benjamin Gray Reviewed-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616034846.311705-10-bgray@linux.ibm.com commit 65d6c884bfbd38235659e6df193345e5ad874043 Author: Benjamin Gray Date: Mon Jun 19 17:36:27 2023 +1000 Documentation: Document PowerPC kernel DEXCR interface Describe the DEXCR and document how to configure it. Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616034846.311705-9-bgray@linux.ibm.com commit 97228ca375c78bfd960767dcd4919c981add306f Author: Benjamin Gray Date: Mon Jun 19 17:36:26 2023 +1000 powerpc/ptrace: Expose HASHKEYR register to ptrace The HASHKEYR register contains a secret per-process key to enable unique hashes per process. In general it should not be exposed to userspace at all and a regular process has no need to know its key. However, checkpoint restore in userspace (CRIU) functionality requires that a process be able to set the HASHKEYR of another process, otherwise existing hashes on the stack would be invalidated by a new random key. Exposing HASHKEYR in this way also makes it appear in core dumps, which is a security concern. Multiple threads may share a key, for example just after a fork() call, where the kernel cannot know if the child is going to return back along the parent's stack. If such a thread is coerced into making a core dump, then the HASHKEYR value will be readable and able to be used against all other threads sharing that key, effectively undoing any protection offered by hashst/hashchk. Therefore we expose HASHKEYR to ptrace when CONFIG_CHECKPOINT_RESTORE is enabled, providing a choice of increased security or migratable ROP protected processes. This is similar to how ARM exposes its PAC keys. Signed-off-by: Benjamin Gray Reviewed-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616034846.311705-8-bgray@linux.ibm.com commit 884ad5c52da253e5d38f947cd8d1d9412a47429c Author: Benjamin Gray Date: Mon Jun 19 17:36:26 2023 +1000 powerpc/ptrace: Expose DEXCR and HDEXCR registers to ptrace The DEXCR register is of interest when ptracing processes. Currently it is static, but eventually will be dynamically controllable by a process. If a process can control its own, then it is useful for it to be ptrace-able to (e.g., for checkpoint-restore functionality). It is also relevant to core dumps (the NPHIE aspect in particular), which use the ptrace mechanism (or is it the other way around?) to decide what to dump. The HDEXCR is useful here too, as the NPHIE aspect may be set in the HDEXCR without being set in the DEXCR. Although the HDEXCR is per-cpu and we don't track it in the task struct (it's useless in normal operation), it would be difficult to imagine why a hypervisor would set it to different values within a guest. A hypervisor cannot safely set NPHIE differently at least, as that would break programs. Expose a read-only view of the userspace DEXCR and HDEXCR to ptrace. The HDEXCR is always readonly, and is useful for diagnosing the core dumps (as the HDEXCR may set NPHIE without the DEXCR setting it). Signed-off-by: Benjamin Gray Reviewed-by: Russell Currey [mpe: Use lower_32_bits() rather than open coding] Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616034846.311705-7-bgray@linux.ibm.com commit be98fcf7c10dea74e9c3e2cd0018e47bdee67442 Author: Benjamin Gray Date: Mon Jun 19 17:36:26 2023 +1000 powerpc/dexcr: Support userspace ROP protection The ISA 3.1B hashst and hashchk instructions use a per-cpu SPR HASHKEYR to hold a key used in the hash calculation. This key should be different for each process to make it harder for a malicious process to recreate valid hash values for a victim process. Add support for storing a per-thread hash key, and setting/clearing HASHKEYR appropriately. Signed-off-by: Benjamin Gray Reviewed-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616034846.311705-6-bgray@linux.ibm.com commit 5bcba4e6c13f0c889da1f9e67ee10accd9ca4c19 Author: Benjamin Gray Date: Mon Jun 19 17:36:25 2023 +1000 powerpc/dexcr: Handle hashchk exception Recognise and pass the appropriate signal to the user program when a hashchk instruction triggers. This is independent of allowing configuration of DEXCR[NPHIE], as a hypervisor can enforce this aspect regardless of the kernel. The signal mirrors how ARM reports their similar check failure. For example, their FPAC handler in arch/arm64/kernel/traps.c do_el0_fpac() does this. When we fail to read the instruction that caused the fault we send a segfault, similar to how emulate_math() does it. Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616034846.311705-5-bgray@linux.ibm.com commit 0ffd60b782ed79349baf28dd3259c872f39274e9 Author: Benjamin Gray Date: Mon Jun 19 17:36:25 2023 +1000 powerpc/dexcr: Add initial Dynamic Execution Control Register (DEXCR) support ISA 3.1B introduces the Dynamic Execution Control Register (DEXCR). It is a per-cpu register that allows control over various CPU behaviours including branch hint usage, indirect branch speculation, and hashst/hashchk support. Add some definitions and basic support for the DEXCR in the kernel. Right now it just * Initialises the DEXCR and HASHKEYR to a fixed value when a CPU onlines. * Clears them in reset_sprs(). * Detects when the NPHIE aspect is supported (the others don't get looked at in this series, so there's no need to waste a CPU_FTR on them). We initialise the HASHKEYR to ensure that all cores have the same key, so an HV enforced NPHIE + swapping cores doesn't randomly crash a process using hash instructions. The stores to HASHKEYR are unconditional because the ISA makes no mention of the SPR being missing if support for doing the hashes isn't present. So all that would happen is the HASHKEYR value gets ignored. This helps slightly if NPHIE detection fails; e.g., we currently only detect it on pseries. Signed-off-by: Benjamin Gray [mpe: Use simple values for DEXCR constants] Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616034846.311705-4-bgray@linux.ibm.com commit 81e30a5412e4bcdc9d338ffa0cf1f4b90bc63abc Author: Benjamin Gray Date: Mon Jun 19 17:36:25 2023 +1000 powerpc/ptrace: Add missing include ptrace-decl.h uses user_regset_get2_fn (among other things) from regset.h. While all current users of ptrace-decl.h include regset.h before it anyway, it adds an implicit ordering dependency and breaks source tooling that tries to inspect ptrace-decl.h by itself. Signed-off-by: Benjamin Gray Reviewed-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616034846.311705-3-bgray@linux.ibm.com commit 7eec97b32e0b62f54b7f6afb5df189806b1bb87b Author: Benjamin Gray Date: Mon Jun 19 17:36:24 2023 +1000 powerpc/book3s: Add missing include The functions here use struct task_struct fields, so need to import the full definition from . The header that defines current only forward declares struct task_struct. Failing to include this header leads to a compilation error when a translation unit does not also include indirectly. Signed-off-by: Benjamin Gray Reviewed-by: Nicholas Piggin Reviewed-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://msgid.link/20230616034846.311705-2-bgray@linux.ibm.com commit 2951580ba6adb082bb6b7154a5ecb24e7c1f7569 Author: Sebastian Andrzej Siewior Date: Tue Apr 18 16:38:54 2023 +0200 tracing/timer: Add missing hrtimer modes to decode_hrtimer_mode(). The trace output for the HRTIMER_MODE_.*_HARD modes is seen as a number since these modes are not decoded. The author was not aware of the fancy decoding function which makes the life easier. Extend decode_hrtimer_mode() with the additional HRTIMER_MODE_.*_HARD modes. Fixes: ae6683d815895 ("hrtimer: Introduce HARD expiry mode") Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Reviewed-by: Mukesh Ojha Acked-by: Steven Rostedt (Google) Link: https://lore.kernel.org/r/20230418143854.8vHWQKLM@linutronix.de commit dadeeffbe525597518df92d859050a3a98e78139 Author: Thomas Zimmermann Date: Tue Jun 6 12:40:56 2023 +0200 fbdev: hitfb: Use NULL for pointers Replace integer constants with NULL. Resolves the following warnings: ../drivers/video/fbdev/hitfb.c:447:23: warning: Using plain integer as NULL pointer ../drivers/video/fbdev/hitfb.c:465:23: warning: Using plain integer as NULL pointer Signed-off-by: Thomas Zimmermann Reviewed-by: Michael J. Ruhl Signed-off-by: Helge Deller commit 73eb77e75a00a7eebf5e3ca9e87ee7f728012bed Author: Thomas Zimmermann Date: Tue Jun 6 12:40:55 2023 +0200 fbdev: hitfb: Fix integer-to-pointer cast Fix the type casting from unsigned long to char __iomem *. Resolves the following warning: ../drivers/video/fbdev/hitfb.c:411:27: warning: incorrect type in assignment (different address spaces) ../drivers/video/fbdev/hitfb.c:411:27: expected char [noderef] __iomem *screen_base ../drivers/video/fbdev/hitfb.c:411:27: got void * Signed-off-by: Thomas Zimmermann Reviewed-by: Michael J. Ruhl Signed-off-by: Helge Deller commit d4313a68ec913f2705b337e2d332813a72cb2de9 Author: Linus Walleij Date: Tue Jun 13 08:33:14 2023 +0200 fbdev/media: Use GPIO descriptors for VIA GPIO The VIA fbdev exposes a custom GPIO chip for its GPIOs, these are in turn looked up the camera driver using a custom API. Drop the custom API, provide a look-up table and convert to GPIO descriptors. Note proper polarity on the RESET line. Cc: Jonathan Corbet Signed-off-by: Linus Walleij Signed-off-by: Helge Deller commit 568c69ae2fea27e0152e4ffeee7c6f354c61810f Author: Christophe JAILLET Date: Sun Jun 18 22:52:28 2023 +0200 video/hdmi: Reorder fields in 'struct hdmi_avi_infoframe' Group some variables based on their sizes to reduce hole and avoid padding. On x86_64, this shrinks the size of 'struct hdmi_avi_infoframe' from 68 to 60 bytes. It saves a few bytes of memory and is more cache-line friendly. This also reduces the union hdmi_infoframe the same way. Signed-off-by: Christophe JAILLET Signed-off-by: Helge Deller commit 07baac6cbac7c071573ecae280a408dde5f18796 Author: Juerg Haefliger Date: Fri Jun 16 14:07:05 2023 +0200 fbdev: broadsheetfb: Add MODULE_FIRMWARE macro The module loads firmware so add a MODULE_FIRMWARE macro to provide that information via modinfo. Signed-off-by: Juerg Haefliger Signed-off-by: Helge Deller commit f338beb6e5e5bfe86e882f2b0bf47ce0344c8bd8 Author: Juerg Haefliger Date: Fri Jun 16 14:05:29 2023 +0200 fbdev: metronomefb: Add MODULE_FIRMWARE macro The module loads firmware so add a MODULE_FIRMWARE macro to provide that information via modinfo. Signed-off-by: Juerg Haefliger Signed-off-by: Helge Deller commit 0f1044701764d89d7065873153bed5402add677f Author: Thomas Zimmermann Date: Tue Jun 6 12:40:54 2023 +0200 fbdev: hitfb: Declare hitfb_blank() as static Fixes the following warnings: ../drivers/video/fbdev/hitfb.c:186:5: warning: no previous prototype for 'hitfb_blank' [-Wmissing-prototypes] 186 | int hitfb_blank(int blank_mode, struct fb_info *info) | ^~~~~~~~~~~ ../drivers/video/fbdev/hitfb.c:186:5: warning: symbol 'hitfb_blank' was not declared. Should it be static? Signed-off-by: Thomas Zimmermann Reviewed-by: Michael J. Ruhl Signed-off-by: Helge Deller commit 2bd9e07140ae7b22b5d049b1dde0449b2f2a28f8 Author: Conor Dooley Date: Sat Jun 17 21:27:35 2023 +0100 riscv: dts: sort makefile entries by directory New additions to the list have tried to respect alphanumeric ordering, but the thing was out of order to start with. Sort it. Signed-off-by: Conor Dooley commit 2222dcb0775d36de28992f56455ab3967b30d380 Merge: cce3b573a52a4 cd036d542afb8 Author: Dave Airlie Date: Mon Jun 19 16:01:45 2023 +1000 Merge tag 'drm-msm-next-2023-06-18' of https://gitlab.freedesktop.org/drm/msm into drm-next Updates for v6.5.. this includes a backmerg of drm-next tree to be able to use new DRM DSC helpers. Core: + Add Marijn Suijten as drm/msm reviewer + Adreno A660 bindings + SM8350 MDSS bindings fix + Fix adreno_is_a690() warnings + More generic (DRM) and MSM-specific DSC helpers DP: + Removed obsolete USB-PD remains + Documented DP compatible string for sm8550 platform DPU: + Enable missing features (DSPP, DSC, split display) on sc8180x, sc8280xp, sm8450 + Enabled writeback on sc7280 + Implemented tearcheck support to support vsync on SM150 and newer platforms + Native HDMI output support + Dropped unused features: regdma, GC, IGC + Fixed the DSC flush operations + Simplified QoS handling, removing obsolete and unused features and merging SSPP and WB code paths + Reworked dpu_encoder initialisation path + Enabled DSPP support on sdm845 + Disabled color-management if DSPP blocks are not available + Added support for DSC 1.2 blocks found on sm8350 and later + Added .fb_dirty to fix CMD panels DSI: + Drop powerup quirks in favour of using pre_enable_prev_first for downstream bridges + Fixed 14nm DSI PHY programming + Added support for DSI and 28nm DSI PHY on MSM8226 platform + Make use of DRM and MSM DSC helpers MDP5: + Added support for display controller on MSM8226 platform GPU: + A690 support + Don't set IO_PGTABLE_QUIRK_ARM_OUTER_WBWA on devices with coherent SMMU (like A690) + Move cmdstream dumping out of fence signaling path + Cleanups + Support for a6xx devices without GMU (aka "GMU wrapper" + a610 support + a619_holi support (a619 variant without GMU) Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGsUB=tRB4nR6ZCJMuLhro5zN3BQWUSywVYbaipqqDZ_cQ@mail.gmail.com commit cce3b573a52a41dd7face9dbf745f10f9bf4632b Merge: bcbede6fbeb0e 45a3e24f65e90 Author: Dave Airlie Date: Mon Jun 19 15:59:52 2023 +1000 Backmerge tag 'v6.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next Linux 6.4-rc7 Need this to pull in the msm work. Signed-off-by: Dave Airlie commit f85534113f5ae90a52521cdb9e9977a43ee42626 Author: Daniel Golle Date: Mon Jun 5 15:18:12 2023 +0100 cpufreq: mediatek: correct voltages for MT7622 and MT7623 The MT6380 regulator typically used together with MT7622 does not support the current maximum processor and SRAM voltage in the cpufreq driver (1360000uV). For MT7622 limit processor and SRAM supply voltages to 1350000uV to avoid having the tracking algorithm request unsupported voltages from the regulator. On MT7623 there is no separate SRAM supply and the maximum voltage used is 1300000uV. Create dedicated platform data for MT7623 to cover that case as well. Fixes: 0883426fd07e3 ("cpufreq: mediatek: Raise proc and sram max voltage for MT7622/7623") Suggested-by: Jia-wei Chang Signed-off-by: Daniel Golle Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit 8eec6e740b564ec5e1da59ab7070b89aa23c9973 Author: Russell King (Oracle) Date: Fri Jun 16 12:41:30 2023 +0100 cpufreq: armada-8k: add ap807 support Add support for the Armada AP807 die to armada-8k. This uses a different compatible for the CPU clock which needs to be added to the cpufreq driver. This commit takes a different approach to the WindRiver patch "cpufreq: armada: enable ap807-cpu-clk" in that rather than calling of_find_compatible_node() for each compatible, we use a table of IDs instead. Signed-off-by: Russell King (Oracle) Signed-off-by: Viresh Kumar commit 7c41cdcd3bbee5d49de9d4821b15e49d155ff22b Author: Viresh Kumar Date: Wed Jun 14 15:29:32 2023 +0530 OPP: Simplify the over-designed pstate <-> level dance While adding support for "performance states" in the OPP and genpd core, it was decided to set the `pstate` field via genpd's pm_genpd_opp_to_performance_state() helper, to allow platforms to set `pstate` even if they don't have a corresponding `level` field in the DT OPP tables (More details are present in commit 6e41766a6a50 ("PM / Domain: Implement of_genpd_opp_to_performance_state()")). Revisiting that five years later clearly suggests that it was over-designed as all current users are eventually using the `level` value only. The previous commit already added necessary checks to make sure pstate is only used for genpd tables. Lets now simplify this a little, and use `level` directly and remove `pstate` field altogether. Suggested-by: Ulf Hansson Signed-off-by: Viresh Kumar Reviewed-by: Ulf Hansson commit 84cb7ff35fcf7c0b552f553a3f2db9c3e92fc707 Author: Viresh Kumar Date: Wed Jun 14 15:57:43 2023 +0530 OPP: pstate is only valid for genpd OPP tables It is not very clear right now that the `pstate` field is only valid for genpd OPP tables and not consumer tables. And there is no checking for the same at various places. Add checks in place to verify that and make it clear to the reader. Signed-off-by: Viresh Kumar Reviewed-by: Ulf Hansson Reviewed-by: Bjorn Andersson Tested-by: Bjorn Andersson commit bcbede6fbeb0e1eb85ccbb532faf06d3b31f0e73 Merge: 4e237d84eec87 72f1de49ffb90 Author: Dave Airlie Date: Mon Jun 19 11:57:25 2023 +1000 Merge tag 'amd-drm-next-6.5-2023-06-16' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.5-2023-06-16: amdgpu: - Misc display fixes - W=1 fixes - Improve scheduler naming - DCN 3.1.4 fixes - kdoc fixes - Enable W=1 - VCN 4.0 fix - xgmi fixes - TOPDOWN fix for large BAR systems - eDP fix - PSR fixes - SubVP fixes - Freesync fix - DPIA fix - SMU 13.0.5 fixes - vblflash fix - RAS fixes - SDMA 4 fix - BO locking fix - BO backing store fix - NBIO 7.9 fixes - GC 9.4.3 fixes - GPU reset recovery fixes - HMM fix amdkfd: - Fix NULL check - Trap fixes - Queue count fix - Add event age tracking radeon: - fbdev client fix scheduler: - Avoid an infinite loop UAPI: - Add KFD event age tracking: Proposed ROCT-Thunk-Interface: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/commit/efdbf6cfbc026bd68ac3c35d00dacf84370eb81e https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/commit/1820ae0a2db85b6f584611dc0cde1a00e7c22915 Proposed ROCR-Runtime: https://github.com/RadeonOpenCompute/ROCR-Runtime/compare/master...zhums:ROCR-Runtime:new_event_wait_review https://github.com/RadeonOpenCompute/ROCR-Runtime/commit/e1f5bdb88eb882ac798aeca2c00ea3fbb2dba459 https://github.com/RadeonOpenCompute/ROCR-Runtime/commit/7d26afd14107b5c2a754c1a3f415d89f3aabb503 drm: - DP MST fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20230616163548.7706-1-alexander.deucher@amd.com commit 4e237d84eec8783eb6dfbccb04a4e570b27a9b09 Merge: e245db7b1451c cf683e8870bd4 Author: Dave Airlie Date: Mon Jun 19 11:26:07 2023 +1000 Merge tag 'drm-misc-next-fixes-2023-06-15' of git://anongit.freedesktop.org/drm/drm-misc into drm-next Short summary of fixes pull: * Fix fbdev initializer macros Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230615114009.GA27261@linux-uq9g commit 892f439ea17cbf56a36e57c584d583649a64b404 Author: Arnd Bergmann Date: Wed Jun 7 16:28:45 2023 +0200 posix-timers: Add sys_ni_posix_timers() prototype The sys_ni_posix_timers() definition causes a warning when the declaration is missing, so this needs to be added along with the normal syscalls, outside of the #ifdef. kernel/time/posix-stubs.c:26:17: error: no previous prototype for 'sys_ni_posix_timers' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230607142925.3126422-1-arnd@kernel.org commit a7e282c77785c7eabf98836431b1f029481085ad Author: Wen Yang Date: Fri May 5 00:12:53 2023 +0800 tick/rcu: Fix bogus ratelimit condition The ratelimit logic in report_idle_softirq() is broken because the exit condition is always true: static int ratelimit; if (ratelimit < 10) return false; ---> always returns here ratelimit++; ---> no chance to run Make it check for >= 10 instead. Fixes: 0345691b24c0 ("tick/rcu: Stop allowing RCU_SOFTIRQ in idle") Signed-off-by: Wen Yang Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/tencent_5AAA3EEAB42095C9B7740BE62FBF9A67E007@qq.com commit fc4b4d96f793c827a5abf23df3e793592dbd38ce Author: Li zeming Date: Sat Jun 10 02:20:59 2023 +0800 alarmtimer: Remove unnecessary (void *) cast Pointers of type void * do not require a type cast when they are assigned to a real pointer. Signed-off-by: Li zeming Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230609182059.4509-1-zeming@nfschina.com commit 986af8dc5af834071a8a7afdf2c3b7a57d562df2 Author: Li zeming Date: Sat Jun 10 02:28:56 2023 +0800 alarmtimer: Remove unnecessary initialization of variable 'ret' ret is assigned before checked, so it does not need to initialize the variable Signed-off-by: Li zeming Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230609182856.4660-1-zeming@nfschina.com commit b9a40f24d8ea86f89f1299a3f2dccd601febe3e5 Author: Lukas Bulwahn Date: Fri Jun 9 11:46:43 2023 +0200 posix-timers: Refer properly to CONFIG_HIGH_RES_TIMERS Commit c78f261e5dcb ("posix-timers: Clarify posix_timer_fn() comments") turns an ifdef CONFIG_HIGH_RES_TIMERS into an conditional on "IS_ENABLED(CONFIG_HIGHRES_TIMERS)"; note that the new conditional refers to "HIGHRES_TIMERS" not "HIGH_RES_TIMERS" as before. Fix this typo introduced in that refactoring. Fixes: c78f261e5dcb ("posix-timers: Clarify posix_timer_fn() comments") Signed-off-by: Lukas Bulwahn Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230609094643.26253-1-lukas.bulwahn@gmail.com commit b96ce4931fcd13d73e32c62c2df3fa8f9f467e33 Author: Thomas Gleixner Date: Tue Apr 25 20:49:27 2023 +0200 posix-timers: Polish coding style in a few places Make it consistent with the TIP tree documentation. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.888493625@linutronix.de commit 200dbd6d14e6a3b22162d78b4f7a253426dba7ee Author: Thomas Gleixner Date: Tue Apr 25 20:49:25 2023 +0200 posix-timers: Remove pointless comments Documenting the obvious is just consuming space for no value. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.832240451@linutronix.de commit 84999b8bdb4969816c7bb7c14c3a55ed42aa4b94 Author: Thomas Gleixner Date: Thu Jun 1 21:07:37 2023 +0200 posix-timers: Clarify posix_timer_fn() comments Make the issues vs. SIG_IGN understandable and remove the 15 years old promise that a proper solution is already on the horizon. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/874jnrdmrq.ffs@tglx commit 02972d7955341b711d4c392f14faa9f9cd69d551 Author: Thomas Gleixner Date: Tue Apr 25 20:49:22 2023 +0200 posix-timers: Clarify posix_timer_rearm() comment Yet another incomprehensible piece of art. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.724863461@linutronix.de commit c575689d66378611bb04137b96e67ebb3ac8482b Author: Thomas Gleixner Date: Tue Apr 25 20:49:20 2023 +0200 posix-timers: Comment SIGEV_THREAD_ID properly Replace the word salad. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.672220780@linutronix.de commit 52f090b164b59c06a4da87c0599424809a6bba16 Author: Thomas Gleixner Date: Tue Apr 25 20:49:19 2023 +0200 posix-timers: Add proper comments in do_timer_create() The comment about timer lifetime at the end of the function is misplaced and uncomprehensible. Make it understandable and put it at the right place. Add a new comment about the visibility of the new timer ID to user space. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.619897296@linutronix.de commit 640fe745d7d4b6e47f3b455cb5de99a08c6b6d23 Author: Thomas Gleixner Date: Tue Apr 25 20:49:17 2023 +0200 posix-timers: Document nanosleep() details The descriptions for common_nsleep() is wrong and common_nsleep_timens() lacks any form of comment. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.567072835@linutronix.de commit 3561fcb402b7ab7fdb4c1746dae4995889506605 Author: Thomas Gleixner Date: Tue Apr 25 20:49:16 2023 +0200 posix-timers: Document sys_clock_settime() permissions in place The documentation of sys_clock_settime() permissions is at a random place and mostly word salad. Remove it and add a concise comment into sys_clock_settime(). Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.514700292@linutronix.de commit 65cade468dee537885b51897ba41ba05a4dcf6ca Author: Thomas Gleixner Date: Tue Apr 25 20:49:14 2023 +0200 posix-timers: Document sys_clock_getoverrun() Document the syscall in detail and with coherent sentences. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.462051641@linutronix.de commit a86e9284336729a8f79a65371eacd0c1c7fae142 Author: Thomas Gleixner Date: Tue Apr 25 20:49:12 2023 +0200 posix-timers: Document common_clock_get() correctly Replace another confusing and inaccurate set of comments. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.409169321@linutronix.de commit 01679b5db7172b898be325ff272e10aebd412911 Author: Thomas Gleixner Date: Tue Apr 25 20:49:11 2023 +0200 posix-timers: Document sys_clock_getres() correctly The decades old comment about Posix clock resolution is confusing at best. Remove it and add a proper explanation to sys_clock_getres(). Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.356427330@linutronix.de commit 8cc96ca2c75f6da59de41321797c87562703c9e1 Author: Thomas Gleixner Date: Tue Apr 25 20:49:09 2023 +0200 posix-timers: Split release_posix_timers() release_posix_timers() is called for cleaning up both hashed and unhashed timers. The cases are differentiated by an argument and the usage is hideous. Seperate the actual free path out and use it for unhashed timers. Provide a function for hashed timers. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.301432503@linutronix.de commit 11fbe6cd41210c7b5173257158a22e11e225622d Author: Thomas Gleixner Date: Tue Apr 25 20:49:08 2023 +0200 posix-timers: Remove pointless irqsafe from hash_lock All usage of hash_lock is in thread context. No point in using spin_lock_irqsave()/irqrestore() for a single usage site. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.249063953@linutronix.de commit 72786ff23d5acb7bf3e2535831b2f1dc55c7f44e Author: Thomas Gleixner Date: Tue Apr 25 20:49:06 2023 +0200 posix-timers: Set k_itimer:: It_signal to NULL on exit() Technically it's not required to set k_itimer::it_signal to NULL on exit() because there is no other thread anymore which could lookup the timer concurrently. Set it to NULL for consistency sake and add a comment to that effect. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.196462644@linutronix.de commit 028cf5eaa12846c4e32104132ff70ca1cd6f5943 Author: Thomas Gleixner Date: Tue Apr 25 20:49:05 2023 +0200 posix-timers: Annotate concurrent access to k_itimer:: It_signal k_itimer::it_signal is read lockless in the RCU protected hash lookup, but it can be written concurrently in the timer_create() and timer_delete() path. Annotate these places with READ_ONCE() and WRITE_ONCE() Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.143596887@linutronix.de commit ae88967d71f1b4ffb6e48043993d37a106da8109 Author: Thomas Gleixner Date: Tue Apr 25 20:49:03 2023 +0200 posix-timers: Add comments about timer lookup Document how the timer ID validation in the hash table works. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.091081515@linutronix.de commit 8d44b958a1a088195524c884f0437660e0522380 Author: Thomas Gleixner Date: Tue Apr 25 20:49:01 2023 +0200 posix-timers: Cleanup comments about timer ID tracking Describe the hash table properly and remove the IDR leftover comments. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.038444551@linutronix.de commit 7d9909026645064cd31b20cee5939a0f72282261 Author: Thomas Gleixner Date: Tue Apr 25 20:49:00 2023 +0200 posix-timers: Clarify timer_wait_running() comment Explain it better and add the CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y aspect for completeness. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183312.985681995@linutronix.de commit 8ce8849dd1e78dadcee0ec9acbd259d239b7069f Author: Thomas Gleixner Date: Thu Jun 1 20:58:47 2023 +0200 posix-timers: Ensure timer ID search-loop limit is valid posix_timer_add() tries to allocate a posix timer ID by starting from the cached ID which was stored by the last successful allocation. This is done in a loop searching the ID space for a free slot one by one. The loop has to terminate when the search wrapped around to the starting point. But that's racy vs. establishing the starting point. That is read out lockless, which leads to the following problem: CPU0 CPU1 posix_timer_add() start = sig->posix_timer_id; lock(hash_lock); ... posix_timer_add() if (++sig->posix_timer_id < 0) start = sig->posix_timer_id; sig->posix_timer_id = 0; So CPU1 can observe a negative start value, i.e. -1, and the loop break never happens because the condition can never be true: if (sig->posix_timer_id == start) break; While this is unlikely to ever turn into an endless loop as the ID space is huge (INT_MAX), the racy read of the start value caught the attention of KCSAN and Dmitry unearthed that incorrectness. Rewrite it so that all id operations are under the hash lock. Reported-by: syzbot+5c54bd3eb218bb595aa9@syzkaller.appspotmail.com Reported-by: Dmitry Vyukov Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/87bkhzdn6g.ffs@tglx commit 9d9e522010eb5685d8b53e8a24320653d9d4cbbf Author: Thomas Gleixner Date: Thu Jun 1 22:16:34 2023 +0200 posix-timers: Prevent RT livelock in itimer_delete() itimer_delete() has a retry loop when the timer is concurrently expired. On non-RT kernels this just spin-waits until the timer callback has completed, except for posix CPU timers which have HAVE_POSIX_CPU_TIMERS_TASK_WORK enabled. In that case and on RT kernels the existing task could live lock when preempting the task which does the timer delivery. Replace spin_unlock() with an invocation of timer_wait_running() to handle it the same way as the other retry loops in the posix timer code. Fixes: ec8f954a40da ("posix-timers: Use a callback for cancel synchronization on PREEMPT_RT") Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/87v8g7c50d.ffs@tglx commit cd036d542afb82adfbbd43c5dbeb7010e8e91ee7 Author: Konrad Dybcio Date: Fri Jun 16 01:21:01 2023 +0200 drm/msm/a6xx: Add A610 speedbin support A610 is implemented on at least three SoCs: SM6115 (bengal), SM6125 (trinket) and SM6225 (khaje). Trinket does not support speed binning (only a single SKU exists) and we don't yet support khaje upstream. Hence, add a fuse mapping table for bengal to allow for per-chip frequency limiting. Reviewed-by: Dmitry Baryshkov Reviewed-by: Akhil P Oommen Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542780/ Signed-off-by: Rob Clark commit 20c8e39985b9a4442123e0fa6496183d9418e422 Author: Konrad Dybcio Date: Fri Jun 16 01:21:00 2023 +0200 drm/msm/a6xx: Add A619_holi speedbin support A619_holi is implemented on at least two SoCs: SM4350 (holi) and SM6375 (blair). This is what seems to be a first occurrence of this happening, but it's easy to overcome by guarding the SoC-specific fuse values with of_machine_is_compatible(). Do just that to enable frequency limiting on these SoCs. Reviewed-by: Dmitry Baryshkov Reviewed-by: Akhil P Oommen Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542772/ Signed-off-by: Rob Clark commit b3bcd583fa6f963be9c8a08405b2cbaeea797a3c Author: Konrad Dybcio Date: Fri Jun 16 01:20:59 2023 +0200 drm/msm/a6xx: Use adreno_is_aXYZ macros in speedbin matching Before transitioning to using per-SoC and not per-Adreno speedbin fuse values (need another patchset to land elsewhere), a good improvement/stopgap solution is to use adreno_is_aXYZ macros in place of explicit revision matching. Do so to allow differentiating between A619 and A619_holi. Reviewed-by: Dmitry Baryshkov Reviewed-by: Akhil P Oommen Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542777/ Signed-off-by: Rob Clark commit ac926549651140243c6f4e234ca83fcb29d29ecf Author: Konrad Dybcio Date: Fri Jun 16 01:20:58 2023 +0200 drm/msm/a6xx: Use "else if" in GPU speedbin rev matching The GPU can only be one at a time. Turn a series of ifs into if + elseifs to save some CPU cycles. Reviewed-by: Dmitry Baryshkov Reviewed-by: Akhil P Oommen Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542770/ Signed-off-by: Rob Clark commit 3e90044d3e4941efafbfcfad8b1b7cfdb6d97a58 Author: Konrad Dybcio Date: Fri Jun 16 01:20:57 2023 +0200 drm/msm/a6xx: Fix some A619 tunables Adreno 619 expects some tunables to be set differently. Make up for it. Fixes: b7616b5c69e6 ("drm/msm/adreno: Add A619 support") Reviewed-by: Dmitry Baryshkov Reviewed-by: Akhil P Oommen Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542782/ Signed-off-by: Rob Clark commit e7fc9398e608a7bc057fe7d50dbdaf3052be59b5 Author: Konrad Dybcio Date: Fri Jun 16 01:20:56 2023 +0200 drm/msm/a6xx: Add A610 support A610 is one of (if not the) lowest-tier SKUs in the A6XX family. It features no GMU, as it's implemented solely on SoCs with SMD_RPM. What's more interesting is that it does not feature a VDDGX line either, being powered solely by VDDCX and has an unfortunate hardware quirk that makes its reset line broken - after a couple of assert/ deassert cycles, it will hang for good and will not wake up again. This GPU requires mesa changes for proper rendering, and lots of them at that. The command streams are quite far away from any other A6XX GPU and hence it needs special care. This patch was validated both by running an (incomplete) downstream mesa with some hacks (frames rendered correctly, though some instructions made the GPU hangcheck which is expected - garbage in, garbage out) and by replaying RD traces captured with the downstream KGSL driver - no crashes there, ever. Add support for this GPU on the kernel side, which comes down to pretty simply adding A612 HWCG tables, altering a few values and adding a special case for handling the reset line. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542779/ Signed-off-by: Rob Clark commit 8296ff0afdf22656683c9cf908ee8abdfa96d03a Author: Konrad Dybcio Date: Fri Jun 16 01:20:55 2023 +0200 drm/msm/a6xx: Add support for A619_holi A619_holi is a GMU-less variant of the already-supported A619 GPU. It's present on at least SM4350 (holi) and SM6375 (blair). No mesa changes are required. Add the required kernel-side support for it. Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542775/ Signed-off-by: Rob Clark commit 9bad37600c89eb6b3ac65faabbb26da21b48ccad Author: Konrad Dybcio Date: Fri Jun 16 01:20:54 2023 +0200 drm/msm/adreno: Disable has_cached_coherent in GMU wrapper configurations A610 and A619_holi don't support the feature. Disable it to make the GPU stop crashing after almost each and every submission - the received data on the GPU end was simply incomplete in garbled, resulting in almost nothing being executed properly. Extend the disablement to adreno_has_gmu_wrapper, as none of the GMU wrapper Adrenos that don't support yet seem to feature it. Reviewed-by: Akhil P Oommen Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542774/ Signed-off-by: Rob Clark commit 5a903a44a98471cedf0021fac0a6a64bbe86943f Author: Konrad Dybcio Date: Fri Jun 16 01:20:53 2023 +0200 drm/msm/a6xx: Introduce GMU wrapper support Some (particularly SMD_RPM, a.k.a non-RPMh) SoCs implement A6XX GPUs but don't implement the associated GMUs. This is due to the fact that the GMU directly pokes at RPMh. Sadly, this means we have to take care of enabling & scaling power rails, clocks and bandwidth ourselves. Reuse existing Adreno-common code and modify the deeply-GMU-infused A6XX code to facilitate these GPUs. This involves if-ing out lots of GMU callbacks and introducing a new type of GMU - GMU wrapper (it's the actual name that Qualcomm uses in their downstream kernels). This is essentially a register region which is convenient to model as a device. We'll use it for managing the GDSCs. The register layout matches the actual GMU_CX/GX regions on the "real GMU" devices and lets us reuse quite a bit of gmu_read/write/rmw calls. Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542766/ Signed-off-by: Rob Clark commit 30f55f3f2374b53a28f08f9a670c1ba7ade3805a Author: Konrad Dybcio Date: Fri Jun 16 01:20:52 2023 +0200 drm/msm/a6xx: Move CX GMU power counter enablement to hw_init Since the introduction of A6xx support, we've been enabling the CX GMU power counter 0 in a bit of a weird spot. Move it to hw_init so that GMU wrapper GPUs can reuse the same code paths. As a bonus, this order makes it easier to compare mainline and downstream register access traces. Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542765/ Signed-off-by: Rob Clark commit df5bb404fa925a1b1fa3893f4976094227fbc1f0 Author: Konrad Dybcio Date: Fri Jun 16 01:20:51 2023 +0200 drm/msm/a6xx: Extend and explain UBWC config Rename lower_bit to hbb_lo and explain what it signifies. Add explanations (wherever possible to other tunables). Port setting min_access_length, ubwc_mode and hbb_hi from downstream. Reviewed-by: Rob Clark Reviewed-by: Akhil P Oommen Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542764/ Signed-off-by: Rob Clark commit 05a23a76d35b874dcfab2ad8e8d156d7f24894bd Author: Konrad Dybcio Date: Fri Jun 16 01:20:50 2023 +0200 drm/msm/a6xx: Remove both GBIF and RBBM GBIF halt on hw init Currently we're only deasserting REG_A6XX_RBBM_GBIF_HALT, but we also need REG_A6XX_GBIF_HALT to be set to 0. This is typically done automatically on successful GX collapse, but in case that fails, we should take care of it. Also, add a memory barrier to ensure it's gone through before jumping to further initialization. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542760/ Signed-off-by: Rob Clark commit 277b967829aad7b24327f246087805078a62076e Author: Konrad Dybcio Date: Fri Jun 16 01:20:49 2023 +0200 drm/msm/a6xx: Add a helper for software-resetting the GPU Introduce a6xx_gpu_sw_reset() in preparation for adding GMU wrapper GPUs and reuse it in a6xx_gmu_force_off(). This helper, contrary to the original usage in GMU code paths, adds a readback+delay sequence to ensure that the reset is never deasserted too quickly due to e.g. OoO execution going crazy. Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542758/ Signed-off-by: Rob Clark commit 3773a57d9c55d77ad6615f7235b91fcac0e6c65e Author: Konrad Dybcio Date: Fri Jun 16 01:20:48 2023 +0200 drm/msm/a6xx: Improve a6xx_bus_clear_pending_transactions() Unify the indentation and explain the cryptic 0xF value. Reviewed-by: Akhil P Oommen Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542756/ Signed-off-by: Rob Clark commit 6e332c99d1aac34660c22fd1dffc5d6f83d330fa Author: Konrad Dybcio Date: Fri Jun 16 01:20:47 2023 +0200 drm/msm/a6xx: Move a6xx_bus_clear_pending_transactions to a6xx_gpu This function is responsible for telling the GPU to halt transactions on all of its relevant buses, drain them and leave them in a predictable state, so that the GPU can be e.g. reset cleanly. Move the function to a6xx_gpu.c, remove the static keyword and add a prototype in a6xx_gpu.h to accomodate for the move. Reviewed-by: Akhil P Oommen Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542762/ Signed-off-by: Rob Clark commit ce8f1381fd4960634e5f2a96bdf6f4eb177bca6e Author: Konrad Dybcio Date: Fri Jun 16 01:20:46 2023 +0200 drm/msm/a6xx: Move force keepalive vote removal to a6xx_gmu_force_off() As pointed out by Akhil during the review process of GMU wrapper introduction [1], it makes sense to move this write into the function that's responsible for forcibly shutting the GMU off. It is also very convenient to move this to GMU-specific code, so that it does not have to be guarded by an if-condition to avoid calling it on GMU wrapper targets. Move the write to the aforementioned a6xx_gmu_force_off() to achieve that. No effective functional change. [1] https://lore.kernel.org/linux-arm-msm/20230501194022.GA18382@akhilpo-linux.qualcomm.com/ Reviewed-by: Akhil P Oommen Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542752/ Signed-off-by: Rob Clark commit bd31afe010ea72de2323c9d95b540f08aeada732 Author: Konrad Dybcio Date: Fri Jun 16 01:20:45 2023 +0200 drm/msm/a6xx: Remove static keyword from sptprac en/disable functions These two will be reused by at least A619_holi in the non-gmu paths. Turn them non-static them to make it possible. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542751/ Signed-off-by: Rob Clark commit 87cc0d0a4204b437c4401864350e7c4ee7710f3f Author: Konrad Dybcio Date: Fri Jun 16 01:20:44 2023 +0200 drm/msm/adreno: Use adreno_is_revn for A690 The adreno_is_revn rework came at the same time as A690 introduction and that resulted in it not covering all cases. Fix it. Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542754/ Signed-off-by: Rob Clark commit 63204be2806b09ab75e03e42c477f69bfd050efc Author: Konrad Dybcio Date: Fri Jun 16 01:20:43 2023 +0200 dt-bindings: display/msm/gmu: Add GMU wrapper The "GMU Wrapper" is Qualcomm's name for "let's treat the GPU blocks we'd normally assign to the GMU as if they were a part of the GMU, even though they are not". It's a (good) software representation of the GMU_CX and GMU_GX register spaces within the GPUSS that helps us programatically treat these de-facto GMU-less parts in a way that's very similar to their GMU-equipped cousins, massively saving up on code duplication. The "wrapper" register space was specifically designed to mimic the layout of a real GMU, though it rather obviously does not have the M3 core et al. To sum it all up, the GMU wrapper is essentially a register space within the GPU, which Linux sees as a dumbed-down regular GMU: there's no clocks, interrupts, multiple reg spaces, iommus and OPP. Document it. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542750/ Signed-off-by: Rob Clark commit a770dc6105fbd27a8c08557c8ef720c6aa878b4d Author: Konrad Dybcio Date: Fri Jun 16 01:20:42 2023 +0200 dt-bindings: display/msm: gpu: Document GMU wrapper-equipped A6xx The "GMU Wrapper" is Qualcomm's name for "let's treat the GPU blocks we'd normally assign to the GMU as if they were a part of the GMU, even though they are not". It's a (good) software representation of the GMU_CX and GMU_GX register spaces within the GPUSS that helps us programatically treat these de-facto GMU-less parts in a way that's very similar to their GMU-equipped cousins, massively saving up on code duplication. The "wrapper" register space was specifically designed to mimic the layout of a real GMU, though it rather obviously does not have the M3 core et al. GMU wrapper-equipped A6xx GPUs require clocks and clock-names to be specified under the GPU node, just like their older cousins. Account for that. Acked-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/542748/ Signed-off-by: Rob Clark commit 9a94d764e9bc6ee4b9424acde77c959270e2ac7a Merge: 2dc6af8be002d 5f2cf757f9c56 Author: David S. Miller Date: Sun Jun 18 18:52:58 2023 +0100 Merge tag 'mlx5-updates-2023-06-16' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux mlx5-updates-2023-06-16 1) Added a new event handler to firmware sync reset, which is used to support firmware sync reset flow on smart NIC. Adding this new stage to the flow enables the firmware to ensure host PFs unload before ECPFs unload, to avoid race of PFs recovery. 2) Debugfs for mlx5 eswitch bridge offloads 3) Added two new counters for vport stats 4) Minor Fixups and cleanups for net-next branch Signed-off-by: David S. Miller commit 2dc6af8be002d16715485372ce1e02b65faf9283 Author: Jakub Kicinski Date: Fri Jun 16 13:49:39 2023 -0700 gro: move the tc_ext comparison to a helper The double ifdefs (one for the variable declaration and one around the code) are quite aesthetically displeasing. Factor this code out into a helper for easier wrapping. This will become even more ugly when another skb ext comparison is added in the future. The resulting machine code looks the same, the compiler seems to try to use %rax more and some blocks more around but I haven't spotted minor differences. Reviewed-by: Simon Horman Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 988e8d90b3dc482637532e61bc2d58bfc4af5167 Author: Christophe JAILLET Date: Sat Jun 17 16:24:37 2023 +0200 net: phy: at803x: Use devm_regulator_get_enable_optional() Use devm_regulator_get_enable_optional() instead of hand writing it. It saves some line of code. Signed-off-by: Christophe JAILLET Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 88770b8de38eeaf093c877ed78a7e6e1660df8df Author: Chuck Lever Date: Sun Jun 18 12:04:01 2023 -0400 svcrdma: Fix stale comment Commit 7d81ee8722d6 ("svcrdma: Single-stage RDMA Read") changed the behavior of svc_rdma_recvfrom() but neglected to update the documenting comment. Signed-off-by: Chuck Lever commit 5e092be7418fdf0e1e288529bd7e657cb9d7954c Author: Chuck Lever Date: Fri Jun 16 23:10:53 2023 -0400 NFSD: Distinguish per-net namespace initialization I find the naming of nfsd_init_net() and nfsd_startup_net() to be confusingly similar. Rename the namespace initialization and tear- down ops and add comments to distinguish their separate purposes. Signed-off-by: Chuck Lever commit ed9ab7346e908496816cffdecd46932035f66e2e Author: Jeff Layton Date: Fri Jun 16 17:51:34 2023 -0400 nfsd: move init of percpu reply_cache_stats counters back to nfsd_init_net Commit f5f9d4a314da ("nfsd: move reply cache initialization into nfsd startup") moved the initialization of the reply cache into nfsd startup, but didn't account for the stats counters, which can be accessed before nfsd is ever started. The result can be a NULL pointer dereference when someone accesses /proc/fs/nfsd/reply_cache_stats while nfsd is still shut down. This is a regression and a user-triggerable oops in the right situation: - non-x86_64 arch - /proc/fs/nfsd is mounted in the namespace - nfsd is not started in the namespace - unprivileged user calls "cat /proc/fs/nfsd/reply_cache_stats" Although this is easy to trigger on some arches (like aarch64), on x86_64, calling this_cpu_ptr(NULL) evidently returns a pointer to the fixed_percpu_data. That struct looks just enough like a newly initialized percpu var to allow nfsd_reply_cache_stats_show to access it without Oopsing. Move the initialization of the per-net+per-cpu reply-cache counters back into nfsd_init_net, while leaving the rest of the reply cache allocations to be done at nfsd startup time. Kudos to Eirik who did most of the legwork to track this down. Cc: stable@vger.kernel.org # v6.3+ Fixes: f5f9d4a314da ("nfsd: move reply cache initialization into nfsd startup") Reported-and-tested-by: Eirik Fuller Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2215429 Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 289a007b98b06d9ce4be24e2dda43f6821687e70 Author: Anup Patel Date: Thu Jun 15 13:03:51 2023 +0530 RISC-V: KVM: Expose APLIC registers as attributes of AIA irqchip We expose APLIC registers as KVM device attributes of the in-kernel AIA irqchip device. This will allow KVM user-space to save/restore APLIC state using KVM device ioctls(). Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 74967aa208e257d0c26a7dd7dd93a8902b2203e4 Author: Anup Patel Date: Thu Jun 15 13:03:50 2023 +0530 RISC-V: KVM: Add in-kernel emulation of AIA APLIC There is no virtualization support in AIA APLIC so we add in-kernel emulation of AIA APLIC which only supports MSI-mode (i.e. wired interrupts forwarded to AIA IMSIC as MSIs). Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 89d01306e34d6ace24e9708cb443df0e53c06ce0 Author: Anup Patel Date: Thu Jun 15 13:03:49 2023 +0530 RISC-V: KVM: Implement device interface for AIA irqchip We implement KVM device interface for in-kernel AIA irqchip so that user-space can use KVM device ioctls to create, configure, and destroy in-kernel AIA irqchip. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 00f918f61c56a46d9e09ce21b54b8c21f496c753 Author: Anup Patel Date: Thu Jun 15 13:03:48 2023 +0530 RISC-V: KVM: Skeletal in-kernel AIA irqchip support To incrementally implement in-kernel AIA irqchip support, we first add minimal skeletal support which only compiles but does not provide any functionality. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit f0607e6215b2329bb8f3117b34ccfc6447e14f22 Author: Anup Patel Date: Thu Jun 15 13:03:47 2023 +0530 RISC-V: KVM: Set kvm_riscv_aia_nr_hgei to zero We hard-code the kvm_riscv_aia_nr_hgei to zero until IMSIC HW guest file support is added in KVM RISC-V. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit cf55201c7516d1c69859f1157deab02223285f82 Author: Anup Patel Date: Thu Jun 15 13:03:46 2023 +0530 RISC-V: KVM: Add APLIC related defines We add APLIC related defines in a separate header so that different parts of KVM code can share it. Once AIA drivers are merged will have a common APLIC header shared by both KVM and IRQCHIP driver. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit f7fec5ecc9b6a6dedf6e38c1d3e7cd6557df5514 Author: Anup Patel Date: Thu Jun 15 13:03:45 2023 +0530 RISC-V: KVM: Add IMSIC related defines We add IMSIC related defines in a separate header so that different parts of KVM code can share it. Once AIA drivers are merged will have a common IMSIC header shared by both KVM and IRQCHIP driver. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 77cf33c17154b7f8151429f6ba32049afc49f9c3 Author: Anup Patel Date: Thu Jun 15 13:03:44 2023 +0530 RISC-V: KVM: Implement guest external interrupt line management The RISC-V host will have one guest external interrupt line for each VS-level IMSICs associated with a HART. The guest external interrupt lines are per-HART resources and hypervisor can use HGEIE, HGEIP, and HIE CSRs to manage these guest external interrupt lines. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 37f665ffa886ce49d1baaca1c3501ce93713b77e Author: Joaquín Ignacio Aramendía Date: Sat Jun 17 15:11:43 2023 -0300 hwmon: (oxp-sensors) Simplify logic of error return Take return logic on error out of if-else, eliminating duplicated code in tt_togle_store() function. Signed-off-by: Joaquín Ignacio Aramendía Link: https://lore.kernel.org/r/20230617181159.32844-3-samsagax@gmail.com Signed-off-by: Guenter Roeck commit d7696214b06dae06b5c632142b1c80cf85219c74 Author: Joaquín Ignacio Aramendía Date: Sat Jun 17 15:11:42 2023 -0300 hwmon: (oxp-sensors) Remove unused header We are not using , remove that. Signed-off-by: Joaquín Ignacio Aramendía Link: https://lore.kernel.org/r/20230617181159.32844-2-samsagax@gmail.com Signed-off-by: Guenter Roeck commit 264879fdbea0c3093057d48f3dcc7afeea433fb7 Author: Michael Walle Date: Fri Jun 16 12:45:57 2023 +0200 dt-bindings: net: phy: gpy2xx: more precise description Mention that the interrupt line is just asserted for a random period of time, not the entire time. Suggested-by: Rob Herring Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 3515440df461359762d447b5068f148611bb4d42 Author: Eric Dumazet Date: Fri Jun 16 08:57:52 2023 +0000 ipv6: also use netdev_hold() in ip6_route_check_nh() In blamed commit, we missed the fact that ip6_validate_gw() could change dev under us from ip6_route_check_nh() In this fix, I use GFP_ATOMIC in order to not pass too many additional arguments to ip6_validate_gw() and ip6_route_check_nh() only for a rarely used debug feature. syzbot reported: refcount_t: decrement hit 0; leaking memory. WARNING: CPU: 0 PID: 5006 at lib/refcount.c:31 refcount_warn_saturate+0x1d7/0x1f0 lib/refcount.c:31 Modules linked in: CPU: 0 PID: 5006 Comm: syz-executor403 Not tainted 6.4.0-rc5-syzkaller-01229-g97c5209b3d37 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 RIP: 0010:refcount_warn_saturate+0x1d7/0x1f0 lib/refcount.c:31 Code: 05 fb 8e 51 0a 01 e8 98 95 38 fd 0f 0b e9 d3 fe ff ff e8 ac d9 70 fd 48 c7 c7 00 d3 a6 8a c6 05 d8 8e 51 0a 01 e8 79 95 38 fd <0f> 0b e9 b4 fe ff ff 48 89 ef e8 1a d7 c3 fd e9 5c fe ff ff 0f 1f RSP: 0018:ffffc900039df6b8 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff888026d71dc0 RSI: ffffffff814c03b7 RDI: 0000000000000001 RBP: ffff888146a505fc R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000001 R12: 1ffff9200073bedc R13: 00000000ffffffef R14: ffff888146a505fc R15: ffff8880284eb5a8 FS: 0000555556c88300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000004585c0 CR3: 000000002b1b1000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __refcount_dec include/linux/refcount.h:344 [inline] refcount_dec include/linux/refcount.h:359 [inline] ref_tracker_free+0x539/0x820 lib/ref_tracker.c:236 netdev_tracker_free include/linux/netdevice.h:4097 [inline] netdev_put include/linux/netdevice.h:4114 [inline] netdev_put include/linux/netdevice.h:4110 [inline] fib6_nh_init+0xb96/0x1bd0 net/ipv6/route.c:3624 ip6_route_info_create+0x10f3/0x1980 net/ipv6/route.c:3791 ip6_route_add+0x28/0x150 net/ipv6/route.c:3835 ipv6_route_ioctl+0x3fc/0x570 net/ipv6/route.c:4459 inet6_ioctl+0x246/0x290 net/ipv6/af_inet6.c:569 sock_do_ioctl+0xcc/0x230 net/socket.c:1189 sock_ioctl+0x1f8/0x680 net/socket.c:1306 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] Fixes: 70f7457ad6d6 ("net: create device lookup API with reference tracking") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Jakub Kicinski Cc: David Ahern Reviewed-by: Jakub Kicinski Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 4380499218c6a1aa77e80e3bf6da107dd8babf62 Author: David Howells Date: Thu Jun 15 22:08:54 2023 +0100 crypto: Fix af_alg_sendmsg(MSG_SPLICE_PAGES) sglist limit When af_alg_sendmsg() calls extract_iter_to_sg(), it passes MAX_SGL_ENTS as the maximum number of elements that may be written to, but some of the elements may already have been used (as recorded in sgl->cur), so extract_iter_to_sg() may end up overrunning the scatterlist. Fix this to limit the number of elements to "MAX_SGL_ENTS - sgl->cur". Note: It probably makes sense in future to alter the behaviour of extract_iter_to_sg() to stop if "sgtable->nents >= sg_max" instead, but this is a smaller fix for now. The bug causes errors looking something like: BUG: KASAN: slab-out-of-bounds in sg_assign_page include/linux/scatterlist.h:109 [inline] BUG: KASAN: slab-out-of-bounds in sg_set_page include/linux/scatterlist.h:139 [inline] BUG: KASAN: slab-out-of-bounds in extract_bvec_to_sg lib/scatterlist.c:1183 [inline] BUG: KASAN: slab-out-of-bounds in extract_iter_to_sg lib/scatterlist.c:1352 [inline] BUG: KASAN: slab-out-of-bounds in extract_iter_to_sg+0x17a6/0x1960 lib/scatterlist.c:1339 Fixes: bf63e250c4b1 ("crypto: af_alg: Support MSG_SPLICE_PAGES") Reported-by: syzbot+6efc50cc1f8d718d6cb7@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/000000000000b2585a05fdeb8379@google.com/ Signed-off-by: David Howells Tested-by: syzbot+6efc50cc1f8d718d6cb7@syzkaller.appspotmail.com cc: Herbert Xu cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org Acked-by: Herbert Xu Signed-off-by: David S. Miller commit dd64621a2a97798d5df40028238a703d4324036b Author: Tiezhu Yang Date: Sun Apr 23 09:39:47 2023 +0800 csky: uprobes: Restore thread.trap_no thread.trap_no is saved in arch_uprobe_pre_xol(), it should be restored in arch_uprobe_{post,abort}_xol() accordingly, otherwise the save operation is meaningless, this change is similar with x86 and powerpc. Signed-off-by: Tiezhu Yang Acked-by: Oleg Nesterov Reviewed-by: Guo Ren Signed-off-by: Guo Ren commit 7a7f094635349a7d0314364ad50bdeb770b6df4f Author: Arjun Roy Date: Fri Jun 16 12:34:27 2023 -0700 tcp: Use per-vma locking for receive zerocopy Per-VMA locking allows us to lock a struct vm_area_struct without taking the process-wide mmap lock in read mode. Consider a process workload where the mmap lock is taken constantly in write mode. In this scenario, all zerocopy receives are periodically blocked during that period of time - though in principle, the memory ranges being used by TCP are not touched by the operations that need the mmap write lock. This results in performance degradation. Now consider another workload where the mmap lock is never taken in write mode, but there are many TCP connections using receive zerocopy that are concurrently receiving. These connections all take the mmap lock in read mode, but this does induce a lot of contention and atomic ops for this process-wide lock. This results in additional CPU overhead caused by contending on the cache line for this lock. However, with per-vma locking, both of these problems can be avoided. As a test, I ran an RPC-style request/response workload with 4KB payloads and receive zerocopy enabled, with 100 simultaneous TCP connections. I measured perf cycles within the find_tcp_vma/mmap_read_lock/mmap_read_unlock codepath, with and without per-vma locking enabled. When using process-wide mmap semaphore read locking, about 1% of measured perf cycles were within this path. With per-VMA locking, this value dropped to about 0.45%. Signed-off-by: Arjun Roy Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 2f2665c13af4895b26761107c2f637c2f112d8e9 Author: Joel Granados Date: Fri Jun 16 10:59:22 2023 +0200 sysctl: replace child with an enumeration This is part of the effort to remove the empty element at the end of ctl_table structs. "child" was a deprecated elem in this struct and was being used to differentiate between two types of ctl_tables: "normal" and "permanently emtpy". What changed?: * Replace "child" with an enumeration that will have two values: the default (0) and the permanently empty (1). The latter is left at zero so when struct ctl_table is created with kzalloc or in a local context, it will have the zero value by default. We document the new enum with kdoc. * Remove the "empty child" check from sysctl_check_table * Remove count_subheaders function as there is no longer a need to calculate how many headers there are for every child * Remove the recursive call to unregister_sysctl_table as there is no need to traverse down the child tree any longer * Add a new SYSCTL_PERM_EMPTY_DIR binary flag * Remove the last remanence of child from partport/procfs.c Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit 94a6490518d80a61c7a8e5aa107547e53636d964 Author: Joel Granados Date: Fri Jun 16 10:59:21 2023 +0200 sysctl: Remove debugging dump_stack Remove unneeded dump_stack in __register_sysctl_table Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit f2e7a6265e5a5e02ee663eda3d0527dd8230b832 Author: Joel Granados Date: Fri Jun 16 10:59:20 2023 +0200 test_sysclt: Test for registering a mount point Test that target gets created by register_sysctl_mount_point and that no additional target can be created "on top" of a permanently empty sysctl table. Create a mount point target (mnt) in the sysctl test driver; try to create another on top of that (mnt_error). Output an error if "mnt_error" is present when we run the sysctl selftests. Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit ec866cc6f8a90a65cd085377405c34f0f6d9ba60 Author: Joel Granados Date: Fri Jun 16 10:59:19 2023 +0200 test_sysctl: Add an option to prevent test skip Tests were being skipped because the target was not present. Add a flag that controls whether to skip a test based on the presence of the target. Actually skip tests in the test_case function with a "return" instead of a "continue". Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit 35576438591e8d37c7651e6ff56f2e07c7f9615a Author: Joel Granados Date: Fri Jun 16 10:59:18 2023 +0200 test_sysctl: Add an unregister sysctl test Add a test that checks that the unregistered directory is removed from /proc/sys/debug Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit e009bd5efe81c5ccd2c08626a79c37d2a238ff15 Author: Joel Granados Date: Fri Jun 16 10:59:17 2023 +0200 test_sysctl: Group node sysctl test under one func Preparation commit to add a new type of test to test_sysctl.c. We want to differentiate between node and (sub)directory tests. Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit a40b702789a480904b15f5843c4ed79f969ee4d5 Author: Joel Granados Date: Fri Jun 16 10:59:16 2023 +0200 test_sysctl: Fix test metadata getters The functions get_test_{count,enabled,target} use awk to get the N'th field in the ALL_TESTS variable. A variable with leading zeros (e.g. 0009) is misinterpreted as an entire line instead of the N'th field. Remove the leading zeros so this does not happen. We can now use the helper in tests 6, 7 and 8. Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit 37e9981e33e4d308c323a56bb908aa54c8f041a8 Author: Joel Granados Date: Fri Jun 16 10:59:15 2023 +0200 parport: plug a sysctl register leak parport registers two sysctl directories in the parport_proc_register function but only one of them was getting unregistered in parport_proc_unregister. Keep track of both sysctl table headers and handle them together when (un)registering. Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit f02615eb6f5a1e732230784bf0e3b6543540e853 Author: Jingbo Xu Date: Tue Jun 13 15:41:14 2023 +0800 erofs: use separate xattr parsers for listxattr/getxattr There's a callback styled xattr parser, i.e. xattr_foreach(), which is shared among listxattr and getxattr. Convert it to two separate xattr parsers to serve listxattr and getxattr for better readability. Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20230613074114.120115-6-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 4b077b501266c6c6784656cd8721db37c090c5df Author: Jingbo Xu Date: Tue Jun 13 15:41:13 2023 +0800 erofs: unify inline/shared xattr iterators for listxattr/getxattr Make inline_{list,get}xattr() as well as inline_xattr_iter_begin() unified as erofs_xattr_iter_inline(), and shared_{list,get}xattr() unified as erofs_xattr_iter_shared(). After these changes, both erofs_xattr_iter_{inline,shared}() return 0 on success, and negative error on failure. One thing worth noting is that, the logic of returning it->buffer_ofs when there's no shared xattrs in shared_listxattr() is moved to erofs_listxattr() to make the unification possible. The only difference is that, semantically the old behavior will return ENOATTR rather than it->buffer_ofs if ENOATTR encountered when listxattr is parsing upon a specific shared xattr, while now the new behavior will return it->buffer_ofs in this case. This is not an issue, as listxattr upon a specific xattr won't return ENOATTR. Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20230613074114.120115-5-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 5a8ffb1975c5b6511a996383fce7ad0f97132a5c Author: Jingbo Xu Date: Tue Jun 13 15:41:12 2023 +0800 erofs: make the size of read data stored in buffer_ofs Since now xattr_iter structures have been unified, make the size of the read data stored in buffer_ofs. Don't bother reusing buffer_size for this use, which may be confusing. This is in preparation for the following further cleanup. Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20230613074114.120115-4-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 8e823961de5a3b502f47a5461954024cc1433147 Author: Jingbo Xu Date: Tue Jun 13 15:41:11 2023 +0800 erofs: unify xattr_iter structures Unify xattr_iter/listxattr_iter/getxattr_iter structures into erofs_xattr_iter structure. This is in preparation for the following further cleanup. Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20230613074114.120115-3-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit eba67eb6de441909a22090bc77206c91134cd58c Author: Jingbo Xu Date: Tue Jun 13 15:41:10 2023 +0800 erofs: use absolute position in xattr iterator Replace blkaddr/ofs with pos in 'struct erofs_xattr_iter'. After erofs_bread() is introduced to replace raw page cache APIs for metadata I/Os handling, xattr_iter_fixup() is no longer needed anymore. In addition, it is also unnecessary to check if the iterated position is span over the block boundary as absolute offset is used instead of blkaddr + offset pairs. Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20230613074114.120115-2-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 001b8ccd0650727e54ec16ef72bf1b8eeab7168e Author: Gao Xiang Date: Thu Jun 1 19:23:41 2023 +0800 erofs: fix compact 4B support for 16k block size In compact 4B, two adjacent lclusters are packed together as a unit to form on-disk indexes for effective random access, as below: (amortized = 4, vcnt = 2) _____________________________________________ |___@_____ encoded bits __________|_ blkaddr _| 0 . amortized * vcnt = 8 . . . . amortized * vcnt - 4 = 4 . . .____________________________. |_type (2 bits)_|_clusterofs_| Therefore, encoded bits for each pack are 32 bits (4 bytes). IOWs, since each lcluster can get 16 bits for its type and clusterofs, the maximum supported lclustersize for compact 4B format is 16k (14 bits). Fix this to enable compact 4B format for 16k lclusters (blocks), which is tested on an arm64 server with 16k page size. Fixes: 152a333a5895 ("staging: erofs: add compacted compression indexes support") Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20230601112341.56960-1-hsiangkao@linux.alibaba.com commit 9c39ec0cff4e9373ab238120ca45a50c703dbb4e Author: Jingbo Xu Date: Thu Jun 1 10:43:42 2023 +0800 erofs: convert erofs_read_metabuf() to erofs_bread() for xattr buf->inode is constant once initialized during erofs_buf's lifetime. Thus call erofs_init_metabuf() and erofs_bread() separately to avoid the repetition of assigning buf->inode when iterating xattrs. Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20230601024347.108469-2-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 43d86ec93630396b622acf3f9cb88f734d4098e8 Author: Gao Xiang Date: Sat May 27 04:14:59 2023 +0800 erofs: use poison pointer to replace the hard-coded address It's safer and cleaner to replace such hard-coded illegal pointer with poison pointers. Signed-off-by: Gao Xiang Reviewed-by: Yue Hu Link: https://lore.kernel.org/r/20230526201459.128169-7-hsiangkao@linux.alibaba.com commit 7674a42f35ea302b97ff3659f2e6f28be23ac9b9 Author: Gao Xiang Date: Mon May 29 20:37:27 2023 +0800 erofs: use struct lockref to replace handcrafted approach Let's avoid the current handcrafted lockref although `struct lockref` inclusion usually increases extra 4 bytes with an explicit spinlock if CONFIG_DEBUG_SPINLOCK is off. Apart from the size difference, note that the meaning of refcount is also changed to active users. IOWs, it doesn't take an extra refcount for XArray tree insertion. I don't observe any significant performance difference at least on our cloud compute server but the new one indeed simplifies the overall codebase a bit. Signed-off-by: Gao Xiang Reviewed-by: Yue Hu Link: https://lore.kernel.org/r/20230529123727.79943-1-hsiangkao@linux.alibaba.com commit aee395bb190564a3fa22aa65c60812c25410e94a Author: Guenter Roeck Date: Wed Dec 28 05:57:44 2022 -0800 hwmon: (nct6755) Add support for NCT6799D NCT6799D is mostly compatible to NCT6798D, with minor variations. Note that NCT6798D and NCT6799D have a new means to select temperature sources, and to report temperatures from those sources. This is not currently implemented, meaning that most likely not all temperatures are reported. Cc: Sebastian Arnhold Cc: Ahmad Khalifa Signed-off-by: Guenter Roeck Tested-by: Sebastian Arnhold Tested-by: Corentin Labbe Link: https://lore.kernel.org/r/20221228135744.281752-1-linux@roeck-us.net commit be144ee49127216b456da26f1a32b6ba281ac505 Author: Joaquín Ignacio Aramendía Date: Sun Jun 11 11:33:20 2023 -0300 hwmon: (oxp-sensors) Add tt_toggle attribute on supported boards OneXPlayer boards from the last generation (both for OneXPlayer and AOK ZOE brands) have a toggle in the EC to switch the "Turbo/Silent" button into a different keyboard event. Add a means to use that "Turbo button takeover" function and expose it to userspace in a custom sysfs `tt_toggle` attribute. It can be read to take the current state. Write 1|0 to activate the function. The specific keycode is dependent on the board but can be checked by running `evtest` utility. Newer BIOS on the OneXPlayer added this function aside from string changes. Add a board enum to differentiate it from the old OneXplayer Mini AMD BIOS. Currently known supported boards: - AOK ZOE A1 - OneXPlayer Mini AMD (only newer BIOS version supported) - OneXPlayer Mini Pro Signed-off-by: Joaquín Ignacio Aramendía Link: https://lore.kernel.org/r/20230611143332.40590-2-samsagax@gmail.com Signed-off-by: Guenter Roeck commit c1362fd0f2fdebf5c56d505100ba37600b5c20a5 Merge: e2c510d6d630f 318afa0812049 Author: Conor Dooley Date: Sat Jun 17 19:08:14 2023 +0100 Merge patch series "Add Sipeed Lichee Pi 4A RISC-V board support" Jisheng Zhang says: Sipeed's Lichee Pi 4A development board uses Lichee Module 4A core module which is powered by T-HEAD's TH1520 SoC. Add minimal device tree files for the core module and the development board. Support basic uart/gpio/dmac drivers, so supports booting to a basic shell. This also pulls in -rc2, because of some maintainers re-jigging that went on in the interim in commit 80e62bc8487b ("MAINTAINERS: re-sort all entries and fields"). Link: https://lore.kernel.org/r/20230617161529.2092-1-jszhang@kernel.org Signed-off-by: Conor Dooley commit 318afa0812049ddaff644482b035ab861d2a920c Author: Jisheng Zhang Date: Sun Jun 18 00:15:29 2023 +0800 riscv: defconfig: enable T-HEAD SoC Enable T-HEAD SoC config in defconfig to allow the default upstream kernel to boot on Sipeed Lichee Pi 4A board. Signed-off-by: Jisheng Zhang Reviewed-by: Conor Dooley Acked-by: Palmer Dabbelt Acked-by: Guo Ren Signed-off-by: Conor Dooley commit 1203f584fe66522b0cf294424a35b4cfbc747d71 Author: Jisheng Zhang Date: Sun Jun 18 00:15:28 2023 +0800 MAINTAINERS: add entry for T-HEAD RISC-V SoC Currently, I would like to maintain the T-HEAD RISC-V SoC support. Signed-off-by: Jisheng Zhang Acked-by: Conor Dooley Signed-off-by: Conor Dooley commit 5af4cb0c42c5ee084c40ae37f6ecce839b4f65bc Author: Jisheng Zhang Date: Sun Jun 18 00:15:27 2023 +0800 riscv: dts: thead: add sipeed Lichee Pi 4A board device tree Sipeed's Lichee Pi 4A development board uses Lichee Module 4A core module which is powered by T-HEAD's TH1520 SoC. Add minimal device tree files for the core module and the development board. Support basic uart/gpio/dmac drivers, so supports booting to a basic shell. Signed-off-by: Jisheng Zhang Signed-off-by: Conor Dooley commit 8e396880a864b80381b3f402e36d9c428422315b Author: Jisheng Zhang Date: Sun Jun 18 00:15:26 2023 +0800 riscv: dts: add initial T-HEAD TH1520 SoC device tree Add initial device tree for the TH1520 RISC-V SoC by T-HEAD. Signed-off-by: Jisheng Zhang Signed-off-by: Conor Dooley commit da47ce0039632d2e82ee70a86079d7a8b4c92103 Author: Jisheng Zhang Date: Sun Jun 18 00:15:25 2023 +0800 riscv: Add the T-HEAD SoC family Kconfig option The first SoC in the T-HEAD series is TH1520, containing quad T-HEAD C910 cores. Signed-off-by: Jisheng Zhang Reviewed-by: Conor Dooley Signed-off-by: Conor Dooley commit 89b0186ab5325fa70852b42d7b0012bb2a1a4891 Author: Jisheng Zhang Date: Sun Jun 18 00:15:24 2023 +0800 dt-bindings: riscv: Add T-HEAD TH1520 board compatibles Several SoMs and boards are available that feature the T-HEAD TH1520 SoC. Document the compatible strings. Signed-off-by: Jisheng Zhang Signed-off-by: Conor Dooley commit 413c24b03f4e50f7e8000079d51122e44d8a8f64 Author: Jisheng Zhang Date: Sun Jun 18 00:15:23 2023 +0800 dt-bindings: timer: Add T-HEAD TH1520 clint Add compatible string for the T-HEAD TH1520 clint. Signed-off-by: Jisheng Zhang Reviewed-by: Conor Dooley Signed-off-by: Conor Dooley commit a04cc7391d88a6e857611f009d30f49b7551daf3 Author: Jisheng Zhang Date: Sun Jun 18 00:15:22 2023 +0800 dt-bindings: interrupt-controller: Add T-HEAD's TH1520 PLIC Add compatible string for T-HEAD TH1520 plic. Signed-off-by: Jisheng Zhang Reviewed-by: Conor Dooley Reviewed-by: Guo Ren Signed-off-by: Conor Dooley commit 00a87e5d1d67ada9fc2d3a1f6407ae339b425bce Author: Chuck Lever Date: Fri Jun 16 09:19:45 2023 -0400 SUNRPC: Address RCU warning in net/sunrpc/svc.c $ make C=1 W=1 net/sunrpc/svc.o make[1]: Entering directory 'linux/obj/manet.1015granger.net' GEN Makefile CALL linux/server-development/scripts/checksyscalls.sh DESCEND objtool INSTALL libsubcmd_headers DESCEND bpf/resolve_btfids INSTALL libsubcmd_headers CC [M] net/sunrpc/svc.o CHECK linux/server-development/net/sunrpc/svc.c linux/server-development/net/sunrpc/svc.c:1225:9: warning: incorrect type in argument 1 (different address spaces) linux/server-development/net/sunrpc/svc.c:1225:9: expected struct spinlock [usertype] *lock linux/server-development/net/sunrpc/svc.c:1225:9: got struct spinlock [noderef] __rcu * linux/server-development/net/sunrpc/svc.c:1227:40: warning: incorrect type in argument 1 (different address spaces) linux/server-development/net/sunrpc/svc.c:1227:40: expected struct spinlock [usertype] *lock linux/server-development/net/sunrpc/svc.c:1227:40: got struct spinlock [noderef] __rcu * make[1]: Leaving directory 'linux/obj/manet.1015granger.net' Warning introduced by commit 913292c97d75 ("sched.h: Annotate sighand_struct with __rcu"). Signed-off-by: Chuck Lever commit a9156d7e7d6a811a0ac1a2bc9ab6006bb928e871 Author: Azeem Shaikh Date: Wed Jun 14 13:37:57 2023 +0000 SUNRPC: Use sysfs_emit in place of strlcpy/sprintf Part of an effort to remove strlcpy() tree-wide [1]. Direct replacement is safe here since the getter in kernel_params_ops handles -errno return [2]. [1] https://github.com/KSPP/linux/issues/89 [2] https://elixir.bootlin.com/linux/v6.4-rc6/source/include/linux/moduleparam.h#L52 Signed-off-by: Azeem Shaikh Signed-off-by: Chuck Lever commit 6c53da5d66b1f0d30b1039e14eed943efe377805 Author: Chuck Lever Date: Mon Jun 12 10:14:10 2023 -0400 SUNRPC: Remove transport class dprintk call sites Remove a couple of dprintk call sites that are of little value. Reviewed-by: Jeff Layton Acked-by: Tom Talpey Signed-off-by: Chuck Lever commit 02cea33f56241819f72edbd8f470a45e720d9ca3 Author: Chuck Lever Date: Mon Jun 12 10:14:04 2023 -0400 SUNRPC: Fix comments for transport class registration The preceding block comment before svc_register_xprt_class() is not related to that function. While we're here, add proper documenting comments for these two publicly-visible functions. Reviewed-by: Jeff Layton Acked-by: Tom Talpey Signed-off-by: Chuck Lever commit b55c63332e9a33833d3daedb83bc1fbbcfc00e1c Author: Chuck Lever Date: Mon Jun 12 10:13:58 2023 -0400 svcrdma: Remove an unused argument from __svc_rdma_put_rw_ctxt() Clean up. Reviewed-by: Jeff Layton Acked-by: Tom Talpey Signed-off-by: Chuck Lever commit a23c76e92d8215456ca2fbd5cf6c1ff71b744c1d Author: Chuck Lever Date: Mon Jun 12 10:13:51 2023 -0400 svcrdma: trace cc_release calls This event brackets the svcrdma_post_* trace points. If this trace event is enabled but does not appear as expected, that indicates a chunk_ctxt leak. Reviewed-by: Jeff Layton Acked-by: Tom Talpey Signed-off-by: Chuck Lever commit 91f8ce28466e480fd9ef27e028ac89dbfd264c24 Author: Chuck Lever Date: Mon Jun 12 10:13:45 2023 -0400 svcrdma: Convert "might sleep" comment into a code annotation Try to catch incorrect calling contexts mechanically rather than by code review. Reviewed-by: Jeff Layton Acked-by: Tom Talpey Signed-off-by: Chuck Lever commit 262176798b18b12fd8ab84c94cfece0a6a652476 Author: Chuck Lever Date: Mon Jun 12 10:13:39 2023 -0400 NFSD: Add an nfsd4_encode_nfstime4() helper Clean up: de-duplicate some common code. Reviewed-by: Jeff Layton Acked-by: Tom Talpey Signed-off-by: Chuck Lever commit f8335a212ac1495da3e9d98ff46c4bcd6a359011 Author: Chuck Lever Date: Mon Jun 12 10:13:33 2023 -0400 SUNRPC: Move initialization of rq_stime Micro-optimization: Call ktime_get() only when ->xpo_recvfrom() has given us a full RPC message to process. rq_stime isn't used otherwise, so this avoids pointless work. Reviewed-by: Jeff Layton Acked-by: Tom Talpey Signed-off-by: Chuck Lever commit 5581cf8efc3863e3831a3ee50854e823ec618df8 Author: Chuck Lever Date: Mon Jun 12 10:10:27 2023 -0400 SUNRPC: Optimize page release in svc_rdma_sendto() Now that we have bulk page allocation and release APIs, it's more efficient to use those than it is for nfsd threads to wait for send completions. Previous patches have eliminated the calls to wait_for_completion() and complete(), in order to avoid scheduler overhead. Now release pages-under-I/O in the send completion handler using the efficient bulk release API. I've measured a 7% reduction in cumulative CPU utilization in svc_rdma_sendto(), svc_rdma_wc_send(), and svc_xprt_release(). In particular, using release_pages() instead of complete() cuts the time per svc_rdma_wc_send() call by two-thirds. This helps improve scalability because svc_rdma_wc_send() is single-threaded per connection. Reviewed-by: Tom Talpey Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit baf6d18b116b7dc84ed5e212c3a89f17cdc3f28c Author: Chuck Lever Date: Mon Jun 12 10:10:20 2023 -0400 svcrdma: Prevent page release when nothing was received I noticed that svc_rqst_release_pages() was still unnecessarily releasing a page when svc_rdma_recvfrom() returns zero. Fixes: a53d5cb0646a ("svcrdma: Avoid releasing a page in svc_xprt_release()") Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit fbb5a7fee063fe97009ff28df8cd0e4af3202683 Author: JuenKit Yip Date: Sat Jun 17 00:00:17 2023 +0800 hwmon: (sht3x) complement sysfs interface for sts3x Compared to sht3x, sts3x has the similar functions and operations but it has no humidity sensor. Signed-off-by: JuenKit Yip Link: https://lore.kernel.org/r/DB4PR10MB6261B912ADFA6BB78240596F9258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM Signed-off-by: Guenter Roeck commit af5ab550125f1bbae0ba89ed8e1994a11f40b96a Author: JuenKit Yip Date: Sat Jun 17 00:00:16 2023 +0800 hwmon: (sht3x) Add new non-stardard sysfs attribute Add "repeatability" attribute to sysfs, it could be read or written to control the sensor. Signed-off-by: JuenKit Yip Link: https://lore.kernel.org/r/DB4PR10MB6261B507C7656E3568DA33E39258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM [groeck: Fixed multi-line alignment; dropped check of unsigned against < 0] Signed-off-by: Guenter Roeck commit 3d2c211c0d2b5955b4ec9a1af7d59e8bed00c7fe Author: JuenKit Yip Date: Sat Jun 17 00:00:15 2023 +0800 hwmon: (sht3x) add medium repeatability support Add support for medium repeatability. Per datasheet: The stated repeatability is 3 times the standard deviation (3σ) of multiple consecutive measurements at the stated repeatability and at constant ambient conditions. It is a measure for the noise on the physical sensor output. Different measurement modes allow for high/medium/low repeatability. For the humidity sensor, repeatability is documented as 0.25% RH for low repeatability, 0.15% RH for medium repeatability, and 0.10% RH for high repeatability. Support all three modes. Signed-off-by: JuenKit Yip Link: https://lore.kernel.org/r/DB4PR10MB6261A70CD0444248ADDCC3219258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM [groeck: Added details to description] Signed-off-by: Guenter Roeck commit 7d6d53ba3bccc5497e5bda5da4868c410f3eaa02 Author: JuenKit Yip Date: Sat Jun 17 00:00:14 2023 +0800 hwmon: (sht3x)replace "high-precision" property to "repeatability" Replace use of "precision" with "repeatability" to match datasheet terminology. No functional change. Signed-off-by: JuenKit Yip Link: https://lore.kernel.org/r/DB4PR10MB626113BFFA66DE32C3479D229258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM [groeck: Added commit description] Signed-off-by: Guenter Roeck commit 5bca68ac63571b67f905b45f6caffd12f8ab80b7 Author: JuenKit Yip Date: Sat Jun 17 00:00:13 2023 +0800 hwmon: (sht3x) remove blocking_io property Due to no support on clock-strench, blocking mode was removed and now single-shot mode only uses non-blocking mode. Signed-off-by: JuenKit Yip Link: https://lore.kernel.org/r/DB4PR10MB6261DA9202AF37B4F6ECDD6C9258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM Signed-off-by: Guenter Roeck commit fc669e922ecff02c173a8484f7a5ed4810089209 Author: JuenKit Yip Date: Sat Jun 17 00:00:12 2023 +0800 hwmon: (sht3x) remove sht3x_platform_data Since no in-tree driver supports it, sht3x_platform_data has been removed and the relevant properties have been moved to sht3x_data. Signed-off-by: JuenKit Yip Link: https://lore.kernel.org/r/DB4PR10MB626126FB7226D5AF341197449258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM Signed-off-by: Guenter Roeck commit f99bbb4412ceffba7e85b9a9227de44c214c68ca Author: Prathu Baronia Date: Fri Jun 16 20:56:00 2023 +0530 axis-fifo: remove the unnecessary dev_info() This dev_info() statement is not needed since drivers need to be quiet under normal operation and its not a good idea to print addresses in kernel log. Signed-off-by: Prathu Baronia Message-ID: <20230616152602.33232-2-prathubaronia2011@gmail.com> Signed-off-by: Greg Kroah-Hartman commit 424a64a2bbc6014c76b9ef6356d38ad8e66d95ad Author: Hui Wang Date: Thu Jun 16 12:00:46 2022 +0800 ASoC: bindings: fsl-asoc-card: add compatible string for nau8822 codec The nau8822 codec is used on an imx6sx EVB. Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/Message-Id: <20220616040046.103524-2-hui.wang@canonical.com> Signed-off-by: Mark Brown commit 1075df4bdeb320bbf94a1f6d3761391264eb2c7f Author: Hui Wang Date: Thu Jun 16 12:00:45 2022 +0800 ASoC: fsl-asoc-card: add nau8822 support This is for an imx6sx EVB which has a nau8822 codec connects to the SSI2 interface, so add the nau8822 support in this machine driver. Because the codec driver nau8822.c doesn't handle mclk enabling, here adding a codec_priv->mclk for nau8822 and similar codecs which need to enable the mclk in the machine driver, and enable the mclk in the card_late_probe() conditionally. Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/Message-Id: <20220616040046.103524-1-hui.wang@canonical.com> Signed-off-by: Mark Brown commit 320d0e2db9edcde026aac93359624c1d429cb865 Author: Tom Rix Date: Sat Jun 17 08:26:35 2023 -0400 ASoC: max98388: set variable soc_codec_dev_max98388 storage-class-specifier to static smatch reports sound/soc/codecs/max98388.c:890:39: warning: symbol 'soc_codec_dev_max98388' was not declared. Should it be static? This variable is only used in its defining file, so it should be static. Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/Message-Id: <20230617122635.3225639-1-trix@redhat.com> Signed-off-by: Mark Brown commit b650d953cd391595e536153ce30b4aab385643ac Author: mfreemon@cloudflare.com Date: Sun Jun 11 22:05:24 2023 -0500 tcp: enforce receive buffer memory limits by allowing the tcp window to shrink Under certain circumstances, the tcp receive buffer memory limit set by autotuning (sk_rcvbuf) is increased due to incoming data packets as a result of the window not closing when it should be. This can result in the receive buffer growing all the way up to tcp_rmem[2], even for tcp sessions with a low BDP. To reproduce: Connect a TCP session with the receiver doing nothing and the sender sending small packets (an infinite loop of socket send() with 4 bytes of payload with a sleep of 1 ms in between each send()). This will cause the tcp receive buffer to grow all the way up to tcp_rmem[2]. As a result, a host can have individual tcp sessions with receive buffers of size tcp_rmem[2], and the host itself can reach tcp_mem limits, causing the host to go into tcp memory pressure mode. The fundamental issue is the relationship between the granularity of the window scaling factor and the number of byte ACKed back to the sender. This problem has previously been identified in RFC 7323, appendix F [1]. The Linux kernel currently adheres to never shrinking the window. In addition to the overallocation of memory mentioned above, the current behavior is functionally incorrect, because once tcp_rmem[2] is reached when no remediations remain (i.e. tcp collapse fails to free up any more memory and there are no packets to prune from the out-of-order queue), the receiver will drop in-window packets resulting in retransmissions and an eventual timeout of the tcp session. A receive buffer full condition should instead result in a zero window and an indefinite wait. In practice, this problem is largely hidden for most flows. It is not applicable to mice flows. Elephant flows can send data fast enough to "overrun" the sk_rcvbuf limit (in a single ACK), triggering a zero window. But this problem does show up for other types of flows. Examples are websockets and other type of flows that send small amounts of data spaced apart slightly in time. In these cases, we directly encounter the problem described in [1]. RFC 7323, section 2.4 [2], says there are instances when a retracted window can be offered, and that TCP implementations MUST ensure that they handle a shrinking window, as specified in RFC 1122, section 4.2.2.16 [3]. All prior RFCs on the topic of tcp window management have made clear that sender must accept a shrunk window from the receiver, including RFC 793 [4] and RFC 1323 [5]. This patch implements the functionality to shrink the tcp window when necessary to keep the right edge within the memory limit by autotuning (sk_rcvbuf). This new functionality is enabled with the new sysctl: net.ipv4.tcp_shrink_window Additional information can be found at: https://blog.cloudflare.com/unbounded-memory-usage-by-tcp-for-receive-buffers-and-how-we-fixed-it/ [1] https://www.rfc-editor.org/rfc/rfc7323#appendix-F [2] https://www.rfc-editor.org/rfc/rfc7323#section-2.4 [3] https://www.rfc-editor.org/rfc/rfc1122#page-91 [4] https://www.rfc-editor.org/rfc/rfc793 [5] https://www.rfc-editor.org/rfc/rfc1323 Signed-off-by: Mike Freemon Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit a52305a81d6bb74b90b400dfa56455d37872fe4b Author: Petr Oros Date: Thu Jun 15 11:54:47 2023 +0200 devlink: report devlink_port_type_warn source device devlink_port_type_warn is scheduled for port devlink and warning when the port type is not set. But from this warning it is not easy found out which device (driver) has no devlink port set. [ 3709.975552] Type was not set for devlink port. [ 3709.975579] WARNING: CPU: 1 PID: 13092 at net/devlink/leftover.c:6775 devlink_port_type_warn+0x11/0x20 [ 3709.993967] Modules linked in: openvswitch nf_conncount nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nfnetlink bluetooth rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs lockd grace fscache netfs vhost_net vhost vhost_iotlb tap tun bridge stp llc qrtr intel_rapl_msr intel_rapl_common i10nm_edac nfit libnvdimm x86_pkg_temp_thermal mlx5_ib intel_powerclamp coretemp dell_wmi ledtrig_audio sparse_keymap ipmi_ssif kvm_intel ib_uverbs rfkill ib_core video kvm iTCO_wdt acpi_ipmi intel_vsec irqbypass ipmi_si iTCO_vendor_support dcdbas ipmi_devintf mei_me ipmi_msghandler rapl mei intel_cstate isst_if_mmio isst_if_mbox_pci dell_smbios intel_uncore isst_if_common i2c_i801 dell_wmi_descriptor wmi_bmof i2c_smbus intel_pch_thermal pcspkr acpi_power_meter xfs libcrc32c sd_mod sg nvme_tcp mgag200 i2c_algo_bit nvme_fabrics drm_shmem_helper drm_kms_helper nvme syscopyarea ahci sysfillrect sysimgblt nvme_core fb_sys_fops crct10dif_pclmul libahci mlx5_core sfc crc32_pclmul nvme_common drm [ 3709.994030] crc32c_intel mtd t10_pi mlxfw libata tg3 mdio megaraid_sas psample ghash_clmulni_intel pci_hyperv_intf wmi dm_multipath sunrpc dm_mirror dm_region_hash dm_log dm_mod be2iscsi bnx2i cnic uio cxgb4i cxgb4 tls libcxgbi libcxgb qla4xxx iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi fuse [ 3710.108431] CPU: 1 PID: 13092 Comm: kworker/1:1 Kdump: loaded Not tainted 5.14.0-319.el9.x86_64 #1 [ 3710.108435] Hardware name: Dell Inc. PowerEdge R750/0PJ80M, BIOS 1.8.2 09/14/2022 [ 3710.108437] Workqueue: events devlink_port_type_warn [ 3710.108440] RIP: 0010:devlink_port_type_warn+0x11/0x20 [ 3710.108443] Code: 84 76 fe ff ff 48 c7 03 20 0e 1a ad 31 c0 e9 96 fd ff ff 66 0f 1f 44 00 00 0f 1f 44 00 00 48 c7 c7 18 24 4e ad e8 ef 71 62 ff <0f> 0b c3 cc cc cc cc 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 f6 87 [ 3710.108445] RSP: 0018:ff3b6d2e8b3c7e90 EFLAGS: 00010282 [ 3710.108447] RAX: 0000000000000000 RBX: ff366d6580127080 RCX: 0000000000000027 [ 3710.108448] RDX: 0000000000000027 RSI: 00000000ffff86de RDI: ff366d753f41f8c8 [ 3710.108449] RBP: ff366d658ff5a0c0 R08: ff366d753f41f8c0 R09: ff3b6d2e8b3c7e18 [ 3710.108450] R10: 0000000000000001 R11: 0000000000000023 R12: ff366d753f430600 [ 3710.108451] R13: ff366d753f436900 R14: 0000000000000000 R15: ff366d753f436905 [ 3710.108452] FS: 0000000000000000(0000) GS:ff366d753f400000(0000) knlGS:0000000000000000 [ 3710.108453] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 3710.108454] CR2: 00007f1c57bc74e0 CR3: 000000111d26a001 CR4: 0000000000773ee0 [ 3710.108456] PKRU: 55555554 [ 3710.108457] Call Trace: [ 3710.108458] [ 3710.108459] process_one_work+0x1e2/0x3b0 [ 3710.108466] ? rescuer_thread+0x390/0x390 [ 3710.108468] worker_thread+0x50/0x3a0 [ 3710.108471] ? rescuer_thread+0x390/0x390 [ 3710.108473] kthread+0xdd/0x100 [ 3710.108477] ? kthread_complete_and_exit+0x20/0x20 [ 3710.108479] ret_from_fork+0x1f/0x30 [ 3710.108485] [ 3710.108486] ---[ end trace 1b4b23cd0c65d6a0 ]--- After patch: [ 402.473064] ice 0000:41:00.0: Type was not set for devlink port. [ 402.473064] ice 0000:41:00.1: Type was not set for devlink port. Signed-off-by: Petr Oros Reviewed-by: Pavan Chebbi Reviewed-by: Jakub Kicinski Link: https://lore.kernel.org/r/20230615095447.8259-1-poros@redhat.com Signed-off-by: Jakub Kicinski commit f60ce8a48b97eb970bfbec1f26c914b9017c4a46 Author: Lin Ma Date: Thu Jun 15 23:22:40 2023 +0800 net: mctp: remove redundant RTN_UNICAST check Current mctp_newroute() contains two exactly same check against rtm->rtm_type static int mctp_newroute(...) { ... if (rtm->rtm_type != RTN_UNICAST) { // (1) NL_SET_ERR_MSG(extack, "rtm_type must be RTN_UNICAST"); return -EINVAL; } ... if (rtm->rtm_type != RTN_UNICAST) // (2) return -EINVAL; ... } This commits removes the (2) check as it is redundant. Signed-off-by: Lin Ma Reviewed-by: Pavan Chebbi Acked-by: Jeremy Kerr Link: https://lore.kernel.org/r/20230615152240.1749428-1-linma@zju.edu.cn Signed-off-by: Jakub Kicinski commit 6907217a8054b8afc47b3944afc7d77ad5caf824 Author: Donald Hunter Date: Thu Jun 15 16:14:05 2023 +0100 netlink: specs: fixup openvswitch specs for code generation Refine the ovs_* specs to align exactly with the ovs netlink UAPI definitions to enable code generation. Signed-off-by: Donald Hunter Link: https://lore.kernel.org/r/20230615151405.77649-1-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski commit e16ad981e2a1e4a9afd1ce0d7a47cd9d8f09feda Author: YueHaibing Date: Thu Jun 15 20:48:10 2023 +0800 net: sched: Remove unused qdisc_l2t() This is unused since switch to psched_l2t_ns(). Signed-off-by: YueHaibing Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230615124810.34020-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski commit 9f8d0dc0ec4a4b5b78c0be83238c4511ff5f1ae0 Author: David Howells Date: Thu Jun 15 12:32:02 2023 +0100 kcm: Fix unnecessary psock unreservation. kcm_write_msgs() calls unreserve_psock() to release its hold on the underlying TCP socket if it has run out of things to transmit, but if we have nothing in the write queue on entry (e.g. because someone did a zero-length sendmsg), we don't actually go into the transmission loop and as a consequence don't call reserve_psock(). Fix this by skipping the call to unreserve_psock() if we didn't reserve a psock. Fixes: c31a25e1db48 ("kcm: Send multiple frags in one sendmsg()") Reported-by: syzbot+dd1339599f1840e4cc65@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/000000000000a61ffe05fe0c3d08@google.com/ Signed-off-by: David Howells Tested-by: syzbot+dd1339599f1840e4cc65@syzkaller.appspotmail.com cc: Tom Herbert cc: Tom Herbert cc: Jens Axboe cc: Matthew Wilcox Link: https://lore.kernel.org/r/20787.1686828722@warthog.procyon.org.uk Signed-off-by: Jakub Kicinski commit 4848229494a323eeaab62eee5574ef9f7de80374 Author: John Paul Adrian Glaubitz Date: Wed May 10 18:33:42 2023 +0200 irqchip/jcore-aic: Fix missing allocation of IRQ descriptors The initialization function for the J-Core AIC aic_irq_of_init() is currently missing the call to irq_alloc_descs() which allocates and initializes all the IRQ descriptors. Add missing function call and return the error code from irq_alloc_descs() in case the allocation fails. Fixes: 981b58f66cfc ("irqchip/jcore-aic: Add J-Core AIC driver") Signed-off-by: John Paul Adrian Glaubitz Tested-by: Rob Landley Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230510163343.43090-1-glaubitz@physik.fu-berlin.de commit 48f31e496488a25f443c0df52464da446fb1d10c Author: Antonio Borneo Date: Thu Jun 1 17:56:14 2023 +0200 irqchip/stm32-exti: Fix warning on initialized field overwritten While compiling with W=1, both gcc and clang complain about a tricky way to initialize an array by filling it with a non-zero value and then overrride some of the array elements. In this case the override is intentional, so just disable the specific warning for only this part of the code. Note: the flag "-Woverride-init" is recognized by both compilers, but the warning msg from clang reports "-Winitializer-overrides". The doc of clang clarifies that the two flags are synonyms, so use here only the flag name common on both compilers. Signed-off-by: Antonio Borneo Fixes: c297493336b7 ("irqchip/stm32-exti: Simplify irq description table") Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230601155614.34490-1-antonio.borneo@foss.st.com commit 1c5187968846fd252d42924fd54f3aad5a6ad7ff Author: Marek Vasut Date: Wed May 17 21:43:47 2023 +0200 irqchip/stm32-exti: Add STM32MP15xx IWDG2 EXTI to GIC map The EXTI interrupt 46 is mapped to GIC interrupt 151. Add the missing mapping, which is used for IWDG2 pretimeout interrupt and wake up source. Reviewed-by: Antonio Borneo Signed-off-by: Marek Vasut Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230517194349.105745-1-marex@denx.de commit 415e84294798d1cb041c902168393054cc4ad211 Author: Arnd Bergmann Date: Tue May 16 22:05:08 2023 +0200 irqchip/gicv3: Add a iort_pmsi_get_dev_id() prototype iort_pmsi_get_dev_id() has a __weak definition in the driver, and an override in arm64 specific code, but the declaration is conditional and not always seen when the copy in the driver gets built: drivers/irqchip/irq-gic-v3-its-platform-msi.c:41:12: error: no previous prototype for 'iort_pmsi_get_dev_id' [-Werror=missing-prototypes] Move the existing declaration out of the #ifdef block to ensure it can be seen in all configurations. Signed-off-by: Arnd Bergmann Reviewed-by: Hanjun Guo Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230516200516.554663-5-arnd@kernel.org commit 5b7e5676209120814dbb9fec8bc3769f0f7a7958 Author: Arnd Bergmann Date: Tue May 16 22:05:07 2023 +0200 irqchip/mxs: Include linux/irqchip/mxs.h This header contains the definition for icoll_handle_irq(), which is used in arch/arm/mach-mxs/mach-mxs.c, without this we get a warning about a missing prototype when building with W=1. Signed-off-by: Arnd Bergmann Acked-by: Shawn Guo Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230516200516.554663-4-arnd@kernel.org commit eee284fe8f326719fed1963e0851cbb2185076f8 Author: Arnd Bergmann Date: Tue May 16 22:05:06 2023 +0200 irqchip/clps711x: Remove unused clps711x_intc_init() function This function has no caller or declaration any more: drivers/irqchip/irq-clps711x.c:215:13: error: no previous prototype for 'clps711x_intc_init' The #ifdef check around clps711x_intc_init_dt() is also not needed since the file is only built when that is enabled. Fixes: 4a56f46a7dc6 ("ARM: clps711x: Remove boards support") Signed-off-by: Arnd Bergmann Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230516200516.554663-3-arnd@kernel.org commit f1771b85e3086c9506c3de81e993330bca568ba5 Author: Arnd Bergmann Date: Tue May 16 22:05:05 2023 +0200 irqchip/mmp: Remove non-DT codepath Building with "W=1" warns about missing declarations for two functions in the mmp irqchip driver: drivers/irqchip/irq-mmp.c:248:13: error: no previous prototype for 'icu_init_irq' drivers/irqchip/irq-mmp.c:271:13: error: no previous prototype for 'mmp2_init_icu' The declarations are present in an unused header, but since there is no caller, it's best to just remove the functions and the header completely, making the driver DT-only to match the state of the platform. Fixes: 77acc85ce797 ("ARM: mmp: remove device definitions") Signed-off-by: Arnd Bergmann Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230516200516.554663-2-arnd@kernel.org commit 97bb0f8e847c0ea6bf926c4e3b7633dd6acfabf2 Author: Arnd Bergmann Date: Tue May 16 22:05:04 2023 +0200 irqchip/ftintc010: Mark all function static Two functions were always global but never had any callers outside of this file: drivers/irqchip/irq-ftintc010.c:128:39: error: no previous prototype for 'ft010_irqchip_handle_irq' drivers/irqchip/irq-ftintc010.c:165:12: error: no previous prototype for 'ft010_of_init_irq' Fixes: b4d3053c8ce9 ("irqchip: Add a driver for Cortina Gemini") Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230516200516.554663-1-arnd@kernel.org commit 8091f56ee4e51037662590edc0b0e44807fbab4d Author: Arnd Bergmann Date: Tue May 16 22:04:28 2023 +0200 irqdomain: Include internals.h for function prototypes irq_domain_debugfs_init() is defined in irqdomain.c, but the declaration is in a header that is not included here: kernel/irq/irqdomain.c:1965:13: error: no previous prototype for 'irq_domain_debugfs_init' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230516200432.554240-1-arnd@kernel.org commit e0b78e9fa34102ce82ef03c71eb13f0b79954ba3 Merge: d59b553fefa94 a3f1132c4c6be Author: Marc Zyngier Date: Sat Jun 17 07:17:53 2023 +0100 Merge branch irq/loongarch-fixes-6.5 into irq/irqchip-next * irq/loongarch-fixes-6.5: : . : Yet another series of random fixes for the Loongson/Loongarch : string of interrupt controller, covering : : - affinity setting, : - trigger polarity, : - wake-up, : - DT support : . irqchip/loongson-eiointc: Add DT init support dt-bindings: interrupt-controller: Add Loongson EIOINTC irqchip/loongson-eiointc: Fix irq affinity setting during resume irqchip/loongson-liointc: Add IRQCHIP_SKIP_SET_WAKE flag irqchip/loongson-liointc: Fix IRQ trigger polarity irqchip/loongson-pch-pic: Fix potential incorrect hwirq assignment irqchip/loongson-pch-pic: Fix initialization of HT vector register Signed-off-by: Marc Zyngier commit a3f1132c4c6be3ab5af1a2ae1885deda81539277 Author: Binbin Zhou Date: Fri May 5 17:46:49 2023 +0800 irqchip/loongson-eiointc: Add DT init support Add EIOINTC irqchip DT support, which is needed for Loongson chips based on DT and supporting EIOINTC, such as the Loongson-2K0500 SOC. Signed-off-by: Binbin Zhou Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/764e02d924094580ac0f1d15535f4b98308705c6.1683279769.git.zhoubinbin@loongson.cn commit 2c23c07a359649b7a053c1af320044329768b1fd Author: Binbin Zhou Date: Fri May 5 17:46:48 2023 +0800 dt-bindings: interrupt-controller: Add Loongson EIOINTC Add Loongson Extended I/O Interrupt controller binding with DT schema format using json-schema. Signed-off-by: Binbin Zhou Reviewed-by: Rob Herring Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/4369959615eda101e612c450b8974d76ce7e8821.1683279769.git.zhoubinbin@loongson.cn commit b1356ed1a4461de06dfdc02bf549c3e8750162e5 Author: Claudiu Beznea Date: Tue May 30 12:39:13 2023 +0300 clk: clocking-wizard: check return value of devm_kasprintf() devm_kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: 2046338dcbc6 ("ARM: mxs: Use soc bus infrastructure") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230530093913.1656095-9-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd commit bd46cd0b802d9c9576ca78007aa084ae3e74907b Author: Claudiu Beznea Date: Tue May 30 12:39:12 2023 +0300 clk: ti: clkctrl: check return value of kasprintf() kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: 852049594b9a ("clk: ti: clkctrl: convert subclocks to use proper names also") Fixes: 6c3090520554 ("clk: ti: clkctrl: Fix hidden dependency to node name") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230530093913.1656095-8-claudiu.beznea@microchip.com Reviewed-by: Tony Lindgren Signed-off-by: Stephen Boyd commit b73ed981da6d25c921aaefa7ca3df85bbd85b7fc Author: Claudiu Beznea Date: Tue May 30 12:39:11 2023 +0300 clk: keystone: sci-clk: check return value of kasprintf() kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: b745c0794e2f ("clk: keystone: Add sci-clk driver support") Depends-on: 96488c09b0f4 ("clk: keystone: sci-clk: cut down the clock name length") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230530093913.1656095-7-claudiu.beznea@microchip.com Reviewed-by: Tony Lindgren Signed-off-by: Stephen Boyd commit 267ad94b13c53d8c99a336f0841b1fa1595b1d0f Author: Claudiu Beznea Date: Tue May 30 12:39:10 2023 +0300 clk: si5341: free unused memory on probe failure Pointers from synth_clock_names[] should be freed at the end of probe either on probe success or failure path. Fixes: b7bbf6ec4940 ("clk: si5341: Allow different output VDD_SEL values") Fixes: 9b13ff4340df ("clk: si5341: Add sysfs properties to allow checking/resetting device faults") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230530093913.1656095-6-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd commit 36e4ef82016a2b785cf2317eade77e76699b7bff Author: Claudiu Beznea Date: Tue May 30 12:39:09 2023 +0300 clk: si5341: check return value of {devm_}kasprintf() {devm_}kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: 3044a860fd09 ("clk: Add Si5341/Si5340 driver") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230530093913.1656095-5-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd commit 2560114c06d7a752b3f4639f28cece58fed11267 Author: Claudiu Beznea Date: Tue May 30 12:39:08 2023 +0300 clk: si5341: return error if one synth clock registration fails In case devm_clk_hw_register() fails for one of synth clocks the probe continues. Later on, when registering output clocks which have as parents all the synth clocks, in case there is registration failure for at least one synth clock the information passed to clk core for registering output clock is not right: init.num_parents is fixed but init.parents may contain an array with less parents. Fixes: 3044a860fd09 ("clk: Add Si5341/Si5340 driver") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230530093913.1656095-4-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd commit bb7d09ddbf361d51eae46f38e7c8a2b85914ea2a Author: Claudiu Beznea Date: Tue May 30 12:39:07 2023 +0300 clk: cdce925: check return value of kasprintf() kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: 19fbbbbcd3a3 ("Add TI CDCE925 I2C controlled clock synthesizer driver") Depends-on: e665f029a283 ("clk: Convert to using %pOFn instead of device_node.name") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230530093913.1656095-3-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd commit 144601f6228de5598f03e693822b60a95c367a17 Author: Claudiu Beznea Date: Tue May 30 12:39:06 2023 +0300 clk: vc5: check memory returned by kasprintf() kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: f491276a5168 ("clk: vc5: Allow Versaclock driver to support multiple instances") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230530093913.1656095-2-claudiu.beznea@microchip.com Reviewed-by: Luca Ceresoli Signed-off-by: Stephen Boyd commit fa375646241b5350f7326fd4d686891b95d9fbe5 Author: Mike Snitzer Date: Fri Jun 16 17:21:24 2023 -0400 dm thin: disable discards for thin-pool if no_discard_passdown Also rename disable_passdown_if_not_supported to disable_discard_passdown_if_not_supported. And fold passdown_enabled() into only caller. Signed-off-by: Mike Snitzer commit 862c6663c12ba217e8e920dc6dd158383ea5cf76 Author: Mike Snitzer Date: Thu Jun 15 16:41:20 2023 -0400 dm: remove stale/redundant dm_internal_{suspend,resume} prototypes in dm.h dm_internal_suspend() no longer exists. Signed-off-by: Mike Snitzer commit c4f512d255e3c4ade80a1d68ca816c1b11556a13 Author: Mike Snitzer Date: Tue Jun 13 16:02:17 2023 -0400 dm: skip dm-stats work in alloc_io() unless needed Don't dm_stats_record_start() if dm_stats_used() is false. Signed-off-by: Mike Snitzer commit 06eed768ea64c7a128582efda4f6107cb14ee962 Author: Mike Snitzer Date: Tue Jun 13 15:19:42 2023 -0400 dm: avoid needless dm_io access if all IO accounting is disabled Update dm_io_acct() to eliminate most dm_io struct accesses if both block core's IO stats and dm-stats are disabled. Signed-off-by: Mike Snitzer commit 526d10061bc29b314cc41f3b8322606df9172f14 Author: Li Nan Date: Tue Jun 13 09:33:32 2023 +0800 dm: support turning off block-core's io stats accounting Commit bc58ba9468d9 ("block: add sysfs file for controlling io stats accounting") allowed users to turn off disk stat accounting completely by checking if queue flag QUEUE_FLAG_IO_STAT is set. In dm, this flag is neither set nor checked: so block-core's io stats are continuously counted and cannot be turned off. Add support for turning off block-core's io stats accounting for dm. Set QUEUE_FLAG_IO_STAT for dm's request_queue. If QUEUE_FLAG_IO_STAT is set when an io starts, record the need for block core's io stats by setting the DM_IO_BLK_STAT dm_io flag to avoid io stats being disabled in the middle of the io. DM statistics (dm-stats) is independent of block-core's io stats and remains unchanged. Signed-off-by: Li Nan Signed-off-by: Mike Snitzer commit e118029cb7605a89bf334a83023fc0c102420954 Author: Christophe JAILLET Date: Wed Jun 7 05:26:27 2023 +0200 dm zone: Use the bitmap API to allocate bitmaps Use bitmap_zalloc()/bitmap_free() instead of hand-writing them. It is less verbose and it improves the semantic. Signed-off-by: Christophe JAILLET Signed-off-by: Mike Snitzer commit d48300120627a1cb98914738fff38b424625b8ad Author: Li Lingfeng Date: Mon Jun 5 15:03:16 2023 +0800 dm thin metadata: Fix ABBA deadlock by resetting dm_bufio_client As described in commit 8111964f1b85 ("dm thin: Fix ABBA deadlock between shrink_slab and dm_pool_abort_metadata"), ABBA deadlocks will be triggered because shrinker_rwsem currently needs to held by dm_pool_abort_metadata() as a side-effect of thin-pool metadata operation failure. The following three problem scenarios have been noticed: 1) Described by commit 8111964f1b85 ("dm thin: Fix ABBA deadlock between shrink_slab and dm_pool_abort_metadata") 2) shrinker_rwsem and throttle->lock P1(drop cache) P2(kworker) drop_caches_sysctl_handler drop_slab shrink_slab down_read(&shrinker_rwsem) - LOCK A do_shrink_slab super_cache_scan prune_icache_sb dispose_list evict ext4_evict_inode ext4_clear_inode ext4_discard_preallocations ext4_mb_load_buddy_gfp ext4_mb_init_cache ext4_wait_block_bitmap __ext4_error ext4_handle_error ext4_commit_super ... dm_submit_bio do_worker throttle_work_update down_write(&t->lock) -- LOCK B process_deferred_bios commit metadata_operation_failed dm_pool_abort_metadata dm_block_manager_create dm_bufio_client_create register_shrinker down_write(&shrinker_rwsem) -- LOCK A thin_map thin_bio_map thin_defer_bio_with_throttle throttle_lock down_read(&t->lock) - LOCK B 3) shrinker_rwsem and wait_on_buffer P1(drop cache) P2(kworker) drop_caches_sysctl_handler drop_slab shrink_slab down_read(&shrinker_rwsem) - LOCK A do_shrink_slab ... ext4_wait_block_bitmap __ext4_error ext4_handle_error jbd2_journal_abort jbd2_journal_update_sb_errno jbd2_write_superblock submit_bh // LOCK B // RELEASE B do_worker throttle_work_update down_write(&t->lock) - LOCK B process_deferred_bios process_bio commit metadata_operation_failed dm_pool_abort_metadata dm_block_manager_create dm_bufio_client_create register_shrinker register_shrinker_prepared down_write(&shrinker_rwsem) - LOCK A bio_endio wait_on_buffer __wait_on_buffer Fix these by resetting dm_bufio_client without holding shrinker_rwsem. Fixes: 8111964f1b85 ("dm thin: Fix ABBA deadlock between shrink_slab and dm_pool_abort_metadata") Cc: stable@vger.kernel.org Signed-off-by: Li Lingfeng Signed-off-by: Mike Snitzer commit 2a32897c840be1c0a0525f4279b365781acfba24 Author: Mikulas Patocka Date: Wed May 24 05:35:29 2023 -0400 dm crypt: fix crypt_ctr_cipher_new return value on invalid AEAD cipher If the user specifies invalid AEAD cipher, dm-crypt should return the error returned from crypt_ctr_auth_spec, not -ENOMEM. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit ef6953fb68fe52a13cd154509d1ac9f9748c6051 Author: Mike Snitzer Date: Wed May 31 13:49:47 2023 -0400 dm thin: update .io_hints methods to not require handling discards last Removes assumptions about what might follow the discard setup code (previously the code would return early if discards not enabled). Makes it possible to add more capabilites to the end of each .io_hints method (which is the natural thing to do when adding new features). Signed-off-by: Mike Snitzer commit c0a7a0ac0707a123f936daccf6639ce1c48840d5 Author: Mike Snitzer Date: Mon May 15 16:21:38 2023 -0400 dm thin: remove return code variable in pool_map Always returns DM_MAPIO_REMAPPED so no need for variable. Signed-off-by: Mike Snitzer commit 4c2c845bdc9a3443ce805460a75242923b0c5ab5 Author: Mikulas Patocka Date: Mon May 1 09:20:08 2023 -0400 dm flakey: introduce random_read_corrupt and random_write_corrupt options The random_read_corrupt and random_write_corrupt options corrupt a random byte in a bio with the provided probability. The corruption only happens in the "down" interval. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 1d9a943898533e83f20370c0e1448d606627522e Author: Mikulas Patocka Date: Mon May 1 09:19:45 2023 -0400 dm flakey: clone pages on write bio before corrupting them dm-flakey has an option to corrupt write bios. It corrupts the memory that is being written. This can cause system crashes or security bugs - for example, if the user writes a shared library code with O_DIRECT flag to a dm-flakey device, it corrupts the memory for all users that have the shared library mapped. Fix this bug by cloning the bio and corrupting the clone rather than the original. Also drop the test for ZERO_PAGE(0) - it can't happen because we write the cloned pages. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 5054e778fcd9cd29ddaa8109077cd235527e4f94 Author: Mikulas Patocka Date: Mon May 1 09:19:17 2023 -0400 dm crypt: allocate compound pages if possible It was reported that allocating pages for the write buffer in dm-crypt causes measurable overhead [1]. Change dm-crypt to allocate compound pages if they are available. If not, fall back to the mempool. [1] https://listman.redhat.com/archives/dm-devel/2023-February/053284.html Suggested-by: Matthew Wilcox Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 82fe2e45cdb00de4fa648050ae33bdadf9b3294a Author: Arnaldo Carvalho de Melo Date: Fri Jun 16 19:01:34 2023 -0300 perf pmus: Check if we can encode the PMU number in perf_event_attr.type In some architectures we can't encode the PMU number in perf_event_attr.type and thus can't just ask for the same event in multiple CPUs (and thus PMUs), that is what we want in hybrid systems but we can't when that encoding isn't understood by the kernel, such as in ARM64's big.LITTLE. If that is the case, fallback to the previous behaviour till we find a better solution to have consistent output accross architectures with hybrid CPU configurations. Co-developed-with: Ian Rogers Cc: James Clark Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Sumanth Korikkar Cc: Suzuki K Poulose Cc: Thomas Richter Cc: Will Deacon Link: https://lore.kernel.org/linux-perf-users/ZIzYgImv61OGK1wA@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit e2be06662c1f310b60a3929f3fc944809c067307 Author: Arnaldo Carvalho de Melo Date: Fri Jun 16 18:57:48 2023 -0300 perf print-events: Export is_event_supported() Will be used when checking if we can encode the PMU number in perf_event_attr.type, part of the logic to use in hybrid systems (multiple types of CPUs, such as Intel's (Alder Lake, etc) or ARM's big.LITTLE). Co-developed-with: Ian Rogers Cc: James Clark Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Sumanth Korikkar Cc: Suzuki K Poulose Cc: Thomas Richter Cc: Will Deacon Link: https://lore.kernel.org/linux-perf-users/ZIzYgImv61OGK1wA@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0a9567ac5e6a40cdd9c8cd15b19a62a15250f450 Author: Thomas Gleixner Date: Fri Jun 16 22:15:31 2023 +0200 x86/mem_encrypt: Unbreak the AMD_MEM_ENCRYPT=n build Moving mem_encrypt_init() broke the AMD_MEM_ENCRYPT=n because the declaration of that function was under #ifdef CONFIG_AMD_MEM_ENCRYPT and the obvious placement for the inline stub was the #else path. This is a leftover of commit 20f07a044a76 ("x86/sev: Move common memory encryption code to mem_encrypt.c") which made mem_encrypt_init() depend on X86_MEM_ENCRYPT without moving the prototype. That did not fail back then because there was no stub inline as the core init code had a weak function. Move both the declaration and the stub out of the CONFIG_AMD_MEM_ENCRYPT section and guard it with CONFIG_X86_MEM_ENCRYPT. Fixes: 439e17576eb4 ("init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init()") Reported-by: kernel test robot Signed-off-by: Thomas Gleixner Closes: https://lore.kernel.org/oe-kbuild-all/202306170247.eQtCJPE8-lkp@intel.com/ commit ebb83d84e49b54369b0db67136a5fe1087124dcc Author: Hao Jia Date: Tue Jun 13 16:20:11 2023 +0800 sched/core: Avoid multiple calling update_rq_clock() in __cfsb_csd_unthrottle() After commit 8ad075c2eb1f ("sched: Async unthrottling for cfs bandwidth"), we may update the rq clock multiple times in the loop of __cfsb_csd_unthrottle(). A prior (although less common) instance of this problem exists in unthrottle_offline_cfs_rqs(). Cure both by ensuring update_rq_clock() is called before the loop and setting RQCF_ACT_SKIP during the loop, to supress further updates. The alternative would be pulling update_rq_clock() out of unthrottle_cfs_rq(), but that gives an even bigger mess. Fixes: 8ad075c2eb1f ("sched: Async unthrottling for cfs bandwidth") Reviewed-By: Ben Segall Suggested-by: Vincent Guittot Signed-off-by: Hao Jia Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lkml.kernel.org/r/20230613082012.49615-4-jiahao.os@bytedance.com commit 96500560f0c73c71bca1b27536c6254fa0e8ce37 Author: Hao Jia Date: Tue Jun 13 16:20:10 2023 +0800 sched/core: Avoid double calling update_rq_clock() in __balance_push_cpu_stop() There is a double update_rq_clock() invocation: __balance_push_cpu_stop() update_rq_clock() __migrate_task() update_rq_clock() Sadly select_fallback_rq() also needs update_rq_clock() for __do_set_cpus_allowed(), it is not possible to remove the update from __balance_push_cpu_stop(). So remove it from __migrate_task() and ensure all callers of this function call update_rq_clock() prior to calling it. Signed-off-by: Hao Jia Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lkml.kernel.org/r/20230613082012.49615-3-jiahao.os@bytedance.com commit cab3ecaed5cdcc9c36a96874b4c45056a46ece45 Author: Hao Jia Date: Tue Jun 13 16:20:09 2023 +0800 sched/core: Fixed missing rq clock update before calling set_rq_offline() When using a cpufreq governor that uses cpufreq_add_update_util_hook(), it is possible to trigger a missing update_rq_clock() warning for the CPU hotplug path: rq_attach_root() set_rq_offline() rq_offline_rt() __disable_runtime() sched_rt_rq_enqueue() enqueue_top_rt_rq() cpufreq_update_util() data->func(data, rq_clock(rq), flags) Move update_rq_clock() from sched_cpu_deactivate() (one of it's callers) into set_rq_offline() such that it covers all set_rq_offline() usage. Additionally change rq_attach_root() to use rq_lock_irqsave() so that it will properly manage the runqueue clock flags. Suggested-by: Ben Segall Signed-off-by: Hao Jia Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lkml.kernel.org/r/20230613082012.49615-2-jiahao.os@bytedance.com commit e20f204c88d595c04fc9197794bb68c0fbabd902 Author: Vineeth Pillai Date: Tue May 30 09:55:26 2023 -0400 sched/deadline: Update GRUB description in the documentation Update the details of GRUB to reflect the updated logic. Signed-off-by: Vineeth Pillai (Google) Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Bristot de Oliveira Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20230530135526.2385378-2-vineeth@bitbyteword.org commit 6a9d623aad89539eca71eb264db6b9d538620ad5 Author: Vineeth Pillai Date: Tue May 30 09:55:25 2023 -0400 sched/deadline: Fix bandwidth reclaim equation in GRUB According to the GRUB[1] rule, the runtime is depreciated as: "dq = -max{u, (1 - Uinact - Uextra)} dt" (1) To guarantee that deadline tasks doesn't starve lower class tasks, we do not allocate the full bandwidth of the cpu to deadline tasks. Maximum bandwidth usable by deadline tasks is denoted by "Umax". Considering Umax, equation (1) becomes: "dq = -(max{u, (Umax - Uinact - Uextra)} / Umax) dt" (2) Current implementation has a minor bug in equation (2), which this patch fixes. The reclamation logic is verified by a sample program which creates multiple deadline threads and observing their utilization. The tests were run on an isolated cpu(isolcpus=3) on a 4 cpu system. Tests on 6.3.0 ============== RUN 1: runtime=7ms, deadline=period=10ms, RT capacity = 95% TID[693]: RECLAIM=1, (r=7ms, d=10ms, p=10ms), Util: 93.33 TID[693]: RECLAIM=1, (r=7ms, d=10ms, p=10ms), Util: 93.35 RUN 2: runtime=1ms, deadline=period=100ms, RT capacity = 95% TID[708]: RECLAIM=1, (r=1ms, d=100ms, p=100ms), Util: 16.69 TID[708]: RECLAIM=1, (r=1ms, d=100ms, p=100ms), Util: 16.69 RUN 3: 2 tasks Task 1: runtime=1ms, deadline=period=10ms Task 2: runtime=1ms, deadline=period=100ms TID[631]: RECLAIM=1, (r=1ms, d=10ms, p=10ms), Util: 62.67 TID[632]: RECLAIM=1, (r=1ms, d=100ms, p=100ms), Util: 6.37 TID[631]: RECLAIM=1, (r=1ms, d=10ms, p=10ms), Util: 62.38 TID[632]: RECLAIM=1, (r=1ms, d=100ms, p=100ms), Util: 6.23 As seen above, the reclamation doesn't reclaim the maximum allowed bandwidth and as the bandwidth of tasks gets smaller, the reclaimed bandwidth also comes down. Tests with this patch applied ============================= RUN 1: runtime=7ms, deadline=period=10ms, RT capacity = 95% TID[608]: RECLAIM=1, (r=7ms, d=10ms, p=10ms), Util: 95.19 TID[608]: RECLAIM=1, (r=7ms, d=10ms, p=10ms), Util: 95.16 RUN 2: runtime=1ms, deadline=period=100ms, RT capacity = 95% TID[616]: RECLAIM=1, (r=1ms, d=100ms, p=100ms), Util: 95.27 TID[616]: RECLAIM=1, (r=1ms, d=100ms, p=100ms), Util: 95.21 RUN 3: 2 tasks Task 1: runtime=1ms, deadline=period=10ms Task 2: runtime=1ms, deadline=period=100ms TID[620]: RECLAIM=1, (r=1ms, d=10ms, p=10ms), Util: 86.64 TID[621]: RECLAIM=1, (r=1ms, d=100ms, p=100ms), Util: 8.66 TID[620]: RECLAIM=1, (r=1ms, d=10ms, p=10ms), Util: 86.45 TID[621]: RECLAIM=1, (r=1ms, d=100ms, p=100ms), Util: 8.73 Running tasks on all cpus allowing for migration also showed that the utilization is reclaimed to the maximum. Running 10 tasks on 3 cpus SCHED_FLAG_RECLAIM - top shows: %Cpu0 : 94.6 us, 0.0 sy, 0.0 ni, 5.4 id, 0.0 wa %Cpu1 : 95.2 us, 0.0 sy, 0.0 ni, 4.8 id, 0.0 wa %Cpu2 : 95.8 us, 0.0 sy, 0.0 ni, 4.2 id, 0.0 wa [1]: Abeni, Luca & Lipari, Giuseppe & Parri, Andrea & Sun, Youcheng. (2015). Parallel and sequential reclaiming in multicore real-time global scheduling. Signed-off-by: Vineeth Pillai (Google) Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Bristot de Oliveira Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20230530135526.2385378-1-vineeth@bitbyteword.org commit bf5a8c26ad7caf0772a1cd48c8a0924e48bdbaf0 Author: Leonardo Bras Date: Thu Jun 15 03:59:47 2023 -0300 trace,smp: Add tracepoints for scheduling remotelly called functions Add a tracepoint for when a CSD is queued to a remote CPU's call_single_queue. This allows finding exactly which CPU queued a given CSD when looking at a csd_function_{entry,exit} event, and also enables us to accurately measure IPI delivery time with e.g. a synthetic event: $ echo 'hist:keys=cpu,csd.hex:ts=common_timestamp.usecs' >\ /sys/kernel/tracing/events/smp/csd_queue_cpu/trigger $ echo 'csd_latency unsigned int dst_cpu; unsigned long csd; u64 time' >\ /sys/kernel/tracing/synthetic_events $ echo \ 'hist:keys=common_cpu,csd.hex:'\ 'time=common_timestamp.usecs-$ts:'\ 'onmatch(smp.csd_queue_cpu).trace(csd_latency,common_cpu,csd,$time)' >\ /sys/kernel/tracing/events/smp/csd_function_entry/trigger $ trace-cmd record -e 'synthetic:csd_latency' hackbench $ trace-cmd report <...>-467 [001] 21.824263: csd_queue_cpu: cpu=0 callsite=try_to_wake_up+0x2ea func=sched_ttwu_pending csd=0xffff8880076148b8 <...>-467 [001] 21.824280: ipi_send_cpu: cpu=0 callsite=try_to_wake_up+0x2ea callback=generic_smp_call_function_single_interrupt+0x0 <...>-489 [000] 21.824299: csd_function_entry: func=sched_ttwu_pending csd=0xffff8880076148b8 <...>-489 [000] 21.824320: csd_latency: dst_cpu=0, csd=18446612682193848504, time=36 Suggested-by: Valentin Schneider Signed-off-by: Leonardo Bras Tested-and-reviewed-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230615065944.188876-7-leobras@redhat.com commit 949fa3f11ced2a5c8e3737e73b09676adf4b322b Author: Leonardo Bras Date: Thu Jun 15 03:59:45 2023 -0300 trace,smp: Add tracepoints around remotelly called functions The recently added ipi_send_{cpu,cpumask} tracepoints allow finding sources of IPIs targeting CPUs running latency-sensitive applications. For NOHZ_FULL CPUs, all IPIs are interference, and those tracepoints are sufficient to find them and work on getting rid of them. In some setups however, not *all* IPIs are to be suppressed, but long-running IPI callbacks can still be problematic. Add a pair of tracepoints to mark the start and end of processing a CSD IPI callback, similar to what exists for softirq, workqueue or timer callbacks. Signed-off-by: Leonardo Bras Tested-and-reviewed-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230615065944.188876-5-leobras@redhat.com commit 800e75245ba7848b1753793af96afad118c31e08 Author: Rob Herring Date: Thu Jun 15 15:31:54 2023 -0600 dt-bindings: Remove last usage of "binding" or "schema" in titles The Devicetree bindings document does not have to say in the title that it is a "Devicetree binding", but instead just describe the hardware. Most of these have been fixed already, so fix the handful that snuck in. With this, a meta-schema check can be enabled to catch these automatically. Reviewed-by: Mathieu Poirier Reviewed-by: Suman Anna Reviewed-by: Marek Vasut Acked-by: Stephen Boyd Reviewed-by: Conor Dooley Acked-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230615213154.1753313-1-robh@kernel.org Signed-off-by: Rob Herring commit b270ae61730e0ebccee39a21dd3311d6896a38ae Author: AngeloGioacchino Del Regno Date: Thu Jun 15 14:20:51 2023 +0200 clk: mediatek: clk-mt8173-apmixedsys: Fix iomap not released issue In case of error after of_ioremap() the resource must be released: call iounmap() where appropriate to fix that. Fixes: 41138fbf876c ("clk: mediatek: mt8173: Migrate to platform driver and common probe") Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230615122051.546985-4-angelogioacchino.delregno@collabora.com Reviewed-by: Chen-Yu Tsai Signed-off-by: Stephen Boyd commit 3dc265b369ee61db999d6d1588e888eb21dc421e Author: AngeloGioacchino Del Regno Date: Thu Jun 15 14:20:50 2023 +0200 clk: mediatek: clk-mt8173-apmixedsys: Fix return value for of_iomap() error The of_iomap() function returns NULL in case of error so usage of PTR_ERR() is wrong! Change that to return -ENOMEM in case of failure. Fixes: 41138fbf876c ("clk: mediatek: mt8173: Migrate to platform driver and common probe") Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230615122051.546985-3-angelogioacchino.delregno@collabora.com Reviewed-by: Chen-Yu Tsai Reviewed-by: Markus Schneider-Pargmann Signed-off-by: Stephen Boyd commit 51821765e89906090753421580a61d25a4668186 Author: AngeloGioacchino Del Regno Date: Thu Jun 15 14:20:49 2023 +0200 clk: mediatek: clk-mtk: Grab iomem pointer for divider clocks In the rare case in which one of the clock drivers has divider clocks but not composite clocks, mtk_clk_simple_probe() would not io(re)map, hence passing a NULL pointer to mtk_clk_register_dividers(). To fix this issue, extend the `if` conditional to also check if any divider clocks are present. While at it, also make sure the iomem pointer is NULL if no composite/divider clocks are declared, as we are checking for that when iounmapping it in the error path. This hasn't been seen on any MediaTek clock driver as the current ones always declare composite clocks along with divider clocks, but this is still an important fix for a future potential KP. Fixes: 1fe074b1f112 ("clk: mediatek: Add divider clocks to mtk_clk_simple_{probe,remove}()") Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230615122051.546985-2-angelogioacchino.delregno@collabora.com Reviewed-by: Chen-Yu Tsai Reviewed-by: Markus Schneider-Pargmann Signed-off-by: Stephen Boyd commit 6acab96ee33703497f30b66efa553a7d0ebd5c0f Author: Jai Luthra Date: Thu Jun 15 17:25:36 2023 +0530 clk: keystone: syscon-clk: Add support for audio refclk TI's AM62 SoC can optionally provide two audio reference clocks (AUDIO_REFCLKx) to external peripherals. By default this reference clock is looped-back inside the SoC to a mux that goes to McASP AHCLK, but can optionally be enabled as an output to peripherals outside the SoC by setting a bit through CTRL_MMR registers. This bit only controls the direction of the clock, while the parent is a muxed input from sci-clk [1] which may be a configurable PLL or a master clock from one of the McASP instances. Link: http://downloads.ti.com/tisci/esd/latest/5_soc_doc/am62x/clocks.html#clocks-for-board0-device [1] Signed-off-by: Jai Luthra Link: https://lore.kernel.org/r/20230515-refclk-v3-2-37c0b550f406@ti.com Signed-off-by: Stephen Boyd commit daecb57cc4e735439d3366778705b21e7bf6f397 Author: Jai Luthra Date: Thu Jun 15 17:25:35 2023 +0530 dt-bindings: clock: Add binding documentation for TI Audio REFCLK Add DT bindings for TI's audio reference clocks (REFCLK) present on AM62 SoC. Reviewed-by: Conor Dooley Signed-off-by: Jai Luthra Link: https://lore.kernel.org/r/20230515-refclk-v3-1-37c0b550f406@ti.com Signed-off-by: Stephen Boyd commit fb1273635f8c38df18483ffcd038a5b792dfcc94 Author: Andy Shevchenko Date: Fri Jun 16 18:02:33 2023 +0300 KVM: x86: Remove PRIx* definitions as they are solely for user space In the Linux kernel we do not support PRI.64 specifiers. Moreover they seem not to be used anyway here. Drop them. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230616150233.83813-1-andriy.shevchenko@linux.intel.com Signed-off-by: Sean Christopherson commit 5f2cf757f9c56255470c23a2a4a5574a34edad4b Author: Jiri Pirko Date: Fri Jun 2 15:34:00 2023 +0200 net/mlx5: Remove unused ecpu field from struct mlx5_sf_table "ecpu" field in struct mlx5_sf_table is not used anywhere. Remove it. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 2bd3b292955fe0a7eb2f768f36a767eddaedd6da Author: Juhee Kang Date: Mon Jun 5 16:51:36 2023 +0900 net/mlx5: Add header file for events Separate the event API defined in the generic mlx5.h header into a dedicated header. And remove the TODO comment in commit 69c1280b1f3b ("net/mlx5: Device events, Use async events chain"). Signed-off-by: Juhee Kang Reviewed-by: Larysa Zaremba Signed-off-by: Saeed Mahameed commit 8bbe544e03809514e441994b4b849fdbeadd0068 Author: Daniel Jurgens Date: Tue Jun 13 22:30:49 2023 +0300 net/mlx5: DR, update query of HCA caps for EC VFs This change is needed to use EC VFs with metadata based steering. There was an assumption that vport was equal to function ID. That's not the case for EC VF functions. Adjust to function ID and set the ec_vf_function bit accordingly. Fixes: 9ac0b128248e ("net/mlx5: Update vport caps query/set for EC VFs") Signed-off-by: Daniel Jurgens Signed-off-by: Saeed Mahameed commit b3bd68925ebb20942d448405351cf43cac9676a7 Author: Daniel Jurgens Date: Tue Jun 13 22:26:43 2023 +0300 net/mlx5: Fix the macro for accessing EC VF vports The last value is not set correctly. This results in representors not being created for all EC VFs when the base value is higher than 0. Fixes: a7719b29a821 ("net/mlx5: Add management of EC VF vports") Signed-off-by: Daniel Jurgens Signed-off-by: Saeed Mahameed commit c8013a1f714f6d9f2d8d673177a824c6b9653218 Author: Or Har-Toov Date: Thu Mar 23 18:11:50 2023 +0200 net/mlx5e: Add local loopback counter to vport stats Add counter for number of unicast, multicast and broadcast packets/ octets that were loopback. Signed-off-by: Or Har-Toov Reviewed-by: Avihai Horon Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 0bd2e6fc78fddf83b9a71a61bdf0c4caca83abe7 Author: Or Har-Toov Date: Thu Mar 23 17:52:03 2023 +0200 net/mlx5: Expose bits for local loopback counter Add needed HW bits for querying local loopback counter and the HCA capability for it. Signed-off-by: Or Har-Toov Reviewed-by: Avihai Horon Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 559f4c32ebff40a25199b5178d58c9283ac5eb9c Author: Gal Pressman Date: Sun Apr 23 14:29:26 2023 +0300 net/mlx5e: Remove mlx5e_dbg() and msglvl support The msglvl support was implemented using the mlx5e_dbg() macro which is rarely used in the driver, and is not very useful when you can just use dynamic debug instead. Remove mlx5e_dbg() and convert its usages to netdev_dbg(). Signed-off-by: Gal Pressman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 8a955da230d39932869e7a6835143be9889b0a45 Author: Saeed Mahameed Date: Wed Jun 7 14:12:10 2023 -0700 net/mlx5: E-Switch, remove redundant else statements These else statement blocks are redundant since the if block already jumps to the function abort label. Signed-off-by: Saeed Mahameed Reviewed-by: Rahul Rameshbabu commit 791eb78285e8b81bc09bfc6bd928b981eaefb082 Author: Vlad Buslov Date: Thu May 25 15:19:00 2023 +0200 net/mlx5: Bridge, expose FDB state via debugfs For debugging purposes expose offloaded FDB state (flags, counters, etc.) via debugfs inside 'esw' root directory. Example debugfs file output: $ cat mlx5/0000\:08\:00.0/esw/bridge/bridge1/fdb DEV MAC VLAN PACKETS BYTES LASTUSE FLAGS enp8s0f0_1 e4:0a:05:08:00:06 2 2 204 4295567112 0x0 enp8s0f0_0 e4:0a:05:08:00:03 2 3 278 4295567112 0x0 Signed-off-by: Vlad Buslov Reviewed-by: Tariq Toukan Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit ade19f0d6a3a395e7936227811acbf897ee186fc Author: Vlad Buslov Date: Fri May 26 08:55:15 2023 +0200 net/mlx5: Bridge, pass net device when linking vport to bridge Following patch requires access to additional data in bridge net_device. Pass the whole structure down the stack instead of adding necessary fields as function arguments one-by-one. Signed-off-by: Vlad Buslov Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit f405787a0abaf14e332aa6d1d924e75970332e68 Author: Vlad Buslov Date: Thu Jun 1 09:34:35 2023 +0200 net/mlx5: Create eswitch debugfs root directory Following patch in series uses the new directory for bridge FDB debugfs. The new directory is intended for all future eswitch-specific debugfs files. Signed-off-by: Vlad Buslov Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit 7a9770f1bfeaeddf5afabd3244e2c4c4966be37d Author: Moshe Shemesh Date: Wed May 17 16:07:40 2023 +0300 net/mlx5: Handle sync reset unload event Added a new event handler to firmware sync reset, which is used to support firmware sync reset flow on smart NIC. Adding this new stage to the flow enables the firmware to ensure host PFs unload before ECPFs unload, to avoid race of PFs recovery. If firmware sends sync_reset_unload event to driver the driver should unload and close all HW resources of the function. Once the driver finishes unloading part, it can't get any more events from firmware as event queues are closed, so it polls the reset state field to know when to continue to next stage of the sync reset flow. Added capability bit for supporting sync_reset_unload event. Signed-off-by: Moshe Shemesh Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 6f8551f8d9e44894ea9ca0748b5523767d7aeacb Author: Moshe Shemesh Date: Wed Jun 14 06:47:58 2023 +0300 net/mlx5: Check DTOR entry value is not zero The Default Timeout Register (DTOR) provides timeout values to driver for flows that are device dependent. Zero value for DTOR entry is not valid and should not be used. In case of reading zero value from DTOR, the driver should use the hard coded SW default value instead. Signed-off-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 8bb42ed4210e342631f63d32f7ed87b722968da6 Author: Moshe Shemesh Date: Wed May 17 11:53:50 2023 +0300 net/mlx5: Expose timeout for sync reset unload stage Expose new timoueout in Default Timeouts Register to be used on sync reset flow running on smart NIC. In this flow the driver should know how much time to wait from getting unload request till firmware will ask the PF to continue to next stage of the flow. Signed-off-by: Moshe Shemesh Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 92501fa6e4217aa0b85b092f91b2649b3c214a75 Author: Moshe Shemesh Date: Sat May 20 11:33:14 2023 +0300 net/mlx5: Ack on sync_reset_request only if PF can do reset_now Verify at reset_request stage that PF is capable to do reset_now. In case PF is not capable, notify the firmware that the sync reset can not happen and so firmware will abort the sync reset at early stage and will not send reset_now event to any PF. Signed-off-by: Moshe Shemesh Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 06b84c59dff1eeaa786153cb6cf864cc7d6ef176 Author: Andrew Davis Date: Tue May 16 13:46:26 2023 -0500 dt-bindings: clock: ehrpwm: Remove unneeded syscon compatible This node's register space is not accessed by any other node, which is the traditional use for the "syscon" hint. It looks to have been added here to make use of a Linux kernel helper syscon_node_to_regmap(). The Linux driver now uses a more appropriate helper that does not require the hint, so let's remove it from the binding. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230516184626.154892-2-afd@ti.com Acked-by: Krzysztof Kozlowski Signed-off-by: Stephen Boyd commit 595409cf07ade54d6265942f25a3d33b0d76a17c Author: Andrew Davis Date: Tue May 16 13:46:25 2023 -0500 clk: keystone: syscon-clk: Allow the clock node to not be of type syscon There is a helper device_node_to_regmap() we can use that does not force this clock DT node to be a "syscon" node. It should work the same in this case but allow us to remove the unneeded "syscon" compatible. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230516184626.154892-1-afd@ti.com Signed-off-by: Stephen Boyd commit 5a6f6873606e03a0a95afe40ba5e84bb6e28a26f Author: David Howells Date: Wed Jun 14 09:04:16 2023 +0100 ip, ip6: Fix splice to raw and ping sockets Splicing to SOCK_RAW sockets may set MSG_SPLICE_PAGES, but in such a case, __ip_append_data() will call skb_splice_from_iter() to access the 'from' data, assuming it to point to a msghdr struct with an iter, instead of using the provided getfrag function to access it. In the case of raw_sendmsg(), however, this is not the case and 'from' will point to a raw_frag_vec struct and raw_getfrag() will be the frag-getting function. A similar issue may occur with rawv6_sendmsg(). Fix this by ignoring MSG_SPLICE_PAGES if getfrag != ip_generic_getfrag as ip_generic_getfrag() expects "from" to be a msghdr*, but the other getfrags don't. Note that this will prevent MSG_SPLICE_PAGES from being effective for udplite. This likely affects ping sockets too. udplite looks like it should be okay as it expects "from" to be a msghdr. Signed-off-by: David Howells Reported-by: syzbot+d8486855ef44506fd675@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/000000000000ae4cbf05fdeb8349@google.com/ Fixes: 2dc334f1a63a ("splice, net: Use sendmsg(MSG_SPLICE_PAGES) rather than ->sendpage()") Tested-by: syzbot+d8486855ef44506fd675@syzkaller.appspotmail.com cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/1410156.1686729856@warthog.procyon.org.uk Signed-off-by: Jakub Kicinski commit 9390860900a304149d9da34bf7d09c19b7e984b7 Merge: e13dd04a242cc 35944dc68e67a Author: Stephen Boyd Date: Fri Jun 16 11:34:36 2023 -0700 Merge tag 'clk-meson-v6.5-2' of https://github.com/BayLibre/clk-meson into clk-amlogic Pull more Amlogic clk driver updates from Jerome Brunet: - Fix maintainers file pattern mistake - Remove unneeded semicolon * tag 'clk-meson-v6.5-2' of https://github.com/BayLibre/clk-meson: MAINTAINERS: repair pattern in ARM/Amlogic Meson SoC CLOCK FRAMEWORK clk: meson: pll: remove unneeded semicolon commit 234489ac561300ceed33e64c3bf3a810b9e2051d Author: Nipun Gupta Date: Wed May 31 18:15:57 2023 +0530 vfio/cdx: add support for CDX bus vfio-cdx driver enables IOCTLs for user space to query MMIO regions for CDX devices and mmap them. This change also adds support for reset of CDX devices. With VFIO enabled on CDX devices, user-space applications can also exercise DMA securely via IOMMU on these devices. This change adds the VFIO CDX driver and enables the following ioctls for CDX devices: - VFIO_DEVICE_GET_INFO: - VFIO_DEVICE_GET_REGION_INFO - VFIO_DEVICE_RESET Signed-off-by: Nipun Gupta Reviewed-by: Pieter Jansen van Vuuren Tested-by: Nikhil Agarwal Link: https://lore.kernel.org/r/20230531124557.11009-1-nipun.gupta@amd.com Signed-off-by: Alex Williamson commit 1e44c58cc485ce265696422c5a9282677ec45473 Author: Alex Williamson Date: Wed Jun 14 13:39:48 2023 -0600 vfio/fsl: Create Kconfig sub-menu For consistency with pci and platform, push the vfio-fsl-mc option into a sub-menu. Reviewed-by: Cédric Le Goater Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20230614193948.477036-4-alex.williamson@redhat.com Signed-off-by: Alex Williamson commit 8bee6f00fce25e7a0db85cbb52b19d729d28273e Author: Alex Williamson Date: Wed Jun 14 13:39:47 2023 -0600 vfio/platform: Cleanup Kconfig Like vfio-pci, there's also a base module here where vfio-amba depends on vfio-platform, when really it only needs vfio-platform-base. Create a sub-menu for platform drivers and a nested menu for reset drivers. Cleanup Makefile to make use of new CONFIG_VFIO_PLATFORM_BASE for building the shared modules and traversing reset modules. Reviewed-by: Cédric Le Goater Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20230614193948.477036-3-alex.williamson@redhat.com Signed-off-by: Alex Williamson commit 8cc75183b78e91455a03ad3a1a68cd0612f66446 Author: Alex Williamson Date: Wed Jun 14 13:39:46 2023 -0600 vfio/pci: Cleanup Kconfig It should be possible to select vfio-pci variant drivers without building vfio-pci itself, which implies each variant driver should select vfio-pci-core. Fix the top level vfio Makefile to traverse pci based on vfio-pci-core rather than vfio-pci. Mark MMAP and INTX options depending on vfio-pci-core to cleanup resulting config if core is not enabled. Push all PCI related vfio options to a sub-menu and make descriptions consistent. Reviewed-by: Cédric Le Goater Reviewed-by: Eric Auger Reviewed-by: Shameer Kolothum Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20230614193948.477036-2-alex.williamson@redhat.com Signed-off-by: Alex Williamson commit a5bfe22db2a4a1ae467f31cfa1d72043eb9f1877 Author: Alex Williamson Date: Fri May 19 15:47:48 2023 -0600 vfio/pci-core: Add capability for AtomicOp completer support Test and enable PCIe AtomicOp completer support of various widths and report via device-info capability to userspace. Reviewed-by: Cédric Le Goater Reviewed-by: Robin Voetter Tested-by: Robin Voetter Link: https://lore.kernel.org/r/20230519214748.402003-1-alex.williamson@redhat.com Signed-off-by: Alex Williamson commit c31b3a1b004c1052c9bcc3f7534e393e205be1cb Author: Rafael J. Wysocki Date: Sun Jun 4 14:21:13 2023 +0200 ACPI: thermal: Drop struct acpi_thermal_flags Drop struct acpi_thermal_flags which is not really used (only one flag in it is ever set, but it is never read) and call acpi_execute_simple_method() directly to evaluate _SCP instead of using acpi_thermal_set_cooling_mode(), which has no callers after that change, so drop it. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit f75fbe28e8b50517402f17a4fa00aaa8a1314a28 Author: Rafael J. Wysocki Date: Sun Jun 4 14:19:43 2023 +0200 ACPI: thermal: Drop struct acpi_thermal_state Drop struct acpi_thermal_state which is not really used. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 365eac5ef2febeea75432b0c5257271fed93bcc5 Author: Rafael J. Wysocki Date: Sun Jun 4 17:23:40 2023 +0200 ACPI: bus: Simplify installation and removal of notify callback Because the only drivers that cared about button fixed events take care of those events by themselves now, eliminate the code related to them from acpi_device_install_notify_handler() and acpi_device_remove_notify_handler(). Signed-off-by: Rafael J. Wysocki commit ff1d7aea83e2ea805b060d6a2f0623e41e3e4158 Author: Rafael J. Wysocki Date: Sun Jun 4 17:22:48 2023 +0200 ACPI: tiny-power-button: Eliminate the driver notify callback Rework the ACPI tiny-power-button driver to install a notify handler or a fixed event handler for the device it binds to by itself and drop its notify callback. This will allow acpi_device_install_notify_handler() and acpi_device_remove_notify_handler() to be simplified going forward. Signed-off-by: Rafael J. Wysocki commit e4e62d5fd8ecb0ea4174afda654432927d248a8a Author: Rafael J. Wysocki Date: Sun Jun 4 17:20:27 2023 +0200 ACPI: button: Use different notify handlers for lid and buttons Since the lid handling in acpi_button_notify() is special, introduce acpi_lid_notify() specifically for handling lid notifications. Signed-off-by: Rafael J. Wysocki commit 0d51157dfaac05ea66616d8a250dce04bef49a4f Author: Rafael J. Wysocki Date: Sun Jun 4 17:19:06 2023 +0200 ACPI: button: Eliminate the driver notify callback Rework the ACPI button driver to install notify handlers or fixed event handlers for the devices it binds to by itself, reduce the indentation level in its notify handler routine and drop its notify callback. This will allow acpi_device_install_notify_handler() and acpi_device_remove_notify_handler() to be simplified going forward and it will allow the driver to use different notify handlers for the lid and for the power and sleep buttons. Signed-off-by: Rafael J. Wysocki Reviewed-by: Michal Wilczynski commit af3215fd02308c9aa982a028284d6414eeb60c04 Author: Mark Brown Date: Fri Jun 9 23:43:41 2023 +0100 arm64/fpsimd: Exit streaming mode when flushing tasks Ensure there is no path where we might attempt to save SME state after we flush a task by updating the SVCR register state as well as updating our in memory state. I haven't seen a specific case where this is happening or seen a path where it might happen but for the cost of a single low overhead instruction it seems sensible to close the potential gap. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230607-arm64-flush-svcr-v2-1-827306001841@kernel.org Signed-off-by: Catalin Marinas commit 4384a70c8813e8573d1841fd94eee873f80a7e1a Author: Ulf Hansson Date: Tue May 30 11:55:36 2023 +0200 PM: domains: Move the verification of in-params from genpd_add_device() Commit f38d1a6d0025 ("PM: domains: Allocate governor data dynamically based on a genpd governor") started to use the in-parameters in genpd_add_device(), without first doing a verification of them. This isn't really a big problem, as most callers do a verification already. Therefore, let's drop the verification from genpd_add_device() and make sure all the callers take care of it instead. Reported-by: Dan Carpenter Fixes: f38d1a6d0025 ("PM: domains: Allocate governor data dynamically based on a genpd governor") Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit f4aad639302a07454dcb23b408dcadf8a9efb031 Author: Wyes Karny Date: Mon Jun 12 11:36:10 2023 +0000 cpufreq: amd-pstate: Make amd-pstate EPP driver name hyphenated amd-pstate passive mode driver is hyphenated. So make amd-pstate active mode driver consistent with that rename "amd_pstate_epp" to "amd-pstate-epp". Fixes: ffa5096a7c33 ("cpufreq: amd-pstate: implement Pstate EPP support for the AMD processors") Cc: All applicable Reviewed-by: Gautham R. Shenoy Signed-off-by: Wyes Karny Acked-by: Huang Rui Reviewed-by: Perry Yuan Signed-off-by: Rafael J. Wysocki commit 217e67784eab30cd0704fab4109647ea68a4d850 Author: Wyes Karny Date: Tue May 30 13:13:48 2023 +0000 cpufreq: amd-pstate: Write CPPC enable bit per-socket Currently amd_pstate sets CPPC enable bit in MSR_AMD_CPPC_ENABLE only for the CPU where the module_init happened. But MSR_AMD_CPPC_ENABLE is per-socket. This causes CPPC enable bit to set for only one socket for servers with more than one physical packages. To fix this write MSR_AMD_CPPC_ENABLE per-socket. Also, handle duplicate calls for cppc_enable, because it's called from per-policy/per-core callbacks and can result in duplicate MSR writes. Before the fix: amd@amd:~$ sudo rdmsr -a 0xc00102b1 | uniq --count 192 0 192 1 After the fix: amd@amd:~$ sudo rdmsr -a 0xc00102b1 | uniq --count 384 1 Suggested-by: Gautham R. Shenoy Signed-off-by: Wyes Karny Acked-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit 2f3d08f074b02aa449de27238fda72496c789034 Author: Arjan van de Ven Date: Mon Jun 5 15:47:15 2023 +0000 intel_idle: Add support for using intel_idle in a VM guest using just hlt In a typical VM guest, the mwait instruction is not available, leaving only the 'hlt' instruction (which causes a VMEXIT to the host). So for this common case, intel_idle will detect the lack of mwait, and fail to initialize (after which another idle method would step in which will just use hlt always). Other (non-common) cases exist; the table below shows the before/after for these: +------------+--------------------------+-------------------------+ | Hypervisor | Idle method before patch | Idle method after patch | | exposes | | | +============+==========================+=========================+ | nothing | default_idle fallback | intel_idle VM table | | (common) | (straight "hlt") | | +------------+--------------------------+-------------------------+ | mwait | intel_idle mwait table | intel_idle mwait table | +------------+--------------------------+-------------------------+ | ACPI | ACPI C1 state ("hlt") | intel_idle VM table | +------------+--------------------------+-------------------------+ This is only applicable to CPUs known by intel_idle. For the bare metal case, unknown CPU models will use the ACPI tables (when available) to get estimates for latency and break even point for longer idle states. In guests, the common case is that ACPI tables are not available, but even when they are available, they can't and don't provide the latency information for the longer (mwait based) states. For this scenario (unknown CPU model), the default_idle mode (no ACPI) or ACPI C1 (ACPI avaible) will be used. By providing capability to do this with the intel_idle driver, we can do better than the fallback or ACPI table methods. While this current change only gets us to the existing behavior, later patches in this series will add new capabilities such as optimized TLB flushing. In order to do this, a simplified version of the initialization function for VM guests is created, and this will be called if the CPU is recognized, but mwait is not supported, and we're in a VM guest. One thing to note is that the max latency (and break even) of this C1 state is higher than the typical bare metal C1 state. Because hlt causes a vmexit, and the cost of vmexit + hypervisor overhead + vmenter is typically in the order of upto 5 microseconds... even if the hypervisor does not actually goes into a hardware power saving state. Signed-off-by: Arjan van de Ven [ rjw: Dropped redundant checks from should_verify_mwait() ] Signed-off-by: Rafael J. Wysocki commit ab5d47bd41b1db82c295b0e751e2b822b43a4b5a Author: Sebastian Andrzej Siewior Date: Wed Jun 14 10:34:30 2023 +0200 bpf: Remove in_atomic() from bpf_link_put(). bpf_free_inode() is invoked as a RCU callback. Usually RCU callbacks are invoked within softirq context. By setting rcutree.use_softirq=0 boot option the RCU callbacks will be invoked in a per-CPU kthread with bottom halves disabled which implies a RCU read section. On PREEMPT_RT the context remains fully preemptible. The RCU read section however does not allow schedule() invocation. The latter happens in mutex_lock() performed by bpf_trampoline_unlink_prog() originated from bpf_link_put(). It was pointed out that the bpf_link_put() invocation should not be delayed if originated from close(). It was also pointed out that other invocations from within a syscall should also avoid the workqueue. Everyone else should use workqueue by default to remain safe in the future (while auditing the code, every caller was preemptible except for the RCU case). Let bpf_link_put() use the worker unconditionally. Add bpf_link_put_direct() which will directly free the resources and is used by close() and from within __sys_bpf(). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230614083430.oENawF8f@linutronix.de commit af92c02fb2090692f4920ea4b74870940260cf49 Merge: 20fce500b232b 6d7160c7da6fa Author: Martin K. Petersen Date: Fri Jun 16 12:21:04 2023 -0400 Merge patch series "scsi: fixes for targets with many LUNs, and scsi_target_block rework" Martin Wilck says: This patch series addresses some issues we saw in a test setup with a large number of SCSI LUNs. The first two patches simply increase the number of available sg and bsg devices. 3-5 fix a large delay we encountered between blocking a Fibre Channel remote port and the dev_loss_tmo. 6 renames scsi_target_block() to scsi_block_targets(), and makes additional changes to this API, as suggested in the review of the v2 series. 7 improves a warning message. Link: https://lore.kernel.org/r/20230614103616.31857-1-mwilck@suse.com Signed-off-by: Martin K. Petersen commit 6d7160c7da6fa3010252910a1680c62ababa6c2f Author: Martin Wilck Date: Wed Jun 14 12:36:16 2023 +0200 scsi: core: Improve warning message in scsi_device_block() If __scsi_internal_device_block() returns an error, it is always -EINVAL because of an invalid state transition. For debugging purposes, it makes more sense to print the device state. Signed-off-by: Martin Wilck Link: https://lore.kernel.org/r/20230614103616.31857-8-mwilck@suse.com Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 31950192d939a969415d0e1da4c62598023b0850 Author: Martin Wilck Date: Wed Jun 14 12:36:15 2023 +0200 scsi: core: Replace scsi_target_block() with scsi_block_targets() All callers (fc_remote_port_delete(), __iscsi_block_session(), __srp_start_tl_fail_timers(), srp_reconnect_rport(), snic_tgt_del()) pass parent devices of scsi_target devices to scsi_target_block(). Rename the function to scsi_block_targets(), and simplify it by assuming that it is always passed a parent device. Also, have callers pass the Scsi_Host pointer to scsi_block_targets(), as every caller has this pointer readily available. Suggested-by: Christoph Hellwig Suggested-by: Bart Van Assche Signed-off-by: Martin Wilck Link: https://lore.kernel.org/r/20230614103616.31857-7-mwilck@suse.com Cc: Karan Tilak Kumar Cc: Sesidhar Baddela Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e20fff8a1f4940f46be888bd175412c2e3e64e96 Author: Martin Wilck Date: Wed Jun 14 12:36:14 2023 +0200 scsi: core: Don't wait for quiesce in scsi_device_block() scsi_device_block() is only called from scsi_target_block(), which calls it repeatedly for every child device. For targets with many devices, waiting for every queue to quiesce may cause a substantial delay (we measured more than 100s delay for blocking a FC rport with 2048 LUNs). Just call blk_mq_wait_quiesce_done() once from scsi_target_block() after stopping all queues. Signed-off-by: Martin Wilck Link: https://lore.kernel.org/r/20230614103616.31857-6-mwilck@suse.com Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d7035b73a73a79a1dc991fad0ee5f784559e81ed Author: Martin Wilck Date: Wed Jun 14 12:36:13 2023 +0200 scsi: core: Don't wait for quiesce in scsi_stop_queue() scsi_stop_queue() has just two callers, one with and one without "nowait". As blk_mq_quiesce_queue() comes down to blk_mq_quiesce_queue_nowait() followed by blk_mq_wait_quiesce_done(), we might as well open-code this in scsi_device_block(). Also, add a comment explaining why blk_mq_quiesce_queue_nowait() must be called with the state_mutex held, see https://lore.kernel.org/linux-scsi/3b8b13bf-a458-827a-b916-07d7eee8ae00@acm.org/. Signed-off-by: Martin Wilck Link: https://lore.kernel.org/r/20230614103616.31857-5-mwilck@suse.com Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit c5e46f7ad43b0519980020378a2b00b339359968 Author: Martin Wilck Date: Wed Jun 14 12:36:12 2023 +0200 scsi: core: Merge scsi_internal_device_block() and device_block() scsi_internal_device_block() is only called from device_block(). Merge the two functions, and call the result scsi_device_block(), as the name device_block() is confusingly generic. Signed-off-by: Martin Wilck Link: https://lore.kernel.org/r/20230614103616.31857-4-mwilck@suse.com Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 37c918e03ef7d8c8b1d4f3216d6935479d3acbee Author: Hannes Reinecke Date: Wed Jun 14 12:36:11 2023 +0200 scsi: sg: Increase number of devices Larger setups may need to allocate more than 32k sg devices, so increase the number of devices to the full range of minor device numbers. Signed-off-by: Hannes Reinecke Signed-off-by: Martin Wilck Link: https://lore.kernel.org/r/20230614103616.31857-3-mwilck@suse.com Acked-by: Douglas Gilbert Reviewed-by: Christoph Hellwig Reviewed-by: Ming Lei Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 9077fb2ab78cd76f710893919df6b0b7da79c2c9 Author: Hannes Reinecke Date: Wed Jun 14 12:36:10 2023 +0200 scsi: bsg: Increase number of devices Larger setups may need to allocate more than 32k bsg devices, so increase the number of devices to the full range of minor device numbers. Signed-off-by: Hannes Reinecke Signed-off-by: Martin Wilck Link: https://lore.kernel.org/r/20230614103616.31857-2-mwilck@suse.com Reviewed-by: Christoph Hellwig Reviewed-by: Ming Lei Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 7f6ee56ca0df0484338d12cd142fb5ebde8875a9 Author: Christian Lamparter Date: Thu Jun 15 14:41:53 2023 +0300 dt-bindings: net: wireless: ath10k: add ieee80211-freq-limit property This is an existing optional property that ieee80211.yaml/cfg80211 provides. It's useful to further restrict supported frequencies for a specified device through device-tree. For testing the addition, I added the ieee80211-freq-limit property with values from an OpenMesh A62 device. This is because the OpenMesh A62 has "special filters in front of the RX+TX paths to the 5GHz PHYs. These filtered channel can in theory still be used by the hardware but the signal strength is reduced so much that it makes no sense." The driver supported this since ~2018 by commit 34d5629d2ca8 ("ath10k: limit available channels via DT ieee80211-freq-limit") Link: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=e3b8ae2b09e137ce2eae33551923daf302293a0c Signed-off-by: Christian Lamparter Acked-by: Krzysztof Kozlowski Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/c33c928b7c6c9bb4e7abe84eb8df9f440add275b.1686486464.git.chunkeey@gmail.com commit 0f00a3fa5ac9c6ec4bc8cc29924f310295432502 Merge: 60e07fa49b320 fd4e9e9bfa0b1 Author: Mark Brown Date: Fri Jun 16 17:16:21 2023 +0100 ASoC: SOF: misc updates for 6.5 Merge series from Pierre-Louis Bossart : Couple of improvements on virtual_widget support, firmware trace free, IPC payload dump, duplicated code in suspend and MeteorLake primary code support. commit 20fce500b232b970e40312a9c97e7f3b6d7a709c Author: Manish Rangankar Date: Thu Jun 15 13:16:33 2023 +0530 scsi: qla2xxx: Remove unused nvme_ls_waitq wait queue System crash when qla2x00_start_sp(sp) returns error code EGAIN and wake_up gets called for uninitialized wait queue sp->nvme_ls_waitq. qla2xxx [0000:37:00.1]-2121:5: Returning existing qpair of ffff8ae2c0513400 for idx=0 qla2xxx [0000:37:00.1]-700e:5: qla2x00_start_sp failed = 11 BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 PGD 0 P4D 0 Oops: 0000 [#1] SMP NOPTI Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 09/03/2021 Workqueue: nvme-wq nvme_fc_connect_ctrl_work [nvme_fc] RIP: 0010:__wake_up_common+0x4c/0x190 RSP: 0018:ffff95f3e0cb7cd0 EFLAGS: 00010086 RAX: 0000000000000000 RBX: ffff8b08d3b26328 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000003 RDI: ffff8b08d3b26320 RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffffffffffe8 R10: 0000000000000000 R11: ffff95f3e0cb7a60 R12: ffff95f3e0cb7d20 R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8b2fdf6c0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000002f1e410002 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: __wake_up_common_lock+0x7c/0xc0 qla_nvme_ls_req+0x355/0x4c0 [qla2xxx] ? __nvme_fc_send_ls_req+0x260/0x380 [nvme_fc] ? nvme_fc_send_ls_req.constprop.42+0x1a/0x45 [nvme_fc] ? nvme_fc_connect_ctrl_work.cold.63+0x1e3/0xa7d [nvme_fc] Remove unused nvme_ls_waitq wait queue. nvme_ls_waitq logic was removed previously in the commits tagged Fixed: below. Fixes: 219d27d7147e ("scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands") Fixes: 5621b0dd7453 ("scsi: qla2xxx: Simpify unregistration of FC-NVMe local/remote ports") Cc: stable@vger.kernel.org Signed-off-by: Manish Rangankar Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230615074633.12721-1-njavali@marvell.com Signed-off-by: Martin K. Petersen commit 245165658e1c9f95c0fecfe02b9b1ebd30a1198a Author: Ming Lei Date: Fri Jun 16 21:23:54 2023 +0800 blk-mq: fix NULL dereference on q->elevator in blk_mq_elv_switch_none After grabbing q->sysfs_lock, q->elevator may become NULL because of elevator switch. Fix the NULL dereference on q->elevator by checking it with lock. Reported-by: Guangwu Zhang Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230616132354.415109-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 84bd06c632c6d5279849f5f8ab47d9517d259422 Author: Christoph Hellwig Date: Wed Jun 14 16:03:41 2023 +0200 iov_iter: remove iov_iter_get_pages and iov_iter_get_pages_alloc Now that the direct I/O helpers have switched to use iov_iter_extract_pages, these helpers are unused. Signed-off-by: Christoph Hellwig Reviewed-by: Christian Brauner Reviewed-by: David Howells Link: https://lore.kernel.org/r/20230614140341.521331-5-hch@lst.de Signed-off-by: Jens Axboe commit e4cc64657becbd073c3ecc9d5938a1fe0d59913f Author: Christoph Hellwig Date: Wed Jun 14 16:03:40 2023 +0200 block: remove BIO_PAGE_REFFED Now that all block direct I/O helpers use page pinning, this flag is unused. Signed-off-by: Christoph Hellwig Reviewed-by: Christian Brauner Reviewed-by: Johannes Thumshirn Reviewed-by: David Howells Link: https://lore.kernel.org/r/20230614140341.521331-4-hch@lst.de Signed-off-by: Jens Axboe commit 2e82f6c3bfd1acde2610dd9feb4f2b264c4ef742 Author: Christoph Hellwig Date: Wed Jun 14 16:03:39 2023 +0200 splice: simplify a conditional in copy_splice_read Check for -EFAULT instead of wrapping the check in an ret < 0 block. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Christian Brauner Reviewed-by: David Howells Link: https://lore.kernel.org/r/20230614140341.521331-3-hch@lst.de Signed-off-by: Jens Axboe commit 0b24be4691c9e6ea13ca70050d42a9f9032fa788 Author: Christoph Hellwig Date: Wed Jun 14 16:03:38 2023 +0200 splice: don't call file_accessed in copy_splice_read copy_splice_read calls into ->read_iter to read the data, which already calls file_accessed. Fixes: 33b3b041543e ("splice: Add a func to do a splice from an O_DIRECT file without ITER_PIPE") Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Christian Brauner Reviewed-by: David Howells Link: https://lore.kernel.org/r/20230614140341.521331-2-hch@lst.de Signed-off-by: Jens Axboe commit ce282d8de71f07f0056ea319541141152c65f552 Author: Ziyang Huang Date: Thu Jun 15 14:41:48 2023 +0300 wifi: ath11k: Add missing hw_ops->get_ring_selector() for IPQ5018 During sending data after clients connected, hw_ops->get_ring_selector() will be called. But for IPQ5018, this member isn't set, and the following NULL pointer exception will be occurred: [ 38.840478] 8<--- cut here --- [ 38.840517] Unable to handle kernel NULL pointer dereference at virtual address 00000000 ... [ 38.923161] PC is at 0x0 [ 38.927930] LR is at ath11k_dp_tx+0x70/0x730 [ath11k] ... [ 39.063264] Process hostapd (pid: 1034, stack limit = 0x801ceb3d) [ 39.068994] Stack: (0x856a9a68 to 0x856aa000) ... [ 39.438467] [<7f323804>] (ath11k_dp_tx [ath11k]) from [<7f314e6c>] (ath11k_mac_op_tx+0x80/0x190 [ath11k]) [ 39.446607] [<7f314e6c>] (ath11k_mac_op_tx [ath11k]) from [<7f17dbe0>] (ieee80211_handle_wake_tx_queue+0x7c/0xc0 [mac80211]) [ 39.456162] [<7f17dbe0>] (ieee80211_handle_wake_tx_queue [mac80211]) from [<7f174450>] (ieee80211_probereq_get+0x584/0x704 [mac80211]) [ 39.467443] [<7f174450>] (ieee80211_probereq_get [mac80211]) from [<7f178c40>] (ieee80211_tx_prepare_skb+0x1f8/0x248 [mac80211]) [ 39.479334] [<7f178c40>] (ieee80211_tx_prepare_skb [mac80211]) from [<7f179e28>] (__ieee80211_subif_start_xmit+0x32c/0x3d4 [mac80211]) [ 39.491053] [<7f179e28>] (__ieee80211_subif_start_xmit [mac80211]) from [<7f17af08>] (ieee80211_tx_control_port+0x19c/0x288 [mac80211]) [ 39.502946] [<7f17af08>] (ieee80211_tx_control_port [mac80211]) from [<7f0fc704>] (nl80211_tx_control_port+0x174/0x1d4 [cfg80211]) [ 39.515017] [<7f0fc704>] (nl80211_tx_control_port [cfg80211]) from [<808ceac4>] (genl_rcv_msg+0x154/0x340) [ 39.526814] [<808ceac4>] (genl_rcv_msg) from [<808cdb74>] (netlink_rcv_skb+0xb8/0x11c) [ 39.536446] [<808cdb74>] (netlink_rcv_skb) from [<808ce1d0>] (genl_rcv+0x28/0x34) [ 39.544344] [<808ce1d0>] (genl_rcv) from [<808cd234>] (netlink_unicast+0x174/0x274) [ 39.551895] [<808cd234>] (netlink_unicast) from [<808cd510>] (netlink_sendmsg+0x1dc/0x440) [ 39.559362] [<808cd510>] (netlink_sendmsg) from [<808596e0>] (____sys_sendmsg+0x1a8/0x1fc) [ 39.567697] [<808596e0>] (____sys_sendmsg) from [<8085b1a8>] (___sys_sendmsg+0xa4/0xdc) [ 39.575941] [<8085b1a8>] (___sys_sendmsg) from [<8085b310>] (sys_sendmsg+0x44/0x74) [ 39.583841] [<8085b310>] (sys_sendmsg) from [<80300060>] (ret_fast_syscall+0x0/0x40) ... [ 39.620734] Code: bad PC value [ 39.625869] ---[ end trace 8aef983ad3cbc032 ]--- Fixes: ba60f2793d3a ("wifi: ath11k: initialize hw_ops for IPQ5018") Signed-off-by: Ziyang Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/TYZPR01MB5556D6E3F63EAB5129D11420C953A@TYZPR01MB5556.apcprd01.prod.exchangelabs.com commit 80c5390e1f5e5b16d820512265530ef26073d8e0 Author: Ziyang Huang Date: Thu Jun 15 14:41:48 2023 +0300 wifi: ath11k: Restart firmware after cold boot calibration for IPQ5018 Restart is required after cold boot calibration on IPQ5018. Otherwise, we get the following exception: [ 14.412829] qcom-q6-mpd cd00000.remoteproc: fatal error received: err_smem_ver.2.1: [ 14.412829] QC Image Version : QC_IMAGE_VERSION_STRING=WLAN.HK.2.6.0.1-00974-QCAHKSWPL_SILICONZ-1 [ 14.412829] Image Variant : IMAGE_VARIANT_STRING=5018.wlanfw2.map_spr_spr_evalQ [ 14.412829] DALSysLogEvent.c:174 Assertion 0 failed param0 :zero,param1 :zero,param2 :zero [ 14.412829] Thread ID : 0x00000048 Thread name : WLAN RT0 Process ID : 0x00000001 Process name :wlan0 [ 14.412829] [ 14.412829] Registers: [ 14.412829] SP : 0x4c81c120 [ 14.412829] FP : 0x4c81c138 [ 14.412829] PC : 0xb022c590 [ 14.412829] SSR : 0x00000000 [ 14.412829] BADVA : 0x00000000 [ 14.412829] LR : 0xb0008490 [ 14.412829] [ 14.412829] StackDump [ 14.412829] from:0x4c81c120 [ 14.412829] to: 0x00000000: [ 14.412829] [ 14.463006] remoteproc remoteproc0: crash detected in cd00000.remoteproc: type fatal error Fixes: 8dfe875aa24a ("wifi: ath11k: update hw params for IPQ5018") Signed-off-by: Ziyang Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/TYZPR01MB55566969818BD4B49E770445C953A@TYZPR01MB5556.apcprd01.prod.exchangelabs.com commit 469ddb20cae61cad9c4f208a4c8682305905a511 Author: Ziyang Huang Date: Thu Jun 15 14:41:47 2023 +0300 wifi: ath11k: Add missing ops config for IPQ5018 in ath11k_ahb_probe() Without this patch, the IPQ5018 WiFi will fail and print the following logs: [ 11.033179] ath11k c000000.wifi: unsupported device type 7 [ 11.033223] ath11k: probe of c000000.wifi failed with error -95 Fixes: 25edca7bb18a ("wifi: ath11k: add ipq5018 device support") Signed-off-by: Ziyang Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/TYZPR01MB5556D7AA10ABEDDDD2D8F39EC953A@TYZPR01MB5556.apcprd01.prod.exchangelabs.com commit 5fc136f3f48ce648d65e28b966a6b3493135af3d Merge: 51031cc3f903e 991e7ac609ee8 Author: Martin K. Petersen Date: Fri Jun 16 12:06:09 2023 -0400 Merge patch series "qla2xxx klocwork fixes" Nilesh Javali says: Please apply the qla2xxx driver klocwork fixes to the scsi tree at your earliest convenience. Link: https://lore.kernel.org/r/20230607113843.37185-1-njavali@marvell.com Signed-off-by: Martin K. Petersen commit 51031cc3f903e202cb79a27766e10227b9cace97 Author: Adrian Hunter Date: Tue Jun 13 20:03:27 2023 +0300 scsi: ufs: ufs-pci: Add support for Intel Arrow Lake Add PCI ID to support Intel Arrow Lake, same as MTL (Intel Meteor Lake). Signed-off-by: Adrian Hunter Link: https://lore.kernel.org/r/20230613170327.61186-1-adrian.hunter@intel.com Reviewed-by: Bart Van Assche Reviewed-by: Avri Altman Signed-off-by: Martin K. Petersen commit ce31dc540a01cab38943cdc2011cb1e4542ef5d7 Author: Johannes Thumshirn Date: Tue Jun 13 05:31:45 2023 -0700 scsi: sd: sd_zbc: Use PAGE_SECTORS_SHIFT Use PAGE_SECTORS_SHIFT instead of open-coding it. Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20230613-sd_zbc-page_sectors-v1-1-363460a4413d@wdc.com Reviewed-by: Niklas Cassel Signed-off-by: Martin K. Petersen commit e3d55626cff32cf7defff7f2053672adc4a712da Author: Lu Hongfei Date: Tue Jun 13 10:22:34 2023 +0800 scsi: ufs: wb: Add explicit flush_threshold sysfs attribute There are three flags that control Write Booster Feature: 1. WB ON/OFF 2. WB Hibern Flush ON/OFF (implicitly) 3. WB Flush ON/OFF (explicit) In the case of "Hibern Flush", one of the conditions for flush WB buffer is that avail_wb_buff < wb_flush_threshold. As we know, different users have different requirements for power consumption and performance. Therefore, we need the ability to manually set wb_flush_threshold, so that users can easily and flexibly adjust the wb_flush_threshold value, thereby achieving a balance between power consumption and performance. So the sysfs attribute that controls this is necessary. wb_flush_threshold represents the threshold for flushing WB buffer, whose value expressed in unit of 10% granularity, such as '1' representing 10%, '2' representing 20%, and so on. Signed-off-by: Lu Hongfei Link: https://lore.kernel.org/r/20230613022240.16595-1-luhongfei@vivo.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 56541c7c4468a9de26d82ba6e8c10ace286f8fdd Author: Abel Vesa Date: Mon Jun 12 22:28:46 2023 +0300 scsi: ufs: ufs-qcom: Switch to the new ICE API Now that there is a new dedicated ICE driver, drop the ufs-qcom-ice and use the new ICE api provided by the Qualcomm soc driver ice. The platforms that already have ICE support will use the API as library since there will not be a devicetree node, but instead they have reg range. In this case, the of_qcom_ice_get will return an ICE instance created for the consumer's device. But if there are platforms that do not have ice reg in the consumer devicetree node and instead provide a dedicated ICE devicetree node, the of_qcom_ice_get will look up the device based on qcom,ice property and will get the ICE instance registered by the probe function of the ice driver. The ICE clock is now handle by the new driver. This is done by enabling it on the creation of the ICE instance and then enabling/disabling it on UFS runtime resume/suspend. Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20230612192847.1599416-3-abel.vesa@linaro.org Reviewed-by: Eric Biggers Signed-off-by: Martin K. Petersen commit 29a6d1215b7cd5fdff9c3c31ea26076a694ee0a3 Author: Abel Vesa Date: Mon Jun 12 22:28:45 2023 +0300 scsi: ufs: dt-bindings: qcom: Add ICE phandle Starting with SM8550, the ICE will have its own devicetree node so add the qcom,ice property to reference it. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20230612192847.1599416-2-abel.vesa@linaro.org Signed-off-by: Martin K. Petersen commit 3c9b49be666679d64191b05c6f3e3fcc9259040d Author: Po-Wen Kao Date: Mon Jun 12 16:58:12 2023 +0800 scsi: ufs: ufs-mediatek: Set UFSHCD_QUIRK_MCQ_BROKEN_RTC quirk Enable UFSHCD_QUIRK_MCQ_BROKEN_RTC for MediaTek host. Signed-off-by: Po-Wen Kao Link: https://lore.kernel.org/r/20230612085817.12275-5-powen.kao@mediatek.com Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 95cd364ccc975e05881012832dc121c19049d405 Author: Po-Wen Kao Date: Mon Jun 12 16:58:11 2023 +0800 scsi: ufs: ufs-mediatek: Set UFSHCD_QUIRK_MCQ_BROKEN_INTR quirk Enable UFSHCD_QUIRK_MCQ_BROKEN_INTR for MediaTek host. Signed-off-by: Po-Wen Kao Link: https://lore.kernel.org/r/20230612085817.12275-4-powen.kao@mediatek.com Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Signed-off-by: Martin K. Petersen commit aa9d5d0015a8b73aa557ab45933efe9cb68a3784 Author: Po-Wen Kao Date: Mon Jun 12 16:58:10 2023 +0800 scsi: ufs: core: Add host quirk UFSHCD_QUIRK_MCQ_BROKEN_RTC Some hosts do not implement SQ Run Time Command (SQRTC) register, thus we need this quirk to skip the related flow. Signed-off-by: Po-Wen Kao Link: https://lore.kernel.org/r/20230612085817.12275-3-powen.kao@mediatek.com Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Signed-off-by: Martin K. Petersen commit c4ad4f2e6646dcd29a1ff7ff682bf650a67b0335 Author: Po-Wen Kao Date: Mon Jun 12 16:58:09 2023 +0800 scsi: ufs: core: Add host quirk UFSHCD_QUIRK_MCQ_BROKEN_INTR Quirk UFSHCD_QUIRK_MCQ_BROKEN_INTR is introduced for hosts that implement a different interrupt topology from the UFSHCI 4.0 spec. Some hosts raise per hw queue interrupt in addition to CQES (traditional) when ESI is disabled. Enabling this quirk will disable CQES and use only per hw queue interrupt. Signed-off-by: Po-Wen Kao Link: https://lore.kernel.org/r/20230612085817.12275-2-powen.kao@mediatek.com Reviewed-by: Stanley Chu Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit ccb23dc3435a0d9dbc07c5156a530a4aae6c851a Author: Po-Wen Kao Date: Sat Jun 10 10:15:52 2023 +0800 scsi: ufs: core: Remove dedicated hwq for dev command This commit depends on "scsi: ufs: core: mcq: Fix the incorrect OCS value for the device command" which takes care of the OCS value of dev commands in MCQ mode. It is safe to share first hwq for dev command and I/O request here. Tested-by: Po-Wen Kao Signed-off-by: Po-Wen Kao Link: https://lore.kernel.org/r/20230610021553.1213-3-powen.kao@mediatek.com Reviewed-by: Stanley Chu Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 0fef6bb730c490fcdc4347dbd21646d3ffe62cf5 Author: Stanley Chu Date: Sat Jun 10 10:15:51 2023 +0800 scsi: ufs: core: mcq: Fix the incorrect OCS value for the device command In MCQ mode, when a device command uses a hardware queue shared with other commands, a race condition may occur in the following scenario: 1. A device command is completed in CQx with CQE entry "e". 2. The interrupt handler copies the "cqe" pointer to "hba->dev_cmd.cqe" and completes "hba->dev_cmd.complete". 3. The "ufshcd_wait_for_dev_cmd()" function is awakened and retrieves the OCS value from "hba->dev_cmd.cqe". However, there is a possibility that the CQE entry "e" will be overwritten by newly completed commands in CQx, resulting in an incorrect OCS value being received by "ufshcd_wait_for_dev_cmd()". To avoid this race condition, the OCS value should be immediately copied to the struct "lrb" of the device command. Then "ufshcd_wait_for_dev_cmd()" can retrieve the OCS value from the struct "lrb". Fixes: 57b1c0ef89ac ("scsi: ufs: core: mcq: Add support to allocate multiple queues") Suggested-by: Can Guo Signed-off-by: Stanley Chu Link: https://lore.kernel.org/r/20230610021553.1213-2-powen.kao@mediatek.com Tested-by: Po-Wen Kao Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e246514ae698813ab1eadb1600aeea0a0c959769 Author: Krzysztof Kozlowski Date: Fri Jun 9 16:06:51 2023 +0200 scsi: ufs: dt-bindings: samsung,exynos: Drop unneeded quotes Clean up bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230609140651.64488-1-krzysztof.kozlowski@linaro.org Acked-by: Alim Akhtar Signed-off-by: Martin K. Petersen commit 01584c1e233740519d0e11aa20daa323d26bf598 Author: Damien Le Moal Date: Thu Jun 8 18:55:56 2023 +0900 scsi: block: Improve ioprio value validity checks The introduction of the macro IOPRIO_PRIO_LEVEL() in commit eca2040972b4 ("scsi: block: ioprio: Clean up interface definition") results in an iopriority level to always be masked using the macro IOPRIO_LEVEL_MASK, and thus to the kernel always seeing an acceptable value for an I/O priority level when checked in ioprio_check_cap(). Before this patch, this function would return an error for some (but not all) invalid values for a level valid range of [0..7]. Restore and improve the detection of invalid priority levels by introducing the inline function ioprio_value() to check an ioprio class, level and hint value before combining these fields into a single value to be used with ioprio_set() or AIOs. If an invalid value for the class, level or hint of an ioprio is detected, ioprio_value() returns an ioprio using the class IOPRIO_CLASS_INVALID, indicating an invalid value and causing ioprio_check_cap() to return -EINVAL. Fixes: 6c913257226a ("scsi: block: Introduce ioprio hints") Fixes: eca2040972b4 ("scsi: block: ioprio: Clean up interface definition") Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230608095556.124001-1-dlemoal@kernel.org Reviewed-by: Niklas Cassel Reviewed-by: Linus Walleij Signed-off-by: Martin K. Petersen commit 236f25529637db5526e2795194d631d41dadab4a Merge: f0854489fc07d 1c606f7f056b2 Author: Jens Axboe Date: Fri Jun 16 09:57:40 2023 -0600 Merge tag 'nvme-6.5-2023-06-16' of git://git.infradead.org/nvme into for-6.5/block Pull NVMe updates from Keith: "nvme updates for Linux 6.5 - Various cleanups all around (Irvin, Chaitanya, Christophe) - Better struct packing (Christophe JAILLET) - Reduce controller error logs for optional commands (Keith) - Support for >=64KiB block sizes (Daniel Gomez) - Fabrics fixes and code organization (Max, Chaitanya, Daniel Wagner)" * tag 'nvme-6.5-2023-06-16' of git://git.infradead.org/nvme: (27 commits) nvme: forward port sysfs delete fix nvme: skip optional id ctrl csi if it failed nvme-core: use nvme_ns_head_multipath instead of ns->head->disk nvmet-fcloop: Do not wait on completion when unregister fails nvme-fabrics: open code __nvmf_host_find() nvme-fabrics: error out to unlock the mutex nvme: Increase block size variable size to 32-bit nvme-fcloop: no need to return from void function nvmet-auth: remove unnecessary break after goto nvmet-auth: remove some dead code nvme-core: remove redundant check from nvme_init_ns_head nvme: move sysfs code to a dedicated sysfs.c file nvme-fabrics: prevent overriding of existing host nvme-fabrics: check hostid using uuid_equal nvme-fabrics: unify common code in admin and io queue connect nvmet: reorder fields in 'struct nvmefc_fcp_req' nvmet: reorder fields in 'struct nvme_dhchap_queue_context' nvmet: reorder fields in 'struct nvmf_ctrl_options' nvme: reorder fields in 'struct nvme_ctrl' nvmet: reorder fields in 'struct nvmet_sq' ... commit 1c606f7f056b266a84482d5522d35bbbbed062db Author: Keith Busch Date: Thu Jun 15 08:17:57 2023 -0700 nvme: forward port sysfs delete fix We had a late fix that modified nvme_sysfs_delete() after the staging branch for the next merge window relocated the function to a new file. Port commit 2eb94dd56a4a4 ("nvme: do not let the user delete a ctrl before a complete") to the latest to avoid a potentially confusing merge conflict. Cc: Maurizio Lombardi Cc: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit ef73d6a4ef0b35524125c3cfc6deafc26a0c966a Author: Arve Hjønnevåg Date: Fri Jun 2 21:23:46 2023 +0000 sched/wait: Fix a kthread_park race with wait_woken() kthread_park and wait_woken have a similar race that kthread_stop and wait_woken used to have before it was fixed in commit cb6538e740d7 ("sched/wait: Fix a kthread race with wait_woken()"). Extend that fix to also cover kthread_park. [jstultz: Made changes suggested by Peter to optimize memory loads] Signed-off-by: Arve Hjønnevåg Signed-off-by: John Stultz Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20230602212350.535358-1-jstultz@google.com commit 0cce0fde499a92c726cd2e24f7763644f7c9f971 Author: Miaohe Lin Date: Sat Jun 3 15:36:45 2023 +0800 sched/topology: Mark set_sched_topology() __init All callers of set_sched_topology() are within __init section. Mark it __init too. Signed-off-by: Miaohe Lin Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20230603073645.1173332-1-linmiaohe@huawei.com commit a707df30c9438a9d4d0a43ae7f22b59b078f94c4 Author: Tom Rix Date: Sun Jun 11 08:25:35 2023 -0400 sched/fair: Rename variable cpu_util eff_util cppcheck reports kernel/sched/fair.c:7436:17: style: Local variable 'cpu_util' shadows outer function [shadowFunction] unsigned long cpu_util; ^ Clean this up by renaming the variable to eff_util Signed-off-by: Tom Rix Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Reviewed-by: Dietmar Eggemann Link: https://lore.kernel.org/r/20230611122535.183654-1-trix@redhat.com commit 669f1f48b07f5dd9146988fab57cbc06794b8c73 Author: Orlando Chamberlain Date: Wed Jun 14 16:49:32 2023 +1000 platform/x86: apple-gmux: don't use be32_to_cpu and cpu_to_be32 Sparce doesn't seem to like using be32_to_cpu and cpu_to_be32 to convert values for the MMIO gmux to/from the host architecture. Instead use iowrite32be and ioread32be to always convert, which should be fine because apple-gmux is only used on x86 with is always little endian. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305161712.5l3f4iI4-lkp@intel.com/ Signed-off-by: Orlando Chamberlain Link: https://lore.kernel.org/r/20230614064931.3263-2-orlandoch.dev@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit b33eb50a92b0a298fa8a6ac350e741c3ec100f6d Author: Mark Rutland Date: Thu Jun 15 14:27:34 2023 +0100 locking/atomic: scripts: fix ${atomic}_dec_if_positive() kerneldoc The ${atomic}_dec_if_positive() ops are unlike all the other conditional atomic ops. Rather than returning a boolean success value, these return the value that the atomic variable would be updated to, even when no update is performed. We missed this when adding kerneldoc comments, and the documentation for ${atomic}_dec_if_positive() erroneously states: | Return: @true if @v was updated, @false otherwise. Ideally we'd clean this up by aligning ${atomic}_dec_if_positive() with the usual atomic op conventions: with ${atomic}_fetch_dec_if_positive() for those who care about the value of the varaible, and ${atomic}_dec_if_positive() returning a boolean success value. In the mean time, align the documentation with the current reality. Fixes: ad8110706f381170 ("locking/atomic: scripts: generate kerneldoc comments") Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paul E. McKenney Link: https://lore.kernel.org/r/20230615132734.1119765-1-mark.rutland@arm.com commit b4da4e112ade4e7c59cf915c702b14d69b528824 Author: Lu Baolu Date: Wed Jun 14 10:47:05 2023 +0800 iommu/vt-d: Remove commented-out code These lines of code were commented out when they were first added in commit ba39592764ed ("Intel IOMMU: Intel IOMMU driver"). We do not want to restore them because the VT-d spec has deprecated the read/write draining hit. VT-d spec (section 11.4.2): " Hardware implementation with Major Version 2 or higher (VER_REG), always performs required drain without software explicitly requesting a drain in IOTLB invalidation. This field is deprecated and hardware will always report it as 1 to maintain backward compatibility with software. " Remove the code to make the code cleaner. Signed-off-by: Lu Baolu Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230609060514.15154-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 3f13f72787bcd15792c01a34c2aed8bdf38397bb Author: Yanfei Xu Date: Wed Jun 14 10:47:04 2023 +0800 iommu/vt-d: Remove two WARN_ON in domain_context_mapping_one() Remove the WARN_ON(did == 0) as the domain id 0 is reserved and set once the domain_ids is allocated. So iommu_init_domains will never return 0. Remove the WARN_ON(!table) as this pointer will be accessed in the following code, if empty "table" really happens, the kernel will report a NULL pointer reference warning at the first place. Signed-off-by: Yanfei Xu Link: https://lore.kernel.org/r/20230605112659.308981-3-yanfei.xu@intel.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit a0e9911ac14baf46d8a8bea322c5bd7b3845825c Author: Yanfei Xu Date: Wed Jun 14 10:47:03 2023 +0800 iommu/vt-d: Handle the failure case of dmar_reenable_qi() dmar_reenable_qi() may not succeed. Check and return when it fails. Signed-off-by: Yanfei Xu Link: https://lore.kernel.org/r/20230605112659.308981-2-yanfei.xu@intel.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit 82d9654f92fd858d3b36c6f189dcfa850f2dfa29 Author: Suhui Date: Wed Jun 14 10:47:02 2023 +0800 iommu/vt-d: Remove unnecessary (void*) conversions No need cast (void*) to (struct root_entry *). Signed-off-by: Suhui Link: https://lore.kernel.org/r/20230425033743.75986-1-suhui@nfschina.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit 78db2985c2f6617cffb302618917400ad313153d Author: Vasant Hegde Date: Fri Jun 9 09:06:31 2023 +0000 iommu/amd: Remove extern from function prototypes The kernel coding style does not require 'extern' in function prototypes. Hence remove them from header file. No functional change intended. Suggested-by: Yazen Ghannam Signed-off-by: Vasant Hegde Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230609090631.6052-2-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit d18f4ee219824f2a0d84590fe537b575eeb5e413 Author: Vasant Hegde Date: Fri Jun 9 09:06:30 2023 +0000 iommu/amd: Use BIT/BIT_ULL macro to define bit fields Make use of BIT macro when defining bitfields which makes it easy to read. No functional change intended. Suggested-by: Yazen Ghannam Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20230609090631.6052-1-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit f8c25662028b38f31f55f9c5d8da45a75dbf094a Author: Jonathan Corbet Date: Fri May 19 10:31:30 2023 -0600 dt-bindings: Update Documentation/arm references The Arm documentation has moved to Documentation/arch/arm; update one devicetree reference to match. Cc: Krzysztof Kozlowski Cc: devicetree@vger.kernel.org Acked-by: Conor Dooley Acked-by: Rob Herring Signed-off-by: Jonathan Corbet commit 173cb655ea4bbcc5d3b7e0397cad99bfb89c8670 Author: Jonathan Corbet Date: Wed May 3 16:55:08 2023 -0600 docs: update some straggling Documentation/arm references The Arm documentation has moved to Documentation/arch/arm; update the last remaining references to match. Cc: Dmitry Torokhov Cc: Chen-Yu Tsai Cc: Samuel Holland Cc: Thierry Reding Acked-by: Nicolas Ferre Acked-by: Jernej Skrabec Acked-by: Greg Kroah-Hartman Acked-by: Uwe Kleine-König # for pwm Signed-off-by: Jonathan Corbet commit 85751a8af5c9cf8724a71735ba0962bbd5fccfad Author: Vasant Hegde Date: Fri Jun 9 09:03:27 2023 +0000 iommu/amd: Fix DTE_IRQ_PHYS_ADDR_MASK macro Interrupt Table Root Pointer is 52 bit and table must be aligned to start on a 128-byte boundary. Hence first 6 bits are ignored. Current code uses address mask as 45 instead of 46bit. Use GENMASK_ULL macro instead of manually generating address mask. Signed-off-by: Vasant Hegde Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230609090327.5923-1-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 95b4d47a44506a7dc924f10450280aeab20424d3 Author: Randy Dunlap Date: Sun Jun 11 20:08:10 2023 -0700 Documentation: KVM: make corrections to vcpu-requests.rst Make corrections to punctuation and grammar. Signed-off-by: Randy Dunlap Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Andrew Jones Cc: Christoffer Dall Cc: kvm@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230612030810.23376-5-rdunlap@infradead.org commit daa3a39731fcdb30b682f4c85cbb9d1b69848068 Author: Randy Dunlap Date: Sun Jun 11 20:08:09 2023 -0700 Documentation: KVM: make corrections to ppc-pv.rst Correct the path of a header file. Change "guest to ... guest" to "guest to ... host" in one place. Hyphenate "32-bit" systems. Add a comma at one parenthetical phrase. Signed-off-by: Randy Dunlap Cc: Paolo Bonzini Cc: Sean Christopherson Cc: kvm@vger.kernel.org Cc: Alexander Graf Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230612030810.23376-4-rdunlap@infradead.org commit c37fa9dbb72e73a412c567cddfa91b0053b0bd68 Author: Randy Dunlap Date: Sun Jun 11 20:08:08 2023 -0700 Documentation: KVM: make corrections to locking.rst Correct grammar and punctuation. Use "read-only" for consistency. Signed-off-by: Randy Dunlap Cc: Sean Christopherson Cc: Paolo Bonzini Cc: kvm@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230612030810.23376-3-rdunlap@infradead.org commit 4c60d49913057ad0dc282bb3580f87fc3a80efbd Author: Randy Dunlap Date: Sun Jun 11 20:08:07 2023 -0700 Documentation: KVM: make corrections to halt-polling.rst Module parameters are in sysfs, not debugfs, so change that. Remove superfluous "that" following "Note:". Hyphenate "system-wide" values. Hyphenate "trade-off". Don't treat "denial of service" as a verb. Signed-off-by: Randy Dunlap Cc: Suraj Jitindar Singh Cc: Paolo Bonzini Cc: Sean Christopherson Cc: kvm@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230612030810.23376-2-rdunlap@infradead.org commit 1954d51592b57c05e85e606af5705570f1839889 Author: Randy Dunlap Date: Fri Jun 9 22:43:02 2023 -0700 Documentation: virt: correct location of haltpoll module params Module parameters are located in sysfs, not debugfs, so correct the statement. Signed-off-by: Randy Dunlap Cc: Marcelo Tosatti Cc: "Rafael J. Wysocki" Link: https://lore.kernel.org/r/20230610054302.6223-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet commit e72ef2d2ba39bad77f37536817124ae52c90e7cf Author: Linus Walleij Date: Wed Jun 14 09:25:48 2023 +0200 Documentation/mm: Initial page table documentation This is based on an earlier blog post at people.kernel.org, it describes the concepts about page tables that were hardest for me to grasp when dealing with them for the first time, such as the prevalent three-letter acronyms pfn, pgd, p4d, pud, pmd and pte. I don't know if this is what people want, but it's what I would have wanted. The wording, introduction, choice of initial subjects and choice of style is mine. I discussed at one point with Mike Rapoport to bring this into the kernel documentation, so here is a small proposal. The current form is augmented in response to feedback from Mike Rapoport, Matthew Wilcox, Jonathan Cameron, Kuan-Ying Lee, Randy Dunlap and Bagas Sanjaya. Cc: Matthew Wilcox Reviewed-by: Mike Rapoport Reviewed-by: Jonathan Cameron Link: https://people.kernel.org/linusw/arm32-page-tables Signed-off-by: Linus Walleij Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230614072548.996940-1-linus.walleij@linaro.org commit bb6b369cb42737afa4114f371868eb1d858ff36e Author: Tiezhu Yang Date: Fri Jun 16 09:56:07 2023 +0800 perf test record+probe_libc_inet_pton.sh: Use "grep -F" instead of obsolescent "fgrep" There exists the following warning when executing 'perf test record+probe_libc_inet_pton.sh': fgrep: warning: fgrep is obsolescent; using grep -F This is tested on Fedora 38, the version of grep is 3.8, the latest version of grep claims the fgrep is obsolete, use "grep -F" instead of "fgrep" to silence the warning. Signed-off-by: Tiezhu Yang Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: loongson-kernel@lists.loongnix.cn Link: https://lore.kernel.org/r/1686880567-30017-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Arnaldo Carvalho de Melo commit 60e07fa49b3201d7201cdd7286e7d51e8d937a28 Author: Juerg Haefliger Date: Fri Jun 16 13:54:32 2023 +0200 ASoC: codecs: wm0010: Add MODULE_FIRMWARE macros The module loads firmware so add MODULE_FIRMWARE macros to provide that information via modinfo. Signed-off-by: Juerg Haefliger Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230616115432.1011707-1-juerg.haefliger@canonical.com Signed-off-by: Mark Brown commit 0f9c14e57818d077ceca060b8a0d0ee5ed3abd95 Author: Juerg Haefliger Date: Fri Jun 16 13:55:49 2023 +0200 ASoC: rt5677: Add MODULE_FIRMWARE macro The module loads firmware so add a MODULE_FIRMWARE macro to provide that information via modinfo. Signed-off-by: Juerg Haefliger Link: https://lore.kernel.org/r/20230616115549.1011903-1-juerg.haefliger@canonical.com Signed-off-by: Mark Brown commit 289650d61c600ac4f631028c761f38042ba599c8 Author: Alexander Stein Date: Fri Jun 16 10:35:49 2023 +0200 ASoC: dt-bindings: tlv320aic32x4: convert to DT schema format Convert the binding to DT schema format. Since commit 514b044cba667 ("ASoC: tlv320aic32x4: Model PLL in CCF") clocks & clock-names = "mclk" is mandatory, it has been added to required properties as well. '#sound-dai-cells' is added for reference from simple-audio-card. Signed-off-by: Alexander Stein Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230616083549.2331830-1-alexander.stein@ew.tq-group.com Signed-off-by: Mark Brown commit 1a32b4b9a6229233de70cec28fb5a87fabac2c41 Merge: 928314eb06709 f9fd804aa0a36 Author: Mark Brown Date: Fri Jun 16 14:55:20 2023 +0100 ASoC: Merge fixes due to dependencies So we can apply the tlv320aic3xxx DT conversion. commit 5752c20f3787c9bc9ff9411a70b3d41add85518c Author: Ravi Bangoria Date: Thu Jun 15 10:47:00 2023 +0530 perf mem: Scan all PMUs instead of just core ones Scanning only core PMUs is not sufficient on platforms like AMD since perf mem on AMD uses IBS OP PMU, which is independent of core PMU. Scan all PMUs instead of just core PMUs. There should be negligible performance overhead because of scanning all PMUs, so we should be okay. Reviewed-by: Ian Rogers Signed-off-by: Ravi Bangoria Cc: Adrian Hunter Cc: Ali Saidi Cc: Ananth Narayan Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Cc: Thomas Richter Link: https://lore.kernel.org/r/20230615051700.1833-4-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit f0dc208267bb744e3b2008bb11f68d02663330ef Author: Ravi Bangoria Date: Thu Jun 15 10:46:59 2023 +0530 perf mem amd: Fix perf_pmus__num_mem_pmus() perf mem/c2c on AMD internally uses IBS OP PMU, not the core PMU. Also, AMD platforms does not have heterogeneous PMUs. Reviewed-by: Ian Rogers Signed-off-by: Ravi Bangoria Cc: Adrian Hunter Cc: Ali Saidi Cc: Ananth Narayan Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Cc: Thomas Richter Link: https://lore.kernel.org/r/20230615051700.1833-3-ravi.bangoria@amd.com [ Added the improved comment for perf_pmus__num_mem_pmus() as b4 didn't from the per-patch (not series) newer version ] Signed-off-by: Arnaldo Carvalho de Melo commit cddfc5fb3f91b00b5d6818d974ed46184e8762a3 Author: Ravi Bangoria Date: Thu Jun 15 10:46:58 2023 +0530 perf pmus: Describe semantics of 'core_pmus' and 'other_pmus' Notion of 'core_pmus' and 'other_pmus' are independent of hw core and uncore pmus. For example, AMD IBS PMUs are present in each SMT-thread but they belongs to 'other_pmus'. Add a comment describing what these list contains and how they are treated. Reviewed-by: Ian Rogers Signed-off-by: Ravi Bangoria Cc: Adrian Hunter Cc: Ali Saidi Cc: Ananth Narayan Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Cc: Thomas Richter Link: https://lore.kernel.org/r/20230615051700.1833-2-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit dada1a1f5fbccc74e9e6754fc586b1e8b82ac0af Author: Namhyung Kim Date: Fri Jun 16 00:32:11 2023 -0700 perf stat: Show average value on multiple runs When -r option is used, perf stat runs the command multiple times and update stats in the evsel->stats.res_stats for global aggregation. But the value is never used and the value it prints at the end is just the value from the last run. I think we should print the average number of multiple runs. Add evlist__copy_res_stats() to update the aggr counter (for display) using the values in the evsel->stats.res_stats. Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230616073211.1057936-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ed4090a22c123b9b33368741253edddc6ff8d18f Author: Namhyung Kim Date: Fri Jun 16 00:32:10 2023 -0700 perf stat: Reset aggr stats for each run When it runs multiple times with -r option, it missed to reset the aggregation counters and the values were added up. The aggregation count has the values to be printed in the end. It should reset the counters at the beginning of each run. But the current code does that only when -I/--interval-print option is given. Fixes: 91f85f98da7ab8c3 ("perf stat: Display event stats using aggr counts") Reported-by: Jiri Olsa Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230616073211.1057936-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 6fbd67b0f067bb1708d4c1a97b1ad53750b906b2 Author: Thomas Richter Date: Fri Jun 16 10:14:37 2023 +0200 perf test: fix failing test cases on linux-next for s390 In linux-next tree the many test cases fail on s390x when running the perf test suite, sometime the perf tool dumps core. Output before: 6.1: Test event parsing : FAILED! 10.3: Parsing of PMU event table metrics : FAILED! 10.4: Parsing of PMU event table metrics with fake PMUs: FAILED! 17: Setup struct perf_event_attr : FAILED! 24: Number of exit events of a simple workload : FAILED! 26: Object code reading : FAILED! 28: Use a dummy software event to keep tracking : FAILED! 35: Track with sched_switch : FAILED! 42.3: BPF prologue generation : FAILED! 66: Parse and process metrics : FAILED! 68: Event expansion for cgroups : FAILED! 69.2: Perf time to TSC : FAILED! 74: build id cache operations : FAILED! 86: Zstd perf.data compression/decompression : FAILED! 87: perf record tests : FAILED! 106: Test java symbol : FAILED! The reason for all these failure is a missing PMU. On s390x the PMU is named cpum_cf which is not detected as core PMU. A similar patch was added before, see commit 9bacbced0e32204d ("perf list: Add s390 support for detailed PMU event description") which got lost during the recent reworks. Add it again. Output after: 10.2: PMU event map aliases : FAILED! 42.3: BPF prologue generation : FAILED! Most test cases now work and there is not core dump anymore. Signed-off-by: Thomas Richter Cc: Heiko Carstens Cc: Ian Rogers Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Vasily Gorbik Link: https://lore.kernel.org/r/20230616081437.1932003-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 81b64c0593537bc6ebca9aa35c97f6f3bcbbf401 Author: Andy Shevchenko Date: Thu Jun 15 19:41:58 2023 +0300 pinctrl: spear: Remove unused of_gpio.h inclusion The of_gpio.h is not and shouldn't be used in the drivers. Remove it. Signed-off-by: Andy Shevchenko Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20230615164158.25406-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit c8b68d527ed1c9aabfe46ed876b4bdb68a3c337b Author: Andy Shevchenko Date: Thu Jun 15 19:42:04 2023 +0300 pinctrl: lantiq: Remove unused of_gpio.h inclusion The of_gpio.h is not and shouldn't be used in the drivers. Remove it. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230615164204.25462-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 66dc1920f6bbc172ee35520d024977d5330df842 Author: Vincent Whitchurch Date: Fri Nov 25 12:42:09 2022 +0100 perf annotate: Work with vmlinux outside symfs It is currently possible to use --symfs along with a vmlinux which lies outside of the symfs by passing an absolute path to --vmlinux, thanks to the check in dso__load_vmlinux() which handles this explicitly. However, the annotate code lacks this check and thus 'perf annotate' does not work ("Internal error: Invalid -1 error code") for kernel functions with this combination. Add the missing handling. Signed-off-by: Vincent Whitchurch Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: kernel@axis.com Link: https://lore.kernel.org/r/20221125114210.2353820-1-vincent.whitchurch@axis.com Signed-off-by: Arnaldo Carvalho de Melo commit f6fd5d4ff8ca0b24cee1af4130bcb1fa96b61aa0 Author: Claudiu Beznea Date: Thu Jun 15 13:53:33 2023 +0300 pinctrl: at91-pio4: check return value of devm_kasprintf() devm_kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: 776180848b57 ("pinctrl: introduce driver for Atmel PIO4 controller") Depends-on: 1c4e5c470a56 ("pinctrl: at91: use devm_kasprintf() to avoid potential leaks") Depends-on: 5a8f9cf269e8 ("pinctrl: at91-pio4: use proper format specifier for unsigned int") Signed-off-by: Claudiu Beznea Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230615105333.585304-4-claudiu.beznea@microchip.com Signed-off-by: Linus Walleij commit 310cd4c206cd04696ccbfd1927b5ab6973e8cc8e Author: Claudiu Beznea Date: Thu Jun 15 13:53:32 2023 +0300 pinctrl: microchip-sgpio: check return value of devm_kasprintf() devm_kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: 7e5ea974e61c ("pinctrl: pinctrl-microchip-sgpio: Add pinctrl driver for Microsemi Serial GPIO") Signed-off-by: Claudiu Beznea Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230615105333.585304-3-claudiu.beznea@microchip.com Signed-off-by: Linus Walleij commit f962514052aa5e8973343af1b1ba041d61424405 Author: Kan Liang Date: Thu Jun 15 20:14:20 2023 -0700 perf vendor events arm64: Add default tags for Hisi hip08 L1 metrics Add the default tags for Hisi hip08 as well. Signed-off-by: Kan Liang Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230616031420.3751973-6-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 99a04a48f22504fc6319a24835e2db7934fae41e Author: Kan Liang Date: Thu Jun 15 20:14:19 2023 -0700 perf test: Add test case for the standard 'perf stat' output Add a new test case to verify the standard 'perf stat' output with different options. Reviewed-by: Ian Rogers Signed-off-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230616031420.3751973-5-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 9063777ca1e2e895c5fdd493ee0c3f18fa710ed4 Author: Xiaolei Wang Date: Fri May 5 07:37:36 2023 +0800 pinctrl: freescale: Fix a memory out of bounds when num_configs is 1 The config passed in by pad wakeup is 1, when num_configs is 1, Configuration [1] should not be fetched, which will be detected by KASAN as a memory out of bounds condition. Modify to get configs[1] when num_configs is 2. Fixes: f60c9eac54af ("gpio: mxc: enable pad wakeup on i.MX8x platforms") Signed-off-by: Xiaolei Wang Reviewed-by: Peng Fan Link: https://lore.kernel.org/r/20230504233736.3766296-1-xiaolei.wang@windriver.com Signed-off-by: Linus Walleij commit fc51fc87b1b84db83907c125bda6b05d52ec21ca Author: Kan Liang Date: Thu Jun 15 20:14:18 2023 -0700 perf test: Move all the check functions of stat CSV output to lib These functions can be shared with the stat std output test. There is no functional change. Reviewed-by: Ian Rogers Signed-off-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230616031420.3751973-4-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 6a80d794d796d22910c03d3e52a3bf0d885326a7 Author: Kan Liang Date: Thu Jun 15 20:14:17 2023 -0700 perf stat: New metricgroup output for the default mode In the default mode, the current output of the metricgroup include both events and metrics, which is not necessary and just makes the output hard to read. Since different ARCHs (even different generations in the same ARCH) may use different events. The output also vary on different platforms. For a metricgroup, only outputting the value of each metric is good enough. Add a new field default_metricgroup in evsel to indicate an event of the default metricgroup. For those events, printout() should print the metricgroup name rather than each event. Add perf_stat__skip_metric_event() to skip the evsel in the Default metricgroup, if it's not running or not the metric event. Add print_metricgroup_header_t to pass the functions which print the display name of each metricgroup in the Default metricgroup. Support all three output methods. Factor out perf_stat__print_shadow_stats_metricgroup() to print out each metrics. On SPR: Before: ./perf_old stat sleep 1 Performance counter stats for 'sleep 1': 0.54 msec task-clock:u # 0.001 CPUs utilized 0 context-switches:u # 0.000 /sec 0 cpu-migrations:u # 0.000 /sec 68 page-faults:u # 125.445 K/sec 540,970 cycles:u # 0.998 GHz 556,325 instructions:u # 1.03 insn per cycle 123,602 branches:u # 228.018 M/sec 6,889 branch-misses:u # 5.57% of all branches 3,245,820 TOPDOWN.SLOTS:u # 18.4 % tma_backend_bound # 17.2 % tma_retiring # 23.1 % tma_bad_speculation # 41.4 % tma_frontend_bound 564,859 topdown-retiring:u 1,370,999 topdown-fe-bound:u 603,271 topdown-be-bound:u 744,874 topdown-bad-spec:u 12,661 INT_MISC.UOP_DROPPING:u # 23.357 M/sec 1.001798215 seconds time elapsed 0.000193000 seconds user 0.001700000 seconds sys After: $ ./perf stat sleep 1 Performance counter stats for 'sleep 1': 0.51 msec task-clock:u # 0.001 CPUs utilized 0 context-switches:u # 0.000 /sec 0 cpu-migrations:u # 0.000 /sec 68 page-faults:u # 132.683 K/sec 545,228 cycles:u # 1.064 GHz 555,509 instructions:u # 1.02 insn per cycle 123,574 branches:u # 241.120 M/sec 6,957 branch-misses:u # 5.63% of all branches TopdownL1 # 17.5 % tma_backend_bound # 22.6 % tma_bad_speculation # 42.7 % tma_frontend_bound # 17.1 % tma_retiring TopdownL2 # 21.8 % tma_branch_mispredicts # 11.5 % tma_core_bound # 13.4 % tma_fetch_bandwidth # 29.3 % tma_fetch_latency # 2.7 % tma_heavy_operations # 14.5 % tma_light_operations # 0.8 % tma_machine_clears # 6.1 % tma_memory_bound 1.001712086 seconds time elapsed 0.000151000 seconds user 0.001618000 seconds sys Reviewed-by: Ian Rogers Signed-off-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230616031420.3751973-3-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 1c0e47956a8e1109ad9635b7fab3f2de515dd598 Author: Kan Liang Date: Thu Jun 15 20:14:16 2023 -0700 perf metrics: Sort the Default metricgroup The new default mode will print the metrics as a metric group. The metrics from the same metric group must be adjacent to each other in the metric list. But the metric_list_cmp() sorts metrics by the number of events. Add a new sort for the Default metricgroup, which sorts by default_metricgroup_name and metric_name. Add is_default in the struct metric_event to indicate that it's from the Default metricgroup. Store the displayed metricgroup name of the Default metricgroup into the metric expr for output. Reviewed-by: Ian Rogers Signed-off-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230616031420.3751973-2-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d614dcb225a8af349b73b8e9bbda4374571d4b9e Author: Giovanni Cabiddu Date: Fri Jun 9 20:42:46 2023 +0100 crypto: qat - do not export adf_init_admin_pm() The function adf_init_admin_pm() is not used outside of the intel_qat module. Do not export it. Signed-off-by: Giovanni Cabiddu Reviewed-by: Damian Muszynski Reviewed-by: Andy Shevchenko Signed-off-by: Herbert Xu commit ee174e266d603f18ab145617373de4f3f5403c89 Author: Rob Herring Date: Fri Jun 9 12:31:05 2023 -0600 crypto: n2 - Use of_property_read_reg() to parse "reg" Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Signed-off-by: Rob Herring Signed-off-by: Herbert Xu commit 2382b5ae80467cb61339db130a07e5075ebb270d Author: Lucas Segarra Fernandez Date: Fri Jun 9 19:06:14 2023 +0200 crypto: qat - expose pm_idle_enabled through sysfs Expose 'pm_idle_enabled' sysfs attribute. This attribute controls how idle conditions are handled. If it is set to 1 (idle support enabled) when the device detects an idle condition, the driver will transition the device to the 'MIN' power configuration. In order to set the value of this attribute for a device, the device must be in the 'down' state. This only applies to qat_4xxx generation. Signed-off-by: Lucas Segarra Fernandez Reviewed-by: Giovanni Cabiddu Reviewed-by: Andy Shevchenko Signed-off-by: Herbert Xu commit 5005327514064840c6713b793cd80c5b98afba3d Author: Adam Guerin Date: Fri Jun 9 17:38:22 2023 +0100 crypto: qat - extend configuration for 4xxx A QAT GEN4 device can be currently configured for crypto (sym;asym) or compression (dc). This patch extends the configuration to support more variations of these services, download the correct FW images on the device and report the correct capabilities on the device based on the configured service. The device can now be configured with the following services: "sym", "asym", "dc", "sym;asym", "asym;sym", "sym;dc", "dc;sym", "asym;dc", "dc;asym". With this change, the configuration "sym", "asym", "sym;dc", "dc;sym", "asym;dc", "dc;asym" will be accessible only via userspace, i.e. the driver for those configurations will not register into the crypto framework. Support for such configurations in kernel will be enabled in a later patch. The pairs "sym;asym" and "asym;sym" result in identical device config. As do "sym;dc", "dc;sym", and "asym;dc", "dc;asym". Signed-off-by: Adam Guerin Reviewed-by: Giovanni Cabiddu Reviewed-by: Andy Shevchenko Signed-off-by: Herbert Xu commit 10484c647af6b1952d1675e83be9cc976cdb6a96 Author: Giovanni Cabiddu Date: Fri Jun 9 17:38:21 2023 +0100 crypto: qat - refactor fw config logic for 4xxx The data structure adf_fw_config is used to select which firmware image is loaded on a certain set of accelerator engines. When support for 402xx was added, the adf_fw_config arrays were duplicated in order to select different firmware images. Since the configurations are the same regardless of the QAT GEN4 flavour, in preparation for adding support for multiple configurations, refactor the logic that retrieves the firmware names in the 4xxx driver. The structure adf_fw_config has been changed to contain a firmware object id that is then mapped to a firmware name depending of the device type. Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Reviewed-by: Andy Shevchenko Signed-off-by: Herbert Xu commit 52f9a2848b962fb68c212930b4bfe9754fd80ac4 Author: Giovanni Cabiddu Date: Fri Jun 9 17:38:20 2023 +0100 crypto: qat - make fw images name constant Update fw image names to be constant throughout the driver. Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Reviewed-by: Andy Shevchenko Signed-off-by: Herbert Xu commit 038ccc2876686a508d9d46d23ad540a5ad6a969f Author: Adam Guerin Date: Fri Jun 9 17:38:19 2023 +0100 crypto: qat - move returns to default case Make use of the default statements by changing the pattern: switch(condition) { case COND_A: ... break; case COND_b: ... break; } return ret; in switch(condition) { case COND_A: ... break; case COND_b: ... break; default: return ret; } Signed-off-by: Adam Guerin Reviewed-by: Giovanni Cabiddu Reviewed-by: Andy Shevchenko Signed-off-by: Herbert Xu commit f75bd28beb4a804a42a01e26f162f8c42b65fb09 Author: Franziska Naepelt Date: Tue Jun 6 13:17:49 2023 +0200 crypto: hmac - Add missing blank line The following checkpatch warning has been fixed: - WARNING: Missing a blank line after declarations Signed-off-by: Franziska Naepelt Signed-off-by: Herbert Xu commit d776b25495f2c71b9dbf1f5e53b642215ba72f3c Author: Hareshx Sankar Raj Date: Mon Jun 5 22:06:07 2023 +0100 crypto: qat - unmap buffers before free for RSA The callback function for RSA frees the memory allocated for the source and destination buffers before unmapping them. This sequence is wrong. Change the cleanup sequence to unmap the buffers before freeing them. Fixes: 3dfaf0071ed7 ("crypto: qat - remove dma_free_coherent() for RSA") Signed-off-by: Hareshx Sankar Raj Co-developed-by: Bolemx Sivanagaleela Signed-off-by: Bolemx Sivanagaleela Reviewed-by: Giovanni Cabiddu Reviewed-by: Andy Shevchenko Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit eb7713f5ca97697b92f225127440d1525119b8de Author: Hareshx Sankar Raj Date: Mon Jun 5 22:06:06 2023 +0100 crypto: qat - unmap buffer before free for DH The callback function for DH frees the memory allocated for the destination buffer before unmapping it. This sequence is wrong. Change the cleanup sequence to unmap the buffer before freeing it. Fixes: 029aa4624a7f ("crypto: qat - remove dma_free_coherent() for DH") Signed-off-by: Hareshx Sankar Raj Co-developed-by: Bolemx Sivanagaleela Signed-off-by: Bolemx Sivanagaleela Reviewed-by: Giovanni Cabiddu Reviewed-by: Andy Shevchenko Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 0ee03b8c8576bf00bd65e60f9a6bb49ca17102ae Author: Ben Schneider Date: Sat Jun 3 05:23:56 2023 +0000 arm64: dts: marvell: Fix espressobin-ultra boot failure and wifi Boot hangs on EspressoBIN Ultra (Armada 3720) after a message that device vcc_sd1 had been disabled. The device manufacturer patched this issue in their kernel fork noting that vcc_sd1 is used by the EspressoBIN model but not the EspressoBIN Ultra. Removing the device from the tree fixes the boot hang and wifi. Signed-off-by: Ben Schneider Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit fe96d8b2a59f46d8d30977ffe5edf745e889c1ee Author: Geert Uytterhoeven Date: Tue May 23 17:50:21 2023 +0200 arm64: dts: marvell: Fix pca954x i2c-mux node names "make dtbs_check": arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtb: i2c-switch@70: $nodename:0: 'i2c-switch@70' does not match '^(i2c-?)?mux' From schema: Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtb: i2c-switch@70: Unevaluated properties are not allowed ('#address-cells', '#size-cells', 'i2c@0', 'i2c@1', 'i2c@2' were unexpected) From schema: Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml ... Fix this by renaming PCA954x nodes to "i2c-mux", to match the I2C bus multiplexer/switch DT bindings and the Generic Names Recommendation in the Devicetree Specification. Signed-off-by: Geert Uytterhoeven Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit fb07b8f83441febeb0daf199b5f18c6de9bbab03 Author: Jianmin Lv Date: Wed Jun 14 19:59:36 2023 +0800 irqchip/loongson-eiointc: Fix irq affinity setting during resume The hierarchy of PCH PIC, PCH PCI MSI and EIONTC is as following: PCH PIC ------->| |---->EIOINTC PCH PCI MSI --->| so the irq_data list of irq_desc for IRQs on PCH PIC and PCH PCI MSI is like this: irq_desc->irq_data(domain: PCH PIC)->parent_data(domain: EIOINTC) irq_desc->irq_data(domain: PCH PCI MSI)->parent_data(domain: EIOINTC) In eiointc_resume(), the irq_data passed into eiointc_set_irq_affinity() should be matched to EIOINTC domain instead of PCH PIC or PCH PCI MSI domain, so fix it. Fixes: a90335c2dfb4 ("irqchip/loongson-eiointc: Add suspend/resume support") Reported-by: yangqiming Signed-off-by: Jianmin Lv Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230614115936.5950-6-lvjianmin@loongson.cn commit e01f9882f6fdbe0fa8ae39fe7691db2964e9fda6 Author: Yinbo Zhu Date: Wed Jun 14 19:59:35 2023 +0800 irqchip/loongson-liointc: Add IRQCHIP_SKIP_SET_WAKE flag LIOINTC doesn't require specific logic to work with wakeup IRQs, and no irq_set_wake callback is needed. To allow registered IRQs from LIOINTC to be used as a wakeup-source, and ensure irq_set_irq_wake() works well, the flag IRQCHIP_SKIP_SET_WAKE should be added. Reviewed-by: Huacai Chen Signed-off-by: Yinbo Zhu Signed-off-by: Jianmin Lv Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230614115936.5950-5-lvjianmin@loongson.cn commit 1d7471b4e0ebba5a4bf9db4ade43619e8f2d333d Author: Jianmin Lv Date: Wed Jun 14 19:59:34 2023 +0800 irqchip/loongson-liointc: Fix IRQ trigger polarity For the INT_POLARITY register of Loongson-2K series IRQ controller, '0' indicates high level or rising edge triggered, '1' indicates low level or falling edge triggered, and we can find out the information from the Loongson 2K1000LA User Manual v1.0, Table 9-2, Section 9.3 (中断寄存器描述 / Description of the Interrupt Registers). For Loongson-3 CPU series, setting INT_POLARITY register is not supported and writting it has no effect. So trigger polarity setting shouled be fixed for Loongson-2K CPU series. Fixes: 17343d0b4039 ("irqchip/loongson-liointc: Support to set IRQ type for ACPI path") Cc: stable@vger.kernel.org Reviewed-by: Huacai Chen Co-developed-by: Chong Qiao Signed-off-by: Chong Qiao Signed-off-by: Jianmin Lv Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230614115936.5950-4-lvjianmin@loongson.cn commit 783422e704ca0fa41cb2fe9ed79e46b6fe7eae29 Author: Liu Peibao Date: Wed Jun 14 19:59:33 2023 +0800 irqchip/loongson-pch-pic: Fix potential incorrect hwirq assignment In DeviceTree path, when ht_vec_base is not zero, the hwirq of PCH PIC will be assigned incorrectly. Because when pch_pic_domain_translate() adds the ht_vec_base to hwirq, the hwirq does not have the ht_vec_base subtracted when calling irq_domain_set_info(). The ht_vec_base is designed for the parent irq chip/domain of the PCH PIC. It seems not proper to deal this in callbacks of the PCH PIC domain and let's put this back like the initial commit ef8c01eb64ca ("irqchip: Add Loongson PCH PIC controller"). Fixes: bcdd75c596c8 ("irqchip/loongson-pch-pic: Add ACPI init support") Cc: stable@vger.kernel.org Reviewed-by: Huacai Chen Signed-off-by: Liu Peibao Signed-off-by: Jianmin Lv Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230614115936.5950-3-lvjianmin@loongson.cn commit f679616565f1cf1a4acb245dbc0032dafcd40637 Author: Jianmin Lv Date: Wed Jun 14 19:59:32 2023 +0800 irqchip/loongson-pch-pic: Fix initialization of HT vector register In an ACPI-based dual-bridge system, IRQ of each bridge's PCH PIC sent to CPU is always a zero-based number, which means that the IRQ on PCH PIC of each bridge is mapped into vector range from 0 to 63 of upstream irqchip(e.g. EIOINTC). EIOINTC N: [0 ... 63 | 64 ... 255] -------- ---------- ^ ^ | | PCH PIC N | PCH MSI N For example, the IRQ vector number of sata controller on PCH PIC of each bridge is 16, which is sent to upstream irqchip of EIOINTC when an interrupt occurs, which will set bit 16 of EIOINTC. Since hwirq of 16 on EIOINTC has been mapped to a irq_desc for sata controller during hierarchy irq allocation, the related mapped IRQ will be found through irq_resolve_mapping() in the IRQ domain of EIOINTC. So, the IRQ number set in HT vector register should be fixed to be a zero-based number. Cc: stable@vger.kernel.org Reviewed-by: Huacai Chen Co-developed-by: liuyun Signed-off-by: liuyun Signed-off-by: Jianmin Lv Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230614115936.5950-2-lvjianmin@loongson.cn commit d3b555e563a0ac80383b66f4ffd8bee2f6272779 Author: ChiYuan Huang Date: Fri Jun 16 10:08:18 2023 +0800 regulator: helper: Document ramp_delay parameter of regulator_set_ramp_delay_regmap() With W=1: drivers/regulator/helpers.c:947: warning: Function parameter or member 'ramp_delay' not described in 'regulator_set_ramp_delay_regmap' Fix it by documenting the parameter. Fixes: fb8fee9efdcf ("regulator: Add regmap helper for ramp-delay setting") Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1686881298-28333-1-git-send-email-cy_huang@richtek.com Signed-off-by: Mark Brown commit 3e47b8877d6c0f60943b00f3112756ca3b572cd6 Author: Mark Brown Date: Fri Jun 16 00:04:40 2023 +0100 regmap: Drop early readability check We have some drivers that have a use case for cached write only registers, doing read/modify/writes on read only registers in order to work more easily with bitfields. Go back to trying the cache before we check if we can read from the device. Fixes: eab5abdeb79f0 ("regmap: Check for register readability before checking cache during read") Reported-by: Konrad Dybcio Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230615-regmap-drop-early-readability-v1-1-8135094362de@kernel.org Signed-off-by: Mark Brown commit 928314eb06709e3861ce3e2c7e9ef3f83ba8691b Author: Arnd Bergmann Date: Fri Jun 16 11:00:40 2023 +0200 ASoC: loongson: fix compile testing on 32-bit DIV_ROUND_CLOSEST() does not work on 64-bit variables when building for a 32-bit target: ld.lld: error: undefined symbol: __udivdi3 >>> referenced by loongson_i2s.c >>> sound/soc/loongson/loongson_i2s.o:(loongson_i2s_hw_params) in archive vmlinux.a Use DIV_ROUND_CLOSEST_ULL() instead. Fixes: d24028606e764 ("ASoC: loongson: Add Loongson ASoC Sound Card Support") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230616090156.2347850-4-arnd@kernel.org Signed-off-by: Mark Brown commit 08432e59c7d9a958e69cf6b7a03777ba4f26f10b Author: Arnd Bergmann Date: Fri Jun 16 11:00:39 2023 +0200 ASoC: loongson: add PCI dependency The new driver fails to build when PCI is disabled: WARNING: unmet direct dependencies detected for SND_SOC_LOONGSON_I2S_PCI Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (LOONGARCH || COMPILE_TEST [=y]) && PCI [=n] Selected by [y]: - SND_SOC_LOONGSON_CARD [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (LOONGARCH || COMPILE_TEST [=y]) sound/soc/loongson/loongson_i2s_pci.c:167:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] module_pci_driver(loongson_i2s_driver); Add the appropriate Kconfig dependency. Fixes: d24028606e764 ("ASoC: loongson: Add Loongson ASoC Sound Card Support") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230616090156.2347850-3-arnd@kernel.org Signed-off-by: Mark Brown commit 041c5a1d065e5882299475326655f573e2a2a580 Author: Arnd Bergmann Date: Fri Jun 16 11:00:38 2023 +0200 ASoC: loongson: fix unused PM function warning Build testing without CONFIG_PM_SLEEP causes a warning: sound/soc/loongson/loongson_i2s.c:246:12: error: unused function 'i2s_suspend' [-Werror,-Wunused-function] sound/soc/loongson/loongson_i2s.c:255:12: error: unused function 'i2s_resume' [-Werror,-Wunused-function] Use the modern SYSTEM_SLEEP_PM_OPS() instead of the old one to avoid this. Fixes: d24028606e764 ("ASoC: loongson: Add Loongson ASoC Sound Card Support") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230616090156.2347850-2-arnd@kernel.org Signed-off-by: Mark Brown commit 0c340ba05fda0fbf5a54207452728911c6388330 Author: Arnd Bergmann Date: Fri Jun 16 11:00:37 2023 +0200 ASoC: max98388: fix unused function warnings The PM functions are never referenced when CONFIG_PM_SLEEP is disabled: sound/soc/codecs/max98388.c:854:12: error: unused function 'max98388_suspend' [-Werror,-Wunused-function] static int max98388_suspend(struct device *dev) ^ sound/soc/codecs/max98388.c:864:12: error: unused function 'max98388_resume' [-Werror,-Wunused-function] static int max98388_resume(struct device *dev) Fix this by using the modern SYSTEM_SLEEP_PM_OPS() macro in place of the deprecated SET_SYSTEM_SLEEP_PM_OPS() version, and use pm_sleep_ptr() to hide the entire structure as well. On a related note, the of_match_ptr() and ACPI_PTR() macros have the same problem and would cause the device id table to be unused when the driver is built-in and the respective subsystems are disabled. This does not cause warnings unless -Wunused-const-variable is passed to the compiler, but it's better to just not use the macros at all here. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230616090156.2347850-1-arnd@kernel.org Signed-off-by: Mark Brown commit dc393f1fdf22eda7255e99aadb400d8faaf3bdcf Author: Chris Packham Date: Thu Jun 15 16:04:46 2023 +1200 ARM: dts: mvebu: align MTD partition nodes to dtschema Update the node names for the SPI NOR and NAND partitions to conform to the partition properties in the relevant dtschema. Signed-off-by: Chris Packham Reviewed-by: Miquel Raynal Signed-off-by: Gregory CLEMENT commit b29381e91e52e787d65d07216ad826efe7dafd43 Author: Vadym Kochan Date: Thu Jun 15 16:04:45 2023 +1200 arm64: dts: marvell: cp11x: Fix nand_controller node name according to YAML Marvell NAND controller has now YAML to validate it's DT bindings, so change the node name of cp11x DTSI as it is required by nand-controller.yaml Signed-off-by: Vadym Kochan Signed-off-by: Chris Packham Reviewed-by: Miquel Raynal Signed-off-by: Gregory CLEMENT commit fd4e9e9bfa0b1c63946fde2ff61440ff1e5eb75b Author: Rander Wang Date: Fri Jun 16 12:00:39 2023 +0200 ASoC: SOF: Intel: mtl: setup primary core info on MeteorLake platform Set primary core mask and refcount. Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230616100039.378150-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 399961423314680c6cb14ac822600b9ede2b991f Author: Peter Ujfalusi Date: Fri Jun 16 12:00:38 2023 +0200 ASoC: SOF: pm: Remove duplicated code in sof_suspend Over time the function has changed and now there is no need to have the duplicated sof_fw_trace_suspend() and sof_suspend_clients() in the if (target_state == SOF_DSP_PM_D0) branch. Remove it and add a simple check with a single goto statement. Reviewed-by: Daniel Baluta Reviewed-by: Paul Olaru Reviewed-by: Ranjani Sridharan Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230616100039.378150-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c3d275e3a84833368c47c803043105bda095a624 Author: Peter Ujfalusi Date: Fri Jun 16 12:00:37 2023 +0200 ASoC: SOF: ipc4: Switch to use the sof_debug:bit11 to dump message payload Use the SOF_DBG_DUMP_IPC_MESSAGE_PAYLOAD flag to print the message payload instead of the DEBUG_VERBOSE, which would need code modification and kernel re-compilation. Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230616100039.378150-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d01c7636ffa051297672c55ab6088ae539d221ee Author: Peter Ujfalusi Date: Fri Jun 16 12:00:36 2023 +0200 ASoC: SOF: ipc3: Dump IPC message payload Dump the IPC message payload if BIT(11) of sof_debug is set and the message contains more data than just a header. The header size differs between TX and RX and in case of set_get_data, the header is always the reply header for the message regardless if it is TX or RX. The use of printk(KERN_DEBUG "..."); is on purpose to keep the dmesg output tidy. Reviewed-by: Bard Liao Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230616100039.378150-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d498a3bdfe954afb4155ab2bdc3ae534c949b907 Author: Peter Ujfalusi Date: Fri Jun 16 12:00:35 2023 +0200 ASoC: SOF: Add new sof_debug flag to request message payload dump We only print out the header information of an IPC message in debug level, either in verbose or non verbose way (Kconfig option). On top of the header information the message itself can help reproducing and identifying issues. BIT(11) can be used to request a message payload dump if it is supported by the IPC implementation. Since IPC message payload printing is only implemented for IPC4, the flag will not have any effect to IPC3 for now. Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230616100039.378150-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d389dcb3a48cec4f03c16434c0bf98a4c635372a Author: Peter Ujfalusi Date: Fri Jun 16 12:00:34 2023 +0200 ASoC: SOF: core: Free the firmware trace before calling snd_sof_shutdown() The shutdown is called on reboot/shutdown of the machine. At this point the firmware tracing cannot be used anymore but in case of IPC3 it is using and keeping a DMA channel active (dtrace). For Tiger Lake platforms we have a quirk in place to fix rare reboot issues when a DMA was active before rebooting the system. If the tracing is enabled this quirk will be always used and a print appears on the kernel log which might be misleading or not even correct. Release the fw tracing before executing the shutdown to make sure that this known DMA user is cleared away. Reviewed-by: Kai Vehmanen Reviewed-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Reviewed-by: Bard Liao Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230616100039.378150-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0557864e9dbe8f6c0f86110ad5712f81649f7288 Author: Bard Liao Date: Fri Jun 16 12:00:33 2023 +0200 ASoC: SOF: sof-audio: test virtual widget in sof_walk_widgets_in_order Virtual widgets are added for the purpose of showing connections between aggregated DAIs in SDW topologies. However, we shouldn't touch them in SOF. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230616100039.378150-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 90ce7538659aad1c048653c23eadaba9d1648559 Author: Bard Liao Date: Fri Jun 16 12:00:32 2023 +0200 ASoC: SOF: sof-audio: add is_virtual_widget helper Testing virtual widget is required in many functions. No function changed in this commit. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230616100039.378150-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ea8d1c062a0e876e999e4f347daeb598d5e677ab Author: Junhao He Date: Thu Jun 15 20:59:26 2023 +0800 docs: perf: Add new description for HiSilicon UC PMU A new function is added on HiSilicon uncore UC PMU. The UC PMU support to filter statistical information based on the specified tx request uring channel. Make user configuration through "uring_channel" parameter. Document them to provide guidance on how to use them. Signed-off-by: Junhao He Reviewed-by: Jonathan Cameron Reviewed-by: Yicong Yang Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20230615125926.29832-4-hejunhao3@huawei.com Signed-off-by: Will Deacon commit 312eca95e28d40694aee7c78a18ac0ecfd6d8159 Author: Junhao He Date: Thu Jun 15 20:59:25 2023 +0800 drivers/perf: hisi: Add support for HiSilicon UC PMU driver On HiSilicon Hip09 platform, there are 4 UC (unified cache) modules on each chip CCL (CPU Cluster). UC is a cache that provides coherence between NUMA and UMA domains. It is located between L2 and Memory System. Many PMU events are supported. Let's support the UC PMU driver using the HiSilicon uncore PMU framework. * rd_req_en : rd_req_en is the abbreviation of read request tracetag enable and allows user to count only read operations. Details are listed in the hisi-pmu document at Documentation/admin-guide/perf/hisi-pmu.rst * srcid_en & srcid: Allows users to filter statistical information based on specific CPU/ICL by srcid. srcid_en depends on rd_req_en being enabled. * uring_channel: Allows users to filter statistical information based on the specified tx request uring channel. uring_channel only supported events: [0x47 ~ 0x59]. Signed-off-by: Junhao He Reviewed-by: Yicong Yang Reviewed-by: Jonathan Cameron Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20230615125926.29832-3-hejunhao3@huawei.com Signed-off-by: Will Deacon commit 1a51688474c0d395b864e98236335fba712e29bf Author: Junhao He Date: Thu Jun 15 20:59:24 2023 +0800 drivers/perf: hisi: Add support for HiSilicon H60PA and PAv3 PMU driver Compared to the original PA device, H60PA offers higher bandwidth. The H60PA is a new device and we use HID to differentiate them. The events supported by PAv3 and PAv2 are different. The PAv3 PMU removed some events which are supported by PAv2 PMU. The older PA PMU driver will probe v3 as v2. Therefore PA events displayed by "perf list" cannot work properly. We add the HISI0275 HID for PAv3 PMU to distinguish different. For each H60PA PMU, except for the overflow interrupt register, other functions of the H60PA PMU are the same as the original PA PMU module. It has 8-programable counters and each counter is free-running. Interrupt is supported to handle counter (64-bits) overflow. Signed-off-by: Junhao He Reviewed-by: Jonathan Cameron Reviewed-by: Yicong Yang Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20230615125926.29832-2-hejunhao3@huawei.com Signed-off-by: Will Deacon commit d59b553fefa940f91aa96ff898267acc58e59e6b Merge: 2b384e01fd122 8f4b589595d01 Author: Marc Zyngier Date: Fri Jun 16 12:23:55 2023 +0100 Merge branch irq/lpi-resend into irq/irqchip-next * irq/lpi-resend: : . : Patch series from James Gowans, working around an issue with : GICv3 LPIs that can fire concurrently on multiple CPUs. : . irqchip/gic-v3-its: Enable RESEND_WHEN_IN_PROGRESS for LPIs genirq: Allow fasteoi handler to resend interrupts on concurrent handling genirq: Expand doc for PENDING and REPLAY flags genirq: Use BIT() for the IRQD_* state flags Signed-off-by: Marc Zyngier commit 8f4b589595d01f882d63d21efe15af4a5ad7c59b Author: James Gowans Date: Thu Jun 8 14:00:21 2023 +0200 irqchip/gic-v3-its: Enable RESEND_WHEN_IN_PROGRESS for LPIs GICv3 LPIs are impacted by an architectural design issue: they do not have a global active state and as such a given LPI can be delivered to a new CPU after an affinity change while the previous instance of the same LPI handler has not yet completed on the original CPU. If LPIs had an active state, this second LPI would not be delivered until the first CPU deactivated the initial LPI, just like SPIs. To solve this issue, use the newly introduced IRQD_RESEND_WHEN_IN_PROGRESS flag, ensuring that we do not lose an LPI being delivered during that window by getting the GIC to resend it. This workaround gets enabled for all LPIs, including the VPE doorbells. Suggested-by: Marc Zyngier Signed-off-by: James Gowans Cc: Thomas Gleixner Cc: Marc Zyngier Cc: KarimAllah Raslan Cc: Yipeng Zou Cc: Zhang Jianhua [maz: massaged commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230608120021.3273400-4-jgowans@amazon.com commit 9c15eeb5362c48dd27d51bd72e8873341fa9383c Author: James Gowans Date: Thu Jun 8 14:00:20 2023 +0200 genirq: Allow fasteoi handler to resend interrupts on concurrent handling There is a class of interrupt controllers out there that, once they have signalled a given interrupt number, will still signal incoming instances of the *same* interrupt despite the original interrupt not having been EOIed yet. As long as the new interrupt reaches the *same* CPU, nothing bad happens, as that CPU still has its interrupts globally disabled, and we will only take the new interrupt once the interrupt has been EOIed. However, things become more "interesting" if an affinity change comes in while the interrupt is being handled. More specifically, while the per-irq lock is being dropped. This results in the affinity change taking place immediately. At this point, there is nothing that prevents the interrupt from firing on the new target CPU. We end-up with the interrupt running concurrently on two CPUs, which isn't a good thing. And that's where things become worse: the new CPU notices that the interrupt handling is in progress (irq_may_run() return false), and *drops the interrupt on the floor*. The whole race looks like this: CPU 0 | CPU 1 -----------------------------|----------------------------- interrupt start | handle_fasteoi_irq | set_affinity(CPU 1) handler | ... | interrupt start ... | handle_fasteoi_irq -> early out handle_fasteoi_irq return | interrupt end interrupt end | If the interrupt was an edge, too bad. The interrupt is lost, and the system will eventually die one way or another. Not great. A way to avoid this situation is to detect this problem at the point we handle the interrupt on the new target. Instead of dropping the interrupt, use the resend mechanism to force it to be replayed. Also, in order to limit the impact of this workaround to the pathetic architectures that require it, gate it behind a new irq flag aptly named IRQD_RESEND_WHEN_IN_PROGRESS. Suggested-by: Marc Zyngier Signed-off-by: James Gowans Cc: Thomas Gleixner Cc: Marc Zyngier Cc: KarimAllah Raslan Cc: Yipeng Zou Cc: Zhang Jianhua [maz: reworded commit mesage] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230608120021.3273400-3-jgowans@amazon.com commit 7cc148a32f1e7496e22c0005dd113a31d4a3b3d4 Author: James Gowans Date: Thu Jun 8 14:00:19 2023 +0200 genirq: Expand doc for PENDING and REPLAY flags Adding a bit more info about what the flags are used for may help future code readers. Signed-off-by: James Gowans Cc: Thomas Gleixner Cc: Marc Zyngier Cc: Liao Chang Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230608120021.3273400-2-jgowans@amazon.com commit 0cfb4a1af386427cdaba98f18f501eb074985cfd Author: Marc Zyngier Date: Thu Jun 15 14:58:52 2023 +0100 genirq: Use BIT() for the IRQD_* state flags As we're about to use the last bit available in the IRQD_* state flags, rewrite these flags with BIT(), which ensures that these constant do not represent a signed value. Signed-off-by: Marc Zyngier commit 452c46ccf603ab181e7d0866f3137e3ae62b5f49 Author: Dmitry Baryshkov Date: Thu Jun 15 01:44:02 2023 +0300 drm/msm/dsi: split dsi_ctrl_config() function It makes no sense to pass NULL parameters to dsi_ctrl_config() in the disable case. Split dsi_ctrl_config() into enable and disable parts and drop unused params. Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/542559/ Link: https://lore.kernel.org/r/20230614224402.296825-2-dmitry.baryshkov@linaro.org commit e2fd7dda3bb867012836500f1816a4837ddb5079 Author: Dmitry Baryshkov Date: Thu Jun 15 01:44:01 2023 +0300 drm/msm/dsi: dsi_host: drop unused clocks Several source clocks are not used anymore, so stop handling them. Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/542558/ Link: https://lore.kernel.org/r/20230614224402.296825-1-dmitry.baryshkov@linaro.org commit c7c4afd943cc98a123d0ee4f482bd9ea96ff18db Author: Dmitry Baryshkov Date: Tue Jun 13 03:09:42 2023 +0300 drm/msm/dpu: remove unused INTF_NONE interfaces sm6115, sm6375 and qcm2290 do not have INTF_0. Drop corresponding interface definitions. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/542180/ Link: https://lore.kernel.org/r/20230613001004.3426676-4-dmitry.baryshkov@linaro.org commit 9a6c13b847d61b0c3796820ca6e976789df59cd8 Author: Dmitry Baryshkov Date: Tue Jun 13 03:09:41 2023 +0300 drm/msm/dpu: correct MERGE_3D length Each MERGE_3D block has just two registers. Correct the block length accordingly. Fixes: 4369c93cf36b ("drm/msm/dpu: initial support for merge3D hardware block") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/542177/ Reviewed-by: Marijn Suijten Link: https://lore.kernel.org/r/20230613001004.3426676-3-dmitry.baryshkov@linaro.org commit 0b78be614c503ec03636f82cea52ad735c5085e7 Author: Dmitry Baryshkov Date: Tue Jun 13 03:09:40 2023 +0300 drm/msm/dpu: fix sc7280 and sc7180 PINGPONG done interrupts During IRQ conversion we have lost the PP_DONE interrupts for sc7280 platform. This was left unnoticed, because this interrupt is only used for CMD outputs and probably no sc7[12]80 systems use DSI CMD panels. Fixes: 667e9985ee24 ("drm/msm/dpu: replace IRQ lookup with the data in hw catalog") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/542175/ Link: https://lore.kernel.org/r/20230613001004.3426676-2-dmitry.baryshkov@linaro.org commit 7e51d05e43f19f394b3b0df01a22225143f9c5b5 Author: Ilkka Koskinen Date: Thu Jun 15 16:26:30 2023 -0700 perf: arm_cspmu: Add missing MODULE_DEVICE_TABLE Add missing MODULE_DEVICE_TABLE definition to generate modalias, which enables module autoloading. Signed-off-by: Ilkka Koskinen Link: https://lore.kernel.org/r/20230615232630.304870-1-ilkka@os.amperecomputing.com Signed-off-by: Will Deacon commit a1c45d3ebd30cf8b9b1131c1335d603f3c46999c Author: Robin Murphy Date: Mon Jun 12 18:16:33 2023 +0100 perf/arm-cmn: Add sysfs identifier Expose a sysfs identifier encapsulating the CMN part number and revision so that jevents can narrow down a fundamental set of possible events for calculating metrics. Configuration-dependent aspects - such as whether a given node type is present, and/or a given node ID is valid - are still not covered, and in general it's hard to see how userspace could handle them, so we won't be removing any data or validation logic from the driver any time soon, but at least it's a step in a useful direction. Signed-off-by: Robin Murphy Reviewed-and-tested-by: Ilkka Koskinen Tested-by: Jing Zhang Link: https://lore.kernel.org/r/b8a14c14fcdf028939ebf57849863e8ae01743de.1686588640.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 7819e05a0dceac20c5ff78ec9b252faf3b76b824 Author: Robin Murphy Date: Mon Jun 12 18:16:32 2023 +0100 perf/arm-cmn: Revamp model detection CMN implements a set of CoreSight-format peripheral ID registers which in principle we should be able to use to identify the hardware. However so far we have avoided trying to use the part number field since the TRMs have all described it as "configuration dependent". It turns out, though, that this is a quirk of the documentation generation process, and in fact the part number should always be a stable well-defined field which we can trust. To that end, revamp our model detection to rely less on ACPI/DT, and pave the way towards further using the hardware information as an identifier for userspace jevent metrics. This includes renaming the revision constants to maximise readability. Signed-off-by: Robin Murphy Reviewed-and-tested-by: Ilkka Koskinen Link: https://lore.kernel.org/r/3c791eaae814b0126f9adbd5419bfb4a600dade7.1686588640.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 707a13c7e488785170a5e7f2467f2823824651e2 Author: Kalle Valo Date: Tue Jun 13 17:09:18 2023 +0300 wifi: ray_cs: fix stringop-truncation GCC warning GCC 12.2 with W=1 warns: drivers/net/wireless/legacy/ray_cs.c:630:17: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] The driver uses SSID as a string which is just wrong, it should be treated as a byte array instead. But as the driver is ancient and most likely there are no users so convert it to use strscpy(). This makes sure that the string is NUL-terminated and also the warning is fixed. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230613140918.389690-5-kvalo@kernel.org commit 5ea0c313090046d84064dc556983d8ed7e6065dd Author: Kalle Valo Date: Tue Jun 13 17:09:17 2023 +0300 wifi: hostap: fix stringop-truncations GCC warning With GCC 13.1 and W=1 hostap has a warning: drivers/net/wireless/intersil/hostap/hostap_ioctl.c:3633:17: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation] fortify-string.h recommends not to use strncpy() so use strscpy() which fixes the warning. Also now it's guarenteed that the string is NUL-terminated. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230613140918.389690-4-kvalo@kernel.org commit 4b6ec74ec476c775b44d49ecd8cd48334db8e798 Author: Kalle Valo Date: Tue Jun 13 17:09:16 2023 +0300 wifi: brcmsmac: fix gnu_printf warnings With GCC 13.1 and W=1 brcmsmac has warnings like this: ./include/trace/stages/stage5_get_offsets.h:23:31: warning: function 'trace_event_get_offsets_brcms_dbg' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] Add a workaround which disables -Wsuggest-attribute=format in brcms_trace_brcmsmac_msg.h. I see similar workarounds in other drivers as well. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230613140918.389690-3-kvalo@kernel.org commit 56714e5f1255fc318b65b6b338a0d8ebc44c920c Author: Kalle Valo Date: Tue Jun 13 17:09:15 2023 +0300 wifi: brcmfmac: fix gnu_printf warnings With GCC 13.1 and W=1 brcmfmac has warnings like this: ./include/trace/perf.h:26:16: warning: function 'perf_trace_brcmf_dbg' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] Add a workaround which disables -Wsuggest-attribute=format in tracepoint.h. I see similar workarounds in other drivers as well. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230613140918.389690-2-kvalo@kernel.org commit 95f5819738a7500b91e99151a03eb05be478ee6a Author: Xin Yang Date: Tue Jun 13 01:34:23 2023 +0000 perf/arm_dmc620: Add cpumask Add a cpumask for the DMC620 PMU. As it is an uncore PMU, perf userspace tool only needs to open a single counter on the CPU specified by the CPU mask for each event on a given DMC620 device. Signed-off-by: Xin Yang Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20230613013423.2078397-1-xin.yang@arm.com Signed-off-by: Will Deacon commit 30d65d1b19850c9bc8c17dba8ebe9be5e0c17054 Author: Juergen Gross Date: Thu Jun 15 14:39:59 2023 +0200 x86/xen: Set default memory type for PV guests to WB When running as an unprivileged PV guest under Xen (not dom0), the default MTRR memory type should be write-back. Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20230615123959.12298-1-jgross@suse.com commit a1b78312ec440e8b4c633bb4985dd825abd29488 Author: Nikita Shubin Date: Thu Jun 1 08:45:38 2023 +0300 dt-bindings: gpio: Add Cirrus EP93xx Add YAML bindings for ep93xx SoC gpio controller. Signed-off-by: Nikita Shubin Signed-off-by: Bartosz Golaszewski commit 19b60f8410ad6b2c8e8bd7ec74a43ab8ede3de05 Author: Michal Smulski Date: Thu Jun 1 16:02:00 2023 -0700 gpio: mpc8xxx: latch GPIOs state on module load when configured as output Qoriq and related devices allow reading out state of GPIO set as output. However, currently on driver's init, all outputs are configured as driven low. So, any changes to GPIO confiuration will drive all pins (configured as output) as output-low. This patch latches state of output GPIOs before any GPIO configuration takes place. This preserves any output settings done prior to loading the driver (for example, by u-boot). Signed-off-by: Michal Smulski Signed-off-by: Bartosz Golaszewski commit 61c65a8b50c22ef17839df6f342df44a5631400a Author: Andy Shevchenko Date: Tue Apr 11 20:15:21 2023 +0300 selftests: gpio: gpio-sim: Use same variable name for sysfs pathname SYSFS_PATH can be used locally and globally, especially that has the same content. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit cd33f216d241520385a5166ae73a0771197a9f0b Author: Asmaa Mnebhi Date: Wed Mar 15 17:50:26 2023 -0400 gpio: mlxbf3: Add gpio driver support Add support for the BlueField-3 SoC GPIO driver. This driver configures and handles GPIO interrupts. It also enables a user to manipulate certain GPIO pins via libgpiod tools or other kernel drivers. The usables pins are defined via the "gpio-reserved-ranges" property. Signed-off-by: Asmaa Mnebhi Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit db54dfc9f71cd2df7afd1e88535ef6099cb0333e Author: Steffen Eiden Date: Thu Jun 15 12:05:33 2023 +0200 s390/uv: Update query for secret-UVCs Update the query struct such that secret-UVC related information can be parsed. Add sysfs files for these new values. 'supp_add_secret_req_ver' notes the supported versions for the Add Secret UVC. Bit 0 indicates that version 0x100 is supported, bit 1 indicates 0x200, and so on. 'supp_add_secret_pcf' notes the supported plaintext flags for the Add Secret UVC. 'supp_secret_types' notes the supported types of secrets. Bit 0 indicates secret type 1, bit 1 indicates type 2, and so on. 'max_secrets' notes the maximum amount of secrets the secret store can store per pv guest. Signed-off-by: Steffen Eiden Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20230615100533.3996107-8-seiden@linux.ibm.com Signed-off-by: Janosch Frank Message-Id: <20230615100533.3996107-8-seiden@linux.ibm.com> commit 78d3326e725e8a8b17b8fe1a6beaf8e0ea04de04 Author: Steffen Eiden Date: Thu Jun 15 12:05:32 2023 +0200 s390/uv: replace scnprintf with sysfs_emit Replace scnprintf(page, PAGE_SIZE, ...) with the page size aware sysfs_emit(buf, ...) which adds some sanity checks. Signed-off-by: Steffen Eiden Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20230615100533.3996107-7-seiden@linux.ibm.com Signed-off-by: Janosch Frank Message-Id: <20230615100533.3996107-7-seiden@linux.ibm.com> commit 2d8a26acaf88a9174bcd44b607c5aa2ca9f5718f Author: Steffen Eiden Date: Thu Jun 15 12:05:31 2023 +0200 s390/uvdevice: Add 'Lock Secret Store' UVC Userspace can call the Lock Secret Store Ultravisor Call using IOCTLs on the uvdevice. The Lock Secret Store UV call disables all additions of secrets for the future. The uvdevice is merely transporting the request from userspace to the Ultravisor. Signed-off-by: Steffen Eiden Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20230615100533.3996107-6-seiden@linux.ibm.com Signed-off-by: Janosch Frank Message-Id: <20230615100533.3996107-6-seiden@linux.ibm.com> commit b96b3ce2720145bd981988443288fbc4bdf37854 Author: Steffen Eiden Date: Thu Jun 15 12:05:30 2023 +0200 s390/uvdevice: Add 'List Secrets' UVC Userspace can call the List Secrets Ultravisor Call using IOCTLs on the uvdevice. The List Secrets UV call lists the identifier of the secrets in the UV secret store. The uvdevice is merely transporting the request from userspace to Ultravisor. It's neither checking nor manipulating the request or response data. Signed-off-by: Steffen Eiden Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20230615100533.3996107-5-seiden@linux.ibm.com Signed-off-by: Janosch Frank Message-Id: <20230615100533.3996107-5-seiden@linux.ibm.com> commit 44567ca21aaf6f60cb5dcde180b1f6aab9da33dd Author: Steffen Eiden Date: Thu Jun 15 12:05:29 2023 +0200 s390/uvdevice: Add 'Add Secret' UVC Userspace can call the Add Secret Ultravisor Call using IOCTLs on the uvdevice. The Add Secret UV call sends an encrypted and cryptographically verified request to the Ultravisor. The request inserts a protected guest's secret into the Ultravisor for later use. The uvdevice is merely transporting the request from userspace to the Ultravisor. It's neither checking nor manipulating the request data. Signed-off-by: Steffen Eiden Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20230615100533.3996107-4-seiden@linux.ibm.com Signed-off-by: Janosch Frank Message-Id: <20230615100533.3996107-4-seiden@linux.ibm.com> commit ea9d97163523d299022fc78258eccc466d92102a Author: Steffen Eiden Date: Thu Jun 15 12:05:28 2023 +0200 s390/uvdevice: Add info IOCTL Add an IOCTL that allows userspace to find out which IOCTLs the uvdevice supports without trial and error. Explicitly expose the IOCTL nr for the request types. Signed-off-by: Steffen Eiden Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20230615100533.3996107-3-seiden@linux.ibm.com Signed-off-by: Janosch Frank Message-Id: <20230615100533.3996107-3-seiden@linux.ibm.com> commit 4255ce017723238dddbb63ba06d760d73b57896a Author: Steffen Eiden Date: Thu Jun 15 12:05:27 2023 +0200 s390/uv: Always export uv_info KVM needs the struct's values to be able to provide PV support. The uvdevice is currently guest only and will need the struct's values for call support checking and potential future expansions. As uv.c is only compiled with CONFIG_PGSTE or CONFIG_PROTECTED_VIRTUALIZATION_GUEST we don't need a second check in the code. Users of uv_info will need to fence for these two config options for the time being. Signed-off-by: Steffen Eiden Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20230615100533.3996107-2-seiden@linux.ibm.com Signed-off-by: Janosch Frank Message-Id: <20230615100533.3996107-2-seiden@linux.ibm.com> commit 0bc380beb78aa352eadbc21d934dd9606fcee808 Author: Christian Borntraeger Date: Mon May 15 10:42:34 2023 +0200 KVM: s390/diag: fix racy access of physical cpu number in diag 9c handler We do check for target CPU == -1, but this might change at the time we are going to use it. Hold the physical target CPU in a local variable to avoid out-of-bound accesses to the cpu arrays. Cc: Pierre Morel Fixes: 87e28a15c42c ("KVM: s390: diag9c (directed yield) forwarding") Reported-by: Marc Hartmayer Reviewed-by: Nico Boehr Reviewed-by: Pierre Morel Signed-off-by: Christian Borntraeger Signed-off-by: Janosch Frank commit 246be7d2720ea9a795b576067ecc5e5c7a1e7848 Author: Pierre Morel Date: Wed May 10 17:42:58 2023 +0200 KVM: s390: vsie: fix the length of APCB bitmap bit_and() uses the count of bits as the woking length. Fix the previous implementation and effectively use the right bitmap size. Fixes: 19fd83a64718 ("KVM: s390: vsie: allow CRYCB FORMAT-1") Fixes: 56019f9aca22 ("KVM: s390: vsie: Allow CRYCB FORMAT-2") Signed-off-by: Pierre Morel Reviewed-by: Janosch Frank Link: https://lore.kernel.org/kvm/20230511094719.9691-1-pmorel@linux.ibm.com/ Signed-off-by: Janosch Frank commit 7bc162d5cc4de5c33c5570dba2719a01506a9fd0 Merge: 1143c9d9d7602 ffe4dfe0badda d5bf485746991 eb07c4f39c3e8 Author: Vlastimil Babka Date: Fri Jun 16 11:05:59 2023 +0200 Merge branches 'slab/for-6.5/prandom', 'slab/for-6.5/slab_no_merge' and 'slab/for-6.5/slab-deprecate' into slab/for-next Merge the feature branches scheduled for 6.5: - replace the usage of weak PRNGs, by David Keisar Schmidt - introduce the SLAB_NO_MERGE kmem_cache flag, by Jesper Dangaard Brouer - deprecate CONFIG_SLAB, with a planned removal, by myself commit e325ba2271849e25017743496bcec8d3a83cacb3 Author: Nico Boehr Date: Fri Mar 24 15:54:24 2023 +0100 KVM: s390: selftests: add selftest for CMMA migration Add a selftest for CMMA migration on s390. The tests cover: - interaction of dirty tracking and migration mode, see my recent patch "KVM: s390: disable migration mode when dirty tracking is disabled" [1], - several invalid calls of KVM_S390_GET_CMMA_BITS, for example: invalid flags, CMMA support off, with/without peeking - ensure KVM_S390_GET_CMMA_BITS initally reports all pages as dirty, - ensure KVM_S390_GET_CMMA_BITS properly skips over holes in memslots, but also non-dirty pages Note that without the patch at [1] and the small fix in this series, the selftests will fail. [1] https://lore.kernel.org/all/20230127140532.230651-2-nrb@linux.ibm.com/ Signed-off-by: Nico Boehr Reviewed-by: Claudio Imbrenda Message-Id: <20230324145424.293889-3-nrb@linux.ibm.com> Signed-off-by: Claudio Imbrenda [frankja@linux.ibm.com: squashed 20230606150510.671301-1-nrb@linux.ibm.com / "KVM: s390: selftests: CMMA: don't run if CMMA not supported"] Signed-off-by: Janosch Frank commit d5bf485746991ce994994e5935b1cf223678f112 Author: Vlastimil Babka Date: Tue Jun 13 12:28:21 2023 +0200 mm/slab_common: use SLAB_NO_MERGE instead of negative refcount When CONFIG_MEMCG_KMEM is enabled, we disable cache merging for KMALLOC_NORMAL caches so they don't end up merged with a cache that uses ad-hoc __GFP_ACCOUNT when allocating. This was implemented by setting the refcount to -1, but now we have a proper SLAB_NO_MERGE flag, so use that instead. Signed-off-by: Vlastimil Babka Acked-by: David Rientjes commit 8efe124702a9a8ef8e3302714ff6a0e68efd118b Author: Andy Shevchenko Date: Thu Jun 15 16:20:23 2023 +0300 gpio: delay: Remove duplicative functionality Now that GPIO aggregator supports a delay line, drop the duplicative functionality, i.e. the entire gpio-delay driver. Reviewed-by: Geert Uytterhoeven Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko Tested-by: Alexander Stein Signed-off-by: Bartosz Golaszewski commit 81674bea191301396a2ebd73a49a2e61e723c3d9 Author: Andy Shevchenko Date: Thu Jun 15 16:20:22 2023 +0300 gpio: aggregator: Set up a parser of delay line parameters The aggregator mode can also handle properties of the platform, that do not belong to the GPIO controller itself. One of such a property is a signal delay line. Set up a parser to support it. Reviewed-by: Geert Uytterhoeven Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko Tested-by: Alexander Stein Signed-off-by: Bartosz Golaszewski commit b466622cecb9b14577ff0ed3e0bc4756dbe1d3d3 Author: Andy Shevchenko Date: Thu Jun 15 16:20:20 2023 +0300 gpio: aggregator: Support delay for setting up individual GPIOs In some cases the GPIO may require an additional delay after setting its value. Add support for that into the GPIO forwarder code. This will be fully enabled for use in the following changes. Reviewed-by: Geert Uytterhoeven Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko Tested-by: Alexander Stein Signed-off-by: Bartosz Golaszewski commit b89a9e9890d42ea83a77106c299d8a563b5d7dbf Author: Andy Shevchenko Date: Thu Jun 15 16:20:19 2023 +0300 gpio: aggregator: Remove CONFIG_OF and of_match_ptr() protections They stop the driver being used with ACPI PRP0001 and are something I want to avoid being cut and paste into new drivers. Also include mod_devicetable.h as we struct of_device_id is defined in there. Reviewed-by: Geert Uytterhoeven Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko Tested-by: Alexander Stein Signed-off-by: Bartosz Golaszewski commit 013fdeb07a8fd32bbb3412e5f49d60207a78bf08 Author: Borislav Petkov (AMD) Date: Wed Jun 14 19:41:48 2023 +0200 x86/mm: Remove unused current_untag_mask() e0bddc19ba95 ("x86/mm: Reduce untagged_addr() overhead for systems without LAM") removed its only usage site so drop it. Move the tlbstate_untag_mask up in the header and drop the ugly ifdeffery as the unused declaration should be properly discarded. Signed-off-by: Borislav Petkov (AMD) Acked-by: Kirill A. Shutemov Link: https://lore.kernel.org/r/20230614174148.5439-1-bp@alien8.de commit b81fac906a8f9e682e513ddd95697ec7a20878d4 Author: Thomas Gleixner Date: Wed Jun 14 01:39:46 2023 +0200 x86/fpu: Move FPU initialization into arch_cpu_finalize_init() Initializing the FPU during the early boot process is a pointless exercise. Early boot is convoluted and fragile enough. Nothing requires that the FPU is set up early. It has to be initialized before fork_init() because the task_struct size depends on the FPU register buffer size. Move the initialization to arch_cpu_finalize_init() which is the perfect place to do so. No functional change. This allows to remove quite some of the custom early command line parsing, but that's subject to the next installment. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.902376621@linutronix.de commit 1703db2b90c91b2eb2d699519fc505fe431dde0e Author: Thomas Gleixner Date: Wed Jun 14 01:39:45 2023 +0200 x86/fpu: Mark init functions __init No point in keeping them around. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.841685728@linutronix.de commit 1f34bb2a24643e0087652d81078e4f616562738d Author: Thomas Gleixner Date: Wed Jun 14 01:39:43 2023 +0200 x86/fpu: Remove cpuinfo argument from init functions Nothing in the call chain requires it Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.783704297@linutronix.de commit 54d9a91a3d6713d1332e93be13b4eaf0fa54349d Author: Thomas Gleixner Date: Wed Jun 14 01:39:42 2023 +0200 x86/init: Initialize signal frame size late No point in doing this during really early boot. Move it to an early initcall so that it is set up before possible user mode helpers are started during device initialization. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.727330699@linutronix.de commit 439e17576eb47f26b78c5bbc72e344d4206d2327 Author: Thomas Gleixner Date: Wed Jun 14 01:39:41 2023 +0200 init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init() Invoke the X86ism mem_encrypt_init() from X86 arch_cpu_finalize_init() and remove the weak fallback from the core code. No functional change. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.670360645@linutronix.de commit 9df9d2f0471b4c4702670380b8d8a45b40b23a7d Author: Thomas Gleixner Date: Wed Jun 14 01:39:39 2023 +0200 init: Invoke arch_cpu_finalize_init() earlier X86 is reworking the boot process so that initializations which are not required during early boot can be moved into the late boot process and out of the fragile and restricted initial boot phase. arch_cpu_finalize_init() is the obvious place to do such initializations, but arch_cpu_finalize_init() is invoked too late in start_kernel() e.g. for initializing the FPU completely. fork_init() requires that the FPU is initialized as the size of task_struct on X86 depends on the size of the required FPU register buffer. Fortunately none of the init calls between calibrate_delay() and arch_cpu_finalize_init() is relevant for the functionality of arch_cpu_finalize_init(). Invoke it right after calibrate_delay() where everything which is relevant for arch_cpu_finalize_init() has been set up already. No functional change intended. Signed-off-by: Thomas Gleixner Reviewed-by: Rick Edgecombe Link: https://lore.kernel.org/r/20230613224545.612182854@linutronix.de commit 61235b24b9cb37c13fcad5b9596d59a1afdcec30 Author: Thomas Gleixner Date: Wed Jun 14 01:39:38 2023 +0200 init: Remove check_bugs() leftovers Everything is converted over to arch_cpu_finalize_init(). Remove the check_bugs() leftovers including the empty stubs in asm-generic, alpha, parisc, powerpc and xtensa. Signed-off-by: Thomas Gleixner Reviewed-by: Richard Henderson Link: https://lore.kernel.org/r/20230613224545.553215951@linutronix.de commit 9349b5cd0908f8afe95529fc7a8cbb1417df9b0c Author: Thomas Gleixner Date: Wed Jun 14 01:39:36 2023 +0200 um/cpu: Switch to arch_cpu_finalize_init() check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Acked-by: Richard Weinberger Link: https://lore.kernel.org/r/20230613224545.493148694@linutronix.de commit 44ade508e3bfac45ae97864587de29eb1a881ec0 Author: Thomas Gleixner Date: Wed Jun 14 01:39:35 2023 +0200 sparc/cpu: Switch to arch_cpu_finalize_init() check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Sam Ravnborg Link: https://lore.kernel.org/r/20230613224545.431995857@linutronix.de commit 01eb454e9bfe593f320ecbc9aaec60bf87cd453d Author: Thomas Gleixner Date: Wed Jun 14 01:39:33 2023 +0200 sh/cpu: Switch to arch_cpu_finalize_init() check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.371697797@linutronix.de commit 7f066a22fe353a827a402ee2835e81f045b1574d Author: Thomas Gleixner Date: Wed Jun 14 01:39:32 2023 +0200 mips/cpu: Switch to arch_cpu_finalize_init() check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.312438573@linutronix.de commit 9ceecc2589b9d7cef6b321339ed8de484eac4b20 Author: Thomas Gleixner Date: Wed Jun 14 01:39:30 2023 +0200 m68k/cpu: Switch to arch_cpu_finalize_init() check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Acked-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230613224545.254342916@linutronix.de commit 9841c423164787feb8f1442f922b7d80a70c82f1 Author: Thomas Gleixner Date: Wed Jun 14 01:39:28 2023 +0200 loongarch/cpu: Switch to arch_cpu_finalize_init() check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.195288218@linutronix.de commit 6c38e3005621800263f117fb00d6787a76e16de7 Author: Thomas Gleixner Date: Wed Jun 14 01:39:27 2023 +0200 ia64/cpu: Switch to arch_cpu_finalize_init() check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.137045745@linutronix.de commit ee31bb0524a2e7c99b03f50249a411cc1eaa411f Author: Thomas Gleixner Date: Wed Jun 14 01:39:25 2023 +0200 ARM: cpu: Switch to arch_cpu_finalize_init() check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.078124882@linutronix.de commit 7c7077a72674402654f3291354720cd73cdf649e Author: Thomas Gleixner Date: Wed Jun 14 01:39:24 2023 +0200 x86/cpu: Switch to arch_cpu_finalize_init() check_bugs() is a dumping ground for finalizing the CPU bringup. Only parts of it has to do with actual CPU bugs. Split it apart into arch_cpu_finalize_init() and cpu_select_mitigations(). Fixup the bogus 32bit comments while at it. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230613224545.019583869@linutronix.de commit 7725acaa4f0c04fbefb0e0d342635b967bb7d414 Author: Thomas Gleixner Date: Wed Jun 14 01:39:22 2023 +0200 init: Provide arch_cpu_finalize_init() check_bugs() has become a dumping ground for all sorts of activities to finalize the CPU initialization before running the rest of the init code. Most are empty, a few do actual bug checks, some do alternative patching and some cobble a CPU advertisement string together.... Aside of that the current implementation requires duplicated function declaration and mostly empty header files for them. Provide a new function arch_cpu_finalize_init(). Provide a generic declaration if CONFIG_ARCH_HAS_CPU_FINALIZE_INIT is selected and a stub inline otherwise. This requires a temporary #ifdef in start_kernel() which will be removed along with check_bugs() once the architectures are converted over. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224544.957805717@linutronix.de commit c08afcdcf95288c627267bb20002e8baaf3394e1 Author: Edward Cree Date: Thu Jun 15 22:52:43 2023 +0100 sfc: do not try to call tc functions when CONFIG_SFC_SRIOV=n Functions efx_tc_netdev_event and efx_tc_netevent_event do not exist in that case as object files tc_bindings.o and tc_encap_actions.o are not built, so the calls to them from ef100_netdev_event and ef100_netevent_event cause link errors. Wrap the corresponding header files (tc_bindings.h, tc_encap_actions.h) with #if IS_ENABLED(CONFIG_SFC_SRIOV), and add an #else with static inline stubs for these two functions. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306102026.ISK5JfUQ-lkp@intel.com/ Fixes: 7e5e7d800011 ("sfc: neighbour lookup for TC encap action offload") Signed-off-by: Edward Cree Reviewed-by: Martin Habets Signed-off-by: David S. Miller commit 1282723361209d06fb1466ffb90e63b1161320b6 Author: Randy Dunlap Date: Thu Jun 15 15:21:52 2023 -0700 s390/net: lcs: use IS_ENABLED() for kconfig detection When CONFIG_ETHERNET=m or CONFIG_FDDI=m, lcs.s has build errors or warnings: ../drivers/s390/net/lcs.c:40:2: error: #error Cannot compile lcs.c without some net devices switched on. 40 | #error Cannot compile lcs.c without some net devices switched on. ../drivers/s390/net/lcs.c: In function 'lcs_startlan_auto': ../drivers/s390/net/lcs.c:1601:13: warning: unused variable 'rc' [-Wunused-variable] 1601 | int rc; Solve this by using IS_ENABLED(CONFIG_symbol) instead of ifdef CONFIG_symbol. The latter only works for builtin (=y) values while IS_ENABLED() works for builtin or modular values. Signed-off-by: Randy Dunlap Cc: Alexandra Winter Cc: Wenjia Zhang Cc: linux-s390@vger.kernel.org Cc: netdev@vger.kernel.org Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Signed-off-by: David S. Miller commit 481012b479fe6d8dd4e01d739c359a8d99d074a9 Author: Mika Westerberg Date: Mon Feb 14 14:09:50 2022 +0200 thunderbolt: Add test case for 3 DisplayPort tunnels Intel Barlow Ridge Thunderbolt controller has 3 DP IN adapters. This allows 3 simultaneus DisplayPort tunnels through either one or two USB4 downstream ports (in any possible configuration). Add test case for this. Signed-off-by: Mika Westerberg commit 2d7e047297983dd29c29c41b8b7034d64f861aa2 Author: Mika Westerberg Date: Mon Jan 23 10:42:58 2023 +0200 thunderbolt: Add DisplayPort 2.x tunneling support This adds support for the UHBR (Ultra High Bit Rate) bandwidths introduced with DisplayPort 2.0 (and refined in 2.1). These can go up to 80 Gbit/s and their support is represent in additional bits in the DP IN capability. This updates the DisplayPort tunneling to support these new rates too. Signed-off-by: Mika Westerberg commit 8d73f6b8e0487ac0ed4acd883a6788b2492a5692 Author: Mika Westerberg Date: Wed Feb 1 13:21:37 2023 +0200 thunderbolt: Make bandwidth allocation mode function names consistent Make sure the DisplayPort bandwidth allocation mode function names are consistent with the existing ones, such as USB3. No functional changes. Signed-off-by: Mika Westerberg commit fd4d58d1fef9ae9b0ee235eaad73d2e0a6a73025 Author: Mika Westerberg Date: Sun Nov 6 13:07:43 2022 +0200 thunderbolt: Enable CL2 low power state For USB4 v2 routers we can also enable CL2 which allows better power savings and thermal management than CL0s and CL1. Signed-off-by: Mika Westerberg commit d49b4f043d63bddf4c1836623b8ae800878ed2e3 Author: Mika Westerberg Date: Tue Oct 11 12:11:09 2022 +0300 thunderbolt: Add support for enhanced uni-directional TMU mode This is new TMU mode introduced with the USB4 v2. This mode is simpler than the existing ones and allows all CL states as well. Enable this for all links where both side routers are v2 and keep the existing functionality for the v1 and earlier links. Currently only support the MedRes rate. We can add the HiFi rate later too if it turns out to be useful. Signed-off-by: Mika Westerberg commit 322ff701ffed52fb1cade855b2145a3b4316ccd7 Author: Gil Fine Date: Thu May 11 11:19:20 2023 +0300 thunderbolt: Increase NVM_MAX_SIZE to support Intel Barlow Ridge controller Intel Barlow Ridge discrete USB4 controller has larger NOR Flash, hence increase NVM_MAX_SIZE to support it. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 7c81a578cbd1124265c07895395f0a5f30fab5d1 Author: Gil Fine Date: Thu May 11 11:19:19 2023 +0300 thunderbolt: Move constants related to NVM into nvm.c Move constants related to NVM into nvm.c to make the code cleaner. Use a separate constant for USB4_DATA_DWORDS in usb4.c. No functional changes. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit f2bfa944080dcbb8eb56259dfd2c07204cbee17e Author: Mika Westerberg Date: Wed May 17 10:45:53 2023 +0300 thunderbolt: Limit Intel Barlow Ridge USB3 bandwidth Intel Barlow Ridge discrete USB4 host router has the same limitation as the previous generations so make sure the USB3 bandwidth limitation quirk is applied to Barlow Ridge too. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 6f14a210661ce03988ef4ed3c8402037c8e06539 Author: Mika Westerberg Date: Sat Dec 17 08:35:04 2022 +0200 thunderbolt: Add Intel Barlow Ridge PCI ID Intel Barlow Ridge is the first USB4 v2 controller from Intel. The controller exposes standard USB4 PCI class ID in typical configurations, however there is a way to configure it so that it uses a special class ID to allow using s different driver than the Windows inbox one. For this reason add the Barlow Ridge PCI ID to the Linux driver too so that the driver can attach regardless of the class ID. Tested-by: Pengfei Xu Signed-off-by: Mika Westerberg commit 0209c808a56e6469f0ed50dd2e70c3aec074bf90 Author: Gil Fine Date: Wed Jan 25 11:48:14 2023 +0200 thunderbolt: Fix PCIe adapter capability length for USB4 v2 routers For USB4 v2 routers, the PCIe adapter capability length is longer. Display the correct capability length in the debugfs register dump. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 75abb4f5fff2314eef15887663a8dcfa062b4f67 Author: Gil Fine Date: Wed Jan 25 11:48:13 2023 +0200 thunderbolt: Fix DisplayPort IN adapter capability length for USB4 v2 routers For USB4 v2 routers, the DisplayPort IN adapter capability length is longer. Display the correct capability length in the debugfs register dump. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit ee22d52aeef1ed417fc7fddc6a7ba047e78f7003 Author: Gil Fine Date: Wed Jan 25 11:48:12 2023 +0200 thunderbolt: Add two additional double words for adapters TMU for USB4 v2 routers For USB4 v2 routers, the adapters's TMU capability has two additional double words. Include them in the debugfs register dump. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 6e19d48ea0d8aeee5688e5718cf2143d281864f3 Author: Gil Fine Date: Thu Sep 29 12:49:48 2022 +0300 thunderbolt: Enable USB4 v2 PCIe TLP/DLLP extended encapsulation USB4 v2 spec introduces modified encapsulation of PCIe TLP and DLLP packets. This improves the PCIe tunneled traffic usage by reducing overhead. Enable this if both sides of the link support it. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 14200a2631dd1f041201985e2a757d2d06ba2524 Author: Gil Fine Date: Thu Sep 29 13:17:24 2022 +0300 thunderbolt: Announce USB4 v2 connection manager support Program the CMUV (Connection Manager USB4 Version) field for USB4 v2 and v1 routers according to the spec. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 0fc70886569c8459c4494ba9ef8c4ef34b81e781 Author: Mika Westerberg Date: Fri Dec 23 16:59:00 2022 +0200 thunderbolt: Reset USB4 v2 host router USB4 v2 added a bit that can be used to reset the host router so we use this to trigger reset when the driver probes. This will reset the already connected topology as well but doing this simplifies things a lot if for instance the link is already set to asymmetric. We also add a module parameter to prevent this in case of problems. While there rename the REG_HOP_COUNT to REG_CAPS to match the USB4 spec naming better. Signed-off-by: Mika Westerberg commit 235d019481bcaa38a1d407f8513c54209aa387b8 Author: Mika Westerberg Date: Fri Dec 23 10:45:51 2022 +0200 thunderbolt: Add the new USB4 v2 notification types USB4 v2 spec adds a bunch of new notifications that the connection manager can use instead of polling. While we do not use these yet we need to ack the ones routers expect to be acked. Signed-off-by: Mika Westerberg commit e111fb92513771cbcae70d0aa855c3ca20f48c1b Author: Gil Fine Date: Thu Sep 29 13:00:09 2022 +0300 thunderbolt: Add support for USB4 v2 80 Gb/s link USB4 v2 bumps the per-lane speed up to 40 Gb/s. Also the lanes are always bonded which gives 80 Gb/s symmetric link (and 120/40 Gb/s asymmetric). This updates the speed and width of routers and XDomain connections to support the Gen 4 link. For now we keep the link as is even if it is already asymmetric. While there make tb_port_set_link_width() static. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 6e21007d0f7e6723bb67e79aa3d0081419c403e8 Author: Gil Fine Date: Fri Sep 23 01:30:43 2022 +0300 thunderbolt: Identify USB4 v2 routers Add a new function usb4_switch_version() that can be used to figure out the spec version of the router and make tb_switch_is_usb4() to use it as well. Update the uevent accordingly. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 2ad3e1314cafad9a8edbefed2b19d2a101cdb4fc Author: Mika Westerberg Date: Fri Dec 16 16:28:05 2022 +0200 thunderbolt: Do not touch lane 1 adapter path config space It is not required to be implemented at all because USB4 does not use lane 1 for tunneling except when aggregated with lane 0. For this reason do not try to read the path config space of USB4 lane 1 adapters. Signed-off-by: Mika Westerberg commit 4796efdd16a8066919a3ff479e0bbc14bac816ff Author: Mika Westerberg Date: Fri Dec 16 13:41:12 2022 +0200 thunderbolt: Ignore data CRC mismatch for USB4 routers This is also something not always updated after the DROM contents itself so issue warning but continue parsing it as we do for pre-USB4 DROMs too. Signed-off-by: Mika Westerberg commit 18da174d865a87d47d2f33f5b0a322efcf067728 Author: Jisheng Zhang Date: Thu Jun 15 00:20:35 2023 +0800 net: ethernet: litex: add support for 64 bit stats Implement 64 bit per cpu stats to fix the overflow of netdev->stats on 32 bit platforms. To simplify the code, we use net core pcpu_sw_netstats infrastructure. One small drawback is some memory overhead because litex uses just one queue, but we allocate the counters per cpu. Signed-off-by: Jisheng Zhang Reviewed-by: Simon Horman Acked-by: Gabriel Somlo Link: https://lore.kernel.org/r/20230614162035.300-1-jszhang@kernel.org Signed-off-by: Jakub Kicinski commit 7deb0c3c24c474e0b79ea03f965b91c9cb1ba08f Merge: 8f72fb1578a91 96868cca7971a Author: Jakub Kicinski Date: Thu Jun 15 22:54:55 2023 -0700 Merge branch 'optimize-procedure-of-changing-mac-address-on-interface' Piotr Gardocki says: ==================== optimize procedure of changing MAC address on interface The first patch adds an if statement in core to skip early when the MAC address is not being changes. The remaining patches remove such checks from Intel drivers as they're redundant at this point. ==================== Link: https://lore.kernel.org/r/20230614145302.902301-1-piotrx.gardocki@intel.com Signed-off-by: Jakub Kicinski commit 96868cca7971a5a3887717fdacd44b281fb87cc9 Author: Piotr Gardocki Date: Wed Jun 14 16:53:02 2023 +0200 ice: remove unnecessary check for old MAC == new MAC The check has been moved to core. The ndo_set_mac_address callback is not being called with new MAC address equal to the old one anymore. Signed-off-by: Piotr Gardocki Reviewed-by: Simon Horman Signed-off-by: Jakub Kicinski commit c45a6d1a23c50b97afd7d767b86e28ea5722e7b7 Author: Piotr Gardocki Date: Wed Jun 14 16:53:01 2023 +0200 i40e: remove unnecessary check for old MAC == new MAC The check has been moved to core. The ndo_set_mac_address callback is not being called with new MAC address equal to the old one anymore. Signed-off-by: Piotr Gardocki Reviewed-by: Simon Horman Signed-off-by: Jakub Kicinski commit ad72c4a06acc6762e84994ac2f722da7a07df34e Author: Piotr Gardocki Date: Wed Jun 14 16:53:00 2023 +0200 net: add check for current MAC address in dev_set_mac_address In some cases it is possible for kernel to come with request to change primary MAC address to the address that is already set on the given interface. Add proper check to return fast from the function in these cases. An example of such case is adding an interface to bonding channel in balance-alb mode: modprobe bonding mode=balance-alb miimon=100 max_bonds=1 ip link set bond0 up ifenslave bond0 Signed-off-by: Piotr Gardocki Reviewed-by: Simon Horman Signed-off-by: Jakub Kicinski commit 8f72fb1578a910571b3f25457e3b7855edfac6cf Author: Jakub Kicinski Date: Wed Jun 14 20:52:31 2023 -0700 eth: fs_enet: fix print format for resource size Randy reported that linux-next build warns on PowerPC: drivers/net/ethernet/freescale/fs_enet/mii-fec.c: In function 'fs_enet_mdio_probe': drivers/net/ethernet/freescale/fs_enet/mii-fec.c:130:50: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=] 130 | snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start); | ~^ ~~~~~~~~~ | | | | | resource_size_t {aka long long unsigned int} | unsigned int | %llx Use the right print format. Link: https://lore.kernel.org/all/8f9f8d38-d9c7-9f1b-feb0-103d76902d14@infradead.org/ Reported-by: Randy Dunlap Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Link: https://lore.kernel.org/r/20230615035231.2184880-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit ca2d49f77ce4531c74ba207b1e07b55f5ced5ab4 Author: David Howells Date: Wed Jun 14 11:09:48 2023 +0100 splice, net: Fix splice_to_socket() to handle pipe bufs larger than a page splice_to_socket() assumes that a pipe_buffer won't hold more than a single page of data - but this assumption can be violated by skb_splice_bits() when it splices from a socket into a pipe. The problem is that splice_to_socket() doesn't advance the pipe_buffer length and offset when transcribing from the pipe buf into a bio_vec, so if the buf is >PAGE_SIZE, it keeps repeating the same initial chunk and doesn't advance the tail index. It then subtracts this from "remain" and overcounts the amount of data to be sent. The cleanup phase then tries to overclean the pipe, hits an unused pipe buf and a NULL-pointer dereference occurs. Fix this by not restricting the bio_vec size to PAGE_SIZE and instead transcribing the entirety of each pipe_buffer into a single bio_vec and advancing the tail index if remain hasn't hit zero yet. Large bio_vecs will then be split up by iterator functions such as iov_iter_extract_pages(). This resulted in a KASAN report looking like: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] ... RIP: 0010:pipe_buf_release include/linux/pipe_fs_i.h:203 [inline] RIP: 0010:splice_to_socket+0xa91/0xe30 fs/splice.c:933 Fixes: 2dc334f1a63a ("splice, net: Use sendmsg(MSG_SPLICE_PAGES) rather than ->sendpage()") Reported-by: syzbot+f9e28a23426ac3b24f20@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/0000000000000900e905fdeb8e39@google.com/ Tested-by: syzbot+f9e28a23426ac3b24f20@syzkaller.appspotmail.com Signed-off-by: David Howells cc: Willem de Bruijn cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox cc: Christian Brauner cc: Alexander Viro Link: https://lore.kernel.org/r/1428985.1686737388@warthog.procyon.org.uk Signed-off-by: Jakub Kicinski commit d9ffa069e006fa2873b94fbf2387546942d4f85b Author: Stephen Rothwell Date: Tue Jun 13 16:46:39 2023 +1000 sunvnet: fix sparc64 build error after gso code split After merging the net-next tree, today's linux-next build (sparc64 defconfig) failed like this: drivers/net/ethernet/sun/sunvnet_common.c: In function 'vnet_handle_offloads': drivers/net/ethernet/sun/sunvnet_common.c:1277:16: error: implicit declaration of function 'skb_gso_segment'; did you mean 'skb_gso_reset'? [-Werror=implicit-function-declaration] 1277 | segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO); | ^~~~~~~~~~~~~~~ | skb_gso_reset drivers/net/ethernet/sun/sunvnet_common.c:1277:14: warning: assignment to 'struct sk_buff *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1277 | segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO); | ^ Fixes: d457a0e329b0 ("net: move gso declarations and functions to their own files") Signed-off-by: Stephen Rothwell Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230613164639.164b2991@canb.auug.org.au Signed-off-by: Jakub Kicinski commit f7d625adeb7bc6a9ec83d32d9615889969d64484 Author: David Arinzon Date: Mon Jun 12 12:14:48 2023 +0000 net: ena: Add dynamic recycling mechanism for rx buffers The current implementation allocates page-sized rx buffers. As traffic may consist of different types and sizes of packets, in various cases, buffers are not fully used. This change (Dynamic RX Buffers - DRB) uses part of the allocated rx page needed for the incoming packet, and returns the rest of the unused page to be used again as an rx buffer for future packets. A threshold of 2K for unused space has been set in order to declare whether the remainder of the page can be reused again as an rx buffer. As a page may be reused, dma_sync_single_for_cpu() is added in order to sync the memory to the CPU side after it was owned by the HW. In addition, when the rx page can no longer be reused, it is being unmapped using dma_page_unmap(), which implicitly syncs and then unmaps the entire page. In case the kernel still handles the skbs pointing to the previous buffers from that rx page, it may access garbage pointers, caused by the implicit sync overwriting them. The implicit dma sync is removed by replacing dma_page_unmap() with dma_unmap_page_attrs() with DMA_ATTR_SKIP_CPU_SYNC flag. The functionality is disabled for XDP traffic to avoid handling several descriptors per packet. Signed-off-by: Arthur Kiyanovski Signed-off-by: Shay Agroskin Signed-off-by: David Arinzon Link: https://lore.kernel.org/r/20230612121448.28829-1-darinzon@amazon.com Signed-off-by: Jakub Kicinski commit e1d001fa5b477c4da46a29be1fcece91db7c7c6f Author: Breno Leitao Date: Fri Jun 9 08:27:42 2023 -0700 net: ioctl: Use kernel memory on protocol ioctl callbacks Most of the ioctls to net protocols operates directly on userspace argument (arg). Usually doing get_user()/put_user() directly in the ioctl callback. This is not flexible, because it is hard to reuse these functions without passing userspace buffers. Change the "struct proto" ioctls to avoid touching userspace memory and operate on kernel buffers, i.e., all protocol's ioctl callbacks is adapted to operate on a kernel memory other than on userspace (so, no more {put,get}_user() and friends being called in the ioctl callback). This changes the "struct proto" ioctl format in the following way: int (*ioctl)(struct sock *sk, int cmd, - unsigned long arg); + int *karg); (Important to say that this patch does not touch the "struct proto_ops" protocols) So, the "karg" argument, which is passed to the ioctl callback, is a pointer allocated to kernel space memory (inside a function wrapper). This buffer (karg) may contain input argument (copied from userspace in a prep function) and it might return a value/buffer, which is copied back to userspace if necessary. There is not one-size-fits-all format (that is I am using 'may' above), but basically, there are three type of ioctls: 1) Do not read from userspace, returns a result to userspace 2) Read an input parameter from userspace, and does not return anything to userspace 3) Read an input from userspace, and return a buffer to userspace. The default case (1) (where no input parameter is given, and an "int" is returned to userspace) encompasses more than 90% of the cases, but there are two other exceptions. Here is a list of exceptions: * Protocol RAW: * cmd = SIOCGETVIFCNT: * input and output = struct sioc_vif_req * cmd = SIOCGETSGCNT * input and output = struct sioc_sg_req * Explanation: for the SIOCGETVIFCNT case, userspace passes the input argument, which is struct sioc_vif_req. Then the callback populates the struct, which is copied back to userspace. * Protocol RAW6: * cmd = SIOCGETMIFCNT_IN6 * input and output = struct sioc_mif_req6 * cmd = SIOCGETSGCNT_IN6 * input and output = struct sioc_sg_req6 * Protocol PHONET: * cmd == SIOCPNADDRESOURCE | SIOCPNDELRESOURCE * input int (4 bytes) * Nothing is copied back to userspace. For the exception cases, functions sock_sk_ioctl_inout() will copy the userspace input, and copy it back to kernel space. The wrapper that prepare the buffer and put the buffer back to user is sk_ioctl(), so, instead of calling sk->sk_prot->ioctl(), the callee now calls sk_ioctl(), which will handle all cases. Signed-off-by: Breno Leitao Reviewed-by: Willem de Bruijn Reviewed-by: David Ahern Reviewed-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20230609152800.830401-1-leitao@debian.org Signed-off-by: Jakub Kicinski commit 173780ff18a93298ca84224cc79df69f9cc198ce Merge: 97c5209b3d374 40f71e7cd3c6a Author: Jakub Kicinski Date: Thu Jun 15 22:18:58 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. Conflicts: include/linux/mlx5/driver.h 617f5db1a626 ("RDMA/mlx5: Fix affinity assignment") dc13180824b7 ("net/mlx5: Enable devlink port for embedded cpu VF vports") https://lore.kernel.org/all/20230613125939.595e50b8@canb.auug.org.au/ tools/testing/selftests/net/mptcp/mptcp_join.sh 47867f0a7e83 ("selftests: mptcp: join: skip check if MIB counter not supported") 425ba803124b ("selftests: mptcp: join: support RM_ADDR for used endpoints or not") 45b1a1227a7a ("mptcp: introduces more address related mibs") 0639fa230a21 ("selftests: mptcp: add explicit check for new mibs") https://lore.kernel.org/netdev/20230609-upstream-net-20230610-mptcp-selftests-support-old-kernels-part-3-v1-0-2896fe2ee8a3@tessares.net/ No adjacent changes. Signed-off-by: Jakub Kicinski commit 18b687d7ef90d1dd56c4df3be7365977861f5d82 Author: Kan Liang Date: Thu Jun 15 06:53:13 2023 -0700 pert tests: Update metric-value for perf stat JSON output There may be multiplexing triggered, e.g., e-core of ADL. Reviewed-by: Ian Rogers Signed-off-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230615135315.3662428-7-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit b0a9e8f81fc45e6d3c9ddf290dabd7f4610f2939 Author: Kan Liang Date: Thu Jun 15 06:53:10 2023 -0700 perf stat,jevents: Introduce Default tags for the default mode Introduce a new metricgroup, Default, to tag all the metric groups which will be collected in the default mode. Add a new field, DefaultMetricgroupName, in the JSON file to indicate the real metric group name. It will be printed in the default output to replace the event names. There is nothing changed for the output format. On SPR, both TopdownL1 and TopdownL2 are displayed in the default output. On ARM, Intel ICL and later platforms (before SPR), only TopdownL1 is displayed in the default output. Suggested-by: Stephane Eranian Reviewed-by: Ian Rogers Signed-off-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230615135315.3662428-4-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 969a4661440808a820361c25a59d59cd9d3a9978 Author: Kan Liang Date: Thu Jun 15 06:53:09 2023 -0700 perf metric: JSON flag to default metric group For the default output, the default metric group could vary on different platforms. For example, on SPR, the TopdownL1 and TopdownL2 metrics should be displayed in the default mode. On ICL, only the TopdownL1 should be displayed. Add a flag so we can tag the default metric group for different platforms rather than hack the perf code. The flag is added to Intel TopdownL1 since ICL and ADL, TopdownL2 metrics since SPR. Add a new field, DefaultMetricgroupName, in the JSON file to indicate the real metric group name. Reviewed-by: Ian Rogers Signed-off-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230615135315.3662428-3-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e15e4a3d7da9521632c39a1f1bfa1e30f80e0415 Author: Kan Liang Date: Thu Jun 15 06:53:08 2023 -0700 perf evsel: Fix the annotation for hardware events on hybrid The annotation for hardware events is wrong on hybrid. For example, # ./perf stat -a sleep 1 Performance counter stats for 'system wide': 32,148.85 msec cpu-clock # 32.000 CPUs utilized 374 context-switches # 11.633 /sec 33 cpu-migrations # 1.026 /sec 295 page-faults # 9.176 /sec 18,979,960 cpu_core/cycles/ # 590.378 K/sec 261,230,783 cpu_atom/cycles/ # 8.126 M/sec (54.21%) 17,019,732 cpu_core/instructions/ # 529.404 K/sec 38,020,470 cpu_atom/instructions/ # 1.183 M/sec (63.36%) 3,296,743 cpu_core/branches/ # 102.546 K/sec 6,692,338 cpu_atom/branches/ # 208.167 K/sec (63.40%) 96,421 cpu_core/branch-misses/ # 2.999 K/sec 1,016,336 cpu_atom/branch-misses/ # 31.613 K/sec (63.38%) The hardware events have extended type on hybrid, but the evsel__match() doesn't take it into account. Filter the config on hybrid before checking. With the patch, # ./perf stat -a sleep 1 Performance counter stats for 'system wide': 32,139.90 msec cpu-clock # 32.003 CPUs utilized 343 context-switches # 10.672 /sec 32 cpu-migrations # 0.996 /sec 73 page-faults # 2.271 /sec 13,712,841 cpu_core/cycles/ # 0.000 GHz 258,301,691 cpu_atom/cycles/ # 0.008 GHz (54.20%) 12,428,163 cpu_core/instructions/ # 0.91 insn per cycle 37,786,557 cpu_atom/instructions/ # 2.76 insn per cycle (63.35%) 2,418,826 cpu_core/branches/ # 75.259 K/sec 6,965,962 cpu_atom/branches/ # 216.739 K/sec (63.38%) 72,150 cpu_core/branch-misses/ # 2.98% of all branches 1,032,746 cpu_atom/branch-misses/ # 42.70% of all branches (63.35%) Suggested-by: Ian Rogers Reviewed-by: Ian Rogers Signed-off-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230615135315.3662428-2-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e90208e9ffe6cbeb3c14cba14082137bcb633ffe Author: Ian Rogers Date: Wed Jun 14 19:50:41 2023 -0700 perf srcline: Fix handling of inline functions We write an address then a ',' to addr2line. With inline data we generally get back (// are my comments): 0x1234 // address foo // function name foo.c:123 // filename:line bar // function name bar.c:123 // filename:line 0x000000000000000 // sentinel address created by ',' ?? // unknown function name ??:0 // unknown filename:line The code was assuming the inline data also had the address, which is incorrect. This means the first inline function name (bar above) needs to be checked to see if it is the sentinel, otherwise to be treated as a function name. The regression was caused by the addition of addresses as the kernel is reporting a symbol at address 0 (used by GNU binutils when it interprets ','). Committer testing: Using: # perf trace --call-graph=dwarf -e lock:contention_* 1244.615 TaskCon~ller #/2645281 lock:contention_begin(lock_addr: 0xffff8e6748da5ab0, flags: 2) __preempt_count_dec_and_test (inlined) trace_contention_begin (inlined) trace_contention_begin (inlined) rwsem_down_read_slowpath ([kernel.kallsyms]) __preempt_count_dec_and_test (inlined) trace_contention_begin (inlined) trace_contention_begin (inlined) rwsem_down_read_slowpath ([kernel.kallsyms]) __down_read_common (inlined) __down_read (inlined) down_read ([kernel.kallsyms]) arch_static_branch (inlined) static_key_false (inlined) __mmap_lock_trace_acquire_returned (inlined) mmap_read_lock (inlined) do_user_addr_fault ([kernel.kallsyms]) arch_local_irq_disable (inlined) handle_page_fault (inlined) exc_page_fault ([kernel.kallsyms]) asm_exc_page_fault ([kernel.kallsyms]) [0x4def008] (/usr/lib64/firefox/libxul.so) 1244.619 TaskCon~ller #/2645281 lock:contention_end(lock_addr: 0xffff8e6748da5ab0) __preempt_count_dec_and_test (inlined) trace_contention_end (inlined) trace_contention_end (inlined) rwsem_down_read_slowpath ([kernel.kallsyms]) __preempt_count_dec_and_test (inlined) trace_contention_end (inlined) trace_contention_end (inlined) rwsem_down_read_slowpath ([kernel.kallsyms]) __down_read_common (inlined) __down_read (inlined) down_read ([kernel.kallsyms]) arch_static_branch (inlined) static_key_false (inlined) __mmap_lock_trace_acquire_returned (inlined) mmap_read_lock (inlined) do_user_addr_fault ([kernel.kallsyms]) arch_local_irq_disable (inlined) handle_page_fault (inlined) exc_page_fault ([kernel.kallsyms]) asm_exc_page_fault ([kernel.kallsyms]) Fixes: 8dc26b6f718a8118 ("perf srcline: Make sentinel reading for binutils addr2line more robust") Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: llvm@lists.linux.dev Cc: Mark Rutland Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Tom Rix Link: https://lore.kernel.org/r/20230615025041.1982072-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 92d05e2492f1400029e84b5a72e15811ef787ee9 Merge: e1e315c4d5282 082fdfd13841f Author: Oliver Upton Date: Fri Jun 16 00:49:36 2023 +0000 Merge branch kvm-arm64/ampere1-hafdbs-mitigation into kvmarm/next * kvm-arm64/ampere1-hafdbs-mitigation: : AmpereOne erratum AC03_CPU_38 mitigation : : AmpereOne does not advertise support for FEAT_HAFDBS due to an : underlying erratum in the feature. The associated control bits do not : have RES0 behavior as required by the architecture. : : Introduce mitigations to prevent KVM from enabling the feature at : stage-2 as well as preventing KVM guests from enabling HAFDBS at : stage-1. KVM: arm64: Prevent guests from enabling HA/HD on Ampere1 KVM: arm64: Refactor HFGxTR configuration into separate helpers arm64: errata: Mitigate Ampere1 erratum AC03_CPU_38 at stage-2 Signed-off-by: Oliver Upton commit 082fdfd13841fa4e38a8b073561d182e195d528c Author: Oliver Upton Date: Fri Jun 9 22:01:04 2023 +0000 KVM: arm64: Prevent guests from enabling HA/HD on Ampere1 An erratum in the HAFDBS implementation in AmpereOne was addressed by clearing the feature in the ID register, with the expectation that software would not attempt to use the corresponding controls in TCR_EL1. The architecture, on the other hand, takes a much more pedantic stance on the subject, requiring the TCR bits behave as RES0. Take an extremely conservative stance on the issue and leverage the precise write trap afforded by FGT. Handle guest writes by clearing HA and HD before writing the intended value to the EL1 register alias. Link: https://lore.kernel.org/r/20230609220104.1836988-4-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit ce4a36225753a1a5f3641bff47ecd32fb394dd22 Author: Oliver Upton Date: Fri Jun 9 22:01:03 2023 +0000 KVM: arm64: Refactor HFGxTR configuration into separate helpers A subsequent change will need to flip more trap bits in HFGWTR_EL2. Make room for this by factoring out the programming of the HFGxTR registers into helpers and using locals to build the set/clear masks. Link: https://lore.kernel.org/r/20230609220104.1836988-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 6df696cd9bc1ceed0e92e36908f88bbd16d18255 Author: Oliver Upton Date: Fri Jun 9 22:01:02 2023 +0000 arm64: errata: Mitigate Ampere1 erratum AC03_CPU_38 at stage-2 AmpereOne has an erratum in its implementation of FEAT_HAFDBS that required disabling the feature on the design. This was done by reporting the feature as not implemented in the ID register, although the corresponding control bits were not actually RES0. This does not align well with the requirements of the architecture, which mandates these bits be RES0 if HAFDBS isn't implemented. The kernel's use of stage-1 is unaffected, as the HA and HD bits are only set if HAFDBS is detected in the ID register. KVM, on the other hand, relies on the RES0 behavior at stage-2 to use the same value for VTCR_EL2 on any cpu in the system. Mitigate the non-RES0 behavior by leaving VTCR_EL2.HA clear on affected systems. Cc: stable@vger.kernel.org Cc: D Scott Phillips Cc: Darren Hart Acked-by: D Scott Phillips Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20230609220104.1836988-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit e245db7b1451c13da0be9af8f5831ecd3796f1fe Merge: 8e04cddf3b0ae 4080a0e7b36b7 Author: Dave Airlie Date: Fri Jun 16 08:33:31 2023 +1000 Merge tag 'mediatek-drm-next-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next Mediatek DRM Next for Linux 6.5 1. Add display binding document for MT6795 Signed-off-by: Dave Airlie From: Chun-Kuang Hu Link: https://patchwork.freedesktop.org/patch/msgid/20230614225803.2547-1-chunkuang.hu@kernel.org commit 8e04cddf3b0ae37fb25267cfc054c1671e9ad6d4 Merge: 901bdf5ea1a83 69f06e4fa0984 Author: Dave Airlie Date: Fri Jun 16 08:09:07 2023 +1000 Merge tag 'drm-intel-next-2023-06-10' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 feature pull #2 for v6.5: Features and functionality: - Meteorlake PM demand (Vinod, Mika) - Switch to dedicated workqueues to stop using flush_scheduled_work() (Luca) Refactoring and cleanups: - Move display runtime init under display/ (Matt) - Async flip error message clarifications (Arun) Fixes: - Remove 10bit gamma on desktop gen3 parts, they don't support it (Ville) - Fix driver probe error handling if driver creation fails (Matt) - Fix all -Wunused-but-set-variable warnings, and enable it for i915 (Jani) - Stop using edid_blob_ptr (Jani) - Fix log level for "CDS interlane align done" (Khaled) - Fix an unnecessary include prefix (Matt) Merges: - Backmerge drm-next to sync with drm-intel-gt-next (Jani) Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87o7lnpxz2.fsf@intel.com commit 72f1de49ffb90b29748284f27f1d6b829ab1de95 Author: Wayne Lin Date: Mon Apr 17 17:08:12 2023 +0800 drm/dp_mst: Clear MSG_RDY flag before sending new message [Why] The sequence for collecting down_reply from source perspective should be: Request_n->repeat (get partial reply of Request_n->clear message ready flag to ack DPRX that the message is received) till all partial replies for Request_n are received->new Request_n+1. Now there is chance that drm_dp_mst_hpd_irq() will fire new down request in the tx queue when the down reply is incomplete. Source is restricted to generate interveleaved message transactions so we should avoid it. Also, while assembling partial reply packets, reading out DPCD DOWN_REP Sideband MSG buffer + clearing DOWN_REP_MSG_RDY flag should be wrapped up as a complete operation for reading out a reply packet. Kicking off a new request before clearing DOWN_REP_MSG_RDY flag might be risky. e.g. If the reply of the new request has overwritten the DPRX DOWN_REP Sideband MSG buffer before source writing one to clear DOWN_REP_MSG_RDY flag, source then unintentionally flushes the reply for the new request. Should handle the up request in the same way. [How] Separete drm_dp_mst_hpd_irq() into 2 steps. After acking the MST IRQ event, driver calls drm_dp_mst_hpd_irq_send_new_request() and might trigger drm_dp_mst_kick_tx() only when there is no on going message transaction. Changes since v1: * Reworked on review comments received -> Adjust the fix to let driver explicitly kick off new down request when mst irq event is handled and acked -> Adjust the commit message Changes since v2: * Adjust the commit message * Adjust the naming of the divided 2 functions and add a new input parameter "ack". * Adjust code flow as per review comments. Changes since v3: * Update the function description of drm_dp_mst_hpd_irq_handle_event Changes since v4: * Change ack of drm_dp_mst_hpd_irq_handle_event() to be an array align the size of esi[] Signed-off-by: Wayne Lin Reviewed-by: Lyude Paul Acked-by: Jani Nikula Cc: stable@vger.kernel.org Signed-off-by: Alex Deucher commit 5d1c70bb6e40c52ee1ff8aa786389919e6fbb09d Author: Philip Yang Date: Tue Jun 6 15:46:33 2023 -0400 drm/amdgpu: Increase hmm range get pages timeout If hmm_range_fault returns -EBUSY, we should call hmm_range_fault again to validate the remaining pages. On one system with NUMA auto balancing enabled, hmm_range_fault takes 6 seconds for 1GB range because CPU migrate the range one page at a time. To be safe, increase timeout value to 1 second for 128MB range. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit d728eda3c59daf2df71f9aae4bb2d3a1eef081da Author: Philip Yang Date: Wed May 3 13:41:40 2023 -0400 drm/amdgpu: Enable translate further for GC v9.4.3 To extend UTCL2 reach. Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 222e0a8e2f8a89f41c518a43ced46e73c57a700e Author: Leonard Göhrs Date: Wed Jun 14 14:32:17 2023 +0200 dt-bindings: display: panel: mipi-dbi-spi: add spi-3wire property Some MIPI DBI panels support a three wire mode (clock, chip select, bidirectional data) that can be used to ask the panel if it is already set up by e.g. the bootloader and can thus skip the initialization. This enables a flicker-free boot. Signed-off-by: Leonard Göhrs Acked-by: Conor Dooley Reviewed-by: Rob Herring Reviewed-by: Noralf Trønnes Link: https://lore.kernel.org/r/20230614123222.4167460-4-l.goehrs@pengutronix.de Signed-off-by: Rob Herring commit 96b2b1a279e15d6441a244259744846a24eec8c0 Author: Leonard Göhrs Date: Wed Jun 14 14:32:16 2023 +0200 dt-bindings: display: panel: mipi-dbi-spi: add shineworld lh133k compatible The Shineworld LH133K is a 1.3" 240x240px RGB LCD with a MIPI DBI compatible SPI interface. The initialization procedure is quite basic with the exception of requiring inverted colors. A basic mipi-dbi-cmd[1] script to get the display running thus looks like this: $ cat shineworld,lh133k.txt command 0x11 # exit sleep mode delay 120 # The display seems to require display color inversion, so enable it. command 0x21 # INVON # Enable normal display mode (in contrast to partial display mode). command 0x13 # NORON command 0x29 # MIPI_DCS_SET_DISPLAY_ON $ mipi-dbi-cmd shineworld,lh133k.bin shineworld,lh133k.txt [1]: https://github.com/notro/panel-mipi-dbi Signed-off-by: Leonard Göhrs Acked-by: Conor Dooley Reviewed-by: Noralf Trønnes Link: https://lore.kernel.org/r/20230614123222.4167460-3-l.goehrs@pengutronix.de Signed-off-by: Rob Herring commit 016a46dcc0c68c529ae65953d123c625225ee583 Author: Leonard Göhrs Date: Wed Jun 14 14:32:15 2023 +0200 dt-bindings: vendor-prefixes: Add prefix for ShineWorld Innovations Add a vendor prefix for ShineWorld Innovations, a manufacturer of display panels https://www.swicn.com/. Signed-off-by: Leonard Göhrs Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230614123222.4167460-2-l.goehrs@pengutronix.de Signed-off-by: Rob Herring commit 0e41639d9a46b0285cd6381482037095f196d516 Author: Lijo Lazar Date: Tue Jun 13 16:18:46 2023 +0530 drm/amdgpu: Remove unused NBIO interface Set compute partition mode interface in NBIO is no longer used. Remove the only implementation from NBIO v7.9 Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit f562514174a0462579e1ba5422ce87472777cdff Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:51 2023 +0200 dt-bindings: clock: drop unneeded quotes and use absolute /schemas path Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Also absolute path starting with /schemas is preferred. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230609140751.65129-1-krzysztof.kozlowski@linaro.org Signed-off-by: Stephen Boyd commit 384febba1d2025b5d30d3f5330377778da1770e2 Author: Uwe Kleine-König Date: Mon Mar 27 19:35:25 2023 +0200 dt-bindings: timer: fsl,imxgpt: Add i.MX8MP variant The i.MX8MP has the same register layout as the i.MX6DL, so add it as a variant allowing to add the GPT IP blocks to the i.MX8MP's dtsi file. Signed-off-by: Uwe Kleine-König Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230327173526.851734-2-u.kleine-koenig@pengutronix.de Signed-off-by: Rob Herring commit 0778a2e9b35c00197db1df957dcb46853eead95f Author: Rob Herring Date: Tue Jun 13 14:12:30 2023 -0600 dt-bindings: crypto: fsl,sec-v4.0-mon: Add "linux,keycodes" and deprecate "linux,keycode" The "linux,keycode" property is non-standard. Add the common property "linux,keycodes" and mark "linux,keycode" deprecated so that the mistake is not propagated. Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230613201231.2826352-2-robh@kernel.org Signed-off-by: Rob Herring commit e7f4f656fac220ab18102b1c8c0450e166383f1e Author: Rob Herring Date: Tue Jun 13 14:12:29 2023 -0600 dt-bindings: crypto: fsl,sec-v4.0-mon: Add missing type for "linux,keycode" The "linux,keycode" property is missing a type probably because it was confused with the common property "linux,keycodes". Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230613201231.2826352-1-robh@kernel.org Signed-off-by: Rob Herring commit 66c9836013b18a309020182ea20a407a0962b458 Author: Rob Herring Date: Tue Jun 13 14:11:14 2023 -0600 dt-bindings: display: Add missing property types A couple of display bridge properties are missing a type definition. Add the types to them. Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230613201114.2824626-1-robh@kernel.org Signed-off-by: Rob Herring commit bf70dc4133537429f0fdd738b916368a7defb574 Author: Rob Herring Date: Tue Jun 13 14:09:29 2023 -0600 dt-bindings: net: bluetooth: nxp: Add missing type for "fw-init-baudrate" "fw-init-baudrate" is missing a type, add it. While we're here, define the default value with a schema rather than freeform text. Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230613200929.2822137-1-robh@kernel.org Signed-off-by: Rob Herring commit 9e654c047061016cb4a07f5c4f3b1596eb481fa6 Author: Krzysztof Kozlowski Date: Mon Jun 12 11:26:11 2023 +0200 dt-bindings: example-schema: don't use enum as fallback, explain clock-names Compatibles with multiple entries should have usually only one fallback compatible thus enum followed by enum is not a common case. Use 'const' as second compatible to show the recommended approach. Explain also when clock-names are not really necessary. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230612092611.12385-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit ab9b4008092c86dc12497af155a0901cc1156999 Author: Mark Rutland Date: Thu Jun 15 11:26:28 2023 +0100 arm64: mm: fix VA-range sanity check Both create_mapping_noalloc() and update_mapping_prot() sanity-check their 'virt' parameter, but the check itself doesn't make much sense. The condition used today appears to be a historical accident. The sanity-check condition: if ((virt >= PAGE_END) && (virt < VMALLOC_START)) { [ ... warning here ... ] return; } ... can only be true for the KASAN shadow region or the module region, and there's no reason to exclude these specifically for creating and updateing mappings. When arm64 support was first upstreamed in commit: c1cc1552616d0f35 ("arm64: MMU initialisation") ... the condition was: if (virt < VMALLOC_START) { [ ... warning here ... ] return; } At the time, VMALLOC_START was the lowest kernel address, and this was checking whether 'virt' would be translated via TTBR1. Subsequently in commit: 14c127c957c1c607 ("arm64: mm: Flip kernel VA space") ... the condition was changed to: if ((virt >= VA_START) && (virt < VMALLOC_START)) { [ ... warning here ... ] return; } This appear to have been a thinko. The commit moved the linear map to the bottom of the kernel address space, with VMALLOC_START being at the halfway point. The old condition would warn for changes to the linear map below this, and at the time VA_START was the end of the linear map. Subsequently we cleaned up the naming of VA_START in commit: 77ad4ce69321abbe ("arm64: memory: rename VA_START to PAGE_END") ... keeping the erroneous condition as: if ((virt >= PAGE_END) && (virt < VMALLOC_START)) { [ ... warning here ... ] return; } Correct the condition to check against the start of the TTBR1 address space, which is currently PAGE_OFFSET. This simplifies the logic, and more clearly matches the "outside kernel range" message in the warning. Signed-off-by: Mark Rutland Cc: Russell King Cc: Steve Capper Cc: Will Deacon Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20230615102628.1052103-1-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 0f8e5651095bcf6e60330c8d558fd1227e0d71b3 Author: Andy Shevchenko Date: Thu Jun 15 17:52:43 2023 +0300 of/platform: Propagate firmware node by calling device_set_node() Insulate of_device_alloc() and of_amba_device_create() from possible changes to fwnode_handle implementation by using device_set_node() instead of open-coding dev->dev.fwnode assignments. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230615145243.37095-1-andriy.shevchenko@linux.intel.com Signed-off-by: Rob Herring commit b9293d457ff3de415fa07d7e35978bceb29c3827 Author: Jamie Iles Date: Tue Jun 13 15:19:59 2023 +0100 arm64/mm: remove now-superfluous ISBs from TTBR writes At the time of authoring 7655abb95386 ("arm64: mm: Move ASID from TTBR0 to TTBR1"), the Arm ARM did not specify any ordering guarantees for direct writes to TTBR0_ELx and TTBR1_ELx and so an ISB was required after each write to ensure TLBs would only be populated from the expected (or reserved tables). In a recent update to the Arm ARM, the requirements have been relaxed to reflect the implementation of current CPUs and required implementation of future CPUs to read (RDYDPX in D8.2.3 Translation table base address register): Direct writes to TTBR0_ELx and TTBR1_ELx occur in program order relative to one another, without the need for explicit synchronization. For any one translation, all indirect reads of TTBR0_ELx and TTBR1_ELx that are made as part of the translation observe only one point in that order of direct writes. Remove the superfluous ISBs to optimize uaccess helpers and context switch. Cc: Will Deacon Cc: Mark Rutland Signed-off-by: Jamie Iles Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20230613141959.92697-1-quic_jiles@quicinc.com [catalin.marinas@arm.com: rename __cpu_set_reserved_ttbr0 to ..._nosync] [catalin.marinas@arm.com: move the cpu_set_reserved_ttbr0_nosync() call to cpu_do_switch_mm()] Signed-off-by: Catalin Marinas commit b4a11fa3331e163e177e76098fe1d8b12b87cf6b Author: Wyes Karny Date: Mon May 29 14:25:51 2023 +0000 cpufreq: Fail driver register if it has adjust_perf without fast_switch If fast_switch_possible flag is set by the scaling driver, the governor is free to select fast_switch function even if adjust_perf is set. Some scaling drivers which use adjust_perf don't set fast_switch thinking that the governor would never fall back to fast_switch. But the governor can fall back to fast_switch even in runtime if frequency invariance is disabled due to some reason. This could crash the kernel if the driver didn't set the fast_switch function pointer. Therefore, fail driver registration if it has adjust_perf without fast_switch. Suggested-by: Rafael J. Wysocki Suggested-by: Viresh Kumar Signed-off-by: Wyes Karny Signed-off-by: Rafael J. Wysocki commit c2951581e69c8fef39120068d1ef5b1974d54ff1 Author: Bjorn Andersson Date: Thu Jun 15 08:45:29 2023 -0700 Revert "arm64: dts: adapt to LP855X bindings changes" commit 'ebdcfc8c42c2 ("arm64: dts: adapt to LP855X bindings changes")' is a Tegra change, but was accidentally merged in the Qualcomm tree. The change is reverted to avoid rebasing a large number of other changes. This reverts commit ebdcfc8c42c2b9d5ca1b27d8ee558eefb3e904d8. Signed-off-by: Bjorn Andersson commit d297eedf83f5af96751c0da1e4355c19244a55a2 Author: James Zhu Date: Wed Jun 7 13:27:40 2023 -0400 drm/amdkfd: bump kfd ioctl minor version for event age availability Bump the minor version to declare event age tracking feature is now available. In kernel amdgpu driver, kfd_wait_on_events is used to support user space signal event wait function. For multiple threads waiting on same event scenery, race condition could occur since some threads after checking signal condition, before calling kfd_wait_on_events, the event interrupt could be fired and wake up other thread which are sleeping on this event. Then those threads could fall into sleep without waking up again. Adding event age tracking in both kernel and user mode, will help avoiding this race condition. Proposed ROCT-Thunk-Interface: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/commit/efdbf6cfbc026bd68ac3c35d00dacf84370eb81e https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/commit/1820ae0a2db85b6f584611dc0cde1a00e7c22915 Proposed ROCR-Runtime: https://github.com/RadeonOpenCompute/ROCR-Runtime/compare/master...zhums:ROCR-Runtime:new_event_wait_review https://github.com/RadeonOpenCompute/ROCR-Runtime/commit/e1f5bdb88eb882ac798aeca2c00ea3fbb2dba459 https://github.com/RadeonOpenCompute/ROCR-Runtime/commit/7d26afd14107b5c2a754c1a3f415d89f3aabb503 Signed-off-by: James Zhu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 973fddea6f3e0d2f623f13fbd5d4d2b775e157f0 Author: James Zhu Date: Thu Jun 8 11:22:03 2023 -0400 drm/amdkfd: update user space last_event_age Update user space last_event_age when event age is enabled. It is only for KFD_EVENT_TYPE_SIGNAL which is checked by user space. Signed-off-by: James Zhu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 96cdb5384d962a7d3be598f0bc9e2be73796e80c Author: James Zhu Date: Wed May 17 16:25:12 2023 -0400 drm/amdkfd: set activated flag true when event age unmatchs Set waiter's activated flag true when event age unmatchs with last_event_age. Signed-off-by: James Zhu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 4057e6ce3384e079f945a7f69797fc6c2864a90f Author: James Zhu Date: Wed May 17 16:22:47 2023 -0400 drm/amdkfd: add event_age tracking when receiving interrupt Add event_age tracking when receiving interrupt. Signed-off-by: James Zhu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6f582513ad15de729ee5c91dfef946f3c266a207 Author: James Zhu Date: Wed May 17 16:19:51 2023 -0400 drm/amdkfd: add event age tracking Add event age tracking Signed-off-by: James Zhu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 4f9b94d848696166011bead3109541ec2a523bb8 Author: ZhenGuo Yin Date: Tue May 9 17:46:17 2023 +0800 drm/scheduler: avoid infinite loop if entity's dependency is a scheduled error fence [Why] drm_sched_entity_add_dependency_cb ignores the scheduled fence and return false. If entity's dependency is a scheduler error fence and drm_sched_stop is called due to TDR, drm_sched_entity_pop_job will wait for the dependency infinitely. [How] Do not wait or ignore the scheduled error fence, add drm_sched_entity_wakeup callback for the dependency with scheduled error fence. Signed-off-by: ZhenGuo Yin Acked-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 71eaac368dccf0619f7adc012063930e459b133e Author: ZhenGuo Yin Date: Thu May 11 17:29:20 2023 +0800 drm/amdgpu: add entity error check in amdgpu_ctx_get_entity [Why] UMD is not aware of entity error, and will keep submitting jobs into the error entity. [How] Add entity error check when getting entity from ctx. Reviewed-by: Alex Deucher Signed-off-by: ZhenGuo Yin Signed-off-by: Alex Deucher commit f88e295e9094deee93066f32a4380307e8cb3dd9 Author: Christian König Date: Wed Apr 19 15:17:57 2023 +0200 drm/amdgpu: add VM generation token Instead of using the VRAM lost counter add a 64bit token which indicates if a context or job is still valid to use. Should the VRAM be lost or the page tables need re-creation the token will change indicating that userspace needs to act and re-create the contexts and re-submit the work. Signed-off-by: Christian König Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 55bf196f60dfc89488c5645d112a9176c6fe4708 Author: Christian König Date: Tue Apr 18 13:18:01 2023 +0200 drm/amdgpu: reset VM when an error is detected When some problem with the updates of page tables is detected reset the state machine of the VM and re-create all page tables from scratch. Signed-off-by: Christian König Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit e84e697d92d9d84ca13b4440cea36abe9a2fe079 Author: Christian König Date: Mon Apr 17 18:15:15 2023 +0200 drm/amdgpu: abort submissions during prepare on error Forward errors from previous submissions to this one. Signed-off-by: Christian König Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 89fae8dc41d0a9bfc9fc1ea7ec03bf36e680774d Author: Christian König Date: Mon Apr 17 13:04:06 2023 +0200 drm/amdgpu: mark soft recovered fences with -ENODATA Set the fence error code before trying to soft-recover it. It gets overwritten when a hard recovery is required. Signed-off-by: Christian König Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 0a33b11d26c6b7e975b54d469a739ffac29f67ab Author: Christian König Date: Mon Apr 17 12:52:18 2023 +0200 drm/amdgpu: mark force completed fences with -ECANCELED When we force complete fences we should mark them as canceled. Signed-off-by: Christian König Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit b13eb02ba8ba7617d41212121891756da31f1d8b Author: Christian König Date: Wed Apr 19 12:51:41 2023 +0200 drm/amdgpu: add amdgpu_error_* debugfs file This allows us to insert some error codes into the bottom of the pipeline on an engine. Signed-off-by: Christian König Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 2eb841bdbca819017e7483cdfbb3d401751848a5 Author: Alex Deucher Date: Thu Jun 15 09:59:34 2023 -0400 drm/amdgpu: mark GC 9.4.3 experimental for now Mark as experimental for now until we get closer to production to avoid possible undesireable behavior when mixing newer boards with older kernels. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a49568115143435390f20965902809471b6f830c Author: Tony Lindgren Date: Thu Jun 15 19:34:06 2023 +0530 arm64: dts: ti: Unify pin group node names for make dtbs checks Prepare for pinctrl-single yaml binding and unify pin group node names. Let's standardize on pin group node naming ending in -pins. As we don't necessarily have a SoC specific compatible property for pinctrl-single. I'd rather not add a pattern match for pins somewhere in the name for all the users. Trying to add matches for pins-default will be futile as on the earlier SoCs we've already seen names like pins-sleep, pins-idle, pins-off and so on that would need to be matched. And as the node is a pin group, let's prefer to use naming -pins rather than -pin as more pins may need to be added to the pin group later on. Signed-off-by: Tony Lindgren [vigneshr@ti.com: Rebase onto latest ti/next and extend to new nodes] Signed-off-by: Vignesh Raghavendra commit 7f066473e49ace276274336cd95f3c828ae4d2f8 Author: Francesco Dolcini Date: Thu Jun 15 11:50:58 2023 +0200 arm64: dts: ti: add verdin am62 yavia Add Toradex Verdin AM62 Yavia. Link: https://www.toradex.com/products/carrier-board/yavia Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20230615095058.33890-6-francesco@dolcini.it Signed-off-by: Vignesh Raghavendra commit 50e3424fbb77c853d14143949cdc1c6a8152c479 Author: Francesco Dolcini Date: Thu Jun 15 11:50:57 2023 +0200 arm64: dts: ti: add verdin am62 dahlia Add Toradex Verdin AM62 Dahlia. Link: https://www.toradex.com/products/carrier-board/dahlia-carrier-board-kit Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20230615095058.33890-5-francesco@dolcini.it Signed-off-by: Vignesh Raghavendra commit 316b80246b16bd1063e41e74ec7bae85e0813dd2 Author: Francesco Dolcini Date: Thu Jun 15 11:50:56 2023 +0200 arm64: dts: ti: add verdin am62 This patch adds the device tree to support Toradex Verdin AM62 a computer on module which can be used on different carrier boards and the Toradex Verdin Development Board carrier board. The module consists of an TI AM62 family SoC (either AM623 or AM625), a TPS65219 PMIC, a Gigabit Ethernet PHY, 512MB to 2GB of LPDDR4 RAM, an eMMC, a TLA2024 ADC, an I2C EEPROM, an RX8130 RTC, and optional Parallel RGB to MIPI DSI bridge plus an optional Bluetooth/Wi-Fi module. Anything that is not self-contained on the module is disabled by default. So far there is no display nor USB role switch supported, apart of that all the other functionalities are fine. Link: https://developer.toradex.com/hardware/verdin-som-family/modules/verdin-am62/ Link: https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62 Link: https://www.toradex.com/products/carrier-board/verdin-development-board-kit Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20230615095058.33890-4-francesco@dolcini.it Signed-off-by: Vignesh Raghavendra commit cf04083c59fbd5e0172dfcdc1f3735dcce42fc28 Author: Francesco Dolcini Date: Thu Jun 15 11:50:54 2023 +0200 dt-bindings: arm: ti: add toradex,verdin-am62 et al. Add toradex,verdin-am62 for Toradex Verdin AM62 SoM, its nonwifi and wifi variants and the carrier boards (Dahlia, Verdin Development Board and Yavia) they may be mated in. Link: https://developer.toradex.com/hardware/verdin-som-family/modules/verdin-am62/ Link: https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62 Signed-off-by: Francesco Dolcini Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230615095058.33890-2-francesco@dolcini.it Signed-off-by: Vignesh Raghavendra commit 3443c1c4ed61c3b9d0d211f81ebfa0b559836646 Author: Wadim Egorov Date: Thu May 4 16:01:43 2023 +0200 arm64: dts: ti: Add basic support for phyBOARD-Lyra-AM625 The phyCORE-AM62x [1] is a SoM (System on Module) featuring TI's AM62x SoC. It can be used in combination with different carrier boards. This module can come with different sizes and models for DDR, eMMC, SPI NOR Flash and various SoCs from the AM62x family. A development Kit, called phyBOARD-Lyra [2] is used as a carrier board reference design around the AM62x SoM. Supported features: * Debug UART * SPI NOR Flash * eMMC * 2x Ethernet * Micro SD card * I2C EEPROM * I2C RTC * GPIO Expander * LEDs * USB For more details, see: [1] Product page SoM: https://www.phytec.com/product/phycore-am62x [2] Product page CB: https://www.phytec.com/product/phyboard-am62x Signed-off-by: Wadim Egorov Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230504140143.1425951-2-w.egorov@phytec.de Signed-off-by: Vignesh Raghavendra commit d1bfdf867d5064b8aa1b5436882080a2e7945cfb Author: Raag Jadav Date: Thu Jun 15 18:20:22 2023 +0530 pinctrl: intel: refine ->irq_set_type() hook Refine ->irq_set_type() hook and improve its readability by: - Reducing scope of spinlock by moving unneeded operations out of it. - Dropping redundant PADCFG0_RXEVCFG_SHIFT and including it directly into PADCFG0_RXEVCFG_* definitions. - Utilizing temporary variables for common operations. - Simplifying if-else-if chain. Signed-off-by: Raag Jadav Signed-off-by: Andy Shevchenko commit c7fe3bbfd622b5ee2341f38421217f56629832a1 Author: Rob Herring Date: Fri Jun 9 12:31:59 2023 -0600 mfd: core: Use of_property_read_reg() to parse "reg" Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230609183159.1766429-1-robh@kernel.org Signed-off-by: Lee Jones commit 2e66833579ed759d7b7da1a8f07eb727ec6e80db Author: SeongJae Park Date: Tue Jun 13 18:30:15 2023 +0000 MAINTAINERS: Add source tree entry for kunit Patches for kunit are managed in kunit and kunit-fixes branches of linux-kselftest tree before merged into the mainline. However, the MAINTAINERS section for kunit is not having the entries for the branches. Add the entries. Signed-off-by: SeongJae Park Reviewed-by: David Gow Signed-off-by: Shuah Khan commit b00f55374ccb3e3e9af6ee46761b74acb648440d Author: Lijo Lazar Date: Tue Jun 13 13:39:36 2023 +0530 drm/amdgpu: Use PSP FW API for partition switch Use PSP firmware interface for switching compute partitions. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit fe381726c96d9a7c2bd6eafa30f22e968f532cd1 Author: Lijo Lazar Date: Tue Jun 13 12:50:02 2023 +0530 drm/amdgpu: Change nbio v7.9 xcp status definition PARTITION_MODE field in PARTITION_COMPUTE_STATUS register is defined as below by firmware. SPX = 0, DPX = 1, TPX = 2, QPX = 3, CPX = 4 Change driver definition accordingly. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit ca0b954a4315ca2228001c439ae1062561c81989 Author: Christian König Date: Mon Jun 5 11:11:22 2023 +0200 drm/amdgpu: make sure that BOs have a backing store It's perfectly possible that the BO is about to be destroyed and doesn't have a backing store associated with it. Signed-off-by: Christian König Reviewed-by: Alex Deucher Acked-by: Guchun Chen Tested-by: Mikhail Gavrilov Signed-off-by: Alex Deucher commit e2ad8e2df432498b1cee2af04df605723f4d75e6 Author: Christian König Date: Mon Jun 5 11:11:21 2023 +0200 drm/amdgpu: make sure BOs are locked in amdgpu_vm_get_memory We need to grab the lock of the BO or otherwise can run into a crash when we try to inspect the current location. Signed-off-by: Christian König Reviewed-by: Alex Deucher Acked-by: Guchun Chen Tested-by: Mikhail Gavrilov Signed-off-by: Alex Deucher commit 43aedbf4da1db9a9c2f9e160a4ae96dfda83774c Author: Stanley.Yang Date: Mon Jun 12 18:25:48 2023 +0800 drm/amdgpu: Add checking mc_vram_size Do not compare injection address with mc_vram_size if mc_vram_size is zero. Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 38298ce6fc35c65ba1364e4221a289dfa07bf5ea Author: Stanley.Yang Date: Mon Jun 12 15:25:05 2023 +0800 drm/amdgpu: Optimize checking ras supported Using "is_app_apu" to identify device in the native APU mode or carveout mode. Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 6fac3964a9092f0ac797cb30cce5fd44f80e5a09 Author: Candice Li Date: Mon Jun 12 11:00:41 2023 +0800 drm/amdgpu: Add channel_dis_num to ras init flags Add disabled channel number to ras init flags. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bcd9a5f8b9e2a705bc30e9b27ebf7b8a8625325f Author: Candice Li Date: Sat Jun 10 10:15:14 2023 +0800 drm/amdgpu: Update total channel number for umc v8_10 Update total channel number for umc v8_10. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4506f0bc15f42d22fc50f75a098ff9133ffdbe6f Author: Candice Li Date: Fri Jun 9 10:53:02 2023 +0800 drm/amd/pm: Align eccinfo table structure with smu v13_0_0 interface Update eccinfo table structure according to smu v13_0_0 interface. v2: Calculate array size instead of using macro definition. Signed-off-by: Candice Li Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit c39ca69b84acbfe0a9e09f62f78f8d769d849940 Author: Srinivasan Shanmugam Date: Tue Jun 13 20:18:38 2023 +0530 drm/amd/display: Convert to kdoc formats in dc/core/dc.c Fixes the following gcc with W=1: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3483: warning: Cannot understand * ******************************************************************************* drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:4204: warning: Cannot understand * ******************************************************************************* Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 80a780ab279906ec4d3b3589bc324746f12d8dbd Author: Jonathan Kim Date: Tue Jun 13 15:57:39 2023 -0400 drm/amdkfd: decrement queue count on mes queue destroy Queue count should decrement on queue destruction regardless of HWS support type. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 121f17ac42df73f0869c1bdce090b31935ea37c8 Author: Tim Huang Date: Fri Jun 9 13:29:37 2023 +0800 drm/amd/pm: enable more Pstates profile levels for SMU v13.0.5 This patch enables following UMD stable Pstates profile levels for power_dpm_force_performance_level interface. - profile_peak - profile_min_sclk - profile_standard Signed-off-by: Tim Huang Acked-by: Alex Deucher Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit fdc95df9c27dd4feb4bd74ac73e69eba49843db1 Author: Srinivasan Shanmugam Date: Mon Jun 12 14:32:50 2023 +0530 drm/radeon: Fix missing prototypes in radeon_atpx_handler.c Fixes the following gcc with W=1: drivers/gpu/drm/radeon/radeon_atpx_handler.c:64:6: warning: no previous prototype for ‘radeon_has_atpx’ [-Wmissing-prototypes] 64 | bool 4(void) { | ^~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/radeon_atpx_handler.c:68:6: warning: no previous prototype for ‘radeon_has_atpx_dgpu_power_cntl’ [-Wmissing-prototypes] 68 | bool radeon_has_atpx_dgpu_power_cntl(void) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/radeon_atpx_handler.c:72:6: warning: no previous prototype for ‘radeon_is_atpx_hybrid’ [-Wmissing-prototypes] 72 | bool radeon_is_atpx_hybrid(void) { | ^~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/radeon_atpx_handler.c:77:6: warning: no previous prototype for ‘radeon_atpx_dgpu_req_power_for_displays’ [-Wmissing-prototypes] 77 | bool radeon_atpx_dgpu_req_power_for_displays(void) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/radeon_atpx_handler.c:596:6: warning: no previous prototype for ‘radeon_register_atpx_handler’ [-Wmissing-prototypes] 596 | void radeon_register_atpx_handler(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/radeon_atpx_handler.c:614:6: warning: no previous prototype for ‘radeon_unregister_atpx_handler’ [-Wmissing-prototypes] 614 | void radeon_unregister_atpx_handler(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/radeon_atpx_handler.c:159: warning: expecting prototype for radeon_atpx_validate_functions(). Prototype was for radeon_atpx_validate() instead Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 71344a718a9fda8c551cdc4381d354f9a9907f6f Author: Luben Tuikov Date: Sat Jun 10 06:19:15 2023 -0400 drm/amdgpu: Fix usage of UMC fill record in RAS The fixed commit listed in the Fixes tag below, introduced a bug in amdgpu_ras.c::amdgpu_reserve_page_direct(), in that when introducing the new amdgpu_umc_fill_error_record() and internally in that new function the physical address (argument "uint64_t retired_page"--wrong name) is right-shifted by AMDGPU_GPU_PAGE_SHIFT. Thus, in amdgpu_reserve_page_direct() when we pass "address" to that new function, we should NOT right-shift it, since this results, erroneously, in the page address to be 0 for first 2^(2*AMDGPU_GPU_PAGE_SHIFT) memory addresses. This commit fixes this bug. Cc: Tao Zhou Cc: Hawking Zhang Cc: Alex Deucher Fixes: 400013b268cb ("drm/amdgpu: add umc_fill_error_record to make code more simple") Signed-off-by: Luben Tuikov Link: https://lore.kernel.org/r/20230610113536.10621-1-luben.tuikov@amd.com Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e5df16d9428f5c6d2d0b1eff244d6c330ba9ef3a Author: Alex Deucher Date: Wed Jun 7 12:14:00 2023 -0400 drm/amdgpu/sdma4: set align mask to 255 The wptr needs to be incremented at at least 64 dword intervals, use 256 to align with windows. This should fix potential hangs with unaligned updates. Reviewed-by: Felix Kuehling Reviewed-by: Aaron Liu Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 740f42a28f4cff9e009a17cc78666165ecca9293 Author: Luben Tuikov Date: Sat Jun 3 00:08:04 2023 -0400 drm/amdgpu: Report ras_num_recs in debugfs Report the number of records stored in the RAS EEPROM table in debugfs. This can be used by user-space to calculate the capacity of the RAS EEPROM table since "bad_page_cnt_threshold" is also reported in the same place in debugfs. See commit 7fb640714547 ("drm/amdgpu: Add bad_page_cnt_threshold to debugfs"). ras_num_recs can already be inferred by dumping the RAS EEPROM table, also in the same debugfs location, see commit reference c65b0805e77919 (drm/amdgpu: RAS EEPROM table is now in debugfs, 2021-04-08). This commit makes it an integer value easily shown in a single file. Cc: Alex Deucher Cc: Hawking Zhang Cc: Tao Zhou Cc: Stanley Yang Cc: John Clements Signed-off-by: Luben Tuikov Link: https://lore.kernel.org/r/20230603051043.211548-1-luben.tuikov@amd.com Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 765663b7faaedf7750ff7e59c3ce5dc51fdd1fca Author: Mukul Joshi Date: Mon Jun 12 19:02:39 2023 -0400 drm/amdkfd: Remove DUMMY_VRAM_SIZE Remove DUMMY_VRAM_SIZE as it is not needed and can result in reporting incorrect memory size. Signed-off-by: Mukul Joshi Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 82a1f42f6aeb54e29b78aa0890ffd3087120264a Author: Lijo Lazar Date: Tue Jun 13 16:05:21 2023 +0530 drm/amdgpu: Release SDMAv4.4.2 ecc irq properly Release ECC irq only if irq is enabled - only when RAS feature is enabled ECC irq gets enabled. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d4a4ff1c8e4cd752b517af7317077939f3a25dfe Author: Likun Gao Date: Tue Jun 13 12:10:00 2023 +0800 drm/amdgpu: add wait_for helper for spirom update Spirom update typically requires extremely long duration for command execution, and special helper function to wait for it completion. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ebbb0b103efdcf9b682c7fe8ea84b1cf355304c6 Author: Srinivasan Shanmugam Date: Mon Jun 5 09:41:29 2023 +0530 drm/amd/display: Clean up dcn10_optc.c kdoc Fixes the following W=1 kernel build warning: display/dc/dcn10/dcn10_optc.c:45: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * apply_front_porch_workaround TODO FPGA still need? display/dc/dcn10/dcn10_optc.c:136: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * program_timing_generator used by mode timing set display/dc/dcn10/dcn10_optc.c:391: warning: Function parameter or member 'optc' not described in 'optc1_set_timing_double_buffer' display/dc/dcn10/dcn10_optc.c:391: warning: Function parameter or member 'enable' not described in 'optc1_set_timing_double_buffer' display/dc/dcn10/dcn10_optc.c:404: warning: Function parameter or member 'optc' not described in 'optc1_unblank_crtc' display/dc/dcn10/dcn10_optc.c:404: warning: expecting prototype for unblank_crtc(). Prototype was for optc1_unblank_crtc() instead display/dc/dcn10/dcn10_optc.c:427: warning: Function parameter or member 'optc' not described in 'optc1_blank_crtc' display/dc/dcn10/dcn10_optc.c:427: warning: expecting prototype for blank_crtc(). Prototype was for optc1_blank_crtc() instead display/dc/dcn10/dcn10_optc.c:496: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Enable CRTC display/dc/dcn10/dcn10_optc.c:895: warning: Cannot understand ***************************************************************************** on line 895 - I thought it was a doc line Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Cc: Harry Wentland Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 2e1e62c8e5e79bce38b574dd4281e6a27fd7f665 Author: Srinivasan Shanmugam Date: Mon Jun 12 09:52:33 2023 +0530 drm/amd/display: Correct kdoc formats in dcn32_resource_helpers.c Fixes the following gcc with W=1: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:285: warning: Function parameter or member 'dc' not described in 'dcn32_determine_det_override' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:285: warning: Function parameter or member 'context' not described in 'dcn32_determine_det_override' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:285: warning: Function parameter or member 'pipes' not described in 'dcn32_determine_det_override' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:624: warning: Cannot understand * ***************************************************************** drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:676: warning: Cannot understand * ***************************************************************** Cc: Alvin Lee Cc: Stylon Wang Cc: Hamza Mahfooz Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Reviewed-by: Alvin Lee Signed-off-by: Alex Deucher commit 9379c7a89f0cfbccdbe788fa189a8b29533489f6 Author: Srinivasan Shanmugam Date: Sat Jun 3 19:08:17 2023 +0530 drm/amd/display: Provide function name for 'optc32_enable_crtc()' Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_optc.c:109: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Enable CRTC Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Cc: Harry Wentland Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 8b42e93b349c8fa18f3a27c56f04128657f47ff0 Author: Srinivasan Shanmugam Date: Mon Jun 12 06:52:07 2023 +0530 drm/amd/display: Correct and remove excess function parameter names in kdoc Fixes the following gcc with W=1: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:872: warning: Excess function parameter 'drr_pipe' description in 'subvp_drr_schedulable' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:1030: warning: Cannot understand * **************************************************** Cc: Stylon Wang Cc: Hamza Mahfooz Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit f9d9745a8603ad61937209c2431732b9abe444b7 Author: Srinivasan Shanmugam Date: Mon Jun 5 10:39:20 2023 +0530 drm/amd/display: Correct kdoc formats in dcn10_opp.c Fixes the following W=1 kernel build warning: display/dc/dcn10/dcn10_opp.c:52: warning: Function parameter or member 'oppn10' not described in 'opp1_set_truncation' display/dc/dcn10/dcn10_opp.c:52: warning: Function parameter or member 'params' not described in 'opp1_set_truncation' display/dc/dcn10/dcn10_opp.c:52: warning: expecting prototype for set_truncation(). Prototype was for opp1_set_truncation() instead display/dc/dcn10/dcn10_opp.c:161: warning: Function parameter or member 'oppn10' not described in 'opp1_set_pixel_encoding' display/dc/dcn10/dcn10_opp.c:161: warning: Function parameter or member 'params' not described in 'opp1_set_pixel_encoding' display/dc/dcn10/dcn10_opp.c:161: warning: expecting prototype for set_pixel_encoding(). Prototype was for opp1_set_pixel_encoding() instead display/dc/dcn10/dcn10_opp.c:183: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Set Clamping Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Cc: Harry Wentland Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 47d4a680b8e2cf0502ee5a6d0191d3b7b1bdcad7 Author: Srinivasan Shanmugam Date: Sat Jun 3 20:22:13 2023 +0530 drm/amdgpu: Add missing function parameter 'optc' & 'enable' to kdoc in optc3_set_timing_double_buffer() Fixes the following gcc with W=1: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_optc.c:285: warning: Function parameter or member 'optc' not described in 'optc3_set_timing_double_buffer' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_optc.c:285: warning: Function parameter or member 'enable' not described in 'optc3_set_timing_double_buffer' Cc: Harry Wentland Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit a1c23485b8ef40fbb9690fdf40f15bcb26c43e73 Author: Ma Jun Date: Wed Jun 7 17:19:14 2023 +0800 drm/amdgpu: Print client id for the unregistered interrupt resource Modify the debug information and print the clien id for these interrupts as well. Signed-off-by: Ma Jun Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit fb120e84b00ad4371c13a0f31df773fbbb16b09f Author: Ruili Ji Date: Tue Jun 6 14:06:01 2023 +0800 drm/amdkfd: To enable traps for GC_11_0_4 and up Flag trap_en should be enabled for trap handler. Signed-off-by: Ruili Ji Signed-off-by: Aaron Liu Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit e6b27cf515a7813ca2228a9aec8e61d67fb9fbf0 Author: Alex Deucher Date: Fri Jun 9 15:40:33 2023 -0400 drm/amd/display: don't free stolen console memory during suspend Don't free the memory if we are hitting this as part of suspend. This way we don't free any memory during suspend; see amdgpu_bo_free_kernel(). The memory will be freed in the first non-suspend modeset or when the driver is torn down. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2568 Acked-by: Harry Wentland Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit c541dce86c537714b6761a79a969c1623dfa222b Author: Jan Kara Date: Thu Jun 15 13:38:48 2023 +0200 fs: Protect reconfiguration of sb read-write from racing writes The reconfigure / remount code takes a lot of effort to protect filesystem's reconfiguration code from racing writes on remounting read-only. However during remounting read-only filesystem to read-write mode userspace writes can start immediately once we clear SB_RDONLY flag. This is inconvenient for example for ext4 because we need to do some writes to the filesystem (such as preparation of quota files) before we can take userspace writes so we are clearing SB_RDONLY flag before we are fully ready to accept userpace writes and syzbot has found a way to exploit this [1]. Also as far as I'm reading the code the filesystem remount code was protected from racing writes in the legacy mount path by the mount's MNT_READONLY flag so this is relatively new problem. It is actually fairly easy to protect remount read-write from racing writes using sb->s_readonly_remount flag so let's just do that instead of having to workaround these races in the filesystem code. [1] https://lore.kernel.org/all/00000000000006a0df05f6667499@google.com/T/ Signed-off-by: Jan Kara Message-Id: <20230615113848.8439-1-jack@suse.cz> Signed-off-by: Christian Brauner commit 7f80a88dd370777b86ff583f036c558c58c9f84c Author: Alex Deucher Date: Mon Jun 12 09:54:06 2023 -0400 Revert "drm/amd/display: fix dpms_off issue when disabling bios mode" This reverts commit 58e67bb3c131da5ee14e4842b08e53f4888dce0a. This patch was reverted, but came back again as commit 58e67bb3c131 ("drm/amd/display: fix dpms_off issue when disabling bios mode") Revert it again as it breaks Asus G513QY / 6800M laptops. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2259 Cc: Rodrigo Siqueira Cc: Zhongwei Cc: Harry Wentland Cc: Mike Lothian Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 8f7bd7010dd5bca920e9d3c0c040622b2e834b57 Author: Jonathan Kim Date: Mon Jun 12 11:42:24 2023 -0400 drm/amdkfd: fix null queue check on debug setting exceptions Null check should be done on queue struct itself and not on the process queue list node. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit fcdb3832a4edece23c043ce97b3a1f7647bec929 Author: Tim Huang Date: Fri Jun 9 13:11:44 2023 +0800 drm/amd/pm: enable vclk and dclk Pstates for SMU v13.0.5 Add the ability to control the vclk and dclk frequency by power_dpm_force_performance_level interface. Signed-off-by: Tim Huang Acked-by: Alex Deucher Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit d50dc746ff72b9c48812dac3344fa87fbde940a3 Author: Srinivasan Shanmugam Date: Fri Jun 9 14:06:43 2023 +0530 drm/amdgpu: Fix memcpy() in sienna_cichlid_append_powerplay_table function. Fixes the following gcc with W=1: In file included from ./include/linux/string.h:253, from ./include/linux/bitmap.h:11, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/cpumask.h:5, from ./arch/x86/include/asm/msr.h:11, from ./arch/x86/include/asm/processor.h:22, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:60, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:78, from ./include/linux/spinlock.h:56, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/firmware.h:7, from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/sienna_cichlid_ppt.c:26: In function ‘fortify_memcpy_chk’, inlined from ‘sienna_cichlid_append_powerplay_table’ at drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/sienna_cichlid_ppt.c:444:2, inlined from ‘sienna_cichlid_setup_pptable’ at drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/sienna_cichlid_ppt.c:506:8, inlined from ‘sienna_cichlid_setup_pptable’ at drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/sienna_cichlid_ppt.c:494:12: ./include/linux/fortify-string.h:413:4: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] 413 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ the compiler complains about the size calculation in the memcpy() - "sizeof(*smc_dpm_table) - sizeof(smc_dpm_table->table_header)" is much larger than what fits into table_member. Hence, reuse 'smu_memcpy_trailing' for nv1x Fixes: 7077b19a38240 ("drm/amd/pm: use macro to get pptable members") Suggested-by: Evan Quan Cc: Evan Quan Cc: Chengming Gui Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit e22821e6302780e2acaef7438cab828f68dde9d1 Author: Tim Huang Date: Fri Jun 9 13:07:56 2023 +0800 drm/amd/pm: fix vclk setting failed for SMU v13.0.5 PMFW use the left-shifted 16 bits argument to set the VCLK DPM frequency for SMU v13.0.5. Signed-off-by: Tim Huang Acked-by: Alex Deucher Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit ddafc678913c4573d52f075af7d82152d431f322 Author: Aric Cyr Date: Mon Jun 5 00:28:51 2023 -0400 drm/amd/display: 3.2.239 This version brings along following fixes: - Improvement on eDP - PSR bug fixes - SubVP bug fixes - Improvements on pipe handling to address potential issues - Freesync bug fix - DPIA bug fix - Fix multi-display issues Acked-by: Stylon Wang Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a2c7356f526dba1aa5f49ba17c822e46dcf7d6f6 Author: Dmytro Laktyushkin Date: Thu Jun 1 16:09:32 2023 -0400 drm/amd/display: fix pixel rate update sequence The k1/k2 pixel rate dividers in dccg should only be updated on stream enable and do not actually depend on whether odm combine is active. This removes an on flip update of these and fixes the calculate function to ignore odm status for dp steams. Acked-by: Stylon Wang Signed-off-by: Dmytro Laktyushkin Reviewed-by: Ariel Bernstein Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f4bc8a43069c6268a49f064fdbf85ead5cc2bf04 Author: Samson Tam Date: Tue May 30 17:35:58 2023 -0400 Revert "drm/amd/display: reallocate DET for dual displays with high pixel rate ratio" Revert commit 5f3401eeb064 ("drm/amd/display: reallocate DET for dual displays with high pixel rate ratio") [Why] Previously had modified DET allocation algorithm to allocate less DET segments for lower pixel rate display and more DET segments for higher pixel rate display. But noticed it is causing underflow when higher pixel rate display is not displaying at higher mode [How] Roll back change Acked-by: Stylon Wang Signed-off-by: Samson Tam Reviewed-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0e69ef6ea82e8eece7d2b2b45a0da9670eaaefff Author: Peichen Huang Date: Wed May 31 13:36:14 2023 +0800 drm/amd/display: limit DPIA link rate to HBR3 [Why] DPIA doesn't support UHBR, driver should not enable UHBR for dp tunneling [How] limit DPIA link rate to HBR3 Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Stylon Wang Signed-off-by: Peichen Huang Reviewed-by: Mustapha Ghaddar Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit bbe4418f22b9b20cf2654ca710e344955380e62c Author: Alvin Lee Date: Thu Jun 1 20:39:35 2023 -0400 drm/amd/display: Include CSC updates in new fast update path [Description] - Missed color / CSC updates in fast update path which caused Custom Color to break. - Add color / CSC updates to new fast update path to fix custom color Acked-by: Stylon Wang Signed-off-by: Alvin Lee Reviewed-by: Jun Lei Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit da55037afde24d74a1a3f26e4d314f897f3432b4 Author: Austin Zheng Date: Thu Jun 1 15:16:45 2023 -0400 drm/amd/display: Limit Minimum FreeSync Refresh Rate Why: Some EDIDs report a minimum refresh rate lower than what HW can support How: Add a check to calculate minimum supported refresh rate with current timing and use that as the minimum if a lower one is passed in Acked-by: Stylon Wang Signed-off-by: Austin Zheng Reviewed-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ec7282bd2688c6c741c79f8696a68c6c0403cf2d Author: Artem Grishin Date: Thu Jun 1 12:52:16 2023 -0400 drm/amd/display: Bug fix in dcn315_populate_dml_pipes_from_context [Why] When iterating over all pipes in the loop, the CRB allocation algorithm may potentially skip some of the pipes. Previously, the current pipe index didn't get updated in this case, causing incorrect outcome. [How] Increment the pipe index when skipping over a pipe in the loop. Acked-by: Stylon Wang Signed-off-by: Artem Grishin Reviewed-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 196754951fc8187c64806d0807c467d6f435d0c5 Author: Alvin Lee Date: Wed May 31 20:00:54 2023 -0400 drm/amd/display: Block SubVP + DRR if the DRR is PSR capable [Description] PSR implementation in FW has inline polling which can poll for up to 1ms. This will interfere with SubVP because SubVP is timing sensitive and can't tolerate up to 1ms worth of delay before handling vertical or VLINE interrupts. Therefore block SubVP + DRR cases if DRR is PSR capable Acked-by: Stylon Wang Signed-off-by: Alvin Lee Reviewed-by: Saaem Rizvi Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d62088ba314ecf098871874898ed760347d1fbd8 Author: Saaem Rizvi Date: Tue May 30 13:21:10 2023 -0400 drm/amd/display: Do not disable phantom pipes in driver [Why and How] We should not disable phantom pipes in this sequence, as this should be controlled by FW. Furthermore, the previous programming sequence would have enabled the phantom pipe in driver as well, causing corruption. This change should avoid this from occuring. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Stylon Wang Signed-off-by: Saaem Rizvi Reviewed-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 299004271cbf0315da327c4bd67aec3e7041cb32 Author: Alvin Lee Date: Wed May 31 12:35:57 2023 -0400 drm/amd/display: Re-enable SubVP high refresh Re-enable SubVP high refresh now that it is fixed for displays with high refresh rates. Acked-by: Stylon Wang Signed-off-by: Alvin Lee Reviewed-by: Saaem Rizvi Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4cc1cebe08bff0d2b75f16aa65ec61360e09a647 Author: Daniel Miess Date: Tue May 23 14:21:59 2023 -0400 drm/amd/display: Re-enable DPP/HUBP Power Gating [Why & How] Bugs preventing DPP/HUBP power gating have been addressed so this should be reenabled on dcn314 for sufficient hardware rev versions Acked-by: Stylon Wang Signed-off-by: Daniel Miess Reviewed-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1c982c9ffefd00120f2293bfd15fec5af475dc28 Author: Alvin Lee Date: Tue May 30 10:07:39 2023 -0400 drm/amd/display: SubVP high refresh only if all displays >= 120hz [Description] - SubVP high refresh should only be enabled if all displays are >= 120hz. We do not want to accidentally enables configs such as 60hz[SubVP] + 120hz[SubVP] - Ensure that the SubVP config generation code does not produce configs such as 60hz[SubVP] + 120hz[SubVP] - Also add admissibility checks to ensure these configs do not pass as valid configs Acked-by: Stylon Wang Signed-off-by: Alvin Lee Reviewed-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e8c49e9eead8620c7dd3c64a1f3bb44682325710 Author: Tom Chung Date: Mon May 29 14:27:11 2023 +0800 drm/amd/display: Fix disbling PSR slow response issue [Why] dmub_psr_get_state() return an invalid PSR state while disable the PSR because convert_psr_state() doesn't recognize the state that return from DMCUB. [How] Add a PSR state to make the dmub_psr_get_state() return a correct PSR state. Acked-by: Stylon Wang Signed-off-by: Tom Chung Reviewed-by: Wayne Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f308116676566b555ec3bab4c3f9eb20c1c9a5cb Author: Tom Chung Date: Mon May 29 18:00:09 2023 +0800 drm/amd/display: fix the system hang while disable PSR [Why] When the PSR enabled. If you try to adjust the timing parameters, it may cause system hang. Because the timing mismatch with the DMCUB settings. [How] Disable the PSR before adjusting timing parameters. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Stylon Wang Signed-off-by: Tom Chung Reviewed-by: Wayne Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5b4d93eaf6b44903f4c71b4f404f65317abd8d9c Author: Aric Cyr Date: Sun May 28 19:48:27 2023 -0400 drm/amd/display: Promote DAL to 3.2.238 Acked-by: Stylon Wang Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit be3a432a9d382a09e02c3359e4f6fcd991fe7d2a Author: Fangzhi Zuo Date: Tue May 16 15:36:45 2023 -0400 drm/amd/display: Add Error Code for Dml Validation Failure Any invalid mode from hw perspective should be given corresponding error code, otherwise it leads to confusing warning message "[drm] Mode Validation Warning: Validation OK failed validation." Acked-by: Stylon Wang Signed-off-by: Fangzhi Zuo Reviewed-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3d8de40fd639c8be24e4aa557a98e20e1d09bdc3 Author: Austin Zheng Date: Thu May 25 14:01:01 2023 -0400 drm/amd/display: Add DP2 Metrics Why: Log DP2 data to be used for debugging purposes How: Check the reported link rate of the DP connection and translate it to the DP version. Acked-by: Stylon Wang Signed-off-by: Austin Zheng Reviewed-by: Martin Leung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ee83c930974d4afb5fec3db638a8341b5d1cd3fa Author: Hersen Wu Date: Thu May 25 09:00:29 2023 -0400 drm/amd/display: add debugfs for allow_edp_hotplug_detection [Why] within dc_link_detect, edp edid is read only for the first time and saved. edid will not be read after the first time read. to run edp edid read test, need read edp edid for each dc_link_detect. dc->config flag allow_edp_hotplug_detection could be used for edp edid test. [How] add debugfs for dc->config.allow_edp_hotplug_detection Acked-by: Stylon Wang Signed-off-by: Hersen Wu Reviewed-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7a0e005c7957931689a327b2a4e7333a19f13f95 Author: Hersen Wu Date: Thu May 25 08:37:40 2023 -0400 drm/amd/display: edp do not add non-edid timings [Why] most edp support only timings from edid. applying non-edid timings, especially those timings out of edp bandwidth, may damage edp. [How] do not add non-edid timings for edp. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Stylon Wang Signed-off-by: Hersen Wu Reviewed-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 59eddd4e215afc05f0610ebabfa05d4b099e5c13 Author: Arunpravin Paneer Selvam Date: Fri Jun 9 06:18:41 2023 -0700 Revert "drm/amdgpu: remove TOPDOWN flags when allocating VRAM in large bar system" This reverts commit c105518679b6e87232874ffc989ec403bee59664. This patch disables the TOPDOWN flag for APU and few dGPU cards which has the VRAM size equal to the BAR size. When we enable the TOPDOWN flag, we get the free blocks at the highest available memory region and we don't split the lower order blocks. This change is required to keep off the fragmentation related issues particularly in ASIC which has VRAM space <= 500MiB Hence, we are reverting this patch. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2270 Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 8d8ffe3740b6de4a8a84817cd85195c533ed52b9 Author: Shiwu Zhang Date: Wed Jun 7 17:14:08 2023 +0800 drm/amdgpu: expose num_hops and num_links xgmi info through dev attr Add these two dev attrs for xgmi info details which is helpful for developers checking the xgmi topology by catting the sys file directly. Take 4 cards with xgmi connection as an example, get the num_hops for each device or node through xmig_hive_info dir like, cat /sys/bus/pci/devices/0000:41:00.0/xgmi_hive_info/node1/num_hops will return "00 41 41 41" where "00" stands for the hops to node1 itself and "41" is the hops in hex format to every other node in the same hive. There are node1/node2/node3/node4 representing 4 cards in the hive. The same for num_links dev attr. Signed-off-by: Shiwu Zhang Acked-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 188d3f80fc6d8451ab5e570becd6a7b2d3033023 Author: Sonny Jiang Date: Tue Jun 6 17:18:52 2023 -0400 drm/amdgpu: vcn_4_0 set instance 0 init sched score to 1 Only vcn0 can process AV1 codecx. In order to use both vcn0 and vcn1 in h264/265 transcode to AV1 cases, set vcn0 sched score to 1 at initialization time. Signed-off-by: Sonny Jiang Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit c069dbbcba7319c514536820f2782a0af3361811 Author: Thomas Zimmermann Date: Fri Jun 9 16:03:56 2023 +0200 drm/radeon: Disable outputs when releasing fbdev client Disable the modesetting pipeline before release the radeon's fbdev client. Fixes the following error: [ 17.217408] WARNING: CPU: 5 PID: 1464 at drivers/gpu/drm/ttm/ttm_bo.c:326 ttm_bo_release+0x27e/0x2d0 [ttm] [ 17.217418] Modules linked in: edac_mce_amd radeon(+) drm_ttm_helper ttm video drm_suballoc_helper drm_display_helper kvm irqbypass drm_kms_helper syscopyarea crc32_pclmul sysfillrect sha512_ssse3 sysimgblt sha512_generic cfbfillrect cfbimgblt wmi_bmof aesni_intel cfbcopyarea crypto_simd cryptd k10temp acpi_cpufreq wmi dm_mod [ 17.217432] CPU: 5 PID: 1464 Comm: systemd-udevd Not tainted 6.4.0-rc4+ #1 [ 17.217436] Hardware name: Micro-Star International Co., Ltd. MS-7A38/B450M PRO-VDH MAX (MS-7A38), BIOS B.G0 07/26/2022 [ 17.217438] RIP: 0010:ttm_bo_release+0x27e/0x2d0 [ttm] [ 17.217444] Code: 48 89 43 38 48 89 43 40 48 8b 5c 24 30 48 8b b5 40 08 00 00 48 8b 6c 24 38 48 83 c4 58 e9 7a 49 f7 e0 48 89 ef e9 6c fe ff ff <0f> 0b 48 83 7b 20 00 0f 84 b7 fd ff ff 0f 0b 0f 1f 00 e9 ad fd ff [ 17.217448] RSP: 0018:ffffc9000095fbb0 EFLAGS: 00010202 [ 17.217451] RAX: 0000000000000001 RBX: ffff8881052c8de0 RCX: 0000000000000000 [ 17.217453] RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff8881052c8de0 [ 17.217455] RBP: ffff888104a66e00 R08: ffff8881052c8de0 R09: ffff888104a7cf08 [ 17.217457] R10: ffffc9000095fbe0 R11: ffffc9000095fbe8 R12: ffff8881052c8c78 [ 17.217458] R13: ffff8881052c8c78 R14: dead000000000100 R15: ffff88810528b108 [ 17.217460] FS: 00007f319fcbb8c0(0000) GS:ffff88881a540000(0000) knlGS:0000000000000000 [ 17.217463] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 17.217464] CR2: 000055dc8b0224a0 CR3: 000000010373d000 CR4: 0000000000750ee0 [ 17.217466] PKRU: 55555554 [ 17.217468] Call Trace: [ 17.217470] [ 17.217472] ? __warn+0x97/0x160 [ 17.217476] ? ttm_bo_release+0x27e/0x2d0 [ttm] [ 17.217481] ? report_bug+0x1ec/0x200 [ 17.217487] ? handle_bug+0x3c/0x70 [ 17.217490] ? exc_invalid_op+0x1f/0x90 [ 17.217493] ? preempt_count_sub+0xb5/0x100 [ 17.217496] ? asm_exc_invalid_op+0x16/0x20 [ 17.217500] ? ttm_bo_release+0x27e/0x2d0 [ttm] [ 17.217505] ? ttm_resource_move_to_lru_tail+0x1ab/0x1d0 [ttm] [ 17.217511] radeon_bo_unref+0x1a/0x30 [radeon] [ 17.217547] radeon_gem_object_free+0x20/0x30 [radeon] [ 17.217579] radeon_fbdev_fb_destroy+0x57/0x90 [radeon] [ 17.217616] unregister_framebuffer+0x72/0x110 [ 17.217620] drm_client_dev_unregister+0x6d/0xe0 [ 17.217623] drm_dev_unregister+0x2e/0x90 [ 17.217626] drm_put_dev+0x26/0x90 [ 17.217628] pci_device_remove+0x44/0xc0 [ 17.217631] really_probe+0x257/0x340 [ 17.217635] __driver_probe_device+0x73/0x120 [ 17.217638] driver_probe_device+0x2c/0xb0 [ 17.217641] __driver_attach+0xa0/0x150 [ 17.217643] ? __pfx___driver_attach+0x10/0x10 [ 17.217646] bus_for_each_dev+0x67/0xa0 [ 17.217649] bus_add_driver+0x10e/0x210 [ 17.217651] driver_register+0x5c/0x120 [ 17.217653] ? __pfx_radeon_module_init+0x10/0x10 [radeon] [ 17.217681] do_one_initcall+0x44/0x220 [ 17.217684] ? kmalloc_trace+0x37/0xc0 [ 17.217688] do_init_module+0x64/0x240 [ 17.217691] __do_sys_finit_module+0xb2/0x100 [ 17.217694] do_syscall_64+0x3b/0x90 [ 17.217697] entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 17.217700] RIP: 0033:0x7f319feaa5a9 [ 17.217702] Code: 08 89 e8 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 27 08 0d 00 f7 d8 64 89 01 48 [ 17.217706] RSP: 002b:00007ffc6bf3e7f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 17.217709] RAX: ffffffffffffffda RBX: 00005607204f3170 RCX: 00007f319feaa5a9 [ 17.217710] RDX: 0000000000000000 RSI: 00007f31a002eefd RDI: 0000000000000018 [ 17.217712] RBP: 00007f31a002eefd R08: 0000000000000000 R09: 00005607204f1860 [ 17.217714] R10: 0000000000000018 R11: 0000000000000246 R12: 0000000000020000 [ 17.217716] R13: 0000000000000000 R14: 0000560720522450 R15: 0000560720255899 [ 17.217718] [ 17.217719] ---[ end trace 0000000000000000 ]--- The buffer object backing the fbdev emulation got pinned twice: by the fb_probe helper radeon_fbdev_create_pinned_object() and the modesetting code when the framebuffer got displayed. It only got unpinned once by the fbdev helper radeon_fbdev_destroy_pinned_object(). Hence TTM's BO- release function complains about the pin counter. Forcing the outputs off also undoes the modesettings pin increment. Tested-by: Borislav Petkov (AMD) Reported-by: Borislav Petkov Closes: https://lore.kernel.org/dri-devel/20230603174814.GCZHt83pN+wNjf63sC@fat_crate.local/ Signed-off-by: Thomas Zimmermann Fixes: e317a69fe891 ("drm/radeon: Implement client-based fbdev emulation") Cc: Alex Deucher Cc: Thomas Zimmermann Cc: "Christian König" Cc: "Pan, Xinhui" Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit 8020f0f9316b6961fe384031b4780e764eeb9652 Author: Hamza Mahfooz Date: Fri Jun 9 11:31:04 2023 -0400 drm/amd/amdgpu: enable W=1 for amdgpu We have a clean build with W=1 as of commit c168feed5d03 ("drm/amd/display/amdgpu_dm/amdgpu_dm_helpers: Move SYNAPTICS_DEVICE_ID into CONFIG_DRM_AMD_DC_DCN ifdef"). So, let's enable these checks unconditionally for the entire module to catch these errors during development. Cc: Alex Deucher Cc: Nathan Chancellor Tested-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit e06da81749716ee3f0404fada97882609921d98f Author: Srinivasan Shanmugam Date: Fri Jun 9 20:35:29 2023 +0530 drm/amdgpu: Fix kdoc warning Fixes the following gcc with W=1: drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c:76: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * EEPROM Table structure v1 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c:98: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * EEPROM Table structrue v2.1 Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 17fbdbda9cc87ff5a013898de506212d25323ed7 Author: Daniel Miess Date: Fri May 19 13:02:01 2023 -0400 drm/amd/display: Enable dcn314 DPP RCO [Why and How] Add back debug bits enabling RCO for dcn314 as underflow associated with this change has been resolved Acked-by: Stylon Wang Signed-off-by: Daniel Miess Reviewed-by: Jun Lei Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 41ce6d6d03d5e51420ea7732c83facc8a7f2e5da Author: Mukul Joshi Date: Tue May 23 11:55:54 2023 -0400 drm/amdgpu: Rename DRM schedulers in amdgpu TTM Rename mman.entity to mman.high_pr to make the distinction clearer that this is a high priority scheduler. Similarly, rename the recently added mman.delayed to mman.low_pr to make it clear it is a low priority scheduler. No functional change in this patch. Signed-off-by: Mukul Joshi Reviewed-by: Christian König Signed-off-by: Alex Deucher commit c168feed5d0341b35b2f6a744f088e7625cfc1aa Author: Lee Jones Date: Fri Jun 9 09:17:14 2023 +0100 drm/amd/display/amdgpu_dm/amdgpu_dm_helpers: Move SYNAPTICS_DEVICE_ID into CONFIG_DRM_AMD_DC_DCN ifdef Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:48:22: warning: ‘SYNAPTICS_DEVICE_ID’ defined but not used [-Wunused-const-variable=] Cc: Harry Wentland Cc: Leo Li Cc: Rodrigo Siqueira Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Reviewed-by: Harry Wentland Signed-off-by: Lee Jones Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 30f90f3c1c2c63c2fa44f61233737d27b72637c2 Author: Nicholas Kazlauskas Date: Fri Apr 28 11:23:50 2023 -0400 drm/amd/display: Skip DPP DTO update if root clock is gated [Why] Hardware implements root clock gating by utilizing the DPP DTO registers with a special case of DTO enabled, phase = 0, modulo = 1. This conflicts with our policy to always update the DPPDTO for cases where it's expected to be disabled. The pipes unexpectedly enter a higher power state than expected because of this programming flow. [How] Guard the upper layers of HWSS against this hardware quirk with programming the register with an internal state flag in DCCG. While technically acting as global state for the DCCG, HWSS shouldn't be expected to understand the hardware quirk for having DTO disabled causing more power than DTO enabled with this specific setting. This also prevents sequencing errors from occuring in the future if we have to program DPP DTO in multiple locations. Acked-by: Stylon Wang Signed-off-by: Nicholas Kazlauskas Reviewed-by: Jun Lei Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b6ca07fa9a19a2fc067eccd6bf1250c51061b436 Author: Rasmus Villemoes Date: Wed Jun 14 22:10:56 2023 +0200 dt-bindings: eeprom: at25: add st,m95640 compatible The st,m95640 is a 64 Kbit SPI eeprom in the same family as the two existing st,m95* compatibles. Signed-off-by: Rasmus Villemoes Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230614201056.379080-1-linux@rasmusvillemoes.dk Signed-off-by: Rob Herring commit 177f76ce42f7bdcaf1e2f22595f432a808224111 Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:25 2023 +0200 dt-bindings: leds: Drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230609140725.64771-1-krzysztof.kozlowski@linaro.org Signed-off-by: Lee Jones commit f1fb98090bfcd2b7403807257220156a3b68737f Author: Lukas Bulwahn Date: Fri Jun 9 12:02:33 2023 +0200 leds: Fix config reference for AW200xx driver Commit 36a87f371b7a ("leds: Add AW20xx driver") adds config LEDS_AW200XX in drivers/leds/Kconfig, but then in drivers/leds/Makefile accidently refers to CONFIG_LEDS_W200XX; note the missing A! This typo makes it impossible to add the driver to a kernel build. Fix this wrong config reference. Fixes: 36a87f371b7a ("leds: Add AW20xx driver") Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20230609100233.4111-1-lukas.bulwahn@gmail.com Signed-off-by: Lee Jones commit 7c81582c0bccb4757186176f0ee12834597066ad Author: Amelie Delaunay Date: Fri Jun 9 11:28:04 2023 +0200 mfd: stmfx: Nullify stmfx->vdd in case of error Nullify stmfx->vdd in case devm_regulator_get_optional() returns an error. And simplify code by returning an error only if return code is not -ENODEV, which means there is no vdd regulator and it is not an issue. Fixes: d75846ed08e6 ("mfd: stmfx: Fix dev_err_probe() call in stmfx_chip_init()") Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20230609092804.793100-2-amelie.delaunay@foss.st.com Signed-off-by: Lee Jones commit f592cf624531286f8b52e40dcfc157a5a7fb115c Author: Amelie Delaunay Date: Fri Jun 9 11:28:03 2023 +0200 mfd: stmfx: Fix error path in stmfx_chip_init In error path, disable vdd regulator if it exists, but don't overload ret. Because if regulator_disable() is successful, stmfx_chip_init will exit successfully while chip init failed. Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver") Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20230609092804.793100-1-amelie.delaunay@foss.st.com Signed-off-by: Lee Jones commit f0854489fc07d2456f7cc71a63f4faf9c716ffbe Author: Mingzhe Zou Date: Thu Jun 15 20:12:23 2023 +0800 bcache: fixup btree_cache_wait list damage We get a kernel crash about "list_add corruption. next->prev should be prev (ffff9c801bc01210), but was ffff9c77b688237c. (next=ffffae586d8afe68)." crash> struct list_head 0xffff9c801bc01210 struct list_head { next = 0xffffae586d8afe68, prev = 0xffffae586d8afe68 } crash> struct list_head 0xffff9c77b688237c struct list_head { next = 0x0, prev = 0x0 } crash> struct list_head 0xffffae586d8afe68 struct list_head struct: invalid kernel virtual address: ffffae586d8afe68 type: "gdb_readmem_callback" Cannot access memory at address 0xffffae586d8afe68 [230469.019492] Call Trace: [230469.032041] prepare_to_wait+0x8a/0xb0 [230469.044363] ? bch_btree_keys_free+0x6c/0xc0 [escache] [230469.056533] mca_cannibalize_lock+0x72/0x90 [escache] [230469.068788] mca_alloc+0x2ae/0x450 [escache] [230469.080790] bch_btree_node_get+0x136/0x2d0 [escache] [230469.092681] bch_btree_check_thread+0x1e1/0x260 [escache] [230469.104382] ? finish_wait+0x80/0x80 [230469.115884] ? bch_btree_check_recurse+0x1a0/0x1a0 [escache] [230469.127259] kthread+0x112/0x130 [230469.138448] ? kthread_flush_work_fn+0x10/0x10 [230469.149477] ret_from_fork+0x35/0x40 bch_btree_check_thread() and bch_dirty_init_thread() may call mca_cannibalize() to cannibalize other cached btree nodes. Only one thread can do it at a time, so the op of other threads will be added to the btree_cache_wait list. We must call finish_wait() to remove op from btree_cache_wait before free it's memory address. Otherwise, the list will be damaged. Also should call bch_cannibalize_unlock() to release the btree_cache_alloc_lock and wake_up other waiters. Fixes: 8e7102273f59 ("bcache: make bch_btree_check() to be multithreaded") Fixes: b144e45fc576 ("bcache: make bch_sectors_dirty_init() to be multithreaded") Cc: stable@vger.kernel.org Signed-off-by: Mingzhe Zou Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20230615121223.22502-7-colyli@suse.de Signed-off-by: Jens Axboe commit 80fca8a10b604afad6c14213fdfd816c4eda3ee4 Author: Zheng Wang Date: Thu Jun 15 20:12:22 2023 +0800 bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent In some specific situations, the return value of __bch_btree_node_alloc may be NULL. This may lead to a potential NULL pointer dereference in caller function like a calling chain : btree_split->bch_btree_node_alloc->__bch_btree_node_alloc. Fix it by initializing the return value in __bch_btree_node_alloc. Fixes: cafe56359144 ("bcache: A block layer cache") Cc: stable@vger.kernel.org Signed-off-by: Zheng Wang Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20230615121223.22502-6-colyli@suse.de Signed-off-by: Jens Axboe commit 028ddcac477b691dd9205c92f991cc15259d033e Author: Zheng Wang Date: Thu Jun 15 20:12:21 2023 +0800 bcache: Remove unnecessary NULL point check in node allocations Due to the previous fix of __bch_btree_node_alloc, the return value will never be a NULL pointer. So IS_ERR is enough to handle the failure situation. Fix it by replacing IS_ERR_OR_NULL check by an IS_ERR check. Fixes: cafe56359144 ("bcache: A block layer cache") Cc: stable@vger.kernel.org Signed-off-by: Zheng Wang Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20230615121223.22502-5-colyli@suse.de Signed-off-by: Jens Axboe commit ccb8c3bd6d93e7986b702d1f66d5d56d08abc59f Author: Andrea Tomassetti Date: Thu Jun 15 20:12:20 2023 +0800 bcache: Remove dead references to cache_readaheads The cache_readaheads stat counter is not used anymore and should be removed. Signed-off-by: Andrea Tomassetti Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20230615121223.22502-4-colyli@suse.de Signed-off-by: Jens Axboe commit b98dd0b0a596fdeaca68396ce8f782883ed253a9 Author: Thomas Weißschuh Date: Thu Jun 15 20:12:19 2023 +0800 bcache: make kobj_type structures constant Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definitions to prevent modification at runtime. Signed-off-by: Thomas Weißschuh Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20230615121223.22502-3-colyli@suse.de Signed-off-by: Jens Axboe commit a301b2deb66cd93bae0f676702356273ebf8abb6 Author: ye xingchen Date: Thu Jun 15 20:12:18 2023 +0800 bcache: Convert to use sysfs_emit()/sysfs_emit_at() APIs Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: ye xingchen Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20230615121223.22502-2-colyli@suse.de Signed-off-by: Jens Axboe commit e1e315c4d5282c1713ab08acec2ac17b8dbd6591 Merge: 89a734b54c1d9 8c15c2a028108 Author: Oliver Upton Date: Thu Jun 15 13:09:21 2023 +0000 Merge branch kvm-arm64/misc into kvmarm/next * kvm-arm64/misc: : Miscellaneous updates : : - Avoid trapping CTR_EL0 on systems with FEAT_EVT, as the register is : commonly read by userspace : : - Make use of FEAT_BTI at hyp stage-1, setting the Guard Page bit to 1 : for executable mappings : : - Use a separate set of pointer authentication keys for the hypervisor : when running in protected mode (i.e. pKVM) : : - Plug a few holes in timer initialization where KVM fails to free the : timer IRQ(s) KVM: arm64: Use different pointer authentication keys for pKVM KVM: arm64: timers: Fix resource leaks in kvm_timer_hyp_init() KVM: arm64: Use BTI for nvhe KVM: arm64: Relax trapping of CTR_EL0 when FEAT_EVT is available Signed-off-by: Oliver Upton commit ae6a2c44052fd59db7daf63eabed9e16be783cbc Merge: 16f2e6c01f1b1 3c40eb8145325 Author: Ulf Hansson Date: Thu Jun 15 15:06:53 2023 +0200 mmc: Merge branch fixes into next Merge the mmc fixes for v6.4-rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.5. Signed-off-by: Ulf Hansson commit 16f2e6c01f1b1d641c92c0dcb469fe0f78b12878 Author: Yann Gautier Date: Tue Jun 13 17:01:48 2023 +0200 mmc: mmci: stm32: set feedback clock when using delay block The feedback clock is used only for SDR104 & HS200 modes, and when delay block is used (frequency is higher than 50 MHz). The tuning procedure is then only required for those modes. Skip the procedure for other modes. The setting of this feedback clock is done just after enabling delay block, and before configuring it. Signed-off-by: Yann Gautier Signed-off-by: Christophe Kerello Link: https://lore.kernel.org/r/20230613150148.429828-1-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit 89a734b54c1d9dd0574079ea373cdecf87438bc8 Merge: acfdf34c7de19 686672407e6ea Author: Oliver Upton Date: Thu Jun 15 13:05:11 2023 +0000 Merge branch kvm-arm64/configurable-id-regs into kvmarm/next * kvm-arm64/configurable-id-regs: : Configurable ID register infrastructure, courtesy of Jing Zhang : : Create generalized infrastructure for allowing userspace to select the : supported feature set for a VM, so long as the feature set is a subset : of what hardware + KVM allows. This does not add any new features that : are user-configurable, and instead focuses on the necessary refactoring : to enable future work. : : As a consequence of the series, feature asymmetry is now deliberately : disallowed for KVM. It is unlikely that VMMs ever configured VMs with : asymmetry, nor does it align with the kernel's overall stance that : features must be uniform across all cores in the system. : : Furthermore, KVM incorrectly advertised an IMP_DEF PMU to guests for : some time. Migrations from affected kernels was supported by explicitly : allowing such an ID register value from userspace, and forwarding that : along to the guest. KVM now allows an IMP_DEF PMU version to be restored : through the ID register interface, but reinterprets the user value as : not implemented (0). KVM: arm64: Rip out the vestiges of the 'old' ID register scheme KVM: arm64: Handle ID register reads using the VM-wide values KVM: arm64: Use generic sanitisation for ID_AA64PFR0_EL1 KVM: arm64: Use generic sanitisation for ID_(AA64)DFR0_EL1 KVM: arm64: Use arm64_ftr_bits to sanitise ID register writes KVM: arm64: Save ID registers' sanitized value per guest KVM: arm64: Reuse fields of sys_reg_desc for idreg KVM: arm64: Rewrite IMPDEF PMU version as NI KVM: arm64: Make vCPU feature flags consistent VM-wide KVM: arm64: Relax invariance of KVM_ARM_VCPU_POWER_OFF KVM: arm64: Separate out feature sanitisation and initialisation Signed-off-by: Oliver Upton commit acfdf34c7de19e1ee9ce3ea2d47e2bf11620f910 Merge: b710fe0d30dd0 3e35d303ab7d2 Author: Oliver Upton Date: Thu Jun 15 13:04:10 2023 +0000 Merge branch for-next/module-alloc into kvmarm/next * for-next/module-alloc: : Drag in module VA rework to handle conflicts w/ sw feature refactor arm64: module: rework module VA range selection arm64: module: mandate MODULE_PLTS arm64: module: move module randomization to module.c arm64: kaslr: split kaslr/module initialization arm64: kasan: remove !KASAN_VMALLOC remnants arm64: module: remove old !KASAN_VMALLOC logic Signed-off-by: Oliver Upton commit b710fe0d30dd0ad0402ab4936a5ab16b87987e70 Merge: 1a08f4927a80c 1700f89cb99aa Author: Oliver Upton Date: Thu Jun 15 13:02:49 2023 +0000 Merge branch kvm-arm64/hvhe into kvmarm/next * kvm-arm64/hvhe: : Support for running split-hypervisor w/VHE, courtesy of Marc Zyngier : : From the cover letter: : : KVM (on ARMv8.0) and pKVM (on all revisions of the architecture) use : the split hypervisor model that makes the EL2 code more or less : standalone. In the later case, we totally ignore the VHE mode and : stick with the good old v8.0 EL2 setup. : : We introduce a new "mode" for KVM called hVHE, in reference to the : nVHE mode, and indicating that only the hypervisor is using VHE. KVM: arm64: Fix hVHE init on CPUs where HCR_EL2.E2H is not RES1 arm64: Allow arm64_sw.hvhe on command line KVM: arm64: Force HCR_E2H in guest context when ARM64_KVM_HVHE is set KVM: arm64: Program the timer traps with VHE layout in hVHE mode KVM: arm64: Rework CPTR_EL2 programming for HVHE configuration KVM: arm64: Adjust EL2 stage-1 leaf AP bits when ARM64_KVM_HVHE is set KVM: arm64: Disable TTBR1_EL2 when using ARM64_KVM_HVHE KVM: arm64: Force HCR_EL2.E2H when ARM64_KVM_HVHE is set KVM: arm64: Key use of VHE instructions in nVHE code off ARM64_KVM_HVHE KVM: arm64: Remove alternatives from sysreg accessors in VHE hypervisor context arm64: Use CPACR_EL1 format to set CPTR_EL2 when E2H is set arm64: Allow EL1 physical timer access when running VHE arm64: Don't enable VHE for the kernel if OVERRIDE_HVHE is set arm64: Add KVM_HVHE capability and has_hvhe() predicate arm64: Turn kaslr_feature_override into a generic SW feature override arm64: Prevent the use of is_kernel_in_hyp_mode() in hypervisor code KVM: arm64: Drop is_kernel_in_hyp_mode() from __invalidate_icache_guest_page() Signed-off-by: Oliver Upton commit 1a08f4927a80ca19baa50f0a4d84f4c40d8979d3 Merge: 83510396c0765 0a9f15fd56742 Author: Oliver Upton Date: Thu Jun 15 13:02:37 2023 +0000 Merge branch kvm-arm64/ffa-proxy into kvmarm/next * kvm-arm64/ffa-proxy: : pKVM FF-A Proxy, courtesy Will Deacon and Andrew Walbran : : From the cover letter: : : pKVM's primary goal is to protect guest pages from a compromised host by : enforcing access control restrictions using stage-2 page-tables. Sadly, : this cannot prevent TrustZone from accessing non-secure memory, and a : compromised host could, for example, perform a 'confused deputy' attack : by asking TrustZone to use pages that have been donated to protected : guests. This would effectively allow the host to have TrustZone : exfiltrate guest secrets on its behalf, hence breaking the isolation : that pKVM intends to provide. : : This series addresses this problem by providing pKVM with the ability to : monitor SMCs following the Arm FF-A protocol. FF-A provides (among other : things) a set of memory management APIs allowing the Normal World to : share, donate or lend pages with Secure. By monitoring these SMCs, pKVM : can ensure that the pages that are shared, lent or donated to Secure by : the host kernel are only pages that it owns. KVM: arm64: pkvm: Add support for fragmented FF-A descriptors KVM: arm64: Handle FFA_FEATURES call from the host KVM: arm64: Handle FFA_MEM_LEND calls from the host KVM: arm64: Handle FFA_MEM_RECLAIM calls from the host KVM: arm64: Handle FFA_MEM_SHARE calls from the host KVM: arm64: Add FF-A helpers to share/unshare memory with secure world KVM: arm64: Handle FFA_RXTX_MAP and FFA_RXTX_UNMAP calls from the host KVM: arm64: Allocate pages for hypervisor FF-A mailboxes KVM: arm64: Probe FF-A version and host/hyp partition ID during init KVM: arm64: Block unsafe FF-A calls from the host Signed-off-by: Oliver Upton commit 83510396c0765cc15454eaf445fb98bad773634e Merge: 44c026a73be80 14c3555f055dd Author: Oliver Upton Date: Thu Jun 15 13:02:11 2023 +0000 Merge branch kvm-arm64/eager-page-splitting into kvmarm/next * kvm-arm64/eager-page-splitting: : Eager Page Splitting, courtesy of Ricardo Koller. : : Dirty logging performance is dominated by the cost of splitting : hugepages to PTE granularity. On systems that mere mortals can get their : hands on, each fault incurs the cost of a full break-before-make : pattern, wherein the broadcast invalidation and ensuing serialization : significantly increases fault latency. : : The goal of eager page splitting is to move the cost of hugepage : splitting out of the stage-2 fault path and instead into the ioctls : responsible for managing the dirty log: : : - If manual protection is enabled for the VM, hugepage splitting : happens in the KVM_CLEAR_DIRTY_LOG ioctl. This is desirable as it : provides userspace granular control over hugepage splitting. : : - Otherwise, if userspace relies on the legacy dirty log behavior : (clear on collection), hugepage splitting is done at the moment dirty : logging is enabled for a particular memslot. : : Support for eager page splitting requires explicit opt-in from : userspace, which is realized through the : KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE capability. arm64: kvm: avoid overflow in integer division KVM: arm64: Use local TLBI on permission relaxation KVM: arm64: Split huge pages during KVM_CLEAR_DIRTY_LOG KVM: arm64: Open-code kvm_mmu_write_protect_pt_masked() KVM: arm64: Split huge pages when dirty logging is enabled KVM: arm64: Add kvm_uninit_stage2_mmu() KVM: arm64: Refactor kvm_arch_commit_memory_region() KVM: arm64: Add kvm_pgtable_stage2_split() KVM: arm64: Add KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE KVM: arm64: Export kvm_are_all_memslots_empty() KVM: arm64: Add helper for creating unlinked stage2 subtrees KVM: arm64: Add KVM_PGTABLE_WALK flags for skipping CMOs and BBM TLBIs KVM: arm64: Rename free_removed to free_unlinked Signed-off-by: Oliver Upton commit 686672407e6eaf8c874d4a6bf315da798f281045 Author: Oliver Upton Date: Fri Jun 9 19:00:54 2023 +0000 KVM: arm64: Rip out the vestiges of the 'old' ID register scheme There's no longer a need for the baggage of the old scheme for handling configurable ID register fields. Rip it all out in favor of the generalized infrastructure. Link: https://lore.kernel.org/r/20230609190054.1542113-12-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 6db7af0d5b2b6073caf6a7f3364d8dd2005584d4 Author: Oliver Upton Date: Fri Jun 9 19:00:53 2023 +0000 KVM: arm64: Handle ID register reads using the VM-wide values Everything is in place now to use the generic ID register infrastructure. Use the VM-wide values to service ID register reads. The ID registers are invariant after the VM has started, so there is no need for locking in that case. This is rather desirable for VM live migration, as the needless lock contention could prolong the VM blackout period. Link: https://lore.kernel.org/r/20230609190054.1542113-11-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit c39f5974d38f7250782c2fe52b2793cd00efaac0 Author: Jing Zhang Date: Fri Jun 9 19:00:52 2023 +0000 KVM: arm64: Use generic sanitisation for ID_AA64PFR0_EL1 KVM allows userspace to write to the CSV2 and CSV3 fields of ID_AA64PFR0_EL1 so long as it doesn't over-promise on the Spectre/Meltdown mitigation state. Switch over to the new way of the world for screening user writes. Leave the old plumbing in place until we actually start handling ID register reads from the VM-wide values. Signed-off-by: Jing Zhang Link: https://lore.kernel.org/r/20230609190054.1542113-10-oliver.upton@linux.dev [Oliver: split from monster patch, added commit description] Signed-off-by: Oliver Upton commit c118cead07a762592c9e67252064616efa4574fa Author: Jing Zhang Date: Fri Jun 9 19:00:51 2023 +0000 KVM: arm64: Use generic sanitisation for ID_(AA64)DFR0_EL1 KVM allows userspace to specify a PMU version for the guest by writing to the corresponding ID registers. Currently the validation of these writes is done manuallly, but there's no reason we can't switch over to the generic sanitisation infrastructure. Start screening user writes through arm64_check_features() to prevent userspace from over-promising in terms of vPMU support. Leave the old masking in place for now, as we aren't completely ready to serve reads from the VM-wide values. Signed-off-by: Jing Zhang Link: https://lore.kernel.org/r/20230609190054.1542113-9-oliver.upton@linux.dev [Oliver: split off from monster patch, cleaned up handling of NI vPMU values, wrote commit description] Signed-off-by: Oliver Upton commit 2e8bf0cbd0589bae3a0466a3ed45f9cf9f3164eb Author: Jing Zhang Date: Fri Jun 9 19:00:50 2023 +0000 KVM: arm64: Use arm64_ftr_bits to sanitise ID register writes Rather than reinventing the wheel in KVM to do ID register sanitisation we can rely on the work already done in the core kernel. Implement a generalized sanitisation of ID registers based on the combination of the arm64_ftr_bits definitions from the core kernel and (optionally) a set of KVM-specific overrides. This all amounts to absolutely nothing for now, but will be used in subsequent changes to realize user-configurable ID registers. Signed-off-by: Jing Zhang Link: https://lore.kernel.org/r/20230609190054.1542113-8-oliver.upton@linux.dev [Oliver: split off from monster patch, rewrote commit description, reworked RAZ handling, return EINVAL to userspace] Signed-off-by: Oliver Upton commit 2d8c9dcf7158060fcec9f891c0292ffdb4397523 Author: Wen Yang Date: Thu Jun 15 02:40:28 2023 +0800 eventfd: add a uapi header for eventfd userspace APIs Create a uapi header include/uapi/linux/eventfd.h, move the associated flags to the uapi header, and include it from linux/eventfd.h. Suggested-by: Christian Brauner Signed-off-by: Wen Yang Reviewed-by: Matthew Wilcox (Oracle) Cc: Alexander Viro Cc: Jens Axboe Cc: Christian Brauner Cc: Christoph Hellwig Cc: Dylan Yudaken Cc: David Woodhouse Cc: Matthew Wilcox Cc: Eric Biggers Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Message-Id: Signed-off-by: Christian Brauner commit 473341469042b39535ee800a19c45110ebc46346 Author: Jing Zhang Date: Fri Jun 9 19:00:49 2023 +0000 KVM: arm64: Save ID registers' sanitized value per guest Initialize the default ID register values upon the first call to KVM_ARM_VCPU_INIT. The vCPU feature flags are finalized at that point, so it is possible to determine the maximum feature set supported by a particular VM configuration. Do nothing with these values for now, as we need to rework the plumbing of what's already writable to be compatible with the generic infrastructure. Co-developed-by: Reiji Watanabe Signed-off-by: Reiji Watanabe Signed-off-by: Jing Zhang Link: https://lore.kernel.org/r/20230609190054.1542113-7-oliver.upton@linux.dev [Oliver: Hoist everything into KVM_ARM_VCPU_INIT time, so the features are final] Signed-off-by: Oliver Upton commit fadccca8f33959857948e279045a3757b5f21d55 Author: Yingkun Meng Date: Wed Jun 14 20:26:59 2023 +0800 ASoC: dt-bindings: Add support for Loongson audio card The audio card uses loongson I2S controller present in 7axxx/2kxxx chips to transfer audio data. On loongson platform, the chip has only one I2S controller. Signed-off-by: Yingkun Meng Link: https://lore.kernel.org/r/20230614122659.3402788-1-mengyingkun@loongson.cn Signed-off-by: Mark Brown commit d24028606e7642261d33ad2a50aed940d35cfb66 Author: Yingkun Meng Date: Wed Jun 14 20:22:40 2023 +0800 ASoC: loongson: Add Loongson ASoC Sound Card Support The Loongson ASoC Sound Card is a general ASoC DAI Link driver that can be used for Loongson CPU DAI drivers and external CODECs. The driver supports the use of ACPI table to describe device resources. On loongson 7axxx platforms, the audio device is an ACPI device. Signed-off-by: Yingkun Meng Link: https://lore.kernel.org/r/20230614122240.3402762-1-mengyingkun@loongson.cn Signed-off-by: Mark Brown commit 6a8e1d46f0621c15d2993c5e847f4f264102f93d Author: Ryan Lee Date: Mon Jun 12 23:09:45 2023 -0700 ASoC: max98388: add amplifier driver Added Analog Devices MAX98388 amplifier driver. MAX98388 provides a PCM interface for audio data and a standard I2C interface for control data communication. Signed-off-by: Ryan Lee Link: https://lore.kernel.org/r/20230613060945.183128-2-ryan.lee.analog@gmail.com Signed-off-by: Mark Brown commit 4cab2d5faf7eff9896a15be3b301150b6fbfcaba Author: Ryan Lee Date: Mon Jun 12 23:09:44 2023 -0700 ASoC: dt-bindings: max98388: add amplifier driver Add dt-bindings information for Analog Devices MAX98388 I2S Amplifier Signed-off-by: Ryan Lee Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230613060945.183128-1-ryan.lee.analog@gmail.com Signed-off-by: Mark Brown commit d84881e06836dc1655777a592b4279be76ad7324 Author: Yingkun Meng Date: Thu Jun 15 20:27:18 2023 +0800 ASoC: Add support for Loongson I2S controller Loongson I2S controller is found on 7axxx/2kxxx chips from loongson, it is a PCI device with two private DMA controllers, one for playback, the other for capture. The driver supports the use of DTS or ACPI to describe device resources. Signed-off-by: Yingkun Meng Link: https://lore.kernel.org/r/20230615122718.3412942-1-mengyingkun@loongson.cn Signed-off-by: Mark Brown commit 06f2c60eee2556259ae0d4da0bf9f3b97629a6dc Merge: 45b4ad53d4840 22691a0513777 Author: Mark Brown Date: Thu Jun 15 13:52:12 2023 +0100 ASoC: Use the maple tree register cache for RealTek Merge series from Mark Brown : The RealTek SoundWire CODECs don't support bulk register operations so they gain no advantage from using the rbtree cache, convert them to use the maple tree cache instead - it is more modern. commit 94d6cb68124b7a63f24fcc345795ba5f9a27e694 Author: Masahiro Yamada Date: Mon Jun 12 00:50:51 2023 +0900 modpost: pass struct module pointer to check_section_mismatch() The next commit will use it. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit e8cc334847dbd204ed4f500b3e3fa899b3766b62 Author: Michal Sekletar Date: Tue Jun 13 19:21:08 2023 +0200 selftests: tty: add selftest for tty timestamp updates Add new test case which checks that timestamp updates on actual terminal character device (e.g. /dev/pts/0) happen even if the terminal is accessed via magic /dev/tty file. Signed-off-by: Michal Sekletar Message-ID: <20230613172107.78138-2-msekleta@redhat.com> Signed-off-by: Greg Kroah-Hartman commit 360c11e2258ce4269441a5ab6d43d0b202f4261b Author: Michal Sekletar Date: Tue Jun 13 19:21:06 2023 +0200 tty: tty_io: update timestamps on all device nodes User space applications watch for timestamp changes on character device files in order to determine idle time of a given terminal session. For example, "w" program uses this information to populate the IDLE column of its output [1]. Similarly, systemd-logind has optional feature where it uses atime of the tty character device to determine if there was activity on the terminal associated with the logind's session object. If there was no activity for a configured period of time then logind will terminate such session [2]. Now, usually (e.g. bash running on the terminal) the use of the terminal will update timestamps (atime and mtime) on the corresponding terminal character device. However, if access to the terminal, e.g. /dev/pts/0, is performed through magic character device /dev/tty then such access obviously changes the state of the terminal, however timestamps on the device that correspond to the terminal (/dev/pts/0) are not updated. This patch makes sure that we update timestamps on *all* character devices that correspond to the given tty, because outside observers (w, systemd-logind) are maybe checking these timestamps. Obviously, they can not check timestamps on /dev/tty as that has per-process meaning. [1] https://gitlab.com/procps-ng/procps/-/blob/v4.0.0/w.c#L286 [2] https://github.com/systemd/systemd/blob/v252/NEWS#L477 Signed-off-by: Michal Sekletar Message-ID: <20230613172107.78138-1-msekleta@redhat.com> Signed-off-by: Greg Kroah-Hartman commit 74a81c4854a8cda61efabcb18ea1ba5b1ae7f768 Author: Uwe Kleine-König Date: Mon Jun 5 11:20:47 2023 +0200 char: xilinx_hwicap: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Michal Simek Message-ID: <20230605092047.50472-3-u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman commit 3d82dca0f27ac5a0bfbbce439bba5c6452f3b7da Author: Uwe Kleine-König Date: Mon Jun 5 11:20:46 2023 +0200 char: xilinx_hwicap: Drop if block with always false condition hwicap_drv_remove() is only called for a device after hwicap_drv_probe() returned 0. In that case dev_set_drvdata() was called (by hwicap_setup()) with a non-NULL value and so dev_get_drvdata() won't return NULL. Signed-off-by: Uwe Kleine-König Acked-by: Michal Simek Message-ID: <20230605092047.50472-2-u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman commit e8989a48ca5111122b73fe905baf07ea29f1c197 Author: Uwe Kleine-König Date: Mon Jun 5 11:20:45 2023 +0200 char: xilinx_hwicap: Fold hwicap_remove() into only caller hwicap_remove() is only called by hwicap_drv_remove(). Simplify by unrolling the former into the latter function. Signed-off-by: Uwe Kleine-König Acked-by: Michal Simek Message-ID: <20230605092047.50472-1-u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman commit 303c9c63abb9390e906052863f82bb4e9824e5c0 Author: Laurentiu Tudor Date: Tue Jun 13 19:07:18 2023 +0300 bus: fsl-mc: don't assume child devices are all fsl-mc devices Changes in VFIO caused a pseudo-device to be created as child of fsl-mc devices causing a crash [1] when trying to bind a fsl-mc device to VFIO. Fix this by checking the device type when enumerating fsl-mc child devices. [1] Modules linked in: Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP CPU: 6 PID: 1289 Comm: sh Not tainted 6.2.0-rc5-00047-g7c46948a6e9c #2 Hardware name: NXP Layerscape LX2160ARDB (DT) pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : mc_send_command+0x24/0x1f0 lr : dprc_get_obj_region+0xfc/0x1c0 sp : ffff80000a88b900 x29: ffff80000a88b900 x28: ffff48a9429e1400 x27: 00000000000002b2 x26: ffff48a9429e1718 x25: 0000000000000000 x24: 0000000000000000 x23: ffffd59331ba3918 x22: ffffd59331ba3000 x21: 0000000000000000 x20: ffff80000a88b9b8 x19: 0000000000000000 x18: 0000000000000001 x17: 7270642f636d2d6c x16: 73662e3030303030 x15: ffffffffffffffff x14: ffffd59330f1d668 x13: ffff48a8727dc389 x12: ffff48a8727dc386 x11: 0000000000000002 x10: 00008ceaf02f35d4 x9 : 0000000000000012 x8 : 0000000000000000 x7 : 0000000000000006 x6 : ffff80000a88bab0 x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff80000a88b9e8 x2 : ffff80000a88b9e8 x1 : 0000000000000000 x0 : ffff48a945142b80 Call trace: mc_send_command+0x24/0x1f0 dprc_get_obj_region+0xfc/0x1c0 fsl_mc_device_add+0x340/0x590 fsl_mc_obj_device_add+0xd0/0xf8 dprc_scan_objects+0x1c4/0x340 dprc_scan_container+0x38/0x60 vfio_fsl_mc_probe+0x9c/0xf8 fsl_mc_driver_probe+0x24/0x70 really_probe+0xbc/0x2a8 __driver_probe_device+0x78/0xe0 device_driver_attach+0x30/0x68 bind_store+0xa8/0x130 drv_attr_store+0x24/0x38 sysfs_kf_write+0x44/0x60 kernfs_fop_write_iter+0x128/0x1b8 vfs_write+0x334/0x448 ksys_write+0x68/0xf0 __arm64_sys_write+0x1c/0x28 invoke_syscall+0x44/0x108 el0_svc_common.constprop.1+0x94/0xf8 do_el0_svc+0x38/0xb0 el0_svc+0x20/0x50 el0t_64_sync_handler+0x98/0xc0 el0t_64_sync+0x174/0x178 Code: aa0103f4 a9025bf5 d5384100 b9400801 (79401260) ---[ end trace 0000000000000000 ]--- Fixes: 3c28a76124b2 ("vfio: Add struct device to vfio_device") Signed-off-by: Laurentiu Tudor Tested-by: Ioana Ciornei Reviewed-by: Ioana Ciornei Message-ID: <20230613160718.29500-1-laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman commit 0b4e32df3e09406b835d8230b9331273f2805058 Author: Ekansh Gupta Date: Wed Jun 14 17:24:45 2023 +0530 misc: fastrpc: Create fastrpc scalar with correct buffer count A process can spawn a PD on DSP with some attributes that can be associated with the PD during spawn and run. The invocation corresponding to the create request with attributes has total 4 buffers at the DSP side implementation. If this number is not correct, the invocation is expected to fail on DSP. Added change to use correct number of buffer count for creating fastrpc scalar. Fixes: d73f71c7c6ee ("misc: fastrpc: Add support for create remote init process") Cc: stable Tested-by: Ekansh Gupta Signed-off-by: Ekansh Gupta Message-ID: <1686743685-21715-1-git-send-email-quic_ekangupt@quicinc.com> Signed-off-by: Greg Kroah-Hartman commit 1995f15590ca222f91193ed11461862b450abfd6 Author: Christophe JAILLET Date: Tue Jun 13 16:15:21 2023 -0500 firmware: stratix10-svc: Fix a potential resource leak in svc_create_memory_pool() svc_create_memory_pool() is only called from stratix10_svc_drv_probe(). Most of resources in the probe are managed, but not this memremap() call. There is also no memunmap() call in the file. So switch to devm_memremap() to avoid a resource leak. Cc: stable@vger.kernel.org Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver") Link: https://lore.kernel.org/all/783e9dfbba34e28505c9efa8bba41f97fd0fa1dc.1686109400.git.christophe.jaillet@wanadoo.fr/ Signed-off-by: Christophe JAILLET Signed-off-by: Dinh Nguyen Message-ID: <20230613211521.16366-1-dinguyen@kernel.org> Signed-off-by: Greg Kroah-Hartman commit 09dd7b993eddb3b48634fd5ddf27aa799785a9ee Author: Phil Elwell Date: Sun Jun 11 15:03:09 2023 +0100 nvmem: rmem: Use NVMEM_DEVID_AUTO It is reasonable to declare multiple nvmem blocks. Unless a unique 'id' is passed in for each block there may be name clashes. Avoid this by using the magic token NVMEM_DEVID_AUTO. Fixes: 5a3fa75a4d9c ("nvmem: Add driver to expose reserved memory as nvmem") Signed-off-by: Phil Elwell Signed-off-by: Ivan T. Ivanov Reviewed-by: Stefan Wahren Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-6-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 7dae593cd226a0bca61201cf85ceb9335cf63682 Author: Mirsad Goran Todorovac Date: Tue Jun 6 09:08:10 2023 +0200 test_firmware: return ENOMEM instead of ENOSPC on failed memory allocation In a couple of situations like name = kstrndup(buf, count, GFP_KERNEL); if (!name) return -ENOSPC; the error is not actually "No space left on device", but "Out of memory". It is semantically correct to return -ENOMEM in all failed kstrndup() and kzalloc() cases in this driver, as it is not a problem with disk space, but with kernel memory allocator failing allocation. The semantically correct should be: name = kstrndup(buf, count, GFP_KERNEL); if (!name) return -ENOMEM; Cc: Dan Carpenter Cc: Takashi Iwai Cc: Kees Cook Cc: "Luis R. Rodriguez" Cc: Scott Branden Cc: Hans de Goede Cc: Brian Norris Fixes: c92316bf8e948 ("test_firmware: add batched firmware tests") Fixes: 0a8adf584759c ("test: add firmware_class loader test") Fixes: 548193cba2a7d ("test_firmware: add support for firmware_request_platform") Fixes: eb910947c82f9 ("test: firmware_class: add asynchronous request trigger") Fixes: 061132d2b9c95 ("test_firmware: add test custom fallback trigger") Fixes: 7feebfa487b92 ("test_firmware: add support for request_firmware_into_buf") Signed-off-by: Mirsad Goran Todorovac Reviewed-by: Dan Carpenter Message-ID: <20230606070808.9300-1-mirsad.todorovac@alu.unizg.hr> Signed-off-by: Greg Kroah-Hartman commit 9f7b17c9cf66e181134d210625c6e17b55e22cc8 Author: Uwe Kleine-König Date: Sun Jun 11 22:47:37 2023 +0200 mux: adg792a: Switch back to use i2c_driver's .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Acked-by: Peter Rosin Message-ID: <20230611204737.828617-1-u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman commit c85fd9422fe0f5d667305efb27f56d09eab120b0 Author: Armin Wolf Date: Fri May 12 20:45:29 2023 +0200 pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() When nonstatic_release_resource_db() frees all resources associated with an PCMCIA socket, it forgets to free socket_data too, causing a memory leak observable with kmemleak: unreferenced object 0xc28d1000 (size 64): comm "systemd-udevd", pid 297, jiffies 4294898478 (age 194.484s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 f0 85 0e c3 00 00 00 00 ................ 00 00 00 00 0c 10 8d c2 00 00 00 00 00 00 00 00 ................ backtrace: [] __kmem_cache_alloc_node+0x2d7/0x4a0 [<7e51f0c8>] kmalloc_trace+0x31/0xa4 [] nonstatic_init+0x24/0x1a4 [pcmcia_rsrc] [] pcmcia_register_socket+0x200/0x35c [pcmcia_core] [] yenta_probe+0x4d8/0xa70 [yenta_socket] [] pci_device_probe+0x99/0x194 [<84b7c690>] really_probe+0x181/0x45c [<8060fe6e>] __driver_probe_device+0x75/0x1f4 [] driver_probe_device+0x28/0xac [<648b766f>] __driver_attach+0xeb/0x1e4 [<6e9659eb>] bus_for_each_dev+0x61/0xb4 [<25a669f3>] driver_attach+0x1e/0x28 [] bus_add_driver+0x102/0x20c [] driver_register+0x5b/0x120 [<942cd8a4>] __pci_register_driver+0x44/0x4c [] __UNIQUE_ID___addressable_cleanup_module188+0x1c/0xfffff000 [iTCO_vendor_support] Fix this by freeing socket_data too. Tested on a Acer Travelmate 4002WLMi by manually binding/unbinding the yenta_cardbus driver (yenta_socket). Signed-off-by: Armin Wolf Message-ID: <20230512184529.5094-1-W_Armin@gmx.de> Signed-off-by: Greg Kroah-Hartman commit 8898faf5bcacb543ea33d01e559dc9f0891fefa7 Author: Krzysztof Kozlowski Date: Sun Jun 11 15:03:30 2023 +0100 dt-bindings: nvmem: imx-ocotp: drop unneeded address/size-cells and children Referenced nvmem.yaml schema already defines address/size-cells and its children, so remove redundant entries. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Peng Fan Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-27-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 27f699e578b1a72df89dfa3bc42e093a01dc8d10 Author: Rafał Miłecki Date: Sun Jun 11 15:03:29 2023 +0100 nvmem: core: add support for fixed cells *layout* This adds support for the "fixed-layout" NVMEM layout binding. It allows defining NVMEM cells in a layout DT node named "nvmem-layout". While NVMEM subsystem supports layout drivers it has been discussed that "fixed-layout" may actually be supperted internally. It's because: 1. It's a very basic layout 2. It allows sharing code with legacy syntax parsing 3. It's safer for soc_device_match() due to -EPROBE_DEFER 4. This will make the syntax transition easier Signed-off-by: Rafał Miłecki Reviewed-by: Michael Walle Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-26-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit fa7fbe53ecdc4e7d549a9f73a40e257b0046b4b9 Author: Rafał Miłecki Date: Sun Jun 11 15:03:28 2023 +0100 dt-bindings: nvmem: convert base example to use NVMEM fixed cells layout With support for the "fixed-layout" binding it's possible and preferred now to define fixed NVMEM cells in the layout node. Do that for the example binding. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-25-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit bd912c991d2ef079a32558f057b8663bcf1fb6fc Author: Rafał Miłecki Date: Sun Jun 11 15:03:27 2023 +0100 dt-bindings: nvmem: layouts: add fixed-layout With the introduction of NVMEM layouts, new NVMEM content structures should be defined as such. We should also try to convert / migrate existing NVMEM content bindings to layouts. This commit handles fixed NVMEM cells. So far they had to be defined directly - as device subnodes. With this change it's allowed to put them in the DT node named "nvmem-layout". Having NVMEM cells in separated node is preferred as it draws a nice line between NVMEM device and its content. It results in cleaner bindings. FWIW a very similar situation has happened to MTD devices and their partitions: see commit 5d96ea42eb63 ("dt-bindings: mtd: Clarify all partition subnodes"). Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-24-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 08ef7a48ef97fbfd778f02303c565a13bf5bbc3f Author: Frank Wunderlich Date: Sun Jun 11 15:03:26 2023 +0100 dt-bindings: nvmem: mediatek: efuse: add support for mt7986 Add compatible string for mt7986 SoC. Signed-off-by: Frank Wunderlich Acked-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-23-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 22e9e6fcfb5042cb6d6c7874c459b034800092f1 Author: Peng Fan Date: Sun Jun 11 15:03:25 2023 +0100 nvmem: imx: support i.MX93 OCOTP Add i.MX93 OCOTP support. i.MX93 OCOTP has two parts: Fuse shadow block(fsb) and fuse managed by ELE. The FSB part could be directly accessed with MMIO, the ELE could only be accessed with ELE API. Currently the ELE API is not ready, so NULL function callback is used, but it was tested with downstream ELE API. Signed-off-by: Peng Fan Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-22-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 805ba376066fa90d3e27aef9cadacc376d662011 Author: Peng Fan Date: Sun Jun 11 15:03:24 2023 +0100 dt-bindings: nvmem: imx-ocotp: support i.MX93 Add i.MX93 OCOTP support Signed-off-by: Peng Fan Reviewed-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-21-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 9734408969e978a1c0d5d752be63dd638288e374 Author: Michal Simek Date: Sun Jun 11 15:03:23 2023 +0100 nvmem: zynqmp: Switch @xilinx.com emails to @amd.com @xilinx.com is still working but better to switch to new amd.com after AMD/Xilinx acquisition. Signed-off-by: Michal Simek Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-20-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 931d7a2580cd7c9fe2d1e133cb081889a6568063 Author: Krzysztof Kozlowski Date: Sun Jun 11 15:03:22 2023 +0100 dt-bindings: nvmem: sunplus,sp7021-ocotp: drop unneeded address/size-cells Referenced nvmem.yaml schema already defines address/size-cells, so remove redundant entries. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-19-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 8cf4348741086adcfc1b9279fbe2ba387d4397aa Author: Krzysztof Kozlowski Date: Sun Jun 11 15:03:21 2023 +0100 dt-bindings: nvmem: socionext,uniphier-efuse: drop unneeded address/size-cells Referenced nvmem.yaml schema already defines address/size-cells, so remove redundant entries. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-18-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 5c007d6e9f062f8d30d553a4d3540e4431f3baef Author: Krzysztof Kozlowski Date: Sun Jun 11 15:03:20 2023 +0100 dt-bindings: nvmem: qcom,spmi-sdam: drop unneeded address/size-cells Referenced nvmem.yaml schema already defines address/size-cells, so remove redundant entries. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-17-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 4bb5b2562b792b650cd4c657d972eb012fb2e6d2 Author: Krzysztof Kozlowski Date: Sun Jun 11 15:03:19 2023 +0100 dt-bindings: nvmem: qcom,qfprom: drop unneeded address/size-cells Referenced nvmem.yaml schema already defines address/size-cells, so remove redundant entries. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-16-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 619b14219ff6f30bd583965d75396157d6c0282b Author: Krzysztof Kozlowski Date: Sun Jun 11 15:03:18 2023 +0100 dt-bindings: nvmem: mxs-ocotp: drop unneeded address/size-cells Referenced nvmem.yaml schema already defines address/size-cells, so remove redundant entries and use unevaluatedProperties: false. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-15-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 8ab099fafbbc8c9607c399d21a774784a6cb8b45 Author: Cristian Ciocaltea Date: Sun Jun 11 15:03:17 2023 +0100 nvmem: rockchip-otp: Add support for RK3588 Add support for the OTP memory device found on the Rockchip RK3588 SoC. While here, remove the unnecessary 'void *' casts in the OF device ID table. Co-developed-by: Finley Xiao Signed-off-by: Finley Xiao Signed-off-by: Cristian Ciocaltea Tested-by: Vincent Legoll Reviewed-by: Heiko Stuebner Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-14-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 912517345b867a69542dc9f5c2cc3e9d8beaccf5 Author: Cristian Ciocaltea Date: Sun Jun 11 15:03:16 2023 +0100 nvmem: rockchip-otp: Improve probe error handling Enhance error handling in the probe function by making use of dev_err_probe(), which ensures the error code is always printed, in addition to the specified error message. Signed-off-by: Cristian Ciocaltea Tested-by: Vincent Legoll Reviewed-by: Heiko Stuebner Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-13-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit d325c9dd2b6e94040ca722ddcadcd6af358dd2be Author: Cristian Ciocaltea Date: Sun Jun 11 15:03:15 2023 +0100 nvmem: rockchip-otp: Use devm_reset_control_array_get_exclusive() In preparation to support new Rockchip OTP memory devices having specific reset configurations, switch devm_reset_control_get() to devm_reset_control_array_get_exclusive(). Signed-off-by: Cristian Ciocaltea Tested-by: Vincent Legoll Reviewed-by: Heiko Stuebner Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-12-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 30fd21cfb1e64ef20035559a8246f5fbf682c40e Author: Cristian Ciocaltea Date: Sun Jun 11 15:03:14 2023 +0100 nvmem: rockchip-otp: Generalize rockchip_otp_wait_status() In preparation to support additional Rockchip OTP memory devices with different register layout, generalize rockchip_otp_wait_status() to accept a new parameter for specifying the offset of the status register. Signed-off-by: Cristian Ciocaltea Tested-by: Vincent Legoll Reviewed-by: Heiko Stuebner Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-11-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 8dc61364164e79e44c07fa2ac0a7b6939f00d5db Author: Cristian Ciocaltea Date: Sun Jun 11 15:03:13 2023 +0100 nvmem: rockchip-otp: Add clks and reg_read to rockchip_data In preparation to support new Rockchip OTP memory devices with different clock configurations and register layout, extend rockchip_data struct with the related members: clks, num_clks, reg_read. Additionally, to avoid managing redundant driver data, drop num_clks member from rockchip_otp struct and update all references to point to the equivalent member in rockchip_data. Signed-off-by: Cristian Ciocaltea Tested-by: Vincent Legoll Reviewed-by: Heiko Stuebner Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-10-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 2d87a3b140b787fb70dd3c8778412f8191806aa3 Author: Cristian Ciocaltea Date: Sun Jun 11 15:03:12 2023 +0100 dt-bindings: nvmem: rockchip,otp: Add compatible for RK3588 Document the OTP memory found on Rockchip RK3588 SoC. Since RK3588 uses different clocks & resets configurations than PX30 / RK3308, provide the required changes in the binding to be able to handle both variants. Signed-off-by: Cristian Ciocaltea Reviewed-by: Heiko Stuebner Reviewed-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-9-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 2827a58c36448d441bb515409331465ebe0ec39e Author: Cristian Ciocaltea Date: Sun Jun 11 15:03:11 2023 +0100 dt-bindings: nvmem: Convert rockchip-otp.txt to dt-schema Convert the Rockchip OTP memory bindings to dt-schema. Signed-off-by: Cristian Ciocaltea Reviewed-by: Heiko Stuebner Reviewed-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-8-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit c6ee6495d4cce606cafabf9133e7c1b6dce6c842 Author: Ivan T. Ivanov Date: Sun Jun 11 15:03:10 2023 +0100 dt-bindings: nvmem: rmem: Add raspberrypi,bootloader-public-key On RPi4 the bootloader[1] will copy the binary public key blob (if present) into memory location specified by this node, for use by the OS. [1] https://www.raspberrypi.com/documentation/computers/configuration.html#nvmem-nodes Signed-off-by: Ivan T. Ivanov Acked-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-7-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 73bcd133c910bff3b6d3b3834d0d14be9444e90a Author: Rafał Miłecki Date: Sun Jun 11 15:03:08 2023 +0100 nvmem: brcm_nvram: add .read_post_process() for MACs 1. Parse ASCII MAC format into byte based 2. Calculate relative addresses based on index argument Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-5-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 1d53afe3875e123beac955135ca01e6664aa5969 Author: Rafał Miłecki Date: Sun Jun 11 15:03:07 2023 +0100 dt-bindings: nvmem: brcm,nvram: add #nvmem-cell-cells for MACs Broadcom's NVRAM contains MACs for Ethernet interfaces. Those MACs are usually base addresses that are also used for calculating other MACs. For example if a router vendor decided to use gmac0 it most likely programmed NVRAM of each unit with a proper "et0macaddr" value. That is a base. Ethernet interface is usually connected to switch port. Switch usually includes few LAN ports and a WAN port. MAC of WAN port gets calculated as relative address to the interface one. Offset varies depending on device model. Wireless MACs may also need to be calculated using relevant offsets. To support all those scenarios let MAC NVMEM cells be referenced with an index specifying MAC offset. Disallow additionalProperties while at it. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-4-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 8a00fc606312c68b98add8fe8e6f7a013ce29e78 Author: Alexander Stein Date: Sun Jun 11 15:03:06 2023 +0100 nvmem: imx-ocotp: Reverse MAC addresses on all i.MX derivates Not just i.MX8M, but all i.MX6/7 (and subtypes) need to reverse the MAC address read from fuses. Exceptions are i.MX6SLL and i.MX7ULP which do not support ethernet at all. Fixes: d0221a780cbc ("nvmem: imx-ocotp: add support for post processing") Signed-off-by: Alexander Stein Tested-by: Richard Leitner # imx6q Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-3-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit eebc6573ad940b62a87776db3917e912b4f52d78 Author: Tom Rix Date: Sun Jun 11 15:03:05 2023 +0100 nvmem: imx-ocotp: set varaiable imx_ocotp_layout storage-class-specifier to static smatch reports drivers/nvmem/imx-ocotp.c:599:21: warning: symbol 'imx_ocotp_layout' was not declared. Should it be static? This variable is only used in one file so should be static. Signed-off-by: Tom Rix Signed-off-by: Srinivas Kandagatla Message-ID: <20230611140330.154222-2-srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 095bb8ba45f28ed15296eb5b7662e03e57d5e34e Author: Yi Yingao Date: Tue May 9 16:52:36 2023 +0800 nvmem: sunplus-ocotp: release otp->clk before return Smatch reports: drivers/nvmem/sunplus-ocotp.c:205 sp_ocotp_probe() warn: 'otp->clk' from clk_prepare() not released on lines: 196. In the function sp_ocotp_probe(struct platform_device *pdev), otp->clk may not be released before return. To fix this issue, using function clk_unprepare() to release otp->clk. Fixes: 8747ec2e9762 ("nvmem: Add driver for OCOTP in Sunplus SP7021") Signed-off-by: Yi Yingao Reviewed-by: Dongliang Mu Message-ID: <20230509085237.5917-1-m202271736@hust.edu.cn> Signed-off-by: Greg Kroah-Hartman commit b1c8ea3c09db24a55ff84ac047cb2e9d9f644bf9 Author: Abhijit Gangurde Date: Tue Jun 13 14:13:18 2023 +0530 cdx: Replace custom mcdi logging with print_hex_dump_debug() Replace custom mcdi logging for send and receive requests with dynamic debug method print_hex_dump_debug(). Signed-off-by: Abhijit Gangurde Message-ID: <20230613084318.27996-1-abhijit.gangurde@amd.com> Signed-off-by: Greg Kroah-Hartman commit b8c5ff76059ded3758de3db83e04189a072ac01f Author: Nipun Gupta Date: Mon Jun 5 18:40:09 2023 +0530 cdx: fix driver managed dma support The devices on cdx could be bound to drivers with the device DMA managed by kernel drivers or user-space applications. As multiple devices can be placed in the same IOMMU group, the DMA on these devices must either be entirely under kernel control or userspace control. Fix the CDX bus driver to acknowlege the driver_managed_dma flag and call the appropriate iommu APIs. Fixes: 2959ab247061 ("cdx: add the cdx bus driver") Signed-off-by: Nipun Gupta Reported-by: Alex Williamson Closes: https://lore.kernel.org/lkml/20230524134831.28dc97e2.alex.williamson@redhat.com/ Reviewed-by: Nikhil Agarwal Message-ID: <20230605131009.6869-1-nipun.gupta@amd.com> Signed-off-by: Greg Kroah-Hartman commit 9e66fb52449538406cea43e9f3889c391350e76e Author: Julien Panis Date: Thu May 11 11:51:26 2023 +0200 samples: Add userspace example for TI TPS6594 PFSM This patch adds an example showing how to use PFSM devices from a userspace application. The PMIC is armed to be triggered by a RTC alarm to execute state transition. Signed-off-by: Julien Panis Message-ID: <20230511095126.105104-7-jpanis@baylibre.com> Signed-off-by: Greg Kroah-Hartman commit dce548889650c188a1078064d038fb72f3fd1c11 Author: Julien Panis Date: Thu May 11 11:51:25 2023 +0200 Documentation: Add TI TPS6594 PFSM This patch adds documentation for the TPS6594 PFSM driver. The PFSM controls the operational states of the TPS6594 PMIC. Depending on the operational mode, some power domain networks remain energized while others can be off. Signed-off-by: Julien Panis Message-ID: <20230511095126.105104-6-jpanis@baylibre.com> Signed-off-by: Greg Kroah-Hartman commit a0df3ef087f8aaebbdf205b1b2e126ec9ef6b113 Author: Julien Panis Date: Thu May 11 11:51:24 2023 +0200 misc: tps6594-pfsm: Add driver for TI TPS6594 PFSM This PFSM controls the operational modes of the PMIC: - STANDBY and LP_STANDBY, - ACTIVE state, - MCU_ONLY state, - RETENTION state, with or without DDR and/or GPIO retention. Depending on the current operational mode, some voltage domains remain energized while others can be off. This PFSM is also used to trigger a firmware update, and provides R/W access to device registers. See Documentation/misc-devices/tps6594-pfsm.rst for more information. Signed-off-by: Julien Panis Message-ID: <20230511095126.105104-5-jpanis@baylibre.com> Signed-off-by: Greg Kroah-Hartman commit 875fdd0787e41e4dfc4161461514ec3b1230458f Author: Julien Panis Date: Thu May 11 11:51:23 2023 +0200 misc: tps6594-esm: Add driver for TI TPS6594 ESM This patch adds support for TPS6594 ESM (Error Signal Monitor). This device monitors the SoC error output signal at its nERR_SOC input pin. In error condition, ESM toggles its nRSTOUT_SOC pin to reset the SoC. Signed-off-by: Julien Panis Message-ID: <20230511095126.105104-4-jpanis@baylibre.com> Signed-off-by: Greg Kroah-Hartman commit 16e0077e14a73866e9b0f4a6bf4ad3d4a5cb0f2a Author: Jiasheng Jiang Date: Tue Jun 13 12:19:40 2023 +0300 wifi: ath11k: Add missing check for ioremap Add check for ioremap() and return the error if it fails in order to guarantee the success of ioremap(), same as in ath11k_qmi_load_file_target_mem(). Fixes: 6ac04bdc5edb ("ath11k: Use reserved host DDR addresses from DT for PCI devices") Signed-off-by: Jiasheng Jiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230608022858.27405-1-jiasheng@iscas.ac.cn commit 9fb908040a935806b2ea606d3429f790c99c965c Merge: e04b1bff33825 325bec7157b38 Author: Greg Kroah-Hartman Date: Thu Jun 15 13:39:13 2023 +0200 Merge tag 'ib-mfd-tps6594-core-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into char-misc-next Immutable branch containing TPS6594 core (MFD) support due for the v6.5 merge window We want this due to patches requiring this mfd support. Signed-off-by: Greg Kroah-Hartman * tag 'ib-mfd-tps6594-core-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: mfd: tps6594: Add driver for TI TPS6594 PMIC commit a91845b9a872039618d74104c0721376ce092638 Author: Miquel Raynal Date: Wed Jun 14 08:30:16 2023 +0200 sysfs: Skip empty folders creation Most sysfs attributes are statically defined, the goal with this design being to be able to move all the filesystem description into read-only memory. Anyway, it may be relevant in some cases to populate attributes at run time. This leads to situation where an attribute may or may not be present depending on conditions which are not known at compile time, up to the point where no attribute at all gets added in a folder which then becomes "sometimes" empty. Problem is, providing an attribute group with a name and without .[bin_]attrs members will be loudly refused by the core, leading in most cases to a device registration failure. The simple way to support such situation right now is to dynamically allocate an empty attribute array, which is: * a (small) waste of space * a waste of time * disturbing, to say the least, as an empty sysfs folder will be created anyway. Another (even worse) possibility would be to dynamically overwrite a member of the attribute_group list, hopefully the last, which is also supposed to remain in the read-only section. In order to avoid these hackish situations, while still giving a little bit of flexibility, we might just check the validity of the .[bin_]attrs list and, if empty, just skip the attribute group creation instead of failing. This way, developers will not be tempted to workaround the core with useless allocations or strange writes on supposedly read-only structures. The content of the WARN() message is kept but turned into a debug message in order to help developers understanding why their sysfs folders might now silently fail to be created. Signed-off-by: Miquel Raynal Message-ID: <20230614063018.2419043-3-miquel.raynal@bootlin.com> Signed-off-by: Greg Kroah-Hartman commit 4981e0139feeadb1cdffd43a203543afe20769fa Author: Miquel Raynal Date: Wed Jun 14 08:30:15 2023 +0200 sysfs: Improve readability by following the kernel coding style The purpose of the if/else block is to select the right sysfs directory entry to be used for the files creation. At a first look when you have the file in front of you, it really seems like the "create_files()" lines right after the block are badly indented and the "else" does not guard. In practice the code is correct but lacks curly brackets to show where the big if/else block actually ends. Add these brackets to comply with the current kernel coding style and to ease the understanding of the whole logic. Signed-off-by: Miquel Raynal Message-ID: <20230614063018.2419043-2-miquel.raynal@bootlin.com> Signed-off-by: Greg Kroah-Hartman commit 39d422555e43379516d4d13f5b7162a3dee6e646 Author: Matti Vaittinen Date: Mon May 29 09:22:33 2023 +0300 drivers: fwnode: fix fwnode_irq_get[_byname]() The fwnode_irq_get() and the fwnode_irq_get_byname() return 0 upon device-tree IRQ mapping failure. This is contradicting the fwnode_irq_get_byname() function documentation and can potentially be a source of errors like: int probe(...) { ... irq = fwnode_irq_get_byname(); if (irq <= 0) return irq; ... } Here we do correctly check the return value from fwnode_irq_get_byname() but the driver probe will now return success. (There was already one such user in-tree). Change the fwnode_irq_get_byname() to work as documented and make also the fwnode_irq_get() follow same common convention returning a negative errno upon failure. Fixes: ca0acb511c21 ("device property: Add fwnode_irq_get_byname") Suggested-by: Sakari Ailus Suggested-by: Jonathan Cameron Signed-off-by: Matti Vaittinen Reviewed-by: Andy Shevchenko Reviewed-by: Jonathan Cameron Message-ID: <3e64fe592dc99e27ef9a0b247fc49fa26b6b8a58.1685340157.git.mazziesaccount@gmail.com> Signed-off-by: Greg Kroah-Hartman commit 3a5d50f8eb4fcf3c69ae858020c49877e4eeaf05 Author: Wen Gong Date: Tue Jun 13 12:19:45 2023 +0300 wifi: ath12k: fix conf_mutex in ath12k_mac_op_unassign_vif_chanctx() "mutex_unlock(&ar->conf_mutex);" is always called at end of function ath12k_mac_op_unassign_vif_chanctx(), so delete this unlock to make sure lock/unlock is paired. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230608104444.3134-1-quic_wgong@quicinc.com commit 259b8366fdd729413a0de399e85e49154e71de57 Author: Andy Shevchenko Date: Fri Jun 9 18:49:00 2023 +0300 ata: ahci_platform: Make code agnostic to OF/ACPI With the help of a new device_is_compatible() make the driver code agnostic to the OF/ACPI. This makes it neater. As a side effect the header inclusions is corrected (seems mod_devicetable.h was implicitly included). Signed-off-by: Andy Shevchenko Reviewed-by: Serge Semin Reviewed-by: Sakari Ailus Message-ID: <20230609154900.43024-4-andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit 2de5897b5c148a1cdf31bf4628590825d694c37d Author: Andy Shevchenko Date: Fri Jun 9 18:48:59 2023 +0300 device property: Implement device_is_compatible() Some users want to use the struct device pointer to see if the device is compatible in terms of Open Firmware specifications, i.e. if it has a 'compatible' property and it matches to the given value. Provide inline helper for the users. Signed-off-by: Andy Shevchenko Reviewed-by: Serge Semin Reviewed-by: Sakari Ailus Message-ID: <20230609154900.43024-3-andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit 007cfa13e034a1a2973967cbbe31e70c19e2bf31 Author: Andy Shevchenko Date: Fri Jun 9 18:48:58 2023 +0300 ACPI: Move ACPI_DEVICE_CLASS() to mod_devicetable.h The data type of struct acpi_device_id is defined in the mod_devicetable.h. It's suboptimal to require user with the almost agnostic code to include acpi.h solely for the macro that affects the data type defined elsewhere. Taking into account the above and for the sake of consistency move ACPI_DEVICE_CLASS() to mod_devicetable.h. Note, that with CONFIG_ACPI=n the ID table will be filed with data but it does not really matter because either it won't be used, or won't be compiled in some cases (when guarded by respective ifdeffery). Signed-off-by: Andy Shevchenko Acked-by: Rafael J. Wysocki Message-ID: <20230609154900.43024-2-andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit 3bfbff9b461e3506dfb5b2904e8c15a0aea39e07 Author: Daniel Golle Date: Tue Jun 6 16:43:20 2023 +0100 arm64: dts: mt7986: increase bl2 partition on NAND of Bananapi R3 The bootrom burned into the MT7986 SoC will try multiple locations on the SPI-NAND flash to load bl2 in case the bl2 image located at the the previously attempted offset is corrupt. Use 0x100000 instead of 0x80000 as partition size for bl2 on SPI-NAND, allowing for up to four redundant copies of bl2 (typically sized a bit less than 0x40000). Fixes: 8e01fb15b8157 ("arm64: dts: mt7986: add Bananapi R3") Signed-off-by: Daniel Golle Link: https://lore.kernel.org/r/ZH9UGF99RgzrHZ88@makrotopia.org Signed-off-by: Matthias Brugger commit f38ea593ad0d487c0fe79867f98840593c47e2d6 Author: Chen-Yu Tsai Date: Fri Jun 9 15:29:05 2023 +0800 arm64: dts: mediatek: mt8186: Wire up GPU voltage/frequency scaling Add the GPU's OPP table. This is from the downstream ChromeOS kernel, adapted to the new upstream opp-supported-hw binning format. Also add dynamic-power-coefficient for the GPU. Also add label for mfg1 power domain. This is to be used at the board level to add a regulator supply for the power domain. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230609072906.2784594-5-wenst@chromium.org Signed-off-by: Matthias Brugger commit 263d2fd02afc57909959616c234d8ff09f52d6ae Author: Chen-Yu Tsai Date: Fri Jun 9 15:29:04 2023 +0800 arm64: dts: mediatek: mt8186: Add GPU speed bin NVMEM cells On the MT8186, the chip is binned for different GPU voltages at the highest OPPs. The binning value is stored in the efuse. Add the NVMEM cell, and tie it to the GPU. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230609072906.2784594-4-wenst@chromium.org Signed-off-by: Matthias Brugger commit 8f4ed8fc51569307d6aec959e1f1c1c790c7fcd7 Author: Chen-Yu Tsai Date: Fri Jun 9 15:29:03 2023 +0800 arm64: dts: mediatek: mt8186: Wire up CPU frequency/voltage scaling This adds clocks, dynamic power coefficients, and OPP tables for the CPU cores, so that everything required at the SoC level for CPU freqency and voltage scaling is available. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230609072906.2784594-3-wenst@chromium.org Signed-off-by: Matthias Brugger commit 32dfbc03fc26a5aeeaff5b34d3d45f94be21cfae Author: Chen-Yu Tsai Date: Fri Jun 9 15:29:02 2023 +0800 arm64: dts: mediatek: mt8186: Add CCI node and CCI OPP table Add a device node for the CCI (cache coherent interconnect) and an OPP table for it. The OPP table was taken from the downstream ChromeOS kernel. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230609072906.2784594-2-wenst@chromium.org Signed-off-by: Matthias Brugger commit c26f779a2295b81891078cc6f791856fa2705b50 Author: Daniel Golle Date: Tue May 30 22:12:35 2023 +0200 arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts Add pwm-fan and cooling-maps to BananaPi-R3 devicetree. Signed-off-by: Daniel Golle Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230530201235.22330-5-linux@fw-web.de Signed-off-by: Matthias Brugger commit 1f5be05132f38cdc2f11e12f9d0b6cf0f106d568 Author: Daniel Golle Date: Tue May 30 22:12:34 2023 +0200 arm64: dts: mt7986: add thermal-zones Add thermal-zones to mt7986 devicetree. Signed-off-by: Daniel Golle Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230530201235.22330-4-linux@fw-web.de Signed-off-by: Matthias Brugger commit 0a9615d58d0494802ffdd99c3d6d3d13b70687b8 Author: Daniel Golle Date: Tue May 30 22:12:33 2023 +0200 arm64: dts: mt7986: add thermal and efuse Add thermal related nodes to mt7986 devicetree. Signed-off-by: Daniel Golle Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230530201235.22330-3-linux@fw-web.de Signed-off-by: Matthias Brugger commit a4366b5695c984b8a3fc8b31de9e758c8f6d1aed Author: Nícolas F. R. A. Prado Date: Fri Jun 2 14:35:15 2023 -0400 arm64: dts: mediatek: mt8192: Fix CPUs capacity-dmips-mhz The capacity-dmips-mhz parameter was miscalculated: this SoC runs the first (Cortex-A55) cluster at a maximum of 2000MHz and the second (Cortex-A76) cluster at a maximum of 2200MHz. In order to calculate the right capacity-dmips-mhz, the following test was performed: 1. CPUFREQ governor was set to 'performance' on both clusters 2. Ran dhrystone with 500000000 iterations for 10 times on each cluster 3. Calculated the mean result for each cluster 4. Calculated DMIPS/MHz: dmips_mhz = dmips_per_second / cpu_mhz 5. Scaled results to 1024: result_c0 = dmips_mhz_c0 / dmips_mhz_c1 * 1024 The mean results for this SoC are: Cluster 0 (LITTLE): 12016411 Dhry/s Cluster 1 (BIG): 31702034 Dhry/s The calculated scaled results are: Cluster 0: 426.953226899238 (rounded to 427) Cluster 1: 1024 Fixes: 48489980e27e ("arm64: dts: Add Mediatek SoC MT8192 and evaluation board dts and Makefile") Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230602183515.3778780-1-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 6970cadb216cef7951bc915a841123d0967e08bc Author: Nícolas F. R. A. Prado Date: Thu Jun 1 16:32:21 2023 -0400 arm64: dts: mediatek: mt8192: Add missing dma-ranges to soc node In the series "Adjust the dma-ranges for MTK IOMMU", the mtk-iommu driver was adapted to separate the iova range based on the larb used, and a dma-ranges property was added to the soc node in the devicetree of the affected SoCs allowing the whole 16GB iova range to be used. Except that for mt8192, there was no patch adding dma-ranges. Add the missing dma-ranges property to the soc node like was done for mt8195 and mt8186. This fixes the usage of the vcodec, which would otherwise trigger iommu faults. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230601203221.3675915-1-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 127e33f91ed90db67fe8e18eb48054f9a96e809f Author: Hsin-Yi Wang Date: Mon Feb 20 17:33:43 2023 +0800 arm64: dts: mediatek: mt8183: kukui: Add scp firmware-name The upstream SCP firmware path is /lib/firmware/mediatek/mt8183/scp.img Signed-off-by: Hsin-Yi Wang Reviewed-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230220093343.3447381-1-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 64bceed383fbce8ef54200d2849935096fe8f831 Author: Yunfei Dong Date: Fri Mar 3 09:38:42 2023 +0800 arm64: dts: mt8195: Add video decoder node Add video decoder node to mt8195 device tree. Signed-off-by: Yunfei Dong Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Tested-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20230303013842.23259-7-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 1b85a4256ec193f5016b7c8973cbf7f01d11d5f9 Author: Allen-KH Cheng Date: Fri Mar 3 09:38:39 2023 +0800 arm64: dts: mt8192: Add video-codec nodes Add video-codec lat and core nodes for mt8192 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Reviewed-by: Chen-Yu Tsai Tested-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20230303013842.23259-4-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 9d498cce9298a71e3896e2d1aee24a1a4c531d81 Author: Allen-KH Cheng Date: Fri Mar 17 14:19:44 2023 +0800 arm64: dts: mediatek: Add cpufreq nodes for MT8192 Add the cpufreq nodes for MT8192 SoC. Signed-off-by: Allen-KH Cheng Tested-by: Chen-Yu Tsai Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230317061944.15434-1-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 6322555dbeb46c512d6be42c3829087af4e4db9d Author: Icenowy Zheng Date: Fri May 26 18:08:01 2023 +0800 arm64: dts: mediatek: mt8173-elm: remove panel model number in DT Currently a specific panel number is used in the Elm DTSI, which is corresponded to a 12" panel. However, according to the official Chrome OS devices document, Elm refers to Acer Chromebook R13, which, as the name specifies, uses a 13.3" panel, which comes with EDID information. As the kernel currently prioritizes the hardcoded timing parameters matched with the panel number compatible, a wrong timing will be applied to the 13.3" panel on Acer Chromebook R13, which leads to blank display. Because the Elm DTSI is shared with Hana board, and Hana corresponds to multiple devices from 11" to 14", a certain panel model number shouldn't be present, and driving the panel according to its EDID information is necessary. Signed-off-by: Icenowy Zheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20230526100801.16310-1-uwu@icenowy.me Signed-off-by: Matthias Brugger commit 7afe7b5969329175ac4f55a6b9c13ba4f6dc267e Author: Frank Wunderlich Date: Sun May 28 13:33:42 2023 +0200 arm64: dts: mt7986: use size of reserved partition for bl2 To store uncompressed bl2 more space is required than partition is actually defined. There is currently no known usage of this reserved partition. Openwrt uses same partition layout. We added same change to u-boot with commit d7bb1099 [1]. [1] https://source.denx.de/u-boot/u-boot/-/commit/d7bb109900c1ca754a0198b9afb50e3161ffc21e Cc: stable@vger.kernel.org Fixes: 8e01fb15b815 ("arm64: dts: mt7986: add Bananapi R3") Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Daniel Golle Link: https://lore.kernel.org/r/20230528113343.7649-1-linux@fw-web.de Signed-off-by: Matthias Brugger commit 621a046d9b2f38a2fccb1651cbe4351f586e80a1 Author: Pin-yen Lin Date: Mon Apr 17 20:39:56 2023 +0800 arm64: dts: mt8173: Power on panel regulator on boot Add "regulator-boot-on" to "panel_fixed_3v3" to save time on powering the regulator during boot. Also add "off-on-delay-us" to the node to make sure the regulator never violates the panel timing requirements. Signed-off-by: Pin-yen Lin Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20230417123956.926266-1-treapking@chromium.org Signed-off-by: Matthias Brugger commit e6afe03351ac81fbc4f2b93bf3b356f7b662939d Author: Alain Volmat Date: Thu Jun 15 09:58:14 2023 +0200 spi: stm32: disable spi-slave property for stm32f4-f7 STM32F4 and STM32F7 can't switch to spi device mode. Forbid this property with compatible "st,stm32f4-spi". Signed-off-by: Alain Volmat Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20230615075815.310261-4-valentin.caron@foss.st.com Signed-off-by: Mark Brown commit e40335fcb89acb274d05deffad9225e973278ec9 Author: Valentin Caron Date: Thu Jun 15 09:58:15 2023 +0200 spi: stm32: introduction of stm32h7 SPI device mode support Add support for stm32h7 to use SPI controller in device role. In such case, the spi instance should have the spi-slave property defined. Signed-off-by: Alain Volmat Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20230615075815.310261-5-valentin.caron@foss.st.com Signed-off-by: Mark Brown commit 4f2b39dc2d14d4fc55d7a3a140ac07eaa761b701 Author: Alain Volmat Date: Thu Jun 15 09:58:13 2023 +0200 spi: stm32: use dmaengine_terminate_{a}sync instead of _all Avoid usage of deprecated dmaengine_terminate_all and use dmaengine_terminate_sync and dmaengine_terminate_async instead. Signed-off-by: Alain Volmat Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20230615075815.310261-3-valentin.caron@foss.st.com Signed-off-by: Mark Brown commit 6f486556abe35f2e6684f95241acbc463342d3eb Author: Alain Volmat Date: Thu Jun 15 09:58:12 2023 +0200 spi: stm32: renaming of spi_master into spi_controller Preparing introduction of SPI device, rename the spi_master structure into spi_controller. This doesn't have any functional impact since spi_master was already a macro for spi_controller. Referring now to ctrl instead of master since the spi_controller structure might not be used as a master controller only. Signed-off-by: Alain Volmat Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20230615075815.310261-2-valentin.caron@foss.st.com Signed-off-by: Mark Brown commit 45b4ad53d4840d92681060c11fcd4f55b1c2f246 Author: Kuninori Morimoto Date: Thu Jun 15 05:32:42 2023 +0000 ASoC: simple_card_utils: remove unused cpus/codecs/platforms from props simple_dai_props has cpus/codecs/platforms. These pointer were used for dai_link before, but are allocated today since commit 050c7950fd70 ("ASoC: simple-card-utils: alloc dai_link information for CPU/Codec/Platform"). We don't need to keep it anymore. This patch removes these. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87bkhhxpc6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit e04b1bff338255777a5a2ba70ec907d52b8e7c8a Merge: be2c2edf5bfb0 d428487471ba6 Author: Greg Kroah-Hartman Date: Thu Jun 15 13:07:59 2023 +0200 Merge tag 'counter-updates-for-6.5a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-next William writes: First set of Counter updates for the 6.5 cycle Biggest changes in this set include the introduction of a new Intel 8254 interface library module and the refactoring of the existing 104-quad-8 modules to migrate it to the regmap API. Some other minor cleanups touching tools/counter and stm32-timer-cnt are also present. Changes * 104-quad-8 - Remove reference in Kconfig to 25-bit counter value - Utilize bitfield access macros - Refactor to buffer states for CMR, IOR, and IDR - Utilize helper functions to handle PR, FLAG and PSC - Migrate to the regmap API * i8254 - Introduce the Intel 8254 interface library module * stm32-timer-cnt - Reset TIM_TISEL to its default value in probe * tools/counter - Add .gitignore - Remove lingering 'include' directories on make clean * tag 'counter-updates-for-6.5a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter: counter: i8254: Introduce the Intel 8254 interface library module counter: 104-quad-8: Migrate to the regmap API counter: 104-quad-8: Utilize helper functions to handle PR, FLAG and PSC counter: 104-quad-8: Refactor to buffer states for CMR, IOR, and IDR counter: 104-quad-8: Utilize bitfield access macros tools/counter: Makefile: Remove lingering 'include' directories on make clean tools/counter: Add .gitignore counter: stm32-timer-cnt: Reset TIM_TISEL to its default value in probe counter: 104-quad-8: Remove reference in Kconfig to 25-bit counter value commit be2c2edf5bfb0961122e4d0a968b632842de3bfb Merge: 269b9d8fafbef 47147d56f92ee Author: Greg Kroah-Hartman Date: Thu Jun 15 13:06:25 2023 +0200 Merge tag 'fpga-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into char-misc-next Xu writes: FPGA Manager changes for 6.5-rc1 DFL: - Krzysztof's change constifies pointers to hwmon_channel_info Xilinx: - Alfonso's change ensures proper reprograming (xCAP) interface switch All patches have been reviewed on the mailing list, and have been in the last linux-next releases (as part of our for-next branch). Signed-off-by: Xu Yilun * tag 'fpga-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga: fpga: zynq-fpga: Ensure proper xCAP interface switch fpga: dfl-fme: constify pointers to hwmon_channel_info commit 269b9d8fafbef403fa3e5672954aee5a9079be11 Merge: 6ea65f24f78cd 0cf9a77e80fa4 Author: Greg Kroah-Hartman Date: Thu Jun 15 13:01:55 2023 +0200 Merge tag 'iio-for-6.5a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: 1st set of IIO new device support, features and cleanup for the 6.5 cycle. New device support - honeywell,mprls0025pa * New driver and dt-bindings for this series of pressure sensors. - invensense,mpu6050 * Add support for ICM 20600 IMU (ID, bindings and device data). - melexis,mlx90614 * Add support for mlx90615 Infra Red Thermometer after driver cleanup and refactoring to support the differences in this device. - renesas,x9250 * New driver and bindings for this quad potentiometer. - rockchip,saradc * Add support for RK3588. Also included is a bunch of refactoring and cleanup for that driver. - rohm,bu27008 * New driver bindings etc for this 5 photodiode color sensor. - st,lsm9ds0/st,st-sensors * ID added for LSM303D accelerometer and magnetometer including ACPI binding. - ti,opt4001 * New driver and bindings for this ambient light sensor. Features - core * Introduce iio_validate_own_trigger() for cases where a driver can only consumer a trigger it registered (detected via same parent device). Use it in the kionix,kx022a driver and new rohm,by27008 driver. - dynaimage,al3320a * ACPI binding CALS0001 seen on Lenovo Yoga Table 2 devices. - kionix,kx002a * Enable asynchronous probe. - rohm,bu27034 * Enable asynchronous probe. - ti,tmp006 * Explicit support for DT including binding documentation. Cleanups, minor fixes and misc improvements. - treewide * Switch I2C drivers from probe_new() back to probe() - part of the long process of getting rid of a parameter from probe() * Various whitespace and typo fixes not otherwise called out. - core * industrialio-buffer,Style cleanup. * Add documentation to extend_name field of struct iio_chan_spec to direct people using it towards the label infrastructure instead. extend_name was a design mistake a long time back so directly people away from it may be useful. - adi,ad7606 * Add HAS_IOPORT dependency to prepare for some Kconfig changes. - bosch,bma400 * Drop pointless print of ret in a dev_err_probe() message. - invensense,icm42600 * Rework timestamp handling to reduce jitter. - mediatek,mt7986-auxdac * Add DT binding for this part. - qcom,spmi-vadc * Allow for 1/16th prescaling used on a few devices. * Various changes to channel labeling and naming, including dropping use of fwnode_name which generates odd channel names. Small ABI change as a result, but not thought to be a problem for users of this platform. - st,lsm6dsx * dt-binding: Use common schema for mount-matrix via a reference. - st,stm32 * Add a debug print for when legacy channel config is used. - ti,palmas-adc * Drop unused i2c.h include. * tag 'iio-for-6.5a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (59 commits) dt-bindings: iio: rockchip: Fix 'oneOf' condition failed warning dt-bindings: iio: afe: voltage-divider: Spelling s/curcuit/circuit/ dt-bindings: iio: adc: Add rockchip,rk3588-saradc string iio: adc: rockchip_saradc: Use dev_err_probe iio: adc: rockchip_saradc: Match alignment with open parenthesis iio: adc: rockchip_saradc: Use of_device_get_match_data iio: adc: rockchip_saradc: Make use of devm_clk_get_enabled iio: adc: rockchip_saradc: Add support for RK3588 iio: adc: rockchip_saradc: Add callback functions iio: temperature: tmp006: Add OF device matching support dt-bindings: iio: temperature: Add support for tmp006 staging: iio: Switch i2c drivers back to use .probe() iio: amplifiers: ad8366 Fix whitespace issue iio: imu: inv_icm42600: avoid frequent timestamp jitter MAINTAINERS: Add ROHM BU27008 iio: light: ROHM BU27008 color sensor iio: kx022a: Use new iio_validate_own_trigger() iio: trigger: Add simple trigger_validation helper dt-bindings: iio: light: ROHM BU27008 iio: mlx90614: Add MLX90615 support ... commit 6ea65f24f78cdc1618be2b7ca5ffc9ce83448c3c Merge: 5959fe74c9932 c57fa0037024c Author: Greg Kroah-Hartman Date: Thu Jun 15 13:01:02 2023 +0200 Merge tag 'iio-fixes-for-6.4b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: 2nd set of IIO fixes for the 6.4 cycle. Given how late this pull request is, I'm expecting these to get queued up for the 6.5 merge window. - adi,ad7192 * Fix a null pointer as spi_set_drvdata() is no longer called. * Fix wrong check prior to using internal clock. * Fix dt-binding to make it clear the voltage reference is required. - adi,ad74413 * DIN_SINK should not be set for functions other than digital inputs. Enforce that in the driver. - amlogic,meson-saradc * Fix clock divider mask length - affects only meson 8 family. - freescale,fxls8962af * Fix endian type and shift of channels to match with default device setup. * Narrow errata handling to FXLS8962AF only as doesn't affect other devices supported by this driver. * tag 'iio-fixes-for-6.4b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: meson saradc: fix clock divider mask length iio: accel: fxls8962af: errata bug only applicable for FXLS8962AF iio: accel: fxls8962af: fixup buffer scan element type dt-bindings: iio: ad7192: Add mandatory reference voltage source iio: adc: ad7192: Fix internal/external clock selection iio: adc: ad7192: Fix null ad7192_state pointer access iio: addac: ad74413: don't set DIN_SINK for functions other than digital input commit 01da3efafe060ba685fcd08f8db665e5a9f1f9fc Author: Philipp Hortmann Date: Thu Jun 8 08:52:34 2023 +0200 staging: rtl8192e: Use standard api to calculate channel to frequency Use ieee80211_channel_to_freq_khz() to calculate channel to frequency to omit proprietary code. Signed-off-by: Philipp Hortmann Message-ID: Signed-off-by: Greg Kroah-Hartman commit 4e9e2c8026ff200e818928f818dde17a311fed86 Author: Philipp Hortmann Date: Thu Jun 8 08:52:18 2023 +0200 staging: rtl8192e: Use standard api to calculate frequency to channel Use ieee80211_freq_khz_to_channel() to calculate frequency to channel to omit proprietary code. Signed-off-by: Philipp Hortmann Message-ID: Signed-off-by: Greg Kroah-Hartman commit 97c5209b3d374a25ebdb4c2ea9e9c1b121768da0 Author: Dan Carpenter Date: Wed Jun 14 10:03:59 2023 +0300 leds: trigger: netdev: uninitialized variable in netdev_trig_activate() The qca8k_cled_hw_control_get() function which implements ->hw_control_get sets the appropriate bits but does not clear them. This leads to an uninitialized variable bug. Fix this by setting mode to zero at the start. Fixes: e0256648c831 ("net: dsa: qca8k: implement hw_control ops") Signed-off-by: Dan Carpenter Reviewed-by: Andrew Lunn Acked-by: Lee Jones Signed-off-by: David S. Miller commit d88b46ce5ab8160a3c5d4efde27197d7545ec19a Author: Philipp Hortmann Date: Sat Jun 3 10:52:51 2023 +0200 staging: rtl8192e: Add cfg80211.h and remove defined variables Add cfg80211 and remove defined variables rfc1042_header and bridge_tunnel_header as they are then already defined. Usage of cfg80211 is required to merge driver into wireless subsystem. Signed-off-by: Philipp Hortmann Message-ID: <20230603085251.GA20230@matrix-ESPRIMO-P710> Signed-off-by: Greg Kroah-Hartman commit c88af76f71c5459852ed959af5ab7afbbf2c4411 Author: Michael Straube Date: Wed May 31 07:31:18 2023 +0200 staging: rtl8192e: remove blank lines Remove unnecessary blank lines reported by checkpatch. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Message-ID: <20230531053118.17053-1-straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman commit 00eca57d6521a14c9257049ad8d029ac6601c4a3 Author: Deepanshu Kartikey Date: Tue May 30 19:21:20 2023 +0530 Staging: rts5208: rtsx: Removed new line in else and else if Removed new line in else and else if, this warning was given by checkpatch.pl Signed-off-by: Deepanshu Kartikey Reviewed-by: Dan Carpenter Message-ID: <20230530135120.37637-1-kartikey406@gmail.com> Signed-off-by: Greg Kroah-Hartman commit f0ec58d557d65838974035ffd8a8862cf8166a81 Author: Jakub Kicinski Date: Tue Jun 13 17:28:00 2023 -0700 tools: ynl: work around stale system headers The inability to include the uAPI headers directly in tools/ is one of the bigger annoyances of compiling user space code. Most projects trade the pain for smaller inconvenience of having to copy the headers under tools/include. In case of netlink headers I think that we can avoid both. Netlink family headers are simple and should be self-contained. We can try to twiddle the Makefile a little to force-include just the family header, and use system headers for the rest. This works fairly well. There are two warts - for some reason if we specify -include $path/family.h as a compilation flag, the #ifdef header guard does not seem to work. So we need to throw the guard in on the command line as well. Seems like GCC detects that the header is different and tries to include both. Second problem is that make wants hash sign to be escaped or not depending on the version. Sigh. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 88d8f3ac9c67e2d00db671dbb0af50efb7c358cb Author: Dmitry Baryshkov Date: Thu Jun 15 12:32:55 2023 +0200 usb: typec: add support for the nb7vpq904m Type-C Linear Redriver Add support for the ON Semiconductor NB7VPQ904M Type-C USB SuperSpeed and DisplayPort ALT Mode Linear Redriver chip found on some devices with a Type-C port. The redriver compensates ultra High-Speeed DisplayPort and USB Super Speed signal integrity losses mainly due to PCB & transmission cables. The redriver doesn't support SuperSpeed lines swapping, but can support Type-C SBU lines swapping. Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus Signed-off-by: Neil Armstrong Message-ID: <20230601-topic-sm8x50-upstream-redriver-v4-2-91d5820f3a03@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 35944dc68e67ab0c105939b83d20a04bd16f4968 Author: Lukas Bulwahn Date: Wed Jun 14 10:42:12 2023 +0200 MAINTAINERS: repair pattern in ARM/Amlogic Meson SoC CLOCK FRAMEWORK Commit e6c6ddb397e2 ("dt-bindings: clock: meson: add A1 PLL clock controller bindings") adds a file entry with pattern "include/dt-bindings/clock/a1*" to the ARM/Amlogic Meson SoC CLOCK FRAMEWORK section. However, all header files added in the patch series to add Amlogic A1 clock controller drivers carry the prefix "amlogic,a1", and there are not header files matching "a1*". Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Adjust the pattern of this file entry to match the headers actually added. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20230614084212.1359-1-lukas.bulwahn@gmail.com Fixes: e6c6ddb397e2 ("dt-bindings: clock: meson: add A1 PLL clock controller bindings") Signed-off-by: Jerome Brunet commit b8533204885a4e1e643014eccb9c727c55f58ce0 Author: Jiapeng Chong Date: Wed Jun 14 16:48:08 2023 +0800 clk: meson: pll: remove unneeded semicolon No functional modification involved. ./drivers/clk/meson/clk-pll.c:373:2-3: Unneeded semicolon. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230614084808.98819-1-jiapeng.chong@linux.alibaba.com Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family") Signed-off-by: Jerome Brunet commit 4903fde8047a28299d1fc79c1a0dcc255e928f12 Author: Hui Li Date: Thu Apr 6 10:44:50 2023 +0800 tty: fix hang on tty device with no_room set It is possible to hang pty devices in this case, the reader was blocking at epoll on master side, the writer was sleeping at wait_woken inside n_tty_write on slave side, and the write buffer on tty_port was full, we found that the reader and writer would never be woken again and blocked forever. The problem was caused by a race between reader and kworker: n_tty_read(reader): n_tty_receive_buf_common(kworker): copy_from_read_buf()| |room = N_TTY_BUF_SIZE - (ldata->read_head - tail) |room <= 0 n_tty_kick_worker() | |ldata->no_room = true After writing to slave device, writer wakes up kworker to flush data on tty_port to reader, and the kworker finds that reader has no room to store data so room <= 0 is met. At this moment, reader consumes all the data on reader buffer and calls n_tty_kick_worker to check ldata->no_room which is false and reader quits reading. Then kworker sets ldata->no_room=true and quits too. If write buffer is not full, writer will wake kworker to flush data again after following writes, but if write buffer is full and writer goes to sleep, kworker will never be woken again and tty device is blocked. This problem can be solved with a check for read buffer size inside n_tty_receive_buf_common, if read buffer is empty and ldata->no_room is true, a call to n_tty_kick_worker is necessary to keep flushing data to reader. Cc: Fixes: 42458f41d08f ("n_tty: Ensure reader restarts worker for next reader") Reviewed-by: Ilpo Järvinen Signed-off-by: Hui Li Message-ID: <1680749090-14106-1-git-send-email-caelli@tencent.com> Signed-off-by: Greg Kroah-Hartman commit cef09673c35bdffb0866268cedae5994e024ddb8 Author: Dan Carpenter Date: Wed Jun 14 09:36:33 2023 +0300 serial: core: fix -EPROBE_DEFER handling in init The -EPROBE_DEFER error path in serial_base_device_init() is a bit awkward. Before the call to device_initialize(dev) then we need to manually release all the device resources. And after the call then we need to call put_device() to release the resources. Doing either one wrong will result in a leak or a use after free. So let's wait to return -EPROBE_DEFER until after the call to device_initialize(dev) so that way callers do not have to handle -EPROBE_DEFER as a special case. Now callers can just use put_device() for clean up. The second issue with the -EPROBE_DEFER path is that deferring is not supposed to be a fatal error, but instead it's normal part of the init process and the kernel recovers from it automatically. That means we should not print an error message but just a debug message on this path. Fixes: 539914240a01 ("serial: core: Fix probing serial_base_bus devices") Signed-off-by: Dan Carpenter Reviewed-by: Tony Lindgren Message-ID: <18318adb-ab2c-4dcc-9f96-498a13d16b80@moroto.mountain> Signed-off-by: Greg Kroah-Hartman commit 20a41a62618df85f3a2981008edec5cadd785e0a Author: Tony Lindgren Date: Wed Jun 14 07:59:19 2023 +0300 serial: 8250_omap: Use force_suspend and resume for system suspend We should not rely on autosuspend timeout for system suspend. Instead, let's use force_suspend and force_resume functions. Otherwise the serial port controller device may not be idled on suspend. As we are doing a register write on suspend to configure the serial port, we still need to runtime PM resume the port on suspend. While at it, let's switch to pm_runtime_resume_and_get() and check for errors returned. And let's add the missing line break before return to the suspend function while at it. Fixes: 09d8b2bdbc5c ("serial: 8250: omap: Provide ability to enable/disable UART as wakeup source") Signed-off-by: Tony Lindgren Tested-by: Dhruva Gole Message-ID: <20230614045922.4798-1-tony@atomide.com> Signed-off-by: Greg Kroah-Hartman commit fa0048a4b1fa7a50c8b0e514f5b428abdf69a6f8 Author: Bjorn Andersson Date: Mon Jun 12 15:02:59 2023 -0700 drm/msm/dp: Free resources after unregistering them The DP component's unbind operation walks through the submodules to unregister and clean things up. But if the unbind happens because the DP controller itself is being removed, all the memory for those submodules has just been freed. Change the order of these operations to avoid the many use-after-free that otherwise happens in this code path. Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support") Signed-off-by: Bjorn Andersson Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/542166/ Link: https://lore.kernel.org/r/20230612220259.1884381-1-quic_bjorande@quicinc.com Signed-off-by: Dmitry Baryshkov commit a7bfb2ad2184a1fba78be35209b6019aa8cc8d4d Author: Bjorn Andersson Date: Mon Jun 12 15:01:06 2023 -0700 drm/msm/dp: Drop aux devices together with DP controller Using devres to depopulate the aux bus made sure that upon a probe deferral the EDP panel device would be destroyed and recreated upon next attempt. But the struct device which the devres is tied to is the DPUs (drm_dev->dev), which may be happen after the DP controller is torn down. Indications of this can be seen in the commonly seen EDID-hexdump full of zeros in the log, or the occasional/rare KASAN fault where the panel's attempt to read the EDID information causes a use after free on DP resources. It's tempting to move the devres to the DP controller's struct device, but the resources used by the device(s) on the aux bus are explicitly torn down in the error path. The KASAN-reported use-after-free also remains, as the DP aux "module" explicitly frees its devres-allocated memory in this code path. As such, explicitly depopulate the aux bus in the error path, and in the component unbind path, to avoid these issues. Fixes: 2b57f726611e ("drm/msm/dp: fix aux-bus EP lifetime") Signed-off-by: Bjorn Andersson Reviewed-by: Dmitry Baryshkov Reviewed-by: Douglas Anderson Patchwork: https://patchwork.freedesktop.org/patch/542163/ Link: https://lore.kernel.org/r/20230612220106.1884039-1-quic_bjorande@quicinc.com Signed-off-by: Dmitry Baryshkov commit fda520976ef49d3ab66f6157053b084721d86712 Author: Dmitry Baryshkov Date: Mon Jun 12 06:16:15 2023 +0300 drm/msm: provide fb_dirty implemenation Since commit 93e81e38e197 ("drm/fb_helper: Minimize damage-helper overhead") the drm_fb_helper_funcs::fb_dirty helper is required for proper dirty/damage processing. The drm/msm driver requires that to function to let CMD panels to work. Use simplified version of drm_fbdev_generic_helper_fb_dirty() to fix support for CMD mode panels. Reported-by: Degdag Mohamed Fixes: 93e81e38e197 ("drm/fb_helper: Minimize damage-helper overhead") Cc: Thomas Zimmermann Signed-off-by: Dmitry Baryshkov Reviewed-by: Thomas Zimmermann Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/542002/ Link: https://lore.kernel.org/r/20230612031616.3620134-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 155fa3a91d64221eb0885fd221cc8085dbef908f Author: Jessica Zhang Date: Fri Jun 9 15:57:17 2023 -0700 drm/msm/dsi: Remove incorrect references to slice_count Currently, slice_count is being used to calculate word count and pkt_per_line. Instead, these values should be calculated using slice per packet, which is not the same as slice_count. Slice count represents the number of slices per interface, and its value will not always match that of slice per packet. For example, it is possible to have cases where there are multiple slices per interface but the panel specifies only one slice per packet. Thus, use the default value of one slice per packet and remove slice_count from the aforementioned calculations. Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Fixes: bc6b6ff8135c ("drm/msm/dsi: Use DSC slice(s) packet size to compute word count") Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/541965/ Link: https://lore.kernel.org/r/20230405-add-dsc-support-v6-5-95eab864d1b6@quicinc.com Signed-off-by: Dmitry Baryshkov commit 1642b580347372a985ff4fbe295c7af44090c51a Author: Jessica Zhang Date: Fri Jun 9 15:57:16 2023 -0700 drm/msm/dpu: Set DATA_COMPRESS on command mode for DCE/DSC 1.2 Add a DPU INTF op to set the DCE_DATA_COMPRESS bit to enable the DCE/DSC 1.2 datapath Note: For now, this op is called for command mode encoders only. Changes to set DATA_COMPRESS for video mode encoders will be posted along with DSC v1.2 support for DP. Signed-off-by: Jessica Zhang Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/541966/ Link: https://lore.kernel.org/r/20230405-add-dsc-support-v6-4-95eab864d1b6@quicinc.com Signed-off-by: Dmitry Baryshkov commit 22598cfc94bb1d6590c49ea749c785e79463cb2f Author: Jessica Zhang Date: Fri Jun 9 15:57:15 2023 -0700 drm/msm/dpu: Add DPU_INTF_DATA_COMPRESS feature flag for DPU >= 7.0 In DPU 7.x and later, DSC/DCE enablement registers have been moved from PINGPONG to INTF. Thus, add a DPU_INTF_DATA_COMPRESS feature flag that will be set if the DATA_COMPRESS register is in the INTF block. Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/541967/ Link: https://lore.kernel.org/r/20230405-add-dsc-support-v6-3-95eab864d1b6@quicinc.com Signed-off-by: Dmitry Baryshkov commit 7c9e4a554d4a712bc6891a49d52b1ec030ed5b4a Author: Jessica Zhang Date: Fri Jun 9 15:57:14 2023 -0700 drm/msm/dsi: Reduce pclk rate for compression Adjust the pclk rate to divide hdisplay by the compression ratio when DSC is enabled. Signed-off-by: Jessica Zhang Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/541972/ Link: https://lore.kernel.org/r/20230405-add-dsc-support-v6-2-95eab864d1b6@quicinc.com Signed-off-by: Dmitry Baryshkov commit 21bf617110bab03001bd86ec1a822164bacbc747 Author: Jessica Zhang Date: Fri Jun 9 15:57:13 2023 -0700 msm/drm/dsi: Round up DSC hdisplay calculation Currently, when compression is enabled, hdisplay is reduced via integer division. This causes issues for modes where the original hdisplay is not a multiple of 3. To fix this, use DIV_ROUND_UP to divide hdisplay. Suggested-by: Marijn Suijten Fixes: 08802f515c3cf ("drm/msm/dsi: Add support for DSC configuration") Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/541970/ Link: https://lore.kernel.org/r/20230405-add-dsc-support-v6-1-95eab864d1b6@quicinc.com Signed-off-by: Dmitry Baryshkov commit 0d1b10c633468e84e64412b8061f6f7f678f14cb Author: Abhinav Kumar Date: Thu May 25 10:40:57 2023 -0700 drm/msm/dpu: add DSC 1.2 hw blocks for relevant chipsets Add DSC 1.2 hardware blocks to the catalog with necessary sub-block and feature flag information. Each display compression engine (DCE) contains dual DSC encoders so both share same base address but with its own different sub block address. changes in v4: -- delete DPU_DSC_HW_REV_1_1 -- re arrange sc8280xp_dsc[] changes in v4: -- fix checkpatch warning changes in v10: -- remove hard slice from commit text -- replace DPU_DSC_NATIVE_422_EN with DPU_DSC_NATIVE_42x_EN -- change DSC_BLK_1_2 .len from 0x100 to 0x29c changes in v11: -- remove comment at DSC_BLK_1_2 marco Signed-off-by: Abhinav Kumar Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/539507/ Link: https://lore.kernel.org/r/1685036458-22683-10-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit 8c4094b275f66d725a785d2314c27e00db2141dd Author: Kuogee Hsieh Date: Thu May 25 10:40:54 2023 -0700 drm/msm/dpu: add support for DSC encoder v1.2 engine Add support for DSC 1.2 by providing the necessary hooks to program the DPU DSC 1.2 encoder. Changes in v3: -- fixed kernel test rebot report that "__iomem *off" is declared but not used at dpu_hw_dsc_config_1_2() -- unrolling thresh loops Changes in v4: -- delete DPU_DSC_HW_REV_1_1 -- delete off and used real register name directly Changes in v7: -- replace offset with sblk->enc.base -- replace ss with slice Changes in v8: -- fixed checkpatch warning Changes in v9: -- replaced __dsc_calc_ob_max_addr() with __dsc_calc_output_buf_max_addr() -- replaced variable num_ss with num_softslice -- remove inline from function declaration changes in v10: -- rewording text of changes in v9 -- replace DPU_DSC_NATIVE_422_EN with DPU_DSC_NATIVE_42x_EN -- replace drm_dsc_calculate_flatness_det_thresh() with drm_dsc_flatness_det_thresh() Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/539500/ Link: https://lore.kernel.org/r/1685036458-22683-7-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit 149419396a9200075de8d75becd740ae48721524 Author: Jessica Zhang Date: Wed May 24 10:45:22 2023 -0700 drm/msm/dsi: update hdisplay calculation for dsi_timing_setup Currently, hdisplay is being divided by 3 for DSC. However, this calculation only works for cases where BPP = 8. Update hdisplay calculation to be bytes_per_line / 3, so that it accounts for cases where BPP != 8. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/539271/ Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-9-bafc7be95691@quicinc.com Signed-off-by: Dmitry Baryshkov commit ed1498f77419f2a636a07825492230c5562cc333 Author: Jessica Zhang Date: Wed May 24 10:45:21 2023 -0700 drm/msm/dsi: Use MSM and DRM DSC helper methods Use MSM and DRM DSC helper methods to configure DSC for DSI. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/539274/ Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-8-bafc7be95691@quicinc.com Signed-off-by: Dmitry Baryshkov commit c223059e6f8340f7eac2319470984cbfc39c433b Author: Jessica Zhang Date: Wed May 24 10:45:20 2023 -0700 drm/msm/dpu: Fix slice_last_group_size calculation Correct the math for slice_last_group_size so that it matches the calculations downstream. Fixes: c110cfd1753e ("drm/msm/disp/dpu1: Add support for DSC") Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/539269/ Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-7-bafc7be95691@quicinc.com Signed-off-by: Dmitry Baryshkov commit 44346191a210f04c52f8389b3bd989d4a2a3e1ba Author: Jessica Zhang Date: Wed May 24 10:45:19 2023 -0700 drm/msm/dpu: Use fixed DRM DSC helper for det_thresh_flatness The current dpu_hw_dsc calculation for det_thresh_flatness does not match the downstream calculation or the DSC spec. Use the DRM DSC helper for det_thresh_flatness to match downstream implementation and the DSC spec. Fixes: c110cfd1753e ("drm/msm/disp/dpu1: Add support for DSC") Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/539275/ Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-6-bafc7be95691@quicinc.com Signed-off-by: Dmitry Baryshkov commit b50f06f83e0e859d93bd7bb80a2d1911f2dc176b Author: Jessica Zhang Date: Wed May 24 10:45:18 2023 -0700 drm/msm: Add MSM-specific DSC helper methods Introduce MSM-specific DSC helper methods, as some calculations are common between DP and DSC. Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/539272/ Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-5-bafc7be95691@quicinc.com Signed-off-by: Dmitry Baryshkov commit 49fd30a7153be027b7ae9895e9061dec15e836f7 Author: Dmitry Baryshkov Date: Wed May 24 10:45:17 2023 -0700 drm/msm/dsi: use DRM DSC helpers for DSC setup Use new DRM DSC helpers to setup DSI DSC configuration. The initial_scale_value needs to be adjusted according to the standard, but this is a separate change. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/539276/ Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-4-bafc7be95691@quicinc.com Signed-off-by: Dmitry Baryshkov commit 68858328124162b9b42bc7b8232eee1915cc1d8f Author: Jessica Zhang Date: Wed May 24 10:45:16 2023 -0700 drm/display/dsc: Add drm_dsc_get_bpp_int helper Add helper to get the integer value of drm_dsc_config.bits_per_pixel Reviewed-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/539268/ Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-3-bafc7be95691@quicinc.com Signed-off-by: Dmitry Baryshkov commit e871a70d8ccd6dbcb30f081f5d3d8854380422fe Author: Dmitry Baryshkov Date: Wed May 24 10:45:15 2023 -0700 drm/display/dsc: add helper to set semi-const parameters Add a helper setting config values which are typically constant across operating modes (table E-4 of the standard) and mux_word_size (which is a const according to 3.5.2). Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/539280/ Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-2-bafc7be95691@quicinc.com Signed-off-by: Dmitry Baryshkov commit 7df1ed6ddf3da52b020ef3c3f5597bc628c3e58e Author: Jessica Zhang Date: Wed May 24 10:45:14 2023 -0700 drm/display/dsc: Add flatness and initial scale value calculations Add helpers to calculate det_thresh_flatness and initial_scale_value as these calculations are defined within the DSC spec. Reviewed-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/539282/ Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-1-bafc7be95691@quicinc.com Signed-off-by: Dmitry Baryshkov commit c72375172194a371935c78b0edaae75cd0c408ea Author: Dmitry Baryshkov Date: Mon Jun 12 21:25:34 2023 +0300 drm/msm/dpu/catalog: define DSPP blocks found on sdm845 Add definitions of DSPP blocks present on the sdm845 platform. This should enable color-management on sdm845-bassed devices. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Reviewed-by: Sumit Semwal Patchwork: https://patchwork.freedesktop.org/patch/542142/ Link: https://lore.kernel.org/r/20230612182534.3345805-2-dmitry.baryshkov@linaro.org commit 3bcfc7b90465efd337d39b91b43972162f0d1908 Author: Dmitry Baryshkov Date: Mon Jun 12 21:25:33 2023 +0300 drm/msm/dpu: do not enable color-management if DSPPs are not available We can not support color management without DSPP blocks being provided in the HW catalog. Do not enable color management for CRTCs if num_dspps is 0. Fixes: 4259ff7ae509 ("drm/msm/dpu: add support for pcc color block in dpu driver") Reported-by: Yongqin Liu Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Reviewed-by: Sumit Semwal Tested-by: Yongqin Liu Patchwork: https://patchwork.freedesktop.org/patch/542141/ Link: https://lore.kernel.org/r/20230612182534.3345805-1-dmitry.baryshkov@linaro.org commit b263325b4f341a0e85c1d5dc4451df2c5e4349fa Author: Dmitry Baryshkov Date: Mon Jun 12 21:25:27 2023 +0300 drm/msm/adreno: make adreno_is_a690()'s argument const Change adreno_is_a690() prototype to accept the const struct adreno_gpu pointer instead of a non-const one. This fixes the following warning: In file included from drivers/gpu/drm/msm/msm_drv.c:33: drivers/gpu/drm/msm/adreno/adreno_gpu.h: In function ‘adreno_is_a660_family’: drivers/gpu/drm/msm/adreno/adreno_gpu.h:303:54: warning: passing argument 1 of ‘adreno_is_a690’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 303 | return adreno_is_a660(gpu) || adreno_is_a690(gpu) || adreno_is_7c3(gpu); Fixes: 1b90e8f8879c ("drm/msm/adreno: change adreno_is_* functions to accept const argument") Signed-off-by: Dmitry Baryshkov Reviewed-by: Rob Clark Reviewed-by: Douglas Anderson Patchwork: https://patchwork.freedesktop.org/patch/542138/ Link: https://lore.kernel.org/r/20230612182527.3345786-1-dmitry.baryshkov@linaro.org commit 4ee94d9407898a5c0d3824d50ec91e4cb1276761 Author: Greg Kroah-Hartman Date: Thu Jun 15 11:43:07 2023 +0200 MAINTAINERS: USB: add uapi header files to USB SUBSYSTEM entry For some reason the include/uapi/linux/usb/ directory is missing in the USB SUBSYSTEM entry, so get_maintainer will not know to cc: the proper mailing lists. Fix this up by adding an entry for this directory. Message-ID: <20230615094306.2072827-2-gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman commit c43e7983fcc3f7dea0b49adfae848c2830d80a59 Author: Piyush Mehta Date: Tue Jun 13 18:00:48 2023 +0530 dt-bindings: reset: convert the xlnx,zynqmp-reset.txt to yaml Convert the binding to DT schema format. It also updates the reset-controller description. Signed-off-by: Piyush Mehta Reviewed-by: Krzysztof Kozlowski Message-ID: <20230613123048.2935502-1-piyush.mehta@amd.com> Signed-off-by: Greg Kroah-Hartman commit 771e0e37bff042b31e8b104263c7ebbe915a0fd3 Author: Neil Armstrong Date: Tue Jun 13 16:50:07 2023 +0200 dt-bindings: usb: add ON Semiconductor nb7vpq904m Type-C Linear Redriver bindings Document bindings for this ON Semiconductor Type-C USB SuperSpeed and DisplayPort ALT Mode Linear Redriver. Signed-off-by: Neil Armstrong Reviewed-by: Krzysztof Kozlowski Message-ID: <20230601-topic-sm8x50-upstream-redriver-v3-1-988c560e2195@linaro.org> Signed-off-by: Greg Kroah-Hartman commit 09b69dd4378b91b3ac3fbac387fb992dc21c0f88 Author: Kees Cook Date: Wed Jun 14 11:13:11 2023 -0700 usb: ch9: Replace 1-element array with flexible array Since commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3"), UBSAN_BOUNDS no longer pretends 1-element arrays are unbounded. Walking wData will trigger a warning, so make it a proper flexible array. Add a union to keep the struct size identical for userspace in case anything was depending on the old size. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202306102333.8f5a7443-oliver.sang@intel.com Cc: Greg Kroah-Hartman Cc: kernel test robot Cc: "Gustavo A. R. Silva" Cc: Dan Williams Cc: "Jó Ágila Bitsch" Signed-off-by: Kees Cook Message-ID: <20230614181307.gonna.256-kees@kernel.org> Signed-off-by: Greg Kroah-Hartman commit df49f2a0ac4a34c0cb4b5c233fcfa0add644c43c Author: Greg Kroah-Hartman Date: Thu Jun 15 11:30:35 2023 +0200 Revert "usb: common: usb-conn-gpio: Set last role to unknown before initial detection" This reverts commit edd60d24bd858cef165274e4cd6cab43bdc58d15. Heikki reports that this should not be a global flag just to work around one broken driver and should be fixed differently, so revert it. Reported-by: Heikki Krogerus Fixes: edd60d24bd85 ("usb: common: usb-conn-gpio: Set last role to unknown before initial detection") Link: https://lore.kernel.org/r/ZImE4L3YgABnCIsP@kuha.fi.intel.com Cc: Prashanth K Cc: AngeloGioacchino Del Regno Signed-off-by: Greg Kroah-Hartman commit 1700f89cb99aae19e4f8ec38b1b59f3b7ae71b91 Author: Marc Zyngier Date: Wed Jun 14 16:51:29 2023 +0100 KVM: arm64: Fix hVHE init on CPUs where HCR_EL2.E2H is not RES1 On CPUs where E2H is RES1, we very quickly set the scene for running EL2 with a VHE configuration, as we do not have any other choice. However, CPUs that conform to the current writing of the architecture start with E2H=0, and only later upgrade with E2H=1. This is all good, but nothing there is actually reconfiguring EL2 to be able to correctly run the kernel at EL1. Huhuh... The "obvious" solution is not to just reinitialise the timer controls like we do, but to really intitialise *everything* unconditionally. This requires a bit of surgery, and is a good opportunity to remove the macro that messes with SPSR_EL2 in init_el2_state. With that, hVHE now works correctly on my trusted A55 machine! Reported-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230614155129.2697388-1-maz@kernel.org Signed-off-by: Oliver Upton commit cf683e8870bd4be0fd6b98639286700a35088660 Author: Thomas Zimmermann Date: Wed Jun 14 15:12:12 2023 +0200 fbdev: Use /* */ comment in initializer macro Use /* */ in initializer macro to avoid out-commenting the comma at the end of the line. Reported-by: Christian König Closes: https://lore.kernel.org/dri-devel/20230530150253.22758-1-tzimmermann@suse.de/T/#m356cda2679c17d7a01f30ce2b5282cd9046ea6d4 Fixes: f1061fa641b8 ("fbdev: Add initializer macros for struct fb_ops") Cc: Sam Ravnborg Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Thomas Zimmermann Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230614131253.10208-1-tzimmermann@suse.de commit db6da59cf27b5661ced03754ae0550f8914eda9e Merge: cf03e2956af30 901bdf5ea1a83 Author: Thomas Zimmermann Date: Thu Jun 15 10:34:19 2023 +0200 Merge drm/drm-next into drm-misc-next-fixes Backmerging to sync drm-misc-next-fixes with drm-misc-next. Signed-off-by: Thomas Zimmermann commit d918e0d5824495a75d00b879118b098fcab36fdb Author: Jiasheng Jiang Date: Fri Jun 9 09:48:18 2023 +0800 mfd: intel-lpss: Add missing check for platform_get_resource Add the missing check for platform_get_resource and return error if it fails. Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices") Signed-off-by: Jiasheng Jiang Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230609014818.28475-1-jiasheng@iscas.ac.cn commit 6e9df38f359a26431609320bd38ea9a81bb4d63d Author: Sean Nyekjaer Date: Fri Jun 2 08:24:26 2023 +0200 mfd: stpmic1: Add PMIC poweroff via sys-off handler Use devm_register_sys_off_handler() that allows to register multiple power-off handlers. This will allow boards using the stpmic1 to power-off. Signed-off-by: Sean Nyekjaer Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230602062426.3947116-2-sean@geanix.com commit 48b4371b98676e8db3f72e4355af7707103d9c07 Author: Sean Nyekjaer Date: Fri Jun 2 08:24:25 2023 +0200 mfd: stpmic1: Fixup main control register and bits naming Fixup main control register and bits naming so the match the naming from the datasheet. https://www.st.com/resource/en/datasheet/stpmic1.pdf Signed-off-by: Sean Nyekjaer Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230602062426.3947116-1-sean@geanix.com commit 2ce68cf10081f906f29a1ad9027c2bcfc2f8465d Author: Vignesh Viswanathan Date: Fri May 26 16:36:51 2023 +0530 dt-bindings: mfd: qcom,tcsr: Add the compatible for IPQ8074 Document the qcom,tcsr-ipq8074 compatible. Signed-off-by: Vignesh Viswanathan Acked-by: Conor Dooley Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230526110653.27777-2-quic_viswanat@quicinc.com commit 3df4c63675203da74385b00dd72ae90cc59dd710 Author: Jerome Neanne Date: Thu Jun 8 09:19:47 2023 +0200 mfd: tps65219: Add support for soft shutdown via sys-off API Use new API for power-off mode support: Link: https://lwn.net/Articles/894511/ Link: https://lore.kernel.org/all/7hfseqa7l0.fsf@baylibre.com/ sys-off API allows support of shutdown handler and restart handler. Shutdown was not supported before that enhancement. This is required for platform that are not using PSCI. Test: - restart: # reboot Default is cold reset: # cat /sys/kernel/reboot/mode Switch boot mode to warm reset: # echo warm > /sys/kernel/reboot/mode - power-off: # halt Tested on AM62-LP-SK board. Signed-off-by: Jerome Neanne Suggested-by: Andrew Davis Reviewed-by: Andrew Davis Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230608071947.3467751-1-jneanne@baylibre.com commit 95100ed6ad4f0f74de2c4bb03618e57c896a7a89 Author: Johan Hovold Date: Fri May 26 11:16:46 2023 +0200 mfd: pm8008: Drop bogus i2c module alias Prior to commit af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF") drivers using OF matching needed an i2c module alias such as "i2c:pm8008" for module autoloading to work. Drop the bogus i2c alias from the pm8008 driver which was merged long after i2c core was fixed and whose alias did not match the driver name ("pm8008") to begin with. Signed-off-by: Johan Hovold Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230526091646.17318-3-johan+linaro@kernel.org commit d420c9886f5369697047b880221789bf0054e438 Author: Johan Hovold Date: Fri May 26 11:16:45 2023 +0200 mfd: pm8008: Fix module autoloading Add the missing module device table alias to that the driver can be autoloaded when built as a module. Cc: stable@vger.kernel.org # 5.14 Fixes: 6b149f3310a4 ("mfd: pm8008: Add driver for QCOM PM8008 PMIC") Signed-off-by: Johan Hovold Reviewed-by: Konrad Dybcio Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230526091646.17318-2-johan+linaro@kernel.org commit 29e92d8ea8e9410c10f2ebdc4abf679be0ff099c Author: Jerome Neanne Date: Wed Jun 7 16:39:32 2023 +0200 mfd: tps65219: Add GPIO cell instance TPS65219 PMIC GPIOs are exposed in a standard way: gpiodetect gpiochip0 [tps65219-gpio] (3 lines) tps65219-gpios is incorrect cell name (plural). Changed to tps65219-gpio (singular) Co-developed-by: Jonathan Cormier Signed-off-by: Jonathan Cormier Reviewed-by: Linus Walleij Signed-off-by: Jerome Neanne Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230511-tps65219-add-gpio-support-v5-2-ebb94281c854@baylibre.com commit a5f00e38eeb41f2f976f037d36b6bf3ee5afdb15 Author: Julien Panis Date: Thu May 11 11:51:21 2023 +0200 dt-bindings: mfd: Add TI TPS6594 PMIC TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine) managing the state of the device. TPS6594 is the super-set device while TPS6593 and LP8764 are derivatives. Signed-off-by: Julien Panis Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230511095126.105104-2-jpanis@baylibre.com commit cc5f2eb7ce1190c163d309146fe236e2fa2e6c68 Author: Dan Carpenter Date: Thu May 25 12:03:45 2023 +0300 mfd: tps6594: Fix an error code in probe() These error paths accidentally return success when they should return -EINVAL. Fixes: 325bec7157b3 ("mfd: tps6594: Add driver for TI TPS6594 PMIC") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/49f7cd8f-f7eb-40f1-91e8-291620c684df@kili.mountain Signed-off-by: Lee Jones commit 4b506480f6d9d3f0d2a170aec048530a3ba4ffa4 Author: Pascal Paillet Date: Tue May 23 09:42:06 2023 +0200 dt-bindings: mfd: Add vref_ddr supply for STPMIC1 Add vref_ddr supply description for the STPMIC1. Signed-off-by: Pascal Paillet Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230523074206.201962-1-p.paillet@foss.st.com Signed-off-by: Lee Jones commit 26e4462d7c13f180c48a689377b978ec7700a3ba Author: Christophe JAILLET Date: Sat May 20 09:11:05 2023 +0200 mfd: wcd934x: Simplify with dev_err_probe() Use dev_err_probe() to simplify code, save a few LoC and be consistent with error codes handling in messages. It also filters -EPROBE_DEFER that can be returned by devm_clk_get(). Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/73fdc6ecf619f80fad126abca11fb579d3d87f64.1684565021.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones commit f190b4891a3f9fac123a7afd378d4143a2723313 Author: Christophe JAILLET Date: Sat May 20 09:10:54 2023 +0200 mfd: wcd934x: Fix an error handling path in wcd934x_slim_probe() If devm_gpiod_get_optional() fails, some resources need to be released, as already done in the .remove() function. While at it, remove the unneeded error code from a dev_err_probe() call. It is already added in a human readable way by dev_err_probe() itself. Fixes: 6a0ee2a61a31 ("mfd: wcd934x: Replace legacy gpio interface for gpiod") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/02d8447f6d1df52cc8357aae698152e9a9be67c6.1684565021.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones commit 8f3ef556f8e1a670895f59ef3f01e4e26edd63e3 Author: Dario Binacchi Date: Sun Apr 23 19:25:25 2023 +0200 dt-bindings: mfd: stm32f7: Add binding definition for CAN3 Add binding definition for CAN3 peripheral. Signed-off-by: Dario Binacchi Link: https://lore.kernel.org/r/20230423172528.1398158-2-dario.binacchi@amarulasolutions.com Signed-off-by: Lee Jones commit 9ef18aa8c0ab5f7824b8380536501859af61265d Author: Arnd Bergmann Date: Tue May 16 22:27:42 2023 +0200 mfd: intel-lpss: Hide suspend/resume functions in #ifdef When CONFIG_PM is disabled, the prototypes for these two functions are not visible: drivers/mfd/intel-lpss.c:482:5: error: no previous prototype for 'intel_lpss_suspend' [-Werror=missing-prototypes] 482 | int intel_lpss_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~ drivers/mfd/intel-lpss.c:503:5: error: no previous prototype for 'intel_lpss_resume' [-Werror=missing-prototypes] 503 | int intel_lpss_resume(struct device *dev) Add the same #ifdef around the definition of the unused functions, which avoids the warning and slightly reduces the code size. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230516202746.561111-1-arnd@kernel.org Signed-off-by: Lee Jones commit e83152a8fae9c36b3ab1886bb9576c4c910269a9 Author: Aidan MacDonald Date: Thu May 11 10:26:09 2023 +0100 dt-bindings: mfd: Add bindings for AXP192 MFD device The AXP192 PMIC is similar to the AXP202/AXP209, but with different regulators, additional GPIOs, and a different IRQ register layout, so it needs a new compatible string. Signed-off-by: Aidan MacDonald Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230511092609.76183-2-aidanmacdonald.0x0@gmail.com Signed-off-by: Lee Jones commit 63eeabbc9dbddd7381409feccd9082e5ffabfe59 Author: Aidan MacDonald Date: Thu May 11 10:26:08 2023 +0100 mfd: axp20x: Add support for AXP192 The AXP192 PMIC is similar to the AXP202/AXP209, but with different regulators, additional GPIOs, and a different IRQ register layout. Signed-off-by: Aidan MacDonald Link: https://lore.kernel.org/r/20230511092609.76183-1-aidanmacdonald.0x0@gmail.com Signed-off-by: Lee Jones commit 35d5ebfa95d8a5e131463b597dbd235df70f751c Author: Lee Jones Date: Wed May 17 15:14:18 2023 +0100 mailmap: Add some mail mappings for Lee Jones Prevent mails from being sent to old and unmonitored inboxes. Signed-off-by: Lee Jones commit 76b4a24d0c0274917679913e5d0bccc15e89974c Author: Abel Vesa Date: Wed May 10 11:27:25 2023 +0300 dt-bindings: mfd: qcom,spmi-pmic: Add pattern property for phy The phy pattern property will be used for providing eUSB2 repeater functionality. This will be modelled as a Qualcomm PHY driver. Signed-off-by: Abel Vesa Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230510082725.3612903-1-abel.vesa@linaro.org Signed-off-by: Lee Jones commit 9816d859239f6d037fef168bdfa1ea1c12e3a76e Author: Uwe Kleine-König Date: Mon May 15 20:27:52 2023 +0200 mfd: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230515182752.10050-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones commit 0c5dc500abf81e296959b289e72ac7f38fd8c087 Author: Guiting Shen Date: Tue Apr 25 10:45:26 2023 +0800 mfd: Remove redundant dev_set_drvdata() from I2C drivers the i2c_set_clientdata() is the inline function which is complemented by the dev_set_drvdata() internally. Do not need to use i2c_set_clientdata() and dev_set_drvdata() at the same time. Signed-off-by: Guiting Shen Reviewed-by: Johan Hovold Reviewed-by: Charles Keepax Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230425024526.6443-1-aarongt.shen@gmail.com commit df2aac1573b57cde4475b587fbb22e1256080bac Author: Christophe JAILLET Date: Mon Apr 24 08:48:12 2023 +0200 mfd: dln2: Remove the unneeded include This driver does not use i2c, so there is no point in including Remove it. Signed-off-by: Christophe JAILLET Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/baf28e7f0fb57e918b76eaa92b94a2ae1a02cce0.1682318879.git.christophe.jaillet@wanadoo.fr commit bab5ab476190db987c54368cea4a220d9b9453e8 Author: Christophe JAILLET Date: Mon Apr 24 08:56:34 2023 +0200 mfd: rc5t583-irq: Remove the unneeded include This driver does not use i2c, so there is no point in including Remove it and add the needed instead, which is much more lightweight. Signed-off-by: Christophe JAILLET Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/128025bf5b81f5424db2202b0c8cfd9722c28aab.1682319383.git.christophe.jaillet@wanadoo.fr commit 7ef47a12a62e8fcf1b66a401cd6f3fc055581da0 Author: Mark Brown Date: Tue Apr 25 19:03:33 2023 +0100 mfd: wm831x: Use maple tree register cache regmap has introduced a maple tree based register cache which makes use of this more advanced data structure which has been added to the kernel recently. Maple trees are much flatter than rbtrees, meaning that they do not grow to such depths when the register map is sparse which makes access a bit more efficient. The maple tree cache type is still a bit of a work in progress but should be effective for some devices already. The wm831x devices have a pretty sparse register map and being always on devices never do cache syncs so don't hit the major current disadvantage so they should be good candiates for using the maple tree cache. Update to do so, there should be little if any visible difference at runtime. Signed-off-by: Mark Brown Reviewed-by: Charles Keepax Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230419-mfd-wm831x-maple-v1-1-e03e39d7bb0b@kernel.org commit 867cae44f8ae150d0e303cfd62a01d0d7cd7f7a5 Author: Ilpo Järvinen Date: Mon Apr 17 12:26:53 2023 +0300 mfd: intel-m10-bmc: Manage access to MAX 10 fw handshake registers On some MAX 10 cards, the BMC firmware is not available to service handshake registers during secure update erase and write phases at normal speeds. This problem affects at least hwmon driver. When the MAX 10 hwmon driver tries to read the sensor values during a secure update, the reads are slowed down (e.g., reading all D5005 sensors takes ~24s which is magnitudes worse than the normal <0.02s). Manage access to the handshake registers using a rw semaphore and a FW state variable to prevent accesses during those secure update phases and return -EBUSY instead. If handshake_sys_reg_nranges == 0, don't update bwcfw_state as it is not used. This avoids the locking cost. Co-developed-by: Russ Weight Signed-off-by: Russ Weight Co-developed-by: Xu Yilun Signed-off-by: Xu Yilun Signed-off-by: Ilpo Järvinen Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230417092653.16487-5-ilpo.jarvinen@linux.intel.com commit e9c154eed8aa166330eb0a8dc84642a8675c31e6 Author: Ilpo Järvinen Date: Mon Apr 17 12:26:52 2023 +0300 mfd: intel-m10-bmc: Move m10bmc_sys_read() away from header Move m10bmc_sys_read() out from the header to prepare it for adding more code into the function which would make it too large to be a static inline any more. While at it, replace the vague wording in function comment with more precise statements. Reviewed-by: Russ Weight Acked-by: Guenter Roeck # For hwmon Signed-off-by: Ilpo Järvinen Reviewed-by: Xu Yilun Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230417092653.16487-4-ilpo.jarvinen@linux.intel.com commit c452e3bd91b30a8ef7889fa06a50f54158c720d6 Author: Ilpo Järvinen Date: Mon Apr 17 12:26:51 2023 +0300 mfd: intel-m10-bmc: Create m10bmc_sys_update_bits() Wrap regmap_update_bits() with m10bmc_sys_update_bits() in order to be able to add additional checks into it. Co-developed-by: Russ Weight Signed-off-by: Russ Weight Signed-off-by: Ilpo Järvinen Reviewed-by: Xu Yilun Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230417092653.16487-3-ilpo.jarvinen@linux.intel.com commit b3ecc7f3830ab628a7799c7667d69613e0de4dd8 Author: Ilpo Järvinen Date: Mon Apr 17 12:26:50 2023 +0300 mfd: intel-m10-bmc: Move core symbols to own namespace Create INTEL_M10_BMC_CORE namespace for symbols exported by intel-m10-bmc-core. Reviewed-by: Russ Weight Signed-off-by: Ilpo Järvinen Reviewed-by: Xu Yilun Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230417092653.16487-2-ilpo.jarvinen@linux.intel.com commit 425f6a45769daa4d4388e2abca3089bb9f0f7000 Merge: 924764aa5f2e7 325bec7157b38 49f661ba99324 75c8cb2f4cb21 d99df65728bdd Author: Lee Jones Date: Thu Jun 15 09:18:54 2023 +0100 Merge branches 'tb-mfd-clk-input-pinctrl-power-rtc-sound-6.5', 'ib-mfd-tps6594-core-6.5', 'ib-mfd-regulator-max5970-6.5', 'ib-mfd-regulator-6.5' and 'ib-mfd-power-6.5' into ibs-for-mfd-merged commit ed3c9a2fcab3b60b0766eb5d7566fd3b10df9a8e Author: Jakub Kicinski Date: Tue Jun 13 13:50:06 2023 -0700 net: tls: make the offload check helper take skb not socket All callers of tls_is_sk_tx_device_offloaded() currently do an equivalent of: if (skb->sk && tls_is_skb_tx_device_offloaded(skb->sk)) Have the helper accept skb and do the skb->sk check locally. Two drivers have local static inlines with similar wrappers already. While at it change the ifdef condition to TLS_DEVICE. Only TLS_DEVICE selects SOCK_VALIDATE_XMIT, so the two are equivalent. This makes removing the duplicated IS_ENABLED() check in funeth more obviously correct. Signed-off-by: Jakub Kicinski Acked-by: Maxim Mikityanskiy Reviewed-by: Simon Horman Acked-by: Tariq Toukan Acked-by: Dimitris Michailidis Signed-off-by: David S. Miller commit cad1e15804a83afd9a5c1d95a428d60d1f9c0340 Author: Andreas Gruenbacher Date: Mon Nov 21 23:09:38 2022 +0100 gfs2: Rename SDF_{FS_FROZEN => FREEZE_INITIATOR} Rename the SDF_FS_FROZEN flag to SDF_FREEZE_INITIATOR to indicate more clearly that the node that has this flag set is the initiator of the freeze. Signed-off-by: Andreas Gruenbacher Date: Thu Nov 17 11:53:07 2022 +0100 gfs2: Reconfiguring frozen filesystem already rejected Reconfiguring a frozen filesystem is already rejected in reconfigure_super(), so there is no need to check for that condition again at the filesystem level. Signed-off-by: Andreas Gruenbacher commit e392edd5d52a6742595ecaf8270c1af3e96b9a38 Author: Andreas Gruenbacher Date: Mon Nov 14 18:26:00 2022 +0100 gfs2: Rename gfs2_freeze_lock{ => _shared } Rename gfs2_freeze_lock to gfs2_freeze_lock_shared to make it a bit more obvious that this function establishes the "thawed" state of the freeze glock. Signed-off-by: Andreas Gruenbacher commit 097cca525adf10f35c9dac037155564f1b1a688b Author: Andreas Gruenbacher Date: Mon Nov 14 16:40:15 2022 +0100 gfs2: Rename the {freeze,thaw}_super callbacks Rename gfs2_freeze to gfs2_freeze_super and gfs2_unfreeze to gfs2_thaw_super to match the names of the corresponding super operations. Signed-off-by: Andreas Gruenbacher commit af1abe11466f1a6cb6ba22ee0d815c21c3559947 Author: Andreas Gruenbacher Date: Wed Nov 16 14:19:06 2022 +0100 gfs2: Rename remaining "transaction" glock references The transaction glock was repurposed to serve as the new freeze glock years ago. Don't refer to it as the transaction glock anymore. Also, to be more precise, call it the "freeze glock" instead of the "freeze lock". Ditto for the journal glock. Signed-off-by: Andreas Gruenbacher commit 3b79104f80036231a40ba5d15c3e329985029a0f Author: Hao Zhang Date: Fri Jun 2 16:41:49 2023 +0800 Documentation: trace: Add documentation for Coresight Dummy Trace Add documentation for Coresight Dummy Trace under trace/coresight. Reviewed-by: Bagas Sanjaya Signed-off-by: Hao Zhang Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230602084149.40031-4-quic_hazha@quicinc.com commit 5911ff4559e45532c1f67257c5731b5e13f5e7a3 Author: Hao Zhang Date: Fri Jun 2 16:41:48 2023 +0800 dt-bindings: arm: Add support for Coresight dummy trace This patch add support for Coresight dummy source and dummy sink trace. Signed-off-by: Hao Zhang Reviewed-by: Rob Herring Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230602084149.40031-3-quic_hazha@quicinc.com commit 9d3ba0b6c056918355cf36094d6ed63cdd01a2ab Author: Hao Zhang Date: Fri Jun 2 16:41:47 2023 +0800 Coresight: Add coresight dummy driver Some Coresight devices that kernel don't have permission to access or configure. For these devices, a dummy driver is needed to register them as Coresight devices. The module may also be used to define components that may not have any programming interfaces, so that paths can be created in the driver. It provides Coresight API for operations on dummy devices, such as enabling and disabling them. It also provides the Coresight dummy sink/source paths for debugging. Signed-off-by: Hao Zhang Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230602084149.40031-2-quic_hazha@quicinc.com commit 5bc9a34ce87bee0ca53b86ff1a5ca340a62c2117 Author: Dmitry Antipov Date: Wed Jun 14 11:15:55 2023 +0300 wifi: rtw89: fix spelling typo of IQK debug messages Fix spelling typo of IQK debug messages. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230614081555.91395-3-dmantipov@yandex.ru commit 686317a246cd10e343f8ca519a54e6a51a3eb142 Author: Dmitry Antipov Date: Wed Jun 14 11:15:54 2023 +0300 wifi: rtw89: cleanup rtw89_iqk_info and related code Drop useless '_iqk_track()' and 'rtw8852a_iqk_track()' (they just change 'thermal_rek_en' field which is set but unused and so removed as well) functions, set but unused 'kcount' field of 'struct rtw89_iqk_info', and convert 'thermal' to local variables where appropriate (it doesn't need to have longer storage duration because it is actually used for the debugging purposes only). Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230614081555.91395-2-dmantipov@yandex.ru commit 65a9140e38b6f3318af90860ab0128a47996aaa9 Author: Dmitry Antipov Date: Wed Jun 14 11:15:53 2023 +0300 wifi: rtw89: cleanup private data structures Remove a bunch of unused (and set but unused) fields from 'struct rtw89_btc_wl_nhm', 'struct rtw89_dle_info', 'struct rtw89_hal' and 'struct rtw89_env_monitor_info' driver-specific data structures, adjust related bits. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230614081555.91395-1-dmantipov@yandex.ru commit 7edbd53a58a86c1d389e474a4f318cf2fdffa5ce Author: Azeem Shaikh Date: Tue Jun 13 00:34:57 2023 +0000 wifi: mt7601u: replace strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since DEV_ASSIGN is only used by TRACE macros and the return values are ignored. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230613003458.3538812-1-azeemshaikh38@gmail.com commit 52818fce28b216ef90edbb2b8e134534cf6364c6 Author: Deming Wang Date: Mon Jun 12 07:46:12 2023 -0400 wifi: rt2x00: fix the typo in comments Fix typo in the description of 'non-succesfull'. Signed-off-by: Deming Wang Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230612114612.1640-1-wangdeming@inspur.com commit 580b7fe5fcc430a38a0b073dbab2f94533a7ae89 Merge: 473f5e13b38b9 cae4bc06b3e41 Author: David S. Miller Date: Thu Jun 15 08:45:29 2023 +0100 Merge branch 'macb-partial-store-and-forward' Pranavi Somisetty says: ==================== Add support for partial store and forward Add support for partial store and forward mode in Cadence MACB. Link for v1: https://lore.kernel.org/all/20221213121245.13981-1-pranavi.somisetty@amd.com/ Changes v2: 1. Removed all the changes related to validating FCS when Rx checksum offload is disabled. 2. Instead of using a platform dependent number (0xFFF) for the reset value of rx watermark, derive it from designcfg_debug2 register. 3. Added a check to see if partial s/f is supported, by reading the designcfg_debug6 register. 4. Added devicetree bindings for "rx-watermark" property. Link for v2: https://lore.kernel.org/all/20230511071214.18611-1-pranavi.somisetty@amd.com/ Changes v3: 1. Fixed DT schema error: "scalar properties shouldn't have array keywords" 2. Modified description of rx-watermark in to include units of the watermark value 3. Modified the DT property name corresponding to rx_watermark in pbuf_rxcutthru to "cdns,rx-watermark". 4. Followed reverse christmas tree pattern in declaring variables. 5. Return -EINVAL when an invalid watermark value is set. 6. Removed netdev_info when partial store and forward is not enabled. 7. Validating the rx-watermark value in probe itself and only write to the register in init. 8. Writing a reset value to the pbuf_cuthru register before disabing partial store and forward is redundant. So removing it. 9. Removed the platform caps flag. 10. Instead of reading rx-watermark from DT in macb_configure_caps, reading it in probe. 11. Changed Signed-Off-By and author names on the macb driver patch. Link for v3: https://lore.kernel.org/all/20230530095138.1302-1-pranavi.somisetty@amd.com/ Changes v4: 1. Modified description for "rx-watermark" property in the DT bindings. 2. Changed the width of the rx-watermark property to uint32. 3. Removed redundant code and unused variables. 4. When the rx-watermark value is invalid, instead of returning EINVAL, do not enable partial store and forward. ==================== Signed-off-by: David S. Miller commit cae4bc06b3e41bc6dfd7116a45c1006e50ffe153 Author: Maulik Jodhani Date: Mon Jun 12 23:43:40 2023 -0600 net: macb: Add support for partial store and forward When the receive partial store and forward mode is activated, the receiver will only begin to forward the packet to the external AHB or AXI slave when enough packet data is stored in the packet buffer. The amount of packet data required to activate the forwarding process is programmable via watermark registers which are located at the same address as the partial store and forward enable bits. Adding support to read this rx-watermark value from device-tree, to program the watermark registers and enable partial store and forwarding. Signed-off-by: Maulik Jodhani Signed-off-by: Pranavi Somisetty Reviewed-by: Claudiu Beznea Signed-off-by: David S. Miller commit 5b32c61a2dac17db3f87c65cada74c9d7f31f4fb Author: Pranavi Somisetty Date: Mon Jun 12 23:43:39 2023 -0600 dt-bindings: net: cdns,macb: Add rx-watermark property watermark value is the minimum amount of packet data required to activate the forwarding process. The watermark implementation and maximum size is dependent on the device where Cadence MACB/GEM is used. Signed-off-by: Pranavi Somisetty Signed-off-by: David S. Miller commit 797a1d894d7b7586f422cabf8d7807cd39d0b5aa Author: Jeff Layton Date: Mon Jun 12 06:45:19 2023 -0400 autofs: set ctime as well when mtime changes on a dir When adding entries to a directory, POSIX generally requires that the ctime also be updated alongside the mtime. Signed-off-by: Jeff Layton Acked-by: Ian Kent Message-Id: <20230612104524.17058-4-jlayton@kernel.org> Signed-off-by: Christian Brauner commit 33d8b5d7824c7175ed968b8e89e6db3566e9c177 Author: Wen Yang Date: Wed Jun 14 01:01:22 2023 +0800 eventfd: show the EFD_SEMAPHORE flag in fdinfo The EFD_SEMAPHORE flag should be displayed in fdinfo, as different value could affect the behavior of eventfd. Suggested-by: Christian Brauner Signed-off-by: Wen Yang Cc: Alexander Viro Cc: Jens Axboe Cc: Christian Brauner Cc: Christoph Hellwig Cc: Dylan Yudaken Cc: David Woodhouse Cc: Matthew Wilcox Cc: Eric Biggers Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Message-Id: Signed-off-by: Christian Brauner commit 5c075c5b8fc4ebc34aac188be4eccc238521eb6f Author: Fabio M. De Francesco Date: Fri Jun 9 16:59:37 2023 +0200 fs/aio: Stop allocating aio rings from HIGHMEM There is no need to allocate aio rings from HIGHMEM because of very little memory needed here. Therefore, use GFP_USER flag in find_or_create_page() and get rid of kmap*() mappings. Cc: Al Viro Cc: Ira Weiny Suggested-by: Matthew Wilcox Signed-off-by: Fabio M. De Francesco Reviewed-by: Ira Weiny Message-Id: <20230609145937.17610-1-fmdefrancesco@gmail.com> Signed-off-by: Christian Brauner commit 473f5e13b38b9533bd3ae0758418581eabf69b50 Merge: 89da780aa4c76 48eed027d3103 Author: David S. Miller Date: Thu Jun 15 08:21:12 2023 +0100 Merge branch 'netdev-tracking' Jakub Kicinski says: ==================== net: create device lookup API with reference tracking We still see dev_hold() / dev_put() calls without reference tracker getting added in new code. dev_get_by_name() / dev_get_by_index() seem to be one of the sources of those. Provide appropriate helpers. Allocating the tracker can obviously be done with an additional call to netdev_tracker_alloc(), but a single API feels cleaner. v2: - fix a dev_put() in ethtool v1: https://lore.kernel.org/all/20230609183207.1466075-1-kuba@kernel.org/ ==================== Signed-off-by: David S. Miller commit 48eed027d310326052655c5ac14588855663087b Author: Jakub Kicinski Date: Mon Jun 12 14:49:44 2023 -0700 netpoll: allocate netdev tracker right away Commit 5fa5ae605821 ("netpoll: add net device refcount tracker to struct netpoll") was part of one of the initial netdev tracker introduction patches. It added an explicit netdev_tracker_alloc() for netpoll, presumably because the flow of the function is somewhat odd. After most of the core networking stack was converted to use the tracking hold() variants, netpoll's call to old dev_hold() stands out a bit. np is allocated by the caller and ready to use, we can use netdev_hold() here, even tho np->ndev will only be set to ndev inside __netpoll_setup(). Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 70f7457ad6d655e65f1b93cbba2a519e4b11c946 Author: Jakub Kicinski Date: Mon Jun 12 14:49:43 2023 -0700 net: create device lookup API with reference tracking New users of dev_get_by_index() and dev_get_by_name() keep getting added and it would be nice to steer them towards the APIs with reference tracking. Add variants of those calls which allocate the reference tracker and use them in a couple of places. Signed-off-by: Jakub Kicinski Reviewed-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 6a8b7e80105416cc7324fda295608ea2d3f98862 Author: Jiapeng Chong Date: Tue Jun 13 09:18:53 2023 +0800 tee: optee: Use kmemdup() to replace kmalloc + memcpy Use kmemdup rather than duplicating its implementation. ./drivers/tee/optee/smc_abi.c:1542:12-19: WARNING opportunity for kmemdup. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5480 Signed-off-by: Jiapeng Chong Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit 79597c8bf64ca99eab385115743131d260339da5 Author: Su Hui Date: Thu Jun 15 10:17:32 2023 +0800 ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer smatch error: sound/pci/ac97/ac97_codec.c:2354 snd_ac97_mixer() error: we previously assumed 'rac97' could be null (see line 2072) remove redundant assignment, return error if rac97 is NULL. Fixes: da3cec35dd3c ("ALSA: Kill snd_assert() in sound/pci/*") Signed-off-by: Su Hui Link: https://lore.kernel.org/r/20230615021732.1972194-1-suhui@nfschina.com Signed-off-by: Takashi Iwai commit 95b4d23907f29de96f8757a43d16b7a440836ea1 Author: Dhruva Gole Date: Mon Apr 17 14:52:43 2023 +0530 arm64: defconfig: Enable UBIFS UBIFS is a file system for flash devices which works on top of UBI. Signed-off-by: Dhruva Gole Link: https://lore.kernel.org/r/20230417092243.967871-1-d-gole@ti.com Signed-off-by: Vignesh Raghavendra commit 94a58c5f131d7f0cf735af24574b7626aab77ab1 Author: Wadim Egorov Date: Thu May 4 16:01:42 2023 +0200 dt-bindings: arm: ti: Add bindings for PHYTEC AM62x based hardware Add devicetree bindings for AM62x based phyCORE-AM62 SoM and phyBOARD-Lyra RDK. Signed-off-by: Wadim Egorov Acked-by: Krzysztof Kozlowski Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230504140143.1425951-1-w.egorov@phytec.de Signed-off-by: Vignesh Raghavendra commit 4c3cdac1955a5274a42d915e98827ba0f136c286 Author: Nishanth Menon Date: Mon Apr 24 12:36:21 2023 -0500 arm64: dts: ti: k3-j7200-mcu-wakeup: Remove 0x unit address prefix from nodename unit-address should not use a 0x prefix. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230424173623.477577-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 4af0332876f945ea1784970727c231f2cfaa3b23 Author: Nishanth Menon Date: Thu Jun 1 13:31:47 2023 -0500 arm64: dts: ti: k3-j721e-som-p0: Enable wakeup_i2c0 and eeprom Enable wakeup_i2c and use un-used pinmux. While at it, describe the board detection eeprom present on the board. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230601183151.1000157-6-nm@ti.com Signed-off-by: Vignesh Raghavendra commit f049b541b81acd88133c2c2247d4fae6c33f1b99 Author: Nishanth Menon Date: Tue May 30 13:53:35 2023 -0500 arm64: dts: ti: k3-am64: Add ESM support Add Error Signaling Module (ESM) instances in MCU and MAIN domains. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230530185335.79942-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit a58eedd1d195f17418c327482a79de5b84bc5aa8 Author: Nishanth Menon Date: Tue May 30 13:53:34 2023 -0500 arm64: dts: ti: k3-am62: Add ESM support Add Error Signaling Module (ESM) instances in MCU and MAIN domains. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230530185335.79942-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit e3d1f2768853f375b87a1c6fc00501165ddae49d Author: Neha Malcom Francis Date: Thu May 4 13:35:26 2023 +0530 arm64: dts: ti: k3-j7200: Add ESM support Add address entry mapping ESM on J7200. Signed-off-by: Neha Malcom Francis Link: https://lore.kernel.org/r/20230504080526.133149-4-n-francis@ti.com Signed-off-by: Vignesh Raghavendra commit 19bfd51845d551c6f4e39969c13c6b8285b94d1c Author: Neha Malcom Francis Date: Thu May 4 13:35:25 2023 +0530 arm64: dts: ti: k3-j721e: Add ESM support Add address entry mapping ESM on J721E. Signed-off-by: Neha Malcom Francis Link: https://lore.kernel.org/r/20230504080526.133149-3-n-francis@ti.com Signed-off-by: Vignesh Raghavendra commit 444f312a73f789bb9f10bbb423f7ae6c3aa76198 Author: Neha Malcom Francis Date: Thu May 4 13:35:24 2023 +0530 dt-bindings: misc: esm: Add ESM support for TI K3 devices Document the binding for TI K3 ESM (Error Signaling Module) block. Signed-off-by: Neha Malcom Francis Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230504080526.133149-2-n-francis@ti.com Signed-off-by: Vignesh Raghavendra commit 9d0350e8a46cae9c77abef1c8193b01a39e64f71 Author: Nishanth Menon Date: Fri Jun 2 10:35:54 2023 -0500 arm64: dts: ti: k3-j721s2-som-p0: Enable wakeup_i2c0 and eeprom Enable wakeup_i2c and use un-used pinmux. While at it, describe the board detection eeprom present on the board. Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602153554.1571128-7-nm@ti.com Signed-off-by: Vignesh Raghavendra commit f5e9ee0b354ac5a02871959c4dad80acfc0fda6b Author: Nishanth Menon Date: Fri Jun 2 10:35:53 2023 -0500 arm64: dts: ti: k3-j721s2-common-proc-board: Add uart pinmux Define the wakeup uart pin-mux for completeness and add explicit muxing for mcu_uart0. This allows the device tree usage in bootloader and firmwares that can configure the same appropriately. Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602153554.1571128-6-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 7d9b3820d756584939ed6d5e4c010aa5927edcc8 Author: Nishanth Menon Date: Fri Jun 2 10:35:52 2023 -0500 arm64: dts: ti: k3-am68-sk-som: Enable wakeup_i2c0 and eeprom Enable wakeup_i2c. While at it, describe the board detection eeprom present on the board. Signed-off-by: Nishanth Menon Reviewed-by: Sinthu Raja Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602153554.1571128-5-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 4c8c2471c7b6230fc41cf839c7b2ead836e71a6c Author: Nishanth Menon Date: Fri Jun 2 10:35:51 2023 -0500 arm64: dts: ti: k3-am68-sk-base-board: Add uart pinmux Define the wakeup uart pin-mux for completeness and add explicit muxing for mcu_uart0. This allows the device tree usage in bootloader and firmwares that can configure the same appropriately. Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602153554.1571128-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 92fee724058d5272f1b1be7805fe3cdf0f561c8f Author: Sinthu Raja Date: Fri Jun 2 10:35:50 2023 -0500 arm64: dts: ti: k3-am68-sk-base-board: Add pinmux for RPi Header Add pinmux required to bring out the i2c and gpios on 40-pin RPi expansion header on the AM68 SK board. Signed-off-by: Sinthu Raja Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602153554.1571128-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 6bc829ceea4158c7aeb3a9e73d5c52634d78fb6f Author: Sinthu Raja Date: Fri Jun 2 10:35:49 2023 -0500 arm64: dts: ti: k3-j721s2: Fix wkup pinmux range The WKUP_PADCONFIG register region in J721S2 has multiple non-addressable regions, accordingly split the existing wkup_pmx region as follows to avoid the non-addressable regions and include the rest of valid WKUP_PADCONFIG registers. Also update references to old nodes with new ones. wkup_pmx0 -> 13 pins (WKUP_PADCONFIG 0 - 12) wkup_pmx1 -> 11 pins (WKUP_PADCONFIG 14 - 24) wkup_pmx2 -> 72 pins (WKUP_PADCONFIG 26 - 97) wkup_pmx3 -> 1 pin (WKUP_PADCONFIG 100) Fixes: b8545f9d3a54 ("arm64: dts: ti: Add initial support for J721S2 SoC") Cc: # 6.3 Signed-off-by: Sinthu Raja Signed-off-by: Thejasvi Konduru Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602153554.1571128-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 858dde8a3f56f0b7a0c217ac4abf56e34c34ae74 Author: Udit Kumar Date: Sun Jun 11 16:41:40 2023 +0530 arm64: dts: ti: k3-j7200: Drop SoC level aliases Aiases are defined at board level, so dropping from soc level Signed-off-by: Udit Kumar Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20230611111140.3189111-7-u-kumar1@ti.com Signed-off-by: Vignesh Raghavendra commit c4ba159fff90791956370ce93c130aadea87dbb6 Author: Udit Kumar Date: Sun Jun 11 16:41:39 2023 +0530 arm64: dts: ti: k3-j7200-common-proc-board: Define aliases at board level Define aliases at board level Signed-off-by: Udit Kumar Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20230611111140.3189111-6-u-kumar1@ti.com Signed-off-by: Vignesh Raghavendra commit 3709ea7f960ed77ac29af692c9e32351060400d9 Author: Udit Kumar Date: Sun Jun 11 16:41:38 2023 +0530 arm64: dts: ti: k3-j7200-common-proc-board: Add uart pinmux Add main, mcu, wakeup domain uart0 pin mux into common board file and it's reference to uart node. Signed-off-by: Udit Kumar Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20230611111140.3189111-5-u-kumar1@ti.com Signed-off-by: Vignesh Raghavendra commit 7f58e2b418d89f38f242b04da5a1dd93a2c514fd Author: Udit Kumar Date: Sun Jun 11 16:41:37 2023 +0530 arm64: dts: ti: k3-j7200-common-proc-board: remove duplicate main_i2c0 pin mux main_i2c0 pin mux was duplicated in som and common file. So removing duplicated node from common file. Signed-off-by: Udit Kumar Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20230611111140.3189111-4-u-kumar1@ti.com Signed-off-by: Vignesh Raghavendra commit 03612d384621ffe21c6d338de916251d1bfd84fa Author: Udit Kumar Date: Sun Jun 11 16:41:36 2023 +0530 arm64: dts: ti: k3-j7200: Configure pinctrl for timer IO pads There are timer IO pads in the MCU domain, and in the MAIN domain. These pads can be muxed for the related timers. There are timer IO control registers for input and output. The registers for CTRLMMR_TIMER*_CTRL and CTRLMMR_MCU_TIMER*_CTRL are used to control the input. The registers for CTCTRLMMR_TIMERIO*_CTRL and CTRLMMR_MCU_TIMERIO*_CTRL the output. The multiplexing is documented in TRM "5.1.2.3.1.4 Timer IO Muxing Control Registers" and "5.1.3.3.1.5 Timer IO Muxing Control Registers", and the CASCADE_EN bit is documented in TRM "12.6.3.1 Timers Overview". For chaining timers, the timer IO control registers also have a CASCADE_EN input bit in the CTRLMMR_TIMER*_CTRL in the registers. The CASCADE_EN bit muxes the previous timer output, or possibly and external TIMER_IO pad source, to the input clock of the selected timer instance for odd numered timers. For the even numbered timers, the CASCADE_EN bit does not do anything. The timer cascade input routing options are shown in TRM "Figure 12-3224. Timers Overview". For handling beyond multiplexing, the driver support for timer cascading should be likely be handled via the clock framework. The MCU timer controls are also marked as reserved for usage by the MCU firmware. Cc: Nishanth Menon Cc: Vignesh Raghavendra Cc: Tony Lindgren Reviewed-by: Tony Lindgren Signed-off-by: Udit Kumar Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20230611111140.3189111-3-u-kumar1@ti.com Signed-off-by: Vignesh Raghavendra commit c8a28ed4837ce03254e0941f4fbc8364b1e78543 Author: Udit Kumar Date: Sun Jun 11 16:41:35 2023 +0530 arm64: dts: ti: k3-j7200: Add general purpose timers There are 20 general purpose timers on j721e that can be used for things like PWM using pwm-omap-dmtimer driver. There are also additional ten timers in the MCU domain which are meant for MCU firmware usage and hence marked reserved by default. The odd numbered timers have the option of being cascaded to even timers to create a 64 bit non-atomic counter which is racy in simple usage, hence the clock muxes are explicitly setup to individual 32 bit counters driven off system crystal (HFOSC) as default. Signed-off-by: Udit Kumar Reviewed-by: Tony Lindgren Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20230611111140.3189111-2-u-kumar1@ti.com Signed-off-by: Vignesh Raghavendra commit 8be20986e0c54420e52048d20bdc31e3a8aec93f Author: Nishanth Menon Date: Thu Jun 1 13:31:51 2023 -0500 arm64: dts: ti: k3-j721e: Drop SoC level aliases Drop the SoC level aliases as these need to be done at board level. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230601183151.1000157-10-nm@ti.com Signed-off-by: Vignesh Raghavendra commit ff59580bf2580ec262098399aab03dfca537bec8 Author: Nishanth Menon Date: Thu Jun 1 13:31:50 2023 -0500 arm64: dts: ti: k3-j721e-common-proc-board: Define aliases at board level Define the aliases at the board level instead of using generic aliases at SoC level. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230601183151.1000157-9-nm@ti.com Signed-off-by: Vignesh Raghavendra commit d1a4304c149d1a26a912d532501ead42e5952501 Author: Nishanth Menon Date: Thu Jun 1 13:31:49 2023 -0500 arm64: dts: ti: k3-j721e-sk: Define aliases at board level Define the aliases at the board level instead of using generic aliases at SoC level. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230601183151.1000157-8-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 4c2c99026ca1525912b40cbc1b69306145ce7082 Author: Nishanth Menon Date: Thu Jun 1 13:31:48 2023 -0500 arm64: dts: ti: k3-j721e-beagleboneai64: Add wakeup_uart pinmux Define the wakeup uart pin-mux for completeness. This allows the device tree usage in bootloader and firmwares that can configure the same appropriately. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230601183151.1000157-7-nm@ti.com Signed-off-by: Vignesh Raghavendra commit b04b18ccb3d5c19c864c10f7cc7b014218aecb22 Author: Nishanth Menon Date: Thu Jun 1 13:31:47 2023 -0500 arm64: dts: ti: k3-j721e-som-p0: Enable wakeup_i2c0 and eeprom Enable wakeup_i2c and use un-used pinmux. While at it, describe the board detection eeprom present on the board. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230601183151.1000157-6-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 86718345b4d3c0d386b3f73ef43e7f72ff04cf4a Author: Nishanth Menon Date: Thu Jun 1 13:31:46 2023 -0500 arm64: dts: ti: j721e-common-proc-board: Add uart pinmux Explicitly define the pinmux rather than depend on bootloader configured pinmux for the platform. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230601183151.1000157-5-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 26efc8d1ad0cc14e2740d310935fa146b1fc5a58 Author: Nishanth Menon Date: Thu Jun 1 13:31:45 2023 -0500 arm64: dts: ti: j721e-som/common-proc-board: Add product links Add product links to get reference to schematics and design files Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230601183151.1000157-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 1b4b376c878b36d1a1c848ebc885487e4cad2546 Author: Nishanth Menon Date: Thu Jun 1 13:31:44 2023 -0500 arm64: dts: ti: k3-j721e-sk: Enable wakeup_i2c0 and eeprom Enable wakeup_i2c and use un-used pinmux. While at it, describe the board detection eeprom present on the board. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230601183151.1000157-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit acfb362a9c78d6708080cdd850b036225c78371b Author: Nishanth Menon Date: Thu Jun 1 13:31:43 2023 -0500 arm64: dts: ti: k3-j721e-sk: Add missing uart pinmuxes Rather than depend on the default pinmuxes, explicitly describe the pinmux Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230601183151.1000157-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 6b343136388fe1ef5837e45ab921705de76665ee Author: Andrew Davis Date: Thu Jun 1 13:49:33 2023 -0500 arm64: dts: ti: k3-am64: Use phandle to stdout UART node Using a phandle makes it clear which UART we are choosing without needing to resolve through an alias first. Especially useful for boards like the TI J721s2-EVM where the alias is "serial2" but it actually resolves to the 8th UART instance(main_uart8). Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230601184933.358731-2-afd@ti.com Signed-off-by: Vignesh Raghavendra commit 27f98f3eca7334fec668ec637ed5e0514458bba8 Author: Andrew Davis Date: Thu Jun 1 13:49:32 2023 -0500 arm64: dts: ti: k3-am64: Only set UART baud for used ports As the binding for "current-speed" states, this should only be used when the baud rate of an attached device cannot be detected. This is the case for our attached on-board USB-to-UART converter used for early kernel console. For all other unconnected/disabled ports this can be configured in userspace later, DT is not the place for device configuration, especially when there are already standard ways to set serial baud in userspace. Remove setting baud for all disabled serial ports and move setting it for the couple enabled ports down into the board files. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230601184933.358731-1-afd@ti.com Signed-off-by: Vignesh Raghavendra commit 0ec1a48d99ddd11c265f7f1b2573fb2c8e0db0ab Author: Dasnavis Sabiya Date: Fri Jun 2 16:49:37 2023 -0500 arm64: dts: ti: k3-am69-sk: Add pinmux for RPi Header Add pinmux required to bring out the i2c and gpios on 40 pin RPi expansion header on AM69 SK board. Signed-off-by: Dasnavis Sabiya Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602214937.2349545-9-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 08ae12b637507cd22fbcdb82521b8b8a5ae96222 Author: Nishanth Menon Date: Fri Jun 2 16:49:36 2023 -0500 arm64: dts: ti: k3-am69-sk: Enable wakeup_i2c0 and eeprom Enable wakeup_i2c and use un-used pinmux. While at it, describe the board detection eeprom present on the board. Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602214937.2349545-8-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 45299dd1991b496ddab5ab4a86d7ae601e0e4c7f Author: Nishanth Menon Date: Fri Jun 2 16:49:35 2023 -0500 arm64: dts: ti: k3-am69-sk: Add mcu and wakeup uarts Add wakeup and MCU uart. This allows the device tree usage in bootloader and firmwares that can configure the same appropriately. Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602214937.2349545-7-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 7b72bd25508de6a5eee2cb1679b9d4b8bc25de5a Author: Nishanth Menon Date: Fri Jun 2 16:49:34 2023 -0500 arm64: dts: ti: k3-am69-sk: Enable mcu network port Enable networking for NFS and basic networking functionality. Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602214937.2349545-6-nm@ti.com Signed-off-by: Vignesh Raghavendra commit b38c6ced4ec5b3f6260ff6cc2b71e8a3d8c897d7 Author: Nishanth Menon Date: Fri Jun 2 16:49:33 2023 -0500 arm64: dts: ti: k3-am69-sk: Fix main_i2c0 alias main_i2c0 is aliased as i2c0 which creates a problem for u-boot R5 SPL attempting to reuse the same definition in the common board detection logic as it looks for the first i2c instance as the bus on which to detect the eeprom to understand the board variant involved. Switch main_i2c0 to i2c3 alias allowing us to introduce wkup_i2c0 and potentially space for mcu_i2c instances in the gap for follow on patches. Fixes: 635fb18ba008 ("arch: arm64: dts: Add support for AM69 Starter Kit") Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602214937.2349545-5-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 5dfbd1debc8ce5123310265cd44b5d99d272b1fe Author: Nishanth Menon Date: Fri Jun 2 16:49:32 2023 -0500 arm64: dts: ti: k3-j784s4-evm: Enable wakeup_i2c0 and eeprom Enable wakeup_i2c and use un-used pinmux. While at it, describe the board detection eeprom present on the board. Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602214937.2349545-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 6fa5d37a2f34476613012789d4618c3dc6c68b35 Author: Nishanth Menon Date: Fri Jun 2 16:49:31 2023 -0500 arm64: dts: ti: k3-j784s4-evm: Add mcu and wakeup uarts Add wakeup and MCU uart. This allows the device tree usage in bootloader and firmwares that can configure the same appropriately. Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602214937.2349545-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 14462bd0b247d05070d48d0f02eb7ca2680ab7bd Author: Thejasvi Konduru Date: Wed May 3 14:01:43 2023 +0530 arm64: dts: ti: k3-j784s4: Fix wakeup pinmux range and pinctrl node offsets The wkup_pmx register region in j784s4 has multiple non-addressable regions, hence the existing wkup_pmx region is split as follows to avoid the non-addressable regions. The pinctrl node offsets are also corrected as per the newly split wkup_pmx* nodes. wkup_pmx0 -> 13 pins (WKUP_PADCONFIG 0 - 12) wkup_pmx1 -> 11 pins (WKUP_PADCONFIG 14 - 24) wkup_pmx2 -> 72 pins (WKUP_PADCONFIG 26 - 97) wkup_pmx3 -> 1 pin (WKUP_PADCONFIG 100) Fixes: 4664ebd8346a ("arm64: dts: ti: Add initial support for J784S4 SoC") Signed-off-by: Thejasvi Konduru Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20230503083143.32369-1-t-konduru@ti.com Signed-off-by: Vignesh Raghavendra commit c10a9df30e3401bd5a5ee43f1afd6c2b2ca75ad7 Author: Nishanth Menon Date: Fri Jun 2 16:49:30 2023 -0500 arm64: dts: ti: k3-j784s4-evm: Fix main_i2c0 alias main_i2c0 is aliased as i2c0 which creates a problem for u-boot R5 SPL attempting to reuse the same definition in the common board detection logic as it looks for the first i2c instance as the bus on which to detect the eeprom to understand the board variant involved. Switch main_i2c0 to i2c3 alias allowing us to introduce wkup_i2c0 and potentially space for mcu_i2c instances in the gap for follow on patches. Fixes: e20a06aca5c9 ("arm64: dts: ti: Add support for J784S4 EVM board") Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230602214937.2349545-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 1f36d0e8be3ae7717c801e954275fba6247b2f46 Author: Neha Malcom Francis Date: Mon Jun 5 16:34:43 2023 +0530 arm64: dts: ti: k3-j721s2: Change CPTS clock parent MAIN_PLL0 has a flag set in DM (Device Manager) that removes it's capability to re-initialise clock frequencies. CPTS and RGMII has MAIN_PLL3 as their parent which does not have this flag. While RGMII needs this reinitialisation to default frequency to be able to get 250MHz with its divider, CPTS can not get its required 200MHz with its divider. Thus, move CPTS clock parent on J721S2 from MAIN_PLL3_HSDIV1 to MAIN_PLL0_HSDIV6. (Note: even GTC will be moved from MAIN_PLL3 to MAIN_PLL0 in U-Boot side for the same reason) Signed-off-by: Neha Malcom Francis Link: https://lore.kernel.org/r/20230605110443.84568-1-n-francis@ti.com Signed-off-by: Vignesh Raghavendra commit 74428680d71a37e6ee458b6eccf085114e0e4167 Author: Dasnavis Sabiya Date: Mon Jun 5 23:15:51 2023 +0530 arm64: dts: ti: k3-am69-sk: Add eMMC mmc0 support Add support for eMMC card connected to main sdhci0 instance. Signed-off-by: Dasnavis Sabiya Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20230605174551.160262-1-sabiya.d@ti.com Signed-off-by: Vignesh Raghavendra commit 918ef215db22b18b75292b6e5bcb763ce27e0483 Author: Nishanth Menon Date: Tue Jun 6 13:22:20 2023 -0500 arm64: dts: ti: k3-am68-sk-base-board: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-15-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 9da060be7491cc67323b8f4386ebc4524eba5970 Author: Nishanth Menon Date: Tue Jun 6 13:22:19 2023 -0500 arm64: dts: ti: k3-am654-base-board: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-14-nm@ti.com Signed-off-by: Vignesh Raghavendra commit f722090aeb70ca67b5f5a37a39a26fca29664dce Author: Nishanth Menon Date: Tue Jun 6 13:22:18 2023 -0500 arm64: dts: ti: k3-am65-iot*: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Cc: Jan Kiszka Reviewed-by: Jan Kiszka Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-13-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 0e97d245633bffc0ae348c95f98a2af5b973811c Author: Nishanth Menon Date: Tue Jun 6 13:22:17 2023 -0500 arm64: dts: ti: k3-am64-sk: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-12-nm@ti.com Signed-off-by: Vignesh Raghavendra commit bb867df51d3b7f305222405c4e01373efc8866c7 Author: Nishanth Menon Date: Tue Jun 6 13:22:16 2023 -0500 arm64: dts: ti: k3-am64-evm: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-11-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 875aad10d219494bb0ef0880b1b4a33f99c98a13 Author: Nishanth Menon Date: Tue Jun 6 13:22:15 2023 -0500 arm64: dts: ti: k3-am625-sk: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-10-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 6a2baa853500d1bbe986f29aacce4a0c859bf017 Author: Nishanth Menon Date: Tue Jun 6 13:22:14 2023 -0500 arm64: dts: ti: k3-j721s2-common-proc-board: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-9-nm@ti.com Signed-off-by: Vignesh Raghavendra commit a6550e2547acbcd7b01ea26d447a437140df7c43 Author: Nishanth Menon Date: Tue Jun 6 13:22:13 2023 -0500 arm64: dts: ti: k3-j7200-som/common-proc-board: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-8-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 56ccd4b1eb52e153d557c7c7ae19f849e5d5c2e1 Author: Nishanth Menon Date: Tue Jun 6 13:22:12 2023 -0500 arm64: dts: ti: k3-am642-phyboard-electra-rdk: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Cc: Wadim Egorov Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-7-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 4a701c01e7ff96966fcf2cf9df0d3dd851197317 Author: Nishanth Menon Date: Tue Jun 6 13:22:11 2023 -0500 arm64: dts: ti: k3-j721e-beagleboneai64: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Cc: Robert Nelson Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-6-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 88875d4c70cabcb509e9836086fdf2064ef89468 Author: Nishanth Menon Date: Tue Jun 6 13:22:10 2023 -0500 arm64: dts: ti: k3-j721e-beagleboneai64: Move eeprom WP gpio pinctrl to eeprom node Move the eeprom WP GPIO mux configuration to be part of the eeprom node instead of the I2C node. Cc: Robert Nelson Suggested-by: Udit Kumar Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-5-nm@ti.com Signed-off-by: Vignesh Raghavendra commit d528c29fa7526adf7074fb166b99df7d5fd90670 Author: Nishanth Menon Date: Tue Jun 6 13:22:09 2023 -0500 arm64: dts: ti: k3-j721e-beagleboneai64: Move camera gpio pinctrl to gpio node Move the GPIO mux configuration needed for camera module to work to the GPIO node instead of the I2C node. Camera nodes are maintained as overlay files, but the common mux is always needed to ensure that camera probes fine and ensuring the mux is configured as part of the GPIO module allows for the multiple overlay files to be simpler. Cc: Robert Nelson Suggested-by: Udit Kumar Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 7335c987de3e4741908a032914bd3f2979898375 Author: Nishanth Menon Date: Tue Jun 6 13:22:08 2023 -0500 arm64: dts: ti: k3-j721e-som-p0/common-proc-board: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 12bf41da5c3a02a9a6f8059404ba97c39a8f1852 Author: Nishanth Menon Date: Tue Jun 6 13:22:07 2023 -0500 arm64: dts: ti: k3-j721e-sk: Fixup reference to phandles array When referring to array of phandles, using <> to separate the array entries is better notation as it makes potential errors with phandle and cell arguments easier to catch. Fix the outliers to be consistent with the rest of the usage. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230606182220.3661956-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 5a41bcff08f9c0705f4e6c576d168051a7b323be Author: Nishanth Menon Date: Wed May 31 16:32:15 2023 -0500 arm64: dts: ti: k3-j784s4: Configure pinctrl for timer IO There are timer IO pads in the MCU domain, and in the MAIN domain. These pads can be muxed for the related timers. The details of the multiplexing can be found in the register documentation and Technical Reference Manual[1]. These are similar to J721e/J7200, but have different mux capabilities. [1] http://www.ti.com/lit/zip/spruj52 Signed-off-by: Nishanth Menon Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230531213215.602395-7-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 833377cf858b24d45e658454bcb683dd9076b576 Author: Nishanth Menon Date: Wed May 31 16:32:14 2023 -0500 arm64: dts: ti: k3-j784s4: Add general purpose timers There are 20 general purpose timers on j784s4 that can be used for things like PWM using pwm-omap-dmtimer driver. There are also additional ten timers in the MCU domain which are meant for MCU firmware usage and hence marked reserved by default. Though the count is similar to J721e/J7200/j721s2, the device IDs and clocks used in j784s4 are different with the option of certain clocks having options of additional clock muxes. Since there is very minimal reuse, it is cleaner to integrate as part of SoC files itself. The defaults are configured for clocking the timers from system clock(HFOSC0). Signed-off-by: Nishanth Menon Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230531213215.602395-6-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 1ecc75be7bc522941261b5eb0c315b09098a47f4 Author: Nishanth Menon Date: Wed May 31 16:32:13 2023 -0500 arm64: dts: ti: k3-j721s2: Configure pinctrl for timer IO There are timer IO pads in the MCU domain, and in the MAIN domain. These pads can be muxed for the related timers. The details of the multiplexing can be found in the register documentation and Technical Reference Manual[1]. These are similar to J721e/J7200, but have different mux capabilities. [1] https://www.ti.com/lit/zip/spruj28 Signed-off-by: Nishanth Menon Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230531213215.602395-5-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 835d04422f9d4c232c060150e696075cd34e081a Author: Nishanth Menon Date: Wed May 31 16:32:12 2023 -0500 arm64: dts: ti: k3-j721s2: Add general purpose timers There are 20 general purpose timers on j721s2 that can be used for things like PWM using pwm-omap-dmtimer driver. There are also additional ten timers in the MCU domain which are meant for MCU firmware usage and hence marked reserved by default. Though the count is similar to J721e/J7200, the device IDs and clocks used in j721s2 are different with the option of certain clocks having options of additional clock muxes. Since there is very minimal reuse, it is cleaner to integrate as part of SoC files itself. The defaults are configured for clocking the timers from system clock(HFOSC0). Signed-off-by: Nishanth Menon Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230531213215.602395-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 72a44d1c473486582d1d6177404e2fa7adf531ac Author: Nishanth Menon Date: Wed May 31 16:32:11 2023 -0500 arm64: dts: ti: k3-j721e: Configure pinctrl for timer IO There are timer IO pads in the MCU domain, and in the MAIN domain. These pads can be muxed for the related timers. There are timer IO control registers for input and output. The registers for CTRLMMR_TIMER*_CTRL and CTRLMMR_MCU_TIMER*_CTRL are used to control the input. The registers for CTCTRLMMR_TIMERIO*_CTRL and CTRLMMR_MCU_TIMERIO*_CTRL the output. The multiplexing is documented in Technical Reference Manual[1] under "Timer IO Muxing Control Registers" and "Timer IO Muxing Control Registers", and the "Timers Overview" chapters. We do not expose the cascade_en bit due to the racy usage of independent 32 bit registers in-line with the timer instantiation in the device tree. The MCU timer controls are also marked as reserved for usage by the MCU firmware. [1] http://www.ti.com/lit/pdf/spruil1 Signed-off-by: Nishanth Menon Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230531213215.602395-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 7f209dd1267ce2a4a5f6a9e4571858fa2d2e588c Author: Nishanth Menon Date: Wed May 31 16:32:10 2023 -0500 arm64: dts: ti: k3-j721e: Add general purpose timers There are 20 general purpose timers on j721e that can be used for things like PWM using pwm-omap-dmtimer driver. There are also additional ten timers in the MCU domain which are meant for MCU firmware usage and hence marked reserved by default. The odd numbered timers have the option of being cascaded to even timers to create a 64 bit non-atomic counter which is racy in simple usage, hence the clock muxes are explicitly setup to individual 32 bit counters driven off system crystal (HFOSC) as default. These instantiation differs from J7200 and other SoCs with the device IDs and clocks involved for muxing. Signed-off-by: Nishanth Menon Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230531213215.602395-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 389ad7111ddd99a05c75bc7d4f480a0526761d06 Author: Nishanth Menon Date: Tue May 30 11:59:00 2023 -0500 arm64: dts: ti: k3-j784s4-mcu-wakeup: Add sa3_secproxy and mcu_sec_proxy Security Management Subsystem(SMS) has it's own unique secure proxy as part of Security Accelerator (SA3) module. This is used for communicating with ROM and for special usecases such as HSM operations. In addition MCU island has it's own secure proxy for usecases involving the MCU micro controllers. These are in addition to the one in the main domain DMSS subsystem that is used for general purpose communication. Describe the nodes for use with bootloaders and firmware that require these communication paths which uses interrupts to corresponding micro controller interrupt controller. Mark the node as disabled since these instances do not have interrupts routed to the main processor by default for a complete description of the node. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230530165900.47502-8-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 77f622cb8633c020a78cfb8b7d3d73ba3eaf0a44 Author: Nishanth Menon Date: Tue May 30 11:58:59 2023 -0500 arm64: dts: ti: k3-j721s2-mcu-wakeup: Add sa3_secproxy and mcu_sec_proxy Security Management Subsystem(SMS) has it's own unique secure proxy as part of Security Accelerator (SA3) module. This is used for communicating with ROM and for special usecases such as HSM operations. In addition MCU island has it's own secure proxy for usecases involving the MCU micro controllers. These are in addition to the one in the main domain DMSS subsystem that is used for general purpose communication. Describe the nodes for use with bootloaders and firmware that require these communication paths which uses interrupts to corresponding micro controller interrupt controller. Mark the node as disabled since these instances do not have interrupts routed to the main processor by default for a complete description of the node. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230530165900.47502-7-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 753904da7072646666fa17a5030ef2be871a385a Author: Nishanth Menon Date: Tue May 30 11:58:58 2023 -0500 arm64: dts: ti: k3-j721e-mcu: Add mcu_secproxy MCU domain has it's own secure proxy for communicating with ROM and for R5 micro controller firmware operations. This is in addition to the one in the main domain NAVSS subsystem that is used for general purpose communication. Describe the node for use with bootloaders and firmware that require this communication path which uses interrupts to corresponding micro controller interrupt controller. Mark the node as disabled since this instance does not have interrupts routed to the main processor by default for a complete description of the node. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230530165900.47502-6-nm@ti.com Signed-off-by: Vignesh Raghavendra commit c4e43f5aef9731c480789dcb044d261f894a102e Author: Nishanth Menon Date: Tue May 30 11:58:57 2023 -0500 arm64: dts: ti: k3-j7200-mcu: Add mcu_secproxy MCU domain has it's own secure proxy for communicating with ROM and for R5 micro controller firmware operations. This is in addition to the one in the main domain NAVSS subsystem that is used for general purpose communication. Describe the node for use with bootloaders and firmware that require this communication path which uses interrupts to corresponding micro controller interrupt controller. Mark the node as disabled since this instance does not have interrupts routed to the main processor by default for a complete description of the node. Signed-off-by: Nishanth Menon Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230530165900.47502-5-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 84debc33b529cae428f29b1eb21ccc05c8b47a16 Author: Nishanth Menon Date: Tue May 30 11:58:56 2023 -0500 arm64: dts: ti: k3-am65-mcu: Add mcu_secproxy MCU domain has it's own secure proxy for communicating with ROM and for R5 micro controller firmware operations. This is in addition to the one in the main domain NAVSS subsystem that is used for general purpose communication. Describe the node for use with bootloaders and firmware that require this communication path which uses interrupts to corresponding micro controller interrupt controller. Mark the node as disabled since this instance does not have interrupts routed to the main processor by default for a complete description of the node. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230530165900.47502-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit f7d3b11cacd1fc9596444e89209b80800d20ea22 Author: Nishanth Menon Date: Tue May 30 11:58:55 2023 -0500 arm64: dts: ti: k3-am62a-main: Add sa3_secproxy Security Management Subsystem(SMS) has it's own unique secure proxy as part of Security Accelerator (SA3) module. This is used for communicating with ROM and for special usecases such as HSM operations. This is in addition to the one in the main domain DMSS subsystem that is used for general purpose communication. Describe the node for use with bootloaders and firmware that require this communication path which uses interrupts to corresponding micro controller interrupt controller. Mark the node as disabled since this instance does not have interrupts routed to the main processor by default for a complete description of the node. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230530165900.47502-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 7450aa5153af55a0c63785a6917e35a989a4fdf5 Author: Nitin Yadav Date: Tue May 30 11:58:54 2023 -0500 arm64: dts: ti: k3-am62-main: Add sa3_secproxy Security Management Subsystem(SMS) has it's own unique secure proxy as part of Security Accelerator (SA3) module. This is used for communicating with ROM and for special usecases such as HSM operations. This is in addition to the one in the main domain DMSS subsystem that is used for general purpose communication. Describe the node for use with bootloaders and firmware that require this communication path which uses interrupts to corresponding micro controller interrupt controller. Mark the node as disabled since this instance does not have interrupts routed to the main processor by default for a complete description of the node. Signed-off-by: Nitin Yadav [nm@ti.com: Update commit message, minor updates] Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230530165900.47502-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 400f4953d53ccc07bb26bb6c9d425934ecab4aa8 Author: Nishanth Menon Date: Wed Jun 7 08:20:43 2023 -0500 arm64: dts: ti: k3-am65-iot2050-common: Rename rtc8564 nodename Just use "rtc" as the nodename to better match with the bindings. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230607132043.3932726-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 2b9bb988742d1794e78d4297a99658f38477eedd Author: Nishanth Menon Date: Wed Jun 7 08:20:42 2023 -0500 arm64: dts: ti: k3-am65-main: Drop deprecated ti,otap-del-sel property ti,otap-del-sel has been deprecated in favor of ti,otap-del-sel-legacy. Drop the duplicate and misleading ti,otap-del-sel property. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230607132043.3932726-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 498f7b0f9da9be6f6c099b4c8ffb502174623565 Author: Nishanth Menon Date: Wed Jun 7 08:20:41 2023 -0500 arm64: dts: ti: k3-am65-main: Fix mcan node name s/mcan/can to stay in sync with bindings conventions. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230607132043.3932726-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 9227c49a09b0cfb152a7824b69db46940db81ff3 Author: Vaishnav Achath Date: Sat May 13 19:47:11 2023 +0530 arm64: dts: ti: k3-am642-sk/evm: Describe OSPI flash partition info Describe OSPI flash partition information through device tree, this helps to remove passing partition information through the mtdparts commandline parameter which requires maintaining the partition information in a string format. AM64 SK and EVM has a S28 64 MiB OSPI flash with sector size of 256 KiB thus the size of the smallest partition is chosen as 256 KiB, the partition names and offsets are chosen according to the corresponding name and offsets in bootloader. Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20230513141712.27346-6-vaishnav.a@ti.com Signed-off-by: Vignesh Raghavendra commit c08cb9cef76abc6216347af8fd8452037b9795de Author: Vaishnav Achath Date: Sat May 13 19:47:10 2023 +0530 arm64: dts: ti: k3-am654-baseboard: Describe OSPI flash partition info Describe OSPI flash partition information through device tree, this helps to remove passing partition information through the mtdparts commandline parameter which requires maintaining the partition information in a string format. AM654 baseboard has a MT35XU512ABA 64 MiB OSPI flash with sector size of 128 KiB thus the size of the smallest partition is chosen as 128 KiB, the partition names and offsets are chosen according to the corresponding name and offsets in bootloader. Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20230513141712.27346-5-vaishnav.a@ti.com Signed-off-by: Vignesh Raghavendra commit 7f80deb0c6c779ee19996918962c8cad058efd10 Author: Vaishnav Achath Date: Sat May 13 19:47:09 2023 +0530 arm64: dts: ti: k3-j7200-som: Describe OSPI and Hyperflash partition info Describe OSPI and Hyperflash partition information through device tree, this helps to remove passing partition information through the mtdparts commandline parameter which requires maintaining the partition information in a string format. J7200 SoM has a S28 64 MiB OSPI flash with sector size of 256 KiB thus the size of the smallest partition is chosen as 256 KiB, the SoM also has a 64 MiB Hyperflash present on it, the partition names and offsets are chosen according to the corresponding name and offsets in bootloader. Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20230513141712.27346-4-vaishnav.a@ti.com Signed-off-by: Vignesh Raghavendra commit 2f1023d5f050e4b83b5e71fb9ad5a81e95e4123d Author: Vaishnav Achath Date: Sat May 13 19:47:08 2023 +0530 arm64: dts: ti: k3-j721e-sk: Describe OSPI flash partition info Describe OSPI flash partition information through device tree, this helps to remove passing partition information through the mtdparts commandline parameter which requires maintaining the partition information in a string format. J721E SK has a S28 64 MiB OSPI flash with sector size of 256 KiB thus the size of the smallest partition is chosen as 256 KiB, the partition names and offsets are chosen according to the corresponding name and offsets in bootloader. Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20230513141712.27346-3-vaishnav.a@ti.com Signed-off-by: Vignesh Raghavendra commit e96b5e98482354be3ef666704964f8c2ed6b6e8d Author: Vaishnav Achath Date: Sat May 13 19:47:07 2023 +0530 arm64: dts: ti: k3-j721e: Describe OSPI and QSPI flash partition info Describe OSPI and QSPI flash partition information through device tree, this helps to remove passing partition information through the mtdparts commandline parameter which requires maintaining the partition information in a string format. J721E SoM has a MT35 64 MiB OSPI flash and MT25 64 MiB QSPI flash both with sector size of 128 KiB thus the size of the smallest partition is chosen as 128KiB, the partition names and offsets are chosen according to the corresponding name and offsets in bootloader. Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20230513141712.27346-2-vaishnav.a@ti.com Signed-off-by: Vignesh Raghavendra commit 150ce1b10740c10f87e90e485bc279c205e3f731 Author: Apurva Nandan Date: Thu May 4 13:33:05 2023 +0530 arm64: dts: ti: k3-j784s4-evm: Add support for OSPI and QSPI flashes J784S4 has S28HS512T OSPI flash connected to OSPI0 and MT25QU512A QSPI flash connected to OSPI1, enable support for the same. Also describe the partition information according to the offsets in the bootloader. Co-developed-by: Vaishnav Achath Signed-off-by: Vaishnav Achath Signed-off-by: Apurva Nandan Link: https://lore.kernel.org/r/20230504080305.38986-3-a-nandan@ti.com Signed-off-by: Vignesh Raghavendra commit 8758109d135401c8afea0d0e3c51e7a52c843b7b Author: Apurva Nandan Date: Thu May 4 13:33:04 2023 +0530 arm64: dts: ti: k3-j784s4-mcu-wakeup: Add FSS OSPI0 and FSS OSPI1 TI K3 J784S4 has the Cadence OSPI controllers OSPI0 and OSPI1 on FSS bus for interfacing with OSPI flashes. Add the nodes to allow using SPI flashes. Signed-off-by: Apurva Nandan Link: https://lore.kernel.org/r/20230504080305.38986-2-a-nandan@ti.com Signed-off-by: Vignesh Raghavendra commit 2dc39c564982f2ca77a9589a3d9906ecaf5a42e4 Author: Wadim Egorov Date: Fri May 5 15:10:12 2023 +0200 arm64: dts: ti: Add LED controller to phyBOARD-Electra With commit 9f6ffd0da650 ("dt-bindings: leds: Convert PCA9532 to dtschema"), we can now add the LED controller without introducing new dtbs_check warnings. Add missing I2C LED controller. Signed-off-by: Wadim Egorov Link: https://lore.kernel.org/r/20230505131012.2027309-1-w.egorov@phytec.de Signed-off-by: Vignesh Raghavendra commit 58cd171af4d7e27525b1924b72100cba98d88d2a Author: Vaishnav Achath Date: Sat May 13 18:03:13 2023 +0530 arm64: dts: ti: k3-j721e-common-proc-board: Add OSPI/Hyperflash select pinmux J721E common processor board has an onboard mux for selecting whether the OSPI signals are externally routed to OSPI flash or Hyperflash. The mux state signal input is tied to WKUP_GPIO0_8 and is used by bootloader for enabling the corresponding node accordingly. Add pinmux for the same. Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20230513123313.11462-5-vaishnav.a@ti.com Signed-off-by: Vignesh Raghavendra commit be8be0d036b2fed1f705931ac3901077039b7496 Author: Vaishnav Achath Date: Sat May 13 18:03:12 2023 +0530 arm64: dts: ti: k3-j7200-common-proc-board: Add OSPI/Hyperflash select pinmux J7200 common processor board has an onboard mux for selecting whether the OSPI signals are externally routed to OSPI flash or Hyperflash. The mux state signal input is tied to WKUP_GPIO0_6 and is used by bootloader for enabling the corresponding node accordingly. Add pinmux for the same. Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20230513123313.11462-4-vaishnav.a@ti.com Signed-off-by: Vignesh Raghavendra commit 0979c0069cb669528d13818410de9f0dd41585f3 Author: Vaishnav Achath Date: Sat May 13 18:03:11 2023 +0530 arm64: dts: ti: k3-j721e-som-p0: Add HyperFlash node J721E SoM has a HyperFlash and HyperRam connected to HyperBus memory controller, add corresponding node, pinmux and partitions for the same. HyperBus is muxed with OSPI and only one controller can be active at a time, therefore keep HyperBus node disabled. Bootloader will detect the external mux state through a wkup gpio and enable the node as required. Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20230513123313.11462-3-vaishnav.a@ti.com Signed-off-by: Vignesh Raghavendra commit d93036b47f354b7acb95aad5c91e9becbe4e9f61 Author: Vaishnav Achath Date: Sat May 13 18:03:10 2023 +0530 arm64: dts: ti: k3-j721e-mcu-wakeup: Add HyperBus node J721E has a Flash SubSystem that has one OSPI and one HyperBus with muxed datapath and another independent OSPI. Add DT nodes for HyperBus controller and keep it disabled and model the data path selection mux as a reg-mux. Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20230513123313.11462-2-vaishnav.a@ti.com Signed-off-by: Vignesh Raghavendra commit b0efb45d126ee914bafca37a582ae6574560dd25 Author: Andrew Davis Date: Mon May 15 12:21:37 2023 -0500 arm64: dts: ti: k3-j721e: Enable MDIO nodes at the board level MDIO nodes defined in the top-level J721e SoC dtsi files are incomplete and will not be functional unless they are extended with a pinmux. As the attached PHY is only known about at the board integration level, these nodes should only be enabled when provided with this information. Disable the MDIO nodes in the dtsi files and only enable the ones that are actually pinned out on a given board. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230515172137.474626-5-afd@ti.com Signed-off-by: Vignesh Raghavendra commit 91f983ff7039fa2ff8ef153e118eec6d60f55e45 Author: Andrew Davis Date: Mon May 15 12:21:36 2023 -0500 arm64: dts: ti: k3-am64: Enable Mailbox nodes at the board level Mailbox nodes defined in the top-level AM64x SoC dtsi files are incomplete and may not be functional unless they are extended with a chosen interrupt and connection to a remote processor. As the remote processors depend on memory nodes which are only known at the board integration level, these nodes should only be enabled when provided with the above information. Disable the Mailbox nodes in the dtsi files and only enable the ones that are actually used on a given board. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230515172137.474626-4-afd@ti.com Signed-off-by: Vignesh Raghavendra commit 731c6deda85ffcac3629bea757a806306e335618 Author: Andrew Davis Date: Mon May 15 12:21:35 2023 -0500 arm64: dts: ti: k3-j721e: Enable PCIe nodes at the board level PCIe nodes defined in the top-level J721e SoC dtsi files are incomplete and will not be functional unless they are extended with a SerDes PHY. And usually only one of the two modes can be used at a time as they share a SerDes link. As the PHY and mode is only known at the board integration level, these nodes should only be enabled when provided with this information. Disable the PCIe nodes in the dtsi files and only enable the ones that are actually pinned out on a given board. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230515172137.474626-3-afd@ti.com Signed-off-by: Vignesh Raghavendra commit a0cfd88d4a8a1106e9de5c3b03e68efe9e6249ec Author: Andrew Davis Date: Mon May 15 12:21:34 2023 -0500 arm64: dts: ti: k3-j721e: Remove PCIe endpoint nodes These nodes are example nodes for the PCIe controller in "endpoint" mode. By default the controller is in "root complex" mode and there is already a DT node for the same. Examples should go in the bindings or other documentation. Remove this node. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230515172137.474626-2-afd@ti.com Signed-off-by: Vignesh Raghavendra commit 155e7635ed1f3814d94d12556a3a0fed41d05b76 Author: Andrew Davis Date: Mon May 15 12:21:33 2023 -0500 arm64: dts: ti: k3-j721e-beagleboneai64: Fix mailbox node status Mailbox nodes are now disabled by default. The BeagleBoard AI64 DT addition went in at around the same time and must have missed that change so the mailboxes are not re-enabled. Do that here. Fixes: fae14a1cb8dd ("arm64: dts: ti: Add k3-j721e-beagleboneai64") Signed-off-by: Andrew Davis Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20230515172137.474626-1-afd@ti.com Signed-off-by: Vignesh Raghavendra commit 426e720259c9e4066cafac9d4592cfbca4031b1d Author: Bhavya Kapoor Date: Tue May 2 14:38:14 2023 +0530 arm64: dts: ti: k3-j784s4-main: Enable support for high speed modes eMMC tuning was incomplete earlier, so support for high speed modes was kept disabled. Remove no-1-8-v property to enable support for high speed modes for eMMC in J784S4 SoC. Signed-off-by: Bhavya Kapoor Link: https://lore.kernel.org/r/20230502090814.144791-1-b-kapoor@ti.com Signed-off-by: Vignesh Raghavendra commit e99913ad58af3172343e3b22fa7a2a794d78b8c1 Author: Bhavya Kapoor Date: Tue May 2 13:41:17 2023 +0530 arm64: dts: ti: k3-j784s4-evm: Add pinmux information for ADC J784S4 has two instances of 8 channel ADCs in MCU domain. Add pinmux information for both ADC nodes. Signed-off-by: Bhavya Kapoor Link: https://lore.kernel.org/r/20230502081117.21431-3-b-kapoor@ti.com Signed-off-by: Vignesh Raghavendra commit ad5f7c514442a5eb29a415f75b3ea2744933e274 Author: Bhavya Kapoor Date: Tue May 2 13:41:16 2023 +0530 arm64: dts: ti: k3-j784s4-mcu-wakeup: Add support for ADC nodes J784S4 has two instances of 8 channel ADCs in MCU domain. Add support for both ADC nodes. Signed-off-by: Bhavya Kapoor Link: https://lore.kernel.org/r/20230502081117.21431-2-b-kapoor@ti.com Signed-off-by: Vignesh Raghavendra commit b8690ed3d1d16153be76f24de3a13797c9fd29b3 Author: Jyri Sarha Date: Tue May 9 15:53:53 2023 +0530 arm64: dts: ti: am65x: Add Rocktech OLDI panel DT overlay The OLDI-LCD1EVM add on board has Rocktech RK101II01D-CT panel[1] with integrated touch screen. The integrated touch screen is Goodix GT928. This panel connects with AM65 GP-EVM[2]. Add DT nodes for these and connect the endpoint nodes with DSS. [1]: Panel link https://www.digimax.it/en/tft-lcd/20881-RK101II01D-CT [2]: AM654 LCD EVM: https://www.ti.com/tool/TMDSLCD1EVM Signed-off-by: Jyri Sarha Signed-off-by: Nikhil Devshatwar [abhatia1@ti.com: Make cosmetic and 6.4 kernel DTSO syntax changes] Signed-off-by: Aradhya Bhatia Reviewed-by: Tomi Valkeinen Reviewed-by: Andrew Davis Link: https://lore.kernel.org/r/20230509102354.10116-2-a-bhatia1@ti.com Signed-off-by: Vignesh Raghavendra commit af398252d68edbeef3b1f8cbdf3867b70d2dbbe8 Author: Bhavya Kapoor Date: Mon Apr 24 15:08:27 2023 +0530 arm64: dts: ti: k3-j721e-main: Update delay select values for MMC subsystems Update the delay values for various speed modes supported, based on the revised august 2021 J721E Datasheet. [1] - Table 7-77. MMC0 DLL Delay Mapping for All Timing Modes and Table 7-86. MMC1/2 DLL Delay Mapping for All Timing Modes, in https://www.ti.com/lit/ds/symlink/tda4vm.pdf, (SPRSP36J – FEBRUARY 2019 – REVISED AUGUST 2021) Signed-off-by: Bhavya Kapoor Link: https://lore.kernel.org/r/20230424093827.1378602-1-b-kapoor@ti.com Signed-off-by: Vignesh Raghavendra commit 5cab8abaee22470523a5293994a52784360a7926 Author: Nishanth Menon Date: Tue Apr 18 16:37:40 2023 -0500 arm64: dts: ti: k3-am62x-sk-common: Improve documentation of mcasp1_pins Include documentation of the AMC package pin name as well to keep it consistent with the rest of the pinctrl documentation. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230418213740.153519-5-nm@ti.com Signed-off-by: Vignesh Raghavendra commit f40ed3b39b486ed8fbca7aa4a319c8d1d14ac97d Author: Nishanth Menon Date: Tue Apr 18 16:37:39 2023 -0500 arm64: dts: ti: k3-am62x-sk-common: Add eeprom Add board EEPROM support to device tree Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230418213740.153519-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 76194aba0c30b1ee25067b34235141443bd078fb Author: Nishanth Menon Date: Tue Apr 18 16:37:38 2023 -0500 arm64: dts: ti: k3-am62x-sk-common: Describe main_uart1 and wkup_uart wkup_uart and main_uart1 on this platform is used by tifs and DM firmwares. Describe them for completeness including the pinmux. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230418213740.153519-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 477d43f6d8546597e007a3a2ebd19f6e4e090fee Author: Nishanth Menon Date: Tue Apr 18 16:37:37 2023 -0500 arm64: dts: ti: k3-am62x-sk-common: Drop extra EoL Drop an extra EoL Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230418213740.153519-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 5e880618936229b85a185cef736c573b81ef0c9d Author: Nishanth Menon Date: Mon Apr 17 17:54:50 2023 -0500 arm64: dts: ti: k3: j721s2/j784s4: Switch to https links Looks like a couple of http:// links crept in. Use https instead. While at it, drop unicode encoded character. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230417225450.1182047-1-nm@ti.com Signed-off-by: Vignesh Raghavendra commit d148e3fe52c855b1709ed031eff6e63e87ad0372 Author: Keerthy Date: Wed Apr 5 16:53:28 2023 -0500 arm64: dts: ti: j721s2: Add VTM node VTM stands for Voltage Thermal Management. Add the thermal zones. Six sensors mapping to six thermal zones. Main0, Main1, Main2, Main3, WKUP1 & WKUP2 domains respectively. Signed-off-by: Keerthy [bb@ti.com: rebased on v6.3-rc1] Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20230405215328.3755561-8-bb@ti.com Signed-off-by: Vignesh Raghavendra commit 4aa6586a9720849527379c415d0977f0d5bcfcac Author: Keerthy Date: Wed Apr 5 16:53:27 2023 -0500 arm64: dts: ti: j7200: Add VTM node VTM stands for Voltage Thermal Management. Add the thermal zones. Three sensors mapping to 3 thermal zones. MCU, MPU & Main domains respectively. Signed-off-by: Keerthy [bb@ti.com: rebased on v6.3-rc1] Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20230405215328.3755561-7-bb@ti.com Signed-off-by: Vignesh Raghavendra commit 8fb4e87c55979c1f6691346205b884d1863ca6db Author: Keerthy Date: Wed Apr 5 16:53:26 2023 -0500 arm64: dts: ti: j721e: Add VTM node VTM stands for Voltage Thermal Management. Add the thermal zones. Five sensors mapping ton 5 thermal zones. WKUP, MPU, C7x, GPU & R5F respectively. Signed-off-by: Keerthy [bb@ti.com: rebased on v6.3-rc1] Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20230405215328.3755561-6-bb@ti.com Signed-off-by: Vignesh Raghavendra commit 89da780aa4c7667c8b1a144959206262aebdeabe Author: Xin Long Date: Mon Jun 12 11:55:34 2023 -0400 rtnetlink: move validate_linkmsg out of do_setlink This patch moves validate_linkmsg() out of do_setlink() to its callers and deletes the early validate_linkmsg() call in __rtnl_newlink(), so that it will not call validate_linkmsg() twice in either of the paths: - __rtnl_newlink() -> do_setlink() - __rtnl_newlink() -> rtnl_newlink_create() -> rtnl_create_link() Additionally, as validate_linkmsg() is now only called with a real dev, we can remove the NULL check for dev in validate_linkmsg(). Note that we moved validate_linkmsg() check to the places where it has not done any changes to the dev, as Jakub suggested. Signed-off-by: Xin Long Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/cf2ef061e08251faf9e8be25ff0d61150c030475.1686585334.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit 64821fbf67382951c5eae4e088df93f236c1ead6 Author: Keerthy Date: Wed Apr 5 16:53:25 2023 -0500 arm64: dts: ti: j784s4: Add VTM node VTM stands for Voltage Thermal Management. Add the thermal zones. Seven sensors mapping to seven thermal zones. Main0, Main1, Main2, Main3, Main4, WKUP1 & WKUP2 domains respectively. Signed-off-by: Keerthy [bb@ti.com: rebased on v6.3-rc1] Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20230405215328.3755561-5-bb@ti.com Signed-off-by: Vignesh Raghavendra commit 901bdf5ea1a836400ee69aa32b04e9c209271ec7 Merge: ba57b9b11f785 3b718dcaf163d Author: Dave Airlie Date: Thu Jun 15 14:11:22 2023 +1000 Merge tag 'amd-drm-next-6.5-2023-06-09' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.5-2023-06-02: amdgpu: - SR-IOV fixes - Warning fixes - Misc code cleanups and spelling fixes - DCN 3.2 updates - Improved DC FAMS support for better power management - Improved DC SubVP support for better power management - DCN 3.1.x fixes - Max IB size query - DC GPU reset fixes - RAS updates - DCN 3.0.x fixes - S/G display fixes - CP shadow buffer support - Implement connector force callback - Z8 power improvements - PSP 13.0.10 vbflash support - Mode2 reset fixes - Store MQDs in VRAM to improve queue switch latency - VCN 3.x fixes - JPEG 3.x fixes - Enable DC_FP on LoongArch - GFXOFF fixes - GC 9.4.3 partition support - SDMA 4.4.2 partition support - VCN/JPEG 4.0.3 partition support - VCN 4.0.3 updates - NBIO 7.9 updates - GC 9.4.3 updates - Take NUMA into account when allocating memory - Handle NUMA for partitions - SMU 13.0.6 updates - GC 9.4.3 RAS updates - Stop including unused swiotlb.h - SMU 13.0.7 fixes - Fix clock output ordering on some APUs - Clean up DC FPGA code - GFX9 preemption fixes - Misc irq fixes - S0ix fixes - Add new DRM_AMDGPU_WERROR config parameter to help with CI - PCIe fix for RDNA2 - kdoc fixes - Documentation updates amdkfd: - Query TTM mem limit rather than hardcoding it - GC 9.4.3 partition support - Handle NUMA for partitions radeon: - Fix possible double free - Stop including unused swiotlb.h - Fix possible division by zero ttm: - Add query for TTM mem limit - Add NUMA awareness to pools - Export ttm_pool_fini() UAPI: - Add new ctx query flag to better handle GPU resets Mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22290 - Add new interface to query and set shadow buffer for RDNA3 Mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21986 - Add new INFO query for max IB size Proposed userspace: https://gitlab.freedesktop.org/bnieuwenhuizen/mesa/-/commits/ib-rejection-v3 amd-drm-next-6.5-2023-06-09: amdgpu: - S0ix fixes - Initial SMU13 Overdrive support - kdoc fixes - Misc clode cleanups - Flexible array fixes - Display OTG fixes - SMU 13.0.6 updates - Revert some broken clock counter updates - Misc display fixes - GFX9 preemption fixes - Add support for newer EEPROM bad page table format - Add missing radeon secondary id - Add support for new colorspace KMS API - CSA fix - Stable pstate fixes for APUs - make vbl interface admin only - Handle PCI accelerator class amdkfd: - Add debugger support for gdb radeon: - Fix possible UAF drm: - Add Colorspace functionality UAPI: - Add debugger interface for enabling gdb Proposed userspace: https://github.com/ROCm-Developer-Tools/ROCdbgapi/tree/wip-dbgapi - Add KMS colorspace API Discussion: https://lists.freedesktop.org/archives/dri-devel/2023-June/408128.html From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20230609174817.7764-1-alexander.deucher@amd.com commit 8ad57add77d352102ba9edd500b00bc851c2e261 Author: Nicholas Piggin Date: Fri Jun 9 15:10:02 2023 +1000 powerpc/build: vdso linker warning for orphan sections Add --orphan-handlin for vdsos, and adjust vdso linker scripts to deal with orphan sections. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230609051002.3342-1-npiggin@gmail.com commit b4bda59b47879cce38a6ec5a01cd3cac702b5331 Author: Nicholas Piggin Date: Wed Jun 7 20:10:24 2023 +1000 powerpc/64s: Fix VAS mm use after free The refcount on mm is dropped before the coprocessor is detached. Reported-by: Sachin Sant Fixes: 7bc6f71bdff5f ("powerpc/vas: Define and use common vas_window struct") Fixes: b22f2d88e435c ("powerpc/pseries/vas: Integrate API with open/close windows") Signed-off-by: Nicholas Piggin Tested-by: Sachin Sant Signed-off-by: Michael Ellerman Link: https://msgid.link/20230607101024.14559-1-npiggin@gmail.com commit 27be2456332dcd69907f086cda327ad923b222cf Author: Nicholas Piggin Date: Tue Jun 6 23:24:47 2023 +1000 powerpc/64: Rename entry_64.S to prom_entry_64.S This file contains only the enter_prom implementation now. Trim includes and update header comment while we're here. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606132447.315714-7-npiggin@gmail.com commit afc6386815a88d067d9f567dcc6266800286f626 Author: Nicholas Piggin Date: Tue Jun 6 23:24:46 2023 +1000 powerpc: merge 32-bit and 64-bit _switch implementation The _switch stack frame setup are substantially the same, so are the comments. The difference in how the stack and current are switched, and other hardware and software housekeeping is done is moved into macros. Generated code should be unchanged. Signed-off-by: Nicholas Piggin [mpe: Tweak include orer to fix compile errors on some configs] Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606132447.315714-6-npiggin@gmail.com commit 19a043bb1fd1b5cb2652ca33536c55e6c0a70df0 Author: Kemeng Shi Date: Sat Jun 3 23:03:15 2023 +0800 ext4: try all groups in ext4_mb_new_blocks_simple ext4_mb_new_blocks_simple ignores the group before goal, so it will fail if free blocks reside in group before goal. Try all groups to avoid unexpected failure. Search finishes either if any free block is found or if no available blocks are found. Simpliy check "i >= max" to distinguish the above cases. Signed-off-by: Kemeng Shi Suggested-by: Theodore Ts'o Reviewed-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230603150327.3596033-8-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 95a4c3c7e0342f553fed1ac70d10c2efc6bba3b1 Author: Kemeng Shi Date: Sat Jun 3 23:03:14 2023 +0800 ext4: remove ext4_block_group and ext4_block_group_offset declaration For ext4_block_group and ext4_block_group_offset, there are only declaration without definition. Just remove them. Signed-off-by: Kemeng Shi Reviewed-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230603150327.3596033-7-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 1eff590489a213a213c57d96b86f48b32cdf8c3a Author: Kemeng Shi Date: Sat Jun 3 23:03:13 2023 +0800 ext4: add EXT4_MB_HINT_GOAL_ONLY test in ext4_mb_use_preallocated ext4_mb_use_preallocated will ignore the demand to alloc goal blocks, although the EXT4_MB_HINT_GOAL_ONLY is requested. For group pa, ext4_mb_group_or_file will not set EXT4_MB_HINT_GROUP_ALLOC if EXT4_MB_HINT_GOAL_ONLY is set. So we will not alloc goal blocks from group pa if EXT4_MB_HINT_GOAL_ONLY is set. For inode pa, ext4_mb_pa_goal_check is added to check if free extent in found inode pa meets goal blocks when EXT4_MB_HINT_GOAL_ONLY is set. Signed-off-by: Kemeng Shi Suggested-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230603150327.3596033-6-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit c3defd99d58cbdd132bd197714e5523dac976b66 Author: Kemeng Shi Date: Sat Jun 3 23:03:12 2023 +0800 ext4: treat stripe in block unit Stripe is misused in block unit and in cluster unit in different code paths. User awared of stripe maybe not awared of bigalloc feature, so treat stripe only in block unit to fix this. Besides, it's hard to get stripe aligned blocks (start and length are both aligned with stripe) if stripe is not aligned with cluster, just disable stripe and alert user in this case to simpfy the code and avoid unnecessary work to get stripe aligned blocks which likely to be failed. Signed-off-by: Kemeng Shi Reviewed-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230603150327.3596033-5-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 99c515e3a860576ba90c11acbc1d6488dfca6463 Author: Kemeng Shi Date: Sat Jun 3 23:03:11 2023 +0800 ext4: fix wrong unit use in ext4_mb_find_by_goal We need start in block unit while fe_start is in cluster unit. Use ext4_grp_offs_to_block helper to convert fe_start to get start in block unit. Signed-off-by: Kemeng Shi Reviewed-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230603150327.3596033-4-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 497885f72d930305d8e61b6b616b22b4da1adf90 Author: Kemeng Shi Date: Sat Jun 3 23:03:10 2023 +0800 ext4: fix unit mismatch in ext4_mb_new_blocks_simple The "i" returned from mb_find_next_zero_bit is in cluster unit and we need offset "block" corresponding to "i" in block unit. Convert "i" to block unit to fix the unit mismatch. Signed-off-by: Kemeng Shi Reviewed-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230603150327.3596033-3-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit b3916da0d9636285c8a881802956631f9e2ebb5b Author: Kemeng Shi Date: Sat Jun 3 23:03:09 2023 +0800 ext4: fix wrong unit use in ext4_mb_normalize_request NRL_CHECK_SIZE will compare input req and size, so req and size should be in same unit. Input req "fe_len" is in cluster unit while input size "(8<<20)>>bsbits" is in block unit. Convert "fe_len" to block unit to fix the mismatch. Signed-off-by: Kemeng Shi Reviewed-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/20230603150327.3596033-2-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 0dea40aa315d01f5d0ffbd871483ea8a45c71f65 Author: Matthew Wilcox Date: Tue May 16 20:27:13 2023 +0100 ext4: Call fsverity_verify_folio() Now that fsverity supports working on entire folios, call fsverity_verify_folio() instead of fsverity_verify_page() Reported-by: Eric Biggers Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Eric Biggers Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20230516192713.1070469-1-willy@infradead.org Signed-off-by: Theodore Ts'o commit d19500da4b8cfe1791e1583ab237c3213e1bd39c Author: Ritesh Harjani Date: Mon May 15 16:10:44 2023 +0530 ext4: Make ext4_write_inline_data_end() use folio ext4_write_inline_data_end() is completely converted to work with folio. Also all callers of ext4_write_inline_data_end() already works on folio except ext4_da_write_end(). Mostly for consistency and saving few instructions maybe, this patch just converts ext4_da_write_end() to work with folio which makes the last caller of ext4_write_inline_data_end() also converted to work with folio. We then make ext4_write_inline_data_end() take folio instead of page. Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/1bcea771720ff451a5a59b3f1bcd5fae51cb7ce7.1684122756.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o commit 80be8c5cc9251484ba856e2cf7d15a189326fe9c Author: Ritesh Harjani Date: Mon May 15 16:10:43 2023 +0530 ext4: Make mpage_journal_page_buffers use folio This patch converts mpage_journal_page_buffers() to use folio and also removes the PAGE_SIZE assumption. Signed-off-by: Ritesh Harjani (IBM) Reviewed-by: Matthew Wilcox (Oracle) Link: https://lore.kernel.org/r/ebc3ac80e6a54b53327740d010ce684a83512021.1684122756.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o commit 36c9b4504088089185f7743433c914935b518ab2 Author: Ritesh Harjani Date: Mon May 15 16:10:42 2023 +0530 ext4: Change remaining tracepoints to use folio ext4_readpage() is converted to ext4_read_folio() hence change the related tracepoint from trace_ext4_readpage(page) to trace_ext4_read_folio(folio). Do the same for trace_ext4_releasepage(page) to trace_ext4_release_folio(folio) As a minor bit of optimization to avoid an extra dereferencing, since both of the above functions already were dereferencing folio->mapping->host, hence change the tracepoint argument to take (inode, folio). Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/caba2b3c0147bed4ea7706767dc1d19cd0e29ab0.1684122756.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o commit 0b956de1512e23329aa27f60fe4a8b3e6afc7d6a Author: Ritesh Harjani Date: Mon May 15 16:10:40 2023 +0530 ext4: kill unused function ext4_journalled_write_inline_data Commit 3f079114bf522 ("ext4: Convert data=journal writeback to use ext4_writepages()") Added support for writeback of journalled data into ext4_writepages() and killed function __ext4_journalled_writepage() which used to call ext4_journalled_write_inline_data() for inline data. This function got left over by mistake. Hence kill it's definition as no one uses it. Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/122b2a8d5e0650686f23ed6da26ed9e04105562b.1684122756.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o commit dd7de3704af9989b780693d51eaea49a665bd9c2 Author: Yu Kuai Date: Sat Jun 10 10:20:03 2023 +0800 block: fix blktrace debugfs entries leakage Commit 99d055b4fd4b ("block: remove per-disk debugfs files in blk_unregister_queue") moves blk_trace_shutdown() from blk_release_queue() to blk_unregister_queue(), this is safe if blktrace is created through sysfs, however, there is a regression in corner case. blktrace can still be enabled after del_gendisk() through ioctl if the disk is opened before del_gendisk(), and if blktrace is not shutdown through ioctl before closing the disk, debugfs entries will be leaked. Fix this problem by shutdown blktrace in disk_release(), this is safe because blk_trace_remove() is reentrant. Fixes: 99d055b4fd4b ("block: remove per-disk debugfs files in blk_unregister_queue") Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230610022003.2557284-4-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit db59133e927916d8a25ee1fd8264f2808040909d Author: Yu Kuai Date: Sat Jun 10 10:20:02 2023 +0800 scsi: sg: fix blktrace debugfs entries leakage sg_ioctl() support to enable blktrace, which will create debugfs entries "/sys/kernel/debug/block/sgx/", however, there is no guarantee that user will remove these entries through ioctl, and deleting sg device doesn't cleanup these blktrace entries. This problem can be fixed by cleanup blktrace while releasing request_queue, however, it's not a good idea to do this special handling in common layer just for sg device. Fix this problem by shutdown bltkrace in sg_device_destroy(), where the device is deleted and all the users close the device, also grab a scsi_device reference from sg_add_device() to prevent scsi_device to be freed before sg_device_destroy(); Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20230610022003.2557284-3-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit cbe7cff4a76bc749dd70264ca5cf924e2adf9296 Author: Yu Kuai Date: Sat Jun 10 10:20:01 2023 +0800 blktrace: use inline function for blk_trace_remove() while blktrace is disabled If config is disabled, call blk_trace_remove() directly will trigger build warning, hence use inline function instead, prepare to fix blktrace debugfs entries leakage. Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230610022003.2557284-2-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 991e7ac609ee817aa2100b7bc5ee8eadf074dea8 Author: Nilesh Javali Date: Wed Jun 7 17:08:43 2023 +0530 scsi: qla2xxx: Update version to 10.02.08.400-k Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230607113843.37185-9-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit b1b9d3825df4c757d653d0b1df66f084835db9c3 Author: Bikash Hazarika Date: Wed Jun 7 17:08:42 2023 +0530 scsi: qla2xxx: Correct the index of array Klocwork reported array 'port_dstate_str' of size 10 may use index value(s) 10..15. Add a fix to correct the index of array. Cc: stable@vger.kernel.org Signed-off-by: Bikash Hazarika Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230607113843.37185-8-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 00eca15319d9ce8c31cdf22f32a3467775423df4 Author: Shreyas Deodhar Date: Wed Jun 7 17:08:41 2023 +0530 scsi: qla2xxx: Pointer may be dereferenced Klocwork tool reported pointer 'rport' returned from call to function fc_bsg_to_rport() may be NULL and will be dereferenced. Add a fix to validate rport before dereferencing. Cc: stable@vger.kernel.org Signed-off-by: Shreyas Deodhar Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230607113843.37185-7-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit b68710a8094fdffe8dd4f7a82c82649f479bb453 Author: Quinn Tran Date: Wed Jun 7 17:08:40 2023 +0530 scsi: qla2xxx: Fix buffer overrun Klocwork warning: Buffer Overflow - Array Index Out of Bounds Driver uses fc_els_flogi to calculate size of buffer. The actual buffer is nested inside of fc_els_flogi which is smaller. Replace structure name to allow proper size calculation. Cc: stable@vger.kernel.org Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230607113843.37185-6-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit af73f23a27206ffb3c477cac75b5fcf03410556e Author: Nilesh Javali Date: Wed Jun 7 17:08:39 2023 +0530 scsi: qla2xxx: Check valid rport returned by fc_bsg_to_rport() Klocwork reported warning of rport maybe NULL and will be dereferenced. rport returned by call to fc_bsg_to_rport() could be NULL and dereferenced. Check valid rport returned by fc_bsg_to_rport(). Cc: stable@vger.kernel.org Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230607113843.37185-5-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 6b504d06976fe4a61cc05dedc68b84fadb397f77 Author: Nilesh Javali Date: Wed Jun 7 17:08:38 2023 +0530 scsi: qla2xxx: Avoid fcport pointer dereference Klocwork reported warning of NULL pointer may be dereferenced. The routine exits when sa_ctl is NULL and fcport is allocated after the exit call thus causing NULL fcport pointer to dereference at the time of exit. To avoid fcport pointer dereference, exit the routine when sa_ctl is NULL. Cc: stable@vger.kernel.org Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230607113843.37185-4-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 464ea494a40c6e3e0e8f91dd325408aaf21515ba Author: Bikash Hazarika Date: Wed Jun 7 17:08:37 2023 +0530 scsi: qla2xxx: Fix potential NULL pointer dereference Klocwork tool reported 'cur_dsd' may be dereferenced. Add fix to validate pointer before dereferencing the pointer. Cc: stable@vger.kernel.org Signed-off-by: Bikash Hazarika Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230607113843.37185-3-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit d721b591b95cf3f290f8a7cbe90aa2ee0368388d Author: Nilesh Javali Date: Wed Jun 7 17:08:36 2023 +0530 scsi: qla2xxx: Array index may go out of bound Klocwork reports array 'vha->host_str' of size 16 may use index value(s) 16..19. Use snprintf() instead of sprintf(). Cc: stable@vger.kernel.org Co-developed-by: Bikash Hazarika Signed-off-by: Bikash Hazarika Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230607113843.37185-2-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 1fe8150d3b0b6270808f0833d9b9ac159af6b770 Author: Rob Herring Date: Wed Apr 5 20:07:38 2023 -0500 clk: mvebu: Use of_address_to_resource() Replace of_get_property() and of_translate_address() calls with a single call to of_address_to_resource(). Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230406010738.1269781-1-robh@kernel.org Signed-off-by: Stephen Boyd commit 53a06e5924c0d43c11379a08c5a78529c3e61595 Author: Yuan Can Date: Fri Dec 9 09:41:24 2022 +0000 clk: tegra: tegra124-emc: Fix potential memory leak The tegra and tegra needs to be freed in the error handling path, otherwise it will be leaked. Fixes: 2db04f16b589 ("clk: tegra: Add EMC clock driver") Signed-off-by: Yuan Can Link: https://lore.kernel.org/r/20221209094124.71043-1-yuancan@huawei.com Acked-by: Thierry Reding Signed-off-by: Stephen Boyd commit 94ec3d8b20d650e25bc82170804c9de8b40b6038 Author: Patrick Delaunay Date: Wed May 10 18:51:40 2023 +0200 dt-bindings: rcc: stm32: Sync with u-boot copy for STM32MP13 SoC Minor cosmetic change, aligned with files in U-Boot: - change obsolete SPDX id : GPL-2.0+ and use the same license GPL-2.0-only for the 2 files - use correct mail address gabriel.fernandez@foss.st.com - remove extra space Signed-off-by: Patrick Delaunay Link: https://lore.kernel.org/r/20230510184305.v2.1.I417093ddcea282be479f10a37147d1935a9050b7@changeid Acked-by: Conor Dooley Acked-by: Gabriel Fernandez Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit 00134556058c2c262b9d1cac25b73727f87f46f5 Author: Damien Le Moal Date: Thu Jun 15 09:19:51 2023 +0900 ata: pata_octeon_cf: Add missing header include Include the header file linux/of_address.h to avoid compilation errors triggered by of_property_read_reg() being undeclared. Fixes: d0b2461678b1 ("ata: Use of_property_read_reg() to parse "reg"") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306141702.ZaO9V2lk-lkp@intel.com/ Signed-off-by: Damien Le Moal commit 9c632a6396505a019ea6d12b5ab45e659a542a93 Author: Dan Carpenter Date: Thu May 11 20:01:20 2023 +0300 clk: clocking-wizard: Fix Oops in clk_wzrd_register_divider() Smatch detected this potential error pointer dereference clk_wzrd_register_divider(). If devm_clk_hw_register() fails then it sets "hw" to an error pointer and then dereferences it on the next line. Return the error directly instead. Fixes: 5a853722eb32 ("staging: clocking-wizard: Add support for dynamic reconfiguration") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/f0e39b5c-4554-41e0-80d9-54ca3fabd060@kili.mountain Reviewed-by: Michal Simek Signed-off-by: Stephen Boyd commit da2edb3e3c09fd1451b7f400ccd1070ef086619a Author: Dan Carpenter Date: Fri Apr 21 13:41:01 2023 +0300 clk: bcm: rpi: Fix off by one in raspberrypi_discover_clocks() Smatch detected an off by one in this code: drivers/clk/bcm/clk-raspberrypi.c:374 raspberrypi_discover_clocks() error: buffer overflow 'data->hws' 16 <= 16 The data->hws[] array has RPI_FIRMWARE_NUM_CLK_ID elements so the > comparison needs to changed to >=. Fixes: 12c90f3f27bb ("clk: bcm: rpi: Add variant structure") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/5a850b08-d2f5-4794-aceb-a6b468965139@kili.mountain Reviewed-by: Stefan Wahren Reviewed-by: Florian Fainelli Signed-off-by: Stephen Boyd commit a7a0c7d5502217e650d1e996520717212ee54fb9 Author: Yang Li Date: Fri Apr 28 15:00:05 2023 +0800 clk: sifive: Use devm_platform_ioremap_resource() Convert platform_get_resource(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20230428070005.41192-1-yang.lee@linux.alibaba.com Signed-off-by: Stephen Boyd commit b1689799772a6f4180f918b0ff66e264a3db9796 Author: Maciej W. Rozycki Date: Sun Jun 11 18:19:45 2023 +0100 PCI/ASPM: Use distinct local vars in pcie_retrain_link() Use separate local variables to hold the respective values retrieved from the Link Control Register and the Link Status Register. Improves readability and it makes it possible for the compiler to detect actual uninitialised use should this code change in the future. [bhelgaas: reorder to clean up before exposing to PCI core] Link: https://lore.kernel.org/r/alpine.DEB.2.21.2306110252260.64925@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit 3bff63ee0303b12bf6727bd18e529bc7f59f6426 Author: Maciej W. Rozycki Date: Sun Jun 11 18:19:36 2023 +0100 net/mlx5: Rely on dev->link_active_reporting Use dev->link_active_reporting to determine whether Data Link Layer Link Active Reporting is available rather than re-retrieving the capability. Link: https://lore.kernel.org/r/alpine.DEB.2.21.2305310125370.59226@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit 1541a21305ceb10fcf3f7cbb23f3e1a00bbf1789 Author: Maciej W. Rozycki Date: Sun Jun 11 18:19:32 2023 +0100 powerpc/eeh: Rely on dev->link_active_reporting Use dev->link_active_reporting to determine whether Data Link Layer Link Active Reporting is available rather than re-retrieving the capability. Link: https://lore.kernel.org/r/alpine.DEB.2.21.2305310124100.59226@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit 1f087398dbbefe3fe48fc3816b9603d66fec36fc Author: Maciej W. Rozycki Date: Sun Jun 11 18:19:14 2023 +0100 PCI: pciehp: Rely on dev->link_active_reporting Use dev->link_active_reporting to determine whether Data Link Layer Link Active Reporting is available rather than re-retrieving the capability. Link: https://lore.kernel.org/r/alpine.DEB.2.21.2305310028150.59226@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas Reviewed-by: Lukas Wunner commit 42adbdc74c9a62ad3587be4d8a18941711023673 Author: Maciej W. Rozycki Date: Sun Jun 11 18:19:27 2023 +0100 PCI: Initialize dev->link_active_reporting earlier Determine whether Data Link Layer Link Active Reporting is available before calling any fixups so that the cached value can be used there and later on. [bhelgaas: move to set_pcie_port_type() where other PCIe init is done] Link: https://lore.kernel.org/r/alpine.DEB.2.21.2305310122210.59226@angie.orcam.me.uk Signed-off-by: Maciej W. Rozycki Signed-off-by: Bjorn Helgaas commit 701677b95764c06bb058c92be11c3a4ad25ab5f2 Author: Ian Rogers Date: Wed Jun 7 23:18:12 2023 -0700 perf srcline: Add a timeout to reading from addr2line addr2line may fail to send expected values causing perf to wait indefinitely. Add a 1 second timeout (twice the timeout for reading from /proc/pid/maps) so that such reads don't cause perf to appear to lock up. There are already checks that the file for addr2line contains a debug section but this isn't always sufficient. The problem was observed when a valid elf file would set the configuration for binutils addr2line, then a later read of vmlinux with ELF debug sections would cause a failing write/read which would block indefinitely. As a service to future readers, if the io hits eof or an error, cleanup the addr2line process. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Yang Jihong Link: https://lore.kernel.org/r/20230608061812.3715566-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f4c0d5309a3e5f16ca3c3854b1e719dace843e03 Author: Ian Rogers Date: Wed Jun 7 23:18:11 2023 -0700 tools api: Add simple timeout to io read In situations like reading from a pipe it can be useful to have a timeout so that the caller doesn't block indefinitely. Implement a simple one based on poll. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Yang Jihong Link: http://lore.kernel.org/lkml/20230608061812.3715566-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 99d4850062a84564f36923764bb93935ef2ed108 Author: Ian Rogers Date: Tue Jun 13 16:54:16 2023 -0700 perf tool x86: Fix perf_env memory leak Found by leak sanitizer: ``` ==1632594==ERROR: LeakSanitizer: detected memory leaks Direct leak of 21 byte(s) in 1 object(s) allocated from: #0 0x7f2953a7077b in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:439 #1 0x556701d6fbbf in perf_env__read_cpuid util/env.c:369 #2 0x556701d70589 in perf_env__cpuid util/env.c:465 #3 0x55670204bba2 in x86__is_amd_cpu arch/x86/util/env.c:14 #4 0x5567020487a2 in arch__post_evsel_config arch/x86/util/evsel.c:83 #5 0x556701d8f78b in evsel__config util/evsel.c:1366 #6 0x556701ef5872 in evlist__config util/record.c:108 #7 0x556701cd6bcd in test__PERF_RECORD tests/perf-record.c:112 #8 0x556701cacd07 in run_test tests/builtin-test.c:236 #9 0x556701cacfac in test_and_print tests/builtin-test.c:265 #10 0x556701cadddb in __cmd_test tests/builtin-test.c:402 #11 0x556701caf2aa in cmd_test tests/builtin-test.c:559 #12 0x556701d3b557 in run_builtin tools/perf/perf.c:323 #13 0x556701d3bac8 in handle_internal_command tools/perf/perf.c:377 #14 0x556701d3be90 in run_argv tools/perf/perf.c:421 #15 0x556701d3c3f8 in main tools/perf/perf.c:537 #16 0x7f2952a46189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 SUMMARY: AddressSanitizer: 21 byte(s) leaked in 1 allocation(s). ``` Fixes: f7b58cbdb3ff36eb ("perf mem/c2c: Add load store event mappings for AMD") Signed-off-by: Ian Rogers Acked-by: Ravi Bangoria Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Link: https://lore.kernel.org/r/20230613235416.1650755-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3973bcc95e7441ddfad39a8e12d8c1eb1ee36426 Merge: ac9a78681b921 9a7b010116a43 Author: Stephen Boyd Date: Wed Jun 14 13:58:01 2023 -0700 Merge tag 'clk-microchip-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into clk-microchip Pull Microchip clk driver updates from Claudiu Beznea: Polarfire: - new Kconfig symbol name (SOC_MICROCHIP_POLARFIRE) for Microchip FPGA clock drivers PIC32: - use of_property_read_bool() to read "microchip,pic32mzda-sosc" boolean DT property in clk-pic32mzda AT91: - convert clock dt-bindings to YAML * tag 'clk-microchip-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: dt-bindings: clocks: at91sam9x5-sckc: convert to yaml dt-bindings: clocks: atmel,at91rm9200-pmc: convert to yaml clk: microchip: Use of_property_read_bool() for boolean properties clk: microchip: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIRE commit 989e4659dc51bd232147ffd5c4317f3a7857d723 Merge: ac9a78681b921 878b02d5f3b56 Author: Stephen Boyd Date: Wed Jun 14 13:43:35 2023 -0700 Merge tag 'clk-imx-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux into clk-imx Pull i.MX clk driver updates from Abel Vesa: - Remove CLK_SET_RATE_PARENT flag from LDB clocks on i.MX6SX - Keep UART clocks enabled during kernel boot if earlycon is set - Drop the imx_unregister_clocks as there are no users for it - Switch to _safe iterator on imx_clk_scu_unregister to avoid use after free - Add determine_rate op to the imx8m composite clock - Use device managed API for iomap and kzalloc for i.MXRT1050, i.MX8MN, i.MX8MP and i.MX93 clock controller drivers - Add missing interrupt DT property for the i.MX8M clock controller * tag 'clk-imx-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux: clk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe() clk: imx93: fix memory leak and missing unwind goto in imx93_clocks_probe clk: imx: clk-imx8mn: fix memory leak in imx8mn_clocks_probe dt-bindings: clock: imx8m: Add missing interrupt property clk: imx: clk-imxrt1050: fix memory leak in imxrt1050_clocks_probe clk: imx: composite-8m: Add imx8m_divider_determine_rate clk: imx: scu: use _safe list iterator to avoid a use after free clk: imx: drop imx_unregister_clocks clk: imx6ul: retain early UART clocks during kernel init clk: imx: imx6sx: Remove CLK_SET_RATE_PARENT from the LDB clocks commit 92e2921eeafdfca9acd9b83f07d2b7ca099bac24 Author: Masahiro Yamada Date: Mon Jun 12 00:50:50 2023 +0900 ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard ASM_NL is useful not only in *.S files but also in .c files for using inline assembler in C code. On ARC, however, ASM_NL is evaluated inconsistently. It is expanded to a backquote (`) in *.S files, but a semicolon (;) in *.c files because arch/arc/include/asm/linkage.h defines it inside #ifdef __ASSEMBLY__, so the definition for C code falls back to the default value defined in include/linux/linkage.h. If ASM_NL is used in inline assembler in .c files, it will result in wrong assembly code because a semicolon is not an instruction separator, but the start of a comment for ARC. Move ASM_NL (also __ALIGN and __ALIGN_STR) out of the #ifdef. Fixes: 9df62f054406 ("arch: use ASM_NL instead of ';' for assembler new line character in the macro") Fixes: 8d92e992a785 ("ARC: define __ALIGN_STR and __ALIGN symbols for ARC") Signed-off-by: Masahiro Yamada commit 1c975da56a6f89a3e610cc86d92f65de3da7bd61 Author: Masahiro Yamada Date: Mon Jun 5 21:26:04 2023 +0900 scripts/kallsyms: remove KSYM_NAME_LEN_BUFFER You do not need to decide the buffer size statically. Use getline() to grow the line buffer as needed. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 92e74fb6e6196d642505ae2b74a8e327202afef9 Author: Masahiro Yamada Date: Mon Jun 5 21:04:00 2023 +0900 scripts/kallsyms: constify long_options getopt_long() does not modify this. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 8635e8df477bc77837886da206f4915576f88fec Author: Masahiro Yamada Date: Sat Jun 10 18:13:10 2023 +0900 Revert "[PATCH] uml: export symbols added by GCC hardened" This reverts commit cead61a6717a9873426b08d73a34a325e3546f5d. It exported __stack_smash_handler and __guard, while they may not be defined by anyone. The code *declares* __stack_smash_handler and __guard. It does not create weak symbols. If no external library is linked, they are left undefined, but yet exported. If a loadable module tries to access non-existing symbols, bad things (a page fault, NULL pointer dereference, etc.) will happen. So, the current code is wrong and dangerous. If the code were written as follows, it would *define* them as weak symbols so modules would be able to get access to them. void (*__stack_smash_handler)(void *) __attribute__((weak)); EXPORT_SYMBOL(__stack_smash_handler); long __guard __attribute__((weak)); EXPORT_SYMBOL(__guard); In fact, modpost forbids exporting undefined symbols. It shows an error message if it detects such a mistake. ERROR: modpost: "..." [...] was exported without definition Unfortunately, it is checked only when the code is built as modular. The problem described above has been unnoticed for a long time because arch/um/os-Linux/user_syms.c is always built-in. With a planned change in Kbuild, exporting undefined symbols will always result in a build error instead of a run-time error. It is a good thing, but we need to fix the breakage in advance. One fix is to define weak symbols as shown above. An alternative is to export them conditionally as follows: #ifdef CONFIG_STACKPROTECTOR extern void __stack_smash_handler(void *); EXPORT_SYMBOL(__stack_smash_handler); external long __guard; EXPORT_SYMBOL(__guard); #endif This is what other architectures do; EXPORT_SYMBOL(__stack_chk_guard) is guarded by #ifdef CONFIG_STACKPROTECTOR. However, adding the #ifdef guard is not sensible because UML cannot enable the stack-protector in the first place! (Please note UML does not select HAVE_STACKPROTECTOR in Kconfig.) So, the code is already broken (and unused) in multiple ways. Just remove. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 587dd448d9fcfb53486197c9c4bf5be99c75fb7c Author: Stephen Boyd Date: Tue Jun 13 12:54:42 2023 -0700 clk: sprd: composite: Simplify determine_rate implementation The sprd_div_helper_round_rate() function calls divider_round_rate() which calls divider_round_rate_parent() which calls divider_determine_rate(). This call chain converts back and forth from the rate request structure to make a determine_rate clk_op fit with a round_rate clk_op. Simplify the code here by directly calling divider_determine_rate() instead. This fixes a smatch warning where an unsigned long is compared to less than zero, which is impossible. This makes sprd_div_helper_round_rate() unnecessary as well so simply remove it and fold it into the only caller left. Reported-by: Harshit Mogalapalli Closes: https://lore.kernel.org/r/45fdc54e-7ab6-edd6-d55a-473485608473@oracle.com Cc: Maxime Ripard Fixes: 302d2f836d78 ("clk: sprd: composite: Switch to determine_rate") Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20230613195443.1555132-1-sboyd@kernel.org Reviewed-by: Maxime Ripard commit a5a319ec2c2236bb96d147c16196d2f1f3799301 Author: Kees Cook Date: Tue Jun 6 15:24:45 2023 -0700 um: Use HOST_DIR for mrproper When HEADER_ARCH was introduced, the MRPROPER_FILES (then MRPROPER_DIRS) list wasn't adjusted, leaving SUBARCH as part of the path argument. This resulted in the "mrproper" target not cleaning up arch/x86/... when SUBARCH was specified. Since HOST_DIR is arch/$(HEADER_ARCH), use it instead to get the correct path. Cc: Richard Weinberger Cc: Anton Ivanov Cc: Johannes Berg Cc: Azeem Shaikh Cc: linux-um@lists.infradead.org Fixes: 7bbe7204e937 ("um: merge Makefile-{i386,x86_64}") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230606222442.never.807-kees@kernel.org commit 33457938a0c4e817ab6f9923e244b91289f47f54 Author: Azeem Shaikh Date: Wed Jun 14 01:03:54 2023 +0000 kallsyms: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230614010354.1026096-1-azeemshaikh38@gmail.com commit 870410910b6ad032afb6a02bfd6a8c65dde6084b Author: Azeem Shaikh Date: Tue May 30 16:30:41 2023 +0000 sh: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Acked-by: John Paul Adrian Glaubitz Tested-by: John Paul Adrian Glaubitz Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230530163041.985456-1-azeemshaikh38@gmail.com commit fdd932efaec97693e6b383df876712f590f4332a Author: Azeem Shaikh Date: Tue May 30 16:22:02 2023 +0000 of/flattree: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230530162202.983558-1-azeemshaikh38@gmail.com commit bb07972fd64a8d666424e6e65648eed2ab758eac Author: Azeem Shaikh Date: Tue May 30 16:30:01 2023 +0000 sparc64: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230530163001.985256-1-azeemshaikh38@gmail.com commit d2b2613d363d3104179d389623e7c5df81d38cc4 Merge: 2b026eabc3152 ea861df772fd8 Author: Mark Brown Date: Wed Jun 14 19:58:02 2023 +0100 regulator: mt6358: Remove bogus regulators and Merge series from Chen-Yu Tsai : This series is a cleanup and improvement of the MT6358 regulator driver. Various discrepancies were found while preparing to upstream MT8186 device trees, which utilize the MT6366 PMIC, that is also covered by this driver. Patches 1~8 should go through the regulator tree, and patch 9 through the soc tree. This series can be seen as two parts: Part 1 - Fixing bogus regulators (patches 1~4 and 9) There are some regulators listed in the bindings and driver that have no corresponding pin on the actual hardware. MediaTek says these are a hardware construct for shared control of the same regulator in the VCN33 case and an alternative control scheme for low power suspend. In the VCN33 case, there's only one actual regulator, so we merge the two and rename them to match the hardware pin. No existing devices use these AFAICT, so this should be safe to change. In the *_SSHUB case, the two extra regulators refer to alternative configuration registers of the same regulators. They are intended for the SoC's low power mode companion processor to use, not the main processor or OS. It should be left to the implementation to choose which set of registers to actually control. Part 2 - Code cleanup (patches 5 and 6) Various tables in the regulator driver were not constant, even though they are just lookup tables. With some reworking of the code, they are made constant. Also, some regulators that have a single linear range were using linear range helpers. This is more complicated than just declaring the range and step directly in the description. This is simplified to use the latter approach. Please have a look. After this series is done I'll send out patches for the MT6366 PMIC, which is what started this. That will also include updated YAML bindings for MT6366. I think we can merge MT6358 bindings into them afterwards. [1] https://lore.kernel.org/linux-arm-kernel/20230609075032.2804554-1-wenst@chromium.org/ commit d97038d5ec2062733c1e016caf9baaf68cf64ea1 Author: Jiasheng Jiang Date: Wed Jun 14 17:37:33 2023 +0800 pstore/ram: Add check for kstrdup Add check for the return value of kstrdup() and return the error if it fails in order to avoid NULL pointer dereference. Fixes: e163fdb3f7f8 ("pstore/ram: Regularize prz label allocation lifetime") Signed-off-by: Jiasheng Jiang Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230614093733.36048-1-jiasheng@iscas.ac.cn commit f0e212de87a1c7884d011da714418a9b18823f7d Author: Azeem Shaikh Date: Tue May 30 16:26:08 2023 +0000 Hexagon: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230530162608.984333-1-azeemshaikh38@gmail.com commit 9d9173e9ceb63660ccad80f41373fd7eb48ff4ac Author: Petr Pavlu Date: Mon Mar 27 11:54:06 2023 +0200 x86/build: Avoid relocation information in final vmlinux The Linux build process on x86 roughly consists of compiling all input files, statically linking them into a vmlinux ELF file, and then taking and turning this file into an actual bzImage bootable file. vmlinux has in this process two main purposes: 1) It is an intermediate build target on the way to produce the final bootable image. 2) It is a file that is expected to be used by debuggers and standard ELF tooling to work with the built kernel. For the second purpose, a vmlinux file is typically collected by various package build recipes, such as distribution spec files, including the kernel's own tar-pkg target. When building a kernel supporting KASLR with CONFIG_X86_NEED_RELOCS, vmlinux contains also relocation information produced by using the --emit-relocs linker option. This is utilized by subsequent build steps to create vmlinux.relocs and produce a relocatable image. However, the information is not needed by debuggers and other standard ELF tooling. The issue is then that the collected vmlinux file and hence distribution packages end up unnecessarily large because of this extra data. The following is a size comparison of vmlinux v6.0 with and without the relocation information: | Configuration | With relocs | Stripped relocs | | x86_64_defconfig | 70 MB | 43 MB | | +CONFIG_DEBUG_INFO | 818 MB | 367 MB | Optimize a resulting vmlinux by adding a postlink step that splits the relocation information into vmlinux.relocs and then strips it from the vmlinux binary. Signed-off-by: Petr Pavlu Signed-off-by: Borislav Petkov (AMD) Tested-by: Nick Desaulniers Link: https://lore.kernel.org/r/20220927084632.14531-1-petr.pavlu@suse.com commit 74836ecbc5c7565d24a770917644e96af3e98d25 Author: Eric Biggers Date: Mon Jun 12 12:00:47 2023 -0700 fsverity: rework fsverity_get_digest() again Address several issues with the calling convention and documentation of fsverity_get_digest(): - Make it provide the hash algorithm as either a FS_VERITY_HASH_ALG_* value or HASH_ALGO_* value, at the caller's choice, rather than only a HASH_ALGO_* value as it did before. This allows callers to work with the fsverity native algorithm numbers if they want to. HASH_ALGO_* is what IMA uses, but other users (e.g. overlayfs) should use FS_VERITY_HASH_ALG_* to match fsverity-utils and the fsverity UAPI. - Make it return the digest size so that it doesn't need to be looked up separately. Use the return value for this, since 0 works nicely for the "file doesn't have fsverity enabled" case. This also makes it clear that no other errors are possible. - Rename the 'digest' parameter to 'raw_digest' and clearly document that it is only useful in combination with the algorithm ID. This hopefully clears up a point of confusion. - Export it to modules, since overlayfs will need it for checking the fsverity digests of lowerdata files (https://lore.kernel.org/r/dd294a44e8f401e6b5140029d8355f88748cd8fd.1686565330.git.alexl@redhat.com). Acked-by: Mimi Zohar # for the IMA piece Link: https://lore.kernel.org/r/20230612190047.59755-1-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 505cb70cd27abde24bd48b2c9a539cca485d722f Merge: eab5abdeb79f0 357a1ebd0c012 Author: Mark Brown Date: Wed Jun 14 18:35:13 2023 +0100 regmap: Add KUnit tests for read/write checking Merge series from Mark Brown : Since Takashi found an issue with maple tree syncing registers it shouldn't do add some test cases that catch that case and some more potential issues, ideally we'd run through the combination of readability with all possible I/O calls but that's lifting for another day. We did find one issue with missing readability checks which will be fixed separately. commit c3c53dcacd1c7e4c9127a84b40fd632fedb2a0e8 Author: Francesco Dolcini Date: Thu Jun 1 15:13:29 2023 +0200 arm64: defconfig: enable drivers for Verdin AM62 Enable drivers used on Verdin AM62 [1] as modules: * PWM driver support for the EHRPWM controller * TC358768 parallel RGB to DSI bridge * SN65DSI83 DSI to LVDS bridge [1] https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62 Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20230601131332.26877-3-francesco@dolcini.it Signed-off-by: Vignesh Raghavendra commit 6dd4423f3f247b6f0ecb828cf62ea2bc4604f0b5 Author: Pankaj Raghav Date: Wed Jun 14 15:35:38 2023 +0200 brd: use cond_resched instead of cond_resched_rcu The body of the loop is run without RCU lock held. Use the regular cond_resched() instead of cond_resched_rcu(). Fixes: 786bb0245881 ("brd: use XArray instead of radix-tree to index backing pages") Suggested-by: Matthew Wilcox (Oracle) Signed-off-by: Pankaj Raghav Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20230614133538.1279369-1-p.raghav@samsung.com Signed-off-by: Jens Axboe commit 30654614f3d27230200b1650f6025a2ce67900b4 Author: Ed Tsai Date: Wed Jun 14 08:25:29 2023 +0800 blk-mq: check on cpu id when there is only one ctx mapping commit f168420c62e7 ("blk-mq: don't redirect completion for hctx withs only one ctx mapping") When nvme applies a 1:1 mapping of hctx and ctx, there will be no remote request. But for ufs, the submission and completion queues could be asymmetric. (e.g. Multiple SQs share one CQ) Therefore, 1:1 mapping of hctx and ctx won't complete request on the submission cpu. In this situation, this nr_ctx check could violate the QUEUE_FLAG_SAME_FORCE, as a result, check on cpu id when there is only one ctx mapping. Signed-off-by: Ed Tsai Signed-off-by: Po-Wen Kao Suggested-by: Keith Busch Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230614002529.6636-1-ed.tsai@mediatek.com [axboe: fixed up indentation] Signed-off-by: Jens Axboe commit 3927eaff464f1fd6eb49388b4c3eb1df677b0360 Author: Jose Marinho Date: Tue Jun 6 10:35:28 2023 +0100 Documentation/arm64: Update ACPI tables from BBR The BBR specification requires (or conditionally requires) a set of ACPI tables for a proper working system. This commit updates: - the list of ACPI tables to reflect the contents of BBR version 2.0 (see https://developer.arm.com/documentation/den0044/g). - the list of ACPI tables in acpi_object_usage. This last update ensures that both files remain coherent. Cc: Jeremy Linton Cc: James Morse Cc: Rob Herring Cc: Will Deacon Cc: Jonathan Corbet Cc: Hanjun Guo Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Cc: linux-acpi@vger.kernel.org Signed-off-by: Jose Marinho Reviewed-by: Samer El-Haj-Mahmoud Acked-by: Sudeep Holla Reviewed-by: Jeremy Linton Reviewed-by: Hanjun Guo Link: https://lore.kernel.org/r/20230606093528.1494344-4-jose.marinho@arm.com Signed-off-by: Catalin Marinas commit 8c350dfc90656639e9482e8a17625e4233d4a23f Author: Jose Marinho Date: Tue Jun 6 10:35:27 2023 +0100 Documentation/arm64: Update references in arm-acpi This patch: - Updates the reference to the DSD document, - Removes the unused reference to AMD Seattle, - Updates the references to BBR, BSA and SBSA. Cc: Jeremy Linton Cc: James Morse Cc: Rob Herring Cc: Will Deacon Cc: Jonathan Corbet Cc: Hanjun Guo Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Cc: linux-acpi@vger.kernel.org Signed-off-by: Jose Marinho Reviewed-by: Samer El-Haj-Mahmoud Reviewed-by: Robin Murphy Acked-by: Sudeep Holla Reviewed-by: Jeremy Linton Reviewed-by: Hanjun Guo Link: https://lore.kernel.org/r/20230606093528.1494344-3-jose.marinho@arm.com Signed-off-by: Catalin Marinas commit 137477c8daac19e4dd4489901fe85c8e3602427b Author: Jose Marinho Date: Tue Jun 6 10:35:26 2023 +0100 Documentation/arm64: Update ARM and arch reference This patch clarifies that both Armv8 and v9 are in scope, not just Armv8 systems. Also, ARM is re-written as Arm. Cc: Jeremy Linton Cc: James Morse Cc: Rob Herring Cc: Will Deacon Cc: Jonathan Corbet Cc: Hanjun Guo Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Cc: linux-acpi@vger.kernel.org Signed-off-by: Jose Marinho Reviewed-by: Samer El-Haj-Mahmoud Reviewed-by: Robin Murphy Acked-by: Sudeep Holla Reviewed-by: Jeremy Linton Reviewed-by: Hanjun Guo Link: https://lore.kernel.org/r/20230606093528.1494344-2-jose.marinho@arm.com Signed-off-by: Catalin Marinas commit 601eaec513cc814c3dc6ed504c7c51ce1b80d0ea Author: Russell King Date: Wed Jun 14 17:09:35 2023 +0100 arm64: consolidate rox page protection logic Consolidate the arm64 decision making for the page protections used for executable pages, used by both the trampoline code and the kernel text mapping code. Acked-by: Mark Rutland Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1q9T3v-00EDmW-BH@rmk-PC.armlinux.org.uk Signed-off-by: Catalin Marinas commit 2bd4aa9325821551648cf9738d6aa3a49317d7e5 Author: Peter Zijlstra Date: Wed Jun 14 16:35:50 2023 +0200 x86/alternative: PAUSE is not a NOP While chasing ghosts, I did notice that optimize_nops() was replacing 'REP NOP' aka 'PAUSE' with NOP2. This is clearly not right. Fixes: 6c480f222128 ("x86/alternative: Rewrite optimize_nops() some") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/linux-next/20230524130104.GR83892@hirez.programming.kicks-ass.net/ commit 9350a629e839ca1c2b529a83a916cf2370bd1c64 Author: Steven Rostedt (Google) Date: Wed May 31 09:24:19 2023 -0400 x86/alternatives: Add cond_resched() to text_poke_bp_batch() Debugging in the kernel has started slowing down the kernel by a noticeable amount. The ftrace start up tests are triggering the softlockup watchdog on some boxes. This is caused by the start up tests that enable function and function graph tracing several times. Sprinkling cond_resched() just in the start up test code was not enough to stop the softlockup from triggering. It would sometimes trigger in the text_poke_bp_batch() code. When function tracing enables all functions, it will call text_poke_queue() to queue the places that need to be patched. Every 256 entries will do a "flush" that calls text_poke_bp_batch() to do the update of the 256 locations. As this is in a scheduleable context, calling cond_resched() at the start of text_poke_bp_batch() will ensure that other tasks could get a chance to run while the patching is happening. This keeps the softlockup from triggering in the start up tests. Signed-off-by: Steven Rostedt (Google) Signed-off-by: Borislav Petkov (AMD) Acked-by: Masami Hiramatsu (Google) Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230531092419.4d051374@rorschach.local.home commit 225312fbaf37bb283dbc92a0a1d4dfe58629ab64 Author: Bryan Brattlof Date: Wed Apr 5 16:53:24 2023 -0500 arm64: dts: ti: k3-am62a-wakeup: add VTM node The am62ax supports a single Voltage and Thermal Management (VTM) device located in the wakeup domain with three associated temperature monitors located in various hot spots of the die. Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20230405215328.3755561-4-bb@ti.com Signed-off-by: Vignesh Raghavendra commit bbb6dc62505acf6fcb80573f7e7a59875c33be0d Author: Bryan Brattlof Date: Wed Apr 5 16:53:23 2023 -0500 arm64: dts: ti: k3-am62-wakeup: add VTM node The am62x supports a single Voltage and Thermal Management (VTM) module located in the wakeup domain with two associated temperature monitors located in hot spots of the die. Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20230405215328.3755561-3-bb@ti.com Signed-off-by: Vignesh Raghavendra commit 96135297a76003faae68e3aa86e2e19851510eb9 Author: Bryan Brattlof Date: Wed Apr 5 16:53:22 2023 -0500 arm64: dts: ti: k3-am64-main: add VTM node The am64x supports a single VTM module which is located in the main domain with two associated temperature monitors located at different hot spots on the die. Tested-by: Christian Gmeiner Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20230405215328.3755561-2-bb@ti.com Signed-off-by: Vignesh Raghavendra commit 598a06afca5a2ab4850ce9ff8146ec728cca570c Author: Bjorn Andersson Date: Wed Jun 14 07:22:04 2023 -0700 arm64: dts: qcom: sc8280xp: Enable GPU related nodes Add memory reservation for the zap-shader and enable the Adreno SMMU, GPU clock controller, GMU and the GPU nodes for the SC8280XP CRD and the Lenovo ThinkPad X13s. Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Tested-by: Johan Hovold Signed-off-by: Bjorn Andersson Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230614142204.2675653-3-quic_bjorande@quicinc.com commit eec51ab2fd6f447a993c502364704d0cb5bc8cae Author: Bjorn Andersson Date: Wed Jun 14 07:22:03 2023 -0700 arm64: dts: qcom: sc8280xp: Add GPU related nodes Add Adreno SMMU, GPU clock controller, GMU and GPU nodes for the SC8280XP. Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Tested-by: Johan Hovold Signed-off-by: Bjorn Andersson Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230614142204.2675653-2-quic_bjorande@quicinc.com commit e95433c367e681dc6d4613706bd74f483a25acd8 Author: Raag Jadav Date: Tue Jun 13 14:20:52 2023 +0530 pinctrl: intel: refine ->set_mux() hook Utilize a temporary variable for common shift operation in ->set_mux() hook and improve readability while saving a few bytes. add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-3 (-3) Function old new delta intel_pinmux_set_mux 245 242 -3 Total: Before=10472, After=10469, chg -0.03% Signed-off-by: Raag Jadav Acked-by: Mika Westerberg Link: https://lore.kernel.org/r/20230613085054.10976-2-raag.jadav@intel.com Signed-off-by: Andy Shevchenko commit 1696c75f1864b338fccbc55f278039d199287ec3 Author: Alexander Aring Date: Mon May 29 17:44:40 2023 -0400 fs: dlm: add send ack threshold and append acks to msgs This patch changes the time when we sending an ack back to tell the other side it can free some message because it is arrived on the receiver node, due random reconnects e.g. TCP resets this is handled as well on application layer to not let DLM run into a deadlock state. The current handling has the following problems: 1. We end in situations that we only send an ack back message of 16 bytes out and no other messages. Whereas DLM has logic to combine so much messages as it can in one send() socket call. This behaviour can be discovered by "trace-cmd start -e dlm_recv" and observing the ret field being 16 bytes. 2. When processing of DLM messages will never end because we receive a lot of messages, we will not send an ack back as it happens when the processing loop ends. This patch introduces a likely and unlikely threshold case. The likely case will send an ack back on a transmit path if the threshold is triggered of amount of processed upper layer protocol. This will solve issue 1 because it will be send when another normal DLM message will be sent. It solves issue 2 because it is not part of the processing loop. There is however a unlikely case, the unlikely case has a bigger threshold and will be triggered when we only receive messages and do not sent any message back. This case avoids that the sending node will keep a lot of message for a long time as we send sometimes ack backs to tell the sender to finally release messages. The atomic cmpxchg() is there to provide a atomically ack send with reset of the upper layer protocol delivery counter. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit d00725cab226491fc347d9bc42b881a0a35419cf Author: Alexander Aring Date: Mon May 29 17:44:39 2023 -0400 fs: dlm: handle sequence numbers as atomic Currently seq_next is only be read on the receive side which processed in an ordered way. The seq_send is being protected by locks. To being able to read the seq_next value on send side as well we convert it to an atomic_t value. The atomic_cmpxchg() is probably not necessary, however the atomic_inc() depends on a if coniditional and this should be handled in an atomic context. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 75a7d60134ce84209f2c61ec4619ee543aa8f466 Author: Alexander Aring Date: Mon May 29 17:44:38 2023 -0400 fs: dlm: handle lkb wait count as atomic_t Currently the lkb_wait_count is locked by the rsb lock and it should be fine to handle lkb_wait_count as non atomic_t value. However for the overall process of reducing locking this patch converts it to an atomic_t value. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 07ee38674a0b9071fa0bbec4dbda6aad1c5e4003 Author: Alexander Aring Date: Mon May 29 17:44:37 2023 -0400 fs: dlm: filter ourself midcomms calls It makes no sense to call midcomms/lowcomms functionality for the local node as socket functionality is only required for remote nodes. This patch filters those calls in the upper layer of lockspace membership handling instead of doing it in midcomms/lowcomms layer as they should never be aware of local nodeid. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 70cf2fecf87354be09c0ab4c233fccea36256d3c Author: Alexander Aring Date: Mon May 29 17:44:36 2023 -0400 fs: dlm: warn about messages from left nodes This patch warns about messages which are received from nodes who already left the lockspace resource signaled by the cluster manager. Before commit 489d8e559c65 ("fs: dlm: add reliable connection if reconnect") there was a synchronization issue with the socket lifetime and the cluster event of leaving a lockspace and other nodes did not stop of sending messages because the cluster manager has a pending message to leave the lockspace. The reliable session layer for dlm use sequence numbers to ensure dlm message were never being dropped. If this is not corrected synchronized we have a problem, this patch will use the filter case and turn it into a WARN_ON_ONCE() so we seeing such issue on the kernel log because it should never happen now. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 5ce9ef30f226c43aa711a4807077447251efa0c6 Author: Alexander Aring Date: Mon May 29 17:44:35 2023 -0400 fs: dlm: move dlm_purge_lkb_callbacks to user module This patch moves the dlm_purge_lkb_callbacks() function from ast to user dlm module as it is only a function being used by dlm user implementation. I got be hinted to hold specific locks regarding the callback handling for dlm_purge_lkb_callbacks() but it was false positive. It is confusing because ast dlm implementation uses a different locking behaviour as user locks uses as DLM handles kernel and user dlm locks differently. To avoid the confusing we move this function to dlm user implementation. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit d41a1a3db49f4b128404114f693398f2878b5100 Author: Alexander Aring Date: Mon May 29 17:44:34 2023 -0400 fs: dlm: cleanup STOP_IO bitflag set when stop io There should no difference between setting the CF_IO_STOP flag before restore_callbacks() to do it before or afterwards. The restore_callbacks() will be sure that no callback is executed anymore when the bit wasn't set. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit f8bce79d9d9edb8d2302a216f298f4839fb0adb6 Author: Alexander Aring Date: Mon May 29 17:44:33 2023 -0400 fs: dlm: don't check othercon twice This patch removes an another check if con->othercon set inside the branch which already does that. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit cbba21169eeff4d43e064c43d0b95b1f89587da3 Author: Alexander Aring Date: Mon May 29 17:44:32 2023 -0400 fs: dlm: unregister memory at the very last The dlm modules midcomms, debugfs, lockspace, uses kmem caches. We ensure that the kmem caches getting deallocated after those modules exited. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit f68bb23cad1f128198074ed7b3a4c5fb03dbd9d2 Author: Alexander Aring Date: Mon May 29 17:44:31 2023 -0400 fs: dlm: fix missing pending to false This patch sets the process_dlm_messages_pending boolean to false when there was no message to process. It is a case which should not happen but if we are prepared to recover from this situation by setting pending boolean to false. Cc: stable@vger.kernel.org Fixes: dbb751ffab0b ("fs: dlm: parallelize lowcomms socket handling") Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 7a931477bff1c7548aa8492bccf600f5f29452b1 Author: Alexander Aring Date: Mon May 29 17:44:30 2023 -0400 fs: dlm: clear pending bit when queue was empty This patch clears the DLM_IFL_CB_PENDING_BIT flag which will be set when there is callback work queued when there was no callback to dequeue. It is a buggy case and should never happen, that's why there is a WARN_ON(). However if the case happens we are prepared to somehow recover from it. Cc: stable@vger.kernel.org Fixes: 61bed0baa4db ("fs: dlm: use a non-static queue for callbacks") Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit c6b6d6dcc7f32767d57740e0552337c8de40610b Author: Alexander Aring Date: Mon May 29 17:44:29 2023 -0400 fs: dlm: revert check required context while close This patch reverts commit 2c3fa6ae4d52 ("dlm: check required context while close"). The function dlm_midcomms_close(), which will call later dlm_lowcomms_close(), is called when the cluster manager tells the node got fenced which means on midcomms/lowcomms layer to disconnect the node from the cluster communication. The node can rejoin the cluster later. This patch was ensuring no new message were able to be triggered when we are in the close() function context. This was done by checking if the lockspace has been stopped. However there is a missing check that we only need to check specific lockspaces where the fenced node is member of. This is currently complicated because there is no way to easily check if a node is part of a specific lockspace without stopping the recovery. For now we just revert this commit as it is just a check to finding possible leaks of stopping lockspaces before close() is called. Cc: stable@vger.kernel.org Fixes: 2c3fa6ae4d52 ("dlm: check required context while close") Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 8c15c2a0281087d19f62d7c2b5ab1f9e961b8d97 Author: Mostafa Saleh Date: Wed Jun 14 12:25:59 2023 +0000 KVM: arm64: Use different pointer authentication keys for pKVM When the use of pointer authentication is enabled in the kernel it applies to both the kernel itself as well as KVM's nVHE hypervisor. The same keys are used for both the kernel and the nVHE hypervisor, which is less than desirable for pKVM as the host is not trusted at runtime. Naturally, the fix is to use a different set of keys for the hypervisor when running in protected mode. Have the host generate a new set of keys for the hypervisor before deprivileging the kernel. While there might be other sources of random directly available at EL2, this keeps the implementation simple, and the host is trusted anyways until it is deprivileged. Since the host and hypervisor no longer share a set of pointer authentication keys, start context switching them on the host entry/exit path exactly as we do for guest entry/exit. There is no need to handle CPU migration as the nVHE code is not migratable in the first place. Signed-off-by: Mostafa Saleh Link: https://lore.kernel.org/r/20230614122600.2098901-1-smostafa@google.com Signed-off-by: Oliver Upton commit 181da4bcc3d4bb4b58e3df481e72353925b36edd Author: Krzysztof Kozlowski Date: Sun May 7 16:48:26 2023 +0200 remoteproc: qcom_q6v5_pas: staticize adsp_segment_dump() adsp_segment_dump() is not used outside of this unit, so add missing static to fix: drivers/remoteproc/qcom_q6v5_pas.c:108:6: warning: no previous prototype for ‘adsp_segment_dump’ [-Wmissing-prototypes] Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230507144826.193067-1-krzysztof.kozlowski@linaro.org commit 1b39e7607144337d752f36c2068ed79447462f99 Author: Krzysztof Kozlowski Date: Fri May 12 18:45:20 2023 +0200 hwspinlock: omap: drop of_match_ptr for ID table The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it might not be relevant here). drivers/hwspinlock/omap_hwspinlock.c:164:34: error: ‘omap_hwspinlock_of_match’ defined but not used [-Werror=unused-const-variable=] Reviewed-by: Baolin Wang Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230512164520.212312-1-krzysztof.kozlowski@linaro.org commit 831b802a7727ba6e67c5ed585c54f610d9db1316 Author: Krishna chaitanya chundru Date: Wed Jun 14 19:54:25 2023 +0530 arm: dts: qcom: sdx55: Add interconnect path Add pcie-mem interconnect path to sdx55 target. Signed-off-by: Krishna chaitanya chundru Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1686752666-13426-3-git-send-email-quic_krichai@quicinc.com commit ecbfba694b5baf2b854689c63ef011e905810c59 Author: Stephan Gerhold Date: Wed Jun 14 09:16:06 2023 +0200 arm64: dts: qcom: msm8939-pm8916: Mark always-on regulators Some of the regulators must be always-on to ensure correct operation of the system, e.g. PM8916 L2 for the LPDDR RAM, L5 for most digital I/O and L7 for the CPU PLL (strictly speaking the CPU PLL might only need an active-only vote but this is not supported for regulators in mainline currently). The RPM firmware seems to enforce that internally, these supplies stay on even if we vote for them to power off (and there is no other processor running). This means it's pointless to keep sending enable/disable requests because they will just be ignored. Also, drivers are much more likely to get a wrong impression of the regulator status, because regulator_is_enabled() will return false when there are no users, even though the regulator is always on. Describe this properly by marking the regulators as always-on. The same changes was already made for MSM8916 in commit 8bbd35771f90 ("arm64: dts: qcom: msm8916-pm8916: Mark always-on regulators"). Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530-msm8939-regulators-v1-8-a3c3ac833567@gerhold.net commit 5cdab9a8c70c4d979909dd1bb6d1f3eacd9fa270 Author: Stephan Gerhold Date: Wed Jun 14 09:16:05 2023 +0200 arm64: dts: qcom: msm8939: Define regulator constraints next to usage Right now each MSM8939 device has a huge block of regulator constraints with allowed voltages for each regulator. For lack of better documentation these voltages are often copied as-is from the vendor device tree, without much extra thought. Unfortunately, the voltages in the vendor device trees are often misleading or even wrong, e.g. because: - There is a large voltage range allowed and the actual voltage is only set somewhere hidden in some messy vendor driver. This is often the case for pm8916_{l14,l15,l16} because they have a broad range of 1.8-3.3V by default. - The voltage is actually wrong but thanks to the voltage constraints in the RPM firmware it still ends up applying the correct voltage. To have proper regulator constraints it is important to review them in context of the usage. The current setup in the MSM8939 device trees makes this quite hard because each device duplicates the standard voltages for components of the SoC and mixes those with minor device-specific additions and dummy voltages for completely unused regulators. The actual usage of the regulators for the SoC components is in msm8939-pm8916.dtsi, so it can and should also define the related voltage constraints. These are not board-specific but defined in the MSM8939/PM8916 specification. There is no documentation available for MSM8939 but in practice it's almost identical to MSM8916. Note that this commit does not make any functional change. All used regulators still have the same regulator constraints as before. Unused regulators do not have regulator constraints anymore because most of these were too broad or even entirely wrong. They should be added back with proper voltage constraints when there is an actual usage. The same changes were already made for MSM8916 in commit b0a8f16ae4a0 ("arm64: dts: qcom: msm8916: Define regulator constraints next to usage"). Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530-msm8939-regulators-v1-7-a3c3ac833567@gerhold.net commit 88028fa047fb72826dd206b51550be780777718c Author: Stephan Gerhold Date: Wed Jun 14 09:16:04 2023 +0200 arm64: dts: qcom: msm8939-pm8916: Clarify purpose Add the same comment to msm8939-pm8916.dtsi that was added for the MSM8916 variant in commit f193264986b5 ("arm64: dts: qcom: msm8916-pm8916: Clarify purpose"). Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530-msm8939-regulators-v1-6-a3c3ac833567@gerhold.net commit 9187d555c4ba9544c7f117062d241aa085f59a06 Author: Stephan Gerhold Date: Wed Jun 14 09:16:03 2023 +0200 arm64: dts: qcom: msm8939: Fix regulator constraints The regulator constraints for the MSM8939 devices were originally taken from Qualcomm's msm-3.10 vendor device tree (for lack of better documentation). Unfortunately it turns out that Qualcomm's voltages are slightly off as well and do not match the voltage constraints applied by the RPM firmware. This means that we sometimes request a specific voltage but the RPM firmware actually applies a much lower or higher voltage. This is particularly critical for pm8916_l11 which is used as SD card VMMC regulator: The SD card can choose a voltage from the current range of 1.8 - 2.95V. If it chooses to run at 1.8V we pretend that this is fine but the RPM firmware will still silently end up configuring 2.95V. This can be easily reproduced with a multimeter or by checking the SPMI hardware registers of the regulator. Apply the same change as for MSM8916 in commit 355750828c55 ("arm64: dts: qcom: msm8916: Fix regulator constraints") and make the voltages match the actual "specified range" in the PM8916 Device Specification which is enforced by the RPM firmware. Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530-msm8939-regulators-v1-5-a3c3ac833567@gerhold.net commit 8771308c91cefc072f36415cec0b802ee55b1d96 Author: Stephan Gerhold Date: Wed Jun 14 09:16:02 2023 +0200 arm64: dts: qcom: msm8939-sony-tulip: Allow disabling pm8916_l6 The vendor kernel from Sony does not have regulator-always-on for pm8916_l6, so we should be able to disable it when setting up the display properly. Since sony-tulip does not have display set up currently it should be fine to let the regulator disable until then. Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530-msm8939-regulators-v1-4-a3c3ac833567@gerhold.net commit 209aea1ad505519faf018b596e4fdca0d0569469 Author: Stephan Gerhold Date: Wed Jun 14 09:16:01 2023 +0200 arm64: dts: qcom: msm8939-sony-tulip: Fix l10-l12 regulator voltages msm8939-sony-xperia-kanuti-tulip.dts has several regulator voltages that do not quite seem to match what is used in the vendor kernel. In particular: - l10 is fixed at 2.8V [1, 2] - l11/l12 are 2.95V max [1] [1]: https://github.com/sonyxperiadev/kernel/blob/aosp/LA.BR.1.3.3_rb2.14/arch/arm/boot/dts/qcom/msm8939-regulator.dtsi [2]: https://github.com/sonyxperiadev/kernel/blob/aosp/LA.BR.1.3.3_rb2.14/arch/arm/boot/dts/qcom/msm8939-kanuti_tulip.dtsi#L671C1-L673 Fixes: f1134f738fad ("arm64: dts: qcom: Add msm8939 Sony Xperia M4 Aqua") Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530-msm8939-regulators-v1-3-a3c3ac833567@gerhold.net commit 6002a78023cded6f02eac7c812b076046cab8060 Author: Stephan Gerhold Date: Wed Jun 14 09:16:00 2023 +0200 arm64: dts: qcom: msm8939: Disable lpass_codec by default Update for recent changes to msm8916.dtsi in commit a5cf21b14666 ("arm64: dts: qcom: msm8916: Disable audio codecs by default") and make lpass_codec disabled by default for devices that are not using the audio codec functionality inside MSM8939. Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530-msm8939-regulators-v1-2-a3c3ac833567@gerhold.net commit dce9254511d6c9ea0d5ed7e4f21e6206e2ca35ce Author: Stephan Gerhold Date: Wed Jun 14 09:15:59 2023 +0200 arm64: dts: qcom: msm8939-pm8916: Add missing pm8916_codec supplies Update for recent changes to pm8916.dtsi in commit 38218822a72f ("arm64: dts: qcom: pm8916: Move default regulator "-supply"s") and add the now missing pm8916_codec supplies to msm8939-pm8916.dtsi as well. Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530-msm8939-regulators-v1-1-a3c3ac833567@gerhold.net commit d34654f54ebad11263cf7c411d8c60cd8941e2d4 Author: Konrad Dybcio Date: Tue Jun 13 20:09:00 2023 +0200 arm64: dts: qcom: qrb4210-rb2: Enable on-board buttons Enable the PMIC GPIO- and RESIN-connected buttons on the board. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230613-topic-rb2_-v1-1-696cd7dbda28@linaro.org commit 5d85ea2c879781d296bd770f562d33a58161d2b1 Author: Vijaya Krishna Nivarthi Date: Wed Jun 14 16:58:07 2023 +0530 soc: qcom: geni-se: Do not bother about enable/disable of interrupts in secondary sequencer The select_fifo/dma_mode() functions in geni driver enable/disable interrupts (secondary included) conditionally for non-uart modes, while uart is supposed to manage this internally. However, only uart uses secondary IRQs while spi, i2c do not care about these at all making their enablement (or disablement) totally unnecessary for these protos. Similarly, select_gpi_mode() also does disable s_irq and its useless again. Drop enabling/disabling secondary IRQs. This doesn't solve any observed problem but only gets rid of code pieces that are not required. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1686742087-30731-1-git-send-email-quic_vnivarth@quicinc.com commit de658bcf03339561572e5dad3ec8ecedd1256747 Author: Jisheng Zhang Date: Tue May 9 23:26:41 2023 +0800 riscv: mm: stub extable related functions/macros for !MMU extable relies on the MMU to work properly, so it's useless to include __ex_table sections and build extable related functions for !MMU case. Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20230509152641.805-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit c818fea83de4cdf5072c7cf00dd289fc9c6e1c68 Author: Ben Dooks Date: Fri Mar 17 13:45:12 2023 +0000 riscv: say disabling zicbom if no or bad riscv,cbom-block-size found If Zicbom is present but there was no riscv,cbom-blocks-size property found during the cpu feeatures probe, or the cbom-block-size is not valid, then the extension will be disabled. Make the print explicitly say this is disabled to ensure that there is no confusion about what is being done. Signed-off-by: Ben Dooks Reviewed-by: Conor Dooley Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20230317134512.254627-1-ben.dooks@codethink.co.uk Signed-off-by: Palmer Dabbelt commit fed4be313a55e9a19fdabe99d1ec373e25889e2c Author: Kuninori Morimoto Date: Wed Jun 14 00:02:57 2023 +0000 ASoC: simple-card-utils.c: share asoc_graph_parse_dai() Current Audio Graph Card/Card2 implements asoc_simple_parse_dai() on each driver, but these are same function. This patch share it as asoc_graph_parse_dai(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87o7lihpvy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit f0d4627f645924edd855a3242ce4f2cdc3d61126 Author: Anshuman Khandual Date: Wed Jun 14 12:29:49 2023 +0530 arm64/sysreg: Convert TRBIDR_EL1 register to automatic generation This converts TRBIDR_EL1 register to automatic generation without causing any functional change. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Mark Brown Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-15-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit a56035c95ec6b55746528a107a4dcdeb8bac0147 Author: Anshuman Khandual Date: Wed Jun 14 12:29:48 2023 +0530 arm64/sysreg: Convert TRBTRG_EL1 register to automatic generation This converts TRBTRG_EL1 register to automatic generation without causing any functional change. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Mark Brown Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-14-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit 3077b1db9d5743c64343f47d88f1da89625c2590 Author: Anshuman Khandual Date: Wed Jun 14 12:29:47 2023 +0530 arm64/sysreg: Convert TRBMAR_EL1 register to automatic generation This converts TRBMAR_EL1 register to automatic generation without causing any functional change. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Mark Brown Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-13-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit 46f3a5b01fd796f657ecbbefff9874e43e172391 Author: Anshuman Khandual Date: Wed Jun 14 12:29:46 2023 +0530 arm64/sysreg: Convert TRBSR_EL1 register to automatic generation This converts TRBSR_EL1 register to automatic generation without causing any functional change. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Mark Brown Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-12-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit cbaf0cf005f0de92532b713fd8f7497a129f588b Author: Anshuman Khandual Date: Wed Jun 14 12:29:45 2023 +0530 arm64/sysreg: Convert TRBBASER_EL1 register to automatic generation This converts TRBBASER_EL1 register to automatic generation without causing any functional change. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Mark Brown Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-11-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit 6669697733ca50d9be9e14cdfd2318bc37d84d97 Author: Anshuman Khandual Date: Wed Jun 14 12:29:44 2023 +0530 arm64/sysreg: Convert TRBPTR_EL1 register to automatic generation This converts TRBPTR_EL1 register to automatic generation without causing any functional change. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Mark Brown Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-10-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit eee64165a54e8e045fffa41950b60af51856266c Author: Anshuman Khandual Date: Wed Jun 14 12:29:43 2023 +0530 arm64/sysreg: Convert TRBLIMITR_EL1 register to automatic generation This converts TRBLIMITR_EL1 register to automatic generation without causing any functional change. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Mark Brown Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-9-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit f170aa51e6c53f49e90805d1fffb55fd199f82b3 Author: Anshuman Khandual Date: Wed Jun 14 12:29:42 2023 +0530 arm64/sysreg: Rename TRBIDR_EL1 fields per auto-gen tools format This renames TRBIDR_EL1 register fields per auto-gen tools format without causing any functional change in the TRBE driver. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: kvmarm@lists.linux.dev Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-8-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit dae169fd63f323b4dea1a01beb46c558e10315ac Author: Anshuman Khandual Date: Wed Jun 14 12:29:41 2023 +0530 arm64/sysreg: Rename TRBTRG_EL1 fields per auto-gen tools format This renames TRBTRG_EL1 register fields per auto-gen tools format without causing any functional change in the TRBE driver. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: kvmarm@lists.linux.dev Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-7-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit b7c3a6eb4d2b6abf9aa2b08d70e5fc9008797a86 Author: Anshuman Khandual Date: Wed Jun 14 12:29:40 2023 +0530 arm64/sysreg: Rename TRBMAR_EL1 fields per auto-gen tools format This renames TRBMAR_EL1 register fields per auto-gen tools format without causing any functional change in the TRBE driver. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: kvmarm@lists.linux.dev Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-6-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit 7bb948826610f05b42567ce89156d6513d53d988 Author: Anshuman Khandual Date: Wed Jun 14 12:29:39 2023 +0530 arm64/sysreg: Rename TRBSR_EL1 fields per auto-gen tools format This renames TRBSR_EL1 register fields per auto-gen tools format without causing any functional change in the TRBE driver. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: kvmarm@lists.linux.dev Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-5-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit 90cdde836c43154acb474553095bb7ee741160a5 Author: Anshuman Khandual Date: Wed Jun 14 12:29:38 2023 +0530 arm64/sysreg: Rename TRBBASER_EL1 fields per auto-gen tools format This renames TRBBASER_EL1 register fields per auto-gen tools format without causing any functional change in the TRBE driver. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: kvmarm@lists.linux.dev Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-4-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit e01e1737e348acdfc43a620060410559072f29c1 Author: Anshuman Khandual Date: Wed Jun 14 12:29:37 2023 +0530 arm64/sysreg: Rename TRBPTR_EL1 fields per auto-gen tools format This renames TRBPTR_EL1 register fields per auto-gen tools format without causing any functional change in the TRBE driver. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: kvmarm@lists.linux.dev Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-3-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit 92b1efcd9d9d984af1e60ae4f575eb2c5bfea303 Author: Anshuman Khandual Date: Wed Jun 14 12:29:36 2023 +0530 arm64/sysreg: Rename TRBLIMITR_EL1 fields per auto-gen tools format This renames TRBLIMITR_EL1 register fields per auto-gen tools format without causing any functional change in the TRBE driver. Cc: Will Deacon Cc: Marc Zyngier Cc: Mark Brown Cc: Rob Herring Cc: Suzuki K Poulose Cc: James Morse Cc: kvmarm@lists.linux.dev Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230614065949.146187-2-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit ea861df772fd8cca715d43f62fe13c09c975f7a2 Author: Chen-Yu Tsai Date: Fri Jun 9 16:30:03 2023 +0800 regulator: mt6358: Use linear voltage helpers for single range regulators Some of the regulators on the MT6358/MT6366 PMICs have just one linear voltage range. These are the bulk regulators and VSRAM_* LDOs. Currently they are modeled with one linear range, but also have their minimum, maximum, and step voltage described. Convert them to the linear voltage helpers. These helpers are a bit simpler, and we can also drop the linear range definitions. Also reflow the touched lines now that they are shorter. Signed-off-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20230609083009.2822259-7-wenst@chromium.org Signed-off-by: Mark Brown commit 1ff35e66cae53f7090a671afddaee45d4ccd9396 Author: Chen-Yu Tsai Date: Fri Jun 9 16:30:02 2023 +0800 regulator: mt6358: Const-ify mt6358_regulator_info data structures In the MT6358 regulator driver, each regulator is described by a |struct regulator_desc| wrapped by a |struct mt6358_regulator_info|. The latter was tied to the regulator device using the config's driver_data field, which meant that the variables could not be constant. Since each regulator device has a pointer to its regulator_desc, and mt6358_regulator_info wraps that, the driver could use container_of() to retrieve it instead. Switch to using container_of(), drop tha driver_data setting, and const-ify all the regulator descriptions. Signed-off-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20230609083009.2822259-6-wenst@chromium.org Signed-off-by: Mark Brown commit 04ba665248ed91576d326041108e5fc2ec2254eb Author: Chen-Yu Tsai Date: Fri Jun 9 16:30:01 2023 +0800 regulator: mt6358: Drop *_SSHUB regulators The *_SSHUB regulators are actually alternate configuration interfaces for their non *_SSHUB counterparts. They are not separate regulator outputs. These registers are intended for the companion processor to use to configure the power rails while the main processor is sleeping. They are not intended for the main operating system to use. Since they are not real outputs they shouldn't be modeled separately. Remove them. Luckily no device tree actually uses them. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20230609083009.2822259-5-wenst@chromium.org Signed-off-by: Mark Brown commit 65bae54e08c109ddbbf121bb00058cf3b3fb7b8e Author: Chen-Yu Tsai Date: Fri Jun 9 16:30:00 2023 +0800 regulator: mt6358: Merge VCN33_* regulators The VCN33_BT and VCN33_WIFI regulators are actually the same regulator, having the same voltage setting and output pin. There are simply two enable bits that are ORed together to enable the regulator. Having two regulators representing the same output pin is misleading from a design matching standpoint, and also error-prone in driver implementations. If consumers try to set different voltages on either regulator, the one set later would override the one set before. There are ways around this, such as chaining them together and having the downstream one act as a switch. But given there's only one output pin, such a workaround doesn't match reality. Remove the VCN33_WIFI regulator. During the probe phase, have the driver sync the enable status of VCN33_WIFI to VCN33_BT. Also drop the suffix so that the regulator name matches the pin name in the datasheet. Signed-off-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20230609083009.2822259-4-wenst@chromium.org Signed-off-by: Mark Brown commit 82f305b18eb0505444eab8ac86bfa134b67cb38e Author: Chen-Yu Tsai Date: Fri Jun 9 16:29:59 2023 +0800 regulator: dt-bindings: mt6358: Drop *_sshub regulators The *_sshub regulators are actually alternate configuration interfaces for their non *_sshub counterparts. They are not separate regulator outputs. These registers are intended for the companion processor to use to configure the power rails while the main processor is sleeping. They are not intended for the main operating system to use. Since they are not real outputs they shouldn't be modeled separately. Remove them. Luckily no device tree actually uses them. Signed-off-by: Chen-Yu Tsai Reviewed-by: Matthias Brugger Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230609083009.2822259-3-wenst@chromium.org Signed-off-by: Mark Brown commit a74d4c577c60b27fc57ea734ef8275921ae8dcb2 Author: Chen-Yu Tsai Date: Fri Jun 9 16:29:58 2023 +0800 regulator: dt-bindings: mt6358: Merge ldo_vcn33_* regulators The ldo_vcn33_bt and ldo_vcn33_wifi regulators are actually the same regulator, having the same voltage setting and output pin. There are simply two enable bits that are ORed together to enable the regulator. Having two regulators representing the same output pin is misleading from a design matching standpoint, and also error-prone in driver implementations. Merge the two as ldo_vcn33. Neither vcn33 regulators are referenced in upstream device trees. As far as hardware designs go, none of the Chromebooks using MT8183 w/ MT6358 use this output. Signed-off-by: Chen-Yu Tsai Acked-by: Krzysztof Kozlowski Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20230609083009.2822259-2-wenst@chromium.org Signed-off-by: Mark Brown commit 6070131176af5375ae9fa24efebda41c878f4ec2 Merge: d44c404207831 460af1f9d9e62 Author: Jens Axboe Date: Wed Jun 14 06:58:43 2023 -0600 Merge tag 'md-next-20230613' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-6.5/block Pull MD updates from Song: "The major changes are: 1. Protect md_thread with rcu, by Yu Kuai; 2. Various non-urgent raid5 and raid1/10 fixes, by Yu Kuai; 3. Non-urgent raid10 fixes, by Li Nan." * tag 'md-next-20230613' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: (29 commits) md/raid1-10: limit the number of plugged bio md/raid1-10: don't handle pluged bio by daemon thread md/md-bitmap: add a new helper to unplug bitmap asynchrously md/raid1-10: submit write io directly if bitmap is not enabled md/raid1-10: factor out a helper to submit normal write md/raid1-10: factor out a helper to add bio to plug md/raid10: prevent soft lockup while flush writes md/raid10: fix io loss while replacement replace rdev md/raid10: Do not add spare disk when recovery fails md/raid10: clean up md_add_new_disk() md/raid10: prioritize adding disk to 'removed' mirror md/raid10: improve code of mrdev in raid10_sync_request md/raid10: fix null-ptr-deref of mreplace in raid10_sync_request md/raid5: don't start reshape when recovery or replace is in progress md: protect md_thread with rcu md/bitmap: factor out a helper to set timeout md/bitmap: always wake up md_thread in timeout_store dm-raid: remove useless checking in raid_message() md: factor out a helper to wake up md_thread directly md: fix duplicate filename for rdev ... commit d44c404207831dfe3b301ff479e964b77914488b Author: David Howells Date: Tue Jun 13 22:54:39 2023 +0100 block: Fix dio_cleanup() to advance the head index Fix dio_bio_cleanup() to advance the head index into the list of pages past the pages it has released, as __blockdev_direct_IO() will call it twice if do_direct_IO() fails. The issue was causing: WARNING: CPU: 6 PID: 2220 at mm/gup.c:76 try_get_folio This can be triggered by setting up a clean pair of UDF filesystems on loopback devices and running the generic/451 xfstest with them as the scratch and test partitions. Something like the following: fallocate /mnt2/udf_scratch -l 1G fallocate /mnt2/udf_test -l 1G mknod /dev/lo0 b 7 0 mknod /dev/lo1 b 7 1 losetup lo0 /mnt2/udf_scratch losetup lo1 /mnt2/udf_test mkfs -t udf /dev/lo0 mkfs -t udf /dev/lo1 cd xfstests ./check generic/451 with xfstests configured by putting the following into local.config: export FSTYP=udf export DISABLE_UDF_TEST=1 export TEST_DEV=/dev/lo1 export TEST_DIR=/xfstest.test export SCRATCH_DEV=/dev/lo0 export SCRATCH_MNT=/xfstest.scratch Fixes: 1ccf164ec866 ("block: Use iov_iter_extract_pages() and page pinning in direct-io.c") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202306120931.a9606b88-oliver.sang@intel.com Signed-off-by: David Howells cc: Christoph Hellwig cc: David Hildenbrand cc: Andrew Morton cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox cc: Jan Kara cc: Jeff Layton cc: Jason Gunthorpe cc: Logan Gunthorpe cc: Hillf Danton cc: Christian Brauner cc: Linus Torvalds cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-kernel@vger.kernel.org cc: linux-mm@kvack.org Reviewed-by: David Hildenbrand Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/1193485.1686693279@warthog.procyon.org.uk Signed-off-by: Jens Axboe commit fa0e21fa44438a0e856d42224bfa24641d37b979 Author: Edwin Peer Date: Sun Jun 11 13:51:08 2023 +0300 rtnetlink: extend RTEXT_FILTER_SKIP_STATS to IFLA_VF_INFO This filter already exists for excluding IPv6 SNMP stats. Extend its definition to also exclude IFLA_VF_INFO stats in RTM_GETLINK. This patch constitutes a partial fix for a netlink attribute nesting overflow bug in IFLA_VFINFO_LIST. By excluding the stats when the requester doesn't need them, the truncation of the VF list is avoided. While it was technically only the stats added in commit c5a9f6f0ab40 ("net/core: Add drop counters to VF statistics") breaking the camel's back, the appreciable size of the stats data should never have been included without due consideration for the maximum number of VFs supported by PCI. Fixes: 3b766cd83232 ("net/core: Add reading VF statistics through the PF netdevice") Fixes: c5a9f6f0ab40 ("net/core: Add drop counters to VF statistics") Signed-off-by: Edwin Peer Cc: Edwin Peer Signed-off-by: Gal Pressman Link: https://lore.kernel.org/r/20230611105108.122586-1-gal@nvidia.com Signed-off-by: Paolo Abeni commit 2b026eabc3152592be75b7d7e73e9536b9eeb794 Author: Rob Herring Date: Tue Jun 13 14:09:56 2023 -0600 regulator: dt-bindings: pwm-regulator: Add missing type for "pwm-dutycycle-unit" "pwm-dutycycle-unit" is missing a type, add it. Signed-off-by: Rob Herring Reviewed-by: Conor Dooley Reviewed-by: Brian Norris Link: https://lore.kernel.org/r/20230613200956.2822740-1-robh@kernel.org Signed-off-by: Mark Brown commit eab5abdeb79f0f694c007c3a76a97902705c86f0 Author: Mark Brown Date: Tue Jun 13 21:07:16 2023 +0100 regmap: Check for register readability before checking cache during read Ensure that we don't return a spurious cache hit for unreadable registers (eg, with the flat cache which doesn't understand sparseness) by checking for readability before we do a cache lookup. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230613-b4-regmap-check-readability-before-cache-v1-1-b144c0b01ed9@kernel.org Signed-off-by: Mark Brown commit 357a1ebd0c012f5421252547ebf4ee619b45733d Author: Mark Brown Date: Tue Jun 13 21:17:44 2023 +0100 regmap: Add test to make sure we don't sync to read only registers Ensure that a read only value in the register cache does not result in a write during regcache_sync(). Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230613-regmap-kunit-read-write-v1-3-2db337c52827@kernel.org Signed-off-by: Mark Brown commit a07bff4054c9e2b3a5c5790312a4a45aaeca7afe Author: Mark Brown Date: Tue Jun 13 21:17:43 2023 +0100 regmap: Add a test case for write only registers Validate that attempts to read from write only registers fail and don't somehow trigger spurious hardware accesses. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230613-regmap-kunit-read-write-v1-2-2db337c52827@kernel.org Signed-off-by: Mark Brown commit 180033061e203a7c5510e7c38bccd885657de517 Author: Mark Brown Date: Tue Jun 13 21:17:42 2023 +0100 regmap: Add test that writes to write only registers are prevented We should have error checking that verifies that writes to write only registers are suppressed, verify that this happens as it should. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230613-regmap-kunit-read-write-v1-1-2db337c52827@kernel.org Signed-off-by: Mark Brown commit fd01a15164a15328fd96f9ce820f0fc9f700f00b Author: Venkata Prasad Potturu Date: Wed Jun 14 16:07:05 2023 +0530 ASoC: SOF: amd: Add support for IPC with a reply_size set to zero Add support for IPC tx_message with a reply_size set to zero, return zero when message reply_size is zero at acp_dsp_ipc_get_reply(). Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/20230614103707.2246296-1-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown commit a3f6df1bf514516d276e90d38ca11581701f2e8e Author: Rob Herring Date: Tue Jun 13 14:10:05 2023 -0600 ASoC: dt-bindings: ti,tlv320aic3x: Add missing type for "gpio-reset" "gpio-reset" may be deprecated, but it still needs a type. Signed-off-by: Rob Herring Acked-by: Jai Luthra Link: https://lore.kernel.org/r/20230613201006.2822985-1-robh@kernel.org Signed-off-by: Mark Brown commit 22691a051377763e6a4e149b7362944253fb434a Author: Mark Brown Date: Sat Jun 10 15:27:19 2023 +0100 ASoC: rt1318: Use maple tree register cache The rt1318 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Tested-by: Bard Liao Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-8-85ee50c93905@kernel.org Signed-off-by: Mark Brown commit 6179a2e84f0b0b353079fe965d321ed25251c996 Author: Mark Brown Date: Sat Jun 10 15:27:18 2023 +0100 ASoC: rt1316: Use maple tree register cache The rt1316 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Tested-by: Bard Liao Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-7-85ee50c93905@kernel.org Signed-off-by: Mark Brown commit 4f69e29ace9dce5f8226bfc99b77b8497d3d3d79 Author: Mark Brown Date: Sat Jun 10 15:27:17 2023 +0100 ASoC: rt1308: Use maple tree register cache The rt1308 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Tested-by: Bard Liao Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-6-85ee50c93905@kernel.org Signed-off-by: Mark Brown commit 799457a3200b0451ca9859c77dd4e863f70ba608 Author: Mark Brown Date: Sat Jun 10 15:27:16 2023 +0100 ASoC: rt722: Use maple tree register cache The rt722 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Tested-by: Bard Liao Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-5-85ee50c93905@kernel.org Signed-off-by: Mark Brown commit dd08b6ddcb319375b4ee69cd02ce3298ca7608aa Author: Mark Brown Date: Sat Jun 10 15:27:15 2023 +0100 ASoC: rt715: Use maple tree register cache The rt715 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Tested-by: Bard Liao Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-4-85ee50c93905@kernel.org Signed-off-by: Mark Brown commit f438c799aa934fcd9b956083043b6f691bcc8492 Author: Mark Brown Date: Sat Jun 10 15:27:14 2023 +0100 ASoC: rt712: Use maple tree register cache The rt712 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Tested-by: Bard Liao Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-3-85ee50c93905@kernel.org Signed-off-by: Mark Brown commit 0a5757293339fbbbb627baa7d2da65fd083c7cce Author: Mark Brown Date: Sat Jun 10 15:27:13 2023 +0100 ASoC: rt711: Use maple tree register cache The rt711 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Tested-by: Bard Liao Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-2-85ee50c93905@kernel.org Signed-off-by: Mark Brown commit 049a78048e15ab276052d846c9692ea272699644 Author: Mark Brown Date: Sat Jun 10 15:27:12 2023 +0100 ASoC: rt700: Use maple tree register cache The rt700 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Tested-by: Bard Liao Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-rt-sdw-maple-v1-1-85ee50c93905@kernel.org Signed-off-by: Mark Brown commit c180f85825e577225372b983fc86dd8d4be89de6 Merge: 2bddad9ec65a9 d4a37bf0943d7 Author: Paolo Abeni Date: Wed Jun 14 13:13:35 2023 +0200 Merge branch 'mlxsw-preparations-for-out-of-order-operations-patches' Petr Machata says: ==================== mlxsw: Preparations for out-of-order-operations patches The mlxsw driver currently makes the assumption that the user applies configuration in a bottom-up manner. Thus netdevices need to be added to the bridge before IP addresses are configured on that bridge or SVI added on top of it. Enslaving a netdevice to another netdevice that already has uppers is in fact forbidden by mlxsw for this reason. Despite this safety, it is rather easy to get into situations where the offloaded configuration is just plain wrong. As an example, take a front panel port, configure an IP address: it gets a RIF. Now enslave the port to a bridge, and the RIF is gone. Remove the port from the bridge again, but the RIF never comes back. There is a number of similar situations, where changing the configuration there and back utterly breaks the offload. Over the course of the following several patchsets, mlxsw code is going to be adjusted to diminish the space of wrongly offloaded configurations. Ideally the offload state will reflect the actual state, regardless of the sequence of operation used to construct that state. No functional changes are intended in this patchset yet. Rather the patches prepare the codebase for easier introduction of functional changes in later patchsets. - In patch #1, extract a helper to join a RIF of a given port, if there is one. In patch #2, use it in a newly-added helper to join a LAG interface. - In patches #3, #4 and #5, add helpers that abstract away the rif->dev access. This will make it simpler in the future to change the way the deduction is done. In patch #6, do this for deduction from nexthop group info to RIF. - In patch #7, add a helper to destroy a RIF. So far RIF was destroyed simply by kfree'ing it. - In patch #8, add a helper to check if any IP addresses are configured on a netdevice. This helper will be useful later. - In patch #9, add a helper to migrate a RIF. This will be a convenient place to put extensions later on. - Patch #10 move IPIP initialization up to make ipip_ops_arr available earlier. ==================== Link: https://lore.kernel.org/r/cover.1686581444.git.petrm@nvidia.com Signed-off-by: Paolo Abeni commit d4a37bf0943d70ca78ae93da9b05e70632c2019c Author: Petr Machata Date: Mon Jun 12 17:31:09 2023 +0200 mlxsw: spectrum_router: Move IPIP init up mlxsw will need to keep track of certain devices that are not related to any of its front panel ports. This includes IPIP netdevices. To be able to query the list of supported IPIP types, router->ipip_ops_arr needs to be initialized. To that end, move the IPIP initialization up (and finalization correspondingly down). Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Paolo Abeni commit 440273e763f575bfd801e00a8892a9abb82fa263 Author: Petr Machata Date: Mon Jun 12 17:31:08 2023 +0200 mlxsw: spectrum_router: Extract a helper for RIF migration RIF configuration contains a number of parameters that cannot be changed after the RIF is created. For the IPIP loopbacks, this is currently worked around by creating a new RIF with the desired configuration changes applied, and updating next hops to the new RIF, and then destroying the old RIF. This operation will be useful as a reusable atom, so extract a helper to that effect. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Paolo Abeni commit 33d11c4e5ce922bc16493fc75ad3c20cc55ed88a Author: Petr Machata Date: Mon Jun 12 17:31:07 2023 +0200 mlxsw: spectrum_router: Add a helper to check if netdev has addresses This function will be useful later as the driver will need to retroactively create RIFs for new uppers with addresses. Add another helper that assumes RCU lock, and restructure the code to skip the IPv6 branch not through conditioning on the addr_list_empty variable, but by directly returning the result value. This makes the skip more obvious than it previously was. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Paolo Abeni commit 571c56911b45059dbdd2fb7912152e3412b658cf Author: Petr Machata Date: Mon Jun 12 17:31:06 2023 +0200 mlxsw: spectrum_router: Extract a helper to free a RIF Right now freeing the object that mlxsw uses to keep track of a RIF is as simple as calling a kfree. But later on as CRIF abstraction is brought in, it will involve severing the link between CRIF and its RIF as well. Better to have the logic encapsulated in a helper. Since a helper is being introduced, make it a full-fledged destructor and have it validate that the objects tracked at the RIF have been released. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Paolo Abeni commit 532b6e2bbc190c899086da5be1fd83e69fb41c12 Author: Petr Machata Date: Mon Jun 12 17:31:05 2023 +0200 mlxsw: spectrum_router: Access nhgi->rif through a helper To abstract away deduction of RIF from the corresponding next hop group info (NHGI), mlxsw currently uses a macro. In its current form, that macro is impossible to extend to more general computation. Therefore introduce a helper, mlxsw_sp_nhgi_rif(), and use it throughout. This will make it possible to change the deduction path easily later on. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Paolo Abeni commit 69f4ba177d6bb863925e586fa15bd0d454a875d7 Author: Petr Machata Date: Mon Jun 12 17:31:04 2023 +0200 mlxsw: spectrum_router: Access nh->rif->dev through a helper In order to abstract away deduction of netdevice from the corresponding next hop, introduce a helper, mlxsw_sp_nexthop_dev(), and use it throughout. This will make it possible to change the deduction path easily later on. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Paolo Abeni commit 2019b5eeae2af862af41882b0863d61dfdaee25d Author: Petr Machata Date: Mon Jun 12 17:31:03 2023 +0200 mlxsw: spectrum_router: Access rif->dev from params in mlxsw_sp_rif_create() The previous patch added a helper to access a netdevice given a RIF. Using this helper in mlxsw_sp_rif_create() is unreasonable: the netdevice was given in RIF creation parameters. Just take it there. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Paolo Abeni commit fb6ac45e86668456e5750d2a1c874ca2f5526171 Author: Petr Machata Date: Mon Jun 12 17:31:02 2023 +0200 mlxsw: spectrum_router: Access rif->dev through a helper In order to abstract away deduction of netdevice from the corresponding RIF, introduce a helper, mlxsw_sp_rif_dev(), and use it throughout. This will make it possible to change the deduction path easily later on. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Paolo Abeni commit 76962b802efe27a32425d2abe818e53167c71dbe Author: Petr Machata Date: Mon Jun 12 17:31:01 2023 +0200 mlxsw: spectrum_router: Add a helper specifically for joining a LAG Currently, joining a LAG very simply means that the LAG RIF should be joined by the subport representing untagged traffic. If the RIF does not exist, it does not have to be created: if the user wants there to be RIF for the LAG device, they are supposed to add an IP address, and they are supposed to do it after tha LAG becomes mlxsw upper. We can also assume that the LAG has no uppers, otherwise the enslavement is not allowed. In the future, these ordering dependencies should be removed. That means that joining LAG will be more complex operation, possibly involving a lazy RIF creation, and possibly joining / lazily creating RIFs for VLAN uppers of the LAG. It will be handy to have a dedicated function that handles all this. The new function mlxsw_sp_router_port_join_lag() is that. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Paolo Abeni commit e0db883b6949bd0b5b221893e30afd5f838783b1 Author: Petr Machata Date: Mon Jun 12 17:31:00 2023 +0200 mlxsw: spectrum_router: Extract a helper from mlxsw_sp_port_vlan_router_join() Split out of mlxsw_sp_port_vlan_router_join() the part that checks for RIF and dispatches to __mlxsw_sp_port_vlan_router_join(), leaving it as wrapper that just manages the router lock. The new function, mlxsw_sp_port_vlan_router_join_existing(), will be useful as an atom in later patches. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Paolo Abeni commit 715084ecc25adafe7f724721807b64fcc3a13e4a Author: Aswath Govindraju Date: Fri Mar 31 14:30:28 2023 +0530 arm64: dts: ti: k3-j721s2-common-proc-board: Enable PCIe x1 lane PCIe slot in the common processor board is enabled and connected to J721S2 SOM. Add PCIe DT node in common processor board to reflect the same. Reviewed-by: Siddharth Vadapalli Signed-off-by: Aswath Govindraju Signed-off-by: Matt Ranostay Signed-off-by: Ravi Gunasekaran Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230331090028.8373-9-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit b6f18aa80f4eee59f9292f0007c021cb7e7dbbec Author: Aswath Govindraju Date: Fri Mar 31 14:30:27 2023 +0530 arm64: dts: ti: k3-j721s2-main: Add PCIe device tree node Add PCIe1 RC device tree node for the single PCIe instance present on the J721S2. Reviewed-by: Siddharth Vadapalli Signed-off-by: Aswath Govindraju Signed-off-by: Matt Ranostay Signed-off-by: Ravi Gunasekaran Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230331090028.8373-8-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit bbabba4ece74c51b98e7c8dbd8fa4725d0ae9baf Author: Aswath Govindraju Date: Fri Mar 31 14:30:26 2023 +0530 arm64: dts: ti: k3-j721s2: Add support for OSPI Flashes J721S2 has an OSPI NOR flash on its SOM connected the OSPI0 instance and a QSPI NOR flash on the common processor board connected to the OSPI1 instance. Add support for the same Reviewed-by: Vaishnav Achath Signed-off-by: Aswath Govindraju Signed-off-by: Matt Ranostay Signed-off-by: Ravi Gunasekaran Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230331090028.8373-7-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit 7743a9d7517a6a1f3b21d32db3bc1d00d6b16983 Author: Aswath Govindraju Date: Fri Mar 31 14:30:25 2023 +0530 arm64: dts: ti: k3-j721s2-common-proc-board: Add USB support The board uses lane 1 of SERDES for USB. Set the mux accordingly. The USB controller and EVM supports super-speed for USB0 on the Type-C port. However, the SERDES has a limitation that up to 2 protocols can be used at a time. The SERDES is wired for PCIe, eDP and USB super-speed. It has been chosen to use PCIe and eDP as default. So restrict USB0 to high-speed mode. Signed-off-by: Aswath Govindraju Signed-off-by: Matt Ranostay Signed-off-by: Ravi Gunasekaran Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230331090028.8373-6-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit da61731dc7f5d7a676acd81124229b57e6fbe0ef Author: Aswath Govindraju Date: Fri Mar 31 14:30:24 2023 +0530 arm64: dts: ti: k3-j721s2-common-proc-board: Enable SERDES0 Configure first lane to PCIe, the second lane to USB and the last two lanes to eDP. Also, add sub-nodes to SERDES0 DT node to represent SERDES0 is connected to PCIe. Signed-off-by: Aswath Govindraju Signed-off-by: Matt Ranostay Signed-off-by: Ravi Gunasekaran Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230331090028.8373-5-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit 80cfbf2f4ac735ab8e72a3c70188c433f06810c1 Author: Aswath Govindraju Date: Fri Mar 31 14:30:23 2023 +0530 arm64: dts: ti: k3-j721s2-mcu-wakeup: Add support of OSPI Add support for two instance of OSPI in J721S2 SoC. Reviewed-by: Vaishnav Achath Signed-off-by: Aswath Govindraju Signed-off-by: Matt Ranostay Signed-off-by: Ravi Gunasekaran Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230331090028.8373-4-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit 393eee04065d26d53e9167e3721ad9a0ff89d40f Author: Matt Ranostay Date: Fri Mar 31 14:30:22 2023 +0530 arm64: dts: ti: k3-j721s2-main: Add SERDES and WIZ device tree node Add dt node for the single instance of WIZ (SERDES wrapper) and SERDES module shared by PCIe, eDP and USB. Signed-off-by: Matt Ranostay Signed-off-by: Ravi Gunasekaran Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230331090028.8373-3-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit 20fcf9d691ff6cde865f8486288b7babe1826b49 Author: Aswath Govindraju Date: Fri Mar 31 14:30:21 2023 +0530 arm64: dts: ti: k3-j721s2-main: Add support for USB Add support for single instance of USB 3.0 controller in J721S2 SoC. Signed-off-by: Aswath Govindraju Signed-off-by: Matt Ranostay Signed-off-by: Ravi Gunasekaran Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230331090028.8373-2-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit 2c213d19515caf880e6c8266fbeda4145894c10e Author: Roger Quadros Date: Thu Mar 30 11:49:53 2023 +0300 arm64: dts: ti: k3-am625: Enable Type-C port for USB0 USB0 is a Type-C port with dual data role and power sink. Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20230330084954.49763-3-rogerq@kernel.org Signed-off-by: Vignesh Raghavendra commit 93ae81454b1107843ad36dcdc457dd10ee0f2cbe Author: Johannes Berg Date: Tue Jun 13 15:57:27 2023 +0300 wifi: iwlwifi: dbg-tlv: clear FW debug memory on init When we restart the firmware, we shouldn't keep old debug data around. Since the "allocate" function might not reallocate the memory blocks (they're only freed when we unbind from the device), clear the memory to have a clean slate for debug data. This is a bit more complex since we normally don't enter into the allocation function, but duplicating the logic didn't seem enticing either, so rework the allocation a bit to always go into the individual block allocation, but there clear if it's already allocated, rather than allocating again. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.30b82881cfbf.I39520aff8ac95ee64d39dc5913525a1efd7995fa@changeid Signed-off-by: Johannes Berg commit 855e2f60fe341a4fd1f9343ed07d6e7fd05ab3f6 Author: Johannes Berg Date: Tue Jun 13 15:57:26 2023 +0300 wifi: iwlwifi: pcie: remove redundant argument The iwl_pcie_alloc_fw_monitor_block() function has an argument that's only ever hard-coded to 11, remove it and hard-code the value into the function itself with a comment. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.737c153e8259.Ibe6250ca812cfa2f00ac47e5e0d1595c6b9b4875@changeid Signed-off-by: Johannes Berg commit 583c58e3b1fa3718c52a5cbba2176cc30688c53c Author: Johannes Berg Date: Tue Jun 13 15:57:25 2023 +0300 wifi: iwlwifi: pcie: clear FW debug memory on init When we restart the firmware, we shouldn't keep old debug data around. Since the "allocate" function might not reallocate the memory block (it's only freed when we unbind from the device), clear the memory to have a clean slate for debug data. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.73c32255a132.Ibd7101dcd285b01ee879fddfbf52c30d49ced3c0@changeid Signed-off-by: Johannes Berg commit c2a2f505e0bcb45052131d173504887041e1faae Author: Johannes Berg Date: Tue Jun 13 15:57:24 2023 +0300 wifi: iwlwifi: dbg-tlv: fix DRAM data init Given the existing code in iwl_dbg_tlv_update_drams(), the following can happen and cause firmware asserts, and even the device to become unusable: * We set the magic so the firmware will use the data; * we try to fill multiple allocation IDs, with at least one successful, but - crucially - one failing and thus not touching the data; * we don't clear the data since there was one success. This doesn't seem like much of a problem just yet, however, what happens now is that the allocation ID(s) that failed are not initialized. There are two additional things to know: * we never free these allocations across FW restart or interface down/up etc., in fact we never free them until the driver is unbound from the device (e.g. unloaded) * the firmware uses the DRAM info structure for real debug data when it has used it completely Given that, and the fact that we never initialize the data on restart, we can be unlucky and end up with an allocation that looks for the most part valid (valid ID, valid number of buffers, etc.) but has bad sizes - causing the firmware to throw an assert we can never recover from. Fixing the code to have the entire buffers cleared (which we should do so old debug data isn't sticking around) is a bit more complex, so as a first step make the actual code that fills the information more robust by clearing the structure first, and filling the magic values only if it actually succeeded for one, rather than doing it the other way around. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.87cf5528f4bc.I26ac907a4162297808b33467fc7f5d8177474a34@changeid Signed-off-by: Johannes Berg commit 1724fc781ffe6e1e44dfe25c3a27e19db42dc0ff Author: Emmanuel Grumbach Date: Tue Jun 13 15:57:23 2023 +0300 wifi: iwlwifi: mvm: allow ADD_STA not to be advertised by the firwmare Newest firmware don't advertise the version of ADD_STA because it has been replaced by another command. There are old firmware images that also don't advertise it. Replace all the checks with a new inline, and in that check for either MLD API or the ADD_STA command version. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.4b9305510223.I7cc143d87186f8441e9b8435cc550b76734c7eef@changeid Signed-off-by: Johannes Berg commit d615ea32f62042c3484520dca648f5120fb1035a Author: Johannes Berg Date: Tue Jun 13 15:57:22 2023 +0300 wifi: iwlwifi: mvm: put only a single IGTK into FW The firmware only supports a single IGTK, and due to some changes it really doesn't like to have multiple programmed in later versions. Since only newer firmware cannot remove a key that isn't present any more, adjust only the MLD API code to keep track of the previous IGTK and remove it when a new one is added. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.3fde1ef09270.I2e12a3b0bba4325c07dc8fcce39b711f158bd621@changeid Signed-off-by: Johannes Berg commit 637452360ecde9ac972d19416e9606529576b302 Author: Gregory Greenman Date: Tue Jun 13 15:57:21 2023 +0300 wifi: iwlwifi: mvm: fix potential array out of bounds access Account for IWL_SEC_WEP_KEY_OFFSET when needed while verifying key_len size in iwl_mvm_sec_key_add(). Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.f193b7493a93.I6948ba625b9318924b96a5e22602ac75d2bd0125@changeid Signed-off-by: Johannes Berg commit 9c5608b3643e99ad03c4a99e88842f2a3ce7f1e0 Author: Mukesh Sisodiya Date: Tue Jun 13 15:57:20 2023 +0300 wifi: iwlwifi: support version C0 of BZ and GL devices Add support for C0 version of MAC and RF for BZ and GL devices. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.90ad8aab8a03.I86d1675095f0e4f5286d9b7c2b00a0220f524472@changeid Signed-off-by: Johannes Berg commit 18c0ffb404db2093b6afdc8ae15f18ba3975e1ed Author: Gregory Greenman Date: Tue Jun 13 15:57:19 2023 +0300 wifi: iwlwifi: mvm: add support for Extra EHT LTF Add support for Extra EHT LTF defined in 9.4.2.313 EHT Capabilities element. Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.de019d7cc174.I806f0f6042b89274192701a60b4f7900822db666@changeid Signed-off-by: Johannes Berg commit d51439a6d79fd251b0d92fa8b1aa3bd4cb17d102 Author: Ariel Malamud Date: Tue Jun 13 15:57:18 2023 +0300 wifi: iwlwifi: mvm: Refactor iwl_mvm_get_lmac_id() The iwl_mvm_get_lmac_id() function is currently defined as a static inline function under fw/api and receives mvm's fw pointer. It will need the ability to access other mvm struct members for future capabilities such as debug. Move the function out of the fw/api and into mvm proper as a regular function and have it receive the pointer to mvm. Signed-off-by: Ariel Malamud Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.507b2f9f64eb.I0ec91310e1911c33faf396b5e17bcb11a164f6ea@changeid Signed-off-by: Johannes Berg commit ff75c21c20b10855d68c95543400951252bf796e Author: Alon Giladi Date: Tue Jun 13 15:57:17 2023 +0300 wifi: iwlwifi: improve debug prints in iwl_read_ppag_table() Add prints of ETSI and China bits. Check if need to mask the China bit (when the firmware doesn't support it) in a separate flow, so it will be easier to follow the conditions. Add a separate message for the command version. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.4ee455ec1ee8.I6f1a4b7dfa5cfd9b4f4a4b5bb5567849e629ae96@changeid Signed-off-by: Johannes Berg commit 97110233c0af777ce6d6c25541cd7fd86e309ecc Author: Mukesh Sisodiya Date: Tue Jun 13 15:57:16 2023 +0300 wifi: iwlwifi: mvm: initialize the rx_vec before using it Initialize the phy_data.rx_vec for both version-3 and above where it is 4-byte data size and below version which has data size of 2-byte. The data will be sent uninitialized in called function if notification version is less than three. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.a6bb856f04bc.I9a15075f3dad61dcabdcd1ed0d34cf3e8ec5453f@changeid Signed-off-by: Johannes Berg commit e9f5ce3471d824039069c740f4fb4de36dd2eccb Author: Haim Dreyfuss Date: Tue Jun 13 15:57:15 2023 +0300 wifi: iwlwifi: mvm: rename BTM support flag and its TLV Currently, we only need to support BTM rejection. However, in the future we might want to support other BTM modes. Rephrase its naming. Signed-off-by: Haim Dreyfuss Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.ad20f10668d1.Icbb3fbae50b2302b97225b183dd336b02a4f37ee@changeid Signed-off-by: Johannes Berg commit 557b56d523d597a415ddfa27860259fcc835356c Author: Johannes Berg Date: Tue Jun 13 15:57:14 2023 +0300 wifi: iwlwifi: mvm: support U-SIG EHT validate checks Support new firmware that can validate the validate bits in sniffer mode, and advertise that fact and the result of the checks in the U-SIG radiotap field. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230613155501.c20480aa1171.Icc0d077dae01d662ccb948823e196aa9c5c87976@changeid Signed-off-by: Johannes Berg commit f3c21ed9ce17438b9b6fb4a959640c486cabda24 Author: Azeem Shaikh Date: Tue Jun 13 00:34:04 2023 +0000 wifi: mac80211: Replace strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since LOCAL_ASSIGN is only used by TRACE macros and the return values are ignored. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230613003404.3538524-1-azeemshaikh38@gmail.com Signed-off-by: Johannes Berg commit 0ffe85885b31ac0308bb13a31eec6a441e2a2d77 Author: Azeem Shaikh Date: Mon Jun 12 23:23:01 2023 +0000 wifi: cfg80211: replace strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since WIPHY_ASSIGN is only used by TRACE macros and the return values are ignored. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230612232301.2572316-1-azeemshaikh38@gmail.com Signed-off-by: Johannes Berg commit a3ff9303b496b29bf182481d152a5efbb57a630e Author: Ilan Peer Date: Mon Jun 12 18:51:16 2023 +0300 wifi: iwlwifi: mvm: Propagate ERP slot changes to FW In AP mode, ERP slot changes weren't properly indicated to the FW. Fix it. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.ef242b8ce245.I01eddee9d3a9a3208499c223eb8e70fe6663f42c@changeid Signed-off-by: Johannes Berg commit fd940de72d493c4bb1c4368ff0f87663492e5645 Author: Avraham Stern Date: Mon Jun 12 18:51:15 2023 +0300 wifi: iwlwifi: mvm: FTM responder MLO support Add a link configuration parameter to FTM responder start instead of using the default link. Signed-off-by: Avraham Stern Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.b367f9bd19b8.I158c71998f39a6c15463ff5ae30129da8ad46d22@changeid Signed-off-by: Johannes Berg commit 6107f300132bb3ff6a22add4a29980ed6ea929a1 Author: Emmanuel Grumbach Date: Mon Jun 12 18:51:14 2023 +0300 wifi: iwlwifi: pass ESR parameters to the firmware The firmware needs to know the esr_transtition_timeout to time the transition between EMLSR and single radio with the AP. Add the EMLSR support bit to the wiphy extended capabilities so that it'll be sent in our association request frame. There are some limitations in the implementation so we cannot use zero padding/transition delay; fill the correct values. Also, feed the medium_synchronization delay to the firmware. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.09fa06820d03.Ie9a9fd37d4948f8c5dd91161de254184b1a093c0@changeid Signed-off-by: Johannes Berg commit a114c4f5f9ca94e79d2ddf67f318d831cf87faf2 Author: Alon Giladi Date: Mon Jun 12 18:51:13 2023 +0300 wifi: iwlwifi: debugfs: add ppag capa to fw info file Add information about ppag_china_bit_support capability. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.4655922aff4d.Ie934027940bd53d05124222aa6a8a8b7021952c4@changeid Signed-off-by: Johannes Berg commit af8bfc7e38a7ad4f8e1663de7ab1463e644050b2 Author: Johannes Berg Date: Mon Jun 12 18:51:12 2023 +0300 wifi: iwlwifi: mvm: always set MH len in offload_assist Some versions of the new hardware don't have a functional version of the new offload method, but still have stricter checks on the MAC header (MH) length in the offload assist word. Include that even if checksumming isn't offloaded to hardware. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.bba713f7495a.Idbc8e3ce313b51af4060326e0191bd338b3163a2@changeid Signed-off-by: Johannes Berg commit 2b69d242e29b891b11f1190201f4a08abb0c8342 Author: Mukesh Sisodiya Date: Mon Jun 12 18:51:11 2023 +0300 wifi: iwlwifi: fw: print PC register value instead of address The program counter address is read from the TLV and PC address is printed in debug messages. Read the value at PC address and print the value instead of the register address. Fixes: 5e31b3df86ec ("wifi: iwlwifi: dbg: print pc register data once fw dump occurred") Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.e5a5f18f1b2c.Ib6117a4e7f66a075913241cc81477c0059953d5d@changeid Signed-off-by: Johannes Berg commit d4f1a50ca998420e27f904128a8dac5f69c291ed Author: Johannes Berg Date: Mon Jun 12 18:51:10 2023 +0300 wifi: iwlwifi: unify checks for HW error values The hardware, depending on which part fails or times out, returns 0xA5A5A5A. or 0x5A5A5A5. with the lowest 4 bits encoding some further reason/status. However, mostly we don't really need to care about the exact reasons, so unify the checks for this to avoid hardcoding those magic values all over the driver. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.3e2959741a38.I1c297a53787b87e4e2b8f296c041921338573f4d@changeid Signed-off-by: Johannes Berg commit cda2e9d7978dadc3f5d56bef69c20e9f9e6cbb97 Author: Mukesh Sisodiya Date: Mon Jun 12 18:51:08 2023 +0300 wifi: iwlwifi: mvm: fix getting LDPC/STBC support Use flags field from struct ieee80211_tx_info in order to get LDPC/STBC support. The rate parameter, used originally, is 16 bits only and does not have details of LDPC/STBC support. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.5a8856739b11.I6af4a55b22ed856f484ba77f87723dceec4904f2@changeid Signed-off-by: Johannes Berg commit ea05ef3f60e7ebdd7e50f6338942544adc4da10d Author: Gregory Greenman Date: Mon Jun 12 18:51:07 2023 +0300 wifi: iwlwifi: bump FW API to 79 for AX devices Start supporting API version 79 for AX devices. Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.c54013425732.I4df33c68ee3ef6b6a330f1cbef7f5bbf4f54b269@changeid Signed-off-by: Johannes Berg commit e9b63341dc15d8ee20b04e174f41873a44ca3f34 Author: Abhishek Naik Date: Mon Jun 12 18:51:06 2023 +0300 wifi: iwlwifi: update response for mcc_update command Add support for the MCC update response version 8. Versions 5-6 are already covered by the existing flags conversion, and 7 isn't used. The capabilities field in iwl_mcc_update_resp is 32 bits wide now, and the flags moved, so some more changes are needed. While at it, convert the flags to bool (to avoid having to deal with BIT(16) specially etc.) and use the struct_size() macro for the memory allocation. Signed-off-by: Abhishek Naik Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.71a7070aecd7.Ibddcb9fbfa74895f742c0ac20968720691c94853@changeid Signed-off-by: Johannes Berg commit 44fa698c78543527d132cbb806b1740a0e87376a Author: Avraham Stern Date: Mon Jun 12 18:51:05 2023 +0300 wifi: iwlwifi: mvm: FTM initiator MLO support When checking if the initiator is associated to the responder, iterate over all active links. Signed-off-by: Avraham Stern Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.1737f26e9cf7.I8f140ca55094da1d73c387fc036394fb2c148c85@changeid Signed-off-by: Johannes Berg commit 8d507812cb4bb3c3b05404a7dda70b32a1fc1324 Author: Mukesh Sisodiya Date: Mon Jun 12 18:51:04 2023 +0300 wifi: iwlwifi: mvm: Handle return value for iwl_mvm_sta_init sta_init function can fail and if it returns an error then driver should not send the request to fw to add a station. Fixes: 69aef848052b ("wifi: iwlwifi: mvm: refactor iwl_mvm_add_sta(), iwl_mvm_rm_sta()") Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.1ecd293539e8.I5ec6aab387bb2fe743a7402581beaeb9c801d31f@changeid Signed-off-by: Johannes Berg commit 3f244876ef73c8ef5eaeb8f01768a2bf33c4421e Author: Benjamin Berg Date: Mon Jun 12 18:51:02 2023 +0300 wifi: iwlwifi: make debugfs entries link specific All of the station elements are really elements for the link. Create them from the correct callback and return the link specific information rather than always using the default link. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230612184434.a8e0c40d325e.I374d9433c3b8694667e1ce550d65f6f1f0d23c05@changeid Signed-off-by: Johannes Berg commit 4cacadc0dbd8013e6161aa8843d8e9d8ad435b47 Author: Ilan Peer Date: Sun Jun 11 12:14:28 2023 +0300 wifi: mac80211: Fix permissions for valid_links debugfs entry The entry should be a read only one and not a write only one. Fix it. Fixes: 3d9011029227 ("wifi: mac80211: implement link switching") Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230611121219.c75316990411.I1565a7fcba8a37f83efffb0cc6b71c572b896e94@changeid [remove x16 change since it doesn't work yet] Signed-off-by: Johannes Berg commit 43ea09285f523df084de7c916667bcac99076095 Author: Ilan Peer Date: Sun Jun 11 12:14:27 2023 +0300 wifi: mac80211: Do not use "non-MLD AP" syntax Instead clarify the cases where link ID == 0 is intended for an AP STA that is not part of an AP MLD. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230611121219.77236a2e26ad.I8193ca8e236c9eb015870471f77a7d5134da3156@changeid Signed-off-by: Johannes Berg commit 6cf963edbbd3b279185e28e4864c9698ffaa23c3 Author: Ilan Peer Date: Thu Jun 8 16:36:10 2023 +0300 wifi: cfg80211: Support association to AP MLD with disabled links An AP part of an AP MLD might be temporarily disabled, and might be enabled later. Such a link should be included in the association exchange, but should not be used until enabled. Extend the NL80211_CMD_ASSOCIATE to also indicate disabled links. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230608163202.c4c61ee4c4a5.I784ef4a0d619fc9120514b5615458fbef3b3684a@changeid Signed-off-by: Johannes Berg commit 01ae1209c0ecb62c31b0d9b75bcff55303a77314 Author: Ilan Peer Date: Thu Jun 8 16:36:09 2023 +0300 wifi: mac80211_hwsim: Don't access vif valid links directly And instead use the vif getter functions, as a preparation for supporting disabled/dormant links. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230608163202.8966bd5ce7c8.Ia73e3555aaf4ddf9917bced8d413fad08cc28f1b@changeid Signed-off-by: Johannes Berg commit f1871abd27641c020298b5c7654e1d8341f22e5f Author: Ilan Peer Date: Thu Jun 8 16:36:08 2023 +0300 wifi: mac80211: Add getter functions for vif MLD state As a preparation to support disabled/dormant links, add the following function: - ieee80211_vif_usable_links(): returns the bitmap of the links that can be activated. Use this function in all the places that the bitmap of the usable links is needed. - ieee80211_vif_is_mld(): returns true iff the vif is an MLD. Use this function in all the places where an indication that the connection is a MLD is needed. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230608163202.86e3351da1fc.If6fe3a339fda2019f13f57ff768ecffb711b710a@changeid Signed-off-by: Johannes Berg commit bc1be54d7eb4ab4c6bd44e9f73d5b44b6c8e761c Author: Miri Korenblit Date: Thu Jun 8 16:36:06 2023 +0300 wifi: mac80211: allow disabling SMPS debugfs controls There are cases in which we don't want the user to override the smps mode, e.g. when SMPS should be disabled due to EMLSR. Add a driver flag to disable SMPS overriding and don't override if it is set. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230608163202.ef129e80556c.I74a298fdc86b87074c95228d3916739de1400597@changeid Signed-off-by: Johannes Berg commit 0e966d9a35fa5a3967a4900654fa925b8fb8e71b Author: Johannes Berg Date: Thu Jun 8 16:36:05 2023 +0300 wifi: mac80211: don't update rx_stats.last_rate for NDP If we get an NDP (null data packet), there's reason to believe the peer is just sending it to probe, and that would happen at a low rate. Don't track this packet for purposes of last RX rate reporting. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230608163202.8af46c4ac094.I13d9d5019addeaa4aff3c8a05f56c9f5a86b1ebd@changeid Signed-off-by: Johannes Berg commit 556f16b83459590a2d8d1394fd3af4d6d8ccabc7 Author: Benjamin Berg Date: Thu Jun 8 16:36:03 2023 +0300 wifi: mac80211: fix CSA processing while scanning The channel switch parsing code would simply return if a scan is in-progress. Supposedly, this was because channel switch announcements from other APs should be ignored. For the beacon case, the function is already only called if we are associated with the sender. For the action frame cases, add the appropriate check whether the frame is coming from the AP we are associated with. Finally, drop the scanning check from ieee80211_sta_process_chanswitch. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230608163202.3366e9302468.I6c7e0b58c33b7fb4c675374cfe8c3a5cddcec416@changeid Signed-off-by: Johannes Berg commit b580a372b84fa4895f9c8c96585f0cb9986a921c Author: Johannes Berg Date: Thu Jun 8 16:36:00 2023 +0300 wifi: mac80211: mlme: clarify WMM messages These messages apply to a single link only, use link_info() to indicate that. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230608163202.21a6bece4313.I08118e5e851fae2f9e43f8a58d3b6217709bf578@changeid Signed-off-by: Johannes Berg commit c6968d4fc9aac110d607722d92fc17dfa65f0716 Author: Anjaneyulu Date: Thu Jun 8 16:35:58 2023 +0300 wifi: mac80211: pass roc->sdata to drv_cancel_remain_on_channel() In suspend flow "sdata" is NULL, destroy all roc's which are started. pass "roc->sdata" to drv_cancel_remain_on_channel() to avoid NULL dereference and destroy that roc Signed-off-by: Anjaneyulu Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230608163202.c678187a308c.Ic11578778655e273931efc5355d570a16465d1be@changeid Signed-off-by: Johannes Berg commit 4c2d68f7981d7794b03fb5035208e6dd3014c9bc Author: Johannes Berg Date: Thu Jun 8 16:35:57 2023 +0300 wifi: mac80211: include key action/command in tracing We trace the key information and all, but not whether the key is added or removed - add that information. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230608163202.546e86e216df.Ie3bf9009926f8fa154dde52b0c02537ff7edae36@changeid Signed-off-by: Johannes Berg commit 1ec7291e247055fab3a088e1a333a31e7c06e2dd Author: Johannes Berg Date: Sun Jun 4 12:11:24 2023 +0300 wifi: mac80211: add helpers to access sband iftype data There's quite a bit of code accessing sband iftype data (HE, HE 6 GHz, EHT) and we always need to remember to use the ieee80211_vif_type_p2p() helper. Add new helpers to directly get it from the sband/vif rather than having to call ieee80211_vif_type_p2p(). Convert most code with the following spatch: @@ expression vif, sband; @@ -ieee80211_get_he_iftype_cap(sband, ieee80211_vif_type_p2p(vif)) +ieee80211_get_he_iftype_cap_vif(sband, vif) @@ expression vif, sband; @@ -ieee80211_get_eht_iftype_cap(sband, ieee80211_vif_type_p2p(vif)) +ieee80211_get_eht_iftype_cap_vif(sband, vif) @@ expression vif, sband; @@ -ieee80211_get_he_6ghz_capa(sband, ieee80211_vif_type_p2p(vif)) +ieee80211_get_he_6ghz_capa_vif(sband, vif) Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.db099f49e764.Ie892966c49e22c7b7ee1073bc684f142debfdc84@changeid Signed-off-by: Johannes Berg commit 2ad66fcb2fded5359a676f7146cf442641d28307 Author: Gilad Itzkovitch Date: Thu May 18 12:07:23 2023 +1200 wifi: cfg80211: S1G rate information and calculations Increase the size of S1G rate_info flags to support S1G and add flags for new S1G MCS and the supported bandwidths. Also, include S1G rate information to netlink STA rate message. Lastly, add rate calculation function for S1G MCS. Signed-off-by: Gilad Itzkovitch Link: https://lore.kernel.org/r/20230518000723.991912-1-gilad.itzkovitch@morsemicro.com Signed-off-by: Johannes Berg commit 04bd2eafee153b9cc4b411d4a24d32b1ec2ce41c Author: Viresh Kumar Date: Wed Jun 14 12:50:20 2023 +0530 OPP: don't drop performance constraint on OPP table removal This code was added (long back) by commit 009acd196fc8 ("PM / OPP: Support updating performance state of device's power domain") and at that time the `opp->pstate` field was used to store the performance state required by a device's OPP. Over time that changed and the `->pstate` field is now used only for genpd devices and consumer devices access that via the required-opps instead. Because of all these changes, _opp_table_kref_release() now drops the constraint only when the genpd's OPP table gets freed and not the device's. Which is definitely not what we wanted. And dropping the constraint doesn't have much meaning as the genpd itself is going away. Moreover, if we want to drop constraints here, then just dropping the performance constraint alone isn't sufficient as there are other resource constraints like clk, regulator, etc. too, which must be handled. Probably the right thing to do here is to leave this decision to the consumers, which can call `dev_pm_opp_set_rate(dev, 0)` or similar APIs to drop all constraints properly. Which many of the consumers already do. Remove the special code, which is broken anyway. Signed-off-by: Viresh Kumar Reviewed-by: Ulf Hansson commit e653810f7898baebd05f953b8fb3e2c7b8485b45 Author: Andi Shyti Date: Sun Jun 11 03:37:01 2023 +0200 i2c: nomadik: Use dev_err_probe() whenever possible Make use of dev_err_probe() in order to simplify the code and avoid printing when returning EPROBE_DEFER. Signed-off-by: Andi Shyti Reviewed-by: Linus Walleij Signed-off-by: Wolfram Sang commit 9c7174db4cdd111e10d19eed5c36fd978a14c8a2 Author: Andi Shyti Date: Sun Jun 11 03:37:00 2023 +0200 i2c: nomadik: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Reviewed-by: Linus Walleij Signed-off-by: Wolfram Sang commit 1c5d33fff0d375e4ab7c4261dc62a286babbb4c6 Author: Andi Shyti Date: Sun Jun 11 03:36:59 2023 +0200 i2c: nomadik: Remove unnecessary goto label The err_no_mem goto label doesn't do anything. Remove it. Signed-off-by: Andi Shyti Reviewed-by: Linus Walleij Signed-off-by: Wolfram Sang commit a7fbfd44c0204f0629288edfd0d77829edb4a2f8 Author: Mario Limonciello Date: Thu May 18 11:11:50 2023 -0500 usb: typec: ucsi: Mark dGPUs as DEVICE scope power_supply_is_system_supplied() checks whether any power supplies are present that aren't batteries to decide whether the system is running on DC or AC. Downstream drivers use this to make performance decisions. Navi dGPUs include an UCSI function that has been exported since commit 17631e8ca2d3 ("i2c: designware: Add driver support for AMD NAVI GPU"). This UCSI function registers a power supply since commit 992a60ed0d5e ("usb: typec: ucsi: register with power_supply class") but this is not a system power supply. As the power supply for a dGPU is only for powering devices connected to dGPU, create a device property to indicate that the UCSI endpoint is only for the scope of `POWER_SUPPLY_SCOPE_DEVICE`. Link: https://lore.kernel.org/lkml/20230516182541.5836-2-mario.limonciello@amd.com/ Reviewed-by: Evan Quan Tested-by: Evan Quan Signed-off-by: Mario Limonciello Reviewed-by: Heikki Krogerus Reviewed-by: Sebastian Reichel Acked-by: Andi Shyti Signed-off-by: Wolfram Sang commit 3152893c04d2c03bf752a0866d6bf8fae91779c6 Author: ye xingchen Date: Sat Jan 28 14:51:44 2023 +0800 i2c: wmt: Use devm_platform_get_and_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: ye xingchen Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit acdaf0e767494697edf44d3424f5458d5868b3ea Author: ye xingchen Date: Thu Jan 19 17:21:23 2023 +0800 i2c: versatile: Use devm_platform_get_and_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: ye xingchen Reviewed-by: Andi Shyti Reviewed-by: Linus Walleij Signed-off-by: Wolfram Sang commit 0520628e5c6bce6b43af8b468ae9396617d5b9a4 Author: taolan Date: Fri Sep 30 01:45:07 2022 +0000 i2c: hix5hd2: Add I2C_M_STOP flag support for i2c-hix5hd2 driver. For compatibility, some devices need to work with controller between messages using a stop. Signed-off-by: taolan Acked-by: Andi Shyti Signed-off-by: Wolfram Sang commit 9d178e00583ee803dd48ec60916c64b87f5449e7 Author: Rob Herring Date: Fri Jun 9 12:30:44 2023 -0600 i2c: mpc: Use of_property_read_reg() to parse "reg" Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Signed-off-by: Rob Herring Acked-by: Andi Shyti Signed-off-by: Wolfram Sang commit 34539b442b3bc7d5bf10164750302b60b91f18a7 Author: Tony Lindgren Date: Wed Jun 14 10:18:23 2023 +0300 bus: ti-sysc: Flush posted write on enable before reset The am335x devices started producing boot errors for resetting musb module in because of subtle timing changes: Unhandled fault: external abort on non-linefetch (0x1008) ... sysc_poll_reset_sysconfig from sysc_reset+0x109/0x12 sysc_reset from sysc_probe+0xa99/0xeb0 ... The fix is to flush posted write after enable before reset during probe. Note that some devices also need to specify the delay after enable with ti,sysc-delay-us, but this is not needed for musb on am335x based on my tests. Reported-by: kernelci.org bot Closes: https://storage.kernelci.org/next/master/next-20230614/arm/multi_v7_defconfig+CONFIG_THUMB2_KERNEL=y/gcc-10/lab-cip/baseline-beaglebone-black.html Fixes: 596e7955692b ("bus: ti-sysc: Add support for software reset") Signed-off-by: Tony Lindgren commit ba12d4dde708de01d3cae5ae368a930ec5f5fd07 Author: Hari Nagalla Date: Tue May 2 18:15:27 2023 -0500 arm64: dts: ti: k3-j784s4-evm: Reserve memory for remote proc IPC Reserve memory for remote processors. Two memory regions are reserved for each remote processor. The first 1Mb region is used for virtio Vring buffers for IPC and the second region is used for holding resource table, trace buffer and as external memory to the remote processor. The mailboxes are also assigned for each remote processor. Signed-off-by: Hari Nagalla Link: https://lore.kernel.org/r/20230502231527.25879-4-hnagalla@ti.com Signed-off-by: Vignesh Raghavendra commit 257d206b6d117d8e40742dc17ae02406747753ad Author: Hari Nagalla Date: Tue May 2 18:15:26 2023 -0500 arm64: dts: ti: k3-j784s4-main: Add C71x DSP nodes The J784S4 SoCs have four TMS320C71x DSP subsystems in the MAIN voltage domain. The functionality of these DSP subsystems is similar to the C71x DSP subsystems on earlier k3 device J721S2. Each subsystem has a 48 KB of L1D configurable SRAM/Cache and 512 KB of L2 SRAM/Cache. This subsystem has a CMMU but is not currently used. The inter-processor communication between the main A72 cores and the C71x DSPs is achieved through shared memory and mailboxes. Add the DT nodes for these DSP processor sub-systems. Signed-off-by: Hari Nagalla Link: https://lore.kernel.org/r/20230502231527.25879-3-hnagalla@ti.com Signed-off-by: Vignesh Raghavendra commit 7e5fd896c3d1ecf7b806f5fd42245c1135fe878d Author: Hari Nagalla Date: Tue May 2 18:15:25 2023 -0500 arm64: dts: ti: k3-j784s4-main: Add R5F cluster nodes The J784S4 SoCs have 4 dual-core Arm Cortex-R5F processor (R5FSS) subsystems/clusters. One R5F cluster (MCU_R5FSS0) is present within the MCU domain, and the remaining three clusters are present in the MAIN domain (MAIN_R5FSS0, MAIN_R5FSS1 & MAIN_R5FSS2). The functionality of the R5FSS is same as the R5FSS functionality on earlier K3 platform device J721S2. Each of the R5FSS can be configured at boot time to be either run in a LockStep mode or in an Asymmetric Multi Processing (AMP) fashion in Split-mode. These subsystems have 64 KB each Tightly-Coupled Memory (TCM) internal memories for each core split between two banks - ATCM and BTCM (further interleaved into two banks). There are some IP integration differences from standard Arm R5 clusters such as the absence of an ACP port, presence of an additional TI-specific Region Address Translater (RAT) module for translating 32-bit CPU addresses into larger system bus addresses etc. Add the DT nodes for the R5F cluster/subsystems, the two R5F cores are each added as child nodes to the corresponding cluster node. The clusters are configured to run in LockStep mode by default, with the ATCMs enabled to allow the R5 cores to execute code from DDR with boot-strapping code from ATCM. The inter-processor communication between the main A72 cores and these processors is achieved through shared memory and Mailboxes. The following firmware names are used by default for these cores, and can be overridden in a board dts file if needed: MAIN R5FSS0 Core0: j784s4-main-r5f0_0-fw (both in LockStep and Split modes) MAIN R5FSS0 Core1: j784s4-main-r5f0_1-fw (needed only in Split mode) MAIN R5FSS1 Core0: j784s4-main-r5f1_0-fw (both in LockStep and Split modes) MAIN R5FSS1 Core1: j784s4-main-r5f1_1-fw (needed only in Split mode) MAIN R5FSS2 Core0: j784s4-main-r5f2_0-fw (both in LockStep and Split modes) MAIN R5FSS2 Core1: j784s4-main-r5f2_1-fw (needed only in Split mode) MCU R5FSS0 Core0: j784s4-mcu-r5f0_0-fw (needed only in Split mode) MCU R5FSS0 Core1: j784s4-mcu-r5f0_1-fw (needed only in Split mode) Signed-off-by: Hari Nagalla Link: https://lore.kernel.org/r/20230502231527.25879-2-hnagalla@ti.com Signed-off-by: Vignesh Raghavendra commit 966cca72ab20289083521a385fa56035d85a222d Author: Michal Wilczynski Date: Tue Jun 13 11:43:10 2023 +0300 platform/x86/dell/dell-rbtn: Fix resources leaking on error path Currently rbtn_add() in case of failure is leaking resources. Fix this by adding a proper rollback. Move devm_kzalloc() before rbtn_acquire(), so it doesn't require rollback in case of failure. While at it, remove unnecessary assignment of NULL to device->driver_data and unnecessary whitespace, plus add a break for the default case in a switch. Suggested-by: Ilpo Järvinen Suggested-by: Pali Rohár Fixes: 817a5cdb40c8 ("dell-rbtn: Dell Airplane Mode Switch driver") Signed-off-by: Michal Wilczynski Reviewed-by: Andy Shevchenko Acked-by: Rafael J. Wysocki Reviewed-by: Pali Rohár Link: https://lore.kernel.org/r/20230613084310.2775896-1-michal.wilczynski@intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 2bddad9ec65a925da4ab4f73a9377d80540ca67b Author: Justin Chen Date: Mon Jun 12 14:37:00 2023 -0700 ethtool: ioctl: account for sopass diff in set_wol sopass won't be set if wolopt doesn't change. This means the following will fail to set the correct sopass. ethtool -s eth0 wol s sopass 11:22:33:44:55:66 ethtool -s eth0 wol s sopass 22:44:55:66:77:88 Make sure we call into the driver layer set_wol if sopass is different. Fixes: 55b24334c0f2 ("ethtool: ioctl: improve error checking for set_wol") Signed-off-by: Justin Chen Link: https://lore.kernel.org/r/1686605822-34544-1-git-send-email-justin.chen@broadcom.com Signed-off-by: Jakub Kicinski commit cc34f2909d2fbc8f52d24b20f6cbedcdf477e049 Author: Max Filippov Date: Fri Mar 17 16:18:07 2023 -0700 xtensa: rearrange show_stack output Minimal stack alignment on xtensa is 16 bytes, having stack dump in 32-byte lines may be visually misleading as the stack frame border may be in the middle of the line. Arrange stack dump in 16-byte lines. Mark lines at stack frame borders with arrows. Signed-off-by: Max Filippov commit f29cf77609cc401d28e2e7ec5c57d9d178ef347d Author: Max Filippov Date: Tue Jun 13 16:51:18 2023 -0700 xtensa: add load/store exception handler Memory attached to instruction bus of the xtensa CPU is only accessible for a limited subset of opcodes. Other opcodes generate an exception with the load/store error cause code. This property complicates use of such systems. Provide a handler that recognizes and transparently fixes such exceptions. The following opcodes are recognized when used outside of FLIX bundles: l32i, l32i.n, l16ui, l16si, l8ui. Signed-off-by: Max Filippov commit 651d4aff6892f630d399201f9ce94e240d932520 Author: Max Filippov Date: Tue Jun 13 01:18:26 2023 -0700 xtensa: rearrange unaligned exception handler - extract initialization part of the exception handler into a separate function. - use single label for invalid instruction instead of two labels, one for load and one for store, at one place. - use sext instruction for sign extension when available. - store SAR on the stack instead of in a0. - replace numeric labels for load and store writeback with .Lload_w and .Lstore_w respectively. Signed-off-by: Max Filippov commit 3522bcfe1ecd48b9db1bbecec5f27010f77b639b Author: Max Filippov Date: Tue Jun 13 20:45:53 2023 -0700 xtensa: always install slow handler for unaligned access exception Currently slow handler for unaligned access exception is not installed when CPU has hardware support for unaligned access. However some opcodes (e.g. l32ai, s32ri, s32c1i) would still raise unaligned access exception even on such CPUs. In that case instead of SIGBUS and a diagnostic entry in the kernel log the faulting process would receive SIGILL. Always install slow handler for unaligned access exception to fix that. Signed-off-by: Max Filippov commit 67e886229e27e80253e1ff9025a74a3dce941f17 Author: Max Filippov Date: Tue Jun 13 19:56:13 2023 -0700 xtensa: move early_trap_init from kasan_early_init to init_arch There may be other users for the early traps besides KASAN. Move call to the early_trap_init from kasan_early_init. Protect init_exc_table initializer with ifdef to make sure it builds on noMMU configurations. Signed-off-by: Max Filippov commit 64aaeb708245acdcbe51cf30c84418668c044d80 Author: Viresh Kumar Date: Thu Jun 8 13:10:14 2023 +0530 OPP: Protect `lazy_opp_tables` list with `opp_table_lock` The `opp_table_lock` lock is already used to protect the list elsewhere, use it while adding or removing entries from it. Reported-by: Stephan Gerhold Signed-off-by: Viresh Kumar Tested-by: Stephan Gerhold commit e5d4a21b3a9477ead1c32504a56569a848c22736 Author: Uwe Kleine-König Date: Mon Jun 12 09:16:41 2023 +0200 mctp i2c: Switch back to use struct i2c_driver's .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230612071641.836976-1-u.kleine-koenig@pengutronix.de Signed-off-by: Jakub Kicinski commit 6958ad05d5789a303afe4fa4495df43993d9b7cb Author: Nicholas Piggin Date: Tue Jun 6 23:24:45 2023 +1000 powerpc/32: Rearrange _switch to prepare for 32/64 merge Change the order of some operations and change some register numbers in preparation to merge 32-bit and 64-bit switch. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606132447.315714-5-npiggin@gmail.com commit fc8562c9b69af9533c39903b1601c378742189b0 Author: Nicholas Piggin Date: Tue Jun 6 23:24:44 2023 +1000 powerpc/32: Remove sync from _switch 64-bit has removed the sync from _switch since commit 9145effd626d1 ("powerpc/64: Drop explicit hwsync in context switch"). The same logic there should apply to 32-bit. Remove the sync and replace with a placeholder comment (32 and 64 will be merged with a later change). Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606132447.315714-4-npiggin@gmail.com commit 0eb8088b5a7524f96cadfb27083f5bdd819d9d52 Author: Nicholas Piggin Date: Tue Jun 6 23:24:43 2023 +1000 powerpc/64: Rearrange 64-bit _switch to prepare for 32/64 merge More some 64-bit specifics out from the function epilogue and rearrange this to be a bit neater, use 32-bit mem ops for CR save/restore, and change some register numbers. This is preparation to consolidate 32-bit and 64-bit switch code. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606132447.315714-3-npiggin@gmail.com commit d6b87c3eb6b2e0b34ba747df549e08768b019fe9 Author: Nicholas Piggin Date: Tue Jun 6 23:24:42 2023 +1000 powerpc/64s: move stack SLB pinning out of line from _switch The large hunk of SLB pinning in _switch asm code makes it more difficult to see everything else that's going on. It is a less important path now, so icache and fetch footprint overhead can be avoided. Move context switch stack SLB pinning out of line. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606132447.315714-2-npiggin@gmail.com commit 31b4f69dbae810b13237a7e8c89a52a72fd492e2 Author: Nicholas Piggin Date: Tue Jun 6 23:18:28 2023 +1000 powerpc/32s: Fix LLVM SMP build LLVM assembler does not recognise 3-operand cmpi, use cmpwi. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606131828.315427-1-npiggin@gmail.com commit 606787fed7268feb256957872586370b56af697a Author: Nicholas Piggin Date: Tue Jun 6 19:38:32 2023 +1000 powerpc/64s: Remove support for ELFv1 little endian userspace ELFv2 was introduced together with little-endian. ELFv1 with LE has never been a thing. The GNU toolchain can create such a beast, but anyone doing that is a maniac who needs to be stopped so I consider this patch a feature. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606093832.199712-5-npiggin@gmail.com commit aec0ba7472a7b0c1c293932e7978197f1489a332 Author: Nicholas Piggin Date: Tue Jun 6 19:38:31 2023 +1000 powerpc/64: Use -mprofile-kernel for big endian ELFv2 kernels -mprofile-kernel is an optimised calling convention for mcount that Linux has only implemented with the ELFv2 ABI, so it was disabled for big endian kernels. However it does work with ELFv2 big endian, so let's allow that if the compiler supports it. Acked-by: Naveen N. Rao Suggested-by: Christophe Leroy Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606093832.199712-4-npiggin@gmail.com commit 8c5fa3b5c4df3d071dab42b04b971df370d99354 Author: Nicholas Piggin Date: Tue Jun 6 19:38:30 2023 +1000 powerpc/64: Make ELFv2 the default for big-endian builds All supported toolchains now support ELFv2 on big-endian, so flip the default on this and hide the option behind EXPERT for the purpose of bug hunting. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606093832.199712-3-npiggin@gmail.com commit 9d90161ca5c7234e80e14e563d198f322ca0c1d0 Author: Nicholas Piggin Date: Tue Jun 6 19:38:29 2023 +1000 powerpc/64: Force ELFv2 when building with LLVM linker The LLVM linker does not support ELFv1 at all, so BE kernels must be built with ELFv2. The LLD version check was added to be conservative, LLD simply fails to link ELFv1 entirely, effectively requiring LLD >= 15 and ELFv2 for BE builds. Instead remove that restriction until proven otherwise (LLD 14.0 links a booting ELFv2 BE vmlinux for me). The minimum GNU binutils has increased such that ELFv2 is always supported, so remove that check while we're here. Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606093832.199712-2-npiggin@gmail.com commit f5df87b855fd835ff0f4928575adbf4f5302bb40 Author: Nicholas Piggin Date: Tue Jun 6 16:48:30 2023 +1000 powerpc/build: Remove -pipe from compilation flags x86 removed -pipe in commit 437e88ab8f9e2 ("x86/build: Remove -pipe from KBUILD_CFLAGS") and the newer arm64 and riscv seem to have never used it, so that seems to be the way the world's going. Compile performance building defconfig on a POWER10 PowerNV system was in the noise after 10 builds each. No point in adding options unless they help something, so remove it. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606064830.184083-1-npiggin@gmail.com commit 8bce81dbce4f3563fffca48ebfce208b1112ab09 Author: Nicholas Piggin Date: Tue Jun 6 16:46:57 2023 +1000 powerpc/boot: Clean up Makefile after cflags and asflags separation Tidy pass over boot Makefile. Move variables together where possible. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606064657.183969-5-npiggin@gmail.com commit 54194a2fab4f78b96347882cf27894f76833c631 Author: Nicholas Piggin Date: Tue Jun 6 16:46:56 2023 +1000 powerpc/boot: Separate BOOTCFLAGS from BOOTASFLAGS BOOTCFLAGS no longer contains anything that BOOTASFLAGS needs (except -pipe). Separate them to avoid fragility with cross-contamination of flags which has caused several build problems. Suggested-by: Linus Torvalds Link: https://lore.kernel.org/lkml/CAHk-=whyWUdJDeOBN1hRWYSkQkvzYiQ5RbSW5rJjExgnbSNX9Q@mail.gmail.com/ Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606064657.183969-4-npiggin@gmail.com commit d1b7d40d4ffa02d59e72abf31ee2119778c6673e Author: Nicholas Piggin Date: Tue Jun 6 16:46:55 2023 +1000 powerpc/boot: Separate CPP flags from BOOTCFLAGS Add BOOTCPPFLAGS variable for the CPP options required by C and AS. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606064657.183969-3-npiggin@gmail.com commit 689d592e406983debe919acb87855cab0f25b7bc Author: Nicholas Piggin Date: Tue Jun 6 16:46:54 2023 +1000 powerpc/boot: Separate target flags from BOOTCFLAGS Add BOOTTARGETFLAGS variable with target / ABI options common to CFLAGS and AFLAGS. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230606064657.183969-2-npiggin@gmail.com commit 48f2444eb4dc0f3de9146f7278e859fa6b5e568b Author: Uwe Kleine-König Date: Thu May 25 22:56:22 2023 +0200 powerpc: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Michael Ellerman Link: https://msgid.link/20230525205622.734093-1-u.kleine-koenig@pengutronix.de commit 922db7c571f55b1eab2d2c5da14d150aff1d0252 Author: Uwe Kleine-König Date: Tue May 23 21:50:53 2023 +0200 macintosh: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Jean Delvare Reviewed-by: Dmitry Torokhov Signed-off-by: Michael Ellerman Link: https://msgid.link/20230523195053.464138-1-u.kleine-koenig@pengutronix.de commit 556fd664d666c0cc9d5b0d52851b0480c51cf59e Author: Kan Liang Date: Wed Jun 7 09:26:56 2023 -0700 perf vendor events arm64: Add default tags into topdown L1 metrics Add the default tags for ARM as well. Signed-off-by: Kan Liang Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230607162700.3234712-5-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e2595550177d8ea42083c9fd8e8a9d4acd5604ec Author: Kan Liang Date: Wed Jun 7 09:26:59 2023 -0700 pert tests: Support metricgroup perf stat JSON output A new field metricgroup has been added in the perf stat JSON output. Support it in the test case. Signed-off-by: Kan Liang Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230607162700.3234712-8-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit c3ac3b0779770acd3ad7eecb5099ab4419ef2e2e Author: Aditya Gupta Date: Tue Jun 13 22:11:45 2023 +0530 perf tests task_analyzer: Skip tests if no libtraceevent support Test "perf script task-analyzer tests" fails in environment with missing libtraceevent support, as perf record fails to create the perf.data file, which further tests depend on. Instead, when perf is not compiled with libtraceevent support, skip those tests instead of failing them, by checking the output of `perf record --dry-run` to see if it prints the error "libtraceevent is necessary for tracepoint support" For the following output, perf compiled with: `make NO_LIBTRACEEVENT=1` Before the patch: 108: perf script task-analyzer tests : test child forked, pid 24105 failed to open perf.data: No such file or directory (try 'perf record' first) FAIL: "invokation of perf script report task-analyzer command failed" Error message: "" FAIL: "test_basic" Error message: "Failed to find required string:'Comm'." failed to open perf.data: No such file or directory (try 'perf record' first) FAIL: "invokation of perf script report task-analyzer --ns --rename-comms-by-tids 0:random command failed" Error message: "" FAIL: "test_ns_rename" Error message: "Failed to find required string:'Comm'." failed to open perf.data: No such file or directory (try 'perf record' first) <...> perf script task-analyzer tests: FAILED! With this patch, the script instead returns 2 signifying SKIP, and after the patch: 108: perf script task-analyzer tests : test child forked, pid 26010 libtraceevent is necessary for tracepoint support WARN: Skipping tests. No libtraceevent support test child finished with -2 perf script task-analyzer tests: Skip Fixes: e8478b84d6ba9ccf ("perf test: Add new task-analyzer tests") Signed-off-by: Aditya Gupta Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Petar Gligoric Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-18-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit b8e55fde9f663bd582d8f0b673fa8735f0dcca47 Author: Aditya Gupta Date: Tue Jun 13 22:11:44 2023 +0530 perf tests task_analyzer: Print command that failed instead of just "perf" Instead of printing "perf command failed" everytime, print the exact command that run earlier Signed-off-by: Aditya Gupta Acked-by: Hagen Paul Pfeifer Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-17-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit 5c4396efb53ef07d046a2e9456b240880e0c3076 Author: Aditya Gupta Date: Tue Jun 13 22:11:43 2023 +0530 perf tests task_analyzer: Fix bad substitution ${$1} ${$1} gives bad substitution error on sh, bash, and zsh. This seems like a typo, and this patch modifies it to $1, since that is what it's usage looks like from wherever `check_exec_0` is called. This issue due to ${$1} caused all function calls to give error in `find_str_or_fail` line, and so no test runs completely. But 'perf test "perf script task-analyzer tests"' wrongly reports that tests passed with the status OK, which is wrong considering the tests didn't even run completely Fixes: e8478b84d6ba9ccf ("perf test: add new task-analyzer tests") Signed-off-by: Aditya Gupta Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Cc: Disha Goel Cc: Hagen Paul Pfeifer Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Petar Gligoric Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-16-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit c4a1a7763da3a7345f338e3666e3f7749b96b734 Author: Spoorthy S Date: Tue Jun 13 22:11:42 2023 +0530 perf tests stat+shadow_stat.sh: Fix all POSIX sh warnings found using shellcheck Running shellcheck -S on stat+shadow_stat.sh testcase, generates SC2046 and SC2034 warnings, $ shellcheck -S warning tests/shell/stat+shadow_stat.sh res=`printf "%.2f" $(echo "scale=6; $num / $cyc" | bc -q)` : Quote this to prevent word splitting To address the POSIX shell warnings used quotes in the printf expressions, to prevent word splitting. Signed-off-by: Spoorthy S Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-15-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit 3b3bf0d112163524e61d1d6456c65e2157aade74 Author: Geetika Date: Tue Jun 13 22:11:41 2023 +0530 perf tests test_brstack.sh: Fix all POSIX sh warnings Fix all the POSIX sh warnings in perf shell test test_brstack.sh Warnings fixed : * In POSIX sh, using lower/mixed case for signal names is undefined. Correcting that in this script. * In POSIX sh, 'local' is undefined. local is supported in many shells, but it's not in POSIX. In POSIX sh, you can adopt some convention to avoid accidentally overwriting variables names, e.g. prefixing with the function name, that is what I have done here. Signed-off-by: Geetika Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-14-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit ed46a9994956b5ee53d62f848b1b69579201a7ec Author: Samir Mulani Date: Tue Jun 13 22:11:40 2023 +0530 perf tests shell: Fixed shellcheck warnings Fixed the shellcheck warnings in buildid.sh, record+probe_libc_inet_pton.sh and record+script_probe_vfs_getname.sh perf shell scripts: 1. Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. 2. Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. 3. Used * argument to avoid the argument mixes string and array 4. Resolved issue for variable refernce, where the variable is being used before it has been initialized. 5. Resolved word splitting issue (syntax error). 6. The "err" variable has been removed from buildid.sh since it is not used anywhere in the code. Signed-off-by: Samir Mulani Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-13-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit fa33cbe26683607f69ed3b6885356e94fadc5ca2 Author: Abhirup Deb Date: Tue Jun 13 22:11:39 2023 +0530 perf tests lock_contention: Fix shellscript errors Use quotes around variables to prevent POSIX word expansion, use uppercase for signals(INT, TERM, EXIT) to avoid mixed/lower case naming of signals and replace "==" with "=" as "==" is not supported by POSIX shell. Signed-off-by: Abhirup Deb Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-12-atrajeev@linux.vnet.ibm.com Signed-off-by: Anushree Mathur Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit e0da03c7b16b466750f0bd91865a2a000f1422b7 Author: Abhirup Deb Date: Tue Jun 13 22:11:38 2023 +0530 perf tests test_arm_spe: Address shellcheck warnings about signal name case Running shellcheck -S on test_arm_spe.sh throws below warnings: #shellcheck -S warning tests/shell/test_arm_spe.sh In tests/shell/test_arm_spe.sh line 30: trap cleanup_files exit term int ^--^ SC3049 (warning): In POSIX sh, using lower/mixed case for signal names is undefined. ^--^ SC3049 (warning): In POSIX sh, using lower/mixed case for signal names is undefined. ^-^ SC3049 (warning): In POSIX sh, using lower/mixed case for signal names is undefined. Fixed this issue by using uppercase for "EXIT", "TERM" and "INIT" signals to avoid using lower/mixed case for signal names as input. Signed-off-by: Abhirup Deb Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-11-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Mukesh Chaurasiya Signed-off-by: Ojaswin Mujoo Signed-off-by: Piyush Sachdeva Signed-off-by: Arnaldo Carvalho de Melo commit 9694dfe0a3fc81309f4c0a9a6a5f99b64caa851a Author: Aboorva Devarajan Date: Tue Jun 13 22:11:37 2023 +0530 perf tests test_task_analyzer: Fix shellcheck issues Fixed the following shellcheck issues in test_task_analyzer.sh file: SC2086: Double quote to prevent globbing and word splitting warnings in shell-check. Fixes the following shellcheck issues, SC2086: Double quote to prevent globbing and word splitting warnings in shell-check. Before Patch: $ shellcheck ./test_task_analyzer.sh | grep "SC2086" | ... In ./test_task_analyzer.sh line 13: SC2086: Double quote to prevent globbing and word splitting. In ./test_task_analyzer.sh line 24: SC2086: Double quote to prevent globbing and word splitting. In ./test_task_analyzer.sh line 39: SC2086: Double quote to prevent globbing and word splitting. After Patch: $ shellcheck ./test_task_analyzer.sh | grep -i "SC2086" None perf test result after patch: PASS: "test_basic" PASS: "test_ns_rename" PASS: "test_ms_filtertasks_highlight" PASS: "test_extended_times_timelimit_limittasks" PASS: "test_summary" PASS: "test_summaryextended" PASS: "test_summaryonly" PASS: "test_extended_times_summary_ns" PASS: "test_extended_times_summary_ns" PASS: "test_csv" PASS: "test_csvsummary" PASS: "test_csv_extended_times" PASS: "test_csvsummary_extended" Signed-off-by: Aboorva Devarajan Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-10-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit a6bdb815ad60f35f581ee0b48a886f7e451e34a3 Author: Barnali Guha Thakurata Date: Tue Jun 13 22:11:36 2023 +0530 perf tests stat_all_metrics: Fix shellcheck warning SC2076 Fixed shellcheck warning SC2076 in stat_all_metrics.sh. Before the patch: shell$ shellcheck stat_all_metrics.sh In stat_all_metrics.sh line 9: if [[ "$result" =~ "${m:0:50}" ]] || [[ "$result" =~ "" ]] ^---------^ SC2076: Don't quote right-hand side of =~, it'll match literally rather than as a regex. In stat_all_metrics.sh line 15: if [[ "$result" =~ "${m:0:50}" ]] ^---------^ SC2076: Don't quote right-hand side of =~, it'll match literally rather than as a regex. In stat_all_metrics.sh line 22: if [[ "$result" =~ "${m:0:50}" ]] ^---------^ SC2076: Don't quote right-hand side of =~, it'll match literally rather than as a regex. After the patch: shell$ shellcheck stat_all_metrics.sh shell$ Signed-off-by: Barnali Guha Thakurata Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-9-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit 0ed4b531e7da1193fa10786672f28d7734eb06ec Author: Anushree Mathur Date: Tue Jun 13 22:11:35 2023 +0530 perf tests test_arm_coresight: Shellcheck fixes Fixed the following shellcheck issues in test_arm_coresight.sh file: In tools/perf/tests/shell/test_arm_coresight.sh line 31: trap - exit term int ^--^ SC2039: In POSIX sh, using lower/mixed case for signal names is undefined. ^--^ SC2039: In POSIX sh, using lower/mixed case for signal names is undefined. ^-^ SC2039: In POSIX sh, using lower/mixed case for signal names is undefined. In tools/perf/tests/shell/test_arm_coresight.sh line 35: trap cleanup_files exit term int ^--^ SC2039: In POSIX sh, using lower/mixed case for signal names is undefined. ^--^ SC2039: In POSIX sh, using lower/mixed case for signal names is undefined. ^-^ SC2039: In POSIX sh, using lower/mixed case for signal names is undefined. In tools/perf/tests/shell/test_arm_coresight.sh line 92: if [ $? -eq 0 -a -e "$1/enable_sink" ]; then ^-- SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. Fixed above warnings by: 1)Capitalize signals(INT, TERM, EXIT) to avoid mixed/lower case naming of signals. 2)Expression [p -a q] was not defined,changed it to [p] && [q] to avoid the ambiguity as this is older format using -a or -o ,now we use [p] && [q] in place of [p -a q] and [p] || [q] in place of [p -o q]. Result after fixing the issues: shell$ shellcheck -S warning test_arm_coresight.sh shell$ Signed-off-by: Anushree Mathur Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-8-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit 9e9d07a71fa44ead54eda05754d17aa02f18b5b2 Author: Korrapati Likhitha Date: Tue Jun 13 22:11:33 2023 +0530 perf tests stat+csv_output: Fix shellcheck warnings Running the shellcheck on stat+csv_output resulted in the following warning. Result with shellcheck without patch: ===== $ shellcheck -S warning stat+csv_output.sh In stat+csv_output.sh line 23: [ $(uname -m) = "s390x" ] && exp='^[6-7]$' ^---------^ SC2046: Quote this to prevent word splitting. In stat+csv_output.sh line 51: [ $(id -u) != 0 ] && [ $(cat /proc/sys/kernel/perf_event_paranoid) -gt $1 ] ^------^ SC2046: Quote this to prevent word splitting. ^-- SC2046: Quote this to prevent word splitting. ===== Fixed the warning SC2046 by adding quotes to prevent word splitting. Result with shellcheck with patch: ===== $ shellcheck -S warning tests/shell/stat+csv_output.sh $ ./perf test "stat CSV output linter" 96: perf stat CSV output linter : Ok ===== Signed-off-by: Korrapati Likhitha Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-6-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Sathvika Vasireddy Signed-off-by: Arnaldo Carvalho de Melo commit 5bd35dfb48b0af870093f2ee130883228b49352a Author: Shirisha G Date: Tue Jun 13 22:11:32 2023 +0530 perf tests daemon: Address shellcheck warnings Running shellcheck -S on daemon.sh throws below warnings: Result from shellcheck: # shellcheck -S warning daemon.sh local line_name=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $2 }'` ^-------^ SC2155: Declare and assign separately to avoid masking return values. trap "echo 'FAILED: Signal caught'; daemon_exit ${config}; exit 1" SIGINT SIGTERM ^-------^ SC2064: Use single quotes, otherwise this expands now rather than when signalled. count=`ls ${base}/session-test/ | grep perf.data | wc -l` ^-- SC2010: Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames. if [ ${size} != "OK" -o ${type} != "OK" ]; then ^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. Fixed above warnings by: - declaring and assigning local variables separately - To fix SC2010, instead of using "ls | grep", used glob to allow non-alphanumeric filenames - Used single quotes to prevent expanding. Result from shellcheck after patch changes: $ shellcheck -S warning daemon.sh $ echo $? 0 Signed-off-by: Shirisha G Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-5-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit 1bb17b4c6c91ad4d9468247cf5f5464fa6440668 Author: Spoorthy S Date: Tue Jun 13 22:11:31 2023 +0530 perf tests arm_callgraph_fp: Address shellcheck warnings about signal names and adding double quotes for expression Running shellcheck -S on test_arm_calligraph_fp throws warnings SC2086 and SC3049,       $shellcheck -S warning tests/shell/test_arm_callgraph_fp.sh          rm -f $PERF_DATA             : Double quote to prevent globbing and word splitting.          trap cleanup_files exit term int       : In POSIX sh, using lower/mixed case for signal names is undefined. After fixing the warnings,       $shellcheck tests/shell/test_arm_callgraph_fp.sh       $ echo $?       0 To address the POSIX shell warnings added changes to convert Lowercase signal names to uppercase in the script and double quoted the command substitutions($fix to "$fix") to solve Globbing warnings. Signed-off-by: Spoorthy S Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230613164145.50488-4-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit b3839ff1f40eba632177bc4775a35ed65a2262a6 Author: Disha Goel Date: Tue Jun 13 22:11:30 2023 +0530 perf tests stat+json_output: Address shellcheck warnings Running shellcheck on stat+json_output testcase, generates below warning: [ $(id -u) != 0 ] && [ $(cat /proc/sys/kernel/perf_event_paranoid) -gt $1 ] ^------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2046 (warning): Quote this to prevent word splitting. Fixed the warning by adding quotes to avoid word splitting. ShellCheck result with patch: # shellcheck -S warning stat+json_output.sh # perf test result after the change: 94: perf stat JSON output linter : Ok Signed-off-by: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/linux-perf-users/20230613164145.50488-3-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit 75782e825377bd2745c0231a0f3483888514acb6 Author: Sourabh Jain Date: Tue Jun 13 22:11:29 2023 +0530 perf python scripting: Get rid of unused import in arm-cs-trace-disasm The arm-cs-trace-disasm.py script doesn't use the sys library, so remove the import. Report by pylint: W0611: Unused import sys (unused-import) Signed-off-by: Sourabh Jain Cc: Athira Rajeev Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/linux-perf-users/20230613164145.50488-2-atrajeev@linux.vnet.ibm.com Signed-off-by: Athira Rajeev Signed-off-by: Kajol Jain Signed-off-by: Arnaldo Carvalho de Melo commit 0cd1ca4650c9cf5f318110f67d39cbebae3693b3 Author: Ravi Bangoria Date: Tue Jun 13 15:25:04 2023 +0530 perf tool x86: Consolidate is_amd check into single function There are multiple places where x86 specific code determines AMD vs Intel arch and acts based on that. Consolidate those checks into a single function. Signed-off-by: Ravi Bangoria Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ali Saidi Cc: Ananth Narayan Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Santosh Shukla Link: https://lore.kernel.org/r/20230613095506.547-3-ravi.bangoria@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 6ec9503f45740b6ae4cb7f3e7441b1539c6d51d6 Author: Ian Rogers Date: Tue Jun 13 11:26:29 2023 -0700 perf parse-events: Avoid string for PE_BP_COLON, PE_BP_SLASH There's no need to read the string ':' or '/' for PE_BP_COLON or PE_BP_SLASH and doing so causes parse-events.y to leak memory. The original patch has a committer note about not using these tokens presumably as yacc spotted they were a memory leak because no %destructor could be run. Remove the unused token workaround as there is now no value associated with these tokens. Fixes: f0617f526cb0c482 ("perf parse: Allow config terms with breakpoints") Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Link: https://lore.kernel.org/r/20230613182629.1500317-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e4c4e8a538a0db071d291bc2dca487e1882a7d4f Author: Kan Liang Date: Wed Jun 7 09:26:53 2023 -0700 perf metric: Fix no group check The no group check fails if there is more than one meticgroup in the metricgroup_no_group. The first parameter of the match_metric() should be the string, while the substring should be the second parameter. Fixes: ccc66c6092802d68 ("perf metric: JSON flag to not group events if gathering a metric group") Signed-off-by: Kan Liang Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230607162700.3234712-2-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 97d5f2e9ee12cdc7214d5835d35c59404cfafee6 Author: Ian Rogers Date: Fri Jun 9 15:40:04 2023 -0700 tools api fs: More thread safety for global filesystem variables Multiple threads, such as with "perf top", may race to initialize a file system path like hugetlbfs. The racy initialization of the path leads to at least memory leaks. To avoid this initialize each fs for reading the mount point path with pthread_once. Mounting the file system may also be racy, so introduce a mutex over the function. This does mean that the path is being accessed with and without a mutex, which is inherently racy but hopefully benign, especially as there are fewer callers to fs__mount. Remove the fs__entries by directly using global variables, this was done as no argument like the index can be passed to the init once routine. Issue found and tested with "perf top" and address sanitizer. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230609224004.180988-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8dc26b6f718a81188519b77033eea764c9b6f732 Author: Ian Rogers Date: Mon Jun 12 20:48:17 2023 -0700 perf srcline: Make sentinel reading for binutils addr2line more robust The addr2line process is sent an address then multiple function, filename:line "records" are read. To detect the end of output a ',' is sent and for llvm-addr2line a ',' is then read back showing the end of addrline's output. For binutils addr2line the ',' translates to address 0 and we expect the bogus filename marker "??:0" (see filename_split) to be sent from addr2line. For some kernels address 0 may have a mapping and so a seemingly valid inline output is given and breaking the sentinel discovery: ``` $ addr2line -e vmlinux -f -i , __per_cpu_start ./arch/x86/kernel/cpu/common.c:1850 ``` To avoid this problem enable the address dumping for addr2line (the -a option). If an address of 0x0000000000000000 is read then this is the sentinel value working around the problem above. The filename_split still needs to check for "??:0" as bogus non-zero addresses also need handling. Reported-by: Changbin Du Signed-off-by: Ian Rogers Tested-by: Changbin Du Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Tom Rix Cc: llvm@lists.linux.dev Link: https://lore.kernel.org/r/20230613034817.1356114-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit c7a0023a1495355e71177ebfae33d27ad97577c3 Author: Ian Rogers Date: Mon Jun 12 20:48:16 2023 -0700 perf srcline: Make addr2line configuration failure more verbose To aid debugging why it fails. Also, combine the loops for reading a line for the llvm/binutils cases. Signed-off-by: Ian Rogers Tested-by: Changbin Du Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Tom Rix Cc: llvm@lists.linux.dev Link: https://lore.kernel.org/r/20230613034817.1356114-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d436373a75f53cafa37df0ace3b329b119739699 Author: Adrian Hunter Date: Tue Jun 13 16:22:26 2023 +0300 perf tests: Make x86 new instructions test optional at build time The "x86 instruction decoder - new instructions" test takes up space but is only really useful to developers. Make it optional at build time. Add variable EXTRA_TESTS which must be defined in order to build perf with the test. Example: Before: $ make -C tools/perf clean >/dev/null $ make -C tools/perf >/dev/null Makefile.config:650: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR Makefile.config:1149: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev PERF_VERSION = 6.4.rc3.gd15b8c76c964 $ readelf -SW tools/perf/perf | grep '\.rela.dyn\|.rodata\|\.data.rel.ro' [10] .rela.dyn RELA 000000000002fcb0 02fcb0 0748b0 18 A 6 0 8 [18] .rodata PROGBITS 00000000002eb000 2eb000 6bac00 00 A 0 0 32 [25] .data.rel.ro PROGBITS 00000000009ea180 9e9180 04b540 00 WA 0 0 32 After: $ make -C tools/perf clean >/dev/null $ make -C tools/perf >/dev/null Makefile.config:650: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR Makefile.config:1154: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev PERF_VERSION = 6.4.rc3.g4ea9c1569ea4 $ readelf -SW tools/perf/perf | grep '\.rela.dyn\|.rodata\|\.data.rel.ro' [10] .rela.dyn RELA 000000000002f3c8 02f3c8 036d68 18 A 6 0 8 [18] .rodata PROGBITS 00000000002ac000 2ac000 68da80 00 A 0 0 32 [25] .data.rel.ro PROGBITS 000000000097d440 97c440 022280 00 WA 0 0 32 Committer notes: Build with 'make EXTRA_TESTS=1 -C tools/perf O=/tmp/build/perf" and reproduced the ELF section size differences. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/683fea7c-f5e9-fa20-f96b-f6233ed5d2a7@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 7f911905ffe62e4fb7274f1f09f4148a449b2f83 Author: Namhyung Kim Date: Mon Jun 12 16:41:02 2023 -0700 perf dwarf-aux: Allow unnamed struct/union/enum It's possible some struct/union/enum type don't have type name. Allow the empty name after "struct"/"union"/"enum" string rather than fail. Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230612234102.3909116-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 3abfcfd847717d232e36963f31a361747c388fe7 Author: Namhyung Kim Date: Mon Jun 12 16:41:01 2023 -0700 perf dwarf-aux: Fix off-by-one in die_get_varname() The die_get_varname() returns "(unknown_type)" string if it failed to find a type for the variable. But it had a space before the opening parenthesis and it made the closing parenthesis cut off due to the off-by-one in the string length (14). Signed-off-by: Namhyung Kim Fixes: 88fd633cdfa19060 ("perf probe: No need to use formatting strbuf method") Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230612234102.3909116-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 8812387d056957355ef1d026cd38bed3830649db Author: Christoph Hellwig Date: Mon Jun 12 07:35:15 2023 +0200 zonefs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file systems can just set the FMODE_CAN_ODIRECT flag at open time instead of wiring up a dummy direct_IO method to indicate support for direct I/O. Do that for zonefs so that noop_direct_IO can eventually be removed. Signed-off-by: Christoph Hellwig Signed-off-by: Damien Le Moal commit 16d7fd3cfa7259729c8e2a7620bd5b4ca480da85 Author: Damien Le Moal Date: Thu Jun 1 17:15:41 2023 +0900 zonefs: use iomap for synchronous direct writes Remove the function zonefs_file_dio_append() that is used to manually issue REQ_OP_ZONE_APPEND BIOs for processing synchronous direct writes and use iomap instead. To preserve the use of zone append operations for synchronous writes, different struct iomap_dio_ops are defined. For synchronous direct writes using zone append, zonefs_zone_append_dio_ops is introduced. The submit_bio operation of this structure is defined as the function zonefs_file_zone_append_dio_submit_io() which is used to change the BIO opreation for synchronous direct IO writes to REQ_OP_ZONE_APPEND. In order to preserve the write location check on completion of zone append BIOs, the end_io operation is also defined using the function zonefs_file_zone_append_dio_bio_end_io(). This check now relies on the zonefs_zone_append_bio structure, allocated together with zone append BIOs with a dedicated BIO set. This structure include the target inode of a zone append BIO as well as the target append offset location for the zone append operation. This is used to perform a check against bio->bi_iter.bi_sector when the BIO completes, without needing to use the zone information z_wpoffset field, thus removing the need for taking the inode truncate mutex. Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Himanshu Madhani commit 9e936277d990552c955f4a20ad33d4cb1319b25b Author: Damien Le Moal Date: Mon Jun 12 09:16:13 2023 +0900 ata: ahci: Cleanup ahci_reset_controller() Fix multi-line comment style in ahci_reset_controller() and change the code to return early if ahci_skip_host_reset is true, reducing indentation by one level for the bulk of the function code. No functional changes. Signed-off-by: Damien Le Moal Reviewed-by: Niklas Cassel commit 8d4236f62f3acbc6a0def79106c13fe7344d8238 Author: Matti Lehtimäki Date: Sun May 7 23:12:24 2023 +0300 ARM: dts: qcom: msm8226: Add thermal zones node Add thermal zones present on MSM8226 SoC. Signed-off-by: Matti Lehtimäki Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230507201225.89694-7-matti.lehtimaki@gmail.com commit 0f8861c9fc7cc9af6d6f65d6657aa9cf2531b29c Author: Matti Lehtimäki Date: Sun May 7 23:12:23 2023 +0300 ARM: dts: qcom: msm8226: Add tsens node and related nvmem cells Specify pre-parsed per-sensor calibration nvmem cells in the qfprom device node rather than parsing the whole data blob in the driver. Signed-off-by: Matti Lehtimäki Reviewed-by: Dmitry Baryshkov Reviewed-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230507201225.89694-6-matti.lehtimaki@gmail.com commit 16a9fa7ab27b69be3a34b97ff8c7b034fcc73b88 Author: Matti Lehtimäki Date: Sun May 7 23:12:22 2023 +0300 ARM: dts: qcom: msm8226: Add qfprom node Add missing QFPROM definition for MSM8226 SoC. Signed-off-by: Matti Lehtimäki Reviewed-by: Dmitry Baryshkov Reviewed-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230507201225.89694-5-matti.lehtimaki@gmail.com commit 097d359c8ca892b63e9d91bdfaf6c45d07c943c7 Author: Konrad Dybcio Date: Mon May 29 15:14:24 2023 +0200 clk: qcom: gpucc-sm6375: Enable runtime pm The GPUCC block on SM6375 is powered by VDD_CX and VDD_GX. If the latter rail is not online, GX_GDSC will never turn on. Enable runtime pm so that we can reference VDD_GX from the dt to ensure that. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230529-topic-sm6375gpuccpd-v1-2-8d57c41a6066@linaro.org commit 2f138c667cb94a3a150d3341ca5ebf62480b501f Author: Konrad Dybcio Date: Mon May 29 15:14:23 2023 +0200 dt-bindings: clock: sm6375-gpucc: Add VDD_GX The GPUCC block on SM6375 is powered by VDD_CX and VDD_GX. If the latter rail is not online, GX_GDSC will never turn on. Describe the missing handles. Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230529-topic-sm6375gpuccpd-v1-1-8d57c41a6066@linaro.org commit 637cc974046abe5718bf045a1bc66a238778a145 Author: Matti Lehtimäki Date: Tue May 30 01:15:01 2023 +0300 ARM: dts: qcom: pm8941: Add thermal zone config Add thermal zone for the PMIC thermal sensor. Signed-off-by: Matti Lehtimäki Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230529221501.43455-4-matti.lehtimaki@gmail.com commit 84e72ea467db83043858b48fcd97de4c9e68881a Author: Matti Lehtimäki Date: Tue May 30 01:15:00 2023 +0300 ARM: dts: qcom: pm8841: Add thermal zone config Add thermal zone for the PMIC thermal sensor. Temperatures are based on downstream values, except for critical trip point where 140°C is used instead of 145°C due to limitations without a configured ADC. Signed-off-by: Matti Lehtimäki Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230529221501.43455-3-matti.lehtimaki@gmail.com commit 1b118df488f2be09b846994a4135d57f634e564b Author: Matti Lehtimäki Date: Tue May 30 01:14:59 2023 +0300 ARM: dts: qcom: pm8226: Add thermal sensor and thermal zone config Add thermal sensor, which is using on chip VADC channel to report PMIC die temperature. Also add the corresponding thermal zone. Signed-off-by: Matti Lehtimäki Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230529221501.43455-2-matti.lehtimaki@gmail.com commit 8734d3355079152dc3fdf628a3724f55603c796d Author: Stephan Gerhold Date: Tue May 30 09:15:27 2023 +0200 arm64: dts: qcom: msm8916: Drop msm8916-pins.dtsi MSM8916 and MSM8939 are pin-compatible and should have exactly the same pinctrl definitions. Still, having pinctrl separated to a -pins.dtsi is not typical anymore for Qualcomm platforms upstream. Since Bjorn specifically requested having the MSM8939 pinctrl inside msm8939.dtsi lets move the MSM8916 definitions to msm8916.dtsi as well to have a consistent location. While at it sort the nodes and drop unnecessary empty lines. Note that in almost all cases changes to MSM8916 pinctrl should also be applied to MSM8939 pinctrl (and vice versa). Right now they are back in sync again and completely identical. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230529-msm8916-pinctrl-v1-6-11f540b51c93@gerhold.net commit b40de51e3b6737a7bd41045e0cd3f78b75c35b24 Author: Stephan Gerhold Date: Tue May 30 09:15:26 2023 +0200 arm64: dts: qcom: msm8916/39: Rename wcnss pinctrl All the pinctrl now uses consistent _default/_sleep suffix so rename the WCNSS pinctrl to be named consistently. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230529-msm8916-pinctrl-v1-5-11f540b51c93@gerhold.net commit 0d3a93b102829b22d104c4108ffc9d50f19a556d Author: Stephan Gerhold Date: Tue May 30 09:15:25 2023 +0200 arm64: dts: qcom: msm8916/39: Cleanup audio pinctrl The audio pinctrl in MSM8916/MSM8939 is very similar but still has subtle differences, e.g. &cdc_pdm_lines_act on MSM8916 vs &cdc_pdm_lines_default on MSM8939. Make this consistent and use the chance to cleanup all of the audio pinctrl: Drop unneeded outer nodes and replace the names taken over from the vendor kernel with more clear ones that are similar to the actual pinctrl function. Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230529-msm8916-pinctrl-v1-4-11f540b51c93@gerhold.net commit 6528e4a90b5105643fe4e748ae90e37dcb3a3502 Author: Stephan Gerhold Date: Tue May 30 09:15:24 2023 +0200 arm64: dts: qcom: apq8016-sbc: Drop unneeded MCLK pinctrl GPIO116 is not connected (NC) on DB410c so there is no need to route MCLK there. The MSM8916 digital codec receives the MCLK internally without leaving the SoC through a GPIO. Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230529-msm8916-pinctrl-v1-3-11f540b51c93@gerhold.net commit c943e4c58b2ffb0dcd497f8b12f284f5e8fc477e Author: Stephan Gerhold Date: Tue May 30 09:15:23 2023 +0200 arm64: dts: qcom: msm8916/39: Consolidate SDC pinctrl MSM8939 has the SDC pinctrl consolidated in two &sdcN_default and &sdcN_sleep states, while MSM8916 has all pins separated. Make this consistent by consolidating them for MSM8916 well. Use this as a chance to define default pinctrl in the SoC.dtsi and only let boards that add additional definitions (such as cd-gpios) override it. For MSM8939 just make the label consistent with the other pinctrl definitions (they do not have a _state suffix). Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230529-msm8916-pinctrl-v1-2-11f540b51c93@gerhold.net commit dfbda20dabaa1f284abd550035db5887384c8e4c Author: Stephan Gerhold Date: Tue May 30 09:15:22 2023 +0200 arm64: dts: qcom: msm8916/39: Fix SD card detect pinctrl The current SD card detect pinctrl setup configures bias-pull-up for the "default" (active) case and bias-disable for the "sleep" case. Before commit b5c833b703cc ("mmc: sdhci-msm: Set IO pins in low power state during suspend") the pull up was permanently active. Since then it is only active when a valid SD card is inserted. This does not really make sense: For an active-low CD, the pull up is needed to pull the GPIO high when the card is not inserted. When the card gets inserted CD is shorted to ground (low). This means right now the pull-up is removed exactly when it is needed to detect the next card insertion. Generally, applying different bias for CD does not really make sense. It should always stay the same so card removals and insertions can be detected properly. The reason why card detection still works fine in practice is that most boards seem to have external pull up on the CD pin. However, this means that there is no need to configure an internal pull-up at all and we can keep bias-disable permanently. There are also some boards with different CD polarity (acer-a1-724) and with different GPIO number (huawei-g7). All in all this makes it obvious that the CD pin is board-specific and the pinctrl for it should be defined in the board DT. Move it to the boards that need it and use bias-disable permanently for the boards that seem to have external pull-up. The vendor device tree for msm8939-sony-xperia-kanuti-tulip suggests that it needs the internal pull-up permanently [1] so it gets bias-pull-up to be sure. [1]: https://github.com/sonyxperiadev/kernel/blob/57b5050e340f40a88e1ddb8d16fd9adb44418923/arch/arm/boot/dts/qcom/msm8939-kanuti_tulip.dtsi#L634-L636 Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230529-msm8916-pinctrl-v1-1-11f540b51c93@gerhold.net commit d59b294874c7f51317dc7edfc12ff950260ed2b9 Author: Dmitry Baryshkov Date: Wed May 31 04:16:23 2023 +0300 ARM: dts: qcom: msm8974: rename labels for DSI nodes Currently in board files MDSS and HDMI nodes stay apart, because labels for HDMI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node aliases from dsi_* to mdss_dsi_*. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-15-dmitry.baryshkov@linaro.org commit f43b6dc7d56ecbd96d8dfb3c3225c46e18f1b842 Author: Dmitry Baryshkov Date: Wed May 31 04:16:22 2023 +0300 arm64: dts: qcom: msm8996: rename labels for HDMI nodes Currently in board files MDSS and HDMI nodes stay apart, because labels for HDMI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change HDMI node labels from hdmi_* to mdss_hdmi_*. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-14-dmitry.baryshkov@linaro.org commit e47a7f571d57d383f345e85c47a05ef1801b278c Author: Dmitry Baryshkov Date: Wed May 31 04:16:21 2023 +0300 arm64: dts: qcom: sm8250: rename labels for DSI nodes Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-13-dmitry.baryshkov@linaro.org commit 8fe25ba3ffec7e8e2345d0163990b77a4092e456 Author: Dmitry Baryshkov Date: Wed May 31 04:16:20 2023 +0300 arm64: dts: qcom: sdm845: rename labels for DSI nodes Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-12-dmitry.baryshkov@linaro.org commit 8e61d532370eb6946d97e39d270129e9442fb326 Author: Dmitry Baryshkov Date: Wed May 31 04:16:19 2023 +0300 arm64: dts: qcom: sdm630: rename labels for DSI nodes Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-11-dmitry.baryshkov@linaro.org commit c3c466d9f305291366f0af0650e62bf8a6c31501 Author: Dmitry Baryshkov Date: Wed May 31 04:16:18 2023 +0300 arm64: dts: qcom: sc8180x: rename labels for DSI nodes Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-10-dmitry.baryshkov@linaro.org commit 71c97412f1d77314434c4097b0ed12646a0403b0 Author: Dmitry Baryshkov Date: Wed May 31 04:16:17 2023 +0300 arm64: dts: qcom: sc7280: rename labels for DSI nodes Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-9-dmitry.baryshkov@linaro.org commit 2b616f86d51ba534ba41b175846e7f9b3afb6e15 Author: Dmitry Baryshkov Date: Wed May 31 04:16:16 2023 +0300 arm64: dts: qcom: sc7180: rename labels for DSI nodes Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-8-dmitry.baryshkov@linaro.org commit 8b764ed0d04621cd3859a351c7d5cc14e87f6c4a Author: Dmitry Baryshkov Date: Wed May 31 04:16:15 2023 +0300 arm64: dts: qcom: msm8996: rename labels for DSI nodes Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-7-dmitry.baryshkov@linaro.org commit 8b87d0585ca6ca0c646d685f29c9a25ade3cb95c Author: Dmitry Baryshkov Date: Wed May 31 04:16:14 2023 +0300 arm64: dts: qcom: msm8953: rename labels for DSI nodes Currently in board files MDSS and DSI nodes stay apart, because labels for DSI nodes do not have the mdss_ prefix. It was found that grouping all display-related notes is more useful. To keep all display-related nodes close in the board files, change DSI node labels from dsi_* to mdss_dsi_*. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-6-dmitry.baryshkov@linaro.org commit f82c8d2f00f6e04a1bc3ad6f0b971a83b02d0bfe Author: Dmitry Baryshkov Date: Wed May 31 04:16:13 2023 +0300 arm64: dts: qcom: qrb5165-rb5: remove useless enablement of mdss_mdp The MDP/DPU device is not disabled by default since the commit 0c25dad9f2a7 ("arm64: dts: qcom: sm8250: Don't disable MDP explicitly"), so there is not point in enabling it in the board DTS file. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-5-dmitry.baryshkov@linaro.org commit 6670bd9e42b43317b3f14dc4e97c3356d7602d63 Author: Dmitry Baryshkov Date: Wed May 31 04:16:12 2023 +0300 arm64: dts: qcom: sm8450-hdk: remove useless enablement of mdss_mdp The MDP/DPU device is not disabled by default, so there is not point in enabling it in the board DTS file. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-4-dmitry.baryshkov@linaro.org commit 7116603bdb60b63f108662a5b36f99136e25c4d5 Author: Dmitry Baryshkov Date: Wed May 31 04:16:11 2023 +0300 arm64: dts: qcom: sm8350-hdk: remove useless enablement of mdss_mdp The MDP/DPU device is not disabled by default, so there is not point in enabling it in the board DTS file. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-3-dmitry.baryshkov@linaro.org commit 650c09daca4cac35ffd264ee1ca92521bdd9a5a9 Author: Dmitry Baryshkov Date: Wed May 31 04:16:10 2023 +0300 arm64: dts: qcom: sc7280: Don't disable MDP explicitly MDSS and all its subdevices are useless without DPU/MDP, so disabling MDP doesn't make any sense. Remove explicit disabling of the DPU device. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531011623.3808538-2-dmitry.baryshkov@linaro.org commit 6198772ec4d9dcd2fea63b4020cef117a786d738 Author: Dmitry Baryshkov Date: Wed May 31 04:26:27 2023 +0300 ARM: dts: qcom: apq8074-dragonboard: add gpio keys Add device nodes for gpio-keys (volume-up, general key) device nodes. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531012627.3813060-3-dmitry.baryshkov@linaro.org commit b9a0de7d5719aa54199da2932c1b1fdb948ff753 Author: Dmitry Baryshkov Date: Wed May 31 04:26:26 2023 +0300 ARM: dts: qcom: apq8074-dragonboard: add onboard leds The dragonboard as three LEDs: red, green and blue. Add corresponding description. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531012627.3813060-2-dmitry.baryshkov@linaro.org commit 2435d79033f5e7400195ed3b31585c0c053de553 Author: Poovendhan Selvaraj Date: Wed May 31 08:56:48 2023 +0530 arm64: dts: qcom: ipq9574: add support for RDP454 variant Add the initial device tree support for the Reference Design Platform (RDP) 454 based on IPQ9574 family of SoCs. This patch adds support for Console UART, SPI NOR and SMPA1 regulator node. Signed-off-by: Poovendhan Selvaraj Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531032648.23816-3-quic_poovendh@quicinc.com commit add687cbfc3482ca74949b91b251e76792d25652 Author: Poovendhan Selvaraj Date: Wed May 31 08:56:47 2023 +0530 dt-bindings: arm: qcom: document AL02-C9 board based on IPQ9574 family Document AL02-C9 (Reference Design Platform 454) board based on IPQ9574 family of SoCs. Acked-by: Conor Dooley Signed-off-by: Poovendhan Selvaraj Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531032648.23816-2-quic_poovendh@quicinc.com commit 852865530a21d139196106543cdf3e76c389659b Author: Konrad Dybcio Date: Wed May 31 17:04:24 2023 +0200 arm64: dts: qcom: sm6375: Add GPUCC and Adreno SMMU Add GPUCC and Adreno SMMU nodes in preparation for adding the GPU itself. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531-topic-sm6375_gpusmmu-v1-2-860943894c71@linaro.org commit a19a3dcb0d190254ded4ac1cabb0f402e4b7c8c4 Author: Konrad Dybcio Date: Thu Jun 1 10:56:50 2023 +0300 arm64: defconfig: Build SM6115 display and GPU clock controller drivers Enable the clock controllers required for a good visual experience on Qualcomm SM6115 platform boards. Signed-off-by: Konrad Dybcio [vzapolskiy: minimal changes to a commit message] Signed-off-by: Vladimir Zapolskiy Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601075650.1437184-6-vladimir.zapolskiy@linaro.org commit f20575d6963da3ccc21a9cf54b04b869e88a8e18 Author: Vladimir Zapolskiy Date: Thu Jun 1 10:56:49 2023 +0300 arm64: defconfig: Build display clock controller driver for QCM2290 Build display clock controller driver for Qualcomm QCM2290 platform. Signed-off-by: Vladimir Zapolskiy Acked-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601075650.1437184-5-vladimir.zapolskiy@linaro.org commit 39433f576758d955c7e4ff58e945540b1cddba98 Author: Vladimir Zapolskiy Date: Thu Jun 1 10:56:48 2023 +0300 arm64: defconfig: Build interconnect driver for QCM2290 Build Qualcomm QCM2290 interconnect driver as a kernel module by default. QUPv3 GENI IP uses the interconnects and provides UARTs, but since the dependency is not yet displayed in the platform qcm2290.dtsi file, it could be assumed that the interconnect IP is preconfigured, thus building the driver as a module and placing it in an initramfs should be sufficient for booting up to rootfs stage. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601075650.1437184-4-vladimir.zapolskiy@linaro.org commit b128ec5d5df44a6d204f959d0325635bb0d995d0 Author: Vladimir Zapolskiy Date: Thu Jun 1 10:56:47 2023 +0300 arm64: defconfig: Build Global Clock Controller driver for QCM2290 Build Qualcomm QCM2290 GCC driver. Signed-off-by: Vladimir Zapolskiy Acked-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601075650.1437184-3-vladimir.zapolskiy@linaro.org commit eac3e74cba6d5a7e1060ffb730c1071a0b4db7fa Author: Vladimir Zapolskiy Date: Thu Jun 1 10:56:46 2023 +0300 arm64: defconfig: Build MSM power manager driver Build Qualcomm MSM Power Manager driver, which is needed for QCM2290 platform, otherwise the TLMM pin controller driver probe fails on boot. Signed-off-by: Vladimir Zapolskiy Acked-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601075650.1437184-2-vladimir.zapolskiy@linaro.org commit e88c533d8a2a0fe84bb54cff1569bd079ad3512c Author: Konrad Dybcio Date: Thu Jun 1 11:39:08 2023 +0200 clk: qcom: gcc-sm6115: Add missing PLL config properties When the driver was ported upstream, PLL ctl register values were omitted. Add them to ensure the PLLs are fully configured like we expect them to. Fixes: cbe63bfdc54f ("clk: qcom: Add Global Clock controller (GCC) driver for SM6115") Signed-off-by: Konrad Dybcio Reviewed-by: Iskren Chernev Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601-topic-alpha_ctl-v1-2-b6a932dfcf68@linaro.org commit 501624339466a7896bb8a1f048cf8dcfd54b174e Author: Konrad Dybcio Date: Thu Jun 1 11:39:07 2023 +0200 clk: qcom: clk-alpha-pll: Add a way to update some bits of test_ctl(_hi) The "vanilla" Alpha PLL configs are sometimes provided with an intention to only update certain bits of th register. Do so if a mask is found. Signed-off-by: Konrad Dybcio Reviewed-by: Iskren Chernev Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601-topic-alpha_ctl-v1-1-b6a932dfcf68@linaro.org commit 11a1397bbf69e408223bb691858a0fcd295a8f76 Author: Abel Vesa Date: Thu Jun 1 13:38:17 2023 +0300 arm64: dts: qcom: sm8550: Add missing interconnect path to USB HC The USB HC node is missing the interconnect paths, so add them. Fixes: 7f7e5c1b037f ("arm64: dts: qcom: sm8550: Add USB PHYs and controller nodes") Signed-off-by: Abel Vesa Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601103817.4066446-1-abel.vesa@linaro.org commit 6901ff9987469fa33d06990463adc8a63f8be5d0 Author: Komal Bajaj Date: Thu Jun 1 16:41:28 2023 +0530 arm64: dts: qcom: qdu1000-idp: add SDHCI for emmc Add sdhci node for emmc in qdu1000-idp. Reviewed-by: Konrad Dybcio Signed-off-by: Komal Bajaj Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601111128.19562-4-quic_kbajaj@quicinc.com commit 90c8c4eb4bbb5e2e241fd5286bd43dd30a850b9d Author: Komal Bajaj Date: Thu Jun 1 16:41:27 2023 +0530 arm64: dts: qcom: qdu1000: Add SDHCI node Add sdhc node for eMMC on QDU1000 and QRU1000 SoCs. Also add required pins for SDHCI, so that the interface can work reliably. Reviewed-by: Konrad Dybcio Signed-off-by: Komal Bajaj Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601111128.19562-3-quic_kbajaj@quicinc.com commit 5ae7899765607e97e5eb34486336898c8d9ec654 Author: Arnd Bergmann Date: Thu Jun 1 23:34:12 2023 +0200 clk: qcom: gcc-ipq6018: remove duplicate initializers A recent change added new initializers for .config_ctl_val and .config_ctl_hi_val but left the old values in place: drivers/clk/qcom/gcc-ipq6018.c:4155:27: error: initialized field overwritten [-Werror=override-init] 4155 | .config_ctl_val = 0x240d4828, | ^~~~~~~~~~ drivers/clk/qcom/gcc-ipq6018.c:4156:30: error: initialized field overwritten [-Werror=override-init] 4156 | .config_ctl_hi_val = 0x6, | ^~~ Remove the unused ones now to avoid confusion. Fixes: f4f0c8acee0e4 ("clk: qcom: gcc-ipq6018: update UBI32 PLL") Signed-off-by: Arnd Bergmann Reviewed-by: Robert Marko Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601213416.3373599-1-arnd@kernel.org commit b5b0649d5be4c82d09489492c121a7823323fc4a Author: Abel Vesa Date: Fri Jun 2 09:20:16 2023 +0300 arm64: dts: qcom: sm8450: Add missing interconnect paths to USB HC The USB HC node is missing the interconnect paths, so add them. Signed-off-by: Abel Vesa Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230602062016.1883171-6-abel.vesa@linaro.org commit 8b51dc863baf1447e9ab52411c5bed7ef9a56d80 Author: Abel Vesa Date: Fri Jun 2 09:20:15 2023 +0300 arm64: dts: qcom: sm8350: Add missing interconnect paths to USB HCs The USB HCs nodes are missing the interconnect paths, so add them. Signed-off-by: Abel Vesa Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230602062016.1883171-5-abel.vesa@linaro.org commit fd62fd1cf9e7fb7ef761e411d37cb5d06769954b Author: Abel Vesa Date: Fri Jun 2 09:20:14 2023 +0300 arm64: dts: qcom: sm8250: Add missing interconnect paths to USB HCs The USB HCs nodes are missing the interconnect paths, so add them. Signed-off-by: Abel Vesa Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230602062016.1883171-4-abel.vesa@linaro.org commit b5a12438325b9c0207ae4374a797368070cfb945 Author: Abel Vesa Date: Fri Jun 2 09:20:13 2023 +0300 arm64: dts: qcom: sm8250: Use 2 interconnect cells Use two interconnect cells in order to optionally support a path tag. Signed-off-by: Abel Vesa Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230602062016.1883171-3-abel.vesa@linaro.org commit c2998e9a42637cdab699a21aa75a8cb5a7cbce72 Author: Abel Vesa Date: Fri Jun 2 09:20:12 2023 +0300 arm64: dts: qcom: sm8150: Add missing interconnect paths to USB HCs The USB HCs nodes are missing the interconnect paths, so add them. Signed-off-by: Abel Vesa Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230602062016.1883171-2-abel.vesa@linaro.org commit 97c289026c62f80933b44353904b919572175f61 Author: Abel Vesa Date: Fri Jun 2 09:20:11 2023 +0300 arm64: dts: qcom: sm8150: Use 2 interconnect cells Use two interconnect cells in order to optionally support a path tag. Signed-off-by: Abel Vesa Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230602062016.1883171-1-abel.vesa@linaro.org commit 223ce29c8b7e5b00f01a68387aabeefd77d97f06 Author: Marijn Suijten Date: Tue Jun 6 23:14:18 2023 +0200 arm64: dts: qcom: sm8250-edo: Panel framebuffer is 2.5k instead of 4k The framebuffer configuration for edo pdx203, written in edo dtsi (which is overwritten in pdx206 dts for its smaller panel) has to use a 1096x2560 configuration as this is what the panel (and framebuffer area) has been initialized to. Downstream userspace also has access to (and uses) this 2.5k mode by default, and only switches the panel to 4k when requested. This is similar to commit be8de06dc397 ("arm64: dts: qcom: sm8150-kumano: Panel framebuffer is 2.5k instead of 4k") which fixed the same for the previous generation Sony platform. Fixes: 69cdb97ef652 ("arm64: dts: qcom: sm8250: Add support for SONY Xperia 1 II / 5 II (Edo platform)") Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230606211418.587676-1-marijn.suijten@somainline.org commit 4acf7eceed31c56cf4baf11d43ee91255685f89a Author: Konrad Dybcio Date: Wed Jun 7 01:04:19 2023 +0200 arm64: dts: qcom: qcm2290: Add CPU idle states Add the (scarce) idle states for the individual CPUs, as well as the whole cluster. This enables deeper-than-WFI cpuidle Signed-off-by: Konrad Dybcio Reviewed-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230606-topic-qcm2290_idlestates-v2-1-580a5a2d28c9@linaro.org commit 2b01dda16124696c4b64edcd31e8c2d37c559998 Author: Rudraksha Gupta Date: Wed Jun 7 01:00:23 2023 -0400 ARM: dts: qcom: Add Samsung Galaxy Express support Add a very basic device tree file for the Samsung Galaxy Express SGH-I437. Currently, the following things work: UART, eMMC, SD Card, and USB. Signed-off-by: Rudraksha Gupta Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230607050025.86636-5-guptarud@gmail.com commit 80ce22e5cbe705ff2e113890828d44aa0b3ad96f Author: Rudraksha Gupta Date: Wed Jun 7 01:00:22 2023 -0400 ARM: dts: qcom: msm8960: Add USB node Add the required nodes to support USB on the MSM8960 SoC. As it's very similar to the APQ8064 SoC, the nodes are almost identical Add a label to sleep_clk for the USB node to reference Signed-off-by: Rudraksha Gupta Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230607050025.86636-4-guptarud@gmail.com commit abc49a7c6035c57ece0642811f70a7a3892badb6 Author: Rudraksha Gupta Date: Wed Jun 7 01:00:20 2023 -0400 dt-bindings: arm: qcom: Add Samsung Galaxy Express Add a compatible for Samsung Galaxy Express SGH-I437. Signed-off-by: Rudraksha Gupta Acked-by: Conor Dooley Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230607050025.86636-2-guptarud@gmail.com commit 581dcbe60b6390c633f318a29db41d1df642e6d8 Author: Varadarajan Narayanan Date: Wed Jun 7 14:23:10 2023 +0530 arm64: dts: qcom: ipq9574: add thermal zone nodes This patch adds thermal zone nodes for the various sensors present in IPQ9574 Reviewed-by: Dmitry Baryshkov Co-developed-by: Praveenkumar I Signed-off-by: Praveenkumar I Signed-off-by: Varadarajan Narayanan Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/404c88e9746b3f25585aef078861ec2c273232d5.1686125196.git.quic_varada@quicinc.com commit 2e0580e10e919b544d7be1b2b8fc48fc7dff1322 Author: Varadarajan Narayanan Date: Wed Jun 7 14:23:09 2023 +0530 arm64: dts: qcom: ipq9574: add tsens node IPQ9574 has a tsens v2.3.1 peripheral which monitors temperatures around the various subsystems on the die. Reviewed-by: Konrad Dybcio Co-developed-by: Praveenkumar I Signed-off-by: Praveenkumar I Signed-off-by: Varadarajan Narayanan Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/00fa16039db78dcb919bd15444bbf86ff3a340d6.1686125196.git.quic_varada@quicinc.com commit 56d3067cb694ba60d654e7f5ef231b6fabc4697f Author: Robert Marko Date: Wed Jun 7 20:44:48 2023 +0200 arm64: dts: qcom: ipq8074: add critical thermal trips According to bindings, thermal zones must have associated trips as well. Since we currently dont have CPUFreq support and thus no passive cooling lets start by defining critical trips to protect the devices against severe overheating. Signed-off-by: Robert Marko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com commit 7b8f119a24f40f4765b8318fb5f6c3feb7d1c713 Author: Artur Weber Date: Fri May 19 20:07:27 2023 +0200 ARM: dts: qcom: adapt to LP855X bindings changes Change underscores in ROM node names to dashes, and remove deprecated pwm-period property. Signed-off-by: Artur Weber Reviewed-by: Luca Weiss Reviewed-by: Daniel Thompson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230519180728.2281-4-aweber.kernel@gmail.com commit f6b2bd9cb29a1150a16f29a8d070e21317c62e71 Author: Anusha Rao Date: Fri May 26 21:41:27 2023 +0530 clk: qcom: gcc-ipq9574: Enable crypto clocks Enable the clocks required for crypto operation. Reviewed-by: Bhupesh Sharma Signed-off-by: Anusha Rao Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526161129.1454-3-quic_anusha@quicinc.com commit 460af1f9d9e62acce4a21f9bd00b5bcd5963bcd4 Author: Yu Kuai Date: Mon May 29 21:11:06 2023 +0800 md/raid1-10: limit the number of plugged bio bio can be added to plug infinitely, and following writeback test can trigger huge amount of plugged bio: Test script: modprobe brd rd_nr=4 rd_size=10485760 mdadm -CR /dev/md0 -l10 -n4 /dev/ram[0123] --assume-clean --bitmap=internal echo 0 > /proc/sys/vm/dirty_background_ratio fio -filename=/dev/md0 -ioengine=libaio -rw=write -bs=4k -numjobs=1 -iodepth=128 -name=test Test result: Monitor /sys/block/md0/inflight will found that inflight keep increasing until fio finish writing, after running for about 2 minutes: [root@fedora ~]# cat /sys/block/md0/inflight 0 4474191 Fix the problem by limiting the number of plugged bio based on the number of copies for original bio. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230529131106.2123367-8-yukuai1@huaweicloud.com commit 9efcc2c3df7612eea02daa159ae7c6ac44420513 Author: Yu Kuai Date: Mon May 29 21:11:05 2023 +0800 md/raid1-10: don't handle pluged bio by daemon thread current->bio_list will be set under submit_bio() context, in this case bitmap io will be added to the list and wait for current io submission to finish, while current io submission must wait for bitmap io to be done. commit 874807a83139 ("md/raid1{,0}: fix deadlock in bitmap_unplug.") fix the deadlock by handling plugged bio by daemon thread. On the one hand, the deadlock won't exist after commit a214b949d8e3 ("blk-mq: only flush requests from the plug in blk_mq_submit_bio"). On the other hand, current solution makes it impossible to flush plugged bio in raid1/10_make_request(), because this will cause that all the writes will goto daemon thread. In order to limit the number of plugged bio, commit 874807a83139 ("md/raid1{,0}: fix deadlock in bitmap_unplug.") is reverted, and the deadlock is fixed by handling bitmap io asynchronously. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230529131106.2123367-7-yukuai1@huaweicloud.com commit a022325ab970cf04b66ca128a87345714aa44b99 Author: Yu Kuai Date: Mon May 29 21:11:04 2023 +0800 md/md-bitmap: add a new helper to unplug bitmap asynchrously If bitmap is enabled, bitmap must update before submitting write io, this is why unplug callback must move these io to 'conf->pending_io_list' if 'current->bio_list' is not empty, which will suffer performance degradation. A new helper md_bitmap_unplug_async() is introduced to submit bitmap io in a kworker, so that submit bitmap io in raid10_unplug() doesn't require that 'current->bio_list' is empty. This patch prepare to limit the number of plugged bio. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230529131106.2123367-6-yukuai1@huaweicloud.com commit 7db922bae3abdf0a1db81ef7228cc0b996a0c1e3 Author: Yu Kuai Date: Mon May 29 21:11:03 2023 +0800 md/raid1-10: submit write io directly if bitmap is not enabled Commit 6cce3b23f6f8 ("[PATCH] md: write intent bitmap support for raid10") add bitmap support, and it changed that write io is submitted through daemon thread because bitmap need to be updated before write io. And later, plug is used to fix performance regression because all the write io will go to demon thread, which means io can't be issued concurrently. However, if bitmap is not enabled, the write io should not go to daemon thread in the first place, and plug is not needed as well. Fixes: 6cce3b23f6f8 ("[PATCH] md: write intent bitmap support for raid10") Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230529131106.2123367-5-yukuai1@huaweicloud.com commit 8295efbe68c080047e98d9c0eb5cb933b238a8cb Author: Yu Kuai Date: Mon May 29 21:11:02 2023 +0800 md/raid1-10: factor out a helper to submit normal write There are multiple places to do the same thing, factor out a helper to prevent redundant code, and the helper will be used in following patch as well. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230529131106.2123367-4-yukuai1@huaweicloud.com commit 5ec6ca140a034682e421e2e808ef5ddfdfd65242 Author: Yu Kuai Date: Mon May 29 21:11:01 2023 +0800 md/raid1-10: factor out a helper to add bio to plug The code in raid1 and raid10 is identical, prepare to limit the number of plugged bios. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230529131106.2123367-3-yukuai1@huaweicloud.com commit 010444623e7f4da6b4a4dd603a7da7469981e293 Author: Yu Kuai Date: Mon May 29 21:11:00 2023 +0800 md/raid10: prevent soft lockup while flush writes Currently, there is no limit for raid1/raid10 plugged bio. While flushing writes, raid1 has cond_resched() while raid10 doesn't, and too many writes can cause soft lockup. Follow up soft lockup can be triggered easily with writeback test for raid10 with ramdisks: watchdog: BUG: soft lockup - CPU#10 stuck for 27s! [md0_raid10:1293] Call Trace: call_rcu+0x16/0x20 put_object+0x41/0x80 __delete_object+0x50/0x90 delete_object_full+0x2b/0x40 kmemleak_free+0x46/0xa0 slab_free_freelist_hook.constprop.0+0xed/0x1a0 kmem_cache_free+0xfd/0x300 mempool_free_slab+0x1f/0x30 mempool_free+0x3a/0x100 bio_free+0x59/0x80 bio_put+0xcf/0x2c0 free_r10bio+0xbf/0xf0 raid_end_bio_io+0x78/0xb0 one_write_done+0x8a/0xa0 raid10_end_write_request+0x1b4/0x430 bio_endio+0x175/0x320 brd_submit_bio+0x3b9/0x9b7 [brd] __submit_bio+0x69/0xe0 submit_bio_noacct_nocheck+0x1e6/0x5a0 submit_bio_noacct+0x38c/0x7e0 flush_pending_writes+0xf0/0x240 raid10d+0xac/0x1ed0 Fix the problem by adding cond_resched() to raid10 like what raid1 did. Note that unlimited plugged bio still need to be optimized, for example, in the case of lots of dirty pages writeback, this will take lots of memory and io will spend a long time in plug, hence io latency is bad. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230529131106.2123367-2-yukuai1@huaweicloud.com commit 2ae6aaf76912bae53c74b191569d2ab484f24bf3 Author: Li Nan Date: Fri Jun 2 17:18:39 2023 +0800 md/raid10: fix io loss while replacement replace rdev When removing a disk with replacement, the replacement will be used to replace rdev. During this process, there is a brief window in which both rdev and replacement are read as NULL in raid10_write_request(). This will result in io not being submitted but it should be. //remove //write raid10_remove_disk raid10_write_request mirror->rdev = NULL read rdev -> NULL mirror->rdev = mirror->replacement mirror->replacement = NULL read replacement -> NULL Fix it by reading replacement first and rdev later, meanwhile, use smp_mb() to prevent memory reordering. Fixes: 475b0321a4df ("md/raid10: writes should get directed to replacement as well as original.") Signed-off-by: Li Nan Reviewed-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230602091839.743798-3-linan666@huaweicloud.com commit 8d355a46c1e0cea59be3ea8395409a5e6eeed946 Author: Li Nan Date: Fri Jun 2 17:18:38 2023 +0800 md/raid10: Do not add spare disk when recovery fails In raid10_sync_request(), if data cannot be read from any disk for recovery, it will go to 'giveup' and let 'chunks_skipped' + 1. After multiple 'giveup', when 'chunks_skipped >= geo.raid_disks', it will return 'max_sector', indicating that the recovery has been completed. However, the recovery is just aborted and the data remains inconsistent. Fix it by setting mirror->recovery_disabled, which will prevent the spare disk from being added to this mirror. The same issue also exists during resync, it will be fixed afterwards. Signed-off-by: Li Nan Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230602091839.743798-2-linan666@huaweicloud.com commit 4d8a5754a694062f349b8bf66856561e3840c7e5 Author: Li Nan Date: Sat May 27 18:18:51 2023 +0800 md/raid10: clean up md_add_new_disk() Commit 1a855a060665 ("md: fix bug with re-adding of partially recovered device.") only add device which is set to In_sync. But it let devices without metadata cannot be added when they should be. Commit bf572541ab44 ("md: fix regression with re-adding devices to arrays with no metadata") fix the above issue, it set device without metadata to In_sync when add new disk. However, after commit f466722ca614 ("md: Change handling of save_raid_disk and metadata update during recovery.") deletes changes of the first patch, setting In_sync for devcie without metadata is meanless because the flag will be cleared soon and will not be used during this period. Clean it up. Signed-off-by: Li Nan Reviewed-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230527101851.3266500-2-linan666@huaweicloud.com commit 6090368abcb40554c660c8c3140ce19ff0f8f66f Author: Li Nan Date: Sat May 27 17:20:07 2023 +0800 md/raid10: prioritize adding disk to 'removed' mirror When add a new disk to raid10, it will traverse conf->mirror from start and find one of the following mirror to add: 1. mirror->rdev is set to WantReplacement and it have no replacement, set new disk to mirror->replacement. 2. no mirror->rdev, set new disk to mirror->rdev. There is a array as below (sda is set to WantReplacement): Number Major Minor RaidDevice State 0 8 0 0 active sync set-A /dev/sda - 0 0 1 removed 2 8 32 2 active sync set-A /dev/sdc 3 8 48 3 active sync set-B /dev/sdd Use 'mdadm --add' to add a new disk to this array, the new disk will become sda's replacement instead of add to removed position, which is confusing for users. Meanwhile, after new disk recovery success, sda will be set to Faulty. Prioritize adding disk to 'removed' mirror is a better choice. In the above scenario, the behavior is the same as before, except sda will not be deleted. Before other disks are added, continued use sda is more reliable. Signed-off-by: Li Nan Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230527092007.3008856-1-linan666@huaweicloud.com commit 59f8f0b54c8ffb4521f6bbd1cb6f4dfa5022e75e Author: Li Nan Date: Sat May 27 15:22:16 2023 +0800 md/raid10: improve code of mrdev in raid10_sync_request 'need_recover' and 'mrdev' are equivalent in raid10_sync_request(), and inc mrdev->nr_pending is unreasonable if don't need recovery. Replace 'need_recover' with 'mrdev', and only inc nr_pending when needed. Signed-off-by: Li Nan Reviewed-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230527072218.2365857-3-linan666@huaweicloud.com commit 34817a2441747b48e444cb0e05d84e14bc9443da Author: Li Nan Date: Sat May 27 15:22:15 2023 +0800 md/raid10: fix null-ptr-deref of mreplace in raid10_sync_request There are two check of 'mreplace' in raid10_sync_request(). In the first check, 'need_replace' will be set and 'mreplace' will be used later if no-Faulty 'mreplace' exists, In the second check, 'mreplace' will be set to NULL if it is Faulty, but 'need_replace' will not be changed accordingly. null-ptr-deref occurs if Faulty is set between two check. Fix it by merging two checks into one. And replace 'need_replace' with 'mreplace' because their values are always the same. Fixes: ee37d7314a32 ("md/raid10: Fix raid10 replace hang when new added disk faulty") Signed-off-by: Li Nan Reviewed-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230527072218.2365857-2-linan666@huaweicloud.com commit 75aa7a1b8f85b03971df1d0f5b1a3a9edf020dff Author: Yu Kuai Date: Mon May 29 21:34:10 2023 +0800 md/raid5: don't start reshape when recovery or replace is in progress When recovery is interrupted (reboot, etc.) check for MD_RECOVERY_RUNNING is not enough to tell recovery is in progress. Also check recovery_cp before starting reshape. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230529133410.2125914-1-yukuai1@huaweicloud.com commit 4469315439827290923fce4f3f672599cabeb366 Author: Yu Kuai Date: Tue May 23 10:10:17 2023 +0800 md: protect md_thread with rcu Currently, there are many places that md_thread can be accessed without protection, following are known scenarios that can cause null-ptr-dereference or uaf: 1) sync_thread that is allocated and started from md_start_sync() 2) mddev->thread can be accessed directly from timeout_store() and md_bitmap_daemon_work() 3) md_unregister_thread() from action_store(). Currently, a global spinlock 'pers_lock' is borrowed to protect 'mddev->thread' in some places, this problem can be fixed likewise, however, use a global lock for all the cases is not good. Fix this problem by protecting all md_thread with rcu. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230523021017.3048783-6-yukuai1@huaweicloud.com commit 4eeb6535cd51100460ec8873bb68addef17b3e81 Author: Yu Kuai Date: Tue May 23 10:10:16 2023 +0800 md/bitmap: factor out a helper to set timeout Register/unregister 'mddev->thread' are both under 'reconfig_mutex', however, some context didn't hold the mutex to access mddev->thread, which can cause null-ptr-deference: 1) md_bitmap_daemon_work() can be called from md_check_recovery() where 'reconfig_mutex' is not held, deference 'mddev->thread' might cause null-ptr-deference, because md_unregister_thread() reset the pointer before stopping the thread. 2) timeout_store() access 'mddev->thread' multiple times, null-ptr-deference can be triggered if 'mddev->thread' is reset in the middle. This patch factor out a helper to set timeout, the new helper always check if 'mddev->thread' is null first, so that problem 1 can be fixed. Now that this helper only access 'mddev->thread' once, but it's possible that 'mddev->thread' can be freed while this helper is still in progress, hence the problem is not fixed yet. Follow up patches will fix this by protecting md_thread with rcu. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230523021017.3048783-5-yukuai1@huaweicloud.com commit c333673a78307abe6b1f6998809288fcd86740ed Author: Yu Kuai Date: Tue May 23 10:10:15 2023 +0800 md/bitmap: always wake up md_thread in timeout_store md_wakeup_thread() can handle the case that pass in md_thread is NULL, the only difference is that md_wakeup_thread() will be called when current timeout is 'MAX_SCHEDULE_TIMEOUT', this should not matter because timeout_store() is not hot path, and the daemon process is woke up more than demand from other context already. Prepare to factor out a helper to set timeout. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230523021017.3048783-4-yukuai1@huaweicloud.com commit 955a257d69e44cea09b0375b8f2f3d4d9fcf7b4e Author: Yu Kuai Date: Tue May 23 10:10:14 2023 +0800 dm-raid: remove useless checking in raid_message() md_wakeup_thread() handle the case that pass in md_thread is NULL, there is no need to check this. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230523021017.3048783-3-yukuai1@huaweicloud.com commit e5e9b9cb71a09d86d5e8d147e6a6457e1f8887b5 Author: Yu Kuai Date: Tue May 23 10:10:13 2023 +0800 md: factor out a helper to wake up md_thread directly md_wakeup_thread() can't wakeup md_thread->tsk if md_thread->run is still in progress, and in some cases md_thread->tsk need to be woke up directly, like md_set_readonly() and do_md_stop(). Commit 9dfbdafda3b3 ("md: unlock mddev before reap sync_thread in action_store") introduce a new scenario where unregister sync_thread is not protected by 'reconfig_mutex', this can cause null-ptr-deference in theroy: t1: md_set_readonly t2: action_store md_unregister_thread // 'reconfig_mutex' is not held // 'reconfig_mutex' is held by caller if (mddev->sync_thread) thread = *threadp *threadp = NULL wake_up_process(mddev->sync_thread->tsk) // null-ptr-deference Fix this problem by factoring out a helper to wake up md_thread directly, so that 'sync_thread' won't be accessed multiple times from the reader side. This helper also prepare to protect md_thread with rcu. Noted that later patches is going to fix that unregister sync_thread is not protected by 'reconfig_mutex' from action_store(). Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230523021017.3048783-2-yukuai1@huaweicloud.com commit 3ce94ce5d05ae89190a23f6187f64d8f4b2d3782 Author: Yu Kuai Date: Tue May 23 09:27:27 2023 +0800 md: fix duplicate filename for rdev Commit 5792a2856a63 ("[PATCH] md: avoid a deadlock when removing a device from an md array via sysfs") delays the deletion of rdev, however, this introduces a window that rdev can be added again while the deletion is not done yet, and sysfs will complain about duplicate filename. Follow up patches try to fix this problem by flushing workqueue, however, flush_rdev_wq() is just dead code, the progress in md_kick_rdev_from_array(): 1) list_del_rcu(&rdev->same_set); 2) synchronize_rcu(); 3) queue_work(md_rdev_misc_wq, &rdev->del_work); So in flush_rdev_wq(), if rdev is found in the list, work_pending() can never pass, in the meantime, if work is queued, then rdev can never be found in the list. flush_rdev_wq() can be replaced by flush_workqueue() directly, however, this approach is not good: - the workqueue is global, this synchronization for all raid disks is not necessary. - flush_workqueue can't be called under 'reconfig_mutex', there is still a small window between flush_workqueue() and mddev_lock() that other contexts can queue new work, hence the problem is not solved completely. sysfs already has apis to support delete itself through writer, and these apis, specifically sysfs_break/unbreak_active_protection(), is used to support deleting rdev synchronously. Therefore, the above commit can be reverted, and sysfs duplicate filename can be avoided. A new mdadm regression test is proposed as well([1]). [1] https://lore.kernel.org/linux-raid/20230428062845.1975462-1-yukuai1@huaweicloud.com/ Fixes: 5792a2856a63 ("[PATCH] md: avoid a deadlock when removing a device from an md array via sysfs") Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230523012727.3042247-1-yukuai1@huaweicloud.com commit 34354cc946abe6b6e4b71883dddfdd368e856d65 Author: Yassine Oudjana Date: Sat May 27 12:39:33 2023 +0300 arm64: dts: qcom: msm8996pro: Add CBF scaling support Add opp-peak-kBps to CPU OPPs to allow for CBF scaling, and change the CBF compatible to reflect the difference between it and the one on MSM8996. Signed-off-by: Yassine Oudjana Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230527093934.101335-3-y.oudjana@protonmail.com commit e58cf964157bb2f875155a2dcf68f3a8db0da2e3 Author: Joel Selvaraj Date: Fri May 26 22:50:24 2023 +0100 arm64: dts: qcom: sdm845-xiaomi-beryllium: enable pmi8998 charger Enable the pmi8998 charger and define some basic battery properties. Signed-off-by: Joel Selvaraj Signed-off-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524-pmi8998-charger-dts-v2-5-2a5c77d2ff0c@linaro.org commit e5d83d4d5cb9e00befb497fe8a64001ac1cce157 Author: Caleb Connolly Date: Fri May 26 22:50:23 2023 +0100 arm64: dts: qcom: sdm845-shift-axolotl: enable pmi8998 charger Enable the PMI8998/smb2 charger, and denote the secondary SMB1355 charger which is used for parallel charging. Signed-off-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524-pmi8998-charger-dts-v2-4-2a5c77d2ff0c@linaro.org commit 23cf50b13e0686cd9929f54f89580d7b22cbeb71 Author: Caleb Connolly Date: Fri May 26 22:50:22 2023 +0100 arm64: dts: qcom: sdm845-oneplus: enable pmi8998 charger Enable the pmi8998 charger on both devices, enabling charging speeds above the default 500mA limit the bootloader sets. Signed-off-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524-pmi8998-charger-dts-v2-3-2a5c77d2ff0c@linaro.org commit 7711c35fd67c762d65fa802d06411e7bdbd3f748 Author: Caleb Connolly Date: Fri May 26 22:50:21 2023 +0100 arm64: dts: qcom: pmi8998: add charger node Add a node for the smb2 charger hardware found on the pmi8998 pmic following the DT bindings. Signed-off-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524-pmi8998-charger-dts-v2-2-2a5c77d2ff0c@linaro.org commit 4e6b053768020f2117caf27b5e062d1e0a06de0c Author: Caleb Connolly Date: Fri May 26 22:50:20 2023 +0100 arm64: dts: qcom: pmi8998: enable rradc by default There is no need for the RRADC to be disabled by default, lets just enable it by default and not clutter up DT. Acked-by: Konrad Dybcio Signed-off-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524-pmi8998-charger-dts-v2-1-2a5c77d2ff0c@linaro.org commit 004823da9b236e71589e2c06844e52327b9fae62 Merge: c2ef1ec97c1fb 35e237b3d5994 Author: Bjorn Andersson Date: Tue Jun 13 15:19:18 2023 -0700 Merge branch '20230526161129.1454-2-quic_anusha@quicinc.com' into clk-for-6.5 Merge the DeviceTree binding updates for IPQ9574 GCC adding clocks and resets related to Crypto Engine, through a topic branch in order to make them available in the DeviceTree source tree as well. commit ffadc79ed99f0f69e4cb74a4d158a18619ccd8ff Author: Anusha Rao Date: Fri May 26 21:41:29 2023 +0530 arm64: dts: qcom: ipq9574: Enable crypto nodes Enable crypto support for ipq9574. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Anusha Rao Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526161129.1454-5-quic_anusha@quicinc.com commit e5d57e7c9434f586ae59e68ba94db626387a5502 Merge: 21c9c7af1b37f 35e237b3d5994 Author: Bjorn Andersson Date: Tue Jun 13 15:17:30 2023 -0700 Merge branch '20230526161129.1454-2-quic_anusha@quicinc.com' into arm64-for-6.5 Merge IPQ9574 Crypto Engine-related DeviceTree bindings, to gain the additional clock defines needed to add the related nodes. commit 35e237b3d59941cff839de2d4089db60fac4679f Author: Anusha Rao Date: Fri May 26 21:41:26 2023 +0530 dt-bindings: clock: Add crypto clock and reset definitions Add crypto clock and reset ID definitions for ipq9574. Acked-by: Krzysztof Kozlowski Reviewed-by: Bhupesh Sharma Signed-off-by: Anusha Rao Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526161129.1454-2-quic_anusha@quicinc.com commit c03531e087b550d975bc1eb32f56f9da47aaa77e Merge: 25085b4e9251c 18b89265572b5 Author: Andrii Nakryiko Date: Tue Jun 13 15:14:27 2023 -0700 Merge branch 'verify scalar ids mapping in regsafe()' Eduard Zingerman says: ==================== Update regsafe() to use check_ids() for scalar values. Otherwise the following unsafe pattern is accepted by verifier: 1: r9 = ... some pointer with range X ... 2: r6 = ... unbound scalar ID=a ... 3: r7 = ... unbound scalar ID=b ... 4: if (r6 > r7) goto +1 5: r6 = r7 6: if (r6 > X) goto ... --- checkpoint --- 7: r9 += r7 8: *(u64 *)r9 = Y This example is unsafe because not all execution paths verify r7 range. Because of the jump at (4) the verifier would arrive at (6) in two states: I. r6{.id=b}, r7{.id=b} via path 1-6; II. r6{.id=a}, r7{.id=b} via path 1-4, 6. Currently regsafe() does not call check_ids() for scalar registers, thus from POV of regsafe() states (I) and (II) are identical. The change is split in two parts: - patches #1,2: update for mark_chain_precision() to propagate precision marks through scalar IDs. - patches #3,4: update for regsafe() to use a special version of check_ids() for precise scalar values. Changelog: - V5 -> V6: - check_ids() is modified to disallow mapping different 'old_id' to the same 'cur_id', check_scalar_ids() simplified (Andrii); - idset_push() updated to return -EFAULT instead of -1 (Andrii); - comments fixed in check_ids_in_regsafe() test case (Maxim Mikityanskiy); - fixed memset warning in states_equal() reported in [4]. - V4 -> V5 (all changes are based on feedback for V4 from Andrii): - mark_precise_scalar_ids() error code is updated to EFAULT; - bpf_verifier_env::idmap_scratch field type is changed to struct bpf_idmap to encapsulate temporary ID generation counter; - regsafe() is updated to call scalar_regs_exact() only for env->explore_alu_limits case (this had no measurable impact on verification duration when tested using veristat). - V3 -> V4: - check_ids() in regsafe() is replaced by check_scalar_ids(), as discussed with Andrii in [3], Note: I did not transfer Andrii's ack for patch #3 from V3 because of the changes to the algorithm. - reg_id_scratch is renamed to idset_scratch; - mark_precise_scalar_ids() is modified to propagate error from idset_push(); - test cases adjusted according to feedback from Andrii for V3. - V2 -> V3: - u32_hashset for IDs used for range transfer is removed; - mark_chain_precision() is updated as discussed with Andrii in [2]. - V1 -> v2: - 'rold->precise' and 'rold->id' checks are dropped as unsafe (thanks to discussion with Yonghong); - patches #3,4 adding tracking of ids used for range transfer in order to mitigate performance impact. - RFC -> V1: - Function verifier.c:mark_equal_scalars_as_read() is dropped, as it was an incorrect fix for problem solved by commit [3]. - check_ids() is called only for precise scalar values. - Test case updated to use inline assembly. [V1] https://lore.kernel.org/bpf/20230526184126.3104040-1-eddyz87@gmail.com/ [V2] https://lore.kernel.org/bpf/20230530172739.447290-1-eddyz87@gmail.com/ [V3] https://lore.kernel.org/bpf/20230606222411.1820404-1-eddyz87@gmail.com/ [V4] https://lore.kernel.org/bpf/20230609210143.2625430-1-eddyz87@gmail.com/ [V5] https://lore.kernel.org/bpf/20230612160801.2804666-1-eddyz87@gmail.com/ [RFC] https://lore.kernel.org/bpf/20221128163442.280187-1-eddyz87@gmail.com/ [1] https://gist.github.com/eddyz87/a32ea7e62a27d3c201117c9a39ab4286 [2] https://lore.kernel.org/bpf/20230530172739.447290-1-eddyz87@gmail.com/T/#mc21009dcd8574b195c1860a98014bb037f16f450 [3] https://lore.kernel.org/bpf/20230606222411.1820404-1-eddyz87@gmail.com/T/#m89da8eeb2fa8c9ca1202c5d0b6660e1f72e45e04 [4] https://lore.kernel.org/oe-kbuild-all/202306131550.U3M9AJGm-lkp@intel.com/ ==================== Signed-off-by: Andrii Nakryiko commit 18b89265572b5c899522b6c1f8698e87edfad369 Author: Eduard Zingerman Date: Tue Jun 13 18:38:24 2023 +0300 selftests/bpf: Verify that check_ids() is used for scalars in regsafe() Verify that the following example is rejected by verifier: r9 = ... some pointer with range X ... r6 = ... unbound scalar ID=a ... r7 = ... unbound scalar ID=b ... if (r6 > r7) goto +1 r7 = r6 if (r7 > X) goto exit r9 += r6 *(u64 *)r9 = Y Also add test cases to: - check that check_alu_op() for BPF_MOV instruction does not allocate scalar ID if source register is a constant; - check that unique scalar IDs are ignored when new verifier state is compared to cached verifier state; - check that two different scalar IDs in a verified state can't be mapped to the same scalar ID in current state. Signed-off-by: Eduard Zingerman Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230613153824.3324830-5-eddyz87@gmail.com commit 1ffc85d9298e0ca0137ba65c93a786143fe167b8 Author: Eduard Zingerman Date: Tue Jun 13 18:38:23 2023 +0300 bpf: Verify scalar ids mapping in regsafe() using check_ids() Make sure that the following unsafe example is rejected by verifier: 1: r9 = ... some pointer with range X ... 2: r6 = ... unbound scalar ID=a ... 3: r7 = ... unbound scalar ID=b ... 4: if (r6 > r7) goto +1 5: r6 = r7 6: if (r6 > X) goto ... --- checkpoint --- 7: r9 += r7 8: *(u64 *)r9 = Y This example is unsafe because not all execution paths verify r7 range. Because of the jump at (4) the verifier would arrive at (6) in two states: I. r6{.id=b}, r7{.id=b} via path 1-6; II. r6{.id=a}, r7{.id=b} via path 1-4, 6. Currently regsafe() does not call check_ids() for scalar registers, thus from POV of regsafe() states (I) and (II) are identical. If the path 1-6 is taken by verifier first, and checkpoint is created at (6) the path [1-4, 6] would be considered safe. Changes in this commit: - check_ids() is modified to disallow mapping multiple old_id to the same cur_id. - check_scalar_ids() is added, unlike check_ids() it treats ID zero as a unique scalar ID. - check_scalar_ids() needs to generate temporary unique IDs, field 'tmp_id_gen' is added to bpf_verifier_env::idmap_scratch to facilitate this. - regsafe() is updated to: - use check_scalar_ids() for precise scalar registers. - compare scalar registers using memcmp only for explore_alu_limits branch. This simplifies control flow for scalar case, and has no measurable performance impact. - check_alu_op() is updated to avoid generating bpf_reg_state::id for constant scalar values when processing BPF_MOV. ID is needed to propagate range information for identical values, but there is nothing to propagate for constants. Fixes: 75748837b7e5 ("bpf: Propagate scalar ranges through register assignments.") Signed-off-by: Eduard Zingerman Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230613153824.3324830-4-eddyz87@gmail.com commit dec020280373c60d6df48d1954e72dd6c5640282 Author: Eduard Zingerman Date: Tue Jun 13 18:38:22 2023 +0300 selftests/bpf: Check if mark_chain_precision() follows scalar ids Check __mark_chain_precision() log to verify that scalars with same IDs are marked as precise. Use several scenarios to test that precision marks are propagated through: - registers of scalar type with the same ID within one state; - registers of scalar type with the same ID cross several states; - registers of scalar type with the same ID cross several stack frames; - stack slot of scalar type with the same ID; - multiple scalar IDs are tracked independently. Signed-off-by: Eduard Zingerman Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230613153824.3324830-3-eddyz87@gmail.com commit 904e6ddf4133c52fdb9654c2cd2ad90f320d48b9 Author: Eduard Zingerman Date: Tue Jun 13 18:38:21 2023 +0300 bpf: Use scalar ids in mark_chain_precision() Change mark_chain_precision() to track precision in situations like below: r2 = unknown value ... --- state #0 --- ... r1 = r2 // r1 and r2 now share the same ID ... --- state #1 {r1.id = A, r2.id = A} --- ... if (r2 > 10) goto exit; // find_equal_scalars() assigns range to r1 ... --- state #2 {r1.id = A, r2.id = A} --- r3 = r10 r3 += r1 // need to mark both r1 and r2 At the beginning of the processing of each state, ensure that if a register with a scalar ID is marked as precise, all registers sharing this ID are also marked as precise. This property would be used by a follow-up change in regsafe(). Signed-off-by: Eduard Zingerman Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230613153824.3324830-2-eddyz87@gmail.com commit f8b20a405428803bd9881881d8242c9d72c6b2b2 Author: Li Nan Date: Mon May 22 15:25:34 2023 +0800 md/raid10: fix wrong setting of max_corr_read_errors There is no input check when echo md/max_read_errors and overflow might occur. Add check of input number. Fixes: 1e50915fe0bb ("raid: improve MD/raid10 handling of correctable read errors.") Signed-off-by: Li Nan Reviewed-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230522072535.1523740-3-linan666@huaweicloud.com commit 6beb489b2eed25978523f379a605073f99240c50 Author: Li Nan Date: Mon May 22 15:25:33 2023 +0800 md/raid10: fix overflow of md/safe_mode_delay There is no input check when echo md/safe_mode_delay in safe_delay_store(). And msec might also overflow when HZ < 1000 in safe_delay_show(), Fix it by checking overflow in safe_delay_store() and use unsigned long conversion in safe_delay_show(). Fixes: 72e02075a33f ("md: factor out parsing of fixed-point numbers") Signed-off-by: Li Nan Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230522072535.1523740-2-linan666@huaweicloud.com commit 868bba54a3bcbfc34314e963d5a7e66717f39d4e Author: Yu Kuai Date: Fri May 12 09:56:10 2023 +0800 md/raid5: fix a deadlock in the case that reshape is interrupted If reshape is in progress and io across reshape_position is issued, such io will wait for reshape to make progress(see details in the case that make_stripe_request() return STRIPE_SCHEDULE_AND_RETRY). It has been reported several times that if system reboot while growing raid5 to raid6, array assemble will hang infinitely([1, 2]). This is because following deadlock is triggered: 1) a normal io is waiting for reshape to progress, this io can be from system-udevd or mdadm. 2) while assemble, mdadm tries to suspend the array, hence 'reconfig_mutex' is held and mddev_suspend() must wait for normal io to be done. 3) daemon thread can't start reshape because 'reconfig_mutex' can't be held. 1) and 3) is unbreakable because they're foundation design. In order to break 2), following is possible solutions that I can think of: a) Let mddev_suspend() fail is not a good option, because this will break many scenarios since mddev_suspend() doesn't fail before. b) Fail the io that is waiting for reshape to make progress from mddev_suspend(). c) Return false for the io that is waiting for reshape to make progress from raid5_make_request(), and these io will wait for suspend to be done in md_handle_request(), where 'active_io' is not grabbed. c) sounds better than b), however, b) is used because it's easy and straightforward, and it's verified that mdadm can assemble in this case. On the other hand, c) breaks the logic that mddev_suspend() will wait for submitted io to be completely handled. Fix the problem by checking reshape in mddev_suspend(), if reshape can't make progress and there are still some io waiting for reshape, fail those io. [1] https://lore.kernel.org/all/CAFig2csUV2QiomUhj_t3dPOgV300dbQ6XtM9ygKPdXJFSH__Nw@mail.gmail.com/ [2] https://lore.kernel.org/all/CAO2ABipzbw6QL5eNa44CQHjiVa-LTvS696Mh9QaTw+qsUKFUCw@mail.gmail.com/ Reported-by: Jove Reported-by: David Gilmour Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230512015610.821290-6-yukuai1@huaweicloud.com commit 3e00777d51572bdd75cef29c9c31106b52d7cc8f Author: Yu Kuai Date: Fri May 12 09:56:09 2023 +0800 md: add a new api prepare_suspend() in md_personality There are no functional changes, the new api will be used later to do special handling for raid456 in md_suspend(). Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230512015610.821290-5-yukuai1@huaweicloud.com commit 431e61257d631157e1d374f1368febf37aa59f7c Author: Yu Kuai Date: Fri May 12 09:56:08 2023 +0800 md: export md_is_rdwr() and is_md_suspended() The two apis will be used later to fix a deadlock in raid456, there are no functional changes. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230512015610.821290-4-yukuai1@huaweicloud.com commit 873f50ece41aad5c4f788a340960c53774b5526e Author: Yu Kuai Date: Fri May 12 09:56:07 2023 +0800 md: fix data corruption for raid456 when reshape restart while grow up Currently, if reshape is interrupted, echo "reshape" to sync_action will restart reshape from scratch, for example: echo frozen > sync_action echo reshape > sync_action This will corrupt data before reshape_position if the array is growing, fix the problem by continue reshape from reshape_position. Reported-by: Peter Neuwirth Link: https://lore.kernel.org/linux-raid/e2f96772-bfbc-f43b-6da1-f520e5164536@online.de/ Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230512015610.821290-3-yukuai1@huaweicloud.com commit 46038b30b308c3ebf49e79548f109d00a8d74b31 Author: Yu Kuai Date: Fri May 12 09:56:06 2023 +0800 md/raid5: don't allow replacement while reshape is in progress If reshape is interrupted(for example, echo frozen to sync_action), then rdev replacement can be set. It's safe because reshape is always prior to resync in md_check_recovery(). However, if system reboots, then kernel will complain cannot handle concurrent replacement and reshape and this array is not able to assemble anymore. Fix this problem by don't allow replacement until reshape is done. Reported-by: Peter Neuwirth Link: https://lore.kernel.org/linux-raid/e2f96772-bfbc-f43b-6da1-f520e5164536@online.de/ Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230512015610.821290-2-yukuai1@huaweicloud.com commit 301867b1c16805aebbc306aafa6ecdc68b73c7e5 Author: Li Nan Date: Mon May 15 21:48:05 2023 +0800 md/raid10: check slab-out-of-bounds in md_bitmap_get_counter If we write a large number to md/bitmap_set_bits, md_bitmap_checkpage() will return -EINVAL because 'page >= bitmap->pages', but the return value was not checked immediately in md_bitmap_get_counter() in order to set *blocks value and slab-out-of-bounds occurs. Move check of 'page >= bitmap->pages' to md_bitmap_get_counter() and return directly if true. Fixes: ef4256733506 ("md/bitmap: optimise scanning of empty bitmaps.") Signed-off-by: Li Nan Reviewed-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230515134808.3936750-2-linan666@huaweicloud.com commit 3de13550a20fd570441c0f854abe58c6cc46c0bc Author: Arnd Bergmann Date: Wed May 17 15:22:12 2023 +0200 raid6: neon: add missing prototypes The raid6 syndrome functions are generated for different sizes and have no generic prototype, while in the inner functions have a prototype in a header that cannot be included from the correct file. In both cases, the compiler warns about missing prototypes: lib/raid6/recov_neon_inner.c:27:6: warning: no previous prototype for '__raid6_2data_recov_neon' [-Wmissing-prototypes] lib/raid6/recov_neon_inner.c:77:6: warning: no previous prototype for '__raid6_datap_recov_neon' [-Wmissing-prototypes] lib/raid6/neon1.c:56:6: warning: no previous prototype for 'raid6_neon1_gen_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon1.c:86:6: warning: no previous prototype for 'raid6_neon1_xor_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon2.c:56:6: warning: no previous prototype for 'raid6_neon2_gen_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon2.c:97:6: warning: no previous prototype for 'raid6_neon2_xor_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon4.c:56:6: warning: no previous prototype for 'raid6_neon4_gen_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon4.c:119:6: warning: no previous prototype for 'raid6_neon4_xor_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon8.c:56:6: warning: no previous prototype for 'raid6_neon8_gen_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon8.c:163:6: warning: no previous prototype for 'raid6_neon8_xor_syndrome_real' [-Wmissing-prototypes] Add a new header file that contains the prototypes for both to avoid the warnings. Signed-off-by: Arnd Bergmann Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230517132220.937200-1-arnd@kernel.org commit 21c9c7af1b37f3b38960f6abaf1b0b43f9db2467 Author: Komal Bajaj Date: Mon May 22 20:42:06 2023 +0530 arm64: dts: qcom: qdu1000: Add IMEM and PIL info region Add a simple-mfd representing IMEM on QDU1000 and define the PIL relocation info region, so that post mortem tools will be able to locate the loaded remoteprocs. Signed-off-by: Komal Bajaj Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230522151206.22654-3-quic_kbajaj@quicinc.com commit 8d66f7a07bc1412c7ffd9aa45602eb6e527dd87e Author: Komal Bajaj Date: Mon May 22 20:42:05 2023 +0530 dt-bindings: sram: qcom,imem: document qdu1000 Add compatible for QDU1000 and QRU1000 SoCs IMEM. Signed-off-by: Komal Bajaj Acked-by: Conor Dooley Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230522151206.22654-2-quic_kbajaj@quicinc.com commit ebdcfc8c42c2b9d5ca1b27d8ee558eefb3e904d8 Author: Artur Weber Date: Fri May 19 20:07:28 2023 +0200 arm64: dts: adapt to LP855X bindings changes Change underscores in ROM node names to dashes, and remove deprecated pwm-period property. Signed-off-by: Artur Weber Reviewed-by: Daniel Thompson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230519180728.2281-5-aweber.kernel@gmail.com commit 0196b041aeec788e1bc516b6d24d9c59ea59b1a6 Author: Kathiravan T Date: Fri May 19 19:08:44 2023 +0530 arm64: dts: qcom: ipq5332: add few more reserved memory region In IPQ SoCs, bootloader will collect the system RAM contents upon crash for the post morterm analysis. If we don't reserve the memory region used by bootloader, obviously linux will consume it and upon next boot on crash, bootloader will be loaded in the same region, which will lead to loose some of the data, sometimes we may miss out critical information. So lets reserve the region used by the bootloader. Similarly SBL copies some data into the reserved region and it will be used in the crash scenario. So reserve 1MB for SBL as well. While at it, drop the size padding in the smem memory region. Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230519133844.23512-4-quic_kathirav@quicinc.com commit 66d141a15c19f89e7e259e57a007550a253e03d2 Author: Kathiravan T Date: Fri May 19 19:08:43 2023 +0530 arm64: dts: qcom: ipq5332: define UART1 Add the definition for the UART1 found on IPQ5332 SoC. Reviewed-by: Bhupesh Sharma Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230519133844.23512-3-quic_kathirav@quicinc.com commit b59cd2902c58969230a8aca67a10ac3fbde0af15 Author: Kathiravan T Date: Fri May 19 19:08:42 2023 +0530 arm64: dts: qcom: ipq5332: rename mi01.2 dts to rdp441 To align with ipq5332-rdp468.dts, lets rename the mi01.2 dts as well to ipq5332-rdp441.dts. Reviewed-by: Konrad Dybcio Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230519133844.23512-2-quic_kathirav@quicinc.com commit c4ef464b24c5aefb7e23eb8fcc08250a783a529b Author: Luca Weiss Date: Fri May 12 15:58:26 2023 +0200 arm64: dts: qcom: sm7225-fairphone-fp4: Add Bluetooth The device has a WCN3988 chip for WiFi and Bluetooth. Configure the Bluetooth node and enable the UART it is connected to, plus the necessary pinctrl that has been borrowed with comments from sc7280-idp.dtsi. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230421-fp4-bluetooth-v2-4-3de840d5483e@fairphone.com commit b179f35b887b2d17e93f1827550290669bc6b110 Author: Luca Weiss Date: Fri May 12 15:58:25 2023 +0200 arm64: dts: qcom: sm6350: add uart1 node Add the node describing uart1 incl. opp table and pinctrl. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230421-fp4-bluetooth-v2-3-3de840d5483e@fairphone.com commit 1c8267cd14ed6a592a2c2a8eb0fefad4eabe5b4f Author: Konrad Dybcio Date: Wed May 31 18:33:03 2023 +0200 soc: qcom: icc-bwmon: Fix MSM8998 count unit MSM8998's BWMON counts in megabytes. Fix it. Signed-off-by: Konrad Dybcio Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531-topic-msm8998-bwmon-v1-1-454f9d550ee5@linaro.org commit 4b2c7ac8e469ab7f92e50c34ad4012a77e79d078 Author: Konrad Dybcio Date: Wed May 31 15:22:42 2023 +0200 arm64: dts: qcom: sm8550: Flush RSC sleep & wake votes The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: ffc50b2d3828 ("arm64: dts: qcom: Add base SM8550 dtsi") Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531-topic-rsc-v1-8-b4a985f57b8b@linaro.org commit 255c53df8ec3ea9f00765eb3dac02ccb705704dd Author: Konrad Dybcio Date: Wed May 31 15:22:41 2023 +0200 arm64: dts: qcom: sm6350: Flush RSC sleep & wake votes The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: 5f82b9cda61e ("arm64: dts: qcom: Add SM6350 device tree") Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531-topic-rsc-v1-7-b4a985f57b8b@linaro.org commit 91e83140b5dd5598fbcfada3ee1f8b2b410c3731 Author: Konrad Dybcio Date: Wed May 31 15:22:40 2023 +0200 arm64: dts: qcom: sdm845: Flush RSC sleep & wake votes The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: c83545d95376 ("arm64: dts: sdm845: Add rpmh-rsc node") Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531-topic-rsc-v1-6-b4a985f57b8b@linaro.org commit 7b04cbd81b0e60c5151a310e7b730dc4a951a211 Author: Konrad Dybcio Date: Wed May 31 15:22:39 2023 +0200 arm64: dts: qcom: sdm670: Flush RSC sleep & wake votes The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees") Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531-topic-rsc-v1-5-b4a985f57b8b@linaro.org commit 442d55d099ed72d96aee996e56f802b5cf885f39 Author: Konrad Dybcio Date: Wed May 31 15:22:38 2023 +0200 arm64: dts: qcom: sc8180x: Flush RSC sleep & wake votes The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: 8575f197b077 ("arm64: dts: qcom: Introduce the SC8180x platform") Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531-topic-rsc-v1-4-b4a985f57b8b@linaro.org commit ab033e7846f91953244d0626b28ce66412b813b3 Author: Konrad Dybcio Date: Wed May 31 15:22:37 2023 +0200 arm64: dts: qcom: qdu1000: Flush RSC sleep & wake votes The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event. Without this, only AMC votes are being commited. Fixes: 6bd20c54b589 ("arm64: dts: qcom: Add base QDU1000/QRU1000 DTSIs") Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531-topic-rsc-v1-3-b4a985f57b8b@linaro.org commit ade89bc08c8e7f52ee8a70d0c6ea55c2defdf1d3 Author: Konrad Dybcio Date: Wed May 31 15:22:36 2023 +0200 arm64: dts: qcom: sm6350: Add PSCI idle states Add the PSCI idle states so that the CPU (among other things) can reach lower power states. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531-topic-rsc-v1-2-b4a985f57b8b@linaro.org commit 66171d3fa08eca4e10384eee385cbdaaea6bb43e Author: Konrad Dybcio Date: Wed May 31 15:22:35 2023 +0200 dt-bindings: soc: qcom,rpmh-rsc: Require power-domains The Linux RPMh implementation refrains from sending some RPMh votes until the system is about to enter suspend (which is indicated by all CPU cores entering a low-power state). Lack of the power-domains property will make it such that these votes are never sent. Require the power-domains property as discussed in [1]. [1] https://lore.kernel.org/linux-arm-msm/20230512150425.3171122-1-quic_bjorande@quicinc.com/ Signed-off-by: Konrad Dybcio Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230531-topic-rsc-v1-1-b4a985f57b8b@linaro.org commit 6a22e017f952ecaf4bb510cd0939259470a27b06 Author: Azeem Shaikh Date: Tue May 30 16:23:58 2023 +0000 nios2: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Reviewed-by: Kees Cook Signed-off-by: Azeem Shaikh Signed-off-by: Dinh Nguyen commit 6ebe94baa2b9ddf3ccbb7f94df6ab26234532734 Author: Vishal Moola (Oracle) Date: Mon Jun 12 14:04:16 2023 -0700 nios2: Convert __pte_free_tlb() to use ptdescs Part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents. Signed-off-by: Vishal Moola (Oracle) Signed-off-by: Dinh Nguyen commit f684391e3d323bbdc832569dc685d1289c58d081 Author: Anusha Rao Date: Fri Jun 2 14:14:31 2023 +0530 arm64: dts: qcom: ipq9574: add few more reserved memory region In IPQ SoCs, bootloader will collect the system RAM contents upon crash for post-morterm analysis. If we don't reserve the memory region used by bootloader, obviously linux will consume it and upon next boot on crash, bootloader will be loaded in the same region, which will lead to loss of some data, sometimes we may miss out critical information. So lets reserve the region used by the bootloader. Similarly SBL copies some data into the reserved region and it will be used in the crash scenario. So reserve 1MB for SBL as well. While at it, drop the size padding in the reserved memory region, wherever applicable Signed-off-by: Anusha Rao Reviewed-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230602084431.19134-1-quic_anusha@quicinc.com commit 5ed19528db8ddcf0113d721f67a381be3e30c65a Author: Yu Zhang Date: Thu Jun 1 16:03:38 2023 +0800 KVM: selftests: Add new CFLAGS to generate dependency files Add "-MD" in CFLAGS to generate dependency files. Currently, each time a header file is updated in KVM selftest, we will have to run "make clean && make" to rebuild the whole test suite. By adding new compiling flags and dependent rules in Makefile, we do not need to make clean && make each time a header file is updated. Signed-off-by: Yu Zhang Link: https://lore.kernel.org/r/20230601080338.212942-1-yu.c.zhang@linux.intel.com Signed-off-by: Sean Christopherson commit cc77b95acf3c7d9a24204b0555fed2014f300fd5 Author: Wei Wang Date: Tue Feb 7 20:37:13 2023 +0800 kvm/eventfd: use list_for_each_entry when deassign ioeventfd Simpify kvm_deassign_ioeventfd_idx to use list_for_each_entry as the loop just ends at the entry that's found and deleted. Note, coalesced_mmio_ops and ioeventfd_ops are the only instances of kvm_io_device_ops that implement a destructor, all other callers of kvm_io_bus_unregister_dev() are unaffected by this change. Suggested-by: Michal Luczaj Signed-off-by: Wei Wang Reviewed-by: Sean Christopherson Link: https://lore.kernel.org/r/20230207123713.3905-3-wei.w.wang@intel.com [sean: call out that only select users implement a destructor] Signed-off-by: Sean Christopherson commit 5aa5dbc254be19b7011cb1f9d3cb7e241d5fc986 Author: Kathiravan T Date: Mon Jun 5 13:35:31 2023 +0530 arm64: dts: qcom: ipq5332: add support for the RDP474 variant Add the initial device tree support for the Reference Design Platform(RDP) 474 based on IPQ5332 family of SoC. This patch carries the support for Console UART, eMMC, I2C and GPIO based buttons. Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230605080531.3879-5-quic_kathirav@quicinc.com commit f2f644d85c4495474bf7d598023f550f0669306a Author: Kathiravan T Date: Mon Jun 5 13:35:30 2023 +0530 dt-bindings: arm: qcom: document MI01.9 board based on IPQ5332 family Document the MI01.9 (Reference Design Platform 474) board based on IPQ5332 family of SoCs. Acked-by: Krzysztof Kozlowski Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230605080531.3879-4-quic_kathirav@quicinc.com commit f471f91a0d63539107004a8e826ff017ed4d2588 Author: Kathiravan T Date: Mon Jun 5 13:35:29 2023 +0530 soc: qcom: socinfo: Add Soc ID for IPQ5300 Add the SoC ID for IPQ5300, which belong to the family of IPQ5332 SoC. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230605080531.3879-3-quic_kathirav@quicinc.com commit b56715957bc820ee4b01adfd6fa63fea63cd212a Author: Kathiravan T Date: Mon Jun 5 13:35:28 2023 +0530 dt-bindings: arm: qcom,ids: add SoC ID for IPQ5300 Add the SoC ID for IPQ5300, which belong to the family of IPQ5332 SoC. Acked-by: Krzysztof Kozlowski Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230605080531.3879-2-quic_kathirav@quicinc.com commit 5ea5ca3c2b4bf4090232e18cfc515dcb52f914a6 Author: Wei Wang Date: Tue Feb 7 20:37:12 2023 +0800 KVM: destruct kvm_io_device while unregistering it from kvm_io_bus Current usage of kvm_io_device requires users to destruct it with an extra call of kvm_iodevice_destructor after the device gets unregistered from kvm_io_bus. This is not necessary and can cause errors if a user forgot to make the extra call. Simplify the usage by combining kvm_iodevice_destructor into kvm_io_bus_unregister_dev. This reduces LOCs a bit for users and can avoid the leakage of destructing the device explicitly. Signed-off-by: Wei Wang Reviewed-by: Sean Christopherson Link: https://lore.kernel.org/r/20230207123713.3905-2-wei.w.wang@intel.com Signed-off-by: Sean Christopherson commit 6127383217741615f3450b684ecbee1ff570ee98 Author: Daniel Bristot de Oliveira Date: Tue Jun 6 18:12:25 2023 +0200 Documentation: Add tools/rtla timerlat -u option documentation Add the -u/--user-thread option documentation for timerlat top/hist. Link: https://lkml.kernel.org/r/bf727c8ccb8f50792200ae620141e047edf4af7a.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit ed774f7481fa0bcf9978556ae828aa1de9f22e20 Author: Daniel Bristot de Oliveira Date: Tue Jun 6 18:12:24 2023 +0200 rtla/timerlat_hist: Add timerlat user-space support Add the support for running timerlat threads in user-space. In this mode, enabled with -u/--user-threads, timerlat dispatches user-space processes that will loop in the timerlat_fd, measuring the overhead for going to user-space and then returning to the kernel - in addition to the existing measurements. Here is one example of the tool's output with -u enabled: $ sudo timerlat hist -u -c 1-3 -d 600 # RTLA timerlat histogram # Time unit is microseconds (us) # Duration: 0 00:10:01 Index IRQ-001 Thr-001 Usr-001 IRQ-002 Thr-002 Usr-002 IRQ-003 Thr-003 Usr-003 0 477555 0 0 425287 0 0 474357 0 0 1 122385 7998 0 174616 1921 0 125412 3138 0 2 47 587376 492150 89 594717 447830 147 593463 454872 3 11 2549 101930 7 2682 145580 64 2530 138680 4 3 1954 2833 1 463 4917 11 548 4656 5 0 60 1037 0 138 1117 6 179 1130 6 0 26 1837 0 38 277 1 76 339 7 0 15 143 0 28 147 2 37 156 8 0 10 23 0 11 75 0 12 80 9 0 7 17 0 0 26 0 11 42 10 0 2 11 0 0 18 0 2 20 11 0 0 7 0 1 8 0 2 12 12 0 0 6 0 1 4 0 2 8 13 0 1 3 0 0 0 0 0 1 14 0 1 0 0 0 1 0 0 2 15 0 1 0 0 0 0 0 0 2 16 0 1 2 0 0 0 0 0 0 17 0 0 1 0 0 0 0 0 0 19 0 0 1 0 0 0 0 0 0 over: 0 0 0 0 0 0 0 0 0 count: 600001 600001 600001 600000 600000 600000 600000 600000 600000 min: 0 1 2 0 1 2 0 1 2 avg: 0 1 2 0 2 2 0 2 2 max: 4 16 19 4 12 14 7 12 15 The tuning setup like -p or -C work for the user-space threads as well. Link: https://lkml.kernel.org/r/b6a042d55003c4a67ff7dce28d96044b7044f00d.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit cdca4f4e5e8ea1c21417d86a0b2ed6af282cbb6e Author: Daniel Bristot de Oliveira Date: Tue Jun 6 18:12:23 2023 +0200 rtla/timerlat_top: Add timerlat user-space support Add the support for running timerlat threads in user-space. In this mode, enabled with -u/--user-threads, timerlat dispatches user-space processes that will loop in the timerlat_fd, measuring the overhead for going to user-space and then returning to the kernel - in addition to the existing measurements. Here is one example of the tool's output with -u enabled: $ sudo timerlat top -u -d 600 -q Timer Latency 0 00:10:01 | IRQ Timer Latency (us) | Thread Timer Latency (us) | Ret user Timer Latency (us) CPU COUNT | cur min avg max | cur min avg max | cur min avg max 0 #600001 | 0 0 0 3 | 2 1 2 9 | 3 2 3 15 1 #600001 | 0 0 0 2 | 2 1 2 13 | 2 2 3 18 2 #600001 | 0 0 0 10 | 2 1 2 16 | 3 2 3 20 3 #600001 | 0 0 0 7 | 2 1 2 10 | 3 2 3 11 4 #600000 | 0 0 0 16 | 2 1 2 41 | 3 2 3 58 5 #600000 | 0 0 0 3 | 2 1 2 10 | 3 2 3 13 6 #600000 | 0 0 0 5 | 2 1 2 7 | 3 2 3 10 7 #600000 | 0 0 0 1 | 2 1 2 7 | 3 2 3 10 The tuning setup like -p or -C work for the user-space threads as well. Link: https://lkml.kernel.org/r/758ad2292a0a1d884138d08219e1a0f572d257a2.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 7bc4d3089a50050d4df0af63423a5d907c3bdb1a Author: Daniel Bristot de Oliveira Date: Tue Jun 6 18:12:22 2023 +0200 rtla/hwnoise: Reduce runtime to 75% osnoise runs 100% of time by default. It makes sense because osnoise is preemptive. hwnoise checks preemption once a second, so it reduces system progress. Reduce runtime to 75% to avoid problems by default. I added a Fixes as it might avoid problems for first time users as it lands on distros. Link: https://lkml.kernel.org/r/af0b7113ffc00031b9af4bb40ef5889a27dadf8c.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Fixes: 1f428356c38d ("rtla: Add hwnoise tool") Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 57cf76ec64573ee1eb75b91d665dba18b21ece6e Author: Daniel Bristot de Oliveira Date: Tue Jun 6 18:12:21 2023 +0200 rtla: Start the tracers after creating all instances Group all start tracing after finishing creating all instances. The tracing instance starts first for the case of hitting a stop tracing while enabling other instances. The trace instance is the one with most valuable information. Link: https://lkml.kernel.org/r/67da7a703a56f75d7cd46568525145a65501a7e8.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 2091336b9a8b5a2a59cdd5c468df62a4b562875f Author: Daniel Bristot de Oliveira Date: Tue Jun 6 18:12:20 2023 +0200 rtla/timerlat_hist: Add auto-analysis support Add auto-analysis to timerlat hist, including the --no-aa option to reduce overhead and --dump-task. --aa-only was not added as it is already on timerlat top. Link: https://lkml.kernel.org/r/c2693f47ee83e659a7723fed8035f5d2534f528e.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit c66552be9ec9f83705a911cb2219cffc39c42a0c Author: Daniel Bristot de Oliveira Date: Tue Jun 6 18:12:19 2023 +0200 rtla/timerlat: Give timerlat auto analysis its own instance Currently, the auto-analysis is attached to the timerlat top instance. The idea was to avoid creating another instance just for that, so one instance could be reused. The drawback is that, by doing so, the auto-analysis run for the entire session, consuming CPU time. On my 24 box CPUs for timerlat with a 100 us period consumed 50 % with auto analysis, but only 16 % without. By creating an instance for auto-analysis, we can keep the processing stopped until a stop tracing condition is hit. Once it happens, timerlat auto-analysis can use its own trace instance to parse only the end of the trace. By doing so, auto-analysis stop consuming cpu time when it is not needed. If the --aa-only is passed, the timerlat top instance is reused for auto analysis. Link: https://lkml.kernel.org/r/346b7168c1bae552a415715ec6d23c129a43bdb7.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit c58a3f8c7f974d171d1b6897a71a078a3bc7afd3 Author: Daniel Bristot de Oliveira Date: Tue Jun 6 18:12:18 2023 +0200 rtla: Automatically move rtla to a house-keeping cpu When the user sets -c try to move rtla out of the , even without an -H option. This is useful to avoid having rtla interfering with the workload. This works by removing from rtla's current affinity. If rtla fails to move itself away it is not that of a problem as this is an automatic measure. Link: https://lkml.kernel.org/r/c54304d90c777310fb85a3e658d1449173759aab.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 894c29c76b2b4c2cfbe1482dab42e4f03b49cf18 Author: Daniel Bristot de Oliveira Date: Tue Jun 6 18:12:17 2023 +0200 rtla: Change monitored_cpus from char * to cpu_set_t Use a cpumask instead of a char *, reducing memory footprint and code. No functional change, and in preparation for auto house-keeping. Link: https://lkml.kernel.org/r/54c46293261d13cb1042d0314486539eeb45fe5d.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 272ced2556e63943113a54c113f8c11aeb53a5c3 Author: Daniel Bristot de Oliveira Date: Tue Jun 6 18:12:16 2023 +0200 rtla: Add --house-keeping option To avoid having rtla interfering with the measurement threads, add an option for the user to set the CPUs in which rtla should run. For instance: # rtla timerlat top -H 0 -c 1-7 Will place rtla in the CPU 0, while running the measurement threads in the CPU 1-7. Link: https://lkml.kernel.org/r/6a6c78a579a96ba8b02ae67ee1e0ba2cb5e03c4a.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Suggested-by: Juri Lelli Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit a957cbc02531a23beeac6dd9e751f8d4dadaf7a9 Author: Daniel Bristot de Oliveira Date: Tue Jun 6 18:12:15 2023 +0200 rtla: Add -C cgroup support The -C option sets a cgroup to the tracer's threads. If the -C option is passed without arguments, the tracer's thread will inherit rtla's cgroup. Otherwise, the threads will be placed on the cgroup passed to the option. Link: https://lkml.kernel.org/r/cb051477331d292f17c08bf1d66f0e0384bbe5a5.1686066600.git.bristot@kernel.org Cc: William White Cc: Jonathan Corbet Tested-by: Juri Lelli Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 87a1752bdd8a76132922c9b2797afb36a8e628dd Author: Tim Jiang Date: Tue May 30 16:29:22 2023 +0800 dt-bindings: net: Add QCA2066 Bluetooth Add bindings for the QCA2066 chipset. Signed-off-by: Tim Jiang Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230530082922.2208-1-quic_tjiang@quicinc.com Signed-off-by: Rob Herring commit 3e253b21693d08126c828cddcb4fd3949898f773 Author: Stephen Boyd Date: Mon Jun 12 18:12:00 2023 -0700 ASoC: tlv320aic32x4: pll: Remove impossible condition in clk_aic32x4_pll_determine_rate() Smatch warns: sound/soc/codecs/tlv320aic32x4-clk.c:219 clk_aic32x4_pll_determine_rate() warn: unsigned 'rate' is never less than zero. Cc: Maxime Ripard Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306101217.08CRVGcK-lkp@intel.com/ Fixes: 25d43ec352ea ("ASoC: tlv320aic32x4: pll: Switch to determine_rate") Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20230613011201.1166753-1-sboyd@kernel.org Reviewed-by: Maxime Ripard commit be8fa5fd0a48fd2decc4de81ffe72bb3ceacecd9 Author: Marek Szyprowski Date: Tue Jun 13 15:16:31 2023 +0200 clk: Fix best_parent_rate after moving code into a separate function best_parent_rate entry is still being used in the code and needs to be always updated regardless of the CLK_SET_RATE_NO_REPARENT flag. Fixes: 1b4e99fda73f ("clk: Move no reparent case into a separate function") Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20230613131631.270192-1-m.szyprowski@samsung.com Acked-by: Maxime Ripard Signed-off-by: Stephen Boyd commit 3aed112953b1877ede66ae77afa4e5a5024be7cb Author: Dan Carpenter Date: Tue Jun 6 11:21:22 2023 +0300 soc: qcom: Fix a IS_ERR() vs NULL bug in probe The devm_ioremap() function returns NULL on error, it never returns error pointers. Fixes: a77b2a0b1280 ("soc: qcom: Introduce RPM master stats driver") Signed-off-by: Dan Carpenter Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/ZH7sgpLAN23bCz9v@moroto commit a9c476978834f2c44c5d04b0938f661fe2f40728 Merge: 6b5f9a87e12d0 be093a80dff09 Author: Jakub Kicinski Date: Tue Jun 13 11:46:47 2023 -0700 Merge branch 'tools-ynl-gen-improvements-for-dpll' Jakub Kicinski says: ==================== tools: ynl-gen: improvements for DPLL A set of improvements needed to generate the kernel code for DPLL. ==================== Link: https://lore.kernel.org/r/20230612155920.1787579-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit be093a80dff0982ba2d205f1ef302a3ace285fa3 Author: Jakub Kicinski Date: Mon Jun 12 08:59:20 2023 -0700 tools: ynl-gen: inherit policy in multi-attr Instead of reimplementing policies in MutliAttr for every underlying type forward the calls to the base type. This will be needed for DPLL which uses a multi-attr nest, and currently gets an invalid NLA_NEST policy generated. Reviewed-by: Jacob Keller Signed-off-by: Jakub Kicinski commit 10c4d2a7b88d65471a5e56bb8946b5bb59ff5cf7 Author: Jakub Kicinski Date: Mon Jun 12 08:59:19 2023 -0700 tools: ynl-gen: correct enum policies Scalar range validation assumes enums start at 0. Teach it to properly calculate the value range. Reviewed-by: Jacob Keller Signed-off-by: Jakub Kicinski commit d9c2a255cfe026c8bf85a39631734f022ecefaff Author: Naman Jain Date: Tue Jun 6 19:16:26 2023 +0530 soc: qcom: socinfo: Add support for new fields in revision 19 Add support for below fields coming in socinfo structure under v19: * num_func_clusters: number of clusters with at least one functional core * boot_cluster: cluster selected as boot cluster * boot_core: core selected as boot core While at it, rename some variables to align them with their functionalities. Signed-off-by: Naman Jain Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230606134626.18790-3-quic_namajain@quicinc.com commit 158826c73d48097f843bacc1bcafa6dbc114f4e5 Author: Naman Jain Date: Tue Jun 6 19:16:25 2023 +0530 soc: qcom: socinfo: Add support for new fields in revision 18 Add support for below fields coming in socinfo structure under v18: * num_kvps: number of key value pairs (KVP) * kvps_offset: the offset of the KVP table from the base address of socinfo structure in SMEM KVP table has boolean values for certain feature flags, used to determine hardware configuration. Signed-off-by: Naman Jain Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230606134626.18790-2-quic_namajain@quicinc.com commit 318da4837d75efb2411b86b39427b7047b41204a Author: Srinivas Kandagatla Date: Thu Jun 8 13:53:15 2023 +0100 arm64: defconfig: Enable sc828x0xp lpasscc clock controller Enabled sc828x0xp lpasscc clock controller driver required for X13s laptop. Signed-off-by: Srinivas Kandagatla Reviewed-by: Johan Hovold Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230608125315.11454-7-srinivas.kandagatla@linaro.org commit c2ef1ec97c1fb932d0cccaee71270f56898b9cd0 Author: Srinivas Kandagatla Date: Thu Jun 8 13:53:13 2023 +0100 clk: qcom: Add lpass audio clock controller driver for SC8280XP Add support for the lpass audio clock controller found on SC8280XP based devices. This would allow lpass peripheral loader drivers to control the clocks and bring the subsystems out of reset. Currently this patch only supports resets as the Q6DSP is in control of LPASS IP which manages most of the clocks via Q6PRM service on GPR rpmsg channel. Signed-off-by: Srinivas Kandagatla Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230608125315.11454-5-srinivas.kandagatla@linaro.org commit a5c9c3ba243ab9a7695b7125d06758f43952b58b Author: Srinivas Kandagatla Date: Thu Jun 8 13:53:12 2023 +0100 clk: qcom: Add lpass clock controller driver for SC8280XP Add support for the lpass clock controller found on SC8280XP based devices. This would allow lpass peripheral loader drivers to control the clocks and bring the subsystems out of reset. Currently this patch only supports resets as the Q6DSP is in control of LPASS IP which manages most of the clocks via Q6PRM service on GPR rpmsg channel. Signed-off-by: Srinivas Kandagatla Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230608125315.11454-4-srinivas.kandagatla@linaro.org commit 532bbadcb511e8477b83b4152a199bf7ffc4350c Author: Srinivas Kandagatla Date: Thu Jun 8 13:53:14 2023 +0100 arm64: dts: qcom: sc8280xp: add resets for soundwire controllers Soundwire controllers on sc8280xp needs an explicit reset, add support for this. Signed-off-by: Srinivas Kandagatla Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230608125315.11454-6-srinivas.kandagatla@linaro.org commit 0832b1c9d0145451ba82d0c163092787e87008f1 Merge: 3f01d016cf4b8 83da70da40c93 Author: Bjorn Andersson Date: Tue Jun 13 11:12:02 2023 -0700 Merge branch '20230608125315.11454-2-srinivas.kandagatla@linaro.org' into arm64-for-6.5 Merge the SC8280XP LPASSCC DeviceTree bindings in order to get access to the newly added reset defines. commit 83da70da40c93f3515aebcd5f2b8ff6283f64ee3 Author: Srinivas Kandagatla Date: Thu Jun 8 13:53:11 2023 +0100 dt-bindings: clock: Add LPASS AUDIOCC and reset controller for SC8280XP The LPASS (Low Power Audio Subsystem) Audio clock controller provides reset support when it is under the control of Q6DSP. Add support for those resets and adds IDs for clients to request the reset. Signed-off-by: Srinivas Kandagatla Reviewed-by: Johan Hovold Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230608125315.11454-3-srinivas.kandagatla@linaro.org commit bfc43a9c0ce5f3fcf98c972d7b7f21a742b7c957 Author: Srinivas Kandagatla Date: Thu Jun 8 13:53:10 2023 +0100 dt-bindings: clock: Add LPASSCC and reset controller for SC8280XP The LPASS (Low Power Audio Subsystem) clock controller provides reset support when it is under the control of Q6DSP. Add support for those resets and adds IDs for clients to request the reset. Signed-off-by: Srinivas Kandagatla Reviewed-by: Johan Hovold Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230608125315.11454-2-srinivas.kandagatla@linaro.org commit 3f01d016cf4b80382f1c1b8ab6bef7aa76dece01 Author: Krzysztof Kozlowski Date: Mon Jun 12 19:37:58 2023 +0200 arm64: dts: qcom: sm8550-mtp: add sound card Add the sound card node with tested playback over WSA8845 speakers and WCD9385 headset over USB Type-C. The recording links were not tested, but should be similar to previous platforms. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230612173758.286411-2-krzysztof.kozlowski@linaro.org commit 9f5ebcd61009de388af6f66509f2a1169f90dbbe Author: Krzysztof Kozlowski Date: Mon Jun 12 19:37:57 2023 +0200 arm64: dts: qcom: sm8550-qrd: add sound card Add the sound card node with tested playback over WSA8845 speakers and WCD9385 headset over USB Type-C. The recording links were not tested, but should be similar to previous platforms. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230612173758.286411-1-krzysztof.kozlowski@linaro.org commit edb92fae57e7b3292e92bc3fe7dfd0e21875befe Author: Krzysztof Kozlowski Date: Thu Jun 8 11:43:23 2023 +0200 arm64: dts: qcom: sm8550-mtp: add WSA8845 speakers Add Qualcomm WSA8845 Soundwire smart speaker amplifiers. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230608094323.267278-2-krzysztof.kozlowski@linaro.org commit a2422d51069d682a2172981fa6e7ba84b2dc93c8 Author: Krzysztof Kozlowski Date: Thu Jun 8 11:43:22 2023 +0200 arm64: dts: qcom: sm8550-qrd: add WSA8845 speakers Add Qualcomm WSA8845 Soundwire smart speaker amplifiers. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230608094323.267278-1-krzysztof.kozlowski@linaro.org commit 9181bb939984f1ad4f958c2be3ea10fd67344165 Author: Rohit Agarwal Date: Fri Jun 9 17:20:38 2023 +0530 arm64: dts: qcom: Add SDX75 platform and IDP board support Add basic devicetree support for SDX75 platform and IDP board from Qualcomm. The SDX75 platform features an ARM Cortex A55 CPU which forms the Application Processor Sub System (APSS) along with standard Qualcomm peripherals like GCC, TLMM, UART, QPIC, and BAM etc... Also, there exists the networking parts such as IPA, MHI, PCIE-EP, EMAC, and Modem etc.. Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1686311438-24177-6-git-send-email-quic_rohiagar@quicinc.com commit f9a97656ace80c617df2d6003c815877c026a9e3 Author: Rohit Agarwal Date: Fri Jun 9 17:20:34 2023 +0530 dt-bindings: arm: qcom: Document SDX75 platform and boards Document the SDX75 platform binding and also the boards using it. Signed-off-by: Rohit Agarwal Acked-by: Conor Dooley Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1686311438-24177-2-git-send-email-quic_rohiagar@quicinc.com commit 68017e6b1b36a87bf00f3ca31e742d53adfb74da Merge: bb47bfbd5aa89 1c305ea86bc32 Author: Bjorn Andersson Date: Tue Jun 13 11:04:23 2023 -0700 Merge branch '20230512122347.1219-3-quic_tdas@quicinc.com' into arm64-for-6.5 Merge the SDX75 GCC DeviceTree binding, in order to get access to the clock defines in the DeviceTree source. commit bb47bfbd5aa89368c348d9828484f7201cef6cea Author: Neil Armstrong Date: Mon Jun 12 17:22:52 2023 +0200 arm64: dts: qcom: sm8550-qrd: enable PMIC Volume and Power buttons The Volume Down & Power buttons are controlled by the PMIC via the PON hardware, and the Volume Up is connected to a PMIC gpio. Enable the necessary hardware and setup the GPIO state for the Volume Up gpio key. Reviewed-by: Konrad Dybcio Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230525-topic-sm8550-upstream-pm8550-lpg-dt-v4-4-a288f24af81b@linaro.org commit a791fc19965e52918bb70e2b764965083eaadbed Author: Neil Armstrong Date: Mon Jun 12 17:22:51 2023 +0200 arm64: dts: qcom: pmk8550: always enable RTC PMIC device There's no reason to keep the RTC disabled, it has been tested and is functional on the SM8550 QRD and MTP boards. Reviewed-by: Konrad Dybcio Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230525-topic-sm8550-upstream-pm8550-lpg-dt-v4-3-a288f24af81b@linaro.org commit 3818165476d70b13cf3193e1b5e60b1af6689772 Author: Neil Armstrong Date: Mon Jun 12 17:22:50 2023 +0200 arm64: dts: qcom: sm8550-qrd: add notification RGB LED The QRD features a notification LED connected to the pm8550. Configure the RGB led controlled by the PMIC PWM controller. Reviewed-by: Konrad Dybcio Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230525-topic-sm8550-upstream-pm8550-lpg-dt-v4-2-a288f24af81b@linaro.org commit 8889d13c2e758cff33fc85139c6d9288553e0e30 Author: Neil Armstrong Date: Mon Jun 12 17:22:49 2023 +0200 arm64: dts: qcom: pm8550: add PWM controller Add the PWM function to the pm8550 dtsi, this is usually used to drive RGB leds on platforms using this PMIC. Reviewed-by: Konrad Dybcio Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230525-topic-sm8550-upstream-pm8550-lpg-dt-v4-1-a288f24af81b@linaro.org commit 2d7b1a31ffb865d1f8e95e985cdbd0df72f671cf Author: Bjorn Andersson Date: Mon Jun 12 15:07:39 2023 -0700 arm64: dts: qcom: sc8180x: Move DisplayPort for MMCX The DisplayPort blocks are powered by MMCX and should be described as such to ensure that power votes are done on the right resource. This also solves the problem that sync_state is unaware of the DP controllers needing MMCX to be kept alive during boot. As such this change also fixes occasionally seen crashes during boot due to undervoltage of MMCX. Fixes: 494dec9b6f54 ("arm64: dts: qcom: sc8180x: Add display and gpu nodes") Signed-off-by: Bjorn Andersson Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230612220739.1886155-1-quic_bjorande@quicinc.com commit e537d5ef47097360d8df524c748f3df451383dcd Author: Bjorn Andersson Date: Mon Jun 12 15:05:32 2023 -0700 arm64: dts: qcom: sc8180x: Fix adreno smmu compatible The adreno smmu should be compatible with qcom,adreno-smmu as well for per-process page tables to work. Fixes: 8575f197b077 ("arm64: dts: qcom: Introduce the SC8180x platform") Signed-off-by: Bjorn Andersson Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230612220532.1884860-1-quic_bjorande@quicinc.com commit a277430b3836cdfb994f45cc87d1bd56c4d490aa Author: Bjorn Andersson Date: Mon Jun 12 15:04:20 2023 -0700 arm64: dts: qcom: sc8180x-primus: dispcc is already okay &dispcc status was changed to okay by default in the platform, no need to do it again in the board. Fixes: 2ce38cc1e8fe ("arm64: dts: qcom: sc8180x: Introduce Primus") Signed-off-by: Bjorn Andersson Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230612220420.1884631-1-quic_bjorande@quicinc.com commit 66adfbc4d33993865a180016db73520a15e754c9 Author: Neil Armstrong Date: Tue Jun 13 09:30:13 2023 +0200 arm64: dts: qcom: sm8550: add display port nodes Add the Display Port controller subnode to the MDSS node. Reviewed-by: Konrad Dybcio Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601-topic-sm8550-upstream-dp-v4-2-ac2c6899d22c@linaro.org commit bbde65f9da9291a77636e1467b28f27ced1b4ece Author: Neil Armstrong Date: Tue Jun 13 09:30:12 2023 +0200 arm64: dts: qcom: sm8550: fix low_svs RPMhPD labels "low" was written "lov", fix this. Fixes: 99d33ee61cb0 ("arm64: dts: qcom: sm8550: Add missing RPMhPD OPP levels") Reviewed-by: Konrad Dybcio Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230601-topic-sm8550-upstream-dp-v4-1-ac2c6899d22c@linaro.org commit f04325e4d4d66e63fc4e474ff54835a28b3ff29e Author: Andrew Halaney Date: Thu Jun 8 15:15:13 2023 -0500 arm64: dts: qcom: sa8540p-ride: Specify ethernet phy OUI With wider usage on more boards, there have been reports of the following: [ 315.016174] qcom-ethqos 20000.ethernet eth0: no phy at addr -1 [ 315.016179] qcom-ethqos 20000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19) which has been fairly random and isolated to specific boards. Early reports were written off as a hardware issue, but it has been prevalent enough on boards that theory seems unlikely. In bring up of a newer piece of hardware, similar was seen, but this time _consistently_. Moving the reset to the mdio bus level (which isn't exactly a lie, it is the only device on the bus so one could model it as such) fixed things on that platform. Analysis on sa8540p-ride shows that the phy's reset is not being handled during the OUI scan if the reset lives in the phy node: # gpio 752 is the reset, and is active low, first mdio reads are the OUI modprobe-420 [006] ..... 154.738544: mdio_access: stmmac-0 read phy:0x08 reg:0x02 val:0x0141 modprobe-420 [007] ..... 154.738665: mdio_access: stmmac-0 read phy:0x08 reg:0x03 val:0x0dd4 modprobe-420 [004] ..... 154.741357: gpio_value: 752 set 1 modprobe-420 [004] ..... 154.741358: gpio_direction: 752 out (0) modprobe-420 [004] ..... 154.741360: gpio_value: 752 set 0 modprobe-420 [006] ..... 154.762751: gpio_value: 752 set 1 modprobe-420 [007] ..... 154.846857: gpio_value: 752 set 1 modprobe-420 [004] ..... 154.937824: mdio_access: stmmac-0 write phy:0x08 reg:0x0d val:0x0003 modprobe-420 [004] ..... 154.937932: mdio_access: stmmac-0 write phy:0x08 reg:0x0e val:0x0014 Moving it to the bus level, or specifying the OUI in the phy's compatible ensures the reset is handled before any mdio access Here is tracing with the OUI approach (which skips scanning the OUI): modprobe-549 [007] ..... 63.860295: gpio_value: 752 set 1 modprobe-549 [007] ..... 63.860297: gpio_direction: 752 out (0) modprobe-549 [007] ..... 63.860299: gpio_value: 752 set 0 modprobe-549 [004] ..... 63.882599: gpio_value: 752 set 1 modprobe-549 [005] ..... 63.962132: gpio_value: 752 set 1 modprobe-549 [006] ..... 64.049379: mdio_access: stmmac-0 write phy:0x08 reg:0x0d val:0x0003 modprobe-549 [006] ..... 64.049490: mdio_access: stmmac-0 write phy:0x08 reg:0x0e val:0x0014 The OUI approach is taken given the description matches the situation perfectly (taken from ethernet-phy.yaml): - pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$" description: If the PHY reports an incorrect ID (or none at all) then the compatible list may contain an entry with the correct PHY ID in the above form. The first group of digits is the 16 bit Phy Identifier 1 register, this is the chip vendor OUI bits 3:18. The second group of digits is the Phy Identifier 2 register, this is the chip vendor OUI bits 19:24, followed by 10 bits of a vendor specific ID. With this in place the sa8540p-ride's phy is probing consistently, so it seems the floating reset during mdio access was the issue. In either case, it shouldn't be floating so this improves the situation. The below link discusses some of the relationship of mdio, its phys, and points to this OUI compatible as a way to opt out of the OUI scan pre-reset handling which influenced this decision. Link: https://lore.kernel.org/all/dca54c57-a3bd-1147-63b2-4631194963f0@gmail.com/ Fixes: 57827e87be54 ("arm64: dts: qcom: sa8540p-ride: Add ethernet nodes") Signed-off-by: Andrew Halaney Reviewed-by: Konrad Dybcio Reviewed-by: Brian Masney Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230608201513.882950-1-ahalaney@redhat.com commit 677b9e85e8691c0bddc35eebf6d01836e109e5f4 Author: Rohit Agarwal Date: Fri Jun 9 17:20:35 2023 +0530 dt-bindings: firmware: scm: Add compatible for SDX75 Add devicetree compatible for SCM present in SDX75 platform. Signed-off-by: Rohit Agarwal Acked-by: Conor Dooley Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1686311438-24177-3-git-send-email-quic_rohiagar@quicinc.com commit 0d25da8e7e1e35bdbb521d586be1954bdedd1cca Author: Bjorn Andersson Date: Mon Jun 12 14:58:04 2023 -0700 soc: qcom: mdt_loader: Fix split image detection The enhanced detection introduced in commit '210d12c8197a ("soc: qcom: mdt_loader: Enhance split binary detection")' requires that all segments lies within the file on disk. But the Qualcomm firmware files consistently has a BSS-like segment at the end, with a p_offset aligned to the next 4k boundary. As the p_size is 0 and there's nothing to load, the image is not padded to cover this (empty) segment. Ignore zero-sized segments when determining if the image is split, to avoid this problem. Fixes: 210d12c8197a ("soc: qcom: mdt_loader: Enhance split binary detection") Signed-off-by: Bjorn Andersson Reviewed-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov # qrb5165-rb5 Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230612215804.1883458-1-quic_bjorande@quicinc.com commit 3f502e372b4d41db1642c0a1285b2cb52ab5f796 Author: Luca Weiss Date: Tue May 9 23:16:37 2023 +0200 ARM: dts: qcom: msm8226: Provide clocks to mmcc node The mmcc needs several clocks that are being used as parents. Provide them in dt. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230509-msm8226-mmcc-parents-v1-3-83a2dfc986ab@z3ntu.xyz commit e280427384269fba93c7ec0373afe87bc39d7945 Author: Luca Weiss Date: Tue May 9 23:16:35 2023 +0200 ARM: dts: qcom: msm8226: Use XO from rpmcc where possible The xo clock being used everywhere actually goes via the RPM. Since the rpmcc driver recently got support for this clock we can use this now. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230509-msm8226-mmcc-parents-v1-1-83a2dfc986ab@z3ntu.xyz commit 5683f11aa194f1dfa7e7c63426379ac6c7bc84be Author: Luca Weiss Date: Tue May 9 23:16:36 2023 +0200 dt-bindings: clock: qcom,mmcc: define clocks/clock-names for MSM8226 Define clock/clock-names properties of the MMCC device node to be used on MSM8226 platform. Signed-off-by: Luca Weiss Acked-by: Jeffrey Hugo Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230509-msm8226-mmcc-parents-v1-2-83a2dfc986ab@z3ntu.xyz commit a11e6515b019da62266b731ff20bc6863f00df4d Merge: e8181a895b05b 099770e2dae04 Author: Mark Brown Date: Tue Jun 13 17:39:51 2023 +0100 ASoC: add new trigger ordering method Merge series from Kuninori Morimoto : This patch-set adds new "trigger" starting/stopping method. commit 106ed2cad9f7bd803bd31a18fe7a9219b077bf95 Author: Sean Christopherson Date: Tue Jun 6 17:44:49 2023 -0700 KVM: SVM: WARN, but continue, if misc_cg_set_capacity() fails WARN and continue if misc_cg_set_capacity() fails, as the only scenario in which it can fail is if the specified resource is invalid, which should never happen when CONFIG_KVM_AMD_SEV=y. Deliberately not bailing "fixes" a theoretical bug where KVM would leak the ASID bitmaps on failure, which again can't happen. If the impossible should happen, the end result is effectively the same with respect to SEV and SEV-ES (they are unusable), while continuing on has the advantage of letting KVM load, i.e. userspace can still run non-SEV guests. Reported-by: Alexander Mikhalitsyn Link: https://lore.kernel.org/r/20230607004449.1421131-1-seanjc@google.com Signed-off-by: Sean Christopherson commit e8181a895b05b264883288c4043ff83f893b56b0 Merge: 1012bfdd2f1f5 0281b02e1913a Author: Mark Brown Date: Tue Jun 13 17:16:51 2023 +0100 ASoC: add N cpus to M codecs dai link support Merge series from Bard Liao : Currently, ASoC supports dailinks with the following mappings: 1 cpu DAI to N codec DAIs N cpu DAIs to N codec DAIs But the mapping between N cpu DAIs and M codec DAIs is not supported. The reason is that we didn't have a mechanism to map cpu and codec DAIs This series suggests a new snd_soc_dai_link_codec_ch_map struct in struct snd_soc_dai_link{} which provides codec DAI to cpu DAI mapping information used to implement N cpu DAIs to M codec DAIs support. And add the codec_ch_maps to SOF SoundWire machine driver. commit 1012bfdd2f1f5a239d83b316177ff645b65c26d7 Merge: 82a28d5aa582a 0eff26b13da4e Author: Mark Brown Date: Tue Jun 13 17:16:44 2023 +0100 ASoC: Use maple tree for Cirrus Logic devices Merge series from Mark Brown : A lot of the Cirrus Logic devices only support single register read/write operations so they get no benefit from using the rbtree cache over the more modern maple tree cache, convert them to use maple tree. commit 0b210faf337314e4bc88e796218bc70c72a51209 Author: Sean Christopherson Date: Thu Jun 1 17:58:59 2023 -0700 KVM: x86/mmu: Add "never" option to allow sticky disabling of nx_huge_pages Add a "never" option to the nx_huge_pages module param to allow userspace to do a one-way hard disabling of the mitigation, and don't create the per-VM recovery threads when the mitigation is hard disabled. Letting userspace pinky swear that userspace doesn't want to enable NX mitigation (without reloading KVM) allows certain use cases to avoid the latency problems associated with spawning a kthread for each VM. E.g. in FaaS use cases, the guest kernel is trusted and the host may create 100+ VMs per logical CPU, which can result in 100ms+ latencies when a burst of VMs is created. Reported-by: Li RongQing Closes: https://lore.kernel.org/all/1679555884-32544-1-git-send-email-lirongqing@baidu.com Cc: Yong He Cc: Robert Hoo Cc: Kai Huang Reviewed-by: Robert Hoo Acked-by: Kai Huang Tested-by: Luiz Capitulino Reviewed-by: Li RongQing Link: https://lore.kernel.org/r/20230602005859.784190-1-seanjc@google.com Signed-off-by: Sean Christopherson commit a30642570855faa1992f333ce5cb60351b0a37da Author: Sean Christopherson Date: Tue Jun 6 17:46:36 2023 -0700 KVM: x86: Update comments about MSR lists exposed to userspace Refresh comments about msrs_to_save, emulated_msrs, and msr_based_features to remove stale references left behind by commit 2374b7310b66 (KVM: x86/pmu: Use separate array for defining "PMU MSRs to save"), and to better reflect the current reality, e.g. emulated_msrs is no longer just for MSRs that are "kvm-specific". Reported-by: Binbin Wu Link: https://lore.kernel.org/r/20230607004636.1421424-1-seanjc@google.com Signed-off-by: Sean Christopherson commit 389ce21b622b0dba4e9134d6236ce0bf1635edcb Author: Baoquan He Date: Mon Jun 12 07:03:58 2023 +0800 arm64: add kdump.rst into index.rst Document kdump.rst was added into Documentation/arm64/, but not listed in Documentation/arm64/index.rst. That triggers below warning when executing "make htmldoc": >> Documentation/arm64/kdump.rst: WARNING: document isn't included in any toctree Fix it now. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306110549.ynH2Juok-lkp@intel.com/ Signed-off-by: Baoquan He Fixes: 03dc0e05407f ("Documentation: add kdump.rst to present crashkernel reservation on arm64") Reviewed-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20230611230358.13635-1-bhe@redhat.com Signed-off-by: Catalin Marinas commit ea197ea2ba572cd350f9fe6224a7d6a8347d91ad Author: Srinivas Pandruvada Date: Wed May 24 05:51:31 2023 -0700 thermal: intel: int340x_thermal: New IOCTLs for Passive v2 table Export Passive version 2 table similar to the way _TRT and _ART tables via IOCTLs. This removes need for binary utility to read ACPI Passive 2 table by providing open source support. This table already has open source implementation in the user space thermald, when the table is part of data vault exported by the int3400 sysfs. This table is supported in some older platforms before Ice Lake generation. Passive 2 tables contain multiple entries. Each entry has following fields: * Source: Named Reference (String). This is the source device for temperature. * Target: Named Reference (String). This is the target device to control. * Priority: Priority of this device compared to others. * SamplingPeriod: Time Period in 1/10 of seconds unit. * PassiveTemp: Passive Temperature in 1/10 of Kelvin. * SourceDomain: Domain for the source (00:Processor, others reserved). * ControlKnob: Type of control knob (00:Power Limit 1, others: reserved) * Limit: The target state to set on reaching passive temperature. This can be a string "max", "min" or a power limit value. * LimitStepSize: Step size during activation. * UnLimitStepSize: Step size during deactivation. * Reserved1: Reserved Three IOCTLs are added similar to IOCTLs for reading TRT: ACPI_THERMAL_GET_PSVT_COUNT: Number of passive 2 entries. ACPI_THERMAL_GET_PSVT_LEN: Total return data size (count x each passive 2 entry size). ACPI_THERMAL_GET_PSVT: Get the data as an array of objects with passive 2 entries. This change is based on original development done by: Todd Brandt Signed-off-by: Srinivas Pandruvada [ rjw: Changelog and subject edits ] Signed-off-by: Rafael J. Wysocki commit c3b880acadc95d6e019eae5d669e072afda24f1b Author: Long Li Date: Tue Jun 13 08:49:20 2023 -0700 xfs: fix ag count overflow during growfs I found a corruption during growfs: XFS (loop0): Internal error agbno >= mp->m_sb.sb_agblocks at line 3661 of file fs/xfs/libxfs/xfs_alloc.c. Caller __xfs_free_extent+0x28e/0x3c0 CPU: 0 PID: 573 Comm: xfs_growfs Not tainted 6.3.0-rc7-next-20230420-00001-gda8c95746257 Call Trace: dump_stack_lvl+0x50/0x70 xfs_corruption_error+0x134/0x150 __xfs_free_extent+0x2c1/0x3c0 xfs_ag_extend_space+0x291/0x3e0 xfs_growfs_data+0xd72/0xe90 xfs_file_ioctl+0x5f9/0x14a0 __x64_sys_ioctl+0x13e/0x1c0 do_syscall_64+0x39/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd XFS (loop0): Corruption detected. Unmount and run xfs_repair XFS (loop0): Internal error xfs_trans_cancel at line 1097 of file fs/xfs/xfs_trans.c. Caller xfs_growfs_data+0x691/0xe90 CPU: 0 PID: 573 Comm: xfs_growfs Not tainted 6.3.0-rc7-next-20230420-00001-gda8c95746257 Call Trace: dump_stack_lvl+0x50/0x70 xfs_error_report+0x93/0xc0 xfs_trans_cancel+0x2c0/0x350 xfs_growfs_data+0x691/0xe90 xfs_file_ioctl+0x5f9/0x14a0 __x64_sys_ioctl+0x13e/0x1c0 do_syscall_64+0x39/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f2d86706577 The bug can be reproduced with the following sequence: # truncate -s 1073741824 xfs_test.img # mkfs.xfs -f -b size=1024 -d agcount=4 xfs_test.img # truncate -s 2305843009213693952 xfs_test.img # mount -o loop xfs_test.img /mnt/test # xfs_growfs -D 1125899907891200 /mnt/test The root cause is that during growfs, user space passed in a large value of newblcoks to xfs_growfs_data_private(), due to current sb_agblocks is too small, new AG count will exceed UINT_MAX. Because of AG number type is unsigned int and it would overflow, that caused nagcount much smaller than the actual value. During AG extent space, delta blocks in xfs_resizefs_init_new_ags() will much larger than the actual value due to incorrect nagcount, even exceed UINT_MAX. This will cause corruption and be detected in __xfs_free_extent. Fix it by growing the filesystem to up to the maximally allowed AGs and not return EINVAL when new AG count overflow. Signed-off-by: Long Li Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 3dbd53c7be1c3dd04875a0672262b56417039869 Author: Christoph Hellwig Date: Tue Jun 13 17:43:09 2023 +0200 swim3: fix the floppy_locked_ioctl prototype Add back the accidentally dropped mode parameter. Fixes: b60f7635788a ("swim3: fix the floppy_locked_ioctl prototype") Reported-by: Randy Dunlap Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230613154309.327557-1-hch@lst.de Signed-off-by: Jens Axboe commit ae128bb36d23e4e95c52e5254c3b4cf408c54433 Author: Leonard Göhrs Date: Wed Jun 7 13:55:02 2023 +0200 dt-bindings: gpio: pca9570: add gpio-line-names property This patch allows giving each of the controller's pins a meaningful name. Signed-off-by: Leonard Göhrs Acked-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit cea44032bc799b088bce1ea73c08269bb59b47d0 Author: Andreas Gruenbacher Date: Wed Jun 7 07:19:50 2023 -0500 gfs2: retry interrupted internal reads The iomap-based read operations done by gfs2 for its system files, such as rindex, may sometimes be interrupted and return -EINTR. This confuses some users of gfs2_internal_read(). Fix that by retrying interrupted reads. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 7d0b80647f73a170dd20d18fbf01de0f770ed7c8 Author: Andy Shevchenko Date: Mon Jun 5 15:54:11 2023 +0300 gpiolib: remove unused gpio_cansleep() There is not a single user in the entire kernel of this deprecated API, kill it for good. Signed-off-by: Andy Shevchenko Reviewed-by: Yanteng Si Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 1e327963cfab0e02eeeb0331178d6c353c959cd6 Author: Jakob Koschel Date: Wed Mar 1 12:17:29 2023 +0100 x86/sgx: Avoid using iterator after loop in sgx_mmu_notifier_release() If &encl_mm->encl->mm_list does not contain the searched 'encl_mm', 'tmp' will not point to a valid sgx_encl_mm struct. Linus proposed to avoid any use of the list iterator variable after the loop, in the attempt to move the list iterator variable declaration into the macro to avoid any potential misuse after the loop. Using it in a pointer comparison after the loop is undefined behavior and should be omitted if possible, see Link tag. Instead, just use a 'found' boolean to indicate if an element was found. [ bp: Massage, fix typos. ] Signed-off-by: Jakob Koschel Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Jarkko Sakkinen Acked-by: Dave Hansen Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Link: https://lore.kernel.org/r/20230206-sgx-use-after-iter-v2-1-736ca621adc3@gmail.com commit 2cc83bf7d41113d95c5e8aa0938a73d6cd7082bb Author: Dennis Zhou Date: Wed Mar 29 16:48:01 2023 -0700 mmc: core: Allow mmc_start_host() synchronously detect a card When using dm-verity with a data partition on an emmc device, dm-verity races with the initialization of the (e)MMC/SD cards. This is because the card detection procedure is being managed from a workqueue, rather than synchronously from the mmc host's ->probe() routine. To allow the card detect to be synchronous, let's simply skip using the workqueue at the first initialization attempt from mmc_start_host(). Signed-off-by: Dennis Zhou Link: https://lore.kernel.org/r/ZCTOMVjW+pnZVGsQ@snowbird [Ulf: Re-wrote the commit message to clarify the change] Signed-off-by: Ulf Hansson commit 3108eb2e8aa7e955a9dd3a4c1bf19a7898961822 Author: Ulf Hansson Date: Mon Jun 12 16:37:30 2023 +0200 mmc: mmci: Set PROBE_PREFER_ASYNCHRONOUS All mmc host drivers should have the asynchronous probe option enabled, but it seems like we failed to set it for mmci, so let's do that now. Fixes: 21b2cec61c04 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4") Signed-off-by: Ulf Hansson Tested-by: Linus Walleij Tested-by: Yann Gautier Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230612143730.210390-1-ulf.hansson@linaro.org commit 57e30e00bd5baacdf99450d69981ec9192592e3c Author: Jerome Neanne Date: Wed Jun 7 16:39:31 2023 +0200 gpio: tps65219: add GPIO support for TPS65219 PMIC Add support for TPS65219 PMICs GPIO interface. 3 GPIO pins: - GPIO0 only is IO but input mode reserved for MULTI_DEVICE_ENABLE usage. - GPIO1 and GPIO2 are Output only and referred as GPO1 and GPO2 in spec. GPIO0 is statically configured as input or output prior to Linux boot. it is used for MULTI_DEVICE_ENABLE function. This setting is statically configured by NVM. GPIO0 can't be used as a generic GPIO (specification Table 8-34). It's either a GPO when MULTI_DEVICE_EN=0 or a GPI when MULTI_DEVICE_EN=1. Datasheet describes specific usage for non standard GPIO. Datasheet: https://www.ti.com/lit/ds/symlink/tps65219.pdf Co-developed-by: Jonathan Cormier Signed-off-by: Jonathan Cormier Reviewed-by: Linus Walleij Signed-off-by: Jerome Neanne Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 6fa0a72cbbe45db4ed967a51f9e6f4e3afe61d20 Author: Tuo Li Date: Tue Jun 13 11:06:37 2023 +0800 gfs2: Fix possible data races in gfs2_show_options() Some fields such as gt_logd_secs of the struct gfs2_tune are accessed without holding the lock gt_spin in gfs2_show_options(): val = sdp->sd_tune.gt_logd_secs; if (val != 30) seq_printf(s, ",commit=%d", val); And thus can cause data races when gfs2_show_options() and other functions such as gfs2_reconfigure() are concurrently executed: spin_lock(>->gt_spin); gt->gt_logd_secs = newargs->ar_commit; To fix these possible data races, the lock sdp->sd_tune.gt_spin is acquired before accessing the fields of gfs2_tune and released after these accesses. Further changes by Andreas: - Don't hold the spin lock over the seq_printf operations. Reported-by: BassCheck Signed-off-by: Tuo Li Signed-off-by: Andreas Gruenbacher commit b629c698eae745eb51b6d92395e2eee44bbf5f49 Author: Waqar Hameed Date: Tue Jun 13 13:42:27 2023 +0200 regmap: Add debugfs file for forcing field writes `_regmap_update_bits()` checks if the current register value differs from the new value, and only writes to the register if they differ. When testing hardware drivers, it might be desirable to always force a register write, for example when writing to a `regmap_field`. This enables and simplifies testing and verification of the hardware interaction. For example, when using a hardware mock/simulation model, one can then more easily verify that the driver makes the correct expected register writes during certain events. Add a bool variable `force_write_field` and a corresponding debugfs entry to enable this. Since this feature could interfere with driver operation, guard it with a macro. Signed-off-by: Waqar Hameed Link: https://lore.kernel.org/r/pnd1qifa7sj.fsf@axis.com Signed-off-by: Mark Brown commit 21e87daece5aed25f47f051af5fccbbd39164c88 Author: Dan Carpenter Date: Tue Jun 13 09:43:39 2023 +0300 KVM: arm64: timers: Fix resource leaks in kvm_timer_hyp_init() Smatch detected this bug: arch/arm64/kvm/arch_timer.c:1425 kvm_timer_hyp_init() warn: missing unwind goto? There are two resources to be freed the vtimer and ptimer. The line that Smatch complains about should free the vtimer first before returning and then after that cleanup code should free the ptimer. I've added a out_free_ptimer_irq to free the ptimer and renamed the existing label to out_free_vtimer_irq. Fixes: 9e01dc76be6a ("KVM: arm/arm64: arch_timer: Assign the phys timer on VHE systems") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/72fffc35-7669-40b1-9d14-113c43269cf3@kili.mountain Signed-off-by: Oliver Upton commit 82a28d5aa582a98f40ab527af08c66556dd3d310 Author: Juerg Haefliger Date: Tue Jun 13 11:54:54 2023 +0200 ASoC: siu: Add MODULE_FIRMWARE macro The module loads firmware so add a MODULE_FIRMWARE macro to provide that information via modinfo. Signed-off-by: Juerg Haefliger Link: https://lore.kernel.org/r/20230613095454.38696-1-juerg.haefliger@canonical.com Signed-off-by: Mark Brown commit 099770e2dae04579670947aaf8b5c70ef6a4cb6a Author: Kuninori Morimoto Date: Thu Jun 8 06:49:11 2023 +0000 ASoC: remove old trigger ordering method All drivers switch to use generic trigger ordering method. Let's remove old method. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87legufnyy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 0a67a14f74ace85cbd5bd4f49595850db2ebe53c Author: Kuninori Morimoto Date: Thu Jun 8 06:49:04 2023 +0000 ASoC: starfive: use use new trigger ordering method ASoC is now supporting generic trigger ordering method. This patch switch to use it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87mt1afnz5.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 38cb2a362d070dcabfbfb2466ca409751c426c30 Author: Kuninori Morimoto Date: Thu Jun 8 06:48:58 2023 +0000 ASoC: atmel: use use new trigger ordering method ASoC is now supporting generic trigger ordering method. This patch switch to use it. Signed-off-by: Kuninori Morimoto Reviewed-by: Claudiu Beznea Tested-by: Claudiu Beznea Link: https://lore.kernel.org/r/87o7lqfnzb.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 4a6aeaebbe3b5ef2ae637c00840de171a6c93478 Author: Kuninori Morimoto Date: Thu Jun 8 06:48:51 2023 +0000 ASoC: amd: use use new trigger ordering method ASoC is now supporting generic trigger ordering method. This patch switch to use it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87pm66fnzi.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 356caf663deee8dc46ff3168ec0b24bcbeb00b28 Author: Kuninori Morimoto Date: Thu Jun 8 06:48:36 2023 +0000 ASoC: add new trigger ordering method Current ASoC is assuming that trigger starting order is Link -> Component -> DAI as default, and its reverse order for stopping. But some Driver / Card want to reorder it for some reasons. We have such flags, but is unbalance like below. struct snd_soc_component_driver :: start_dma_last struct snd_soc_dai_link :: stop_dma_first We want to have more flexible, and more generic method. This patch adds new snd_soc_trigger_order for start/stop at component / DAI-link. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r0qmfnzx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 0281b02e1913a9443ce891dcc13613829e4dc3c5 Author: Bard Liao Date: Wed Jun 7 11:12:42 2023 +0800 ASoC: Intel: sof_sdw: add dai_link_codec_ch_map The captured data will be combined from each cpu DAI if the dai link has more than one cpu DAIs. We can set channel number indirectly by adding sdw_codec_ch_maps. Signed-off-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230607031242.1032060-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit ac950278b0872c87bcef6153fd9c119265c8ba83 Author: Bard Liao Date: Wed Jun 7 11:12:41 2023 +0800 ASoC: add N cpus to M codecs dai link support Currently, ASoC supports dailinks with the following mappings: 1 cpu DAI to N codec DAIs N cpu DAIs to N codec DAIs But the mapping between N cpu DAIs and M codec DAIs is not supported. The reason is that we didn't have a mechanism to map cpu and codec DAIs This patch suggests a new snd_soc_dai_link_codec_ch_map struct in struct snd_soc_dai_link{} which provides codec DAI to cpu DAI mapping information used to implement N cpu DAIs to M codec DAIs support. When a dailink contains two or more cpu DAIs, we should set channel number of cpus based on its channel mask. The new struct also provides channel mask information for each codec and we can construct the cpu channel mask by combining all codec channel masks which map to the cpu. The N:M mapping is however restricted to the N <= M case due to physical restrictions on a time-multiplexed bus such as I2S/TDM, AC97, SoundWire and HDaudio. Signed-off-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230607031242.1032060-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 0eff26b13da4eb5a71a59280c3483273ccb5b9cb Author: Mark Brown Date: Sat Jun 10 14:56:30 2023 +0100 ASoC: cs35l30: Use maple tree register cache The cs35l30 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Acked-by: David Rhodes Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-10-b806c4cbd1d4@kernel.org Signed-off-by: Mark Brown commit ce598b2f83608f3818f8a4079662d3844679b16f Author: Mark Brown Date: Sat Jun 10 14:56:29 2023 +0100 ASoC: cs43130: Use maple tree register cache The cs43130 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Acked-by: David Rhodes Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-9-b806c4cbd1d4@kernel.org Signed-off-by: Mark Brown commit 62145b0a537410d7ce237945c339635f9a86a895 Author: Mark Brown Date: Sat Jun 10 14:56:28 2023 +0100 ASoC: cs42l83: Use maple tree register cache The cs42l83 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Acked-by: David Rhodes Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-8-b806c4cbd1d4@kernel.org Signed-off-by: Mark Brown commit 7e39a71876244639774c71144e4b5dee7799e1cf Author: Mark Brown Date: Sat Jun 10 14:56:27 2023 +0100 ASoC: cs42l73: Use maple tree register cache The cs42l73 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Acked-by: David Rhodes Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-7-b806c4cbd1d4@kernel.org Signed-off-by: Mark Brown commit 6b7fed83c9455f64a1509a9e1d512a92edaaf44e Author: Mark Brown Date: Sat Jun 10 14:56:26 2023 +0100 ASoC: cs42l42: Use maple tree register cache The cs42l42 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Acked-by: David Rhodes Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-6-b806c4cbd1d4@kernel.org Signed-off-by: Mark Brown commit bb1bd25ad79cf21b8fa4c0eae474307b2d24b268 Author: Mark Brown Date: Sat Jun 10 14:56:25 2023 +0100 ASoC: cs4234: Use maple tree register cache The cs4234 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Acked-by: David Rhodes Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-5-b806c4cbd1d4@kernel.org Signed-off-by: Mark Brown commit 28f851babc484c86bc8e1919ad0bbe11f4fd9210 Author: Mark Brown Date: Sat Jun 10 14:56:24 2023 +0100 ASoC: cs35l35: Use maple tree register cache The cs35l35 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Acked-by: David Rhodes Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-4-b806c4cbd1d4@kernel.org Signed-off-by: Mark Brown commit e7795f2d29e08e15fbc5ad88b94cf1899915a7c3 Author: Mark Brown Date: Sat Jun 10 14:56:23 2023 +0100 ASoC: cs35l34: Use maple tree register cache The cs35l34 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Acked-by: David Rhodes Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-3-b806c4cbd1d4@kernel.org Signed-off-by: Mark Brown commit 7a230512d335793fdc43bb85a7d5cff9dd171c26 Author: Mark Brown Date: Sat Jun 10 14:56:22 2023 +0100 ASoC: cs35l33: Use maple tree register cache The cs35l33 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Acked-by: David Rhodes Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-2-b806c4cbd1d4@kernel.org Signed-off-by: Mark Brown commit 176bb179f190682d496220be469ea20527bb5f43 Author: Mark Brown Date: Sat Jun 10 14:56:21 2023 +0100 ASoC: cs35l32: Use maple tree register cache The cs35l32 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Acked-by: David Rhodes Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-asoc-cirrus-maple-v1-1-b806c4cbd1d4@kernel.org Signed-off-by: Mark Brown commit 404615d7f1dcd4cca200e9a7a9df3a1dcae1dd62 Author: Jan Kara Date: Tue Jun 13 12:25:52 2023 +0200 ext2: Drop fragment support Ext2 has fields in superblock reserved for subblock allocation support. However that never landed. Drop the many years dead code. Reported-by: syzbot+af5e10f73dbff48f70af@syzkaller.appspotmail.com Signed-off-by: Jan Kara commit 9ce930869164abf2d2d260e5470ed7ffc17a32c3 Merge: b77b75fc61216 7244720ac137e Author: Hans de Goede Date: Tue Jun 13 12:37:05 2023 +0200 Merge remote-tracking branch 'intel-speed-select/intel-sst' into review-hans commit b77b75fc61216cfaa974a8241186635eabe6671a Author: Srinivas Pandruvada Date: Mon Jun 12 15:40:33 2023 -0700 platform/x86: ISST: Fix usage counter On multi package system, the TPMI SST instance is getting allocated again as the usage counter is not getting incremented. Here the instance is allocated only when the usage count is zero. There is no need to allocate again. Increment usage ID on successful return from isst_if_cdev_register(). Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20230612224033.2382527-3-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit fa5e68b1c10d56befcee2ee0a9e1eed2c830e352 Author: Srinivas Pandruvada Date: Mon Jun 12 15:40:32 2023 -0700 platform/x86: ISST: Reset default callback on unregister When multiple clients are registered and some of those modules are removed, the default IOCTL callback for those clients are still not NULL. Calling them will result in crash. Set the default IOCTL callback pointer to NULL on unregister. Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20230612224033.2382527-2-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit f3710f5e9e1a68da53202cffba73f4b604f05b15 Author: Christophe JAILLET Date: Sat Jun 10 17:59:27 2023 +0200 tty: serial: samsung_tty: Use abs() to simplify some code Use abs() instead of hand-writing it. Suggested-by: Walter Harms Signed-off-by: Christophe JAILLET Reviewed-by: Andi Shyti Reviewed-by: Jiri Slaby Message-ID: <7bd165e82ed3675d4ddee343ab373031e995a126.1686412569.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Greg Kroah-Hartman commit 832e231cff476102e8204a9e7bddfe5c6154a375 Author: Christophe JAILLET Date: Sat Jun 10 17:59:26 2023 +0200 tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() when iterating clk When the best clk is searched, we iterate over all possible clk. If we find a better match, the previous one, if any, needs to be freed. If a better match has already been found, we still need to free the new one, otherwise it leaks. Cc: # v3.3+ Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andi Shyti Fixes: 5f5a7a5578c5 ("serial: samsung: switch to clkdev based clock lookup") Signed-off-by: Christophe JAILLET Reviewed-by: Jiri Slaby Message-ID: Signed-off-by: Greg Kroah-Hartman commit a9c09546e903f1068acfa38e1ee18bded7114b37 Author: Christophe JAILLET Date: Sat Jun 10 17:59:25 2023 +0200 tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() in case of error If clk_get_rate() fails, the clk that has just been allocated needs to be freed. Cc: # v3.3+ Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andi Shyti Fixes: 5f5a7a5578c5 ("serial: samsung: switch to clkdev based clock lookup") Signed-off-by: Christophe JAILLET Reviewed-by: Jiri Slaby Message-ID: Signed-off-by: Greg Kroah-Hartman commit aeaee158c2dbcba3763044424783e98846a1922c Author: Uwe Kleine-König Date: Mon Jun 12 09:39:02 2023 +0200 platform/x86: int3472: Switch back to use struct i2c_driver's .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230612073902.840435-4-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit bba73a1d05f3445ef7ae42456692078cd66ab39b Author: Uwe Kleine-König Date: Mon Jun 12 09:39:01 2023 +0200 platform/x86: asus-tf103c-dock: Switch back to use struct i2c_driver's .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230612073902.840435-3-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 8802fcfb57d5ec1adc866bde010f07be78267e4e Author: Uwe Kleine-König Date: Mon Jun 12 09:39:00 2023 +0200 platform/surface: surface3_power: Switch back to use struct i2c_driver's .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Acked-by: Maximilian Luz Link: https://lore.kernel.org/r/20230612073902.840435-2-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit f2b689ab2f8cc089cc7659c323f282e6a1fb6d64 Author: David E. Box Date: Wed Jun 7 16:38:49 2023 -0700 platform/x86/intel/pmc/mtl: Put devices in D3 during resume An earlier commit placed some driverless devices in D3 during boot so that they don't block package cstate entry on Meteor Lake. Also place these devices in D3 after resume from suspend. Fixes: 336ba968d3e3 ("platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3") Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20230607233849.239047-2-david.e.box@linux.intel.com Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 801e5dc9853fcc36164c502456078145d72b23c5 Author: David E. Box Date: Wed Jun 7 16:38:48 2023 -0700 platform/x86/intel/pmc: Add resume callback Add a resume callback to perform platform specific functions during resume from suspend. Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20230607233849.239047-1-david.e.box@linux.intel.com Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d9f59caf94a92f7a54b83766de29028cab9ec5b8 Author: Uwe Kleine-König Date: Fri Jun 9 15:39:32 2023 +0200 serial: 8250: Apply FSL workarounds also without SERIAL_8250_CONSOLE The need to handle the FSL variant of 8250 in a special way is also present without console support. So soften the dependency for SERIAL_8250_FSL from SERIAL_8250_CONSOLE to SERIAL_8250. To handle SERIAL_8250=m, the FSL code can be modular, too, thus SERIAL_8250_FSL becomes tristate. Compiling 8250_fsl as a module requires adding a module license so this is added, too. While add it also add a appropriate module description. As then SERIAL_OF_PLATFORM=y + SERIAL_8250_FSL=m is a valid combination (if COMPILE_TEST is enabled on a platform that is neither PPC, ARM nor ARM64), the check in 8250_of.c must be weakened a bit. Signed-off-by: Uwe Kleine-König Reviewed-by: Andy Shevchenko Message-ID: <20230609133932.786117-3-u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman commit 1eea99c04555e505c0361f70c9232a9f0d88974b Author: Uwe Kleine-König Date: Fri Jun 9 15:39:31 2023 +0200 powerpc/legacy_serial: Handle SERIAL_8250_FSL=n build failures With SERIAL_8250=y and SERIAL_8250_FSL_CONSOLE=n the both IS_ENABLED(CONFIG_SERIAL_8250) and IS_REACHABLE(CONFIG_SERIAL_8250) evaluate to true and so fsl8250_handle_irq() is used. However this function is only available if CONFIG_SERIAL_8250_CONSOLE=y (and thus SERIAL_8250_FSL=y). To prepare SERIAL_8250_FSL becoming tristate and being enabled in more cases, check for IS_REACHABLE(CONFIG_SERIAL_8250_FSL) before making use of fsl8250_handle_irq(). This check is correct with and without the change to make SERIAL_8250_FSL modular. Reported-by: Randy Dunlap Fixes: 66eff0ef528b ("powerpc/legacy_serial: Warn about 8250 devices operated without active FSL workarounds") Signed-off-by: Uwe Kleine-König Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Message-ID: <20230609133932.786117-2-u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman commit f999e23ce66c1555d7b653fba171a88ecee53704 Author: Mark Pearson Date: Tue Jun 6 11:18:04 2023 -0400 platform/x86: thinkpad_acpi: Fix lkp-tests warnings for platform profiles Fix issues identified in dytc_profile_refresh identified by lkp-tests. drivers/platform/x86/thinkpad_acpi.c:10538 dytc_profile_refresh() error: uninitialized symbol 'funcmode'. drivers/platform/x86/thinkpad_acpi.c:10531 dytc_profile_refresh() error: uninitialized symbol 'output'. drivers/platform/x86/thinkpad_acpi.c:10537 dytc_profile_refresh() error: uninitialized symbol 'output'. These issues should not lead to real problems in the field as the refresh function should only be called if MMC or PSC mode enabled. But good to fix. Thanks to Dan Carpenter and the lkp-tests project for flagging these. Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202306011202.1hbgLRD4-lkp@intel.com/ Fixes: 1bc5d819f0b9 ("platform/x86: thinkpad_acpi: Fix profile modes on Intel platforms") Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20230606151804.8819-1-mpearson-lenovo@squebb.ca Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 53d061c19dc4cb68409df6dc11c40389c8c42a75 Author: Xu Yang Date: Wed May 17 16:19:07 2023 +0800 usb: chipidea: imx: add missing USB PHY DPDM wakeup setting USB PHY DPDM wakeup bit is enabled by default, when USB wakeup is not required(/sys/.../wakeup is disabled), this bit should be disabled, otherwise we will have unexpected wakeup if do USB device connect/disconnect while system sleep. This bit can be enabled for both host and device mode. Signed-off-by: Li Jun Signed-off-by: Xu Yang Acked-by: Peter Chen Message-ID: <20230517081907.3410465-3-xu.yang_2@nxp.com> Signed-off-by: Greg Kroah-Hartman commit 0ac37fbdad7087bbcbbe246a602c248ccfd954ea Author: Xu Yang Date: Wed May 17 16:19:06 2023 +0800 usb: chipidea: imx: turn off vbus comparator when suspend As we use bvalid for vbus wakeup source, to save power when suspend, turn off the vbus comparator for imx7d and imx8mm. Below is this bit description from RM of iMX8MM "VBUS Valid Comparator Enable: This signal controls the USB OTG PHY VBUS Valid comparator which indicates whether the voltage on the USB_OTG*_VBUS pin is below the VBUS Valid threshold. The VBUS Valid threshold is nominally 4.75V on this USB PHY. The VBUS Valid threshold can be adjusted using the USBNC_OTGn_PHY_CFG1[OTGTUNE0] bit field. Status of the VBUS Valid comparator, when it is enabled, is reported on the USBNC_OTGn_PHY_STATUS[VBUS_VLD] bit. When OTGDISABLE0 (USBNC_USB_OTGx_PHY_CFG2[10])is set to 1'b0 and DRVVBUS0 is set to 1'b1, the Bandgap circuitry and VBUS Valid comparator are powered, even in Suspend or Sleep mode. DRVVBUS0 should be reset to 1'b0 when the internal VBUS Valid comparator is not required, to reduce quiescent current in Suspend or Sleep mode. - 0 The VBUS Valid comparator is disabled - 1 The VBUS Valid comparator is enabled" Signed-off-by: Li Jun Signed-off-by: Xu Yang Acked-by: Peter Chen Message-ID: <20230517081907.3410465-2-xu.yang_2@nxp.com> Signed-off-by: Greg Kroah-Hartman commit 41e2f976b558ca71fb79dbc7874c4fc91370b5d6 Author: Pawel Laszczak Date: Fri Jun 2 06:26:44 2023 -0400 MAINTAINERS: add Cadence USBHS driver entry Patch adds entry for USBHS (CDNS2) driver into MAINTARNERS file Signed-off-by: Pawel Laszczak Message-ID: <20230602102644.77470-5-pawell@cadence.com> Signed-off-by: Greg Kroah-Hartman commit 07a3aef249a1a084b081002e7cbab3873dfb58ae Author: Pawel Laszczak Date: Fri Jun 2 06:26:43 2023 -0400 usb: cdns2: Add tracepoints for CDNS2 driver Patch adds the series of tracepoints that can be used for debugging issues detected in driver. Signed-off-by: Pawel Laszczak Message-ID: <20230602102644.77470-4-pawell@cadence.com> Signed-off-by: Greg Kroah-Hartman commit 3eb1f1efe2045e7083048f4cc4257d0df51899b8 Author: Pawel Laszczak Date: Fri Jun 2 06:26:42 2023 -0400 usb: cdns2: Add main part of Cadence USBHS driver This patch introduces the main part of Cadence USBHS driver to Linux kernel. To reduce the patch size a little bit, the header file gadget.h was intentionally added as separate patch. The Cadence USB 2.0 Controller is a highly configurable IP Core which supports both full and high speed data transfer. The current driver has been validated with FPGA platform. We have support for PCIe bus, which is used on FPGA prototyping. Signed-off-by: Pawel Laszczak Message-ID: <20230602102644.77470-3-pawell@cadence.com> Signed-off-by: Greg Kroah-Hartman commit 0ca2026eea104adc1d0d356bca35915a1ab6e3e9 Author: Pawel Laszczak Date: Fri Jun 2 06:26:41 2023 -0400 usb: cdns2: Device side header file for CDNS2 driver Patch defines macros, registers and structures used by Device side driver. Signed-off-by: Pawel Laszczak Message-ID: <20230602102644.77470-2-pawell@cadence.com> Signed-off-by: Greg Kroah-Hartman commit 01052b91c9808e3c3b068ae2721cb728ec9aa4c0 Author: Christophe JAILLET Date: Sat Jun 10 15:32:52 2023 +0200 usb: dwc3-meson-g12a: Fix an error handling path in dwc3_meson_g12a_probe() If dwc3_meson_g12a_otg_init() fails, resources allocated by the previous of_platform_populate() call should be released, as already done in the error handling path. Fixes: 1e355f21d3fb ("usb: dwc3: Add Amlogic A1 DWC3 glue") Signed-off-by: Christophe JAILLET Reviewed-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Message-ID: <9d28466de1808ccc756b4cc25fc72c482d133d13.1686403934.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Greg Kroah-Hartman commit a053d9dc45acb9534ab4ff1e5794c73011ae5d4d Author: Jeff Layton Date: Mon Jun 12 06:45:18 2023 -0400 usb: update the ctime as well when updating mtime after an ioctl In general, POSIX requires that when the mtime is updated that the ctime be updated as well. Add the missing timestamp updates to the usb ioctls. Signed-off-by: Jeff Layton Message-ID: <20230612104524.17058-3-jlayton@kernel.org> Signed-off-by: Greg Kroah-Hartman commit 83cb2604f641cecadc275ca18adbba4bf262320f Author: Roy Luo Date: Thu Jun 8 01:59:12 2023 +0000 usb: core: add sysfs entry for usb device state Expose usb device state to userland as the information is useful in detecting non-compliant setups and diagnosing enumeration failures. For example: - End-to-end signal integrity issues: the device would fail port reset repeatedly and thus be stuck in POWERED state. - Charge-only cables (missing D+/D- lines): the device would never enter POWERED state as the HC would not see any pullup. What's the status quo? We do have error logs such as "Cannot enable. Maybe the USB cable is bad?" to flag potential setup issues, but there's no good way to expose them to userspace. Why add a sysfs entry in struct usb_port instead of struct usb_device? The struct usb_device is not device_add() to the system until it's in ADDRESS state hence we would miss the first two states. The struct usb_port is a better place to keep the information because its life cycle is longer than the struct usb_device that is attached to the port. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202306042228.e532af6e-oliver.sang@intel.com Reviewed-by: Alan Stern Signed-off-by: Roy Luo Message-ID: <20230608015913.1679984-1-royluo@google.com> Signed-off-by: Greg Kroah-Hartman commit edd60d24bd858cef165274e4cd6cab43bdc58d15 Author: Prashanth K Date: Wed May 31 20:11:14 2023 +0530 usb: common: usb-conn-gpio: Set last role to unknown before initial detection Currently if we bootup a device without cable connected, then usb-conn-gpio won't call set_role() since last_role is same as current role. This happens because during probe last_role gets initialised to zero. To avoid this, added a new constant in enum usb_role, last_role is set to USB_ROLE_UNKNOWN before performing initial detection. While at it, also handle default case for the usb_role switch in cdns3, intel-xhci-usb-role-switch & musb/jz4740 to avoid build warnings. Fixes: 4602f3bff266 ("usb: common: add USB GPIO based connection detection driver") Signed-off-by: Prashanth K Reviewed-by: AngeloGioacchino Del Regno Message-ID: <1685544074-17337-1-git-send-email-quic_prashk@quicinc.com> Signed-off-by: Greg Kroah-Hartman commit 9a070e8e208995a9d638b538ed7abf28bd6ea6f0 Author: Xu Yang Date: Tue May 30 18:40:07 2023 +0800 usb: chipidea: imx: don't request QoS for imx8ulp Use dedicated imx8ulp usb compatible to remove QoS request since imx8ulp has no such limitation of imx7ulp: DMA will not work if system enters idle. Signed-off-by: Xu Yang Signed-off-by: Li Jun Acked-by: Peter Chen Message-ID: <20230530104007.1294702-2-xu.yang_2@nxp.com> Signed-off-by: Greg Kroah-Hartman commit 52ff079dede27c67f106d6f05eeba3650c000439 Author: Xu Yang Date: Tue May 30 18:40:06 2023 +0800 dt-bindings: usb: ci-hdrc-usb2: add fsl,imx8ulp-usb compatible The imx8ulp and imx8dxl are compatible. This will add fsl,imx8ulp-usb to the compatible property. Signed-off-by: Xu Yang Acked-by: Krzysztof Kozlowski Message-ID: <20230530104007.1294702-1-xu.yang_2@nxp.com> Signed-off-by: Greg Kroah-Hartman commit 60d5b71933c4f1d818aff15ec8b2a8f83a3843b2 Author: Andrew Halaney Date: Mon Jun 5 14:36:25 2023 -0500 usb: dwc3: qcom: use dev_err_probe() where appropriate Update to using dev_err_probe() throughout to reduce spam and log useful information in devices_deferred. Signed-off-by: Andrew Halaney Message-ID: <20230605193625.63187-1-ahalaney@redhat.com> Signed-off-by: Greg Kroah-Hartman commit 4a944da707123686d372ec01ea60056902fadf35 Author: Christophe JAILLET Date: Sun Jun 4 16:56:34 2023 +0200 usb: dwc3: qcom: Fix an error handling path in dwc3_qcom_probe() If dwc3_qcom_create_urs_usb_platdev() fails, some resources still need to be released, as already done in the other error handling path of the probe. Fixes: c25c210f590e ("usb: dwc3: qcom: add URS Host support for sdm845 ACPI boot") Signed-off-by: Christophe JAILLET Reviewed-by: Andrew Halaney Message-ID: Signed-off-by: Greg Kroah-Hartman commit 8fd95da2cfb5046c4bb5a3cdc9eb7963ba8b10dd Author: Christophe JAILLET Date: Sun Jun 4 17:04:37 2023 +0200 usb: dwc3: qcom: Release the correct resources in dwc3_qcom_remove() In the probe, some resources are allocated with dwc3_qcom_of_register_core() or dwc3_qcom_acpi_register_core(). The corresponding resources are already coorectly freed in the error handling path of the probe, but not in the remove function. Fix it. Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI") Signed-off-by: Christophe JAILLET Reviewed-by: Andrew Halaney Message-ID: Signed-off-by: Greg Kroah-Hartman commit 6b394dbb6469e438c537f84899402ffdb8fcbdbd Author: David Disseldorp Date: Wed Jun 7 23:54:02 2023 +0200 usb: gadget: f_mass_storage: remove unnecessary open check The fsg_lun_is_open() test can be eliminated and the code merged with the preceding conditional, because the LUN won't be open if cfg->filename wasn't set. Similarly, the error_lun label will never be reached with an open lun (non-null filp) so remove the unnecessary fsg_lun_close() call. Signed-off-by: David Disseldorp Reviewed-by: Alan Stern Message-ID: <20230607215401.22563-1-ddiss@suse.de> Signed-off-by: Greg Kroah-Hartman commit 5ae8a35459e77fd9ddb1844baa8c736fc0223847 Author: Avichal Rakesh Date: Fri Jun 2 15:04:55 2023 -0700 usb: gadget: uvc: clean up comments and styling in video_pump This patch elaborates on some of the edge cases handled by video_pump around setting no_interrupt flag, and brings the code style in line with rest of the file. Link: https://lore.kernel.org/20230602151916.GH26944@pendragon.ideasonboard.com/ Signed-off-by: Avichal Rakesh Reviewed-by: Laurent Pinchart Message-ID: <20230602220455.313801-1-arakesh@google.com> Signed-off-by: Greg Kroah-Hartman commit 152669f844d11513fc438bfee01d3f1bb2b2b565 Author: Piyush Mehta Date: Wed Jun 7 12:59:59 2023 +0530 usb: gadget: udc: udc-xilinx: Add identifier to read_fn function arg Add an identifier in the read_fn function declaration because based on commit ca0d8929e75a ("checkpatch: add warning for unnamed function definition arguments") it is the preferred coding style even C standard allows both formats. Signed-off-by: Piyush Mehta Message-ID: <20230607072959.2334046-1-piyush.mehta@amd.com> Signed-off-by: Greg Kroah-Hartman commit f817f271dad345833929a6180a3a637f9bcc1a76 Author: Christophe JAILLET Date: Sun Jun 4 13:11:18 2023 +0200 usb: usb251xb: Use of_property_read_u16() Use of_property_read_u16() instead of of_property_read_u16_array() when only 1 element is read. This slightly simplifies the code. Signed-off-by: Christophe JAILLET Message-ID: <97478908a814d4fa694e0ca44212c3776cf3e6e9.1685877052.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Greg Kroah-Hartman commit ffd603f214237e250271162a5b325c6199a65382 Author: Kuen-Han Tsai Date: Fri Jun 2 15:00:06 2023 +0800 usb: gadget: u_serial: Add null pointer check in gs_start_io If gs_close has cleared port->port.tty and gs_start_io is called afterwards, then the function tty_wakeup will attempt to access the value of the pointer port->port.tty which will cause a null pointer dereference error. To avoid this, add a null pointer check to gs_start_io before attempting to access the value of the pointer port->port.tty. Signed-off-by: Kuen-Han Tsai Message-ID: <20230602070009.1353946-1-khtsai@google.com> Signed-off-by: Greg Kroah-Hartman commit 0a453dc9f260281e3a063e07b526a7e494e496fe Author: Rajat Khandelwal Date: Wed May 31 16:20:50 2023 +0530 usb: typec: intel_pmc_mux: Expose IOM port status to debugfs IOM status has a crucial role during debugging to check the current state of the type-C port. There are ways to fetch the status, but all those require the IOM port status offset, which could change with platform. Make a debugfs directory for intel_pmc_mux and expose the status under it per port basis. Signed-off-by: Rajat Khandelwal Reviewed-by: Heikki Krogerus Message-ID: <20230531105050.638250-1-rajat.khandelwal@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit f5691439353783ef114876849c70d2a641e09498 Author: Manikanta Guntupalli Date: Fri Jun 9 00:12:52 2023 +0530 gpio: zynq: fix zynqmp_gpio not an immutable chip warning Make the struct irq_chip const and flag it as IRQCHIP_IMMUTABLE, call gpiochip_disable_irq() in the .irq_mask() callback and gpiochip_enable_irq() in the .irq_unmask() callback to fix "gpio gpiochip1: (zynqmp_gpio): not an immutable chip" warning. Signed-off-by: Manikanta Guntupalli Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 39db3f15194954568b626bfb8cf50910ad811bdc Author: Jonathan Corbet Date: Wed May 3 16:54:22 2023 -0600 crypto: update some Arm documentation references The Arm documentation has moved to Documentation/arch/arm; update a set of references under crypto/allwinner to match. Cc: Corentin Labbe Cc: Herbert Xu Cc: "David S. Miller" Cc: Chen-Yu Tsai Cc: Samuel Holland Acked-by: Jernej Skrabec Signed-off-by: Jonathan Corbet commit 964e6d97a3bd1336a9e4aee7317c1fa5f98ba469 Author: Jonathan Corbet Date: Wed May 3 16:53:08 2023 -0600 mips: update a reference to a moved Arm Document Arm documentation has moved to Documentation/arch/arm; update a reference in arch/mips/bmips/setup.c to match. Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Acked-by: Florian Fainelli Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Jonathan Corbet commit 8507f35447e6e51c15a7172ecc81c4219017d476 Author: Min-Hua Chen Date: Fri Jun 9 20:16:48 2023 +0800 gpio: davinci: make davinci_gpio_dev_pm_ops static This patch fixes the following sprse warnings: drivers/gpio/gpio-davinci.c:695:1: sparse: warning: symbol 'davinci_gpio_dev_pm_ops' was not declared. Should it be static? No functional change intended. Signed-off-by: Min-Hua Chen Signed-off-by: Bartosz Golaszewski commit 6b5f9a87e12d044f513a4f4c0e31ac7b5e988b66 Author: Raju Rangoju Date: Mon Jun 12 11:37:24 2023 +0530 amd-xgbe: extend 10Mbps support to MAC version 21H MAC version 21H supports the 10Mbps speed. So, extend support to platforms that support it. Acked-by: Shyam Sundar S K Reviewed-by: Sridhar Samudrala Signed-off-by: Raju Rangoju Signed-off-by: David S. Miller commit d5e234ff08a45a7a08a52173ed793b3c125ab88d Author: Weitao Wang Date: Fri Jun 2 17:40:09 2023 +0300 xhci: Add ZHAOXIN xHCI host U1/U2 feature support Add U1/U2 feature support of xHCI for ZHAOXIN. Since both INTEL and ZHAOXIN need to check the tier where the device is located to determine whether to enabled U1/U2, remove the previous INTEL U1/U2 tier policy and add common policy in xhci_check_tier_policy. If vendor has specific U1/U2 enable policy,quirks can be add to declare. Suggested-by: Mathias Nyman Signed-off-by: Weitao Wang Signed-off-by: Mathias Nyman Message-ID: <20230602144009.1225632-12-mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit d9b0328d0b8b8298dfdc97cd8e0e2371d4bcc97b Author: Weitao Wang Date: Fri Jun 2 17:40:08 2023 +0300 xhci: Show ZHAOXIN xHCI root hub speed correctly Some ZHAOXIN xHCI controllers follow usb3.1 spec, but only support gen1 speed 5Gbps. While in Linux kernel, if xHCI suspport usb3.1, root hub speed will show on 10Gbps. To fix this issue of ZHAOXIN xHCI platforms, read usb speed ID supported by xHCI to determine root hub speed. And add a quirk XHCI_ZHAOXIN_HOST for this issue. [fix warning about uninitialized symbol -Mathias] Suggested-by: Mathias Nyman Cc: stable@vger.kernel.org Signed-off-by: Weitao Wang Signed-off-by: Mathias Nyman Message-ID: <20230602144009.1225632-11-mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit 2a865a652299f5666f3b785cbe758c5f57453036 Author: Weitao Wang Date: Fri Jun 2 17:40:07 2023 +0300 xhci: Fix TRB prefetch issue of ZHAOXIN hosts On some ZHAOXIN hosts, xHCI will prefetch TRB for performance improvement. However this TRB prefetch mechanism may cross page boundary, which may access memory not allocated by xHCI driver. In order to fix this issue, two pages was allocated for a segment and only the first page will be used. And add a quirk XHCI_ZHAOXIN_TRB_FETCH for this issue. Cc: stable@vger.kernel.org Signed-off-by: Weitao Wang Signed-off-by: Mathias Nyman Message-ID: <20230602144009.1225632-10-mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit f927728186f0de1167262d6a632f9f7e96433d1a Author: Weitao Wang Date: Fri Jun 2 17:40:06 2023 +0300 xhci: Fix resume issue of some ZHAOXIN hosts On ZHAOXIN ZX-100 project, xHCI can't work normally after resume from system Sx state. To fix this issue, when resume from system Sx state, reinitialize xHCI instead of restore. So, Add XHCI_RESET_ON_RESUME quirk for ZX-100 to fix issue of resuming from system Sx state. Cc: stable@vger.kernel.org Signed-off-by: Weitao Wang Signed-off-by: Mathias Nyman Message-ID: <20230602144009.1225632-9-mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit 2710f8186f889798f7d1b87b762461a07cac56c6 Author: Mathias Nyman Date: Fri Jun 2 17:40:05 2023 +0300 xhci: Stop unnecessary tracking of free trbs in a ring Trying to keep track of free trbs in a ring by adding and subtracting deltas each time a enqueue or dequeue is increased or moved has proven to be buggy and complicated, especially over long periods of time. Recently a bug in counting free trbs was fixed, now taking into account cancelled URBs that were turned into no-ops, preventing free_trbs to slowly wander off causing unnecessary ring expansion. See commit fe82f16aafda ("xhci: Fix incorrect tracking of free space on transfer rings") Turns out its a lot easier to just calculate the numer of free TRB based on ring size and the current enqueue and dequeue pointer values. This is currently only needed for the command ring as multi segment transfer rings already ensures there is enough room the ring during the ring expansion check. We could get rid of the ring->num_trbs_free entry completely, but as the xhci DbC code also uses it we don't clean that up in this patch. Reported-by: Miller Hunter Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217242 Tested-by: Miller Hunter Signed-off-by: Mathias Nyman Message-ID: <20230602144009.1225632-8-mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit f5af638f0609af889f15c700c60b93c06cc76675 Author: Mathias Nyman Date: Fri Jun 2 17:40:04 2023 +0300 xhci: Fix transfer ring expansion size calculation The amount of new TRBs needed is calculated incorrectly when expanding a transfer ring. The room_on_ring() helper will correctly report that the ring needs expansion if the enqueue pointer is about to reach the dequeue segment. If enqueue reaches the dequeue segment then there is no easy way to expand the ring by adding new segments between enqueue and dequeue. This leads to ring expansion even if num_trbs_free is larger than num_trbs we are queueing. As a result we try to store a negative number in a unsigned int, leading to a huge percieved trb need, and doubling of ring size. Rework and rename the room_on_ring() to a helper that checks if ring needs expansion, and return number of new segments needed. Don't rely on the tracked ring->num_trbs_free value as turns out it has been unreliable. Use ring enqueue and dequeue positions to determine expansion need. The unsigned int issue was first reported first Chao zeng, and a bit later seen in a real world bug. Reported-by: chao zeng Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217242 Tested-by: Miller Hunter Signed-off-by: Mathias Nyman Message-ID: <20230602144009.1225632-7-mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit 4bf398e15aa410e25fa46a5684c7e5bf682ecc48 Author: Mathias Nyman Date: Fri Jun 2 17:40:03 2023 +0300 xhci: split allocate interrupter into separate alloacte and add parts The current function that both allocates and adds the interrupter isn't optimal when using several interrupters. The array of interrupters need to be protected with a lock while adding or removing interrupters. If memory is allocated under the default xhci spinlock then GFP_KERNEL can't be used. There is no need to allocate the interrupter memory under the lock, so split this code into separate unlocked allocate part, and a lock protected add part. Signed-off-by: Mathias Nyman Message-ID: <20230602144009.1225632-6-mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit 0a4776205b16d038ec6fedef2094951fcb6f441b Author: Mathias Nyman Date: Fri Jun 2 17:40:02 2023 +0300 xhci: get rid of XHCI_PLAT quirk that used to prevent MSI setup The XHCI_PLAT quirk was only needed to ensure non-PCI xHC host avoided setting up MSI interrupts in generic xhci codepaths. The MSI setup code is now moved to PCI specific xhci-pci.c file so the quirk is no longer needed. Remove setting the XHCI_PLAT quirk for HiSilocon SoC xHC, NVIDIA Tegra xHC, MediaTek xHC, the generic xhci-plat driver, and the checks for XHCI_PLAT in xhci-pci.c MSI setup code. Signed-off-by: Mathias Nyman Message-ID: <20230602144009.1225632-5-mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit 9b907c91aa94522ae14bf155ce7b9ccb10a0903c Author: Mathias Nyman Date: Fri Jun 2 17:40:01 2023 +0300 xhci: Don't require a valid get_quirks() function pointer during xhci setup Not all platforms drivers need to set up custom quirks during the xhci generic setup. Allow them to pass NULL as the function pointer when calling xhci_gen_setup() Signed-off-by: Mathias Nyman Message-ID: <20230602144009.1225632-4-mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit b9e43779ac9be64da453d67f550fc46c335791e1 Author: Mathias Nyman Date: Fri Jun 2 17:40:00 2023 +0300 xhci: Add usb cold attach (CAS) as a reason to resume root hub. Check for the cold attach (CAS) bit while checking for other usb3 roothub port changes during host resume. The CAS bit is set if a USB 3 device is connected while the host is suspended in such a way it can't perform proper link training and progress the link to the enabled U0 state. If the CAS bit set we want to resume the root hub, and reset and enumerate the newly connected device. Signed-off-by: Mathias Nyman Message-ID: <20230602144009.1225632-3-mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit b47ad02ff283d60e55e3e59d0e2455e3ab1812c6 Author: Udipto Goswami Date: Fri Jun 2 17:39:59 2023 +0300 usb: xhci: Remove unused udev from xhci_log_ctx trace event xhci_log_ctx event is not utilizing the extracted udev to print out anything, hence removing it. Fixes: 1d27fabec068 ("xhci: add xhci_address_ctx trace event") Signed-off-by: Udipto Goswami Signed-off-by: Mathias Nyman Message-ID: <20230602144009.1225632-2-mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman commit 285cff4c0454340a4dc53f46e67f2cb1c293bd74 Author: Nico Boehr Date: Fri Mar 24 15:54:23 2023 +0100 KVM: s390: fix KVM_S390_GET_CMMA_BITS for GFNs in memslot holes The KVM_S390_GET_CMMA_BITS ioctl may return incorrect values when userspace specifies a start_gfn outside of memslots. This can occur when a VM has multiple memslots with a hole in between: +-----+----------+--------+--------+ | ... | Slot N-1 | | Slot N | +-----+----------+--------+--------+ ^ ^ ^ ^ | | | | GFN A A+B | | A+B+C | A+B+C+D When userspace specifies a GFN in [A+B, A+B+C), it would expect to get the CMMA values of the first dirty page in Slot N. However, userspace may get a start_gfn of A+B+C+D with a count of 0, hence completely skipping over any dirty pages in slot N. The error is in kvm_s390_next_dirty_cmma(), which assumes gfn_to_memslot_approx() will return the memslot _below_ the specified GFN when the specified GFN lies outside a memslot. In reality it may return either the memslot below or above the specified GFN. When a memslot above the specified GFN is returned this happens: - ofs is calculated, but since the memslot's base_gfn is larger than the specified cur_gfn, ofs will underflow to a huge number. - ofs is passed to find_next_bit(). Since ofs will exceed the memslot's number of pages, the number of pages in the memslot is returned, completely skipping over all bits in the memslot userspace would be interested in. Fix this by resetting ofs to zero when a memslot _above_ cur_gfn is returned (cur_gfn < ms->base_gfn). Signed-off-by: Nico Boehr Reviewed-by: Claudio Imbrenda Fixes: afdad61615cc ("KVM: s390: Fix storage attributes migration with memory slots") Message-Id: <20230324145424.293889-2-nrb@linux.ibm.com> Signed-off-by: Claudio Imbrenda Signed-off-by: Janosch Frank commit 6aafa1c2d3e3fea2ebe84c018003f2a91722e607 Author: P Praneesh Date: Tue Jun 6 14:41:28 2023 +0530 wifi: ath11k: fix memory leak in WMI firmware stats Memory allocated for firmware pdev, vdev and beacon statistics are not released during rmmod. Fix it by calling ath11k_fw_stats_free() function before hardware unregister. While at it, avoid calling ath11k_fw_stats_free() while processing the firmware stats received in the WMI event because the local list is getting spliced and reinitialised and hence there are no elements in the list after splicing. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: P Praneesh Signed-off-by: Aditya Kumar Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230606091128.14202-1-quic_adisi@quicinc.com commit 4f52ec65a9aef4755f46e613e6fbfb3333bbe3db Author: Kalle Valo Date: Fri Jun 9 17:24:40 2023 +0300 wifi: ath11k: debug: add ATH11K_DBG_CE Add a new debug level for CE so that we don't need to use AHB level in ce.c. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-16-kvalo@kernel.org commit 3512593884b3b3f10e1b42cb2fe3ca8c469a8f15 Author: Kalle Valo Date: Fri Jun 9 17:24:39 2023 +0300 wifi: ath11k: htc: cleanup debug messages Cleanup HTC debug messages to follow the preferred style and try to make them more readable. Also add a few more and remove unnecessary. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-15-kvalo@kernel.org commit cf036c416e9a0a8216900f9f43c41a1815847a00 Author: Kalle Valo Date: Fri Jun 9 17:24:38 2023 +0300 wifi: ath11k: don't use %pK According to Documentation/core-api/printk-formats.rst %pK should not be used with printk(), so switch back to using just %p. printk() will hash the address so addresses are not leaked to user space. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-14-kvalo@kernel.org commit ac483942616a068da25348c473d96725226189c8 Author: Kalle Valo Date: Fri Jun 9 17:24:37 2023 +0300 wifi: ath11k: hal: cleanup debug message Fix the debug message to follow the preferred style. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-13-kvalo@kernel.org commit 06819e471f28a4f818c3abf4fb2520a2db9047d9 Author: Kalle Valo Date: Fri Jun 9 17:24:36 2023 +0300 wifi: ath11k: debug: use all upper case in ATH11k_DBG_HAL Somehow the character 'k' in ATH11k_DBG_HAL was in lower case. Change it to upper case. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-12-kvalo@kernel.org commit 947b5e22481837117a7a75bfe04a699538cad836 Author: Kalle Valo Date: Fri Jun 9 17:24:35 2023 +0300 wifi: ath11k: dp: cleanup debug message Merge the two debug messages into and fix them to follow the preferred style. Also change the log level to ATH11K_DBG_DP_TX to match the filename. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-11-kvalo@kernel.org commit 332c656289388887b2cd39a3f53fc05dcc65e310 Author: Kalle Valo Date: Fri Jun 9 17:24:34 2023 +0300 wifi: ath11k: pci: cleanup debug logging For better readability fix PCI debug messages to follow the preferred style. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-10-kvalo@kernel.org commit 00608b40ae1aea8b79d110b51784ae291af380f4 Author: Kalle Valo Date: Fri Jun 9 17:24:33 2023 +0300 wifi: ath11k: wmi: add unified command debug messages Add debug messages for every command and cleanup the existing ones to make them all follow the same style. For better readability start every message with "cmd". Print the debug message after a successful ath11k_wmi_cmd_send() call. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-9-kvalo@kernel.org commit afba35d7d12514aa1122fdfb4ca5459417656813 Author: Kalle Valo Date: Fri Jun 9 17:24:32 2023 +0300 wifi: ath11k: wmi: use common error handling style Also these functions don't follow the preferred style so fix those. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-8-kvalo@kernel.org commit 90a9fb5b6618ae070c94b2141ec5de6a2a207eae Author: Kalle Valo Date: Fri Jun 9 17:24:31 2023 +0300 wifi: ath11k: wmi: cleanup error handling in ath11k_wmi_send_init_country_cmd() The error handling doesn't follow the preferred style so fix that. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-7-kvalo@kernel.org commit 8fbeaca7a001cf6e854fceade17865c7b23b3ce2 Author: Kalle Valo Date: Fri Jun 9 17:24:30 2023 +0300 wifi: ath11k: remove unsupported event handlers Now that we have a default handler there's no need anymore to list every unsupported event id anymore, so remove that to clean this up. While at it remove the pointless todo comment and change the debug message to follow the preferred style. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-6-kvalo@kernel.org commit e5df15773d8d7b4269bc97a0378dc6d9ba400e84 Author: Kalle Valo Date: Fri Jun 9 17:24:29 2023 +0300 wifi: ath11k: add WMI event debug messages Add a debug message for every WMI event to make it easier track what's happening in WMI. For better readability start every debug message with "event". Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-5-kvalo@kernel.org commit fc3b984a7d99bcac74d10fae40fcbffce5495024 Author: Kalle Valo Date: Fri Jun 9 17:24:28 2023 +0300 wifi: ath11k: remove manual mask names from debug messages Now that the previous patch changed ath11k_dbg() to print the debug level there's no need to have the level in the actual message anymore. So remove those. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-4-kvalo@kernel.org commit 9a599e968f022e77519e5f13f421369699f95269 Author: Kalle Valo Date: Fri Jun 9 17:24:27 2023 +0300 wifi: ath11k: print debug level in debug messages To make it easier understand the context of a debug message print the debug level before the actual message. An example: [21867.231900] ath11k_pci 0000:06:00.0: wmi processed regulatory ext channel list The tracepoint call is not modified, it's better to userspace print the debug level if needed. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-3-kvalo@kernel.org commit d13936d57927574815db968f1e5f9026dade3370 Author: Kalle Valo Date: Fri Jun 9 17:24:26 2023 +0300 wifi: ath11k: debug: remove unused ATH11K_DBG_ANY It's not used anywhere so can be easily removed. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609142440.24643-2-kvalo@kernel.org commit 75086cc6dee046e3fbb3dba148b376d8802f83bc Author: Remi Pommarel Date: Fri Jun 9 11:37:44 2023 +0200 wifi: ath9k: Fix possible stall on ath9k_txq_list_has_key() On EDMA capable hardware, ath9k_txq_list_has_key() can enter infinite loop if it is called while all txq_fifos have packets that use different key that the one we are looking for. Fix it by exiting the loop if all txq_fifos have been checked already. Because this loop is called under spin_lock_bh() (see ath_txq_lock) it causes the following rcu stall: rcu: INFO: rcu_sched self-detected stall on CPU ath10k_pci 0000:01:00.0: failed to read temperature -11 rcu: 1-....: (5254 ticks this GP) idle=189/1/0x4000000000000002 softirq=8442983/8442984 fqs=2579 (t=5257 jiffies g=17983297 q=334) Task dump for CPU 1: task:hostapd state:R running task stack: 0 pid: 297 ppid: 289 flags:0x0000000a Call trace: dump_backtrace+0x0/0x170 show_stack+0x1c/0x24 sched_show_task+0x140/0x170 dump_cpu_task+0x48/0x54 rcu_dump_cpu_stacks+0xf0/0x134 rcu_sched_clock_irq+0x8d8/0x9fc update_process_times+0xa0/0xec tick_sched_timer+0x5c/0xd0 __hrtimer_run_queues+0x154/0x320 hrtimer_interrupt+0x120/0x2f0 arch_timer_handler_virt+0x38/0x44 handle_percpu_devid_irq+0x9c/0x1e0 handle_domain_irq+0x64/0x90 gic_handle_irq+0x78/0xb0 call_on_irq_stack+0x28/0x38 do_interrupt_handler+0x54/0x5c el1_interrupt+0x2c/0x4c el1h_64_irq_handler+0x14/0x1c el1h_64_irq+0x74/0x78 ath9k_txq_has_key+0x1bc/0x250 [ath9k] ath9k_set_key+0x1cc/0x3dc [ath9k] drv_set_key+0x78/0x170 ieee80211_key_replace+0x564/0x6cc ieee80211_key_link+0x174/0x220 ieee80211_add_key+0x11c/0x300 nl80211_new_key+0x12c/0x330 genl_family_rcv_msg_doit+0xbc/0x11c genl_rcv_msg+0xd8/0x1c4 netlink_rcv_skb+0x40/0x100 genl_rcv+0x3c/0x50 netlink_unicast+0x1ec/0x2c0 netlink_sendmsg+0x198/0x3c0 ____sys_sendmsg+0x210/0x250 ___sys_sendmsg+0x78/0xc4 __sys_sendmsg+0x4c/0x90 __arm64_sys_sendmsg+0x28/0x30 invoke_syscall.constprop.0+0x60/0x100 do_el0_svc+0x48/0xd0 el0_svc+0x14/0x50 el0t_64_sync_handler+0xa8/0xb0 el0t_64_sync+0x158/0x15c This rcu stall is hard to reproduce as is, but changing ATH_TXFIFO_DEPTH from 8 to 2 makes it reasonably easy to reproduce. Fixes: ca2848022c12 ("ath9k: Postpone key cache entry deletion for TXQ frames reference it") Signed-off-by: Remi Pommarel Tested-by: Nicolas Escande Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230609093744.1985-1-repk@triplefau.lt commit 15f522411c98cd3e76d92f582627edfa5fe4f3e0 Merge: c29e012eae29c e18aab0470d8f Author: David S. Miller Date: Tue Jun 13 09:54:58 2023 +0100 Merge branch 'octeontx2-updates' Naveen Mamindlapalli says: ==================== RVU NIX AF driver updates This patch series includes a few enhancements and other updates to the RVU NIX AF driver. The first patch adds devlink option to configure NPC MCAM high priority zone entries reservation. This is useful when the requester needs more high priority entries than default reserved entries. The second patch adds support for RSS hash computation using L3 SRC or DST only, or L4 SRC or DST only. The third patch updates DWRR MTU configuration for CN10KB silicon. HW uses the DWRR MTU to compute DWRR weight. Patch 4 configures the LBK link in TL3_TL2 configuration only when switch mode is enabled. Patch 5 adds an option in the mailbox request to enable/disable DROP_RE bit which drops packets with L2 errors when set. Patch 6 updates SMQ flush mechanism to stop other child nodes from enqueuing any packets while SMQ flush is active. Otherwise SMQ flush may timeout. ==================== Signed-off-by: David S. Miller commit e18aab0470d8f6259be82282ffb3fdcfeaeff6c3 Author: Naveen Mamindlapalli Date: Mon Jun 12 11:34:24 2023 +0530 octeontx2-af: Set XOFF on other child transmit schedulers during SMQ flush When multiple transmit scheduler queues feed a TL1 transmit link, the SMQ flush initiated on a low priority queue might get stuck when a high priority queue fully subscribes the transmit link. This inturn effects interface teardown. To avoid this, temporarily XOFF all TL1's other immediate child transmit scheduler queues and also clear any rate limit configuration on all the scheduler queues in SMQ(flush) hierarchy. Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 4ed6387a61fcc96f46859349b7e7696db9988ed6 Author: Nithin Dabilpuram Date: Mon Jun 12 11:34:23 2023 +0530 octeontx2-af: add option to toggle DROP_RE enable in rx cfg Add option to toggle DROP_RE bit in rx cfg mbox. This helps in modifying the config runtime as opposed to setting available via nix_lf_alloc() mbox at NIX LF init time. Signed-off-by: Nithin Dabilpuram Signed-off-by: Jerin Jacob Kollanukkaran Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Naveen Mamindlapalli Signed-off-by: David S. Miller commit b6a072a153277dc590703ada2fd1f53ecb7f8cb9 Author: Subbaraya Sundeep Date: Mon Jun 12 11:34:22 2023 +0530 octeontx2-af: Enable LBK links only when switch mode is on. Currently, all the TL3_TL2 nodes are being configured to enable switch LBK channel 63 in them. Instead enable them only when switch mode is enabled. Signed-off-by: Subbaraya Sundeep Signed-off-by: Naveen Mamindlapalli Signed-off-by: David S. Miller commit bbba125eade7916277ef694d562cc95a39e86487 Author: Sunil Goutham Date: Mon Jun 12 11:34:21 2023 +0530 octeontx2-af: cn10k: Set NIX DWRR MTU for CN10KB silicon The DWRR MTU config added for SDP and RPM/LBK links on CN10K silicon is further extended on CK10KB silicon variant and made it configurable. Now there are 4 DWRR MTU config to choose while setting transmit scheduler's RR_WEIGHT. Here we are reserving one config for each of RPM, SDP and LBK. NIXX_AF_DWRR_MTUX(0) ---> RPM NIXX_AF_DWRR_MTUX(1) ---> SDP NIXX_AF_DWRR_MTUX(2) ---> LBK PF/VF drivers can choose the DWRR_MTU to be used by setting SMQX_CFG[pkt_link_type] to one of above. TLx_SCHEDULE[RR_WEIGHT] is to be as configured 'quantum / 2^DWRR_MTUX[MTU]'. DWRR_MTU of each link is exposed to PF/VF drivers via mailbox for RR_WEIGHT calculation. Signed-off-by: Sunil Goutham Signed-off-by: Geetha sowjanya Signed-off-by: Naveen Mamindlapalli Signed-off-by: David S. Miller commit 79bc788c038c9c87224d41ba6bbab20b6bf1a141 Author: Kiran Kumar K Date: Mon Jun 12 11:34:20 2023 +0530 octeontx2-af: extend RSS supported offload types Add support to select L3 SRC or DST only, L4 SRC or DST only for RSS calculation. AF consumer may have requirement as we can select only SRC or DST data for RSS calculation in L3, L4 layers. With this requirement there will be following combinations, IPV[4,6]_SRC_ONLY, IPV[4,6]_DST_ONLY, [TCP,UDP,SCTP]_SRC_ONLY, [TCP,UDP,SCTP]_DST_ONLY. So, instead of creating a bit for each combination, we are using upper 4 bits (31:28) in the flow_key_cfg to represent the SRC, DST selection. 31 => L3_SRC, 30 => L3_DST, 29 => L4_SRC, 28 => L4_DST. These won't be part of flow_cfg, so that we don't need to change the existing ABI. Signed-off-by: Kiran Kumar K Signed-off-by: Geetha sowjanya Signed-off-by: Naveen Mamindlapalli Signed-off-by: David S. Miller commit 09de114c770fef0c8c586b4dd59431226d873387 Author: Naveen Mamindlapalli Date: Mon Jun 12 11:34:19 2023 +0530 octeontx2-af: Add devlink option to adjust mcam high prio zone entries The NPC MCAM entries are currently divided into three priority zones in AF driver: high, mid, and low. The high priority zone and low priority zone take up 1/8th (each) of the available MCAM entries, and remaining going to the mid priority zone. The current allocation scheme may not meet certain requirements, such as when a requester needs more high priority zone entries than are reserved. This patch adds a devlink configurable option to increase the number of high priority zone entries that can be allocated by requester. The max number of entries that can be reserved for high priority usage is 100% of available MCAM entries. Usage: 1) Change high priority zone percentage to 75%: devlink -p dev param set pci/0002:01:00.0 name npc_mcam_high_zone_percent \ value 75 cmode runtime 2) Read high priority zone percentage: devlink -p dev param show pci/0002:01:00.0 name npc_mcam_high_zone_percent The devlink set configuration is only permitted when no MCAM entries are assigned, i.e., all MCAM entries are free, indicating that no PF/VF driver is loaded. So user must unload/unbind PF/VF driver/devices before modifying the high priority zone percentage. Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 30d60844a0fd0bb2e0656def5358f9930ca21b95 Merge: c7eed31e235ce e6f9e590b72e1 Author: Ulf Hansson Date: Tue Jun 13 10:41:28 2023 +0200 mmc: Merge branch fixes into next Merge the mmc fixes for v6.4-rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.5. Signed-off-by: Ulf Hansson commit c29e012eae29c13f092a95f1ffab40a269fe5bc2 Author: Ido Schimmel Date: Sun Jun 11 14:22:18 2023 +0300 selftests: forwarding: Fix layer 2 miss test syntax The test currently specifies "l2_miss" as "true" / "false", but the version that eventually landed in iproute2 uses "1" / "0" [1]. Align the test accordingly. [1] https://lore.kernel.org/netdev/20230607153550.3829340-1-idosch@nvidia.com/ Fixes: 8c33266ae26a ("selftests: forwarding: Add layer 2 miss test cases") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 91ccdbb94feadb0d8bf3b35c841b33ac95f2f45f Author: Ping-Ke Shih Date: Wed Jun 7 09:27:41 2023 +0800 wifi: rtw88: add missing unwind goto for __rtw_download_firmware() This flaw is detected by smatch: drivers/net/wireless/realtek/rtw88/mac.c:748 __rtw_download_firmware() warn: missing unwind goto? Though most things of dlfw_fail have been done by download_firmware_end_flow() and wlan_cpu_enable(), an exception is that download_firmware_end_flow() clear BIT_MCUFWDL_EN bit conditionally. So, make this change to clear the bit. Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202306052310.OVhcUjZ3-lkp@intel.com/ Cc: Sascha Hauer Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230607012741.10353-1-pkshih@realtek.com commit 60be49bdf1d4ddb9e2deb7aa718d5b8bc167ee4e Author: Thomas Gleixner Date: Mon Jun 12 11:04:39 2023 +0200 MAINTAINERS: Add CPU HOTPLUG entry Document the status quo and add myself and Peter as CPU hotplug maintainers. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/87o7ll6ogo.ffs@tglx commit d0b2461678b12c08d43eaf6740485e2f2c3aeac6 Author: Rob Herring Date: Fri Jun 9 12:31:25 2023 -0600 ata: Use of_property_read_reg() to parse "reg" Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Signed-off-by: Rob Herring Reviewed-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit 58cc6133cc27496c1f041f302e13c33f0867be8a Author: Oswald Buddenhagen Date: Mon Jun 12 21:13:25 2023 +0200 ALSA: emu10k1: actually show some S/PDIF status in /proc for E-MU cards The file is called spdif-in, but we abused it to show only sample rates from various sources. Rectify it as far as possible (the FPGA doesn't give us a lot of information). Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230612191325.1315854-10-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 3ac251420be2bbc9f5e83281661dbfaf05983f69 Author: Oswald Buddenhagen Date: Mon Jun 12 21:13:24 2023 +0200 ALSA: emu10k1: add support for 12 kHz capture on Audigy Fixes a tentative FIXME. Because we can. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230612191325.1315854-9-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit ca533448a0936cd1c9f8e158af36f0657ed4d66e Author: Oswald Buddenhagen Date: Mon Jun 12 21:13:23 2023 +0200 ALSA: emu10k1: fix timer for E-MU cards at 44.1 kHz word clock The timer was presuming a fixed 48 kHz word clock, like the rest of the code. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230612191325.1315854-8-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 6cc844504638b0d1429be729b2d66be92276e24b Author: Oswald Buddenhagen Date: Mon Jun 12 21:13:22 2023 +0200 ALSA: timer: minimize open-coded access to hw.resolution Some info-querying code still used hw.resolution directly instead of calling snd_timer_hw_resolution(), thus missing a possible hw.c_resolution callback. This patch rectifies that. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230612191325.1315854-7-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit e68235c8aae9af08a868e4a4337daf2bcb4f6a92 Author: Oswald Buddenhagen Date: Mon Jun 12 21:13:21 2023 +0200 ALSA: emu10k1: fix synthesizer pitch for E-MU cards at 44.1 kHz This is only a very partial fix - the frequency-dependent envelope & LFO register values aren't adjusted. But I'm not sure they were even correct at 48 kHz to start with, as most of them are precalculated by common code which assumes an EMU8K-specific 44.1 kHz word clock, and it seems somewhat unlikely that the hardware's register interpretation was adjusted to compensate for the different word clock. In any case I'm not going to spend time on fixing that, as this code is unlikely to be actually used by anyone today. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230612191325.1315854-6-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 19b89d15fa978c7e6327287f90d1dde15aff01c4 Author: Oswald Buddenhagen Date: Mon Jun 12 21:13:20 2023 +0200 ALSA: emu10k1: fix sample rates for E-MU cards at 44.1 kHz word clock Now that we know the actual word clock, we can: - Put the resulting rate into the hardware info - At 44.1 kHz word clock shift the rate for the pitch calculations, which presume a 48 kHz word clock Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230612191325.1315854-5-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit e73b597e63ebad26d9dee5feb5d47251ed53b8a4 Author: Oswald Buddenhagen Date: Mon Jun 12 21:13:19 2023 +0200 ALSA: emu10k1: query rate of external clock sources on E-MU cards The value isn't used yet; the subsequent commits will do that. This ignores the existence of rates above 48 kHz, which is fine, as the hardware will just switch to the fallback clock source when fed with a rate which is incompatible with the base clock multiplier, which currently is always x1. The sample rate display in /proc spdif-in is adjusted to reflect our understanding of the input rates. This is tested only with an 0404b card without sync card, so there is a lot of room for improvement. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230612191325.1315854-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 60985241bfc61c6d6d85a78e0f29c866c546c7f5 Author: Oswald Buddenhagen Date: Mon Jun 12 21:13:18 2023 +0200 ALSA: emu10k1: make available E-MU clock sources card-specific The actually available clock sources depend on the available audio input ports and dedicated clock input ports. This includes refactoring the code to be data-driven to remain manageable. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230612191325.1315854-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 1359886227e52c27c0a230769f3be4c486e36299 Author: Oswald Buddenhagen Date: Mon Jun 12 21:13:17 2023 +0200 ALSA: emu10k1: split off E-MU fallback clock from clock source So far, we set the fallback as a side effect of setting the source. But the fallback makes no sense at all when an internal clock is selected. Defaulting to 48k for S/PDIF & ADAT makes sense, but as that is the global default and we're not changing it automatically any more, it's just fine to leave it entirely to the explicit setting. This changes the name of the pre-existing control to something more appropriate (regardless of the split), so users will need to adjust their mixer settings. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230612191325.1315854-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 508b662b6928808d1af3887f4adc20fb0cd315df Merge: 9b4469410cf9a febdfa0e9c8a5 Author: Takashi Iwai Date: Tue Jun 13 07:36:39 2023 +0200 Merge branch 'topic/midi20' into for-next As the updated MIDI 2.0 spec has been published freshly, this is a catch up to add the support for new specs, especially UMP v1.1 features, on Linux kernel. The new UMP v1.1 introduced the concept of Function Blocks (FB), which is a kind of superset of USB MIDI 2.0 Group Terminal Blocks (GTB). The patch set adds the support for FB as the primary information source while keeping the parse of GTB as fallback. Also UMP v1.1 supports the groupless messages, the protocol switch, static FBs, and other new fundamental features, and those are supported as well. Link: https://www.midi.org/midi-articles/details-about-midi-2-0-midi-ci-profiles-and-property-exchange Link: https://lore.kernel.org/r/20230612081054.17200-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2b8cc5858a07ab75ce98cae720e263e1c1b0d1d9 Author: Andy Shevchenko Date: Tue Jun 13 00:23:36 2023 +0300 platform/chrome: cros_ec_spi: Use %*ph for printing hexdump of a small buffer The kernel already has a helper to print a hexdump of a small buffer via pointer extension. Use that instead of open coded variant. In long term it helps to kill pr_cont() or at least narrow down its use. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230612212336.4961-1-andriy.shevchenko@linux.intel.com Signed-off-by: Tzung-Bi Shih commit 7d4e87e97382848affe0000eefef1a9b176f3b5c Merge: ccbe64be15338 c31a25e1db486 Author: Jakub Kicinski Date: Mon Jun 12 21:13:24 2023 -0700 Merge branch 'splice-net-some-miscellaneous-msg_splice_pages-changes' David Howells says: ==================== splice, net: Some miscellaneous MSG_SPLICE_PAGES changes Now that the splice_to_socket() has been rewritten so that nothing now uses the ->sendpage() file op[1], some further changes can be made, so here are some miscellaneous changes that can now be done. (1) Remove the ->sendpage() file op. (2) Remove hash_sendpage*() from AF_ALG. (3) Make sunrpc send multiple pages in single sendmsg() call rather than calling sendpage() in TCP (or maybe TLS). (4) Make tcp_bpf_sendpage() a wrapper around tcp_bpf_sendmsg(). (5) Make AF_KCM use sendmsg() when calling down to TCP and then make it send entire fragment lists in single sendmsg calls. Link: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=fd5f4d7da29218485153fd8b4c08da7fc130c79f [1] ==================== Link: https://lore.kernel.org/r/20230609100221.2620633-1-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit c31a25e1db486f36a0ffe3c849b0a82cda3db7db Author: David Howells Date: Fri Jun 9 11:02:21 2023 +0100 kcm: Send multiple frags in one sendmsg() Rewrite the AF_KCM transmission loop to send all the fragments in a single skb or frag_list-skb in one sendmsg() with MSG_SPLICE_PAGES set. The list of fragments in each skb is conveniently a bio_vec[] that can just be attached to a BVEC iter. Note: I'm working out the size of each fragment-skb by adding up bv_len for all the bio_vecs in skb->frags[] - but surely this information is recorded somewhere? For the skbs in head->frag_list, this is equal to skb->data_len, but not for the head. head->data_len includes all the tail frags too. Signed-off-by: David Howells cc: Tom Herbert cc: Tom Herbert cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 264ba53fac79b03ff754bce62da5027ee3c57b8f Author: David Howells Date: Fri Jun 9 11:02:20 2023 +0100 kcm: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage When transmitting data, call down into the transport socket using sendmsg with MSG_SPLICE_PAGES to indicate that content should be spliced rather than using sendpage. Signed-off-by: David Howells cc: Tom Herbert cc: Tom Herbert cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit de17c6857301f1f5b0e71dd064bb816d6628a91d Author: David Howells Date: Fri Jun 9 11:02:19 2023 +0100 tcp_bpf: Make tcp_bpf_sendpage() go through tcp_bpf_sendmsg(MSG_SPLICE_PAGES) Make tcp_bpf_sendpage() a wrapper around tcp_bpf_sendmsg(MSG_SPLICE_PAGES) rather than a loop calling tcp_sendpage(). sendpage() will be removed in the future. Signed-off-by: David Howells cc: John Fastabend cc: Jakub Sitnicki cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 5df5dd03a8f71ca9640f208d8f523856e1069ee7 Author: David Howells Date: Fri Jun 9 11:02:18 2023 +0100 sunrpc: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage When transmitting data, call down into TCP using sendmsg with MSG_SPLICE_PAGES to indicate that content should be spliced rather than performing sendpage calls to transmit header, data pages and trailer. Signed-off-by: David Howells Acked-by: Chuck Lever cc: Trond Myklebust cc: Anna Schumaker cc: Jeff Layton cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 345ee3e8126aa042e8b4c61ed9eca42e9334b09e Author: David Howells Date: Fri Jun 9 11:02:17 2023 +0100 algif: Remove hash_sendpage*() Remove hash_sendpage*() as nothing should now call it since the rewrite of splice_to_socket()[1]. Signed-off-by: David Howells cc: Herbert Xu cc: Jens Axboe cc: Matthew Wilcox Link: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=2dc334f1a63a8839b88483a3e73c0f27c9c1791c [1] Signed-off-by: Jakub Kicinski commit a3bbdc52c38fa95488ca713e54bcb40699c26acf Author: David Howells Date: Fri Jun 9 11:02:16 2023 +0100 Remove file->f_op->sendpage Remove file->f_op->sendpage as splicing to a socket now calls sendmsg rather than sendpage. Signed-off-by: David Howells cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 959b76a909bf520b3b2ead067db487a80d19663d Author: Max Filippov Date: Wed Jan 11 14:35:38 2023 -0800 xtensa: drop ARCH_WANT_FRAME_POINTERS ARCH_WANT_FRAME_POINTERS was enabled in the xtensa Kconfig in the commit 8f371c752154 ("xtensa: enable lockdep support"), but neither windowed nor call0 xtensa ABI need frame pointers for stack tracing. Drop ARCH_WANT_FRAME_POINTERS from the xtensa Kconfig. Drop ftrace_return_address0 definition as the generic implementation is correct. Signed-off-by: Max Filippov commit e6807b44e49aa737b4ee9fb614da3152e2ce49c0 Author: Max Filippov Date: Sun May 21 13:50:20 2023 -0700 xtensa: report trax and perf counters in cpuinfo Add 'trax' to the list of CPU features when xtensa core is configured with TRAX. Add 'perf' to the list of CPU features when xtensa core is configured with perf counters and show the number of configured perf counters. Signed-off-by: Max Filippov commit 338d9150900d39530d3b49a446ef68d28d98e377 Author: Max Filippov Date: Thu May 11 13:53:08 2023 -0700 xtensa: add asm-prototypes.h Move assembly source prototypes from xtensa_ksyms.c to asm/asm-prototypes.h, move corresponding EXPORT_SYMBOLs to the assembly sources and enable HAVE_ASM_MODVERSIONS for xtensa. Signed-off-by: Max Filippov commit 74e25376b0fea8912d85df6e53a096c51f9df9f5 Author: Max Filippov Date: Fri Jun 9 00:07:47 2023 -0700 xtensa: only build __strncpy_user with CONFIG_ARCH_HAS_STRNCPY_FROM_USER __strncpy_user is only used when CONFIG_ARCH_HAS_STRNCPY_FROM_USER is enabled so don't build the source when it's off. Signed-off-by: Max Filippov commit e7cb083891e42493d07e9e597f837ff622f892ea Author: Max Filippov Date: Thu Jun 8 21:36:37 2023 -0700 xtensa: drop bcopy implementation bcopy is not exported and there's no in-tree users of this function. Drop it. Signed-off-by: Max Filippov commit f8b09d4524125163b9db47e831f398d7c6f8b22c Author: Max Filippov Date: Thu Jun 8 21:29:58 2023 -0700 xtensa: drop EXPORT_SYMBOL for common_exception_return common_exception_return used to be referenced from the oprofile code, but since oprofile support removal in the commit a848bf1d9ef1 ("arch: xtensa: Remove CONFIG_OPROFILE support") it is no longer supposed to be used by modules. Drop EXPORT_SYMBOL for common_exception_return. Signed-off-by: Max Filippov commit fe5775f238d68ae160eb7c2a3ddbb1d7894d2c56 Author: Max Filippov Date: Thu Jun 8 19:28:52 2023 -0700 xtensa: boot-redboot: clean up Makefile Drop references to external library search directory and compiler libgcc from the link command. Use KBUILD_LDFLAGS in the link command. Signed-off-by: Max Filippov commit 752121c7ebf84c39a3e7a45c432d7fc220cbe465 Author: Max Filippov Date: Thu Jun 8 18:17:00 2023 -0700 xtensa: clean up default platform functions Drop _F macro used to define default platform functions and rewrite definitions as normal functions. Don't define separate __platform_* function and platform_* weak alias, just define a weak function. Signed-off-by: Max Filippov commit 7561dfbf3b3451957c5d3fc52f53c78e78ed3034 Author: Max Filippov Date: Wed Jun 7 08:59:38 2023 -0700 xtensa: drop platform_halt and platform_power_off Instead of using xtensa-specific platform_halt and platform_power_off callbacks use do_kernel_power_off in the machine_halt and machine_power_off and reimplement existing platform_halt and platform_power_off users with register_sys_off_handler. Drop platform_halt and platform_power_off declarations and default implementations. Signed-off-by: Max Filippov commit 11976fe2a47aa952b8fec54bc2bd54d57642f650 Author: Max Filippov Date: Tue Jun 6 18:54:10 2023 -0700 xtensa: drop platform_restart Instead of using xtensa-specific platform_restart callback use do_kernel_restart in the machine_restart implementation and reimplement existing platform_restart users with register_restart_handler. Drop platform_restart declaration and default implementation. Signed-off-by: Max Filippov commit 71a5fd7d89fb6e6071f041ba1b55837837ccddb8 Author: Max Filippov Date: Tue Jun 6 17:43:47 2023 -0700 xtensa: drop platform_heartbeat platform_heartbeat is called from the timer interrupt handler, but there may be no periodic timer interrupts on xtensa, so the frequency of platform_heartbeat calls may be unrelated to HZ. Drop the callback and reimplement its only user with a timer. Signed-off-by: Max Filippov commit f9f6ff8c5adb1b60cabc65dd830580dedeeb9aa6 Author: Max Filippov Date: Tue Jun 6 17:22:32 2023 -0700 xtensa: xt2000: drop empty platform_init platform_init doesn't do anything for xt2000, drop it. Signed-off-by: Max Filippov commit 3db7285e044144fd88a356f5b641b9cd4b231a77 Author: Bosi Zhang Date: Sat Apr 22 08:43:31 2023 +0000 clk: mediatek: fix of_iomap memory leak Smatch reports: drivers/clk/mediatek/clk-mtk.c:583 mtk_clk_simple_probe() warn: 'base' from of_iomap() not released on lines: 496. This problem was also found in linux-next. In mtk_clk_simple_probe(), base is not released when handling errors if clk_data is not existed, which may cause a leak. So free_base should be added here to release base. Fixes: c58cd0e40ffa ("clk: mediatek: Add mtk_clk_simple_probe() to simplify clock providers") Signed-off-by: Bosi Zhang Reviewed-by: Dongliang Mu Link: https://lore.kernel.org/r/20230422084331.47198-1-u201911157@hust.edu.cn Signed-off-by: Stephen Boyd commit 18eb864f1a2df1956a2829edd58d5d9e9e73bc19 Author: Runyang Chen Date: Thu May 25 15:50:11 2023 +0800 clk: mediatek: reset: add infra_ao reset support for MT8188 The infra_ao reset is needed for MT8188. - Add mtk_clk_rst_desc for MT8188. - Add register reset controller function for MT8188 infra_ao. - Add infra_ao_idx_map for MT8188. Signed-off-by: Runyang Chen Link: https://lore.kernel.org/r/20230525075011.7032-3-runyang.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit c917dd96fe41c2fb2a4b606372bf64ec5661f509 Author: Keith Busch Date: Tue May 30 08:18:20 2023 -0700 nvme: skip optional id ctrl csi if it failed A frequently recieved report is the driver requests the optional Command Set Specific Identify Controller structure. Some controllers report this in their error log, which tiggers other warnings to user space monitoring the devices. These error entries are harmless and of questionable value to save in the log, but let's reduce their occurance by not resending the command if it previously failed. This will not prevent the errors on the initial module load, but will greatly reduce their occurance on any rescans and resumes from suspend. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217445 Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 2cf4ec53446fa5ab6f860b10a4d825311c40518d Author: Runyang Chen Date: Thu May 25 15:50:10 2023 +0800 dt-bindings: reset: mt8188: add thermal reset control bit To support reset of infra_ao, add the index of infra_ao reset of thermal for MT8188. Signed-off-by: Runyang Chen Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230525075011.7032-2-runyang.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit f235f6ae59e5060af6d924038348f94a6348ee8d Author: AngeloGioacchino Del Regno Date: Tue May 16 15:52:05 2023 +0200 clk: mediatek: Remove CLK_SET_PARENT from all MSDC core clocks Various MSDC core clocks, used for multiple MSDC controller instances, share the same parent(s): in order to add parents selection in the mtk-sd driver to achieve an accurate clock rate for all modes, remove the CLK_SET_RATE_PARENT flag from all MSDC clocks for all SoCs: this will make sure that a clk_set_rate() call performed for a clock on a secondary controller will not change the rate of a common parent, which would result in an overclock or underclock of one of the controllers. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Reviewed-by: Markus Schneider-Pargmann Link: https://lore.kernel.org/r/20230516135205.372951-3-angelogioacchino.delregno@collabora.com Tested-by: Alexandre Mergnat Reviewed-by: Alexandre Mergnat Signed-off-by: Stephen Boyd commit 1775790eff4a8fa885db189c75f4ce98e7a6a1dc Author: AngeloGioacchino Del Regno Date: Tue May 16 15:52:04 2023 +0200 clk: mediatek: mux: Stop forcing CLK_SET_RATE_PARENT flag The clk-mux driver was forcing the CLK_SET_RATE_PARENT flag even for the GATE_CLK_SET_UPD_FLAGS() macro, as in mtk_clk_register_mux() the flag was unconditionally added. In preparation for a change on MSDC clock muxes, stop forcing this flag and, where necessary, update clock drivers to add it so that with this commit we introduce no functional changes for the currently supported SoCs. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Reviewed-by: Markus Schneider-Pargmann Link: https://lore.kernel.org/r/20230516135205.372951-2-angelogioacchino.delregno@collabora.com Tested-by: Alexandre Mergnat Reviewed-by: Alexandre Mergnat Signed-off-by: Stephen Boyd commit 16d4f5378d964c20be1ecce17341b5c81a1eef88 Author: Uwe Kleine-König Date: Fri May 26 08:09:55 2023 +0200 clk: si521xx: Switch i2c driver back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230526060955.1130253-1-u.kleine-koenig@pengutronix.de Signed-off-by: Stephen Boyd commit b294349993716ca67c8bd2183c7d43c28df481fc Author: Christoph Hellwig Date: Mon Jun 12 18:09:23 2023 -0700 xfs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file systems can just set the FMODE_CAN_ODIRECT flag at open time instead of wiring up a dummy direct_IO method to indicate support for direct I/O. Do that for xfs so that noop_direct_IO can eventually be removed. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 61d7e8274cd84f574e686b24048ebf29bac861cc Author: Darrick J. Wong Date: Mon Jun 12 18:09:04 2023 -0700 xfs: drop EXPERIMENTAL tag for large extent counts This feature has been baking in upstream for ~10mo with no bug reports. It seems to work fine here, let's get rid of the scary warnings? Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 06f3ef6e1705612b88aa0b6991e2ac3b8ed3f8ec Author: Darrick J. Wong Date: Mon Jun 12 18:09:04 2023 -0700 xfs: don't deplete the reserve pool when trying to shrink the fs Every now and then, xfs/168 fails with this logged in dmesg: Reserve blocks depleted! Consider increasing reserve pool size. EXPERIMENTAL online shrink feature in use. Use at your own risk! Per-AG reservation for AG 1 failed. Filesystem may run out of space. Per-AG reservation for AG 1 failed. Filesystem may run out of space. Error -28 reserving per-AG metadata reserve pool. Corruption of in-memory data (0x8) detected at xfs_ag_shrink_space+0x23c/0x3b0 [xfs] (fs/xfs/libxfs/xfs_ag.c:1007). Shutting down filesystem. It's silly to deplete the reserved blocks pool just to shrink the filesystem, particularly since the fs goes down after that. Fixes: fb2fc1720185 ("xfs: support shrinking unused space in the last AG") Signed-off-by: Darrick J. Wong commit d15b8c76c964e882593365a5d1b4b924c945b90e Author: Arnaldo Carvalho de Melo Date: Mon Jun 12 21:56:09 2023 -0300 perf pfm: Remove duplicate util/cpumap.h include Fixes: d1f1cecc92ae0dba ("perf list: Check if libpfm4 event is supported") Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202306110636.2sTsiAcl-lkp@intel.com/ Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 103b3d2f94732fb1bc796e68e4cdfbcd731bbeaa Author: Namhyung Kim Date: Mon Jun 12 16:00:26 2023 -0700 perf annotate: Allow whitespace between insn operands The llvm-objdump adds a space between the operands while GNU objdump does not. Allow a space to handle the both. In GNU objdump: Disassembly of section .text: here | ffffffff81000000 <_stext>: v ffffffff81000000: 48 8d 25 51 1f 40 01 lea 0x1401f51(%rip),%rsp ffffffff81000007: e8 d4 00 00 00 call ffffffff810000e0 ffffffff8100000c: 48 8d 3d ed ff ff ff lea -0x13(%rip),%rdi In llvm-objdump: Disassembly of section .text: here | ffffffff81000000 : v ffffffff81000000: 48 8d 25 51 1f 40 01 leaq 20979537(%rip), %rsp ffffffff81000007: e8 d4 00 00 00 callq 0xffffffff810000e0 ffffffff8100000c: 48 8d 3d ed ff ff ff leaq -19(%rip), %rdi Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230612230026.3887586-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ccbe64be1533878f1dd3e7e28cfc33db60361bca Merge: 3a2cb45ca0ccb 1668a55a73f5a Author: Jakub Kicinski Date: Mon Jun 12 17:01:47 2023 -0700 Merge branch 'net-flower-add-cfm-support' Zahari Doychev says: ==================== net: flower: add cfm support The first patch adds cfm support to the flow dissector. The second adds the flower classifier support. The third adds a selftest for the flower cfm functionality. ==================== Link: https://lore.kernel.org/r/20230608105648.266575-1-zahari.doychev@linux.com Signed-off-by: Jakub Kicinski commit 1668a55a73f5a3ddde1019695223eed8e23b9436 Author: Zahari Doychev Date: Thu Jun 8 12:56:48 2023 +0200 selftests: net: add tc flower cfm test New cfm flower test case is added to the net forwarding selfttests. Example output: # ./tc_flower_cfm.sh p1 p2 TEST: CFM opcode match test [ OK ] TEST: CFM level match test [ OK ] TEST: CFM opcode and level match test [ OK ] Signed-off-by: Zahari Doychev Reviewed-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 7cfffd5fed3e385010583840402f0bf66c4ed147 Author: Zahari Doychev Date: Thu Jun 8 12:56:47 2023 +0200 net: flower: add support for matching cfm fields Add support to the tc flower classifier to match based on fields in CFM information elements like level and opcode. tc filter add dev ens6 ingress protocol 802.1q \ flower vlan_id 698 vlan_ethtype 0x8902 cfm mdl 5 op 46 \ action drop Signed-off-by: Zahari Doychev Reviewed-by: Simon Horman Reviewed-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit d7ad70b5ef5ab8dedaa403e0e5c711ca1aa8cb14 Author: Zahari Doychev Date: Thu Jun 8 12:56:46 2023 +0200 net: flow_dissector: add support for cfm packets Add support for dissecting cfm packets. The cfm packet header fields maintenance domain level and opcode can be dissected. Signed-off-by: Zahari Doychev Reviewed-by: Simon Horman Reviewed-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit d2e3115d717197cb2bc020dd1f06b06538474ac3 Author: Gary Guo Date: Wed May 31 17:44:50 2023 +0000 rust: error: `impl Debug` for `Error` with `errname()` integration Integrate the `Error` type with `errname()` by providing a new `name()` method. Then, implement `Debug` for the type using the new method. [ Miguel: under `CONFIG_SYMBOLIC_ERRNAME=n`, `errname()` is a `static inline`, so added a helper to support that case, like we had in the `rust` branch. Also moved `#include` up and reworded commit message for clarity. ] Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Co-developed-by: Sven Van Asbroeck Signed-off-by: Sven Van Asbroeck Signed-off-by: Gary Guo Signed-off-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Link: https://lore.kernel.org/r/20230531174450.3733220-1-aliceryhl@google.com Signed-off-by: Miguel Ojeda commit ad744e8cb346743dd76425942910c7b75a782ed0 Author: Marc Zyngier Date: Fri Jun 9 17:21:59 2023 +0100 arm64: Allow arm64_sw.hvhe on command line Add the arm64_sw.hvhe=1 option to force the use of the hVHE mode in the hypervisor code only. This enables the hVHE mode of operation when using KVM on VHE hardware. Signed-off-by: Marc Zyngier Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230609162200.2024064-17-maz@kernel.org Signed-off-by: Oliver Upton commit 38cba55008e5fab9181302ea5daf79e2070c9998 Author: Marc Zyngier Date: Fri Jun 9 17:21:58 2023 +0100 KVM: arm64: Force HCR_E2H in guest context when ARM64_KVM_HVHE is set Also make sure HCR_EL2.E2H is set when switching HCR_EL2 in guest context. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230609162200.2024064-16-maz@kernel.org Signed-off-by: Oliver Upton commit aca18585db4fd0ed0bd7420eddcdc39a535194fe Author: Marc Zyngier Date: Fri Jun 9 17:21:57 2023 +0100 KVM: arm64: Program the timer traps with VHE layout in hVHE mode Just like the rest of the timer code, we need to shift the enable bits around when HCR_EL2.E2H is set, which is the case in hVHE mode. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230609162200.2024064-15-maz@kernel.org Signed-off-by: Oliver Upton commit 75c76ab5a641b64e872b6e136b5edf8a72009cc6 Author: Marc Zyngier Date: Fri Jun 9 17:21:56 2023 +0100 KVM: arm64: Rework CPTR_EL2 programming for HVHE configuration Just like we repainted the early arm64 code, we need to update the CPTR_EL2 accesses that are taking place in the nVHE code when hVHE is used, making them look as if they were CPACR_EL1 accesses. Just like the VHE code. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230609162200.2024064-14-maz@kernel.org Signed-off-by: Oliver Upton commit 6537565fd9b7f169cda025482f6de2646cf7b60a Author: Marc Zyngier Date: Fri Jun 9 17:21:55 2023 +0100 KVM: arm64: Adjust EL2 stage-1 leaf AP bits when ARM64_KVM_HVHE is set El2 stage-1 page-table format is subtly (and annoyingly) different when HCR_EL2.E2H is set. Take the ARM64_KVM_HVHE configuration into account when setting the AP bits. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230609162200.2024064-13-maz@kernel.org Signed-off-by: Oliver Upton commit cff3b5cf96edbb9e7448bca6261871272922a0df Author: Marc Zyngier Date: Fri Jun 9 17:21:54 2023 +0100 KVM: arm64: Disable TTBR1_EL2 when using ARM64_KVM_HVHE When using hVHE, we end-up with two TTBRs at EL2. That's great, but we're not quite ready for this just yet. Disable TTBR1_EL2 by setting TCR_EL2.EPD1 so that we only translate via TTBR0_EL2. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230609162200.2024064-12-maz@kernel.org Signed-off-by: Oliver Upton commit d0daf5a21e635057e87cc05d6bca012157aa3ab7 Author: Marc Zyngier Date: Fri Jun 9 17:21:53 2023 +0100 KVM: arm64: Force HCR_EL2.E2H when ARM64_KVM_HVHE is set Obviously, in order to be able to use VHE whilst at EL2, we need to set HCR_EL2.E2H. Do so when ARM64_KVM_HVHE is set. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230609162200.2024064-11-maz@kernel.org Signed-off-by: Oliver Upton commit 6f617d3aa643e4ed6929f5b582759f4a73804034 Author: Marc Zyngier Date: Fri Jun 9 17:21:52 2023 +0100 KVM: arm64: Key use of VHE instructions in nVHE code off ARM64_KVM_HVHE We can now start with the fun stuff: if we enable VHE *only* for the hypervisor, we need to generate the VHE instructions when accessing the system registers. For this, reporpose the alternative sequence to be keyed off ARM64_KVM_HVHE in the nVHE hypervisor code, and only there. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230609162200.2024064-10-maz@kernel.org Signed-off-by: Oliver Upton commit 57e784b4079e9499ea1bafd56a0d422252aa2401 Author: Marc Zyngier Date: Fri Jun 9 17:21:51 2023 +0100 KVM: arm64: Remove alternatives from sysreg accessors in VHE hypervisor context In the VHE hypervisor code, we should be using the remapped VHE accessors, no ifs, no buts. No need to generate any alternative. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230609162200.2024064-9-maz@kernel.org Signed-off-by: Oliver Upton commit 659803aef48b1a43bf47c6b105f5e3cee6a1501c Author: Marc Zyngier Date: Fri Jun 9 17:21:50 2023 +0100 arm64: Use CPACR_EL1 format to set CPTR_EL2 when E2H is set When HCR_EL2.E2H is set, the CPTR_EL2 register takes the CPACR_EL1 format. Yes, this is good fun. Hack the bits of startup code that assume E2H=0 while setting up CPTR_EL2 to make them grok the CPTR_EL1 format. Signed-off-by: Marc Zyngier Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230609162200.2024064-8-maz@kernel.org Signed-off-by: Oliver Upton commit 9e7462bbe00d8431694720804a50b8f48d8ed0b0 Author: Marc Zyngier Date: Fri Jun 9 17:21:49 2023 +0100 arm64: Allow EL1 physical timer access when running VHE To initialise the timer access from EL2 when HCR_EL2.E2H is set, we must make use the CNTHCTL_EL2 formap used is appropriate. This amounts to shifting the timer/counter enable bits by 10 to the left. Signed-off-by: Marc Zyngier Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230609162200.2024064-7-maz@kernel.org Signed-off-by: Oliver Upton commit 7a26e1f51e3c26a1b4a1f087e2056f1554365682 Author: Marc Zyngier Date: Fri Jun 9 17:21:48 2023 +0100 arm64: Don't enable VHE for the kernel if OVERRIDE_HVHE is set If the OVERRIDE_HVHE SW override is set (as a precursor of the KVM_HVHE capability), do not enable VHE for the kernel and drop to EL1 as if VHE was either disabled or unavailable. Further changes will enable VHE at EL2 only, with the kernel still running at EL1. Signed-off-by: Marc Zyngier Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230609162200.2024064-6-maz@kernel.org Signed-off-by: Oliver Upton commit e2d6c906f0ac69559da887c0a2c3c10070e746c5 Author: Marc Zyngier Date: Fri Jun 9 17:21:47 2023 +0100 arm64: Add KVM_HVHE capability and has_hvhe() predicate Expose a capability keying the hVHE feature as well as a new predicate testing it. Nothing is so far using it, and nothing is enabling it yet. Signed-off-by: Marc Zyngier Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230609162200.2024064-5-maz@kernel.org Signed-off-by: Oliver Upton commit 0ddc312b7c73049d982d173fee4c5dabf1727ebb Author: Marc Zyngier Date: Fri Jun 9 17:21:46 2023 +0100 arm64: Turn kaslr_feature_override into a generic SW feature override Disabling KASLR from the command line is implemented as a feature override. Repaint it slightly so that it can further be used as more generic infrastructure for SW override purposes. Signed-off-by: Marc Zyngier Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230609162200.2024064-4-maz@kernel.org Signed-off-by: Oliver Upton commit 35230be87ec6147c20e7433ab9d41e2fd2664631 Author: Marc Zyngier Date: Fri Jun 9 17:21:45 2023 +0100 arm64: Prevent the use of is_kernel_in_hyp_mode() in hypervisor code Using is_kernel_in_hyp_mode() in hypervisor code is a pretty bad mistake. This helper only checks for CurrentEL being EL2, which is always true. Make the compilation fail if using the helper in hypervisor context Whilst we're at it, flag the helper as __always_inline, which it really should be. Signed-off-by: Marc Zyngier Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20230609162200.2024064-3-maz@kernel.org Signed-off-by: Oliver Upton commit c4b9fd2ac035a55d1fd98322f4360c9d07530597 Author: Marc Zyngier Date: Fri Jun 9 17:21:44 2023 +0100 KVM: arm64: Drop is_kernel_in_hyp_mode() from __invalidate_icache_guest_page() It is pretty obvious that is_kernel_in_hyp_mode() doesn't make much sense in the hypervisor part of KVM, and should be reserved to the kernel side. However, mem_protect.c::invalidate_icache_guest_page() calls into __invalidate_icache_guest_page(), which uses is_kernel_in_hyp_mode(). Given that this is part of the pKVM side of the hypervisor, this helper can only return true. Nothing goes really bad, but __invalidate_icache_guest_page() could spell out what the actual check is: we cannot invalidate the cache if the i-cache is VPIPT and we're running at EL1. Drop the is_kernel_in_hyp_mode() check for an explicit check against CurrentEL being EL1 or not. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230609162200.2024064-2-maz@kernel.org Signed-off-by: Oliver Upton commit 7244720ac137e3193db11b009fc33c0dd4e999c9 Author: Srinivas Pandruvada Date: Mon Jun 12 16:10:37 2023 -0700 tools/power/x86/intel-speed-select: v1.16 release This version addresses issues with core power configuration for non CPU dies. Also address issue with JSON formatting of output. Signed-off-by: Srinivas Pandruvada commit d86cde6e335fa442c6b0866562140a2bef25402a Author: Jing Zhang Date: Fri Jun 9 19:00:48 2023 +0000 KVM: arm64: Reuse fields of sys_reg_desc for idreg sys_reg_desc::{reset, val} are presently unused for ID register descriptors. Repurpose these fields to support user-configurable ID registers. Use the ::reset() function pointer to return the sanitised value of a given ID register, optionally with KVM-specific feature sanitisation. Additionally, keep a mask of writable register fields in ::val. Signed-off-by: Jing Zhang Link: https://lore.kernel.org/r/20230609190054.1542113-6-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit f90f9360c3d7fbb731732fbb9a1228f55d178e10 Author: Oliver Upton Date: Fri Jun 9 19:00:47 2023 +0000 KVM: arm64: Rewrite IMPDEF PMU version as NI KVM allows userspace to write an IMPDEF PMU version to the corresponding 32bit and 64bit ID register fields for the sake of backwards compatibility with kernels that lacked commit 3d0dba5764b9 ("KVM: arm64: PMU: Move the ID_AA64DFR0_EL1.PMUver limit to VM creation"). Plumbing that IMPDEF PMU version through to the gues is getting in the way of progress, and really doesn't any sense in the first place. Bite the bullet and reinterpret the IMPDEF PMU version as NI (0) for userspace writes. Additionally, spill the dirty details into a comment. Link: https://lore.kernel.org/r/20230609190054.1542113-5-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 2251e9ff1573a266102f40e507f0b8dc5861f3e4 Author: Oliver Upton Date: Fri Jun 9 19:00:46 2023 +0000 KVM: arm64: Make vCPU feature flags consistent VM-wide To date KVM has allowed userspace to construct asymmetric VMs where particular features may only be supported on a subset of vCPUs. This wasn't really the intened usage pattern, and it is a total pain in the ass to keep working in the kernel. What's more, this is at odds with CPU features in host userspace, where asymmetric features are largely hidden or disabled. It's time to put an end to the whole game. Require all vCPUs in the VM to have the same feature set, rejecting deviants in the KVM_ARM_VCPU_INIT ioctl. Preserve some of the vestiges of per-vCPU feature flags in case we need to reinstate the old behavior for some limited configurations. Yes, this is a sign of cowardice around a user-visibile change. Hoist all of the 32-bit limitations into kvm_vcpu_init_check_features() to avoid nested attempts to acquire the config_lock, which won't end well. Link: https://lore.kernel.org/r/20230609190054.1542113-4-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit e3c1c0cae31ec9ebfdffeaa2c86ddeba6cf5c74c Author: Oliver Upton Date: Fri Jun 9 19:00:45 2023 +0000 KVM: arm64: Relax invariance of KVM_ARM_VCPU_POWER_OFF Allow the value of KVM_ARM_VCPU_POWER_OFF to differ between calls to KVM_ARM_VCPU_INIT. Userspace can already change the state of the vCPU through the KVM_SET_MP_STATE ioctl, so making the bit invariant seems needlessly restrictive. Link: https://lore.kernel.org/r/20230609190054.1542113-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit a7a2c72ae01483d3923b18ee18c8007de2bc5e20 Author: Oliver Upton Date: Fri Jun 9 19:00:44 2023 +0000 KVM: arm64: Separate out feature sanitisation and initialisation kvm_vcpu_set_target() iteratively sanitises and copies feature flags in one go. This is rather odd, especially considering the fact that bitmap accessors can do the heavy lifting. A subsequent change will make vCPU features VM-wide, and fitting that into the present implementation is just a chore. Rework the whole thing to use bitmap accessors to sanitise and copy flags. Link: https://lore.kernel.org/r/20230609190054.1542113-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit fcf127839e6a37bfb0f3ac102c8bc7988f627df2 Author: Srinivas Pandruvada Date: Mon May 22 12:55:24 2023 -0700 tools/power/x86/intel-speed-select: Fix json formatting issue Fix two issues related to JSON formatting: 1. intel-speed-select -f json -o cp.out -c 1 core-power assoc -c 1 Intel(R) Speed Select Technology Executing on CPU model:143[0x8f] [root@spr-bkc bin]# cat cp.out | jq . "package-0:die-0:cpu-1" 2. intel-speed-select -f json -o tf.out turbo-freq enable -a Intel(R) Speed Select Technology Executing on CPU model:143[0x8f] [root@spr-bkc bin]# cat tf.out | jq . { "package-0:die-0:cpu-0": { "turbo-freq": { "enable": "success" } }, "package-1:die-0:cpu-48": { "turbo-freq": { "enable": "success" } } } "turbo-freq --auto" parse error: Expected string key before ':' at line 17, column 24 Both of these issues needed proper closing "}" for JSON. Signed-off-by: Srinivas Pandruvada commit 4ebde55b7de1a25a9e20ae91e42157798ef8e958 Author: Srinivas Pandruvada Date: Thu May 18 09:49:35 2023 -0700 tools/power/x86/intel-speed-select: Adjust scope of core-power config When core-power configuration or enabled is modified, this is only done for compute dies. But the config must also be set to cores with no CPUs. Without this the configuration is not affective. On displaying config information, allow display for non compute dies also. Signed-off-by: Srinivas Pandruvada commit 8cd0d8633e2de4e6dd9ddae7980432e726220fdb Author: Mark Brown Date: Sat Jun 10 15:27:55 2023 +0100 selftests/ftace: Fix KTAP output ordering The KTAP parser I used to test the KTAP output for ftracetest was overly robust and did not notice that the test number and pass/fail result were reversed. Fix this. Fixes: dbcf76390eb9 ("selftests/ftrace: Improve integration with kselftest runner") Signed-off-by: Mark Brown Acked-by: Masami Hiramatsu (Google) Acked-by: Steven Rostedt (Google) Signed-off-by: Shuah Khan commit 1e2c44992788886e536b52c1bf9d77eeb6e5969d Author: Mark Brown Date: Tue Jun 6 15:11:49 2023 +0100 selftests/cpufreq: Don't enable generic lock debugging options Currently the the config fragment for cpufreq enables a lot of generic lock debugging. While these options are useful when testing cpufreq they aren't actually required to run the tests and are therefore out of scope for the cpufreq fragement, they are more of a thing that it's good to enable while doing testing than an actual requirement for cpufreq testing specifically. Having these debugging options enabled, especially the mutex and spinlock instrumentation, mean that any build that includes the cpufreq fragment is both very much larger than a standard defconfig (eg, I'm seeing 35% on x86_64) and also slower at runtime. This is causing real problems for CI systems. In order to avoid building large numbers of kernels they try to group kselftest fragments together, frequently just grouping all the kselftest fragments into a single block. The increased size is an issue for memory constrained systems and is also problematic for systems with fixed storage allocations for kernel images (eg, typical u-boot systems) where it frequently causes the kernel to overflow the storage space allocated for kernels. The reduced performance isn't too bad with real hardware but can be disruptive on emulated platforms. In order to avoid these issues remove these generic instrumentation options from the cpufreq fragment, bringing the cpufreq fragment into line with other fragments which generally set requirements for testing rather than nice to haves. Signed-off-by: Mark Brown Acked-by: Viresh Kumar Signed-off-by: Shuah Khan commit 301d6815cdb3c5de9159d4564cb27e56c6cebd0b Author: Rishabh Bhatnagar Date: Thu Jun 1 21:11:12 2023 +0000 kselftests: Sort the collections list to avoid duplicate tests If the collections list is not sorted uniq doesn't weed out duplicate tests correctly. Make sure to sort it before running uniq. Signed-off-by: Rishabh Bhatnagar Signed-off-by: Shuah Khan commit bcda4c863efdd038c4f8ade63ff435ed663cc286 Author: Ziqi Zhao Date: Tue May 23 23:22:07 2023 +0000 selftest: pidfd: Omit long and repeating outputs An output message: > # # waitpid WEXITSTATUS=0 will be printed for 30,000+ times in the `pidfd_test` selftest, which does not seem ideal. This patch removes the print logic in the `wait_for_pid` function, so each call to this function does not output a line by default. Any existing call sites where the extra line might be beneficial have been modified to include extra print statements outside of the function calls. Signed-off-by: Ziqi Zhao Reviewed-by: Christian Brauner Signed-off-by: Shuah Khan commit f6a01213e3f812b645cd1079167bf47fc45bb0c8 Author: Luis Chamberlain Date: Fri Apr 14 12:38:45 2023 -0700 selftests: allow runners to override the timeout The default timeout for selftests tests is 45 seconds. Although we already have 13 settings for tests of about 96 sefltests which use a timeout greater than this, we want to try to avoid encouraging more tests to forcing a higher test timeout as selftests strives to run all tests quickly. Selftests also uses the timeout as a non-fatal error. Only tests runners which have control over a system would know if to treat a timeout as fatal or not. To help with all this: o Enhance documentation to avoid future increases of insane timeouts o Add the option to allow overriding the default timeout with test runners with a command line option Suggested-by: Shuah Khan Signed-off-by: Luis Chamberlain Reviewed-by: Muhammad Usama Anjum Tested-by:Muhammad Usama Anjum Signed-off-by: Shuah Khan commit 1977ecea8c75547a35fdab8827937eb2dc6048be Author: Akanksha J N Date: Fri Apr 28 22:08:42 2023 +0530 selftests/ftrace: Add new test case which checks for optimized probes Add new test case kprobe_opt_types.tc which enables and checks if each probe has been optimized in order to test potential issues with optimized probes. The '|| continue' is added with the echo statement to ignore errors that are caused by trying to add kprobes to non probeable lines and continue with the test. Signed-off-by: Akanksha J N Acked-by: Masami Hiramatsu (Google) Acked-by: Shuah Khan Acked-by: Steven Rostedt (Google) Signed-off-by: Shuah Khan commit c4f461a113ec3a523a0b5b35ed9ebd90d4145672 Author: Tobias Klauser Date: Thu May 4 10:59:30 2023 +0200 selftests/clone3: test clone3 with exit signal in flags Verify that calling clone3 with an exit signal (SIGCHLD) in flags will fail. Signed-off-by: Tobias Klauser Reviewed-by: Christian Brauner Signed-off-by: Shuah Khan commit 375b9ff53cb6f9c042817b75f2be0a650626dc4f Author: Colin Ian King Date: Mon Apr 17 11:47:43 2023 +0100 kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined In the unlikely case that CLOCK_REALTIME is not defined, variable ret is not initialized and further accumulation of return values to ret can leave ret in an undefined state. Fix this by initialized ret to zero and changing the assignment of ret to an accumulation for the CLOCK_REALTIME case. Fixes: 03f55c7952c9 ("kselftest: Extend vDSO selftest to clock_getres") Signed-off-by: Colin Ian King Reviewed-by: Vincenzo Frascino Signed-off-by: Shuah Khan commit 17cb2f17ed50d55ca4598b3cfa58fbc3bf019280 Author: Colin Ian King Date: Wed Mar 29 10:34:12 2023 +0100 selftests: prctl: Fix spelling mistake "anonynous" -> "anonymous" There is a spelling mistake in an log message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Shuah Khan commit e42bf3cfedec2bd759976ad202f8383ef8f17473 Author: Ivan Orlov Date: Thu Apr 6 00:04:50 2023 +0400 selftests: media_tests: Add new subtest to video_device_test Add new subtest to video_device_test to cover the VIDIOC_G_PRIORITY and VIDIOC_S_PRIORITY ioctl calls. This test tries to set the priority associated with the file descriptior via ioctl VIDIOC_S_PRIORITY command from V4L2 API. After that, the test tries to get the new priority via VIDIOC_G_PRIORITY ioctl command and compares the result with the v4l2_priority it set before. At the end, the test restores the old priority. This test will increase the code coverage for video_device_test, so I think it might be useful. Additionally, this patch will refactor the video_device_test a little bit, according to the new functionality. Signed-off-by: Ivan Orlov Signed-off-by: Shuah Khan commit 25085b4e9251c77758964a8e8651338972353642 Author: David Vernet Date: Fri Jun 9 22:50:53 2023 -0500 bpf/docs: Update documentation for new cpumask kfuncs We recently added the bpf_cpumask_first_and() kfunc, and changed bpf_cpumask_any() / bpf_cpumask_any_and() to bpf_cpumask_any_distribute() and bpf_cpumask_any_distribute_and() respectively. This patch adds an entry for the bpf_cpumask_first_and() kfunc, and updates the documentation for the *any* kfuncs to the new names. Signed-off-by: David Vernet Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230610035053.117605-5-void@manifault.com Signed-off-by: Alexei Starovoitov commit 5a73efc7d1b4b48ccb74fb399a818dfbd2250c89 Author: David Vernet Date: Fri Jun 9 22:50:52 2023 -0500 selftests/bpf: Update bpf_cpumask_any* tests to use bpf_cpumask_any_distribute* In a prior patch, we removed the bpf_cpumask_any() and bpf_cpumask_any_and() kfuncs, and replaced them with bpf_cpumask_any_distribute() and bpf_cpumask_any_distribute_and(). The advertised semantics between the two kfuncs were identical, with the former always returning the first CPU, and the latter actually returning any CPU. This patch updates the selftests for these kfuncs to use the new names. Signed-off-by: David Vernet Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230610035053.117605-4-void@manifault.com Signed-off-by: Alexei Starovoitov commit f983be917332ea5e03f689e12c6668be48cb4cfe Author: David Vernet Date: Fri Jun 9 22:50:51 2023 -0500 bpf: Replace bpf_cpumask_any* with bpf_cpumask_any_distribute* We currently export the bpf_cpumask_any() and bpf_cpumask_any_and() kfuncs. Intuitively, one would expect these to choose any CPU in the cpumask, but what they actually do is alias to cpumask_first() and cpmkas_first_and(). This is useless given that we already export bpf_cpumask_first() and bpf_cpumask_first_and(), so this patch replaces them with kfuncs that call cpumask_any_distribute() and cpumask_any_and_distribute(), which actually choose any CPU from the cpumask (or the AND of two cpumasks for the latter). Signed-off-by: David Vernet Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230610035053.117605-3-void@manifault.com Signed-off-by: Alexei Starovoitov commit 58476d8a24bd94b96ac1ab78baba8af1cc89fbeb Author: David Vernet Date: Fri Jun 9 22:50:50 2023 -0500 selftests/bpf: Add test for new bpf_cpumask_first_and() kfunc A prior patch added a new kfunc called bpf_cpumask_first_and() which wraps cpumask_first_and(). This patch adds a selftest to validate its behavior. Signed-off-by: David Vernet Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230610035053.117605-2-void@manifault.com Signed-off-by: Alexei Starovoitov commit 5ba3a7a851e3ebffc4cb8f052a4581c4d8af3ae3 Author: David Vernet Date: Fri Jun 9 22:50:49 2023 -0500 bpf: Add bpf_cpumask_first_and() kfunc We currently provide bpf_cpumask_first(), bpf_cpumask_any(), and bpf_cpumask_any_and() kfuncs. bpf_cpumask_any() and bpf_cpumask_any_and() are confusing misnomers in that they actually just call cpumask_first() and cpumask_first_and() respectively. We'll replace them with bpf_cpumask_any_distribute() and bpf_cpumask_any_distribute_and() kfuncs in a subsequent patch, so let's ensure feature parity by adding a bpf_cpumask_first_and() kfunc to account for bpf_cpumask_any_and() being removed. Signed-off-by: David Vernet Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230610035053.117605-1-void@manifault.com Signed-off-by: Alexei Starovoitov commit e13dd04a242cc8c064b9af8cde38b8e9a548cf81 Author: Stephen Boyd Date: Mon Jun 12 11:23:32 2023 -0700 clk: meson: a1: Staticize rtc clk Sparse rightly complains that this symbol is supposed to be static. Cc: Jian Hu Cc: Dmitry Rokosov Cc: Martin Blumenstingl Cc: Jerome Brunet Fixes: 84af914404db ("clk: meson: a1: add Amlogic A1 Peripherals clock controller driver") Link: https://lore.kernel.org/r/20230612182332.371003-1-sboyd@kernel.org Reviewed-by: Jerome Brunet Reviewed-by: Martin Blumenstingl Signed-off-by: Stephen Boyd commit 03c601927b673a243c9595e1ecc9e8adfdd02438 Merge: 1b90e8f8879c6 ba57b9b11f785 Author: Dmitry Baryshkov Date: Tue Jun 13 00:20:40 2023 +0300 Merge branch 'drm-next' of git://anongit.freedesktop.org/drm/drm into msm-next-lumag-base Merge the drm-next tree to pick up the DRM DSC helpers (merged via drm-intel-next tree). MSM DSC v1.2 patches depend on these helpers. Signed-off-by: Dmitry Baryshkov commit 892d00fba18a6dec2620165ce05e1697496f8381 Author: Ian Rogers Date: Fri May 26 20:43:22 2023 -0700 perf inject: Lazily allocate guest_event event_buf The event_buf is 64kb (PERF_SAMPLE_SIZE_MAX) and stack allocated in struct perf_inject. It is used for guest events that may not exist in a file. Make the array allocation lazy to cut down on the stack usage. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230527034324.2597593-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d3944f0ed4e4039201b160fc11004abaa2ca5385 Author: Ian Rogers Date: Fri May 26 20:43:21 2023 -0700 perf inject: Lazily allocate event_copy The event_copy is 64kb (PERF_SAMPLE_SIZE_MAX) and stack allocated in struct perf_inject. It is used for aux events that may not exist in a file. Make the array allocation lazy to cut down on the stack usage. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230527034324.2597593-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e590e46b548e0de3df52a8a093639ce67002fae0 Author: Ian Rogers Date: Fri May 26 20:43:20 2023 -0700 perf script: Remove some large stack allocations Some char buffers are stack allocated but in total they come to 24kb. Avoid Wstack-usage warnings by moving the arrays to being dynamically allocated. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230527034324.2597593-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 232418a0b2e8b8e72dac003b19352f1b647cdb31 Author: Ian Rogers Date: Fri May 26 20:43:19 2023 -0700 perf sched: Avoid large stack allocations Commit 5ded57ac1bdb ("perf inject: Remove static variables") moved static variables to local, however, in this case 3 MAX_CPUS (4096) sized arrays were moved onto the stack making the stack frame quite large. Avoid the stack usage by dynamically allocating the arrays. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230527034324.2597593-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e57d739334d55688bfbf161b1501426467d02c86 Author: Ian Rogers Date: Sun Jun 11 16:36:10 2023 -0700 perf bench sched messaging: Free contexts on exit Place sender and receiver contexts onto lists so that they may be freed on exit. Add missing pthread_attr_destroy. Fixes memory leaks reported by leak sanitizer. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: André Almeida Cc: Darren Hart Cc: Davidlohr Bueso Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lore.kernel.org/r/20230611233610.953456-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8351498d5204ef572ace0582c33b2302fe303c57 Author: Ian Rogers Date: Sun Jun 11 16:36:09 2023 -0700 perf bench futex: Avoid memory leaks from pthread_attr Remove code sharing the pthread_attr_t and initialize/destroy pthread_attr_t when needed. This avoids the same attribute being set that leak sanitizer reports as a memory leak. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: André Almeida Cc: Darren Hart Cc: Davidlohr Bueso Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lore.kernel.org/r/20230611233610.953456-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e6deda2e5a6a387437bcaeffa7bf4bc95fe8c446 Author: Ian Rogers Date: Sun Jun 11 16:36:08 2023 -0700 perf bench epoll: Fix missing frees/puts on the exit path Issues detected by leak sanitizer. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: André Almeida Cc: Darren Hart Cc: Davidlohr Bueso Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lore.kernel.org/r/20230611233610.953456-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0f0d1354a54cf679e773cae551b4523f5ec00c94 Author: Ian Rogers Date: Sun Jun 11 16:36:07 2023 -0700 perf help: Ensure clean_cmds is called on all paths Avoid potential memory leaks. Committer notes: This is right before calling exit(1), so just to clean up memory leak checker detection. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: André Almeida Cc: Darren Hart Cc: Davidlohr Bueso Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lore.kernel.org/r/20230611233610.953456-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 657a3efee43a29d13c4f30e4c8f6a178fd2bf14a Author: Ian Rogers Date: Sun Jun 11 16:36:06 2023 -0700 lib subcmd: Avoid memory leak in exclude_cmds exclude_cmds will shorten the cmds names array, before doing so free the removed entry. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: André Almeida Cc: Darren Hart Cc: Davidlohr Bueso Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lore.kernel.org/r/20230611233610.953456-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d927ef5004ef79e7fa6e85ff1f62f19fd4051988 Author: James Clark Date: Mon Jun 12 12:14:02 2023 +0100 perf cs-etm: Add exception level consistency check Assert that our own tracking of the exception level matches what OpenCSD provides. OpenCSD doesn't distinguish between EL0 and EL1 in the memory access callback so the extra tracking was required. But a rough assert can still be done. Signed-off-by: James Clark Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230612111403.100613-6-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 8d3031d39fe84cce9ab74ee22309ec8c0433c4a1 Author: James Clark Date: Mon Jun 12 12:14:01 2023 +0100 perf cs-etm: Track exception level Currently we assume all trace belongs to the host machine so when the decoder should be looking at the guest kernel maps it can crash because it looks at the host ones instead. Avoid one scenario (guest kernel running at EL1) by assigning the default guest machine to this trace. For userspace trace it's still not possible to determine guest vs host, but the PIDs should help in this case. Committer notes: Fixed up conflict with: perf addr_location: Add init/exit/copy functions That was only on tmp.perf-tools-next. Reviewed-by: Leo Yan Signed-off-by: James Clark Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230612111403.100613-5-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 5414b532611b19671cb10813e5d56e011574d698 Author: James Clark Date: Mon Jun 12 12:14:00 2023 +0100 perf cs-etm: Make PID format accessible from struct cs_etm_auxtrace To avoid every user of PID format having to use their own static local variable, cache it on initialisation and change the accessor to take struct cs_etm_auxtrace. Reviewed-by: Leo Yan Signed-off-by: James Clark Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230612111403.100613-4-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit d67d8c87d0e3c808e6c716ab59f981f7d0ec2cbd Author: James Clark Date: Mon Jun 12 12:13:59 2023 +0100 perf cs-etm: Use previous thread for branch sample source IP Branch samples currently use the IP of the previous packet as the from IP, and the IP of the current packet as the to IP. But it incorrectly uses the current thread. In some cases like a jump into a different exception level this will attribute to the incorrect process. Fix it by tracking the previous thread in the same way the previous packet is tracked. Committer notes: Resolved conflicts with: perf addr_location: Add init/exit/copy functions perf thread: Add accessor functions for thread Reviewed-by: Mike Leach Signed-off-by: James Clark Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20230612111403.100613-3-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 951ccccdc7153120673fdc398878d629dcb7adf6 Author: James Clark Date: Mon Jun 12 12:13:58 2023 +0100 perf cs-etm: Only track threads instead of PID and TIDs PIDs and TIDs are already contained within the thread struct, so to avoid inconsistencies drop the extra members on the etm queue and only use the thread struct. At the same time stop using the 'unknown' thread. In a later commit we will be making samples from multiple machines so it will be better to use the idle thread of each machine rather than overlapping unknown threads. Using the idle thread is also better because kernel addresses with a previously unknown thread will now be assigned to a real kernel thread. Committer notes: Resolved conflicts with: perf addr_location: Add init/exit/copy functions perf thread: Add accessor functions for thread perf thread: Remove notion of dead threads That were present in tmp.perf-tools.next only. Reviewed-by: Leo Yan Reviewed-by: Mike Leach Signed-off-by: James Clark Acked-by: Suzuki Poulouse Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20230612111403.100613-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 0d98a7af4b12ae7ea78075240a66c21e5d3d9325 Author: James Clark Date: Mon Jun 12 16:04:24 2023 +0100 perf map: Fix double 'struct map' reference free found with -DREFCNT_CHECKING=1 When quitting after running a 'perf report', the refcount checker finds some double frees. The issue is that map__put() is called on a function argument so it removes the refcount wrapper that someone else was using. Fix it by only calling map__put() on a reference that is owned by this function. Committer notes: Narrowed the map_ref scope as suggested by Ian, removed the symbol-elf part as it was already fixed by another patch, from Ian. Signed-off-by: James Clark Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230612150424.198914-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 922db21d7e094c363313f9787acdd47d774651af Author: Arnaldo Carvalho de Melo Date: Mon Jun 12 11:10:46 2023 -0300 perf srcline: Optimize comparision against SRCLINE_UNKNOWN This is a string constant that gets returned and then strcmp() around, we can instead just do a pointer comparision. That requires a new global variable to comply with these warnings from some versions of clang and gcc: 41 68.95 fedora:rawhide : FAIL clang version 16.0.4 (Fedora 16.0.4-1.fc39) result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare] if (start_line != SRCLINE_UNKNOWN && ^ ~~~~~~~~~~~~~~~ 41 Ack comments: Agreed, the strcmps make me nervous as they won't distinguish heap from a global meaning we could end up with things like pointers to freed memory. The comparison with the global is always going to be same imo. Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Link: https://lore.kernel.org/lkml/ZIcoJytUEz4UgQYR@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5079e1c0c879311668b77075de3e701869804adf Author: Chao Yu Date: Fri Jun 2 16:36:05 2023 +0800 f2fs: avoid dead loop in f2fs_issue_checkpoint() generic/082 reports a bug as below: __schedule+0x332/0xf60 schedule+0x6f/0xf0 schedule_timeout+0x23b/0x2a0 wait_for_completion+0x8f/0x140 f2fs_issue_checkpoint+0xfe/0x1b0 f2fs_sync_fs+0x9d/0xb0 sync_filesystem+0x87/0xb0 dquot_load_quota_sb+0x41b/0x460 dquot_load_quota_inode+0xa5/0x130 dquot_quota_on+0x4b/0x60 f2fs_quota_on+0xe3/0x1b0 do_quotactl+0x483/0x700 __x64_sys_quotactl+0x15c/0x310 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc The root casue is race case as below: Thread A Kworker IRQ - write() : write data to quota.user file - writepages - f2fs_submit_page_write - __is_cp_guaranteed return false - inc_page_count(F2FS_WB_DATA) - submit_bio - quotactl(Q_QUOTAON) - f2fs_quota_on - dquot_quota_on - dquot_load_quota_inode - vfs_setup_quota_inode : inode->i_flags |= S_NOQUOTA - f2fs_write_end_io - __is_cp_guaranteed return true - dec_page_count(F2FS_WB_CP_DATA) - dquot_load_quota_sb - f2fs_sync_fs - f2fs_issue_checkpoint - do_checkpoint - f2fs_wait_on_all_pages(F2FS_WB_CP_DATA) : loop due to F2FS_WB_CP_DATA count is negative Calling filemap_fdatawrite() and filemap_fdatawait() to keep all data clean before quota file setup. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit cadfc2f9f8c35ed429a64245a89766961dad49fa Author: Wu Bo Date: Thu Jun 1 09:37:59 2023 +0800 f2fs: fix args passed to trace_f2fs_lookup_end The NULL return of 'd_splice_alias' dosen't mean error. Thus the successful case will also return NULL, which makes the tracepoint always print 'err=-ENOENT'. And the different cases of 'new' & 'err' are list as following: 1) dentry exists: err(0) with new(NULL) --> dentry, err=0 2) dentry exists: err(0) with new(VALID) --> new, err=0 3) dentry exists: err(0) with new(ERR) --> dentry, err=ERR 4) no dentry exists: err(-ENOENT) with new(NULL) --> dentry, err=-ENOENT 5) no dentry exists: err(-ENOENT) with new(VALID) --> new, err=-ENOENT 6) no dentry exists: err(-ENOENT) with new(ERR) --> dentry, err=ERR Signed-off-by: Wu Bo Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 38b57833de1d9716bf8134c6fefcc35d23d5b136 Author: Yangtao Li Date: Wed May 31 20:59:18 2023 +0800 f2fs: flag as supporting buffered async reads The f2fs uses generic_file_buffered_read(), which supports buffered async reads since commit 1a0a7853b901 ("mm: support async buffered reads in generic_file_buffered_read()"). Let's enable it to match other file-systems. The read performance has been greatly improved under io_uring: 167M/s -> 234M/s, Increase ratio by 40% Test w/: ./fio --name=onessd --filename=/data/test/local/io_uring_test --size=256M --rw=randread --bs=4k --direct=0 --overwrite=0 --numjobs=1 --iodepth=1 --time_based=0 --runtime=10 --ioengine=io_uring --registerfiles --fixedbufs --gtod_reduce=1 --group_reporting --sqthread_poll=1 Signed-off-by: Lu Hongfei Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 20872584b8c0b006c007da9588a272c9e28d2e18 Author: Chao Yu Date: Sun May 28 15:47:12 2023 +0800 f2fs: fix to drop all dirty meta/node pages during umount() For cp error case, there will be dirty meta/node pages remained after f2fs_write_checkpoint() in f2fs_put_super(), drop them explicitly, and do sanity check on reference count of dirty pages and inflight IOs. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 38a4a330c8bf6498bde3be155485c9b44a517fb0 Author: Chunhai Guo Date: Sun May 28 01:06:40 2023 +0800 f2fs: Detect looped node chain efficiently find_fsync_dnodes() detect the looped node chain by comparing the loop counter with free blocks. While it may take tens of seconds to quit when the free blocks are large enough. We can use Floyd's cycle detection algorithm to make the detection more efficient. Signed-off-by: Chunhai Guo Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 25f9080576b9549be9435123d7e45bfeebd2dc97 Author: Daejun Park Date: Mon May 8 17:10:42 2023 +0900 f2fs: add async reset zone command support This patch enables submit reset zone command asynchornously. It helps decrease average latency of write IOs in high utilization scenario by faster checkpointing. Signed-off-by: Daejun Park Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 901c12d144570ed2558f4a6806201453c5b01bea Author: Chao Yu Date: Thu May 18 10:14:12 2023 +0800 f2fs: flush error flags in workqueue In IRQ context, it wakes up workqueue to record errors into on-disk superblock fields rather than in-memory fields. Fixes: 1aa161e43106 ("f2fs: fix scheduling while atomic in decompression path") Fixes: 95fa90c9e5a7 ("f2fs: support recording errors into superblock") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 458c15dfbce62c35fefd9ca637b20a051309c9f1 Author: Chao Yu Date: Tue May 23 11:58:22 2023 +0800 f2fs: don't reset unchangable mount option in f2fs_remount() syzbot reports a bug as below: general protection fault, probably for non-canonical address 0xdffffc0000000009: 0000 [#1] PREEMPT SMP KASAN RIP: 0010:__lock_acquire+0x69/0x2000 kernel/locking/lockdep.c:4942 Call Trace: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5691 __raw_write_lock include/linux/rwlock_api_smp.h:209 [inline] _raw_write_lock+0x2e/0x40 kernel/locking/spinlock.c:300 __drop_extent_tree+0x3ac/0x660 fs/f2fs/extent_cache.c:1100 f2fs_drop_extent_tree+0x17/0x30 fs/f2fs/extent_cache.c:1116 f2fs_insert_range+0x2d5/0x3c0 fs/f2fs/file.c:1664 f2fs_fallocate+0x4e4/0x6d0 fs/f2fs/file.c:1838 vfs_fallocate+0x54b/0x6b0 fs/open.c:324 ksys_fallocate fs/open.c:347 [inline] __do_sys_fallocate fs/open.c:355 [inline] __se_sys_fallocate fs/open.c:353 [inline] __x64_sys_fallocate+0xbd/0x100 fs/open.c:353 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The root cause is race condition as below: - since it tries to remount rw filesystem, so that do_remount won't call sb_prepare_remount_readonly to block fallocate, there may be race condition in between remount and fallocate. - in f2fs_remount(), default_options() will reset mount option to default one, and then update it based on result of parse_options(), so there is a hole which race condition can happen. Thread A Thread B - f2fs_fill_super - parse_options - clear_opt(READ_EXTENT_CACHE) - f2fs_remount - default_options - set_opt(READ_EXTENT_CACHE) - f2fs_fallocate - f2fs_insert_range - f2fs_drop_extent_tree - __drop_extent_tree - __may_extent_tree - test_opt(READ_EXTENT_CACHE) return true - write_lock(&et->lock) access NULL pointer - parse_options - clear_opt(READ_EXTENT_CACHE) Cc: Reported-by: syzbot+d015b6c2fbb5c383bf08@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-f2fs-devel/20230522124203.3838360-1-chao@kernel.org Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d8189834d4348ae608083e1f1f53792cfcc2a9bc Author: Chao Yu Date: Tue May 23 14:17:25 2023 +0800 f2fs: fix to avoid NULL pointer dereference f2fs_write_end_io() butt3rflyh4ck reports a bug as below: When a thread always calls F2FS_IOC_RESIZE_FS to resize fs, if resize fs is failed, f2fs kernel thread would invoke callback function to update f2fs io info, it would call f2fs_write_end_io and may trigger null-ptr-deref in NODE_MAPPING. general protection fault, probably for non-canonical address KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037] RIP: 0010:NODE_MAPPING fs/f2fs/f2fs.h:1972 [inline] RIP: 0010:f2fs_write_end_io+0x727/0x1050 fs/f2fs/data.c:370 bio_endio+0x5af/0x6c0 block/bio.c:1608 req_bio_endio block/blk-mq.c:761 [inline] blk_update_request+0x5cc/0x1690 block/blk-mq.c:906 blk_mq_end_request+0x59/0x4c0 block/blk-mq.c:1023 lo_complete_rq+0x1c6/0x280 drivers/block/loop.c:370 blk_complete_reqs+0xad/0xe0 block/blk-mq.c:1101 __do_softirq+0x1d4/0x8ef kernel/softirq.c:571 run_ksoftirqd kernel/softirq.c:939 [inline] run_ksoftirqd+0x31/0x60 kernel/softirq.c:931 smpboot_thread_fn+0x659/0x9e0 kernel/smpboot.c:164 kthread+0x33e/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The root cause is below race case can cause leaving dirty metadata in f2fs after filesystem is remount as ro: Thread A Thread B - f2fs_ioc_resize_fs - f2fs_readonly --- return false - f2fs_resize_fs - f2fs_remount - write_checkpoint - set f2fs as ro - free_segment_range - update meta_inode's data Then, if f2fs_put_super() fails to write_checkpoint due to readonly status, and meta_inode's dirty data will be writebacked after node_inode is put, finally, f2fs_write_end_io will access NULL pointer on sbi->node_inode. Thread A IRQ context - f2fs_put_super - write_checkpoint fails - iput(node_inode) - node_inode = NULL - iput(meta_inode) - write_inode_now - f2fs_write_meta_page - f2fs_write_end_io - NODE_MAPPING(sbi) : access NULL pointer on node_inode Fixes: b4b10061ef98 ("f2fs: refactor resize_fs to avoid meta updates in progress") Reported-by: butt3rflyh4ck Closes: https://lore.kernel.org/r/1684480657-2375-1-git-send-email-yangtiezhu@loongson.cn Tested-by: butt3rflyh4ck Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit bfd476623999118d9c509cb0fa9380f2912bc225 Author: Chao Yu Date: Tue May 23 20:35:21 2023 +0800 f2fs: clean up w/ sbi->log_sectors_per_block Use sbi->log_sectors_per_block to clean up below calculated one: unsigned int log_sectors_per_block = sbi->log_blocksize - SECTOR_SHIFT; Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 90b7c4b748d897226577abb14480ec61a7c2a1f7 Author: Chao Yu Date: Sat May 27 08:15:39 2023 +0800 f2fs: fix to set noatime and immutable flag for quota file We should set noatime bit for quota files, since no one cares about atime of quota file, and we should set immutalbe bit as well, due to nobody should write to the file through exported interfaces. Meanwhile this patch use inode_lock to avoid race condition during inode->i_flags, f2fs_inode->i_flags update. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 77e820ea73a5b86f434a776d63e1e5f50a366c19 Author: Chao Yu Date: Wed May 17 17:42:50 2023 +0800 f2fs: renew value of F2FS_FEATURE_* Define F2FS_FEATURE_* macro w/ 32-bits value rather than 16-bits value. No logic changes. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 478d7100f44b7d250272fb86d70c909045171c9e Author: Chao Yu Date: Wed May 17 17:42:49 2023 +0800 f2fs: renew value of F2FS_MOUNT_* Then we can just define newly introduced mount option w/ lasted free number rather than random free one. Just cleanup, no logic changes. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f082c6b205a06953f26c40bdc7621cc5a58ceb7c Author: Chao Yu Date: Sun May 14 16:07:23 2023 +0800 f2fs: fix potential deadlock due to unpaired node_write lock use If S_NOQUOTA is cleared from inode during data page writeback of quota file, it may miss to unlock node_write lock, result in potential deadlock, fix to use the lock in paired. Kworker Thread - writepage if (IS_NOQUOTA()) f2fs_down_read(&sbi->node_write); - vfs_cleanup_quota_inode - inode->i_flags &= ~S_NOQUOTA; if (IS_NOQUOTA()) f2fs_up_read(&sbi->node_write); Fixes: 79963d967b49 ("f2fs: shrink node_write lock coverage") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 36ded4c106db2434754c9bdcabdbdb52117be35f Author: Yonggil Song Date: Fri May 12 13:16:10 2023 +0900 f2fs: Fix over-estimating free section during FG GC There was a bug that finishing FG GC unconditionally because free sections are over-estimated after checkpoint in FG GC. This patch initializes sec_freed by every checkpoint in FG GC. Signed-off-by: Yonggil Song Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 04abeb699ddce800837c4039ea1cc7d4d139bb36 Author: Daeho Jeong Date: Fri May 5 13:40:00 2023 -0700 f2fs: close unused open zones while mounting Zoned UFS allows only 6 open zones at the same time, so we need to take care of the count of open zones while mounting. Signed-off-by: Daeho Jeong Signed-off-by: Jaegeuk Kim commit 753c742352d38e0994628b6f610f255a04744300 Author: Krzysztof Kozlowski Date: Mon May 15 17:57:47 2023 +0200 dt-bindings: vendor-prefixes: document TeeJet Document TeeJet vendor prefix (used in am3517_mt_ventoux.dts board). Signed-off-by: Krzysztof Kozlowski Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230515155747.499371-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 3a5bbced6efce5a1115604a7ca8711bf3fec8a9e Author: Michal Simek Date: Thu Jun 8 16:04:12 2023 +0200 dt-bindings: trivial-devices: Add infineon,irps5401 Add Infineon IRPS5401 power supply to trivial devices. Driver has been added long time ago by commit 9158411b96b1 ("hwmon: (pmbus) Add Infineon IRPS5401 driver"). Signed-off-by: Michal Simek Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/9673fc919c6785879975fb1830d5026d3cfa658a.1686233049.git.michal.simek@amd.com Signed-off-by: Rob Herring commit 03daea192aa3e251ab7593f5add27765dc6b6109 Author: Uwe Kleine-König Date: Thu May 25 22:48:12 2023 +0200 of: unittest: Switch i2c driver back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230525204812.733642-1-u.kleine-koenig@pengutronix.de Signed-off-by: Rob Herring commit 2b544ec6a1051b106351e5a4f0b4d591de82b924 Author: Krzysztof Kozlowski Date: Wed Jun 7 20:41:47 2023 +0200 dt-bindings: misc: qcom,fastrpc: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230607184147.420352-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring commit 451d69d2f1f97a35b1f8eb9ee0ce6a9a2dd372e1 Author: Stefan Wahren Date: Tue May 30 12:08:43 2023 +0200 dt-bindings: imxgpt: add imx6ul compatible Currently the dtbs_check for imx6ul generates warnings like this: ['fsl,imx6ul-gpt', 'fsl,imx6sx-gpt'] is too long According to the timer-imx-gpt driver all imx6 use the same imx6dl data, but according to the existing DTS files the imx6ul GPT IP is derived from imx6sx. So better follow the DTS files here and make the imx6ul GPT compatible to the imx6sl one to fix the warning. Signed-off-by: Stefan Wahren Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230530100843.15072-3-stefan.wahren@i2se.com Signed-off-by: Rob Herring commit a2c6326c8b9de219bc77188e188ae9baa8299b8a Author: Stefan Wahren Date: Tue May 30 12:08:42 2023 +0200 dt-bindings: crypto: fsl-dcp: add imx6sl and imx6ull compatible Currently the dtbs_check for imx6 generates warnings like this: 'fsl,imx6sl-dcp' is not one of ['fsl,imx23-dcp', 'fsl,imx28-dcp'] ['fsl,imx6sl-dcp', 'fsl,imx28-dcp'] is too long or 'fsl,imx6ull-dcp' is not one of ['fsl,imx23-dcp', 'fsl,imx28-dcp'] ['fsl,imx6ull-dcp', 'fsl,imx28-dcp'] is too long So add them to the devicetree binding. Signed-off-by: Stefan Wahren Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230530100843.15072-2-stefan.wahren@i2se.com Signed-off-by: Rob Herring commit ce294330ebdd8b4696b4480e4fdb9f10c010f8ab Author: Claudiu Beznea Date: Tue May 23 10:06:37 2023 +0300 MAINTAINERS: add documentation file for Microchip EIC section Add documentation file to Microchip EIC section. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230523070637.224476-3-claudiu.beznea@microchip.com Signed-off-by: Rob Herring commit 93da99912932638fc2716b435c1e6e39060822c5 Author: Claudiu Beznea Date: Tue May 23 10:06:36 2023 +0300 dt-bindings: interrupt-controller: microchip,sama7g5-eic: use proper naming syntax Use the following syntax for Microchip EIC YAML file: vendor,device.yaml. Signed-off-by: Claudiu Beznea Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230523070637.224476-2-claudiu.beznea@microchip.com Signed-off-by: Rob Herring commit d70684772aa96af7aacb350e59e7b84660c1aa0b Author: Ayan Kumar Halder Date: Thu May 18 16:27:30 2023 +0100 dt-bindings: arm: Add Cortex-R52 to the list of enum As a pre-requisite for porting Xen on a Cortex-R52 based System-on-chip, we need to add "cortex-r52" to the list of enum. Signed-off-by: Ayan Kumar Halder Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230518152730.82954-1-ayan.kumar.halder@amd.com Signed-off-by: Rob Herring commit 35ca4239929737bdc021ee923f97ebe7aff8fcc4 Author: Mickaël Salaün Date: Mon Jun 12 21:14:30 2023 +0200 selftests/landlock: Add hostfs tests Add tests for the hostfs filesystems to make sure it has a consistent inode management, which is required for Landlock's file hierarchy identification. This adds 5 new tests for layout3_fs with the hostfs variant. Add hostfs to the new (architecture-specific) config.um file. The hostfs filesystem, only available for an User-Mode Linux kernel, is special because we cannot explicitly mount it. The layout3_fs.hostfs variant tests are skipped if the current test directory is not backed by this filesystem. The layout3_fs.hostfs.tag_inode_dir_child and layout3_fs.hostfs.tag_inode_file tests pass thanks to a previous commit fixing hostfs inode management. Without this fix, the deny-by-default policy would apply and all access requests would be denied. Link: https://lore.kernel.org/r/20230612191430.339153-7-mic@digikod.net Signed-off-by: Mickaël Salaün commit 04f9070e99a4c5d60f05436f63e470c19b579e24 Author: Mickaël Salaün Date: Mon Jun 12 21:14:29 2023 +0200 selftests/landlock: Add tests for pseudo filesystems Add generic and read-only tests for 6 pseudo filesystems to make sure they have a consistent inode management, which is required for Landlock's file hierarchy identification: - tmpfs - ramfs - cgroup2 - proc - sysfs Update related kernel configuration to support these new filesystems, remove useless CONFIG_SECURITY_PATH, and sort all entries. If these filesystems are not supported by the kernel running tests, the related tests are skipped. Expanding variants, this adds 25 new tests for layout3_fs: - tag_inode_dir_parent - tag_inode_dir_mnt - tag_inode_dir_child - tag_inode_dir_file - release_inodes Test coverage for security/landlock with kernel debug code: - 94.7% of 835 lines according to gcc/gcov-12 - 93.0% of 852 lines according to gcc/gcov-13 Test coverage for security/landlock without kernel debug code: - 95.5% of 624 lines according to gcc/gcov-12 - 93.1% of 641 lines according to gcc/gcov-13 Link: https://lore.kernel.org/r/20230612191430.339153-6-mic@digikod.net Signed-off-by: Mickaël Salaün commit 55ab3fbe8333148e9c21477ffdc4edbe1f568f55 Author: Mickaël Salaün Date: Mon Jun 12 21:14:28 2023 +0200 selftests/landlock: Make mounts configurable Add a new struct mnt_opt to define a mount point with the mount_opt() helper. This doesn't change tests but prepare for the next commit. Link: https://lore.kernel.org/r/20230612191430.339153-5-mic@digikod.net Signed-off-by: Mickaël Salaün commit 3de64b656b3c827d7d194558b0ae3a09400b116d Author: Mickaël Salaün Date: Mon Jun 12 21:14:27 2023 +0200 selftests/landlock: Add supports_filesystem() helper Replace supports_overlayfs() with supports_filesystem() to be able to check several filesystems. This will be useful in a following commit. Only check for overlay filesystem once in the setup step, and then rely on self->skip_test. Cc: Guenter Roeck Cc: Jeff Xu Link: https://lore.kernel.org/r/20230612191430.339153-4-mic@digikod.net Signed-off-by: Mickaël Salaün commit 592efeb4a07ee46204c0f87001455c28f4743dea Author: Mickaël Salaün Date: Mon Jun 12 21:14:26 2023 +0200 selftests/landlock: Don't create useless file layouts Add and use a layout0 test fixture to not populate the tmpfs filesystem if it is not required for tests: unknown_access_rights, proc_nsfs, unpriv and max_layers. This doesn't change these tests but it speeds up their setup and makes them less prone to error. This prepare the ground for a next commit. Link: https://lore.kernel.org/r/20230612191430.339153-3-mic@digikod.net Signed-off-by: Mickaël Salaün commit 74ce793bcbde5cef0f82d6ccb3c47cb651295a9a Author: Mickaël Salaün Date: Mon Jun 12 21:14:25 2023 +0200 hostfs: Fix ephemeral inodes hostfs creates a new inode for each opened or created file, which created useless inode allocations and forbade identifying a host file with a kernel inode. Fix this uncommon filesystem behavior by tying kernel inodes to host file's inode and device IDs. Even if the host filesystem inodes may be recycled, this cannot happen while a file referencing it is opened, which is the case with hostfs. It should be noted that hostfs inode IDs may not be unique for the same hostfs superblock because multiple host's (backed) superblocks may be used. Delete inodes when dropping them to force backed host's file descriptors closing. This enables to entirely remove ARCH_EPHEMERAL_INODES, and then makes Landlock fully supported by UML. This is very useful for testing changes. These changes also factor out and simplify some helpers thanks to the new hostfs_inode_update() and the hostfs_iget() revamp: read_name(), hostfs_create(), hostfs_lookup(), hostfs_mknod(), and hostfs_fill_sb_common(). A following commit with new Landlock tests check this new hostfs inode consistency. Cc: Anton Ivanov Cc: Johannes Berg Acked-by: Richard Weinberger Link: https://lore.kernel.org/r/20230612191430.339153-2-mic@digikod.net Signed-off-by: Mickaël Salaün commit 834631ee770aebd05fd25eaa5a4a2d0dcd65f3c5 Author: Ian Rogers Date: Thu Jun 8 16:28:23 2023 -0700 perf hist: Fix srcline memory leak srcline isn't freed if it is SRCLINE_UNKNOWN. Avoid strduping in this case as such strdups are redundant and leak memory. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-27-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 625db36e6c53b39c664b7fcb509207d26ac58ea6 Author: Ian Rogers Date: Thu Jun 8 16:28:22 2023 -0700 perf srcline: Change free_srcline to zfree_srcline Make use after free more unlikely. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-26-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8ab12a2038e36beda4062a8e7562a8cfe9655553 Author: Ian Rogers Date: Thu Jun 8 16:28:21 2023 -0700 perf callchain: Use pthread keys for tls callchain_cursor Pthread keys are more portable than __thread and allow the association of a destructor with the key. Use the destructor to clean up TLS callchain cursors to aid understanding memory leaks. Committer notes: Had to fixup a series of unconverted places and also check for the return of get_tls_callchain_cursor() as it may fail and return NULL. In that unlikely case we now either print something to a file, if the caller was expecting to print a callchain, or return an error code to state that resolving the callchain isn't possible. In some cases this was made easier because thread__resolve_callchain() already can fail for other reasons, so this new one (cursor == NULL) can be added and the callers don't have to explicitely check for this new condition. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-25-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d7ba60a4e590f79e6f28c0fb47d4a862656b1d70 Author: Ian Rogers Date: Thu Jun 8 16:28:20 2023 -0700 perf header: Avoid out-of-bounds read intel-pt tests were failing: -- Test virtual LBR --- Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.126 MB /tmp/perf-test-intel-pt-sh.FW57CXnCqQ/test-perf.data ] Failed with virtual lbr ... ``` The root cause is an out-of-bounds read in header (where maxbrstack.py is from test_intel_pt.sh): ``` $ perf --no-pager script --itrace=L -s maxbrstack.py ================================================================= ==3907930==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000095a8 at pc 0x563c26c840bb bp 0x7fff43582710 sp 0x7fff43582708 READ of size 4 at 0x6020000095a8 thread T0 #0 0x563c26c840ba in process_group_desc util/header.c:2847 #1 0x563c26c8bc78 in perf_file_section__process util/header.c:4037 #2 0x563c26c8aa9b in perf_header__process_sections util/header.c:3813 #3 0x563c26c8d028 in perf_session__read_header util/header.c:4286 #4 0x563c26cbab29 in perf_session__open util/session.c:113 #5 0x563c26cbb3d0 in __perf_session__new util/session.c:221 #6 0x563c26aacb14 in perf_session__new util/session.h:73 #7 0x563c26acf7f1 in cmd_script tools/perf/builtin-script.c:4212 #8 0x563c26bb58ff in run_builtin tools/perf/perf.c:323 #9 0x563c26bb5e70 in handle_internal_command tools/perf/perf.c:377 #10 0x563c26bb6238 in run_argv tools/perf/perf.c:421 #11 0x563c26bb67a0 in main tools/perf/perf.c:537 #12 0x7f34bde46189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #13 0x7f34bde46244 in __libc_start_main_impl ../csu/libc-start.c:381 #14 0x563c26a33390 in _start (/tmp/perf/perf+0x1eb390) 0x6020000095a8 is located 8 bytes to the right of 16-byte region [0x602000009590,0x6020000095a0) allocated by thread T0 here: #0 0x7f34beeb83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77 #1 0x563c26c83df8 in process_group_desc util/header.c:2824 #2 0x563c26c8bc78 in perf_file_section__process util/header.c:4037 #3 0x563c26c8aa9b in perf_header__process_sections util/header.c:3813 #4 0x563c26c8d028 in perf_session__read_header util/header.c:4286 #5 0x563c26cbab29 in perf_session__open util/session.c:113 #6 0x563c26cbb3d0 in __perf_session__new util/session.c:221 #7 0x563c26aacb14 in perf_session__new util/session.h:73 #8 0x563c26acf7f1 in cmd_script tools/perf/builtin-script.c:4212 #9 0x563c26bb58ff in run_builtin tools/perf/perf.c:323 #10 0x563c26bb5e70 in handle_internal_command tools/perf/perf.c:377 #11 0x563c26bb6238 in run_argv tools/perf/perf.c:421 #12 0x563c26bb67a0 in main tools/perf/perf.c:537 #13 0x7f34bde46189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 ``` Avoid the out-of-bounds read checking for the leader. Leave the 'nr' check intact as nr will be 0 or the counting down and evsel be a group member. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ian Rogers Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/lkml/20230608232823.4027869-24-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit cddeeeda8fba4156255abf5a1d8c2517de8db0cd Author: Ian Rogers Date: Thu Jun 8 16:28:19 2023 -0700 perf top: Add exit routine for main thread Add exit_process_thread that reverses init_process_thread. This avoids leak sanitizer reporting memory leaks. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-23-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d3d53b2e9617ea606aae91a013163895f037de96 Author: Ian Rogers Date: Thu Jun 8 16:28:18 2023 -0700 perf annotate: Fix parse_objdump_line memory leak fileloc is used to hold a previous line, before overwriting it ensure the previous contents is freed. Free the storage once done in symbol__disassemble. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-22-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit bffb5b0c0976aa46aaa961dd19a47c9d6301cfe1 Author: Ian Rogers Date: Thu Jun 8 16:28:17 2023 -0700 perf map/maps/thread: Changes to reference counting Fix missed reference count gets and puts as detected with leak sanitizer and reference count checking. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-21-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1981da1fe2499823f626c86c5ba3be6b89844384 Author: Ian Rogers Date: Thu Jun 8 16:28:16 2023 -0700 perf machine: Don't leak module maps machine__addnew_module_map requires a put on its result. Add this and narrow the scope of map to make the correctness more obvious. This leak was caught with leak sanitizer and the reference count checker. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-20-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 34b29bd61d4e0385164d569f2dd8ffc3b4058ed6 Author: Ian Rogers Date: Thu Jun 8 16:28:15 2023 -0700 perf machine: Fix leak of kernel dso The kernel dso may be found by searching dsos or allocating if not found. The allocation returns with a reference count of 2, once for the dsos list and once for the returned value. The list search has a reference count of 1, once for the dsos list. To make the reference counts consistent, increase the dsos list search reference count to 2 with a dso__get, and do a put when the scope ends for either the allocated or found dso. This issue was found with leak sanitizer and reference count checking. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-19-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 814a656870eee89062b960c48c1fdd6064cd0bbf Author: Ian Rogers Date: Thu Jun 8 16:28:14 2023 -0700 perf maps: Fix overlapping memory leak Add a missed free detected by leak sanitizer. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-18-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit fe8fec1028dc382606a91c4bf27d3dd350c306bd Author: Ian Rogers Date: Thu Jun 8 16:28:13 2023 -0700 perf symbol-elf: Correct holding a reference If a reference is held, don't put it as this will confuse reference count checking. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-17-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5cedd1e29d4513c54be2c681cffaad47058f8cc0 Author: Ian Rogers Date: Thu Jun 8 16:28:12 2023 -0700 perf jit: Fix two thread leaks As reported by leak sanitizer with reference count checking. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-16-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 51cfe7a3e87ed760f6604ad4bbce898b9a3f8f92 Author: Ian Rogers Date: Thu Jun 8 16:28:11 2023 -0700 perf python: Avoid 2 leak sanitizer issues Leak sanitizer complains about the variable size bf allocation and store to bf if sized 0. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-15-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ac873ac32618dd1ce9a46ade575a421f0e1bf779 Author: Ian Rogers Date: Thu Jun 8 16:28:10 2023 -0700 perf evlist: Free stats in all evlist destruction There is no evsel free stats, freeing in the evlist__delete ensures memory leaks are avoided. Issues detected with "perf stat report" and leak sanitizer, perf stat uses perf_session__delete to free the evlist. Add dummy symbol for python build. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-14-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 084770f55acb41505258f5035387312fd6f0592f Author: Ian Rogers Date: Thu Jun 8 16:28:09 2023 -0700 perf intel-pt: Fix missed put and leak Add missing put and free, detected with leak sanitizer. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-13-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 2b87be183bca9774c8ce238f5fc84d3b3f671b33 Author: Ian Rogers Date: Thu Jun 8 16:28:08 2023 -0700 perf stat: Avoid evlist leak Free evlist before overwriting in "perf stat report" mode. Detected using leak sanitizer. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-12-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f8e502b9d1b3b1979590b3fc0f9b2a65fedfcb9b Author: Ian Rogers Date: Thu Jun 8 16:28:07 2023 -0700 perf header: Ensure bitmaps are freed memory_node bitmaps need a bitmap_free to avoid memory leaks. Caught by leak sanitizer. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-11-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 2c9f7bd7951af269afe9680746f4c566c3abc769 Author: Ian Rogers Date: Thu Jun 8 16:28:06 2023 -0700 perf report: Avoid 'parent_thread' thread leak on '--tasks' processing Caught with address sanitizer and reference count checking. Committer notes: The command leading to this leak: # perf record -a sleep 2 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 2.516 MB perf.data (6422 samples) ] # perf report --tasks # pid tid ppid comm 0 0 -1 |swapper 1 1 0 | systemd 1474 1474 1 | systemd 2816 2816 1474 | gjs 2816 2825 2816 | gmain 2816 2831 2816 | gdbus 2816 2861 2816 | JS Helper 2816 2862 2816 | JS Helper 2816 2863 2816 | JS Helper 2816 2864 2816 | JS Helper 2816 2865 2816 | JS Helper 2816 2866 2816 | JS Helper 2816 2867 2816 | JS Helper 2816 2868 2816 | JS Helper 3072 3072 1474 | gsd-printer 3072 3082 3072 | gmain 3072 3083 3072 | gdbus 2600 2600 1474 | gnome-shell 15621 15621 2600 | firefox 15771 15771 15621 | WebExtensions 15771 15872 15771 | TaskCon~ller #6 15771 15873 15771 | TaskCon~ller #7 15771 15778 15771 | IPC I/O Child 15771 15779 15771 | Socket Thread 15771 15780 15771 | HTML5 Parser 15771 15781 15771 | JS Watchdog # When it is going to exit a thread__put(parent_thread) was missed, add it to have ASAN clean. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-10-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit cf078c838181366867091b024ff351ea2a414e0c Author: Ian Rogers Date: Thu Jun 8 16:28:05 2023 -0700 perf machine: Make delete_threads part of machine__exit The code required threads to be deleted before machine__exit was called or the threads would be leaked. This was error prone so move the delete_threads into machine__exit. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-9-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f6005cafebab72f8c02100dc896d6cfd5b8918cb Author: Ian Rogers Date: Thu Jun 8 16:28:04 2023 -0700 perf thread: Add reference count checking Modify struct declaration and accessor functions for the reference count checkers additional layer of indirection. Make sure pid_cmp in builtin-sched.c uses the underlying/original struct in pointer arithmetic, and not the temporary get/put indirection. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0dd5041c9a0eaf8c5c3fd46df4ee60f877799f44 Author: Ian Rogers Date: Thu Jun 8 16:28:03 2023 -0700 perf addr_location: Add init/exit/copy functions struct addr_location holds references to multiple reference counted objects. Add init/exit functions to make maintenance of those more consistent with the rest of the code and to try to avoid leaks. Modification of thread reference counts isn't included in this change. Committer notes: I needed to initialize result to sample->ip to make sure is set to something, fixing a compile time error, mostly keeping the previous logic as build_alloc_func_list() already does debugging/error prints about what went wrong if it takes the 'goto out'. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 620be847f459fce62f673311d035cd298581b1eb Author: Ian Rogers Date: Thu Jun 8 16:28:02 2023 -0700 perf addr_location: Move to its own header addr_location is a common abstraction, move it into its own header and source file in preparation for wider clean up. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 46125590e0df7602d02602fcb0134a4085aca442 Author: Ian Rogers Date: Thu Jun 8 16:28:01 2023 -0700 perf maps: Make delete static, always use put Address/leak sanitizer with reference count checking can identify the location of leaks, so use put rather than delete to avoid free-ing memory when the reference count is >1. Add maps__zput to ensure the variable is cleared. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ee84a3032b74055feed192a727e872b0a18d1140 Author: Ian Rogers Date: Thu Jun 8 16:28:00 2023 -0700 perf thread: Add accessor functions for thread Using accessors will make it easier to add reference count checking in later patches. Committer notes: thread->nsinfo wasn't wrapped as it is used together with nsinfo__zput(), where does a trick to set the field with a refcount being dropped to NULL, and that doesn't work well with using thread__nsinfo(thread), that loses the &thread->nsinfo pointer. When refcount checking is added to 'struct thread', later in this series, nsinfo__zput(RC_CHK_ACCESS(thread)->nsinfo) will be used to check the thread pointer. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7ee227f674028435c01cb6fa02fa268ae48b1823 Author: Ian Rogers Date: Thu Jun 8 16:27:59 2023 -0700 perf thread: Make threads rbtree non-invasive Separate the rbtree out of thread and into a new struct thread_rb_node. The refcnt is in thread and the rbtree is responsible for a single count. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 40826c45eb0b88565b5ea3fa98e6c251b193ad4b Author: Ian Rogers Date: Thu Jun 8 16:27:58 2023 -0700 perf thread: Remove notion of dead threads The dead thread list is best effort. Threads live on it until the reference count hits zero and they are removed. With correct reference counting this should never happen. It is, however, part of the 'perf sched' output that is now removed. If this is an issue we should implement tracking of dead threads in a robust not best-effort way. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Andi Kleen Cc: Athira Rajeev Cc: Brian Robbins Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Fangrui Song Cc: German Gomez Cc: Ingo Molnar Cc: Ivan Babrou Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sean Christopherson Cc: Steinar H. Gunderson Cc: Suzuki Poulouse Cc: Wenyu Liu Cc: Will Deacon Cc: Yang Jihong Cc: Ye Xingchen Cc: Yuan Can Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230608232823.4027869-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit dcf7a17714e63d6e38c8c9612fee2dbc2e64c57e Author: Ian Rogers Date: Thu Jun 8 16:24:00 2023 -0700 perf test: Add test of libpfm4 events $ ./perf test -v 102 102: perf all libpfm4 events test : --- start --- test child forked, pid 3030994 Testing ix86arch::UNHALTED_CORE_CYCLES Testing ix86arch::INSTRUCTION_RETIRED Testing ix86arch::UNHALTED_REFERENCE_CYCLES Testing ix86arch::LLC_REFERENCES Testing ix86arch::LLC_MISSES Testing ix86arch::BRANCH_INSTRUCTIONS_RETIRED Testing ix86arch::MISPREDICTED_BRANCH_RETIRED Testing perf_raw::r0000 Testing icl::UNHALTED_CORE_CYCLES Testing icl::UNHALTED_REFERENCE_CYCLES ... test child finished with 0 ---- end ---- perf all libpfm4 events test: Ok Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230608232400.3056312-4-namhyung@kernel.org Signed-off-by: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit cc3d139bca0fdf14d8e5f0e2a3b4132fddebb14b Author: Ian Rogers Date: Thu Jun 8 16:23:59 2023 -0700 perf list: Check arguments to show libpfm4 events This is particularly useful for tests. $ perf list pfm Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230608232400.3056312-3-namhyung@kernel.org Signed-off-by: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit d1f1cecc92ae0dba44eac3ce10baf4edb4553e41 Author: Namhyung Kim Date: Thu Jun 8 16:23:58 2023 -0700 perf list: Check if libpfm4 event is supported Some of its event info cannot be used directly due to missing default attributes. Let's check if the event is supported before printing like we do for hw and cache events. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers @google.com> Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230608232400.3056312-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f0617f526cb0c482dd46ed798db28d3991f6f872 Author: Adrian Hunter Date: Thu May 25 11:29:02 2023 +0300 perf parse: Allow config terms with breakpoints Add config terms to the parsing of breakpoint events. Extend "Test event parsing" to also cover using a confg term. This makes breakpoint events consistent with other events which already support config terms. Example: $ cat dr_test.c #include #include void func0(void) { } int main() { printf("func0 %p\n", &func0); while (1) { func0(); usleep(100000); } return 0; } $ gcc -g -O0 -o dr_test dr_test.c $ ./dr_test & [2] 19646 func0 0x55feb98dd169 $ perf record -e mem:0x55feb98dd169:x/name=breakpoint/ -p 19646 -- sleep 0.5 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.017 MB perf.data (5 samples) ] $ perf script dr_test 19646 5632.956628: 1 breakpoint: 55feb98dd169 func0+0x0 (/home/ahunter/git/work/dr_test) dr_test 19646 5633.056866: 1 breakpoint: 55feb98dd169 func0+0x0 (/home/ahunter/git/work/dr_test) dr_test 19646 5633.157084: 1 breakpoint: 55feb98dd169 func0+0x0 (/home/ahunter/git/work/dr_test) dr_test 19646 5633.257309: 1 breakpoint: 55feb98dd169 func0+0x0 (/home/ahunter/git/work/dr_test) dr_test 19646 5633.357532: 1 breakpoint: 55feb98dd169 func0+0x0 (/home/ahunter/git/work/dr_test) $ sudo perf test "Test event parsing" 6: Parse event definition strings : 6.1: Test event parsing : Ok $ sudo perf test -v "Test event parsing" |& grep mem running test 8 'mem:0' running test 9 'mem:0:x' running test 10 'mem:0:r' running test 11 'mem:0:w' running test 19 'mem:0:u' running test 20 'mem:0:x:k' running test 21 'mem:0:r:hp' running test 22 'mem:0:w:up' running test 26 'mem:0:rw' running test 27 'mem:0:rw:kp' running test 42 'mem:0/1' running test 43 'mem:0/2:w' running test 44 'mem:0/4:rw:u' running test 58 'mem:0/name=breakpoint/' running test 59 'mem:0:x/name=breakpoint/' running test 60 'mem:0:r/name=breakpoint/' running test 61 'mem:0:w/name=breakpoint/' running test 62 'mem:0/name=breakpoint/u' running test 63 'mem:0:x/name=breakpoint/k' running test 64 'mem:0:r/name=breakpoint/hp' running test 65 'mem:0:w/name=breakpoint/up' running test 66 'mem:0:rw/name=breakpoint/' running test 67 'mem:0:rw/name=breakpoint/kp' running test 68 'mem:0/1/name=breakpoint/' running test 69 'mem:0/2:w/name=breakpoint/' running test 70 'mem:0/4:rw/name=breakpoint/u' running test 71 'mem:0/1/name=breakpoint1/,mem:0/4:rw/name=breakpoint2/' Committer notes: Folded follow up patch (see 2nd link below) to address warnings about unused tokens: perf tools: Suppress bison unused value warnings Patch "perf tools: Allow config terms with breakpoints" introduced parse tokens for colons and slashes within breakpoint parsing to prevent mix up with colons and slashes related to config terms. The token values are not needed but introduce bison "unused value" warnings. Suppress those warnings. Committer testing: # cat ~acme/c/mem_breakpoint.c #include #include void func1(void) { } void func2(void) { } void func3(void) { } void func4(void) { } void func5(void) { } int main() { printf("func1 %p\n", &func1); printf("func2 %p\n", &func2); printf("func3 %p\n", &func3); printf("func4 %p\n", &func4); printf("func5 %p\n", &func5); while (1) { func1(); func2(); func3(); func4(); func5(); usleep(100000); } return 0; } # ~acme/c/mem_breakpoint & [1] 3186153 func1 0x401136 func2 0x40113d func3 0x401144 func4 0x40114b func5 0x401152 # Trying to watch the first 4 functions for eXecutable access: # perf record -e mem:0x401136:x/name=breakpoint1/,mem:0x40113d:x/name=breakpoint2/,mem:0x401144:x/name=breakpoint3/,mem:0x40114b:x/name=breakpoint4/ -p 3186153 -- sleep 0.5 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.026 MB perf.data (20 samples) ] [root@five ~]# perf script mem_breakpoint 3186153 131612.864793: 1 breakpoint1: 401136 func1+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131612.864795: 1 breakpoint2: 40113d func2+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131612.864796: 1 breakpoint3: 401144 func3+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131612.864797: 1 breakpoint4: 40114b func4+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131612.964868: 1 breakpoint1: 401136 func1+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131612.964870: 1 breakpoint2: 40113d func2+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131612.964871: 1 breakpoint3: 401144 func3+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131612.964872: 1 breakpoint4: 40114b func4+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.064945: 1 breakpoint1: 401136 func1+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.064948: 1 breakpoint2: 40113d func2+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.064948: 1 breakpoint3: 401144 func3+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.064949: 1 breakpoint4: 40114b func4+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.165024: 1 breakpoint1: 401136 func1+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.165026: 1 breakpoint2: 40113d func2+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.165027: 1 breakpoint3: 401144 func3+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.165028: 1 breakpoint4: 40114b func4+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.265103: 1 breakpoint1: 401136 func1+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.265105: 1 breakpoint2: 40113d func2+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.265106: 1 breakpoint3: 401144 func3+0x0 (/var/home/acme/c/mem_breakpoint) mem_breakpoint 3186153 131613.265107: 1 breakpoint4: 40114b func4+0x0 (/var/home/acme/c/mem_breakpoint) # Then all the 5 functions: # perf record -e mem:0x401136:x/name=breakpoint1/,mem:0x40113d:x/name=breakpoint2/,mem:0x401144:x/name=breakpoint3/,mem:0x40114b:x/name=breakpoint4/,mem:0x401152:x/name=breakpoint5/ -p 3186153 -- sleep 0.5 Error: The sys_perf_event_open() syscall returned with 28 (No space left on device) for event (breakpoint5). /bin/dmesg | grep -i perf may provide additional information. # grep -m1 'model name' /proc/cpuinfo model name : AMD Ryzen 9 5950X 16-Core Processor # Reviewed-by: Ian Rogers Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20230525082902.25332-2-adrian.hunter@intel.com Link: https://lore.kernel.org/r/f7228dc9-fe18-a8e3-7d3f-52922e0e1113@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 36d3e4138e1b6cc9ab179f3f397b5548f8b1eaae Author: Arnaldo Carvalho de Melo Date: Tue Jun 6 16:11:10 2023 -0300 perf script: Fix allocation of evsel->priv related to per-event dump files When printing output we may want to generate per event files, where the --per-event-dump option should be used, creating perf.data.EVENT.dump files instead of printing to stdout. The callback thar processes event thus expects that evsel->priv->fp should point to either the per-event FILE descriptor or to stdout. The a3af66f51bd0bca7 ("perf script: Fix crash because of missing evsel->priv") changeset fixed a case where evsel->priv wasn't setup, thus set to NULL, causing a segfault when trying to access evsel->priv->fp. But it did it for the non --per-event-dump case by allocating a 'struct perf_evsel_script' just to set its ->fp to stdout. Since evsel->priv is only freed when --per-event-dump is used, we ended up with a memory leak, detected using ASAN. Fix it by using the same method as perf_script__setup_per_event_dump(), and reuse that static 'struct perf_evsel_script'. Also check if evsel_script__new() failed. Fixes: a3af66f51bd0bca7 ("perf script: Fix crash because of missing evsel->priv") Reported-by: Ian Rogers Tested-by: Ian Rogers Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Ravi Bangoria Link: https://lore.kernel.org/lkml/ZH+F0wGAWV14zvMP@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 59374d08b2b0b7305bd984c487c668bb93ebcf43 Merge: ac9a78681b921 2aac2d8b95923 Author: Stephen Boyd Date: Mon Jun 12 11:27:57 2023 -0700 Merge tag 'samsung-clk-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into clk-samsung Pull Samsung clk driver updates from Krzysztof Kozlowski: - Re-add support for Exynos4212 clock controller because we are re-introducing the SoC in the mainline - Add CONFIG_OF dependency to solve some objtool warnings * tag 'samsung-clk-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: clk: samsung: add CONFIG_OF dependency clk: samsung: Re-add support for Exynos4212 CPU clock clk: samsung: Add Exynos4212 compatible to CLKOUT driver dt-bindings: clock: samsung,exynos: add Exynos4212 clock compatible commit 29d70888100990d88e518bd7ab5b01520fcdeddf Merge: ac9a78681b921 ca1170b699682 Author: Stephen Boyd Date: Mon Jun 12 11:24:26 2023 -0700 Merge tag 'sunxi-clk-for-6.5-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner Pull an Allwinner clk driver update from Jernej Skrabec: - Preselect PLL MIPI as TCON0 parent for A64 SoC * tag 'sunxi-clk-for-6.5-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: a64: force select PLL_MIPI in TCON0 mux commit 7826c069c8765969cfb7a364f8e0e663fc132b10 Author: Arjan van de Ven Date: Mon Jun 5 15:47:14 2023 +0000 intel_idle: clean up the (new) state_update_enter_method function Now that the logic for state_update_enter_method() is in its own function, the long if .. else if .. else if .. else if chain can be simplified by just returning from the function at the various places. This does not change functionality, but it makes the logic much simpler to read or modify later. Signed-off-by: Arjan van de Ven Signed-off-by: Rafael J. Wysocki commit 4622ba923e55e12cb76081c8865b01fcb383a9d8 Author: Arjan van de Ven Date: Mon Jun 5 15:47:13 2023 +0000 intel_idle: refactor state->enter manipulation into its own function Since the 6.4 kernel, the logic for updating a state's enter method based on "environmental conditions" (command line options, cpu sidechannel workarounds etc etc) has gotten pretty complex. This patch refactors this into a seperate small, self contained function (no behavior changes) for improved readability and to make future changes to this logic easier to do and understand. Signed-off-by: Arjan van de Ven Signed-off-by: Rafael J. Wysocki commit c8ed1b35931245087968fd95b2ec3dfc50f77769 Author: Bob Peterson Date: Mon Jun 12 12:26:23 2023 -0500 gfs2: Fix duplicate should_fault_in_pages() call In gfs2_file_buffered_write(), we currently jump from the second call of function should_fault_in_pages() to above the first call, so should_fault_in_pages() is getting called twice in a row, causing it to accidentally fall back to single-page writes rather than trying the more efficient multi-page writes first. Fix that by moving the retry label to the correct place, behind the first call to should_fault_in_pages(). Fixes: e1fa9ea85ce8 ("gfs2: Stop using glock holder auto-demotion for now") Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 9eb77e4207a8b4e3c2967ba39dc46e798caefadf Merge: ac9a78681b921 84af914404dbc Author: Stephen Boyd Date: Mon Jun 12 11:03:02 2023 -0700 Merge tag 'clk-meson-v6.5-1' of https://github.com/BayLibre/clk-meson into clk-allwinner Pull Amlogic clk driver updates from Jerome Brunet: - Add amlogic a1 SoC family PLL and peripheral clock controller support * tag 'clk-meson-v6.5-1' of https://github.com/BayLibre/clk-meson: clk: meson: a1: add Amlogic A1 Peripherals clock controller driver clk: meson: a1: add Amlogic A1 PLL clock controller driver clk: meson: introduce new pll power-on sequence for A1 SoC family clk: meson: make pll rst bit as optional dt-bindings: clock: meson: add A1 Peripherals clock controller bindings dt-bindings: clock: meson: add A1 PLL clock controller bindings commit b77505ed8a885c67a589c049c38824082a569068 Author: Mario Limonciello Date: Fri Jun 2 02:30:25 2023 -0500 platform/x86/amd: pmc: Use pm_pr_dbg() for suspend related messages Using pm_pr_dbg() allows users to toggle `/sys/power/pm_debug_messages` as a single knob to turn on messages that amd-pmc can emit to aid in any s2idle debugging. Signed-off-by: Mario Limonciello Acked-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit c9a236419ff936755eb5db8a894c3047440e65a8 Author: Mario Limonciello Date: Fri Jun 2 02:30:24 2023 -0500 pinctrl: amd: Use pm_pr_dbg to show debugging messages To make the GPIO tracking around suspend easier for end users to use, link it with pm_debug_messages. This will make discovering sources of spurious GPIOs around suspend easier. Signed-off-by: Mario Limonciello Acked-by: Linus Walleij Signed-off-by: Rafael J. Wysocki commit f75400603f5fb7a031218c659852809378a77cb7 Author: Mario Limonciello Date: Fri Jun 2 02:30:23 2023 -0500 ACPI: x86: Add pm_debug_messages for LPS0 _DSM state tracking Enabling debugging messages for the state requires turning on dynamic debugging for the file. To make it more accessible, use `pm_debug_messages` and clearer strings for what is happening. Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit cdb8c100d8a4b4e31c829724e40b4fdf32977cce Author: Mario Limonciello Date: Fri Jun 2 02:30:22 2023 -0500 include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume All uses in the kernel are currently already oriented around suspend/resume. As some other parts of the kernel may also use these messages in functions that could also be used outside of suspend/resume, only enable in suspend/resume path. Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 49776c712eb6ded12fcbb8cc915a498dbfb47311 Author: Dan Carpenter Date: Tue Jun 6 11:22:42 2023 +0300 powercap: RAPL: Fix a NULL vs IS_ERR() bug The devm_ioremap_resource() function returns error pointers on error, it never returns NULL. Update the check accordingly. Fixes: 9eef7f9da928 ("powercap: intel_rapl: Introduce RAPL TPMI interface driver") Signed-off-by: Dan Carpenter Acked-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit 6a66fb9ffe7b4558c04f73593c01ee484a5c9ddf Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:20 2023 +0200 dt-bindings: memory-controllers: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Link: https://lore.kernel.org/r/20230609140720.64743-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 4658fe81b3f8afe8adf37734ec5fe595d90415c6 Author: Zhang Rui Date: Tue Jun 6 22:00:00 2023 +0800 powercap: RAPL: Fix CONFIG_IOSF_MBI dependency After commit 3382388d7148 ("intel_rapl: abstract RAPL common code"), accessing to IOSF_MBI interface is done in the RAPL common code. Thus it is the CONFIG_INTEL_RAPL_CORE that has dependency of CONFIG_IOSF_MBI, while CONFIG_INTEL_RAPL_MSR does not. This problem was not exposed previously because all the previous RAPL common code users, aka, the RAPL MSR and MMIO I/F drivers, have CONFIG_IOSF_MBI selected. Fix the CONFIG_IOSF_MBI dependency in RAPL code. This also fixes a build time failure when the RAPL TPMI I/F driver is introduced without selecting CONFIG_IOSF_MBI. x86_64-linux-ld: vmlinux.o: in function `set_floor_freq_atom': intel_rapl_common.c:(.text+0x2dac9b8): undefined reference to `iosf_mbi_write' x86_64-linux-ld: intel_rapl_common.c:(.text+0x2daca66): undefined reference to `iosf_mbi_read' Reference to iosf_mbi.h is also removed from the RAPL MSR I/F driver. Fixes: 3382388d7148 ("intel_rapl: abstract RAPL common code") Reported-by: Arnd Bergmann Link: https://lore.kernel.org/all/20230601213246.3271412-1-arnd@kernel.org Signed-off-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit 35e797b0246b49d116326ff23c2dbfd6507168a5 Author: Irvin Cote Date: Thu May 18 19:10:54 2023 -0300 nvme-core: use nvme_ns_head_multipath instead of ns->head->disk Change the way we check for a multipath nshead so as to consistently use the same check to assert the same condition. Signed-off-by: Irvin Cote Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit d05b5e0baf424c8c4b4709ac11f66ab726c8deaf Author: Sumeet Pawnikar Date: Thu Jun 8 08:00:06 2023 +0530 powercap: RAPL: fix invalid initialization for pl4_supported field The current initialization of the struct x86_cpu_id via pl4_support_ids[] is partial and wrong. It is initializing "stepping" field with "X86_FEATURE_ANY" instead of "feature" field. Use X86_MATCH_INTEL_FAM6_MODEL macro instead of initializing each field of the struct x86_cpu_id for pl4_supported list of CPUs. This X86_MATCH_INTEL_FAM6_MODEL macro internally uses another macro X86_MATCH_VENDOR_FAM_MODEL_FEATURE for X86 based CPU matching with appropriate initialized values. Reported-by: Dave Hansen Link: https://lore.kernel.org/lkml/28ead36b-2d9e-1a36-6f4e-04684e420260@intel.com Fixes: eb52bc2ae5b8 ("powercap: RAPL: Add Power Limit4 support for Meteor Lake SoC") Fixes: b08b95cf30f5 ("powercap: RAPL: Add Power Limit4 support for Alder Lake-N and Raptor Lake-P") Fixes: 515755906921 ("powercap: RAPL: Add Power Limit4 support for RaptorLake") Fixes: 1cc5b9a411e4 ("powercap: Add Power Limit4 support for Alder Lake SoC") Fixes: 8365a898fe53 ("powercap: Add Power Limit4 support") Signed-off-by: Sumeet Pawnikar Signed-off-by: Rafael J. Wysocki commit d97b4111b3228122284df0263200f02fd44751fd Author: Daniel Wagner Date: Tue Jun 6 14:24:11 2023 +0200 nvmet-fcloop: Do not wait on completion when unregister fails The nvme_fc_unregister_localport() returns an error code in case that the locaport pointer is NULL or has already been unegisterd. localport is is either in the ONLINE state (all resources allocated) or has already been put into DELETED state. In this case we will never receive an wakeup call and thus any caller will hang, e.g. module unload. Signed-off-by: Daniel Wagner Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 959ffef13bac792e4e2e3321d6e2bd2b00c0f5f9 Author: Chaitanya Kulkarni Date: Thu Jun 1 23:47:42 2023 -0700 nvme-fabrics: open code __nvmf_host_find() There is no point in maintaining a separate funciton __nvmf_host_find() that has only one caller nvmf_host_add() especially when caller and callee both are small enough to merge. Due to this we are actually repeating the error handling code in both callee and caller for no reason that can be avoided, but instead we have to read both function to establish the correctness along with additional lockdep warning check due to involved locking. Just open code __nvmf_host_find() in nvme_host_alloc() with appropriate comment that removes repeated error checks in the callee/caller and lockdep check that is needed for the nvmf_hosts_mutex involvement, diffstats :- drivers/nvme/host/fabrics.c | 75 +++++++++++++------------------------ 1 file changed, 27 insertions(+), 48 deletions(-) Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Reviewed-by: Max Gurtovoy Signed-off-by: Keith Busch commit 900095bfbbf6623fbfa9e5ceb3982f293b6f3275 Author: Chaitanya Kulkarni Date: Thu Jun 1 22:37:13 2023 -0700 nvme-fabrics: error out to unlock the mutex Currently, in the nvmf_host_add() function, if the nvmf_host_alloc() call failed to allocate memory for the host, the code would directly return -ENOMEM without unlocking the nvmf_hosts_mutex. This could lead to potential issues with mutex synchronization. Fix that error handling mechanism by jumping to the out_unlock label when nvmf_host_alloc() fails. This ensures that the mutex is unlocked before returning the error code. The updated code enhances avoids possible deadlocks. Fixes: f0cebf82004d ("nvme-fabrics: prevent overriding of existing host") Reported-by: kernel test robot Reported-by: Julia Lawall Closes: https://lore.kernel.org/r/202306020909.MTUEBeIa-lkp@intel.com/ Signed-off-by: Chaitanya Kulkarni Reviewed-by: Julia Lawall Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit bdbfcd5f6caa46e1ddbfd60cbf694d192b37805a Author: Daniel Gomez Date: Tue May 30 15:42:53 2023 +0000 nvme: Increase block size variable size to 32-bit Increase block size variable size to 32-bit unsigned to be able to support block devices larger than 32k (starting from 64 KiB). Physical and logical block size already support unsigned 32-bit. Signed-off-by: Daniel Gomez Reviewed-by: Luis Chamberlain Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit e9227d486ede0428a00f011236753d83a390d2e1 Author: Chaitanya Kulkarni Date: Fri May 19 02:40:52 2023 -0700 nvme-fcloop: no need to return from void function Remove return at the end of void function. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 94c78ea124001f5b04630947197fda4b9a9e95c6 Author: Chaitanya Kulkarni Date: Fri May 19 02:40:51 2023 -0700 nvmet-auth: remove unnecessary break after goto Remove dead break after goto. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Keith Busch commit 2ad0713c73ffea42a7a69ac2fa8996454e9f7816 Author: Christophe JAILLET Date: Mon Apr 17 22:41:13 2023 +0200 nvmet-auth: remove some dead code 'status' is known to be 0 at the point. And nvmet_auth_challenge() return a -E or 0. So these lines of code should just be removed. Signed-off-by: Christophe JAILLET Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 2110a6bcd7afd313ae10e9808878cd7c419c6b65 Author: Irvin Cote Date: Wed May 17 19:09:15 2023 -0300 nvme-core: remove redundant check from nvme_init_ns_head nvme_find_ns_head already checks that the list of namescpaces in an already existing namespace head is not empty Signed-off-by: Irvin Cote Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 942e21c042e6f735e13364e955cbd55a8930294b Author: Max Gurtovoy Date: Tue Apr 25 00:12:42 2023 +0300 nvme: move sysfs code to a dedicated sysfs.c file The core.c file became long and hard to maintain. Create a dedicated file to centralize the sysfs functionality. This is a common practice to separate sysfs/configfs related logic from the main driver logic .c file. For example, in the nvmet module the configfs interface has its own dedicated file. This patch does not include any functional changes. Reviewed-by: Keith Busch Reviewed-by: Christoph Hellwig Reviewed-by: Jens Axboe Reviewed-by: Hannes Reinecke Signed-off-by: Max Gurtovoy [merged dhchap memleak fixes, include nvme-auth.h] Signed-off-by: Keith Busch commit ae8bd606e09bbdb2607c8249872cc2aeaf2fcc72 Author: Max Gurtovoy Date: Fri May 12 18:41:55 2023 +0300 nvme-fabrics: prevent overriding of existing host When first connecting a target using the "default" host parameters, setting the hostid from the command line during a subsequent connection establishment would override the "default" hostid parameter. This would cause an existing connection that is already using the host definitions to lose its hostid. To address this issue, the code has been modified to allow only 1:1 mapping between hostnqn and hostid. This will maintain unambiguous host identification. Any non 1:1 mapping will be rejected during connection establishment. Tested-by: Noam Gottlieb Reviewed-by: Israel Rukshin Signed-off-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 5e4b55fa522ec0839f33a73fe5facf609ee66b58 Author: Max Gurtovoy Date: Fri May 12 18:41:54 2023 +0300 nvme-fabrics: check hostid using uuid_equal Use a dedicated function to match uuids instead of duplicating it. Tested-by: Noam Gottlieb Reviewed-by: Israel Rukshin Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Max Gurtovoy Signed-off-by: Keith Busch commit b86d6595f73462c4086cadba63aacff4155e74ed Author: Max Gurtovoy Date: Fri May 12 18:41:53 2023 +0300 nvme-fabrics: unify common code in admin and io queue connect To simplify code maintenance, it is recommended to avoid duplicating code. Tested-by: Noam Gottlieb Reviewed-by: Israel Rukshin Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Max Gurtovoy Signed-off-by: Keith Busch commit 92bbe55182affa9f3b00a266d5f41fbc8a2114d6 Author: Christophe JAILLET Date: Mon May 1 14:40:29 2023 +0200 nvmet: reorder fields in 'struct nvmefc_fcp_req' Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nvmefc_fcp_req' from 112 to 104 bytes. This structure is embedded in some other structures (nvme_fc_fcp_op which itself is embedded in nvme_fcp_op_w_sgl), so it helps reducing the size of these structures too. Signed-off-by: Christophe JAILLET Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 0f5335e15897fa989ffc301e4657ed5aa7b62f9f Author: Christophe JAILLET Date: Mon May 1 14:40:28 2023 +0200 nvmet: reorder fields in 'struct nvme_dhchap_queue_context' Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nvme_dhchap_queue_context' from 416 to 400 bytes. This structure is kvcalloc()'ed in nvme_auth_init_ctrl(), so it is likely that the allocation can be relatively big. Saving 16 bytes per structure may might a slight difference. Signed-off-by: Christophe JAILLET Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit e64b0c807cdb7e1c8c6cd1a1b4e72027d1034d91 Author: Christophe JAILLET Date: Mon May 1 14:40:27 2023 +0200 nvmet: reorder fields in 'struct nvmf_ctrl_options' Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nvmf_ctrl_options' from 136 to 128 bytes. When such a structure is allocated in nvmf_create_ctrl(), because of the way memory allocation works, when 136 bytes were requested, 192 bytes were allocated. So this saves 64 bytes per allocation, 1 cache line to hold the whole structure and a few cycles when zeroing the memory in nvmf_create_ctrl(). Signed-off-by: Christophe JAILLET Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 9d217fb0e778d69b2e3988efbc441976c0fb29b5 Author: Christophe JAILLET Date: Mon May 1 14:40:26 2023 +0200 nvme: reorder fields in 'struct nvme_ctrl' Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nvme_ctrl' from 5368 to 5344 bytes when all CONFIG_* are defined. This structure is embedded into some other structures, so it helps reducing their size as well. Signed-off-by: Christophe JAILLET Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit c60651e32f1e886cd85fd9f591ad2d8706173605 Author: Christophe JAILLET Date: Mon May 1 14:40:25 2023 +0200 nvmet: reorder fields in 'struct nvmet_sq' Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nvmet_sq' from 472 to 464 bytes when CONFIG_NVME_TARGET_AUTH is defined. This structure is embedded into some other structures, so it helps reducing their sizes as well. Signed-off-by: Christophe JAILLET Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 7266c88cbaa3deb0764c6c667d72f393ea98061a Author: Rafael J. Wysocki Date: Sun Jun 4 14:18:05 2023 +0200 ACPI: thermal: Eliminate struct acpi_thermal_state_flags Notice that the enabled flag is only needed for active trip points, so drop struct acpi_thermal_state_flags, add a simple "bool valid" field to the definitions of all trip point structures instead of flags and add a "bool enabled" field to struct acpi_thermal_active. Adjust the code using the modified structures accordingly. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Michal Wilczynski Reviewed-by: Daniel Lezcano commit 607d265fc1ab0639085016e170ef4e300d187a77 Author: Rafael J. Wysocki Date: Sun Jun 4 14:15:36 2023 +0200 ACPI: thermal: Move acpi_thermal_driver definition Move the definition of the acpi_thermal_driver structure closer to the initialization code that registes the driver, so some function forward declarations can be dropped. Also move the module information to the end of the file where it is usually located. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit bb5ab1fd61d6fcb35502aab39cb195789e3883c7 Author: Rafael J. Wysocki Date: Sun Jun 4 14:15:20 2023 +0200 ACPI: thermal: Move symbol definitions to one place Move all of the symbol definitions to the initial part of the code so they all can be found in one place. While at it, consolidate white space used in there. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Michal Wilczynski Reviewed-by: Daniel Lezcano commit a809560469957249f35afe7f5e31fcd58dc21d96 Author: Rafael J. Wysocki Date: Sun Jun 4 14:13:33 2023 +0200 ACPI: thermal: Drop redundant ACPI_TRIPS_REFRESH_DEVICES symbol Drop the ACPI_TRIPS_REFRESH_DEVICES symbol which is redundant, because ACPI_TRIPS_DEVICES can be used directly instead of it without any drawbacks and rename the ACPI_TRIPS_REFRESH_THRESHOLDS to ACPI_TRIPS_THRESHOLDS to make the code a bit more consistent. While at it, fix up some formatting white space used in the symbol definitions. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Michal Wilczynski Reviewed-by: Daniel Lezcano commit 3883fe9e148e18c27e550693abfb58d984ffbadf Author: Rafael J. Wysocki Date: Sun Jun 4 14:07:51 2023 +0200 ACPI: thermal: Use BIT() macro for defining flags Use the BIT() macro for defining flag symbols in the ACPI thermal driver instead of using "raw" values for the flags. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Michal Wilczynski Reviewed-by: Daniel Lezcano commit 597d364cd7b447aff5668639b90ec33ea420eaa2 Merge: 487db53bb504b 51bdf6ebe5b7d Author: Mark Brown Date: Mon Jun 12 18:35:11 2023 +0100 ASoC: Intel: avs: remove redundant dapm routes Merge series from Brent Lu : This patch series remove redundant dapm routes declared in multiple machine drivers. These routes will be created by snd_soc_dapm_connect_dai_link_widgets() during soundcard initialization. Following is the kernel log from a KBL chromebook nocturne. dmic: [ 13.773455] avs_dmic avs_dmic: connected DAI link dmic-codec:Capture -> dmic-platform:DMIC Rx [ 13.773460] avs_dmic avs_dmic: connected DAI link dmic-codec:Capture -> dmic-platform:DMIC WoV Rx max98373: [ 14.079536] avs_max98373 avs_max98373.1: connected DAI link avs_max98373.1-platform:ssp0 Tx -> i2c-MX98373:00:Right HiFi Playback [ 14.079545] avs_max98373 avs_max98373.1: connected DAI link i2c-MX98373:00:Right HiFi Capture -> avs_max98373.1-platform:ssp0 Rx [ 14.079550] avs_max98373 avs_max98373.1: connected DAI link avs_max98373.1-platform:ssp0 Tx -> i2c-MX98373:01:Left HiFi Playback [ 14.079554] avs_max98373 avs_max98373.1: connected DAI link i2c-MX98373:01:Left HiFi Capture -> avs_max98373.1-platform:ssp0 Rx hdaudio: [ 14.094818] avs_hdaudio avs_hdaudio.2: connected DAI link hdaudioB0D2-platform:hdaudioB0D2-cpu0 Tx -> hdaudioB0D2:HDMI 0 Playback [ 14.094824] avs_hdaudio avs_hdaudio.2: connected DAI link hdaudioB0D2-platform:hdaudioB0D2-cpu1 Tx -> hdaudioB0D2:HDMI 1 Playback [ 14.094828] avs_hdaudio avs_hdaudio.2: connected DAI link hdaudioB0D2-platform:hdaudioB0D2-cpu2 Tx -> hdaudioB0D2:HDMI 2 Playback commit a249d3066de62ce2ed68fdf6445556658ecba222 Author: Keith Busch Date: Wed Apr 26 08:04:41 2023 -0700 nvme-fabrics: add queue setup helpers tcp and rdma transports have lots of duplicate code setting up the different queue mappings. Add common helpers. Cc: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 4a4d9bc0c86dcd7b6f9b5471962839e8ce7682e4 Author: Irvin Cote Date: Fri May 12 03:05:37 2023 -0300 nvme-pci: cleaning up nvme_pci_init_request Erase the superfluous line that retrieves the nvme_dev. Signed-off-by: Irvin Cote Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit f3f28373152da143da9d163b2529669508e52e8e Author: Max Gurtovoy Date: Thu Apr 20 02:17:50 2023 +0300 nvme-rdma: fix typo in comment There is no ib_stop_cq API and the need for the +1 is for ib_drain_qp. Reviewed-by: Sagi Grimberg Reviewed-by: Israel Rukshin Signed-off-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 7ed5cf8e6d9bfb6a78d0471317edff14f0f2b4dd Author: Chaitanya Kulkarni Date: Fri Apr 28 00:31:15 2023 -0700 nvme-core: fix dev_pm_qos memleak Call dev_pm_qos_hide_latency_tolerance() in the error unwind patch to avoid following kmemleak:- blktests (master) # kmemleak-clear; ./check nvme/044; blktests (master) # kmemleak-scan ; kmemleak-show nvme/044 (Test bi-directional authentication) [passed] runtime 2.111s ... 2.124s unreferenced object 0xffff888110c46240 (size 96): comm "nvme", pid 33461, jiffies 4345365353 (age 75.586s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<0000000069ac2cec>] kmalloc_trace+0x25/0x90 [<000000006acc66d5>] dev_pm_qos_update_user_latency_tolerance+0x6f/0x100 [<00000000cc376ea7>] nvme_init_ctrl+0x38e/0x410 [nvme_core] [<000000007df61b4b>] 0xffffffffc05e88b3 [<00000000d152b985>] 0xffffffffc05744cb [<00000000f04a4041>] vfs_write+0xc5/0x3c0 [<00000000f9491baf>] ksys_write+0x5f/0xe0 [<000000001c46513d>] do_syscall_64+0x3b/0x90 [<00000000ecf348fe>] entry_SYSCALL_64_after_hwframe+0x72/0xdc Link: https://lore.kernel.org/linux-nvme/CAHj4cs-nDaKzMx2txO4dbE+Mz9ePwLtU0e3egz+StmzOUgWUrA@mail.gmail.com/ Fixes: f50fff73d620 ("nvme: implement In-Band authentication") Signed-off-by: Chaitanya Kulkarni Tested-by: Yi Zhang Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 3a12a0b868a512fcada564699d00f5e652c0998c Author: Chaitanya Kulkarni Date: Fri Apr 28 00:31:14 2023 -0700 nvme-core: add missing fault-injection cleanup Add missing fault-injection cleanup in nvme_init_ctrl() in the error unwind path that also fixes following message for blktests:- linux-block (for-next) # grep debugfs debugfs-err.log [ 147.853464] debugfs: Directory 'nvme1' with parent '/' already present! [ 147.853973] nvme1: failed to create debugfs attr [ 148.802490] debugfs: Directory 'nvme1' with parent '/' already present! [ 148.803244] nvme1: failed to create debugfs attr [ 148.877304] debugfs: Directory 'nvme1' with parent '/' already present! [ 148.877775] nvme1: failed to create debugfs attr [ 149.816652] debugfs: Directory 'nvme1' with parent '/' already present! [ 149.818011] nvme1: failed to create debugfs attr Signed-off-by: Chaitanya Kulkarni Tested-by: Yi Zhang Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 99c2dcc8ffc24e210a3aa05c204d92f3ef460b05 Author: Chaitanya Kulkarni Date: Fri Apr 28 00:31:13 2023 -0700 nvme-core: fix memory leak in dhchap_ctrl_secret Free dhchap_secret in nvme_ctrl_dhchap_ctrl_secret_store() before we return when nvme_auth_generate_key() returns error. Fixes: f50fff73d620 ("nvme: implement In-Band authentication") Signed-off-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit a836ca33c5b07d34dd5347af9f64d25651d12674 Author: Chaitanya Kulkarni Date: Fri Apr 28 00:31:12 2023 -0700 nvme-core: fix memory leak in dhchap_secret_store Free dhchap_secret in nvme_ctrl_dhchap_secret_store() before we return fix following kmemleack:- unreferenced object 0xffff8886376ea800 (size 64): comm "check", pid 22048, jiffies 4344316705 (age 92.199s) hex dump (first 32 bytes): 44 48 48 43 2d 31 3a 30 30 3a 6e 78 72 35 4b 67 DHHC-1:00:nxr5Kg 75 58 34 75 6f 41 78 73 4a 61 34 63 2f 68 75 4c uX4uoAxsJa4c/huL backtrace: [<0000000030ce5d4b>] __kmalloc+0x4b/0x130 [<000000009be1cdc1>] nvme_ctrl_dhchap_secret_store+0x8f/0x160 [nvme_core] [<00000000ac06c96a>] kernfs_fop_write_iter+0x12b/0x1c0 [<00000000437e7ced>] vfs_write+0x2ba/0x3c0 [<00000000f9491baf>] ksys_write+0x5f/0xe0 [<000000001c46513d>] do_syscall_64+0x3b/0x90 [<00000000ecf348fe>] entry_SYSCALL_64_after_hwframe+0x72/0xdc unreferenced object 0xffff8886376eaf00 (size 64): comm "check", pid 22048, jiffies 4344316736 (age 92.168s) hex dump (first 32 bytes): 44 48 48 43 2d 31 3a 30 30 3a 6e 78 72 35 4b 67 DHHC-1:00:nxr5Kg 75 58 34 75 6f 41 78 73 4a 61 34 63 2f 68 75 4c uX4uoAxsJa4c/huL backtrace: [<0000000030ce5d4b>] __kmalloc+0x4b/0x130 [<000000009be1cdc1>] nvme_ctrl_dhchap_secret_store+0x8f/0x160 [nvme_core] [<00000000ac06c96a>] kernfs_fop_write_iter+0x12b/0x1c0 [<00000000437e7ced>] vfs_write+0x2ba/0x3c0 [<00000000f9491baf>] ksys_write+0x5f/0xe0 [<000000001c46513d>] do_syscall_64+0x3b/0x90 [<00000000ecf348fe>] entry_SYSCALL_64_after_hwframe+0x72/0xdc Fixes: f50fff73d620 ("nvme: implement In-Band authentication") Signed-off-by: Chaitanya Kulkarni Tested-by: Yi Zhang Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 9368aa1882ac7178adcd936cee5f0899dbf76dc4 Author: Li Yang Date: Fri May 19 15:12:49 2023 -0500 APEI: GHES: correctly return NULL for ghes_get_devices() Since 315bada690e0 ("EDAC: Check for GHES preference in the chipset-specific EDAC drivers"), vendor specific EDAC driver will not probe correctly when CONFIG_ACPI_APEI_GHES is enabled but no GHES device is present. Make ghes_get_devices() return NULL when the GHES device list is empty to fix the problem. Fixes: 9057a3f7ac36 ("EDAC/ghes: Prepare to make ghes_edac a proper module") Signed-off-by: Li Yang Reviewed-by: Tony Luck Signed-off-by: Rafael J. Wysocki commit 097e727b585a9031e04e5c883e02c05ee8c6c901 Author: Sudeep Holla Date: Mon Jun 5 11:35:36 2023 +0100 ACPI: FFH: Drop the inclusion of linux/arm-smccc.h The inclusion of linux/arm-smccc.h in acpi_ffh is unnecessary and can be even termed wrong. It is needed in the arm64 architecture callback implementation and probably is the leftover from the missed cleanup of the initial implementation. Signed-off-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit 487db53bb504be00bb07c95d85a2e5c1194f4510 Merge: fd6f223639b83 f9c058d14f4fe Author: Mark Brown Date: Mon Jun 12 18:26:12 2023 +0100 ASoC: mediatek: mt8173: Fix error paths Merge series from Ricardo Ribalda Delgado : ASoC: mediatek: mt8173, presented a couple of error paths errors, lets fix them. commit b72f301c5bdce11ef32a7363bdc05edd4fc3b386 Author: Tony W Wang-oc Date: Tue Jun 6 17:56:41 2023 +0800 ACPI: PAD: mark Zhaoxin CPUs NONSTOP TSC correctly Zhaoxin CPUs support NONSTOP TSC feature, so do not mark these CPUs TSC unstable when use the acpi_pad driver. Signed-off-by: Tony W Wang-oc Signed-off-by: Rafael J. Wysocki commit d38f6bcea88836bfb346a6d567c452065417e2ed Author: Miaohe Lin Date: Tue Jun 6 20:28:19 2023 +0800 ACPI: APEI: mark bert_disable as __initdata It's only used inside the __init section. Mark it __initdata. Signed-off-by: Miaohe Lin Signed-off-by: Rafael J. Wysocki commit 896e97bf99ecf0ecb6cc420bc2c9eb268d3edc05 Author: Compostella, Jeremy Date: Tue Jun 6 09:13:23 2023 -0700 ACPI: EC: Clear GPE on interrupt handling only On multiple devices I work on, we noticed that /sys/firmware/acpi/interrupts/sci_not is non-zero and keeps increasing over time. It turns out that there is a race condition between servicing a GPE interrupt and handling task driven transactions. If a GPE interrupt is received at the same time ec_poll() is running, the advance_transaction() clears the GPE flag and the interrupt is not serviced as acpi_ev_detect_gpe() relies on the GPE flag to call the handler. As a result, `sci_not' is increased. To address this, move the GPE status check and clearing from advance_transaction() directly into acpi_ec_handle_interrupt(), so the EC GPE only gets cleared in the interrupt handling path. Signed-off-by: Jeremy Compostella [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit 11502feab423cbbbaae47c0672409840b04037d5 Author: Bjorn Helgaas Date: Fri Jun 9 17:25:00 2023 -0500 Documentation: PCI: Tidy AER documentation Consistently use: PCIe previously PCIe, PCI Express, or pci express Root Port previously Root Port or root port Endpoint previously EndPoint or endpoint AER previously AER or aer please previously pls Also update a few awkward wordings. Link: https://lore.kernel.org/r/20230609222500.1267795-5-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Stefan Roese Reviewed-by: Kuppuswamy Sathyanarayanan commit f142badf4645bd5ab72987d5595edbfae22a6d0b Author: Bjorn Helgaas Date: Fri Jun 9 17:24:59 2023 -0500 Documentation: PCI: Update cross references to .rst files Change references to *.txt to *.rst to match the current filenames. Link: https://lore.kernel.org/r/20230609222500.1267795-4-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Stefan Roese Reviewed-by: Kuppuswamy Sathyanarayanan commit a6378a7a1c7d95229f10fa00ce9b1925d6453ff0 Author: Bjorn Helgaas Date: Fri Jun 9 17:24:58 2023 -0500 Documentation: PCI: Drop recommendation to configure AER Capability Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core enables PCIe device error reporting for all devices during enumeration, so drivers don't need to do it. Remove the recommendation for drivers to configure AER and call pci_enable_pcie_error_reporting() themselves. Also remove the suggestion that drivers may change AER mask and severity registers. Ownership of these registers is negotiated between the OS and platform firmware. If firmware owns these registers, the OS must not change them. Link: https://lore.kernel.org/r/20230609222500.1267795-3-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Dave Jiang Reviewed-by: Stefan Roese Reviewed-by: Kuppuswamy Sathyanarayanan commit ba3da66783184ca94a6c1be2a6a03d20d8889b14 Author: Bjorn Helgaas Date: Fri Jun 9 17:24:57 2023 -0500 PCI: Unexport pci_save_aer_state() pci_save_aer_state() and pci_restore_aer_state() are only used in drivers/pci, so don't expose them to the rest of the kernel. No functional change intended. Link: https://lore.kernel.org/r/20230609222500.1267795-2-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Stefan Roese Reviewed-by: Kuppuswamy Sathyanarayanan commit ecfb8ce26d02ec136b4e1ae8c5a77d22d335057b Merge: d32758acbd4ee 155a6bd6375b5 Author: Mark Brown Date: Mon Jun 12 18:14:53 2023 +0100 regmap: Provide basic test coverage for raw I/O Merge series from Mark Brown : Our existing coverage only deals with buses that provide single register read and write operations, extend it to cover raw buses using a similar approach with a RAM backed register map that the tests can inspect to check operations. This coverage could be more complete but provides a good start. commit c518d31b2a3390e059c7bda1c1ce429c83ee8517 Author: Andy Shevchenko Date: Mon Oct 17 20:15:06 2022 +0300 pinctrl: baytrail: Use str_hi_lo() helper Use str_hi_lo() helper instead of open coding the same. Signed-off-by: Andy Shevchenko commit a9fc76645ca02a79ab491e2b05e29dc222b1f6b4 Author: Andy Shevchenko Date: Mon Mar 6 21:55:43 2023 +0200 lib/string_choices: Add str_high_low() helper Add str_high_low() helper to return 'high' or 'low' string literal. Also add an inversed variant, i.e. str_low_high(). All the same for str_hi_low(). Signed-off-by: Andy Shevchenko commit fca76071bab2304b379c35674d3b9e36a82e364a Author: Andy Shevchenko Date: Mon Mar 6 21:55:42 2023 +0200 lib/string_helpers: Split out string_choices.h Some users may only need the string choice APIs. Split the respective header, i.e. string_choices.h. Include it in the string_helpers.h for backward compatibility. Signed-off-by: Andy Shevchenko commit 27896ffd8fe41a6f052962c2fb1573daa6476f13 Author: Andy Shevchenko Date: Mon Mar 6 21:55:41 2023 +0200 lib/string_helpers: Add missing header files to MAINTAINERS database The header files string.h and string_helpers.h are missing in the MAINTAINERS. Add them. Signed-off-by: Andy Shevchenko commit d16b3af46679a1eb21652c37711a60d3d4e6b8c0 Author: Miaohe Lin Date: Sat Jun 10 11:57:37 2023 +0800 cgroup: remove unused task_cgroup_path() task_cgroup_path() is not used anymore. So remove it. Signed-off-by: Miaohe Lin Signed-off-by: Tejun Heo commit aa8a950a5d6b2094830aff834198777371ff91ff Author: Hans de Goede Date: Thu Jun 8 11:12:58 2023 +0200 ACPI: video: Stop trying to use vendor backlight control on laptops from after ~2012 There have been 2 separate reports now about a non working "dell_backlight" device getting registered under /sys/class/backlight 1 report for a Raptor Lake based Dell and 1 report for a Meteor Lake (development) platform. On hw from the last 10 years dell-laptop will not register "dell_backlight" because acpi_video_get_backlight_type() will return acpi_backlight_video there if called before the GPU/kms driver loads. So it does not matter if the GPU driver's native backlight is registered after dell-laptop loads. But it seems that on the latest generation laptops the ACPI tables no longer contain acpi_video backlight control support which causes acpi_video_get_backlight_type() to return acpi_backlight_vendor causing "dell_backlight" to get registered if the dell-laptop module is loaded before the GPU/kms driver. Vendor specific backlight control like the "dell_backlight" device is only necessary on quite old hw (from before acpi_video backlight control was introduced). Work around "dell_backlight" registering on very new hw (where acpi_video backlight control seems to be no more) by making acpi_video_get_backlight_type() return acpi_backlight_none instead of acpi_backlight_vendor as final fallback when the ACPI tables have support for Windows 8 or later (laptops from after ~2012). Suggested-by: Matthew Garrett Reported-by: AceLan Kao Closes: https://lore.kernel.org/platform-driver-x86/20230607034331.576623-1-acelan.kao@canonical.com/ Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit ba49f976885869835a1783863376221dc24f1817 Author: Arnd Bergmann Date: Fri Jun 2 15:50:18 2023 +0200 bpf: Hide unused bpf_patch_call_args This function is only used when CONFIG_BPF_JIT_ALWAYS_ON is disabled, but CONFIG_BPF_SYSCALL is enabled. When both are turned off, the prototype is missing but the unused function is still compiled, as seen from this W=1 warning: [...] kernel/bpf/core.c:2075:6: error: no previous prototype for 'bpf_patch_call_args' [-Werror=missing-prototypes] [...] Add a matching #ifdef for the definition to leave it out. Signed-off-by: Arnd Bergmann Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20230602135128.1498362-1-arnd@kernel.org commit 5273ee254e34cf577460dc8eb786b26a7b5329d8 Author: Miaohe Lin Date: Sat Jun 10 14:41:38 2023 +0800 cgroup/cpuset: remove unneeded header files Remove some unnecessary header files. No functional change intended. Signed-off-by: Miaohe Lin Signed-off-by: Tejun Heo commit febdfa0e9c8a5d3a3d895245d1c294c26787daef Author: Takashi Iwai Date: Mon Jun 12 10:10:54 2023 +0200 ALSA: docs: Update MIDI 2.0 documentation for UMP 1.1 enhancement There have been a few enhancements for the new UMP 1.1 features. Update the documentation accordingly. Link: https://lore.kernel.org/r/20230612081054.17200-11-tiwai@suse.de Signed-off-by: Takashi Iwai commit 01dfa8e969dbbc72fc4564e8d61c905c4f3a2352 Author: Takashi Iwai Date: Mon Jun 12 10:10:53 2023 +0200 ALSA: ump: Add info flag bit for static blocks UMP v1.1 spec allows to inform whether the function blocks are static and not dynamically updated. Add a new flag bit to snd_ump_endpoint_info to reflect that attribute, too. The flag is set when a USB MIDI device is still in the old MIDI 2.0 without UMP 1.1 support. Then the driver falls back to GTBs, and they are supposed to be static-only. Link: https://lore.kernel.org/r/20230612081054.17200-10-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6a8b4800ae54e9ceb8d017bcfb61d04ff0da90f2 Author: Takashi Iwai Date: Mon Jun 12 10:10:52 2023 +0200 ALSA: seq: ump: Notify UMP protocol change to sequencer UMP v1.1 supports the protocol switch via a UMP Stream message. When it's received, we need to take care of the midi_version field in the corresponding sequencer client, too. This patch introduces a new ops to notify the protocol change to snd_seq_ump_ops for handling it. Link: https://lore.kernel.org/r/20230612081054.17200-9-tiwai@suse.de Signed-off-by: Takashi Iwai commit 174a6dfbc17ee9defed4daeeea6061ef34644f02 Author: Takashi Iwai Date: Mon Jun 12 10:10:51 2023 +0200 ALSA: seq: ump: Notify port changes to system port For allowing applications to track the FB active changes, this patch adds the notification from the system port at each time a FB change is handled and the active flag or re-grouping happens. Link: https://lore.kernel.org/r/20230612081054.17200-8-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4a16a3af05712e7fd5a205f34e2908055bd9fb5e Author: Takashi Iwai Date: Mon Jun 12 10:10:50 2023 +0200 ALSA: seq: ump: Handle FB info update This patch implements the handling of the dynamic update of FB info. When the FB info update is received after the initial parsing, it means the dynamic FB info update. We compare the result, and if the actual update is detected, it's notified via a new ops, notify_fb_change, to the sequencer client, and the corresponding sequencer ports are updated accordingly. Link: https://lore.kernel.org/r/20230612081054.17200-7-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5437ac9bad639bb9112e1a749acbe4a143562cdc Author: Takashi Iwai Date: Mon Jun 12 10:10:49 2023 +0200 ALSA: seq: ump: Handle groupless messages The UMP Utility and Stream messages are "groupless", i.e. an incoming groupless packet should be sent only to the UMP EP port, and the event with the groupless message is sent to UMP EP as is without the group translation per port. Also, the former reserved bit 0 for the client group filter is now used for groupless events. When the bit 0 is set, the groupless events are filtered out and skipped. Link: https://lore.kernel.org/r/20230612081054.17200-6-tiwai@suse.de Signed-off-by: Takashi Iwai commit 960a1149c8fa70c221c70eaa13903ff873ba1873 Author: Takashi Iwai Date: Mon Jun 12 10:10:48 2023 +0200 ALSA: usb-audio: Add midi2_ump_probe option Add a new option to enable/disable the UMP Endpoint probing. Some firmware seems screwed up when such a new command issued, and this option allows user to suppress it. Link: https://lore.kernel.org/r/20230612081054.17200-5-tiwai@suse.de Signed-off-by: Takashi Iwai commit 54852e8f401a70b3a0197737122be523639dc62f Author: Takashi Iwai Date: Mon Jun 12 10:10:47 2023 +0200 ALSA: usb-audio: Parse UMP Endpoint and Function Blocks at first Try to parse the UMP Endpoint and UMP Function Blocks for building the topology at first. Only when those are missing (e.g. on an older USB MIDI 2.0 spec or a unidirectional endpoint), the driver still creates blocks based on USB group terminal block information as fallback. Link: https://lore.kernel.org/r/20230612081054.17200-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit 37e0e14128e0685267dc5c037bf655421a6ce2ea Author: Takashi Iwai Date: Mon Jun 12 10:10:46 2023 +0200 ALSA: ump: Support UMP Endpoint and Function Block parsing This patch adds the basic support for UMP Endpoint and UMP Function Block parsing, which are extended in the new UMP v1.1 spec. The patch provides a new helper function to perform the query of the UMP Endpoint information and builds up the UMP blocks based on UMP Function Block information. For the communication over the UMP Endpoint, it opens the rawmidi device once internally, inquiries the UMP Endpoint and Function Block info by sending new UMP Stream messages, and waits for the response for each query. The new UMP spec allows to update the FB info and change its associated groups or its activeness on the fly, too. For catching it, the UMP core keeps watching the incoming UMP messages, and snd_ump_receive() handles the incoming UMP Stream messages to refresh the FB info. Link: https://lore.kernel.org/r/20230612081054.17200-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit e375b8a045873cf5fb8bf61bf9a0ddfcd484243a Author: Takashi Iwai Date: Mon Jun 12 10:10:45 2023 +0200 ALSA: ump: Add more attributes to UMP EP and FB info Add a few more fields to snd_ump_endpoint_info and snd_ump_block_info that are added in the new v1.1 spec. Those are filled by the UMP Stream messages. The rawmidi protocol version is bumped to 2.0.4 to indicate those updates. Also, update the proc outputs to show the newly introduced fields. Link: https://lore.kernel.org/r/20230612081054.17200-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4080a0e7b36b7bb103dc739779a338d412c78943 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:26 2023 +0200 dt-bindings: display: mediatek: od: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795's OverDrive (OD) block: this is the same as MT8173. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Acked-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-15-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit c4b50cdf9d9d7962d58ece5efba865f56ec40398 Author: Chuck Lever Date: Mon Jun 12 10:10:14 2023 -0400 svcrdma: Revert 2a1e4f21d841 ("svcrdma: Normalize Send page handling") Get rid of the completion wait in svc_rdma_sendto(), and release pages in the send completion handler again. A subsequent patch will handle releasing those pages more efficiently. Reverted by hand: patch -R would not apply cleanly. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit a944209c11aff9a5c9b7987fc958cc2344dca51f Author: Chuck Lever Date: Mon Jun 12 10:10:07 2023 -0400 SUNRPC: Revert 579900670ac7 ("svcrdma: Remove unused sc_pages field") Pre-requisite for releasing pages in the send completion handler. Reverted by hand: patch -R would not apply cleanly. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 6be7afcd92cd426428b94dd7e258b2472a45cde7 Author: Chuck Lever Date: Mon Jun 12 10:10:01 2023 -0400 SUNRPC: Revert cc93ce9529a6 ("svcrdma: Retain the page backing rq_res.head[0].iov_base") Pre-requisite for releasing pages in the send completion handler. Reverted by hand: patch -R would not apply cleanly. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 58f5d894006d82ed7335e1c37182fbc5f08c2f51 Author: Dai Ngo Date: Tue Jun 6 16:41:02 2023 -0700 NFSD: add encoding of op_recall flag for write delegation Modified nfsd4_encode_open to encode the op_recall flag properly for OPEN result with write delegation granted. Signed-off-by: Dai Ngo Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever Cc: stable@vger.kernel.org commit 8111c17cfcb322d13622eb3fb1a5de5b9e6b163b Author: Chuck Lever Date: Mon Jun 5 09:12:45 2023 -0400 NFSD: Add "official" reviewers for this subsystem At LFS 2023, it was suggested we should publicly document the name and email of reviewers who new contributors can trust. This also gives them some recognition for their work as reviewers. Acked-by: Tom Talpey Signed-off-by: Chuck Lever commit b1c6ffb267285e20bfe53b7180e4ce785cab2a97 Author: Chuck Lever Date: Mon Jun 5 09:12:38 2023 -0400 mailmap: Add Bruce Fields' latest e-mail addresses Ensure that Bruce's old e-mail addresses map to his current one so he doesn't miss out on all the fun. Signed-off-by: Chuck Lever commit ac3c32bbdb0e3f787333ae67d650868b6ef5c9a7 Author: Chuck Lever Date: Mon Jun 5 09:11:43 2023 -0400 svcrdma: Clean up allocation of svc_rdma_rw_ctxt The physical device's favored NUMA node ID is available when allocating a rw_ctxt. Use that value instead of relying on the assumption that the memory allocation happens to be running on a node close to the device. Signed-off-by: Chuck Lever commit ed51b426101427c90c14696f073ef8fe71a806f9 Author: Chuck Lever Date: Mon Jun 5 09:11:37 2023 -0400 svcrdma: Clean up allocation of svc_rdma_send_ctxt The physical device's favored NUMA node ID is available when allocating a send_ctxt. Use that value instead of relying on the assumption that the memory allocation happens to be running on a node close to the device. Signed-off-by: Chuck Lever commit c5d68d25bd6b5798bf0eb96661e1b26748e970d7 Author: Chuck Lever Date: Mon Jun 5 09:11:30 2023 -0400 svcrdma: Clean up allocation of svc_rdma_recv_ctxt The physical device's favored NUMA node ID is available when allocating a recv_ctxt. Use that value instead of relying on the assumption that the memory allocation happens to be running on a node close to the device. This clean up eliminates the hack of destroying recv_ctxts that were not created by the receive CQ thread -- recv_ctxts are now always allocated on a "good" node. Signed-off-by: Chuck Lever commit fe2b401e55482cf90a0056209c8a232b2d39056c Author: Chuck Lever Date: Mon Jun 5 09:11:24 2023 -0400 svcrdma: Allocate new transports on device's NUMA node The physical device's NUMA node ID is available when allocating an svc_xprt for an incoming connection. Use that value to ensure the svc_xprt structure is allocated on the NUMA node closest to the device. Signed-off-by: Chuck Lever commit 665e89ab7c5af1f2d260834c861a74b01a30f95f Author: NeilBrown Date: Sat Jun 3 07:14:14 2023 +1000 lockd: drop inappropriate svc_get() from locked_get() The below-mentioned patch was intended to simplify refcounting on the svc_serv used by locked. The goal was to only ever have a single reference from the single thread. To that end we dropped a call to lockd_start_svc() (except when creating thread) which would take a reference, and dropped the svc_put(serv) that would drop that reference. Unfortunately we didn't also remove the svc_get() from lockd_create_svc() in the case where the svc_serv already existed. So after the patch: - on the first call the svc_serv was allocated and the one reference was given to the thread, so there are no extra references - on subsequent calls svc_get() was called so there is now an extra reference. This is clearly not consistent. The inconsistency is also clear in the current code in lockd_get() takes *two* references, one on nlmsvc_serv and one by incrementing nlmsvc_users. This clearly does not match lockd_put(). So: drop that svc_get() from lockd_get() (which used to be in lockd_create_svc(). Reported-by: Ido Schimmel Closes: https://lore.kernel.org/linux-nfs/ZHsI%2FH16VX9kJQX1@shredder/T/#u Fixes: b73a2972041b ("lockd: move lockd_start_svc() call into lockd_create_svc()") Signed-off-by: NeilBrown Tested-by: Ido Schimmel Signed-off-by: Chuck Lever commit c769eccefbb3c6c516e38704bdca386531640170 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:25 2023 +0200 dt-bindings: display: mediatek: ufoe: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795's UFOE block: this is the same as MT8173. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Acked-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-14-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 5dfd9bb376d9754c52ee6a3ef61c63869b5a36b3 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:24 2023 +0200 dt-bindings: display: mediatek: split: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795's SPLIT block: this is the same as MT8173. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Acked-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-13-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 400ab909b7cd41a60838f0f27503d7cfc9cc7030 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:23 2023 +0200 dt-bindings: display: mediatek: merge: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795's MERGE block: this is the same as MT8173. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Acked-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-12-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 84e05dc1f94d53ecbafb3176b1ce8f2988a1262f Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:22 2023 +0200 dt-bindings: display: mediatek: gamma: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795's GAMMA block: this is the same as MT8173. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-11-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 791a9974fcaac826c4ff716a5b663f176d315ff3 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:21 2023 +0200 dt-bindings: display: mediatek: color: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795's COLOR block: this is the same as MT8173. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Acked-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-10-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 8f2a42046cb60a937481d1d3979bedb86166c6b4 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:20 2023 +0200 dt-bindings: display: mediatek: wdma: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795's WDMA block: this is the same as MT8173. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Acked-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-9-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 4f1731df60f9033669f024d06ae26a6301260b55 Author: Yu Kuai Date: Sat Jun 10 10:30:43 2023 +0800 blk-mq: fix potential io hang by wrong 'wake_batch' In __blk_mq_tag_busy/idle(), updating 'active_queues' and calculating 'wake_batch' is not atomic: t1: t2: _blk_mq_tag_busy blk_mq_tag_busy inc active_queues // assume 1->2 inc active_queues // 2 -> 3 blk_mq_update_wake_batch // calculate based on 3 blk_mq_update_wake_batch /* calculate based on 2, while active_queues is actually 3. */ Fix this problem by protecting them wih 'tags->lock', this is not a hot path, so performance should not be concerned. And now that all writers are inside the lock, switch 'actives_queues' from atomic to unsigned int. Fixes: 180dccb0dba4 ("blk-mq: fix tag_get wait task can't be awakened") Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230610023043.2559121-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 48ed9e648722cb2e23936df5f1b6eaf080dc9046 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:19 2023 +0200 dt-bindings: display: mediatek: rdma: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795's RDMA block: this is the same as MT8173. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-8-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 35b7a18c59a146635ecf368a9c10e5074a099a43 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:18 2023 +0200 dt-bindings: display: mediatek: ovl: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795's OVL block: this is the same as MT8173. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-7-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 28c143af8bc954b3167534b0475cc25d1b3eea34 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:17 2023 +0200 dt-bindings: display: mediatek: dsi: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795, using the same DSI block as MT8173. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-6-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 4826c59453b3b4677d6bf72814e7ababdea86949 Author: Jens Axboe Date: Sun Jun 11 21:14:09 2023 -0600 io_uring: wait interruptibly for request completions on exit WHen the ring exits, cleanup is done and the final cancelation and waiting on completions is done by io_ring_exit_work. That function is invoked by kworker, which doesn't take any signals. Because of that, it doesn't really matter if we wait for completions in TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE state. However, it does matter to the hung task detection checker! Normally we expect cancelations and completions to happen rather quickly. Some test cases, however, will exit the ring and park the owning task stopped (eg via SIGSTOP). If the owning task needs to run task_work to complete requests, then io_ring_exit_work won't make any progress until the task is runnable again. Hence io_ring_exit_work can trigger the hung task detection, which is particularly problematic if panic-on-hung-task is enabled. As the ring exit doesn't take signals to begin with, have it wait interruptibly rather than uninterruptibly. io_uring has a separate stuck-exit warning that triggers independently anyway, so we're not really missing anything by making this switch. Cc: stable@vger.kernel.org # 5.10+ Link: https://lore.kernel.org/r/b0e4aaef-7088-56ce-244c-976edeac0e66@kernel.dk Signed-off-by: Jens Axboe commit d8720452fe0fee795517d69bc73820ec6c1c4727 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:16 2023 +0200 dt-bindings: display: mediatek: aal: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795: similarly to MT8173, this SoC has the gamma LUT registers in DISP_AAL. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Reviewed-by: Alexandre Mergnat Acked-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-5-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit b84c6b26a6509f7570d099c0a1dfcebf440f1b30 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:15 2023 +0200 dt-bindings: display: mediatek: dpi: Add compatible for MediaTek MT6795 Add a compatible string for the MediaTek Helio X10 MT6795 SoC, using the same parameters as MT8183. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Reviewed-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230412112739.160376-4-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 83e92e301eb2f1eee9415eca55ce1547d22dae6f Author: Suzuki K Poulose Date: Thu Jun 8 16:20:45 2023 +0100 MAINTAINERS: coresight: Add James Clark as Reviewer James has made significant contributions to the CoreSight subsystem both with code and reviews. Add James to the Reviewer for the subsystem. Cc: James Clark Signed-off-by: Suzuki K Poulose Acked-by: James Clark Link: https://lore.kernel.org/r/20230608152045.112349-1-suzuki.poulose@arm.com commit b23ed4d74c4d583b5f621ee4c776699442833554 Author: Eduard Zingerman Date: Sat Jun 10 01:16:37 2023 +0300 selftests/bpf: Fix invalid pointer check in get_xlated_program() Dan Carpenter reported invalid check for calloc() result in test_verifier.c:get_xlated_program(): ./tools/testing/selftests/bpf/test_verifier.c:1365 get_xlated_program() warn: variable dereferenced before check 'buf' (see line 1364) ./tools/testing/selftests/bpf/test_verifier.c 1363 *cnt = xlated_prog_len / buf_element_size; 1364 *buf = calloc(*cnt, buf_element_size); 1365 if (!buf) { This should be if (!*buf) { 1366 perror("can't allocate xlated program buffer"); 1367 return -ENOMEM; This commit refactors the get_xlated_program() to avoid using double pointer type. Fixes: 933ff53191eb ("selftests/bpf: specify expected instructions in test_verifier tests") Reported-by: Dan Carpenter Signed-off-by: Eduard Zingerman Signed-off-by: Daniel Borkmann Closes: https://lore.kernel.org/bpf/ZH7u0hEGVB4MjGZq@moroto/ Link: https://lore.kernel.org/bpf/20230609221637.2631800-1-eddyz87@gmail.com commit 0733ad8002916b9dbbbcfe6e92ad44d2657de1c1 Author: Christoph Hellwig Date: Thu Jun 8 13:02:58 2023 +0200 fs: remove the now unused FMODE_* flags FMODE_NDELAY, FMODE_EXCL and FMODE_WRITE_IOCTL were only used for block internal purposed and are now entirely unused, so remove them. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-31-hch@lst.de Signed-off-by: Jens Axboe commit ee3249a8ce78ef014a71b05157a43fba8dc764e3 Author: Christoph Hellwig Date: Thu Jun 8 13:02:57 2023 +0200 block: store the holder in file->private_data Store the file struct used as the holder in file->private_data as an indicator that this file descriptor was opened exclusively to remove the last use of FMODE_EXCL. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20230608110258.189493-30-hch@lst.de Signed-off-by: Jens Axboe commit 4e762d8623448bb9d32711832ce977a65ff7636a Author: Christoph Hellwig Date: Thu Jun 8 13:02:56 2023 +0200 block: always use I_BDEV on file->f_mapping->host to find the bdev Always use I_BDEV(file->f_mapping->host) to find the bdev for a file to free up file->private_data for other uses. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-29-hch@lst.de Signed-off-by: Jens Axboe commit 05bdb9965305bbfdae79b31d22df03d1e2cfcb22 Author: Christoph Hellwig Date: Thu Jun 8 13:02:55 2023 +0200 block: replace fmode_t with a block-specific type for block open flags The only overlap between the block open flags mapped into the fmode_t and other uses of fmode_t are FMODE_READ and FMODE_WRITE. Define a new blk_mode_t instead for use in blkdev_get_by_{dev,path}, ->open and ->ioctl and stop abusing fmode_t. Signed-off-by: Christoph Hellwig Acked-by: Jack Wang [rnbd] Reviewed-by: Hannes Reinecke Reviewed-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-28-hch@lst.de Signed-off-by: Jens Axboe commit 5e4ea834676e3b8965344ca61d36e1ae236249eb Author: Christoph Hellwig Date: Thu Jun 8 13:02:54 2023 +0200 block: remove unused fmode_t arguments from ioctl handlers A few ioctl handlers have fmode_t arguments that are entirely unused, remove them. Signed-off-by: Christoph Hellwig Acked-by: Christian Brauner Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20230608110258.189493-27-hch@lst.de Signed-off-by: Jens Axboe commit cfb425761c79b6056ae5bb73f8d400f03b513959 Author: Christoph Hellwig Date: Thu Jun 8 13:02:53 2023 +0200 block: move a few internal definitions out of blkdev.h All these helpers are only used in core block code, so move them out of the public header. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-26-hch@lst.de Signed-off-by: Jens Axboe commit bd6abfc8e7898ce2163a1ffdbb9ec71a0a081267 Author: Christoph Hellwig Date: Thu Jun 8 13:02:52 2023 +0200 ubd: remove commented out code in ubd_open This code has been dead forever, make sure it doesn't show up in code searches. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Acked-by: Richard Weinberger Link: https://lore.kernel.org/r/20230608110258.189493-25-hch@lst.de Signed-off-by: Jens Axboe commit 99b07780814e89f16bec2773c237eb25121f8502 Author: Christoph Hellwig Date: Thu Jun 8 13:02:51 2023 +0200 rnbd-srv: replace sess->open_flags with a "bool readonly" Stop passing the fmode_t around and just use a simple bool to track if an export is read-only. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Acked-by: Jack Wang Link: https://lore.kernel.org/r/20230608110258.189493-24-hch@lst.de Signed-off-by: Jens Axboe commit 658afed19ceed54a52b9e9e69c0791c8868ff55d Author: Christoph Hellwig Date: Thu Jun 8 13:02:50 2023 +0200 mtd: block: use a simple bool to track open for write Instead of propagating the fmode_t, just use a bool to track if a mtd block device was opened for writing. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Acked-by: Richard Weinberger Link: https://lore.kernel.org/r/20230608110258.189493-23-hch@lst.de Signed-off-by: Jens Axboe commit 7d9d7d59d44b7e9236d168472aa222b6543fae25 Author: Christoph Hellwig Date: Thu Jun 8 13:02:49 2023 +0200 nvme: replace the fmode_t argument to the nvme ioctl handlers with a simple bool Instead of passing a fmode_t and only checking it fo0r FMODE_WRITE, pass a bool open_for_write to prepare for callers that won't have the fmode_t. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Reviewed-by: Keith Busch Link: https://lore.kernel.org/r/20230608110258.189493-22-hch@lst.de Signed-off-by: Jens Axboe commit 1991299e49fa58c3ba7e91599932f84bf537d592 Author: Christoph Hellwig Date: Thu Jun 8 13:02:48 2023 +0200 scsi: replace the fmode_t argument to ->sg_io_fn with a simple bool Instead of passing a fmode_t and only checking it for FMODE_WRITE, pass a bool open_for_write to prepare for callers that won't have the fmode_t. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-21-hch@lst.de Signed-off-by: Jens Axboe commit 2e80089c18241699c41d0af0669cb93844ff0dc1 Author: Christoph Hellwig Date: Thu Jun 8 13:02:47 2023 +0200 scsi: replace the fmode_t argument to scsi_ioctl with a simple bool Instead of passing a fmode_t and only checking it for FMODE_WRITE, pass a bool open_for_write to prepare for callers that won't have the fmode_t. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-20-hch@lst.de Signed-off-by: Jens Axboe commit 5f4eb9d5413fdfc779c099fdaf0ff417eb163145 Author: Christoph Hellwig Date: Thu Jun 8 13:02:46 2023 +0200 scsi: replace the fmode_t argument to scsi_cmd_allowed with a simple bool Instead of passing a fmode_t and only checking it for FMODE_WRITE, pass a bool open_for_write to prepare for callers that won't have the fmode_t. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-19-hch@lst.de Signed-off-by: Jens Axboe commit 81b1fb7d17c0110df839e13468ada9e99bb6e5f4 Author: Christoph Hellwig Date: Thu Jun 8 13:02:45 2023 +0200 fs: remove sb->s_mode There is no real need to store the open mode in the super_block now. It is only used by f2fs, which can easily recalculate it. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-18-hch@lst.de Signed-off-by: Jens Axboe commit 3f0b3e785e8b54a40c530fa77b7ab37bec925c57 Author: Christoph Hellwig Date: Thu Jun 8 13:02:44 2023 +0200 block: add a sb_open_mode helper Add a helper to return the open flags for blkdev_get_by* for passed in super block flags instead of open coding the logic in many places. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-17-hch@lst.de Signed-off-by: Jens Axboe commit 2736e8eeb0ccdc71d1f4256c9c9a28f58cc43307 Author: Christoph Hellwig Date: Thu Jun 8 13:02:43 2023 +0200 block: use the holder as indication for exclusive opens The current interface for exclusive opens is rather confusing as it requires both the FMODE_EXCL flag and a holder. Remove the need to pass FMODE_EXCL and just key off the exclusive open off a non-NULL holder. For blkdev_put this requires adding the holder argument, which provides better debug checking that only the holder actually releases the hold, but at the same time allows removing the now superfluous mode argument. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Acked-by: David Sterba [btrfs] Acked-by: Jack Wang [rnbd] Link: https://lore.kernel.org/r/20230608110258.189493-16-hch@lst.de Signed-off-by: Jens Axboe commit 2ef789288afd365f4245ba97e56189062de5148e Author: Christoph Hellwig Date: Thu Jun 8 13:02:42 2023 +0200 btrfs: don't pass a holder for non-exclusive blkdev_get_by_path Passing a holder to blkdev_get_by_path when FMODE_EXCL isn't set doesn't make sense, so pass NULL instead and remove the holder argument from the call chains the only end up in non-FMODE_EXCL blkdev_get_by_path calls. Exclusive mode for device scanning is not used since commit 50d281fc434c ("btrfs: scan device in non-exclusive mode")". Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Acked-by: David Sterba Link: https://lore.kernel.org/r/20230608110258.189493-15-hch@lst.de Signed-off-by: Jens Axboe commit 5ee607675debef509946f8a251d4c30a21493ec2 Author: Christoph Hellwig Date: Thu Jun 8 13:02:41 2023 +0200 rnbd-srv: don't pass a holder for non-exclusive blkdev_get_by_path Passing a holder to blkdev_get_by_path when FMODE_EXCL isn't set doesn't make sense, so pass NULL instead. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Acked-by: Jack Wang Link: https://lore.kernel.org/r/20230608110258.189493-14-hch@lst.de Signed-off-by: Jens Axboe commit 29499ab060fec044161be73fb0e448eab97b4813 Author: Christoph Hellwig Date: Thu Jun 8 13:02:40 2023 +0200 bcache: don't pass a stack address to blkdev_get_by_path sb is just an on-stack pointer that can easily be reused by other calls. Switch to use the bcache-wide bcache_kobj instead as there is no need to claim per-bcache device anyway. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20230608110258.189493-13-hch@lst.de Signed-off-by: Jens Axboe commit c889d0793d9dc07e94a5fddcc05356157fab00b7 Author: Christoph Hellwig Date: Thu Jun 8 13:02:39 2023 +0200 swsusp: don't pass a stack address to blkdev_get_by_path holder is just an on-stack pointer that can easily be reused by other calls, replace it with a static variable that doesn't change. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230608110258.189493-12-hch@lst.de Signed-off-by: Jens Axboe commit 7ee34cbc291a28134b60683b246ba58b4b676ec3 Author: Christoph Hellwig Date: Thu Jun 8 13:02:38 2023 +0200 block: rename blkdev_close to blkdev_release Make the function name match the method name. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-11-hch@lst.de Signed-off-by: Jens Axboe commit ae220766d87cd6799dbf918fea10613ae14c0654 Author: Christoph Hellwig Date: Thu Jun 8 13:02:37 2023 +0200 block: remove the unused mode argument to ->release The mode argument to the ->release block_device_operation is never used, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Acked-by: Jack Wang [rnbd] Link: https://lore.kernel.org/r/20230608110258.189493-10-hch@lst.de Signed-off-by: Jens Axboe commit d32e2bf83791727a84ad5d3e3d713e82f9adbe30 Author: Christoph Hellwig Date: Thu Jun 8 13:02:36 2023 +0200 block: pass a gendisk to ->open ->open is only called on the whole device. Make that explicit by passing a gendisk instead of the block_device. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Acked-by: Jack Wang [rnbd] Link: https://lore.kernel.org/r/20230608110258.189493-9-hch@lst.de Signed-off-by: Jens Axboe commit 444aa2c58cb3b6cfe3b7cc7db6c294d73393a894 Author: Christoph Hellwig Date: Thu Jun 8 13:02:35 2023 +0200 block: pass a gendisk on bdev_check_media_change bdev_check_media_change should only ever be called for the whole device. Pass a gendisk to make that explicit and rename the function to disk_check_media_change. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-8-hch@lst.de Signed-off-by: Jens Axboe commit 7ae24fcee9929f9002b84d8121144b2b3590b58c Author: Christoph Hellwig Date: Thu Jun 8 13:02:34 2023 +0200 cdrom: remove the unused mode argument to cdrom_release Signed-off-by: Christoph Hellwig Reviewed-by: Phillip Potter Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-7-hch@lst.de Signed-off-by: Jens Axboe commit 8cdf433e2b8e4fc6c7b4393deb93fb258175d537 Author: Christoph Hellwig Date: Thu Jun 8 13:02:33 2023 +0200 cdrom: track if a cdrom_device_info was opened for data Set a flag when a cdrom_device_info is opened for writing, instead of trying to figure out this at release time. This will allow to eventually remove the mode argument to the ->release block_device_operation as nothing but the CDROM drivers uses that argument. Signed-off-by: Christoph Hellwig Reviewed-by: Phillip Potter Acked-by: Christian Brauner Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20230608110258.189493-6-hch@lst.de Signed-off-by: Jens Axboe commit a4cec8bc14c02e15006a71f02b0e1bbc72b9f796 Author: Christoph Hellwig Date: Thu Jun 8 13:02:32 2023 +0200 cdrom: remove the unused cdrom_close_write release code cdrom_close_write is empty, and the for_data flag it is keyed off is never set. Remove all this clutter. Signed-off-by: Christoph Hellwig Reviewed-by: Phillip Potter Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-5-hch@lst.de Signed-off-by: Jens Axboe commit 473399b50de1fdc12606254351273c71d1786251 Author: Christoph Hellwig Date: Thu Jun 8 13:02:31 2023 +0200 cdrom: remove the unused mode argument to cdrom_ioctl Signed-off-by: Christoph Hellwig Reviewed-by: Phillip Potter Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-4-hch@lst.de Signed-off-by: Jens Axboe commit 764b83100b9aff52f950e408539c22a37cdedae8 Author: Christoph Hellwig Date: Thu Jun 8 13:02:30 2023 +0200 cdrom: remove the unused bdev argument to cdrom_open Signed-off-by: Christoph Hellwig Reviewed-by: Phillip Potter Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-3-hch@lst.de Signed-off-by: Jens Axboe commit 9d1c92872e7082f100f629a58b32fa0214aa1aec Author: Christoph Hellwig Date: Thu Jun 8 13:02:29 2023 +0200 block: also call ->open for incremental partition opens For whole devices ->open is called for each open, but for partitions it is only called on the first open of a partition, e.g.: open("/dev/vdb", ...) open("/dev/vdb", ...) - 2 call to ->open open("/dev/vdb1", ...) open("/dev/vdb", ...) - 2 call to ->open open("/dev/vdb", ...) open("/dev/vdb", ...) - just open call to ->open This is problematic as various block drivers look at open flags and might not do all the required setup if the earlier open was with an odd flag like O_NDELAY or the magic 3 ioctl-only open mode. Signed-off-by: Christoph Hellwig Reviewed-by: Phillip Potter Reviewed-by: Hannes Reinecke Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20230608110258.189493-2-hch@lst.de Signed-off-by: Jens Axboe commit d692cc619247addcb9336c220ea1face91b365f0 Author: Uwe Kleine-König Date: Sun Jun 11 22:35:59 2023 +0200 regulator: Switch two more i2c drivers back to use .probe() The previous conversion back to .probe done in commit 964e186547b2 ("regulator: Switch i2c drivers back to use .probe()") was done based on v6.3. Since then two more drivers were added which need to be convert back in the same way before eventually .probe_new() can be dropped from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230611203559.827168-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit d32758acbd4eee8ce95b705a6760526b4d26c2aa Author: Mark Brown Date: Sat Jun 10 15:05:54 2023 +0100 regmap: Don't check for changes in regcache_set_val() The only user of regcache_set_val() ignores the return value so we may as well not bother checking if the value we are trying to set is the same as the value already stored. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-regcache-set-val-no-ret-v1-1-9a6932760cf8@kernel.org Signed-off-by: Mark Brown commit bfa0b38c148379c8a8c52e23bbdcb086414fb354 Author: Mark Brown Date: Sun Jun 11 13:06:07 2023 +0100 regmap: maple: Implement block sync for the maple tree cache For register maps where we can write multiple values in a single bus operation it is generally much faster to do so. Improve the performance of maple tree cache syncs on such devices by identifying blocks of adjacent registers that need to be written out and combining them into a single operation. Combining writes does mean that we need to allocate a scratch buffer and format the data into it but it is expected that for most cases where caches are in use the cost of I/O will be much greater than the cost of doing the allocation and format. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-regcache-maple-sync-raw-v1-1-8ddeb4e2b9ab@kernel.org Signed-off-by: Mark Brown commit b7c268638db1a27305abe9cb371c13c3a7a8868b Merge: 99e8dd39f3433 858fd168a95c5 Author: Mark Brown Date: Mon Jun 12 14:50:15 2023 +0100 regmap: Merge up v6.4-rc6 The fix for maple tree RCU locking on sync is a dependency for the block sync code for the maple tree. commit 155a6bd6375b584c8bdbf963b8ddef672ff9aca3 Author: Mark Brown Date: Sun Jun 11 14:25:03 2023 +0100 regmap: Provide basic KUnit coverage for the raw register I/O Simple tests that cover basic raw I/O, plus basic coverage of cache sync since the caches generate bulk I/O with raw register maps. This could be more comprehensive but it is good for testing generic code. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230610-regcache-raw-kunit-v1-2-583112cd28ac@kernel.org Signed-off-by: Mark Brown commit 65dd2f671875b1d97b6fa9bcf7677f5e1c55f776 Author: Mark Brown Date: Sun Jun 11 14:25:02 2023 +0100 regmap: Provide a ram backed regmap with raw support Provide a simple, 16 bit only, RAM backed regmap which supports raw I/O for use in testing. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230610-regcache-raw-kunit-v1-1-583112cd28ac@kernel.org Signed-off-by: Mark Brown commit fd6f223639b834d169218ff3f53e2f6e9f8c1790 Author: Kuninori Morimoto Date: Mon Jun 12 01:59:34 2023 +0000 ASoC: audio-graph-card2-custom-sample.dtsi: remove DT warning Current audio-graph-card2-custom-sample.dtsi is missing address-cells / size-cells / reg. Thus it get too many DT warnings. This patch solved it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87a5x5qw3d.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 947e3960a72aa51d8643098851534baa5cc6538b Author: Uwe Kleine-König Date: Mon Jun 12 09:06:08 2023 +0200 ASoC: Switch two more i2c drivers back to use .probe() The previous conversion back to .probe() applied in commit 9abcd24002bf ("ASoC: Switch i2c drivers back to use .probe()") was created based on v6.3. Since then two more drivers were added which need to be convert back in the same way before eventually .probe_new() can be dropped from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230612070608.836186-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 374b54532b1c94076799518cad5c33536eaf0c1b Author: Krzysztof Kozlowski Date: Fri Jun 9 16:06:58 2023 +0200 ASoC: dt-bindings: cirrus,cs35l45: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230609140658.64557-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit f9c058d14f4fe23ef523a7ff73734d51c151683c Author: Ricardo Ribalda Delgado Date: Mon Jun 12 11:05:32 2023 +0200 ASoC: mediatek: mt8173: Fix irq error path After reordering the irq probe, the error path was not properly done. Lets fix it. Reported-by: Dan Carpenter Cc: stable@kernel.org Fixes: 4cbb264d4e91 ("ASoC: mediatek: mt8173: Enable IRQ when pdata is ready") Signed-off-by: Ricardo Ribalda Delgado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230612-mt8173-fixup-v2-2-432aa99ce24d@chromium.org Signed-off-by: Mark Brown commit a46d37012a5be1737393b8f82fd35665e4556eee Author: Ricardo Ribalda Delgado Date: Mon Jun 12 11:05:31 2023 +0200 ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path If the second component fails to initialize, cleanup the first on. Reported-by: Dan Carpenter Cc: stable@kernel.org Fixes: f1b5bf07365d ("ASoC: mt2701/mt8173: replace platform to component") Signed-off-by: Ricardo Ribalda Delgado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230612-mt8173-fixup-v2-1-432aa99ce24d@chromium.org Signed-off-by: Mark Brown commit 51bdf6ebe5b7da8d1b86cf66fe7e21de353e5218 Author: Brent Lu Date: Mon Jun 12 19:09:58 2023 +0800 ASoC: Intel: avs-ssm4567: remove redundant dapm routes Four routes "Left Playback<-sspX Tx", "Right Playback<-sspX Tx", "sspX Rx<-Left Capture Sense", and "sspX Rx<-Right Capture Sense" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-13-brent.lu@intel.com Signed-off-by: Mark Brown commit 96b5452fe43c23451050b3efa5197bd10dce9bc6 Author: Brent Lu Date: Mon Jun 12 19:09:57 2023 +0800 ASoC: Intel: avs-rt5682: remove redundant dapm routes Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-12-brent.lu@intel.com Signed-off-by: Mark Brown commit eae0655316a5d741ab27c7b3a67a55b0af970e19 Author: Brent Lu Date: Mon Jun 12 19:09:56 2023 +0800 ASoC: Intel: avs-rt298: remove redundant dapm routes Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-11-brent.lu@intel.com Signed-off-by: Mark Brown commit cca1ac1f097afa7ad6e587d6f1e86fd738ede508 Author: Brent Lu Date: Mon Jun 12 19:09:55 2023 +0800 ASoC: Intel: avs-rt286: remove redundant dapm routes Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-10-brent.lu@intel.com Signed-off-by: Mark Brown commit 6227269fb375af2ff239a68499856abfd6a2bceb Author: Brent Lu Date: Mon Jun 12 19:09:54 2023 +0800 ASoC: Intel: avs-rt274: remove redundant dapm routes Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-9-brent.lu@intel.com Signed-off-by: Mark Brown commit ae7d66822de5aeaf991eda96c823ee9dffebfe46 Author: Brent Lu Date: Mon Jun 12 19:09:53 2023 +0800 ASoC: Intel: avs-nau8825: remove redundant dapm routes Two routes "Playback<-sspX Tx" and "sspX Rx<-Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-8-brent.lu@intel.com Signed-off-by: Mark Brown commit 9868ca64fd7a87cf997040452519b07e47a8d008 Author: Brent Lu Date: Mon Jun 12 19:09:52 2023 +0800 ASoC: Intel: avs-max98927: remove redundant dapm routes Two routes "Left HiFi Playback<-sspX Tx" and "Right HiFi Playback<-sspX Tx" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-7-brent.lu@intel.com Signed-off-by: Mark Brown commit b4df7ce9905b1e8cb84ee247ca7db6ae004bc508 Author: Brent Lu Date: Mon Jun 12 19:09:51 2023 +0800 ASoC: Intel: avs-max98373: remove redundant dapm routes Two routes "Left HiFi Playback<-sspX Tx" and "Right HiFi Playback<-sspX Tx" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-6-brent.lu@intel.com Signed-off-by: Mark Brown commit d48e3cd5aaecd7769b073f65bb95004a54bc76e6 Author: Brent Lu Date: Mon Jun 12 19:09:50 2023 +0800 ASoC: Intel: avs-max98357a: remove redundant dapm routes The route "HiFi Playback<-sspX Tx" is created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-5-brent.lu@intel.com Signed-off-by: Mark Brown commit 12ea56d73c548929ef1a498848905b04bfe85f90 Author: Brent Lu Date: Mon Jun 12 19:09:49 2023 +0800 ASoC: Intel: avs-hdaudio: remove redundant dapm routes Three routes "HDMI 0 Playback<-hdaudioB0D2-cpu0 Tx", "HDMI 1 Playback<-hdaudioB0D2-cpu1 Tx" and "HDMI 2 Playback<-hdaudioB0D2-cpu2 Tx" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-4-brent.lu@intel.com Signed-off-by: Mark Brown commit c2076f4fa4f15559ed7e568186c4089479a62154 Author: Brent Lu Date: Mon Jun 12 19:09:48 2023 +0800 ASoC: Intel: avs-dmic: remove redundant dapm routes Two routes "DMIC Rx<-Capture" and "DMIC WoV Rx<-Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-3-brent.lu@intel.com Signed-off-by: Mark Brown commit 530ca0a7ed04230408775b495034941346ea5db1 Author: Brent Lu Date: Mon Jun 12 19:09:47 2023 +0800 ASoC: Intel: avs-da7219: remove redundant dapm routes Two routes "Playback<-sspX Tx" and "sspX Rx<-Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230612110958.592674-2-brent.lu@intel.com Signed-off-by: Mark Brown commit c7eed31e235ceeaaab505f4b10649f5f95c7d319 Author: Abel Vesa Date: Sun Apr 9 00:40:41 2023 +0300 mmc: sdhci-msm: Switch to the new ICE API Now that there is a new dedicated ICE driver, drop the sdhci-msm ICE implementation and use the new ICE api provided by the Qualcomm soc driver ice. The platforms that already have ICE support will use the API as library since there will not be a devicetree node, but instead they have reg range. In this case, the of_qcom_ice_get will return an ICE instance created for the consumer's device. But if there are platforms that do not have ice reg in the consumer devicetree node and instead provide a dedicated ICE devicetree node, theof_qcom_ice_get will look up the device based on qcom,ice property and will get the ICE instance registered by the probe function of the ice driver. The ICE clock is now handle by the new driver. This is done by enabling it on the creation of the ICE instance and then enabling/disabling it on SDCC runtime resume/suspend. Signed-off-by: Abel Vesa Acked-by: Adrian Hunter Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20230408214041.533749-4-abel.vesa@linaro.org Signed-off-by: Ulf Hansson commit 8414061cd9c2ef33c533c297e00376060fb6d157 Author: Stefan Wahren Date: Sun Jun 4 14:12:21 2023 +0200 dt-bindings: mmc: convert bcm2835-sdhost bindings to YAML Convert the DT binding document for bcm2835-sdhost from .txt to YAML. Signed-off-by: Stefan Wahren Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230604121223.9625-9-stefan.wahren@i2se.com Signed-off-by: Ulf Hansson commit 0e92aec2efa04a9e0a5b3a927dab06773dd814ca Author: Victor Shih Date: Fri Jun 9 15:14:41 2023 +0800 mmc: sdhci-pci-gli: Add support SD Express card for GL9767 Add support SD Express card for GL9767. The workflow of the SD Express card in GL9767 is as below. 1. GL9767 operates in SD mode and set MMC_CAP2_SD_EXP flag. 2. If card is inserted, Host send CMD8 to ask the capabilities of the card. 3. If the card has PCIe capability, then init_sd_express() will be invoked. 4. If the card has been put in write protect state then the SD features supported by SD mode but not supported by PCIe mode, therefore GL9767 switch to SD mode. 5. If the card has not been put in write protect state then GL9767 switch from SD mode to PCIe/NVMe mode and mmc driver handover control to NVMe driver. 6. If card is removed, GL9767 will return to SD mode. Signed-off-by: Ben Chuang Signed-off-by: Victor Shih Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20230609071441.451464-5-victorshihgli@gmail.com Signed-off-by: Ulf Hansson commit 17b492117b00ead1fa0a53035b2fb98b04ba35f4 Author: Victor Shih Date: Fri Jun 9 15:14:40 2023 +0800 mmc: sdhci: Add VDD2 definition for power control register Add new definition for VDD2 - UHS2 or PCIe/NVMe. Signed-off-by: Ben Chuang Signed-off-by: Victor Shih Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20230609071441.451464-4-victorshihgli@gmail.com Signed-off-by: Ulf Hansson commit d2754355512e51c1e6c37975ccc5bdca635b3718 Author: Victor Shih Date: Fri Jun 9 15:14:39 2023 +0800 mmc: sdhci-pci-gli: Set SDR104's clock to 205MHz and enable SSC for GL9767 Set GL9767 SDR104's clock to 205MHz and enable SSC feature depend on register 0x888 BIT(1). Signed-off-by: Ben Chuang Signed-off-by: Victor Shih Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20230609071441.451464-3-victorshihgli@gmail.com Signed-off-by: Ulf Hansson commit f3a5b56c1286444204c95ba78e1b03961aac580c Author: Victor Shih Date: Fri Jun 9 15:14:38 2023 +0800 mmc: sdhci-pci-gli: Add Genesys Logic GL9767 support Add support for the GL9767 chipset. GL9767 supports SD3 mode likes UHS-I SDR50, SDR104. Enable MSI interrupt for GL9767. Some platform do not support PCI INTx and devices can not work without interrupt. Signed-off-by: Ben Chuang Signed-off-by: Victor Shih Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20230609071441.451464-2-victorshihgli@gmail.com Signed-off-by: Ulf Hansson commit f2764e1f795c1db80ac1a08abae5b2f470355da6 Author: Wenbin Mei Date: Fri Jun 9 18:13:55 2023 +0800 mmc: mtk-sd: reduce CIT for better performance CQHCI_SSC1 indicates to CQE the polling period to use when using periodic SEND_QUEUE_STATUS(CMD13) polling. Since MSDC CQE uses msdc_hclk as ITCFVAL, so driver should use hclk frequency to get the actual time. The default value 0x1000 that corresponds to 150us for MediaTek SoCs, let's decrease it to 0x40 that corresponds to 2.35us, which can improve the performance of some eMMC devices. Reported-by: kernel test robot Signed-off-by: Wenbin Mei Reviewed-by: AngeloGioacchino Del Regno Acked-by: Adrian Hunter Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230609101355.5220-2-wenbin.mei@mediatek.com Signed-off-by: Ulf Hansson commit ac93af1fe3f49ddecc6d0a367e9c3e1caac3cfe5 Author: Komal Bajaj Date: Thu Jun 1 16:41:26 2023 +0530 dt-bindings: mmc: sdhci-msm: Document the QDU1000/QRU1000 compatible Document the compatible for SDHCI on QDU1000 and QRU1000 SoCs. Acked-by: Conor Dooley Reviewed-by: Bhupesh Sharma Signed-off-by: Komal Bajaj Link: https://lore.kernel.org/r/20230601111128.19562-2-quic_kbajaj@quicinc.com Signed-off-by: Ulf Hansson commit 568898cbc8b570311b3b94a3202b8233f4168144 Author: Christian Loehle Date: Thu May 25 09:56:04 2023 +0000 mmc: block: ioctl: do write error check for spi SPI doesn't have the usual PROG path we can check for error bits after moving back to TRAN. Instead it holds the line LOW until completion. We can then check if the card shows any errors or is in IDLE state, indicating the line is no longer LOW because the card was reset. Signed-off-by: Christian Loehle Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/55920f880c9742f486f64aa44e25508e@hyperstone.com Signed-off-by: Ulf Hansson commit 20dbd07ef0a8bc29eb03d6a95258ac8934cbe52d Author: Chevron Li Date: Tue May 23 19:11:14 2023 +0800 mmc: sdhci: fix DMA configure compatibility issue when 64bit DMA mode is used. Bayhub SD host has hardware limitation: 1.The upper 32bit address is inhibited to be written at SD Host Register [03E][13]=0 (32bits addressing) mode, is admitted to be written only at SD Host Register [03E][13]=1 (64bits addressing) mode. 2.Because of above item#1, need to configure SD Host Register [03E][13] to 1(64bits addressing mode) before set 64bit ADMA system address's higher 32bits SD Host Register [05F~05C] if 64 bits addressing mode is used. The hardware limitation is reasonable for below reasons: 1.Normal flow should set DMA working mode first, then do DMA-transfer-related configuration, such as system address. 2.The hardware limitation may avoid the software to configure wrong higher 32bit address at 32bits addressing mode although it is redundant. The change that set 32bits/64bits addressing mode before set ADMA address, has no side-effect to other host IPs for below reason: The setting order is reasonable and standard: DMA Mode setting first and then DMA address setting. It meets all DMA setting sequence. Signed-off-by: Chevron Li Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230523111114.18124-1-chevron_li@126.com Signed-off-by: Ulf Hansson commit 584f5488e4845522f526e467138526f0155e9ab6 Author: Yeqi Fu Date: Thu May 18 18:12:16 2023 +0800 mmc: core: Remove unnecessary error checks and change return type The error checks in mmc_blk_add_debugfs() and mmc_blk_remove_debugfs() are extraneous. Therefore, this patch removes all error checks from both functions. Additionally, mmc_blk_add_debugfs() has been changed to return void instead of an integer value that was never used. This simplifies the function and improves its clarity. Signed-off-by: Yeqi Fu Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20230518101216.369970-1-asuk4.q@gmail.com Signed-off-by: Ulf Hansson commit 434587df9f7fd68575f99a889cc5f2efc2eaee5e Author: Arnd Bergmann Date: Tue May 16 22:27:04 2023 +0200 memstick r592: make memstick_debug_get_tpc_name() static There are no other files referencing this function, apparently it was left global to avoid an 'unused function' warning when the only caller is left out. With a 'W=1' build, it causes a 'missing prototype' warning though: drivers/memstick/host/r592.c:47:13: error: no previous prototype for 'memstick_debug_get_tpc_name' [-Werror=missing-prototypes] Annotate the function as 'static __maybe_unused' to avoid both problems. Fixes: 926341250102 ("memstick: add driver for Ricoh R5C592 card reader") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230516202714.560929-1-arnd@kernel.org Signed-off-by: Ulf Hansson commit a3332b7aad346b14770797e03ddd02ebdb14db41 Author: Douglas Anderson Date: Wed May 10 06:44:54 2023 -0700 mmc: mediatek: Avoid ugly error message when SDIO wakeup IRQ isn't used When I boot a kukui-kodama board, I see an ugly warning in my kernel log: mtk-msdc 11240000.mmc: error -ENXIO: IRQ sdio_wakeup not found It's pretty normal not to have an "sdio_wakeup" IRQ defined. In fact, no device trees in mainline seem to have it. Let's use the platform_get_irq_byname_optional() to avoid the error message. Fixes: 527f36f5efa4 ("mmc: mediatek: add support for SDIO eint wakup IRQ") Signed-off-by: Douglas Anderson Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20230510064434.1.I935404c5396e6bf952e99bb7ffb744c6f7fd430b@changeid Signed-off-by: Ulf Hansson commit 6151bc77daac5ac89634ee49416ac562bfdee2ce Author: Simon Horman Date: Wed May 10 14:39:00 2023 +0200 mmc: meson-mx-sdhc: Avoid cast to incompatible function type Rather than casting mmc_free_host to an incompatible function type, provide a trivial wrapper with the correct signature for the use-case. Reported by clang-16 with W=1: .../meson-mx-sdhc-mmc.c:791:38: error: cast from 'void (*)(struct mmc_host *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] ret = devm_add_action_or_reset(dev, (void(*)(void *))mmc_free_host, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/device.h:265:38: note: expanded from macro 'devm_add_action_or_reset' __devm_add_action_or_reset(release, action, data, #action) ^~~~~~ The same approach is taken in litex_mmc.c with the function litex_mmc_free_host_wrapper(). There may be scope for consolidation. No functional change intended. Compile tested only. Signed-off-by: Simon Horman Reviewed-by: Neil Armstrong Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230510-mmc-sdhci-msm-function-cast-v1-1-5ae634b24fbd@kernel.org Signed-off-by: Ulf Hansson commit 78ce88e7581f5737c9e4f6aa6df7abbd4835ad1c Author: Florian Fainelli Date: Tue May 9 12:44:53 2023 -0700 mmc: block: Suppress empty whitespaces in prints If the device is not read-only, then we will be printing an empty whitespace before the newline, fix that. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20230509194455.1791890-1-f.fainelli@gmail.com Signed-off-by: Ulf Hansson commit 2d2934783f8db70353e44fd1959f10eedc993c2e Author: Bjorn Andersson Date: Mon May 8 20:01:35 2023 -0700 dt-bindings: mmc: sdhci-msm: Document SC8280XP SDHCI Add compatible for the SDHCI block found in SC8280XP. Signed-off-by: Bjorn Andersson Reviewed-by: Krzysztof Kozlowski Reviewed-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20230509030136.1524860-1-quic_bjorande@quicinc.com Signed-off-by: Ulf Hansson commit 77a83be815990b183f1b4e344841580b6ee4e38c Author: Stanislav Jakubek Date: Mon May 8 14:46:03 2023 +0200 dt-bindings: mmc: brcm,kona-sdhci: convert to YAML Convert Broadcom Kona family SDHCI controller bindings to DT schema. Changes during conversion: - also mark reg and interrupts as required - drop deprecated compatible (it's been deprecated for ~10 years) Signed-off-by: Stanislav Jakubek Acked-by: Conor Dooley Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/a1fd4092b8a31c2ee58a3cd4cca062db13197b45.1683548624.git.stano.jakubek@gmail.com Signed-off-by: Ulf Hansson commit 982fe2e093c62dbe144bd86c8b88cee65e5ad345 Author: Uwe Kleine-König Date: Sat May 6 00:15:06 2023 +0200 mmc: dw_mmc: Make dw_mci_pltfm_remove() return void dw_mci_pltfm_remove() returned zero unconditionally. Make it return void instead which makes its semantics a bit clearer. Convert the drivers that use this function as .remove() callback to .remove_new() which has the right prototype. This helps getting rid of the platform_driver's remove callback that returns an int (which is error prone). The other users didn't check the return value anyhow. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230505221506.1247424-1-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson commit 2fba941d3423ee3084721ac7e64c042fefa9cdab Author: Mantas Pucka Date: Mon Apr 24 15:13:31 2023 +0300 dt-bindings: mmc: sdhci-msm: add IPQ6018 compatible IPQ6018 has a sdhci-msm compatible MMC controller. Add the appropriate compatible to the documentation. Signed-off-by: Mantas Pucka Acked-by: Rob Herring Link: https://lore.kernel.org/r/1682338412-15420-2-git-send-email-mantas@8devices.com Signed-off-by: Ulf Hansson commit 852667c317ae23f366cfaade3b9269b1943888dd Merge: 0a81fa5d74cd8 d244c610f1d9a Author: Borislav Petkov (AMD) Date: Mon Jun 12 15:15:36 2023 +0200 Merge ras/edac-drivers into for-next * ras/edac-drivers: EDAC/npcm: Add NPCM memory controller driver dt-bindings: memory-controllers: nuvoton: Add NPCM memory controller Signed-off-by: Borislav Petkov (AMD) commit d244c610f1d9a9d2976192c1d7e114a59fba02e0 Author: Marvin Lin Date: Wed Jan 11 17:32:45 2023 +0800 EDAC/npcm: Add NPCM memory controller driver Add driver for memory controller present on Nuvoton NPCM SoCs. The memory controller supports single bit error correction and double bit error detection. Signed-off-by: Marvin Lin Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230111093245.318745-4-milkfafa@gmail.com commit a053b7e579bdc2d0d66ee263a76214f6f1f89549 Author: Marvin Lin Date: Wed Jan 11 17:32:44 2023 +0800 dt-bindings: memory-controllers: nuvoton: Add NPCM memory controller Add dt-bindings document for Nuvoton NPCM memory controller. Signed-off-by: Marvin Lin Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Rob Herring Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230111093245.318745-3-milkfafa@gmail.com commit 9b4469410cf9a0fcbccc92c480fd42f7c815a745 Author: Takashi Sakamoto Date: Sun Jun 11 23:44:45 2023 +0900 ALSA: firewire: use 'GPL' string for module license contributed by Clemens Ladisch In MODULE_LICENSE macro, "GPL" string obsoletes "GPL v2" string by a commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity"). This commit uses the preferable expression. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20230611144445.221529-3-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 81c29435073355b8194986a2193d3e7b9d449225 Author: Takashi Sakamoto Date: Sun Jun 11 23:44:44 2023 +0900 ALSA: firewire: use 'GPL' string for module license contributed by Takashi Sakamoto In MODULE_LICENSE macro, "GPL" string obsoletes "GPL v2" string by a commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity"). This commit uses the preferable expression. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20230611144445.221529-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 263638dc0690f833a6464ccbf5cb9a799edc0751 Author: Jonathan Corbet Date: Wed May 3 16:51:57 2023 -0600 arm64: Update Documentation/arm references The Arm documentation has moved to Documentation/arch/arm; update references under arch/arm64 to match. Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Acked-by: Catalin Marinas Signed-off-by: Jonathan Corbet commit e318b36ed37d241eb279382bde587eabf1892e34 Author: Jonathan Corbet Date: Wed May 3 16:50:54 2023 -0600 arm: update in-source documentation references The Arm documentation has moved to Documentation/arch/arm; update references within arch/arm to match. Cc: Russell King Cc: Alim Akhtar Cc: Patrice Chotard Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-arch@vger.kernel.org Signed-off-by: Jonathan Corbet commit e790a4ce529041bb21ec0b69a38c1b92f29df2cf Author: Jonathan Corbet Date: Wed May 3 16:47:22 2023 -0600 arm: docs: Move Arm documentation to Documentation/arch/ Architecture-specific documentation is being moved into Documentation/arch/ as a way of cleaning up the top-level documentation directory and making the docs hierarchy more closely match the source hierarchy. Move Documentation/arm into arch/ (along with the Chinese equvalent translations). Cc: Maxime Coquelin Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Samuel Holland Cc: Krzysztof Kozlowski Cc: Alim Akhtar Cc: Alex Shi Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-arch@vger.kernel.org Acked-by: Alexandre TORGUE Reviewed-by: Yanteng Si Signed-off-by: Jonathan Corbet commit d99df65728bdd087046af7357ceaef2ecfb1ba72 Author: Mark Brown Date: Sat Jun 10 15:05:21 2023 +0100 mfd: twl6040: Use maple tree register cache The twl6040 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-mfd-twl6040-maple-v1-1-3493d051cd6f@kernel.org Signed-off-by: Lee Jones commit 3a2cb45ca0ccb5dab9b701f50cfd981f8dfd1673 Author: Uwe Kleine-König Date: Mon Jun 12 09:22:22 2023 +0200 net: mlxsw: i2c: Switch back to use struct i2c_driver's .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: David S. Miller commit 98c485eaf509bc0e2a85f9b58d17cd501f274c4e Author: Daniel Golle Date: Sun Jun 11 00:48:10 2023 +0100 net: phy: add driver for MediaTek SoC built-in GE PHYs Some of MediaTek's Filogic SoCs come with built-in gigabit Ethernet PHYs which require calibration data from the SoC's efuse. Despite the similar design the driver doesn't share any code with the existing mediatek-ge.c. Add support for such PHYs by introducing a new driver with basic support for MediaTek SoCs MT7981 and MT7988 built-in 1GE PHYs. Signed-off-by: Daniel Golle Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit a89dc58703c362bf2005880c575608e10f3607a8 Merge: 73f49f8cc1fef 978015f7ef924 Author: David S. Miller Date: Mon Jun 12 11:41:57 2023 +0100 Merge tag 'mlx5-updates-2023-06-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux mlx5-updates-2023-06-09 1) Embedded CPU Virtual Functions 2) Lightweight local SFs Daniel Jurgens says: ==================== Embedded CPU Virtual Functions This series enables the creation of virtual functions on Bluefield (the embedded CPU platform). Embedded CPU virtual functions (EC VFs). EC VF creation, deletion and management interfaces are the same as those for virtual functions in a server with a Connect-X NIC. When using EC VFs on the ARM the creation of virtual functions on the host system is still supported. Host VFs eswitch vports occupy a range of 1..max_vfs, the EC VF vport range is max_vfs+1..max_ec_vfs. Every function (PF, ECPF, VF, EC VF, and subfunction) has a function ID associated with it. Prior to this series the function ID and the eswitch vport were the same. That is no longer the case, the EC VF function ID range is 1..max_ec_vfs. When querying or setting the capabilities of an EC VF function an new bit must be set in the query/set HCA cap structure. This is a high level overview of the changes made: - Allocate vports for EC VFs if they are enabled. - Create representors and devlink ports for the EC VF vports. - When querying/setting HCA caps by vport break the assumption that function ID is the same a vport number and adjust accordingly. - Create a new type of page, so that when SRIOV on the ARM is disabled, but remains enabled on the host, the driver can wait for the correct pages. - Update SRIOV code to support EC VF creation/deletion. =================== Lightweight local SFs: Last 3 patches form Shay Drory: SFs are heavy weight and by default they come with the full package of ConnectX features. Usually users want specialized SFs for one specific purpose and using devlink users will almost always override the set of advertises features of an SF and reload it. Shay Drory says: ================ In order to avoid the wasted time and resources on the reload, local SFs will probe without any auxiliary sub-device, so that the SFs can be configured prior to its full probe. The defaults of the enable_* devlink params of these SFs are set to false. Usage example: Create SF: $ devlink port add pci/0000:08:00.0 flavour pcisf pfnum 0 sfnum 11 $ devlink port function set pci/0000:08:00.0/32768 \ hw_addr 00:00:00:00:00:11 state active Enable ETH auxiliary device: $ devlink dev param set auxiliary/mlx5_core.sf.1 \ name enable_eth value true cmode driverinit Now, in order to fully probe the SF, use devlink reload: $ devlink dev reload auxiliary/mlx5_core.sf.1 At this point the user have SF devlink instance with auxiliary device for the Ethernet functionality only. ================ commit 73f49f8cc1fef29c062bf92b1ea24047cf67bee4 Merge: f2f069da4c40d 5882efff88aa7 Author: David S. Miller Date: Mon Jun 12 11:38:55 2023 +0100 Merge branch 'tcp-tx-headless' Eric Dumazet says: ==================== tcp: tx path fully headless This series completes transition of TCP stack tx path to headless packets : All payload now reside in page frags, never in skb->head. ==================== Signed-off-by: David S. Miller commit 5882efff88aa7063ebdecd4ee92cc2cd1d0b3a8f Author: Eric Dumazet Date: Fri Jun 9 20:42:46 2023 +0000 tcp: remove size parameter from tcp_stream_alloc_skb() Now all tcp_stream_alloc_skb() callers pass @size == 0, we can remove this parameter. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit b4a24397139cd943c8fa057c372f8a019e07168d Author: Eric Dumazet Date: Fri Jun 9 20:42:45 2023 +0000 tcp: remove some dead code Now all skbs in write queue do not contain any payload in skb->head, we can remove some dead code. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit fbf934068f6b93a8c4ddda293fc02b4eb3747323 Author: Eric Dumazet Date: Fri Jun 9 20:42:44 2023 +0000 tcp: let tcp_send_syn_data() build headless packets tcp_send_syn_data() is the last component in TCP transmit path to put payload in skb->head. Switch it to use page frags, so that we can remove dead code later. This allows to put more payload than previous implementation. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit f2f069da4c40dcf136db731c9fece17c3bbf7cdc Merge: 238131684f7b1 500e1340d1d26 Author: David S. Miller Date: Mon Jun 12 11:32:45 2023 +0100 Merge branch 'ethtool-extack' Jakub Kicinski says: ==================== net: support extack in dump and simplify ethtool uAPI Ethtool currently requires header nest to be always present even if it doesn't have to carry any attr for a given request. This inflicts unnecessary pain on the users. What makes it worse is that extack was not working in dump's ->start() callback. Address both of those issues. ==================== Signed-off-by: David S. Miller commit 500e1340d1d2695de3f15fc0b3781f593a77acc2 Author: Jakub Kicinski Date: Fri Jun 9 14:53:31 2023 -0700 net: ethtool: don't require empty header nests Ethtool currently requires a header nest (which is used to carry the common family options) in all requests including dumps. $ cli.py --spec netlink/specs/ethtool.yaml --dump channels-get lib.ynl.NlError: Netlink error: Invalid argument nl_len = 64 (48) nl_flags = 0x300 nl_type = 2 error: -22 extack: {'msg': 'request header missing'} $ cli.py --spec netlink/specs/ethtool.yaml --dump channels-get \ --json '{"header":{}}'; ) [{'combined-count': 1, 'combined-max': 1, 'header': {'dev-index': 2, 'dev-name': 'enp1s0'}}] Requiring the header nest to always be there may seem nice from the consistency perspective, but it's not serving any practical purpose. We shouldn't burden the user like this. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5ab8c41cef30d8b6160a80b69d2eb39d570491ac Author: Jakub Kicinski Date: Fri Jun 9 14:53:30 2023 -0700 netlink: support extack in dump ->start() Commit 4a19edb60d02 ("netlink: Pass extack to dump handlers") added extack support to netlink dumps. It was focused on rtnl and since rtnl does not use ->start(), ->done() callbacks it ignored those. Genetlink on the other hand uses ->start() extensively, for parsing and input validation. Pass the extact in via struct netlink_dump_control and link it to cb for the time of ->start(). Both struct netlink_dump_control and extack itself live on the stack so we can't keep the same extack for the duration of the dump. This means that the extack visible in ->start() and each ->dump() callbacks will be different. Corner cases like reporting a warning message in DONE across dump calls are still not supported. We could put the extack (for dumps) in the socket struct, but layering makes it slightly awkward (extack pointer is decided before the DO / DUMP split). The genetlink dump error extacks are now surfaced: $ cli.py --spec netlink/specs/ethtool.yaml --dump channels-get lib.ynl.NlError: Netlink error: Invalid argument nl_len = 64 (48) nl_flags = 0x300 nl_type = 2 error: -22 extack: {'msg': 'request header missing'} Previously extack was missing: $ cli.py --spec netlink/specs/ethtool.yaml --dump channels-get lib.ynl.NlError: Netlink error: Invalid argument nl_len = 36 (20) nl_flags = 0x100 nl_type = 2 error: -22 Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 7b7b06d55aeff969ffdfd1170937198f7c02b684 Author: Christoph Hellwig Date: Mon Jun 12 07:36:46 2023 +0200 gfs2: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag"), file systems can just set the FMODE_CAN_ODIRECT flag at open time instead of wiring up a dummy direct_IO method to indicate support for direct I/O. Remove .direct_IO from gfs2_aops and set FMODE_CAN_ODIRECT in gfs2_open_common for regular files that do not use data journalling. Signed-off-by: Christoph Hellwig Signed-off-by: Andreas Gruenbacher commit 238131684f7b1bc2e0788583f22ed67bf3f5ca37 Merge: b30a1f305b7bf f561ff232a6b5 Author: David S. Miller Date: Mon Jun 12 11:01:03 2023 +0100 Merge branch 'ynl-ethtool' Jakub Kicinski says: ==================== tools: ynl: generate code for the ethtool family And finally ethtool support. Thanks to Stan's work the ethtool family spec is quite complete, so there is a lot of operations to support. I chickened out of stats-get support, they require at the very least type-value support on a u64 scalar. Type-value is an arrangement where a u16 attribute is encoded directly in attribute type. Code gen can support this if the inside is a nest, we just throw in an extra field into that nest to carry the attr type. But a little more coding is needed to for a scalar, because first we need to turn the scalar into a struct with one member, then we can add the attr type. Other than that ethtool required event support (notification which does not share contents with any GET), but the previous series already added that to the codegen. I haven't tested all the ops here, and a few I tried seem to work. ==================== Acked-by: Stanislav Fomichev Signed-off-by: David S. Miller commit f561ff232a6b502bda020ac47200e88f0bc5f98a Author: Jakub Kicinski Date: Fri Jun 9 14:43:46 2023 -0700 tools: ynl: add sample for ethtool Configuring / reading ring sizes and counts is a fairly common operation for ethtool netlink. Present a sample doing that with YNL: $ ./ethtool Channels: enp1s0: combined 1 eni1np1: combined 1 eni2np1: combined 1 Rings: enp1s0: rx 256 tx 256 eni1np1: rx 0 tx 0 eni2np1: rx 0 tx 0 Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 2d7be507d65e90099c76631bf0448d0b30f7f203 Author: Jakub Kicinski Date: Fri Jun 9 14:43:45 2023 -0700 tools: ynl: generate code for the ethtool family Generate the protocol code for ethtool. Skip the stats for now, they are the only outlier in terms of complexity. Stats are a sort-of semi-polymorphic (attr space of a nest depends on value of another attr) or a type-value-scalar, depending on how one wants to look at it... A challenge for another time. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 68335713d2eaf8e3e064c584b39da45fdee6e365 Author: Jakub Kicinski Date: Fri Jun 9 14:43:44 2023 -0700 netlink: specs: ethtool: mark pads as pads Pad is a separate type. Even though in practice they can only be a u32 the value should be discarded. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 709d0c3b3d4c385793fd12cc57e400c8e036e744 Author: Jakub Kicinski Date: Fri Jun 9 14:43:43 2023 -0700 netlink: specs: ethtool: untangle stats-get Code gen for stats is a bit of a challenge, but from looking at the attrs I think that the format isn't quite right. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 37c852222712e1968da858961709a179150acd41 Author: Jakub Kicinski Date: Fri Jun 9 14:43:42 2023 -0700 netlink: specs: ethtool: untangle UDP tunnels and cable test a bit UDP tunnel and cable test messages have a lot of nests, which do not match the names of the enum entries in C uAPI. Some of the structure / nesting also looks wrong. Untangle this a little bit based on the names, comments and educated guesses, I haven't actually tested the results. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 180ad455273a7d3ba95ec21d28c1fee6766f166d Author: Jakub Kicinski Date: Fri Jun 9 14:43:41 2023 -0700 netlink: specs: ethtool: add empty enum stringset C does not allow defining structures and enums with the same name. Since enum ethtool_stringset exists in the uAPI we need to include at least a stub of it in the spec. This will trigger name collision avoidance in the code gen. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 2c9d47a095f7d0380e35064121bc8838dbf136cb Author: Jakub Kicinski Date: Fri Jun 9 14:43:40 2023 -0700 tools: ynl-gen: resolve enum vs struct name conflicts Ethtool has an attribute set called stringset, from which we'll generate struct ethtool_stringset. Unfortunately, the old ethtool header declares enum ethtool_stringset (the same name), to which compilers object. This seems unavoidable. Check struct names against known constants and append an underscore if conflict is detected. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit dddc9f53da3e1e359e56edc8da301e145e3b97df Author: Jakub Kicinski Date: Fri Jun 9 14:43:39 2023 -0700 tools: ynl-gen: don't generate enum types if unnamed If attr set or enum has empty enum name we need to use u32 or int as function arguments and struct members. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit d4813b11d679c80d4c3e20d27dafcd6d3317a69c Author: Jakub Kicinski Date: Fri Jun 9 14:43:38 2023 -0700 netlink: specs: ethtool: add C render hints Most of the C enum names are guessed correctly, but there is a handful of corner cases we need to name explicitly. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit ed2042cc77f1cef4850a891dc93d80fb1aa6c955 Author: Jakub Kicinski Date: Fri Jun 9 14:43:37 2023 -0700 netlink: specs: support setting prefix-name per attribute Ethtool's PSE PoDL has a attr nest with different prefixes: /* Power Sourcing Equipment */ enum { ETHTOOL_A_PSE_UNSPEC, ETHTOOL_A_PSE_HEADER, /* nest - _A_HEADER_* */ ETHTOOL_A_PODL_PSE_ADMIN_STATE, /* u32 */ ETHTOOL_A_PODL_PSE_ADMIN_CONTROL, /* u32 */ ETHTOOL_A_PODL_PSE_PW_D_STATUS, /* u32 */ Header has a prefix of ETHTOOL_A_PSE_ and other attrs prefix of ETHTOOL_A_PODL_PSE_ we can't cover them uniformly. If PODL was after PSE life would be easy. Now we either need to add prefixes to attr names which is yucky or support setting prefix name per attr. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 33eedb0071c84ee47ab329a90e8e7b0653bcba33 Author: Jakub Kicinski Date: Fri Jun 9 14:43:36 2023 -0700 tools: ynl-gen: record extra args for regen ynl-regen needs to know the arguments used to generate a file. Record excluded ops and, while at it, user headers. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 008bcd6835a2f00a46bc91cad32de50d57d1b196 Author: Jakub Kicinski Date: Fri Jun 9 14:43:35 2023 -0700 tools: ynl-gen: support excluding tricky ops The ethtool family has a small handful of quite tricky ops and a lot of simple very useful ops. Teach ynl-gen to skip ops so that we can bypass the tricky ones. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit b30a1f305b7bfde19c2ddbb053b51705eef65553 Author: Rob Herring Date: Fri Jun 9 12:26:16 2023 -0600 mdio: mdio-mux-mmioreg: Use of_property_read_reg() to parse "reg" Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Signed-off-by: Rob Herring Signed-off-by: David S. Miller commit 61ab5a060a57d7aa77cfbc860c84a25d7d1ac3cf Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:12 2023 +0200 dt-bindings: net: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Acked-by: Jernej Skrabec Signed-off-by: David S. Miller commit ba47545c756b55f4b114c45fea7d52dd1577e181 Merge: 55d7c91406b4b 97154bcf4d1b7 Author: David S. Miller Date: Mon Jun 12 10:45:50 2023 +0100 Merge branch 'SCM_PIDFD-SCM_PEERPIDFD' Alexander Mikhalitsyn says: ==================== Add SCM_PIDFD and SO_PEERPIDFD 1. Implement SCM_PIDFD, a new type of CMSG type analogical to SCM_CREDENTIALS, but it contains pidfd instead of plain pid, which allows programmers not to care about PID reuse problem. 2. Add SO_PEERPIDFD which allows to get pidfd of peer socket holder pidfd. This thing is direct analog of SO_PEERCRED which allows to get plain PID. 3. Add SCM_PIDFD / SO_PEERPIDFD kselftest Idea comes from UAPI kernel group: https://uapi-group.org/kernel-features/ Big thanks to Christian Brauner and Lennart Poettering for productive discussions about this and Luca Boccassi for testing and reviewing this. === Motivation behind this patchset Eric Dumazet raised a question: > It seems that we already can use pidfd_open() (since linux-5.3), and > pass the resulting fd in af_unix SCM_RIGHTS message ? Yes, it's possible, but it means that from the receiver side we need to trust the sent pidfd (in SCM_RIGHTS), or always use combination of SCM_RIGHTS+SCM_CREDENTIALS, then we can extract pidfd from SCM_RIGHTS, then acquire plain pid from pidfd and after compare it with the pid from SCM_CREDENTIALS. A few comments from other folks regarding this. Christian Brauner wrote: >Let me try and provide some of the missing background. >There are a range of use-cases where we would like to authenticate a >client through sockets without being susceptible to PID recycling >attacks. Currently, we can't do this as the race isn't fully fixable. >We can only apply mitigations. >What this patchset will allows us to do is to get a pidfd without the >client having to send us an fd explicitly via SCM_RIGHTS. As that's >already possibly as you correctly point out. >But for protocols like polkit this is quite important. Every message is >standalone and we would need to force a complete protocol change where >we would need to require that every client allocate and send a pidfd via >SCM_RIGHTS. That would also mean patching through all polkit users. >For something like systemd-journald where we provide logging facilities >and want to add metadata to the log we would also immensely benefit from >being able to get a receiver-side controlled pidfd. >With the message type we envisioned we don't need to change the sender >at all and can be safe against pid recycling. >Link: https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/154 >Link: https://uapi-group.org/kernel-features Lennart Poettering wrote: >So yes, this is of course possible, but it would mean the pidfd would >have to be transported as part of the user protocol, explicitly sent >by the sender. (Moreover, the receiver after receiving the pidfd would >then still have to somehow be able to prove that the pidfd it just >received actually refers to the peer's process and not some random >process. – this part is actually solvable in userspace, but ugly) >The big thing is simply that we want that the pidfd is associated >*implicity* with each AF_UNIX connection, not explicitly. A lot of >userspace already relies on this, both in the authentication area >(polkit) as well as in the logging area (systemd-journald). Right now >using the PID field from SO_PEERCREDS/SCM_CREDENTIALS is racy though >and very hard to get right. Making this available as pidfd too, would >solve this raciness, without otherwise changing semantics of it all: >receivers can still enable the creds stuff as they wish, and the data >is then implicitly appended to the connections/datagrams the sender >initiates. >Or to turn this around: things like polkit are typically used to >authenticate arbitrary dbus methods calls: some service implements a >dbus method call, and when an unprivileged client then issues that >call, it will take the client's info, go to polkit and ask it if this >is ok. If we wanted to send the pidfd as part of the protocol we >basically would have to extend every single method call to contain the >client's pidfd along with it as an additional argument, which would be >a massive undertaking: it would change the prototypes of basically >*all* methods a service defines… And that's just ugly. >Note that Alex' patch set doesn't expose anything that wasn't exposed >before, or attach, propagate what wasn't before. All it does, is make >the field already available anyway (the struct ucred .pid field) >available also in a better way (as a pidfd), to solve a variety of >races, with no effect on the protocol actually spoken within the >AF_UNIX transport. It's a seamless improvement of the status quo. ==================== Signed-off-by: David S. Miller commit 97154bcf4d1b7cabefec8a72cff5fbb91d5afb7b Author: Alexander Mikhalitsyn Date: Thu Jun 8 22:26:28 2023 +0200 af_unix: Kconfig: make CONFIG_UNIX bool Let's make CONFIG_UNIX a bool instead of a tristate. We've decided to do that during discussion about SCM_PIDFD patchset [1]. [1] https://lore.kernel.org/lkml/20230524081933.44dc8bea@kernel.org/ Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Leon Romanovsky Cc: David Ahern Cc: Arnd Bergmann Cc: Kees Cook Cc: Christian Brauner Cc: Kuniyuki Iwashima Cc: Lennart Poettering Cc: Luca Boccassi Cc: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-arch@vger.kernel.org Suggested-by: Jakub Kicinski Signed-off-by: Alexander Mikhalitsyn Acked-by: Christian Brauner Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit ec80f488252b9ce0536c397364dd2c9cc820c1e1 Author: Alexander Mikhalitsyn Date: Thu Jun 8 22:26:27 2023 +0200 selftests: net: add SCM_PIDFD / SO_PEERPIDFD test Basic test to check consistency between: - SCM_CREDENTIALS and SCM_PIDFD - SO_PEERCRED and SO_PEERPIDFD Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Leon Romanovsky Cc: David Ahern Cc: Arnd Bergmann Cc: Kees Cook Cc: Christian Brauner Cc: Kuniyuki Iwashima Cc: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Signed-off-by: Alexander Mikhalitsyn Signed-off-by: David S. Miller commit 7b26952a91cf65ff1cc867a2382a8964d8c0ee7d Author: Alexander Mikhalitsyn Date: Thu Jun 8 22:26:26 2023 +0200 net: core: add getsockopt SO_PEERPIDFD Add SO_PEERPIDFD which allows to get pidfd of peer socket holder pidfd. This thing is direct analog of SO_PEERCRED which allows to get plain PID. Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Leon Romanovsky Cc: David Ahern Cc: Arnd Bergmann Cc: Kees Cook Cc: Christian Brauner Cc: Kuniyuki Iwashima Cc: Lennart Poettering Cc: Luca Boccassi Cc: Daniel Borkmann Cc: Stanislav Fomichev Cc: bpf@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-arch@vger.kernel.org Reviewed-by: Christian Brauner Acked-by: Stanislav Fomichev Tested-by: Luca Boccassi Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 5e2ff6704a275be009be8979af17c52361b79b89 Author: Alexander Mikhalitsyn Date: Thu Jun 8 22:26:25 2023 +0200 scm: add SO_PASSPIDFD and SCM_PIDFD Implement SCM_PIDFD, a new type of CMSG type analogical to SCM_CREDENTIALS, but it contains pidfd instead of plain pid, which allows programmers not to care about PID reuse problem. We mask SO_PASSPIDFD feature if CONFIG_UNIX is not builtin because it depends on a pidfd_prepare() API which is not exported to the kernel modules. Idea comes from UAPI kernel group: https://uapi-group.org/kernel-features/ Big thanks to Christian Brauner and Lennart Poettering for productive discussions about this. Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Leon Romanovsky Cc: David Ahern Cc: Arnd Bergmann Cc: Kees Cook Cc: Christian Brauner Cc: Kuniyuki Iwashima Cc: Lennart Poettering Cc: Luca Boccassi Cc: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-arch@vger.kernel.org Tested-by: Luca Boccassi Reviewed-by: Kuniyuki Iwashima Reviewed-by: Christian Brauner Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 2aac2d8b95923203e683c60124877ab434133679 Author: Arnd Bergmann Date: Fri Jun 9 10:15:49 2023 +0200 clk: samsung: add CONFIG_OF dependency When CONFIG_OF is disabled, build testing on x86 runs into a couple of objtool warnings from functions that unconditionally call panic() but have no __noreturn annotation: vmlinux.o: warning: objtool: exynos3250_cmu_isp_probe+0x17: samsung_cmu_register_one() is missing a __noreturn annotation vmlinux.o: warning: objtool: exynos7885_cmu_probe+0x16: exynos_arm64_register_cmu() is missing a __noreturn annotation vmlinux.o: warning: objtool: exynos850_cmu_probe+0x16: exynos_arm64_register_cmu() is missing a __noreturn annotation vmlinux.o: warning: objtool: exynosautov9_cmu_probe+0x16: exynos_arm64_register_cmu() is missing a __noreturn annotation The objtool analysis is correct, and this could be addressed by just returning success whenever CONFIG_OF is disabled to let all that code be eliminated, but since the driver is no use without CONFIG_OF, just add that as a dependency. It will still get compile tested on all architectures since CONFIG_OF is enabled in allmodconfig and most randconfig builds. Cc: Josh Poimboeuf Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230609081559.915867-1-arnd@kernel.org Signed-off-by: Krzysztof Kozlowski commit 4055eabe04a26f5d113b5a02588b20b5e166a753 Author: Geert Uytterhoeven Date: Mon May 8 14:39:09 2023 +0200 m68k: defconfig: Update defconfigs for v6.4-rc1 - Enable modular build of the new DMA pool test, - Drop CONFIG_PRINT_QUOTA_WARNING=n (auto-disabled since commit 36d532d713db5797 ("quota: mark PRINT_QUOTA_WARNING as BROKEN")), - Drop CONFIG_UNIX=y and CONFIG_INET=y (implied by 9P_FS since commit d7385ba137711ea7 ("9p: Remove INET dependency")). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/5a9bc6058c4fab4b57ba45d778956df8ce7e8688.1683548863.git.geert@linux-m68k.org commit 878b02d5f3b56cb090dbe2c70c89273be144087f Author: Yuxing Liu Date: Wed May 3 07:06:07 2023 +0000 clk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe() Replace of_iomap() and kzalloc() with devm_of_iomap() and devm_kzalloc() which can automatically release the related memory when the device or driver is removed or unloaded to avoid potential memory leak. In this case, iounmap(anatop_base) in line 427,433 are removed as manual release is not required. Besides, referring to clk-imx8mq.c, check the return code of of_clk_add_hw_provider, if it returns negtive, print error info and unregister hws, which makes the program more robust. Fixes: 9c140d992676 ("clk: imx: Add support for i.MX8MP clock driver") Signed-off-by: Yuxing Liu Reviewed-by: Dongliang Mu Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230503070607.2462-1-lyx2022@hust.edu.cn Signed-off-by: Abel Vesa commit e02ba11b457647050cb16e7cad16cec3c252fade Author: Zhanhao Hu Date: Thu Jun 1 03:38:25 2023 +0000 clk: imx93: fix memory leak and missing unwind goto in imx93_clocks_probe In function probe(), it returns directly without unregistered hws when error occurs. Fix this by adding 'goto unregister_hws;' on line 295 and line 310. Use devm_kzalloc() instead of kzalloc() to automatically free the memory using devm_kfree() when error occurs. Replace of_iomap() with devm_of_iomap() to automatically handle the unused ioremap region and delete 'iounmap(anatop_base);' in unregister_hws. Fixes: 24defbe194b6 ("clk: imx: add i.MX93 clk") Signed-off-by: Zhanhao Hu Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230601033825.336558-1-zero12113@hust.edu.cn Signed-off-by: Abel Vesa commit 188d070de9132667956f5aadd98d2bd87d3eac89 Author: Hao Luo Date: Tue Apr 11 09:51:07 2023 +0800 clk: imx: clk-imx8mn: fix memory leak in imx8mn_clocks_probe Use devm_of_iomap() instead of of_iomap() to automatically handle the unused ioremap region. If any error occurs, regions allocated by kzalloc() will leak, but using devm_kzalloc() instead will automatically free the memory using devm_kfree(). Fixes: daeb14545514 ("clk: imx: imx8mn: Switch to clk_hw based API") Fixes: 96d6392b54db ("clk: imx: Add support for i.MX8MN clock driver") Signed-off-by: Hao Luo Reviewed-by: Dongliang Mu Reviewed-by: Peng Fan Link: https://lore.kernel.org/r/20230411015107.2645-1-m202171776@hust.edu.cn Signed-off-by: Abel Vesa commit 6e6bb1639136f36c82efda147b63e2a2197fa3f8 Author: Alexander Stein Date: Wed May 10 08:56:41 2023 +0200 dt-bindings: clock: imx8m: Add missing interrupt property All i.MX8M SoC have 2 CCM interrupts, called: * Interrupt Request 1 * Interrupt Request 2 Signed-off-by: Alexander Stein Acked-by: Krzysztof Kozlowski Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230510065644.1317577-1-alexander.stein@ew.tq-group.com Signed-off-by: Abel Vesa commit 1b280598ab3bd8a2dc8b96a12530d5b1ee7a8f4a Author: Kai Ma Date: Tue Apr 18 11:34:51 2023 +0000 clk: imx: clk-imxrt1050: fix memory leak in imxrt1050_clocks_probe Use devm_of_iomap() instead of of_iomap() to automatically handle the unused ioremap region. If any error occurs, regions allocated by kzalloc() will leak, but using devm_kzalloc() instead will automatically free the memory using devm_kfree(). Also, fix error handling of hws by adding unregister_hws label, which unregisters remaining hws when iomap failed. Fixes: 7154b046d8f3 ("clk: imx: Add initial support for i.MXRT1050 clock driver") Signed-off-by: Kai Ma Reviewed-by: Peng Fan Acked-by: Jesse Taube Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230418113451.151312-1-kaima@hust.edu.cn Signed-off-by: Abel Vesa commit a32b0f0db3f396f1c9be2fe621e77c09ec3d8e7d Author: Borislav Petkov (AMD) Date: Tue May 2 19:53:50 2023 +0200 x86/microcode/AMD: Load late on both threads too Do the same as early loading - load on both threads. Signed-off-by: Borislav Petkov (AMD) Cc: Link: https://lore.kernel.org/r/20230605141332.25948-1-bp@alien8.de commit 8208181fe536bba3b411508f81c4426fc9c71d9a Author: Adam Ford Date: Sat May 6 14:53:25 2023 -0500 clk: imx: composite-8m: Add imx8m_divider_determine_rate Currently, certain clocks are derrived as a divider from their parent clock. For some clocks, even when CLK_SET_RATE_PARENT is set, the parent clock is not properly set which can lead to some relatively inaccurate clock values. Unlike imx/clk-composite-93 and imx/clk-divider-gate, it cannot rely on calling a standard determine_rate function, because the 8m composite clocks have a pre-divider and post-divider. Because of this, a custom determine_rate function is necessary to determine the maximum clock division which is equivalent to pre-divider * the post-divider. With this added, the system can attempt to adjust the parent rate when the proper flags are set which can lead to a more precise clock value. On the imx8mplus, no clock changes are present. On the Mini and Nano, this can help achieve more accurate lcdif clocks. When trying to get a pixel clock of 31.500MHz on an imx8m Nano, the clocks divided the 594MHz down, but left the parent rate untouched which caused a calulation error. Before: video_pll 594000000 video_pll_bypass 594000000 video_pll_out 594000000 disp_pixel 31263158 disp_pixel_clk 31263158 Variance = -236842 Hz After this patch: video_pll 31500000 video_pll_bypass 31500000 video_pll_out 31500000 disp_pixel 31500000 disp_pixel_clk 31500000 Variance = 0 Hz All other clocks rates and parent were the same. Similar results on imx8mm were found. Fixes: 690dccc4a0bf ("Revert "clk: imx: composite-8m: Add support to determine_rate"") Signed-off-by: Adam Ford Reviewed-by: Abel Vesa Tested-by: Fabio Estevam Link: https://lore.kernel.org/r/20230506195325.876871-1-aford173@gmail.com Signed-off-by: Abel Vesa commit 55d7c91406b4b486ea8c50e2fb31f1e1a0ef5143 Merge: e069ba07e6c7a df95ae66cc0a1 Author: David S. Miller Date: Mon Jun 12 09:49:30 2023 +0100 Merge branch 'mlxsw-cleanups' Petr Machata says: ==================== mlxsw: Cleanups in router code This patchset moves some router-related code from spectrum.c to spectrum_router.c where it should be. It also simplifies handlers of netevent notifications. - Patch #1 caches router pointer in a dedicated variable. This obviates the need to access the same as mlxsw_sp->router, making lines shorter, and permitting a future patch to add code that fits within 80 character limit. - Patch #2 moves IP / IPv6 validation notifier blocks from spectrum.c to spectrum_router, where the handlers are anyway. - In patch #3, pass router pointer to scheduler of deferred work directly, instead of having it deduce it on its own. - This makes the router pointer available in the handler function mlxsw_sp_router_netevent_event(), so in patch #4, use it directly, instead of finding it through mlxsw_sp_port. - In patch #5, extend mlxsw_sp_router_schedule_work() so that the NETEVENT_NEIGH_UPDATE handler can use it directly instead of inlining equivalent code. - In patches #6 and #7, add helpers for two common operations involving a backing netdev of a RIF. This makes it unnecessary for the function mlxsw_sp_rif_dev() to be visible outside of the router module, so in patch #8, hide it. ==================== Signed-off-by: David S. Miller commit df95ae66cc0a1606278677b1be4f2170c73876a9 Author: Petr Machata Date: Fri Jun 9 19:32:13 2023 +0200 mlxsw: spectrum_router: Privatize mlxsw_sp_rif_dev() Now that the external users of mlxsw_sp_rif_dev() have been converted in the preceding patches, make the function static. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 5374a50f2eb617022cdd1aab6b1b7d4d2a952d56 Author: Petr Machata Date: Fri Jun 9 19:32:12 2023 +0200 mlxsw: Convert does-RIF-have-this-netdev queries to a dedicated helper In a number of places, a netdevice underlying a RIF is obtained only to compare it to another pointer. In order to clean up the interface between the router and the other modules, add a new helper to specifically answer this question, and convert the relevant uses to this new interface. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 0255f74845c0035d918697b7abff1fcf45ed2789 Author: Petr Machata Date: Fri Jun 9 19:32:11 2023 +0200 mlxsw: Convert RIF-has-netdevice queries to a dedicated helper In a number of places, a netdevice underlying a RIF is obtained only to check if it a NULL pointer. In order to clean up the interface between the router and the other modules, add a new helper to specifically answer this question, and convert the relevant uses to this new interface. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 151b89f6025a95dd8083d5844f2746a9450653ca Author: Petr Machata Date: Fri Jun 9 19:32:10 2023 +0200 mlxsw: spectrum_router: Reuse work neighbor initialization in work scheduler After the struct mlxsw_sp_netevent_work.n field initialization is moved here, the body of code that handles NETEVENT_NEIGH_UPDATE is almost identical to the one in the helper function. Therefore defer to the helper instead of inlining the equivalent. Note that previously, the code took and put a reference of the netdevice. The new code defers to mlxsw_sp_dev_lower_is_port() to obviate the need for taking the reference. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 14304e70634cb03913ec11b7f418df752d9ee3f8 Author: Petr Machata Date: Fri Jun 9 19:32:09 2023 +0200 mlxsw: spectrum_router: Use the available router pointer for netevent handling This code handles NETEVENT_DELAY_PROBE_TIME_UPDATE, which is invoked every time the delay_probe_time changes. mlxsw router currently only maintains one timer, so the last delay_probe_time set wins. Currently, mlxsw uses mlxsw_sp_port_lower_dev_hold() to find a reference to the router. This is no longer necessary. But as a side effect, this makes sure that only updates to "interesting netdevices" (ones that have a physical netdevice lower) are projected. Retain that side effect by calling mlxsw_sp_port_dev_lower_find_rcu() and punting if there is none. Then just proceed using the router pointer that's already at hand in the helper. Note that previously, the code took and put a reference of the netdevice. Because the mlxsw_sp pointer is now obtained from the notifier block, the port pointer (non-) NULL-ness is all that's relevant, and the reference does not need to be taken anymore. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 48dde35ea157b4b17bcccb8cd6fed3dfd9627a7a Author: Petr Machata Date: Fri Jun 9 19:32:08 2023 +0200 mlxsw: spectrum_router: Pass router to mlxsw_sp_router_schedule_work() directly Instead of passing a notifier block and deducing the router pointer from that in the helper, do that in the caller, and pass the result. In the following patches, the pointer will also be made useful in the caller. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 41b2bd208e8acf0f453e258f342a593332e3d2c8 Author: Petr Machata Date: Fri Jun 9 19:32:07 2023 +0200 mlxsw: spectrum_router: Move here inetaddr validator notifiers The validation logic is already in the router code. Move there the notifier blocks themselves as well. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 50f6c3d57e9a7d11ff935198c1d55d37975c2fa4 Author: Petr Machata Date: Fri Jun 9 19:32:06 2023 +0200 mlxsw: spectrum_router: mlxsw_sp_router_fini(): Extract a helper variable Make mlxsw_sp_router_fini() more similar to the _init() function (and more concise) by extracting the `router' handle to a named variable and using that throughout. The availability of a dedicated `router' variable will come in handy in following patches. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit e069ba07e6c7af69e119316bc87ff44869095f49 Author: Aaron Conole Date: Fri Jun 9 09:59:55 2023 -0400 net: openvswitch: add support for l4 symmetric hashing Since its introduction, the ovs module execute_hash action allowed hash algorithms other than the skb->l4_hash to be used. However, additional hash algorithms were not implemented. This means flows requiring different hash distributions weren't able to use the kernel datapath. Now, introduce support for symmetric hashing algorithm as an alternative hash supported by the ovs module using the flow dissector. Output of flow using l4_sym hash: recirc_id(0),in_port(3),eth(),eth_type(0x0800), ipv4(dst=64.0.0.0/192.0.0.0,proto=6,frag=no), packets:30473425, bytes:45902883702, used:0.000s, flags:SP., actions:hash(sym_l4(0)),recirc(0xd) Some performance testing with no GRO/GSO, two veths, single flow: hash(l4(0)): 4.35 GBits/s hash(l4_sym(0)): 4.24 GBits/s Signed-off-by: Aaron Conole Signed-off-by: David S. Miller commit 7b8c9d7bb4570ee4800642009c8f2d9756004552 Author: Amir Goldstein Date: Sun Jun 11 15:24:29 2023 +0300 fsnotify: move fsnotify_open() hook into do_dentry_open() fsnotify_open() hook is called only from high level system calls context and not called for the very many helpers to open files. This may makes sense for many of the special file open cases, but it is inconsistent with fsnotify_close() hook that is called for every last fput() of on a file object with FMODE_OPENED. As a result, it is possible to observe ACCESS, MODIFY and CLOSE events without ever observing an OPEN event. Fix this inconsistency by replacing all the fsnotify_open() hooks with a single hook inside do_dentry_open(). If there are special cases that would like to opt-out of the possible overhead of fsnotify() call in fsnotify_open(), they would probably also want to avoid the overhead of fsnotify() call in the rest of the fsnotify hooks, so they should be opening that file with the __FMODE_NONOTIFY flag. However, in the majority of those cases, the s_fsnotify_connectors optimization in fsnotify_parent() would be sufficient to avoid the overhead of fsnotify() call anyway. Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara Message-Id: <20230611122429.1499617-1-amir73il@gmail.com> commit 65137877338149185d71d2bc1481693b78377e04 Merge: f2ea0c3582abc f1e668d29c574 Author: David S. Miller Date: Mon Jun 12 09:43:31 2023 +0100 Merge branch 'taprio-xstats' Vladimir Oltean says: ==================== Fixes for taprio xstats 1. Taprio classes correspond to TXQs, and thus, class stats are TXQ stats not TC stats. 2. Drivers reporting taprio xstats should report xstats for *this* taprio, not for a previous one. ==================== Signed-off-by: David S. Miller commit f1e668d29c57499f734a291bfb96a82142322f41 Author: Vladimir Oltean Date: Fri Jun 9 16:59:17 2023 +0300 net: enetc: reset taprio stats when taprio is deleted Currently, the window_drop stats persist even if an incorrect Qdisc was removed from the interface and a new one is installed. This is because the enetc driver keeps the state, and that is persistent across multiple Qdiscs. To resolve the issue, clear all win_drop counters from all TX queues when the currently active Qdisc is removed. These counters are zero by default. The counters visible in ethtool -S are also affected, but I don't care very much about preserving those enough to keep them monotonically incrementing. Fixes: 4802fca8d1af ("net: enetc: report statistics counters for taprio") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 2b84960fc5dd38a19241388fb33f20936cb217e2 Author: Vladimir Oltean Date: Fri Jun 9 16:59:16 2023 +0300 net/sched: taprio: report class offload stats per TXQ, not per TC The taprio Qdisc creates child classes per netdev TX queue, but taprio_dump_class_stats() currently reports offload statistics per traffic class. Traffic classes are groups of TXQs sharing the same dequeue priority, so this is incorrect and we shouldn't be bundling up the TXQ stats when reporting them, as we currently do in enetc. Modify the API from taprio to drivers such that they report TXQ offload stats and not TC offload stats. There is no change in the UAPI or in the global Qdisc stats. Fixes: 6c1adb650c8d ("net/sched: taprio: add netlink reporting for offload statistics counters") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f2ea0c3582abc721ce9e090cf496b96e6b204e2c Author: Simon Horman Date: Fri Jun 9 15:31:57 2023 +0200 nfc: nxp-nci: store __be16 value in __be16 variable Use a __be16 variable to store the big endian value of header in nxp_nci_i2c_fw_read(). Flagged by Sparse as: .../i2c.c:113:22: warning: cast to restricted __be16 No functional changes intended. Compile tested only. Signed-off-by: Simon Horman Reviewed-by: Sridhar Samudrala Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit b803d1fded4085d268507a432dac8077ead68971 Author: Haiyang Zhang Date: Fri Jun 9 05:47:17 2023 -0700 net: mana: Add support for vlan tagging To support vlan, use MANA_LONG_PKT_FMT if vlan tag is present in TX skb. Then extract the vlan tag from the skb struct, and save it to tx_oob for the NIC to transmit. For vlan tags on the payload, they are accepted by the NIC too. For RX, extract the vlan tag from CQE and put it into skb. Signed-off-by: Haiyang Zhang Signed-off-by: David S. Miller commit b6334e2cd46f0dab1131c0272426182c79b51114 Author: Mao Zhu Date: Sun Jun 11 08:33:14 2023 -0400 fs: Fix comment typo Delete duplicated word in comment. Signed-off-by: Mao Zhu Message-Id: <20230611123314.5282-1-dengshaomin@cdjrlc.com> Signed-off-by: Christian Brauner commit 998b85f0468f0b4784da69c087f52149ae7ded13 Author: Martin Habets Date: Fri Jun 9 08:57:36 2023 +0100 sfc: Add devlink dev info support for EF10 Reuse the work done for EF100 to add devlink support for EF10. There is no devlink port support for EF10. Signed-off-by: Martin Habets Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 26e35370b9766914364409626035fda2c63fef05 Author: Jiapeng Chong Date: Fri Jun 9 15:01:17 2023 +0800 net/sched: act_pedit: Use kmemdup() to replace kmalloc + memcpy ./net/sched/act_pedit.c:245:21-28: WARNING opportunity for kmemdup. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5478 Signed-off-by: Jiapeng Chong Reviewed-by: Pedro Tammela Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 132b4ebfa090492663f84144a1e7afaca54cd58a Author: Nitya Sunkad Date: Thu Jun 8 22:50:16 2023 -0700 ionic: add support for ethtool extended stat link_down_count Following the example of 'commit 9a0f830f8026 ("ethtool: linkstate: add a statistic for PHY down events")', added support for link down events. Add callback ionic_get_link_ext_stats to ionic_ethtool.c to support link_down_count, a property of netdev that gets reported exclusively on physical link down events. Run ethtool -I to display the device link down count. Signed-off-by: Nitya Sunkad Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 72d77bad12c6b2207be10824c0f05ba55123161f Merge: e4f5073d53be6 0ec38df36ea1c Author: David S. Miller Date: Mon Jun 12 08:52:09 2023 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== ice: Improve miscellaneous interrupt code Jacob Keller says: This series improves the driver's use of the threaded IRQ and the communication between ice_misc_intr() and the ice_misc_intr_thread_fn() which was previously introduced by commit 1229b33973c7 ("ice: Add low latency Tx timestamp read"). First, a new custom enumerated return value is used instead of a boolean for ice_ptp_process_ts(). This significantly reduces the cognitive burden when reviewing the logic for this function, as the expected action is clear from the return value name. Second, the unconditional loop in ice_misc_intr_thread_fn() is removed, replacing it with a write to the Other Interrupt Cause register. This causes the MAC to trigger the Tx timestamp interrupt again. This makes it possible to safely use the ice_misc_intr_thread_fn() to handle other tasks beyond just the Tx timestamps. It is also easier to reason about since the thread function will exit cleanly if we do something like disable the interrupt and call synchronize_irq(). Third, refactor the handling for external timestamp events to use the miscellaneous thread function. This resolves an issue with the external time stamps getting blocked while processing the periodic work function task. Fourth, a simplification of the ice_misc_intr() function to always return IRQ_WAKE_THREAD, and schedule the ice service task in the ice_misc_intr_thread_fn() instead. Finally, the Other Interrupt Cause is kept disabled over the thread function processing, rather than immediately re-enabled. Special thanks to Michal Schmidt for the careful review of the series and pointing out my misunderstandings of the kernel IRQ code. It has been determined that the race outlined as being fixed in previous series was actually introduced by this series itself, which I've since corrected. ==================== Signed-off-by: David S. Miller commit e4f5073d53be6cec0c654fac98372047efb66947 Author: M Chetan Kumar Date: Thu Jun 8 15:38:03 2023 +0530 net: wwan: iosm: enable runtime pm support for 7560 Adds runtime pm support for 7560. As part of probe procedure auto suspend is enabled and auto suspend delay is set to 5000 ms for runtime pm use. Later auto flag is set to power manage the device at run time. On successful communication establishment between host and device the device usage counter is dropped and request to put the device into sleep state (suspend). In TX path, the device usage counter is raised and device is moved out of sleep(resume) for data transmission. In RX path, if the device has some data to be sent it request host platform to change the power state by giving PCI PME message. Signed-off-by: M Chetan Kumar Signed-off-by: David S. Miller commit cbb1ca6d5f9a5a4972c4466a4b61e5bed1f4690f Author: Radhey Shyam Pandey Date: Thu Jun 8 13:54:58 2023 +0530 dt-bindings: net: xlnx,axi-ethernet: convert bindings document to yaml Convert the bindings document for Xilinx AXI Ethernet Subsystem from txt to yaml. No changes to existing binding description. Signed-off-by: Radhey Shyam Pandey Signed-off-by: Sarath Babu Naidu Gaddam Signed-off-by: David S. Miller commit 830f93f47068b1632cc127871fbf27e918efdf46 Author: Kashyap Desai Date: Fri Jun 9 04:01:54 2023 -0700 RDMA/bnxt_re: optimize the parameters passed to helper functions Avoid passing arguments like Opcode which can be retrieved from bnxt_qplib_crsqe structure. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-18-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit bcfee4ce3e0139ffa9c564e4ed3682e8b87f0a1d Author: Kashyap Desai Date: Fri Jun 9 04:01:53 2023 -0700 RDMA/bnxt_re: remove redundant cmdq_bitmap cmdq_bitmap is used to derive the next available index in the CMDQ. This is not required as the we can get the next index using the existing bnxt_qplib_crsqe array. Driver will use bnxt_qplib_crsqe array and flag is_in_used to derive valid entries. is_in_used is replacement of cmdq_bitmap. There is no change in the existing mechanism of the circular buffer used to get index. Added opcode field in bnxt_qplib_crsqe array so that it is easy to map opcode associated with pending rcfw command. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-17-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit f0c875ff6293965a30aaeb02a0d19b293e11bc2b Author: Kashyap Desai Date: Fri Jun 9 04:01:52 2023 -0700 RDMA/bnxt_re: use firmware provided max request timeout Firmware provides max request timeout value as part of hwrm_ver_get API. Driver gets the timeout from firmware and if that interface is not available then fall back to hardcoded timeout value. Also, Add a helper function to check the FW status. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-16-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit a00278521c9107c1edec0088f512a85316795692 Author: Kashyap Desai Date: Fri Jun 9 04:01:51 2023 -0700 RDMA/bnxt_re: cancel all control path command waiters upon error When an error is detected in FW, wake up all the waiters as the all of them need to be completed with timeout. Add the device error state also as a wait condition. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-15-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit bb8c93618fb0b8567d309f1aebc6df0cd31da1a2 Author: Kashyap Desai Date: Fri Jun 9 04:01:50 2023 -0700 RDMA/bnxt_re: consider timeout of destroy ah as success. If destroy_ah is timed out, it is likely to be destroyed by firmware but it is taking longer time due to temporary slowness in processing the rcfw command. In worst case, there might be AH resource leak in firmware. Sending timeout return value can dump warning message from ib_core which can be avoided if we map timeout of destroy_ah as success. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-14-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 84911cf3b2aa8d0a1e563d346c852131582cb871 Author: Kashyap Desai Date: Fri Jun 9 04:01:49 2023 -0700 RDMA/bnxt_re: post destroy_ah for delayed completion of AH creation AH create may be called from interrpt context and driver has a special timeout (8 sec) for this command. This is to avoid soft lockups when the FW command takes more time. Driver returns -ETIMEOUT and fail create AH, without waiting for actual completion from firmware. When FW completion is received, use is_waiter_alive flag to avoid a regular completion path. If create_ah opcode is detected in completion path which does not have waiter alive, driver will fetch ah_id from successful firmware completion in the interrupt context and sends destroy_ah command for same ah_id. This special post is done in quick manner using helper function __send_message_no_waiter. timeout_send is only used for debugging purposes. If timeout_send value keeps incrementing, it indicates out of sync active ah counter between driver and firmware. This is a limitation but graceful handling is possible in future. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-13-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit b6c7256688264f5096a2cfaaaa56d01ea686b367 Author: Kashyap Desai Date: Fri Jun 9 04:01:48 2023 -0700 RDMA/bnxt_re: Add firmware stall check detection Every completion will update last_seen value in the unit of jiffies. last_seen field will be used to know if firmware is alive and is useful to detect firmware stall. Non blocking interface __wait_for_resp will have logic to detect firmware stall. After every 10 second interval if __wait_for_resp has not received completion for a given command it will check for firmware stall condition. If current jiffies is greater than last_seen jiffies + RCFW_FW_STALL_TIMEOUT_SEC * HZ, it is a firmware stall. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-12-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 691eb7c6110fe04e38bf0f60d713482508b3d199 Author: Kashyap Desai Date: Fri Jun 9 04:01:47 2023 -0700 RDMA/bnxt_re: handle command completions after driver detect a timedout If calling context detect command timeout, associated memory stored on stack will not be valid. If firmware complete the same command later, this causes incorrect memory access by driver. Added is_waiter_alive to handle delayed completion by firmware. is_waiter_alive is set and reset under command queue lock. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-11-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 354f5bd985af9515190828bc642ebdf59acea121 Author: Kashyap Desai Date: Fri Jun 9 04:01:46 2023 -0700 RDMA/bnxt_re: add helper function __poll_for_resp This interface will be used if the driver has not enabled interrupt and/or interrupt is disabled for a short period of time. Completion is not possible from interrupt so this interface does self-polling. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-10-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 159cf95e42a7ca7375646fab82c0056cbb71f9e9 Author: Kashyap Desai Date: Fri Jun 9 04:01:45 2023 -0700 RDMA/bnxt_re: Simplify the function that sends the FW commands - Use __send_message_basic_sanity helper function. - Do not retry posting same command if there is a queue full detection. - ENXIO is used to indicate controller recovery. - In the case of ERR_DEVICE_DETACHED state, the driver should not post commands to the firmware, but also return fabricated written code. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-9-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 65288a22ddd81422a2a2a10c15df976a5332e41b Author: Kashyap Desai Date: Fri Jun 9 04:01:44 2023 -0700 RDMA/bnxt_re: use shadow qd while posting non blocking rcfw command Whenever there is a fast path IO and create/destroy resources from the slow path is happening in parallel, we may notice high latency of slow path command completion. Introduces a shadow queue depth to prevent the outstanding requests to the FW. Driver will not allow more than #RCFW_CMD_NON_BLOCKING_SHADOW_QD non-blocking commands to the Firmware. Shadow queue depth is a soft limit only for non-blocking commands. Blocking commands will be posted to the firmware as long as there is a free slot. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-8-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 3022cc15119733cebaef05feddb5d87b9e401c0e Author: Kashyap Desai Date: Fri Jun 9 04:01:43 2023 -0700 RDMA/bnxt_re: Avoid the command wait if firmware is inactive Add a check to avoid waiting if driver already detects a FW timeout. Return success for resource destroy in case the device is detached. Add helper function to map timeout error code to success. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-7-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 8cf1d12ad56beb73d2439ccf334b7148e71de58e Author: Kashyap Desai Date: Fri Jun 9 04:01:42 2023 -0700 RDMA/bnxt_re: Enhance the existing functions that wait for FW responses Use jiffies based timewait instead of counting iteration for commands that block for FW response. Also add a poll routine for control path commands. This is for polling completion if the waiting commands timeout. This avoids cases where the driver misses completion interrupts. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-6-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 258ee04317dacf789da420e2791fde2eb0da6946 Author: Kashyap Desai Date: Fri Jun 9 04:01:41 2023 -0700 RDMA/bnxt_re: set fixed command queue depth There is no need of setting max command queue entries based on firmware version check. Removing deperecated code. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-5-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit b021186bca9d6b3d6d16ea8b97c4a598f62de12c Author: Kashyap Desai Date: Fri Jun 9 04:01:40 2023 -0700 RDMA/bnxt_re: remove virt_func check while creating RoCE FW channel There is a common FW communication offset for both PF and VF. Removed code around virt_fn check while creating FW channel. Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-4-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 3099bcdc19b701f732f638ee45679858c08559bb Author: Kashyap Desai Date: Fri Jun 9 04:01:39 2023 -0700 RDMA/bnxt_re: Avoid calling wake_up threads from spin_lock context bnxt_qplib_service_creq can be called from interrupt or tasklet or process context. So the function take irq variant of spin_lock. But when wake_up is invoked with the lock held, it is putting the calling context to sleep. [exception RIP: __wake_up_common+190] RIP: ffffffffb7539d7e RSP: ffffa73300207ad8 RFLAGS: 00000083 RAX: 0000000000000001 RBX: ffff91fa295f69b8 RCX: dead000000000200 RDX: ffffa733344af940 RSI: ffffa73336527940 RDI: ffffa73336527940 RBP: 000000000000001c R8: 0000000000000002 R9: 00000000000299c0 R10: 0000017230de82c5 R11: 0000000000000002 R12: ffffa73300207b28 R13: 0000000000000000 R14: ffffa733341bf928 R15: 0000000000000000 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 Call the wakeup after releasing the lock. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-3-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 0af91306e17ef3d18e5f100aa58aa787869118af Author: Kashyap Desai Date: Fri Jun 9 04:01:38 2023 -0700 RDMA/bnxt_re: wraparound mbox producer index Driver is not handling the wraparound of the mbox producer index correctly. Currently the wraparound happens once u32 max is reached. Bit 31 of the producer index register is special and should be set only once for the first command. Because the producer index overflow setting bit31 after a long time, FW goes to initialization sequence and this causes FW hang. Fix is to wraparound the mbox producer index once it reaches u16 max. Fixes: cee0c7bba486 ("RDMA/bnxt_re: Refactor command queue management code") Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1686308514-11996-2-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 87200371817ec6e48e42ef2f03756268661a8815 Author: Mika Westerberg Date: Fri May 26 14:55:20 2023 +0300 thunderbolt: Enable/disable sideband depending on USB4 port offline mode When USB4 port is in offline mode (this mean there is no device attached) we want to keep the sideband up to make it possible to communicate with the retimers. In the same way there is no need to enable sideband transactions when the USB4 port is not offline as they are already up. For this reason make the enabling/disabling depend on the USB4 port offline status. Signed-off-by: Mika Westerberg commit b7b83911f7906a72f50806279ef22c86be728b69 Author: Mika Westerberg Date: Fri May 26 14:51:23 2023 +0300 thunderbolt: Do not send UNSET_INBOUND_SBTX when retimer NVM authentication started Once retimer NVM authentication is started, sending UNSET_INBOUND_SBTX will fail so avoid doing that. Only send it when we are writing an image with not authentication or when the authentication failed early. Signed-off-by: Mika Westerberg commit 1402ba08abae5cfa583ff1a40b99c098a0532d41 Author: Mika Westerberg Date: Fri May 26 14:46:44 2023 +0300 thunderbolt: Read retimer NVM authentication status prior tb_retimer_set_inbound_sbtx() According to the USB4 retimer guide the correct order is immediately after sending ENUMERATE_RETIMERS so update the code to follow this. Signed-off-by: Mika Westerberg commit fece685cc7bbb5e1af89f891223c31c3bcc969f7 Author: Guoqing Jiang Date: Wed May 24 15:00:26 2023 +0800 block/rnbd-srv: make process_msg_sess_info returns void Change the return type to void given it always returns 0. Acked-by: Jack Wang Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20230524070026.2932-9-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit d3fc0b46642524bc8e38aed3c7f5e99742436495 Author: Guoqing Jiang Date: Wed May 24 15:00:25 2023 +0800 block/rnbd-srv: init err earlier in rnbd_srv_init_module With this, we can remove several lines of code. Acked-by: Jack Wang Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20230524070026.2932-8-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit 6a12d5379508d530a73140fc7d5502551558ced5 Author: Guoqing Jiang Date: Wed May 24 15:00:24 2023 +0800 block/rnbd-srv: init ret with 0 instead of -EPERM Let's always set errno after pr_err which is consistent with default case. Acked-by: Jack Wang Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20230524070026.2932-7-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit 3ecdbf91513511fae49eb0cfa9f39f690eb4fe11 Author: Guoqing Jiang Date: Wed May 24 15:00:23 2023 +0800 block/rnbd-srv: rename one member in rnbd_srv_dev It actually represents the name of rnbd_srv_dev. Acked-by: Jack Wang Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20230524070026.2932-6-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit ba2eed1cf8f08f1e5b1ba009ac22554f14d05342 Author: Guoqing Jiang Date: Wed May 24 15:00:22 2023 +0800 block/rnbd-srv: no need to check sess_dev Check ret is enough since if sess_dev is NULL which also implies ret should be 0. Acked-by: Jack Wang Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20230524070026.2932-5-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit d6e94913cb1cb4b4d1d737f72b5cef10b13395ff Author: Guoqing Jiang Date: Wed May 24 15:00:21 2023 +0800 block/rnbd: introduce rnbd_access_modes Add one new array (marked with __maybe_unused to prevent gcc warning about "defined but not used" with W=1), then we can remove rnbd_access_mode_str and rnbd-common.c accordingly. Signed-off-by: Guoqing Jiang Acked-by: Jack Wang Link: https://lore.kernel.org/r/20230524070026.2932-4-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit 5783153ac67e20f65a402ef42237cd1a6d7fa320 Author: Guoqing Jiang Date: Wed May 24 15:00:20 2023 +0800 block/rnbd-srv: remove unused header No need to include it since none of macros in limits.h are used by rnbd-srv. Acked-by: Jack Wang Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20230524070026.2932-3-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit b0488411e919368014907850f74191d03e25f031 Author: Guoqing Jiang Date: Wed May 24 15:00:19 2023 +0800 block/rnbd: kill rnbd_flags_supported This routine is not called since added. Then the two flags (RNBD_OP_LAST and RNBD_F_ALL) can be removed too after kill rnbd_flags_supported. Acked-by: Jack Wang Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20230524070026.2932-2-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe commit a68e1aec587a75a51496f1b207272b6034cca190 Author: Shreeya Patel Date: Sat Jun 10 19:18:41 2023 +0530 arm64: dts: rockchip: Add saradc node to rock5b Add ADC support for ROCK 5B. Signed-off-by: Shreeya Patel Link: https://lore.kernel.org/r/20230610134841.172313-1-shreeya.patel@collabora.com Signed-off-by: Heiko Stuebner commit a10b3841f901714dbe16a8f9b0f2bbe1034e6454 Author: Randy Dunlap Date: Sun Apr 30 19:49:50 2023 -0700 soc: rockchip: dtpm: use C99 array init syntax Eliminate sparse warnings in soc/rockchip/dtpm.c: drivers/soc/rockchip/dtpm.c:15:12: sparse: warning: obsolete array initializer, use C99 syntax drivers/soc/rockchip/dtpm.c:17:12: sparse: warning: obsolete array initializer, use C99 syntax drivers/soc/rockchip/dtpm.c:20:12: sparse: warning: obsolete array initializer, use C99 syntax drivers/soc/rockchip/dtpm.c:23:12: sparse: warning: obsolete array initializer, use C99 syntax drivers/soc/rockchip/dtpm.c:26:12: sparse: warning: obsolete array initializer, use C99 syntax drivers/soc/rockchip/dtpm.c:29:12: sparse: warning: obsolete array initializer, use C99 syntax drivers/soc/rockchip/dtpm.c:32:12: sparse: warning: obsolete array initializer, use C99 syntax drivers/soc/rockchip/dtpm.c:35:12: sparse: warning: obsolete array initializer, use C99 syntax drivers/soc/rockchip/dtpm.c:38:12: sparse: warning: obsolete array initializer, use C99 syntax drivers/soc/rockchip/dtpm.c:41:12: sparse: warning: obsolete array initializer, use C99 syntax Fixes: b9d6c47a2be8 ("rockchip/soc/drivers: Add DTPM description for rk3399") Signed-off-by: Randy Dunlap Cc: Daniel Lezcano Cc: Heiko Stuebner Cc: linux-rockchip@lists.infradead.org Acked-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230501024950.31518-1-rdunlap@infradead.org Signed-off-by: Heiko Stuebner commit 518f375c15af724cd89a4ec888dea942bb27f77f Author: Jeff Layton Date: Fri May 19 07:17:23 2023 -0400 nfsd: don't provide pre/post-op attrs if fh_getattr fails nfsd calls fh_getattr to get the latest inode attrs for pre/post-op info. In the event that fh_getattr fails, it resorts to scraping cached values out of the inode directly. Since these attributes are optional, we can just skip providing them altogether when this happens. Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever Reviewed-by: Neil Brown commit df56b384de521236c261bf34856dd0d3ba772850 Author: Chuck Lever Date: Thu May 18 13:46:09 2023 -0400 NFSD: Remove nfsd_readv() nfsd_readv()'s consumers now use nfsd_iter_read(). Signed-off-by: Chuck Lever commit 703d7521555504b3a316b105b4806d641b7ebc76 Author: Chuck Lever Date: Thu May 18 13:46:03 2023 -0400 NFSD: Hoist rq_vec preparation into nfsd_read() [step two] Now that the preparation of an rq_vec has been removed from the generic read path, nfsd_splice_read() no longer needs to reset rq_next_page. nfsd4_encode_read() calls nfsd_splice_read() directly. As far as I can ascertain, resetting rq_next_page for NFSv4 splice reads is unnecessary because rq_next_page is already set correctly. Moreover, resetting it might even be incorrect if previous operations in the COMPOUND have already consumed at least a page of the send buffer. I would expect that the result would be encoding the READ payload over previously-encoded results. Signed-off-by: Chuck Lever commit 507df40ebf31655203dd05e6e31db5849a83347a Author: Chuck Lever Date: Thu May 18 13:45:56 2023 -0400 NFSD: Hoist rq_vec preparation into nfsd_read() Accrue the following benefits: a) Deduplicate this common bit of code. b) Don't prepare rq_vec for NFSv2 and NFSv3 spliced reads, which don't use rq_vec. This is already the case for nfsd4_encode_read(). c) Eventually, converting NFSD's read path to use a bvec iterator will be simpler. In the next patch, nfsd_iter_read() will replace nfsd_readv() for all NFS versions. Signed-off-by: Chuck Lever commit ed4a567a179ec15c15f78fa60ca6de9cc4f34897 Author: Chuck Lever Date: Thu May 18 13:45:50 2023 -0400 NFSD: Update rq_next_page between COMPOUND operations A GETATTR with a large result can advance xdr->page_ptr without updating rq_next_page. If a splice READ follows that GETATTR in the COMPOUND, nfsd_splice_actor can start splicing at the wrong page. I've also seen READLINK and READDIR leave rq_next_page in an unmodified state. There are potentially a myriad of combinations like this, so play it safe: move the rq_next_page update to nfsd4_encode_operation. Signed-off-by: Chuck Lever commit ba21e20b309564c64761f4953db4456ec8c4e49c Author: Chuck Lever Date: Thu May 18 13:45:43 2023 -0400 NFSD: Use svcxdr_encode_opaque_pages() in nfsd4_encode_splice_read() Commit 15b23ef5d348 ("nfsd4: fix corruption of NFSv4 read data") encountered exactly the same issue: after a splice read, a filesystem-owned page is left in rq_pages[]; the symptoms are the same as described there. If the computed number of pages in nfsd4_encode_splice_read() is not exactly the same as the actual number of pages that were consumed by nfsd_splice_actor() (say, because of a bug) then hilarity ensues. Instead of recomputing the page offset based on the size of the payload, use rq_next_page, which is already properly updated by nfsd_splice_actor(), to cause svc_rqst_release_pages() to operate correctly in every instance. This is a defensive change since we believe that after commit 27c934dd8832 ("nfsd: don't replace page in rq_pages if it's a continuation of last page") has been applied, there are no known opportunities for nfsd_splice_actor() to screw up. So I'm not marking it for stable backport. Reported-by: Andy Zlotek Suggested-by: Calum Mackay Signed-off-by: Chuck Lever commit 26a4dd839eeba3638df8441223903baa49c6f0da Author: Vladimir Nikishkin Date: Thu Jun 8 14:44:48 2023 +0800 selftests: net: vxlan: Fix selftest regression after changes in iproute2. The iproute2 output that eventually landed upstream is different than the one used in this test, resulting in failures. Fix by adjusting the test to use iproute2's JSON output, which is more stable than regular output. Fixes: 305c04189997 ("selftests: net: vxlan: Add tests for vxlan nolocalbypass option.") Signed-off-by: Vladimir Nikishkin Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: David S. Miller commit a8ac2961148e8c720dc760f2e06627cd5c55a154 Author: Sergey Shtylyov Date: Thu Jun 1 23:22:17 2023 +0300 sh: Avoid using IRQ0 on SH3 and SH4 IRQ0 is no longer returned by platform_get_irq() and its ilk -- they now return -EINVAL instead. However, the kernel code supporting SH3/4-based SoCs still maps the IRQ #s starting at 0 -- modify that code to start the IRQ #s from 16 instead. The patch should mostly affect the AP-SH4A-3A/AP-SH4AD-0A boards as they indeed are using IRQ0 for the SMSC911x compatible Ethernet chip. Fixes: ce753ad1549c ("platform: finally disallow IRQ0 in platform_get_irq() and its ilk") Signed-off-by: Sergey Shtylyov Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Tested-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/71105dbf-cdb0-72e1-f9eb-eeda8e321696@omp.ru Signed-off-by: John Paul Adrian Glaubitz commit 3b3dfd58bace12e8348e5863e05867afd2ead28b Author: Cheng Xu Date: Tue Jun 6 13:50:05 2023 +0800 RDMA/erdma: Refactor the original doorbell allocation mechanism The original doorbell allocation mechanism is complex and does not meet the isolation requirement. So we introduce a new doorbell mechanism and the original mechanism (only be used with CAP_SYS_RAWIO if hardware does not support the new mechanism) needs to be kept as simple as possible for compatibility. Signed-off-by: Cheng Xu Link: https://lore.kernel.org/r/20230606055005.80729-5-chengyou@linux.alibaba.com Signed-off-by: Leon Romanovsky commit 6534de1fe385145d256cf5f37b01ccbd63e23405 Author: Cheng Xu Date: Tue Jun 6 13:50:04 2023 +0800 RDMA/erdma: Associate QPs/CQs with doorbells for authorization For the isolation requirement, each QP/CQ can only issue doorbells from the allocated mmio space. Configure the relationship between QPs/CQs and mmio doorbell spaces to hardware in create_qp/create_cq interfaces. Signed-off-by: Cheng Xu Link: https://lore.kernel.org/r/20230606055005.80729-4-chengyou@linux.alibaba.com Signed-off-by: Leon Romanovsky commit 7e9a1dada2266c1ef777eba123b5515859779eb9 Author: Cheng Xu Date: Tue Jun 6 13:50:03 2023 +0800 RDMA/erdma: Allocate doorbell resources from hardware Each ucontext will try to allocate doorbell resources in the extended bar space from hardware. For compatibility, we change nothing for the original bar space, and it will be used only for applications with CAP_SYS_RAWIO authority in the older HW/FW environments. Signed-off-by: Cheng Xu Link: https://lore.kernel.org/r/20230606055005.80729-3-chengyou@linux.alibaba.com Signed-off-by: Leon Romanovsky commit 128f8404306d4299f4b962ba1161f14a794ddb13 Author: Cheng Xu Date: Tue Jun 6 13:50:02 2023 +0800 RDMA/erdma: Configure PAGE_SIZE to hardware Add a new CMDQ message to configure hardware. Initially the page size (in the format of shift) will be passed to hardware, so that hardware can organize the mmio space properly. It's called only if hardware supports it. Signed-off-by: Cheng Xu Link: https://lore.kernel.org/r/20230606055005.80729-2-chengyou@linux.alibaba.com Signed-off-by: Leon Romanovsky commit 22664c06e997087fe37f9ba208008c948571214a Author: Patrisious Haddad Date: Mon Jun 5 13:14:07 2023 +0300 RDMA/mlx5: Return the firmware result upon destroying QP/RQ Previously when destroying a QP/RQ, the result of the firmware destruction function was ignored and upper layers weren't informed about the failure. Which in turn could lead to various problems since when upper layer isn't aware of the failure it continues its operation thinking that the related QP/RQ was successfully destroyed while it actually wasn't, which could lead to the below kernel WARN. Currently, we return the correct firmware destruction status to upper layers which in case of the RQ would be mlx5_ib_destroy_wq() which was already capable of handling RQ destruction failure or in case of a QP to destroy_qp_common(), which now would actually warn upon qp destruction failure. WARNING: CPU: 3 PID: 995 at drivers/infiniband/core/rdma_core.c:940 uverbs_destroy_ufile_hw+0xcb/0xe0 [ib_uverbs] Modules linked in: xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcrdma rdma_ucm ib_iser libiscsi scsi_transport_iscsi rdma_cm ib_umad ib_ipoib iw_cm ib_cm mlx5_ib ib_uverbs ib_core overlay mlx5_core fuse CPU: 3 PID: 995 Comm: python3 Not tainted 5.16.0-rc5+ #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:uverbs_destroy_ufile_hw+0xcb/0xe0 [ib_uverbs] Code: 41 5c 41 5d 41 5e e9 44 34 f0 e0 48 89 df e8 4c 77 ff ff 49 8b 86 10 01 00 00 48 85 c0 74 a1 4c 89 e7 ff d0 eb 9a 0f 0b eb c1 <0f> 0b be 04 00 00 00 48 89 df e8 b6 f6 ff ff e9 75 ff ff ff 90 0f RSP: 0018:ffff8881533e3e78 EFLAGS: 00010287 RAX: ffff88811b2cf3e0 RBX: ffff888106209700 RCX: 0000000000000000 RDX: ffff888106209780 RSI: ffff8881533e3d30 RDI: ffff888109b101a0 RBP: 0000000000000001 R08: ffff888127cb381c R09: 0de9890000000009 R10: ffff888127cb3800 R11: 0000000000000000 R12: ffff888106209780 R13: ffff888106209750 R14: ffff888100f20660 R15: 0000000000000000 FS: 00007f8be353b740(0000) GS:ffff88852c980000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f8bd5b117c0 CR3: 000000012cd8a004 CR4: 0000000000370ea0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ib_uverbs_close+0x1a/0x90 [ib_uverbs] __fput+0x82/0x230 task_work_run+0x59/0x90 exit_to_user_mode_prepare+0x138/0x140 syscall_exit_to_user_mode+0x1d/0x50 ? __x64_sys_close+0xe/0x40 do_syscall_64+0x4a/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f8be3ae0abb Code: 03 00 00 00 0f 05 48 3d 00 f0 ff ff 77 41 c3 48 83 ec 18 89 7c 24 0c e8 83 43 f9 ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 c1 43 f9 ff 8b 44 RSP: 002b:00007ffdb51909c0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000557bb7f7c020 RCX: 00007f8be3ae0abb RDX: 0000557bb7c74010 RSI: 0000557bb7f14ca0 RDI: 0000000000000005 RBP: 0000557bb7fbd598 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000557bb7fbd5b8 R13: 0000557bb7fbd5a8 R14: 0000000000001000 R15: 0000557bb7f7c020 Signed-off-by: Patrisious Haddad Link: https://lore.kernel.org/r/c6df677f931d18090bafbe7f7dbb9524047b7d9b.1685953497.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit afff24899846ffca0c25c75b24893c90aef82603 Author: Patrisious Haddad Date: Mon Jun 5 13:14:06 2023 +0300 RDMA/mlx5: Handle DCT QP logic separately from low level QP interface Previously when destroying a DCT, if the firmware function for the destruction failed, the common resource would have been destroyed either way, since it was destroyed before the firmware object. Which leads to kernel warning "refcount_t: underflow" which indicates possible use-after-free. Which is triggered when we try to destroy the common resource for the second time and execute refcount_dec_and_test(&common->refcount). So, let's fix the destruction order by factoring out the DCT QP logic to be in separate XArray database. refcount_t: underflow; use-after-free. WARNING: CPU: 8 PID: 1002 at lib/refcount.c:28 refcount_warn_saturate+0xd8/0xe0 Modules linked in: xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcrdma rdma_ucm ib_iser libiscsi scsi_transport_iscsi ib_umad rdma_cm ib_ipoib iw_cm ib_cm mlx5_ib ib_uverbs ib_core overlay mlx5_core fuse CPU: 8 PID: 1002 Comm: python3 Not tainted 5.16.0-rc5+ #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:refcount_warn_saturate+0xd8/0xe0 Code: ff 48 c7 c7 18 f5 23 82 c6 05 60 70 ff 00 01 e8 d0 0a 45 00 0f 0b c3 48 c7 c7 c0 f4 23 82 c6 05 4c 70 ff 00 01 e8 ba 0a 45 00 <0f> 0b c3 0f 1f 44 00 00 8b 07 3d 00 00 00 c0 74 12 83 f8 01 74 13 RSP: 0018:ffff8881221d3aa8 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff8881313e8d40 RCX: ffff88852cc1b5c8 RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ffff88852cc1b5c0 RBP: ffff888100f70000 R08: ffff88853ffd1ba8 R09: 0000000000000003 R10: 00000000fffff000 R11: 3fffffffffffffff R12: 0000000000000246 R13: ffff888100f71fa0 R14: ffff8881221d3c68 R15: 0000000000000020 FS: 00007efebbb13740(0000) GS:ffff88852cc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005611aac29f80 CR3: 00000001313de004 CR4: 0000000000370ea0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: destroy_resource_common+0x6e/0x95 [mlx5_ib] mlx5_core_destroy_rq_tracked+0x38/0xbe [mlx5_ib] mlx5_ib_destroy_wq+0x22/0x80 [mlx5_ib] ib_destroy_wq_user+0x1f/0x40 [ib_core] uverbs_free_wq+0x19/0x40 [ib_uverbs] destroy_hw_idr_uobject+0x18/0x50 [ib_uverbs] uverbs_destroy_uobject+0x2f/0x190 [ib_uverbs] uobj_destroy+0x3c/0x80 [ib_uverbs] ib_uverbs_cmd_verbs+0x3e4/0xb80 [ib_uverbs] ? uverbs_free_wq+0x40/0x40 [ib_uverbs] ? ip_list_rcv+0xf7/0x120 ? netif_receive_skb_list_internal+0x1b6/0x2d0 ? task_tick_fair+0xbf/0x450 ? __handle_mm_fault+0x11fc/0x1450 ib_uverbs_ioctl+0xa4/0x110 [ib_uverbs] __x64_sys_ioctl+0x3e4/0x8e0 ? handle_mm_fault+0xb9/0x210 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7efebc0be17b Code: 0f 1e fa 48 8b 05 1d ad 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ed ac 0c 00 f7 d8 64 89 01 48 RSP: 002b:00007ffe71813e78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007ffe71813fb8 RCX: 00007efebc0be17b RDX: 00007ffe71813fa0 RSI: 00000000c0181b01 RDI: 0000000000000005 RBP: 00007ffe71813f80 R08: 00005611aae96020 R09: 000000000000004f R10: 00007efebbf9ffa0 R11: 0000000000000246 R12: 00007ffe71813f80 R13: 00007ffe71813f4c R14: 00005611aae2eca0 R15: 00007efeae6c89d0 Signed-off-by: Patrisious Haddad Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/4470888466c8a898edc9833286967529cc5f3c0d.1685953497.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit 2ecfd946169e7f56534db2a5f6935858be3005ba Author: Leon Romanovsky Date: Mon Jun 5 13:14:05 2023 +0300 RDMA/mlx5: Reduce QP table exposure driver.h is common header to whole mlx5 code base, but struct mlx5_qp_table is used in mlx5_ib driver only. So move that struct to be under sole responsibility of mlx5_ib. Link: https://lore.kernel.org/r/bec0dc1158e795813b135d1143147977f26bf668.1685953497.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit c023b61ac8285dc6b2b2f275bf9d97cfd36b56fb Author: Patrisious Haddad Date: Mon Jun 5 13:14:04 2023 +0300 net/mlx5: Nullify qp->dbg pointer post destruction Nullifying qp->dbg is a preparation for the next patches from the series in which mlx5_core_destroy_qp() could actually fail, and then it can be called again which causes a kernel crash, since qp->dbg was not nullified in previous call. Signed-off-by: Patrisious Haddad Link: https://lore.kernel.org/r/1677e52bb642fd8d6062d73a5aa69083c0283dc9.1685953497.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit 15253079ca300160c92c9c0ee2541836463043f6 Author: Mark Brown Date: Sat Jun 10 15:26:37 2023 +0100 ALSA: hda: Use maple tree register cache HDA can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-alsa-hda-maple-v1-1-a2b725c8b8f5@kernel.org Signed-off-by: Takashi Iwai commit 4e739807ca96e56d0a7f6256f13c4ff416850ef9 Merge: ad64639417161 647c16ac7b15f Author: Linus Walleij Date: Sat Jun 10 20:59:13 2023 +0200 Merge tag 'qcom-pinctrl-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt into devel Qualcomm pinctrl Devicetree bindings changes for v6.5 Simplify remaining bindings with usage of unevaluatedProperties. This will have the same functional effect with less code. commit 3334129245a93142a509112b9947609c8051f733 Merge: e431e712c8367 c87bd91e34e15 Author: David S. Miller Date: Sat Jun 10 19:49:34 2023 +0100 Merge branch 'renesas-rswitch-perf' Yoshihiro Shimoda says: ==================== net: renesas: rswitch: Improve perfromance of TX/RX This patch series is based on net-next.git / main branch [1]. This patch series can improve perfromance of TX in a specific condition. The previous code used "global rate limiter" feature so that this is possible to cause performance down if we use multiple ports at the same time. To resolve this issue, use "hardware pause" features of GWCA and COMA. Note that this is not related to the ethernet PAUSE frames. < UDP TX by iperf3 > before: about 450Mbps on both tsn0 and tsn1 after: about 950Mbps on both tsn0 and tsn1 Also, this patch series can improve performance of RX by using napi_gro_receive(). < TCP RX by iperf > before: about 670Mbps on tsn0 after: about 840Mbps on tsn0 [1] The commit e06bd5e3adae ("Merge branch 'followup-fixes-for-the-dwmac-and-altera-lynx-conversion'") Changes from v3: https://lore.kernel.org/all/20230607015641.1724057-1-yoshihiro.shimoda.uh@renesas.com/ - Rebased on the latest net-next.git / main branch. - Added Reviewed-by in the patch 2/2. (Maciej, thanks!) - Fix typos in the commit description in the patch 2/2. Changes from v2: https://lore.kernel.org/all/20230606085558.1708766-1-yoshihiro.shimoda.uh@renesas.com/ - Rebased on the latest net-next.git / main branch. - Added Reviewed-by in the patch 1/2. (Maciej, thanks!) - Revise the commit description in the patch 2/2. - Add definition to remove magic hardcoded numbers in the patch 2/2. Changes from v1: https://lore.kernel.org/all/20230529080840.1156458-1-yoshihiro.shimoda.uh@renesas.com/ - Rebased on the latest net-next.git / main branch. - Use "hardware pause" feature instead of "per-queue limiter" feature. - Drop refactaring for "per-queue limiter". - Drop dt-bindings update because "hardware pause" doesn't need additional clock information. - Use napi_gro_receive() to improve RX performance. ==================== Signed-off-by: David S. Miller commit c87bd91e34e1593584c3b309e8fead833c985855 Author: Yoshihiro Shimoda Date: Thu Jun 8 11:20:07 2023 +0900 net: renesas: rswitch: Use hardware pause features Since this driver used the "global rate limiter" feature of GWCA, the TX performance of each port was reduced when multiple ports transmitted frames simultaneously. To improve performance, remove the use of the "global rate limiter" feature and use "hardware pause" features of the following: - "per priority pause" of GWCA - "global pause" of COMA Note that these features are not related to the ethernet PAUSE frame. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Maciej Fijalkowski Signed-off-by: David S. Miller commit dc510c6d2ecfff1faaf95b642c5fc01c86d6fdff Author: Yoshihiro Shimoda Date: Thu Jun 8 11:20:06 2023 +0900 net: renesas: rswitch: Use napi_gro_receive() in RX This hardware can receive multiple frames so that using napi_gro_receive() instead of netif_receive_skb() gets good performance of RX. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Maciej Fijalkowski Signed-off-by: David S. Miller commit 0cf9a77e80fa48e4392e408f8660e93c080cb78d Author: Shreeya Patel Date: Sat Jun 10 20:06:01 2023 +0530 dt-bindings: iio: rockchip: Fix 'oneOf' condition failed warning rk3588-saradc isn't compatible with the rk3399-saradc variant, hence, fix the following dtbs_check warning for 'oneOf' condition failure. DTC_CHK arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dtb /home/shreeya/linux/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dtb: saradc@fec10000: compatible: 'oneOf' conditional failed, one must be fixed: ['rockchip,rk3588-saradc'] is too short 'rockchip,saradc' was expected 'rockchip,rk3066-tsadc' was expected 'rockchip,rk3399-saradc' was expected Fixes: 2daf2ae9793d ("dt-bindings: iio: adc: Add rockchip,rk3588-saradc string") Signed-off-by: Shreeya Patel Reviewed-by: Heiko Stuebner Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230610143601.173307-1-shreeya.patel@collabora.com Signed-off-by: Jonathan Cameron commit c57fa0037024c92c2ca34243e79e857da5d2c0a9 Author: George Stark Date: Tue Jun 6 19:53:57 2023 +0300 meson saradc: fix clock divider mask length According to the datasheets of supported meson SoCs length of ADC_CLK_DIV field is 6-bit. Although all supported SoCs have the register with that field documented later SoCs use external clock rather than ADC internal clock so this patch affects only meson8 family (S8* SoCs). Fixes: 3adbf3427330 ("iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs") Signed-off-by: George Stark Reviewed-by: Andy Shevchenko Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230606165357.42417-1-gnstark@sberdevices.ru Cc: Signed-off-by: Jonathan Cameron commit 939110f2d0759c679d860ead97d5a8fcf94220e7 Author: Geert Uytterhoeven Date: Tue Jun 6 12:03:39 2023 +0200 dt-bindings: iio: afe: voltage-divider: Spelling s/curcuit/circuit/ Fix a misspelling of "circuit". Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Acked-by: Peter Rosin Link: https://lore.kernel.org/r/a8597e54b55dedc51025fe3073d25ef0d659d0dc.1686045793.git.geert+renesas@glider.be Signed-off-by: Jonathan Cameron commit 450d1a8ce1e5f1cadd402ae62013afff50a5cc9c Author: Guenter Roeck Date: Fri Jun 9 11:24:47 2023 -0700 hwmon: (pmbus/max16601) Add support for new revisions of MAX16508 New revisions of MAX16508 report MAX16508.xx or MAX16508y.xx as device ID, but are functionally similar to MAX16508. Add support for those chip variants. Cc: Vlad Sytchenko Cc: Steve Foreman Signed-off-by: Guenter Roeck commit 5e28d5e4b8bbc94526e66e808ef0ba1b91b72b3e Author: Yongsheng Yang Date: Fri Jun 9 11:55:10 2023 +0400 Documentation/hwmon: Fix description of devm_hwmon_device_unregister() Use devm_hwmon_device_register_with_info to replace hwmon_device_register_with_info in description of devm_hwmon_device_unregister. Signed-off-by: Yongsheng Yang Reviewed-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20230609075510.1305-1-iyysheng@gmail.com Signed-off-by: Guenter Roeck commit 7357b1876b212742a5bec59786d660cfcf66defb Author: Mark Brown Date: Sat Jun 10 14:59:11 2023 +0100 hwmon: (tmp464) Use maple tree register cache The tmp464 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-hwmon-maple-v1-5-8edacce86b28@kernel.org Signed-off-by: Guenter Roeck commit e68953fcc69e08bdefab700e876f13f671881ad8 Author: Mark Brown Date: Sat Jun 10 14:59:10 2023 +0100 hwmon: (tmp108) Use maple tree register cache The tmp108 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-hwmon-maple-v1-4-8edacce86b28@kernel.org Signed-off-by: Guenter Roeck commit 729f1f738a76accdd9dca4d0eaeba4b263bdee60 Author: Mark Brown Date: Sat Jun 10 14:59:09 2023 +0100 hwmon: (tmp102) Use maple tree register cache The tmp102 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-hwmon-maple-v1-3-8edacce86b28@kernel.org Signed-off-by: Guenter Roeck commit 6ef3811c40eb24c061cfd8ba445bccb4ac46ca98 Author: Mark Brown Date: Sat Jun 10 14:59:08 2023 +0100 hwmon: (lm95245) Use maple tree register cache The lm95245 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-hwmon-maple-v1-2-8edacce86b28@kernel.org Signed-off-by: Guenter Roeck commit 30841ce37321fa66c58ee79ec7b17a45df2a6b9e Author: Mark Brown Date: Sat Jun 10 14:59:07 2023 +0100 hwmon: (lm75) Use maple tree register cache The lm75 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230609-hwmon-maple-v1-1-8edacce86b28@kernel.org Signed-off-by: Guenter Roeck commit 1b90e8f8879c64d4f77dd1f25134397ac075b7bd Author: Dmitry Baryshkov Date: Tue Apr 11 19:19:03 2023 +0300 drm/msm/adreno: change adreno_is_* functions to accept const argument All adreno_is_*() functions do not modify their argument in any way, so they can be changed to accept const struct adreno_gpu pointer. Suggested-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/531706/ Signed-off-by: Rob Clark commit cc943f43ece7be313617ccb8425c31e02b73cbbe Author: Dmitry Baryshkov Date: Tue Apr 11 19:19:02 2023 +0300 drm/msm/adreno: warn if chip revn is verified before being set The commit 010c8bbad2cb ("drm: msm: adreno: Disable preemption on Adreno 510") tried to check GPU's revn before revn being set. Add WARN_ON_ONCE to prevent such bugs from happening again. A separate helper is necessary so that the warning is displayed really just once instead of being displayed for each of comparisons. Suggested-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/531705/ Signed-off-by: Rob Clark commit 736a9327365644b460e4498b1ce172ca411efcbc Author: Dmitry Baryshkov Date: Sun Apr 9 04:13:29 2023 +0300 drm/msm/a5xx: really check for A510 in a5xx_gpu_init The commit 010c8bbad2cb ("drm: msm: adreno: Disable preemption on Adreno 510") added special handling for a510 (this SKU doesn't seem to support preemption, so the driver should clamp nr_rings to 1). However the gpu->revn is not yet set (it is set later, in adreno_gpu_init()) and thus the condition is always false. Check config->rev instead. Fixes: 010c8bbad2cb ("drm: msm: adreno: Disable preemption on Adreno 510") Reported-by: Adam Skladowski Signed-off-by: Dmitry Baryshkov Tested-by: Adam Skladowski Patchwork: https://patchwork.freedesktop.org/patch/531511/ Signed-off-by: Rob Clark commit bf08e9791ca4e598f7088f24189dc3ef802b2a9f Author: Rob Clark Date: Sat Jun 3 09:43:56 2023 -0700 drm/msm/a6xx: Fix a690 CP_PROTECT settings Allow access to CP_PERFCTR_CP_SEL[n] and RB_PERFCTR_RB_SEL which are used by fdperf and pps-provider (perfetto). Signed-off-by: Rob Clark commit 5e7665b5e484b32872bc1f44263940f094ccd814 Author: Bjorn Andersson Date: Tue May 30 20:09:43 2023 -0700 drm/msm/adreno: Add Adreno A690 support Introduce support for the Adreno A690, found in Qualcomm SC8280XP. Tested-by: Steev Klimaszewski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Patchwork: https://patchwork.freedesktop.org/patch/540335/ Signed-off-by: Rob Clark commit 171f580e32096e0cbd19e458d704b9330197d627 Author: Rob Clark Date: Mon Apr 17 15:55:10 2023 -0700 drm/msm: Move cmdstream dumping out of sched kthread This is something that can block for arbitrary amounts of time as userspace consumes from the FIFO. So we don't really want this to be in the fence signaling path. Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/532617/ commit 38e27a6fbf2206b18417c5985dbcdeca0f2026b8 Author: Dmitry Baryshkov Date: Mon Apr 10 21:52:26 2023 +0300 drm/msm/a6xx: don't set IO_PGTABLE_QUIRK_ARM_OUTER_WBWA with coherent SMMU If the Adreno SMMU is dma-coherent, allocation will fail unless we disable IO_PGTABLE_QUIRK_ARM_OUTER_WBWA. Skip setting this quirk for the coherent SMMUs (like we have on sm8350 platform). Fixes: 54af0ceb7595 ("arm64: dts: qcom: sm8350: add GPU, GMU, GPU CC and SMMU nodes") Reported-by: David Heidelberg Signed-off-by: Dmitry Baryshkov Tested-by: David Heidelberg Reviewed-by: Konrad Dybcio Tested-by: Konrad Dybcio # SM8450 HDK Patchwork: https://patchwork.freedesktop.org/patch/531562/ Signed-off-by: Rob Clark commit 635455260d06b5189bdf9b400d591fabd9ef90b2 Author: Dmitry Baryshkov Date: Wed Mar 29 03:55:29 2023 +0300 drm/msm: drop unused ring variable in msm_ioctl_gem_submit() The variable ring is not used by msm_parse_deps() and msm_ioctl_gem_submit() and thus can be dropped. Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/529340/ Signed-off-by: Rob Clark commit a52b66172927a2a7b861b34c908850d76bc33024 Author: Dmitry Baryshkov Date: Tue Apr 11 01:40:34 2023 +0300 drm/msm/adreno: fix sparse warnings in a6xx code Sparse reports plenty of warnings against the a6xx code because of a6xx_gmu::mmio and a6xx_gmu::rscc members. For some reason they were defined as __iomem pointers rather than pointers to __iomem memory. Correct the __iomem attribute. Fixes: 02ef80c54e7c ("drm/msm/a6xx: update pdc/rscc GMU registers for A640/A650") Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304070550.NrbhJCvP-lkp@intel.com/ Reviewed-by: Javier Martinez Canillas Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/531583/ Signed-off-by: Rob Clark commit 94da3da96c35744001adfdb65e501e633a64cb51 Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:40 2023 +0200 dt-bindings: extcon: wlf,arizona: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 1400725e45152a62fa43f8275e6bee99d584c967 Merge: 7f1ed4659bad2 0ebee0a6f73e7 Author: Georgi Djakov Date: Sat Jun 10 10:43:50 2023 +0300 Merge branch 'icc-qos' into icc-next * icc-qos interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks interconnect: qcom: rpm: Rename icc provider num_clocks to num_bus_clocks interconnect: qcom: rpm: Drop unused parameters interconnect: qcom: rpm: Set QoS registers only once interconnect: qcom: rpm: Handle interface clocks interconnect: qcom: icc-rpm: Enforce 2 or 0 bus clocks interconnect: qcom: rpm: Don't use clk_get_optional for bus clocks anymore interconnect: qcom: msm8996: Promote to core_initcall interconnect: qcom: rpm: allocate enough data in probe() Link: https://lore.kernel.org/r/20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org Signed-off-by: Georgi Djakov commit 7f1ed4659bad2dbb0627e0df8933b1cd651e0137 Merge: 4396f5fc6d032 a1f7e72178475 Author: Georgi Djakov Date: Sat Jun 10 10:43:20 2023 +0300 Merge branch 'icc-cbf' into icc-next On MSM8996 two CPU clusters are interconnected using the Core Bus Fabric (CBF). In order for the CPU clusters to function properly, it should be clocked following the core's frequencies to provide adequate bandwidth. Register CBF as a clock (required for CPU to boot) and add a tiny interconnect layer on top of it to let cpufreq/opp scale the CBF clock. * icc-cbf dt-bindings: interconnect/msm8996-cbf: add defines to be used by CBF interconnect: add clk-based icc provider support clk: qcom: cbf-msm8996: scale CBF clock according to the CPUfreq interconnect: icc-clk: fix modular build Link: https://lore.kernel.org/r/20230512001334.2983048-1-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov commit dd203fefd9c9e28bc141d144e032e263804c90bb Author: Johannes Berg Date: Fri Jun 9 10:46:42 2023 +0200 kbuild: enable kernel-doc -Wall for W=2 For W=2, we can enable more kernel-doc warnings, such as missing return value descriptions etc. Signed-off-by: Johannes Berg Signed-off-by: Masahiro Yamada commit 56b0f453db74207633019f83758b4c11c66b75d0 Author: Johannes Berg Date: Fri Jun 9 10:46:41 2023 +0200 kernel-doc: don't let V=1 change outcome The kernel-doc script currently reports a number of issues only in "verbose" mode, but that's initialized from V=1 (via KBUILD_VERBOSE), so if you use KDOC_WERROR=1 then adding V=1 might actually break the build. This is rather unexpected. Change kernel-doc to not change its behaviour wrt. errors (or warnings) when verbose mode is enabled, but rather add separate warning flags (and -Wall) for it. Allow enabling those flags via environment/make variables in the kernel's build system for easier user use, but to not have to parse them in the script itself. Signed-off-by: Johannes Berg Acked-by: Jonathan Corbet Signed-off-by: Masahiro Yamada commit 4396f5fc6d032388012a4772278975210398f525 Author: Krzysztof Kozlowski Date: Fri Jun 9 16:07:32 2023 +0200 dt-bindings: interconnect: fsl,imx8m-noc: drop unneeded quotes Cleanup bindings dropping unneeded quotes. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230609140732.64828-1-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov commit a1f7e72178475e0e0d90cd89ef7457b6c69c50ec Author: Dmitry Baryshkov Date: Sat May 20 02:01:22 2023 +0300 interconnect: icc-clk: fix modular build Fix building interconnect-clk as a module: - Add EXPORT_SYMBOL_GPL to the exported functions - Add MODULE_DESCRIPTION/_LICENSE/_AUTHOR Reported-by: Nick Desaulniers Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230519230122.3958816-1-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov commit 12dc71953e664f084918d3e1b63b211b0e6f8e98 Author: Dmitry Baryshkov Date: Fri May 12 03:13:33 2023 +0300 clk: qcom: cbf-msm8996: scale CBF clock according to the CPUfreq Turn CBF into the interconnect provider. Scale CBF frequency (bandwidth) according to CPU frequencies. Reviewed-by: Konrad Dybcio Tested-by: Yassine Oudjana Signed-off-by: Dmitry Baryshkov Acked-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230512001334.2983048-4-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov commit e431e712c83676a8a9cd3988b323e3ef994a8ff3 Merge: d457a0e329b0b a1e82162af0b8 Author: Jakub Kicinski Date: Sat Jun 10 00:11:51 2023 -0700 Merge branch 'sfc-tc-encap-actions-offload' Edward Cree says: ==================== sfc: TC encap actions offload This series adds support for offloading TC tunnel_key set actions to the EF100 driver, supporting VxLAN and GENEVE tunnels over IPv4 or IPv6. ==================== Link: https://lore.kernel.org/r/cover.1686240142.git.ecree.xilinx@gmail.com Signed-off-by: Jakub Kicinski commit a1e82162af0b8ae9e65320ca405c6327edb99648 Author: Edward Cree Date: Thu Jun 8 17:42:35 2023 +0100 sfc: generate encap headers for TC offload Support constructing VxLAN and GENEVE headers, on either IPv4 or IPv6, using the neighbouring information obtained in encap->neigh to populate the Ethernet header. Note that the ef100 hardware does not insert UDP checksums when performing encap, so for IPv6 the remote endpoint will need to be configured with udp6zerocsumrx or equivalent. Signed-off-by: Edward Cree Reviewed-by: Simon Horman Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Jakub Kicinski commit 7e5e7d800011adf4aeda615f8a1bc31c0c1e2bb9 Author: Edward Cree Date: Thu Jun 8 17:42:34 2023 +0100 sfc: neighbour lookup for TC encap action offload For each neighbour we're interested in, create a struct efx_neigh_binder object which has a list of all the encap_actions using it. When we receive a neighbouring update (through the netevent notifier), find the corresponding efx_neigh_binder and update all its users. Since the actual generation of encap headers is still only a stub, the resulting rules still get left on fallback actions. Signed-off-by: Edward Cree Reviewed-by: Simon Horman Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Jakub Kicinski commit f1363154c47468725611f264fc2e50833800dc3b Author: Edward Cree Date: Thu Jun 8 17:42:33 2023 +0100 sfc: MAE functions to create/update/delete encap headers Besides the raw header data, also pass the tunnel type, so that the hardware knows it needs to update the IP Total Length and UDP Length fields (and corresponding checksums) for each packet. Also, populate the ENCAP_HEADER_ID field in efx_mae_alloc_action_set() with the fw_id returned from efx_mae_allocate_encap_md(). Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Reviewed-by: Simon Horman Signed-off-by: Jakub Kicinski commit 69819d3bc4086dd5a268600d1cbd65c39eda1672 Author: Edward Cree Date: Thu Jun 8 17:42:32 2023 +0100 sfc: add function to atomically update a rule in the MAE efx_mae_update_rule() changes the action-set-list attached to an MAE flow rule in the Action Rule Table. We will use this when neighbouring updates change encap actions. Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Reviewed-by: Simon Horman Signed-off-by: Jakub Kicinski commit b4da4235dc69427fbdb66c9fbdf094ac76cdf745 Author: Edward Cree Date: Thu Jun 8 17:42:31 2023 +0100 sfc: some plumbing towards TC encap action offload Create software objects to manage the metadata for encap actions that can be attached to TC rules. However, since we don't yet have the neighbouring information (needed to generate the Ethernet header), all rules with encap actions are marked as "unready" and thus insert the fallback action into hardware rather than actually offloading the encapsulation action. Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Reviewed-by: Simon Horman Signed-off-by: Jakub Kicinski commit e16ca7fb9ffb0d51ddf01e450a1043ea65b5be3f Author: Edward Cree Date: Thu Jun 8 17:42:30 2023 +0100 sfc: add fallback action-set-lists for TC offload When offloading a TC encap action, the action information for the hardware might not be "ready": if there's currently no neighbour entry available for the destination address, we can't construct the Ethernet header to prepend to the packet. In this case, we still offload the flow rule, but with its action-set-list ID pointing at a "fallback" action which simply delivers the packet to its default destination (as though no flow rule had matched), thus allowing software TC to handle it. Later, when we receive a neighbouring update that allows us to construct the encap header, the rule will become "ready" and we will update its action-set-list ID in hardware to point at the actual offloaded actions. This patch sets up these fallback ASLs, but does not yet use them. Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Reviewed-by: Simon Horman Signed-off-by: Jakub Kicinski commit d457a0e329b0bfd3a1450e0b1a18cd2b47a25a08 Author: Eric Dumazet Date: Thu Jun 8 19:17:37 2023 +0000 net: move gso declarations and functions to their own files Move declarations into include/net/gso.h and code into net/core/gso.c Signed-off-by: Eric Dumazet Cc: Stanislav Fomichev Reviewed-by: Simon Horman Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20230608191738.3947077-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit cabb8b48e542e1401f6881c4f7d3bb82f723ee40 Merge: cde11936cffb7 6ba7ce89905c5 Author: Jakub Kicinski Date: Sat Jun 10 00:06:01 2023 -0700 Merge branch 'mptcp-unify-pm-interfaces' Matthieu Baerts says: ==================== mptcp: unify PM interfaces These patches from Geliang better isolate the two MPTCP path-managers by avoiding calling userspace PM functions from the in-kernel PM. Instead, new functions declared in pm.c directly dispatch to the right PM. In addition to have a clearer code, this also avoids a bit of duplicated checks. This is a refactoring, there is no behaviour change intended here. ==================== Link: https://lore.kernel.org/r/20230608-upstream-net-next-20230608-mptcp-unify-pm-interfaces-v1-0-b301717c9ff5@tessares.net Signed-off-by: Jakub Kicinski commit 6ba7ce89905c5d5cdb4ff9ff7c763a6a1d31f48d Author: Geliang Tang Date: Thu Jun 8 15:20:52 2023 +0200 mptcp: unify pm set_flags interfaces This patch unifies the three PM set_flags() interfaces: mptcp_pm_nl_set_flags() in mptcp/pm_netlink.c for the in-kernel PM and mptcp_userspace_pm_set_flags() in mptcp/pm_userspace.c for the userspace PM. They'll be switched in the common PM infterface mptcp_pm_set_flags() in mptcp/pm.c based on whether token is NULL or not. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Reviewed-by: Larysa Zaremba Signed-off-by: Jakub Kicinski commit f40be0db0b7680c2e9f0b1289788542813ba0f00 Author: Geliang Tang Date: Thu Jun 8 15:20:51 2023 +0200 mptcp: unify pm get_flags_and_ifindex_by_id This patch unifies the three PM get_flags_and_ifindex_by_id() interfaces: mptcp_pm_nl_get_flags_and_ifindex_by_id() in mptcp/pm_netlink.c for the in-kernel PM and mptcp_userspace_pm_get_flags_and_ifindex_by_id() in mptcp/pm_userspace.c for the userspace PM. They'll be switched in the common PM infterface mptcp_pm_get_flags_and_ifindex_by_id() in mptcp/pm.c based on whether mptcp_pm_is_userspace() or not. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Reviewed-by: Larysa Zaremba Signed-off-by: Jakub Kicinski commit 9bbec87ecfe8a5c06710100a93e6b7e66f2cbbaf Author: Geliang Tang Date: Thu Jun 8 15:20:50 2023 +0200 mptcp: unify pm get_local_id interfaces This patch unifies the three PM get_local_id() interfaces: mptcp_pm_nl_get_local_id() in mptcp/pm_netlink.c for the in-kernel PM and mptcp_userspace_pm_get_local_id() in mptcp/pm_userspace.c for the userspace PM. They'll be switched in the common PM infterface mptcp_pm_get_local_id() in mptcp/pm.c based on whether mptcp_pm_is_userspace() or not. Also put together the declarations of these three functions in protocol.h. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Reviewed-by: Larysa Zaremba Signed-off-by: Jakub Kicinski commit dc886bce753cc2cf3c88ec5c7a6880a4e17d65ba Author: Geliang Tang Date: Thu Jun 8 15:20:49 2023 +0200 mptcp: export local_address Rename local_address() with "mptcp_" prefix and export it in protocol.h. This function will be re-used in the common PM code (pm.c) in the following commit. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Reviewed-by: Larysa Zaremba Signed-off-by: Jakub Kicinski commit 69f06e4fa098420e94f6970332e84f0ed493271c Merge: 0976b3dc021b2 ba57b9b11f785 Author: Jani Nikula Date: Sat Jun 10 10:04:00 2023 +0300 Merge drm/drm-next into drm-intel-next Sync up with changes from drm-intel-gt-next. Signed-off-by: Jani Nikula commit cde11936cffb7280eb48b5e118ea8f5a03aad0ae Merge: ded5c1a16ec69 fef0f427f7122 Author: Jakub Kicinski Date: Fri Jun 9 23:26:55 2023 -0700 Merge tag 'wireless-next-2023-06-09' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle Valo says: ==================== wireless-next patches for v6.5 The second pull request for v6.5. We have support for three new Realtek chipsets, all from different generations. Shows how active Realtek development is right now, even older generations are being worked on. Note: We merged wireless into wireless-next to avoid complex conflicts between the trees. Major changes: rtl8xxxu - RTL8192FU support rtw89 - RTL8851BE support rtw88 - RTL8723DS support ath11k - Multiple Basic Service Set Identifier (MBSSID) and Enhanced MBSSID Advertisement (EMA) support in AP mode iwlwifi - support for segmented PNVM images and power tables - new vendor entries for PPAG (platform antenna gain) feature cfg80211/mac80211 - more Multi-Link Operation (MLO) support such as hardware restart - fixes for a potential work/mutex deadlock and with it beginnings of the previously discussed locking simplifications * tag 'wireless-next-2023-06-09' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (162 commits) wifi: rtlwifi: remove misused flag from HAL data wifi: rtlwifi: remove unused dualmac control leftovers wifi: rtlwifi: remove unused timer and related code wifi: rsi: Do not set MMC_PM_KEEP_POWER in shutdown wifi: rsi: Do not configure WoWlan in shutdown hook if not enabled wifi: brcmfmac: Detect corner error case earlier with log wifi: rtw89: 8852c: update RF radio A/B parameters to R63 wifi: rtw89: 8852c: update TX power tables to R63 with 6 GHz power type (3 of 3) wifi: rtw89: 8852c: update TX power tables to R63 with 6 GHz power type (2 of 3) wifi: rtw89: 8852c: update TX power tables to R63 with 6 GHz power type (1 of 3) wifi: rtw89: process regulatory for 6 GHz power type wifi: rtw89: regd: update regulatory map to R64-R40 wifi: rtw89: regd: judge 6 GHz according to chip and BIOS wifi: rtw89: refine clearing supported bands to check 2/5 GHz first wifi: rtw89: 8851b: configure CRASH_TRIGGER feature for 8851B wifi: rtw89: set TX power without precondition during setting channel wifi: rtw89: debug: txpwr table access only valid page according to chip wifi: rtw89: 8851b: enable hw_scan support wifi: cfg80211: move scan done work to wiphy work wifi: cfg80211: move sched scan stop to wiphy work ... ==================== Link: https://lore.kernel.org/r/87bkhohkbg.fsf@kernel.org Signed-off-by: Jakub Kicinski commit 0976b3dc021b2c5392d6abf443460e4208f85fe6 Author: Luca Coelho Date: Thu Jun 8 16:35:46 2023 +0300 drm/i915/selftests: add local workqueue for SW fence selftest Instead of using a global workqueue for the SW fence selftest, allocate a separate one temporarily only while running the test. Cc: Tetsuo Handa Cc: Jani Nikula Cc: Ville Syrjälä Reviewed-by: Tvrtko Ursulin Signed-off-by: Luca Coelho Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/313f4a713053c2b4896ced5b0e9ff456eb85fe57.1686231190.git.jani.nikula@intel.com commit 848a4e5c096ddf8ed1323123ae15b8d4318700ab Author: Luca Coelho Date: Thu Jun 8 16:35:45 2023 +0300 drm/i915: add a dedicated workqueue inside drm_i915_private In order to avoid flush_scheduled_work() usage, add a dedicated workqueue in the drm_i915_private structure. In this way, we don't need to use the system queue anymore. This change is mostly mechanical and based on Tetsuo's original patch[1]. v6 by Jani: - Also create unordered_wq for mock device Link: https://patchwork.freedesktop.org/series/114608/ [1] Cc: Tetsuo Handa Cc: Tvrtko Ursulin Cc: Jani Nikula Cc: Ville Syrjälä Reviewed-by: Jani Nikula Reviewed-by: Tvrtko Ursulin Signed-off-by: Luca Coelho Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/c816ebe17ef08d363981942a096a586a7658a65e.1686231190.git.jani.nikula@intel.com commit 8d208a5eed4890f52a33ce847cbb8f8a5b1be6a7 Author: Luca Coelho Date: Thu Jun 8 16:35:44 2023 +0300 drm/i915: use pointer to i915 instead of rpm in wakeref Currently a pointer to an intel_runtime_pm structure is stored in the wake reference structures so the runtime data can be accessed. We can save the entire device information (drm_i915_private) instead, since we'll need to reference the new workqueue we'll add in subsequent patches. Reviewed-by: Tvrtko Ursulin Signed-off-by: Luca Coelho Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/ec0eb5149120d04f3d9870d7671ef10103e6fc29.1686231190.git.jani.nikula@intel.com commit 978015f7ef9240acfb078f4c1c0d79459b42f951 Author: Christophe JAILLET Date: Mon May 29 10:34:59 2023 +0200 net/mlx5e: Remove a useless function call 'handle' is known to be NULL here. There is no need to kfree() it. Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit e71383fb9cd15a28d6c01d2c165a96f1c0bcf418 Author: Shay Drory Date: Wed May 3 14:18:23 2023 +0300 net/mlx5: Light probe local SFs In case user wants to configure the SFs, for example: to use only vdpa functionality, he needs to fully probe a SF, configure what he wants, and afterward reload the SF. In order to save the time of the reload, local SFs will probe without any auxiliary sub-device, so that the SFs can be configured prior to its full probe. The defaults of the enable_* devlink params of these SFs are set to false. Usage example: Create SF: $ devlink port add pci/0000:08:00.0 flavour pcisf pfnum 0 sfnum 11 $ devlink port function set pci/0000:08:00.0/32768 \ hw_addr 00:00:00:00:00:11 state active Enable ETH auxiliary device: $ devlink dev param set auxiliary/mlx5_core.sf.1 \ name enable_eth value true cmode driverinit Now, in order to fully probe the SF, use devlink reload: $ devlink dev reload auxiliary/mlx5_core.sf.1 At this point the user have SF devlink instance with auxiliary device for the Ethernet functionality only. Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 3f90840305e2b240749aec7dde23f5262e513641 Author: Shay Drory Date: Wed May 17 17:39:54 2023 +0300 net/mlx5: Move esw multiport devlink param to eswitch code Move the param registration and handling code into the eswitch code as they are related to each other. No point in having the devlink param registration done in separate file. Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 2059cf51f318681a4cdd3eb1a01a2d62b6a9c442 Author: Shay Drory Date: Wed May 3 12:08:48 2023 +0300 net/mlx5: Split function_setup() to enable and open functions mlx5_cmd_init_hca() is taking ~0.2 seconds. In case of a user who desire to disable some of the SF aux devices, and with large scale-1K SFs for example, this user will waste more than 3 minutes on mlx5_cmd_init_hca() which isn't needed at this stage. Downstream patch will change SFs which are probe over the E-switch, local SFs, to be probed without any aux dev. In order to support this, split function_setup() to avoid executing mlx5_cmd_init_hca(). Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 7057fe561988effa0b044b99262bb3712a5892c0 Author: Daniel Jurgens Date: Wed Mar 15 17:29:13 2023 +0200 net/mlx5: Set max number of embedded CPU VFs Set the maximum number of embedded cpu VF functions available. Signed-off-by: Daniel Jurgens Signed-off-by: Saeed Mahameed commit 6d98f314bfca10cebf66e42573c4b362ed2ee17c Author: Daniel Jurgens Date: Tue Mar 7 18:52:29 2023 +0200 net/mlx5: Update SRIOV enable/disable to handle EC/VFs Previously on the embedded CPU platform SRIOV was never enabled/disabled via mlx5_core_sriov_configure. Host VF updates are provided by an event handler. Now in the disable flow it must be known if this is a disable due to driver unload or SRIOV detach, or if the user updated the number of VFs. If due to change in the number of VFs only wait for the pages of ECVFs. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Signed-off-by: Saeed Mahameed commit 42a84a430931afe2ccf31a6910dec86e87de5d2a Author: Daniel Jurgens Date: Tue Mar 7 19:13:43 2023 +0200 net/mlx5: Query correct caps for min msix vectors The VFs on the host and the embedded CPU platform share function numbers. Set the ec_vf_function field to query the caps for the correct function. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Signed-off-by: Saeed Mahameed commit 2ee3db806e851b9f3bfc46a1004a1ccee180b0a8 Author: Daniel Jurgens Date: Tue Mar 7 19:06:58 2023 +0200 net/mlx5: Use correct vport when restoring GUIDs Prior to enabling EC VF functionality the vport number and function ID were always the same. That's not the case now. Use the correct vport number to modify the HCA vport context. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Signed-off-by: Saeed Mahameed commit 395ccd6eb49a12b021ac5deaa56e6b0b8f93241b Author: Daniel Jurgens Date: Tue Mar 7 00:53:21 2023 +0200 net/mlx5: Add new page type for EC VF pages When the embedded cpu supports SRIOV it can be enabled and disabled independently from the host SRIOV. Track the pages separately so we can properly wait for returned VF pages. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Signed-off-by: Saeed Mahameed commit fa3c73eee641cf76bc232373303aa51a1cad8b8e Author: Daniel Jurgens Date: Tue Mar 7 21:36:39 2023 +0200 net/mlx5: Add/remove peer miss rules for EC VFs Add and remove the peer miss rules for EC VFs. It's possible that there are different amounts of total VFs per function so only create rules for the minimum number of max VFs. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit a7719b29a82199b90ebbf355d3332e0fbfbf6045 Author: Daniel Jurgens Date: Tue Mar 7 21:24:55 2023 +0200 net/mlx5: Add management of EC VF vports Add init, load, unload, and cleanup of the EC VF vports. This includes changes in how eswitch SRIOV is managed. Previous on an embedded CPU platform the number of VFs provided when enabling the eswitch was always 0, host VFs vports are handled in the eswitch functions change event handler. Now track the number of EC VFs as well, so they can be handled properly in the enable/disable flows. There are only 3 marks available for use in xarrays, all 3 were already in use for this use case. EC VF vports are in a known range so we can access them by index instead of marks. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Signed-off-by: Saeed Mahameed commit 9ac0b128248e19d06475f4592fe87f6ce18bc554 Author: Daniel Jurgens Date: Tue Mar 7 19:51:22 2023 +0200 net/mlx5: Update vport caps query/set for EC VFs These functions are for query/set by vport, there was an underlying assumption that vport was equal to function ID. That's not the case for EC VF functions. Set the ec_vf_function bit accordingly. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Signed-off-by: Saeed Mahameed commit dc13180824b78e1e4e7ae1ce22160ae8e5fb858e Author: Daniel Jurgens Date: Tue Mar 7 19:36:14 2023 +0200 net/mlx5: Enable devlink port for embedded cpu VF vports Enable creation of a devlink port for EC VF vports. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Signed-off-by: Saeed Mahameed commit 93b36d0f2892357906f1058778c9188ff857baa1 Author: Daniel Jurgens Date: Tue Mar 7 00:27:21 2023 +0200 net/mlx5: mlx5_ifc updates for embedded CPU SRIOV Add ec_vf_vport_base to HCA Capabilities 2. This indicates the base vport of embedded CPU virtual functions that are connected to the eswitch. Add ec_vf_function to query/set_hca_caps. If set this indicates accessing a virtual function on the embedded CPU by function ID. This should only be used with other_function set to 1. Signed-off-by: Daniel Jurgens Reviewed-by: Bodong Wang Reviewed-by: William Tu Signed-off-by: Saeed Mahameed commit 18a92b05425493c3d131c47689443d7ae860c986 Author: Daniel Jurgens Date: Wed Mar 8 00:02:12 2023 +0200 net/mlx5: Simplify unload all rep code Instead of using type specific iterators which are only used in one place just traverse the xarray. It will provide suitable ordering based on the vport numbers. This will also eliminate the need for changes here when new types are added. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 712c76b360aa3d2a99c9597f2fba9ee117a303f6 Merge: 12abd735f0300 5ff3d3a0a09ec e7a2cf8e058e2 76015b9e573ee 1531d0b9235e5 eed3f9c7c36a2 Author: Dmitry Baryshkov Date: Sat Jun 10 03:56:52 2023 +0300 Merge branches 'msm-next-lumag-core', 'msm-next-lumag-dpu', 'msm-next-lumag-dp', 'msm-next-lumag-dsi' and 'msm-next-lumag-mdp5' into msm-next-lumag Core: - Add Marijn Suijten as drm/msm reviewer - Adreno A660 bindings - SM8350 MDSS bindings fix DP: - Removed obsolete USB-PD remains - Documented DP compatible string for sm8550 platform DPU: - Added support for DPU on sm6350 and sm6375 platforms - Implemented tearcheck support to support vsync on SM150 and newer platforms - Enabled missing features (DSPP, DSC, split display) on sc8180x, sc8280xp, sm8450 - Enabled writeback on sc7280 - Enabled DSC on msm8998 - Native HDMI output support - Dropped unused features: regdma, GC, IGC - Fixed the DSC flush operations - Simplified QoS handling, removing obsolete and unused features and merging SSPP and WB code paths - Reworked dpu_encoder initialisation path DSI: - Added support for DSI and 28nm DSI PHY on MSM8226 platform - Added support for DSI on sm6350 and sm6375 platforms - Dropped powerup quirks in favour of using pre_enable_prev_first for downstream bridges - Fixed 14nm DSI PHY programming MDP5: - Added support for display controller on MSM8226 platform Signed-off-by: Dmitry Baryshkov commit a94181ec064b3ad1b6f573f5953e2011f8c90292 Author: Arnd Bergmann Date: Wed Jun 7 16:28:45 2023 +0200 syscalls: add sys_ni_posix_timers prototype The sys_ni_posix_timers() definition causes a warning when the declaration is missing, so this needs to be added along with the normal syscalls, outside of the #ifdef. kernel/time/posix-stubs.c:26:17: error: no previous prototype for 'sys_ni_posix_timers' [-Werror=missing-prototypes] Link: https://lkml.kernel.org/r/20230607142925.3126422-1-arnd@kernel.org Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Signed-off-by: Andrew Morton commit f26799ffd6c7871aa0a1b8eeff2bd28258368cdb Author: Kees Cook Date: Thu Jun 1 09:07:46 2023 -0700 checkpatch: check for 0-length and 1-element arrays Fake flexible arrays have been deprecated since last millennium. Proper C99 flexible arrays must be used throughout the kernel so CONFIG_FORTIFY_SOURCE and CONFIG_UBSAN_BOUNDS can provide proper array bounds checking. [joe@perches.com: various suggestions] Link: https://lkml.kernel.org/r/20230601160746.up.948-kees@kernel.org Link: https://lore.kernel.org/r/20230517204530.never.151-kees@kernel.org Signed-off-by: Kees Cook Acked-by: Gustavo A. R. Silva Acked-by: Joe Perches Cc: Andy Whitcroft Cc: Dwaipayan Ray Cc: Lukas Bulwahn Signed-off-by: Andrew Morton commit 16c6006af4d4e70ecef93977a5314409d931020b Author: Zhen Lei Date: Sat May 27 20:34:39 2023 +0800 kexec: enable kexec_crash_size to support two crash kernel regions The crashk_low_res should be considered by /sys/kernel/kexec_crash_size to support two crash kernel regions shrinking if existing. While doing it, crashk_low_res will only be shrunk when the entire crashk_res is empty; and if the crashk_res is empty and crahk_low_res is not, change crashk_low_res to be crashk_res. [bhe@redhat.com: redo changelog] Link: https://lkml.kernel.org/r/20230527123439.772-7-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Acked-by: Baoquan He Cc: Cong Wang Cc: Eric W. Biederman Cc: Michael Holzheu Signed-off-by: Andrew Morton commit 5b7bfb32cbaad6ba997ab4295ee50bc9921252f2 Author: Zhen Lei Date: Sat May 27 20:34:38 2023 +0800 kexec: add helper __crash_shrink_memory() No functional change, in preparation for the next patch so that it is easier to review. [akpm@linux-foundation.org: make __crash_shrink_memory() static] Link: https://lore.kernel.org/oe-kbuild-all/202305280717.Pw06aLkz-lkp@intel.com/ Link: https://lkml.kernel.org/r/20230527123439.772-6-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Acked-by: Baoquan He Cc: Cong Wang Cc: Eric W. Biederman Cc: Michael Holzheu Signed-off-by: Andrew Morton commit 8a7db7790a3ff8413bedef886cf135ba301e88d7 Author: Zhen Lei Date: Sat May 27 20:34:37 2023 +0800 kexec: improve the readability of crash_shrink_memory() The major adjustments are: 1. end = start + new_size. The 'end' here is not an accurate representation, because it is not the new end of crashk_res, but the start of ram_res, difference 1. So eliminate it and replace it with ram_res->start. 2. Use 'ram_res->start' and 'ram_res->end' as arguments to crash_free_reserved_phys_range() to indicate that the memory covered by 'ram_res' is released from the crashk. And keep it close to insert_resource(). 3. Replace 'if (start == end)' with 'if (!new_size)', clear indication that all crashk memory will be shrunken. No functional change. Link: https://lkml.kernel.org/r/20230527123439.772-5-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Acked-by: Baoquan He Cc: Cong Wang Cc: Eric W. Biederman Cc: Michael Holzheu Signed-off-by: Andrew Morton commit f7f567b95b12eda7a6a273b8cb82d152491bc0da Author: Zhen Lei Date: Sat May 27 20:34:36 2023 +0800 kexec: clear crashk_res if all its memory has been released If the resource of crashk_res has been released, it is better to clear crashk_res.start and crashk_res.end. Because 'end = start - 1' is not reasonable, and in some places the test is based on crashk_res.end, not resource_size(&crashk_res). Link: https://lkml.kernel.org/r/20230527123439.772-4-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Acked-by: Baoquan He Cc: Cong Wang Cc: Eric W. Biederman Cc: Michael Holzheu Signed-off-by: Andrew Morton commit 6f22a744f4ee7a22be4704cf93bbe22decc7e79e Author: Zhen Lei Date: Sat May 27 20:34:35 2023 +0800 kexec: delete a useless check in crash_shrink_memory() The check '(crashk_res.parent != NULL)' is added by commit e05bd3367bd3 ("kexec: fix Oops in crash_shrink_memory()"), but it's stale now. Because if 'crashk_res' is not reserved, it will be zero in size and will be intercepted by the above 'if (new_size >= old_size)'. Ago: if (new_size >= end - start + 1) Now: old_size = (end == 0) ? 0 : end - start + 1; if (new_size >= old_size) Link: https://lkml.kernel.org/r/20230527123439.772-3-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Cc: Baoquan He Cc: Cong Wang Cc: Eric W. Biederman Cc: Michael Holzheu Signed-off-by: Andrew Morton commit 1cba6c4309f03de570202c46f03df3f73a0d4c82 Author: Zhen Lei Date: Sat May 27 20:34:34 2023 +0800 kexec: fix a memory leak in crash_shrink_memory() Patch series "kexec: enable kexec_crash_size to support two crash kernel regions". When crashkernel=X fails to reserve region under 4G, it will fall back to reserve region above 4G and a region of the default size will also be reserved under 4G. Unfortunately, /sys/kernel/kexec_crash_size only supports one crash kernel region now, the user cannot sense the low memory reserved by reading /sys/kernel/kexec_crash_size. Also, low memory cannot be freed by writing this file. For example: resource_size(crashk_res) = 512M resource_size(crashk_low_res) = 256M The result of 'cat /sys/kernel/kexec_crash_size' is 512M, but it should be 768M. When we execute 'echo 0 > /sys/kernel/kexec_crash_size', the size of crashk_res becomes 0 and resource_size(crashk_low_res) is still 256 MB, which is incorrect. Since crashk_res manages the memory with high address and crashk_low_res manages the memory with low address, crashk_low_res is shrunken only when all crashk_res is shrunken. And because when there is only one crash kernel region, crashk_res is always used. Therefore, if all crashk_res is shrunken and crashk_low_res still exists, swap them. This patch (of 6): If the value of parameter 'new_size' is in the semi-open and semi-closed interval (crashk_res.end - KEXEC_CRASH_MEM_ALIGN + 1, crashk_res.end], the calculation result of ram_res is: ram_res->start = crashk_res.end + 1 ram_res->end = crashk_res.end The operation of insert_resource() fails, and ram_res is not added to iomem_resource. As a result, the memory of the control block ram_res is leaked. In fact, on all architectures, the start address and size of crashk_res are already aligned by KEXEC_CRASH_MEM_ALIGN. Therefore, we do not need to round up crashk_res.start again. Instead, we should round up 'new_size' in advance. Link: https://lkml.kernel.org/r/20230527123439.772-1-thunder.leizhen@huawei.com Link: https://lkml.kernel.org/r/20230527123439.772-2-thunder.leizhen@huawei.com Fixes: 6480e5a09237 ("kdump: add missing RAM resource in crash_shrink_memory()") Fixes: 06a7f711246b ("kexec: premit reduction of the reserved memory size") Signed-off-by: Zhen Lei Acked-by: Baoquan He Cc: Cong Wang Cc: Eric W. Biederman Cc: Michael Holzheu Signed-off-by: Andrew Morton commit 69fe5c430ccd09a4c6e2d0b13d1164812983e2a1 Author: Joseph Qi Date: Sun May 28 21:20:33 2023 +0800 ocfs2: cleanup trace events After commit 6dc8bc0fb300 ("ocfs2: switch to iter_file_splice_write()"), ocfs2 has switched from ocfs2_file_splice_write() to iter_file_splice_write(), so cleanup the corresponding trace event as well. Link: https://lkml.kernel.org/r/20230528132033.217664-2-joseph.qi@linux.alibaba.com Signed-off-by: Joseph Qi Cc: Al Viro Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton commit d32840ad4a111c6abd651fbf6b5996e6123913da Author: Joseph Qi Date: Sun May 28 21:20:32 2023 +0800 ocfs2: correct return value of ocfs2_local_free_info() Now in ocfs2_local_free_info(), it returns 0 even if it actually fails. Though it doesn't cause any real problem since the only caller dquot_disable() ignores the return value, we'd better return correct as it is. Link: https://lkml.kernel.org/r/20230528132033.217664-1-joseph.qi@linux.alibaba.com Signed-off-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Joseph Qi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton commit 4df3504e2f17cb35d2c12b07e716ae37971d0d52 Author: Simon Horman Date: Thu May 25 16:26:25 2023 +0200 kexec: avoid calculating array size twice Avoid calculating array size twice in kexec_purgatory_setup_sechdrs(). Once using array_size(), and once open-coded. Flagged by Coccinelle: .../kexec_file.c:881:8-25: WARNING: array_size is already used (line 877) to compute the same size No functional change intended. Compile tested only. Link: https://lkml.kernel.org/r/20230525-kexec-array_size-v1-1-8b4bf4f7500a@kernel.org Signed-off-by: Simon Horman Acked-by: Baoquan He Cc: Eric W. Biederman Cc: Zhen Lei Signed-off-by: Andrew Morton commit 048a9883267f9b8f8e05dca9e9e8e6f991eea61e Author: Alexey Dobriyan Date: Sat May 20 21:25:19 2023 +0300 include/linux/math.h: fix mult_frac() multiple argument evaluation bug mult_frac() evaluates _all_ arguments multiple times in the body. Clarify comment while I'm at it. Link: https://lkml.kernel.org/r/f9f9fdbb-ec8e-4f5e-a998-2a58627a1a43@p183 Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton commit d7a0fe9ef6d6484fca4ba55c19091932337d4272 Author: Douglas Anderson Date: Fri May 19 10:18:42 2023 -0700 arm64: enable perf events based hard lockup detector With the recent feature added to enable perf events to use pseudo NMIs as interrupts on platforms which support GICv3 or later, its now been possible to enable hard lockup detector (or NMI watchdog) on arm64 platforms. So enable corresponding support. One thing to note here is that normally lockup detector is initialized just after the early initcalls but PMU on arm64 comes up much later as device_initcall(). To cope with that, override arch_perf_nmi_is_available() to let the watchdog framework know PMU not ready, and inform the framework to re-initialize lockup detection once PMU has been initialized. [dianders@chromium.org: only HAVE_HARDLOCKUP_DETECTOR_PERF if the PMU config is enabled] Link: https://lkml.kernel.org/r/20230523073952.1.I60217a63acc35621e13f10be16c0cd7c363caf8c@changeid Link: https://lkml.kernel.org/r/20230519101840.v5.18.Ia44852044cdcb074f387e80df6b45e892965d4a1@changeid Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg Co-developed-by: Pingfan Liu Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Signed-off-by: Douglas Anderson Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Petr Mladek Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 94946f9eaac116f2943ec79ec3df1ec2fc92ae07 Author: Lecopzer Chen Date: Fri May 19 10:18:41 2023 -0700 arm64: add hw_nmi_get_sample_period for preparation of lockup detector Set safe maximum CPU frequency to 5 GHz in case a particular platform doesn't implement cpufreq driver. Although, architecture doesn't put any restrictions on maximum frequency but 5 GHz seems to be safe maximum given the available Arm CPUs in the market which are clocked much less than 5 GHz. On the other hand, we can't make it much higher as it would lead to a large hard-lockup detection timeout on parts which are running slower (eg. 1GHz on Developerbox) and doesn't possess a cpufreq driver. Link: https://lkml.kernel.org/r/20230519101840.v5.17.Ia9d02578e89c3f44d3cb12eec8b0176603c8ab2f@changeid Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg Co-developed-by: Pingfan Liu Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Signed-off-by: Douglas Anderson Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Petr Mladek Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 930d8f8dbab97cb05dba30e67a2dfa0c6dbf4bc7 Author: Lecopzer Chen Date: Fri May 19 10:18:40 2023 -0700 watchdog/perf: adapt the watchdog_perf interface for async model When lockup_detector_init()->watchdog_hardlockup_probe(), PMU may be not ready yet. E.g. on arm64, PMU is not ready until device_initcall(armv8_pmu_driver_init). And it is deeply integrated with the driver model and cpuhp. Hence it is hard to push this initialization before smp_init(). But it is easy to take an opposite approach and try to initialize the watchdog once again later. The delayed probe is called using workqueues. It need to allocate memory and must be proceed in a normal context. The delayed probe is able to use if watchdog_hardlockup_probe() returns non-zero which means the return code returned when PMU is not ready yet. Provide an API - lockup_detector_retry_init() for anyone who needs to delayed init lockup detector if they had ever failed at lockup_detector_init(). The original assumption is: nobody should use delayed probe after lockup_detector_check() which has __init attribute. That is, anyone uses this API must call between lockup_detector_init() and lockup_detector_check(), and the caller must have __init attribute Link: https://lkml.kernel.org/r/20230519101840.v5.16.If4ad5dd5d09fb1309cebf8bcead4b6a5a7758ca7@changeid Reviewed-by: Petr Mladek Co-developed-by: Pingfan Liu Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Signed-off-by: Douglas Anderson Suggested-by: Petr Mladek Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit b17aa959330e8058452297049a0056ba4b9c72e8 Author: Douglas Anderson Date: Fri May 19 10:18:39 2023 -0700 watchdog/perf: add a weak function for an arch to detect if perf can use NMIs On arm64, NMI support needs to be detected at runtime. Add a weak function to the perf hardlockup detector so that an architecture can implement it to detect whether NMIs are available. Link: https://lkml.kernel.org/r/20230519101840.v5.15.Ic55cb6f90ef5967d8aaa2b503a4e67c753f64d3a@changeid Signed-off-by: Douglas Anderson Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Lecopzer Chen Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Petr Mladek Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 1f423c905a6b43b493df1b259e6e6267e5624e62 Author: Douglas Anderson Date: Fri May 19 10:18:38 2023 -0700 watchdog/hardlockup: detect hard lockups using secondary (buddy) CPUs Implement a hardlockup detector that doesn't doesn't need any extra arch-specific support code to detect lockups. Instead of using something arch-specific we will use the buddy system, where each CPU watches out for another one. Specifically, each CPU will use its softlockup hrtimer to check that the next CPU is processing hrtimer interrupts by verifying that a counter is increasing. NOTE: unlike the other hard lockup detectors, the buddy one can't easily show what's happening on the CPU that locked up just by doing a simple backtrace. It relies on some other mechanism in the system to get information about the locked up CPUs. This could be support for NMI backtraces like [1], it could be a mechanism for printing the PC of locked CPUs at panic time like [2] / [3], or it could be something else. Even though that means we still rely on arch-specific code, this arch-specific code seems to often be implemented even on architectures that don't have a hardlockup detector. This style of hardlockup detector originated in some downstream Android trees and has been rebased on / carried in ChromeOS trees for quite a long time for use on arm and arm64 boards. Historically on these boards we've leveraged mechanism [2] / [3] to get information about hung CPUs, but we could move to [1]. Although the original motivation for the buddy system was for use on systems without an arch-specific hardlockup detector, it can still be useful to use even on systems that _do_ have an arch-specific hardlockup detector. On x86, for instance, there is a 24-part patch series [4] in progress switching the arch-specific hard lockup detector from a scarce perf counter to a less-scarce hardware resource. Potentially the buddy system could be a simpler alternative to free up the perf counter but still get hard lockup detection. Overall, pros (+) and cons (-) of the buddy system compared to an arch-specific hardlockup detector (which might be implemented using perf): + The buddy system is usable on systems that don't have an arch-specific hardlockup detector, like arm32 and arm64 (though it's being worked on for arm64 [5]). + The buddy system may free up scarce hardware resources. + If a CPU totally goes out to lunch (can't process NMIs) the buddy system could still detect the problem (though it would be unlikely to be able to get a stack trace). + The buddy system uses the same timer function to pet the hardlockup detector on the running CPU as it uses to detect hardlockups on other CPUs. Compared to other hardlockup detectors, this means it generates fewer interrupts and thus is likely better able to let CPUs stay idle longer. - If all CPUs are hard locked up at the same time the buddy system can't detect it. - If we don't have SMP we can't use the buddy system. - The buddy system needs an arch-specific mechanism (possibly NMI backtrace) to get info about the locked up CPU. [1] https://lore.kernel.org/r/20230419225604.21204-1-dianders@chromium.org [2] https://issuetracker.google.com/172213129 [3] https://docs.kernel.org/trace/coresight/coresight-cpu-debug.html [4] https://lore.kernel.org/lkml/20230301234753.28582-1-ricardo.neri-calderon@linux.intel.com/ [5] https://lore.kernel.org/linux-arm-kernel/20220903093415.15850-1-lecopzer.chen@mediatek.com/ Link: https://lkml.kernel.org/r/20230519101840.v5.14.I6bf789d21d0c3d75d382e7e51a804a7a51315f2c@changeid Signed-off-by: Colin Cross Signed-off-by: Matthias Kaehlcke Signed-off-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih Signed-off-by: Douglas Anderson Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Daniel Thompson Cc: "David S. Miller" Cc: Ian Rogers Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Petr Mladek Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Will Deacon Signed-off-by: Andrew Morton commit d9b3629ade8ebffb0075e311409796a56bac8282 Author: Douglas Anderson Date: Fri May 19 10:18:37 2023 -0700 watchdog/hardlockup: have the perf hardlockup use __weak functions more cleanly The fact that there watchdog_hardlockup_enable(), watchdog_hardlockup_disable(), and watchdog_hardlockup_probe() are declared __weak means that the configured hardlockup detector can define non-weak versions of those functions if it needs to. Instead of doing this, the perf hardlockup detector hooked itself into the default __weak implementation, which was a bit awkward. Clean this up. From comments, it looks as if the original design was done because the __weak function were expected to implemented by the architecture and not by the configured hardlockup detector. This got awkward when we tried to add the buddy lockup detector which was not arch-specific but wanted to hook into those same functions. This is not expected to have any functional impact. Link: https://lkml.kernel.org/r/20230519101840.v5.13.I847d9ec852449350997ba00401d2462a9cb4302b@changeid Signed-off-by: Douglas Anderson Reviewed-by: Petr Mladek Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Lecopzer Chen Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit df95d3085caa5b99a60eb033d7ad6c2ff2b43dbf Author: Douglas Anderson Date: Fri May 19 10:18:36 2023 -0700 watchdog/hardlockup: rename some "NMI watchdog" constants/function Do a search and replace of: - NMI_WATCHDOG_ENABLED => WATCHDOG_HARDLOCKUP_ENABLED - SOFT_WATCHDOG_ENABLED => WATCHDOG_SOFTOCKUP_ENABLED - watchdog_nmi_ => watchdog_hardlockup_ - nmi_watchdog_available => watchdog_hardlockup_available - nmi_watchdog_user_enabled => watchdog_hardlockup_user_enabled - soft_watchdog_user_enabled => watchdog_softlockup_user_enabled - NMI_WATCHDOG_DEFAULT => WATCHDOG_HARDLOCKUP_DEFAULT Then update a few comments near where names were changed. This is specifically to make it less confusing when we want to introduce the buddy hardlockup detector, which isn't using NMIs. As part of this, we sanitized a few names for consistency. [trix@redhat.com: make variables static] Link: https://lkml.kernel.org/r/20230525162822.1.I0fb41d138d158c9230573eaa37dc56afa2fb14ee@changeid Link: https://lkml.kernel.org/r/20230519101840.v5.12.I91f7277bab4bf8c0cb238732ed92e7ce7bbd71a6@changeid Signed-off-by: Douglas Anderson Signed-off-by: Tom Rix Reviewed-by: Tom Rix Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Lecopzer Chen Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Petr Mladek Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit ed92e1ef52224c7c9c15fba559448396b059c2ee Author: Douglas Anderson Date: Fri May 19 10:18:35 2023 -0700 watchdog/hardlockup: move perf hardlockup watchdog petting to watchdog.c In preparation for the buddy hardlockup detector, which wants the same petting logic as the current perf hardlockup detector, move the code to watchdog.c. While doing this, rename the global variable to match others nearby. As part of this change we have to change the code to account for the fact that the CPU we're running on might be different than the one we're checking. Currently the code in watchdog.c is guarded by CONFIG_HARDLOCKUP_DETECTOR_PERF, which makes this change seem silly. However, a future patch will change this. Link: https://lkml.kernel.org/r/20230519101840.v5.11.I00dfd6386ee00da25bf26d140559a41339b53e57@changeid Signed-off-by: Douglas Anderson Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Lecopzer Chen Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Petr Mladek Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 77c12fc95980d100fdc49e88a5727c242d0dfedc Author: Douglas Anderson Date: Fri May 19 10:18:34 2023 -0700 watchdog/hardlockup: add a "cpu" param to watchdog_hardlockup_check() In preparation for the buddy hardlockup detector where the CPU checking for lockup might not be the currently running CPU, add a "cpu" parameter to watchdog_hardlockup_check(). As part of this change, make hrtimer_interrupts an atomic_t since now the CPU incrementing the value and the CPU reading the value might be different. Technially this could also be done with just READ_ONCE and WRITE_ONCE, but atomic_t feels a little cleaner in this case. While hrtimer_interrupts is made atomic_t, we change hrtimer_interrupts_saved from "unsigned long" to "int". The "int" is needed to match the data type backing atomic_t for hrtimer_interrupts. Even if this changes us from 64-bits to 32-bits (which I don't think is true for most compilers), it doesn't really matter. All we ever do is increment it every few seconds and compare it to an old value so 32-bits is fine (even 16-bits would be). The "signed" vs "unsigned" also doesn't matter for simple equality comparisons. hrtimer_interrupts_saved is _not_ switched to atomic_t nor even accessed with READ_ONCE / WRITE_ONCE. The hrtimer_interrupts_saved is always consistently accessed with the same CPU. NOTE: with the upcoming "buddy" detector there is one special case. When a CPU goes offline/online then we can change which CPU is the one to consistently access a given instance of hrtimer_interrupts_saved. We still can't end up with a partially updated hrtimer_interrupts_saved, however, because we end up petting all affected CPUs to make sure the new and old CPU can't end up somehow read/write hrtimer_interrupts_saved at the same time. Link: https://lkml.kernel.org/r/20230519101840.v5.10.I3a7d4dd8c23ac30ee0b607d77feb6646b64825c0@changeid Signed-off-by: Douglas Anderson Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Lecopzer Chen Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Petr Mladek Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 1610611aadc2241179e7090ba2f3fd0d763d9932 Author: Douglas Anderson Date: Fri May 19 10:18:33 2023 -0700 watchdog/hardlockup: style changes to watchdog_hardlockup_check() / is_hardlockup() These are tiny style changes: - Add a blank line before a "return". - Renames two globals to use the "watchdog_hardlockup" prefix. - Store processor id in "unsigned int" rather than "int". - Minor comment rewording. - Use "else" rather than extra returns since it seemed more symmetric. Link: https://lkml.kernel.org/r/20230519101840.v5.9.I818492c326b632560b09f20d2608455ecf9d3650@changeid Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Lecopzer Chen Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 81972551df9d168a8183b786ff4de06008469c2e Author: Douglas Anderson Date: Fri May 19 10:18:32 2023 -0700 watchdog/hardlockup: move perf hardlockup checking/panic to common watchdog.c The perf hardlockup detector works by looking at interrupt counts and seeing if they change from run to run. The interrupt counts are managed by the common watchdog code via its watchdog_timer_fn(). Currently the API between the perf detector and the common code is a function: is_hardlockup(). When the hard lockup detector sees that function return true then it handles printing out debug info and inducing a panic if necessary. Let's change the API a little bit in preparation for the buddy hardlockup detector. The buddy hardlockup detector wants to print nearly the same debug info and have nearly the same panic behavior. That means we want to move all that code to the common file. For now, the code in the common file will only be there if the perf hardlockup detector is enabled, but eventually it will be selected by a common config. Right now, this _just_ moves the code from the perf detector file to the common file and changes the names. It doesn't make the changes that the buddy hardlockup detector will need and doesn't do any style cleanups. A future patch will do cleanup to make it more obvious what changed. With the above, we no longer have any callers of is_hardlockup() outside of the "watchdog.c" file, so we can remove it from the header, make it static, and move it to the same "#ifdef" block as our new watchdog_hardlockup_check(). While doing this, it can be noted that even if no hardlockup detectors were configured the existing code used to still have the code for counting/checking "hrtimer_interrupts" even if the perf hardlockup detector wasn't configured. We didn't need to do that, so move all the "hrtimer_interrupts" counting to only be there if the perf hardlockup detector is configured as well. This change is expected to be a no-op. Link: https://lkml.kernel.org/r/20230519101840.v5.8.Id4133d3183e798122dc3b6205e7852601f289071@changeid Signed-off-by: Douglas Anderson Reviewed-by: Petr Mladek Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Lecopzer Chen Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 6ea0d04211a7715a926f5dca4aa1065614fa64da Author: Douglas Anderson Date: Fri May 19 10:18:31 2023 -0700 watchdog/perf: rename watchdog_hld.c to watchdog_perf.c The code currently in "watchdog_hld.c" is for detecting hardlockups using perf, as evidenced by the line in the Makefile that only compiles this file if CONFIG_HARDLOCKUP_DETECTOR_PERF is defined. Rename the file to prepare for the buddy hardlockup detector, which doesn't use perf. It could be argued that the new name makes it less obvious that this is a hardlockup detector. While true, it's not hard to remember that the "perf" detector is always a hardlockup detector and it's nice not to have names that are too convoluted. Link: https://lkml.kernel.org/r/20230519101840.v5.7.Ice803cb078d0e15fb2cbf49132f096ee2bd4199d@changeid Signed-off-by: Douglas Anderson Acked-by: Nicholas Piggin Reviewed-by: Petr Mladek Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Lecopzer Chen Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 8b5c59a92b5b37e5c65ec185810d67e3f30f5a2e Author: Douglas Anderson Date: Fri May 19 10:18:30 2023 -0700 watchdog/hardlockup: add comments to touch_nmi_watchdog() In preparation for the buddy hardlockup detector, add comments to touch_nmi_watchdog() to make it obvious that it touches the configured hardlockup detector regardless of whether it's backed by an NMI. Also note that arch_touch_nmi_watchdog() may not be architecture-specific. Ideally, we'd like to rename these functions but that is a fairly disruptive change touching a lot of drivers. After discussion [1] the plan is to defer this until a good time. [1] https://lore.kernel.org/r/ZFy0TX1tfhlH8gxj@alley [akpm@linux-foundation.org: comment changes, per Petr] Link: https://lkml.kernel.org/r/ZGyONWPXpE1DcxA5@alley Link: https://lkml.kernel.org/r/20230519101840.v5.6.I4e47cbfa1bb2ebbcdb5ca16817aa2887f15dc82c@changeid Signed-off-by: Douglas Anderson Reviewed-by: Petr Mladek Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Lecopzer Chen Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Petr Mladek Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 1fafaa7745eeeeffef7155ab5eeb8cc83d04874f Author: Pingfan Liu Date: Fri May 19 10:18:29 2023 -0700 watchdog/perf: ensure CPU-bound context when creating hardlockup detector event hardlockup_detector_event_create() should create perf_event on the current CPU. Preemption could not get disabled because perf_event_create_kernel_counter() allocates memory. Instead, the CPU locality is achieved by processing the code in a per-CPU bound kthread. Add a check to prevent mistakes when calling the code in another code path. Link: https://lkml.kernel.org/r/20230519101840.v5.5.I654063e53782b11d53e736a8ad4897ffd207406a@changeid Signed-off-by: Pingfan Liu Co-developed-by: Lecopzer Chen Signed-off-by: Lecopzer Chen Signed-off-by: Douglas Anderson Reviewed-by: Petr Mladek Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 730211182ed083898fa5feb4b28459ffac4c9615 Author: Lecopzer Chen Date: Fri May 19 10:18:28 2023 -0700 watchdog/hardlockup: change watchdog_nmi_enable() to void Nobody cares about the return value of watchdog_nmi_enable(), changing its prototype to void. Link: https://lkml.kernel.org/r/20230519101840.v5.4.Ic3a19b592eb1ac4c6f6eade44ffd943e8637b6e5@changeid Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Signed-off-by: Douglas Anderson Reviewed-by: Petr Mladek Acked-by: Nicholas Piggin Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 810b560e8985725dbd57bbb3f188c231365eb5ae Author: Lecopzer Chen Date: Fri May 19 10:18:27 2023 -0700 watchdog: remove WATCHDOG_DEFAULT No reference to WATCHDOG_DEFAULT, remove it. Link: https://lkml.kernel.org/r/20230519101840.v5.3.I6a729209a1320e0ad212176e250ff945b8f91b2a@changeid Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Signed-off-by: Douglas Anderson Reviewed-by: Petr Mladek Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 4379e59fe5665cfda737e45b8bf2f05321ef049c Author: Douglas Anderson Date: Fri May 19 10:18:26 2023 -0700 watchdog/perf: more properly prevent false positives with turbo modes Currently, in the watchdog_overflow_callback() we first check to see if the watchdog had been touched and _then_ we handle the workaround for turbo mode. This order should be reversed. Specifically, "touching" the hardlockup detector's watchdog should avoid lockups being detected for one period that should be roughly the same regardless of whether we're running turbo or not. That means that we should do the extra accounting for turbo _before_ we look at (and clear) the global indicating that we've been touched. NOTE: this fix is made based on code inspection. I am not aware of any reports where the old code would have generated false positives. That being said, this order seems more correct and also makes it easier down the line to share code with the "buddy" hardlockup detector. Link: https://lkml.kernel.org/r/20230519101840.v5.2.I843b0d1de3e096ba111a179f3adb16d576bef5c7@changeid Fixes: 7edaeb6841df ("kernel/watchdog: Prevent false positives with turbo modes") Signed-off-by: Douglas Anderson Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Lecopzer Chen Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Petr Mladek Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton commit 5e008df11c55228a86a1bae692cc2002503572c9 Author: Douglas Anderson Date: Fri May 19 10:18:25 2023 -0700 watchdog/perf: define dummy watchdog_update_hrtimer_threshold() on correct config Patch series "watchdog/hardlockup: Add the buddy hardlockup detector", v5. This patch series adds the "buddy" hardlockup detector. In brief, the buddy hardlockup detector can detect hardlockups without arch-level support by having CPUs checkup on a "buddy" CPU periodically. Given the new design of this patch series, testing all combinations is fairly difficult. I've attempted to make sure that all combinations of CONFIG_ options are good, but it wouldn't surprise me if I missed something. I apologize in advance and I'll do my best to fix any problems that are found. This patch (of 18): The real watchdog_update_hrtimer_threshold() is defined in kernel/watchdog_hld.c. That file is included if CONFIG_HARDLOCKUP_DETECTOR_PERF and the function is defined in that file if CONFIG_HARDLOCKUP_CHECK_TIMESTAMP. The dummy version of the function in "nmi.h" didn't get that quite right. While this doesn't appear to be a huge deal, it's nice to make it consistent. It doesn't break builds because CHECK_TIMESTAMP is only defined by x86 so others don't get a double definition, and x86 uses perf lockup detector, so it gets the out of line version. Link: https://lkml.kernel.org/r/20230519101840.v5.18.Ia44852044cdcb074f387e80df6b45e892965d4a1@changeid Link: https://lkml.kernel.org/r/20230519101840.v5.1.I8cbb2f4fa740528fcfade4f5439b6cdcdd059251@changeid Fixes: 7edaeb6841df ("kernel/watchdog: Prevent false positives with turbo modes") Signed-off-by: Douglas Anderson Reviewed-by: Nicholas Piggin Reviewed-by: Petr Mladek Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Lecopzer Chen Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Pingfan Liu Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Cc: Colin Cross Signed-off-by: Andrew Morton commit 004444486184a7222a7b4bde0c568f6da3621b25 Author: Arnd Bergmann Date: Wed May 17 15:19:31 2023 +0200 decompressor: provide missing prototypes The entry points for the decompressor don't always have a prototype included in the .c file: lib/decompress_inflate.c:42:17: error: no previous prototype for '__gunzip' [-Werror=missing-prototypes] lib/decompress_unxz.c:251:17: error: no previous prototype for 'unxz' [-Werror=missing-prototypes] lib/decompress_unzstd.c:331:17: error: no previous prototype for 'unzstd' [-Werror=missing-prototypes] Include the correct headers for unxz and unzstd, and mark the inflate function above as unconditionally 'static' to avoid these warnings. Link: https://lkml.kernel.org/r/20230517131936.936840-1-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Nick Terrell Signed-off-by: Andrew Morton commit 6aee6723f1b3a4453b327fdafcde362e9befcc11 Author: Angus Chen Date: Thu May 18 11:53:21 2023 +0800 init: add bdev fs printk if mount_block_root failed Booting with the QEMU command line: "qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..." will panic if ext4 is not builtin and a request to load the ext4 module fails. [ 1.729006] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19 [ 1.730603] Please append a correct "root=" boot option; here are the available partitions: [ 1.732323] fd00 256000 vda [ 1.732329] driver: virtio_blk [ 1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0) [ 1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53 [ 1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.10.2-1ubuntu1 04/01/2014 [ 1.735772] Call Trace: [ 1.735950] [ 1.736113] dump_stack_lvl+0x32/0x50 [ 1.736367] panic+0x108/0x310 [ 1.736570] mount_block_root+0x161/0x310 [ 1.736849] ? rdinit_setup+0x40/0x40 [ 1.737088] prepare_namespace+0x10c/0x180 [ 1.737393] kernel_init_freeable+0x354/0x450 [ 1.737707] ? rest_init+0xd0/0xd0 [ 1.737945] kernel_init+0x16/0x130 [ 1.738196] ret_from_fork+0x1f/0x30 As a hint, print all the bdev fstypes which are available. [akpm@linux-foundation.org: fix spelling in printk message] Link: https://lkml.kernel.org/r/20230518035321.1672-1-angus.chen@jaguarmicro.com Signed-off-by: Angus Chen Acked-by: Nick Desaulniers Cc: Masahiro Yamada Cc: Mike Rapoport (IBM) Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Vlastimil Babka Cc: Al Viro Signed-off-by: Andrew Morton commit e0ddec73fd4822d2ffe914d5ce3e2718f985276a Author: Arnd Bergmann Date: Wed May 17 14:49:25 2023 +0200 kcov: add prototypes for helper functions A number of internal functions in kcov are only called from generated code and don't technically need a declaration, but 'make W=1' warns about global symbols without a prototype: kernel/kcov.c:199:14: error: no previous prototype for '__sanitizer_cov_trace_pc' [-Werror=missing-prototypes] kernel/kcov.c:264:14: error: no previous prototype for '__sanitizer_cov_trace_cmp1' [-Werror=missing-prototypes] kernel/kcov.c:270:14: error: no previous prototype for '__sanitizer_cov_trace_cmp2' [-Werror=missing-prototypes] kernel/kcov.c:276:14: error: no previous prototype for '__sanitizer_cov_trace_cmp4' [-Werror=missing-prototypes] kernel/kcov.c:282:14: error: no previous prototype for '__sanitizer_cov_trace_cmp8' [-Werror=missing-prototypes] kernel/kcov.c:288:14: error: no previous prototype for '__sanitizer_cov_trace_const_cmp1' [-Werror=missing-prototypes] kernel/kcov.c:295:14: error: no previous prototype for '__sanitizer_cov_trace_const_cmp2' [-Werror=missing-prototypes] kernel/kcov.c:302:14: error: no previous prototype for '__sanitizer_cov_trace_const_cmp4' [-Werror=missing-prototypes] kernel/kcov.c:309:14: error: no previous prototype for '__sanitizer_cov_trace_const_cmp8' [-Werror=missing-prototypes] kernel/kcov.c:316:14: error: no previous prototype for '__sanitizer_cov_trace_switch' [-Werror=missing-prototypes] Adding prototypes for these in a header solves that problem, but now there is a mismatch between the built-in type and the prototype on 64-bit architectures because they expect some functions to take a 64-bit 'unsigned long' argument rather than an 'unsigned long long' u64 type: include/linux/kcov.h:84:6: error: conflicting types for built-in function '__sanitizer_cov_trace_switch'; expected 'void(long long unsigned int, void *)' [-Werror=builtin-declaration-mismatch] 84 | void __sanitizer_cov_trace_switch(u64 val, u64 *cases); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Avoid this as well with a custom type definition. Link: https://lkml.kernel.org/r/20230517124944.929997-1-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Rong Tao Signed-off-by: Andrew Morton commit 3403bb4ea5983b4e84f404f91322a9a0cc75d700 Author: Arnd Bergmann Date: Wed May 17 15:11:02 2023 +0200 time_namespace: always provide arch_get_vdso_data() prototype for vdso The arch_get_vdso_data() function is defined separately on each architecture, but only called when CONFIG_TIME_NS is set. If the definition is a global function, this causes a W=1 warning without TIME_NS: arch/x86/entry/vdso/vma.c:35:19: error: no previous prototype for 'arch_get_vdso_data' [-Werror=missing-prototypes] Move the prototype out of the #ifdef block to reliably turn off that warning. Link: https://lkml.kernel.org/r/20230517131102.934196-15-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit af0a76e1269516d940214be48255669b0b5ff40b Author: Arnd Bergmann Date: Wed May 17 15:11:01 2023 +0200 thread_info: move function declarations to linux/thread_info.h There are a few __weak functions in kernel/fork.c, which architectures can override. If there is no prototype, the compiler warns about them: kernel/fork.c:164:13: error: no previous prototype for 'arch_release_task_struct' [-Werror=missing-prototypes] kernel/fork.c:991:20: error: no previous prototype for 'arch_task_cache_init' [-Werror=missing-prototypes] kernel/fork.c:1086:12: error: no previous prototype for 'arch_dup_task_struct' [-Werror=missing-prototypes] There are already prototypes in a number of architecture specific headers that have addressed those warnings before, but it's much better to have these in a single place so the warning no longer shows up anywhere. Link: https://lkml.kernel.org/r/20230517131102.934196-14-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit 73648e6fa79a832a6a50e87d4a9e9da416f82aaa Author: Arnd Bergmann Date: Wed May 17 15:11:00 2023 +0200 init: move cifs_root_data() prototype into linux/mount.h cifs_root_data() is defined in cifs and called from early init code, but lacks a global prototype: fs/cifs/cifsroot.c:83:12: error: no previous prototype for 'cifs_root_data' Move the declaration from do_mounts.c into an appropriate header. Link: https://lkml.kernel.org/r/20230517131102.934196-13-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit ad1a48301f659a02df5bff0a121d4a5c0411d36b Author: Arnd Bergmann Date: Wed May 17 15:10:59 2023 +0200 init: consolidate prototypes in linux/init.h The init/main.c file contains some extern declarations for functions defined in architecture code, and it defines some other functions that are called from architecture code with a custom prototype. Both of those result in warnings with 'make W=1': init/calibrate.c:261:37: error: no previous prototype for 'calibrate_delay_is_known' [-Werror=missing-prototypes] init/main.c:790:20: error: no previous prototype for 'mem_encrypt_init' [-Werror=missing-prototypes] init/main.c:792:20: error: no previous prototype for 'poking_init' [-Werror=missing-prototypes] arch/arm64/kernel/irq.c:122:13: error: no previous prototype for 'init_IRQ' [-Werror=missing-prototypes] arch/arm64/kernel/time.c:55:13: error: no previous prototype for 'time_init' [-Werror=missing-prototypes] arch/x86/kernel/process.c:935:13: error: no previous prototype for 'arch_post_acpi_subsys_init' [-Werror=missing-prototypes] init/calibrate.c:261:37: error: no previous prototype for 'calibrate_delay_is_known' [-Werror=missing-prototypes] kernel/fork.c:991:20: error: no previous prototype for 'arch_task_cache_init' [-Werror=missing-prototypes] Add prototypes for all of these in include/linux/init.h or another appropriate header, and remove the duplicate declarations from architecture specific code. [sfr@canb.auug.org.au: declare time_init_early()] Link: https://lkml.kernel.org/r/20230519124311.5167221c@canb.auug.org.au Link: https://lkml.kernel.org/r/20230517131102.934196-12-arnd@kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: Stephen Rothwell Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit 23108f6aac4c86f822db59b89d64da0e70bad5fe Author: Arnd Bergmann Date: Wed May 17 15:10:57 2023 +0200 kunit: include debugfs header file An extra #include statement is needed to ensure the prototypes for debugfs interfaces are visible, avoiding this warning: lib/kunit/debugfs.c:28:6: error: no previous prototype for 'kunit_debugfs_cleanup' [-Werror=missing-prototypes] lib/kunit/debugfs.c:33:6: error: no previous prototype for 'kunit_debugfs_init' [-Werror=missing-prototypes] lib/kunit/debugfs.c:102:6: error: no previous prototype for 'kunit_debugfs_create_suite' [-Werror=missing-prototypes] lib/kunit/debugfs.c:118:6: error: no previous prototype for 'kunit_debugfs_destroy_suite' [-Werror=missing-prototypes] Link: https://lkml.kernel.org/r/20230517131102.934196-10-arnd@kernel.org Signed-off-by: Arnd Bergmann Reviewed-by: David Gow Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit d9cdb43189ef9aa4f8a12b00e86875544942fa6a Author: Arnd Bergmann Date: Wed May 17 15:10:56 2023 +0200 panic: make function declarations visible A few panic() related functions have a global definition but not declaration, which causes a warning with W=1: kernel/panic.c:710:6: error: no previous prototype for '__warn_printk' [-Werror=missing-prototypes] kernel/panic.c:756:24: error: no previous prototype for '__stack_chk_fail' [-Werror=missing-prototypes] kernel/exit.c:1917:32: error: no previous prototype for 'abort' [-Werror=missing-prototypes] __warn_printk() is called both as a global function when CONFIG_BUG is enabled, and as a local function in other configs. The other two here are called indirectly from generated or assembler code. Add prototypes for all of these. Link: https://lkml.kernel.org/r/20230517131102.934196-9-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit 525bb813a995283bef759659cfc00f3fc2d51e81 Author: Arnd Bergmann Date: Wed May 17 15:10:55 2023 +0200 panic: hide unused global functions Building with W=1 shows warnings about two functions that have no declaration or caller in certain configurations: kernel/panic.c:688:6: error: no previous prototype for 'warn_slowpath_fmt' [-Werror=missing-prototypes] kernel/panic.c:710:6: error: no previous prototype for '__warn_printk' [-Werror=missing-prototypes] Enclose the definition in the same #ifdef check as the declaration. Link: https://lkml.kernel.org/r/20230517131102.934196-8-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit ff7138813ac4a20628ce4b40952c69faba835fbb Author: Arnd Bergmann Date: Wed May 17 15:10:54 2023 +0200 locking: add lockevent_read() prototype lockevent_read() has a __weak definition and the only caller in kernel/locking/lock_events.c, plus a strong definition in qspinlock_stat.h that overrides it, but no other declaration. This causes a W=1 warning: kernel/locking/lock_events.c:61:16: error: no previous prototype for 'lockevent_read' [-Werror=missing-prototypes] Add shared prototype to avoid the warnings. Link: https://lkml.kernel.org/r/20230517131102.934196-7-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit 6b76ca2ab917185b63ded3d7f85bbf9998ab939e Author: Arnd Bergmann Date: Wed May 17 15:10:53 2023 +0200 lib: devmem_is_allowed: include linux/io.h The devmem_is_allowed() function is defined in a file of the same name, but the declaration is in asm/io.h, which is not included there, causing a W=1 warning: lib/devmem_is_allowed.c:20:5: error: no previous prototype for 'devmem_is_allowed' [-Werror=missing-prototypes] Include the appropriate header to avoid the warning. Link: https://lkml.kernel.org/r/20230517131102.934196-6-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit 52bb85d64361e7861cc2d38cfbc85881bc57c0b6 Author: Arnd Bergmann Date: Wed May 17 15:10:51 2023 +0200 mm: sparse: mark populate_section_memmap() static There are two definitions of this function, but the second one lacks the 'static' annotation: mm/sparse.c:704:25: error: no previous prototype for 'populate_section_memmap' [-Werror=missing-prototypes] Link: https://lkml.kernel.org/r/20230517131102.934196-4-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit 8f14a96386b2676a1ccdd9d2f1732fbd7248fa98 Author: Arnd Bergmann Date: Wed May 17 15:10:50 2023 +0200 mm: page_poison: always declare __kernel_map_pages() function The __kernel_map_pages() function is mainly used for CONFIG_DEBUG_PAGEALLOC, but has a number of architecture specific definitions that may also be used in other configurations, as well as a global fallback definition for architectures that do not support DEBUG_PAGEALLOC. When the option is disabled, any definitions without the prototype cause a warning: mm/page_poison.c:102:6: error: no previous prototype for '__kernel_map_pages' [-Werror=missing-prototypes] The function is a trivial nop here, so just declare it anyway to avoid the warning. Link: https://lkml.kernel.org/r/20230517131102.934196-3-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit 6ca0f81c0b96a5e29de48cb02062b5130d27dbe3 Author: Arnd Bergmann Date: Wed May 17 15:10:49 2023 +0200 mm: percpu: unhide pcpu_embed_first_chunk prototype Patch series "mm/init/kernel: missing-prototypes warnings". These are patches addressing -Wmissing-prototypes warnings in common kernel code and memory management code files that usually get merged through the -mm tree. This patch (of 12): This function is called whenever CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK or CONFIG_HAVE_SETUP_PER_CPU_AREA, but only declared when the former is set: mm/percpu.c:3055:12: error: no previous prototype for 'pcpu_embed_first_chunk' [-Werror=missing-prototypes] There is no real point in hiding declarations, so just remove the #ifdef here. Link: https://lkml.kernel.org/r/20230517131102.934196-1-arnd@kernel.org Link: https://lkml.kernel.org/r/20230517131102.934196-2-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Boqun Feng Cc: Catalin Marinas Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Paris Cc: Heiko Carstens Cc: Helge Deller Cc: Ingo Molnar Cc: Michael Ellerman Cc: Michal Simek Cc: Palmer Dabbelt Cc: Paul Moore Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Russell King Cc: Tejun Heo Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton commit e994f5b677ee016a2535d9df826315122da1ae65 Author: Vincent Whitchurch Date: Wed May 17 16:18:19 2023 +0200 squashfs: cache partial compressed blocks Before commit 93e72b3c612adcaca1 ("squashfs: migrate from ll_rw_block usage to BIO"), compressed blocks read by squashfs were cached in the page cache, but that is not the case after that commit. That has lead to squashfs having to re-read a lot of sectors from disk/flash. For example, the first sectors of every metadata block need to be read twice from the disk. Once partially to read the length, and a second time to read the block itself. Also, in linear reads of large files, the last sectors of one data block are re-read from disk when reading the next data block, since the compressed blocks are of variable sizes and not aligned to device blocks. This extra I/O results in a degrade in read performance of, for example, ~16% in one scenario on my ARM platform using squashfs with dm-verity and NAND. Since the decompressed data is cached in the page cache or squashfs' internal metadata and fragment caches, caching _all_ compressed pages would lead to a lot of double caching and is undesirable. But make the code cache any disk blocks which were only partially requested, since these are the ones likely to include data which is needed by other file system blocks. This restores read performance in my test scenario. The compressed block caching is only applied when the disk block size is equal to the page size, to avoid having to deal with caching sub-page reads. [akpm@linux-foundation.org: fs/squashfs/block.c needs linux/pagemap.h] [vincent.whitchurch@axis.com: fix page update race] Link: https://lkml.kernel.org/r/20230526-squashfs-cache-fixup-v1-1-d54a7fa23e7b@axis.com [vincent.whitchurch@axis.com: fix page indices] Link: https://lkml.kernel.org/r/20230526-squashfs-cache-fixup-v1-2-d54a7fa23e7b@axis.com [akpm@linux-foundation.org: fix layout, per hch] Link: https://lkml.kernel.org/r/20230510-squashfs-cache-v4-1-3bd394e1ee71@axis.com Signed-off-by: Vincent Whitchurch Reviewed-by: Christoph Hellwig Reviewed-by: Phillip Lougher Signed-off-by: Andrew Morton commit 6b81459c9cb0e11e30b07ff0a171c27f3650eb82 Author: Christoph Hellwig Date: Wed May 17 09:16:22 2023 +0200 squashfs: don't include buffer_head.h Squashfs has stopped using buffers heads in 93e72b3c612adcaca1 ("squashfs: migrate from ll_rw_block usage to BIO"). Link: https://lkml.kernel.org/r/20230517071622.245151-1-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Pankaj Raghav Reviewed-by: Phillip Lougher Signed-off-by: Andrew Morton commit 4e2f6342ccaf9d8beb33b398cc2862769c7d2a3b Author: Haifeng Xu Date: Mon May 8 06:44:58 2023 +0000 fork: optimize memcg_charge_kernel_stack() a bit Since commit f1c1a9ee00e4 ("fork: Move memcg_charge_kernel_stack() into CONFIG_VMAP_STACK"), memcg_charge_kernel_stack() has been moved into CONFIG_VMAP_STACK block, so the CONFIG_VMAP_STACK check can be removed. Furthermore, memcg_charge_kernel_stack() is only invoked by alloc_thread_stack_node() instead of dup_task_struct(). If memcg_kmem_charge_page() fails, the uncharge process is handled in memcg_charge_kernel_stack() itself instead of free_thread_stack(), so remove the incorrect comments. If memcg_charge_kernel_stack() fails to charge pages used by kernel stack, only charged pages need to be uncharged. It's unnecessary to uncharge those pages which memory cgroup pointer is NULL. [akpm@linux-foundation.org: remove assertion that PAGE_SIZE is a multiple of 1k] Link: https://lkml.kernel.org/r/20230508064458.32855-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Cc: Andy Lutomirski Cc: Daniel Bristot de Oliveira Cc: Sebastian Andrzej Siewior Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit 3db55767da7427cebc49e22b25b5f50ff455add6 Author: Alexey Dobriyan Date: Fri May 12 13:33:38 2023 +0300 add intptr_t Add signed intptr_t given that a) it is standard type and b) uintptr_t is in tree. Link: https://lkml.kernel.org/r/ed66b9e4-1fb7-45be-9bb9-d4bc291c691f@p183 Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton commit 9e627588bf91174d8903f5550dc4cffc5c348247 Author: Azeem Shaikh Date: Wed May 10 21:24:57 2023 +0000 procfs: replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Link: https://lkml.kernel.org/r/20230510212457.3491385-1-azeemshaikh38@gmail.com Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Reviewed-by: Alexey Dobriyan Cc: Baoquan He Cc: David Hildenbrand Cc: Kefeng Wang Cc: Liu Shixin Cc: Lorenzo Stoakes Signed-off-by: Andrew Morton commit 35a609a82c17b460fde063f8f4a6514441360cfd Author: Colin Ian King Date: Thu Apr 27 11:28:35 2023 +0100 scripts/spelling.txt: add more spellings to spelling.txt Some of the more common spelling mistakes and typos that I've found while fixing up spelling mistakes in the kernel over the past couple of releases. Link: https://lkml.kernel.org/r/20230427102835.83482-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Andrew Morton commit 6a25212dc35897e36f83860df3cefcdf5fb5c189 Author: Prathu Baronia Date: Tue May 2 14:32:40 2023 +0530 kthread: fix spelling typo and grammar in comments - `If present` -> `If present,' - `reuturn` -> `return` - `function exit safely` -> `function to exit safely` Link: https://lkml.kernel.org/r/20230502090242.3037194-1-quic_pbaronia@quicinc.com Signed-off-by: Prathu Baronia Cc: Eric W. Biederman Cc: Jason A. Donenfeld Cc: Kees Cook Cc: Petr Mladek Cc: Sami Tolvanen Cc: Tejun Heo Cc: Zqiang Signed-off-by: Andrew Morton commit a6e79df92e4a371ba7b751a20e3a31fde0f528b8 Author: Lorenzo Stoakes Date: Thu May 4 22:27:53 2023 +0100 mm/gup: disallow FOLL_LONGTERM GUP-fast writing to file-backed mappings Writing to file-backed dirty-tracked mappings via GUP is inherently broken as we cannot rule out folios being cleaned and then a GUP user writing to them again and possibly marking them dirty unexpectedly. This is especially egregious for long-term mappings (as indicated by the use of the FOLL_LONGTERM flag), so we disallow this case in GUP-fast as we have already done in the slow path. We have access to less information in the fast path as we cannot examine the VMA containing the mapping, however we can determine whether the folio is anonymous or belonging to a whitelisted filesystem - specifically hugetlb and shmem mappings. We take special care to ensure that both the folio and mapping are safe to access when performing these checks and document folio_fast_pin_allowed() accordingly. It's important to note that there are no APIs allowing users to specify FOLL_FAST_ONLY for a PUP-fast let alone with FOLL_LONGTERM, so we can always rely on the fact that if we fail to pin on the fast path, the code will fall back to the slow path which can perform the more thorough check. Link: https://lkml.kernel.org/r/a27d39b87ded7f3dad5fd4181edb106393660453.1683235180.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Suggested-by: David Hildenbrand Suggested-by: Kirill A . Shutemov Suggested-by: Peter Zijlstra Reviewed-by: Jan Kara Acked-by: David Hildenbrand Cc: Jason Gunthorpe Cc: John Hubbard Cc: Mika Penttilä Signed-off-by: Andrew Morton commit 8ac268436e6d52f3bb4d212df9395aec97afaa00 Author: Lorenzo Stoakes Date: Thu May 4 22:27:52 2023 +0100 mm/gup: disallow FOLL_LONGTERM GUP-nonfast writing to file-backed mappings Writing to file-backed mappings which require folio dirty tracking using GUP is a fundamentally broken operation, as kernel write access to GUP mappings do not adhere to the semantics expected by a file system. A GUP caller uses the direct mapping to access the folio, which does not cause write notify to trigger, nor does it enforce that the caller marks the folio dirty. The problem arises when, after an initial write to the folio, writeback results in the folio being cleaned and then the caller, via the GUP interface, writes to the folio again. As a result of the use of this secondary, direct, mapping to the folio no write notify will occur, and if the caller does mark the folio dirty, this will be done so unexpectedly. For example, consider the following scenario:- 1. A folio is written to via GUP which write-faults the memory, notifying the file system and dirtying the folio. 2. Later, writeback is triggered, resulting in the folio being cleaned and the PTE being marked read-only. 3. The GUP caller writes to the folio, as it is mapped read/write via the direct mapping. 4. The GUP caller, now done with the page, unpins it and sets it dirty (though it does not have to). This results in both data being written to a folio without writenotify, and the folio being dirtied unexpectedly (if the caller decides to do so). This issue was first reported by Jan Kara [1] in 2018, where the problem resulted in file system crashes. This is only relevant when the mappings are file-backed and the underlying file system requires folio dirty tracking. File systems which do not, such as shmem or hugetlb, are not at risk and therefore can be written to without issue. Unfortunately this limitation of GUP has been present for some time and requires future rework of the GUP API in order to provide correct write access to such mappings. However, for the time being we introduce this check to prevent the most egregious case of this occurring, use of the FOLL_LONGTERM pin. These mappings are considerably more likely to be written to after folios are cleaned and thus simply must not be permitted to do so. This patch changes only the slow-path GUP functions, a following patch adapts the GUP-fast path along similar lines. [1] https://lore.kernel.org/linux-mm/20180103100430.GE4911@quack2.suse.cz/ Link: https://lkml.kernel.org/r/7282506742d2390c125949c2f9894722750bb68a.1683235180.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Suggested-by: Jason Gunthorpe Reviewed-by: John Hubbard Reviewed-by: Mika Penttilä Reviewed-by: Jan Kara Reviewed-by: Jason Gunthorpe Acked-by: David Hildenbrand Cc: Kirill A . Shutemov Cc: Peter Zijlstra Signed-off-by: Andrew Morton commit 54cbbbf3faf610fb4eba6f8d39d933bcbfc6f4de Author: Lorenzo Stoakes Date: Thu May 4 22:27:51 2023 +0100 mm/mmap: separate writenotify and dirty tracking logic Patch series "mm/gup: disallow GUP writing to file-backed mappings by default", v9. Writing to file-backed mappings which require folio dirty tracking using GUP is a fundamentally broken operation, as kernel write access to GUP mappings do not adhere to the semantics expected by a file system. A GUP caller uses the direct mapping to access the folio, which does not cause write notify to trigger, nor does it enforce that the caller marks the folio dirty. The problem arises when, after an initial write to the folio, writeback results in the folio being cleaned and then the caller, via the GUP interface, writes to the folio again. As a result of the use of this secondary, direct, mapping to the folio no write notify will occur, and if the caller does mark the folio dirty, this will be done so unexpectedly. For example, consider the following scenario:- 1. A folio is written to via GUP which write-faults the memory, notifying the file system and dirtying the folio. 2. Later, writeback is triggered, resulting in the folio being cleaned and the PTE being marked read-only. 3. The GUP caller writes to the folio, as it is mapped read/write via the direct mapping. 4. The GUP caller, now done with the page, unpins it and sets it dirty (though it does not have to). This change updates both the PUP FOLL_LONGTERM slow and fast APIs. As pin_user_pages_fast_only() does not exist, we can rely on a slightly imperfect whitelisting in the PUP-fast case and fall back to the slow case should this fail. This patch (of 3): vma_wants_writenotify() is specifically intended for setting PTE page table flags, accounting for existing page table flag state and whether the underlying filesystem performs dirty tracking for a file-backed mapping. Everything is predicated firstly on whether the mapping is shared writable, as this is the only instance where dirty tracking is pertinent - MAP_PRIVATE mappings will always be CoW'd and unshared, and read-only file-backed shared mappings cannot be written to, even with FOLL_FORCE. All other checks are in line with existing logic, though now separated into checks eplicitily for dirty tracking and those for determining how to set page table flags. We make this change so we can perform checks in the GUP logic to determine which mappings might be problematic when written to. Link: https://lkml.kernel.org/r/cover.1683235180.git.lstoakes@gmail.com Link: https://lkml.kernel.org/r/0f218370bd49b4e6bbfbb499f7c7b92c26ba1ceb.1683235180.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: John Hubbard Reviewed-by: Mika Penttilä Reviewed-by: Jan Kara Reviewed-by: Jason Gunthorpe Acked-by: David Hildenbrand Cc: Kirill A . Shutemov Cc: Peter Zijlstra Signed-off-by: Andrew Morton commit 5e07472583840308949ce807b11274de15cb79a0 Author: Liam Ni Date: Sat Jun 3 10:31:16 2023 +0800 mm/early_ioremap.c: improve the execution efficiency of early_ioremap_setup() Reduce the number of invalid loops of the function early_ioremap_setup() to improve the efficiency of function execution Link: https://lkml.kernel.org/r/CACZJ9cU6t5sLoDwE6_XOg+UJLpZt4+qHfjYN2bA0s+3y9y6pQQ@mail.gmail.com Signed-off-by: LiamNi Signed-off-by: Andrew Morton commit 396faf88981917f975773d8589ce4f6e6c679e13 Author: Miaohe Lin Date: Sat Jun 3 15:21:16 2023 +0800 memcg: use helper macro FLUSH_TIME Use helper macro FLUSH_TIME to indicate the flush time to improve the readability a bit. No functional change intended. Link: https://lkml.kernel.org/r/20230603072116.1101690-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Shakeel Butt Reviewed-by: Muchun Song Reviewed-by: David Hildenbrand Acked-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Signed-off-by: Andrew Morton commit 12dd992accd96c09ec765a3bb4706a3ed24ae5b3 Author: Miaohe Lin Date: Sat Jun 3 19:25:58 2023 +0800 mm: page_alloc: remove unneeded header files Remove some unneeded header files. No functional change intended. Link: https://lkml.kernel.org/r/20230603112558.213694-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton commit 3b65f437d9e8dd696a2b88e7afcd51385532ab35 Author: Ryan Roberts Date: Fri Jun 2 10:29:49 2023 +0100 mm: fix failure to unmap pte on highmem systems The loser of a race to service a pte for a device private entry in the swap path previously unlocked the ptl, but failed to unmap the pte. This only affects highmem systems since unmapping a pte is a noop on non-highmem systems. Link: https://lkml.kernel.org/r/20230602092949.545577-5-ryan.roberts@arm.com Fixes: 16ce101db85d ("mm/memory.c: fix race when faulting a device private page") Signed-off-by: Ryan Roberts Reviewed-by: Zi Yan Reviewed-by: Mike Rapoport (IBM) Cc: Christoph Hellwig Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox (Oracle) Cc: SeongJae Park Cc: Uladzislau Rezki (Sony) Cc: Yu Zhao Signed-off-by: Andrew Morton commit fa8c919dac3f5f325b17f9fcf8ac7dd899992598 Author: Ryan Roberts Date: Fri Jun 2 10:29:48 2023 +0100 mm/damon/ops-common: refactor to use {pte|pmd}p_clear_young_notify() With the fix in place to atomically test and clear young on ptes and pmds, simplify the code to handle the clearing for both the primary mmu and the mmu notifier with a single API call. Link: https://lkml.kernel.org/r/20230602092949.545577-4-ryan.roberts@arm.com Signed-off-by: Ryan Roberts Acked-by: Yu Zhao Reviewed-by: SeongJae Park Cc: Christoph Hellwig Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox (Oracle) Cc: Mike Rapoport (IBM) Cc: Uladzislau Rezki (Sony) Cc: Zi Yan Signed-off-by: Andrew Morton commit c11d34fa139e4b0fb4249a30f37b178353533fa1 Author: Ryan Roberts Date: Fri Jun 2 10:29:47 2023 +0100 mm/damon/ops-common: atomically test and clear young on ptes and pmds It is racy to non-atomically read a pte, then clear the young bit, then write it back as this could discard dirty information. Further, it is bad practice to directly set a pte entry within a table. Instead clearing young must go through the arch-provided helper, ptep_test_and_clear_young() to ensure it is modified atomically and to give the arch code visibility and allow it to check (and potentially modify) the operation. Link: https://lkml.kernel.org/r/20230602092949.545577-3-ryan.roberts@arm.com Fixes: 3f49584b262c ("mm/damon: implement primitives for the virtual memory address spaces"). Signed-off-by: Ryan Roberts Reviewed-by: Zi Yan Reviewed-by: SeongJae Park Reviewed-by: Mike Rapoport (IBM) Cc: Christoph Hellwig Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox (Oracle) Cc: Uladzislau Rezki (Sony) Cc: Yu Zhao Cc: Signed-off-by: Andrew Morton commit b3f78e74986546a6da5d28c24e627d95d17f79ec Author: Ryan Roberts Date: Fri Jun 2 10:29:46 2023 +0100 mm: vmalloc must set pte via arch code Patch series "Fixes for pte encapsulation bypasses", v3. A series to improve the encapsulation of pte entries by disallowing non-arch code from directly dereferencing pte_t pointers. This patch (of 4): It is bad practice to directly set pte entries within a pte table. Instead all modifications must go through arch-provided helpers such as set_pte_at() to give the arch code visibility and allow it to check (and potentially modify) the operation. Link: https://lkml.kernel.org/r/20230602092949.545577-1-ryan.roberts@arm.com Link: https://lkml.kernel.org/r/20230602092949.545577-2-ryan.roberts@arm.com Fixes: 3e9a9e256b1e ("mm: add a vmap_pfn function") Signed-off-by: Ryan Roberts Reviewed-by: Zi Yan Acked-by: Lorenzo Stoakes Reviewed-by: Christoph Hellwig Reviewed-by: Uladzislau Rezki (Sony) Reviewed-by: Mike Rapoport (IBM) Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: SeongJae Park Cc: Yu Zhao Signed-off-by: Andrew Morton commit 501b26510ae3bbdf9333b83addcd4e5c4214346d Author: Marcelo Tosatti Date: Tue May 30 11:52:35 2023 -0300 vmstat: allow_direct_reclaim should use zone_page_state_snapshot A customer provided evidence indicating that a process was stalled in direct reclaim: - The process was trapped in throttle_direct_reclaim(). The function wait_event_killable() was called to wait condition allow_direct_reclaim(pgdat) for current node to be true. The allow_direct_reclaim(pgdat) examined the number of free pages on the node by zone_page_state() which just returns value in zone->vm_stat[NR_FREE_PAGES]. - On node #1, zone->vm_stat[NR_FREE_PAGES] was 0. However, the freelist on this node was not empty. - This inconsistent of vmstat value was caused by percpu vmstat on nohz_full cpus. Every increment/decrement of vmstat is performed on percpu vmstat counter at first, then pooled diffs are cumulated to the zone's vmstat counter in timely manner. However, on nohz_full cpus (in case of this customer's system, 48 of 52 cpus) these pooled diffs were not cumulated once the cpu had no event on it so that the cpu started sleeping infinitely. I checked percpu vmstat and found there were total 69 counts not cumulated to the zone's vmstat counter yet. - In this situation, kswapd did not help the trapped process. In pgdat_balanced(), zone_wakermark_ok_safe() examined the number of free pages on the node by zone_page_state_snapshot() which checks pending counts on percpu vmstat. Therefore kswapd could know there were 69 free pages correctly. Since zone->_watermark = {8, 20, 32}, kswapd did not work because 69 was greater than 32 as high watermark. Change allow_direct_reclaim to use zone_page_state_snapshot, which allows a more precise version of the vmstat counters to be used. allow_direct_reclaim will only be called from try_to_free_pages, which is not a hot path. Testing: Due to difficulties accessing the system, it has not been possible for the reproducer to test the patch (however its clear from available data and analysis that it should fix it). Link: https://lkml.kernel.org/r/20230530145335.677325196@redhat.com Reviewed-by: Michal Hocko Reviewed-by: Aaron Tomlin Signed-off-by: Marcelo Tosatti Cc: Christoph Lameter Cc: Frederic Weisbecker Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 64d1b4dd826d88d239945d71f58cac582c0495b4 Author: Christoph Hellwig Date: Thu Jun 1 16:59:04 2023 +0200 fuse: use direct_write_fallback Use the generic direct_write_fallback helper instead of duplicating the logic. Link: https://lkml.kernel.org/r/20230601145904.1385409-13-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Cc: Al Viro Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Chao Yu Cc: Christian Brauner Cc: "Darrick J. Wong" Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Xiubo Li Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Miklos Szeredi Signed-off-by: Andrew Morton commit 596df33d673d9d816b60b95088e59a76d845c254 Author: Christoph Hellwig Date: Thu Jun 1 16:59:03 2023 +0200 fuse: drop redundant arguments to fuse_perform_write pos is always equal to iocb->ki_pos, and mapping is always equal to iocb->ki_filp->f_mapping. Link: https://lkml.kernel.org/r/20230601145904.1385409-12-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Acked-by: Miklos Szeredi Cc: Al Viro Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Chao Yu Cc: Christian Brauner Cc: "Darrick J. Wong" Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Johannes Thumshirn Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Xiubo Li Signed-off-by: Andrew Morton commit 70e986c3b4f43ae7096be6de9a39c947f182e0c0 Author: Christoph Hellwig Date: Thu Jun 1 16:59:02 2023 +0200 fuse: update ki_pos in fuse_perform_write Both callers of fuse_perform_write need to updated ki_pos, move it into common code. Link: https://lkml.kernel.org/r/20230601145904.1385409-11-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Cc: Al Viro Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Chao Yu Cc: Christian Brauner Cc: "Darrick J. Wong" Cc: Hannes Reinecke Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Johannes Thumshirn Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Miklos Szeredi Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Xiubo Li Signed-off-by: Andrew Morton commit 44fff0fa08ec5a6d9d5fb05443a36d854d0ece4d Author: Christoph Hellwig Date: Thu Jun 1 16:59:01 2023 +0200 fs: factor out a direct_write_fallback helper Add a helper dealing with handling the syncing of a buffered write fallback for direct I/O. Link: https://lkml.kernel.org/r/20230601145904.1385409-10-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Miklos Szeredi Reviewed-by: Darrick J. Wong Cc: Al Viro Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Chao Yu Cc: Christian Brauner Cc: Hannes Reinecke Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Johannes Thumshirn Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Xiubo Li Signed-off-by: Andrew Morton commit 8ee93b4bb6265f2c2c13d075c3999ed83113ff4b Author: Christoph Hellwig Date: Thu Jun 1 16:59:00 2023 +0200 iomap: use kiocb_write_and_wait and kiocb_invalidate_pages Use the common helpers for direct I/O page invalidation instead of open coding the logic. This leads to a slight reordering of checks in __iomap_dio_rw to keep the logic straight. Link: https://lkml.kernel.org/r/20230601145904.1385409-9-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Darrick J. Wong Cc: Al Viro Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Chao Yu Cc: Christian Brauner Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Johannes Thumshirn Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Miklos Szeredi Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Xiubo Li Signed-off-by: Andrew Morton commit 219580eea1eedefebd3f17c4b31a5226ff4c6a89 Author: Christoph Hellwig Date: Thu Jun 1 16:58:59 2023 +0200 iomap: update ki_pos in iomap_file_buffered_write All callers of iomap_file_buffered_write need to updated ki_pos, move it into common code. Link: https://lkml.kernel.org/r/20230601145904.1385409-8-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Gruenbacher Reviewed-by: Hannes Reinecke Reviewed-by: Darrick J. Wong Acked-by: Damien Le Moal Cc: Al Viro Cc: Anna Schumaker Cc: Chao Yu Cc: Christian Brauner Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Johannes Thumshirn Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Miklos Szeredi Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Xiubo Li Signed-off-by: Andrew Morton commit c402a9a9430b670926decbb284b756ee6f47c1ec Author: Christoph Hellwig Date: Thu Jun 1 16:58:58 2023 +0200 filemap: add a kiocb_invalidate_post_direct_write helper Add a helper to invalidate page cache after a dio write. Link: https://lkml.kernel.org/r/20230601145904.1385409-7-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Acked-by: Darrick J. Wong Cc: Al Viro Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Chao Yu Cc: Christian Brauner Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Johannes Thumshirn Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Miklos Szeredi Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Xiubo Li Signed-off-by: Andrew Morton commit e003f74afbd2feadbb9ffbf9135e2d2fb5d320a5 Author: Christoph Hellwig Date: Thu Jun 1 16:58:57 2023 +0200 filemap: add a kiocb_invalidate_pages helper Factor out a helper that calls filemap_write_and_wait_range and invalidate_inode_pages2_range for the range covered by a write kiocb or returns -EAGAIN if the kiocb is marked as nowait and there would be pages to write or invalidate. Link: https://lkml.kernel.org/r/20230601145904.1385409-6-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Acked-by: Darrick J. Wong Cc: Al Viro Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Chao Yu Cc: Christian Brauner Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Johannes Thumshirn Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Miklos Szeredi Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Xiubo Li Signed-off-by: Andrew Morton commit 3c435a0fe35c220bec442dffff04a64aacf952b0 Author: Christoph Hellwig Date: Thu Jun 1 16:58:56 2023 +0200 filemap: add a kiocb_write_and_wait helper Factor out a helper that does filemap_write_and_wait_range for the range covered by a read kiocb, or returns -EAGAIN if the kiocb is marked as nowait and there would be pages to write. Link: https://lkml.kernel.org/r/20230601145904.1385409-5-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Acked-by: Darrick J. Wong Cc: Al Viro Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Chao Yu Cc: Christian Brauner Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Johannes Thumshirn Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Miklos Szeredi Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Xiubo Li Signed-off-by: Andrew Morton commit 182c25e9c157f37bd0ab5a82fe2417e2223df459 Author: Christoph Hellwig Date: Thu Jun 1 16:58:55 2023 +0200 filemap: update ki_pos in generic_perform_write All callers of generic_perform_write need to updated ki_pos, move it into common code. Link: https://lkml.kernel.org/r/20230601145904.1385409-4-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Xiubo Li Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Acked-by: Theodore Ts'o Acked-by: Darrick J. Wong Cc: Al Viro Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Chao Yu Cc: Christian Brauner Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Johannes Thumshirn Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Miklos Szeredi Cc: Trond Myklebust Signed-off-by: Andrew Morton commit 936e114a245b6e38e0dbf706a67e7611fc993da1 Author: Christoph Hellwig Date: Thu Jun 1 16:58:54 2023 +0200 iomap: update ki_pos a little later in iomap_dio_complete Move the ki_pos update down a bit to prepare for a better common helper that invalidates pages based of an iocb. Link: https://lkml.kernel.org/r/20230601145904.1385409-3-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Darrick J. Wong Cc: Al Viro Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Chao Yu Cc: Christian Brauner Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Johannes Thumshirn Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Miklos Szeredi Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Xiubo Li Signed-off-by: Andrew Morton commit 0d625446d0a451a683a357799912b9e688629707 Author: Christoph Hellwig Date: Thu Jun 1 16:58:53 2023 +0200 backing_dev: remove current->backing_dev_info Patch series "cleanup the filemap / direct I/O interaction", v4. This series cleans up some of the generic write helper calling conventions and the page cache writeback / invalidation for direct I/O. This is a spinoff from the no-bufferhead kernel project, for which we'll want to an use iomap based buffered write path in the block layer. This patch (of 12): The last user of current->backing_dev_info disappeared in commit b9b1335e6403 ("remove bdi_congested() and wb_congested() and related functions"). Remove the field and all assignments to it. Link: https://lkml.kernel.org/r/20230601145904.1385409-1-hch@lst.de Link: https://lkml.kernel.org/r/20230601145904.1385409-2-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Christian Brauner Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Darrick J. Wong Acked-by: Theodore Ts'o Cc: Al Viro Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Chao Yu Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jens Axboe Cc: Matthew Wilcox Cc: Miklos Szeredi Cc: Miklos Szeredi Cc: Trond Myklebust Cc: Xiubo Li Signed-off-by: Andrew Morton commit e0228d590beb0d0af345c58a282f01afac5c57f3 Author: Domenico Cerasuolo Date: Fri May 26 20:32:27 2023 +0200 mm: zswap: shrink until can accept This update addresses an issue with the zswap reclaim mechanism, which hinders the efficient offloading of cold pages to disk, thereby compromising the preservation of the LRU order and consequently diminishing, if not inverting, its performance benefits. The functioning of the zswap shrink worker was found to be inadequate, as shown by basic benchmark test. For the test, a kernel build was utilized as a reference, with its memory confined to 1G via a cgroup and a 5G swap file provided. The results are presented below, these are averages of three runs without the use of zswap: real 46m26s user 35m4s sys 7m37s With zswap (zbud) enabled and max_pool_percent set to 1 (in a 32G system), the results changed to: real 56m4s user 35m13s sys 8m43s written_back_pages: 18 reject_reclaim_fail: 0 pool_limit_hit:1478 Besides the evident regression, one thing to notice from this data is the extremely low number of written_back_pages and pool_limit_hit. The pool_limit_hit counter, which is increased in zswap_frontswap_store when zswap is completely full, doesn't account for a particular scenario: once zswap hits his limit, zswap_pool_reached_full is set to true; with this flag on, zswap_frontswap_store rejects pages if zswap is still above the acceptance threshold. Once we include the rejections due to zswap_pool_reached_full && !zswap_can_accept(), the number goes from 1478 to a significant 21578266. Zswap is stuck in an undesirable state where it rejects pages because it's above the acceptance threshold, yet fails to attempt memory reclaimation. This happens because the shrink work is only queued when zswap_frontswap_store detects that it's full and the work itself only reclaims one page per run. This state results in hot pages getting written directly to disk, while cold ones remain memory, waiting only to be invalidated. The LRU order is completely broken and zswap ends up being just an overhead without providing any benefits. This commit applies 2 changes: a) the shrink worker is set to reclaim pages until the acceptance threshold is met and b) the task is also enqueued when zswap is not full but still above the threshold. Testing this suggested update showed much better numbers: real 36m37s user 35m8s sys 9m32s written_back_pages: 10459423 reject_reclaim_fail: 12896 pool_limit_hit: 75653 Link: https://lkml.kernel.org/r/20230526183227.793977-1-cerasuolodomenico@gmail.com Fixes: 45190f01dd40 ("mm/zswap.c: add allocation hysteresis if pool limit is hit") Signed-off-by: Domenico Cerasuolo Acked-by: Johannes Weiner Reviewed-by: Yosry Ahmed Reviewed-by: Vitaly Wool Cc: Dan Streetman Cc: Seth Jennings Signed-off-by: Andrew Morton commit e3d9b45fb17cfddb1c414b5981743d4245fcf486 Author: Haifeng Xu Date: Thu Jun 1 06:35:35 2023 +0000 mm/mm_init.c: move set_pageblock_order() to free_area_init() pageblock_order only needs to be set once, there is no need to initialize it in every zone/node. Link: https://lkml.kernel.org/r/20230601063536.26882-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Reviewed-by: Mike Rapoport (IBM) Cc: Michal Hocko Signed-off-by: Andrew Morton commit 16618670276a77480e274117992cec5e42ce66a9 Author: Xin Hao Date: Wed May 31 17:58:17 2023 +0800 mm: khugepaged: avoid pointless allocation for "struct mm_slot" In __khugepaged_enter(), if "mm->flags" with MMF_VM_HUGEPAGE bit is set, the "mm_slot" will be released and return, so we can call mm_slot_alloc() after test_and_set_bit(). Link: https://lkml.kernel.org/r/20230531095817.11012-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton commit 3b11edf1f2398cac206a224308de6628ebeea924 Author: Tetsuo Handa Date: Sun May 14 09:28:56 2023 +0900 mm/page_alloc: don't wake kswapd from rmqueue() unless __GFP_KSWAPD_RECLAIM is specified Commit 73444bc4d8f9 ("mm, page_alloc: do not wake kswapd with zone lock held") moved wakeup_kswapd() from steal_suitable_fallback() to rmqueue() using ZONE_BOOSTED_WATERMARK flag. Only allocation contexts that include ALLOC_KSWAPD (which corresponds to __GFP_KSWAPD_RECLAIM) should wake kswapd, for callers are supposed to remove __GFP_KSWAPD_RECLAIM if trying to hold pgdat->kswapd_wait has a risk of deadlock. But since zone->flags is a shared variable, a thread doing !__GFP_KSWAPD_RECLAIM allocation request might observe this flag being set immediately after another thread doing __GFP_KSWAPD_RECLAIM allocation request set this flag, causing possibility of deadlock. Link: https://lkml.kernel.org/r/c3c3dacf-dd3b-77c9-f96a-d0982b4b2a4f@I-love.SAKURA.ne.jp Fixes: 73444bc4d8f9 ("mm, page_alloc: do not wake kswapd with zone lock held") Signed-off-by: Tetsuo Handa Acked-by: Mel Gorman Cc: "Huang, Ying" Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 837c2ba56d6fd1ecf7a1c5aa0cdc872f3b74185b Author: Haifeng Xu Date: Sun May 28 04:57:20 2023 +0000 mm/mm_init.c: remove free_area_init_memoryless_node() free_area_init_memoryless_node() is just a wrapper of free_area_init_node(), remove it to clean up. Link: https://lkml.kernel.org/r/20230528045720.4835-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Acked-by: Michal Hocko Cc: Mike Rapoport Signed-off-by: Andrew Morton commit deedad80f660af8199ea3b3f70939f2d226b9154 Author: Yin Fengwei Date: Sat Apr 29 16:27:58 2023 +0800 THP: avoid lock when check whether THP is in deferred list free_transhuge_page() acquires split queue lock then check whether the THP was added to deferred list or not. It brings high deferred queue lock contention. It's safe to check whether the THP is in deferred list or not without holding the deferred queue lock in free_transhuge_page() because when code hit free_transhuge_page(), there is no one tries to add the folio to _deferred_list. Running page_fault1 of will-it-scale + order 2 folio for anonymous mapping with 96 processes on an Ice Lake 48C/96T test box, we could see the 61% split_queue_lock contention: - 63.02% 0.01% page_fault1_pro [kernel.kallsyms] [k] free_transhuge_page - 63.01% free_transhuge_page + 62.91% _raw_spin_lock_irqsave With this patch applied, the split_queue_lock contention is less than 1%. Link: https://lkml.kernel.org/r/20230429082759.1600796-2-fengwei.yin@intel.com Signed-off-by: Yin Fengwei Acked-by: Kirill A. Shutemov Reviewed-by: "Huang, Ying" Cc: Matthew Wilcox Cc: Ryan Roberts Cc: Yu Zhao Signed-off-by: Andrew Morton commit a95722a047724ef75567381976a36f0e44230bd9 Author: Huang Ying Date: Mon May 29 14:13:55 2023 +0800 swap: comments get_swap_device() with usage rule The general rule to use a swap entry is as follows. When we get a swap entry, if there aren't some other ways to prevent swapoff, such as the folio in swap cache is locked, page table lock is held, etc., the swap entry may become invalid because of swapoff. Then, we need to enclose all swap related functions with get_swap_device() and put_swap_device(), unless the swap functions call get/put_swap_device() by themselves. Add the rule as comments of get_swap_device(). Link: https://lkml.kernel.org/r/20230529061355.125791-6-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: David Hildenbrand Reviewed-by: Yosry Ahmed Reviewed-by: Chris Li (Google) Cc: Hugh Dickins Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Michal Hocko Cc: Minchan Kim Cc: Tim Chen Cc: Yang Shi Cc: Yu Zhao Signed-off-by: Andrew Morton commit c07aee4f82af3c466509782b15658837fe53babc Author: Huang Ying Date: Mon May 29 14:13:54 2023 +0800 swap: remove get/put_swap_device() in __swap_duplicate() __swap_duplicate() is called by - swap_shmem_alloc(): the folio in swap cache is locked. - copy_nonpresent_pte() -> swap_duplicate() and try_to_unmap_one() -> swap_duplicate(): the page table lock is held. - __read_swap_cache_async() -> swapcache_prepare(): enclosed with get/put_swap_device() in __read_swap_cache_async() already. So, it's safe to remove get/put_swap_device() in __swap_duplicate(). Link: https://lkml.kernel.org/r/20230529061355.125791-5-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Yosry Ahmed Reviewed-by: David Hildenbrand Reviewed-by: Chris Li (Google) Cc: Hugh Dickins Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Michal Hocko Cc: Minchan Kim Cc: Tim Chen Cc: Yang Shi Cc: Yu Zhao Signed-off-by: Andrew Morton commit 3ecdeb0f876e91c4a7129ba2ba5baa530aa6c4f9 Author: Huang Ying Date: Mon May 29 14:13:53 2023 +0800 swap: remove __swp_swapcount() __swp_swapcount() just encloses the calling to swap_swapcount() with get/put_swap_device(). It is called in __read_swap_cache_async() only, which encloses the calling with get/put_swap_device() already. So, __read_swap_cache_async() can call swap_swapcount() directly. Link: https://lkml.kernel.org/r/20230529061355.125791-4-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: David Hildenbrand Reviewed-by: Chris Li (Google) Cc: Hugh Dickins Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Michal Hocko Cc: Minchan Kim Cc: Tim Chen Cc: Yang Shi Cc: Yu Zhao Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 46a774d3eae523fd9a1907ba90e9a116cd1c5ddc Author: Huang Ying Date: Mon May 29 14:13:52 2023 +0800 swap, __read_swap_cache_async(): enlarge get/put_swap_device protection range This makes the function a little easier to be understood because we don't need to consider swapoff. And this makes it possible to remove get/put_swap_device() calling in some functions called by __read_swap_cache_async(). Link: https://lkml.kernel.org/r/20230529061355.125791-3-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: David Hildenbrand Reviewed-by: Chris Li (Google) Cc: Hugh Dickins Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Michal Hocko Cc: Minchan Kim Cc: Tim Chen Cc: Yang Shi Cc: Yu Zhao Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit f9f956b550b8ce6fb902af9f29ba31b3e0fd052d Author: Huang Ying Date: Mon May 29 14:13:51 2023 +0800 swap: remove get/put_swap_device() in __swap_count() Patch series "swap: cleanup get/put_swap_device() usage", v3. The general rule to use a swap entry is as follows. When we get a swap entry, if there aren't some other ways to prevent swapoff, such as the folio in swap cache is locked, page table lock is held, etc., the swap entry may become invalid because of swapoff. Then, we need to enclose all swap related functions with get_swap_device() and put_swap_device(), unless the swap functions call get/put_swap_device() by themselves. Based on the above rule, all get/put_swap_device() usage are checked and cleaned up if necessary. This patch (of 5): get/put_swap_device() are added to __swap_count() in commit eb085574a752 ("mm, swap: fix race between swapoff and some swap operations"). Later, in commit 2799e77529c2 ("swap: fix do_swap_page() race with swapoff"), get/put_swap_device() are added to do_swap_page(). And they enclose the only call site of __swap_count(). So, it's safe to remove get/put_swap_device() in __swap_count() now. Link: https://lkml.kernel.org/r/20230529061355.125791-1-ying.huang@intel.com Link: https://lkml.kernel.org/r/20230529061355.125791-2-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Yosry Ahmed Reviewed-by: David Hildenbrand Reviewed-by: Chris Li (Google) Cc: Hugh Dickins Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Michal Hocko Cc: Minchan Kim Cc: Tim Chen Cc: Yang Shi Cc: Yu Zhao Signed-off-by: Andrew Morton commit 1c2d252f5b4289e1c6840bcf394157b70c639d6e Author: Haifeng Xu Date: Fri May 26 08:52:51 2023 +0000 mm/mm_init.c: do not calculate zone_start_pfn/zone_end_pfn in zone_absent_pages_in_node() In calculate_node_totalpages(), zone_start_pfn/zone_end_pfn are already calculated in zone_spanned_pages_in_node(), so use them as parameters instead of node_start_pfn/node_end_pfn and the duplicated calculation process can de dropped. Link: https://lkml.kernel.org/r/20230526085251.1977-2-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Suggested-by: Mike Rapoport Reviewed-by: Mike Rapoport (IBM) Cc: David Hildenbrand Cc: Haifeng Xu Cc: Michal Hocko Signed-off-by: Andrew Morton commit ba1b67c79cb3c5f5d11cb475bb7045929b235538 Author: Haifeng Xu Date: Fri May 26 08:52:50 2023 +0000 mm/mm_init.c: introduce reset_memoryless_node_totalpages() Currently, no matter whether a node actually has memory or not, calculate_node_totalpages() is used to account number of pages in zone/node. However, for node without memory, these unnecessary calculations can be skipped. All the zone/node page counts can be set to 0 directly. So introduce reset_memoryless_node_totalpages() to perform this action. Furthermore, calculate_node_totalpages() only gets called for the node with memory. Link: https://lkml.kernel.org/r/20230526085251.1977-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Suggested-by: Mike Rapoport Reviewed-by: Mike Rapoport (IBM) Cc: David Hildenbrand Cc: Michal Hocko Signed-off-by: Andrew Morton commit da9698105c7a84f601e81ea1f5f39ba53f6b9d7c Author: SeongJae Park Date: Thu May 25 21:43:14 2023 +0000 Docs/mm/damon/design: add a section for the modules layer Add a section for covering DAMON modules layer to the design document. Link: https://lkml.kernel.org/r/20230525214314.5204-11-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit f508a0fbd3807b9aa157612bba7cf2bafa9dbc97 Author: SeongJae Park Date: Thu May 25 21:43:13 2023 +0000 Docs/mm/damon/design: add a section for DAMON core API Add a section covering the API of DAMON core layer on the design document. Link: https://lkml.kernel.org/r/20230525214314.5204-10-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit b138878609be31615309af6400bf05937e076525 Author: SeongJae Park Date: Thu May 25 21:43:12 2023 +0000 Docs/mm/damon/design: add sections for advanced features of DAMOS Add sections for advanced features of DAMOS including quotas, prioritization, watermarks, and filters of DAMOS on the design document. Link: https://lkml.kernel.org/r/20230525214314.5204-9-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 2dc4e6a509aef2d06d9cccfb2aad4cec92752a39 Author: SeongJae Park Date: Thu May 25 21:43:11 2023 +0000 Docs/mm/damon/design: add sections for basic parts of DAMOS DAMOS is an important part of DAMON, but the design doc is not covering it. Add sections for covering the basic part of DAMOS. Link: https://lkml.kernel.org/r/20230525214314.5204-8-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit eaabfa4321a66b771479ce92bb5ad493762f0f0a Author: SeongJae Park Date: Thu May 25 21:43:10 2023 +0000 Docs/mm/damon/design: add a section for the relation between Core and Modules layer Add overall desription of the interface and the relation between the Core and the Modules layer under 'Overall Architecture' section. Link: https://lkml.kernel.org/r/20230525214314.5204-7-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 69e7b88cea29f10bb8707f4056cba1e2d04cb894 Author: SeongJae Park Date: Thu May 25 21:43:09 2023 +0000 Docs/mm/damon/design: rewrite configurable layers The 'Configurable Operations Set' section is a little bit outdated. Update the text. Link: https://lkml.kernel.org/r/20230525214314.5204-6-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit e168962dbf7f0a6aba26174b3b09d0c313c6f7f5 Author: SeongJae Park Date: Thu May 25 21:43:08 2023 +0000 Docs/mm/damon/design: update the layout based on the layers DAMON design document is describing only the operations set layer and monitoring part of the core logic. Update the layout based on the DAMON's layers, so that more parts of DAMON including DAMOS core logic and DAMON modules can easily be added. Link: https://lkml.kernel.org/r/20230525214314.5204-5-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 45b849df7d0ea9d65b8f088b6b86d12d7f1bdee6 Author: SeongJae Park Date: Thu May 25 21:43:07 2023 +0000 Docs/mm/damon/design: add a section for overall architecture The design doc is missing overall picture of DAMON. Add a section for overall architeucture and layers. Link: https://lkml.kernel.org/r/20230525214314.5204-4-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 73dc57e4ef49a69681d351e0e8fe6fbfb1ba8d92 Author: SeongJae Park Date: Thu May 25 21:43:06 2023 +0000 Docs/mm/damon/maintainer-profile: fix typos and grammar errors Fix a few typos and grammar erros in DAMON Maintainer Profile document. Link: https://lkml.kernel.org/r/20230525214314.5204-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit c6bb975aa60bef4b689f9811d888c79d721077e3 Author: SeongJae Park Date: Thu May 25 21:43:05 2023 +0000 Docs/mm/damon/faq: remove old questions Patch series "Docs/mm/damon: Minor fixes and design doc update". Some of the DAMON documents are outdated, or having minor typos or grammar erros. Especially, the design doc has not updated for DAMOS, which is an important part of DAMON. Fix the minor issues and update documents. This patch (of 10): The first two questions of DAMON faqs have raised when DAMON patches were first submitted. More than one year has passed since DAMON patches get merged in the mainline, and that kind of questions are not asked nowadays. Remove the questions. Link: https://lkml.kernel.org/r/20230525214314.5204-1-sj@kernel.org Link: https://lkml.kernel.org/r/20230525214314.5204-2-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 3af0191a594d5ca5d6d2e3602b5d4284c6835e77 Author: Kalesh Singh Date: Tue May 23 13:59:21 2023 -0700 Multi-gen LRU: fix workingset accounting On Android app cycle workloads, MGLRU showed a significant reduction in workingset refaults although pgpgin/pswpin remained relatively unchanged. This indicated MGLRU may be undercounting workingset refaults. This has impact on userspace programs, like Android's LMKD, that monitor workingset refault statistics to detect thrashing. It was found that refaults were only accounted if the MGLRU shadow entry was for a recently evicted folio. However, recently evicted folios should be accounted as workingset activation, and refaults should be accounted regardless of recency. Fix MGLRU's workingset refault and activation accounting to more closely match that of the conventional active/inactive LRU. Link: https://lkml.kernel.org/r/20230523205922.3852731-1-kaleshsingh@google.com Fixes: ac35a4902374 ("mm: multi-gen LRU: minimal implementation") Signed-off-by: Kalesh Singh Reported-by: Charan Teja Kalla Acked-by: Yu Zhao Cc: Brian Geffon Cc: Jan Alexander Steffens (heftig) Cc: Oleksandr Natalenko Cc: Suren Baghdasaryan Signed-off-by: Andrew Morton commit 06b27ce36a1a3dc5ea6f8314d0c7d1baa9f8ece7 Author: Peng Zhang Date: Wed May 24 11:12:47 2023 +0800 maple_tree: relocate the declaration of mas_empty_area_rev(). Relocate the declaration of mas_empty_area_rev() so that mas_empty_area() and mas_empty_area_rev() are together. Link: https://lkml.kernel.org/r/20230524031247.65949-11-zhangpeng.00@bytedance.com Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit 7a03ae39209cf882bb673f724ba723020e1233cc Author: Peng Zhang Date: Wed May 24 11:12:46 2023 +0800 maple_tree: simplify and clean up mas_wr_node_store() Simplify and clean up mas_wr_node_store(), remove unnecessary code. Link: https://lkml.kernel.org/r/20230524031247.65949-10-zhangpeng.00@bytedance.com Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit e6d1ffd611affcd58b31047324f511d8e1de2a38 Author: Peng Zhang Date: Wed May 24 11:12:45 2023 +0800 maple_tree: rework mas_wr_slot_store() to be cleaner and more efficient. Get whether the two gaps to be overwritten are empty to avoid calling mas_update_gap() all the time. Also clean up the code and add comments. Link: https://lkml.kernel.org/r/20230524031247.65949-9-zhangpeng.00@bytedance.com Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit 2e1da329b424c693662e7e2afa34654989de3fac Author: Peng Zhang Date: Wed May 24 11:12:44 2023 +0800 maple_tree: add comments and some minor cleanups to mas_wr_append() Add comment for mas_wr_append(), move mas_update_gap() into mas_wr_append(), and other cleanups to make mas_wr_modify() cleaner. Link: https://lkml.kernel.org/r/20230524031247.65949-8-zhangpeng.00@bytedance.com Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit c6fc9e4a5c505228032fa645e32341d243d51959 Author: Peng Zhang Date: Wed May 24 11:12:43 2023 +0800 maple_tree: add mas_wr_new_end() to calculate new_end accurately The previous new_end calculation is inaccurate, because it assumes that two new pivots must be added (this is inaccurate), and sometimes it will miss the fast path and enter the slow path. Add mas_wr_new_end() to accurately calculate new_end to make the conditions for entering the fast path more accurate. Link: https://lkml.kernel.org/r/20230524031247.65949-7-zhangpeng.00@bytedance.com Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit 8c995a631474a85c656e9237f868e2ddf87910c0 Author: Peng Zhang Date: Wed May 24 11:12:42 2023 +0800 maple_tree: make the code symmetrical in mas_wr_extend_null() Just make the code symmetrical to improve readability. Link: https://lkml.kernel.org/r/20230524031247.65949-6-zhangpeng.00@bytedance.com Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit bc147f0f70a3f0ce3f3978d9476a4e894e1aad88 Author: Peng Zhang Date: Wed May 24 11:12:41 2023 +0800 maple_tree: simplify mas_is_span_wr() Make the code for detecting spanning writes more concise. Link: https://lkml.kernel.org/r/20230524031247.65949-5-zhangpeng.00@bytedance.com Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit 14c4b5ab6a43495d0153958d5fe6c6c6ace49e91 Author: Peng Zhang Date: Wed May 24 11:12:40 2023 +0800 maple_tree: fix the arguments to __must_hold() Fix the arguments to __must_hold() to make sparse work. Link: https://lkml.kernel.org/r/20230524031247.65949-4-zhangpeng.00@bytedance.com Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit c2aa6f5328b9c33195c656cd81771d6c2595fac3 Author: Peng Zhang Date: Wed May 24 11:12:39 2023 +0800 maple_tree: drop mas_{rev_}alloc() and mas_fill_gap() mas_{rev_}alloc() and mas_fill_gap() are no longer used, delete them. Link: https://lkml.kernel.org/r/20230524031247.65949-3-zhangpeng.00@bytedance.com Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit 523716770e63e229dbb6307d663f03d990dfefc5 Author: Peng Zhang Date: Wed May 24 11:12:38 2023 +0800 maple_tree: rework mtree_alloc_{range,rrange}() Patch series "Clean ups for maple tree", v4. Some clean ups, mainly to make the code of maple tree more concise. This patchset has passed the self-test. This patch (of 10): Use mas_empty_area{_rev}() to refactor mtree_alloc_{range,rrange}() Link: https://lkml.kernel.org/r/20230524031247.65949-2-zhangpeng.00@bytedance.com Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit e0e0b4126c1f1effd480777507a61bd09360dc8f Author: Lars R. Damerow Date: Wed May 24 11:17:33 2023 -0700 mm/memcontrol: export memcg.swap watermark via sysfs for v2 memcg This patch is similar to commit 8e20d4b33266 ("mm/memcontrol: export memcg->watermark via sysfs for v2 memcg"), but exports the swap counter's watermark. We allocate jobs to our compute farm using heuristics determined by memory and swap usage from previous jobs. Tracking the peak swap usage for new jobs is important for determining when jobs are exceeding their expected bounds, or when our baseline metrics are getting outdated. Our toolset was written to use the "memory.memsw.max_usage_in_bytes" file in cgroups v1, and altering it to poll cgroups v2's "memory.swap.current" would give less accurate results as well as add complication to the code. Having this watermark exposed in sysfs is much preferred. Link: https://lkml.kernel.org/r/20230524181734.125696-1-lars@pixar.com Signed-off-by: Lars R. Damerow Acked-by: Johannes Weiner Cc: Jonathan Corbet Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Cc: Tejun Heo Cc: Zefan Li Signed-off-by: Andrew Morton commit 283ebdee2da30f65cba04c8fe690b97acfc7f4c4 Author: Tu Jinjiang Date: Thu May 25 11:16:40 2023 +0800 mm: shmem: fix UAF bug in shmem_show_options() shmem_show_options() uses sbinfo->mpol without adding it's refcnt. This may lead to race with replacement of the mpol by remount. The execution sequence is as follows. CPU0 CPU1 shmem_show_options() shmem_reconfigure() shmem_show_mpol(seq, sbinfo->mpol) mpol = sbinfo->mpol mpol_put(mpol) mpol->mode The KASAN report is as follows. BUG: KASAN: slab-use-after-free in shmem_show_options+0x21b/0x340 Read of size 2 at addr ffff888124324004 by task mount/2388 CPU: 2 PID: 2388 Comm: mount Not tainted 6.4.0-rc3-00017-g9d646009f65d-dirty #8 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Call Trace: dump_stack_lvl+0x37/0x50 print_report+0xd0/0x620 ? shmem_show_options+0x21b/0x340 ? __virt_addr_valid+0xf4/0x180 ? shmem_show_options+0x21b/0x340 kasan_report+0xb8/0xe0 ? shmem_show_options+0x21b/0x340 shmem_show_options+0x21b/0x340 ? __pfx_shmem_show_options+0x10/0x10 ? strchr+0x2c/0x50 ? strlen+0x23/0x40 ? seq_puts+0x7d/0x90 show_vfsmnt+0x1e6/0x260 ? __pfx_show_vfsmnt+0x10/0x10 ? __kasan_kmalloc+0x7f/0x90 seq_read_iter+0x57a/0x740 vfs_read+0x2e2/0x4a0 ? __pfx_vfs_read+0x10/0x10 ? down_write_killable+0xb8/0x140 ? __pfx_down_write_killable+0x10/0x10 ? __fget_light+0xa9/0x1e0 ? up_write+0x3f/0x80 ksys_read+0xb8/0x150 ? __pfx_ksys_read+0x10/0x10 ? fpregs_assert_state_consistent+0x55/0x60 ? exit_to_user_mode_prepare+0x2d/0x120 do_syscall_64+0x3c/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc Allocated by task 2387: kasan_save_stack+0x22/0x50 kasan_set_track+0x25/0x30 __kasan_slab_alloc+0x59/0x70 kmem_cache_alloc+0xdd/0x220 mpol_new+0x83/0x150 mpol_parse_str+0x280/0x4a0 shmem_parse_one+0x364/0x520 vfs_parse_fs_param+0xf8/0x1a0 vfs_parse_fs_string+0xc9/0x130 shmem_parse_options+0xb2/0x110 path_mount+0x597/0xdf0 do_mount+0xcd/0xf0 __x64_sys_mount+0xbd/0x100 do_syscall_64+0x3c/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc Freed by task 2389: kasan_save_stack+0x22/0x50 kasan_set_track+0x25/0x30 kasan_save_free_info+0x2e/0x50 __kasan_slab_free+0x10e/0x1a0 kmem_cache_free+0x9c/0x350 shmem_reconfigure+0x278/0x370 reconfigure_super+0x383/0x450 path_mount+0xcc5/0xdf0 do_mount+0xcd/0xf0 __x64_sys_mount+0xbd/0x100 do_syscall_64+0x3c/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc The buggy address belongs to the object at ffff888124324000 which belongs to the cache numa_policy of size 32 The buggy address is located 4 bytes inside of freed 32-byte region [ffff888124324000, ffff888124324020) ================================================================== To fix the bug, shmem_get_sbmpol() / mpol_put() needs to be called before / after shmem_show_mpol() call. Link: https://lkml.kernel.org/r/20230525031640.593733-1-tujinjiang@huawei.com Signed-off-by: Tu Jinjiang Reviewed-by: Kefeng Wang Acked-by: Hugh Dickins Cc: Nanyong Sun Signed-off-by: Andrew Morton commit a8d13355c660255266ece529e81e6cb26754941a Author: Baolin Wang Date: Thu May 25 20:54:01 2023 +0800 mm: compaction: skip fast freepages isolation if enough freepages are isolated I've observed that fast isolation often isolates more pages than cc->migratepages, and the excess freepages will be released back to the buddy system. So skip fast freepages isolation if enough freepages are isolated to save some CPU cycles. Link: https://lkml.kernel.org/r/f39c2c07f2dba2732fd9c0843572e5bef96f7f67.1685018752.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Vlastimil Babka Cc: Mel Gorman Cc: Johannes Weiner Signed-off-by: Andrew Morton commit 447ba88658faa8dbfd29d557daa38b7d88f460ec Author: Baolin Wang Date: Thu May 25 20:54:00 2023 +0800 mm: compaction: add trace event for fast freepages isolation The fast_isolate_freepages() can also isolate freepages, but we can not know the fast isolation efficiency to understand the fast isolation pressure. So add a trace event to show some numbers to help to understand the efficiency for fast freepages isolation. Link: https://lkml.kernel.org/r/78d2932d0160d122c15372aceb3f2c45460a17fc.1685018752.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Vlastimil Babka Cc: Mel Gorman Signed-off-by: Andrew Morton commit 8b71b499ff98fdcda7efefc146841a8b4d26813d Author: Baolin Wang Date: Thu May 25 20:53:59 2023 +0800 mm: compaction: only set skip flag if cc->no_set_skip_hint is false To keep the same logic as test_and_set_skip(), only set the skip flag if cc->no_set_skip_hint is false, which makes code more reasonable. Link: https://lkml.kernel.org/r/0eb2cd2407ffb259ae6e3071e10f70f2d41d0f3e.1685018752.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Vlastimil Babka Cc: Mel Gorman Signed-off-by: Andrew Morton commit cf650342f83ae655c6d05a1a74ae1672459973d0 Author: Baolin Wang Date: Thu May 25 20:53:58 2023 +0800 mm: compaction: skip more fully scanned pageblock In fast_isolate_around(), it assumes the pageblock is fully scanned if cc->nr_freepages < cc->nr_migratepages after trying to isolate some free pages, and will set skip flag to avoid scanning in future. However this can miss setting the skip flag for a fully scanned pageblock (returned 'start_pfn' is equal to 'end_pfn') in the case where cc->nr_freepages is larger than cc->nr_migratepages. So using the returned 'start_pfn' from isolate_freepages_block() and 'end_pfn' to decide if a pageblock is fully scanned makes more sense. It can also cover the case where cc->nr_freepages < cc->nr_migratepages, which means the 'start_pfn' is usually equal to 'end_pfn' except some uncommon fatal error occurs after non-strict mode isolation. Link: https://lkml.kernel.org/r/f4efd2fa08735794a6d809da3249b6715ba6ad38.1685018752.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Vlastimil Babka Cc: Mel Gorman Signed-off-by: Andrew Morton commit 2dbd90054f965c899b9adb62b2d0d215f687d04b Author: Baolin Wang Date: Thu May 25 20:53:57 2023 +0800 mm: compaction: change fast_isolate_freepages() to void type No caller cares about the return value of fast_isolate_freepages(), void it. Link: https://lkml.kernel.org/r/759fca20b22ebf4c81afa30496837b9e0fb2e53b.1685018752.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Vlastimil Babka Cc: Mel Gorman Signed-off-by: Andrew Morton commit 75990f6459b9cf61a94e8a08d0f6a4aa0b8cf3b5 Author: Baolin Wang Date: Thu May 25 20:53:56 2023 +0800 mm: compaction: drop the redundant page validation in update_pageblock_skip() Patch series "Misc cleanups and improvements for compaction". This series cantains some cleanups and improvements for compaction. This patch (of 6): The caller has validated the page before calling update_pageblock_skip(), thus drop the redundant page validation in update_pageblock_skip(). Link: https://lkml.kernel.org/r/5142e15b9295fe8c447dbb39b7907a20177a1413.1685018752.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Vlastimil Babka Cc: Mel Gorman Signed-off-by: Andrew Morton commit 77e50af07f14ea7b53f82f9417ddf2fd96c78da3 Author: Thomas Gleixner Date: Thu May 25 14:57:09 2023 +0200 mm/vmalloc: dont purge usable blocks unnecessarily Purging fragmented blocks is done unconditionally in several contexts: 1) From drain_vmap_area_work(), when the number of lazy to be freed vmap_areas reached the threshold 2) Reclaiming vmalloc address space from pcpu_get_vm_areas() 3) _vm_unmap_aliases() #1 There is no reason to zap fragmented vmap blocks unconditionally, simply because reclaiming all lazy areas drains at least 32MB * fls(num_online_cpus()) per invocation which is plenty. #2 Reclaiming when running out of space or due to memory pressure makes a lot of sense #3 _unmap_aliases() requires to touch everything because the caller has no clue which vmap_area used a particular page last and the vmap_area lost that information too. Except for the vfree + VM_FLUSH_RESET_PERMS case, which removes the vmap area first and then cares about the flush. That in turn requires a full walk of _all_ vmap areas including the one which was just added to the purge list. But as this has to be flushed anyway this is an opportunity to combine outstanding TLB flushes and do the housekeeping of purging freed areas, but like #1 there is no real good reason to zap usable vmap blocks unconditionally. Add a @force_purge argument to the newly split out block purge function and if not true only purge fragmented blocks which have less than 1/4 of their capacity left. Rename purge_vmap_area_lazy() to reclaim_and_purge_vmap_areas() to make it clear what the function does. [lstoakes@gmail.com: correct VMAP_PURGE_THRESHOLD check] Link: https://lkml.kernel.org/r/3e92ef61-b910-4576-88e7-cf43211fd4e7@lucifer.local Link: https://lkml.kernel.org/r/20230525124504.864005691@linutronix.de Signed-off-by: Thomas Gleixner Signed-off-by: Lorenzo Stoakes Reviewed-by: Baoquan He Cc: Christoph Hellwig Cc: Lorenzo Stoakes Cc: Uladzislau Rezki (Sony) Signed-off-by: Andrew Morton commit 7f48121e9fa82bdaf0bd0f7a7e49f48803c6c0e8 Author: Thomas Gleixner Date: Thu May 25 14:57:08 2023 +0200 mm/vmalloc: add missing READ/WRITE_ONCE() annotations purge_fragmented_blocks() accesses vmap_block::free and vmap_block::dirty lockless for a quick check. Add the missing READ/WRITE_ONCE() annotations. Link: https://lkml.kernel.org/r/20230525124504.807356682@linutronix.de Signed-off-by: Thomas Gleixner Reviewed-by: Uladzislau Rezki (Sony) Reviewed-by: Christoph Hellwig Reviewed-by: Baoquan He Cc: Lorenzo Stoakes Signed-off-by: Andrew Morton commit 43d7650234c62201ba3ca5b731226b0b189989a8 Author: Thomas Gleixner Date: Thu May 25 14:57:07 2023 +0200 mm/vmalloc: check free space in vmap_block lockless vb_alloc() unconditionally locks a vmap_block on the free list to check the free space. This can be done locklessly because vmap_block::free never increases, it's only decreased on allocations. Check the free space lockless and only if that succeeds, recheck under the lock. Link: https://lkml.kernel.org/r/20230525124504.750481992@linutronix.de Signed-off-by: Thomas Gleixner Reviewed-by: Uladzislau Rezki (Sony) Reviewed-by: Christoph Hellwig Reviewed-by: Lorenzo Stoakes Reviewed-by: Baoquan He Signed-off-by: Andrew Morton commit a09fad96ffb1d0da007283727235a03b813f989b Author: Thomas Gleixner Date: Thu May 25 14:57:05 2023 +0200 mm/vmalloc: prevent flushing dirty space over and over vmap blocks which have active mappings cannot be purged. Allocations which have been freed are accounted for in vmap_block::dirty_min/max, so that they can be detected in _vm_unmap_aliases() as potentially stale TLBs. If there are several invocations of _vm_unmap_aliases() then each of them will flush the dirty range. That's pointless and just increases the probability of full TLB flushes. Avoid that by resetting the flush range after accounting for it. That's safe versus other invocations of _vm_unmap_aliases() because this is all serialized with vmap_purge_lock. Link: https://lkml.kernel.org/r/20230525124504.692056496@linutronix.de Signed-off-by: Thomas Gleixner Reviewed-by: Baoquan He Reviewed-by: Christoph Hellwig Reviewed-by: Lorenzo Stoakes Cc: Uladzislau Rezki (Sony) Signed-off-by: Andrew Morton commit ca5e46c3400badc418a8fbcaeba711ad60ff4e1b Author: Thomas Gleixner Date: Thu May 25 14:57:04 2023 +0200 mm/vmalloc: avoid iterating over per CPU vmap blocks twice _vunmap_aliases() walks the per CPU xarrays to find partially unmapped blocks and then walks the per cpu free lists to purge fragmented blocks. Arguably that's waste of CPU cycles and cache lines as the full xarray walk already touches every block. Avoid this double iteration: - Split out the code to purge one block and the code to free the local purge list into helper functions. - Try to purge the fragmented blocks in the xarray walk before looking at their dirty space. Link: https://lkml.kernel.org/r/20230525124504.633469722@linutronix.de Signed-off-by: Thomas Gleixner Reviewed-by: Christoph Hellwig Reviewed-by: Baoquan He Cc: Lorenzo Stoakes Cc: Uladzislau Rezki (Sony) Signed-off-by: Andrew Morton commit fc1e0d980037e065441cd1d9a1a5e9c9117e4ba2 Author: Thomas Gleixner Date: Thu May 25 14:57:03 2023 +0200 mm/vmalloc: prevent stale TLBs in fully utilized blocks Patch series "mm/vmalloc: Assorted fixes and improvements", v2. this series addresses the following issues: 1) Prevent the stale TLB problem related to fully utilized vmap blocks 2) Avoid the double per CPU list walk in _vm_unmap_aliases() 3) Avoid flushing dirty space over and over 4) Add a lockless quickcheck in vb_alloc() and add missing READ/WRITE_ONCE() annotations 5) Prevent overeager purging of usable vmap_blocks if not under memory/address space pressure. This patch (of 6): _vm_unmap_aliases() is used to ensure that no unflushed TLB entries for a page are left in the system. This is required due to the lazy TLB flush mechanism in vmalloc. This is tried to achieve by walking the per CPU free lists, but those do not contain fully utilized vmap blocks because they are removed from the free list once the blocks free space became zero. When the block is not fully unmapped then it is not on the purge list either. So neither the per CPU list iteration nor the purge list walk find the block and if the page was mapped via such a block and the TLB has not yet been flushed, the guarantee of _vm_unmap_aliases() that there are no stale TLBs after returning is broken: x = vb_alloc() // Removes vmap_block from free list because vb->free became 0 vb_free(x) // Unmaps page and marks in dirty_min/max range // Block has still mappings and is not put on purge list // Page is reused vm_unmap_aliases() // Can't find vmap block with the dirty space -> FAIL So instead of walking the per CPU free lists, walk the per CPU xarrays which hold pointers to _all_ active blocks in the system including those removed from the free lists. Link: https://lkml.kernel.org/r/20230525122342.109672430@linutronix.de Link: https://lkml.kernel.org/r/20230525124504.573987880@linutronix.de Fixes: db64fe02258f ("mm: rewrite vmap layer") Signed-off-by: Thomas Gleixner Reviewed-by: Christoph Hellwig Reviewed-by: Lorenzo Stoakes Reviewed-by: Uladzislau Rezki (Sony) Reviewed-by: Baoquan He Signed-off-by: Andrew Morton commit dcb8cbb58a218c99aab0dbf3f76cf06a04d44f37 Author: Jim Cromie Date: Thu May 25 11:43:56 2023 -0600 kmemleak-test: drop __init to get better backtrace Drop the __init on kmemleak_test_init(). With it, the storage is reclaimed, but then the symbol isn't available for "%pS" rendering, and the backtrace gets a bare pointer where the actual leak happened. unreferenced object 0xffff88800a2b0800 (size 1024): comm "modprobe", pid 413, jiffies 4294953430 hex dump (first 32 bytes): 73 02 00 00 75 01 00 68 02 00 00 01 00 00 00 04 s...u..h........ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000fabad728>] kmalloc_trace+0x26/0x90 [<00000000ef738764>] 0xffffffffc02350a2 [<00000000004e5795>] do_one_initcall+0x43/0x210 [<00000000d768905e>] do_init_module+0x4a/0x210 [<0000000087135ab5>] __do_sys_finit_module+0x93/0xf0 [<000000004fcb1fa2>] do_syscall_64+0x34/0x80 [<00000000c73c8d9d>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 with __init gone, that trace entry renders like: [<00000000ef738764>] kmemleak_test_init+/ Link: https://lkml.kernel.org/r/20230525174356.69711-1-jim.cromie@gmail.com Signed-off-by: Jim Cromie Acked-by: Catalin Marinas Signed-off-by: Andrew Morton commit d7f1afd0e3ac4c5c703b67d6003b62f760e95ba8 Author: T.J. Alumbaugh Date: Mon May 22 11:20:58 2023 +0000 mm: multi-gen LRU: cleanup lru_gen_test_recent() Avoid passing memcg* and pglist_data* to lru_gen_test_recent() since we only use the lruvec anyway. Link: https://lkml.kernel.org/r/20230522112058.2965866-4-talumbau@google.com Signed-off-by: T.J. Alumbaugh Reviewed-by: Yuanchu Xie Cc: David Hildenbrand Cc: Yu Zhao Signed-off-by: Andrew Morton commit bd02df412cbb9a63e945a647e3dbe4d6f9e06d19 Author: T.J. Alumbaugh Date: Mon May 22 11:20:57 2023 +0000 mm: multi-gen LRU: add helpers in page table walks Add helpers to page table walking code: - Clarifies intent via name "should_walk_mmu" and "should_clear_pmd_young" - Avoids repeating same logic in two places Link: https://lkml.kernel.org/r/20230522112058.2965866-3-talumbau@google.com Signed-off-by: T.J. Alumbaugh Reviewed-by: Yuanchu Xie Cc: David Hildenbrand Cc: Yu Zhao Signed-off-by: Andrew Morton commit 5c7e7a0d79072eb02780a2c0dee730b23cde711d Author: T.J. Alumbaugh Date: Mon May 22 11:20:56 2023 +0000 mm: multi-gen LRU: cleanup lru_gen_soft_reclaim() lru_gen_soft_reclaim() gets the lruvec from the memcg and node ID to keep a cleaner interface on the caller side. Link: https://lkml.kernel.org/r/20230522112058.2965866-2-talumbau@google.com Signed-off-by: T.J. Alumbaugh Reviewed-by: Yuanchu Xie Cc: David Hildenbrand Cc: Yu Zhao Signed-off-by: Andrew Morton commit 0285762c6f161c3a93ffc75ba278aad21719460a Author: T.J. Alumbaugh Date: Mon May 22 11:20:55 2023 +0000 mm: multi-gen LRU: use macro for bitmap Use DECLARE_BITMAP macro when possible. Link: https://lkml.kernel.org/r/20230522112058.2965866-1-talumbau@google.com Signed-off-by: T.J. Alumbaugh Reviewed-by: David Hildenbrand Reviewed-by: Yuanchu Xie Cc: Yu Zhao Signed-off-by: Andrew Morton commit 19ab365762c6cc39dfdee9e13ab0d12fe4b5540d Author: Haifeng Xu Date: Mon May 22 09:52:33 2023 +0000 selftests: cgroup: fix unexpected failure on test_memcg_low Since commit f079a020ba95 ("selftests: memcg: factor out common parts of memory.{low,min} tests"), the value used in second alloc_anon has changed from 148M to 170M. Because memory.low allows reclaiming page cache in child cgroups, so the memory.current is close to 30M instead of 50M. Therefore, adjust the expected value of parent cgroup. Link: https://lkml.kernel.org/r/20230522095233.4246-2-haifeng.xu@shopee.com Fixes: f079a020ba95 ("selftests: memcg: factor out common parts of memory.{low,min} tests") Signed-off-by: Haifeng Xu Cc: Johannes Weiner Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 08e0f49e9991b175f2cda7ba32a7e9f1320dcbad Author: Haifeng Xu Date: Mon May 22 09:52:32 2023 +0000 mm/memcontrol: fix typo in comment Replace 'then' with 'than'. Link: https://lkml.kernel.org/r/20230522095233.4246-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Cc: Johannes Weiner Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit b0cc5e89caadc21c2d8f7dc4c97947761b358876 Author: Andrew Morton Date: Mon May 22 13:52:10 2023 -0700 mm/mlock: rename mlock_future_check() to mlock_future_ok() It is felt that the name mlock_future_check() is vague - it doesn't particularly convey the function's operation. mlock_future_ok() is a clearer name for a predicate function. Acked-by: Vlastimil Babka Cc: Liam Howlett Cc: Lorenzo Stoakes Cc: Mike Rapoport (IBM) Signed-off-by: Andrew Morton commit 3c54a298db4c6b38bbd5f86216ce0f5ad4596ccf Author: Lorenzo Stoakes Date: Mon May 22 09:24:12 2023 +0100 mm/mmap: refactor mlock_future_check() In all but one instance, mlock_future_check() is treated as a boolean function despite returning an error code. In one instance, this error code is ignored and replaced with -ENOMEM. This is confusing, and the inversion of true -> failure, false -> success is not warranted. Convert the function to a bool, lightly refactor and return true if the check passes, false if not. Link: https://lkml.kernel.org/r/20230522082412.56685-1-lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Acked-by: Vlastimil Babka Cc: Liam Howlett Cc: Mike Rapoport (IBM) Signed-off-by: Andrew Morton commit 89207c669bbf464c81e1561d8206f120a679aaf7 Author: David Hildenbrand Date: Fri May 19 12:27:23 2023 +0200 selftests/mm: gup_longterm: add liburing tests Similar to the COW selftests, also use io_uring fixed buffers to test if long-term page pinning works as expected. Link: https://lkml.kernel.org/r/20230519102723.185721-4-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Lorenzo Stoakes Cc: Jan Kara Cc: Jason Gunthorpe Cc: Jens Axboe Cc: John Hubbard Cc: Peter Xu Cc: Shuah Khan Signed-off-by: Andrew Morton commit c879462a08feafe1bc10f34089f39932a2e1d712 Author: David Hildenbrand Date: Fri May 19 12:27:22 2023 +0200 selftests/mm: gup_longterm: new functional test for FOLL_LONGTERM Let's add a new test for checking whether GUP long-term page pinning works as expected (R/O vs. R/W, MAP_PRIVATE vs. MAP_SHARED, GUP vs. GUP-fast). Note that COW handling with long-term R/O pinning in private mappings, and pinning of anonymous memory in general, is tested by the COW selftest. This test, therefore, focuses on page pinning in file mappings. The most interesting case is probably the "local tmpfile" case, as that will likely end up on a "real" filesystem such as ext4 or xfs, not on a virtual one like tmpfs or hugetlb where any long-term page pinning is always expected to succeed. For now, only add tests that use the "/sys/kernel/debug/gup_test" interface. We'll add tests based on liburing separately next. [akpm@linux-foundation.org: update .gitignore for gup_longterm, per Peter] Link: https://lkml.kernel.org/r/20230519102723.185721-3-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Lorenzo Stoakes Cc: Jan Kara Cc: Jason Gunthorpe Cc: Jens Axboe Cc: John Hubbard Cc: Peter Xu Cc: Shuah Khan Signed-off-by: Andrew Morton commit 81b1e3f91d77564611ab10d2c61774cf6a46ec78 Author: David Hildenbrand Date: Fri May 19 12:27:21 2023 +0200 selftests/mm: factor out detection of hugetlb page sizes into vm_util Patch series "selftests/mm: new test for FOLL_LONGTERM on file mappings". Let's add some selftests to make sure that: * R/O long-term pinning always works of file mappings * R/W long-term pinning always works in MAP_PRIVATE file mappings * R/W long-term pinning only works in MAP_SHARED mappings with special filesystems (shmem, hugetlb) and fails with other filesystems (ext4, btrfs, xfs). The tests make use of the gup_test kernel module to trigger ordinary GUP and GUP-fast, and liburing (similar to our COW selftests). Test with memfd, memfd hugetlb, tmpfile() and mkstemp(). The latter usually gives us a "real" filesystem (ext4, btrfs, xfs) where long-term pinning is expected to fail. Note that these selftests don't contain any actual reproducers for data corruptions in case R/W long-term pinning on problematic filesystems "would" work. Maybe we can later come up with a racy !FOLL_LONGTERM reproducer that can reuse an existing interface to trigger short-term pinning (I'll look into that next). On current mm/mm-unstable: # ./gup_longterm # [INFO] detected hugetlb page size: 2048 KiB # [INFO] detected hugetlb page size: 1048576 KiB TAP version 13 1..50 # [RUN] R/W longterm GUP pin in MAP_SHARED file mapping ... with memfd ok 1 Should have worked # [RUN] R/W longterm GUP pin in MAP_SHARED file mapping ... with tmpfile ok 2 Should have worked # [RUN] R/W longterm GUP pin in MAP_SHARED file mapping ... with local tmpfile ok 3 Should have failed # [RUN] R/W longterm GUP pin in MAP_SHARED file mapping ... with memfd hugetlb (2048 kB) ok 4 Should have worked # [RUN] R/W longterm GUP pin in MAP_SHARED file mapping ... with memfd hugetlb (1048576 kB) ok 5 Should have worked # [RUN] R/W longterm GUP-fast pin in MAP_SHARED file mapping ... with memfd ok 6 Should have worked # [RUN] R/W longterm GUP-fast pin in MAP_SHARED file mapping ... with tmpfile ok 7 Should have worked # [RUN] R/W longterm GUP-fast pin in MAP_SHARED file mapping ... with local tmpfile ok 8 Should have failed # [RUN] R/W longterm GUP-fast pin in MAP_SHARED file mapping ... with memfd hugetlb (2048 kB) ok 9 Should have worked # [RUN] R/W longterm GUP-fast pin in MAP_SHARED file mapping ... with memfd hugetlb (1048576 kB) ok 10 Should have worked # [RUN] R/O longterm GUP pin in MAP_SHARED file mapping ... with memfd ok 11 Should have worked # [RUN] R/O longterm GUP pin in MAP_SHARED file mapping ... with tmpfile ok 12 Should have worked # [RUN] R/O longterm GUP pin in MAP_SHARED file mapping ... with local tmpfile ok 13 Should have worked # [RUN] R/O longterm GUP pin in MAP_SHARED file mapping ... with memfd hugetlb (2048 kB) ok 14 Should have worked # [RUN] R/O longterm GUP pin in MAP_SHARED file mapping ... with memfd hugetlb (1048576 kB) ok 15 Should have worked # [RUN] R/O longterm GUP-fast pin in MAP_SHARED file mapping ... with memfd ok 16 Should have worked # [RUN] R/O longterm GUP-fast pin in MAP_SHARED file mapping ... with tmpfile ok 17 Should have worked # [RUN] R/O longterm GUP-fast pin in MAP_SHARED file mapping ... with local tmpfile ok 18 Should have worked # [RUN] R/O longterm GUP-fast pin in MAP_SHARED file mapping ... with memfd hugetlb (2048 kB) ok 19 Should have worked # [RUN] R/O longterm GUP-fast pin in MAP_SHARED file mapping ... with memfd hugetlb (1048576 kB) ok 20 Should have worked # [RUN] R/W longterm GUP pin in MAP_PRIVATE file mapping ... with memfd ok 21 Should have worked # [RUN] R/W longterm GUP pin in MAP_PRIVATE file mapping ... with tmpfile ok 22 Should have worked # [RUN] R/W longterm GUP pin in MAP_PRIVATE file mapping ... with local tmpfile ok 23 Should have worked # [RUN] R/W longterm GUP pin in MAP_PRIVATE file mapping ... with memfd hugetlb (2048 kB) ok 24 Should have worked # [RUN] R/W longterm GUP pin in MAP_PRIVATE file mapping ... with memfd hugetlb (1048576 kB) ok 25 Should have worked # [RUN] R/W longterm GUP-fast pin in MAP_PRIVATE file mapping ... with memfd ok 26 Should have worked # [RUN] R/W longterm GUP-fast pin in MAP_PRIVATE file mapping ... with tmpfile ok 27 Should have worked # [RUN] R/W longterm GUP-fast pin in MAP_PRIVATE file mapping ... with local tmpfile ok 28 Should have worked # [RUN] R/W longterm GUP-fast pin in MAP_PRIVATE file mapping ... with memfd hugetlb (2048 kB) ok 29 Should have worked # [RUN] R/W longterm GUP-fast pin in MAP_PRIVATE file mapping ... with memfd hugetlb (1048576 kB) ok 30 Should have worked # [RUN] R/O longterm GUP pin in MAP_PRIVATE file mapping ... with memfd ok 31 Should have worked # [RUN] R/O longterm GUP pin in MAP_PRIVATE file mapping ... with tmpfile ok 32 Should have worked # [RUN] R/O longterm GUP pin in MAP_PRIVATE file mapping ... with local tmpfile ok 33 Should have worked # [RUN] R/O longterm GUP pin in MAP_PRIVATE file mapping ... with memfd hugetlb (2048 kB) ok 34 Should have worked # [RUN] R/O longterm GUP pin in MAP_PRIVATE file mapping ... with memfd hugetlb (1048576 kB) ok 35 Should have worked # [RUN] R/O longterm GUP-fast pin in MAP_PRIVATE file mapping ... with memfd ok 36 Should have worked # [RUN] R/O longterm GUP-fast pin in MAP_PRIVATE file mapping ... with tmpfile ok 37 Should have worked # [RUN] R/O longterm GUP-fast pin in MAP_PRIVATE file mapping ... with local tmpfile ok 38 Should have worked # [RUN] R/O longterm GUP-fast pin in MAP_PRIVATE file mapping ... with memfd hugetlb (2048 kB) ok 39 Should have worked # [RUN] R/O longterm GUP-fast pin in MAP_PRIVATE file mapping ... with memfd hugetlb (1048576 kB) ok 40 Should have worked # [RUN] io_uring fixed buffer with MAP_SHARED file mapping ... with memfd ok 41 Should have worked # [RUN] io_uring fixed buffer with MAP_SHARED file mapping ... with tmpfile ok 42 Should have worked # [RUN] io_uring fixed buffer with MAP_SHARED file mapping ... with local tmpfile ok 43 Should have failed # [RUN] io_uring fixed buffer with MAP_SHARED file mapping ... with memfd hugetlb (2048 kB) ok 44 Should have worked # [RUN] io_uring fixed buffer with MAP_SHARED file mapping ... with memfd hugetlb (1048576 kB) ok 45 Should have worked # [RUN] io_uring fixed buffer with MAP_PRIVATE file mapping ... with memfd ok 46 Should have worked # [RUN] io_uring fixed buffer with MAP_PRIVATE file mapping ... with tmpfile ok 47 Should have worked # [RUN] io_uring fixed buffer with MAP_PRIVATE file mapping ... with local tmpfile ok 48 Should have worked # [RUN] io_uring fixed buffer with MAP_PRIVATE file mapping ... with memfd hugetlb (2048 kB) ok 49 Should have worked # [RUN] io_uring fixed buffer with MAP_PRIVATE file mapping ... with memfd hugetlb (1048576 kB) ok 50 Should have worked # Totals: pass:50 fail:0 xfail:0 xpass:0 skip:0 error:0 This patch (of 3): Let's factor detection out into vm_util, to be reused by a new test. Link: https://lkml.kernel.org/r/20230519102723.185721-1-david@redhat.com Link: https://lkml.kernel.org/r/20230519102723.185721-2-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Lorenzo Stoakes Cc: Jan Kara Cc: Jason Gunthorpe Cc: Jens Axboe Cc: John Hubbard Cc: Peter Xu Cc: Shuah Khan Signed-off-by: Andrew Morton commit 4fbbb3fde3c69879ceebb33a8edd9d867008728b Author: Johannes Weiner Date: Fri May 19 13:13:59 2023 +0200 mm: compaction: avoid GFP_NOFS ABBA deadlock During stress testing with higher-order allocations, a deadlock scenario was observed in compaction: One GFP_NOFS allocation was sleeping on mm/compaction.c::too_many_isolated(), while all CPUs in the system were busy with compactors spinning on buffer locks held by the sleeping GFP_NOFS allocation. Reclaim is susceptible to this same deadlock; we fixed it by granting GFP_NOFS allocations additional LRU isolation headroom, to ensure it makes forward progress while holding fs locks that other reclaimers might acquire. Do the same here. This code has been like this since compaction was initially merged, and I only managed to trigger this with out-of-tree patches that dramatically increase the contexts that do GFP_NOFS compaction. While the issue is real, it seems theoretical in nature given existing allocation sites. Worth fixing now, but no Fixes tag or stable CC. Link: https://lkml.kernel.org/r/20230519111359.40475-1-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Mel Gorman Acked-by: Vlastimil Babka Cc: Michal Hocko Signed-off-by: Andrew Morton commit 3cf04937529020e149666f56a41ebdeb226b69ed Author: Johannes Weiner Date: Fri Jun 2 11:12:04 2023 -0400 mm: compaction: have compaction_suitable() return bool Since it only returns COMPACT_CONTINUE or COMPACT_SKIPPED now, a bool return value simplifies the callsites. Link: https://lkml.kernel.org/r/20230602151204.GD161817@cmpxchg.org Signed-off-by: Johannes Weiner Suggested-by: Vlastimil Babka Acked-by: Vlastimil Babka Cc: Baolin Wang Cc: Mel Gorman Cc: Michal Hocko Signed-off-by: Andrew Morton commit 1c9568e806a589da84b7afbdf0619b2c1f6c102a Author: Johannes Weiner Date: Fri May 19 14:39:59 2023 +0200 mm: compaction: drop redundant watermark check in compaction_zonelist_suitable() The watermark check in compaction_zonelist_suitable(), called from should_compact_retry(), is sandwiched between two watermark checks already: before, there are freelist attempts as part of direct reclaim and direct compaction; after, there is a last-minute freelist attempt in __alloc_pages_may_oom(). The check in compaction_zonelist_suitable() isn't necessary. Kill it. Link: https://lkml.kernel.org/r/20230519123959.77335-6-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Vlastimil Babka Cc: Mel Gorman Cc: Michal Hocko Cc: Baolin Wang Signed-off-by: Andrew Morton commit f98a497e1f16ee411df72629e32e31cba4cfa9cf Author: Johannes Weiner Date: Fri May 19 14:39:58 2023 +0200 mm: compaction: remove unnecessary is_via_compact_memory() checks Remove from all paths not reachable via /proc/sys/vm/compact_memory. Link: https://lkml.kernel.org/r/20230519123959.77335-5-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Vlastimil Babka Cc: Mel Gorman Cc: Michal Hocko Cc: Baolin Wang Signed-off-by: Andrew Morton commit e8606320e9af9774fd879e71c940fc9e5fd9b901 Author: Johannes Weiner Date: Fri May 19 14:39:57 2023 +0200 mm: compaction: refactor __compaction_suitable() __compaction_suitable() is supposed to check for available migration targets. However, it also checks whether the operation was requested via /proc/sys/vm/compact_memory, and whether the original allocation request can already succeed. These don't apply to all callsites. Move the checks out to the callers, so that later patches can deal with them one by one. No functional change intended. [hannes@cmpxchg.org: fix comment, per Vlastimil] Link: https://lkml.kernel.org/r/20230602144942.GC161817@cmpxchg.org Link: https://lkml.kernel.org/r/20230519123959.77335-4-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Vlastimil Babka Cc: Mel Gorman Cc: Michal Hocko Signed-off-by: Andrew Morton commit 511a69b27fe6c2d7312789bd9e2e40b00e3903ef Author: Johannes Weiner Date: Fri May 19 14:39:56 2023 +0200 mm: compaction: simplify should_compact_retry() The different branches for retry are unnecessarily complicated. There are really only three outcomes: progress (retry n times), skipped (retry if reclaim can help), failed (retry with higher priority). Rearrange the branches and the retry counter to make it simpler. [hannes@cmpxchg.org: restore behavior when hitting max_retries] Link: https://lkml.kernel.org/r/20230602144705.GB161817@cmpxchg.org Link: https://lkml.kernel.org/r/20230519123959.77335-3-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Vlastimil Babka Cc: Mel Gorman Cc: Michal Hocko Signed-off-by: Andrew Morton commit ecd8b2928f2efc7b678b361d51920c15b5ef3885 Author: Johannes Weiner Date: Fri May 19 14:39:55 2023 +0200 mm: compaction: remove compaction result helpers Patch series "mm: compaction: cleanups & simplifications". These compaction cleanups are split out from the huge page allocator series[1], as requested by reviewer feedback. [1] https://lore.kernel.org/linux-mm/20230418191313.268131-1-hannes@cmpxchg.org/ This patch (of 5): The compaction result helpers encode quirks that are specific to the allocator's retry logic. E.g. COMPACT_SUCCESS and COMPACT_COMPLETE actually represent failures that should be retried upon, and so on. I frequently found myself pulling up the helper implementation in order to understand and work on the retry logic. They're not quite clean abstractions; rather they split the retry logic into two locations. Remove the helpers and inline the checks. Then comment on the result interpretations directly where the decision making happens. Link: https://lkml.kernel.org/r/20230519123959.77335-1-hannes@cmpxchg.org Link: https://lkml.kernel.org/r/20230519123959.77335-2-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Vlastimil Babka Cc: Mel Gorman Cc: Michal Hocko Signed-off-by: Andrew Morton commit 62069aace145658bc8ce79cbf7b6cf611db4a22f Author: Tom Rix Date: Thu May 18 10:11:19 2023 -0400 mm: page_alloc: set sysctl_lowmem_reserve_ratio storage-class-specifier to static smatch reports mm/page_alloc.c:247:5: warning: symbol 'sysctl_lowmem_reserve_ratio' was not declared. Should it be static? This variable is only used in its defining file, so it should be static Link: https://lkml.kernel.org/r/20230518141119.927074-1-trix@redhat.com Signed-off-by: Tom Rix Signed-off-by: Andrew Morton commit 5c1c03de1b1636f041a275e777171307cac8d958 Author: Liam R. Howlett Date: Thu May 18 10:55:44 2023 -0400 mm: avoid rewalk in mmap_region If the iterator has moved to the previous entry, then step forward one range, back to the gap. Link: https://lkml.kernel.org/r/20230518145544.1722059-36-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit bb5dbd2272b8d7b3a34d234bb916819afbf802d1 Author: Liam R. Howlett Date: Thu May 18 10:55:43 2023 -0400 mm: add vma_iter_{next,prev}_range() to vma iterator Add functionality to the VMA iterator to advance and retreat one offset within the maple tree, regardless of the value contained. This can lead to less re-walking to find an area of interest, especially when there is nothing in that offset. Link: https://lkml.kernel.org/r/20230518145544.1722059-35-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit eb2e817f38cafbf776ffec9b273aaada6ffc274d Author: Liam R. Howlett Date: Thu May 18 10:55:42 2023 -0400 maple_tree: update testing code for mas_{next,prev,walk} Now that the functions have changed the limits, update the testing of the maple tree to test these new settings. Link: https://lkml.kernel.org/r/20230518145544.1722059-34-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 6b23a290611df5312eba08bf5176cbf96a5d81f7 Author: Liam R. Howlett Date: Thu May 18 10:55:41 2023 -0400 maple_tree: clear up index and last setting in single entry tree When there is a single entry tree (range of 0-0 pointing to an entry), then ensure the limit is either 0-0 or 1-oo, depending on where the user walks. Ensure the correct node setting as well; either MAS_ROOT or MAS_NONE. Link: https://lkml.kernel.org/r/20230518145544.1722059-33-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: Peng Zhang Cc: David Binderman Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 6b9e93e0102048e64681c2fa265ae81c221f6c6d Author: Liam R. Howlett Date: Thu May 18 10:55:40 2023 -0400 maple_tree: add mas_prev_range() and mas_find_range_rev interface Some users of the maple tree may want to move to the previous range regardless of the value stored there. Add this interface as well as the 'find' variant to support walking to the first value, then iterating over the previous ranges. Link: https://lkml.kernel.org/r/20230518145544.1722059-32-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: Vernon Yang Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Wei Yang Signed-off-by: Andrew Morton commit dd9a85138280d8caef2de6d3e533ee286ca200d6 Author: Liam R. Howlett Date: Thu May 18 10:55:39 2023 -0400 maple_tree: introduce mas_prev_slot() interface Sometimes the user needs to revert to the previous slot, regardless of if it is empty or not. Add an interface to go to the previous slot. Since there can't be two consecutive NULLs in the tree, the mas_prev() function can be implemented by calling mas_prev_slot() a maximum of 2 times. Change the underlying interface to use mas_prev_slot() to align the code. Link: https://lkml.kernel.org/r/20230518145544.1722059-31-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit de6e386c060cdb66880882327dc7136bda0b3925 Author: Liam R. Howlett Date: Thu May 18 10:55:38 2023 -0400 maple_tree: relocate mas_rewalk() and mas_rewalk_if_dead() These functions need to move for future use. Link: https://lkml.kernel.org/r/20230518145544.1722059-30-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 6169b553195a193c52a675e45a9578f595fe194f Author: Liam R. Howlett Date: Thu May 18 10:55:37 2023 -0400 maple_tree: add mas_next_range() and mas_find_range() interfaces Some users of the maple tree may want to move to the next range in the tree, even if it stores a NULL. This family of function provides that functionality by advancing one slot at a time and returning the result, while mas_contiguous() will iterate over the range and stop on encountering the first NULL. Link: https://lkml.kernel.org/r/20230518145544.1722059-29-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit fff4a58cc00b3baef860c82d6e5e149f71c79d44 Author: Liam R. Howlett Date: Thu May 18 10:55:36 2023 -0400 maple_tree: introduce mas_next_slot() interface Sometimes, during a tree walk, the user needs the next slot regardless of if it is empty or not. Add an interface to get the next slot. Since there are no consecutive NULLs allowed in the tree, the mas_next() function can only advance two slots at most. So use the new mas_next_slot() interface to align both implementations. Use this method for mas_find() as well. Link: https://lkml.kernel.org/r/20230518145544.1722059-28-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 17e7436bd327364d46f75d40fd093120ca533b7e Author: Liam R. Howlett Date: Thu May 18 10:55:35 2023 -0400 maple_tree: fix testing mas_empty_area() Empty area will return -EINVAL if the search window is smaller than the requested size. Fix the test case to check for this error code. Link: https://lkml.kernel.org/r/20230518145544.1722059-27-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit ba9972121ab26a53c917ddb141738aa0e559685e Author: Liam R. Howlett Date: Thu May 18 10:55:34 2023 -0400 maple_tree: revise limit checks in mas_empty_area{_rev}() Since the maple tree is inclusive in range, ensure that a range of 1 (min = max) works for searching for a gap in either direction, and make sure the size is at least 1 but not larger than the delta between min and max. This commit also updates the testing. Unfortunately there isn't a way to safely update the tests and code without a test failure. Link: https://lkml.kernel.org/r/20230518145544.1722059-26-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Suggested-by: Peng Zhang Cc: David Binderman Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 39193685d585e573592e58204c445bfc5c3cafb3 Author: Liam R. Howlett Date: Thu May 18 10:55:33 2023 -0400 maple_tree: try harder to keep active node with mas_prev() Keep a reference to the node when possible with mas_prev(). This will avoid re-walking the tree. In keeping a reference to the node, keep the last/index accurate to the range being referenced. This means the limit may be within the range, but the range may extend outside of the limit. Also fix the single entry tree to respect the range (of 0), or set the node to MAS_NONE in the case of shifting beyond 0. Link: https://lkml.kernel.org/r/20230518145544.1722059-25-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit ca80f610045d3fe57c1b43909c79d0c51badca27 Author: Liam R. Howlett Date: Thu May 18 10:55:32 2023 -0400 maple_tree: try harder to keep active node after mas_next() Clean up the mas_next() call to try and keep a node reference when possible. This will avoid re-walking the tree in most cases. Also clean up the single entry tree handling to ensure index/last are consistent with what one would expect. (returning NULL with limit of 1-oo). Link: https://lkml.kernel.org/r/20230518145544.1722059-24-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 15c0c60b8cee4a6db263585520f994654429fac3 Author: Liam R. Howlett Date: Thu May 18 10:55:31 2023 -0400 mm/mmap: change do_vmi_align_munmap() for maple tree iterator changes The maple tree iterator clean up is incompatible with the way do_vmi_align_munmap() expects it to behave. Update the expected behaviour to map now since the change will work currently. Link: https://lkml.kernel.org/r/20230518145544.1722059-23-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit d04118605f65929003c2a71229d45fee00207a1b Author: Liam R. Howlett Date: Thu May 18 10:55:30 2023 -0400 maple_tree: mas_start() reset depth on dead node When a dead node is detected, the depth has already been set to 1 so reset it to 0. Link: https://lkml.kernel.org/r/20230518145544.1722059-22-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reviewed-by: Peng Zhang Cc: David Binderman Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 23e734ecd97fb0dec1537960040e7ef0d5ef7ae6 Author: Liam R. Howlett Date: Thu May 18 10:55:29 2023 -0400 maple_tree: remove unnecessary check from mas_destroy() mas_destroy currently checks if mas->node is MAS_START prior to calling mas_start(), but this is unnecessary as mas_start() will do nothing if the node is anything but MAS_START. Link: https://lkml.kernel.org/r/20230518145544.1722059-21-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reviewed-by: Peng Zhang Cc: David Binderman Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit eaf9790d3bc6e157a2134c01c7d707a5a712fab1 Author: Liam R. Howlett Date: Thu May 18 10:55:28 2023 -0400 maple_tree: add __init and __exit to test module The test functions are not needed after the module is removed, so mark them as such. Add __exit to the module removal function. Some other variables have been marked as const static as well. Link: https://lkml.kernel.org/r/20230518145544.1722059-20-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Suggested-by: Andrew Morton Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 36bd931049bf93a4eaec4a558beca477db152881 Author: Liam R. Howlett Date: Thu May 18 10:55:27 2023 -0400 mm: update vma_iter_store() to use MAS_WARN_ON() MAS_WARN_ON() will provide more information on the maple state and can be more useful for debugging. Use this version of WARN_ON() in the debugging code when storing to the tree. Update the printk to a pr_warn(), but this will only be printed when maple tree debug is enabled anyways. Making all print statements into one will keep them together on a busy terminal. Link: https://lkml.kernel.org/r/20230518145544.1722059-19-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reviewed-by: Sergey Senozhatsky Cc: David Binderman Cc: Peng Zhang Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit b50e195ff436625b26dcc9839bc52cc7c5bf1a54 Author: Liam R. Howlett Date: Thu May 18 10:55:26 2023 -0400 mm: update validate_mm() to use vma iterator Use the vma iterator in the validation code and combine the code to check the maple tree into the main validate_mm() function. Introduce a new function vma_iter_dump_tree() to dump the maple tree in hex layout. Replace all calls to validate_mm_mt() with validate_mm(). [Liam.Howlett@oracle.com: update validate_mm() to use vma iterator CONFIG flag] Link: https://lkml.kernel.org/r/20230606183538.588190-1-Liam.Howlett@oracle.com Link: https://lkml.kernel.org/r/20230518145544.1722059-18-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit a5199577b1ddae696528d7e4e7a406d5a8f23a7b Author: Liam R. Howlett Date: Thu May 18 10:55:25 2023 -0400 maple_tree: make test code work without debug enabled The test code is less useful without debug, but can still do general validations. Define mt_dump(), mas_dump() and mas_wr_dump() as a noop if debug is not enabled and document it in the test module information that more information can be obtained with another kernel config option. MT_BUG_ON() will report a failures without tree dumps, and the output will be less useful. Link: https://lkml.kernel.org/r/20230518145544.1722059-17-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit acd4de60dd356ffef57149237d9d727325a4f8ef Author: Liam R. Howlett Date: Thu May 18 10:55:24 2023 -0400 maple_tree: return error on mte_pivots() out of range Rename mte_pivots() to mas_pivots() and pass through the ma_state to set the error code to -EIO when the offset is out of range for the node type. Change the WARN_ON() to MAS_WARN_ON() to log the maple state. Link: https://lkml.kernel.org/r/20230518145544.1722059-16-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reviewed-by: Peng Zhang Cc: David Binderman Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit bec1b51efbe71616742a6290aa6a56def80ba90e Author: Liam R. Howlett Date: Thu May 18 10:55:23 2023 -0400 maple_tree: use MAS_BUG_ON() prior to calling mas_meta_gap() Replace the call to BUG_ON() in mas_meta_gap() with calls before the function call MAS_BUG_ON() to get more information on error condition. Link: https://lkml.kernel.org/r/20230518145544.1722059-15-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 1c414c6a4b232245153a2de90106e0fba62ed78e Author: Liam R. Howlett Date: Thu May 18 10:55:22 2023 -0400 maple_tree: use MAS_WR_BUG_ON() in mas_store_prealloc() mas_store_prealloc() should never fail, but if it does due to internal tree issues then get as much debug information as possible prior to crashing the kernel. Link: https://lkml.kernel.org/r/20230518145544.1722059-14-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 4bbd1748c14ec9c14b9e4b91442e5d27b9833637 Author: Liam R. Howlett Date: Thu May 18 10:55:21 2023 -0400 maple_tree: use MAS_BUG_ON() from mas_topiary_range() In the even of trying to remove data from a leaf node by use of mas_topiary_range(), log the maple state. Link: https://lkml.kernel.org/r/20230518145544.1722059-13-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 5950ada963a6e26f318e54f873a4cc5769c1a3da Author: Liam R. Howlett Date: Thu May 18 10:55:20 2023 -0400 maple_tree: use MAS_BUG_ON() in mas_set_height() Use MAS_BUG_ON() instead of MT_BUG_ON() to get the maple state information. In the unlikely event of a tree height of > 31, try to increase the probability of useful information being logged. Link: https://lkml.kernel.org/r/20230518145544.1722059-12-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit bf96715eb485dd51bb783502694c3dfc63da923e Author: Liam R. Howlett Date: Thu May 18 10:55:19 2023 -0400 maple_tree: use MAS_BUG_ON() when setting a leaf node as a parent Use MAS_BUG_ON() to dump the maple state and tree in the unlikely event of an issue. Link: https://lkml.kernel.org/r/20230518145544.1722059-11-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit e6d6792a5c5156c60e9e4fea7d3bd5c5fec4d872 Author: Liam R. Howlett Date: Thu May 18 10:55:18 2023 -0400 maple_tree: convert debug code to use MT_WARN_ON() and MAS_WARN_ON() Using MT_WARN_ON() allows for the removal of if statements before logging. Using MAS_WARN_ON() will provide more information when issues are encountered. Link: https://lkml.kernel.org/r/20230518145544.1722059-10-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 7f2f9dc16fee59afdec2df8c794e97c36e387257 Author: Liam R. Howlett Date: Thu May 18 10:55:17 2023 -0400 maple_tree: change RCU checks to WARN_ON() instead of BUG_ON() If RCU is enabled and the tree isn't locked, just warn the user and avoid crashing the kernel. Link: https://lkml.kernel.org/r/20230518145544.1722059-9-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 0d7c52bb29302bf06e6774f4d6494e942213205e Author: Liam R. Howlett Date: Thu May 18 10:55:16 2023 -0400 maple_tree: convert BUG_ON() to MT_BUG_ON() Use MT_BUG_ON() to get more information when running with MAPLE_TREE_DEBUG enabled. Link: https://lkml.kernel.org/r/20230518145544.1722059-8-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit f0a1f866aba1ca62ef6f17d1c441eba65f2d6845 Author: Liam R. Howlett Date: Thu May 18 10:55:15 2023 -0400 maple_tree: add debug BUG_ON and WARN_ON variants Add debug macros to dump the maple state and/or the tree for both warning and bug_on calls. Link: https://lkml.kernel.org/r/20230518145544.1722059-7-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 89f499f35c11af61ba7075ddc23209d10805a25a Author: Liam R. Howlett Date: Thu May 18 10:55:14 2023 -0400 maple_tree: add format option to mt_dump() Allow different formatting strings to be used when dumping the tree. Currently supports hex and decimal. Link: https://lkml.kernel.org/r/20230518145544.1722059-6-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit c3eb787e88e486eefcfafbf990df32c75018ca92 Author: Liam R. Howlett Date: Thu May 18 10:55:13 2023 -0400 maple_tree: clean up mas_dfs_postorder() Convert loop type to ensure all variables are set to make the compiler happy, and use the mas_is_none() function instead of explicitly checking the node in the maple state. Link: https://lkml.kernel.org/r/20230518145544.1722059-5-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 633769c9267fadadffd31e27655bf028538238ad Author: Liam R. Howlett Date: Thu May 18 10:55:12 2023 -0400 maple_tree: avoid unnecessary ascending The maple tree node limits are implied by the parent. When walking up the tree, the limit may not be known until a slot that does not have implied limits are encountered. However, if the node is the left-most or right-most node, the walking up to find that limit can be skipped. This commit also fixes the debug/testing code that was not setting the limit on walking down the tree as that optimization is not compatible with this change. Link: https://lkml.kernel.org/r/20230518145544.1722059-4-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reviewed-by: Peng Zhang Cc: David Binderman Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit afc754c651b87093cd3293954f09fae589402fb0 Author: Liam R. Howlett Date: Thu May 18 10:55:11 2023 -0400 maple_tree: clean up mas_parent_enum() and rename to mas_parent_type() mas_parent_enum() is a simple wrapper for mte_parent_enum() which is only called from that wrapper. Remove the wrapper and inline mte_parent_enum() into mas_parent_enum(). At the same time, clean up the bit masking of the root pointer since it cannot be set by the time the bit masking occurs. Change the check on the root bit to a WARN_ON(), and fix the verification code to not trigger the WARN_ON() before checking if the node is root. Align the name to mas_parent_type() since mas_node_type() exists already. Link: https://lkml.kernel.org/r/20230518145544.1722059-3-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reported-by: Wei Yang Reviewed-by: Wei Yang Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Signed-off-by: Andrew Morton commit 5729e06c819184b7ba40869c1ad53e1a463040b2 Author: Liam R. Howlett Date: Thu May 18 10:55:10 2023 -0400 maple_tree: fix static analyser cppcheck issue Patch series "Maple tree mas_{next,prev}_range() and cleanup", v4. This patchset contains a number of clean ups to the code to make it more usable (next/prev range), the addition of debug output formatting, the addition of printing the maple state information in the WARN_ON/BUG_ON code. There is also work done here to keep nodes active during iterations to reduce the necessity of re-walking the tree. Finally, there is a new interface added to move to the next or previous range in the tree, even if it is empty. The organisation of the patches is as follows: 0001-0004 - Small clean ups 0005-0018 - Additional debug options and WARN_ON/BUG_ON changes 0019 - Test module __init and __exit addition 0020-0021 - More functional clean ups 0022-0026 - Changes to keep nodes active 0027-0034 - Add new mas_{prev,next}_range() 0035 - Use new mas_{prev,next}_range() in mmap_region() This patch (of 35): Static analyser of the maple tree code noticed that the split variable is being used to dereference into an array prior to checking the variable itself. Fix this issue by changing the order of the statement to check the variable first. Link: https://lkml.kernel.org/r/20230518145544.1722059-1-Liam.Howlett@oracle.com Link: https://lkml.kernel.org/r/20230518145544.1722059-2-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reported-by: David Binderman Reviewed-by: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton commit 4e096ae1801e24b338e02715c65c3ffa8883ba5d Author: Matthew Wilcox (Oracle) Date: Sat May 13 01:11:01 2023 +0100 mm: convert migrate_pages() to work on folios Almost all of the callers & implementors of migrate_pages() were already converted to use folios. compaction_alloc() & compaction_free() are trivial to convert a part of this patch and not worth splitting out. Link: https://lkml.kernel.org/r/20230513001101.276972-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: "Huang, Ying" Signed-off-by: Andrew Morton commit b2cac248191b7466c5819e0da617b0705a26e197 Author: Lorenzo Stoakes Date: Wed May 17 20:25:48 2023 +0100 mm/gup: remove vmas array from internal GUP functions Now we have eliminated all callers to GUP APIs which use the vmas parameter, eliminate it altogether. This eliminates a class of bugs where vmas might have been kept around longer than the mmap_lock and thus we need not be concerned about locks being dropped during this operation leaving behind dangling pointers. This simplifies the GUP API and makes it considerably clearer as to its purpose - follow flags are applied and if pinning, an array of pages is returned. Link: https://lkml.kernel.org/r/6811b4b2b4b3baf3dd07f422bb18853bb2cd09fb.1684350871.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Acked-by: David Hildenbrand Reviewed-by: Christoph Hellwig Cc: Catalin Marinas Cc: Christian König Cc: Dennis Dalessandro Cc: Greg Kroah-Hartman Cc: Janosch Frank Cc: Jarkko Sakkinen Cc: Jason Gunthorpe Cc: Jens Axboe Cc: Matthew Wilcox (Oracle) Cc: Sakari Ailus Cc: Sean Christopherson Signed-off-by: Andrew Morton commit 4c630f307455c06f99bdeca7f7a1ab5318604fe0 Author: Lorenzo Stoakes Date: Wed May 17 20:25:45 2023 +0100 mm/gup: remove vmas parameter from pin_user_pages() We are now in a position where no caller of pin_user_pages() requires the vmas parameter at all, so eliminate this parameter from the function and all callers. This clears the way to removing the vmas parameter from GUP altogether. Link: https://lkml.kernel.org/r/195a99ae949c9f5cb589d2222b736ced96ec199a.1684350871.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Acked-by: David Hildenbrand Acked-by: Dennis Dalessandro [qib] Reviewed-by: Christoph Hellwig Acked-by: Sakari Ailus [drivers/media] Cc: Catalin Marinas Cc: Christian König Cc: Greg Kroah-Hartman Cc: Janosch Frank Cc: Jarkko Sakkinen Cc: Jason Gunthorpe Cc: Jens Axboe Cc: Matthew Wilcox (Oracle) Cc: Sean Christopherson Signed-off-by: Andrew Morton commit 34ed8d0dcd692378f1155fe27648f54f99adbfbf Author: Lorenzo Stoakes Date: Wed May 17 20:25:42 2023 +0100 io_uring: rsrc: delegate VMA file-backed check to GUP Now that the GUP explicitly checks FOLL_LONGTERM pin_user_pages() for broken file-backed mappings in "mm/gup: disallow FOLL_LONGTERM GUP-nonfast writing to file-backed mappings", there is no need to explicitly check VMAs for this condition, so simply remove this logic from io_uring altogether. Link: https://lkml.kernel.org/r/e4a4efbda9cd12df71e0ed81796dc630231a1ef2.1684350871.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Christoph Hellwig Reviewed-by: Jens Axboe Reviewed-by: David Hildenbrand Cc: Catalin Marinas Cc: Christian König Cc: Dennis Dalessandro Cc: Greg Kroah-Hartman Cc: Janosch Frank Cc: Jarkko Sakkinen Cc: Jason Gunthorpe Cc: Matthew Wilcox (Oracle) Cc: Sakari Ailus Cc: Sean Christopherson Signed-off-by: Andrew Morton commit ca5e863233e8f6acd1792fd85d6bc2729a1b2c10 Author: Lorenzo Stoakes Date: Wed May 17 20:25:39 2023 +0100 mm/gup: remove vmas parameter from get_user_pages_remote() The only instances of get_user_pages_remote() invocations which used the vmas parameter were for a single page which can instead simply look up the VMA directly. In particular:- - __update_ref_ctr() looked up the VMA but did nothing with it so we simply remove it. - __access_remote_vm() was already using vma_lookup() when the original lookup failed so by doing the lookup directly this also de-duplicates the code. We are able to perform these VMA operations as we already hold the mmap_lock in order to be able to call get_user_pages_remote(). As part of this work we add get_user_page_vma_remote() which abstracts the VMA lookup, error handling and decrementing the page reference count should the VMA lookup fail. This forms part of a broader set of patches intended to eliminate the vmas parameter altogether. [akpm@linux-foundation.org: avoid passing NULL to PTR_ERR] Link: https://lkml.kernel.org/r/d20128c849ecdbf4dd01cc828fcec32127ed939a.1684350871.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Catalin Marinas (for arm64) Acked-by: David Hildenbrand Reviewed-by: Janosch Frank (for s390) Reviewed-by: Christoph Hellwig Cc: Christian König Cc: Dennis Dalessandro Cc: Greg Kroah-Hartman Cc: Jarkko Sakkinen Cc: Jason Gunthorpe Cc: Jens Axboe Cc: Matthew Wilcox (Oracle) Cc: Sakari Ailus Cc: Sean Christopherson Signed-off-by: Andrew Morton commit 0b295316b3a9b7858eafbebdc31b4827a6edde03 Author: Lorenzo Stoakes Date: Wed May 17 20:25:36 2023 +0100 mm/gup: remove unused vmas parameter from pin_user_pages_remote() No invocation of pin_user_pages_remote() uses the vmas parameter, so remove it. This forms part of a larger patch set eliminating the use of the vmas parameters altogether. Link: https://lkml.kernel.org/r/28f000beb81e45bf538a2aaa77c90f5482b67a32.1684350871.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Acked-by: David Hildenbrand Reviewed-by: Jason Gunthorpe Reviewed-by: Christoph Hellwig Cc: Catalin Marinas Cc: Christian König Cc: Dennis Dalessandro Cc: Greg Kroah-Hartman Cc: Janosch Frank Cc: Jarkko Sakkinen Cc: Jens Axboe Cc: Matthew Wilcox (Oracle) Cc: Sakari Ailus Cc: Sean Christopherson Signed-off-by: Andrew Morton commit 54d020692b342f7bd02d7f5795fb5c401caecfcc Author: Lorenzo Stoakes Date: Wed May 17 20:25:33 2023 +0100 mm/gup: remove unused vmas parameter from get_user_pages() Patch series "remove the vmas parameter from GUP APIs", v6. (pin_/get)_user_pages[_remote]() each provide an optional output parameter for an array of VMA objects associated with each page in the input range. These provide the means for VMAs to be returned, as long as mm->mmap_lock is never released during the GUP operation (i.e. the internal flag FOLL_UNLOCKABLE is not specified). In addition, these VMAs can only be accessed with the mmap_lock held and become invalidated the moment it is released. The vast majority of invocations do not use this functionality and of those that do, all but one case retrieve a single VMA to perform checks upon. It is not egregious in the single VMA cases to simply replace the operation with a vma_lookup(). In these cases we duplicate the (fast) lookup on a slow path already under the mmap_lock, abstracted to a new get_user_page_vma_remote() inline helper function which also performs error checking and reference count maintenance. The special case is io_uring, where io_pin_pages() specifically needs to assert that the VMAs underlying the range do not result in broken long-term GUP file-backed mappings. As GUP now internally asserts that FOLL_LONGTERM mappings are not file-backed in a broken fashion (i.e. requiring dirty tracking) - as implemented in "mm/gup: disallow FOLL_LONGTERM GUP-nonfast writing to file-backed mappings" - this logic is no longer required and so we can simply remove it altogether from io_uring. Eliminating the vmas parameter eliminates an entire class of danging pointer errors that might have occured should the lock have been incorrectly released. In addition, the API is simplified and now clearly expresses what it is intended for - applying the specified GUP flags and (if pinning) returning pinned pages. This change additionally opens the door to further potential improvements in GUP and the possible marrying of disparate code paths. I have run this series against gup_test with no issues. Thanks to Matthew Wilcox for suggesting this refactoring! This patch (of 6): No invocation of get_user_pages() use the vmas parameter, so remove it. The GUP API is confusing and caveated. Recent changes have done much to improve that, however there is more we can do. Exporting vmas is a prime target as the caller has to be extremely careful to preclude their use after the mmap_lock has expired or otherwise be left with dangling pointers. Removing the vmas parameter focuses the GUP functions upon their primary purpose - pinning (and outputting) pages as well as performing the actions implied by the input flags. This is part of a patch series aiming to remove the vmas parameter altogether. Link: https://lkml.kernel.org/r/cover.1684350871.git.lstoakes@gmail.com Link: https://lkml.kernel.org/r/589e0c64794668ffc799651e8d85e703262b1e9d.1684350871.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Suggested-by: Matthew Wilcox (Oracle) Acked-by: Greg Kroah-Hartman Acked-by: David Hildenbrand Reviewed-by: Jason Gunthorpe Acked-by: Christian König (for radeon parts) Acked-by: Jarkko Sakkinen Reviewed-by: Christoph Hellwig Acked-by: Sean Christopherson (KVM) Cc: Catalin Marinas Cc: Dennis Dalessandro Cc: Janosch Frank Cc: Jens Axboe Cc: Sakari Ailus Signed-off-by: Andrew Morton commit f6797adff7f09b4d7f7607c99116409b5ddb54d9 Author: Sidhartha Kumar Date: Tue May 16 15:52:05 2023 -0700 mm/hugetlb: remove hugetlb_page_subpool() All users of hugetlb_page_subpool() have been converted to use the folio equivalent. This function can be safely removed. Link: https://lkml.kernel.org/r/20230516225205.1429196-1-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Reviewed-by: David Hildenbrand Reviewed-by: Mike Kravetz Cc: Matthew Wilcox (Oracle) Cc: Muchun Song Signed-off-by: Andrew Morton commit ecbb490d8ee38fd84a0d682282589ff723dc62c0 Author: Kefeng Wang Date: Tue May 16 14:38:21 2023 +0800 mm: page_alloc: move is_check_pages_enabled() into page_alloc.c The is_check_pages_enabled() only used in page_alloc.c, move it into page_alloc.c, also use it in free_tail_page_prepare(). Link: https://lkml.kernel.org/r/20230516063821.121844-14-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Mike Rapoport (IBM) Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit e95d372c4cd46b6ec4eeacc07adcb7260ab4cfa0 Author: Kefeng Wang Date: Tue May 16 14:38:20 2023 +0800 mm: page_alloc: move sysctls into it own fils This moves all page alloc related sysctls to its own file, as part of the kernel/sysctl.c spring cleaning, also move some functions declarations from mm.h into internal.h. Link: https://lkml.kernel.org/r/20230516063821.121844-13-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Mike Rapoport (IBM) Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit 5221b5a89340f63dafa4d5f38537efb1ad506f15 Author: Kefeng Wang Date: Tue May 16 14:38:19 2023 +0800 mm: vmscan: use gfp_has_io_fs() Use gfp_has_io_fs() instead of open-code. Link: https://lkml.kernel.org/r/20230516063821.121844-12-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Mike Rapoport (IBM) Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit 07f44ac3c90c50a201307d3fe4dda120ee8394f5 Author: Kefeng Wang Date: Tue May 16 14:38:18 2023 +0800 mm: page_alloc: move pm_* function into power pm_restrict_gfp_mask()/pm_restore_gfp_mask() only used in power, let's move them out of page_alloc.c. Adding a general gfp_has_io_fs() function which return true if gfp with both __GFP_IO and __GFP_FS flags, then use it inside of pm_suspended_storage(), also the pm_suspended_storage() is moved into suspend.h. Link: https://lkml.kernel.org/r/20230516063821.121844-11-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Mike Rapoport (IBM) Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit 31a1b9d7fe768db521b12287ec6426983e9787e3 Author: Kefeng Wang Date: Tue May 16 14:38:17 2023 +0800 mm: page_alloc: move mark_free_page() into snapshot.c The mark_free_page() is only used in kernel/power/snapshot.c, move it out to reduce a bit of page_alloc.c Link: https://lkml.kernel.org/r/20230516063821.121844-10-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Mike Rapoport (IBM) Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit 884c175f12ce1fabff18ac113349628149fc6cf2 Author: Kefeng Wang Date: Tue May 16 14:38:16 2023 +0800 mm: page_alloc: split out DEBUG_PAGEALLOC Move DEBUG_PAGEALLOC related functions into a single file to reduce a bit of page_alloc.c. Link: https://lkml.kernel.org/r/20230516063821.121844-9-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Mike Rapoport (IBM) Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit 0866e82e40fba45dae07e6e8385929b574201752 Author: Kefeng Wang Date: Tue May 16 14:38:15 2023 +0800 mm: page_alloc: split out FAIL_PAGE_ALLOC ... to a single file to reduce a bit of page_alloc.c. Link: https://lkml.kernel.org/r/20230516063821.121844-8-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Mike Rapoport (IBM) Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit e9f2b529e10f9ca8d25ac83e574e027d504de879 Author: Kefeng Wang Date: Tue May 16 14:38:14 2023 +0800 mm: page_alloc: remove alloc_contig_dump_pages() stub DEFINE_DYNAMIC_DEBUG_METADATA and DYNAMIC_DEBUG_BRANCH already has stub definitions without dynamic debug feature, remove unnecessary alloc_contig_dump_pages() stub. Link: https://lkml.kernel.org/r/20230516063821.121844-7-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Mike Rapoport (IBM) Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit 5b855aa37cf742960d4f8a6c5c8e16092d0463be Author: Kefeng Wang Date: Tue May 16 14:38:13 2023 +0800 mm: page_alloc: squash page_is_consistent() Squash the page_is_consistent() into bad_range() as there is only one caller. Link: https://lkml.kernel.org/r/20230516063821.121844-6-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Mike Rapoport (IBM) Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit e9aae1709264b2353d67d4846bd617c445a49fe0 Author: Kefeng Wang Date: Tue May 16 14:38:12 2023 +0800 mm: page_alloc: collect mem statistic into show_mem.c Let's move show_mem.c from lib to mm, as it belongs memory subsystem, also split some memory statistic related functions from page_alloc.c to show_mem.c, and we cleanup some unneeded include. There is no functional change. Link: https://lkml.kernel.org/r/20230516063821.121844-5-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Mike Rapoport (IBM) Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit 904d58578fce531be07619a2bc2cdc16c9fd49b6 Author: Kefeng Wang Date: Tue May 16 14:38:11 2023 +0800 mm: page_alloc: move set_zone_contiguous() into mm_init.c set_zone_contiguous() is only used in mm init/hotplug, and clear_zone_contiguous() only used in hotplug, move them from page_alloc.c to the more appropriate file. Link: https://lkml.kernel.org/r/20230516063821.121844-4-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Mike Rapoport (IBM) Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit 5e7d5da2f41c1d762cd1dbdd97758be6c414ea29 Author: Kefeng Wang Date: Tue May 16 14:38:10 2023 +0800 mm: page_alloc: move init_on_alloc/free() into mm_init.c Since commit f2fc4b44ec2b ("mm: move init_mem_debugging_and_hardening() to mm/mm_init.c"), the init_on_alloc() and init_on_free() define is better to move there too. Link: https://lkml.kernel.org/r/20230516063821.121844-3-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Mike Rapoport (IBM) Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit 072ba380cefc7722c9442cc14a9c2810898c13ac Author: Kefeng Wang Date: Tue May 16 14:38:09 2023 +0800 mm: page_alloc: move mirrored_kernelcore into mm_init.c Patch series "mm: page_alloc: misc cleanup and refactor", v2. This aims to reduce more space in page_alloc.c, also do some cleanup, no functional changes intended. This patch (of 13): Since commit 9420f89db2dd ("mm: move most of core MM initialization to mm/mm_init.c"), mirrored_kernelcore should be moved into mm_init.c, as most related codes are already there. Link: https://lkml.kernel.org/r/20230516063821.121844-1-wangkefeng.wang@huawei.com Link: https://lkml.kernel.org/r/20230516063821.121844-2-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Mike Rapoport (IBM) Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Iurii Zaikin Cc: Kees Cook Cc: Len Brown Cc: Luis Chamberlain Cc: Oscar Salvador Cc: Pavel Machek Cc: Rafael J. Wysocki Signed-off-by: Andrew Morton commit f24f66eef5c03e07120edddde3608477f10b3980 Author: Alexey Romanov Date: Tue May 16 12:50:29 2023 +0300 mm/zsmalloc: get rid of PAGE_MASK Use offset_in_page() macro instead of 'val & ~PAGE_MASK' Link: https://lkml.kernel.org/r/20230516095029.49036-2-avromanov@sberdevices.ru Signed-off-by: Alexey Romanov Reviewed-by: Sergey Senozhatsky Cc: Minchan Kim Signed-off-by: Andrew Morton commit b758fe6df50daf68fef089d8f3c1cd49fc794ed2 Author: Mike Rapoport (IBM) Date: Mon May 15 11:34:00 2023 +0300 mm/secretmem: make it on by default Following the discussion about direct map fragmentaion at LSF/MM [1], it appears that direct map fragmentation has a negligible effect on kernel data accesses. Since the only reason that warranted secretmem to be disabled by default was concern about performance regression caused by the direct map fragmentation, it makes perfect sense to lift this restriction and make secretmem enabled. secretmem obeys RLIMIT_MEMBLOCK and as such it is not expected to cause large fragmentation of the direct map or meaningfull increase in page tables allocated during split of the large mappings in the direct map. The secretmem.enable parameter is retained to allow system administrators to disable secretmem at boot. Switch the default setting of secretmem.enable parameter to 1. Link: https://lwn.net/Articles/931406/ [1] Link: https://lkml.kernel.org/r/20230515083400.3563974-1-rppt@kernel.org Signed-off-by: Mike Rapoport (IBM) Acked-by: David Hildenbrand Cc: Randy Dunlap Signed-off-by: Andrew Morton commit 90ed667c03fe553a41d79057740ed5df951eead0 Author: Mel Gorman Date: Mon May 15 12:33:44 2023 +0100 Revert "Revert "mm/compaction: fix set skip in fast_find_migrateblock"" This reverts commit 95e7a450b819 ("Revert "mm/compaction: fix set skip in fast_find_migrateblock""). Commit 7efc3b726103 ("mm/compaction: fix set skip in fast_find_migrateblock") was reverted due to bug reports about khugepaged consuming large amounts of CPU without making progress. The underlying bug was partially fixed by commit cfccd2e63e7e ("mm, compaction: finish pageblocks on complete migration failure") but it only mitigated the problem and Vlastimil Babka pointing out the same issue could theoretically happen to kcompactd. As pageblocks containing pages that fail to migrate should now be forcibly rescanned to set the skip hint if skip hints are used, fast_find_migrateblock() should no longer loop on a small subset of pageblocks for prolonged periods of time. Revert the revert so fast_find_migrateblock() is effective again. Using the mmtests config workload-usemem-stress-numa-compact, the number of unique ranges scanned was analysed for both kcompactd and !kcompactd activity. 6.4.0-rc1-vanilla kcompactd 7 range=(0x10d600~0x10d800) 7 range=(0x110c00~0x110e00) 7 range=(0x110e00~0x111000) 7 range=(0x111800~0x111a00) 7 range=(0x111a00~0x111c00) !kcompactd 1 range=(0x113e00~0x114000) 1 range=(0x114000~0x114020) 1 range=(0x114400~0x114489) 1 range=(0x114489~0x1144aa) 1 range=(0x1144aa~0x114600) 6.4.0-rc1-mm-revertfastmigrate kcompactd 17 range=(0x104200~0x104400) 17 range=(0x104400~0x104600) 17 range=(0x104600~0x104800) 17 range=(0x104800~0x104a00) 17 range=(0x104a00~0x104c00) !kcompactd 1793 range=(0x15c200~0x15c400) 5436 range=(0x105800~0x105a00) 19826 range=(0x150a00~0x150c00) 19833 range=(0x150800~0x150a00) 19834 range=(0x11ce00~0x11d000) 6.4.0-rc1-mm-follupfastfind kcompactd 22 range=(0x107200~0x107400) 23 range=(0x107400~0x107600) 23 range=(0x107600~0x107800) 23 range=(0x107c00~0x107e00) 23 range=(0x107e00~0x108000) !kcompactd 3 range=(0x890240~0x890400) 5 range=(0x886e00~0x887000) 5 range=(0x88a400~0x88a600) 6 range=(0x88f800~0x88fa00) 9 range=(0x88a400~0x88a420) Note that the vanilla kernel and the full series had some duplication of ranges scanned but it was not severe and would be in line with compaction resets when the skip hints are cleared. Just a revert of commit 7efc3b726103 ("mm/compaction: fix set skip in fast_find_migrateblock") showed excessive rescans of the same ranges so the series should not reintroduce bug 1206848. Link: https://bugzilla.suse.com/show_bug.cgi?id=1206848 Link: https://lkml.kernel.org/r/20230515113344.6869-5-mgorman@techsingularity.net Signed-off-by: Mel Gorman Tested-by: Raghavendra K T Acked-by: Vlastimil Babka Cc: Chuyi Zhou Cc: Jiri Slaby Cc: Maxim Levitsky Cc: Michal Hocko Cc: Paolo Bonzini Cc: Pedro Falcato Signed-off-by: Andrew Morton commit 590ccea80af950685de7f72ec43831765e5c8cb1 Author: Mel Gorman Date: Mon May 15 12:33:43 2023 +0100 mm: compaction: update pageblock skip when first migration candidate is not at the start isolate_migratepages_block should mark a pageblock as skip if scanning started on an aligned pageblock boundary but it only updates the skip flag if the first migration candidate is also aligned. Tracing during a compaction stress load (mmtests: workload-usemem-stress-numa-compact) that many pageblocks are not marked skip causing excessive scanning of blocks that had been recently checked. Update pageblock skip based on "valid_page" which is set if scanning started on a pageblock boundary. [mgorman@techsingularity.net: fix handling of skip bit] Link: https://lkml.kernel.org/r/20230602111622.swtxhn6lu2qwgrwq@techsingularity.net Link: https://lkml.kernel.org/r/20230515113344.6869-4-mgorman@techsingularity.net Signed-off-by: Mel Gorman Tested-by: Raghavendra K T Acked-by: Vlastimil Babka Cc: Chuyi Zhou Cc: Jiri Slaby Cc: Maxim Levitsky Cc: Michal Hocko Cc: Paolo Bonzini Cc: Pedro Falcato Signed-off-by: Andrew Morton commit 9ecc5fc50a9c75b0af252913163a9f1ac4206b17 Author: Mel Gorman Date: Mon May 15 12:33:42 2023 +0100 mm: compaction: only force pageblock scan completion when skip hints are obeyed fast_find_migrateblock relies on skip hints to avoid rescanning a recently selected pageblock but compact_zone() only forces the pageblock scan completion to set the skip hint if in direct compaction. While this prevents direct compaction repeatedly scanning a subset of blocks due to fast_find_migrateblock(), it does not prevent proactive compaction, node compaction and kcompactd encountering the same problem described in commit cfccd2e63e7e ("mm, compaction: finish pageblocks on complete migration failure"). Force the scan completion of a pageblock to set the skip hint if skip hints are obeyed to prevent fast_find_migrateblock() repeatedly selecting a subset of pageblocks. Link: https://lkml.kernel.org/r/20230515113344.6869-3-mgorman@techsingularity.net Signed-off-by: Mel Gorman Suggested-by: Vlastimil Babka Tested-by: Raghavendra K T Acked-by: Vlastimil Babka Cc: Chuyi Zhou Cc: Jiri Slaby Cc: Maxim Levitsky Cc: Michal Hocko Cc: Paolo Bonzini Cc: Pedro Falcato Signed-off-by: Andrew Morton commit 539aa041a9b1d98cd847b949ba8f91857c995f26 Author: Mel Gorman Date: Mon May 15 12:33:41 2023 +0100 mm: compaction: ensure rescanning only happens on partially scanned pageblocks Patch series "Follow-up "Fix excessive CPU usage during compaction"". The series "Fix excessive CPU usage during compaction" [1] attempted to fix a bug [2] but Vlastimil noted that the fix was incomplete [3]. While the series was merged, fast_find_migrateblock was still disabled. This series should fix the corner cases and allow 95e7a450b819 ("Revert "mm/compaction: fix set skip in fast_find_migrateblock"") to be safely reverted. Details on how many pageblocks are rescanned are in the changelog of the last patch. "Raghavendra K T" tested this and reported "decent improvement from perf perspective as well as compaction related data [4] [1] https://lore.kernel.org/r/20230125134434.18017-1-mgorman@techsingularity.net [2] https://bugzilla.suse.com/show_bug.cgi?id=1206848 [3] https://lore.kernel.org/r/a55cf026-a2f9-ef01-9a4c-398693e048ea@suse.cz [4] https://lkml.kernel.org/r/6d62686f-964d-342c-e085-0eae2555cc54@amd.com This patch (of 4): compact_zone() intends to rescan pageblocks if there is a failure to migrate "within the current order-aligned block". However, the pageblock scan may already be complete and moved to the next block causing the next pageblock to be "rescanned". Ensure only the most recent pageblock is rescanned. Link: https://lkml.kernel.org/r/20230515113344.6869-1-mgorman@techsingularity.net Link: https://lkml.kernel.org/r/20230515113344.6869-2-mgorman@techsingularity.net Signed-off-by: Mel Gorman Reported-by: Vlastimil Babka Tested-by: Raghavendra K T Acked-by: Vlastimil Babka Cc: Chuyi Zhou Cc: Jiri Slaby Cc: Maxim Levitsky Cc: Mel Gorman Cc: Michal Hocko Cc: Paolo Bonzini Cc: Pedro Falcato Signed-off-by: Andrew Morton commit 7bab8dfb12d63e6aea325362b0a52916a5503fe6 Author: Yuanchu Xie Date: Tue May 16 01:26:08 2023 +0800 mm: pagemap: restrict pagewalk to the requested range The pagewalk in pagemap_read reads one PTE past the end of the requested range, and stops when the buffer runs out of space. While it produces the right result, the extra read is unnecessary and less performant. I timed the following command before and after this patch: dd count=100000 if=/proc/self/pagemap of=/dev/null The results are consistently within 0.001s across 5 runs. Before: 100000+0 records in 100000+0 records out 51200000 bytes (51 MB) copied, 0.0763159 s, 671 MB/s real 0m0.078s user 0m0.012s sys 0m0.065s After: 100000+0 records in 100000+0 records out 51200000 bytes (51 MB) copied, 0.0487928 s, 1.0 GB/s real 0m0.050s user 0m0.011s sys 0m0.039s Link: https://lkml.kernel.org/r/20230515172608.3558391-1-yuanchu@google.com Signed-off-by: Yuanchu Xie Acked-by: Peter Xu Reviewed-by: Yang Shi Acked-by: David Rientjes Cc: Kirill A. Shutemov Cc: Liam R. Howlett Cc: Matthew Wilcox Cc: Pavel Tatashin Cc: Zach O'Keefe Signed-off-by: Andrew Morton commit 4822acb1369637938c1252d534d3356c5e313cde Author: Haifeng Xu Date: Mon May 8 07:35:38 2023 +0000 mm, oom: do not check 0 mask in out_of_memory() Since commit 60e2793d440a ("mm, oom: do not trigger out_of_memory from the #PF"), no user sets gfp_mask to 0. Remove the 0 mask check and update the comments. Link: https://lkml.kernel.org/r/20230508073538.1168-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 97de10a9932c363a4e4ee9bb5f2297e254fb1413 Author: Kefeng Wang Date: Mon May 8 19:41:28 2023 +0800 mm: memory-failure: move sysctl register in memory_failure_init() There is already a memory_failure_init(), don't add a new initcall, move register_sysctl_init() into it to cleanup a bit. Link: https://lkml.kernel.org/r/20230508114128.37081-2-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 870388db25324fec267862baddc28aaaf0baca73 Author: Kefeng Wang Date: Mon May 8 19:41:27 2023 +0800 mm: memory_failure: move memory_failure_attr_group under MEMORY_FAILURE The memory_failure_attr_group is only called if MEMORY_FAILURE enabled, move it under this configuration. Link: https://lkml.kernel.org/r/20230508114128.37081-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit eb83f6528b563550e9ba92f9accfd453ca28e828 Author: Pasha Tatashin Date: Mon May 8 23:40:59 2023 +0000 mm: hugetlb_vmemmap: provide stronger vmemmap allocation guarantees HugeTLB pages have a struct page optimizations where struct pages for tail pages are freed. However, when HugeTLB pages are destroyed, the memory for struct pages (vmemmap) need to be allocated again. Currently, __GFP_NORETRY flag is used to allocate the memory for vmemmap, but given that this flag makes very little effort to actually reclaim memory the returning of huge pages back to the system can be problem. Lets use __GFP_RETRY_MAYFAIL instead. This flag is also performs graceful reclaim without causing ooms, but at least it may perform a few retries, and will fail only when there is genuinely little amount of unused memory in the system. Freeing a 1G page requires 16M of free memory. A machine might need to be reconfigured from one task to another, and release a large number of 1G pages back to the system if allocating 16M fails, the release won't work. Link: https://lkml.kernel.org/r/20230508234059.2529638-1-pasha.tatashin@soleen.com Signed-off-by: Pasha Tatashin Suggested-by: David Rientjes Reviewed-by: Mike Kravetz Cc: Michal Hocko Cc: Muchun Song Signed-off-by: Andrew Morton commit bb6e04a173f06e51819a4bb512e127dfbc50dcfa Author: Arnd Bergmann Date: Tue May 9 16:57:21 2023 +0200 kasan: use internal prototypes matching gcc-13 builtins gcc-13 warns about function definitions for builtin interfaces that have a different prototype, e.g.: In file included from kasan_test.c:31: kasan.h:574:6: error: conflicting types for built-in function '__asan_register_globals'; expected 'void(void *, long int)' [-Werror=builtin-declaration-mismatch] 574 | void __asan_register_globals(struct kasan_global *globals, size_t size); kasan.h:577:6: error: conflicting types for built-in function '__asan_alloca_poison'; expected 'void(void *, long int)' [-Werror=builtin-declaration-mismatch] 577 | void __asan_alloca_poison(unsigned long addr, size_t size); kasan.h:580:6: error: conflicting types for built-in function '__asan_load1'; expected 'void(void *)' [-Werror=builtin-declaration-mismatch] 580 | void __asan_load1(unsigned long addr); kasan.h:581:6: error: conflicting types for built-in function '__asan_store1'; expected 'void(void *)' [-Werror=builtin-declaration-mismatch] 581 | void __asan_store1(unsigned long addr); kasan.h:643:6: error: conflicting types for built-in function '__hwasan_tag_memory'; expected 'void(void *, unsigned char, long int)' [-Werror=builtin-declaration-mismatch] 643 | void __hwasan_tag_memory(unsigned long addr, u8 tag, unsigned long size); The two problems are: - Addresses are passes as 'unsigned long' in the kernel, but gcc-13 expects a 'void *'. - sizes meant to use a signed ssize_t rather than size_t. Change all the prototypes to match these. Using 'void *' consistently for addresses gets rid of a couple of type casts, so push that down to the leaf functions where possible. This now passes all randconfig builds on arm, arm64 and x86, but I have not tested it on the other architectures that support kasan, since they tend to fail randconfig builds in other ways. This might fail if any of the 32-bit architectures expect a 'long' instead of 'int' for the size argument. The __asan_allocas_unpoison() function prototype is somewhat weird, since it uses a pointer for 'stack_top' and an size_t for 'stack_bottom'. This looks like it is meant to be 'addr' and 'size' like the others, but the implementation clearly treats them as 'top' and 'bottom'. Link: https://lkml.kernel.org/r/20230509145735.9263-2-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Cc: Vincenzo Frascino Cc: Signed-off-by: Andrew Morton commit fb646a4cd3f0ff27d19911bef7b6622263723df6 Author: Arnd Bergmann Date: Tue May 9 16:57:20 2023 +0200 kasan: add kasan_tag_mismatch prototype The kasan sw-tags implementation contains one function that is only called from assembler and has no prototype in a header. This causes a W=1 warning: mm/kasan/sw_tags.c:171:6: warning: no previous prototype for 'kasan_tag_mismatch' [-Wmissing-prototypes] 171 | void kasan_tag_mismatch(unsigned long addr, unsigned long access_info, Add a prototype in the local header to get a clean build. Link: https://lkml.kernel.org/r/20230509145735.9263-1-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Cc: Vincenzo Frascino Cc: Signed-off-by: Andrew Morton commit 124abced647306aa3badb5d472c3616de23f180a Author: Huang Ying Date: Wed May 10 11:18:29 2023 +0800 migrate_pages_batch: simplify retrying and failure counting of large folios After recent changes to the retrying and failure counting in migrate_pages_batch(), it was found that it's unnecessary to count retrying and failure for normal, large, and THP folios separately. Because we don't use retrying and failure number of large folios directly. So, in this patch, we simplified retrying and failure counting of large folios via counting retrying and failure of normal and large folios together. This results in the reduced line number. Previously, in migrate_pages_batch we need to track whether the source folio is large/THP before splitting. So is_large is used to cache folio_test_large() result. Now, we don't need that variable any more because we don't count retrying and failure of large folios (only counting that of THP folios). So, in this patch, is_large is removed to simplify the code. This is just code cleanup, no functionality changes are expected. Link: https://lkml.kernel.org/r/20230510031829.11513-1-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Xin Hao Reviewed-by: Zi Yan Reviewed-by: Alistair Popple Cc: Yang Shi Cc: Baolin Wang Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 501350459b1fe7a0da6d089484fa112ff48f5252 Author: Rick Wertenbroek Date: Wed May 10 11:07:57 2023 +0200 mm: memory_hotplug: fix format string in warnings The format string in __add_pages and __remove_pages has a typo and prints e.g., "Misaligned __add_pages start: 0xfc605 end: #fc609" instead of "Misaligned __add_pages start: 0xfc605 end: 0xfc609" Fix "#%lx" => "%#lx" Link: https://lkml.kernel.org/r/20230510090758.3537242-1-rick.wertenbroek@gmail.com Signed-off-by: Rick Wertenbroek Reviewed-by: David Hildenbrand Reviewed-by: Mike Rapoport (IBM) Cc: Oscar Salvador Signed-off-by: Andrew Morton commit c963901197188189e85b4d768a059fe1bbc2a502 Author: Pankaj Raghav Date: Wed May 10 14:47:16 2023 +0200 filemap: remove page_endio() page_endio() is not used anymore. Remove it. Link: https://lkml.kernel.org/r/20230510124716.73655-1-p.raghav@samsung.com Signed-off-by: Pankaj Raghav Reviewed-by: Christoph Hellwig Acked-by: Matthew Wilcox (Oracle) Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit cd00dd2585c4158e81fdfac0bbcc0446afbad26d Author: Peng Zhang Date: Sat May 6 10:47:52 2023 +0800 maple_tree: fix potential out-of-bounds access in mas_wr_end_piv() Check the write offset end bounds before using it as the offset into the pivot array. This avoids a possible out-of-bounds access on the pivot array if the write extends to the last slot in the node, in which case the node maximum should be used as the end pivot. akpm: this doesn't affect any current callers, but new users of mapletree may encounter this problem if backported into earlier kernels, so let's fix it in -stable kernels in case of this. Link: https://lkml.kernel.org/r/20230506024752.2550-1-zhangpeng.00@bytedance.com Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Peng Zhang Reviewed-by: Liam R. Howlett Cc: Signed-off-by: Andrew Morton commit 311150343e69ed4fe6380d2de74602a2a29df7c2 Author: Lorenzo Stoakes Date: Sat May 6 15:05:25 2023 +0100 mm/gup: add missing gup_must_unshare() check to gup_huge_pgd() All other instances of gup_huge_pXd() perform the unshare check, so update the PGD-specific function to do so as well. While checking pgd_write() might seem unusual, this function already performs such a check via pgd_access_permitted() so this is in line with the existing implementation. David said: : This change makes unshare handling across all GUP-fast variants : consistent, which is desirable as GUP-fast is complicated enough : already even when consistent. : : This function was the only one I seemed to have missed (or left out and : forgot why -- maybe because it's really dead code for now). The COW : selftest would identify the problem, so far there was no report. : Either the selftest wasn't run on corresponding architectures with that : hugetlb size, or that code is still dead code and unused by : architectures. : : the original commit(s) that added unsharing explain why we care about : these checks: : : a7f226604170acd6 ("mm/gup: trigger FAULT_FLAG_UNSHARE when R/O-pinning a possibly shared anonymous page") : 84209e87c6963f92 ("mm/gup: reliable R/O long-term pinning in COW mappings") Link: https://lkml.kernel.org/r/cb971ac8dd315df97058ea69442ecc007b9a364a.1683381545.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Suggested-by: David Hildenbrand Acked-by: David Hildenbrand Signed-off-by: Andrew Morton commit 9f297db35667021925b67e27d81463e38445041c Author: Keith Busch Date: Thu Jan 26 13:51:25 2023 -0800 dmapool: create/destroy cleanup Set the 'empty' bool directly from the result of the function that determines its value instead of adding additional logic. Link: https://lkml.kernel.org/r/20230126215125.4069751-13-kbusch@meta.com Fixes: 2d55c16c0c54 ("dmapool: create/destroy cleanup") Signed-off-by: Keith Busch Reviewed-by: Christoph Hellwig Cc: Matthew Wilcox Cc: Tony Battersby Signed-off-by: Andrew Morton commit adef080382637f207c68e8ad633481d9b9332b63 Author: Ackerley Tng Date: Tue May 2 23:56:22 2023 +0000 fs: hugetlbfs: set vma policy only when needed for allocating folio Calling hugetlb_set_vma_policy() later avoids setting the vma policy and then dropping it on a page cache hit. Link: https://lkml.kernel.org/r/20230502235622.3652586-1-ackerleytng@google.com Signed-off-by: Ackerley Tng Reviewed-by: Mike Kravetz Cc: Erdem Aktas Cc: John Hubbard Cc: Matthew Wilcox (Oracle) Cc: Muchun Song Cc: Sidhartha Kumar Cc: Vishal Annapurve Signed-off-by: Andrew Morton commit 88537aac0b3840314d3a5cc401a7fc400c069bc9 Author: Nhat Pham Date: Tue May 2 18:36:08 2023 -0700 selftests: add selftests for cachestat Test cachestat on a newly created file, /dev/ files, /proc/ files and a directory. Also test on a shmem file (which can also be tested with huge pages since tmpfs supports huge pages). [colin.i.king@gmail.com: fix spelling mistake "trucate" -> "truncate"] Link: https://lkml.kernel.org/r/20230505110855.2493457-1-colin.i.king@gmail.com [mpe@ellerman.id.au: avoid excessive stack allocation] Link: https://lkml.kernel.org/r/877ctfa6yv.fsf@mail.lhotse Link: https://lkml.kernel.org/r/20230503013608.2431726-4-nphamcs@gmail.com Signed-off-by: Nhat Pham Signed-off-by: Colin Ian King Signed-off-by: Michael Ellerman Acked-by: Johannes Weiner Cc: Brian Foster Cc: Matthew Wilcox (Oracle) Cc: Michael Kerrisk Cc: Colin Ian King Cc: Michael Ellerman Signed-off-by: Andrew Morton commit 946e697c69ffeeefdd84dad90eac307284df46be Author: Nhat Pham Date: Wed May 10 12:58:06 2023 -0700 cachestat: wire up cachestat for other architectures cachestat is previously only wired in for x86 (and architectures using the generic unistd.h table): https://lore.kernel.org/lkml/20230503013608.2431726-1-nphamcs@gmail.com/ This patch wires cachestat in for all the other architectures. [nphamcs@gmail.com: wire up cachestat for arm64] Link: https://lkml.kernel.org/r/20230511092843.3896327-1-nphamcs@gmail.com Link: https://lkml.kernel.org/r/20230510195806.2902878-1-nphamcs@gmail.com Signed-off-by: Nhat Pham Tested-by: Michael Ellerman [powerpc] Acked-by: Geert Uytterhoeven [m68k] Reviewed-by: Arnd Bergmann Acked-by: Heiko Carstens [s390] Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Chris Zankel Cc: David S. Miller Cc: Helge Deller Cc: Ivan Kokshaysky Cc: "James E.J. Bottomley" Cc: Johannes Weiner Cc: John Paul Adrian Glaubitz Cc: Matt Turner Cc: Max Filippov Cc: Michal Simek Cc: Nicholas Piggin Cc: Richard Henderson Cc: Rich Felker Cc: Russell King Cc: Sven Schnelle Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Cc: Yoshinori Sato Signed-off-by: Andrew Morton commit cf264e1329fb0307e044f7675849f9f38b44c11a Author: Nhat Pham Date: Tue May 2 18:36:07 2023 -0700 cachestat: implement cachestat syscall There is currently no good way to query the page cache state of large file sets and directory trees. There is mincore(), but it scales poorly: the kernel writes out a lot of bitmap data that userspace has to aggregate, when the user really doesn not care about per-page information in that case. The user also needs to mmap and unmap each file as it goes along, which can be quite slow as well. Some use cases where this information could come in handy: * Allowing database to decide whether to perform an index scan or direct table queries based on the in-memory cache state of the index. * Visibility into the writeback algorithm, for performance issues diagnostic. * Workload-aware writeback pacing: estimating IO fulfilled by page cache (and IO to be done) within a range of a file, allowing for more frequent syncing when and where there is IO capacity, and batching when there is not. * Computing memory usage of large files/directory trees, analogous to the du tool for disk usage. More information about these use cases could be found in the following thread: https://lore.kernel.org/lkml/20230315170934.GA97793@cmpxchg.org/ This patch implements a new syscall that queries cache state of a file and summarizes the number of cached pages, number of dirty pages, number of pages marked for writeback, number of (recently) evicted pages, etc. in a given range. Currently, the syscall is only wired in for x86 architecture. NAME cachestat - query the page cache statistics of a file. SYNOPSIS #include struct cachestat_range { __u64 off; __u64 len; }; struct cachestat { __u64 nr_cache; __u64 nr_dirty; __u64 nr_writeback; __u64 nr_evicted; __u64 nr_recently_evicted; }; int cachestat(unsigned int fd, struct cachestat_range *cstat_range, struct cachestat *cstat, unsigned int flags); DESCRIPTION cachestat() queries the number of cached pages, number of dirty pages, number of pages marked for writeback, number of evicted pages, number of recently evicted pages, in the bytes range given by `off` and `len`. An evicted page is a page that is previously in the page cache but has been evicted since. A page is recently evicted if its last eviction was recent enough that its reentry to the cache would indicate that it is actively being used by the system, and that there is memory pressure on the system. These values are returned in a cachestat struct, whose address is given by the `cstat` argument. The `off` and `len` arguments must be non-negative integers. If `len` > 0, the queried range is [`off`, `off` + `len`]. If `len` == 0, we will query in the range from `off` to the end of the file. The `flags` argument is unused for now, but is included for future extensibility. User should pass 0 (i.e no flag specified). Currently, hugetlbfs is not supported. Because the status of a page can change after cachestat() checks it but before it returns to the application, the returned values may contain stale information. RETURN VALUE On success, cachestat returns 0. On error, -1 is returned, and errno is set to indicate the error. ERRORS EFAULT cstat or cstat_args points to an invalid address. EINVAL invalid flags. EBADF invalid file descriptor. EOPNOTSUPP file descriptor is of a hugetlbfs file [nphamcs@gmail.com: replace rounddown logic with the existing helper] Link: https://lkml.kernel.org/r/20230504022044.3675469-1-nphamcs@gmail.com Link: https://lkml.kernel.org/r/20230503013608.2431726-3-nphamcs@gmail.com Signed-off-by: Nhat Pham Acked-by: Johannes Weiner Cc: Brian Foster Cc: Matthew Wilcox (Oracle) Cc: Michael Kerrisk Signed-off-by: Andrew Morton commit ffcb5f5262b756a598eefb11e340bbd027cde037 Author: Nhat Pham Date: Tue May 2 18:36:06 2023 -0700 workingset: refactor LRU refault to expose refault recency check Patch series "cachestat: a new syscall for page cache state of files", v13. There is currently no good way to query the page cache statistics of large files and directory trees. There is mincore(), but it scales poorly: the kernel writes out a lot of bitmap data that userspace has to aggregate, when the user really does not care about per-page information in that case. The user also needs to mmap and unmap each file as it goes along, which can be quite slow as well. Some use cases where this information could come in handy: * Allowing database to decide whether to perform an index scan or direct table queries based on the in-memory cache state of the index. * Visibility into the writeback algorithm, for performance issues diagnostic. * Workload-aware writeback pacing: estimating IO fulfilled by page cache (and IO to be done) within a range of a file, allowing for more frequent syncing when and where there is IO capacity, and batching when there is not. * Computing memory usage of large files/directory trees, analogous to the du tool for disk usage. More information about these use cases could be found in this thread: https://lore.kernel.org/lkml/20230315170934.GA97793@cmpxchg.org/ This series of patches introduces a new system call, cachestat, that summarizes the page cache statistics (number of cached pages, dirty pages, pages marked for writeback, evicted pages etc.) of a file, in a specified range of bytes. It also include a selftest suite that tests some typical usage. Currently, the syscall is only wired in for x86 architecture. This interface is inspired by past discussion and concerns with fincore, which has a similar design (and as a result, issues) as mincore. Relevant links: https://lkml.indiana.edu/hypermail/linux/kernel/1302.1/04207.html https://lkml.indiana.edu/hypermail/linux/kernel/1302.1/04209.html I have also developed a small tool that computes the memory usage of files and directories, analogous to the du utility. User can choose between mincore or cachestat (with cachestat exporting more information than mincore). To compare the performance of these two options, I benchmarked the tool on the root directory of a Meta's server machine, each for five runs: Using cachestat real -- Median: 33.377s, Average: 33.475s, Standard Deviation: 0.3602 user -- Median: 4.08s, Average: 4.1078s, Standard Deviation: 0.0742 sys -- Median: 28.823s, Average: 28.8866s, Standard Deviation: 0.2689 Using mincore: real -- Median: 102.352s, Average: 102.3442s, Standard Deviation: 0.2059 user -- Median: 10.149s, Average: 10.1482s, Standard Deviation: 0.0162 sys -- Median: 91.186s, Average: 91.2084s, Standard Deviation: 0.2046 I also ran both syscalls on a 2TB sparse file: Using cachestat: real 0m0.009s user 0m0.000s sys 0m0.009s Using mincore: real 0m37.510s user 0m2.934s sys 0m34.558s Very large files like this are the pathological case for mincore. In fact, to compute the stats for a single 2TB file, mincore takes as long as cachestat takes to compute the stats for the entire tree! This could easily happen inadvertently when we run it on subdirectories. Mincore is clearly not suitable for a general-purpose command line tool. Regarding security concerns, cachestat() should not pose any additional issues. The caller already has read permission to the file itself (since they need an fd to that file to call cachestat). This means that the caller can access the underlying data in its entirety, which is a much greater source of information (and as a result, a much greater security risk) than the cache status itself. The latest API change (in v13 of the patch series) is suggested by Jens Axboe. It allows for 64-bit length argument, even on 32-bit architecture (which is previously not possible due to the limit on the number of syscall arguments). Furthermore, it eliminates the need for compatibility handling - every user can use the same ABI. This patch (of 4): In preparation for computing recently evicted pages in cachestat, refactor workingset_refault and lru_gen_refault to expose a helper function that would test if an evicted page is recently evicted. [penguin-kernel@I-love.SAKURA.ne.jp: add missing rcu_read_unlock() in lru_gen_refault()] Link: https://lkml.kernel.org/r/610781bc-cf11-fc89-a46f-87cb8235d439@I-love.SAKURA.ne.jp Link: https://lkml.kernel.org/r/20230503013608.2431726-1-nphamcs@gmail.com Link: https://lkml.kernel.org/r/20230503013608.2431726-2-nphamcs@gmail.com Signed-off-by: Nhat Pham Signed-off-by: Tetsuo Handa Acked-by: Johannes Weiner Cc: Brian Foster Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Michael Kerrisk Cc: Tetsuo Handa Signed-off-by: Andrew Morton commit 18b1d18bc2bd8f54e8df6bc8096185361a6d1b15 Author: Haifeng Xu Date: Wed Apr 19 03:07:39 2023 +0000 memcg, oom: remove explicit wakeup in mem_cgroup_oom_synchronize() Before commit 29ef680ae7c2 ("memcg, oom: move out_of_memory back to the charge path"), all memcg oom killers were delayed to page fault path. And the explicit wakeup is used in this case: thread A: ... if (locked) { // complete oom-kill, hold the lock mem_cgroup_oom_unlock(memcg); ... } ... thread B: ... if (locked && !memcg->oom_kill_disable) { ... } else { schedule(); // can't acquire the lock ... } ... The reason is that thread A kicks off the OOM-killer, which leads to wakeups from the uncharges of the exiting task. But thread B is not guaranteed to see them if it enters the OOM path after the OOM kills but before thread A releases the lock. Now only oom_kill_disable case is handled from the #PF path. In that case it is userspace to trigger the wake up not the #PF path itself. All potential paths to free some charges are responsible to call memcg_oom_recover() , so the explicit wakeup is not needed in the mem_cgroup_oom_synchronize() path which doesn't release any memory itself. Link: https://lkml.kernel.org/r/20230419030739.115845-2-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Suggested-by: Michal Hocko Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 857f21397f7113e4f764aa65fb0160eb7f404808 Author: Haifeng Xu Date: Wed Apr 19 03:07:38 2023 +0000 memcg, oom: remove unnecessary check in mem_cgroup_oom_synchronize() mem_cgroup_oom_synchronize() is only used when the memcg oom handling is handed over to the edge of the #PF path. Since commit 29ef680ae7c2 ("memcg, oom: move out_of_memory back to the charge path") this is the case only when the kernel memcg oom killer is disabled (current->memcg_in_oom is only set if memcg->oom_kill_disable). Therefore a check for oom_kill_disable in mem_cgroup_oom_synchronize() is not required. Link: https://lkml.kernel.org/r/20230419030739.115845-1-haifeng.xu@shopee.com Signed-off-by: Haifeng Xu Suggested-by: Michal Hocko Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 0a2dc6ac33297f8a1a65f81b633a1ea753f19f69 Author: Yosry Ahmed Date: Fri Apr 21 17:40:20 2023 +0000 cgroup: remove cgroup_rstat_flush_atomic() Previous patches removed the only caller of cgroup_rstat_flush_atomic(). Remove the function and simplify the code. Link: https://lkml.kernel.org/r/20230421174020.2994750-6-yosryahmed@google.com Signed-off-by: Yosry Ahmed Acked-by: Shakeel Butt Acked-by: Tejun Heo Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: Jens Axboe Cc: Johannes Weiner Cc: Michal Hocko Cc: Michal Koutný Cc: Muchun Song Cc: Roman Gushchin Signed-off-by: Andrew Morton commit 35822fdae3bf509532b0954088070f17de51ff15 Author: Yosry Ahmed Date: Fri Apr 21 17:40:19 2023 +0000 memcg: remove mem_cgroup_flush_stats_atomic() Previous patches removed all callers of mem_cgroup_flush_stats_atomic(). Remove the function and simplify the code. Link: https://lkml.kernel.org/r/20230421174020.2994750-5-yosryahmed@google.com Signed-off-by: Yosry Ahmed Acked-by: Shakeel Butt Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: Jens Axboe Cc: Johannes Weiner Cc: Michal Hocko Cc: Michal Koutný Cc: Muchun Song Cc: Roman Gushchin Cc: Tejun Heo Signed-off-by: Andrew Morton commit f82a7a86dbfbd0ee81a4907ca41ba78bda1846f4 Author: Yosry Ahmed Date: Fri Apr 21 17:40:18 2023 +0000 memcg: calculate root usage from global state Currently, we approximate the root usage by adding the memcg stats for anon, file, and conditionally swap (for memsw). To read the memcg stats we need to invoke an rstat flush. rstat flushes can be expensive, they scale with the number of cpus and cgroups on the system. mem_cgroup_usage() is called by memcg_events()->mem_cgroup_threshold() with irqs disabled, so such an expensive operation with irqs disabled can cause problems. Instead, approximate the root usage from global state. This is not 100% accurate, but the root usage has always been ill-defined anyway. Link: https://lkml.kernel.org/r/20230421174020.2994750-4-yosryahmed@google.com Signed-off-by: Yosry Ahmed Reviewed-by: Michal Koutný Acked-by: Shakeel Butt Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: Jens Axboe Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Cc: Tejun Heo Signed-off-by: Andrew Morton commit 190409caaf7e3eee6926943488e486590efe6fde Author: Yosry Ahmed Date: Fri Apr 21 17:40:17 2023 +0000 memcg: flush stats non-atomically in mem_cgroup_wb_stats() The previous patch moved the wb_over_bg_thresh()->mem_cgroup_wb_stats() code path in wb_writeback() outside the lock section. We no longer need to flush the stats atomically. Flush the stats non-atomically. Link: https://lkml.kernel.org/r/20230421174020.2994750-3-yosryahmed@google.com Signed-off-by: Yosry Ahmed Reviewed-by: Michal Koutný Acked-by: Shakeel Butt Acked-by: Tejun Heo Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: Jens Axboe Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Signed-off-by: Andrew Morton commit 2816ea2abf5f54438517f64efd78a9984685d6db Author: Yosry Ahmed Date: Fri Apr 21 17:40:16 2023 +0000 writeback: move wb_over_bg_thresh() call outside lock section Patch series "cgroup: eliminate atomic rstat flushing", v5. A previous patch series [1] changed most atomic rstat flushing contexts to become non-atomic. This was done to avoid an expensive operation that scales with # cgroups and # cpus to happen with irqs disabled and scheduling not permitted. There were two remaining atomic flushing contexts after that series. This series tries to eliminate them as well, eliminating atomic rstat flushing completely. The two remaining atomic flushing contexts are: (a) wb_over_bg_thresh()->mem_cgroup_wb_stats() (b) mem_cgroup_threshold()->mem_cgroup_usage() For (a), flushing needs to be atomic as wb_writeback() calls wb_over_bg_thresh() with a spinlock held. However, it seems like the call to wb_over_bg_thresh() doesn't need to be protected by that spinlock, so this series proposes a refactoring that moves the call outside the lock criticial section and makes the stats flushing in mem_cgroup_wb_stats() non-atomic. For (b), flushing needs to be atomic as mem_cgroup_threshold() is called with irqs disabled. We only flush the stats when calculating the root usage, as it is approximated as the sum of some memcg stats (file, anon, and optionally swap) instead of the conventional page counter. This series proposes changing this calculation to use the global stats instead, eliminating the need for a memcg stat flush. After these 2 contexts are eliminated, we no longer need mem_cgroup_flush_stats_atomic() or cgroup_rstat_flush_atomic(). We can remove them and simplify the code. [1] https://lore.kernel.org/linux-mm/20230330191801.1967435-1-yosryahmed@google.com/ This patch (of 5): wb_over_bg_thresh() calls mem_cgroup_wb_stats() which invokes an rstat flush, which can be expensive on large systems. Currently, wb_writeback() calls wb_over_bg_thresh() within a lock section, so we have to do the rstat flush atomically. On systems with a lot of cpus and/or cgroups, this can cause us to disable irqs for a long time, potentially causing problems. Move the call to wb_over_bg_thresh() outside the lock section in preparation to make the rstat flush in mem_cgroup_wb_stats() non-atomic. The list_empty(&wb->work_list) check should be okay outside the lock section of wb->list_lock as it is protected by a separate lock (wb->work_lock), and wb_over_bg_thresh() doesn't seem like it is modifying any of wb->b_* lists the wb->list_lock is protecting. Also, the loop seems to be already releasing and reacquring the lock, so this refactoring looks safe. Link: https://lkml.kernel.org/r/20230421174020.2994750-1-yosryahmed@google.com Link: https://lkml.kernel.org/r/20230421174020.2994750-2-yosryahmed@google.com Signed-off-by: Yosry Ahmed Reviewed-by: Michal Koutný Reviewed-by: Jan Kara Acked-by: Shakeel Butt Acked-by: Tejun Heo Cc: Alexander Viro Cc: Christian Brauner Cc: Jens Axboe Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Signed-off-by: Andrew Morton commit 3c4322c94b9af33dc62e47cb80c057f9814fb595 Author: Baolin Wang Date: Mon Apr 24 21:45:39 2023 +0800 mm/page_alloc: drop the unnecessary pfn_valid() for start pfn __pageblock_pfn_to_page() currently performs both pfn_valid check and pfn_to_online_page(). The former one is redundant because the latter is a stronger check. Drop pfn_valid(). Link: https://lkml.kernel.org/r/c3868b58c6714c09a43440d7d02c7b4eed6e03f6.1682342634.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: David Hildenbrand Reviewed-by: "Huang, Ying" Acked-by: Michal Hocko Cc: Mel Gorman Cc: Mike Rapoport (IBM) Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 8b9167cd9ef039d95b65ef9600a7507795173121 Author: Wen Yang Date: Tue Apr 25 23:52:35 2023 +0800 mm: compaction: optimize compact_memory to comply with the admin-guide For the /proc/sys/vm/compact_memory file, the admin-guide states: When 1 is written to the file, all zones are compacted such that free memory is available in contiguous blocks where possible. This can be important for example in the allocation of huge pages although processes will also directly compact memory as required But it was not strictly followed, writing any value would cause all zones to be compacted. It has been slightly optimized to comply with the admin-guide. Enforce the 1 on the unlikely chance that the sysctl handler is ever extended to do something different. Commit ef4984384172 ("mm/compaction: remove unused variable sysctl_compact_memory") has also been optimized a bit here, as the declaration in the external header file has been eliminated, and sysctl_compact_memory also needs to be verified. [akpm@linux-foundation.org: add __read_mostly, per Mel] Link: https://lkml.kernel.org/r/tencent_DFF54DB2A60F3333F97D3F6B5441519B050A@qq.com Signed-off-by: Wen Yang Acked-by: Mel Gorman Cc: Oscar Salvador Cc: William Lam Cc: Pintu Kumar Cc: Fu Wei Signed-off-by: Andrew Morton commit dddb44ffa0d59c8a3f2a5cb9690ccebe3150810c Author: Yosry Ahmed Date: Fri Apr 28 13:24:06 2023 +0000 memcg: dump memory.stat during cgroup OOM for v1 Patch series "memcg: OOM log improvements", v2. This short patch series brings back some cgroup v1 stats in OOM logs that were unnecessarily changed before. It also makes memcg OOM logs less reliant on printk() internals. This patch (of 2): Commit c8713d0b2312 ("mm: memcontrol: dump memory.stat during cgroup OOM") made sure we dump all the stats in memory.stat during a cgroup OOM, but it also introduced a slight behavioral change. The code used to print the non-hierarchical v1 cgroup stats for the entire cgroup subtree, now it only prints the v2 cgroup stats for the cgroup under OOM. For cgroup v1 users, this introduces a few problems: (a) The non-hierarchical stats of the memcg under OOM are no longer shown. (b) A couple of v1-only stats (e.g. pgpgin, pgpgout) are no longer shown. (c) We show the list of cgroup v2 stats, even in cgroup v1. This list of stats is not tracked with v1 in mind. While most of the stats seem to be working on v1, there may be some stats that are not fully or correctly tracked. Although OOM log is not set in stone, we should not change it for no reason. When upgrading the kernel version to a version including commit c8713d0b2312 ("mm: memcontrol: dump memory.stat during cgroup OOM"), these behavioral changes are noticed in cgroup v1. The fix is simple. Commit c8713d0b2312 ("mm: memcontrol: dump memory.stat during cgroup OOM") separated stats formatting from stats display for v2, to reuse the stats formatting in the OOM logs. Do the same for v1. Move the v2 specific formatting from memory_stat_format() to memcg_stat_format(), add memcg1_stat_format() for v1, and make memory_stat_format() select between them based on cgroup version. Since memory_stat_show() now works for both v1 & v2, drop memcg_stat_show(). Link: https://lkml.kernel.org/r/20230428132406.2540811-1-yosryahmed@google.com Link: https://lkml.kernel.org/r/20230428132406.2540811-3-yosryahmed@google.com Signed-off-by: Yosry Ahmed Acked-by: Shakeel Butt Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Muchun Song Cc: Petr Mladek Cc: Roman Gushchin Cc: Sergey Senozhatsky Cc: Steven Rostedt (Google) Cc: Michal Hocko Signed-off-by: Andrew Morton commit 5b42360c73b0679505dac6ec44d234cfec61120c Author: Yosry Ahmed Date: Fri Apr 28 13:24:05 2023 +0000 memcg: use seq_buf_do_printk() with mem_cgroup_print_oom_meminfo() Currently, we format all the memcg stats into a buffer in mem_cgroup_print_oom_meminfo() and use pr_info() to dump it to the logs. However, this buffer is large in size. Although it is currently working as intended, ther is a dependency between the memcg stats buffer and the printk record size limit. If we add more stats in the future and the buffer becomes larger than the printk record size limit, or if the prink record size limit is reduced, the logs may be truncated. It is safer to use seq_buf_do_printk(), which will automatically break up the buffer at line breaks and issue small printk() calls. Refactor the code to move the seq_buf from memory_stat_format() to its callers, and use seq_buf_do_printk() to print the seq_buf in mem_cgroup_print_oom_meminfo(). Link: https://lkml.kernel.org/r/20230428132406.2540811-2-yosryahmed@google.com Signed-off-by: Yosry Ahmed Acked-by: Michal Hocko Reviewed-by: Sergey Senozhatsky Acked-by: Shakeel Butt Reviewed-by: Muchun Song Cc: Johannes Weiner Cc: Michal Hocko Cc: Petr Mladek Cc: Roman Gushchin Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 4bb6dc79d987b243d65c70c5029e51e719cfb94b Author: Douglas Anderson Date: Fri Apr 28 13:54:38 2023 -0700 migrate_pages: avoid blocking for IO in MIGRATE_SYNC_LIGHT The MIGRATE_SYNC_LIGHT mode is intended to block for things that will finish quickly but not for things that will take a long time. Exactly how long is too long is not well defined, but waits of tens of milliseconds is likely non-ideal. When putting a Chromebook under memory pressure (opening over 90 tabs on a 4GB machine) it was fairly easy to see delays waiting for some locks in the kcompactd code path of > 100 ms. While the laptop wasn't amazingly usable in this state, it was still limping along and this state isn't something artificial. Sometimes we simply end up with a lot of memory pressure. Putting the same Chromebook under memory pressure while it was running Android apps (though not stressing them) showed a much worse result (NOTE: this was on a older kernel but the codepaths here are similar). Android apps on ChromeOS currently run from a 128K-block, zlib-compressed, loopback-mounted squashfs disk. If we get a page fault from something backed by the squashfs filesystem we could end up holding a folio lock while reading enough from disk to decompress 128K (and then decompressing it using the somewhat slow zlib algorithms). That reading goes through the ext4 subsystem (because it's a loopback mount) before eventually ending up in the block subsystem. This extra jaunt adds extra overhead. Without much work I could see cases where we ended up blocked on a folio lock for over a second. With more extreme memory pressure I could see up to 25 seconds. We considered adding a timeout in the case of MIGRATE_SYNC_LIGHT for the two locks that were seen to be slow [1] and that generated much discussion. After discussion, it was decided that we should avoid waiting for the two locks during MIGRATE_SYNC_LIGHT if they were being held for IO. We'll continue with the unbounded wait for the more full SYNC modes. With this change, I couldn't see any slow waits on these locks with my previous testcases. NOTE: The reason I stated digging into this originally isn't because some benchmark had gone awry, but because we've received in-the-field crash reports where we have a hung task waiting on the page lock (which is the equivalent code path on old kernels). While the root cause of those crashes is likely unrelated and won't be fixed by this patch, analyzing those crash reports did point out these very long waits seemed like something good to fix. With this patch we should no longer hang waiting on these locks, but presumably the system will still be in a bad shape and hang somewhere else. [1] https://lore.kernel.org/r/20230421151135.v2.1.I2b71e11264c5c214bc59744b9e13e4c353bc5714@changeid Link: https://lkml.kernel.org/r/20230428135414.v3.1.Ia86ccac02a303154a0b8bc60567e7a95d34c96d3@changeid Signed-off-by: Douglas Anderson Suggested-by: Matthew Wilcox Reviewed-by: Matthew Wilcox (Oracle) Acked-by: Mel Gorman Cc: Hillf Danton Cc: Gao Xiang Cc: Alexander Viro Cc: Christian Brauner Cc: Gao Xiang Cc: Huang Ying Cc: Vlastimil Babka Cc: Yu Zhao Signed-off-by: Andrew Morton commit f785a8f21a9cc46fced9f53c51a6f2dc647ed484 Author: Roman Gushchin Date: Tue May 2 09:08:39 2023 -0700 mm: memcg: use READ_ONCE()/WRITE_ONCE() to access stock->cached A memcg pointer in the percpu stock can be accessed by drain_all_stock() from another cpu in a lockless way. In theory it might lead to an issue, similar to the one which has been discovered with stock->cached_objcg, where the pointer was zeroed between the check for being NULL and dereferencing. In this case the issue is unlikely a real problem, but to make it bulletproof and similar to stock->cached_objcg, let's annotate all accesses to stock->cached with READ_ONCE()/WTRITE_ONCE(). Link: https://lkml.kernel.org/r/20230502160839.361544-2-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin Acked-by: Shakeel Butt Cc: Dmitry Vyukov Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 3b8abb3239530c423c0b97e42af7f7e856e1ee96 Author: Roman Gushchin Date: Tue May 2 09:08:38 2023 -0700 mm: kmem: fix a NULL pointer dereference in obj_stock_flush_required() KCSAN found an issue in obj_stock_flush_required(): stock->cached_objcg can be reset between the check and dereference: ================================================================== BUG: KCSAN: data-race in drain_all_stock / drain_obj_stock write to 0xffff888237c2a2f8 of 8 bytes by task 19625 on cpu 0: drain_obj_stock+0x408/0x4e0 mm/memcontrol.c:3306 refill_obj_stock+0x9c/0x1e0 mm/memcontrol.c:3340 obj_cgroup_uncharge+0xe/0x10 mm/memcontrol.c:3408 memcg_slab_free_hook mm/slab.h:587 [inline] __cache_free mm/slab.c:3373 [inline] __do_kmem_cache_free mm/slab.c:3577 [inline] kmem_cache_free+0x105/0x280 mm/slab.c:3602 __d_free fs/dcache.c:298 [inline] dentry_free fs/dcache.c:375 [inline] __dentry_kill+0x422/0x4a0 fs/dcache.c:621 dentry_kill+0x8d/0x1e0 dput+0x118/0x1f0 fs/dcache.c:913 __fput+0x3bf/0x570 fs/file_table.c:329 ____fput+0x15/0x20 fs/file_table.c:349 task_work_run+0x123/0x160 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xcf/0xe0 kernel/entry/common.c:171 exit_to_user_mode_prepare+0x6a/0xa0 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x26/0x140 kernel/entry/common.c:296 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd read to 0xffff888237c2a2f8 of 8 bytes by task 19632 on cpu 1: obj_stock_flush_required mm/memcontrol.c:3319 [inline] drain_all_stock+0x174/0x2a0 mm/memcontrol.c:2361 try_charge_memcg+0x6d0/0xd10 mm/memcontrol.c:2703 try_charge mm/memcontrol.c:2837 [inline] mem_cgroup_charge_skmem+0x51/0x140 mm/memcontrol.c:7290 sock_reserve_memory+0xb1/0x390 net/core/sock.c:1025 sk_setsockopt+0x800/0x1e70 net/core/sock.c:1525 udp_lib_setsockopt+0x99/0x6c0 net/ipv4/udp.c:2692 udp_setsockopt+0x73/0xa0 net/ipv4/udp.c:2817 sock_common_setsockopt+0x61/0x70 net/core/sock.c:3668 __sys_setsockopt+0x1c3/0x230 net/socket.c:2271 __do_sys_setsockopt net/socket.c:2282 [inline] __se_sys_setsockopt net/socket.c:2279 [inline] __x64_sys_setsockopt+0x66/0x80 net/socket.c:2279 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0xffff8881382d52c0 -> 0xffff888138893740 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 19632 Comm: syz-executor.0 Not tainted 6.3.0-rc2-syzkaller-00387-g534293368afa #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Fix it by using READ_ONCE()/WRITE_ONCE() for all accesses to stock->cached_objcg. Link: https://lkml.kernel.org/r/20230502160839.361544-1-roman.gushchin@linux.dev Fixes: bf4f059954dc ("mm: memcg/slab: obj_cgroup API") Signed-off-by: Roman Gushchin Reported-by: syzbot+774c29891415ab0fd29d@syzkaller.appspotmail.com Reported-by: Dmitry Vyukov Link: https://lore.kernel.org/linux-mm/CACT4Y+ZfucZhM60YPphWiCLJr6+SGFhT+jjm8k1P-a_8Kkxsjg@mail.gmail.com/T/#t Reviewed-by: Yosry Ahmed Acked-by: Shakeel Butt Reviewed-by: Dmitry Vyukov Signed-off-by: Andrew Morton commit e90f15be2447d95d6b56068ad03c5ec73730103d Merge: f73b836edfef2 7df8eea64a417 Author: Stephen Boyd Date: Fri Jun 9 14:59:14 2023 -0700 Merge tag 'renesas-clk-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas Pull more Renesas clk driver updates from Geert Uytterhoeven: - Convert the Renesas clock drivers to readl_poll_timeout_atomic() * tag 'renesas-clk-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: rzg2l: Convert to readl_poll_timeout_atomic() clk: renesas: mstp: Convert to readl_poll_timeout_atomic() clk: renesas: cpg-mssr: Convert to readl_poll_timeout_atomic() iopoll: Do not use timekeeping in read_poll_timeout_atomic() iopoll: Call cpu_relax() in busy loops commit ded5c1a16ec69bb815f2b7d9ea4028913ebffca4 Merge: 7ec5d48fdb782 76abff37f0d70 Author: Jakub Kicinski Date: Fri Jun 9 14:40:33 2023 -0700 Merge branch 'tools-ynl-gen-code-gen-improvements-before-ethtool' Jakub Kicinski says: ==================== tools: ynl-gen: code gen improvements before ethtool I was going to post ethtool but I couldn't stand the ugliness of the if conditions which were previously generated. So I cleaned that up and improved a number of other things ethtool will benefit from. ==================== Link: https://lore.kernel.org/r/20230608211200.1247213-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 76abff37f0d70066503747a76deb40b752fb23be Author: Jakub Kicinski Date: Thu Jun 8 14:12:00 2023 -0700 tools: ynl-gen: support / skip pads on the way to kernel Kernel does not have padding requirements for 64b attrs. We can ignore pad attrs. Signed-off-by: Jakub Kicinski commit 6f96ec73cb5a87f438fa20c585e72b2918885df3 Author: Jakub Kicinski Date: Thu Jun 8 14:11:59 2023 -0700 tools: ynl-gen: don't pass op_name to RenderInfo The op_name argument is barely used and identical to op.name in all cases. Signed-off-by: Jakub Kicinski commit 6da3424fd629570b5e3b5e9484ffc752a325f9f5 Author: Jakub Kicinski Date: Thu Jun 8 14:11:58 2023 -0700 tools: ynl-gen: support code gen for events Netlink specs support both events and notifications (former can define their own message contents). Plug in missing code to generate types, parsers and include events into notification tables. Signed-off-by: Jakub Kicinski commit ced1568862bdb985eb4e5ca854cc7734a4ad3543 Author: Jakub Kicinski Date: Thu Jun 8 14:11:57 2023 -0700 tools: ynl-gen: sanitize notification tracking Don't modify the raw dicts (as loaded from YAML) to pretend that the notify attributes also exist on the ops. This makes the code easier to follow. Signed-off-by: Jakub Kicinski commit d0915d64c3a636f73065dbb7e5aab78eb7e75f0d Author: Jakub Kicinski Date: Thu Jun 8 14:11:56 2023 -0700 tools: ynl: regen: stop generating common notification handlers Remove unused notification handlers. Signed-off-by: Jakub Kicinski commit f2ba1e5e22081e3279fd248677f53ce719fdc23d Author: Jakub Kicinski Date: Thu Jun 8 14:11:55 2023 -0700 tools: ynl-gen: stop generating common notification handlers Common notification handler was supposed to be a way for the user to parse the notifications from a socket synchronously. I don't think we'll end up using it, ynl_ntf_check() works for all known use cases. Signed-off-by: Jakub Kicinski commit 7234415b8f86c496fec2d62a48f136cde530ad95 Author: Jakub Kicinski Date: Thu Jun 8 14:11:54 2023 -0700 tools: ynl: regen: regenerate the if ladders Renegate the code to combine } and else and use tmp variable to store type. Signed-off-by: Jakub Kicinski commit e4ea3cc68472b1cc0b68a1adf145ee39fb90a506 Author: Jakub Kicinski Date: Thu Jun 8 14:11:53 2023 -0700 tools: ynl-gen: get attr type outside of if() Reading attr type with mnl_attr_get_type() for each condition leads to most conditions being longer than 80 chars. Avoid this by reading the type to a variable on the stack. Signed-off-by: Jakub Kicinski commit 2c0f1466867c8405224b97d978b67f35d76b1dc1 Author: Jakub Kicinski Date: Thu Jun 8 14:11:52 2023 -0700 tools: ynl-gen: combine else with closing bracket Code gen currently prints: } else if (... This is really ugly. Fix it by delaying printing of closing brackets in anticipation of else coming along. Signed-off-by: Jakub Kicinski commit 820343ccbb2e11a6579a33a856dcc2a10bb3c7a6 Author: Jakub Kicinski Date: Thu Jun 8 14:11:51 2023 -0700 tools: ynl-gen: complete the C keyword list C keywords need to be avoided when naming things. Complete the list (ethtool has at least one thing called "auto"). Signed-off-by: Jakub Kicinski commit 9b52fd4b630526aa78bde8f9c6217954c71dc6a5 Author: Jakub Kicinski Date: Thu Jun 8 14:11:50 2023 -0700 tools: ynl: regen: cleanup user space header includes Remove unnecessary includes. Signed-off-by: Jakub Kicinski commit 30b5c720e1a90c9709187871c9f2152192078519 Author: Jakub Kicinski Date: Thu Jun 8 14:11:49 2023 -0700 tools: ynl-gen: cleanup user space header includes Bots started screaming that we're including stdlib.h twice. While at it move string.h into a common spot and drop stdio.h which we don't need. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5464 Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5466 Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5467 Signed-off-by: Jakub Kicinski commit 11ca605653480b2ddc70ec142a0a686796a7fc87 Author: Arnd Bergmann Date: Fri Jun 9 22:20:56 2023 +0200 Input: ads7846 - fix pointer cast warning The previous bugfix caused a warning on 64-bit builds: drivers/input/touchscreen/ads7846.c:1126:17: warning: cast to smaller integer type 'u32' (aka 'unsigned int') from 'const void *' [-Wvoid-pointer-to-int-cast] Change the cast back to something that works on both 32-bit and 64-bit kernels. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306100442.jStknDT1-lkp@intel.com/ Fixes: 8f7913c04f6a7 ("Input: ads7846 - Fix usage of match data") Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann commit e54223275ba1bc6f704a6bab015fcd2ae4f72572 Author: Ross Lagerwall Date: Thu May 25 16:32:48 2023 +0100 PCI: Release resource invalidated by coalescing When contiguous windows are coalesced by pci_register_host_bridge(), the second resource is expanded to include the first, and the first is invalidated and consequently not added to the bus. However, it remains in the resource hierarchy. For example, these windows: fec00000-fec7ffff : PCI Bus 0000:00 fec80000-fecbffff : PCI Bus 0000:00 are coalesced into this, where the first resource remains in the tree with start/end zeroed out: 00000000-00000000 : PCI Bus 0000:00 fec00000-fecbffff : PCI Bus 0000:00 In some cases (e.g. the Xen scratch region), this causes future calls to allocate_resource() to choose an inappropriate location which the caller cannot handle. Fix by releasing the zeroed-out resource and removing it from the resource hierarchy. [bhelgaas: commit log] Fixes: 7c3855c423b1 ("PCI: Coalesce host bridge contiguous apertures") Link: https://lore.kernel.org/r/20230525153248.712779-1-ross.lagerwall@citrix.com Signed-off-by: Ross Lagerwall Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v5.16+ commit 03dc0e05407f394d4f8b3da8210013fef91e74ff Author: Baoquan He Date: Mon May 15 14:02:59 2023 +0800 Documentation: add kdump.rst to present crashkernel reservation on arm64 People complained the crashkernel reservation code flow is hard to follow, so add this document to explain the background, concepts and implementation of crashkernel reservation on arm64. Hope this can help people to understand it more easily. Signed-off-by: Baoquan He Reviewed-by: Zhen Lei Link: https://lore.kernel.org/r/20230515060259.830662-3-bhe@redhat.com [catalin.marinas@arm.com: rewrote some sentences, removed others] Signed-off-by: Catalin Marinas commit 4dea2fd6e83c4aaa47c68987d4c68d39b5ae9654 Author: Dmitry Baryshkov Date: Fri Jun 9 05:25:51 2023 +0300 power: reset: qcom-pon: add support for pm8941-pon For PM8941 we don't have a defined field to store the reset reason. Support wrapping pwrkey and resin, but without writing the reset reason. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Signed-off-by: Sebastian Reichel commit 7a54cf02d7176aec484aca7e010deee21d3117ad Author: Dmitry Baryshkov Date: Fri Jun 9 05:25:50 2023 +0300 dt-bindings: power: reset: qcom-pon: define pm8941-pon On PM8941 pon doesn't store the reset reason. However we still need the wrapping node for pwrkey and resin nodes. Add bindings for pm8941-pon device. Signed-off-by: Dmitry Baryshkov Acked-by: Rob Herring Signed-off-by: Sebastian Reichel commit dd58d666ac08eb5eb81e4956172fc52b3bf0ab38 Author: Willy Tarreau Date: Wed Jun 7 22:28:58 2023 +0200 selftests/nolibc: make sure gcc always use little endian on MIPS The test on MIPS stopped working after I upgraded some of my toolchains to use the ones from kernel.org because the mips toolchain defaults to big endian, even though it supports both endians. Let's just add an explicit -EL to make sure it always succeeds like the kernel does. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit fa0df56a804b9b1df6caea7f178771665e46d218 Author: Willy Tarreau Date: Sun Jun 4 14:14:27 2023 +0200 selftests/nolibc: also count skipped and failed tests in output Right now skipped and failed test counts are not reported, and a few times already we missed skipped ones that ought not to. Let's now count each category and continue to invite the user to check the report file when skipped+fail > 0. E.g: $ make run-user (...) CC nolibc-test 136 test(s) passed, 2 skipped, 0 failed. See all results in .../run.out Note that it's important to be careful about the trailing \r on the qemu output (thanks Zhangjin for noticing). Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 957bfa31f1d93ba7ea9fda2a401b0f3c79129d5e Author: Zhangjin Wu Date: Sat Jun 3 16:16:07 2023 +0800 selftests/nolibc: add new gettimeofday test cases These 2 test cases are added to cover the normal using scenes of gettimeofday(). They have been used to trigger and fix up such issue with nolibc: nolibc-test.c:(.text.gettimeofday+0x54): undefined reference to `__aeabi_ldivmod' This issue happens while there is no "unsigned int" conversion in the coming new clock_gettime / clock_gettime64 syscall path of gettimeofday(): tv->tv_usec = ts.tv_nsec / 1000; Suggested-by: Thomas Weißschuh Link: https://lore.kernel.org/linux-riscv/280867a8-7601-4a96-9b85-87668e1f1282@t-8ch.de/ Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 4cbab2eca009ca022ae17596b5f3d4024c52a65b Author: Zhangjin Wu Date: Sat Jun 3 16:14:55 2023 +0800 selftests/nolibc: remove gettimeofday_bad1/2 completely In the clock_gettime / clock_gettime64 syscalls based gettimeofday(), there is no way to let kernel space 'fixup' the invalid data pointer of 'struct timeval' and 'struct timezone' for us for we need to read timespec from kernel space and then convert to timeval in user-space ourselves and also we need to simply ignore and reset timezone in user-space. Without this removal, the invalid (void *)1 address will trigger a sigsegv (signum = 11) signal and stop the whole test. Suggested-by: Willy Tarreau Link: https://lore.kernel.org/linux-riscv/20230528113325.GJ1956@1wt.eu/ Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 75d75a7b2803173c376b01e1f992f6364a5fdb33 Author: Zhangjin Wu Date: Sat Jun 3 16:13:40 2023 +0800 selftests/nolibc: support two errnos with EXPECT_SYSER2() Some functions may be implemented with different syscalls in different platforms, these syscalls may set different errnos for the same arguments, let's support such cases. Suggested-by: Willy Tarreau Link: https://lore.kernel.org/linux-riscv/20230528113325.GJ1956@1wt.eu/ Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit f62ec079d0899331085ff3537848e55cc316d751 Author: Zhangjin Wu Date: Sat Jun 3 16:11:57 2023 +0800 tools/nolibc: open: fix up compile warning for arm In function ‘open’: nolibc/sysroot/arm/include/sys.h:919:23: warning: ‘mode_t’ {aka ‘short unsigned int’} is promoted to ‘int’ when passed through ‘...’ 919 | mode = va_arg(args, mode_t); | ^ nolibc/sysroot/arm/include/sys.h:919:23: note: (so you should pass ‘int’ not ‘mode_t’ {aka ‘short unsigned int’} to ‘va_arg’) nolibc/sysroot/arm/include/sys.h:919:23: note: if this code is reached, the program will abort Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 646ff7c7edaade6b1ea81fa2e132c52a346bba39 Author: Zhangjin Wu Date: Sat Jun 3 16:09:41 2023 +0800 tools/nolibc: arm: add missing my_syscall6 This is required by the coming removal of the oldselect and newselect support. pselect6/pselect6_time64 will be used unconditionally, they have 6 arguments. Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/linux-riscv/bf3e07c1-75f5-425b-9124-f3f2b230e63a@app.fastmail.com/ Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit a36cfc5e483e7bf609b3d39d83150626d92355e0 Author: Zhangjin Wu Date: Sat Jun 3 16:08:12 2023 +0800 selftests/nolibc: use INT_MAX instead of __INT_MAX__ nolibc now has INT_MAX in stdint.h, so, don't mix INT_MAX and __INT_MAX__, unify them to INT_MAX. Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit bd27fef32960f5c9da57a50d58aa9f0bf0a3ff54 Author: Zhangjin Wu Date: Sat Jun 3 16:06:57 2023 +0800 selftests/nolibc: not include limits.h for nolibc When compile nolibc-test.c with 2.31 glibc, we got such error: In file included from /usr/riscv64-linux-gnu/include/sys/cdefs.h:452, from /usr/riscv64-linux-gnu/include/features.h:461, from /usr/riscv64-linux-gnu/include/bits/libc-header-start.h:33, from /usr/riscv64-linux-gnu/include/limits.h:26, from /usr/lib/gcc-cross/riscv64-linux-gnu/9/include/limits.h:194, from /usr/lib/gcc-cross/riscv64-linux-gnu/9/include/syslimits.h:7, from /usr/lib/gcc-cross/riscv64-linux-gnu/9/include/limits.h:34, from /labs/linux-lab/src/linux-stable/tools/testing/selftests/nolibc/nolibc-test.c:6: /usr/riscv64-linux-gnu/include/bits/wordsize.h:28:3: error: #error "rv32i-based targets are not supported" 28 | # error "rv32i-based targets are not supported" Glibc (>= 2.33) commit 5b6113d62efa ("RISC-V: Support the 32-bit ABI implementation") fixed up above error. As suggested by Thomas, defining INT_MIN/INT_MAX for nolibc can remove the including of limits.h, and therefore no above error. of course, the other libcs still require limits.h, move it to the right place. The LONG_MIN/LONG_MAX are also defined too. Suggested-by: Thomas Weißschuh Link: https://lore.kernel.org/linux-riscv/09d60dc2-e298-4c22-8e2f-8375861bd9be@t-8ch.de/ Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 0858aec4359636e539c6f26a1f3c9a3eceb87494 Author: Zhangjin Wu Date: Sat Jun 3 16:05:30 2023 +0800 selftests/nolibc: fix up compile warning with glibc on x86_64 Compiling nolibc-test.c with gcc on x86_64 got such warning: tools/testing/selftests/nolibc/nolibc-test.c: In function ‘expect_eq’: tools/testing/selftests/nolibc/nolibc-test.c:177:24: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=] 177 | llen += printf(" = %lld ", expr); | ~~~^ ~~~~ | | | | | uint64_t {aka long unsigned int} | long long int | %ld It because that glibc defines uint64_t as "unsigned long int" when word size (means sizeof(long)) is 64bit (see include/bits/types.h), but nolibc directly use the 64bit "unsigned long long" (see tools/include/nolibc/stdint.h), which is simpler, seems kernel uses it too (include/uapi/asm-generic/int-ll64.h). use a simple conversion to solve it. Suggested-by: Willy Tarreau Link: https://lore.kernel.org/linux-riscv/20230529130449.GA2813@1wt.eu/ Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit c88e46d6d63b789bb2d5050e62ec0a0a477d4dfb Author: Zhangjin Wu Date: Sat Jun 3 16:04:10 2023 +0800 selftests/nolibc: allow specify extra arguments for qemu The opensbi package from Ubuntu 20.04 only provides rv64 firmwares: $ dpkg -S opensbi | grep -E "fw_.*bin|fw_.*elf" | uniq opensbi: /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_dynamic.bin opensbi: /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.bin opensbi: /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_dynamic.elf opensbi: /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf To run this nolibc test for rv32, users must build opensbi or download a prebuilt one from qemu repository: https://gitlab.com/qemu-project/qemu/-/blob/master/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin And then use -bios to tell qemu use it to avoid such failure: $ qemu-system-riscv32 -display none -no-reboot -kernel /path/to/arch/riscv/boot/Image -serial stdio -M virt -append "console=ttyS0 panic=-1" qemu-system-riscv32: Unable to load the RISC-V firmware "opensbi-riscv32-generic-fw_dynamic.bin" To run from makefile, QEMU_ARGS_EXTRA is added to allow pass extra arguments like -bios: $ make run QEMU_ARGS_EXTRA="-bios /path/to/opensbi-riscv32-generic-fw_dynamic.bin" ... Suggested-by: Thomas Weißschuh Link: https://lore.kernel.org/linux-riscv/2ab94136-d341-4a26-964e-6d6c32e66c9b@t-8ch.de/ Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit a4c65af1511c8cf14ada10a957250c5051b8ccac Author: Thomas Weißschuh Date: Tue May 30 15:48:48 2023 +0200 selftests/nolibc: remove test gettimeofday_null gettimeofday() is not guaranteed by posix to handle a NULL value as first argument gracefully. On glibc for example it crashes. (When not going through the vdso) Link: https://lore.kernel.org/lkml/96f1134d-ce6e-4d82-ae00-1cd4038809c4@t-8ch.de/ Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit f9bf5944d37b75b8238349d4fb5b7a97bbecfc9d Author: Thomas Weißschuh Date: Tue May 30 11:18:00 2023 +0200 tools/nolibc: ensure fast64 integer types have 64 bits On 32bit platforms size_t is not enough to represent [u]int_fast64_t. Fixes: 3e9fd4e9a1d5 ("tools/nolibc: add integer types and integer limit macros") Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit ed495f0945e732c55bb8c21e660c2c86f5e57812 Author: Zhangjin Wu Date: Tue May 30 14:03:33 2023 +0800 selftests/nolibc: test_fork: fix up duplicated print running nolibc-test with glibc on x86_64 got such print issue: 29 execve_root = -1 EACCES [OK] 30 fork30 fork = 0 [OK] 31 getdents64_root = 712 [OK] The fork test case has three printf calls: (1) llen += printf("%d %s", test, #name); (2) llen += printf(" = %d %s ", expr, errorname(errno)); (3) llen += pad_spc(llen, 64, "[FAIL]\n"); --> vfprintf() In the following scene, the above issue happens: (a) The parent calls (1) (b) The parent calls fork() (c) The child runs and shares the print buffer of (1) (d) The child exits, flushs the print buffer and closes its own stdout/stderr * "30 fork" is printed at the first time. (e) The parent calls (2) and (3), with "\n" in (3), it flushs the whole buffer * "30 fork = 0 ..." is printed Therefore, there are two "30 fork" in the stdout. Between (a) and (b), if flush the stdout (and the sterr), the child in stage (c) will not be able to 'see' the print buffer. Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 0dd2fdbfa59373a77b4d6ba82027b60700b6a0a0 Author: Zhangjin Wu Date: Thu May 25 01:58:39 2023 +0800 tools/nolibc: ppoll/ppoll_time64: add a missing argument The ppoll and ppoll_time64 syscalls have 5 arguments, but we only provide 4, align with kernel and add the missing sigsetsize argument. Because the sigmask is NULL, the last sigsetsize argument is ignored, keep it as 0 here is safe enough. Signed-off-by: Zhangjin Wu Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit da1affc5cedacb91ce0a15ad768e56383d1e48b7 Author: Zhangjin Wu Date: Thu May 25 01:54:19 2023 +0800 selftests/nolibc: remove the duplicated gettimeofday_bad2 There were two exactly similar occurrences of this test. Signed-off-by: Zhangjin Wu Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 758f970f4204d17b4e14774d6eb2b8bdecda067e Author: Zhangjin Wu Date: Thu May 25 01:46:54 2023 +0800 selftests/nolibc: print name instead of number for EOVERFLOW EOVERFLOW will be used in the coming time64 syscalls support. Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 87b9fa66af9ad92097c0593626dea3654ec19fd0 Author: Thomas Weißschuh Date: Sat May 27 14:56:42 2023 +0200 tools/nolibc: support nanoseconds in stat() Keep backwards compatibility through unions. The compatibility macros like #define st_atime st_atim.tv_sec as documented in stat(3type) don't work for nolibc because it would break with other stat-like structures that contain the field st_atime. The stx_atime, stx_mtime, stx_ctime are in type of 'struct statx_timestamp', which is incompatible with 'struct timespec', should be converted explicitly. /* include/uapi/linux/stat.h */ struct statx_timestamp { __s64 tv_sec; __u32 tv_nsec; __s32 __reserved; }; /* include/uapi/linux/time.h */ struct timespec { __kernel_old_time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/linux-riscv/3a3edd48-1ace-4c89-89e8-9c594dd1b3c9@t-8ch.de/ Co-authored-by: Zhangjin Wu Signed-off-by: Zhangjin Wu [wt: squashed Zhangjin & Thomas' patches into one to preserve "bisectability"] Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 9a75575b81b5639f7ca82c9701fb199401fd6471 Author: Thomas Weißschuh Date: Fri May 26 09:51:20 2023 +0200 selftests/nolibc: prevent coredumps during test execution The child process forked during stackprotector tests intentionally gets killed with SIGABRT. By default this will trigger writing a coredump. The writing of the coredump can spam the systems coredump machinery and take some time. Timings for the full run of nolibc-test: Before: 200ms After: 20ms This is on a desktop x86 system with systemd-coredumpd enabled. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 208aa9d94c1181d8dff8e60d681e3b6cf0b37fae Author: Thomas Weißschuh Date: Fri May 26 09:51:19 2023 +0200 tools/nolibc: add support for prctl() It will be used to disable core dumps from the child spawned to validate the stack protector functionality. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 79d8d4cad2252dd69076cc7997e56459baf523b1 Author: Thomas Weißschuh Date: Wed May 24 18:27:06 2023 +0200 tools/nolibc: s390: disable stackprotector in _start s390 does not support the "global" stack protector mode that is implemented in nolibc. Now that nolibc detects if stack protectors are enabled at runtime it could happen that a future compiler does indeed use global mode on and nolibc would compile but segfault at runtime. To avoid this hypothetic case and to align s390 with the other architectures disable stack protectors when compiling _start(). Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit e76b70dec9c257f4ccebd7f98d1de97ed071f0d1 Author: Thomas Weißschuh Date: Wed May 24 08:44:44 2023 +0200 tools/nolibc: fix segfaults on compilers without attribute no_stack_protector Not all compilers, notably GCC < 10, have support for __attribute__((no_stack_protector)). Fall back to a mechanism that also works there. Tested with GCC 9.5.0 from kernel.org crosstools. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 0093c2dae8d37595c3c7fcc626b51300699a003b Author: Thomas Weißschuh Date: Sun May 21 11:36:35 2023 +0200 tools/nolibc: simplify stackprotector compiler flags Now that nolibc enable stackprotector support automatically when the compiler enables it we only have to get the -fstack-protector flags correct. The cc-options are structured so that -fstack-protector-all is only enabled if -mstack-protector=guard works, as that is the only mode supported by nolibc. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 818924d1295ea16db267ea6defe08b21243583b6 Author: Thomas Weißschuh Date: Sun May 21 11:36:34 2023 +0200 tools/nolibc: add autodetection for stackprotector support The stackprotector support in nolibc should be enabled iff it is also enabled in the compiler. Use the preprocessor defines added by gcc and clang if stackprotector support is enable to automatically do so in nolibc. This completely removes the need for any user-visible API. To avoid inlining the lengthy preprocessor check into every user introduce a new header compiler.h that abstracts the logic away. As the define NOLIBC_STACKPROTECTOR is now not user-relevant anymore prefix it with an underscore. Suggested-by: Willy Tarreau Link: https://lore.kernel.org/lkml/20230520133237.GA27501@1wt.eu/ Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit e21a2eef74305b9ec2b8dcecf364aeb5e2e10e2e Author: Thomas Weißschuh Date: Sun May 21 11:36:33 2023 +0200 tools/nolibc: reformat list of headers to be installed This makes it easier to add and remove more entries in the future without creating spurious diff hunks. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 8525092104ca97d5131fe594081dc176bcce34b5 Author: Thomas Weißschuh Date: Sun May 21 11:36:32 2023 +0200 tools/nolibc: add test for __stack_chk_guard initialization Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 88fc7eb54ecc6db8b773341ce39ad201066fa7da Author: Thomas Weißschuh Date: Sun May 21 11:36:31 2023 +0200 tools/nolibc: ensure stack protector guard is never zero The all-zero pattern is one of the more probable out-of-bound writes so add a special case to not accidentally accept it. Also it enables the reliable detection of stack protector initialization during testing. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 7a9b2345202a14dfec9081994486156f7a691513 Author: Thomas Weißschuh Date: Sun May 21 11:36:30 2023 +0200 tools/nolibc: x86_64: disable stack protector for _start This was forgotten in the original submission. It is unknown why it worked for x86_64 on some compiler without this attribute. Reported-by: Willy Tarreau Closes: https://lore.kernel.org/lkml/20230520133237.GA27501@1wt.eu/ Fixes: 0d8c461adbc4 ("tools/nolibc: x86_64: add stackprotector support") Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 659ee30f33b1cbafcc364cffc24db0fe31f26ed5 Author: Thomas Weißschuh Date: Sun May 21 11:36:29 2023 +0200 tools/nolibc: fix typo pint -> point Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 56d294a50cf34990dec8886bef3f1a1386d56ac6 Author: Thomas Weißschuh Date: Sat May 20 11:53:35 2023 +0200 tools/nolibc: riscv: add stackprotector support Signed-off-by: Thomas Weißschuh Acked-by: Palmer Dabbelt Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 3da0de377b5c93518e894f63766d3555ed883f93 Author: Thomas Weißschuh Date: Mon Apr 17 18:01:36 2023 +0200 tools/nolibc: mips: add stackprotector support Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit ca2d0437141681cf3d446e7002692c3617a5bd28 Author: Thomas Weißschuh Date: Mon Apr 17 18:01:35 2023 +0200 tools/nolibc: loongarch: add stackprotector support Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit ed6c0d89bb391c736850e79dbc82aea5e078a941 Author: Thomas Weißschuh Date: Mon Apr 17 18:01:34 2023 +0200 tools/nolibc: arm: add stackprotector support Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit c1e30f7d38fd64add1fff08b59c21cf3129e4f7f Author: Thomas Weißschuh Date: Mon Apr 17 18:01:33 2023 +0200 tools/nolibc: aarch64: add stackprotector support Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 443de903146e83c13ce43d4ad7ed470129aa348a Author: Thomas Weißschuh Date: Mon Apr 17 18:01:31 2023 +0200 selftests/nolibc: reduce syscalls during space padding Previously each space character used for alignment during test execution was written in a single write() call. This would make the output from strace fairly unreadable. Coalesce all spaces into a single call to write(). Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit ec8e1b73d58863d1600ca292c9d18de4ec258ba7 Author: Zhangjin Wu Date: Sat Jun 3 16:00:46 2023 +0800 selftests/nolibc: syscall_args: use generic __NR_statx Compiling nolibc-test.c for rv32 got such error: tools/testing/selftests/nolibc/nolibc-test.c:599:57: error: ‘__NR_fstat’ undeclared (first use in this function) 599 | CASE_TEST(syscall_args); EXPECT_SYSER(1, syscall(__NR_fstat, 0, NULL), -1, EFAULT); break; The generic include/uapi/asm-generic/unistd.h used by rv32 doesn't support __NR_fstat, use the more generic __NR_statx instead: Running test 'syscall' 69 syscall_noargs = 1 [OK] 70 syscall_args = -1 EFAULT [OK] __NR_statx has been added from v4.10: commit a528d35e8bfc ("statx: Add a system call to make enhanced file info available") It has been supported by all of the platforms since at least from v4.20. Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/linux-riscv/ee8b1f02-ded1-488b-a3a5-68774f0349b5@app.fastmail.com/ Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 53fcfafa8c5c848d4ef1712053f6ea23b263a0de Author: Thomas Weißschuh Date: Sat May 20 09:58:57 2023 +0200 tools/nolibc/unistd: add syscall() syscall() is used by "normal" libcs to allow users to directly call syscalls. By having the same syntax inside nolibc users can more easily write code that works with different libcs. The macro logic is adapted from systemtaps STAP_PROBEV() macro that is released in the public domain / CC0. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit c22c7c81af4d061e484e0833fbc3418d0f3008d4 Author: Zhangjin Wu Date: Fri May 19 01:02:12 2023 +0800 tools/nolibc: riscv: Fix up load/store instructions for rv32 When compile nolibc application for rv32, we got such errors: nolibc/sysroot/riscv/include/arch.h:190: Error: unrecognized opcode `ld a4,0(a3)' nolibc/sysroot/riscv/include/arch.h:194: Error: unrecognized opcode `sd a3,%lo(_auxv)(a4)' nolibc/sysroot/riscv/include/arch.h:196: Error: unrecognized opcode `sd a2,%lo(environ)(a3)' Refer to arch/riscv/include/asm/asm.h and add REG_L/REG_S macros here to let rv32 uses its own lw/sw instructions. Signed-off-by: Zhangjin Wu Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 72ffbc6784a40b958ac9a4e68049dc14730a4024 Author: Thomas Weißschuh Date: Fri Apr 28 17:52:11 2023 +0200 tools/nolibc: remove LINUX_REBOOT_ constants The same constants and some more have been exposed to userspace via linux/reboot.h for a long time. To avoid conflicts and trim down nolibc a bit drop the custom definitions. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 3ad09d72e4d2232374f0dadf94641011b5772bb2 Author: Thomas Weißschuh Date: Sat Apr 15 23:28:48 2023 +0200 tools/nolibc: add testcase for fork()/waitpid() On s390 the arguments to clone() which is used by fork() are different than other archs. Make sure everything works correctly. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 404fa87c0eafbd420c2a016b964facb92250ae85 Author: Thomas Weißschuh Date: Sat Apr 15 23:28:47 2023 +0200 tools/nolibc: s390: provide custom implementation for sys_fork On s390 the first two arguments to the clone() syscall are swapped, as documented in clone(2). Signed-off-by: Thomas Weißschuh Cc: Sven Schnelle Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit f2fa6b384c67feebd367fa2cb45254a79fd37312 Author: Thomas Weißschuh Date: Thu Apr 6 21:54:57 2023 +0000 tools/nolibc: validate C89 compatibility To make sure no non-compatible changes are introduced accidentally validate the language standard when building the tests. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit fddc8f81f1cccb081b69b66b1e0f5cfba58c7b43 Author: Thomas Weißschuh Date: Thu Apr 6 21:54:49 2023 +0000 tools/nolibc: use C89 comment syntax Most of nolibc is already using C89 comments. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 0738c2d7bf93cb2c11cd4b24b53a77fe9faaad5d Author: Thomas Weißschuh Date: Thu Apr 6 21:54:48 2023 +0000 tools/nolibc: use __inline__ syntax When building in strict C89 mode the "inline" keyword is unknown. While "__inline__" is non-standard it is used by the kernel headers themselves. So the used compilers would have to support it or the users shim it with a #define. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 7f291cfa90d7f95da11fe9aa7062344ddfce603a Author: Thomas Weißschuh Date: Thu Apr 6 21:54:47 2023 +0000 tools/nolibc: use standard __asm__ statements Most of the code was migrated to C99-conformant __asm__ statements before. It seems string.h was missed. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 3a8039e289a337aeaa9ad37f3fcd411d83fee983 Author: Mark Brown Date: Thu Apr 13 17:26:32 2023 +0100 tools/nolibc: Fix build of stdio.h due to header ordering When we added fd based file streams we created references to STx_FILENO in stdio.h but these constants are declared in unistd.h which is the last file included by the top level nolibc.h meaning those constants are not defined when we try to build stdio.h. This causes programs using nolibc.h to fail to build. Reorder the headers to avoid this issue. Fixes: d449546c957f ("tools/nolibc: implement fd-based FILE streams") Signed-off-by: Mark Brown Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 69f2cd9fea01a21259d361e839efd02cba7fe945 Author: Thomas Weißschuh Date: Sun Apr 2 20:48:06 2023 +0200 tools/nolibc: add testcases for vfprintf vfprintf() is complex and so far did not have proper tests. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 5df28c153dade7920fce3998d4c7b1a60db5ae79 Author: Thomas Weißschuh Date: Sun Apr 2 20:48:05 2023 +0200 tools/nolibc: implement fd-based FILE streams This enables the usage of the stream APIs with arbitrary filedescriptors. It will be used by a future testcase. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit e8842cf04ee0e746a42e4a21b9a3a6a1327596cf Author: Thomas Weißschuh Date: Sun Apr 2 20:48:04 2023 +0200 tools/nolibc: add wrapper for memfd_create This is useful for users and will also be used by a future testcase. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit fc82d7dbca3b789897bfb7fb5098439959c8f296 Author: Thomas Weißschuh Date: Sun Apr 2 20:48:03 2023 +0200 tools/nolibc: add libc-test binary This can be used to easily compare the behavior of nolibc to the system libc. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 2df07fc55d5cf377308fad02a022cf0f0401daf4 Author: Willy Tarreau Date: Sun Apr 2 10:13:57 2023 +0200 tools/nolibc: fix build of the test case using glibc Some extra tests for various integer types and limits were added by commit d1209597ff00 ("tools/nolibc: add tests for the integer limits in stdint.h"), but we forgot to retest with glibc. Stddef and stdint are now needed for the program to build there. Cc: Vincent Dagonneau Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit aa662d127e651df6e51d710014d7eb4c2a3049f5 Author: Willy Tarreau Date: Sun Apr 2 10:13:56 2023 +0200 tools/nolibc: tests: fix build on non-c99 compliant compilers Commit 9735716830f2 ("tools/nolibc: tests: add test for -fstack-protector") brought a declaration inside the initialization statement of a for loop, which breaks the build on compilers that do not default to c99 compatibility, making it more difficult to validate that the lib still builds on such compilers. The fix is trivial, so let's move the declaration to the variables block of the function instead. No backport is needed. Cc: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit e7654c3fbdb348a0c54244015d97f0a0b8773b8c Author: Thomas Weißschuh Date: Tue Mar 28 18:18:45 2023 +0200 tools/nolibc: tests: use volatile to force stack smashing Use a volatile pointer to write outside the buffer so the compiler can't optimize it away. Reported-by: Alexey Dobriyan Link: https://lore.kernel.org/lkml/c0584807-511c-4496-b062-1263ea38f349@p183/ Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 7ec5d48fdb78260a51122bd8d0cee4a0e2b7b089 Author: Jakub Kicinski Date: Fri Jun 9 11:00:59 2023 -0700 Revert "tools: ynl: Remove duplicated include in handshake-user.c" This reverts commit e7c5433c5aaab52ddd5448967a9a5db94a3939cc. Commit e7c5433c5aaa ("tools: ynl: Remove duplicated include in handshake-user.c") was applied too hastily. It changes an auto-generated file, and there's already a proper fix on the list. Link: https://lore.kernel.org/all/ZIMPLYi%2FxRih+DlC@nanopsycho/ Signed-off-by: Jakub Kicinski commit bb91a7d96a5c9662f41a08024f405bf9ad333e86 Author: Christoph Hellwig Date: Fri Jun 9 07:17:37 2023 +0200 block: fix rootwait= again The previous rootwait fix added an -EINVAL return to a completely bogus superflous branch, fix this. Fixes: 1341c7d2ccf4 ("block: fix rootwait=") Reported-by: Mark Brown Signed-off-by: Christoph Hellwig Tested-by: Fabio Estevam Tested-by: Marek Szyprowski Tested-by: Mark Brown Link: https://lore.kernel.org/r/20230609051737.328930-1-hch@lst.de Signed-off-by: Jens Axboe commit 7ad697cdd31b9d5e59e25b035bad4cdd8e76aca1 Author: Bryan Tan Date: Mon Jun 5 11:37:28 2023 -0700 RDMA/vmw_pvrdma: Remove unnecessary check on wr->opcode wr->opcode is unsigned; checking if it is negative is unnecessary. Fix this issue by removing the check. Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver") Link: https://lore.kernel.org/r/20230605183728.47021-1-bryantan@vmware.com Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/07c48eee-0aca-48ee-897a-38588c341c41@kili.mountain Signed-off-by: Bryan Tan Signed-off-by: Jason Gunthorpe commit c3e1bf626eb3c53ea60a0c64b441fb3015e1652e Author: Bob Pearson Date: Fri Jun 2 11:42:29 2023 -0500 RDMA/rxe: Send last wqe reached event on qp cleanup The IBA requires: o11-5.2.5: If the HCA supports SRQ, for RC and UD service, the CI shall generate a Last WQE Reached Affiliated Asynchronous Event on a QP that is in the Error State and is associated with an SRQ when either: • a CQE is generated for the last WQE, or • the QP gets in the Error State and there are no more WQEs on the RQ. This patch implements this behavior in flush_recv_queue() which is called as a result of rxe_qp_error() being called whenever the qp is put into the error state. The rxe responder executes SRQ WQEs directly from the SRQ so there are never more WQES on the RQ. Link: https://lore.kernel.org/r/20230602164229.9277-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 3b718dcaf163d17fe907ea098c8449e0cd6bc271 Author: Austin Zheng Date: Wed May 24 11:52:12 2023 -0400 drm/amd/display: Filter out AC mode frequencies on DC mode systems Why: Limit maximum clock speeds to DC mode limits for DC mode systems How: Store DC mode limits when individual clocks are initialized and cap the values when building the clock table Acked-by: Stylon Wang Signed-off-by: Austin Zheng Reviewed-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 24e52fc20201c87912eee8f337829c036c3b0f3a Author: Sridevi Date: Wed May 10 14:34:55 2023 -0400 drm/amd/display: DSC Programming Deltas [Why] Programming register delta for DSC sub-block [How] Change DSC, resource files for programming register delta. Acked-by: Stylon Wang Signed-off-by: Sridevi Reviewed-by: Chris Park Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit aeb3dd7e6f91da0a8c460d61fad13db85b3b33b7 Author: Leo Ma Date: Thu May 18 14:07:13 2023 -0400 Revert "drm/amd/display: cache trace buffer size" Revert commit 257e9891db0b ("drm/amd/display: cache trace buffer size") to fix regression found in tests. Acked-by: Stylon Wang Signed-off-by: Leo Ma Reviewed-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 57a8011512131c63cf700d42ef56ad875409a1a5 Author: Kenneth Feng Date: Thu Jun 8 22:07:11 2023 +0800 drm/amd/pm: workaround for compute workload type on some skus On smu 13.0.0, the compute workload type cannot be set on all the skus due to some other problems. This workaround is to make sure compute workload type can also run on some specific skus. v2: keep the variable consistent Signed-off-by: Kenneth Feng Acked-by: Lijo Lazar Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit 389c6b3e120303715c018d1bfc7bab02b50ca3f4 Author: Charlene Liu Date: Fri May 19 20:43:30 2023 -0400 drm/amd/display: add NULL pointer check [why] check dmub_Srv exist or not before accessing dmub. Acked-by: Stylon Wang Signed-off-by: Charlene Liu Reviewed-by: Zhan Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3ffb193969c57afd4096cfb107ca2cc3bb0c55d9 Author: shikaguo Date: Fri Jun 9 11:32:09 2023 +0800 drm/amd/pm: enable more Pstates profile levels for yellow_carp This patch enables following UMD stable Pstates profile levels for power_dpm_force_performance_level interface. - profile_peak - profile_min_mclk - profile_min_sclk - profile_standard Signed-off-by: shikaguo Reviewed-by: Tim Huang Signed-off-by: Alex Deucher commit 80e709ee6ecc9eba8bd8d188218472822e1b38bd Author: Chong Li Date: Wed Jun 7 15:56:12 2023 +0800 drm/amdgpu: add option params to enforce process isolation between graphics and compute enforce process isolation between graphics and compute via using the same reserved vmid. v2: remove params "struct amdgpu_vm *vm" from amdgpu_vmid_alloc_reserved and amdgpu_vmid_free_reserved. Signed-off-by: Chong Li Reviewed-by: Christian Koenig Signed-off-by: Alex Deucher commit 4e70da985cef954cdf7813d651c067d2c602ea71 Author: Nathan Chancellor Date: Thu Jun 8 10:01:57 2023 -0700 drm/amdgpu: Wrap -Wunused-but-set-variable in cc-option -Wunused-but-set-variable was only supported in clang starting with 13.0.0, so earlier versions will emit a warning, which is turned into a hard error for the kernel to mirror GCC: error: unknown warning option '-Wunused-but-set-variable'; did you mean '-Wunused-const-variable'? [-Werror,-Wunknown-warning-option] The minimum supported version of clang for building the kernel is 11.0.0, so match the rest of the kernel and wrap -Wunused-but-set-variable in a cc-option call, so that it is only used when supported by the compiler. Closes: https://github.com/ClangBuiltLinux/linux/issues/1869 Fixes: 1b320ad3f5a8 ("drm/amd/amdgpu: introduce DRM_AMDGPU_WERROR") Signed-off-by: Nathan Chancellor Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 9d65b1b4bcf3918164e17365eec169875eef8ee3 Author: Shiwu Zhang Date: Tue May 23 12:02:32 2023 +0800 drm/amdgpu: add the accelerator PCIe class Add the accelerator PCIe class and match the class in amdgpu for 0x1002 devices of that class. From PCI spec: "PCI Code and ID Assignment, r1.9, sec 1, 1.19" Signed-off-by: Shiwu Zhang Acked-by: Lijo Lazar Acked-by: Bjorn Helgaas # pci_ids.h Signed-off-by: Alex Deucher commit 11b92df8a2f7f4605ccc764ce6ae4a72760674df Author: Aurabindo Pillai Date: Wed Mar 22 14:29:26 2023 -0400 Revert "Revert drm/amd/display: Enable Freesync Video Mode by default" This reverts commit 4243c84aa082d8fba70c45f48eb2bb5c19799060. Enables freesync video by default, since the hang and corruption issue on eDP panels are now fixed. Acked-by: Stylon Wang Signed-off-by: Aurabindo Pillai Reviewed-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 09d49e14ea6fd125a21f89b80f888c09be32a174 Author: Jonathan Kim Date: Tue May 23 11:57:27 2023 -0400 drm/amdkfd: fix and enable debugging for gfx11 There are a couple of fixes required to enable gfx11 debugging. First, ADD_QUEUE.trap_en is an inappropriate place to toggle a per-process register so move it to SET_SHADER_DEBUGGER.trap_en. When ADD_QUEUE.skip_process_ctx_clear is set, MES will prioritize the SET_SHADER_DEBUGGER.trap_en setting. Second, to preserve correct save/restore priviledged wave states in coordination with the trap enablement setting, resume suspended waves early in the disable call. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit fe56c6ee0457035ae8fbbc2aa5ddfcfac6ded787 Author: Mario Limonciello Date: Wed Jun 7 01:45:20 2023 -0500 drm/amd: Tighten permissions on VBIOS flashing attributes Non-root users shouldn't be able to try to trigger a VBIOS flash or query the flashing status. This should be reserved for users with the appropriate permissions. Cc: stable@vger.kernel.org Fixes: 8424f2ccb3c0 ("drm/amdgpu/psp: Add vbflash sysfs interface support") Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 3537d6a48c50ed37e419f89931a5acdb6c56c6d6 Author: Mario Limonciello Date: Wed Jun 7 01:41:22 2023 -0500 drm/amd: Make sure image is written to trigger VBIOS image update flow The VBIOS image update flow requires userspace to: 1) Write the image to `psp_vbflash` 2) Read `psp_vbflash` 3) Poll `psp_vbflash_status` to check for completion If userspace reads `psp_vbflash` before writing an image, it's possible that it causes problems that can put the dGPU into an invalid state. Explicitly check that an image has been written before letting a read succeed. Cc: stable@vger.kernel.org Fixes: 8424f2ccb3c0 ("drm/amdgpu/psp: Add vbflash sysfs interface support") Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 55682a893844cc64e3a85806b0c3ca7a77b905c3 Author: Tim Huang Date: Mon Jun 5 16:57:45 2023 +0800 drm/amd/pm: enable more Pstates profile levels for SMU v13.0.4 This patch enables following UMD stable Pstates profile levels for power_dpm_force_performance_level interface. - profile_peak - profile_min_mclk - profile_min_sclk - profile_standard Signed-off-by: Tim Huang Acked-by: Alex Deucher Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 2d0ee64e9846ed4036fd11c5b900a21039ee8b7a Author: Tim Huang Date: Fri Jun 2 16:57:12 2023 +0800 drm/amd/pm: enable vclk and dclk Pstates for SMU v13.0.4 Add the ability to control the vclk and dclk frequency by power_dpm_force_performance_level interface. Signed-off-by: Tim Huang Acked-by: Alex Deucher Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 27d196c4491458ca00014cfe1cfa9d0fa87a2ff9 Author: Tim Huang Date: Wed Jun 7 11:24:48 2023 +0800 drm/amd/pm: fix vclk setting failed for SMU v13.0.4 PMFW use the left-shifted 16 bits argument to set the VCLK DPM frequency for SMU v13.0.4. Signed-off-by: Tim Huang Acked-by: Alex Deucher Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit cab69d36ccdbfa3fa0b5627a032150369c20b4f3 Author: Yang Wang Date: Tue Jun 6 14:42:39 2023 +0800 drm/amdgpu: skip to resume rlcg for gc 9.4.3 in vf side skip to resume rlcg, because rlcg is already enabled in pf side. Signed-off-by: Yang Wang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 731b48463b0d96eda1f1684eacde6e9c8065df83 Author: Yang Wang Date: Mon Jun 5 11:39:30 2023 +0800 drm/amdgpu: disable virtual display support on APP device virtual display is not support on APP device. Signed-off-by: Yang Wang Signed-off-by: Gavin Wan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5daff15cd013422bc6d1efcfe82b586800025384 Author: Lang Yu Date: Sat May 6 12:01:33 2023 +0800 drm/amdgpu: unmap and remove csa_va properly Root PD BO should be reserved before unmap and remove a bo_va from VM otherwise lockdep will complain. v2: check fpriv->csa_va is not NULL instead of amdgpu_mcbp (christian) [14616.936827] WARNING: CPU: 6 PID: 1711 at drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1762 amdgpu_vm_bo_del+0x399/0x3f0 [amdgpu] [14616.937096] Call Trace: [14616.937097] [14616.937102] amdgpu_driver_postclose_kms+0x249/0x2f0 [amdgpu] [14616.937187] drm_file_free+0x1d6/0x300 [drm] [14616.937207] drm_close_helper.isra.0+0x62/0x70 [drm] [14616.937220] drm_release+0x5e/0x100 [drm] [14616.937234] __fput+0x9f/0x280 [14616.937239] ____fput+0xe/0x20 [14616.937241] task_work_run+0x61/0x90 [14616.937246] exit_to_user_mode_prepare+0x215/0x220 [14616.937251] syscall_exit_to_user_mode+0x2a/0x60 [14616.937254] do_syscall_64+0x48/0x90 [14616.937257] entry_SYSCALL_64_after_hwframe+0x63/0xcd Signed-off-by: Lang Yu Acked-by: Christian König Signed-off-by: Alex Deucher commit eaa7d8301109092670c5cf3e12c502618d6adc51 Author: Joshua Ashton Date: Tue Jan 10 19:14:06 2023 +0000 drm/amd/display: Refactor avi_info_frame colorimetry determination Replace the messy two if-else chains here that were on the same value with a switch on the enum. Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Reviewed-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit fd45b6540f513887c172e2082d437209fe8f4a54 Author: Harry Wentland Date: Tue Nov 29 17:24:52 2022 -0500 drm/amd/display: Add debugfs for testing output colorspace In order to IGT test colorspace we'll want to print the currently enabled colorspace on a stream. We add a new debugfs to do so, using the same scheme as current bpc reporting. This might also come in handy when debugging display issues. v4: - Fix function doc comment - Fix sRGB debug print Signed-off-by: Harry Wentland Reviewed-by: Joshua Ashton Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit bd49f19039c1806cd10cff8aaec7f90ebf28f0e9 Author: Joshua Ashton Date: Mon Nov 14 19:52:30 2022 +0000 drm/amd/display: Always set crtcinfo from create_stream_for_sink Given that we always pass dm_state into here now, this won't ever trigger anymore. This is needed for we will always fail mode validation with invalid clocks or link bandwidth errors. Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Reviewed-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit 2e656827ceed9fb1ba406e7cd11d7b572010add0 Author: Harry Wentland Date: Tue Mar 29 15:30:05 2022 -0400 drm/amd/display: Send correct DP colorspace infopacket Look at connector->colorimetry to determine output colorspace. We don't want to impact current SDR behavior, so DRM_MODE_COLORIMETRY_DEFAULT preserves current behavior. Also add support to explicitly set BT601 and BT709. v4: - Roll support for BT709 and BT601 into this patch - Add default case to avoid warnings for unhandled enum values Signed-off-by: Harry Wentland Reviewed-by: Joshua Ashton Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit a0b433c858ac1d2e03cbfd5bb34b9b61906600eb Author: Harry Wentland Date: Tue Mar 29 11:26:23 2022 -0400 drm/amd/display: Signal mode_changed if colorspace changed We need to signal mode_changed to make sure we update the output colorspace. v2: No need to call drm_hdmi_avi_infoframe_colorimetry as DC does its own infoframe packing. Signed-off-by: Harry Wentland Reviewed-by: Leo Li Reviewed-by: Joshua Ashton Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Joshua Ashton Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit 15f9dfd545a1edd604648961feadce16791d0f4f Author: Harry Wentland Date: Fri Mar 25 15:30:28 2022 -0400 drm/amd/display: Register Colorspace property for DP and HDMI We want compositors to be able to set the output colorspace on DP and HDMI outputs, based on the caps reported from the receiver via EDID. Signed-off-by: Harry Wentland Reviewed-by: Joshua Ashton Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: Simon Ser Cc: Ville Syrjälä Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit cb841d27b8767fd88096d06186b5f5de990fd6d0 Author: Harry Wentland Date: Fri Apr 1 13:45:29 2022 -0400 drm/amd/display: Always pass connector_state to stream validation We need the connector_state for colorspace and scaling information and can get it from connector->state. Signed-off-by: Harry Wentland Reviewed-by: Joshua Ashton Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit c265f340eaa87aa5f979adfb23d7463af67b7f27 Author: Harry Wentland Date: Tue Nov 29 15:16:31 2022 -0500 drm/connector: Allow drivers to pass list of supported colorspaces Drivers might not support all colorspaces defined in dp_colorspaces and hdmi_colorspaces. This results in undefined behavior when userspace is setting an unsupported colorspace. Allow drivers to pass the list of supported colorspaces when creating the colorspace property. v2: - Use 0 to indicate support for all colorspaces (Jani) - Print drm_dbg_kms message when drivers pass 0 to signal that drivers should specify supported colorspaecs explicity (Jani) v3: - Move changes to create a common colorspace_names array to separate patch v6: - Avoid magic when passing 0 for supported_colorspaces; be explicit in treating it as "all DP/HDMI" Signed-off-by: Harry Wentland Reviewed-by: Sebastian Wick Reviewed-by: Joshua Ashton Reviewed-by: Simon Ser Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: Jani Nikula Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit 035d53e0f36da6ce49abf7bea3d9b30a075ff247 Author: Harry Wentland Date: Wed Nov 30 16:11:30 2022 -0500 drm/connector: Print connector colorspace in state debugfs v3: Fix kerneldocs (kernel test robot) v4: Avoid returning NULL from drm_get_colorspace_name Signed-off-by: Harry Wentland Reviewed-by: Sebastian Wick Reviewed-by: Joshua Ashton Reviewed-by: Simon Ser Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: Jani Nikula Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit c627087cb164d1675323c7942fa29bded4263dfc Author: Harry Wentland Date: Tue Nov 29 15:16:31 2022 -0500 drm/connector: Use common colorspace_names array We an use bitfields to track the support ones for HDMI and DP. This allows us to print colorspaces in a consistent manner without needing to know whether we're dealing with DP or HDMI. v4: - Rename _MAX to _COUNT and leave comment to indicate it's not a valid value - Fix misplaced function doc v6: - Drop magic in drm_mode_create_colorspace_property for dealing with "0" supported_colorspaces. Expect the caller to always provide a non-zero supported_colorspaces. - Improve error checking and logging Signed-off-by: Harry Wentland Reviewed-by: Sebastian Wick Reviewed-by: Joshua Ashton Reviewed-by: Simon Ser Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: Jani Nikula Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit 6120611abc05dd850eff4eb3026f977ac7e34718 Author: Harry Wentland Date: Wed Nov 30 14:42:03 2022 -0500 drm/connector: Pull out common create_colorspace_property code Signed-off-by: Harry Wentland Reviewed-by: Sebastian Wick Reviewed-by: Joshua Ashton Reviewed-by: Simon Ser Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: Jani Nikula Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit f96c61fe0383d73732aba72fabb7e2c7ce0b0835 Author: Joshua Ashton Date: Fri Feb 3 02:07:43 2023 +0000 drm/connector: Add enum documentation to drm_colorspace To match the other enums, and add more information about these values. v2: - Specify where an enum entry comes from - Clarify DEFAULT and NO_DATA behavior - BT.2020 CYCC is "constant luminance" - correct type for BT.601 v4: - drop DP/HDMI clarifications that might create more questions than answers v5: - Add note on YCC and RGB variants Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Reviewed-by: Harry Wentland Reviewed-by: Sebastian Wick Acked-by: Pekka Paalanen Reviewed-by: Simon Ser Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit 1626761ee4406c51d5afe9d47dd41a29e2049b71 Author: Harry Wentland Date: Fri Feb 3 02:07:42 2023 +0000 drm/connector: Convert DRM_MODE_COLORIMETRY to enum This allows us to use strongly typed arguments. v2: - Bring NO_DATA back - Provide explicit enum values v3: - Drop unnecessary '&' from kerneldoc (emersion) v4: - Fix Normal Colorimetry comment Signed-off-by: Harry Wentland Reviewed-by: Simon Ser Reviewed-by: Sebastian Wick Reviewed-by: Pekka Paalanen Reviewed-by: Joshua Ashton Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: Simon Ser Cc: Melissa Wen Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Alex Deucher commit 597364adc0fcf71617b3adbe647b6eec76e27554 Author: Mukul Joshi Date: Wed May 31 11:22:03 2023 -0400 drm/amdkfd: Fix reserved SDMA queues handling This patch fixes a regression caused by a bad merge where the handling of reserved SDMA queues was accidentally removed. With the fix, the reserved SDMA queues are again correctly marked as unavailable for allocation. Fixes: a805889a1531 ("drm/amdkfd: Update SDMA queue management for GFX9.4.3") Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit c1ac2ea802f5adfd1d128fc01375af9c5f113932 Author: Alex Deucher Date: Tue Jun 6 11:14:04 2023 -0400 drm/amdgpu: add missing radeon secondary PCI ID 0x5b70 is a missing RV370 secondary id. Add it so we don't try and probe it with amdgpu. Cc: michel@daenzer.net Reviewed-by: Michel Dänzer Tested-by: Michel Dänzer Signed-off-by: Alex Deucher commit bbcc3514ab4f7ec3ae2273ad08b0a1b6b4aa9dd9 Author: Mario Limonciello Date: Fri Jun 2 07:18:06 2023 -0500 drm/amd: Check that a system is a NUMA system before looking for SRAT It's pointless on laptops to look for the SRAT table as these are not NUMA. Check the number of possible nodes is > 1 to decide whether to look for SRAT. Suggested-by: Felix Kuehling Signed-off-by: Mario Limonciello Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 7386f88ab1732af890a09ab3a7f400bb20adbe5a Author: Jonathan Kim Date: Wed Jun 7 03:56:27 2023 -0400 drm/amdkfd: fix vmfault signalling with additional data. Exception handling for vmfaults should be raised with additional data. Reported-by: Mukul Joshi Signed-off-by: Jonathan Kim Reviewed-by: Mukul Joshi Signed-off-by: Alex Deucher commit 0bc3137b2157115f328859477b463c912d605c3a Author: Stanley.Yang Date: Thu Jun 1 20:56:42 2023 +0800 drm/amdgpu: Set EEPROM ras info Set EEPROM ras info: rma status, health percent and bad page threshold. Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7c2551fa1dfdb06a9dd3a6c629086fe2c348e00a Author: Stanley.Yang Date: Mon May 29 10:17:59 2023 +0800 drm/amdgpu: Calculate EEPROM table ras info bytes sum It's more reasonable to check EEPROM table ras info bytes. Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7f599fed3b13fe97dcd6f68bf8a5c62abb91d0a4 Author: Stanley.Yang Date: Wed May 31 10:37:09 2023 +0800 drm/amdgpu: Add support EEPROM table v2.1 Add ras info to EEPROM table, app can analyse device ECC status without GPU driver through EEPROM table ras info. Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b573cf88c0d0a1f71873ca36edf0e20d4b9a82a8 Author: Stanley.Yang Date: Tue May 30 22:48:34 2023 +0800 drm/amdgpu: Support setting EEPROM table version Add setting EEPROM table version interface for umcv8.10, Add EEPROM table v2.1 to UMC v8.10. Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 65183faec89f3ef2c781f2ed6803e6ed5c365d48 Author: Stanley.Yang Date: Tue May 30 22:38:17 2023 +0800 drm/amdgpu: Add RAS table v2.1 macro definition Add RAS EEPROM table version 2.1 macro definition. Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 71c79a196096bf51603322760dc6a95e2eb82ac1 Author: Stanley.Yang Date: Tue May 30 21:48:17 2023 +0800 drm/amdgpu: Rename ras table version Rename RAS_TABLE_VER to RAS_TABLE_VER_V1, move RAS_TABLE_VER_V1 from amdgpu_ras_eeprom.c to amdgpu_ras_eeprom.h. Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ea791e704b97ab5abd563b6d2f88c4019940079e Author: Jiadong Zhu Date: Thu May 25 18:42:15 2023 +0800 drm/amdgpu: Implement gfx9 patch functions for resubmission Patch the packages including CONTEXT_CONTROL and WRITE_DATA for gfx9 during the resubmission scenario. Signed-off-by: Jiadong Zhu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 8ff865be93e642d0ad66ca7369f42fbe36dc6a90 Author: Jiadong Zhu Date: Thu May 25 16:52:55 2023 +0800 drm/amdgpu: Modify indirect buffer packages for resubmission When the preempted IB frame resubmitted to cp, we need to modify the frame data including: 1. set PRE_RESUME 1 in CONTEXT_CONTROL. 2. use meta data(DE and CE) read from CSA in WRITE_DATA. Add functions to save the location the first time IBs emitted and callback to patch the package when resubmission happens. Signed-off-by: Jiadong Zhu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit f2bcc0c7db0c004f0184675e7862648e8aa197f9 Author: Emily Deng Date: Tue Jun 6 14:27:04 2023 +0800 drm/amdgpu/mmsch: Correct the definition for mmsch init header For the header, it is version related, shouldn't use MAX_VCN_INSTANCES. Signed-off-by: Emily Deng Reviewed-by: Feifei Xu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 8be295046748432c53a2dee39c469f63c60b0ec3 Author: Dan Carpenter Date: Tue Jun 6 19:29:51 2023 -0400 drm/amdkfd: potential error pointer dereference in ioctl The "target" either comes from kfd_create_process() which returns error pointers on error or kfd_lookup_process_by_pid() which returns NULL on error. So we need to check for both types of errors. Fixes: 0ab2d7532b05 ("drm/amdkfd: prepare per-process debug enable and disable") Signed-off-by: Dan Carpenter Reviewed-by: Jonathan Kim Signed-off-by: Alex Deucher commit 33e82119cfb2a957f250f92a1e4c4db2b06400db Author: Aurabindo Pillai Date: Tue Jun 6 11:42:53 2023 -0400 drm/amd/display: Only use ODM2:1 policy for high pixel rate displays We only gain a benefit of using the ODM2:1 dynamic policy if it allow us to decrease DISPCLK to use the VMIN freq. If the display config can already achieve VMIN DISPCLK freq without ODM2:1, don't apply the policy. This patch was reverted but that causes some IGT regressions. To unblock, the patch is being applied again until IGT failures are fixed. Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Aurabindo Pillai Reviewed-by: Rodrigo Siqueira commit b7588507152148eaf0f19feb98c65b72ab40a726 Author: Dan Carpenter Date: Tue Jun 6 11:33:46 2023 +0300 drm/amd/pm: Fix memory some memory corruption The "od_table" is a pointer to a large struct, but this code is doing pointer math as if it were pointing to bytes. It results in writing far outside the struct. Fixes: 2e8452ea4ef6 ("drm/amd/pm: fulfill the OD support for SMU13.0.0") Fixes: 2a9aa52e4617 ("drm/amd/pm: fulfill the OD support for SMU13.0.7") Reviewed-by: Evan Quan Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit d155cfff48499d1e973976519ca81a7d9bab2cc3 Author: Sui Jingfeng Date: Tue Jun 6 21:33:28 2023 +0800 drm/amdgpu: display/Kconfig: replace leading spaces with tab This patch replace the leading spaces with tab, make them keep aligned with the rest of the config options. No functional change. Signed-off-by: Sui Jingfeng Signed-off-by: Alex Deucher commit 82054942472745c2caa4f6b31b4174401348b887 Author: Hamza Mahfooz Date: Mon Jun 5 14:18:49 2023 -0400 drm/amd/display: mark dml314's UseMinimumDCFCLK() as noinline_for_stack clang reports: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn314/display_mode_vba_314.c:3892:6: error: stack frame size (2632) exceeds limit (2048) in 'dml314_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] 3892 | void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) | ^ 1 error generated. So, since UseMinimumDCFCLK() consumes a lot of stack space, mark it as noinline_for_stack to prevent it from blowing up dml314_ModeSupportAndSystemConfigurationFull()'s stack size. Acked-by: Alex Deucher Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit caf0f98dc280b5426b1858d4e70130aa3dd9679c Author: Hamza Mahfooz Date: Mon Jun 5 13:59:08 2023 -0400 drm/amd/display: mark dml31's UseMinimumDCFCLK() as noinline_for_stack clang reports: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_mode_vba_31.c:3797:6: error: stack frame size (2632) exceeds limit (2048) in 'dml31_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] 3797 | void dml31_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) | ^ 1 error generated. So, since UseMinimumDCFCLK() consumes a lot of stack space, mark it as noinline_for_stack to prevent it from blowing up dml31_ModeSupportAndSystemConfigurationFull()'s stack size. Acked-by: Alex Deucher Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 35c7b59e3691cbea91c8b91e8ec4b0a4a960dd5a Author: Srinivasan Shanmugam Date: Tue Jun 6 17:36:45 2023 +0530 drm/amd/display: Fix unused variable ‘should_lock_all_pipes’ Fix below compilation error: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3524:7: error: unused variable 'should_lock_all_pipes' [-Werror,-Wunused-variable] bool should_lock_all_pipes = (update_type != UPDATE_TYPE_FAST); Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Cc: Harry Wentland Cc: Alex Deucher Reviewed-by: Hamza Mahfooz Signed-off-by: Srinivasan Shanmugam Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit bbd069a860b78a087d20d91656a5026c0196586b Author: Alvin Lee Date: Fri May 19 11:38:15 2023 -0400 drm/amd/display: Reduce sdp bw after urgent to 90% [Description] Reduce expected SDP bandwidth due to poor QoS and arbitration issues on high bandwidth configs Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Stylon Wang Signed-off-by: Alvin Lee Reviewed-by: Nevenko Stupar Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8e7b3f5435b3c0751515c973972ebb11e0fc0fb5 Author: Max Tseng Date: Tue Apr 25 15:05:17 2023 +0800 drm/amd/display: Add control flag to dc_stream_state to skip eDP BL off/link off Add control flag to dc_stream_state to skip eDP BL off/link off. Acked-by: Stylon Wang Signed-off-by: Max Tseng Reviewed-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 490ddccb84fe2f6165b2bdd2d00fd4ab593b95ec Author: Saaem Rizvi Date: Thu May 18 12:12:20 2023 -0400 drm/amd/display: Wrong index type for pipe iterator [Why and How] Type mismatch in index and pipe count might cause an infinite loop. code Change should resolve this issue. Acked-by: Stylon Wang Signed-off-by: Saaem Rizvi Reviewed-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0baae624630788862bbd654741929007971e9d5b Author: Alvin Lee Date: Thu May 18 11:30:44 2023 -0400 drm/amd/display: Refactor fast update to use new HWSS build sequence [Description] - Refactor HW sequencer to use a build / execute sequence - Also move gamma updates to become fast v2: squash in build fix ("drm/amd/display: Fix guarding of 'if (dc->debug.visual_confirm)'") Acked-by: Stylon Wang Signed-off-by: Alvin Lee Reviewed-by: Jun Lei Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 49f26218c344741cb3eaa740b1e44e960551a87f Author: Dmytro Laktyushkin Date: Tue May 16 15:50:40 2023 -0400 drm/amd/display: fix dcn315 single stream crb allocation Change to improve avoiding asymetric crb calculations for single stream scenarios. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Stylon Wang Signed-off-by: Dmytro Laktyushkin Reviewed-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 869bcf59fd64382e3b23b219e791e6e5ebf1114e Author: YiPeng Chai Date: Wed May 24 17:14:15 2023 +0800 drm/amdgpu: change reserved vram info print The link object of mgr->reserved_pages is the blocks variable in struct amdgpu_vram_reservation, not the link variable in struct drm_buddy_block. Signed-off-by: YiPeng Chai Reviewed-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 5a863904bab4f5d22012f7d68ab2becafc303a40 Author: Chia-I Wu Date: Thu Jun 1 14:48:08 2023 -0700 drm/amdgpu: fix xclk freq on CHIP_STONEY According to Alex, most APUs from that time seem to have the same issue (vbios says 48Mhz, actual is 100Mhz). I only have a CHIP_STONEY so I limit the fixup to CHIP_STONEY Signed-off-by: Chia-I Wu Signed-off-by: Alex Deucher commit e6850f98efc70277dc0e941e905182738e7327a0 Author: Min Li Date: Sat Jun 3 15:43:45 2023 +0800 drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl Userspace can race to free the gobj(robj converted from), robj should not be accessed again after drm_gem_object_put, otherwith it will result in use-after-free. Reviewed-by: Christian König Signed-off-by: Min Li Signed-off-by: Alex Deucher commit 5a03159ab7ef456ba22460e47a9d0eab2f310424 Author: Alex Deucher Date: Fri Jun 2 14:37:13 2023 -0400 Revert "drm/amdgpu: switch to golden tsc registers for raven/raven2" This reverts commit f03eb1d26c2739b75580f58bbab4ab2d5d3eba46. This results in inconsistent timing reported via asynchronous GPU queries. Link: https://lists.freedesktop.org/archives/amd-gfx/2023-May/093731.html Cc: Jesse.Zhang@amd.com Cc: michel@daenzer.net Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit f9bfc9fff2997abe3c1a560a38a0c359775e7ec5 Author: Alex Deucher Date: Fri Jun 2 14:34:12 2023 -0400 Revert "drm/amdgpu: Differentiate between Raven2 and Raven/Picasso according to revision id" This reverts commit 9d2d1827af295fd6971786672c41c4dba3657154. This results in inconsistent timing reported via asynchronous GPU queries. Link: https://lists.freedesktop.org/archives/amd-gfx/2023-May/093731.html Cc: Jesse.Zhang@amd.com Cc: michel@daenzer.net Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit a15a77c8e61d2db075cc6e2104bfdebf5c9b966c Author: Alex Deucher Date: Fri Jun 2 14:32:55 2023 -0400 Revert "drm/amdgpu: change the reference clock for raven/raven2" This reverts commit fbc24293ca16b3b9ef891fe32ccd04735a6f8dc1. This results in inconsistent timing reported via asynchronous GPU queries. Link: https://lists.freedesktop.org/archives/amd-gfx/2023-May/093731.html Cc: Jesse.Zhang@amd.com Cc: michel@daenzer.net Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit 3898c8fc42b247c26c43c26873895b87fe58b477 Author: Stanley.Yang Date: Fri Apr 21 20:58:39 2023 +0800 drm/amdgpu: convert vcn/jpeg logical mask to physical mask Changed from V1: Remove amdgpu_ras_logical_mask_to_physical_mask due to GET_MASK provides same feature. Support convert VCN/JPEG logical mask to physical mask. Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e3959cb5479cd24baf9687734d5591b8e2ee08d4 Author: Stanley.Yang Date: Fri Apr 21 21:14:36 2023 +0800 drm/amdgpu: support check vcn jpeg block mask Support VCN/JPEG instance mask checking, pass logical mask directly except GFX/SDMA/VCN/JPEG blocks. Changed from V1: correct a typo Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 61a7c162399590263bf5f1ff5d2de634bfe3ae8d Author: Stanley.Yang Date: Wed Mar 29 22:03:09 2023 +0800 drm/amdgpu: pass xcc mask to ras ta pass xcc mask to ras ta, ras ta will compare the mask with the one from chiplet topology. Changed from V1: Remove IP version checking. Set ras_cmd->ras_init_message.init_flags.xcc_mask directly due to xcc_mask is common structres to all the devices. Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d522ca2714b77e15ebe6e77c1db7468c11a81180 Author: Kenneth Feng Date: Mon Jun 5 11:15:34 2023 +0800 drm/amd/pm: update smu-driver if header for smu 13.0.0 and smu 13.0.10 update smu-driver if header for smu 13.0.0 and smu 13.0.10 Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 09a77a40b51a979557521d5a2d39e431564d5d23 Author: Le Ma Date: Wed May 31 16:08:50 2023 +0800 drm/amdgpu/pm: notify driver unloading to PMFW for SMU v13.0.6 dGPU Per requested, follow the same sequence as APU to send only PPSMC_MSG_PrepareForDriverUnload to PMFW during driver unloading. Signed-off-by: Le Ma Reviewed-by: Shiwu Zhang Reviewed-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 25c30a12d718bd68ad91f58c7546eceaaf0feca5 Author: Srinivasan Shanmugam Date: Fri Jun 2 21:14:21 2023 +0530 drm/amdgpu: Mark 'kgd_gfx_aldebaran_clear_address_watch' & 'kgd_gfx_v11_clear_address_watch' functions as static Below two functions cause a warning because they lack a prototype: drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c:164:10: warning: no previous prototype for ‘kgd_gfx_aldebaran_clear_address_watch’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c:782:10: warning: no previous prototype for ‘kgd_gfx_v11_clear_address_watch’ [-Wmissing-prototypes] There are no callers from other files, so just mark them as 'static'. Also fixes the following checks: CHECK: Alignment should match open parenthesis +static uint32_t kgd_gfx_aldebaran_clear_address_watch(struct amdgpu_device *adev, uint32_t watch_id) CHECK: Alignment should match open parenthesis +static uint32_t kgd_gfx_v11_clear_address_watch(struct amdgpu_device *adev, uint32_t watch_id) Cc: Felix Kuehling Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1598fc576420207e5c89088fc46610c2318e2f5c Author: Aurabindo Pillai Date: Thu Jun 1 13:09:44 2023 -0400 drm/amd/display: Program OTG vtotal min/max selectors unconditionally for DCN1+ For FPO/FAMS, DMCUB will try to change the output timings by writing to the OTG registers. However, the timings written directly to the OTG registers will not be honoured unless VMIN/VMAX selector registers are programmed with the right bits and trigger source is selected correctly. Proper solution needs to go into DMCUB but will require additional state tracking to ensure that the selectors are set and reset correctly as per driver state. Until fix is merged into firmware, apply the workaround in driver to unconditionally write OTG vmin/vmax selectors. Reviewed-by: Rodrigo Siqueira Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 3cb4807dbf7f47f0a1368f78e7c37b1dd515c2dd Author: Aurabindo Pillai Date: Tue Apr 4 12:53:54 2023 -0400 Revert "drm/amd/display: Only use ODM2:1 policy for high pixel rate displays" This reverts commit 047783cdd5f604d87398236beb4971abb4d43293 since it causes higher power consumption for single display use case (4k60). Also, this patch introduced a 35% performance drop in a Vulkan benchmark. * The patch disabled the ODM-combination on most popular monitors, including 4K, 2K and FHD monitors at 60Hz. * ODM-combination can halve the DPP clock to save power, that is the reason why we introduce ODM-combination, and the PM log shows single pipe consumes more power at 4K@60Hz. * ODM-combination has 2 de-tiled buffer involved, which provides longer self-sustained time, that benefit to the memory power optimization. Signed-off-by: Aurabindo Pillai Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d6634d4d92eac068e2136afab49dfb15a9efae74 Author: Srinivasan Shanmugam Date: Fri Jun 2 21:08:49 2023 +0530 drm/amd/display: Add gnu_printf format attribute for snprintf_count() Fix the following W=1 kernel build warning: display/dc/dcn10/dcn10_hw_sequencer_debug.c: In function ‘snprintf_count’: display/dc/dcn10/dcn10_hw_sequencer_debug.c:56:2: warning: function ‘snprintf_count’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] Use the __printf() attribute to let the compiler warn if invalid format strings are passed in. And fix the following checks: CHECK: Avoid CamelCase: +unsigned int __printf(3, 4) snprintf_count(char *pBuf, unsigned int bufSize, char *fmt, ...) CHECK: Avoid CamelCase: +unsigned int __printf(3, 4) snprintf_count(char *pBuf, unsigned int bufSize, char *fmt, ...) Cc: Hamza Mahfooz Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 6b37fee590ec842f6e172c4f9c7dc4baadbdfda2 Author: Srinivasan Shanmugam Date: Fri Jun 2 14:02:45 2023 +0530 drm/amd/display: Address kdoc warnings in dcn30_fpu.c Fixes the following gcc with W=1: display/dc/dml/dcn30/dcn30_fpu.c:677: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Finds dummy_latency_index when MCLK switching using firmware based display/dc/dml/dcn30/dcn30_fpu.c:688: warning: Function parameter or member 'dc' not described in 'dcn30_find_dummy_latency_index_for_fw_based_mclk_switch' display/dc/dml/dcn30/dcn30_fpu.c:688: warning: Function parameter or member 'context' not described in 'dcn30_find_dummy_latency_index_for_fw_based_mclk_switch' display/dc/dml/dcn30/dcn30_fpu.c:688: warning: Function parameter or member 'pipes' not described in 'dcn30_find_dummy_latency_index_for_fw_based_mclk_switch' display/dc/dml/dcn30/dcn30_fpu.c:688: warning: Function parameter or member 'pipe_cnt' not described in 'dcn30_find_dummy_latency_index_for_fw_based_mclk_switch' display/dc/dml/dcn30/dcn30_fpu.c:688: warning: Function parameter or member 'vlevel' not described in 'dcn30_find_dummy_latency_index_for_fw_based_mclk_switch' Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 2890662822def3dcc1b2e690d6fcea694c666083 Author: GONG, Ruiqi Date: Fri Jun 2 18:12:33 2023 +0800 drm/amd/display: fix compilation error due to shifting negative value Currently compiling linux-next with allmodconfig triggers the following error: ./drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h: In function ‘dc_fixpt_truncate’: ./drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:528:22: error: left shift of negative value [-Werror=shift-negative-value] 528 | arg.value &= (~0LL) << (FIXED31_32_BITS_PER_FRACTIONAL_PART - frac_bits); | ^~ Use `unsigned long long` instead. Signed-off-by: GONG, Ruiqi Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 5be7d4e3cf9ef9853934daa03cf573723bae1650 Author: Gustavo A. R. Silva Date: Sun May 28 14:26:37 2023 -0600 drm/amdgpu/discovery: Replace fake flex-arrays with flexible-array members Zero-length and one-element arrays are deprecated, and we are moving towards adopting C99 flexible-array members, instead. Use the DECLARE_FLEX_ARRAY() helper macro to transform zero-length arrays in a union into flexible-array members. And replace a one-element array with a C99 flexible-array member. Address the following warnings found with GCC-13 and -fstrict-flex-arrays=3 enabled: drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1009:89: warning: array subscript kk is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Warray-bounds=] drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1007:94: warning: array subscript kk is outside array bounds of ‘uint64_t[0]’ {aka ‘long long unsigned int[]’} [-Warray-bounds=] drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1310:94: warning: array subscript k is outside array bounds of ‘uint64_t[0]’ {aka ‘long long unsigned int[]’} [-Warray-bounds=] drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1309:57: warning: array subscript k is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Warray-bounds=] This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/21 Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/300 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Signed-off-by: Alex Deucher commit 9f0bcf49e9895cb005d78b33a5eebfa11711b425 Author: Chia-I Wu Date: Thu Jun 1 15:44:12 2023 -0700 amdgpu: validate offset_in_bo of drm_amdgpu_gem_va This is motivated by OOB access in amdgpu_vm_update_range when offset_in_bo+map_size overflows. v2: keep the validations in amdgpu_vm_bo_map v3: add the validations to amdgpu_vm_bo_map/amdgpu_vm_bo_replace_map rather than to amdgpu_gem_va_ioctl Fixes: 9f7eb5367d00 ("drm/amdgpu: actually use the VM map parameters") Reviewed-by: Christian König Signed-off-by: Chia-I Wu Signed-off-by: Alex Deucher commit 9bd443cb74bd47d820c3cc31ee0ed3008d004d73 Author: Jonathan Kim Date: Fri Jun 2 13:52:04 2023 -0400 drm/amdgpu: fix debug wait on idle for gfx9.4.1 Wait calls for amd_ip_block_type not amd_hw_ip_block_type. Reported-by: Hamza Mahfooz Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 75c2b7ed080d7421157c03064be82275364136e7 Author: Dmytro Laktyushkin Date: Tue Apr 18 10:11:56 2023 -0400 drm/amd/display: fix seamless odm transitions Add missing programming and function pointers Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Stylon Wang Signed-off-by: Dmytro Laktyushkin Reviewed-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6c4dcaddbd36ffc0f29dd874bbddbab30d8edca8 Author: Baoquan He Date: Mon May 15 17:54:16 2023 +0800 arm64: kdump: simplify the reservation behaviour of crashkernel=,high On arm64, reservation for 'crashkernel=xM,high' is taken by searching for suitable memory region top down. If the 'xM' of crashkernel high memory is reserved from high memory successfully, it will try to reserve crashkernel low memory later accoringly. Otherwise, it will try to search low memory area for the 'xM' suitable region. Please see the details in Documentation/admin-guide/kernel-parameters.txt. While we observed an unexpected case where a reserved region crosses the high and low meomry boundary. E.g on a system with 4G as low memory end, user added the kernel parameters like: 'crashkernel=512M,high', it could finally have [4G-126M, 4G+386M], [1G, 1G+128M] regions in running kernel. The crashkernel high region crossing low and high memory boudary will bring issues: 1) For crashkernel=x,high, if getting crashkernel high region across low and high memory boundary, then user will see two memory regions in low memory, and one memory region in high memory. The two crashkernel low memory regions are confusing as shown in above example. 2) If people explicityly specify "crashkernel=x,high crashkernel=y,low" and y <= 128M, when crashkernel high region crosses low and high memory boundary and the part of crashkernel high reservation below boundary is bigger than y, the expected crahskernel low reservation will be skipped. But the expected crashkernel high reservation is shrank and could not satisfy user space requirement. 3) The crossing boundary behaviour of crahskernel high reservation is different than x86 arch. On x86_64, the low memory end is 4G fixedly, and the memory near 4G is reserved by system, e.g for mapping firmware, pci mapping, so the crashkernel reservation crossing boundary never happens. From distros point of view, this brings inconsistency and confusion. Users need to dig into x86 and arm64 system details to find out why. For kernel itself, the impact of issue 3) could be slight. While issue 1) and 2) cause actual impact because it brings obscure semantics and behaviour to crashkernel=,high reservation. Here, for crashkernel=xM,high, search the high memory for the suitable region only in high memory. If failed, try reserving the suitable region only in low memory. Like this, the crashkernel high region will only exist in high memory, and crashkernel low region only exists in low memory. The reservation behaviour for crashkernel=,high is clearer and simpler. Note: RPi4 has different zone ranges than normal memory. Its DMA zone is 0~1G, and DMA32 zone is 1G~4G if CONFIG_ZONE_DMA|DMA32 are enabled by default. The low memory end is 1G in order to validate all devices, high memory starts at 1G memory. However, for being consistent with normal arm64 system, its low memory end is still 1G, while reserving crashkernel high memory from 4G if crashkernel=size,high specified. This will remove confusion. With above change applied, summary of arm64 crashkernel reservation range: 1) RPi4(zone DMA:0~1G; DMA32:1G~4G): crashkernel=size 0~1G: low memory | 1G~top: high memory crashkernel=size,high 0~1G: low memory | 4G~top: high memory 2) Other normal system: crashkernel=size crashkernel=size,high 0~4G: low memory | 4G~top: high memory 3) Systems w/o zone DMA|DMA32 crashkernel=size crashkernel=size,high 0~top: low memory Signed-off-by: Baoquan He Reviewed-by: Catalin Marinas Reviewed-by: Zhen Lei Link: https://lore.kernel.org/r/ZGIBSEoZ7VRVvP8H@MiWiFi-R3L-srv Signed-off-by: Catalin Marinas commit 24e461e84f1c6d58fa1032f06d97e277dd0b4adf Author: Samson Tam Date: Tue May 9 16:40:19 2023 -0400 drm/amd/display: add ODM case when looking for first split pipe [Why] When going from ODM 2:1 single display case to max displays, second odm pipe needs to be repurposed for one of the new single displays. However, acquire_first_split_pipe() only handles MPC case and not ODM case [How] Add ODM conditions in acquire_first_split_pipe() Add commit_minimal_transition_state() in commit_streams() to handle odm 2:1 exit first, and then process new streams Handle ODM condition in commit_minimal_transition_state() Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Stylon Wang Signed-off-by: Samson Tam Reviewed-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2b607025797543433e7733c276ec34381edffd71 Author: Jiapeng Chong Date: Fri Jun 2 14:17:53 2023 +0800 drm/amd/display: clean up some inconsistent indenting No functional modification involved. drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2377 link_set_dpms_on() warn: inconsistent indenting. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5376 Acked-by: Alex Deucher Signed-off-by: Jiapeng Chong Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit a4d4db727320e0f80df605ccb877743359448a36 Author: Srinivasan Shanmugam Date: Fri Jun 2 15:19:22 2023 +0530 drm/amd/display: Fix dc/dcn20/dcn20_optc.c kdoc Fix all kdoc warnings in dc/dcn20/dcn20_optc.c: display/dc/dcn20/dcn20_optc.c:41: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Enable CRTC display/dc/dcn20/dcn20_optc.c:76: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst *For the below, I'm not sure how your GSL parameters are stored in your env, display/dc/dcn20/dcn20_optc.c:85: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * There are (MAX_OPTC+1)/2 gsl groups available for use. Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Cc: Harry Wentland Signed-off-by: Srinivasan Shanmugam Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 2a9aa52e4617c777fb0c885f0c02bf5ac65a786c Author: Evan Quan Date: Tue May 9 10:21:52 2023 +0800 drm/amd/pm: fulfill the OD support for SMU13.0.7 Fulfill the interfaces for OD settings retrieving and setting. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1718e973e3d23b653cd77994073a9deda3875689 Author: Lijo Lazar Date: Thu Jun 1 17:53:45 2023 +0530 drm/amd/pm: Fill metrics data for SMUv13.0.6 Populate metrics data table for SMU v13.0.6. Add PCIe link speed/width information also. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 2e8452ea4ef6406927e4c5a71d1a7ed6881c5a9b Author: Evan Quan Date: Mon May 8 16:57:02 2023 +0800 drm/amd/pm: fulfill the OD support for SMU13.0.0 Fulfill the interfaces for OD settings retrieving and setting. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 8f4f5f0b901a444c2317ef0fb29f35bc296daa55 Author: Evan Quan Date: Tue Apr 11 11:49:09 2023 +0800 drm/amd/pm: fulfill SMU13 OD settings init and restore Gfxclk fmin/fmax, Uclk fmin/fmax and Gfx v/f curve voltage offset OD settings are supported for SMU13. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a159afdad2f6b97e4d18549cff2b53d17e68a412 Author: Jonathan Kim Date: Tue May 10 12:51:26 2022 -0400 drm/amdkfd: bump kfd ioctl minor version for debug api availability Bump the minor version to declare debugging capability is now available. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 12976e6a5ab8fc3766c0304d72f7eec81a109b55 Author: Jonathan Kim Date: Tue May 10 12:47:45 2022 -0400 drm/amdkfd: add debug device snapshot operation Similar to queue snapshot, return an array of device information using an entry_size check and return. Unlike queue snapshots, the debugger needs to pass to correct number of devices that exist. If it fails to do so, the KFD will return the number of actual devices so that the debugger can make a subsequent successful call. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit b17bd5dbf64677682a3bca249c64521d5eabcb38 Author: Jonathan Kim Date: Tue May 10 11:15:29 2022 -0400 drm/amdkfd: add debug queue snapshot operation Allow the debugger to get a snapshot of a specified number of queues containing various queue property information that is copied to the debugger. Since the debugger doesn't know how many queues exist at any given time, allow the debugger to pass the requested number of snapshots as 0 to get the actual number of potential snapshots to use for a subsequent snapshot request for actual information. To prevent future ABI breakage, pass in the requested entry_size. The KFD will return it's own entry_size in case the debugger still wants log the information in a core dump on sizing failure. Also allow the debugger to clear exceptions when doing a snapshot. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2b36de971d25daa2ad287114ae3ca11a8f8d49d7 Author: Jonathan Kim Date: Mon May 9 13:37:36 2022 -0400 drm/amdkfd: add debug query exception info operation Allow the debugger to query additional info based on an exception code. For device exceptions, it's currently only memory violation information. For process exceptions, it's currently only runtime information. Queue exception only report the queue exception status. The debugger has the option of clearing the target exception on query. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 5bc20c224bcb863571e8831cdbba23cd61b10ac3 Author: Jonathan Kim Date: Mon May 9 11:10:32 2022 -0400 drm/amdkfd: add debug query event operation Allow the debugger to query a single queue, device and process exception. The KFD should also return the GPU or Queue id of the exception. The debugger also has the option of clearing exceptions after being queried. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 103d5f08ff42b666c61c350be2c3e724c1646918 Author: Jonathan Kim Date: Mon May 9 10:51:56 2022 -0400 drm/amdkfd: add debug set flags operation Allow the debugger to set single memory and single ALU operations. Some exceptions are imprecise (memory violations, address watch) in the sense that a trap occurs only when the exception interrupt occurs and not at the non-halting faulty instruction. Trap temporaries 0 & 1 save the program counter address, which means that these values will not point to the faulty instruction address but to whenever the interrupt was raised. Setting the Single Memory Operations flag will inject an automatic wait on every memory operation instruction forcing imprecise memory exceptions to become precise at the cost of performance. This setting is not permitted on debug devices that support only a global setting of this option. Return the previous set flags to the debugger as well. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit e0f85f4690d089cc1a60337decafb1acf7eec45e Author: Jonathan Kim Date: Fri May 6 14:58:55 2022 -0400 drm/amdkfd: add debug set and clear address watch points operation Shader read, write and atomic memory operations can be alerted to the debugger as an address watch exception. Allow the debugger to pass in a watch point to a particular memory address per device. Note that there exists only 4 watch points per devices to date, so have the KFD keep track of what watch points are allocated or not. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a70a93fa568b4f05aba548dadb673703eccf5480 Author: Jonathan Kim Date: Thu May 5 16:15:37 2022 -0400 drm/amdkfd: add debug suspend and resume process queues operation In order to inspect waves from the saved context at any point during a debug session, the debugger must be able to preempt queues to trigger context save by suspending them. On queue suspend, the KFD will copy the context save header information so that the debugger can correctly crawl the appropriate size of the saved context. The debugger must then also be allowed to resume suspended queues. A queue that is newly created cannot be suspended because queue ids are recycled after destruction so the debugger needs to know that this has occurred. Query functions will be later added that will clear a given queue of its new queue status. A queue cannot be destroyed while it is suspended to preserve its saved context during debugger inspection. Have queue destruction block while a queue is suspended and unblocked when it is resumed. Likewise, if a queue is about to be destroyed, it cannot be suspended. Return the number of queues successfully suspended or resumed along with a per queue status array where the upper bits per queue status show that the request was invalid (new/destroyed queue suspend request, missing queue) or an error occurred (HWS in a fatal state so it can't suspend or resume queues). Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit aea1b4738bebd8092bd437ce0b03aa9587fc20a7 Author: Jonathan Kim Date: Mon May 2 11:45:05 2022 -0400 drm/amdkfd: add debug wave launch mode operation Allow the debugger to set wave behaviour on to either normally operate, halt at launch, trap on every instruction, terminate immediately or stall on allocation. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 101827e13026a981e887527620fe9710adc0e481 Author: Jonathan Kim Date: Wed Apr 27 13:18:10 2022 -0400 drm/amdkfd: add debug wave launch override operation This operation allows the debugger to override the enabled HW exceptions on the device. On debug devices that only support the debugging of a single process, the HW exceptions are global and set through the SPI_GDBG_TRAP_MASK register. Because they are global, only address watch exceptions are allowed to be enabled. In other words, the debugger must preserve all non-address watch exception states in normal mode operation by barring a full replacement override or a non-address watch override request. For multi-process debugging, all HW exception overrides are per-VMID so all exceptions can be overridden or fully replaced. In order for the debugger to know what is permissible, returned the supported override mask back to the debugger along with the previously enable overrides. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit e90bf919f714ae2a658cdfd03238e7be9ce9185c Author: Jonathan Kim Date: Wed Apr 27 10:24:37 2022 -0400 drm/amdkfd: add debug set exceptions enabled operation The debugger subscibes to nofication for requested exceptions on attach. Allow the debugger to change its subsciption later on. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 12fb1ad70d65edc3405884792d044fa79df7244f Author: Jonathan Kim Date: Fri Apr 22 12:26:18 2022 -0400 drm/amdkfd: update process interrupt handling for debug events The debugger must be notified by any debugger subscribed exception that comes from hardware interrupts. If a debugger session exits, any exceptions it subscribed to may still have interrupts in the interrupt ring buffer or KGD/KFD pipeline. To prevent a new session from inheriting stale interrupts, when a new queue is created, open an interrupt drain and allow the IH ring to drain from a timestamped checkpoint. Then inject a custom IV so that once the custom IV is picked up by the KFD, it's safe to close the drain and proceed with queue creation. The drain must also be on debug disable as SW interrupts may still be processed. Drain at this time and clear all the exception status. The debugger may also not be attached nor subscibed to certain exceptions so forward them directly to the runtime. GFX10 also requires its own IV processing, hence the creation of kfd_int_process_v10.c. This is because the IV from SQ interrupts are packed into a new continguous format unlike GFX9. To make this clear, a separate interrupting handling code file was created. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a37d23f816b18a324c24d066d5bc453308913bf9 Author: Evan Quan Date: Tue Apr 11 11:25:52 2023 +0800 drm/amd/pm: update SMU13 header files for coming OD support Correct the data structures for OD feature support. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 50cff45e274896235d371f16eab67a180e12a732 Author: Jay Cornwall Date: Mon Mar 1 18:34:39 2021 -0600 drm/amdkfd: add debug trap enabled flag to tma Trap handler behavior will differ when a debugger is attached. Make the debug trap flag available in the trap handler TMA. Update it when the debug trap ioctl is invoked. Signed-off-by: Jay Cornwall Reviewed-by: Felix Kuehling Signed-off-by: Jonathan Kim Signed-off-by: Alex Deucher commit 455227c4642c5e1867213cea73a527e431779060 Author: Jonathan Kim Date: Fri Apr 8 13:12:24 2022 -0400 drm/amdkfd: add runtime enable operation The debugger can attach to a process prior to HSA enablement (i.e. inferior is spawned by the debugger and attached to immediately before target process has been enabled for HSA dispatches) or it can attach to a running target that is already HSA enabled. Either way, the debugger needs to know the enablement status to know when it can inspect queues. For the scenario where the debugger spawns the target process, it will have to wait for ROCr's runtime enable request from the target. The runtime enable request will be able to see that its process has been debug attached. ROCr raises an EC_PROCESS_RUNTIME signal to the debugger then blocks the target process while waiting the debugger's response. Once the debugger has received the runtime signal, it will unblock the target process. For the scenario where the debugger attaches to a running target process, ROCr will set the target process' runtime status as enabled so that on an attach request, the debugger will be able to see this status and will continue with debug enablement as normal. A secondary requirement is to conditionally enable the trap tempories only if the user requests it (env var HSA_ENABLE_DEBUG=1) or if the debugger attaches with HSA runtime enabled. This is because setting up the trap temporaries incurs a performance overhead that is unacceptable for microbench performance in normal mode for certain customers. In the scenario where the debugger spawns the target process, when ROCr detects that the debugger has attached during the runtime enable request, it will enable the trap temporaries before it blocks the target process while waiting for the debugger to respond. In the scenario where the debugger attaches to a running target process, it will enable to trap temporaries itself. Finally, there is an additional restriction that is required to be enforced with runtime enable and HW debug mode setting. The debugger must first ensure that HW debug mode has been enabled before permitting HW debug mode operations. With single process debug devices, allowing the debugger to set debug HW modes prior to trap activation means that debug HW mode setting can occur before the KFD has reserved the debug VMID (0xf) from the hardware scheduler's VMID allocation resource pool. This can result in the hardware scheduler assigning VMID 0xf to a non-debugged process and having that process inherit debug HW mode settings intended for the debugged target process instead, which is both incorrect and potentially fatal for normal mode operation. With multi process debug devices, allowing the debugger to set debug HW modes prior to trap activation means that non-debugged processes migrating to a new VMID could inherit unintended debug settings. All debug operations that touch HW settings must require trap activation where trap activation is triggered by both debug attach and runtime enablement (target has KFD opened and is ready to dispatch work). Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit c2d2588c702364ff53916ddd97e2b26fd4f4a317 Author: Jonathan Kim Date: Fri Apr 8 12:49:48 2022 -0400 drm/amdkfd: add send exception operation Add a debug operation that allows the debugger to send an exception directly to runtime through a payload address. For memory violations, normal vmfault signals will be applied to notify runtime instead after passing in the saved exception data when a memory violation was raised to the debugger. For runtime exceptions, this will unblock the runtime enable function which will be explained and implemented in a follow up patch. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 44b87bb0836c65d1b9d21b01503eb6e9b9297771 Author: Jonathan Kim Date: Wed Apr 6 12:03:31 2022 -0400 drm/amdkfd: add raise exception event function Exception events can be generated from interrupts or queue activitity. The raise event function will save exception status of a queue, device or process then notify the debugger of the status change by writing to a debugger polled file descriptor that the debugger provides during debug attach. For memory violation exceptions, extra exception data will be saved. The debugger will be able to query the saved exception states by query operation that will be provided by follow up patches. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 69a8c3ae2dea84a6d571e4c1aad306f630f3ccfd Author: Jonathan Kim Date: Thu Sep 1 11:27:15 2022 -0400 drm/amdkfd: apply trap workaround for gfx11 Due to a HW bug, waves in only half the shader arrays can enter trap. When starting a debug session, relocate all waves to the first shader array of each shader engine and mask off the 2nd shader array as unavailable. When ending a debug session, re-enable the 2nd shader array per shader engine. User CU masking per queue cannot be guaranteed to remain functional if requested during debugging (e.g. user cu mask requests only 2nd shader array as an available resource leading to zero HW resources available) nor can runtime be alerted of any of these changes during execution. Make user CU masking and debugging mutual exclusive with respect to availability. If the debugger tries to attach to a process with a user cu masked queue, return the runtime status as enabled but busy. If the debugger tries to attach and fails to reallocate queue waves to the first shader array of each shader engine, return the runtime status as enabled but with an error. In addition, like any other mutli-process debug supported devices, disable trap temporary setup per-process to avoid performance impact from setup overhead. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 218895820e6fccade42a7c3ab9c0a44dec0a1ebc Author: Jonathan Kim Date: Tue Apr 5 12:34:55 2022 -0400 drm/amdkfd: add per process hw trap enable and disable functions To enable HW debug mode per process, all devices must be debug enabled successfully. If a failure occures, rewind the enablement of debug mode on the enabled devices. A power management scenario that needs to be considered is HW debug mode setting during GFXOFF. During GFXOFF, these registers will be unreachable so we have to transiently disable GFXOFF when setting. Also, some devices don't support the RLC save restore function for these debug registers so we have to disable GFXOFF completely during a debug session. Cooperative launch also has debugging restriction based on HW/FW bugs. If such bugs exists, the debugger cannot attach to a process that uses GWS resources nor can GWS resources be requested if a process is being debugged. Multi-process debug devices can only enable trap temporaries based on certain runtime scenerios, which will be explained when the runtime enable functions are implemented in a follow up patch. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a9818854ea7870ec5464d37b72c89f5fc198708e Author: Jonathan Kim Date: Fri Aug 26 22:04:15 2022 -0400 drm/amdgpu: expose debug api for mes Similar to the F32 HWS, the RS64 HWS for GFX11 now supports a multi-process debug API. The skip_process_ctx_clear ADD_QUEUE requirement is to prevent the MES from clearing the process context when the first queue is added to the scheduler in order to maintain debug mode settings during queue preemption and restore. The MES clears the process context in this case due to an unresolved FW caching bug during normal mode operations. During debug mode, the KFD will hold a reference to the target process so the process context should never go stale and MES can afford to skip this requirement. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 0de4ec9a03537bd2b189b5afbf83acd6b72b0258 Author: Jonathan Kim Date: Mon Apr 4 13:38:11 2022 -0400 drm/amdgpu: prepare map process for multi-process debug devices Unlike single process debug devices, multi-process debug devices allow debug mode setting per-VMID (non-device-global). Because the HWS manages PASID-VMID mapping, the new MAP_PROCESS API allows the KFD to forward the required SPI debug register write requests. To request a new debug mode setting change, the KFD must be able to preempt all queues then remap all queues with these new setting requests for MAP_PROCESS to take effect. Note that by default, trap enablement in non-debug mode must be disabled for performance reasons for multi-process debug devices due to setup overhead in FW. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 97ae3c8cce96f3bebf883d0812cef5d3fdbe3e64 Author: Jonathan Kim Date: Mon Apr 4 12:27:43 2022 -0400 drm/amdkfd: prepare map process for single process debug devices Older HW only supports debugging on a single process because the SPI debug mode setting registers are device global. The HWS has supplied a single pinned VMID (0xf) for MAP_PROCESS for debug purposes. To pin the VMID, the KFD will remove the VMID from the HWS dynamic VMID allocation via SET_RESOUCES so that a debugged process will never migrate away from its pinned VMID. The KFD is responsible for reserving and releasing this pinned VMID accordingly whenever the debugger attaches and detaches respectively. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 7cee6a6824a0429a6255abe91b5af01b9a01cd03 Author: Jonathan Kim Date: Thu Mar 23 17:17:20 2023 -0400 drm/amdgpu: add configurable grace period for unmap queues The HWS schedule allows a grace period for wave completion prior to preemption for better performance by avoiding CWSR on waves that can potentially complete quickly. The debugger, on the other hand, will want to inspect wave status immediately after it actively triggers preemption (a suspend function to be provided). To minimize latency between preemption and debugger wave inspection, allow immediate preemption by setting the grace period to 0. Note that setting the preepmtion grace period to 0 will result in an infinite grace period being set due to a CP FW bug so set it to 1 for now. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 33f3437ae1194ef5dedbf275dcf74ed9c114647d Author: Jonathan Kim Date: Fri Aug 26 22:35:50 2022 -0400 drm/amdgpu: add gfx11 hw debug mode enable and disable calls Implement the per-device calls to enable or disable HW debug mode for GFX11. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit be6f94039e1a91df4b0efc2da9167ca9c17bb532 Author: Jonathan Kim Date: Fri Apr 1 13:31:57 2022 -0400 drm/amdgpu: add gfx9.4.2 hw debug mode enable and disable calls GFX9.4.2 now supports per-VMID debug mode controls registers (SPI_GDBG_PER_VMID_CNTL). Because the KFD lets the HWS handle PASID-VMID mapping, the KFD will forward all debug mode setting register writes to the HWS scheduler using a new MAP_PROCESS API, so instead of writing to registers, return the required register values that the HWS needs to write on debug enable and disable. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit d13f050fee94a454323f864fb005c4355600cdbd Author: Jonathan Kim Date: Thu Mar 31 13:14:01 2022 -0400 drm/amdgpu: add gfx10 hw debug mode enable and disable calls Similar to GFX9 debug devices, set the hardware debug mode by draining the SPI appropriately prior the mode setting request. Because GFX10 has waves allocated by the work group boundary and each SE's SPI instances do not communicate, the SPI drain time is much longer. This long drain time will be fixed for GFX11 onwards. Also remove a bunch of deprecated misplaced references for GFX10.3. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit bb13d763f251c28b08d996671c5146a2113fc9e7 Author: Jonathan Kim Date: Fri Mar 24 16:19:27 2023 -0400 drm/amdkfd: fix kfd_suspend_all_processes Flush delayed restore work in kfd_suspend_all_queues instead of cancelling. Cancelling the work before it runs results in the queues becoming permanently disabled. Flushing the work ensures that the queue suspend/resume state stays balanced. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 01f648202c5390f4c366793b34c27cddad4ca8d7 Author: Jonathan Kim Date: Wed Mar 30 15:31:00 2022 -0400 drm/amdgpu: add gfx9.4.1 hw debug mode enable and disable calls On GFX9.4.1, the implicit wait count instruction on s_barrier is disabled by default in the driver during normal operation for performance requirements. There is a hardware bug in GFX9.4.1 where if the implicit wait count instruction after an s_barrier instruction is disabled, any wave that hits an exception may step over the s_barrier when returning from the trap handler with the barrier logic having no ability to be aware of this, thereby causing other waves to wait at the barrier indefinitely resulting in a shader hang. This bug has been corrected for GFX9.4.2 and onward. Since the debugger subscribes to hardware exceptions, in order to avoid this bug, the debugger must enable implicit wait count on s_barrier for a debug session and disable it on detach. In order to change this setting in the in the device global SQ_CONFIG register, the GFX pipeline must be idle. GFX9.4.1 as a compute device will either dispatch work through the compute ring buffers used for image post processing or through the hardware scheduler by the KFD. Have the KGD suspend and drain the compute ring buffer, then suspend the hardware scheduler and block any future KFD process job requests before changing the implicit wait count setting. Once set, resume all work. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit cde2e087a320bff5d772d82c9fbddaea18daa94a Author: Jonathan Kim Date: Wed Mar 30 15:09:11 2022 -0400 drm/amdgpu: add gfx9 hw debug mode enable and disable calls Implement the per-device calls to enable or disable HW debug mode for GFX9 prior to GFX9.4.1. GFX9.4.1 and onward will require their own enable/disable sequence as follow on patches. When hardware debug mode setting is requested, waves will inherit these settings in the Shader Processor Input's (SPI) Sequencer Global Block (SQG). This means that the KGD must drain all waves from the SPI into SQG (approximately 96 SPI clock cycles) prior to debug mode setting to ensure that the order of operations that the debugger expects with regards to debug mode setting transaction requests and wave inheritence of that mode is upheld. Also ensure that exception overrides are reset to their original state prior to debug enable or disable. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit d3116d9f27b89d363dd528e42fcf4895a15e0c3c Author: Yang Li Date: Wed May 31 10:08:11 2023 +0800 drm/amdkfd: clean up one inconsistent indenting drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device.c:1036 kgd2kfd_interrupt() warn: inconsistent indenting Signed-off-by: Yang Li Signed-off-by: Felix Kuehling Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 34941e5dc72daff878267c55a9bdb5e055804953 Author: Srinivasan Shanmugam Date: Wed May 31 09:03:27 2023 +0530 drm/amd/display: Drop unused DCN_BASE variable in dcn314_resource.c Fixes the following W=1 kernel build warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_resource.c:128:29: warning: ‘DCN_BASE’ defined but not used [-Wunused-const-variable=] 128 | static const struct IP_BASE DCN_BASE = { { { { 0x00000012, 0x000000C0, 0x000034C0, 0x00009000, 0x02403C00, 0, 0, 0 } }, | ^~~~~~~~ Suggested-by: Roman Li Cc: Hamza Mahfooz Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Roman Li Signed-off-by: Alex Deucher commit 257d7b7be26d83768cb07585480d90e875365d5c Author: Mario Limonciello Date: Tue May 30 12:44:30 2023 -0500 drm/amd: Make lack of `ACPI_FADT_LOW_POWER_S0` or `CONFIG_AMD_PMC` louder during suspend path Users have reported that s2idle wasn't working on OEM Phoenix systems, but it was root caused to be because `CONFIG_AMD_PMC` wasn't set in the distribution kernel config. To make this more apparent, raise the messaging to err instead of warn. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217497 Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 4504f14338cdc43586189558113faafa8acb9ffe Author: Jonathan Kim Date: Thu Mar 31 12:05:00 2022 -0400 drm/amdgpu: setup hw debug registers on driver initialization Add missing debug trap registers references and initialize all debug registers on boot by clearing the hardware exception overrides and the wave allocation ID index. The debugger requires that TTMPs 6 & 7 save the dispatch ID to map waves onto dispatch during compute context inspection. In order to correctly set this up, set the special reserved CP bit by default whenever the MQD is initailized. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 08ca712270028111b22e4b159d11dbd6b770135e Author: Jonathan Kim Date: Wed Mar 30 14:54:16 2022 -0400 drm/amdgpu: add kgd hw debug mode setting interface Introduce the require KGD debug calls that will execute hardware debug mode setting. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 0ab2d7532b05a3e7c06fd3b0c8bd6b46c1dfb508 Author: Jonathan Kim Date: Fri Mar 25 14:55:30 2022 -0400 drm/amdkfd: prepare per-process debug enable and disable The ROCm debugger will attach to a process to debug by PTRACE and will expect the KFD to prepare a process for the target PID, whether the target PID has opened the KFD device or not. This patch is to explicity handle this requirement. Further HW mode setting and runtime coordination requirements will be handled in following patches. In the case where the target process has not opened the KFD device, a new KFD process must be created for the target PID. The debugger as well as the target process for this case will have not acquired any VMs so handle process restoration to correctly account for this. To coordinate with HSA runtime, the debugger must be aware of the target process' runtime enablement status and will copy the runtime status information into the debugged KFD process for later query. On enablement, the debugger will subscribe to a set of exceptions where each exception events will notify the debugger through a pollable FIFO file descriptor that the debugger provides to the KFD to manage. Finally on process termination of either the debugger or the target, debugging must be disabled if it has not been done so. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit d230f1bfe7a1977565ce1e2804ddb7b7a3d911ff Author: Jonathan Kim Date: Fri Mar 25 12:39:06 2022 -0400 drm/amdkfd: display debug capabilities Expose debug capabilities in the KFD topology node's HSA capabilities and debug properties flags. Ensure correct capabilities are exposed based on firmware support. Flag definitions can be referenced in uapi/linux/kfd_sysfs.h. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 4f98cf2baf9faee5b6f2f7889dad7c0f7686a787 Author: Jonathan Kim Date: Wed Mar 2 14:30:12 2022 -0500 drm/amdkfd: add debug and runtime enable interface Introduce the GPU debug operations interface. For ROCm-GDB to extend the GNU Debugger's ability to inspect the AMD GPU instruction set, provide the necessary interface to allow the debugger to HW debug-mode set and query exceptions per HSA queue, process or device. The runtime_enable interface coordinates exception handling with the HSA runtime. Usage is available in the kern docs at uapi/linux/kfd_ioctl.h. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ba3c87fffb79311f54464288c66421d19c2c1234 Author: Alex Deucher Date: Fri Jun 2 12:58:05 2023 -0400 amd/amdkfd: drop unused KFD_IOCTL_SVM_FLAG_UNCACHED flag Was leftover from GC 9.4.3 bring up and is currently unused. Drop it for now. Cc: Philip.Yang@amd.com Cc: rajneesh.bhardwaj@amd.com Cc: Felix.Kuehling@amd.com Reviewed-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 6ff5a1cff70441e1cd27614c359a66d29649e872 Author: Evan Quan Date: Thu Apr 6 12:08:21 2023 +0800 drm/amd/pm: conditionally disable pcie lane switching for some sienna_cichlid SKUs Disable the pcie lane switching for some sienna_cichlid SKUs since it might not work well on some platforms. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 3c87de6d034fcb756a10523367219c5564a85fd3 Author: Lijo Lazar Date: Fri Mar 31 16:30:01 2023 +0530 drm/amd/pm: Fix power context allocation in SMU13 Use the right data structure for allocation. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5e86aa29a338f5c25e2d10d021bffc6b1b560ad5 Author: Yang Wang Date: Wed May 24 13:54:26 2023 +0800 drm/amd/pm: add unique serial number support for smu_v13_0_6 add unique serial number support for smu_v13_0_6. (use aid0 serial number by default) Signed-off-by: Yang Wang Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 93682f8a196718c2caf9b9b3de7894d5c0318f1f Author: Lijo Lazar Date: Fri Mar 31 16:34:15 2023 +0530 drm/amd/pm: Fix SMUv13.0.6 throttle status report Add throttle status in power context Keep throttle status indicator in SMUv13 power context v2: Removed Dummy definition Signed-off-by: Lijo Lazar Signed-off-by: Asad Kamal Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 023f4d60747cadd96115c3c3b55986798322f3f6 Author: Lijo Lazar Date: Mon Apr 3 11:38:17 2023 +0530 drm/amd/pm: Update SMUv13.0.6 PMFW headers Update PMFW interface headers to for new metrics table format and throttling information. v2: Added dummy definition for compilation error Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Asad Kamal Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit cbb63eccc05626d0d111b335e44f111a3bb92871 Author: Horatio Zhang Date: Mon May 29 14:23:37 2023 -0400 drm/amdgpu: fix Null pointer dereference error in amdgpu_device_recover_vram Use the function of amdgpu_bo_vm_destroy to handle the resource release of shadow bo. During the amdgpu_mes_self_test, shadow bo released, but vmbo->shadow_list was not, which caused a null pointer reference error in amdgpu_device_recover_vram when GPU reset. Fixes: 6c032c37ac3e ("drm/amdgpu: Fix vram recover doesn't work after whole GPU reset (v2)") Signed-off-by: xinhui pan Signed-off-by: Horatio Zhang Acked-by: Feifei Xu Signed-off-by: Alex Deucher commit 16cc3a221537bb3588ec2a568d7bd0e7972b25a8 Author: Srinivasan Shanmugam Date: Wed May 31 23:33:35 2023 +0530 drm/amdgpu: Add function parameter 'event' to kdoc in svm_range_evict() Fixes the following gcc with W=1: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:1841: warning: Function parameter or member 'event' not described in 'svm_range_evict' Cc: Felix Kuehling Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2e9fee9b8e0e10fb9a4cba3ace607cebf7021bc1 Author: Srinivasan Shanmugam Date: Thu May 25 22:56:17 2023 +0530 drm/amdgpu: Fix up kdoc in amdgpu_device.c Fix these warnings by deleting the deviant arguments. gcc with W=1 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:799: warning: Excess function parameter 'pcie_index' description in 'amdgpu_device_indirect_wreg' drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:799: warning: Excess function parameter 'pcie_data' description in 'amdgpu_device_indirect_wreg' drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:870: warning: Excess function parameter 'pcie_index' description in 'amdgpu_device_indirect_wreg64' drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:870: warning: Excess function parameter 'pcie_data' description in 'amdgpu_device_indirect_wreg64' Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ebe884e8b93351382290ae107c880230d3a1f125 Author: Srinivasan Shanmugam Date: Wed May 31 00:12:22 2023 +0530 drm/amdgpu: Fix up kdoc 'ring' parameter in sdma_v6_0_ring_pad_ib Fix this warning by adding 'ring' arguments to kdoc. gcc with W=1 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:1128: warning: Function parameter or member 'ring' not described in 'sdma_v6_0_ring_pad_ib' Cc: Felix Kuehling Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c60c9a5f9ab659e5ca9fa0e485a28e82fba761ce Author: Srinivasan Shanmugam Date: Wed May 31 00:34:10 2023 +0530 drm/amd/display: Fix up kdoc formatting in display_mode_vba.c Fixes the following W=1 kernel build warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_vba.c:936: warning: Cannot understand * ************************************************************************* Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 1b320ad3f5a88602aef2f207bc211539a5496702 Author: Hamza Mahfooz Date: Wed May 24 14:59:32 2023 -0400 drm/amd/amdgpu: introduce DRM_AMDGPU_WERROR We want to do -Werror builds on our CI. However, non-amdgpu breakages have prevented us from doing so thus far. Also, there are a number of additional checks that we should enable, that the community cares about and are hidden behind -Wextra. So, define DRM_AMDGPU_WERROR to only enable -Werror for the amdgpu kernel module and enable -Wextra while disabling all of the checks that are too noisy. Cc: Alex Deucher Cc: Kenny Ho Suggested-by: Jani Nikula Reviewed-by: Kenny Ho Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 0df1106bfd13a9fe1eb7c33666bec091bc37c2a7 Author: Tom Rix Date: Thu Mar 30 11:20:40 2023 -0400 drm/amdkfd: remove unused sq_int_priv variable clang with W=1 reports drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_int_process_v11.c:282:38: error: variable 'sq_int_priv' set but not used [-Werror,-Wunused-but-set-variable] uint8_t sq_int_enc, sq_int_errtype, sq_int_priv; ^ This variable is not used so remove it. Signed-off-by: Tom Rix Signed-off-by: Alex Deucher commit 09521b5d49222d5ae932c4d738b2d55fb7abb415 Author: Mario Limonciello Date: Tue May 30 11:57:59 2023 -0500 drm/amd: Disallow s0ix without BIOS support again commit cf488dcd0ab7 ("drm/amd: Allow s0ix without BIOS support") showed improvements to power consumption over suspend when s0ix wasn't enabled in BIOS and the system didn't support S3. This patch however was misguided because the reason the system didn't support S3 was because SMT was disabled in OEM BIOS setup. This prevented the BIOS from allowing S3. Also allowing GPUs to use the s2idle path actually causes problems if they're invoked on systems that may not support s2idle in the platform firmware. `systemd` has a tendency to try to use `s2idle` if `deep` fails for any reason, which could lead to unexpected flows. The original commit also fixed a problem during resume from suspend to idle without hardware support, but this is no longer necessary with commit ca4751866397 ("drm/amd: Don't allow s0ix on APUs older than Raven") Revert commit cf488dcd0ab7 ("drm/amd: Allow s0ix without BIOS support") to make it match the expected behavior again. Cc: Rafael Ávila de Espíndola Link: https://github.com/torvalds/linux/blob/v6.1/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c#L1060 Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2599 Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit b5c07eaefc8b6e4aaa433f52ce74e619cd0ec386 Author: Srinivasan Shanmugam Date: Wed May 31 09:22:36 2023 +0530 drm/amd/display: Correct kdoc formatting for DCN32_CRB_SEGMENT_SIZE_KB in dcn32_hubbub.c Fixes the following W=1 kernel build warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_hubbub.c:45: warning: Cannot understand * @DCN32_CRB_SEGMENT_SIZE_KB: Maximum Configurable Return Buffer size for on line 45 - I thought it was a doc line Cc: Hamza Mahfooz Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 3808c34b291925d8a0fda2f23136381c1feb1dd2 Author: Srinivasan Shanmugam Date: Wed May 31 10:41:59 2023 +0530 drm/amd/display: Fix up missing 'dc' & 'pipe_ctx' kdoc parameters in delay_cursor_until_vupdate() Fixes the following gcc with W=1: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:1904: warning: Function parameter or member 'dc' not described in 'delay_cursor_until_vupdate' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:1904: warning: Function parameter or member 'pipe_ctx' not described in 'delay_cursor_until_vupdate' Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit c00ebe9aeec6df816fa8a5a167cd1c102d02dd28 Author: Srinivasan Shanmugam Date: Wed May 31 14:52:02 2023 +0530 drm/amd/display: Fix up kdoc formatting in dcn32_resource_helpers.c Fixes the following W=1 kernel build warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:97: warning: Cannot understand * ************************************************************************** drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:264: warning: Cannot understand * ************************************************************************* drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:435: warning: Cannot understand * ************************************************************************* drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:475: warning: Cannot understand * ************************************************************************* drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:599: warning: Function parameter or member 'dc' not described in 'dcn32_can_support_mclk_switch_using_fw_based_vblank_stretch' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:599: warning: Function parameter or member 'context' not described in 'dcn32_can_support_mclk_switch_using_fw_based_vblank_stretch' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:587: warning: Function parameter or member 'dc' not described in 'dcn32_can_support_mclk_switch_using_fw_based_vblank_stretch' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:587: warning: Function parameter or member 'context' not described in 'dcn32_can_support_mclk_switch_using_fw_based_vblank_stretch' Cc: Hamza Mahfooz Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 23ed8833f231a3ea36d1c352737ef6f1eadfc899 Author: Bob Zhou Date: Tue May 30 14:48:02 2023 +0800 drm/amdxcp: fix Makefile to build amdxcp module After drm conduct amdgpu Makefile, amdgpu.ko has been created and "amdgpu-y +=" in amdxcp Makefile isn't used. So modify amdgpu-y to amdxcp-y and build amdxcp module. Signed-off-by: Bob Zhou Reviewed-by: James Zhu Reviewed-by: Guchun Chen Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit b3a02e8b61c19a0380870c713bc704d7e4f9e0dd Author: Srinivasan Shanmugam Date: Tue May 30 04:03:16 2023 +0530 drm/amdgpu: Fix up missing parameters kdoc in svm_migrate_vma_to_ram Fix these warnings by adding & deleting the deviant arguments. gcc with W=1 drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_migrate.c:671: warning: Function parameter or member 'node' not described in 'svm_migrate_vma_to_ram' drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_migrate.c:671: warning: Function parameter or member 'trigger' not described in 'svm_migrate_vma_to_ram' drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_migrate.c:671: warning: Function parameter or member 'fault_page' not described in 'svm_migrate_vma_to_ram' drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_migrate.c:671: warning: Excess function parameter 'adev' description in 'svm_migrate_vma_to_ram' drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_migrate.c:771: warning: Function parameter or member 'fault_page' not described in 'svm_migrate_vram_to_ram' Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 7a66ad6c087ee3863cc9a8d696ac2191d1c2e904 Author: ZhenGuo Yin Date: Tue May 9 17:42:11 2023 +0800 drm/amdgpu: set finished fence error if job timedout Set finished fence to ETIME error if job timedout. Signed-off-by: ZhenGuo Yin Acked-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 932fc49479303961c1da54a1112eb26cdc890c76 Author: Srinivasan Shanmugam Date: Mon May 29 20:23:33 2023 +0530 drm/amdgpu: Fix missing parameter desc for 'xcp_id' in amdgpu_amdkfd_reserve_mem_limit Fix these warnings by adding 'xcp_id' argument. gcc with W=1 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:160: warning: Function parameter or member 'xcp_id' not described in 'amdgpu_amdkfd_reserve_mem_limit' Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Acked-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 1bae03aab2b41770b9198b3ef1ddc7dc7efb0678 Author: Srinivasan Shanmugam Date: Tue May 30 14:43:14 2023 +0530 drm/amdgpu: Fix up missing parameter in kdoc for 'inst' in gmc_ v7, v8, v9, v10, v11.c Fix these warnings by adding 'inst' arguments to kdocs. gcc with W=1 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c:428: warning: Function parameter or member 'inst' not described in 'gmc_v7_0_flush_gpu_tlb_pasid' drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c:626: warning: Function parameter or member 'inst' not described in 'gmc_v8_0_flush_gpu_tlb_pasid' drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c:423: warning: Function parameter or member 'inst' not described in 'gmc_v10_0_flush_gpu_tlb_pasid' drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c:328: warning: Function parameter or member 'inst' not described in 'gmc_v11_0_flush_gpu_tlb_pasid' drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c:950: warning: Function parameter or member 'inst' not described in 'gmc_v9_0_flush_gpu_tlb_pasid' Cc: Christian König Cc: Alex Deucher Cc: Hawking Zhang Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 3eeb0d037a543588cf2b8890224ec26841e1069a Author: Srinivasan Shanmugam Date: Tue May 30 18:17:17 2023 +0530 drm/amdgpu: Fix up missing kdoc parameter 'inst' in get_wave_count() & kgd_gfx_v9_get_cu_occupancy() Fix these warnings by adding 'inst' arguments to kdocs. gcc with W=1 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:692: warning: Function parameter or member 'inst' not described in 'get_wave_count' drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:763: warning: Function parameter or member 'inst' not described in 'kgd_gfx_v9_get_cu_occupancy' Cc: Felix Kuehling Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ca2943fe0acecfc89937dcf0abef2d7c1bccf9f4 Author: Srinivasan Shanmugam Date: Mon May 29 19:29:35 2023 +0530 drm/amdgpu: Fix missing parameter desc for 'xcc_id' in gfx_v7_0.c & amdgpu_rlc.c Fix these warnings by adding 'xcc_id' arguments. gcc with W=1 drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c:1557: warning: Function parameter or member 'xcc_id' not described in 'gfx_v7_0_select_se_sh' drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c:38: warning: Function parameter or member 'xcc_id' not described in 'amdgpu_gfx_rlc_enter_safe_mode' drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c:62: warning: Function parameter or member 'xcc_id' not described in 'amdgpu_gfx_rlc_exit_safe_mode' Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit c22b044070971e474dd0ff81a9830df93751f726 Author: Alex Sierra Date: Mon May 29 16:01:37 2023 -0500 drm/amdkfd: flag added to handle errors from svm validate and map If a return error is raised during validation and mapping of a prange, this flag is set. It is a rare occurrence, but it could happen when `amdgpu_hmm_range_get_pages_done` returns true. In such cases, the caller should retry. However, it is important to ensure that the prange is updated correctly during the retry. Signed-off-by: Alex Sierra Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit c6a64ad9b7f7182b5e2439a740574300b2e61951 Author: Lijo Lazar Date: Tue May 30 11:52:45 2023 +0530 drm/amdgpu: Initialize xcc mask For ASICs which are not initialized through discovery, initialize GFX cluster as 1. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0be5ccd518031be41266ef952db2202900d519cc Author: Srinivasan Shanmugam Date: Sat May 27 22:05:40 2023 +0530 drm/amd/display: Fix up kdoc formats in dcn32_fpu.c Fixes the following gcc with W=1: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:2806: warning: Cannot understand * ************************************************************************* drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:2855: warning: Cannot understand * ************************************************************************* drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:2900: warning: Function parameter or member 'dc' not described in 'dcn32_assign_fpo_vactive_candidate' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:2900: warning: Function parameter or member 'context' not described in 'dcn32_assign_fpo_vactive_candidate' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:2900: warning: Function parameter or member 'fpo_candidate_stream' not described in 'dcn32_assign_fpo_vactive_candidate' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:2929: warning: Function parameter or member 'dc' not described in 'dcn32_find_vactive_pipe' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:2929: warning: Function parameter or member 'context' not described in 'dcn32_find_vactive_pipe' drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:2929: warning: Function parameter or member 'vactive_margin_req_us' not described in 'dcn32_find_vactive_pipe' Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 21d81681c298e9712fe37df4b001e8476fc7d03b Author: Srinivasan Shanmugam Date: Sat May 27 19:45:52 2023 +0530 drm/amd/display: Add missing kdoc entries in update_planes_and_stream_adapter Fixes the following gcc with W=1: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:374: warning: Function parameter or member 'dc' not described in 'update_planes_and_stream_adapter' drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:374: warning: Function parameter or member 'update_type' not described in 'update_planes_and_stream_adapter' drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:374: warning: Function parameter or member 'planes_count' not described in 'update_planes_and_stream_adapter' drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:374: warning: Function parameter or member 'stream' not described in 'update_planes_and_stream_adapter' drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:374: warning: Function parameter or member 'stream_update' not described in 'update_planes_and_stream_adapter' drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:374: warning: Function parameter or member 'array_of_surface_update' not described in 'update_planes_and_stream_adapter' Cc: Rodrigo Siqueira Signed-off-by: Srinivasan Shanmugam Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 837d4e071d250d695eba7a08c55c77f6a5b4bb5e Author: Srinivasan Shanmugam Date: Sat May 27 22:24:53 2023 +0530 drm/amdgpu: Fix create_dmamap_sg_bo kdoc warnings Fix the following gcc with W=1: drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:292: warning: Cannot understand * @create_dmamap_sg_bo: Creates a amdgpu_bo object to reflect information Cc: Felix Kuehling Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit b695c97b580a1949d0dd96aa17b01d4de738eda3 Author: Lijo Lazar Date: Mon May 29 19:18:54 2023 +0530 drm/amdkfd: Fix MEC pipe interrupt enablement for_each_inst modifies xcc_mask and therefore the loop doesn't initialize properly interrupts on all pipes. Keep looping through xcc as the outer loop to fix this issue. Fixes: c4050ff1a43e ("drm/amdkfd: Use xcc mask for identifying xcc") Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 07a1475279244cd8eea81bec44fd5f0a9d6871f8 Author: Graham Sider Date: Mon Apr 3 15:31:53 2023 -0400 drm/amdkfd: Add new gfx_target_versions for GC 9.4.3 For GC 9.4.3, set gfx_target_version to 90402 for rev 1 and later (APU or dGPU), 90401 for rev 0 dGPU, and 90400 for rev 0 APU. Signed-off-by: Graham Sider Acked-by: Alex Deucher Reviewed-by: Amber Lin Signed-off-by: Alex Deucher commit 9eba1b8b70f6488e944fdd1928ef758917bf7229 Author: Srinivasan Shanmugam Date: Thu May 25 21:37:35 2023 +0530 drm/amdgpu: Fix up missing kdoc in sdma_v6_0.c Address a bunch of kdoc warnings: gcc with W=1 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:248: warning: Function parameter or member 'job' not described in 'sdma_v6_0_ring_emit_ib' drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:248: warning: Function parameter or member 'flags' not described in 'sdma_v6_0_ring_emit_ib' drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:946: warning: Function parameter or member 'timeout' not described in 'sdma_v6_0_ring_test_ib' drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:1125: warning: Function parameter or member 'ring' not described in 'sdma_v6_0_ring_pad_ib' drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:1176: warning: Function parameter or member 'vmid' not described in 'sdma_v6_0_ring_emit_vm_flush' drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:1176: warning: Function parameter or member 'pd_addr' not described in 'sdma_v6_0_ring_emit_vm_flush' Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 66dadf1ab196fd2cf8c41f07a4745ad7fb84726e Author: Srinivasan Shanmugam Date: Thu May 25 23:30:59 2023 +0530 drm/amdgpu: Fix up kdoc in amdgpu_acpi.c Fix these warnings by adding & deleting the deviant arguments. gcc with W=1 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:906: warning: Function parameter or member 'numa_info' not described in 'amdgpu_acpi_get_node_id' drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:906: warning: Excess function parameter 'nid' description in 'amdgpu_acpi_get_node_id' Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 23616d1ff31d6e8ffd4f1e12b6b1e2e783fa8280 Author: Srinivasan Shanmugam Date: Thu May 25 22:32:35 2023 +0530 drm/amdgpu: Fix up kdoc in sdma_v4_4_2.c Address a bunch of kdoc warnings: gcc with W=1 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:426: warning: Function parameter or member 'inst_mask' not described in 'sdma_v4_4_2_inst_gfx_stop' drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:457: warning: Function parameter or member 'inst_mask' not described in 'sdma_v4_4_2_inst_rlc_stop' drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:470: warning: Function parameter or member 'inst_mask' not described in 'sdma_v4_4_2_inst_page_stop' drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:506: warning: Function parameter or member 'inst_mask' not described in 'sdma_v4_4_2_inst_ctx_switch_enable' drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:794: warning: Function parameter or member 'inst_mask' not described in 'sdma_v4_4_2_inst_rlc_resume' drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:810: warning: Function parameter or member 'inst_mask' not described in 'sdma_v4_4_2_inst_load_microcode' drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:854: warning: Function parameter or member 'inst_mask' not described in 'sdma_v4_4_2_inst_start' Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 3a25071a970885a2bd3f63cfc7c729e0d536e10f Author: Ikshwaku Chauhan Date: Thu May 25 10:57:26 2023 +0530 drm/amdgpu: enable tmz by default for GC 11.0.1 Add IP GC 11.0.1 in the list of target to have tmz enabled by default. Signed-off-by: Ikshwaku Chauhan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 28ebbb4981cb1fad12e0b1227dbecc88810b1ee8 Author: Alex Deucher Date: Wed May 24 14:30:12 2023 -0400 drm/amdkfd: fix gfx_target_version for certain 11.0.3 devices Certain boards with GC IP 11.0.3 need slightly different handling in the shader compiler due to board specific bounding box optimizations. Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit 8ffd6f0442674f32c048ec8dffdbc5ec67829beb Author: Guchun Chen Date: Thu May 25 17:24:31 2023 +0800 drm/amdgpu: keep irq count in amdgpu_irq_disable_all This can clean up all irq warnings because of unbalanced amdgpu_irq_get/put when unplugging/unbinding device, and leave irq count decrease in each ip fini function. Signed-off-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 544c7f62cf32db2bd358f1e8a40a98bf98fa2a5c Author: Bob Pearson Date: Tue May 30 17:13:35 2023 -0500 RDMA/rxe: Implement rereg_user_mr Implement the two easy cases of ib_rereg_user_mr. Link: https://lore.kernel.org/r/20230530221334.89432-7-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 86a3fb55bc4fb2ea0c276d56f03335574a694ee4 Author: Bob Pearson Date: Tue May 30 17:13:34 2023 -0500 RDMA/rxe: Let rkey == lkey for local access In order to conform to other drivers stop using rkey == 0 as an indication that there are no remote access flags set. Set rkey == lkey by default for all MRs. Link: https://lore.kernel.org/r/20230530221334.89432-6-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 02ed253770fb27380c51af8e7e0903e6905469b6 Author: Bob Pearson Date: Tue May 30 17:13:33 2023 -0500 RDMA/rxe: Introduce rxe access supported flags Introduce supported bit masks for setting the access attributes of MWs, MRs, and QPs. Check these when attributes are set. Link: https://lore.kernel.org/r/20230530221334.89432-5-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 425e1c9018fdf25cb4531606cc92d9d01a55534f Author: Bob Pearson Date: Tue May 30 17:13:32 2023 -0500 RDMA/rxe: Fix access checks in rxe_check_bind_mw The subroutine rxe_check_bind_mw() in rxe_mw.c performs checks on the mw access flags before they are set so they always succeed. This patch instead checks the access flags passed in the send wqe. Fixes: 32a577b4c3a9 ("RDMA/rxe: Add support for bind MW work requests") Link: https://lore.kernel.org/r/20230530221334.89432-4-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 2a129958bdf045ba5eec20d3b6a1c20614ea05a7 Author: Bob Pearson Date: Tue May 30 17:13:31 2023 -0500 RDMA//rxe: Optimize send path in rxe_resp.c Bypass calling check_rkey() in rxe_resp.c for non-rdma messages. Link: https://lore.kernel.org/r/20230530221334.89432-3-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit d11442c6bde7aad0948b39c3e47f375fed98c776 Author: Bob Pearson Date: Tue May 30 17:13:30 2023 -0500 RDMA/rxe: Rename IB_ACCESS_REMOTE Rename IB_ACCESS_REMOTE to RXE_ACCESS_REMOTE and move to rxe_verbs.h as an enum instead of a #define. Shouldn't use IB_xxx for rxe symbols. Link: https://lore.kernel.org/r/20230530221334.89432-2-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 0db117359e47750d8bd310d19f13e1c4ef7fc26a Author: Marco Morandini Date: Tue May 30 15:40:08 2023 +0200 HID: add quirk for 03f0:464a HP Elite Presenter Mouse HP Elite Presenter Mouse HID Record Descriptor shows two mouses (Repord ID 0x1 and 0x2), one keypad (Report ID 0x5), two Consumer Controls (Report IDs 0x6 and 0x3). Previous to this commit it registers one mouse, one keypad and one Consumer Control, and it was usable only as a digitl laser pointer (one of the two mouses). This patch defines the 464a USB device ID and enables the HID_QUIRK_MULTI_INPUT quirk for it, allowing to use the device both as a mouse and a digital laser pointer. Signed-off-by: Marco Morandini Signed-off-by: Jiri Kosina commit f88af60e74a5b31be1551ffb9af216c8a800501c Author: Rahul Rameshbabu Date: Mon May 29 15:20:51 2023 -0700 HID: nvidia-shield: Support LED functionality for Thunderstrike Expose the 2017 SHIELD controller (Thunderstrike) LED through the kernel LED API. Signed-off-by: Rahul Rameshbabu Signed-off-by: Jiri Kosina commit 13d02c69e4788f700377677a6cc4247a2869b17d Author: Rahul Rameshbabu Date: Mon May 29 15:20:50 2023 -0700 HID: nvidia-shield: Add mappings for consumer HID USAGE buttons Map Android Home, Back, Search, VolumeUp, VolumeDown, and PlayPause buttons to the appropriate input event codes. Signed-off-by: Rahul Rameshbabu Signed-off-by: Jiri Kosina commit 09308562d4afb1abc66366608fa1cb9de783272f Author: Rahul Rameshbabu Date: Thu Jun 8 07:34:50 2023 -0700 HID: nvidia-shield: Initial driver implementation with Thunderstrike support Supports the Thunderstrike (SHIELD 2017) controller. Implements support for the Thunderstrike HOSTCMD firmware interface. Adds sysfs attributes about a SHIELD device and introduces haptics support for controllers. Signed-off-by: Rahul Rameshbabu Signed-off-by: Jiri Kosina commit 6312e57b3250085b196d9630d2eeea6a583b97ef Author: Thierry Reding Date: Fri Jun 9 13:48:38 2023 +0200 arm64: tegra: Enable thermal support on Jetson Orin Nano Enable the TJ thermal zone and hook up cooling maps for the PWM- controlled fan and two trip points. Acked-by: Jon Hunter Signed-off-by: Thierry Reding commit a6fb90f0eefb13e2cf18f39f1a84a9ef6054153b Author: Thierry Reding Date: Fri Jun 9 13:45:53 2023 +0200 arm64: tegra: Enable thermal support on Jetson Orin NX Enable the TJ thermal zone and hook up cooling maps for the PWM- controlled fan and two trip points. This also removes a duplicate definition of the PWM fan and changes its cooling levels. This should have no effect, though, because the fan wasn't previously connected to anything and by default would be turned off at probe time. Acked-by: Jon Hunter Signed-off-by: Thierry Reding commit 1d3fbd3d41a6c7552126ce39b81591de942a4207 Author: Thierry Reding Date: Thu Jan 26 14:34:02 2023 +0100 arm64: tegra: Enable thermal support on Jetson AGX Orin Add thermal zone details and enable the PWM fan as cooling device. Note that this also changes the cooling levels for the PWM fan, which should have no effect, though, because the fan wasn't previously connected to anything and by default would be turned off at probe time. Acked-by: Jon Hunter Signed-off-by: Thierry Reding commit 09d990782a243b97eb566717a2155a306a2f42af Author: Thierry Reding Date: Thu Nov 17 14:02:30 2022 +0100 arm64: tegra: Add Tegra234 thermal support Add device tree node for the BPMP thermal node on Tegra234 and add thermal zone definitions. Acked-by: Jon Hunter Signed-off-by: Thierry Reding commit bd9681c00612a6830ecf74403584054e74646dd0 Author: Thierry Reding Date: Fri Jun 9 12:55:43 2023 +0200 arm64: tegra: Add a few blank lines for better readability Surround device tree nodes with blank lines for increased readability. Acked-by: Jon Hunter Signed-off-by: Thierry Reding commit 679899fbc2592e1edecd77d31e89c3ad92ba9e5a Author: Thierry Reding Date: Fri Jun 9 12:55:42 2023 +0200 arm64: tegra: Sort properties more logically We typically sort the "compatible" property first because it defines what the remainder of the properties can be. For the sound node on the Jetson AGX Orin this wasn't done, so fix that up. Acked-by: Jon Hunter Signed-off-by: Thierry Reding commit e2dbd577c51b999d25c3cc990149d98d97f3a152 Author: Diogo Ivo Date: Tue May 16 09:28:29 2023 +0100 arm64: tegra: Enable GPU on Smaug Enable the GPU on the Pixel C. Signed-off-by: Diogo Ivo Signed-off-by: Thierry Reding commit aa8ca24cc8e7c105b93b1bf35598f402ca8afd6c Author: Diogo Ivo Date: Tue May 16 09:28:28 2023 +0100 arm64: tegra: Add GPU power rail regulator on Smaug Add the GPU power rail regulator node for the Pixel C. Signed-off-by: Diogo Ivo Signed-off-by: Thierry Reding commit 72e49cadea390556ca60fad973740ddc5587e408 Author: Lasse Brun Date: Mon May 22 20:40:12 2023 +0200 HID: apple: Option to swap only left side mod keys On the Keychron K8 keyboard, and probably others, the right side keys should not be swapped to maintain PC layout. Swapping the right side keys moves 'Super' before 'Alt gr' which is not intended by the default Keychron layout or the ISO layout. Signed-off-by: Lasse Brun Signed-off-by: Jiri Kosina commit 49904a0ebf23b15aad288a10f5354e7cd8193121 Author: Geert Uytterhoeven Date: Tue May 23 17:10:59 2023 +0200 HID: uclogic: Modular KUnit tests should not depend on KUNIT=y While KUnit tests that cannot be built as a loadable module must depend on "KUNIT=y", this is not true for modular tests, where it adds an unnecessary limitation. Fix this by relaxing the dependency to "KUNIT". Fixes: 08809e482a1c44d9 ("HID: uclogic: KUnit best practices and naming conventions") Signed-off-by: Geert Uytterhoeven Reviewed-by: David Gow Reviewed-by: José Expósito Signed-off-by: Jiri Kosina commit d78b9d6671decdaedb539635b1d0a34f8f5934f8 Author: Yunfei Dong Date: Tue May 30 20:29:08 2023 +0800 media: mediatek: vcodec: Add dbgfs help function Getting dbgfs help information with command "echo -help > vdec" or "echo > vdec". Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cc770218226534d921d2adb0819e00014ce471c5 Author: Yunfei Dong Date: Tue May 30 20:29:07 2023 +0800 media: mediatek: vcodec: Add encode to support dbgfs Add encode to support dbgfs. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5910584b560b7db374d00d65ba608eb0b156eb11 Author: Yunfei Dong Date: Tue May 30 20:29:06 2023 +0800 media: mediatek: vcodec: Change dbgfs interface to support encode Extend dbgfs init interface to support encode and create encode dbgfs file. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6d5aea131f4d99ec0de79d3bd8e8e15ee05563e4 Author: Yunfei Dong Date: Tue May 30 20:29:05 2023 +0800 media: mediatek: vcodec: Get each instance format type Adding echo command to get capture and output queue format type of each instance:"echo '-format' > vdec", not current hardware supported. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 07b7e505ff13f6c8493291bc0b24c6303a6b224f Author: Yunfei Dong Date: Tue May 30 20:29:04 2023 +0800 media: mediatek: vcodec: Get each context resolution information Will store the string to temp buffer like "echo -picinfo > vdec" when user want to get needed information. Then getting debug information using command 'cat vdec' calling mtk_vdec_dbgfs_read to analysis the temp buffer. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5e488a4fd8595817e74b255d33868e03f57ad16f Author: Yunfei Dong Date: Tue May 30 20:29:03 2023 +0800 media: mediatek: vcodec: Add a debugfs file to get different useful information In oder to get each instance information according to test command, adding one file node "vdec". Can use echo command to set different string value as 'echo -picinfo > vdec'. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil [hverkuil: drop unwanted dbgfs_inst NULL ptr check in mtk_vcodec_dbgfs_remove] Signed-off-by: Mauro Carvalho Chehab commit 404500ba8009ae8fa29edbb871b9bc2591b39c76 Author: Yunfei Dong Date: Tue May 30 20:29:02 2023 +0800 media: mediatek: vcodec: Add debug params to control different log level Add parameter mtk_vcodec_dbg to open each codec log. Add parameter mtk_v4l2_dbg_level to open each instance log according to the parameter value. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil [hverkuil: add () around 'level' in macro] Signed-off-by: Mauro Carvalho Chehab commit 7866e124394d2c0e8e57b29d8c62ef362896c705 Author: Yunfei Dong Date: Tue May 30 20:29:01 2023 +0800 media: mediatek: vcodec: Add debugfs interface to get debug information This will be useful when debugging specific issues related to kernel in running status. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c21a17b5ce6e1a2e8de2f027a9a98db3cb96c428 Author: Uwe Kleine-König Date: Thu Jun 1 15:25:32 2023 +0200 i2c: imx-lpi2c: Don't open-code DIV_ROUND_UP There is no change in the generated code (tested on an ARCH=arm allmodconfig build). Signed-off-by: Uwe Kleine-König Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 564d73c4d9201526bd976b9379d2aaf1a7133e84 Author: Biju Das Date: Wed Jun 7 17:57:38 2023 +0100 i2c: Add i2c_get_match_data() Add i2c_get_match_data() to get match data for I2C, ACPI and DT-based matching, so that we can optimize the driver code. Suggested-by: Geert Uytterhoeven Signed-off-by: Biju Das [wsa: simplified var initialization] Signed-off-by: Wolfram Sang commit 3b270fac84439cbd036c98e189d17f2bc3c85494 Author: Linus Walleij Date: Tue Jun 6 16:29:31 2023 +0200 mtd: otp: Put factory OTP/NVRAM into the entropy pool The factory OTP, if supported, contains factory-programmed information such as typically the serial number or production week for the chip. As this is device-unique information, submit it into the system entropy pool. This does not count as improvement of the entropy as such but in practice it makes it a bit more random to mix in these numbers. Cc: Michael Walle Acked-by: Jason A. Donenfeld Signed-off-by: Linus Walleij Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230606142931.3721374-1-linus.walleij@linaro.org commit 6db02fdfdca0cf39b4d66950451d7f22b72a9031 Author: Christophe JAILLET Date: Sun Jun 4 06:42:01 2023 +0200 mtd: mtdpart: Drop useless LIST_HEAD 'tmp_list' is unused, so drop it. Signed-off-by: Christophe JAILLET Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/547248195d87d1240d6126d13eb1364b1a0b634d.1685853690.git.christophe.jaillet@wanadoo.fr commit 87194abaa5ced8c1cee5499d9da058eadfa63f44 Author: Linus Walleij Date: Sat Jun 3 20:52:00 2023 +0200 mtd: chips: Use SPDX license headers Some of the files in mtd/chips do not have a SPDX license header, presumably because the text string "GPL'd" didn't parse with Thomas rulesets for magic license tagging. Fix this, the code is initially from RedHat which clearly targeted the Linux kernel and intended it to be GPLv2. In any case the original author appears to be David Woodhouse who can then confirm this. Cc: David Woodhouse Cc: Thomas Gleixner Signed-off-by: Linus Walleij Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230603185200.3571174-1-linus.walleij@linaro.org commit 7c74557f59e8880f079121e3cf8d5875f3e7e99d Author: Rafał Miłecki Date: Fri Jun 2 23:56:29 2023 +0200 dt-bindings: mtd: partitions: Include TP-Link SafeLoader in allowed list It's supposed to be there and it's needed for proper validation of DTS files. This fixes following errors for Northstar based TP-Link routers: arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dtb: flash@0: partitions: 'oneOf' conditional failed, one must be fixed: 'partition-file-system', 'partition-os-image', 'partitions-table-offset' do not match any of the regexes: 'pinctrl-[0-9]+' '#address-cells' is a required property '#size-cells' is a required property 'partition-file-system', 'partition-os-image', 'partitions-table-offset' do not match any of the regexes: '^partition@[0-9a-f]+$', 'pinctrl-[0-9]+' 'partition-file-system', 'partition-os-image', 'partitions-table-offset' do not match any of the regexes: '^partition-[0-9a-z]+$', 'pinctrl-[0-9]+' 'fis-index-block' is a required property arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dtb: flash@0: partitions:compatible: 'oneOf' conditional failed, one must be fixed: ['tplink,safeloader-partitions'] is too short 'fixed-partitions' was expected 'sercomm,sc-partitions' was expected 'arm,arm-firmware-suite' was expected 'brcm,bcm4908-partitions' was expected 'brcm,bcm947xx-cfe-partitions' was expected 'linksys,ns-partitions' was expected 'qcom,smem-part' was expected 'redboot-fis' was expected From schema: Documentation/devicetree/bindings/mtd/mtd.yaml arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dtb: flash@0: partitions: Unevaluated properties are not allowed ('partitions-table-offset' was unexpected) From schema: Documentation/devicetree/bindings/mtd/mtd.yaml arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dtb: flash@0: partitions: 'oneOf' conditional failed, one must be fixed: 'partition-file-system', 'partition-os-image', 'partitions-table-offset' do not match any of the regexes: 'pinctrl-[0-9]+' '#address-cells' is a required property '#size-cells' is a required property 'partition-file-system', 'partition-os-image', 'partitions-table-offset' do not match any of the regexes: '^partition@[0-9a-f]+$', 'pinctrl-[0-9]+' 'partition-file-system', 'partition-os-image', 'partitions-table-offset' do not match any of the regexes: '^partition-[0-9a-z]+$', 'pinctrl-[0-9]+' 'fis-index-block' is a required property arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dtb: flash@0: partitions:compatible: 'oneOf' conditional failed, one must be fixed: ['tplink,safeloader-partitions'] is too short 'fixed-partitions' was expected 'sercomm,sc-partitions' was expected 'arm,arm-firmware-suite' was expected 'brcm,bcm4908-partitions' was expected 'brcm,bcm947xx-cfe-partitions' was expected 'linksys,ns-partitions' was expected 'qcom,smem-part' was expected 'redboot-fis' was expected From schema: Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dtb: flash@0: partitions: Unevaluated properties are not allowed ('partitions-table-offset' was unexpected) From schema: Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dtb: flash@0: Unevaluated properties are not allowed ('partitions' was unexpected) From schema: Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml Signed-off-by: Rafał Miłecki Acked-by: Conor Dooley Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230602215629.2568-1-zajec5@gmail.com commit 46c37b99b5cbaa69a4d2af498b7d6a6db34d4db0 Author: Arseniy Krasnov Date: Fri Jun 9 14:28:39 2023 +0300 mtd: rawnand: meson: check buffer length Meson NAND controller has limited buffer length, so check it before command execution to avoid length trim. Also check MTD write size on chip attach. Signed-off-by: Arseniy Krasnov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230609112840.2325455-1-AVKrasnov@sberdevices.ru commit 2f5d0aef37c64c30da17a74a82cb782a4a943545 Author: Xiaoyong Lu Date: Tue May 30 08:55:00 2023 +0100 media: mediatek: vcodec: support stateless AV1 decoder Add mediatek av1 decoder linux driver which use the stateless API in MT8195. Signed-off-by: Xiaoyong Lu Tested-by: Nicolas Dufresne Reviewed-by: Nicolas Dufresne Tested-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1a50947df5b3a574c4c97891f8deb8de6500be6c Author: JaimeLiao Date: Thu Jun 8 13:21:14 2023 +0800 mtd: spinand: macronix: Add support for serial NAND flash MX31LF2GE4BC and MX31UF2GE4BC are Macroninx SPI NAND flash with 8-bit on-die ECC. Validated via normal(default) and QUAD mode by read ,read back, on Xilinx Zynq PicoZed FPGA which include Macronix SPI Host(drivers/spi/spi-mxic.c) Signed-off-by: JaimeLiao Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230608052114.20454-1-jaimeliao.tw@gmail.com commit c17a90a46a712b78578dd7156380fdd515a2af9d Author: Arseniy Krasnov Date: Thu Jun 8 07:47:28 2023 +0300 mtd: rawnand: meson: waiting w/o wired ready/busy pin If there is no wired ready/busy pin, classic way to wait for command completion is to use function 'nand_soft_waitrdy()'. Meson NAND has special command which allows to wait for NAND_STATUS_READY bit without reading status in a software loop (as 'nand_soft_waitrdy()' does). To use it send this command along with NAND_CMD_STATUS, then wait for an interrupt, and after interrupt send NAND_CMD_READ0. So this feature allows to use interrupt driven waiting without wired ready/busy pin. Suggested-by: Liang Yang Signed-off-by: Arseniy Krasnov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230608044728.1328506-3-AVKrasnov@sberdevices.ru commit 262bc0096b7c9122f5f815f094b068a1496a20f6 Author: Arseniy Krasnov Date: Thu Jun 8 07:47:27 2023 +0300 dt-bindings: nand: meson: Fix 'nand-rb' property Add description of 'nand-rb' property. Use "Fixes" because this property must be supported since the beginning. Fixes: fbc00b5e746f ("dt-bindings: nand: meson: convert txt to yaml") Signed-off-by: Arseniy Krasnov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230608044728.1328506-2-AVKrasnov@sberdevices.ru commit 30540a0d05d85ef7e6f740e62c3b44c87396e56c Author: Arseniy Krasnov Date: Thu Jun 8 07:36:44 2023 +0300 mtd: rawnand: meson: replace integer consts with proper defines Add defines for column address. It makes driver more readable, because bitwise OR with 0 looks useless. Suggested-by: Liang Yang Signed-off-by: Arseniy Krasnov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230608043644.1271186-1-AVKrasnov@sberdevices.ru commit 21962132044653f42ff8bbb37127c2557d6c39c2 Author: Amit Kumar Mahapatra Date: Wed Jun 7 11:09:36 2023 +0530 Revert "mtd: rawnand: arasan: Prevent an unsupported configuration" This reverts commit fc9e18f9e987ad46722dad53adab1c12148c213c. This patch was a work around to fix timeout issue while operating in NVDDR mode with software ECC engine. This patch prevents the Arasan NAND driver from operating in NVDDR mode with software ECC engine resulting in a significant performance degradation with SW-ECC. 'commit 7499bfeedb47 ("mtd: rawnand: arasan: Update NAND bus clock instead of system clock")' and 'commit e16eceea863b ("mtd: rawnand: arasan: Fix clock rate in NV-DDR")' fixes the timeout issue in NVDDR mode with SW-ECC so, reverting the changes as this work around is no longer required. Signed-off-by: Amit Kumar Mahapatra Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230607053936.14306-1-amit.kumar-mahapatra@amd.com commit 80c7373a456e71a41e40f0cfb32e32b9572262ce Author: Benjamin Gaignard Date: Wed May 3 09:34:38 2023 +0100 media: verisilicon: Conditionally ignore native formats AV1 film grain feature requires to use the postprocessor to produce valid frames. In such case the driver shouldn't propose native pixels format but only post-processed pixels format. Additionally if when setting a control a value could change capture queue pixels formats it is needed to call hantro_reset_raw_fmt(). Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 003afda97c6510f33d1ebcd96ca39661f3bf922f Author: Benjamin Gaignard Date: Wed May 3 09:34:37 2023 +0100 media: verisilicon: Enable AV1 decoder on rk3588 Add rk3588 AV1 decoder to Hantro variant. The hardware support image from 64x64 up to 7680x4320 by steps of 16 pixels. Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d8ebe59e7b36bce848426c43cd2ccacc03c82c0a Author: Benjamin Gaignard Date: Wed May 3 09:34:36 2023 +0100 media: verisilicon: Add film grain feature to AV1 driver Film grain feature add "old style" grain noise on decoded streams. Grain noise is applied after decoding by the postprocessor. The level of grain is based on gaussian sequence. Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 727a400686a2c0d25015c9e44916a59b72882f83 Author: Benjamin Gaignard Date: Wed May 3 09:34:35 2023 +0100 media: verisilicon: Add Rockchip AV1 decoder Implement AV1 stateless decoder for rockchip VPU981. It decode 8 and 10 bits AV1 bitstreams. AV1 scaling feature is done by the postprocessor. Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2abd484ca48f2e160c8d9c7241627c34855b621e Author: Peter De Schrijver Date: Mon May 8 15:20:54 2023 +0300 firmware: tegra: bpmp: Add support for DRAM MRQ GSCs Implement support for DRAM MRQ GSCs. Signed-off-by: Peter De Schrijver [treding@nvidia.com: drop unnecessary discrimination enum] Signed-off-by: Thierry Reding commit c0d0e579db4ee81a71fd1c81aad66caa236723fe Author: Benjamin Gaignard Date: Wed May 3 09:34:34 2023 +0100 media: verisilicon: Add AV1 entropy helpers AV1 hardware decoder needs entropy parameters to decode frames. They are computed from various arrays defined in AV1 section "9.4. Default CDF tables". Add helpers functions to init, store and get these parameters. Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1b9ef2744c5e7d68e940794827cc8f035e6460ef Author: Benjamin Gaignard Date: Wed May 3 09:34:33 2023 +0100 media: verisilicon: Compute motion vectors size for AV1 frames Compute the additional space required to store motion vectors at the end of the frames buffers. Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7040ed4ee68cae6d4571ab5b7ce1311de13f74c1 Author: Benjamin Gaignard Date: Wed May 3 09:34:32 2023 +0100 media: verisilicon: Check AV1 bitstreams bit depth The driver supports 8 and 10 bits bitstreams, make sure to discard other cases. It could happens that userland test if V4L2_CID_STATELESS_AV1_SEQUENCE exists without setting bit_depth field in this case use HANTRO_DEFAULT_BIT_DEPTH value. Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 53421e73b6a20cf0952c9428d003c45a10435776 Author: Benjamin Gaignard Date: Wed May 3 09:34:31 2023 +0100 media: verisilicon: Add AV1 decoder mode and controls Add AV1 decoder as new decoder mode to Hantro driver. Register needed AV1 controls for the decoder. Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit aa1e34c85b9e04ed7c4bb9798094799938eb0525 Author: Benjamin Gaignard Date: Wed May 3 09:34:30 2023 +0100 media: verisilicon: Get bit depth for V4L2_PIX_FMT_NV15_4L4 Let's the driver knows that V4L2_PIX_FMT_NV15_4L4 is a 10bits pixel format. Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fc91af075512386facb5f1a84fe85dcf28f68767 Author: Benjamin Gaignard Date: Wed May 3 09:34:29 2023 +0100 media: Add NV15_4L4 pixel format NV15_4L4 is the 10-bits per component 4x4 tiled format. Signed-off-by: Benjamin Gaignard Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 86c256be5848b2515702832ce93f748d9ffbebea Author: Nicolas Dufresne Date: Wed May 3 09:34:28 2023 +0100 media: v4l2-common: Add support for fractional bpp Fraction bytes-per-pixel exist for some packed format. You will find notably on Rockhip platform that 10bit data is stored fully packed, meaning that there is 1.25 pixels per bytes. This can be represented with the fraction 5/4 and can be used to scale the width into a bytesperline. Signed-off-by: Nicolas Dufresne Signed-off-by: Benjamin Gaignard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2ef3372355f63fc1a29310ce9064fb76fe0806ed Author: Benjamin Gaignard Date: Wed May 3 09:34:27 2023 +0100 media: AV1: Make sure that bit depth in correctly initialize Make sure that bit_depth field of V4L2_CTRL_TYPE_AV1_SEQUENCE is initialized correctly before using it. Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1fb38c3cfd39ada092a0a1588a119bf297494b9d Author: Benjamin Gaignard Date: Wed May 3 09:34:26 2023 +0100 media: dt-bindings: media: rockchip-vpu: Add rk3588 vpu compatible Add compatible for rk3588 AV1 vpu decoder. Signed-off-by: Benjamin Gaignard Acked-by: Krzysztof Kozlowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9de30f579980b498606a9c2440b73ae3b670771b Author: Daniel Almeida Date: Mon Mar 6 16:18:50 2023 +0000 media: Add AV1 uAPI This patch adds the AOMedia Video 1 (AV1) kernel uAPI. This design is based on currently available AV1 API implementations and aims to support the development of AV1 stateless video codecs on Linux. Signed-off-by: Daniel Almeida Co-developed-by: Nicolas Dufresne Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9c9d501b28a00f4365632260df6cae488a905af7 Author: Dan Carpenter Date: Thu May 25 11:04:51 2023 +0300 drm/amd/amdgpu: Fix up locking etc in amdgpu_debugfs_gprwave_ioctl() There are two bugs here. 1) Drop the lock if copy_from_user() fails. 2) If the copy fails then the correct error code is -EFAULT instead of -EINVAL. I also broke up the long line and changed "sizeof rd->id" to "sizeof(rd->id)". Fixes: 553f973a0d7b ("drm/amd/amdgpu: Update debugfs for XCC support (v3)") Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit 2104793233c2b803107fa39baa9fa149648adce7 Author: Hans Verkuil Date: Wed May 24 13:11:49 2023 +0100 media: pci: tw686x: no need to check 'next' If 'done' is not NULL, then next can never be NULL, so just drop the 'next' check. This fixes this smatch warning: drivers/media/pci/tw686x/tw686x-audio.c:62 tw686x_audio_irq() warn: can 'next' even be NULL? Signed-off-by: Hans Verkuil Cc: Ezequiel Garcia Signed-off-by: Mauro Carvalho Chehab commit 321488d180c2f5c1811a0ba7b18d18c7af87739b Author: Yang Li Date: Wed May 24 11:59:52 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_resource.c:899:43: warning: unused variable 'res_create_maximus_funcs' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 9938333a46c9e20539c85ca7df42a739541b0493 Author: James Zhu Date: Tue Apr 25 17:02:48 2023 -0400 drm/amdgpu: use amdxcp platform device as spatial partition Use amdxcp platform device as spatial partition device. -v2: remove unused variable Signed-off-by: James Zhu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 2192fa95276b0561a579fa4cd19de3f16d47d171 Author: Hans Verkuil Date: Wed May 24 13:11:48 2023 +0100 media: mediatek: vpu: add missing clk_unprepare If vpu_clock_enable() fails, then call clk_unprepare(). This fixes this smatch warning: drivers/media/platform/mediatek/vpu/mtk_vpu.c:1031 mtk_vpu_resume() warn: 'vpu->clk' from clk_prepare() not released on lines: 1020. Signed-off-by: Hans Verkuil Cc: Yunfei Dong Signed-off-by: Mauro Carvalho Chehab commit ab1270a29b4f2b23aaa28d590d8361903c68b770 Author: Yang Li Date: Wed May 24 11:59:48 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_resource.c:1390:43: warning: unused variable 'res_create_maximus_funcs' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 3b60b70dbec9bb2450ecf012a7b8b6e5dce7168d Author: James Zhu Date: Tue Apr 25 17:00:50 2023 -0400 drm/amdxcp: add platform device driver for amdxcp Add platform device driver for amdxcp to support amdgpu spatial partition. -v2: fix build warning Signed-off-by: James Zhu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 3034983db355daefc4463defce802b8e6d86539f Author: Srinivasan Shanmugam Date: Fri May 19 18:10:40 2023 +0530 drm/amdgpu: Mark mmhub_v1_8_mmea_err_status_reg as __maybe_unused Silencing the compiler from below compilation error: drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c:704:23: error: variable 'mmhub_v1_8_mmea_err_status_reg' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static const uint32_t mmhub_v1_8_mmea_err_status_reg[] = { ^ 1 error generated. Mark the variable as __maybe_unused to make it clear to clang that this is expected, so there is no more warning. Cc: Christian König Cc: Lijo Lazar Cc: Luben Tuikov Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Nathan Chancellor Signed-off-by: Alex Deucher commit 3df55cd773e8603b623425cc97b05e542854ad27 Author: Hans Verkuil Date: Wed May 24 13:11:47 2023 +0100 media: platform: mediatek: vpu: fix NULL ptr dereference If pdev is NULL, then it is still dereferenced. This fixes this smatch warning: drivers/media/platform/mediatek/vpu/mtk_vpu.c:570 vpu_load_firmware() warn: address of NULL pointer 'pdev' Signed-off-by: Hans Verkuil Cc: Yunfei Dong Signed-off-by: Mauro Carvalho Chehab commit 70a6267753c1f755157e3bfb63d8fce4137729c6 Author: Yang Li Date: Wed May 24 11:59:51 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn321/dcn321_resource.c:1346:43: warning: unused variable 'res_create_maximus_funcs' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn321/dcn321_resource.c:735:38: warning: unused variable 'debug_defaults_diags' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 3a10a44a3e00d0227d13210ffeef50daa3a326bb Author: Jiapeng Chong Date: Wed May 24 16:57:09 2023 +0800 drm/amd/display: clean up some inconsistent indenting No functional modification involved. drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn321/dcn321_fpu.c:556 dcn321_update_bw_bounding_box_fpu() warn: inconsistent indenting. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5304 Signed-off-by: Jiapeng Chong Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 2c4993bf88ef1e0ed6c81d2fb56f30f32c3d2e74 Author: Yang Li Date: Wed May 24 11:59:50 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.c:1355:43: warning: unused variable 'res_create_maximus_funcs' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.c:899:38: warning: unused variable 'debug_defaults_diags' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit c0c2c51c40fef6960c11a3f132acf91878fa0de0 Author: Jiapeng Chong Date: Wed May 24 16:57:08 2023 +0800 drm/amd/display: clean up some inconsistent indenting No functional modification involved. drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn314/dcn314_fpu.c:269 dcn314_update_bw_bounding_box_fpu() warn: inconsistent indenting. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5305 Signed-off-by: Jiapeng Chong Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 99f9cd2e25cc4cd1a193c8e4c9ea4877abf6bddd Author: Hans Verkuil Date: Wed May 24 13:11:46 2023 +0100 media: platform: renesas-ceu: drop buf NULL check Since start_streaming is only called if there are at least two buffers queued, the ceudev->capture list will never be empty, so the check whether there are no buffers can be dropped. Note that the '!buf' check was wrong in any case, if we wanted to check for an empty list it should have used list_empty(). This fixes this smatch warning: drivers/media/platform/renesas/renesas-ceu.c:705 ceu_start_streaming() warn: can 'buf' even be NULL? Signed-off-by: Hans Verkuil Reviewed-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab commit abc7e24275a35975e58e699ff2afdbcc47e124d6 Author: Yang Li Date: Wed May 24 11:59:49 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.c:1357:43: warning: unused variable 'res_create_maximus_funcs' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.c:893:38: warning: unused variable 'debug_defaults_diags' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit aab9b215d96e0c7e89109821f738f80d84270461 Author: Yang Li Date: Wed May 24 11:59:46 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn302/dcn302_resource.c:957:43: warning: unused variable 'res_create_maximus_funcs' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn302/dcn302_resource.c:101:38: warning: unused variable 'debug_defaults_diags' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 7cc471112edd5292a05698dd3f7b9543844a26a1 Author: Hans Verkuil Date: Wed May 24 13:11:45 2023 +0100 media: usb: as102: drop as102_dev NULL check Fixes this smatch warning: drivers/media/usb/as102/as102_usb_drv.c:306 as102_usb_release() warn: can 'as102_dev' even be NULL? And indeed, as102_dev can never be NULL, so just drop the NULL check. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e0ac8656e75f1f26833c14313811043e36b0bba8 Author: Yang Li Date: Wed May 24 11:59:47 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn303/dcn303_resource.c:884:43: warning: unused variable 'res_create_maximus_funcs' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn303/dcn303_resource.c:84:38: warning: unused variable 'debug_defaults_diags' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 5d6cd20075c823565e7550f8de70d7615ec3c8b7 Author: Shiwu Zhang Date: Mon May 22 15:58:10 2023 +0800 drm/amdgpu: add the accelerator pcie class v2: add the base class id for accelerator (lijo) v3: add the new pci class in amdgpu tree (hawking) Signed-off-by: Shiwu Zhang Acked-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 23105541727cd6b702c9ee66d98ba50a129fbd5e Author: James Zhu Date: Tue Apr 25 16:55:56 2023 -0400 drm/amdgpu: save/restore part of xcp drm_device fields Redirect xcp allocated drm_device::rdev/pdev/driver with amdgpu pci_device/drm_device setting. They need be saved before redirect and restored after unregister xcp drm_device. -v2: fix warning discarded-qualifiers Signed-off-by: James Zhu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 20997c04b7168b1833da77f882eb5a6f246c4b96 Author: Shiwu Zhang Date: Mon May 22 17:11:59 2023 +0800 drm/amdgpu: set the APU flag based on package type Since currently APU and dGPU share the same pcie class while gmc init needs the flag to set up correctly for upcomming memory allocations v2: call get_pkg_type in smuio 13_0_3 is enough (hawking) Signed-off-by: Shiwu Zhang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 254f3337ce2575bf94f1fb40cc40fdbc70371116 Author: Hans Verkuil Date: Wed May 24 13:11:44 2023 +0100 media: rockchip: rga: fix clock cleanup Fix this smatch warning: drivers/media/platform/rockchip/rga/rga.c:734 rga_enable_clocks() warn: 'rga->sclk' from clk_prepare_enable() not released on lines: 734. The reason is that aclk should be disabled/unprepared before sclk, instead of the other way around. Signed-off-by: Hans Verkuil Cc: Jacob Chen Cc: Ezequiel Garcia Reviewed-by: Michael Tretter Signed-off-by: Mauro Carvalho Chehab commit 28bb7f13e70dcd3a6c736ee1567cf91c47af2600 Author: James Zhu Date: Wed May 24 10:48:40 2023 -0400 drm/jpeg: add init value for num_jpeg_rings Need init new num_jpeg_rings to 1 on jpeg. Signed-off-by: James Zhu Acked-by: Alex Deucher Reviewed-by: Richard Liang Tested-by: Ying Li Signed-off-by: Alex Deucher commit 491ae27829cda38df3ab6d2fe5d94a80ec1bbe22 Author: Shiwu Zhang Date: Wed May 17 13:40:04 2023 +0800 drm/amdgpu: complement the 4, 6 and 8 XCC cases Signed-off-by: Shiwu Zhang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 89f85765555caccec0a31b604639cea53942e522 Author: Shiwu Zhang Date: Tue May 16 10:31:49 2023 +0800 drm/amdgpu: golden settings for ASIC rev_id 0 Suggested by FW team that GB_ADDR_CONFIG is handled by golden settings in driver to get the expected value Signed-off-by: Shiwu Zhang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9535a86a4072babc37dc6bdadae52bdbb88166f5 Author: Shiwu Zhang Date: Wed May 17 14:15:05 2023 +0800 drm/amdgpu: bypass bios dependent operations Since bios reading does not work currently so just bypass all operations related to bios v2: hardcode the vram info for APP_APU case (hawking) v3: correct the vram_width with channel number * channel size (lijo) Signed-off-by: Shiwu Zhang Reviewed-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cfdce594171cea19ba033e8d7ff57a767c0ccd63 Author: Jiadong Zhu Date: Wed May 24 16:51:32 2023 +0800 drm/amdgpu: Program gds backup address as zero if no gds allocated It is firmware requirement to set gds_backup_addrlo and gds_backup_addrhi of DE meta both zero if no gds partition is allocated for the frame. Signed-off-by: Jiadong Zhu Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b7941e2fef13baabd3eade31601e70adf729e887 Author: Jiadong Zhu Date: Wed May 24 11:42:19 2023 +0800 drm/amdgpu: Reset CP_VMID_PREEMPT after trailing fence signaled When MEC executes unmap_queue for mid command buffer preemption, it will kick the write pointer of the gfx ring, set CP_VMID_PREEMPT to trigger the preemption and wait for CP_VMID_PREEMPT becomes zero after the preemption done. There is a race condition that PFP may excute the resetting command before MEC set CP_VMID_PREEMPT. As a result, hang happens as CP_VMID_PREEMPT is always 0xffff. To avoid this, we send resetting CP_VMID_PREEMPT command after the trailing fence is siganled and update gfx write pointer explicitly. Signed-off-by: Jiadong Zhu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 24bc366a4309f407ea77110ba15e3581005def6b Author: Yang Li Date: Wed May 24 11:59:45 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn301/dcn301_resource.c:1050:43: warning: unused variable 'res_create_maximus_funcs' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn301/dcn301_resource.c:705:38: warning: unused variable 'debug_defaults_diags' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 423502d4f622ad90414bd38d834763277fbab26c Author: Yang Li Date: Wed May 24 11:59:44 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource.c:1360:43: warning: unused variable 'res_create_maximus_funcs' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource.c:737:38: warning: unused variable 'debug_defaults_diags' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 8cce16826f5e154a3463b7eafa0f6beebeb48e49 Author: Srinivasan Shanmugam Date: Wed May 24 00:26:28 2023 +0530 drm/amdgpu: Fix unused variable in amdgpu_gfx.c drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c: In function ‘amdgpu_gfx_disable_kcq’: drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:497:6: warning: variable ‘j’ set but not used [-Wunused-but-set-variable] 497 | int j; | ^ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c: In function ‘amdgpu_gfx_disable_kgq’: drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:528:6: warning: variable ‘j’ set but not used [-Wunused-but-set-variable] 528 | int j; | ^ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c: In function ‘amdgpu_gfx_enable_kgq’: drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:630:12: warning: variable ‘j’ set but not used [-Wunused-but-set-variable] 630 | int r, i, j; | Cc: Alex Deucher Cc: Christian König Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a09e2065101a343ac3a709aa6236cdac874627eb Author: Srinivasan Shanmugam Date: Wed May 24 20:37:26 2023 +0530 drm/amdgpu: Fix defined but not used gfx9_cs_data in gfx_v9_4_3.c gcc with W=1 In file included from drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:33: drivers/gpu/drm/amd/amdgpu/clearstate_gfx9.h:939:36: warning: ‘gfx9_cs_data’ defined but not used [-Wunused-const-variable=] 939 | static const struct cs_section_def gfx9_cs_data[] = { | gfx9_cs_data is not used in gfx_v9_4_3.c, hence remove its include in gfx_v9_4_3.c Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 6c882a573bc1d6130274ef74d1697dd769f6a9e4 Author: Nathan Chancellor Date: Wed May 24 09:44:02 2023 -0700 drm/amdgpu: Fix return types of certain NBIOv7.9 callbacks When building with clang's -Wincompatible-function-pointer-types-strict, which ensures that function pointer signatures match exactly to avoid tripping clang's Control Flow Integrity (kCFI) checks at run time and will eventually be turned on for the kernel, the following instances appear in the NBIOv7.9 code: drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c:465:32: error: incompatible function pointer types initializing 'int (*)(struct amdgpu_device *)' with an expression of type 'enum amdgpu_gfx_partition (struct amdgpu_device *)' [-Werror,-Wincompatible-function-pointer-types-strict] .get_compute_partition_mode = nbio_v7_9_get_compute_partition_mode, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c:467:31: error: incompatible function pointer types initializing 'u32 (*)(struct amdgpu_device *, u32 *)' (aka 'unsigned int (*)(struct amdgpu_device *, unsigned int *)') with an expression of type 'enum amdgpu_memory_partition (struct amdgpu_device *, u32 *)' (aka 'enum amdgpu_memory_partition (struct amdgpu_device *, unsigned int *)') [-Werror,-Wincompatible-function-pointer-types-strict] .get_memory_partition_mode = nbio_v7_9_get_memory_partition_mode, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. Change the return types of these callbacks to match the prototypes to clear up the warning and avoid tripping kCFI at run time. Both functions return a value from ffs(), which is an integer that can fit into either int or unsigned int. Fixes: 98a54e88e87f ("drm/amdgpu: add sysfs node for compute partition mode") Fixes: ea2d2f8ececd ("drm/amdgpu: detect current GPU memory partition mode") Signed-off-by: Nathan Chancellor Signed-off-by: Alex Deucher commit 4ba439b0b38456c61505568a7fa4fa364850a236 Author: Yang Li Date: Wed May 24 11:59:43 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.c:1356:43: warning: unused variable 'res_create_maximus_funcs' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.c:894:38: warning: unused variable 'debug_defaults_diags' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 200c7c8132318378feffc1e4b0189482f4c7f1b6 Author: Mario Limonciello Date: Wed May 24 12:51:23 2023 -0500 drm/amd: Drop debugfs access to the DPCD There is already access to the DPCD from userspace through `CONFIG_DRM_DP_AUX_CHARDEV`, so it's unnecessary to reinvent the wheel with a set of extra debugfs nodes specific to amdgpu. The character device interface behaves more like you would expect in that you can seek/read/write all from the same file. Reviewed-by: Hamza Mahfooz Reviewed-by: Harry Wentland Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 95c2f89895930538879e1c3f1467a8095e03d1a5 Author: Yang Li Date: Wed May 24 11:59:42 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_resource.c:1079:43: warning: unused variable 'res_create_maximus_funcs' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_resource.c:731:38: warning: unused variable 'debug_defaults_diags' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 164f0791c5d10a2f0e947f6872a7c14ccd860085 Author: Yang Li Date: Wed May 24 11:59:41 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c:1222:43: warning: unused variable 'res_create_maximus_funcs' drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c:658:38: warning: unused variable 'debug_defaults_diags' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit bea35f7d4219999b5e4a9c8cdf6a17683b2ed1bd Author: Yang Li Date: Wed May 24 11:59:40 2023 +0800 drm/amd/display: remove unused definition Eliminate the following warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_resource.c:889:43: warning: unused variable 'res_create_maximus_funcs' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5296 Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Yang Li Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 3525844d483bfb2236c1dd00f7a490297721ef78 Author: Lijo Lazar Date: Thu Jul 28 11:42:44 2022 +0530 drm/amdgpu: Use single copy per SDMA instance type (v2) v1: Only single copy per instance type is required for PSP. All instance types use the same firmware copy. (Lijo) v2: Apply the change into amdgpu_sdma_init_microcode() due to rebase. (Morris) Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Shiwu Zhang Signed-off-by: Alex Deucher commit 93ab59ac6d8311244a76ddb31e7ced4cb1e8f22c Author: Guchun Chen Date: Fri May 12 16:14:25 2023 +0800 drm/amdgpu: switch to unified amdgpu_ring_test_helper This will simplify code. Signed-off-by: Guchun Chen Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 232f2431899cbe6c00c1350e35cfba91ea0c1c0b Author: Guchun Chen Date: Fri May 12 16:10:40 2023 +0800 drm/amdgpu/gfx: set sched.ready status after ring/IB test in gfx sched.ready is nothing with ring initialization, it needs to set to be true after ring/IB test in amdgpu_ring_test_helper to tell the ring is ready for submission. Signed-off-by: Guchun Chen Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 61c31b8b6c5e386a9c2ddc4e2cf9d8ae46c8a1f9 Author: Guchun Chen Date: Fri May 12 16:04:56 2023 +0800 drm/amdgpu/sdma: set sched.ready status after ring/IB test in sdma sched.ready is nothing with ring initialization, it needs to set to be true after ring/IB test in amdgpu_ring_test_helper to tell the ring is ready for submission. Signed-off-by: Guchun Chen Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit a569552f76889c8162b73add69afa161ff660ae4 Author: Guchun Chen Date: Wed May 24 15:03:02 2023 +0800 drm/amd/pm: resolve reboot exception for si oland During reboot test on arm64 platform, it may failure on boot. The error message are as follows: [ 1.706570][ 3] [ T273] [drm:si_thermal_enable_alert [amdgpu]] *ERROR* Could not enable thermal interrupts. [ 1.716547][ 3] [ T273] [drm:amdgpu_device_ip_late_init [amdgpu]] *ERROR* late_init of IP block failed -22 [ 1.727064][ 3] [ T273] amdgpu 0000:02:00.0: amdgpu_device_ip_late_init failed [ 1.734367][ 3] [ T273] amdgpu 0000:02:00.0: Fatal error during GPU init v2: squash in built warning fix (Alex) Signed-off-by: Zhenneng Li Reviewed-by: Guchun Chen Signed-off-by: Guchun Chen Signed-off-by: Alex Deucher commit c954cd7ad041251d903707c463a2c4d6cc30e5ae Author: Thierry Reding Date: Fri Jun 9 16:42:25 2023 +0200 soc/tegra: pmc: Use devm_clk_notifier_register() Move to the device-managed version of clk_notifier_register() to remove the need for manual cleanup. This fixes a potential issue where the clock notifier would stick around after the driver fails to probe at a later point. Reviewed-by: Jon Hunter Signed-off-by: Thierry Reding commit 194224a54c8bbc896b1fdb4a10ca5789ea4b9e7d Author: Lijo Lazar Date: Tue May 23 13:26:39 2023 +0530 drm/amdgpu: Fix warnings Fix warnings reported by kernel test bot/smatch smatch warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c:65 amdgpu_xcp_run_transition() error: buffer overflow 'xcp_mgr->xcp' 8 <= 8 Reported-by: kernel test robot Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/202305231453.I0bXngYn-lkp@intel.com/ Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bae9fb2d39b73822379b9bda02f3b9335fc77e13 Author: Thierry Reding Date: Fri Jun 9 16:42:24 2023 +0200 soc/tegra: pmc: Simplify debugfs initialization debugfs calls should generally not be error-checked to simplify the case where debugfs is disabled. Since this driver is built-in and has the sysfs bind/unbind attributes disabled, it cannot be unloaded, so there is no need to hold onto a reference to the debugfs files that are created. We can further simplify this by moving the debugfs file creation to a later stage to avoid any cleanup we might have to do during error unwind operations. This is also a little cleaner because the debugfs file relies on data structures that are created at a later point than when the file was previously created. Suggested-by: Jon Hunter Reviewed-by: Jon Hunter Signed-off-by: Thierry Reding commit d48a4f2c2809b882b58b428577707fe1b6f52673 Author: Tim Huang Date: Mon May 22 23:17:28 2023 +0800 drm/amd/pm: reverse mclk and fclk clocks levels for renoir This patch reverses the DPM clocks levels output of pp_dpm_mclk and pp_dpm_fclk for renoir. On dGPUs and older APUs we expose the levels from lowest clocks to highest clocks. But for some APUs, the clocks levels are given the reversed orders by PMFW. Like the memory DPM clocks that are exposed by pp_dpm_mclk. It's not intuitive that they are reversed on these APUs. All tools and software that talks to the driver then has to know different ways to interpret the data depending on the asic. So we need to reverse them to expose the clocks levels from the driver consistently. Signed-off-by: Tim Huang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 55a6dc60b47c817c644af2b505d46815d8b9219e Author: Mukul Joshi Date: Tue May 23 11:59:53 2023 -0400 drm/amdkfd: Set event interrupt class for GFX 9.4.3 Fix the warning during driver load because the event interrupt class is not set for GFX9.4.3. Signed-off-by: Mukul Joshi Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 360930985ec9f394c82ba0b235403b4a366d1560 Author: Michel Dänzer Date: Mon May 22 15:08:23 2023 +0200 Revert "drm/amd/display: Do not set drr on pipe commit" This reverts commit e101bf95ea87ccc03ac2f48dfc0757c6364ff3c7. Caused a regression: Samsung Odyssey Neo G9, running at 5120x1440@240/VRR, connected to Navi 21 via DisplayPort, blanks and the GPU hangs while starting the Steam game Assetto Corsa Competizione (via Proton 7.0). Example dmesg excerpt: amdgpu 0000:0c:00.0: [drm] ERROR [CRTC:82:crtc-0] flip_done timed out NMI watchdog: Watchdog detected hard LOCKUP on cpu 6 [...] RIP: 0010:amdgpu_device_rreg.part.0+0x2f/0xf0 [amdgpu] Code: 41 54 44 8d 24 b5 00 00 00 00 55 89 f5 53 48 89 fb 4c 3b a7 60 0b 00 00 73 6a 83 e2 02 74 29 4c 03 a3 68 0b 00 00 45 8b 24 24 <48> 8b 43 08 0f b7 70 3e 66 90 44 89 e0 5b 5d 41 5c 31 d2 31 c9 31 RSP: 0000:ffffb39a119dfb88 EFLAGS: 00000086 RAX: ffffffffc0eb96a0 RBX: ffff9e7963dc0000 RCX: 0000000000007fff RDX: 0000000000000000 RSI: 0000000000004ff6 RDI: ffff9e7963dc0000 RBP: 0000000000004ff6 R08: ffffb39a119dfc40 R09: 0000000000000010 R10: ffffb39a119dfc40 R11: ffffb39a119dfc44 R12: 00000000000e05ae R13: 0000000000000000 R14: ffff9e7963dc0010 R15: 0000000000000000 FS: 000000001012f6c0(0000) GS:ffff9e805eb80000(0000) knlGS:000000007fd40000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000461ca000 CR3: 00000002a8a20000 CR4: 0000000000350ee0 Call Trace: dm_read_reg_func+0x37/0xc0 [amdgpu] generic_reg_get2+0x22/0x60 [amdgpu] optc1_get_crtc_scanoutpos+0x6a/0xc0 [amdgpu] dc_stream_get_scanoutpos+0x74/0x90 [amdgpu] dm_crtc_get_scanoutpos+0x82/0xf0 [amdgpu] amdgpu_display_get_crtc_scanoutpos+0x91/0x190 [amdgpu] ? dm_read_reg_func+0x37/0xc0 [amdgpu] amdgpu_get_vblank_counter_kms+0xb4/0x1a0 [amdgpu] dm_pflip_high_irq+0x213/0x2f0 [amdgpu] amdgpu_dm_irq_handler+0x8a/0x200 [amdgpu] amdgpu_irq_dispatch+0xd4/0x220 [amdgpu] amdgpu_ih_process+0x7f/0x110 [amdgpu] amdgpu_irq_handler+0x1f/0x70 [amdgpu] __handle_irq_event_percpu+0x46/0x1b0 handle_irq_event+0x34/0x80 handle_edge_irq+0x9f/0x240 __common_interrupt+0x66/0x110 common_interrupt+0x5c/0xd0 asm_common_interrupt+0x22/0x40 Reviewed-by: Aurabindo Pillai Acked-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 413521a4c9f4bbb4637b9ff3427070325890b08f Author: Srinivasan Shanmugam Date: Wed May 24 01:17:48 2023 +0530 drm/amd/amdgpu: Fix warnings in amdgpu_irq.c checkpatch reports: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: braces {} are not necessary for any arm of this statement + if (nvec <= 0) { [...] + } else { [...] WARNING: Block comments use a trailing */ on a separate line Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 353491c48697df8a133bc468dc1b8ef65045254a Author: Michel Dänzer Date: Mon May 22 15:08:22 2023 +0200 Revert "drm/amd/display: Block optimize on consecutive FAMS enables" This reverts commit 751e17147953bc30036b8fe0eaaf780b6951404c. It depends on its parent commit, which we want to revert. Acked-by: Alex Deucher Signed-off-by: Michel Dänzer [Hamza: fix a whitespace issue in dcn30_prepare_bandwidth()] Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit c3aaca43fb07ce05f3a3bd85288eb3d500469be5 Author: Mukul Joshi Date: Wed May 17 15:53:50 2023 -0400 drm/amdgpu: Add a low priority scheduler for VRAM clearing Add a low priority DRM scheduler for VRAM clearing instead of using the exisiting high priority scheduler. Use the high priority scheduler for migrations and evictions. Signed-off-by: Mukul Joshi Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit 1fbc69b8f543864fa0a6c4b5d95fb5f9f5d23d33 Author: Jiapeng Chong Date: Tue May 23 11:32:02 2023 +0800 drm/amdgpu/vcn: Modify mismatched function name No functional modification involved. drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c:374: warning: expecting prototype for vcn_v4_0_mc_resume_dpg_mode(). Prototype was for vcn_v4_0_3_mc_resume_dpg_mode() instead. drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c:631: warning: expecting prototype for vcn_v4_0_enable_clock_gating(). Prototype was for vcn_v4_0_3_enable_clock_gating() instead. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=5284 Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit aaff9c089947cdb366ffddf4d4fb9747b6469d3e Author: Jiapeng Chong Date: Tue May 23 11:17:09 2023 +0800 drm/amdgpu: Modify mismatched function name No functional modification involved. drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:426: warning: expecting prototype for sdma_v4_4_2_gfx_stop(). Prototype was for sdma_v4_4_2_inst_gfx_stop() instead. drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:457: warning: expecting prototype for sdma_v4_4_2_rlc_stop(). Prototype was for sdma_v4_4_2_inst_rlc_stop() instead. drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:470: warning: expecting prototype for sdma_v4_4_2_page_stop(). Prototype was for sdma_v4_4_2_inst_page_stop() instead. drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:506: warning: expecting prototype for sdma_v4_4_2_ctx_switch_enable(). Prototype was for sdma_v4_4_2_inst_ctx_switch_enable() instead. drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:561: warning: expecting prototype for sdma_v4_4_2_enable(). Prototype was for sdma_v4_4_2_inst_enable() instead. drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:798: warning: expecting prototype for sdma_v4_4_2_rlc_resume(). Prototype was for sdma_v4_4_2_inst_rlc_resume() instead. drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:814: warning: expecting prototype for sdma_v4_4_2_load_microcode(). Prototype was for sdma_v4_4_2_inst_load_microcode() instead. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=5283 Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit e7665d0ca7938a8f921760a780bdc55c5eda6df0 Author: Jiapeng Chong Date: Tue May 23 10:18:11 2023 +0800 drm/amdgpu: Remove duplicate include ./drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c: amdgpu_xcp.h is included more than once. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=5281 Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 025723e059ab454823e6aa21277976178f23d120 Author: Tom Rix Date: Tue May 23 07:49:37 2023 -0400 drm/amd/display: remove unused variables res_create_maximus_funcs and debug_defaults_diags gcc with W=1 reports drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_resource.c:1069:43: error: ‘res_create_maximus_funcs’ defined but not used [-Werror=unused-const-variable=] 1069 | static const struct resource_create_funcs res_create_maximus_funcs = { | ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_resource.c:727:38: error: ‘debug_defaults_diags’ defined but not used [-Werror=unused-const-variable=] 727 | static const struct dc_debug_options debug_defaults_diags = { | ^~~~~~~~~~~~~~~~~~~~ These variables are not used so remove them. Fixes: 25879d7b4986 ("drm/amd/display: Clean FPGA code in dc") Signed-off-by: Tom Rix Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 9f173a80305d84f6b41bfb2a5482179e6e4957b1 Author: Arnd Bergmann Date: Tue May 23 10:34:30 2023 +0200 drm/amd/display: avoid calling missing .resync_fifo_dccg_dio() The .resync_fifo_dccg_dio() callback pointer was added in an #ifdef block, but is called unconditionally: drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:2292:31: error: 'struct hwseq_private_funcs' has no member named 'resync_fifo_dccg_dio' Add the same #ifdef around the caller as well. Fixes: 3e8d74cb128f ("drm/amd/display: Trigger DIO FIFO resync on commit streams") Signed-off-by: Arnd Bergmann Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit acf429dcac1440169a3b28da784cbda72f3b678b Author: Philip Yang Date: Thu May 18 15:08:16 2023 -0400 drm/amdkfd: Align partition memory size to page size The compute partition memory size calculated from KFD_XCP_MEMORY_SIZE may not align to page size if xcp_mgr->num_xcp_per_mem_partition is 6. Change the KFD_XCP_MEMORY_SIZE macro to return page align size, so KFD node memory size reported in sysfs is page align size, to avoid application VRAM allocation failure because application may use the size directly and Thunk requires the memory allocation size is page size align. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 63b9acdf06200bb6537a3a479741b4cb52488a89 Author: Tim Huang Date: Sun May 21 11:10:19 2023 +0800 drm/amd/pm: reverse mclk and fclk clocks levels for vangogh This patch reverses the DPM clocks levels output of pp_dpm_mclk and pp_dpm_fclk. On dGPUs and older APUs we expose the levels from lowest clocks to highest clocks. But for some APUs, the clocks levels that from the DFPstateTable are given the reversed orders by PMFW. Like the memory DPM clocks that are exposed by pp_dpm_mclk. It's not intuitive that they are reversed on these APUs. All tools and software that talks to the driver then has to know different ways to interpret the data depending on the asic. So we need to reverse them to expose the clocks levels from the driver consistently. Signed-off-by: Tim Huang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 06aade19bb2433001f4d10f1424a803b3f63734a Author: Tim Huang Date: Sun May 21 10:35:59 2023 +0800 drm/amd/pm: reverse mclk and fclk clocks levels for yellow carp This patch reverses the DPM clocks levels output of pp_dpm_mclk and pp_dpm_fclk. On dGPUs and older APUs we expose the levels from lowest clocks to highest clocks. But for some APUs, the clocks levels that from the DFPstateTable are given the reversed orders by PMFW. Like the memory DPM clocks that are exposed by pp_dpm_mclk. It's not intuitive that they are reversed on these APUs. All tools and software that talks to the driver then has to know different ways to interpret the data depending on the asic. So we need to reverse them to expose the clocks levels from the driver consistently. Signed-off-by: Tim Huang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit d9ed111b76e3ebe1d15b7db746d498666a396de1 Author: Tim Huang Date: Sun May 21 10:28:05 2023 +0800 drm/amd/pm: reverse mclk clocks levels for SMU v13.0.5 This patch reverses the DPM clocks levels output of pp_dpm_mclk. On dGPUs and older APUs we expose the levels from lowest clocks to highest clocks. But for some APUs, the clocks levels that from the DFPstateTable are given the reversed orders by PMFW. Like the memory DPM clocks that are exposed by pp_dpm_mclk. It's not intuitive that they are reversed on these APUs. All tools and software that talks to the driver then has to know different ways to interpret the data depending on the asic. So we need to reverse them to expose the clocks levels from the driver consistently. Signed-off-by: Tim Huang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 665d49c27eff01c91a155a37f025b981c2f73a3b Author: Tim Huang Date: Sun May 21 09:24:00 2023 +0800 drm/amd/pm: reverse mclk and fclk clocks levels for SMU v13.0.4 This patch reverses the DPM clocks levels output of pp_dpm_mclk and pp_dpm_fclk. On dGPUs and older APUs we expose the levels from lowest clocks to highest clocks. But for some APUs, the clocks levels that from the DFPstateTable are given the reversed orders by PMFW. Like the memory DPM clocks that are exposed by pp_dpm_mclk. It's not intuitive that they are reversed on these APUs. All tools and software that talks to the driver then has to know different ways to interpret the data depending on the asic. So we need to reverse them to expose the clocks levels from the driver consistently. Signed-off-by: Tim Huang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 803e4c9efc79c96796efbecab9ed53267d051256 Author: Tom Rix Date: Mon May 22 08:30:13 2023 -0400 drm/amdgpu: remove unused variable num_xcc gcc with W=1 reports drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:2138:13: error: variable ‘num_xcc’ set but not used [-Werror=unused-but-set-variable] 2138 | int num_xcc; | ^~~~~~~ This variable is not used so remove it. Signed-off-by: Tom Rix Signed-off-by: Alex Deucher commit 1501fe94eedd18243b84008aecc25f4f3c4fa48d Author: Arnd Bergmann Date: Mon May 22 13:50:32 2023 +0200 drm/amdgpu: fix acpi build warnings Two newly introduced functions are in the global namespace but have no prototypes or callers outside of amdgpu_acpi.c, another function is static but only has a caller inside of an #ifdef: drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:902:13: error: no previous prototype for 'amdgpu_acpi_get_node_id' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:928:30: error: no previous prototype for 'amdgpu_acpi_get_dev' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:860:33: error: 'amdgpu_acpi_get_numa_info' defined but not used [-Werror=unused-function] Avoid the warnings by marking all of them static and ensuring that the compiler is able to see the callsites. v2: rebase on latest code (Alex) Fixes: fa0497c34eb7 ("drm/amdgpu: Add API to get numa information of XCC") Fixes: 1cc823011a23 ("drm/amdgpu: Store additional numa node information") Signed-off-by: Arnd Bergmann Signed-off-by: Alex Deucher commit 1f9bb94f128f7d13a67fbff5eca730cc2e8842a6 Author: Arnd Bergmann Date: Mon May 22 13:50:31 2023 +0200 drm/amdgpu: use %pad format string for dma_addr_t DMA addresses can be shorter than u64, which results in a broken debug output: drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c: In function 'amdgpu_gart_table_ram_alloc': drivers/gpu/drm/amd/amdgpu/amdgpu.h:41:22: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=] drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c:146:9: note: in expansion of macro 'dev_info' 146 | dev_info(adev->dev, "%s dma_addr:%llx\n", __func__, dma_addr); Use the special %pad format string and pass the DMA address by reference. Fixes: c9a502e981a9 ("drm/amdgpu: Allocate GART table in RAM for AMD APU") Signed-off-by: Arnd Bergmann Signed-off-by: Alex Deucher commit 1b177b5c6846f20be013b45c36c24264049c81bf Author: Arnd Bergmann Date: Mon May 22 13:50:30 2023 +0200 drm/amdgpu:mark aqua_vanjaram_reg_init.c function as static A few newly added global functions have no prototype, which causes warnings: drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c:169:5: error: no previous prototype for 'aqua_vanjaram_select_scheds' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c:310:5: error: no previous prototype for '__aqua_vanjaram_get_xcc_per_xcp' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c:337:5: error: no previous prototype for '__aqua_vanjaram_get_xcp_ip_info' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c:593:5: error: no previous prototype for 'aqua_vanjaram_get_xcp_ip_details' [-Werror=missing-prototypes] There are no callers from other files, so just mark them as 'static'. Fixes: cd7d8400aa04 ("drm/amdgpu: add partition schedule for GC(9, 4, 3)") Fixes: 9cb18287d8f1 ("drm/amdgpu: Add SOC partition funcs for GC v9.4.3") Signed-off-by: Arnd Bergmann Signed-off-by: Alex Deucher commit f7c487366b3a82ced30923e591aaab0cdf1e4199 Author: Hans de Goede Date: Tue Jun 6 14:31:36 2023 +0100 media: atomisp: csi2-bridge: Add support for setting "clock-" and "link-frequencies" props Some standard v4l2 sensor drivers from drivers/media/i2c expect a "clock-frequency" property on the device indicating the frequency of the extclk for the sensor. Example of such drivers are the ov2680 and ov5693 drivers. The standard ov5693 sensor also expects a "link-frequencies" property. Add support for setting both properties. Note the "clock-frequency" prop is added before the "rotation" prop while the "link-frequencies" are added at the end to match the ipu3 cio2-bridge code from which this is derived. Link: https://lore.kernel.org/r/20230606133136.23619-1-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit d522458e63136ccccea18077687ceff1d31527ca Author: Arnd Bergmann Date: Mon May 22 13:50:29 2023 +0200 drm/amdkfd: mark local functions as static The file was newly added and causes some -Wmissing-prototype warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c:57:5: error: no previous prototype for 'kgd_gfx_v9_4_3_hqd_sdma_load' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c:126:5: error: no previous prototype for 'kgd_gfx_v9_4_3_hqd_sdma_dump' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c:163:6: error: no previous prototype for 'kgd_gfx_v9_4_3_hqd_sdma_is_occupied' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c:181:5: error: no previous prototype for 'kgd_gfx_v9_4_3_hqd_sdma_destroy' [-Werror=missing-prototypes] Mark these all as 'static' since there are no outside callers. Fixes: a805889a1531 ("drm/amdkfd: Update SDMA queue management for GFX9.4.3") Signed-off-by: Arnd Bergmann Signed-off-by: Alex Deucher commit 87f4c2d9205c6646b25081581e810a05cc9d2799 Author: Arnd Bergmann Date: Mon May 22 13:50:28 2023 +0200 drm/amd/pm: mark irq functions as 'static' Two newly added functions cause a warning because they lack a prototype: drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:1328:5: error: no previous prototype for 'smu_v13_0_6_set_irq_state' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:1368:5: error: no previous prototype for 'smu_v13_0_6_register_irq_handler' [-Werror=missing-prototypes] They are only used locally, so just mark them static. Fixes: 676915e4108f ("drm/amd/pm: Add ih for SMU v13.0.6 thermal throttling") Signed-off-by: Arnd Bergmann Signed-off-by: Alex Deucher commit 4f7d1334114f056b4b5bc102bd22d078a7154923 Author: Hans de Goede Date: Sun Jun 4 17:14:06 2023 +0100 media: atomisp: Add testing instructions to TODO file Testing the atomisp can be a bit tricky. The BYT/CHT CPUs are not very powerful so some apps like camorama cannot run at full FPS. Add instructions for how to test with gstreamer which does runs at full FPS without issues. Link: https://lore.kernel.org/r/20230604161406.69369-6-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit dbacd5c5e1ff4220c239f4522de3450996cea62f Author: Hans de Goede Date: Sun Jun 4 17:14:05 2023 +0100 media: atomisp: ov2680: Rename unknown/0x370a to sensor_ctrl_0a The data sheets say the registers at offset 0x3700 - 0x373f are "sensor control" registers rename the unknown variable in ov2680_set_mode() to sensor_ctrl_0a and add a OV2680_REG_SENSOR_CTRL_0A define. Link: https://lore.kernel.org/r/20230604161406.69369-5-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 6dabce860d40703d7c27b71a120317f09293cf9c Author: Harshit Mogalapalli Date: Mon May 22 00:30:15 2023 -0700 drm/amdgpu: Fix unsigned comparison with zero in gmc_v9_0_process_interrupt() Smatch warns: drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c:579: unsigned 'xcc_id' is never less than zero. gfx_v9_4_3_ih_to_xcc_inst() returns negative numbers as well. Fix this by changing type of xcc_id to int. Fixes: 98b2e9cad227 ("drm/amdgpu: correct the vmhub index when page fault occurs") Signed-off-by: Harshit Mogalapalli Signed-off-by: Alex Deucher commit 9f77af014cbc3b77a2f5b8cbce8262ff97e94aa7 Author: Colin Ian King Date: Mon May 22 10:02:52 2023 +0100 drm/amdgpu: Fix a couple of spelling mistakes in info and debug messages There are a couple of spelling mistakes, one in a dev_info message and the other in a dev_debug message. Fix them. Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit ab22ecabe99922db4bec8e2b439336f865bbc117 Author: Jonatas Esteves Date: Sat May 20 10:39:52 2023 -0300 drm/amd/pm: Fix output of pp_od_clk_voltage Printing the other clock types should not be conditioned on being able to print OD_SCLK. Some GPUs currently have limited capability of only printing a subset of these. Since this condition was introduced in v5.18-rc1, reading from `pp_od_clk_voltage` has been returning empty on the Asus ROG Strix G15 (2021). Fixes: 79c65f3fcbb1 ("drm/amd/pm: do not expose power implementation details to amdgpu_pm.c") Reviewed-by: Evan Quan Signed-off-by: Jonatas Esteves Signed-off-by: Alex Deucher commit a3ffabb25077059427434368a1c65c176a0f93d0 Author: Lijo Lazar Date: Wed Apr 19 16:02:44 2023 +0530 drm/amdgpu: Disable interrupt tracker on NBIOv7.9 Enabling nBIF interrupt history tracker prevents LCLK deep sleep, hence disable it Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit d4281b49c1b6afc66c470c85019fc1eceb676a78 Author: Evan Quan Date: Fri May 19 14:20:17 2023 +0800 drm/amd/pm: add missing NotifyPowerSource message mapping for SMU13.0.7 Otherwise, the power source switching will fail due to message unavailable. Fixes: bf4823267a81 ("drm/amd/pm: fix possible power mode mismatch between driver and PMFW") Signed-off-by: Evan Quan Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 1becc57cd1a905e2aa0e1eca60d2a37744525c4a Author: Nikita Zhandarovich Date: Fri May 19 08:33:27 2023 -0700 drm/radeon: fix possible division-by-zero errors Function rv740_get_decoded_reference_divider() may return 0 due to unpredictable reference divider value calculated in radeon_atom_get_clock_dividers(). This will lead to division-by-zero error once that value is used as a divider in calculating 'clk_s'. While unlikely, this issue should nonetheless be prevented so add a sanity check for such cases by testing 'decoded_ref' value against 0. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. v2: minor coding style fixes (Alex) In practice this should actually happen as the vbios should be properly populated. Fixes: 66229b200598 ("drm/radeon/kms: add dpm support for rv7xx (v4)") Signed-off-by: Nikita Zhandarovich Signed-off-by: Alex Deucher commit 61ae5ec4c8b8ffbe160ce1acaa860eb9599c46a7 Author: Hans de Goede Date: Sun Jun 4 17:14:04 2023 +0100 media: atomisp: ov2680: Remove unnecessary registers from ov2680_global_setting[] Many of the values in ov2680_global_setting[] match the default/reset register value for the ov2680 sensor (verified with both datasheet and actual hw) so they are no-ops. And there are also a couple of others which are later overwritten by ctrls or by ov2680_set_mode(). Remove all the unnecessary entries and add annotations to the remaining entries documenting what they change (in so far as things are documented in the datasheet). This also removes the double writing of OV2680_REG_SOFT_RESET in ov2680_init_registers() (one direct write, one in ov2680_global_setting[]) instead add a short sleep after the first write to give the sensor time to reset. Link: https://lore.kernel.org/r/20230604161406.69369-4-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit a64f7eb026ea7205bf9dfadabd746e47c5717b5d Author: Christoph Hellwig Date: Thu May 18 15:52:08 2023 +0200 drm/radeon: stop including swiotlb.h radeon does not need swiotlb.h, so stop including it. Signed-off-by: Christoph Hellwig Signed-off-by: Alex Deucher commit 89fb3020d68d46807e1341ad8acae53cdf197234 Author: Shiwu Zhang Date: Tue May 16 09:55:38 2023 +0800 drm/amdgpu: init the XCC_DOORBELL_FENCE regs add the the init_registers callback for nbio_v7_9 Signed-off-by: Shiwu Zhang Reviewed-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 332bb09352a69b8e7cf0825575f90581d3695135 Author: Tao Zhou Date: Fri May 19 11:34:04 2023 +0800 drm/amdgpu: remove unused definition mmhub_v1_8_mmea_cgtt_clk_cntl_reg is defined but not used. Reported-by: kernel test robot Signed-off-by: Tao Zhou Acked-by: Srinivasan Shanmugam Signed-off-by: Alex Deucher commit 1893549af62135c788a66e7ff27c81459c532fb2 Author: Srinivasan Shanmugam Date: Fri May 19 10:25:28 2023 +0530 drm/amdgpu: Fix uninitialized variable in gfxhub_v1_2_xcp_resume drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c:657:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (!amdgpu_sriov_vf(adev)) ^~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c:660:9: note: uninitialized use occurs here return ret; ^~~ drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c:657:2: note: remove the 'if' if its condition is always true if (!amdgpu_sriov_vf(adev)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c:648:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 1 error generated. Cc: Luben Tuikov Cc: Alex Deucher Cc: Christian König Cc: Lijo Lazar Cc: Hawking Zhang Signed-off-by: Srinivasan Shanmugam Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 40e39d72277fc014e7b8149def35831998c8df2f Author: Srinivasan Shanmugam Date: Fri May 19 17:48:12 2023 +0530 drm/amdgpu: Fix unused amdgpu_acpi_get_numa_info function in amdgpu_acpi_get_node_id() Fix the below compiler complaining error: drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:860:33: error: unused function 'amdgpu_acpi_get_numa_info' [-Werror,-Wunused-function] static struct amdgpu_numa_info *amdgpu_acpi_get_numa_info(uint32_t pxm) ^ 1 error generated. By guarding amdgpu_acpi_get_numa_info & amdgpu_acpi_get_numa_size function, only when CONFIG_ACPI_NUMA is enabled. Suggested-by: Lijo Lazar Cc: Christian König Cc: Lijo Lazar Cc: Luben Tuikov Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 0d1ff99a3398ad4b7165ecd8e69d360090b32250 Author: Aric Cyr Date: Mon May 15 00:14:00 2023 -0400 drm/amd/display: 3.2.237 This version brings along following fixes: - Improve the message printed - Disable dcn315 pixel rate crb when scaling - Update SR watermarks for DCN314 - Fix dcn315 pixel rate crb scaling check - Reset CRTC State Before Restore from S2idle - Have Payload Properly Created After Resume - Trigger DIO FIFO resync on commit streams - Revert vblank change that causes null pointer crash - Fix possible underflow for displays with large vblank - Apply 60us prefetch for DCFCLK <= 300Mhz - Update correct DCN314 register header Acked-by: Tom Chung Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 257e9891db0b961b79c9f0ca50c808a738000e70 Author: Josip Pavic Date: Fri May 12 09:56:05 2023 -0400 drm/amd/display: cache trace buffer size [Why & How] Cache the trace buffer size retrieved from DMUB FW in the driver Reviewed-by: Nicholas Kazlauskas Reviewed-by: Aric Cyr Acked-by: Tom Chung Signed-off-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5b466b28fa943aa9441cd27a9a469e1330814299 Author: Rodrigo Siqueira Date: Tue May 9 13:59:36 2023 -0600 drm/amd/display: Reorganize DCN30 Makefile DCN30 has a lot of files in the Makefile, and adding each one next to the other makes it hard to read and can increase the chance of merge conflicts. This commit just reorganize the Makefile to put each file associated with DCN30 in its own line. Reviewed-by: Chris Park Acked-by: Tom Chung Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2da3556c8650798606c0d3f2288b2f87c6665a69 Author: Saaem Rizvi Date: Thu May 11 15:16:35 2023 -0400 drm/amd/display: Trigger DIO FIFO resync on commit streams for DCN32 [WHY and HOW] Currently, on DCN32 we have an old workaround to resolve a DIO FIFO speed issue when writing to the OTG DIVIDER register. However, this workaround is not safe as we should be applying the DIO FIFO rampup logic when the OTG re disabled along with the encoders. This new workaround accounts for this. If the workaround sequence is incorrect, like it is was, there is a chance we might hang. this new workaround was first implemented in DCN314. Reviewed-by: Alvin Lee Acked-by: Tom Chung Signed-off-by: Saaem Rizvi Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 268182606f26434c5d3ebd0e86efcb0418dec487 Author: Cruise Hung Date: Fri May 12 23:33:46 2023 +0800 drm/amd/display: Update correct DCN314 register header [Why] The register header for DCN314 is not correct. [How] Update correct DCN314 register header. Reviewed-by: Nicholas Kazlauskas Acked-by: Tom Chung Signed-off-by: Cruise Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 25879d7b4986beba3f0d84762fe40d09fdc8b219 Author: Qingqing Zhuo Date: Thu Mar 16 09:05:58 2023 -0400 drm/amd/display: Clean FPGA code in dc [Why] Drop dead code for Linux. [How] Remove all IS_FPGA_MAXIMUS_DC and IS_DIAG_DC Reviewed-by: Ariel Bernstein Acked-by: Tom Chung Signed-off-by: Qingqing Zhuo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7e60ab4eb3e4ba2adac46d737fdbbc5732bebd58 Author: Alvin Lee Date: Thu May 11 15:25:01 2023 -0400 drm/amd/display: Apply 60us prefetch for DCFCLK <= 300Mhz [Description] - Previously we wanted to apply extra 60us of prefetch for min DCFCLK (200Mhz), but DCFCLK can be calculated to be 201Mhz which underflows also without the extra prefetch - Instead, apply the the extra 60us prefetch for any DCFCLK freq <= 300Mhz Reviewed-by: Nevenko Stupar Reviewed-by: Jun Lei Acked-by: Tom Chung Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit de231189e7bf1a38c0f889ec5f8911af473aa792 Author: Daniel Miess Date: Thu May 11 10:51:27 2023 -0400 drm/amd/display: Fix possible underflow for displays with large vblank [Why] Underflow observed when using a display with a large vblank region and low refresh rate [How] Simplify calculation of vblank_nom Increase value for VBlankNomDefaultUS to 800us Fixed a null pointer from previous commit of this change Reviewed-by: Nicholas Kazlauskas Acked-by: Tom Chung Signed-off-by: Daniel Miess Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7d45a432251a30ed0252655177e708229b163291 Author: Hans de Goede Date: Sun Jun 4 17:14:03 2023 +0100 media: atomisp: ov2680: Stop using half pixelclock for binned modes Stop using half pixelclock for binned modes this fixes: 1. The exposure being twice as high for binned mods (due to the half clk) 2. The framerate being 15 fps instead of 30 fps The original code with fixed per mode register lists did use half pixel clk, but this should be combined with using half for the VTS value too. Using half VTS fixes the framerate issue, but this has the undesired side-effect of change the exposure ctrl range (half the range, double the amount of exposure per step). Link: https://lore.kernel.org/r/20230604161406.69369-3-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit c02b04633c4f4654331c53966cb937df1c73a9bb Author: Daniel Miess Date: Thu May 11 09:12:09 2023 -0400 drm/amd/display: Revert vblank change that causes null pointer crash Revert commit 1a4bcdbea431 ("drm/amd/display: Fix possible underflow for displays with large vblank") Because it cause some regression Fixes: 1a4bcdbea431 ("drm/amd/display: Fix possible underflow for displays with large vblank") Reviewed-by: Nicholas Kazlauskas Acked-by: Tom Chung Signed-off-by: Daniel Miess Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3e8d74cb128fb1a4d56270ffbecea6056c55739a Author: Saaem Rizvi Date: Tue May 9 14:41:59 2023 -0400 drm/amd/display: Trigger DIO FIFO resync on commit streams [WHY] Currently, there is an intermittent issue where a screen can either go blank or be corrupted. [HOW] To resolve the issue we trigger the ramping logic for DIO FIFO so that it goes back up to the correct speed. Reviewed-by: Nicholas Kazlauskas Acked-by: Tom Chung Signed-off-by: Saaem Rizvi Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ef0feca22e866a8544847232fe32d5fdc11f0fbd Author: Hans de Goede Date: Sun Jun 4 17:14:02 2023 +0100 media: atomisp: Stop resetting selected input to 0 between /dev/video# opens No other V4L2 driver resets the selected input (front cam or back cam selected in case of the atomisp). Stop resetting selected input to 0 between /dev/video# opens. This allows e.g. using v4l2-ctl -i to switch the input before starting another app, which is useful since most apps don't support selecting the input. Note more in general the whole resetting of a bunch of internal state from the open fop needs to be removed there to allow multiple opens of /dev/video# for full v4l2 API compliance. Link: https://lore.kernel.org/r/20230604161406.69369-2-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 91b38ca1b331ef1af3b77e2ffdb41654e0fba127 Author: Fangzhi Zuo Date: Wed May 10 16:43:30 2023 -0400 drm/amd/display: Have Payload Properly Created After Resume At drm suspend sequence, MST dc_sink is removed. When commit cached MST stream back in drm resume sequence, the MST stream payload is not properly created and added into the payload table. After resume, topology change is reprobed by removing existing streams first. That leads to no payload is found in the existing payload table as below error "[drm] ERROR No payload for [MST PORT:] found in mst state" 1. In encoder .atomic_check routine, remove check existance of dc_sink 2. Bypass MST by checking existence of MST root port. dc_link_type cannot differentiate MST port before topology is rediscovered. Reviewed-by: Wayne Lin Acked-by: Tom Chung Signed-off-by: Fangzhi Zuo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0ab720d506252a28983baabafa2605eb6c94b1d7 Author: Dmytro Laktyushkin Date: Wed May 10 15:27:19 2023 -0400 drm/amd/display: fix dcn315 pixel rate crb scaling check fix dcn315 pixel rate crb scaling check error Reviewed-by: Charlene Liu Acked-by: Tom Chung Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 38ff516bb00cd8e974c8b5e70ab6e1b354b8f424 Author: Hersen Wu Date: Mon Apr 24 11:39:20 2023 -0400 drm/amd/display: lower dp link training message level [Why] some test apps report dp link training waring even dp training pass. there are 4 tries of lt within perform_link_training_with_retries. if lt pass within 4 tries, it will NOT be reated as lt failure. for each try of lt, if lt fails, current driver implementation prints message at warning level. this let people think dp lt does not work properly. [How] for 1st, 2nd and 3rd try of lt, print message at debug level. for the 4th try of lt, print message at warning level. Reviewed-by: Jerry Zuo Acked-by: Tom Chung Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit cd465a670087f94e62100622f9cbb894f524268a Author: Alan Liu Date: Tue May 2 17:54:50 2023 +0800 drm/amd/display: Fix warning in disabling vblank irq [Why] During gpu-reset, we toggle vblank irq by calling dc_interrupt_set() instead of amdgpu_irq_get/put() because we don't want to change the irq source's refcount. However, we see the warning when vblank irq is enabled by dc_interrupt_set() during gpu-reset but disabled by amdgpu_irq_put() after gpu-reset. [How] Only in dm_gpureset_toggle_interrupts() we toggle vblank interrupts by calling dc_interrupt_set(). Apart from this we call dm_set_vblank() which uses amdgpu_irq_get/put() to operate vblank irq. Reviewed-by: Bhawanpreet Lakha Acked-by: Tom Chung Signed-off-by: Alan Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6812d74803740100a0c422b9bc1fda947af4da6a Author: Nicholas Kazlauskas Date: Mon May 8 16:08:37 2023 -0400 drm/amd/display: Update SR watermarks for DCN314 [Why & How] Update parameters for SR watermarks for DCN314 Reviewed-by: Charlene Liu Acked-by: Tom Chung Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 75589226372ce5255ffade2ec6dea862338f7595 Author: Dmytro Laktyushkin Date: Tue May 9 09:38:29 2023 -0400 drm/amd/display: disable dcn315 pixel rate crb when scaling The rough calculation does not account for scaling. Also, make 2 segments the minimum allowed per surface to avoid potential 0 detile with mpc/odm combine on such outputs. Reviewed-by: Ariel Bernstein Acked-by: Tom Chung Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f36f2648f32c184ffc285a836b1ce3757e966925 Author: Cruise Hung Date: Tue May 9 21:36:35 2023 +0800 drm/amd/display: Fix DMUB debugging print issue [Why] The DMUB diagnostic data was not printed out correctly. [How] Print the DMUB diagnostic data line by line. Reviewed-by: Nicholas Kazlauskas Acked-by: Tom Chung Signed-off-by: Cruise Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 73ade646c545feda7c5df9b9c78c5d011ce76463 Author: Christoph Hellwig Date: Thu May 18 15:51:38 2023 +0200 drm/amdgpu: stop including swiotlb.h amdgpu does not need swiotlb.h, so stop including it. Signed-off-by: Christoph Hellwig Signed-off-by: Alex Deucher commit 4c44a51c78447ae97a6d7ef27ffdb790c3f61cca Author: Alex Deucher Date: Thu May 18 12:38:22 2023 -0400 drm/radeon: reintroduce radeon_dp_work_func content Put back the radeon_dp_work_func logic. It seems that handling DP RX interrupts is necessary to make some panels work. This was removed with the MST support, but it regresses some systems so add it back. While we are here, add the proper mutex locking. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2567 Fixes: 01ad1d9c2888 ("drm/radeon: Drop legacy MST support") Reviewed-by: Lyude Paul Signed-off-by: Alex Deucher Cc: Lyude Paul commit 930d333a00e1c7ac6caa83b70402367069f6c377 Author: Hans de Goede Date: Thu Jun 1 15:58:58 2023 +0100 media: atomisp: Fix binning check in atomisp_set_crop() The fmt / size passed to atomisp_set_crop() includes padding, so the binning check should be against 1/2 of the native rect. of the sensor, rather then 1/2 of the active rect. This fixes binning not being used when using e.g. 800x600 on a 1600x1200 sensor leading to a very small field of view. Link: https://lore.kernel.org/r/20230601145858.59652-4-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 2ad00e753ae13b0c523a579fb04372787f77cce9 Author: Srinivasan Shanmugam Date: Fri May 19 10:44:41 2023 +0530 drm/amdgpu: Fix uninitalized variable in kgd2kfd_device_init drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device.c:613:4: error: variable 'num_xcd' is uninitialized when used here [-Werror,-Wuninitialized] num_xcd, kfd->adev->gfx.num_xcc_per_xcp); ^~~~~~~ include/linux/dev_printk.h:144:65: note: expanded from macro 'dev_err' dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~ include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' _p_func(dev, fmt, ##__VA_ARGS__); \ ^~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device.c:597:13: note: initialize the variable 'num_xcd' to silence this warning int num_xcd, partition_mode; ^ = 0 1 error generated. Cc: Luben Tuikov Cc: Alex Deucher Cc: Christian König Cc: Felix Kuehling Cc: Mukul Joshi Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b3b0e016ec44d94db48a7d01b69570b5de37a31c Author: Srinivasan Shanmugam Date: Fri May 19 10:34:50 2023 +0530 drm/amdgpu: Fix uninitalized variable in jpeg_v4_0_3_is_idle & jpeg_v4_0_3_wait_for_idle drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c:752:4: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized] ret &= ((RREG32_SOC15_OFFSET( ^~~ drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c:745:10: note: initialize the variable 'ret' to silence this warning bool ret; ^ = 0 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c:774:4: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized] ret &= SOC15_WAIT_ON_RREG_OFFSET( ^~~ drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c:767:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 2 errors generated. Cc: Luben Tuikov Cc: Alex Deucher Cc: Christian König Cc: James Zhu Cc: Leo Liu Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ff6b11cc7263d4d6f17bc7b94e81ffcaae5fe107 Author: Srinivasan Shanmugam Date: Fri May 19 16:24:55 2023 +0530 drm/amd/amdgpu: Fix errors & warnings in mmhub_v1_8.c Fix below errors & warnings reported by checkpatch: ERROR: code indent should use tabs where possible WARNING: please, no space before tabs WARNING: please, no spaces at the start of a line WARNING: Prefer 'unsigned int' to bare use of 'unsigned' ERROR: space prohibited before that '++' (ctx:WxB) WARNING: Block comments use a trailing */ on a separate line Cc: Alex Deucher Cc: Christian König Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 20a29ac09192f9d9705015261652f277e8162f09 Author: Likun Gao Date: Fri May 19 18:54:18 2023 +0800 drm/amdgpu: retire set_vga_state for some ASIC set_vga_state operation only allowed on SI generation ASIC, retire the realted function on those ASIC which did not do anything. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9788d087caffd8358d6e14349ee69d9385666719 Author: Aurabindo Pillai Date: Fri May 5 13:16:32 2023 -0400 drm/amd/display: improve the message printed when loading DC [Why&How] Change how DC version and hardware version is printed when driver is loaded. - Remove exclamation - Add DC version and hardware version to both success and failure cases - Add version in between appropriate filler words to make a complete statement. Reviewed-by: Harry Wentland Acked-by: Tom Chung Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b336c681bdb5d1814acf8f19d1225a93f36ddfa2 Author: Likun Gao Date: Fri May 19 16:01:57 2023 +0800 drm/amdgpu: fix vga_set_state NULL pointer issue Fix NULL pointer issue for vga_set_state function as not all the ASIC need this operation. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d7b8e68dc04ad89809832bebe9ab5d7965a6eef5 Author: Srinivasan Shanmugam Date: Fri May 19 11:36:57 2023 +0530 drm/amdgpu: Fix uninitialized variable in gfx_v9_4_3_cp_resume drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:1925:6: error: variable 'r' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (amdgpu_xcp_query_partition_mode(adev->xcp_mgr, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:1931:6: note: uninitialized use occurs here if (r) ^ drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:1925:2: note: remove the 'if' if its condition is always true if (amdgpu_xcp_query_partition_mode(adev->xcp_mgr, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:1923:7: note: initialize the variable 'r' to silence this warning int r, i, num_xcc; ^ = 0 1 error generated. Suggested-by: Lijo Lazar Cc: Luben Tuikov Cc: Alex Deucher Cc: Christian König Signed-off-by: Srinivasan Shanmugam Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit a34b09060a3b95c0341b444ea49558a807988e34 Author: Horatio Zhang Date: Mon May 15 23:02:10 2023 -0400 drm/amdgpu: add RAS POISON interrupt funcs for jpeg_v4_0 Add ras_poison_irq and functions. And fix the amdgpu_irq_put call trace in jpeg_v4_0_hw_fini. [ 50.497562] RIP: 0010:amdgpu_irq_put+0xa4/0xc0 [amdgpu] [ 50.497619] RSP: 0018:ffffaa2400fcfcb0 EFLAGS: 00010246 [ 50.497620] RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000 [ 50.497621] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 50.497621] RBP: ffffaa2400fcfcd0 R08: 0000000000000000 R09: 0000000000000000 [ 50.497622] R10: 0000000000000000 R11: 0000000000000000 R12: ffff99b2105242d8 [ 50.497622] R13: 0000000000000000 R14: ffff99b210500000 R15: ffff99b210500000 [ 50.497623] FS: 0000000000000000(0000) GS:ffff99b518480000(0000) knlGS:0000000000000000 [ 50.497623] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 50.497624] CR2: 00007f9d32aa91e8 CR3: 00000001ba210000 CR4: 0000000000750ee0 [ 50.497624] PKRU: 55555554 [ 50.497625] Call Trace: [ 50.497625] [ 50.497627] jpeg_v4_0_hw_fini+0x43/0xc0 [amdgpu] [ 50.497693] jpeg_v4_0_suspend+0x13/0x30 [amdgpu] [ 50.497751] amdgpu_device_ip_suspend_phase2+0x240/0x470 [amdgpu] [ 50.497802] amdgpu_device_ip_suspend+0x41/0x80 [amdgpu] [ 50.497854] amdgpu_device_pre_asic_reset+0xd9/0x4a0 [amdgpu] [ 50.497905] amdgpu_device_gpu_recover.cold+0x548/0xcf1 [amdgpu] [ 50.498005] amdgpu_debugfs_reset_work+0x4c/0x80 [amdgpu] [ 50.498060] process_one_work+0x21f/0x400 [ 50.498063] worker_thread+0x200/0x3f0 [ 50.498064] ? process_one_work+0x400/0x400 [ 50.498065] kthread+0xee/0x120 [ 50.498067] ? kthread_complete_and_exit+0x20/0x20 [ 50.498068] ret_from_fork+0x22/0x30 Suggested-by: Hawking Zhang Signed-off-by: Horatio Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 674f90f83bc941d0cd5a85a714c5bfeb8789163a Author: Horatio Zhang Date: Mon May 15 22:59:54 2023 -0400 drm/amdgpu: add RAS POISON interrupt funcs for jpeg_v2_6 Add ras_poison_irq and functions. Suggested-by: Hawking Zhang Signed-off-by: Horatio Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 18dad20c3dcbd7789f3d07056cd78394c8278a75 Author: Horatio Zhang Date: Mon May 15 22:57:19 2023 -0400 drm/amdgpu: separate ras irq from jpeg instance irq for UVD_POISON Separate jpegbRAS poison consumption handling from the instance irq, and register dedicated ras_poison_irq src and funcs for UVD_POISON. v2: - Separate ras irq from jpeg instance irq - Improve the subject and code comments v3: - Split the patch into three parts - Improve the code comments Suggested-by: Hawking Zhang Signed-off-by: Horatio Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 66a11ecbdebbc8ab29a4076df0b95f0bfd61b1c5 Author: Horatio Zhang Date: Mon May 15 22:09:43 2023 -0400 drm/amdgpu: add RAS POISON interrupt funcs for vcn_v4_0 Add ras_poison_irq and functions. And fix the amdgpu_irq_put call trace in vcn_v4_0_hw_fini. [ 44.563572] RIP: 0010:amdgpu_irq_put+0xa4/0xc0 [amdgpu] [ 44.563629] RSP: 0018:ffffb36740edfc90 EFLAGS: 00010246 [ 44.563630] RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000 [ 44.563630] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 44.563631] RBP: ffffb36740edfcb0 R08: 0000000000000000 R09: 0000000000000000 [ 44.563631] R10: 0000000000000000 R11: 0000000000000000 R12: ffff954c568e2ea8 [ 44.563631] R13: 0000000000000000 R14: ffff954c568c0000 R15: ffff954c568e2ea8 [ 44.563632] FS: 0000000000000000(0000) GS:ffff954f584c0000(0000) knlGS:0000000000000000 [ 44.563632] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 44.563633] CR2: 00007f028741ba70 CR3: 000000026ca10000 CR4: 0000000000750ee0 [ 44.563633] PKRU: 55555554 [ 44.563633] Call Trace: [ 44.563634] [ 44.563634] vcn_v4_0_hw_fini+0x62/0x160 [amdgpu] [ 44.563700] vcn_v4_0_suspend+0x13/0x30 [amdgpu] [ 44.563755] amdgpu_device_ip_suspend_phase2+0x240/0x470 [amdgpu] [ 44.563806] amdgpu_device_ip_suspend+0x41/0x80 [amdgpu] [ 44.563858] amdgpu_device_pre_asic_reset+0xd9/0x4a0 [amdgpu] [ 44.563909] amdgpu_device_gpu_recover.cold+0x548/0xcf1 [amdgpu] [ 44.564006] amdgpu_debugfs_reset_work+0x4c/0x80 [amdgpu] [ 44.564061] process_one_work+0x21f/0x400 [ 44.564062] worker_thread+0x200/0x3f0 [ 44.564063] ? process_one_work+0x400/0x400 [ 44.564064] kthread+0xee/0x120 [ 44.564065] ? kthread_complete_and_exit+0x20/0x20 [ 44.564066] ret_from_fork+0x22/0x30 Suggested-by: Hawking Zhang Signed-off-by: Horatio Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 46d75d23005f87057881c460a94f9357d079087f Author: Horatio Zhang Date: Mon May 15 21:52:00 2023 -0400 drm/amdgpu: add RAS POISON interrupt funcs for vcn_v2_6 Add ras_poison_irq and functions. Suggested-by: Hawking Zhang Signed-off-by: Horatio Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 0f417dc1b7330aae06f155ea505899fa74b2eabe Author: Hans de Goede Date: Thu Jun 1 15:58:57 2023 +0100 media: atomisp: Make atomisp_enum_framesizes_crop() check resolution fits with padding Now that atomisp_get_padding() takes minimum padding requirements on BYT/ISP2400 into account, it is possible for a resolution which fits in the active area of the sensor to not fit in the native area once padding is added. For example on the ov2680 which has a native resolution of 1616x1216 the max active resolution of 1600x1200 leaves 16x16 for padding which meets the worst-case minimum padding requirement of 14x14 on BYT. But after binning we are left with an native area of 808x608 and an active area of 800x600. This leaves 8x8 for padding which is not enough. So on BYT 800x600 is not a valid resolution (it could be made by lots of cropping without binning but then the remaining field of view is no good). Modify atomisp_enum_framesizes_crop() to check the resolution + padding fits in the native rectangle, removing 800x600 from the list of valid modes on BYT. Link: https://lore.kernel.org/r/20230601145858.59652-3-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 2ecf927b1730a4addba7ef775f433046fbcc423b Author: Horatio Zhang Date: Mon May 15 21:45:51 2023 -0400 drm/amdgpu: separate ras irq from vcn instance irq for UVD_POISON Separate vcn RAS poison consumption handling from the instance irq, and register dedicated ras_poison_irq src and funcs for UVD_POISON. v2: - Separate ras irq from vcn instance irq - Improve the subject and code comments v3: - Split the patch into three parts - Improve the code comments Suggested-by: Hawking Zhang Signed-off-by: Horatio Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit c77b3608b8ec79a33ac36a9d281e0395a3343d6e Author: YuanShang Date: Mon May 8 12:12:28 2023 +0800 drm/amdgpu: Remove IMU ucode in vf2pf The IMU firmware is loaded on the host side, not the guest. Remove IMU in vf2pf ucode id enum. Signed-off-by: YuanShang Reviewed-By: Horace Chen Signed-off-by: Alex Deucher commit e825fb641b4c78a8dab5101559dd27e64d2f24aa Author: Shiwu Zhang Date: Wed May 17 13:21:15 2023 +0800 drm/amdgpu: fix the memory override in kiq ring struct This is introduced by the code merge and will let the adev->gfx.kiq[0].ring struct being overrided Signed-off-by: Shiwu Zhang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c796d7e039b57f9407523b8c4a3ba5358dd2d8ff Author: Shiwu Zhang Date: Wed May 17 13:49:08 2023 +0800 drm/amdgpu: add the smu_v13_0_6 and gfx_v9_4_3 ip block Signed-off-by: Shiwu Zhang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b3122c92697a870d75a516537f094f589dfe7ca1 Author: Jesse Zhang Date: Thu May 18 09:46:22 2023 +0800 drm/amdgpu: don't enable secure display on incompatible platforms [why] [drm] psp gfx command LOAD_TA(0x1) failed and response status is (0x7) [drm] psp gfx command INVOKE_CMD(0x3) failed and response status is (0x4) amdgpu 0000:04:00.0: amdgpu: Secure display: Generic Failure. [how] don't enable secure display on incompatible platforms Suggested-by: Aaron Liu Signed-off-by: Jesse zhang Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit 6091ede913015fd3c07cb16298505bbd71f41689 Author: Su Hui Date: Wed May 17 10:52:19 2023 +0800 drm/radeon: Remove unnecessary (void*) conversions No need cast (void*) to (struct radeon_device *) or (struct radeon_ring *). Signed-off-by: Su Hui Signed-off-by: Alex Deucher commit 1385d88c6aa774332f1a88562b6f1bf04de6d710 Author: Sukrut Bellary Date: Wed May 3 16:15:07 2023 -0700 drm:amd:amdgpu: Fix missing buffer object unlock in failure path smatch warning - 1) drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:3615 gfx_v9_0_kiq_resume() warn: inconsistent returns 'ring->mqd_obj->tbo.base.resv'. 2) drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:6901 gfx_v10_0_kiq_resume() warn: inconsistent returns 'ring->mqd_obj->tbo.base.resv'. Signed-off-by: Sukrut Bellary Signed-off-by: Alex Deucher commit b18f05a0666aecd5cb19c26a8305bcfa4e9d6502 Author: Aurabindo Pillai Date: Wed May 17 14:39:46 2023 -0400 drm/amd/display: Fix artifacting on eDP panels when engaging freesync video mode [Why] When freesync video mode is enabled, switching resolution from native mode to one of the freesync video compatible modes can trigger continous artifacts on some eDP panels when running under KDE. The articating can be seen in the attached bug report. [How] Fix this by restricting updates that require full commit by using the same checks for stream and scaling changes in the the enable pass of dm_update_crtc_state() along with the check for compatible timings for freesync vide mode. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2162 Fixes: da5e14909776 ("drm/amd/display: Fix hang when skipping modeset") Signed-off-by: Aurabindo Pillai Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 21d4631eedb136f101d2633b72cf42c20db79202 Author: Jason-JH.Lin Date: Mon Mar 6 16:06:59 2023 +0800 soc: mediatek: remove DDP_DOMPONENT_DITHER from enum After mmsys and drm change DITHER enum to DDP_COMPONENT_DITHER0, mmsys header can remove the useless DDP_COMPONENT_DITHER enum. Signed-off-by: Jason-JH.Lin Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Rex-BC Chen Acked-by: Matthias Brugger Link: https://lore.kernel.org/r/20230306080659.15261-3-jason-jh.lin@mediatek.com Signed-off-by: Matthias Brugger commit a2b308044dcaca8d3e580959a4f867a1d5c37fac Author: Bas Nieuwenhuizen Date: Sat May 13 14:51:00 2023 +0200 drm/amdgpu: Validate VM ioctl flags. None have been defined yet, so reject anybody setting any. Mesa sets it to 0 anyway. Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 72f0ba79a063ec2b21d5874e41c6d82193100515 Author: Hans de Goede Date: Thu Jun 1 15:58:56 2023 +0100 media: atomisp: Take minimum padding requirement on BYT/ISP2400 into account The main binary for the pipeline on BYT/ISP2400 has its ia_css_binary_info.pipeline.left_cropping and .top_cropping fields set to 12. So a minimum padding of 12 is required. And for certain bayer-orders additional width / height padding is necessary so that the ISP crop rectangle for the raw sensor data can be used to change the bayer-order to the fixed bayer-order supported by the debayer block. Without the minmum required padding ia_css_ifmtr_configure() will fail inside ifmtr_input_start_line() and/or ifmtr_start_column() because it cannot set the ISP crop rectangle for the raw sensor data. Fix this by making atomisp_get_padding() take the minimum padding requirements into account on BYT/ISP2400 (CHT/ISP2401 does not seem to need this). Link: https://lore.kernel.org/r/20230601145858.59652-2-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit e5edd9ab0e291912cf68abf5dc84d393d29a60a7 Author: Mario Limonciello Date: Thu May 18 09:40:09 2023 -0500 drm/amd: Update driver-misc.html for Rembrandt-R AMD has added marketing information publicly for Rembrandt-R, so update the APU table with matching versions. Link: https://www.amd.com/en/product/13086 Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 109b4d8cfe4279da1cbcbcd99ae54cb2b2aee521 Author: Su Hui Date: Mon May 15 09:34:28 2023 +0800 drm/amdgpu: remove unnecessary (void*) conversions No need cast (void*) to (struct amdgpu_device *). Signed-off-by: Su Hui Signed-off-by: Alex Deucher commit c0dba2d34ac153414c4c09e073f5582eeb67a252 Author: Mario Limonciello Date: Thu May 18 09:35:17 2023 -0500 drm/amd: Update driver-misc.html for Dragon Range AMD has added marketing information publicly for Dragon Range, so update the APU table with matching versions. Link: https://www.amd.com/en/product/13016 Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ea2a50ae3d4c9857c8967df44b0b2b42eee7d7c9 Author: Mario Limonciello Date: Thu May 18 09:30:26 2023 -0500 drm/amd: Update driver-misc.html for Phoenix AMD has added marketing information publicly for Phoenix, so update the APU table with matching versions. Link: https://www.amd.com/en/product/13036 Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 04e8595819480bec2754bd2cc4377270e7e6c799 Author: Tong Liu01 Date: Tue May 16 14:50:04 2023 +0800 drm/amdgpu: fix incorrect pcie_gen_mask in passthrough case [why] Passthrough case is treated as root bus and pcie_gen_mask is set as default value that does not support GEN 3 and GEN 4 for PCIe link speed. So PCIe link speed will be downgraded at smu hw init in passthrough condition [how] Move get pci info after detect virtualization and check if it is passthrough case when set pcie_gen_mask Signed-off-by: Tong Liu01 Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 0af9078315c1a737675f041996c02582610b7cfd Author: Hans de Goede Date: Mon May 29 11:37:41 2023 +0100 media: atomisp: csi2-bridge: Set PMC clk-rate for sensors to 19.2 MHz The ACPI code takes care of enabling/disabling the PMC clk(s) for the sensors as necessary based on the runtime-pm state of the sensor. But the GMIN code this replaces also set the clk-rate of the PMC clk to 19.2 MHz. At least on BYT devices the PMC clks may come up running at 25 MHz instead of the expected 19.2 MHz. Ensure the sensor clk also runs at the expected 19.2 MHz for sensors using v4l2-async probing by explicitly setting it to 19.2 MHz when enumerating sensors in atomisp_csi2_bridge.c. Link: https://lore.kernel.org/r/20230529103741.11904-22-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit e980fb04e779730b799a4ba712db901a7b08e8f9 Author: Hans de Goede Date: Mon May 29 11:37:40 2023 +0100 media: atomisp: Add enum_framesizes function for sensors with selection / crop support Some sensor drivers with crop support (e.g. the ov5693 driver) only return the current crop rectangle + 1/2 (binning) of the current crop rectangle when calling their enum_frame_sizes op. This causes 2 issues: 1. Atomisp sets to the crop area to include the padding, where as the enum_framesizes ioctl should return values without padding. 2. With cropping a lot more standard resolutions are possible then just these 2 and many apps limit the list given to the end user to the list returned by enum_framesizes. Add an alternative enum_framesizes function for sensors which support cropping to fix both issues. Link: https://lore.kernel.org/r/20230529103741.11904-21-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 8789989b476b5f3bb0bf1a63b5223f6e76cfd13d Author: Hamza Mahfooz Date: Wed May 17 14:09:39 2023 -0400 drm/amd/display: drop unused count variable in create_eml_sink() Since, we are only interested in having drm_edid_override_connector_update(), update the value of connector->edid_blob_ptr. We don't care about the return value of drm_edid_override_connector_update() here. So, drop count. Fixes: 550e5d23f147 ("drm/amd/display: assign edid_blob_ptr with edid from debugfs") Reported-by: kernel test robot Reviewed-by: Rodrigo Siqueira Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit fd73c8507675f6bccc039cf319f183e41e447cb7 Author: Hamza Mahfooz Date: Wed May 17 13:49:29 2023 -0400 drm/amd/display: drop unused function set_abm_event() set_abm_event() is never actually used. So, drop it. Fixes: b8fe56375f78 ("drm/amd/display: Refactor ABM feature") Reported-by: kernel test robot Reported-by: Tom Rix Reviewed-by: Rodrigo Siqueira Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 48dd83c0fb6c68742f7fefca907036942dd358be Author: Hamza Mahfooz Date: Wed May 17 13:31:45 2023 -0400 drm/amd/display: drop redundant memset() in get_available_dsc_slices() get_available_dsc_slices() returns the number of indices set, and all of the users of get_available_dsc_slices() don't cross the returned bound when iterating over available_slices[]. So, the memset() in get_available_dsc_slices() is redundant and can be dropped. Fixes: 97bda0322b8a ("drm/amd/display: Add DSC support for Navi (v2)") Reported-by: Christophe JAILLET Reviewed-by: Rodrigo Siqueira Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit e602157ec089240861cd641ee2c7c64eeaec09bf Author: Jack Xiao Date: Wed May 17 17:07:01 2023 +0800 drm/amdgpu: fix S3 issue if MQD in VRAM 1. Need flush HDP for MQD putting in vram 2. Zero out mes MQD Signed-off-by: Jack Xiao Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit e03f04b84901644c81b4348a813a8d17facbd277 Author: Srinivasan Shanmugam Date: Thu May 18 07:52:06 2023 +0530 drm/amdgpu: Fix warnings in amdgpu _sdma, _ucode.c Fix below checkpatch warnings: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: Comparisons should place the constant on the right side of the test WARNING: Missing a blank line after declarations Cc: Luben Tuikov Cc: Alex Deucher Cc: Christian König Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit f10984a353c87e696872de8f9614a58689deb0d0 Author: Srinivasan Shanmugam Date: Wed May 17 21:24:43 2023 +0530 drm/amd/amdgpu: Fix errors & warnings in amdgpu _uvd, _vce.c Fix below checkpatch errors & warnings: In amdgpu_uvd.c: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: Prefer 'unsigned int *' to bare use of 'unsigned *' WARNING: Missing a blank line after declarations WARNING: %Lx is non-standard C, use %llx ERROR: space required before the open parenthesis '(' ERROR: space required before the open brace '{' WARNING: %LX is non-standard C, use %llX WARNING: Block comments use * on subsequent lines +/* multiple fence commands without any stream commands in between can + crash the vcpu so just try to emmit a dummy create/destroy msg to WARNING: Block comments use a trailing */ on a separate line + avoid this */ WARNING: braces {} are not necessary for single statement blocks + for (j = 0; j < adev->uvd.num_enc_rings; ++j) { + fences += amdgpu_fence_count_emitted(&adev->uvd.inst[i].ring_enc[j]); + } In amdgpu_vce.c: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: Missing a blank line after declarations WARNING: %Lx is non-standard C, use %llx WARNING: Possible repeated word: 'we' ERROR: space required before the open parenthesis '(' Cc: Alex Deucher Cc: Christian König Signed-off-by: Srinivasan Shanmugam Acked-by: Luben Tuikov Signed-off-by: Alex Deucher commit 6c47a79b3b8ba91faf89f9866da2ec16aac979e7 Author: YiPeng Chai Date: Tue May 16 17:34:17 2023 +0800 drm/amdgpu: perform mode2 reset for sdma fed error on gfx v11_0_3 perform mode2 reset for sdma fed error on gfx v11_0_3. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5d0622705ff76e017b32cb763cbc7b00694f3b92 Author: Srinivasan Shanmugam Date: Wed May 17 20:31:02 2023 +0530 drm/amd/amdgpu: Fix errors & warnings in amdgpu_vcn.c Fix below checkpatch insisted error & warnings: ERROR: space required before the open brace '{' WARNING: braces {} are not necessary for any arm of this statement + if ((type == VCN_ENCODE_RING) && (vcn_config & VCN_BLOCK_ENCODE_DISABLE_MASK)) { [...] + } else if ((type == VCN_DECODE_RING) && (vcn_config & VCN_BLOCK_DECODE_DISABLE_MASK)) { [...] + } else if ((type == VCN_UNIFIED_RING) && (vcn_config & VCN_BLOCK_QUEUE_DISABLE_MASK)) { [...] ERROR: code indent should use tabs where possible WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: braces {} are not necessary for single statement blocks + for (i = 0; i < adev->vcn.num_enc_rings; ++i) { + fence[j] += amdgpu_fence_count_emitted(&adev->vcn.inst[j].ring_enc[i]); + ERROR: space required before the open parenthesis '(' WARNING: Missing a blank line after declarations WARNING: please, no spaces at the start of a line WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. Cc: Alex Deucher Cc: Christian König Signed-off-by: Srinivasan Shanmugam Acked-by: Luben Tuikov Signed-off-by: Alex Deucher commit 1e28b9e048b5edd29c7bf9c8ce6d9d5dcda6f36b Author: Hans de Goede Date: Mon May 29 11:37:39 2023 +0100 media: atomisp: Set crop before setting fmt Some drivers which implement selections/crop only allow setting the format with and height to either the crop rectangle width and height or to half the crop rectangle width and height (binning). An example of such a driver is the standard v4l2 ov5693 driver. First set the crop rectangle to match the requested format when trying or setting the sensor format, to match these drivers expectations. Link: https://lore.kernel.org/r/20230529103741.11904-20-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 29f187f71e7fd4e4516f235c400e457c50e2ab70 Author: Srinivasan Shanmugam Date: Wed May 17 18:38:00 2023 +0530 drm/amd/amdgpu: Fix warnings in amdgpu_encoders.c Fix below checkpatch warnings: WARNING: Missing a blank line after declarations + struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); + amdgpu_encoder->active_device = amdgpu_encoder->devices & amdgpu_connector->devices; WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Cc: Alex Deucher Cc: Christian König Signed-off-by: Srinivasan Shanmugam Acked-by: Luben Tuikov Signed-off-by: Alex Deucher commit f2cd6b26922e68ffafd14a9128e20630296e430d Author: Alex Deucher Date: Wed May 17 15:04:35 2023 -0400 drm/amdkfd: fix stack size in svm_range_validate_and_map Allocate large local variable on heap to avoid exceeding the stack size: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c: In function ‘svm_range_validate_and_map’: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:1690:1: warning: the frame size of 2360 bytes is larger than 2048 bytes [-Wframe-larger-than=] Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 01c3f464743b64e6e65cb9bad951458986819a42 Author: Srinivasan Shanmugam Date: Wed May 17 20:10:48 2023 +0530 drm/amd/amdgpu: Fix errors & warnings in amdgpu_ttm.c Fix below checkpatch insisted error & warnings: ERROR: Macros with complex values should be enclosed in parentheses WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: braces {} are not necessary for single statement blocks WARNING: Block comments use a trailing */ on a separate line WARNING: Missing a blank line after declarations Cc: Alex Deucher Cc: Christian König Signed-off-by: Srinivasan Shanmugam Acked-by: Luben Tuikov Signed-off-by: Alex Deucher commit 0ce50b2efe08e56224d11d735310b353e0e4e222 Author: Alex Deucher Date: Tue May 16 16:56:49 2023 -0400 drm/amdgpu/vcn4: fix endian conversion sq.is_enabled is a byte so there is no need to endian swap it. Acked-by: Guchun Chen Signed-off-by: Alex Deucher commit 45b3a914d40e63d2c9e3a3e02fb2014be975b9b0 Author: Alex Deucher Date: Tue May 16 17:16:30 2023 -0400 drm/amdgpu/gmc9: fix 64 bit division in partition code Rework logic or use do_div() to avoid problems on 32 bit. v2: add a missing case for XCP macro v3: fix out of bounds array access v4: fix xcp handling harder Acked-by: Guchun Chen (v1) Reviewed-by: Mukul Joshi (v3) Signed-off-by: Alex Deucher commit 92ecb92ccc839c4c4b51ab1025cde5dd82c2fb4b Author: Tao Zhou Date: Wed Feb 8 17:05:08 2023 +0800 drm/amdgpu: initialize RAS for gfx_v9_4_3 Register GFX RAS functions and initialize GFX RAS. v2: remove xcp operations. v3: reuse the return value of gfx_ras_sw_init. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0386d52d1516d80b81a25552df74b8a82dfb77f3 Author: Tao Zhou Date: Fri Feb 10 18:41:28 2023 +0800 drm/amdgpu: add sq timeout status functions for gfx_v9_4_3 Query and reset sq timeout status. v2: change instance from 0 to xcc_id for register access. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 30feef0676092bdb4b8697e68b8d5864d54f096f Author: Tao Zhou Date: Wed Feb 8 14:54:01 2023 +0800 drm/amdgpu: add RAS error count reset for gfx_v9_4_3 Add GFX RAS error count reset function. v2: remove xcp operation. only select_se_sh when instance number is more than 1. v3: add check for se_num before select_se_sh. change instance from 0 to xcc_id for register access. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bfa84da6185cb1897fcee0ac3815625d162d39f0 Author: Tao Zhou Date: Fri Mar 17 17:13:46 2023 +0800 drm/amdgpu: add RAS error count query for gfx_v9_4_3 Query GFX RAS ce/ue count. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5c1c09a71634423604c47502d8059a5c098c6f40 Author: Tao Zhou Date: Mon Feb 6 11:38:19 2023 +0800 drm/amdgpu: add RAS error count definitions for gfx_v9_4_3 Prepare for the query of GFX RAS ce/ue count. v2: remove xcp operation. only select_se_sh when instance number is more than 1. v3: add more CE/UE registsers to query list. add check for se_num before select_se_sh. change instance from 0 to xcc_id for register access. v4: move gfx memory id definitions to gfx_v9_4_3. v5: create a dedicated patch for adding error count query function. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 77462ab8c62b0dc65261c042771efea44a111131 Author: Tao Zhou Date: Tue Feb 7 18:30:55 2023 +0800 drm/amdgpu: add RAS definitions for GFX Add common GFX RAS definitions. v2: remove instance from amdgpu_gfx_ras_reg_entry, amdgpu_ras_err_status_reg_entry has already defined it. v3: remove memory id definitions from amdgpu_gfx.h, they are related to IP version. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2b80ffc2d86cce8444d5fc0237afd77f7d18cd1d Author: Hawking Zhang Date: Mon Feb 27 17:36:19 2023 +0800 drm/amdgpu: Add gc v9_4_3 ras error status registers GC v9_4_3 introduces UE|CE_ERR_STATUS_LO|HI to log hardware errors Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 47e7f527c8256a2fe3e61fcd5f59c18bc3fb53fc Author: Tao Zhou Date: Fri Feb 3 10:41:26 2023 +0800 drm/amdgpu: add RAS status reset for gfx_v9_4_3 Reset GFX RAS status registers. v2: fix typo in title. remove xcp operation. v3: change instance from 0 to xcc_id for register access. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bf16235b39d4ca9c8dd47ec1b2faded6ea58f7a2 Author: Tao Zhou Date: Thu Feb 2 17:20:23 2023 +0800 drm/amdgpu: add RAS status query for gfx_v9_4_3 Query GFX RAS status. v2: remove xcp operation. v3: change instance from 0 to xcc_id for register access. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d78c71321ea963378cd3c5646ac6c6483d8d1a50 Author: Tao Zhou Date: Thu Feb 2 18:57:04 2023 +0800 drm/amdgpu: add GFX RAS common function The common function can help reduce redundant code. v2: remove xcp operation, only need to do RAS operations for all instances. v3: remove check for GFX RAS support, will be checked in higher level. add amdgpu prefix for the function name. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9a3ce1a7a9e5372d8c275bf3fbef4456c8407145 Author: Hawking Zhang Date: Fri May 12 13:22:57 2023 +0800 drm/amdgpu: Do not access members of xcp w/o check (v2) Not all the asic needs xcp. ensure check xcp availabity before accessing its member. v2: add missing change in kfd_topology.c Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 0409022c15623d91c112e51f38cb62633becd432 Author: Hawking Zhang Date: Thu May 11 17:01:03 2023 +0800 drm/amdkfd: Fix null ptr access Avoid access null xcp_mgr pointer. Signed-off-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit f464c5dd4d918d4dd84eda7e68d4a0b6d41fe37f Author: Tao Zhou Date: Mon Mar 20 18:21:14 2023 +0800 drm/amdgpu: add check for RAS instance mask The mask is only needed to be set when RAS block instance number is more than 1 and invalid bits should be also masked out. We only check valid bits for GFX and SDMA block for now, and will add check for other RAS blocks in the future. v2: move the check under injection operation since the mask is only used by RAS error inject. v3: add valid bits handling for SDMA. v4: print message if the mask is adjusted. Signed-off-by: Tao Zhou Hawking Zhang Reviewed-by: Stanley.Yang Signed-off-by: Alex Deucher commit 6e3c51a5814aff70b72e8b2a9953bdac7aea2f44 Author: Tao Zhou Date: Mon Mar 13 16:34:19 2023 +0800 drm/amdgpu: remove RAS GFX injection for gfx_v9_4/gfx_v9_4_2 No special requirement in RAS injection for the two versions, switch to use default injection interface. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Reviewed-by: Stanley.Yang Signed-off-by: Alex Deucher commit 27c5f29526d17a33946a6b977a0274eae320c489 Author: Tao Zhou Date: Mon Mar 13 16:24:11 2023 +0800 drm/amdgpu: reorganize RAS injection flow So GFX RAS injection could use default function if it doesn't define its own injection interface. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Reviewed-by: Stanley.Yang Signed-off-by: Alex Deucher commit 2c22ed0bdb0cb6da9408593eafa6137325576017 Author: Tao Zhou Date: Mon Feb 27 18:25:23 2023 +0800 drm/amdgpu: add instance mask for RAS inject User can specify injected instances by the mask. For backward compatibility, the mask value is incorporated into sub block index without interface change of RAS TA. User uses logical mask and driver should convert it to physical value before sending it to RAS TA. v2: update parameter name. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Reviewed-by: Stanley.Yang Signed-off-by: Alex Deucher commit af2ba368838ee4913e758f34e3d8bbfeb110be36 Author: Tao Zhou Date: Mon Feb 27 16:31:56 2023 +0800 drm/amdgpu: convert logical instance mask to physical one Convert instance mask for the convenience of RAS TA. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Reviewed-by: Stanley.Yang Signed-off-by: Alex Deucher commit 40b832aac03249ebc70479da9f3ecf2789deaeed Author: Mukul Joshi Date: Wed Apr 12 16:56:29 2023 -0400 drm/amdgpu: Enable IH CAM on GFX9.4.3 This patch enables IH CAM on GFX9.4.3 ASIC. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3cde91172d2e9d8d8dc6e0d62b7c829de503825c Author: Philip Yang Date: Wed Apr 19 17:39:35 2023 -0400 drm/amdgpu: Correct get_xcp_mem_id calculation Current calculation only works for NPS4/QPX mode, correct it for NPS4/CPX mode. Signed-off-by: Philip Yang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 84b4dd3f84de424a68e1fda0d483530ddaa92b45 Author: Philip Yang Date: Fri Mar 31 11:18:12 2023 -0400 drm/amdkfd: Refactor migrate init to support partition switch Rename smv_migrate_init to a better name kgd2kfd_init_zone_device because it setup zone devive pgmap for page migration and keep it in kfd_migrate.c to access static functions svm_migrate_pgmap_ops. Call it only once in amdgpu_device_ip_init after adev ip blocks are initialized, but before amdgpu_amdkfd_device_init initialize kfd nodes which enable SVM support based on pgmap. svm_range_set_max_pages is called by kgd2kfd_device_init everytime after switching compute partition mode. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 44a976655597b60bd501148abe66462bdc33fb6b Author: Shiwu Zhang Date: Fri Mar 31 17:16:41 2023 +0800 drm/amdgpu: route ioctls on primary node of XCPs to primary device During XCP init, unlike the primary device, there is no amdgpu_device attached to each XCP's drm_device In case that user trying to open/close the primary node of XCP drm_device this rerouting is to solve the NULL pointer issue causing by referring to any member of the amdgpu_device BUG: unable to handle page fault for address: 0000000000020c80 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page Oops: 0002 [#1] PREEMPT SMP NOPTI Call Trace: lock_timer_base+0x6b/0x90 try_to_del_timer_sync+0x2b/0x80 del_timer_sync+0x29/0x40 flush_delayed_work+0x1c/0x50 amdgpu_driver_open_kms+0x2c/0x280 [amdgpu] drm_file_alloc+0x1b3/0x260 [drm] drm_open+0xaa/0x280 [drm] drm_stub_open+0xa2/0x120 [drm] chrdev_open+0xa6/0x1c0 Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 25f50704343de1bea70100ad41621b5737a6a96b Author: Philip Yang Date: Thu Mar 23 08:45:56 2023 -0400 drm/amdkfd: APU mode set max svm range pages svm_migrate_init set the max svm range pages based on the KFD nodes partition size. APU mode don't init pgmap because there is no migration. kgd2kfd_device_init calls svm_migrate_init after KFD nodes allocation and initialization. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 1c77527a69d5ca19cb276e2728992d922b687f35 Author: Mukul Joshi Date: Mon Mar 20 11:22:30 2023 -0400 drm/amdkfd: Fix memory reporting on GFX 9.4.3 This patch fixes memory reporting on the GFX 9.4.3 APU and dGPU by reporting available memory on a per partition basis. If its an APU, available and used memory calculations take into account system and TTM memory. v2: squash in fix ("drm/amdkfd: Fix array out of bound warning") squash in fix ("drm/amdgpu: Update memory reporting for GFX9.4.3") Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 315e29eca57f85107cc6f687c2d510aa532fb3f0 Author: Mukul Joshi Date: Mon Mar 20 11:21:38 2023 -0400 drm/amdkfd: Move local_mem_info to kfd_node We need to track memory usage on a per partition basis. To do that, store the local memory information in KFD node instead of kfd device. v2: squash in fix ("amdkfd: Use mem_id to access mem_partition info") Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit b125b80bd546d72d08ab64d63cfc8efa397b6779 Author: James Zhu Date: Mon Mar 13 12:03:18 2023 -0400 drm/amdgpu: use xcp partition ID for amdgpu_gem Find xcp_id from amdgpu_fpriv, use it for amdgpu_gem_object_create. Signed-off-by: James Zhu Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2fa9ff25de08e598af051c76b216d2f073b2ee89 Author: Philip Yang Date: Thu Mar 9 19:30:02 2023 -0500 drm/amdgpu: KFD graphics interop support compute partition kfd_ioctl_get_dmabuf use the amdgpu bo xcp_id to get the gpu_id of the KFD node from the exported dmabuf_adev, and then create kfd bo on the correct adev and KFD node when importing the amdgpu bo to KFD. Remove function kfd_device_by_adev, it is not needed as it is the same result as dmabuf_adev->kfd.dev->nodes[0]->id. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3ebfd221c1a83e5f0edadb87d173d8fd93d1d125 Author: Philip Yang Date: Wed Mar 8 11:57:00 2023 -0500 drm/amdkfd: Store xcp partition id to amdgpu bo For memory accounting per compute partition and export drm amdgpu bo and then import to KFD, we need the xcp id to account the memory usage or find the KFD node of the original amdgpu bo to create the KFD bo on the correct adev KFD node. Set xcp_id_plus1 of amdgpu_bo_param to create bo and store xcp_id to amddgpu bo. Add helper macro to get the mem_id from adev and xcp_id. v2: squash in fix ("drm/amdgpu: Fix BO creation failure on GFX 9.4.3 dGPU") Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6cfba94a77c5cbad2d7c106ac5f026b6a8b1efe6 Author: Philip Yang Date: Tue Mar 7 11:30:24 2023 -0500 drm/amdgpu: dGPU mode set VRAM range lpfn as exclusive TTM place lpfn is exclusive used as end (start + size) in drm and buddy allocator, adev->gmc memory partition range lpfn is inclusive (start + size - 1), should plus 1 to set TTM place lpfn. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ea7bf2f22061a7bd77b17ddd4ac1bb3500ae823f Author: Philip Yang Date: Thu Feb 23 20:00:05 2023 -0500 drm/amdgpu: Alloc page table on correct memory partition Alloc kernel mode page table bo uses the amdgpu_vm->mem_id + 1 as bp mem_id_plus1 parameter. For APU mode, select the correct TTM pool to alloc page from the corresponding memory partition, this will be the closest NUMA node. For dGPU mode, select the correct address range for vram manager. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit dc12f9eddedb8b41f4dc948e5e636e5221fb4d43 Author: Philip Yang Date: Thu Feb 2 11:07:53 2023 -0500 drm/amdkfd: Update MTYPE for far memory partition Use MTYPE RW/MTYPE_CC for mapping system memory or VRAM to KFD node within the same memory partition, use MTYPE_NC for mapping on KFD node from the far memory partition of the same socket or from another socket on same XGMI hive. On NPS4 or 4P system, MTYPE will be overridden per page depending on the memory NUMA node id and vm->mem_id. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3e399cf20f69b7f810bcdf98c8df6b1c2af88465 Author: Hans de Goede Date: Mon May 29 11:37:38 2023 +0100 media: atomisp: Use selection API info to determine sensor padding Using the selection / crop info to determine the padding values to use with a specific resolution on specific sensor. This allows e.g. automatically halving the padding when using the max binned resolution and also ensures the right amount of padding is used on models with 2 sensors with different padding requirements. Link: https://lore.kernel.org/r/20230529103741.11904-19-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 7f6db89418f9d26eb68e050ff16de8e9827011ca Author: Philip Yang Date: Thu Jan 26 18:54:29 2023 -0500 drm/amdgpu: dGPU mode placement support memory partition dGPU mode uses VRAM manager to validate bo, amdgpu bo placement use the mem_id to get the allocation range first, last page frame number from xcp manager, pass to drm buddy allocator as the allowed range. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2046ed6c8aa951e4ae83c5022bb0a7c777386097 Author: Philip Yang Date: Thu Jan 26 18:45:32 2023 -0500 drm/amdkfd: SVM range allocation support memory partition Pass kfd node->xcp->mem_id to amdgpu bo create parameter mem_id_plus1 to allocate new svm_bo on the specified memory partition. This is only for dGPU mode as we don't migrate with APU mode. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 62866c23c78d2c5db85bf82d61d8801aa9e93176 Author: Hans de Goede Date: Mon May 29 11:37:37 2023 +0100 media: atomisp: Make atomisp_init_sensor() check if the sensor supports binning Make atomisp_init_sensor() check if the sensor supports binning. This is a preparation patch for using the selection / crop support to determine the padding values to use with a specific sensor. Link: https://lore.kernel.org/r/20230529103741.11904-18-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 95094495401bdf6a0649d220dfd095e6079b5e39 Author: Chen-Yu Tsai Date: Wed May 31 14:35:30 2023 +0800 soc: mediatek: SVS: Fix MT8192 GPU node name Device tree node names should be generic. The planned device node name for the GPU, according to the bindings and posted DT changes, is "gpu", not "mali". Fix the GPU node name in the SVS driver to follow. Fixes: 0bbb09b2af9d ("soc: mediatek: SVS: add mt8192 SVS GPU driver") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230531063532.2240038-1-wenst@chromium.org Signed-off-by: Matthias Brugger commit 8e2facfe904a20e306536aeadd737dfaeab5cb38 Author: Fabio Estevam Date: Tue Jun 6 16:03:22 2023 -0300 arm64: dts: imx8mq: Pass address-cells/size-cells to mipi_dsi mipi_dsi node requires #address-cells and #size-cells. Pass them to fix the following schema warnings: imx8mq-mnt-reform2.dtb: mipi-dsi@30a00000: '#address-cells' is a required property From schema: Documentation/devicetree/bindings/display/bridge/nwl-dsi.yaml imx8mq-mnt-reform2.dtb: mipi-dsi@30a00000: '#size-cells' is a required property From schema: Documentation/devicetree/bindings/display/bridge/nwl-dsi.yaml Signed-off-by: Fabio Estevam Acked-by: Alexander Stein Signed-off-by: Shawn Guo commit 91c167b9fea03acd8d0e36e11ed2ab92127f7220 Author: Fabio Estevam Date: Tue Jun 6 16:03:21 2023 -0300 arm64: dts: imx8mq: Use 'dsi' as node name Use 'dsi' as node name to avoid the following schema warning: imx8mq-evk.dtb: mipi-dsi@30a00000: $nodename:0: 'mipi-dsi@30a00000' does not match '^dsi(@.*)?$' From schema: Documentation/devicetree/bindings/display/bridge/nwl-dsi.yaml Signed-off-by: Fabio Estevam Acked-by: Alexander Stein Signed-off-by: Shawn Guo commit 115ee470e5d2438f9c36802fc47bcb2297ec33be Author: Arınç ÜNAL Date: Fri Feb 10 21:25:05 2023 +0300 arm: dts: mt7623: add port@5 as CPU port On the MT7623AI SoC and Bananapi BPI-R2, port 5 of the MT7530 switch is connected to the second MAC of the SoC as a CPU port. Add the port and set up the second MAC on the bindings. Signed-off-by: Arınç ÜNAL Link: https://lore.kernel.org/r/20230210182505.24597-6-arinc.unal@arinc9.com Signed-off-by: Matthias Brugger commit 031bf30966721c28489b9a52942dcaa4ef67b63e Author: Arınç ÜNAL Date: Fri Feb 10 21:25:04 2023 +0300 arm: dts: mt7623: enable flow control on port@6 Flow control needs to be enabled on both sides to work. It is already enabled on gmac0, enable it on port@6 too. Signed-off-by: Arınç ÜNAL Link: https://lore.kernel.org/r/20230210182505.24597-5-arinc.unal@arinc9.com Signed-off-by: Matthias Brugger commit cf8f3a7a044d57f3a0c5e14e97b8926c212f31f0 Author: Arınç ÜNAL Date: Fri Feb 10 21:25:03 2023 +0300 arm: dts: mt7623: change mt7530 switch address In the case of muxing phy0 of the MT7530 switch, the switch and the phy will have the same address on the mdio bus, 0. This causes the ethernet driver to fail since devices on the mdio bus cannot share an address. Any address can be used for the switch, therefore, change the switch address to 0x1f. Signed-off-by: Arınç ÜNAL Link: https://lore.kernel.org/r/20230210182505.24597-4-arinc.unal@arinc9.com Signed-off-by: Matthias Brugger commit e5240c35fa75c44d36b3a361a6f8d5685fde269e Author: Arınç ÜNAL Date: Fri Feb 10 21:25:02 2023 +0300 arm: dts: mt7623: add mt7530 switch to mt7623a.dtsi The MT7530 switch is included as a part of the multi-chip module on the MT7623AI SoC. Add it to mt7623a.dtsi and adjust DTs that call mt7623a.dtsi. Signed-off-by: Arınç ÜNAL Link: https://lore.kernel.org/r/20230210182505.24597-3-arinc.unal@arinc9.com Signed-off-by: Matthias Brugger commit f847a3a8c68fe048d77485690af8c2a86d32763e Author: Arınç ÜNAL Date: Fri Feb 10 21:25:01 2023 +0300 arm: dts: mt7623: add gmacs to mt7623.dtsi There are two gigabit MACs on the MT7623AI and MT7623NI SoCs. Add them to mt7623.dtsi and adjust the DTs that call mt7623.dtsi. Now that there are labels for the MACs, remove them from under ð on the DTs that call mt7623.dtsi. Remove the unnecessary mdio label from Bananapi BPI-R2. Signed-off-by: Arınç ÜNAL Link: https://lore.kernel.org/r/20230210182505.24597-2-arinc.unal@arinc9.com Signed-off-by: Matthias Brugger commit a08183b8460e4800c186b754026b6fd937370871 Author: Hans de Goede Date: Mon May 29 11:37:36 2023 +0100 media: atomisp: Pass MEDIA_BUS_FMT_* code when calling enum_frame_size pad-op A sensor driver's enum_frame_size pad-op may return -EINVAL when v4l2_subdev_frame_size_enum.code is not set to a supported MEDIA_BUS_FMT_* code. Make atomisp_init_sensor() get the sensor's MEDIA_BUS_FMT_* code and pass this when calling the enum_frame_size pad-op. Link: https://lore.kernel.org/r/20230529103741.11904-17-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 2e21f19fc510412b20665a7797e0fb918ff3cd13 Author: Tim Harvey Date: Wed Jun 7 08:36:02 2023 -0700 arm64: dts: imx8mp-venice-gw702x: fix GSC vdd_bat data size On this board, vdd_bat is 16bit, not 24bit. Set the mode to mode_voltage_16bit (3) instead of mode_voltage_24bit (1). Fixes: 0d5b288c2110 ("arm64: dts: freescale: Add imx8mp-venice-gw7905-2x") Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 04eca831605390071be83b87774e4987639e6331 Author: Hans de Goede Date: Mon May 29 11:37:35 2023 +0100 media: atomisp: Add support for sensors which implement selection API / cropping Sensor drivers which implement set_selection V4L2_SEL_TGT_CROP expect v4l2_subdev_state.pads[pad].try_crop to have valid contents when calling set_fmt with which == V4L2_SUBDEV_FORMAT_TRY since the crop-rectangle may influence the available image size. Just passing an uninitalized struct v4l2_subdev_pad_config from the stack to set_fmt with which == V4L2_SUBDEV_FORMAT_TRY will result in wrong results with such drivers. Store a per sensor v4l2_subdev_pad_config and add a new atomisp_init_sensor_crop() function to initialize this before registering /dev/* nodes with userspace. Sensor drivers which implement the selection API will allow the atomisp to properly deal with the extra padding the ISP wants on a per sensor basis instead of hardcoding this. atomisp_init_sensor_crop() stores the native and active rects of the sensor in preparation for using these for this. Link: https://lore.kernel.org/r/20230529103741.11904-16-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 929eee2fb07aee951c493cfdd87cb19719606d91 Author: Hans de Goede Date: Mon May 29 11:37:34 2023 +0100 media: atomisp: Refactor atomisp_try_fmt() / atomisp_set_fmt() There are a number of bugs in atomisp_try_fmt_cap() and atomisp_set_fmt(): 1. atomisp_try_fmt_cap() uses atomisp_adjust_fmt() which adds the sensor padding to the width passed to atomisp_adjust_fmt() to calculate bytesperline. This is buggy for 2 reasons: a) The width passed to atomisp_adjust_fmt() already contains   the sensor padding. b) The fmt returned by atomisp_try_fmt_cap() is the fmt outputted by the ISP and the sensor padding applies to the input side of the ISP not the output side. The output side of the ISP has its own padding / pitch requirements which have nothing to do with the sensor. Both these issues are fixed in this refactor by switching to ia_css_frame_pad_width() to calculate the padding. 2. atomisp_set_fmt() takes the passed in bytesperline value without doing any validation on it and then passes this unchecked value to the configure_output() callback. If bytesperline converted to pixels is > 1920 ia_css_binary_find() will fail to find a valid binary for the preview pipeline triggering a dump_stack_lvl() call inside ia_css_binary_find() and causing atomisp_set_fmt() to fail. This is fixed by making atomisp_set_fmt() call atomisp_try_fmt() first which we override the userspace specified bytesperline with the correct value. Besides this bug there is also a bunch of weirdness and a lot of duplication in the code: 1. atomisp_try_fmt_cap() adds the sensor padding itself but then it gets substracted again in atomisp_adjust_fmt() not doing the addition + substraction in the same place makes the code hard to follow (weirdness). 2. atomisp_set_fmt() starts with basically an atomisp_try_fmt() call, except that the only atomisp_try_fmt() caller: atomisp_try_fmt_cap() adds the sensor padding itself rather than letting atomisp_try_fmt() do this (duplication). 3. Both atomisp_try_fmt_cap() and atomisp_set_fmt() contain code to lookup the bridge-format matching the requested pixelformat and both will fallback to YUV420 if this is not set (duplication). 4. Both atomisp_try_fmt_cap() and atomisp_set_fmt() contain code to fill in the passed in v4l2_pix_format struct (duplication). Cleanup all of this (and fix the bugs mentioned above) by: 1. Adding a new atomisp_fill_pix_format() helper which properly uses ia_css_frame_pad_width() to calculate bytesperline. 2. Move all sensor padding handling to atomisp_try_fmt() and make atomisp_try_fmt() fill the passed in v4l2_pix_format struct. 3. This reduces atomisp_try_fmt_cap() to just a small wrapper around atomisp_try_fmt(). 4. Replace the DIY try_fmt code at the beginning of atomisp_set_fmt() with atomisp_try_fmt(), this will also override/fix the bytersperline passed by userspace. 5. Replace the DIY v4l2_pix_format filling at the end of atomisp_set_fmt() with atomisp_fill_pix_format(). Link: https://lore.kernel.org/r/20230529103741.11904-15-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit eec8787bfb5558999ac97ac3363acc7fc8c4fdf8 Author: Hans de Goede Date: Mon May 29 11:37:33 2023 +0100 media: atomisp: Add ia_css_frame_pad_width() helper function Factor the code to go from width to a properly aligned pitch out of ia_css_frame_info_set_width(). This is a preparation patch to fix try_fmt() calls returning a bogus bytesperline value. Link: https://lore.kernel.org/r/20230529103741.11904-14-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 9f221053342ab943c4bac8d5cf10ca256793a878 Author: Hans de Goede Date: Mon May 29 11:37:32 2023 +0100 media: atomisp: Add input helper variable for isp->asd->inputs[asd->input_curr] Passing 'isp->asd->inputs[asd->input_curr].foo' as argument to various function calls is rather long. Add a local input helper variable for this, so that the function calls will fit on one line. Link: https://lore.kernel.org/r/20230529103741.11904-13-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 6c0160aa6ecdbad091c6ef9da507511b3d06eaaa Author: Alexander Stein Date: Tue Jun 6 17:10:48 2023 +0200 arm64: dts: imx8mq-tqma8mq-mba8mx: Remove invalid properties They originated from the downstream kernel and slipped into mainline. Remove them to silence also dtbs_check warnings: pcie@33800000: Unevaluated properties are not allowed ('epdev_on-supply', 'hard-wired' were unexpected) pcie@33c00000: Unevaluated properties are not allowed ('epdev_on-supply', 'hard-wired' were unexpected) Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit e79fae3d15095542db18c4cb2adfbd9e8fda91a4 Author: Hans de Goede Date: Mon May 29 11:37:31 2023 +0100 media: atomisp: Remove bogus fh use from atomisp_set_fmt*() atomisp_set_fmt*() use a local v4l2_subdev_fh declared on the stack, specifically they use fh.state which is never initialized so when passing fh.state to atomisp_subdev_set_ffmt() / to atomisp_subdev_set_selection() these functions are passing random stack contents as a pointer. The reason this works is because when the which parameter is V4L2_SUBDEV_FORMAT_ACTIVE the passed in state is not used. Remove the bogus fh usage and just pass NULL as state. Link: https://lore.kernel.org/r/20230529103741.11904-12-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 566f6de6aa283be619e870fae175404b447cdee1 Author: Hans de Goede Date: Mon May 29 11:37:30 2023 +0100 media: atomisp: Add target validation to atomisp_subdev_set_selection() As the 2 comments in the function already say both the sink and the source pads only support setting the selection for 1 target: /* Only crop target supported on sink pad. */ /* Only compose target is supported on source pads. */ Validate that the passed in target actually matches these expectations. Link: https://lore.kernel.org/r/20230529103741.11904-11-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 7caa6570da6a21973340edf4075f31a59f08187a Author: Hans de Goede Date: Mon May 29 11:37:29 2023 +0100 media: atomisp: Simplify atomisp_subdev_set_selection() calls in atomisp_set_fmt() With the atomisp_subdev_set_selection(sink-pad, V4L2_SEL_TGT_CROP, rect) calls dropped. The first and last compount code blocks of the 3 code blocks in the if (...) {} else if (...) {} else {} code setting the source-pad V4L2_SEL_TGT_COMPOSE selection are the same. The both set V4L2_SEL_TGT_COMPOSE to a rectangle with the same dimensions as f->fmt.pix.height. Remove the else {} block at the end, drop the second if and prepend the first if condition with "!second-if-condition ||" to remove the code duplication. Link: https://lore.kernel.org/r/20230529103741.11904-10-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 940587e7737d56173321926d4d3d9daf332e0a6a Author: Alexander Stein Date: Tue Jun 6 17:09:19 2023 +0200 arm64: dts: imx8mq: Add missing pci property Add the required bus-range property to PCI RC node. Fixes the warning: pcie@33c00000: 'bus-range' is a required property From schema: Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml Signed-off-by: Alexander Stein Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit edcaf194db96eda0db59cf813be07d619fb9596d Author: Alexander Stein Date: Tue Jun 6 17:09:18 2023 +0200 arm64: dts: imx8mq: Fix lcdif clocks Add display APB and AXI clocks as required by bindings. This fixes the warnings: lcd-controller@30320000: clocks: [[2, 128]] is too short From schema: Documentation/devicetree/bindings/display/fsl,lcdif.yaml lcd-controller@30320000: clock-names: ['pix'] is too short From schema: Documentation/devicetree/bindings/display/fsl,lcdif.yaml Signed-off-by: Alexander Stein Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 02208f0e600a6555254133fd7ca8a863ecfa7bcd Author: Alexander Stein Date: Tue Jun 6 17:09:17 2023 +0200 arm64: dts: imx8mq: Fix lcdif compatible "fsl,imx8mq-lcdif" is compatible to "fsl,imx6sx-lcdif", adjust the list accordingly. Fixes the dtbs_check warning: imx8mq-tqma8mq-mba8mx.dtb: lcd-controller@30320000: compatible: 'oneOf' conditional failed, one must be fixed: ['fsl,imx8mq-lcdif', 'fsl,imx28-lcdif'] is too long 'fsl,imx8mq-lcdif' is not one of ['fsl,imx23-lcdif', 'fsl,imx28-lcdif', 'fsl,imx6sx-lcdif', 'fsl,imx8mp-lcdif', 'fsl,imx93-lcdif'] 'fsl,imx6sx-lcdif' was expected Signed-off-by: Alexander Stein Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit af330c965fdd6bb86b8aaf804334f03623d6d2cd Author: Hans de Goede Date: Mon May 29 11:37:28 2023 +0100 media: atomisp: Remove redundant atomisp_subdev_set_selection() calls from atomisp_set_fmt() atomisp_subdev_set_selection(sink-pad, V4L2_SEL_TGT_CROP, rect) ignores the passed in rect, using the width and height from the last atomisp_subdev_set_ffmt(ATOMISP_SUBDEV_PAD_SINK, ffmt) call instead. The atomisp_subdev_set_ffmt() call done by atomisp_set_fmt_to_snr() already propagates the sink ffmt changes to V4L2_SEL_TGT_CROP (this is what allows atomisp_set_fmt() to get the isp_sink_crop in the first place). Remove the redundant atomisp_subdev_set_selection(sink-pad, ...) calls. Note the removed aspect ratio correction in the last else block is is already done by atomisp_subdev_set_selection() itself when setting V4L2_SEL_TGT_COMPOSE on the source-pad. Link: https://lore.kernel.org/r/20230529103741.11904-9-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 503bf3090a19b6c7ba620b9c224a9409a41d3c91 Author: Hans de Goede Date: Mon May 29 11:37:27 2023 +0100 media: atomisp: Remove a bunch of sensor related custom IOCTLs Remove a bunch of sensor related custom IOCTLs because: 1. They are custom IOCTLs and all custom IOCTLs should be removed 2. Userspace should directly talk to the sensor v4l2-subdev, rather then relying on ioctl-s on the output /dev/video# node to pass through ioctl-s to the senor 3. Some of these rely on the atomisp specific camera_mipi_info struct which is going away as we are switching to using standard v4l2 sensor drivers 4. In the case of ATOMISP_IOC_S_EXPOSURE_WINDOW this was using the v4l2-subdev set_selection API in an undocumented atomisp custom way Link: https://lore.kernel.org/r/20230529103741.11904-8-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit a5cc2f0dc51964c200dc6cfcdf8a77aa711b7c0c Author: Hans de Goede Date: Mon May 29 11:37:26 2023 +0100 media: atomisp: ov2680: Implement selection support Implement selection support. Modelled after ov5693 selection support, but allow setting sizes smaller than crop-size through set_fmt since that was already allowed. Link: https://lore.kernel.org/r/20230529103741.11904-7-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit b1b2d3992623290833f7f4ddea1986c7f123f3ad Author: Hans de Goede Date: Mon May 29 11:37:25 2023 +0100 media: atomisp: ov2680: Add init_cfg pad-op Having an init_cfg to initialize the passed in subdev-state is important to make which == V4L2_SUBDEV_FORMAT_TRY ops work when userspace is talking to a /dev/v4l2-subdev# node. Copy the ov2680_init_cfg() from the standard drivers/media/i2c/ov2680.c driver. This is esp. relevant once support for cropping is added where the v4l2_subdev_state.pads[pad].try_crop rectangle needs to be set correctly for set_fmt which == V4L2_SUBDEV_FORMAT_TRY calls to work. Link: https://lore.kernel.org/r/20230529103741.11904-6-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit c1ee1db3c936c09141020007a11da24660c5393f Author: Hans de Goede Date: Mon May 29 11:37:24 2023 +0100 media: atomisp: ov2680: Add missing ov2680_calc_mode() call to probe() Call ov2680_calc_mode() from probe() instead of relying on userspace to make at least one s_fmt call to fill the mode parameters. Link: https://lore.kernel.org/r/20230529103741.11904-5-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit b0e880e4a85b87b68a76391cdfd1046f024386ef Author: Hans de Goede Date: Mon May 29 11:37:23 2023 +0100 media: atomisp: ov2680: s/input_lock/lock/ s/input_lock/lock/ lock is used by the generic drivers/media/i2c/ov2680.c driver. Bring the atomisp ov2680 code inline to make it easier to port changes between the two, with the end goal of getting rid of the atomisp specific version. Link: https://lore.kernel.org/r/20230529103741.11904-4-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 19cdcf676355a93a139113d3008112c895915cfc Author: Hans de Goede Date: Mon May 29 11:37:22 2023 +0100 media: atomisp: ov2680: s/ov2680_device/ov2680_dev/ s/ov2680_device/ov2680_dev/ ov2680_dev is used by the generic drivers/media/i2c/ov2680.c driver. Bring the atomisp ov2680 code inline to make it easier to port changes between the two, with the end goal of getting rid of the atomisp specific version. Link: https://lore.kernel.org/r/20230529103741.11904-3-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 36f48c705242bd21a295992c3b0bd2ebbcdef1df Author: Hans de Goede Date: Mon May 29 11:37:21 2023 +0100 media: atomisp: Update TODO A lot of work has been done on the atomisp driver lately. Rewrite the TODO file to drop all the already fixed items: * Moved to videobuf2 + fixed mmap support * Whole bunch of v4l2 API fixes making more apps work * v4l2-async sensor probing support * pm-runtime support (for some sensor drivers at least) * buffer MM code was cleaned up / replaced when moving the videobuf2 And add a new TODO list (retaining some of the old items) split into items which absolutely must be fixed before the driver can be moved out of staging: 1. Conflicting hw-ids with regular sensor drivers 2. Private userspace API stuff As well as a list of items which also definitely needs to be fixed but which could also be fixed after moving the driver out of staging. Link: https://lore.kernel.org/r/20230529103741.11904-2-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 16c984524862d57c456d090ab835e0085c47d579 Author: Lucas Stach Date: Fri Jun 2 21:10:13 2023 +0200 arm64: dts: imx8mp: don't initialize audio clocks from CCM node The audio clocks should be intitialized to the correct rate by the subsystem using them. There is no need to always initialize them from the CCM node assigned-clocks property. This way boards using the audio clocks in a non- standard way can change them without first duplicating the CCM clock setup. Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit fadac6afccf7d8a4efa1e0ca89958f6716685333 Author: Hans de Goede Date: Sat May 27 16:38:12 2023 +0100 media: atomisp: Fix buffer overrun in gmin_get_var_int() Not all functions used in gmin_get_var_int() update len to the actual length of the returned string. So len may still have its initial value of the length of val[] when "val[len] = 0;" is run to ensure 0 termination. If this happens we end up writing one beyond the bounds of val[], fix this. Note this is a quick fix for this since the entirety of atomisp_gmin_platform.c will be removed once all atomisp sensor drivers have been moved over to runtime-pm + v4l2-async device registration. Closes: https://lore.kernel.org/linux-media/26f37e19-c240-4d77-831d-ef3f1a4dd51d@kili.mountain/ Reported-by: Dan Carpenter Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 1657f2934daf89e8d9fa4b2697008909eb22c73e Author: Dan Carpenter Date: Fri May 26 12:53:23 2023 +0100 media: atomisp: gmin_platform: fix out_len in gmin_get_config_dsm_var() Ideally, strlen(cur->string.pointer) and strlen(out) would be the same. But this code is using strscpy() to avoid a potential buffer overflow. So in the same way we should take the strlen() of the smaller string to avoid a buffer overflow in the caller, gmin_get_var_int(). Link: https://lore.kernel.org/r/26124bcd-8132-4483-9d67-225c87d424e8@kili.mountain Fixes: 387041cda44e ("media: atomisp: improve sensor detection code to use _DSM table") Signed-off-by: Dan Carpenter Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit c79d80960349c4ec5918f581168a263e88e6190a Author: Nicolas Cavallari Date: Mon Jun 5 11:04:42 2023 +0200 arm64: dts: imx8mm-venice: Fix GSC vdd_bat data size. On these boards, vdd_bat is 16bit, not 24bit. Reading them as 24bit values yield garbage values because of the additional byte, which is a configurable fan trippoint[1]. So set their mode to mode_voltage_16bit = 3 instead of mode_voltage_24bit = 1. [1]: http://trac.gateworks.com/wiki/gsc#SystemTemperatureandVoltageMonitor Only tested on GW7100. Signed-off-by: Nicolas Cavallari Acked-by: Tim Harvey Signed-off-by: Shawn Guo commit d80be6a10cd3855004dc0ba3716fb1c76471dea1 Author: Hans de Goede Date: Thu May 25 20:00:59 2023 +0100 media: atomisp: Drop v4l2_get_acpi_sensor_info() function Drop v4l2_get_acpi_sensor_info() the 2 sensor drivers which were using this have both been converted to v4l2-async probing, relying on the atomisp_csi2_bridge.c code to add the GPIO mappings instead. Link: https://lore.kernel.org/r/20230525190100.130010-5-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 1aace3da2847a003a3dcadada2820dbb9b4291ec Author: Hans de Goede Date: Thu May 25 20:00:58 2023 +0100 media: atomisp: gc0310: Turn into standard v4l2 sensor driver Switch the atomisp-gc0310 driver to v4l2 async device registration. After this change this driver no longer depends on atomisp_gmin_platform and all atomisp-isms are gone. Link: https://lore.kernel.org/r/20230525190100.130010-4-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 947550f8c08ec68db637dbb27f80dbb922536a82 Author: Hans de Goede Date: Thu May 25 20:00:57 2023 +0100 media: atomisp: ov2680: Turn into standard v4l2 sensor driver Turn the atomisp-ov2680 driver into a standard v4l2 sensor driver: 1. Stop filling camera_mipi_info 2. Stop calling v4l2_get_acpi_sensor_info() this will be done by atomisp_csi2_bridge_parse_firmware() now 3. Switch to v4l2 async device registration After this change this driver no longer depends on atomisp_gmin_platform and all atomisp-isms are gone. While at it, also add missing mutex_destroy() to ov2680_remove(). Link: https://lore.kernel.org/r/20230525190100.130010-3-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 8d28ec7e9145ef6308ab3438d73308ec6ea14360 Author: Hans de Goede Date: Thu May 25 20:00:56 2023 +0100 media: atomisp: Add support for v4l2-async sensor registration Add support for using v4l2-async sensor registration. This has been tested with both the gc0310 and the ov2680 sensor drivers. Drivers must add the ACPI HIDs they match on to the supported_sensors[] array in the same commit as that they are converted to v4l2_async_register_subdev_sensor(). Sensor drivers also must check they have a fwnode graph endpoint and return -EPROBE_DEFER from probe() if there is no endpoint yet. This guarantees that the GPIO mappings are in place before the driver tries to get GPIOs. For now it also is still possible to use the old atomisp_gmin_platform based sensor drivers. This is mainly intended for testing while moving other sensor drivers over to runtime-pm + v4l2-async. Link: https://lore.kernel.org/r/20230525190100.130010-2-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 5e131b80605a391bb61c23e1f5950a343b4d8a58 Author: Hans Verkuil Date: Wed May 24 13:11:50 2023 +0100 media: atomisp: move up sanity checks The sanity checks were done too late, so move them up. This fixes this smatch warning: drivers/staging/media/atomisp/pci/sh_css_firmware.c:247 sh_css_load_firmware() warn: variable dereferenced before check 'fw_data' (see line 237) Link: https://lore.kernel.org/r/20230524121150.435736-9-hverkuil-cisco@xs4all.nl Signed-off-by: Hans Verkuil Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 66c1dfad00120d15abb1bca4e97b1dcf82002019 Author: Hans Verkuil Date: Wed May 24 13:11:43 2023 +0100 media: atomisp: initialize settings to 0 Fix a compiler warning: drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c:1525:13: warning: 'settings' may be used uninitialized [-Wmaybe-uninitialized] The 'settings' variable is actually always initialized, but the compiler isn't quite able to figure that out. Just initialize it to 0 to avoid this warning. Link: https://lore.kernel.org/r/20230524121150.435736-2-hverkuil-cisco@xs4all.nl Signed-off-by: Hans Verkuil Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 625ac9af384481e8644e0653a4aa472aa95f0395 Author: Uwe Kleine-König Date: Wed May 24 16:16:43 2023 +0100 media: atomisp: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Link: https://lore.kernel.org/r/20230524151646.486847-3-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 71c2ac9a2a3da9ba986d3f9e6aa1ffdb04bc5b25 Author: Frank Li Date: Mon May 15 11:01:49 2023 -0400 arm64: dts: imx8mp: Add coresight trace components Add coresight trace components (ETM, ETF, ETB and Funnel). ┌───────┐ ┌───────┐ ┌───────┐ │ CPU0 ├─►│ ETM0 ├─►│ │ └───────┘ └───────┘ │ │ │ │ ┌───────┐ ┌───────┐ │ ATP │ │ CPU1 ├─►│ ETM1 ├─►│ │ └───────┘ └───────┘ │ │ │ FUNNEL│ ┌───────┐ ┌───────┐ │ │ │ CPU2 ├─►│ ETM2 ├─►│ │ └───────┘ └───────┘ │ │ ┌─────┐ ┌─────┐ │ │ │ │ │ │ ┌───────┐ ┌───────┐ │ │ │ M7 │ │ DSP │ │ CPU3 ├─►│ ETM3 ├─►│ │ │ │ │ │ └───────┘ └───────┘ └───┬───┘ └──┬──┘ └──┬──┘ AXI │ │ │ ▲ ▼ ▼ ▼ │ ┌───────────────────────────┐ ┌─────┐ ┌─┴──┐ │ ATP FUNNEL ├──►│ETF ├─► │ETR │ └───────────────────────────┘ └─────┘ └────┘ Signed-off-by: Frank Li Signed-off-by: Shawn Guo commit 4d98580962610e5d41f62e063e759b5bd5f7534a Author: Hans de Goede Date: Tue May 16 21:29:18 2023 +0100 media: atomisp: Allow camera_mipi_info to be NULL camera_mipi_info is an atomisp / atomisp_gmin_platform specific struct, allow mipi_info pointers to be NULL. This is a preparation patch for making atomisp work with standard v4l2 sensor drivers. Link: https://lore.kernel.org/r/20230518153733.195306-9-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit d374e4559127e68c63f07af02153df37c42989bd Author: Hans de Goede Date: Mon May 15 14:40:11 2023 +0100 media: atomisp: Move pad linking to atomisp_register_device_nodes() atomisp_register_device_nodes() already iterates over the ports/sensors in a loop and that loop already does not include the TPG input. So we can simply setup the CSI2-port <-> ISP and sensor <-> CSI2-port mediactl-pad links there instead of repeating the loop in atomisp_create_pads_links(), which atomisp_register_device_nodes() used to call later on. Link: https://lore.kernel.org/r/20230518153733.195306-8-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 96f18f25c1f5f8cee04c1b6895e9404ce1651ebc Author: Hans de Goede Date: Sun May 14 21:08:29 2023 +0100 media: atomisp: Delay mapping sensors to inputs till atomisp_register_device_nodes() Delay mapping sensors to inputs till atomisp_register_device_nodes() time. There are 2 reasons for this: 1. This guarantees a stable input order independent of the sensor probe order. 2. This is a preparation patch for v4l2-async sensor probing support. Link: https://lore.kernel.org/r/20230518153733.195306-7-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit a6af62dd0ddfcc366f371762fa9dca9d8dbb4993 Author: Xu Yang Date: Tue Apr 18 18:29:10 2023 +0800 arm64: dts: imx93: add ddr performance monitor node Add performance monitor. Signed-off-by: Xu Yang Signed-off-by: Shawn Guo commit 5b9ca47a258871739d60476afafd77519bcc59ee Author: Hans de Goede Date: Sun May 14 20:37:00 2023 +0100 media: atomisp: Store number of sensor lanes per port in struct atomisp_device Store number of sensor lanes per port in struct atomisp_device. This is a preparation patch for adding v4l2-async sensor probing support. With async probing the inputs will get registered later, but we can already fill the sensor_lanes array when parsing the fwnodes. Link: https://lore.kernel.org/r/20230518153733.195306-6-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 64be20708a4b51661ae6d2dd4cc0d7bec4116d12 Author: Hans de Goede Date: Tue May 16 21:36:14 2023 +0100 media: atomisp: Rename __get_mipi_port() to atomisp_port_to_mipi_port() Rename __get_mipi_port() to atomisp_port_to_mipi_port(), this is not a private (not static) function so its name should be properly prefixed. While at is also cleanup the weird handling of ATOMISP_CAMERA_PORT_TERTIARY this seems to be a left over from when the driver also supported CSI receivers with only 2 ports, but those are not supported by the current code base, so this can be cleaned up now. Link: https://lore.kernel.org/r/20230518153733.195306-5-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 45b4ab382a9ef7ff8dc62f6625601879ba8af4c0 Author: Hans de Goede Date: Mon May 15 19:08:05 2023 +0100 media: atomisp: Remove atomisp_video_init() parametrization Now that we only have a single /dev/video# node it is no longer necessary for atomisp_video_init() to be parametrized. Remove its parameters and while at it also change the name from the single /dev/video# node from "ATOMISP ISP PREVIEW output" to "ATOMISP video output". Link: https://lore.kernel.org/r/20230518153733.195306-4-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 9af6100f4ff55bc3295803c58f535363e3693b38 Author: Hans de Goede Date: Sun May 14 19:59:13 2023 +0100 media: atomisp: Remove unused fields from struct atomisp_input_subdev Remove unused fields from struct atomisp_input_subdev: 1. frame_size is never used at all 2. sensor_index is always 0, just directly pass 0 in the single user. Link: https://lore.kernel.org/r/20230518153733.195306-3-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 53c5692e7a3c8e8eed3ec6b876a3c982d217a5d7 Author: Philip Yang Date: Thu Jan 26 18:50:09 2023 -0500 drm/amdkfd: Alloc memory of GPU support memory partition For dGPU mode VRAM allocation, create amdgpu_bo from amdgpu_vm->mem_id, to alloc from the correct memory range. For APU mode VRAM allocation, set alloc domain to GTT, and set bp->mem_id_plus1 from amdgpu_vm->mem_id + 1 to create amdgpu_bo, to allocate system memory from correct NUMA node. For GTT allocation, use mem_id -1 to allocate system memory from any NUMA nodes. Remove amdgpu_ttm_tt_set_mem_pool, to avoid the confusion that memory maybe allocated from different mem_id. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit f24e924b7e8aba7b62671e7e1a19d83301a08597 Author: Philip Yang Date: Thu Jan 26 18:25:28 2023 -0500 drm/amdgpu: Add memory partition mem_id to amdgpu_bo Add mem_id_plus1 parameter to amdgpu_gem_object_create and pass it to amdgpu_bo_create. For dGPU mode allocation, mem_id is used by VRAM manager to get the memory partition fpfn, lpfn from xcp manager. For APU native mode allocation, mem_id is used to get NUMA node id from xcp manager, then pass to TTM as numa pool id to alloc memory from the specific NUMA node. mem_id -1 means for entire VRAM or any NUMA nodes. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 1ad997e83110d57af7dca8ccbb490e6c634ba46e Author: Hans de Goede Date: Sun May 14 19:51:28 2023 +0100 media: atomisp: Drop MRFLD_PORT_NUM define The info in the MRFLD_PORT_NUM define is duplicate with the ATOMISP_CAMERA_NR_PORTS and N_MIPI_PORT_ID enum values. Drop the MRFLD_PORT_NUM define and switch to N_MIPI_PORT_ID since the [sensor_]lanes arrays are in enum mipi_port_id order. Link: https://lore.kernel.org/r/20230518153733.195306-2-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 4c6ce75fdd628c43aea11448ed41b52119dae42b Author: Philip Yang Date: Thu Jan 26 18:11:29 2023 -0500 drm/amdkfd: Show KFD node memory partition info Show KFD node memory partition id and size, add helper function KFD_XCP_MEMORY_SIZE to get kfd node memory size, will be used later to support memory accounting per partition. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 934deb64fdf220d2caf978d22615bcc7c9f6897e Author: Philip Yang Date: Thu Feb 23 19:58:22 2023 -0500 drm/amdgpu: Add memory partition id to amdgpu_vm If xcp_mgr is initialized, add mem_id to amdgpu_vm structure to store memory partition number when creating amdgpu_vm for the xcp. The xcp number is decided when opening the render device, for example /dev/dri/renderD129 is xcp_id 0, /dev/dri/renderD130 is xcp_id 1. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a476c0c645535cc0361938becb440b4239996079 Author: Philip Yang Date: Thu Feb 23 11:03:37 2023 -0500 drm/amdkfd: Store drm node minor number for kfd nodes From KFD topology, application will find kfd node with the corresponding drm device node minor number, for example if partition drm node starts from /dev/dri/renderD129, then KFD node 0 with store drm node minor number 129. Application will open drm node /dev/dri/renderD129 to create amdgpu vm for kfd node 0 with the correct vm->mem_id to indicate the memory partition. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit d26ea1b346e71c07aa00956c32fe2d2dbec068ec Author: Philip Yang Date: Fri Mar 3 19:45:45 2023 -0500 drm/amdgpu: Add xcp manager num_xcp_per_mem_partition Used by KFD to check memory limit accounting. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3e7c6fe38724eab767033f9d26b496bc2e815157 Author: James Zhu Date: Mon Aug 15 17:21:44 2022 -0400 drm/amdgpu: update ref_cnt before ctx free Update ref_cnt before ctx free. Signed-off-by: James Zhu Acked-by: Lijo Lazar Signed-off-by: Alex Deucher commit 9a18292d41ae201333fc4203b3e7987ce5c1de6e Author: James Zhu Date: Mon Aug 15 17:15:02 2022 -0400 drm/amdgpu: run partition schedule if it is supported Run partition schedule if it is supported during ctx init entity. Signed-off-by: James Zhu Acked-by: Lijo Lazar Signed-off-by: Alex Deucher commit cd7d8400aa04ba989a87949cf4611b7e16af274f Author: James Zhu Date: Mon Aug 15 17:00:54 2022 -0400 drm/amdgpu: add partition schedule for GC(9, 4, 3) Implement partition schedule for GC(9, 4, 3). Signed-off-by: James Zhu Acked-by: Lijo Lazar Signed-off-by: Alex Deucher commit c30e326e488ec43f6b0931f16ddba16a3370ed4a Author: James Zhu Date: Mon Aug 15 17:12:01 2022 -0400 drm/amdgpu: keep amdgpu_ctx_mgr in ctx structure Keep amdgpu_ctx_mgr in ctx structure to track fpriv. v2: add missing fpriv declaration lost in rebase Signed-off-by: James Zhu Acked-by: Lijo Lazar Signed-off-by: Alex Deucher commit d425c6f48b189f0a5a7c7d26980fd7a2114fb35d Author: James Zhu Date: Mon Aug 15 17:19:11 2022 -0400 drm/amdgpu: add partition scheduler list update Add partition scheduler list update in late init and xcp partition mode switch. Signed-off-by: James Zhu Acked-by: Lijo Lazar Signed-off-by: Alex Deucher commit 0a9115fd952a5de27dc360dc0c4618b6a1846c58 Author: James Zhu Date: Mon Aug 15 16:55:02 2022 -0400 drm/amdgpu: update header to support partition scheduling Update header to support partition scheduling. Signed-off-by: James Zhu Acked-by: Lijo Lazar Signed-off-by: Alex Deucher commit 797a0a142ca7f3b823ae1032983111c055bc50fb Author: James Zhu Date: Mon Aug 15 16:45:12 2022 -0400 drm/amdgpu: add partition ID track in ring Keep track partition ID in ring. Signed-off-by: James Zhu Acked-by: Lijo Lazar Signed-off-by: Alex Deucher commit 1bb2a551e65bf35928432d1837e6d9287361704e Author: Hans de Goede Date: Thu May 18 15:33:34 2023 +0100 media: atomisp: gc0310: Remove gc0310.h Remove the gc0310.h header file, moving most of its content into atomisp-gc0310.c and dropping some unused parts. This brings the gc0310 sensor driver inline with other sensor regular / non atomisp sensor drivers which usually only are one single .c file. Link: https://lore.kernel.org/r/20230518153214.194976-9-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit be3800f57c3b0fb39dc732345279db76a50559a3 Author: James Zhu Date: Tue Feb 28 14:16:38 2023 -0500 drm/amdgpu: find partition ID when open device Find partition ID when open device from render device minor. Signed-off-by: Christian König Signed-off-by: James Zhu Reviewed-and-tested-by: Philip Yang Signed-off-by: Alex Deucher commit 2c1c7ba457d4ecf475c0e220ac5359971355c6eb Author: James Zhu Date: Mon Aug 15 16:55:02 2022 -0400 drm/amdgpu: support partition drm devices Support partition drm devices on GC_HWIP IP_VERSION(9, 4, 3). This is a temporary solution and will be superceded. Signed-off-by: Christian König Signed-off-by: James Zhu Reviewed-and-tested-by: Philip Yang Signed-off-by: Alex Deucher commit f5e381ffb6fdd021f2a1c0172dce486f647746c6 Author: Hans de Goede Date: Thu May 18 15:19:14 2023 +0100 media: atomisp: gc0310: Remove gc0310_s_config() function gc0310_s_config() used to call camera_sensor_platform_data.csi_cfg() back when the gc0310 driver was still using the atomisp_gmin_platform code for power-management. Now it is just a weirdly named wrapper around gc0310_detect(), drop gc0310_s_config() and make probe() call gc0310_detect() directly. Link: https://lore.kernel.org/r/20230518153214.194976-8-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit b9cbd51000ad3541351ca832b00600870ac08e5c Author: Graham Sider Date: Mon Mar 6 17:56:44 2023 -0500 drm/amdgpu/bu: update mtype_local parameter settings Update mtype_local module parameter to use MTYPE_RW by default. 0: MTYPE_RW (default) 1: MTYPE_NC 2: MTYPE_CC Signed-off-by: Graham Sider Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit 76eb9c95a409ea820b2e7c968c220e7a38f27d76 Author: David Francis Date: Mon Feb 27 10:33:11 2023 -0500 drm/amdgpu/bu: add mtype_local as a module parameter Selects the MTYPE to be used for local memory, (0 = MTYPE_CC (default), 1 = MTYPE_NC, 2 = MTYPE_RW) v2: squash in build fix (Alex) Reviewed-by: Graham Sider Signed-off-by: David Francis Signed-off-by: Alex Deucher commit 352b919c1e5ff50c71d665395b27acbd1bf23a05 Author: Felix Kuehling Date: Tue Feb 21 17:44:18 2023 -0500 drm/amdgpu: Override MTYPE per page on GFXv9.4.3 APUs On GFXv9.4.3 NUMA APUs, system memory locality must be determined per page to choose the correct MTYPE. This patch adds a GMC callback that can provide this per-page override and implements it for native mode. Carve-out mode is not yet supported and will use the safe default (remote) MTYPE for system memory. Signed-off-by: Felix Kuehling Reviewed-by: Philip Yang Reviewed-and-tested-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 1e4a00334add40f609162914af7a24bc92951008 Author: Felix Kuehling Date: Tue Feb 21 17:31:32 2023 -0500 drm/amdgpu: Fix per-BO MTYPE selection for GFXv9.4.3 Treat system memory on NUMA systems as remote by default. Overriding with a more efficient MTYPE per page will be implemented in the next patch. No need for a special case for APP APUs. System memory is handled the same for carve-out and native mode. And VRAM doesn't exist in native mode. Signed-off-by: Felix Kuehling Reviewed-by: Philip Yang Reviewed-and-tested-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 895797d9193b38e759bc01268a8e3887e521f682 Author: Graham Sider Date: Mon Feb 6 14:04:42 2023 -0500 drm/amdgpu/bu: Add use_mtype_cc_wa module param By default, set use_mtype_cc_wa to 1 to set PTE coherence flag MTYPE_CC instead of MTYPE_RW by default. This is required for the time being to mitigate a bug causing XCCs to hit stale data due to TCC marking fully dirty lines as exclusive. Signed-off-by: Graham Sider Reviewed-by: Joseph Greathouse Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2e8cc5d317d12f7fb4f66361a3ce5427f0abe2cd Author: Graham Sider Date: Wed Feb 8 11:10:57 2023 -0500 drm/amdgpu: Use legacy TLB flush for gfx943 Invalidate TLBs via a legacy flush request (flush_type=0) prior to the heavyweight flush requests (flush_type=2) in gmc_v9_0.c. This is temporarily required to mitigate a bug causing CPC UTCL1 to return stale translations after invalidation requests in address range mode. v2: squash in long term fix "drm/amdgpu: disable extra gfx943 legacy flush on rev1+" Signed-off-by: Graham Sider Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit f915f3af9984464c308787102990d85d4e988d2c Author: Harish Kasiviswanathan Date: Fri Apr 28 14:20:00 2023 -0400 drm/amdgpu: For GFX 9.4.3 APU fix vram_usage value For GFX 9.4.3 APP APU VRAM is allocated in GTT domain. While freeing memory check for GTT domain instead of VRAM if it is APP APU Signed-off-by: Harish Kasiviswanathan Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit fc021438d0ab7863dc93f84a557af6dc6255b881 Author: Philip Yang Date: Wed Apr 19 17:43:26 2023 -0400 drm/amdgpu: Enable NPS4 CPX mode CPX compute mode is valid mode for NPS4 memory partition mode. Signed-off-by: Philip Yang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 610dab118ff5013d46069c828b58d576e0907b66 Author: Philip Yang Date: Fri Mar 31 11:13:40 2023 -0400 drm/amdkfd: Move pgmap to amdgpu_kfd_dev structure VRAM pgmap resource is allocated every time when switching compute partitions because kfd_dev is re-initialized by post_partition_switch, As a result, it causes memory region resource leaking and system memory usage accounting unbalanced. pgmap resource should be allocated and registered only once when loading driver and freed when unloading driver, move it from kfd_dev to amdgpu_kfd_dev. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 00e1ab02c2ba31b2bd446979949193eb3ca2561c Author: Lijo Lazar Date: Fri Mar 24 15:21:30 2023 +0530 drm/amdgpu: Skip halting RLC on GFX v9.4.3 RLC-PMFW handshake happens periodically when GFXCLK DPM is enabled and halting RLC may cause unexpected results. Avoid halting RLC from driver side. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 1e91a5f79110b96baf7ad21d3c7b5c3e18cdf2a5 Author: Lijo Lazar Date: Thu Mar 16 14:59:27 2023 +0530 drm/amdgpu: Fix register accesses in GFX v9.4.3 Access registers with the right xcc id. Also, remove the unused logic as PG is not used in GFX v9.4.3 Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 3697b9bd7c69910cb6543d8441211ecfb2f013ca Author: Mukul Joshi Date: Wed Mar 15 14:04:33 2023 -0400 drm/amdkfd: Increase queue number per process to 255 on GFX9.4.3 Increase the maximum number of queues that can be created per process to 255 on GFX 9.4.3. There is no HWS limitation restricting the number queues that can be created. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9b337b7d628a5e97b4dd72bb1d75f1716567b416 Author: Hawking Zhang Date: Mon Mar 20 17:51:30 2023 +0800 drm/amdgpu: Adjust the sequence to query ras error info It turns out STATUS_VALID_FLAG needs to be checked ahead of any other fields. ADDRESS_VALID_FLAG and ERR_INFO_VALID_FLAG only manages ADDRESS and ERR_INFO field respectively. driver should continue poll ERR CNT field even ERR_INFO_VALD_FLAG is not set. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 35d54e21e002198c13647b6cd8c77586f683cf39 Author: Hawking Zhang Date: Mon Mar 6 11:03:27 2023 +0800 drm/amdgpu: Initialize jpeg v4_0_3 ras function Initialize jpeg v4_0_3 ras function. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 570df4bca6187f493a1315a7373d7eb1285b3e86 Author: Hawking Zhang Date: Thu Mar 2 18:04:24 2023 +0800 drm/amdgpu: Add reset_ras_error_count for jpeg v4_0_3 Add reset_ras_error_count callback for jpeg v4_0_3. It will be used to reset jpeg ras error count. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 41e491d8b606ea55b7234967f802cec8e6d77952 Author: Hawking Zhang Date: Thu Mar 2 17:56:59 2023 +0800 drm/amdgpu: Add query_ras_error_count for jpeg v4_0_3 Add query_ras_error_count callback for jpeg v4_0_3. It will be used to query and log jpeg error count. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 85f23b0a8ce31f1e22d7bfb4666b4a7830563347 Author: Hawking Zhang Date: Thu Mar 2 16:38:38 2023 +0800 drm/amdgpu: Re-enable VCN RAS if DPG is enabled VCN RAS enablement sequence needs to be added in DPG HW init sequence. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit c3f05ab8c40f8a5a8576e3d936cff450a39b0360 Author: Hawking Zhang Date: Mon Mar 6 11:00:11 2023 +0800 drm/amdgpu: Initialize vcn v4_0_3 ras function Initialize vcn v4_0_3 ras function Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 6d39fa3fc802e511241898a6890a9b2ec7f958e3 Author: Hawking Zhang Date: Thu Mar 2 14:23:47 2023 +0800 drm/amdgpu: Add reset_ras_error_count for vcn v4_0_3 Add reset_ras_error_count callback for vcn v4_0_3. It will be used to reset vcn ras error count. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 5e1e227fb7cbea2624b4b9375a9b888d02fed4f5 Author: Hawking Zhang Date: Wed Mar 1 20:37:56 2023 +0800 drm/amdgpu: Add query_ras_error_count for vcn v4_0_3 Add query_ras_error_count callback for vcn v4_0_3. It will be used to query and log vcn error count. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 6c2bebfca43c14967cfb9cf6c2c074b0d755ddd7 Author: Hawking Zhang Date: Wed Mar 1 10:05:17 2023 +0800 drm/amdgpu: Add vcn/jpeg ras err status registers Add new ras error status registers introduced in vcn v4_0_3 to log vcn and jpeg ras error. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 63558464ad4dc25dc012d67d5f1e9fad8abcc28a Author: Hans de Goede Date: Thu May 18 13:48:34 2023 +0100 media: atomisp: gc0310: Cleanup includes Remove a bunch of unused includes and sort the remainging includes alphabetically. Link: https://lore.kernel.org/r/20230518153214.194976-7-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit b4520bfd801338c48d887f0eec74a53ab80f2167 Author: Gavin Wan Date: Fri Mar 17 18:42:30 2023 -0400 drm/amdgpu: Checked if the pointer NULL before use it. For SRIOV on some parts, the host driver does not post VBIOS. So the guest cannot get bios information. Therefore, adev->virt.fw_reserve.p_pf2vf and adev->mode_info.atom_context are NULL. Signed-off-by: Gavin Wan Reviewed-by: Zhigang Luo Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit 46f7b4deb30558593c1d2e62d561a3cee21f558a Author: Gavin Wan Date: Mon Apr 10 15:04:26 2023 -0400 drm/amdgpu: Set memory partitions to 1 for SRIOV. For SRIOV, the memory partitions are set on host drover. Each VF only has one memory partition. We need set the memory partitions to 1 on guest driver for SRIOV. V2: sqaush in fix ("drm/amdgpu: Fix memory range info of GC 9.4.3 VFs") Signed-off-by: Gavin Wan Acked-by: Zhigang Luo Signed-off-by: Alex Deucher commit b0a3bbf947f6ed690336cec1f6cde2a30d082dbb Author: Gavin Wan Date: Mon Apr 3 17:49:41 2023 -0400 drm/amdgpu: Skip using MC FB Offset when APU flag is set for SRIOV. The MC_VM_FB_OFFSET is PF only register. It cannot be read on VF. So, the driver should not use MC_VM_FB_OFFSET address to set the address of dev->gmc.aper_base. Signed-off-by: Gavin Wan Reviewed-by: Zhigang Luo Signed-off-by: Alex Deucher commit 63630c9e5c3481c51ac3b4ee058628a01ac91ba8 Author: Gavin Wan Date: Thu Mar 16 13:44:41 2023 -0400 drm/amdgpu: Add PSP supporting PSP 13.0.6 SRIOV ucode init. Add PSP supporting PSP 13.0.6 SRIOV ucode init. Signed-off-by: Gavin Wan Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit ba08e9cb6ff87acdb2f28f013fe695a252533f0e Author: Lijo Lazar Date: Fri Mar 10 15:38:19 2023 +0530 drm/amdgpu: Add PSP spatial parition interface Add PSP ring command interface for spatial partitioning. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b6b85c8b43a85988ecd06f039f8f90c041842812 Author: Lijo Lazar Date: Tue Mar 7 10:36:08 2023 +0530 drm/amdgpu: Return error on invalid compute mode Return error if an invalid compute partition mode is requested. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit f9632096be49ed31e86541e3e79960e21e8f1578 Author: Lijo Lazar Date: Tue Mar 7 10:33:05 2023 +0530 drm/amdgpu: Add compute mode descriptor function Keep a helper function to get description of compute partition mode. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit a0ba127960982b8827ba8b410c272ec8f3ee7e6a Author: Lijo Lazar Date: Fri Mar 3 18:03:00 2023 +0530 drm/amdgpu: Fix unmapping of aperture When aperture size is zero, there is no mapping done. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e181be58ccc2ac48e4b79996c8dd6dd9f34fa4b5 Author: Rajneesh Bhardwaj Date: Mon Feb 27 13:17:14 2023 -0500 drm/amdgpu: Fix xGMI access P2P mapping failure on GFXIP 9.4.3 On GFXIP 9.4.3, we dont need to rely on xGMI hive info to determine P2P access. Reviewed-by: Felix Kuehling Acked-and-tested-by: Mukul Joshi Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit fcfefd85f18a0004c7c7b499f0701fd2c76d4c68 Author: Rajneesh Bhardwaj Date: Mon Feb 27 20:08:29 2023 -0500 drm/amdkfd: Native mode memory partition support For native mode, after amdgpu_bo is created on CPU domain, then call amdgpu_ttm_tt_set_mem_pool to select the TTM pool using bo->mem_id. ttm_bo_validate will allocate the memory to the correct memory partition before mapping to GPUs. Reviewed-by: Felix Kuehling Acked-and-tested-by: Mukul Joshi Signed-off-by: Philip Yang Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 1e03322cfef9b83aa87ea0a508588f9f05a47dfc Author: Philip Yang Date: Mon Feb 27 11:16:09 2023 -0500 drm/amdgpu: Set TTM pools for memory partitions For native mode only, create TTM pool for each memory partition to store the NUMA node id, then the TTM pool will be selected using memory partition id to allocate memory from the correct partition. Acked-by: Christian König (rajneesh: changed need_swiotlb and need_dma32 to false for pool init) Reviewed-by: Felix Kuehling Acked-and-tested-by: Mukul Joshi Signed-off-by: Philip Yang Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 6b43e1a05cb764196c5158b2447a9bfad1f2b531 Author: Rajneesh Bhardwaj Date: Mon Feb 13 23:51:07 2023 -0500 drm/ttm: export ttm_pool_fini for cleanup ttm_pool_init is exported and used outside of ttm subsystem with amdgpu_ttm interface, similarly export ttm_pool_fini for proper cleanup. Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 570de94b9c5d93e1c5bc4e357946efb93c662da9 Author: Lijo Lazar Date: Mon Feb 13 19:26:18 2023 +0530 drm/amdgpu: Add auto mode for compute partition When auto mode is specified, driver will choose the right compute partition mode. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit 1589c82a10852c6de742e5d6a92042a3fd68d753 Author: Lijo Lazar Date: Mon Feb 13 18:50:07 2023 +0530 drm/amdgpu: Check memory ranges for valid xcp mode Check the memory ranges available to the device also for deciding a valid partition mode. Only select combinations are valid for a particular mode. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit c4050ff1a43eec08498b1ed876efc6213592dba0 Author: Lijo Lazar Date: Thu Feb 9 16:30:53 2023 +0530 drm/amdkfd: Use xcc mask for identifying xcc Instead of start xcc id and number of xcc per node, use the xcc mask which is the mask of logical ids of xccs belonging to a parition. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit a75f2271a4936265c8a189ab06f9eb89e343b441 Author: Lijo Lazar Date: Thu Feb 9 14:44:13 2023 +0530 drm/amdkfd: Add xcp reference to kfd node Fetch xcp information from xcp_mgr and also add xcc_mask to kfd node. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit e47947abb9e71176ea2d9c8f55e03134dabd2605 Author: Lijo Lazar Date: Fri Feb 3 18:46:40 2023 +0530 drm/amdgpu: Move initialization of xcp before kfd After partition switch, fill all relevant xcp information before kfd starts initialization. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 2746a966f9f05fdb0727f4e1e8f2d51ec79e071d Author: Hans de Goede Date: Thu May 18 15:15:07 2023 +0100 media: atomisp: gc0310: Fix double free in gc0310_remove() gc0310_remove() must not call kfree(dev) since the gc0310_device struct is devm managed so explicitly freeing it causes a double free. While at it add a missing mutex_destroy() call for the input_lock. Link: https://lore.kernel.org/r/20230518153214.194976-6-hdegoede@redhat.com Fixes: 340b4dd6c183 ("media: atomisp: gc0310: Use devm_kzalloc() for data struct") Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 15e3eee8d3939d1f28cd314a5db2590ab94109d6 Author: Lijo Lazar Date: Fri Feb 3 17:14:12 2023 +0530 drm/amdgpu: Fill xcp mem node in aquavanjaram Implement callbacks to fill memory node information in aquavanjaram. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit da539b213d7952741499283636f70406383b9570 Author: Lijo Lazar Date: Fri Feb 3 17:12:10 2023 +0530 drm/amdgpu: Add callback to fill xcp memory id Add callback in xcp interface to fill xcp memory id information. Memory id is used to identify the range/partition of an XCP from the available memory partitions in device. Also, fill the id information. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit a433f1f59484fba7a7743a3c5a5f320d9e828b3a Author: Lijo Lazar Date: Tue Feb 14 14:45:45 2023 +0530 drm/amdgpu: Initialize memory ranges for GC 9.4.3 GC 9.4.3 ASICS may have memory split into multiple partitions.Initialize the memory partition information for each range. The information may be in the form of a numa node id or a range of pages. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 14493cb99b71dbaff58dc0dc0b2cc0a56a88ef05 Author: Lijo Lazar Date: Tue Feb 14 14:37:53 2023 +0530 drm/amdgpu: Add memory partitions to gmc Some ASICs have the device memory divided into multiple partitions. The parititions could be denoted by a numa node or by a range of pages. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit fa0497c34eb7dd9db9a09963917382e924c3fbc5 Author: Lijo Lazar Date: Tue Feb 14 18:59:40 2023 +0530 drm/amdgpu: Add API to get numa information of XCC Add interface to get numa information of ACPI XCC object. The interface uses logical id to identify an XCC. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 1cc823011a23fa0e3497e9f6655172b2507ce2cd Author: Lijo Lazar Date: Tue Feb 14 18:33:51 2023 +0530 drm/amdgpu: Store additional numa node information Use a struct to store additional numa node information including size and base address. Add numa_info pointer to xcc object to point to the relevant structure based on its proximity domain. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 0f2e1d620eca56c4ceebc041aabb1eda26b2cfd0 Author: Lijo Lazar Date: Fri Feb 17 09:32:44 2023 +0530 drm/amdgpu: Get supported memory partition modes Expand the interface to get supported memory partition modes also along with the current memory partition mode. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit b6f90baafe267a0705c5d9b1429c875d3c39fbc7 Author: Lijo Lazar Date: Tue Jan 31 12:39:49 2023 +0530 drm/amdgpu: Move memory partition query to gmc GMC block handles memory related information, it makes more sense to keep memory partition functions in gmc block. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 4bdca2057933ef08a2ca7f44e30a8894ff78c472 Author: Lijo Lazar Date: Wed Jan 25 20:04:52 2023 +0530 drm/amdgpu: Add utility functions for xcp Add utility functions to get details of xcp and iterate through available xcps. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit db3b5cb64a9ca301d14ed027e470834316720e42 Author: Lijo Lazar Date: Fri Feb 24 18:01:38 2023 +0530 drm/amdgpu: Use apt name for FW reserved region Use the generic term fw_reserved_memory for FW reserve region. This region may also hold discovery TMR in addition to other reserve regions. This region size could be larger than discovery tmr size, hence don't change the discovery tmr size based on this. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit d6748385098a8333a0e1c7e2d77119c919776728 Author: Ian Rogers Date: Mon Jun 5 13:34:25 2023 -0700 tools headers: Make the difference output easier to read Add failures to an array and display it before exiting. Before: Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h' diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/perf_regs.h' differs from latest version at 'arch/arm64/include/uapi/asm/perf_regs.h' diff -u tools/arch/arm64/include/uapi/asm/perf_regs.h arch/arm64/include/uapi/asm/perf_regs.h Warning: Kernel ABI header at 'tools/arch/arm64/include/asm/cputype.h' differs from latest version at 'arch/arm64/include/asm/cputype.h' diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h ... After: Warning: Kernel ABI header differences: diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h diff -u tools/arch/arm64/include/uapi/asm/perf_regs.h arch/arm64/include/uapi/asm/perf_regs.h diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h ... The aim is to make the warnings easier to read and distinguish from other Makefile warnings messages. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230605203425.1696844-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit bc71daff4f147377674e14589fb651bb36f44d4b Author: Lijo Lazar Date: Thu Feb 23 20:13:56 2023 +0530 drm/amdgpu: Use GPU VA space for IH v4.4.2 in APU For IH ring buffer and read/write pointers, use GPU VA space rather than Guest PA on APU configs. Access through Guest PA doesn't work when IOMMU is enabled. It is also beneficial in NUMA configs as it allocates from the closest numa pool in a numa enabled system. Signed-off-by: Lijo Lazar Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit 672c883c26c68fe49b161d7ceab94bdc69e57b0e Author: Lijo Lazar Date: Mon Feb 20 12:04:30 2023 +0530 drm/amdgpu: Simplify aquavanjram instance mapping Simplify so as to use the same sequence to assign logical to physical ids for all IPs. Signed-off-by: Lijo Lazar Acked-by: Leo Liu Tested-by: James Zhu Signed-off-by: Alex Deucher commit a3edd1ac706243fe5ca1c0925ce120b5a2661975 Author: Lijo Lazar Date: Wed Mar 8 12:41:22 2023 +0530 drm/amdgpu/vcn: Use buffer object's deletion logic VCN DPG buffer object is intialized to NULL. If allotted, buffer object deletion logic will take care of NULL check and delete accordingly. This is useful for cases where indirect sram flag could be manipulated later after buffer allocation. Signed-off-by: Lijo Lazar Reviewed-by: Christian König Signed-off-by: Alex Deucher commit e7947c021a8b394677ab875288565d4dfcac779a Author: Sonny Jiang Date: Fri Mar 24 17:44:59 2023 -0400 drm/amdgpu: Use a different value than 0xDEADBEEF for jpeg ring test The 0xDEADBEEF standard anti-hang value. Use it may cause fake pass. Signed-off-by: Sonny Jiang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 96e693ad78a0778efb5256684a2f3712298f3e18 Author: Sonny Jiang Date: Tue Mar 28 13:19:11 2023 -0400 drm/amdgpu: Add a read after write DB_CTRL for vcn_v4_0_3 To make sure VCN DB_CTRL is delivered before doorbell write. Signed-off-by: Sonny Jiang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 55ff23d9eb814dce8393a4c471259ded5a85d461 Author: Sonny Jiang Date: Wed Mar 22 15:49:29 2023 -0400 drm/amdgpu: fixes a JPEG get write/read pointer bug Need parentheses for the micro parameters. Signed-off-by: Sonny Jiang Reviewed-by: David (Ming Qiang) Wu Signed-off-by: Alex Deucher commit 26dc0448ef36ba83be43a7c4da94d55ec626db1a Author: Sonny Jiang Date: Mon Mar 20 16:17:21 2023 -0400 drm/amdgpu: A workaround for JPEG_v4_0_3 ring test fail The jpeg_v4_0_3 jpeg_pitch register uses UVD_JRBC_SCRATCH0. It needs to move WREG() to after jpeg_start. Switch to a posted register write when doing the ring test to make sure the register write lands before we test the result. Signed-off-by: Sonny Jiang Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 358e6c38300b7d2b7d7122d4fe485d8a4580dc1e Author: James Zhu Date: Wed Mar 15 04:09:25 2023 -0400 drm/amdgpu: use physical AID index for ring name Use physical AID index for VCN/JPEG ring name instead of logical AID index. Signed-off-by: James Zhu Reviewed-by: Sonny Jiang Signed-off-by: Alex Deucher commit d3e53452b0f4cdd210432a268cabdbf65e98ddab Author: James Zhu Date: Wed Mar 15 03:54:55 2023 -0400 drm/amdgpu/vcn: use dummy register selects AID for VCN_RAM ucode Use dummy register 0xDEADBEEF selects AID for PSP VCN_RAM ucode. Signed-off-by: James Zhu Reviewed-by: Sonny Jiang Signed-off-by: Alex Deucher commit 6a944ccbf5f5059de1a9b3d48971a50cb5857ebf Author: Lijo Lazar Date: Mon Feb 27 16:07:39 2023 +0530 drm/amdgpu: Fix harvest reporting of VCN Use VCN instance mask to check if an instance is harvested or not. Signed-off-by: Lijo Lazar Reviewed-by: James Zhu Signed-off-by: Alex Deucher commit fd91d38b5275959a5b0804d4b4dbc5a4c0a8aac9 Author: Lijo Lazar Date: Fri Feb 17 19:41:06 2023 +0530 drm/amdgpu: Use logical ids for VCN/JPEG v4.0.3 Address VCN/JPEG instances using logical ids. Whenever register access is required, get the physical instance using GET_INST. Signed-off-by: Lijo Lazar Acked-by: Leo Liu Tested-by: James Zhu Signed-off-by: Alex Deucher commit b541a91793fe124b199dc734aa5d7712d2993f06 Author: Namhyung Kim Date: Wed May 24 13:50:54 2023 -0700 perf annotate: Remove x86 instructions with suffix Now the suffix is handled in the general code. Let's get rid of them. Reviewed-by: Adrian Hunter Reviewed-by: Masami Hiramatsu Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230524205054.3087004-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d0b35979986e3bd03cb2f2e887e0b8036ae06198 Author: Namhyung Kim Date: Wed May 24 13:50:53 2023 -0700 perf annotate: Handle x86 instruction suffix generally In AT&T asm syntax, most of x86 instructions can have size suffix like b, w, l or q. Instead of adding all these instructions in the table, we can handle them in a general way. For example, it can try to find an instruction as is. If not found, assuming it has a suffix and it'd try again without the suffix if it's one of the allowed suffixes. This way, we can reduce the instruction table size for duplicated entries of the same instructions with a different suffix. If an instruction xyz and others like xyz are completely different ones, then they both need to be listed in the table so that they can be found before the second attempt (without the suffix). Reviewed-by: Adrian Hunter Reviewed-by: Masami Hiramatsu Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230524205054.3087004-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 07bc0ac8ff49c9868a66526634fbc21cb194afca Author: Lijo Lazar Date: Fri Feb 17 18:44:20 2023 +0530 drm/amdgpu: Add VCN logical to physical id mapping Add mappings for logical to physical id for VCN/JPEG 4.0.3 v2: make local function static (Alex) Signed-off-by: Lijo Lazar Acked-by: Leo Liu Tested-by: James Zhu Signed-off-by: Alex Deucher commit aaf1090a6cb66e8b6d9da63ee983604a7eca8ffd Author: Lijo Lazar Date: Fri Feb 17 18:27:51 2023 +0530 drm/amdgpu: Add instance mask for VCN and JPEG Keep an instance mask formed by physical instance numbers for VCN and JPEG IPs. Populate the mask from discovery table information. Signed-off-by: Lijo Lazar Acked-by: Leo Liu Tested-by: James Zhu Signed-off-by: Alex Deucher commit 76d2d7d6afae2fe5bd7f8e441e9944c6ac8f10dc Author: Hans de Goede Date: Thu May 18 13:43:45 2023 +0100 media: atomisp: gc0310: Drop XXGC0310 ACPI hardware-id The XXGC0310 ACPI hardware-id does not appear to be used in the DSDTs of any hardware out there, so drop it. Link: https://lore.kernel.org/r/20230518153214.194976-5-hdegoede@redhat.com Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 48d19834ea551af2932090ff6de04730007e9876 Author: Sonny Jiang Date: Wed Feb 15 13:56:57 2023 -0500 drm/amdgpu: Load vcn_v4_0_3 ucode during early_init VCN loading ucode is moved to early_init with using 'amdgpu_ucode_*' helpers. Reviewed-by: Leo Liu Signed-off-by: Sonny Jiang Signed-off-by: Alex Deucher commit 5ae0ec8b8045d72467d4e7417b34a5ab2fa72138 Author: Shiwu Zhang Date: Mon Feb 13 15:45:42 2023 +0800 drm/amdgpu: preserve the num_links in case of reflection For topology reflection, each socket to every other socket has the exactly same topology info as the other way around. So it is safe to keep the reflected num_links value otherwise it will be overriden by the link info output of GET_PEER_LINKS command. Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit f2b8447b1f309901c3fdd4045febfe5cab545d87 Author: Lijo Lazar Date: Fri Feb 10 12:05:59 2023 +0530 drm/amdgpu: Fix discovery sys node harvest info Initalize syfs nodes after harvest information is fetched and fetch the correct harvest info based on each IP instance. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 75dda67c7213c3e0d17244a8c42547c27ee746f8 Author: Philip Yang Date: Thu Feb 9 18:23:16 2023 -0500 drm/amdkfd: Flush TLB after unmapping for GFX v9.4.3 kfd_flush_tlb_after_unmap should return true for GFX v9.4.3, to do TLB heavyweight flush after unmapping from GPU to guarantee that the GPU will not access pages after they have been unmapped. This also helps improve the mapping to GPU performance. Without this, KFD accidently flush TLB after mapping to GPU because the vm update sequence number is increased by previous unmapping. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ac772a3c07cad66df46b2781f39121be211d383e Author: Lijo Lazar Date: Mon Jan 30 09:48:39 2023 +0530 drm/amdgpu: Add fallback path for discovery info If SOC doesn't expose dedicated vram, discovery region may be available through system memory. Rename the existing interface to generic read_binary_from_mem and add a fallback path to read from system memory. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 368bb1bcfb3a3bc70793cd347abe0bc60c01d94b Author: Lijo Lazar Date: Mon Jan 30 09:38:09 2023 +0530 drm/amdgpu: Read discovery info from system memory On certain ASICs, discovery info is available at reserved region in system memory. The location is available through ACPI interface. Add API to read discovery info from there. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6e01882267a696b022cfe3473a0d3e5ccbe54010 Author: Lijo Lazar Date: Fri Jan 27 18:40:14 2023 +0530 drm/amdgpu: Add API to get tmr info from acpi In certain configs, TMR information is available from ACPI. Add API to fetch the information. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4d5275ab0b18d17697392aafd93e206e6b9de647 Author: Lijo Lazar Date: Fri Jan 27 18:18:17 2023 +0530 drm/amdgpu: Add parsing of acpi xcc objects Add parsing of ACPI xcc objects and fill in relevant info from them by invoking the DSM methods. Signed-off-by: Lijo Lazar Reviewed-and-tested-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit f4d8b6f5c61ab5e98258bd0072d733741c76bd8d Author: Mukul Joshi Date: Tue Jan 31 11:23:50 2023 -0500 drm/amdkfd: Enable SVM on Native mode This patch enables SVM capability on GFX9.4.3 when run in Native mode. It also sets best_prefetch and best_restore locations to CPU as there is no VRAM. Signed-off-by: Mukul Joshi Acked-by: Rajneesh Bhardwaj Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 01ef47477d05b784ab6ac26fa6878987eda436f1 Author: Lijo Lazar Date: Thu Feb 2 15:13:12 2023 +0530 drm/amdgpu: Add FGCG for GFX v9.4.3 It's not fine grain, behaves similar to MGCG. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 46d79cbf9ac64a5e63f0c85f256ba6400a1f2024 Author: Lijo Lazar Date: Fri Jan 20 15:53:47 2023 +0530 drm/amdgpu: Use transient mode during xcp switch During partition switch, keep the state as transient mode. Fetch the latest state if switch fails. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ded7d99eb5b78931cec30dd49cd4097d0ac770e1 Author: Lijo Lazar Date: Mon Jan 16 10:55:38 2023 +0530 drm/amdgpu: Add flags for partition mode query It's not required to take lock on all cases while querying partition mode. Querying partition mode during KFD init process doesn't need to take a lock. Init process after a switch will already be happening under lock. Control the behaviour by adding flags to xcp_query_partition_mode. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 463e953ea2eda25fbde70e0e72900f5bafeff93c Author: Yang Wang Date: Thu Apr 27 10:36:51 2023 +0800 drm/amd/pm: fix wrong smu socclk value fix typo about smu socclk value. Signed-off-by: Yang Wang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 8f2ccaaa373815ff94223dc2e3f6d53ff2f3ecb3 Author: Lijo Lazar Date: Thu Mar 9 13:04:56 2023 +0530 drm/amdgpu: Add mode-2 reset in SMU v13.0.6 Modifications to mode-2 reset flow for SMU v13.0.6 ASICs. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit 7214c08c168046aadf15e3d731ee673f26c77213 Author: Lijo Lazar Date: Fri Mar 10 11:33:37 2023 +0530 drm/amd/pm: Notify PMFW about driver unload cases On SMU v13.0.6 APUs, FW will need to take some actions if driver is going to halt RLC. Notify PMFW that driver is not going to manage device so that FW takes care of the required actions. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit fe9e5f56feb287b3f14b0a5892061a1da2b89b5b Author: Lijo Lazar Date: Fri Mar 10 18:11:25 2023 +0530 drm/amd/pm: Update PMFW headers for version 85.54 It adds message support for FW notification on driver unload. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit bfb4fd20b3e6997876068f469c14d963b227d896 Author: Asad Kamal Date: Wed Mar 8 22:30:58 2023 +0800 drm/amd/pm: Expose mem temperature for GC version 9.4.3 Add mem temperature as part of hw mon attributes for GC version 9.4.3 Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 250781c5a2e6a0335b85f2342415fe6f1180c6e0 Author: Hans de Goede Date: Tue May 9 21:10:34 2023 +0100 media: atomisp: Set asd.subdev.devnode once from isp_subdev_init_entities() Now that we have only one /dev/video# node we can set asd.subdev.devnode once from isp_subdev_init_entities(), replacing the hack to set it the last opened/closed /dev/video# node from atomisp_open() / atomisp_release(). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 8572fa2aa517d2512abba661ddd5e9a44a893dc9 Author: Asad Kamal Date: Fri Mar 3 12:20:21 2023 +0800 drm/amd/pm: Update hw mon attributes for GC version 9.4.3 Update hw mon attributes for GC Version 9.4.3 to valid ones on APU and Non APU systems v2: Group checks along existing one Added power limit & mclock for gc version 9.4.3 Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 909ae7155faebc62af461924a91071c0b9cc4e39 Author: Lijo Lazar Date: Mon Feb 27 16:51:16 2023 +0530 drm/amd/pm: Initialize power limit for SMU v13.0.6 PMFW will initialize the power limit values even if PPT throttler feature is disabled. Fetch the limit value from FW. Signed-off-by: Lijo Lazar Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit 9661bf687623f628729566cc3c58207c44e56258 Author: Lijo Lazar Date: Tue Feb 21 14:47:51 2023 +0530 drm/amd/pm: Keep interface version in PMFW header Use the interface version directly from PMFW interface header file rather than keeping another definition in common smu13 file. Signed-off-by: Lijo Lazar Reviewed-by: Asad kamal Signed-off-by: Alex Deucher commit 676915e4108f3a8d98944e16e6ce00a6440ac701 Author: Asad kamal Date: Wed Feb 15 15:53:15 2023 +0800 drm/amd/pm: Add ih for SMU v13.0.6 thermal throttling Add interrupt handler for thermal throttler events from PMFW on SMUv13.0.6 Signed-off-by: Asad kamal Acked-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 6d5f5eaf6acf26ce0dc986fe7240dc4a0c981119 Author: Asad kamal Date: Mon Feb 13 19:52:56 2023 +0800 drm/amd/pm: Update pmfw header files for SMU v13.0.6 Update driver interface for SMU v13.0.6 to be compatible with PMFW v85.48 version Signed-off-by: Asad kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit a1b0dafafca414cf8b3a51225215a21df2b3ddf8 Author: Asad kamal Date: Wed Feb 8 23:04:25 2023 +0800 drm/amd/pm: Update gfx clock frequency for SMU v13.0.6 Update gfx clock frequency from metric table for SMU v13.0.6 Signed-off-by: Asad kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 8d1c1bc13134ab90d773cb73c0298f2459703bee Author: Asad kamal Date: Wed Feb 8 20:19:13 2023 +0800 drm/amd/pm: Update pmfw header files for SMU v13.0.6 Update driver metrics table for SMU v13.0.6 to be compatible with PMFW v85.47 version Signed-off-by: Asad kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 1ad29cb3438175a9517f3b6cfeb0e331be213d8c Author: Stanley.Yang Date: Wed Mar 22 11:16:53 2023 +0800 drm/amdgpu: fix sdma instance It should change logical instance to device instance to query ras info Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 0c451baf3bff8e2a9fa45ef6471f9f25da00f39b Author: Le Ma Date: Thu Mar 16 17:42:49 2023 +0800 drm/amdgpu: change the print level to warn for ip block disabled Avoid to mislead users as it's not a real error. Signed-off-by: Le Ma Reviewed-by: Asad Kamal Reviewed-by: Amber Lin Signed-off-by: Alex Deucher commit 9e4216cf2dcccacd0e5dc932f26e35d18527ff41 Author: Mukul Joshi Date: Fri May 5 11:54:38 2023 -0400 drm/amdgpu: Increase Max GPU instance to 64 Increase Max GPU instances to 64 to handle multi-socket system with GFX 9.4.3 asic. Signed-off-by: Mukul Joshi Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit bb0ed57b4450e46de3651b310dcb4273032c3122 Author: Le Ma Date: Thu Mar 16 11:08:06 2023 +0800 drm/amdgpu: increase AMDGPU_MAX_RINGS On newer GPUs, the number of kernel rings are increased. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 970c1646b5ac93a13496d3429aca3e799fa6cf07 Author: Rajneesh Bhardwaj Date: Fri Jan 27 21:48:06 2023 -0500 drm/amdgpu: Create VRAM BOs on GTT for GFXIP9.4.3 On GFXIP9.4.3 APP APU where there is no dedicated VRAM domain handle VRAM BO allocation requests on CPU domain and validate them on GTT. Support for handling multi-socket and multi-numa partitions within a socket will be added by future patches, this enables 1P NPS1 asic bringup configuration. Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit f431393d605f55f8865dbf8ba8236760fbb0a3dc Author: Rajneesh Bhardwaj Date: Fri Jan 27 21:46:59 2023 -0500 drm/amdgpu: Implement new dummy vram manager This adds dummy vram manager to support ASICs that do not have a dedicated or carvedout vram domain. Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 228ce176434b0f61451019065393040d58e1668d Author: Rajneesh Bhardwaj Date: Fri Jan 27 21:57:00 2023 -0500 drm/amdgpu: Handle VRAM dependencies on GFXIP9.4.3 [For 1P NPS1 mode driver bringup] Changes required to initialize the amdgpu driver with frontdoor firmware loading and discovery=2 with the native mode SBIOS that enables CPU GPU unified interleaved memory. sudo modprobe amdgpu discovery=2 Once PSP TMR region is reported via the ACPI interface, the dependency on the ip_discovery.bin will be removed. Choice of where to allocate driver table is given to each IP version. In general, both GTT and VRAM domains will be considered. If one of the tables has a strict restriction for VRAM domain, then only VRAM domain is considered. Reviewed-by: Felix Kuehling (lijo: Modified the handling for SMU Tables) Signed-off-by: Lijo Lazar Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 9faf929fbf6b457d13064d57017b2d4f62670b58 Author: Asad kamal Date: Tue Feb 7 20:55:24 2023 +0800 drm/amdgpu: Enable CG for IH v4.4.2 Enable clock gating on IH v4.4.2 versions. Signed-off-by: Asad kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 8107e4996f4ec3304485c608b5880185840c464c Author: Hawking Zhang Date: Sun Jan 29 22:48:15 2023 +0800 drm/amdgpu: Enable persistent edc harvesting in APP APU Persistent edc harvesting is supported in APP APU Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 73c2b3fd2c515bcb819d801c5c4bf053fdb1e5cb Author: Hawking Zhang Date: Sun Jan 22 23:26:40 2023 +0800 drm/amdgpu: Initialize mmhub v1_8 ras function Initialize mmhub v1_8 ras function. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit ccfdbd4bdc0875ee8b8fe00691a6b5f883227bdb Author: Hawking Zhang Date: Sun Jan 22 23:20:09 2023 +0800 drm/amdgpu: Add reset_ras_error_status for mmhub v1_8 Add reset_ras_error_status callback for mmhub v1_8. It will be used to reset mmhub error status. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 00c145222b6ac93ee9926a8ef2e41dae55b97b7e Author: Hawking Zhang Date: Sun Jan 22 23:36:25 2023 +0800 drm/amdgpu: Add query_ras_error_status for mmhub v1_8 Add query_ras_error_status callback for mmhub v1_8. It will be used to log mmhub error status. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit ae39964d2c01cb1805fcaa6f0ad0b7b4e8568106 Author: Hans de Goede Date: Fri May 12 18:31:21 2023 +0100 media: atomisp: Remove in_reset argument from atomisp_css_start() The in_reset argument to atomisp_css_start() is only ever true in atomisp_assert_recovery_work(), drop the argument and move the special reset handlig to atomisp_assert_recovery_work(). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit a0cdb3d09332900e145fb99f52d1d571d7030183 Author: Hawking Zhang Date: Sun Jan 22 22:22:06 2023 +0800 drm/amdgpu: Add reset_ras_error_count for mmhub v1_8 Add reset_ras_error_count callback for mmhub v1_8. It will be used to reset mmhub ras error count. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit bc069d823bffd774294f5c3b12757a50fb726fd0 Author: Hawking Zhang Date: Thu Feb 2 21:00:39 2023 +0800 drm/amdgpu: Add query_ras_error_count for mmhub v1_8 Add query_ras_error_count callback for mmhub v1_8. It will be used to query and log mmhub error count and memory block. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 90cbee204e6619e47b1ec9fc14ebe03852585dac Author: Hawking Zhang Date: Wed Dec 28 18:18:38 2022 +0800 drm/amdgpu: Add mmhub v1_8_0 ras err status registers add new ras error status registers introduced in mmhub v1_8_0 to log mmea and mm_cane ras err, including MMEAx_UE|CE_ERR_STATUS_LO|HI MM_CANE_UE|CE_ERR_STATUS_LO|HI Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 84b9b44b99780d35fe72ac63c4724f158771e898 Author: Arnd Bergmann Date: Tue Jan 17 18:13:56 2023 +0100 virt: sevguest: Add CONFIG_CRYPTO dependency This driver fails to link when CRYPTO is disabled, or in a loadable module: WARNING: unmet direct dependencies detected for CRYPTO_GCM WARNING: unmet direct dependencies detected for CRYPTO_AEAD2 Depends on [m]: CRYPTO [=m] Selected by [y]: - SEV_GUEST [=y] && VIRT_DRIVERS [=y] && AMD_MEM_ENCRYPT [=y] x86_64-linux-ld: crypto/aead.o: in function `crypto_register_aeads': Fixes: fce96cf04430 ("virt: Add SEV-SNP guest driver") Signed-off-by: Arnd Bergmann Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230117171416.2715125-1-arnd@kernel.org commit 1e69fde70030e2fd2b729de5998d3fd6c94be238 Author: Hawking Zhang Date: Sun Jan 22 23:29:28 2023 +0800 drm/amdgpu: Initialize sdma v4_4_2 ras function Initialize sdma v4_4_2 ras function and interrupt handler. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit a64b15520cc3a19bc6ca807870b51b37774a4d3d Author: Hawking Zhang Date: Sun Jan 22 12:19:57 2023 +0800 drm/amdgpu: Add reset_ras_error_count for sdma v4_4_2 Add reset_ras_error_count callback for sdma v4_4_2. It will be used to reset sdma ras error count. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit dc37a9194ad20c4f09f22ec79cc2b5e5eb57c5a2 Author: Hawking Zhang Date: Sun Feb 5 22:54:50 2023 +0800 drm/amdgpu: Add query_ras_error_count for sdma v4_4_2 Add query_ras_error_count callback for sdma v4_4_2. It will be used to query and log sdma uncorrectable error count and memory block. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit d90d90a1978af6530c7d8b201c4ab117d0506b1a Author: Hawking Zhang Date: Fri Dec 23 15:54:43 2022 +0800 drm/amdgpu: Add sdma v4_4_2 ras registers SDMA_UE_ERR_STATUS_HI|LO are introduced in v4_4_2 to replace SDMA_EDC_COUNTER/COUNTER2 registers to log SDMA RAS errors Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit e53a3250f76b8a0dd5b533bd0ce0dc821055e77d Author: Hawking Zhang Date: Fri Feb 3 16:10:37 2023 +0800 drm/amdgpu: Add common helper to reset ras error Add common helper to reset ras error status. It applies to IP blocks that follow the new ras error logging register design, and need to write 0 to reset the error status. For IP blocks that don't support the new design, please still implement ip specific helper. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 322a7e005db78b8a46ead91b7e3df3514cb658f0 Author: Hawking Zhang Date: Thu Feb 2 20:54:08 2023 +0800 drm/amdgpu: Add common helper to query ras error (v2) Add common helper to query ras error status and log error information, including memory block id and erorr count. The helpers are applicable to IP blocks that follow the new ras error logging design. For IP blocks that don't support the new design, please still implement ip specific helper to query ras error. v2: optimize struct amdgpu_ras_err_status_reg_entry and the implementaion in helper (Lijo/Tao) Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit cbf9e46ab0fec29ac39d05d9a87fa66122bc9783 Author: Lijo Lazar Date: Fri Feb 3 13:17:51 2023 +0530 drm/amdgpu: Enable MGCG on SDMAv4.4.2 Enable clock gating on SDMAv4.4.2 versions. Leave memory light sleep to default. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 35ff4301ebc37bd45c18edae08afd2983dc9a338 Author: Le Ma Date: Fri Feb 3 14:38:33 2023 +0800 drm/amdgpu: enable context empty interrupt on sdma v4.4.2 With SDMA_CTNL.CTXEMPTY_INT_ENABLE set, the F32 clock can be gated when SDMA finishes all job and goes to idle. And no specific interrupt handling is required in driver. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7b08b2e1caa04757bc7a35a46b3d5c83b1748423 Author: Sonny Jiang Date: Tue Jan 31 16:44:28 2023 -0500 drm/amdgpu: add vcn_4_0_3 codec query Add support for vcn_4_0_3 video codec query Signed-off-by: Sonny Jiang Reviewed-by: James Zhu Signed-off-by: Alex Deucher commit 1698e200e88db96aef7d16aa3d63df68a209ffbd Author: Jonathan Kim Date: Thu Feb 2 11:10:08 2023 -0500 drm/amdkfd: bind cpu and hiveless gpu to a hive if xgmi connected If a CPU and GPU are xGMI connected but the GPU is hiveless with respect to other GPUs, create a new CPU-GPU hive using the GPU's PCI device location ID as the new hive ID to maintain fine grain memory access usage. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 8c45a8340dd097ea0d6be6f718c4882283d9645d Author: Philip Yang Date: Tue Jan 24 10:10:14 2023 -0500 drm/amdkfd: Cleanup KFD nodes creation kfd node allocation outside kfd->num_nodes loop is not needed and causes memory leak because kfd->num_nodes is at least equal to 1. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 4482d3c94d7f1d6912521e6de23bb051bfcd084d Author: Rajneesh Bhardwaj Date: Wed Oct 12 21:58:29 2022 -0400 drm/ttm: add NUMA node id to the pool This allows backing ttm_tt structure with pages from different NUMA pools. Tested-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Christian König Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit c1d3f627ff33bf1ae145209030a114c4985beddf Author: Lijo Lazar Date: Fri Jan 20 12:42:00 2023 +0530 drm/amdgpu: Fix mqd init on GFX v9.4.3 For MQD init, an XCC's queue is selected with GRBM select. However, for initialization of MQD, values read from logical XCC0 registers are used. This results in garbage values being read from XCC0 whose queue is not selected. Change to read from the right XCC for MQD initialization. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5ca1ceebab140b36928dabc9a5b36b9a3010e844 Author: Harish Kasiviswanathan Date: Sat Jan 21 15:47:11 2023 -0500 drm/amd: fix compiler error to support older compilers ‘for’ loop initial declarations are only allowed in C99 or C11 mode Signed-off-by: Harish Kasiviswanathan Reviewed-by: Mukul Joshi Signed-off-by: Alex Deucher commit b7c7011e67b09efc486b1de38f6bfbed75139989 Author: Lijo Lazar Date: Thu Jan 19 15:00:45 2023 +0530 drm/amdgpu: Enable CGCG/LS for GC 9.4.3 Enable coarse grain clockgating/light sleep for GC v9.4.3. Remove programming that is not meant for GC 9.4.3. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 233bb3733bd43966696f4a5e95129476e86bf4e3 Author: Lijo Lazar Date: Thu Jan 19 14:47:22 2023 +0530 drm/amdgpu: Use unique doorbell range per xcc Program different ranges in each XCC with MEC_DOORBELL_RANGE_LOWER/HIGHER. Keeping the same range causes CPF in other XCCs also to be busy when an IB packet is submitted to KCQ. Only the XCC which processes the packet comes back to idle afterwards and this causes other CPs not be idle. This in turn affects clockgating behavior as RLC doesn't get idle interrupt. LOWER/HIGHER covers only KIQ/KCQs which are per XCC queues. Assigning different ranges doesn't seem to have any side effect as user queue ranges are outside of this range. User queue tests - PM4 through KFD and AQL through rocr - have the same results after this change. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7389c75114c53b061d686f19dff5833adaf96cb8 Author: Lijo Lazar Date: Tue Jan 17 16:54:49 2023 +0530 drm/amdgpu: Keep SDMAv4.4.2 active during reset During ASIC wide reset, SDMA shouldn't be clockgated and be ready to accept freeze requests from PMFW. For that, don't stop SDMA engine during reset and keep the clocks active. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b2ef2fdffed2a7fd5bf3f178a6a0427487dba5dd Author: Rajneesh Bhardwaj Date: Thu Jan 5 11:39:34 2023 -0500 drm/amdkfd: Report XGMI IOLINKs for GFXIP9.4.3 GFXIP 9.4.3 could be in APU or carveout mode but we cannot use the xgmi.connected_to_cpu flag to identify the iolinks type. Use appropriate APU or Carveout mode based condition to report xgmi connection in kfd topology. Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 13a94f3f130ee4db6b4d2a0843104807a7299aa4 Author: James Zhu Date: Tue Jan 10 09:05:35 2023 -0500 drm/amdgpu: add num_xcps return Add num_xcps return. Signed-off-by: James Zhu Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 1bd99ca2695a76f15d7f7862d6ef878588e854dc Author: James Zhu Date: Tue Jan 10 09:01:33 2023 -0500 drm/amdgpu: increase AMDGPU_MAX_HWIP_RINGS [WA] Increase AMDGPU_MAX_HWIP_RINGS to 64 to support more compute ring resource. Later need redesign with queue/prirority/scheduler factors to reduce AMDGPU_MAX_HWIP_RINGS. Signed-off-by: James Zhu Acked-by: Christian König Signed-off-by: Alex Deucher commit f471de2586e8ef388eea2cafa911695d94ec1d88 Author: James Zhu Date: Mon Dec 19 20:11:11 2022 -0500 drm/amdgpu: vcn_v4_0_3 load vcn fw once for all AIDs Signed-off-by: James Zhu Signed-off-by: Alex Deucher commit 1180d072e05cb40fdd65725b9235e23c008411f9 Author: Hans de Goede Date: Fri May 12 17:27:10 2023 +0100 media: atomisp: Remove unused atomisp_get_css_pipe_id() function Remove no longer user atomisp_get_css_pipe_id() function. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 52c293ab0653b3e57d2202a5002f59593ed12d1b Author: Lijo Lazar Date: Tue Jan 10 09:52:53 2023 +0530 drm/amdgpu: Populate VCN/JPEG harvest information Certain instances of VCN/JPEG IPs may not be usable. Fetch the information from harvest table. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d839a158b2480814bc438f9f46f440a7b9f63cb6 Author: Graham Sider Date: Thu Jan 5 10:58:07 2023 -0500 drm/amdgpu: Correct dGPU MTYPE settings for gfx943 Revert temporary dGPU VRAM MTYPE setting and align with expected coherency protocol. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 30b52995c294b3c9a002ff2f90f773cbf8850714 Author: Asad kamal Date: Tue Jan 3 13:14:58 2023 +0800 drm/amdgpu: Remove SMU powergate message call for SDMA SDMA v4.4.2 doesn't need explicit power gating control through PMFW Signed-off-by: Asad kamal Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit ed1f42f03c46767df7f55d6a75c39051a55cc656 Author: James Zhu Date: Sat Dec 17 19:44:15 2022 -0500 drm/amdgpu: enable vcn/jpeg on vcn_v4_0_3 Enable vcn/jpeg on vcn_v4_0_3. Signed-off-by: James Zhu Acked-by Leo Liu Signed-off-by: Alex Deucher commit e40b4b9a474887653263c138b0172b0e2fde57cb Author: James Zhu Date: Mon Dec 12 13:14:05 2022 -0500 drm/amdgpu: enable indirect_sram mode on vcn_v4_0_3 Enable indirect_sram mode on vcn_v4_0_3. Signed-off-by: James Zhu Acked-by Leo Liu Signed-off-by: Alex Deucher commit e5fab487eac8bb3ec784c2523f128ceaeb8feba4 Author: Hans de Goede Date: Fri May 12 17:26:11 2023 +0100 media: atomisp: Remove unused css_pipe_id argument from atomisp_css_[start|stop]() The css_pipe_id argument pass to atomisp_css_[start|stop]() is not used, drop it. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit da044aaeb31ac11e733a667763487508433f3ede Author: James Zhu Date: Sat Dec 17 10:51:04 2022 -0500 drm/amdgpu: add unified queue support on vcn_v4_0_3 Add unified queue support on vcn_v4_0_3. Signed-off-by: James Zhu Acked-by Leo Liu Signed-off-by: Alex Deucher commit 2d7f1d51c1e9812c6a085b6e5bfd99e31b1442cb Author: James Zhu Date: Mon Dec 12 12:31:23 2022 -0500 drm/amdgpu: add fwlog support on vcn_v4_0_3 Add fwlog support on vcn_v4_0_3. Signed-off-by: James Zhu Acked-by Leo Liu Signed-off-by: Alex Deucher commit 45ed97ad36b744dfc2754c47cfd4423aab6322a2 Author: James Zhu Date: Mon Dec 12 12:29:04 2022 -0500 drm/amdgpu: increase MAX setting to hold more jpeg instances vcn_v4_0_3 increased jpeg instances, need increasing MAX resources setting accordlingly. Signed-off-by: James Zhu Acked-by Leo Liu Signed-off-by: Alex Deucher commit 73fa255328263e525d7d46d511b088e80e3cd579 Author: Lijo Lazar Date: Mon Nov 28 12:02:14 2022 +0530 drm/amdgpu: Use discovery to get XCC/SDMA mask Get information about active XCC and SDMAs from discovery table. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 44cbc4534bbe7cc1f7dd25976a044c7a84628978 Author: Lijo Lazar Date: Thu Dec 1 17:27:47 2022 +0530 drm/amdgpu: Make VRAM discovery read optional When overridden with module param, directly read discovery info from discovery binary instead of reading from VRAM. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c9a502e981a961053f3f873b14677d95e804251e Author: Felix Kuehling Date: Tue Nov 29 12:45:26 2022 -0500 drm/amdgpu: Allocate GART table in RAM for AMD APU Some AMD APUs may not have a dedicated VRAM. On such platforms the GART table should be allocated on the system memory. When real vram size is zero, place the GART table in system memory and create an SG BO to make it GPU accessible. v2: fix includes Reviewed-by: Felix Kuehling (rajneesh: removed set_memory_wc workaround) Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Harish Kasiviswanathan Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit 34fd9d686772f6725242e900913ca2be987c12dd Author: Lijo Lazar Date: Tue Dec 20 14:21:57 2022 +0530 drm/amdgpu: Add FGCG logic for GFX v9.4.3 Add logic for fine grain clock gating logic for GFX v9.4.3. The feature will be controlled using CG flags. Also, make a change so that RLC safe mode entry/exit is done only once during CG update sequence. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7a7aaab021a6772b29c81c22db9f4d2d8cd66ecd Author: Rajneesh Bhardwaj Date: Tue Dec 20 15:37:57 2022 -0500 drm/amdgpu: Make UTCL2 snoop CPU caches On AMD APP APUs, to make UTCL2 snoop CPU caches, its not sufficient to rely on xgmi connected flag so add the logic to use is_app_apu to program the PDE_REQUEST_PHYSICAL bit correctly for gfxhub and mmhub both. Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 85b45b60722f506322393320bb6cc195378f2e4f Author: Amber Lin Date: Mon Nov 28 11:26:02 2022 -0500 amd/amdgpu: Set MTYPE_UC for access over PCIe For GFX v9_4_3, set MTYPE_UC for memory access over PCIe. v4 - add missing indentation pointed out by Felix and add his reviewed-by tag. v3 - add missing logic for the svm path. v2 - add amdgpu_xgmi_same_hive to separate access over xgmi from pcie Reviewed-by: Felix Kuehling Signed-off-by: Amber Lin Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit d524180b88009d9158bff7fd20f3916455e0c32c Author: Lijo Lazar Date: Mon Dec 19 17:39:42 2022 +0530 drm/amdgpu: Fix GFX v9.4.3 EOP buffer allocation Each compute cluster gets 8 compute queues in GFX v9.4.3. Fix the EOP buffer allocation so that compute queue on every XCC gets a unique address. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Tested-and-Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit 12c4d7edfb7238ded6c7a2584995d888b4d877ec Author: Lijo Lazar Date: Thu Dec 15 13:13:29 2022 +0530 drm/amdgpu: Fix GFX 9.4.3 dma address capability ASICs with GFX 9.4.3 support 48-bit addressing. Signed-off-by: Lijo Lazar Acked-by: Christian König Signed-off-by: Alex Deucher commit a0a0c69c05bff025abf49ec66b2bfb94aeabcc6e Author: Lijo Lazar Date: Wed Dec 14 10:28:50 2022 +0530 drm/amdgpu: Fix semaphore release Use the right register for semaphore release during invalidation. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 5ab97df8642e93559edfcbf2d9f7b8478b683c96 Author: Hans de Goede Date: Fri May 12 16:27:46 2023 +0100 media: atomisp: Remove atomisp_[sub]dev_users() The atomisp_[sub]dev_users() functions are not used anymore, remove them. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit c2d43918a14f7b0f04932f5a45728e0fe8161da0 Author: Mukul Joshi Date: Fri Dec 9 09:03:01 2022 -0500 drm/amdkfd: Setup current_logical_xcc_id in MQD Setup rolling current_logical_xcc_id in MQD for GFX9.4.3 to ensure each queue starts at a different place and prevent hotspotting issues. Also, remove updating current_logical_xcc_id during queue update. Suggested-by: Joseph Greathouse Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a820d3ca8ed3a2851e1c9d5713e807f84e88019d Author: Lijo Lazar Date: Thu Dec 1 17:22:01 2022 +0530 drm/amdgpu: Remove unnecessary return value check There is no need to check return value, as the function internally used - amdgpu_discovery_read_binary_from_vram() - returns void. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 98b2e9cad2279132e3aa4b9caf9164b2e35c1a52 Author: Le Ma Date: Fri Dec 9 19:44:05 2022 +0800 drm/amdgpu: correct the vmhub index when page fault occurs The AMDGPU_GFXHUB was bind to each xcc in the logical order. Thus convert the node_id to logical xcc_id to index the correct AMDGPU_GFXHUB. And "node_id / 4" can get the correct AMDGPU_MMHUB0 index. Signed-off-by: Le Ma Tested-by: Asad kamal Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 1794e9d7e78cb52605234d0ddc3f46084937f4e9 Author: Mukul Joshi Date: Thu Dec 8 12:08:17 2022 -0500 drm/amdkfd: Update packet manager for GFX9.4.3 In GFX 9.4.3, there can be more than 8 SDMA engines. As a result, extended_engine_sel and engine_sel fields in MAP_QUEUES packet need to be updated to allow correct mapping of SDMA queues to these SDMA engines. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 753b999afe47900531282f86bf430aec250b4232 Author: Rajneesh Bhardwaj Date: Wed Dec 7 00:29:40 2022 -0500 drm/amdgpu: set MTYPE in PTE for GFXIP 9.4.3 Apply the GFXIP 9.4.3 specific snoop and mtype settings for various scenarios such as APU, APU in Carveout mode and dGPU mode. Note: This is expected to change due to: 1 - NPS > 1 support in future 2 - Hardware bugs found during initial asic bringup. Cc: Graham Sider Cc: Hawking Zhang Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 7a1efad04c210594069c4ab9f9c25039cd6915e4 Author: Lijo Lazar Date: Tue Nov 29 14:00:37 2022 +0530 drm/amdgpu: Use mask for active clusters Use a mask of available active clusters instead of using only the number of active clusters. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4d141d3fae3e3d8b85817bde3b6b6a0e7b08eb3b Author: Hans de Goede Date: Fri May 12 16:24:32 2023 +0100 media: atomisp: Allow system suspend to continue with open /dev/video# nodes Just having a /dev/video# node open is not a reason to block system suspend. At least when userspace is not streaming. In that case the worst case scenario is that streams have been created, but we can just destroy those before powering off the ISP and recreate the streams on resume. Fixing suspend when streaming is left as a FIXME item for later. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit bbca579fd2ea8cbc170df33587f8a4b572a4f025 Author: Lijo Lazar Date: Mon Nov 28 11:17:15 2022 +0530 drm/amdgpu: Derive active clusters from SDMA SDMA instances per active cluster and SDMA instance mask are used to find the number of active clusters. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit dc6df2095deaaefe38a94d62a51b0d07c0794eaf Author: Lijo Lazar Date: Mon Nov 28 09:57:51 2022 +0530 drm/amdgpu: Move generic logic to soc config Move soc specific configuration details to aqua vanjaram specific file. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit fee500fa7cb7e11a4d2d66e75e65e67c156e27c6 Author: Shiwu Zhang Date: Fri Nov 18 14:21:15 2022 +0800 drm/amdgpu: Fix the KCQ hang when binding back Just like the KIQ, KCQ need to clear the doorbell related regs as well to avoid hangs when to load driver again after unloading. Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 5b03127d4745d6848f208463390e6a76d489eb03 Author: Lijo Lazar Date: Thu Nov 24 14:23:58 2022 +0530 drm/amdgpu: Skip TMR allocation if not required On ASICs with PSPv13.0.6, TMR is reserved at boot time. There is no need to allocate TMR region by driver. However, it's still required to send SETUP_TMR command to PSP. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 845c9b313f3122191c847fcc4092492ce039542a Author: Lijo Lazar Date: Fri Sep 23 17:15:15 2022 +0530 drm/amdgpu: Add XCP IP callback funcs for each IP Initialize with the IP specific functions needed for GFXHUB, GFX and SDMA. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 73c84f7c478aeb98bce494cac73f2d20f4a81c6e Author: Lijo Lazar Date: Fri Sep 23 16:48:43 2022 +0530 drm/amdgpu: Add XCP functions for GFX v9.4.3 Add functions to suspend/resume GFX instances belonging to an XCP. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 3446cb78f3a8033fda416825282e7cafecc83129 Author: Lijo Lazar Date: Fri Sep 23 15:40:15 2022 +0530 drm/amdgpu: Add SDMA v4.4.2 XCP funcs Add functions required to suspend/resume instances of SDMA which are part of an XCP. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit dfdd6f89c4c7f3315d9cabd9bf80a8174ecb5753 Author: Lijo Lazar Date: Fri Sep 23 15:20:08 2022 +0530 drm/amdgpu: Add GFXHUB v1.2 XCP funcs Add functions required for suspend/resume of GFXHUB instances which are part of an XCP. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8e7fd19380f9187dae3ad18a61793b1752dfa097 Author: Lijo Lazar Date: Wed Nov 16 17:15:47 2022 +0530 drm/amdgpu: Switch to SOC partition funcs For GFXv9.4.3, use SOC level partition switch implementation rather than keeping them at GFX IP level. Change the exisiting implementation in GFX IP for keeping partition mode and restrict it to only GFX related switch. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e56c9ef6cb35f33dc83f635419ae55adf69db9fc Author: Lijo Lazar Date: Fri Sep 23 14:43:17 2022 +0530 drm/amdgpu: Add soc config init for GC9.4.3 ASICs Add function to initialize soc configuration information for GC 9.4.3 ASICs. Use it to map IPs and other SOC related information once IP configuration information is available through discovery. For GC9.4.3 compute partition related callbacks are initialized as part of configuration init. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9cb18287d8f1c4549d95280e2cf60f4d1bab64f8 Author: Lijo Lazar Date: Mon Sep 19 17:34:02 2022 +0530 drm/amdgpu: Add SOC partition funcs for GC v9.4.3 Switching the partition mode configuration of ASIC is SOC level function rather than something at GFX core level. Add partition mode switch functions as SOC specific callbacks. Implement the XCP manager callbacks needed for partition switch for GC 9.4.3 based ASICs. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 75d1692393cb78b510ff18733457f91d002452f7 Author: Lijo Lazar Date: Fri Sep 16 12:43:35 2022 +0530 drm/amdgpu: Add initial version of XCP routines Within a device, an accelerator core partition can be constituted with different IP instances. These partitions are spatial in nature. Number of partitions which can exist at the same time depends on the 'partition mode'. Add a manager entity which is responsible for switching between different partition modes and maintaining partitions. It is also responsible for suspend/resume of different partitions. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 527c670e5323414dbef8f4719dc9b348a50ac1c8 Author: Lijo Lazar Date: Wed Sep 14 12:48:08 2022 +0530 drm/amdgpu: Add sdma instance specific functions SDMA 4.4.2 supports multiple instances. Add functions to support handling of each SDMA instance separately. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit dd1a02e280dae1904c8858c8cb572a61a84ba7c0 Author: Lijo Lazar Date: Wed Sep 14 12:16:48 2022 +0530 drm/amdgpu: Add xcc specific functions for gfxhub GFXHUB 1.2 supports multiple XCC instances. Add XCC specific functions to handle XCC instances separately. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 44b5cf2e0f7952856f48b9be56b9eb2f688d70f0 Author: Lijo Lazar Date: Wed Nov 16 10:47:18 2022 +0530 drm/amdgpu: Add xcc specific functions Add more XCC specific functions and use them from IP block functions. RLC, CP functions are further split to have xcc specific versions. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 880f8b3f8032a022c85351857ba7020fd3345592 Author: Lijo Lazar Date: Wed Jul 20 13:45:30 2022 +0530 drm/amdgpu: Rename xcc specific functions Add 'xcc' prefix to xcc specific functions to distinguish from IP block functions. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 497db7ea33f7cec2a0019894e844789f003dbd22 Author: Rajneesh Bhardwaj Date: Tue Nov 8 23:04:30 2022 -0500 drm/amdgpu: Check APU supports true APP mode On GPXIP 9.4.3 APU, in no carveout mode there is no real vram heap and could be emulated by the driver over the interleaved NUMA system memory and the APU could also be in the carveout mode during early development stage or otherwise for debugging purpose so introduce a new member in amdgpu_gmc to figure out whether the APU is in the native mode as per the production configuration. AMD_IS_APU cannot be used for Accelerated Processing Platform APUs as it might be used in a different context on previous generations or on small APUs. Reviewed-by: Hawking Zhang Reviewed-by: Felix Kuehling Tested-by: Graham Sider Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit eaae4beee8a94b30f37341c9d14837c82e7e2647 Author: Philip Yang Date: Mon Nov 14 17:35:43 2022 -0500 drm/amdgpu: more GPU page fault info for GC v9.4.3 Output IH cookie node_id and translate it to the corresponding AID id and XCC id, to help debug the GPU page fault. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 993d218f82211b1e17fcea7a5f727fa16efba353 Author: Shiwu Zhang Date: Mon Nov 14 15:52:19 2022 +0800 drm/amdgpu: remove partition attributes sys file for gfx_v9_4_3 For driver de-init like rmmod operations those partition specific attributes need to be removed accordingly. Signed-off-by: Shiwu Zhang Reviewed-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 37dd9d58a595f4cda5a7f01703592cc4e00f69b4 Author: Shiwu Zhang Date: Fri Nov 11 15:54:52 2022 +0800 drm/amdgpu: fix kcq mqd_backup buffer double free for multi-XCD For gfx_v9_4_3 and beyond, struct kiq has its own mqd_backup pointer rather than using the last pointer from mec struct. Then the kfree operation on the pointer from the mec struct should be removed otherwise it will cause double free on the first kcq's mqd_backup buffer on XCD1. Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit cbd442ce91bdeb8f618511d65e674894a80e4c31 Author: Lijo Lazar Date: Sat Nov 12 16:30:40 2022 +0530 drm/amdgpu: Skip runtime db read for PSP 13.0.6 Skip reading runtime db information for PSP 13.0.6. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4bc615a5237a641ddb2235236c21b1eaadb76963 Author: Le Ma Date: Sat Nov 12 17:01:05 2022 +0800 drm/amdgpu: fix vm context register assignment in mmhub v1.8 Assign the vm context register addr per aid instance. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d55391c2138c1a5bcd1316ccedf1835dd067d568 Author: Lijo Lazar Date: Wed Nov 9 19:47:38 2022 +0530 drm/amdgpu: Revert programming of CP_PSP_XCP_CTL Programming of this register is taken care by PSP. Incorrect programming causes CP not to detect its XCC. Signed-off-by: Lijo Lazar Reported-by: Alexander Turek Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ea2d2f8ececdd4c778b66e19b82ce278dfc5e1c4 Author: Rajneesh Bhardwaj Date: Tue Apr 5 13:00:13 2022 -0400 drm/amdgpu: detect current GPU memory partition mode - Add helpers to detect the current GPU memory partition. - Add current memory partition mode sysfs node. Tested-by: Ori Messinger Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 6b7ec18b045ff524eab94340e18feefe9a783d2e Author: Hawking Zhang Date: Tue Nov 23 22:27:17 2021 +0800 drm/amdgpu: init smuio funcs for smuio v13_0_3 Add callbacks for SMUIO 13.0.3 Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 3d2ea552b229495050316e84d7cb0257cb3cd13b Author: Rajneesh Bhardwaj Date: Tue Apr 12 23:33:20 2022 -0400 drm/amdgpu: implement smuio v13_0_3 callbacks Add smuio v13_0_3 callbacks for SMUIO. Tested-by: Ori Messinger Acked-by: Alex Deucher Reviewed-by: Lijo Lazar Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 63121b11a95ccd30763e6def363f8fbe992b7a3f Author: Hawking Zhang Date: Sun Apr 24 15:23:08 2022 +0800 drm/amdgpu: add smuio v13_0_3 ip headers Add smuio v13_0_3 register offset and shift masks header files v2: update headers (Alex) Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit ebadc1061e045e961339e0df7b8a07f3e589579c Author: Hawking Zhang Date: Mon Nov 7 11:11:29 2022 +0800 drm/amdgpu: retire render backend setup from gfx_v9_4_3 gfx v9_4_3 only support compute. render backend doesn't need to be involved in any compute shader execution. Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 2cb61011bfed4344185fcfe64adf2c9f2353eaa3 Author: Hans de Goede Date: Fri May 12 16:17:54 2023 +0100 media: atomisp: Rename atomisp_destroy_pipes_stream_force() to atomisp_destroy_pipes_stream() There now no longer is a non force version of atomisp_destroy_pipes_stream_force() so having the _force postfix no longer makes sense rename it to atomisp_destroy_pipes_stream(). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 553f973a0d7bbe95ea5da46979d926a9c0ada109 Author: Tom St Denis Date: Tue Oct 11 09:52:58 2022 -0400 drm/amd/amdgpu: Update debugfs for XCC support (v3) This patch updates the 'regs2' interface for MMIO registers to add a new IOCTL command for a 'v2' state data that includes the XCC ID. This patch then updates amdgpu_gfx_select_se_sh() and amdgpu_gfx_select_me_pipe_q() (and the implementations in the gfx drivers) to support an additional parameter. This patch then creates a new debugfs interface "gprwave" which is a merge of shader GPR and wave status access. This new inteface uses an IOCTL to select banks as well as XCC identity. (v2) Fix missing xcc_id in wave_ind function (v3) Fix pm runtime calls and mutex locking (v4) Fix bad label Signed-off-by: Tom St Denis Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit 5f09237b82e51be8a1849eb658dcb153748f8f60 Author: Lijo Lazar Date: Mon Oct 31 10:46:05 2022 +0530 drm/amdgpu: Add SDMA v4.4.2 golden settings Add programming of SDMA golden settings for v4.4.2 Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 57a83b2dafff055698190d3fe3d7197c969c2dcc Author: Hawking Zhang Date: Sun Oct 23 20:27:59 2022 +0800 drm/amdgpu: init gfx_v9_4_3 external_rev_id it is used for user space driver to identify gfx_v9_4_3 chip Signed-off-by: Hawking Zhang Acked-by: Alex Deucher Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 870d1e5afca58261a147e9080abb8cc75fccb849 Author: Lijo Lazar Date: Fri Oct 14 13:06:18 2022 +0530 drm/amdgpu: Fix interrupt handling in GFX v9.4.3 IH follows a different identification scheme for its clients. Get the right mapping of xcc instance from IH node id. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 369576c2d5a8e8c3d7efb9d598970ba3f006b07e Author: Le Ma Date: Thu Sep 22 15:46:54 2022 +0800 drm/amdgpu: consolidate the access helpers in nbio v7_9 Use WREG32_SOC15_EXT to write registers with address larger than 32bit. Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 2fa480d36eb302712e48dce4d2f6564b24426be3 Author: Le Ma Date: Tue Sep 27 17:51:33 2022 +0800 drm/amdgpu: add helpers to access registers on different AIDs SMN address which is larger than 32bit has different indications through bit[34:32] on different AIDs. v2: put smn addressing of different AIDs into asic specific place v3: change to ext_id/ext_offset naming Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 7d158f52bfbf82279ea8f1c3dc7a3ab3065a76e4 Author: Le Ma Date: Tue Sep 27 17:26:27 2022 +0800 drm/amdgpu: parse base address from new ip discovery with 64bit ip base address Truncate the 64bit base address from ip discovery and only store lower 32bit ip base in reg_offset[]. Bits > 32 follows ASIC specific format, thus just discard them and handle it within specific ASIC. By this way reg_offset[] and related helpers can stay unchanged. v2: make comments more generic Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit aabb478421f5ca2be0f1343d02873394e935c582 Author: Le Ma Date: Wed Sep 7 21:17:03 2022 +0800 drm/amdgpu: upgrade amdgpu_discovery struct ip to ip_v4 version 4 supports 64bit ip base address Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 3955b14134285f99e0763ba74b8b1b35faed37ed Author: Le Ma Date: Tue Sep 20 15:14:48 2022 +0800 drm/amdgpu: do some register access cleanup in nbio v7_9 Use WREG_SOC15x() instead of WREG32(SOC15_REG_OFFSET()) Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 7e0eebdc4745b7e0f031df571621204fd9d6288e Author: Le Ma Date: Wed Sep 14 15:07:23 2022 +0800 drm/amdgpu: extend max instances Number of instances is extended. Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit c3729997a23e8955f017b6286bd6c73b386fbe49 Author: Le Ma Date: Tue Sep 6 15:22:44 2022 +0800 drm/amdgpu: increase DISCOVERY_TMR_SIZE New ip_discovery binary size is increased. Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit fa9e78d14070c55a47dc092f6d18364680b83f44 Author: Le Ma Date: Wed Aug 31 17:11:59 2022 +0800 drm/amdgpu: update ip discovery header to v4 version 4 supports 64bit ip base address Signed-off-by: Le Ma Signed-off-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 1dfcdc30270a80ba5b45f922833c0c0e56d82576 Author: Le Ma Date: Tue May 24 19:44:27 2022 +0800 drm/amdgpu: switch to aqua_vanjaram_doorbell_index_init New doorbell index assignment is used by aqua_vanjaram. Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 5c606836eff823ea14c481ad6374bc6d87121182 Author: Lijo Lazar Date: Wed Jun 29 21:04:39 2022 +0530 drm/amdgpu: Use SDMA instance table for aqua vanjaram For aqua vanjaram, add mapping for logical to physical instances. v2: Register accesses on bare metal should be based on physical instance. Use GET_INST() to get physical instance. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit cf24f6a0d7137bc703a23187ffa4a65ed3f17820 Author: Lijo Lazar Date: Wed Jun 29 16:26:49 2022 +0530 drm/amdgpu: Add mask for SDMA instances Add a mask of SDMA instances available for use. On certain ASIC configs, not all SDMA instances are available for software use. v2: Change sdma mask type to uint32_t (Le) Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit cab7d478da112e66f2ad8eec7dcfc0aa2a5babe1 Author: Lijo Lazar Date: Wed Jun 29 15:45:06 2022 +0530 drm/amdgpu: Add IP instance map for aqua vanjaram Add XCC logical to physical instance map for aqua vanjaram v2: Keep look up table only for required IPs, for others return default mapping (Felix). Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6df442a03d1a839242397259fa13168858c52413 Author: Le Ma Date: Mon Apr 25 22:19:58 2022 +0800 drm/amdgpu: add new doorbell assignment table for aqua_vanjaram Four basic reasons as below to do the change: 1. number of ring expand a lot on aqua_vanjaram, and adjustment on old assignment cannot make each ring in a continuous doorbell space. 2. the SDMA doorbell index should not exceed 0x1FF on aqua_vanjaram due to regDOORBELLx_CTRL_ENTRY.BIF_DOORBELLx_RANGE_OFFSET_ENTRY field width. 3. re-design the doorbell assignment and unify the calculation as "start + ring/inst id" will make the code much concise. 4. only defining the START/END makes the table look simple v2: (Lijo) 1. replace name 2. use num_inst_per_aid/sdma_doorbell_range instead of hardcoding Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 5a8b26a88639d69453d592ee11c03a24e0b62b9a Author: Lijo Lazar Date: Mon Sep 19 18:08:25 2022 +0530 drm/amdgpu: Fix register access on GC v9.4.3 In GC v9.4.3 there are multiple XCCs. It's required to use physical instance number to get the right register offset. Use GET_INST API for that. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bcc90bb31c819a7428ecd0604ce50553371fa278 Author: Hans de Goede Date: Thu May 11 19:53:16 2023 +0100 media: atomisp: Simplify atomisp_isr() and recovery_work() Both atomisp_isr() and recovery_work() now have a combination of: 1. "if (!isp->asd.streaming) goto out;" code at the top 2. "if (sp->asd.streaming) {}" blocks in the body which are jumped over by the goto out. This means that the "if (sp->asd.streaming) {}" blocks are always executed if they are not jumped over by the goto. Remove the unnecessary "if (sp->asd.streaming)" checks and re-indent the code. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 955220b04d42c41050158fec0f53957f320b96f9 Author: Lijo Lazar Date: Thu Oct 6 15:25:08 2022 +0530 drm/amdgpu: Fix programming of initial XCP mode On initialization set the partition mode correctly to SPX (default) or any other user specified partition mode. Use switch_compute_partition API so that all settings are initialized correctly. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f5fe7edfd6ce62cd23fbd707e7f9fe0f56a45e94 Author: Mukul Joshi Date: Fri Sep 30 09:16:21 2022 -0400 drm/amdkfd: Update interrupt handling for GFX9.4.3 Update interrupt handling in CPX mode for GFX9.4.3 by using the VMID space instead of SDMA client id to determine if an interrupt should be processed by a KFD node. This is especially needed for handling retry faults from MMHUB. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit cb30544e3cadf2164a123859519521dc474d21eb Author: Mukul Joshi Date: Thu Sep 29 12:07:49 2022 -0400 drm/amdgpu: Fix failure when switching to DPX mode Fix the if condition which causes dynamic repartitioning to fail when trying to switch to DPX mode. Signed-off-by: Mukul Joshi Reviewed-by: Amber Lin Signed-off-by: Alex Deucher commit 3fb3cd02d25b391a507cbc480361d4d27cbdfc21 Author: Hans de Goede Date: Thu May 11 19:35:43 2023 +0100 media: atomisp: Remove atomisp_streaming_count() atomisp_streaming_count() is just an alias for isp->asd.streaming now, replace it with directly checking that and remove the helper. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 02ee3b02d77661c593c7b0e49f5baa4aa0974024 Author: Mukul Joshi Date: Tue Sep 13 15:13:18 2022 -0400 drm/amdkfd: Use instance table for GFX 9.4.3 For GFX 9.4.3, use the logical to physical mapping table, to get the correct XCD instance when accessing registers on bare metal. Signed-off-by: Mukul Joshi Reviewed-by: Amber Lin Signed-off-by: Alex Deucher commit a058799923af7984552c6c07d6bbb088c1537e6a Author: Amber Lin Date: Tue Apr 12 15:37:15 2022 -0400 drm/amdgpu: Fix SWS on multi-XCD GPU GFX_9_4_3 supports multi-XCDs and multi-AIDs in one GPU device. SWS needs to program IH_VMID_x_LUT with specified XCC instance and corresponded AID instance. Signed-off-by: Amber Lin Reviewed-by: Mukul Joshi Signed-off-by: Alex Deucher commit 9cd51d53695e1df134301c1bdb8a8f965506e35b Author: Le Ma Date: Thu Aug 25 15:51:43 2022 +0800 drm/amdgpu: drop redundant csb init for gfx943 It's not required for compute pipeline and will cause soft lockup on emulation due to long-time writing. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 58bd8023752f3d7e6888d5cbb27387853b04c431 Author: Le Ma Date: Wed Aug 24 17:41:47 2022 +0800 drm/amdgpu: adjust s2a entry register for sdma doorbell trans decoding Use s2a entry 5/6 registers to decode sdma doorbell trans on different AIDs, which aligns the entry table in SHUB spec, and leave entry 4 dedicated for VCN doorbell to avoid conflict. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d6e924ad85a0cebc9e39eb956a23386ce32cc9f9 Author: Mukul Joshi Date: Tue Aug 9 14:56:53 2022 -0400 drm/amdkfd: Update SMI events for GFX9.4.3 On GFX 9.4.3, there can be multiple KFD nodes. As a result, SMI events for SVM, queue evict/restore should be raised for each node independently. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit cd321e6fd611db983fb7cdb52daf089fabe4f9c7 Author: Lijo Lazar Date: Mon Aug 8 11:20:36 2022 +0530 drm/amdgpu: Use status register for partition mode Program partition status register to reflect the current partition mode. Partition capability register is for capability and is a one-time setting. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5fb34bd9cf9e248d7e84e431a4a6b731334ab564 Author: Alex Sierra Date: Tue May 24 10:22:12 2022 -0500 drm/amdkfd: pass kfd_node ref to svm migration api This work is required for GC 9.4.3, previous to support memory partitions per node at SVM. When multiple partition is configured, every BO should be allocated inside one specific partition which corresponds to the current amdgpu_device and kfd_node. v2: squash in compilation fix (Alex) v3: squash in fix for pre-gfx 9.4.3 (Alex) v4: squash in best_loc fix (Alex) Signed-off-by: Alex Sierra Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 0b02364e03caecbe30bdd9db0b3e6ba0196bb0ef Author: Lijo Lazar Date: Fri Jul 29 14:56:59 2022 +0530 drm/amdgpu: Conform to SET_UCONFIG_REG spec The packet expects only 16 bits register offset. Hence pass register offset which is local to each XCC. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 762702ebd324596def832a2b2a1cfd24fff78338 Author: James Zhu Date: Mon Jul 11 11:06:46 2022 -0400 drm/amdgpu/vcn: add vcn multiple AIDs support add vcn multiple AIDs support. v2: squash in FW setting fix (Alex) Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 7229bd6fe02865a9fc324b4f062268f53190b5f4 Author: James Zhu Date: Mon Jul 11 11:05:05 2022 -0400 drm/amdgpu/vcn: update clock gate setting for VCN 4.0.3 Update clock gate setting. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit d4ad24a0b796ad429403bf17ba97ee7e2470ad68 Author: James Zhu Date: Sat Jul 2 19:53:36 2022 -0400 drm/amdgpu/jpeg: add JPEG multiple AIDs support Add JPEG multiple AIDs support. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 2e10ced47ff261d9dba439c5bcecf68d0c1b7de5 Author: James Zhu Date: Sat Jul 2 19:39:34 2022 -0400 drm/amdgpu/nbio: add vcn doorbell multiple AIDs support Update vcn doorbell range to support multiple AIDs. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 7aa8a266aaa25e9e2f85d9d2d594cdff6b5635f2 Author: Lijo Lazar Date: Wed Jul 6 13:50:45 2022 +0530 drm/amdgpu: Fix GRBM programming sequence It needs to be done only for XCC instances in non-AID0. Use the physical instance to determine non-AID0 XCC instances. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit f8b34a0518701bae8bb02fabe129f01b1dc33336 Author: Lijo Lazar Date: Wed Jun 29 21:04:39 2022 +0530 drm/amdgpu: Use instance table for sdma 4.4.2 For ASICs with sdma IP v4.4.2, add mapping for logical to physical instances. v2: Register accesses on bare metal should be based on physical instance. Use GET_INST() to get physical instance. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 4db6f200a5fef12666ab66e54bacb65c5d675e9d Author: Lijo Lazar Date: Wed Jun 29 16:26:49 2022 +0530 drm/amdgpu: Add mask for SDMA instances Add a mask of SDMA instances available for use. On certain ASIC configs, not all SDMA instances are available for software use. v2: Change sdma mask type to uint32_t (Le) Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 659a4ab8e27eb39cc61cb74cc714ba1a8f8c9a61 Author: Lijo Lazar Date: Tue Jul 5 09:56:41 2022 +0530 drm/amdgpu: Use instance lookup table for GC 9.4.3 Register accesses need to be based on physical instance on bare metal. Pass the right instance using logical to physical instance lookup table before accessing registers. Add a macro GET_INST to get the right physical instance of an IP corresponding to a logical instance. v2: fix gfx_v9_4_3_check_rlcg_range() (Alex) Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 5d30cbb4dbf096bb964fb9c5fd4417cad13445a4 Author: Lijo Lazar Date: Wed Jun 29 14:59:04 2022 +0530 drm/amdgpu: Add map of logical to physical inst Add a map for logical to physical instances of an IP. For ex: on some device configurations, the first logical XCC may not be the first physical XCC. Software may continue to access in logical IP instance order. The map provides a convenient way to get to the actual physical instance. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 0c7315e7d5ef9b36ca4db32ffeb34a187cbaf231 Author: Mukul Joshi Date: Fri Jun 10 09:41:29 2022 -0400 drm/amdkfd: Add device repartition support GFX9.4.3 will support dynamic repartitioning of the GPU through sysfs. Add device repartitioning support in KFD to repartition GPU from one mode to other. v2: squash in fix ("drm/amdkfd: Fix warning kgd2kfd_unlock_kfd defined but not used") Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit fe1f05df5919c67c3add49efb55e251a8d78ee4e Author: Mukul Joshi Date: Tue May 31 14:39:36 2022 -0400 drm/amdkfd: Rework kfd_locked handling Currently, even if kfd_locked is set, a process is first created and then removed to work around a race condition in updating kfd_locked flag. Rework kfd_locked handling to ensure no processes is created if kfd_locked is set. This is achieved by updating kfd_locked under kfd_processes_mutex. With this there is no need for kfd_locked to be an atomic counter. Instead, it can be a regular integer. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6b22ef25748fb77030bac02e2147f6d738212ac3 Author: Le Ma Date: Sat Apr 2 20:21:35 2022 +0800 drm/amdgpu: configure the doorbell settings for sdma on non-AID0 Configure the sdma doorbell settings on NBIF0 and SYSHUB of each AID v2: fetch aid_id from amdgpu_sdma_instance (Lijo) Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 0c552ed38780f24b7ac235c3d10c6c94686ecfdf Author: Le Ma Date: Sat Apr 2 19:39:59 2022 +0800 drm/amdgpu: add indirect r/w interface for smn address greater than 32bits On multiple AIDs platform, bit[34:32] in SMD address is leveraged to access nonAID0 register smn address and new PCI_INDEX_HI register is introduced to access the higher bits. v2: rebase on latest register accessors (Alex) Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 1526ec9a3ed90e7ad36de7ef8aa2768b60af14df Author: David Belanger Date: Wed Feb 16 12:07:28 2022 -0500 drm/amdkfd: EOP Removal - Handle size 0 correctly On GC 9.4.3, we are removing the EOP buffer. If we specify 0 for the size, CP_HQD_EOP_CONTROL ends up with incorrect value as order_size_2 calculations does not handle 0. Fix it by using zero for the MQD entry for EOP size 0. v2: Reworked code with a conditional assignment and fixed style issues. Signed-off-by: David Belanger Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 07bc768afb0a1c638f4eb054aaed9eaa291132de Author: Jonathan Kim Date: Tue Aug 9 12:58:58 2022 -0400 drm/amdgpu: reflect psp xgmi topology info for gfx9.4.3 Similar to GFX9.4.2 non-A+A devices, GFX9.4.3 psp xgmi topology info is half duplex and requires the driver to fill in the bidirectional info. Signed-off-by: Jonathan Kim Reviewed-by: Shiwu Zhang Signed-off-by: Alex Deucher commit cf1f3737c2d336b1473596cc7356bdffa186bc71 Author: James Zhu Date: Mon Jul 11 10:58:40 2022 -0400 drm/amdgpu/vcn: update amdgpu_fw_shared to amdgpu_vcn4_fw_shared Use amdgpu_vcn4_fw_shared for vcn 4.0.3. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit b19f8ef5bd3957e6269f1cb9647054de2e1bf217 Author: Hans de Goede Date: Thu May 11 16:14:21 2023 +0100 media: atomisp: Remove no longer used atomisp_css_flush() Remove the no longer used atomisp_css_flush() function and merge atomisp_assert_recovery_work() and __atomisp_css_recover() into a single function. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 7f0af02ab362df7f064df690fd59659a1cdb9b44 Author: James Zhu Date: Sat Jul 2 20:03:18 2022 -0400 drm/amdgpu/vcn: remove unused code Remove unused code. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 429a111851bc1f7388fe44af36166d399583a18f Author: James Zhu Date: Sat Jul 2 20:00:41 2022 -0400 drm/amdgpu/vcn: update ucode setup Use common amdgpu_vcn_setup_ucode for ucode setup. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 53054e9a7775c228ada4d052f3e7849e71072811 Author: James Zhu Date: Sat Jul 2 19:34:00 2022 -0400 drm/amdgpu/vcn: update new doorbell map New doorbell map is used for VCN 4.0.3. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 492c464750587ea033d7a2fcaa21f902e345b383 Author: James Zhu Date: Sat Jul 2 16:41:52 2022 -0400 drm/amdgpu/jpeg: update jpeg header to support multiple AIDs Add aid_id in jpeg header to support multiple AIDs. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit f9f74df58faa4d6744acc6d91a81a86895bc7fe8 Author: James Zhu Date: Sat Jul 2 16:41:16 2022 -0400 drm/amdgpu/vcn: update vcn header to support multiple AIDs Add aid_id in vcn header to support multiple AIDs Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit d244a4167a0276db054d588e11f8142942bcf529 Author: James Zhu Date: Sat Jul 2 16:04:26 2022 -0400 drm/amdgpu/vcn: use vcn4 irqsrc header for VCN 4.0.3 Use vcn4 irqsrc header for VCN 4.0.3. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 8078f1c610fdcdd8003e2c538fb04af41fa5c269 Author: Lijo Lazar Date: Wed Jun 29 11:41:53 2022 +0530 drm/amdgpu: Change num_xcd to xcc_mask Instead of number of XCCs, keep a mask of XCCs for the exact XCCs available on the ASIC. XCC configuration could differ based on different ASIC configs. v2: Rename num_xcd to num_xcc (Hawking) Use smaller xcc_mask size, changed to u16 (Le) Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 9eb7681f760c77adece36bc62953245c9f44a3be Author: Shiwu Zhang Date: Mon Feb 21 15:38:39 2022 +0800 drm/amdgpu: add the support of XGMI link for GC 9.4.3 Add the xgmi LFB_CNTL/LBF_SIZE reg addresses to fetch the xgmi info from. v2: move get_xgmi_info() to GC_V9_4_3 sepecific source files to utilize the register definitions specific for GC_V9_4_3 v3: remove the duplicated register definitions v4: enable xgmi based on asic_type as XGMI_IP ver is not available yet for IP discovery Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Ack-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cd8d77f328c53aad8915c9c4d64cf557742bb257 Author: Hawking Zhang Date: Fri May 27 13:47:24 2022 +0800 drm/amdgpu: add new vram type for dgpu hbm3 will be supported in some dgpu program Signed-off-by: Hawking Zhang Reviewed-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit d1d22df174ae512c57374f517e346b608f61555c Author: Mukul Joshi Date: Tue Jun 7 14:46:18 2022 -0400 drm/amdkfd: Populate memory info before adding GPU node to topology The local memory info needs to be fetched before the GPU node is added to topology. Without this, the sysfs is incorrectly populated and the size is reported as 0. This was causing rocr tests to fail. This issue was caused because of a bad merge. Signed-off-by: Mukul Joshi Reviewed-by: Amber Lin Signed-off-by: Alex Deucher commit 1bd6dd21fcd53ac78a9018b96699ef1aa99a3e59 Author: Mukul Joshi Date: Tue May 31 16:31:28 2022 -0400 drm/amdkfd: Add SDMA info for SDMA 4.4.2 Update SDMA queue information for SDMA 4.4.2. Signed-off-by: Mukul Joshi Signed-off-by: Alex Deucher commit 643e40d4c06f8c887af1789c7bf8d279e9c8e4cf Author: Mukul Joshi Date: Tue May 31 16:25:16 2022 -0400 drm/amdkfd: Fix SDMA in CPX mode When creating a user-mode SDMA queue, CP FW expects driver to use/set virtual SDMA engine id in MAP_QUEUES packet instead of using the physical SDMA engine id. Each partition node's virtual SDMA number should start from 0. However, when allocating doorbell for the queue, KFD needs to allocate the doorbell from doorbell space corresponding to the physical SDMA engine id, otherwise the hwardware will not see the doorbell press. Signed-off-by: Mukul Joshi Reviewed-by: Amber Lin Signed-off-by: Alex Deucher commit 92085240ef9c0ec60c27a60b3cc0d4f5266fa511 Author: Jonathan Kim Date: Tue May 3 10:16:46 2022 -0400 drm/amdkfd: add gpu compute cores io links for gfx9.4.3 The PSP TA will only provide xGMI topology info for links between GPU sockets so links between partitions from different sockets will be hardcoded as 3 xGMI hops with 1 hops weighted as xGMI and 2 hops weighted with a new intra-socket weight to indicate the longest possible distance. If the link between a partition and the CPU is non-PCIe, then assume the CPU (CCDs) is located within the same socket as the partition and represent the link as an intra-socket weighted single hop XGMI link with memory bandwidth. Links between partitions within a single socket will be abstracted as single hop xGMI links weighted with the new intra-socket weight and will have memory bandwidth. Finally, use the unused function bits in the location ID to represent the coordinates of the compute partition within its socket. A follow on patch will resolve the requirement for GPU socket xGMI link representation sometime later. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 20bedf1379b1d4b060e3f43661f35e5447d0cfed Author: Le Ma Date: Mon Apr 25 22:19:58 2022 +0800 drm/amdgpu: introduce new doorbell assignment table for GC 9.4.3 Four basic reasons as below to do the change: 1. number of ring expand a lot on GC 9.4.3, and adjustment on old assignment cannot make each ring in a continuous doorbell space. 2. the SDMA doorbell index should not exceed 0x1FF on SDMA 4.2.2 due to regDOORBELLx_CTRL_ENTRY.BIF_DOORBELLx_RANGE_OFFSET_ENTRY field width. 3. re-design the doorbell assignment and unify the calculation as "start + ring/inst id" will make the code much concise. 4. only defining the START/END makes the table look simple v2: (Lijo) 1. replace name 2. use num_inst_per_aid/sdma_doorbell_range instead of hardcoding Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 36be0181eab50abbb043a087988e6c2bef59dd45 Author: Le Ma Date: Wed Apr 20 23:25:48 2022 +0800 drm/amdgpu: program GRBM_MCM_ADDR for non-AID0 GRBM Otherwise the EOP interrupt on non-AID0 cannot route to IH0. Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit feb36dd01403689140a42f906fc75769d3158400 Author: Le Ma Date: Fri Mar 18 16:46:04 2022 +0800 drm/amdgpu: convert the doorbell_index to 2 dwords offset for kiq KIQ doorbell_index is non-zero from XCC1, thus need to left-shift it like other rings. Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 5de6bd6a13f1c717279c870eb8290e466c8f6a80 Author: Le Ma Date: Fri Feb 25 15:47:20 2022 +0800 drm/amdgpu: set mmhub bitmask for multiple AIDs Like GFXHUB, set MMHUB0 bitmask for each AID. Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 0d81101c190d1835f1bfba85dc3d65b9f9cacd68 Author: Le Ma Date: Fri Feb 25 15:14:19 2022 +0800 drm/amdgpu: complement the IH node_id table for multiple AIDs With different node_id, the SDMA interrupt from multiple AIDs can be distinguished by sw driver. Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit ed42f2cc3b56955310a16da726886e684ed88432 Author: Le Ma Date: Thu Feb 24 16:26:07 2022 +0800 drm/amdgpu: correct the vmhub reference for each XCD in gfxhub init Correct this though the value is same across different vmhub. Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 3a1083873ba7730970665d04c33680f96b27e3b4 Author: Le Ma Date: Wed Mar 2 17:33:24 2022 +0800 drm/amdgpu: do mmhub init for multiple AIDs Mmhub on each AID needs to be initialized respectively Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 2a47a2d90e5cd96c24503061c8920a1e6ee248a0 Author: Le Ma Date: Tue Mar 1 19:42:29 2022 +0800 drm/amdgpu: assign the doorbell index for sdma on non-AID0 Allocate new sdma doorbell index for the instances only on AID1 for now. Todo: there's limitation that SDMA doorbell index on SDMA 4.4.2 needs to be less than 0x1FF, so the tail part in _AMDGPU_VEGA20_DOORBELL_ASSIGNMENT is not enough to store sdma doorbell range on maximum 4 AIDs if doorbell_range is 20. So it looks better to create a new doorbell index assignment table for 4.4.2. v2: change "(x << 1) + 2" to "(x + 1) << 1" for readability. Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit f786b1d4ec778a5fc23911f06a0e38c9f4953b0c Author: Le Ma Date: Wed Apr 20 17:03:00 2022 +0800 drm/amdgpu: add support for SDMA on multiple AIDs Initialize SDMA instances on each AID. v2: revise coding fault in hw_fini Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 386ea27c3b0bcdd5b5be74bdf26022ab931eae7b Author: Le Ma Date: Wed Feb 23 11:43:01 2022 +0800 drm/amdgpu: adjust some basic elements for multiple AID case add some elements below: - num_aid - aid_id for each sdma instance - num_inst_per_aid for sdma and extend macro size below: - SDMA_MAX_INSTANCES to 16 - AMDGPU_MAX_RINGS to 96 - AMDGPU_MAX_HWIP_RINGS to 32 v2: move aid_id from amdgpu_ring to amdgpu_sdma_instance. (Lijo) Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 0ee20b86966cff359f51051a56f8c2d89b09aed4 Author: Le Ma Date: Mon Feb 28 19:30:10 2022 +0800 drm/amdgpu: assign the doorbell index in 1st page to sdma page queue Previously for vega10, the sdma_doorbell_range is only enough for sdma gfx queue, thus the index on second doorbell page is allocated for sdma page queue. From vega20, the sdma_doorbell_range on 1st page is enlarged. Therefore, just leverage these index instead of allocation on 2nd page. v2: change "(x << 1) + 2" to "(x + 1) << 1" for readability and add comments. Signed-off-by: Le Ma Acked-by: Felix Kuehling Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit d25555866172a0454b0dc1374b0ff29e1ae5f676 Author: Amber Lin Date: Wed Mar 23 11:01:52 2022 -0400 drm/amdgpu: Set XNACK per process on GC 9.4.3 Set RETRY_PERMISSION_OR_INVALID_PAGE_FAULT bit in VM_CONTEXT1_CNTL as well so XNACK can be enabled in the SQ per process. Signed-off-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 5db392a04575120de4e73ee10c0dc727426100c7 Author: Lijo Lazar Date: Thu Mar 10 16:45:53 2022 +0530 drm/amdgpu: Use new atomfirmware init for GC 9.4.3 Use the new atomfirmware initialization logic for GC 9.4.3 based ASICs also. ASIC init logic doesn't consider boot clocks during init. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0f072c1e2453e6c56b233b15a2f5d50606f02d85 Author: Hans de Goede Date: Thu May 11 18:33:06 2023 +0100 media: atomisp: Turn asd->streaming state tracker into a bool The ATOMISP_DEVICE_STREAMING_STOPPING pipe state comes from when we still had continuous mode. This would be set when streaming from both capture + preview devnodes when 1 of the 2 streams has been stopped and the driver was waiting for the other stream to get stopped too. With continuous mode gone the stopping state is no longer necessary and asd->streaming can be changed to a bool. Note that atomisp_assert_recovery_work() would still temporarily set streaming to stopping, but it does so with the isp->mutex held and changes streaming to either enabled or disabled before releasing the mutex, so none of the consumers which care about the difference ever see the stopping state. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit ef75a6ef37235e211bbdb17c25e5f79c55df1750 Author: Rajneesh Bhardwaj Date: Thu Mar 3 10:56:05 2022 -0500 drm/amdkfd: Update coherence settings for svm ranges Recently introduced commit "drm/amdgpu: Set cache coherency for GC 9.4.3" did not update the settings applicable for svm ranges. Add the coherence settings for svm ranges for GFX IP 9.4.3. Reviewed-by: Amber Lin Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit a8027fcd08f9127d38edeb59600ecb76c56a121a Author: Mukul Joshi Date: Wed Mar 2 21:40:38 2022 -0500 drm/amdgpu: Fix CP_HYP_XCP_CTL register programming in CPX mode Currently, in CPX mode, the CP_HYP_XCP_CTL register is programmed incorrectly with the number of XCCs in the partition. As a result, HIQ doesn't work in CPX mode. Fix this by programming the correct number of XCCs in a partition, which is 1, in CPX mode. Signed-off-by: Mukul Joshi Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit a805889a15315f7fa78c1c4bb2f1875c7c43f919 Author: Mukul Joshi Date: Mon May 9 22:52:39 2022 -0400 drm/amdkfd: Update SDMA queue management for GFX9.4.3 This patch updates SDMA queue management for multi XCC in GFX9.4.3. - Allocate/deallocate SDMA queues from the correct SDMA engines based on the partition mode. - Updates the kgd2kfd interface to fetch the correct SDMA register addresses. - It also fixes dumping correct SDMA queue info in debugfs. v2: squash in fix "drm/amdkfd: Fix XGMI SDMA user-mode queue allocation" Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit f38f147ab3121adbd7510a82e6eb0b41a356c26e Author: Mukul Joshi Date: Mon May 9 22:35:55 2022 -0400 drm/amdkfd: Update sysfs node properties for multi XCC Update simd_count and array_count node properties to report values multiplied by number of XCCs in the partition. Signed-off-by: Mukul Joshi Tested-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 5e4060123687c4f2c9fb855874f77b14f07526d6 Author: Mukul Joshi Date: Mon May 9 22:34:38 2022 -0400 drm/amdkfd: Call DQM stop during DQM uninitialize During DQM tear down, call DQM stop to unitialize HIQ and associated memory allocated during packet manager init. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 21e1217b4c0e0234704d50ea303c7603266604ac Author: Mukul Joshi Date: Mon May 9 22:30:57 2022 -0400 drm/amdgpu: Fix VM fault reporting on XCC1 Fix VM fault reporting and clear VM fault register for XCC1. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 7fe51e6fd2368b358441a1f6e0c94f4cd7e0720f Author: Mukul Joshi Date: Mon May 9 22:25:25 2022 -0400 drm/amdkfd: Update context save handling for multi XCC setup (v2) Context save handling needs to be updated for a multi XCC setup: - On a multi XCC setup, KFD needs to report context save base address and size for each XCC in MQD. - Thunk will allocate a large context save area covering all XCCs which will be equal to: num_of_xccs in a partition * size of context save area for 1 XCC. However, it will report only the size of context save area for 1 XCC only in the ioctl call. - Driver then setups the MQD correctly using the size passed from Thunk and information about number of XCCs in a partition. - Update get_wave_state function to return context save area for all XCCs in the partition. v2: update the get_wave_state function for mqd manager v11 (Morris) Signed-off-by: Mukul Joshi Tested-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Morris Zhang Signed-off-by: Alex Deucher commit f87f686482c6d2d4465245356854710b01f312c1 Author: Mukul Joshi Date: Mon May 9 22:22:20 2022 -0400 drm/amdgpu: Add XCC inst to PASID TLB flushing Add XCC instance to select the correct KIQ ring when flushing TLBs on a multi-XCC setup. Signed-off-by: Mukul Joshi Tested-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit e2069a7b0880ccdc6fa6530b6091e47168705425 Author: Mukul Joshi Date: Mon May 9 22:20:52 2022 -0400 drm/amdkfd: Add XCC instance to kgd2kfd interface (v3) Gfx 9 starts to have multiple XCC instances in one device. Add instance parameter to kgd2kfd functions where XCC instance was hard coded as 0. Also, update code to pass the correct instance number when running on a multi-XCC setup. v2: introduce the XCC instance to gfx v11 (Morris) v3: rebase (Alex) Signed-off-by: Amber Lin Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Tested-by: Amber Lin Signed-off-by: Morris Zhang Signed-off-by: Alex Deucher commit 3c8bdb51be0e895010da62dfa173bb1227ff3b6f Author: Mukul Joshi Date: Mon May 9 21:50:43 2022 -0400 drm/amdkfd: Add PM4 target XCC In a device that supports multiple XCCs, unlike AQL queues, the PM4 queue will be only processed in one XCC in the partitioning. This patch re-purposes the queue percentage variable in create queue and update queue ioctl for the user space to specify the target XCC. Signed-off-by: Amber Lin Signed-off-by: Mukul Joshi Tested-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2f77b9a242a2e01822efc80c8b63eaa31df0f8b4 Author: Mukul Joshi Date: Mon May 9 21:45:50 2022 -0400 drm/amdkfd: Update MQD management on multi XCC setup Update MQD management for both HIQ and user-mode compute queues on a multi XCC setup. MQDs needs to be allocated, initialized, loaded and destroyed for each XCC in the KFD node. v2: squash in fix "drm/amdkfd: Fix SDMA+HIQ HQD allocation on GFX9.4.3" Signed-off-by: Mukul Joshi Signed-off-by: Amber Lin Tested-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 74c5b85da75475c73a8f040397610fbfcc2c3e78 Author: Mukul Joshi Date: Mon May 9 16:33:38 2022 -0400 drm/amdkfd: Add spatial partitioning support in KFD This patch introduces multi-partition support in KFD. This patch includes: - Support for maximum 8 spatial partitions in KFD. - Initialize one HIQ per partition. - Management of VMID range depending on partition mode. - Management of doorbell aperture space between all partitions. - Each partition does its own queue management, interrupt handling, SMI event reporting. - IOMMU, if enabled with multiple partitions, will only work on first partition. - SPM is only supported on the first partition. - Currently, there is no support for resetting individual partitions. All partitions will reset together. Signed-off-by: Mukul Joshi Tested-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 8dc1db3172ae2f17ae71e33b608a33411ce8a1aa Author: Mukul Joshi Date: Wed Sep 14 16:39:48 2022 +0800 drm/amdkfd: Introduce kfd_node struct (v5) Introduce a new structure, kfd_node, which will now represent a compute node. kfd_node is carved out of kfd_dev structure. kfd_dev struct now will become the parent of kfd_node, and will store common resources such as doorbells, GTT sub-alloctor etc. kfd_node struct will store all resources specific to a compute node, such as device queue manager, interrupt handling etc. This is the first step in adding compute partition support in KFD. v2: introduce kfd_node struct to gc v11 (Hawking) v3: make reference to kfd_dev struct through kfd_node (Morris) v4: use kfd_node instead for kfd isr/mqd functions (Morris) v5: rebase (Alex) Signed-off-by: Mukul Joshi Tested-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Hawking Zhang Signed-off-by: Morris Zhang Signed-off-by: Alex Deucher commit 5cf1675591dd28afc498348757469a87c1e9fcf2 Author: Lijo Lazar Date: Mon Feb 28 12:25:15 2022 +0530 drm/amdgpu: Add mode2 reset logic for v13.0.6 Mode2 reset for v13.0.6 has similar workflow as v13.0.2 Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e6a02e2cc7fe3fec05eeaf08855e57d616a037e1 Author: Lijo Lazar Date: Fri Feb 18 15:04:35 2022 +0530 drm/amdgpu: Add some XCC programming Add additional XCC programming sequences. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 15091a6f4380a0c1a7202d52e82cdaaf80e2bb70 Author: Le Ma Date: Fri Nov 19 18:03:34 2021 +0800 drm/amdgpu: add node_id to physical id conversion in EOP handler A new field nodeid in interrupt cookie indicates the node ID. Signed-off-by: Le Ma Reviewed-by: Shiwu Zhang Signed-off-by: Alex Deucher commit 147862d00bcf7e23e0a125f910f5db224f7b6722 Author: Shiwu Zhang Date: Fri Jun 3 11:08:12 2022 +0800 drm/amdgpu: enable the ring and IB test for slave kcq With the mec FW update to utilize the mqd base set by driver for kcq mapping, slave kcq ring test and IB test can be re-enabled. Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 89cf4549a949b4ba3ce771163b75285979c95602 Author: Hawking Zhang Date: Mon May 23 13:53:45 2022 +0800 drm/amdgpu: support gc v9_4_3 ring_test running on all xcc Each xcc has its own sratch_reg offset Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit ae972ed5e0dcb3fab57020e243563cc484b8969a Author: James Zhu Date: Mon Feb 7 10:25:47 2022 -0500 drm/amdgpu: fix vcn doorbell range setting Should use vcn_ring0_1 instead of doorbell index to set nbio doorbell range. Signed-off-by: James Zhu Reviewed-by: Sonny Jiang Signed-off-by: Alex Deucher commit 6ddae0f3ab18a64e83bcf7b090e085394046f130 Author: James Zhu Date: Sat Jan 29 10:34:05 2022 -0500 drm/amdgpu/jpeg: enable jpeg doorbell for jpeg4.0.3 Enable jpeg doorbell for jpeg4.0.3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit c21d446ba7a83ab9f15fae8f9c732bb94f8a5677 Author: James Zhu Date: Sat Jan 29 10:28:26 2022 -0500 drm/amdgpu/vcn: enable vcn doorbell for vcn4.0.3 Enable vcn doorbell for vcn4.0.3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit d7fd2a9e394b5f2bb900fc4e1e04e8dd4a97a7be Author: James Zhu Date: Sat Jan 29 10:24:26 2022 -0500 drm/amdgpu/nbio: update vcn doorbell range VCN4.0.3 used up to 16 doorbells per partition. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit bfb44eacb0e2de63bc7824cc590ede51a02a7ded Author: Amber Lin Date: Thu Jan 27 09:02:16 2022 -0500 drm/amdkfd: Set F8_MODE for gc_v9_4_3 Set F8_MODE for GC 9.4.3 as optimal/non-IEEE. Also update gc_v9_0 to gc_v9_4_3 to include more definitions such as the F8_MODE bit, and remove unused header files. v2: fix IP version check (Alex) Signed-off-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit db77081fe3c88a31eaade8a9c565c48c4d51b093 Author: James Zhu Date: Wed Jan 19 23:32:43 2022 -0500 drm/amdgpu/jpeg: add multiple jpeg rings support for vcn4_0_3 Add multiple jpeg rings support for vcn4_0_3 Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit bc224553843e526bad4bb91188363aea1664a70d Author: James Zhu Date: Tue May 24 12:03:03 2022 +0800 drm/amdgpu/jpeg: add multiple jpeg rings support Add multiple jpeg rings support. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 31c0ec84f92cd40cfae210dac59413372996b5e7 Author: James Zhu Date: Sun Jan 9 16:05:31 2022 -0500 drm/amdgpu/vcn: enable vcn DPG mode for VCN4_0_3 Enable vcn DPG mode for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit ef3aa0b40c4b1f4d8b7db8582833cb61fc673f60 Author: James Zhu Date: Sun Jan 9 16:05:07 2022 -0500 drm/amdgpu/vcn: enable vcn pg for VCN4_0_3 Enable vcn pg for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 342397db6d09068e335d42a97e0879b7f5f99364 Author: James Zhu Date: Sun Jan 9 16:04:41 2022 -0500 drm/amdgpu/vcn: enable vcn cg for VCN4_0_3 Enable vcn cg for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit b7179fc29f50d837090d7b0c1f224e3a116cdcc2 Author: James Zhu Date: Sun Jan 9 16:04:05 2022 -0500 drm/amdgpu/jpeg: enable jpeg pg for VCN4_0_3 Enable jpeg pg for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 380302f8b894a11fcd84a08aadf6a858eb003b0b Author: James Zhu Date: Sun Jan 9 16:03:25 2022 -0500 drm/amdgpu/jpeg: enable jpeg cg for VCN4_0_3 Enable jpeg cg for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit b889ef4ac98837838c38f7b9f72bba2f33ee367d Author: James Zhu Date: Tue May 24 11:56:44 2022 +0800 drm/amdgpu/vcn: add vcn support for VCN4_0_3 Add vcn support for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit e1278e6187b804566b789bdfd5339cceed035d71 Author: Hans de Goede Date: Thu May 11 18:18:24 2023 +0100 media: atomisp: Simplify atomisp_pipe_check() All switch (pipe->asd->streaming) cases in atomisp_pipe_check() are either no-ops or never happen: 1. ATOMISP_DEVICE_STREAMING_DISABLED already is a no-op 2. The videobuf2 core guarantees that when we are streaming vb2_is_busy() returns true. So the ATOMISP_DEVICE_STREAMING_ENABLED case is already handled by the if above the switch (pipe->asd->streaming). 3. After recent changes pipe->asd->streaming is only ever set to ATOMISP_DEVICE_STREAMING_STOPPING in atomisp_assert_recovery_work() and that function holds isp->mutex and always transitions the streaming state to ATOMISP_DEVICE_STREAMING_DISABLED or ATOMISP_DEVICE_STREAMING_ENABLED before releasing the mutex. So atomisp_pipe_check() never sees ATOMISP_DEVICE_STREAMING_STOPPING. Remove the entire switch-case. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit e684e654eba9481a9f462a7bbf5c385b7d1c076e Author: James Zhu Date: Thu Jan 6 17:04:42 2022 -0500 drm/amdgpu/jpeg: add jpeg support for VCN4_0_3 Add jpeg support for VCN4_0_3. v2: squash in delayed work typo fix (Alex) Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 76e5e4c70160b3764db6093b3366b36e4466d727 Author: James Zhu Date: Thu Jan 6 14:41:33 2022 -0500 drm/amdgpu: add VCN4_0_3 firmware Add VCN4_0_3 firmware. v2: fix fw name (Alex) Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 50b8b62ea496c615fb08ccc8a6fdf1891af75d7e Author: Hawking Zhang Date: Sun Apr 24 15:38:16 2022 +0800 drm/amdgpu: add vcn v4_0_3 ip headers Add vcn v4_0_3 register offset adn shift masks header files v2: update headers (Alex) Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 81283fee15ea6afb1e32defb369c3b96d2d6765c Author: James Zhu Date: Wed Jan 19 22:32:41 2022 -0500 drm/amdgpu/: add more macro to support offset variant Add more macro to support offset variant and simplify macro SOC15_WAIT_ON_RREG. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 9b4fd27601fbe7f77e7f8a8ca226211ef748844b Author: Lijo Lazar Date: Wed Jan 12 19:42:56 2022 +0530 drm/amdgpu: Use the correct API to read register Use SOC15 API so that the register offset is calculated correctly. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f544afac3f34124088b981c63843a3cc48f4ee3e Author: Amber Lin Date: Tue May 17 23:41:01 2022 +0800 drm/amdgpu: Add kgd2kfd for GC 9.4.3 New GC (v9.4.3) and ATHUB (v1.8.0) versions are used. Add kgd_gfx_v9_4_3_* functions if registers in use of kgd_gfx_v9_* functions are changed or have different offset. Signed-off-by: Amber Lin Acked-by: Felix Kuehling Reviewed-by: Mukul Joshi Signed-off-by: Alex Deucher commit 62e790879efbf09edb9f262d5eb7765aeaf89809 Author: Shiwu Zhang Date: Thu Dec 23 13:44:48 2021 +0800 drm/amdgpu: alloc vm inv engines for every vmhub There are AMDGPU_MAX_VMHUBS of vmhub in maximum and need to init the vm_inv_engs for all of them. In this way, the below error can be ruled out. [ 217.317752] amdgpu 0000:02:00.0: amdgpu: no VM inv eng for ring sdma0 Signed-off-by: Shiwu Zhang Reviewed-by: Christian Koenig Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 0fa49d108386c201b5c2cce68066a9b8f66883a5 Author: Shiwu Zhang Date: Fri Dec 17 11:27:53 2021 +0800 drm/amdgpu: override partition mode through module parameter Add a module parameter to override the partition mode. Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 99951878b048e39278bb05d96831353eca23b75f Author: Shiwu Zhang Date: Mon Nov 29 20:44:05 2021 +0800 drm/amdgpu: make the WREG32_SOC15_xx macro to support multi GC To write regs on different GCDs, use the inst index. Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 98a54e88e87f7291d4bbc6ec646c498f64ae042f Author: Le Ma Date: Tue May 17 22:20:10 2022 +0800 drm/amdgpu: add sysfs node for compute partition mode Add current/available compute partitin mode sysfs node. v2: make the sysfs node as IP independent one in amdgpu_gfx.c Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 3566938b3491bb3aad701b487130f3efc363e2dc Author: Le Ma Date: Mon Dec 20 16:06:25 2021 +0800 drm/amdgpu: assign different AMDGPU_GFXHUB for rings on each xcc Pass the xcc_id to AMDGPU_GFXHUB(x) Signed-off-by: Le Ma Reviewed-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ce8a12a532ed62d7037be91c5714243fdfa9f672 Author: Le Ma Date: Mon Dec 20 16:42:20 2021 +0800 drm/amdgpu: init vmhubs bitmask for GC 9.4.3 Each XCD owns one GFXHUB. v2: switch to the new VMHUB layout Signed-off-by: Le Ma Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d9426c3d9b4e91dda4f1f1684f9296762fafe0de Author: Le Ma Date: Mon Dec 20 16:06:25 2021 +0800 drm/amdgpu: add bitmask to iterate vmhubs As the layout of VMHUB definition has been changed to cover multiple XCD/AID case, the original num_vmhubs is not appropriate to do vmhub iteration any more. Drop num_vmhubs and introduce vmhubs_mask instead. v2: switch to the new VMHUB layout v3: use DECLARE_BITMAP to define vmhubs_mask Signed-off-by: Le Ma Reviewed-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b35ce49ab9ca2bc6a59d4441efc5039de80643ce Author: Le Ma Date: Sun Dec 19 11:03:59 2021 +0800 drm/amdgpu: assign register address for vmhub object on each XCD Each XCD has its own gfxhub. v2: switch to the new VMHUB layout v3: fix mistake Signed-off-by: Le Ma Reviewed-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f4caf5842652f08e024741ef6d423cb0c101d863 Author: Hawking Zhang Date: Wed Sep 14 16:35:50 2022 +0800 drm/amdgpu: introduce vmhub definition for multi-partition cases (v3) v1: Each partition has its own gfxhub or mmhub. adjust the num of MAX_VMHUBS and the GFXHUB/MMHUB layout (Le) v2: re-design the AMDGPU_GFXHUB/AMDGPU_MMHUB layout (Le) v3: apply the gfxhub/mmhub layout to new IPs (Hawking) v4: fix up gmc11 (Alex) v5: rebase (Alex) Signed-off-by: Le Ma Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit 629b8ede8b93428b8d124d343b5fbb57ab64d5a8 Author: Aric Cyr Date: Mon May 8 00:32:41 2023 -0400 drm/amd/display: 3.2.236 Acked-by: Aurabindo Pillai Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3a31e8b89b7240d9a17ace8a1ed050bdcb560f9e Author: Daniel Miess Date: Tue Apr 25 14:02:02 2023 -0400 drm/amd/display: Remove v_startup workaround for dcn3+ [Why] Calls to dcn20_adjust_freesync_v_startup are no longer needed as of dcn3+ and can cause underflow in some cases [How] Move calls to dcn20_adjust_freesync_v_startup up into validate_bandwidth for dcn2.x Reviewed-by: Jun Lei Acked-by: Aurabindo Pillai Signed-off-by: Daniel Miess Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 50a32b8cf4d7624eb8606b4cb7bc6dee37703da6 Author: Rodrigo Siqueira Date: Mon May 1 16:30:54 2023 -0600 drm/amd/display: Remove unnecessary variable There is no need to use dc_version in the dc_construct_ctx since this value is copied to dc_ctx->dce_version later. This commit removes the extra steps. Reviewed-by: Alex Hung Acked-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fe9fa3859b66caf4a6923598c8e343b8a32ec5d1 Author: Alvin Lee Date: Fri May 5 11:06:26 2023 -0400 drm/amd/display: Make unbounded req update separate from dlg/ttu [Description] - Updates to unbounded requesting should not be conditional on updates to dlg / ttu, as this could prevent unbounded requesting from being updated if dlg / ttu does not change Reviewed-by: Jun Lei Acked-by: Aurabindo Pillai Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d205a800a66e46430ab93c0d450393233d39931a Author: Leo (Hanghong) Ma Date: Wed Apr 12 14:02:01 2023 -0400 drm/amd/display: Add visual confirm color support for MCLK switch [Why && How] We would like to have visual confirm color support for MCLK switch. 1. Set visual confirm color to yellow: Vblank MCLK switch. 2. Set visual confirm color to cyan: FPO + Vblank MCLK switch. 3. Set visual confirm color to pink: Vactive MCLK switch. Reviewed-by: Jun Lei Acked-by: Aurabindo Pillai Signed-off-by: Leo (Hanghong) Ma Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1a4bcdbea4319efeb26cc4b05be859a7867e02dc Author: Daniel Miess Date: Tue Apr 25 14:29:48 2023 -0400 drm/amd/display: Fix possible underflow for displays with large vblank [Why] Underflow observed when using a display with a large vblank region and low refresh rate [How] Simplify calculation of vblank_nom Increase value for VBlankNomDefaultUS to 800us Reviewed-by: Jun Lei Acked-by: Aurabindo Pillai Signed-off-by: Daniel Miess Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9c384ee8f997d0646844cd431f1c23e6dbf84a98 Author: Rodrigo Siqueira Date: Wed Apr 26 18:17:13 2023 -0600 drm/amd/display: Convert connector signal id to string To improve the readability of the of the log, this commit introduces a function that converts the signal type id to a human-readable string. Reviewed-by: Jerry Zuo Acked-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6ba5a269cdc9f447be882bbf99548361c8ebc254 Author: Alvin Lee Date: Tue May 2 12:27:26 2023 -0400 drm/amd/display: Update vactive margin and max vblank for fpo + vactive [Description] - Some 1920x1080@60hz displays have VBLANK time > 600us which we still want to accept for FPO + Vactive configs based on testing - Increase max VBLANK time to 1000us to allow these configs for FPO + Vactive - Increase minimum vactive switch margin for FPO + Vactive to 200us - Based on testing, 1920x1080@120hz can have a switch margin of ~160us which requires significantly longer FPO stretch margin (5ms) which we don't want to accept for now - Also move margins into debug option Reviewed-by: Jun Lei Reviewed-by: Nevenko Stupar Acked-by: Aurabindo Pillai Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1d8355ad922423c9f765a644ed04526a6273d9ee Author: Alvin Lee Date: Tue May 2 09:54:56 2023 -0400 drm/amd/display: Only skip update for DCFCLK, UCLK, FCLK on overclock [Description] - Update clocks is skipped in the GPU overclock sequence - However, we still need to update DISPCLK, DPPCLK, and DTBCLK because the GPU overclock sequence could temporarily disable ODM 2:1 combine because we disable all planes in the sequence Reviewed-by: Jun Lei Acked-by: Aurabindo Pillai Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 347f2e56b94e1ed197daa6697b22af049a82157d Author: Hans de Goede Date: Thu May 11 16:39:37 2023 +0100 media: atomisp: Simplify atomisp_open() and atomisp_release() Now that continuous mode is gone and we only have 1 /dev/video# node, combined with only allowing 1 open of that /dev/video# node for now, there is no need to check for other (sub)dev / pipe users. Remove the unnecessary checks for a nice cleanup. Note we also don't need to set asd->streaming to disabled since the vb2_fop_release() call done by atomisp_release() will have called atomisp_stop_streaming() already at this point (if necessary) and that will have already done this. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit f1822392128e00c1ae1579fe050ae3797db6ea02 Author: Mustapha Ghaddar Date: Fri Apr 28 12:13:21 2023 -0400 drm/amd/display: enable dpia validate Use dpia_validate_usb4_bw() function Fixes: a8b537605e22 ("drm/amd/display: Add function pointer for validate bw usb4") Reviewed-by: Roman Li Reviewed-by: Meenakshikumar Somasundaram Acked-by: Aurabindo Pillai Signed-off-by: Mustapha Ghaddar Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 572773992e31e0e31692adf6797a3bf7e094097c Author: Evan Quan Date: Thu May 11 15:41:27 2023 +0800 drm/amd/pm: fix possible power mode mismatch between driver and PMFW PMFW may boots the ASIC with a different power mode from the system's real one. Notify PMFW explicitly the power mode the system in. This is needed only when ACDC switch via gpio is not supported. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 3083b1007d4b8d377f8e2b5ce349a275a2fff725 Author: Guchun Chen Date: Tue May 9 16:15:27 2023 +0800 drm/amdgpu: skip disabling fence driver src_irqs when device is unplugged When performing device unbind or halt, we have disabled all irqs at the very begining like amdgpu_pci_remove or amdgpu_device_halt. So amdgpu_irq_put for irqs stored in fence driver should not be called any more, otherwise, below calltrace will arrive. [ 139.114088] WARNING: CPU: 2 PID: 1550 at drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:616 amdgpu_irq_put+0xf6/0x110 [amdgpu] [ 139.114655] Call Trace: [ 139.114655] [ 139.114657] amdgpu_fence_driver_hw_fini+0x93/0x130 [amdgpu] [ 139.114836] amdgpu_device_fini_hw+0xb6/0x350 [amdgpu] [ 139.114955] amdgpu_driver_unload_kms+0x51/0x70 [amdgpu] [ 139.115075] amdgpu_pci_remove+0x63/0x160 [amdgpu] [ 139.115193] ? __pm_runtime_resume+0x64/0x90 [ 139.115195] pci_device_remove+0x3a/0xb0 [ 139.115197] device_remove+0x43/0x70 [ 139.115198] device_release_driver_internal+0xbd/0x140 Signed-off-by: Guchun Chen Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 6e87c4229513904295674b84b6e2d12951567191 Author: Alex Sierra Date: Mon Apr 24 14:27:26 2023 -0500 drm/amdgpu: improve wait logic at fence polling Accomplish this by reading the seq number right away instead of sleep for 5us. There are certain cases where the fence is ready almost immediately. Sleep number granularity was also reduced as the majority of the kiq tlb flush takes between 2us to 6us. Signed-off-by: Alex Sierra Acked-by: Felix Kuehling Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 17d62410aec363ec972f532fed5aba89b3f59ae7 Author: Alex Deucher Date: Thu May 11 10:40:03 2023 -0400 drm/amdgpu/gmc11: implement get_vbios_fb_size() Implement get_vbios_fb_size() so we can properly reserve the vbios splash screen to avoid potential artifacts on the screen during the transition from the pre-OS console to the OS console. Acked-by: Sunil Khatri Signed-off-by: Alex Deucher commit e84e40dcb3fc972cbe41d228f1e45128285e0c47 Author: Jiapeng Chong Date: Fri May 12 15:04:51 2023 +0800 drm/amd/display: Simplify the calculation of variables ./drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c:586:37-39: WARNING !A || A && B is equivalent to !A || B. ./drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c:595:37-39: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4941 Signed-off-by: Jiapeng Chong Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 82ad22bbad008f84ec52208c5ba2c8f1cf55fd8d Author: Jesse Zhang Date: Fri May 12 09:29:17 2023 +0800 drm/amdgpu: Differentiate between Raven2 and Raven/Picasso according to revision id Due to the raven2 and raven/picasso maybe have the same GC_HWIP version. So differentiate them by revision id. Signed-off-by: shanshengwang Signed-off-by: Jesse Zhang Acked-by: Evan Quan Signed-off-by: Alex Deucher commit cabbdea1f1861098991768d7bbf5a49ed1608213 Author: Daniil Dulov Date: Thu May 11 04:23:14 2023 -0700 drm/amdkfd: Fix potential deallocation of previously deallocated memory. Pointer mqd_mem_obj can be deallocated in kfd_gtt_sa_allocate(). The function then returns non-zero value, which causes the second deallocation. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: d1f8f0d17d40 ("drm/amdkfd: Move non-sdma mqd allocation out of init_mqd") Signed-off-by: Daniil Dulov Signed-off-by: Felix Kuehling Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6d99f3f4ea948f26b074a069c0406dd7f1cb0d8f Author: Yifan Zhang Date: Wed May 10 16:13:48 2023 +0800 drm/amdgpu: change gfx 11.0.4 external_id range gfx 11.0.4 range starts from 0x80. Fixes: 311d52367d0a ("drm/amdgpu: add soc21 common ip block support for GC 11.0.4") Signed-off-by: Yifan Zhang Reported-by: Yogesh Mohan Marimuthu Acked-by: Alex Deucher Reviewed-by: Tim Huang Signed-off-by: Alex Deucher commit 1d6ecab1ac0fdff8e62ff3ba506b606177010d08 Author: Srinivasan Shanmugam Date: Tue May 9 19:08:17 2023 +0530 drm/amd/amdgpu: Fix warnings in amdgpu _object, _ring.c Fix below warnings reported by checkpatch: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: static const char * array should probably be static const char * const WARNING: space prohibited between function name and open parenthesis '(' WARNING: braces {} are not necessary for single statement blocks WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit ee30b8001cd85ba0ef287b216eb1dad58bb58159 Author: Guilherme G. Piccoli Date: Tue May 9 18:49:47 2023 +0200 drm/amdgpu/gfx11: Adjust gfxoff before powergating on gfx11 as well (Bas: speculative change to mirror gfx10/gfx9) Signed-off-by: Guilherme G. Piccoli Signed-off-by: Bas Nieuwenhuizen Cc: Alex Deucher Signed-off-by: Alex Deucher commit a39b52c838127a42c57d5e080dbd5204770aa80e Author: Bas Nieuwenhuizen Date: Tue May 9 18:49:46 2023 +0200 drm/amdgpu/gfx10: Disable gfxoff before disabling powergating. Otherwise we get a full system lock (looks like a FW mess). Copied the order from the GFX9 powergating code. Fixes: 366468ff6c34 ("drm/amdgpu: Allow GfxOff on Vangogh as default") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2545 Signed-off-by: Bas Nieuwenhuizen Tested-by: Guilherme G. Piccoli Cc: Alex Deucher Signed-off-by: Alex Deucher commit 71a85e054f3237595c50b1a74919185597fa2fba Author: Hans de Goede Date: Thu May 11 19:27:24 2023 +0100 media: atomisp: Simplify atomisp_css_[start|stop]() Now that continuous mode is gone and we only have 1 /dev/video# node, the videobuf2 core guarantees that atomisp_css_[start|stop]() will only be called one at a time. So there is no need for atomisp_streaming_count() counts. When reqbufs has been done then the streams are guaranteed to be created, and streaming cannot be started without reqbufs so there is no need for atomisp_css_start() to check if it needs to create the streams. Use this to clean-up atomisp_css_[start|stop](). While at it also fix atomisp_css_start() not re-creating the streams on an error, breaking the guarantee that the streams are always there after a succesfull reqbufs call. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 3f3ee94c89b79c9addaf83b029edec9b720ec1f7 Author: Hans de Goede Date: Thu May 11 16:03:38 2023 +0100 media: atomisp: Simplify atomisp_[start|stop]_streaming() Now that continuous mode is gone and we only have 1 /dev/video# node, the videobuf2 core guarantees that atomisp_[start|stop]_streaming() will only be called one at a time. So there is no need to check for things like the isp is already streaming when starting, or other streams still being active while stopping. Remove checks for these from atomisp_[start|stop]_streaming(). While at it also improve the logging a bit: 1. Remove the dev_err(isp->dev, "atomisp_reset") logged on every stream stop (even though everything is fine. 2. Log a message when starting/stopping the sensor stream fails Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 3fb9dd5fef7ccd756544713e6e84db1c525816c4 Author: Dan Carpenter Date: Tue May 9 17:21:14 2023 +0300 drm/amdgpu: release correct lock in amdgpu_gfx_enable_kgq() This function was releasing the incorrect lock on the error path. Reported-by: kernel test robot Fixes: 1156e1a60f02 ("drm/amdgpu: add [en/dis]able_kgq() functions") Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit 9a06655e73834819149466ae8170ffe53b23e6f8 Author: Huacai Chen Date: Mon May 8 11:09:41 2023 +0800 drm/amdgpu/display: Enable DC_FP for LoongArch LoongArch now provides kernel_fpu_begin() and kernel_fpu_end() that are used like the x86 counterparts in commit 2b3bd32ea3a22ea2d ("LoongArch: Provide kernel fpu functions"), so we can enable DC_FP on LoongArch for supporting more DCN devices. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit c488a9370d5a1da71f7683e0d6da40a2ab0f1be3 Author: Saleemkhan Jamadar Date: Tue May 9 12:37:50 2023 +0530 drm/amdgpu/jpeg: Remove harvest checking for JPEG3 Register CC_UVD_HARVESTING is obsolete for JPEG 3.1.2 Signed-off-by: Saleemkhan Jamadar Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit d97b02bb9c7aa3008d473d11001e1b45b7e0c7c6 Author: Guchun Chen Date: Sat May 6 20:06:45 2023 +0800 drm/amdgpu/gfx: disable gfx9 cp_ecc_error_irq only when enabling legacy gfx ras gfx9 cp_ecc_error_irq is only enabled when legacy gfx ras is assert. So in gfx_v9_0_hw_fini, interrupt disablement for cp_ecc_error_irq should be executed under such condition, otherwise, an amdgpu_irq_put calltrace will occur. [ 7283.170322] RIP: 0010:amdgpu_irq_put+0x45/0x70 [amdgpu] [ 7283.170964] RSP: 0018:ffff9a5fc3967d00 EFLAGS: 00010246 [ 7283.170967] RAX: ffff98d88afd3040 RBX: ffff98d89da20000 RCX: 0000000000000000 [ 7283.170969] RDX: 0000000000000000 RSI: ffff98d89da2bef8 RDI: ffff98d89da20000 [ 7283.170971] RBP: ffff98d89da20000 R08: ffff98d89da2ca18 R09: 0000000000000006 [ 7283.170973] R10: ffffd5764243c008 R11: 0000000000000000 R12: 0000000000001050 [ 7283.170975] R13: ffff98d89da38978 R14: ffffffff999ae15a R15: ffff98d880130105 [ 7283.170978] FS: 0000000000000000(0000) GS:ffff98d996f00000(0000) knlGS:0000000000000000 [ 7283.170981] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 7283.170983] CR2: 00000000f7a9d178 CR3: 00000001c42ea000 CR4: 00000000003506e0 [ 7283.170986] Call Trace: [ 7283.170988] [ 7283.170989] gfx_v9_0_hw_fini+0x1c/0x6d0 [amdgpu] [ 7283.171655] amdgpu_device_ip_suspend_phase2+0x101/0x1a0 [amdgpu] [ 7283.172245] amdgpu_device_suspend+0x103/0x180 [amdgpu] [ 7283.172823] amdgpu_pmops_freeze+0x21/0x60 [amdgpu] [ 7283.173412] pci_pm_freeze+0x54/0xc0 [ 7283.173419] ? __pfx_pci_pm_freeze+0x10/0x10 [ 7283.173425] dpm_run_callback+0x98/0x200 [ 7283.173430] __device_suspend+0x164/0x5f0 v2: drop gfx11 as it's fixed in a different solution by retiring cp_ecc_irq funcs(Hawking) Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2522 Signed-off-by: Guchun Chen Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 936e95a461c2606ac2ffae3bb0d991e7081eafd8 Author: Guchun Chen Date: Tue May 9 09:36:49 2023 +0800 drm/amd/pm: avoid potential UBSAN issue on legacy asics Prevent further dpm casting on legacy asics without od_enabled in amdgpu_dpm_is_overdrive_supported. This can avoid UBSAN complain in init sequence. v2: add a macro to check legacy dpm instead of checking asic family/type v3: refine macro name for naming consistency Suggested-by: Evan Quan Signed-off-by: Guchun Chen Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit eb4f01784ec1d589629dd8c85044b7c07e5f6993 Author: Guchun Chen Date: Sat May 6 16:52:59 2023 +0800 drm/amdgpu: disable sdma ecc irq only when sdma RAS is enabled in suspend sdma_v4_0_ip is shared on a few asics, but in sdma_v4_0_hw_fini, driver unconditionally disables ecc_irq which is only enabled on those asics enabling sdma ecc. This will introduce a warning in suspend cycle on those chips with sdma ip v4.0, while without sdma ecc. So this patch correct this. [ 7283.166354] RIP: 0010:amdgpu_irq_put+0x45/0x70 [amdgpu] [ 7283.167001] RSP: 0018:ffff9a5fc3967d08 EFLAGS: 00010246 [ 7283.167019] RAX: ffff98d88afd3770 RBX: 0000000000000001 RCX: 0000000000000000 [ 7283.167023] RDX: 0000000000000000 RSI: ffff98d89da30390 RDI: ffff98d89da20000 [ 7283.167025] RBP: ffff98d89da20000 R08: 0000000000036838 R09: 0000000000000006 [ 7283.167028] R10: ffffd5764243c008 R11: 0000000000000000 R12: ffff98d89da30390 [ 7283.167030] R13: ffff98d89da38978 R14: ffffffff999ae15a R15: ffff98d880130105 [ 7283.167032] FS: 0000000000000000(0000) GS:ffff98d996f00000(0000) knlGS:0000000000000000 [ 7283.167036] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 7283.167039] CR2: 00000000f7a9d178 CR3: 00000001c42ea000 CR4: 00000000003506e0 [ 7283.167041] Call Trace: [ 7283.167046] [ 7283.167048] sdma_v4_0_hw_fini+0x38/0xa0 [amdgpu] [ 7283.167704] amdgpu_device_ip_suspend_phase2+0x101/0x1a0 [amdgpu] [ 7283.168296] amdgpu_device_suspend+0x103/0x180 [amdgpu] [ 7283.168875] amdgpu_pmops_freeze+0x21/0x60 [amdgpu] [ 7283.169464] pci_pm_freeze+0x54/0xc0 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2522 Signed-off-by: Guchun Chen Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit aaa07c0d08a37bf72cd73a3119ff99dc2bfece74 Author: Aric Cyr Date: Sun Apr 30 15:54:14 2023 -0400 drm/amd/display: Promote DAL to 3.2.235 This version brings along following fixes: - Block SubVP on displays that have pixclk > 1800Mhz - Block SubVP high refresh when VRR active fixed - Enforce 60us prefetch for 200Mhz DCFCLK modes - Check Vactive for VRR active for FPO + Vactive - Add symclk workaround during disable link output - Show the DCN/DCE version in the log - Add additional pstate registers to HW state query Acked-by: Alex Hung Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1ae393ea3dbc0a75f1eb460d32d56a4f18dfd684 Author: Hans de Goede Date: Tue May 9 22:12:16 2023 +0100 media: atomisp: Remove atomisp_sensor_start_stream() Now that we no longer have continuous mode we always want to start the sensor on the first atomisp_start_streaming() call and stop it on the first atomisp_stop_streaming() call. Remove atomisp_sensor_start_stream() which returned the number of streams which should be active before starting the sensor and always start/stop the sensor directly. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 4994d1f0a754cded0afb62c4753d00760ddca511 Author: Lin.Cao Date: Mon May 8 17:28:41 2023 +0800 drm/amdgpu: Fix vram recover doesn't work after whole GPU reset (v2) v1: Vmbo->shadow is used to back vram bo up when vram lost. So that we should set shadow as vmbo->shadow to recover vmbo->bo v2: Modify if(vmbo->shadow) shadow = vmbo->shadow as if(!vmbo->shadow) continue; Fixes: e18aaea733da ("drm/amdgpu: move shadow_list to amdgpu_bo_vm") Reviewed-by: Christian König Signed-off-by: Lin.Cao Signed-off-by: Alex Deucher commit 2f48965bdc02d781181ee4fa3d5b3cc168e6d9af Author: Horatio Zhang Date: Thu May 4 01:46:12 2023 -0400 drm/amdgpu: drop gfx_v11_0_cp_ecc_error_irq_funcs The gfx.cp_ecc_error_irq is retired in gfx11. In gfx_v11_0_hw_fini still use amdgpu_irq_put to disable this interrupt, which caused the call trace in this function. [ 102.873958] Call Trace: [ 102.873959] [ 102.873961] gfx_v11_0_hw_fini+0x23/0x1e0 [amdgpu] [ 102.874019] gfx_v11_0_suspend+0xe/0x20 [amdgpu] [ 102.874072] amdgpu_device_ip_suspend_phase2+0x240/0x460 [amdgpu] [ 102.874122] amdgpu_device_ip_suspend+0x3d/0x80 [amdgpu] [ 102.874172] amdgpu_device_pre_asic_reset+0xd9/0x490 [amdgpu] [ 102.874223] amdgpu_device_gpu_recover.cold+0x548/0xce6 [amdgpu] [ 102.874321] amdgpu_debugfs_reset_work+0x4c/0x70 [amdgpu] [ 102.874375] process_one_work+0x21f/0x3f0 [ 102.874377] worker_thread+0x200/0x3e0 [ 102.874378] ? process_one_work+0x3f0/0x3f0 [ 102.874379] kthread+0xfd/0x130 [ 102.874380] ? kthread_complete_and_exit+0x20/0x20 [ 102.874381] ret_from_fork+0x22/0x30 v2: - Handle umc and gfx ras cases in separated patch - Retired the gfx_v11_0_cp_ecc_error_irq_funcs in gfx11 v3: - Improve the subject and code comments - Add judgment on gfx11 in the function of amdgpu_gfx_ras_late_init v4: - Drop the define of CP_ME1_PIPE_INST_ADDR_INTERVAL and SET_ECC_ME_PIPE_STATE which using in gfx_v11_0_set_cp_ecc_error_state - Check cp_ecc_error_irq.funcs rather than ip version for a more sustainable life v5: - Simplify judgment conditions Signed-off-by: Horatio Zhang Reviewed-by: Hawking Zhang Acked-by: Christian König Reviewed-by: Guchun Chen Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit 807a1c14276b6ba6dc7efb4784ac35bceea1413f Author: Alvin Lee Date: Fri Apr 28 17:29:02 2023 -0400 drm/amd/display: Block SubVP on displays that have pixclk > 1800Mhz [Description] - Enabling SubVP on high refresh rate displays had a side effect of also enabling on high bandwidth displays such as 8K60 - However, these are not validated and should be blocked for the time being - Block SubVP on displays that have pix rate > 1800Mhz (includes 8K60 displays) Reviewed-by: Jun Lei Reviewed-by: Nevenko Stupar Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Alex Hung Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a00e595207d001432a85758954c3a6f6a9896368 Author: Alvin Lee Date: Thu Apr 27 15:10:41 2023 -0400 drm/amd/display: Block SubVP high refresh when VRR active fixed [Description] - SubVP high refresh is blocked when VRR is active variable, but we should also block it for when VRR is active fixed (video use case) Reviewed-by: Nevenko Stupar Reviewed-by: Jun Lei Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Alex Hung Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 820a1338d6a14bde0de7ed57cf486c31798a9619 Author: Hans de Goede Date: Thu May 11 15:51:21 2023 +0100 media: atomisp: Remove isp_timeout flag isp_timeout only ever gets set in __atomisp_css_recover() and then immediately gets cleared again after calling atomisp_reset(). All this happens with isp->mutex held. The only consumer of isp->isp_timeout is atomisp_stop_streaming(), which also holds isp->mutex and which is *not* called by atomisp_reset(). Since both hold isp->mutex and since __atomisp_css_recover() clears isp_timeout before releasing the mutex, atomisp_stop_streaming() can never see isp_timeout being true, so just remove the flag. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 84f14428b1e0d1f61776c5fcfdef181129533e0b Author: Alvin Lee Date: Thu Apr 27 15:10:13 2023 -0400 drm/amd/display: Enforce 60us prefetch for 200Mhz DCFCLK modes [Description] - Due to bandwidth / arbitration issues at 200Mhz DCFCLK, we want to enforce minimum 60us of prefetch to avoid intermittent underflow issues - Since 60us prefetch is already enforced for UCLK DPM0, and many DCFCLK's > 200Mhz are mapped to UCLK DPM1, in theory there should not be any UCLK DPM regressions by enforcing greater prefetch Reviewed-by: Nevenko Stupar Reviewed-by: Jun Lei Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Alex Hung Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 62cc621604a466ede81a125a2ed63e05695a48cc Author: Alvin Lee Date: Wed Apr 26 19:33:16 2023 -0400 drm/amd/display: Check Vactive for VRR active for FPO + Vactive [Description] - For FPO + Vactive cases, we rely on the Vactive display to be at it's nominal refresh rate because the Vactive pipe may not necessarily assert P-State allow while it's in VBLANK - For cases where the Vactive display has a stretched VBLANK due to VRR, we could underflow when trying to complete an FPO + Vactive MCLK switch because the FPO display has limited VBLANK time in waiting for the Vactive display to assert P-State allow naturally - Block FPO + Vactive if the Vactive display has VRR active (variable or fixed) Reviewed-by: Jun Lei Acked-by: Alex Hung Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 273f47997718fc72d96e5a4a640538c00575fa7e Author: Leo Chen Date: Wed Apr 26 16:02:28 2023 -0400 drm/amd/display: Add symclk workaround during disable link output [Why & How] This is originally a change (9c75891f) in DCN32 because of the lack of interface to set TX while keeping symclk on. Adding this workaround to DCN314 will resolve the current issue. Fixes: 9c75891feef0 ("drm/amd/display: rework recent update PHY state commit") Reviewed-by: Nicholas Kazlauskas Acked-by: Alex Hung Signed-off-by: Leo Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit db5dcd476eb0288cdfa781725582dcf9bd747a6b Author: YuBiao Wang Date: Fri May 5 14:35:32 2023 +0800 drm/amdgpu: set default num_kcq to 2 under sriov The number of kernel queues has impact on the latency under sriov usecase. So to reduce the latency we set the default num_kcq = 2 under sriov if not set manually. Signed-off-by: YuBiao Wang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 9d7a348d368ccd940242d4aa68292cf665f6d474 Author: Guchun Chen Date: Fri May 5 13:20:11 2023 +0800 drm/amd/pm: parse pp_handle under appropriate conditions amdgpu_dpm_is_overdrive_supported is a common API across all asics, so we should cast pp_handle into correct structure under different power frameworks. v2: using return directly to simplify code v3: SI asic does not carry od_enabled member in pp_handle, and update Fixes tag Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2541 Fixes: eb4900aa4c49 ("drm/amdgpu: Fix kernel NULL pointer dereference in dpm functions") Suggested-by: Mario Limonciello Signed-off-by: Guchun Chen Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher commit 187916e6ed9d0c3b3abc27429f7a5f8c936bd1f0 Author: Lang Yu Date: Fri May 5 20:14:15 2023 +0800 drm/amdgpu: install stub fence into potential unused fence pointers When using cpu to update page tables, vm update fences are unused. Install stub fence into these fence pointers instead of NULL to avoid NULL dereference when calling dma_fence_wait() on them. Suggested-by: Christian König Signed-off-by: Lang Yu Reviewed-by: Christian König Signed-off-by: Alex Deucher commit bf7fda0b3736f93ac8b18e7147e1e7acd27e6a19 Author: Rodrigo Siqueira Date: Tue Apr 25 14:42:29 2023 -0600 drm/amd/display: Show the DCN/DCE version in the log Some times people send their dmesg log for debugging, and one common task is to check the modesetting line to catch which DCN/DCE we need to debug. This commit introduces a simple conversion from the DCN/DCE version to a string shown in the dmesg log. Reviewed-by: Hamza Mahfooz Acked-by: Alex Hung Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9e72813f69b178b676a54c4d6b24d3e84492b61a Author: Jiapeng Chong Date: Sat May 6 16:10:43 2023 +0800 drm/amdgpu: Remove the unused variable golden_settings_gc_9_4_3 Variable golden_settings_gc_9_4_3 is not effectively used, so delete it. drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:48:38: warning: ‘golden_settings_gc_9_4_3’ defined but not used. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4877 Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit fb86cf8bd8a94981be5c0f4263f31e43e1aaf445 Author: Hans de Goede Date: Wed May 10 21:21:51 2023 +0100 media: atomisp: Remove unused mipi_frame_size field from atomisp_[sub_]device Both the atomisp_device and the atomisp_sub_device structs have an unused mipi_frame_size field, remove the field from both. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit b9274387bc2a4cf54b02e039b6a0aef5dd5f2936 Author: Felix Kuehling Date: Wed Apr 26 22:07:43 2023 -0400 drm/amdkfd: Don't trigger evictions unmapping dmabuf attachments Don't move DMABuf attachments for PCIe P2P mappings to the SYSTEM domain when unmapping. This avoids triggering eviction fences unnecessarily. Instead do the move to SYSTEM and back to GTT when mapping these attachments to ensure the SG table gets updated after evictions. This may still trigger unnecessary evictions if user mode unmaps and remaps the same BO. However, this is unlikely in real applications. Signed-off-by: Felix Kuehling Reviewed-by: Eric Huang Signed-off-by: Alex Deucher commit 738b3469f8e12ae72555ef4724bebe8167a93e29 Author: Sung Lee Date: Fri Apr 21 12:03:16 2023 -0400 drm/amd/display: Add additional pstate registers to HW state query [WHY] These registers would be useful to know when debugging pstate issues. [HOW] Add additional registers to hw state query. Reviewed-by: Aric Cyr Reviewed-by: Jun Lei Acked-by: Alex Hung Signed-off-by: Sung Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1ffbc89c302669c95779c1e6b0901380544c9bb8 Author: Jiapeng Chong Date: Fri May 5 15:37:31 2023 +0800 drm/amdgpu: remove unneeded semicolon No functional modification involved. ./drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c:146:2-3: Unneeded semicolon. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4871 Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 4667fbe2f7c54628c48aedc8c8472cd12a5f7fcd Author: Le Ma Date: Wed Nov 24 17:24:58 2021 +0800 drm/amdgpu: do gfxhub init for all XCDs Each XCD needs to do gfxhub init Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6f48bc9e49f9ff343badeee9b87b258826c9bdc6 Author: Hans de Goede Date: Sun May 7 21:21:30 2023 +0100 media: atomisp: Remove a bunch of unused atomisp_css_*() functions Remove various unused atomisp_css_*() functions from atomisp_compat_css20.c. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 28714506c3b775702dd6738a0a44b9ff0d7bf0ac Author: Hans de Goede Date: Sun May 7 21:19:33 2023 +0100 media: atomisp: Remove atomisp_subdev_register_video_nodes() helper Now that there is only 1 /dev/video# node left there is no need to do this in a helper. Just make atomisp_register_device_nodes() call video_register_device() directly. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit e2d1f005d3fbaea14ddea1a24db924406e55f6c3 Author: Hari Chandrakanthan Date: Mon May 29 15:43:58 2023 +0530 wifi: ath12k: delete the timer rx_replenish_retry during rmmod The rx_replenish_retry timer is initialized in ath12k_core_alloc() when ath12k module is loaded. But rx_replenish_retry timer is not deleted anywhere in the code. It is supposed to be deleted when ath12k module is removed/unloaded. Delete the timer rx_replenish_retry in ath12k_core_free(). Found during code review. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-02903-QCAHKSWPL_SILICONZ-1 Signed-off-by: Hari Chandrakanthan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1685355238-3282-1-git-send-email-quic_haric@quicinc.com commit c0c27428903700d86920394aa2302506b5d95b17 Author: Hamza Mahfooz Date: Tue May 2 11:59:08 2023 -0400 drm/amdgpu: fix an amdgpu_irq_put() issue in gmc_v9_0_hw_fini() As made mention of in commit c56edea58c31 ("drm/amdgpu: fix amdgpu_irq_put call trace in gmc_v10_0_hw_fini") and commit aa6ac247ed7d ("drm/amdgpu: fix amdgpu_irq_put call trace in gmc_v11_0_hw_fini"). It is meaningless to call amdgpu_irq_put() for gmc.ecc_irq. So, remove it from gmc_v9_0_hw_fini(). Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2522 Fixes: c8b5a95b5709 ("drm/amdgpu: Fix desktop freezed after gpu-reset") Reviewed-by: Mario Limonciello Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 8f04852e90cbed8e12c13d75a87adbad313d365e Author: Baochen Qiang Date: Mon May 29 16:16:09 2023 +0800 wifi: ath12k: Use msdu_end to check MCBC We are seeing a very low TCP throughput testing with some specific tools. This is because for sub-frames of an AMSDU, MCBC flag in mpdu_start may be not valid, and as a result those frames would be dropped by kernel. Add a new helper to get it from msdu_end. Also clean up original helper since it is not needed any more. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230529081609.34567-1-quic_bqiang@quicinc.com commit 8fd3c9a468c044e25b2ddaaa53d10414906b83af Author: Hans de Goede Date: Sun May 7 21:14:47 2023 +0100 media: atomisp: Remove 1 line atomisp_flush_bufs_and_wakeup() helper After recent changes this now is just a wrapper around atomisp_flush_video_pipe(). Make its single caller call atomisp_flush_video_pipe() directly and drop the helper. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit f4409a2361152f3480781a1dea1a3bd0d8369c78 Author: Dan Carpenter Date: Wed May 3 18:09:35 2023 +0300 drm/amdgpu: unlock on error in gfx_v9_4_3_kiq_resume() Smatch complains that we need to drop this lock before returning. drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:1838 gfx_v9_4_3_kiq_resume() warn: inconsistent returns 'ring->mqd_obj->tbo.base.resv'. Fixes: 86301129698b ("drm/amdgpu: split gc v9_4_3 functionality from gc v9_0") Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit 3394b51c7d3f5239459ceac7e535e45836d78bd4 Author: Carl Huang Date: Thu Jun 1 13:35:15 2023 +0300 wifi: ath12k: check hardware major version for WCN7850 This is to check the hardware major version for WCN7850 so only supported hardware is initialized. Now only WCN7850 with major version 2 is supported. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230518105741.1281424-1-quic_cjhuang@quicinc.com commit e4454e06e55d78852693641bebb041b6a0cebe79 Author: Hans de Goede Date: Sun May 7 21:11:42 2023 +0100 media: atomisp: Remove source_pad parameter from functions and structs Now that there is only 1 source-pad for an asd there is no need to have a parameter for this in various places. Remove the source_pad function parameter and atomisp_sub_device.capture_pad data member. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 054b5580a36e435692c203c19abdcb9f7734320e Author: Balamurugan S Date: Thu Jun 1 13:35:15 2023 +0300 wifi: ath12k: Avoid NULL pointer access during management transmit cleanup Currently 'ar' reference is not added in skb_cb. Though this is generally not used during transmit completion callbacks, on interface removal the remaining idr cleanup callback uses the ar pointer from skb_cb from management txmgmt_idr. Hence fill them during transmit call for proper usage to avoid NULL pointer dereference. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Balamurugan S Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230518071046.14337-1-quic_bselvara@quicinc.com commit 7a6a2e59aacd6d5e75927352b72d39a5bc447e09 Author: Dan Carpenter Date: Wed May 3 18:09:18 2023 +0300 drm/amdgpu: unlock the correct lock in amdgpu_gfx_enable_kcq() We changed which lock we are supposed to take but this error path was accidentally over looked so it still drops the old lock. Fixes: def799c6596d ("drm/amdgpu: add multi-xcc support to amdgpu_gfx interfaces (v4)") Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit aca8a1dfb9ee56dcd358e73745c850db7f8a7dca Author: Hans de Goede Date: Sun May 7 20:42:26 2023 +0100 media: atomisp: Rename video_out_preview to video_out Now that we have only 1 /dev/video# node for output for all different run-modes (with only 1 run-mode at a time) using video_out_preview for the remaining atomisp_pipe does not properly reflect that this is *the* output pipe. Fo the following renames to fix the naming: s/video_out_preview/video_out/ s/ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW/ATOMISP_SUBDEV_PAD_SOURCE/ Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 0e5f625157ca47d9ee27a36310611964bd97c605 Author: Alex Deucher Date: Thu Apr 27 14:32:11 2023 -0400 drm/amdgpu: drop unused function amdgpu_discovery_get_ip_version() has not been used since commit c40bdfb2ffa4 ("drm/amdgpu: fix incorrect VCN revision in SRIOV") so drop it. Reviewed-by: Luben Tuikov Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 29551fd90ee69771f499071c1119c1007febbd1d Author: Alex Deucher Date: Thu Apr 27 14:09:33 2023 -0400 drm/amdgpu: drop invalid IP revision This was already fixed and dropped in: commit baf3f8f37406 ("drm/amdgpu: handle SRIOV VCN revision parsing") commit c40bdfb2ffa4 ("drm/amdgpu: fix incorrect VCN revision in SRIOV") But seems to have been accidently been left around in a merge. Reviewed-by: Luben Tuikov Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 1cfb4d6121276a829aa94d0e32a7f5e1830ebc21 Author: Alex Deucher Date: Wed Apr 26 15:30:13 2023 -0400 drm/amdgpu: put MQDs in VRAM Reduces preemption latency. Only enable this for gfx10 and 11 for now to avoid changing behavior on gfx 8 and 9. v2: move MES MQDs into VRAM as well (YuBiao) v3: enable on gfx10, 11 only (Alex) v4: minor style changes, document why gfx10/11 only (Alex) Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 26dcabc0dd1bcbcb23464362a5ddc917df8ceb74 Author: Hans de Goede Date: Sun May 7 15:20:22 2023 +0100 media: atomisp: Drop atomisp_is_vf_pipe() Since there only is one /dev/video# node now (no more continuous mode), there are now no longer separate main capture + view-finder pipes. We are now always on the main pipe, so atomisp_is_vf_pipe() should always return false now. Drop any checks using it, replacing them with the code-path for a false return. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit d957824bf8e43f052e339c16032a4dccf52b0ed0 Author: Hans de Goede Date: Sun May 7 12:54:26 2023 +0100 media: atomisp: Register only 1 /dev/video# node Now that we no longer support continuous mode and thus no longer support streaming from 2 /dev/video# nodes at the same time, there is no need to have a separate /dev/video# node (+ matching v4l2-subdev pads) for each run-mode. Keep the video_out_preview /dev/video0 device and remove the video_out_video_capture / video_out_vf / video_out_capture video-devices (atomisp_pipe-s) and also remove the matching ATOMISP_SUBDEV_PAD_SOURCE_VIDEO / ATOMISP_SUBDEV_PAD_SOURCE_VF / ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE source-pads. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 967a66396e4668ef314e06a0391e67aa1cf6d058 Author: Guchun Chen Date: Wed Apr 26 09:46:54 2023 +0800 drm/amdgpu: drop redundant sched job cleanup when cs is aborted Once command submission failed due to userptr invalidation in amdgpu_cs_submit, legacy code will perform cleanup of scheduler job. However, it's not needed at all, as former commit has integrated job cleanup stuff into amdgpu_job_free. Otherwise, because of double free, a NULL pointer dereference will occur in such scenario. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2457 Fixes: f7d66fb2ea43 ("drm/amdgpu: cleanup scheduler job initialization v2") Signed-off-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher commit ea3600379e0f38f7c25263a0ab01cc3efc6cd3fe Author: Hans de Goede Date: Sun May 7 19:11:48 2023 +0100 media: atomisp: Replace source-pad checks with run-mode checks Currently atomisp behavior is determined by a mix of which /dev/video# node (which isp-subdev source-pad) is opened + which run-mode is set. With various combinations not being allowed and likely leading to crashes due to lack of error checking. Now that we no longer support continuous mode and thus no longer support streaming from 2 /dev/video# nodes at the same time, there is no need to have a separate /dev/video# node for each run-mode. Instead the plan is to support the 3 different run-modes on a single /dev/video# node. Since we are moving to a single isp-subdev source-pad, the behavior should then be solely and consistently be defined by the run-mode. Replace various source-pad checks with run-mode checks in preparation for moving to a single source-pad. In some places the new run-mode checks overlap with existing run-mode checks and the checks are folded together into a single check. This removes handling of the ATOMISP_SUBDEV_PAD_SOURCE_VF source-pad, this source-pad was only useful for continuous mode, for which support has been removed. Note that currently the only run-mode which we actually have been able to get to work is the video-capture with scaler aka preview mode and as such that is also the only run-mode tested. This patch is intended to preserve the current (known to not work 100%) behavior of the other run-modes, so that those maybe can be enabled later. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit a03b1a0b19398a47489fdcef02ec19c2ba05a15d Author: Christophe Leroy Date: Mon Jun 5 10:58:35 2023 +0200 powerpc/signal32: Force inlining of __unsafe_save_user_regs() and save_tm_user_regs_unsafe() Looking at generated code for handle_signal32() shows calls to a function called __unsafe_save_user_regs.constprop.0 while user access is open. And that __unsafe_save_user_regs.constprop.0 function has two nops at the begining, allowing it to be traced, which is unexpected during user access open window. The solution could be to mark __unsafe_save_user_regs() no trace, but to be on the safe side the most efficient is to flag it __always_inline as already done for function __unsafe_restore_general_regs(). The function is relatively small and only called twice, so the size increase will remain in the noise. Do the same with save_tm_user_regs_unsafe() as it may suffer the same issue. Fixes: ef75e7318294 ("powerpc/signal32: Transform save_user_regs() and save_tm_user_regs() in 'unsafe' version") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/7e469c8f01860a69c1ada3ca6a5e2aa65f0f74b2.1685955220.git.christophe.leroy@csgroup.eu commit 9e690184586bfb88efa176cdf912414f6c53519c Author: Srinivasan Shanmugam Date: Wed May 3 14:10:20 2023 +0530 drm/amd/amdgpu: Fix errors & warnings in amdgpu _bios, _cs, _dma_buf, _fence.c The following checkpatch errors & warning is removed. ERROR: else should follow close brace '}' ERROR: trailing statements should be on next line WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: Possible repeated word: 'Fences' WARNING: Missing a blank line after declarations WARNING: braces {} are not necessary for single statement blocks WARNING: Comparisons should place the constant on the right side of the test WARNING: printk() should include KERN_ facility level Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 0eb089a72fda3f7969e6277804bde75dc1474a14 Author: Christophe Leroy Date: Mon Jun 5 10:55:26 2023 +0200 powerpc/interrupt: Don't read MSR from interrupt_exit_kernel_prepare() A disassembly of interrupt_exit_kernel_prepare() shows a useless read of MSR register. This is shown by r9 being re-used immediately without doing anything with the value read. c000e0e0: 60 00 00 00 nop c000e0e4: 7d 3a c2 a6 mfmd_ap r9 c000e0e8: 7d 20 00 a6 mfmsr r9 c000e0ec: 7c 51 13 a6 mtspr 81,r2 c000e0f0: 81 3f 00 84 lwz r9,132(r31) c000e0f4: 71 29 80 00 andi. r9,r9,32768 This is due to the use of local_irq_save(). The flags read by local_irq_save() are never used, use local_irq_disable() instead. Fixes: 13799748b957 ("powerpc/64: use interrupt restart table to speed up return from interrupt") Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/df36c6205ab64326fb1b991993c82057e92ace2f.1685955214.git.christophe.leroy@csgroup.eu commit 396f2b0106ff343c61f7ae221dc6ae300f807760 Author: Christophe Leroy Date: Fri May 26 07:57:33 2023 +0200 powerpc/kcsan: Properly instrument arch_spin_unlock() The following boottime error is encountered with SMP kernel: kcsan: improperly instrumented type=(0): arch_spin_unlock(&arch_spinlock) kcsan: improperly instrumented type=(0): spin_unlock(&test_spinlock) kcsan: improperly instrumented type=(KCSAN_ACCESS_WRITE): arch_spin_unlock(&arch_spinlock) kcsan: improperly instrumented type=(KCSAN_ACCESS_WRITE): spin_unlock(&test_spinlock) kcsan: improperly instrumented type=(KCSAN_ACCESS_WRITE | KCSAN_ACCESS_COMPOUND): arch_spin_unlock(&arch_spinlock) kcsan: improperly instrumented type=(KCSAN_ACCESS_WRITE | KCSAN_ACCESS_COMPOUND): spin_unlock(&test_spinlock) kcsan: selftest: test_barrier failed kcsan: selftest: 2/3 tests passed Kernel panic - not syncing: selftests failed Properly instrument arch_spin_unlock() with kcsan_mb(). Signed-off-by: Christophe Leroy Acked-by: Marco Elver Signed-off-by: Michael Ellerman Link: https://msgid.link/57834a703dfa5d6c27c9de0a01329059636e5ab7.1685080579.git.christophe.leroy@csgroup.eu commit bcea4f7a70dc800e769ef02d8c3bc4df357ed893 Author: Christophe Leroy Date: Fri May 12 17:31:19 2023 +0200 xtensa: Remove 64 bits atomic builtins stubs The stubs were provided by commit 725aea873261 ("xtensa: enable KCSAN") to make linker happy allthought they are not meant to be used at all. KCSAN core has been fixed to not require them anymore on 32 bits architectures. Then they can be removed. Signed-off-by: Christophe Leroy Acked-by: Max Filippov Acked-by: Marco Elver Signed-off-by: Michael Ellerman Link: https://msgid.link/a6834980e58c5e2cdf25b3db061f34975de46437.1683892665.git.christophe.leroy@csgroup.eu commit 95567f46b4d20c047750a5e3029461afcdc67697 Author: Rohan McLure Date: Fri May 12 17:31:18 2023 +0200 powerpc/{32,book3e}: kcsan: Extend KCSAN Support Enable HAVE_ARCH_KCSAN on all powerpc platforms, permitting use of the kernel concurrency sanitiser through the CONFIG_KCSAN_* kconfig options. Boots and passes selftests on 32-bit and 64-bit platforms. See documentation in Documentation/dev-tools/kcsan.rst for more information. Signed-off-by: Rohan McLure Signed-off-by: Christophe Leroy Acked-by: Marco Elver Signed-off-by: Michael Ellerman Link: https://msgid.link/1a1138966780c3709f55bde8a0eb80209fa4395d.1683892665.git.christophe.leroy@csgroup.eu commit 353e7300a1db928e427462f2745f9a2cd1625b3d Author: Christophe Leroy Date: Fri May 12 17:31:17 2023 +0200 kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures Activating KCSAN on a 32 bits architecture leads to the following link-time failure: LD .tmp_vmlinux.kallsyms1 powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_load': kernel/kcsan/core.c:1273: undefined reference to `__atomic_load_8' powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_store': kernel/kcsan/core.c:1273: undefined reference to `__atomic_store_8' powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_exchange': kernel/kcsan/core.c:1273: undefined reference to `__atomic_exchange_8' powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_add': kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_add_8' powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_sub': kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_sub_8' powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_and': kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_and_8' powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_or': kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_or_8' powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_xor': kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_xor_8' powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_nand': kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_nand_8' powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_strong': kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8' powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_weak': kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8' powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_val': kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8' 32 bits architectures don't have 64 bits atomic builtins. Only include DEFINE_TSAN_ATOMIC_OPS(64) on 64 bits architectures. Fixes: 0f8ad5f2e934 ("kcsan: Add support for atomic builtins") Suggested-by: Marco Elver Signed-off-by: Christophe Leroy Reviewed-by: Marco Elver Acked-by: Marco Elver Signed-off-by: Michael Ellerman Link: https://msgid.link/d9c6afc28d0855240171a4e0ad9ffcdb9d07fceb.1683892665.git.christophe.leroy@csgroup.eu commit 05d1c49c0339bab1c5d94a3d5146c8efc8385dd2 Author: Randy Dunlap Date: Sun May 21 15:51:03 2023 -0700 powerpc/embedded6xx: select MPC10X_BRIDGE only if PCI is set When CONFIG_SMP is not set, CONFIG_BROKEN_ON_SMP is set, and CONFIG_PCI is not set, there can be a kconfig warning: WARNING: unmet direct dependencies detected for PPC_INDIRECT_PCI Depends on [n]: PCI [=n] Selected by [y]: - MPC10X_BRIDGE [=y] To fix that, make the selects of MPC10X_BRIDGE be conditional on PCI and use "imply" instead of "select". Signed-off-by: Randy Dunlap Suggested-by: Michael Ellerman # use "imply" Signed-off-by: Michael Ellerman Link: https://msgid.link/20230521225103.19197-1-rdunlap@infradead.org commit 7cc99ed87e4aeb3738e6ea7dc4d3ae28ad943601 Author: Nicholas Piggin Date: Thu Jun 8 12:45:04 2023 +1000 KVM: PPC: Update MAINTAINERS Michael is merging KVM PPC patches via the powerpc tree and KVM topic branches. He doesn't necessarily have time to be across all of KVM so is reluctant to call himself maintainer, but for the mechanics of how patches flow upstream, it is maintained and does make sense to have some contact people in MAINTAINERS. So add Michael Ellerman as KVM PPC maintainer and myself as reviewer. Split out the subarchs that don't get so much attention. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20230608024504.58189-1-npiggin@gmail.com commit b8d96bac4a50b8c8adb195e8efae7ea5599c7abf Author: Michael Ellerman Date: Wed May 17 17:48:19 2023 +1000 powerpc: Mark powermac as orphan in MAINTAINERS Ben no longer has time to do any maintenance of the powermac code. Mark it as orphan. Signed-off-by: Michael Ellerman Link: https://msgid.link/20230517074819.52546-1-mpe@ellerman.id.au commit a43d52ab96f97967f4c5d28d1607fb1179057786 Author: Michael Ellerman Date: Wed May 31 22:50:23 2023 +1000 MAINTAINERS: Exclude m68k-only drivers from powerpc entry The powerpc section has a "F:" entry for drivers/macintosh, matching all files in or below drivers/macintosh. That is correct for the most part, but there are a couple of m68k-only drivers in the directory, so exclude those. Acked-by: Geert Uytterhoeven Signed-off-by: Michael Ellerman Link: https://msgid.link/20230531125023.1121060-1-mpe@ellerman.id.au commit 0e768043bf68dc9713de34780363c595e54af7fa Author: Yifan Zhang Date: Thu Apr 27 14:01:05 2023 +0800 drm/amdgpu: set gfx9 onwards APU atomics support to be true APUs w/ gfx9 onwards doesn't reply on PCIe atomics, rather it is internal path w/ native atomic support. Set have_atomics_support to true. Signed-off-by: Yifan Zhang Reviewed-by: Lang Yu Acked-by: Felix Kuehling Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 09d8a67912462a07cb7ff40956ed8c79b1c74564 Author: Alex Deucher Date: Wed Apr 26 14:54:27 2023 -0400 drm/amdgpu/gfx11: always restore kcq/kgq MQDs Always restore the MQD not just when we do a reset. This allows us to move the MQD to VRAM if we want. v2: always reset ring pointer as well (Christian) Reviewed-by: Christian König Signed-off-by: Alex Deucher commit c6fa6fe9ebd5cdde0e41a558ff3efea8fe988e77 Author: Thong Thai Date: Mon May 1 11:04:36 2023 -0400 drm/amdgpu/nv: update VCN 3 max HEVC encoding resolution Update the maximum resolution reported for HEVC encoding on VCN 3 devices to reflect its 8K encoding capability. v2: Also update the max height for H.264 encoding to match spec. (Ruijing) Signed-off-by: Thong Thai Reviewed-by: Ruijing Dong Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 006f27897cbdbe02bb3b307118e7a6e25543b516 Author: Hans de Goede Date: Sun May 7 18:38:10 2023 +0100 media: atomisp: Drop atomisp_get_css_buf_type() Since continuous mode has been removed, there no longer is the option for separate capture output + viewfinder output streams at the same time. So all buffers queued by userspace are now for the normal output stream, remove atomisp_get_css_buf_type() and always use IA_CSS_BUFFER_TYPE_OUTPUT_FRAME for buffers queued by userspace. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit dae343b343ff741d727312b2a9b03d86e64b31c5 Author: Arnd Bergmann Date: Mon May 1 16:31:53 2023 +0200 drm/amd/display: mark amdgpu_dm_connector_funcs_force static A global function without a header prototype has made it into linux-next during the merge window: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:6339:6: error: no previous prototype for 'amdgpu_dm_connector_funcs_force' [-Werror=missing-prototypes] Mark the function static instead, as there are no other callers outside this file. Fixes: 0ba4a784a145 ("drm/amd/display: implement force function in amdgpu_dm_connector_funcs") Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304251640.JClqTim9-lkp@intel.com/ Signed-off-by: Arnd Bergmann Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 2dbaf83998fe4772c83e5060cfbc21808758bb4b Author: Alex Deucher Date: Wed Apr 26 14:51:34 2023 -0400 drm/amdgpu/gfx10: always restore kcq/kgq MQDs Always restore the MQD not just when we do a reset. This allows us to move the MQD to VRAM if we want. v2: always reset ring pointer as well (Christian) Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 45b54a7dd3437632352ed28163e982233ef190a8 Author: Alex Deucher Date: Wed Apr 26 14:49:00 2023 -0400 drm/amdgpu/gfx9: always restore kcq MQDs Always restore the MQD not just when we do a reset. This allows us to move the MQD to VRAM if we want. v2: always reset ring pointer as well (Christian) Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 42cdf6f687daa1a1992db400e8311e1e49c787fb Author: Alex Deucher Date: Wed Apr 26 14:44:43 2023 -0400 drm/amdgpu/gfx8: always restore kcq MQDs Always restore the MQD not just when we do a reset. This allows us to move the MQD to VRAM if we want. v2: always reset ring pointer as well (Christian) Reviewed-by: Christian König Signed-off-by: Alex Deucher commit b848fe65f856193fc4f567c84f559f60ff66a3db Author: Alex Deucher Date: Wed Apr 26 14:42:53 2023 -0400 drm/amdgpu/gfx11: drop unused variable Just check the return value directly. Reviewed-by: Christian König Signed-off-by: Alex Deucher commit d78e816a3d615073a48bf8cc438790bc08160e0e Author: Alex Deucher Date: Wed Apr 26 14:42:09 2023 -0400 drm/amdgpu/gfx10: drop unused variable Just check the return value directly. Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 5a0510d58b635ed5bc2555ba1255cd2b34e033ee Author: Mario Limonciello Date: Fri Apr 28 16:42:03 2023 -0500 drm/amd: Downgrade message about watermarks table after s0i3 to debug This message shows up on s0i3 resume for DCN31 and DCN314 platforms but it has been decided that this flow won't be changed and the message is expected behavior. Downgrade the message to debug. Signed-off-by: Mario Limonciello Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 83033f72a40b5035c78f847fa4cc55fba633b82a Author: Alex Deucher Date: Mon Apr 24 14:33:15 2023 -0400 drm/amdgpu/gfx11: use generic [en/dis]able_kgq() helpers And remove the duplicate local variants. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f39c25357f0c9ada9ed9676eaa7681d4583dda63 Author: Alex Deucher Date: Mon Apr 24 14:31:00 2023 -0400 drm/amdgpu/gfx10: use generic [en/dis]able_kgq() helpers And remove the duplicate local variants. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 1156e1a60f024ce29fbb88dd330c2be81c4303ea Author: Alex Deucher Date: Mon Apr 24 14:24:20 2023 -0400 drm/amdgpu: add [en/dis]able_kgq() functions To replace the IP specific variants which are largely duplicate. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4b668b32023f9afa6d16f541375aab6fae2619db Merge: 7d3ee229ea51a 719dfd5925e18 Author: Michael Ellerman Date: Fri Jun 9 23:28:26 2023 +1000 Merge branch 'fixes' into next Merge our fixes branch, in particular to bring in the change to arch/powerpc/boot/Makefile, which is depended upon by a subsequent series. commit 4ab9d5848c728e5339e382f678a5e580573b3a3a Author: Aric Cyr Date: Sun Apr 23 22:12:05 2023 -0400 drm/amd/display: 3.2.234 This version brings along following fixes: - FW Release 0.0.165.0 - Add w/a to disable DP dual mode on certain ports - Revert "Update scaler recout data for visual confirm" - Filter out invalid bits in pipe_fuses - Adding debug option to override Z8 watermark values - Change default Z8 watermark values - Workaround wrong HDR colorimetry with some receivers Acked-by: Alan Liu Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 6d7d0a4bc39240a2dd84d122d4ed5487e6acddf7 Author: Anthony Koo Date: Sat Apr 22 23:09:38 2023 -0400 drm/amd/display: [FW Promotion] Release 0.0.165.0 - Add dmub boot options to disable ips states on init Acked-by: Alan Liu Signed-off-by: Anthony Koo Signed-off-by: Alex Deucher commit 1b9a80a47dbfc871867845350fcc519ea5181418 Author: Hans de Goede Date: Sun May 7 16:23:48 2023 +0100 media: atomisp: Remove isp->need_gfx_throttle field Remove the isp->need_gfx_throttle field it is only ever set and never read. Also the code setting it is broken, comparing run_mode->val to ATOMISP_SUBDEV_PAD_SOURCE_VIDEO which are not of the same type / not part of the same enum. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 124155c0bd4a4ed822c1ba246bdf5123b42c3ad9 Author: George Shen Date: Thu Apr 13 19:03:59 2023 -0400 drm/amd/display: Add w/a to disable DP dual mode on certain ports [Why] Certain ports on DCN3.2 configs do not properly populate the BIOS info table flag to indicate DP dual mode is unsupported. [How] Add a workaround to disable DP dual mode on the ports with the missing BIOS info table flag. Reviewed-by: Michael Strauss Acked-by: Alan Liu Signed-off-by: George Shen Signed-off-by: Alex Deucher commit 029c85adccb2e23352f622394288ecd133449332 Author: Leo Ma Date: Fri Apr 21 09:58:25 2023 -0400 drm/amd/display: revert "Update scaler recout data for visual confirm" This reverts commit 1068e987ad0be83a109147fe7fa0891700e8d80e. A regression is found on this change, so revert it for the time being and resubmit when issue is fixed. Reviewed-by: Martin Leung Acked-by: Alan Liu Signed-off-by: Leo Ma Signed-off-by: Alex Deucher commit f835a571ec998b83c165022795f9385f9335f108 Author: Samson Tam Date: Wed Apr 19 18:17:14 2023 -0400 drm/amd/display: filter out invalid bits in pipe_fuses [Why] Reading pipe_fuses from register may have invalid bits set, which may affect the num_pipes erroneously. [How] Add read_pipes_fuses() call and filter bits based on expected number of pipes. Reviewed-by: Alvin Lee Acked-by: Alan Liu Signed-off-by: Samson Tam Signed-off-by: Alex Deucher commit 4dfa60aede755814dcfbc9a05008265d827cc98d Author: Leo Chen Date: Thu Apr 13 17:37:49 2023 -0400 drm/amd/display: Adding debug option to override Z8 watermark values [Why & How] Adding debug options to override Z8 watermark values for testing purposes. Reviewed-by: Nicholas Kazlauskas Acked-by: Alan Liu Signed-off-by: Leo Chen Signed-off-by: Alex Deucher commit 9749a42db74c3400e0526d9a39fa0324abfd0d66 Author: Leo Chen Date: Thu Apr 13 17:34:24 2023 -0400 drm/amd/display: Change default Z8 watermark values [Why & How] Previous Z8 watermark values were causing flickering and OTC underflow. Updating Z8 watermark values based on the measurement. Reviewed-by: Nicholas Kazlauskas Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Alan Liu Signed-off-by: Leo Chen Signed-off-by: Alex Deucher commit 5b7bee5b445785a47b781e889e51219ec35d4407 Author: Ilya Bakoulin Date: Fri Apr 14 12:46:48 2023 -0400 drm/amd/display: Workaround wrong HDR colorimetry with some receivers [Why] Some scalers do not pick up color space updates unless the DP link is disabled/re-enabled which can result in incorrect/washed out HDR colors in some cases. [How] Call set_dpms_on to disable the link, re-train and re-enable with the updated output color space. Reviewed-by: Aric Cyr Acked-by: Alan Liu Signed-off-by: Ilya Bakoulin Signed-off-by: Alex Deucher commit 9ab367f838a692843aa21b2ff43ebfc3bafa7175 Author: Srinivasan Shanmugam Date: Wed Apr 19 17:30:39 2023 +0530 drm/amd/display: Add logging when DP link training Channel EQ is Successful Log when Channel Equalization is successful. Cc: Aurabindo Pillai Cc: Fangzhi Zuo Reviewed-by: Rodrigo Siqueira Signed-off-by: Srinivasan Shanmugam Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit f14c8c3e1fc9e10c6d54999a96acb2b5087374df Author: Srinivasan Shanmugam Date: Fri Apr 28 17:22:20 2023 +0530 drm/amd/amdgpu: Fix style problems in amdgpu_psp.c Fix the following checkpatch warnings & error in amdgpu_psp.c WARNING: Comparisons should place the constant on the right side of the test WARNING: braces {} are not necessary for single statement blocks WARNING: please, no space before tabs WARNING: braces {} are not necessary for single statement blocks ERROR: that open brace { should be on the previous line Suggested-by: Christian König Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 7943916bd4e5952a535ae8b3f7513866a33b302b Author: Hans de Goede Date: Sun May 7 16:16:06 2023 +0100 media: atomisp: Remove Continuous capture and SDV run-modes Since we no longer support Continuous mode, setting the run_mode to ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE no longer make sense, so remove this. While at it, also remove ATOMISP_RUN_MODE_SDV, which was never exposed to userspace in the first place. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit edacf33357b8576db3198e4ae41bb7e6cd41ce4e Author: Alex Deucher Date: Mon Apr 24 12:52:31 2023 -0400 drm/amdgpu/gfx10: drop old bring up code No longer used. Remove it. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6ae869b9b62534eaf04f838048338bf150bc6ce4 Author: Alex Deucher Date: Mon Apr 24 12:50:30 2023 -0400 drm/amdgpu/gfx11: drop old bring up code No longer used. Remove it. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 435af0b919bf9eb78f4e05e8596ebed9ca7885b7 Author: Philip Yang Date: Mon Apr 24 14:46:16 2023 -0400 drm/amdkfd: Optimize svm range map to GPU with XNACK on With XNACK on if svm_range_set_attr set the range access or access_in_place attribute, we don't call svm_range_validate_and_map to update GPU mapping. This avoids prefaulting the range pages on system memory if the range is not prefetch to VRAM and not mapped to GPUs. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9420a034060a094874091cb6c6257268f08a1999 Author: Srinivasan Shanmugam Date: Tue Apr 25 08:34:17 2023 +0530 drm/amd/display: Add logging for eDP v1.4 supported sink rates Include eDP v1.4 panels supported sink rates in debug output, useful info for knowing optimized link rates Cc: Aurabindo Pillai Cc: Jerry Zuo Reviewed-by: Rodrigo Siqueira Signed-off-by: Srinivasan Shanmugam Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 649920afc4269fe3db74feadffb8f18dea057dc1 Author: Hans de Goede Date: Sat May 6 19:56:05 2023 +0100 media: atomisp: Remove res_overflow parameter from atomisp_try_fmt() The only remaining caller of atomisp_try_fmt() always passes NULL for the res_overflow parameter. Drop it and simplify atomisp_try_fmt(). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 44407010ce7f524e4f68aa25f9250a9cf9e4410c Author: Harshit Mogalapalli Date: Wed Apr 26 12:24:12 2023 -0700 drm/amd/display: Fix possible NULL dereference in dc_dmub_srv_cmd_run_list() We have a NULL check for 'dc_dmub_srv' in dc_dmub_srv_cmd_run_list() but we are dereferencing it before checking. Fix this moving the dereference next to NULL check. This issue is found with Smatch(static analysis tool). Fixes: e97cc04fe0fb ("drm/amd/display: refactor dmub commands into single function") Signed-off-by: Harshit Mogalapalli Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 8fa76350587b6deb8a95d83f9cb23ce7599587b5 Author: Srinivasan Shanmugam Date: Fri Apr 28 16:04:59 2023 +0530 drm/amd/amdgpu: Fix style problems in amdgpu_debugfs.c Fix the following issues reported by checkpatch: WARNING: please, no space before tabs WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: sizeof *rd should be sizeof(*rd) WARNING: Missing a blank line after declarations WARNING: sizeof rd->id should be sizeof(rd->id) WARNING: static const char * array should probably be static const char * const WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. WARNING: Prefer seq_puts to seq_printf ERROR: space prohibited after that open parenthesis '(' Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit d446127107e8185c2dc750cd4d0c5ff697a694f6 Author: YuBiao Wang Date: Fri Apr 28 14:00:40 2023 +0800 drm/amdgpu: Enable mcbp under sriov by default Enable mcbp under sriov by default. Asics with soc21 supports mcbp now so we should set it enabled. Signed-off-by: YuBiao Wang Reviewed-by: Horace Chen Signed-off-by: Alex Deucher commit 04b3c34f5cb2994a5e466659ea4aa962c0fc09a6 Author: Xiaomeng Hou Date: Thu Apr 27 13:38:47 2023 +0800 drm/amdgpu: remove pasid_src field from IV entry PASID_SRC is not actually present in the Interrupt Packet, the field is taken as reserved bits now. So remove it from IV entry to avoid misuse. Signed-off-by: Xiaomeng Hou Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit a6f7baa387a32940e364978f72c1c150a29a219d Author: Srinivasan Shanmugam Date: Thu Apr 27 20:12:31 2023 +0530 drm/amd/amdgpu: Simplify switch case statements in amdgpu_connectors.c Fix the following checkpatch errors: ERROR: trailing statements should be on next line ERROR: space required after that ',' (ctx:VxV) ERROR: code indent should use tabs where possible Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 9f58341d63bd26e93cca66e9e1ca850d3c40b0c3 Author: Horace Chen Date: Tue Apr 25 13:15:32 2023 +0800 drm/amdgpu: disable SDMA WPTR_POLL_ENABLE for SR-IOV [Why] This WPTR_POLL_ENABLE is a hardware contigious polling which will cause FCLK and UCLK to keep on a high level. Mostly its case can be covered by F32_WPTR_POLL_ENABLE which polls by firmware. So to save power, SR-IOV also needs to disable this bit Signed-off-by: Horace Chen Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 64e2e71737acad867577deac92c1bec62e8b57d1 Author: Stanley.Yang Date: Thu Apr 27 16:58:50 2023 +0800 drm/amdgpu: Add SDMA_UTCL1_WR_FIFO_SED field for sdma_v4_4_ras_field Query sdma_utcl1_wr_fifo_sed fiel to detect UTCL1_WR_FIFO SED error counts Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 514987a5bc3eb9bc86946f8013a9bdf732a29ef8 Author: Chia-I Wu Date: Wed Apr 26 15:54:55 2023 -0700 drm/amdgpu: add a missing lock for AMDGPU_SCHED mgr->ctx_handles should be protected by mgr->lock. v2: improve commit message v3: add a Fixes tag Signed-off-by: Chia-I Wu Reviewed-by: Christian König Fixes: 52c6a62c64fa ("drm/amdgpu: add interface for editing a foreign process's priority v3") Signed-off-by: Alex Deucher commit 27fb73a0e3aa7478bcb5d2d59d65eec3c68fc165 Author: Mukul Joshi Date: Tue Apr 25 14:19:05 2023 -0400 drm/amdkfd: Update KFD TTM mem limit Use the helper function in TTM to get TTM memory limit and set KFD's internal mem limit. This ensures that KFD's TTM mem limit and actual TTM mem limit are exactly same. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit f1f6f48a338cdab96efef712dbef6b1e279583e2 Author: Mukul Joshi Date: Tue Apr 25 14:13:36 2023 -0400 drm/amdgpu: Set GTT size equal to TTM mem limit Use the helper function in TTM to get TTM mem limit and set GTT size to be equal to TTL mem limit. Signed-off-by: Mukul Joshi Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 1d74159021e9a4e58c422f0b91e2a6fcb884c54f Author: Mukul Joshi Date: Tue Apr 25 14:11:56 2023 -0400 drm/ttm: Helper function to get TTM mem limit Add a helper function to get TTM memory limit. This is needed by KFD to set its own internal memory limits. Signed-off-by: Mukul Joshi Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 5c3213e9e2dd5dee0ba54a65a491ad4e43b615d0 Author: Kate Hsuan Date: Mon May 8 07:26:32 2023 +0100 media: atomisp: sh_css_mipi: Remove #ifdef ISP2401 The actions of ISP2401 and 2400 are determined at the runtime. Link: https://lore.kernel.org/r/20230508062632.34537-5-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 3c4f6507abde5c36e892d63b25296fc6d9b13285 Author: Guchun Chen Date: Thu Apr 27 09:21:05 2023 +0800 drm/amdgpu: mark gfx_v9_4_3_disable_gpa_mode() static This was left global by accident, the corresponding functions for other hardware types are already static: drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:1072:6: error: no previous prototype for function 'gfx_v9_4_3_disable_gpa_mode' [-Werror,-Wmissing-prototypes] Fixes: 86301129698b ("drm/amdgpu: split gc v9_4_3 functionality from gc v9_0") Reported-by: kernel test robot Signed-off-by: Arnd Bergmann Reviewed-by: Guchun Chen Signed-off-by: Guchun Chen Signed-off-by: Alex Deucher commit 34305ac364dbee1b8e4e5307599c8b9afff0b01c Author: Guchun Chen Date: Wed Apr 26 11:27:46 2023 +0800 drm/amdgpu: check correct allocated mqd_backup object after alloc Instead of the default one, check the right mqd_backup object. Signed-off-by: Guchun Chen Cc: Le Ma Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 7a4685cdfbdb94f1cf5ea2ddde824d94bf414708 Author: Guchun Chen Date: Wed Apr 26 11:05:49 2023 +0800 drm/amdgpu: fix a build warning by a typo in amdgpu_gfx.c This should be a typo when intruducing multi-xx support. Reported-by: kernel test robot Signed-off-by: Guchun Chen Cc: Le Ma Reviewed-by: Le Ma Acked-by: Christian König Signed-off-by: Alex Deucher commit b94f1cc93db72078ad2da02adf1818f5e9122cb7 Author: Tom Rix Date: Thu Apr 20 09:59:01 2023 -0400 drm/amd/display: return status of dmub_srv_get_fw_boot_status gcc with W=1 reports drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c: In function ‘dc_dmub_srv_optimized_init_done’: drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:184:26: error: variable ‘dmub’ set but not used [-Werror=unused-but-set-variable] 184 | struct dmub_srv *dmub; | ^~~~ The return status is never set. It looks like a call to dmub_srv_get_fw_boot_status is missing. Fixes: 499e4b1c722e ("drm/amd/display: add mechanism to skip DCN init") Signed-off-by: Tom Rix Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 4e004146c0bab0c05d66dc648593e8b7ec3d8df5 Author: Tom Rix Date: Wed Apr 26 07:18:38 2023 -0400 drm/amd/display: set variable custom_backlight_curve0 storage-class-specifier to static smatch reports drivers/gpu/drm/amd/amdgpu/../display/modules/power/power_helpers.c:119:31: warning: symbol 'custom_backlight_curve0' was not declared. Should it be static? This variable is only used in its defining file, so it should be static Signed-off-by: Tom Rix Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 08b9c820878f387b903c28962703337e42cfc4a5 Author: Kate Hsuan Date: Mon May 8 07:26:31 2023 +0100 media: atomisp: sh_css_firmware: determine firmware version at runtime The firmware version of ISP2401 and 2400 is determined at runtime. Link: https://lore.kernel.org/r/20230508062632.34537-4-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit c953cf040687992cfa066acca7d1c12e25fcec3e Author: Horatio Zhang Date: Tue Apr 25 10:52:28 2023 +0800 drm/amdgpu: fix amdgpu_irq_put call trace in gmc_v10_0_hw_fini The gmc.ecc_irq is enabled by firmware per IFWI setting, and the host driver is not privileged to enable/disable the interrupt. So, it is meaningless to use the amdgpu_irq_put function in gmc_v10_0_hw_fini, which also leads to the call trace. [ 82.340264] Call Trace: [ 82.340265] [ 82.340269] gmc_v10_0_hw_fini+0x83/0xa0 [amdgpu] [ 82.340447] gmc_v10_0_suspend+0xe/0x20 [amdgpu] [ 82.340623] amdgpu_device_ip_suspend_phase2+0x127/0x1c0 [amdgpu] [ 82.340789] amdgpu_device_ip_suspend+0x3d/0x80 [amdgpu] [ 82.340955] amdgpu_device_pre_asic_reset+0xdd/0x2b0 [amdgpu] [ 82.341122] amdgpu_device_gpu_recover.cold+0x4dd/0xbb2 [amdgpu] [ 82.341359] amdgpu_debugfs_reset_work+0x4c/0x70 [amdgpu] [ 82.341529] process_one_work+0x21d/0x3f0 [ 82.341535] worker_thread+0x1fa/0x3c0 [ 82.341538] ? process_one_work+0x3f0/0x3f0 [ 82.341540] kthread+0xff/0x130 [ 82.341544] ? kthread_complete_and_exit+0x20/0x20 [ 82.341547] ret_from_fork+0x22/0x30 Signed-off-by: Horatio Zhang Reviewed-by: Hawking Zhang Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 7e5b601008e781231be77bc8e1a84516f069983d Author: Horatio Zhang Date: Tue Apr 25 13:16:32 2023 +0800 drm/amdgpu: fix amdgpu_irq_put call trace in gmc_v11_0_hw_fini The gmc.ecc_irq is enabled by firmware per IFWI setting, and the host driver is not privileged to enable/disable the interrupt. So, it is meaningless to use the amdgpu_irq_put function in gmc_v11_0_hw_fini, which also leads to the call trace. [ 102.980303] Call Trace: [ 102.980303] [ 102.980304] gmc_v11_0_hw_fini+0x54/0x90 [amdgpu] [ 102.980357] gmc_v11_0_suspend+0xe/0x20 [amdgpu] [ 102.980409] amdgpu_device_ip_suspend_phase2+0x240/0x460 [amdgpu] [ 102.980459] amdgpu_device_ip_suspend+0x3d/0x80 [amdgpu] [ 102.980520] amdgpu_device_pre_asic_reset+0xd9/0x490 [amdgpu] [ 102.980573] amdgpu_device_gpu_recover.cold+0x548/0xce6 [amdgpu] [ 102.980687] amdgpu_debugfs_reset_work+0x4c/0x70 [amdgpu] [ 102.980740] process_one_work+0x21f/0x3f0 [ 102.980741] worker_thread+0x200/0x3e0 [ 102.980742] ? process_one_work+0x3f0/0x3f0 [ 102.980743] kthread+0xfd/0x130 [ 102.980743] ? kthread_complete_and_exit+0x20/0x20 [ 102.980744] ret_from_fork+0x22/0x30 Signed-off-by: Horatio Zhang Reviewed-by: Hawking Zhang Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 72c1c48553093f63be9518b5d7541a66dafad83a Author: Kate Hsuan Date: Mon May 8 07:26:30 2023 +0100 media: atomisp: sh_css_sp: Remove #ifdef ISP2401 The actions of ISP2401 and 2400 will be determined at the runtime. Link: https://lore.kernel.org/r/20230508062632.34537-3-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 1c312e816c4088d183c41b5d944f89775f3789bd Author: Shane Xiao Date: Tue Apr 25 22:39:08 2023 +0800 drm/amdgpu: Enable doorbell selfring after resize FB BAR [Why] The selfring doorbell aperture will change when resize FB BAR successfully during gmc sw init, we should reorder the sequence of enabling doorbell selfring aperture. [How] Move enable_doorbell_selfring_aperture from *_common_hw_init to *_common_late_init. This fixes the potential issue that GPU ring its own doorbell when this device is in translated mode when iommu is on. v2: Remove *_enable_doorbell_aperture functions (Christian) v3: Add comments to note that why we need enable doorbell selfring late (Christian) Signed-off-by: Shane Xiao Signed-off-by: Aaron Liu Tested-by: Xiaomeng Hou Reviewed-by: Christian K�nig Signed-off-by: Alex Deucher commit b2edaac4f2fb4866c3f9b7be5c39f518fd497a3b Author: Srinivasan Shanmugam Date: Wed Apr 26 00:15:26 2023 +0530 drm/amd/amdgpu: Fix style errors in amdgpu_display.c Fix following checkpatch errors in amdgpu_display.c ERROR: spaces required around that '=' (ctx:VxW) ERROR: that open brace { should be on the previous line ERROR: else should follow close brace '}' Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 5925dc0f30c2294f0015ee7060ef844b93000289 Author: Kate Hsuan Date: Mon May 8 07:26:29 2023 +0100 media: atomisp: runtime: frame: remove #ifdef ISP2401 The actions of ISP2401 and 2400 are determined at the runtime. Link: https://lore.kernel.org/r/20230508062632.34537-2-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit bc13f2ffd5c0160128d7520f32767423fc044a45 Author: Kate Hsuan Date: Mon May 8 07:26:28 2023 +0100 media: atomisp: sh_css: Remove #ifdef ISP2401 The actions of ISP2401 and 2400 are determined at the runtime. Link: https://lore.kernel.org/r/20230508062632.34537-1-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 27e6be5d753687764c852af6468c21ef0624022a Author: Srinivasan Shanmugam Date: Sat Apr 22 06:50:14 2023 +0530 drm/amd/display: DSC passthrough is for DP-HDMI pcon (SST pcon) if check over DSC passthrough is removed, as this is not for MST use case. It is for DP-HDMI pcon use case. sst pcon is detected as sst not mst. In sst pcon dsc passthrough message will not get below log printed Fixes: 9b035d089086 ("drm/amd/display: Check & log if receiver supports MST, DSC & FEC.") Suggested-by: Fangzhi Zuo Cc: Aurabindo Pillai Signed-off-by: Srinivasan Shanmugam Reviewed-by: Fangzhi Zuo Signed-off-by: Alex Deucher commit 59e9fff1983eaa9f226699f66f7d58da432dfb16 Author: lyndonli Date: Sun Apr 23 17:05:15 2023 +0800 drm/amdgpu: Use the default reset when loading or reloading the driver Below call trace and errors are observed when reloading amdgpu driver with the module parameter reset_method=3. It should do a default reset when loading or reloading the driver, regardless of the module parameter reset_method. v2: add comments inside and modify commit messages. [ +2.180243] [drm] psp gfx command ID_LOAD_TOC(0x20) failed and response status is (0x0) [ +0.000011] [drm:psp_hw_start [amdgpu]] *ERROR* Failed to load toc [ +0.000890] [drm:psp_hw_start [amdgpu]] *ERROR* PSP tmr init failed! [ +0.020683] [drm:amdgpu_fill_buffer [amdgpu]] *ERROR* Trying to clear memory with ring turned off. [ +0.000003] RIP: 0010:amdgpu_bo_release_notify+0x1ef/0x210 [amdgpu] [ +0.000004] Call Trace: [ +0.000003] [ +0.000008] ttm_bo_release+0x2c4/0x330 [amdttm] [ +0.000026] amdttm_bo_put+0x3c/0x70 [amdttm] [ +0.000020] amdgpu_bo_free_kernel+0xe6/0x140 [amdgpu] [ +0.000728] psp_v11_0_ring_destroy+0x34/0x60 [amdgpu] [ +0.000826] psp_hw_init+0xe7/0x2f0 [amdgpu] [ +0.000813] amdgpu_device_fw_loading+0x1ad/0x2d0 [amdgpu] [ +0.000731] amdgpu_device_init.cold+0x108e/0x2002 [amdgpu] [ +0.001071] ? do_pci_enable_device+0xe1/0x110 [ +0.000011] amdgpu_driver_load_kms+0x1a/0x160 [amdgpu] [ +0.000729] amdgpu_pci_probe+0x179/0x3a0 [amdgpu] Signed-off-by: lyndonli Signed-off-by: Yunxiang Li Reviewed-by: Feifei Xu Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 535f77861084467eaf37bbbb4d4aaa96f5fe4c1c Author: lyndonli Date: Sun Apr 23 16:46:30 2023 +0800 drm/amdgpu: Fix mode2 reset for sienna cichlid Before this change, sienna_cichlid_get_reset_handler will always return NULL, although the module parameter reset_method is 3 when loading amdgpu driver. Signed-off-by: lyndonli Signed-off-by: Yunxiang Li Reviewed-by: Feifei Xu Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 489763af891d5dc35c0b64e18af284d6591286cf Author: Pierre-Eric Pelloux-Prayer Date: Mon Apr 24 19:25:32 2023 +0200 drm/amdgpu: add new flag to AMDGPU_CTX_QUERY2 OpenGL EXT_robustness extension expects the driver to stop reporting GUILTY_CONTEXT_RESET when the reset has completed and the GPU is ready to accept submission again. This commit adds a AMDGPU_CTX_QUERY2_FLAGS_RESET_IN_PROGRESS flag, that let the UMD know that the reset is still not finished. Mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22290 Reviewed-by: Christian König Reviewed-by: André Almeida Signed-off-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Alex Deucher commit bafc31166aa7df5fa26ae0ad8196d1717e6cdea9 Author: Christophe JAILLET Date: Mon Apr 17 23:41:11 2023 +0200 drm/amd/display: Fix a test dml32_rq_dlg_get_rq_reg() It is likely p1_min_meta_chunk_bytes was expected here, instead of min_meta_chunk_bytes. Test the correct variable. Fixes: dda4fb85e433 ("drm/amd/display: DML changes for DCN32/321") Signed-off-by: Christophe JAILLET Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 960e27a5741cd3001996ff6ddfb3eb0ed3a4909d Author: Christophe JAILLET Date: Mon Apr 17 23:35:08 2023 +0200 drm/amd/display: Fix a test CalculatePrefetchSchedule() It is likely Height was expected here, instead of Width. Test the correct variable. Fixes: 17529ea2acfa ("drm/amd/display: Optimizations for DML math") Signed-off-by: Christophe JAILLET Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 609d830048fb00d4fdea59fc9d17a8d63fbddb4a Author: Sukrut Bellary Date: Sun Apr 23 22:59:10 2023 -0700 drm:amd:amdgpu: Fix missing bo unlock in failure path smatch warning - inconsistent handling of buffer object reserve and unreserve. Reviewed-by: Christian König Signed-off-by: Sukrut Bellary Signed-off-by: Alex Deucher commit e94c25567c8519b770985cc86b652b06dce807d2 Author: Tom Rix Date: Thu Apr 20 14:07:05 2023 -0400 drm/amd/display: remove unused variables dispclk_delay_subtotal and dout clang with W=1 reports drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn314/display_rq_dlg_calc_314.c:1003:15: error: variable 'dispclk_delay_subtotal' set but not used [-Werror,-Wunused-but-set-variable] unsigned int dispclk_delay_subtotal; ^ This variable is not used, so remove it. Which made dout unused, so also remove. Signed-off-by: Tom Rix Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 1ce018df87640adb139c8418785ad3b6e4376bd3 Author: Joerg Roedel Date: Fri Jun 9 15:15:08 2023 +0200 iommu/amd: Fix compile error for unused function Recent changes introduced a compile error: drivers/iommu/amd/iommu.c:1285:13: error: ‘iommu_flush_irt_and_complete’ defined but not used [-Werror=unused-function] 1285 | static void iommu_flush_irt_and_complete(struct amd_iommu *iommu, u16 devid) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ This happens with defconfig-x86_64 because AMD IOMMU is enabled but CONFIG_IRQ_REMAP is disabled. Move the function under #ifdef CONFIG_IRQ_REMAP to fix the error. Signed-off-by: Joerg Roedel commit 9a0e0c5957ff37147253796fbf5dfd68b307af58 Merge: 54cb981c29969 ca027ae58eaab Author: Arnd Bergmann Date: Fri Jun 9 15:14:51 2023 +0200 Merge tag 'samsung-soc-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/arm Samsung mach/soc changes for v6.5 1. Re-introduce Exynos4212 which was removed because of lack of upstream users. Artur Weber adds now Samsung Galaxy Tab3 with Exynos4212. 2. Minor cleanups. * tag 'samsung-soc-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: s3c: Switch i2c drivers back to use .probe() ARM: exynos: Re-introduce Exynos4212 support ARM: s3c: remove obsolete config S3C64XX_SETUP_IDE Link: https://lore.kernel.org/r/20230602091501.15178-3-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 102df33eba00a0af226279b8da244af85cf47a39 Author: Laurent Pinchart Date: Thu Apr 20 06:47:57 2023 +0300 media: uvcvideo: Constify descriptor buffers There is no need to modify the content of UVC descriptor buffers during parsing. Make all the corresponding pointers const to avoid unintended modifications. Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab commit af621ba2ede802bcd01b9d9af539f95030e21795 Author: Laurent Pinchart Date: Thu Apr 20 06:47:57 2023 +0300 media: uvcvideo: Constify formats, frames and intervals The formats, frames and intervals stored in the uvc_streaming structure are not meant to change after being parsed at probe time. Make them const to prevent unintended modifications, and adapt the probe code accordingly to use non-const pointers during parsing. Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab commit 7691d900b9291417dc6a88262f43176a63536c31 Author: Laurent Pinchart Date: Fri May 5 14:45:24 2023 +0300 media: uvcvideo: Increment intervals pointer at end of parsing The intervals pointer is incremented for each interval when parsing the format descriptor. This doesn't cause any issue as such, but gets in the way of constifying some pointers. Modify the parsing code to index the intervals pointer as an array and increment it in one go at end of parsing. Careful readers will notice that the maxIntervalIndex variable is set to 1 instead of n - 2 when bFrameIntervalType has a zero value. This is functionally equivalent, as n is equal to 3 in that case. Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab commit c9d597b9b7ef9ffcb54051f04798b608edc6850c Author: Laurent Pinchart Date: Fri May 5 14:45:24 2023 +0300 media: uvcvideo: Reorganize format descriptor parsing Format descriptor parsing has grown over time and now mixes parsing of frame intervals with various quirk handling. Reorganize it to make the code easier to follow, by parsing frame intervals first, and then applying fixes and quirks. No functional change is intended. Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab commit 7c5dfb2d912c005285682508447585c15aa7b765 Author: Laurent Pinchart Date: Fri May 5 14:45:24 2023 +0300 media: uvcvideo: Use clamp() to replace manual implementation The kernel has a nice clamp() macro, use it to replace a manual implementation based on min() and max(). No functional change is intended. Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab commit aa8db3adc7b2e4be80294bfcbbb20097dee76af6 Author: Laurent Pinchart Date: Thu Apr 20 06:33:03 2023 +0300 media: uvcvideo: Rename uvc_format 'frame' field to 'frames' The uvc_format 'frame' field points to an array of frames. Rename it to 'frames' to make this clearer. Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab commit ccfad4e85e3da034b0cd1c24ded77647a60ce3ac Author: Laurent Pinchart Date: Thu Apr 20 06:33:03 2023 +0300 media: uvcvideo: Rename uvc_streaming 'format' field to 'formats' The uvc_streaming 'format' field points to an array of formats. Rename it to 'formats' to make this clearer. Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab commit e33ae66a2e22f65c8e43ef95b614d42a685789d6 Author: Dmitry Perchanov Date: Thu Apr 20 12:06:55 2023 +0300 media: uvcvideo: Enable Intel RealSense metadata for devices Intel RealSense UVC Depth cameras produce metadata in a vendor-specific format that is already supported by the uvcvideo driver. Enable handling of this metadata for 7 additional RealSense devices. Co-developed-by: Yu MENG Co-developed-by: Evgeni Raikhel Signed-off-by: Dmitry Perchanov Reviewed-by: Laurent Pinchart Reviewed-by: Sakari Ailus Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit e7f61113edcac20f53068de46e7163004f46f99f Author: Dmitry Perchanov Date: Thu Jun 1 19:08:46 2023 +0300 media: uapi: v4l: Intel metadata format update Update metadata structure for Intel RealSense UVC/MIPI cameras. Compliant to Intel Configuration version 3. Signed-off-by: Dmitry Perchanov Reviewed-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 0ece58b280a4fa5e34cac64524a991f3cadccc45 Author: Sakari Ailus Date: Fri Jun 2 16:19:19 2023 +0300 Revert "media: uvcvideo: Limit power line control for Acer EasyCamera" This reverts commit 5dd0eab84ae9a4b292baf1ad02e1a273c475cd04. Revert this patch as it has been merged twice. The earlier merged commit is 81e78a6fc320 ("media: uvcvideo: Limit power line control for Acer EasyCamera"). Reported-by: Dmitry Perchanov Signed-off-by: Sakari Ailus Reviewed-by: Ricardo Ribalda Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 34318b808ef20cdddd4e187ea2df0455936cf61b Author: Sergey Senozhatsky Date: Fri May 26 07:29:34 2023 +0100 media: venus: provide ctx queue lock for ioctl synchronization Video device has to provide a lock so that __video_do_ioctl() can serialize IOCTL calls. Introduce a dedicated venus_inst mutex for the purpose of vb2 operations synchronization. Signed-off-by: Sergey Senozhatsky Reviewed-by: Vikash Garodia Reviewed-by: Bryan O'Donoghue Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 08998cf30f66862916b7b21784f0640677415492 Author: Dikshita Agarwal Date: Mon May 22 07:48:18 2023 +0100 media: venus: return P010 as preferred format for 10 bit decode If bit depth is detected as 10 bit by firmware, return P010 as preferred decoder format to the client. Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 996d215547a877406e601439bd6533d8524d27db Author: Dikshita Agarwal Date: Mon May 22 07:48:17 2023 +0100 media: venus: add handling of bit depth change from firmware Set opb format to TP10_UWC and dpb to client set format when bit depth change to 10 bit is detecting by firmware. Acked-by: Konrad Dybcio Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 58b64dd09fd83542effd621daf65b53114904619 Author: Dikshita Agarwal Date: Mon May 22 07:48:16 2023 +0100 media: venus: update calculation for dpb buffers Use dpb color format, width and height of output port for calculating buffer size of dpb buffers. Acked-by: Konrad Dybcio Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 3095607739d820fc691ab0cc6b85e801f74d2dc5 Author: Dikshita Agarwal Date: Mon May 22 07:48:15 2023 +0100 media: venus: add support for V4L2_PIX_FMT_P010 color format add V4L2_PIX_FMT_P010 as supported color format for decoder. Reviewed-by: Konrad Dybcio Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 2b832a06a8c85bca42b3cd6aacd703eea1feb784 Author: Dikshita Agarwal Date: Mon May 22 07:17:09 2023 +0100 media: venus: replace arrary index with enum for supported formats Use enums to list supported formats for encoder and decoder instead of array index which was a error prone design. Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 47f867cb1b6364be6b3d50a333370d6f66a7e085 Author: Dikshita Agarwal Date: Mon May 22 07:02:52 2023 +0100 media: venus: fix EOS handling in decoder stop command Use firmware version based check to assign correct device address for EOS buffer to fix the EOS handling with different firmware version. Reviewed-by: Konrad Dybcio Tested-by: Nathan Hebert Signed-off-by: Vikash Garodia Signed-off-by: Viswanath Boma Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit b79dec951a5ed81cdd6de88e619c1a8e3f88200f Merge: 24138ec0a39a2 a49e482c52d55 Author: Arnd Bergmann Date: Fri Jun 9 15:01:45 2023 +0200 Merge tag 'zynqmp-soc-for-v6.5' of https://github.com/Xilinx/linux-xlnx into soc/drivers arm64: ZynqMP SoC changes for v6.5 soc-power - Use of_property_present() instead of of_find_property() soc-event - Avoid use after free eve_data in event manager code firmware: - Extend zynqmp_pm_fpga_load() interface MAINTAINERS: - Clean xilinx records * tag 'zynqmp-soc-for-v6.5' of https://github.com/Xilinx/linux-xlnx: MAINTAINERS: Switch to @amd.com emails MAINTAINERS: Remove Hyun and Anurag from maintainer list firmware: xilinx: Update the zynqmp_pm_fpga_load() API driver: soc: xilinx: use _safe loop iterator to avoid a use after free soc: xilinx: Use of_property_present() for testing DT property presence Link: https://lore.kernel.org/r/411aee78-e7e8-5966-cbe8-40ff45e27ba2@monstr.eu Signed-off-by: Arnd Bergmann commit 938beb48f7653d27a270c68659d00a0f58643ac7 Author: Dikshita Agarwal Date: Mon May 22 07:02:51 2023 +0100 media: venus: enable sufficient sequence change support for vp9 VP9 supports resolution change at interframe. Currenlty, if sequence change is detected at interframe and resources are sufficient, sequence change event is not raised by firmware to driver until the next keyframe. This change add the HFI to notify the sequence change in this case to driver. Reviewed-by: Konrad Dybcio Tested-by: Nathan Hebert Signed-off-by: Vikash Garodia Signed-off-by: Viswanath Boma Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 7b87c164e179d36ca059199b3a54b265c66f67e3 Merge: 1b84450ef02c4 c776a2128dee5 Author: Arnd Bergmann Date: Fri Jun 9 15:00:24 2023 +0200 Merge tag 'renesas-dts-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/dt Renesas DTS updates for v6.5 (take two) - Add IOMMU support for PCIe devices on R-Car Gen3 and RZ/G2 SoCs, - Add HSCIF1 serial port support on Renesas ULCB boards equipped with the Shimafuji Kingfisher extension, - Miscellaneous fixes and improvements. * tag 'renesas-dts-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: dts: renesas: ulcb-kf: Add HSCIF1 node arm64: dts: renesas: ulcb-kf: Remove flow control for SCIF1 ARM: dts: iwg20d-q7-common: Fix backlight pwm specifier arm64: dts: renesas: Add IOMMU related properties into PCIe host nodes Link: https://lore.kernel.org/r/cover.1686304614.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 1b84450ef02c4565be8d283239563cd039aae9f8 Merge: 705ebd7768c48 02310be6f0800 Author: Arnd Bergmann Date: Fri Jun 9 14:59:17 2023 +0200 Merge tag 'amlogic-arm64-dt-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into soc/dt Amlogic ARM64 DT changes for v6.4: - Introduce initial DT for Amlogic C4 SoC based AW409 - add missing cache properties * tag 'amlogic-arm64-dt-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: arm64: dts: add support for C3 based Amlogic AW409 arm64: dts: amlogic: add missing cache properties dt-bindings: arm: amlogic: add C3 bindings Link: https://lore.kernel.org/r/37e5de2f-47f1-a3f3-f1e4-4a304192e556@linaro.org Signed-off-by: Arnd Bergmann commit 705ebd7768c48805eb38f9927bed7d4d5c70f479 Merge: a813efafd5f7b 98b503c7fb13a Author: Arnd Bergmann Date: Fri Jun 9 14:58:41 2023 +0200 Merge tag 'amlogic-arm-dt-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into soc/dt Amlogic ARM DT changes for v6.5: - correct uart_B and uart_C clock references for meson8 & meson8b * tag 'amlogic-arm-dt-for-v6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: ARM: dts: meson8: correct uart_B and uart_C clock references ARM: dts: meson8b: correct uart_B and uart_C clock references Link: https://lore.kernel.org/r/21b55df9-3eda-0a0f-cf76-79b1d7735314@linaro.org Signed-off-by: Arnd Bergmann commit ac3c456382e8fbf861824aebb0d9cc0a529972a7 Merge: 44c026a73be80 c5fb66a17a436 Author: Joerg Roedel Date: Fri Jun 9 14:58:03 2023 +0200 Merge tag 'arm-smmu-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into arm/smmu Arm SMMU updates for 6.5 - Device-tree binding updates: * Add missing clocks for SC8280XP and SA8775 Adreno SMMUs * Add two new Qualcomm SMMUs in SDX75 and SM6375 - Workarounds for Arm MMU-700 errata: * 1076982: Avoid use of SEV-based cmdq wakeup * 2812531: Terminate command batches with a CMD_SYNC * Enforce single-stage translation to avoid nesting-related errata - Set the correct level hint for range TLB invalidation on teardown commit a813efafd5f7b22de5cf228321127b0bcdfc2509 Merge: 2ddb56a5c2697 35e6bcd138bc7 Author: Arnd Bergmann Date: Fri Jun 9 14:57:56 2023 +0200 Merge tag 'hisi-arm64-dt-for-6.5' of https://github.com/hisilicon/linux-hisi into soc/dt ARM64: DT: HiSilicon ARM64 DT updates for v6.5 - Clean up the pinctrl-single node names and correct the #size-cells of the pinctrl controller nodes * tag 'hisi-arm64-dt-for-6.5' of https://github.com/hisilicon/linux-hisi: arm64: dts: hisilicon: Unify pinctrl-single pin group nodes Link: https://lore.kernel.org/r/6482C916.1010507@hisilicon.com Signed-off-by: Arnd Bergmann commit 2ddb56a5c2697def1238672bd51ed7ee358ab6fd Merge: 08750aa8beef5 709f6754fa357 Author: Arnd Bergmann Date: Fri Jun 9 14:57:25 2023 +0200 Merge tag 'hisi-arm32-dt-for-6.5' of https://github.com/hisilicon/linux-hisi into soc/dt ARM: DT: HiSilicon ARM32 DT updates for v6.5 - Clean up the pinctrl-single node names and correct the pinctrl controller nodes of the hi3620 SoC * tag 'hisi-arm32-dt-for-6.5' of https://github.com/hisilicon/linux-hisi: ARM: dts: hisilicon: Unify pinctrl-single pin group nodes Link: https://lore.kernel.org/r/6482C732.3060300@hisilicon.com Signed-off-by: Arnd Bergmann commit 08750aa8beef5fe120d74f1781b756f1a2988b56 Merge: 739c4c317e20d e2ff42b4f1caf Author: Arnd Bergmann Date: Fri Jun 9 14:56:07 2023 +0200 Merge tag 'zynq-dt-for-v6.5' of https://github.com/Xilinx/linux-xlnx into soc/dt ARM: Zynq DT changes for v6.5 - Setup 400k as default i2c frequency - Wire i2c recovery via gpio on zc702 * tag 'zynq-dt-for-v6.5' of https://github.com/Xilinx/linux-xlnx: ARM: zynq: dts: Add SCL & SDA GPIO entries for recovery ARM: zynq: dts: Setting default i2c clock frequency to 400kHz Link: https://lore.kernel.org/r/c5c99ba2-f004-306c-6251-551826f90df8@amd.com Signed-off-by: Arnd Bergmann commit 739c4c317e20dbaab9b05780598932995e68b569 Merge: c5c3f746c9baf 5cb957a188c7c Author: Arnd Bergmann Date: Fri Jun 9 14:54:32 2023 +0200 Merge tag 'omap-for-v6.5/dt-pin-nodes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/dt Clean-up for pinctrl-single node names for omaps for v6.5 To avoid producing lots of make dtbs checks warnings when the yaml binding for pinctrl-single gets merged, let's fix up the pin group node names. We want to do this rather than add non-standard node name workarounds to the yaml binding. Also included is a non-urgent fix to move gta04 model name out of the pinmux node that can wait for the merge window. * tag 'omap-for-v6.5/dt-pin-nodes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: Unify pinctrl-single pin group nodes for dra7 ARM: dts: Unify pinctrl-single pin group nodes for am4 ARM: dts: Unify pinctrl-single pin group nodes for am33xx ARM: dts: Unify pinctrl-single pin group nodes for ti81xx ARM: dts: Unify pinctrl-single pin group nodes for omap5 ARM: dts: Unify pinctrl-single pin group nodes for omap4 ARM: dts: Unify pinctrl-single pin group nodes for omap2 ARM: dts: Unify pinctrl-single pin group nodes for omap3 ARM: dts: gta04: Move model property out of pinctrl node Link: https://lore.kernel.org/r/pull-1685700720-242492@atomide.com-2 Signed-off-by: Arnd Bergmann commit 24138ec0a39a27c179cdb2465ee4a5242754b45d Merge: acaa52bc093f2 f620596fa3471 Author: Arnd Bergmann Date: Fri Jun 9 14:47:25 2023 +0200 Merge tag 'omap-for-v6.5/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/drivers Non-urgent ti-sysc driver fix for v6.5 merge window A fix for masking bool variables that can wait for the merge window no problem. * tag 'omap-for-v6.5/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: bus: ti-sysc: Fix dispc quirk masking bool variables Link: https://lore.kernel.org/r/pull-1685700720-242492@atomide.com Signed-off-by: Arnd Bergmann commit bccc37a8a2fb002a302a526656c56a793a708670 Author: Suravee Suthikulpanit Date: Tue May 30 10:11:37 2023 -0400 iommu/amd: Improving Interrupt Remapping Table Invalidation Invalidating Interrupt Remapping Table (IRT) requires, the AMD IOMMU driver to issue INVALIDATE_INTERRUPT_TABLE and COMPLETION_WAIT commands. Currently, the driver issues the two commands separately, which requires calling raw_spin_lock_irqsave() twice. In addition, the COMPLETION_WAIT could potentially be interleaved with other commands causing delay of the COMPLETION_WAIT command. Therefore, combine issuing of the two commands in one spin-lock, and changing struct amd_iommu.cmd_sem_val to use atomic64 to minimize locking. Reviewed-by: Jerry Snitselaar Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20230530141137.14376-6-suravee.suthikulpanit@amd.com Signed-off-by: Joerg Roedel commit 98aeb4ea5599c5f7fbb1645bdd2050d0be96dfa3 Author: Suravee Suthikulpanit Date: Tue May 30 10:11:36 2023 -0400 iommu/amd: Do not Invalidate IRT when IRTE caching is disabled With the Interrupt Remapping Table cache disabled, there is no need to issue invalidate IRT and wait for its completion. Therefore, add logic to bypass the operation. Reviewed-by: Jerry Snitselaar Suggested-by: Joao Martins Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20230530141137.14376-5-suravee.suthikulpanit@amd.com Signed-off-by: Joerg Roedel commit 66419036f68a838c00cbccacd6cb2e99da6e5710 Author: Suravee Suthikulpanit Date: Tue May 30 10:11:35 2023 -0400 iommu/amd: Introduce Disable IRTE Caching Support An Interrupt Remapping Table (IRT) stores interrupt remapping configuration for each device. In a normal operation, the AMD IOMMU caches the table to optimize subsequent data accesses. This requires the IOMMU driver to invalidate IRT whenever it updates the table. The invalidation process includes issuing an INVALIDATE_INTERRUPT_TABLE command following by a COMPLETION_WAIT command. However, there are cases in which the IRT is updated at a high rate. For example, for IOMMU AVIC, the IRTE[IsRun] bit is updated on every vcpu scheduling (i.e. amd_iommu_update_ga()). On system with large amount of vcpus and VFIO PCI pass-through devices, the invalidation process could potentially become a performance bottleneck. Introducing a new kernel boot option: amd_iommu=irtcachedis which disables IRTE caching by setting the IRTCachedis bit in each IOMMU Control register, and bypass the IRT invalidation process. Reviewed-by: Jerry Snitselaar Co-developed-by: Alejandro Jimenez Signed-off-by: Alejandro Jimenez Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20230530141137.14376-4-suravee.suthikulpanit@amd.com Signed-off-by: Joerg Roedel commit 74a37817bd1567330fb372eb01223e31b45b1cc0 Author: Suravee Suthikulpanit Date: Tue May 30 10:11:34 2023 -0400 iommu/amd: Remove the unused struct amd_ir_data.ref Since the amd_iommu_update_ga() has been switched to use the modify_irte_ga() helper function to update the IRTE, the parameter is no longer needed. Reviewed-by: Jerry Snitselaar Suggested-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20230530141137.14376-3-suravee.suthikulpanit@amd.com Signed-off-by: Joerg Roedel commit a42f0c7a4118ffa395866cc7f5522d71a86fc4dd Author: Joao Martins Date: Tue May 30 10:11:33 2023 -0400 iommu/amd: Switch amd_iommu_update_ga() to use modify_irte_ga() The modify_irte_ga() uses cmpxchg_double() to update the IRTE in one shot, which is necessary when adding IRTE cache disabling support since the driver no longer need to flush the IRT for hardware to take effect. Please note that there is a functional change where the IsRun and Destination bits of IRTE are now cached in the struct amd_ir_data.entry. Reviewed-by: Jerry Snitselaar Signed-off-by: Joao Martins Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20230530141137.14376-2-suravee.suthikulpanit@amd.com Signed-off-by: Joerg Roedel commit acaa52bc093f21c9d8dd43f21020ecf94e259561 Merge: c6a5181263ad7 538af6e5856b1 Author: Arnd Bergmann Date: Fri Jun 9 14:46:47 2023 +0200 Merge tag 'samsung-drivers-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/drivers Samsung SoC driver changes for v6.5 1. Re-introduce Exynos4212: Exynos PMU driver. 2. Convert S5P/Exynos Multi Format Codec bindings to DT schema. * tag 'samsung-drivers-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: dt-bindings: media: s5p-mfc: convert bindings to json-schema soc: samsung: exynos-pmu: Re-introduce Exynos4212 support dt-bindings: soc: samsung: exynos-pmu: add Exynos4212 compatible Link: https://lore.kernel.org/r/20230602091501.15178-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit ae8cdfc3f281ac28d5e64bc21dc1947224d98f37 Author: Dikshita Agarwal Date: Mon May 22 07:02:50 2023 +0100 media: venus: add firmware version based check Add firmware version based checks to enable/disable features for different SOCs. Tested-by: Nathan Hebert Signed-off-by: Vikash Garodia Signed-off-by: Viswanath Boma Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit e03ac40885db88cece5a5c866b6825d1eeacb24e Author: Gustavo A. R. Silva Date: Wed May 17 00:14:49 2023 +0100 media: venus: hfi_cmds: Use struct_size() helper Prefer struct_size() over open-coded versions of idiom: sizeof(struct-with-flex-array) + sizeof(typeof-flex-array-elements) * count where count is the max number of items the flexible array is supposed to contain. Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 40c02059645890d0525b693fc5b80d4c4db8d205 Author: Gustavo A. R. Silva Date: Wed May 17 00:14:27 2023 +0100 media: venus: hfi_cmds: Replace one-element array with flexible-array member One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array members in struct hfi_session_set_buffers_pkt, and refactor the rest of the code, accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/292 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit a80d6771ae067c3ec2313897fd999d3649a81c9c Author: Gustavo A. R. Silva Date: Tue May 16 21:17:32 2023 +0100 media: venus: Replace one-element arrays with flexible-array members One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array members in multiple structures, and refactor the rest of the code, accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/291 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit a0eadbe92610cfaa0f5d519778c0297564e6a3a2 Author: Gustavo A. R. Silva Date: Wed May 17 02:03:39 2023 +0100 media: venus: hfi_cmds: Replace fake flex-array with flexible-array member One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array members in struct hfi_sys_set_resource_pkt, and refactor the rest of the code, accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. The only binary differences seen before/after changes are the following: 17ba: mov %rbx,%rdi 17bd: call 17c2 17be: R_X86_64_PLT32 __tsan_write4-0x4 - 17c2: movl $0x14,(%rbx) + 17c2: movl $0x10,(%rbx) 17c8: lea 0x4(%rbx),%rdi 17cc: call 17d1 17cd: R_X86_64_PLT32 __tsan_write4-0x4 which is expected once this accounts for the following line of code at drivers/media/platform/qcom/venus/hfi_cmds.c:73 73 pkt->hdr.size = sizeof(*pkt); and as *pkt is of type struct hfi_sys_set_resource_pkt, sizeof(*pkt) is reduced by 4 bytes, due to the flex-array transformation. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/293 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 927e78ac8bc58155316cf6f46026e1912bbbbcfc Author: Rikard Falkeborn Date: Sat Sep 12 20:03:01 2020 +0100 media: venus: helpers: Fix ALIGN() of non power of two ALIGN() expects its second argument to be a power of 2, otherwise incorrect results are produced for some inputs. The output can be both larger or smaller than what is expected. For example, ALIGN(304, 192) equals 320 instead of 384, and ALIGN(65, 192) equals 256 instead of 192. However, nestling two ALIGN() as is done in this case seem to only produce results equal to or bigger than the expected result if ALIGN() had handled non powers of two, and that in turn results in framesizes that are either the correct size or too large. Fortunately, since 192 * 4 / 3 equals 256, it turns out that one ALIGN() is sufficient. Fixes: ab1eda449c6e ("media: venus: vdec: handle 10bit bitstreams") Signed-off-by: Rikard Falkeborn Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit c6a5181263ad7acc2463d99fc3bf9ab374b98865 Merge: edc24de71648d a00d47f7645d6 Author: Arnd Bergmann Date: Fri Jun 9 14:42:18 2023 +0200 Merge tag 'renesas-drivers-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/drivers Renesas driver updates for v6.5 (take two) - Convert the R-Mobile SYSC driver to readl_poll_timeout_atomic(). * tag 'renesas-drivers-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: rmobile-sysc: Convert to readl_poll_timeout_atomic() iopoll: Do not use timekeeping in read_poll_timeout_atomic() iopoll: Call cpu_relax() in busy loops Link: https://lore.kernel.org/r/cover.1686304612.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 751be5c63f542b794328c9b1c8fd4a934c24fdeb Author: Liu Shixin Date: Mon Sep 21 09:24:40 2020 +0100 media: venus: simplify the return expression of venus_sys_set_* function Simplify the return expression. Signed-off-by: Liu Shixin Reviewed-by: Bjorn Andersson Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 0403565132a5409ab39760d0b6810d9c66213d66 Merge: 795acd67c5848 cacde5cc9dbc1 Author: Arnd Bergmann Date: Fri Jun 9 14:41:03 2023 +0200 Merge tag 'renesas-arm-defconfig-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/defconfig Renesas ARM defconfig updates for v6.5 (take two) - Enable support for the Renesas MTU3a counter in the arm64 defconfig. * tag 'renesas-arm-defconfig-for-v6.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: defconfig: Enable Renesas MTU3a counter config Link: https://lore.kernel.org/r/cover.1686304611.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 98d4351847bb45d956722f81f4948aebf3b8df2d Author: Qinglang Miao Date: Mon Sep 21 14:10:38 2020 +0100 media: venus: simplify the return expression of session_process_buf() Simplify the return expression. Signed-off-by: Qinglang Miao Reviewed-by: Bjorn Andersson Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 37fdb33c87c2fa9f83f0f3f0ae5a007c1e917052 Author: Venkateswara Naralasetty Date: Thu Jun 1 20:02:14 2023 +0530 wifi: ath11k: update proper pdev/vdev id for testmode command User can extend test mode command support to set vdev and pdev params for debug purpose at run time by sending vdev/pdev param set command through the testmode command interface. Fill the proper pdev/vdev id in driver since, pdev/vdev id details may not be available at user space. It will make sure that the proper vdev/pdev ids are sent to firmware. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Venkateswara Naralasetty Signed-off-by: Raj Kumar Bhagat Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230601143214.13006-1-quic_rajkbhag@quicinc.com commit 6358b10371579e1068b6f236a3ccd5c2fef995e6 Author: Uwe Kleine-König Date: Thu Jun 1 10:25:56 2023 +0200 wifi: atk10k: Don't opencode ath10k_pci_priv() in ath10k_ahb_priv() This introduces no changes in the compiled result (tested for an ARCH=arm allmodconfig build). Signed-off-by: Uwe Kleine-König Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230601082556.2738446-5-u.kleine-koenig@pengutronix.de commit d457bff2763366513bce36c2fc51fcba12a2f912 Author: Uwe Kleine-König Date: Thu Jun 1 10:25:55 2023 +0200 wifi: ath10k: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Both ath10k platform drivers return zero unconditionally in their remove callback, so they can be trivially converted to use .remove_new(). Also fix on of the more offending whitespace issues in the definition of ath10k_snoc_driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230601082556.2738446-4-u.kleine-koenig@pengutronix.de commit fad5ac80dfa5010d44c24d59d9e8e1552a447911 Author: Uwe Kleine-König Date: Thu Jun 1 10:25:54 2023 +0200 wifi: ath10k: Drop checks that are always false platform_get_drvdata() cannot return NULL as the probe function calls platform_set_drvdata() with a non-NULL argument or returns with a failure. In the first case, platform_get_drvdata() returns this non-NULL value and in the second the remove callback isn't called at all. ath10k_ahb_priv() cannot return NULL and ar_ahb is unused after the check anyhow. Signed-off-by: Uwe Kleine-König Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230601082556.2738446-3-u.kleine-koenig@pengutronix.de commit ec3b1ce2ca347b4b0a7cd5d1b69c316840202df3 Author: Uwe Kleine-König Date: Thu Jun 1 10:25:53 2023 +0200 wifi: ath10k: Drop cleaning of driver data from probe error path and remove The driver core cares for resetting driver data if probe fails and after remove. So drop the explicit and duplicate cleanup in the driver's functions. Signed-off-by: Uwe Kleine-König Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230601082556.2738446-2-u.kleine-koenig@pengutronix.de commit 62a97bea5cce5317d6d7630f7bcf0cdf5333e269 Merge: 7077b1864ca8f 8bd81864533bd Author: Mark Brown Date: Fri Jun 9 13:13:51 2023 +0100 Fix error check and cleanup for JH7110 TDM Merge series from Walker Chen : Some minor issues were found during addtional testing and static analysis. The first patch fix the error check for the return value of devm_reset_control_array_get_exclusive(). The second patch drop some unused macros. commit b1acb4e5601b07700fd30346a08dcb7dbfc437a7 Author: Xu Yang Date: Tue Apr 18 18:29:09 2023 +0800 dt-bindings: perf: fsl-imx-ddr: Add i.MX93 compatible i.MX93 ddr pmu shares the same device node format as i.MX8. This will add a compatible for i.MX93 and modify the title. Reviewed-by: Rob Herring Signed-off-by: Xu Yang Link: https://lore.kernel.org/r/20230418102910.2065651-2-xu.yang_2@nxp.com Signed-off-by: Will Deacon commit 55691f99d417084305e575c477f06556f93dfb0b Author: Xu Yang Date: Tue Apr 18 18:29:08 2023 +0800 drivers/perf: imx_ddr: Add support for NXP i.MX9 SoC DDRC PMU driver Add ddr performance monitor support for i.MX93. There are 11 counters for ddr performance events. - Counter 0 is a 64-bit counter that counts only clock cycles. - Counter 1-10 are 32-bit counters that can monitor counter-specific events in addition to counting reference events. For example: perf stat -a -e imx9_ddr0/ddrc_pm_1,counter=1/,imx9_ddr0/ddrc_pm_2,counter=2/ ls Besides, this ddr pmu support AXI filter capability. It's implemented as counter-specific events. It now supports read transaction, write transaction and read beat events which corresponding respecitively to counter 2, 3 and 4. axi_mask and axi_id need to be as event parameters. For example: perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_trans_filt,counter=2,axi_mask=ID_MASK,axi_id=ID/ perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_wr_trans_filt,counter=3,axi_mask=ID_MASK,axi_id=ID/ perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt,counter=4,axi_mask=ID_MASK,axi_id=ID/ Signed-off-by: Xu Yang Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20230418102910.2065651-1-xu.yang_2@nxp.com [will: Remove redundant error message on platform_get_irq() failure] Signed-off-by: Will Deacon commit e7c5433c5aaab52ddd5448967a9a5db94a3939cc Author: Yang Li Date: Thu Jun 8 16:31:48 2023 +0800 tools: ynl: Remove duplicated include in handshake-user.c ./tools/net/ynl/generated/handshake-user.c: stdlib.h is included more than once. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5464 Signed-off-by: Yang Li Signed-off-by: David S. Miller commit d2e3bb51281875be23cb4726a59b03d0a53eb0d3 Author: Robin Murphy Date: Mon Jun 5 18:01:34 2023 +0100 perf/arm_cspmu: Decouple APMT dependency The functional paths of the driver need not care about ACPI, so abstract the property of atomic doubleword access as its own flag (repacking the structure for a better fit). We also do not need to go poking directly at the APMT for standard resources which the ACPI layer has already dealt with, so deal with the optional MMIO page and interrupt in the normal firmware-agnostic manner. The few remaining portions of probing that *are* APMT-specific can still easily retrieve the APMT pointer as needed without us having to carry a duplicate copy around everywhere. Reviewed-by: Suzuki K Poulose Signed-off-by: Robin Murphy Reviewed-and-tested-by: Ilkka Koskinen Link: https://lore.kernel.org/r/88f97268603e1aa6016d178982a1dc2861f6770d.1685983270.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit f9bd34e3753ea8f1433a3ba70f03a165a1416f98 Author: Robin Murphy Date: Mon Jun 5 18:01:33 2023 +0100 perf/arm_cspmu: Clean up ACPI dependency Build-wise, the ACPI dependency consists of only a couple of things which could probably stand being factored out into ACPI helpers anyway. However for the immediate concern of working towards Devicetree support here, it's easy enough to make a few tweaks to contain the affected code locally, such that we can relax the Kconfig dependency. Reviewed-and-Tested-by: Suzuki K Poulose Reviewed-by: Ilkka Koskinen Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/9d126711c7498b199b3e6f5cf48ca60ffb9df54c.1685983270.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 87b3b6d53efccbb64396675b35839180ef14ef40 Author: Robin Murphy Date: Mon Jun 5 18:01:32 2023 +0100 ACPI/APMT: Don't register invalid resource Don't register a resource for the second page unless the dual-page extension flag is actually present to say it's valid. CC: Lorenzo Pieralisi CC: Sudeep Holla Reviewed-by: Suzuki K Poulose Reviewed-by: Hanjun Guo Reviewed-and-tested-by: Ilkka Koskinen Signed-off-by: Robin Murphy Acked-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/63b34656e1f7b41bcb458fb6d7496e04db757e0d.1685983270.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 71e0cb32d5fc61468e83ed962379af71bba8237e Author: Robin Murphy Date: Mon Jun 5 18:01:31 2023 +0100 perf/arm_cspmu: Fix event attribute type ARM_CSPMU_EVENT_ATTR() defines a struct perf_pmu_events_attr, so arm_cspmu_sysfs_event_show() should not be interpreting it as struct dev_ext_attribute. Fixes: e37dfd65731d ("perf: arm_cspmu: Add support for ARM CoreSight PMU driver") Reviewed-by: Suzuki K Poulose Reviewed-and-tested-by: Ilkka Koskinen Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/27c0804af64007b2400abbc40278f642ee6a0a29.1685983270.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 225d757012e0afa673d8c862e6fb39ed2f429b4d Author: Ilkka Koskinen Date: Thu Jun 8 13:37:42 2023 -0700 perf: arm_cspmu: Set irq affinitiy only if overflow interrupt is used Don't try to set irq affinity if PMU doesn't have an overflow interrupt. Fixes: e37dfd65731d ("perf: arm_cspmu: Add support for ARM CoreSight PMU driver") Signed-off-by: Ilkka Koskinen Link: https://lore.kernel.org/r/20230608203742.3503486-1-ilkka@os.amperecomputing.com Signed-off-by: Will Deacon commit 7a6a9f1c5a0a875a421db798d4b2ee022dc1ee1a Author: Junhao He Date: Thu Jun 8 19:43:26 2023 +0800 drivers/perf: hisi: Don't migrate perf to the CPU going to teardown The driver needs to migrate the perf context if the current using CPU going to teardown. By the time calling the cpuhp::teardown() callback the cpu_online_mask() hasn't updated yet and still includes the CPU going to teardown. In current driver's implementation we may migrate the context to the teardown CPU and leads to the below calltrace: ... [ 368.104662][ T932] task:cpuhp/0 state:D stack: 0 pid: 15 ppid: 2 flags:0x00000008 [ 368.113699][ T932] Call trace: [ 368.116834][ T932] __switch_to+0x7c/0xbc [ 368.120924][ T932] __schedule+0x338/0x6f0 [ 368.125098][ T932] schedule+0x50/0xe0 [ 368.128926][ T932] schedule_preempt_disabled+0x18/0x24 [ 368.134229][ T932] __mutex_lock.constprop.0+0x1d4/0x5dc [ 368.139617][ T932] __mutex_lock_slowpath+0x1c/0x30 [ 368.144573][ T932] mutex_lock+0x50/0x60 [ 368.148579][ T932] perf_pmu_migrate_context+0x84/0x2b0 [ 368.153884][ T932] hisi_pcie_pmu_offline_cpu+0x90/0xe0 [hisi_pcie_pmu] [ 368.160579][ T932] cpuhp_invoke_callback+0x2a0/0x650 [ 368.165707][ T932] cpuhp_thread_fun+0xe4/0x190 [ 368.170316][ T932] smpboot_thread_fn+0x15c/0x1a0 [ 368.175099][ T932] kthread+0x108/0x13c [ 368.179012][ T932] ret_from_fork+0x10/0x18 ... Use function cpumask_any_but() to find one correct active cpu to fixes this issue. Fixes: 8404b0fbc7fb ("drivers/perf: hisi: Add driver for HiSilicon PCIe PMU") Signed-off-by: Junhao He Reviewed-by: Jonathan Cameron Reviewed-by: Yicong Yang Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20230608114326.27649-1-hejunhao3@huawei.com Signed-off-by: Will Deacon commit 7077b1864ca8f0d616c497b3ee890d72d1da0a26 Author: Marek Vasut Date: Tue Jun 6 19:59:51 2023 +0200 ASoC: dt-bindings: audio-graph-card: Expand 'widgets' documentation Document the encoding of 'widgets' property to avoid confusion. Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230606175951.215740-1-marex@denx.de Signed-off-by: Mark Brown commit ca27441efe696a8990858156c6c332e786c30b4a Author: Kuninori Morimoto Date: Fri Jun 9 01:40:41 2023 +0000 ASoC: audio-graph-card2-custom-sample: add missing CPU:Codec = 1:N sample It has CPU:Codec = 1:1 and N:N samples, but missing 1:N settings. This patch adds it. One note here is that because of registering timing, probing and CPU/Codec numbering are mismatching. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87ilbx1kh3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 70dad53ddff0778c4920a1ee9eb1cfea539d4e91 Author: Curtis Malainey Date: Thu Jun 8 15:18:16 2023 -0700 ASoC: SOF: Add IPC3 Kernel Injector Add debugfs path to fake a malicious firmware message for fuzzing purposes. Skip IPC4 for initial integration Signed-off-by: Curtis Malainey Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20230608221822.2825786-2-cujomalainey@chromium.org Signed-off-by: Mark Brown commit 12c41c779fad54714ce4901757374f6006a88644 Author: Curtis Malainey Date: Thu Jun 8 15:18:15 2023 -0700 ASoC: SOF: Refactor rx function for fuzzing Refactor the function so reading the data is done outside the work function so fuzzing can pass data directly into the work callbacks. Also expose the inner function outside the module so we can call it from the injector. Signed-off-by: Curtis Malainey Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20230608221822.2825786-1-cujomalainey@chromium.org Signed-off-by: Mark Brown commit e352f31a863f47adfa54c76b633a21b1ed562387 Author: Nícolas F. R. A. Prado Date: Thu Jun 8 18:10:48 2023 -0400 ASoC: mediatek: mt8192-mt6359: Go back to old headphone pin name This reverts commit cbbc0ec6dea09c ("ASoC: mediatek: mt8192-mt6359: Remove " Jack" from Headphone pin name"). That commit removed the " Jack" suffix with the reasoning that it is automatically added to the name of the kcontrol created, which is true, but this name is also used to look for the DAPM widget that will be toggled when the jack status is updated. Since the widget is still called "Headphone Jack" the jack can't link to the widget and the following error is shown: mt8192_mt6359 sound: ASoC: DAPM unknown pin Headphone It is not possible to also rename the headphone DAPM widget because its name is used by a switch kcontrol, "Headphone Jack Switch", both to link to the headphone widget and to assemble its name. This switch's name is referenced in the upstream UCM file, so renaming it would break userspace. Since the original commit didn't bring any benefit, besides sparing a few CPU cycles, simply revert it. Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20230608221050.217968-1-nfraprado@collabora.com Signed-off-by: Mark Brown commit 8bd81864533bd02d6922deadeed643c813dfe142 Author: Walker Chen Date: Thu Jun 8 21:57:50 2023 +0800 ASoC: starfive: Remove some unused macros These macros are unused and can be dropped. Signed-off-by: Walker Chen Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230608135750.11041-3-walker.chen@starfivetech.com Signed-off-by: Mark Brown commit 3582cf94ff49469ffe78e96014550f7d4e466fbd Author: Walker Chen Date: Thu Jun 8 21:57:49 2023 +0800 ASoC: starfive: Fix an error check in jh7110_tdm_clk_reset_get() Fix the check for devm_reset_control_array_get_exclusive() return value. The devm_reset_control_array_get_exclusive() function may return NULL if it's an optional request. If optional is intended then NULL should not be treated as an error case, but as a special kind of success case. So here the IS_ERR() is used to check better. Signed-off-by: Walker Chen Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230608135750.11041-2-walker.chen@starfivetech.com Signed-off-by: Mark Brown commit 56f7783ba4e514a18a13cda94b08563dbefede0a Merge: 54a8c43f3bcfd bd5736e146e35 Author: David S. Miller Date: Fri Jun 9 10:38:44 2023 +0100 Merge branch 'broadcom-phy-led-brightness' Florian Fainelli says: ==================== LED brightness support for Broadcom PHYs This patch series adds support for controlling the LED brightness on Broadcom PHYs. ==================== Signed-off-by: David S. Miller commit bd5736e146e35f9eabe8c1bfc0ab00979ae62930 Author: Florian Fainelli Date: Wed Jun 7 11:34:53 2023 -0700 net: phy: broadcom: Add support for setting LED brightness Broadcom PHYs have two LEDs selector registers which allow us to control the LED assignment, including how to turn them on/off. Signed-off-by: Florian Fainelli Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 57fd7d59b1c7d6f6a1c34863a2bc4ff1f6c92d40 Author: Florian Fainelli Date: Wed Jun 7 11:34:52 2023 -0700 net: phy: broadcom: Rename LED registers These registers are common to most PHYs and are not specific to the BCM5482, renamed the constants accordingly, no functional change. Signed-off-by: Florian Fainelli Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit b0ce9ce408b6cfbce6c720c7eb084e6d81a04434 Author: Andy Shevchenko Date: Mon Jun 5 15:58:10 2023 +0300 gpiolib: Do not unexport GPIO on freeing Since the legacy exporting is gone with 2f804aca4832 ("gpiolib: Kill unused GPIOF_EXPORT and Co") there is no need to unexport GPIO on freeing. Remove that call. Note, the other users of this functionality do that explicitly, except one SH and one OMAP boardfile which don't free GPIO anyways, so it is safe to drop the call. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 5cad8323040bb8d47e130c10ea4dcb7175c7602a Author: Tony Lindgren Date: Tue May 23 09:59:58 2023 +0300 mips: dts: ralink: mt7628a: Unify pinctrl-single pin group nodes We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren Signed-off-by: Thomas Bogendoerfer commit 54a8c43f3bcfd5adbb9f15f8a992a3d0fce8ee50 Merge: 0c6e9d32ef0cc 790071347a0a1 Author: David S. Miller Date: Fri Jun 9 10:32:51 2023 +0100 Merge branch 'net-ncsi-refactoring-for-GMA-cmd' Ivan Mikhaylov says: ==================== net/ncsi: refactoring for GMA command Make one GMA function for all manufacturers, change ndo_set_mac_address to dev_set_mac_address for notifiying net layer about MAC change which ndo_set_mac_address doesn't do. Changes from v1: 1. delete ftgmac100.txt changes about mac-address-increment 2. add convert to yaml from ftgmac100.txt 3. add mac-address-increment option for ethernet-controller.yaml Changes from v2: 1. remove DT changes from series, will be done in another one ==================== Signed-off-by: David S. Miller commit 790071347a0a1a89e618eedcd51c687ea783aeb3 Author: Ivan Mikhaylov Date: Wed Jun 7 18:17:42 2023 +0300 net/ncsi: change from ndo_set_mac_address to dev_set_mac_address Change ndo_set_mac_address to dev_set_mac_address because dev_set_mac_address provides a way to notify network layer about MAC change. In other case, services may not aware about MAC change and keep using old one which set from network adapter driver. As example, DHCP client from systemd do not update MAC address without notification from net subsystem which leads to the problem with acquiring the right address from DHCP server. Fixes: cb10c7c0dfd9e ("net/ncsi: Add NCSI Broadcom OEM command") Cc: stable@vger.kernel.org # v6.0+ 2f38e84 net/ncsi: make one oem_gma function for all mfr id Signed-off-by: Paul Fertser Signed-off-by: Ivan Mikhaylov Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 74b449b98dccdf24288d562f9d207fa066da793d Author: Ivan Mikhaylov Date: Wed Jun 7 18:17:41 2023 +0300 net/ncsi: make one oem_gma function for all mfr id Make the one Get Mac Address function for all manufacturers and change this call in handlers accordingly. Reviewed-by: Simon Horman Signed-off-by: Ivan Mikhaylov Signed-off-by: David S. Miller commit 0c6e9d32ef0ccfcf2d875cbcff23bf345a54d585 Author: Foster Snowhill Date: Wed Jun 7 15:57:02 2023 +0200 usbnet: ipheth: update Kconfig description This module has for a long time not been limited to iPhone <= 3GS. Update description to match the actual state of the driver. Remove dead link from 2010, instead reference an existing userspace iOS device pairing implementation as part of libimobiledevice. Signed-off-by: Foster Snowhill Signed-off-by: David S. Miller commit a2d274c62e44b1995c170595db3865c6fe701226 Author: Foster Snowhill Date: Wed Jun 7 15:57:01 2023 +0200 usbnet: ipheth: add CDC NCM support Recent iOS releases support CDC NCM encapsulation on RX. This mode is the default on macOS and Windows. In this mode, an iOS device may include one or more Ethernet frames inside a single URB. Freshly booted iOS devices start in legacy mode, but are put into NCM mode by the official Apple driver. When reconnecting such a device from a macOS/Windows machine to a Linux host, the device stays in NCM mode, making it unusable with the legacy ipheth driver code. To correctly support such a device, the driver has to either support the NCM mode too, or put the device back into legacy mode. To match the behaviour of the macOS/Windows driver, and since there is no documented control command to revert to legacy mode, implement NCM support. The device is attempted to be put into NCM mode by default, and falls back to legacy mode if the attempt fails. Signed-off-by: Foster Snowhill Tested-by: Georgi Valkov Signed-off-by: David S. Miller commit 3e65efcca87a9bb5f3b864e0a43d167bc0a8688c Author: Foster Snowhill Date: Wed Jun 7 15:57:00 2023 +0200 usbnet: ipheth: transmit URBs without trailing padding The behaviour of the official iOS tethering driver on macOS is to not transmit any trailing padding at the end of URBs. This is applicable to both NCM and legacy modes, including older devices. Adapt the driver to not include trailing padding in TX URBs, matching the behaviour of the official macOS driver. Signed-off-by: Foster Snowhill Tested-by: Georgi Valkov Signed-off-by: David S. Miller commit 2203718c2f59ffdd6c78d54e5add594aebb4461e Author: Georgi Valkov Date: Wed Jun 7 15:56:59 2023 +0200 usbnet: ipheth: fix risk of NULL pointer deallocation The cleanup precedure in ipheth_probe will attempt to free a NULL pointer in dev->ctrl_buf if the memory allocation for this buffer is not successful. While kfree ignores NULL pointers, and the existing code is safe, it is a better design to rearrange the goto labels and avoid this. Signed-off-by: Georgi Valkov Signed-off-by: Foster Snowhill Signed-off-by: David S. Miller commit be9aac187433af6abba5fcc2e73d91d0794ba360 Merge: aafeeaf3d2a8a 9561de3a55bed Author: Mauro Carvalho Chehab Date: Fri Jun 9 10:12:41 2023 +0100 Merge tag 'v6.4-rc5' into media_stage Linux 6.4-rc5 * tag 'v6.4-rc5': (919 commits) Linux 6.4-rc5 leds: qcom-lpg: Fix PWM period limits selftests/ftrace: Choose target function for filter test from samples KVM: selftests: Add test for race in kvm_recalculate_apic_map() KVM: x86: Bail from kvm_recalculate_phys_map() if x2APIC ID is out-of-bounds KVM: x86: Account fastpath-only VM-Exits in vCPU stats KVM: SVM: vNMI pending bit is V_NMI_PENDING_MASK not V_NMI_BLOCKING_MASK KVM: x86/mmu: Grab memslot for correct address space in NX recovery worker tpm, tpm_tis: correct tpm_tis_flags enumeration values Revert "ext4: remove ac->ac_found > sbi->s_mb_min_to_scan dead check in ext4_mb_check_limits" media: uvcvideo: Don't expose unsupported formats to userspace media: v4l2-subdev: Fix missing kerneldoc for client_caps media: staging: media: imx: initialize hs_settle to avoid warning media: v4l2-mc: Drop subdev check in v4l2_create_fwnode_links_to_pad() riscv: Implement missing huge_ptep_get riscv: Fix huge_ptep_set_wrprotect when PTE is a NAPOT module/decompress: Fix error checking on zstd decompression fork, vhost: Use CLONE_THREAD to fix freezer/ps regression dt-bindings: serial: 8250_omap: add rs485-rts-active-high selinux: don't use make's grouped targets feature yet ... commit e3023094dffb41540330fb0c74cd3a019cd525c2 Author: Herbert Xu Date: Thu Jun 1 16:47:43 2023 +0800 dm crypt: Avoid using MAX_CIPHER_BLOCKSIZE MAX_CIPHER_BLOCKSIZE is an internal implementation detail and should not be relied on by users of the Crypto API. Instead of storing the IV on the stack, allocate it together with the crypto request. Signed-off-by: Herbert Xu Reviewed-by: Mike Snitzer Signed-off-by: Herbert Xu commit f0051844fba1a304beafe3b0d529be35cb468fda Author: Karthikeyan Gopal Date: Tue May 30 17:01:47 2023 +0100 crypto: qat - update slice mask for 4xxx devices Update slice mask enum for 4xxx device with BIT(7) to mask SMX fuse. This change is done to align the slice mask with the hardware fuse register. Signed-off-by: Karthikeyan Gopal Reviewed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit c8c6ee5199bf70f369d5dd97bad7072361ba569d Author: Karthikeyan Gopal Date: Tue May 30 16:58:11 2023 +0100 crypto: qat - set deprecated capabilities as reserved The LZS and RAND features are no longer available on QAT. Remove the definition of bit 6 (LZS) and bit 7 (RAND) in the enum that represents the capabilities and replace them with a comment mentioning that those bits are reserved. Those bits shall not be used in future. Signed-off-by: Karthikeyan Gopal Reviewed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 301cf77e21317b3465c5e2bb0188df24bbf1c2e2 Author: Ingo Molnar Date: Fri Jun 9 11:04:53 2023 +0200 x86/orc: Make the is_callthunk() definition depend on CONFIG_BPF_JIT=y Recent commit: 020126239b8f Revert "x86/orc: Make it callthunk aware" Made the only user of is_callthunk() depend on CONFIG_BPF_JIT=y, while the definition of the helper function is unconditional. Move is_callthunk() inside the #ifdef block. Addresses this build failure: arch/x86/kernel/callthunks.c:296:13: error: ‘is_callthunk’ defined but not used [-Werror=unused-function] Signed-off-by: Ingo Molnar Cc: Josh Poimboeuf Cc: linux-kernel@vger.kernel.org Cc: Peter Zijlstra commit 53ba2e16957b01eb7858e3ee5a3a8187a2892f15 Author: Mika Westerberg Date: Fri Mar 24 13:04:39 2023 +0200 thunderbolt: Disable CL states when a DMA tunnel is established Tunnels between hosts should not have CL states enabled because otherwise they might enter a low power state without the other end noticing which causes packets to be lost. For this reason disable all CL states upon first DMA tunnel creation. Once the last DMA tunnel is torn down we try to re-enable them. Signed-off-by: Mika Westerberg commit 4a420eb1426a237aaf105c9d040644785fc2c7fa Author: Mika Westerberg Date: Fri Nov 18 15:42:27 2022 +0200 thunderbolt: Make tb_switch_clx_disable() return CL states that were enabled This allows us to disable all CL states temporarily when running lane margining and then return back the previously enabled states. Signed-off-by: Mika Westerberg commit 768e6fe69fde546beb942344c4c4932f3b3bb55b Author: Mika Westerberg Date: Wed May 24 13:33:57 2023 +0300 thunderbolt: Initialize CL states from the hardware In case the boot firmware enabled any of them, read the currently configured CL states and update the router structure accordingly. Signed-off-by: Mika Westerberg commit b5d15961d95565934109b4cc53f50c3f5caf0d80 Author: Mika Westerberg Date: Thu May 25 12:22:11 2023 +0300 thunderbolt: Prefix CL state related log messages with "CLx: " This makes it easier to spot from the logs and follows what we do with the TMU code already. We also log enabling/disabling CL states using the tb_sw_dbg() instead of tb_port_dbg(). Signed-off-by: Mika Westerberg commit cb625ec6e57195a7b6a6d0947e6203614f874d3e Author: Mika Westerberg Date: Fri May 26 13:53:35 2023 +0300 thunderbolt: Prefix TMU post time log message with "TMU: " Following what we do with other messages in this file. No functional changes. Signed-off-by: Mika Westerberg commit bdc6660e553ae74b2bf2689b69ee0b28d383c63f Author: Mika Westerberg Date: Mon Oct 10 18:52:24 2022 +0300 thunderbolt: Do not call CLx functions from TMU code There is really no need to call any of the CLx functions in the TMU code so remove all these checks. This makes the TMU enable/disable flows easier to follow as well. Signed-off-by: Mika Westerberg commit 9650de737992cad35f48e19d7004a0ad2673dae1 Author: Mika Westerberg Date: Fri Nov 18 15:26:12 2022 +0200 thunderbolt: Check for first depth router in tb.c Currently tb_switch_clx_enable() enables CL states only for the first depth router. This is something we may want to change in the future and in addition it is not visible from the calling path at all. For this reason do the check in the tb.c so it is immediately visible that we only do this for the first depth router. Fix the kernel-docs accordingly. Signed-off-by: Mika Westerberg commit 35627353063bc145ba5c2c509dfe042982e2a219 Author: Mika Westerberg Date: Mon Oct 10 13:36:56 2022 +0300 thunderbolt: Switch CL states from enum to a bitmask This is more natural and follows the hardware register layout better. This makes it easier to see which CL states we enable (even though they should be enabled together). Rename 'clx_mask' to 'clx' everywhere as this is now always bitmask. Signed-off-by: Mika Westerberg commit 1a9b6cb8b5dbd4a8425c7d774e911c0e22e4db56 Author: Mika Westerberg Date: Mon Oct 10 11:31:07 2022 +0300 thunderbolt: Move CLx enabling into tb_enable_clx() This avoids some duplication and makes the flow slightly easier to understand. Also follows what we do in tb_enable_tmu(). Signed-off-by: Mika Westerberg commit 4f9a4f25ade82463895a70096c722780deab000f Author: Mika Westerberg Date: Mon Oct 10 12:10:33 2022 +0300 thunderbolt: Get rid of __tb_switch_[en|dis]able_clx() No need to have separate functions for these so fold them into tb_switch_clx_enable() and tb_switch_clx_disable() accordingly. No functional changes. Signed-off-by: Mika Westerberg commit 12a14f2fca32332d065b64f6f654fa332c90475e Author: Mika Westerberg Date: Fri Oct 7 18:12:02 2022 +0300 thunderbolt: Move CLx support functions into clx.c There really don't belong to switch.c so move them into their own file. As we do this rename the functions to match the conventions used elsewhere in the driver. No functional changes. Signed-off-by: Mika Westerberg commit ef34add89ee4d1473bd0e78f551efa6fc1feb0cd Author: Mika Westerberg Date: Mon Oct 10 18:04:16 2022 +0300 thunderbolt: Check valid TMU configuration in tb_switch_tmu_configure() Instead of at enable time we can do this already in tb_switch_tmu_configure(). Signed-off-by: Mika Westerberg commit 4e7b4955cba13bb8b8f63400fbd28081f11179a7 Author: Mika Westerberg Date: Fri Oct 7 17:49:01 2022 +0300 thunderbolt: Move tb_enable_tmu() close to other TMU functions This makes the code easier to follow. No functional changes. Signed-off-by: Mika Westerberg commit 20c2fae9dbe35134e98679181faa611cc69c6c30 Author: Mika Westerberg Date: Fri Oct 7 16:53:58 2022 +0300 thunderbolt: Move TMU configuration to tb_enable_tmu() There is no need to duplicate the code the enables TMU. Also update the comment to better explain why we do this in the first place. No functional changes. Signed-off-by: Mika Westerberg commit 7d283f4148f184b200854acdc21308e5bfee9fc1 Author: Mika Westerberg Date: Fri Oct 7 15:40:21 2022 +0300 thunderbolt: Get rid of tb_switch_enable_tmu_1st_child() This is better to be part of the software connection manager flows in tb.c. Also name the new function tb_increase_tmu_accuracy() to match what it actually does. Signed-off-by: Mika Westerberg commit 701e73a823bb887be1aabebf1ffaba068d329550 Author: Mika Westerberg Date: Fri May 26 09:22:06 2023 +0300 thunderbolt: Rework Titan Ridge TMU objection disable function Now this is split into two with one having a misleading name (tb_switch_tmu_unidirectional_enable()). Make this easier to read, rename and consolidate the two functions into one with name that explains what it actually does. Use the two constants as well that were added but never used to make it clear which bits are being set. No functional changes. Signed-off-by: Mika Westerberg commit 826f55d50de95572661ab4508d6aa0649a60627b Author: Mika Westerberg Date: Fri Oct 7 13:19:09 2022 +0300 thunderbolt: Drop useless 'unidirectional' parameter from tb_switch_tmu_is_enabled() There is no point passing it as we already have a field for that. While there clean up the kernel-doc of things that do not really belong to the API documentation (these can be figured out from the spec itself). No functional changes. Signed-off-by: Mika Westerberg commit c437dcb18310f296eb9db58a361f309f7817014d Author: Mika Westerberg Date: Fri Oct 7 13:14:13 2022 +0300 thunderbolt: Fix a couple of style issues in TMU code Drop extra empty line and get rid of the '__' in function names. No functional changes. Signed-off-by: Mika Westerberg commit 17fb1a3df9c3059798bfd823f58407e206c31ab9 Author: Mika Westerberg Date: Fri Sep 30 11:12:42 2022 +0300 thunderbolt: Introduce tb_xdomain_downstream_port() In the same way we did for the routers add a function that returns the parent routers downstream facing port for XDomain devices. Signed-off-by: Mika Westerberg commit 7ce542219b6323764cb922722b677005404d9b60 Author: Gil Fine Date: Fri Sep 23 01:30:38 2022 +0300 thunderbolt: Introduce tb_switch_downstream_port() Introduce tb_switch_downstream_port() helper function that returns the downstream port of a parent switch that is connected to the upstream port of specified switch. From now on, we use it all across the driver where applicable. While there fix a whitespace in comment and rename 'downstream' to 'down' to be consistent with the rest of the driver. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit ef65afa0740e28cb0951fa9012cb78765f883a4a Merge: 033c2d8ab2835 9f9666e65359d Author: Mika Westerberg Date: Fri Jun 9 12:05:44 2023 +0300 Merge branch 'thunderbolt/fixes' into thunderbolt/next We need Thunderbolt/USB4 fixes here as well. Signed-off-by: Mika Westerberg commit 78841cd185aa74bc92d3ac2c63a870395caaa086 Author: Juergen Gross Date: Fri Jun 9 07:51:00 2023 +0200 x86/mm: Remove Xen-PV leftovers from init_32.c There are still some unneeded paravirt calls in arch/x86/mm/init_32.c. Remove them. Signed-off-by: Juergen Gross Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230609055100.12633-1-jgross@suse.com commit 975fd3c26fedac29f3767971918add558bae5c51 Author: Jiaxun Yang Date: Sun May 21 23:31:23 2023 +0100 MIPS: Select CONFIG_GENERIC_IDLE_POLL_SETUP hlt,nohlt paramaters are useful when debugging cpuidle related issues. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 96cb8ae28c652e7ef0633b1c0786eb0f529ed516 Author: Jiaxun Yang Date: Sun May 21 23:31:22 2023 +0100 MIPS: Rework smt cmdline parameters Provide a generic smt parameters interface aligned with s390 to allow users to limit smt usage and threads per core. It replaced previous undocumented "nothreads" parameter for smp-cps which is ambiguous and does not cover smp-mt. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit dfbd992e0ef2319b869bf69fe649d34d2dc49e4b Author: Arnd Bergmann Date: Tue May 16 21:39:43 2023 +0200 mips: asm-offsets: add missing prototypes Building with -Werror and W=1 fails entirely because of warnings in asm-offsets.c: arch/mips/kernel/asm-offsets.c:26:6: error: no previous prototype for 'output_ptreg_defines' [-Werror=missing-prototypes] arch/mips/kernel/asm-offsets.c:78:6: error: no previous prototype for 'output_task_defines' [-Werror=missing-prototypes] arch/mips/kernel/asm-offsets.c:92:6: error: no previous prototype for 'output_thread_info_defines' [-Werror=missing-prototypes] arch/mips/kernel/asm-offsets.c:108:6: error: no previous prototype for 'output_thread_defines' [-Werror=missing-prototypes] arch/mips/kernel/asm-offsets.c:136:6: error: no previous prototype for 'output_thread_fpu_defines' [-Werror=missing-prototypes] Nothing actually calls these functions, so just add prototypes to shut up the warnings. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Bogendoerfer commit 02310be6f080071e1b9e2021fd6dd655bd842aad Author: Xianwei Zhao Date: Mon May 15 17:32:37 2023 +0800 arm64: dts: add support for C3 based Amlogic AW409 Amlogic C3 is an advanced edge AI processor designed for smart IP camera applications. Add basic support for the C3 based Amlogic AW409 board, which describes the following components: CPU, GIC, IRQ, Timer, UART. It's capable of booting up into the serial console. Signed-off-by: Xianwei Zhao Link: https://lore.kernel.org/r/20230515093237.2203171-1-xianwei.zhao@amlogic.com Signed-off-by: Neil Armstrong commit d27e40b5548182df4095c801020f239f103e4307 Author: Baruch Siach Date: Mon May 29 09:38:11 2023 +0300 docs: crypto: async-tx-api: fix typo in struct name Add missing underscore. Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/2ef9dfaa33c1eff019e6fe43fe738700c2230b3d.1685342291.git.baruch@tkos.co.il Signed-off-by: Jonathan Corbet commit 35d4a3c67eb5fe786e93e06df103fc3f181eaf07 Author: Joe Stringer Date: Mon Apr 24 10:18:50 2023 -0700 docs/doc-guide: Clarify how to write tables Prior to this commit, the kernel docs writing guide spent over a page describing exactly how *not* to write tables into the kernel docs, without providing a example about the desired format. This patch provides a positive example first in the guide so that it's harder to miss, then leaves the existing less desirable approach below for contributors to follow if they have some stronger justification for why to use that approach. Signed-off-by: Joe Stringer Reviewed-by: Randy Dunlap Link: https://lore.kernel.org/r/20230424171850.3612317-1-joe@isovalent.com Signed-off-by: Jonathan Corbet commit 5487a7b60695a92cf998350e4beac17144c91fcd Author: Jiaxun Yang Date: Wed Jun 7 13:51:22 2023 +0800 MIPS: cpu-features: Use boot_cpu_type for CPU type based features Some CPU feature macros were using current_cpu_type to mark feature availability. However current_cpu_type will use smp_processor_id, which is prohibited under preemptable context. Since those features are all uniform on all CPUs in a SMP system, use boot_cpu_type instead of current_cpu_type to fix preemptable kernel. Cc: stable@vger.kernel.org Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit ece68749f86230ebf691bd7ee27eb3118140b1f1 Author: Liviu Dudau Date: Tue Jun 6 22:16:00 2023 +0100 mips: dts: ralink: Add support for TP-Link HC220 G5 v1 board This WiFi AP is based on a MT7621 SoC with 128MiB RAM, 128MiB NAND, a MT7603 2.4GHz WiFi and a MT7613 5GHz WiFi chips integrated on the board, connected to the main SoC over PCIe. The device uses NMBM over NAND, which is not currently supported in the mainline, so NAND node is skipped in this revision. Signed-off-by: Liviu Dudau Reviewed-by: Arınç ÜNAL Acked-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 0daf939e0fdfb18520db2bd545111272f14a9fa6 Author: Liviu Dudau Date: Tue Jun 6 22:15:59 2023 +0100 dt-bindings: mips: Add bindings for TP-Link HC220 G5 v1 board Add bindings for the compatible string used for the TP-Link's HC220 G5 V1 board, a wireless AP based on MT7621. Signed-off-by: Liviu Dudau Acked-by: Conor Dooley Acked-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 2dbbe4de633b262d939f40458ff2c1a16fa9fe24 Author: Paul Cercueil Date: Sun Jun 4 16:56:42 2023 +0200 MIPS: configs: CI20: Enable WiFi / Bluetooth Enable the required drivers for the WiFi / Bluetooth functionality. I enabled WEXT compatibility as well since the CI20 is typically used with a very old userspace. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit e94c1e4921395492ea2fa9d4ecf303b0db5aca69 Author: Paul Cercueil Date: Sun Jun 4 16:56:41 2023 +0200 MIPS: configs: CI20: Regenerate defconfig Just a "make ci20_defconfig menuconfig savedefconfig" Without changing anything in the menuconfig. No functional change. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit c9f4b25272843bcf6a86809915ccfb4fd7436c91 Author: Paul Cercueil Date: Sun Jun 4 16:56:40 2023 +0200 MIPS: DTS: CI20: Enable support for WiFi / Bluetooth Wire the WiFi/Bluetooth chip properly in the Device Tree. - Provide it with the correct regulators and clocks; - Change the MMC I/O bus to 1.8V which seems to be enough; - Change the MMC I/O bus frequency to 25 MHz as 50 MHz causes errors; - Fix the Bluetooth powerdown GPIO being inverted and add reset GPIO; - Convert host-wakeup-gpios to IRQ. With these changes, the WiFi works properly with the latest firmware provided by linux-firmware. The Bluetooth does not work very well here, as I cannot get my wireless keyboard to pair; but it does detect it, and it does see the key presses when I type the pairing code. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 868b70b9e6bd8d211cb846ad332c777591b68c8f Author: Paul Cercueil Date: Sun Jun 4 16:56:39 2023 +0200 MIPS: DTS: CI20: Parent MSCMUX clock to MPLL This makes it possible to clock the SD cards much higher, as the MPLL is running at 1.2 GHz by default. The previous parent was the EXT clock, which caused the SD cards to be clocked at 24 MHz maximum. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 5fe60d3b680106109fd5c8b5270ef83f076b0c65 Author: Paul Cercueil Date: Sun Jun 4 16:56:38 2023 +0200 MIPS: DTS: CI20: Misc. cleanups - Use the standard "ecc-engine" property instead of the custom "ingenic,bch-controller" to get a handle to the BCH controller. - Respect cell sizes in the Ethernet controller node. - Use proper macro for interrupt type instead of hardcoding magic values. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 34d4b67e81f9fa61a34be395b1c6ecb672fbcbd2 Author: Paul Cercueil Date: Sun Jun 4 16:56:37 2023 +0200 MIPS: DTS: CI20: Do not force-enable CIM and WiFi regulators These regulators should be enabled by their respective drivers. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit fbf1e42093f8d6346baf17079585fbcebb2ff284 Author: Paul Cercueil Date: Sun Jun 4 16:56:36 2023 +0200 MIPS: DTS: CI20: Add parent supplies to ACT8600 regulators Provide parent regulators to the ACT8600 regulators that need one. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 08384e80a70fb1942510ab5f0ce27bad134e634e Author: Paul Cercueil Date: Sun Jun 4 16:56:35 2023 +0200 MIPS: DTS: CI20: Fix ACT8600 regulator node names The Device Tree was using invalid node names for the ACT8600 regulators. To be fair, it is not the original committer's fault, as the documentation did gives invalid names as well. In theory, the fix should have been to modify the driver to accept the alternative names. However, even though the act8865 driver spits warnings, the kernel seemed to work fine with what is currently supported upstream. For that reason, I think it is okay to just update the DTS. I removed the "regulator-name" too, since they really didn't bring any information. The node names are enough. Fixes: 73f2b940474d ("MIPS: CI20: DTS: Add I2C nodes") Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit ea1ccdc605f27066d3b1d28da2d503d354387945 Author: Paul Cercueil Date: Sun Jun 4 16:56:34 2023 +0200 MIPS: DTS: CI20: Fix regulators The regulators don't have any "reg" property, and therefore shouldn't use an unit address in their node names. They also don't need to specify the GPIO_ACTIVE_LOW flag, which will be ignored anyway, as they are active-high. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 4cdb5d9d39f010ba98e93e657f36c59a3cdf8730 Author: Paul Cercueil Date: Sun Jun 4 14:26:55 2023 +0200 MIPS: DTS: qi_lb60: Don't use unit address for regulators The regulators don't have any "reg" property, and therefore shouldn't use an unit address in their node names. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit fc18139c28674688b36782fcafd6ba25c7013684 Author: Paul Cercueil Date: Sun Jun 4 14:26:54 2023 +0200 mips: ingenic: Enable EXT/2 divider on JZ4750/55/60 if EXT is 24 MHz The JZ4750, JZ4755 and JZ4760 (non-B version) support using a 24 MHz external crystal oscillator instead of the typical 12 MHz one. However, most of the SoC's IP blocks only work with a 12 MHz clock. Thanksfully, there is a /2 divider we can enable when a 24 MHz external crystal is present. Force-enable this /2 divider when the oscillator is 24 MHz, so that the SoC always uses a 12 MHz clock internally. It is done here, and not in the clocks driver, because we need the EXT clock to be 12 MHz for the early console to work, and the clocks driver probes way too late. Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 50a1171d3bd1d0edd637b9fc5e81d842c5bc55c0 Author: Paul Cercueil Date: Sun Jun 4 14:26:53 2023 +0200 mips: ingenic: Remove useless __maybe_unused These flags are useless in this case as the code referencing these data structures is always seen by the compiler (and not behind #ifdef guards). Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 6673c2763f6f999fc32cff1833c7d4d6d35f787b Author: Siarhei Volkau Date: Sun Jun 4 14:26:52 2023 +0200 MIPS: uaccess: emulate Ingenic LXW/LXH/LXHU uaccess The LXW, LXH, LXHU opcodes are part of the MXU ASE found in Ingenic XBurst based SoCs. While technically part of the MXU ASE, they do not touch any of the SIMD registers, and can be used even when the MXU ASE is disabled. This patch makes it possible to emulate unaligned access for those instructions. Signed-off-by: Siarhei Volkau Signed-off-by: Thomas Bogendoerfer commit 1e13da548fbffb807633df85a244b70caa90bdf7 Author: Maciej W. Rozycki Date: Thu Jun 1 13:56:36 2023 +0100 Revert "MIPS: unhide PATA_PLATFORM" Revert commit 75b18aac6fa3 ("MIPS: unhide PATA_PLATFORM") now that HAVE_PATA_PLATFORM is set selectively for all the relevant platforms. Verified with `db1xxx_defconfig' and `sb1250_swarm_defconfig' by making sure PATA_PLATFORM is still there in `.config' with this change applied, and with `malta_defconfig' by making sure it's now gone. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Bogendoerfer commit 70278d1d589f9feda6fdd97e66e1e1603992715d Author: Maciej W. Rozycki Date: Thu Jun 1 13:56:19 2023 +0100 MIPS: Alchemy: Enable PATA_PLATFORM support We have limited demand for platform PATA support across MIPS platforms: $ find arch/mips -type f | sort | xargs grep -l pata_platform_info arch/mips/alchemy/devboards/db1200.c arch/mips/alchemy/devboards/db1300.c arch/mips/sibyte/swarm/platform.c $ certainly not high enough to justify enabling support for PATA_PLATFORM port-wide. SiByte platforms are handled selectively already, so just make a similar arrangement for Alchemy DB1XXX platforms. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Bogendoerfer commit e71dc5bf5e01089d0fad0d85596a9ac8634969b0 Merge: 12324a8896ba8 4897a898a2160 Author: Thomas Bogendoerfer Date: Fri Jun 9 09:52:40 2023 +0200 Merge tag 'mips-fixes_6.4_1' into mips-next - fixes to get alchemy platform back in shape - fix for initrd detection commit eed892da9cd08be76a8f467c600ef58716dbb4d2 Author: Thorsten Leemhuis Date: Mon May 15 10:40:48 2023 +0200 docs: handling-regressions: rework section about fixing procedures This basically rewrites the 'Prioritize work on fixing regressions' section of Documentation/process/handling-regressions.rst for various reasons. Among them: some things were too demanding, some didn't align well with the usual workflows, and some apparently were not clear enough -- and of course a few things were missing that would be good to have in there. Linus for example recently stated that regressions introduced during the past year should be handled similarly to regressions from the current cycle, if it's a clear fix with no semantic subtlety. His exact wording[1] didn't fit well into the text structure, but the author tried to stick close to the apparent intention. It was a noble goal from the original author to state "[prevent situations that might force users to] continue running an outdated and thus potentially insecure kernel version for more than two weeks after a regression's culprit was identified"; this directly led to the goal "fix regression in mainline within one week, if the issue made it into a stable/longterm kernel", because the stable team needs time to pick up and prepare a new release. But apparently all that was a bit too demanding. That "one week" target for example doesn't align well with the usual habits of the subsystem maintainers, which normally send their fixes to Linus once a week; and it doesn't align too well with stable/longterm releases either, which often enter a -rc phase on Mondays or Tuesdays and then are released two to three days later. And asking developers to create, review, and mainline fixes within one week might be too much to ask for in general. Hence tone the general goal down to three weeks and use an approach that better aligns with the usual merging and release habits. While at it, also make the rules of thumb a bit easier to follow by grouping them by topic (e.g. generic things, timing, procedures, ...). Also add text for a few cases where recent discussions showed they need covering. Among them are multiple points that better explain the relations to stable and longterm kernels and the team that manages them; they and the group seperators are the primary reason why this whole section sadly grew somewhat in the rewrite. The group about those relations led to one addition the author came up with without any precedent from Linus: the text now tells developers to add a stable tag for any regression that made it into a proper mainline release during the past 12 months. This is meant to ensure the stable team will definitely notice any fixes for recent regressions. That includes those introduced shortly before a new mainline release and found right after it; without such a rule the stable team might miss the fix, which then would only reach users after weeks or months with later releases. Note, the aspect "Do not consider regressions from the current cycle as something that can wait till the cycle's end [...]" might look like an addition, but was kinda was in the old text as well -- but only indirectly. That apparently was too subtle, as many developers seem to assume waiting till the end of the cycle is fine (even for build fixes). In practice this was especially problematic when a cause of a regression made it into a proper release (either directly or through a backport). A revert performed by Linus shortly before the 6.3 release illustrated that[2], as the developer of the culprit had been willing to revert the culprit about three weeks earlier already -- but didn't do so when a fix came into sight and a maintainer suggested it can wait. Due to that the issue in the end plagued users of 6.2.y at least two weeks longer than necessary, as the fix in the end didn't become ready in time. This issue in fact could have been resolved one or two additional weeks earlier, if the developer had reverted the culprit shortly after it had been identified (which even the old version of the text suggest to do in such cases). [1] https://lore.kernel.org/all/CAHk-=wis_qQy4oDNynNKi5b7Qhosmxtoj1jxo5wmB6SRUwQUBQ@mail.gmail.com/ [2] https://lore.kernel.org/all/CAHk-=wgD98pmSK3ZyHk_d9kZ2bhgN6DuNZMAJaV0WTtbkf=RDw@mail.gmail.com/ CC: Linus Torvalds CC: Greg KH CC: Lukas Bulwahn Signed-off-by: Thorsten Leemhuis Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/6971680941a5b7b9cb0c2839c75b5cc4ddb2d162.1684139586.git.linux@leemhuis.info Signed-off-by: Jonathan Corbet commit 12324a8896ba8fedf27c0007af417a3948cf2c39 Author: Franziska Naepelt Date: Tue May 30 08:59:49 2023 +0200 mips: Fix spacing issue Fix some indentation issues and remove the following checkpatch issue: - ERROR: need consistent spacing around '-' (ctx:WxV) Co-Developed-by: Ladislav Michl Signed-off-by: Franziska Naepelt Signed-off-by: Thomas Bogendoerfer commit fb6700c598d8a10d35afb1365cb321695e9a94bc Author: Jiaxun Yang Date: Mon May 29 14:52:45 2023 +0100 MIPS: generic: Allow R5 CPUs to be selected Since we do have P5600 bitfile for boston board, we should allow generic kernel to be compiled for R5 CPUs. Signed-off-by: Jiaxun Yang Reviewed-by: Serge Semin Signed-off-by: Thomas Bogendoerfer commit 99b619b37ae151dc0fcdffcae48b5a5ad90ebde8 Author: Arnd Bergmann Date: Tue May 16 21:39:42 2023 +0200 mips: provide unxlate_dev_mem_ptr() in asm/io.h The unxlate_dev_mem_ptr() function has no prototype on the mips architecture, which does not include asm-generic/io.h, so gcc warns about the __weak definition: drivers/char/mem.c:94:29: error: no previous prototype for 'unxlate_dev_mem_ptr' [-Werror=missing-prototypes] Since everyone else already gets the generic definition or has a custom one, there is not really much point in having a __weak version as well. Remove this one, and instead add a trivial macro to the mips header. Once we convert mips to use the asm-generic header, this can go away again. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Bogendoerfer commit ad64639417161e90b30dda00486570eb150aeee5 Author: Jiasheng Jiang Date: Wed Jun 7 17:58:29 2023 +0800 pinctrl: npcm7xx: Add missing check for ioremap Add check for ioremap() and return the error if it fails in order to guarantee the success of ioremap(). Fixes: 3b588e43ee5c ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver") Signed-off-by: Jiasheng Jiang Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230607095829.1345-1-jiasheng@iscas.ac.cn Signed-off-by: Linus Walleij commit 73f8ce7f961afcb3be49352efeb7c26cc1c00cc4 Author: Wells Lu Date: Sun May 28 20:34:37 2023 +0800 pinctrl:sunplus: Add check for kmalloc Fix Smatch static checker warning: potential null dereference 'configs'. (kmalloc returns null) Changes in v2: 1. Add free allocated memory before returned -ENOMEM. 2. Add call of_node_put() before returned -ENOMEM. Fixes: aa74c44be19c ("pinctrl: Add driver for Sunplus SP7021") Signed-off-by: Wells Lu Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/1685277277-12209-1-git-send-email-wellslutw@gmail.com [Rebased on the patch from Lu Hongfei] Signed-off-by: Linus Walleij commit b2132afec09772f1f2f0ddbe223be41431e46924 Author: Lu Hongfei Date: Tue Jun 6 15:02:01 2023 +0800 pinctrl: nxp: Fix resource leaks in for_each_child_of_node() loops Ensure child node references are decremented properly in the error path. Signed-off-by: Lu Hongfei Link: https://lore.kernel.org/r/20230606070201.14249-1-luhongfei@vivo.com Signed-off-by: Linus Walleij commit e3275a89e5c7c4a78522357b8b677b1a79d4d011 Author: Andy Shevchenko Date: Sun Jun 4 16:12:15 2023 +0300 pinctrl: Relax user input size in pinmux_select() This is debugfs and there is no much sense to strict the user from sending as much data as they can. The memdup_user_nul() will anyway fail if there is not enough memory. Relax the user input size by removing an artificial limitaion. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230604131215.78847-2-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 0d8675e1dfa6253e92b6e42504094d42f27d3ca6 Author: Andy Shevchenko Date: Sun Jun 4 16:12:14 2023 +0300 pinctrl: Duplicate user memory in one go in pinmux_select() Current code is suboptimal in three ways: 1) it explicitly terminates the string which is not needed; 2) it might provoke additional faults, because asked lenght might be bigger than the real one; 3) it consumes more than needed lines in the source. Instead of using kmalloc() + strncpy_from_user() + terminating, just utilize memdup_user_nul(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230604131215.78847-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 5cc9525bfc8e32029d1339349d65873c42193b00 Author: Prathamesh Shete Date: Wed Jun 7 17:01:04 2023 +0530 gpio: tegra186: Check PMC driver status before any request When the PMC device is disabled, probing of the Tegra186 GPIO driver fails because the IRQ domain that is registered by the PMC driver is not found. The PMC IRQ domain is only used for wake-up and does not impact GPIO functionality in general. Therefore, if the PMC device is disabled, skip looking up the PMC IRQ domain to allow the GPIO driver to be probed. Signed-off-by: Manish Bhardwaj Signed-off-by: Prathamesh Shete Reviewed-by: Jon Hunter Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20230607113104.11761-1-pshete@nvidia.com Signed-off-by: Linus Walleij commit 6d8257ca39884a90bbb61e3441f7d578abc53bac Author: Prathamesh Shete Date: Mon Jun 5 17:42:29 2023 +0200 pinctrl: tegra: Add Tegra234 pinmux driver This change adds support for the two pin controllers found on Tegra234. Signed-off-by: Prathamesh Shete Signed-off-by: Thierry Reding Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230605154230.2910847-3-thierry.reding@gmail.com Signed-off-by: Linus Walleij commit 857982138b79640a6e51c095360977ed2a26f8a7 Author: Prathamesh Shete Date: Mon Jun 5 17:42:28 2023 +0200 dt-bindings: pinctrl: Document Tegra234 pin controllers Tegra234 contains two pin controllers. Document their compatible strings and describe the list of pins and functions that they provide. Signed-off-by: Prathamesh Shete Signed-off-by: Thierry Reding Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230605154230.2910847-2-thierry.reding@gmail.com Signed-off-by: Linus Walleij commit a46f809bf3170674da0488b0db240a244e4c4ccc Author: Krzysztof Kozlowski Date: Thu Jun 1 17:20:26 2023 +0200 pinctrl: qcom: organize audio drivers in menuconfig The audio pin controller drivers depend on PINCTRL_LPASS_LPI, but since PINCTRL_LPASS_LPI is not the first entry, they are not displayed in menuconfig as dependent of PINCTRL_LPASS_LPI. Re-order the entries to fix this. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230601152026.1182648-8-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 3476b8b1920f918affebd0d38a724a45bca1e5ff Author: Krzysztof Kozlowski Date: Thu Jun 1 17:20:25 2023 +0200 pinctrl: qcom: organize main SoC drivers in new Kconfig.msm In menuconfig, some entries depending on PINCTRL_MSM are indented and expressed as dependening but some not, because of other Kconfig entries in between, Move all main Qualcomm SoC pin controller driver entries into new Kconfig.msm file so they will be nicely ordered in Kconfig file (by CONFIG_ name) and properly indented as PINCTRL_MSM dependency in menuconfig. Functionally this is the same, but since entire file is guarded with "if PINCTRL_MSM" drop this dependency from individual entries. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230601152026.1182648-7-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 405ac045ec730d10e5901d653088b9d67bfaaa80 Author: Krzysztof Kozlowski Date: Thu Jun 1 17:20:24 2023 +0200 pinctrl: qcom: allow true compile testing Makefile selected Qualcomm pinctrl drivers only for ARCH_QCOM, making any COMPILE_TEST options inside Kconfig ((ARCH_QCOM || COMPILE_TEST) or (OF || COMPILE_TEST)) not effective. Always descent to the qcom subdirectory to fix this. All individual drivers are selected in Makefile via dedicated CONFIG entries, thus this should not have functional impact except when compile testing. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230601152026.1182648-6-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit da95f081b3fea8e6d78b31ced149cbaad183a342 Author: Krzysztof Kozlowski Date: Thu Jun 1 17:20:23 2023 +0200 pinctrl: qcom: mark true OF dependency - common MSM pinctrl code The common MSM pinctrl driver code (PINCTRL_MSM) uses pinconf_generic_dt_node_to_map_group() from GENERIC_PINCONF, which is not available for compile testing for !OF cases. Drivers actually do not depend on OF. Move the OF dependency to the entry actually depending on it and drop any "|| COMPILE_TEST", because OF is required also for compile testing (lack of OF was never visible in compile testing because none of the drivers could be compile tested due to Makefile). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230601152026.1182648-5-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit c0602eea4a9549e2a5ded641c4fe2e935194be55 Author: Krzysztof Kozlowski Date: Thu Jun 1 17:20:22 2023 +0200 pinctrl: qcom: drop unneeded GPIOLIB dependency PINCTRL_MSM depends on GPIOLIB, thus individual driver entries depending on the first do not have to depend on the latter. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230601152026.1182648-4-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit be7d0c78aa4ad9547ed7b738398cb7bb3234b7d8 Author: Krzysztof Kozlowski Date: Thu Jun 1 17:20:21 2023 +0200 pinctrl: qcom: correct language typo (Technologies) Correct typo: Tehcnologies->Technologies. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230601152026.1182648-3-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 01bceae21471bc70370fc4c76f858b1b66881e41 Author: Krzysztof Kozlowski Date: Thu Jun 1 17:20:20 2023 +0200 pinctrl: qcom: fix indentation in Kconfig Use tab for correct Kconfig indentation. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230601152026.1182648-2-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 1c4aac1739bab13a0eacb7518bf1848bfb9c13bc Author: Krzysztof Kozlowski Date: Thu Jun 1 17:20:19 2023 +0200 pinctrl: qcom: qdf2xxx: drop ACPI_PTR Driver can bind only via ACPI matching and acpi_device_id is there unconditionally, so drop useless ACPI_PTR() macro. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230601152026.1182648-1-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 725d1c8916583f9c09e5f05e5a55dd47fdca61c1 Author: Sricharan Ramabadhran Date: Thu Jun 8 17:51:48 2023 +0530 pinctrl: qcom: Add IPQ5018 pinctrl driver Add pinctrl definitions for the TLMM of IPQ5018. Reviewed-by: Bjorn Andersson Reviewed-by: Linus Walleij Co-developed-by: Nitheesh Sekar Signed-off-by: Nitheesh Sekar Co-developed-by: Varadarajan Narayanan Signed-off-by: Varadarajan Narayanan Signed-off-by: Sricharan Ramabadhran Link: https://lore.kernel.org/r/20230608122152.3930377-5-quic_srichara@quicinc.com Signed-off-by: Linus Walleij commit 75750edba5494ce613009571a5d42e659d897df9 Author: Sricharan Ramabadhran Date: Thu Jun 8 17:51:47 2023 +0530 dt-bindings: pinctrl: qcom: Add support for ipq5018 Add device tree binding Documentation details for ipq5018 pinctrl driver. Reviewed-by: Krzysztof Kozlowski Co-developed-by: Nitheesh Sekar Signed-off-by: Nitheesh Sekar Co-developed-by: Varadarajan Narayanan Signed-off-by: Varadarajan Narayanan Signed-off-by: Sricharan Ramabadhran Link: https://lore.kernel.org/r/20230608122152.3930377-4-quic_srichara@quicinc.com Signed-off-by: Linus Walleij commit 32a2e6ab2cebed4d79a4ee70ba86d5a44c841270 Author: Nishanth Menon Date: Thu Jun 1 12:38:31 2023 -0500 dt-bindings: pinctrl: Drop k3 For convenience (less code duplication), the pin controller pin configuration register values were defined in the bindings header. These are not some IDs or other abstraction layer but raw numbers used in the registers. These constants do not fit the purpose of bindings. They do not provide any abstraction, any hardware and driver independent ID. In fact, the Linux pinctrl-single driver actually do not use the bindings header at all. Commit f2de003e1426 ("dt-bindings: pinctrl: k3: Deprecate header with register constants") already moved users to the local header, so, drop the binding header. See background discussion in [1]. While at it, clean up the MAINTAINERS file which is the only reference left. [1]: https://lore.kernel.org/linux-arm-kernel/71c7feff-4189-f12f-7353-bce41a61119d@linaro.org/ Suggested-by: Krzysztof Kozlowski Signed-off-by: Nishanth Menon Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230601173831.982429-1-nm@ti.com Signed-off-by: Linus Walleij commit 9bb0a9e0626ccaaff268de12d4cde4d4c3c3c9d7 Author: AngeloGioacchino Del Regno Date: Thu Jun 1 13:08:13 2023 +0200 leds: leds-mt6323: Add support for WLEDs and MT6332 Add basic code to turn on and off WLEDs and wire up MT6332 support to take advantage of it. This is a simple approach due to the aforementioned PMIC supporting only on/off status so, at the time of writing, it is impossible for me to validate more advanced functionality due to lack of hardware. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230601110813.2373764-9-angelogioacchino.delregno@collabora.com commit 9540989ca85b91a34ecde8877f385a299c9c1ccc Author: AngeloGioacchino Del Regno Date: Thu Jun 1 13:08:12 2023 +0200 leds: leds-mt6323: Add support for MT6331 leds Add the register offsets for MT6331. The hwspec is the same as MT6323. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Pavel Machek Reviewed-by: Alexandre Mergnat Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230601110813.2373764-8-angelogioacchino.delregno@collabora.com commit ba57b9b11f78530146f02b776854b2b6b6d344a4 Merge: 959294e47953e 24335848e543d Author: Dave Airlie Date: Fri Jun 9 16:43:35 2023 +1000 Merge tag 'drm-intel-gt-next-2023-06-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-next UAPI Changes: - I915_GEM_CREATE_EXT_SET_PAT for Mesa on Meteorlake. Driver Changes: Fixes/improvements/new stuff: - Use large rings for compute contexts (Chris Wilson) - Better logging/debug of unexpected GuC communication issues (Michal Wajdeczko) - Clear out entire reports after reading if not power of 2 size (Ashutosh Dixit) - Limit lmem allocation size to succeed on SmallBars (Andrzej Hajda) - perf/OA capture robustness improvements on DG2 (Umesh Nerlige Ramappa) - Fix error code in intel_gsc_uc_heci_cmd_submit_nonpriv() (Dan Carpenter) Future platform enablement: - Add workaround 14016712196 (Tejas Upadhyay) - HuC loading for MTL (Daniele Ceraolo Spurio) - Allow user to set cache at BO creation (Fei Yang) Miscellaneous: - Use system include style for drm headers (Jani Nikula) - Drop legacy CTB definitions (Michal Wajdeczko) - Turn off the timer to sample frequencies when GT is parked (Ashutosh Dixit) - Make PMU sample array two-dimensional (Ashutosh Dixit) - Use the correct error value when kernel_context() fails (Andi Shyti) - Fix second parameter type of pre-gen8 pte_encode callbacks (Nathan Chancellor) - Fix parameter in gmch_ggtt_insert_{entries, page}() (Nathan Chancellor) - Fix size_t format specifier in gsccs_send_message() (Nathan Chancellor) - Use the fdinfo helper (Tvrtko Ursulin) - Add some missing error propagation (Tvrtko Ursulin) - Reduce I915_MAX_GT to 2 (Matt Atwood) - Rename I915_PMU_MAX_GTS to I915_PMU_MAX_GT (Matt Atwood) - Remove some obsolete definitions (John Harrison) Merges: - Merge drm/drm-next into drm-intel-gt-next (Tvrtko Ursulin) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZIH09fqe5v5yArsu@tursulin-desk commit 4c58b6d906dc99554f1767c574b68ce8e133fcbb Author: AngeloGioacchino Del Regno Date: Thu Jun 1 13:08:11 2023 +0200 leds: leds-mt6323: Open code and drop MT6323_CAL_HW_DUTY macro There is only one instance of using this macro and it's anyway not simplifying the flow, or increasing the readability of this driver. Drop this macro by open coding it in mt6323_led_set_blink(). No functional changes. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230601110813.2373764-7-angelogioacchino.delregno@collabora.com commit 9bef14141f2b912345280ba10e6e8318d0bb054b Author: AngeloGioacchino Del Regno Date: Thu Jun 1 13:08:10 2023 +0200 leds: leds-mt6323: Drop MT6323_ prefix from macros and defines This renames all definitions and macros to drop the MT6323_ prefix, since it is now possible to easily add support to more PMICs in this driver. While at it, also fix related formatting where possible. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230601110813.2373764-6-angelogioacchino.delregno@collabora.com commit 3ec0b29e596270fd02bbe1656c5005e0c38b8ce0 Author: AngeloGioacchino Del Regno Date: Thu Jun 1 13:08:09 2023 +0200 leds: leds-mt6323: Specify registers and specs in platform data In order to enhance the flexibility of this driver and let it support more than just one MediaTek LEDs IP for more than just one PMIC, add platform data structure specifying the register offsets and data that commonly varies between different IPs. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Acked-by: Pavel Machek Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230601110813.2373764-5-angelogioacchino.delregno@collabora.com commit 0642b7e8384226aedfe82f6bc8242fbf2454ec6d Author: AngeloGioacchino Del Regno Date: Thu Jun 1 13:08:07 2023 +0200 dt-bindings: leds: leds-mt6323: Document mt6332 compatible Add support for MT6332 LEDs/WLEDs with compatible "mediatek,mt6332-led". Signed-off-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Reviewed-by: Alexandre Mergnat Acked-by: Pavel Machek Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230601110813.2373764-3-angelogioacchino.delregno@collabora.com commit 020378ab90813793fc4c1ddabe0a726850cdd899 Author: AngeloGioacchino Del Regno Date: Thu Jun 1 13:08:06 2023 +0200 dt-bindings: leds: leds-mt6323: Document mt6331 compatible Add mediatek,mt6331-led compatible for the LED controller found in the MT6331 PMIC. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Reviewed-by: Alexandre Mergnat Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230601110813.2373764-2-angelogioacchino.delregno@collabora.com commit fd5f4d7da29218485153fd8b4c08da7fc130c79f Merge: 736013292e3ca 3dc8976c7ad6e Author: Jakub Kicinski Date: Thu Jun 8 19:40:32 2023 -0700 Merge branch 'splice-net-rewrite-splice-to-socket-fix-splice_f_more-and-handle-msg_splice_pages-in-af_tls' David Howells says: ==================== splice, net: Rewrite splice-to-socket, fix SPLICE_F_MORE and handle MSG_SPLICE_PAGES in AF_TLS Here are patches to do the following: (1) Block MSG_SENDPAGE_* flags from leaking into ->sendmsg() from userspace, whilst allowing splice_to_socket() to pass them in. (2) Allow MSG_SPLICE_PAGES to be passed into tls_*_sendmsg(). Until support is added, it will be ignored and a splice-driven sendmsg() will be treated like a normal sendmsg(). TCP, UDP, AF_UNIX and Chelsio-TLS already handle the flag in net-next. (3) Replace a chain of functions to splice-to-sendpage with a single function to splice via sendmsg() with MSG_SPLICE_PAGES. This allows a bunch of pages to be spliced from a pipe in a single call using a bio_vec[] and pushes the main processing loop down into the bowels of the protocol driver rather than repeatedly calling in with a page at a time. (4) Provide a ->splice_eof() op[2] that allows splice to signal to its output that the input observed a premature EOF and that the caller didn't flag SPLICE_F_MORE, thereby allowing a corked socket to be flushed. This attempts to maintain the current behaviour. It is also not called if we didn't manage to read any data and so didn't called the actor function. This needs routing though several layers to get it down to the network protocol. [!] Note that I chose not to pass in any flags - I'm not sure it's particularly useful to pass in the splice flags; I also elected not to return any error code - though we might actually want to do that. (5) Provide tls_{device,sw}_splice_eof() to flush a pending TLS record if there is one. (6) Provide splice_eof() for UDP, TCP, Chelsio-TLS and AF_KCM. AF_UNIX doesn't seem to pay attention to the MSG_MORE or MSG_SENDPAGE_NOTLAST flags. (7) Alter the behaviour of sendfile() and fix SPLICE_F_MORE/MSG_MORE signalling[1] such SPLICE_F_MORE is always signalled until we have read sufficient data to finish the request. If we get a zero-length before we've managed to splice sufficient data, we now leave the socket expecting more data and leave it to userspace to deal with it. (8) Make AF_TLS handle the MSG_SPLICE_PAGES internal sendmsg flag. MSG_SPLICE_PAGES is an internal hint that tells the protocol that it should splice the pages supplied if it can. Its sendpage implementations are then turned into wrappers around that. Link: https://lore.kernel.org/r/499791.1685485603@warthog.procyon.org.uk/ [1] Link: https://lore.kernel.org/r/CAHk-=wh=V579PDYvkpnTobCLGczbgxpMgGmmhqiTyE34Cpi5Gg@mail.gmail.com/ [2] Link: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=51c78a4d532efe9543a4df019ff405f05c6157f6 # part 1 Link: https://lore.kernel.org/r/20230524153311.3625329-1-dhowells@redhat.com/ # v1 ==================== Link: https://lore.kernel.org/r/20230607181920.2294972-1-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit 3dc8976c7ad6ec46954eb99076551e2a2c4114da Author: David Howells Date: Wed Jun 7 19:19:20 2023 +0100 tls/device: Convert tls_device_sendpage() to use MSG_SPLICE_PAGES Convert tls_device_sendpage() to use sendmsg() with MSG_SPLICE_PAGES rather than directly splicing in the pages itself. With that, the tls_iter_offset union is no longer necessary and can be replaced with an iov_iter pointer and the zc_page argument to tls_push_data() can also be removed. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells Acked-by: Jakub Kicinski cc: Chuck Lever cc: Boris Pismenny cc: John Fastabend cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 24763c9c09804db9b178f41358034144b87a937a Author: David Howells Date: Wed Jun 7 19:19:19 2023 +0100 tls/device: Support MSG_SPLICE_PAGES Make TLS's device sendmsg() support MSG_SPLICE_PAGES. This causes pages to be spliced from the source iterator if possible. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells Reviewed-by: Jakub Kicinski cc: Chuck Lever cc: Boris Pismenny cc: John Fastabend cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 45e5be844ab6b2845b6d2935b61278c5ecae7d38 Author: David Howells Date: Wed Jun 7 19:19:18 2023 +0100 tls/sw: Convert tls_sw_sendpage() to use MSG_SPLICE_PAGES Convert tls_sw_sendpage() and tls_sw_sendpage_locked() to use sendmsg() with MSG_SPLICE_PAGES rather than directly splicing in the pages itself. [!] Note that tls_sw_sendpage_locked() appears to have the wrong locking upstream. I think the caller will only hold the socket lock, but it should hold tls_ctx->tx_lock too. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells Reviewed-by: Jakub Kicinski cc: Chuck Lever cc: Boris Pismenny cc: John Fastabend cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit fe1e81d4f73b6cbaed4fcc476960d26770642842 Author: David Howells Date: Wed Jun 7 19:19:17 2023 +0100 tls/sw: Support MSG_SPLICE_PAGES Make TLS's sendmsg() support MSG_SPLICE_PAGES. This causes pages to be spliced from the source iterator if possible. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Chuck Lever cc: Boris Pismenny cc: John Fastabend cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 219d92056ba36ca9f79a72e8544874d1bf35b21d Author: David Howells Date: Wed Jun 7 19:19:16 2023 +0100 splice, net: Fix SPLICE_F_MORE signalling in splice_direct_to_actor() splice_direct_to_actor() doesn't manage SPLICE_F_MORE correctly[1] - and, as a result, it incorrectly signals/fails to signal MSG_MORE when splicing to a socket. The problem I'm seeing happens when a short splice occurs because we got a short read due to hitting the EOF on a file: as the length read (read_len) is less than the remaining size to be spliced (len), SPLICE_F_MORE (and thus MSG_MORE) is set. The issue is that, for the moment, we have no way to know *why* the short read occurred and so can't make a good decision on whether we *should* keep MSG_MORE set. MSG_SENDPAGE_NOTLAST was added to work around this, but that is also set incorrectly under some circumstances - for example if a short read fills a single pipe_buffer, but the next read would return more (seqfile can do this). This was observed with the multi_chunk_sendfile tests in the tls kselftest program. Some of those tests would hang and time out when the last chunk of file was less than the sendfile request size: build/kselftest/net/tls -r tls.12_aes_gcm.multi_chunk_sendfile This has been observed before[2] and worked around in AF_TLS[3]. Fix this by making splice_direct_to_actor() always signal SPLICE_F_MORE if we haven't yet hit the requested operation size. SPLICE_F_MORE remains signalled if the user passed it in to splice() but otherwise gets cleared when we've read sufficient data to fulfill the request. If, however, we get a premature EOF from ->splice_read(), have sent at least one byte and SPLICE_F_MORE was not set by the caller, ->splice_eof() will be invoked. Signed-off-by: David Howells cc: Linus Torvalds cc: Jens Axboe cc: Christoph Hellwig cc: Al Viro cc: Matthew Wilcox cc: Jan Kara cc: Jeff Layton cc: David Hildenbrand cc: Christian Brauner cc: Chuck Lever cc: Boris Pismenny cc: John Fastabend cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/499791.1685485603@warthog.procyon.org.uk/ [1] Link: https://lore.kernel.org/r/1591392508-14592-1-git-send-email-pooja.trivedi@stackpath.com/ [2] Link: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=d452d48b9f8b1a7f8152d33ef52cfd7fe1735b0a [3] Signed-off-by: Jakub Kicinski commit 951ace9951382a90a56e98590e0b9b651e7579b4 Author: David Howells Date: Wed Jun 7 19:19:15 2023 +0100 kcm: Use splice_eof() to flush Allow splice to undo the effects of MSG_MORE after prematurely ending a splice/sendfile due to getting an EOF condition (->splice_read() returned 0) after splice had called sendmsg() with MSG_MORE set when the user didn't set MSG_MORE. Suggested-by: Linus Torvalds Link: https://lore.kernel.org/r/CAHk-=wh=V579PDYvkpnTobCLGczbgxpMgGmmhqiTyE34Cpi5Gg@mail.gmail.com/ Signed-off-by: David Howells cc: Tom Herbert cc: Tom Herbert cc: Cong Wang cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit c289a1601abd7313ef08ec13184df385cfb4d388 Author: David Howells Date: Wed Jun 7 19:19:14 2023 +0100 chelsio/chtls: Use splice_eof() to flush Allow splice to end a Chelsio TLS record after prematurely ending a splice/sendfile due to getting an EOF condition (->splice_read() returned 0) after splice had called sendmsg() with MSG_MORE set when the user didn't set MSG_MORE. Suggested-by: Linus Torvalds Link: https://lore.kernel.org/r/CAHk-=wh=V579PDYvkpnTobCLGczbgxpMgGmmhqiTyE34Cpi5Gg@mail.gmail.com/ Signed-off-by: David Howells cc: Ayush Sawal cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 1d7e4538a5463faa0b0e26a7a7b6bd68c7dfdd78 Author: David Howells Date: Wed Jun 7 19:19:13 2023 +0100 ipv4, ipv6: Use splice_eof() to flush Allow splice to undo the effects of MSG_MORE after prematurely ending a splice/sendfile due to getting an EOF condition (->splice_read() returned 0) after splice had called sendmsg() with MSG_MORE set when the user didn't set MSG_MORE. For UDP, a pending packet will not be emitted if the socket is closed before it is flushed; with this change, it be flushed by ->splice_eof(). For TCP, it's not clear that MSG_MORE is actually effective. Suggested-by: Linus Torvalds Link: https://lore.kernel.org/r/CAHk-=wh=V579PDYvkpnTobCLGczbgxpMgGmmhqiTyE34Cpi5Gg@mail.gmail.com/ Signed-off-by: David Howells cc: Kuniyuki Iwashima cc: Willem de Bruijn cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit d4c1e80b0d1bacbbca5184f122b9893c5920c598 Author: David Howells Date: Wed Jun 7 19:19:12 2023 +0100 tls/device: Use splice_eof() to flush Allow splice to end a TLS record after prematurely ending a splice/sendfile due to getting an EOF condition (->splice_read() returned 0) after splice had called TLS with a sendmsg() with MSG_MORE set when the user didn't set MSG_MORE. Suggested-by: Linus Torvalds Link: https://lore.kernel.org/r/CAHk-=wh=V579PDYvkpnTobCLGczbgxpMgGmmhqiTyE34Cpi5Gg@mail.gmail.com/ Signed-off-by: David Howells Reviewed-by: Jakub Kicinski cc: Chuck Lever cc: Boris Pismenny cc: John Fastabend cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit df720d288dbb1793e82b6ccbfc670ec871e9def4 Author: David Howells Date: Wed Jun 7 19:19:11 2023 +0100 tls/sw: Use splice_eof() to flush Allow splice to end a TLS record after prematurely ending a splice/sendfile due to getting an EOF condition (->splice_read() returned 0) after splice had called TLS with a sendmsg() with MSG_MORE set when the user didn't set MSG_MORE. Suggested-by: Linus Torvalds Link: https://lore.kernel.org/r/CAHk-=wh=V579PDYvkpnTobCLGczbgxpMgGmmhqiTyE34Cpi5Gg@mail.gmail.com/ Signed-off-by: David Howells Reviewed-by: Jakub Kicinski cc: Chuck Lever cc: Boris Pismenny cc: John Fastabend cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 2bfc66850952b6921b2033b09729ec59eabbc81d Author: David Howells Date: Wed Jun 7 19:19:10 2023 +0100 splice, net: Add a splice_eof op to file-ops and socket-ops Add an optional method, ->splice_eof(), to allow splice to indicate the premature termination of a splice to struct file_operations and struct proto_ops. This is called if sendfile() or splice() encounters all of the following conditions inside splice_direct_to_actor(): (1) the user did not set SPLICE_F_MORE (splice only), and (2) an EOF condition occurred (->splice_read() returned 0), and (3) we haven't read enough to fulfill the request (ie. len > 0 still), and (4) we have already spliced at least one byte. A further patch will modify the behaviour of SPLICE_F_MORE to always be passed to the actor if either the user set it or we haven't yet read sufficient data to fulfill the request. Suggested-by: Linus Torvalds Link: https://lore.kernel.org/r/CAHk-=wh=V579PDYvkpnTobCLGczbgxpMgGmmhqiTyE34Cpi5Gg@mail.gmail.com/ Signed-off-by: David Howells Reviewed-by: Jakub Kicinski cc: Jens Axboe cc: Christoph Hellwig cc: Al Viro cc: Matthew Wilcox cc: Jan Kara cc: Jeff Layton cc: David Hildenbrand cc: Christian Brauner cc: Chuck Lever cc: Boris Pismenny cc: John Fastabend cc: linux-mm@kvack.org Signed-off-by: Jakub Kicinski commit 2dc334f1a63a8839b88483a3e73c0f27c9c1791c Author: David Howells Date: Wed Jun 7 19:19:09 2023 +0100 splice, net: Use sendmsg(MSG_SPLICE_PAGES) rather than ->sendpage() Replace generic_splice_sendpage() + splice_from_pipe + pipe_to_sendpage() with a net-specific handler, splice_to_socket(), that calls sendmsg() with MSG_SPLICE_PAGES set instead of calling ->sendpage(). MSG_MORE is used to indicate if the sendmsg() is expected to be followed with more data. This allows multiple pipe-buffer pages to be passed in a single call in a BVEC iterator, allowing the processing to be pushed down to a loop in the protocol driver. This helps pave the way for passing multipage folios down too. Protocols that haven't been converted to handle MSG_SPLICE_PAGES yet should just ignore it and do a normal sendmsg() for now - although that may be a bit slower as it may copy everything. Signed-off-by: David Howells Reviewed-by: Jakub Kicinski cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 81840b3b91aad06053ad2712f3da5d0448eeb0e8 Author: David Howells Date: Wed Jun 7 19:19:08 2023 +0100 tls: Allow MSG_SPLICE_PAGES but treat it as normal sendmsg Allow MSG_SPLICE_PAGES to be specified to sendmsg() but treat it as normal sendmsg for now. This means the data will just be copied until MSG_SPLICE_PAGES is handled. Signed-off-by: David Howells cc: Chuck Lever cc: Boris Pismenny cc: John Fastabend cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 4fe38acdac8a71f7cccf347a2e9902bc818ecef7 Author: David Howells Date: Wed Jun 7 19:19:07 2023 +0100 net: Block MSG_SENDPAGE_* from being passed to sendmsg() by userspace It is necessary to allow MSG_SENDPAGE_* to be passed into ->sendmsg() to allow sendmsg(MSG_SPLICE_PAGES) to replace ->sendpage(). Unblocking them in the network protocol, however, allows these flags to be passed in by userspace too[1]. Fix this by marking MSG_SENDPAGE_NOPOLICY, MSG_SENDPAGE_NOTLAST and MSG_SENDPAGE_DECRYPTED as internal flags, which causes sendmsg() to object if they are passed to sendmsg() by userspace. Network protocol ->sendmsg() implementations can then allow them through. Note that it should be possible to remove MSG_SENDPAGE_NOTLAST once sendpage is removed as a whole slew of pages will be passed in in one go by splice through sendmsg, with MSG_MORE being set if it has more data waiting in the pipe. Signed-off-by: David Howells cc: Chuck Lever cc: Boris Pismenny cc: John Fastabend cc: Jens Axboe cc: Matthew Wilcox Link: https://lore.kernel.org/r/20230526181338.03a99016@kernel.org/ [1] Signed-off-by: Jakub Kicinski commit 736013292e3ca5ec2aabb32daf72a73b1256ac57 Author: Eric Dumazet Date: Wed Jun 7 21:41:13 2023 +0000 tcp: let tcp_mtu_probe() build headless packets tcp_mtu_probe() is still copying payload from skbs in the write queue, using skb_copy_bits(), ignoring potential errors. Modern TCP stack wants to only deal with payload found in page frags, as this is a prereq for TCPDirect (host stack might not have access to the payload) Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20230607214113.1992947-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit f84ad5cffd889226e820a727211c0d0264fe7f34 Merge: 55b24334c0f2d 803ea346bd3ff Author: Jakub Kicinski Date: Thu Jun 8 19:28:20 2023 -0700 Merge tag 'mlx5-updates-2023-06-06' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2023-06-06 1) Support 4 ports VF LAG, part 2/2 2) Few extra trivial cleanup patches Shay Drory Says: ================ Support 4 ports VF LAG, part 2/2 This series continues the series[1] "Support 4 ports VF LAG, part1/2". This series adds support for 4 ports VF LAG (single FDB E-Switch). This series of patches refactoring LAG code that make assumptions about VF LAG supporting only two ports and then enable 4 ports VF LAG. Patch 1: - Fix for ib rep code Patches 2-5: - Refactors LAG layer. Patches 6-7: - Block LAG types which doesn't support 4 ports. Patch 8: - Enable 4 ports VF LAG. This series specifically allows HCAs with 4 ports to create a VF LAG with only 4 ports. It is not possible to create a VF LAG with 2 or 3 ports using HCAs that have 4 ports. Currently, the Merged E-Switch feature only supports HCAs with 2 ports. However, upcoming patches will introduce support for HCAs with 4 ports. In order to activate VF LAG a user can execute: devlink dev eswitch set pci/0000:08:00.0 mode switchdev devlink dev eswitch set pci/0000:08:00.1 mode switchdev devlink dev eswitch set pci/0000:08:00.2 mode switchdev devlink dev eswitch set pci/0000:08:00.3 mode switchdev ip link add name bond0 type bond ip link set dev bond0 type bond mode 802.3ad ip link set dev eth2 master bond0 ip link set dev eth3 master bond0 ip link set dev eth4 master bond0 ip link set dev eth5 master bond0 Where eth2, eth3, eth4 and eth5 are net-interfaces of pci/0000:08:00.0 pci/0000:08:00.1 pci/0000:08:00.2 pci/0000:08:00.3 respectively. User can verify LAG state and type via debugfs: /sys/kernel/debug/mlx5/0000\:08\:00.0/lag/state /sys/kernel/debug/mlx5/0000\:08\:00.0/lag/type [1] https://lore.kernel.org/netdev/20230601060118.154015-1-saeed@kernel.org/T/#mf1d2083780970ba277bfe721554d4925f03f36d1 ================ * tag 'mlx5-updates-2023-06-06' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: simplify condition after napi budget handling change mlx5/core: E-Switch, Allocate ECPF vport if it's an eswitch manager net/mlx5: Skip inline mode check after mlx5_eswitch_enable_locked() failure net/mlx5e: TC, refactor access to hash key net/mlx5e: Remove RX page cache leftovers net/mlx5e: Expose catastrophic steering error counters net/mlx5: Enable 4 ports VF LAG net/mlx5: LAG, block multiport eswitch LAG in case ldev have more than 2 ports net/mlx5: LAG, block multipath LAG in case ldev have more than 2 ports net/mlx5: LAG, change mlx5_shared_fdb_supported() to static net/mlx5: LAG, generalize handling of shared FDB net/mlx5: LAG, check if all eswitches are paired for shared FDB {net/RDMA}/mlx5: introduce lag_for_each_peer RDMA/mlx5: Free second uplink ib port ==================== Link: https://lore.kernel.org/r/20230607210410.88209-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 55b24334c0f2db55ca059848121939f59133bdb6 Author: Justin Chen Date: Wed Jun 7 16:14:11 2023 -0700 ethtool: ioctl: improve error checking for set_wol The netlink version of set_wol checks for not supported wolopts and avoids setting wol when the correct wolopt is already set. If we do the same with the ioctl version then we can remove these checks from the driver layer. Reviewed-by: Simon Horman Signed-off-by: Justin Chen Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/1686179653-29750-1-git-send-email-justin.chen@broadcom.com Signed-off-by: Jakub Kicinski commit 68bd67b43fe9e6f8128d1bedf698b5f13ec6a766 Merge: c8cc2ae229ff0 32fc30353f7c4 Author: Jakub Kicinski Date: Thu Jun 8 19:19:52 2023 -0700 Merge branch 'complete-lynx-mdio-device-handling' Russell King says: ==================== complete Lynx mdio device handling This series completes the mdio device lifetime handling for Lynx PCS users which do not create their own mdio device, but instead fetch it using a firmware description - namely the DPAA2 and FMAN_MEMAC drivers. In a previous patch set, lynx_pcs_create() was modified to increase the mdio device refcount, and lynx_pcs_destroy() to drop that refcount. The first two patches change these two drivers to put the reference which they hold immediately after lynx_pcs_create(), effectively handing the responsibility for maintaining the refcount to the Lynx PCS driver. A side effect of the first two patches is that lynx_get_mdio_device() is no longer used, so patch 3 removes it. Patch 4 adds a new helper - lynx_pcs_create_fwnode(), which creates a Lynx PCS instance from the fwnode. Patch 5 and 6 convert the two drivers to make use of this new helper, which simply has to find the mdio device, and then create the Lynx PCS from that. With those conversions done, lynx_pcs_create() is no longer required outside pcs-lynx.c, so remove it from public view. Patch 8 we changes lynx_pcs_create() to return an error-pointer rather than NULL to bring consistency to the return style, and means that we can remove the NULL-to-error-pointer conversion from both lynx_pcs_create_fwnode() and lynx_pcs_create_mdiodev(). Patch 9 adds a check for the fwnode being available, and returns an -ENODEV error pointer if unavailable. Patch 10 removes this check from DPAA2, detecting the error pointer value to continue printing the helpful message. Patch 11 removes this check from fman_memac, and in doing so fixes a bug where if the node is unavailable, the reference count is not dropped. ==================== Link: https://lore.kernel.org/r/ZIBwuw+IuGQo5yV8@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 32fc30353f7c4d5370acf6ef8fb3be9363dce3c2 Author: Russell King (Oracle) Date: Wed Jun 7 12:59:04 2023 +0100 net: fman_memac: use pcs-lynx's check for fwnode availability Use pcs-lynx's check rather than our own when determining if the device is available. This fixes a bug where the reference gained by of_parse_phandle() is not dropped if the device is not available. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 8c1d0b339d675366ad02fe8c571cdeed0dd28435 Author: Russell King (Oracle) Date: Wed Jun 7 12:58:59 2023 +0100 net: dpaa2: use pcs-lynx's check for fwnode availability Use pcs-lynx's check rather than our own when determining if the device is available. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit d143898c6d7b7f9b171ddc76cd9a3d8356bfddd5 Author: Russell King (Oracle) Date: Wed Jun 7 12:58:54 2023 +0100 net: pcs: lynx: check that the fwnode is available prior to use Check that the fwnode is marked as available prior to trying to lookup the PCS device, and return -ENODEV if unavailable. Document the return codes from lynx_pcs_create_fwnode(). Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 05b606b8845213092b50a855ecf7211caa7c82fa Author: Russell King (Oracle) Date: Wed Jun 7 12:58:49 2023 +0100 net: pcs: lynx: change lynx_pcs_create() to return error-pointers Change lynx_pcs_create() to return an error-pointer on failure to allocate memory, rather than returning NULL. This allows the removal of the conversion in lynx_pcs_create_fwnode() and lynx_pcs_create_mdiodev(). Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 84e476b876d9164af4b965c97eee90fa88204b63 Author: Russell King (Oracle) Date: Wed Jun 7 12:58:44 2023 +0100 net: pcs: lynx: make lynx_pcs_create() static We no longer need to export lynx_pcs_create() for drivers to use as we now have all the functionality we need in the two new creation helpers. Remove the export and prototype, and make it static. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 929a629c211f1e6a4be1b941efab595fe6bfaa69 Author: Russell King (Oracle) Date: Wed Jun 7 12:58:39 2023 +0100 net: fman_memac: use lynx_pcs_create_fwnode() Use lynx_pcs_create_fwnode() to create a lynx PCS from a fwnode handle. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 595fa7634d71be88689f61456f38b4dc252366b4 Author: Russell King (Oracle) Date: Wed Jun 7 12:58:34 2023 +0100 net: dpaa2-mac: use lynx_pcs_create_fwnode() Use lynx_pcs_create_fwnode() to create a lynx PCS from a fwnode handle. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 6e1a12821d34ee37b1196872eccc7dc9b5218a87 Author: Russell King (Oracle) Date: Wed Jun 7 12:58:29 2023 +0100 net: pcs: lynx: add lynx_pcs_create_fwnode() Add a helper to create a lynx PCS from a fwnode handle. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit b3b984dc0ba60ce4787f661d8fc7f44e8953b51d Author: Russell King (Oracle) Date: Wed Jun 7 12:58:24 2023 +0100 net: pcs: lynx: remove lynx_get_mdio_device() lynx_get_mdio_device() is no longer necessary, let's remove it so the lynx PCS code is always managing the lifetime of the mdiodev. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit d7b6ea1a14e454ae480274a68daed9136409376f Author: Russell King (Oracle) Date: Wed Jun 7 12:58:18 2023 +0100 net: fman_memac: allow lynx PCS to handle mdiodev lifetime Put the mdiodev after lynx_pcs_create() so that the Lynx PCS driver can manage the lifetime of the mdiodev its using. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 6c79a9c8b1f3eb00b336fc2557fc5e1a5c15bd20 Author: Russell King (Oracle) Date: Wed Jun 7 12:58:13 2023 +0100 net: dpaa2-mac: allow lynx PCS to manage mdiodev lifetime Put the mdiodev after lynx_pcs_create() so that the Lynx PCS driver can manage the lifetime of the mdiodev its using. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit c8cc2ae229ff0aa9b7e67fd38f5d73bece111e71 Author: Jiaxun Yang Date: Wed Jun 7 13:59:53 2023 +0800 net: pch_gbe: Allow build on MIPS_GENERIC kernel MIPS Boston board, which is using MIPS_GENERIC kernel is using EG20T PCH and thus need this driver. Dependency of PCH_GBE, PTP_1588_CLOCK_PCH is also fixed for MIPS_GENERIC. Note that CONFIG_PCH_GBE is selected in arch/mips/configs/generic/ board-boston.config for a while, some how it's never wired up in Kconfig. Signed-off-by: Jiaxun Yang Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230607055953.34110-1-jiaxun.yang@flygoat.com Signed-off-by: Jakub Kicinski commit 37ff78e977f1a4676354a6c6ebbbf293e540abc1 Author: Ido Schimmel Date: Wed Jun 7 14:19:26 2023 +0200 mlxsw: spectrum_nve_vxlan: Fix unsupported flag regression The recently added 'VXLAN_F_LOCALBYPASS' flag is set by default on VXLAN devices and denotes a behavior that is irrelevant for the hardware data path. Add it to the lists of IPv4 and IPv6 supported flags to avoid rejecting offload of VXLAN devices which have this flag set. Fixes: 69474a8a5837 ("net: vxlan: Add nolocalbypass option to vxlan.") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/5533e63643bf719bbe286fef60f749c9cad35005.1686139716.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 959294e47953eafd1ddbeee362827f4a8aa07377 Merge: 45365b6588b39 619a06dba6fa3 Author: Dave Airlie Date: Fri Jun 9 11:46:10 2023 +1000 Merge tag 'drm-intel-next-2023-06-05' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 features for v6.5: Features and functionality: - Meteorlake (MTL) display enabling (Mika, Radhakrishna, José, Ankit, Clint, Gustavo, Imre, Anusha, Juha-Pekka, Matt) - Allow VRR to be toggled during fastsets (Ville) - Allow arbitrary refresh rates with VRR eDP panels (Ville) - Support async flips on linear buffers on display ver 12+ (Arun) - New debugfs for display clock frequencies (Bhanuprakash) - Taint kernel when force probing unsupported devices (Jani) - Expose CRTC CTM property on ILK/SNB/VLV (Ville) DRM subsystem changes: - EDID changes to support further conversion to struct drm_edid (Jani) - Move i915 DSC parameter code to common DRM helpers (Dmitry Baryshkov) Refactoring and cleanups: - CSC color refactoring (Ville) - VRR cleanups (Ville) - Finish i915 conversion to struct drm_edid (Jani) - Start high level display driver file (Jani) - Hotplug refactoring (Ville) - Misc display refactoring and cleanups (Jani, Ville) - Use device based logging for state checker warnings (Jani) - Split out hotplug and display irq handling (Jani) - Move display device info and probe under display/ (Matt) - HDCP cleanups (Suraj) - Use localized warning ignores instead of per file (Jani) - Remove superfluous enum i915_drm_suspend_mode (Maarten) - PSR, pfit, scaler and chicken register definition cleanups (Ville) - Constify pointers to hwmon_channel_info (Krzysztof Kozlowski) - Replace all non-returning strlcpy with strscpy (Azeem Shaikh) - Refactor VBT aux channel and DDC pin mapping (Ville) - Include cleanups (Jani) Fixes: - Fix modeset locking issue in DP MST HDCP (Suraj) - Fix disconnected Type-C/DP-alt disable at probe (Imre) - Fix HDMI PCON DSC usage and color conversions (Ankit) - Fix g4x HDMI infoframe/audio transmission port usage (Ville) - Avoid use-after-free when DP connector init fails (Maarten) - Fix voltage level for 480 MHz CDCLK (Chaitanya) - Check HPD live state during eDP probe (Ville) - Fix active port PLL selection for secondary MST streams (Imre) - Check pipe source size when using SKL+ scalers (Ville) - Fix MIPI DSI sleep sequences (Hans de Goede) - Fix DPCD register write order to match 128b/132b requirement (Arun) - Increase AUX timeout for Type-C (Suraj) - Communicate display power demands to pcode (Stan) - Fix potential division by zero in DSC compute config (Nikita Zhandarovich) - Fix fast wake AUX sync length (Jouni) - Fix potential oops on intel_get_crtc_new_encoder() (Ville) Merges: - drm-next backmerges (Rodrigo, Jani) Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87zg5eat32.fsf@intel.com commit 45365b6588b3910c1699d818d0bf3e4c514258c8 Merge: 7f4f4adb9ba1d 13cdd12a9f934 Author: Dave Airlie Date: Fri Jun 9 11:42:02 2023 +1000 Merge tag 'drm-misc-next-2023-06-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v6.5: UAPI Changes: Cross-subsystem Changes: Core Changes: Driver Changes: * bridge * imx: Fix module linking * tc358762: Support reset GPIO * meson * Add support for MIPI DSI displays; plus fixes and DT bindings * panel * Add Support for Rocktech RK043FN48H; plus DT bindings * Add support for Starry himax83102-j02; plus DT bindings * Add support for Starry ili9882t; plus DT bindings * virtio * Support sync-object UAPI Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230607085644.GA12673@linux-uq9g commit 326cc42f9fdc3030676e949d5cea3ccc923fd1de Author: Maxime Ripard Date: Fri May 5 13:26:10 2023 +0200 clk: Forbid to register a mux without determine_rate The determine_rate hook allows to select the proper parent and its rate for a given clock configuration. On another hand, set_parent is there to change the parent of a mux. Some clocks provide a set_parent hook but don't implement determine_rate. In such a case, set_parent is pretty much useless since the clock framework will always assume the current parent is to be used, and we will thus never change it. This situation can be solved in two ways: - either we don't need to change the parent, and we thus shouldn't implement set_parent; - or we don't want to change the parent, in this case we should set CLK_SET_RATE_NO_REPARENT; - or we're missing a determine_rate implementation. The latter is probably just an oversight from the driver's author, and we should thus raise their awareness about the fact that the current state of the driver is confusing. All the drivers in-tree have been converted by now, so let's prevent any clock with set_parent but without determine_rate to register so that it can't sneak in again in the future. Cc: Abel Vesa Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Alexandre Torgue Cc: "Andreas Färber" Cc: AngeloGioacchino Del Regno Cc: Baolin Wang Cc: Charles Keepax Cc: Chen-Yu Tsai Cc: Chen-Yu Tsai Cc: Chunyan Zhang Cc: Claudiu Beznea Cc: Daniel Vetter Cc: David Airlie Cc: David Lechner Cc: Dinh Nguyen Cc: Fabio Estevam Cc: Geert Uytterhoeven Cc: Jaroslav Kysela Cc: Jernej Skrabec Cc: Jonathan Hunter Cc: Kishon Vijay Abraham I Cc: Liam Girdwood Cc: Linus Walleij Cc: Luca Ceresoli Cc: Manivannan Sadhasivam Cc: Mark Brown Cc: Markus Schneider-Pargmann Cc: Max Filippov Cc: Maxime Coquelin Cc: Mikko Perttunen Cc: Miles Chen Cc: Nicolas Ferre Cc: Orson Zhai Cc: Paul Cercueil Cc: Peng Fan Cc: Peter De Schrijver Cc: Prashant Gaikwad Cc: Richard Fitzgerald Cc: Samuel Holland Cc: Sascha Hauer Cc: Sekhar Nori Cc: Shawn Guo Cc: Takashi Iwai Cc: Thierry Reding Cc: Ulf Hansson Cc: Vinod Koul Cc: dri-devel@lists.freedesktop.org Cc: linux-actions@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mips@vger.kernel.org Cc: linux-phy@lists.infradead.org Cc: linux-renesas-soc@vger.kernel.org Cc: linux-rtc@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-sunxi@lists.linux.dev Cc: linux-tegra@vger.kernel.org Cc: NXP Linux Team Cc: patches@opensource.cirrus.com Cc: Pengutronix Kernel Team Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-68-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 2b6c9b0eee89379fda238d543c5acf098a2ac5a5 Author: Maxime Ripard Date: Fri May 5 13:26:09 2023 +0200 ASoC: tlv320aic32x4: div: Switch to determine_rate The tlv320aic32x4 divider clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Jaroslav Kysela Cc: Liam Girdwood Cc: Mark Brown Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-67-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 25d43ec352eaefbfaee0912d02b6f10ea606931f Author: Maxime Ripard Date: Fri May 5 13:26:08 2023 +0200 ASoC: tlv320aic32x4: pll: Switch to determine_rate The tlv320aic32x4 PLL clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Jaroslav Kysela Cc: Liam Girdwood Cc: Mark Brown Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-66-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 493ffb046cf5ad10abafa34b9797dda2340937bb Author: Maxime Ripard Date: Fri May 5 13:26:07 2023 +0200 clk: tegra: super: Switch to determine_rate The Tegra super clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Jonathan Hunter Cc: Peter De Schrijver Cc: Prashant Gaikwad Cc: Thierry Reding Cc: linux-tegra@vger.kernel.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-65-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 4d78bd80cef7b6a46bb5390b10abb3692fac1c48 Author: Maxime Ripard Date: Fri May 5 13:26:06 2023 +0200 clk: tegra: periph: Switch to determine_rate The Tegra periph clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Jonathan Hunter Cc: Peter De Schrijver Cc: Prashant Gaikwad Cc: Thierry Reding Cc: linux-tegra@vger.kernel.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-64-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 06ed0fc0fbacee513d84a142a58d5f5cf154c6ff Author: Maxime Ripard Date: Fri May 5 13:26:05 2023 +0200 clk: stm32: composite: Switch to determine_rate The STM32 composite clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: linux-arm-kernel@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-63-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 36f8a30c0f229e6b74cded8b352a9298ea545151 Author: Maxime Ripard Date: Fri May 5 13:26:04 2023 +0200 clk: st: flexgen: Switch to determine_rate The ST Flexgen clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-62-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 302d2f836d78bb6e977054c8ef91ca0d1a902263 Author: Maxime Ripard Date: Fri May 5 13:26:03 2023 +0200 clk: sprd: composite: Switch to determine_rate The Spreadtrum composite clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Baolin Wang Cc: Chunyan Zhang Cc: Orson Zhai Acked-by: Chunyan Zhang Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-61-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 65c1f037b4921dcab187574466f5199bd5c9d71f Author: Maxime Ripard Date: Fri May 5 13:26:02 2023 +0200 clk: ingenic: tcu: Switch to determine_rate The Ingenic TCU clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Paul Cercueil Cc: linux-mips@vger.kernel.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-60-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit fa0dadde058404bca3ba2269bf6163f0147b50a6 Author: Maxime Ripard Date: Fri May 5 13:26:01 2023 +0200 clk: ingenic: cgu: Switch to determine_rate The Ingenic CGU clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Paul Cercueil Cc: linux-mips@vger.kernel.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-59-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 15d3f365abff5823998ea4976ee0cbce12047637 Author: Maxime Ripard Date: Fri May 5 13:26:00 2023 +0200 clk: imx: scu: Switch to determine_rate The iMX SCU clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. The round_rate() implementation being shared with other clocks, it's not removed. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Abel Vesa Cc: Fabio Estevam Cc: Peng Fan Cc: Sascha Hauer Cc: Shawn Guo Cc: linux-arm-kernel@lists.infradead.org Cc: NXP Linux Team Cc: Pengutronix Kernel Team Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-58-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 785e4a29a657ed7948ccc979ca8a09aa26328251 Author: Maxime Ripard Date: Fri May 5 13:25:59 2023 +0200 clk: da8xx: clk48: Switch to determine_rate The TI DA8xx USB0 clk48 clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: David Lechner Cc: Sekhar Nori Acked-by: David Lechner Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-57-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit c8bfcfcb969104370367be7b3cf33477a912f8ee Author: Maxime Ripard Date: Fri May 5 13:25:58 2023 +0200 clk: si5351: clkout: Switch to determine_rate The SI5351 clkout clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-56-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 4ab2bf813e248eb7dd2269cadd493b25497241b5 Author: Maxime Ripard Date: Fri May 5 13:25:57 2023 +0200 clk: si5351: msynth: Switch to determine_rate The SI5351 msynth clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-55-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 08add3c1d80d3325fb3d826e14a1382d63e13e7c Author: Maxime Ripard Date: Fri May 5 13:25:56 2023 +0200 clk: si5351: pll: Switch to determine_rate The SI5351 PLL clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-54-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 61c34af50c5f219bdeb990026b1b560d8d8eb67c Author: Maxime Ripard Date: Fri May 5 13:25:55 2023 +0200 clk: si5341: Switch to determine_rate The SI5341 output clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-53-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 924418cb851f7107930c4fd61b377f39e5286503 Author: Maxime Ripard Date: Fri May 5 13:25:54 2023 +0200 clk: cdce706: clkout: Switch to determine_rate The cdce706 clkout clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Max Filippov Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-52-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 81fdf73ac7dd4ff12a078a2511a7222d72aec8f8 Author: Maxime Ripard Date: Fri May 5 13:25:53 2023 +0200 clk: cdce706: divider: Switch to determine_rate The cdce706 divider clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Max Filippov Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-51-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 6222b494a961cf48b01e2e2b2500629e82908a60 Author: Maxime Ripard Date: Fri May 5 13:25:52 2023 +0200 clk: axi-clkgen: Switch to determine_rate The AXI clkgen clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-50-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 6a25bd4d1d00baaf32a0da76631db47adeea7b56 Author: Maxime Ripard Date: Fri May 5 13:25:51 2023 +0200 clk: at91: smd: Switch to determine_rate The Atmel SAM9x5 SMD clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: Alexandre Belloni Cc: Claudiu Beznea Cc: Nicolas Ferre Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-49-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 939b61f67ec306981a85b94d17ba07a5996f5a14 Author: Maxime Ripard Date: Fri May 5 13:25:50 2023 +0200 clk: actions: composite: fact: Switch to determine_rate The Actions composite factor clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: "Andreas Färber" Cc: Manivannan Sadhasivam Cc: linux-actions@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-48-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 4407740621ef0d70611a0cb2463240f97dd238cb Author: Maxime Ripard Date: Fri May 5 13:25:49 2023 +0200 clk: actions: composite: div: Switch to determine_rate The Actions composite divider clocks implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The driver does implement round_rate() though, which means that we can change the rate of the clock, but we will never get to change the parent. However, It's hard to tell whether it's been done on purpose or not. Since we'll start mandating a determine_rate() implementation, let's convert the round_rate() implementation to a determine_rate(), which will also make the current behavior explicit. And if it was an oversight, the clock behaviour can be adjusted later on. Cc: "Andreas Färber" Cc: Manivannan Sadhasivam Cc: linux-actions@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-47-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 218b95bac6bec1d5d2ea4625528ba82b81b5f0fa Author: Maxime Ripard Date: Fri May 5 13:25:48 2023 +0200 ASoC: tlv320aic32x4: Add a determine_rate hook The tlv320aic32x4 clkin clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Jaroslav Kysela Cc: Liam Girdwood Cc: Mark Brown Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-46-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit bd0a601fcb7d43bb5745293c2aaf8a1343a20baf Author: Maxime Ripard Date: Fri May 5 13:25:47 2023 +0200 rtc: sun6i: Add a determine_rate hook The Allwinner sun6i RTC clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Samuel Holland Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rtc@vger.kernel.org Cc: linux-sunxi@lists.linux.dev Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-45-971d5077e7d2@cerno.tech Acked-by: Jernej Skrabec Signed-off-by: Stephen Boyd commit 2230aa250ca97a1f51f9f17a776e300d87b33b99 Author: Maxime Ripard Date: Fri May 5 13:25:46 2023 +0200 phy: ti: j721e-wiz: Add a determine_rate hook The TI J721e Wiz clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the flag CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook to __clk_mux_determine_rate(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Since the CLK_SET_RATE_NO_REPARENT flag was already set though, it seems unlikely. Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: linux-phy@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-44-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 36c1dfea91fb0bf00072c0019d6bfb0c139a7b27 Author: Maxime Ripard Date: Fri May 5 13:25:45 2023 +0200 phy: ti: am654-serdes: Add a determine_rate hook The TI AM654 SerDes clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the flag CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook to __clk_mux_determine_rate(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Since the CLK_SET_RATE_NO_REPARENT flag was already set though, it seems unlikely. Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: linux-phy@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-43-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 7aee650eedaba1808b3132d1e176c74aea888f8a Author: Maxime Ripard Date: Fri May 5 13:25:44 2023 +0200 phy: cadence: torrent: Add a determine_rate hook The Cadence Torrent refclk clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the flag CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook to __clk_mux_determine_rate(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Since the CLK_SET_RATE_NO_REPARENT flag was already set though, it seems unlikely. Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: linux-phy@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-42-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 1ca48301a820dcab547351f1ef018c01821f7964 Author: Maxime Ripard Date: Fri May 5 13:25:43 2023 +0200 phy: cadence: sierra: Add a determine_rate hook The Cadence Sierra PLL clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the flag CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook to __clk_mux_determine_rate(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Since the CLK_SET_RATE_NO_REPARENT flag was already set though, it seems unlikely. Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: linux-phy@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-41-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 3867497d64cec53195e9de2db1118af4610fb9fe Author: Maxime Ripard Date: Fri May 5 13:25:42 2023 +0200 drm/tegra: sor: Add a determine_rate hook The Tegra sor pad clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Daniel Vetter Cc: David Airlie Cc: Jonathan Hunter Cc: Mikko Perttunen Cc: Thierry Reding Cc: dri-devel@lists.freedesktop.org Cc: linux-tegra@vger.kernel.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-40-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit d5a5a6e4d129f5b1167e8497155ada63b8c865b2 Author: Maxime Ripard Date: Fri May 5 13:25:41 2023 +0200 clk: versatile: sp810: Add a determine_rate hook The Versatile sp810 "timerclken" clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. This mismatch is probably due to the fact that the driver introduction predates the determine_rate introduction, and it was never revised since then. The default, implicit, behaviour that has been in use so far has thus been to simply keep using the current parent in all cases. This is also the behaviour of the new clk_hw_determine_rate_no_reparent() helper, so we can simply use it to make our expectation explicit. Cc: Linus Walleij Cc: Pawel Moll Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-39-971d5077e7d2@cerno.tech Acked-by: Linus Walleij Acked-by: Pawel Moll Signed-off-by: Stephen Boyd commit b7f0dee221e641a1e9c1640a2bed184a74875e62 Author: Maxime Ripard Date: Fri May 5 13:25:40 2023 +0200 clk: ux500: sysctrl: Add a determine_rate hook The UX500 sysctrl "set_parent" clocks implement a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Ulf Hansson Cc: linux-arm-kernel@lists.infradead.org Acked-by: Linus Walleij Reviewed-by: Ulf Hansson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-38-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 97eb8f8a95fac869f3ffc75cda0308ab07780f4f Author: Maxime Ripard Date: Fri May 5 13:25:39 2023 +0200 clk: ux500: prcmu: Add a determine_rate hook The UX500 PRCMU "clkout" clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The PRCMU binding also allows to specify the default clock parent through a device tree cell. This will be enforced at prepare time by the driver. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. The result is that the driver relies on prepare to set the default parent, and thus the set_parent hook is effectively unused by design. We can make that decision explicit by setting the determine_rate implementation to clk_hw_determine_rate_no_reparent() that will keep the same behaviour. Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. Cc: Ulf Hansson Cc: linux-arm-kernel@lists.infradead.org Acked-by: Linus Walleij Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-37-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit b11fcfa884da5b884584c6b85d697548c81511b8 Author: Maxime Ripard Date: Fri May 5 13:25:38 2023 +0200 clk: tegra: periph: Add a determine_rate hook The Tegra periph nodiv clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. However, the upstream device trees seem to use assigned-clock-parents on that clock to force the parent at boot time, so it's likely that the author intent was to force the parent through the device tree and prevent any reparenting but through an explicit call to clk_set_parent(). This case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. Cc: Jonathan Hunter Cc: Peter De Schrijver Cc: Prashant Gaikwad Cc: Thierry Reding Cc: linux-tegra@vger.kernel.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-36-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 78b435c8db6c84f512ddcb247f6f206ce96ae82b Author: Maxime Ripard Date: Fri May 5 13:25:37 2023 +0200 clk: tegra: super: Add a determine_rate hook The Tegra super mux clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. However, the upstream device trees seem to use assigned-clock-parents on that clock to force the parent at boot time, so it's likely that the author intent was to force the parent through the device tree and prevent any reparenting but through an explicit call to clk_set_parent(). This case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. Cc: Jonathan Hunter Cc: Peter De Schrijver Cc: Prashant Gaikwad Cc: Thierry Reding Cc: linux-tegra@vger.kernel.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-35-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 4552a852f207957ae71831042d56749cd9ac485d Author: Maxime Ripard Date: Fri May 5 13:25:36 2023 +0200 clk: tegra: bpmp: Add a determine_rate hook The Tegra BPMP mux clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. However, the upstream device trees seem to use assigned-clock-parents on that clock to force the parent at boot time, so it's likely that the author intent was to force the parent through the device tree and prevent any reparenting but through an explicit call to clk_set_parent(). This case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. Cc: Jonathan Hunter Cc: Peter De Schrijver Cc: Prashant Gaikwad Cc: Thierry Reding Cc: linux-tegra@vger.kernel.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-34-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit d052f0671f769bc542f326fa29edc131a7afba28 Author: Maxime Ripard Date: Fri May 5 13:25:35 2023 +0200 clk: stm32: core: Add a determine_rate hook The STM32 mux clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the flag CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook to __clk_mux_determine_rate(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Since the CLK_SET_RATE_NO_REPARENT flag was already set though, it seems unlikely. Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: linux-arm-kernel@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-33-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 9607beb917df80ce70e8d46b733eae25f7ba582a Author: Maxime Ripard Date: Fri May 5 13:25:34 2023 +0200 clk: socfpga: gate: Add a determine_rate hook The SoCFGPA gate clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Dinh Nguyen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-32-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 03b56aa9bfb2bf2b1eb8cb95cde4cb2b52a1e65b Author: Maxime Ripard Date: Fri May 5 13:25:33 2023 +0200 clk: renesas: r9a06g032: Add a determine_rate hook The Renesas r9a06g032 bitselect clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Geert Uytterhoeven Cc: linux-renesas-soc@vger.kernel.org Reviewed-by: Geert Uytterhoeven Reviewed-by: Miquel Raynal Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-31-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit e9b6ea4eb6989bd32b55f97014b0da835eaf8e38 Author: Maxime Ripard Date: Fri May 5 13:25:32 2023 +0200 clk: pxa: Add a determine_rate hook The PXA "CKEN" clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-30-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 90fe6ebf729000ba9d5bdfc53597bd7d99d34e43 Author: Maxime Ripard Date: Fri May 5 13:25:31 2023 +0200 clk: mediatek: cpumux: Add a determine_rate hook The Mediatek cpumux clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: AngeloGioacchino Del Regno Cc: Matthias Brugger Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-29-971d5077e7d2@cerno.tech Reviewed-by: Chen-Yu Tsai Signed-off-by: Stephen Boyd commit 1c2c20dbb5d79bfe6bb30ec5b2b04ef724ba3059 Author: Maxime Ripard Date: Fri May 5 13:25:30 2023 +0200 clk: imx: scu: Add a determine_rate hook The iMX SCU mux clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Abel Vesa Cc: Fabio Estevam Cc: Peng Fan Cc: Sascha Hauer Cc: Shawn Guo Cc: linux-arm-kernel@lists.infradead.org Cc: NXP Linux Team Cc: Pengutronix Kernel Team Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-28-971d5077e7d2@cerno.tech | Reported-by: kernel test robot : Signed-off-by: Stephen Boyd commit b2252ca68c173846191b2ad91631214e9e27ee4a Author: Maxime Ripard Date: Fri May 5 13:25:29 2023 +0200 clk: imx: fixup-mux: Add a determine_rate hook The iMX fixup mux clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. However, the upstream device trees seem to use assigned-clock-parents on that clock to force the parent at boot time, so it's likely that the author intent was to force the parent through the device tree and prevent any reparenting but through an explicit call to clk_set_parent(). This case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. Cc: Abel Vesa Cc: Fabio Estevam Cc: Peng Fan Cc: Sascha Hauer Cc: Shawn Guo Cc: linux-arm-kernel@lists.infradead.org Cc: NXP Linux Team Cc: Pengutronix Kernel Team Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-27-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 79ef35a9443588e782a8da9bd96a2af47c10a226 Author: Maxime Ripard Date: Fri May 5 13:25:28 2023 +0200 clk: imx: busy: Add a determine_rate hook The iMX busy clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Abel Vesa Cc: Fabio Estevam Cc: Peng Fan Cc: Sascha Hauer Cc: Shawn Guo Cc: linux-arm-kernel@lists.infradead.org Cc: NXP Linux Team Cc: Pengutronix Kernel Team Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-26-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 4d8aa2a3aa485c056ad488608c08a55201482127 Author: Maxime Ripard Date: Fri May 5 13:25:27 2023 +0200 clk: davinci: da8xx-cfgchip: Add a determine_rate hook The Davinci DA8xxx cfgchip "clk48" clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: David Lechner Cc: Sekhar Nori Acked-by: David Lechner Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-25-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit de9271f24efc30db84ff514387bba897274291b2 Author: Maxime Ripard Date: Fri May 5 13:25:26 2023 +0200 clk: davinci: da8xx-cfgchip: Add a determine_rate hook The Davinci DA8xxx cfgchip mux clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. However, the upstream device trees seem to use assigned-clock-parents on that clock to force the parent at boot time, so it's likely that the author intent was to force the parent through the device tree and prevent any reparenting but through an explicit call to clk_set_parent(). This case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. Cc: David Lechner Cc: Sekhar Nori Acked-by: David Lechner Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-24-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit fa2a1931e48a87ef1376df95ee84a13fcf2acc59 Author: Maxime Ripard Date: Fri May 5 13:25:25 2023 +0200 clk: wm831x: clkout: Add a determine_rate hook The WM381x "clkout" clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: patches@opensource.cirrus.com Acked-by: Charles Keepax Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-23-971d5077e7d2@cerno.tech | Reported-by: kernel test robot : Signed-off-by: Stephen Boyd commit 538e864f8edde646ab6c454c382b2ba4ee2870e2 Author: Maxime Ripard Date: Fri May 5 13:25:24 2023 +0200 clk: vc5: clkout: Add a determine_rate hook The Versaclock5 "clkout" clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Luca Ceresoli Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-22-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit dcba8da50b05f36437ff5ee8e37a32bdecb4de8a Author: Maxime Ripard Date: Fri May 5 13:25:23 2023 +0200 clk: vc5: mux: Add a determine_rate hook The Versaclock5 mux clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Luca Ceresoli Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-21-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 5ce89dcc68071899070ba0c381b3eec2d09b2d5d Author: Maxime Ripard Date: Fri May 5 13:25:22 2023 +0200 clk: stm32f4: mux: Add a determine_rate hook The STM32F4 mux clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. However, the upstream device trees seem to use assigned-clock-parents on that clock to force the parent at boot time, so it's likely that the author intent was to force the parent through the device tree and prevent any reparenting but through an explicit call to clk_set_parent(). This case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: linux-arm-kernel@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-20-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 67110f5af1f838e2a6eb8a51e250913123e9f66f Author: Maxime Ripard Date: Fri May 5 13:25:21 2023 +0200 clk: si5341: Add a determine_rate hook The SI5341 clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-19-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 4cbe64280cb0501ad357c489ca5e7dfaef9a122d Author: Maxime Ripard Date: Fri May 5 13:25:20 2023 +0200 clk: qoriq: Add a determine_rate hook The Qoriq mux clocks implement a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-18-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 4e382f196a4e49944b37ad322e0456c163177b2b Author: Maxime Ripard Date: Fri May 5 13:25:19 2023 +0200 clk: lochnagar: Add a determine_rate hook The lochnagar clocks implement a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Since there's no upstream device tree using that driver, it's a bit hard to tell if it uses the assigned-clock properties. The binding and its example uses them though, so it's likely that the author intent was to force the parent through the device tree and prevent any reparenting but through an explicit call to clk_set_parent(). This case is equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. Cc: Charles Keepax Cc: Richard Fitzgerald Cc: patches@opensource.cirrus.com Tested-by: Charles Keepax Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-17-971d5077e7d2@cerno.tech | Reported-by: kernel test robot : | Reported-by: kernel test robot : Signed-off-by: Stephen Boyd commit 38bdfb21edc183ef973d6d2bcdb5aef20b83db61 Author: Maxime Ripard Date: Fri May 5 13:25:18 2023 +0200 clk: lmk04832: clkout: Add a determine_rate hook The LKM04832 "CLKOUT" clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidate to trigger that parent change is a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the flag CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook to __clk_mux_determine_rate(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Since the CLK_SET_RATE_NO_REPARENT flag was already set though, it seems unlikely. Reviewed-by: Liam Beguin Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-16-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit f6a01564fc8090ba6f8db2082427055cb3496124 Author: Maxime Ripard Date: Fri May 5 13:25:17 2023 +0200 clk: k210: mux: Add a determine_rate hook The K210 mux clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-15-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit d0f775d0367ac5d96ed4fb32fae492994fee52d4 Author: Maxime Ripard Date: Fri May 5 13:25:16 2023 +0200 clk: k210: aclk: Add a determine_rate hook The K210 ACLK clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-14-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 8e3f15601cf3b54f5bed8bf6c881adc48afeefcd Author: Maxime Ripard Date: Fri May 5 13:25:15 2023 +0200 clk: k210: pll: Add a determine_rate hook The K210 PLL clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-13-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 43e8f067db1373dbc0c2a6079cb18f9fc29d35ec Author: Maxime Ripard Date: Fri May 5 13:25:14 2023 +0200 clk: cdce706: Add a determine_rate hook The cdce706 "clkin" clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Max Filippov Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-12-971d5077e7d2@cerno.tech | Reported-by: kernel test robot : Signed-off-by: Stephen Boyd commit 321437f33e6409e0303a4e894bca6fddf66f3a90 Author: Maxime Ripard Date: Fri May 5 13:25:13 2023 +0200 clk: berlin: div: Add a determine_rate hook The Berlin2 divider clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-11-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit d2e88be3085a0fda143e9c944cc4555889ccd57e Author: Maxime Ripard Date: Fri May 5 13:25:12 2023 +0200 clk: at91: sckc: Add a determine_rate hook The SAM9x5 slow clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Alexandre Belloni Cc: Claudiu Beznea Cc: Nicolas Ferre Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-10-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 63ec565301b582275374607945e70a2ae9060a79 Author: Maxime Ripard Date: Fri May 5 13:25:11 2023 +0200 clk: at91: main: Add a determine_rate hook The SAM9x5 main clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties on that clock. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: Alexandre Belloni Cc: Claudiu Beznea Cc: Nicolas Ferre Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-9-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 3876e2d77e9abdb18b14cf881b650e074f448963 Author: Maxime Ripard Date: Fri May 5 13:25:10 2023 +0200 clk: actions: composite: Add a determine_rate hook for pass clk The Actions "Pass" clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is a bit odd, since set_parent() is there to, as its name implies, change the parent of a clock. However, the most likely candidates to trigger that parent change are either the assigned-clock-parents device tree property or a call to clk_set_rate(), with determine_rate() figuring out which parent is the best suited for a given rate. The other trigger would be a call to clk_set_parent(), but it's far less used, and it doesn't look like there's any obvious user for that clock. Similarly, it doesn't look like the device tree using that clock driver uses any of the assigned-clock properties. So, the set_parent hook is effectively unused, possibly because of an oversight. However, it could also be an explicit decision by the original author to avoid any reparenting but through an explicit call to clk_set_parent(). The latter case would be equivalent to setting the determine_rate implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no determine_rate implementation is provided, clk_round_rate() (through clk_core_round_rate_nolock()) will call itself on the parent if CLK_SET_RATE_PARENT is set, and will not change the clock rate otherwise. And if it was an oversight, then we are at least explicit about our behavior now and it can be further refined down the line. Cc: "Andreas Färber" Cc: Manivannan Sadhasivam Cc: linux-actions@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-8-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit aebddfe2dfaf1100cfdeb56783384868786bca05 Author: Maxime Ripard Date: Fri May 5 13:25:09 2023 +0200 clk: test: Add a determine_rate hook The single parent clock in our kunit tests implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. This is not entirely unexpected, since its whole purpose it to have a single parent. When determine_rate is missing, and since CLK_SET_RATE_PARENT is set for all its instances, the default behaviour of the framework will be to forward it to the current parent. This is totally fine as far as the tests are concerned, but we'll start to mandate a determine_rate implementation when set_parent is set, so let's fill it with __clk_mux_determine_rate() which will have the same behavior. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-7-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 9e3943afb2f671b0abc0aa1b381001e5e45fe976 Author: Maxime Ripard Date: Fri May 5 13:25:08 2023 +0200 clk: nodrv: Add a determine_rate hook The nodrv clock implements a mux with a set_parent hook, but doesn't provide a determine_rate implementation. Even though it's a mock clock and the missing function is harmless, we'll start to require a determine_rate implementation when set_parent is set, so let's fill it. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-6-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit e2533dad2f683976166d365aaeec65af7841a2de Author: Maxime Ripard Date: Fri May 5 13:25:07 2023 +0200 clk: lan966x: Remove unused round_rate hook The lan966x driver registers a gck clock with both a determine_rate and a round_rate implementation. Both are equivalent, and are only called by clk_core_determine_round_nolock() which favors determine_rate. Thus, lan966x_gck_round_rate() is never called, so we can just remove it. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-5-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit 33b70fbc4f815f0acb327fa506c988ef25cd943d Author: Stephen Boyd Date: Fri May 5 13:25:06 2023 +0200 clk: Introduce clk_hw_determine_rate_no_reparent() Some clock drivers do not want to allow any reparenting on a given clock, but usually do so by not providing any determine_rate implementation. Whenever we call clk_round_rate() or clk_set_rate(), this leads to clk_core_can_round() returning false and thus the rest of the function either forwarding the rate request to its current parent if CLK_SET_RATE_PARENT is set, or just returning the current clock rate. This behaviour happens implicitly, and as we move forward to making a determine_rate implementation required for muxes, we need some way to explicitly opt-in for that behaviour. Fortunately, this is exactly what the clk_core_determine_rate_no_reparent() function is doing, so we can simply make it available to drivers. Cc: Abel Vesa Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Alexandre Torgue Cc: "Andreas Färber" Cc: AngeloGioacchino Del Regno Cc: Baolin Wang Cc: Charles Keepax Cc: Chen-Yu Tsai Cc: Chen-Yu Tsai Cc: Chunyan Zhang Cc: Claudiu Beznea Cc: Daniel Vetter Cc: David Airlie Cc: David Lechner Cc: Dinh Nguyen Cc: Fabio Estevam Cc: Geert Uytterhoeven Cc: Jaroslav Kysela Cc: Jernej Skrabec Cc: Jonathan Hunter Cc: Kishon Vijay Abraham I Cc: Liam Girdwood Cc: Linus Walleij Cc: Luca Ceresoli Cc: Manivannan Sadhasivam Cc: Mark Brown Cc: Markus Schneider-Pargmann Cc: Max Filippov Cc: Maxime Coquelin Cc: Mikko Perttunen Cc: Miles Chen Cc: Nicolas Ferre Cc: Orson Zhai Cc: Paul Cercueil Cc: Peng Fan Cc: Peter De Schrijver Cc: Prashant Gaikwad Cc: Richard Fitzgerald Cc: Samuel Holland Cc: Sascha Hauer Cc: Sekhar Nori Cc: Shawn Guo Cc: Takashi Iwai Cc: Thierry Reding Cc: Ulf Hansson Cc: Vinod Koul Cc: dri-devel@lists.freedesktop.org Cc: linux-actions@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mips@vger.kernel.org Cc: linux-phy@lists.infradead.org Cc: linux-renesas-soc@vger.kernel.org Cc: linux-rtc@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-sunxi@lists.linux.dev Cc: linux-tegra@vger.kernel.org Cc: NXP Linux Team Cc: patches@opensource.cirrus.com Cc: Pengutronix Kernel Team Signed-off-by: Stephen Boyd Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-4-971d5077e7d2@cerno.tech | Reported-by: kernel test robot : commit 7f4f4adb9ba1d9b292e4b3ade0235be2e5ad5da7 Merge: c9b685df2d213 e6f49e96bc57d Author: Dave Airlie Date: Fri Jun 9 11:30:37 2023 +1000 Merge tag 'drm-habanalabs-next-2023-06-08' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux into drm-next This tag contains additional habanalabs driver changes for v6.5: - uAPI changes: - Return 0 when user queries if there was a h/w or f/w error and no such error happened. Previously we returned an error in such case. - New features and improvements: - Add pci health check when we lose connection with the firmware. This can be used to distinguish between pci link down and firmware getting stuck. - Add more info to the error print when TPC interrupt occur. - Reduce amount of code under mutex in the command submission of signal event. - Firmware related fixes: - Fixes to the handshake protocol during f/w initialization. - Display information that the f/w sends us when encountering a DMA error. - Do soft-reset using a message sent to firmware instead of writing to MMIO. - Prepare generic code to extract f/w version numbers. - Bug fixes and code cleanups. Notable fixes are: - Unsecure certain TPC registers that the user should access. - Fix handling of QMAN errors - Fix memory leak when recording errors (to later pass them to the user) - Multiple fixes to razwi interrupt handling code Signed-off-by: Dave Airlie From: Oded Gabbay Link: https://patchwork.freedesktop.org/patch/msgid/20230608103043.GA2699019@ogabbay-vm-u20.habana-labs.com commit c9b685df2d2138aa31399b0d146ba095a91c7846 Merge: 2e1492835e439 11696c5e89245 Author: Dave Airlie Date: Fri Jun 9 11:16:54 2023 +1000 Merge tag 'drm-next-20230529' of git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux into drm-next Renesas DRM/KMS drivers: - Group drivers in renesas subdirectory to prepare for new platform - Drop deprecated R-Car H3 ES1.x support Signed-off-by: Dave Airlie From: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20230602111504.GA24855@pendragon.ideasonboard.com commit 1b4e99fda73fd030635f378ee059257f6ad0f780 Author: Stephen Boyd Date: Fri May 5 13:25:05 2023 +0200 clk: Move no reparent case into a separate function We'll need to turn the code in clk_mux_determine_rate_flags() to deal with CLK_SET_RATE_NO_REPARENT into a helper clock drivers will be able to use if they don't want to allow reparenting. Cc: Abel Vesa Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Alexandre Torgue Cc: "Andreas Färber" Cc: AngeloGioacchino Del Regno Cc: Baolin Wang Cc: Charles Keepax Cc: Chen-Yu Tsai Cc: Chen-Yu Tsai Cc: Chunyan Zhang Cc: Claudiu Beznea Cc: Daniel Vetter Cc: David Airlie Cc: David Lechner Cc: Dinh Nguyen Cc: Fabio Estevam Cc: Geert Uytterhoeven Cc: Jaroslav Kysela Cc: Jernej Skrabec Cc: Jonathan Hunter Cc: Kishon Vijay Abraham I Cc: Liam Girdwood Cc: Linus Walleij Cc: Luca Ceresoli Cc: Manivannan Sadhasivam Cc: Mark Brown Cc: Markus Schneider-Pargmann Cc: Max Filippov Cc: Maxime Coquelin Cc: Mikko Perttunen Cc: Miles Chen Cc: Nicolas Ferre Cc: Orson Zhai Cc: Paul Cercueil Cc: Peng Fan Cc: Peter De Schrijver Cc: Prashant Gaikwad Cc: Richard Fitzgerald Cc: Samuel Holland Cc: Sascha Hauer Cc: Sekhar Nori Cc: Shawn Guo Cc: Takashi Iwai Cc: Thierry Reding Cc: Ulf Hansson Cc: Vinod Koul Cc: dri-devel@lists.freedesktop.org Cc: linux-actions@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mips@vger.kernel.org Cc: linux-phy@lists.infradead.org Cc: linux-renesas-soc@vger.kernel.org Cc: linux-rtc@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-sunxi@lists.linux.dev Cc: linux-tegra@vger.kernel.org Cc: NXP Linux Team Cc: patches@opensource.cirrus.com Cc: Pengutronix Kernel Team Signed-off-by: Stephen Boyd Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-3-971d5077e7d2@cerno.tech commit 9633b4c17b734de8308461182facc931042824b7 Author: Maxime Ripard Date: Fri May 5 13:25:04 2023 +0200 clk: test: Fix type sign of rounded rate variables clk_round_rate() may return a negative error code, but most of the variables we defined to store its returned value are unsigned. This obviously leads to issues on error. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-2-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit ed046ac74da0b5602566073023a1519b5ae657b7 Author: Maxime Ripard Date: Fri May 5 13:25:03 2023 +0200 clk: Export clk_hw_forward_rate_request() Commit 262ca38f4b6e ("clk: Stop forwarding clk_rate_requests to the parent") introduced the public clk_hw_forward_rate_request() function, but didn't export the symbol. Make sure it's the case. Fixes: 262ca38f4b6e ("clk: Stop forwarding clk_rate_requests to the parent") Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-1-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd commit f73b836edfef23054c227712bbdb9d4c23e00440 Merge: ac9a78681b921 d1c20885d3b01 Author: Stephen Boyd Date: Thu Jun 8 17:40:12 2023 -0700 Merge tag 'renesas-clk-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas Pull Renesas clk driver updates from Geert Uytterhoeven: - Add PWM clock on Renesas R-Car V3U - Fix PLL5 on Renesas RZ/G2L and RZ/V2L * tag 'renesas-clk-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: rzg2l: Fix CPG_SIPLL5_CLK1 register write clk: renesas: r8a779a0: Add PWM clock commit 893911e657365d49b23fc8a32a3184be036878e2 Author: Marek Vasut Date: Sun May 14 21:19:59 2023 +0200 clk: vc7: Use device_get_match_data() instead of of_device_get_match_data() Use device_get_match_data() which, unlike of_device_get_match_data(), is compatible with other firmware interfaces than just OF. Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230514191959.706269-2-marek.vasut+renesas@mailbox.org Reviewed-by: Geert Uytterhoeven Signed-off-by: Stephen Boyd commit d3d1c5e9fda089fa0094285096686d64eeea8f78 Author: Marek Vasut Date: Sun May 14 21:19:58 2023 +0200 clk: vc5: Use device_get_match_data() instead of of_device_get_match_data() Use device_get_match_data() which, unlike of_device_get_match_data(), is compatible with other firmware interfaces than just OF. Reviewed-by: Luca Ceresoli Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230514191959.706269-1-marek.vasut+renesas@mailbox.org Reviewed-by: Geert Uytterhoeven Signed-off-by: Stephen Boyd commit 752a63b8dbe6cc6900efd1035bea427a778a4b55 Author: Rafał Miłecki Date: Fri Jun 2 15:59:25 2023 +0200 ARM: dts: BCM5301X: Add Netgear R8000 WiFi regulator mappings This allows setting FullMAC firmware regulatory domain. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20230602135925.14143-3-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 156d2a64e0176863cb2b0df1f014cda1ab0393d2 Author: Rafał Miłecki Date: Fri Jun 2 15:59:24 2023 +0200 dt-bindings: net: wireless: brcm,bcm4329-fmac: allow generic properties Include ieee80211.yaml to allow using generic 802.11 properties for bindings of Broadcom FullMAC devices. That allows specifying frequencies ranges. Signed-off-by: Rafał Miłecki Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230602135925.14143-2-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 3efb0f179e7f935bcba61f8a71292b12332da9c8 Author: Rafał Miłecki Date: Fri Jun 2 15:59:23 2023 +0200 dt-bindings: net: wireless: brcm,bcm4329-fmac: add BCM4366 binding It's an 802.11ac chipset that can be found hardwired in a lot of Northstar based routers. Signed-off-by: Rafał Miłecki Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230602135925.14143-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 8648aeb5d7b70e13264ff5f444f22081d37d4670 Author: Caleb Connolly Date: Fri May 26 22:44:15 2023 +0100 power: supply: add Qualcomm PMI8998 SMB2 Charger driver Add a driver for the SMB2 charger block found in the Qualcomm PMI8998 and PM660. This driver is capable of utilising Qualcomm's Automatic Power Source Detection (APSD) BC1.2 implementation, as well as Automatic Input Current Limiting (AICL) to configure the maximum input current limit of DCP (wall) chargers. Quick Charge is not currently supported. Most devices using the smb2 charger have a secondary dedicated charger chip which is used in parallel to enable faster charger without overheating. However, not all do, as a result to ensure safety until these are supported, the maximum current is limited to ~1A via the FAST_CHARGE_CURRENT_CFG register. Signed-off-by: Caleb Connolly Tested-by: Joel Selvaraj Signed-off-by: Sebastian Reichel commit 4a6598c49ab91837c218d640f95547edf0903434 Author: Caleb Connolly Date: Fri May 26 22:44:14 2023 +0100 dt-bindings: power: supply: qcom,pmi8998-charger: add bindings for smb2 driver Add devicetree bindings for the Qualcomm PMI8998/PM660 SMB2 charger driver. Signed-off-by: Caleb Connolly Reviewed-by: Conor Dooley Signed-off-by: Sebastian Reichel commit fb9c384625dd604e8a5be1f42b35e83104b90670 Author: Uwe Kleine-König Date: Mon Jun 5 13:20:25 2023 +0200 bus: fsl-mc: fsl-mc-allocator: Drop a write-only variable Fixes a clang compiler warning: drivers/bus/fsl-mc/fsl-mc-allocator.c:565:6: warning: variable 'free_count' set but not used [-Wunused-but-set-variable] int free_count = 0; Fixes: d8e026a44919 ("staging: fsl-mc: remove some superfluous WARN_ONs") Reported-by: kernel test robot Signed-off-by: Uwe Kleine-König Reviewed-by: Nathan Chancellor Signed-off-by: Li Yang commit e0d43ed6389733c518619ec5b0ad2052352e40a4 Author: Uwe Kleine-König Date: Mon Jun 5 13:20:24 2023 +0200 bus: fsl-mc: fsl-mc-allocator: Initialize mc_bus_dev before use Fixes a clang compiler warning: >> drivers/bus/fsl-mc/fsl-mc-allocator.c:108:12: warning: variable 'mc_bus_dev' is uninitialized when used here [-Wuninitialized] dev_err(&mc_bus_dev->dev, "resource mismatch\n"); Fixes: b3134039c5b3 ("bus: fsl-mc: fsl-mc-allocator: Improve error reporting") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306021936.OktTcMAT-lkp@intel.com/ Signed-off-by: Uwe Kleine-König Reviewed-by: Nathan Chancellor Signed-off-by: Li Yang commit 28898e260a34e840f86ca80bf0c7657d76ad3f80 Author: Luis Chamberlain Date: Sun May 28 13:54:20 2023 -0700 sysctl: move security keys sysctl registration to its own file The security keys sysctls are already declared on its own file, just move the sysctl registration to its own file to help avoid merge conflicts on sysctls.c, and help with clearing up sysctl.c further. This creates a small penalty of 23 bytes: ./scripts/bloat-o-meter vmlinux.1 vmlinux.2 add/remove: 2/0 grow/shrink: 0/1 up/down: 49/-26 (23) Function old new delta init_security_keys_sysctls - 33 +33 __pfx_init_security_keys_sysctls - 16 +16 sysctl_init_bases 85 59 -26 Total: Before=21256937, After=21256960, chg +0.00% But soon we'll be saving tons of bytes anyway, as we modify the sysctl registrations to use ARRAY_SIZE and so we get rid of all the empty array elements so let's just clean this up now. Reviewed-by: Paul Moore Acked-by: Jarkko Sakkinen Acked-by: David Howells Signed-off-by: Luis Chamberlain commit 861dc0b46432a7086bc6de526aae775b4d615e28 Author: Luis Chamberlain Date: Sun May 28 13:43:46 2023 -0700 sysctl: move umh sysctl registration to its own file Move the umh sysctl registration to its own file, the array is already there. We do this to remove the clutter out of kernel/sysctl.c to avoid merge conflicts. This also lets the sysctls not be built at all now when CONFIG_SYSCTL is not enabled. This has a small penalty of 23 bytes but soon we'll be removing all the empty entries on sysctl arrays so just do this cleanup now: ./scripts/bloat-o-meter vmlinux.base vmlinux.1 add/remove: 2/0 grow/shrink: 0/1 up/down: 49/-26 (23) Function old new delta init_umh_sysctls - 33 +33 __pfx_init_umh_sysctls - 16 +16 sysctl_init_bases 111 85 -26 Total: Before=21256914, After=21256937, chg +0.00% Acked-by: Jarkko Sakkinen Signed-off-by: Luis Chamberlain commit fd274b733bfdde3ca72f0fa2a37f032f3a8c402c Author: Christian Lamparter Date: Thu Jun 8 17:36:29 2023 +0200 ARM: dts: BCM5301X: fix duplex-full => full-duplex this typo was found by the dtbs_check | ports:port@5:fixed-link: 'oneOf' conditional failed, | {'speed': [[1000]], 'duplex-full': True} is not of type 'array' | 'duplex-full' does not match any of the regexes: 'pinctrl-[0-]..." this should have been full-duplex; Fixes: 935327a73553 ("ARM: dts: BCM5301X: Add DT for Meraki MR26") Fixes: ec88a9c344d9 ("ARM: BCM5301X: Add DT for Meraki MR32") Signed-off-by: Christian Lamparter Link: https://lore.kernel.org/r/50522f45566951a9eabd22820647924cc6b4a264.1686238550.git.chunkeey@gmail.com Signed-off-by: Florian Fainelli commit d68b2f7d7d06872450d4f39d84d5926d7e7ae88c Author: Christian Lamparter Date: Thu Jun 8 17:36:28 2023 +0200 ARM: dts: BCM5301X: MR32: remove partition index numbers removes the partition indexes in the node names under. This brings the device tree source in line with others. Signed-off-by: Christian Lamparter Link: https://lore.kernel.org/r/627f57d568030a56499361790524b4d4f3381619.1686238550.git.chunkeey@gmail.com Signed-off-by: Florian Fainelli commit a6a1a156f5debaebf9f61850d111b966e9be9ee9 Author: Christian Lamparter Date: Thu Jun 8 17:36:27 2023 +0200 ARM: dts: BCM5301X: MR26: MR32: remove bogus nand-ecc-algo property | bcm53015-meraki-mr26.dtb: nand-controller@18028000: | nand@0:nand-ecc-algo:0: 'hw' is not one of ['hamming', 'bch', 'rs'] | From schema: Documentation/[...]/nand-controller.yaml | bcm53016-meraki-mr32.dtb: nand-controller@18028000: | nand@0:nand-ecc-algo:0: 'hw' is not one of ['hamming', 'bch', 'rs'] | From schema: Documentation/[...]/nand-controller.yaml original ECC values for these old Merakis are sadly not provided by the vendor. It looks like Meraki just stuck with what Broadcom's SDK was doing... which left this up to the proprietary nand driver. Note: The invalid setting was and is handled by brcmnand. It falls back to "bch" in brcmnand_setup_dev() when ecc.algo is set to NAND_ECC_ALGO_UNKNOWN (since "hw" is not in the list above). A correct nand-ecc-algo = "bch"; is already specified in the included "bcm5301x-nand-cs0-bch8.dtsi". So this line can be dropped. Reported-by: Rafał Miłecki (per Mail) Fixes: 935327a73553 ("ARM: dts: BCM5301X: Add DT for Meraki MR26") Fixes: ec88a9c344d9 ("ARM: BCM5301X: Add DT for Meraki MR32") Signed-off-by: Christian Lamparter Link: https://lore.kernel.org/r/2c4d00dd40124c2ddc0b139cbce7531b108f9052.1686238550.git.chunkeey@gmail.com Signed-off-by: Florian Fainelli commit 7121458ec0e140feb95e9e65a9a4971cbd063c00 Author: Stanislav Jakubek Date: Sat May 27 16:12:22 2023 +0200 dt-bindings: power: reset: bcm21664-resetmgr: convert to YAML Convert Broadcom Kona family reset manager bindings to DT schema. Signed-off-by: Stanislav Jakubek Reviewed-by: Conor Dooley Acked-by: Krzysztof Kozlowski Acked-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230527141222.GA5048@standask-GA-A55M-S2HP Signed-off-by: Florian Fainelli commit 9ad7f375e9dc7efdb8d9803cd01a78fbe70968b3 Author: Stanislav Jakubek Date: Fri May 26 21:30:30 2023 +0200 ARM: dts: bcm21664-garnet: use node labels Use node labels instead of nodename@address for BCM21664 Garnet to simplify its DTS file. Signed-off-by: Stanislav Jakubek Link: https://lore.kernel.org/r/e9f1ac2e9aa0ef7e880b1c152cbd56ff6b151955.1685127525.git.stano.jakubek@gmail.com Signed-off-by: Florian Fainelli commit f13e52ae0f1071c34e9cc24f9c0b0218f95f8aad Author: Stanislav Jakubek Date: Fri May 26 21:30:08 2023 +0200 ARM: dts: bcm11351/21664: add UART, I2C node labels Add node labels to serial (UART) and I2C nodes for BCM11351 and BCM21664. Signed-off-by: Stanislav Jakubek Link: https://lore.kernel.org/r/4c8bb3a725dad9048665d39d0ca728b52152e59e.1685127525.git.stano.jakubek@gmail.com Signed-off-by: Florian Fainelli commit 517025689e1b79e0a476c1dbf91a4e9637d235a8 Author: Stanislav Jakubek Date: Fri May 26 21:29:47 2023 +0200 ARM: dts: bcm-mobile: move status properties to the end of nodes Move some DT "status" properties so that they're the last specified property (before sub-nodes). Signed-off-by: Stanislav Jakubek Link: https://lore.kernel.org/r/d7060071cb1f4b36b06b6507a09b32c7751ca7f0.1685127525.git.stano.jakubek@gmail.com Signed-off-by: Florian Fainelli commit 2e167b34c0b5e7fba5ee531fa190be427adc1aa5 Author: Stanislav Jakubek Date: Fri May 26 21:29:21 2023 +0200 ARM: dts: bcm21664/23550: use CCU compatibles directly BCM21664 and BCM23550 DTs for some reason use constants from a header file for their CCU node compatibles. Change these to use the strings directly. Signed-off-by: Stanislav Jakubek Link: https://lore.kernel.org/r/65c54bd4076d646623d2a2f518631435522dc628.1685127525.git.stano.jakubek@gmail.com Signed-off-by: Florian Fainelli commit 9038af901654a9e31e3bcbc4ebcec5d109b87059 Author: Stanislav Jakubek Date: Fri May 26 21:28:45 2023 +0200 ARM: dts: bcm-mobile: change "" includes to <> where applicable While at it, also sort the includes alphabetically. Signed-off-by: Stanislav Jakubek Link: https://lore.kernel.org/r/04aa10d644eb183f6c0c5b944e527e36d56e2110.1685127525.git.stano.jakubek@gmail.com Signed-off-by: Florian Fainelli commit ba4aebce23b2affb810b8a60eae853674d2cded2 Author: Rafał Miłecki Date: Mon Jun 5 15:21:09 2023 +0200 ARM: dts: BCM5301X: Describe switch ports in the main DTS All Northstar SoCs have BCM5301x switches (BCM53011, BCM53012) with 8 ports (0-8 without 6). By design 3 switch ports (5, 7 and 8) are hardwired to 3 on-SoC Ethernet interfaces. Switch port 8 requires forcing link state. It seems that global Northstar .dtsi file is the best place to describe those hw details. Only device specific bits (like labels) should go to device .dts files. This seems to fit well with a tiny exception of Asus RT-AC88U which somehow was designed to have switch 5 connected to an extra switch. This case was simply handled with a /delete-property/. Signed-off-by: Rafał Miłecki Reviewed-by: Christian Lamparter (MR32+MR26) Link: https://lore.kernel.org/r/20230605132109.7933-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit c5fb66a17a4362a8990e0d3d050c1c5a415dfc7e Merge: 6833b8f2e1994 48989c0b25ca6 Author: Will Deacon Date: Thu Jun 8 22:27:26 2023 +0100 Merge branch 'for-joerg/arm-smmu/bindings' into for-joerg/arm-smmu/updates Updates to the Arm SMMU device-tree bindings. * for-joerg/arm-smmu/bindings: dt-bindings: arm-smmu: Add SDX75 SMMU compatible dt-bindings: arm-smmu: Add SM6375 GPU SMMU dt-bindings: iommu: arm,smmu: enable clocks for sa8775p Adreno SMMU dt-bindings: arm-smmu: Fix SC8280XP Adreno binding commit 392c108bce6e405be56c38e6ac35d5c73f5fc439 Merge: 449f6bc17a51e fff8660b5425b Author: Jakub Kicinski Date: Thu Jun 8 14:01:12 2023 -0700 Merge branch 'tools-ynl-generate-code-for-the-devlink-family' Jakub Kicinski says: ==================== tools: ynl: generate code for the devlink family Another chunk of changes to support more capabilities in the YNL code gen. Devlink brings in deep nesting and directional messages (requests and responses have different IDs). We need a healthy dose of codegen changes to support those (I wasn't planning to support code gen for "directional" families initially, but the importance of devlink and ethtool is undeniable). ==================== Link: https://lore.kernel.org/r/20230607202403.1089925-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit fff8660b5425bb2f441d67758926df62e61a69aa Author: Jakub Kicinski Date: Wed Jun 7 13:24:03 2023 -0700 tools: ynl: add sample for devlink Add a sample to show off how to issue basic devlink requests. For added testing issue get requests while walking a dump. $ ./devlink netdevsim/netdevsim1: driver: netdevsim running fw: fw.mgmt: 10.20.30 ... netdevsim/netdevsim2: driver: netdevsim running fw: fw.mgmt: 10.20.30 ... Signed-off-by: Jakub Kicinski commit 5d1a30eb989afb22b60e7d3985984ebcb00bf598 Author: Jakub Kicinski Date: Wed Jun 7 13:24:02 2023 -0700 tools: ynl: generate code for the devlink family Admittedly the devlink.yaml spec is fairly limitted, it only covers basic device get and info-get ops. That's sufficient to be useful (monitoring FW versions in the fleet). Plus it gives us a chance to exercise deep nesting and directional messaging in YNL. Signed-off-by: Jakub Kicinski commit 0a9471219672c63b4729f4011a77e017becf8607 Author: Jakub Kicinski Date: Wed Jun 7 13:24:01 2023 -0700 tools: ynl-gen: don't generate forward declarations for policies - regen Renegerate code after dropping forward declarations for policies. Signed-off-by: Jakub Kicinski commit 168dea20ecef59f9e513a8b869da4841775cc49d Author: Jakub Kicinski Date: Wed Jun 7 13:24:00 2023 -0700 tools: ynl-gen: don't generate forward declarations for policies Now that all nested types have structs and are sorted topologically there should be no need to generate forward declarations for policies. Signed-off-by: Jakub Kicinski commit eae7af21bdb9022bfea7ee96fb4fa6c39bf02f32 Author: Jakub Kicinski Date: Wed Jun 7 13:23:59 2023 -0700 tools: ynl-gen: walk nested types in depth So far we had only created structures for nested types nested directly in messages (second level of attrs so to speak). Walk types in depth to support deeper nesting. Signed-off-by: Jakub Kicinski commit 37487f93b12551f82547e04b32d8d285818ea7a0 Author: Jakub Kicinski Date: Wed Jun 7 13:23:58 2023 -0700 tools: ynl-gen: inherit struct use info We only render parse and netlink generation helpers as needed, to avoid generating dead code. Propagate the information from first- and second-layer attribute sets onto all children. Otherwise devlink won't work, it has a lot more levels of nesting. Signed-off-by: Jakub Kicinski commit 6afaa0ef9b0e446fde14a1424f2c2858484a3601 Author: Jakub Kicinski Date: Wed Jun 7 13:23:57 2023 -0700 tools: ynl-gen: try to sort the types more intelligently We need to sort the structures to avoid the need for forward declarations. While at it remove the sort of structs when rendering, it doesn't do anything. Signed-off-by: Jakub Kicinski commit ff6db4b58c93eada66f58423aa02363f987679c5 Author: Jakub Kicinski Date: Wed Jun 7 13:23:56 2023 -0700 tools: ynl-gen: enable code gen for directional specs I think that user space code gen for directional specs works after recent changes. Let them through. Signed-off-by: Jakub Kicinski commit 6f115d4575ab7225fc16ba816b9d25d88976a540 Author: Jakub Kicinski Date: Wed Jun 7 13:23:55 2023 -0700 tools: ynl-gen: refactor strmap helper generation Move generating strmap lookup function to a helper. No functional changes. Signed-off-by: Jakub Kicinski commit 9858bfc271de3cc61307a710044c304e6ec34f8a Author: Jakub Kicinski Date: Wed Jun 7 13:23:54 2023 -0700 tools: ynl-gen: use enum names in op strmap more carefully In preparation for supporting families which use different msg ids to and from the kernel - make sure the ids in op strmap are correct. The map is expected to be used mostly for notifications, don't generate a separate map for the "to kernel" direction. Signed-off-by: Jakub Kicinski commit 8947e503737138ff92323f99637d921451fe398a Author: Jakub Kicinski Date: Wed Jun 7 13:23:53 2023 -0700 netlink: specs: devlink: fill in some details important for C Python YNL is much more forgiving than the C code gen in terms of the spec completeness. Fill in a handful of devlink details to make the spec usable in C. Signed-off-by: Jakub Kicinski commit 6833b8f2e19945a41e4d5efd8c6d9f4cae9a5b7d Author: Robin Murphy Date: Thu Jun 1 17:43:33 2023 +0100 iommu/arm-smmu-v3: Set TTL invalidation hint better When io-pgtable unmaps a whole table, rather than waste time walking it to find the leaf entries to invalidate exactly, it simply expects .tlb_flush_walk with nominal last-level granularity to invalidate any leaf entries at higher intermediate levels as well. This works fine with page-based invalidation, but with range commands we need to be careful with the TTL hint - unconditionally setting it based on the given level 3 granule means that an invalidation for a level 1 table would strictly not be required to affect level 2 block entries. It's easy to comply with the expected behaviour by simply not setting the TTL hint for non-leaf invalidations, so let's do that. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/b409d9a17c52dc0db51faee91d92737bb7975f5b.1685637456.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 0bfbfc526c70606bf0fad302e4821087cbecfaf4 Author: Robin Murphy Date: Wed May 10 16:38:46 2023 +0100 iommu/arm-smmu-v3: Document nesting-related errata Both MMU-600 and MMU-700 have similar errata around TLB invalidation while both stages of translation are active, which will need some consideration once nesting support is implemented. For now, though, it's very easy to make our implicit lack of nesting support explicit for those cases, so they're less likely to be missed in future. Signed-off-by: Robin Murphy Reviewed-by: Nicolin Chen Link: https://lore.kernel.org/r/696da78d32bb4491f898f11b0bb4d850a8aa7c6a.1683731256.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 1d9777b9f3d55b4b6faf186ba4f1d6fb560c0523 Author: Robin Murphy Date: Wed May 10 16:38:45 2023 +0100 iommu/arm-smmu-v3: Add explicit feature for nesting In certain cases we may want to refuse to allow nested translation even when both stages are implemented, so let's add an explicit feature for nesting support which we can control in its own right. For now this merely serves as documentation, but it means a nice convenient check will be ready and waiting for the future nesting code. Signed-off-by: Robin Murphy Reviewed-by: Nicolin Chen Link: https://lore.kernel.org/r/136c3f4a3a84cc14a5a1978ace57dfd3ed67b688.1683731256.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 309a15cb16bb075da1c99d46fb457db6a1a2669e Author: Robin Murphy Date: Wed May 10 16:38:44 2023 +0100 iommu/arm-smmu-v3: Document MMU-700 erratum 2812531 To work around MMU-700 erratum 2812531 we need to ensure that certain sequences of commands cannot be issued without an intervening sync. In practice this falls out of our current command-batching machinery anyway - each batch only contains a single type of invalidation command, and ends with a sync. The only exception is when a batch is sufficiently large to need issuing across multiple command queue slots, wherein the earlier slots will not contain a sync and thus may in theory interleave with another batch being issued in parallel to create an affected sequence across the slot boundary. Since MMU-700 supports range invalidate commands and thus we will prefer to use them (which also happens to avoid conditions for other errata), I'm not entirely sure it's even possible for a single high-level invalidate call to generate a batch of more than 63 commands, but for the sake of robustness and documentation, wire up an option to enforce that a sync is always inserted for every slot issued. The other aspect is that the relative order of DVM commands cannot be controlled, so DVM cannot be used. Again that is already the status quo, but since we have at least defined ARM_SMMU_FEAT_BTM, we can explicitly disable it for documentation purposes even if it's not wired up anywhere yet. Signed-off-by: Robin Murphy Reviewed-by: Nicolin Chen Link: https://lore.kernel.org/r/330221cdfd0003cd51b6c04e7ff3566741ad8374.1683731256.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit f322e8af35c7f23a8c08b595c38d6c855b2d836f Author: Robin Murphy Date: Wed May 10 16:38:43 2023 +0100 iommu/arm-smmu-v3: Work around MMU-600 erratum 1076982 MMU-600 versions prior to r1p0 fail to correctly generate a WFE wakeup event when the command queue transitions fom full to non-full. We can easily work around this by simply hiding the SEV capability such that we fall back to polling for space in the queue - since MMU-600 implements MSIs we wouldn't expect to need SEV for sync completion either, so this should have little to no impact. Signed-off-by: Robin Murphy Reviewed-by: Nicolin Chen Tested-by: Nicolin Chen Link: https://lore.kernel.org/r/08adbe3d01024d8382a478325f73b56851f76e49.1683731256.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit edaac7d9fff62718d0edaa7ae99fd0be36450f32 Author: XU pengfei Date: Mon Aug 1 09:33:20 2022 +0800 i2c: img-scb: remove unnecessary (void*) conversion Signed-off-by: XU pengfei Signed-off-by: Wolfram Sang commit 0ec38df36ea1cc4f21bf7cd61a89942b034883c5 Author: Jacob Keller Date: Thu Jun 1 14:15:07 2023 -0700 ice: do not re-enable miscellaneous interrupt until thread_fn completes The ice driver uses threaded IRQ for managing Tx timestamps via the devm_request_threaded_irq() interface. The ice_misc_intr() handler function is responsible for processing the hard interrupt context, and can wake the ice_misc_intr_thread_fn() by returning IRQ_WAKE_THREAD. The request_threaded_irq() function comment says: @handler is still called in hard interrupt context and has to check whether the interrupt originates from the device. If yes, it needs to disable the interrupt on the device and return IRQ_WAKE_THREAD which will wake up the handler thread and run the @thread_fn. We currently re-enable the Other Interrupt Cause Register (OCIR) at the end of ice_misc_intr(). In practice, this seems to be ok, but it can make communicating between the handler function and the thread function difficult. This is because the interrupt can trigger again while the thread function is still processing. Move the OICR update to the end of the thread function, leaving the other interrupt cause disabled in hardware until we complete one pass of the thread function. This prevents the miscellaneous interrupt from firing until after we finish the thread function. Signed-off-by: Jacob Keller Tested-by: Arpana Arland (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 9a8648cce8d8a4a7770b45239912e20edb9736ad Author: Jacob Keller Date: Thu Jun 1 14:15:06 2023 -0700 ice: trigger PFINT_OICR_TSYN_TX interrupt instead of polling In ice_misc_intr_thread_fn(), if we do not complete all Tx timestamp work, the thread function will poll continuously forever. For E822 hardware, this wastes time as the return value from ice_ptp_process_ts() is accurate and always reports correctly that the PHY actually has new timestamp data. In addition, if we receive enough timestamps with the right pacing, we may never exit this polling. Should this occur, other tasks handled by the ice_misc_intr_thread_fn() will never be processed. Fix this by instead writing to PFINT_OICR, causing an emulated interrupt to be triggered immediately. This does take slightly more processing than just re-checking the timestamps. However, it allows all of the other interrupt causes a chance to be processed first in the hard IRQ function. Note that the OICR interrupt is configured to be throttled to no more than once every 124 microseconds. This gives an effective interrupt rate of ~8000 interrupts per second. This should thus not cause a significant increase in overall CPU usage when compared to sleeping. Signed-off-by: Jacob Keller Tested-by: Arpana Arland (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 0eeaf1eb40a34fddd1d568a9b32c3d6669238743 Author: Maninder Singh Date: Thu Jun 8 09:01:19 2023 +0530 kallsyms: make kallsyms_show_value() as generic function This change makes function kallsyms_show_value() as generic function without dependency on CONFIG_KALLSYMS. Now module address will be displayed with lsmod and /proc/modules. Earlier: ======= / # insmod test.ko / # lsmod test 12288 0 - Live 0x0000000000000000 (O) // No Module Load address / # With change: ========== / # insmod test.ko / # lsmod test 12288 0 - Live 0xffff800000fc0000 (O) // Module address / # cat /proc/modules test 12288 0 - Live 0xffff800000fc0000 (O) Co-developed-by: Onkarnath Signed-off-by: Onkarnath Signed-off-by: Maninder Singh Reviewed-by: Zhen Lei Signed-off-by: Luis Chamberlain commit b06e9318bfd03f531b918bd27b63f1eb88c21729 Author: Maninder Singh Date: Thu Jun 8 09:01:18 2023 +0530 kallsyms: move kallsyms_show_value() out of kallsyms.c function kallsyms_show_value() is used by other parts like modules_open(), kprobes_read() etc. which can work in case of !KALLSYMS also. e.g. as of now lsmod do not show module address if KALLSYMS is disabled. since kallsyms_show_value() defination is not present, it returns false in !KALLSYMS. / # lsmod test 12288 0 - Live 0x0000000000000000 (O) So kallsyms_show_value() can be made generic without dependency on KALLSYMS. Thus moving out function to a new file ksyms_common.c. With this patch code is just moved to new file and no functional change. Co-developed-by: Onkarnath Signed-off-by: Onkarnath Signed-off-by: Maninder Singh Reviewed-by: Zhen Lei Signed-off-by: Luis Chamberlain commit b432b55176443e96b6f3bc39ed140ab00cddd84f Author: Paul Moore Date: Thu Jun 8 14:58:28 2023 -0400 MAINTAINERS: move labeled networking to "supported" My current employer, Microsoft, cares very much about the development and maintenance of the upstream Linux Kernel so we can consider labeled networking to be "supported" according to the definition in MAINTAINERS: S: *Status*, one of the following: Supported: Someone is actually paid to look after this. Maintained: Someone actually looks after it. ... Signed-off-by: Paul Moore commit fdbd69549be8760060952e431ba940112ea623cc Author: Md Sadre Alam Date: Mon Mar 6 20:15:22 2023 +0530 i2c: qcom-cci:Use devm_platform_get_and_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Md Sadre Alam Acked-by: Robert Foss Signed-off-by: Wolfram Sang commit 449f6bc17a51e68b06cfd742898e5ff3fe6e04d7 Merge: bfd019d10fdab 25041a4c02c7c Author: Jakub Kicinski Date: Thu Jun 8 11:34:28 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. Conflicts: net/sched/sch_taprio.c d636fc5dd692 ("net: sched: add rcu annotations around qdisc->qdisc_sleeping") dced11ef84fb ("net/sched: taprio: don't overwrite "sch" variable in taprio_dump_class_stats()") net/ipv4/sysctl_net_ipv4.c e209fee4118f ("net/ipv4: ping_group_range: allow GID from 2147483648 to 4294967294") ccce324dabfe ("tcp: make the first N SYN RTO backoffs linear") https://lore.kernel.org/all/20230605100816.08d41a7b@canb.auug.org.au/ No adjacent changes. Signed-off-by: Jakub Kicinski commit b29ac0a518fc620274b62521721344009a1c377e Author: Henning Schild Date: Wed May 24 14:46:28 2023 +0200 leds: simatic-ipc-leds-gpio: Introduce more Kconfig switches To describe the dependency chain better and allow for potential fine-grained config tuning, introduce Kconfig switch for the individual GPIO based drivers. Signed-off-by: Henning Schild Acked-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230524124628.32295-5-henning.schild@siemens.com commit 2f5d6fe37b97cabf5cb5fc2be9630e37e2820e94 Author: Henning Schild Date: Wed May 24 14:46:27 2023 +0200 leds: simatic-ipc-leds-gpio: Split up into multiple drivers In order to clearly describe the dependencies between the GPIO controller drivers and the users the driver is split up into a core, two drivers and a common header. Signed-off-by: Henning Schild Acked-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230524124628.32295-4-henning.schild@siemens.com commit 799c0197aa5f732cefa8ca6285bd611b5cf45996 Author: Henning Schild Date: Wed May 24 14:46:26 2023 +0200 leds: simatic-ipc-leds-gpio: Move two extra gpio pins into another table There are two special pins needed to init the LEDs. We used to have them at the end of the gpiod_lookup table to give to "leds-gpio". A cleaner way is to have a dedicated table for the special pins. Signed-off-by: Henning Schild Acked-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230524124628.32295-3-henning.schild@siemens.com commit 8aee49eb939daeedab96a9a38e956ff9c81d4f08 Author: Henning Schild Date: Wed May 24 14:46:25 2023 +0200 leds: simatic-ipc-leds-gpio: Add terminating entries to gpio tables The entries do not seem to be stricly needed when the number of entries is given via the number of LEDs. But adding them is a safeguard should anyone ever iterate over the tables to their end, it also gets us in line with other drivers that register "leds-gpio" tables. Reported-by: Andy Shevchenko Signed-off-by: Henning Schild Reviewed-by: Andy Shevchenko Acked-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230524124628.32295-2-henning.schild@siemens.com commit f6794950f0e5ba37e3bbedda4d6ab0aad7395dd3 Author: Youngmin Nam Date: Mon Apr 24 10:04:36 2023 +0900 arm64: set __exception_irq_entry with __irq_entry as a default filter_irq_stacks() is supposed to cut entries which are related irq entries from its call stack. And in_irqentry_text() which is called by filter_irq_stacks() uses __irqentry_text_start/end symbol to find irq entries in callstack. But it doesn't work correctly as without "CONFIG_FUNCTION_GRAPH_TRACER", arm64 kernel doesn't include gic_handle_irq which is entry point of arm64 irq between __irqentry_text_start and __irqentry_text_end as we discussed in below link. https://lore.kernel.org/all/CACT4Y+aReMGLYua2rCLHgFpS9io5cZC04Q8GLs-uNmrn1ezxYQ@mail.gmail.com/#t This problem can makes unintentional deep call stack entries especially in KASAN enabled situation as below. [ 2479.383395]I[0:launcher-loader: 1719] Stack depot reached limit capacity [ 2479.383538]I[0:launcher-loader: 1719] WARNING: CPU: 0 PID: 1719 at lib/stackdepot.c:129 __stack_depot_save+0x464/0x46c [ 2479.385693]I[0:launcher-loader: 1719] pstate: 624000c5 (nZCv daIF +PAN -UAO +TCO -DIT -SSBS BTYPE=--) [ 2479.385724]I[0:launcher-loader: 1719] pc : __stack_depot_save+0x464/0x46c [ 2479.385751]I[0:launcher-loader: 1719] lr : __stack_depot_save+0x460/0x46c [ 2479.385774]I[0:launcher-loader: 1719] sp : ffffffc0080073c0 [ 2479.385793]I[0:launcher-loader: 1719] x29: ffffffc0080073e0 x28: ffffffd00b78a000 x27: 0000000000000000 [ 2479.385839]I[0:launcher-loader: 1719] x26: 000000000004d1dd x25: ffffff891474f000 x24: 00000000ca64d1dd [ 2479.385882]I[0:launcher-loader: 1719] x23: 0000000000000200 x22: 0000000000000220 x21: 0000000000000040 [ 2479.385925]I[0:launcher-loader: 1719] x20: ffffffc008007440 x19: 0000000000000000 x18: 0000000000000000 [ 2479.385969]I[0:launcher-loader: 1719] x17: 2065726568207475 x16: 000000000000005e x15: 2d2d2d2d2d2d2d20 [ 2479.386013]I[0:launcher-loader: 1719] x14: 5d39313731203a72 x13: 00000000002f6b30 x12: 00000000002f6af8 [ 2479.386057]I[0:launcher-loader: 1719] x11: 00000000ffffffff x10: ffffffb90aacf000 x9 : e8a74a6c16008800 [ 2479.386101]I[0:launcher-loader: 1719] x8 : e8a74a6c16008800 x7 : 00000000002f6b30 x6 : 00000000002f6af8 [ 2479.386145]I[0:launcher-loader: 1719] x5 : ffffffc0080070c8 x4 : ffffffd00b192380 x3 : ffffffd0092b313c [ 2479.386189]I[0:launcher-loader: 1719] x2 : 0000000000000001 x1 : 0000000000000004 x0 : 0000000000000022 [ 2479.386231]I[0:launcher-loader: 1719] Call trace: [ 2479.386248]I[0:launcher-loader: 1719] __stack_depot_save+0x464/0x46c [ 2479.386273]I[0:launcher-loader: 1719] kasan_save_stack+0x58/0x70 [ 2479.386303]I[0:launcher-loader: 1719] save_stack_info+0x34/0x138 [ 2479.386331]I[0:launcher-loader: 1719] kasan_save_free_info+0x18/0x24 [ 2479.386358]I[0:launcher-loader: 1719] ____kasan_slab_free+0x16c/0x170 [ 2479.386385]I[0:launcher-loader: 1719] __kasan_slab_free+0x10/0x20 [ 2479.386410]I[0:launcher-loader: 1719] kmem_cache_free+0x238/0x53c [ 2479.386435]I[0:launcher-loader: 1719] mempool_free_slab+0x1c/0x28 [ 2479.386460]I[0:launcher-loader: 1719] mempool_free+0x7c/0x1a0 [ 2479.386484]I[0:launcher-loader: 1719] bvec_free+0x34/0x80 [ 2479.386514]I[0:launcher-loader: 1719] bio_free+0x60/0x98 [ 2479.386540]I[0:launcher-loader: 1719] bio_put+0x50/0x21c [ 2479.386567]I[0:launcher-loader: 1719] f2fs_write_end_io+0x4ac/0x4d0 [ 2479.386594]I[0:launcher-loader: 1719] bio_endio+0x2dc/0x300 [ 2479.386622]I[0:launcher-loader: 1719] __dm_io_complete+0x324/0x37c [ 2479.386650]I[0:launcher-loader: 1719] dm_io_dec_pending+0x60/0xa4 [ 2479.386676]I[0:launcher-loader: 1719] clone_endio+0xf8/0x2f0 [ 2479.386700]I[0:launcher-loader: 1719] bio_endio+0x2dc/0x300 [ 2479.386727]I[0:launcher-loader: 1719] blk_update_request+0x258/0x63c [ 2479.386754]I[0:launcher-loader: 1719] scsi_end_request+0x50/0x304 [ 2479.386782]I[0:launcher-loader: 1719] scsi_io_completion+0x88/0x160 [ 2479.386808]I[0:launcher-loader: 1719] scsi_finish_command+0x17c/0x194 [ 2479.386833]I[0:launcher-loader: 1719] scsi_complete+0xcc/0x158 [ 2479.386859]I[0:launcher-loader: 1719] blk_mq_complete_request+0x4c/0x5c [ 2479.386885]I[0:launcher-loader: 1719] scsi_done_internal+0xf4/0x1e0 [ 2479.386910]I[0:launcher-loader: 1719] scsi_done+0x14/0x20 [ 2479.386935]I[0:launcher-loader: 1719] ufshcd_compl_one_cqe+0x578/0x71c [ 2479.386963]I[0:launcher-loader: 1719] ufshcd_mcq_poll_cqe_nolock+0xc8/0x150 [ 2479.386991]I[0:launcher-loader: 1719] ufshcd_intr+0x868/0xc0c [ 2479.387017]I[0:launcher-loader: 1719] __handle_irq_event_percpu+0xd0/0x348 [ 2479.387044]I[0:launcher-loader: 1719] handle_irq_event_percpu+0x24/0x74 [ 2479.387068]I[0:launcher-loader: 1719] handle_irq_event+0x74/0xe0 [ 2479.387091]I[0:launcher-loader: 1719] handle_fasteoi_irq+0x174/0x240 [ 2479.387118]I[0:launcher-loader: 1719] handle_irq_desc+0x7c/0x2c0 [ 2479.387147]I[0:launcher-loader: 1719] generic_handle_domain_irq+0x1c/0x28 [ 2479.387174]I[0:launcher-loader: 1719] gic_handle_irq+0x64/0x158 [ 2479.387204]I[0:launcher-loader: 1719] call_on_irq_stack+0x2c/0x54 [ 2479.387231]I[0:launcher-loader: 1719] do_interrupt_handler+0x70/0xa0 [ 2479.387258]I[0:launcher-loader: 1719] el1_interrupt+0x34/0x68 [ 2479.387283]I[0:launcher-loader: 1719] el1h_64_irq_handler+0x18/0x24 [ 2479.387308]I[0:launcher-loader: 1719] el1h_64_irq+0x68/0x6c [ 2479.387332]I[0:launcher-loader: 1719] blk_attempt_bio_merge+0x8/0x170 [ 2479.387356]I[0:launcher-loader: 1719] blk_mq_attempt_bio_merge+0x78/0x98 [ 2479.387383]I[0:launcher-loader: 1719] blk_mq_submit_bio+0x324/0xa40 [ 2479.387409]I[0:launcher-loader: 1719] __submit_bio+0x104/0x138 [ 2479.387436]I[0:launcher-loader: 1719] submit_bio_noacct_nocheck+0x1d0/0x4a0 [ 2479.387462]I[0:launcher-loader: 1719] submit_bio_noacct+0x618/0x804 [ 2479.387487]I[0:launcher-loader: 1719] submit_bio+0x164/0x180 [ 2479.387511]I[0:launcher-loader: 1719] f2fs_submit_read_bio+0xe4/0x1c4 [ 2479.387537]I[0:launcher-loader: 1719] f2fs_mpage_readpages+0x888/0xa4c [ 2479.387563]I[0:launcher-loader: 1719] f2fs_readahead+0xd4/0x19c [ 2479.387587]I[0:launcher-loader: 1719] read_pages+0xb0/0x4ac [ 2479.387614]I[0:launcher-loader: 1719] page_cache_ra_unbounded+0x238/0x288 [ 2479.387642]I[0:launcher-loader: 1719] do_page_cache_ra+0x60/0x6c [ 2479.387669]I[0:launcher-loader: 1719] page_cache_ra_order+0x318/0x364 [ 2479.387695]I[0:launcher-loader: 1719] ondemand_readahead+0x30c/0x3d8 [ 2479.387722]I[0:launcher-loader: 1719] page_cache_sync_ra+0xb4/0xc8 [ 2479.387749]I[0:launcher-loader: 1719] filemap_read+0x268/0xd24 [ 2479.387777]I[0:launcher-loader: 1719] f2fs_file_read_iter+0x1a0/0x62c [ 2479.387806]I[0:launcher-loader: 1719] vfs_read+0x258/0x34c [ 2479.387831]I[0:launcher-loader: 1719] ksys_pread64+0x8c/0xd0 [ 2479.387857]I[0:launcher-loader: 1719] __arm64_sys_pread64+0x48/0x54 [ 2479.387881]I[0:launcher-loader: 1719] invoke_syscall+0x58/0x158 [ 2479.387909]I[0:launcher-loader: 1719] el0_svc_common+0xf0/0x134 [ 2479.387935]I[0:launcher-loader: 1719] do_el0_svc+0x44/0x114 [ 2479.387961]I[0:launcher-loader: 1719] el0_svc+0x2c/0x80 [ 2479.387985]I[0:launcher-loader: 1719] el0t_64_sync_handler+0x48/0x114 [ 2479.388010]I[0:launcher-loader: 1719] el0t_64_sync+0x190/0x194 [ 2479.388038]I[0:launcher-loader: 1719] Kernel panic - not syncing: kernel: panic_on_warn set ... So let's set __exception_irq_entry with __irq_entry as a default. Applying this patch, we can see gic_hande_irq is included in Systemp.map as below. * Before ffffffc008010000 T __do_softirq ffffffc008010000 T __irqentry_text_end ffffffc008010000 T __irqentry_text_start ffffffc008010000 T __softirqentry_text_start ffffffc008010000 T _stext ffffffc00801066c T __softirqentry_text_end ffffffc008010670 T __entry_text_start * After ffffffc008010000 T __irqentry_text_start ffffffc008010000 T _stext ffffffc008010000 t gic_handle_irq ffffffc00801013c t gic_handle_irq ffffffc008010294 T __irqentry_text_end ffffffc008010298 T __do_softirq ffffffc008010298 T __softirqentry_text_start ffffffc008010904 T __softirqentry_text_end ffffffc008010908 T __entry_text_start Signed-off-by: Youngmin Nam Signed-off-by: SEO HOYOUNG Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20230424010436.779733-1-youngmin.nam@samsung.com Signed-off-by: Catalin Marinas commit ae39eb42dd06e058215d0f782365b84039d686d4 Author: Jacob Keller Date: Thu Jun 1 14:15:05 2023 -0700 ice: introduce ICE_TX_TSTAMP_WORK enumeration The ice_ptp_process_ts() function and its various helper functions return a boolean value indicating whether any work is remaining. This use of a boolean has grown confusing as we have multiple helpers that pass status between each other. Readers must be aware of what "true" and "false" mean, and it is very easy to get their meaning inverted. The names of the functions are not standard "yes/no" questions, which is the best practice for boolean returns. Replace this use of an enumeration with a custom type, enum ice_tx_tstamp_work. This enumeration clearly indicates whether all work is done, or if more work is pending. To aid in readability, factor the actual list iteration and processing out into ice_ptp_process_tx_tstamp(), making it void. Then call this in ice_ptp_tx_tstamp() ensuring that we always check the Tracker list at the end when determining the appropriate return value. Now the return value is an explicit name instead of the true or false value. This is easier to follow and makes reading the resulting callers much simpler. In addition, this paves the way for future work to allow E822 hardware to process timestamps for all functions using a single interrupt on the clock owning PF. Signed-off-by: Jacob Keller Tested-by: Arpana Arland (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit b54185c1e3b02c91e4a190ac5c346ea7bfb0de93 Author: Jakob Hauser Date: Mon May 15 22:57:19 2023 +0200 dt-bindings: Add rt5033 MFD, Regulator and Charger Add device tree binding documentation for rt5033 multifunction device, voltage regulator and battery charger. Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/bff139976865c2a489ab62333d78c4e3179a8eae.1684182964.git.jahau@rocketmail.com commit 395289114602ed3319eb7c4c064083dfacf4240d Author: Jakob Hauser Date: Mon May 15 22:57:18 2023 +0200 dt-bindings: power: supply: rt5033-battery: Apply unevaluatedProperties Additionally to the already available ref "power-supply.yaml", replace "additionalProperties: false" by "unevaluatedProperties: false". Otherwise, when referencing rt5033-battery in an example, message "'power-supplies' does not match any of the regexes: 'pinctrl-[0-9]+'" will be returned. Signed-off-by: Jakob Hauser Acked-by: Conor Dooley Acked-by: Sebastian Reichel Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/ef86067348f01a3bbf1bd9b4f81716b62ea1f552.1684182964.git.jahau@rocketmail.com commit 4ed21f06a913f79850d8c937c15fda03dde34512 Author: Jakob Hauser Date: Mon May 15 22:57:17 2023 +0200 power: supply: rt5033_battery: Adopt status property from charger The rt5033-battery fuelgauge can't get a status by itself. The rt5033-charger can, let's get this value. To get the charger as a "supplier" from the devicetree, the "of_node" needs to be initiated. Additionally, in the probe function replace dev_err() with dev_err_probe(), this will avoid printing an error for -EPROBE_DEFER when the battery driver probes before the charger driver. Signed-off-by: Jakob Hauser Acked-by: Sebastian Reichel Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/a2015d257b145108a3ecdf107a3040362c887fc5.1684182964.git.jahau@rocketmail.com commit 49b435908b2aeb0f3a8a5256256019594a5adc1c Author: Jakob Hauser Date: Mon May 15 22:57:16 2023 +0200 power: supply: rt5033_battery: Move struct rt5033_battery to battery driver Move struct rt5033_battery from the mfd header into the battery driver because it's not used by others. Within struct rt5033_battery, remove the line "struct rt5033_dev *rt5033;" because it doesn't get used. In rt5033.h, remove #include , it's not necessary anymore. In rt5033_battery.c, remove #include , it's not necessary anymore either. Instead add #include and Signed-off-by: Jakob Hauser Acked-by: Sebastian Reichel Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/736e1cbee257853cb3d1da6f05c184e9a053263b.1684182964.git.jahau@rocketmail.com commit 88d341716b83abd355558523186ca488918627ee Author: Robin Murphy Date: Wed Jun 7 18:18:47 2023 +0100 PCI: Add function 1 DMA alias quirk for Marvell 88SE9235 Marvell's own product brief implies the 92xx series are a closely related family, and sure enough it turns out that 9235 seems to need the same quirk as the other three, although possibly only when certain ports are used. Link: https://lore.kernel.org/linux-iommu/2a699a99-545c-1324-e052-7d2f41fed1ae@yahoo.co.uk/ Link: https://lore.kernel.org/r/731507e05d70239aec96fcbfab6e65d8ce00edd2.1686157165.git.robin.murphy@arm.com Reported-by: Jason Adriaanse Signed-off-by: Robin Murphy Signed-off-by: Bjorn Helgaas Reviewed-by: Christoph Hellwig Cc: stable@vger.kernel.org commit b7653853d5b12637c16b5ca5c8bab39b486bfe99 Author: Jakob Hauser Date: Mon May 15 22:57:14 2023 +0200 power: supply: rt5033_charger: Add RT5033 charger device driver This patch adds device driver of Richtek RT5033 PMIC. The driver supports switching charger. rt5033 charger provides three charging modes. The charging modes are pre-charge mode, fast charge mode and constant voltage mode. They vary in charge rate, the charge parameters can be controlled by i2c interface. Tested-by: Raymond Hackley Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Acked-by: Sebastian Reichel Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/9556d4ebb30fd321e37aa0eb343554122e4720c9.1684182964.git.jahau@rocketmail.com commit 3d897612107a3d7b4d70ca4296a6fd80bfd1b04f Author: Jakob Hauser Date: Mon May 15 22:57:13 2023 +0200 mfd: rt5033: Apply preparatory changes before adding rt5033-charger driver Order the register blocks to have the masks in descending manner. Add new defines for constant voltage shift (RT5033_CHGCTRL2_CV_SHIFT), MIVR mask (RT5033_CHGCTRL4_MIVR_MASK), pre-charge current shift (RT5033_CHGCTRL4_IPREC_SHIFT), internal timer disable (RT5033_INT_TIMER_DISABLE), termination disable (RT5033_TE_DISABLE), CFO disable (RT5033_CFO_DISABLE), UUG disable (RT5033_CHARGER_UUG_DISABLE). The fast charge timer type needs to be written on mask 0x38 (RT5033_CHGCTRL3_TIMER_MASK). To avoid a bit shift on application, change the values of the timer types to fit the mask. Added the timout duration as a comment. And the timer between TIMER8 and TIMER12 is most likely TIMER10, see e.g. RT5036 [1] page 28 bottom. Add value options for MIVR (Minimum Input Voltage Regulation). Move RT5033_TE_ENABLE_MASK to the block "RT5033 CHGCTRL1 register", in order to have the masks of the register collected there. To fit the naming scheme, rename it to RT5033_CHGCTRL1_TE_EN_MASK. Move RT5033_CHG_MAX_CURRENT to the block "RT5033 charger fast-charge current". Add new defines RT5033_CV_MAX_VOLTAGE and RT5033_CHG_MAX_PRE_CURRENT to the blocks "RT5033 charger constant charge voltage" and "RT5033 charger pre-charge current limits". In include/linux/mfd/rt5033.h, turn power_supply "psy" into a pointer in order to use it in devm_power_supply_register(). [1] https://media.digikey.com/pdf/Data%20Sheets/Richtek%20PDF/RT5036%20%20Preliminary.pdf Signed-off-by: Jakob Hauser Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/31c750ae13a1c1896b51d8f0a0d9869f8b85624f.1684182964.git.jahau@rocketmail.com commit 4f7a2a08c735003893da177071bf5e5f6f14e39c Author: Jakob Hauser Date: Mon May 15 22:57:12 2023 +0200 mfd: rt5033: Fix STAT_MASK, HZ_MASK and AICR defines The charger state mask RT5033_CHG_STAT_MASK should be 0x30 [1][2]. The high impedance mask RT5033_RT_HZ_MASK is actually value 0x02 [3] and is assosiated to the RT5033 CHGCTRL1 register [4]. Accordingly also change RT5033_CHARGER_HZ_ENABLE to 0x02 to avoid the need of a bit shift upon application. For input current limiting AICR mode, the define for the 1000 mA step was missing [5]. Additionally add the define for DISABLE option. Concerning the mask, remove RT5033_AICR_MODE_MASK because there is already RT5033_CHGCTRL1_IAICR_MASK further up. They are redundant and the upper one makes more sense to have the masks of a register colleted there as an overview. [1] https://github.com/msm8916-mainline/linux-downstream/blob/GT-I9195I/drivers/battery/rt5033_charger.c#L669-L682 [2] https://github.com/torvalds/linux/blob/v6.0/include/linux/mfd/rt5033-private.h#L59-L62 [3] https://github.com/msm8916-mainline/linux-downstream/blob/GT-I9195I/include/linux/battery/charger/rt5033_charger.h#L44 [4] https://github.com/msm8916-mainline/linux-downstream/blob/GT-I9195I/drivers/battery/rt5033_charger.c#L223 [5] https://github.com/msm8916-mainline/linux-downstream/blob/GT-I9195I/drivers/battery/rt5033_charger.c#L278 Signed-off-by: Jakob Hauser Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/2f17beec3d6c59b41d7e2451d177dc8aaeb7efe2.1684182964.git.jahau@rocketmail.com commit c4747d7ce3948766cdae2404b4a796ba4cda9d7d Author: Jakob Hauser Date: Mon May 15 22:57:11 2023 +0200 mfd: rt5033: Fix chip revision readout After reading the data from the DEVICE_ID register, mask 0x0f needs to be applied to extract the revision of the chip [1]. The other part of the DEVICE_ID register, mask 0xf0, is a vendor identification code. That's how it is set up at similar products of Richtek, e.g. RT9455 [2] page 21 top. [1] https://github.com/msm8916-mainline/linux-downstream/blob/GT-I9195I/drivers/mfd/rt5033_core.c#L484 [2] https://www.richtek.com/assets/product_file/RT9455/DS9455-00.pdf Signed-off-by: Jakob Hauser Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/9a98521ffdf76851d5d344afa6ce65f692ecc024.1684182964.git.jahau@rocketmail.com commit 43db1344e0f8c1eb687a1d6cd5b0de3009ab66cb Author: Stephan Gerhold Date: Mon May 15 22:57:10 2023 +0200 mfd: rt5033: Drop rt5033-battery sub-device The fuel gauge in the RT5033 PMIC (rt5033-battery) has its own I2C bus and interrupt lines. Therefore, it is not part of the MFD device and needs to be specified separately in the device tree. Fixes: 0b271258544b ("mfd: rt5033: Add Richtek RT5033 driver core.") Signed-off-by: Stephan Gerhold Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/6a8a19bc67b5be3732882e8131ad2ffcb546ac03.1684182964.git.jahau@rocketmail.com commit d578e618f192f453baf4fd7e32fec88ed7e678b8 Author: Karol Kolacinski Date: Thu Jun 1 14:15:04 2023 -0700 ice: always return IRQ_WAKE_THREAD in ice_misc_intr() Refactor the ice_misc_intr() function to always return IRQ_WAKE_THREAD, and schedule the service task during the soft IRQ thread function instead of at the end of the hard IRQ handler. Remove the duplicate call to ice_service_task_schedule() that happened when we got a PCI exception. Signed-off-by: Karol Kolacinski Signed-off-by: Jacob Keller Tested-by: Arpana Arland (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit b3f4b679ff427bba8208177ea52cc39128995f62 Author: Jiapeng Chong Date: Wed May 31 13:35:59 2023 +0800 leds: flash: leds-qcom-flash: Fix an unsigned comparison which can never be negative The variable 'count' is defined as unsigned type, so the following if statement is invalid, we can modify the type of count to int. if (count <= 0) { dev_err(dev, "No led-sources specified\n"); return -ENODEV; } ./drivers/leds/flash/leds-qcom-flash.c:546:5-10: WARNING: Unsigned expression compared with zero: count <= 0. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5344 Signed-off-by: Jiapeng Chong Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230531053559.5702-1-jiapeng.chong@linux.alibaba.com commit dda968475beb1939be84c7f34636cbc7bdc0eb14 Author: Jiapeng Chong Date: Wed May 31 10:40:20 2023 +0800 leds: cht-wcove: Remove unneeded semicolon No functional modification involved. ./drivers/leds/leds-cht-wcove.c:193:2-3: Unneeded semicolon. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5343 Signed-off-by: Jiapeng Chong Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230531024020.106641-1-jiapeng.chong@linux.alibaba.com commit 6e8b2c88fc8cf95ed09de25946b20b7536c88cd5 Author: Karol Kolacinski Date: Thu Jun 1 14:15:03 2023 -0700 ice: handle extts in the miscellaneous interrupt thread The ice_ptp_extts_work() and ice_ptp_periodic_work() functions are both scheduled on the same kthread worker, pf.ptp.kworker. The ice_ptp_periodic_work() function sends to the firmware to interact with the PHY, and must block to wait for responses. This can cause delay in responding to the PFINT_OICR_TSYN_EVNT interrupt cause, ultimately resulting in disruption to processing an input signal of the frequency is high enough. In our testing, even 100 Hz signals get disrupted. Fix this by instead processing the signal inside the miscellaneous interrupt thread prior to handling Tx timestamps. Use atomic bits in a new pf->misc_thread bitmap in order to safely communicate which tasks require processing within the ice_misc_intr_thread_fn(). This ensures the communication of desired tasks from the ice_misc_intr() are correctly processed without racing even in the event that the interrupt triggers again before the thread function exits. Fixes: 172db5f91d5f ("ice: add support for auxiliary input/output pins") Signed-off-by: Karol Kolacinski Signed-off-by: Jacob Keller Tested-by: Arpana Arland (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit de416a9f91f330cf764c9d46bb5faac844f4e9ac Author: Yang Li Date: Wed May 31 10:02:38 2023 +0800 leds: cht-wcove: Fix an unsigned comparison which can never be negative The return value from the call to cht_wc_leds_find_freq() is int. However, the return value is being assigned to an unsigned int variable 'ctrl', so making it an int. Eliminate the following warning: drivers/leds/leds-cht-wcove.c:236 cht_wc_leds_set_effect() warn: unsigned 'ctrl' is never less than zero. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5341 Signed-off-by: Yang Li Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230531020238.102684-1-yang.lee@linux.alibaba.com commit e180cf836433185d0674ade52f8db911d89f6422 Author: Kartik Date: Tue Jun 6 16:36:08 2023 +0100 soc/tegra: fuse: Fix Tegra234 fuse size The Tegra234 fuse size is incorrectly defined as 0x98c. The actual size of the Tegra234 fuses is 0xf8c and so update the size of the Tegra234 fuses to fix this. Signed-off-by: Kartik Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit c3a1c97c72601f8c00678f0ebafb574ec6e26d54 Author: Viswanath L Date: Tue Jun 6 16:36:07 2023 +0100 soc/tegra: pmc: Add AON SW Wake support for Tegra234 Wake-up signal 83 on Tegra234 is triggered by software writing to WAKE_AOWAKE_SW_WAKE_TIER0_TRIGGER_0 register. This wake-up is mapped to CPU interrupt 179 and is used by the Sensor Processing Engine (SPE) in the Always-on (AON) power domain for waking up the system. Signed-off-by: Viswanath L Signed-off-by: Kartik Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit fef0f427f71224442698ea4e052315a894d9de69 Author: Dmitry Antipov Date: Mon Jun 5 13:07:00 2023 +0300 wifi: rtlwifi: remove misused flag from HAL data Always rely on 'driver_is_goingto_unload' of 'struct rtl_hal' and remove (presumably misused) 'driver_going2unload' from it. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230605100700.111644-1-dmantipov@yandex.ru commit 557123259200b30863e1b6a8f24a8c8060b6fc1d Author: Dmitry Antipov Date: Fri Jun 2 09:59:40 2023 +0300 wifi: rtlwifi: remove unused dualmac control leftovers Remove 'struct rtl_dualmac_easy_concurrent_ctl' of 'struct rtl_priv' and related code in '_rtl_pci_tx_chk_waitq()'. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230602065940.149198-2-dmantipov@yandex.ru commit 358b94f0a7cadd2ec7824531d54dadaa8b71de04 Author: Dmitry Antipov Date: Fri Jun 2 09:59:39 2023 +0300 wifi: rtlwifi: remove unused timer and related code Drop unused 'dualmac_easyconcurrent_retrytimer' of 'struct rtl_works', corresponding 'rtl_easy_concurrent_retrytimer_callback()' handler, 'dualmac_easy_concurrent' function pointer of 'struct rtl_hal_ops' and related call to 'timer_setup()' in '_rtl_init_deferred_work()'. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230602065940.149198-1-dmantipov@yandex.ru commit e74f562328b03fbe9cf438f958464dff3a644dfc Author: Marek Vasut Date: Sun May 28 00:28:59 2023 +0200 wifi: rsi: Do not set MMC_PM_KEEP_POWER in shutdown It makes no sense to set MMC_PM_KEEP_POWER in shutdown. The flag indicates to the MMC subsystem to keep the slot powered on during suspend, but in shutdown the slot should actually be powered off. Drop this call. Fixes: 063848c3e155 ("rsi: sdio: Add WOWLAN support for S5 shutdown state") Signed-off-by: Marek Vasut Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230527222859.273768-1-marex@denx.de commit b241e260820b68c09586e8a0ae0fc23c0e3215bd Author: Marek Vasut Date: Sun May 28 00:28:33 2023 +0200 wifi: rsi: Do not configure WoWlan in shutdown hook if not enabled In case WoWlan was never configured during the operation of the system, the hw->wiphy->wowlan_config will be NULL. rsi_config_wowlan() checks whether wowlan_config is non-NULL and if it is not, then WARNs about it. The warning is valid, as during normal operation the rsi_config_wowlan() should only ever be called with non-NULL wowlan_config. In shutdown this rsi_config_wowlan() should only ever be called if WoWlan was configured before by the user. Add checks for non-NULL wowlan_config into the shutdown hook. While at it, check whether the wiphy is also non-NULL before accessing wowlan_config . Drop the single-use wowlan_config variable, just inline it into function call. Fixes: 16bbc3eb8372 ("rsi: fix null pointer dereference during rsi_shutdown()") Signed-off-by: Marek Vasut Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230527222833.273741-1-marex@denx.de commit f8f912bf69a021c8cfff23e69e59c7c975a47c1a Author: Neal Sidhwaney Date: Sat Jun 3 02:00:23 2023 -0400 wifi: brcmfmac: Detect corner error case earlier with log In brcmf_chip_recognition(), the return value from an MMIO read is interpreted as various fields without checking if it failed, which is harmless today, as the interpreted fields are checked for validity a few lines below. However, in corner cases (on my MacbookPro 14,1, sometimes after waking from sleep or soft reboot), when this happens, it causes the logging to be misleading, because the message indicates an unsupported chip type ("brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported"). This patch detects this case slightly earlier and logs an appropriate message, with the same return result as is the case today. Signed-off-by: Neal Sidhwaney Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230603060021.57225-1-nealsid@gmail.com commit 5883fc2ef8573649ee6a63968ae82e679766b878 Author: Ping-Ke Shih Date: Fri Jun 2 23:05:56 2023 +0800 wifi: rtw89: 8852c: update RF radio A/B parameters to R63 Update 8852c radio A/B parameters from internal HALRF_029_00_102 R63. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230602150556.36777-9-pkshih@realtek.com commit dad142c3f56a2459b1f18cac63e1a436d0a31c84 Author: Zong-Zhe Yang Date: Fri Jun 2 23:05:55 2023 +0800 wifi: rtw89: 8852c: update TX power tables to R63 with 6 GHz power type (3 of 3) Update TX power tables to RF version R63. TX power tables' changes: * TX power byrate: tweak a bit * TX power limit, TX power limit RU, TX power shape: configure values for MEXICO, UKRAINE, CHILE, QATAR tweak a bit on other configured values * 6 GHz TX power limit, 6 GHz TX power limit RU: add an extra dimension for 6 GHz regulatory power type, i.e. STD (standard power), LPI (low power indoor), VLP (very low power) Besides, we adjust TX power handling at 6 GHz in phy to consider 6 GHz regulatory power type. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230602150556.36777-8-pkshih@realtek.com commit 2a8ec45f4d0eff76cf0cef78b3040ccfd923a72e Author: Zong-Zhe Yang Date: Fri Jun 2 23:05:54 2023 +0800 wifi: rtw89: 8852c: update TX power tables to R63 with 6 GHz power type (2 of 3) Update TX power tables to RF version R63. TX power tables' changes: * TX power byrate: tweak a bit * TX power limit, TX power limit RU, TX power shape: configure values for MEXICO, UKRAINE, CHILE, QATAR tweak a bit on other configured values * 6 GHz TX power limit, 6 GHz TX power limit RU: add an extra dimension for 6 GHz regulatory power type, i.e. STD (standard power), LPI (low power indoor), VLP (very low power) Besides, we adjust TX power handling at 6 GHz in phy to consider 6 GHz regulatory power type. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230602150556.36777-7-pkshih@realtek.com commit b742394cfe80a51572ff74e0a57b4b21db1489b1 Author: Zong-Zhe Yang Date: Fri Jun 2 23:05:53 2023 +0800 wifi: rtw89: 8852c: update TX power tables to R63 with 6 GHz power type (1 of 3) Update TX power tables to RF version R63. TX power tables' changes: * TX power byrate: tweak a bit * TX power limit, TX power limit RU, TX power shape: configure values for MEXICO, UKRAINE, CHILE, QATAR tweak a bit on other configured values * 6 GHz TX power limit, 6 GHz TX power limit RU: add an extra dimension for 6 GHz regulatory power type, i.e. STD (standard power), LPI (low power indoor), VLP (very low power) Besides, we adjust TX power handling at 6 GHz in phy to consider 6 GHz regulatory power type. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230602150556.36777-6-pkshih@realtek.com commit f6baa1d3d5703fe65b87b3149265a1c7f564f450 Author: Zong-Zhe Yang Date: Fri Jun 2 23:05:52 2023 +0800 wifi: rtw89: process regulatory for 6 GHz power type Configure the corresponding power type for 6 GHz regulatory if we can determine one single target. Otherwise, we use the default one. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230602150556.36777-5-pkshih@realtek.com commit 9468046ff54eb5b72616c8126105bbf2df711253 Author: Zong-Zhe Yang Date: Fri Jun 2 23:05:51 2023 +0800 wifi: rtw89: regd: update regulatory map to R64-R40 Update notes: According to Realtek Regulatory R40 and Realtek Channel Plan R64, configure rtw89_regulatory mapping of 6 GHz for more countries and adjust rtw89_regulatory mapping of 2/5 GHz for a few countries. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230602150556.36777-4-pkshih@realtek.com commit ffc23511531341936dbddd24ba0e3a08bcdda01c Author: Zong-Zhe Yang Date: Fri Jun 2 23:05:50 2023 +0800 wifi: rtw89: regd: judge 6 GHz according to chip and BIOS We allow platform to disable 6 GHz on chips, which supports 6 GHz, through BIOS. Driver will evaluate Realtek acpi DSM with RTW89_ACPI_DSM_FUNC_6G_DIS (function 3) to get whether 6 GHz should be disabled. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230602150556.36777-3-pkshih@realtek.com commit b7d170d5a670de8d30d2db94179099f52f8df485 Author: Zong-Zhe Yang Date: Fri Jun 2 23:05:49 2023 +0800 wifi: rtw89: refine clearing supported bands to check 2/5 GHz first We refine to check if supported bands of NL80211_BAND_2GHZ and NL80211_BAND_5GHZ exist before freeing their iftype_data. For now, it does not really encounter problems because all current chips support both 2 GHz and 5 GHz. But, driver actually allows chips to declare whether 2/5 GHz are supported or not. In case some future chips really don't support them, we refine this code. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230602150556.36777-2-pkshih@realtek.com commit 57369e2aa2eb9812368c6cf3c4378d1fbe9e8c8a Author: Zong-Zhe Yang Date: Wed May 31 14:07:13 2023 +0800 wifi: rtw89: 8851b: configure CRASH_TRIGGER feature for 8851B RTL8851B firmware supports CRASH_TRIGGER feature from v0.29.41.0. After this is configured, debugfs fw_crash can support type 1 on RTL8851B to trigger firmware crash and verify L2 recovery through simulation. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230531060713.57203-5-pkshih@realtek.com commit db67b03b04b4363251c0d8eecaf7a631449b6f3d Author: Zong-Zhe Yang Date: Wed May 31 14:07:12 2023 +0800 wifi: rtw89: set TX power without precondition during setting channel The key condition to check in wrapper of setting TX power is whether entity is active or not. Before entity is active, we restrict TX power from being set by outside callers, e.g. SAR/regulatory. We mark entity as inactive when powering off MAC. Then, we will mark it as active when we initialize HW channel stuffs after MAC power on. Although we can get an active entity after leaving idle phase, TX power doesn't be set well for default channel until stack set target channel for connection. It causes that RF things cannot use better TX power during this interval. Below are some cases which may encounter this or a similar situation. * hw scan process before connection As described above. * right after restart hardware process (SER L2) HW stuffs of target channel is initialized after mac80211 restart hardware, but we unexpectedly need to wait one more command to set channel again or to set TX power. To fix it and improve RF behavior in that interval, during setting channel, we don't need to check entity state before setting TX power, which actually is used to restrict outside callers. It means we call chip ops directly to replace the wrapper call. Then, TX power can be initialized as long as we initialize/setup HW stuffs on one channel. Besides, all chips should configure ops of setting TX power, so we remove trivial check on pointer. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230531060713.57203-4-pkshih@realtek.com commit b25e755e5e418aa7b537b8b2a2506c34c53df2d5 Author: Zong-Zhe Yang Date: Wed May 31 14:07:11 2023 +0800 wifi: rtw89: debug: txpwr table access only valid page according to chip We now support RTL8851B which has only single RF path. For chip with single RF path, TX power page is valid only in single path section. So, we refine debugfs txpwr table to access TX power page according to RF path number of runtime chip. It can prevent us from reading beyond valid sections. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230531060713.57203-3-pkshih@realtek.com commit 9c52e8bf07c7097e09503fcad7cb156deffef619 Author: Po-Hao Huang Date: Wed May 31 14:07:10 2023 +0800 wifi: rtw89: 8851b: enable hw_scan support This enables hw_scan for 8851b after firmware version 0.29.37.1. Extend the channel info struct with padding zeros so newer firmware can work properly, this change is backward compatible with older firmware. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230531060713.57203-2-pkshih@realtek.com commit c1ff7da03e164265cd19f95ac0926c22d28eec19 Author: Artur Weber Date: Fri May 19 20:07:26 2023 +0200 video: backlight: lp855x: Get PWM for PWM mode during probe Also deprecate the pwm-period DT property, as it is now redundant (pwms property already contains period value). Signed-off-by: Artur Weber Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230519180728.2281-3-aweber.kernel@gmail.com commit 24b8ae3e2e2f675e78bdf97f24de285c4a38cbcb Author: Artur Weber Date: Fri May 19 20:07:25 2023 +0200 dt-bindings: backlight: lp855x: Convert to YAML and modernize Notable changes: - ROM child nodes use dashes instead of underscores; the driver reads all child nodes regardless of their names, so this doesn't break ABI. - pwm-period argument is deprecated, as it effectively duplicates the period value provided in pwms. The driver continues to accept the property, so this should not break ABI. Signed-off-by: Artur Weber Reviewed-by: Rob Herring Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230519180728.2281-2-aweber.kernel@gmail.com commit 504dba50b0c3fa02ec513d7d0405ddffba2d1c0a Author: Michael Kelley Date: Mon Feb 27 10:46:08 2023 -0800 x86/irq: Add hardcoded hypervisor interrupts to /proc/stat Some hypervisor interrupts (such as for Hyper-V VMbus and Hyper-V timers) have hardcoded interrupt vectors on x86 and don't have Linux IRQs assigned. These interrupts are shown in /proc/interrupts, but are not reported in the first field of the "intr" line in /proc/stat because the x86 version of arch_irq_stat_cpu() doesn't include them. Fix this by adding code to arch_irq_stat_cpu() to include these interrupts, similar to existing interrupts that don't have Linux IRQs. Use #if IS_ENABLED() because unlike all the other nearby #ifdefs, CONFIG_HYPERV can be built as a module. Signed-off-by: Michael Kelley Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/1677523568-50263-1-git-send-email-mikelley%40microsoft.com commit 08e6c4bb17087584261c4aff555d32fc1c620b81 Merge: 41a343cd6b7f8 b0e2e4fb8a546 Author: Mark Brown Date: Thu Jun 8 16:07:32 2023 +0100 ASoC: mt8188-mt6359: Cleanups Merge series from AngeloGioacchino Del Regno : This series performs some cleanups to the mt8188-mt6359 driver, including usage of bitfield macros, adding definitions of register fields and some others for readability and consistency. commit 89e756e3cc8d9c1ebc0f2b2f6912227073d93118 Author: Dan Carpenter Date: Tue Jun 6 11:20:54 2023 +0300 HID: fix an error code in hid_check_device_match() The hid_check_device_match() returns true if we find a match and false if we don't. But here it returns -ENODEV which becomes true instead of false. Fixes: 207733f92661 ("HID: split apart hid_device_probe to make logic more apparent") Signed-off-by: Dan Carpenter Reviewed-by: Benjamin Tissoires Reviewed-by: Dmitry Torokhov Signed-off-by: Jiri Kosina commit 3f80ba4444dc004f5db473439c2f80837cbe85f6 Author: Hans de Goede Date: Thu May 25 20:33:17 2023 +0200 leds: cht-wcove: Mark cht_wc_leds_brightness_get() static cht_wc_leds_brightness_get() is only used internally, mark it static. Cc: Yauhen Kharuzhy Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305260008.QCRrKILf-lkp@intel.com/ Signed-off-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230525183317.129232-1-hdegoede@redhat.com commit 48aea8b445c422a372cf15915101035a47105421 Author: stuarthayhurst Date: Tue May 30 15:44:28 2023 +0100 HID: logitech-hidpp: Add USB and Bluetooth IDs for the Logitech G915 TKL Keyboard Adds the USB and Bluetooth IDs for the Logitech G915 TKL keyboard, for device detection For this device, this provides battery reporting on top of hid-generic Reviewed-by: Bastien Nocera Signed-off-by: Stuart Hayhurst Signed-off-by: Jiri Kosina commit e4b880758a9182fbfa4b28302a66acfeac2cbfed Author: Uwe Kleine-König Date: Thu May 25 22:32:02 2023 +0200 HID: i2c-hid: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Jiri Kosina commit 7607f12ba735f04e0ef8718dabadf3a765c9a477 Author: Fei Shao Date: Wed May 24 11:42:37 2023 +0800 HID: i2c-hid: goodix: Add support for "goodix,no-reset-during-suspend" property In the beginning, commit 18eeef46d359 ("HID: i2c-hid: goodix: Tie the reset line to true state of the regulator") introduced a change to tie the reset line of the Goodix touchscreen to the state of the regulator to fix a power leakage issue in suspend. After some time, the change was deemed unnecessary and was reverted in commit 557e05fa9fdd ("HID: i2c-hid: goodix: Stop tying the reset line to the regulator") due to difficulties in managing regulator notifiers for designs like Evoker, which provides a second power rail to touchscreen. However, the revert caused a power regression on another Chromebook device Steelix in the field, which has a dedicated always-on regulator for touchscreen and was covered by the workaround in the first commit. To address both cases, this patch adds the support for the new "goodix,no-reset-during-suspend" property in the driver: - When set to true, the driver does not assert the reset GPIO during power-down. Instead, the GPIO will be asserted during power-up to ensure the touchscreen always has a clean start and consistent behavior after resuming. This is for designs with a dedicated always-on regulator. - When set to false or unset, the driver uses the original control flow and asserts GPIO and disables regulators normally. This is for the two-regulator and shared-regulator designs. Signed-off-by: Fei Shao Suggested-by: Douglas Anderson Reviewed-by: Douglas Anderson Reviewed-by: Jeff LaBundy Signed-off-by: Jiri Kosina commit 359ed24a0dd3802e703ec8071dc3b6ed446de5f0 Author: Fei Shao Date: Wed May 24 11:42:36 2023 +0800 dt-bindings: input: goodix: Add "goodix,no-reset-during-suspend" property We observed that on Chromebook device Steelix, if Goodix GT7375P touchscreen is powered in suspend (because, for example, it connects to an always-on regulator) and with the reset GPIO asserted, it will introduce about 14mW power leakage. To address that, we add this property to skip reset during suspend. If it's set, the driver will stop asserting the reset GPIO during power-down. Refer to the comments in the driver for details. Signed-off-by: Fei Shao Suggested-by: Jeff LaBundy Reviewed-by: Douglas Anderson Reviewed-by: Matthias Brugger Reviewed-by: Jeff LaBundy Acked-by: Rob Herring Signed-off-by: Jiri Kosina commit d5e45e810e0e08114035d31d88049544c038e6fc Merge: 748462b59f901 1e72695137ef5 Author: Palmer Dabbelt Date: Thu Jun 8 07:17:09 2023 -0700 Merge patch series "riscv: Add vector ISA support" Andy Chiu says: This is the v21 patch series for adding Vector extension support in Linux. Please refer to [1] for the introduction of the patchset. The v21 patch series was aimed to solve build issues from v19, provide usage guideline for the prctl interface, and address review comments on v20. Thank every one who has been reviewing, suggesting on the topic. Hope this get a step closer to the final merge. * b4-shazam-merge: (27 commits) selftests: add .gitignore file for RISC-V hwprobe selftests: Test RISC-V Vector prctl interface riscv: Add documentation for Vector riscv: Enable Vector code to be built riscv: detect assembler support for .option arch riscv: Add sysctl to set the default vector rule for new processes riscv: Add prctl controls for userspace vector management riscv: hwcap: change ELF_HWCAP to a function riscv: KVM: Add vector lazy save/restore support riscv: kvm: Add V extension to KVM ISA riscv: prevent stack corruption by reserving task_pt_regs(p) early riscv: signal: validate altstack to reflect Vector riscv: signal: Report signal frame size to userspace via auxv riscv: signal: Add sigcontext save/restore for vector riscv: signal: check fp-reserved words unconditionally riscv: Add ptrace vector support riscv: Allocate user's vector context in the first-use trap riscv: Add task switch support for vector riscv: Introduce struct/helpers to save/restore per-task Vector state riscv: Introduce riscv_v_vsize to record size of Vector context ... Link: https://lore.kernel.org/r/20230605110724.21391-1-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 1e72695137ef5afd94000b763f7a35899d0a005e Author: Andy Chiu Date: Mon Jun 5 11:07:24 2023 +0000 selftests: add .gitignore file for RISC-V hwprobe The executable file "hwprobe" should be ignored by git, adding it to fix that. Signed-off-by: Andy Chiu Link: https://lore.kernel.org/r/20230605110724.21391-28-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 7cf6198ce22d92590f9aaa13431001fa97bc0b2b Author: Andy Chiu Date: Mon Jun 5 11:07:23 2023 +0000 selftests: Test RISC-V Vector prctl interface This add a test for prctl interface that controls the use of userspace Vector. Signed-off-by: Andy Chiu Link: https://lore.kernel.org/r/20230605110724.21391-27-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 04a4722eeede8f83ce3fefc67b891bd8e132784a Author: Andy Chiu Date: Mon Jun 5 11:07:22 2023 +0000 riscv: Add documentation for Vector This patch add a brief documentation of the userspace interface in regard to the RISC-V Vector extension. Signed-off-by: Andy Chiu Reviewed-by: Greentime Hu Reviewed-by: Vincent Chen Co-developed-by: Bagas Sanjaya Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20230605110724.21391-26-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit fa8e7cce55da3569259dc270801885c420eb50fe Author: Guo Ren Date: Mon Jun 5 11:07:21 2023 +0000 riscv: Enable Vector code to be built This patch adds configs for building Vector code. First it detects the reqired toolchain support for building the code. Then it provides an option setting whether Vector is implicitly enabled to userspace. Signed-off-by: Guo Ren Co-developed-by: Greentime Hu Signed-off-by: Greentime Hu Co-developed-by: Andy Chiu Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230605110724.21391-25-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit e4bb020f3dbb83912eb6799a9d4bb79da4fd77ec Author: Andy Chiu Date: Mon Jun 5 11:07:20 2023 +0000 riscv: detect assembler support for .option arch Some extensions use .option arch directive to selectively enable certain extensions in parts of its assembly code. For example, Zbb uses it to inform assmebler to emit bit manipulation instructions. However, supporting of this directive only exist on GNU assembler and has not landed on clang at the moment, making TOOLCHAIN_HAS_ZBB depend on AS_IS_GNU. While it is still under review at https://reviews.llvm.org/D123515, the upcoming Vector patch also requires this feature in assembler. Thus, provide Kconfig AS_HAS_OPTION_ARCH to detect such feature. Then TOOLCHAIN_HAS_XXX will be turned on automatically when the feature land. Suggested-by: Nathan Chancellor Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Nathan Chancellor Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20230605110724.21391-24-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 7ca7a7b9b635dbf8428f8e3bb8ea9e9ff5c79bfc Author: Andy Chiu Date: Mon Jun 5 11:07:19 2023 +0000 riscv: Add sysctl to set the default vector rule for new processes To support Vector extension, the series exports variable-length vector registers on the signal frame. However, this potentially breaks abi if processing vector registers is required in the signal handler for old binaries. For example, there is such need if user-level context switch is triggerred via signals[1]. For this reason, it is best to leave a decision to distro maintainers, where the enablement of userspace Vector for new launching programs can be controlled. Developers may also need the switch to experiment with. The parameter is configurable through sysctl interface so a distro may turn off Vector early at init script if the break really happens in the wild. The switch will only take effects on new execve() calls once set. This will not effect existing processes that do not call execve(), nor processes which has been set with a non-default vstate_ctrl by making explicit PR_RISCV_V_SET_CONTROL prctl() calls. Link: https://lore.kernel.org/all/87cz4048rp.fsf@all.your.base.are.belong.to.us/ Signed-off-by: Andy Chiu Reviewed-by: Greentime Hu Reviewed-by: Vincent Chen Reviewed-by: Björn Töpel Link: https://lore.kernel.org/r/20230605110724.21391-23-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 1fd96a3e9d5d4febe1a8486590ad52c048d1be77 Author: Andy Chiu Date: Mon Jun 5 11:07:18 2023 +0000 riscv: Add prctl controls for userspace vector management This patch add two riscv-specific prctls, to allow usespace control the use of vector unit: * PR_RISCV_V_SET_CONTROL: control the permission to use Vector at next, or all following execve for a thread. Turning off a thread's Vector live is not possible since libraries may have registered ifunc that may execute Vector instructions. * PR_RISCV_V_GET_CONTROL: get the same permission setting for the current thread, and the setting for following execve(s). Signed-off-by: Andy Chiu Reviewed-by: Greentime Hu Reviewed-by: Vincent Chen Link: https://lore.kernel.org/r/20230605110724.21391-22-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 50724efcb370c61c64f75614763fb411e087f70c Author: Andy Chiu Date: Mon Jun 5 11:07:17 2023 +0000 riscv: hwcap: change ELF_HWCAP to a function Using a function is flexible to represent ELF_HWCAP. So the kernel may encode hwcap reflecting supported hardware features just at the moment of the start of each program. This will be helpful when we introduce prctl/sysctl interface to control per-process availability of Vector extension in following patches. Programs started with V disabled should see V masked off in theirs ELF_HWCAP. Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230605110724.21391-21-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 0f4b82579716b12bb88257bd7ea80f25c791fb2c Author: Vincent Chen Date: Mon Jun 5 11:07:16 2023 +0000 riscv: KVM: Add vector lazy save/restore support This patch adds vector context save/restore for guest VCPUs. To reduce the impact on KVM performance, the implementation imitates the FP context switch mechanism to lazily store and restore the vector context only when the kernel enters/exits the in-kernel run loop and not during the KVM world switch. Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu Signed-off-by: Andy Chiu Reviewed-by: Anup Patel Acked-by: Anup Patel Link: https://lore.kernel.org/r/20230605110724.21391-20-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit bf78f1ea6e5108a7ebd55be0853f0716433117a9 Author: Vincent Chen Date: Mon Jun 5 11:07:15 2023 +0000 riscv: kvm: Add V extension to KVM ISA Add V extension to KVM isa extension list to enable supporting of V extension on VCPUs. Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Anup Patel Acked-by: Anup Patel Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20230605110724.21391-19-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit c7cdd96eca2810f5b69c37eb439ec63d59fa1b83 Author: Greentime Hu Date: Mon Jun 5 11:07:14 2023 +0000 riscv: prevent stack corruption by reserving task_pt_regs(p) early Early function calls, such as setup_vm(), relocate_enable_mmu(), soc_early_init() etc, are free to operate on stack. However, PT_SIZE_ON_STACK bytes at the head of the kernel stack are purposedly reserved for the placement of per-task register context pointed by task_pt_regs(p). Those functions may corrupt task_pt_regs if we overlap the $sp with it. In fact, we had accidentally corrupted sstatus.VS in some tests, treating the kernel to save V context before V was actually allocated, resulting in a kernel panic. Thus, we should skip PT_SIZE_ON_STACK for $sp before making C function calls from the top-level assembly. Co-developed-by: ShihPo Hung Signed-off-by: ShihPo Hung Co-developed-by: Vincent Chen Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20230605110724.21391-18-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 76e22fdc2c2658ab595cdda7368d43d2dc16f3f4 Author: Andy Chiu Date: Mon Jun 5 11:07:13 2023 +0000 riscv: signal: validate altstack to reflect Vector Some extensions, such as Vector, dynamically change footprint on a signal frame, so MINSIGSTKSZ is no longer accurate. For example, an RV64V implementation with vlen = 512 may occupy 2K + 40 + 12 Bytes of a signal frame with the upcoming support. And processes that do not execute any vector instructions do not need to reserve the extra sigframe. So we need a way to guard the allocation size of the sigframe at process runtime according to current status of V. Thus, provide the function sigaltstack_size_valid() to validate its size based on current allocation status of supported extensions. Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20230605110724.21391-17-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit e92f469b0771e6db9688a58c0e34a8342da6a6bc Author: Vincent Chen Date: Mon Jun 5 11:07:12 2023 +0000 riscv: signal: Report signal frame size to userspace via auxv The vector register belongs to the signal context. They need to be stored and restored as entering and leaving the signal handler. According to the V-extension specification, the maximum length of the vector registers can be 2^16. Hence, if userspace refers to the MINSIGSTKSZ to create a sigframe, it may not be enough. To resolve this problem, this patch refers to the commit 94b07c1f8c39c ("arm64: signal: Report signal frame size to userspace via auxv") to enable userspace to know the minimum required sigframe size through the auxiliary vector and use it to allocate enough memory for signal context. Note that auxv always reports size of the sigframe as if V exists for all starting processes, whenever the kernel has CONFIG_RISCV_ISA_V. The reason is that users usually reference this value to allocate an alternative signal stack, and the user may use V anytime. So the user must reserve a space for V-context in sigframe in case that the signal handler invokes after the kernel allocating V. Signed-off-by: Greentime Hu Signed-off-by: Vincent Chen Signed-off-by: Andy Chiu Acked-by: Conor Dooley Reviewed-by: Björn Töpel Reviewed-by: Guo Ren Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20230605110724.21391-16-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 8ee0b41898fa26f66e32237f179b6989c65600d6 Author: Greentime Hu Date: Mon Jun 5 11:07:11 2023 +0000 riscv: signal: Add sigcontext save/restore for vector This patch facilitates the existing fp-reserved words for placement of the first extension's context header on the user's sigframe. A context header consists of a distinct magic word and the size, including the header itself, of an extension on the stack. Then, the frame is followed by the context of that extension, and then a header + context body for another extension if exists. If there is no more extension to come, then the frame must be ended with a null context header. A special case is rv64gc, where the kernel support no extensions requiring to expose additional regfile to the user. In such case the kernel would place the null context header right after the first reserved word of __riscv_q_ext_state when saving sigframe. And the kernel would check if all reserved words are zeros when a signal handler returns. __riscv_q_ext_state---->| |<-__riscv_extra_ext_header ~ ~ .reserved[0]--->|0 |<- .reserved <-------|magic |<- .hdr | |size |_______ end of sc_fpregs | |ext-bdy| | ~ ~ +)size ------->|magic |<- another context header |size | |ext-bdy| ~ ~ |magic:0|<- null context header |size:0 | The vector registers will be saved in datap pointer. The datap pointer will be allocated dynamically when the task needs in kernel space. On the other hand, datap pointer on the sigframe will be set right after the __riscv_v_ext_state data structure. Co-developed-by: Vincent Chen Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu Suggested-by: Vineet Gupta Suggested-by: Richard Henderson Co-developed-by: Andy Chiu Signed-off-by: Andy Chiu Acked-by: Conor Dooley Acked-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20230605110724.21391-15-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit a45cedaa1ac0da7b30882afb42ff9d5285e9bb44 Author: Andy Chiu Date: Mon Jun 5 11:07:10 2023 +0000 riscv: signal: check fp-reserved words unconditionally In order to let kernel/user locate and identify an extension context on the existing sigframe, we are going to utilize reserved space of fp and encode the information there. And since the sigcontext has already preserved a space for fp context w or w/o CONFIG_FPU, we move those reserved words checking/setting routine back into generic code. This commit also undone an additional logical change carried by the refactor commit 007f5c3589578 ("Refactor FPU code in signal setup/return procedures"). Originally we did not restore fp context if restoring of gpr have failed. And it was fine on the other side. In such way the kernel could keep the regfiles intact, and potentially react at the failing point of restore. Signed-off-by: Andy Chiu Acked-by: Conor Dooley Acked-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20230605110724.21391-14-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 0c59922c769a1361d4699ef6694b59031767a74e Author: Greentime Hu Date: Mon Jun 5 11:07:09 2023 +0000 riscv: Add ptrace vector support This patch adds ptrace support for riscv vector. The vector registers will be saved in datap pointer of __riscv_v_ext_state. This pointer will be set right after the __riscv_v_ext_state data structure then it will be put in ubuf for ptrace system call to get or set. It will check if the datap got from ubuf is set to the correct address or not when the ptrace system call is trying to set the vector registers. Co-developed-by: Vincent Chen Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230605110724.21391-13-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit cd054837243b5f36ff395c21135ff153871180f1 Author: Andy Chiu Date: Mon Jun 5 11:07:08 2023 +0000 riscv: Allocate user's vector context in the first-use trap Vector unit is disabled by default for all user processes. Thus, a process will take a trap (illegal instruction) into kernel at the first time when it uses Vector. Only after then, the kernel allocates V context and starts take care of the context for that user process. Suggested-by: Richard Henderson Link: https://lore.kernel.org/r/3923eeee-e4dc-0911-40bf-84c34aee962d@linaro.org Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230605110724.21391-12-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 3a2df6323defbb42234aaae804a8ad6af397016a Author: Greentime Hu Date: Mon Jun 5 11:07:07 2023 +0000 riscv: Add task switch support for vector This patch adds task switch support for vector. It also supports all lengths of vlen. Suggested-by: Andrew Waterman Co-developed-by: Nick Knight Signed-off-by: Nick Knight Co-developed-by: Guo Ren Signed-off-by: Guo Ren Co-developed-by: Vincent Chen Signed-off-by: Vincent Chen Co-developed-by: Ruinland Tsai Signed-off-by: Ruinland Tsai Signed-off-by: Greentime Hu Signed-off-by: Vineet Gupta Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Björn Töpel Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20230605110724.21391-11-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 03c3fcd9941a172abdea84456eefce2d2b7b415c Author: Greentime Hu Date: Mon Jun 5 11:07:06 2023 +0000 riscv: Introduce struct/helpers to save/restore per-task Vector state Add vector state context struct to be added later in thread_struct. And prepare low-level helper functions to save/restore vector contexts. This include Vector Regfile and CSRs holding dynamic configuration state (vstart, vl, vtype, vcsr). The Vec Register width could be implementation defined, but same for all processes, so that is saved separately. This is not yet wired into final thread_struct - will be done when __switch_to actually starts doing this in later patches. Given the variable (and potentially large) size of regfile, they are saved in dynamically allocated memory, pointed to by datap pointer in __riscv_v_ext_state. Co-developed-by: Vincent Chen Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu Signed-off-by: Vineet Gupta Signed-off-by: Andy Chiu Acked-by: Conor Dooley Reviewed-by: Guo Ren Reviewed-by: Björn Töpel Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230605110724.21391-10-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 7017858eb2d7ed7a295be02c71124049a6409295 Author: Greentime Hu Date: Mon Jun 5 11:07:05 2023 +0000 riscv: Introduce riscv_v_vsize to record size of Vector context This patch is used to detect the size of CPU vector registers and use riscv_v_vsize to save the size of all the vector registers. It assumes all harts has the same capabilities in a SMP system. If a core detects VLENB that is different from the boot core, then it warns and turns off V support for user space. Co-developed-by: Guo Ren Signed-off-by: Guo Ren Co-developed-by: Vincent Chen Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230605110724.21391-9-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 0a3381a01dcc3d0537732794c007f32e4dfd1efc Author: Greentime Hu Date: Mon Jun 5 11:07:04 2023 +0000 riscv: Introduce Vector enable/disable helpers These are small and likely to be frequently called so implement as inline routines (vs. function call). Co-developed-by: Guo Ren Signed-off-by: Guo Ren Co-developed-by: Vincent Chen Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu Signed-off-by: Vineet Gupta Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230605110724.21391-8-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 74abe5a39d3a110f4c87c8ff34b80705009a96e0 Author: Guo Ren Date: Mon Jun 5 11:07:03 2023 +0000 riscv: Disable Vector Instructions for kernel itself Disable vector instructions execution for kernel mode at its entrances. This helps find illegal uses of vector in the kernel space, which is similar to the fpu. Signed-off-by: Guo Ren Co-developed-by: Vincent Chen Signed-off-by: Vincent Chen Co-developed-by: Han-Kuan Chen Signed-off-by: Han-Kuan Chen Co-developed-by: Greentime Hu Signed-off-by: Greentime Hu Signed-off-by: Vineet Gupta Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230605110724.21391-7-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 6b533828726af4e3609aeb6e5f494e936f9a7cde Author: Greentime Hu Date: Mon Jun 5 11:07:02 2023 +0000 riscv: Clear vector regfile on bootup clear vector registers on boot if kernel supports V. Signed-off-by: Greentime Hu Signed-off-by: Vineet Gupta Signed-off-by: Andy Chiu Acked-by: Conor Dooley Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230605110724.21391-6-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit b5665d2a94325c3244584f504d039a573cfd63e8 Author: Greentime Hu Date: Mon Jun 5 11:07:01 2023 +0000 riscv: Add new csr defines related to vector extension Follow the riscv vector spec to add new csr numbers. Acked-by: Guo Ren Co-developed-by: Guo Ren Signed-off-by: Guo Ren Co-developed-by: Vincent Chen Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu Reviewed-by: Palmer Dabbelt Suggested-by: Vineet Gupta Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20230605110724.21391-5-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 162e4df137c1fea6557fda3e4cdf5dc6ca6d5510 Author: Andy Chiu Date: Mon Jun 5 11:07:00 2023 +0000 riscv: hwprobe: Add support for probing V in RISCV_HWPROBE_KEY_IMA_EXT_0 Probing kernel support for Vector extension is available now. This only add detection for V only. Extenions like Zvfh, Zk are not in this scope. Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Evan Green Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230605110724.21391-4-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit dc6667a4e7e36f283bcd0264a0be55adae4d6f86 Author: Guo Ren Date: Mon Jun 5 11:06:59 2023 +0000 riscv: Extending cpufeature.c to detect V-extension Add V-extension into riscv_isa_ext_keys array and detect it with isa string parsing. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Signed-off-by: Greentime Hu Suggested-by: Vineet Gupta Co-developed-by: Andy Chiu Signed-off-by: Andy Chiu Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230605110724.21391-3-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit 419d5d38ac5d79dfd899522274c872854cfe17ac Author: Guo Ren Date: Mon Jun 5 11:06:58 2023 +0000 riscv: Rename __switch_to_aux() -> fpu The name of __switch_to_aux() is not clear and rename it with the determine function: __switch_to_fpu(). Next we could add other regs' switch. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Signed-off-by: Greentime Hu Reviewed-by: Anup Patel Reviewed-by: Palmer Dabbelt Signed-off-by: Andy Chiu Tested-by: Heiko Stuebner Reviewed-by: Heiko Stuebner Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230605110724.21391-2-andy.chiu@sifive.com Signed-off-by: Palmer Dabbelt commit d428487471ba6640ee8bcdabaf830aec08b85400 Author: William Breathitt Gray Date: Sun Apr 16 13:36:53 2023 -0400 counter: i8254: Introduce the Intel 8254 interface library module Exposes consumer library functions providing support for interfaces compatible with the venerable Intel 8254 Programmable Interval Timer (PIT). The Intel 8254 PIT first appeared in the early 1980s and was used initially in IBM PC compatibles. The popularity of the original Intel 825x family of chips led to many subsequent variants and clones of the interface in various chips and integrated circuits. Although still popular, interfaces compatible with the Intel 8254 PIT are nowdays typically found embedded in larger VLSI processing chips and FPGA components rather than as discrete ICs. A CONFIG_I8254 Kconfig option is introduced by this patch. Modules wanting access to these i8254 library functions should select this Kconfig option, and import the I8254 symbol namespace. Link: https://lore.kernel.org/r/f6fe32c2db9525d816ab1a01f45abad56c081652.1681665189.git.william.gray@linaro.org/ Signed-off-by: William Breathitt Gray commit f5554725f30475b05b5178b998366f11ecb50c7f Author: Siarhei Vishniakou Date: Tue Apr 25 09:38:44 2023 -0700 HID: microsoft: Add rumble support to latest xbox controllers Currently, rumble is only supported via bluetooth on a single xbox controller, called 'model 1708'. On the back of the device, it's named 'wireless controller for xbox one'. However, in 2021, Microsoft released a firmware update for this controller. As part of this update, the HID descriptor of the device changed. The product ID was also changed from 0x02fd to 0x0b20. On this controller, rumble was supported via hid-microsoft, which matched against the old product id (0x02fd). As a result, the firmware update broke rumble support on this controller. See: https://news.xbox.com/en-us/2021/09/08/xbox-controller-firmware-update-rolling-out-to-insiders-starting-today/ The hid-microsoft driver actually supports rumble on the new firmware, as well. So simply adding new product id is sufficient to bring back this support. After discussing further with the xbox team, it was pointed out that another xbox controller, xbox elite series 2, can be supported in a similar way. Add rumble support for all of these devices in this patch. Two of the devices have received firmware updates that caused their product id's to change. Both old and new firmware versions of these devices were tested. The tested controllers are: 1. 'wireless controller for xbox one', model 1708 2. 'xbox wireless controller', model 1914. This is also sometimes referred to as 'xbox series S|X'. 3. 'elite series 2', model 1797. The tested configurations are: 1. model 1708, pid 0x02fd (old firmware) 2. model 1708, pid 0x0b20 (new firmware) 3. model 1914, pid 0x0b13 4. model 1797, pid 0x0b05 (old firmware) 5. model 1797, pid 0x0b22 (new firmware) I verified rumble support on both bluetooth and usb. Reviewed-by: Bastien Nocera Signed-off-by: Siarhei Vishniakou Signed-off-by: Jiri Kosina commit c9cb7e72e293141d0d6c1d74c26788d3a0605172 Author: Alexandre Torgue Date: Thu May 25 17:28:19 2023 +0200 MAINTAINERS: add entry for ARM/STM32 ARCHITECTURE STM32 SoCs based on Armv8 have been added to the STM32 family. Those new SoCs are maintained as legacy STM32 MPU. Signed-off-by: Alexandre Torgue commit 064433f84e6b69055379aa11a4084627537ee64e Author: Alexandre Torgue Date: Wed May 24 17:27:13 2023 +0200 arm64: defconfig: enable ARCH_STM32 and STM32 serial driver Allow a basic boot on STM32MP257 SoC. Signed-off-by: Alexandre Torgue commit 1c89075497bb6347fcda99442f3505043b4d2fdf Author: Alexandre Torgue Date: Thu Nov 18 12:26:49 2021 +0100 arm64: dts: st: add stm32mp257f-ev1 board support Add STM32MP257F Evaluation board support. It embeds a STM32MP257FAI SoC, with 4GB of DDR4, TSN switch (2+1 ports), 2*USB typeA, 1*USB2 typeC, SNOR OctoSPI, mini PCIe, STPMIC2 for power distribution ... Signed-off-by: Alexandre Torgue commit 6defdc268916a6f92a24d3495b22cd9c573e4357 Author: Alexandre Torgue Date: Wed May 24 16:39:51 2023 +0200 dt-bindings: stm32: document stm32mp257f-ev1 board Add new entry for stm32mp257f-ev1 board. Signed-off-by: Alexandre Torgue Reviewed-by: Conor Dooley commit 3b170e1653c05b067ea6ef616ece961b07714f48 Author: Alexandre Torgue Date: Thu Jan 7 14:15:12 2021 +0100 arm64: dts: st: introduce stm32mp25 pinctrl files Three packages exist for stm32mp25 dies. As ball-out is different between them, this patch covers those differences by introducing dedicated pinctrl dtsi files. Each dtsi pinctrl package file describes the package ball-out through gpio-ranges. Available packages are: STM32MP25xAI: 18*18/FCBGA 172 ios STM32MP25xAK: 14*14/FCBGA 144 ios STM32MP25xAL: 10*10/TFBGA 144 ios It includes also the common file used for pin groups definition. Signed-off-by: Alexandre Torgue commit 5d30d03aaf78586c37100006ba271d045f730bb5 Author: Alexandre Torgue Date: Wed Oct 7 15:29:52 2020 +0200 arm64: dts: st: introduce stm32mp25 SoCs family STM32MP25 family is composed of 4 SoCs defined as following: -STM32MP251: common part composed of 1*Cortex-A35, common peripherals like SDMMC, UART, SPI, I2C, PCIe, USB3, parallel and DSI display, 1*ETH ... -STM32MP253: STM32MP251 + 1*Cortex-A35 (dual CPU), a second ETH, CAN-FD and LVDS display. -STM32MP255: STM32MP253 + GPU/AI and video encode/decode. -STM32MP257: STM32MP255 + ETH TSN switch (2+1 ports). A second diversity layer exists for security features/ A35 frequency: -STM32MP25xY, "Y" gives information: -Y = A means A35@1.2GHz + no cryp IP and no secure boot. -Y = C means A35@1.2GHz + cryp IP and secure boot. -Y = D means A35@1.5GHz + no cryp IP and no secure boot. -Y = F means A35@1.5GHz + cryp IP and secure boot. Signed-off-by: Alexandre Torgue commit 9e4e24414cc6b45bd887d746a59691e295431ddf Author: Alexandre Torgue Date: Wed May 24 14:37:27 2023 +0200 arm64: introduce STM32 family on Armv8 architecture Add a dedicated ARCH_STM32 for STM32 SoCs config. First STM32 Armv8 SoC family is the STM32MP25 which is composed of STM32MP251, STM32MP253, STM32MP255, STM32MP257 SoCs. Signed-off-by: Alexandre Torgue commit c3053382574a5a829c93fb5ab0bb52d20456e745 Author: Patrick Delaunay Date: Tue Jan 5 13:37:13 2021 +0100 dt-bindings: stm32: add st,stm32mp25-syscfg compatible for syscon Add the new syscon compatible for STM32MP25 syscfg = "st,stm32mp25-syscfg". Reorder enum following ASCII oredering. Signed-off-by: Patrick Delaunay Signed-off-by: Alexandre Torgue Acked-by: Krzysztof Kozlowski commit 619f8ca4a73d376bee4307948aea6cd6177aa1df Author: Alexandre Torgue Date: Wed May 24 15:33:57 2023 +0200 pinctrl: stm32: add stm32mp257 pinctrl support Add stm32mp257 pinctrl support. Signed-off-by: Alexandre Torgue Reviewed-by: Linus Walleij commit a45645472f7762df7c5ee4fabde3a86581012ae4 Author: Alexandre Torgue Date: Wed Apr 6 15:39:28 2022 +0200 dt-bindings: pinctrl: stm32: support for stm32mp257 and additional packages Add support for st,stm32mp257-pinctrl and st,stm32mp257-z-pinctrl. Add packages AI, AK and AL (values : 0x100, 0x400 and 0x800) Signed-off-by: Alexandre Torgue Reviewed-by: Conor Dooley Reviewed-by: Linus Walleij commit 4c2216728f688da3c4478fec23be9bd820824664 Author: Joshua Dickens Date: Thu May 11 12:47:54 2023 -0700 selftests: hid: Add touch tests for Wacom devices Adding a wacom touch device to use the test_multitouch tests. Adding a 2 additional tests. - A test to check if a touch event is sent when the contact_id of the event is 0. - A test to check if a touch event is not sent when confidence is set to 0. Signed-off-by: Joshua Dickens Reviewed-by: Jason Gerecke Signed-off-by: Jiri Kosina commit 3a3f1e573a105328a2cca45a7cfbebabbf5e3192 Author: Dan Carpenter Date: Thu Jun 8 11:23:40 2023 +0300 modpost: fix off by one in is_executable_section() The > comparison should be >= to prevent an out of bounds array access. Fixes: 52dc0595d540 ("modpost: handle relocations mismatch in __ex_table.") Signed-off-by: Dan Carpenter Signed-off-by: Masahiro Yamada commit 317840cfd665d69a728424d1a85b80264442357f Author: Frank Crawford Date: Sat May 27 19:47:56 2023 +1000 hwmon: (it87) Generalise support for FAN_CTL ON/OFF Support for FAN_CTL ON/OFF is currently disabled only for IT8603E but there are severl chips that don't support the configuration bits to turn off fan control entirely. Generalise this support for any chip. Add feature flag FEAT_FANCTL_ONOFF for chips that support configuration bits for management of fan control off and assign all chips that support the configuration. Signed-off-by: Frank Crawford Link: https://lore.kernel.org/r/20230527094756.3464256-1-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck commit a1b6f13578e15e09fdaee5d90f05de04b59240bd Author: Osama Muhammad Date: Fri May 26 21:39:38 2023 +0500 hwmon: (pmbus/adm1266) Drop unnecessary error check for debugfs_create_dir This patch removes the error checking for debugfs_create_dir in adm1266.c. This is because the debugfs_create_dir() does not return NULL but an ERR_PTR after an error. The DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes.The debugfs Api handles it gracefully. The check is unnecessary. Link to the comment above debugfs_create_dir: https://elixir.bootlin.com/linux/latest/source/fs/debugfs/inode.c#L565 Signed-off-by: Osama Muhammad Link: https://lore.kernel.org/r/20230526163938.9903-1-osmtendev@gmail.com Signed-off-by: Guenter Roeck commit ca866920b0f35350b8b2bf9c7323051649a75bee Author: Osama Muhammad Date: Fri May 26 20:49:06 2023 +0500 hwmon: (pmbus/ucd9000) Drop unnecessary error check for debugfs_create_dir This patch removes the error checking for debugfs_create_dir in ucd9000.c. This is because the debugfs_create_dir() does not return NULL but an ERR_PTR after an error. The DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes.The debugfs Api handles it gracefully. The check is unnecessary. Link to the comment above debugfs_create_dir: https://elixir.bootlin.com/linux/latest/source/fs/debugfs/inode.c#L565 Signed-off-by: Osama Muhammad Link: https://lore.kernel.org/r/20230526154906.6370-1-osmtendev@gmail.com Signed-off-by: Guenter Roeck commit 153c9a023b1f455887a3fb7913207794eee3c6c2 Author: Arnd Bergmann Date: Thu Jun 1 23:31:54 2023 +0200 hwmon: (hp-wmi-sensors) fix debugfs check Checking for Kconfig symbols with #if is wrong: drivers/hwmon/hp-wmi-sensors.c:1141:5: error: "CONFIG_DEBUG_FS" is not defined, evaluates to 0 [-Werror=undef] This could be an #ifdef, but an IS_ENABLED() check is even better to give the best compile coverage. Fixes: 23902f98f8d4 ("hwmon: add HP WMI Sensors driver") Signed-off-by: Arnd Bergmann Acked-by: James Seo Link: https://lore.kernel.org/r/20230601213216.3220550-1-arnd@kernel.org Signed-off-by: Guenter Roeck commit 23902f98f8d4811ab84dde6419569a5b374f8122 Author: James Seo Date: Mon May 22 04:56:46 2023 -0700 hwmon: add HP WMI Sensors driver Hewlett-Packard (and some HP Compaq) business-class computers report hardware monitoring information via WMI. This driver exposes that information to hwmon. Initial support is provided for temperature, fan speed, and intrusion sensor types. Provisional support is provided for voltage and current sensor types. HP's WMI implementation permits many other types of numeric sensors. Therefore, a debugfs interface is also provided to enumerate and inspect all numeric sensors visible on the WMI side. This should facilitate adding support for other sensor types in the future. Tested on a HP Z420, a HP EliteOne 800 G1, and a HP Compaq Elite 8300 SFF. Note that provisionally supported sensor types are untested and seem to be rare-to-nonexistent in the wild, having been encountered neither on test systems nor in ACPI dumps from the Linux Hardware Database. They are included because their popularity in general makes their presence on past or future HP systems plausible and because no doubt exists as to how the sensors themselves would be represented in WMI (alarm attributes will need to wait for hardware to be located). A 2005 HP whitepaper gives the relevant sensor object MOF definition and sensor value scaling calculation, and both this driver and the official HP Performance Advisor utility comply with them (confirmed in the latter case by reverse engineering). Link: https://h20331.www2.hp.com/hpsub/downloads/cmi_whitepaper.pdf Signed-off-by: James Seo Link: https://lore.kernel.org/r/20230522115645.509701-1-james@equiv.tech [groeck: Set error return value for intrusion writes to -EINVAL. Always accept writes of 0 even if there was no intrusion. ] Signed-off-by: Guenter Roeck commit 7590e659e063dc45a5743bb4e5eb4a21ee1fd651 Author: Joaquín Ignacio Aramendía Date: Thu May 25 11:26:52 2023 -0300 hwmon: (oxp-sensors) Stop passing device structure We don't need to pass device structure to write_to_ec() so we remove that from the function declaration. The same is valid for pwm_enable() and pwm_disable() as we were passing the pointer to hand it off to write_to_ec(). Signed-off-by: Joaquín Ignacio Aramendía Link: https://lore.kernel.org/r/20230525142652.41981-1-samsagax@gmail.com Signed-off-by: Guenter Roeck commit 16d60ba8fdc4c6e4745005889dea6ed82b6b5cbd Author: Daniel Matyas Date: Wed May 24 19:01:30 2023 +0300 hwmon: Add MAX31827 driver MAX31827 is a low-power temperature switch with I2C interface. The device is a ±1°C accuracy from -40°C to +125°C (12 bits) local temperature switch and sensor with I2C/SM- Bus interface. The combination of small 6-bump wafer-lev- el package (WLP) and high accuracy makes this temper- ature sensor/switch ideal for a wide range of applications. Signed-off-by: Daniel Matyas Link: https://lore.kernel.org/r/20230524160131.14081-2-daniel.matyas@analog.com [groeck: Improved define alignment, return -EINVAL after bad user input, fixed up compatible statement] Signed-off-by: Guenter Roeck commit 9702fc8768ee7262aa2f672d77c1062eba761cf9 Author: Daniel Matyas Date: Wed May 24 19:01:29 2023 +0300 dt-bindings: hwmon: add MAX31827 MAX31827 is a low-power temperature switch with I2C interface. The device is a ±1°C accuracy from -40°C to +125°C (12 bits) local temperature switch and sensor with I2C/SM- Bus interface. The combination of small 6-bump wafer-lev- el package (WLP) and high accuracy makes this temper- ature sensor/switch ideal for a wide range of applications. Signed-off-by: Daniel Matyas Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230524160131.14081-1-daniel.matyas@analog.com Signed-off-by: Guenter Roeck commit d2abcb5cc88577f996ab505c8102254aba7062d8 Author: Kirill Yatsenko Date: Wed May 24 22:19:12 2023 +0200 hwmon: (aht10) Add support for compatible aht20 Add support for compatible AHT20 temperature/humidity sensor. The only difference between the two is that AHT20 has additional crc8 byte. It seems like AHT15 is also supported by the driver but it wasn't verified and tested yet. Tested on Beaglebone black rev C. Signed-off-by: Kirill Yatsenko Link: https://lore.kernel.org/r/20230524201912.815993-1-kiriyatsenko@gmail.com Signed-off-by: Guenter Roeck commit 7d0c2c61b1a4d1cf5641b35b491fe58ffafe26bc Author: Joaquín Ignacio Aramendía Date: Wed May 17 15:35:41 2023 -0300 hwmon: (oxp-sensors) Add new DMI match for OXP Mini A newer BIOS version for the OneXPlayer Mini AMD modified vendor and board name strings. Add those to the match table and set the same board model as older OXP Mini AMD. Signed-off-by: Joaquín Ignacio Aramendía Link: https://lore.kernel.org/r/20230517183540.187383-1-samsagax@gmail.com Signed-off-by: Guenter Roeck commit b3d3be6c4cd1908b9ffdb3d347de232a6c34a0a9 Author: Aleksa Savic Date: Sat May 20 11:54:47 2023 +0200 hwmon: (aquacomputer_d5next) Add support for Aquacomputer Leakshield Extend aquacomputer_d5next driver to expose various hardware sensors of the Aquacomputer Leakshield leak prevention system, which communicates through a proprietary USB HID protocol. Implemented by Noah Bergbauer [1]. Two temperature sensors are exposed, along with pressure (current, min, max and target), reservoir volume (total and filled), pump speed and flow. Pump speed and flow values are user provided and allow the Leakshield to optimize its operation. Writing them to the device is subject of future patches. [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/pull/41 Originally-from: Noah Bergbauer Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/20230520095447.509287-3-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck commit fdbfd330c43034e539692c3798bc38736dd1f1c7 Author: Aleksa Savic Date: Sat May 20 11:54:46 2023 +0200 hwmon: (aquacomputer_d5next) Rename AQC_TEMP_SENSOR_DISCONNECTED Rename the macro in question to AQC_SENSOR_NA because more than just temperature sensors use this value to indicate that they don't have a reading. Implemented by Noah Bergbauer [1]. [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/pull/41 Originally-from: Noah Bergbauer Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/20230520095447.509287-2-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck commit 014714b8a62107d22bd2a089801bbfb4bb6412ae Author: Kirill Yatsenko Date: Thu May 11 22:26:32 2023 +0200 hwmon: (aht10) Refactor aht10_read_values function Exit from the function immediately if the poll time hasn't yet expired. Therefore the code after the check can be moved one tab to the left which improves readability. Signed-off-by: Kirill Yatsenko Link: https://lore.kernel.org/r/20230511202633.299174-2-kiriyatsenko@gmail.com [groeck: Dropped else after return] Signed-off-by: Guenter Roeck commit 0cb01ec31529096b6460290963bf78c9146d83b7 Author: Kirill Yatsenko Date: Thu May 11 22:26:31 2023 +0200 hwmon: (aht10) Fix typos in comments Fix typos in the description of the return value section of the functions. The word 'succesfull' is incorrect, it should be 'successful'. Signed-off-by: Kirill Yatsenko Link: https://lore.kernel.org/r/20230511202633.299174-1-kiriyatsenko@gmail.com Signed-off-by: Guenter Roeck commit 3b9da0422a7b597cfde3d9d7dfec0b5b065c4824 Author: James Seo Date: Sun May 7 08:10:53 2023 -0700 hwmon: (core) Finish renaming groups parameter in API to extra_groups Commit 848ba0a2f20d ("hwmon: (core) Rename groups parameter in API to extra_groups") renames the 'groups' parameter of devm_hwmon_device_register_with_info() to 'extra_groups' in hwmon-kernel-api.txt (later .rst) and hwmon.h, but this change was not propagated to the function code itself in hwmon.c. Finish the job. Note that hwmon_device_register_with_info() has the same parameter, and the name of that parameter was changed in all three files. Harmonizing the name between these related functions also removes a potential source of confusion. Signed-off-by: James Seo Link: https://lore.kernel.org/r/20230507151051.1861929-1-james@equiv.tech [groeck: Fixed up SHA reference in description] Signed-off-by: Guenter Roeck commit fe6ac23777ef70c17aa7333400ede88e364fbd36 Author: James Seo Date: Sun May 7 08:22:17 2023 -0700 hwmon: (core) Add missing beep-related standard attributes beep_enable, inX_beep, currX_beep, fanX_beep, and tempX_beep are standard attributes mentioned in the sysfs interface specification but not implemented in the hwmon core. Since these are not deprecated, implement them. Adding beep_mask is not necessary, as it is deprecated and the drivers already using it are manually defining it. Signed-off-by: James Seo Link: https://lore.kernel.org/r/20230507152216.1862653-1-james@equiv.tech Signed-off-by: Guenter Roeck commit 7c415ed8673470fbe18ce4a3694e5776d4db2456 Author: Gopal Prasad Date: Wed May 17 09:50:25 2023 +0530 hwmon: (nct6683) Add another customer ID for NCT6687D sensor chip on some MSI boards. This value was found on a MSI Z690-A PRO DDR5 with NCT6687D. Signed-off-by: Gopal Prasad Link: https://lore.kernel.org/r/20230517042025.16942-1-llyyr.public@gmail.com Signed-off-by: Guenter Roeck commit 6d3b8bc508784f62acd2d25acb253244bbcc3f69 Author: James Seo Date: Thu May 4 00:57:42 2023 -0700 Documentation/hwmon: Move misplaced entry in hwmon docs index Move the entry for the inspur-ipsps1 driver so that it no longer appears in the hwmon docs TOC as a document relating to the hwmon subsystem itself. Signed-off-by: James Seo Reviewed-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20230504075752.1320967-2-james@equiv.tech Signed-off-by: Guenter Roeck commit 1975d167869ef03102771d6267582623d6e07058 Author: Uwe Kleine-König Date: Fri May 5 15:17:18 2023 +0200 hwmon: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230505131718.1210071-1-u.kleine-koenig@pengutronix.de [groeck: Added missing change in pmbus/acbel-fsg032.c] Signed-off-by: Guenter Roeck commit 339c8f2484a110fd94af4d045e2be9bf25800381 Author: Frank Crawford Date: Sun Apr 30 14:50:32 2023 +1000 hwmon: (it87) Allow for chips with only 4 temp sensors Some chips are known to only have 4 temperature sensors and there is no requirement to test for more. Currently only the IT8622E fits this category. Signed-off-by: Frank Crawford Link: https://lore.kernel.org/r/20230430045032.1723288-1-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck commit 6a01a12d7e1609defa9a025e22e8730008a62104 Author: Chris Packham Date: Wed Apr 19 11:36:56 2023 +1200 hwmon: (adt7475) Convert to use device_property APIs Instead of of_property_read_*() use the equivalent device_property_read_*() API. This will allow these properties to be used on DT unaware platforms. For DT aware platforms this will be a noop. Signed-off-by: Chris Packham Link: https://lore.kernel.org/r/20230418233656.869055-3-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck commit bd5940221b7d49addfa5e80f3cf8fcd7cedd4dc5 Author: Frank Crawford Date: Sat Apr 29 21:52:05 2023 +1000 hwmon: (it87) Update IT8732F chip for 4 fans and PWMs Add support for 4 fans and 4 PWMs to chipset IT8732F. Signed-off-by: Frank Crawford Link: https://lore.kernel.org/r/20230429115205.1547251-4-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck commit 39a6dcf640a5fc0aa880a8cf8871755fdbd42a5e Author: Frank Crawford Date: Sat Apr 29 21:52:04 2023 +1000 hwmon: (it87) Add controls for chips with only 4 PWMs Add feature and support for chips with only 4 PWMs. Signed-off-by: Frank Crawford Link: https://lore.kernel.org/r/20230429115205.1547251-3-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck commit 5a4417bc67cd2cb24667f226667dba66d284de8b Author: Frank Crawford Date: Sat Apr 29 21:52:03 2023 +1000 hwmon: (it87) Add controls for chips with only 4 fans Add feature and support for chips with only 4 fans. Reorder macro definitions to bring all fan definitions together. Signed-off-by: Frank Crawford Link: https://lore.kernel.org/r/20230429115205.1547251-2-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck commit 5d06ec4279a8605b0fa53dd649d7feda3f06d0c2 Author: Joaquín Ignacio Aramendía Date: Sat Apr 29 11:25:48 2023 -0300 hwmon: (oxp-sensors) Use less convoluted enum cast Change .driver_data = (void *) &(enum type) {enum_literal}; to more readable form: .driver_data = (void *) enum_literal; and corresponding cast usage as board type flag. Signed-off-by: Joaquín Ignacio Aramendía Link: https://lore.kernel.org/r/20230429142547.328125-1-samsagax@gmail.com [groeck: Use double cast for assignment from driver_data to fix clang build warning] Signed-off-by: Guenter Roeck commit 790dec13c0128dfec5b6bf28bef433661875e634 Author: Michael Carns Date: Wed Apr 26 22:03:44 2023 +0200 hwmon: (asus-ec-sensors) add ROG Crosshair X670E Hero. Only the temp sensors that I can verify are present. HWINFO in Windows shows other accumulated data and statistics (time since installed, total power used, etc) that I have not attempted to find. Signed-off-by: Michael Carns Signed-off-by: Eugene Shalygin Link: https://lore.kernel.org/r/20230426200345.65765-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck commit f415cb6c0ffece69eb60eca9750a2877c7985c89 Author: Joaquín Ignacio Aramendía Date: Wed Apr 26 15:44:20 2023 -0300 hwmon: (oxp-sensors) Add AYANEO 2 and Geek models Add support for handhelds with same EC registers - AYANEO 2 - AYANEO GEEK All functionality tests succeed on AYANEO 2 by "pastaq" user on Discord and AYANEO GEEK tested by "oneoc" Discord user. Signed-off-by: Joaquín Ignacio Aramendía Link: https://lore.kernel.org/r/20230426184420.99945-1-samsagax@gmail.com Signed-off-by: Guenter Roeck commit b153a0bb4199566abd337119207f82b59a8cd1ca Author: Guenter Roeck Date: Fri Jun 2 14:34:47 2023 -0700 hwmon: (pmbus/adm1275) Fix problems with temperature monitoring on ADM1272 The PMON_CONFIG register on ADM1272 is a 16 bit register. Writing a 8 bit value into it clears the upper 8 bits of the register, resulting in unexpected side effects. Fix by writing the 16 bit register value. Also, it has been reported that temperature readings are sometimes widely inaccurate, to the point where readings may result in device shutdown due to errant overtemperature faults. Improve by enabling temperature sampling. While at it, move the common code for ADM1272 and ADM1278 into a separate function, and clarify in the error message that an attempt was made to enable both VOUT and temperature monitoring. Last but not least, return the error code reported by the underlying I2C controller and not -ENODEV if updating the PMON_CONFIG register fails. After all, this does not indicate that the chip is not present, but an error in the communication with the chip. Fixes: 4ff0ce227a1e ("hwmon: (pmbus/adm1275) Add support for ADM1272") Fixes: 9da9c2dc57b2 ("hwmon: (adm1275) enable adm1272 temperature reporting") Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20230602213447.3557346-1-linux@roeck-us.net Signed-off-by: Guenter Roeck commit a6d80df47ee2c69db99e4f2f8871aa4db154620b Author: Tim Harvey Date: Tue Jun 6 08:30:04 2023 -0700 hwmon: (gsc-hwmon) fix fan pwm temperature scaling The GSC fan pwm temperature register is in centidegrees celcius but the Linux hwmon convention is to use milidegrees celcius. Fix the scaling. Fixes: 3bce5377ef66 ("hwmon: Add Gateworks System Controller support") Signed-off-by: Tim Harvey Link: https://lore.kernel.org/r/20230606153004.1448086-1-tharvey@gateworks.com Signed-off-by: Guenter Roeck commit 4bb218a65a43782b1e75f5510744cb44795a1105 Author: Christoph Hellwig Date: Thu Jun 8 14:29:58 2023 +0200 fs: unexport buffer_check_dirty_writeback buffer_check_dirty_writeback is only used by the block device aops, remove the export. Signed-off-by: Christoph Hellwig Message-Id: <20230608122958.276954-1-hch@lst.de> Signed-off-by: Christian Brauner commit bfd019d10fdabf70f9b01264aea6d6c7595f9226 Merge: b62d9e2004920 c662b043cdca8 Author: Paolo Abeni Date: Thu Jun 8 13:42:54 2023 +0200 Merge branch 'crypto-splice-net-make-af_alg-handle-sendmsg-msg_splice_pages' David Howells says: ==================== crypto, splice, net: Make AF_ALG handle sendmsg(MSG_SPLICE_PAGES) Here are patches to make AF_ALG handle the MSG_SPLICE_PAGES internal sendmsg flag. MSG_SPLICE_PAGES is an internal hint that tells the protocol that it should splice the pages supplied if it can. The sendpage functions are then turned into wrappers around that. This set consists of the following parts: (1) Move netfs_extract_iter_to_sg() to somewhere more general and rename it to drop the "netfs" prefix. We use this to extract directly from an iterator into a scatterlist. (2) Make AF_ALG use iov_iter_extract_pages(). This has the additional effect of pinning pages obtained from userspace rather than taking refs on them. Pages from kernel-backed iterators would not be pinned, but AF_ALG isn't really meant for use by kernel services. (3) Change AF_ALG still further to use extract_iter_to_sg(). (4) Make af_alg_sendmsg() support MSG_SPLICE_PAGES support and make af_alg_sendpage() just a wrapper around sendmsg(). This has to take refs on the pages pinned for the moment. (5) Make hash_sendmsg() support MSG_SPLICE_PAGES by simply ignoring it. hash_sendpage() is left untouched to be removed later, after the splice core has been changed to call sendmsg(). ==================== Link: https://lore.kernel.org/r/20230606130856.1970660-1-dhowells@redhat.com Signed-off-by: Paolo Abeni commit c662b043cdca89bf0f03fc37251000ac69a3a548 Author: David Howells Date: Tue Jun 6 14:08:56 2023 +0100 crypto: af_alg/hash: Support MSG_SPLICE_PAGES Make AF_ALG sendmsg() support MSG_SPLICE_PAGES in the hashing code. This causes pages to be spliced from the source iterator if possible. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Herbert Xu cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org Acked-by: Herbert Xu Signed-off-by: Paolo Abeni commit fb800fa4c1f5aee1238267252e88a7837e645c02 Author: David Howells Date: Tue Jun 6 14:08:55 2023 +0100 crypto: af_alg: Convert af_alg_sendpage() to use MSG_SPLICE_PAGES Convert af_alg_sendpage() to use sendmsg() with MSG_SPLICE_PAGES rather than directly splicing in the pages itself. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Herbert Xu cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org Acked-by: Herbert Xu Signed-off-by: Paolo Abeni commit bf63e250c4b1f21696599e0ab7117f4429dcbdc0 Author: David Howells Date: Tue Jun 6 14:08:54 2023 +0100 crypto: af_alg: Support MSG_SPLICE_PAGES Make AF_ALG sendmsg() support MSG_SPLICE_PAGES. This causes pages to be spliced from the source iterator. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Herbert Xu cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org Acked-by: Herbert Xu Signed-off-by: Paolo Abeni commit 73d7409cfdad7fd08a9203eb2912c1c77e527776 Author: David Howells Date: Tue Jun 6 14:08:53 2023 +0100 crypto: af_alg: Indent the loop in af_alg_sendmsg() Put the loop in af_alg_sendmsg() into an if-statement to indent it to make the next patch easier to review as that will add another branch to handle MSG_SPLICE_PAGES to the if-statement. Signed-off-by: David Howells cc: Herbert Xu cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org Acked-by: Herbert Xu Signed-off-by: Paolo Abeni commit c1abe6f570aff4b6d396dc551e60570d2f50bd79 Author: David Howells Date: Tue Jun 6 14:08:52 2023 +0100 crypto: af_alg: Use extract_iter_to_sg() to create scatterlists Use extract_iter_to_sg() to decant the destination iterator into a scatterlist in af_alg_get_rsgl(). af_alg_make_sg() can then be removed. Signed-off-by: David Howells cc: Herbert Xu cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org Acked-by: Herbert Xu Signed-off-by: Paolo Abeni commit f9e7a5fa51fbb6fcb9c1c7e2c89dd7df9e7fe253 Author: David Howells Date: Tue Jun 6 14:08:51 2023 +0100 crypto: af_alg: Pin pages rather than ref'ing if appropriate Convert AF_ALG to use iov_iter_extract_pages() instead of iov_iter_get_pages(). This will pin pages or leave them unaltered rather than getting a ref on them as appropriate to the iterator. The pages need to be pinned for DIO-read rather than having refs taken on them to prevent VM copy-on-write from malfunctioning during a concurrent fork() (the result of the I/O would otherwise end up only visible to the child process and not the parent). Signed-off-by: David Howells cc: Herbert Xu cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org Acked-by: Herbert Xu Signed-off-by: Paolo Abeni commit f5f82cd18732d828bcd1ec308c4e8c55012e84b0 Author: David Howells Date: Tue Jun 6 14:08:50 2023 +0100 Move netfs_extract_iter_to_sg() to lib/scatterlist.c Move netfs_extract_iter_to_sg() to lib/scatterlist.c as it's going to be used by more than just network filesystems (AF_ALG, for example). Signed-off-by: David Howells cc: Jeff Layton cc: Steve French cc: Shyam Prasad N cc: Rohith Surabattula cc: Jens Axboe cc: Herbert Xu cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Matthew Wilcox cc: linux-crypto@vger.kernel.org cc: linux-cachefs@redhat.com cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: netdev@vger.kernel.org Signed-off-by: Paolo Abeni commit 936dc763c52e05cb2e7302af30a69c826916d89e Author: David Howells Date: Tue Jun 6 14:08:49 2023 +0100 Wrap lines at 80 Wrap a line at 80 to stop checkpatch complaining. Signed-off-by: David Howells cc: Jeff Layton cc: Steve French cc: Shyam Prasad N cc: Rohith Surabattula cc: Jens Axboe cc: Herbert Xu cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Matthew Wilcox cc: Simon Horman cc: linux-crypto@vger.kernel.org cc: linux-cachefs@redhat.com cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: netdev@vger.kernel.org Signed-off-by: Paolo Abeni commit 3b9e9f72badfbb03415459126498d524bcb25225 Author: David Howells Date: Tue Jun 6 14:08:48 2023 +0100 Fix a couple of spelling mistakes Fix a couple of spelling mistakes in a comment. Suggested-by: Simon Horman Link: https://lore.kernel.org/r/ZHH2mSRqeL4Gs1ft@corigine.com/ Link: https://lore.kernel.org/r/ZHH1nqZWOGzxlidT@corigine.com/ Signed-off-by: David Howells Reviewed-by: Simon Horman cc: Jeff Layton cc: Steve French cc: Shyam Prasad N cc: Rohith Surabattula cc: Jens Axboe cc: Herbert Xu cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Matthew Wilcox cc: linux-crypto@vger.kernel.org cc: linux-cachefs@redhat.com cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: netdev@vger.kernel.org Signed-off-by: Paolo Abeni commit 0d7aeb68700ff87b4d2acafb789408a065225e1e Author: David Howells Date: Tue Jun 6 14:08:47 2023 +0100 Drop the netfs_ prefix from netfs_extract_iter_to_sg() Rename netfs_extract_iter_to_sg() and its auxiliary functions to drop the netfs_ prefix. Signed-off-by: David Howells cc: Jeff Layton cc: Steve French cc: Shyam Prasad N cc: Rohith Surabattula cc: Jens Axboe cc: Herbert Xu cc: "Matthew Wilcox (Oracle)" cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-crypto@vger.kernel.org cc: linux-cachefs@redhat.com cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: netdev@vger.kernel.org Signed-off-by: Paolo Abeni commit 038306aabee6947bf925659563adac38c74200cf Author: Uday M Bhat Date: Wed Jun 7 10:06:32 2023 +0800 soundwire: debugfs: Add missing SCP registers SCP registers needs to be updated to accommodate additional register entries as per the Soundwire 1.2 specification. Signed-off-by: Uday M Bhat Signed-off-by: Yong Zhi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230607020632.1030309-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 0cbcced983e763f33c24a6834ed0d7c13152a0bb Author: Charles Keepax Date: Fri Jun 2 11:11:40 2023 +0100 soundwire: stream: Remove unnecessary gotos There is a lot of code using gotos to skip small sections of code, this is a fairly dubious use of a goto, especially when the level of intentation is really low. Most of this code doesn't even breach 80 characters when naively shifted over. Simplify the code a bit, by replacing these unnecessary gotos with simple ifs. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602101140.2040141-5-ckeepax@opensource.cirrus.com Signed-off-by: Vinod Koul commit e0240644e7cbb0fce4ea4e3fdcefdaa1a39eb9ea Author: Charles Keepax Date: Fri Jun 2 11:11:39 2023 +0100 soundwire: stream: Invert logic on runtime alloc flags sdw_stream_add_slave/master have flags to indicate if the master or slave runtime where allocated in that call to the function. Currently these flags are cleared on all the paths where the runtime is not allocated, it is more logic and simpler to set the flag on the one path where the runtime is allocated. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602101140.2040141-4-ckeepax@opensource.cirrus.com Signed-off-by: Vinod Koul commit 2b2da40979dde8466dd1b7b5969af5fa5aa52cbd Author: Charles Keepax Date: Fri Jun 2 11:11:38 2023 +0100 soundwire: stream: Remove unneeded checks for NULL bus Version of the code prior to commit d014688eb373 ("soundwire: stream: remove bus->dev from logs on multiple buses"), used bus->dev in the error message after do_bank_switch, this necessitated some checking to ensure the bus pointer was valid. As the code no longer uses bus->dev said checking is now redundant, so remove it. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602101140.2040141-3-ckeepax@opensource.cirrus.com Signed-off-by: Vinod Koul commit 6eedc227241eb59dc05636e8aaed7b0195bc4a5c Author: Charles Keepax Date: Fri Jun 2 11:11:37 2023 +0100 soundwire: bandwidth allocation: Remove pointless variable The block_offset variable in _sdw_compute_port_params adds nothing either functionally or in terms of code clarity, remove it. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20230602101140.2040141-2-ckeepax@opensource.cirrus.com Signed-off-by: Vinod Koul commit c05bfbd0c62baa052a04a566525611ab932b50a2 Merge: 94f89950850e1 58d95889f3c20 Author: Vinod Koul Date: Thu Jun 8 17:08:33 2023 +0530 Merge branch 'fixes' into next This resolves dependecy for the series 20230602101140.2040141-1-ckeepax@opensource.cirrus.com commit 67faabbde36b7dc006cb0a71811098e7277976d0 Author: Jiri Olsa Date: Wed Jun 7 15:40:46 2023 -0700 selftests/bpf: Add missing prototypes for several test kfuncs Adding missing prototypes for several kfuncs that are used by test_verifier tests. We don't really need kfunc prototypes for these tests, but adding them to silence 'make W=1' build and to have all test kfuncs declarations in bpf_testmod_kfunc.h. Also moving __diag_pop for -Wmissing-prototypes to cover also bpf_testmod_test_write and bpf_testmod_test_read and adding bpf_fentry_shadow_test in there as well. All of them need to be exported, but there's no need for declarations. Fixes: 65eb006d85a2 ("bpf: Move kernel test kfuncs to bpf_testmod") Reported-by: kernel test robot Signed-off-by: Jiri Olsa Signed-off-by: Daniel Borkmann Closes: https://lore.kernel.org/oe-kbuild-all/202306051319.EihCQZPs-lkp@intel.com Link: https://lore.kernel.org/bpf/20230607224046.236510-1-jolsa@kernel.org commit b62d9e20049209c3d4a15835a9473594d75641eb Merge: 4a56212774acf 08f08f9390e4d Author: Paolo Abeni Date: Thu Jun 8 13:25:14 2023 +0200 Merge branch 'txgbe-phylink-support' Jiawen Wu says: ==================== TXGBE PHYLINK support Implement I2C, SFP, GPIO and PHYLINK to setup TXGBE link. Because our I2C and PCS are based on Synopsys Designware IP-core, extend the i2c-designware and pcs-xpcs driver to realize our functions. ==================== Link: https://lore.kernel.org/r/20230606092107.764621-1-jiawenwu@trustnetic.com Signed-off-by: Paolo Abeni commit 08f08f9390e4d7770e400b98eb4a25909593508e Author: Jiawen Wu Date: Tue Jun 6 17:21:07 2023 +0800 net: txgbe: Support phylink MAC layer Add phylink support to Wangxun 10Gb Ethernet controller for the 10GBASE-R interface. Signed-off-by: Jiawen Wu Reviewed-by: Maciej Fijalkowski Signed-off-by: Paolo Abeni commit 854cace61387b6f60734d9ec254443a6894c480d Author: Jiawen Wu Date: Tue Jun 6 17:21:06 2023 +0800 net: txgbe: Implement phylink pcs Register MDIO bus for PCS layer to use Synopsys designware XPCS, support 10GBASE-R interface to the controller. Signed-off-by: Jiawen Wu Reviewed-by: Andrew Lunn Reviewed-by: Maciej Fijalkowski Signed-off-by: Paolo Abeni commit af8de1e307bf1ecbd17d220122832cd093f7a3f8 Author: Jiawen Wu Date: Tue Jun 6 17:21:05 2023 +0800 net: pcs: Add 10GBASE-R mode for Synopsys Designware XPCS Add basic support for XPCS using 10GBASE-R interface. This mode will be extended to use interrupt, so set pcs.poll false. And avoid soft reset so that the device using this mode is in the default configuration. Signed-off-by: Jiawen Wu Reviewed-by: Andrew Lunn Reviewed-by: Maciej Fijalkowski Signed-off-by: Paolo Abeni commit b83c37315a620fc8dcb5f3cffe4753765228d1f4 Author: Jiawen Wu Date: Tue Jun 6 17:21:04 2023 +0800 net: txgbe: Support GPIO to SFP socket Register GPIO chip and handle GPIO IRQ for SFP socket. Signed-off-by: Jiawen Wu Reviewed-by: Andy Shevchenko Reviewed-by: Maciej Fijalkowski Signed-off-by: Paolo Abeni commit 04d94236182e4f46bea6a48e3830b27f361f090f Author: Jiawen Wu Date: Tue Jun 6 17:21:03 2023 +0800 net: txgbe: Add SFP module identify Register SFP platform device to get modules information. Signed-off-by: Jiawen Wu Reviewed-by: Andrew Lunn Reviewed-by: Piotr Raczynski Reviewed-by: Maciej Fijalkowski Signed-off-by: Paolo Abeni commit c625e72561f6c9bd5d1a86aa4d1d5a68db43d2e0 Author: Jiawen Wu Date: Tue Jun 6 17:21:02 2023 +0800 net: txgbe: Register I2C platform device Register the platform device to use Designware I2C bus master driver. Use regmap to read/write I2C device region from given base offset. Signed-off-by: Jiawen Wu Reviewed-by: Andrew Lunn Reviewed-by: Piotr Raczynski Reviewed-by: Andy Shevchenko Reviewed-by: Maciej Fijalkowski Signed-off-by: Paolo Abeni commit b63f20485e433e6e548df81f5c76556d7f187266 Author: Jiawen Wu Date: Tue Jun 6 17:21:01 2023 +0800 net: txgbe: Register fixed rate clock In order for I2C to be able to work in standard mode, register a fixed rate clock for each I2C device. Signed-off-by: Jiawen Wu Reviewed-by: Andrew Lunn Reviewed-by: Maciej Fijalkowski Signed-off-by: Paolo Abeni commit c3e382ad6d15a8041ab8a168ad3ff90137ee8a45 Author: Jiawen Wu Date: Tue Jun 6 17:21:00 2023 +0800 net: txgbe: Add software nodes to support phylink Register software nodes for GPIO, I2C, SFP and PHYLINK. Define the device properties. Signed-off-by: Jiawen Wu Reviewed-by: Andrew Lunn Reviewed-by: Piotr Raczynski Reviewed-by: Maciej Fijalkowski Signed-off-by: Paolo Abeni commit 41a343cd6b7f8d0f70dd90c236086ccf8a84a7de Author: Christophe JAILLET Date: Thu Jun 8 07:27:22 2023 +0200 ASoC: tegra: Simplify code around clk_get_rate() handling clk_get_rate() returns an unsigned long, so there is no point in storing it in a long, and test for negative values. So, turn 'parent_rate' into an unsigned long, simplify the sanity check, the error message and the return value, in case of error (i.e. 0). Doing so also turns 'i' and 'valid_rates' into unsigned long, but it is fine and harmless. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/53f928290f08f50ff43031e17fe1d88443c2c441.1686202022.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 3b3a8d6d34a3ace4d49beb6f69ebb0d3cfaf0479 Author: Jiapeng Chong Date: Thu Jun 8 15:55:40 2023 +0800 ASoC: max98088: clean up some inconsistent indenting No functional modification involved. sound/soc/codecs/max98088.c:316 m98088_eq_band() warn: inconsistent indenting. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5461 Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20230608075540.61575-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Mark Brown commit b0e2e4fb8a5467f4f64bcf64d1454d18cb665cc8 Author: AngeloGioacchino Del Regno Date: Thu Jun 8 10:47:27 2023 +0200 ASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers Replace open coded instances of FIELD_GET() with it, move register definitions at the top of the file and also replace magic numbers with register definitions. While at it, also change a regmap_update_bits() call to regmap_write() because the top 29 bits of AUD_TOP_CFG (31:3) are reserved (unused). Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230608084727.74403-6-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit acb43baf8b7e75acdb14920de29881e3f70c6819 Author: AngeloGioacchino Del Regno Date: Thu Jun 8 10:47:26 2023 +0200 ASoC: mediatek: mt8188-mt6359: Clean up log levels Change some dev_info prints to dev_err() and some to dev_dbg(), depending on the actual severity of them. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230608084727.74403-5-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 4882ef44f51bbb759b8a738b747fdbcbad38e51b Author: AngeloGioacchino Del Regno Date: Thu Jun 8 10:47:25 2023 +0200 ASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return ret Change all instances of `return ret` to `return 0` at the end of functions where ret is always zero and also change functions mt8188_{hdmi,dptx}_codec_init to be consistent with how other functions are returning errors Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230608084727.74403-4-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 1148b42257e2bf30093708398db2c4570ae9fe97 Author: Dan Carpenter Date: Thu Jun 8 10:47:24 2023 +0200 ASoC: mediatek: mt8188-mt6359: clean up a return in codec_init This code triggers a Smatch static checker warning and does sort of look like an error path. sound/soc/mediatek/mt8188/mt8188-mt6359.c:597 mt8188_max98390_codec_init() warn: missing error code? 'ret' However, returning 0 is intentional. Make that explicit. Signed-off-by: Dan Carpenter Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230608084727.74403-3-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 22628e92d76a403181916f7bac7848dd2326d750 Author: AngeloGioacchino Del Regno Date: Thu Jun 8 10:47:23 2023 +0200 ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries Those entries fit in one line: compress them to reduce line count. While at it, also add the sentinel comment to the last entry. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230608084727.74403-2-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 076c74c592cabe4a47537fe5205b5b678bed010d Author: Olivier Moysan Date: Tue Jun 6 13:56:04 2023 +0200 ARM: dts: stm32: fix i2s endpoint format property for stm32mp15xx-dkx Use "dai-format" to configure DAI audio format as specified in audio-graph-port.yaml bindings. Fixes: 144d1ba70548 ("ARM: dts: stm32: Adapt STM32MP157 DK boards to stm32 DT diversity") Signed-off-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit e6f49e96bc57d34fc0f617f37bfdf62a9b58d2c2 Author: Dani Liberman Date: Mon May 22 17:15:36 2023 +0300 accel/habanalabs: refactor error info reset Moved error info reset code to single function for future use from other places in the driver. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit fac91dd54f3b6f5dbd20c1cb26e59eceb128ca42 Author: Ofir Bitton Date: Sun May 21 10:24:13 2023 +0300 accel/habanalabs: add event queue extra validation In order to increase reliability of the event queue interface, we apply to Gaudi2 the same mechanism we have in Gaudi1. The extra validation is basically checking that the received event index matches the expected index. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 19aa21b9807ad277972f7ebe8a8dd9fbf9063bc8 Author: Ofir Bitton Date: Mon May 22 08:52:46 2023 +0300 accel/habanalabs: unsecure TSB_CFG_MTRR regs In order to utilize Engine Barrier padding, user must have access to this register set. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ff5c702522bb01d8d28da98b508168b391600080 Author: Oded Gabbay Date: Thu May 18 10:59:38 2023 +0300 accel/habanalabs: move ioctl error print to debug level We don't want to allow users to spam the kernel log and sending ioctls with bad opcodes is a sure way to do it. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit 8a20b381644528794a78f791fd1a7ae87f3fc6ff Author: Ofir Bitton Date: Wed May 17 20:47:44 2023 +0300 accel/habanalabs: fix bug of not fetching addr_dec info addr_dec info should always be fetched, regardless of cause value. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 92a3a9b1a3997cf67aca7874e7f61b102ea2f27c Author: Dani Liberman Date: Thu Apr 20 19:33:34 2023 +0300 accel/habanalabs: add description to several info ioctls Several info ioctls may return success although no data retrieved. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 569210233a31fa23932b269779144252ce7bfee9 Author: Oded Gabbay Date: Mon May 22 14:09:21 2023 +0300 accel/habanalabs: remove sim code There were a few places where simulator only code got into the upstream. Remove those places that can confuse other developers. Fixes: 2a0a839b6a28 ("habanalabs: extend fatal messages to contain PCI info") Cc: Moti Haimovski Cc: Dan Carpenter Signed-off-by: Oded Gabbay commit 5d658d0c5137f709e9888f2f3687afbde38b5ac0 Author: Dani Liberman Date: Mon May 8 11:06:17 2023 +0300 accel/habanalabs: mask part of hmmu page fault captured address When receiving page fault from hmmu, the captured address is scrambled both by HW and by driver. The driver part is unscrambled but the HW part isn't getting unscrambled. To avoid declaring wrong address, the HW scrambled part will be masked. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 7e63f317c0c3eb72e745ce3509299800ef54d6de Author: Koby Elbaz Date: Wed May 10 10:15:22 2023 +0300 accel/habanalabs: update state when loading boot fit Any FW component we load must be followed by a corresponding state update. However, it seems that so far we skipped doing so for the bootfit case, so fix that. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 6092cedfff1180b0d0aea402a198397fff609c71 Author: Tomer Tayar Date: Wed May 10 13:28:05 2023 +0300 accel/habanalabs: print qman data on error only for lower qman By default, the upper QMANs are not used, and instead engines ARCs access the lower QMANs directly. Errors for upper QMANs are therefore not expected, and the debug print of the PQ entries is not needed. Modify the QMAN debug data print on errors to include only information for the lower QMAN. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 54381ee8099839c8163cee45b65d824ca76186a2 Author: Tomer Tayar Date: Wed May 10 13:34:28 2023 +0300 accel/habanalabs: use lower QM in QM errors handling The QMAN GLBL_ERR_STS_4 register has indications for errors also in the lower CQ and the ARC CQ, and not just for errors in the lower CP. Modify the relevant define/struct and the related print to use "lower QM" instead of "lower CP". Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit dcc8fa88d46ef97ea9812735d0d54591bc16b242 Author: Dani Liberman Date: Mon May 8 17:24:38 2023 +0300 accel/habanalabs: use binning info when handling razwi When receiving sei interrupt from tpc or decoder, we need to check the binning mask because if the engine is binned, the razwi info won't be in the router of the binned engine, instead will be in the router of the substitute engine. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 583f12a80dfb7997d59a42e8642019695f5aa15a Author: Ofir Bitton Date: Tue May 9 14:02:49 2023 +0300 accel/habanalabs: remove support for mmu disable As mmu disable mode is only used for bring-up stages, let's remove this option and all code related to it. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit b2d61fecb443c10f116fa00a1b9b5677a5822e52 Author: Koby Elbaz Date: Tue May 2 17:28:56 2023 +0300 accel/habanalabs: upon DMA errors, use FW-extracted error cause Initially, the driver used to read the error cause data directly from the ASIC. However, the FW now clears it before the driver could read it. Therefore we should use the error cause data that is extracted by the FW. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit adda800c049a4580aaec4d710a9972cdad5b14e3 Author: Oded Gabbay Date: Wed May 3 14:47:54 2023 +0300 accel/habanalabs: print max timeout value on CS stuck If a workload got stuck, we print an error to the kernel log about it. Add to that print the configured max timeout value, as that value is not fixed between ASICs and in addition it can be configured using a kernel module parameter. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit dcfce96ee834de6f9223670f3d2e1440559fb9b6 Author: Oded Gabbay Date: Mon May 1 13:19:57 2023 +0300 accel/habanalabs: align to latest firmware specs Update the firmware common interface files with the latest version. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit 314a7ffd7c196b27eedd50cb7553029e17789b55 Author: Moti Haimovski Date: Sun Apr 16 18:36:17 2023 +0300 accel/habanalabs: fix mem leak in capture user mappings This commit fixes a memory leak caused when clearing the user_mappings info when a new context is opened immediately after user_mapping is captured and a hard reset is performed. Signed-off-by: Moti Haimovski Reviewed-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e715008b7c318fb1901a37bdd0941fb46c2b90b5 Author: Oded Gabbay Date: Mon May 1 13:12:22 2023 +0300 accel/habanalabs: set unused bit as reserved Get latest f/w gaudi2 interface file which marks unused bist_need_iatu_config bit in cold_rst_data structure as reserved bit. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit 964234aba59b0a92de701f25d0d6da7a5ebb3e16 Author: Koby Elbaz Date: Tue May 16 09:56:18 2023 +0300 accel/habanalabs: rename security functions related arguments Make the argument names specify the registers array represent registers that should be unsecured so the user can access them. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 9ec7639b5e124f273db20555cc38bd40057157b3 Author: Dan Carpenter Date: Mon May 15 13:32:18 2023 +0300 accel/habanalabs: fix gaudi2_get_tpc_idle_status() return The gaudi2_get_tpc_idle_status() function returned the incorrect variable so it always returned true. Fixes: d85f0531b928 ("accel/habanalabs: break is_idle function into per-engine sub-routines") Signed-off-by: Dan Carpenter Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit cc1eeaa335f2d71e8bddf268e3e60d3a3c3a08bc Author: Yang Li Date: Fri May 12 14:46:55 2023 +0800 accel/habanalabs: Fix some kernel-doc comments Make the description of @regs_range_array and @regs_range_array_size to @user_regs_range_array and @user_regs_range_array_size to silence the warnings: drivers/accel/habanalabs/common/security.c:506: warning: Function parameter or member 'user_regs_range_array' not described in 'hl_init_pb_ranges_single_dcore' drivers/accel/habanalabs/common/security.c:506: warning: Function parameter or member 'user_regs_range_array_size' not described in 'hl_init_pb_ranges_single_dcore' drivers/accel/habanalabs/common/security.c:506: warning: Excess function parameter 'regs_range_array' description in 'hl_init_pb_ranges_single_dcore' drivers/accel/habanalabs/common/security.c:506: warning: Excess function parameter 'regs_range_array_size' description in 'hl_init_pb_ranges_single_dcore' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=4940 Signed-off-by: Yang Li Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d0dcd4bbfa47f8726df5a45236c0edd0107ec5c3 Author: Ofir Bitton Date: Mon Apr 24 14:17:03 2023 +0300 accel/habanalabs: always fetch pci addr_dec error info Due to missing indication of address decode source (LBW/HBW bus), we should always try and fetch extended information. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 7d212963366e8113d1a8548a35eb9cd5df110dca Author: Koby Elbaz Date: Thu Apr 20 14:17:31 2023 +0300 accel/habanalabs: fix a static warning - 'dubious: x & !y' Use a straight forward approach to get a conditional result. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 67d19a2f49b07b2c4a15e6a96e1de46d95209ae4 Author: Koby Elbaz Date: Mon Mar 27 11:56:16 2023 +0300 accel/habanalabs: poll for device status update following WFE cmd Currently, we rely on COMMS protocol's ack to verify that WFE command has been acknowledged by the FW. However, this does not guarantee that the device status has been updated. Although unlikely, this could trigger a race since the driver expects the device to be halted at that stage, but it might not be. Therefore, we increase WFE's robustness by polling on the status register that will be updated once the device is actually halted. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3b9abb4fa642ee28bcd22a0398087a2d87d3c987 Author: Tomer Tayar Date: Sun Mar 19 21:46:44 2023 +0200 accel/habanalabs: expose debugfs files later Currently the debugfs root folder and files for a device are created at an early step, before the device initialization and before the char device and sysfs files are exposed to user. As there is no real reason not to do it together with the device creation, postpone it to be done right afterwards. The initialization of the debugfs entry structure is left in its current position because it is used before creating the files. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d8b9cea584661b30305cf341bf9f675dc0a25471 Author: Ofir Bitton Date: Tue Apr 18 14:48:22 2023 +0300 accel/habanalabs: add pci health check during heartbeat Currently upon a heartbeat failure, we don't know if the failure is due to firmware hang or due to a bad PCI link. Hence, we are reading a PCI config space register with a known value (vendor ID) so we will know which of the two possibilities caused the heartbeat failure. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3d21ec6424e6d38f284c37d77e7ec524c1a454f2 Author: Dafna Hirschfeld Date: Mon Apr 17 21:24:19 2023 +0300 accel/habanalabs: add missing tpc interrupt info For some reason the last possible tpc interrupt cause in gaudi2_tpc_interrupts_cause is missing from the code. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 9a4e44a4ee49dff6ded6a4c76bb921a8379cb7b4 Author: Koby Elbaz Date: Sun Dec 4 18:37:53 2022 +0200 accel/habanalabs: refactor abort of completions and waits Aborting CS completions should be in command_submission.c but aborting waiting for user interrupts should be in device.c. This separation is also for adding more abort operations in the future. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ad8bfd3619bb096dd1929a69989120b45e3c3eee Author: Koby Elbaz Date: Mon Apr 17 15:14:30 2023 +0300 accel/habanalabs: minimize encapsulation signal mutex lock time Sync Stream Encapsulated Signal Handlers can be managed from different contexts, and as such they are protected via a spin_lock. However, spin_lock was unnecessarily protecting a larger code section than really needed, covering a sleepable code section as well. Since spin_lock disables preemption, it could lead to sleeping in atomic context. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 2515e54267c98dc91a6273765b4bbf560c52b770 Author: SungHwan Jung Date: Mon Jun 5 02:30:23 2023 +0900 platform/x86: hp-wmi: Add thermal profile for Victus 16-d1xxx This patch includes Platform Profile support (performance, balanced, quiet) for Victus 16-d1xxx (8A25). Signed-off-by: SungHwan Jung Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230604173023.4675-1-onenowy@gmail.com Signed-off-by: Hans de Goede commit 7def1d35d4b4a92e33fa665ba1a5a02926be9c3c Author: Mark Pearson Date: Thu Jun 1 16:05:52 2023 -0400 platform/x86: think-lmi: Don't display unnecessary authentication settings If Opcode support is available (which is the standard for all platforms going forward) then there is no need to have the encoding and kbdlang attributes visible. Signed-off-by: Mark Pearson Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230601200552.4396-8-mpearson-lenovo@squebb.ca Signed-off-by: Hans de Goede commit 3206001f704ab4dc7dc0ff69209f770680bcf5bf Author: Mark Pearson Date: Thu Jun 1 16:05:51 2023 -0400 platform/x86: think-lmi: Correct NVME index default The NVME/HDD index used by WMI starts at 1 so corrected the default appropriately. Note, zero index is still permitted in case it is required on future platforms. Documentation updated correspondingly Signed-off-by: Mark Pearson Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230601200552.4396-7-mpearson-lenovo@squebb.ca Signed-off-by: Hans de Goede commit 4cebb42412248d28df6de01420cfac5654428d41 Author: Mark Pearson Date: Thu Jun 1 16:05:50 2023 -0400 platform/x86: think-lmi: Correct NVME password handling NVME passwords identifier have been standardised across the Lenovo systems and now use udrp and adrp (user and admin level) instead of unvp and mnvp. This should apparently be backwards compatible. Fixes: 640a5fa50a42 ("platform/x86: think-lmi: Opcode support") Signed-off-by: Mark Pearson Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230601200552.4396-6-mpearson-lenovo@squebb.ca Signed-off-by: Hans de Goede commit 2aec96a981df5c51c970ddec0350381c6d178508 Author: Mark Pearson Date: Thu Jun 1 16:05:49 2023 -0400 platform/x86: think-lmi: Update password fields to use BIT Code clean up to use BIT macro as suggested. Signed-off-by: Mark Pearson Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230601200552.4396-5-mpearson-lenovo@squebb.ca Signed-off-by: Hans de Goede commit a4f7f0641199cee4e0f56d65373693677738c001 Author: Mark Pearson Date: Thu Jun 1 16:05:48 2023 -0400 platform/x86: think-lmi: Update password attribute comments Add comments to clarify what the different password attributes are (as requested). Signed-off-by: Mark Pearson Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230601200552.4396-4-mpearson-lenovo@squebb.ca Signed-off-by: Hans de Goede commit 97eef5983372d7aee6549d644d788fd0c10d2b6e Author: Mark Pearson Date: Thu Jun 1 16:05:47 2023 -0400 platform/x86: think-lmi: Correct System password interface The system password identification was incorrect. This means that if the password was enabled it wouldn't be detected correctly; and setting it would not work. Also updated code to use TLMI_SMP_PWD instead of TLMI_SYS_PWD to be in sync with Lenovo documentation. Fixes: 640a5fa50a42 ("platform/x86: think-lmi: Opcode support") Signed-off-by: Mark Pearson Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230601200552.4396-3-mpearson-lenovo@squebb.ca Signed-off-by: Hans de Goede commit 4ca9c3d404cef529de77af2382fa2e6a1612a1ca Author: Mark Pearson Date: Thu Jun 1 16:05:46 2023 -0400 platform/x86: think-lmi: Enable opcode support on BIOS settings Whilst reviewing some documentation from the FW team on using WMI on Lenovo system I noticed that we weren't using Opcode support when changing BIOS settings in the thinkLMI driver. We should be doing this to ensure we're future proof as the old non-opcode mechanism has been deprecated. Tested on X1 Carbon G10 and G11. Signed-off-by: Mark Pearson Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230601200552.4396-2-mpearson-lenovo@squebb.ca Signed-off-by: Hans de Goede commit c41e0121a1221894a1a9c4666156db9e1def4d6c Author: Mark Pearson Date: Thu Jun 1 16:05:45 2023 -0400 platform/x86: think-lmi: mutex protection around multiple WMI calls When an attribute is being changed if the Admin account is enabled, or if a password is being updated then multiple WMI calls are needed. Add mutex protection to ensure no race conditions are introduced. Fixes: b49f72e7f96d ("platform/x86: think-lmi: Certificate authentication support") Signed-off-by: Mark Pearson Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230601200552.4396-1-mpearson-lenovo@squebb.ca Signed-off-by: Hans de Goede commit 416a87c972b978d71ab828442d1d48e3bd194855 Author: Xi Pardee Date: Wed May 31 17:47:06 2023 -0700 platform/x86:intel/pmc: Remove Meteor Lake S platform support commit c5ad454a12c6 ("platform/x86: intel/pmc/core: Add Meteor Lake support to pmc core driver") was supposed to add support for Meter Lake P/M and mistakenly added support for Meteor Lake S instead. Meteor Lake P/M support was added later and MTL-S support needs to be removed since its currently assigned to the wrong register maps. Fixes: c5ad454a12c6 ("platform/x86: intel/pmc/core: Add Meteor Lake support to pmc core driver") Signed-off-by: Xi Pardee Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20230601004706.871528-1-xi.pardee@intel.com Signed-off-by: Hans de Goede commit e4543de8b6ffeba0622b9910df90d89676523975 Author: Bingbu Cao Date: Wed May 31 15:44:29 2023 +0200 platform/x86: int3472: Evaluate device's _DSM method to control imaging clock On some platforms, the imaging clock should be controlled by evaluating specific clock device's _DSM method instead of setting gpio, so this change register clock if no gpio based clock and then use the _DSM method to enable and disable clock. Signed-off-by: Bingbu Cao Signed-off-by: Hao Yao Link: https://lore.kernel.org/r/20230524035135.90315-2-bingbu.cao@intel.com Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230531134429.171337-1-hdegoede@redhat.com commit 139332e2fce621f759af8c86052417e3307b239f Author: Shyam Sundar S K Date: Thu May 25 19:49:29 2023 +0530 platform/x86/amd: pmc: Update metrics table info for Pink Sardine Starting from Pink Sardine, number of IP blocks were added to the SoC and the PMFW has the ability to give debug stats on each the IP blocks after a S0ix cycle within part of the SMU metrics table. To differentiate this change, the 's2d_msg_id' is also changed. Add these new capabilities to the driver. Signed-off-by: Shyam Sundar S K Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230525141929.866385-5-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit e3f2778b1b6ced649bffdc7cbb05b80bb92f2108 Author: Marek Vasut Date: Tue Jun 6 20:01:12 2023 +0200 ARM: dts: stm32: Fix audio routing on STM32MP15xx DHCOM PDK2 The audio routing flow is not correct, the flow should be from source (second element in the pair) to sink (first element in the pair). The flow now is from "HP_OUT" to "Playback", where "Playback" is source and "HP_OUT" is sink, i.e. the direction is swapped and there is no direct link between the two either. Fill in the correct routing, where "HP_OUT" supplies the "Headphone Jack", "Line In Jack" supplies "LINE_IN" input, "Microphone Jack" supplies "MIC_IN" input and "Mic Bias" supplies "Microphone Jack". Fixes: 34e0c7847dcf ("ARM: dts: stm32: Add DH Electronics DHCOM STM32MP1 SoM and PDK2 board") Signed-off-by: Marek Vasut Signed-off-by: Alexandre Torgue commit a325956fa7048906e26a4535ac2e87e111788fe8 Author: Chris Morgan Date: Mon May 8 11:08:11 2023 -0500 arm64: dts: rockchip: Fix compatible for Bluetooth on rk3566-anbernic The realtek Bluetooth module uses the same driver as the realtek,rtl8822cs-bt and the realtek,rtl8723bs-bt, however by selecting the 8723bs advanced power saving features are disabled that appear to interfere with normal operation of the bluetooth module. This change switches the compatible string to disable power saving. Without this patch evtest of a paired bluetooth controller fails, with this patch the controller operates as expected. Fixes: b6986b7920bb ("arm64: dts: rockchip: Update compatible for bluetooth") Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20230508160811.3568213-3-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 093d9b240a1fa261ff8aeb7c7cc484dedacfda53 Author: Nathan Chancellor Date: Wed Jun 7 14:20:59 2023 -0700 percpu: Fix self-assignment of __old in raw_cpu_generic_try_cmpxchg() After commit c5c0ba953b8c ("percpu: Add {raw,this}_cpu_try_cmpxchg()"), clang built ARCH=arm and ARCH=arm64 kernels with CONFIG_INIT_STACK_NONE started panicking on boot in alloc_vmap_area(): [ 0.000000] kernel BUG at mm/vmalloc.c:1638! [ 0.000000] Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.4.0-rc2-ARCH+ #1 [ 0.000000] Hardware name: linux,dummy-virt (DT) [ 0.000000] pstate: 200000c9 (nzCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.000000] pc : alloc_vmap_area+0x7ec/0x7f8 [ 0.000000] lr : alloc_vmap_area+0x7e8/0x7f8 Compiling mm/vmalloc.c with W=2 reveals an instance of -Wshadow, which helps uncover that through macro expansion, '__old = *(ovalp)' in raw_cpu_generic_try_cmpxchg() can become '__old = *(&__old)' through raw_cpu_generic_cmpxchg(), which results in garbage being assigned to the inner __old and the cmpxchg not working properly. Add an extra underscore to __old in raw_cpu_generic_try_cmpxchg() so that there is no more self-assignment, which resolves the panics. Closes: https://github.com/ClangBuiltLinux/linux/issues/1868 Fixes: c5c0ba953b8c ("percpu: Add {raw,this}_cpu_try_cmpxchg()") Debugged-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230607-fix-shadowing-in-raw_cpu_generic_try_cmpxchg-v1-1-8f0a3d930d43@kernel.org commit 3fecd469da9aa0b24bd965f05a8bf44f9d8e2a2e Author: Jani Nikula Date: Fri May 26 19:38:08 2023 +0300 drm/i915: re-enable -Wunused-but-set-variable W=1 enables -Wunused-but-set-variable. We disabled it locally in i915 Makefile as we were hitting a bunch of warnings. See commit 6a05d2900464 ("drm/i915: Disable unused-but-set compiler warning"). With the issues fixed or annotated with __maybe_unused, re-enable the warning not only in W=1 but also locally as part of i915 build. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/28ca3f95fe77ceb8aa35b87fca73f7afbc89859a.1685119007.git.jani.nikula@intel.com commit f645d22b93d5599fe47ce587ee36931290ba5778 Author: Zhi Wang Date: Wed May 31 02:04:11 2023 +0000 drm/i915/gvt: remove unused variable gma_bottom in command parser Remove unused variable gma_bottom in scan_workload() and scan_wa_ctx(). commit be1da7070aea ("drm/i915/gvt: vGPU command scanner") introduces gma_bottom in several functions to calculate the size of the command buffer. However, some of them are set but actually unused. When compiling the code with ccflags -Wunused-but-set-variable, gcc throws warnings. Remove unused variables to avoid the gcc warnings. Tested via compiling the code with ccflags -Wunused-but-set-variable. Fixes: be1da7070aea ("drm/i915/gvt: vGPU command scanner") Suggested-by: Jani Nikula Cc: Zhenyu Wang Cc: intel-gvt-dev@lists.freedesktop.org Signed-off-by: Zhi Wang Reviewed-by: Zhenyu Wang Reviewed-by: Andi Shyti Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230531020411.18987-1-zhi.a.wang@intel.com commit 167eb2bd947d9c04b0f6f1a5495ce4a99eeab598 Author: Viresh Kumar Date: Thu Jun 8 12:55:07 2023 +0530 OPP: Staticize `lazy_opp_tables` in of.c `lazy_opp_tables` is only used in of.c, move it there and mark it `static`. Signed-off-by: Viresh Kumar commit 1143c9d9d7602f20ba7bb3cef0d07b10f23cbef7 Author: SeongJae Park Date: Mon Apr 17 19:04:50 2023 +0000 mm/slab: break up RCU readers on SLAB_TYPESAFE_BY_RCU example code The SLAB_TYPESAFE_BY_RCU example code snippet uses a single RCU read-side critical section for retries. 'Documentation/RCU/rculist_nulls.rst' has similar example code snippet, and commit da82af04352b ("doc: Update and wordsmith rculist_nulls.rst") broke it up. Apply the change to SLAB_TYPESAFE_BY_RCU example code snippet, too. Signed-off-by: SeongJae Park Reviewed-by: Paul E. McKenney Signed-off-by: Vlastimil Babka commit 9ca73f2645706230249c4ec2a2b0cab9515987c8 Author: SeongJae Park Date: Mon Apr 17 19:04:49 2023 +0000 mm/slab: add a missing semicolon on SLAB_TYPESAFE_BY_RCU example code An example code snippet for SLAB_TYPESAFE_BY_RCU is missing a semicolon. Add it. Signed-off-by: SeongJae Park Reviewed-by: Paul E. McKenney Signed-off-by: Vlastimil Babka commit fcea0ccf4fd7f5e0b978d3c18923eea4e431118d Author: Sudeep Holla Date: Tue Jun 6 10:35:31 2023 +0100 ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init() Move all of the ARM-specific initialization into one function namely acpi_arm_init(), so it is not necessary to modify/update bus.c every time a new piece of it is added. Cc: Lorenzo Pieralisi Cc: Rafael J. Wysocki Suggested-by: Rafael J. Wysocki Reviewed-by: Robin Murphy Reviewed-by: Hanjun Guo Link: https://lore.kernel.org/r/CAJZ5v0iBZRZmV_oU+VurqxnVMbFN_ttqrL=cLh0sUH+=u0PYsw@mail.gmail.com Signed-off-by: Sudeep Holla Reviewed-by: Lorenzo Pieralisi Acked-by: Rafael J. Wysocki Reviewed-by: Shaoqin Huang Link: https://lore.kernel.org/r/20230606093531.2746732-1-sudeep.holla@arm.com Signed-off-by: Catalin Marinas commit 4a56212774acf71a7356026fb11b78228a7ad24d Author: Michal Smulski Date: Mon Jun 5 10:44:42 2023 -0700 net: dsa: mv88e6xxx: implement USXGMII mode for mv88e6393x Enable USXGMII mode for mv88e6393x chips. Tested on Marvell 88E6191X. Signed-off-by: Michal Smulski Link: https://lore.kernel.org/r/20230605174442.12493-1-msmulski2@gmail.com Signed-off-by: Jakub Kicinski commit 98d7c7544a3a9f2713dc0f729bca4ab05fbc6e7f Author: Jiri Slaby Date: Wed Jun 7 08:14:17 2023 +0200 streamline_config.pl: handle also ${CONFIG_FOO} streamline_config.pl currently searches for CONFIG options in Kconfig files as $(CONFIG_FOO). But some Kconfigs (e.g. thunderbolt) use ${CONFIG_FOO}. So fix up the regex to accept both. This fixes: $ make LSMOD=`pwd/`/lsmod localmodconfig using config: '.config' thunderbolt config not found!! Signed-off-by: Jiri Slaby Reviewed-by: Mika Westerberg Acked-by: Steven Rostedt (Google) Signed-off-by: Masahiro Yamada commit 022000d3f586de7b0765075b85f0705f50a4fa69 Author: Christophe JAILLET Date: Sun Jun 4 06:52:42 2023 +0200 scsi: qla2xxx: Drop useless LIST_HEAD 'new_fcports' is unused, so drop it. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/49bb77624c9edc8d9bf8fe71d0c8a4cd7e582175.1685854354.git.christophe.jaillet@wanadoo.fr Signed-off-by: Martin K. Petersen commit 512a365368c7af689c19e5a45d50d26cfe8c47cb Author: Gustavo A. R. Silva Date: Tue Jun 6 17:22:21 2023 -0600 scsi: qla2xxx: Replace one-element array with DECLARE_FLEX_ARRAY() helper One-element arrays as fake flex arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace one-element array declaration in struct ct_sns_gpnft_rsp, which is ultimately being used inside a union: drivers/scsi/qla2xxx/qla_def.h: 3240 struct ct_sns_gpnft_pkt { 3241 union { 3242 struct ct_sns_req req; 3243 struct ct_sns_gpnft_rsp rsp; 3244 } p; 3245 }; Refactor the rest of the code, accordingly. This issue was found with the help of Coccinelle. Link: https://github.com/KSPP/linux/issues/245 Link: https://github.com/KSPP/linux/issues/193 Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/ZH+/rZ1R1cBjIxjS@work Signed-off-by: Martin K. Petersen commit 8cd6d0a39452df6101e486471f0e85c1736e9aaa Author: Uwe Kleine-König Date: Thu May 18 22:20:43 2023 +0200 scsi: hisi_sas: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. hisi_sas_remove() returned zero unconditionally so this was changed to return void. Then it has the right prototype to be used directly as remove callback for the two hisi_sas drivers. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230518202043.261739-1-u.kleine-koenig@pengutronix.de Signed-off-by: Martin K. Petersen commit a48e2c328c6505d356c90ef51a2052d1d27f9bef Author: Gustavo A. R. Silva Date: Thu Jun 1 17:40:41 2023 -0600 scsi: lpfc: Avoid -Wstringop-overflow warning Prevent any potential integer wrapping issue, and avoid a -Wstringop-overflow warning by using the check_mul_overflow() helper. drivers/scsi/lpfc/lpfc.h: 837:#define LPFC_RAS_MIN_BUFF_POST_SIZE (256 * 1024) drivers/scsi/lpfc/lpfc_debugfs.c: 2266 size = LPFC_RAS_MIN_BUFF_POST_SIZE * phba->cfg_ras_fwlog_buffsize; this can wrap to negative if cfg_ras_fwlog_buffsize is large enough. And even when in practice this is not possible (due to phba->cfg_ras_fwlog_buffsize never being larger than 4[1]), the compiler is legitimately warning us about potentially buggy code. Fix the following warning seen under GCC-13: In function ‘lpfc_debugfs_ras_log_data’, inlined from ‘lpfc_debugfs_ras_log_open’ at drivers/scsi/lpfc/lpfc_debugfs.c:2271:15: drivers/scsi/lpfc/lpfc_debugfs.c:2210:25: warning: ‘memcpy’ specified bound between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=] 2210 | memcpy(buffer + copied, dmabuf->virt, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2211 | size - copied - 1); | ~~~~~~~~~~~~~~~~~~ Link: https://github.com/KSPP/linux/issues/305 Link: https://lore.kernel.org/linux-hardening/CABPRKS8zyzrbsWt4B5fp7kMowAZFiMLKg5kW26uELpg1cDKY3A@mail.gmail.com/ [1] Co-developed-by: Kees Cook Signed-off-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/ZHkseX6TiFahvxJA@work Reviewed-by: Justin Tee Signed-off-by: Martin K. Petersen commit bb26224ed47c8cf7a3507637deb43f9bd466225d Author: Justin Tee Date: Wed May 31 15:33:19 2023 -0700 scsi: lpfc: Use struct_size() helper Prefer struct_size() over open-coded versions of idiom: sizeof(struct-with-flex-array) + sizeof(typeof-flex-array-elements) * count where count is the max number of items the flexible array is supposed to contain. Link: https://github.com/KSPP/linux/issues/160 Co-developed-by: Gustavo A. R. Silva Signed-off-by: Gustavo A. R. Silva Co-developed-by: Kees Cook Signed-off-by: Kees Cook Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230531223319.24328-1-justintee8345@gmail.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 9c24f90f6a5f3ec0d782813ac5f211d411e4f542 Author: Stanley Chu Date: Fri Jun 2 06:50:48 2023 +0800 scsi: ufs: core: Combine ufshcd_mq_poll_cqe functions Currently, ufshcd_mcq_poll_cqe_nolock() is only called by ufshcd_mcq_poll_cqe_lock() with the addition of a spinlock wrapper for ufshcd_mcq_poll_cqe_nolock(). Combining these two functions into one results in cleaner code. Reviewed-by: Bao D. Nguyen Signed-off-by: Stanley Chu Link: https://lore.kernel.org/r/20230601225048.12228-1-stanley.chu@mediatek.com Reviewed-by: Keoseong Park Acked-by: Bean Huo Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e01d05bbf6348ccd9f5a057280310d78ea9e7b52 Author: zhanghui Date: Thu Jun 1 20:46:14 2023 +0800 scsi: ufs: core: Fix ufshcd_inc_sq_tail() function bug When qdepth is not power of 2, not every bit of the mask is 1, so in sq_tail_slot some bits will be cleared unexpectedly. Signed-off-by: zhanghui Link: https://lore.kernel.org/r/20230601124613.1446-1-zhanghui31@xiaomi.com Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 72554035b9797e00e68cd866e6cefa7f0b2c6f76 Author: Bart Van Assche Date: Wed May 31 15:40:47 2023 -0700 scsi: ufs: core: Remove a ufshcd_add_command_trace() call ufshcd_add_command_trace() traces SCSI commands. Remove a ufshcd_add_command_trace() call from a code path that is not related to SCSI commands. Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230531224050.25554-1-bvanassche@acm.org Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Martin K. Petersen commit 24335848e543dc95c9e2ffa0108d879ffefd0442 Author: Dan Carpenter Date: Tue Jun 6 11:22:07 2023 +0300 drm/i915/gsc: Fix error code in intel_gsc_uc_heci_cmd_submit_nonpriv() This should return negative -EAGAIN instead of positive EAGAIN. Fixes: e5e1e6d28ebc ("drm/i915/pxp: Add MTL helpers to submit Heci-Cmd-Packet to GSC") Signed-off-by: Dan Carpenter Reviewed-by: Alan Previn Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/ZH7sr+Vs4zOQoouU@moroto commit 5d80a86a99d524b0d89ff3906c6200b9f57b66f8 Author: ChiYuan Huang Date: Thu Jun 1 14:24:36 2023 +0800 power: supply: rt9467: Make charger-enable control as logic level The current coding make 'charger-enable-gpio' control as real hardware level. This conflicts with the default binding example. For driver behavior, no need to use real hardware level, just logic level is enough. This change can make this flexibility keep in dts gpio active level about this pin. Fixes: 6f7f70e3a8dd ("power: supply: rt9467: Add Richtek RT9467 charger driver") Signed-off-by: ChiYuan Huang Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel commit e7a2cf8e058e24218067694113938726db8696c9 Author: Dan Carpenter Date: Tue Jun 6 11:33:03 2023 +0300 drm/msm/dpu: tidy up some error checking The "vsync_hz" variable is unsigned int so it can't be less than zero. The dpu_kms_get_clk_rate() function used to return a u64 but I previously changed it to return an unsigned long and zero on error so it matches clk_get_rate(). Change the "vsync_hz" type to unsigned long as well and change the error checking to check for zero instead of negatives. This change does not affect runtime at all. It's just a clean up. Signed-off-by: Dan Carpenter Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/541225/ Link: https://lore.kernel.org/r/ZH7vP2Swu8CYpgUL@moroto [DB: fixed debug message] Signed-off-by: Dmitry Baryshkov commit 203b2019b3acc4ec851ba0461f1b30a3fd4449f5 Author: Abhinav Kumar Date: Tue Jun 6 13:11:12 2023 -0700 drm/msm/dpu: add DSC blocks to the catalog of MSM8998 MSM8998 doesn't have DSC blocks declared in the catalog. Complete DSC 1.1 support for all platforms by adding the missing blocks to MSM8998. Changes in v9: -- add MSM8998 and SC8180x to commit title Changes in v10: -- fix grammar at commit text Changes in v12: -- fix "titil" with "title" at changes in v9 Changes in v14: -- "dsc" tp "DSC" at commit title Changes in v15: -- fix merge conflicts at dpu_5_1_sc8180x.h Changes in v16 -- fix cherry-pick error by deleting both redundant .dsc and .dsc_count assignment from dpu_5_1_sc8180x.h Changes in v17 -- remove sc8180x from both commit title and text -- remove Reviewed-by Signed-off-by: Abhinav Kumar Reviewed-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/541371/ Link: https://lore.kernel.org/r/1686082272-22191-1-git-send-email-quic_khsieh@quicinc.com [DB: fixed commit message as agreed in the email discussion] Signed-off-by: Dmitry Baryshkov commit 5e0bff2b9690c857d3465d90015fb30fa4947ffe Author: Matt Roper Date: Wed Jun 7 08:09:46 2023 -0700 drm/i915/display: Include of display limits doesn't need 'display/' Drop the unnecessary directory prefix. This also makes intel_display_device.h easier to use from the Xe driver. Cc: Lucas De Marchi Cc: Jani Nikula Signed-off-by: Matt Roper Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230607150946.1996087-1-matthew.d.roper@intel.com commit 5ff3d3a0a09ecf86f7de6089905d8c9297503da2 Author: Konrad Dybcio Date: Tue Jun 6 14:44:00 2023 +0200 drm/msm: mdss: Add SM6375 support Add support for MDSS on SM6375. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/541295/ Link: https://lore.kernel.org/r/20230411-topic-straitlagoon_mdss-v6-9-dee6a882571b@linaro.org Signed-off-by: Dmitry Baryshkov commit c2c1217e61bd80b1d21963ec7c2f8ebb9f77c2a0 Author: Konrad Dybcio Date: Tue Jun 6 14:43:58 2023 +0200 drm/msm: mdss: Add SM6350 support Add support for MDSS on SM6350. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/541291/ Link: https://lore.kernel.org/r/20230411-topic-straitlagoon_mdss-v6-7-dee6a882571b@linaro.org Signed-off-by: Dmitry Baryshkov commit 27f0df03f3ffd3905bc320a8da4050cd645bd685 Author: Konrad Dybcio Date: Tue Jun 6 14:43:59 2023 +0200 drm/msm/dpu: Add SM6375 support Add basic SM6375 support to the DPU1 driver to enable display output. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/541293/ Link: https://lore.kernel.org/r/20230411-topic-straitlagoon_mdss-v6-8-dee6a882571b@linaro.org Signed-off-by: Dmitry Baryshkov commit 3186acba5cdc10b5eb0f45a5ff7ce8c1c6e8c16c Author: Konrad Dybcio Date: Tue Jun 6 14:43:57 2023 +0200 drm/msm/dpu: Add SM6350 support Add SM6350 support to the DPU1 driver to enable display output. It's worth noting that one entry dpu_qos_lut_entry was trimmed off: {.fl = 0, .lut = 0x0011223344556677 }, due to the lack of support for selecting between portrait and landscape LUT settings (for danger and safe LUTs) and no full support for qseed/non-qseed usescases (for QoS LUT). Signed-off-by: Konrad Dybcio Reviewed-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/541287/ Link: https://lore.kernel.org/r/20230411-topic-straitlagoon_mdss-v6-6-dee6a882571b@linaro.org Signed-off-by: Dmitry Baryshkov commit 2a5c1021bc77857d39a15590682f69c33417f1ba Author: Konrad Dybcio Date: Tue Jun 6 14:43:56 2023 +0200 dt-bindings: display/msm: Add SM6375 MDSS Document the SM6375 MDSS. Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Patchwork: https://patchwork.freedesktop.org/patch/541289/ Link: https://lore.kernel.org/r/20230411-topic-straitlagoon_mdss-v6-5-dee6a882571b@linaro.org Signed-off-by: Dmitry Baryshkov commit 3b7502b0c205323b679596925d963f1e1c1804af Author: Konrad Dybcio Date: Tue Jun 6 14:43:55 2023 +0200 dt-bindings: display/msm: Add SM6350 MDSS Document the SM6350 MDSS. Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Patchwork: https://patchwork.freedesktop.org/patch/541286/ Link: https://lore.kernel.org/r/20230411-topic-straitlagoon_mdss-v6-4-dee6a882571b@linaro.org Signed-off-by: Dmitry Baryshkov commit ed41005f5b7c6886179c3f7546ebe50ef7d28d5e Author: Konrad Dybcio Date: Tue Jun 6 14:43:54 2023 +0200 dt-bindings: display/msm: sc7180-dpu: Describe SM6350 and SM6375 SC7180, SM6350 and SM6375 use a rather similar hw setup for DPU, with the main exception being that the last one requires an additional throttle clock. It is not well understood yet, but failing to toggle it on makes the display hardware stall and not output any frames. Document SM6350 and SM6375 DPU. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/541283/ Link: https://lore.kernel.org/r/20230411-topic-straitlagoon_mdss-v6-3-dee6a882571b@linaro.org Signed-off-by: Dmitry Baryshkov commit 27a869221bb7a9ae3de62b683d5c3cc98edaf3c8 Author: Konrad Dybcio Date: Tue Jun 6 14:43:53 2023 +0200 dt-bindings: display/msm: dsi-controller-main: Add SM6375 Add the DSI host found on SM6375. Acked-by: Rob Herring Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/541285/ Link: https://lore.kernel.org/r/20230411-topic-straitlagoon_mdss-v6-2-dee6a882571b@linaro.org Signed-off-by: Dmitry Baryshkov commit e99b2d0670a7f6eb81e049a5279aa7124705fbc9 Author: Konrad Dybcio Date: Tue Jun 6 14:43:52 2023 +0200 dt-bindings: display/msm: dsi-controller-main: Add SM6350 Add the DSI host found on SM6350. Acked-by: Rob Herring Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/541281/ Link: https://lore.kernel.org/r/20230411-topic-straitlagoon_mdss-v6-1-dee6a882571b@linaro.org Signed-off-by: Dmitry Baryshkov commit 0f86d9c980a3e4cc8b8ca604cfb5ac3537c3fba7 Author: Dmitry Baryshkov Date: Sun Jun 4 06:13:08 2023 +0300 drm/msm/dpu: use PINGPONG_NONE to unbind WB from PP Currently the driver passes the PINGPONG index to dpu_hw_wb_ops::bind_pingpong_blk() callback and uses separate boolean flag to tell whether WB should be bound or unbound. Simplify this by passing PINGPONG_NONE in case of unbinding and drop the flag completely. Suggested-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/540969/ Link: https://lore.kernel.org/r/20230604031308.894274-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit a03b7c4698d78b2e4d0c06a439d01cce8a3823bc Author: Dmitry Baryshkov Date: Sun Jun 4 06:13:07 2023 +0300 drm/msm/dpu: use PINGPONG_NONE to unbind INTF from PP Currently the driver passes the PINGPONG index to dpu_hw_intf_ops::bind_pingpong_blk() callback and uses separate boolean flag to tell whether INTF should be bound or unbound. Simplify this by passing PINGPONG_NONE in case of unbinding and drop the flag completely. Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/540968/ Link: https://lore.kernel.org/r/20230604031308.894274-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 803ea346bd3ff1ac80fc65cf5899c0ad045d1788 Author: Jakub Kicinski Date: Tue Jun 6 00:12:19 2023 -0700 net/mlx5e: simplify condition after napi budget handling change Since recent commit budget can't be 0 here. Signed-off-by: Jakub Kicinski Signed-off-by: Saeed Mahameed commit eb8e9fae0a22d07c6a09983ec52a2dcdc9d4d82b Author: Bodong Wang Date: Tue Jun 6 00:12:18 2023 -0700 mlx5/core: E-Switch, Allocate ECPF vport if it's an eswitch manager Eswitch vport is needed for eswitch manager when creating LAG, to create egress rules. However, this was not handled when ECPF is an eswitch manager. Signed-off-by: Bodong Wang Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 97bd788efb9052963b43ba41c8aaff3ed12e1ede Author: Jiri Pirko Date: Tue Jun 6 00:12:17 2023 -0700 net/mlx5: Skip inline mode check after mlx5_eswitch_enable_locked() failure Commit bffaa916588e ("net/mlx5: E-Switch, Add control for inline mode") added inline mode checking to esw_offloads_start() with a warning printed out in case there is a problem. Tne inline mode checking was done even after mlx5_eswitch_enable_locked() call failed, which is pointless. Later on, commit 8c98ee77d911 ("net/mlx5e: E-Switch, Add extack messages to devlink callbacks") converted the error/warning prints to extack setting, which caused that the inline mode check error to overwrite possible previous extack message when mlx5_eswitch_enable_locked() failed. User then gets confusing error message. Fix this by skipping check of inline mode after mlx5_eswitch_enable_locked() call failed. Signed-off-by: Jiri Pirko Signed-off-by: Saeed Mahameed commit de1f0a650824ed1905d5d48190f65f309cee5163 Author: Oz Shlomo Date: Tue Jun 6 00:12:16 2023 -0700 net/mlx5e: TC, refactor access to hash key Currently, a temp object is filled and used as a key for rhashtable_lookup. Lookups will only works while key remains the first attribute in the relevant rhashtable node object. Fix this by passing a key, instead of a object containing the key. Signed-off-by: Oz Shlomo Reviewed-by: Paul Blakey Signed-off-by: Saeed Mahameed commit f4692ab13a1f7ad2c2098b838c2820c113ce8a07 Author: Tariq Toukan Date: Tue Jun 6 00:12:15 2023 -0700 net/mlx5e: Remove RX page cache leftovers Remove unused definitions left after the removal of the RX page cache feature. Signed-off-by: Tariq Toukan Reviewed-by: Dragos Tatulea Signed-off-by: Saeed Mahameed commit a33682e4e78e249155abbe5e8ee880d5760b5e28 Author: Lama Kayal Date: Tue Jun 6 00:12:14 2023 -0700 net/mlx5e: Expose catastrophic steering error counters Add generated_pkt_steering_fail and handled_pkt_steering_fail to devlink heatlth reporter. generated_pkt_steering_fail indicates the number of packets dropped due to illegal steering operation within the vport steering domain. handled_pkt_steering_fail indicates the number of packets dropped due to illegal steering operation, originated by the vport. Also, update devlink reporter functionality documentation with the newly exposed counters. Signed-off-by: Lama Kayal Reviewed-by: Rahul Rameshbabu Signed-off-by: Saeed Mahameed commit 6ec0b55e72a5c6fb056ad1eea12a3b5a74a402fe Author: Shay Drory Date: Tue Jun 6 00:12:12 2023 -0700 net/mlx5: Enable 4 ports VF LAG Now, after all preparation are done, enable 4 ports VF LAG Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 7718c1c8ac325019a3d727e994faab9cf2438263 Author: Shay Drory Date: Tue Jun 6 00:12:11 2023 -0700 net/mlx5: LAG, block multiport eswitch LAG in case ldev have more than 2 ports multiport eswitch LAG is not supported over more than two ports. Add a check in order to block multiport eswitch LAG over such devices. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit d61bab396115dafc9ad572afa57d464e2e00b396 Author: Shay Drory Date: Tue Jun 6 00:12:10 2023 -0700 net/mlx5: LAG, block multipath LAG in case ldev have more than 2 ports multipath LAG is not supported over more than two ports. Add a check in order to block multipath LAG over such configurations. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit c83e6ab96ef20bcdb5bfb12f42bd2e6734920bfd Author: Shay Drory Date: Tue Jun 6 00:12:09 2023 -0700 net/mlx5: LAG, change mlx5_shared_fdb_supported() to static mlx5_shared_fdb_supported() is used only in a single file. Change the function to be static. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 86a12124dc0249d60bb5f01497b3a86e99efae6d Author: Shay Drory Date: Tue Jun 6 00:12:08 2023 -0700 net/mlx5: LAG, generalize handling of shared FDB Shared FDB handling is using the assumption that shared FDB can only be created from two devices. In order to support shared FDB of more than two devices, iterate over all LAG ports instead of hard coding only the first two LAG ports whenever handling shared FDB. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 4c103aea4bedfb109e91bed2023178059947fc4c Author: Shay Drory Date: Tue Jun 6 00:12:07 2023 -0700 net/mlx5: LAG, check if all eswitches are paired for shared FDB Shared FDB LAG can only work if all eswitches are paired. Also, whenever two eswitches are paired, devcom is marked as ready. Therefore, in case of device with two eswitches, checking devcom was sufficient. However, this is not correct for device with more than two eswitches, which will be introduced in downstream patch. Hence, check all eswitches are paired explicitly. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 222dd185833e464faad2d175c14bca584b6b6dad Author: Shay Drory Date: Tue Jun 6 00:12:06 2023 -0700 {net/RDMA}/mlx5: introduce lag_for_each_peer Introduce a generic APIs to iterate over all the devices which are part of the LAG. This API replace mlx5_lag_get_peer_mdev() which retrieve only a single peer device from the lag. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 962825e534a998025bc23a187c457ec7f9fac764 Author: Shay Drory Date: Tue Jun 6 00:12:05 2023 -0700 RDMA/mlx5: Free second uplink ib port The cited patch introduce ib port for the slave device uplink in case of multiport eswitch. However, this ib port didn't perform anything when unloaded. Unload the new ib port properly. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 003f242b0dc16b287e6d15833d1d7f4adfa346ff Author: Jens Axboe Date: Wed Jun 7 15:00:07 2023 -0600 io_uring: get rid of unnecessary 'length' variable Just use the ARRAY_SIZE directly, we don't use length for anything else in this function. Signed-off-by: Jens Axboe commit d86eaed185e9c6052d1ee2ca538f1936ff255887 Author: Jens Axboe Date: Wed Jun 7 14:41:20 2023 -0600 io_uring: cleanup io_aux_cqe() API Everybody is passing in the request, so get rid of the io_ring_ctx and explicit user_data pass-in. Both the ctx and user_data can be deduced from the request at hand. Signed-off-by: Jens Axboe commit 2e31da752c6d0e892f2a9232e18da816d04ee691 Merge: e1bd2334f165a 401b0de3ae4fa 6b706e5603c44 fbde57d2d2995 edff5e9a99e0e ce2544b2d05ee de29a96acceae Author: Paul E. McKenney Date: Wed Jun 7 13:44:06 2023 -0700 Merge branches 'doc.2023.05.10a', 'fixes.2023.05.11a', 'kvfree.2023.05.10a', 'nocb.2023.05.11a', 'rcu-tasks.2023.05.10a', 'torture.2023.05.15a' and 'rcu-urgent.2023.06.06a' into HEAD doc.2023.05.10a: Documentation updates fixes.2023.05.11a: Miscellaneous fixes kvfree.2023.05.10a: kvfree_rcu updates nocb.2023.05.11a: Callback-offloading updates rcu-tasks.2023.05.10a: Tasks RCU updates torture.2023.05.15a: Torture-test updates rcu-urgent.2023.06.06a: Urgent SRCU fix commit e06bd5e3adae14a4c0c50d74e36b064ab77601ba Merge: 6878eb59d92cc 06b9dede1e7d8 Author: Jakub Kicinski Date: Wed Jun 7 13:30:30 2023 -0700 Merge branch 'followup-fixes-for-the-dwmac-and-altera-lynx-conversion' Maxime Chevallier says: ==================== Followup fixes for the dwmac and altera lynx conversion Here's yet another version of the cleanup series for the TSE PCS replacement by PCS Lynx. It includes Kconfig fixups, some missing initialisations and a slight rework suggested by Russell for the dwmac cleanup sequence, along with more explicit zeroing of local structures as per MAciej's review. ==================== Link: https://lore.kernel.org/r/20230607135941.407054-1-maxime.chevallier@bootlin.com Signed-off-by: Jakub Kicinski commit 06b9dede1e7d8b7a199f8014aca5a7d7137b41b0 Author: Maxime Chevallier Date: Wed Jun 7 15:59:41 2023 +0200 net: dwmac_socfpga: initialize local data for mdio regmap configuration Explicitly zero-ize the local mdio_regmap_config data, and explicitly set the .autoscan parameter, as we only have a PCS on this bus. Fixes: 5d1f3fe7d2d5 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver") Suggested-by: Russell King (Oracle) Suggested-by: Maciej Fijalkowski Signed-off-by: Maxime Chevallier Reviewed-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit e98d14fa7315867fded127a98db355f49807dfdb Author: Uwe Kleine-König Date: Tue Jun 6 20:26:00 2023 -0700 tools/testing/nvdimm: Drop empty platform remove function A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20221213100512.599548-1-u.kleine-koenig@pengutronix.de Signed-off-by: Dan Williams commit 7f80ab365a1d10cb143c897954199c760272c338 Author: Arnd Bergmann Date: Tue May 16 22:14:09 2023 +0200 libnvdimm: mark 'security_show' static again The security_show() function was made global and __weak at some point to allow overriding it. The override was removed later, but it remains global, which causes a warning about the missing declaration: drivers/nvdimm/dimm_devs.c:352:9: error: no previous prototype for 'security_show' This is also not an appropriate name for a global symbol in the kernel, so just make it static again. Fixes: 15a8348707ff ("libnvdimm: Introduce CONFIG_NVDIMM_SECURITY_TEST flag") Signed-off-by: Arnd Bergmann Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20230516201415.556858-3-arnd@kernel.org Signed-off-by: Dan Williams commit 9e46e541cf19fffbbbd9c6ef393446e7d5ef8c39 Author: Arnd Bergmann Date: Tue May 16 22:14:08 2023 +0200 testing: nvdimm: add missing prototypes for wrapped functions The nvdimm test wraps a number of API functions, but these functions don't have a prototype in a header because they are all called by a different name: drivers/nvdimm/../../tools/testing/nvdimm/test/iomap.c:74:15: error: no previous prototype for '__wrap_devm_ioremap' [-Werror=missing-prototypes] 74 | void __iomem *__wrap_devm_ioremap(struct device *dev, | ^~~~~~~~~~~~~~~~~~~ drivers/nvdimm/../../tools/testing/nvdimm/test/iomap.c:86:7: error: no previous prototype for '__wrap_devm_memremap' [-Werror=missing-prototypes] 86 | void *__wrap_devm_memremap(struct device *dev, resource_size_t offset, | ^~~~~~~~~~~~~~~~~~~~ ... Add prototypes to avoid the warning. Signed-off-by: Arnd Bergmann Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20230516201415.556858-2-arnd@kernel.org Signed-off-by: Dan Williams commit fa19a5d9dcffddae2cb5774df98b09ca3f2ea783 Author: Maxime Chevallier Date: Wed Jun 7 15:59:40 2023 +0200 net: altera_tse: explicitly disable autoscan on the regmap-mdio bus Set the .autoscan flag to false on the regmap-mdio bus, to avoid using a random uninitialized value. We don't want autoscan in this case as the mdio device is a PCS and not a PHY. Fixes: db48abbaa18e ("net: ethernet: altera-tse: Convert to mdio-regmap and use PCS Lynx") Suggested-by: Russell King (Oracle) Signed-off-by: Maxime Chevallier Reviewed-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit a8dd7404c21447b46e792a483f4d73af66ccaf8d Author: Maxime Chevallier Date: Wed Jun 7 15:59:39 2023 +0200 net: stmmac: make the pcs_lynx cleanup sequence specific to dwmac_socfpga So far, only the dwmac_socfpga variant of stmmac uses PCS Lynx. Use a dedicated cleanup sequence for dwmac_socfpga instead of using the generic stmmac one. Fixes: 5d1f3fe7d2d5 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver") Suggested-by: Russell King (Oracle) Signed-off-by: Maxime Chevallier Reviewed-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit fae555f5a56f1d10cc5dc6ec3ad4f07243f6ce3c Author: Maxime Chevallier Date: Wed Jun 7 15:59:38 2023 +0200 net: altera_tse: Use the correct Kconfig option for the PCS_LYNX dependency Use the correct Kconfig dependency for altera_tse as PCS_ALTERA_TSE was replaced by PCS_LYNX. Fixes: db48abbaa18e ("net: ethernet: altera-tse: Convert to mdio-regmap and use PCS Lynx") Signed-off-by: Maxime Chevallier Reviewed-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 2d830f7a41343302ab19e73d4f44f5ccb6940a25 Author: Maxime Chevallier Date: Wed Jun 7 15:59:37 2023 +0200 net: altera-tse: Initialize local structs before using it The regmap_config and mdio_regmap_config objects needs to be zeroed before using them. This will cause spurious errors at probe time as config->pad_bits is containing random uninitialized data. Fixes: db48abbaa18e ("net: ethernet: altera-tse: Convert to mdio-regmap and use PCS Lynx") Signed-off-by: Maxime Chevallier Reviewed-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 7da15fb0318f18398feea2848d099a8d0d7b5965 Author: Andy Shevchenko Date: Fri Mar 10 18:45:49 2023 +0200 pktcdvd: Sort headers Sort the headers in alphabetic order in order to ease the maintenance for this part. Signed-off-by: Andy Shevchenko Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230310164549.22133-10-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe commit 6a5945a8eb5a626afe6feb341824e7e1d007c8ff Author: Andy Shevchenko Date: Fri Mar 10 18:45:48 2023 +0200 pktcdvd: Get rid of redundant 'else' In the snippets like the following if (...) return / goto / break / continue ...; else ... the 'else' is redundant. Get rid of it. Signed-off-by: Andy Shevchenko Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230310164549.22133-9-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe commit 046636a4bac575aff78e44c7e1cff84c83a345a9 Author: Andy Shevchenko Date: Fri Mar 10 18:45:47 2023 +0200 pktcdvd: Use put_unaligned_be16() and get_unaligned_be16() This makes the driver code slightly better to understand. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230310164549.22133-8-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe commit 80d994d2a71f88e0809dcaccef2259c791d2e3ef Author: Andy Shevchenko Date: Fri Mar 10 18:45:46 2023 +0200 pktcdvd: Use DEFINE_SHOW_ATTRIBUTE() to simplify code Use DEFINE_SHOW_ATTRIBUTE() helper macro to simplify the code. No functional change. Signed-off-by: Andy Shevchenko Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230310164549.22133-7-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe commit 93c8f6f38be67e30adf8d8eb5e7e9ccb89326119 Author: Andy Shevchenko Date: Fri Mar 10 18:45:45 2023 +0200 pktcdvd: Drop redundant castings for sector_t Since the commit 72deb455b5ec ("block: remove CONFIG_LBDAF") the sector_t is always 64-bit type, no need to cast anymore. Signed-off-by: Andy Shevchenko Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230310164549.22133-6-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe commit f023faaa988671f0f1d1a965dc5d7e61d0f5e65e Author: Andy Shevchenko Date: Fri Mar 10 18:45:44 2023 +0200 pktcdvd: Get rid of pkt_seq_show() forward declaration The code can be neater without forward declarations. Get rid of pkt_seq_show() forward declaration. This will also allow futher cleanups to be cleaner. Signed-off-by: Andy Shevchenko Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230310164549.22133-5-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe commit 3bb5746c26cdfcc354af4867c02f1e0ec1131a62 Author: Andy Shevchenko Date: Fri Mar 10 18:45:43 2023 +0200 pktcdvd: use sysfs_emit() to instead of scnprintf() Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Andy Shevchenko Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230310164549.22133-4-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe commit 1a0ddd56e545b743af510b5a1b8dbdfe7d35cd3b Author: Andy Shevchenko Date: Fri Mar 10 18:45:42 2023 +0200 pktcdvd: replace sscanf() by kstrtoul() The checkpatch.pl warns: "Prefer kstrto to single variable sscanf". Fix the code accordingly. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230310164549.22133-3-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe commit 3a41db531e5124adaa3a9ab9ca0c724aee85b10c Author: Andy Shevchenko Date: Fri Mar 10 18:45:41 2023 +0200 pktcdvd: Get rid of custom printing macros We may use traditional dev_*() macros instead of custom ones provided by the driver. Signed-off-by: Andy Shevchenko Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230310164549.22133-2-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe commit 143e19547f9bbd0cc7ae6dffa87f05c14f040cdc Merge: 99f3e7de7a100 fe748da7c2165 Author: Mark Brown Date: Wed Jun 7 21:16:47 2023 +0100 ASoC: stm32: fix dtbs_check warnings Merge series from Olivier Moysan : Fix dtbs_check warnings in STM32MP15 DK boards Devices Trees for STM32 I2S and Cirrus CS42L51 codec. - Add OF graph port property in I2S and CS42L51 DT bindings. Fixes warnings: audio-controller@4000b000: Unevaluated properties are not allowed ('port' was unexpected) cs42l51@4a: Unevaluated properties are not allowed ('port' was unexpected) - Correct OF graph DAI audio format property for STM32MP15x Dkx I2S node commit 34ce984c24e69abc271f855cfe2969f444f3b98b Author: Andy Shevchenko Date: Mon Jun 5 19:49:43 2023 +0300 pinctrl: intel: Add Intel Meteor Lake-S pin controller support This driver adds pinctrl/GPIO support for Intel Meteor Lake-S. The GPIO controller is based on the next generation GPIO hardware but still compatible with the one supported by the Intel pinctrl and GPIO core driver. Reviewed-by: Linus Walleij Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 589f4924e815559282e7c9f2854cd6b53ee9d6af Author: Umesh Nerlige Ramappa Date: Mon Jun 5 12:39:23 2023 -0700 i915/perf: Do not add ggtt offset to hw_tail ggtt offset for hw_tail is not required for the calculations, so drop it. Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230605193923.1836048-3-umesh.nerlige.ramappa@intel.com commit 9cc31938d4586f72eb8e0235ad9d9eb22496fcee Author: Umesh Nerlige Ramappa Date: Mon Jun 5 12:39:22 2023 -0700 i915/perf: Drop the aging_tail logic in perf OA On DG2, capturing OA reports while running heavy render workloads sometimes results in invalid OA reports where 64-byte chunks inside reports have stale values. Under memory pressure, high OA sampling rates (13.3 us) and heavy render workload, occasionally, the OA HW TAIL pointer does not progress as fast as the sampling rate. When these glitches occur, the TAIL pointer takes approx. 200us to progress. While this is expected behavior from the HW perspective, invalid reports are not expected. In oa_buffer_check_unlocked(), when we execute the if condition, we are updating the oa_buffer.tail to the aging tail and then setting pollin based on this tail value, however, we do not have a chance to rewind and validate the reports prior to setting pollin. The validation happens in a subsequent call to oa_buffer_check_unlocked(). If a read occurs before this validation, then we end up reading reports up until this oa_buffer.tail value which includes invalid reports. Though found on DG2, this affects all platforms. The aging tail logic is no longer necessary since we are explicitly checking for landed reports. Start by dropping the aging tail logic. v2: - Drop extra blank line - Add reason to drop aging logic (Ashutosh) - Add bug links (Ashutosh) - rename aged_tail to read_tail - Squash patches 3 and 1 v3: (Ashutosh) - Remove extra spaces - Remove gtt_offset from the pollin calculation - s/Bug:/Link/ in commit message (checkpatch) Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7484 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7757 Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230605193923.1836048-2-umesh.nerlige.ramappa@intel.com commit 6878eb59d92cc0aff170179480dc32795ac7513b Merge: e7214663e023b 7a11f70ce8820 Author: Jakub Kicinski Date: Wed Jun 7 12:53:13 2023 -0700 Merge branch 'tools-ynl-generate-code-for-the-handshake-family' Jakub Kicinski says: ==================== tools: ynl: generate code for the handshake family Add necessary features and generate user space C code for serializing / deserializing messages of the handshake family. In addition to basics already present in netdev and fou, handshake has nested attrs and multi-attr u32. ==================== Link: https://lore.kernel.org/r/20230606194302.919343-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 7a11f70ce8820d13db6bdde913e6520ad58daf20 Author: Jakub Kicinski Date: Tue Jun 6 12:43:02 2023 -0700 tools: ynl: generate code for the handshake family Generate support for the handshake family. Signed-off-by: Jakub Kicinski commit 58da455b31baf87dd74b71fc54d0356e05c0bf49 Author: Jakub Kicinski Date: Tue Jun 6 12:43:01 2023 -0700 tools: ynl-gen: improve unwind on parsing errors When parsing multi-attr we count the objects and then allocate an array to hold the parsed objects. If an attr space has multiple multi-attr objects, however, if parsing the first array fails we'll leave the object count for the second even tho the second array was never allocated. This may cause crashes when freeing objects on error. Count attributes to a variable on the stack and only set the count in the object once the memory was allocated. Signed-off-by: Jakub Kicinski commit 2cc9671a82e3ba8911f01b04fd8f8f2da3a238a7 Author: Jakub Kicinski Date: Tue Jun 6 12:43:00 2023 -0700 tools: ynl-gen: fill in support for MultiAttr scalars The handshake family needs support for MultiAttr scalars. Right now we only support code gen for MultiAttr nested types. Signed-off-by: Jakub Kicinski commit 62176420274db5b5127cd7a0083a9aeb461756ee Author: Thomas Weißschuh Date: Wed Jun 7 19:28:48 2023 +0200 fs: avoid empty option when generating legacy mount string As each option string fragment is always prepended with a comma it would happen that the whole string always starts with a comma. This could be interpreted by filesystem drivers as an empty option and may produce errors. For example the NTFS driver from ntfs.ko behaves like this and fails when mounted via the new API. Link: https://github.com/util-linux/util-linux/issues/2298 Signed-off-by: Thomas Weißschuh Fixes: 3e1aeb00e6d1 ("vfs: Implement a filesystem superblock creation/configuration context") Cc: stable@vger.kernel.org Message-Id: <20230607-fs-empty-option-v1-1-20c8dbf4671b@weissschuh.net> Signed-off-by: Christian Brauner commit 4c4cc7ac207f56ed5db5272dab4169d2d40e418d Author: Mika Kahola Date: Tue Jun 6 23:10:32 2023 +0300 drm/i915/mtl: Add support for PM DEMAND MTL introduces a new way to instruct the PUnit with power and bandwidth requirements of DE. Add the functionality to program the registers and handle waits using interrupts. The current wait time for timeouts is programmed for 10 msecs to factor in the worst case scenarios. Changes made to use REG_BIT for a register that we touched(GEN8_DE_MISC_IER _MMIO). Wa_14016740474 is added which applies to Xe_LPD+ display v2: checkpatch warning fixes, simplify program pmdemand part v3: update to dbufs and pipes values to pmdemand register(stan) Removed the macro usage in update_pmdemand_values() v4: move the pmdemand_pre_plane_update before cdclk update pmdemand_needs_update included cdclk params comparisons pmdemand_state NULL check (Gustavo) pmdemand.o in sorted order in the makefile (Jani) update pmdemand misc irq handler loop (Gustavo) active phys bitmask and programming correction (Gustavo) v5: simplify pmdemand_state structure simplify methods to find active phys and max port clock Timeout in case of previou pmdemand task pending (Gustavo) v6: rebasing updates to max_ddiclk calculations (Gustavo) updates to active_phys count method (Gustavo) v7: use two separate loop to iterate throug old and new crtc states to calculate the active phys (Gustavo) v8: use uniform function names (Gustavo) v9: For phys change iterate through connectors (Imre) Look for change in phys for pmdemand update (Gustavo, Imre) Some more stlying changes (Imre) Update pmdemand state during HW readout/sanitize (Imre) v10: Fix CI checkpatch warnings v11: use correct pmdemand object pointer during hw readout, simplify the check for phys need update (Gustavo) v12: Handle possible non serialize cases (Imre) Initialise also pmdemand params HW readout (Imre) Update active phys mask during sanitize calls (Imre) Check TC/encoder changes to limit connector update (Imre) v13: Check display version before accessing pmdemand functions v14: Move is_serialized to intel_global_state.c simplify update params and other stlying issues (Imre) Bspec: 66451, 64636, 64602, 64603 Cc: Matt Atwood Cc: Matt Roper Cc: Lucas De Marchi Cc: Gustavo Sousa Signed-off-by: José Roberto de Souza Signed-off-by: Gustavo Sousa Signed-off-by: Mika Kahola Signed-off-by: Vinod Govindapillai Reviewed-by: Stanislav Lisovskiy #v4 Acked-by: Gustavo Sousa #v11 Reviewed-by: Imre Deak [RK: Fixed minor typo in one of the comments. s/qclck_gc/qclk_gv/] Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230606201032.347449-1-vinod.govindapillai@intel.com commit a5819e51912292e16f14f4c014c384f754002e5e Author: Vinod Govindapillai Date: Tue Jun 6 12:35:08 2023 +0300 drm/i915/mtl: find the best QGV point for the SAGV configuration From MTL onwards, we need to find the best QGV point based on the required data rate and pass the peak BW of that point to the punit to lock the corresponding QGV point. v1: Fix for warning from kernel test robot v2: No need to serialize for the peakbw change as pmdemand code will do that (Imre) Bspec: 64636 Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202305280253.Ab8bRV2w-lkp@intel.com/ Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202305280253.Ab8bRV2w-lkp@intel.com/ Signed-off-by: Vinod Govindapillai Reviewed-by: Stanislav Lisovskiy Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230606093509.221709-7-vinod.govindapillai@intel.com commit 6400c215a1c19e40bab513b20d35780e61b291f5 Author: Vinod Govindapillai Date: Tue Jun 6 12:35:07 2023 +0300 drm/i915: modify max_bw to return index to intel_bw_info MTL uses the peak BW of a QGV point to lock the required QGV point instead of the QGV index. Instead of passing the deratedbw of the selected bw_info, return the index to the selected bw_info so that either deratedbw or peakbw can be used based on the platform. v2: use idx to store index returned by max_bw_index functions v3: return UINT_MAX in icl_max_bw_index in case no match found v3: check idx >= ARRAY_SIZE Signed-off-by: Vinod Govindapillai Reviewed-by: Stanislav Lisovskiy Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230606093509.221709-6-vinod.govindapillai@intel.com commit 463cc9402e71deead30bd85335c56a98a1c1c462 Author: Vinod Govindapillai Date: Tue Jun 6 12:35:06 2023 +0300 drm/i915: extract intel_bw_check_qgv_points() Extract intel_bw_check_qgv_points() from intel_bw_atomic_check to facilitate future platform variations in handling SAGV configurations. Signed-off-by: Vinod Govindapillai Reviewed-by: Stanislav Lisovskiy Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230606093509.221709-5-vinod.govindapillai@intel.com commit 88d0ecbde90fdf5b78d702f9ec9711d60d35004c Author: Vinod Govindapillai Date: Tue Jun 6 12:35:05 2023 +0300 drm/i915: store the peak bw per QGV point In MTL onwards, pcode locks the GV point based on the peak BW of a QGV point. So store the peak BW of all the QGV points. v2: use DIV_ROUND_CLOSEST() for the peakBW calculation Bspec: 64636 Signed-off-by: Vinod Govindapillai Reviewed-by: Stanislav Lisovskiy Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230606093509.221709-4-vinod.govindapillai@intel.com commit 39bea0ff0f7470a5a812f50b2485d2380759e19b Author: Vinod Govindapillai Date: Tue Jun 6 12:35:04 2023 +0300 drm/i915: update the QGV point frequency calculations From MTL onwwards, pcode locks the QGV point based on peak BW of the intended QGV point passed by the driver. So the peak BW calculation must match the value expected by the pcode. Update the calculations as per the Bspec. v2: use DIV_ROUND_* macro for the calculations (Ville) v3: Use only DIV_ROUN_CLOSEST and remove divisor / 2 again Bspec: 64636 Signed-off-by: Vinod Govindapillai Reviewed-by: Stanislav Lisovskiy Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230606093509.221709-3-vinod.govindapillai@intel.com commit 626765bb4b2e732e9a1595fc801f696dbde12db9 Author: Vinod Govindapillai Date: Tue Jun 6 12:35:03 2023 +0300 drm/i915: fix the derating percentage for MTL Follow the values from bspec for the percentage overhead for efficiency in MTL BW calculations. Bspec: 64631 Signed-off-by: Vinod Govindapillai Reviewed-by: Matt Roper Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230606093509.221709-2-vinod.govindapillai@intel.com commit fe0af9fe54d0ff53aa49eef390c8962355b274e2 Author: Johannes Berg Date: Tue Jun 6 14:49:33 2023 +0200 wifi: cfg80211: move scan done work to wiphy work Move the scan done work to the new wiphy work to simplify the code a bit. Signed-off-by: Johannes Berg commit c88d7178229b7b9482ab4cc0b781aef0f20c3dfb Author: Johannes Berg Date: Tue Jun 6 14:49:32 2023 +0200 wifi: cfg80211: move sched scan stop to wiphy work This work can now trivially be converted, it behaves identical either way. Signed-off-by: Johannes Berg commit 4b8d43f1137cb9f6e8bb3b77251ad9429ab7ef34 Author: Johannes Berg Date: Tue Jun 6 14:49:31 2023 +0200 wifi: mac80211: mlme: move disconnects to wiphy work Move the beacon loss work that might cause a disconnect and the CSA disconnect work to be wiphy work, so we hold the wiphy lock for them. Signed-off-by: Johannes Berg commit 87351d09261308472ddb6d700e182c34db4fce7a Author: Johannes Berg Date: Tue Jun 6 14:49:30 2023 +0200 wifi: mac80211: ibss: move disconnect to wiphy work Move the IBSS disconnect work to be a wiphy work. Signed-off-by: Johannes Berg commit ec3252bff7b60fd2ee1a51a11054c54d63435ed2 Author: Johannes Berg Date: Tue Jun 6 14:49:29 2023 +0200 wifi: mac80211: use wiphy work for channel switch Channel switch obviously must be handled per link, and we have a (potential) deadlock when canceling that work. Use the new delayed wiphy work to handle this instead and get rid of the explicit timer that way too. Signed-off-by: Johannes Berg commit 1444f58931ef5227532cf5436bb55c1dd511d9a2 Author: Johannes Berg Date: Tue Jun 6 14:49:28 2023 +0200 wifi: mac80211: use wiphy work for SMPS SMPS requests are per link, and currently there's a potential deadlock with canceling. Use the new wiphy work to handle SMPS instead, so that the cancel cannot deadlock. Signed-off-by: Johannes Berg commit a3df43b16fc49213ab4b925711d4725e1e2f2305 Author: Johannes Berg Date: Tue Jun 6 14:49:27 2023 +0200 wifi: mac80211: unregister netdevs through cfg80211 Since we want to have wiphy_lock() for the unregistration in the future, unregister also netdevs via cfg80211 now to be able to hold the wiphy_lock() for it. Signed-off-by: Johannes Berg commit 16114496d684a3df4ce09f7c6b7557a8b2922795 Author: Johannes Berg Date: Tue Jun 6 14:49:26 2023 +0200 wifi: mac80211: use wiphy work for sdata->work We'll need this later to convert other works that might be cancelled from here, so convert this one first. Signed-off-by: Johannes Berg commit a3ee4dc84c4e9d14cb34dad095fd678127aca5b6 Author: Johannes Berg Date: Tue Jun 6 14:49:25 2023 +0200 wifi: cfg80211: add a work abstraction with special semantics Add a work abstraction at the cfg80211 level that will always hold the wiphy_lock() for any work executed and therefore also can be canceled safely (without waiting) while holding that. This improves on what we do now as with the new wiphy works we don't have to worry about locking while cancelling them safely. Also, don't let such works run while the device is suspended, since they'll likely need to interact with the device. Flush them before suspend though. Signed-off-by: Johannes Berg commit 4d45145ba6e2e1c0eba4ebda7d6273319191f4e8 Author: Johannes Berg Date: Tue Jun 6 14:49:24 2023 +0200 wifi: cfg80211: hold wiphy lock when sending wiphy Sending the wiphy out might cause calls to the driver, notably get_txq_stats() and get_antenna(). These aren't very important, since the normally have their own locks and/or just send out static data, but if the contract should be that the wiphy lock is always held, these are also affected. Fix that. Signed-off-by: Johannes Berg commit 7d2d0ff49dfdb38ad37baa9a27c0132d5e51a923 Author: Johannes Berg Date: Tue Jun 6 14:49:23 2023 +0200 wifi: cfg80211: wext: hold wiphy lock in siwgenie Missed this ioctl since it's in wext-sme.c where we usually get via a front-level ioctl handler in the other files, but it should also hold the wiphy lock to align the locking contract towards the driver. Signed-off-by: Johannes Berg commit a993df0f9143e63eca38c96a30daf08db99a98a3 Author: Johannes Berg Date: Tue Jun 6 14:49:22 2023 +0200 wifi: cfg80211: move wowlan disable under locks This is a driver callback, and the driver should be able to assume that it's called with the wiphy lock held. Move the call up so that's true, it has no other effect since the device is already unregistering and we cannot reach this function through other paths. Signed-off-by: Johannes Berg commit 0dcb84ede5b0a99fc125df2f82ca1f539d41446d Author: Johannes Berg Date: Tue Jun 6 14:49:21 2023 +0200 wifi: cfg80211: hold wiphy lock in pmsr work Most code paths in cfg80211 already hold the wiphy lock, mostly by virtue of being called from nl80211, so make the pmsr cleanup worker also hold it, aligning the locking promises between different parts of cfg80211. Signed-off-by: Johannes Berg commit e9da6df7492a981b071bafd169fb4c35b45f5ebf Author: Johannes Berg Date: Tue Jun 6 14:49:20 2023 +0200 wifi: cfg80211: hold wiphy lock in auto-disconnect Most code paths in cfg80211 already hold the wiphy lock, mostly by virtue of being called from nl80211, so make the auto-disconnect worker also hold it, aligning the locking promises between different parts of cfg80211. Signed-off-by: Johannes Berg commit 10f5ae21940cc754f82828d81b8009f2e8ae2c64 Merge: 7d528eafc5290 f7e60032c6618 Author: Johannes Berg Date: Wed Jun 7 19:43:52 2023 +0200 Merge wireless into wireless-next There are a number of upcoming things in both the stack and drivers that would otherwise conflict, so merge wireless to wireless-next to be able to avoid those conflicts. Signed-off-by: Johannes Berg commit 9831a9d1841fb3188c46a13da30aecd96bd1bae6 Author: Khaled Almahallawy Date: Tue Jun 6 15:44:28 2023 -0700 drm/i915/dp: Fix log level for "CDS interlane align done" "CDS interlane align done" is a passing condition not an error. Before adding new macros for logs it was drm_dbg_kms. Fixes: f48eab290287 ("drm/i915/dp: Add link training debug and error printing helpers") Cc: Imre Deak CC: Jani Nikula Signed-off-by: Khaled Almahallawy Signed-off-by: Imre Deak Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230606224428.3791006-1-khaled.almahallawy@intel.com commit 99f3e7de7a100eddcf92af55a7e23000afeed35c Author: Krzysztof Kozlowski Date: Wed Jun 7 19:13:26 2023 +0200 ASoC: codecs: wsa883x: use existing define instead of raw value Use existing define for WSA883X_GLOBAL_PA_ENABLE instead of hard-coded value, just like in other places in this driver. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230607171326.179527-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 1da185fc8288fadb952e06881d0b75e924780103 Author: Guo Hui Date: Fri May 26 10:47:15 2023 +0800 arm64: syscall: unmask DAIF for tracing status The following code: static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, const syscall_fn_t syscall_table[]) { ... if (!has_syscall_work(flags) && !IS_ENABLED(CONFIG_DEBUG_RSEQ)) { local_daif_mask(); flags = read_thread_flags(); -------------------------------- A if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP)) return; local_daif_restore(DAIF_PROCCTX); } trace_exit: syscall_trace_exit(regs); ------- B } 1. The flags in the if conditional statement should be used in the same way as the flags in the function syscall_trace_exit, because DAIF is not shielded in the function syscall_trace_exit, so when the flags are obtained in line A of the code, there is no need to shield DAIF. Don't care about the modification of flags after line A. 2. Masking DAIF caused syscall performance to deteriorate by about 10%. The Unixbench single core syscall performance data is as follows: Machine: Kunpeng 920 Mask DAIF: System Call Overhead 1172314.1 lps (10.0 s, 7 samples) System Benchmarks Partial Index BASELINE RESULT INDEX System Call Overhead 15000.0 1172314.1 781.5 ======== System Benchmarks Index Score (Partial Only) 781.5 Unmask DAIF: System Call Overhead 1287944.6 lps (10.0 s, 7 samples) System Benchmarks Partial Index BASELINE RESULT INDEX System Call Overhead 15000.0 1287944.6 858.6 ======== System Benchmarks Index Score (Partial Only) 858.6 Rationale from Mark Rutland as for why this is safe: This masking is an artifact of the old "ret_fast_syscall" assembly that was converted to C in commit: f37099b6992a0b81 ("arm64: convert syscall trace logic to C") The assembly would mask DAIF, check the thread flags, and fall through to kernel_exit without unmasking if no tracing was needed. The conversion copied this masking into the C version, though this wasn't strictly necessary. As (in general) thread flags can be manipulated by other threads, it's not safe to manipulate the thread flags with plain reads and writes, and since commit: 342b3808786518ce ("arm64: Snapshot thread flags") ... we use read_thread_flags() to read the flags atomically. With this, there is no need to mask DAIF transiently around reading the flags, as we only decide whether to trace while DAIF is masked, and the actual tracing occurs with DAIF unmasked. When el0_svc_common() returns its caller will unconditionally mask DAIF via exit_to_user_mode(), so the masking is redundant. Signed-off-by: Guo Hui Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20230526024715.8773-1-guohui@uniontech.com [catalin.marinas@arm.com: updated comment with Mark's rationale] Signed-off-by: Catalin Marinas commit 0ad902aa3b062a9f1dd51dc628e460896a3a405c Merge: 5b6d0b91f84cf b4f273774c8b2 Author: Mark Brown Date: Wed Jun 7 18:22:20 2023 +0100 spi: s3c64xx: Cleanups Merge series from Andi Shyti : Two small cleanups in the probe function. The first puts in use the managed spi master allocation while the second implements the dev_err_probe() function. commit 8da936e1b4bf958984cce25f569502b9fa15f3f7 Merge: 484ede9bcb031 3bd45b8dea73e Author: Mark Brown Date: Wed Jun 7 18:22:08 2023 +0100 ASoC: Intel: HDA: two cleanups Merge series from Pierre-Louis Bossart : One removal of a non-existent Kconfig initialization and one correction to enable SoundWire link when no HDaudio external codec is detected. This will generate more information and help resolve cases where the ACPI information is incorrect. commit b4c96ef0add5b701eb37be9830a98610e1d9b4a3 Author: Josh Poimboeuf Date: Tue May 30 10:21:14 2023 -0700 objtool: Skip reading DWARF section data Objtool doesn't use DWARF at all, and the DWARF sections' data take up a lot of memory. Skip reading them. Note this only skips the DWARF base sections, not the rela sections. The relas are needed because their symbol references may need to be reindexed if any local symbols get added by elf_create_symbol(). Also note the DWARF data will eventually be read by libelf anyway, when writing the object file. But that's fine, the goal here is to reduce *peak* memory usage, and the previous patch (which freed insn memory) gave some breathing room. So the allocation gets shifted to a later time, resulting in lower peak memory usage. With allyesconfig + CONFIG_DEBUG_INFO: - Before: peak heap memory consumption: 29.93G - After: peak heap memory consumption: 25.47G Link: https://lore.kernel.org/r/52a9698835861dd35f2ec35c49f96d0bb39fb177.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit d93b5935fd47007597aed5105a902a10204bc30e Author: Josh Poimboeuf Date: Tue May 30 10:21:13 2023 -0700 objtool: Free insns when done Free the decoded instructions as they're no longer needed after this point. This frees up a big chunk of heap, which will come handy when skipping the reading of DWARF section data. Link: https://lore.kernel.org/r/4d4bca1a0f869de020dac80d91f9acbf6df77eab.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit ec24b927c1fbfc91cf7a48276d9fd92072b17d3b Author: Josh Poimboeuf Date: Tue May 30 10:21:12 2023 -0700 objtool: Get rid of reloc->rel[a] Get the relocation entry info from the underlying rsec->data. With allyesconfig + CONFIG_DEBUG_INFO: - Before: peak heap memory consumption: 35.12G - After: peak heap memory consumption: 29.93G Link: https://lore.kernel.org/r/2be32323de6d8cc73179ee0ff14b71f4e7cefaa0.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 02b54001066364aee72bc4c802b42a96c6e0dc1f Author: Josh Poimboeuf Date: Tue May 30 10:21:11 2023 -0700 objtool: Shrink elf hash nodes Instead of using hlist for the 'struct elf' hashes, use a custom single-linked list scheme. With allyesconfig + CONFIG_DEBUG_INFO: - Before: peak heap memory consumption: 36.89G - After: peak heap memory consumption: 35.12G Link: https://lore.kernel.org/r/6e8cd305ed22e743c30d6e72cfdc1be20fb94cd4.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 890f10a433f51f95eccaec13d46dde769ccc113b Author: Josh Poimboeuf Date: Tue May 30 10:21:10 2023 -0700 objtool: Shrink reloc->sym_reloc_entry Convert it to a singly-linked list. With allyesconfig + CONFIG_DEBUG_INFO: - Before: peak heap memory consumption: 38.64G - After: peak heap memory consumption: 36.89G Link: https://lore.kernel.org/r/a51f0a6f9bbf2494d5a3a449807307e78a940988.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit be2f0b1e12644c956a347d7fde93c2ffe9cdb1af Author: Josh Poimboeuf Date: Tue May 30 10:21:09 2023 -0700 objtool: Get rid of reloc->jump_table_start Rework the jump table logic slightly so 'jump_table_start' is no longer needed. With allyesconfig + CONFIG_DEBUG_INFO: - Before: peak heap memory consumption: 40.37G - After: peak heap memory consumption: 38.64G Link: https://lore.kernel.org/r/e1602ed8a6171ada3cfac0bd8449892ec82bd188.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 0696b6e314dbe4bd2f24d5e749469f57ea095a9f Author: Josh Poimboeuf Date: Tue May 30 10:21:08 2023 -0700 objtool: Get rid of reloc->addend Get the addend from the embedded GElf_Rel[a] struct. With allyesconfig + CONFIG_DEBUG_INFO: - Before: peak heap memory consumption: 42.10G - After: peak heap memory consumption: 40.37G Link: https://lore.kernel.org/r/ad2354f95d9ddd86094e3f7687acfa0750657784.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit fcee899d2794319c9dbeb7b877b0c4ac92f5dd16 Author: Josh Poimboeuf Date: Tue May 30 10:21:07 2023 -0700 objtool: Get rid of reloc->type Get the type from the embedded GElf_Rel[a] struct. Link: https://lore.kernel.org/r/d1c1f8da31e4f052a2478aea585fcf355cacc53a.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit e4cbb9b81f1f7519c7ae3abda09cb15794022952 Author: Josh Poimboeuf Date: Tue May 30 10:21:06 2023 -0700 objtool: Get rid of reloc->offset Get the offset from the embedded GElf_Rel[a] struct. With allyesconfig + CONFIG_DEBUG_INFO: - Before: peak heap memory consumption: 43.83G - After: peak heap memory consumption: 42.10G Link: https://lore.kernel.org/r/2b9ec01178baa346a99522710bf2e82159412e3a.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit be9a4c116824c39720001db5bc45fe7528b26cff Author: Josh Poimboeuf Date: Tue May 30 10:21:05 2023 -0700 objtool: Get rid of reloc->idx Use the array offset to calculate the reloc index. With allyesconfig + CONFIG_DEBUG_INFO: - Before: peak heap memory consumption: 45.56G - After: peak heap memory consumption: 43.83G Link: https://lore.kernel.org/r/7351d2ebad0519027db14a32f6204af84952574a.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit ebcef730a19ba7ca446169f391d2e51722d68043 Author: Josh Poimboeuf Date: Tue May 30 10:21:04 2023 -0700 objtool: Get rid of reloc->list Now that all relocs are allocated in an array, the linked list is no longer needed. With allyesconfig + CONFIG_DEBUG_INFO: - Before: peak heap memory consumption: 49.02G - After: peak heap memory consumption: 45.56G Link: https://lore.kernel.org/r/71e7a2c017dbc46bb497857ec97d67214f832d10.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit e0a9349b4c590145c6a83e6c9f7701cec42debbd Author: Josh Poimboeuf Date: Tue May 30 10:21:03 2023 -0700 objtool: Allocate relocs in advance for new rela sections Similar to read_relocs(), allocate the reloc structs all together in an array rather than allocating them one at a time. Link: https://lore.kernel.org/r/5332d845c5a2d6c2d052075b381bfba8bcb67ed5.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit caa4a6b74b405ddaea40e2946cc3983aac96451d Author: Josh Poimboeuf Date: Tue May 30 10:21:02 2023 -0700 objtool: Add for_each_reloc() Link: https://lore.kernel.org/r/dbfcb1037d8b958e52d097b67829c4c6811c24bb.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 5201a9bcb7d3f98ab99c17325b0aa925c2888ca3 Author: Josh Poimboeuf Date: Tue May 30 10:21:01 2023 -0700 objtool: Don't free memory in elf_close() It's not necessary, objtool's about to exit anyway. Link: https://lore.kernel.org/r/74bdb3058b8f029db8d5b3b5175f2a200804196d.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit fcf933552bebdecd72b324738c6635f46b0df569 Author: Josh Poimboeuf Date: Tue May 30 10:21:00 2023 -0700 objtool: Keep GElf_Rel[a] structs synced Keep the GElf_Rela structs synced with their 'struct reloc' counterparts instead of having to go back and "rebuild" them later. Link: https://lore.kernel.org/r/156d8a3e528a11e5c8577cf552890ed1f2b9567b.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 6342a20efbd8b70d169c325b2c27a8a8f96388d5 Author: Josh Poimboeuf Date: Tue May 30 10:20:59 2023 -0700 objtool: Add elf_create_section_pair() When creating an annotation section, allocate the reloc section data at the beginning. This simplifies the data model a bit and also saves memory due to the removal of malloc() in elf_rebuild_reloc_section(). With allyesconfig + CONFIG_DEBUG_INFO: - Before: peak heap memory consumption: 53.49G - After: peak heap memory consumption: 49.02G Link: https://lore.kernel.org/r/048e908f3ede9b66c15e44672b6dda992b1dae3e.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit ff4082730c2aaff3706232266e09d1ae4b350521 Author: Josh Poimboeuf Date: Tue May 30 10:20:58 2023 -0700 objtool: Add mark_sec_changed() Ensure elf->changed always gets set when sec->changed gets set. Link: https://lore.kernel.org/r/9a810a8d2e28af6ba07325362d0eb4703bb09d3a.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit eb0481bbc4ce386e73e28ad8590b4f12c8aded56 Author: Josh Poimboeuf Date: Tue May 30 10:20:57 2023 -0700 objtool: Fix reloc_hash size With CONFIG_DEBUG_INFO, DWARF creates a lot of relocations and reloc_hash is woefully undersized, which can affect performance significantly. Fix that. Link: https://lore.kernel.org/r/38ef60dc8043270bf3b9dfd139ae2a30ca3f75cc.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 53257a977a69b5eabbaafb64dcd767d2a4fef2b3 Author: Josh Poimboeuf Date: Tue May 30 10:20:56 2023 -0700 objtool: Consolidate rel/rela handling The GElf_Rel[a] structs have more similarities than differences. It's safe to hard-code the assumptions about their shared fields as they will never change. Consolidate their handling where possible, getting rid of duplicated code. Also, at least for now we only ever create rela sections, so simplify the relocation creation code to be rela-only. Link: https://lore.kernel.org/r/dcabf6df400ca500ea929f1e4284f5e5ec0b27c8.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit a5bd623653231bce8657978e9d2c2ebfaf19e297 Author: Josh Poimboeuf Date: Tue May 30 10:20:55 2023 -0700 objtool: Improve reloc naming - The term "reloc" is overloaded to mean both "an instance of struct reloc" and "a reloc section". Change the latter to "rsec". - For variable names, use "sec" for regular sections and "rsec" for rela sections to prevent them getting mixed up. - For struct reloc variables, use "reloc" instead of "rel" everywhere for consistency. Link: https://lore.kernel.org/r/8b790e403df46f445c21003e7893b8f53b99a6f3.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 2707579dfa615a5dda4aabb92e433f03a87b5ec5 Author: Josh Poimboeuf Date: Tue May 30 10:20:54 2023 -0700 objtool: Remove flags argument from elf_create_section() Simplify the elf_create_section() interface a bit by removing the flags argument. Most callers don't care about changing the section header flags. If needed, they can be modified afterwards, just like any other section header field. Link: https://lore.kernel.org/r/515235d9cf62637a14bee37bfa9169ef20065471.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 809373e17b2649948cc681dd1962b2736b22c7a6 Author: Josh Poimboeuf Date: Tue May 30 10:20:53 2023 -0700 objtool: Tidy elf.h Reorganize elf.h a bit: - Move the prototypes higher up so they can be used by the inline functions. - Move hash-related code to the bottom. - Remove the unused ELF_HASH_BITS macro. No functional changes. Link: https://lore.kernel.org/r/b1490ed85951868219a6ece177a7cd30a6454d66.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit a9da8247627eefc73f909bf945031a5431a53993 Author: Josh Poimboeuf Date: Mon Jun 5 09:12:22 2023 -0700 drm/vmwgfx: Add unwind hints around RBP clobber VMware high-bandwidth hypercalls take the RBP register as input. This breaks basic frame pointer convention, as RBP should never be clobbered. So frame pointer unwinding is broken for the instructions surrounding the hypercalls. Fortunately this doesn't break live patching with CONFIG_FRAME_POINTER, as it only unwinds from blocking tasks, and stack traces from preempted tasks are already marked unreliable anyway. However, for live patching with ORC, this could actually be a theoretical problem if vmw_port_hb_{in,out}() were still compiled with a frame pointer due to having an aligned stack. In practice that hasn't seemed to be an issue since the objtool warnings have only been seen with CONFIG_FRAME_POINTER. Add unwind hint annotations to tell the ORC unwinder to mark stack traces as unreliable. Fixes the following warnings: vmlinux.o: warning: objtool: vmw_port_hb_in+0x1df: return with modified stack frame vmlinux.o: warning: objtool: vmw_port_hb_out+0x1dd: return with modified stack frame Fixes: 89da76fde68d ("drm/vmwgfx: Add VMWare host messaging capability") Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202305160135.97q0Elax-lkp@intel.com/ Link: https://lore.kernel.org/r/4c795f2d87bc0391cf6543bcb224fa540b55ce4b.1685981486.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 1e4b619185e83e54aca617cf5070c64a88fe936b Author: Josh Poimboeuf Date: Mon Jun 5 09:12:21 2023 -0700 objtool: Allow stack operations in UNWIND_HINT_UNDEFINED regions If the code specified UNWIND_HINT_UNDEFINED, skip the "undefined stack state" warning due to a stack operation. Just ignore the stack op and continue to propagate the undefined state. Link: https://lore.kernel.org/r/820c5b433f17c84e8761fb7465a8d319d706b1cf.1685981486.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 7dae5f086fceba6b0a4735b63dbcb4795f353c39 Author: Mark Rutland Date: Wed Jun 7 17:48:46 2023 +0100 arm64: cpufeature: fold cpus_set_cap() into update_cpu_capabilities() We only use cpus_set_cap() in update_cpu_capabilities(), where we open-code an analgous update to boot_cpucaps. Due to the way the cpucap_ptrs[] array is initialized, we know that the capability number cannot be greater than or equal to ARM64_NCAPS, so the warning is superfluous. Fold cpus_set_cap() into update_cpu_capabilities(), matching what we do for the boot_cpucaps, and making the relationship between the two a bit clearer. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Suzuki K Poulose Cc: Marc Zyngier Cc: Mark Brown Cc: Will Deacon Link: https://lore.kernel.org/r/20230607164846.3967305-5-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 1c8ae42975bd708f6c8c73d011025868b23076b3 Author: Mark Rutland Date: Wed Jun 7 17:48:45 2023 +0100 arm64: cpufeature: use cpucap naming To more clearly align the various users of the cpucap enumeration, this patch changes the cpufeature code to use the term `cpucap` in favour of `cpu_hwcap`. This more clearly aligns with other users of the cpucaps, and avoids confusion with the ELF hwcaps. There should be no functional change as a result of this patch; this is purely a renaming exercise. Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Reviewed-by: Suzuki K Poulose Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20230607164846.3967305-4-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 5235c7e2cfccb5bbd71aeda26240bb7877072782 Author: Mark Rutland Date: Wed Jun 7 17:48:44 2023 +0100 arm64: alternatives: use cpucap naming To more clearly align the various users of the cpucap enumeration, this patch changes the alternative code to use the term `cpucap` in favour of `feature`. The alternative_has_feature_{likely,unlikely}() functions are renamed to alternative_has_cap_ Reviewed-by: Suzuki K Poulose Cc: Marc Zyngier Cc: Mark Brown Cc: Will Deacon Link: https://lore.kernel.org/r/20230607164846.3967305-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 7f242982e408d530958dd6efee059f353f636cf1 Author: Mark Rutland Date: Wed Jun 7 17:48:43 2023 +0100 arm64: standardise cpucap bitmap names The 'cpu_hwcaps' and 'boot_capabilities' bitmaps are bitmaps have the same enumerated bits, but are named wildly differently for no good reason. The terms 'hwcaps' and 'capabilities' have become ambiguous over time (e.g. due to clashes with ELF hwcaps and the structures used to manage feature detection), and it would be nicer to use 'cpucaps', matching the header the enumerated bit indices are defined in. While this isn't a functional problem, it makes the code harder than necessary to understand, and hard to extend with related functionality (e.g. per-cpu cpucap bitmaps). To that end, this patch renames `boot_capabilities` to `boot_cpucaps` and `cpu_hwcaps` to `system_cpucaps`. This more clearly indicates the relationship between the two and aligns with terminology used elsewhere in our feature management code. This change was scripted with: | find . -type f -name '*.[chS]' -print0 | \ | xargs -0 sed -i 's/\/boot_cpucaps/' | find . -type f -name '*.[chS]' -print0 | \ | xargs -0 sed -i 's/\/system_cpucaps/' ... and the instance of "cpu_hwcap" (without a trailing "s") in corrected manually to "system_cpucaps". Subsequent patches will adjust the naming of related functions to better align with the `cpucap` naming. There should be no functional change as a result of this patch; this is purely a renaming exercise. Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Reviewed-by: Suzuki K Poulose Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20230607164846.3967305-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit ac27ecf68a1ada240bb71531dc2d30cde04ad70a Author: Josh Poimboeuf Date: Tue May 30 16:07:41 2023 -0700 x86/entry: Move thunk restore code into thunk functions There's no need for both thunk functions to jump to the same shared thunk restore code which lives outside the thunk function boundaries. It disrupts i-cache locality and confuses objtool. Keep it simple by keeping each thunk's restore code self-contained within the function. Fixes a bunch of false positive "missing __noreturn" warnings like: vmlinux.o: warning: objtool: do_arch_prctl_common+0xf4: preempt_schedule_thunk() is missing a __noreturn annotation Fixes: fedb724c3db5 ("objtool: Detect missing __noreturn annotations") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305281037.3PaI3tW4-lkp@intel.com/ Link: https://lore.kernel.org/r/46aa8aeb716f302e22e1673ae15ee6fe050b41f4.1685488050.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 020126239b8f376ed2f0bef9dc07d0b280a0b7f5 Author: Josh Poimboeuf Date: Tue May 16 06:56:46 2023 -0700 Revert "x86/orc: Make it callthunk aware" Commit 396e0b8e09e8 ("x86/orc: Make it callthunk aware") attempted to deal with the fact that function prefix code didn't have ORC coverage. However, it didn't work as advertised. Use of the "null" ORC entry just caused affected unwinds to end early. The root cause has now been fixed with commit 5743654f5e2e ("objtool: Generate ORC data for __pfx code"). Revert most of commit 396e0b8e09e8 ("x86/orc: Make it callthunk aware"). The is_callthunk() function remains as it's now used by other code. Link: https://lore.kernel.org/r/a05b916ef941da872cbece1ab3593eceabd05a79.1684245404.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 4a03aa34432abe0703abf232f31fc5e2ed8256f6 Author: Peter Zijlstra Date: Mon Nov 14 16:23:45 2022 +0100 lkdtm: Avoid objtool/ibt warning For certain configs objtool will complain like: vmlinux.o: warning: objtool: lkdtm_UNSET_SMEP+0x1c3: relocation to !ENDBR: native_write_cr4+0x41 What happens is that GCC optimizes the loop: insn = (unsigned char *)native_write_cr4; for (i = 0; i < MOV_CR4_DEPTH; i++) to read something like: for (insn = (unsigned char *)native_write_cr4; insn < (unsigned char *)native_write_cr4 + MOV_CR4_DEPTH; insn++) Which then obviously generates the text reference native_write_cr4+041. Since none of this is a fast path, simply confuse GCC enough to inhibit this optimization. Reported-by: kernel test robot Signed-off-by: Peter Zijlstra (Intel) Acked-by: Kees Cook Link: https://lore.kernel.org/r/Y3JdgbXRV0MNZ+9h@hirez.programming.kicks-ass.net Signed-off-by: Josh Poimboeuf commit d49d1666aab51ad3caf79f414aff6b641837a6ea Author: Lu Hongfei Date: Tue May 30 15:56:49 2023 +0800 tools: Remove unnecessary variables There are several places where warnings variables are not needed, remove them and directly return 0. Signed-off-by: Lu Hongfei Link: https://lore.kernel.org/r/20230530075649.21661-1-luhongfei@vivo.com Signed-off-by: Josh Poimboeuf commit a9d1c4c6df0e568207907c04aed9e7beb1294c42 Author: Miklos Szeredi Date: Wed Jun 7 17:49:20 2023 +0200 fuse: revalidate: don't invalidate if interrupted If the LOOKUP request triggered from fuse_dentry_revalidate() is interrupted, then the dentry will be invalidated, possibly resulting in submounts being unmounted. Reported-by: Xu Rongbo Closes: https://lore.kernel.org/all/CAJfpegswN_CJJ6C3RZiaK6rpFmNyWmXfaEpnQUJ42KCwNF5tWw@mail.gmail.com/ Fixes: 9e6268db496a ("[PATCH] FUSE - read-write operations") Cc: Signed-off-by: Miklos Szeredi commit 3066ff93476c35679cb07a97cce37d9bb07632ff Author: Bernd Schubert Date: Fri Apr 15 13:53:56 2022 +0200 fuse: Apply flags2 only when userspace set the FUSE_INIT_EXT This is just a safety precaution to avoid checking flags on memory that was initialized on the user space side. libfuse zeroes struct fuse_init_out outarg, but this is not guranteed to be done in all implementations. Better is to act on flags and to only apply flags2 when FUSE_INIT_EXT is set. There is a risk with this change, though - it might break existing user space libraries, which are already using flags2 without setting FUSE_INIT_EXT. The corresponding libfuse patch is here https://github.com/libfuse/libfuse/pull/662 Signed-off-by: Bernd Schubert Fixes: 53db28933e95 ("fuse: extend init flags") Cc: # v5.17 Signed-off-by: Miklos Szeredi commit 81b1b599dfd71c958418dad586fa72c8d30d1065 Author: Fei Yang Date: Tue Jun 6 12:00:42 2023 +0200 drm/i915: Allow user to set cache at BO creation To comply with the design that buffer objects shall have immutable cache setting through out their life cycle, {set, get}_caching ioctl's are no longer supported from MTL onward. With that change caching policy can only be set at object creation time. The current code applies a default (platform dependent) cache setting for all objects. However this is not optimal for performance tuning. The patch extends the existing gem_create uAPI to let user set PAT index for the object at creation time. The new extension is platform independent, so UMD's can switch to using this extension for older platforms as well, while {set, get}_caching are still supported on these legacy paltforms for compatibility reason. However, since PAT index was not clearly defined for platforms prior to GEN12 (TGL), so we are limiting this externsion to GEN12+ platforms only. See ext_set_pat() in for the implementation details. The documentation related to the PAT/MOCS tables is currently available for Tiger Lake here: https://www.intel.com/content/www/us/en/docs/graphics-for-linux/developer-reference/1-0/tiger-lake.html The documentation for other platforms is currently being updated. BSpec: 45101 Mesa support has been submitted in this merge request: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878 The media driver supprt has bin submitted in this merge request: https://github.com/intel/media-driver/pull/1680 The IGT test related to this change is igt@gem_create@create-ext-set-pat Signed-off-by: Fei Yang Cc: Chris Wilson Cc: Matt Roper Cc: Andi Shyti Reviewed-by: Andi Shyti Acked-by: Jordan Justen Tested-by: Jordan Justen Acked-by: Carl Zhang Tested-by: Lihao Gu Signed-off-by: Andi Shyti Acked-by: Tvrtko Ursulin Acked-by: Slawomir Milczarek Link: https://patchwork.freedesktop.org/patch/msgid/20230606100042.482345-2-andi.shyti@linux.intel.com commit c9d934053d9e850bc901b6425eacb5fe3d4b1738 Author: Johan Hovold Date: Sun Jun 4 14:35:05 2023 +0200 USB: serial: report unsupported break signalling Instead of returning success when a driver does not support break signalling, return an error to let user space know and to avoid waiting when break is not supported. Tested-by: Corey Minyard Signed-off-by: Johan Hovold commit f4bbae27b32ea0ffb9e25931b9769600e8d8a664 Author: Johan Hovold Date: Sun Jun 4 14:35:04 2023 +0200 USB: serial: cp210x: disable break signalling on CP2105 SCI Only the first UART interface (ECI) on CP2105 supports break signalling. Return an error on requests for break state changes for the second interface (SCI) to avoid transmitting a garbage character and waiting when break is not supported. Tested-by: Corey Minyard Signed-off-by: Johan Hovold commit 6ff58ae17fd9523246a260434133ed9ab7f56df2 Author: Johan Hovold Date: Sun Jun 4 14:35:03 2023 +0200 USB: serial: return errors from break handling Start propagating errors to user space when setting the break state fails. This will be used by follow-on changes to also report when a driver or device does not support break control. Tested-by: Corey Minyard Signed-off-by: Johan Hovold commit 1c3610d30e5c15f4db7eb8465e311b582aa50ebe Author: zyfjeff Date: Tue Dec 13 19:51:47 2022 +0800 fuse: remove duplicate check for nodeid before this check, the nodeid has already been checked once, so the check here doesn't make an sense, so remove the check for nodeid here. if (err || !outarg->nodeid) goto out_put_forget; err = -EIO; >>> if (!outarg->nodeid) goto out_put_forget; Signed-off-by: zyfjeff Signed-off-by: Miklos Szeredi commit 5cadfbd5a11e5495cac217534c5f788168b1afd7 Author: Miklos Szeredi Date: Mon Mar 27 16:14:49 2023 +0200 fuse: add feature flag for expire-only Add an init flag idicating whether the FUSE_EXPIRE_ONLY flag of FUSE_NOTIFY_INVAL_ENTRY is effective. This is needed for backports of this feature, otherwise the server could just check the protocol version. Fixes: 4f8d37020e1f ("fuse: add "expire only" mode to FUSE_NOTIFY_INVAL_ENTRY") Cc: # v6.2 Signed-off-by: Miklos Szeredi commit 2d62aab57d2ace03d840c08fb323ed1b9bd83a94 Author: Andrew Davis Date: Mon May 15 13:35:15 2023 -0500 ARM: dts: keystone: Do not capitalize hex digits Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230515183515.509371-5-afd@ti.com Signed-off-by: Nishanth Menon commit 4b3498372664efe3755255402537e243bc83eb82 Author: Andrew Davis Date: Mon May 15 13:35:14 2023 -0500 ARM: dts: keystone: Remove ti,keystone from soc node compatible This is just a "simple-bus" node, there is no need for the extra compatible "ti,keystone" which is unused and undocumented. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230515183515.509371-4-afd@ti.com Signed-off-by: Nishanth Menon commit 5ae8afd41ea5a1767d0b683ffa8f9ff3d9c7e68c Author: Andrew Davis Date: Mon May 15 13:35:13 2023 -0500 ARM: dts: keystone: Fix EEPROM node names These should follow the standard EEPROM node naming convention. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20230515183515.509371-3-afd@ti.com Signed-off-by: Nishanth Menon commit 98788f7914af3fcb41101d76f02e1daed5e450a0 Author: Tony Lindgren Date: Tue May 23 10:48:43 2023 +0300 ARM: dts: Unify pinctrl-single pin group nodes for keystone We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230523074845.59433-1-tony@atomide.com Signed-off-by: Nishanth Menon commit 1341c7d2ccf42ed91aea80b8579d35bc1ea381e2 Author: Christoph Hellwig Date: Wed Jun 7 15:57:46 2023 +0200 block: fix rootwait= Failures to look up the gendisk must return -ENODEV so that rootwait retries the lookup instead of -EINVAL which exits early. Fixes: cf056a431215 ("init: improve the name_to_dev_t interface") Reported-by: Fabio Estevam Signed-off-by: Christoph Hellwig Tested-by: Fabio Estevam Link: https://lore.kernel.org/r/20230607135746.92995-1-hch@lst.de Signed-off-by: Jens Axboe commit 3d2af77e31ade05ff7ccc3658c3635ec1bea0979 Author: Waiman Long Date: Tue Jun 6 14:07:24 2023 -0400 blk-cgroup: Reinit blkg_iostat_set after clearing in blkcg_reset_stats() When blkg_alloc() is called to allocate a blkcg_gq structure with the associated blkg_iostat_set's, there are 2 fields within blkg_iostat_set that requires proper initialization - blkg & sync. The former field was introduced by commit 3b8cc6298724 ("blk-cgroup: Optimize blkcg_rstat_flush()") while the later one was introduced by commit f73316482977 ("blk-cgroup: reimplement basic IO stats using cgroup rstat"). Unfortunately those fields in the blkg_iostat_set's are not properly re-initialized when they are cleared in v1's blkcg_reset_stats(). This can lead to a kernel panic due to NULL pointer access of the blkg pointer. The missing initialization of sync is less problematic and can be a problem in a debug kernel due to missing lockdep initialization. Fix these problems by re-initializing them after memory clearing. Fixes: 3b8cc6298724 ("blk-cgroup: Optimize blkcg_rstat_flush()") Fixes: f73316482977 ("blk-cgroup: reimplement basic IO stats using cgroup rstat") Signed-off-by: Waiman Long Reviewed-by: Ming Lei Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230606180724.2455066-1-longman@redhat.com Signed-off-by: Jens Axboe commit a7cfa0af0c88353b4eb59db5a2a0fbe35329b3f9 Author: Yu Kuai Date: Tue Jun 6 09:14:38 2023 +0800 blk-ioc: fix recursive spin_lock/unlock_irq() in ioc_clear_queue() Recursive spin_lock/unlock_irq() is not safe, because spin_unlock_irq() will enable irq unconditionally: spin_lock_irq queue_lock -> disable irq spin_lock_irq ioc->lock spin_unlock_irq ioc->lock -> enable irq /* * AA dead lock will be triggered if current context is preempted by irq, * and irq try to hold queue_lock again. */ spin_unlock_irq queue_lock Fix this problem by using spin_lock/unlock() directly for 'ioc->lock'. Fixes: 5a0ac57c48aa ("blk-ioc: protect ioc_destroy_icq() by 'queue_lock'") Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230606011438.3743440-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit f12bc113ce904777fd6ca003b473b427782b3dde Author: Zhong Jinghua Date: Mon Jun 5 20:21:59 2023 +0800 nbd: Add the maximum limit of allocated index in nbd_dev_add If the index allocated by idr_alloc greater than MINORMASK >> part_shift, the device number will overflow, resulting in failure to create a block device. Fix it by imiting the size of the max allocation. Signed-off-by: Zhong Jinghua Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230605122159.2134384-1-zhongjinghua@huaweicloud.com Signed-off-by: Jens Axboe commit 43fc0a99906e04792786edf8534d8d58d1e9de0c Author: Nathan Chancellor Date: Tue Jun 6 15:40:35 2023 -0700 kbuild: Add KBUILD_CPPFLAGS to as-option invocation After commit feb843a469fb ("kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS"), there is an error while building certain PowerPC assembly files with clang: arch/powerpc/lib/copypage_power7.S: Assembler messages: arch/powerpc/lib/copypage_power7.S:34: Error: junk at end of line: `0b01000' arch/powerpc/lib/copypage_power7.S:35: Error: junk at end of line: `0b01010' arch/powerpc/lib/copypage_power7.S:37: Error: junk at end of line: `0b01000' arch/powerpc/lib/copypage_power7.S:38: Error: junk at end of line: `0b01010' arch/powerpc/lib/copypage_power7.S:40: Error: junk at end of line: `0b01010' clang: error: assembler command failed with exit code 1 (use -v to see invocation) as-option only uses KBUILD_AFLAGS, so after removing CLANG_FLAGS from KBUILD_AFLAGS, there is no more '--target=' or '--prefix=' flags. As a result of those missing flags, the host target will be tested during as-option calls and likely fail, meaning necessary flags may not get added when building assembly files, resulting in errors like seen above. Add KBUILD_CPPFLAGS to as-option invocations to clear up the errors. This should have been done in commit d5c8d6e0fa61 ("kbuild: Update assembler calls to use proper flags and language target"), which switched from using the assembler target to the assembler-with-cpp target, so flags that affect preprocessing are passed along in all relevant tests. as-option now mirrors cc-option. Fixes: feb843a469fb ("kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS") Reported-by: Linux Kernel Functional Testing Closes: https://lore.kernel.org/CA+G9fYs=koW9WardsTtora+nMgLR3raHz-LSLr58tgX4T5Mxag@mail.gmail.com/ Signed-off-by: Nathan Chancellor Tested-by: Naresh Kamboju Signed-off-by: Masahiro Yamada commit 200dd957a7a72278363a8f2a49d2e90491bdb1b4 Author: Pierre-Clément Tosi Date: Tue Jun 6 18:19:36 2023 +0000 scripts/mksysmap: Ignore __pi_ local arm64 symbols Similarly to "__kvm_nvhe_", filter out any local symbol that was prefixed with "__pi_" (generated when CONFIG_RANDOMIZE_BASE=y) when compiling System.map and in kallsyms. Signed-off-by: Pierre-Clément Tosi Acked-by: Ard Biesheuvel Signed-off-by: Masahiro Yamada commit ec336aa83162fe0f3d554baed2d4e2589b69ec6e Author: Pierre-Clément Tosi Date: Tue Jun 6 17:35:53 2023 +0000 scripts/mksysmap: Fix badly escaped '$' The backslash characters escaping '$' in the command to sed (intended to prevent it from interpreting '$' as "end-of-line") are currently being consumed by the Shell (where they mean that sh should not evaluate what follows '$' as a variable name). This means that sed -e "/ \$/d" executes the script / $/d instead of the intended / \$/d So escape twice in mksysmap any '$' that actually needs to reach sed escaped so that the backslash survives the Shell. Fixes: c4802044a0a7 ("scripts/mksysmap: use sed with in-line comments") Fixes: 320e7c9d4494 ("scripts/kallsyms: move compiler-generated symbol patterns to mksysmap") Signed-off-by: Pierre-Clément Tosi Signed-off-by: Masahiro Yamada commit 20ff36856fe00879f82de71fe6f1482ca1b72334 Author: Masahiro Yamada Date: Tue Jun 6 18:41:59 2023 +0900 modpost: propagate W=1 build option to modpost "No build warning" is a strong requirement these days, so you must fix all issues before enabling a new warning flag. We often add a new warning to W=1 first so that the kbuild test robot blocks new breakages. This commit allows modpost to show extra warnings only when W=1 (or KBUILD_EXTRA_WARN=1) is given. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 0a2f6372a43ff5e948b8b10be34d4473f6c2ef6c Author: Christoph Hellwig Date: Fri Apr 7 08:31:30 2023 +0200 drm/nouveau: stop using is_swiotlb_active Drivers have no business looking into dma-mapping internals and check what backend is used. Unfortunstely the DRM core is still broken and tries to do plain page allocations instead of using DMA API allocators by default and uses various bandaids on when to use dma_alloc_coherent. Switch nouveau to use the same (broken) scheme as amdgpu and radeon to remove the last driver user of is_swiotlb_active. Signed-off-by: Christoph Hellwig Reviewed-by: Lyude Paul commit 484ede9bcb031a98880817480b685cac0ec96f2b Author: Arnd Bergmann Date: Wed Jun 7 14:08:15 2023 +0200 ASoC: mediatek: mt8188-mt6359: add i2c dependency The newly added driver is missing this dependency, causing a possible build failure: WARNING: unmet direct dependencies detected for SND_SOC_MAX98390 WARNING: unmet direct dependencies detected for SND_SOC_NAU8825 Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=m] Selected by [y]: - SND_SOC_MT8188_MT6359 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_MT8188 [=y] && MTK_PMIC_WRAP [=y] aarch64-linux-ld: sound/soc/codecs/max98390.o: in function `max98390_i2c_probe': max98390.c:(.text+0x514): undefined reference to `__devm_regmap_init_i2c' Fixes: 9f08dcbddeb30 ("ASoC: mediatek: mt8188-mt6359: support new board with nau88255") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230607120831.3587379-1-arnd@kernel.org Signed-off-by: Mark Brown commit 693405cf11357017ea29764e3bd9488a2d292d8f Author: Petr Tesarik Date: Wed Jun 7 11:04:18 2023 +0200 swiotlb: use the atomic counter of total used slabs if available If DEBUG_FS is enabled, the cost of keeping an exact number of total used slabs is already paid. In this case, there is no reason to use an inexact number for statistics and kernel messages. Signed-off-by: Petr Tesarik Signed-off-by: Christoph Hellwig commit efa76afdde16f195f8faff0e8dbe58ec18aad70c Author: Petr Tesarik Date: Tue Jun 6 14:46:25 2023 +0200 swiotlb: remove unused field "used" from struct io_tlb_mem Commit 20347fca71a3 ("swiotlb: split up the global swiotlb lock") moved the number of used slots to struct io_tlb_area, but it did not remove the field from struct io_tlb_mem. Signed-off-by: Petr Tesarik Signed-off-by: Christoph Hellwig commit 51ff97d54f02b4444dfc42e380ac4c058e12d5dd Author: gaoxu Date: Tue Jun 6 12:47:37 2023 +0000 dma-remap: use kvmalloc_array/kvfree for larger dma memory remap If dma_direct_alloc() alloc memory in size of 64MB, the inner function dma_common_contiguous_remap() will allocate 128KB memory by invoking the function kmalloc_array(). and the kmalloc_array seems to fail to try to allocate 128KB mem. Call trace: [14977.928623] qcrosvm: page allocation failure: order:5, mode:0x40cc0 [14977.928638] dump_backtrace.cfi_jt+0x0/0x8 [14977.928647] dump_stack_lvl+0x80/0xb8 [14977.928652] warn_alloc+0x164/0x200 [14977.928657] __alloc_pages_slowpath+0x9f0/0xb4c [14977.928660] __alloc_pages+0x21c/0x39c [14977.928662] kmalloc_order+0x48/0x108 [14977.928666] kmalloc_order_trace+0x34/0x154 [14977.928668] __kmalloc+0x548/0x7e4 [14977.928673] dma_direct_alloc+0x11c/0x4f8 [14977.928678] dma_alloc_attrs+0xf4/0x138 [14977.928680] gh_vm_ioctl_set_fw_name+0x3c4/0x610 [gunyah] [14977.928698] gh_vm_ioctl+0x90/0x14c [gunyah] [14977.928705] __arm64_sys_ioctl+0x184/0x210 work around by doing kvmalloc_array instead. Signed-off-by: Gao Xu Reviewed-by: Suren Baghdasaryan Signed-off-by: Christoph Hellwig commit 4d3af20eaf3fcd481a797738bb46634e37f4a1cc Author: Sui Jingfeng Date: Sun Jun 4 21:50:54 2023 +0800 dma-mapping: fix a Kconfig typo 'thing' -> 'think' Signed-off-by: Sui Jingfeng Signed-off-by: Christoph Hellwig commit 2f2f43dd21f8928128c55afd386472feb679630b Merge: 30e15cb0fbb51 f17ccc5deb4d0 Author: Mark Brown Date: Wed Jun 7 13:39:25 2023 +0100 TI TPS6594 PMIC support (RTC, pinctrl, regulators) Merge series from Esteban Blanc : TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine). The SoC and the PMIC can communicate through the I2C or SPI interfaces. TPS6594 is the super-set device while TPS6593 and LP8764 are derivatives. This series adds support to TI TPS6594 PMIC and its derivatives. commit 30e15cb0fbb51513586a49d299798245a1c4a207 Merge: 3b88f5fba2448 3a76c7ca9e772 Author: Mark Brown Date: Wed Jun 7 13:28:09 2023 +0100 spi-geni-qcom: Add new interfaces and utilise them Merge series from Vijaya Krishna Nivarthi : A "known issue" during implementation of SE DMA for spi geni driver was that it does DMA map/unmap internally instead of in spi framework. Current patches remove this hiccup and also clean up code a bit. Testing revealed no regressions and results with 1000 iterations of reading from EC showed no loss of performance. Results ======= Before - Iteration 999, min=5.10, max=5.17, avg=5.14, ints=25129 After - Iteration 999, min=5.10, max=5.20, avg=5.15, ints=25153 commit 8b64d420fe2450f82848178506d3e3a0bd195539 Author: Tetsuo Handa Date: Wed Jun 7 19:19:02 2023 +0900 debugobjects: Recheck debug_objects_enabled before reporting syzbot is reporting false a positive ODEBUG message immediately after ODEBUG was disabled due to OOM. [ 1062.309646][T22911] ODEBUG: Out of memory. ODEBUG disabled [ 1062.886755][ T5171] ------------[ cut here ]------------ [ 1062.892770][ T5171] ODEBUG: assert_init not available (active state 0) object: ffffc900056afb20 object type: timer_list hint: process_timeout+0x0/0x40 CPU 0 [ T5171] CPU 1 [T22911] -------------- -------------- debug_object_assert_init() { if (!debug_objects_enabled) return; db = get_bucket(addr); lookup_object_or_alloc() { debug_objects_enabled = 0; return NULL; } debug_objects_oom() { pr_warn("Out of memory. ODEBUG disabled\n"); // all buckets get emptied here, and } lookup_object_or_alloc(addr, db, descr, false, true) { // this bucket is already empty. return ERR_PTR(-ENOENT); } // Emits false positive warning. debug_print_object(&o, "assert_init"); } Recheck debug_object_enabled in debug_print_object() to avoid that. Reported-by: syzbot Suggested-by: Thomas Gleixner Signed-off-by: Tetsuo Handa Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/492fe2ae-5141-d548-ebd5-62f5fe2e57f7@I-love.SAKURA.ne.jp Closes: https://syzkaller.appspot.com/bug?extid=7937ba6a50bdd00fffdf commit 06e989578232da33a7fe96b04191b862af8b2cec Author: Markus Elfring Date: Fri Feb 2 14:50:09 2018 +0100 i2c: Improve size determinations Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Wolfram Sang commit 6b3b21a8542fd2fb6ffc61bc13b9419f0c58ebad Author: Markus Elfring Date: Fri Feb 2 17:24:57 2018 +0100 i2c: Delete error messages for failed memory allocations These issues were detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Wolfram Sang commit 5b6d0b91f84cff3f28724076f93f6f9e2ef8d775 Author: Abe Kohandel Date: Tue Jun 6 16:18:44 2023 -0700 spi: dw: Remove misleading comment for Mount Evans SoC Remove a misleading comment about the DMA operations of the Intel Mount Evans SoC's SPI Controller as requested by Serge. Signed-off-by: Abe Kohandel Link: https://lore.kernel.org/linux-spi/20230606191333.247ucbf7h3tlooxf@mobilestation/ Fixes: 0760d5d0e9f0 ("spi: dw: Add compatible for Intel Mount Evans SoC") Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20230606231844.726272-1-abe.kohandel@intel.com Signed-off-by: Mark Brown commit 3bd45b8dea73eabc9bbfdcdc69675e3ef8ca8920 Author: Pierre-Louis Bossart Date: Tue Jun 6 17:25:29 2023 -0500 ASoC: SOF: Intel: hda-pcm: remove kernel parameter init The 'hda_disable_rewinds' kernel parameter is initialized with a non-existent CONFIG_SND_SOC_SOF_HDA_DISABLE_REWINDS. We probably forgot to clean this up when this Kconfig option was removed when upstreaming in 2021. Reported-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20230606222529.57156-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f751b99255cacd9ffe8c4bbf99767ad670cee1f7 Author: Pierre-Louis Bossart Date: Tue Jun 6 17:25:28 2023 -0500 ASoC: SOF: Intel: fix SoundWire/HDaudio mutual exclusion The functionality described in Commit 61bef9e68dca ("ASoC: SOF: Intel: hda: enforce exclusion between HDaudio and SoundWire") does not seem to be properly implemented with two issues that need to be corrected. a) The test used is incorrect when DisplayAudio codecs are not supported. b) Conversely when only Display Audio codecs can be found, we do want to start the SoundWire links, if any. That will help add the relevant topologies and machine descriptors, and identify cases where the SoundWire information in ACPI needs to be modified with a quirk. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230606222529.57156-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e7214663e023be5e518e8d0d8f2dca6848731652 Author: Simon Horman Date: Tue Jun 6 15:49:45 2023 +0200 net: txgbe: Avoid passing uninitialised parameter to pci_wake_from_d3() txgbe_shutdown() relies on txgbe_dev_shutdown() to initialise wake by passing it by reference. However, txgbe_dev_shutdown() doesn't use this parameter at all. wake is then passed uninitialised by txgbe_dev_shutdown() to pci_wake_from_d3(). Resolve this problem by: * Removing the unused parameter from txgbe_dev_shutdown() * Removing the uninitialised variable wake from txgbe_dev_shutdown() * Passing false to pci_wake_from_d3() - this assumes that although uninitialised wake was in practice false (0). I'm not sure that this counts as a bug, as I'm not sure that it manifests in any unwanted behaviour. But in any case, the issue was introduced by: 3ce7547e5b71 ("net: txgbe: Add build support for txgbe") Flagged by Smatch as: .../txgbe_main.c:486 txgbe_shutdown() error: uninitialized symbol 'wake'. No functional change intended. Compile tested only. Signed-off-by: Simon Horman Reviewed-by: Jiawen Wu Reviewed-by: Maciej Fijalkowski Signed-off-by: David S. Miller commit 92db9e2e0498b92d0a57cc48ea869ddabda934d9 Author: Atin Bainada Date: Tue Jun 6 12:23:08 2023 +0000 net: dsa: qca8k: remove unnecessary (void*) conversions Pointer variables of (void*) type do not require type cast. Signed-off-by: Atin Bainada Signed-off-by: David S. Miller commit f71be9d084c92e0ef36e248303f32f8e4cf623da Author: Masahiro Yamada Date: Wed Jun 7 02:18:49 2023 +0900 net: liquidio: fix mixed module-builtin object With CONFIG_LIQUIDIO=m and CONFIG_LIQUIDIO_VF=y (or vice versa), $(common-objs) are linked to a module and also to vmlinux even though the expected CFLAGS are different between builtins and modules. This is the same situation as fixed by commit 637a642f5ca5 ("zstd: Fixing mixed module-builtin objects"). Introduce the new module, liquidio-core, to provide the common functions to liquidio and liquidio-vf. Signed-off-by: Masahiro Yamada Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 10b98a4db11a289b260928f2c81799642dcd2cb0 Author: Ivan Orlov Date: Tue Jun 6 23:32:54 2023 +0400 selftests: ALSA: Add test for the 'pcmtest' driver This test covers the new Virtual PCM Test Driver, including the capturing, playback and ioctl redefinition functionalities for both interleaved and non-interleaved access modes. This test is also helpful as an usage example of the 'pcmtest' driver. We have a lot of different virtual media drivers, which can be used for testing of the userspace applications and media subsystem middle layer. However, all of them are aimed at testing the video functionality and simulating the video devices. For audio devices we have only snd-dummy module, which is good in simulating the correct behavior of an ALSA device. I decided to write a tool, which would help to test the userspace ALSA programs (and the PCM middle layer as well) under unusual circumstances to figure out how they would behave. So I came up with this Virtual PCM Test Driver. This new Virtual PCM Test Driver has several features which can be useful during the userspace ALSA applications testing/fuzzing, or testing/fuzzing of the PCM middle layer. Not all of them can be implemented using the existing virtual drivers (like dummy or loopback). Here is what can this driver do: - Simulate both capture and playback processes - Generate random or pattern-based capture data - Check the playback stream for containing the looped pattern - Inject delays into the playback and capturing processes - Inject errors during the PCM callbacks Also, this driver can check the playback stream for containing the predefined pattern, which is used in the corresponding selftest to check the PCM middle layer data transferring functionality. Additionally, this driver redefines the default RESET ioctl, and the selftest covers this PCM API functionality as well. The driver supports both interleaved and non-interleaved access modes, and have separate pattern buffers for each channel. The driver supports up to 4 channels and up to 8 substreams. Signed-off-by: Ivan Orlov Acked-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230606193254.20791-3-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai commit 315a3d57c64c55901d6fe5a5eef3b3e51d215381 Author: Ivan Orlov Date: Tue Jun 6 23:32:53 2023 +0400 ALSA: Implement the new Virtual PCM Test Driver We have a lot of different virtual media drivers, which can be used for testing of the userspace applications and media subsystem middle layer. However, all of them are aimed at testing the video functionality and simulating the video devices. For audio devices we have only snd-dummy module, which is good in simulating the correct behavior of an ALSA device. I decided to write a tool, which would help to test the userspace ALSA programs (and the PCM middle layer as well) under unusual circumstances to figure out how they would behave. So I came up with this Virtual PCM Test Driver. This new Virtual PCM Test Driver has several features which can be useful during the userspace ALSA applications testing/fuzzing, or testing/fuzzing of the PCM middle layer. Not all of them can be implemented using the existing virtual drivers (like dummy or loopback). Here is what can this driver do: - Simulate both capture and playback processes - Generate random or pattern-based capture data - Inject delays into the playback and capturing processes - Inject errors during the PCM callbacks Also, this driver can check the playback stream for containing the predefined pattern, which is used in the corresponding selftest to check the PCM middle layer data transferring functionality. Additionally, this driver redefines the default RESET ioctl, and the selftest covers this PCM API functionality as well. The driver supports both interleaved and non-interleaved access modes, and have separate pattern buffers for each channel. The driver supports up to 4 channels and up to 8 substreams. Signed-off-by: Ivan Orlov Acked-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230606193254.20791-2-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai commit f091ec768c52fe7192faeabf47cf212321879176 Author: Ivan Orlov Date: Tue Jun 6 23:32:52 2023 +0400 docs: sound: add 'pcmtest' driver documentation Add documentation for the new Virtual PCM Test Driver. It covers all possible usage cases: errors and delay injections, random and pattern-based data generation, playback and ioctl redefinition functionalities testing. We have a lot of different virtual media drivers, which can be used for testing of the userspace applications and media subsystem middle layer. However, all of them are aimed at testing the video functionality and simulating the video devices. For audio devices we have only snd-dummy module, which is good in simulating the correct behavior of an ALSA device. I decided to write a tool, which would help to test the userspace ALSA programs (and the PCM middle layer as well) under unusual circumstances to figure out how they would behave. So I came up with this Virtual PCM Test Driver. This new Virtual PCM Test Driver has several features which can be useful during the userspace ALSA applications testing/fuzzing, or testing/fuzzing of the PCM middle layer. Not all of them can be implemented using the existing virtual drivers (like dummy or loopback). Here is what can this driver do: - Simulate both capture and playback processes - Check the playback stream for containing the looped pattern - Generate random or pattern-based capture data - Inject delays into the playback and capturing processes - Inject errors during the PCM callbacks Also, this driver can check the playback stream for containing the predefined pattern, which is used in the corresponding selftest to check the PCM middle layer data transferring functionality. Additionally, this driver redefines the default RESET ioctl, and the selftest covers this PCM API functionality as well. The driver supports both interleaved and non-interleaved access modes, and have separate pattern buffers for each channel. The driver supports up to 4 channels and up to 8 substreams. Signed-off-by: Ivan Orlov Acked-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230606193254.20791-1-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai commit ab5ca6268afcc470e7c9b2d66b0eb9f178755260 Author: Suzuki K Poulose Date: Mon Jun 5 14:30:30 2023 +0100 coresight: etm4x: Match all ETM4 instances based on DEVARCH and DEVTYPE Instead of adding the PIDs forever to the list for the new CPUs, let us detect a component to be ETMv4 based on the CoreSight CID, DEVTYPE=PE_TRACE and DEVARCH=ETMv4. This is already done for some of the ETMs. We can extend the PID matching to match the PIDR2:JEDEC, BIT[3], which must be 1 (RAO) always. Link: https://lkml.kernel.org/r/20230317030501.1811905-1-anshuman.khandual@arm.com Cc: Anshuman Khandual Cc: Rob Herring Cc: frowand.list@gmail.com Cc: linux@armlinux.org.uk Cc: Mike Leach Reviewed-by: Mike Leach [ Fixed typo in the description RA0 => RAO ] Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230605133031.1827626-1-suzuki.poulose@arm.com commit 54cb981c299696228d586d30ebc6db34bb6179ac Merge: 8f7913c04f6a7 937e87229ea04 Author: Arnd Bergmann Date: Wed Jun 7 12:56:47 2023 +0200 Merge tag 'omap-for-v6.5/cleanup-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/arm Clean-up for omaps for v6.5 Two patches for checkpatch warnings, and one change to use pr_err instead of printk. * tag 'omap-for-v6.5/cleanup-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: omap2: Fix checkpatch issues arm: omap1: replace printk() with pr_err macro ARM: omap: Fix checkpatch issues Link: https://lore.kernel.org/r/pull-1685946511-835910@atomide.com Signed-off-by: Arnd Bergmann commit 8f7913c04f6a7b90bcf998ece17395d7090f6d44 Author: Linus Walleij Date: Tue Jun 6 21:13:04 2023 +0200 Input: ads7846 - Fix usage of match data device_get_match_data() returns the match data directly, fix this up and fix the probe crash. Fixes: 767d83361aaa ("Input: ads7846 - Convert to use software nodes") Reported-by: Guenter Roeck Signed-off-by: Linus Walleij Acked-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20230606191304.3804174-1-linus.walleij@linaro.org Signed-off-by: Arnd Bergmann commit 7e980867ced0037a65f588971b89769857b77aab Author: Bo Liu Date: Thu May 4 04:54:46 2023 -0400 x86/mm: Remove repeated word in comments Remove the repeated word "the" in comments. Signed-off-by: Bo Liu Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230504085446.2574-1-liubo03@inspur.com commit a4d2b8537845c9a4f4b16dd31793af9c08548341 Author: Yanteng Si Date: Wed Jun 7 17:21:52 2023 +0800 ALSA: hda/intel: Workaround for WALLCLK register for loongson controller On loongson controller, the value of WALLCLK register is always 0, which is meaningless, so we return directly. Signed-off-by: Yanteng Si Signed-off-by: Yingkun Meng Acked-by: Huacai Chen Link: https://lore.kernel.org/r/185df71ef413ab190460eb377703214ee7288aeb.1686128807.git.siyanteng@loongson.cn Signed-off-by: Takashi Iwai commit e0a6ede2dd884adb73a7dde80444185b655f7c79 Author: Peter Newman Date: Wed Apr 19 14:50:15 2023 +0200 Documentation/x86: Documentation for MON group move feature Describe new support for moving MON groups to a new parent CTRL_MON group and its restrictions. Signed-off-by: Peter Newman Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lore.kernel.org/r/20230419125015.693566-4-peternewman@google.com commit 942ccdd834f43b498abc3f022b73fb831d78f5f7 Author: Yanteng Si Date: Wed Jun 7 17:21:51 2023 +0800 ALSA: hda: Workaround for SDnCTL register on loongson On loongson controller, after calling snd_hdac_stream_updateb() to enable DMA engine, the SDnCTL.STRM will become to zero. We need to access SDnCTL in dword to keep SDnCTL.STRM is not changed. Signed-off-by: Yanteng Si Signed-off-by: Yingkun Meng Acked-by: Huacai Chen Link: https://lore.kernel.org/r/27aeddf5ebbe7c69631cec0e489c1b264be94990.1686128807.git.siyanteng@loongson.cn Signed-off-by: Takashi Iwai commit 8da2b938eb7e2ef407b8ef99def12e3054a99645 Author: Peter Newman Date: Wed Apr 19 14:50:14 2023 +0200 x86/resctrl: Implement rename op for mon groups To change the resources allocated to a large group of tasks, such as an application container, a container manager must write all of the tasks' IDs into the tasks file interface of the new control group. This is challenging when the container's task list is always changing. In addition, if the container manager is using monitoring groups to separately track the bandwidth of containers assigned to the same control group, when moving a container, it must first move the container's tasks to the default monitoring group of the new control group before it can move these tasks into the container's replacement monitoring group under the destination control group. This is undesirable because it makes bandwidth usage during the move unattributable to the correct tasks and resets monitoring event counters and cache usage information for the group. Implement the rename operation only for resctrlfs monitor groups to enable users to move a monitoring group from one control group to another. This effects a change in resources allocated to all the tasks in the monitoring group while otherwise leaving the monitoring data intact. Signed-off-by: Peter Newman Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lore.kernel.org/r/20230419125015.693566-3-peternewman@google.com commit cbc3e98acf802c8939e14103a059db60499d69eb Author: Yanteng Si Date: Wed Jun 7 17:21:50 2023 +0800 ALSA: hda: Using polling mode for loongson controller by default On loongson controller, RIRBSTS.RINTFL cannot be cleared, azx_interrupt() is called all the time. We disable RIRB interrupt, and use polling mode by default. Signed-off-by: Yanteng Si Signed-off-by: Yingkun Meng Acked-by: Huacai Chen Link: https://lore.kernel.org/r/d309a75424d438b958d90d797b4f1ba45468e090.1686128807.git.siyanteng@loongson.cn Signed-off-by: Takashi Iwai commit 28bd137a3c8e105587ba8c55b68ef43b519b270f Author: Yanteng Si Date: Wed Jun 7 17:21:49 2023 +0800 ALSA: hda: Add Loongson LS7A HD-Audio support Add the new PCI ID 0x0014 0x7a07 and the new PCI ID 0x0014 0x7a37 Loongson HDA controller. Signed-off-by: Yanteng Si Acked-by: Huacai Chen Link: https://lore.kernel.org/r/993587483b9509796b29a416f257fcfb4b15c6ea.1686128807.git.siyanteng@loongson.cn Signed-off-by: Takashi Iwai commit 84f9c3c73b9a18a21ea13135d4e850fcf7629f59 Author: Jani Nikula Date: Fri May 26 19:38:06 2023 +0300 drm/i915: annotate maybe unused but set intel_crtc_state variables Prepare for re-enabling -Wunused-but-set-variable. for_each_new_intel_crtc_in_state() requires passing in a struct intel_crtc_state pointer, which it uses, but in a few places this leads to warning about unused but set variables. Annotate them with __maybe_unused. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/eb041f426bc3d76ef7a0ea906f99367cbf439b1a.1685119007.git.jani.nikula@intel.com commit ace873049e8cb543f00d8393dcad19711e7ec969 Author: Jani Nikula Date: Fri May 26 19:38:05 2023 +0300 drm/i915: annotate maybe unused but set intel_plane_state variables Prepare for re-enabling -Wunused-but-set-variable. for_each_new_intel_plane_in_state() requires passing in a struct intel_plane_state pointer, which it uses, but in many places this leads to warning about unused but set variables. Annotate them with __maybe_unused. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/438ff3b257b7f85ecca5750ae8687336faee0a79.1685119007.git.jani.nikula@intel.com commit 1032a491e2b5fc9793be31aae2d9e207975a1e7e Author: Jani Nikula Date: Fri May 26 19:38:04 2023 +0300 drm/i915/selftest: annotate maybe unused but set variable unused Prepare for re-enabling -Wunused-but-set-variable. The variable is indeed 'unused' as the name suggests, but we can't just drop it because i915_vma_unbind_unlocked() is annotated __must_check. Apparently the selftest does not really need to check the value. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/e7654682f6bd6a9f6af74f4b6eb5fff7b527e412.1685119007.git.jani.nikula@intel.com commit ab438a61e4c3675e6077d232a67284328777d929 Author: Jani Nikula Date: Fri May 26 19:38:03 2023 +0300 drm/i915/gem: annotate maybe unused but set variable c Prepare for re-enabling -Wunused-but-set-variable. The variable 'c' appears unused, but I'm not sure what should be done with it. Annotate it with __maybe_unused. Signed-off-by: Jani Nikula Reviewed-by: Andi Shyti Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/9ee9e7d7a0a7ad4ff03c14e64b95d3fbcb7885a4.1685119007.git.jani.nikula@intel.com commit 927fc4a015937ecdc5de04c144963aa6a57762a2 Author: Jani Nikula Date: Fri May 26 19:38:02 2023 +0300 drm/i915/gem: drop unused but set variable unpinned Prepare for re-enabling -Wunused-but-set-variable. Signed-off-by: Jani Nikula Reviewed-by: Andi Shyti Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/6831c21567e8e84da424f32a8b7b48932803ab7b.1685119007.git.jani.nikula@intel.com commit b3343230ceb571be927b273875af6d8282eda2e1 Author: Jani Nikula Date: Fri May 26 19:38:01 2023 +0300 drm/i915/gt/uc: drop unused but set variable sseu Prepare for re-enabling -Wunused-but-set-variable. Apparently sseu is leftover from commit 9a92732f040a ("drm/i915/gt: Add general DSS steering iterator to intel_gt_mcr"). Signed-off-by: Jani Nikula Reviewed-by: Andi Shyti Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/d542f25bffd5a50ff621bee93415a972c7768a2a.1685119007.git.jani.nikula@intel.com commit 41b611db30143e77bc1d7f066f1954e9fbb2cdfc Author: Jani Nikula Date: Fri May 26 19:38:00 2023 +0300 drm/i915/irq: drop unused but set variable tmp Prepare for re-enabling -Wunused-but-set-variable. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/6c529e8721d56b0148a3a84fb2d396d4485e09a2.1685119007.git.jani.nikula@intel.com commit 1176a905dd64637b34b7d2cde8f994ff5c3d1644 Author: Jani Nikula Date: Fri May 26 19:37:59 2023 +0300 drm/i915/fb: drop unused but set variable cpp Prepare for re-enabling -Wunused-but-set-variable. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/ce7a5cb06c562a3399206c521a24f5091a3e7c23.1685119007.git.jani.nikula@intel.com commit c294d37eb4554d3e40f9fd66a54b5594028a0ebe Author: Jani Nikula Date: Fri May 26 19:37:58 2023 +0300 drm/i915/dpll: drop unused but set variables bestn and bestm1 Prepare for re-enabling -Wunused-but-set-variable. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/a85ccc8c0f451fcb997b4ac138dbeba2a653cebe.1685119007.git.jani.nikula@intel.com commit 1fdac123ab01f1e5eb91a34e6d8a60858f5927ea Author: Jani Nikula Date: Fri May 26 19:37:57 2023 +0300 drm/i915/dsi: drop unused but set variable vbp Prepare for re-enabling -Wunused-but-set-variable. The vbp is not used for anything in the readout, as we get e.g. crtc_vtotal from BXT_MIPI_TRANS_VTOTAL. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/27efd245aa75226adcac01eff7b21781970f2736.1685119007.git.jani.nikula@intel.com commit ac12d250e9889e1f3476b96931dbf07ea24f5f52 Author: Jani Nikula Date: Fri May 26 19:37:56 2023 +0300 drm/i915/dsi: drop unused but set variable data Prepare for re-enabling -Wunused-but-set-variable. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/a1a167a4ff18b19d10769d83670e414586c16956.1685119007.git.jani.nikula@intel.com commit 3ba39084d6fc5dd4db321b367f8bbd46c6ea90ff Author: Jani Nikula Date: Fri May 26 19:37:55 2023 +0300 drm/i915/ddi: drop unused but set variable intel_dp Prepare for re-enabling -Wunused-but-set-variable. The intel_dp variable has been unused since commit ef79fafe9dae ("drm/i915: Eliminate intel_dp.regs.dp_tp_{ctl,status}"). Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/66ca543b400a2048a6a84bb57a7bac8943014a96.1685119007.git.jani.nikula@intel.com commit 47e157a5b49a4c099daf202207adc9815a2f2916 Author: Jani Nikula Date: Fri May 26 20:22:18 2023 +0300 drm/i915/plane: warn on non-zero plane offset We assume the plane offset is 0. Warn if it's not. This also fixes a warn on unused but set variable offset. v2: initialize offset on the gen2/3 path (Ville) Suggested-by: Ville Syrjälä Reviewed-by: Ville Syrjälä Reviewed-by: Jouni Högander Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230526172218.1597394-1-jani.nikula@intel.com commit c45c06d4ae63a0714efbfa435c5a8f64a5f35b9b Author: Peter Newman Date: Wed Apr 19 14:50:13 2023 +0200 x86/resctrl: Factor rdtgroup lock for multi-file ops rdtgroup_kn_lock_live() can only release a kernfs reference for a single file before waiting on the rdtgroup_mutex, limiting its usefulness for operations on multiple files, such as rename. Factor the work needed to respectively break and unbreak active protection on an individual file into rdtgroup_kn_{get,put}(). No functional change. Signed-off-by: Peter Newman Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Reinette Chatre Tested-by: Babu Moger Link: https://lore.kernel.org/r/20230419125015.693566-2-peternewman@google.com commit 8690be05cf055e0c68a7e151530eea8bda0e601a Author: Jani Nikula Date: Fri Jun 2 16:23:21 2023 +0300 drm/i915/debugfs: stop using edid_blob_ptr Only the EDID code and sysfs should look at the EDID property. Stop using it. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20230602132321.3199445-1-jani.nikula@intel.com commit 0824a987a58070470351906590a89fa5e0f88ba1 Author: David Morley Date: Tue Jun 6 18:12:33 2023 +0000 tcp: fix formatting in sysctl_net_ipv4.c Fix incorrectly formatted tcp_syn_linear_timeouts sysctl in the ipv4_net_table. Fixes: ccce324dabfe ("tcp: make the first N SYN RTO backoffs linear") Signed-off-by: David Morley Signed-off-by: Neal Cardwell Tested-by: David Morley Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 1ebafd5f5caaece1d25556cfb3a8f7fcb7629550 Author: Andrew Davis Date: Mon May 15 12:50:42 2023 -0500 i2c: davinci: Use struct name not type with devm_kzalloc() This reduces chance of error if the type of "dev" changes. While here remove extra error print out, this is not usually done for memory allocation failures. Signed-off-by: Andrew Davis Reviewed-by: Bartosz Golaszewski Signed-off-by: Wolfram Sang commit cad7526f33ce1e7d387d1d0568a089e41deec5c2 Author: Dan Carpenter Date: Tue Jun 6 11:24:37 2023 +0300 net: dsa: ocelot: unlock on error in vsc9959_qos_port_tas_set() This error path needs call mutex_unlock(&ocelot->tas_lock) before returning. Fixes: 2d800bc500fb ("net/sched: taprio: replace tc_taprio_qopt_offload :: enable with a "cmd" enum") Signed-off-by: Dan Carpenter Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 2f27d7890f53a9da696277e1993acd7eb6ca6d66 Merge: 4cab498f33f7a 59e227e2894b2 Author: David S. Miller Date: Wed Jun 7 09:52:25 2023 +0100 Merge branch 'realtek-external-phy-clock' Detlev Casanova says: ==================== net: phy: realtek: Support external PHY clock Some PHYs can use an external clock that must be enabled before communicating with them. Changes since v3: * Do not call genphy_suspend if WoL is enabled. Changes since v2: * Reword documentation commit message Changes since v1: * Remove the clock name as it is not guaranteed to be identical across different PHYs * Disable/Enable the clock when suspending/resuming ==================== Signed-off-by: David S. Miller commit 59e227e2894b28c4409e89d04a33868c176587b2 Author: Detlev Casanova Date: Mon Jun 5 11:40:10 2023 -0400 net: phy: realtek: Disable clock on suspend For PHYs that call rtl821x_probe() where an external clock can be configured, make sure that the clock is disabled when ->suspend() is called and enabled on resume. The PHY_ALWAYS_CALL_SUSPEND is added to ensure that the suspend function is actually always called. Reviewed-by: Florian Fainelli Signed-off-by: Detlev Casanova Signed-off-by: David S. Miller commit 350b7a258f20427a411a888e5af0684327d49e3a Author: Detlev Casanova Date: Mon Jun 5 11:40:09 2023 -0400 dt-bindings: net: phy: Document support for external PHY clk Ethern PHYs can have external an clock that needs to be activated before communicating with the PHY. Acked-by: Krzysztof Kozlowski Signed-off-by: Detlev Casanova Signed-off-by: David S. Miller commit 7300c9b574cc2b259ef112d34affa0671ae4810a Author: Detlev Casanova Date: Mon Jun 5 11:40:08 2023 -0400 net: phy: realtek: Add optional external PHY clock In some cases, the PHY can use an external clock source instead of a crystal. Add an optional clock in the phy node to make sure that the clock source is enabled, if specified, before probing. Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: Detlev Casanova Signed-off-by: David S. Miller commit 0a81fa5d74cd8746002d137c47c80a4e8d3a4633 Merge: 6c79e42169fe1 bf5c04ddd378d Author: Borislav Petkov (AMD) Date: Wed Jun 7 10:50:07 2023 +0200 Merge ras/edac-misc into for-next * ras/edac-misc: EDAC/thunderx: Check debugfs file creation retval properly Signed-off-by: Borislav Petkov (AMD) commit 4cab498f33f7adaa01ad15909c0f34a81e5a0b0a Author: Shradha Gupta Date: Mon Jun 5 04:30:06 2023 -0700 hv_netvsc: Allocate rx indirection table size dynamically Allocate the size of rx indirection table dynamically in netvsc from the value of size provided by OID_GEN_RECEIVE_SCALE_CAPABILITIES query instead of using a constant value of ITAB_NUM. Signed-off-by: Shradha Gupta Reviewed-by: Haiyang Zhang Tested-on: Ubuntu22 (azure VM, SKU size: Standard_F72s_v2) Testcases: 1. ethtool -x eth0 output 2. LISA testcase:PERF-NETWORK-TCP-THROUGHPUT-MULTICONNECTION-NTTTCP-Synthetic 3. LISA testcase:PERF-NETWORK-TCP-THROUGHPUT-MULTICONNECTION-NTTTCP-SRIOV Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit c5f231f1a7e18d28e02b282d33541d31358360e4 Author: Uwe Kleine-König Date: Thu May 18 22:16:29 2023 +0200 coresight: etm4x: Make etm4_remove_dev() return void etm4_remove_dev() returned zero unconditionally. Make it return void instead, which makes it clear in the callers that there is no error to handle. Simplify etm4_remove_platform_dev() accordingly. Signed-off-by: Uwe Kleine-König Reviewed-by: Anshuman Khandual Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230518201629.260672-1-u.kleine-koenig@pengutronix.de commit be6736cc5423e9c153f38ca49ed9ba05a02a58f9 Author: Bartosz Golaszewski Date: Mon Jun 5 14:52:48 2023 +0200 gpiolib: demote the hogging log messages to debug Drivers should be silent when they work correctly. There's no reason to emit info messages when GPIO lines are hogged. Demote the message to debug. Signed-off-by: Bartosz Golaszewski Suggested-by: Kent Gibson Reviewed-by: Andy Shevchenko commit 13cdd12a9f934158f4ec817cf048fcb4384aa9dc Author: Dario Binacchi Date: Wed Jun 7 08:31:38 2023 +0200 drm/panel: simple: add support for Rocktech RK043FN48H panel Add support for Rocktech RK043FN48H 4.3" (480x272) LCD-TFT panel. Signed-off-by: Dario Binacchi Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306020343.jNTWeM0P-lkp@intel.com/ Reviewed-by: Jagan Teki Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230607063139.621351-6-dario.binacchi@amarulasolutions.com commit c42a37a27c777d63961dd634a30f7c887949491a Author: Dario Binacchi Date: Wed Jun 7 08:31:37 2023 +0200 dt-bindings: display: simple: add Rocktech RK043FN48H Add compatible to panel-simple for Rocktech Displays Limited RK043FN48H 4.3" 480x272 LCD-TFT panel. Signed-off-by: Dario Binacchi Acked-by: Conor Dooley Reviewed-by: Jagan Teki Reviewed-by: Raphael Gallais-Pou Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230607063139.621351-5-dario.binacchi@amarulasolutions.com commit 2454ad83b90afbc6ed2c22ec1310b624c40bf0d3 Author: Jan Kara Date: Thu Jun 1 12:58:26 2023 +0200 fs: Restrict lock_two_nondirectories() to non-directory inodes Currently lock_two_nondirectories() is skipping any passed directories. After vfs_rename() uses lock_two_inodes(), all the remaining four users of this function pass only regular files to it. So drop the somewhat unusual "skip directory" logic and instead warn if anybody passes directory to it. This also allows us to use lock_two_inodes() in lock_two_nondirectories() to concentrate the lock ordering logic in less places. Signed-off-by: Jan Kara Message-Id: <20230601105830.13168-6-jack@suse.cz> Signed-off-by: Christian Brauner commit ae28ea5cbdee9956464223b304d6c767238b2506 Author: Xin Long Date: Mon Jun 5 10:40:44 2023 -0400 tipc: replace open-code bearer rcu_dereference access in bearer.c Replace these open-code bearer rcu_dereference access with bearer_get(), like other places in bearer.c. While at it, also use tipc_net() instead of net_generic(net, tipc_net_id) to get "tn" in bearer.c. Signed-off-by: Xin Long Reviewed-by: Larysa Zaremba Reviewed-by: Tung Nguyen Link: https://lore.kernel.org/r/1072588a8691f970bda950c7e2834d1f2983f58e.1685976044.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit ddf63516d8d37528dc6834c7f19b55084e956068 Author: Hou Tao Date: Fri Apr 28 15:44:04 2023 +0800 blk-ioprio: Introduce promote-to-rt policy Since commit a78418e6a04c ("block: Always initialize bio IO priority on submit"), bio->bi_ioprio will never be IOPRIO_CLASS_NONE when calling blkcg_set_ioprio(), so there will be no way to promote the io-priority of one cgroup to IOPRIO_CLASS_RT, because bi_ioprio will always be greater than or equals to IOPRIO_CLASS_RT. It seems possible to call blkcg_set_ioprio() first then try to initialize bi_ioprio later in bio_set_ioprio(), but this doesn't work for bio in which bi_ioprio is already initialized (e.g., direct-io), so introduce a new promote-to-rt policy to promote the iopriority of bio to IOPRIO_CLASS_RT if the ioprio is not already RT. For none-to-rt policy, although it doesn't work now, but considering that its purpose was also to override the io-priority to RT and allowing for a smoother transition, just keep it and treat it as an alias of the promote-to-rt policy. Acked-by: Tejun Heo Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Reviewed-by: Jan Kara Signed-off-by: Hou Tao Reviewed-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20230428074404.280532-1-houtao@huaweicloud.com Signed-off-by: Jens Axboe commit be1f4a262b43576a6a81490b97ab19a6763f8c75 Merge: fe109f6b6378a 6f8a76f802212 Author: Jakub Kicinski Date: Tue Jun 6 21:13:04 2023 -0700 Merge branch 'ipv4-remove-rt_conn_flags-calls-in-flowi4_init_output' Guillaume Nault says: ==================== ipv4: Remove RT_CONN_FLAGS() calls in flowi4_init_output(). Remove a few RT_CONN_FLAGS() calls used inside flowi4_init_output(). These users can be easily converted to set the scope properly, instead of overloading the tos parameter with scope information as done by RT_CONN_FLAGS(). The objective is to eventually remove RT_CONN_FLAGS() entirely, which will then allow to also remove RTO_ONLINK and to finally convert ->flowi4_tos to dscp_t. ==================== Link: https://lore.kernel.org/r/cover.1685999117.git.gnault@redhat.com Signed-off-by: Jakub Kicinski commit 6f8a76f8022121f7e4dc9cc29da7fb716b7db45f Author: Guillaume Nault Date: Mon Jun 5 23:55:30 2023 +0200 tcp: Set route scope properly in cookie_v4_check(). RT_CONN_FLAGS(sk) overloads flowi4_tos with the RTO_ONLINK bit when sk has the SOCK_LOCALROUTE flag set. This allows ip_route_output_key_hash() to eventually adjust flowi4_scope. Instead of relying on special handling of the RTO_ONLINK bit, we can just set the route scope correctly. This will eventually allow to avoid special interpretation of tos variables and to convert ->flowi4_tos to dscp_t. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit 4b095281cacab0b62e7f11d6d8c4a6d49ecaae42 Author: Guillaume Nault Date: Mon Jun 5 23:55:25 2023 +0200 ipv4: Set correct scope in inet_csk_route_*(). RT_CONN_FLAGS(sk) overloads the tos parameter with the RTO_ONLINK bit when sk has the SOCK_LOCALROUTE flag set. This is only useful for ip_route_output_key_hash() to eventually adjust the route scope. Let's drop RTO_ONLINK and set the correct scope directly to avoid this special case in the future and to allow converting ->flowi4_tos to dscp_t. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit fe109f6b6378a7d26231474ca0acb7d028cbaa70 Merge: 2dc476404efa8 6068e6d7ba500 Author: Jakub Kicinski Date: Tue Jun 6 21:08:39 2023 -0700 Merge branch 'move-ksz9477-errata-handling-to-phy-driver' Robert Hancock says: ==================== Move KSZ9477 errata handling to PHY driver Patches to move handling for KSZ9477 PHY errata register fixes from the DSA switch driver into the corresponding PHY driver, for more proper layering and ordering. ==================== Link: https://lore.kernel.org/r/20230605153943.1060444-1-robert.hancock@calian.com Signed-off-by: Jakub Kicinski commit 6068e6d7ba5001dfb96bb8b7b92e2ed2a5877786 Author: Robert Hancock Date: Mon Jun 5 09:39:43 2023 -0600 net: dsa: microchip: remove KSZ9477 PHY errata handling The KSZ9477 PHY errata handling code has now been moved into the Micrel PHY driver, so it is no longer needed inside the DSA switch driver. Remove it. Signed-off-by: Robert Hancock Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 26dd2974c5b5caef358784530c9e72715adc8f5b Author: Robert Hancock Date: Mon Jun 5 09:39:42 2023 -0600 net: phy: micrel: Move KSZ9477 errata fixes to PHY driver The ksz9477 DSA switch driver is currently updating some MMD registers on the internal port PHYs to address some chip errata. However, these errata are really a property of the PHY itself, not the switch they are part of, so this is kind of a layering violation. It makes more sense for these writes to be done inside the driver which binds to the PHY and not the driver for the containing device. This also addresses some issues where the ordering of when these writes are done may have been incorrect, causing the link to erratically fail to come up at the proper speed or at all. Doing this in the PHY driver during config_init ensures that they happen before anything else tries to change the state of the PHY on the port. The new code also ensures that autonegotiation is disabled during the register writes and re-enabled afterwards, as indicated by the latest version of the errata documentation from Microchip. Signed-off-by: Robert Hancock Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 35e6bcd138bc7ae85b193186207371d77749afcf Author: Tony Lindgren Date: Tue May 23 09:55:18 2023 +0300 arm64: dts: hisilicon: Unify pinctrl-single pin group nodes We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Let's also correct the pinctrl controller #size-cells to 0 while at it. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren Signed-off-by: Wei Xu commit 709f6754fa357d82f497dac9bc5c5a1538713f97 Author: Tony Lindgren Date: Tue May 23 10:50:34 2023 +0300 ARM: dts: hisilicon: Unify pinctrl-single pin group nodes We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Let's also correct the pinctrl controller #size-cells to 0 while at it and drop unnecessary ranges property. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren Signed-off-by: Wei Xu commit 94cdeebd82111d7b7da5bd4da053eed9e0f65d72 Author: Like Xu Date: Fri Jun 2 18:10:58 2023 -0700 KVM: x86/cpuid: Add AMD CPUID ExtPerfMonAndDbg leaf 0x80000022 CPUID leaf 0x80000022 i.e. ExtPerfMonAndDbg advertises some new performance monitoring features for AMD processors. Bit 0 of EAX indicates support for Performance Monitoring Version 2 (PerfMonV2) features. If found to be set during PMU initialization, the EBX bits of the same CPUID function can be used to determine the number of available PMCs for different PMU types. Expose the relevant bits via KVM_GET_SUPPORTED_CPUID so that guests can make use of the PerfMonV2 features. Co-developed-by: Sandipan Das Signed-off-by: Sandipan Das Signed-off-by: Like Xu Link: https://lore.kernel.org/r/20230603011058.1038821-13-seanjc@google.com Signed-off-by: Sean Christopherson commit 4a2771895ca63a055df815be5e307cce8e85308c Author: Like Xu Date: Fri Jun 2 18:10:57 2023 -0700 KVM: x86/svm/pmu: Add AMD PerfMonV2 support If AMD Performance Monitoring Version 2 (PerfMonV2) is detected by the guest, it can use a new scheme to manage the Core PMCs using the new global control and status registers. In addition to benefiting from the PerfMonV2 functionality in the same way as the host (higher precision), the guest also can reduce the number of vm-exits by lowering the total number of MSRs accesses. In terms of implementation details, amd_is_valid_msr() is resurrected since three newly added MSRs could not be mapped to one vPMC. The possibility of emulating PerfMonV2 on the mainframe has also been eliminated for reasons of precision. Co-developed-by: Sandipan Das Signed-off-by: Sandipan Das Signed-off-by: Like Xu [sean: drop "Based on the observed HW." comments] Link: https://lore.kernel.org/r/20230603011058.1038821-12-seanjc@google.com Signed-off-by: Sean Christopherson commit fe8d76c1a6f04387953727ee3e63469956e7360d Author: Like Xu Date: Fri Jun 2 18:10:56 2023 -0700 KVM: x86/cpuid: Add a KVM-only leaf to redirect AMD PerfMonV2 flag Add a KVM-only leaf for AMD's PerfMonV2 to redirect the kernel's scattered version to its architectural location, e.g. so that KVM can query guest support via guest_cpuid_has(). Suggested-by: Sean Christopherson Signed-off-by: Like Xu [sean: massage changelog] Link: https://lore.kernel.org/r/20230603011058.1038821-11-seanjc@google.com Signed-off-by: Sean Christopherson commit 1c2bf8a6b045a6ac4e75a7a07fde70db63e5a380 Author: Like Xu Date: Fri Jun 2 18:10:55 2023 -0700 KVM: x86/pmu: Constrain the num of guest counters with kvm_pmu_cap Cap the number of general purpose counters enumerated on AMD to what KVM actually supports, i.e. don't allow userspace to coerce KVM into thinking there are more counters than actually exist, e.g. by enumerating X86_FEATURE_PERFCTR_CORE in guest CPUID when its not supported. Suggested-by: Sean Christopherson Signed-off-by: Like Xu [sean: massage changelog] Link: https://lore.kernel.org/r/20230603011058.1038821-10-seanjc@google.com Signed-off-by: Sean Christopherson commit d338d8789e64b2d8ed2f82f9364c415d6efa118d Author: Like Xu Date: Fri Jun 2 18:10:54 2023 -0700 KVM: x86/pmu: Advertise PERFCTR_CORE iff the min nr of counters is met Enable and advertise PERFCTR_CORE if and only if the minimum number of required counters are available, i.e. if perf says there are less than six general purpose counters. Opportunistically, use kvm_cpu_cap_check_and_set() instead of open coding the check for host support. Suggested-by: Sean Christopherson Signed-off-by: Like Xu [sean: massage shortlog and changelog] Link: https://lore.kernel.org/r/20230603011058.1038821-9-seanjc@google.com Signed-off-by: Sean Christopherson commit 6a08083f294cb623fbc882417b28c5646b01f4bf Author: Like Xu Date: Fri Jun 2 18:10:53 2023 -0700 KVM: x86/pmu: Disable vPMU if the minimum num of counters isn't met Disable PMU support when running on AMD and perf reports fewer than four general purpose counters. All AMD PMUs must define at least four counters due to AMD's legacy architecture hardcoding the number of counters without providing a way to enumerate the number of counters to software, e.g. from AMD's APM: The legacy architecture defines four performance counters (PerfCtrn) and corresponding event-select registers (PerfEvtSeln). Virtualizing fewer than four counters can lead to guest instability as software expects four counters to be available. Rather than bleed AMD details into the common code, just define a const unsigned int and provide a convenient location to document why Intel and AMD have different mins (in particular, AMD's lack of any way to enumerate less than four counters to the guest). Keep the minimum number of counters at Intel at one, even though old P6 and Core Solo/Duo processor effectively require a minimum of two counters. KVM can, and more importantly has up until this point, supported a vPMU so long as the CPU has at least one counter. Perf's support for P6/Core CPUs does require two counters, but perf will happily chug along with a single counter when running on a modern CPU. Cc: Jim Mattson Suggested-by: Sean Christopherson Signed-off-by: Like Xu [sean: set Intel min to '1', not '2'] Link: https://lore.kernel.org/r/20230603011058.1038821-8-seanjc@google.com Signed-off-by: Sean Christopherson commit 6593039d33c119968b9e2d85eaca853b391e8a55 Author: Like Xu Date: Fri Jun 2 18:10:52 2023 -0700 KVM: x86: Explicitly zero cpuid "0xa" leaf when PMU is disabled Add an explicit !enable_pmu check as relying on kvm_pmu_cap to be zeroed isn't obvious. Although when !enable_pmu, KVM will have zero-padded kvm_pmu_cap to do subsequent CPUID leaf assignments. Suggested-by: Sean Christopherson Signed-off-by: Like Xu Link: https://lore.kernel.org/r/20230603011058.1038821-7-seanjc@google.com Signed-off-by: Sean Christopherson commit 13afa29ae489d9b7c1038179f1e2bec74873e471 Author: Like Xu Date: Fri Jun 2 18:10:51 2023 -0700 KVM: x86/pmu: Provide Intel PMU's pmc_is_enabled() as generic x86 code Move the Intel PMU implementation of pmc_is_enabled() to common x86 code as pmc_is_globally_enabled(), and drop AMD's implementation. AMD PMU currently supports only v1, and thus not PERF_GLOBAL_CONTROL, thus the semantics for AMD are unchanged. And when support for AMD PMU v2 comes along, the common behavior will also Just Work. Signed-off-by: Like Xu Co-developed-by: Sean Christopherson Link: https://lore.kernel.org/r/20230603011058.1038821-6-seanjc@google.com Signed-off-by: Sean Christopherson commit c85cdc1cc1ea27573ab15c76f13a06f12530aa54 Author: Like Xu Date: Fri Jun 2 18:10:50 2023 -0700 KVM: x86/pmu: Move handling PERF_GLOBAL_CTRL and friends to common x86 Move the handling of GLOBAL_CTRL, GLOBAL_STATUS, and GLOBAL_OVF_CTRL, a.k.a. GLOBAL_STATUS_RESET, from Intel PMU code to generic x86 PMU code. AMD PerfMonV2 defines three registers that have the same semantics as Intel's variants, just with different names and indices. Conveniently, since KVM virtualizes GLOBAL_CTRL on Intel only for PMU v2 and above, and AMD's version shows up in v2, KVM can use common code for the existence check as well. Signed-off-by: Like Xu Co-developed-by: Sean Christopherson Link: https://lore.kernel.org/r/20230603011058.1038821-5-seanjc@google.com Signed-off-by: Sean Christopherson commit 30dab5c0b65ea580878f36d6ae7ff85f06813387 Author: Like Xu Date: Fri Jun 2 18:10:49 2023 -0700 KVM: x86/pmu: Reject userspace attempts to set reserved GLOBAL_STATUS bits Reject userspace writes to MSR_CORE_PERF_GLOBAL_STATUS that attempt to set reserved bits. Allowing userspace to stuff reserved bits doesn't harm KVM itself, but it's architecturally wrong and the guest can't clear the unsupported bits, e.g. makes the guest's PMI handler very confused. Signed-off-by: Like Xu [sean: rewrite changelog to avoid use of #GP, rebase on name change] Link: https://lore.kernel.org/r/20230603011058.1038821-4-seanjc@google.com Signed-off-by: Sean Christopherson commit 8de18543dfe34a6aac9deefb0256db2609cfa351 Author: Like Xu Date: Fri Jun 2 18:10:48 2023 -0700 KVM: x86/pmu: Move reprogram_counters() to pmu.h Move reprogram_counters() out of Intel specific PMU code and into pmu.h so that it can be used to implement AMD PMU v2 support. No functional change intended. Suggested-by: Sean Christopherson Signed-off-by: Like Xu [sean: rewrite changelog] Link: https://lore.kernel.org/r/20230603011058.1038821-3-seanjc@google.com Signed-off-by: Sean Christopherson commit 53550b89220beda42934a76a61313ecf308b2b03 Author: Sean Christopherson Date: Fri Jun 2 18:10:47 2023 -0700 KVM: x86/pmu: Rename global_ovf_ctrl_mask to global_status_mask Rename global_ovf_ctrl_mask to global_status_mask to avoid confusion now that Intel has renamed GLOBAL_OVF_CTRL to GLOBAL_STATUS_RESET in PMU v4. GLOBAL_OVF_CTRL and GLOBAL_STATUS_RESET are the same MSR index, i.e. are just different names for the same thing, but the SDM provides different entries in the IA-32 Architectural MSRs table, which gets really confusing when looking at PMU v4 definitions since it *looks* like GLOBAL_STATUS has bits that don't exist in GLOBAL_OVF_CTRL, but in reality the bits are simply defined in the GLOBAL_STATUS_RESET entry. No functional change intended. Cc: Like Xu Link: https://lore.kernel.org/r/20230603011058.1038821-2-seanjc@google.com Signed-off-by: Sean Christopherson commit d4ec586c60ab978554245c58cf432df444c93b4e Author: Peter Xu Date: Tue Jun 6 17:12:26 2023 -0700 KVM: selftests: Allow specify physical cpu list in demand paging test Mimic the dirty log test and allow the user to pin demand paging test tasks to physical CPUs. Put the help message into a general helper as suggested by Sean. Signed-off-by: Peter Xu [sean: rebase, tweak arg ordering, add "print" to helper, print program name] Link: https://lore.kernel.org/r/20230607001226.1398889-1-seanjc@google.com Signed-off-by: Sean Christopherson commit e12fa4b92a07f4274ffa02e581d059a7869dd50e Author: Michal Luczaj Date: Mon Jun 5 22:01:21 2023 +0200 KVM: x86: Clean up: remove redundant bool conversions As test_bit() returns bool, explicitly converting result to bool is unnecessary. Get rid of '!!'. No functional change intended. Suggested-by: Sean Christopherson Signed-off-by: Michal Luczaj Link: https://lore.kernel.org/r/20230605200158.118109-1-mhal@rbox.co Signed-off-by: Sean Christopherson commit 94142c9d1bdf1c18027a42758ceb6bdd59a92012 Author: Kirill A. Shutemov Date: Tue Jun 6 12:56:22 2023 +0300 x86/mm: Fix enc_status_change_finish_noop() enc_status_change_finish_noop() is now defined as always-fail, which doesn't make sense for noop. The change has no user-visible effect because it is only called if the platform has CC_ATTR_MEM_ENCRYPT. All platforms with the attribute override the callback with their own implementation. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Kuppuswamy Sathyanarayanan Link: https://lore.kernel.org/all/20230606095622.1939-4-kirill.shutemov%40linux.intel.com commit 195edce08b63d293377f615f4f7f086715d2d212 Author: Kirill A. Shutemov Date: Tue Jun 6 12:56:21 2023 +0300 x86/tdx: Fix race between set_memory_encrypted() and load_unaligned_zeropad() tl;dr: There is a race in the TDX private<=>shared conversion code which could kill the TDX guest. Fix it by changing conversion ordering to eliminate the window. TDX hardware maintains metadata to track which pages are private and shared. Additionally, TDX guests use the guest x86 page tables to specify whether a given mapping is intended to be private or shared. Bad things happen when the intent and metadata do not match. So there are two thing in play: 1. "the page" -- the physical TDX page metadata 2. "the mapping" -- the guest-controlled x86 page table intent For instance, an unrecoverable exit to VMM occurs if a guest touches a private mapping that points to a shared physical page. In summary: * Private mapping => Private Page == OK (obviously) * Shared mapping => Shared Page == OK (obviously) * Private mapping => Shared Page == BIG BOOM! * Shared mapping => Private Page == OK-ish (It will read generate a recoverable #VE via handle_mmio()) Enter load_unaligned_zeropad(). It can touch memory that is adjacent but otherwise unrelated to the memory it needs to touch. It will cause one of those unrecoverable exits (aka. BIG BOOM) if it blunders into a shared mapping pointing to a private page. This is a problem when __set_memory_enc_pgtable() converts pages from shared to private. It first changes the mapping and second modifies the TDX page metadata. It's moving from: * Shared mapping => Shared Page == OK to: * Private mapping => Shared Page == BIG BOOM! This means that there is a window with a shared mapping pointing to a private page where load_unaligned_zeropad() can strike. Add a TDX handler for guest.enc_status_change_prepare(). This converts the page from shared to private *before* the page becomes private. This ensures that there is never a private mapping to a shared page. Leave a guest.enc_status_change_finish() in place but only use it for private=>shared conversions. This will delay updating the TDX metadata marking the page private until *after* the mapping matches the metadata. This also ensures that there is never a private mapping to a shared page. [ dhansen: rewrite changelog ] Fixes: 7dbde7631629 ("x86/mm/cpa: Add support for TDX shared memory") Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Kuppuswamy Sathyanarayanan Link: https://lore.kernel.org/all/20230606095622.1939-3-kirill.shutemov%40linux.intel.com commit 748462b59f901557377b2c33ea9808ff2000e141 Merge: 90502d51ab900 9e320d7ca46ae Author: Palmer Dabbelt Date: Tue Jun 6 15:19:33 2023 -0700 Merge patch series "riscv: allow case-insensitive ISA string parsing" Yangyu Chen says: This patchset allows case-insensitive ISA string parsing, which is needed in the ACPI environment. As the RISC-V Hart Capabilities Table (RHCT) description in UEFI Forum ECR[1] shows the format of the ISA string is defined in the RISC-V unprivileged specification[2]. However, the RISC-V unprivileged specification defines the ISA naming strings are case-insensitive while the current ISA string parser in the kernel only accepts lowercase letters. In this case, the kernel should allow case-insensitive ISA string parsing. Moreover, this reason has been discussed in Conor's patch[3]. And I have also checked the current ISA string parsing in the recent ACPI support patch[4] will also call `riscv_fill_hwcap` function as DT we use now. The original motivation for my patch v1[5] is that some SoC generators will provide generated DT with illegal ISA string in dt-binding such as rocket-chip, which will even cause kernel panic in some cases as I mentioned in v1[5]. Now, the rocket-chip has been fixed in PR #3333[6]. However, when using some specific version of rocket-chip with illegal ISA string in DT, this patchset will also work for parsing uppercase letters correctly in DT, thus will have better compatibility. In summary, this patch not only works for case-insensitive ISA string parsing to meet the requirements in ECR[1] but also can be a workaround for some specific versions of rocket-chip. * b4-shazam-merge: dt-bindings: riscv: drop invalid comment about riscv,isa lower-case reasoning riscv: allow case-insensitive ISA string parsing Link: https://lore.kernel.org/r/tencent_E6911C8D71F5624E432A1AFDF86804C3B509@qq.com Signed-off-by: Palmer Dabbelt commit 9e320d7ca46aecf565c3900452acae579a7d0a9a Author: Conor Dooley Date: Tue May 2 00:17:39 2023 +0800 dt-bindings: riscv: drop invalid comment about riscv,isa lower-case reasoning "Ease of parsing" may have been the initial argument for keeping this string in lower-case, but parsers may have been written that expect lower-case only. For example, the one in released kernels currently does not behave correctly for multi-letter extensions that begin with a capital letter. Allowing upper-case here brings about no benefit but would break compatibility between new devicetrees and older kernels. Drop the comment to avoid confusing people. Signed-off-by: Conor Dooley Reviewed-by: Andrew Jones Acked-by: Rob Herring Signed-off-by: Yangyu Chen Link: https://lore.kernel.org/r/tencent_3B8290DDC66D3E624132ED39C7465CDC9807@qq.com Signed-off-by: Palmer Dabbelt commit 255b34d799ddaaef5e8672b96c47a3b94fe85da9 Author: Yangyu Chen Date: Tue May 2 00:17:38 2023 +0800 riscv: allow case-insensitive ISA string parsing According to RISC-V Hart Capabilities Table (RHCT) description in UEFI Forum ECR, the format of the ISA string is defined in the RISC-V unprivileged specification which is case-insensitive. However, the current ISA string parser in the kernel does not support ISA strings with uppercase letters. This patch modifies the ISA string parser in the kernel to support case-insensitive ISA string parsing. Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Signed-off-by: Yangyu Chen Link: https://lore.kernel.org/r/tencent_B30EED51C7235CA1988890E5C658BE35C107@qq.com Signed-off-by: Palmer Dabbelt commit 7b3ba09febf409117a6f5b3e8ae10d503a972fee Author: Mika Westerberg Date: Tue Apr 25 09:47:51 2023 +0300 PCI/PM: Shorten pci_bridge_wait_for_secondary_bus() wait time for slow links With slow links (<= 5GT/s) active link reporting is not mandatory, so if a device is disconnected during system sleep we might end up waiting for it to respond for ~60s, which slows down resume time. PCIe r6.0, sec 6.6.1, mandates that software must wait for at least 1s before it can assume a device is broken, so use that minimum requirement for slow links and bail out if the device doesn't respond within 1s. However, if the port supports active link reporting we can wait longer as we do with the fast links. This should make system resume time faster for slow links as well while still following the PCIe spec. While there move the PCI_RESET_WAIT constant into pci.c because it is not used outside of that file anymore. Link: https://lore.kernel.org/r/20230425064751.24951-1-mika.westerberg@linux.intel.com Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Lukas Wunner Reviewed-by: Kuppuswamy Sathyanarayanan commit c6f54cf44c3d05510f8f292a1782105c087797ba Author: Andy Shevchenko Date: Fri Apr 21 13:09:39 2023 +0300 PCI: of: Propagate firmware node by calling device_set_node() Insulate pci_set_of_node() and pci_set_bus_of_node() from possible changes to fwnode_handle implementation by using device_set_node() instead of open-coding dev->dev.fwnode assignments. Link: https://lore.kernel.org/r/20230421100939.68225-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Bjorn Helgaas commit 056b9919a16aedc560e6756a235ef5a62a68db05 Author: Sean Christopherson Date: Thu Jun 1 18:05:50 2023 -0700 KVM: x86: Use cpu_feature_enabled() for PKU instead of #ifdef Replace an #ifdef on CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS with a cpu_feature_enabled() check on X86_FEATURE_PKU. The macro magic of DISABLED_MASK_BIT_SET() means that cpu_feature_enabled() provides the same end result (no code generated) when PKU is disabled by Kconfig. No functional change intended. Cc: Jon Kohler Reviewed-by: Jon Kohler Link: https://lore.kernel.org/r/20230602010550.785722-1-seanjc@google.com Signed-off-by: Sean Christopherson commit 5f643e460ab1298a32b7d0db104bfcab9d6165c0 Author: Michal Luczaj Date: Mon Jun 5 13:44:19 2023 +0200 KVM: Clean up kvm_vm_ioctl_create_vcpu() Since c9d601548603 ("KVM: allow KVM_BUG/KVM_BUG_ON to handle 64-bit cond") 'cond' is internally converted to boolean, so caller's explicit conversion from void* is unnecessary. Remove the double bang. Signed-off-by: Michal Luczaj Reviewed-by: Yuan Yao base-commit: 76a17bf03a268bc342e08c05d8ddbe607d294eb4 Link: https://lore.kernel.org/r/20230605114852.288964-1-mhal@rbox.co Signed-off-by: Sean Christopherson commit 0a3869e14d4a5e1016aad6bc6c5b70f82bc0dbbe Author: Sean Christopherson Date: Thu Jun 1 18:15:18 2023 -0700 KVM: x86/mmu: Trigger APIC-access page reload iff vendor code cares Request an APIC-access page reload when the backing page is migrated (or unmapped) if and only if vendor code actually plugs the backing pfn into structures that reside outside of KVM's MMU. This avoids kicking all vCPUs in the (hopefully infrequent) scenario where the backing page is migrated/invalidated. Unlike VMX's APICv, SVM's AVIC doesn't plug the backing pfn directly into the VMCB and so doesn't need a hook to invalidate an out-of-MMU "mapping". Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20230602011518.787006-4-seanjc@google.com Signed-off-by: Sean Christopherson commit 0a8a5f2c8c266e9d94fb45f76a26cff135d0051c Author: Sean Christopherson Date: Thu Jun 1 18:15:17 2023 -0700 KVM: x86: Use standard mmu_notifier invalidate hooks for APIC access page Now that KVM honors past and in-progress mmu_notifier invalidations when reloading the APIC-access page, use KVM's "standard" invalidation hooks to trigger a reload and delete the one-off usage of invalidate_range(). Aside from eliminating one-off code in KVM, dropping KVM's use of invalidate_range() will allow common mmu_notifier to redefine the API to be more strictly focused on invalidating secondary TLBs that share the primary MMU's page tables. Suggested-by: Jason Gunthorpe Cc: Alistair Popple Cc: Robin Murphy Reviewed-by: Alistair Popple Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20230602011518.787006-3-seanjc@google.com Signed-off-by: Sean Christopherson commit 878940b33d7678e39a526ffe264ee025977dc67e Author: Sean Christopherson Date: Thu Jun 1 18:15:16 2023 -0700 KVM: VMX: Retry APIC-access page reload if invalidation is in-progress Re-request an APIC-access page reload if there is a relevant mmu_notifier invalidation in-progress when KVM retrieves the backing pfn, i.e. stall vCPUs until the backing pfn for the APIC-access page is "officially" stable. Relying on the primary MMU to not make changes after invoking ->invalidate_range() works, e.g. any additional changes to a PRESENT PTE would also trigger an ->invalidate_range(), but using ->invalidate_range() to fudge around KVM not honoring past and in-progress invalidations is a bit hacky. Honoring invalidations will allow using KVM's standard mmu_notifier hooks to detect APIC-access page reloads, which will in turn allow removing KVM's implementation of ->invalidate_range() (the APIC-access page case is a true one-off). Opportunistically add a comment to explain why doing nothing if a memslot isn't found is functionally correct. Suggested-by: Jason Gunthorpe Cc: Alistair Popple Cc: Robin Murphy Reviewed-by: Alistair Popple Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20230602011518.787006-2-seanjc@google.com Signed-off-by: Sean Christopherson commit 38e0689b27f8b9a0085815b2446b12f685d028aa Author: Alexandre Torgue Date: Wed May 31 14:27:31 2023 +0200 rtc: stm32: remove dedicated wakeup management There is no more needs to use a dedicated wake up interrupt for RTC as EXTI block manages by itself now all interrupt lines. Dedicated wakeup interrupt has been introduced with STM32 MP1 support commit b72252b6580c ("rtc: stm32: add stm32mp1 rtc support") because GIC & EXTI interrupts were not yet linked in EXTI driver. Removing this interrupt won't break compatibility with device trees which do use two interrupts entries: it could only prevent wakeup from low power modes on STM32MP1x, but platform power management is not yet available. Signed-off-by: Alexandre Torgue Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20230531122732.1515594-1-amelie.delaunay@foss.st.com Signed-off-by: Alexandre Belloni commit 93eff1e0e67a0b54fc16f07f0ca88f8b5afd9f89 Author: Krzysztof Kozlowski Date: Tue May 30 16:48:47 2023 +0200 dt-bindings: rtc: restrict node name suffixes Make the pattern matching node names a bit stricter to improve DTS consistency. The pattern is restricted to: 1. Only one unit address or one -N suffix, 2. -N suffixes to decimal numbers. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230530144851.92059-4-krzysztof.kozlowski@linaro.org Signed-off-by: Alexandre Belloni commit 8bb12adb214b2d7cdad84f89db2cbab4b2908b61 Author: Niklas Schnelle Date: Mon May 22 12:50:35 2023 +0200 rtc: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Acked-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/20230522105049.1467313-31-schnelle@linux.ibm.com Signed-off-by: Alexandre Belloni commit 31b0cecb4042d2676fd48f09379a19bc8b16eadd Author: Uwe Kleine-König Date: Fri May 5 14:11:36 2023 +0200 rtc: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230505121136.1185653-1-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit b19118965778da3ba9fbeeca39bdf24738d229b4 Author: Krzysztof Kozlowski Date: Thu May 11 19:56:09 2023 +0200 rtc: rv3032: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230511175609.282191-4-krzysztof.kozlowski@linaro.org Signed-off-by: Alexandre Belloni commit 303b1e894470421f7c5b6452937fc8c1f0f89075 Author: Krzysztof Kozlowski Date: Thu May 11 19:56:08 2023 +0200 rtc: isl12022: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230511175609.282191-3-krzysztof.kozlowski@linaro.org Signed-off-by: Alexandre Belloni commit d00caa55cecd3e833c21c9372fc558cb9f40a07f Author: Krzysztof Kozlowski Date: Thu May 11 19:56:07 2023 +0200 rtc: ds3232: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230511175609.282191-2-krzysztof.kozlowski@linaro.org Signed-off-by: Alexandre Belloni commit 973ef08456f8c6aea4672ae986dfe907b9e4fdc3 Author: Krzysztof Kozlowski Date: Thu May 11 19:56:06 2023 +0200 rtc: ab-eoz9: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230511175609.282191-1-krzysztof.kozlowski@linaro.org Signed-off-by: Alexandre Belloni commit 55382134366e641e97cd83264c22c60c7dc10ccd Author: GONG, Ruiqi Date: Fri Jun 2 13:45:27 2023 +0800 capability: erase checker warnings about struct __user_cap_data_struct Currently Sparse warns the following when compiling kernel/capability.c: kernel/capability.c:191:35: warning: incorrect type in argument 2 (different address spaces) kernel/capability.c:191:35: expected void const *from kernel/capability.c:191:35: got struct __user_cap_data_struct [noderef] __user * kernel/capability.c:168:14: warning: dereference of noderef expression ...... (multiple noderef warnings on different locations) kernel/capability.c:244:29: warning: incorrect type in argument 1 (different address spaces) kernel/capability.c:244:29: expected void *to kernel/capability.c:244:29: got struct __user_cap_data_struct [noderef] __user ( * )[2] kernel/capability.c:247:42: warning: dereference of noderef expression ...... (multiple noderef warnings on different locations) It seems that defining `struct __user_cap_data_struct` together with `cap_user_data_t` make Sparse believe that the struct is `noderef` as well. Separate their definitions to clarify their respective attributes. Signed-off-by: GONG, Ruiqi Acked-by: Serge Hallyn [PM: wrapped long lines in the description] Signed-off-by: Paul Moore commit bf5c04ddd378dbd62d41d9c5bd18cca03bee2946 Author: Yeqi Fu Date: Thu May 18 01:31:11 2023 +0800 EDAC/thunderx: Check debugfs file creation retval properly edac_debugfs_create_file() returns ERR_PTR by way of the respective debugfs function it calls, if an error occurs. The appropriate way to verify for errors is to use IS_ERR(). Do so. [ bp: Rewrite all text. ] Signed-off-by: Yeqi Fu Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230517173111.365787-1-asuk4.q@gmail.com commit aa7881fcfe9d328484265d589bc2785533e33c4d Author: Hou Tao Date: Tue Jun 6 11:53:08 2023 +0800 bpf: Factor out a common helper free_all() Factor out a common helper free_all() to free all normal elements or per-cpu elements on a lock-less list. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20230606035310.4026145-2-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 2dc476404efa8546a08561877e88bfb2006facab Merge: ae91f7e436f8b ee0202e2e731d Author: Jakub Kicinski Date: Tue Jun 6 12:31:33 2023 -0700 Merge branch 'tools-ynl-user-space-c' Jakub Kicinski says: ==================== tools: ynl: user space C Use the code gen which is already in tree to generate a user space library for a handful of simple families. I find YNL C quite useful in some WIP projects, and I think others may find it useful, too. I was hoping someone will pick this work up and finish it... but it seems that Python YNL has largely stolen the thunder. Python may not be great for selftest, tho, and actually this lib is more fully-featured. The Python script was meant as a quick demo, funny how those things go. v2: https://lore.kernel.org/all/20230604175843.662084-1-kuba@kernel.org/ v1: https://lore.kernel.org/all/20230603052547.631384-1-kuba@kernel.org/ ==================== Link: https://lore.kernel.org/r/20230605190108.809439-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit ee0202e2e731d074639461b3db2296bf44d847ce Author: Jakub Kicinski Date: Mon Jun 5 12:01:08 2023 -0700 tools: ynl: add sample for netdev Add a sample application using the C library. My main goal is to make writing selftests easier but until I have some of those ready I think it's useful to show off the functionality and let people poke and tinker. Sample outputs - dump: $ ./netdev Select ifc ($ifindex; or 0 = dump; or -2 ntf check): 0 lo[1] 0: enp1s0[2] 23: basic redirect rx-sg Notifications (watching veth pair getting added and deleted): $ ./netdev Select ifc ($ifindex; or 0 = dump; or -2 ntf check): -2 [53] 0: (ntf: dev-add-ntf) [54] 0: (ntf: dev-add-ntf) [54] 23: basic redirect rx-sg (ntf: dev-change-ntf) [53] 23: basic redirect rx-sg (ntf: dev-change-ntf) [53] 23: basic redirect rx-sg (ntf: dev-del-ntf) [54] 23: basic redirect rx-sg (ntf: dev-del-ntf) Reviewed-by: Willem de Bruijn Signed-off-by: Jakub Kicinski commit d75fdfbc6f260f50cde5d1d566ab010a370df62e Author: Jakub Kicinski Date: Mon Jun 5 12:01:07 2023 -0700 tools: ynl: support fou and netdev in C Generate the code for netdev and fou families. They are simple and already supported by the code gen. Reviewed-by: Willem de Bruijn Signed-off-by: Jakub Kicinski commit 86878f14d71af89149a955122afd8b7af1ee9bf2 Author: Jakub Kicinski Date: Mon Jun 5 12:01:06 2023 -0700 tools: ynl: user space helpers Add "fixed" part of the user space Netlink Spec-based library. This will get linked with the protocol implementations to form a full API. Acked-by: Willem de Bruijn Signed-off-by: Jakub Kicinski commit a99bfdf647953f8ac4ae71f373113e8ac194f1c0 Author: Jakub Kicinski Date: Mon Jun 5 12:01:05 2023 -0700 tools: ynl-gen: clean up stray new lines at the end of reply-less requests Do not print empty lines before closing brackets. Reviewed-by: Willem de Bruijn Signed-off-by: Jakub Kicinski commit 8c9cce9cb81b5fdc6e66bf3f129727b89e8daab7 Author: Caleb Connolly Date: Tue Jun 6 12:05:32 2023 -0700 Input: pm8941-powerkey - fix debounce on gen2+ PMICs Since PM8998/PM660, the power key debounce register was redefined to support shorter debounce times. On PM8941 the shortest debounce time (represented by register value 0) was 15625us, on PM8998 the shortest debounce time is 62us, with the default being 2ms. Adjust the bit shift to correctly program debounce on PM8998 and newer. Fixes: 68c581d5e7d8 ("Input: add Qualcomm PM8941 power key driver") Signed-off-by: Caleb Connolly Link: https://lore.kernel.org/r/20230529-pm8941-pwrkey-debounce-v1-2-c043a6d5c814@linaro.org Signed-off-by: Dmitry Torokhov commit 60b7ae370797692dc747c3b88a7f2c737e39f864 Author: Caleb Connolly Date: Tue Jun 6 12:03:30 2023 -0700 MAINTAINERS: Adjust Qualcomm driver globbing The only drivers matching pm8???-* are two levels deep, adjust the glob to match them. Signed-off-by: Caleb Connolly Link: https://lore.kernel.org/r/20230529-pm8941-pwrkey-debounce-v1-1-c043a6d5c814@linaro.org Signed-off-by: Dmitry Torokhov commit b11403c93b7cddc8916b132a395b1524c02447a3 Author: Osama Muhammad Date: Wed May 17 22:24:31 2023 +0500 wkup_m3_ipc.c: Fix error checking for debugfs_create_dir This patch fixes the error checking in wkup_m3_ipc.c in debugfs_create_dir. The correct way to check if an error occurred is 'IS_ERR' inline function. Signed-off-by: Osama Muhammad Link: https://lore.kernel.org/r/20230517172431.13507-1-osmtendev@gmail.com Signed-off-by: Nishanth Menon commit 18b849f12dcc34ec4cb9c8fadeb503b069499ba4 Author: Andy Shevchenko Date: Sun May 28 17:09:38 2023 +0300 ieee802154: ca8210: Remove stray gpiod_unexport() call There is no gpiod_export() and gpiod_unexport() looks pretty much stray. The gpiod_export() and gpiod_unexport() shouldn't be used in the code, GPIO sysfs is deprecated. That said, simply drop the stray call. Signed-off-by: Andy Shevchenko Reviewed-by: Simon Horman Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-wpan/20230528140938.34034-1-andriy.shevchenko@linux.intel.com commit f11f1a92c17385ff4d6e2bc8002d59aed70b98c4 Author: Dmitry Torokhov Date: Tue Jun 6 11:16:25 2023 -0700 Input: gameport - provide default trigger() and read() Instead of constantly checking pointer(s) for non-NULL-ness provide default implementations of trigger() and read() and instantiate them during pore registration if driver-specific versions were not provided. Link: https://lore.kernel.org/r/ZGvoqP5PAAsJuky4@google.com Signed-off-by: Dmitry Torokhov commit 1b842f73edbb1f8513ef4a89389176c628dc014a Author: John Harrison Date: Wed May 31 08:59:42 2023 -0700 drm/i915/guc: Remove some obsolete definitions There were a bunch of defines and structures left over from an API update a very long time ago. Remove them. Signed-off-by: John Harrison Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230531155942.441862-1-John.C.Harrison@Intel.com commit d9f12a3bbb6d1afe872425a8fa2612945975cfb8 Author: Uwe Kleine-König Date: Tue Jun 6 10:42:36 2023 -0700 Input: tps65219-pwrbutton - use regmap_set_bits() regmap_set_bits() is equivalent to regmap_update_bits() if mask == val. The probe function uses regmap_clear_bits() to enable irqs, so symmetrically make use of regmap_set_bits() to disable them. There is no semantic difference. Signed-off-by: Uwe Kleine-König Reviewed-by: Markus Schneider-Pargmann Link: https://lore.kernel.org/r/20230605161458.117361-2-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit ab892b7fd44a68feead30e2f53ba31818ca84749 Author: Uwe Kleine-König Date: Tue Jun 6 10:27:24 2023 -0700 Input: tps65219-pwrbutton - convert to .remove_new() The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning). To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Before this driver might have returned an error. In this case emit a warning that tells more about the problem than the generic warning by the core, and instead of making the remove callback return zero unconditionally, convert to .remove_new() which is equivalent. Signed-off-by: Uwe Kleine-König Reviewed-by: Markus Schneider-Pargmann Link: https://lore.kernel.org/r/20230605161458.117361-1-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 3f6819dd192ef4f0c568ec3e9d6d408b3fa1ad3d Author: Kirill A. Shutemov Date: Tue Jun 6 12:56:20 2023 +0300 x86/mm: Allow guest.enc_status_change_prepare() to fail TDX code is going to provide guest.enc_status_change_prepare() that is able to fail. TDX will use the call to convert the GPA range from shared to private. This operation can fail. Add a way to return an error from the callback. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Kuppuswamy Sathyanarayanan Link: https://lore.kernel.org/all/20230606095622.1939-2-kirill.shutemov%40linux.intel.com commit 6d1bc9754b04075d938b47cf7f7800814b8911a7 Author: Alexander Mikhalitsyn Date: Mon May 22 18:12:48 2023 +0200 KVM: SVM: enhance info printk's in SEV init Let's print available ASID ranges for SEV/SEV-ES guests. This information can be useful for system administrator to debug if SEV/SEV-ES fails to enable. There are a few reasons. SEV: - NPT is disabled (module parameter) - CPU lacks some features (sev, decodeassists) - Maximum SEV ASID is 0 SEV-ES: - mmio_caching is disabled (module parameter) - CPU lacks sev_es feature - Minimum SEV ASID value is 1 (can be adjusted in BIOS/UEFI) Cc: Sean Christopherson Cc: Paolo Bonzini Cc: Stéphane Graber Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Suggested-by: Sean Christopherson Signed-off-by: Alexander Mikhalitsyn Link: https://lore.kernel.org/r/20230522161249.800829-3-aleksandr.mikhalitsyn@canonical.com [sean: print '0' for min SEV-ES ASID if there are no available ASIDs] Signed-off-by: Sean Christopherson commit 3a76c7ca9e77269dd10cf21465a055274cfa40c6 Author: Vijaya Krishna Nivarthi Date: Wed May 17 17:48:14 2023 +0530 spi: spi-geni-qcom: Do not do DMA map/unmap inside driver, use framework instead The spi geni driver in SE DMA mode, unlike GSI DMA, is not making use of DMA mapping functionality available in the framework. The driver does mapping internally which makes dma buffer fields available in spi_transfer struct superfluous while requiring additional members in spi_geni_master struct. Conform to the design by having framework handle map/unmap and do only DMA transfer in the driver; this also simplifies code a bit. Fixes: e5f0dfa78ac7 ("spi: spi-geni-qcom: Add support for SE DMA mode") Suggested-by: Douglas Anderson Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/1684325894-30252-3-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Mark Brown commit 6d6e57594957ee9131bc3802dfc8657ca6f78fee Author: Vijaya Krishna Nivarthi Date: Wed May 17 17:48:13 2023 +0530 soc: qcom: geni-se: Add interfaces geni_se_tx_init_dma() and geni_se_rx_init_dma() The geni_se_xx_dma_prep() interfaces necessarily do DMA mapping before initiating DMA transfers. This is not suitable for spi where framework is expected to handle map/unmap. Expose new interfaces geni_se_xx_init_dma() which do only DMA transfer. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/1684325894-30252-2-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Mark Brown commit 2f932d4151599bc647607ae841cf57273279168c Author: Udit Kumar Date: Wed Apr 19 09:30:07 2023 +0530 arm64: dts: ti: k3-j7200-som: Enable I2C This patch enables wkup_i2c0 node in board dts file along with pin mux and speed. Also enables underneath eeprom CAV24C256WE. J7200 Datasheet (Table 6-106, Section 6.4 Pin Multiplexing) : https://www.ti.com/lit/ds/symlink/dra821u.pdf J7200 User Guide (Section 4.3, Table 4-2) : https://www.ti.com/lit/ug/spruiw7a/spruiw7a.pdf Signed-off-by: Udit Kumar Link: https://lore.kernel.org/r/20230419040007.3022780-3-u-kumar1@ti.com Signed-off-by: Vignesh Raghavendra commit 3d011933000ed9054c649952d83162d24f020a93 Author: Keerthy Date: Wed Apr 19 09:30:06 2023 +0530 arm64: dts: ti: k3-j7200: Fix physical address of pin wkup_pmx splits into multiple regions. Like wkup_pmx0 -> 13 pins (WKUP_PADCONFIG 0 - 12) wkup_pmx1 -> 2 pins (WKUP_PADCONFIG 14 - 15) wkup_pmx2 -> 59 pins (WKUP_PADCONFIG 26 - 84) wkup_pmx3 -> 8 pins (WKUP_PADCONFIG 93 - 100) With this split, pin offset needs to be adjusted to match with new pmx for all pins above wkup_pmx0. Example a pin under wkup_pmx1 should start from 0 instead of old offset(0x38 WKUP_PADCONFIG 14 offset) J7200 Datasheet (Table 6-106, Section 6.4 Pin Multiplexing) : https://www.ti.com/lit/ds/symlink/dra821u.pdf Fixes: 9ae21ac445e9 ("arm64: dts: ti: k3-j7200: Fix wakeup pinmux range") Signed-off-by: Keerthy Signed-off-by: Udit Kumar Link: https://lore.kernel.org/r/20230419040007.3022780-2-u-kumar1@ti.com Signed-off-by: Vignesh Raghavendra commit cf39ff15cc01adea0ec46d1571d5ae849bb02d43 Author: Nishanth Menon Date: Tue Apr 25 17:17:08 2023 -0500 arm64: dts: ti: k3-am62a7-sk: Describe main_uart1 and wkup_uart wkup_uart and main_uart1 on this platform is used by tifs and DM firmwares. Describe them for completeness including the pinmux. Signed-off-by: Nishanth Menon [bb@ti.com: updated pinmux and commit subject] Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20230425221708.549675-1-bb@ti.com Signed-off-by: Vignesh Raghavendra commit f17ccc5deb4d024bb52fd3433471e77ab7ae9ad8 Author: Jerome Neanne Date: Mon May 22 18:31:15 2023 +0200 regulator: tps6594-regulator: Add driver for TI TPS6594 regulators This patch adds support for TPS6594 regulators (bucks and LDOs). The output voltages are configurable and are meant to supply power to the main processor and other components. Bucks can be used in single or multiphase mode, depending on PMIC part number. Signed-off-by: Jerome Neanne Signed-off-by: Esteban Blanc Link: https://lore.kernel.org/r/20230522163115.2592883-4-eblanc@baylibre.com Signed-off-by: Mark Brown commit 1d5682ccc7d6088179b6cfd50a3e3bb6d2b0527e Author: Rafał Miłecki Date: Mon Jun 5 08:10:49 2023 +0200 ARM: dts: BCM5301X: Relicense Christian's code to the GPL 2.0+ / MIT Move code added by Christian to the bcm-ns.dtsi which uses dual licensing. That syncs more Northstar code to be based on the same licensing schema. Cc: Christian Lamparter Signed-off-by: Rafał Miłecki Acked-by: Christian Lamparter Link: https://lore.kernel.org/r/20230605061049.16136-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 175cea665877c89aae4bd449d67bd8f4d6f900a3 Author: Mark Brown Date: Tue May 23 19:37:05 2023 +0100 arm64/sysreg: Convert OSECCR_EL1 to automatic generation Convert OSECCR_EL1 to automatic generation as per DDI0601 2023-03, no functional changes. Signed-off-by: Mark Brown Reviewed-by: Shaoqin Huang Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20230419-arm64-syreg-gen-v2-7-4c6add1f6257@kernel.org Signed-off-by: Catalin Marinas commit 42383388758a56ceda7cc7b7e941cd9f415511f3 Author: Mark Brown Date: Tue May 23 19:37:04 2023 +0100 arm64/sysreg: Convert OSDTRTX_EL1 to automatic generation Convert OSDTRTX_EL1 to automatic generation as per DDI0601 2023-03. No functional changes. Signed-off-by: Mark Brown Reviewed-by: Shaoqin Huang Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20230419-arm64-syreg-gen-v2-6-4c6add1f6257@kernel.org Signed-off-by: Catalin Marinas commit 7b416a16222901082d9c0c7748d5b446a2d85d90 Author: Mark Brown Date: Tue May 23 19:37:03 2023 +0100 arm64/sysreg: Convert OSDTRRX_EL1 to automatic generation Convert OSDTRRX_EL1 to automatic generation as per DDI0601 2023-03, no functional changes. Signed-off-by: Mark Brown Reviewed-by: Shaoqin Huang Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20230419-arm64-syreg-gen-v2-5-4c6add1f6257@kernel.org Signed-off-by: Catalin Marinas commit 31d504fce595f2aab00889e05bf8cea222e65d90 Author: Mark Brown Date: Tue May 23 19:37:02 2023 +0100 arm64/sysreg: Convert OSLAR_EL1 to automatic generation Convert OSLAR_EL1 to automatic generation as per DDI0601 2023-03. No functional change. Reviewed-by: Shaoqin Huang Signed-off-by: Mark Brown Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20230419-arm64-syreg-gen-v2-4-4c6add1f6257@kernel.org Signed-off-by: Catalin Marinas commit 187de7c2aad86c7bde6f695bfadb0ecd489de55c Author: Mark Brown Date: Tue May 23 19:37:01 2023 +0100 arm64/sysreg: Standardise naming of bitfield constants in OSL[AS]R_EL1 Our standard scheme for naming the constants for bitfields in system registers includes _ELx in the name but not the SYS_, update the constants for OSL[AS]R_EL1 to follow this convention. Reviewed-by: Shaoqin Huang Signed-off-by: Mark Brown Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20230419-arm64-syreg-gen-v2-3-4c6add1f6257@kernel.org Signed-off-by: Catalin Marinas commit 103b88427bc514c5f7d2d28b9f4e10cddc8900e0 Author: Mark Brown Date: Tue May 23 19:37:00 2023 +0100 arm64/sysreg: Convert MDSCR_EL1 to automatic register generation Convert MDSCR_EL1 to automatic register generation as per DDI0616 2023-03. No functional change. Reviewed-by: Shaoqin Huang Signed-off-by: Mark Brown Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20230419-arm64-syreg-gen-v2-2-4c6add1f6257@kernel.org Signed-off-by: Catalin Marinas commit 3def3387f7556efa5f7ec738a3511758e0a4b1d1 Author: Mark Brown Date: Tue May 23 19:36:59 2023 +0100 arm64/sysreg: Convert MDCCINT_EL1 to automatic register generation Convert MDCCINT_EL1 to automatic register generation as per DDI0616 2023-03. No functional change. Reviewed-by: Anshuman Khandual Reviewed-by: Shaoqin Huang Signed-off-by: Mark Brown Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20230419-arm64-syreg-gen-v2-1-4c6add1f6257@kernel.org Signed-off-by: Catalin Marinas commit 3e35d303ab7d22c4b6597e56ba46ee7cc61f3a5a Author: Mark Rutland Date: Tue May 30 12:03:28 2023 +0100 arm64: module: rework module VA range selection Currently, the modules region is 128M in size, which is a problem for some large modules. Shanker reports [1] that the NVIDIA GPU driver alone can consume 110M of module space in some configurations. We'd like to make the modules region a full 2G such that we can always make use of a 2G range. It's possible to build kernel images which are larger than 128M in some configurations, such as when many debug options are selected and many drivers are built in. In these configurations, we can't legitimately select a base for a 128M module region, though we currently select a value for which allocation will fail. It would be nicer to have a diagnostic message in this case. Similarly, in theory it's possible to build a kernel image which is larger than 2G and which cannot support modules. While this isn't likely to be the case for any realistic kernel deplyed in the field, it would be nice if we could print a diagnostic in this case. This patch reworks the module VA range selection to use a 2G range, and improves handling of cases where we cannot select legitimate module regions. We now attempt to select a 128M region and a 2G region: * The 128M region is selected such that modules can use direct branches (with JUMP26/CALL26 relocations) to branch to kernel code and other modules, and so that modules can reference data and text (using PREL32 relocations) anywhere in the kernel image and other modules. This region covers the entire kernel image (rather than just the text) to ensure that all PREL32 relocations are in range even when the kernel data section is absurdly large. Where we cannot allocate from this region, we'll fall back to the full 2G region. * The 2G region is selected such that modules can use direct branches with PLTs to branch to kernel code and other modules, and so that modules can use reference data and text (with PREL32 relocations) in the kernel image and other modules. This region covers the entire kernel image, and the 128M region (if one is selected). The two module regions are randomized independently while ensuring the constraints described above. [1] https://lore.kernel.org/linux-arm-kernel/159ceeab-09af-3174-5058-445bc8dcf85b@nvidia.com/ Signed-off-by: Mark Rutland Reviewed-by: Ard Biesheuvel Cc: Shanker Donthineni Cc: Will Deacon Tested-by: Shanker Donthineni Link: https://lore.kernel.org/r/20230530110328.2213762-7-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit ea3752ba9685b47db4571ddaee39344cf2b0bf45 Author: Mark Rutland Date: Tue May 30 12:03:27 2023 +0100 arm64: module: mandate MODULE_PLTS Contemporary kernels and modules can be relatively large, especially when common debug options are enabled. Using GCC 12.1.0, a v6.3-rc7 defconfig kernel is ~38M, and with PROVE_LOCKING + KASAN_INLINE enabled this expands to ~117M. Shanker reports [1] that the NVIDIA GPU driver alone can consume 110M of module space in some configurations. Both KASLR and ARM64_ERRATUM_843419 select MODULE_PLTS, so anyone wanting a kernel to have KASLR or run on Cortex-A53 will have MODULE_PLTS selected. This is the case in defconfig and distribution kernels (e.g. Debian, Android, etc). Practically speaking, this means we're very likely to need MODULE_PLTS and while it's almost guaranteed that MODULE_PLTS will be selected, it is possible to disable support, and we have to maintain some awkward special cases for such unusual configurations. This patch removes the MODULE_PLTS config option, with the support code always enabled if MODULES is selected. This results in a slight simplification, and will allow for further improvement in subsequent patches. For any config which currently selects MODULE_PLTS, there will be no functional change as a result of this patch. [1] https://lore.kernel.org/linux-arm-kernel/159ceeab-09af-3174-5058-445bc8dcf85b@nvidia.com/ Signed-off-by: Mark Rutland Reviewed-by: Ard Biesheuvel Cc: Shanker Donthineni Cc: Will Deacon Tested-by: Shanker Donthineni Link: https://lore.kernel.org/r/20230530110328.2213762-6-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit e46b7103aef39c3f421f0bff7a10ae5a29cd5cee Author: Mark Rutland Date: Tue May 30 12:03:26 2023 +0100 arm64: module: move module randomization to module.c When CONFIG_RANDOMIZE_BASE=y, module_alloc_base is a variable which is configured by kaslr_module_init() in kaslr.c, and otherwise it is an expression defined in module.h. As kaslr_module_init() is no longer tightly coupled with the KASLR initialization code, we can centralize this in module.c. This patch moves kaslr_module_init() to module.c, making module_alloc_base a static variable, and removing redundant includes from kaslr.c. For the defintion of struct arm64_ftr_override we must include , which was previously included transitively via another header. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Ard Biesheuvel Cc: Will Deacon Tested-by: Shanker Donthineni Link: https://lore.kernel.org/r/20230530110328.2213762-5-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 6e13b6b923b35a965d128a40ef0c5d9dd101e603 Author: Mark Rutland Date: Tue May 30 12:03:25 2023 +0100 arm64: kaslr: split kaslr/module initialization Currently kaslr_init() handles a mixture of detecting/announcing whether KASLR is enabled, and randomizing the module region depending on whether KASLR is enabled. To make it easier to rework the module region initialization, split the KASLR initialization into two steps: * kaslr_init() determines whether KASLR should be enabled, and announces this choice, recording this to a new global boolean variable. This is called from setup_arch() just before the existing call to kaslr_requires_kpti() so that this will always provide the expected result. * kaslr_module_init() randomizes the module region when required. This is called as a subsys_initcall, where we previously called kaslr_init(). As a bonus, moving the KASLR reporting earlier makes it easier to spot and permits it to be logged via earlycon, making it easier to debug any issues that could be triggered by KASLR. Booting a v6.4-rc1 kernel with this patch applied, the log looks like: | EFI stub: Booting Linux Kernel... | EFI stub: Generating empty DTB | EFI stub: Exiting boot services... | [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x000f0510] | [ 0.000000] Linux version 6.4.0-rc1-00006-g4763a8f8aeb3 (mark@lakrids) (aarch64-linux-gcc (GCC) 12.1.0, GNU ld (GNU Binutils) 2.38) #2 SMP PREEMPT Tue May 9 11:03:37 BST 2023 | [ 0.000000] KASLR enabled | [ 0.000000] earlycon: pl11 at MMIO 0x0000000009000000 (options '') | [ 0.000000] printk: bootconsole [pl11] enabled Signed-off-by: Mark Rutland Reviewed-by: Ard Biesheuvel Cc: Will Deacon Tested-by: Shanker Donthineni Link: https://lore.kernel.org/r/20230530110328.2213762-4-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 55123afffe931ab02066f60084c9c495b9b52fda Author: Mark Rutland Date: Tue May 30 12:03:24 2023 +0100 arm64: kasan: remove !KASAN_VMALLOC remnants Historically, KASAN could be selected with or without KASAN_VMALLOC, but since commit: f6f37d9320a11e90 ("arm64: select KASAN_VMALLOC for SW/HW_TAGS modes") ... we can never select KASAN without KASAN_VMALLOC on arm64, and thus arm64 code for KASAN && !KASAN_VMALLOC is redundant and can be removed. Remove the redundant code kasan_init.c Signed-off-by: Mark Rutland Reviewed-by: Alexander Potapenko Reviewed-by: Ard Biesheuvel Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Will Deacon Tested-by: Shanker Donthineni Link: https://lore.kernel.org/r/20230530110328.2213762-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 8339f7d8e178d9c933f437d14be0a5fd1359f53d Author: Mark Rutland Date: Tue May 30 12:03:23 2023 +0100 arm64: module: remove old !KASAN_VMALLOC logic Historically, KASAN could be selected with or without KASAN_VMALLOC, and we had to be very careful where to place modules when KASAN_VMALLOC was not selected. However, since commit: f6f37d9320a11e90 ("arm64: select KASAN_VMALLOC for SW/HW_TAGS modes") Selecting CONFIG_KASAN on arm64 will also select CONFIG_KASAN_VMALLOC, and so the logic for handling CONFIG_KASAN without CONFIG_KASAN_VMALLOC is redundant and can be removed. Note: the "kasan.vmalloc={on,off}" option which only exists for HW_TAGS changes whether the vmalloc region is given non-match-all tags, and does not affect the page table manipulation code. The VM_DEFER_KMEMLEAK flag was only necessary for !CONFIG_KASAN_VMALLOC as described in its introduction in commit: 60115fa54ad7b913 ("mm: defer kmemleak object creation of module_alloc()") ... and therefore it can also be removed. Remove the redundant logic for !CONFIG_KASAN_VMALLOC. At the same time, add the missing braces around the multi-line conditional block in arch/arm64/kernel/module.c. Suggested-by: Ard Biesheuvel Signed-off-by: Mark Rutland Reviewed-by: Ard Biesheuvel Cc: Alexander Potapenko Cc: Andrew Morton Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Will Deacon Tested-by: Shanker Donthineni Link: https://lore.kernel.org/r/20230530110328.2213762-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit ab1e29acdb33c971e1af8ed8ec427bd1deff5f32 Author: Eric Chan Date: Wed May 31 09:09:09 2023 +0000 arm64: lockdep: enable checks for held locks when returning to userspace Currently arm64 doesn't use CONFIG_GENERIC_ENTRY and doesn't call lockdep_sys_exit() when returning to userspace. This means that lockdep won't check for held locks when returning to userspace, which would be useful to detect kernel bugs. Call lockdep_sys_exit() when returning to userspace, enabling checking for held locks. At the same time, rename arm64's prepare_exit_to_user_mode() to exit_to_user_mode_prepare() to more clearly align with the naming in the generic entry code. Signed-off-by: Eric Chan Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20230531090909.357047-1-ericchancf@google.com Signed-off-by: Catalin Marinas commit f9da18cd4616fbc9816347b7b2be188653786058 Author: Bob Peterson Date: Thu May 4 14:28:51 2023 -0400 gfs2: Don't remember delete unless it's successful This patch changes function evict_unlinked_inode so it does not call gfs2_inode_remember_delete until it gets a good return code from gfs2_dinode_dealloc. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 17a5934653826644ba8c1ad21b9fc8d6e7e62f34 Author: Bob Peterson Date: Thu May 4 14:27:42 2023 -0400 gfs2: Update rl_unlinked before releasing rgrp lock Function gfs2_free_di was changing the rgrp lvb count of unlinked dinodes after the lock was released. This patch moves it inside the lock. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit dac0fc31bea78e3ac1467d2fdb49ffff37e95e84 Author: Bob Peterson Date: Mon May 15 11:37:57 2023 -0500 gfs2: Fix gfs2_qa_get imbalance in gfs2_quota_hold This patch fixes a case in which function gfs2_quota_hold encounters an assert error and exits. The lack of gfs2_qa_put causes further problems when the inode is evicted and the get/put count is non-zero. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 9b620429eca9a1dbadf6cf983b11d2cb427411ce Author: Bob Peterson Date: Thu May 4 13:43:22 2023 -0400 gfs2: ignore rindex_update failure in dinode_dealloc Before this patch, function gfs2_dinode_dealloc would abort if it got a bad return code from gfs2_rindex_update(). The problem is that it left the dinode in the unlinked (not free) state, which meant subsequent fsck would clean it up and flag an error. That meant some of our QE tests would fail. The sole purpose of gfs2_rindex_update(), in this code path, is to read in any newer rgrps added by gfs2_grow. But since this is a delete operation it won't actually use any of those new rgrps. It can really only twiddle the bits from "Unlinked" to "Free" in an existing rgrp. Therefore the error should not prevent the transition from unlinked to free. This patch makes gfs2_dinode_dealloc ignore the bad return code and proceed with freeing the dinode so the QE tests will not be tripped up. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit e4f82bf21f2586aa823fd40de72023236062a4aa Author: Bob Peterson Date: Wed Apr 26 10:46:16 2023 -0400 gfs2: fix minor comment typos Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit a9b0f6f4adb1a8b4219e3e14ab6ef46c14987ac0 Author: Bob Peterson Date: Tue Apr 25 12:26:19 2023 -0400 gfs2: simplify gdlm_put_lock with out_free label This patch introduces a new out_free label and consolidates the three places function gdlm_put_lock freed the glock. No change in functionality. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 2a6d4af5f157b1540e7a49f7fdbbf517b0d0d5b7 Author: Lucas Tanure Date: Mon May 29 19:05:32 2023 +0200 arm64: dts: rockchip: Add SD card support to rock-5b Add sdmmc support for Rock Pi 5B board. Signed-off-by: Lucas Tanure Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230529170532.59804-2-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit db242e8240b5dc8bd3709dceb194bd49cd3aac2e Author: Sebastian Reichel Date: Mon May 29 19:05:31 2023 +0200 arm64: dts: rockchip: add PMIC to rock-5b This adds PMIC support for the Radxa ROCK 5B Signed-off-by: shengfei Xu Co-developed-by: shengfei Xu Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230529170532.59804-1-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit c0461bd16666351f0de11578b1e02dcdae4db736 Author: Dionna Glaze Date: Tue Jun 6 09:51:27 2023 -0500 x86/efi: Safely enable unaccepted memory in UEFI The UEFI v2.9 specification includes a new memory type to be used in environments where the OS must accept memory that is provided from its host. Before the introduction of this memory type, all memory was accepted eagerly in the firmware. In order for the firmware to safely stop accepting memory on the OS's behalf, the OS must affirmatively indicate support to the firmware. This is only a problem for AMD SEV-SNP, since Linux has had support for it since 5.19. The other technology that can make use of unaccepted memory, Intel TDX, does not yet have Linux support, so it can strictly require unaccepted memory support as a dependency of CONFIG_TDX and not require communication with the firmware. Enabling unaccepted memory requires calling a 0-argument enablement protocol before ExitBootServices. This call is only made if the kernel is compiled with UNACCEPTED_MEMORY=y This protocol will be removed after the end of life of the first LTS that includes it, in order to give firmware implementations an expiration date for it. When the protocol is removed, firmware will strictly infer that a SEV-SNP VM is running an OS that supports the unaccepted memory type. At the earliest convenience, when unaccepted memory support is added to Linux, SEV-SNP may take strict dependence in it. After the firmware removes support for the protocol, this should be reverted. [tl: address some checkscript warnings] Signed-off-by: Dionna Glaze Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/0d5f3d9a20b5cf361945b7ab1263c36586a78a42.1686063086.git.thomas.lendacky@amd.com commit 28ee08cef4f838c343013330a3cd12674c4dd113 Author: Cristian Ciocaltea Date: Tue May 30 21:11:40 2023 +0300 arm64: dts: rockchip: Assign ES8316 MCLK rate on rk3588-rock-5b The I2S0_8CH_MCLKOUT clock rate on Rock 5B board defaults to 12 MHz and it is used to provide the master clock (MCLK) for the ES8316 audio codec. On sound card initialization, this limits the allowed sample rates according to the MCLK/LRCK ratios supported by the codec, which results in the following non-standard rates: 15625, 30000, 31250, 46875. Hence, the very first access of the sound card fails: Broken configuration for playback: no configurations available: Invalid argument Setting of hwparams failed: Invalid argument However, all subsequent attempts will succeed, as the audio graph card will request a correct clock frequency, based on the stream sample rate and the multiplication factor. Assign MCLK to 12.288 MHz, which allows the codec to advertise most of the standard sample rates. Fixes: 55529fe3f32d ("arm64: dts: rockchip: Add rk3588-rock-5b analog audio") Signed-off-by: Cristian Ciocaltea Link: https://lore.kernel.org/r/20230530181140.483936-4-cristian.ciocaltea@collabora.com Signed-off-by: Heiko Stuebner commit 6c3211796326a9d35618b866826ca556c8f008a8 Author: Tom Lendacky Date: Tue Jun 6 09:51:26 2023 -0500 x86/sev: Add SNP-specific unaccepted memory support Add SNP-specific hooks to the unaccepted memory support in the boot path (__accept_memory()) and the core kernel (accept_memory()) in order to support booting SNP guests when unaccepted memory is present. Without this support, SNP guests will fail to boot and/or panic() when unaccepted memory is present in the EFI memory map. The process of accepting memory under SNP involves invoking the hypervisor to perform a page state change for the page to private memory and then issuing a PVALIDATE instruction to accept the page. Since the boot path and the core kernel paths perform similar operations, move the pvalidate_pages() and vmgexit_psc() functions into sev-shared.c to avoid code duplication. Create the new header file arch/x86/boot/compressed/sev.h because adding the function declaration to any of the existing SEV related header files pulls in too many other header files, causing the build to fail. Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/a52fa69f460fd1876d70074b20ad68210dfc31dd.1686063086.git.thomas.lendacky@amd.com commit 3900160e164bcba23a111a3ba80f06aff7764c34 Author: Chris Morgan Date: Wed May 31 11:12:20 2023 -0500 arm64: dts: rockchip: Add Indiedroid Nova board The Indiedroid Nova is an SBC from a sub-brand of Ameridroid that includes the following hardware: - A 40-pin GPIO header - 2 USB-A 3.0 ports - 2 USB-A 2.0 ports - A USB-C 2.0 OTG port (used for USB power delivery) - A USB-C 3.0 port that can do display port output. - A Micro HDMI 2.1 port. - A 1GB ethernet port. - An RT8821CS based WiFi/Bluetooth module. - A user replaceable eMMC module. - An SDMMC card slot. - A MIPI DSI connector. - A MIPI CSI connector. - A 3.5mm TRRS audio jack with microphone input. - An 2 pin socket for an RTC battery. - A 4 pin socket for a debug port. - A power button (connected to PMIC), a reset button (connected to SoC reset), a boot button, and a recovery button (both connected to the ADC). - 4GB, 8GB, or 16GB of system RAM. This initial devicetree includes support for the WiFi, bluetooth, analog audio out/in, SDMMC, eMMC, RTC, UART debugging, and has the regulator values from the schematics. ADC, graphics output, GPU, USB, and wired ethernet are still pending additional upstream changes. Analog audio will require changes to handle a difference between the requested clock frequency of 12288000 and the actual clock freqency of 12287999 before it will work properly. This will be done in a subsequent patch series. Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20230531161220.280744-6-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 81154abafbe88ca7a723e34d67748a6a514ac882 Author: Chris Morgan Date: Wed May 31 11:12:19 2023 -0500 dt-bindings: arm: rockchip: Add Indiedroid Nova Add Indiedroid Nova, an rk3588s based single board computer. Signed-off-by: Chris Morgan Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230531161220.280744-5-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit e78a863151ede8725fcb360c627e90f76fa584f3 Author: Chris Morgan Date: Wed May 31 11:12:18 2023 -0500 dt-bindings: vendor-prefixes: add Indiedroid Indiedroid is a sub-brand of Ameridroid for their line of single board computers. https://indiedroid.us/ Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230531161220.280744-4-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 725c47d78ddefd04a94391fafa5f99414c7f88db Author: Chris Morgan Date: Wed May 31 11:12:17 2023 -0500 arm64: dts: rockchip: Add sdio node to rk3588 Add SDIO node for rk3588/rk3588s. Signed-off-by: Chris Morgan Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230531161220.280744-3-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 47ecb3905715a73b336103cc8d225877ab50143e Author: Chris Morgan Date: Wed May 31 11:12:16 2023 -0500 arm64: dts: rockchip: add default pinctrl for rk3588 emmc Add a default pinctrl definition for the rk3588 emmc. Signed-off-by: Chris Morgan Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230531161220.280744-2-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 15d9088779b8693cffe47527ea4f9ff8fde4cd03 Author: Tom Lendacky Date: Tue Jun 6 09:51:25 2023 -0500 x86/sev: Use large PSC requests if applicable In advance of providing support for unaccepted memory, request 2M Page State Change (PSC) requests when the address range allows for it. By using a 2M page size, more PSC operations can be handled in a single request to the hypervisor. The hypervisor will determine if it can accommodate the larger request by checking the mapping in the nested page table. If mapped as a large page, then the 2M page request can be performed, otherwise the 2M page request will be broken down into 512 4K page requests. This is still more efficient than having the guest perform multiple PSC requests in order to process the 512 4K pages. In conjunction with the 2M PSC requests, attempt to perform the associated PVALIDATE instruction of the page using the 2M page size. If PVALIDATE fails with a size mismatch, then fallback to validating 512 4K pages. To do this, page validation is modified to work with the PSC structure and not just a virtual address range. Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/050d17b460dfc237b51d72082e5df4498d3513cb.1686063086.git.thomas.lendacky@amd.com commit 7006b75592feb1902563ac1decfd98d7e4a0dd6c Author: Tom Lendacky Date: Tue Jun 6 09:51:24 2023 -0500 x86/sev: Allow for use of the early boot GHCB for PSC requests Using a GHCB for a page stage change (as opposed to the MSR protocol) allows for multiple pages to be processed in a single request. In prep for early PSC requests in support of unaccepted memory, update the invocation of vmgexit_psc() to be able to use the early boot GHCB and not just the per-CPU GHCB structure. In order to use the proper GHCB (early boot vs per-CPU), set a flag that indicates when the per-CPU GHCBs are available and registered. For APs, the per-CPU GHCBs are created before they are started and registered upon startup, so this flag can be used globally for the BSP and APs instead of creating a per-CPU flag. This will allow for a significant reduction in the number of MSR protocol page state change requests when accepting memory. Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/d6cbb21f87f81eb8282dd3bf6c34d9698c8a4bbc.1686063086.git.thomas.lendacky@amd.com commit 69dcb1e3bbbe7fe092ea7af70e295e43ab0c7bc7 Author: Tom Lendacky Date: Tue Jun 6 09:51:23 2023 -0500 x86/sev: Put PSC struct on the stack in prep for unaccepted memory support In advance of providing support for unaccepted memory, switch from using kmalloc() for allocating the Page State Change (PSC) structure to using a local variable that lives on the stack. This is needed to avoid a possible recursive call into set_pages_state() if the kmalloc() call requires (more) memory to be accepted, which would result in a hang. The current size of the PSC struct is 2,032 bytes. To make the struct more stack friendly, reduce the number of PSC entries from 253 down to 64, resulting in a size of 520 bytes. This is a nice compromise on struct size and total PSC requests while still allowing parallel PSC operations across vCPUs. If the reduction in PSC entries results in any kind of performance issue (that is not seen at the moment), use of a larger static PSC struct, with fallback to the smaller stack version, can be investigated. For more background info on this decision, see the subthread in the Link: tag below. Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/lkml/658c455c40e8950cb046dd885dd19dc1c52d060a.1659103274.git.thomas.lendacky@amd.com commit 5dee19b6b2b194216919b99a1f5af2949a754016 Author: Tom Lendacky Date: Tue Jun 6 09:51:22 2023 -0500 x86/sev: Fix calculation of end address based on number of pages When calculating an end address based on an unsigned int number of pages, any value greater than or equal to 0x100000 that is shift PAGE_SHIFT bits results in a 0 value, resulting in an invalid end address. Change the number of pages variable in various routines from an unsigned int to an unsigned long to calculate the end address correctly. Fixes: 5e5ccff60a29 ("x86/sev: Add helper for validating pages in early enc attribute changes") Fixes: dc3f3d2474b8 ("x86/mm: Validate memory when changing the C-bit") Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/6a6e4eea0e1414402bac747744984fa4e9c01bb6.1686063086.git.thomas.lendacky@amd.com commit 75d090fd167acab4d7eda7e2b65729e877c0fd64 Author: Kirill A. Shutemov Date: Tue Jun 6 17:26:37 2023 +0300 x86/tdx: Add unaccepted memory support Hookup TDX-specific code to accept memory. Accepting the memory is done with ACCEPT_PAGE module call on every page in the range. MAP_GPA hypercall is not required as the unaccepted memory is considered private already. Extract the part of tdx_enc_status_changed() that does memory acceptance in a new helper. Move the helper tdx-shared.c. It is going to be used by both main kernel and decompressor. [ bp: Fix the INTEL_TDX_GUEST=y, KVM_GUEST=n build. ] Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230606142637.5171-10-kirill.shutemov@linux.intel.com commit 419491eaf1ee90b83c260c32b6c29b1d96c15ce8 Author: Matt Atwood Date: Fri Jun 2 16:17:54 2023 -0700 drm/i915: rename I915_PMU_MAX_GTS to I915_PMU_MAX_GT _GTS as an abbreviation here leads to some confusion, match other definitions and drop the s. Cc: Matt Roper Cc: Ashutosh Dixit Cc: Andi Shyti Cc: Tvrtko Ursulin Cc: Umesh Nerlige Ramappa Signed-off-by: Matt Atwood Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230602231754.1596433-3-matthew.s.atwood@intel.com commit cd65de1ab2fe4b99ec20861182b7c24d26559f48 Author: Matt Atwood Date: Fri Jun 2 16:17:53 2023 -0700 drm/i915: Reduce I915_MAX_GT to 2 According to Ashutosh there is no current or planned product in i915 for I915_MAX_GT to be 4 anymore. Cc: Matt Roper Cc: Ashutosh Dixit Cc: Andi Shyti Cc: Tvrtko Ursulin Cc: Umesh Nerlige Ramappa Signed-off-by: Matt Atwood Reviewed-by: Matt Roper Reviewed-by: Ashutosh Dixit Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230602231754.1596433-2-matthew.s.atwood@intel.com commit 56b77ba112d48becc3e41c9fe2b1533ba220b7c3 Author: Prathu Baronia Date: Sat May 27 18:08:58 2023 +0530 arm64/cpucaps: increase string width to properly format cpucaps.h The lengthiest capability is `WORKAROUND_TRBE_OVERWRITE_FILL_MODE` and its length is 35 characters so increase the width of left justified strings to 40 and adjust the tab space for `ARM64_NCAPS` accordingly. Now the generated cpucaps.h is properly formatted. Signed-off-by: Prathu Baronia Link: https://lore.kernel.org/r/20230527123900.680520-1-quic_pbaronia@quicinc.com Signed-off-by: Catalin Marinas commit ea85370df14011255c60e1951ef4ef749806aa5c Author: Sebastian Reichel Date: Mon May 22 19:34:18 2023 +0200 dt-bindings: soc: rockchip: add rk3588 pipe-phy syscon The pipe-phy syscon is used by rockchip,rk3588-naneng-combphy, which in turn is the PHY for USB3, PCIe and SATA. Acked-by: Rob Herring Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230522173423.64691-2-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 02f1b0b736606f9870595b3089d9c124f9da8be9 Author: Chao Gao Date: Wed May 24 14:16:32 2023 +0800 KVM: x86: Correct the name for skipping VMENTER l1d flush There is no VMENTER_L1D_FLUSH_NESTED_VM. It should be ARCH_CAP_SKIP_VMENTRY_L1DFLUSH. Signed-off-by: Chao Gao Reviewed-by: Xiaoyao Li Link: https://lore.kernel.org/r/20230524061634.54141-3-chao.gao@intel.com Signed-off-by: Sean Christopherson commit ec084cbddbbe3a778ee06ccc0c59cee23b5cbaf4 Author: Shreeya Patel Date: Sun Jun 4 00:23:39 2023 +0530 arm64: dts: rockchip: Add DT node for ADC support in RK3588 Add DT node for ADC support in RK3588. Signed-off-by: Shreeya Patel Link: https://lore.kernel.org/r/20230603185340.13838-8-shreeya.patel@collabora.com Signed-off-by: Heiko Stuebner commit 1c943f60e830d0b959c765df09d4c4b254de0481 Author: Kuninori Morimoto Date: Thu Jun 1 00:42:49 2023 +0000 ASoC: add snd_soc_get_stream_cpu() We are using get_stream_cpu() to get CPU stream which cares Codec2Codec. But it is static function for now, and we want to use it from other files. This patch makes it global function. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87fs7cj9mf.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b9aa53fbee1e55abfcdfcc081c242de3c0582be4 Author: Kuninori Morimoto Date: Thu Jun 1 00:43:02 2023 +0000 ASoC: soc.h: remove snd_soc_compr_ops :: trigger ASoC framework is not using trigger call-back for snd_soc_compr_ops. This patch remove it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87edmwj9m1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5f0419a0083b304566fa32c27a0f009634a7f703 Author: Joey Gouly Date: Tue Jun 6 15:58:59 2023 +0100 KVM: selftests: get-reg-list: add Permission Indirection registers Add new system registers: - ID_AA64MMFR3_EL1 - TCR2_EL1 - PIRE0_EL1 - PIR_EL1 Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: Mark Brown Cc: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-21-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit ee053e03b08e1b287d9a43152e4623a04cb24fe6 Author: Joey Gouly Date: Tue Jun 6 15:58:58 2023 +0100 KVM: selftests: get-reg-list: support ID register features This stops the test complaining about missing registers, when running on an older kernel that does not support newer features. Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: Mark Brown Cc: Shuah Khan Link: https://lore.kernel.org/r/20230606145859.697944-20-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 6c792b7d3c2c901cdd76b760d6676510e83c778d Author: Joey Gouly Date: Tue Jun 6 15:58:57 2023 +0100 arm64: Document boot requirements for PIE Features PIE and TCR2 introduce new registers, update the trap requirements for these features. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-19-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 6b776d385562f5d8fd7f90406f0ef47d1e352fa7 Author: Joey Gouly Date: Tue Jun 6 15:58:56 2023 +0100 arm64: transfer permission indirection settings to EL2 Copy the EL1 registers: TCR2_EL1, PIR_EL1, PIRE0_EL1, such that PIE is also enabled for EL2. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Marc Zyngier Cc: Oliver Upton Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-18-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 9e9bb6ede00a84275b65bb8d00812c1e24b5fa7e Author: Joey Gouly Date: Tue Jun 6 15:58:55 2023 +0100 arm64: enable Permission Indirection Extension (PIE) Now that the necessary changes have been made, set the Permission Indirection registers and enable the Permission Indirection Extension. Signed-off-by: Joey Gouly Cc: Will Deacon Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-17-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit eeda243dfeb996fe236c624796630c16237a18d6 Author: Joey Gouly Date: Tue Jun 6 15:58:54 2023 +0100 arm64: add encodings of PIRx_ELx registers The encodings used in the permission indirection registers means that the values that Linux puts in the PTEs do not need to be changed. The E0 values are replicated in E1, with the execute permissions removed. This is needed as the futex operations access user mappings with privileged loads/stores. Signed-off-by: Joey Gouly Cc: Will Deacon Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-16-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 7df7170965a28c61f80a57b655b0cc10adb88ab9 Author: Joey Gouly Date: Tue Jun 6 15:58:53 2023 +0100 arm64: disable EL2 traps for PIE Disable trapping of TCR2_EL1 and PIRx_EL1 registers, so they can be accessed from by EL1. Signed-off-by: Joey Gouly Cc: Will Deacon Reviewed-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-15-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit fa4cdccaa58224a12591f2c045c24abc5251bb9d Author: Joey Gouly Date: Tue Jun 6 15:58:52 2023 +0100 arm64: reorganise PAGE_/PROT_ macros Make these macros available to assembly code, so they can be re-used by the PIE initialisation code. This involves adding some extra macros, prepended with _ that are the raw values not `pgprot` values. A dummy value for PTE_MAYBE_NG is also provided, for use in assembly. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Mark Rutland Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-14-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 7c302cfbee1f6cc23d831be4b6cf42f331019e68 Author: Joey Gouly Date: Tue Jun 6 15:58:51 2023 +0100 arm64: add PTE_WRITE to PROT_SECT_NORMAL With PIE enabled, PROT_SECT_NORMAL would map onto PAGE_KERNEL_RO. Add PTE_WRITE so that this maps onto PAGE_KERNEL, so that it is writable. Without PIE, this should enable DBM for PROT_SECT_NORMAL. However PTE_RDONLY is already cleared, so the DBM mechanism is not used, and it is always writable, so this is functionally equivalent. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Mark Rutland Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-13-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit f0af339fc408a55c9f48f5d9ca47059ef1eb36b8 Author: Joey Gouly Date: Tue Jun 6 15:58:50 2023 +0100 arm64: add PTE_UXN/PTE_WRITE to SWAPPER_*_FLAGS With PIE enabled, the swapper PTEs would have a Permission Indirection Index (PIIndex) of 0. A PIIndex of 0 is not currently used by any other PTEs. To avoid using index 0 specifically for the swapper PTEs, mark them as PTE_UXN and PTE_WRITE, so that they map to a PAGE_KERNEL_EXEC equivalent. This also adds PTE_WRITE to KPTI_NG_PTE_FLAGS, which was tested by booting with kpti=on. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Mark Rutland Link: https://lore.kernel.org/r/20230606145859.697944-12-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 8ef67c67e637809a28f0efeb045aa454c7799a51 Author: Joey Gouly Date: Tue Jun 6 15:58:49 2023 +0100 KVM: arm64: expose ID_AA64MMFR3_EL1 to guests Now that KVM context switches the appropriate registers, expose ID_AA64MMFR3_EL1 to guests to allow them to use the new features. Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: James Morse Cc: Suzuki K Poulose Cc: Zenghui Yu Cc: Will Deacon Acked-by: Catalin Marinas Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230606145859.697944-11-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 86f9de9db1783b32e8812fe21c2c8cf02cf911ff Author: Joey Gouly Date: Tue Jun 6 15:58:48 2023 +0100 KVM: arm64: Save/restore PIE registers Define the new system registers that PIE introduces and context switch them. The PIE feature is still hidden from the ID register, and not exposed to a VM. Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: James Morse Cc: Suzuki K Poulose Cc: Zenghui Yu Cc: Will Deacon Reviewed-by: Catalin Marinas Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230606145859.697944-10-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit fbff560682323dc171c89b4821308af47f166a8f Author: Joey Gouly Date: Tue Jun 6 15:58:47 2023 +0100 KVM: arm64: Save/restore TCR2_EL1 Define the new system register TCR2_EL1 and context switch it. Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: James Morse Cc: Suzuki K Poulose Cc: Zenghui Yu Cc: Will Deacon Reviewed-by: Catalin Marinas Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230606145859.697944-9-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit e43454c44232640bdb71a0c9ce49d39e856e5ebb Author: Joey Gouly Date: Tue Jun 6 15:58:46 2023 +0100 arm64: cpufeature: add Permission Indirection Extension cpucap This indicates if the system supports PIE. This is a CPUCAP_BOOT_CPU_FEATURE as the boot CPU will enable PIE if it has it, so secondary CPUs must also have this feature. Signed-off-by: Joey Gouly Cc: Will Deacon Reviewed-by: Catalin Marinas Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20230606145859.697944-8-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 2b760046a2d3d630d42bbe416f5d7f43792a1639 Author: Joey Gouly Date: Tue Jun 6 15:58:45 2023 +0100 arm64: cpufeature: add TCR2 cpucap This capability indicates if the system supports the TCR2_ELx system register. Signed-off-by: Joey Gouly Cc: Will Deacon Reviewed-by: Catalin Marinas Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20230606145859.697944-7-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit edc25898f0b6cceed6c90b0e79916bd04de7dd19 Author: Joey Gouly Date: Tue Jun 6 15:58:44 2023 +0100 arm64: cpufeature: add system register ID_AA64MMFR3 Add new system register ID_AA64MMFR3 to the cpufeature infrastructure. Signed-off-by: Joey Gouly Cc: Will Deacon Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-6-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit c36ad1943f947eb763fb2eb976a5f6f25150113d Author: Joey Gouly Date: Tue Jun 6 15:58:43 2023 +0100 arm64/sysreg: add PIR*_ELx registers Add definitions of PIR_EL1, PIR_EL12, PIRE0_EL1, PIRE0_EL12, and PIR_EL2 registers. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-5-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 25bc6f32cd716fcc14d4b31f4451cb7044da3053 Author: Joey Gouly Date: Tue Jun 6 15:58:42 2023 +0100 arm64/sysreg: update HCRX_EL2 register Update the HCRX_EL2 register with new bit definitions. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-4-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 89b6c3ee498859166be6b0f4d6672b51e478b887 Author: Joey Gouly Date: Tue Jun 6 15:58:41 2023 +0100 arm64/sysreg: add system registers TCR2_ELx Add definitions of TCR2_EL1, TCR2_EL12 and TCR_EL2 registers. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-3-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 00ac84677d8742022e0a15a6b1ffecfa3739f664 Author: Joey Gouly Date: Tue Jun 6 15:58:40 2023 +0100 arm64/sysreg: Add ID register ID_AA64MMFR3 Add the new ID register ID_AA64MMFR3, according to DDI0601 2023-03. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20230606145859.697944-2-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit ba65c79fbb813423e7d42d99375e2045b27958a6 Author: Geert Uytterhoeven Date: Tue Jun 6 12:01:40 2023 +0200 dt-bindings: gpio: gpio-delay: Spelling s/curcuit/circuit/ Fix misspellings of "circuit". Fixes: c7239a3da1628767 ("dt-bindings: gpio: Add gpio-delay binding document") Signed-off-by: Geert Uytterhoeven Acked-by: Alexander Stein Acked-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit 59960e67b9aae666655c42cf1df9eb58bf82c77f Merge: c7e076de2d511 a0503817c0be5 Author: Mark Brown Date: Tue Jun 6 16:41:59 2023 +0100 ASoC: Intel: machine driver updates for 6.5 Merge series from Pierre-Louis Bossart : An unusually large set of patches to deal with new SoundWire-based platforms. The bulk of the patches addresses support for MTL using RT712, RT713, MAX98363, CS42L42 jack codec and amplifiers. The sof_sdw machine driver had to be updated to remove limitations on number of codecs per links, dai types, dai naming, etc. We also moved parts of the Realtek and Maxim support in common code to avoid duplication. Community users also reported two Dell SKUs which were not supported in the mainline due to hardware permutations. commit c5c3f746c9baf9927c3358fdf7c152638d5a2ffb Merge: 33f0ceca111f2 445d5be64be82 Author: Arnd Bergmann Date: Tue Jun 6 17:40:00 2023 +0200 Merge tag 'omap-for-v6.5/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/dt Devicetree changes for omaps for v6.5 A non-urgent fix for gpmc,wait-pin property for am335x-myirtech-myc, and initial support for Epson Moverio BT-200 AR glasses. * tag 'omap-for-v6.5/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: omap4: add initial support for Epson Moverio BT-200 ARM: dts: am335x-myirtech: Add missing NAND wait pin definition Link: https://lore.kernel.org/r/pull-1685700720-242492@atomide.com-3 Signed-off-by: Arnd Bergmann commit c2b353ae24d6fecddcc599529ad8319282494781 Author: Kirill A. Shutemov Date: Tue Jun 6 17:26:36 2023 +0300 x86/tdx: Refactor try_accept_one() Rework try_accept_one() to return accepted size instead of modifying 'start' inside the helper. It makes 'start' in-only argument and streamlines code on the caller side. Suggested-by: Borislav Petkov Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Dave Hansen Link: https://lore.kernel.org/r/20230606142637.5171-9-kirill.shutemov@linux.intel.com commit 33f0ceca111f2a97cdf954d8eeb6c37915990db0 Merge: 4d1010ff173e3 6a988251c4e53 Author: Arnd Bergmann Date: Tue Jun 6 17:33:48 2023 +0200 Merge tag 'samsung-dt-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/dt Samsung DTS ARM changes for v6.5 1. Final cleanups and improvements as a result of dtbs_checks which rely on previously merged driver changes thus affecting older or out-of-tree kernels. The changes are necessary to achieve full dtbs_check compliance, which justifies affecting out-of-tree users. Changes affecting them are: - Drop simple-bus compatible from FIMC: Exynos4 and S5PV210, - Remove empty camera pinctrl configuration: Exynos4 and S5PV210, - Re-order MFC clock names to match Exynos and bindings: S5PV210. 2. Except above few more non-intrusive cleanups for dtbs_check for S5PV210. Fix also some typos. 3. Re-introduce Exynos4212 which was removed because of lack of upstream users. Artur Weber adds now Samsung Galaxy Tab3 with Exynos4212. * tag 'samsung-dt-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: s5pv210: Fix typo in comments, fix pinctrl header ARM: dts: s3c64xx: Fix some typos in comments ARM: dts: exynos: Fix some typos in comments dt-bindings: arm: samsung: Add Samsung Galaxy Tab3 family boards ARM: dts: exynos: Re-introduce Exynos4212 DTSI ARM: dts: exynos: Move common Exynos4x12 definitions to exynos4x12.dtsi ARM: dts: s5pv210: remove empty camera pinctrl configuration ARM: dts: s5pv210: add dummy 5V regulator for backlight on SMDKv210 ARM: dts: s5pv210: re-order MFC clock names to match Exynos and bindings ARM: dts: s5pv210: align USB node name with bindings ARM: dts: s5pv210: align pin configuration nodes with bindings ARM: dts: exynos: Remove empty camera pinctrl configuration in Odroid X/U3 ARM: dts: exynos: Remove empty camera pinctrl configuration in Universal C210 ARM: dts: exynos: Remove empty camera pinctrl configuration in Trats ARM: dts: s5pv210: drop simple-bus from FIMC ARM: dts: exynos: drop simple-bus from FIMC in Exynos4 Link: https://lore.kernel.org/r/20230602091501.15178-2-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 4d1010ff173e3733c4f4d1f1e1feb329b7808feb Merge: 35ee6a4deb82c 4ceb0c70d0dae Author: Arnd Bergmann Date: Tue Jun 6 17:32:01 2023 +0200 Merge tag 'at91-dt-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into soc/dt AT91 DT for 6.5 It contains: - gpio-line-names addition for at91-tse850-3 board - support for SMA connectors on lan966x-pcb8309 board - use drive-open-drain as boolean property as this is how code handles it - generic names for clock controller devices - use of the new clock controller bindings for at91sam9n12 slow clock controller - one blank line removal on sama5d2.dtsi * tag 'at91-dt-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: sama5d2: remove extra line ARM: dts: at91: Return to boolean properties ARM: dts: lan966x: Add support for SMA connectors ARM: dts: at91: use clock-controller name for sckc nodes ARM: dts: at91: at91sam9n12: witch sckc to new clock bindings ARM: dts: at91: use clock-controller name for PMC nodes ARM: dts: at91: tse850: add properties for gpio-line-names Link: https://lore.kernel.org/r/20230530105945.11638-1-claudiu.beznea@microchip.com Signed-off-by: Arnd Bergmann commit ff40b5769a50fab654a70575ff0f49853b799b0e Author: Kirill A. Shutemov Date: Tue Jun 6 17:26:35 2023 +0300 x86/tdx: Make _tdx_hypercall() and __tdx_module_call() available in boot stub Memory acceptance requires a hypercall and one or multiple module calls. Make helpers for the calls available in boot stub. It has to accept memory where kernel image and initrd are placed. Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Dave Hansen Link: https://lore.kernel.org/r/20230606142637.5171-8-kirill.shutemov@linux.intel.com commit c211c19e80d046441655e372c6ae15f29d358259 Author: Kirill A. Shutemov Date: Tue Jun 6 17:26:34 2023 +0300 efi/unaccepted: Avoid load_unaligned_zeropad() stepping into unaccepted memory load_unaligned_zeropad() can lead to unwanted loads across page boundaries. The unwanted loads are typically harmless. But, they might be made to totally unrelated or even unmapped memory. load_unaligned_zeropad() relies on exception fixup (#PF, #GP and now #VE) to recover from these unwanted loads. But, this approach does not work for unaccepted memory. For TDX, a load from unaccepted memory will not lead to a recoverable exception within the guest. The guest will exit to the VMM where the only recourse is to terminate the guest. There are two parts to fix this issue and comprehensively avoid access to unaccepted memory. Together these ensure that an extra "guard" page is accepted in addition to the memory that needs to be used. 1. Implicitly extend the range_contains_unaccepted_memory(start, end) checks up to end+unit_size if 'end' is aligned on a unit_size boundary. 2. Implicitly extend accept_memory(start, end) to end+unit_size if 'end' is aligned on a unit_size boundary. Side note: This leads to something strange. Pages which were accepted at boot, marked by the firmware as accepted and will never _need_ to be accepted might be on unaccepted_pages list This is a cue to ensure that the next page is accepted before 'page' can be used. This is an actual, real-world problem which was discovered during TDX testing. Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Dave Hansen Reviewed-by: Ard Biesheuvel Reviewed-by: Tom Lendacky Link: https://lore.kernel.org/r/20230606142637.5171-7-kirill.shutemov@linux.intel.com commit 2053bc57f36763febced0b5cd91821698bcf6b3d Author: Kirill A. Shutemov Date: Tue Jun 6 17:26:33 2023 +0300 efi: Add unaccepted memory support efi_config_parse_tables() reserves memory that holds unaccepted memory configuration table so it won't be reused by page allocator. Core-mm requires few helpers to support unaccepted memory: - accept_memory() checks the range of addresses against the bitmap and accept memory if needed. - range_contains_unaccepted_memory() checks if anything within the range requires acceptance. Architectural code has to provide efi_get_unaccepted_table() that returns pointer to the unaccepted memory configuration table. arch_accept_memory() handles arch-specific part of memory acceptance. Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Ard Biesheuvel Reviewed-by: Tom Lendacky Link: https://lore.kernel.org/r/20230606142637.5171-6-kirill.shutemov@linux.intel.com commit 3fd1239a783522e7158a1f141fabc7b3b5dc84c6 Author: Kirill A. Shutemov Date: Tue Jun 6 17:26:32 2023 +0300 x86/boot/compressed: Handle unaccepted memory The firmware will pre-accept the memory used to run the stub. But, the stub is responsible for accepting the memory into which it decompresses the main kernel. Accept memory just before decompression starts. The stub is also responsible for choosing a physical address in which to place the decompressed kernel image. The KASLR mechanism will randomize this physical address. Since the accepted memory region is relatively small, KASLR would be quite ineffective if it only used the pre-accepted area (EFI_CONVENTIONAL_MEMORY). Ensure that KASLR randomizes among the entire physical address space by also including EFI_UNACCEPTED_MEMORY. Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Liam Merwick Reviewed-by: Tom Lendacky Link: https://lore.kernel.org/r/20230606142637.5171-5-kirill.shutemov@linux.intel.com commit 35ee6a4deb82c09c6d135b25259a1b173c39112c Merge: c98d589879317 56f0440f27b48 Author: Arnd Bergmann Date: Tue Jun 6 17:16:30 2023 +0200 Merge tag 'ux500-dts-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into soc/dt These are some Ux500 DTS updates for the v6.5 kernel cycle: - Define the SRAM nodes that will be the preferred way to specify SRAM segments to drivers going forward. - Fix up the naming of the STMPE nodes as we are merging proper YAML bindings which puts restrictions on those. - Disable charging on the Ux500 HREF boards because these do not have any real batteries connected. * tag 'ux500-dts-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: dts: ux500: Add eSRAM nodes ARM: dts: ux500: Fix STMPE device nodes ARM: dts: ux500: Disable charging on HREF boards Link: https://lore.kernel.org/r/CACRpkdZ2YLzB-n+1M9u0UqVfct_LAR5cLvYyJhxHsXNR_TFzpQ@mail.gmail.com Signed-off-by: Arnd Bergmann commit 095641817e1bf6aa2560e025e47575188ee3edaf Author: Jesper Dangaard Brouer Date: Tue Jun 6 13:30:47 2023 +0200 selftests/bpf: Fix check_mtu using wrong variable type Dan Carpenter found via Smatch static checker, that unsigned 'mtu_lo' is never less than zero. Variable mtu_lo should have been an 'int', because read_mtu_device_lo() uses minus as error indications. Fixes: b62eba563229 ("selftests/bpf: Tests using bpf_check_mtu BPF-helper") Reported-by: Dan Carpenter Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann Reviewed-by: Simon Horman Link: https://lore.kernel.org/bpf/168605104733.3636467.17945947801753092590.stgit@firesoul commit 425d827ef91ec2c7e5c01332531cd66cdfb1b99f Author: Conor Dooley Date: Tue Jun 6 09:27:43 2023 +0100 Documentation/process: add soc maintainer handbook Arnd suggested that adding a maintainer handbook for the SoC "subsystem" would be helpful in trying to bring on board maintainers for the various new platforms cropping up in RISC-V land. Add a document briefly describing the role of the SoC subsystem and some basic advice for (new) platform maintainers. Suggested-by: Arnd Bergmann Reviewed-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley Signed-off-by: Arnd Bergmann commit aa6182707a53c5e4df7b3da7ba4faa7e29dc71a0 Author: Ruiqi Gong Date: Tue Jun 6 10:10:47 2023 +0800 bpf: Cleanup unused function declaration All usage and the definition of `bpf_prog_free_linfo()` has been removed in commit e16301fbe183 ("bpf: Simplify freeing logic in linfo and jited_linfo"). Clean up its declaration in the header file. Signed-off-by: Ruiqi Gong Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/all/20230602030842.279262-1-gongruiqi@huaweicloud.com/ Link: https://lore.kernel.org/bpf/20230606021047.170667-1-gongruiqi@huaweicloud.com commit 7bac98a338d63efb0b44ce4b79d53838491f00df Author: Abe Kohandel Date: Tue Jun 6 07:54:02 2023 -0700 spi: dt-bindings: snps,dw-apb-ssi: Add compatible for Intel Mount Evans SoC Document the DesignWare SSI controller compatible for Intel Mount Evans Integrated Management Complex SoC. Signed-off-by: Abe Kohandel Link: https://lore.kernel.org/r/20230606145402.474866-3-abe.kohandel@intel.com Signed-off-by: Mark Brown commit 0760d5d0e9f0c0e2200a0323a61d1995bb745dee Author: Abe Kohandel Date: Tue Jun 6 07:54:01 2023 -0700 spi: dw: Add compatible for Intel Mount Evans SoC The Intel Mount Evans SoC's Integrated Management Complex uses the SPI controller for access to a NOR SPI FLASH. However, the SoC doesn't provide a mechanism to override the native chip select signal. This driver doesn't use DMA for memory operations when a chip select override is not provided due to the native chip select timing behavior. As a result no DMA configuration is done for the controller and this configuration is not tested. The controller also has an errata where a full TX FIFO can result in data corruption. The suggested workaround is to never completely fill the FIFO. The TX FIFO has a size of 32 so the fifo_len is set to 31. Signed-off-by: Abe Kohandel Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230606145402.474866-2-abe.kohandel@intel.com Signed-off-by: Mark Brown commit 745e3ed85f71a6382a239b03d9278a8025f2beae Author: Kirill A. Shutemov Date: Tue Jun 6 17:26:31 2023 +0300 efi/libstub: Implement support for unaccepted memory UEFI Specification version 2.9 introduces the concept of memory acceptance: Some Virtual Machine platforms, such as Intel TDX or AMD SEV-SNP, requiring memory to be accepted before it can be used by the guest. Accepting happens via a protocol specific for the Virtual Machine platform. Accepting memory is costly and it makes VMM allocate memory for the accepted guest physical address range. It's better to postpone memory acceptance until memory is needed. It lowers boot time and reduces memory overhead. The kernel needs to know what memory has been accepted. Firmware communicates this information via memory map: a new memory type -- EFI_UNACCEPTED_MEMORY -- indicates such memory. Range-based tracking works fine for firmware, but it gets bulky for the kernel: e820 (or whatever the arch uses) has to be modified on every page acceptance. It leads to table fragmentation and there's a limited number of entries in the e820 table. Another option is to mark such memory as usable in e820 and track if the range has been accepted in a bitmap. One bit in the bitmap represents a naturally aligned power-2-sized region of address space -- unit. For x86, unit size is 2MiB: 4k of the bitmap is enough to track 64GiB or physical address space. In the worst-case scenario -- a huge hole in the middle of the address space -- It needs 256MiB to handle 4PiB of the address space. Any unaccepted memory that is not aligned to unit_size gets accepted upfront. The bitmap is allocated and constructed in the EFI stub and passed down to the kernel via EFI configuration table. allocate_e820() allocates the bitmap if unaccepted memory is present, according to the size of unaccepted region. Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230606142637.5171-4-kirill.shutemov@linux.intel.com commit fefdb43943c1a0d87e1b43ae4d03e5f9a1d058f4 Author: David Gow Date: Fri Jun 2 11:53:59 2023 +0800 Documentation: kunit: Rename references to kunit_abort() The kunit_abort() function has been renamed __kunit_abort(), update the references to it in the documentation. Suggested-by: Daniel Latypov Signed-off-by: David Gow Reviewed-by: Daniel Latypov Signed-off-by: Shuah Khan commit 2e9f46ee1599be8a50a5366eb3ef4a4b5acff0b7 Author: Kirill A. Shutemov Date: Tue Jun 6 17:26:30 2023 +0300 efi/x86: Get full memory map in allocate_e820() Currently allocate_e820() is only interested in the size of map and size of memory descriptor to determine how many e820 entries the kernel needs. UEFI Specification version 2.9 introduces a new memory type -- unaccepted memory. To track unaccepted memory, the kernel needs to allocate a bitmap. The size of the bitmap is dependent on the maximum physical address present in the system. A full memory map is required to find the maximum address. Modify allocate_e820() to get a full memory map. Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Borislav Petkov Reviewed-by: Tom Lendacky Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230606142637.5171-3-kirill.shutemov@linux.intel.com commit dcdfdd40fa82b6704d2841938e5c8ec3051eb0d6 Author: Kirill A. Shutemov Date: Tue Jun 6 17:26:29 2023 +0300 mm: Add support for unaccepted memory UEFI Specification version 2.9 introduces the concept of memory acceptance. Some Virtual Machine platforms, such as Intel TDX or AMD SEV-SNP, require memory to be accepted before it can be used by the guest. Accepting happens via a protocol specific to the Virtual Machine platform. There are several ways the kernel can deal with unaccepted memory: 1. Accept all the memory during boot. It is easy to implement and it doesn't have runtime cost once the system is booted. The downside is very long boot time. Accept can be parallelized to multiple CPUs to keep it manageable (i.e. via DEFERRED_STRUCT_PAGE_INIT), but it tends to saturate memory bandwidth and does not scale beyond the point. 2. Accept a block of memory on the first use. It requires more infrastructure and changes in page allocator to make it work, but it provides good boot time. On-demand memory accept means latency spikes every time kernel steps onto a new memory block. The spikes will go away once workload data set size gets stabilized or all memory gets accepted. 3. Accept all memory in background. Introduce a thread (or multiple) that gets memory accepted proactively. It will minimize time the system experience latency spikes on memory allocation while keeping low boot time. This approach cannot function on its own. It is an extension of #2: background memory acceptance requires functional scheduler, but the page allocator may need to tap into unaccepted memory before that. The downside of the approach is that these threads also steal CPU cycles and memory bandwidth from the user's workload and may hurt user experience. Implement #1 and #2 for now. #2 is the default. Some workloads may want to use #1 with accept_memory=eager in kernel command line. #3 can be implemented later based on user's demands. Support of unaccepted memory requires a few changes in core-mm code: - memblock accepts memory on allocation. It serves early boot memory allocations and doesn't limit them to pre-accepted pool of memory. - page allocator accepts memory on the first allocation of the page. When kernel runs out of accepted memory, it accepts memory until the high watermark is reached. It helps to minimize fragmentation. EFI code will provide two helpers if the platform supports unaccepted memory: - accept_memory() makes a range of physical addresses accepted. - range_contains_unaccepted_memory() checks anything within the range of physical addresses requires acceptance. Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Vlastimil Babka Acked-by: Mike Rapoport # memblock Link: https://lore.kernel.org/r/20230606142637.5171-2-kirill.shutemov@linux.intel.com commit 95526d13038c2bbddd567a4d8e39fac42484e182 Author: Roberto Sassu Date: Tue Jun 6 09:41:13 2023 +0200 ima: Fix build warnings Fix build warnings (function parameters description) for ima_collect_modsig(), ima_match_policy() and ima_parse_add_rule(). Fixes: 15588227e086 ("ima: Collect modsig") # v5.4+ Fixes: 2fe5d6def167 ("ima: integrity appraisal extension") # v5.14+ Fixes: 4af4662fa4a9 ("integrity: IMA policy") # v3.2+ Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar commit d0a1865cf7e2211d9227592ef4141f4632e33908 Author: Nicholas Bishop Date: Fri May 12 19:43:02 2023 +0000 efi/esrt: Allow ESRT access without CAP_SYS_ADMIN Access to the files in /sys/firmware/efi/esrt has been restricted to CAP_SYS_ADMIN since support for ESRT was added, but this seems overly restrictive given that the files are read-only and just provide information about UEFI firmware updates. Remove the CAP_SYS_ADMIN restriction so that a non-root process can read the files, provided a suitably-privileged process changes the file ownership first. The files are still read-only and still owned by root by default. Signed-off-by: Nicholas Bishop Signed-off-by: Ard Biesheuvel commit 3b88f5fba24485e6cfa2883e155d78d330e2eabc Merge: 9defeb9f0a2a0 9e72869d0fe12 Author: Mark Brown Date: Tue Jun 6 14:29:41 2023 +0100 regulator: Add X-Powers AXP15060/AXP313a PMIC Merge series from Andre Przywara : This patch series adds support for the X-Powers AXP15060 and AXP313a PMIC, which are general purpose PMICs as seen on different boards with different SOCs, mostly from Allwinner. This is mostly a repost of the previous patches, combining both the AXP313a and AXP15060 series, rebased on top of v6.4-rc3, and omitting the patches that already got merged. The first two patches are the successors of the AXP313a v10 post, the third patch is based on Shengyu's AXP15060 v3 post. There were no code changes, just some tiny context differences due to the rebase, plus I added the newly gained tags. As the DT bindings and the AXP15060 MFD part are already in the tree, this is just completing support with the MFD part for the AXP313a, and the regulator support for both PMICs. commit 7d528eafc5290bed18551a22ff25ce8587b603e0 Author: Johannes Berg Date: Tue Jun 6 15:28:05 2023 +0200 Revert "wifi: iwlwifi: update response for mcc_update command" This reverts commit b70813e4a88f ("wifi: iwlwifi: update response for mcc_update command") since it causes a merge conflict, and it seems easier to redo the patch later. Signed-off-by: Johannes Berg commit 8b4580ab5612b34e2d05e60cb0efdc26e1bd6f39 Author: Johannes Berg Date: Tue Jun 6 15:26:05 2023 +0200 Revert "wifi: iwlwifi: mvm: FTM initiator MLO support" This reverts commit 1bcbb1208e9a ("wifi: iwlwifi: mvm: FTM initiator MLO support") as it causes a merge conflict, and we can defer and re-do those changes later. Signed-off-by: Johannes Berg commit b26d3d054de18f2334e06985e508083b2f32a101 Author: Randy Dunlap Date: Tue Apr 11 16:45:03 2023 -0700 x86/lib/msr: Clean up kernel-doc notation Convert x86/lib/msr.c comments to kernel-doc notation to eliminate kernel-doc warnings: msr.c:30: warning: This comment starts with '/**', but isn't \ a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst ... Fixes: 22085a66c2fa ("x86: Add another set of MSR accessor functions") Reported-by: kernel test robot Signed-off-by: Randy Dunlap Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/oe-kbuild-all/202304120048.v4uqUq9Q-lkp@intel.com/ commit 86d24f98b75d3a58503554e8d1dd277ae7386966 Author: Jon Hunter Date: Tue May 30 15:02:32 2023 +0100 arm64: tegra: Update USB phy-name for Jetson Orin NX Running 'make dtbs_check' reports the following warning for the Jetson Orin NX platform ... arch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767-0000.dtb: usb@3550000: phy-names:1: 'usb3-0' was expected Fix this by updating the phy-names:1 to be 'usb3-0' as expected. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 620405856d591ef95b01ee3e275af3a636c05010 Author: Jon Hunter Date: Tue May 30 15:02:31 2023 +0100 arm64: tegra: Enable USB device for Jetson AGX Orin Enable USB device support for the Jetson AGX Orin platform and update the mode for the usb2-0 port to be on-the-go. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 7e521093113b3920aff2f932221c87b6e910f33a Author: Andy Shevchenko Date: Mon Jun 5 18:45:23 2023 +0300 pinctrl: moorefield: Use BUFCFG_PINMODE_GPIO in ->pin_dbg_show() Use explicit comparison to BUFCFG_PINMODE_GPIO instead of implying it. Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit be5bb8f08205b5af9c44dccc9567584f572e2264 Author: Andy Shevchenko Date: Mon Jun 5 18:45:22 2023 +0300 pinctrl: moorefield: Fix open-drain pin mode configuration Currently the pin may not be configured as open-drain in some cases because the argument may be 0 for the boolean types of the pin configurations. Fix this by ignoring the argument. With that, allow to actually restore pin to the push-pull mode. Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 29cf9f36215c350a1990f68f1798fc826e4ef00b Author: Andy Shevchenko Date: Mon Jun 5 18:45:09 2023 +0300 pinctrl: merrifield: Use BUFCFG_PINMODE_GPIO in ->pin_dbg_show() Use explicit comparison to BUFCFG_PINMODE_GPIO instead of implying it. Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 9891422ba6777272e2638c5fbae6800cc23baf4e Author: Andy Shevchenko Date: Mon Jun 5 18:45:08 2023 +0300 pinctrl: merrifield: Fix open-drain pin mode configuration Currently the pin may not be configured as open-drain in some cases because the argument may be 0 for the boolean types of the pin configurations. Fix this by ignoring the argument. With that, allow to actually restore pin to the push-pull mode. Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 5835196a17be5cfdcad0b617f90cf4abe16951a4 Author: Andy Shevchenko Date: Mon Jun 5 17:37:34 2023 +0300 pinctrl: cherryview: Return correct value if pin in push-pull mode Currently the getter returns ENOTSUPP on pin configured in the push-pull mode. Fix this by adding the missed switch case. Fixes: ccdf81d08dbe ("pinctrl: cherryview: add option to set open-drain pin config") Fixes: 6e08d6bbebeb ("pinctrl: Add Intel Cherryview/Braswell pin controller support") Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit aaffb4cacd4c5546778a6e3b4bb2deef2dde4bd1 Author: Cristian Marussi Date: Wed May 31 16:20:39 2023 +0100 powercap: arm_scmi: Add support for disabling powercaps on a zone Add support to disable/enable powercapping on a zone. Acked-by: Rafael J. Wysocki Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20230531152039.2363181-4-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit 758cd5fc13b20a5874d33b7d381e78408743f587 Author: Cristian Marussi Date: Wed May 31 16:20:38 2023 +0100 firmware: arm_scmi: Add Powercap protocol enable support SCMI powercap protocol v3.2 supports disabling the powercap on a zone by zone basis by providing a zero valued powercap. Expose new operations to enable/disable powercapping on a per-zone base. Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20230531152039.2363181-3-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit 4e1a53b4030e0a28e17548f8f380fa38207ec300 Author: Cristian Marussi Date: Wed May 31 16:20:37 2023 +0100 firmware: arm_scmi: Refactor the internal powercap get/set helpers Refactor the SCMI powercap internal get/set helpers in preparation to adding the powercap protocol enable/disable support. Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20230531152039.2363181-2-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit b4f273774c8b2b7c6f5e0cb9b18a234a8ca322b4 Author: Andi Shyti Date: Tue Jun 6 03:20:51 2023 +0200 spi: s3c64xx: Use dev_err_probe() Simplify the code by using dev_err_probe() instead of dev_err() and 'return'. Signed-off-by: Andi Shyti Link: https://lore.kernel.org/r/20230606012051.2139333-3-andi.shyti@kernel.org Signed-off-by: Mark Brown commit 76fbad410c0fed0c203c22e7e5ef8455725f3338 Author: Andi Shyti Date: Tue Jun 6 03:20:50 2023 +0200 spi: s3c64xx: Use the managed spi master allocation function Use devm_spi_alloc_master() and get rid of one goto error path Signed-off-by: Andi Shyti Link: https://lore.kernel.org/r/20230606012051.2139333-2-andi.shyti@kernel.org Signed-off-by: Mark Brown commit fe748da7c216528d46adb4c6f4a969346ec3a452 Author: Olivier Moysan Date: Tue Jun 6 13:56:03 2023 +0200 ASoC: dt-bindings: document audio of graph port for cs42l51 When linking the CS42L51 to another DAI component, according to audio graph cards bindings, an OF graph port property is expected in the node. Document the port property. Signed-off-by: Olivier Moysan Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230606115605.1633595-3-olivier.moysan@foss.st.com Signed-off-by: Mark Brown commit 401ec2b8878f34b6baf64fba3e29411c246b785c Author: Olivier Moysan Date: Tue Jun 6 13:56:02 2023 +0200 ASoC: dt-bindings: stm32: document audio of graph port for i2s When linking the STM32 I2S to another DAI component, according to audio graph cards bindings, an OF graph port property is expected in the node. Document the port property. Signed-off-by: Olivier Moysan Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230606115605.1633595-2-olivier.moysan@foss.st.com Signed-off-by: Mark Brown commit 996e0a97ebd7b11cb785794e2a83c20c1add9d92 Author: Roberto Sassu Date: Tue Jun 6 09:41:12 2023 +0200 evm: Fix build warnings Fix build warnings (function parameters description) for evm_read_protected_xattrs(), evm_set_key() and evm_verifyxattr(). Fixes: 7626676320f3 ("evm: provide a function to set the EVM key from the kernel") # v4.5+ Fixes: 8314b6732ae4 ("ima: Define new template fields xattrnames, xattrlengths and xattrvalues") # v5.14+ Fixes: 2960e6cb5f7c ("evm: additional parameter to pass integrity cache entry 'iint'") # v3.2+ Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar commit 52861a3be8d6eae5c90963b747c4276ba6059c6b Author: Dan Carpenter Date: Tue Jun 6 11:26:25 2023 +0300 serial: core: don't kfree device managed data The put_device() function will call serial_base_ctrl_release() or serial_base_port_release() so these kfrees() are a double free bug. Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Signed-off-by: Dan Carpenter Reviewed-by: Tony Lindgren Message-ID: Signed-off-by: Greg Kroah-Hartman commit 282fde002760d3a006128c1d70b329e68a6ef844 Author: Prathamesh Shete Date: Mon Jun 5 17:42:30 2023 +0200 arm64: tegra: Add Tegra234 pin controllers Add the device tree nodes for the MAIN and AON pin controllers found on the Tegra234 family of SoCs. Signed-off-by: Prathamesh Shete Signed-off-by: Thierry Reding commit b6c7ff2693ddc24cdad3b032d969303f7b2ae3da Author: Chen-Yu Tsai Date: Tue Jun 6 17:17:45 2023 +0800 serial: 8250_mtk: Simplify clock sequencing and runtime PM The 8250_mtk driver's runtime PM support has some issues: - The bus clock is enabled (through runtime PM callback) later than a register write - runtime PM resume callback directly called in probe, but no pm_runtime_set_active() call is present - UART PM function calls the callbacks directly, _and_ calls runtime PM API - runtime PM callbacks try to do reference counting, adding yet another count between runtime PM and clocks This fragile setup worked in a way, but broke recently with runtime PM support added to the serial core. The system would hang when the UART console was probed and brought up. Tony provided some potential fixes [1][2], though they were still a bit complicated. The 8250_dw driver, which the 8250_mtk driver might have been based on, has a similar structure but simpler runtime PM usage. Simplify clock sequencing and runtime PM support in the 8250_mtk driver. Specifically, the clock is acquired enabled and assumed to be active, unless toggled through runtime PM suspend/resume. Reference counting is removed and left to the runtime PM core. The serial pm function now only calls the runtime PM API. [1] https://lore.kernel.org/linux-serial/20230602092701.GP14287@atomide.com/ [2] https://lore.kernel.org/linux-serial/20230605061511.GW14287@atomide.com/ Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Suggested-by: Tony Lindgren Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Tony Lindgren Message-ID: <20230606091747.2031168-1-wenst@chromium.org> Signed-off-by: Greg Kroah-Hartman commit 643662d12bc2b38ca693d6707e8da11c4777a09f Author: Raphael Gallais-Pou Date: Sun Jun 4 10:35:58 2023 +0200 serial: st-asc: fix typo in property name Changes the property name read in the driver according to the YAML. According to device-tree documentation, property names should not include underscores. Signed-off-by: Raphael Gallais-Pou Reviewed-by: Patrice Chotard Message-ID: <20230604083558.16661-1-rgallaispou@gmail.com> Signed-off-by: Greg Kroah-Hartman commit 66eff0ef528b6d6e9a45b68f6cd969dcbe7b800a Author: Uwe Kleine-König Date: Mon Jun 5 15:08:56 2023 +0200 powerpc/legacy_serial: Warn about 8250 devices operated without active FSL workarounds If the 8250 driver is built as a module (or built-in without console support) the Freescale specific workaround were silently not activated. Add a warning in this case. Currently CONFIG_SERIAL_8250_FSL=y implies that the function fsl8250_handle_irq() is built-in and can be used. However with the changes of the next commit CONFIG_SERIAL_8250_FSL might be enabled also when the 8250 driver is a module and so more care is needed when fsl8250_handle_irq() is to be used. The code added here is able to handle the new situation already. Signed-off-by: Uwe Kleine-König Message-ID: <20230605130857.85543-2-u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman commit cf9071dd46e72bd51c116b84fe33bf671ab3ae65 Author: Akanksha J N Date: Tue Jun 6 21:39:57 2023 +0900 selftests/ftrace: Add new test case which adds multiple consecutive probes in a function Commit 97f88a3d723162 ("powerpc/kprobes: Fix null pointer reference in arch_prepare_kprobe()") fixed a recent kernel oops that was caused as ftrace-based kprobe does not generate kprobe::ainsn::insn and it gets set to NULL. Add new test case kprobe_insn_boundary.tc which adds a kprobe at every byte within $FUNCTION_FORK up to an offset of 256 bytes, to be able to test potential issues with kprobes on successive instructions. The '|| continue' is added with the echo statement to ignore errors that are caused by trying to add kprobes to non probeable lines and continue with the test. Link: https://lore.kernel.org/linux-trace-kernel/20230428163842.95118-2-akanksha@linux.ibm.com Signed-off-by: Akanksha J N Acked-by: Naveen N. Rao Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 590e7b2804152eeb4f9c2d7d8f5c0f5ea47cca3d Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:56 2023 +0900 Documentation: tracing/probes: Add fprobe event tracing document Add a documentation about fprobe event tracing including tracepoint probe event and BTF argument. Link: https://lore.kernel.org/all/168507479345.913472.2804569685436422001.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Bagas Sanjaya commit 4231f30fcc34ad91d7faa58fe709992497f86c64 Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:56 2023 +0900 selftests/ftrace: Add BTF arguments test cases Add test cases to check the BTF arguments correctly supported. Link: https://lore.kernel.org/all/168507478292.913472.25631899274942311.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) commit 6335265ef2fe95c09d4a123e769778274d86f115 Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:56 2023 +0900 selftests/ftrace: Add tracepoint probe test case Add test cases for tracepoint probe events. Link: https://lore.kernel.org/all/168507477214.913472.11218388626709005588.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) commit fd26290ec89d4eae8570e027df3b8c519d285fd0 Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:56 2023 +0900 tracing/probes: Add BTF retval type support Check the target function has non-void retval type and set the correct fetch type if user doesn't specify it. If the function returns void, $retval is rejected as below; # echo 'f unregister_kprobes%return $retval' >> dynamic_events sh: write error: No such file or directory # cat error_log [ 37.488397] trace_fprobe: error: This function returns 'void' type Command: f unregister_kprobes%return $retval ^ Link: https://lore.kernel.org/all/168507476195.913472.16290308831790216609.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) commit 18b1e870a49671745c31434b18bcfdd6f20cb6a1 Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:56 2023 +0900 tracing/probes: Add $arg* meta argument for all function args Add the '$arg*' meta fetch argument for function-entry probe events. This will be expanded to the all arguments of the function and the tracepoint using BTF function argument information. e.g. # echo 'p vfs_read $arg*' >> dynamic_events # echo 'f vfs_write $arg*' >> dynamic_events # echo 't sched_overutilized_tp $arg*' >> dynamic_events # cat dynamic_events p:kprobes/p_vfs_read_0 vfs_read file=file buf=buf count=count pos=pos f:fprobes/vfs_write__entry vfs_write file=file buf=buf count=count pos=pos t:tracepoints/sched_overutilized_tp sched_overutilized_tp rd=rd overutilized=overutilized Also, single '$arg[0-9]*' will be converted to the BTF function argument. NOTE: This seems like a wildcard, but a fake one at this moment. This is just for telling user that this can be expanded to several arguments. And it is not like other $-vars, you can not use this $arg* as a part of fetch args, e.g. specifying name "foo=$arg*" and using it in dereferences "+0($arg*)" will lead a parse error. Link: https://lore.kernel.org/all/168507475126.913472.18329684401466211816.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) commit b576e09701c7d045bbe5cd85d53e2f34426aa214 Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:56 2023 +0900 tracing/probes: Support function parameters if BTF is available Support function or tracepoint parameters by name if BTF support is enabled and the event is for function entry (this feature can be used with kprobe- events, fprobe-events and tracepoint probe events.) Note that the BTF variable syntax does not require a prefix. If it starts with an alphabetic character or an underscore ('_') without a prefix like '$' and '%', it is considered as a BTF variable. If you specify only the BTF variable name, the argument name will also be the same name instead of 'arg*'. # echo 'p vfs_read count pos' >> dynamic_events # echo 'f vfs_write count pos' >> dynamic_events # echo 't sched_overutilized_tp rd overutilized' >> dynamic_events # cat dynamic_events p:kprobes/p_vfs_read_0 vfs_read count=count pos=pos f:fprobes/vfs_write__entry vfs_write count=count pos=pos t:tracepoints/sched_overutilized_tp sched_overutilized_tp rd=rd overutilized=overutilized Link: https://lore.kernel.org/all/168507474014.913472.16963996883278039183.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Alan Maguire Tested-by: Alan Maguire commit 1b8b0cd754cdbb54058165992456368495a695ac Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:56 2023 +0900 tracing/probes: Move event parameter fetching code to common parser Move trace event parameter fetching code to common parser in trace_probe.c. This simplifies eprobe's trace-event variable fetching code by introducing a parse context data structure. Link: https://lore.kernel.org/all/168507472950.913472.2812253181558471278.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) commit e2d0d7b2f42dcaf924e9c891c91c9aa22cbbebce Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:55 2023 +0900 tracing/probes: Add tracepoint support on fprobe_events Allow fprobe_events to trace raw tracepoints so that user can trace tracepoints which don't have traceevent wrappers. This new event is always available if the fprobe_events is enabled (thus no kconfig), because the fprobe_events depends on the trace-event and traceporint. e.g. # echo 't sched_overutilized_tp' >> dynamic_events # echo 't 9p_client_req' >> dynamic_events # cat dynamic_events t:tracepoints/sched_overutilized_tp sched_overutilized_tp t:tracepoints/_9p_client_req 9p_client_req The event name is based on the tracepoint name, but if it is started with digit character, an underscore '_' will be added. NOTE: to avoid further confusion, this renames TPARG_FL_TPOINT to TPARG_FL_TEVENT because this flag is used for eprobe (trace-event probe). And reuse TPARG_FL_TPOINT for this raw tracepoint probe. Link: https://lore.kernel.org/all/168507471874.913472.17214624519622959593.stgit@mhiramat.roam.corp.google.com/ Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202305020453.afTJ3VVp-lkp@intel.com/ Signed-off-by: Masami Hiramatsu (Google) commit 4d42a7656d871d80645385b0ac08eff9931c749e Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:55 2023 +0900 selftests/ftrace: Add fprobe related testcases Add syntax error testcase and add-remove testcase for fprobe events. This ensures that the fprobe events can be added/removed and parser handles syntax errors correctly. Link: https://lore.kernel.org/all/168507470812.913472.7489900116963294042.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) commit 334e5519c3757019cc591d4539d5aca199bdb114 Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:55 2023 +0900 tracing/probes: Add fprobe events for tracing function entry and exit. Add fprobe events for tracing function entry and exit instead of kprobe events. With this change, we can continue to trace function entry/exit even if the CONFIG_KPROBES_ON_FTRACE is not available. Since CONFIG_KPROBES_ON_FTRACE requires the CONFIG_DYNAMIC_FTRACE_WITH_REGS, it is not available if the architecture only supports CONFIG_DYNAMIC_FTRACE_WITH_ARGS. And that means kprobe events can not probe function entry/exit effectively on such architecture. But this can be solved if the dynamic events supports fprobe events. The fprobe event is a new dynamic events which is only for the function (symbol) entry and exit. This event accepts non register fetch arguments so that user can trace the function arguments and return values. The fprobe events syntax is here; f[:[GRP/][EVENT]] FUNCTION [FETCHARGS] f[MAXACTIVE][:[GRP/][EVENT]] FUNCTION%return [FETCHARGS] E.g. # echo 'f vfs_read $arg1' >> dynamic_events # echo 'f vfs_read%return $retval' >> dynamic_events # cat dynamic_events f:fprobes/vfs_read__entry vfs_read arg1=$arg1 f:fprobes/vfs_read__exit vfs_read%return arg1=$retval # echo 1 > events/fprobes/enable # head -n 20 trace | tail # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | sh-142 [005] ...1. 448.386420: vfs_read__entry: (vfs_read+0x4/0x340) arg1=0xffff888007f7c540 sh-142 [005] ..... 448.386436: vfs_read__exit: (ksys_read+0x75/0x100 <- vfs_read) arg1=0x1 sh-142 [005] ...1. 448.386451: vfs_read__entry: (vfs_read+0x4/0x340) arg1=0xffff888007f7c540 sh-142 [005] ..... 448.386458: vfs_read__exit: (ksys_read+0x75/0x100 <- vfs_read) arg1=0x1 sh-142 [005] ...1. 448.386469: vfs_read__entry: (vfs_read+0x4/0x340) arg1=0xffff888007f7c540 sh-142 [005] ..... 448.386476: vfs_read__exit: (ksys_read+0x75/0x100 <- vfs_read) arg1=0x1 sh-142 [005] ...1. 448.602073: vfs_read__entry: (vfs_read+0x4/0x340) arg1=0xffff888007f7c540 sh-142 [005] ..... 448.602089: vfs_read__exit: (ksys_read+0x75/0x100 <- vfs_read) arg1=0x1 Link: https://lore.kernel.org/all/168507469754.913472.6112857614708350210.stgit@mhiramat.roam.corp.google.com/ Reported-by: kernel test robot Link: https://lore.kernel.org/all/202302011530.7vm4O8Ro-lkp@intel.com/ Signed-off-by: Masami Hiramatsu (Google) commit 30460c21ed40a10bf541c4e93ba5e80bb4aac5da Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:55 2023 +0900 tracing/probes: Avoid setting TPARG_FL_FENTRY and TPARG_FL_RETURN When parsing a kprobe event, the return probe always sets both TPARG_FL_RETURN and TPARG_FL_FENTRY, but this is not useful because some fetchargs are only for return probe and some others only for function entry. Make it obviously mutual exclusive. Link: https://lore.kernel.org/all/168507468731.913472.11354553441385410734.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) commit cb16330d12741f6dae56aad5acf62f5be3a06c4e Author: Masami Hiramatsu (Google) Date: Tue Jun 6 21:39:55 2023 +0900 fprobe: Pass return address to the handlers Pass return address as 'ret_ip' to the fprobe entry and return handlers so that the fprobe user handler can get the reutrn address without analyzing arch-dependent pt_regs. Link: https://lore.kernel.org/all/168507467664.913472.11642316698862778600.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) commit 4d92116266485bc05a7d8cde41fba8845074d152 Author: Thierry Reding Date: Tue May 16 11:58:50 2023 +0200 arm64: tegra: Support Jetson Orin Nano Developer Kit The NVIDIA Jetson Orin Nano Developer Kit is the combination of the NVIDIA Jetson Orin Nano (P3767, SKU 5) module and the P3768 carrier board. Signed-off-by: Thierry Reding commit 5f027147e4796e9fc11083b2ad50a91c1ac36ede Author: Thierry Reding Date: Tue May 16 11:58:49 2023 +0200 dt-bindings: tegra: Document Jetson Orin Nano Developer Kit The Jetson Orin Nano Developer Kit pairs the Jetson Orin Nano devkit module with the P3768 carrier board. Acked-by: Conor Dooley Signed-off-by: Thierry Reding commit b4032e1726648cb156f45ae756c8730d6d39a5de Author: Thierry Reding Date: Tue May 16 11:58:48 2023 +0200 dt-bindings: tegra: Document Jetson Orin Nano The Jetson Orin Nano is the little sibling of the Jetson Orin NX. Document the corresponding compatible strings for these devices. Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 12382ad05110b569d95d29c637e16bbeb115acca Author: Prathamesh Shete Date: Tue May 30 12:51:08 2023 +0200 dt-bindings: gpio: Remove FSI domain ports on Tegra234 Ports S, T, U and V are in a separate controller that is part of the FSI domain. Remove their definitions from the MAIN controller definitions to get rid of the confusion. This technically breaks ABI compatibility with old device trees. However it doesn't cause issues in practice. The GPIO pins impacted by this are used for non-critical functionality. Fixes: a8b10f3d12cfc ("dt-bindings: gpio: Add Tegra234 support") Signed-off-by: Prathamesh Shete [treding@nvidia.com: rewrite commit message] Reviewed-by: Jon Hunter Signed-off-by: Thierry Reding commit 306f3f78a5ff578bdfd97c658a862cb2c2419fb6 Author: Takashi Iwai Date: Tue Jun 6 11:40:35 2023 +0200 ALSA: control: Keep the previous numid at snd_ctl_rename_id() We don't need to change the numid at each time snd_ctl_rename_id() is called, as the control element size itself doesn't change. Let's keep the previous numid value. Along with it, add a note about calling this function only in the card init phase. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230606094035.14808-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit ebcbfd846367c980e105c787d372c4239e9ed922 Author: Stefan Binding Date: Tue Jun 6 11:34:36 2023 +0100 ALSA: hda/realtek: Delete cs35l41 component master during free This ensures that the driver is properly cleaned up when freed. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20230606103436.455348-4-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 31dbb503f07a059419f16773e47df4a31093ba31 Author: Stefan Binding Date: Tue Jun 6 11:34:35 2023 +0100 ALSA: hda: cs35l41: Fix endian conversions Found during static analysis, ensure variables are correct types before endian conversion. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20230606103436.455348-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 448425f05b16f124290ad82b836c04da63b63035 Author: Stefan Binding Date: Tue Jun 6 11:34:34 2023 +0100 ALSA: hda: cs35l41: Clean up Firmware Load Controls Ensure Firmware Load control and Firmware Type control returns 1 when the value changes. Remove fw_mutex from firmware load control put, since it is unnecessary, and prevents any possibility of mutex inversion. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20230606103436.455348-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit c4fdb0818d38fbe1ea7021fb51346df70bbca284 Author: Johannes Berg Date: Sun Jun 4 12:11:28 2023 +0300 wifi: mac80211: stop warning after reconfig failures If we have a reconfig failure in the driver, then we need to shut down the network interface(s) at the network stack level through cfg80211, which can result in a lot of those "Failed check-sdata-in-driver check, ..." warnings, since interfaces are considered to not be in the driver when the reconfiguration fails, but we still need to go through all the shutdown flow. Avoid many of these warnings by storing the fact that the stack experienced a reconfiguration failure and not doing the warning in that case. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.3750c4ae6e76.I9e80d6026f59263c008a1a68f6cd6891ca0b93b0@changeid Signed-off-by: Johannes Berg commit 0cc80943ef518a1c51a1111e9346d1daf11dd545 Author: Ilan Peer Date: Sun Jun 4 12:11:27 2023 +0300 wifi: mac80211_hwsim: Fix possible NULL dereference In a call to mac80211_hwsim_select_tx_link() the sta pointer might be NULL, thus need to check that it is not NULL before accessing it. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.f4d889fc98c4.Iae85f527ed245a37637a874bb8b8c83d79812512@changeid Signed-off-by: Johannes Berg commit 15ddba5f43114c1fd9cd83676e04a9e1acf8e37f Author: Anjaneyulu Date: Sun Jun 4 12:11:26 2023 +0300 wifi: mac80211: consistently use u64 for BSS changes Currently, enum ieee80211_bss_change has more than 32 flags. Change the type of the corresponding variables from u32 to u64. Signed-off-by: Anjaneyulu Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.10354a05eaf1.If19359262fe2728dd523ea6d7c3aa7dc50940411@changeid Signed-off-by: Johannes Berg commit 92747f17c431a75967b461bedbb36ff259acead1 Author: Johannes Berg Date: Sun Jun 4 12:11:22 2023 +0300 wifi: mac80211: batch recalc during STA flush When we flush stations, we first take them off the list and then destroy them one by one. If we do the different mode recalculations while destroying them, we cause the following scenario: - STA 1 has 80 MHz - min chanctx width is now 80 MHz - STA 2 has 80 MHz - empty STA list - destroy STA 2 - recalc min chanctx width -> results in 20 MHz as the STA list is already empty This is broken, since as far as the driver is concerned STA 1 still exists at this point, and this causes issues at least with iwlwifi. Fix - and also optimize - this by doing the recalc of min chanctx width (and also P2P PS) only after all the stations were removed. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.48d262b6b42d.Ia15532657c17535c28ec0c5df263b65f0f80663c@changeid Signed-off-by: Johannes Berg commit 10a7ba92c7ab6cbac3c805ab3ee0642e91f1da97 Author: Johannes Berg Date: Sun Jun 4 12:11:21 2023 +0300 wifi: mac80211: move sta_info_move_state() up To fix a sequencing issue, this code needs to be changed a bit. Move it up in the file to prepare for that. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.05bb735d7075.I984b5c194a0f84580247d73620a4e61a5f82a774@changeid Signed-off-by: Johannes Berg commit ba7af2654e3b7b810c750b3c6106f6f20b81cc88 Author: Johannes Berg Date: Sun Jun 4 12:11:20 2023 +0300 wifi: mac80211: recalc min chandef for new STA links When adding a new link to a station, this needs to cause a recalculation of the minimum chandef since otherwise we can have a higher bandwidth station connected on that link than the link is operating at. Do the appropriate recalc. Fixes: cb71f1d136a6 ("wifi: mac80211: add sta link addition/removal") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.377adf3c789a.I91bf28f399e16e6ac1f83bacd1029a698b4e6685@changeid Signed-off-by: Johannes Berg commit b970ac68e0c46aec8049ba69e621a3e62353d2ce Author: Mukesh Sisodiya Date: Sun Jun 4 12:11:19 2023 +0300 wifi: mac80211_hwsim: check the return value of nla_put_u32 Check the return value of nla_put_u32() and handle it accordingly. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.de5168568cf6.Ie16442af9be879fd835506ba5dade780edecfb60@changeid Signed-off-by: Johannes Berg commit 29c6e2dc3d12a188a48f2a45759e8da44840546b Author: Emmanuel Grumbach Date: Sun Jun 4 12:11:17 2023 +0300 wifi: mac80211: provide a helper to fetch the medium synchronization delay There are drivers which need this information. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.b1043f3126e2.Iad3806f8bf8df07f52ef0a02cc3d0373c44a8c93@changeid Signed-off-by: Johannes Berg commit 1d10575bced5b65e138b029a35e6ef657f3b3273 Author: Mukesh Sisodiya Date: Sun Jun 4 12:11:14 2023 +0300 wifi: mac80211: refactor ieee80211_select_link_key() Simplify ieee80211_select_link_key(), no functional changes are made. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.a4e332755bb0.Iff4a2b6ed767b2a329c51c29bb597ece9ebe2af8@changeid Signed-off-by: Johannes Berg commit 2a5325f802863c399fe40de935ba01195d4c43c8 Author: Mukesh Sisodiya Date: Sun Jun 4 12:11:13 2023 +0300 wifi: mac80211: use u64 to hold enum ieee80211_bss_change flags The size of enum ieee80211_bss_change is bigger that 32, so we need u64 to be used in a flag. Also pass u64 instead of u32 to ieee80211_reconfig_ap_links() for the same reason. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.d53b7018a4eb.I1adaa041de51d50d84a11226573e81ceac0fe90d@changeid Signed-off-by: Johannes Berg commit 61403414e1719f929386dda8fb954bb302628ef3 Author: Johannes Berg Date: Thu May 4 16:45:11 2023 +0300 wifi: mac80211: implement proper AP MLD HW restart Previously, I didn't implement restarting here at all if the interface is an MLD, so it only worked for non-MLO. Add the needed code to restart an AP MLD correctly. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230504134511.828474-12-gregory.greenman@intel.com Signed-off-by: Johannes Berg commit ce2bb3b66273d7d122c5dbf8f1e58e8ebc82c5fb Author: Emmanuel Grumbach Date: Thu May 4 16:45:10 2023 +0300 wifi: mac80211: fetch and store the EML capability information We need to teach the low level driver about the EML capability which includes information for EMLSR / EMLMR operation. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230504134511.828474-11-gregory.greenman@intel.com Signed-off-by: Johannes Berg commit 08dbff230048ec2812c33e78f81855635a3c1734 Author: Johannes Berg Date: Thu May 4 16:45:08 2023 +0300 wifi: mac80211: skip EHT BSS membership selector Skip the EHT BSS membership selector for getting rates. While at it, add the definitions for GLK and EPS, and sort the list. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230504134511.828474-9-gregory.greenman@intel.com Signed-off-by: Johannes Berg commit 2d22be01b844c47771421ff8e0e68cecf967b7e3 Author: Johannes Berg Date: Thu May 4 16:45:07 2023 +0300 wifi: mac80211_hwsim: avoid warning with MLO PS stations If the station disables all links it's in powersave and we shouldn't transmit anything to it, but we don't handle that correctly yet. For now, just avoid the warning, once we really add support for this case we can revert to the old warning. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230504134511.828474-8-gregory.greenman@intel.com Signed-off-by: Johannes Berg commit 91f53ae97cb1a8c1c26f6cbcf9e2dc1cdff9b012 Author: Johannes Berg Date: Tue Jun 6 14:13:20 2023 +0200 wifi: mac80211: remove element scratch_len This isn't used, and there isn't really a good way it could be used, so just remove that. Signed-off-by: Johannes Berg commit acb8bca343f8d5b8697d027771abf8a371580d53 Author: Johannes Berg Date: Thu May 4 16:45:05 2023 +0300 wifi: mac80211: HW restart for MLO Implement proper reconfiguration for interfaces that are doing MLO, in order to be able to recover from HW restart correctly. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230504134511.828474-6-gregory.greenman@intel.com Signed-off-by: Johannes Berg commit 372a714808c8ec4f4ae4915c734d80d7f504997c Author: Gregory Greenman Date: Tue Jun 6 10:43:10 2023 +0300 wifi: iwlwifi: pnvm: handle memory descriptor tlv When PNVM is obtained from UEFI, there's an additional memory descriptor TLV that has to be handled. It is the same TLV that holds data in the reduced power tables. Also, in this TLV, the actual data is located after address and size, so add the corresponding offset. Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.8c5f5ee8e30b.Id1893c9dec140b5ba4abe8a121c2e1a1d121d2d7@changeid Signed-off-by: Johannes Berg commit 8ae3e23195188a925b9a3e05f34f114441d97e14 Author: Gregory Greenman Date: Tue Jun 6 10:43:09 2023 +0300 wifi: iwlwifi: fw: don't use constant size with efi.get_variable Use efi.get_variable() with NULL pointer for data in order to obtain entry size and then call it again with the correct size to get the entry itself. Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.ef95a8055a50.Iae5389baaf0a9a3c89469f7502275ee119d378b6@changeid Signed-off-by: Johannes Berg commit 875d035f37ec06a27c61abd9103178ae5a674672 Author: Johannes Berg Date: Tue Jun 6 10:43:08 2023 +0300 wifi: iwlwifi: fw: clean up PNVM loading code This code is a bit of a maze of gotos etc. Clean up the code a bit to make the intent clearer. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.51fb5ee63f21.I20f270b2d47612e84643dc235c2940b8d9ed9930@changeid Signed-off-by: Johannes Berg commit 380bf72d1b1dc3cb2572acd9b61153e79413b036 Author: Alon Giladi Date: Tue Jun 6 10:43:07 2023 +0300 wifi: iwlwifi: Separate reading and parsing of reduce power table It enables to better handle error cases. Also save the image till the end of the loading and only then free it. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.71e3b3e0e794.Ifbe69ad99a7e805eb70e09280365821eb146b1c9@changeid Signed-off-by: Johannes Berg commit 7c9c8477170d32def5df9d88823ea10d65749341 Author: Alon Giladi Date: Tue Jun 6 10:43:06 2023 +0300 wifi: iwlwifi: Enable loading of reduce-power tables into several segments Replace the field reduce_power_dram with a struct that holds data about the reduced-power tables drams regions. Generalize load_payloads_segments() to work for both pnvm tables and reduction power tables. Make required adjustments in the data structures. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.6fe66958f049.I85d80682229fc02fe354462cc9da40937558f30c@changeid Signed-off-by: Johannes Berg commit ea3571f48953df2cf77a9c4200a7363236736673 Author: Alon Giladi Date: Tue Jun 6 10:43:05 2023 +0300 wifi: iwlwifi: Use iwl_pnvm_image in reduce power tables flow Generalize the parsing, loading, and setting of the power-reduce tables, in order to support allocation of several DRAM payloads in the future. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.564f1eead99b.Iaba653b21dc09aafc72b9bbb3928abddce0db50a@changeid Signed-off-by: Johannes Berg commit c738fb6163b213dd9565ba1951d4f130975db10f Author: Alon Giladi Date: Tue Jun 6 10:43:04 2023 +0300 wifi: iwlwifi: Separate loading and setting of power reduce tables Take the part that copies the tables into DRAM, out of the method that sets the prph_scratch to make the code cleaner. Each of the operations will get more complex in the future when it will also support larger power-reduce tables images. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.7695684dc848.I13626cd318e5d68efec9618b2045f52788bff114@changeid Signed-off-by: Johannes Berg commit 63b9e7b9f02ee3b10b6998778e2ed11f23510d9c Author: Alon Giladi Date: Tue Jun 6 10:43:03 2023 +0300 wifi: iwlwifi: Implement loading and setting of fragmented pnvm image Save the pnvm payloads in several DRAM segments (not only in one as used to). In addition, allocate a FW structure in DRAM that holds the segments' addresses and forward its address to the FW. It's done when FW has the capability to handle pnvm images this way (helps to process large pnvm images). Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.dbdad8995ce1.I986213527982637042532de3851a1bd8a11be87a@changeid Signed-off-by: Johannes Berg commit 331828106e52d76170fed605aeeb9ba1b7321f46 Author: Alon Giladi Date: Tue Jun 6 10:43:02 2023 +0300 wifi: iwlwifi: Add support for fragmented pnvm images Add support for fragmented pnvm images, depending on the FW capability. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.c49bfaf435a9.I0278312e7c3355b224cd870d4f8cf6578d12f03e@changeid Signed-off-by: Johannes Berg commit f6fa5835652150734c57ccb2a21f3653cbe42a27 Author: Alon Giladi Date: Tue Jun 6 10:43:01 2023 +0300 wifi: iwlwifi: Allow trans_pcie track more than 1 pnvm DRAM region Change the field pnvm_dram to an array that describes many regions and add a counter to the number of pnvm regions that were allocated in DRAM. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.bb206d71bf45.I627640701757bb2f234f8e18a3afbd6af1206658@changeid Signed-off-by: Johannes Berg commit b99e32cbfdf63a8acab18b0d44402172528ffe48 Author: Alon Giladi Date: Tue Jun 6 10:43:00 2023 +0300 wifi: iwlwifi: Take loading and setting of pnvm image out of parsing part Change iwl_pnvm_parse so it will only save the information into the iwl_pnvm_image struct. This enables to use the parsing code for the power reduce tables in the future. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.504b42fc1611.I4ddf6ad76d922d118fcbcc4f0e9ec003753d0b75@changeid Signed-off-by: Johannes Berg commit 194d1f84d56e912459f166a80ef520037c84b0d3 Author: Alon Giladi Date: Tue Jun 6 10:42:59 2023 +0300 wifi: iwlwifi: Separate loading and setting of pnvm image into two functions Take the part that is copying the pnvm image into DRAM, out of the the method that sets the prph_scratch. Makes the code cleaner since those 2 operations don't always happen together (loading should happen only once while setting can happen more than once). In addition, each operation will get more complex in the future when it will support also larger pnvm images. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.4c0728239fd6.Ibc30a9fbdb6123dadbe2dbb89318dbd5ec01080a@changeid Signed-off-by: Johannes Berg commit 5f40850399c61aec5f26861f4a5194aae64c27df Author: Alon Giladi Date: Tue Jun 6 10:42:58 2023 +0300 wifi: iwlwifi: Generalize the parsing of the pnvm image Generalize iwl_pnvm_parse(). This saves us from copying each payload twice (first in the parsing and later when copying it to the dram). Moreover, its more compatible for handling larger pnvm tables in the future (in which payloads won't be concatenated). The main changes are: 1. Take out the concatenating of the payloads from the parsing level 2. Start using iwl_pnvm_image structure that will hold pointers to payloads that should be delivered to fw, their sizes and number. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230606103519.06c02f380b6f.I03a3030fca194aa0c4bc2ecd18531f8914e98cfd@changeid Signed-off-by: Johannes Berg commit 2e3d8d71e285fcf39eb30dbb17a58baa90649867 Author: Tony Krowiak Date: Tue May 30 18:35:38 2023 -0400 s390/vfio-ap: wire in the vfio_device_ops request callback The mdev device is being removed, so pass the request to userspace to ask for a graceful cleanup. This should free up the thread that would otherwise loop waiting for the device to be fully released. Signed-off-by: Tony Krowiak Reviewed-by: Cédric Le Goater Reviewed-by: Matthew Rosato Tested-by: Matthew Rosato Acked-by: Alex Williamson Link: https://lore.kernel.org/r/20230530223538.279198-4-akrowiak@linux.ibm.com Signed-off-by: Alexander Gordeev commit bf48961f6f48e3b7eb80c3e179207e9f4e4cd660 Author: Tony Krowiak Date: Tue May 30 18:35:37 2023 -0400 s390/vfio-ap: realize the VFIO_DEVICE_SET_IRQS ioctl Realize the VFIO_DEVICE_SET_IRQS ioctl to set an eventfd file descriptor to be used by the vfio_ap device driver to signal a device request to userspace. Signed-off-by: Tony Krowiak Reviewed-by: Cédric Le Goater Reviewed-by: Matthew Rosato Tested-by: Matthew Rosato Link: https://lore.kernel.org/r/20230530223538.279198-3-akrowiak@linux.ibm.com Signed-off-by: Alexander Gordeev commit 6afc770048edc90405c444163de70b1cdfbb8b57 Author: Tony Krowiak Date: Tue May 30 18:35:36 2023 -0400 s390/vfio-ap: realize the VFIO_DEVICE_GET_IRQ_INFO ioctl Realize the VFIO_DEVICE_GET_IRQ_INFO ioctl to retrieve the information for the VFIO device request IRQ. Signed-off-by: Tony Krowiak Acked-by: Alex Williamson Reviewed-by: Cédric Le Goater Reviewed-by: Matthew Rosato Tested-by: Matthew Rosato Link: https://lore.kernel.org/r/20230530223538.279198-2-akrowiak@linux.ibm.com Signed-off-by: Alexander Gordeev commit 43413a36b268f1a5049b8c1d44fdd892e080b563 Author: Johannes Berg Date: Thu Jun 1 17:20:06 2023 +0300 wifi: iwlwifi: api: fix kernel-doc links Some of the kernel-doc links are outdated due to other changes, fix that. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230601171633.85e2cf489893.Ie3889ea6f755b80c988543ccca56c67420c51b1f@changeid Signed-off-by: Johannes Berg commit d6b0e44e49bc55ec45b25133ba5de3bc20fbd82a Author: Johannes Berg Date: Thu Jun 1 17:20:05 2023 +0300 wifi: iwlwifi: api: remove unused commands Some commands are no longer used and have broken kernel-doc links, so just remove them. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230601171633.3dad4ad9b53e.I018abd02d6925950b8748dfb7a59db87255fc670@changeid Signed-off-by: Johannes Berg commit 11b60071759de9d623feb478dfcdf1d1e63ce95d Author: Johannes Berg Date: Thu Jun 1 17:20:04 2023 +0300 wifi: iwlwifi: api: use __le16 instead of u16 Even for reserved values we shouldn't use u16, that's just error prone. Fix this to __le16. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230601171633.29ebf70aa64e.I1263f6724e1c70ff5541f447b9744f143ee736a3@changeid Signed-off-by: Johannes Berg commit 59505471a11b31a4296f4782dfcb36e0b459df5b Author: Johannes Berg Date: Thu Jun 1 17:20:03 2023 +0300 wifi: iwlwifi: api: link context action in kernel-doc This is clearer in kernel-doc than spelling out the prefix. It also lets us generate better tracing data. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230601171633.e11ece794f60.I9874c7b0437071a2620d68ca5a16efed60da07a9@changeid Signed-off-by: Johannes Berg commit 4c8d5c8d079e7ccdac959a2d909e1d2aca28b038 Author: Johannes Berg Date: Thu Jun 1 09:52:46 2023 +0300 wifi: iwlwifi: mvm: tell firmware about per-STA MFP enablement Indicate to the firmware for each station whether or not MFP is used with this station. Note that we indicate MFP for it before authorized since we don't know yet, and that will make the firmware not handle should-be-protected management frames without being able to check them. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230601095201.b1052f39af4c.I1b46b751d5808e65ea3d0e7b8b38209c5aecf042@changeid Signed-off-by: Johannes Berg commit ead65aa2d5155728baec90f6404cd02618ef29d0 Author: Johannes Berg Date: Wed May 31 19:50:06 2023 +0300 wifi: iwlwifi: mvm: send time sync only if needed If there's no peer configured then there's no point in sending the command down to the firmware with an invalid peer address. Fixes: cf85123a210f ("wifi: iwlwifi: mvm: support enabling and disabling HW timestamping") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194630.0fb9f81f1852.Idcc41b67d1fbb421e5ed9bac2177b948b7b4d1c9@changeid Signed-off-by: Johannes Berg commit fccf5ff14e00b264c03467186e6055dcb9959475 Author: Johannes Berg Date: Wed May 31 19:50:05 2023 +0300 wifi: iwlwifi: mvm: remove warning for beacon filtering error This warning is sometimes happening if we force a FW error while disconnecting, which is annoying but harmless. However, it's also pointless to throw a warning here, since the stack and driver state doesn't really help, so just remove that so the driver will ignore the error if any. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194630.29fe6990d372.I00ff5dc7bfb4025a609f380a0a3911d842b72449@changeid Signed-off-by: Johannes Berg commit 4784f3f9232fd295245d54abdf03002a91e4784f Author: Mukesh Sisodiya Date: Wed May 31 19:50:04 2023 +0300 wifi: iwlwifi: remove dead code in iwl_dump_ini_imr_get_size() Remove the check for the IMR debug data size which leads to dead code. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194630.58eec8d40729.Ifb7d64706eed45726db804f36e785283dff7adab@changeid Signed-off-by: Johannes Berg commit 9e6942121e1956191dce0779cb8228f64d19e1d9 Author: Alon Giladi Date: Wed May 31 19:50:03 2023 +0300 wifi: iwlwifi: Add Dell to ppag approved list Add 2 new entries for Dell in PPAG approved list. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194630.a2696f0538ef.I324e4a0cc4696c27830a490b79c42dfeff8ba074@changeid Signed-off-by: Johannes Berg commit 1bcbb1208e9a392fd850b7c8e0422d618d4ab565 Author: Avraham Stern Date: Wed May 31 19:50:01 2023 +0300 wifi: iwlwifi: mvm: FTM initiator MLO support When checking if the initiator is associated to the responder, iterate over all active links. Signed-off-by: Avraham Stern Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194629.a0d86655e7d2.I8f140ca55094da1d73c387fc036394fb2c148c85@changeid Signed-off-by: Johannes Berg commit ec80c23170465a123f7382120f1af04289adc465 Author: Johannes Berg Date: Wed May 31 19:50:00 2023 +0300 wifi: iwlwifi: pcie: adjust Bz device timings The 100ms shouldn't be needed, only 10ms. However after reset we should have 10ms as well for these devices. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194629.9a5627c1ff18.Ifcfbccd5458bd9ebd496aa834284fb0facfcaaef@changeid Signed-off-by: Johannes Berg commit 3b67a20bb0cb9e2f03dbe0af2074b7f4aa5fa811 Author: Haim Dreyfuss Date: Wed May 31 19:49:59 2023 +0300 wifi: iwlwifi: mvm: offload BTM response during D3 There are mainly two types of BTM (BSS Transition Management) requests, recommendations and notifications. For the first type, a response is needed otherwise, most probably the STA will be disconnected. Since we don't want to wake up the host on it, set the BTM to reject offload flag (if the device supports it) and rely on the FW to take care of it. The FW will reject the BTM request and in case the AP sends DEAUTH the FW can wake up the host to let it decide on the next steps. Signed-off-by: Haim Dreyfuss Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194629.d95ae6f2804c.I9457acc55bc23ce715c714b5088058f52540c224@changeid Signed-off-by: Johannes Berg commit 3278c42ba992fd016baa7275feeb138c05cceb62 Author: Benjamin Berg Date: Wed May 31 19:49:58 2023 +0300 wifi: iwlwifi: do not log undefined DRAM buffers unnecessarily DRAM buffers that are not defined in the TLVs (or are unused in the preset) would cause a log message. To avoid confusion, skip processing buffers with an invalid (i.e. uninitialized) DRAM path. This further reduces the noise of the message in cases where it is unlikely to be helpful. Also update a related debug log string to better describe what is happening. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194629.ecae60cf2d7f.Ib44a94d4aeb55dbb2e52edea8b69a09bc0f722c3@changeid Signed-off-by: Johannes Berg commit 7bc57ca9b4129c4c2265832c79722d531308b072 Author: Golan Ben Ami Date: Wed May 31 19:49:57 2023 +0300 wifi: iwlwifi: acpi: add other Google OEMs to the ppag approved list Add two new vendors to the PPAG approved vendor list as Google OEMs. Signed-off-by: Golan Ben Ami Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194629.b89a3f9e3ae0.Iab1e13285c58ef1fee2a8bad8429eda4547b0b74@changeid Signed-off-by: Johannes Berg commit 0e3941357a0be334413c96e57a18b54e31aaf55a Author: Johannes Berg Date: Wed May 31 19:49:56 2023 +0300 wifi: iwlwifi: mvm: clarify EHT RU allocation bits Calling this IWL_RX_PHY_DATA1_EHT_B0 is just confusing, it's the RU allocation bit 0. Also then align the name for B1-B7 accordingly. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194629.824edb28c0eb.Ia9f74573e3ac771911b679558984f1bfb36de674@changeid Signed-off-by: Johannes Berg commit f9f5cc864533c4ac7afb476c57a3ae3f8998a837 Author: Johannes Berg Date: Wed May 31 19:49:55 2023 +0300 wifi: iwlwifi: mvm: support injection rate control Supporting controlling the frame rate during injection, HT/VHT are supported in addition to legacy rates. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194629.85a662792649.I0847b47dec0dfb0290d7b15ebc6bc0a575eed7b5@changeid Signed-off-by: Johannes Berg commit 06471b67d42efeae151931f7ed95ed612734f1be Author: Alon Giladi Date: Wed May 31 19:49:54 2023 +0300 wifi: iwlwifi: Add vendors to TAS approved list Allows vendors to use the time average sar feature. Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531194629.845c205e4def.Iab5c849617ed7e13304e4dfc7def668659439946@changeid Signed-off-by: Johannes Berg commit 352d3ef47efb6f36d44f645387f7746a6fcb4035 Author: Avraham Stern Date: Wed May 31 11:50:33 2023 +0300 wifi: iwlwifi: iwlmei: fix compilation error The feature is still disabled (depends on BROKEN), but the code had a compilation error after one of the merges. Fix that. Signed-off-by: Avraham Stern Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230531085033.216028-1-gregory.greenman@intel.com Signed-off-by: Johannes Berg commit b70813e4a88f231f1dc76fedbbd24ce4961b9a85 Author: Abhishek Naik Date: Wed May 24 20:42:11 2023 +0300 wifi: iwlwifi: update response for mcc_update command Add support for the MCC update response version 8. Versions 5-6 are already covered by the existing flags conversion, and 7 isn't used. The capabilities field in iwl_mcc_update_resp is 32 bits wide now, and the flags moved, so some more changes are needed. While at it, convert the flags to bool (to avoid having to deal with BIT(16) specially etc.) and use the struct_size() macro for the memory allocation. Signed-off-by: Abhishek Naik Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.fd9016f8f994.Ibddcb9fbfa74895f742c0ac20968720691c94853@changeid Signed-off-by: Johannes Berg commit e2c510d6d630fe6593a0cf87531913b4b08ebeb1 Author: Mason Huo Date: Tue Jun 6 18:56:56 2023 +0800 riscv: dts: starfive: Add cpu scaling for JH7110 SoC Add the operating-points-v2 to support cpu scaling on StarFive JH7110 SoC. It supports up to 4 cpu frequency loads. Signed-off-by: Mason Huo Signed-off-by: Conor Dooley commit 2378341504de476acd880833a0e5481555b9aa5c Author: Mason Huo Date: Tue Jun 6 18:56:54 2023 +0800 riscv: dts: starfive: Enable axp15060 pmic for cpufreq The VisionFive 2 board has an embedded pmic axp15060, which supports the cpu DVFS through the dcdc2 regulator. This patch enables axp15060 pmic and configs the dcdc2. Signed-off-by: Mason Huo Signed-off-by: Conor Dooley commit ae91f7e436f8b631c47e244b892ecac62a4d9430 Author: Lukas Bulwahn Date: Mon Jun 5 09:27:43 2023 +0200 net/pppoe: fix a typo for the PPPOE_HASH_BITS_1 definition Instead of its intention to define PPPOE_HASH_BITS_1, commit 96ba44c637b0 ("net/pppoe: make number of hash bits configurable") actually defined config PPPOE_HASH_BITS_2 twice in the ppp's Kconfig file due to a quick typo with the numbers. Fix the typo and define PPPOE_HASH_BITS_1. Fixes: 96ba44c637b0 ("net/pppoe: make number of hash bits configurable") Signed-off-by: Lukas Bulwahn Reviewed-by: Simon Horman Reviewed-by: Jaco Kroon Link: https://lore.kernel.org/r/20230605072743.11247-1-lukas.bulwahn@gmail.com Signed-off-by: Paolo Abeni commit 8d2b2281aea90ab265733c3cda83b73a01ca352f Author: Andy Shevchenko Date: Sun Jun 4 16:28:58 2023 +0300 mac_pton: Clean up the header inclusions Since hex_to_bin() is provided by hex.h there is no need to require kernel.h. Replace the latter by the former and add missing export.h. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230604132858.6650-1-andriy.shevchenko@linux.intel.com Signed-off-by: Paolo Abeni commit 47147d56f92ee3f575e4b457413e0f2587b40e17 Author: Alfonso Rodriguez Date: Mon Jun 5 17:24:33 2023 +0530 fpga: zynq-fpga: Ensure proper xCAP interface switch The Zynq platform has PCAP, ICAP and JTAG interfaces for configuring programmable logic (PL). The existing driver implementation uses the PCAP interface to configure the PL. Before switching the PL configuration interface from PCAP to ICAP make sure that all outstanding Transactions relevant to the PL configuration should be completed by the PCAP interface otherwise it may lead to PL configuration issues. This patch provides a required fix to ensure that all existing PL transactions are completed before switching from PCAP to ICAP. For detailed information relevant to PL configuration interfaces refer Zynq 7000 TRM (section 6.5.1). Link: https://docs.xilinx.com/v/u/en-US/ug585-Zynq-7000-TRM Signed-off-by: Alfonso Rodriguez Signed-off-by: Nava kishore Manne Acked-by: Xu Yilun Link: https://lore.kernel.org/r/20230605115433.186087-1-nava.kishore.manne@amd.com Signed-off-by: Xu Yilun commit 5cd4ef0d02737f3e8372cb388e7da78f1238782e Author: Alon Giladi Date: Wed May 24 20:42:10 2023 +0300 wifi: iwlwifi: support PPAG in China for older FW cmd version Allows the China bit in the ppag flags to turn on also when FW cmd version is 1 (if FW has the capability). Signed-off-by: Alon Giladi Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.3cc19e799eeb.I9054b1d63fd7ae2b5f0e416825b4b1dc9f79cc80@changeid Signed-off-by: Johannes Berg commit 8dd1039f8fab9ed9514d601be5988aa72ab2c077 Author: Johannes Berg Date: Wed May 24 20:42:09 2023 +0300 wifi: iwlwifi: mvm: remove useless code Setting the station to -EBUSY was originally done under this lock, and the comment still refers to it. But this no longer happens because that was removed when DQA was removed. Remove the leftover code as well. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.30048b1cd0fd.Ie2c2ff6fd7c6e3ebf5b736de350dc15515970792@changeid Signed-off-by: Johannes Berg commit dbb6f2307b84e8aaaa60f7ba0b17cb1a333e2216 Author: Gregory Greenman Date: Wed May 24 20:42:08 2023 +0300 wifi: iwlwifi: disable RX STBC when a device doesn't support it Some devices, like step A0 of GL FM device doesn't support RX STBC for VHT/HE. Add a workaround to remove it from capabilities in this case. Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.65c3e09813e5.Iadfd8cdb0ea5a8088ae3daa555c780c423951894@changeid Signed-off-by: Johannes Berg commit 58e682768938cd8e8cd9fbd46adcbdb9afa4cee4 Author: Ariel Malamud Date: Wed May 24 20:42:07 2023 +0300 wifi: iwlwifi: fw: Add new ODM vendor to ppag approved list Add new oem/odm pair to ppag approved vendors list when specified by platform. Signed-off-by: Ariel Malamud Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.549a57a1cf11.I7392b1cd31f4f7ee60aafe2093f4e82b1d6fd3a7@changeid Signed-off-by: Johannes Berg commit fa53608b525fa8d32770783f4f9e59eafd905cc4 Author: Gregory Greenman Date: Wed May 24 20:42:06 2023 +0300 wifi: iwlwifi: mvm: adjust csa notifications and commands to MLO In the following notifications and commands mac_id was replaced with link_id: * CANCEL_CHANNEL_SWITCH_CMD * CHANNEL_SWITCH_START_NOTIF * CHANNEL_SWITCH_ERROR_NOTIF The logic around was not changed, so only adjust handling mac/link id. Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.6aa6e394f5fe.Ie9e78918511ca901f9f3966d774fa74a71a186e3@changeid Signed-off-by: Johannes Berg commit 3f3022694f62476df562244ee2a72819e98eec89 Author: Emmanuel Grumbach Date: Wed May 24 20:42:05 2023 +0300 wifi: iwlwifi: mvm: update the FW apis for LINK and MAC commands The firmware added new fields to be able to pass the link_id as the AP knows it and the esr_transition_timeout. For now, pass only the link_id since we don't have access to the esr_transition_timeout yet. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.bf80ce717458.Icd4174911227c00cd12783fe1f517ae8097809b9@changeid Signed-off-by: Johannes Berg commit cec74584dc19a604c39a9b77a819b35e684e6e4c Author: Miri Korenblit Date: Wed May 24 20:42:04 2023 +0300 wifi: iwlwifi: mvm: Make iwl_mvm_diversity_iter() MLO aware This function is MLO related, so it should iterate over all the links, and not only on deflink. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.56a9c709e987.I9716195ec288cce2c929338c254ee9add8cfcc1f@changeid Signed-off-by: Johannes Berg commit cad7850ac0f597cd462b263a6395c5cd0ad8e760 Author: Haim Dreyfuss Date: Wed May 24 20:42:03 2023 +0300 wifi: iwlwifi: don't silently ignore missing suspend or resume ops In case the driver doesn't implement suspend or resume operations on the transport layer, notify the driver's upper layer. Otherwise, we might access d3_status uninitialized. Signed-off-by: Haim Dreyfuss Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.0c55e0ca92f1.I6870fe1683215e65d3d036f9b576b03b7b7257be@changeid Signed-off-by: Johannes Berg commit 0945f9762ec3766186a179f7ccd001a3e160e3a0 Author: Avraham Stern Date: Wed May 24 20:42:02 2023 +0300 wifi: iwlwifi: mvm: support PASN for MLO When adding a PASN station, the non MLD API was used. This results in assert when operating as MLD. Fix it to use the MLD API when operating as MLD. For now, the default link is used for the added station. Signed-off-by: Avraham Stern Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.7c35dccc8a12.I7bc78cd16d7c750f42fdd60e07e839a860d279d2@changeid Signed-off-by: Johannes Berg commit 1be4858ec43de04ef640022af6e6c9de40260ea4 Author: Johannes Berg Date: Wed May 24 20:42:01 2023 +0300 wifi: iwlwifi: mvm: dissolve iwl_mvm_mac_add_interface_common() This wasn't really common anymore, so dissolve it, it has a pretty strange calling convention that's confusing. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.44320ab2e842.Ie1d6b9c28caca3b541ca383a4c0c8799b0e72fe0@changeid Signed-off-by: Johannes Berg commit a2906ea60a141e23d9ed635e6306d295d37427e8 Author: Johannes Berg Date: Wed May 24 20:42:00 2023 +0300 wifi: iwlwifi: mvm: make internal callback structs const There's no need for these to be writable, so they can be const (and static). Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.c41eb6687868.I2dac1158e5723187bda1973aa49fde8a794621c8@changeid Signed-off-by: Johannes Berg commit d464550bb2e9cce2c377ed39c7e327e7db6e2be9 Author: Yedidya Benshimol Date: Wed May 24 20:41:59 2023 +0300 wifi: iwlwifi: mvm: use link ID in missed beacon notification This new version of missed beacon notification uses link_id instead of mac_id. Also add an option to use link id for retrieving vif. Signed-off-by: Yedidya Benshimol Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.17fe1cc632f1.Id1fabb532e2174712fe17d4ad86a2c8c64ae84da@changeid Signed-off-by: Johannes Berg commit e23b4fdb5cd0bab2ba770bc481dfb36c875a1d09 Merge: 9f70bc890ae29 9e436c195e2d6 Author: Alexander Gordeev Date: Tue Jun 6 13:00:11 2023 +0200 Merge branch 'protected-key' into features Harald Freudenberger says: =================== This patches do some cleanup and reorg of the pkey module code and extend the existing ioctl with supporting derivation of protected key material from clear key material for some ECC curves with the help of the PCKMO instruction. Please note that 'protected key' is a special type of key only available on s390. It is similar to an secure key which is encrypted by a master key sitting inside an HSM. In contrast to secure keys a protected key is encrypted by a random key located in a hidden firmware memory accessible by the CPU and thus much faster but less secure. =================== The merged updates are: - Fix the style of protected key API driver source: use x-mas tree for all local variable declarations. - Rework protected key API driver to not use the struct pkey_protkey and pkey_clrkey anymore. Both structures have a fixed size buffer, but with the support of ECC protected key these buffers are not big enough. Use dynamic buffers internally and transparently for userspace. - Add support for a new 'non CCA clear key token' with ECC clear keys supported: ECC P256, ECC P384, ECC P521, ECC ED25519 and ECC ED448. This makes it possible to derive a protected key from the ECC clear key input via PKEY_KBLOB2PROTK3 ioctl, while currently the only way to derive is via PCKMO instruction. Signed-off-by: Alexander Gordeev commit 75f059d37b58d9082273dfdd097d57f788f57c27 Author: Golan Ben Ami Date: Wed May 24 20:41:58 2023 +0300 wifi: iwlwifi: cfg: freeze 22500 devices FW API FW version is now frozen for 22500 devices. Don't allow newer versions in the driver. Signed-off-by: Golan Ben Ami Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230524203151.8a25ebf9134c.I3f1454498322ce28cb687d28c091c7ee092cefca@changeid Signed-off-by: Johannes Berg commit aead1076f3dbd16ec2241f94264b1a53989101cc Author: Geert Uytterhoeven Date: Tue Jun 6 11:55:42 2023 +0200 reset: RESET_NUVOTON_MA35D1 should depend on ARCH_MA35 The Nuvoton MA35D1 reset controller is only present on Nuvoton MA35 SoCs. Hence add a dependency on ARCH_MA35, to prevent asking the user about this driver when configuring a kernel without MA35 SoC support. Also, do not enable the driver by default when merely compile-testing. While at it, fix a misspelling of "Nuvoton". Fixes: e4bb55d6ccf0f774 ("reset: Add Nuvoton ma35d1 reset driver support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Ilpo Järvinen Signed-off-by: Arnd Bergmann commit 9f37d3798026f9a7447d851a2cb356610852e426 Author: Mike Leach Date: Fri May 12 14:30:54 2023 +0100 coresight: etm4x: Fix missing trctraceidr file in sysfs The trace ID patchset adjusted the handling of the TRCTRACEIDR register sysfs to allocate on read. Although this was initally correct, the final version of the patch series introduced an error which resulted in the mgmt/trctraceidr file in sysfs not being visible. This patch fixes that issue. Fixes: df4871204e5d ("coresight: etm4x: Update ETM4 driver to use Trace ID API") Reported-by: Junhao He Link: https://lists.linaro.org/archives/list/coresight@lists.linaro.org/thread/KK3CVVMRHJWVUORKMFJRSXYCEDFKENQJ/ Signed-off-by: Mike Leach Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230512133054.235073-1-mike.leach@linaro.org commit 7b355b76e2b32cc516969c01984efdf49b11fc81 Author: Richard Gobert Date: Thu Jun 1 18:14:09 2023 +0200 gro: decrease size of CB The GRO control block (NAPI_GRO_CB) is currently at its maximum size. This commit reduces its size by putting two groups of fields that are used only at different times into a union. Specifically, the fields frag0 and frag0_len are the fields that make up the frag0 optimisation mechanism, which is used during the initial parsing of the SKB. The fields last and age are used after the initial parsing, while the SKB is stored in the GRO list, waiting for other packets to arrive. There was one location in dev_gro_receive that modified the frag0 fields after setting last and age. I changed this accordingly without altering the code behaviour. Signed-off-by: Richard Gobert Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20230601161407.GA9253@debian Signed-off-by: Paolo Abeni commit 412fa1f097f48c8c1321806dd25e46618e0da147 Author: Tvrtko Ursulin Date: Mon Jun 5 14:11:35 2023 +0100 drm/i915/selftests: Add some missing error propagation Add some missing error propagation in live_parallel_switch. To avoid needlessly burdening the various backport processes, note I am not marking it as a fix against any patches and not copying stable since it is debug/selftests only code. Signed-off-by: Tvrtko Ursulin Reported-by: Dan Carpenter Cc: Andi Shyti Reviewed-by: Andi Shyti Fixes: 50d16d44cce4 ("drm/i915/selftests: Exercise context switching in parallel") Fixes: 6407cf533217 ("drm/i915/selftests: Stop using kthread_stop()") Link: https://patchwork.freedesktop.org/patch/msgid/20230605131135.396854-1-tvrtko.ursulin@linux.intel.com commit e894b724c316d9b45d963f929c97578cdffbbe8d Author: Tvrtko Ursulin Date: Mon Jun 5 13:32:24 2023 +0100 drm/i915: Use the fdinfo helper Use the common fdinfo helper for printing the basics. Remove now unused client id allocation code. Signed-off-by: Tvrtko Ursulin Cc: Rob Clark Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230605123224.373633-1-tvrtko.ursulin@linux.intel.com commit 7f8256ae0efba344a9b113036b1d545a1f6cdaa7 Author: Benjamin Gray Date: Tue Jun 6 16:17:41 2023 +1000 initramfs: Encode dependency on KBUILD_BUILD_TIMESTAMP gen_initramfs.sh has an internal dependency on KBUILD_BUILD_TIMESTAMP for generating file mtimes that is not exposed to make, so changing KBUILD_BUILD_TIMESTAMP will not trigger a rebuild of the archive. Declare the mtime date as a new parameter to gen_initramfs.sh to encode KBUILD_BUILD_TIMESTAMP in the shell command, thereby making make aware of the dependency. It will rebuild if KBUILD_BUILD_TIMESTAMP changes or is newly set/unset. It will _not_ rebuild if KBUILD_BUILD_TIMESTAMP is unset before and after. This should be fine for anyone who doesn't care about setting specific build times in the first place. Reviewed-by: Andrew Donnellan Tested-by: Andrew Donnellan Signed-off-by: Benjamin Gray Reviewed-by: Nicolas Schier Signed-off-by: Masahiro Yamada commit 943211c87427f25bd22e0e63849fb486bb5f87fa Author: Siddh Raman Pant Date: Mon Jun 5 20:06:16 2023 +0530 watch_queue: prevent dangling pipe pointer NULL the dangling pipe reference while clearing watch_queue. If not done, a reference to a freed pipe remains in the watch_queue, as this function is called before freeing a pipe in free_pipe_info() (see line 834 of fs/pipe.c). The sole use of wqueue->defunct is for checking if the watch queue has been cleared, but wqueue->pipe is also NULLed while clearing. Thus, wqueue->defunct is superfluous, as wqueue->pipe can be checked for NULL. Hence, the former can be removed. Tested with keyutils testsuite. Cc: stable@vger.kernel.org # 6.1 Signed-off-by: Siddh Raman Pant Acked-by: David Howells Message-Id: <20230605143616.640517-1-code@siddh.me> Signed-off-by: Christian Brauner commit 5c68005083d620b1499fc81926a514d39ae8b88c Merge: 1af3de62f03f6 7877cb91f1081 Author: Miquel Raynal Date: Tue Jun 6 10:42:42 2023 +0200 Merge tag 'v6.4-rc4' into wpan-next/staging Linux 6.4-rc4 commit b9dad156af1fd6c66ffa40f007c09823a8319abe Author: Zhen Lei Date: Tue Jun 6 14:55:43 2023 +0800 mm/slab_common: reduce an if statement in create_cache() Move the 'out:' statement block out of the successful path to avoid redundant check on 'err'. The value of 'err' is always zero on success and negative on failure. No functional changes, no performance improvements, just a little more readability. Signed-off-by: Zhen Lei Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka commit 5416bf1cf5602ab3a38b4c0d15ccec1ca4199633 Author: Peter Zijlstra Date: Tue Jun 6 10:06:14 2023 +0200 arm64/arch_timer: Fix MMIO byteswap The readl_relaxed() to __raw_readl() change meant to loose the instrumentation, but also (inadvertently) lost the byteswap. Fixes: 24ee7607b286 ("arm64/arch_timer: Provide noinstr sched_clock_read() functions") Reported-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland Link: https://lkml.kernel.org/r/20230606080614.GB905437@hirez.programming.kicks-ass.net commit 228020b490eda9133c9cb6f59a5ee1278d8c463f Author: Peter Zijlstra Date: Mon Jun 5 12:14:01 2023 +0200 perf: Re-instate the linear PMU search Full revert of commit 9551fbb64d09 ("perf/core: Remove pmu linear searching code"). Some architectures (notably arm/arm64) still relied on the linear search in order to find the PMU that consumes PERF_TYPE_{HARDWARE,HW_CACHE,RAW}. This will need a more thorought audit and cleanup. Reported-by: Nathan Chancellor Reported-by: Krzysztof Kozlowski Acked-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230605101401.GL38236@hirez.programming.kicks-ass.net commit 134e0dc6b73ab7e99464182356a8b3fa4ea3b499 Author: Giovanni Cabiddu Date: Sat Jun 3 09:28:53 2023 +0100 crypto: qat - add missing function declaration in adf_dbgfs.h The function adf_dbgfs_exit() was improperly named causing the build to fail when CONFIG_DEBUG_FS=n. Rename adf_dbgfs_cleanup() as adf_dbgfs_exit(). This fixes the following build error: CC [M] drivers/crypto/intel/qat/qat_c62x/adf_drv.o drivers/crypto/intel/qat/qat_c62x/adf_drv.c: In function ‘adf_cleanup_accel’: drivers/crypto/intel/qat/qat_c62x/adf_drv.c:69:9: error: implicit declaration of function ‘adf_dbgfs_exit’; did you mean ‘adf_dbgfs_init’? [-Werror=implicit-function-declaration] 69 | adf_dbgfs_exit(accel_dev); | ^~~~~~~~~~~~~~ | adf_dbgfs_init cc1: all warnings being treated as errors make[2]: *** [scripts/Makefile.build:252: drivers/crypto/intel/qat/qat_c62x/adf_drv.o] Error 1 make[1]: *** [scripts/Makefile.build:494: drivers/crypto/intel/qat/qat_c62x] Error 2 make: *** [Makefile:2026: drivers/crypto/intel/qat] Error 2 Fixes: 9260db6640a6 ("crypto: qat - move dbgfs init to separate file") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306030654.5t4qkyN1-lkp@intel.com/ Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit ddb8701dcb67aff0155d507c63cb1e201daf3ad6 Merge: 28cfea989d6f5 5bb3a5cb3e217 Author: Jakub Kicinski Date: Mon Jun 5 20:51:57 2023 -0700 Merge branch 'splice-net-handle-msg_splice_pages-in-af_kcm' David Howells says: ==================== splice, net: Handle MSG_SPLICE_PAGES in AF_KCM Here are patches to make AF_KCM handle the MSG_SPLICE_PAGES internal sendmsg flag. MSG_SPLICE_PAGES is an internal hint that tells the protocol that it should splice the pages supplied if it can. Its sendpage implementation is then turned into a wrapper around that. Does anyone actually use AF_KCM? Upstream it has some issues. It doesn't seem able to handle a "message" longer than 113920 bytes without jamming and doesn't handle the client termination once it is jammed. Link: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=51c78a4d532efe9543a4df019ff405f05c6157f6 # part 1 Link: https://lore.kernel.org/r/20230524144923.3623536-1-dhowells@redhat.com/ # v1 ==================== Link: https://lore.kernel.org/r/20230531110423.643196-1-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit 5bb3a5cb3e217b838e85661f527818e16ce61bec Author: David Howells Date: Wed May 31 12:04:22 2023 +0100 kcm: Convert kcm_sendpage() to use MSG_SPLICE_PAGES Convert kcm_sendpage() to use sendmsg() with MSG_SPLICE_PAGES rather than directly splicing in the pages itself. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Tom Herbert cc: Tom Herbert cc: Cong Wang cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 2b03bcae66c7b29f151e51d3109dbe1e31272235 Author: David Howells Date: Wed May 31 12:04:21 2023 +0100 kcm: Support MSG_SPLICE_PAGES Make AF_KCM sendmsg() support MSG_SPLICE_PAGES. This causes pages to be spliced from the source iterator if possible. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Tom Herbert cc: Tom Herbert cc: Cong Wang cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 95c99104cb42bea5a0874c362f284ae4b91289dd Author: Andrew Jones Date: Tue May 30 19:50:24 2023 +0200 RISC-V: KVM: Probe for SBI extension status Rather than defaulting the status to available and allowing the user to set availability, default to uninitialized and only allow the user to set the status to unavailable. Then, when an extension is first used, ensure it is available by invoking its probe function, if it has one (an extension is assumed available if it doesn't have a probe function). Checking the status in kvm_vcpu_sbi_find_ext() ensures extension functions cannot be invoked when they're unavailable. Signed-off-by: Andrew Jones Reviewed-by: Anup Patel Signed-off-by: Anup Patel commit 9f9e3ebe111c7aabf18a4085648dcc58c568c1d6 Author: Andrew Jones Date: Tue May 30 19:50:23 2023 +0200 RISC-V: KVM: Convert extension_disabled[] to ext_status[] Change the boolean extension_disabled[] array to an array of enums, ext_status[]. For now, the enum only has two states, which correspond to the previous boolean states, so this patch has no intended functional change. The next patch will add another state, expanding the purpose of ext_status[]. Signed-off-by: Andrew Jones Reviewed-by: Anup Patel Signed-off-by: Anup Patel commit ae328dadf9852bc420880d48e341f528b7e0ce78 Author: Andrew Jones Date: Tue May 30 19:50:22 2023 +0200 RISC-V: KVM: Rename dis_idx to ext_idx Make the name of the extension_disabled[] index more general in order to expand its application. Signed-off-by: Andrew Jones Reviewed-by: Anup Patel Signed-off-by: Anup Patel commit 19bff88e65b552f54c191e600498bd50ff47e1ef Author: wchen Date: Sat May 20 23:01:16 2023 +0800 RISC-V: KVM: Redirect AMO load/store misaligned traps to guest The M-mode redirects an unhandled misaligned trap back to S-mode when not delegating it to VS-mode(hedeleg). However, KVM running in HS-mode terminates the VS-mode software when back from M-mode. The KVM should redirect the trap back to VS-mode, and let VS-mode trap handler decide the next step. Here is a way to handle misaligned traps in KVM, not only directing them to VS-mode or terminate it. Signed-off-by: wchen Reviewed-by: Anup Patel Signed-off-by: Anup Patel commit 78329084b86436b9a77cedd3e1331734c442d413 Author: Ye Xingchen Date: Sat May 6 17:10:30 2023 +0800 RISC-V: KVM: use bitmap_zero() API bitmap_zero() is faster than bitmap_clear(), so use bitmap_zero() instead of bitmap_clear(). Signed-off-by: Ye Xingchen Reviewed-by: Anup Patel Signed-off-by: Anup Patel commit 3d272c2fa8045f31879a3beee230c1711367b697 Author: David Vernet Date: Fri Jun 2 09:01:08 2023 -0500 selftests/bpf: Add missing selftests kconfig options Our selftests of course rely on the kernel being built with CONFIG_DEBUG_INFO_BTF=y, though this (nor its dependencies of CONFIG_DEBUG_INFO=y and CONFIG_DEBUG_INFO_DWARF4=y) are not specified. This causes the wrong kernel to be built, and selftests to similarly fail to build. Additionally, in the BPF selftests kconfig file, CONFIG_NF_CONNTRACK_MARK=y is specified, so that the 'u_int32_t mark' field will be present in the definition of struct nf_conn. While a dependency of CONFIG_NF_CONNTRACK_MARK=y, CONFIG_NETFILTER_ADVANCED=y, should be enabled by default, I've run into instances of CONFIG_NF_CONNTRACK_MARK not being set because CONFIG_NETFILTER_ADVANCED isn't set, and have to manually enable them with make menuconfig. Let's add these missing kconfig options to the file so that the necessary dependencies are in place to build vmlinux. Otherwise, we'll get errors like this when we try to compile selftests and generate vmlinux.h: $ cd /path/to/bpf-next $ make mrproper; make defconfig $ cat tools/testing/selftests/config >> .config $ make -j ... $ cd tools/testing/selftests/bpf $ make clean $ make -j ... LD [M] tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.ko tools/testing/selftests/bpf/tools/build/bpftool/bootstrap/bpftool btf dump file vmlinux format c > tools/testing/selftests/bpf/tools/build/bpftool/vmlinux.h libbpf: failed to find '.BTF' ELF section in vmlinux Error: failed to load BTF from bpf-next/vmlinux: No data available make[1]: *** [Makefile:208: tools/testing/selftests/bpf/tools/build/bpftool/vmlinux.h] Error 195 make[1]: *** Deleting file 'tools/testing/selftests/bpf/tools/build/bpftool/vmlinux.h' make: *** [Makefile:261: tools/testing/selftests/bpf/tools/sbin/bpftool] Error 2 Signed-off-by: David Vernet Signed-off-by: Andrii Nakryiko Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20230602140108.1177900-1-void@manifault.com commit 718551bbed3ca5308a9f9429305dd074727e8d46 Author: Matt Roper Date: Thu Jun 1 10:38:04 2023 -0700 drm/i915: Fix error handling if driver creation fails during probe If i915_driver_create() fails to create a valid 'i915' object, we should just disable the PCI device and return immediately without trying to call i915_probe_error() that relies on a valid i915 pointer. Fixes: 12e6f6dc78e4 ("drm/i915/display: Handle GMD_ID identification in display code") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/55236f93-dcc5-481e-b788-9f7e95b129d8@kili.mountain/ Signed-off-by: Matt Roper Reviewed-by: Gustavo Sousa Link: https://patchwork.freedesktop.org/patch/msgid/20230601173804.557756-1-matthew.d.roper@intel.com commit 2d0cdf6020549400d93a3f56f09373ece71c76da Author: Matt Roper Date: Fri Jun 2 11:14:50 2023 -0700 drm/i915/display: Extract display init from intel_device_info_runtime_init Moving display-specific runtime info initialization into display/ makes the display code more self-contained and also makes it easier to call from the Xe driver. v2: - Drop unnecessary display/ prefix from #includes. (Jani) - Clear runtime info if fusing leaves no pipes remaining, the same as we do when fusing indicates the entire display controller is unavailable. (Jani) - Move adjustment of DRIVER_MODESET / DRIVER_ATOMIC after call to intel_display_device_info_runtime_init(); HAS_DISPLAY may have changed to false during the runtime init. (Jani) Cc: Jani Nikula Signed-off-by: Matt Roper Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230602181450.1151368-1-matthew.d.roper@intel.com commit 06f45435d985d60d7d2fe2424fbb9909d177a63d Author: Takashi Sakamoto Date: Sun Jun 4 16:02:55 2023 +0900 firewire: core: obsolete usage of GFP_ATOMIC at building node tree The flag of GFP_ATOMIC is given to the call of kmalloc when building node tree, but the call is not atomic context. The call of fw_core_handle_bus_reset() and fw_core_remove_card() builds the tree, while they are done in specific workqueue or pci remove callback. This commit obsolete the usage of GFP_ATOMIC. Link: https://lore.kernel.org/r/20230604070255.172700-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 5716e58aecdd4f7225c2e46ce903a839fc54f22f Author: Takashi Sakamoto Date: Sun Jun 4 14:44:51 2023 +0900 firewire: ohci: release buffer for AR req/resp contexts when managed resource is released The 1394 OHCI driver allocates several non-coherent DMA buffers for AR request and response contexts. The buffers are mapped to kernel virtual address (VMA) so that the first page locates after the last page. Even when large payload of packet is handled crossing the boundary of buffers, the driver operates continuously on VMA. No kernel API is provided for this kind of mapping, while it is possible to release the buffer when PCI device is going to be released. This commit moves the call of release helper function to the callback function of release resources. Link: https://lore.kernel.org/r/20230604054451.161076-10-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit aeaf6aa8647182892f6bd63c5ae9faf4e73cbad0 Author: Takashi Sakamoto Date: Sun Jun 4 14:44:50 2023 +0900 firewire: ohci: use devres for content of configuration ROM The 1394 OHCI driver allocates DMA coherent buffer to transfer content of configuration ROM. This commit utilizes managed device resource to maintain the lifetime of buffer. Link: https://lore.kernel.org/r/20230604054451.161076-9-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit aa71e28d757244166c9ff50e4bc85cd83f2956fe Author: Takashi Sakamoto Date: Sun Jun 4 14:44:49 2023 +0900 firewire: ohci: use devres for IT, IR, AT/receive, and AT/request contexts The 1394 OHCI driver allocates DMA coherent buffer for descriptors of IT, IR, AT receive, and AT request contexts by the same way. This commit utilizes managed device resource to maintain the lifetime of buffers. Link: https://lore.kernel.org/r/20230604054451.161076-8-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 30d97fd7e30b6ba8ecef15c43797f90dad56ddab Author: Takashi Sakamoto Date: Sun Jun 4 14:44:48 2023 +0900 firewire: ohci: use devres for list of isochronous contexts The 1394 OHCI driver allocates the list of isochronous contexts as much as the hardware supports. This commit utilizes managed device resource to maintain the lifetime of list. Link: https://lore.kernel.org/r/20230604054451.161076-7-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 5a95f1ded28691e69f7d6718c5dcbc149613d431 Author: Takashi Sakamoto Date: Sun Jun 4 14:44:47 2023 +0900 firewire: ohci: use devres for requested IRQ The 1394 OHCI controller register handler to single interrupt number. This commit uses managed device resource to maintain the lifetime of requested IRQ. Link: https://lore.kernel.org/r/20230604054451.161076-6-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 8320442b264a8d49b08f2730d63a39b2e0c146f8 Author: Takashi Sakamoto Date: Sun Jun 4 14:44:46 2023 +0900 firewire: ohci: use devres for misc DMA buffer The 1394 OHCI driver allocates a DMA coherent buffer for multi-purposes. The buffer is split into three region for specific purposes; i.e. 1/4 for context descriptors of AR request and response as well as 1/2 for self ID handling. This commit uses managed device resource to maintain the lifetime of buffer. Link: https://lore.kernel.org/r/20230604054451.161076-5-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 086a0afbe9bbcdf7e12cdc7e317a57f49fa35207 Author: Takashi Sakamoto Date: Sun Jun 4 14:44:45 2023 +0900 firewire: ohci: use devres for MMIO region mapping The PCI framework has the convenient helper function to check and map MMIO region with managed device resource. This commit elaborates 1394 OHCI driver to use the function. Link: https://lore.kernel.org/r/20230604054451.161076-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 14f6ca5b6ae759046fdc461633043bb05ff6de58 Author: Takashi Sakamoto Date: Sun Jun 4 14:44:44 2023 +0900 firewire: ohci: use devres for PCI-related resources The PCI framework supports managed device resource to maintain the lifetime of PCI specific resources. This commit allows 1394 OHCI driver to utilize it. Link: https://lore.kernel.org/r/20230604054451.161076-3-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit f86319c02c3c5253ddebc21e81271c83421aaeb9 Author: Takashi Sakamoto Date: Sun Jun 4 14:44:43 2023 +0900 firewire: ohci: use devres for memory object of ohci structure The managed device resource (devres) framework is convenient to maintain lifetime of allocated memory object for device. This commit utilizes the framework for the object of ohci structure. The extra operation for power management is required in Apple PowerMac based machines, thus release callback is assigned to the object to call the operation. Link: https://lore.kernel.org/r/20230604054451.161076-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 0258d889a7ee28310dbe3f5d4d039b48a1d080ad Author: Takashi Sakamoto Date: Thu Jun 1 23:49:37 2023 +0900 firewire: fix warnings to generate UAPI documentation Any target to generate UAPI documentation reports warnings to missing annotation for padding member in structures added recently. This commit suppresses the warnings. Reported-by: Stephen Rothwell Closes: https://lore.kernel.org/lkml/20230531135306.43613a59@canb.auug.org.au/ Fixes: 7c22d4a92bb2 ("firewire: cdev: add new event to notify request subaction with time stamp") Fixes: fc2b52cf2e0e ("firewire: cdev: add new event to notify response subaction with time stamp") Link: https://lore.kernel.org/r/20230601144937.121179-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit edd75c802855271c8610f58a2fc9e54aefc49ce5 Author: Viktor Malik Date: Tue May 30 14:33:52 2023 +0200 tools/resolve_btfids: Fix setting HOSTCFLAGS Building BPF selftests with custom HOSTCFLAGS yields an error: # make HOSTCFLAGS="-O2" [...] HOSTCC ./tools/testing/selftests/bpf/tools/build/resolve_btfids/main.o main.c:73:10: fatal error: linux/rbtree.h: No such file or directory 73 | #include | ^~~~~~~~~~~~~~~~ The reason is that tools/bpf/resolve_btfids/Makefile passes header include paths by extending HOSTCFLAGS which is overridden by setting HOSTCFLAGS in the make command (because of Makefile rules [1]). This patch fixes the above problem by passing the include paths via `HOSTCFLAGS_resolve_btfids` which is used by tools/build/Build.include and can be combined with overridding HOSTCFLAGS. [1] https://www.gnu.org/software/make/manual/html_node/Overriding.html Fixes: 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host program") Signed-off-by: Viktor Malik Signed-off-by: Andrii Nakryiko Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20230530123352.1308488-1-vmalik@redhat.com commit 28cfea989d6f55c3d10608eba2a2bae609c5bf3e Merge: c422ac94e6daa e2a82bf8a4281 Author: Jakub Kicinski Date: Mon Jun 5 15:42:22 2023 -0700 Merge tag 'mlx5-updates-2023-05-31' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2023-05-31 net/mlx5: Support 4 ports VF LAG, part 1/2 This series continues the series[1] "Support 4 ports HCAs LAG mode" by Mark Bloch. This series adds support for 4 ports VF LAG (single FDB E-Switch). This series of patches focuses on refactoring different sections of the code that make assumptions about VF LAG supporting only two ports. For instance, it assumes that each device can only have one peer. Patches 1-5: - Refactor ETH handling of TC rules of eswitches with peers. Patch 6: - Refactors peer miss group table. Patches 7-9: - Refactor single FDB E-Switch creation. Patch 10: - Refactor the DR layer. Patches 11-14: - Refactors devcom layer. Next series will refactor LAG layer and enable 4 ports VF LAG. This series specifically allows HCAs with 4 ports to create a VF LAG with only 4 ports. It is not possible to create a VF LAG with 2 or 3 ports using HCAs that have 4 ports. Currently, the Merged E-Switch feature only supports HCAs with 2 ports. However, upcoming patches will introduce support for HCAs with 4 ports. In order to activate VF LAG a user can execute: devlink dev eswitch set pci/0000:08:00.0 mode switchdev devlink dev eswitch set pci/0000:08:00.1 mode switchdev devlink dev eswitch set pci/0000:08:00.2 mode switchdev devlink dev eswitch set pci/0000:08:00.3 mode switchdev ip link add name bond0 type bond ip link set dev bond0 type bond mode 802.3ad ip link set dev eth2 master bond0 ip link set dev eth3 master bond0 ip link set dev eth4 master bond0 ip link set dev eth5 master bond0 Where eth2, eth3, eth4 and eth5 are net-interfaces of pci/0000:08:00.0 pci/0000:08:00.1 pci/0000:08:00.2 pci/0000:08:00.3 respectively. User can verify LAG state and type via debugfs: /sys/kernel/debug/mlx5/0000\:08\:00.0/lag/state /sys/kernel/debug/mlx5/0000\:08\:00.0/lag/type [1] https://lore.kernel.org/netdev/20220510055743.118828-1-saeedm@nvidia.com/ * tag 'mlx5-updates-2023-05-31' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5: Devcom, extend mlx5_devcom_send_event to work with more than two devices net/mlx5: Devcom, introduce devcom_for_each_peer_entry net/mlx5: E-switch, mark devcom as not ready when all eswitches are unpaired net/mlx5: Devcom, Rename paired to ready net/mlx5: DR, handle more than one peer domain net/mlx5: E-switch, generalize shared FDB creation net/mlx5: E-switch, Handle multiple master egress rules net/mlx5: E-switch, refactor FDB miss rule add/remove net/mlx5: E-switch, enlarge peer miss group table net/mlx5e: Handle offloads flows per peer net/mlx5e: en_tc, re-factor query route port net/mlx5e: rep, store send to vport rules per peer net/mlx5e: tc, Refactor peer add/del flow net/mlx5e: en_tc, Extend peer flows to a list ==================== Link: https://lore.kernel.org/r/20230602191301.47004-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit b2f10148ec1eae7d63dd6a1a56afdf93a27daa74 Author: Andy Shevchenko Date: Mon Jun 5 20:05:53 2023 +0300 kobject: Use return value of strreplace() Since strreplace() returns the pointer to the string itself, we may use it directly in the code. Signed-off-by: Andy Shevchenko Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230605170553.7835-4-andriy.shevchenko@linux.intel.com commit d01a77afd6bef1b3a2ed15e8ca6887ca7da0cddc Author: Andy Shevchenko Date: Mon Jun 5 20:05:52 2023 +0300 lib/string_helpers: Change returned value of the strreplace() It's more useful to return the pointer to the string itself with strreplace(), so it may be used like attr->name = strreplace(name, '/', '_'); While at it, amend the kernel documentation. Signed-off-by: Andy Shevchenko Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230605170553.7835-3-andriy.shevchenko@linux.intel.com commit 7afb6d8fa81fd8d332f70ead5e35d8c90abb8165 Author: Andy Shevchenko Date: Mon Jun 5 20:05:51 2023 +0300 jbd2: Avoid printing outside the boundary of the buffer Theoretically possible that "%pg" will take all room for the j_devname and hence the "-%lu" will go outside the boundary due to unconditional sprintf() in use. To make this code more robust, replace two sequential s*printf():s by a single call and then replace forbidden character. It's possible to do this way, because '/' won't ever be in the result of "-%lu". Reviewed-by: Jan Kara Signed-off-by: Andy Shevchenko Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230605170553.7835-2-andriy.shevchenko@linux.intel.com commit 8515e4a746fcb888fa6c320242eccf4c1d402465 Author: Kees Cook Date: Wed May 17 13:45:37 2023 -0700 checkpatch: Check for 0-length and 1-element arrays Fake flexible arrays have been deprecated since last millennium. Proper C99 flexible arrays must be used throughout the kernel so CONFIG_FORTIFY_SOURCE and CONFIG_UBSAN_BOUNDS can provide proper array bounds checking. Cc: Andy Whitcroft Cc: Dwaipayan Ray Cc: Lukas Bulwahn Fixed-by: Joe Perches Signed-off-by: Kees Cook Acked-by: Gustavo A. R. Silva Acked-by: Joe Perches Link: https://lore.kernel.org/r/20230517204530.never.151-kees@kernel.org commit 8762606ae22e71ec65249cdbf809e3dc7ea8ea1e Author: Kees Cook Date: Thu Jun 1 09:00:28 2023 -0700 riscv/purgatory: Do not use fortified string functions With the addition of -fstrict-flex-arrays=3, struct sha256_state's trailing array is no longer ignored by CONFIG_FORTIFY_SOURCE: struct sha256_state { u32 state[SHA256_DIGEST_SIZE / 4]; u64 count; u8 buf[SHA256_BLOCK_SIZE]; }; This means that the memcpy() calls with "buf" as a destination in sha256.c's code will attempt to perform run-time bounds checking, which could lead to calling missing functions, specifically a potential WARN_ONCE, which isn't callable from purgatory. Reported-by: Thorsten Leemhuis Closes: https://lore.kernel.org/lkml/175578ec-9dec-7a9c-8d3a-43f24ff86b92@leemhuis.info/ Bisected-by: "Joan Bruguera Micó" Fixes: df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Masahiro Yamada Cc: Conor Dooley Cc: Nick Desaulniers Cc: Alyssa Ross Cc: Heiko Stuebner Cc: "Gustavo A. R. Silva" Cc: linux-riscv@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Conor Dooley Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230601160025.gonna.868-kees@kernel.org commit c422ac94e6daa3607319a08be89f133cb48aa42b Merge: 69da40ac34819 acd8f0e5d7274 Author: Jakub Kicinski Date: Mon Jun 5 15:28:45 2023 -0700 Merge branch 'drm-i915-use-ref_tracker-library-for-tracking-wakerefs' Andrzej Hajda says: ==================== drm/i915: use ref_tracker library for tracking wakerefs This is reviewed series of ref_tracker patches, ready to merge via network tree, rebased on net-next/main. i915 patches will be merged later via intel-gfx tree. ==================== Merge on top of an -rc tag in case it's needed in another tree. Link: https://lore.kernel.org/r/20230224-track_gt-v9-0-5b47a33f55d1@intel.com Signed-off-by: Jakub Kicinski commit acd8f0e5d72741bee715867e8185e3d57ca93703 Author: Andrzej Hajda Date: Fri Jun 2 12:21:36 2023 +0200 lib/ref_tracker: remove warnings in case of allocation failure Library can handle allocation failures. To avoid allocation warnings __GFP_NOWARN has been added everywhere. Moreover GFP_ATOMIC has been replaced with GFP_NOWAIT in case of stack allocation on tracker free call. Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 227c6c832303cec3941166d3335ecbccd980d615 Author: Andrzej Hajda Date: Fri Jun 2 12:21:35 2023 +0200 lib/ref_tracker: add printing to memory buffer Similar to stack_(depot|trace)_snprint the patch adds helper to printing stats to memory buffer. It will be helpful in case of debugfs. Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit b6d7c0eb2dcbd238fa233a3a1737654e380e784a Author: Andrzej Hajda Date: Fri Jun 2 12:21:34 2023 +0200 lib/ref_tracker: improve printing stats In case the library is tracking busy subsystem, simply printing stack for every active reference will spam log with long, hard to read, redundant stack traces. To improve readabilty following changes have been made: - reports are printed per stack_handle - log is more compact, - added display name for ref_tracker_dir - it will differentiate multiple subsystems, - stack trace is printed indented, in the same printk call, - info about dropped references is printed as well. Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 7a113ff6355944283402fb617dc97122f68d5a41 Author: Andrzej Hajda Date: Fri Jun 2 12:21:33 2023 +0200 lib/ref_tracker: add unlocked leak print helper To have reliable detection of leaks, caller must be able to check under the same lock both: tracked counter and the leaks. dir.lock is natural candidate for such lock and unlocked print helper can be called with this lock taken. As a bonus we can reuse this helper in ref_tracker_dir_exit. Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit f904c67876c42c14a108d7f80459ef59d900b8fc Author: David Vernet Date: Fri Jun 2 10:01:12 2023 -0500 selftests/bpf: Add test for non-NULLable PTR_TO_BTF_IDs In a recent patch, we taught the verifier that trusted PTR_TO_BTF_ID can never be NULL. This prevents the verifier from incorrectly failing to load certain programs where it gets confused and thinks a reference isn't dropped because it incorrectly assumes that a branch exists in which a NULL PTR_TO_BTF_ID pointer is never released. This patch adds a testcase that verifies this cannot happen. Signed-off-by: David Vernet Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20230602150112.1494194-2-void@manifault.com Signed-off-by: Alexei Starovoitov commit 51302c951c8fd5c298565c7127c855bf1d4550b6 Author: David Vernet Date: Fri Jun 2 10:01:11 2023 -0500 bpf: Teach verifier that trusted PTR_TO_BTF_ID pointers are non-NULL In reg_type_not_null(), we currently assume that a pointer may be NULL if it has the PTR_MAYBE_NULL modifier, or if it doesn't belong to one of several base type of pointers that are never NULL-able. For example, PTR_TO_CTX, PTR_TO_MAP_VALUE, etc. It turns out that in some cases, PTR_TO_BTF_ID can never be NULL as well, though we currently don't specify it. For example, if you had the following program: SEC("tc") long example_refcnt_fail(void *ctx) { struct bpf_cpumask *mask1, *mask2; mask1 = bpf_cpumask_create(); mask2 = bpf_cpumask_create(); if (!mask1 || !mask2) goto error_release; bpf_cpumask_test_cpu(0, (const struct cpumask *)mask1); bpf_cpumask_test_cpu(0, (const struct cpumask *)mask2); error_release: if (mask1) bpf_cpumask_release(mask1); if (mask2) bpf_cpumask_release(mask2); return ret; } The verifier will incorrectly fail to load the program, thinking (unintuitively) that we have a possibly-unreleased reference if the mask is NULL, because we (correctly) don't issue a bpf_cpumask_release() on the NULL path. The reason the verifier gets confused is due to the fact that we don't explicitly tell the verifier that trusted PTR_TO_BTF_ID pointers can never be NULL. Basically, if we successfully get past the if check (meaning both pointers go from ptr_or_null_bpf_cpumask to ptr_bpf_cpumask), the verifier will correctly assume that the references need to be dropped on any possible branch that leads to program exit. However, it will _incorrectly_ think that the ptr == NULL branch is possible, and will erroneously detect it as a branch on which we failed to drop the reference. The solution is of course to teach the verifier that trusted PTR_TO_BTF_ID pointers can never be NULL, so that it doesn't incorrectly think it's possible for the reference to be present on the ptr == NULL branch. A follow-on patch will add a selftest that verifies this behavior. Signed-off-by: David Vernet Link: https://lore.kernel.org/r/20230602150112.1494194-1-void@manifault.com Signed-off-by: Alexei Starovoitov commit 503e4def5414fd0f9b6ffecb6eedbc4b1603693b Author: Daniel T. Lee Date: Sat May 27 21:27:06 2023 +0900 bpf: Replace open code with for allocated object check >From commit 282de143ead9 ("bpf: Introduce allocated objects support"), With this allocated object with BPF program, (PTR_TO_BTF_ID | MEM_ALLOC) has been a way of indicating to check the type is the allocated object. commit d8939cb0a03c ("bpf: Loosen alloc obj test in verifier's reg_btf_record") >From the commit, there has been helper function for checking this, named type_is_ptr_alloc_obj(). But still, some of the code use open code to retrieve this info. This commit replaces the open code with the type_is_alloc(), and the type_is_ptr_alloc_obj() function. Signed-off-by: Daniel T. Lee Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230527122706.59315-1-danieltimlee@gmail.com commit 447a5688005e5b789633bd080016517a08f9fd8d Author: Christian Göttsche Date: Fri Jun 2 15:35:10 2023 +0200 selinux: avoid bool as identifier name Avoid using the identifier `bool` to improve support with future C standards. C23 is about to make `bool` a predefined macro (see N2654). Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 411486626e5779bd85439282985ff3fc25a3f6d2 Author: Jesper Dangaard Brouer Date: Thu Jun 1 18:21:54 2023 +0200 bpf/xdp: optimize bpf_xdp_pointer to avoid reading sinfo Currently we observed a significant performance degradation in samples/bpf xdp1 and xdp2, due XDP multibuffer "xdp.frags" handling, added in commit 772251742262 ("samples/bpf: fixup some tools to be able to support xdp multibuffer"). This patch reduce the overhead by avoiding to read/load shared_info (sinfo) memory area, when XDP packet don't have any frags. This improves performance because sinfo is located in another cacheline. Function bpf_xdp_pointer() is used by BPF helpers bpf_xdp_load_bytes() and bpf_xdp_store_bytes(). As a help to reviewers, xdp_get_buff_len() can potentially access sinfo, but it uses xdp_buff_has_frags() flags bit check to avoid accessing sinfo in no-frags case. The likely/unlikely instrumentation lays out asm code such that sinfo access isn't interleaved with no-frags case (checked on GCC 12.2.1-4). The generated asm code is more compact towards the no-frags case. The BPF kfunc bpf_dynptr_slice() also use bpf_xdp_pointer(). Thus, it should also take effect for that. Signed-off-by: Jesper Dangaard Brouer Acked-by: Lorenzo Bianconi Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/168563651438.3436004.17735707525651776648.stgit@firesoul Signed-off-by: Alexei Starovoitov commit 0dad9b072b2b170a99fcefa330a1a3193d503d8c Author: Miaohe Lin Date: Sat Jun 3 15:13:04 2023 +0800 cgroup: make cgroup_is_threaded() and cgroup_is_thread_root() static They're only called inside cgroup.c. Make them static. Signed-off-by: Miaohe Lin Signed-off-by: Tejun Heo commit 7793fc3babe9fea908e57f7c187ea819f9fd7e95 Author: Dave Marchevsky Date: Thu Jun 1 19:26:42 2023 -0700 bpf: Make bpf_refcount_acquire fallible for non-owning refs This patch fixes an incorrect assumption made in the original bpf_refcount series [0], specifically that the BPF program calling bpf_refcount_acquire on some node can always guarantee that the node is alive. In that series, the patch adding failure behavior to rbtree_add and list_push_{front, back} breaks this assumption for non-owning references. Consider the following program: n = bpf_kptr_xchg(&mapval, NULL); /* skip error checking */ bpf_spin_lock(&l); if(bpf_rbtree_add(&t, &n->rb, less)) { bpf_refcount_acquire(n); /* Failed to add, do something else with the node */ } bpf_spin_unlock(&l); It's incorrect to assume that bpf_refcount_acquire will always succeed in this scenario. bpf_refcount_acquire is being called in a critical section here, but the lock being held is associated with rbtree t, which isn't necessarily the lock associated with the tree that the node is already in. So after bpf_rbtree_add fails to add the node and calls bpf_obj_drop in it, the program has no ownership of the node's lifetime. Therefore the node's refcount can be decr'd to 0 at any time after the failing rbtree_add. If this happens before the refcount_acquire above, the node might be free'd, and regardless refcount_acquire will be incrementing a 0 refcount. Later patches in the series exercise this scenario, resulting in the expected complaint from the kernel (without this patch's changes): refcount_t: addition on 0; use-after-free. WARNING: CPU: 1 PID: 207 at lib/refcount.c:25 refcount_warn_saturate+0xbc/0x110 Modules linked in: bpf_testmod(O) CPU: 1 PID: 207 Comm: test_progs Tainted: G O 6.3.0-rc7-02231-g723de1a718a2-dirty #371 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 RIP: 0010:refcount_warn_saturate+0xbc/0x110 Code: 6f 64 f6 02 01 e8 84 a3 5c ff 0f 0b eb 9d 80 3d 5e 64 f6 02 00 75 94 48 c7 c7 e0 13 d2 82 c6 05 4e 64 f6 02 01 e8 64 a3 5c ff <0f> 0b e9 7a ff ff ff 80 3d 38 64 f6 02 00 0f 85 6d ff ff ff 48 c7 RSP: 0018:ffff88810b9179b0 EFLAGS: 00010082 RAX: 0000000000000000 RBX: 0000000000000002 RCX: 0000000000000000 RDX: 0000000000000202 RSI: 0000000000000008 RDI: ffffffff857c3680 RBP: ffff88810027d3c0 R08: ffffffff8125f2a4 R09: ffff88810b9176e7 R10: ffffed1021722edc R11: 746e756f63666572 R12: ffff88810027d388 R13: ffff88810027d3c0 R14: ffffc900005fe030 R15: ffffc900005fe048 FS: 00007fee0584a700(0000) GS:ffff88811b280000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005634a96f6c58 CR3: 0000000108ce9002 CR4: 0000000000770ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: bpf_refcount_acquire_impl+0xb5/0xc0 (rest of output snipped) The patch addresses this by changing bpf_refcount_acquire_impl to use refcount_inc_not_zero instead of refcount_inc and marking bpf_refcount_acquire KF_RET_NULL. For owning references, though, we know the above scenario is not possible and thus that bpf_refcount_acquire will always succeed. Some verifier bookkeeping is added to track "is input owning ref?" for bpf_refcount_acquire calls and return false from is_kfunc_ret_null for bpf_refcount_acquire on owning refs despite it being marked KF_RET_NULL. Existing selftests using bpf_refcount_acquire are modified where necessary to NULL-check its return value. [0]: https://lore.kernel.org/bpf/20230415201811.343116-1-davemarchevsky@fb.com/ Fixes: d2dcc67df910 ("bpf: Migrate bpf_rbtree_add and bpf_list_push_{front,back} to possibly fail") Reported-by: Kumar Kartikeya Dwivedi Signed-off-by: Dave Marchevsky Link: https://lore.kernel.org/r/20230602022647.1571784-5-davemarchevsky@fb.com Signed-off-by: Alexei Starovoitov commit cc0d76cafebbd3e1ffab9c4252d48ecc9e0737f6 Author: Dave Marchevsky Date: Thu Jun 1 19:26:41 2023 -0700 bpf: Fix __bpf_{list,rbtree}_add's beginning-of-node calculation Given the pointer to struct bpf_{rb,list}_node within a local kptr and the byte offset of that field within the kptr struct, the calculation changed by this patch is meant to find the beginning of the kptr so that it can be passed to bpf_obj_drop. Unfortunately instead of doing ptr_to_kptr = ptr_to_node_field - offset_bytes the calculation is erroneously doing ptr_to_ktpr = ptr_to_node_field - (offset_bytes * sizeof(struct bpf_rb_node)) or the bpf_list_node equivalent. This patch fixes the calculation. Fixes: d2dcc67df910 ("bpf: Migrate bpf_rbtree_add and bpf_list_push_{front,back} to possibly fail") Signed-off-by: Dave Marchevsky Link: https://lore.kernel.org/r/20230602022647.1571784-4-davemarchevsky@fb.com Signed-off-by: Alexei Starovoitov commit 2140a6e3422de22e6ebe77d4d18b6c0c9c425426 Author: Dave Marchevsky Date: Thu Jun 1 19:26:40 2023 -0700 bpf: Set kptr_struct_meta for node param to list and rbtree insert funcs In verifier.c, fixup_kfunc_call uses struct bpf_insn_aux_data's kptr_struct_meta field to pass information about local kptr types to various helpers and kfuncs at runtime. The recent bpf_refcount series added a few functions to the set that need this information: * bpf_refcount_acquire * Needs to know where the refcount field is in order to increment * Graph collection insert kfuncs: bpf_rbtree_add, bpf_list_push_{front,back} * Were migrated to possibly fail by the bpf_refcount series. If insert fails, the input node is bpf_obj_drop'd. bpf_obj_drop needs the kptr_struct_meta in order to decr refcount and properly free special fields. Unfortunately the verifier handling of collection insert kfuncs was not modified to actually populate kptr_struct_meta. Accordingly, when the node input to those kfuncs is passed to bpf_obj_drop, it is done so without the information necessary to decr refcount. This patch fixes the issue by populating kptr_struct_meta for those kfuncs. Fixes: d2dcc67df910 ("bpf: Migrate bpf_rbtree_add and bpf_list_push_{front,back} to possibly fail") Signed-off-by: Dave Marchevsky Link: https://lore.kernel.org/r/20230602022647.1571784-3-davemarchevsky@fb.com Signed-off-by: Alexei Starovoitov commit 06b66e050095db599f4f598ee627d1dc9c933018 Author: Binbin Wu Date: Thu May 18 17:13:39 2023 +0800 KVM: x86: Fix a typo in Documentation/virt/kvm/x86/mmu.rst L1 CR4.LA57 should be '0' instead of '1' when shadowing 5-level NPT for 4-level NPT L1 guest. Signed-off-by: Binbin Wu Link: https://lore.kernel.org/r/20230518091339.1102-4-binbin.wu@linux.intel.com Signed-off-by: Sean Christopherson commit c20d4d889fc65bedd52430710ff7428bf32944fd Author: Gaosheng Cui Date: Fri Jun 2 15:44:56 2023 +0800 rdmacg: fix kernel-doc warnings in rdmacg Fix all kernel-doc warnings in rdmacg: kernel/cgroup/rdma.c:209: warning: Function parameter or member 'cg' not described in 'rdmacg_uncharge_hierarchy' kernel/cgroup/rdma.c:230: warning: Function parameter or member 'cg' not described in 'rdmacg_uncharge' Signed-off-by: Gaosheng Cui Signed-off-by: Tejun Heo commit 7bf11e90a30afcf79ff1acf28b01c6455799861a Author: Gaosheng Cui Date: Fri Jun 2 15:43:46 2023 +0800 cgroup: Replace the css_set call with cgroup_get We will release the refcnt of cgroup via cgroup_put, for example in the cgroup_lock_and_drain_offline function, so replace css_get with the cgroup_get function for better readability. Signed-off-by: Gaosheng Cui Signed-off-by: Tejun Heo commit 22725266bdf95bddd01a23841097492489dfc9d9 Author: Binbin Wu Date: Thu May 18 17:13:37 2023 +0800 KVM: Fix comment for KVM_ENABLE_CAP Fix comment for vcpu ioctl version of KVM_ENABLE_CAP. KVM provides ioctl KVM_ENABLE_CAP to allow userspace to enable an extension which is not enabled by default. For vcpu ioctl version, it is available with the capability KVM_CAP_ENABLE_CAP. For vm ioctl version, it is available with the capability KVM_CAP_ENABLE_CAP_VM. Signed-off-by: Binbin Wu Link: https://lore.kernel.org/r/20230518091339.1102-2-binbin.wu@linux.intel.com Signed-off-by: Sean Christopherson commit a49a11dc6449a7e1370441bc23d83d528787066d Author: Miaohe Lin Date: Sat May 27 17:33:53 2023 +0800 cgroup: remove unused macro for_each_e_css() for_each_e_css() is unused now. Remove it. Signed-off-by: Miaohe Lin Reviewed-by: Yosry Ahmed Reviewed-by: Michal Koutný Signed-off-by: Tejun Heo commit 7d0583cf9ec7bf8e5897dc7d3a7059e8fae5464a Author: Dietmar Eggemann Date: Mon May 15 13:57:35 2023 +0200 sched/fair, cpufreq: Introduce 'runnable boosting' The responsiveness of the Per Entity Load Tracking (PELT) util_avg in mobile devices is still considered too low for utilization changes during task ramp-up. In Android this manifests in the fact that the first frames of a UI activity are very prone to be jankframes (a frame which doesn't meet the required frame rendering time, e.g. 16ms@60Hz) since the CPU frequency is normally low at this point and has to ramp up quickly. The beginning of an UI activity is also characterized by the occurrence of CPU contention, especially on little CPUs. Current little CPUs can have an original CPU capacity of only ~ 150 which means that the actual CPU capacity at lower frequency can even be much smaller. Schedutil maps CPU util_avg into CPU frequency request via: util = effective_cpu_util(..., cpu_util_cfs(cpu), ...) -> util = map_util_perf(util) -> freq = map_util_freq(util, ...) CPU contention for CFS tasks can be detected by 'CPU runnable > CPU utililization' in cpu_util_cfs_boost() -> cpu_util(..., boost = 1). Schedutil uses 'runnable boosting' by calling cpu_util_cfs_boost(). To be in sync with schedutil's CPU frequency selection, Energy Aware Scheduling (EAS) also calls cpu_util(..., boost = 1) during max util detection. Moreover, 'runnable boosting' is also used in load-balance for busiest CPU selection when the migration type is 'migrate_util', i.e. only at sched domains which don't have the SD_SHARE_PKG_RESOURCES flag set. Suggested-by: Vincent Guittot Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20230515115735.296329-3-dietmar.eggemann@arm.com commit 3eb6d6ececca2fd566d717b37ab467c246f66be7 Author: Dietmar Eggemann Date: Mon May 15 13:57:34 2023 +0200 sched/fair: Refactor CPU utilization functions There is a lot of code duplication in cpu_util_next() & cpu_util_cfs(). Remove this by allowing cpu_util_next() to be called with p = NULL. Rename cpu_util_next() to cpu_util() since the '_next' suffix is no longer necessary to distinct cpu utilization related functions. Implement cpu_util_cfs(cpu) as cpu_util(cpu, p = NULL, -1). This will allow to code future related cpu util changes only in one place, namely in cpu_util(). Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20230515115735.296329-2-dietmar.eggemann@arm.com commit e6a15fa9ea8372ad4db973191233f743ae1081d5 Author: Peter Zijlstra Date: Fri May 19 12:21:11 2023 +0200 cpuidle: Use local_clock_noinstr() With the introduction of local_clock_noinstr(), local_clock() itself is no longer marked noinstr, use the correct function. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rafael J. Wysocki Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102716.045980863@infradead.org commit fb7d4948c4da2dbd26da4b7ec76bbd2f19ff862a Author: Peter Zijlstra Date: Fri May 19 12:21:10 2023 +0200 sched/clock: Provide local_clock_noinstr() Now that all ARCH_WANTS_NO_INSTR architectures (arm64, loongarch, s390, x86) provide sched_clock_noinstr(), use this to provide local_clock_noinstr(). This local_clock_noinstr() will be safe to use from noinstr code with the assumption that any such noinstr code is non-preemptible (it had better be, entry code will have IRQs disabled while __cpuidle must have preemption disabled). Specifically, preempt_enable_notrace(), a common part of many a sched_clock() implementation calls out to schedule() -- even though, per the above, it will never trigger -- which frustrates noinstr validation. vmlinux.o: warning: objtool: local_clock+0xb5: call to preempt_schedule_notrace_thunk() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.978624636@infradead.org commit 5c5e9a2b25b6a79d4b7a5f2a54d02ef1c36dc35a Author: Peter Zijlstra Date: Fri May 19 12:21:09 2023 +0200 x86/tsc: Provide sched_clock_noinstr() With the intent to provide local_clock_noinstr(), a variant of local_clock() that's safe to be called from noinstr code (with the assumption that any such code will already be non-preemptible), prepare for things by providing a noinstr sched_clock_noinstr() function. Specifically, preempt_enable_*() calls out to schedule(), which upsets noinstr validation efforts. vmlinux.o: warning: objtool: native_sched_clock+0x96: call to preempt_schedule_notrace_thunk() leaves .noinstr.text section vmlinux.o: warning: objtool: kvm_clock_read+0x22: call to preempt_schedule_notrace_thunk() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.910937674@infradead.org commit e39acc37db34f6688e2c16e958fb1d662c422c81 Author: Peter Zijlstra Date: Fri May 19 12:21:08 2023 +0200 clocksource: hyper-v: Provide noinstr sched_clock() With the intent to provide local_clock_noinstr(), a variant of local_clock() that's safe to be called from noinstr code (with the assumption that any such code will already be non-preemptible), prepare for things by making the Hyper-V TSC and MSR sched_clock implementations noinstr. Signed-off-by: Peter Zijlstra (Intel) Co-developed-by: Michael Kelley Signed-off-by: Michael Kelley Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.843039089@infradead.org commit 9397fa2ea3e7634f61da1ab76b9eb88ba04dfdfc Author: Peter Zijlstra Date: Fri May 19 12:21:07 2023 +0200 clocksource: hyper-v: Adjust hv_read_tsc_page_tsc() to avoid special casing U64_MAX Currently hv_read_tsc_page_tsc() (ab)uses the (valid) time value of U64_MAX as an error return. This breaks the clean wrap-around of the clock. Modify the function signature to return a boolean state and provide another u64 pointer to store the actual time on success. This obviates the need to steal one time value and restores the full counter width. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Michael Kelley Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.775630881@infradead.org commit 77750f78b0b3247c64b9821b49158cafe0506880 Author: Peter Zijlstra Date: Fri May 19 12:21:06 2023 +0200 x86/vdso: Fix gettimeofday masking Because of how the virtual clocks use U64_MAX as an exception value instead of a valid time, the clocks can no longer be assumed to wrap cleanly. This is then compounded by arch_vdso_cycles_ok() rejecting everything with the MSB/Sign-bit set. Therefore, the effective mask becomes S64_MAX, and the comment with vdso_calc_delta() that states the mask is U64_MAX and isn't optimized out is just plain silly. Now, the code has a negative filter -- to deal with TSC wobbles: if (cycles > last) which is just plain wrong, because it should've been written as: if ((s64)(cycles - last) > 0) to take wrapping into account, but per all the above, we don't actually wrap on u64 anymore. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Tested-by: Thomas Gleixner Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.704767397@infradead.org commit fc4a0db4149afcdae2527f0d8c376accca34adc9 Author: Peter Zijlstra Date: Fri May 19 12:21:05 2023 +0200 math64: Always inline u128 version of mul_u64_u64_shr() In order to prevent the following complaint from happening, always inline the u128 variant of mul_u64_u64_shr() -- which is what x86_64 will use. vmlinux.o: warning: objtool: read_hv_sched_clock_tsc+0x5a: call to mul_u64_u64_shr.constprop.0() leaves .noinstr.text section It should compile into something like: asm("mul %[mul];" "shrd %rdx, %rax, %cl" : "+&a" (a) : "c" shift, [mul] "r" (mul) : "d"); Which is silly not to inline, but it happens. Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.637420396@infradead.org commit 91b41a237512b569746e1f560a42d9fba077261d Author: Peter Zijlstra Date: Fri May 19 12:21:04 2023 +0200 s390/time: Provide sched_clock_noinstr() With the intent to provide local_clock_noinstr(), a variant of local_clock() that's safe to be called from noinstr code (with the assumption that any such code will already be non-preemptible), prepare for things by providing a noinstr sched_clock_noinstr() function. Specifically, preempt_enable_*() calls out to schedule(), which upsets noinstr validation efforts. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Heiko Carstens Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.570170436@infradead.org commit 6b10fef09f937433563822f4bb6a2f947176e5a0 Author: Peter Zijlstra Date: Fri May 19 12:21:03 2023 +0200 loongarch: Provide noinstr sched_clock_read() With the intent to provide local_clock_noinstr(), a variant of local_clock() that's safe to be called from noinstr code (with the assumption that any such code will already be non-preemptible), prepare for things by providing a noinstr sched_clock_read() function. Specifically, preempt_enable_*() calls out to schedule(), which upsets noinstr validation efforts. Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.502547082@infradead.org commit 24ee7607b286b44a5112ced38652df14cd80d5e2 Author: Peter Zijlstra Date: Fri May 19 12:21:02 2023 +0200 arm64/arch_timer: Provide noinstr sched_clock_read() functions With the intent to provide local_clock_noinstr(), a variant of local_clock() that's safe to be called from noinstr code (with the assumption that any such code will already be non-preemptible), prepare for things by providing a noinstr sched_clock_read() function. Specifically, preempt_enable_*() calls out to schedule(), which upsets noinstr validation efforts. Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.435618812@infradead.org commit c1d26c0f0295953d35307f9ee07f3e5295741315 Author: Peter Zijlstra Date: Fri May 19 12:21:01 2023 +0200 arm64/io: Always inline all of __raw_{read,write}[bwlq]() The next patch will want to use __raw_readl() from a noinstr section and as such that needs to be marked __always_inline to avoid the compiler being a silly bugger. Turns out it already is, but its siblings are not. Finish the work started in commit e43f1331e2ef913b ("arm64: Ask the compiler to __always_inline functions used by KVM at HYP") for consistenies sake. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.368919762@infradead.org commit 5949a68c73444d89b171703b67ff04fc4d6059c1 Author: Peter Zijlstra Date: Fri May 19 12:21:00 2023 +0200 time/sched_clock: Provide sched_clock_noinstr() With the intent to provide local_clock_noinstr(), a variant of local_clock() that's safe to be called from noinstr code (with the assumption that any such code will already be non-preemptible), prepare for things by providing a noinstr sched_clock_noinstr() function. Specifically, preempt_enable_*() calls out to schedule(), which upsets noinstr validation efforts. As such, pull out the preempt_{dis,en}able_notrace() requirements from the sched_clock_read() implementations by explicitly providing it in the sched_clock() function. This further requires said sched_clock_read() functions to be noinstr themselves, for ARCH_WANTS_NO_INSTR users. See the next few patches. Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.302350330@infradead.org commit d16317de9b412aa7bd3598c607112298e36b4352 Author: Peter Zijlstra Date: Fri May 19 12:20:59 2023 +0200 seqlock/latch: Provide raw_read_seqcount_latch_retry() The read side of seqcount_latch consists of: do { seq = raw_read_seqcount_latch(&latch->seq); ... } while (read_seqcount_latch_retry(&latch->seq, seq)); which is asymmetric in the raw_ department, and sure enough, read_seqcount_latch_retry() includes (explicit) instrumentation where raw_read_seqcount_latch() does not. This inconsistency becomes a problem when trying to use it from noinstr code. As such, fix it by renaming and re-implementing raw_read_seqcount_latch_retry() without the instrumentation. Specifically the instrumentation in question is kcsan_atomic_next(0) in do___read_seqcount_retry(). Loosing this annotation is not a problem because raw_read_seqcount_latch() does not pass through kcsan_atomic_next(KCSAN_SEQLOCK_REGION_MAX). Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Reviewed-by: Petr Mladek Tested-by: Michael Kelley # Hyper-V Link: https://lore.kernel.org/r/20230519102715.233598176@infradead.org commit 8f2d6c41e5a649fe217724364cbb1a7d2e6ff205 Author: Peter Zijlstra Date: Thu Jun 1 18:00:25 2023 +0200 x86/sched: Rewrite topology setup Instead of having a number of fixed topologies to pick from; build one on the fly. This is both simpler now and simpler to extend in the future. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230601153522.GB559993%40hirez.programming.kicks-ass.net commit 1c06918788e8ae6e69e4381a2806617312922524 Author: Peter Zijlstra Date: Wed May 31 16:39:07 2023 +0200 sched: Consider task_struct::saved_state in wait_task_inactive() With the introduction of task_struct::saved_state in commit 5f220be21418 ("sched/wakeup: Prepare for RT sleeping spin/rwlocks") matching the task state has gotten more complicated. That same commit changed try_to_wake_up() to consider both states, but wait_task_inactive() has been neglected. Sebastian noted that the wait_task_inactive() usage in ptrace_check_attach() can misbehave when ptrace_stop() is blocked on the tasklist_lock after it sets TASK_TRACED. Therefore extract a common helper from ttwu_state_match() and use that to teach wait_task_inactive() about the PREEMPT_RT locks. Originally-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Tested-by: Sebastian Andrzej Siewior Link: https://lkml.kernel.org/r/20230601091234.GW83892@hirez.programming.kicks-ass.net commit d5e1586617be7093ea3419e3fa9387ed833cdbb1 Author: Peter Zijlstra Date: Fri Jun 2 10:42:53 2023 +0200 sched: Unconditionally use full-fat wait_task_inactive() While modifying wait_task_inactive() for PREEMPT_RT; the build robot noted that UP got broken. This led to audit and consideration of the UP implementation of wait_task_inactive(). It looks like the UP implementation is also broken for PREEMPT; consider task_current_syscall() getting preempted between the two calls to wait_task_inactive(). Therefore move the wait_task_inactive() implementation out of CONFIG_SMP and unconditionally use it. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230602103731.GA630648%40hirez.programming.kicks-ass.net commit 0dd37d6dd33a9c23351e6115ae8cdac7863bc7de Author: Yicong Yang Date: Tue May 30 16:25:07 2023 +0800 sched/fair: Don't balance task to its current running CPU We've run into the case that the balancer tries to balance a migration disabled task and trigger the warning in set_task_cpu() like below: ------------[ cut here ]------------ WARNING: CPU: 7 PID: 0 at kernel/sched/core.c:3115 set_task_cpu+0x188/0x240 Modules linked in: hclgevf xt_CHECKSUM ipt_REJECT nf_reject_ipv4 <...snip> CPU: 7 PID: 0 Comm: swapper/7 Kdump: loaded Tainted: G O 6.1.0-rc4+ #1 Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V5.B221.01 12/09/2021 pstate: 604000c9 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : set_task_cpu+0x188/0x240 lr : load_balance+0x5d0/0xc60 sp : ffff80000803bc70 x29: ffff80000803bc70 x28: ffff004089e190e8 x27: ffff004089e19040 x26: ffff007effcabc38 x25: 0000000000000000 x24: 0000000000000001 x23: ffff80000803be84 x22: 000000000000000c x21: ffffb093e79e2a78 x20: 000000000000000c x19: ffff004089e19040 x18: 0000000000000000 x17: 0000000000001fad x16: 0000000000000030 x15: 0000000000000000 x14: 0000000000000003 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000001 x10: 0000000000000400 x9 : ffffb093e4cee530 x8 : 00000000fffffffe x7 : 0000000000ce168a x6 : 000000000000013e x5 : 00000000ffffffe1 x4 : 0000000000000001 x3 : 0000000000000b2a x2 : 0000000000000b2a x1 : ffffb093e6d6c510 x0 : 0000000000000001 Call trace: set_task_cpu+0x188/0x240 load_balance+0x5d0/0xc60 rebalance_domains+0x26c/0x380 _nohz_idle_balance.isra.0+0x1e0/0x370 run_rebalance_domains+0x6c/0x80 __do_softirq+0x128/0x3d8 ____do_softirq+0x18/0x24 call_on_irq_stack+0x2c/0x38 do_softirq_own_stack+0x24/0x3c __irq_exit_rcu+0xcc/0xf4 irq_exit_rcu+0x18/0x24 el1_interrupt+0x4c/0xe4 el1h_64_irq_handler+0x18/0x2c el1h_64_irq+0x74/0x78 arch_cpu_idle+0x18/0x4c default_idle_call+0x58/0x194 do_idle+0x244/0x2b0 cpu_startup_entry+0x30/0x3c secondary_start_kernel+0x14c/0x190 __secondary_switched+0xb0/0xb4 ---[ end trace 0000000000000000 ]--- Further investigation shows that the warning is superfluous, the migration disabled task is just going to be migrated to its current running CPU. This is because that on load balance if the dst_cpu is not allowed by the task, we'll re-select a new_dst_cpu as a candidate. If no task can be balanced to dst_cpu we'll try to balance the task to the new_dst_cpu instead. In this case when the migration disabled task is not on CPU it only allows to run on its current CPU, load balance will select its current CPU as new_dst_cpu and later triggers the warning above. The new_dst_cpu is chosen from the env->dst_grpmask. Currently it contains CPUs in sched_group_span() and if we have overlapped groups it's possible to run into this case. This patch makes env->dst_grpmask of group_balance_mask() which exclude any CPUs from the busiest group and solve the issue. For balancing in a domain with no overlapped groups the behaviour keeps same as before. Suggested-by: Vincent Guittot Signed-off-by: Yicong Yang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20230530082507.10444-1-yangyicong@huawei.com commit b410a9307bc3a7cdee3c930c98f6fc9cf1d2c484 Author: Sean Nyekjaer Date: Mon Jun 5 12:32:22 2023 +0200 iio: accel: fxls8962af: errata bug only applicable for FXLS8962AF Remove special errata handling if FXLS8964AF is used. Fixes: af959b7b96b8 ("iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads") Signed-off-by: Sean Nyekjaer Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230605103223.1400980-2-sean@geanix.com Signed-off-by: Jonathan Cameron commit d1cfbd52ede5e5fabc09992894c5733b4057f159 Author: Sean Nyekjaer Date: Mon Jun 5 12:32:21 2023 +0200 iio: accel: fxls8962af: fixup buffer scan element type Scan elements for x,y,z channels is little endian and requires no bit shifts. LE vs. BE is controlled in register SENS_CONFIG2 and bit LE_BE, default value is LE. Fixes: a3e0b51884ee ("iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers") Signed-off-by: Sean Nyekjaer Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230605103223.1400980-1-sean@geanix.com Signed-off-by: Jonathan Cameron commit e6570967775bbc62a19920bbc4f13bfa73936218 Author: Ian Rogers Date: Thu May 18 23:37:19 2023 -0700 perf stat: Document --metric-no-threshold and threshold colors Document the threshold behavior for -M/--metrics. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Caleb Biggers Cc: Eduard Zingerman Cc: Edward Baker Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Weilin Wang Link: https://lore.kernel.org/r/20230519063719.1029596-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 6f765bbbfb3c8c5993796402a3cba311e9506eed Author: Ian Rogers Date: Thu May 18 23:37:18 2023 -0700 perf expr: Make the evaluation of & and | logical and lazy Currently the & and | operators are only used in metric thresholds like (from the tma_retiring metric): tma_retiring > 0.7 | tma_heavy_operations > 0.1 Thresholds are always computed when present, but a lack of events may mean the threshold can't be computed. This happens with the option --metric-no-threshold for say the metric tma_retiring on Tigerlake model CPUs. To fully compute the threshold tma_heavy_operations is needed and it needs the extra events of IDQ.MS_UOPS, UOPS_DECODED.DEC0, cpu/UOPS_DECODED.DEC0,cmask=1/ and IDQ.MITE_UOPS. So --metric-no-threshold is a useful option to reduce the number of events needed and potentially multiplexing of events. Rather than just fail threshold computations like this, we may know a result from just the left or right-hand side. So, for tma_retiring if its value is "> 0.7" we know it is over the threshold. This allows the metric to have the threshold coloring, when possible, without all the counters being programmed. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Tested-by: Kan Liang Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Caleb Biggers Cc: Eduard Zingerman Cc: Edward Baker Cc: Ingo Molnar Cc: James Clark Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Samantha Alt Cc: Stephane Eranian Cc: Weilin Wang Link: https://lore.kernel.org/r/20230519063719.1029596-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 676bf7d062c14191c3fc12f1e36e1f3809041483 Author: Rafał Miłecki Date: Fri Jun 2 15:34:55 2023 +0200 ARM: dts: BCM5301X: Drop invalid properties from Meraki MR32 keys This fixes: arch/arm/boot/dts/bcm53015-meraki-mr26.dtb: keys: '#address-cells', '#size-cells' do not match any of the regexes: '^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$', 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/input/gpio-keys.yaml Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20230602133455.7441-2-zajec5@gmail.com Signed-off-by: Florian Fainelli commit c3acdd4901192bc69dc577012663d5abae21661e Author: Rafał Miłecki Date: Fri Jun 2 15:34:54 2023 +0200 ARM: dts: BCM5301X: Drop invalid #usb-cells Such property simply doesn't exist (is not documented or used anywhere). This fixes: arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: usb@21000: Unevaluated properties are not allowed ('#usb-cells' was unexpected) From schema: Documentation/devicetree/bindings/usb/generic-ehci.yaml arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: usb@22000: Unevaluated properties are not allowed ('#usb-cells' was unexpected) From schema: Documentation/devicetree/bindings/usb/generic-ohci.yaml arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: usb@23000: Unevaluated properties are not allowed ('#usb-cells' was unexpected) From schema: Documentation/devicetree/bindings/usb/generic-xhci.yaml Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20230602133455.7441-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 58e058f73ce3ac58ae744c783547caaa80807996 Author: Rafał Miłecki Date: Fri Jun 2 17:36:57 2023 +0200 dt-bindings: arm: bcm: Add bindings for Buffalo WZR-1166DHP(2) Add two more Northstar devices based on the BCM4708 SoC. Linux already contains DTS files for both. Signed-off-by: Rafał Miłecki Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230602153657.11362-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 04afb51c1dce90051487d3c7b70a1b1b246ce29a Author: Rafał Miłecki Date: Fri Jun 2 17:10:23 2023 +0200 ARM: dts: BCM5301X: Use updated "spi-gpio" binding properties Switch away from deprecated properties. This fixes: arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dtb: spi: gpio-sck: False schema does not allow [[6, 7, 0]] From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dtb: spi: gpio-mosi: False schema does not allow [[6, 4, 0]] From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dtb: spi: 'sck-gpios' is a required property From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dtb: spi: Unevaluated properties are not allowed ('gpio-mosi', 'gpio-sck' were unexpected) From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20230602151023.8607-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 8d211554679d0b23702bd32ba04aeac0c1c4f660 Author: Li Nan Date: Sat May 27 17:19:04 2023 +0800 blk-iocost: use spin_lock_irqsave in adjust_inuse_and_calc_cost adjust_inuse_and_calc_cost() use spin_lock_irq() and IRQ will be enabled when unlock. DEADLOCK might happen if we have held other locks and disabled IRQ before invoking it. Fix it by using spin_lock_irqsave() instead, which can keep IRQ state consistent with before when unlock. ================================ WARNING: inconsistent lock state 5.10.0-02758-g8e5f91fd772f #26 Not tainted -------------------------------- inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. kworker/2:3/388 [HC0[0]:SC0[0]:HE0:SE1] takes: ffff888118c00c28 (&bfqd->lock){?.-.}-{2:2}, at: spin_lock_irq ffff888118c00c28 (&bfqd->lock){?.-.}-{2:2}, at: bfq_bio_merge+0x141/0x390 {IN-HARDIRQ-W} state was registered at: __lock_acquire+0x3d7/0x1070 lock_acquire+0x197/0x4a0 __raw_spin_lock_irqsave _raw_spin_lock_irqsave+0x3b/0x60 bfq_idle_slice_timer_body bfq_idle_slice_timer+0x53/0x1d0 __run_hrtimer+0x477/0xa70 __hrtimer_run_queues+0x1c6/0x2d0 hrtimer_interrupt+0x302/0x9e0 local_apic_timer_interrupt __sysvec_apic_timer_interrupt+0xfd/0x420 run_sysvec_on_irqstack_cond sysvec_apic_timer_interrupt+0x46/0xa0 asm_sysvec_apic_timer_interrupt+0x12/0x20 irq event stamp: 837522 hardirqs last enabled at (837521): [] __raw_spin_unlock_irqrestore hardirqs last enabled at (837521): [] _raw_spin_unlock_irqrestore+0x3d/0x40 hardirqs last disabled at (837522): [] __raw_spin_lock_irq hardirqs last disabled at (837522): [] _raw_spin_lock_irq+0x43/0x50 softirqs last enabled at (835852): [] __do_softirq+0x558/0x8ec softirqs last disabled at (835845): [] asm_call_irq_on_stack+0xf/0x20 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&bfqd->lock); lock(&bfqd->lock); *** DEADLOCK *** 3 locks held by kworker/2:3/388: #0: ffff888107af0f38 ((wq_completion)kthrotld){+.+.}-{0:0}, at: process_one_work+0x742/0x13f0 #1: ffff8881176bfdd8 ((work_completion)(&td->dispatch_work)){+.+.}-{0:0}, at: process_one_work+0x777/0x13f0 #2: ffff888118c00c28 (&bfqd->lock){?.-.}-{2:2}, at: spin_lock_irq #2: ffff888118c00c28 (&bfqd->lock){?.-.}-{2:2}, at: bfq_bio_merge+0x141/0x390 stack backtrace: CPU: 2 PID: 388 Comm: kworker/2:3 Not tainted 5.10.0-02758-g8e5f91fd772f #26 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Workqueue: kthrotld blk_throtl_dispatch_work_fn Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x167 print_usage_bug valid_state mark_lock_irq.cold+0x32/0x3a mark_lock+0x693/0xbc0 mark_held_locks+0x9e/0xe0 __trace_hardirqs_on_caller lockdep_hardirqs_on_prepare.part.0+0x151/0x360 trace_hardirqs_on+0x5b/0x180 __raw_spin_unlock_irq _raw_spin_unlock_irq+0x24/0x40 spin_unlock_irq adjust_inuse_and_calc_cost+0x4fb/0x970 ioc_rqos_merge+0x277/0x740 __rq_qos_merge+0x62/0xb0 rq_qos_merge bio_attempt_back_merge+0x12c/0x4a0 blk_mq_sched_try_merge+0x1b6/0x4d0 bfq_bio_merge+0x24a/0x390 __blk_mq_sched_bio_merge+0xa6/0x460 blk_mq_sched_bio_merge blk_mq_submit_bio+0x2e7/0x1ee0 __submit_bio_noacct_mq+0x175/0x3b0 submit_bio_noacct+0x1fb/0x270 blk_throtl_dispatch_work_fn+0x1ef/0x2b0 process_one_work+0x83e/0x13f0 process_scheduled_works worker_thread+0x7e3/0xd80 kthread+0x353/0x470 ret_from_fork+0x1f/0x30 Fixes: b0853ab4a238 ("blk-iocost: revamp in-period donation snapbacks") Signed-off-by: Li Nan Acked-by: Tejun Heo Reviewed-by: Yu Kuai Link: https://lore.kernel.org/r/20230527091904.3001833-1-linan666@huaweicloud.com Signed-off-by: Jens Axboe commit c7e076de2d511e0186c7a6585fa3be3f30bb57e0 Merge: 1499febc01c9b ee02b869dcad7 Author: Mark Brown Date: Mon Jun 5 18:29:36 2023 +0100 ASoC: mt8188: add new board support Merge series from Trevor Wu : In the series, we extend the capability of mt8188-mt6359 driver. The following changes are included. 1. Divide ADDA BE dai into two dais for SOF. 2. Register hdmi/dp jack pins. 3. dai_fmt can be configured from device tree. 4. Add some I2S codecs support. In addition, new compatible string "mediatek,mt8188-nau8825" is included for a new board support. commit 1499febc01c9bd4e533834dda5c290d51b18d233 Merge: fd0a7ec379dbf d3e7c32b7d5c7 Author: Mark Brown Date: Mon Jun 5 18:29:30 2023 +0100 ASoC: SOF: Intel: LunarLake preparation patches Merge series from Pierre-Louis Bossart : This patchset adds the changes required for the hda-dai extension to deal with SSSP/DMIC/SoundWire starting with LunarLake, as well as the new TLV IPC to provide the DMA stream_tag to the DSP firmware. LunarLake support for SSP/DMIC is ready but is gated by the patch "ASoC: SOF: Intel: shim: add enum for ACE 2.0 IP used in LunarLake" currently only present in the SoundWire tree. commit f198478cfdc8105a1c8d8945918904f0498d19be Author: Mario Limonciello Date: Thu Jun 1 18:39:53 2023 -0500 ACPI: x86: s2idle: Adjust Microsoft LPS0 _DSM handling sequence In Windows the Microsoft _DSM doesn't call functions 3->5->7 for suspend and 8->6->4 for resume like Linux currently does. Rather it calls 3->7->5 for suspend and 6->8->4 for resume. Align this calling order for Linux as well. Link: https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby-states Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit a9c4a912b7dc7ff922d4b9261160c001558f9755 Author: Mario Limonciello Date: Thu Jun 1 17:11:51 2023 -0500 ACPI: resource: Remove "Zen" specific match and quirks commit 9946e39fe8d0 ("ACPI: resource: skip IRQ override on AMD Zen platforms") attempted to overhaul the override logic so it didn't apply on X86 AMD Zen systems. This was intentional so that systems would prefer DSDT values instead of default MADT value for IRQ 1 on Ryzen 6000 systems which typically uses ActiveLow for IRQ1. This turned out to be a bad assumption because several vendors add Interrupt Source Override but don't fix the DSDT. A pile of quirks was collecting that proved this wasn't sustaintable. Furthermore some vendors have used ActiveHigh for IRQ1. To solve this problem revert the following commits: * commit 17bb7046e7ce ("ACPI: resource: Do IRQ override on all TongFang GMxRGxx") * commit f3cb9b740869 ("ACPI: resource: do IRQ override on Lenovo 14ALC7") * commit bfcdf58380b1 ("ACPI: resource: do IRQ override on LENOVO IdeaPad") * commit 7592b79ba4a9 ("ACPI: resource: do IRQ override on XMG Core 15") * commit 9946e39fe8d0 ("ACPI: resource: skip IRQ override on AMD Zen platforms") Reported-by: evilsnoo@proton.me Link: https://bugzilla.kernel.org/show_bug.cgi?id=217394 Reported-by: ruinairas1992@gmail.com Link: https://bugzilla.kernel.org/show_bug.cgi?id=217406 Reported-by: nmschulte@gmail.com Link: https://bugzilla.kernel.org/show_bug.cgi?id=217336 Signed-off-by: Mario Limonciello Tested-by: Werner Sembach Tested-by: Chuanhong Guo Signed-off-by: Rafael J. Wysocki commit 89d5b7178d4edc2a5d7b6070923fe2d2125ec52a Author: Arnd Bergmann Date: Thu Jun 1 23:33:15 2023 +0200 ACPI: PM: s2idle: fix section mismatch warning The acpi_sleep_suspend_setup() function is missing an __init annotation, which causes a warning in rare configurations that end up not inlining it into its caller: WARNING: modpost: vmlinux.o: section mismatch in reference: acpi_sleep_suspend_setup (section: .text) -> acpi_s2idle_setup (section: .init.text) It's only called from an __init function, so adding the annotation is correct here. Signed-off-by: Arnd Bergmann Signed-off-by: Rafael J. Wysocki commit 4348270137e2be2542c4dd092a75cb6655913477 Author: Miaohe Lin Date: Sat May 27 17:51:58 2023 +0800 ACPI: APEI: GHES: Remove unused ghes_estatus_pool_size_request() ghes_estatus_pool_size_request() is unused now, so remove it. Signed-off-by: Miaohe Lin [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 2577f53f42947d8ca01666e3444bb7307319ea38 Author: Christoph Hellwig Date: Wed May 31 14:55:35 2023 +0200 block: mark early_lookup_bdev as __init early_lookup_bdev is now only used during the early boot code as it should, so mark it __init to not waste run time memory on it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-25-hch@lst.de Signed-off-by: Jens Axboe commit 8d03187ee7328af8e18ef1782289e0b034e75485 Author: Christoph Hellwig Date: Wed May 31 14:55:34 2023 +0200 mtd: block2mtd: don't call early_lookup_bdev after the system is running early_lookup_bdev is supposed to only be called from the early boot code, but mdtblock_early_get_bdev is called as a general fallback when lookup_bdev fails, which is problematic because early_lookup_bdev bypasses all normal path based permission checking, and might cause problems with certain container environments renaming devices. Switch to only call early_lookup_bdev when block2mtd is built-in and the system state in not running yet. Note that this strictly speaking changes the kernel ABI as the PARTUUID= and PARTLABEL= style syntax is now not available during a running systems. They never were intended for that, but this breaks things we'll have to figure out a way to make them available again. But if avoidable in any way I'd rather avoid that. Signed-off-by: Christoph Hellwig Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20230531125535.676098-24-hch@lst.de Signed-off-by: Jens Axboe commit b2baa57475e3a24bb9ad27bb9047ea3be94627f5 Author: Christoph Hellwig Date: Wed May 31 14:55:33 2023 +0200 mtd: block2mtd: factor the early block device open logic into a helper Simplify add_device a bit by splitting out the cumbersome early boot logic into a separate helper. Signed-off-by: Christoph Hellwig Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20230531125535.676098-23-hch@lst.de Signed-off-by: Jens Axboe commit 8f0e8597a7fa1020e96415fdf2a022cc961cfa90 Author: Arnd Bergmann Date: Tue May 16 22:14:07 2023 +0200 ACPI: NFIT: Add declaration in a local header The nfit_intel_shutdown_status() function has a __weak defintion in nfit.c and an override in acpi_nfit_test.c for testing purposes. This works without an extern declaration, but causes a W=1 build warning: drivers/acpi/nfit/core.c:1717:13: error: no previous prototype for 'nfit_intel_shutdown_status' [-Werror=missing-prototypes] Add a declaration in a header that gets included from both sides to shut up the warning and ensure that the prototypes actually match. Signed-off-by: Arnd Bergmann Reviewed-by: Dave Jiang Signed-off-by: Rafael J. Wysocki commit 1e8c813b083c4122dfeaa5c3b11028331026e85d Author: Christoph Hellwig Date: Wed May 31 14:55:32 2023 +0200 PM: hibernate: don't use early_lookup_bdev in resume_store resume_store is a sysfs attribute written during normal kernel runtime, and it should not use the early_lookup_bdev API that bypasses all normal path based permission checking, and might cause problems with certain container environments renaming devices. Switch to lookup_bdev, which does a normal path lookup instead, and fall back to trying to parse a numeric dev_t just like early_lookup_bdev did. Note that this strictly speaking changes the kernel ABI as the PARTUUID= and PARTLABEL= style syntax is now not available during a running systems. They never were intended for that, but this breaks things we'll have to figure out a way to make them available again. But if avoidable in any way I'd rather avoid that. Fixes: 421a5fa1a6cf ("PM / hibernate: use name_to_dev_t to parse resume") Signed-off-by: Christoph Hellwig Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230531125535.676098-22-hch@lst.de Signed-off-by: Jens Axboe commit 7a126d5bf975f082281fb9b45d110cd49b7c3ee4 Author: Christoph Hellwig Date: Wed May 31 14:55:31 2023 +0200 dm: only call early_lookup_bdev from early boot context early_lookup_bdev is supposed to only be called from the early boot code, but dm_get_device calls it as a general fallback when lookup_bdev fails, which is problematic because early_lookup_bdev bypasses all normal path based permission checking, and might cause problems with certain container environments renaming devices. Switch to only call early_lookup_bdev when dm is built-in and the system state in not running yet. This means it is still available when tables are constructed by dm-init.c from the kernel command line, but not otherwise. Note that this strictly speaking changes the kernel ABI as the PARTUUID= and PARTLABEL= style syntax is now not available during a running systems. They never were intended for that, but this breaks things we'll have to figure out a way to make them available again. But if avoidable in any way I'd rather avoid that. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20230531125535.676098-21-hch@lst.de Signed-off-by: Jens Axboe commit d4a28d7defe79006e59293a4b43d518ba8483fb0 Author: Christoph Hellwig Date: Wed May 31 14:55:30 2023 +0200 dm: remove dm_get_dev_t Open code dm_get_dev_t in the only remaining caller, and propagate the exact error code from lookup_bdev and early_lookup_bdev. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-20-hch@lst.de Signed-off-by: Jens Axboe commit 49177377e910a8fd5cd1388c966d8fbb51075c3c Author: Christoph Hellwig Date: Wed May 31 14:55:29 2023 +0200 dm: open code dm_get_dev_t in dm_init_init dm_init_init is called from early boot code, and thus lookup_bdev will never succeed. Just open code that call to early_lookup_bdev instead. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20230531125535.676098-19-hch@lst.de Signed-off-by: Jens Axboe commit 26110d5afe8117d1b505fe735ac709bdf063f4da Author: Christoph Hellwig Date: Wed May 31 14:55:28 2023 +0200 dm-snap: simplify the origin_dev == cow_dev check in snapshot_ctr Use the block_device acquired in dm_get_device for the check instead of doing an extra lookup. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20230531125535.676098-18-hch@lst.de Signed-off-by: Jens Axboe commit 7cadcaf1d82618852745e7206fffa2c72c17ce4b Author: Christoph Hellwig Date: Wed May 31 14:55:27 2023 +0200 block: move more code to early-lookup.c blk_lookup_devt is only used by code in early-lookup.c, so move it there. printk_all_partitions and it's helper bdevt_str are only used by the early init code in init/do_mounts.c, so they should go there as well. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-17-hch@lst.de Signed-off-by: Jens Axboe commit 702f3189e454b3c3c2f3c99dbf30acf41aab707c Author: Christoph Hellwig Date: Wed May 31 14:55:26 2023 +0200 block: move the code to do early boot lookup of block devices to block/ Create a new block/early-lookup.c to keep the early block device lookup code instead of having this code sit with the early mount code. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-16-hch@lst.de Signed-off-by: Jens Axboe commit 079caa35f7863cd9958b4555ae873ea4d352a502 Author: Christoph Hellwig Date: Wed May 31 14:55:25 2023 +0200 init: clear root_wait on all invalid root= strings Instead of only clearing root_wait in devt_from_partuuid when the UUID format was invalid, do that in parse_root_device for all strings that failed to parse. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-15-hch@lst.de Signed-off-by: Jens Axboe commit cf056a43121559d3642419917d405c3237ded90a Author: Christoph Hellwig Date: Wed May 31 14:55:24 2023 +0200 init: improve the name_to_dev_t interface name_to_dev_t has a very misleading name, that doesn't make clear it should only be used by the early init code, and also has a bad calling convention that doesn't allow returning different kinds of errors. Rename it to early_lookup_bdev to make the use case clear, and return an errno, where -EINVAL means the string could not be parsed, and -ENODEV means it the string was valid, but there was no device found for it. Also stub out the whole call for !CONFIG_BLOCK as all the non-block root cases are always covered in the caller. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-14-hch@lst.de Signed-off-by: Jens Axboe commit c0c1a7dcb6f5db4500e6574294674213bc24940c Author: Christoph Hellwig Date: Wed May 31 14:55:23 2023 +0200 init: move the nfs/cifs/ram special cases out of name_to_dev_t The nfs/cifs/ram special case only needs to be parsed once, and only in the boot code. Move them out of name_to_dev_t and into prepare_namespace. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-13-hch@lst.de Signed-off-by: Jens Axboe commit 3701c600a3e735b9fbac6f7a73e4c086090c97ca Author: Christoph Hellwig Date: Wed May 31 14:55:22 2023 +0200 init: factor the root_wait logic in prepare_namespace into a helper The root_wait logic is a bit obsfucated right now. Expand it and move it into a helper. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-12-hch@lst.de Signed-off-by: Jens Axboe commit 07d63cbb67cdb5e2a7720fdd8579b3be979c2d66 Author: Christoph Hellwig Date: Wed May 31 14:55:21 2023 +0200 init: handle ubi/mtd root mounting like all other root types Assign a Root_Generic magic value for UBI/MTD root and handle the root mounting in mount_root like all other root types. Besides making the code more clear this also means that UBI/MTD root can be used together with an initrd (not that anyone should care). Also factor parsing of the root name into a helper now that it can be easily done and will get more complicated with subsequent patches. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-11-hch@lst.de Signed-off-by: Jens Axboe commit 73231b58b1b496d631fa0ecf9fa7f64f5a07c6e3 Author: Christoph Hellwig Date: Wed May 31 14:55:20 2023 +0200 init: don't remove the /dev/ prefix from error messages Remove the code that drops the /dev/ prefix from root_device_name, which is only used for error messages when mounting the root device fails. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-10-hch@lst.de Signed-off-by: Jens Axboe commit c8643c72bc42781fc169c6498a3902bec447099e Author: Christoph Hellwig Date: Wed May 31 14:55:19 2023 +0200 init: pass root_device_name explicitly Instead of declaring root_device_name as a global variable pass it as an argument to the functions using it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-9-hch@lst.de Signed-off-by: Jens Axboe commit a6a41d39c2d91ff2543d31b6cc6070f3957e3aea Author: Christoph Hellwig Date: Wed May 31 14:55:18 2023 +0200 init: refactor mount_root Provide stubs for all the lower level mount helpers, and just switch on ROOT_DEV in the main function. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-8-hch@lst.de Signed-off-by: Jens Axboe commit e3102722ffe77094ba9e7e46380792b3dd8a7abd Author: Christoph Hellwig Date: Wed May 31 14:55:17 2023 +0200 init: rename mount_block_root to mount_root_generic mount_block_root is also used to mount non-block file systems, so give it a better name. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-7-hch@lst.de Signed-off-by: Jens Axboe commit f5524c3fadba35c075a5131bad74e3041507a694 Author: Christoph Hellwig Date: Wed May 31 14:55:16 2023 +0200 init: remove pointless Root_* values Remove all unused defines, and just use the expanded versions for the SCSI disk majors. I've decided to keep Root_RAM0 even if it could be expanded as there is a lot of special casing for it in the init code. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531125535.676098-6-hch@lst.de Signed-off-by: Jens Axboe commit cc89c63e2fe37d476357c82390dfb12edcd41cdd Author: Christoph Hellwig Date: Wed May 31 14:55:15 2023 +0200 PM: hibernate: move finding the resume device out of software_resume software_resume can be called either from an init call in the boot code, or from sysfs once the system has finished booting, and the two invocation methods this can't race with each other. For the latter case we did just parse the suspend device manually, while the former might not have one. Split software_resume so that the search only happens for the boot case, which also means the special lockdep nesting annotation can go away as the system transition mutex can be taken a little later and doesn't have the sysfs locking nest inside it. Signed-off-by: Christoph Hellwig Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230531125535.676098-5-hch@lst.de Signed-off-by: Jens Axboe commit d6545e687271ab27472eebff770f2de6a5f1a464 Author: Christoph Hellwig Date: Wed May 31 14:55:14 2023 +0200 PM: hibernate: remove the global snapshot_test variable Passing call dependent variable in global variables is a huge antipattern. Fix it up. Signed-off-by: Christoph Hellwig Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230531125535.676098-4-hch@lst.de Signed-off-by: Jens Axboe commit 02b42d58f3898134b900ff3030561099e38adb32 Author: Christoph Hellwig Date: Wed May 31 14:55:13 2023 +0200 PM: hibernate: factor out a helper to find the resume device Split the logic to find the resume device out software_resume and into a separate helper to start unwindig the convoluted goto logic. Signed-off-by: Christoph Hellwig Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230531125535.676098-3-hch@lst.de Signed-off-by: Jens Axboe commit aa5f6ed8c21ec1aa5fd688118d8d5cd87c5ffc1d Author: Christoph Hellwig Date: Wed May 31 14:55:12 2023 +0200 driver core: return bool from driver_probe_done bool is the most sensible return value for a yes/no return. Also add __init as this funtion is only called from the early boot code. Signed-off-by: Christoph Hellwig Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230531125535.676098-2-hch@lst.de Signed-off-by: Jens Axboe commit 744bbf2a67e7798118c39cd6652a0e1e4ad86498 Author: Daniele Ceraolo Spurio Date: Wed May 31 16:54:15 2023 -0700 drm/i915/huc: define HuC FW version for MTL Follow the same logic as DG2, so just a meu binary with no version number. Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230531235415.1467475-8-daniele.ceraolospurio@intel.com commit 59c8cd3ef6d04923e74dbef6e8cb4cec4053a99f Author: Daniele Ceraolo Spurio Date: Wed May 31 16:54:14 2023 -0700 drm/i915/mtl/huc: Use the media gt for the HuC getparam On MTL, for obvious reasons, HuC is only available on the media tile. We already disable SW support for HuC on the root gt due to the absence of VCS engines, but we also need to update the getparam to point to the HuC struct in the media GT. Signed-off-by: Daniele Ceraolo Spurio Cc: John Harrison Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230531235415.1467475-7-daniele.ceraolospurio@intel.com commit 08872cb13a715e2e963533f18f4aec2bcb145201 Author: Daniele Ceraolo Spurio Date: Wed May 31 16:54:13 2023 -0700 drm/i915/mtl/huc: auth HuC via GSC The full authentication via the GSC requires an heci packet submission to the GSC FW via the GSC CS. The GSC has new PXP command for this (literally called NEW_HUC_AUTH). The intel_huc_auth function is also updated to handle both authentication types. v2: check that the GuC auth for clear media has completed before proceding with the full auth v3: use a define for the object size (Alan) Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20230531235415.1467475-6-daniele.ceraolospurio@intel.com commit 98d2722a85c4ad5f2baf2272cbb0fab67f797b69 Author: Daniele Ceraolo Spurio Date: Wed May 31 16:54:12 2023 -0700 drm/i915/huc: differentiate the 2 steps of the MTL HuC auth flow Before we add the second step of the MTL HuC auth (via GSC), we need to have the ability to differentiate between them. To do so, the huc authentication check is duplicated for GuC and GSC auth, with GSC-enabled binaries being considered fully authenticated only after the GSC auth step. To report the difference between the 2 auth steps, a new case is added to the HuC getparam. This way, the clear media driver can start submitting before full auth, as partial auth is enough for those workloads. v2: fix authentication status check for DG2 v3: add a better comment at the top of the HuC file to explain the different approaches to load and auth (John) v4: update call to intel_huc_is_authenticated in the pxp code to check for GSC authentication v5: drop references to meu and esclamation mark in huc_auth print (John) Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Cc: John Harrison Reviewed-by: Alan Previn #v2 Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230531235415.1467475-5-daniele.ceraolospurio@intel.com commit 6a9b6c4580af184f1f8744ade1fe1979e3da05ac Author: Daniele Ceraolo Spurio Date: Wed May 31 16:54:11 2023 -0700 drm/i915/huc: Load GSC-enabled HuC via DMA xfer if the fuse says so In the previous patch we extracted the offset of the legacy-style HuC binary located within the GSC-enabled blob, so now we can use that to load the HuC via DMA if the fuse is set that way. Note that we now need to differentiate between "GSC-enabled binary" and "loaded by GSC", so the former case has been renamed to "has GSC headers" for clarity, while the latter is now based on the fuse instead of the binary format. This way, all the legacy load paths are automatically taken (including the auth by GuC) without having to implement further code changes. v2: s/is_meu_binary/has_gsc_headers/, clearer logs (John) v3: split check for GSC access, better comments (John) Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Cc: John Harrison Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230531235415.1467475-4-daniele.ceraolospurio@intel.com commit dd2e31afba9e3a3107aa202726b6199c55075f59 Author: Christoph Hellwig Date: Thu Jun 1 11:44:59 2023 +0200 ext4: wire up the ->mark_dead holder operation for log devices Implement a set of holder_ops that shut down the file system when the block device used as log device is removed undeneath the file system. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-17-hch@lst.de Signed-off-by: Jens Axboe commit f5db130d4443ddf63b49e195782038ebaab0bec9 Author: Christoph Hellwig Date: Thu Jun 1 11:44:58 2023 +0200 ext4: wire up sops->shutdown Wire up the shutdown method to shut down the file system when the underlying block device is marked dead. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-16-hch@lst.de Signed-off-by: Jens Axboe commit 97524b454bc562f4052751f0e635a61dad78f1b2 Author: Christoph Hellwig Date: Thu Jun 1 11:44:57 2023 +0200 ext4: split ext4_shutdown Split ext4_shutdown into a low-level helper that will be reused for implementing the shutdown super operation and a wrapper for the ioctl handling. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-15-hch@lst.de Signed-off-by: Jens Axboe commit 8067ca1dcdfcc2a5e0a51bff3730ad3eef0623d6 Author: Christoph Hellwig Date: Thu Jun 1 11:44:56 2023 +0200 xfs: wire up the ->mark_dead holder operation for log and RT devices Implement a set of holder_ops that shut down the file system when the block device used as log or RT device is removed undeneath the file system. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-14-hch@lst.de Signed-off-by: Jens Axboe commit e7caa877e5ddac63886f4a8376cb3ffbd4dfe569 Author: Christoph Hellwig Date: Thu Jun 1 11:44:55 2023 +0200 xfs: wire up sops->shutdown Wire up the shutdown method to shut down the file system when the underlying block device is marked dead. Add a new message to clearly distinguish this shutdown reason from other shutdowns. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-13-hch@lst.de Signed-off-by: Jens Axboe commit 87efb39075be6a288cd7f23858f15bd01c83028a Author: Christoph Hellwig Date: Thu Jun 1 11:44:54 2023 +0200 fs: add a method to shut down the file system Add a new ->shutdown super operation that can be used to tell the file system to shut down, and call it from newly created holder ops when the block device under a file system shuts down. This only covers the main block device for "simple" file systems using get_tree_bdev / mount_bdev. File systems their own get_tree method or opening additional devices will need to set up their own blk_holder_ops. Signed-off-by: Christoph Hellwig Reviewed-by: Christian Brauner Reviewed-by: Jan Kara Reviewed-by: Darrick J. Wong Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-12-hch@lst.de Signed-off-by: Jens Axboe commit f55e017c642051ddc01d77a89ab18f5ee71d6276 Author: Christoph Hellwig Date: Thu Jun 1 11:44:53 2023 +0200 block: add a mark_dead holder operation Add a mark_dead method to blk_holder_ops that is called from blk_mark_disk_dead to notify the holder that the block device it is using has been marked dead. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Christian Brauner Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-11-hch@lst.de Signed-off-by: Jens Axboe commit 0718afd47f70cf46877c39c25d06b786e1a3f36c Author: Christoph Hellwig Date: Thu Jun 1 11:44:52 2023 +0200 block: introduce holder ops Add a new blk_holder_ops structure, which is passed to blkdev_get_by_* and installed in the block_device for exclusive claims. It will be used to allow the block layer to call back into the user of the block device for thing like notification of a removed device or a device resize. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-10-hch@lst.de Signed-off-by: Jens Axboe commit 00080f7fb7a599c26523037b202fb945f3141811 Author: Christoph Hellwig Date: Thu Jun 1 11:44:51 2023 +0200 block: remove blk_drop_partitions There is only a single caller left, so fold the loop into that. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-9-hch@lst.de Signed-off-by: Jens Axboe commit eec1be4c30df73238b936fa9f3653773a6f8b15c Author: Christoph Hellwig Date: Thu Jun 1 11:44:50 2023 +0200 block: delete partitions later in del_gendisk Delay dropping the block_devices for partitions in del_gendisk until after the call to blk_mark_disk_dead, so that we can implementat notification of removed devices in blk_mark_disk_dead. This requires splitting a lower-level drop_partition helper out of delete_partition and using that from del_gendisk, while having a common loop for the whole device and partitions that calls remove_inode_hash, fsync_bdev and __invalidate_device before the call to blk_mark_disk_dead. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-8-hch@lst.de Signed-off-by: Jens Axboe commit 69f90b70bdb62e1a930239d33579e04884cd0b9a Author: Christoph Hellwig Date: Thu Jun 1 11:44:49 2023 +0200 block: unhash the inode earlier in delete_partition Move the call to remove_inode_hash to the beginning of delete_partition, as we want to prevent opening a block_device that is about to be removed ASAP. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-7-hch@lst.de Signed-off-by: Jens Axboe commit a4f75764d16bed317276b05a9fe2c179ef61680d Author: Christoph Hellwig Date: Thu Jun 1 11:44:48 2023 +0200 block: avoid repeated work in blk_mark_disk_dead Check if GD_DEAD is already set in blk_mark_disk_dead, and don't duplicate the work already done. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Christian Brauner Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-6-hch@lst.de Signed-off-by: Jens Axboe commit 66fddc25fe182fd7d28b35f4173113f3eefc7fb5 Author: Christoph Hellwig Date: Thu Jun 1 11:44:47 2023 +0200 block: consolidate the shutdown logic in blk_mark_disk_dead and del_gendisk blk_mark_disk_dead does very similar work a a section of del_gendisk: - set the GD_DEAD flag - set the capacity to zero - start a queue drain but del_gendisk also sets QUEUE_FLAG_DYING on the queue if it is owned by the disk, sets the capacity to zero before starting the drain, and both with sending a uevent and kernel message for this fake capacity change. Move the exact logic from the more heavily used del_gendisk into blk_mark_disk_dead and then call blk_mark_disk_dead from del_gendisk. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-5-hch@lst.de Signed-off-by: Jens Axboe commit 74e6464a987b2572771ac19163e961777fd0252e Author: Christoph Hellwig Date: Thu Jun 1 11:44:46 2023 +0200 block: turn bdev_lock into a mutex There is no reason for this lock to spin, and being able to sleep under it will come in handy soon. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Christian Brauner Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-4-hch@lst.de Signed-off-by: Jens Axboe commit ae5f855ead6b41422ca0c971ebda509c0414f8ec Author: Christoph Hellwig Date: Thu Jun 1 11:44:45 2023 +0200 block: refactor bd_may_claim The long if/else chain obsfucates the actual logic. Tidy it up to be more structured. Also drop the whole argument, as it can be trivially derived from bdev using bdev_whole, and having the bdev_whole in the function makes it easier to follow. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-3-hch@lst.de Signed-off-by: Jens Axboe commit 0783b1a7cbd9a02ddc35fe531b5966b674b304f0 Author: Christoph Hellwig Date: Thu Jun 1 11:44:44 2023 +0200 block: factor out a bd_end_claim helper from blkdev_put Move all the logic to release an exclusive claim into a helper. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Christian Brauner Acked-by: Dave Chinner Reviewed-by: Dave Chinner Link: https://lore.kernel.org/r/20230601094459.1350643-2-hch@lst.de Signed-off-by: Jens Axboe commit 93a575ab15332e2037d35744c50412b40e6511a4 Author: Daniele Ceraolo Spurio Date: Wed May 31 16:54:10 2023 -0700 drm/i915/huc: Parse the GSC-enabled HuC binary The new binaries that support the 2-step authentication contain the legacy-style binary, which we can use for loading the HuC via DMA. To find out where this is located in the image, we need to parse the manifest of the GSC-enabled HuC binary. The manifest consist of a partition header followed by entries, one of which contains the offset we're looking for. Note that the DG2 GSC binary contains entries with the same names, but it doesn't contain a full legacy binary, so we need to skip assigning the dma offset in that case (which we can do by checking the ccs). Also, since we're now parsing the entries, we can extract the HuC version that way instead of using hardcoded offsets. Note that the GSC binary uses the same structures in its binary header, so they've been added in their own header file. v2: fix structure names to match meu defines (s/CPT/CPD/), update commit message, check ccs validity, drop old version location defines. v3: drop references to the MEU tool to reduce confusion, fix log (John) v4: fix log for real (John) Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Cc: John Harrison Reviewed-by: Alan Previn #v2 Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230531235415.1467475-3-daniele.ceraolospurio@intel.com commit 3532e75dfadcf52f8cb56dbfb6bce4503c69091f Author: Daniele Ceraolo Spurio Date: Wed May 31 16:54:09 2023 -0700 drm/i915/uc: perma-pin firmwares Now that each FW has its own reserved area, we can keep them always pinned and skip the pin/unpin dance on reset. This will make things easier for the 2-step HuC authentication, which requires the FW to be pinned in GGTT after the xfer is completed. Since the vma is now valid for a long time and not just for the quick pin-load-unpin dance, the name "dummy" is no longer appropriare and has been replaced with vma_res. All the functions have also been updated to operate on vma_res for consistency. Given that we pin the vma behind the allocator's back (which is ok because we do the pinning in an area that was previously reserved for thus purpose), we do need to explicitly re-pin on resume because the automated helper won't cover us. v2: better comments and commit message, s/dummy/vma_res/ Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Cc: John Harrison Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230531235415.1467475-2-daniele.ceraolospurio@intel.com commit d519df00938eed652fc041ff4e07b2b38a4ad3bc Author: Christoph Hellwig Date: Thu Jun 1 17:16:46 2023 +0200 drbd: stop defining __KERNEL_SYSCALLS__ __KERNEL_SYSCALLS__ hasn't been needed since Linux 2.6.19 so stop defining it. Signed-off-by: Christoph Hellwig Reviewed-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20230601151646.1386867-1-hch@lst.de Signed-off-by: Jens Axboe commit d8a324f102cc894fa0df6849504a9023f3ea5da6 Author: Kristina Martsenko Date: Tue May 9 15:22:35 2023 +0100 kselftest/arm64: add MOPS to hwcap test Add the MOPS hwcap to the hwcap kselftest and check that a SIGILL is not generated when the feature is detected. A SIGILL is reliable when the feature is not detected as SCTLR_EL1.MSCEn won't have been set. Signed-off-by: Kristina Martsenko Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20230509142235.3284028-12-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas commit 3e1dedb29d0f70b0bd10bb83001df8c04fc246eb Author: Kristina Martsenko Date: Tue May 9 15:22:34 2023 +0100 arm64: mops: allow disabling MOPS from the kernel command line Make it possible to disable the MOPS extension at runtime using the kernel command line. This can be useful for testing or working around hardware issues. For example it could be used to test new memory copy routines that do not use MOPS instructions (e.g. from Arm Optimized Routines). Reviewed-by: Catalin Marinas Signed-off-by: Kristina Martsenko Link: https://lore.kernel.org/r/20230509142235.3284028-11-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas commit b7564127ffcb1a26854d7515a0918d775e663639 Author: Kristina Martsenko Date: Tue May 9 15:22:33 2023 +0100 arm64: mops: detect and enable FEAT_MOPS The Arm v8.8/9.3 FEAT_MOPS feature provides new instructions that perform a memory copy or set. Wire up the cpufeature code to detect the presence of FEAT_MOPS and enable it. Reviewed-by: Catalin Marinas Signed-off-by: Kristina Martsenko Link: https://lore.kernel.org/r/20230509142235.3284028-10-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas commit 8cd076a67dc8eac5d613b3258f656efa7a54412e Author: Kristina Martsenko Date: Tue May 9 15:22:32 2023 +0100 arm64: mops: handle single stepping after MOPS exception When a MOPS main or epilogue instruction is being executed, the task may get scheduled on a different CPU and restart execution from the prologue instruction. If the main or epilogue instruction is being single stepped then it makes sense to finish the step and take the step exception before starting to execute the next (prologue) instruction. So fast-forward the single step state machine when taking a MOPS exception. This means that if a main or epilogue instruction is single stepped with ptrace, the debugger will sometimes observe the PC moving back to the prologue instruction. (As already mentioned, this should be rare as it only happens when the task is scheduled to another CPU during the step.) This also ensures that perf breakpoints count prologue instructions consistently (i.e. every time they are executed), rather than skipping them when there also happens to be a breakpoint on a main or epilogue instruction. Acked-by: Catalin Marinas Signed-off-by: Kristina Martsenko Link: https://lore.kernel.org/r/20230509142235.3284028-9-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas commit 8536ceaa747174ded7983f13906b225e0c33ac51 Author: Kristina Martsenko Date: Tue May 9 15:22:31 2023 +0100 arm64: mops: handle MOPS exceptions The memory copy/set instructions added as part of FEAT_MOPS can take an exception (e.g. page fault) part-way through their execution and resume execution afterwards. If however the task is re-scheduled and execution resumes on a different CPU, then the CPU may take a new type of exception to indicate this. This is because the architecture allows two options (Option A and Option B) to implement the instructions and a heterogeneous system can have different implementations between CPUs. In this case the OS has to reset the registers and restart execution from the prologue instruction. The algorithm for doing this is provided as part of the Arm ARM. Add an exception handler for the new exception and wire it up for userspace tasks. Reviewed-by: Catalin Marinas Signed-off-by: Kristina Martsenko Link: https://lore.kernel.org/r/20230509142235.3284028-8-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas commit 3172613fbcbb0634d91d05601f029da0c1466999 Author: Kristina Martsenko Date: Tue May 9 15:22:30 2023 +0100 KVM: arm64: hide MOPS from guests As FEAT_MOPS is not supported in guests yet, hide it from the ID registers for guests. The MOPS instructions are UNDEFINED in guests as HCRX_EL2.MSCEn is not set in HCRX_GUEST_FLAGS, and will take an exception to EL1 if executed. Signed-off-by: Kristina Martsenko Acked-by: Catalin Marinas Acked-by: Marc Zyngier Acked-by: Oliver Upton Link: https://lore.kernel.org/r/20230509142235.3284028-7-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas commit b1319c0e955933eae918a8a95c5361378ca86968 Author: Kristina Martsenko Date: Tue May 9 15:22:29 2023 +0100 arm64: mops: don't disable host MOPS instructions from EL2 To allow nVHE host EL0 and EL1 to use FEAT_MOPS instructions, configure EL2 to not cause these instructions to be treated as UNDEFINED. A VHE host is unaffected by this control. Reviewed-by: Catalin Marinas Signed-off-by: Kristina Martsenko Link: https://lore.kernel.org/r/20230509142235.3284028-6-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas commit f32c053b9806e42209d40e9ce7ed6f7f8be3be3b Author: Kristina Martsenko Date: Tue May 9 15:22:28 2023 +0100 arm64: mops: document boot requirements for MOPS FEAT_MOPS introduces new instructions, we require that these instructions not execute as UNDEFINED when we identify that the feature is supported. Signed-off-by: Kristina Martsenko Link: https://lore.kernel.org/r/20230509142235.3284028-5-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas commit 306b4c9f7120c485607cbbfa1ac3ecec005d8231 Author: Kristina Martsenko Date: Tue May 9 15:22:27 2023 +0100 KVM: arm64: switch HCRX_EL2 between host and guest Switch the HCRX_EL2 register between host and guest configurations, in order to enable different features in the host and guest. Now that there are separate guest flags, we can also remove SMPME from the host flags, as SMPME is used for virtualizing SME priorities and has no use in the host. Signed-off-by: Kristina Martsenko Acked-by: Marc Zyngier Acked-by: Oliver Upton Link: https://lore.kernel.org/r/20230509142235.3284028-4-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas commit b0c756fe996ac930033882ca56410639e5cad1ec Author: Kristina Martsenko Date: Tue May 9 15:22:26 2023 +0100 arm64: cpufeature: detect FEAT_HCX Detect if the system has the new HCRX_EL2 register added in ARMv8.7/9.2, so that subsequent patches can check for its presence. KVM currently relies on the register being present on all CPUs (or none), so the kernel will panic if that is not the case. Fortunately no such systems currently exist, but this can be revisited if they appear. Note that the kernel will not panic if CONFIG_KVM is disabled. Reviewed-by: Catalin Marinas Signed-off-by: Kristina Martsenko Link: https://lore.kernel.org/r/20230509142235.3284028-3-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas commit af94aad4c9150cca6781ad134c950fb05dff43f9 Author: Kristina Martsenko Date: Tue May 9 15:22:25 2023 +0100 KVM: arm64: initialize HCRX_EL2 ARMv8.7/9.2 adds a new hypervisor configuration register HCRX_EL2. Initialize the register to a safe value (all fields 0), to be robust against firmware that has not initialized it. This is also needed to ensure that the register is reinitialized after a kexec by a future kernel. In addition, move SMPME setup over to the new flags, as it would otherwise get overridden. It is safe to set the bit even if SME is not (uniformly) supported, as it will write to a RES0 bit (having no effect), and SME will be disabled by the cpufeature framework. (Similar to how e.g. the API bit is handled in HCR_HOST_NVHE_FLAGS.) Signed-off-by: Kristina Martsenko Acked-by: Marc Zyngier Acked-by: Oliver Upton Link: https://lore.kernel.org/r/20230509142235.3284028-2-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas commit 19db2062094c75c64039d820c2547aad4dcfd905 Author: Ville Syrjälä Date: Wed May 31 16:56:25 2023 +0300 drm/i915: No 10bit gamma on desktop gen3 parts Apparently desktop gen3 parts don't support the 10bit gamma mode at all. Stop claiming otherwise. As is the case with pipe A on gen3 mobile parts, the PIPECONF gamma mode bit can be set but it has no effect on the output. PNV seems to be the only slight exception, but generally the desktop PNV variant looks more like a mobile part so this is not entirely surprising. Fixes: 67630bacae23 ("drm/i915: Add 10bit gamma mode for gen2/3") Signed-off-by: Ville Syrjälä Reviewed-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20230531135625.3467-1-ville.syrjala@linux.intel.com commit 48989c0b25ca6ed75f3ea81053936ff0b64d02e7 Author: Rohit Agarwal Date: Fri May 19 14:39:06 2023 +0530 dt-bindings: arm-smmu: Add SDX75 SMMU compatible Add devicetree binding for Qualcomm SDX75 SMMU. Signed-off-by: Rohit Agarwal Acked-by: Conor Dooley Link: https://lore.kernel.org/r/1684487350-30476-5-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Will Deacon commit 44984d56e0598d7e80b9e544aaffd6700f5cb578 Author: Konrad Dybcio Date: Wed May 31 17:04:23 2023 +0200 dt-bindings: arm-smmu: Add SM6375 GPU SMMU SM6375 has a "Qualcomm SMMU V2" implementation for its GPU SMMU. It does not however qualify for the qcom,adreno-smmu compatible, as it can not do split pagetables. It consumes a single clock and a single genpd. Signed-off-by: Konrad Dybcio Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230531-topic-sm6375_gpusmmu-v1-1-860943894c71@linaro.org Signed-off-by: Will Deacon commit 387a80a7412543e2efe6bbf7dc150100900fc415 Author: Bartosz Golaszewski Date: Mon Apr 17 14:58:43 2023 +0200 dt-bindings: iommu: arm,smmu: enable clocks for sa8775p Adreno SMMU The GPU SMMU will require the clocks property to be set so put the relevant compatible into the adreno if-then block. Signed-off-by: Bartosz Golaszewski Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230417125844.400782-5-brgl@bgdev.pl [will: Fixed conflict with 'qcom,sc8280xp-smmu-500' entry] Signed-off-by: Will Deacon commit 84b8a7fe29205016cffd4eff91b45830d318b53d Author: Bjorn Andersson Date: Mon May 22 18:04:41 2023 -0700 dt-bindings: arm-smmu: Fix SC8280XP Adreno binding The qcom,sc8280xp-smmu-500 Adreno SMMU binding has clocks, so fix up the binding to allow this. Fixes: 38db6b41b2f4 ("dt-bindings: arm-smmu: Add compatible for Qualcomm SC8280XP") Signed-off-by: Bjorn Andersson Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230523010441.63236-1-quic_bjorande@quicinc.com Signed-off-by: Will Deacon commit 3ba12d8de3faa666ba2d6d01863feca73518a743 Author: Rafael J. Wysocki Date: Tue May 16 12:25:22 2023 +0200 ACPI: scan: Reduce overhead related to devices with dependencies Notice that all of the objects for which the acpi_scan_check_dep() return value is greater than 0 are present in acpi_dep_list as consumers (there may be multiple entries for one object, but that is not a problem), so after carrying out the initial ACPI namespace walk in which devices with dependencies are skipped, acpi_bus_scan() can simply walk acpi_dep_list and enumerate all of the unique consumer objects from there and their descendants instead of walking the entire target branch of the ACPI namespace and looking for device objects that have not been enumerated yet in it. Because walking acpi_dep_list is generally less overhead than walking the entire ACPI namespace, use the observation above to reduce the system initialization overhead related to ACPI, which is particularly important on large systems. Signed-off-by: Rafael J. Wysocki Reviewed-by: Hans de Goede commit d58bfcd4ea9910f59cf8327a36603e214e631b12 Author: Arun R Murthy Date: Fri Jun 2 07:51:57 2023 +0530 drm/i915/display: Print useful information on error For modifier not supporting async flip, print the modifier and display version. Helps in reading the error message. v2: Reframe the error message (Jani) Signed-off-by: Arun R Murthy Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230602022157.221225-1-arun.r.murthy@intel.com commit d6a95db3c7ad160bc16b89e36449705309b52bcb Author: Ye Bin Date: Mon Jun 5 22:07:31 2023 +0800 quota: fix warning in dqgrab() There's issue as follows when do fault injection: WARNING: CPU: 1 PID: 14870 at include/linux/quotaops.h:51 dquot_disable+0x13b7/0x18c0 Modules linked in: CPU: 1 PID: 14870 Comm: fsconfig Not tainted 6.3.0-next-20230505-00006-g5107a9c821af-dirty #541 RIP: 0010:dquot_disable+0x13b7/0x18c0 RSP: 0018:ffffc9000acc79e0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88825e41b980 RDX: 0000000000000000 RSI: ffff88825e41b980 RDI: 0000000000000002 RBP: ffff888179f68000 R08: ffffffff82087ca7 R09: 0000000000000000 R10: 0000000000000001 R11: ffffed102f3ed026 R12: ffff888179f68130 R13: ffff888179f68110 R14: dffffc0000000000 R15: ffff888179f68118 FS: 00007f450a073740(0000) GS:ffff88882fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffe96f2efd8 CR3: 000000025c8ad000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: dquot_load_quota_sb+0xd53/0x1060 dquot_resume+0x172/0x230 ext4_reconfigure+0x1dc6/0x27b0 reconfigure_super+0x515/0xa90 __x64_sys_fsconfig+0xb19/0xd20 do_syscall_64+0x39/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd Above issue may happens as follows: ProcessA ProcessB ProcessC sys_fsconfig vfs_fsconfig_locked reconfigure_super ext4_remount dquot_suspend -> suspend all type quota sys_fsconfig vfs_fsconfig_locked reconfigure_super ext4_remount dquot_resume ret = dquot_load_quota_sb add_dquot_ref do_open -> open file O_RDWR vfs_open do_dentry_open get_write_access atomic_inc_unless_negative(&inode->i_writecount) ext4_file_open dquot_file_open dquot_initialize __dquot_initialize dqget atomic_inc(&dquot->dq_count); __dquot_initialize __dquot_initialize dqget if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) ext4_acquire_dquot -> Return error DQ_ACTIVE_B flag isn't set dquot_disable invalidate_dquots if (atomic_read(&dquot->dq_count)) dqgrab WARN_ON_ONCE(!test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) -> Trigger warning In the above scenario, 'dquot->dq_flags' has no DQ_ACTIVE_B is normal when dqgrab(). To solve above issue just replace the dqgrab() use in invalidate_dquots() with atomic_inc(&dquot->dq_count). Signed-off-by: Ye Bin Signed-off-by: Jan Kara Message-Id: <20230605140731.2427629-3-yebin10@huawei.com> commit 6a4e3363792e30177cc3965697e34ddcea8b900b Author: Jan Kara Date: Mon Jun 5 22:07:30 2023 +0800 quota: Properly disable quotas when add_dquot_ref() fails When add_dquot_ref() fails (usually due to IO error or ENOMEM), we want to disable quotas we are trying to enable. However dquot_disable() call was passed just the flags we are enabling so in case flags == DQUOT_USAGE_ENABLED dquot_disable() call will just fail with EINVAL instead of properly disabling quotas. Fix the problem by always passing DQUOT_LIMITS_ENABLED | DQUOT_USAGE_ENABLED to dquot_disable() in this case. Reported-and-tested-by: Ye Bin Reported-by: syzbot+e633c79ceaecbf479854@syzkaller.appspotmail.com Signed-off-by: Jan Kara Message-Id: <20230605140731.2427629-2-yebin10@huawei.com> commit 1a764994102b150a3b9b965a33c76c2d11ff2f34 Merge: db987421b57cd 8c15a18331191 Author: Takashi Iwai Date: Mon Jun 5 16:49:20 2023 +0200 Merge branch 'topic/midi20' into for-next Pull fixes for a couple of minor issues spotted by bots. Signed-off-by: Takashi Iwai commit 8c15a18331191b67bdce54d21af068baec044baf Author: Takashi Iwai Date: Mon Jun 5 16:47:58 2023 +0200 ALSA: seq: Avoid confusion of aligned read size Currently the read event packet size in snd_seq_read() is defined by client->midi_version value that is guaranteed to be zero if UMP isn't enabled. But the static analyzer doesn't know of the fact, and it still suspects as if it were leading to a potential overflow. Add the more explicit check of CONFIG_SND_SEQ_UMP to determine the aligned_size value for avoiding the confusion. Fixes: 46397622a3fa ("ALSA: seq: Add UMP support") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202305261415.NY0vapZK-lkp@intel.com/ Link: https://lore.kernel.org/r/20230605144758.6677-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4f4e7112666b5aa1f179b4046299f85c09b46821 Author: Takashi Iwai Date: Mon Jun 5 16:47:57 2023 +0200 ALSA: usb-audio: Use __le16 for 16bit USB descriptor fields Use proper notion for 16bit values for fixing the sparse warnings. Fixes: f8ddb0fb3289 ("ALSA: usb-audio: Define USB MIDI 2.0 specs") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305260528.wcqjXso8-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202305270534.odwHL9F0-lkp@intel.com/ Link: https://lore.kernel.org/r/20230605144758.6677-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 1b5b1646e63d5ce43469e00680b8c1a3a1e034cd Author: James Clark Date: Tue Apr 25 15:35:40 2023 +0100 coresight: Fix CTI module refcount leak by making it a helper device The CTI module has some hard coded refcounting code that has a leak. For example running perf and then trying to unload it fails: perf record -e cs_etm// -a -- ls rmmod coresight_cti rmmod: ERROR: Module coresight_cti is in use The coresight core already handles references of devices in use, so by making CTI a normal helper device, we get working refcounting for free. Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-14-james.clark@arm.com commit 6148652807ba89b0c9af05ebed3e005b626f90eb Author: James Clark Date: Tue Apr 25 15:35:39 2023 +0100 coresight: Enable and disable helper devices adjacent to the path Currently CATU is the only helper device, and its enable and disable calls are hard coded. To allow more helper devices to be added in a generic way, remove these hard coded calls and just enable and disable all helper devices. This has to apply to helpers adjacent to the path, because they will never be in the path. CATU was already discovered in this way, so there is no change there. One change that is needed is for CATU to call back into ETR to allocate the buffer. Because the enable call was previously hard coded, it was done at a point where the buffer was already allocated, but this is no longer the case. Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-13-james.clark@arm.com commit 296b01fd106e787d4463974a7f42d286a5df08cd Author: James Clark Date: Tue Apr 25 15:35:38 2023 +0100 coresight: Refactor out buffer allocation function for ETR When CATU is moved to the generic enable/disable path system in the next commit, it will need to call into ETR and get it to pre-allocate its buffer so add a function for it. No functional changes Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-12-james.clark@arm.com commit ae7f2b5a7b569f8ede4af9e215515e5a0b824edd Author: James Clark Date: Tue Apr 25 15:35:37 2023 +0100 coresight: Make refcount a property of the connection This removes the need to do an additional lookup for the total number of ports used and also removes the need to allocate an array of refcounts which is just another representation of a connection array. This was only used for link type devices, for regular devices a single refcount on the coresight device is used. There is a both an input and output refcount in case two link type devices are connected together so that they don't overwrite each other's counts. Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-11-james.clark@arm.com commit e3f4e68797a960869ccae556ad63163b3dc470a2 Author: James Clark Date: Tue Apr 25 15:35:36 2023 +0100 coresight: Store in-connections as well as out-connections This will allow CATU to get its associated ETR in a generic way where currently the enable path has some hard coded searches which avoid the need to store input connections. This also means that the full search for connected devices on removal can be replaced with a loop through only the input and output devices. Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-10-james.clark@arm.com commit 102162dbac89b35eb04f3bd621d3673b0676637a Author: James Clark Date: Tue Apr 25 15:35:35 2023 +0100 coresight: Simplify connection fixup mechanism There is some duplication between coresight_fixup_device_conns() and coresight_fixup_orphan_conns(). They both do the same thing except for the fact that coresight_fixup_orphan_conns() can't handle iterating over itself. By making it able to handle fixing up it's own connections the other function can be removed. Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-9-james.clark@arm.com commit 4e8fe7e5c3a5e48295a6745727a6703adab8ff7f Author: James Clark Date: Tue Apr 25 15:35:34 2023 +0100 coresight: Store pointers to connections rather than an array of them This will allow the same connection object to be referenced via the input connection list in a later commit rather than duplicating them. Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-8-james.clark@arm.com commit 3d4ff657e454f8dba3e5e268e731e6e28c6031c1 Author: James Clark Date: Tue Apr 25 15:35:33 2023 +0100 coresight: Dynamically add connections Add a function for adding connections dynamically. This also removes the 1:1 mapping between port number and the index into the connections array. The only place this mapping was used was in the warning for duplicate output ports, which has been replaced by a search. Other uses of the port number already use the port member variable. Being able to dynamically add connections will allow other devices like CTI to re-use the connection mechanism despite not having explicit connections described in the DT. The connections array is now no longer sparse, so child_fwnode doesn't need to be checked as all connections have a target node. Because the array is no longer sparse, the high in and out port numbers are required for the refcount arrays. But these will also be removed in a later commit when the refcount is made a property of the connection. Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-7-james.clark@arm.com commit d49c9cf15f89cdd77f3ce3f0187fa1cfbdea28f5 Author: James Clark Date: Tue Apr 25 15:35:32 2023 +0100 coresight: Rename connection members to make the direction explicit When input connections are added they will use the same connection object as the output so parent and child could be misinterpreted. Making the direction unambiguous in the names should improve readability. Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-6-james.clark@arm.com commit 81d0ea763d8a1089749a9b671a730cef6cc5c5d7 Author: James Clark Date: Tue Apr 25 15:35:31 2023 +0100 coresight: Rename nr_outports to nr_outconns Rename to avoid confusion between port number and the index in the connection array. The port number is already stored in the connection, and in a later commit the connection array will be appended to, so the length of it will no longer reflect the number of ports. No functional changes. Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-5-james.clark@arm.com commit 704faaf4e33ca0bd9caa1e06c379c32a13d8c3f2 Author: James Clark Date: Tue Apr 25 15:35:30 2023 +0100 coresight: Change name of pdata->conns conns is actually for output connections. Change the name to make it clearer and so that we can add input connections later. No functional changes. Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-4-james.clark@arm.com commit 9fa3682869d4e1632f0fb2ed18c4cece101ace57 Author: James Clark Date: Tue Apr 25 15:35:29 2023 +0100 coresight: Use enum type for cs_mode wherever possible mode is stored as a local_t, but it is also passed around a lot as a plain u32, so use the correct type wherever local_t isn't currently used. This helps a little bit with readability. Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-3-james.clark@arm.com commit c45b2835e7b205783bdfe08cc98fa86a7c5eeb74 Author: James Clark Date: Tue Apr 25 15:35:28 2023 +0100 coresight: Fix loss of connection info when a module is unloaded child_fwnode should be a read only property based on the DT or ACPI. If it's cleared on the parent device when a child is unloaded, then when the child is loaded again the connection won't be remade. child_dev should be cleared instead which signifies that the connection should be remade when the child_fwnode registers a new coresight_device. Similarly the reference count shouldn't be decremented as long as the parent device exists. The correct place to drop the reference is in coresight_release_platform_data() which is already done. Reproducible on Juno with the following steps: # load all coresight modules. $ cd /sys/bus/coresight/devices/ $ echo 1 > tmc_etr0/enable_sink $ echo 1 > etm0/enable_source # Works fine ^ $ echo 0 > etm0/enable_source $ rmmod coresight-funnel $ modprobe coresight-funnel $ echo 1 > etm0/enable_source -bash: echo: write error: Invalid argument Fixes: 37ea1ffddffa ("coresight: Use fwnode handle instead of device names") Fixes: 2af89ebacf29 ("coresight: Clear the connection field properly") Tested-by: Suzuki K Poulose Reviewed-by: Mike Leach Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230425143542.2305069-2-james.clark@arm.com commit 269f49f9cb1e94732ec1738d0b1af4653cadd2f5 Author: Tiezhu Yang Date: Tue May 30 18:10:01 2023 +0800 perf LoongArch: Simplify mksyscalltbl In order to print the numerical entries of the syscall table, there is no need to call the host compiler to build and then run a program, this can be done directly by the shell script. This is similar with commit 9854e7ad35fe ("perf arm64: Simplify mksyscalltbl"). For now, the mksyscalltbl file of LoongArch is almost same with arm64. Reviewed-by: Huacai Chen Reviewed-by: Leo Yan Signed-off-by: Tiezhu Yang Acked-by: Ian Rogers Cc: Ingo Molnar Cc: Peter Zijlstra Cc: loongarch@lists.linux.dev Link: https://lore.kernel.org/r/1685441401-8709-6-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Arnaldo Carvalho de Melo commit 250e30badf11001a1015ca51a9d9cba2cf34fb97 Author: Tiezhu Yang Date: Tue May 30 18:10:00 2023 +0800 perf arm64: Use max_nr to define SYSCALLTBL_ARM64_MAX_ID Like x86, powerpc, mips and s390, use max_nr which is a digital number to define SYSCALLTBL_ARM64_MAX_ID. Reviewed-by: Huacai Chen Signed-off-by: Tiezhu Yang Acked-by: Ian Rogers Cc: Ingo Molnar Cc: Peter Zijlstra Cc: loongarch@lists.linux.dev Link: https://lore.kernel.org/r/1685441401-8709-5-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Arnaldo Carvalho de Melo commit 8be3593b9efa8903d2ee7bb9cdf57a8e56c66f36 Author: Marc Zyngier Date: Sun May 28 09:02:05 2023 +0100 drivers/perf: apple_m1: Force 63bit counters for M2 CPUs Sidharth reports that on M2, the PMU never generates any interrupt when using 'perf record', which is a annoying as you get no sample. I'm temped to say "no sample, no problem", but others may have a different opinion. Upon investigation, it appears that the counters on M2 are significantly different from the ones on M1, as they count on 64 bits instead of 48. Which of course, in the fine M1 tradition, means that we can only use 63 bits, as the top bit is used to signal the interrupt... This results in having to introduce yet another flag to indicate yet another odd counter width. Who knows what the next crazy implementation will do... With this, perf can work out the correct offset, and 'perf record' works as intended. Tested on M2 and M2-Pro CPUs. Cc: Janne Grunau Cc: Hector Martin Cc: Mark Rutland Cc: Will Deacon Fixes: 7d0bfb7c9977 ("drivers/perf: apple_m1: Add Apple M2 support") Reported-by: Sidharth Kshatriya Tested-by: Sidharth Kshatriya Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230528080205.288446-1-maz@kernel.org Signed-off-by: Will Deacon commit d6e1cc6b7220073d6d5d2edd79edf2d36da046bf Author: Tiezhu Yang Date: Tue May 30 18:09:59 2023 +0800 perf arm64: Handle __NR3264_ prefixed syscall number After commit 9854e7ad35fe ("perf arm64: Simplify mksyscalltbl"), in the generated syscall table file syscalls.c, there exist some __NR3264_ prefixed syscall numbers such as [__NR3264_ftruncate], it looks like not so good, just do some small filter operations to handle __NR3264_ prefixed syscall number as a digital number. Without this patch: [__NR3264_ftruncate] = "ftruncate", With this patch: [46] = "ftruncate", Suggested-by: Alexander Kapshuk Reviewed-by: Huacai Chen Reviewed-by: Leo Yan Signed-off-by: Tiezhu Yang Acked-by: Ian Rogers Cc: Ingo Molnar Cc: Peter Zijlstra Cc: loongarch@lists.linux.dev Link: https://lore.kernel.org/r/1685441401-8709-4-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Arnaldo Carvalho de Melo commit 0d0db47634611bf25bb933fec801faa91702a3ab Author: Tiezhu Yang Date: Tue May 30 18:09:58 2023 +0800 perf arm64: Rename create_table_from_c() to create_sc_table() After commit 9854e7ad35fecf30 ("perf arm64: Simplify mksyscalltbl") it has been removed the temporary C program and used shell to generate syscall table, so let us rename create_table_from_c() to create_sc_table() to avoid confusion. Suggested-by: Leo Yan Reviewed-by: Huacai Chen Signed-off-by: Tiezhu Yang Acked-by: Ian Rogers Cc: Ingo Molnar Cc: Peter Zijlstra Cc: loongarch@lists.linux.dev Link: https://lore.kernel.org/r/1685441401-8709-3-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Arnaldo Carvalho de Melo commit 49f3806d89e4cf9e330b6f2e39db1c913a8fd25a Author: Tiezhu Yang Date: Tue May 30 18:09:57 2023 +0800 perf tools: Declare syscalltbl_*[] as const for all archs syscalltbl_*[] should never be changing, let us declare it as const. Suggested-by: Ian Rogers Reviewed-by: Huacai Chen Signed-off-by: Tiezhu Yang Acked-by: Ian Rogers Cc: Ingo Molnar Cc: Peter Zijlstra Cc: loongarch@lists.linux.dev Link: https://lore.kernel.org/r/1685441401-8709-2-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Arnaldo Carvalho de Melo commit 71746c995cac92fcf6a65661b51211cf2009d7f0 Author: Robin Murphy Date: Wed May 24 17:44:32 2023 +0100 perf/arm-cmn: Fix DTC reset It turns out that my naive DTC reset logic fails to work as intended, since, after checking with the hardware designers, the PMU actually needs to be fully enabled in order to correctly clear any pending overflows. Therefore, invert the sequence to start with turning on both enables so that we can reliably get the DTCs into a known state, then moving to our normal counters-stopped state from there. Since all the DTM counters have already been unpaired during the initial discovery pass, we just need to additionally reset the cycle counters to ensure that no other unexpected overflows occur during this period. Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver") Reported-by: Geoff Blake Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/0ea4559261ea394f827c9aee5168c77a60aaee03.1684946389.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 7bd42f122c7cf1e8101519dced3e07866b81e0d2 Author: Christophe JAILLET Date: Thu May 18 10:18:08 2023 +0200 perf: qcom_l2_pmu: Make l2_cache_pmu_probe_cluster() more robust If an error occurs after calling list_add(), the &l2cache_pmu->clusters list will reference some memory that will be freed when the managed resources will be released. Move the list_add() at the end of the function when everything is in fine. This is harmless because if l2_cache_pmu_probe_cluster() fails, then l2_cache_pmu_probe() will fail as well and 'l2cache_pmu' will be released as well. But it looks cleaner and could silence static checker warning. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/6a0f5bdb6b7b2ed4ef194fc49693e902ad5b95ea.1684397879.git.christophe.jaillet@wanadoo.fr Signed-off-by: Will Deacon commit 013413cdfeec53e06c43a239fb4e06a39ffedce3 Author: Masahiro Yamada Date: Mon Jun 5 21:00:21 2023 +0900 drm/bridge: imx: turn imx8{qm,qxp}-ldb into single-object modules With the previous fix, these modules are built from a single C file. Rename the source files so they match the module names. Signed-off-by: Masahiro Yamada Reviewed-by: Laurent Pinchart Reviewed-by: Liu Ying Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230605120021.1774711-2-masahiroy@kernel.org commit a272cadbd8834c06cc2e34213202cc6be2c8fc19 Author: Masahiro Yamada Date: Mon Jun 5 21:00:20 2023 +0900 drm/bridge: imx: fix mixed module-builtin object With CONFIG_DRM_IMX8QM_LDB=m and CONFIG_DRM_IMX8QXP_LDB=y (or vice versa), imx-ldb-helper.o is linked to a module and also to vmlinux even though the expected CFLAGS are different between builtins and modules. This is the same situation as fixed by commit 637a642f5ca5 ("zstd: Fixing mixed module-builtin objects"). Split imx-ldb-helper.c into a separate module. Signed-off-by: Masahiro Yamada Reviewed-by: Laurent Pinchart Reviewed-by: Liu Ying Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230605120021.1774711-1-masahiroy@kernel.org commit f818947a06183dee7c2afc6648c75149586bf288 Author: Christophe JAILLET Date: Thu Apr 20 22:27:24 2023 +0200 perf/arm-cci: Slightly optimize cci_pmu_sync_counters() When the 'mask' bitmap is cleared, it is better to use its full maximum size instead of only the needed size. This lets the compiler optimize it because the size is now known at compile time. HW_CNTRS_MAX is small (i.e. currently 9), so a call to memset() is saved. Also, as 'mask' is local to the function, the non-atomic __set_bit() can also safely be used here. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/88d4e20d595f771396e9d558c1587eb4494057db.1682022422.git.christophe.jaillet@wanadoo.fr Signed-off-by: Will Deacon commit a00d47f7645d6e840a38a62fd961c8aa2c8fed6c Author: Geert Uytterhoeven Date: Fri Jun 2 10:50:41 2023 +0200 soc: renesas: rmobile-sysc: Convert to readl_poll_timeout_atomic() Use readl_poll_timeout_atomic() instead of open-coding the same operation. 1. rmobile_pd_power_down(): as typically less than 20 retries are needed, PSTR_RETRIES (100) µs is a suitable timeout value. 2. __rmobile_pd_power_up(): the old method of first polling some cycles with a 1 µs delay, followed by more polling cycles without any delay didn't make much sense, as the latter was insignificant compared to the former. Furthermore, typically no retries are needed. Hence just retain the polling with delay. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/ae4bf03ab8fd5a557c683086958d6764babc0723.1685692810.git.geert+renesas@glider.be commit a1b1dd71882f7b9e80e3d1cd4314d17613aafda4 Merge: cb9a39aacd3d6 7349a69cf3125 Author: Geert Uytterhoeven Date: Mon Jun 5 15:43:21 2023 +0200 Merge tag 'iopoll-busy-loop-timeout-tag' into renesas-drivers-for-v6.5 iopoll: Busy loop and timeout improvements commit 7df8eea64a417f1db6777cddc1d7eda3634b7175 Author: Geert Uytterhoeven Date: Fri Jun 2 10:50:40 2023 +0200 clk: renesas: rzg2l: Convert to readl_poll_timeout_atomic() Use readl_poll_timeout_atomic() instead of open-coding the same operation. As typically no retries are needed, 10 µs is a suitable timeout value. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/900543d4b9abc1004e6aecdb676f23e5508ae96f.1685692810.git.geert+renesas@glider.be commit d0414e762f4d2151e29c1a89fafe0368d8362419 Author: Geert Uytterhoeven Date: Fri Jun 2 10:50:39 2023 +0200 clk: renesas: mstp: Convert to readl_poll_timeout_atomic() Use readl_poll_timeout_atomic() instead of open-coding the same operation. As typically no retries are needed, 10 µs is a suitable timeout value. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/bce7d0bdd80c800aa150f1868b610b7d94f4cc66.1685692810.git.geert+renesas@glider.be commit 14e53669cbf4ab361c849efbe12aa0f5bb5db5f6 Author: Geert Uytterhoeven Date: Fri Jun 2 10:50:38 2023 +0200 clk: renesas: cpg-mssr: Convert to readl_poll_timeout_atomic() Use readl_poll_timeout_atomic() instead of open-coding the same operation. As typically no retries are needed, 10 µs is a suitable timeout value. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/832d29fd9aa3239ea949535309d2bdb003d40c9e.1685692810.git.geert+renesas@glider.be commit f267be7907bffca1309ca064b617023633e91499 Merge: d1c20885d3b01 7349a69cf3125 Author: Geert Uytterhoeven Date: Mon Jun 5 15:41:13 2023 +0200 Merge tag 'iopoll-busy-loop-timeout-tag' into renesas-clk-for-v6.5 iopoll: Busy loop and timeout improvements commit 16203e9cd01896b4244100a8e3fb9f6e612ab2b1 Author: Arnaldo Carvalho de Melo Date: Fri Jun 2 15:38:25 2023 -0300 perf bench: Add missing setlocale() call to allow usage of %'d style formatting Without this we were not getting the thousands separator for big numbers. Noticed while developing 'perf bench uprobe', but the use of %' predates that, for instance 'perf bench syscall' uses it. Before: # perf bench uprobe all # Running uprobe/baseline benchmark... # Executed 1000 usleep(1000) calls Total time: 1054082243ns 1054082.243000 nsecs/op # After: # perf bench uprobe all # Running uprobe/baseline benchmark... # Executed 1,000 usleep(1000) calls Total time: 1,053,715,144ns 1,053,715.144000 nsecs/op # Fixes: c2a08203052f8975 ("perf bench: Add basic syscall benchmark") Cc: Adrian Hunter Cc: Andre Fredette Cc: Clark Williams Cc: Dave Tucker Cc: Davidlohr Bueso Cc: Derek Barbosa Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Tiezhu Yang Link: https://lore.kernel.org/lkml/ZH3lcepZ4tBYr1jv@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7349a69cf3125e92d48e442d9f400ba446fa314f Author: Geert Uytterhoeven Date: Fri Jun 2 10:50:37 2023 +0200 iopoll: Do not use timekeeping in read_poll_timeout_atomic() read_poll_timeout_atomic() uses ktime_get() to implement the timeout feature, just like its non-atomic counterpart. However, there are several issues with this, due to its use in atomic contexts: 1. When called in the s2ram path (as typically done by clock or PM domain drivers), timekeeping may be suspended, triggering the WARN_ON(timekeeping_suspended) in ktime_get(): WARNING: CPU: 0 PID: 654 at kernel/time/timekeeping.c:843 ktime_get+0x28/0x78 Calling ktime_get_mono_fast_ns() instead of ktime_get() would get rid of that warning. However, that would break timeout handling, as (at least on systems with an ARM architectured timer), the time returned by ktime_get_mono_fast_ns() does not advance while timekeeping is suspended. Interestingly, (on the same ARM systems) the time returned by ktime_get() does advance while timekeeping is suspended, despite the warning. 2. Depending on the actual clock source, and especially before a high-resolution clocksource (e.g. the ARM architectured timer) becomes available, time may not advance in atomic contexts, thus breaking timeout handling. Fix this by abandoning the idea that one can rely on timekeeping to implement timeout handling in all atomic contexts, and switch from a global time-based to a locally-estimated timeout handling. In most (all?) cases the timeout condition is exceptional and an error condition, hence any additional delays due to underestimating wall clock time are irrelevant. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Reviewed-by: Tony Lindgren Reviewed-by: Ulf Hansson Link: https://lore.kernel.org/r/3d2a2f4e553489392d871108797c3be08f88300b.1685692810.git.geert+renesas@glider.be commit b407460ee99033503993ac7437d593451fcdfe44 Author: Geert Uytterhoeven Date: Fri Jun 2 10:50:36 2023 +0200 iopoll: Call cpu_relax() in busy loops It is considered good practice to call cpu_relax() in busy loops, see Documentation/process/volatile-considered-harmful.rst. This can not only lower CPU power consumption or yield to a hyperthreaded twin processor, but also allows an architecture to mitigate hardware issues (e.g. ARM Erratum 754327 for Cortex-A9 prior to r2p0) in the architecture-specific cpu_relax() implementation. In addition, cpu_relax() is also a compiler barrier. It is not immediately obvious that the @op argument "function" will result in an actual function call (e.g. in case of inlining). Where a function call is a C sequence point, this is lost on inlining. Therefore, with agressive enough optimization it might be possible for the compiler to hoist the: (val) = op(args); "load" out of the loop because it doesn't see the value changing. The addition of cpu_relax() would inhibit this. As the iopoll helpers lack calls to cpu_relax(), people are sometimes reluctant to use them, and may fall back to open-coded polling loops (including cpu_relax() calls) instead. Fix this by adding calls to cpu_relax() to the iopoll helpers: - For the non-atomic case, it is sufficient to call cpu_relax() in case of a zero sleep-between-reads value, as a call to usleep_range() is a safe barrier otherwise. However, it doesn't hurt to add the call regardless, for simplicity, and for similarity with the atomic case below. - For the atomic case, cpu_relax() must be called regardless of the sleep-between-reads value, as there is no guarantee all architecture-specific implementations of udelay() handle this. Signed-off-by: Geert Uytterhoeven Acked-by: Peter Zijlstra (Intel) Acked-by: Arnd Bergmann Reviewed-by: Tony Lindgren Reviewed-by: Ulf Hansson Link: https://lore.kernel.org/r/45c87bec3397fdd704376807f0eec5cc71be440f.1685692810.git.geert+renesas@glider.be commit b1de86d4248b273cb12c4cd7d20c08d459519f7d Author: Roberto Sassu Date: Mon Mar 6 11:40:36 2023 +0100 evm: Complete description of evm_inode_setattr() Add the description for missing parameters of evm_inode_setattr() to avoid the warning arising with W=n compile option. Fixes: 817b54aa45db ("evm: add evm_inode_setattr to prevent updating an invalid security.evm") # v3.2+ Fixes: c1632a0f1120 ("fs: port ->setattr() to pass mnt_idmap") # v6.3+ Signed-off-by: Roberto Sassu Reviewed-by: Stefan Berger Signed-off-by: Mimi Zohar commit 43cff7d94370c35ad7d96c9764b3b12f7735e6cc Author: Damien Le Moal Date: Mon Jun 5 08:27:14 2023 +0900 ata: libata-scsi: Use ata_ncq_supported in ata_scsi_dev_config() In ata_scsi_dev_config(), instead of hard-coding the test to check if an ATA device supports NCQ by looking at the ATA_DFLAG_NCQ flag, use ata_ncq_supported(). Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: John Garry Reviewed-by: Johannes Thumshirn commit 82078b9895bd46ce69b4a73e2da40e7e2202fdb5 Author: Chuck Lever Date: Thu May 18 13:45:36 2023 -0400 NFSD: Ensure that xdr_write_pages updates rq_next_page All other NFSv[23] procedures manage to keep page_ptr and rq_next_page in lock step. Signed-off-by: Chuck Lever commit 66a21db7db59f279a9fcb6445fa36dc6eb001b3c Author: Chuck Lever Date: Tue May 16 10:26:15 2023 -0400 NFSD: Replace encode_cinfo() De-duplicate "reserve_space; encode_cinfo". Signed-off-by: Chuck Lever commit adaa7a50d027b91ee6d56ae8b0a3f6edf5a78776 Author: Chuck Lever Date: Tue May 16 10:26:09 2023 -0400 NFSD: Add encoders for NFSv4 clientids and verifiers Deduplicate some common code. Signed-off-by: Chuck Lever commit 88e4d41a264d00fbfd344eb2485c1c59096197f4 Author: Chuck Lever Date: Mon May 15 09:47:36 2023 -0400 SUNRPC: Use __alloc_bulk_pages() in svc_init_buffer() Clean up: Use the bulk page allocator when filling a server thread's buffer page array. Signed-off-by: Chuck Lever commit 5f7fc5d69f6e92ec0b38774c387f5cf7812c5806 Author: Chuck Lever Date: Mon May 15 09:47:29 2023 -0400 SUNRPC: Resupply rq_pages from node-local memory svc_init_buffer() is careful to allocate the initial set of server thread buffer pages from memory on the local NUMA node. svc_alloc_arg() should also be that careful. Signed-off-by: Chuck Lever commit 39d432fc76301cf0a0c454022117601994ca9397 Author: Chuck Lever Date: Mon May 15 09:35:50 2023 -0400 NFSD: trace nfsctl operations Add trace log eye-catchers that record the arguments used to configure NFSD. This helps when troubleshooting the NFSD administrative interfaces. These tracepoints can capture NFSD start-up and shutdown times and parameters, changes in lease time and thread count, and a request to end the namespace's NFSv4 grace period, in addition to the set of NFS versions that are enabled. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 3434d7aa77d24c5c4b3d4385084cfdb607f05dec Author: Chuck Lever Date: Mon May 15 09:35:44 2023 -0400 NFSD: Clean up nfsctl_transaction_write() For easier readability, follow the common convention: if (error) handle_error; continue_normally; No behavior change is expected. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 442a629009818de2f8d9731cafb96e111ca8e4e6 Author: Chuck Lever Date: Mon May 15 09:35:38 2023 -0400 NFSD: Clean up nfsctl white-space damage Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit c42bebca967da88c054ccb5ab152c9822c054662 Author: Chuck Lever Date: Mon May 15 09:33:00 2023 -0400 SUNRPC: Trace struct svc_sock lifetime events Capture a timestamp and pointer address during the creation and destruction of struct svc_sock to record its lifetime. This helps to diagnose transport reference counting issues. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit d7900daea0b9818cd1cbeb9c5bd94653c487b0e4 Author: Chuck Lever Date: Mon May 15 09:32:53 2023 -0400 SUNRPC: Improve observability in svc_tcp_accept() The -ENOMEM arm could fire repeatedly if the system runs low on memory, so remove it. Don't bother to trace -EAGAIN error events, since those fire after a listener is created (with no work done) and once again after an accept has been handled successfully (again, with no work done). Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit cce4ee9c7834f68cf6a221d61d614c2748611c1c Author: Chuck Lever Date: Mon May 15 09:32:47 2023 -0400 SUNRPC: Remove dprintk() in svc_handle_xprt() When enabled, this dprintk() fires for every incoming RPC, which is an enormous amount of log traffic. These days, after the first few hundred log messages, the system journald is just going to mute it, along with all other NFSD debug output. Let's rely on trace points for this high-traffic information instead. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit e8277327d74fb28bf46969ad68a225272f04c318 Author: Chuck Lever Date: Mon May 15 09:32:41 2023 -0400 SUNRPC: Fix an incorrect comment The correct function name is svc_tcp_listen_data_ready(). Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit fc80fc2d4e39137869da3150ee169b40bf879287 Author: Ding Hui Date: Mon May 15 10:13:07 2023 +0800 SUNRPC: Fix UAF in svc_tcp_listen_data_ready() After the listener svc_sock is freed, and before invoking svc_tcp_accept() for the established child sock, there is a window that the newsock retaining a freed listener svc_sock in sk_user_data which cloning from parent. In the race window, if data is received on the newsock, we will observe use-after-free report in svc_tcp_listen_data_ready(). Reproduce by two tasks: 1. while :; do rpc.nfsd 0 ; rpc.nfsd; done 2. while :; do echo "" | ncat -4 127.0.0.1 2049 ; done KASAN report: ================================================================== BUG: KASAN: slab-use-after-free in svc_tcp_listen_data_ready+0x1cf/0x1f0 [sunrpc] Read of size 8 at addr ffff888139d96228 by task nc/102553 CPU: 7 PID: 102553 Comm: nc Not tainted 6.3.0+ #18 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020 Call Trace: dump_stack_lvl+0x33/0x50 print_address_description.constprop.0+0x27/0x310 print_report+0x3e/0x70 kasan_report+0xae/0xe0 svc_tcp_listen_data_ready+0x1cf/0x1f0 [sunrpc] tcp_data_queue+0x9f4/0x20e0 tcp_rcv_established+0x666/0x1f60 tcp_v4_do_rcv+0x51c/0x850 tcp_v4_rcv+0x23fc/0x2e80 ip_protocol_deliver_rcu+0x62/0x300 ip_local_deliver_finish+0x267/0x350 ip_local_deliver+0x18b/0x2d0 ip_rcv+0x2fb/0x370 __netif_receive_skb_one_core+0x166/0x1b0 process_backlog+0x24c/0x5e0 __napi_poll+0xa2/0x500 net_rx_action+0x854/0xc90 __do_softirq+0x1bb/0x5de do_softirq+0xcb/0x100 ... Allocated by task 102371: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 __kasan_kmalloc+0x7b/0x90 svc_setup_socket+0x52/0x4f0 [sunrpc] svc_addsock+0x20d/0x400 [sunrpc] __write_ports_addfd+0x209/0x390 [nfsd] write_ports+0x239/0x2c0 [nfsd] nfsctl_transaction_write+0xac/0x110 [nfsd] vfs_write+0x1c3/0xae0 ksys_write+0xed/0x1c0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc Freed by task 102551: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_save_free_info+0x2a/0x50 __kasan_slab_free+0x106/0x190 __kmem_cache_free+0x133/0x270 svc_xprt_free+0x1e2/0x350 [sunrpc] svc_xprt_destroy_all+0x25a/0x440 [sunrpc] nfsd_put+0x125/0x240 [nfsd] nfsd_svc+0x2cb/0x3c0 [nfsd] write_threads+0x1ac/0x2a0 [nfsd] nfsctl_transaction_write+0xac/0x110 [nfsd] vfs_write+0x1c3/0xae0 ksys_write+0xed/0x1c0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc Fix the UAF by simply doing nothing in svc_tcp_listen_data_ready() if state != TCP_LISTEN, that will avoid dereferencing svsk for all child socket. Link: https://lore.kernel.org/lkml/20230507091131.23540-1-dinghui@sangfor.com.cn/ Fixes: fa9251afc33c ("SUNRPC: Call the default socket callbacks instead of open coding") Signed-off-by: Ding Hui Cc: Signed-off-by: Chuck Lever commit 2d8ae8c417db284f598dffb178cc01e7db0f1821 Author: Christian Brauner Date: Tue May 2 15:36:02 2023 +0200 nfsd: use vfs setgid helper We've aligned setgid behavior over multiple kernel releases. The details can be found in commit cf619f891971 ("Merge tag 'fs.ovl.setgid.v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping") and commit 426b4ca2d6a5 ("Merge tag 'fs.setgid.v6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux"). Consistent setgid stripping behavior is now encapsulated in the setattr_should_drop_sgid() helper which is used by all filesystems that strip setgid bits outside of vfs proper. Usually ATTR_KILL_SGID is raised in e.g., chown_common() and is subject to the setattr_should_drop_sgid() check to determine whether the setgid bit can be retained. Since nfsd is raising ATTR_KILL_SGID unconditionally it will cause notify_change() to strip it even if the caller had the necessary privileges to retain it. Ensure that nfsd only raises ATR_KILL_SGID if the caller lacks the necessary privileges to retain the setgid bit. Without this patch the setgid stripping tests in LTP will fail: > As you can see, the problem is S_ISGID (0002000) was dropped on a > non-group-executable file while chown was invoked by super-user, while [...] > fchown02.c:66: TFAIL: testfile2: wrong mode permissions 0100700, expected 0102700 [...] > chown02.c:57: TFAIL: testfile2: wrong mode permissions 0100700, expected 0102700 With this patch all tests pass. Reported-by: Sherry Yang Signed-off-by: Christian Brauner Reviewed-by: Jeff Layton Cc: Signed-off-by: Chuck Lever commit d3e7c32b7d5c7132edca6d84499ec8ac2f060aa7 Author: Pierre-Louis Bossart Date: Fri Jun 2 15:56:20 2023 -0500 ASoC: SOF: Intel: hda: add helper to extract SoundWire link count The register changed with the HDaudio integration, the information is present in the extended link descriptor and not in the SHIM. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20230602205620.310879-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 730025cffedc6b8887d72031795796ac6d9947c3 Author: Pierre-Louis Bossart Date: Fri Jun 2 15:56:19 2023 -0500 ASoC: SOF: Intel: mtl: prepare for code reuse Some functions can be used for newer LNL hardware. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20230602205620.310879-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a0659f81c348946383526b764ad66d9900ea2cb9 Author: Pierre-Louis Bossart Date: Fri Jun 2 15:56:18 2023 -0500 ASoC: SOF: ipc4-topology: add DMA config TLV to IPC data This patch adds a DMA config TLV structure and the relevant code to copy this TLV after the gateway configuration. For now this is an iso-functionality change, the TLVs are not configured just yet. Additional patches will be needed for DMIC/SSP/ALH (aka SoundWire). Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20230602205620.310879-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 116bc1503652c72541d63f67c74b2ff1e4532f03 Author: Pierre-Louis Bossart Date: Fri Jun 2 15:56:17 2023 -0500 ASoC: SOF: ipc4-topology: introduce DMA config TLV Starting with LunarLake, the DMIC/SSP/SoundWire audio interfaces will use the HDaudio DMA. This patch adds the DMA configuration structure to be passed as a TLV appended at the end of each gateway configuration. This patch only provides the definitions for now, the TLV will be added in the actual blobs separately for each interface. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20230602205620.310879-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e186e1f237c1e2447a83059d48439ffcefbf5a93 Author: Pierre-Louis Bossart Date: Fri Jun 2 15:56:16 2023 -0500 ASoC: SOF: ipc4-topology: extend ALH-specific data structure LunarLake introduces a new TLV blob passed to the firmware for DMA configuration. This TLV structure is directly inspired by the ALH multi-gateway structure used so far. This patch suggest a transition to the more abstract structure with no references to ALH. This is an iso-functionality redefinition of structure, the TLV will be added in a follow-up patch. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20230602205620.310879-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d1bf58474d17a77a26bc27ff85a4e5c4fefc0934 Author: Pierre-Louis Bossart Date: Fri Jun 2 15:56:15 2023 -0500 ASoC: SOF: Intel: hda-dai: add get_hlink callback The existing code for HDAudio DAIs cannot be extended to other types of DAIs, specific programming sequences need to be abstracted away. This patch hides the mechanism to determine the multi-link structure related to the DAI and program the LOSIDV register. An added benefit is that we can remove all references to the codec DAI from what should be a CPU dai configuration only. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20230602205620.310879-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 767cda3fdac0faec84dc3fd654bd9d09b55eef40 Author: Pierre-Louis Bossart Date: Fri Jun 2 15:56:14 2023 -0500 ASoC: SOF: Intel: hda-dai: add calc_stream_format callback The existing code for HDAudio DAIs cannot be extended to other types of DAIs, specific programming sequences need to be abstracted away. This patch hides the stream format setup which is currently completely related to the HDaudio codec setup - not something that will work for other types of DAIs. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20230602205620.310879-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 2205c63d8d216b44127560cc564b2098843553e2 Author: Pierre-Louis Bossart Date: Fri Jun 2 15:56:13 2023 -0500 ASoC: SOF: Intel: hda-dai: add codec_dai_set_stream callback The existing code for HDAudio DAIs cannot be extended to other types of DAIs, specific programming sequences need to be abstracted away. Start here with hiding the stream_tag needed by the HDAudio codec_dai. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20230602205620.310879-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c4be6024d51d3930459a61d4c91990f20264c60b Author: Pierre-Louis Bossart Date: Fri Jun 2 15:56:12 2023 -0500 ASoC: SOF: Intel: hda-dai: add error checks to prevent static analysis warnings make KCFLAGS='-fanalyzer' sound/soc/sof/intel/ reports several NULL pointer dereference paths. Example log: ops = hda_dai_get_ops(substream, cpu_dai); | | ^~~~~ | | | | | (14) return of NULL to ‘non_hda_dai_hw_params’ from ‘hda_dai_get_ops’ | 353 | sdev = widget_to_sdev(w); | 354 | hext_stream = ops->get_hext_stream(sdev, cpu_dai, substream); | | ~~~~~~~~~~~~~~~~~~~~ | | | | | (15) dereference of NULL ‘ops’ The function hda_dai_get_ops() can return NULL, but the return value is not checked across the board. It's not a problem today, since we do check in the first use of the function, but static analysis tools are not aware of the different ALSA stages. Rather than argue forever, let's just add the error checks consistently and make sure this tool can be added to the CI checks. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230602205620.310879-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a0503817c0be5ea15164f64e06350e3363466021 Author: Uday M Bhat Date: Fri Jun 2 15:22:25 2023 -0500 ASoC: Intel: soc-acpi: add Rex CS42l42 and MAX98363 SoundWire entries Add support to the following daughter card for rex: SDW0: CS42l42 Headset SDW2: MX98363 Speaker Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Yong Zhi Signed-off-by: Uday M Bhat Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-29-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 164e5dc17525181c05563f0a06796f1a363801d5 Author: Uday M Bhat Date: Fri Jun 2 15:22:24 2023 -0500 ASoC: Intel: sof_sdw: Add support for Rex soundwire Add rex entry in the soundwire quirk table Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Yong Zhi Signed-off-by: Uday M Bhat Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-28-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit dea4138d7794f3041f6969bff637b7e5ed89ae90 Author: Uday M Bhat Date: Fri Jun 2 15:22:23 2023 -0500 ASoC: Intel: sof_sdw: Add support for MAX98363 codec Add support for MAX98363 soundwire codec. Update build configuration to include this codec. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Yong Zhi Signed-off-by: Uday M Bhat Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-27-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit fcb3f0fb4c7255b7617d3d0e98414ab36ddcbee3 Author: Uday M Bhat Date: Fri Jun 2 15:22:22 2023 -0500 ASoC: Intel: sof_sdw: Modify maxim helper functions and structure names Init function and structure names are modified to use maxim instead of max98373. Card components and speaker names are updated based on part id. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Yong Zhi Signed-off-by: Uday M Bhat Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-26-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 85565f8047668b6727127df539f7a6ecc0f9b9c0 Author: Uday M Bhat Date: Fri Jun 2 15:22:21 2023 -0500 ASoC: Intel: sof_sdw: Rename sof_sdw_max98373.c file to sof_sdw_maxim.c This is needed to use the common implementation for other maxim soundwire codecs Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Yong Zhi Signed-off-by: Uday M Bhat Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-25-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 43cdea08a4acc8f61daf0050f713314f0bfbedf7 Author: Uday M Bhat Date: Fri Jun 2 15:22:20 2023 -0500 ASoC: Intel: sof_sdw: Add helper function for cs42l42 codec Helper functions added to support CS42l42 soundwire codec. Build configuration is updated to include this codec. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Yong Zhi Signed-off-by: Uday M Bhat Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-24-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5dc51e50457a1ddafad47fcd668910a5bd91106f Author: Terry Cheong Date: Fri Jun 2 15:22:19 2023 -0500 ASoC: Intel: Add rpl_rt1019_rt5682 driver Boards were using this in older kernels before adl and rpl ids were split. Add this back to maintain support. Reviewed-by: Curtis Malainey Signed-off-by: Terry Cheong Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-23-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 1529d344dd49059c114c200dbe1c1a55d45ea120 Author: Balamurugan C Date: Fri Jun 2 15:22:18 2023 -0500 ASoC: Intel: Sof_ssp_amp: Correcting author name. Corrected the author name camel case and initial. Reviewed-by: Bard Liao Signed-off-by: Balamurugan C Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-22-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c3a3c06e05c244374fb773c80e4055a5e8aa45f7 Author: Balamurugan C Date: Fri Jun 2 15:22:17 2023 -0500 ASoC: Intel: ADL: Moving amp only boards into end of the table. Moving amp only boards into end of the match table to have better order and maintenance. Reviewed-by: Bard Liao Signed-off-by: Balamurugan C Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-21-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5376d37b2a8bf7382cd627504e27c5e42cdc820f Author: Balamurugan C Date: Fri Jun 2 15:22:16 2023 -0500 ASoC: Intel: ADL: Enable HDMI-In capture feature support for non-I2S codec boards. Adding HDMI-In capture support for the products doesn't have onboard I2S codec.but need to support HDMI-In capture via I2S and audio playback through HDMI/DP monitor. Reviewed-by: Bard Liao Signed-off-by: Balamurugan C Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-20-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 332f618756e61bee564e0919f97faef788c6a6e6 Author: Pierre-Louis Bossart Date: Fri Jun 2 15:22:15 2023 -0500 ASoC: Intel: sof-sdw: add Dell SKU 0B34 This device has no 3.5mm jack, only a single amplifier and mic codec. Closes: https://github.com/thesofproject/linux/issues/4399 Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-19-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b62a1a839b48f55046727089c3ba7a8ebbf97f0e Author: Pierre-Louis Bossart Date: Fri Jun 2 15:22:14 2023 -0500 ASoC: Intel: soc-acpi: add tables for Dell SKU 0B34 Yet another permutation of devices. Closes: https://github.com/thesofproject/linux/issues/4399 Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-18-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3daf02819ac3fd8d7605804a00213cf123ac880d Author: Pierre-Louis Bossart Date: Fri Jun 2 15:22:13 2023 -0500 ASoC: Intel: sof_sdw: add quick for Dell SKU 0BDA The SKU numbering isn't quite consistent with the existing RaptorLake SKUs but the PCI ID is definitively RaptorLake. Closes: https://github.com/thesofproject/linux/issues/4380 Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-17-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit eeb9f9f7e59d75c97909c3bd51574191d205765a Author: Pierre-Louis Bossart Date: Fri Jun 2 15:22:12 2023 -0500 ASoC: Intel: soc-acpi: add table for RPL Dell SKU 0BDA This is a standard configuration we've seen before for TGL. Closes: https://github.com/thesofproject/linux/issues/4380 Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-16-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 35d28ccd185cfbf5748d4d25dd013e41286a4bf2 Author: Bard Liao Date: Fri Jun 2 15:22:11 2023 -0500 ASoC: Intel: sof_sdw: increase sdw pin index for each sdw link To support multiple codecs per SoundWire link, we have to assign multiple CPU DAIs to different DAI links sharing the same physical link. This is not possible with the existing code since we assume that only 'Pin2' is used for playback and 'Pin3' used for capture - additional DAIs cannot be handled. This patch enables more CPU DAIs to be used, e.g. "SDW0 Pin2", "SDW0 Pin3", and "SDW0 Pin4" for SDW0-Playback-SimpleJack, SDW0-Capture-SimpleJack, and SDW0-Playback-SmartAmp DAI links on physical link #0. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit fbaaf80d8cf6f5da4397108efceca99abfaebbc8 Author: Bard Liao Date: Fri Jun 2 15:22:10 2023 -0500 ASoC: Intel: sof_sdw: add rt713 support rt713 is rt712 but without amp. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9efa6f46bc8b606df4226630c668af0e9d25ba7f Author: Bard Liao Date: Fri Jun 2 15:22:09 2023 -0500 ASoC: Intel: soc-acpi-intel-mtl-match: add rt712 ID Add rt712 ID for MTL. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a2f4d70921f218db768cf3e879fe87dea0a354a5 Author: Bard Liao Date: Fri Jun 2 15:22:08 2023 -0500 ASoC: Intel: soc-acpi-intel-tgl-match: add rt712 ID Add rt712 ID for TGL. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5360c67046385f90406ec17e367ba9aeb42d5459 Author: Bard Liao Date: Fri Jun 2 15:22:07 2023 -0500 ASoC: Intel: sof_sdw: add rt712 support Rt712 is a multi function codec which shpports headset, amp, and dmic functions. Rt712 has two sdw interfaces and codec drivers, one for jack and amp, the other for dmic. part id 0x712 is for jack and amp, and 0x1712 is for dmic. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 43f8012c3a6e2b33003ba7ec8c23fbb5bed2ca30 Author: Bard Liao Date: Fri Jun 2 15:22:06 2023 -0500 ASoC: Intel: sof_sdw: make rt711_sdca be generic Let rename rt711_sdca to rt_sdca_jack and let it be used for all Realtek sdca jacks. The commit uses component->name_prefix to construct card->components, and determine which codec it is. So, we have to set name_prefix properly. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 752d4de4c614d639fdb636e4a1ce102328696453 Author: Bard Liao Date: Fri Jun 2 15:22:05 2023 -0500 ASoC: Intel: sof_sdw: rename SOF_RT711_JDSRC to SOF_JACK_JDSRC Jack Detection source can be applied to all jacks, not only rt711. No function changes. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 526a1876fc48e2d0c0ea8ad63b58bdb2cc13047f Author: Bard Liao Date: Fri Jun 2 15:22:04 2023 -0500 ASoC: Intel: sof_sdw_rt_sdca_jack_common: test SOF_JACK_JDSRC in _exit if (!SOF_RT711_JDSRC(sof_sdw_quirk)) is tested in rt711_sdca_add_codec_ device_props(), and we don't add software node to the device if jack source is not set. We need to do the same test in sof_sdw_rt711_sdca_exit(), and avoid removing software node if jack source is not set. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d3fc5c4da599482a3ada60b26b22fa7de9c6da42 Author: Bard Liao Date: Fri Jun 2 15:22:03 2023 -0500 ASoC: Intel: sof_sdw: add multi dailink support for a codec A codec may support multiple dais for different purpose. For example, the rt712 codec supports jack and amp on different dais and machine driver needs to create different dailink for those dais. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5714aabdf9713297947615fd2325719a6f9db316 Author: Bard Liao Date: Fri Jun 2 15:22:02 2023 -0500 ASoC: Intel: sdw_sof: append dai_type and remove codec_type We append codec type to dailink name to distinguish different dailink on the same sdw link and direction. But we could create multi dailinks for a codec and the dailink name will be duplicated if we append codec type to the dailink name. Appending dai type instead of codec type can solve the issue. For example, if a codec supports JACK on dai 0 and AMP on dai 1, the existing code will create dailinks SDW0-Playback-SimpleJack or SDW0-Playback-SmartAmp for both dailinks, and it will be SDW0-Playback-SimpleJack for dailink 0 and SDW0-Playback-SmartAmp for dailink 1 after this change. Then codec type is not used any more and can be removed. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit cededa5a6486821402c5e9bb7fd3cfd71d7999bc Author: Bard Liao Date: Fri Jun 2 15:22:01 2023 -0500 ASoC: Intel: sof_sdw: add codec_info pointer codec_info_list[codec_index] is used multiple times in the create_sdw_dailink() function. Adding a codec_info pointer to shorten the code. This is a preparation for the following up patches. No function changed. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b274586533f516b35519f409a4d089341a9c2690 Author: Bard Liao Date: Fri Jun 2 15:22:00 2023 -0500 ASoC: Intel: sof_sdw: use predefine dailink id Currently, we assign dailink ids in order, and shift with codec type. The purpose is to have consistent dailink ids for topologies. This can be simplified if we have a predefined dailink id in sof_sdw_dai_info. We reuse the existing ids as the predefine ids. So the dailink ids will not be changed by this commit. With this change, we no longer need to check the adr order described in a snd_soc_acpi_link_adr array. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 07140abbbf9e3dc412a34ed4a60c4b0d58fbe192 Author: Bard Liao Date: Fri Jun 2 15:21:59 2023 -0500 ASoC: Intel: sof_sdw: add dai info The existing code create a dailink for a codec. However, we may need multi dailinks for a codec. This commit adds a new struct in sof_sdw_codec_info{} to store the dai info of a codec. The initial assumption if that we will create at most 3 dailink types for a codec, since this is the max known with upcoming SDCA devices. We may need to increase this number as new SDCA 'functions' become available. One strong assumption is that all dailinks exposed are independent, as per SDCA directions. This commit just moves some items into the new sof_sdw_dai_info struct. There is no function changed. Multi dais supported will be added in the follow up commits. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ba032909bb2d15fd3014c829fdc7a2a74a8b88ad Author: Bard Liao Date: Fri Jun 2 15:21:58 2023 -0500 ASoC: Intel: sof_sdw: add missing exit callback Somehow .exit = sof_sdw_rt_amp_exit was missing in rt1318 codec info. Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230602202225.249209-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a7bc2e8ddf3c8e1f5bfeb401f7ee112956cea259 Author: chenzhiyin Date: Thu Jun 1 05:24:00 2023 -0400 fs.h: Optimize file struct to prevent false sharing In the syscall test of UnixBench, performance regression occurred due to false sharing. The lock and atomic members, including file::f_lock, file::f_count and file::f_pos_lock are highly contended and frequently updated in the high-concurrency test scenarios. perf c2c indentified one affected read access, file::f_op. To prevent false sharing, the layout of file struct is changed as following (A) f_lock, f_count and f_pos_lock are put together to share the same cache line. (B) The read mostly members, including f_path, f_inode, f_op are put into a separate cache line. (C) f_mode is put together with f_count, since they are used frequently at the same time. Due to '__randomize_layout' attribute of file struct, the updated layout only can be effective when CONFIG_RANDSTRUCT_NONE is 'y'. The optimization has been validated in the syscall test of UnixBench. performance gain is 30~50%. Furthermore, to confirm the optimization effectiveness on the other codes path, the results of fsdisk, fsbuffer and fstime are also shown. Here are the detailed test results of unixbench. Command: numactl -C 3-18 ./Run -c 16 syscall fsbuffer fstime fsdisk Without Patch ------------------------------------------------------------------------ File Copy 1024 bufsize 2000 maxblocks 875052.1 KBps (30.0 s, 2 samples) File Copy 256 bufsize 500 maxblocks 235484.0 KBps (30.0 s, 2 samples) File Copy 4096 bufsize 8000 maxblocks 2815153.5 KBps (30.0 s, 2 samples) System Call Overhead 5772268.3 lps (10.0 s, 7 samples) System Benchmarks Partial Index BASELINE RESULT INDEX File Copy 1024 bufsize 2000 maxblocks 3960.0 875052.1 2209.7 File Copy 256 bufsize 500 maxblocks 1655.0 235484.0 1422.9 File Copy 4096 bufsize 8000 maxblocks 5800.0 2815153.5 4853.7 System Call Overhead 15000.0 5772268.3 3848.2 ======== System Benchmarks Index Score (Partial Only) 2768.3 With Patch ------------------------------------------------------------------------ File Copy 1024 bufsize 2000 maxblocks 1009977.2 KBps (30.0 s, 2 samples) File Copy 256 bufsize 500 maxblocks 264765.9 KBps (30.0 s, 2 samples) File Copy 4096 bufsize 8000 maxblocks 3052236.0 KBps (30.0 s, 2 samples) System Call Overhead 8237404.4 lps (10.0 s, 7 samples) System Benchmarks Partial Index BASELINE RESULT INDEX File Copy 1024 bufsize 2000 maxblocks 3960.0 1009977.2 2550.4 File Copy 256 bufsize 500 maxblocks 1655.0 264765.9 1599.8 File Copy 4096 bufsize 8000 maxblocks 5800.0 3052236.0 5262.5 System Call Overhead 15000.0 8237404.4 5491.6 ======== System Benchmarks Index Score (Partial Only) 3295.3 Signed-off-by: chenzhiyin Message-Id: <20230601092400.27162-1-zhiyin.chen@intel.com> Signed-off-by: Christian Brauner commit fd0a7ec379dbf21b7bfd81914381ae5281706ef5 Author: Arnd Bergmann Date: Mon Jun 5 10:58:29 2023 +0200 ASoC: amd: vangogh: select CONFIG_SND_AMD_ACP_CONFIG The vangogh driver just gained a link time dependency that now causes randconfig builds to fail: x86_64-linux-ld: sound/soc/amd/vangogh/pci-acp5x.o: in function `snd_acp5x_probe': pci-acp5x.c:(.text+0xbb): undefined reference to `snd_amd_acp_find_config' Fixes: e89f45edb747e ("ASoC: amd: vangogh: Add check for acp config flags in vangogh platform") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230605085839.2157268-1-arnd@kernel.org Signed-off-by: Mark Brown commit 12980c1f2f8a926dd634e27c700014b3246a99ec Author: Damien Le Moal Date: Mon Jun 5 08:16:32 2023 +0900 ata: libata-eh: Use ata_ncq_enabled() in ata_eh_speed_down() In ata_eh_speed_down(), instead of hard-coding the test on the device flags to detect if NCQ is supported and enabled, use ata_ncq_enabled(). Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: John Garry commit 04729b418f8b031712e6dbf5bffa7d639f8f211e Author: Moti Haimovski Date: Thu Apr 13 13:54:40 2023 +0300 accel/habanalabs: call to HW/FW err returns 0 when no events exist This commit modifies the call to retrieve HW or FW error events to return success when no events are pending, as done in the calls to other events. Signed-off-by: Moti Haimovski Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 57469c12060899b7b0768ace178c7e36501e2f21 Author: Ofir Bitton Date: Thu Apr 13 11:22:06 2023 +0300 accel/habanalabs: unsecure TPC bias registers User needs to be able to perform downcast / upcast of fp8_143 dtype. Hence bias register needs to be accessed by the user. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit cc7b790d412461520de49eb321a0aeed2735e5c4 Author: Dafna Hirschfeld Date: Wed Feb 8 16:16:08 2023 +0200 accel/habanalabs: do soft-reset using cpucp packet This is done depending on the FW version. The cpucp method is preferable and saves scratchpads resource. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit a12428acf823a1a367d38a4113b7365e3e5603bf Author: Dafna Hirschfeld Date: Tue Apr 18 11:39:44 2023 +0300 accel/habanalabs: check fw version using sw version The fw inner version is less trustable, instead use the fw general sw release version. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit dd5667ff6f9c52c6a49aa9725b80542793613036 Author: Dafna Hirschfeld Date: Thu Mar 16 10:20:44 2023 +0200 accel/habanalabs: extract and save the FW's SW major/minor/sub-minor It is not always possible to know the FW's SW version from the inner FW version. Therefore we should extract the general SW version in addition to the FW version and use it in functions like 'hl_is_fw_ver_below_1_9' etc. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3071247ca06195eed4261b99035e0c031fa5ddd0 Author: Dafna Hirschfeld Date: Sun Apr 2 12:05:43 2023 +0300 accel/habanalabs: rename fw_{major/minor}_version to fw_inner_{major/minor}_ver We later want to add fields for Firmware SW version. The current extracted FW version is the inner FW versioning so the new name is better and also better differentiate from the FW's SW version. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 9ef23f05aed4e1dd89b70cd2b8a5e35134ab90bb Author: Dafna Hirschfeld Date: Wed Mar 22 08:38:49 2023 +0200 accel/habanalabs: add helper to extract the FW major/minor the helper is extract_u32_until_given_char and can later be used to also get the major/minor of the sw version. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit f9b60242af3e2216ed03139bc2c14a02c54073ce Author: Moti Haimovski Date: Mon Apr 10 09:31:16 2023 +0300 accel/habanalabs: fix bug in free scratchpad memory This commit fixes a bug in Gaudi2 when freeing the scratchpad memory in case software init fails. Signed-off-by: Moti Haimovski Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 574ee40f514453d09ea2c5f3882b3b369b5ba027 Author: Koby Elbaz Date: Sun Apr 9 14:24:05 2023 +0300 accel/habanalabs: remove commented code that won't be used Once it was decided that these security settings are to be done by FW rather than by the driver, there's no reason to keep them in the code. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 9ce36082c1723d96603c667436a88866b3fde531 Author: Rakesh Ughreja Date: Wed Apr 5 09:12:29 2023 +0300 accel/habanalabs: allow user to modify EDMA RL register EDMA transpose workload requires to signal for every activation. User FW sends all the dummy signals to RD_LBW_RATE_LIM_CFG, to save lbw bandwidth. We need the user to be able to access that register to configure it. Signed-off-by: Rakesh Ughreja Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 1464fbd8bab958b771af3214bd5cb52cd5f612ed Author: Tal Cohen Date: Thu Mar 30 13:38:19 2023 +0300 accel/habanalabs: ignore false positive razwi In Gaudi2 asic, PSOC RAZWI may cause in HBW or LBW. The address that caused the error is read from HW register and printed by the Driver. There are cases where the Driver receives an indication on PSOC RAZWI error but the address value is zero. In that case, the indication is a false positive. The Driver should not "count" a PSOC RAZWI event error when the caused the address is zeroed. Signed-off-by: Tal Cohen Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d95f87d29cf2097485765baac5109cecb486b5ee Author: Tom Rix Date: Tue Apr 11 10:08:50 2023 -0400 accel/habanalabs: remove variable gaudi_irq_name gcc with W=1 reports drivers/accel/habanalabs/gaudi/gaudi.c:117:19: error: ‘gaudi_irq_name’ defined but not used [-Werror=unused-const-variable=] 117 | static const char gaudi_irq_name[GAUDI_MSI_ENTRIES][GAUDI_MAX_STRING_LEN] = { | ^~~~~~~~~~~~~~ This variable is not used so remove it. Signed-off-by: Tom Rix Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 4ff52a694e249d6a0bf3301bd8e83330bee9608f Merge: 812a05256d673 955b503b63178 Author: Mark Brown Date: Mon Jun 5 13:11:17 2023 +0100 Add NAU8825C support Merge series from David Lin : This series adds nau8825c support. The driver can be used on NAU8825B and NAU8825C. commit 42cffe980ce383893660d78e33340763ca1dadae Author: Josh Poimboeuf Date: Tue May 30 16:15:58 2023 -0700 livepatch: Make 'klp_stack_entries' static The 'klp_stack_entries' percpu array is only used in transition.c. Make it static. Fixes: e92606fa172f ("livepatch: Convert stack entries array to percpu") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305171329.i0UQ4TJa-lkp@intel.com/ Signed-off-by: Josh Poimboeuf Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/5115752fca6537720700f4bf5b178959dfbca41a.1685488550.git.jpoimboe@kernel.org commit d0e135408e196921da2c85ee424235382c9ed614 Author: Fabio M. De Francesco Date: Fri Jun 2 12:33:07 2023 +0200 highmem: Rename put_and_unmap_page() to unmap_and_put_page() With commit 849ad04cf562a ("new helper: put_and_unmap_page()"), Al Viro introduced the put_and_unmap_page() to use in those many places where we have a common pattern consisting of calls to kunmap_local() + put_page(). Obviously, first we unmap and then we put pages. Instead, the original name of this helper seems to imply that we first put and then unmap. Therefore, rename the helper and change the only known upstreamed user (i.e., fs/sysv) before this helper enters common use and might become difficult to find all call sites and instead easy to break the builds. Cc: Al Viro Signed-off-by: Fabio M. De Francesco Reviewed-by: Eric Biggers Message-Id: <20230602103307.5637-1-fmdefrancesco@gmail.com> Signed-off-by: Christian Brauner commit a49e482c52d551b46ec10fb12bbf5ad242848a59 Author: Michal Simek Date: Tue May 16 15:48:52 2023 +0200 MAINTAINERS: Switch to @amd.com emails @xilinx.com is still working but better to switch to new amd.com after AMD/Xilinx acquisition. Acked-by: Shubhrajyoti Datta Acked-by: Radhey Shyam Pandey Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/f7773fdd002f89578b9e5262692a563fe7be4123.1684244928.git.michal.simek@amd.com commit 207656f7d82f85181cb40e084c47d74e53714182 Merge: f1fcbaa18b28d e4bb55d6ccf0f Author: Arnd Bergmann Date: Mon Jun 5 13:19:10 2023 +0200 Merge branch 'nuvoton/ma35d1' into soc/newsoc This patchset adds initial support for the Nuvoton ma35d1 SoC, including initial device tree, clock driver, reset driver, and serial driver. This patchset cover letter is based from the initial support for Nuvoton ma35d1 to keep tracking the version history. This patchset had been applied to Linux kernel 6.4.0-rc5 and tested on the Nuvoton ma35d1 SOM evaluation board. (ma35d1 information: https://www.nuvoton.com/products/microprocessors/arm-cortex-a35-mpus/) MA35D1 porting on linux-5.10.y can be found at: https://github.com/OpenNuvoton/MPU-Family Link: https://lore.kernel.org/linux-arm-kernel/20230605040749.67964-1-ychuang570808@gmail.com/ [arnd: merging everything aside from the serial port driver for now, as that is still waiting for an Ack] * nuvoton/ma35d1: reset: Add Nuvoton ma35d1 reset driver support clk: nuvoton: Add clock driver for ma35d1 clock controller arm64: dts: nuvoton: Add initial ma35d1 device tree dt-bindings: serial: Document ma35d1 uart controller dt-bindings: arm: Add initial bindings for Nuvoton platform dt-bindings: reset: nuvoton: Document ma35d1 reset control dt-bindings: clock: nuvoton: add binding for ma35d1 clock controller arm64: defconfig: Add support for Nuvoton MA35 family SoCs arm64: Kconfig.platforms: Add config for Nuvoton MA35 platform Signed-off-by: Arnd Bergmann commit 067bf44de11ceae0d2787c86127a39a67b2d60a6 Author: Michal Simek Date: Tue May 23 10:00:09 2023 +0200 dt-bindings: usb: xilinx: Replace Manish by Piyush Manish no longer works for AMD/Xilinx and there is also no activity from him. That's why proposing Piyush as the best candidate instead. Acked-by: Krzysztof Kozlowski Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/504444f5c2f4e725ac39cba1d72032d5a00c7cda.1684828805.git.michal.simek@amd.com commit e4bb55d6ccf0f774d879630e048deac6a5b8b8a8 Author: Jacky Huang Date: Mon Jun 5 04:07:48 2023 +0000 reset: Add Nuvoton ma35d1 reset driver support This driver supports individual IP reset for the MA35D1. The reset control registers are a subset of the system control registers. Signed-off-by: Jacky Huang Reviewed-by: Philipp Zabel Reviewed-by: Ilpo Järvinen Signed-off-by: Arnd Bergmann commit 691521a367cf3c7b3add17addbd4daa6384890d6 Author: Jacky Huang Date: Mon Jun 5 04:07:47 2023 +0000 clk: nuvoton: Add clock driver for ma35d1 clock controller The clock controller generates clocks for the whole chip, including system clocks and all peripheral clocks. This driver support ma35d1 clock gating, divider, and individual PLL configuration. There are 6 PLLs in ma35d1 SoC: - CA-PLL for the two Cortex-A35 CPU clock - SYS-PLL for system bus, which comes from the companion MCU and cannot be programmed by clock controller. - DDR-PLL for DDR - EPLL for GMAC and GFX, Display, and VDEC IPs. - VPLL for video output pixel clock - APLL for SDHC, I2S audio, and other IPs. CA-PLL has only one operation mode. DDR-PLL, EPLL, VPLL, and APLL are advanced PLLs which have 3 operation modes: integer mode, fraction mode, and spread specturm mode. Signed-off-by: Jacky Huang Acked-by: Krzysztof Kozlowski Signed-off-by: Arnd Bergmann commit b69af09847323f67aeb8adbe214f5e2b4ad6b97a Author: Jacky Huang Date: Mon Jun 5 04:07:46 2023 +0000 arm64: dts: nuvoton: Add initial ma35d1 device tree Add initial device tree support for Nuvoton ma35d1 SoC, including cpu, clock, reset, and serial controllers. Add reference boards som-256m and iot-512m. Signed-off-by: Jacky Huang Acked-by: Krzysztof Kozlowski Signed-off-by: Arnd Bergmann commit 15b53677e786d94a647d77e1544a7a56fbc4584e Author: Jacky Huang Date: Mon Jun 5 04:07:45 2023 +0000 dt-bindings: serial: Document ma35d1 uart controller Add documentation that describes the nuvoton ma35d1 UART driver bindings. Signed-off-by: Jacky Huang Reviewed-by: Krzysztof Kozlowski Signed-off-by: Arnd Bergmann commit 0545810f7edaf0c2869eccdd97a3694b5a292e1d Author: Jacky Huang Date: Mon Jun 5 04:07:44 2023 +0000 dt-bindings: arm: Add initial bindings for Nuvoton platform Modify Nuvoton NPCM and MA35 platform board bindings - Move 'nuvoton,npcm-gcr.yaml' from 'bindings/arm/npcm' to 'bindings/soc/nuvoton'. - Rename the 'bindings/arm/npcm' directory to 'bindings/arm/nuvoton'. - Add bindings for ARMv8-based Nuvoton SoCs and platform boards, and include the initial bindings for ma35d1 series development boards. Modify MAINTAINERS - Remove the line for 'bindings/arm/npcm/' under ARM/NUVOTON NPCM, as it has been renamed. - Add ARM/NUVOTON MA35 for Nuvoton MA35 series SoCs maintainer and files. Signed-off-by: Jacky Huang Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Arnd Bergmann commit 476650a64b6b9467250269432f86c637fc35e835 Author: Jacky Huang Date: Mon Jun 5 04:07:43 2023 +0000 dt-bindings: reset: nuvoton: Document ma35d1 reset control Add the dt-bindings header for Nuvoton ma35d1, that gets shared between the reset controller and reset references in the dts. Add documentation to describe nuvoton ma35d1 reset driver. Signed-off-by: Jacky Huang Reviewed-by: Krzysztof Kozlowski Signed-off-by: Arnd Bergmann commit 2f8b5eb589cb4afa0f16e9a86f50d289729b95da Author: Jacky Huang Date: Mon Jun 5 04:07:42 2023 +0000 dt-bindings: clock: nuvoton: add binding for ma35d1 clock controller Add the dt-bindings header for Nuvoton ma35d1, that gets shared between the clock controller and clock references in the dts. Add documentation to describe nuvoton ma35d1 clock driver. Signed-off-by: Jacky Huang Reviewed-by: Krzysztof Kozlowski Signed-off-by: Arnd Bergmann commit 4cc2272447b806ba17d4fdfdfadcb9d1c5c3fe1f Author: Jacky Huang Date: Mon Jun 5 04:07:41 2023 +0000 arm64: defconfig: Add support for Nuvoton MA35 family SoCs This adds support for the Nuvoton MA35 family SoCs which are based on the Cortex-A35 Armv8-A 64-bit architecture. Signed-off-by: Jacky Huang Acked-by: Krzysztof Kozlowski Signed-off-by: Arnd Bergmann commit 64b88e9ff6c5bed70c57103bb481ea4d7fcc9548 Author: Jacky Huang Date: Mon Jun 5 04:07:40 2023 +0000 arm64: Kconfig.platforms: Add config for Nuvoton MA35 platform Add ARCH_NUVOTON configuration option for Nuvoton MA35 family SoCs. Signed-off-by: Jacky Huang Acked-by: Krzysztof Kozlowski Signed-off-by: Arnd Bergmann commit a5e0a69dc34b2acf211785e9ad9642c5aaea098b Author: Michal Simek Date: Tue May 23 09:56:57 2023 +0200 dt-bindings: xilinx: Remove Rajan, Jolly and Manish Rajan, Jolly and Manish are no longer work for AMD/Xilinx and there is no activity from them to continue to maintain bindings that's why remove them. Acked-by: Conor Dooley Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/9b252dd71c82593fa6b137eca2174d9ab6e57f7a.1684828606.git.michal.simek@amd.com commit 153fc203f68453d9c28e7347420e68fa3665613a Author: Michal Simek Date: Mon May 22 16:59:53 2023 +0200 arm64: zynqmp: Used fixed-partitions for QSPI in k26 Using fixed partitions is recommended way how to describe QSPI. Also add label for qspi flash memory to be able to reference it in future. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/7368dc772d8dc29477a880ac2065e2ecb98cf3f5.1684767562.git.michal.simek@amd.com commit f1d48a128a2a016cda9049355cd5db35a9644012 Author: Radhey Shyam Pandey Date: Mon May 22 16:59:52 2023 +0200 arm64: zynqmp: Add pmu interrupt-affinity Based on dt-binding "This property should present when there is more than a single SPI" that's also case that's why explicitly specify interrupt affinity to avoid incorrect usage. Signed-off-by: Radhey Shyam Pandey Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/dde2e4b5ac6018adb9bfae05bb3800af6b7c0f0e.1684767562.git.michal.simek@amd.com commit 1d831cade71883d0578e9f41d19d09b67f8263ac Author: Amit Kumar Mahapatra Date: Mon May 22 16:59:50 2023 +0200 arm64: zynqmp: Set qspi tx-buswidth to 4 All ZynqMP boards are setting up tx-buswidth to 1. Due to this the framework only issues 1-1-1 write commands to the GQSPI driver. But the GQSPI controller is capable of handling 1-4-4 write commands, so updated the tx-buswidth to 4. Using all 4 lines will increase the tx data transfer rate, as now the tx data will be transferred on four lines instead on single line. Signed-off-by: Amit Kumar Mahapatra Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/1f1b0028106d83aa06e0777e91862a07df100fa1.1684767562.git.michal.simek@amd.com commit f8673fd5700257576b23e0f6de71c153bac23978 Author: Ashok Reddy Soma Date: Mon May 22 16:59:49 2023 +0200 arm64: zynqmp: Fix usb node drive strength and slew rate As per design, all input/rx pins should have fast slew rate and 12mA drive strength. Rest all pins should be slow slew rate and 4mA drive strength. Fix usb nodes as per this and remove setting of slow slew rate for all the usb group pins. Signed-off-by: Ashok Reddy Soma Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/379071f44ceb27a0e32d74e13221640922d989d1.1684767562.git.michal.simek@amd.com commit c720a1f5e6ee8cb39c28435efc0819cec84d6ee2 Author: Michal Simek Date: Mon May 22 16:59:48 2023 +0200 arm64: zynqmp: Describe TI phy as ethernet-phy-id TI DP83867 is using strapping based on MIO pins. Tristate setup can influence PHY address. That's why switch description with ethernet-phy-id compatible string which enable calling reset. PHY itself setups phy address after power up or reset. Phy reset is done via gpio. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/b49904649a363f40dc9c4d3fa275e42129562082.1684767562.git.michal.simek@amd.com commit 4e4ddd3d1dee009a26a8a74822d4761287768a95 Author: Michal Simek Date: Tue May 30 12:42:41 2023 +0200 arm64: zynqmp: Switch to amd.com emails Update my and DPs email address to match current setup. Reviewed-by: Laurent Pinchart Acked-by: Krzysztof Kozlowski Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/108cbbbab29e13d386d38a779fd582f10844a030.1685443337.git.michal.simek@amd.com commit f5c8855de148f8a911842e8b9c81d2d2a5f3d37f Author: Michal Simek Date: Tue May 16 15:40:27 2023 +0200 arm64: zynqmp: Convert kv260-revA overlay to ASCII text File was in UTF-8 format but there is no reason for it. Convert it to ASCII/plain text. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/9161f4e1d449edd86e642b6769575b8e201fccf0.1684244418.git.michal.simek@amd.com commit d5c421d24d7eca0a2c9708cf0b3fbc1e63f9136a Author: Michal Simek Date: Tue May 16 15:51:08 2023 +0200 dt-bindings: xilinx: Switch xilinx.com emails to amd.com @xilinx.com is still working but better to switch to new amd.com after AMD/Xilinx acquisition. Acked-by: Sebastian Reichel Acked-by: Wolfram Sang # for I2C Acked-by: Mark Brown Acked-by: Jassi Brar Acked-by: Damien Le Moal Acked-by: Krzysztof Kozlowski Acked-by: Guenter Roeck Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/f5b2bd1e78407e4128fc8f0b5874ba723e710a88.1684245058.git.michal.simek@amd.com commit 3b062a086984d35a3c6d3a1c7841d0aa73aa76af Author: Zhipeng Wang Date: Wed May 24 15:34:16 2023 +0000 cpufreq: dt-platdev: Support building as module Make the cpufreq platdev driver as tristate so that it can be built as loadable module. Also add MODULE_LICENSE to support building as module. Signed-off-by: Zhipeng Wang [ Viresh: Merged two commits, included module.h ] Signed-off-by: Viresh Kumar commit 45623d33bfc055d8a9d53eded5dc9c1c977036ed Author: Damien Le Moal Date: Mon Jun 5 08:39:12 2023 +0900 ata: libata-sata: Improve ata_change_queue_depth() ata_change_queue_depth() implements different behaviors for ATA devices managed by libsas than for those managed by libata directly. Specifically, if a user attempts to set a device queue depth to a value larger than 32 (ATA_MAX_QUEUE), the queue depth is capped to the maximum and set to 32 for libsas managed devices whereas for libata managed devices, the queue depth is unchanged and an error returned to the user. This is due to the fact that for libsas devices, sdev->host->can_queue may indicate the host (HBA) maximum number of commands that can be queued rather than the device maximum queue depth. Change ata_change_queue_depth() to provide a consistent behavior for all devices by changing the queue depth capping code to a check that the user provided value does not exceed the device maximum queue depth. This check is moved before the code clearing or setting the ATA_DFLAG_NCQ_OFF flag to ensure that this flag is not modified when an invlaid queue depth is provided. While at it, two other small improvements are added: 1) Use ata_ncq_supported() instead of ata_ncq_enabled() and clear the ATA_DFLAG_NCQ_OFF flag only and only if needed. 2) If the user provided queue depth is equal to the current queue depth, do not return an error as that is useless. Overall, the behavior of ata_change_queue_depth() for libata managed devices is unchanged. The behavior with libsas managed devices becomes consistent with libata managed devices. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: John Garry Reviewed-by: Johannes Thumshirn commit 69da40ac3481993d6f599c98e84fcdbbf0bcd7e0 Merge: 3db05776036b6 f5136877f421f Author: David S. Miller Date: Mon Jun 5 11:29:49 2023 +0100 Merge branch 'mlxsw-selftests-cleanups' Petr Machata says: ==================== mlxsw, selftests: Cleanups This patchset consolidates a number of disparate items that can all be considered cleanups. They are all related to mlxsw in that they are directly in mlxsw code, or in selftests that mlxsw heavily uses. - patch #1 fixes a comment, patch #2 propagates an extack - patches #3 and #4 tweak several loops to query a resource once and cache in a local variable instead of querying on each iteration - patches #5 and #6 fix selftest diagrams, and #7 adds a missing diagram into an existing test - patch #8 disables a PVID on a bridge in a selftest that should not need said PVID ==================== Signed-off-by: David S. Miller commit f5136877f421f298423e595fdf6a00e4e4c52706 Author: Petr Machata Date: Fri Jun 2 18:20:12 2023 +0200 selftests: router_bridge_vlan: Set vlan_default_pvid 0 on the bridge When everything is configured, VLAN membership on the bridge in this selftest are as follows: # bridge vlan show port vlan-id swp2 1 PVID Egress Untagged 555 br1 1 Egress Untagged 555 PVID Egress Untagged Note that it is possible for untagged traffic to just flow through as VLAN 1, instead of using VLAN 555 as intended by the test. This configuration seems too close to "works by accident", and it would be better to just shut out VLAN 1 altogether. To that end, configure vlan_default_pvid of 0: # bridge vlan show port vlan-id swp2 555 br1 555 PVID Egress Untagged Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: David S. Miller commit 812de4dfab98640ebf0fd443b326c04724bf7eb0 Author: Petr Machata Date: Fri Jun 2 18:20:11 2023 +0200 selftests: router_bridge_vlan: Add a diagram Add a topology diagram to this selftest to make the configuration easier to understand. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: David S. Miller commit 34ad708d1b4346ec4b0ee9c7aa1204c2d9734698 Author: Petr Machata Date: Fri Jun 2 18:20:10 2023 +0200 selftests: mlxsw: egress_vid_classification: Fix the diagram The topology diagram implies that $swp1 and $swp2 are members of the bridge br0, when in fact only their uppers, $swp1.10 and $swp2.10 are. Adjust the diagram. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: David S. Miller commit 204cc3d04fe26c1794e50211393a050c7635cccc Author: Petr Machata Date: Fri Jun 2 18:20:09 2023 +0200 selftests: mlxsw: ingress_rif_conf_1d: Fix the diagram The topology diagram implies that $swp1 and $swp2 are members of the bridge br0, when in fact only their uppers, $swp1.10 and $swp2.10 are. Adjust the diagram. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: David S. Miller commit 75426cc0b31616b11d635076bd1692f2ff2f4a5f Author: Petr Machata Date: Fri Jun 2 18:20:08 2023 +0200 mlxsw: spectrum_router: Do not query MAX_VRS on each iteration MLXSW_CORE_RES_GET involves a call to spectrum_core, a separate module. Instead of making the call on every iteration, cache it up front, and use the value. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: David S. Miller commit 3903249ee1afb9aa06d77e2c39c4be2d3df25e0e Author: Petr Machata Date: Fri Jun 2 18:20:07 2023 +0200 mlxsw: spectrum_router: Do not query MAX_RIFS on each iteration MLXSW_CORE_RES_GET involves a call to spectrum_core, a separate module. Instead of making the call on every iteration, cache it up front, and use the value. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: David S. Miller commit 5afef6748c19032ef9953b0b97f75fd0593178f3 Author: Petr Machata Date: Fri Jun 2 18:20:06 2023 +0200 mlxsw: spectrum_router: Use extack in mlxsw_sp~_rif_ipip_lb_configure() In commit 26029225d992 ("mlxsw: spectrum_router: Propagate extack further"), the mlxsw_sp_rif_ops.configure callback got a new argument, extack. However the callbacks that deal with tunnel configuration, mlxsw_sp1_rif_ipip_lb_configure() and mlxsw_sp2_rif_ipip_lb_configure(), were never updated to pass the parameter further. Do that now. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: David S. Miller commit be35db17c8729aa07aafec02e1201c06c03f22b0 Author: Petr Machata Date: Fri Jun 2 18:20:05 2023 +0200 mlxsw: spectrum_router: Clarify a comment "Reserved for X" usually means that only X is supposed to use a given object. Here, it is used in the sense that X should consider the object "reserved", as in "restricted". Replace the comment simply by "X", with the implication that that's where the field is used. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: David S. Miller commit 9c42edd571aa4f8b2125b71e3924eeb0f6a54af1 Author: Muralidhara M K Date: Mon May 15 11:35:36 2023 +0000 EDAC/amd64: Add support for AMD heterogeneous Family 19h Model 30h-3Fh AMD Family 19h Model 30h-3Fh systems can be connected to AMD MI200 accelerator/GPU devices such that the CPU and GPU data fabrics are connected together. In this configuration, the CPU manages error logging and reporting for MCA banks located on the GPUs. This includes HBM memory errors reported from Unified Memory Controllers (UMCs) on the GPUs. The GPU memory errors are handled like CPU memory errors. AMD CPU UMC support in EDAC can be re-used for GPU UMC support. However, keeping them separate means drastic changes in one path (e.g. to support newer products) should have less impact on the other path. Also, simplify the "gpu_" helper functions where possible. GPU product configuration, like memory type and channel count, is fixed compared to CPU products. GPU UMCs each have four physical connections (phys) connected to eight channels. There is a single "chip select". This differs from CPUs where each UMC has one physical connection connected to one channel, and each channel has up to four "chip selects". Enumerate each UMC "phy" as an EDAC CSROW, since there is only a single chip select for each physical connection. This is similar to how a CPU UMC "phy" is enumerated as an EDAC CHANNEL, since there is only a single channel for each physical connection. Signed-off-by: Muralidhara M K Co-developed-by: Naveen Krishna Chatradhi Signed-off-by: Naveen Krishna Chatradhi Co-developed-by: Yazen Ghannam Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230515113537.1052146-5-muralimk@amd.com commit 4f3fa571a48feb56e7ed1978a27983b89dd2107a Author: Muralidhara M K Date: Mon May 15 11:35:35 2023 +0000 EDAC/amd64: Document heterogeneous system enumeration Document High Bandwidth Memory (HBM) and AMD heterogeneous system topology and enumeration. [ bp: Simplify and de-marketize, unify, massage. ] Signed-off-by: Muralidhara M K Co-developed-by: Naveen Krishna Chatradhi Signed-off-by: Naveen Krishna Chatradhi Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230515113537.1052146-4-muralimk@amd.com commit c35977b00fa76ce5f3fe9afdb9cffda970c943d5 Author: Yazen Ghannam Date: Mon May 15 11:35:34 2023 +0000 x86/MCE/AMD, EDAC/mce_amd: Decode UMC_V2 ECC errors The MI200 (Aldebaran) series of devices introduced a new SMCA bank type for Unified Memory Controllers. The MCE subsystem already has support for this new type. The MCE decoder module will decode the common MCA error information for the new bank type, but it will not pass the information to the AMD64 EDAC module for detailed memory error decoding. Have the MCE decoder module recognize the new bank type as an SMCA UMC memory error and pass the MCA information to AMD64 EDAC. Signed-off-by: Yazen Ghannam Co-developed-by: Muralidhara M K Signed-off-by: Muralidhara M K Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230515113537.1052146-3-muralimk@amd.com commit f5e87cd5114e9c6d15a12922f26bdd6e24e508ee Author: Borislav Petkov (AMD) Date: Wed May 31 11:39:57 2023 +0200 x86/amd_nb: Re-sort and re-indent PCI defines Sort them by family, model and type and align them vertically for better readability. No functional changes. Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230531094212.GHZHcWdMDkCpAp4daj@fat_crate.local commit e15885689cf4bc92356e52ea6ef38379a749819a Author: Yazen Ghannam Date: Mon May 15 11:35:33 2023 +0000 x86/amd_nb: Add MI200 PCI IDs The AMD MI200 series accelerators are data center GPUs. They include unified memory controllers and a data fabric similar to those used in AMD x86 CPU products. The memory controllers report errors using MCA, though these errors are generally handled through GPU drivers that directly manage the accelerator device. In some configurations, memory errors from these devices will be reported through MCA and managed by x86 CPUs. The OS is expected to handle these errors in similar fashion to MCA errors originating from memory controllers on the CPUs. In Linux, this flow includes passing MCA errors to a notifier chain with handlers in the EDAC subsystem. The AMD64 EDAC module requires information from the memory controllers and data fabric in order to provide detailed decoding of memory errors. The information is read from hardware registers accessed through interfaces in the data fabric. The accelerator data fabrics are visible to the host x86 CPUs as PCI devices just like x86 CPU data fabrics are already. However, the accelerator fabrics have new and unique PCI IDs. Add PCI IDs for the MI200 series of accelerator devices in order to enable EDAC support. The data fabrics of the accelerator devices will be enumerated as any other fabric already supported. System-specific implementation details will be handled within the AMD64 EDAC module. [ bp: Scrub off marketing speak. ] Signed-off-by: Yazen Ghannam Co-developed-by: Muralidhara M K Signed-off-by: Muralidhara M K Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230515113537.1052146-2-muralimk@amd.com commit 3db05776036b694ece35a7933e2c537cb90881b2 Merge: f91e32dea6393 4739b9f3d211b Author: David S. Miller Date: Mon Jun 5 11:26:03 2023 +0100 Merge branch 'sja1105-cleanups' Russell King says: ==================== convert sja1105 xpcs creation and remove xpcs_create This series of three patches converts sja1105 to use the newly provided xpcs_create_mdiodev(), and as there become no users of xpcs_create(), removes this function from the global namespace to discourage future direct use. ==================== Signed-off-by: David S. Miller commit 4739b9f3d211b3c4ce9353fbfd9f22e2bcb64c17 Author: Russell King (Oracle) Date: Fri Jun 2 14:58:45 2023 +0100 net: pcs: xpcs: remove xpcs_create() from public view There are now no callers of xpcs_create(), so let's remove it from public view to discourage future direct usage. Signed-off-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit bf9a17b04c85345df6e53e4058a56513f41265cf Author: Russell King (Oracle) Date: Fri Jun 2 14:58:40 2023 +0100 net: dsa: sja1105: use xpcs_create_mdiodev() Use the new xpcs_create_mdiodev() creator, which simplifies the creation and destruction of the mdio device associated with xpcs. Signed-off-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9607eaadba68732b76c744bd22635fb1da5a7622 Author: Russell King (Oracle) Date: Fri Jun 2 14:58:35 2023 +0100 net: dsa: sja1105: allow XPCS to handle mdiodev lifetime Put the mdiodev after xpcs_create() so that the XPCS driver can manage the lifetime of the mdiodev its using. Signed-off-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9ff17e6bdaa50892dd9bdb1b116cb71b73dd711a Merge: d922b80b1010c 2e1492835e439 Author: Tvrtko Ursulin Date: Mon Jun 5 11:10:23 2023 +0100 Merge drm/drm-next into drm-intel-gt-next For conflict avoidance we need the following commit: c9a9f18d3ad8 drm/i915/huc: use const struct bus_type pointers Signed-off-by: Tvrtko Ursulin commit c3cc5c59cb16dbf14d8c52ac4df6650438613b5b Author: Biju Das Date: Fri May 26 14:57:38 2023 +0100 i2c: rzv2m: Disable the operation of unit in case of error The remove and suspend callbacks disable the operation of the unit. Do the same in probe() in case of error. While at it, introduce a helper function rzv2m_i2c_disable() for disabling the operation of the unit and this function is shared between probe error path, remove and suspend callbacks. Reported-by: Pavel Machek Signed-off-by: Biju Das Signed-off-by: Wolfram Sang commit 252f211bd0328c6a3d7d30eaf4d59a8363f3d578 Author: Biju Das Date: Fri May 26 14:57:37 2023 +0100 i2c: rzv2m: Replace lowercase macros with static inline functions Convert macros bit_setl and bit_clrl with static inline functions as normally we'd put macro names in all uppercase. Reported-by: Pavel Machek Signed-off-by: Biju Das Signed-off-by: Wolfram Sang commit 3c4b88de7e2f61a8c742c7cf0ae59e83cf1e6b35 Author: Biju Das Date: Fri May 26 14:57:36 2023 +0100 i2c: rzv2m: Drop extra space Drop extra space from the I2C_RZV2M config help description. Reported-by: Pavel Machek Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit 619a06dba6fa38de1b85c09ac74bb8aa2449ce0c Author: Mika Kahola Date: Thu Jun 1 13:13:14 2023 +0300 drm/i915/mtl: Reset only one lane in case of MFD In case when only two or less transmit lanes are owned such as MFD (DP-alt with x2 lanes) we need to reset only one data lane (lane0). With only x2 lanes we don't need to poll for the phy current status on both data lanes since only the owned data lane will respond. v2: Find better naming for lanes and revise the commit message (Luca) Reviewed-by: Arun R Murthy (v1) Signed-off-by: Mika Kahola Reviewed-by: Luca Coelho (v2) Signed-off-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20230601101314.332392-1-mika.kahola@intel.com commit 79a3908d1ea6c35157a6d907b1a9d8ec06015e7a Author: Christophe JAILLET Date: Sun Jun 4 17:42:28 2023 +0200 fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe() If 'mipid_detect()' fails, we must free 'md' to avoid a memory leak. Fixes: 66d2f99d0bb5 ("omapfb: add support for MIPI-DCS compatible LCDs") Signed-off-by: Christophe JAILLET Signed-off-by: Helge Deller commit 2f8d1ed793453b9f7a832c96d699bf3dca176280 Author: Jiawen Wu Date: Mon Jun 5 10:52:04 2023 +0800 i2c: designware: Add driver support for Wangxun 10Gb NIC Wangxun 10Gb ethernet chip is connected to Designware I2C, to communicate with SFP. Introduce the property "wx,i2c-snps-model" to match device data for Wangxun in software node case. Since IO resource was mapped on the ethernet driver, add a model quirk to get regmap from parent device. The exists IP limitations are dealt as workarounds: - IP does not support interrupt mode, it works on polling mode. - Additionally set FIFO depth address the chip issue. Signed-off-by: Jiawen Wu Reviewed-by: Piotr Raczynski Reviewed-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit d922b80b1010cd6164fa7d3c197b4fbf94b47beb Author: Tejas Upadhyay Date: Thu Jun 1 16:39:59 2023 +0530 drm/i915/gt: Add workaround 14016712196 For mtl, workaround suggests that, SW insert a dummy PIPE_CONTROL prior to PIPE_CONTROL which contains a post sync: Timestamp or Write Immediate. Bspec: 72197 V5: - Remove ret variable - Andi V4: - Update commit message, avoid returing cs - Andi/Matt V3: - Wrap dummy pipe control stuff in API - Andi V2: - Fix kernel test robot warnings Closes: https://lore.kernel.org/oe-kbuild-all/202305121525.3EWdGoBY-lkp@intel.com/ Signed-off-by: Tejas Upadhyay Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230601110959.1715927-1-tejas.upadhyay@intel.com commit f91e32dea63930ef9dfd3382d757865d9455cfb1 Merge: f69de8aa4752a 5d1f3fe7d2d54 Author: David S. Miller Date: Mon Jun 5 09:56:36 2023 +0100 Merge branch 'regmap-TSE-PCS' Maxime Chevallier says: ==================== net: add a regmap-based mdio driver and drop TSE PCS This is the V4 of a series that follows-up on the work [1] aiming to drop the altera TSE PCS driver, as it turns out to be a version of the Lynx PCS exposed as a memory-mapped block, instead of living on an MDIO bus. One step of this removal involved creating a regmap-based mdio driver that translates MDIO accesses into the actual underlying bus that exposes the register. The register layout must of course match the standard MDIO layout, but we can now account for differences in stride with recent work on the regmap subsystem [2]. Sorry for repeating this, but I didn't hear anything on this matter in previous iterations, Mark, Net maintainers, this series depends on the patch e12ff2876493 that was recently merged into the regmap tree [3]. For this series to be usable in net-next, this patch must be applied beforehand. Should Mark create a tag that would then be merged into net-next ? Or should we just wait for the next release to merge this into net-next ? This series introduces a new MDIO driver, and uses it to convert Altera TSE from the actual TSE PCS driver to Lynx PCS. Since it turns out dwmac_socfpga also uses a TSE PCS block, port that driver to Lynx as well. Changes in V4 : - Use new pcs_lynx_create/destroy helpers added by Russell - Rework the cleanup sequence to avoid leaking data - Rework a bit KConfig to properly select dependencies - Fix a few hiccups with misplaced hunks in 2 commits Changes in V3 : - Use a dedicated struct for the mii bus's priv data, to avoid duplicating the whole struct mdio_regmap_config, from which 2 fields only are necessary after init, as suggested by Russell - Use ~0 instead of ~0UL for the no-scan bitmask, following Simon's review. Changes in V2 : - Use phy_mask to avoid unnecessarily scanning the whole mdio bus - Go one step further and completely disable scanning if users set the .autoscan flag to false, in case the mdiodevice isn't an actual PHY (a PCS for example). ==================== Signed-off-by: David S. Miller commit 5d1f3fe7d2d54d04b44aa5b9b62b305fdcf653ec Author: Maxime Chevallier Date: Thu Jun 1 16:14:54 2023 +0200 net: stmmac: dwmac-sogfpga: use the lynx pcs driver dwmac_socfpga re-implements support for the TSE PCS, which is identical to the already existing TSE PCS, which in turn is the same as the Lynx PCS. Drop the existing TSE re-implemenation and use the Lynx PCS instead, relying on the regmap-mdio driver to translate MDIO accesses into mmio accesses. Add a lynx_pcs reference in the stmmac's internal structure, and use .mac_select_pcs() to return the relevant PCS to be used. Signed-off-by: Maxime Chevallier Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 196eec4062b006575e441ef00339c3ebcea26b8d Author: Maxime Chevallier Date: Thu Jun 1 16:14:53 2023 +0200 net: pcs: Drop the TSE PCS driver Now that we can easily create a mdio-device that represents a memory-mapped device that exposes an MDIO-like register layout, we don't need the Altera TSE PCS anymore, since we can use the Lynx PCS instead. Reviewed-by: Simon Horman Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit db48abbaa18e571106711b42affe68ca6f36ca5a Author: Maxime Chevallier Date: Thu Jun 1 16:14:52 2023 +0200 net: ethernet: altera-tse: Convert to mdio-regmap and use PCS Lynx The newly introduced regmap-based MDIO driver allows for an easy mapping of an mdiodevice onto the memory-mapped TSE PCS, which is actually a Lynx PCS. Convert Altera TSE to use this PCS instead of the pcs-altera-tse, which is nothing more than a memory-mapped Lynx PCS. Signed-off-by: Maxime Chevallier Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 642af0f92cbe01c4b05eb38a0fe94867a3798b34 Author: Maxime Chevallier Date: Thu Jun 1 16:14:51 2023 +0200 net: mdio: Introduce a regmap-based mdio driver There exists several examples today of devices that embed an ethernet PHY or PCS directly inside an SoC. In this situation, either the device is controlled through a vendor-specific register set, or sometimes exposes the standard 802.3 registers that are typically accessed over MDIO. As phylib and phylink are designed to use mdiodevices, this driver allows creating a virtual MDIO bus, that translates mdiodev register accesses to regmap accesses. The reason we use regmap is because there are at least 3 such devices known today, 2 of them are Altera TSE PCS's, memory-mapped, exposed with a 4-byte stride in stmmac's dwmac-socfpga variant, and a 2-byte stride in altera-tse. The other one (nxp,sja1110-base-tx-mdio) is exposed over SPI. Signed-off-by: Maxime Chevallier Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 79aa28494638f03a9e664163cb4620eb0482aaa2 Author: David Howells Date: Fri May 19 18:21:20 2023 +0100 cachefiles: Allow the cache to be non-root Set mode 0600 on files in the cache so that cachefilesd can run as an unprivileged user rather than leaving the files all with 0. Directories are already set to 0700. Userspace then needs to set the uid and gid before issuing the "bind" command and the cache must've been chown'd to those IDs. Signed-off-by: David Howells Reviewed-by: Jeff Layton Reviewed-by: Gao Xiang cc: David Howells cc: Jeff Layton cc: linux-cachefs@redhat.com cc: linux-erofs@lists.ozlabs.org cc: linux-fsdevel@vger.kernel.org Message-Id: <1853230.1684516880@warthog.procyon.org.uk> Signed-off-by: Christian Brauner commit 26e293f73fd76eeadfbad24d7d73481e211e5966 Author: Yihuan Pan Date: Sat May 20 15:23:32 2023 +0800 init: remove unused names parameter in split_fs_names() The split_fs_names() function takes a names parameter, but the function actually uses the root_fs_names global variable instead. This names parameter is not used in the function, so it can be safely removed. This change does not affect the functionality of split_fs_names() or any other part of the kernel. Signed-off-by: Yihuan Pan Reviewed-by: Christoph Hellwig Message-Id: <4lsiigvaw4lxcs37rlhgepv77xyxym6krkqcpc3xfncnswok3y@b67z3b44orar> Signed-off-by: Christian Brauner commit 4f5d68c8591498c3955dc0228ed6606c1b138278 Author: Michał Mirosław Date: Sat May 6 23:19:02 2023 +0200 i2c: tegra: allow VI support to be compiled out Save a bit of code for older Tegra platforms by compiling out VI's I2C mode support that's used only for Tegra210. $ size i2c-tegra.o text data bss dec hex filename 11381 292 8 11681 2da1 i2c-tegra.o (full) 10193 292 8 10493 28fd i2c-tegra.o (no-dvc) 9145 292 8 9445 24e5 i2c-tegra.o (no-vi,no-dvc) Signed-off-by: Michał Mirosław Reviewed-by: Dmitry Osipenko Signed-off-by: Wolfram Sang commit a55efa7edf37dc428da7058b25c58a54dc9db4e4 Author: Michał Mirosław Date: Sat May 6 23:19:01 2023 +0200 i2c: tegra: allow DVC support to be compiled out Save a bit of code for newer Tegra platforms by compiling out DVC's I2C mode support that's used only for Tegra2. $ size i2c-tegra.o text data bss dec hex filename - 11381 292 8 11681 2da1 i2c-tegra.o + 10193 292 8 10493 28fd i2c-tegra.o Signed-off-by: Michał Mirosław Reviewed-by: Dmitry Osipenko Signed-off-by: Wolfram Sang commit fcc8a89a1c839bbe274de8e518ce7886553ddcc6 Author: Akhil R Date: Thu Apr 27 18:09:15 2023 +0530 i2c: tegra: Share same DMA channel for RX and TX Allocate only one DMA channel for I2C and share it for both TX and RX instead of using two different DMA hardware channels with the same slave ID. Since I2C supports only half duplex, there is no impact on perf with this. Signed-off-by: Akhil R Acked-by: Thierry Reding Signed-off-by: Wolfram Sang commit bcfc2ab7f43508ec6e80353768a77aedc883e568 Author: Jarkko Nikula Date: Fri May 12 14:50:01 2023 +0300 i2c: i801: Add support for Intel Meteor Lake PCH-S Add SMBus PCI ID on Intel Meteor Lake PCH-S. Signed-off-by: Jarkko Nikula Reviewed-by: Andi Shyti Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit e755ef0095ba5a56f8dcb759a7c3b4f3db28ab21 Author: Jarkko Nikula Date: Fri May 12 14:50:00 2023 +0300 i2c: i801: Add support for Intel Meteor Lake SoC-S Add SMBus PCI ID on Intel Meteor Lake SoC-S South. Signed-off-by: Jarkko Nikula Reviewed-by: Andi Shyti Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit eb9c18bf95d9b20e0f44be43e5b662c9be18be17 Author: Jarkko Nikula Date: Fri May 12 14:49:59 2023 +0300 i2c: i801: Enlarge device name field in i801_ids table Indent data field in the i801_ids table by one tab to make more space for longer device names. Signed-off-by: Jarkko Nikula Reviewed-by: Andi Shyti Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit ef558b4b7bbbf7e115c87e4da21ce86444d6ec3b Author: Mark Rutland Date: Mon Jun 5 08:01:24 2023 +0100 locking/atomic: treewide: delete arch_atomic_*() kerneldoc Currently several architectures have kerneldoc comments for arch_atomic_*(), which is unhelpful as these live in a shared namespace where they clash, and the arch_atomic_*() ops are now an implementation detail of the raw_atomic_*() ops, which no-one should use those directly. Delete the kerneldoc comments for arch_atomic_*(), along with pseudo-kerneldoc comments which are in the correct style but are missing the leading '/**' necessary to be true kerneldoc comments. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-28-mark.rutland@arm.com commit e74f4059d11f36e936b08e98bc96f654c308807a Author: Paul E. McKenney Date: Mon Jun 5 08:01:23 2023 +0100 locking/atomic: docs: Add atomic operations to the driver basic API documentation Add the generated atomic headers to driver-api/basics.rst in order to provide documentation for the Linux kernel's atomic operations. At the same time, dtop the x86 atomic header, which provides kerneldoc comments for some arch_atomic*_*() operations. The arch_atomic*_*() operations are now purely an implenentation detail of the raw_atomic*_*() ops, and outside of implementing the atomics, code should use the raw_atomic*_*() forms. [Mark: add atomic-{instrumented,long}.h, update commit message] Signed-off-by: Paul E. McKenney Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-27-mark.rutland@arm.com commit ad8110706f381170c9f9975f1cb06010fd3ca381 Author: Mark Rutland Date: Mon Jun 5 08:01:22 2023 +0100 locking/atomic: scripts: generate kerneldoc comments Currently the atomics are documented in Documentation/atomic_t.txt, and have no kerneldoc comments. There are a sufficient number of gotchas (e.g. semantics, noinstr-safety) that it would be nice to have comments to call these out, and it would be nice to have kerneldoc comments such that these can be collated. While it's possible to derive the semantics from the code, this can be painful given the amount of indirection we currently have (e.g. fallback paths), and it's easy to be mislead by naming, e.g. * The unconditional void-returning ops *only* have relaxed variants without a _relaxed suffix, and can easily be mistaken for being fully ordered. It would be nice to give these a _relaxed() suffix, but this would result in significant churn throughout the kernel. * Our naming of conditional and unconditional+test ops is rather inconsistent, and it can be difficult to derive the name of an operation, or to identify where an op is conditional or unconditional+test. Some ops are clearly conditional: - dec_if_positive - add_unless - dec_unless_positive - inc_unless_negative Some ops are clearly unconditional+test: - sub_and_test - dec_and_test - inc_and_test However, what exactly those test is not obvious. A _test_zero suffix might be clearer. Others could be read ambiguously: - inc_not_zero // conditional - add_negative // unconditional+test It would probably be worth renaming these, e.g. to inc_unless_zero and add_test_negative. As a step towards making this more consistent and easier to understand, this patch adds kerneldoc comments for all generated *atomic*_*() functions. These are generated from templates, with some common text shared, making it easy to extend these in future if necessary. I've tried to make these as consistent and clear as possible, and I've deliberately ensured: * All ops have their ordering explicitly mentioned in the short and long description. * All test ops have "test" in their short description. * All ops are described as an expression using their usual C operator. For example: andnot: "Atomically updates @v to (@v & ~@i)" inc: "Atomically updates @v to (@v + 1)" Which may be clearer to non-naative English speakers, and allows all the operations to be described in the same style. * All conditional ops have their condition described as an expression using the usual C operators. For example: add_unless: "If (@v != @u), atomically updates @v to (@v + @i)" cmpxchg: "If (@v == @old), atomically updates @v to @new" Which may be clearer to non-naative English speakers, and allows all the operations to be described in the same style. * All bitwise ops (and,andnot,or,xor) explicitly mention that they are bitwise in their short description, so that they are not mistaken for performing their logical equivalents. * The noinstr safety of each op is explicitly described, with a description of whether or not to use the raw_ form of the op. There should be no functional change as a result of this patch. Reported-by: Paul E. McKenney Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-26-mark.rutland@arm.com commit 8aaf297a0dd66d4fac215af24ece8dea091079bc Author: Mark Rutland Date: Mon Jun 5 08:01:21 2023 +0100 docs: scripts: kernel-doc: accept bitwise negation like ~@var In some cases we'd like to indicate the bitwise negation of a parameter, e.g. ~@var This will be helpful for describing the atomic andnot operations, where we'd like to write comments of the form: Atomically updates @v to (@v & ~@i) Which kernel-doc currently transforms to: Atomically updates **v** to (**v** & ~**i**) Rather than the preferable form: Atomically updates **v** to (**v** & **~i**) This is similar to what we did for '!@var' in commit: ee2aa7590398 ("scripts: kernel-doc: accept negation like !@var") This patch follows the same pattern that commit used to permit a '!' prefix on a param ref, allowing a '~' prefix on a param ref, cuasing kernel-doc to generate the preferred form above. Suggested-by: Akira Yokosawa Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230605070124.3741859-25-mark.rutland@arm.com commit 1d78814d41701c216e28fcf2656526146dec4a1a Author: Mark Rutland Date: Mon Jun 5 08:01:20 2023 +0100 locking/atomic: scripts: simplify raw_atomic*() definitions Currently each ordering variant has several potential definitions, with a mixture of preprocessor and C definitions, including several copies of its C prototype, e.g. | #if defined(arch_atomic_fetch_andnot_acquire) | #define raw_atomic_fetch_andnot_acquire arch_atomic_fetch_andnot_acquire | #elif defined(arch_atomic_fetch_andnot_relaxed) | static __always_inline int | raw_atomic_fetch_andnot_acquire(int i, atomic_t *v) | { | int ret = arch_atomic_fetch_andnot_relaxed(i, v); | __atomic_acquire_fence(); | return ret; | } | #elif defined(arch_atomic_fetch_andnot) | #define raw_atomic_fetch_andnot_acquire arch_atomic_fetch_andnot | #else | static __always_inline int | raw_atomic_fetch_andnot_acquire(int i, atomic_t *v) | { | return raw_atomic_fetch_and_acquire(~i, v); | } | #endif Make this a bit simpler by defining the C prototype once, and writing the various potential definitions as plain C code guarded by ifdeffery. For example, the above becomes: | static __always_inline int | raw_atomic_fetch_andnot_acquire(int i, atomic_t *v) | { | #if defined(arch_atomic_fetch_andnot_acquire) | return arch_atomic_fetch_andnot_acquire(i, v); | #elif defined(arch_atomic_fetch_andnot_relaxed) | int ret = arch_atomic_fetch_andnot_relaxed(i, v); | __atomic_acquire_fence(); | return ret; | #elif defined(arch_atomic_fetch_andnot) | return arch_atomic_fetch_andnot(i, v); | #else | return raw_atomic_fetch_and_acquire(~i, v); | #endif | } Which is far easier to read. As we now always have a single copy of the C prototype wrapping all the potential definitions, we now have an obvious single location for kerneldoc comments. At the same time, the fallbacks for raw_atomic*_xhcg() are made to use 'new' rather than 'i' as the name of the new value. This is what the existing fallback template used, and is more consistent with the raw_atomic{_try,}cmpxchg() fallbacks. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-24-mark.rutland@arm.com commit 630399469ffcb937936644fbaa5daf61e700a329 Author: Mark Rutland Date: Mon Jun 5 08:01:19 2023 +0100 locking/atomic: scripts: simplify raw_atomic_long*() definitions Currently, atomic-long is split into two sections, one defining the raw_atomic_long_*() ops for CONFIG_64BIT, and one defining the raw atomic_long_*() ops for !CONFIG_64BIT. With many lines elided, this looks like: | #ifdef CONFIG_64BIT | ... | static __always_inline bool | raw_atomic_long_try_cmpxchg(atomic_long_t *v, long *old, long new) | { | return raw_atomic64_try_cmpxchg(v, (s64 *)old, new); | } | ... | #else /* CONFIG_64BIT */ | ... | static __always_inline bool | raw_atomic_long_try_cmpxchg(atomic_long_t *v, long *old, long new) | { | return raw_atomic_try_cmpxchg(v, (int *)old, new); | } | ... | #endif The two definitions are spread far apart in the file, and duplicate the prototype, making it hard to have a legible set of kerneldoc comments. Make this simpler by defining the C prototype once, and writing the two definitions inline. For example, the above becomes: | static __always_inline bool | raw_atomic_long_try_cmpxchg(atomic_long_t *v, long *old, long new) | { | #ifdef CONFIG_64BIT | return raw_atomic64_try_cmpxchg(v, (s64 *)old, new); | #else | return raw_atomic_try_cmpxchg(v, (int *)old, new); | #endif | } As we now always have a single copy of the C prototype wrapping all the potential definitions, we now have an obvious single location for kerneldoc comments. As a bonus, both the script and the generated file are somewhat shorter. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-23-mark.rutland@arm.com commit b916a8c765692444388891f5b9c5b6e941e16d42 Author: Mark Rutland Date: Mon Jun 5 08:01:18 2023 +0100 locking/atomic: scripts: split pfx/name/sfx/order Currently gen-atomic-long.sh's gen_proto_order_variant() function combines the pfx/name/sfx/order variables immediately, unlike other functions in gen-atomic-*.sh. This is fine today, but subsequent patches will require the individual individual pfx/name/sfx/order variables within gen-atomic-long.sh's gen_proto_order_variant() function. In preparation for this, split the variables in the style of other gen-atomic-*.sh scripts. This results in no change to the generated headers, so there should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-22-mark.rutland@arm.com commit 9257959a6e5b4fca6fc8e985790bff62c2046f20 Author: Mark Rutland Date: Mon Jun 5 08:01:17 2023 +0100 locking/atomic: scripts: restructure fallback ifdeffery Currently the various ordering variants of an atomic operation are defined in groups of full/acquire/release/relaxed ordering variants with some shared ifdeffery and several potential definitions of each ordering variant in different branches of the shared ifdeffery. As an ordering variant can have several potential definitions down different branches of the shared ifdeffery, it can be painful for a human to find a relevant definition, and we don't have a good location to place anything common to all definitions of an ordering variant (e.g. kerneldoc). Historically the grouping of full/acquire/release/relaxed ordering variants was necessary as we filled in the missing atomics in the same namespace as the architecture used. It would be easy to accidentally define one ordering fallback in terms of another ordering fallback with redundant barriers, and avoiding that would otherwise require a lot of baroque ifdeffery. With recent changes we no longer need to fill in the missing atomics in the arch_atomic*_() namespace, and only need to fill in the raw_atomic*_() namespace. Due to this, there's no risk of a namespace collision, and we can define each raw_atomic*_ ordering variant with its own ifdeffery checking for the arch_atomic*_ ordering variants. Restructure the fallbacks in this way, with each ordering variant having its own ifdeffery of the form: | #if defined(arch_atomic_fetch_andnot_acquire) | #define raw_atomic_fetch_andnot_acquire arch_atomic_fetch_andnot_acquire | #elif defined(arch_atomic_fetch_andnot_relaxed) | static __always_inline int | raw_atomic_fetch_andnot_acquire(int i, atomic_t *v) | { | int ret = arch_atomic_fetch_andnot_relaxed(i, v); | __atomic_acquire_fence(); | return ret; | } | #elif defined(arch_atomic_fetch_andnot) | #define raw_atomic_fetch_andnot_acquire arch_atomic_fetch_andnot | #else | static __always_inline int | raw_atomic_fetch_andnot_acquire(int i, atomic_t *v) | { | return raw_atomic_fetch_and_acquire(~i, v); | } | #endif Note that where there's no relevant arch_atomic*_() ordering variant, we'll define the operation in terms of a distinct raw_atomic*_(), as this itself might have been filled in with a fallback. As we now generate the raw_atomic*_() implementations directly, we no longer need the trivial wrappers, so they are removed. This makes the ifdeffery easier to follow, and will allow for further improvements in subsequent patches. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-21-mark.rutland@arm.com commit 1815da1718aa4c062b94cf3fc09432f552e25768 Author: Mark Rutland Date: Mon Jun 5 08:01:16 2023 +0100 locking/atomic: scripts: build raw_atomic_long*() directly Now that arch_atomic*() usage is limited to the atomic headers, we no longer have any users of arch_atomic_long_*(), and can generate raw_atomic_long_*() directly. Generate the raw_atomic_long_*() ops directly. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-20-mark.rutland@arm.com commit 0f613bfa8268a89be25f2b6b58fc6fe8ccd9a2ba Author: Mark Rutland Date: Mon Jun 5 08:01:15 2023 +0100 locking/atomic: treewide: use raw_atomic*_() Now that we have raw_atomic*_() definitions, there's no need to use arch_atomic*_() definitions outside of the low-level atomic definitions. Move treewide users of arch_atomic*_() over to the equivalent raw_atomic*_(). There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-19-mark.rutland@arm.com commit c9268ac615f9f6dded7801df5993374598934377 Author: Mark Rutland Date: Mon Jun 5 08:01:14 2023 +0100 locking/atomic: scripts: add trivial raw_atomic*_() Currently a number of arch_atomic*_() functions are optional, and where an arch does not provide a given arch_atomic*_() we will define an implementation of arch_atomic*_() in atomic-arch-fallback.h. Filling in the missing ops requires special care as we want to select the optimal definition of each op (e.g. preferentially defining ops in terms of their relaxed form rather than their fully-ordered form). The ifdeffery necessary for this requires us to group ordering variants together, which can be a bit painful to read, and is painful for kerneldoc generation. It would be easier to handle this if we generated ops into a separate namespace, as this would remove the need to take special care with the ifdeffery, and allow each ordering variant to be generated separately. This patch adds a new set of raw_atomic_() definitions, which are currently trivial wrappers of their arch_atomic_() equivalent. This will allow us to move treewide users of arch_atomic_() over to raw atomic op before we rework the fallback generation to generate raw_atomic_ directly. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-18-mark.rutland@arm.com commit 7ed7a1564090fdd265f49d1ad94ee92845b14c76 Author: Mark Rutland Date: Mon Jun 5 08:01:13 2023 +0100 locking/atomic: scripts: factor out order template generation Currently gen_proto_order_variants() hard codes the path for the templates used for order fallbacks. Factor this out into a helper so that it can be reused elsewhere. This results in no change to the generated headers, so there should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-17-mark.rutland@arm.com commit e40e5298e692bb6b5a200b3f0f55e6e5adf0e5ad Author: Mark Rutland Date: Mon Jun 5 08:01:12 2023 +0100 locking/atomic: scripts: remove leftover "${mult}" We removed cmpxchg_double() and variants in commit: b4cf83b2d1da40b2 ("arch: Remove cmpxchg_double") Which removed the need for "${mult}" in the instrumentation logic. Unfortunately we missed an instance of "${mult}". There is no change to the generated header. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-16-mark.rutland@arm.com commit a083ecc9333c62237551ad93f42e86a42a3c7cc2 Author: Mark Rutland Date: Mon Jun 5 08:01:11 2023 +0100 locking/atomic: scripts: remove bogus order parameter At the start of gen_proto_order_variants(), the ${order} variable is not yet defined, and will be substituted with an empty string. Replace the current bogus use of ${order} with an empty string instead. This results in no change to the generated headers. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-15-mark.rutland@arm.com commit 7c7084f3ba4031a9c2858afed696a577fcfe41d2 Author: Mark Rutland Date: Mon Jun 5 08:01:10 2023 +0100 locking/atomic: xtensa: add preprocessor symbols Some atomics can be implemented in several different ways, e.g. FULL/ACQUIRE/RELEASE ordered atomics can be implemented in terms of RELAXED atomics, and ACQUIRE/RELEASE/RELAXED can be implemented in terms of FULL ordered atomics. Other atomics are optional, and don't exist in some configurations (e.g. not all architectures implement the 128-bit cmpxchg ops). Subsequent patches will require that architectures define a preprocessor symbol for any atomic (or ordering variant) which is optional. This will make the fallback ifdeffery more robust, and simplify future changes. Add the required definitions to arch/xtensa. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-14-mark.rutland@arm.com commit 5bef003538ae8621c95ac6ebfd37324373fae37d Author: Mark Rutland Date: Mon Jun 5 08:01:09 2023 +0100 locking/atomic: x86: add preprocessor symbols Some atomics can be implemented in several different ways, e.g. FULL/ACQUIRE/RELEASE ordered atomics can be implemented in terms of RELAXED atomics, and ACQUIRE/RELEASE/RELAXED can be implemented in terms of FULL ordered atomics. Other atomics are optional, and don't exist in some configurations (e.g. not all architectures implement the 128-bit cmpxchg ops). Subsequent patches will require that architectures define a preprocessor symbol for any atomic (or ordering variant) which is optional. This will make the fallback ifdeffery more robust, and simplify future changes. Add the required definitions to arch/x86. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-13-mark.rutland@arm.com commit 358c449afa662b1120d43738d2b0400ed2cc97df Author: Mark Rutland Date: Mon Jun 5 08:01:08 2023 +0100 locking/atomic: sparc: add preprocessor symbols Some atomics can be implemented in several different ways, e.g. FULL/ACQUIRE/RELEASE ordered atomics can be implemented in terms of RELAXED atomics, and ACQUIRE/RELEASE/RELAXED can be implemented in terms of FULL ordered atomics. Other atomics are optional, and don't exist in some configurations (e.g. not all architectures implement the 128-bit cmpxchg ops). Subsequent patches will require that architectures define a preprocessor symbol for any atomic (or ordering variant) which is optional. This will make the fallback ifdeffery more robust, and simplify future changes. Add the required definitions to arch/sparc. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-12-mark.rutland@arm.com commit 770345adc38485c688e5d832d82306a4c2da828c Author: Mark Rutland Date: Mon Jun 5 08:01:07 2023 +0100 locking/atomic: sh: add preprocessor symbols Some atomics can be implemented in several different ways, e.g. FULL/ACQUIRE/RELEASE ordered atomics can be implemented in terms of RELAXED atomics, and ACQUIRE/RELEASE/RELAXED can be implemented in terms of FULL ordered atomics. Other atomics are optional, and don't exist in some configurations (e.g. not all architectures implement the 128-bit cmpxchg ops). Subsequent patches will require that architectures define a preprocessor symbol for any atomic (or ordering variant) which is optional. This will make the fallback ifdeffery more robust, and simplify future changes. Add the required definitions to arch/sh. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-11-mark.rutland@arm.com commit 07bf3dcbe0e199422598f12918021c516161fd12 Author: Mark Rutland Date: Mon Jun 5 08:01:06 2023 +0100 locking/atomic: parisc: add preprocessor symbols Some atomics can be implemented in several different ways, e.g. FULL/ACQUIRE/RELEASE ordered atomics can be implemented in terms of RELAXED atomics, and ACQUIRE/RELEASE/RELAXED can be implemented in terms of FULL ordered atomics. Other atomics are optional, and don't exist in some configurations (e.g. not all architectures implement the 128-bit cmpxchg ops). Subsequent patches will require that architectures define a preprocessor symbol for any atomic (or ordering variant) which is optional. This will make the fallback ifdeffery more robust, and simplify future changes. Add the required definitions to arch/parisc. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-10-mark.rutland@arm.com commit e50f06ce2d876c740993b5e3d01e203520391ccd Author: Mark Rutland Date: Mon Jun 5 08:01:05 2023 +0100 locking/atomic: m68k: add preprocessor symbols Some atomics can be implemented in several different ways, e.g. FULL/ACQUIRE/RELEASE ordered atomics can be implemented in terms of RELAXED atomics, and ACQUIRE/RELEASE/RELAXED can be implemented in terms of FULL ordered atomics. Other atomics are optional, and don't exist in some configurations (e.g. not all architectures implement the 128-bit cmpxchg ops). Subsequent patches will require that architectures define a preprocessor symbol for any atomic (or ordering variant) which is optional. This will make the fallback ifdeffery more robust, and simplify future changes. Add the required definitions to arch/m68k. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-9-mark.rutland@arm.com commit 8ad17f2183fd7e37ceafddbdff334a3e2608cc84 Author: Mark Rutland Date: Mon Jun 5 08:01:04 2023 +0100 locking/atomic: hexagon: add preprocessor symbols Some atomics can be implemented in several different ways, e.g. FULL/ACQUIRE/RELEASE ordered atomics can be implemented in terms of RELAXED atomics, and ACQUIRE/RELEASE/RELAXED can be implemented in terms of FULL ordered atomics. Other atomics are optional, and don't exist in some configurations (e.g. not all architectures implement the 128-bit cmpxchg ops). Subsequent patches will require that architectures define a preprocessor symbol for any atomic (or ordering variant) which is optional. This will make the fallback ifdeffery more robust, and simplify future changes. Add the required definitions to arch/hexagon. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-8-mark.rutland@arm.com commit d6cd3664806fbe8313b8e04b042d40e8135ca459 Author: Mark Rutland Date: Mon Jun 5 08:01:03 2023 +0100 locking/atomic: arm: add preprocessor symbols Some atomics can be implemented in several different ways, e.g. FULL/ACQUIRE/RELEASE ordered atomics can be implemented in terms of RELAXED atomics, and ACQUIRE/RELEASE/RELAXED can be implemented in terms of FULL ordered atomics. Other atomics are optional, and don't exist in some configurations (e.g. not all architectures implement the 128-bit cmpxchg ops). Subsequent patches will require that architectures define a preprocessor symbol for any atomic (or ordering variant) which is optional. This will make the fallback ifdeffery more robust, and simplify future changes. Add the required definitions to arch/arm. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-7-mark.rutland@arm.com commit f739287ef57bc01155e556033462e9a6ff020c97 Author: Mark Rutland Date: Mon Jun 5 08:01:02 2023 +0100 locking/atomic: arc: add preprocessor symbols Some atomics can be implemented in several different ways, e.g. FULL/ACQUIRE/RELEASE ordered atomics can be implemented in terms of RELAXED atomics, and ACQUIRE/RELEASE/RELAXED can be implemented in terms of FULL ordered atomics. Other atomics are optional, and don't exist in some configurations (e.g. not all architectures implement the 128-bit cmpxchg ops). Subsequent patches will require that architectures define a preprocessor symbol for any atomic (or ordering variant) which is optional. This will make the fallback ifdeffery more robust, and simplify future changes. Add the required definitions to arch/arc. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-6-mark.rutland@arm.com commit d12157efc8e083c77d054675fcdd594f54cc7e2b Author: Mark Rutland Date: Mon Jun 5 08:01:01 2023 +0100 locking/atomic: make atomic*_{cmp,}xchg optional Most architectures define the atomic/atomic64 xchg and cmpxchg operations in terms of arch_xchg and arch_cmpxchg respectfully. Add fallbacks for these cases and remove the trivial cases from arch code. On some architectures the existing definitions are kept as these are used to build other arch_atomic*() operations. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-5-mark.rutland@arm.com commit a7bafa7969da1c0e9c342c792d8224078d1c491c Author: Mark Rutland Date: Mon Jun 5 08:01:00 2023 +0100 locking/atomic: hexagon: remove redundant arch_atomic_cmpxchg Hexagon's implementation of arch_atomic_cmpxchg() is identical to its implementation of arch_cmpxchg(). Have it define arch_atomic_cmpxchg() in terms of arch_cmpxchg(), matching what it does for arch_atomic_xchg() and arch_xchg(). At the same time, remove the kerneldoc comments for hexagon's arch_atomic_xchg() and arch_atomic_cmpxchg(). The arch_atomic_*() namespace is shared by all architectures and the API should be documented centrally, and the comments aren't all that helpful as-is. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-4-mark.rutland@arm.com commit 14d72d4b6f0e88b5f683c1a5b7a876a55055852d Author: Mark Rutland Date: Mon Jun 5 08:00:59 2023 +0100 locking/atomic: remove fallback comments Currently a subset of the fallback templates have kerneldoc comments, resulting in a haphazard set of generated kerneldoc comments as only some operations have fallback templates to begin with. We'd like to generate more consistent kerneldoc comments, and to do so we'll need to restructure the way the fallback code is generated. To minimize churn and to make it easier to restructure the fallback code, this patch removes the existing kerneldoc comments from the fallback templates. We can add new kerneldoc comments in subsequent patches. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-3-mark.rutland@arm.com commit dda5f312bb09e56e7a1c3e3851f2000eb2e9c879 Author: Mark Rutland Date: Mon Jun 5 08:00:58 2023 +0100 locking/atomic: arm: fix sync ops The sync_*() ops on arch/arm are defined in terms of the regular bitops with no special handling. This is not correct, as UP kernels elide barriers for the fully-ordered operations, and so the required ordering is lost when such UP kernels are run under a hypervsior on an SMP system. Fix this by defining sync ops with the required barriers. Note: On 32-bit arm, the sync_*() ops are currently only used by Xen, which requires ARMv7, but the semantics can be implemented for ARMv6+. Fixes: e54d2f61528165bb ("xen/arm: sync_bitops") Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230605070124.3741859-2-mark.rutland@arm.com commit e190a0c389e60178fba3d532abf936dcae223e7d Author: Uwe Kleine-König Date: Mon May 8 22:51:38 2023 +0200 i2c: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Signed-off-by: Uwe Kleine-König Acked-by: Alain Volmat Acked-by: Ard Biesheuvel Acked-by: Baruch Siach Acked-by: Florian Fainelli Acked-by: Heiko Stuebner Acked-by: Jarkko Nikula Acked-by: Jernej Skrabec Acked-by: Jochen Friedrich Acked-by: Peter Rosin Acked-by: Vadim Pasternak Reviewed-by: Asmaa Mnebhi Reviewed-by: Bartosz Golaszewski Reviewed-by: Chris Packham Reviewed-by: Chris Pringle Reviewed-by: Claudiu Beznea Reviewed-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Reviewed-by: Hans de Goede Reviewed-by: Jean Delvare Reviewed-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij Reviewed-by: Martin Blumenstingl Reviewed-by: Matthias Brugger Reviewed-by: Patrice Chotard Reviewed-by: Tali Perry Reviewed-by: Vignesh Raghavendra Signed-off-by: Wolfram Sang commit 7ce8d39e342167b2be7004b28926728176e6d94e Author: Alexander Stein Date: Mon Jun 5 09:25:18 2023 +0200 gpio: Fix dependency for gpio-delay This driver relies on OF_GPIO features, add a dependency to Kconfig. Fixes: cf5dec80c4e2 ("gpio: Add gpio delay driver") Signed-off-by: Alexander Stein Signed-off-by: Bartosz Golaszewski commit 497cc42bf53b55185ab3d39c634fbf09eb6681ae Author: Peter Zijlstra Date: Wed May 31 15:08:45 2023 +0200 s390/cpum_sf: Convert to cmpxchg128() Now that there is a cross arch u128 and cmpxchg128(), use those instead of the custom CDSG helper. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Arnd Bergmann Reviewed-by: Mark Rutland Acked-by: Heiko Carstens Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132324.058821078@infradead.org commit febe950dbfb464799beb0339cc6fb10699f4a5da Author: Peter Zijlstra Date: Wed May 31 15:08:44 2023 +0200 arch: Remove cmpxchg_double No moar users, remove the monster. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Arnd Bergmann Reviewed-by: Mark Rutland Acked-by: Heiko Carstens Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132323.991907085@infradead.org commit 6801be4f2653e5fdddca73b527cf0728284ba8a3 Author: Peter Zijlstra Date: Wed May 31 15:08:43 2023 +0200 slub: Replace cmpxchg_double() Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Arnd Bergmann Reviewed-by: Mark Rutland Acked-by: Vlastimil Babka Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132323.924677086@infradead.org commit b1fe7f2cda2a003afe316ce8dfe8d3645694a67e Author: Peter Zijlstra Date: Wed May 31 15:08:42 2023 +0200 x86,intel_iommu: Replace cmpxchg_double() Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Lu Baolu Reviewed-by: Arnd Bergmann Reviewed-by: Mark Rutland Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132323.855976804@infradead.org commit 0a0a6800b02489c1288f963ad290b6a4876a2cc8 Author: Peter Zijlstra Date: Wed May 31 15:08:41 2023 +0200 x86,amd_iommu: Replace cmpxchg_double() Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Arnd Bergmann Reviewed-by: Mark Rutland Tested-by: Vasant Hegde Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132323.788955257@infradead.org commit 8664645ade97b66a9d150cae43f4e6eef737b97d Author: Peter Zijlstra Date: Fri Jun 2 16:33:54 2023 +0200 parisc: Raise minimal GCC version 64-bit targets need the __int128 type, which for pa-risc means raising the minimum gcc version to 11. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Helge Deller Tested-by: Mark Rutland Link: https://lkml.kernel.org/r/20230602143912.GI620383%40hirez.programming.kicks-ass.net commit 6d12c8d308e68b9b0fa98ca2df4f83db4b4c965d Author: Peter Zijlstra Date: Wed May 31 15:08:39 2023 +0200 percpu: Wire up cmpxchg128 In order to replace cmpxchg_double() with the newly minted cmpxchg128() family of functions, wire it up in this_cpu_cmpxchg(). Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Mark Rutland Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132323.654945124@infradead.org commit c5c0ba953b8c969c5d51bf1c57f239866a97c47c Author: Peter Zijlstra Date: Wed May 31 15:08:38 2023 +0200 percpu: Add {raw,this}_cpu_try_cmpxchg() Add the try_cmpxchg() form to the per-cpu ops. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Mark Rutland Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132323.587480729@infradead.org commit 8c8b096a23d12fedf3c0f50524f30113ef97aa8c Author: Peter Zijlstra Date: Wed May 31 15:08:37 2023 +0200 instrumentation: Wire up cmpxchg128() Wire up the cmpxchg128 family in the atomic wrapper scripts. These provide the generic cmpxchg128 family of functions from the arch_ prefixed version, adding explicit instrumentation where needed. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Arnd Bergmann Reviewed-by: Mark Rutland Acked-by: Mark Rutland Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132323.519237070@infradead.org commit b23e139d0b66c0216e7e9361a5021290395f504c Author: Peter Zijlstra Date: Wed May 31 15:08:36 2023 +0200 arch: Introduce arch_{,try_}_cmpxchg128{,_local}() For all architectures that currently support cmpxchg_double() implement the cmpxchg128() family of functions that is basically the same but with a saner interface. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Arnd Bergmann Reviewed-by: Mark Rutland Acked-by: Heiko Carstens Acked-by: Mark Rutland Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132323.452120708@infradead.org commit 224d80c584d3016cb8d83d1c33914fdd3508aa8c Author: Peter Zijlstra Date: Wed May 31 15:08:35 2023 +0200 types: Introduce [us]128 Introduce [us]128 (when available). Unlike [us]64, ensure they are always naturally aligned. This also enables 128bit wide atomics (which require natural alignment) such as cmpxchg128(). Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Arnd Bergmann Reviewed-by: Mark Rutland Acked-by: Herbert Xu Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132323.385005581@infradead.org commit f413e724818c6482146218b3bcaf3d75b1317fc4 Author: Peter Zijlstra Date: Wed May 31 15:08:34 2023 +0200 cyrpto/b128ops: Remove struct u128 Per git-grep u128_xor() and its related struct u128 are unused except to implement {be,le}128_xor(). Remove them to free up the namespace. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Arnd Bergmann Reviewed-by: Mark Rutland Acked-by: Herbert Xu Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132323.314826687@infradead.org commit db987421b57cdf3ecb4859e0c7b49726baae895e Author: Oswald Buddenhagen Date: Fri May 26 12:16:59 2023 +0200 ALSA: emu10k1: vastly improve usefulness of info in /proc - Include the FX bus map, without which the already present send routing info would require looking up the documentation. - Include the physical I/O channels as known to the driver - Make the multi-channel capture map actually name the mapped input channels rather than "FXBUS" (Audigy) or even "???" (SbLive) - The latter two are omitted for E-MU cards, as their physical I/O is routed through the FPGA - While at it, make the "Card" field somewhat more useful This includes de-duplicating the label tables between emuproc and emufx, updating/improving the FX bus label table, and making the SB Live! 5.1 multi-track capture channel mapping hack data-driven. Tested-by: Jonathan Dowland Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230526101659.437969-7-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 6ab13291ba82e6f0c8778cb45726dffffb9205f5 Author: Oswald Buddenhagen Date: Fri May 26 12:16:58 2023 +0200 ALSA: emu10k1: make E-MU FPGA register dump in /proc more useful Include the routing information, which can be actually read back. Somewhat as a drive-by, make the register dump format less obscure - the previous one made no sense at all. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230526101659.437969-6-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit ad326d4a1364f9d677204b1e005ee8eb2a0b6558 Author: Oswald Buddenhagen Date: Fri May 26 12:16:57 2023 +0200 ALSA: emu10k1: include FX send amounts in /proc output It seems to make little sense to include the FX send routing, but not the amounts. This also simplifies the code somewhat, and lines up the output. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230526101659.437969-5-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 6e91a93d1e7417e5f700fb1d10de994d1539de8e Author: Oswald Buddenhagen Date: Mon May 29 11:55:04 2023 +0200 ALSA: emu10k1: actually disassemble DSP instructions in /proc fx8010_acode is supposed to be a human-readable representation; the binary is already in fx8010_code. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230529095504.559054-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 67ff2add9e2cef1d5d60cf5a37f1f52c65bf97c7 Author: Oswald Buddenhagen Date: Fri May 26 12:16:55 2023 +0200 ALSA: emu10k1: fix writing 1st pointer-offset register set through /proc The limits were appropriate only for the 2nd set. FWIW, the channel count 4 for the 2nd set is suspicious as well - at least P17V_PLAYBACK_FIFO_PTR actually has 8 channels, and comments on HCFG2 hint at that as well. But all bitmasks are documented only for 4 channels. Anyway, rectifying that is out of scope for this patch. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230526101659.437969-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 219153c6ed46b064f9c2b0f70dacf21f719751ee Author: Oswald Buddenhagen Date: Fri May 26 12:16:54 2023 +0200 ALSA: emu10k1: hide absent 2nd pointer-offset register set from /proc The 2nd register set belongs to the P16V chip (or embedded P17V module), so there is nothing to show when no such part is present. Gen2 E-MU cards have a P17V, but it's entirely unused, so we hide it there as well. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230526101659.437969-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit c894ec016c9d0418dd832202225a8c64f450d71e Author: Uwe Kleine-König Date: Thu May 25 22:36:40 2023 +0200 ALSA: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Luca Ceresoli Link: https://lore.kernel.org/r/20230525203640.677826-1-u.kleine-koenig@pengutronix.de Signed-off-by: Takashi Iwai commit b29a20f7c4995a059ed764ce42389857426397c7 Author: Jouni Högander Date: Tue May 30 13:16:49 2023 +0300 drm/i915: Use 18 fast wake AUX sync len HW default for wake sync pulses is 18. 10 precharge and 8 preamble. There is no reason to change this especially as it is causing problems with certain eDP panels. v3: Change "Fixes:" commit v2: Remove "fast wake" repeat from subject Signed-off-by: Jouni Högander Fixes: e1c71f8f9180 ("drm/i915: Fix fast wake AUX sync len") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8475 Reviewed-by: Luca Coelho Link: https://patchwork.freedesktop.org/patch/msgid/20230530101649.2549949-1-jouni.hogander@intel.com commit 2076b2a4a6b7e36a33dad178ff6f7c45657b00cc Merge: 49c80922ff811 9561de3a55bed Author: Greg Kroah-Hartman Date: Mon Jun 5 07:41:04 2023 +0200 Merge 6.4-rc5 into tty-next We need the tty fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit d37537a1f7cf09e304fe7993cb5e732534a0fb22 Merge: 243ff7e6a0353 9561de3a55bed Author: Greg Kroah-Hartman Date: Mon Jun 5 07:39:02 2023 +0200 Merge 6.4-rc5 into usb-next We need the USB fixes in here are well. Signed-off-by: Greg Kroah-Hartman commit 16b58423b4c33dfd9622dcfc93bc5ce35c17ce72 Merge: 7810f4dc87950 9561de3a55bed Author: Greg Kroah-Hartman Date: Mon Jun 5 07:37:37 2023 +0200 Merge 6.4-rc5 into driver-core-next We need the driver core fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 5959fe74c9932d18059811af0ec4870831821c79 Merge: 82089b00ae026 9561de3a55bed Author: Greg Kroah-Hartman Date: Mon Jun 5 07:19:18 2023 +0200 Merge 6.4-rc5 into char-misc-next We need the char/misc fixes in here as well for mergeing and testing. Signed-off-by: Greg Kroah-Hartman commit feb843a469fb0ab00d2d23cfb9bcc379791011bb Author: Masahiro Yamada Date: Sun Apr 9 23:53:57 2023 +0900 kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS When preprocessing arch/*/kernel/vmlinux.lds.S, the target triple is not passed to $(CPP) because we add it only to KBUILD_{C,A}FLAGS. As a result, the linker script is preprocessed with predefined macros for the build host instead of the target. Assuming you use an x86 build machine, compare the following: $ clang -dM -E -x c /dev/null $ clang -dM -E -x c /dev/null -target aarch64-linux-gnu There is no actual problem presumably because our linker scripts do not rely on such predefined macros, but it is better to define correct ones. Move $(CLANG_FLAGS) to KBUILD_CPPFLAGS, so that all *.c, *.S, *.lds.S will be processed with the proper target triple. [Note] After the patch submission, we got an actual problem that needs this commit. (CBL issue 1859) Link: https://github.com/ClangBuiltLinux/linux/issues/1859 Reported-by: Tom Rini Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor commit cff6e7f50bd315e5b39c4e46c704ac587ceb965f Author: Nathan Chancellor Date: Thu Jun 1 12:50:39 2023 -0700 kbuild: Add CLANG_FLAGS to as-instr A future change will move CLANG_FLAGS from KBUILD_{A,C}FLAGS to KBUILD_CPPFLAGS so that '--target' is available while preprocessing. When that occurs, the following errors appear multiple times when building ARCH=powerpc powernv_defconfig: ld.lld: error: vmlinux.a(arch/powerpc/kernel/head_64.o):(.text+0x12d4): relocation R_PPC64_ADDR16_HI out of range: -4611686018409717520 is not in [-2147483648, 2147483647]; references '__start___soft_mask_table' ld.lld: error: vmlinux.a(arch/powerpc/kernel/head_64.o):(.text+0x12e8): relocation R_PPC64_ADDR16_HI out of range: -4611686018409717392 is not in [-2147483648, 2147483647]; references '__stop___soft_mask_table' Diffing the .o.cmd files reveals that -DHAVE_AS_ATHIGH=1 is not present anymore, because as-instr only uses KBUILD_AFLAGS, which will no longer contain '--target'. Mirror Kconfig's as-instr and add CLANG_FLAGS explicitly to the invocation to ensure the target information is always present. Signed-off-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit a7e5eb53bf9b800d086e2ebcfebd9a3bb16bd1b0 Author: Nathan Chancellor Date: Thu Jun 1 11:46:33 2023 -0700 powerpc/vdso: Include CLANG_FLAGS explicitly in ldflags-y A future change will move CLANG_FLAGS from KBUILD_{A,C}FLAGS to KBUILD_CPPFLAGS so that '--target' is available while preprocessing. When that occurs, the following error appears when building the compat PowerPC vDSO: clang: error: unsupported option '-mbig-endian' for target 'x86_64-pc-linux-gnu' make[3]: *** [.../arch/powerpc/kernel/vdso/Makefile:76: arch/powerpc/kernel/vdso/vdso32.so.dbg] Error 1 Explicitly add CLANG_FLAGS to ldflags-y, so that '--target' will always be present. Signed-off-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 08f6554ff90ef189e6b8f0303e57005bddfdd6a7 Author: Nathan Chancellor Date: Thu Jun 1 11:38:24 2023 -0700 mips: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation A future change will move CLANG_FLAGS from KBUILD_{A,C}FLAGS to KBUILD_CPPFLAGS so that '--target' is available while preprocessing. When that occurs, the following error appears when building ARCH=mips with clang (tip of tree error shown): clang: error: unsupported option '-mabi=' for target 'x86_64-pc-linux-gnu' Add KBUILD_CPPFLAGS in the CHECKFLAGS invocation to keep everything working after the move. Signed-off-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 371b74c8ba8fa588ab9ba10d0504acf495b3490e Author: Damien Le Moal Date: Tue May 30 16:29:24 2023 +0900 ata: libata-sata: Simplify ata_change_queue_depth() Commit 141f3d6256e5 ("ata: libata-sata: Fix device queue depth control") added a struct ata_device argument to ata_change_queue_depth() to address problems with changing the queue depth of ATA devices managed through libsas. This was due to problems with ata_scsi_find_dev() which are now fixed with commit 7f875850f20a ("ata: libata-scsi: Use correct device no in ata_find_dev()"). Undo some of the changes of commit 141f3d6256e5: remove the added struct ata_device aregument and use again ata_scsi_find_dev() to find the target ATA device structure. While doing this, also make sure that ata_scsi_find_dev() is called with ap->lock held, as it should. libsas and libata call sites of ata_change_queue_depth() are updated to match the modified function arguments. Signed-off-by: Damien Le Moal Reviewed-by: Jason Yan Reviewed-by: John Garry commit 49b472ebc61de3d4aa7cc57539246bb39f6c5128 Author: Clark Wang Date: Wed May 17 11:30:30 2023 +0800 i3c: master: svc: add NACK check after start byte sent Add NACK check after start byte is sent. It is possible to detect early that a device is not on the bus and avoid invalid transmissions thereafter. Signed-off-by: Clark Wang Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20230517033030.3068085-3-xiaoning.wang@nxp.com Signed-off-by: Alexandre Belloni commit 33beadb3b1ab74e69db2c49d9663f3a93a273943 Author: Clark Wang Date: Wed May 17 11:30:29 2023 +0800 i3c: master: svc: fix cpu schedule in spin lock pm_runtime_resume_and_get() may call sleep(). It cannot be used in svc_i3c_master_start_xfer_locked(), because it is in a spin lock. Move the pm runtime operations to svc_i3c_master_enqueue_xfer(). Signed-off-by: Clark Wang Fixes: 05be23ef78f7 ("i3c: master: svc: add runtime pm support") Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20230517033030.3068085-2-xiaoning.wang@nxp.com Signed-off-by: Alexandre Belloni commit 1c5ee2a77b1bacd4c333bebea93610aaf17977be Author: Clark Wang Date: Wed May 17 11:30:28 2023 +0800 i3c: master: svc: fix i3c suspend/resume issue When system suspends, if i3c module is powered down, register value will lose. Need to save the key registers before system suspend. So save these registers value in runtime pm suspend, and restore them if these register's value is different with the saved values when runtime pm resume. Signed-off-by: Clark Wang Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20230517033030.3068085-1-xiaoning.wang@nxp.com Signed-off-by: Alexandre Belloni commit fe20b1dcd2de47cdc983a47f4fb7a781e0b6c39c Author: Uwe Kleine-König Date: Wed May 17 18:55:14 2023 +0200 power: supply: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Sebastian Reichel commit f69de8aa4752adae750892c71711a5b806ec0dff Author: Matthieu Baerts Date: Fri Jun 2 11:36:07 2023 +0200 ipv6: lower "link become ready"'s level message This following message is printed in the console each time a network device configured with an IPv6 addresses is ready to be used: ADDRCONF(NETDEV_CHANGE): : link becomes ready When netns are being extensively used -- e.g. by re-creating netns' with veth to discuss with each others for testing purposes like mptcp_join.sh selftest does -- it generates a lot of messages like that: more than 700 when executing mptcp_join.sh with the latest version. It looks like this message is not that helpful after all: maybe it can be used as a sign to know if there is something wrong, e.g. if a device is being regularly reconfigured by accident? But even then, there are better ways to monitor and diagnose such issues. When looking at commit 3c21edbd1137 ("[IPV6]: Defer IPv6 device initialization until the link becomes ready.") which introduces this new message, it seems it had been added to verify that the new feature was working as expected. It could have then used a lower level than "info" from the beginning but it was fine like that back then: 17 years ago. It seems then OK today to simply lower its level, similar to commit 7c62b8dd5ca8 ("net/ipv6: lower the level of "link is not ready" messages") and as suggested by Mat [1], Stephen and David [2]. Link: https://lore.kernel.org/mptcp/614e76ac-184e-c553-af72-084f792e60b0@kernel.org/T/ [1] Link: https://lore.kernel.org/netdev/68035bad-b53e-91cb-0e4a-007f27d62b05@tessares.net/T/ [2] Suggested-by: Mat Martineau Suggested-by: Stephen Hemminger Suggested-by: David Ahern Signed-off-by: Matthieu Baerts Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit b5bbc52fd01278642773818642288999a0236cb6 Author: Ming Lei Date: Sat Jun 3 12:06:01 2023 +0800 ublk: add control command of UBLK_U_CMD_GET_FEATURES Add control command of UBLK_U_CMD_GET_FEATURES for returning driver's feature set or capability. This way can simplify userspace for maintaining compatibility because userspace doesn't need to send command to one device for querying driver feature set any more. Such as, with the queried feature set, userspace can choose to use: - UBLK_CMD_GET_DEV_INFO2 or UBLK_CMD_GET_DEV_INFO, - UBLK_U_CMD_* or UBLK_CMD_* Userspace code: https://github.com/ming1/ubdsrv/commits/features-cmd Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230603040601.775227-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 3f89845698b7deecb3ea1e25a21d92b376796873 Author: Fabio Estevam Date: Tue May 30 16:19:21 2023 -0300 arm64: dts: imx8mm-phg: Add display support The imx8mm-phg has a SN65DSI83 MIPI-DSI to LVDS bridge. Add suppor for it. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0dc9d469c2bda63dcf8c9afd956fc39db6f2afca Author: Alexander Stein Date: Tue May 30 16:12:34 2023 +0200 arm64: dts: tqma8mqml: Add vcc supply to i2c eeproms Fixes the warnings: at24 0-0053: supply vcc not found, using dummy regulator at24 0-0057: supply vcc not found, using dummy regulator Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit a27335b3f1e03fb3d0cdd28066b4d7d28e71e3a9 Author: Fabio Estevam Date: Tue May 30 10:11:12 2023 -0300 arm64: dts: imx8mm-evk: Add HDMI support imx8mm-evk has a MIPI DSI port that can be used with a ADV7535 MIPI DSI to HDMI bridge. Add support for it. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 773887a41b9c26b0d1afccd51080635a976b867c Author: Fabio Estevam Date: Tue May 30 10:11:13 2023 -0300 arm64: defconfig: Enable the TI SN65DSI83 driver There are some imx8mm-based boards that contain an SN65DSI83 MIPI DSI to LVDS bridge chip. Add support for it so that the LVDS output can be functional by default. Signed-off-by: Fabio Estevam Reviewed-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 5ef0f31fb9285d72bbe3bfd80be34284d4b9c7dd Author: Oleksij Rempel Date: Tue May 30 14:03:45 2023 +0200 ARM: dts: imx6qdl: vicut1: rename power to power-button In order to address the warnings about the naming convention for keys, this commit renames the 'power' key to 'power-button' in the vicut1-12inch device tree source file. The warning in question is as follows: arch/arm/boot/dts/imx6q-vicut1.dtb: gpio-keys: 'power' does not match any of the regexes: '^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$', 'pinctrl-[0-9]+' The referenced warning originates from the following schema: Documentation/devicetree/bindings/input/gpio-keys.yaml Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 1d14bd943fa2bbdfda1efbcc080b298fed5f1803 Author: Oleksij Rempel Date: Tue May 30 14:03:44 2023 +0200 ARM: dts: imx6dl: prtrvt, prtvt7, prti6q, prtwd2: fix USB related warnings Fix USB-related warnings in prtrvt, prtvt7, prti6q and prtwd2 device trees by disabling unused usbphynop1 and usbphynop2 USB PHYs and providing proper configuration for the over-current detection. This fixes the following warnings with the current kernel: usb_phy_generic usbphynop1: dummy supplies not allowed for exclusive requests usb_phy_generic usbphynop2: dummy supplies not allowed for exclusive requests imx_usb 2184200.usb: No over current polarity defined By the way, fix over-current detection on usbotg port for prtvt7, prti6q and prtwd2 boards. Only prtrvt do not have OC on USB OTG port. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 31d682f1186c3c85eb8e7416a0b1d929b283ad43 Author: Oleksij Rempel Date: Tue May 30 14:03:43 2023 +0200 ARM: dts: imx6dl: plybas: fix USB over-current detection on USB OTG port USB over-current detection is supported on this board. So, activate it. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 84bd06535980595db95255c2c894845902dfb241 Author: Oleksij Rempel Date: Tue May 30 14:03:42 2023 +0200 ARM: dts: imx6ul: prti6g: fix USB over-current detection on USB OTG port USB over-current detection is supported on this board. So, activate it and fixes the following kernel warnings: imx_usb 2184200.usb: No over current polarity defined Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 18ee5b92ed5e27b667a3a464cbf7e9e7191765fa Author: Oleksij Rempel Date: Tue May 30 14:03:41 2023 +0200 ARM: dts: imx6qp: prtwd3: Enable USB over current detection on USB OTG port The imx6qp-prtwd3 board supports USB over current detection on the USB OTG port, however, it was previously disabled in the device tree. This commit enables the over current detection by changing the device tree setting from 'disable-over-current' to 'over-current-active-low'. This could potentially protect the USB port from damage due to over current situations. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 5fdc9d1e9a8cd1d8143b54a9f1bddc6b0483d67f Author: Oleksij Rempel Date: Tue May 30 14:03:40 2023 +0200 ARM: dts: imx6dl: prtmvt: fix different USB related warnings Fix USB-related warnings in imx6dl prtmvt device tree by disabling unused usbphynop1 and usbphynop2 USB PHYs and over-current detection which is not supported on USB h1 port. This fixes the following warnings with the current kernel: usb_phy_generic usbphynop1: dummy supplies not allowed for exclusive requests usb_phy_generic usbphynop2: dummy supplies not allowed for exclusive requests imx_usb 2184200.usb: No over current polarity defined By the way, fix over-current detection on usbotg port. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 768b95f963b804dbaf559c61899abaae48bc9512 Author: Oleksij Rempel Date: Tue May 30 14:03:39 2023 +0200 ARM: dts: imx6dl: alti6p: fix different USB related warnings Fix USB-related warnings in imx6dl alti6p device tree by disabling unused usbphynop1 and usbphynop2 USB PHYs and properly configuring over-current detection on related ports. This fixes the following warnings with the current kernel: usb_phy_generic usbphynop1: dummy supplies not allowed for exclusive requests usb_phy_generic usbphynop2: dummy supplies not allowed for exclusive requests imx_usb 2184200.usb: No over-current polarity defined Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit d5a17fb69f909a97fffe3fd7eb3cdde526a7b4d7 Author: Oleksij Rempel Date: Tue May 30 14:03:38 2023 +0200 ARM: dts: imx6dl: vicut1: Address USB related warnings This patch addresses several USB-related warnings in the device tree for the imx6dl vicut1 system. Specifically, it disables the unused usbphynop1 and usbphynop2 USB PHYs, and disables unsupported over-current detection. This action mitigates the following kernel warnings: usb_phy_generic usbphynop1: dummy supplies not allowed for exclusive requests usb_phy_generic usbphynop2: dummy supplies not allowed for exclusive requests imx_usb 2184200.usb: No over-current polarity defined Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 543b2064b2f994bdc5d8de82c95f29a1417ee81c Author: Oleksij Rempel Date: Tue May 30 14:03:37 2023 +0200 ARM: dts: imx6dl: Add trip points to thermal zones on several devices Kernel v6.3-rc1 prints errors due to missing trip points in thermal zones. These errors indicate a lack of critical temperature threshold settings, causing warnings at boot. To silence these errors, this patch introduces trip points into the thermal zones of several imx6dl based devices. The following devices are updated: - plym2m - prtvt7 - victgo - vicut1 These devices are automotive grade and expected to operate up to 105C. An exception is the plym2m, an industrial grade device, which is certified to work up to 85C. The added trip points act as alert thresholds but do not trigger any actions except warnings. This behavior is by design, as these devices should maintain their performance until the end, without any thermal throttling. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 5e7487d08d5cf3a39aeb98c064c4a4f3bf5dadd0 Author: Oleksij Rempel Date: Tue May 30 14:03:36 2023 +0200 ARM: dts: imx6dl: lanmcu: Configure over-current polarity for USB OTG node This commit adds the 'over-current-active-low' flag to the USB OTG node in the imx6dl-lanmcu device tree. This flag is necessary because the hardware signals over-current conditions by pulling the line low. Without this flag, the kernel could misinterpret an over-current condition, leading to unexpected behavior. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit bcadb701689a6569fbec7e60e21a73c586d0ed3b Author: Oleksij Rempel Date: Tue May 30 14:03:35 2023 +0200 ARM: dts: imx6dl: lanmcu: Disable unused USB PHY nodes In the imx6dl-lanmcu system, the usbh2 and usbh3 interfaces are not in use. However, the related USB PHY nodes (usbphynop1 and usbphynop2) are enabled by default in the imx6qdl.dtsi file, which can lead to confusion and potential resource mismanagement. This commit explicitly disables these unused USB PHY nodes in the imx6dl-lanmcu device tree, aligning the configuration more accurately with the actual hardware setup. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit fb9e67f279058a9fb9c7e3044479419dcef00d8b Author: Robin van der Gracht Date: Tue May 30 14:03:34 2023 +0200 ARM: dts: imx6q: prtwd2: Correct iomux configuration for ENET MDIO and MDC This commit addresses a misconfiguration in the prtwd2 device tree source. Specifically, the ENET MDIO and MDC pins were mistakenly assigned to the Ethernet block, while they are actually used by the I2C4 interface. Signed-off-by: Robin van der Gracht Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit e76194fc6e5e0d22e1ae6b7c19e010718bd61ca2 Author: David Jander Date: Tue May 30 14:03:33 2023 +0200 ARM: dts: imx6dl: prtvt7: Remove touchscreen inversion This touchscreen does not seem to be inverted in any axis, so remove these DT properties. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit b007934665132e387275438e91e2151464bb88a5 Author: Robin van der Gracht Date: Tue May 30 14:03:32 2023 +0200 ARM: dts: imx6dl: prtvt7: Adjust default backlight brightness to 65 This commit changes the default brightness level of the backlight on the prtvt7 device from 20 to 65, roughly equivalent to 75% of the maximum brightness level defined in the "brightness-levels" property. The adjustment provides a more optimal default brightness for the device, improving the overall user experience. Signed-off-by: Robin van der Gracht Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 49daa70b4f726e0de632e11e98ae8bfea3efd27d Author: Robin van der Gracht Date: Tue May 30 14:03:31 2023 +0200 ARM: dts: imx6qdl: vicut1: The sgtl5000 uses i2s not ac97 According to Documentation/devicetree/bindings/sound/fsl,ssi.txt 'fsl,mode' should be specified for AC97 mode only. The 'fsl,ssi' documentation doesn't say anything about specifying 'sound-dai-cells' so we'll remove that as well. Signed-off-by: Robin van der Gracht Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 13e2408d02dd12a3b46bf8a29b3ae4f6119fc520 Author: Eric Biggers Date: Sat Jun 3 19:23:12 2023 -0700 fsverity: simplify error handling in verify_data_block() Clean up the error handling in verify_data_block() to (a) eliminate the 'err' variable which has caused some confusion because the function actually returns a bool, (b) reduce the compiled code size slightly, and (c) execute one fewer branch in the success case. Link: https://lore.kernel.org/r/20230604022312.48532-1-ebiggers@kernel.org Signed-off-by: Eric Biggers commit d1f0c5ea04cd0a93309de0246278f0b22394692d Author: Eric Biggers Date: Sat Jun 3 19:21:01 2023 -0700 fsverity: don't use bio_first_page_all() in fsverity_verify_bio() bio_first_page_all(bio)->mapping->host is not compatible with large folios, since the first page of the bio is not necessarily the head page of the folio, and therefore it might not have the mapping pointer set. Therefore, move the dereference of ->mapping->host into verify_data_blocks(), which works with a folio. (Like the commit that this Fixes, this hasn't actually been tested with large folios yet, since the filesystems that use fs/verity/ don't support that yet. But based on code review, I think this is needed.) Fixes: 5d0f0e57ed90 ("fsverity: support verifying data from large folios") Link: https://lore.kernel.org/r/20230604022101.48342-1-ebiggers@kernel.org Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Eric Biggers commit 32ab3c5e6226a5c39b6674b5fbb16b492c2faa2e Author: Eric Biggers Date: Sat Jun 3 19:23:48 2023 -0700 fsverity: constify fsverity_hash_alg Now that fsverity_hash_alg doesn't have an embedded mempool, it can be 'const' almost everywhere. Add it. Link: https://lore.kernel.org/r/20230604022348.48658-1-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 8fcd94add6c5c93ed3b9314456e8420914401530 Author: Eric Biggers Date: Mon May 15 22:12:16 2023 -0700 fsverity: use shash API instead of ahash API The "ahash" API, like the other scatterlist-based crypto APIs such as "skcipher", comes with some well-known limitations. First, it can't easily be used with vmalloc addresses. Second, the request struct can't be allocated on the stack. This adds complexity and a possible failure point that needs to be worked around, e.g. using a mempool. The only benefit of ahash over "shash" is that ahash is needed to access traditional memory-to-memory crypto accelerators, i.e. drivers/crypto/. However, this style of crypto acceleration has largely fallen out of favor and been superseded by CPU-based acceleration or inline crypto engines. Also, ahash needs to be used asynchronously to take full advantage of such hardware, but fs/verity/ has never done this. On all systems that aren't actually using one of these ahash-only crypto accelerators, ahash just adds unnecessary overhead as it sits between the user and the underlying shash algorithms. Also, XFS is planned to cache fsverity Merkle tree blocks in the existing XFS buffer cache. As a result, it will be possible for a single Merkle tree block to be split across discontiguous pages (https://lore.kernel.org/r/20230405233753.GU3223426@dread.disaster.area). This data will need to be hashed. It is easiest to work with a vmapped address in this case. However, ahash is incompatible with this. Therefore, let's convert fs/verity/ from ahash to shash. This simplifies the code, and it should also slightly improve performance for everyone who wasn't actually using one of these ahash-only crypto accelerators, i.e. almost everyone (or maybe even everyone)! Link: https://lore.kernel.org/r/20230516052306.99600-1-ebiggers@kernel.org Reviewed-by: Christoph Hellwig Acked-by: Ard Biesheuvel Signed-off-by: Eric Biggers commit 17afe1a31b993bf0d6cdc4a1455f9f9f2caaa964 Author: Fabio Estevam Date: Mon May 29 17:06:45 2023 -0300 ARM: dts: imx: Use 'eeprom' as node name Devicetree node names should be generic. Use 'eeprom' as node name to avoid devicetree check warning from at24.yaml. Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 37d61885acdec51bb062cf33e0ad6fdc40114ff1 Author: Hugo Villeneuve Date: Mon May 29 15:35:26 2023 -0400 arm64: dts: imx8mn-var-som-symphony: adapt FEC pinctrl for SOMs with onboard PHY The VAR SOM symphony carrier board can be used with SOMs which have a soldered ethernet PHY onboard and with SOMs which don't have one. For SOMs with an onboard PHY, the PHY on the cartrier board is not used, and GPIO1_IO9 is used as a reset line to the onboard PHY. For SOMs without an onboard PHY, the PHY on the carrier board is used. For this configuration, pca9534 GPIO 5 (located on the carrier board) is used as a reset line to the PHY, and GPIO1_IO9 is not used. GPIO1_IO9 is not connected to any user-accessible pins or functions, and leaving it enabled in the mux pinctrl for both configurations is safe. Signed-off-by: Hugo Villeneuve Signed-off-by: Shawn Guo commit 26ca44bdbd13edbe6cbe0dc63327c3316ce01bae Author: Hugo Villeneuve Date: Mon May 29 15:33:12 2023 -0400 arm64: dts: imx8mn-var-som: add 20ms delay to ethernet regulator enable This commit is taken from Variscite linux kernel public git repository. Original patch author: Nate Drude See: https://github.com/varigit/linux-imx/blob/5.15-2.0.x-imx_var01/drivers/net/ethernet/freescale/fec_main.c#L3993-L4050 The ethernet phy reset was moved from the fec controller to the mdio bus, see for example: 0e825b32c033e1998d0ebaf247f5dab3c340e3bf When the fec driver managed the reset, the regulator had time to settle during the fec phy reset before calling of_mdiobus_register, which probes the mii bus for the phy id to match the correct driver. Now that the mdio bus controls the reset, the fec driver no longer has any delay between enabling the regulator and calling of_mdiobus_register. If the regulator voltage has not settled, the phy id will not be read correctly and the generic phy driver will be used. The following call tree explains in more detail: fec_probe fec_reset_phy <- no longer introduces delay after migration to mdio reset fec_enet_mii_init of_mdiobus_register of_mdiobus_register_phy fwnode_mdiobus_register_phy get_phy_device <- mii probe for phy id to match driver happens here ... fwnode_mdiobus_phy_device_register phy_device_register mdiobus_register_device mdio_device_reset <- mdio reset assert / deassert delay happens here Add a 20ms enable delay to the regulator to fix the issue. Signed-off-by: Hugo Villeneuve Signed-off-by: Shawn Guo commit d874b9f7f28335809df27d6e0def4103e34c534a Author: Luca Ceresoli Date: Mon May 29 11:57:28 2023 +0200 arm64: dts: imx8mp-msc-sm2s: Add sound card The MSC SM2-MB-EP1 carrier board for the SM2S-IMX8PLUS SMARC module has an NXP SGTL5000 audio codec connected to I2S-0 (sai2). This requires to: * add the power supplies (always on) * enable sai2 with pinmuxes * reparent the CLKOUT1 clock that feeds the codec SYS_MCLK to IMX8MP_CLK_24M in order it to generate an accurate 24 MHz rate Signed-off-by: Luca Ceresoli Signed-off-by: Shawn Guo commit f5402fff11b00466b664ad75d951a06fe8e4a20d Author: Adam Ford Date: Sun May 28 06:22:53 2023 -0500 arm64: dts: imx8mn-beacon: Migrate sound card to simple-audio-card Instead of using a custom glue layer connecting the wm8962 CODEC to the SAI3 sound-dai, migrate the sound card to simple-audio-card. Signed-off-by: Adam Ford Signed-off-by: Shawn Guo commit 69e2f37a6ddc2d1cd964c8d3af2581ea21be764d Author: Adam Ford Date: Sun May 28 06:01:19 2023 -0500 arm64: dts: imx8mp-beacon-kit: Enable WM8962 Audio CODEC The baseboard has an WM8962 Audio CODEC connected to the SAI3 peripheral. The CODEC supports stereo in and out and a microphone input connected to the headphone jack. Route this CODEC through the simple-audio-card driver. Signed-off-by: Adam Ford Signed-off-by: Shawn Guo commit 3c52e3e454079a74fd9c997d94c886fe47bc936e Author: Fabio Estevam Date: Sat May 27 17:50:48 2023 -0300 ARM: dts: imx6ul-ccimx6ulsom: Fix the "coin" regulator name As documented in pfuze100.yaml, the correct name for the regulator is "coin", so change it to fix the following DT check warning: imx6ul-ccimx6ulsbcexpress.dtb: pmic@8: regulators: 'vcoin' does not match any of the regexes: Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 106924746955cfd1f37f6dbb97f94f5cf7db1d7c Author: Fabio Estevam Date: Sat May 27 17:50:47 2023 -0300 ARM: dts: imx: Use 'pmic' as node name Devicetree node names should be generic. Use 'pmic' as node name to avoid devicetree check warning from pfuze100.yaml. Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 6266a0198f281198a3c49c68979d7b1959bd0dfc Author: Fabio Estevam Date: Sat May 27 13:10:46 2023 -0300 ARM: dts: imx6: Use the mux- prefix According to Documentation/devicetree/bindings/sound/imx-audmux.yaml, there must be a "mux-" prefix in the audmux port nodes. Add the "mux-" prefix to avoid devicetree schema warnings. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit ba5e46f762f18d1759769cbcda714a6685bf1e4f Author: Fabio Estevam Date: Sat May 27 13:06:34 2023 -0300 ARM: dts: imx7d-sdb: Allow UHS modes Describe the SD1_VSELECT pad, which is necessary to allow UHS modes. Also, to support higher SD card speed modes, describe the 100MHz and 200MHz SD card pinctrl entries. Suggested-by: Ye Li Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit dda66e99db331c19d7e9e6fe9422d479e27257ae Author: Fabio Estevam Date: Sat May 27 13:06:33 2023 -0300 ARM: dts: imx7d-sdb: Describe the SD card regulator Improve the devicetree description by adding the SD card regulator that is controlled via GPIO5_2. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit c6dab7245604862d86f0b6d764919f470584d24f Author: Fabrizio Lamarque Date: Tue May 30 09:53:10 2023 +0200 dt-bindings: iio: ad7192: Add mandatory reference voltage source Add required reference voltage (VRef) supply regulator. AD7192 requires three independent voltage sources: DVdd, AVdd and VRef (on REFINx pin pairs). Fixes: b581f748cce0 ("staging: iio: adc: ad7192: move out of staging") Signed-off-by: Fabrizio Lamarque Acked-by: Conor Dooley Cc: Link: https://lore.kernel.org/r/20230530075311.400686-5-fl.scratchpad@gmail.com Signed-off-by: Jonathan Cameron commit f7d9e21dd274b97dc0a8dbc136a2ea8506063a96 Author: Fabrizio Lamarque Date: Tue May 30 09:53:08 2023 +0200 iio: adc: ad7192: Fix internal/external clock selection Fix wrong selection of internal clock when mclk is defined. Resolve a logical inversion introduced in c9ec2cb328e3. Fixes: c9ec2cb328e3 ("iio: adc: ad7192: use devm_clk_get_optional() for mclk") Signed-off-by: Fabrizio Lamarque Reviewed-by: Nuno Sa Cc: Link: https://lore.kernel.org/r/20230530075311.400686-3-fl.scratchpad@gmail.com Signed-off-by: Jonathan Cameron commit 9e58e3a6f8e1c483c86a04903b7b7aa0923e4426 Author: Fabrizio Lamarque Date: Tue May 30 09:53:07 2023 +0200 iio: adc: ad7192: Fix null ad7192_state pointer access Pointer to indio_dev structure is obtained via spi_get_drvdata() at the beginning of function ad7192_setup(), but the spi->dev->driver_data member is not initialized, hence a NULL pointer is returned. Fix by changing ad7192_setup() signature to take pointer to struct iio_dev, and get ad7192_state pointer via st = iio_priv(indio_dev); Fixes: bd5dcdeb3fd0 ("iio: adc: ad7192: convert to device-managed functions") Signed-off-by: Fabrizio Lamarque Reviewed-by: Nuno Sa Cc: Link: https://lore.kernel.org/r/20230530075311.400686-2-fl.scratchpad@gmail.com Signed-off-by: Jonathan Cameron commit a4cba07e64e6ec22d9504a1a45d29afa863dc19c Author: Rasmus Villemoes Date: Wed May 3 12:50:41 2023 +0200 iio: addac: ad74413: don't set DIN_SINK for functions other than digital input Apparently, despite the name Digital Input Configuration Register, the settings in the DIN_CONFIGx registers also affect other channel functions. In particular, setting a non-zero value in the DIN_SINK field breaks the resistance measurement function. Now, one can of course argue that specifying a drive-strength-microamp property along with a adi,ch-func which is not one of the digital input functions is a bug in the device tree. However, we have a rather complicated setup with instances of ad74412r on external hardware modules, and have set a default drive-strength-microamp in our DT fragments describing those, merely modifying the adi,ch-func settings to reflect however the modules have been wired up. And restricting this setting to just being done for digital input doesn't make the driver any more complex. Fixes: 504eb485589d1 (iio: ad74413r: wire up support for drive-strength-microamp property) Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20230503105042.453755-1-linux@rasmusvillemoes.dk Cc: Signed-off-by: Jonathan Cameron commit 2daf2ae9793d03d705a0ab5bbe876c5fe5ca6247 Author: Shreeya Patel Date: Sun Jun 4 00:23:40 2023 +0530 dt-bindings: iio: adc: Add rockchip,rk3588-saradc string Add rockchip,rk3588-saradc compatible string. Signed-off-by: Shreeya Patel Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230603185340.13838-9-shreeya.patel@collabora.com Signed-off-by: Jonathan Cameron commit 5e63d7a260ea5536c22fda7b852f54eeee6d7c98 Author: Shreeya Patel Date: Sun Jun 4 00:23:38 2023 +0530 iio: adc: rockchip_saradc: Use dev_err_probe Use dev_err_probe instead of dev_err in probe function, which simplifies code a little bit and prints the error code. Signed-off-by: Shreeya Patel Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230603185340.13838-7-shreeya.patel@collabora.com Signed-off-by: Jonathan Cameron commit 10bec68f51ee1564fc2b6dcc25ccec22a01b22f9 Author: Shreeya Patel Date: Sun Jun 4 00:23:37 2023 +0530 iio: adc: rockchip_saradc: Match alignment with open parenthesis Match alignment with open parenthesis for improving the code readability. Signed-off-by: Shreeya Patel Reviewed-by: Andy Shevchenko Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230603185340.13838-6-shreeya.patel@collabora.com Signed-off-by: Jonathan Cameron commit 47902344c8c35c1c08147df08879ef75a3ff86c1 Author: Shreeya Patel Date: Sun Jun 4 00:23:36 2023 +0530 iio: adc: rockchip_saradc: Use of_device_get_match_data Use of_device_get_match_data() to simplify the code. Signed-off-by: Shreeya Patel Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230603185340.13838-5-shreeya.patel@collabora.com Signed-off-by: Jonathan Cameron commit 97ad10bb2901738b87b02a8fbf02215f1f198bdb Author: Shreeya Patel Date: Sun Jun 4 00:23:35 2023 +0530 iio: adc: rockchip_saradc: Make use of devm_clk_get_enabled Use devm_clk_get_enabled() to avoid manually disabling the clock. Signed-off-by: Shreeya Patel Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230603185340.13838-4-shreeya.patel@collabora.com Signed-off-by: Jonathan Cameron commit 757953f8ec6916084e0c22218d1d0482e9fc6682 Author: Simon Xue Date: Sun Jun 4 00:23:34 2023 +0530 iio: adc: rockchip_saradc: Add support for RK3588 Add new start and read functions to support rk3588 device. Also, add a device compatible string for the same. Signed-off-by: Simon Xue Signed-off-by: Shreeya Patel Reviewed-by: Andy Shevchenko Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230603185340.13838-3-shreeya.patel@collabora.com Signed-off-by: Jonathan Cameron commit fb1c13d595857ccff49cbb69ddcdc08594a832e7 Author: Simon Xue Date: Sun Jun 4 00:23:33 2023 +0530 iio: adc: rockchip_saradc: Add callback functions Add start, read and power_down callback functions, which will help in adding new rockchip device support cleanly. Signed-off-by: Simon Xue Signed-off-by: Shreeya Patel Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230603185340.13838-2-shreeya.patel@collabora.com Signed-off-by: Jonathan Cameron commit 76015b9e573eee41009ba8a5ff556ef02f83abfd Author: Neil Armstrong Date: Thu Jun 1 12:09:47 2023 +0200 dt-bindings: display: msm: dp-controller: document SM8550 compatible The SM8550 & SM8350 SoC shares the same DP TX IP version, use the SM8350 compatible as fallback for SM8550. Acked-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong Patchwork: https://patchwork.freedesktop.org/patch/540552/ Link: https://lore.kernel.org/r/20230601-topic-sm8550-upstream-dp-v2-1-e8778109c757@linaro.org Signed-off-by: Dmitry Baryshkov commit 9edac2eec47c82dcb679a285c6d9bb4b6f21a1a9 Author: Bjorn Andersson Date: Sun May 14 20:02:56 2023 -0700 drm/msm/dp: Clean up pdev/dev duplication in dp_power The dp_power module keeps track of both the DP controller's struct platform_device and struct device - with the prior pulled out of the dp_parser module. Clean up the duplication by dropping the platform_device reference and just track the passed struct device. Signed-off-by: Bjorn Andersson Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/536939/ Link: https://lore.kernel.org/r/20230515030256.300104-3-quic_bjorande@quicinc.com Signed-off-by: Dmitry Baryshkov commit 9f93258549dbc677898224b8c20d56d1eb96b66e Author: Bjorn Andersson Date: Sun May 14 20:02:55 2023 -0700 drm/msm/dp: Clean up logs dp_power module The clk_bulk API already provides error messages indicating which specific clock in the request for which the operation failed, further more these errors are associated with the specific DisplayPort controller (rather than the shared drm_device). The additional error messages int he dp_power module does thereby not provide any benefit. While at it, none of the dp_power handles passed to these functions are dynamic in nature, so there should not be any need for runtime checking them. Drop these as well. Signed-off-by: Bjorn Andersson Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/536938/ Link: https://lore.kernel.org/r/20230515030256.300104-2-quic_bjorande@quicinc.com Signed-off-by: Dmitry Baryshkov commit 1c5f6051ffdfdc633af088e565bc028e459b57d2 Author: Dmitry Baryshkov Date: Sat May 20 21:20:50 2023 +0300 drm/msm/dp: remove most of usbpd-related remains Remove most of remains of downstream usbpd code. Mainline kernel uses different approach for managing Type-C / USB-PD, so this remains unused. Signed-off-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Patchwork: https://patchwork.freedesktop.org/patch/538270/ Link: https://lore.kernel.org/r/20230520182050.4014143-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 5d1227d1c7a38adb26a0203ecaf5873b2bbbf7b6 Author: Dmitry Baryshkov Date: Thu Jun 1 20:22:36 2023 +0300 drm/msm/dpu: simplify dpu_encoder_phys_wb_init() There is no need to assign a result to temp varable just to return it after a goto. Drop the temporary variable and goto and return the result directly. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Tested-by: Abhinav Kumar # sc7280 Patchwork: https://patchwork.freedesktop.org/patch/540639/ Link: https://lore.kernel.org/r/20230601172236.564445-8-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit ed02d3dd18dc35a8f8ca0527c1eaebb992585ec6 Author: Dmitry Baryshkov Date: Thu Jun 1 20:22:35 2023 +0300 drm/msm/dpu: drop temp variable from dpu_encoder_phys_cmd_init() There is no need to assign a result to temp varable just to return it two lines below. Drop the temporary variable. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Tested-by: Abhinav Kumar # sc7280 Patchwork: https://patchwork.freedesktop.org/patch/540637/ Link: https://lore.kernel.org/r/20230601172236.564445-7-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 004be38657f45f6ecba4158dde2754bc4b75081d Author: Dmitry Baryshkov Date: Thu Jun 1 20:22:34 2023 +0300 drm/msm/dpu: call dpu_rm_get_intf() from dpu_encoder_get_intf() There is little sense to get intf index just to call dpu_rm_get_intf() on it. Move dpu_rm_get_intf() call to dpu_encoder_get_intf() function. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Tested-by: Abhinav Kumar # sc7280 Patchwork: https://patchwork.freedesktop.org/patch/540632/ Link: https://lore.kernel.org/r/20230601172236.564445-6-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 04ada3d8380ac8623fc79b172427b984535f8215 Author: Dmitry Baryshkov Date: Thu Jun 1 20:22:33 2023 +0300 drm/msm/dpu: inline dpu_encoder_get_wb() The function dpu_encoder_get_wb() returns controller_id if the corresponding WB is present in the catalog. We can inline this function and rely on dpu_rm_get_wb() returning NULL for indices for which the WB is not present on the device. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Tested-by: Abhinav Kumar # sc7280 Patchwork: https://patchwork.freedesktop.org/patch/540634/ Link: https://lore.kernel.org/r/20230601172236.564445-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 8ea432b8428e9b324eee2bbfafbded99f80e3414 Author: Dmitry Baryshkov Date: Thu Jun 1 20:22:32 2023 +0300 drm/msm/dpu: drop duplicated intf/wb indices from encoder structs Remove intf_idx and wb_idx fields from struct dpu_encoder_phys and struct dpu_enc_phys_init_params. Set the hw_intf and hw_wb directly and use them to get the instance index. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Tested-by: Abhinav Kumar # sc7280 Patchwork: https://patchwork.freedesktop.org/patch/540635/ Link: https://lore.kernel.org/r/20230601172236.564445-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 7731ee3b06c12b3eb46957b054629e1bb88e99ce Author: Dmitry Baryshkov Date: Thu Jun 1 20:22:31 2023 +0300 drm/msm/dpu: separate common function to init physical encoder Move common DPU physical encoder initialization code to the new function dpu_encoder_phys_init(). Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Tested-by: Abhinav Kumar # sc7280 Patchwork: https://patchwork.freedesktop.org/patch/540630/ Link: https://lore.kernel.org/r/20230601172236.564445-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 9b930f14e530135e0f90bb809a1d8d72f50b1143 Author: Dmitry Baryshkov Date: Thu Jun 1 20:22:30 2023 +0300 drm/msm/dpu: merge dpu_encoder_init() and dpu_encoder_setup() There is no reason to split the dpu_encoder interface into separate _init() and _setup() phases. Merge them into a single function. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Tested-by: Abhinav Kumar # sc7280 Patchwork: https://patchwork.freedesktop.org/patch/540628/ Link: https://lore.kernel.org/r/20230601172236.564445-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit eed3f9c7c36a2dbf01b6a3529a17b015df68b456 Author: Luca Weiss Date: Thu Jun 1 19:00:11 2023 +0200 drm/msm/mdp5: Add MDP5 configuration for MSM8226 Add the required config for the v1.1 MDP5 found on MSM8226. Reviewed-by: Dmitry Baryshkov Signed-off-by: Luca Weiss Patchwork: https://patchwork.freedesktop.org/patch/540612/ Link: https://lore.kernel.org/r/20230308-msm8226-mdp-v3-4-b6284145d67a@z3ntu.xyz Signed-off-by: Dmitry Baryshkov commit c6e79fd5c80d8d6f9039b498a1203214bdf7695e Author: Luca Weiss Date: Thu Jun 1 19:00:10 2023 +0200 dt-bindings: display/msm: qcom, mdp5: Add msm8226 compatible Add the compatible for the MDP5 found on MSM8226. Acked-by: Conor Dooley Signed-off-by: Luca Weiss Patchwork: https://patchwork.freedesktop.org/patch/540614/ Link: https://lore.kernel.org/r/20230308-msm8226-mdp-v3-3-b6284145d67a@z3ntu.xyz Signed-off-by: Dmitry Baryshkov commit 1531d0b9235e5c8e959fbfe02c90ecd5b2b8de05 Author: Luca Weiss Date: Thu Jun 1 19:00:13 2023 +0200 drm/msm/dsi: Add phy configuration for MSM8226 MSM8226 uses a modified PLL lock sequence compared to MSM8974, which is based on the function dsi_pll_enable_seq_m in the msm-3.10 kernel. Worth noting that the msm-3.10 downstream kernel also will try other sequences in case this one doesn't work, but during testing it has shown that the _m sequence succeeds first time also: .pll_enable_seqs[0] = dsi_pll_enable_seq_m, .pll_enable_seqs[1] = dsi_pll_enable_seq_m, .pll_enable_seqs[2] = dsi_pll_enable_seq_d, .pll_enable_seqs[3] = dsi_pll_enable_seq_d, .pll_enable_seqs[4] = dsi_pll_enable_seq_f1, .pll_enable_seqs[5] = dsi_pll_enable_seq_c, .pll_enable_seqs[6] = dsi_pll_enable_seq_e, We may need to expand this in the future. Signed-off-by: Luca Weiss Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/540618/ Link: https://lore.kernel.org/r/20230308-msm8226-mdp-v3-6-b6284145d67a@z3ntu.xyz Signed-off-by: Dmitry Baryshkov commit 82cf4954a0d5f50fa546753cbf0388e69755c54d Author: Luca Weiss Date: Thu Jun 1 19:00:12 2023 +0200 drm/msm/dsi: Add configuration for MSM8226 Add the config for the v1.0.2 DSI found on MSM8226. We can reuse existing bits from other revisions that are identical for v1.0.2. Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss Patchwork: https://patchwork.freedesktop.org/patch/540616/ Link: https://lore.kernel.org/r/20230308-msm8226-mdp-v3-5-b6284145d67a@z3ntu.xyz Signed-off-by: Dmitry Baryshkov commit 46ccf3e0ed63e7f6f7a6a6258888eec0787a9f88 Author: Luca Weiss Date: Thu Jun 1 19:00:09 2023 +0200 dt-bindings: display/msm: dsi-controller-main: Add msm8226 compatible Add the compatible for the DSI found on MSM8226. Acked-by: Conor Dooley Signed-off-by: Luca Weiss Patchwork: https://patchwork.freedesktop.org/patch/540613/ Link: https://lore.kernel.org/r/20230308-msm8226-mdp-v3-2-b6284145d67a@z3ntu.xyz Signed-off-by: Dmitry Baryshkov commit d01eb3421b101c6f066fc474f567ba902cca0077 Author: Luca Weiss Date: Thu Jun 1 19:00:08 2023 +0200 dt-bindings: msm: dsi-phy-28nm: Document msm8226 compatible The MSM8226 SoC uses a slightly different 28nm dsi phy. Add a new compatible for it. And while we're at it, in the dsi-phy-28nm.yaml move the 8960 compatible to its correct place so its sorted alphabetically. Acked-by: Conor Dooley Signed-off-by: Luca Weiss Patchwork: https://patchwork.freedesktop.org/patch/540621/ Link: https://lore.kernel.org/r/20230308-msm8226-mdp-v3-1-b6284145d67a@z3ntu.xyz Signed-off-by: Dmitry Baryshkov commit eea9cf72b718b1d2c935f2be2610d05e7527f2d8 Author: Su Hui Date: Mon May 22 09:32:13 2023 +0800 drm/msm: Remove unnecessary (void*) conversions Pointer variables of (void*) type do not require type cast. Signed-off-by: Su Hui Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/540599/ Link: https://lore.kernel.org/r/20230522013213.25876-1-suhui@nfschina.com Signed-off-by: Dmitry Baryshkov commit 025e3d97867c55e4519edde2fda9363b9a4da795 Author: Dan Carpenter Date: Fri May 26 14:51:59 2023 +0300 drm/msm/dpu: clean up dpu_kms_get_clk_rate() returns Static analysis tools complain about the -EINVAL error code being stored in an unsigned variable. Let's change this to match the clk_get_rate() function which is type unsigned long and returns zero on error. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Dan Carpenter Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/539626/ Link: https://lore.kernel.org/r/28644c5e-950e-41cd-8389-67f37b067bdc@kili.mountain Signed-off-by: Dmitry Baryshkov commit 997ed53dd69379d266fee206774e1c6b1244c178 Author: Kuogee Hsieh Date: Thu May 25 10:40:58 2023 -0700 drm/msm/dpu: Tear down DSC datapath on encoder cleanup Unset DSC_ACTIVE bit at dpu_hw_ctl_reset_intf_cfg_v1(), dpu_encoder_unprep_dsc() and dpu_encoder_dsc_pipe_clr() functions to tear down DSC data path if DSC data path was setup previous. Changes in V10: -- pass ctl directly instead of dpu_enc to dsc_pipe_cfg() -- move both dpu_encoder_unprep_dsc() and dpu_encoder_dsc_pipe_clr() to above phys_cleanup() Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/539515/ Link: https://lore.kernel.org/r/1685036458-22683-11-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit 761c629d186009517477a0c415ecfbff3063ecbb Author: Kuogee Hsieh Date: Thu May 25 10:40:56 2023 -0700 drm/msm/dpu: separate DSC flush update out of interface Currently DSC flushing happens during interface configuration at dpu_hw_ctl_intf_cfg_v1(). Separate DSC flush away from dpu_hw_ctl_intf_cfg_v1() by adding dpu_hw_ctl_update_pending_flush_dsc_v1() to handle both per-DSC engine and DSC flush bits at same time to make it consistent with the location of flush programming of other DPU sub-blocks. Changes in v10: -- rewording commit text -- pass ctl directly instead of dpu_enc to dsc_pipe_cfg() -- ctx->pending_dsc_flush_mask = 0; Changes in v11: -- add Fixes tag Changes in v12: -- move dsc parameter to next line at dpu_encoder_dsc_pipe_cfg() Changes in v14: -- Fixes tag had been move to 1st patch of this series Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/539506/ Link: https://lore.kernel.org/r/1685036458-22683-9-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit 625cbb077007698060b12d0ae5657a4d8411b153 Author: Kuogee Hsieh Date: Thu May 25 10:40:55 2023 -0700 drm/msm/dpu: always clear every individual pending flush mask There are two tiers of pending flush control, top level and individual hardware block. Currently only the top level of flush mask is reset to 0 but the individual pending flush masks of particular hardware blocks are left at their previous values, eventually accumulating all possible bit values and typically flushing more than necessary. Reset all individual hardware block flush masks to 0 to avoid accidentally flushing them. Changes in V13: -- rewording commit text -- add an empty space line as suggested Changes in V14: -- add Fixes tag Fixes: 73bfb790ac78 ("msm:disp:dpu1: setup display datapath for SC7180 target") Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/539508/ Link: https://lore.kernel.org/r/1685036458-22683-8-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit d45be1ccd3303201e8f7c28aefe28e6e4b168ab8 Author: Kuogee Hsieh Date: Thu May 25 10:40:53 2023 -0700 drm/msm/dpu: Introduce PINGPONG_NONE to disconnect DSC from PINGPONG Disabling the crossbar mux between DSC and PINGPONG currently requires a bogus enum dpu_pingpong value to be passed when calling dsc_bind_pingpong_blk() with enable=false, even though the register value written is independent of the current PINGPONG block. Replace that `bool enable` parameter with a new PINGPONG_NONE dpu_pingpong flag that triggers the write of the "special" 0xF "crossbar disabled" value to the register instead. Changes in v4: -- more details to commit text Changes in v5: -- rewording commit text suggested by Marijn -- add DRM_DEBUG_KMS for DSC unbinding case Changes in v8: -- fix checkpatch warning Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/539505/ Link: https://lore.kernel.org/r/1685036458-22683-6-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit 108ff1417795eb991ce5c3af77c119e0841136f2 Author: Kuogee Hsieh Date: Thu May 25 10:40:52 2023 -0700 drm/msm/dpu: Guard PINGPONG DSC ops behind DPU_PINGPONG_DSC bit DPU < 7.0.0 has DPU_PINGPONG_DSC feature bit set to indicate it requires both dpu_hw_pp_setup_dsc() and dpu_hw_pp_dsc_{enable,disable}() to be executed to complete DSC configuration if DSC hardware block is present. Hence test DPU_PINGPONG_DSC feature bit and assign DSC related functions to the ops of PINGPONG block accordingly if DPU_PINGPONG_DSC bit is set. Changes in v6: -- split patches, this patch has function handles DPU_PINGPONG_DSC bit Changes in v9: -- the original code of assigning dsc related functions to the ops of pingpong block without testing the DPU_PINGPONG_DSC feature bit was restored back due to rebase error which defeat the purpose of this patch. Remove those error code. Changes in v10: -- change commit title -- correct texts at changes in v9 Changes in v12: -- fixed length too long at Changes in v9 Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/539504/ Link: https://lore.kernel.org/r/1685036458-22683-5-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit c20c44403e11d572c1adebf557c64017fd9868fd Author: Kuogee Hsieh Date: Thu May 25 10:40:51 2023 -0700 drm/msm/dpu: add DPU_PINGPONG_DSC feature bit for DPU < 7.0.0 DPU < 7.0.0 requires the PINGPONG block to be involved during DSC setting up. Since DPU >= 7.0.0, enabling and starting the DSC encoder engine was moved to INTF with the help of the flush mechanism. Add a DPU_PINGPONG_DSC feature bit to restrict the availability of dpu_hw_pp_setup_dsc() and dpu_hw_pp_dsc_{enable,disable}() on the PINGPONG block to DPU < 7.0.0 hardware, as the registers are not available on DPU 7.0.0 and higher anymore. Add DPU_PINGPONG_DSC to PINGPONG_SDM845_MASK, PINGPONG_SDM845_TE2_MASK and PINGPONG_SM8150_MASK which is used for all DPU < 7.0 chipsets. changes in v6: -- split patches and rearrange to keep catalog related files at this patch changes in v7: -- rewording commit text as suggested at review comments changes in v9: -- delete BIT(DPU_PINGPONG_DSC) from PINGPONG_SDM845_TE2_MASK changes in v10: -- correct order of commit text Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/539502/ Link: https://lore.kernel.org/r/1685036458-22683-4-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit 12cef323c903bd8b13d1f6ff24a9695c2cdc360b Author: Kuogee Hsieh Date: Thu May 25 10:40:49 2023 -0700 drm/msm/dpu: set DSC flush bit correctly at MDP CTL flush register The CTL_FLUSH register should be programmed with the 22th bit (DSC_IDX) to flush the DSC hardware blocks, not the literal value of 22 (which corresponds to flushing VIG1, VIG2 and RGB1 instead). Changes in V12: -- split this patch out of "separate DSC flush update out of interface" Changes in V13: -- rewording the commit text Changes in V14: -- drop 'DSC" from "The DSC CTL_FLUSH register" at commit text Fixes: 77f6da90487c ("drm/msm/disp/dpu1: Add DSC support in hw_ctl") Signed-off-by: Kuogee Hsieh Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/539496/ Link: https://lore.kernel.org/r/1685036458-22683-2-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit 4fb5ad612c5cb1dfc72bd6bb9150d0112bfb0d27 Author: Thomas Zimmermann Date: Mon May 22 21:17:01 2023 +0200 drm/msm: Use struct fb_info.screen_buffer The fbdev framebuffer is in system memory. Store the address in the field 'screen_buffer'. Fixes the following sparse warning. ../drivers/gpu/drm/msm/msm_fbdev.c:124:26: warning: incorrect type in assignment (different address spaces) ../drivers/gpu/drm/msm/msm_fbdev.c:124:26: expected char [noderef] __iomem *screen_base ../drivers/gpu/drm/msm/msm_fbdev.c:124:26: got void * Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/538531/ Link: https://lore.kernel.org/r/20230522191701.13406-1-tzimmermann@suse.de Signed-off-by: Dmitry Baryshkov commit a659098d78d607c150a45276b6e9726f43646619 Author: Dmitry Baryshkov Date: Sun May 21 22:22:29 2023 +0300 drm/msm/dpu: drop (mostly) unused DPU_NAME_SIZE define This define is used only in one place, in dpu_encoder debugfs code. Inline the value and drop the define completely. Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/538303/ Link: https://lore.kernel.org/r/20230521192230.9747-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 95666ca7431c0217ce65d932526c0dbe32f85265 Author: Dmitry Baryshkov Date: Sun May 21 22:22:28 2023 +0300 drm/msm/dpu: drop dpu_encoder_phys_ops::late_register() This callback has been unused since the driver being added. Drop it now. Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/538302/ Link: https://lore.kernel.org/r/20230521192230.9747-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 374918d2c396c7099c4bcd04ee044e8b0456afce Author: Dmitry Baryshkov Date: Sat May 20 23:01:03 2023 +0300 drm/msm/dsi: use mult_frac for pclk_bpp calculation Simplify calculations around pixel_clk_rate division. Replace common pattern of doing 64-bit multiplication and then a do_div() call with simpler mult_frac() invocation. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/538273/ Link: https://lore.kernel.org/r/20230520200103.4019607-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 6de6c28d97c02b5abdb208975cf392942e462424 Author: Dmitry Baryshkov Date: Sat May 20 23:01:02 2023 +0300 drm/msm/dsi: remove extra call to dsi_get_pclk_rate() In dsi_calc_clk_rate_v2() there is no need to call dsi_get_pclk_rate(). This function has just been called (from dsi_calc_pclk()) and its result is stored at msm_host->pixel_clk_rate. Use this variable directly. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Reviewed-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/538272/ Link: https://lore.kernel.org/r/20230520200103.4019607-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 5fe0faa62461adb578785169f29f3c4638ca4e9a Author: Dmitry Baryshkov Date: Fri May 19 01:22:38 2023 +0300 drm/msm/dpu: use common helper for WB and SSPP QoS setup Rework SSPP and WB code to use common helper for programming QoS settings. Reviewed-by: Jeykumar Sankaran Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/537912/ Link: https://lore.kernel.org/r/20230518222238.3815293-10-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit a5ebb27bffcc2c1e785abc6782202d9e4041e71c Author: Dmitry Baryshkov Date: Fri May 19 01:22:37 2023 +0300 drm/msm/dpu: remove struct dpu_hw_pipe_qos_cfg Now as the struct dpu_hw_pipe_qos_cfg consists of only one bool field, drop the structure and use corresponding bool directly. Reviewed-by: Jeykumar Sankaran Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/537918/ Link: https://lore.kernel.org/r/20230518222238.3815293-9-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 9ccff1d2c062302fe20ebbdee1831d0933d32a04 Author: Dmitry Baryshkov Date: Fri May 19 01:22:36 2023 +0300 drm/msm/dpu: drop DPU_PLANE_QOS_PANIC_CTRL This flag is always passed to _dpu_plane_set_qos_ctrl(), so drop it and remove corresponding conditions from the mentioned function. Reviewed-by: Jeykumar Sankaran Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/537916/ Link: https://lore.kernel.org/r/20230518222238.3815293-8-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit f68098003dc351c06e1aba1fbccddfbbf7fa2110 Author: Dmitry Baryshkov Date: Fri May 19 01:22:35 2023 +0300 drm/msm/dpu: simplify qos_ctrl handling After removal of DPU_PLANE_QOS_VBLANK_CTRL, several fields of struct dpu_hw_pipe_qos_cfg are fixed to false/0. Drop them from the structure (and drop the corresponding code from the functions). The DPU_PLANE_QOS_VBLANK_AMORTIZE flag is also removed, since it is now a NOP. Reviewed-by: Jeykumar Sankaran Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/537909/ Link: https://lore.kernel.org/r/20230518222238.3815293-7-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit d5f86e50f0319966503cbd54a2116d838d5984bc Author: Dmitry Baryshkov Date: Fri May 19 01:22:34 2023 +0300 drm/msm/dpu: drop DPU_PLANE_QOS_VBLANK_CTRL Drop support for DPU_PLANE_QOS_VBLANK_CTRL flag. It is not used both in upstream driver and in vendor SDE driver. Reviewed-by: Jeykumar Sankaran Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/537907/ Link: https://lore.kernel.org/r/20230518222238.3815293-6-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 78c2925de971095e45aad4359f040dbe547714bd Author: Dmitry Baryshkov Date: Fri May 19 01:22:33 2023 +0300 drm/msm/dpu: rearrange QoS setting code Slightly rearrainge code in dpu_plane_sspp_update_pipe() to group QoS/LUT related functions. Reviewed-by: Jeykumar Sankaran Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/537906/ Link: https://lore.kernel.org/r/20230518222238.3815293-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 2defa907ed5018fb7520bc9c3dc224961df5eda9 Author: Dmitry Baryshkov Date: Fri May 19 01:22:32 2023 +0300 drm/msm/dpu: fix the condition for (not) applying QoS to CURSOR SSPP The function dpu_plane_sspp_update_pipe() contains code to skip enabling the QoS and OT limitis for CURSOR pipes. However all DPU since sdm845 repurpose DMA SSPP for the cursor planes because they lack the real CURSOR SSPP. Fix the condition to actually check that the plane is CURSOR or not. Reviewed-by: Jeykumar Sankaran Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/537911/ Link: https://lore.kernel.org/r/20230518222238.3815293-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 48b3207e4ed9e5140c69e229b697373f233419c8 Author: Dmitry Baryshkov Date: Fri May 19 01:22:31 2023 +0300 drm/msm/dpu: simplify CDP programming Get rid of intermediatory configuration structure and defines. Pass the format and the enablement bit directly to the new helper. The WB_CDP_CNTL register ignores BIT(2), so we can write it for both SSPP and WB CDP settings. Reviewed-by: Jeykumar Sankaran Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/537910/ Link: https://lore.kernel.org/r/20230518222238.3815293-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 5f31d7e61ddf5ca8db06455b30d3b3e16d656944 Author: Dmitry Baryshkov Date: Fri May 19 01:22:30 2023 +0300 drm/msm/dpu: fix SSPP register definitions Reorder SSPP register definitions to sort them in the ascending order. Move register bitfields after the register definitions. Signed-off-by: Dmitry Baryshkov Reviewed-by: Jeykumar Sankaran Patchwork: https://patchwork.freedesktop.org/patch/537903/ Link: https://lore.kernel.org/r/20230518222238.3815293-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 2cb749466d179e3ccfe83eb8a52dc002d07b08af Author: Masahiro Yamada Date: Thu Jun 1 21:10:01 2023 +0900 modpost: detect section mismatch for R_ARM_REL32 For ARM, modpost fails to detect some types of section mismatches. [test code] .section .init.data,"aw" bar: .long 0 .section .data,"aw" .globl foo foo: .long bar - . It is apparently a bad reference, but modpost does not report anything. The test code above produces the following relocations. Relocation section '.rel.data' at offset 0xe8 contains 1 entry: Offset Info Type Sym.Value Sym. Name 00000000 00000403 R_ARM_REL32 00000000 .init.data Currently, R_ARM_REL32 is just skipped. Handle it like R_ARM_ABS32. Signed-off-by: Masahiro Yamada commit 3310bae805250aec227eb056e8e61a246678f28a Author: Masahiro Yamada Date: Thu Jun 1 21:10:00 2023 +0900 modpost: fix section_mismatch message for R_ARM_THM_{CALL,JUMP24,JUMP19} addend_arm_rel() processes R_ARM_THM_CALL, R_ARM_THM_JUMP24, R_ARM_THM_JUMP19 in a wrong way. Here, test code. [test code for R_ARM_THM_JUMP24]   .section .init.text,"ax"   bar:           bx      lr   .section .text,"ax"   .globl foo   foo:           b       bar [test code for R_ARM_THM_CALL]   .section .init.text,"ax"   bar:           bx      lr   .section .text,"ax"   .globl foo   foo:           push    {lr}           bl      bar           pop     {pc} If you compile it with CONFIG_THUMB2_KERNEL=y, modpost will show the symbol name, (unknown).   WARNING: modpost: vmlinux.o: section mismatch in reference: foo (section: .text) -> (unknown) (section: .init.text) (You need to use GNU linker instead of LLD to reproduce it.) Fix the code to make modpost show the correct symbol name. I checked arch/arm/kernel/module.c to learn the encoding of R_ARM_THM_CALL and R_ARM_THM_JUMP24. The module does not support R_ARM_THM_JUMP19, but I checked its encoding in ARM ARM. The '+4' is the compensation for pc-relative instruction. It is documented in "ELF for the Arm Architecture" [1].   "If the relocation is pc-relative then compensation for the PC bias   (the PC value is 8 bytes ahead of the executing instruction in Arm   state and 4 bytes in Thumb state) must be encoded in the relocation   by the object producer." [1]: https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst Fixes: c9698e5cd6ad ("ARM: 7964/1: Detect section mismatches in thumb relocations") Signed-off-by: Masahiro Yamada commit cd1824fb7a377882497e8b87a6f3a9ec19be3623 Author: Masahiro Yamada Date: Thu Jun 1 21:09:59 2023 +0900 modpost: detect section mismatch for R_ARM_THM_{MOVW_ABS_NC,MOVT_ABS} When CONFIG_THUMB2_KERNEL is enabled, modpost fails to detect some types of section mismatches. [test code] #include int __initdata foo; int get_foo(void) { return foo; } It is apparently a bad reference, but modpost does not report anything. The test code above produces the following relocations. Relocation section '.rel.text' at offset 0x1e8 contains 2 entries: Offset Info Type Sym.Value Sym. Name 00000000 0000052f R_ARM_THM_MOVW_AB 00000000 .LANCHOR0 00000004 00000530 R_ARM_THM_MOVT_AB 00000000 .LANCHOR0 Currently, R_ARM_THM_MOVW_ABS_NC and R_ARM_THM_MOVT_ABS are just skipped. Add code to handle them. I checked arch/arm/kernel/module.c to learn how the offset is encoded in the instruction. One more thing to note for Thumb instructions - the st_value is an odd value, so you need to mask the bit 0 to get the offset. Otherwise, you will get an off-by-one error in the nearest symbol look-up. It is documented in "ELF for the ARM Architecture" [1]: In addition to the normal rules for symbol values the following rules shall also apply to symbols of type STT_FUNC: * If the symbol addresses an Arm instruction, its value is the address of the instruction (in a relocatable object, the offset of the instruction from the start of the section containing it). * If the symbol addresses a Thumb instruction, its value is the address of the instruction with bit zero set (in a relocatable object, the section offset with bit zero set). * For the purposes of relocation the value used shall be the address of the instruction (st_value & ~1). [1]: https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst Signed-off-by: Masahiro Yamada commit 4ec7329517027db28c5683675ab3b3842ad60324 Author: Russell King (Oracle) Date: Thu Jun 1 16:48:12 2023 +0100 net: phylib: fix phy_read*_poll_timeout() Dan Carpenter reported a signedness bug in genphy_loopback(). Andrew reports that: "It is common to get this wrong in general with PHY drivers. Dan regularly posts fixes like this soon after a PHY driver patch it merged. I really wish we could somehow get the compiler to warn when the result from phy_read() is stored into a unsigned type. It would save Dan a lot of work." Let's make phy_read*_poll_timeout() immune to further issues when "val" is an unsigned type by storing the read function's result in a signed int as well as "val", and using the signed variable both to check for an error and for propagating that error to the caller. The advantage of this method is we don't change where the cast from the signed return code to the user's variable occurs - so users will see no change. Previously Heiner changed phy_read_poll_timeout() to check for an error before evaluating the user supplied condition, but didn't update phy_read_mmd_poll_timeout(). Make that change there too. Link: https://lore.kernel.org/r/d7bb312e-2428-45f6-b9b3-59ba544e8b94@kili.mountain Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1q4kX6-00BNuM-Mx@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 7fa217d4be0fd6f4f91e01ab7c4a7f225462e013 Merge: 3f06760c00f56 59d814f0f2851 Author: Jakub Kicinski Date: Fri Jun 2 22:10:48 2023 -0700 Merge branch 'tools-ynl-gen-dust-off-the-user-space-code' Jakub Kicinski says: ==================== tools: ynl-gen: dust off the user space code Every now and then I wish I finished the user space part of the netlink specs, Python scripts kind of stole the show but C is useful for selftests and stuff which needs to be fast. Recently someone asked me how to access devlink and ethtool from C++ which pushed me over the edge. Fix things which bit rotted and finish notification handling. This series contains code gen changes only. I'll follow up with the fixed component, samples and docs as soon as it's merged. ==================== Link: https://lore.kernel.org/r/20230602023548.463441-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 59d814f0f28513ae632739634e3b869098beb093 Author: Jakub Kicinski Date: Thu Jun 1 19:35:48 2023 -0700 tools: ynl-gen: generate static descriptions of notifications Notifications may come in at any time. The family must be always ready to parse a random incoming notification. Generate notification table for parsing and tell YNL which request we're processing to distinguish responses from notifications. Signed-off-by: Jakub Kicinski commit 8cb6afb3354172360881d6a644967c35f767ca2b Author: Jakub Kicinski Date: Thu Jun 1 19:35:47 2023 -0700 tools: ynl-gen: switch to family struct We'll want to store static info about the family soon. Generate a struct. This changes creation from, e.g.: ys = ynl_sock_create("netdev", &yerr); to: ys = ynl_sock_create(&ynl_netdev_family, &yerr); on user's side. Signed-off-by: Jakub Kicinski commit 5d58f911c75544eeb213e75a69912f330ad9f052 Author: Jakub Kicinski Date: Thu Jun 1 19:35:46 2023 -0700 tools: ynl-gen: generate alloc and free helpers for req We expect user to allocate requests with calloc(), make things a bit more consistent and provide helpers. Generate free calls, too. Signed-off-by: Jakub Kicinski commit dc0956c98f110ef0ff9c9c9cf150b8410a2a4200 Author: Jakub Kicinski Date: Thu Jun 1 19:35:45 2023 -0700 tools: ynl-gen: move the response reading logic into YNL We generate send() and recv() calls and all msg handling for each operation. It's a lot of repeated code and will only grow with notification handling. Call back to a helper YNL lib instead. Signed-off-by: Jakub Kicinski commit 21b6e302789c412bdde84439b9325c76e2a5c428 Author: Jakub Kicinski Date: Thu Jun 1 19:35:44 2023 -0700 tools: ynl-gen: generate enum-to-string helpers It's sometimes useful to print the name of an enum value, flag or name of the op. Python can do it, add C helper code gen for getting names of things. Example: static const char * const netdev_xdp_act_strmap[] = { [0] = "basic", [1] = "redirect", [2] = "ndo-xmit", [3] = "xsk-zerocopy", [4] = "hw-offload", [5] = "rx-sg", [6] = "ndo-xmit-sg", }; const char *netdev_xdp_act_str(enum netdev_xdp_act value) { value = ffs(value) - 1; if (value < 0 || value >= (int)MNL_ARRAY_SIZE(netdev_xdp_act_strmap)) return NULL; return netdev_xdp_act_strmap[value]; } Signed-off-by: Jakub Kicinski commit eef9b794eac87022464c28a3763f9030e1d53f80 Author: Jakub Kicinski Date: Thu Jun 1 19:35:43 2023 -0700 tools: ynl-gen: add error checking for nested structs Parsing nested types may return an error, propagate it. Not marking as a fix, because nothing uses YNL upstream. Signed-off-by: Jakub Kicinski commit 5605f102378f59f4e87f33685bb273602622c643 Author: Jakub Kicinski Date: Thu Jun 1 19:35:42 2023 -0700 tools: ynl-gen: loosen type consistency check for events Both event and notify types are always consistent. Rewrite the condition checking if we can reuse reply types to be less picky and let notify thru. Signed-off-by: Jakub Kicinski commit 67c65ce762adaf3515fe058538c0a7065dc9f2b4 Author: Jakub Kicinski Date: Thu Jun 1 19:35:41 2023 -0700 tools: ynl-gen: don't override pure nested struct For pure structs (parsed nested attributes) we track what forms of the struct exist in request and reply directions. Make sure we don't overwrite the recorded struct each time, otherwise the information is lost. Signed-off-by: Jakub Kicinski commit 6ad49839ba9b44cf957555f2b0b4f8bc076db48f Author: Jakub Kicinski Date: Thu Jun 1 19:35:40 2023 -0700 tools: ynl-gen: fix unused / pad attribute handling Unused and Pad attributes don't carry information. Unused should never exist, and be rejected. Pad should be silently skipped. Signed-off-by: Jakub Kicinski commit 91dfaef243cdabbda8af95643bba82b778a4d0dc Author: Jakub Kicinski Date: Thu Jun 1 19:35:39 2023 -0700 tools: ynl-gen: add extra headers for user space Make sure all relevant headers are included, we allocate memory, use memcpy() and Linux types without including the headers. Signed-off-by: Jakub Kicinski commit eba57fb5498f2858768321e64570caea188455b8 Author: Dmitry Osipenko Date: Sun Apr 16 14:52:36 2023 +0300 drm/virtio: Wait for each dma-fence of in-fence array individually Use dma-fence-unwrap API for waiting each dma-fence of the in-fence array individually. Sync file's in-fence array always has a non-matching fence context ID, which doesn't allow to skip waiting of fences with a matching context ID in a case of a merged sync file fence. Suggested-by: Rob Clark Reviewed-by: Emil Velikov Tested-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20230416115237.798604-3-dmitry.osipenko@collabora.com commit e4812ab8e6b142e1ce19b50fcf744e20ea9adfe3 Author: Dmitry Osipenko Date: Sun Apr 16 14:52:35 2023 +0300 drm/virtio: Refactor and optimize job submission code path Move virtio_gpu_execbuffer_ioctl() into separate virtgpu_submit.c file, refactoring and optimizing the code along the way to ease addition of new features to the ioctl. The optimization is done by using optimal ordering of the job's submission steps, reducing code path from the start of the ioctl to the point of pushing job to virtio queue. Job's initialization is now performed before in-fence is awaited and out-fence setup is made after sending out job to virtio. Reviewed-by: Rob Clark Reviewed-by: Emil Velikov Tested-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20230416115237.798604-2-dmitry.osipenko@collabora.com commit 791a089861fced01dc6d8a67507d711839659fb8 Author: Sean Christopherson Date: Thu Jun 1 18:19:20 2023 -0700 KVM: SVM: Invoke trace_kvm_exit() for fastpath VM-Exits Move SVM's call to trace_kvm_exit() from the "slow" VM-Exit handler to svm_vcpu_run() so that KVM traces fastpath VM-Exits that re-enter the guest without bouncing through the slow path. This bug is benign in the current code base as KVM doesn't currently support any such exits on SVM. Fixes: a9ab13ff6e84 ("KVM: X86: Improve latency for single target IPI fastpath") Link: https://lore.kernel.org/r/20230602011920.787844-3-seanjc@google.com Signed-off-by: Sean Christopherson commit 5a3c46b809d09f8ef59e2fbf2463b1c102aecbaa Author: Chaitanya Kumar Borah Date: Mon May 29 11:37:47 2023 +0530 drm/i915/display: Set correct voltage level for 480MHz CDCLK According to Bspec, the voltage level for 480MHz is to be set as 1 instead of 2. BSpec: 49208 Fixes: 06f1b06dc5b7 ("drm/i915/display: Add 480 MHz CDCLK steps for RPL-U") v2: rebase Signed-off-by: Chaitanya Kumar Borah Reviewed-by: Mika Kahola Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230529060747.3972259-1-chaitanya.kumar.borah@intel.com commit 0fcf8ffdfe9013b05807b99a4c28da59b2d39bec Author: Jeffrey Hugo Date: Tue May 23 10:14:21 2023 -0600 MAINTAINERS: Add Carl/Pranjal as QAIC reviewers Carl and Pranjal have been reviewing the QAIC patches. List them as reviewers so that they are copied on all developments which will make it easier for them to continue reviewing QAIC patches. Signed-off-by: Jeffrey Hugo Acked-by: Carl Vanderlip Acked-by: Pranjal Ramajor Asha Kanojiya Link: https://patchwork.freedesktop.org/patch/msgid/20230523161421.11017-1-quic_jhugo@quicinc.com commit ec4a491d180b076191e72ef88c240caead1b20fc Author: Paul Moore Date: Thu Jun 1 17:04:02 2023 -0400 selinux: fix Makefile for versions of make < v4.3 As noted in the comments of this commit, the current SELinux Makefile requires features found in make v4.3 or later, which is problematic as the Linux Kernel currently only requires make v3.82. This patch fixes the SELinux Makefile so that it works properly on these older versions of make, and adds a couple of comments to the Makefile about how it can be improved once make v4.3 is required by the kernel. Fixes: 6f933aa7dfd0 ("selinux: more Makefile tweaks") Signed-off-by: Paul Moore commit ff9a6459bbec06df7da2545020d7383aba13b3fb Author: Josh Poimboeuf Date: Fri Jun 2 10:54:53 2023 -0700 objtool: Add __kunit_abort() to noreturns Fixes a bunch of warnings like: drivers/input/tests/input_test.o: warning: objtool: input_test_init+0x1cb: stack state mismatch: cfa1=4+64 cfa2=4+56 lib/kunit/kunit-test.o: warning: objtool: kunit_log_newline_test+0xfb: return with modified stack frame ... Fixes: 260755184cbd ("kunit: Move kunit_abort() call out of kunit_do_failed_assertion()") Reported-by: Stephen Rothwell Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230602175453.swsn3ehyochtwkhy@treble commit e2a82bf8a428165a803c037228bdaa67cbe4764c Author: Shay Drory Date: Mon Feb 6 13:50:13 2023 +0200 net/mlx5: Devcom, extend mlx5_devcom_send_event to work with more than two devices mlx5_devcom_send_event is used to send event from one eswitch to the other. In other words, only one event is sent, which means, no error mechanism is needed. However, In case devcom have more than two eswitches, a proper error mechanism is needed. Hence, in case of error, devcom will perform the error unwind, since devcom knows how many events were successful. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 90ca127c62e9963e8efd032409f4f4e70308de37 Author: Saeed Mahameed Date: Fri Jun 2 11:51:22 2023 -0700 net/mlx5: Devcom, introduce devcom_for_each_peer_entry Introduce generic APIs which will retrieve all peers. This API replace mlx5_devcom_get/release_peer_data which retrieve only a single peer. Signed-off-by: Mark Bloch Signed-off-by: Shay Drory Reviewed-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 8611df722030171e31535da569d3da488d2cd3b6 Author: Shay Drory Date: Thu Feb 2 10:27:45 2023 +0200 net/mlx5: E-switch, mark devcom as not ready when all eswitches are unpaired Whenever an eswitch is unpaired with another, the driver mark devcom as not ready. While this is correct in case we are pairing only two eswitches, in order to support pairing of more than two eswitches, driver need to mark devcom as not ready only when all eswitches are unpaired. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit e67f928a5204cc577ad35dc8c3ebe60ef64bade8 Author: Shay Drory Date: Tue Feb 7 16:08:33 2023 +0200 net/mlx5: Devcom, Rename paired to ready In downstream patch devcom will provide support for more than two devices. The term 'paired' will be renamed as 'ready' to convey a more accurate meaning. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 6d5b7321d8af0d4f5ec81d8e739c7ed2a93cf12a Author: Shay Drory Date: Tue Feb 21 10:17:06 2023 +0200 net/mlx5: DR, handle more than one peer domain Currently, DR domain is using the assumption that each domain can only have a single peer. In order to support VF LAG of more then two ports, expand peer domain to use an array of peers, and align the code accordingly. Signed-off-by: Shay Drory Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit 014e4d48eaa36f1678642f9d9125ac5b4526bd3e Author: Shay Drory Date: Thu Feb 2 10:27:45 2023 +0200 net/mlx5: E-switch, generalize shared FDB creation Shared FDB creation is hard coded for only two eswitches. Generalize shared FDB creation so that any number of eswitches could create shared FDB. Signed-off-by: Shay Drory Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 5e0202eb49ed02b9b9ec423684dd840e0edd8695 Author: Shay Drory Date: Wed Feb 22 11:54:19 2023 +0200 net/mlx5: E-switch, Handle multiple master egress rules Currently, whenever a shared FDB is created, the slave eswitch is creating master egress rule to the master eswitch. In order to support more than two ports, which means there will be more than one slave eswitch, enlarge bounce_rule, which is used to create master egress rule, to an xarray. Signed-off-by: Shay Drory Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 9bee385a6e3981d22d75873a059aa94d276ede32 Author: Shay Drory Date: Sun Feb 5 17:18:19 2023 +0200 net/mlx5: E-switch, refactor FDB miss rule add/remove Currently, E-switch FDB have a single peer miss rule. In order to support more than one peer, refactor E-switch FDB to have peer miss rule per peer, and change the code to add/remove a rule from specific peer. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 18e31d42267556fd98590d91dda161f2a39a1def Author: Shay Drory Date: Sun Feb 5 14:44:40 2023 +0200 net/mlx5: E-switch, enlarge peer miss group table There is an implicit assumption that peer miss group table require to handle only a single peer. Also, there is an assumption that total_vports of the master is greater or equal to the total_vports of each peer. Change the code to support peer miss group for more than one peer. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 9be6c21fdcf8a7ec48262bb76f78c17ac2761ac6 Author: Shay Drory Date: Mon Feb 6 10:12:34 2023 +0200 net/mlx5e: Handle offloads flows per peer Currently, E-switch offloads table have a list of all flows that create a peer_flow over the peer eswitch. In order to support more than one peer, extend E-switch offloads table peer_flow to hold an array of lists, where each peer have dedicate index via mlx5_get_dev_index(). Thereafter, extend original flow to hold an array of peers as well. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 0af3613ddc915d136e9c56f645f80c4b1cb828ff Author: Mark Bloch Date: Wed Mar 30 08:51:16 2022 +0000 net/mlx5e: en_tc, re-factor query route port query for peer esw outside of if scope. This is preparation for query route port over multiple peers. Signed-off-by: Mark Bloch Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit ed7a8fe71836fda7d669d4a3afbd5f4dba742c18 Author: Mark Bloch Date: Wed Mar 30 07:16:23 2022 +0000 net/mlx5e: rep, store send to vport rules per peer Each representor, for each send queue, is holding a send_to_vport rule for the peer eswitch. In order to support more than one peer, and to map between the peer rules and peer eswitches, refactor representor to hold both the peer rules and pointer to the peer eswitches. This enables mlx5 to store send_to_vport rules per peer, where each peer have dedicate index via mlx5_get_dev_index(). Signed-off-by: Mark Bloch Signed-off-by: Shay Drory Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit b1661efa4dbbd7d4055543f036cae6c28257d292 Author: Shay Drory Date: Tue Mar 29 14:47:20 2022 +0000 net/mlx5e: tc, Refactor peer add/del flow Move peer_eswitch outside mlx5e_tc_add_fdb_peer_flow() so downstream patch can call mlx5e_tc_add_fdb_peer_flow() with multiple peers. Move peer_eswitch in the remove flow as well in order to keep symmetry. Signed-off-by: Mark Bloch Signed-off-by: Shay Drory Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 953bb24ddc118a5a3021a90a8cab8eae946238e7 Author: Mark Bloch Date: Tue Mar 29 14:35:22 2022 +0000 net/mlx5e: en_tc, Extend peer flows to a list Currently, mlx5e_flow is holding a pointer to a peer_flow, in case one was created. e.g. There is an assumption that mlx5e_flow can have only one peer. In order to support more than one peer, refactor mlx5e_flow to hold a list of peer flows. Signed-off-by: Mark Bloch Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 8098a931c080d32687aee72a1dfac98507a6034b Author: Mårten Lindahl Date: Fri Jun 2 20:12:54 2023 +0200 spi: spl022: Probe defer is no error When the spi controller is registered and the cs_gpiods cannot be assigned, causing a defer of the probe, there is an error print saying: "probe - problem registering spi master" This should not be announced as an error. Print this message for all errors except for the probe defer. Signed-off-by: Mårten Lindahl Link: https://lore.kernel.org/r/20230602-pl022-defer-fix-v2-1-383f6bc2293a@axis.com Signed-off-by: Mark Brown commit f917130f19fe62c6688cc95ebebfafee3e005958 Author: Maarten Lankhorst Date: Thu Dec 22 21:18:04 2022 +0100 drm/i915: Flush power delayed put when connector init failed When intel_dp_init_connector fails, some power wells used in dp aux communication may not be completely disabled yet. This may result in a null pointer dereference when icl_aux_pw_to_phy() is called from icl_combo_phy_aux_power_well_disable() after the encoder and connector are already freed. Signed-off-by: Maarten Lankhorst Cc: Imre Deak Cc: Jani Nikula Acked-by: Imre Deak Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20221222201804.1380963-1-maarten.lankhorst@linux.intel.com commit 0633dc4a542344fd40f432c63d9ac4940a370ea9 Author: Andy Shevchenko Date: Fri Jun 2 19:46:55 2023 +0300 pinctrl: cherryview: Don't use IRQ core constanst for invalid IRQ The semantics of INVALID_HWIRQ is rather localized to IPI usage. Let's keep it that way. Signed-off-by: Andy Shevchenko commit 9d71208632ec61e4bf0a0ba3008326f7936918eb Author: Andy Shevchenko Date: Fri Jun 2 19:56:15 2023 +0300 pinctrl: baytrail: Use BIT() in BYT_PULL_ASSIGN_* definitions The bias setting (pull-up or pull-down) are bit fields and we never enable them both, hence use BIT() macro to define them. Signed-off-by: Andy Shevchenko commit b9e1843447bb54ef5125e606fd720c43a3c29da2 Author: Andy Shevchenko Date: Fri Jun 2 20:30:17 2023 +0300 pinctrl: baytrail: Unify style of error and debug messages Use same formatting strings where it makes sense, so linker will utilize only a single copy of it, otherwise make the style similar to the rest of the messages of the close enough semantics. add/remove: 1/0 grow/shrink: 2/2 up/down: 91/-110 (-19) Total: Before=17562, After=17543, chg -0.11% Signed-off-by: Andy Shevchenko commit c7b5abd3e030718b6666cdf766f8905b006a9b1b Author: Maarten Lankhorst Date: Mon May 29 13:59:00 2023 +0300 drm/i915: Remove i915_drm_suspend_mode enum i915_drm_suspend_mode suspend_mode is only used in intel_display_power, while we only care about whether we perform a s2idle. Remove it and use a simple bool. v2: Rebase Signed-off-by: Maarten Lankhorst Reviewed-by: Rodrigo Vivi # v1 Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230529105900.1942814-1-jani.nikula@intel.com commit c3a1e119a343a70a9f49689b8f18bb43f236d681 Author: Sean Christopherson Date: Wed Apr 5 16:45:56 2023 -0700 KVM: VMX: Inject #GP, not #UD, if SGX2 ENCLS leafs are unsupported Per Intel's SDM, unsupported ENCLS leafs result in a #GP, not a #UD. SGX1 is a special snowflake as the SGX1 flag is used by the CPU as a "soft" disable, e.g. if software disables machine check reporting, i.e. having SGX but not SGX1 is effectively "SGX completely unsupported" and and thus #UDs. Fixes: 9798adbc04cf ("KVM: VMX: Frame in ENCLS handler for SGX virtualization") Cc: Binbin Wu Cc: Kai Huang Tested-by: Kai Huang Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230405234556.696927-3-seanjc@google.com Signed-off-by: Sean Christopherson commit 5e50082c8c21cd32ef21f523c149939668954ab6 Author: Sean Christopherson Date: Wed Apr 5 16:45:55 2023 -0700 KVM: VMX: Inject #GP on ENCLS if vCPU has paging disabled (CR0.PG==0) Inject a #GP when emulating/forwarding a valid ENCLS leaf if the vCPU has paging disabled, e.g. if KVM is intercepting ECREATE to enforce additional restrictions. The pseudocode in the SDM lists all #GP triggers, including CR0.PG=0, as being checked after the ENLCS-exiting checks, i.e. the VM-Exit will occur before the CPU performs the CR0.PG check. Fixes: 70210c044b4e ("KVM: VMX: Add SGX ENCLS[ECREATE] handler to enforce CPUID restrictions") Cc: Binbin Wu Cc: Kai Huang Tested-by: Kai Huang Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230405234556.696927-2-seanjc@google.com Signed-off-by: Sean Christopherson commit e788ff7ee3b4b7b8ae534e605154f50dc4443a40 Author: Sui Jingfeng Date: Mon May 29 19:29:56 2023 +0800 drm/i915_drm.h: fix a typo 'rbiter' -> 'arbiter' Signed-off-by: Sui Jingfeng Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230529112956.2083389-1-suijingfeng@loongson.cn commit cf5dec80c4e23ac1677b8ef9aafe5a7b87bb18c3 Author: Alexander Stein Date: Thu Apr 6 11:33:43 2023 +0200 gpio: Add gpio delay driver This driver implements a GPIO enable/disable delay. It supports a list of GPIO outputs, which ramp-up/ramp-down delay can be specified at consumer location. The main purpose is to address external, passive delays upon line voltage changes. Signed-off-by: Alexander Stein Acked-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit c7239a3da16287670453a62f1a8c36778d316902 Author: Alexander Stein Date: Thu Apr 6 11:33:42 2023 +0200 dt-bindings: gpio: Add gpio-delay binding document This adds bindings for a GPIO enable/disable delay driver. Signed-off-by: Alexander Stein Acked-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit fa1fccfb47a7f3d0fd32dbb0df050b01487ae754 Author: Maxime Ripard Date: Wed May 31 15:37:24 2023 +0200 mailmap: Add missing email address I've been using that email address for contributions for a while but it seems I never added it to mailmap. Signed-off-by: Maxime Ripard Reviewed-by: Sui Jingfeng Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230531133724.133872-1-maxime@cerno.tech commit 5c315434fdb6ab43566e6e0f6b9528bb0ad0aca9 Author: Nathan Chancellor Date: Tue May 30 11:37:56 2023 -0700 drm/i915/pxp: Fix size_t format specifier in gsccs_send_message() When building ARCH=i386 allmodconfig, the following warning occurs: In file included from include/linux/device.h:15, from include/linux/node.h:18, from include/linux/cpu.h:17, from include/linux/static_call.h:135, from arch/x86/include/asm/perf_event.h:5, from include/linux/perf_event.h:25, from drivers/gpu/drm/i915/i915_pmu.h:11, from drivers/gpu/drm/i915/gt/intel_engine_types.h:21, from drivers/gpu/drm/i915/gt/intel_context_types.h:18, from drivers/gpu/drm/i915/gem/i915_gem_context_types.h:20, from drivers/gpu/drm/i915/i915_request.h:34, from drivers/gpu/drm/i915/i915_active.h:13, from drivers/gpu/drm/i915/gt/intel_context.h:13, from drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:8: drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c: In function 'gsccs_send_message': include/drm/drm_print.h:456:39: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=] 456 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__) | ^~~~~~~~ include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap' 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ | ^~~ include/linux/dev_printk.h:146:61: note: in expansion of macro 'dev_fmt' 146 | dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__) | ^~~~~~~ include/drm/drm_print.h:456:9: note: in expansion of macro 'dev_warn' 456 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__) | ^~~~ include/drm/drm_print.h:466:9: note: in expansion of macro '__drm_printk' 466 | __drm_printk((drm), warn,, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~ drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:146:17: note: in expansion of macro 'drm_warn' 146 | drm_warn(&i915->drm, "caller with insufficient PXP reply size %u (%ld)\n", | ^~~~~~~~ cc1: all warnings being treated as errors Use the '%zu' format specifier, as the variable is a 'size_t'. Fixes: dc9ac125d81f ("drm/i915/pxp: Add GSC-CS backend to send GSC fw messages") Signed-off-by: Nathan Chancellor Reviewed-by: Andi Shyti Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230530-i915-pxp-size_t-wformat-v1-1-9631081e2e5b@kernel.org commit c92fcfc2bab54451c4f1481755ea244f413455cb Author: Jens Axboe Date: Fri Jun 2 08:41:46 2023 -0600 io_uring: avoid indirect function calls for the hottest task_work We use task_work for a variety of reasons, but doing completions or triggering rety after poll are by far the hottest two. Use the indirect funtion call wrappers to avoid the indirect function call if CONFIG_RETPOLINE is set. Signed-off-by: Jens Axboe commit 664dba662cb313da9cbb1c944c472638a65c552e Author: Arnd Bergmann Date: Fri Jun 2 14:45:24 2023 +0200 drm/meson: venc: include linux/bitfield.h Without this header, the use of FIELD_PREP() can cause a build failure: drivers/gpu/drm/meson/meson_venc.c: In function 'meson_encl_set_gamma_table': drivers/gpu/drm/meson/meson_venc.c:1595:24: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration] Fixes: 51fc01a03442c ("drm/meson: venc: add ENCL encoder setup for MIPI-DSI output") Signed-off-by: Arnd Bergmann Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230602124539.894888-1-arnd@kernel.org commit e96f099c8544a542f7cd37d2e51ba52786adbbc7 Author: Yang Li Date: Fri Jun 2 17:14:16 2023 +0800 drm/meson: Remove unneeded semicolon ./drivers/gpu/drm/meson/meson_dw_mipi_dsi.c:117:2-3: Unneeded semicolon ./drivers/gpu/drm/meson/meson_dw_mipi_dsi.c:231:2-3: Unneeded semicolon Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5392 Signed-off-by: Yang Li Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230602091416.107850-1-yang.lee@linux.alibaba.com commit b1a9651d48b42f3eddf095123c09f93e4df23060 Author: Masahiro Yamada Date: Thu Jun 1 21:09:58 2023 +0900 modpost: refactor find_fromsym() and find_tosym() find_fromsym() and find_tosym() are similar - both of them iterate in the .symtab section and return the nearest symbol. The difference between them is that find_tosym() allows a negative distance, but the distance must be less than 20. Factor out the common part into find_nearest_sym(). Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 28eceeda130f5058074dd007d9c59d2e8bc5af2e Author: Jan Kara Date: Thu Jun 1 12:58:25 2023 +0200 fs: Lock moved directories When a directory is moved to a different directory, some filesystems (udf, ext4, ocfs2, f2fs, and likely gfs2, reiserfs, and others) need to update their pointer to the parent and this must not race with other operations on the directory. Lock the directories when they are moved. Although not all filesystems need this locking, we perform it in vfs_rename() because getting the lock ordering right is really difficult and we don't want to expose these locking details to filesystems. CC: stable@vger.kernel.org Signed-off-by: Jan Kara Message-Id: <20230601105830.13168-5-jack@suse.cz> Signed-off-by: Christian Brauner commit f23ce757185319886ca80c4864ce5f81ac6cc9e9 Author: Jan Kara Date: Thu Jun 1 12:58:24 2023 +0200 fs: Establish locking order for unrelated directories Currently the locking order of inode locks for directories that are not in ancestor relationship is not defined because all operations that needed to lock two directories like this were serialized by sb->s_vfs_rename_mutex. However some filesystems need to lock two subdirectories for RENAME_EXCHANGE operations and for this we need the locking order established even for two tree-unrelated directories. Provide a helper function lock_two_inodes() that establishes lock ordering for any two inodes and use it in lock_two_directories(). CC: stable@vger.kernel.org Signed-off-by: Jan Kara Message-Id: <20230601105830.13168-4-jack@suse.cz> Signed-off-by: Christian Brauner commit cde3c9d7e2a359e337216855dcb333a19daaa436 Author: Jan Kara Date: Thu Jun 1 12:58:23 2023 +0200 Revert "f2fs: fix potential corruption when moving a directory" This reverts commit d94772154e524b329a168678836745d2773a6e02. The locking is going to be provided by VFS. CC: Jaegeuk Kim CC: stable@vger.kernel.org Signed-off-by: Jan Kara Message-Id: <20230601105830.13168-3-jack@suse.cz> Signed-off-by: Christian Brauner commit 7517ce5dc4d6963ef9ace2acb3f081ef8cd8a1e3 Author: Jan Kara Date: Thu Jun 1 12:58:22 2023 +0200 Revert "udf: Protect rename against modification of moved directory" This reverts commit f950fd0529130a617b3da526da9fb6a896ce87c2. The locking is going to be provided by vfs_rename() in the following patches. CC: stable@vger.kernel.org Signed-off-by: Jan Kara Message-Id: <20230601105830.13168-2-jack@suse.cz> Signed-off-by: Christian Brauner commit 3658840cd363f2be094f5dfd2f0b174a9055dd0f Author: Jan Kara Date: Thu Jun 1 12:58:21 2023 +0200 ext4: Remove ext4 locking of moved directory Remove locking of moved directory in ext4_rename2(). We will take care of it in VFS instead. This effectively reverts commit 0813299c586b ("ext4: Fix possible corruption when moving a directory") and followup fixes. CC: Ted Tso CC: stable@vger.kernel.org Signed-off-by: Jan Kara Message-Id: <20230601105830.13168-1-jack@suse.cz> Signed-off-by: Christian Brauner commit 812a05256d673b2b9c5db906775d1e6625ba4787 Author: Arnd Bergmann Date: Fri Jun 2 14:44:39 2023 +0200 ASoC: amd: vangogh: select CONFIG_SND_AMD_ACP_CONFIG The vangogh driver just gained a link time dependency that now causes randconfig builds to fail: x86_64-linux-ld: sound/soc/amd/vangogh/pci-acp5x.o: in function `snd_acp5x_probe': pci-acp5x.c:(.text+0xbb): undefined reference to `snd_amd_acp_find_config' Fixes: e89f45edb747e ("ASoC: amd: vangogh: Add check for acp config flags in vangogh platform") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230602124447.863476-1-arnd@kernel.org Signed-off-by: Mark Brown commit 9e72869d0fe12aba8cd489e485d93912b3f5c248 Author: Shengyu Qu Date: Wed May 24 01:00:12 2023 +0100 regulator: axp20x: Add AXP15060 support The AXP15060 is a typical I2C-controlled PMIC, seen on multiple boards with different default register value. Current driver is tested on Starfive Visionfive 2. The RTCLDO is fixed, and cannot even be turned on or off. On top of that, its voltage is customisable (either 1.8V or 3.3V). We pretend it's a fixed 1.8V regulator since other AXP driver also do like this. Also, BSP code ignores this regulator and it's not used according to VF2 schematic. Describe the AXP15060's voltage settings and switch registers, how the voltages are encoded, and connect this to the MFD device via its regulator ID. Signed-off-by: Shengyu Qu Signed-off-by: Andre Przywara Reviewed-by: Mark Brown Tested-by: Shengyu Qu Link: https://lore.kernel.org/r/20230524000012.15028-4-andre.przywara@arm.com Signed-off-by: Mark Brown commit 60fd7eb89670d2636ac3156881acbd103c6eba6a Author: Martin Botka Date: Wed May 24 01:00:11 2023 +0100 regulator: axp20x: Add support for AXP313a variant The AXP313a is your typical I2C controlled PMIC, although in a lighter fashion compared to the other X-Powers PMICs: it has only three DCDC rails, three LDOs, and no battery charging support. The AXP313a datasheet does not describe a register to change the DCDC switching frequency, and talks of it being fixed at 3 MHz. Check that the property allowing to change that frequency is absent from the DT, and bail out otherwise. The third LDO, RTCLDO, is fixed, and cannot even be turned on or off, programmatically. On top of that, its voltage is customisable (either 1.8V or 3.3V), which we cannot describe easily using the existing regulator wrapper functions. This should be fixed properly, using regulator-{min,max}-microvolt in the DT, but this requires more changes to the code. As some other PMICs (AXP2xx, AXP803) seem to paper over the same problem as well, we follow suit here and pretend it's a fixed 1.8V regulator. A proper fix can follow later. The BSP code seems to ignore this regulator altogether. Describe the AXP313A's voltage settings and switch registers, how the voltages are encoded, and connect this to the MFD device via its regulator ID. Signed-off-by: Martin Botka Signed-off-by: Andre Przywara Reviewed-by: Chen-Yu Tsai Reviewed-by: Mark Brown Tested-by: Shengyu Qu Link: https://lore.kernel.org/r/20230524000012.15028-3-andre.przywara@arm.com Signed-off-by: Mark Brown commit ee02b869dcad7ba3772b58e93dd90ab4f932fac5 Author: Trevor Wu Date: Fri May 26 17:31:50 2023 +0800 ASoC: dt-bindings: mediatek,mt8188-mt6359: add NAU8825 support Add compatible string "mediatek,mt8188-nau8825" to support new board with nau8825 codec. Introduce two properties "dai-format" and "mediatek,clk-provider" under dai-link subnode to configure dai-link parameters via dts. "codec" property is removed from required property of dai-link subnode. For co-clock case, it's possible two dai-links should be configured to the same dai format, but only one cpu dai is bound with codec. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20230526093150.22923-8-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 9f08dcbddeb307793bbfff036db213d2cdf03a50 Author: Trevor Wu Date: Fri May 26 17:31:49 2023 +0800 ASoC: mediatek: mt8188-mt6359: support new board with nau88255 This patch adds multiple i2s codecs support including NAU88L25, MAX98390, and the dumb amp like NAU8318 usage. In addition, dmic-codec is also added to skip the beginning pop noise. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20230526093150.22923-7-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 8ad13cdc92f66333ae475251ae7722313f84e496 Author: Trevor Wu Date: Fri May 26 17:31:48 2023 +0800 ASoC: soc-dapm.c: clean up debugfs for freed widget When a widget is added to dapm via snd_soc_dapm_new_widgets, dapm_debugfs_add_widget is also called to create a corresponding debugfs file. However, when a widget is freed by snd_soc_dapm_free_widget, the corresponding debugfs is not cleared. As a result, the freed widget is still seen in the dapm directory. This patch adds dapm_debugfs_free_widget to free the debugfs of a specified widget, and it's called at snd_soc_dapm_free_widget to clean up the debugfs for freed widget. Signed-off-by: Trevor Wu Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230526093150.22923-6-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit c0e7390e6d3f42b9a15a0e72add21facb8e17790 Author: Trevor Wu Date: Fri May 26 17:31:47 2023 +0800 ASoC: mediatek: common: soundcard driver add dai_fmt support There are two changes included in the patch. First, add set_dailink_daifmt() function, so dai_fmt can be updated by the configuration in dai-link sub node. Second, remove codec phandle from required property in dai-link sub node. For example, user possibly needs to update dai-format for all etdm co-clock dai-links, but codec doesn't need to be specified in capture dai-link for a speaker amp. Signed-off-by: Trevor Wu Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230526093150.22923-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 73cf2b3f2b45fa4c231e8e84ae5d8cc80947d799 Author: Trevor Wu Date: Fri May 26 17:31:46 2023 +0800 ASoC: mediatek: mt8188-mt6359: register hdmi/dp jack pins Some userspace applications need jack control events, so register hdmi and dp jack pins to activate jack control events. Signed-off-by: Trevor Wu Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230526093150.22923-4-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 9fba0d3ec0a074d1a7c094b2cb722f135215fab0 Author: Trevor Wu Date: Fri May 26 17:31:45 2023 +0800 ASoC: dt-bindings: mediatek,mt8188-mt6359: remove ADDA_BE from link-name ADDA_BE is used to connect to mt6359. For machine mt8188-mt6359, codec for ADDA_BE must be mt6359 which are configured on the machine driver. Besides, ADDA_BE is divided into two dais, UL_SRC_BE and DL_SRC_BE. As a result, remove ADDA_BE from items of link-name. Signed-off-by: Trevor Wu Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230526093150.22923-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 2a7a1ae95c84d4199736872bfbc39d01f4b6b0ab Author: Trevor Wu Date: Fri May 26 17:31:44 2023 +0800 ASoC: mediatek: mt8188: separate ADDA playback dai from capture dai MT8188 will support SOF. In SOF, be_hw_params_fixup callback are used to configure BE hardware parameters. However, playback and capture stream share the same callback function in which it can't know the stream type. It's possible to require different parameters for playback and capture stream, so separate them into two dais for SOF usage. Signed-off-by: Trevor Wu Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230526093150.22923-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit a34e0353a681bbdd0402825e25410c3236109f31 Author: Rasmus Villemoes Date: Fri Jun 2 13:57:30 2023 +0200 spi: spi-imx: fix mixing of native and gpio chipselects for imx51/imx53/imx6 variants Commit 87c614175bbf (spi: spi-imx: fix MX51_ECSPI_* macros when cs > 3) ensured that the argument passed to the macros was masked with &3, so that we no longer write outside the intended fields in the various control registers. When all chip selects are gpios, this works just fine. However, when a mix of native and gpio chip selects are in use, that masking is too naive. Say, for example, that SS0 is muxed as native chip select, and there is also a chip at 4 (obviously with a gpio cs). In that case, when accessing the latter chip, both the SS0 pin and the gpio pin will be asserted low. The fix for this is to use the ->unused_native_cs value as channel number for any spi device which uses a gpio as chip select. Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20230602115731.708883-1-linux@rasmusvillemoes.dk Signed-off-by: Mark Brown commit 9da2bf3bcd8bbc0b700b44886a8e2a0036216748 Author: Alain Volmat Date: Thu Jun 1 08:52:21 2023 +0200 ARM: dts: stm32: add required supplies of ov5640 in stm32mp157c-ev1 Correct the following warnings by adding the required supplies (AVDD, DVDD) for the ov5640 node. arch/arm/boot/dts/stm32mp157c-ev1.dtb: camera@3c: 'AVDD-supply' is a required property From schema: Documentation/devicetree/bindings/media/i2c/ovti,ov5640.yaml arch/arm/boot/dts/stm32mp157c-ev1.dtb: camera@3c: 'DVDD-supply' is a required property From schema: Documentation/devicetree/bindings/media/i2c/ovti,ov5640.yaml Signed-off-by: Alain Volmat Signed-off-by: Alexandre Torgue commit 4d4de1cbdb26829615d05e6b556011d308880e82 Author: Andrzej Hajda Date: Thu Jun 1 16:44:50 2023 +0200 drm/i915/gt: limit lmem allocation size to succeed on SmallBars In case system is short on mappable memory (256MB on SmallBar) allocation of two 1GB buffers will fail. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8300 Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230601144450.792228-1-andrzej.hajda@intel.com commit 955b503b6317859632c7ea214babfa22305d1de4 Author: David Lin Date: Fri Jun 2 12:09:24 2023 +0800 ASoC: nau8825: Update output control for NAU8825C Update the output control for NAU8825C. Signed-off-by: David Lin Link: https://lore.kernel.org/r/20230602040924.188913-4-CTLIN0@nuvoton.com Signed-off-by: Mark Brown commit 6d64c33f0f0018bd26836680175b4ee05f3cf54c Author: David Lin Date: Fri Jun 2 12:09:23 2023 +0800 ASoC: nau8825: Update the calculation of FLL for NAU8825C The FLL is updated to 24 bit with lower power consumption. Signed-off-by: David Lin Link: https://lore.kernel.org/r/20230602040924.188913-3-CTLIN0@nuvoton.com Signed-off-by: Mark Brown commit b81a2cc9a2f2314dad78ca14f12d2fbf8e071c3e Author: David Lin Date: Fri Jun 2 12:09:22 2023 +0800 ASoC: nau8825: Add registers patch for NAU8825C The patch is to update default regmap and register a set of registers for NAU8825C. Signed-off-by: David Lin Link: https://lore.kernel.org/r/20230602040924.188913-2-CTLIN0@nuvoton.com Signed-off-by: Mark Brown commit def85dce1451ec276b8047da2010b6e6a159c2b6 Author: Uwe Kleine-König Date: Thu May 25 22:58:40 2023 +0200 auxdisplay: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230525205840.734432-1-u.kleine-koenig@pengutronix.de Signed-off-by: Miguel Ojeda commit 9bcfc3cdc903485a52c6f471f4ae96a41fa51803 Author: Marek Vasut Date: Tue May 30 14:45:37 2023 +0200 ARM: dts: stm32: Update to generic ADC channel binding on DHSOM systems The generic ADC channel binding is recommended over legacy one, update the DT to the modern binding. No functional change. For further details, see commit which adds the generic binding to STM32 ADC binding document: '664b9879f56e ("dt-bindings: iio: stm32-adc: add generic channel binding")' Signed-off-by: Marek Vasut Signed-off-by: Alexandre Torgue commit 84cb6d8a0aafabe484203fc5fd63984a5aea8747 Author: Olivier Moysan Date: Tue May 30 14:45:36 2023 +0200 ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench Use STM32 ADC generic bindings instead of legacy bindings on DHCOR Testbench board. The STM32 ADC specific binding to declare channels has been deprecated, hence adopt the generic IIO channels bindings, instead. The STM32MP151 device tree now exposes internal channels using the generic binding. This makes the change mandatory here to avoid a mixed use of legacy and generic binding, which is not supported by the driver. Signed-off-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit 1866e1f96cda9237d21e3028f036eb62e1e36d6e Author: Olivier Moysan Date: Tue May 30 14:45:35 2023 +0200 ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc Use STM32 ADC generic bindings instead of legacy bindings on DHCOR DRC Compact board. The STM32 ADC specific binding to declare channels has been deprecated, hence adopt the generic IIO channels bindings, instead. The STM32MP151 device tree now exposes internal channels using the generic binding. This makes the change mandatory here to avoid a mixed use of legacy and generic binding, which is not supported by the driver. Signed-off-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit c46e9b6cc98245f7264a8d15394d1f95d433abec Author: Olivier Moysan Date: Tue May 30 14:45:34 2023 +0200 ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon Use STM32 ADC generic bindings instead of legacy bindings on emtrion GmbH Argon boards. The STM32 ADC specific binding to declare channels has been deprecated, hence adopt the generic IIO channels bindings, instead. The STM32MP151 device tree now exposes internal channels using the generic binding. This makes the change mandatory here to avoid a mixed use of legacy and generic binding, which is not supported by the driver. Signed-off-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit 765ce359d67fc089281bc5317230c310122f7a32 Author: Olivier Moysan Date: Tue May 30 14:45:33 2023 +0200 ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1 Use STM32 ADC generic bindings instead of legacy bindings on STM32MP157c-ed1 board. The STM32 ADC specific binding to declare channels has been deprecated, hence adopt the generic IIO channels bindings, instead. The STM32MP151 device tree now exposes internal channels using the generic binding. This makes the change mandatory here to avoid a mixed use of legacy and generic binding, which is not supported by the driver. Signed-off-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit 7ea81ea58d61aed271afb83fef5935232ee43cd4 Author: Olivier Moysan Date: Tue May 30 14:45:32 2023 +0200 ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards U-Boot enables ADC1&2 to support USB power measurement and ADC calibration on STM32MP15x Disco boards. When leaving U-boot the ADCs do not return to power down state to keep ADC linear calibration available for kernel. Enable ADC1&2 by default on STM32MP15xx-DKx boards to align kernel DT with Uboot. This avoids to shutdown the ADCs VDDA, while the ADCs are not in power down. Use STM32 ADC generic bindings instead of legacy bindings on STM32MP15xx-DKx boards. The ADC pins on Arduino connector are not set by default. These pins are added in A7 Disco example DTs only. Signed-off-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit 95ee314b387d1eb30cb75022f6098845ae59a5b0 Author: Olivier Moysan Date: Tue May 30 14:45:31 2023 +0200 ARM: dts: stm32: add vrefint support to adc2 on stm32mp15 Set STM32 ADC2 as a consumer of BSEC on STM32MP15, to retrieve vrefint calibration data saved in OTP. During the calibration process vrefp is set to 3.3V and the data acquired is saved to the OTP. This data is used by the ADC driver to calculated the actual value of vrefp according to the formula: vrefp = 3.3 x vrefint_cal / vrefint_data The vrefint channel provides the actual value of vrefp, which can be used to correct ADC acquisition data. Signed-off-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit 5988bd535975486a0a550fa8fe8a4ca2fd9231c9 Author: Olivier Moysan Date: Tue May 30 14:45:30 2023 +0200 ARM: dts: stm32: add vrefint calibration on stm32mp15 Describe vrefint calibration cell to be retrieved through bsec. Signed-off-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit 04d28eb48ff30c059069e27689c4638c8a17134e Author: Olivier Moysan Date: Tue May 30 14:45:29 2023 +0200 ARM: dts: stm32: add adc internal channels to stm32mp15 Add STM32 ADC2 internal channels VREFINT and VDDCORE to STM32MP15x SoCs. VBAT internal channel is not defined by default in SoC DT, and has be defined in board DT when needed, instead. This avoids unwanted current consumption on battery, when ADC conversions are performed on any other channels. The internal channels are defined in STM32MP15 SoC DT according to the generic IIO channel bindings. The STM32 driver does not support a mixed use of legacy and generic channels. When generic channels are defined, legacy channels are ignored. This involves that the board device trees using legacy bindings for ADC2, have to be reworked. Signed-off-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit 27cbdc6bddc28cdc2a91e24d1ae91405e261fc2a Author: Jani Nikula Date: Tue May 30 12:08:25 2023 +0300 drm/i915/display: switch the rest of the connectors to struct drm_edid Convert the remaining uses of struct edid based drm_get_edid(), drm_connector_update_edid_property() and drm_add_edid_modes() calls to the struct drm_edid based drm_edid_read_ddc(), drm_edid_connector_update() and drm_edid_connector_add_modes(). Reviewed-by: Ankit Nautiyal Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/b1b53bb9004adaa402e061f7df2caf0eb4723a43.1685437501.git.jani.nikula@intel.com commit c1c9042b20031aa4f86f60bba8f04e304bb9f72a Author: Jani Nikula Date: Tue May 30 12:08:24 2023 +0300 drm/display/dp_mst: convert to struct drm_edid Convert the topology manager to use struct drm_edid, add drm_dp_mst_edid_read() that returns drm_edid, and rewrite the old drm_dp_mst_get_edid() to use it. Note that the old drm_get_edid() ended up calling drm_connector_update_edid_property(). This responsibility is now deferred to drivers, which all do it anyway after calling drm_dp_mst_edid_read() or drm_dp_mst_get_edid(). Reviewed-by: Ankit Nautiyal Acked-by: Thomas Zimmermann Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/9c32e5c241934093fc4144eed4c01155e1f03af1.1685437501.git.jani.nikula@intel.com commit d60d2bccae65e9f85016ca4d6f6ad169c86b1024 Author: Jani Nikula Date: Tue May 30 12:08:23 2023 +0300 drm/edid: make drm_edid_duplicate() safe to call with NULL parameter It's a bit tedious to check for NULL before calling drm_edid_duplicate(). Make it handle NULL parameter graciously. Reviewed-by: Ankit Nautiyal Acked-by: Thomas Zimmermann Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1ae8923d39a5abd0260fdf7f9cc54c5e046e70d3.1685437501.git.jani.nikula@intel.com commit a036aa1f01e7d1321859613d85570720f041cb07 Author: Jani Nikula Date: Tue May 30 12:08:22 2023 +0300 drm/i915/lvds: switch to drm_edid_read_switcheroo() Use drm_edid_read_switcheroo() to switch from struct edid to struct drm_edid. Reviewed-by: Lukas Wunner Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/429cd6f23366cb4cace4fa13cf92ad068aca64dd.1685437501.git.jani.nikula@intel.com commit 6c46f644cd5aa5b2b18020bef83d67101a98d873 Author: Jani Nikula Date: Tue May 30 12:08:21 2023 +0300 drm/edid: add drm_edid_read_switcheroo() Add a switcheroo variant to the struct drm_edid based EDID read functions. Reviewed-by: Ankit Nautiyal Acked-by: Thomas Zimmermann Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/4ab5ec994670ea50f95c8079c1f1ae915940b00f.1685437501.git.jani.nikula@intel.com commit dd9f377ae12110fef29262af23859d144a613bfa Author: Jani Nikula Date: Tue May 30 12:08:20 2023 +0300 drm/i915/sdvo: stop caching has_hdmi_audio in struct intel_sdvo Use the information stored in display info. Reviewed-by: Ankit Nautiyal Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/1e02f2f7381dfcee6e4160a5fc17aea6ff04baf9.1685437500.git.jani.nikula@intel.com commit f2f9c8cb6421429ef166d6404426693212d0ca07 Author: Jani Nikula Date: Tue May 30 12:08:19 2023 +0300 drm/i915/sdvo: stop caching has_hdmi_monitor in struct intel_sdvo Use the information stored in display info. Reviewed-by: Ankit Nautiyal Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/3e9e1dcd554d470bdf474891a431b15e1880f9a0.1685437500.git.jani.nikula@intel.com commit 7c1000aae5521ea4fa027b6ddf6aa9d4863e9c29 Author: Jani Nikula Date: Tue May 30 12:08:18 2023 +0300 drm/i915/hdmi: stop caching has_hdmi_sink in struct intel_hdmi Use the information stored in display info. Reviewed-by: Ankit Nautiyal Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/5cdb4731260b062c0f0ad2f8b64195c9a57bcb76.1685437500.git.jani.nikula@intel.com commit 9fe2a4adc09567e32a5ecd4cab236022436a16c2 Author: Jani Nikula Date: Tue May 30 12:08:17 2023 +0300 drm/i915/hdmi: stop caching has_audio in struct intel_hdmi Use the information stored in display info. Reviewed-by: Ankit Nautiyal Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/710286536d6b07ba8aa068b65b2b2c0c7743220e.1685437500.git.jani.nikula@intel.com commit 7ffa2f27cf0aa1a89bea7fdacd9a51668ec32e7b Author: Jani Nikula Date: Tue May 30 12:08:16 2023 +0300 drm/i915/dp: stop caching has_hdmi_sink in struct intel_dp Use the information stored in display info. Add intel_dp_has_hdmi_sink() helper to access it. v2: Rebased Reviewed-by: Ankit Nautiyal Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/748103fda572b3552e5bbdafb300d8508d4eeaf4.1685437500.git.jani.nikula@intel.com commit 1d217fa26680b074dbb44f6183f971a5304eaf8b Author: Bhupesh Sharma Date: Sat May 27 00:52:05 2023 +0530 dt-bindings: qcom-qce: Add compatibles for SM6115 and QCM2290 The core clock for the Crypto Engine block on Qualcomm SoCs SM6115 and QCM2290 are provided via the RPM block. So mark the compatibles for these SoCs to indicate that only 'core' clock is required for such SoCs. Acked-by: Krzysztof Kozlowski Tested-by: Anders Roxell Tested-by: Linux Kernel Functional Testing Signed-off-by: Bhupesh Sharma Signed-off-by: Herbert Xu commit b3b266fa15552ba342831653f2b8b02c91451e73 Author: Bhupesh Sharma Date: Sat May 27 00:52:04 2023 +0530 dt-bindings: qcom-qce: Fix compatible combinations for SM8150 and IPQ4019 SoCs Currently the compatible list available in 'qce' dt-bindings does not support SM8150 and IPQ4019 SoCs directly which may lead to potential 'dtbs_check' error(s). Fix the same. Fixes: 00f3bc2db351 ("dt-bindings: qcom-qce: Add new SoC compatible strings for Qualcomm QCE IP") Reviewed-by: Vladimir Zapolskiy Acked-by: Rob Herring Tested-by: Anders Roxell Tested-by: Linux Kernel Functional Testing Signed-off-by: Bhupesh Sharma Signed-off-by: Herbert Xu commit 9260db6640a61ebba5348ceae7fa26307d9d5b0e Author: Damian Muszynski Date: Fri May 26 17:48:59 2023 +0100 crypto: qat - move dbgfs init to separate file Move initialization of debugfs entries to a separate file. This simplifies the exclusion of the debugfs logic in the QAT driver when the kernel is built with CONFIG_DEBUG_FS=n. In addition, it will allow to consolidate the addition of debugfs entries to a single location in the code. This implementation adds infrastructure to create (and remove) debugfs entries at two different stages. The first, done when a device is probed, allows to keep debugfs entries persistent between a transition in device state (up to down or vice versa). The second, done after the initialization phase, allows to have debugfs entries that are accessible only when the device is up. In addition, move the creation of debugfs entries for configuration to the newly created function adf_dbgfs_init() and replace symbolic permissions with octal permissions when creating the debugfs files. This is to resolve the following warning reported by checkpatch: WARNING: Symbolic permissions 'S_IRUSR' are not preferred. Consider using octal permissions '0400'. Signed-off-by: Damian Muszynski Reviewed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 755b4e7f7c224e10af10edafe34577b5512f7cbb Author: Uwe Kleine-König Date: Thu May 25 23:03:47 2023 +0200 crypto: atmel - Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Tudor Ambarus Signed-off-by: Herbert Xu commit d23659769ad1bf2cbafaa0efcbae20ef1a74f77e Author: Stephan Müller Date: Thu May 25 19:00:05 2023 +0200 crypto: jitter - correct health test during initialization With the update of the permanent and intermittent health errors, the actual indicator for the health test indicates a potential error only for the one offending time stamp gathered in the current iteration round. The next iteration round will "overwrite" the health test result. Thus, the entropy collection loop in jent_gen_entropy checks for the health test failure upon each loop iteration. However, the initialization operation checked for the APT health test once for an APT window which implies it would not catch most errors. Thus, the check for all health errors is now invoked unconditionally during each loop iteration for the startup test. With the change, the error JENT_ERCT becomes unused as all health errors are only reported with the JENT_HEALTH return code. This allows the removal of the error indicator. Fixes: 3fde2fe99aa6 ("crypto: jitter - permanent and intermittent health errors" ) Reported-by: Joachim Vandersmissen Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 506579e88caf882b91ff2c62a203af793f468183 Author: Bharat Bhushan Date: Thu May 25 09:12:00 2023 +0530 hwrng: cn10k - Add extended trng register support The way random data is read from hardware has changed from Octeon CN10KA-B0 and later SoCs onwards. A new set of registers have been added to read random data and to verify whether the read data is valid or not. This patch extends and uses RNM_PF_TRNG_DAT and RNM_PF_TRNG_STS CSRs to read random number and status for the applicable silicon variants. Signed-off-by: Bharat Bhushan Signed-off-by: Herbert Xu commit efbc7764c4446566edb76ca05e903b5905673d2e Author: Arnd Bergmann Date: Tue May 23 10:33:04 2023 +0200 crypto: marvell/cesa - Fix type mismatch warning Commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") uncovered a type mismatch in cesa 3des support that leads to a memcpy beyond the end of a structure: In function 'fortify_memcpy_chk', inlined from 'mv_cesa_des3_ede_setkey' at drivers/crypto/marvell/cesa/cipher.c:307:2: include/linux/fortify-string.h:583:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 583 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is probably harmless as the actual data that is copied has the correct type, but clearly worth fixing nonetheless. Fixes: 4ada48397823 ("crypto: marvell/cesa - add Triple-DES support") Cc: Kees Cook Cc: Gustavo A. R. Silva" Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Signed-off-by: Herbert Xu commit bb4185e595e476d4ceccd366bca39762823c5a2e Author: John Allen Date: Thu May 18 22:24:14 2023 -0500 crypto: ccp - Add support for PCI device 0x156E Add a new CCP/PSP PCI device ID and new PSP register offsets. Signed-off-by: John Allen Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit 4aa0931be8f0a2b1571dd24611b26602d2285a1a Author: Mario Limonciello Date: Thu May 18 22:24:13 2023 -0500 crypto: ccp - Add support for PCI device 0x17E0 PCI device 0x17E0 includes new TEE offsets, doesn't support a platform mailbox, and does support platform doorbell so introduce a new structure to represent it. Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit dd536cb9f73cb31eb6e997ab8a81bb1eb5b0c465 Author: Mario Limonciello Date: Thu May 18 22:24:12 2023 -0500 crypto: ccp - Validate that platform access mailbox registers are declared Some platforms might support platform access doorbell but not mailbox. Add an extra guard to ensure this doesn't cause accesses to wrong ranges if a consumer calls psp_send_platform_access_msg(). Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit 28da4f8336083874699defb5016cda3015ef2723 Author: Jani Nikula Date: Tue May 30 12:08:15 2023 +0300 drm/i915/dp: stop caching has_audio in struct intel_dp Use the information stored in display info. Reviewed-by: Ankit Nautiyal Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/695bbe8b5ebee6e492f95a1c818da15691752dc8.1685437500.git.jani.nikula@intel.com commit 3d35ddfb07136cb4220fd9672589dcdf5c9d4acf Author: Jani Nikula Date: Tue May 30 12:08:14 2023 +0300 drm/display/dp_mst: drop has_audio from struct drm_dp_mst_port Caching the has_audio in struct drm_dp_mst_port seems odd, and oddly placed. Defer audio handling to drivers, and use the info from the connector display info. i915 was the only one using it anyway. Reviewed-by: Ankit Nautiyal Acked-by: Thomas Zimmermann Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/7d9eefdf150870479c5797f027d4c2b0a19ff583.1685437500.git.jani.nikula@intel.com commit 0374ffa507d8106202a956f5951226f1d9eac22e Author: Jani Nikula Date: Tue May 30 12:08:13 2023 +0300 drm/edid: parse display info has_audio similar to is_hdmi Since we already iterate everything that's needed for determining audio, reduce the need to call drm_detect_monitor_audio() by storing has_audio to connector info. Reviewed-by: Ankit Nautiyal Acked-by: Thomas Zimmermann Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/391a93b25c6bcbb39854aaa2813570cfb1580ed9.1685437500.git.jani.nikula@intel.com commit 3f06760c00f56c5fe6c7f3361c2cf64becee1174 Author: Guillaume Nault Date: Thu Jun 1 18:37:46 2023 +0200 ipv4: Drop tos parameter from flowi4_update_output() Callers of flowi4_update_output() never try to update ->flowi4_tos: * ip_route_connect() updates ->flowi4_tos with its own current value. * ip_route_newports() has two users: tcp_v4_connect() and dccp_v4_connect. Both initialise fl4 with ip_route_connect(), which in turn sets ->flowi4_tos with RT_TOS(inet_sk(sk)->tos) and ->flowi4_scope based on SOCK_LOCALROUTE. Then ip_route_newports() updates ->flowi4_tos with RT_CONN_FLAGS(sk), which is the same as RT_TOS(inet_sk(sk)->tos), unless SOCK_LOCALROUTE is set on the socket. In that case, the lowest order bit is set to 1, to eventually inform ip_route_output_key_hash() to restrict the scope to RT_SCOPE_LINK. This is equivalent to properly setting ->flowi4_scope as ip_route_connect() did. * ip_vs_xmit.c initialises ->flowi4_tos with memset(0), then calls flowi4_update_output() with tos=0. * sctp_v4_get_dst() uses the same RT_CONN_FLAGS_TOS() when initialising ->flowi4_tos and when calling flowi4_update_output(). In the end, ->flowi4_tos never changes. So let's just drop the tos parameter. This will simplify the conversion of ->flowi4_tos from __u8 to dscp_t. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 0f0f5868689ecbf643b723fae1a353c5a11a8e46 Author: Moritz Fischer Date: Fri Jun 2 00:04:14 2023 +0000 net: lan743x: Remove extranous gotos The gotos for cleanup aren't required, the function might as well just return the actual error code. Signed-off-by: Moritz Fischer Reviewed-by: Siddharth Vadapalli Signed-off-by: David S. Miller commit a92fb5c0340411c66b48f66b6b8854f271e4ca8d Author: Jiapeng Chong Date: Fri Jun 2 13:59:25 2023 +0800 ip_gre: clean up some inconsistent indenting No functional modification involved. net/ipv4/ip_gre.c:192 ipgre_err() warn: inconsistent indenting. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5375 Signed-off-by: Jiapeng Chong Signed-off-by: David S. Miller commit c776a2128dee50a9f10eace4a14ff894e1432a31 Author: Wolfram Sang Date: Thu May 25 10:48:23 2023 +0200 arm64: dts: renesas: ulcb-kf: Add HSCIF1 node Exposed on CN4. Tested by connecting it to a Renesas Ebisu board. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230525084823.4195-3-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 1a2c4e5635177939a088d22fa35c6a7032725663 Author: Wolfram Sang Date: Thu May 25 10:48:22 2023 +0200 arm64: dts: renesas: ulcb-kf: Remove flow control for SCIF1 The schematics are misleading, the flow control is for HSCIF1. We need SCIF1 for GNSS/GPS which does not use flow control. Fixes: c6c816e22bc8 ("arm64: dts: ulcb-kf: enable SCIF1") Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230525084823.4195-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 0501fdec106a291c43b3c1b525cf22ab4c24b2d8 Author: Geert Uytterhoeven Date: Tue May 23 17:35:16 2023 +0200 ARM: dts: iwg20d-q7-common: Fix backlight pwm specifier make dtbs_check: arch/arm/boot/dts/renesas/r8a7743-iwg20d-q7.dtb: backlight: pwms: [[58, 0, 5000000], [0]] is too long From schema: Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml arch/arm/boot/dts/renesas/r8a7743-iwg20d-q7-dbcm-ca.dtb: backlight: pwms: [[67, 0, 5000000], [0]] is too long From schema: Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml arch/arm/boot/dts/renesas/r8a7744-iwg20d-q7-dbcm-ca.dtb: backlight: pwms: [[67, 0, 5000000], [0]] is too long From schema: Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml arch/arm/boot/dts/renesas/r8a7744-iwg20d-q7.dtb: backlight: pwms: [[58, 0, 5000000], [0]] is too long From schema: Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml PWM specifiers referring to R-Car PWM Timer Controllers should contain only two cells. Fix this by dropping the bogus third cell. Fixes: 6f89dd9e9325d05b ("ARM: dts: iwg20d-q7-common: Add LCD support") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/6e5c3167424a43faf8c1fa68d9667b3d87dc86d8.1684855911.git.geert+renesas@glider.be commit 937e87229ea04e94c4f1a2f3f5ae9d2c56989acd Author: Franziska Naepelt Date: Wed May 31 19:04:27 2023 +0200 ARM: omap2: Fix checkpatch issues The following checkpatch issues have been resolved: arch/arm/mach-omap2/omap-wakeupgen.c WARNING: Missing a blank line after declarations arch/arm/mach-omap2/omap_hwmod_3xxx_data.c ERROR: space prohibited before that ',' (ctx:WxE) WARNING: Use lore.kernel.org archive links when possible arch/arm/mach-omap2/omap_phy_internal.c WARNING: Block comments should align the * on each line arch/arm/mach-omap2/sdrc2xxx.c WARNING: It's generally not useful to have the filename in the file arch/arm/mach-omap2/ti81xx-restart.c ERROR: trailing statements should be on next line Signed-off-by: Franziska Naepelt Message-ID: <20230531170427.42199-1-franziska.naepelt@gmail.com> Signed-off-by: Tony Lindgren commit 86d904b6ef9f5e67a28e0a0bb58df898c08ae0b8 Author: Yoshihiro Shimoda Date: Wed May 10 18:03:58 2023 +0900 arm64: dts: renesas: Add IOMMU related properties into PCIe host nodes Add iommu-map and iommu-map-mask properties to the PCIe host nodes. Note that iommu-map-mask should be zero because the IPMMU assigns one micro TLB ID only, to the PCIe host. Also change the dma-ranges arguments for IOMMU. Note that dma-ranges can be used if the IOMMU is disabled. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230510090358.261266-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit cacde5cc9dbc1af46a5d35efd17365bc3324b4fb Author: Biju Das Date: Mon Apr 17 11:06:07 2023 +0100 arm64: defconfig: Enable Renesas MTU3a counter config Enable MFD & counter related configs for Renesas MTU3a Counter as it is populated on RZ/{G2L, LC, UL} and RZ/V2L SMARC EVKs. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230417100607.309068-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 12ca2c67d742d390c0aa1f8c1cfc49469df55ddf Author: Masahiro Yamada Date: Thu Jun 1 21:09:57 2023 +0900 modpost: detect section mismatch for R_ARM_{MOVW_ABS_NC,MOVT_ABS} For ARM defconfig (i.e. multi_v7_defconfig), modpost fails to detect some types of section mismatches. [test code] #include int __initdata foo; int get_foo(void) { return foo; } It is apparently a bad reference, but modpost does not report anything. The test code above produces the following relocations. Relocation section '.rel.text' at offset 0x200 contains 2 entries: Offset Info Type Sym.Value Sym. Name 00000000 0000062b R_ARM_MOVW_ABS_NC 00000000 .LANCHOR0 00000004 0000062c R_ARM_MOVT_ABS 00000000 .LANCHOR0 Currently, R_ARM_MOVW_ABS_NC and R_ARM_MOVT_ABS are just skipped. Add code to handle them. I checked arch/arm/kernel/module.c to learn how the offset is encoded in the instruction. The referenced symbol in relocation might be a local anchor. If is_valid_name() returns false, let's search for a better symbol name. Signed-off-by: Masahiro Yamada commit 56a24b8ce6a7f9c4a21b2276a8644f6f3d8fc14d Author: Masahiro Yamada Date: Thu Jun 1 21:09:56 2023 +0900 modpost: fix section mismatch message for R_ARM_{PC24,CALL,JUMP24} addend_arm_rel() processes R_ARM_PC24, R_ARM_CALL, R_ARM_JUMP24 in a wrong way. Here, test code. [test code for R_ARM_JUMP24] .section .init.text,"ax" bar: bx lr .section .text,"ax" .globl foo foo: b bar [test code for R_ARM_CALL] .section .init.text,"ax" bar: bx lr .section .text,"ax" .globl foo foo: push {lr} bl bar pop {pc} If you compile it with ARM multi_v7_defconfig, modpost will show the symbol name, (unknown). WARNING: modpost: vmlinux.o: section mismatch in reference: foo (section: .text) -> (unknown) (section: .init.text) (You need to use GNU linker instead of LLD to reproduce it.) Fix the code to make modpost show the correct symbol name. I imported (with adjustment) sign_extend32() from include/linux/bitops.h. The '+8' is the compensation for pc-relative instruction. It is documented in "ELF for the Arm Architecture" [1]. "If the relocation is pc-relative then compensation for the PC bias (the PC value is 8 bytes ahead of the executing instruction in Arm state and 4 bytes in Thumb state) must be encoded in the relocation by the object producer." [1]: https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst Fixes: 56a974fa2d59 ("kbuild: make better section mismatch reports on arm") Fixes: 6e2e340b59d2 ("ARM: 7324/1: modpost: Fix section warnings for ARM for many compilers") Signed-off-by: Masahiro Yamada commit b7c63520f6703a25eebb4f8138fed764fcae1c6f Author: Masahiro Yamada Date: Thu Jun 1 21:09:55 2023 +0900 modpost: fix section mismatch message for R_ARM_ABS32 addend_arm_rel() processes R_ARM_ABS32 in a wrong way. Here, test code. [test code 1] #include int __initdata foo; int get_foo(void) { return foo; } If you compile it with ARM versatile_defconfig, modpost will show the symbol name, (unknown). WARNING: modpost: vmlinux.o: section mismatch in reference: get_foo (section: .text) -> (unknown) (section: .init.data) (You need to use GNU linker instead of LLD to reproduce it.) If you compile it for other architectures, modpost will show the correct symbol name. WARNING: modpost: vmlinux.o: section mismatch in reference: get_foo (section: .text) -> foo (section: .init.data) For R_ARM_ABS32, addend_arm_rel() sets r->r_addend to a wrong value. I just mimicked the code in arch/arm/kernel/module.c. However, there is more difficulty for ARM. Here, test code. [test code 2] #include int __initdata foo; int get_foo(void) { return foo; } int __initdata bar; int get_bar(void) { return bar; } With this commit applied, modpost will show the following messages for ARM versatile_defconfig: WARNING: modpost: vmlinux.o: section mismatch in reference: get_foo (section: .text) -> foo (section: .init.data) WARNING: modpost: vmlinux.o: section mismatch in reference: get_bar (section: .text) -> foo (section: .init.data) The reference from 'get_bar' to 'foo' seems wrong. I have no solution for this because it is true in assembly level. In the following output, relocation at 0x1c is no longer associated with 'bar'. The two relocation entries point to the same symbol, and the offset to 'bar' is encoded in the instruction 'r0, [r3, #4]'. Disassembly of section .text: 00000000 : 0: e59f3004 ldr r3, [pc, #4] @ c 4: e5930000 ldr r0, [r3] 8: e12fff1e bx lr c: 00000000 .word 0x00000000 00000010 : 10: e59f3004 ldr r3, [pc, #4] @ 1c 14: e5930004 ldr r0, [r3, #4] 18: e12fff1e bx lr 1c: 00000000 .word 0x00000000 Relocation section '.rel.text' at offset 0x244 contains 2 entries: Offset Info Type Sym.Value Sym. Name 0000000c 00000c02 R_ARM_ABS32 00000000 .init.data 0000001c 00000c02 R_ARM_ABS32 00000000 .init.data When find_elf_symbol() gets into a situation where relsym->st_name is zero, there is no guarantee to get the symbol name as written in C. I am keeping the current logic because it is useful in many architectures, but the symbol name is not always correct depending on the optimization. I left some comments in find_tosym(). Fixes: 56a974fa2d59 ("kbuild: make better section mismatch reports on arm") Signed-off-by: Masahiro Yamada commit 5516c89d58283413134f8d26960c6303d5d5bd89 Author: Nadav Amit Date: Thu May 25 11:42:44 2023 -0700 x86/lib: Make get/put_user() exception handling a visible symbol The .L-prefixed exception handling symbols of get_user() and put_user() do get discarded from the symbol table of the final kernel image. This confuses tools which parse that symbol table and try to map the chunk of code to a symbol. And, in general, from toolchain perspective, it is a good practice to have all code belong to a symbol, and the correct one at that. ( Currently, objdump displays that exception handling chunk as part of the previous symbol which is a "fallback" of sorts and not correct. ) While at it, rename them to something more descriptive. [ bp: Rewrite commit message, rename symbols. ] Signed-off-by: Nadav Amit Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230525184244.2311-1-namit@vmware.com commit 23fcb62bc19c37adb72a585d5dc702ac55b74fb1 Author: Jakub Kicinski Date: Wed May 31 08:35:51 2023 -0700 selftests: tls: add tests for poll behavior Make sure we don't generate premature POLLIN events. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 121dca784fc0f6c022493a5d23d86b3cc20380f4 Author: Jakub Kicinski Date: Wed May 31 08:35:50 2023 -0700 tls: suppress wakeups unless we have a full record TLS does not override .poll() so TLS-enabled socket will generate an event whenever data arrives at the TCP socket. This leads to unnecessary wakeups on slow connections. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit d3369a4b6f0164b8869a097547846ed4e5c9c47f Author: Claudiu Beznea Date: Tue May 16 10:24:05 2023 +0300 memory: atmel-sdramc: remove the driver Driver does only clock request + enable for DDR clocks. DDR clocks are enabled by bootloader and need to stay that way in Linux. To avoid having these clocks disabled by clock subsystem in case there are no Linux consumers for them the clocks were marked as critical in clock drivers (in commit 68b3b6f1773d ("clk: at91: mark ddr clocks as critical")). With this, there is no need to have a separate driver that only does clock request + enable. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230516072405.2696225-1-claudiu.beznea@microchip.com Signed-off-by: Krzysztof Kozlowski commit 820eb59da8c7ca7e705a02f37dda2be316807847 Author: Kees Cook Date: Sat Feb 4 10:33:56 2023 -0800 jfs: Use unsigned variable for length calculations To avoid confusing the compiler about possible negative sizes, switch "ssize" which can never be negative from int to u32. Seen with GCC 13: ../fs/jfs/namei.c: In function 'jfs_symlink': ../include/linux/fortify-string.h:57:33: warning: '__builtin_memcpy' pointer overflow between offset 0 and size [-2147483648, -1] [-Warray-bounds=] 57 | #define __underlying_memcpy __builtin_memcpy | ^ ... ../fs/jfs/namei.c:950:17: note: in expansion of macro 'memcpy' 950 | memcpy(ip->i_link, name, ssize); | ^~~~~~ Cc: Dave Kleikamp Cc: Christian Brauner Cc: Dave Chinner Cc: jfs-discussion@lists.sourceforge.net Signed-off-by: Kees Cook Acked-by: Jeff Xu Message-Id: <20230204183355.never.877-kees@kernel.org> Signed-off-by: Christian Brauner commit d0bf7d5759c1d89fb013aa41cca5832e00b9632a Author: Jesper Dangaard Brouer Date: Tue Jan 17 14:40:00 2023 +0100 mm/slab: introduce kmem_cache flag SLAB_NO_MERGE Allow API users of kmem_cache_create to specify that they don't want any slab merge or aliasing (with similar sized objects). Use this in kfence_test. The SKB (sk_buff) kmem_cache slab is critical for network performance. Network stack uses kmem_cache_{alloc,free}_bulk APIs to gain performance by amortising the alloc/free cost. For the bulk API to perform efficiently the slub fragmentation need to be low. Especially for the SLUB allocator, the efficiency of bulk free API depend on objects belonging to the same slab (page). When running different network performance microbenchmarks, I started to notice that performance was reduced (slightly) when machines had longer uptimes. I believe the cause was 'skbuff_head_cache' got aliased/merged into the general slub for 256 bytes sized objects (with my kernel config, without CONFIG_HARDENED_USERCOPY). For SKB kmem_cache network stack have reasons for not merging, but it varies depending on kernel config (e.g. CONFIG_HARDENED_USERCOPY). We want to explicitly set SLAB_NO_MERGE for this kmem_cache. Another use case for the flag has been described by David Sterba [1]: > This can be used for more fine grained control over the caches or for > debugging builds where separate slabs can verify that no objects leak. > The slab_nomerge boot option is too coarse and would need to be > enabled on all testing hosts. There are some other ways how to disable > merging, e.g. a slab constructor but this disables poisoning besides > that it adds additional overhead. Other flags are internal and may > have other semantics. > A concrete example what motivates the flag. During 'btrfs balance' > slab top reported huge increase in caches like > 1330095 1330095 100% 0.10K 34105 39 136420K Acpi-ParseExt > 1734684 1734684 100% 0.14K 61953 28 247812K pid_namespace > 8244036 6873075 83% 0.11K 229001 36 916004K khugepaged_mm_slot > which was confusing and that it's because of slab merging was not the > first idea. After rebooting with slab_nomerge all the caches were > from btrfs_ namespace as expected. [1] https://lore.kernel.org/all/20230524101748.30714-1-dsterba@suse.com/ [ vbabka@suse.cz: rename to SLAB_NO_MERGE, change the flag value to the one proposed by David so it does not collide with internal SLAB/SLUB flags, write a comment for the flag, expand changelog, drop the skbuff part to be handled spearately ] Link: https://lore.kernel.org/all/167396280045.539803.7540459812377220500.stgit@firesoul/ Reported-by: David Sterba Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Vlastimil Babka Acked-by: Jesper Dangaard Brouer Acked-by: Roman Gushchin commit 49f661ba99324a3f7eef0befbdaa4f22dee02b97 Author: Naresh Solanki Date: Thu Apr 27 13:30:45 2023 +0200 mfd: max5970: Rename driver and remove wildcard The previous version of this driver included wildcards in file names and descriptions. This patch renames the driver to only support MAX5970 and MAX5978, which are the only chips that the driver actually supports. Signed-off-by: Naresh Solanki Link: https://lore.kernel.org/r/20230427113046.3971425-1-Naresh.Solanki@9elements.com Signed-off-by: Lee Jones commit 0da4cebebc37b0f68c1ad991a1c6e4ecdb1bbc41 Author: Chester Lin Date: Wed Mar 29 12:16:30 2023 +0800 pinctrl: s32: separate const device data from struct s32_pinctrl_soc_info The .data field in struct of_device_id is used as a const member so it's inappropriate to attach struct s32_pinctrl_soc_info with of_device_id because some members in s32_pinctrl_soc_info need to be filled by pinctrl-s32cc at runtime. For this reason, struct s32_pinctrl_soc_info must be allocated in pinctrl-s32cc and then create a new struct s32_pinctrl_soc_data in order to represent const .data in of_device_id. To combine these two structures, a s32_pinctrl_soc_data pointer is introduced in s32_pinctrl_soc_info. Besides, use of_device_get_match_data() instead of of_match_device() since the driver only needs to retrieve the .data from of_device_id. Link: https://lore.kernel.org/r/20230329041630.8011-1-clin@suse.com/ Suggested-by: Andy Shevchenko Signed-off-by: Chester Lin Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij commit 49c80922ff8115bc86c82e5fc9e6842cd87db689 Author: Tony Lindgren Date: Fri Jun 2 10:00:05 2023 +0300 serial: core: Fix error handling for serial_core_ctrl_device_add() Checking for NULL is incorrect as serial_base_ctrl_add() uses ERR_PTR(). Let's also pass any returned error along, there's no reason to translate all errors to -ENODEV. Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Signed-off-by: Tony Lindgren Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20230602070007.59268-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit de649e7f5edb2e61dbd3d64deae44cb165e657ad Author: Yuwei Guan Date: Thu Jun 1 21:31:49 2023 +0800 memblock: Update nid info in memblock debugfs The node id for memblock reserved regions will be wrong, so let's show 'x' for reg->nid == MAX_NUMNODES in debugfs to keep it align. Suggested-by: Mike Rapoport (IBM) Co-developed-by: Kefeng Wang Signed-off-by: Kefeng Wang Signed-off-by: Yuwei Guan Link: https://lore.kernel.org/r/20230601133149.37160-1-ssawgyw@gmail.com Signed-off-by: Mike Rapoport (IBM) commit a395b8d1c7c3a074bfa83b9759a4a11901a295c5 Author: Zhengchao Shao Date: Thu Jun 1 09:22:50 2023 +0800 selftests/tc-testing: replace mq with invalid parent ID The test case shown in [1] triggers the kernel to access the null pointer. Therefore, add related test cases to mq. The test results are as follows: ./tdc.py -e 0531 1..1 ok 1 0531 - Replace mq with invalid parent ID ./tdc.py -c mq 1..8 ok 1 ce7d - Add mq Qdisc to multi-queue device (4 queues) ok 2 2f82 - Add mq Qdisc to multi-queue device (256 queues) ok 3 c525 - Add duplicate mq Qdisc ok 4 128a - Delete nonexistent mq Qdisc ok 5 03a9 - Delete mq Qdisc twice ok 6 be0f - Add mq Qdisc to single-queue device ok 7 1023 - Show mq class ok 8 0531 - Replace mq with invalid parent ID [1] https://lore.kernel.org/all/20230527093747.3583502-1-shaozhengchao@huawei.com/ Signed-off-by: Zhengchao Shao Reviewed-by: Pedro Tammela Link: https://lore.kernel.org/r/20230601012250.52738-1-shaozhengchao@huawei.com Signed-off-by: Jakub Kicinski commit e8b6f79b41840c542b7ef45c16b31dd17e1cc6e1 Author: Florian Fainelli Date: Wed May 31 16:17:29 2023 -0700 net: phy: broadcom: Add LPI counter Add the ability to read the PHY maintained LPI counter which is in the Clause 45 vendor space, device address 7, offset 0x803F. The counter is cleared on read. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230531231729.1873932-1-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski commit 733b3e27650b1bbce3c21fcfdb4fca22063efd66 Author: Heiner Kallweit Date: Wed May 31 22:41:32 2023 +0200 r8169: use dev_err_probe in all appropriate places in rtl_init_one() In addition to properly handling probe deferrals dev_err_probe() conveniently combines printing an error message with returning the errno. So let's use it for every error path in rtl_init_one() to simplify the code. Signed-off-by: Heiner Kallweit Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/f0596a19-d517-e301-b649-304f9247b75a@gmail.com Signed-off-by: Jakub Kicinski commit b345b2a6cb96583aa695226cb8961803dbbdd27c Merge: 5ff9424ea03a1 bd415f6c748ec Author: Jakub Kicinski Date: Thu Jun 1 21:38:32 2023 -0700 Merge branch 'extend-dt-bindings-for-pse-pd-controllers-and-update-prtt1c-dts' Oleksij Rempel says: ==================== Extend dt-bindings for PSE-PD controllers and update prtt1c dts This patch set comes in response to issues identified while adding PoDL PSE support to the stm32 prtt1c device tree. The existing pse-pd device tree bindings did not allow node name patterns like "ethernet-pse-0" and "ethernet-pse-1", leading to validation failures. To address these false positives in validation, the device tree bindings are extended to support these node name patterns. Alongside this, an example node is added to aid in the improved validation process. ==================== Link: https://lore.kernel.org/r/20230531102113.3353065-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit bd415f6c748ec3ca0017f9a6f23a5c02900eb6d2 Author: Oleksij Rempel Date: Wed May 31 12:21:12 2023 +0200 dt-bindings: net: pse-pd: Allow -N suffix for ethernet-pse node names Extend the pattern matching for PSE-PD controller nodes to allow -N suffixes. This enables the use of multiple "ethernet-pse" nodes without the need for a "reg" property. Signed-off-by: Oleksij Rempel Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 5ff9424ea03a1fce2298b271eec1dad5ff4df1be Author: Jiri Pirko Date: Wed May 31 16:20:25 2023 +0200 devlink: bring port new reply back In the offending fixes commit I mistakenly removed the reply message of the port new command. I was under impression it is a new port notification, partly due to the "notify" in the name of the helper function. Bring the code sending reply with new port message back, this time putting it directly to devlink_nl_cmd_port_new_doit() Fixes: c496daeb8630 ("devlink: remove duplicate port notification") Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230531142025.2605001-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 2e1492835e439fceba57a5b0f9b17da8e78ffa3d Merge: 85d712f033d23 43049f17b5262 Author: Dave Airlie Date: Fri Jun 2 13:38:48 2023 +1000 Merge tag 'drm-misc-next-2023-06-01' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v6.5: UAPI Changes: Cross-subsystem Changes: * fbdev: * Add Kconfig options and initializer macros for file I/O, convert DRM fbdev emulation Core Changes: * Unify handling of struct file_operations.show_fdinfo * Use .probe in all i2c code (interface cleanup) * TTM: * Remove unused code Driver Changes: * amdgpu: * Use shared show_fdinfo code * Fix building without procfs * bridge: * display-conenctor: Add support for external power supply * samsung-dsim: Fix enabling; Support variable clocking * tc358767: Fixes * ti-sn65dsi83: Fix enabling * msm: * Use shared show_fdinfo code * msxfb: * Add support for i.MX93 LCDIF * panel: * Add support for Ampire AM-800480L1TMQW-T00H plus DT bindings * panel-edp: Convert .remove to return void * stm: * dsi: Use devm_ helper * ltdc: Fix potential invalid pointer deref Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230601112246.GA10882@linux-uq9g commit 1baeef6cd2229e01091c69cef042f6b688e194be Author: Nathan Chancellor Date: Tue May 30 11:24:39 2023 -0700 drm/i915/gt: Fix parameter in gmch_ggtt_insert_{entries, page}() When building with clang's -Wincompatible-function-pointer-types-strict, the following warnings occur: drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c:102:23: error: incompatible function pointer types assigning to 'void (*)(struct i915_address_space *, dma_addr_t, u64, unsigned int, u32)' (aka 'void (*)(struct i915_address_space *, unsigned int, unsigned long long, unsigned int, unsigned int)') from 'void (struct i915_address_space *, dma_addr_t, u64, enum i915_cache_level, u32)' (aka 'void (struct i915_address_space *, unsigned int, unsigned long long, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict] ggtt->vm.insert_page = gmch_ggtt_insert_page; ^ ~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c:103:26: error: incompatible function pointer types assigning to 'void (*)(struct i915_address_space *, struct i915_vma_resource *, unsigned int, u32)' (aka 'void (*)(struct i915_address_space *, struct i915_vma_resource *, unsigned int, unsigned int)') from 'void (struct i915_address_space *, struct i915_vma_resource *, enum i915_cache_level, u32)' (aka 'void (struct i915_address_space *, struct i915_vma_resource *, enum i915_cache_level, unsigned int)') [-Werror, -Wincompatible-function-pointer-types-strict] ggtt->vm.insert_entries = gmch_ggtt_insert_entries; ^ ~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. The warning is pointing out that while 'enum i915_cache_level' and 'unsigned int' are ABI compatible, these indirect calls will fail clang's kernel Control Flow Integrity (kCFI) checks, as the callback's signature does not exactly match the prototype's signature. To fix this, replace the cache_level parameter with pat_index, as was done in other places within i915 where there is no difference between cache_level and pat_index on certain generations. Fixes: 9275277d5324 ("drm/i915: use pat_index instead of cache_level") Signed-off-by: Nathan Chancellor Reviewed-by: Andi Shyti Reviewed-by: Fei Yang Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230530-i915-gt-cache_level-wincompatible-function-pointer-types-strict-v1-2-54501d598229@kernel.org commit 4722e2ebe6f2168309b285977c5c96baf910c57b Author: Nathan Chancellor Date: Tue May 30 11:24:38 2023 -0700 drm/i915/gt: Fix second parameter type of pre-gen8 pte_encode callbacks When booting a kernel compiled with CONFIG_CFI_CLANG (kCFI), there is a CFI failure in ggtt_probe_common() when trying to call hsw_pte_encode() via an indirect call: [ 5.030027] CFI failure at ggtt_probe_common+0xd1/0x130 [i915] (target: hsw_pte_encode+0x0/0x30 [i915]; expected type: 0xf5c1d0fc) With kCFI, indirect calls are validated against their expected type versus actual type and failures occur when the two types do not match. clang's -Wincompatible-function-pointer-types-strict can catch this at compile time but it is not enabled for the kernel yet: drivers/gpu/drm/i915/gt/intel_ggtt.c:1155:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t, enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict] ggtt->vm.pte_encode = iris_pte_encode; ^ ~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/gt/intel_ggtt.c:1157:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t, enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict] ggtt->vm.pte_encode = hsw_pte_encode; ^ ~~~~~~~~~~~~~~ drivers/gpu/drm/i915/gt/intel_ggtt.c:1159:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t, enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict] ggtt->vm.pte_encode = byt_pte_encode; ^ ~~~~~~~~~~~~~~ drivers/gpu/drm/i915/gt/intel_ggtt.c:1161:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t, enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict] ggtt->vm.pte_encode = ivb_pte_encode; ^ ~~~~~~~~~~~~~~ drivers/gpu/drm/i915/gt/intel_ggtt.c:1163:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t, enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict] ggtt->vm.pte_encode = snb_pte_encode; ^ ~~~~~~~~~~~~~~ 5 errors generated. In this case, the pre-gen8 pte_encode functions have a second parameter type of 'enum i915_cache_level' whereas the function pointer prototype in 'struct i915_address_space' expects a second parameter type of 'unsigned int'. Update the second parameter of the callbacks and the comment above them noting that these statements are still valid, which matches other functions and files, to clear up the kCFI failures at run time. Fixes: 9275277d5324 ("drm/i915: use pat_index instead of cache_level") Signed-off-by: Nathan Chancellor Reviewed-by: Andi Shyti Reviewed-by: Fei Yang Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230530-i915-gt-cache_level-wincompatible-function-pointer-types-strict-v1-1-54501d598229@kernel.org commit a519a612a71848b69b70b18b4d14d165b2d8aaf7 Author: Chengchang Tang Date: Tue May 23 20:16:41 2023 +0800 RDMA/hns: Add clear_hem return value to log Log return value of clear_hem() to help diagnose. Link: https://lore.kernel.org/r/20230523121641.3132102-4-huangjunxian6@hisilicon.com Signed-off-by: Chengchang Tang Signed-off-by: Junxian Huang Signed-off-by: Jason Gunthorpe commit cf5b608fb0e369c473a8303cad6ddb386505e5b8 Author: Chengchang Tang Date: Tue May 23 20:16:40 2023 +0800 RDMA/hns: Fix hns_roce_table_get return value The return value of set_hem has been fixed to ENODEV, which will lead a diagnostic information missing. Fixes: 9a4435375cd1 ("IB/hns: Add driver files for hns RoCE driver") Link: https://lore.kernel.org/r/20230523121641.3132102-3-huangjunxian6@hisilicon.com Signed-off-by: Chengchang Tang Signed-off-by: Junxian Huang Signed-off-by: Jason Gunthorpe commit b9989ab3f61ec459cbaf0a492fea3168bbfa4c7a Author: Junxian Huang Date: Tue May 23 20:16:39 2023 +0800 RDMA/hns: Remove unnecessary QP type checks It is not necessary to check the type of the queue on IO path because unsupported QP type cannot be created. Link: https://lore.kernel.org/r/20230523121641.3132102-2-huangjunxian6@hisilicon.com Signed-off-by: Chengchang Tang Signed-off-by: Junxian Huang Signed-off-by: Jason Gunthorpe commit a03a91bd68cb00c615e602cf605e6be12bedaa90 Merge: 4ff3dfc91c845 714069daa5d34 Author: Jakub Kicinski Date: Thu Jun 1 15:33:03 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. No conflicts. Adjacent changes: drivers/net/ethernet/sfc/tc.c 622ab656344a ("sfc: fix error unwinds in TC offload") b6583d5e9e94 ("sfc: support TC decap rules matching on enc_src_port") net/mptcp/protocol.c 5b825727d087 ("mptcp: add annotations around msk->subflow accesses") e76c8ef5cc5b ("mptcp: refactor mptcp_stream_accept()") Signed-off-by: Jakub Kicinski commit 0a9f15fd56742b785ba4d06e64976f1f700b807c Author: Quentin Perret Date: Tue May 23 11:18:27 2023 +0100 KVM: arm64: pkvm: Add support for fragmented FF-A descriptors FF-A memory descriptors may need to be sent in fragments when they don't fit in the mailboxes. Doing so involves using the FRAG_TX and FRAG_RX primitives defined in the FF-A protocol. Add support in the pKVM FF-A relayer for fragmented descriptors by monitoring outgoing FRAG_TX transactions and by buffering large descriptors on the reclaim path. Co-developed-by: Andrew Walbran Signed-off-by: Andrew Walbran Signed-off-by: Quentin Perret Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20230523101828.7328-11-will@kernel.org Signed-off-by: Oliver Upton commit 20936cd11479709ccd5de2dc77ac8063cd9bfad8 Author: Fuad Tabba Date: Tue May 23 11:18:26 2023 +0100 KVM: arm64: Handle FFA_FEATURES call from the host Filter out advertising unsupported features, and only advertise features and properties that are supported by the hypervisor proxy. Signed-off-by: Fuad Tabba Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20230523101828.7328-10-will@kernel.org Signed-off-by: Oliver Upton commit 634d90cf0ac6562f121a4acd4caec36d695d6aa2 Author: Will Deacon Date: Tue May 23 11:18:25 2023 +0100 KVM: arm64: Handle FFA_MEM_LEND calls from the host Handle FFA_MEM_LEND calls from the host by treating them identically to FFA_MEM_SHARE calls for the purposes of the host stage-2 page-table, but forwarding on the original request to EL3. Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20230523101828.7328-9-will@kernel.org Signed-off-by: Oliver Upton commit 0e3bcb49c13567adb821c4251dcfd04ad7e1179f Author: Will Deacon Date: Tue May 23 11:18:24 2023 +0100 KVM: arm64: Handle FFA_MEM_RECLAIM calls from the host Intecept FFA_MEM_RECLAIM calls from the host and transition the host stage-2 page-table entries from the SHARED_OWNED state back to the OWNED state once EL3 has confirmed that the secure mapping has been reclaimed. Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20230523101828.7328-8-will@kernel.org Signed-off-by: Oliver Upton commit 43609000177625b1c93c55a16a07aee5a4258260 Author: Will Deacon Date: Tue May 23 11:18:23 2023 +0100 KVM: arm64: Handle FFA_MEM_SHARE calls from the host Intercept FFA_MEM_SHARE/FFA_FN64_MEM_SHARE calls from the host and transition the host stage-2 page-table entries from the OWNED state to the SHARED_OWNED state prior to forwarding the call onto EL3. Co-developed-by: Andrew Walbran Signed-off-by: Andrew Walbran Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20230523101828.7328-7-will@kernel.org Signed-off-by: Oliver Upton commit f9112eade788439d721ca3032369fb4bf4c7e222 Author: Will Deacon Date: Tue May 23 11:18:22 2023 +0100 KVM: arm64: Add FF-A helpers to share/unshare memory with secure world Extend pKVM's memory protection code so that we can update the host's stage-2 page-table to track pages shared with secure world by the host using FF-A and prevent those pages from being mapped into a guest. Co-developed-by: Andrew Walbran Signed-off-by: Andrew Walbran Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20230523101828.7328-6-will@kernel.org Signed-off-by: Oliver Upton commit 9d0c6a9af9e38efa675e565bd181794deca1188a Author: Will Deacon Date: Tue May 23 11:18:21 2023 +0100 KVM: arm64: Handle FFA_RXTX_MAP and FFA_RXTX_UNMAP calls from the host Handle FFA_RXTX_MAP and FFA_RXTX_UNMAP calls from the host by sharing the host's mailbox memory with the hypervisor and establishing a separate pair of mailboxes between the hypervisor and the SPMD at EL3. Co-developed-by: Andrew Walbran Signed-off-by: Andrew Walbran Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20230523101828.7328-5-will@kernel.org Signed-off-by: Oliver Upton commit bc3888a0f4e979ecf9dd8c33a84b8da8cc130790 Author: Will Deacon Date: Tue May 23 11:18:20 2023 +0100 KVM: arm64: Allocate pages for hypervisor FF-A mailboxes The FF-A proxy code needs to allocate its own buffer pair for communication with EL3 and for forwarding calls from the host at EL1. Reserve a couple of pages for this purpose and use them to initialise the hypervisor's FF-A buffer structure. Co-developed-by: Andrew Walbran Signed-off-by: Andrew Walbran Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20230523101828.7328-4-will@kernel.org Signed-off-by: Oliver Upton commit 12bdce4f41197a1a97ba1c711f77d557841e13d9 Author: Will Deacon Date: Tue May 23 11:18:19 2023 +0100 KVM: arm64: Probe FF-A version and host/hyp partition ID during init Probe FF-A during pKVM initialisation so that we can detect any inconsistencies in the version or partition ID early on. Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20230523101828.7328-3-will@kernel.org Signed-off-by: Oliver Upton commit 048be5fea43deef7e96c0de5ba05515c5cbe28cb Author: Will Deacon Date: Tue May 23 11:18:18 2023 +0100 KVM: arm64: Block unsafe FF-A calls from the host When KVM is initialised in protected mode, we must take care to filter certain FFA calls from the host kernel so that the integrity of guest and hypervisor memory is maintained and is not made available to the secure world. As a first step, intercept and block all memory-related FF-A SMC calls from the host to EL3 and don't advertise any FF-A features. This puts the framework in place for handling them properly. Co-developed-by: Andrew Walbran Signed-off-by: Andrew Walbran Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20230523101828.7328-2-will@kernel.org Signed-off-by: Oliver Upton commit 331f229768160dceec5b5694ea32ecf66e2e2452 Author: Jon Kohler Date: Wed May 31 11:58:21 2023 -0400 KVM: VMX: restore vmx_vmexit alignment Commit 8bd200d23ec4 ("KVM: VMX: Flatten __vmx_vcpu_run()") changed vmx_vmexit from SYM_FUNC_START to SYM_INNER_LABEL, accidentally removing 16 byte alignment as SYM_FUNC_START uses SYM_A_ALIGN and SYM_INNER_LABEL does not. Josh mentioned [1] this was unintentional. Fix by changing to SYM_INNER_LABEL_ALIGN instead. [1] https://lore.kernel.org/lkml/Y3adkSe%2FJ70PqUyt@p183 Fixes: 8bd200d23ec4 ("KVM: VMX: Flatten __vmx_vcpu_run()") Signed-off-by: Jon Kohler Suggested-by: Alexey Dobriyan CC: Josh Poimboeuf Acked-by: Josh Poimboeuf Reviewed-by: Jim Mattson Link: https://lore.kernel.org/r/20230531155821.80590-1-jon@nutanix.com Signed-off-by: Sean Christopherson commit 2c76131319982f9c9410bc12127ac1df4e810b87 Author: Sean Christopherson Date: Fri May 26 14:03:40 2023 -0700 KVM: selftests: Extend cpuid_test to verify KVM_GET_CPUID2 "nent" updates Verify that KVM reports the actual number of CPUID entries on success, but doesn't touch the userspace struct on failure (which for better or worse, is KVM's ABI). Link: https://lore.kernel.org/r/20230526210340.2799158-3-seanjc@google.com Signed-off-by: Sean Christopherson commit ab322c43cce97ff6d05439c9b72bf1513e3e1020 Author: Sean Christopherson Date: Fri May 26 14:03:39 2023 -0700 KVM: x86: Update number of entries for KVM_GET_CPUID2 on success, not failure Update cpuid->nent if and only if kvm_vcpu_ioctl_get_cpuid2() succeeds. The sole caller copies @cpuid to userspace only on success, i.e. the existing code effectively does nothing. Arguably, KVM should report the number of entries when returning -E2BIG so that userspace doesn't have to guess the size, but all other similar KVM ioctls() don't report the size either, i.e. userspace is conditioned to guess. Suggested-by: Takahiro Itazuri Link: https://lore.kernel.org/all/20230410141820.57328-1-itazur@amazon.com Link: https://lore.kernel.org/r/20230526210340.2799158-2-seanjc@google.com Signed-off-by: Sean Christopherson commit 33ab767c2628136c54c2e2160e4c536c7db9c6d0 Author: Jinrong Liang Date: Tue Apr 11 21:03:38 2023 +0800 KVM: x86/pmu: Remove redundant check for MSR_IA32_DS_AREA set handler After commit 2de154f541fc ("KVM: x86/pmu: Provide "error" semantics for unsupported-but-known PMU MSRs"), the guest_cpuid_has(DS) check is not necessary any more since if the guest supports X86_FEATURE_DS, it never returns 1. And if the guest does not support this feature, the set_msr handler will get false from kvm_pmu_is_valid_msr() before reaching this point. Therefore, the check will not be true in all cases and can be safely removed, which also simplifies the code and improves its readability. Signed-off-by: Jinrong Liang Link: https://lore.kernel.org/r/20230411130338.8592-1-cloudliang@tencent.com Signed-off-by: Sean Christopherson commit dfa78a20cc879205b2c6239300dac09907ad3da1 Author: Ben Gardon Date: Tue Jan 31 18:18:20 2023 +0000 KVM: selftests: Add dirty logging page splitting test Add a test for page splitting during dirty logging and for hugepage recovery after dirty logging. Page splitting represents non-trivial behavior, which is complicated by MANUAL_PROTECT mode, which causes pages to be split on the first clear, instead of when dirty logging is enabled. Add a test which makes assertions about page counts to help define the expected behavior of page splitting and to provide needed coverage of the behavior. This also helps ensure that a failure in eager page splitting is not covered up by splitting in the vCPU path. Tested by running the test on an Intel Haswell machine w/wo MANUAL_PROTECT. Reviewed-by: Vipin Sharma Signed-off-by: Ben Gardon Link: https://lore.kernel.org/r/20230131181820.179033-3-bgardon@google.com [sean: let the user run without hugetlb, as suggested by Paolo] Signed-off-by: Sean Christopherson commit de10b798055db5df93474cdfa5dbffc57169f458 Author: Ben Gardon Date: Tue Jan 31 18:18:19 2023 +0000 KVM: selftests: Move dirty logging functions to memstress.(c|h) Move some helper functions from dirty_log_perf_test.c to the memstress library so that they can be used in a future commit which tests page splitting during dirty logging. Reviewed-by: Vipin Sharma Signed-off-by: Ben Gardon Link: https://lore.kernel.org/r/20230131181820.179033-2-bgardon@google.com Signed-off-by: Sean Christopherson commit 07b4b2f4047f600ca7974797900b7409081f826c Author: Paolo Bonzini Date: Wed Apr 12 16:09:13 2023 -0400 KVM: selftests: touch all pages of args on each memstress iteration Access the same memory addresses on each iteration of the memstress guest code. This ensures that the state of KVM's page tables is the same after every iteration, including the pages that host the guest page tables for args and vcpu_args. This difference is visible when running the proposed dirty_log_page_splitting_test[*] on AMD, or on Intel with pml=0 and eptad=0. The tests fail due to different semantics of dirty bits for page-table pages on AMD (and eptad=0) and Intel. Both AMD and Intel with eptad=0 treat page-table accesses as writes, therefore more pages are dropped before the repopulation phase when dirty logging is disabled. The "missing" page had been included in the population phase because it hosts the page tables for vcpu_args, but repopulation does not need it." Signed-off-by: Paolo Bonzini Reviewed-by: Vipin Sharma Link: https://lore.kernel.org/r/20230412200913.1570873-1-pbonzini@redhat.com [sean: add additional details in changelog] Signed-off-by: Sean Christopherson commit 70b0bc4c0a05cb68ffeeaba8c8340896b5ff6fd7 Author: Michal Luczaj Date: Mon Mar 27 19:54:57 2023 +0200 KVM: Don't kfree(NULL) on kzalloc() failure in kvm_assign_ioeventfd_idx() On kzalloc() failure, taking the `goto fail` path leads to kfree(NULL). Such no-op has no use. Move it out. Signed-off-by: Michal Luczaj Reviewed-by: Sean Christopherson Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20230327175457.735903-1-mhal@rbox.co Signed-off-by: Sean Christopherson commit 0d42522bdee70b9197be63dd76c9f6297cd1e832 Author: Jinliang Zheng Date: Wed Apr 19 10:19:25 2023 +0800 KVM: x86: Fix poll command According to the hardware manual, when the Poll command is issued, the byte returned by the I/O read is 1 in Bit 7 when there is an interrupt, and the highest priority binary code in Bits 2:0. The current pic simulation code is not implemented strictly according to the above expression. Fix the implementation of pic_poll_read(), set Bit 7 when there is an interrupt. Signed-off-by: Jinliang Zheng Link: https://lore.kernel.org/r/20230419021924.1342184-1-alexjlzheng@tencent.com Signed-off-by: Sean Christopherson commit dee321977a230802a5065af4ad4f4f5e8558a738 Author: Sean Christopherson Date: Thu May 11 16:33:51 2023 -0700 KVM: x86: Move common handling of PAT MSR writes to kvm_set_msr_common() Move the common check-and-set handling of PAT MSR writes out of vendor code and into kvm_set_msr_common(). This aligns writes with reads, which are already handled in common code, i.e. makes the handling of reads and writes symmetrical in common code. Alternatively, the common handling in kvm_get_msr_common() could be moved to vendor code, but duplicating code is generally undesirable (even though the duplicatated code is trivial in this case), and guest writes to PAT should be rare, i.e. the overhead of the extra function call is a non-issue in practice. Suggested-by: Kai Huang Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230511233351.635053-9-seanjc@google.com Signed-off-by: Sean Christopherson commit 3a5f49078eb5106f9b918066908508c3044b5ada Author: Sean Christopherson Date: Thu May 11 16:33:50 2023 -0700 KVM: x86: Make kvm_mtrr_valid() static now that there are no external users Make kvm_mtrr_valid() local to mtrr.c now that it's not used to check the validity of a PAT MSR value. Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230511233351.635053-8-seanjc@google.com Signed-off-by: Sean Christopherson commit bc7fe2f0b7511ef6bb2765b6e1f923da449e00ef Author: Sean Christopherson Date: Thu May 11 16:33:49 2023 -0700 KVM: x86: Move PAT MSR handling out of mtrr.c Drop handling of MSR_IA32_CR_PAT from mtrr.c now that SVM and VMX handle writes without bouncing through kvm_set_msr_common(). PAT isn't truly an MTRR even though it affects memory types, and more importantly KVM enables hardware virtualization of guest PAT (by NOT setting "ignore guest PAT") when a guest has non-coherent DMA, i.e. KVM doesn't need to zap SPTEs when the guest PAT changes. The read path is and always has been trivial, i.e. burying it in the MTRR code does more harm than good. WARN and continue for the PAT case in kvm_set_msr_common(), as that code is _currently_ reached if and only if KVM is buggy. Defer cleaning up the lack of symmetry between the read and write paths to a future patch. Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230511233351.635053-7-seanjc@google.com Signed-off-by: Sean Christopherson commit 34a83deac31cd9fdecef331578422095af2db4b0 Author: Sean Christopherson Date: Thu May 11 16:33:48 2023 -0700 KVM: x86: Use MTRR macros to define possible MTRR MSR ranges Use the MTRR macros to identify the ranges of possible MTRR MSRs instead of bounding the ranges with a mismash of open coded values and unrelated MSR indices. Carving out the gap for the machine check MSRs in particular is confusing, as it's easy to incorrectly think the case statement handles MCE MSRs instead of skipping them. Drop the range-based funneling of MSRs between the end of the MCE MSRs and MTRR_DEF_TYPE, i.e. 0x2A0-0x2FF, and instead handle MTTR_DEF_TYPE as the one-off case that it is. Extract PAT (0x277) as well in anticipation of dropping PAT "handling" from the MTRR code. Keep the range-based handling for the variable+fixed MTRRs even though capturing unknown MSRs 0x214-0x24F is arguably "wrong". There is a gap in the fixed MTRRs, 0x260-0x267, i.e. the MTRR code needs to filter out unknown MSRs anyways, and using a single range generates marginally better code for the big switch statement. Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230511233351.635053-6-seanjc@google.com Signed-off-by: Sean Christopherson commit 9ae38b4fb13597ce1821376d23958bbe4976c759 Author: Sean Christopherson Date: Thu May 11 16:33:47 2023 -0700 KVM: x86: Add helper to get variable MTRR range from MSR index Add a helper to dedup the logic for retrieving a variable MTRR range structure given a variable MTRR MSR index. No functional change intended. Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230511233351.635053-5-seanjc@google.com Signed-off-by: Sean Christopherson commit ebda79e5057778be1ad8ed072e4229894dfc66b7 Author: Sean Christopherson Date: Thu May 11 16:33:46 2023 -0700 KVM: x86: Add helper to query if variable MTRR MSR is base (versus mask) Add a helper to query whether a variable MTRR MSR is a base versus as mask MSR. Replace the unnecessarily complex math with a simple check on bit 0; base MSRs are even, mask MSRs are odd. Link: https://lore.kernel.org/r/20230511233351.635053-4-seanjc@google.com Signed-off-by: Sean Christopherson commit 7aeae027611ff27f13a32e19736c8fd06e41786c Author: Ke Guo Date: Thu May 11 16:33:45 2023 -0700 KVM: SVM: Use kvm_pat_valid() directly instead of kvm_mtrr_valid() Use kvm_pat_valid() directly instead of bouncing through kvm_mtrr_valid(). The PAT is not an MTRR, and kvm_mtrr_valid() just redirects to kvm_pat_valid(), i.e. is exempt from KVM's "zap SPTEs" logic that's needed to honor guest MTRRs when the VM has a passthrough device with non-coherent DMA (KVM does NOT set "ignore guest PAT" in this case, and so enables hardware virtualization of the guest's PAT, i.e. doesn't need to manually emulate the PAT memtype). Signed-off-by: Ke Guo [sean: massage changelog] Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230511233351.635053-3-seanjc@google.com Signed-off-by: Sean Christopherson commit a33ba1bf0dc6082227d1ddf964632e07b53b8971 Author: Wenyao Hai Date: Thu May 11 16:33:44 2023 -0700 KVM: VMX: Open code writing vCPU's PAT in VMX's MSR handler Open code setting "vcpu->arch.pat" in vmx_set_msr() instead of bouncing through kvm_set_msr_common() to get to the same code in kvm_mtrr_set_msr(). This aligns VMX with SVM, avoids hiding a very simple operation behind a relatively complicated function call (finding the PAT MSR case in kvm_set_msr_common() is non-trivial), and most importantly, makes it clear that not unwinding the VMCS updates if kvm_set_msr_common() isn't a bug (because kvm_set_msr_common() can never fail for PAT). Opportunistically set vcpu->arch.pat before updating the VMCS info so that a future patch can move the common bits (back) into kvm_set_msr_common() without a functional change. Note, MSR_IA32_CR_PAT is 0x277, and is very subtly handled by case 0x200 ... MSR_IA32_MC0_CTL2 - 1: in kvm_set_msr_common(). Cc: Kai Huang Signed-off-by: Wenyao Hai [sean: massage changelog, hoist setting vcpu->arch.pat up] Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230511233351.635053-2-seanjc@google.com Signed-off-by: Sean Christopherson commit 0d3518d2f8c3c432270e3eff56e28ae6c0cedfac Author: Mingwei Zhang Date: Tue May 23 16:56:35 2023 +0000 KVM: SVM: Remove TSS reloading code after VMEXIT Remove the dedicated post-VMEXIT TSS reloading code now that KVM uses VMLOAD to load host segment state, which includes TSS state. Fixes: e79b91bb3c91 ("KVM: SVM: use vmsave/vmload for saving/restoring additional host state") Reported-by: Venkatesh Srinivas Suggested-by: Jim Mattson Signed-off-by: Mingwei Zhang Link: https://lore.kernel.org/r/20230523165635.4002711-1-mizhang@google.com [sean: massage changelog] Signed-off-by: Sean Christopherson commit c9d601548603c54919a3b1333c5b972252b4031d Author: Wei Wang Date: Tue Mar 7 21:52:33 2023 +0800 KVM: allow KVM_BUG/KVM_BUG_ON to handle 64-bit cond Current KVM_BUG and KVM_BUG_ON assume that 'cond' passed from callers is 32-bit as it casts 'cond' to the type of int. This will be wrong if 'cond' provided by a caller is 64-bit, e.g. an error code of 0xc0000d0300000000 will be converted to 0, which is not expected. Improves the implementation by using bool in KVM_BUG and KVM_BUG_ON. 'bool' is preferred to 'int' as __ret is essentially used as a boolean and coding-stytle.rst documents that use of bool is encouraged to improve readability and is often a better option than 'int' for storing boolean values. Fixes: 0b8f11737cff ("KVM: Add infrastructure and macro to mark VM as bugged") Signed-off-by: Wei Wang Reviewed-by: Mingwei Zhang Reviewed-by: Sean Christopherson Link: https://lore.kernel.org/r/20230307135233.54684-1-wei.w.wang@intel.com Signed-off-by: Sean Christopherson commit fe8e04348727f992f6fce3709639fb6d92a81137 Author: Namhyung Kim Date: Wed May 31 13:32:36 2023 -0700 perf script: Increase PID/TID width for output On large systems, it's common that PID/TID is bigger than 5-digit and it makes the output unaligned. Let's increase the width to 7. Before: $ perf script ... swapper 0 [006] 1540823.803935: 1369324 cycles:P: ffffffff9c755588 ktime_get+0x18 ([kernel.kallsyms]) gvfsd-dnssd 95114 [004] 1540823.804164: 1643871 cycles:P: ffffffff9cfdca5c __get_user_8+0x1c ([kernel.kallsyms]) perf-exec 1558582 [000] 1540823.804209: 1018714 cycles:P: ffffffff9c924ab9 __slab_free+0x9 ([kernel.kallsyms]) nmcli 1558589 [007] 1540823.804384: 1859212 cycles:P: 7f70537a8ad8 __strchrnul_evex+0x18 (/usr/lib/x86_64-linux-gnu/libc.so.6> sleep 1558582 [000] 1540823.804456: 987425 cycles:P: 7fd35bb27b30 _dl_init+0x0 (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2> dbus-daemon 3043 [003] 1540823.804575: 1564465 cycles:P: ffffffff9cb2bb70 llist_add_batch+0x0 ([kernel.kallsyms]) gdbus 1558592 [001] 1540823.804766: 1315219 cycles:P: ffffffff9c797b2e audit_filter_syscall+0x9e ([kernel.kallsyms]) NetworkManager 3452 [005] 1540823.805301: 1558782 cycles:P: 7fa957737748 g_bit_lock+0x58 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7400.5> After: $ perf script ... swapper 0 [006] 1540823.803935: 1369324 cycles:P: ffffffff9c755588 ktime_get+0x18 ([kernel.kallsyms]) gvfsd-dnssd 95114 [004] 1540823.804164: 1643871 cycles:P: ffffffff9cfdca5c __get_user_8+0x1c ([kernel.kallsyms]) perf-exec 1558582 [000] 1540823.804209: 1018714 cycles:P: ffffffff9c924ab9 __slab_free+0x9 ([kernel.kallsyms]) nmcli 1558589 [007] 1540823.804384: 1859212 cycles:P: 7f70537a8ad8 __strchrnul_evex+0x18 (/usr/lib/x86_64-linux-gnu/libc.so.6> sleep 1558582 [000] 1540823.804456: 987425 cycles:P: 7fd35bb27b30 _dl_init+0x0 (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2> dbus-daemon 3043 [003] 1540823.804575: 1564465 cycles:P: ffffffff9cb2bb70 llist_add_batch+0x0 ([kernel.kallsyms]) gdbus 1558592 [001] 1540823.804766: 1315219 cycles:P: ffffffff9c797b2e audit_filter_syscall+0x9e ([kernel.kallsyms]) NetworkManager 3452 [005] 1540823.805301: 1558782 cycles:P: 7fa957737748 g_bit_lock+0x58 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7400.5> Reviewer notes: Adrian added: "Might be worth noting that currently the biggest PID_MAX_LIMIT is 2^22 so pids don't get bigger than 7 digits presently" $ echo $((2 ** 22)) 4194304 $ echo -n $((2 ** 22)) | wc -c 7 $ Signed-off-by: Namhyung Kim Acked-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Ian Rogers Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20230531203236.1602054-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b9f010328c0f5af017b0fb9ca24a5c531bc3c682 Author: Ian Rogers Date: Wed May 31 19:36:44 2023 -0700 perf pmu: Warn about invalid config for all PMUs and configs Don't just check the raw PMU type, the only core PMU on homogeneous x86, check raw and all dynamically added PMUs. Extend the perf_pmu__warn_invalid_config to check all 4 config values. Rather than process the format list once per event, store the computed masks for each config value. Don't ignore the mask being zero, which is likely for config2 and config3, add config_masks_present so config values can be ignored only when no format information is present. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Peter Zijlstra Cc: Rob Herring Cc: Suzuki Poulouse Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230601023644.587584-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 68c250434125f94dddcff7e9faf392fa96773ac3 Author: Ian Rogers Date: Wed May 31 19:36:43 2023 -0700 perf pmu: Only warn about unsupported formats once Avoid scanning format list for each event parsed. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Peter Zijlstra Cc: Rob Herring Cc: Suzuki Poulouse Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230601023644.587584-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 4f325e26277b6a1381235008ca6fa97e6cc8f43b Author: Julian Anastasov Date: Wed May 17 15:37:31 2023 +0300 ipvs: dynamically limit the connection hash table As we allow the hash table to be configured to rows above 2^20, we should limit it depending on the available memory to some sane values. Switch to kvmalloc allocation to better select the needed allocation type. Signed-off-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso commit 04292c695f82b6cf0d25dd5ae494f16ddbb621f6 Author: Abhijeet Rastogi Date: Tue May 16 20:08:49 2023 -0700 ipvs: increase ip_vs_conn_tab_bits range for 64BIT Current range [8, 20] is set purely due to historical reasons because at the time, ~1M (2^20) was considered sufficient. With this change, 27 is the upper limit for 64-bit, 20 otherwise. Previous change regarding this limit is here. Link: https://lore.kernel.org/all/86eabeb9dd62aebf1e2533926fdd13fed48bab1f.1631289960.git.aclaudi@redhat.com/T/#u Signed-off-by: Abhijeet Rastogi Acked-by: Julian Anastasov Acked-by: Simon Horman Signed-off-by: Pablo Neira Ayuso commit 260755184cbdb267a046e7ffd397c1d2ba09bb5e Author: David Gow Date: Wed May 31 13:21:57 2023 +0800 kunit: Move kunit_abort() call out of kunit_do_failed_assertion() KUnit aborts the current thread when an assertion fails. Currently, this is done conditionally as part of the kunit_do_failed_assertion() function, but this hides the kunit_abort() call from the compiler (particularly if it's in another module). This, in turn, can lead to both suboptimal code generation (the compiler can't know if kunit_do_failed_assertion() will return), and to static analysis tools like smatch giving false positives. Moving the kunit_abort() call into the macro should give the compiler and tools a better chance at understanding what's going on. Doing so requires exporting kunit_abort(), though it's recommended to continue to use assertions in lieu of aborting directly. In addition, kunit_abort() and kunit_do_failed_assertion() are renamed to make it clear they they're intended for internal KUnit use, to: __kunit_do_failed_assertion() and __kunit_abort() Suggested-by: Dan Carpenter Signed-off-by: David Gow Reviewed-by: Miguel Ojeda Reviewed-by: Daniel Latypov Signed-off-by: Shuah Khan commit c042030aa15e9265504a034243a8cae062e900a1 Author: David Gow Date: Tue May 30 15:55:57 2023 +0800 kunit: Fix obsolete name in documentation headers (func->action) The kunit_add_action() and related functions named the kunit_action_t parameter 'func' in early drafts, which was later renamed to 'action' However, the doc comments were not properly updated. Fix these to avoid confusion and 'make htmldocs' warnings. Fixes: b9dce8a1ed3e ("kunit: Add kunit_add_action() to defer a call until test exit") Reported-by: Stephen Rothwell Closes: https://lore.kernel.org/lkml/20230530151840.16a56460@canb.auug.org.au/ Signed-off-by: David Gow Reviewed-by: Maxime Ripard Signed-off-by: Shuah Khan commit e338a05e76cab377c9227c1d4f591b5879d6062a Author: Martin Kurbanov Date: Fri May 19 16:04:02 2023 +0300 dt-bindings: leds: Add binding for AW200xx Add YAML devicetree binding for AWINIC AW20036/AW20052/AW20074 led driver. Signed-off-by: Martin Kurbanov Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230519130403.212479-2-mmkurbanov@sberdevices.ru Signed-off-by: Lee Jones commit 36a87f371b7a1b69584a40c873c0b62dc87d3f80 Author: Martin Kurbanov Date: Fri May 19 16:04:03 2023 +0300 leds: Add AW20xx driver This commit adds support for AWINIC AW20036/AW20054/AW20072 LED driver. This driver supports following AW200XX features: - Individual 64-level DIM currents Signed-off-by: Martin Kurbanov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230519130403.212479-3-mmkurbanov@sberdevices.ru Signed-off-by: Lee Jones commit 4ce1e94175696b8f5f6fa29f09f7ef56724ddc2a Author: Kees Cook Date: Tue May 30 17:34:15 2023 -0700 s390/purgatory: Do not use fortified string functions With the addition of -fstrict-flex-arrays=3, struct sha256_state's trailing array is no longer ignored by CONFIG_FORTIFY_SOURCE: struct sha256_state { u32 state[SHA256_DIGEST_SIZE / 4]; u64 count; u8 buf[SHA256_BLOCK_SIZE]; }; This means that the memcpy() calls with "buf" as a destination in sha256.c's code will attempt to perform run-time bounds checking, which could lead to calling missing functions, specifically a potential WARN_ONCE, which isn't callable from purgatory. Reported-by: Thorsten Leemhuis Closes: https://lore.kernel.org/lkml/175578ec-9dec-7a9c-8d3a-43f24ff86b92@leemhuis.info/ Bisected-by: "Joan Bruguera Micó" Fixes: df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Cc: Masahiro Yamada Cc: Linux Kernel Functional Testing Cc: Nathan Chancellor Cc: "Gustavo A. R. Silva" Cc: linux-s390@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20230531003414.never.050-kees@kernel.org commit 91218d7d708ed2f4b77323ca70a948b8334dd767 Author: Kees Cook Date: Tue May 30 17:33:48 2023 -0700 x86/purgatory: Do not use fortified string functions With the addition of -fstrict-flex-arrays=3, struct sha256_state's trailing array is no longer ignored by CONFIG_FORTIFY_SOURCE: struct sha256_state { u32 state[SHA256_DIGEST_SIZE / 4]; u64 count; u8 buf[SHA256_BLOCK_SIZE]; }; This means that the memcpy() calls with "buf" as a destination in sha256.c's code will attempt to perform run-time bounds checking, which could lead to calling missing functions, specifically a potential WARN_ONCE, which isn't callable from purgatory. Reported-by: Thorsten Leemhuis Closes: https://lore.kernel.org/lkml/175578ec-9dec-7a9c-8d3a-43f24ff86b92@leemhuis.info/ Bisected-by: "Joan Bruguera Micó" Fixes: df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: Nick Desaulniers Cc: Masahiro Yamada Cc: "Peter Zijlstra (Intel)" Cc: Alyssa Ross Cc: Sami Tolvanen Cc: Alexander Potapenko Signed-off-by: Kees Cook Tested-by: Thorsten Leemhuis Acked-by: Dave Hansen Link: https://lore.kernel.org/r/20230531003345.never.325-kees@kernel.org commit 41e7a72e1d3ca62560ec1ef1f4529e7a4c4ad8a3 Author: Wyes Karny Date: Tue May 23 16:18:15 2023 +0000 acpi: Replace struct acpi_table_slit 1-element array with flex-array struct acpi_table_slit is used for copying System Locality Information Table data from ACPI tables. Here `entry` is a flex array but it was using ancient 1-element fake flexible array, which has been deprecated. Replace it with a C99 flexible array. Signed-off-by: Wyes Karny Reviewed-by: Kees Cook Fixes: df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230523161815.3083-1-wyes.karny@amd.com commit 76edc27eda068fb8222c452d522d4c93bcebe557 Author: Azeem Shaikh Date: Tue May 30 16:35:46 2023 +0000 clocksource: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Acked-by: John Stultz Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230530163546.986188-1-azeemshaikh38@gmail.com commit f9cfb1910ece5b5dbedca096fc9b7c9fe4fd3c50 Author: Alexander Potapenko Date: Tue May 30 10:39:11 2023 +0200 string: use __builtin_memcpy() in strlcpy/strlcat lib/string.c is built with -ffreestanding, which prevents the compiler from replacing certain functions with calls to their library versions. On the other hand, this also prevents Clang and GCC from instrumenting calls to memcpy() when building with KASAN, KCSAN or KMSAN: - KASAN normally replaces memcpy() with __asan_memcpy() with the additional cc-param,asan-kernel-mem-intrinsic-prefix=1; - KCSAN and KMSAN replace memcpy() with __tsan_memcpy() and __msan_memcpy() by default. To let the tools catch memory accesses from strlcpy/strlcat, replace the calls to memcpy() with __builtin_memcpy(), which KASAN, KCSAN and KMSAN are able to replace even in -ffreestanding mode. This preserves the behavior in normal builds (__builtin_memcpy() ends up being replaced with memcpy()), and does not introduce new instrumentation in unwanted places, as strlcpy/strlcat are already instrumented. Suggested-by: Marco Elver Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver Link: https://lore.kernel.org/all/20230224085942.1791837-1-elver@google.com/ Acked-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230530083911.1104336-1-glider@google.com commit 82089b00ae026f638277c51bf3f36c68ed4021c7 Author: Jialu Xu Date: Thu Jun 1 09:04:02 2023 +0800 scripts/tags.sh: improve compiled sources generation Use grep instead of sed for all compiled sources generation, it is three times more efficient. Signed-off-by: Jialu Xu Tested-by: Carlos Llamas Link: https://lore.kernel.org/r/20230601010402.71040-1-xujialu@vimux.org Signed-off-by: Greg Kroah-Hartman commit d4ae3e587eced73c9b6f82fd8f88606a09ff710c Author: Louis DeLosSantos Date: Wed May 31 15:38:49 2023 -0400 selftests/bpf: Test table ID fib lookup BPF helper Add additional test cases to `fib_lookup.c` prog_test. These test cases add a new /24 network to the previously unused veth2 device, removes the directly connected route from the main routing table and moves it to table 100. The first test case then confirms a fib lookup for a remote address in this directly connected network, using the main routing table fails. The second test case ensures the same fib lookup using table 100 succeeds. An additional pair of tests which function in the same manner are added for IPv6. Signed-off-by: Louis DeLosSantos Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230505-bpf-add-tbid-fib-lookup-v2-2-0a31c22c748c@gmail.com commit 8ad77e72caae22a1ddcfd0c03f2884929e93b7a4 Author: Louis DeLosSantos Date: Wed May 31 15:38:48 2023 -0400 bpf: Add table ID to bpf_fib_lookup BPF helper Add ability to specify routing table ID to the `bpf_fib_lookup` BPF helper. A new field `tbid` is added to `struct bpf_fib_lookup` used as parameters to the `bpf_fib_lookup` BPF helper. When the helper is called with the `BPF_FIB_LOOKUP_DIRECT` and `BPF_FIB_LOOKUP_TBID` flags the `tbid` field in `struct bpf_fib_lookup` will be used as the table ID for the fib lookup. If the `tbid` does not exist the fib lookup will fail with `BPF_FIB_LKUP_RET_NOT_FWDED`. The `tbid` field becomes a union over the vlan related output fields in `struct bpf_fib_lookup` and will be zeroed immediately after usage. This functionality is useful in containerized environments. For instance, if a CNI wants to dictate the next-hop for traffic leaving a container it can create a container-specific routing table and perform a fib lookup against this table in a "host-net-namespace-side" TC program. This functionality also allows `ip rule` like functionality at the TC layer, allowing an eBPF program to pick a routing table based on some aspect of the sk_buff. As a concrete use case, this feature will be used in Cilium's SRv6 L3VPN datapath. When egress traffic leaves a Pod an eBPF program attached by Cilium will determine which VRF the egress traffic should target, and then perform a FIB lookup in a specific table representing this VRF's FIB. Signed-off-by: Louis DeLosSantos Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230505-bpf-add-tbid-fib-lookup-v2-1-0a31c22c748c@gmail.com commit dbf87ab2eacd4bbb67d7429dec7a6fee155dc17d Merge: 8258d997b874b b332af5398a3a Author: Greg Kroah-Hartman Date: Thu Jun 1 18:53:51 2023 +0100 Merge tag 'w1-drv-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1 into char-misc-next Krzysztof writes: 1-Wire bus drivers for v6.5 1. Several older cleanups and minor improvements like dropping redundant match function, fixing indentation and typos, simplifying sysfs attribute show, removing redundant variable initializations, using max() instead of open-coding it and constifying pointer to struct hwmon_channel_info. 2. w1_therm: fix inverted lock handling causing spurious temperature reads. 3. sgi: Use strscpy() over strlcpy(). 4. w1 bus fixes: - Correct missing OF node reference put in error path. - Correct iterating over master device list while removing items from it. - Don't use loop iterator past the loop. * tag 'w1-drv-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1: w1: Replace usage of found with dedicated list iterator variable w1: therm: constify pointers to hwmon_channel_info w1: Add missing of_node_put() in w1.c w1: no need to initialise statics to 0 w1: ds2438: remove redundant initialization of variable crc w1: w1_therm: fix typo in comment w1: w1_therm: Use max() instead of doing it manually w1: fix loop in w1_fini() w1: remove redundant initialization to variable result w1: Simplify the atribute show w1: Fix Kconfig indentation w1: sgi: move from strlcpy with unused retval to strscpy w1: Remove driver match function w1: w1_therm: fix locking behavior in convert_t commit 95ea2efbd66fb9e85238bd8d59341f8ce7a31065 Author: Brendan Cunningham Date: Fri May 19 12:54:25 2023 -0400 IB/hfi1: Remove unused struct mmu_rb_ops fields .insert, .invalidate The struct mmu_rb_ops function pointers .insert, .invalidate were only used to increment and decrement struct sdma_mmu_node.refcount. With the deletion of struct sdma_mmu_node.refcount and the addition of struct mmu_rb_node.refcount these function pointers are not called and there are no implementations of them. So it is safe to delete these from struct mmu_rb_ops. Link: https://lore.kernel.org/r/168451526508.3702129.8677714753157495310.stgit@awfm-02.cornelisnetworks.com Signed-off-by: Brendan Cunningham Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit e236e2eae52e1e7fb0d38b8d921b04e527151b73 Author: Brendan Cunningham Date: Fri May 19 12:54:19 2023 -0400 IB/hfi1: Add mmu_rb_node refcount to hfi1_mmu_rb_template tracepoints Add kref_read() of mmu_rb_node.refcount in hfi1_mmu_rb_template-type tracepoint output. Change hfi1_mmu_rb_template tracepoint to take a struct mmu_rb_node* and record the values it needs from that. This makes the trace_hfi1_mmu*() calls shorter and easier to read. Add hfi1_mmu_release_node() tracepoint before all mmu_rb_node->handler->ops->remove() calls. Make hfi1_mmu_rb_search() tracepoint its own tracepoint type separate from hfi1_mmu_rb_template since hfi1_mmu_rb_search() does not take a struct mmu_rb_node*. Link: https://lore.kernel.org/r/168451525987.3702129.12824880387615916700.stgit@awfm-02.cornelisnetworks.com Reviewed-by: Dean Luick Signed-off-by: Brendan Cunningham Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit c9358de193ecfb360c3ce75f27ce839ca0b0bc8c Author: Brendan Cunningham Date: Fri May 19 12:32:16 2023 -0400 IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate The hfi1 user SDMA pinned-page cache will leave a stale cache entry when the cache-entry's virtual address range is invalidated but that cache entry is in-use by an outstanding SDMA request. Subsequent user SDMA requests with buffers in or spanning the virtual address range of the stale cache entry will result in packets constructed from the wrong memory, the physical pages pointed to by the stale cache entry. To fix this, remove mmu_rb_node cache entries from the mmu_rb_handler cache independent of the cache entry's refcount. Add 'struct kref refcount' to struct mmu_rb_node and manage mmu_rb_node lifetime with kref_get() and kref_put(). mmu_rb_node.refcount makes sdma_mmu_node.refcount redundant. Remove 'atomic_t refcount' from struct sdma_mmu_node and change sdma_mmu_node code to use mmu_rb_node.refcount. Move the mmu_rb_handler destructor call after a wait-for-SDMA-request-completion call so mmu_rb_nodes that need mmu_rb_handler's workqueue to queue themselves up for destruction from an interrupt context may do so. Fixes: f48ad614c100 ("IB/hfi1: Move driver out of staging") Fixes: 00cbce5cbf88 ("IB/hfi1: Fix bugs with non-PAGE_SIZE-end multi-iovec user SDMA requests") Link: https://lore.kernel.org/r/168451393605.3700681.13493776139032178861.stgit@awfm-02.cornelisnetworks.com Reviewed-by: Dean Luick Signed-off-by: Brendan Cunningham Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit e925743edc0d86fb846d952190d005bac8a6e373 Author: Aurelien Jarno Date: Tue May 30 19:56:24 2023 +0200 arm: dts: bcm: Enable device-tree overlay support for RPi devices Add the '-@' DTC option for the Raspberry Pi devices. This option populates the '__symbols__' node that contains all the necessary symbols for supporting device-tree overlays (for instance from the firmware or the bootloader) on these devices. The Rasbperry Pi devices are well known for their GPIO header, that allow various "HATs" or other modules do be connected and this enables users to create out-of-tree device-tree overlays for these modules. Please note that this change does increase the size of the resulting DTB by ~40%. For example, with v6.4-rc1 increase in size is as follows: bcm2711-rpi-400.dtb 27556 -> 38141 bytes bcm2711-rpi-4-b.dtb 27484 -> 38069 bytes bcm2711-rpi-cm4-io.dtb 27373 -> 38076 bytes bcm2835-rpi-a.dtb 12879 -> 18235 bytes bcm2835-rpi-a-plus.dtb 13015 -> 18371 bytes bcm2835-rpi-b.dtb 12997 -> 18377 bytes bcm2835-rpi-b-plus.dtb 13237 -> 18666 bytes bcm2835-rpi-b-rev2.dtb 13085 -> 18514 bytes bcm2835-rpi-cm1-io1.dtb 13109 -> 18528 bytes bcm2835-rpi-zero.dtb 12923 -> 18311 bytes bcm2835-rpi-zero-w.dtb 13449 -> 18889 bytes bcm2836-rpi-2-b.dtb 14500 -> 20252 bytes bcm2837-rpi-3-a-plus.dtb 14930 -> 20713 bytes bcm2837-rpi-3-b.dtb 15107 -> 20979 bytes bcm2837-rpi-3-b-plus.dtb 15463 -> 21443 bytes bcm2837-rpi-cm3-io3.dtb 14429 -> 20098 bytes bcm2837-rpi-zero-2-w.dtb 14781 -> 20524 bytes Signed-off-by: Aurelien Jarno Link: https://lore.kernel.org/r/20220410225940.135744-3-aurelien@aurel32.net [ukleinek: rebased to v6.4-rc1] Signed-off-by: Uwe Kleine-König Acked-by: Conor Dooley Signed-off-by: Florian Fainelli commit 3cdba279c5e9209fc1ffd6e56db1e79421555984 Author: Aurelien Jarno Date: Tue May 30 19:56:23 2023 +0200 arm64: dts: broadcom: Enable device-tree overlay support for RPi devices Add the '-@' DTC option for the Raspberry Pi devices. This option populates the '__symbols__' node that contains all the necessary symbols for supporting device-tree overlays (for instance from the firmware or the bootloader) on these devices. The Rasbperry Pi devices are well known for their GPIO header, that allow various "HATs" or other modules do be connected and this enables users to create out-of-tree device-tree overlays for these modules. Please note that this change does increase the size of the resulting DTB by ~40%. For example, with v6.4-rc1 increase in size is as follows: bcm2711-rpi-400.dtb 27556 -> 38141 bytes bcm2711-rpi-4-b.dtb 27484 -> 38069 bytes bcm2711-rpi-cm4-io.dtb 27373 -> 38076 bytes bcm2837-rpi-3-a-plus.dtb 14930 -> 20713 bytes bcm2837-rpi-3-b.dtb 15107 -> 20979 bytes bcm2837-rpi-3-b-plus.dtb 15463 -> 21443 bytes bcm2837-rpi-cm3-io3.dtb 14429 -> 20098 bytes bcm2837-rpi-zero-2-w.dtb 14781 -> 20524 bytes Signed-off-by: Aurelien Jarno Link: https://lore.kernel.org/r/20220410225940.135744-2-aurelien@aurel32.net [ukleinek: rebased to v6.4, replaced by a single assignment to DTC_FLAGS] Signed-off-by: Uwe Kleine-König Acked-by: Conor Dooley Signed-off-by: Florian Fainelli commit 27c9fcfc1e14ca9dff930d55cadd8ee4a34e4321 Author: Ian Rogers Date: Thu Jun 1 01:29:54 2023 -0700 perf test: Update parse-events expectations to test for multiple events With PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE events opening on multiple PMUs, the test expectations need updating to test for multiple events. TODOs are added to document existing hybrid perf bugs. Tested on hybrid alderlake and non-hybrid tigerlake. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230601082954.754318-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 251aa040244a3b17068e4e6ec61f138d7e50681a Author: Ian Rogers Date: Thu Jun 1 01:29:53 2023 -0700 perf parse-events: Wildcard most "numeric" events Numeric events are either raw events or those with ABI defined numbers matched by the lexer. PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE events should wildcard match on hybrid systems. So "cycles" should match each PMU type with an extended type, not just PERF_TYPE_HARDWARE. Change wildcard matching to add the event even if wildcard PMU scanning fails, there will be no extended type but this best matches previous behavior. Only set the extended type when the event type supports it and when perf_pmus__supports_extended_type is true. This new function returns true if >1 core PMU and avoids potential errors on older kernels. Modify evsel__compute_group_pmu_name using a helper perf_pmu__is_software to determine when grouping should occur. Try to use PMUs, and evsel__find_pmu, as being more dependable than evsel->pmu_name. Set a parse events error if a hardware term's PMU lookup fails, to provide extra diagnostics. Fixes: 8bc75f699c141420 ("perf parse-events: Support wildcards on raw events") Reported-by: Kan Liang Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230601082954.754318-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1f4326bf83ce02ae8f7d50240c367fbb7bf28343 Author: Ian Rogers Date: Thu Jun 1 01:29:52 2023 -0700 perf evsel: Add verbose 3 print of evsel name when opening It is often useful to know not just the attribute and perf_event_open() details when opening an evsel, but also the evsel's name. Add this debug output for verbose 3 so that it won't interfere with the current verbose 2 output. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230601082954.754318-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e23421426e1364299e9ee5091022058ba10fee63 Author: Ian Rogers Date: Thu Jun 1 01:29:51 2023 -0700 perf pmu: Correct perf_pmu__auto_merge_stats() affecting hybrid Flip the return value correcting a bug. Fixes: 6b9da260703096b3 ("perf pmu: Remove is_pmu_hybrid") Reported-by: Kan Liang Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230601082954.754318-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 20c475d21ed9326f7b1396c9bb8991b375cb6c50 Author: Andi Shyti Date: Wed May 31 22:55:50 2023 +0200 spi: s3c64xx: Use devm_clk_get_enabled() Replace the tuple devm_clk_get()/clk_prepare_enable() with the single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Link: https://lore.kernel.org/r/20230531205550.568340-1-andi.shyti@kernel.org Signed-off-by: Mark Brown commit 34fcc0f0a410ff67aba99875d0452a0762d5a98d Author: Krzysztof Kozlowski Date: Thu Jun 1 11:59:08 2023 +0200 spi: dt-bindings: socionext,uniphier: drop address/size-cells Remove address/size-cells because they are already mentioned by common spi-controller.yaml. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230601095908.563865-3-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit bbd25f1ae8bfaeb99de2a0e1985d206cd39ac014 Author: Krzysztof Kozlowski Date: Thu Jun 1 11:59:07 2023 +0200 spi: dt-bindings: samsung: drop cs-gpios Remove cs-gpios because it is already mentioned by common spi-controller.yaml. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230601095908.563865-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit c092a878729843c10160c6f22864507ab7dbceb2 Author: Krzysztof Kozlowski Date: Thu Jun 1 11:59:06 2023 +0200 spi: dt-bindings: allwinner: simplify with unevaluatedProperties Remove properties already mentioned by common spi-controller.yaml and switch to unevaluatedProperties:false to achieve same functional effect. This makes the binding a bit smaller. Similarly there is no need to allow additionalProperties for children, because spi-controller.yaml already does it. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230601095908.563865-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit edad9ee94f17adc75d3b13ab51bbe3d615ce1e7e Author: Andi Shyti Date: Fri May 26 14:41:38 2023 +0200 drm/i915/gt: Use the correct error value when kernel_context() fails kernel_context() returns an error pointer. Use pointer-error conversion functions to evaluate its return value, rather than checking for a '0' return. Fixes: eb5c10cbbc2f ("drm/i915: Remove I915_USER_PRIORITY_SHIFT") Reported-by: Dan Carpenter Signed-off-by: Andi Shyti Cc: Chris Wilson Cc: # v5.13+ Reviewed-by: Andrzej Hajda Acked-by: Tejas Upadhyay Link: https://patchwork.freedesktop.org/patch/msgid/20230526124138.2006110-1-andi.shyti@linux.intel.com commit 1cc625cecce9cbbe7898c88cc9e6c06021d7d8f0 Author: Li Zhijian Date: Tue Apr 25 01:02:41 2023 +0000 RDMA/rtrs: Remove duplicate cq_num assignment line 1701 and 1713 are duplicate: > 1701 cq_num = max_send_wr + max_recv_wr; 1702 /* alloc iu to recv new rkey reply when server reports flags set */ 1703 if (clt_path->flags & RTRS_MSG_NEW_RKEY_F || con->c.cid == 0) { 1704 con->rsp_ius = rtrs_iu_alloc(cq_num, sizeof(*rsp), 1705 GFP_KERNEL, 1706 clt_path->s.dev->ib_dev, 1707 DMA_FROM_DEVICE, 1708 rtrs_clt_rdma_done); 1709 if (!con->rsp_ius) 1710 return -ENOMEM; 1711 con->queue_num = cq_num; 1712 } > 1713 cq_num = max_send_wr + max_recv_wr; Remove the duplicate. Link: https://lore.kernel.org/r/1682384563-2-2-git-send-email-lizhijian@fujitsu.com Acked-by: Guoqing Jiang Acked-by: Jack Wang Signed-off-by: Li Zhijian Signed-off-by: Jason Gunthorpe commit 84510a61ef0974ec765cc68d04ddab905b9b6c7c Author: Nicolas Morey Date: Wed May 24 10:52:20 2023 +0200 RDMA/rxe: Remove dangling declaration of rxe_cq_disable() rxe_cq_disable() has been removed but not its declaration. Fixes: 78b26a335310 ("RDMA/rxe: Remove tasklet call from rxe_cq.c") Link: https://lore.kernel.org/r/4f20ffc5-b2c4-0c11-2883-a835caf01a94@suse.com Signed-off-by: Nicolas Morey Acked-by: Zhu Yanjun Signed-off-by: Jason Gunthorpe commit b002760f877c0d91ecd3c78565b52f4bbac379dd Author: Arnd Bergmann Date: Tue May 23 13:18:45 2023 +0200 RDMA/irdma: avoid fortify-string warning in irdma_clr_wqes Commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") triggers a warning for fortified memset(): In function 'fortify_memset_chk', inlined from 'irdma_clr_wqes' at drivers/infiniband/hw/irdma/uk.c:103:4: include/linux/fortify-string.h:493:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 493 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The problem here isthat the inner array only has four 8-byte elements, so clearing 4096 bytes overflows that. As this structure is part of an outer array, change the code to pass a pointer to the irdma_qp_quanta instead, and change the size argument for readability, matching the comment above it. Fixes: 551c46edc769 ("RDMA/irdma: Add user/kernel shared libraries") Link: https://lore.kernel.org/r/20230523111859.2197825-1-arnd@kernel.org Signed-off-by: Arnd Bergmann Acked-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 2145328515c8fa9b8a9f7889250bc6c032f2a0e6 Author: Long Li Date: Sat May 13 23:18:15 2023 -0700 RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to enable RX coalescing With RX coalescing, one CQE entry can be used to indicate multiple packets on the receive queue. This saves processing time and PCI bandwidth over the CQ. The MANA Ethernet driver also uses the v2 version of the protocol. It doesn't use RX coalescing and its behavior is not changed. Link: https://lore.kernel.org/r/1684045095-31228-1-git-send-email-longli@linuxonhyperv.com Signed-off-by: Long Li Signed-off-by: Jason Gunthorpe commit 8716a6473e6c50a5c335f6fa7d6b73779ecf6972 Author: Cong Yang Date: Thu May 25 17:31:51 2023 +0800 drm/panel: Support for Starry-ili9882t TDDI MIPI-DSI panel The Starry-ili9882 is a 10.51" WUXGA TFT panel. which fits in nicely with the existing panel-boe-tv101wum-nl6 driver. From the datasheet,MIPI need to keep the LP11 state before the lcm_reset pin is pulled high. So add lp11_before_reset flag. Signed-off-by: Cong Yang Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230525093151.2338370-5-yangcong5@huaqin.corp-partner.google.com commit 0a73471ca1f7a67d9d2967379087d1784ba62855 Author: Cong Yang Date: Thu May 25 17:31:50 2023 +0800 dt-bindings: display: panel: Add compatible for Starry ili9882t The STARRY ili9882t is a 10.51" WUXGA TFT LCD panel, which fits in nicely with the existing panel-boe-tv101wum-nl6 driver. Hence, we add a new compatible with panel specific config. Signed-off-by: Cong Yang Reviewed-by: Douglas Anderson Acked-by: Conor Dooley Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230525093151.2338370-4-yangcong5@huaqin.corp-partner.google.com commit 1bc2ef065f13043bbefc927e6dc99c82b56ec037 Author: Cong Yang Date: Thu May 25 17:31:49 2023 +0800 drm/panel: Support for Starry-himax83102-j02 TDDI MIPI-DSI panel The Starry-himax83102-j02 is a 10.51" WUXGA TFT panel. which fits in nicely with the existing panel-boe-tv101wum-nl6 driver. From the datasheet[1], MIPI needs to keep the LP11 state before the lcm_reset pin is pulled high, so increase lp11_before_reset flag. [1]: https://github.com/HimaxSoftware/Doc/tree/main/Himax_Chipset_Power_Sequence Signed-off-by: Cong Yang Reviewed-by: Douglas Anderson [dianders: removed some spacing on one line] Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230525093151.2338370-3-yangcong5@huaqin.corp-partner.google.com commit 539914240a01c7d68476d10c07b7f4f9a05d38ed Author: Tony Lindgren Date: Thu Jun 1 17:14:44 2023 +0300 serial: core: Fix probing serial_base_bus devices If a physical serial port device driver uses arch_initcall() we fail to probe the serial_base_bus devices and the serial port tx fails. This is because as serial_base_bus uses module_initcall(). Let's fix the issue by changing serial_base_bus to use arch_initcall(). Let's also return an error if a driver attempts to call uart_add_one_port() too early. Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Closes: https://lore.kernel.org/linux-serial/20230601132012.GB14287@atomide.com/T/#m6a40440fc04d551d27b147da8602e065c982a115 Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230601141445.11321-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 90502d51ab90032a3cd2e3268ba8f794fe85b534 Merge: ac9a78681b921 cc9e654a7e816 Author: Palmer Dabbelt Date: Thu Jun 1 08:41:29 2023 -0700 Merge patch series "Add basic ACPI support for RISC-V" Sunil V L says: This patch series enables the basic ACPI infrastructure for RISC-V. Supporting external interrupt controllers is in progress and hence it is tested using poll based HVC SBI console and RAM disk. The first patch in this series is one of the patch from Jisheng's series [1] which is not merged yet. This patch is required to support ACPI since efi_init() which gets called before sbi_init() can enable static branches and hits a panic. Below are two ECRs approved by ASWG. RINTC - https://drive.google.com/file/d/1R6k4MshhN3WTT-hwqAquu5nX6xSEqK2l/view RHCT - https://drive.google.com/file/d/1nP3nFiH4jkPMp6COOxP6123DCZKR-tia/view Testing: 1) Build latest Qemu 2) Build EDK2 as per instructions in https://github.com/vlsunil/riscv-uefi-edk2-docs/wiki/RISC-V-Qemu-Virt-support 3) Build Linux after enabling SBI HVC and SBI earlycon CONFIG_RISCV_SBI_V01=y CONFIG_SERIAL_EARLYCON_RISCV_SBI=y CONFIG_HVC_RISCV_SBI=y 4) Build buildroot. Run with below command. qemu-system-riscv64 -nographic \ -drive file=Build/RiscVVirtQemu/RELEASE_GCC5/FV/RISCV_VIRT.fd,if=pflash,format=raw,unit=1 \ -machine virt -smp 16 -m 2G \ -kernel arch/riscv/boot/Image \ -initrd buildroot/output/images/rootfs.cpio \ -append "root=/dev/ram ro console=hvc0 earlycon=sbi" * b4-shazam-merge: RISC-V: Enable ACPI in defconfig RISC-V: time.c: Add ACPI support for time_init() clocksource/timer-riscv: Add ACPI support clocksource/timer-riscv: Refactor riscv_timer_init_dt() irqchip/riscv-intc: Add ACPI support RISC-V: cpu: Enable cpuinfo for ACPI systems RISC-V: cpufeature: Add ACPI support in riscv_fill_hwcap() RISC-V: only iterate over possible CPUs in ISA string parser RISC-V: smpboot: Add ACPI support in setup_smp() RISC-V: smpboot: Create wrapper setup_smp() drivers/acpi: RISC-V: Add RHCT related code RISC-V: ACPI: Cache and retrieve the RINTC structure RISC-V: Add ACPI initialization in setup_arch() ACPI: processor_core: RISC-V: Enable mapping processor to the hartid RISC-V: Add support to build the ACPI core ACPI: OSL: Make should_use_kmap() 0 for RISC-V ACPI: tables: Print RINTC information when MADT is parsed crypto: hisilicon/qm: Fix to enable build with RISC-V clang platform/surface: Disable for RISC-V riscv: move sbi_init() earlier before jump_label_init() Link: https://lore.kernel.org/r/20230515054928.2079268-1-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit cc9e654a7e81684091ade9c9d16d8a4e0b6cf53b Author: Sunil V L Date: Mon May 15 11:19:28 2023 +0530 MAINTAINERS: Add entry for drivers/acpi/riscv ACPI defines few RISC-V specific tables which need parsing code added in drivers/acpi/riscv. Add maintainer entries for this newly created folder. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230515054928.2079268-22-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 0b8e15ca008260cf28b354e27f3d2824f33a18b2 Author: Sunil V L Date: Mon May 15 11:19:27 2023 +0530 RISC-V: Enable ACPI in defconfig Add support to build ACPI subsystem in defconfig. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230515054928.2079268-21-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 714aa1d1c8cad1c005bb93a1ba46dfa145ec2e6f Author: Sunil V L Date: Mon May 15 11:19:26 2023 +0530 RISC-V: time.c: Add ACPI support for time_init() On ACPI based platforms, timer related information is available in RHCT. Add ACPI based probe support to the timer initialization. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230515054928.2079268-20-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 21f4f92410dc302b43c6c8307191704ba93c748d Author: Sunil V L Date: Mon May 15 11:19:25 2023 +0530 clocksource/timer-riscv: Add ACPI support Initialize the timer driver based on RHCT table on ACPI based platforms. Currently, ACPI doesn't support a flag to indicate that the timer interrupt can wake up the cpu irrespective of its power state. It will be added in future update. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230515054928.2079268-19-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit cd12d206685af04b30a222a42137a700bff3c7fd Author: Sunil V L Date: Mon May 15 11:19:24 2023 +0530 clocksource/timer-riscv: Refactor riscv_timer_init_dt() Refactor the timer init function such that few things can be shared by both DT and ACPI based platforms. Co-developed-by: Anup Patel Signed-off-by: Anup Patel Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230515054928.2079268-18-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 7023b9d83f039d849d13a845c8eceea19703de0d Author: Sunil V L Date: Mon May 15 11:19:23 2023 +0530 irqchip/riscv-intc: Add ACPI support Add support for initializing the RISC-V INTC driver on ACPI platforms. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230515054928.2079268-17-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 0b144c8189895038cd624035b0cee24869de54f7 Author: Sunil V L Date: Mon May 15 11:19:22 2023 +0530 RISC-V: cpu: Enable cpuinfo for ACPI systems On ACPI based platforms, few details like ISA need to be read from the ACPI table. Enable cpuinfo on ACPI based systems. ACPI has nothing similar to DT compatible property for each CPU. Hence, cpuinfo will not print "uarch". Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230515054928.2079268-16-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 396c018332a10a845e8a555ca3fa288c952a37af Author: Sunil V L Date: Mon May 15 11:19:21 2023 +0530 RISC-V: cpufeature: Add ACPI support in riscv_fill_hwcap() On ACPI based systems, the information about the hart like ISA is provided by the RISC-V Hart Capabilities Table (RHCT). Enable filling up hwcap structure based on the information in RHCT. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230515054928.2079268-15-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 914d6f44fc50744163e9bba7178644231f77a46a Author: Sunil V L Date: Mon May 15 11:19:20 2023 +0530 RISC-V: only iterate over possible CPUs in ISA string parser During boot we call riscv_of_processor_hartid() for each hart that we add to the possible cpus list. Repeating the call again here is not required, if we iterate over the list of possible CPUs, rather than the list of all CPUs. The call to of_property_read_string() for "riscv,isa" cannot fail either, as it has previously succeeded in riscv_of_processor_hartid(), but leaving in the error checking makes the operation of the loop more obvious & provides leeway for future refactoring of riscv_of_processor_hartid(). Signed-off-by: Sunil V L Co-developed-by: Conor Dooley Signed-off-by: Conor Dooley Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20230515054928.2079268-14-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit ce92546cd63779445d205e3153defedacf8b08c6 Author: Sunil V L Date: Mon May 15 11:19:19 2023 +0530 RISC-V: smpboot: Add ACPI support in setup_smp() Enable SMP boot on ACPI based platforms by using the RINTC structures in the MADT table. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Conor Dooley Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20230515054928.2079268-13-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 61946127ab49d0bb47786b8de2aff73a051e054f Author: Sunil V L Date: Mon May 15 11:19:18 2023 +0530 RISC-V: smpboot: Create wrapper setup_smp() setup_smp() currently assumes DT-based platforms. To enable ACPI, first make this a wrapper function and move existing code to a separate DT-specific function. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Conor Dooley Reviewed-by: Andrew Jones Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230515054928.2079268-12-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit e6b9d8eddb1772d99a676a906d42865293934edd Author: Sunil V L Date: Mon May 15 11:19:17 2023 +0530 drivers/acpi: RISC-V: Add RHCT related code RHCT is a new table defined for RISC-V to communicate the features of the CPU to the OS. Create a new architecture folder in drivers/acpi and add RHCT parsing code. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230515054928.2079268-11-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit f995611994704b5c039731287b897993808e63e3 Author: Sunil V L Date: Mon May 15 11:19:16 2023 +0530 RISC-V: ACPI: Cache and retrieve the RINTC structure RINTC structures in the MADT provide mapping between the hartid and the CPU. This is required many times even at run time like cpuinfo. So, instead of parsing the ACPI table every time, cache the RINTC structures and provide a function to get the correct RINTC structure for a given cpu. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20230515054928.2079268-10-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 724f4c0df7665a1bb9cb105a20131dfca5c032dd Author: Sunil V L Date: Mon May 15 11:19:15 2023 +0530 RISC-V: Add ACPI initialization in setup_arch() Initialize the ACPI core for RISC-V during boot. ACPI tables and interpreter are initialized based on the information passed from the firmware and the value of the kernel parameter 'acpi'. With ACPI support added for RISC-V, the kernel parameter 'acpi' is also supported on RISC-V. Hence, update the documentation. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230515054928.2079268-9-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 8b7809e289524e02f8f0755ca632ea9e9aefbd0e Author: Sunil V L Date: Mon May 15 11:19:14 2023 +0530 ACPI: processor_core: RISC-V: Enable mapping processor to the hartid processor_core needs arch-specific functions to map the ACPI ID to the physical ID. In RISC-V platforms, hartid is the physical id and RINTC structure in MADT provides this mapping. Add arch-specific function to get this mapping from RINTC. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20230515054928.2079268-8-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit a91a9ffbd3a55a0ae1bb75e2b6e85b2a03f64e8f Author: Sunil V L Date: Mon May 15 11:19:13 2023 +0530 RISC-V: Add support to build the ACPI core Enable ACPI core for RISC-V after adding architecture-specific interfaces and header files required to build the ACPI core. 1) Couple of header files are required unconditionally by the ACPI core. Add empty acenv.h and cpu.h header files. 2) If CONFIG_PCI is enabled, a few PCI related interfaces need to be provided by the architecture. Define dummy interfaces for now so that build succeeds. Actual implementation will be added when PCI support is added for ACPI along with external interrupt controller support. 3) A few globals and memory mapping related functions specific to the architecture need to be provided. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230515054928.2079268-7-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 214c236223b8449177a7e4a4c49dd65892f6cd59 Author: Sunil V L Date: Mon May 15 11:19:12 2023 +0530 ACPI: OSL: Make should_use_kmap() 0 for RISC-V Without this, if the tables are larger than 4K, acpi_map() will fail. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230515054928.2079268-6-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 4d02d88d2b922807307a3574a7b401dcccb870d1 Author: Sunil V L Date: Mon May 15 11:19:11 2023 +0530 ACPI: tables: Print RINTC information when MADT is parsed When MADT is parsed, print RINTC information as below: ACPI: RISC-V INTC (acpi_uid[0x0000] hart_id[0x0] enabled) ACPI: RISC-V INTC (acpi_uid[0x0001] hart_id[0x1] enabled) ... ACPI: RISC-V INTC (acpi_uid[0x000f] hart_id[0xf] enabled) This debug information will be very helpful during bring up. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20230515054928.2079268-5-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit fbb995a7b27c72d83963bf43ed76dcaf0449a2a9 Author: Sunil V L Date: Mon May 15 11:19:10 2023 +0530 crypto: hisilicon/qm: Fix to enable build with RISC-V clang With CONFIG_ACPI enabled for RISC-V, this driver gets enabled in allmodconfig build. However, build fails with clang and below error is seen. drivers/crypto/hisilicon/qm.c:627:10: error: invalid output constraint '+Q' in asm "+Q" (*((char __iomem *)fun_base)) ^ This is expected error with clang due to the way it is designed. To fix this issue, move arm64 assembly code under #if. Link: https://github.com/ClangBuiltLinux/linux/issues/999 Signed-off-by: Nathan Chancellor [sunilvl@ventanamicro.com: Moved tmp0 and tmp1 into the #if] Signed-off-by: Sunil V L Acked-by: Herbert Xu Link: https://lore.kernel.org/r/20230515054928.2079268-4-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 7f2e20459b281449b0228338d0dd5b044bc55eb6 Author: Sunil V L Date: Mon May 15 11:19:09 2023 +0530 platform/surface: Disable for RISC-V With CONFIG_ACPI enabled for RISC-V, this driver gets enabled in allmodconfig build. However, RISC-V doesn't support sub-word atomics which is used by this driver and hence allmodconfig build will fail. There is currently no plan to support this driver for RISC-V. So, disable this driver for RISC-V even when ACPI is enabled. Signed-off-by: Sunil V L Acked-by: Maximilian Luz Link: https://lore.kernel.org/r/20230515054928.2079268-3-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 24fc18087f4237d98d892280abe97711e0f4bc9e Author: Jisheng Zhang Date: Mon May 15 11:19:08 2023 +0530 riscv: move sbi_init() earlier before jump_label_init() We call jump_label_init() in setup_arch() is to use static key mechanism earlier, but riscv jump label relies on the sbi functions, If we enable static key before sbi_init(), the code path looks like: static_branch_enable() .. arch_jump_label_transform() patch_text_nosync() flush_icache_range() flush_icache_all() sbi_remote_fence_i() for CONFIG_RISCV_SBI case __sbi_rfence() Since sbi isn't initialized, so NULL deference! Here is a typical panic log: [ 0.000000] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 [ 0.000000] Oops [#1] [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc7+ #79 [ 0.000000] Hardware name: riscv-virtio,qemu (DT) [ 0.000000] epc : 0x0 [ 0.000000] ra : sbi_remote_fence_i+0x1e/0x26 [ 0.000000] epc : 0000000000000000 ra : ffffffff80005826 sp : ffffffff80c03d50 [ 0.000000] gp : ffffffff80ca6178 tp : ffffffff80c0ad80 t0 : 6200000000000000 [ 0.000000] t1 : 0000000000000000 t2 : 62203a6b746e6972 s0 : ffffffff80c03d60 [ 0.000000] s1 : ffffffff80001af6 a0 : 0000000000000000 a1 : 0000000000000000 [ 0.000000] a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 [ 0.000000] a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000000080200 [ 0.000000] s2 : ffffffff808b3e48 s3 : ffffffff808bf698 s4 : ffffffff80cb2818 [ 0.000000] s5 : 0000000000000001 s6 : ffffffff80c9c345 s7 : ffffffff80895aa0 [ 0.000000] s8 : 0000000000000001 s9 : 000000000000007f s10: 0000000000000000 [ 0.000000] s11: 0000000000000000 t3 : ffffffff80824d08 t4 : 0000000000000022 [ 0.000000] t5 : 000000000000003d t6 : 0000000000000000 [ 0.000000] status: 0000000000000100 badaddr: 0000000000000000 cause: 000000000000000c [ 0.000000] ---[ end trace 0000000000000000 ]--- [ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task! [ 0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]--- Fix this issue by moving sbi_init() earlier before jump_label_init() Signed-off-by: Jisheng Zhang Reviewed-by: Anup Patel Reviewed-by: Atish Patra Link: https://lore.kernel.org/r/20230515054928.2079268-2-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 06c3269cd5748293d77b9ae8d05611f7cc9187df Author: Cong Yang Date: Thu May 25 17:31:48 2023 +0800 dt-bindings: display: panel: Add compatible for Starry himax83102-j02 The STARRY himax83102-j02 is a 10.51" WUXGA TFT LCD panel, which fits in nicely with the existing panel-boe-tv101wum-nl6 driver. Hence, we add a new compatible with panel specific config. Signed-off-by: Cong Yang Reviewed-by: Douglas Anderson Acked-by: Conor Dooley Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230525093151.2338370-2-yangcong5@huaqin.corp-partner.google.com commit 1fbcc5ab1c7a172ef1159b154c296fe1e9ce209b Merge: 089adf3370142 fd4762b6b5cfa Author: Mark Brown Date: Thu Jun 1 16:43:46 2023 +0100 Add TDM audio on StarFive JH7110 Merge series from Walker Chen : This patchset adds TDM audio driver for the StarFive JH7110 SoC. The first patch adds device tree binding for TDM module. The second patch adds tdm driver support for JH7110 SoC. The last patch adds device tree node and pins configuration of tdm to JH7110 dts. The series has been tested on the VisionFive 2 board by plugging an audio expansion board. For more information of audio expansion board, you can take a look at the following webpage: https://wiki.seeedstudio.com/ReSpeaker_2_Mics_Pi_HAT/ commit 20d099756b98fa6b5b838448b1ffbce46f4f3283 Author: Azeem Shaikh Date: Tue May 30 15:56:08 2023 +0000 block: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230530155608.272266-1-azeemshaikh38@gmail.com Signed-off-by: Jens Axboe commit 5a0ac57c48aa9380126bd9bf3ec82140aab84548 Author: Yu Kuai Date: Wed May 31 15:34:35 2023 +0800 blk-ioc: protect ioc_destroy_icq() by 'queue_lock' Currently, icq is tracked by both request_queue(icq->q_node) and task(icq->ioc_node), and ioc_clear_queue() from elevator exit is not safe because it can access the list without protection: ioc_clear_queue ioc_release_fn lock queue_lock list_splice /* move queue list to a local list */ unlock queue_lock /* * lock is released, the local list * can be accessed through task exit. */ lock ioc->lock while (!hlist_empty) icq = hlist_entry lock queue_lock ioc_destroy_icq delete icq->ioc_node while (!list_empty) icq = list_entry() list_del icq->q_node /* * This is not protected by any lock, * list_entry concurrent with list_del * is not safe. */ unlock queue_lock unlock ioc->lock Fix this problem by protecting list 'icq->q_node' by queue_lock from ioc_clear_queue(). Reported-and-tested-by: Pradeep Pragallapati Link: https://lore.kernel.org/lkml/20230517084434.18932-1-quic_pragalla@quicinc.com/ Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230531073435.2923422-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 6c500000af037f74b66dd01b565c8ee1b501cc1b Author: Johannes Thumshirn Date: Wed May 31 04:50:43 2023 -0700 block: mark bio_add_folio as __must_check Now that all callers of bio_add_folio() check the return value, mark it as __must_check. Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/381360a45ac3684120cfbe1e07685e9c36256e47.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit c2478469f2bb821a268bd02cae5b2af1c119c9bd Author: Johannes Thumshirn Date: Wed May 31 04:50:42 2023 -0700 fs: iomap: use bio_add_folio_nofail where possible When the iomap buffered-io code can't add a folio to a bio, it allocates a new bio and adds the folio to that one. This is done using bio_add_folio(), but doesn't check for errors. As adding a folio to a newly created bio can't fail, use the newly introduced bio_add_folio_nofail() function. Reviewed-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/58fa893c24c67340a63323f09a179fefdca07f2a.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 7a150f1ed19b709837e98571f49ab1ff2625ca89 Author: Johannes Thumshirn Date: Wed May 31 04:50:41 2023 -0700 block: add bio_add_folio_nofail Just like for bio_add_pages() add a no-fail variant for bio_add_folio(). Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/924dff4077812804398ef84128fb920507fa4be1.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 83f2caaaf9cb25fe74775a59bf2662f184bfaa08 Author: Johannes Thumshirn Date: Wed May 31 04:50:40 2023 -0700 block: mark bio_add_page as __must_check Now that all users of bio_add_page check for the return value, mark bio_add_page as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/7ae4a902e08fe2e90c012ee07aeb35d4aae28373.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 2c550517bc7e44c8d1151deb08f5b2b2cf63cf6c Author: Johannes Thumshirn Date: Wed May 31 04:50:39 2023 -0700 dm-crypt: use __bio_add_page to add single page to clone bio crypt_alloc_buffer() already allocates enough entries in the clone bio's vector, so adding a page to the bio can't fail. Use __bio_add_page() to reflect this. Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/f9a4dee5e81389fd70ffc442da01006538e55aca.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 0c67dd644176092d47b97215daca830c6ee0db18 Author: Johannes Thumshirn Date: Wed May 31 04:50:38 2023 -0700 md: raid1: check if adding pages to resync bio fails Check if adding pages to resync bio fails and if bail out. As the comment above suggests this cannot happen, WARN if it actually happens. Technically __bio_add_pages() would be sufficient here, but asserting the pages actually get added to the bio is preferred. This way we can mark bio_add_pages as __must_check. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/33aea4c271220dc9bcab58c4b7bec478c1511142.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit f83123223a8447a1369409568f698c68a230010e Author: Johannes Thumshirn Date: Wed May 31 04:50:37 2023 -0700 md: raid1: use __bio_add_page for adding single page to bio The sync request code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/6cf7f66c6e646231200d025dfd5f2d3ae75c8fe5.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit b42473cdbab7661535516ae76e0a871d98b5cb97 Author: Johannes Thumshirn Date: Wed May 31 04:50:36 2023 -0700 md: check for failure when adding pages in alloc_behind_master_bio alloc_behind_master_bio() can possibly add multiple pages to a bio, but it is not checking for the return value of bio_add_page() if adding really succeeded. Check if the page adding succeeded and if not bail out. Reviewed-by: Christoph Hellwig Acked-by: Song Liu Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/827aa12d44ebf3f50b41b47f5cedc0f80179f2c1.1685532726.git.johannes.thumshirn@wdc.com [axboe: fold in s/free_page/put_page fix] Signed-off-by: Jens Axboe commit 9e436c195e2d6d3a0db6921e14ef2c85e559ae5b Author: Harald Freudenberger Date: Sat Apr 1 18:26:06 2023 +0200 s390/pkey: add support for ecc clear key Add support for a new 'non CCA clear key token' with these ECC clear keys supported: - ECC P256 - ECC P384 - ECC P521 - ECC ED25519 - ECC ED448 This makes it possible to derive a protected key from this ECC clear key input via PKEY_KBLOB2PROTK3 ioctl. As of now the only way to derive protected keys from these clear key tokens is via PCKMO instruction. For AES keys an alternate path via creating a secure key from the clear key and then derive a protected key from the secure key exists. This alternate path is not implemented for ECC keys as it would require to rearrange and maybe recalculate the clear key material for input to derive an CCA or EP11 ECC secure key. Signed-off-by: Harald Freudenberger Reviewed-by: Holger Dengler Signed-off-by: Alexander Gordeev commit f370f45c6475ad0058277ae111f28fb32f58aa46 Author: Harald Freudenberger Date: Sat Apr 1 14:32:08 2023 +0200 s390/pkey: do not use struct pkey_protkey This is an internal rework of the pkey code to not use the struct pkey_protkey internal any more. This struct has a hard coded protected key buffer with MAXPROTKEYSIZE = 64 bytes. However, with support for ECC protected key, this limit is too short and thus this patch reworks all the internal code to use the triple u8 *protkey, u32 protkeylen, u32 protkeytype instead. So the ioctl which still has to deal with this struct coming from userspace and/or provided to userspace invoke all the internal functions now with the triple instead of passing a pointer to struct pkey_protkey. Also the struct pkey_clrkey has been internally replaced in a similar way. This struct also has a hard coded clear key buffer of MAXCLRKEYSIZE = 32 bytes and thus is not usable with e.g. ECC clear key material. This is a transparent rework for userspace applications using the pkey API. The internal kernel API used by the PAES crypto ciphers has been adapted to this change to make it possible to provide ECC protected keys via this interface in the future. Signed-off-by: Harald Freudenberger Reviewed-by: Holger Dengler Signed-off-by: Alexander Gordeev commit 46a29b039e2ea1199ef59c68f4313a8eebbd7d56 Author: Harald Freudenberger Date: Wed Apr 5 17:29:32 2023 +0200 s390/pkey: introduce reverse x-mas trees This patch introduces reverse x-mas trees for all local variables on all the functions in pkey. Signed-off-by: Harald Freudenberger Reviewed-by: Holger Dengler Signed-off-by: Alexander Gordeev commit 9f70bc890ae299a6fdf83bfc99832509fd2f7494 Author: Mikhail Zaslonko Date: Tue May 9 17:38:15 2023 +0200 s390/zcore: conditionally clear memory on reipl Currently zcore_reipl_write() always use DIAG308_LOAD_CLEAR to ipl the system (used by ngdump and zfcpdump to ipl the original kernel after dumping). Instead of 'always clear' check OS_INFO_FLAG_REIPL_CLEAR flag and use either LOAD_CLEAR or LOAD_NORMAL diag308 subcode accordingly. For that read os_info and check for the valid os_info flags entry in zcore_reipl_init(). Do not return error on failure (e.g. os_info checksum error) in order to continue dump processing, considering that os_info could be corrupted on the panicked system. Signed-off-by: Mikhail Zaslonko Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 31e9ccc67ce24f82120e41fcafd841f98838ff5c Author: Mikhail Zaslonko Date: Thu Mar 30 09:18:01 2023 +0200 s390/ipl: add REIPL_CLEAR flag to os_info Introduce new OS_INFO_FLAGS_ENTRY to os_info pointing to the field with bit flags. Add OS_INFO_FLAGS_ENTRY upon dump_reipl shutdown action processing and set OS_INFO_FLAG_REIPL_CLEAR flag indicating 'clear' sysfs attribute has been set on the panicked system for specified ipl type. This flag can be used to inform the dumper whether LOAD_CLEAR or LOAD_NORMAL diag308 subcode to be used for ipl after dumping the memory. Signed-off-by: Mikhail Zaslonko Acked-by: Alexander Gordeev Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit d933e5f41e4f6c54f4bd3e0b29ca4854fe5fa0d6 Author: Gustavo A. R. Silva Date: Mon May 22 19:35:59 2023 -0600 vfio/ccw: use struct_size() helper Prefer struct_size() over open-coded versions. Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Reviewed-by: Eric Farman Reviewed-by: Matthew Rosato Link: https://lore.kernel.org/r/f657276073630e806e69726a40ad1cc85101448a.1684805398.git.gustavoars@kernel.org Signed-off-by: Alexander Gordeev commit 5dd4241964c86e866ae51b5c5b95cd14c5f341e6 Author: Gustavo A. R. Silva Date: Mon May 22 19:35:12 2023 -0600 vfio/ccw: replace one-element array with flexible-array member One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct vfio_ccw_parent and refactor the rest of the code accordingly. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/297 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Reviewed-by: Eric Farman Reviewed-by: Matthew Rosato Link: https://lore.kernel.org/r/3c10549ebe1564eade68a2515bde233527376971.1684805398.git.gustavoars@kernel.org Signed-off-by: Alexander Gordeev commit bcfa8e33064f1357e60a7c056a2e51cc5928d629 Author: Uwe Kleine-König Date: Tue May 30 07:17:26 2023 +0200 extcon: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Chanwoo Choi commit 29c6df0d942454cb43334cf0e36de068f4124b94 Author: Neil Armstrong Date: Tue May 30 09:38:14 2023 +0200 drm/panel: khadas-ts050: update timings to achieve 60Hz refresh rate This updates the panel timings to achieve a clean 60Hz refresh rate. Reviewed-by: Nicolas Belin Tested-by: Nicolas Belin # on Khadas VIM3 + TS050 Panel Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230512-amlogic-v6-4-upstream-dsi-ccf-vim3-v5-13-56eb7a4d5b8e@linaro.org commit 77d9e1e6b8468f701ab024a060aa9c0339356870 Author: Neil Armstrong Date: Tue May 30 09:38:13 2023 +0200 drm/meson: add support for MIPI-DSI transceiver The Amlogic G12A/G12B/SM1 SoCs embeds a Synopsys DW-MIPI-DSI transceiver (ver 1.21a), with a custom glue managing the IP resets, clock and data inputs similar to the DW-HDMI Glue on other Amlogic SoCs. This adds support for the Glue managing the transceiver, mimicing the init flow provided by Amlogic to setup the ENCL encoder, the glue, the transceiver, the digital D-PHY and the Analog PHY in the proper way. An optional "MEAS" clock can be enabled to measure the delay between each vsync feeding the DW-MIPI-DSI transceiver. Signed-off-by: Neil Armstrong Reviewed-by: Jagan Teki Reviewed-by: Nicolas Belin Tested-by: Nicolas Belin # on Khadas VIM3 + TS050 Panel Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230512-amlogic-v6-4-upstream-dsi-ccf-vim3-v5-12-56eb7a4d5b8e@linaro.org commit 42dcf15f901c8222352da31d622b4ee844068f42 Author: Neil Armstrong Date: Tue May 30 09:38:12 2023 +0200 drm/meson: add DSI encoder This adds an encoder bridge designed to drive a MIPI-DSI display by using the ENCL encoder through the internal MIPI DSI transceiver connected to the output of the ENCL pixel encoder. Signed-off-by: Neil Armstrong Reviewed-by: Jagan Teki Reviewed-by: Nicolas Belin Tested-by: Nicolas Belin # on Khadas VIM3 + TS050 Panel Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230512-amlogic-v6-4-upstream-dsi-ccf-vim3-v5-11-56eb7a4d5b8e@linaro.org commit 51fc01a03442cce5e4c21375a1ceb2e4ec93c833 Author: Neil Armstrong Date: Tue May 30 09:38:11 2023 +0200 drm/meson: venc: add ENCL encoder setup for MIPI-DSI output This adds supports for the ENCL encoder connected to a MIPI-DSI transceiver on the Amlogic AXG, G12A, G12B & SM1 SoCs. Signed-off-by: Neil Armstrong Reviewed-by: Nicolas Belin Tested-by: Nicolas Belin # on Khadas VIM3 + TS050 Panel Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230512-amlogic-v6-4-upstream-dsi-ccf-vim3-v5-10-56eb7a4d5b8e@linaro.org commit 44e16166e0e9b94d8bcdf55fc0e5fcceca1154f0 Author: Neil Armstrong Date: Tue May 30 09:38:10 2023 +0200 drm/meson: only use components with dw-hdmi Only DW-HDMI currently needs components since it reuses the drm-meson driver context to access HHI registers (sic). Once this is solved, we can get rid on components. Until now, limit the components matching to the dw-hdmi compatibles we know to require this hack, for other bridges simply use probe defer instead and get over this components sitation. The back story is that we simply cannot attach DSI adapters bridges if we use components, only DSI panels, this is because we bind/unbind the DSI controller at each drm-meson driver master bind tentative. With this the I2C DSI bridge is unable to find the DSI controller host and everything fails to probe. This will simplify a lot adding new or older HDMI bridges. Cc: Martin Blumenstingl Reviewed-by: Nicolas Belin Tested-by: Nicolas Belin # on Khadas VIM3 + TS050 Panel Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230512-amlogic-v6-4-upstream-dsi-ccf-vim3-v5-9-56eb7a4d5b8e@linaro.org commit 6a044642988b5f8285f3173b8e88784bef2bc306 Author: Neil Armstrong Date: Tue May 30 09:38:09 2023 +0200 drm/meson: fix unbind path if HDMI fails to bind If the case the HDMI controller fails to bind, we try to unbind all components before calling drm_dev_put() which makes drm_bridge_detach() crash because unbinding the HDMI controller frees the bridge memory. The solution is the unbind all components at the end like in the remove path. Reviewed-by: Nicolas Belin Tested-by: Nicolas Belin Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230512-amlogic-v6-4-upstream-dsi-ccf-vim3-v5-8-56eb7a4d5b8e@linaro.org commit 25b3b35cd51ef0d98165666d250a51f39db6a1fc Author: Neil Armstrong Date: Tue May 30 09:38:08 2023 +0200 dt-bindings: display: meson-vpu: add third DPI output port Add third port corresponding to the ENCL DPI encoder used to connect to DSI or LVDS transceivers. Signed-off-by: Neil Armstrong Reviewed-by: Martin Blumenstingl Reviewed-by: Rob Herring Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230512-amlogic-v6-4-upstream-dsi-ccf-vim3-v5-7-56eb7a4d5b8e@linaro.org commit 0628f2341e96213c9f2d074853b255f65acd3795 Author: Neil Armstrong Date: Tue May 30 09:38:07 2023 +0200 dt-bindings: display: add Amlogic MIPI DSI Host Controller bindings The Amlogic G12A, G12B & SM1 SoCs embeds a Synopsys DW-MIPI-DSI transceiver (ver 1.21a) with a custom glue managing the IP resets, clock and data inputs similar to the DW-HDMI Glue on the same Amlogic SoC families. Signed-off-by: Neil Armstrong Reviewed-by: Conor Dooley Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230512-amlogic-v6-4-upstream-dsi-ccf-vim3-v5-6-56eb7a4d5b8e@linaro.org commit 2af4aa3be58802cf00f834eeaad1243290bb1d4a Author: Azeem Shaikh Date: Tue May 23 02:16:40 2023 +0000 staging: most: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230523021640.2406585-1-azeemshaikh38@gmail.com commit f4a0659f823e5a828ea2f45b4849ea8e2dd2984c Author: Azeem Shaikh Date: Mon May 22 15:53:50 2023 +0000 drm/i2c: tda998x: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230522155350.2337029-1-azeemshaikh38@gmail.com commit 8360257608f74946a985400f1994d3eea9b74a85 Author: Azeem Shaikh Date: Mon May 22 15:53:31 2023 +0000 drm/sun4i: hdmi: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230522155331.2336966-1-azeemshaikh38@gmail.com commit 3213bfde114f9ce37e2a0264d368dcf8a2347bea Author: Azeem Shaikh Date: Mon May 22 15:53:06 2023 +0000 drm/mediatek: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230522155306.2336889-1-azeemshaikh38@gmail.com commit 576f0d7a8ad3219a35d06a297005cc1aa14ae96f Author: Azeem Shaikh Date: Mon May 22 15:51:49 2023 +0000 drm/rockchip: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230522155149.2336620-1-azeemshaikh38@gmail.com commit 533950d32d292cc4d0cef5b85af57948b8dcb11a Author: Azeem Shaikh Date: Mon May 22 15:51:24 2023 +0000 drm/display/dp_mst: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230522155124.2336545-1-azeemshaikh38@gmail.com commit 8012ec4a0e64b60d4d782950296e6fb217c6758f Author: Juhee Kang Date: Sat May 27 20:49:54 2023 +0900 wifi: brcmutil: use helper function pktq_empty() instead of open code pktq_empty was added in commit 5b435de0d786 ("net: wireless: add brcm80211 drivers") but it is currently not being utilized in some areas. This commit replaces the open code with the pktq_empty() function. Signed-off-by: Juhee Kang Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230527114954.3281-2-claudiajkang@gmail.com commit 3e450386e99e6eeb9a40ac09fbc4704936334579 Author: Juhee Kang Date: Sat May 27 20:49:53 2023 +0900 wifi: rtlwifi: use helper function rtl_get_hdr() Although rtl_get_hdr was added in commit 3dad618b7b92 ("rtlwifi: Change wifi.h for rtl8192se and rtl8192de"), it is currently not being utilized in some areas. This commit replaces the open code with the rtl_get_hdr() function. Signed-off-by: Juhee Kang Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230527114954.3281-1-claudiajkang@gmail.com commit 7c1dee734f3b8003429c40fb9186401485670dfd Author: Borislav Petkov (AMD) Date: Wed May 31 19:23:34 2023 +0200 x86/mtrr: Unify debugging printing Put all the debugging output behind "mtrr=debug" and get rid of "mtrr_cleanup_debug" which wasn't even documented anywhere. No functional changes. Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20230531174857.GDZHeIib57h5lT5Vh1@fat_crate.local commit 08611a3a9a23e5e2e1a799e966c69ebc4851dfa8 Author: Juergen Gross Date: Tue May 2 14:09:31 2023 +0200 x86/mtrr: Remove unused code mtrr_centaur_report_mcr() isn't used by anyone, so it can be removed. Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-17-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit 12f0dd8df14285a5604f35ed3af8b8c33e8fd97f Author: Juergen Gross Date: Tue May 2 14:09:30 2023 +0200 x86/mm: Only check uniform after calling mtrr_type_lookup() Today pud_set_huge() and pmd_set_huge() test for the MTRR type to be WB or INVALID after calling mtrr_type_lookup(). Those tests can be dropped as the only reason not to use a large mapping would be uniform being 0. Any MTRR type can be accepted as long as it applies to the whole memory range covered by the mapping, as the alternative would only be to map the same region with smaller pages instead, using the same PAT type as for the large mapping. [ bp: Massage commit message. ] Suggested-by: Linus Torvalds Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-16-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit 973df1942068c0cc72244ce7dce5e5aeca03ad5f Author: Juergen Gross Date: Tue May 2 14:09:29 2023 +0200 x86/mtrr: Don't let mtrr_type_lookup() return MTRR_TYPE_INVALID mtrr_type_lookup() should always return a valid memory type. In case there is no information available, it should return the default UC. This will remove the last case where mtrr_type_lookup() can return MTRR_TYPE_INVALID, so adjust the comment in include/uapi/asm/mtrr.h. Note that removing the MTRR_TYPE_INVALID #define from that header could break user code, so it has to stay. At the same time the mtrr_type_lookup() stub for the !CONFIG_MTRR case should set uniform to 1, as if the memory range would be covered by no MTRR at all. Suggested-by: Linus Torvalds Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-15-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit 8227f40ade2362982505f66f1614b78a3a083ec9 Author: Juergen Gross Date: Tue May 2 14:09:28 2023 +0200 x86/mtrr: Use new cache_map in mtrr_type_lookup() Instead of crawling through the MTRR register state, use the new cache_map for looking up the cache type(s) of a memory region. This allows now to set the uniform parameter according to the uniformity of the cache mode of the region, instead of setting it only if the complete region is mapped by a single MTRR. This now includes even the region covered by the fixed MTRR registers. Make sure uniform is always set. [ bp: Massage. ] [ jgross: Explain mtrr_type_lookup() logic. ] Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-14-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit a4316603534cf7f4dcd9f9f1ed170257b987cca9 Author: Juergen Gross Date: Tue May 2 14:09:27 2023 +0200 x86/mtrr: Add mtrr=debug command line option Add a new command line option "mtrr=debug" for getting debug output after building the new cache mode map. The output will include MTRR register values and the resulting map. Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-13-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit 061b984aab5845dc958f248b5b0f9040fe45b5e1 Author: Juergen Gross Date: Tue May 2 14:09:26 2023 +0200 x86/mtrr: Construct a memory map with cache modes After MTRR initialization construct a memory map with cache modes from MTRR values. This will speed up lookups via mtrr_lookup_type() especially in case of overlapping MTRRs. This will be needed when switching the semantics of the "uniform" parameter of mtrr_lookup_type() from "only covered by one MTRR" to "memory range has a uniform cache mode", which is the data the callers really want to know. Today this information is not easily available, in case MTRRs are not well sorted regarding base address. The map will be built in __initdata. When memory management is up, the map will be moved to dynamically allocated memory, in order to avoid the need of an overly large array. The size of this array is calculated using the number of variable MTRR registers and the needed size for fixed entries. Only add the map creation and expansion for now. The lookup will be added later. When writing new MTRR entries in the running system rebuild the map inside the call from mtrr_rendezvous_handler() in order to avoid nasty race conditions with concurrent lookups. [ bp: Move out rebuild_map() call and rename it. ] Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-12-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit 1ca12099040fec8c6bbcd9fabf37f04ac0d08e48 Author: Juergen Gross Date: Tue May 2 14:09:25 2023 +0200 x86/mtrr: Add get_effective_type() service function Add a service function for obtaining the effective cache mode of overlapping MTRR registers. Make use of that function in check_type_overlap(). Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-11-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit 961c6a4326643e6588352b7f1f5d77364415386f Author: Juergen Gross Date: Tue May 2 14:09:24 2023 +0200 x86/mtrr: Allocate mtrr_value array dynamically The mtrr_value[] array is a static variable which is used only in a few configurations. Consuming 6kB is ridiculous for this case, especially as the array doesn't need to be that large and it can easily be allocated dynamically. Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-10-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit b5d3c72829b1f2b181cd7c5b426f7deaae452045 Author: Juergen Gross Date: Tue May 2 14:09:23 2023 +0200 x86/mtrr: Move 32-bit code from mtrr.c to legacy.c There is some code in mtrr.c which is relevant for old 32-bit CPUs only. Move it to a new source legacy.c. While modifying mtrr_init_finalize() fix spelling of its name. Suggested-by: Borislav Petkov Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-9-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit 34cf2d19552bbe3b72b34fc859a19cd5070c466a Author: Juergen Gross Date: Tue May 2 14:09:22 2023 +0200 x86/mtrr: Have only one set_mtrr() variant Today there are two variants of set_mtrr(): one calling stop_machine() and one calling stop_machine_cpuslocked(). The first one (set_mtrr()) has only one caller, and this caller is running only when resuming from suspend when the interrupts are still off and only one CPU is active. Additionally this code is used only on rather old 32-bit CPUs not supporting SMP. For these reasons the first variant can be replaced by a simple call of mtrr_if->set(). Rename the second variant set_mtrr_cpuslocked() to set_mtrr() now that there is only one variant left, in order to have a shorter function name. Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-8-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit 03409069520974361ffb510c725305239b78b39f Author: Juergen Gross Date: Tue May 2 14:09:21 2023 +0200 x86/mtrr: Replace vendor tests in MTRR code Modern CPUs all share the same MTRR interface implemented via generic_mtrr_ops. At several places in MTRR code this generic interface is deduced via is_cpu(INTEL) tests, which is only working due to X86_VENDOR_INTEL being 0 (the is_cpu() macro is testing mtrr_if->vendor, which isn't explicitly set in generic_mtrr_ops). Test the generic CPU feature X86_FEATURE_MTRR instead. The only other place where the .vendor member of struct mtrr_ops is being used is in set_num_var_ranges(), where depending on the vendor the number of MTRR registers is determined. This can easily be changed by replacing .vendor with the static number of MTRR registers. It should be noted that the test "is_cpu(HYGON)" wasn't ever returning true, as there is no struct mtrr_ops with that vendor information. [ bp: Use mtrr_enabled() before doing mtrr_if-> accesses, esp. in mtrr_trim_uncached_memory() which gets called independently from whether mtrr_if is set or not. ] Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230502120931.20719-7-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit a153f254e5cdf8fa3a1df90a6ffed3063fede154 Author: Juergen Gross Date: Tue May 2 14:09:20 2023 +0200 x86/xen: Set MTRR state when running as Xen PV initial domain When running as Xen PV initial domain (aka dom0), MTRRs are disabled by the hypervisor, but the system should nevertheless use correct cache memory types. This has always kind of worked, as disabled MTRRs resulted in disabled PAT, too, so that the kernel avoided code paths resulting in inconsistencies. This bypassed all of the sanity checks the kernel is doing with enabled MTRRs in order to avoid memory mappings with conflicting memory types. This has been changed recently, leading to PAT being accepted to be enabled, while MTRRs stayed disabled. The result is that mtrr_type_lookup() no longer is accepting all memory type requests, but started to return WB even if UC- was requested. This led to driver failures during initialization of some devices. In reality MTRRs are still in effect, but they are under complete control of the Xen hypervisor. It is possible, however, to retrieve the MTRR settings from the hypervisor. In order to fix those problems, overwrite the MTRR state via mtrr_overwrite_state() with the MTRR data from the hypervisor, if the system is running as a Xen dom0. Fixes: 72cbc8f04fe2 ("x86/PAT: Have pat_enabled() properly reflect state when running on Xen") Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Boris Ostrovsky Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-6-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit c957f1f3c498bcce85c04e92e60afbae1fd10cde Author: Juergen Gross Date: Tue May 2 14:09:19 2023 +0200 x86/hyperv: Set MTRR state when running as SEV-SNP Hyper-V guest In order to avoid mappings using the UC- cache attribute, set the MTRR state to use WB caching as the default. This is needed in order to cope with the fact that PAT is enabled, while MTRRs are not supported by the hypervisor. Fixes: 90b926e68f50 ("x86/pat: Fix pat_x_mtrr_type() for MTRR disabled case") Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-5-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit 29055dc74287467bd7a053d60b4afe753832960d Author: Juergen Gross Date: Tue May 2 14:09:18 2023 +0200 x86/mtrr: Support setting MTRR state for software defined MTRRs When running virtualized, MTRR access can be reduced (e.g. in Xen PV guests or when running as a SEV-SNP guest under Hyper-V). Typically, the hypervisor will not advertize the MTRR feature in CPUID data, resulting in no MTRR memory type information being available for the kernel. This has turned out to result in problems (Link tags below): - Hyper-V SEV-SNP guests using uncached mappings where they shouldn't - Xen PV dom0 mapping memory as WB which should be UC- instead Solve those problems by allowing an MTRR static state override, overwriting the empty state used today. In case such a state has been set, don't call get_mtrr_state() in mtrr_bp_init(). The set state will only be used by mtrr_type_lookup(), as in all other cases mtrr_enabled() is being checked, which will return false. Accept the overwrite call only for selected cases when running as a guest. Disable X86_FEATURE_MTRR in order to avoid any MTRR modifications by just refusing them. [ bp: Massage. ] Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/all/4fe9541e-4d4c-2b2a-f8c8-2d34a7284930@nerdbynature.de/ Link: https://lore.kernel.org/lkml/BYAPR21MB16883ABC186566BD4D2A1451D7FE9@BYAPR21MB1688.namprd21.prod.outlook.com Signed-off-by: Borislav Petkov (AMD) commit d053b481a5f16dbd4f020c6b3ebdf9173fdef0e2 Author: Juergen Gross Date: Tue May 2 14:09:17 2023 +0200 x86/mtrr: Replace size_or_mask and size_and_mask with a much easier concept Replace size_or_mask and size_and_mask with the much easier concept of high reserved bits. While at it, instead of using constants in the MTRR code, use some new [ bp: - Drop mtrr_set_mask() - Unbreak long lines - Move struct mtrr_state_type out of the uapi header as it doesn't belong there. It also fixes a HDRTEST breakage "unknown type name ‘bool’" as Reported-by: kernel test robot - Massage. ] Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230502120931.20719-3-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit d0a396083e91e3f118c90afa95c91f8c243a6c11 Author: Steven Price Date: Thu Jun 1 11:55:48 2023 +0100 serial: core: Don't drop port_mutex in serial_core_remove_one_port Commit 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") required the caller to hold port_mutex rather than taking it locally. However the mutex_unlock() call wasn't removed causing the mutex to be dropped unexpectly. Remove the call to mutex_unlock() (and fix up the early return) to restore correct behaviour. Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Signed-off-by: Steven Price Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230601105548.29965-1-steven.price@arm.com Signed-off-by: Greg Kroah-Hartman commit 3355f4ee561da6065cc756bf54a3f8bb556889df Author: Marek Vasut Date: Tue May 30 21:28:05 2023 +0200 drm/bridge: tc358762: Add reset GPIO support Add reset GPIO support. The reset GPIO is cleared after supply regulator was enabled, and set before supply regulator is disabled. Signed-off-by: Marek Vasut Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230530192805.648646-2-marex@denx.de commit e8001973bb4567e8dece6fdcbe4c72313df9945e Author: Marek Vasut Date: Tue May 30 21:28:04 2023 +0200 dt-bindings: display: bridge: tc358762: Document reset-gpios This chip has one reset GPIO input, document it. The reset GPIO is optional as it is sometimes not connected on some hardware. Signed-off-by: Marek Vasut Acked-by: Conor Dooley Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230530192805.648646-1-marex@denx.de commit 4ff3dfc91c8458f65366f283167d1cd6f16be06f Merge: 735c9ee9a3747 26acc982c1c5c Author: Paolo Abeni Date: Thu Jun 1 13:41:40 2023 +0200 Merge branch 'splice-net-handle-msg_splice_pages-in-chelsio-tls' David Howells says: ==================== splice, net: Handle MSG_SPLICE_PAGES in Chelsio-TLS Here are patches to make Chelsio-TLS handle the MSG_SPLICE_PAGES internal sendmsg flag. MSG_SPLICE_PAGES is an internal hint that tells the protocol that it should splice the pages supplied if it can. Its sendpage implementation is then turned into a wrapper around that. ==================== Link: https://lore.kernel.org/r/20230531110008.642903-1-dhowells@redhat.com Signed-off-by: Paolo Abeni commit 26acc982c1c5c2835b0c6981d896329efa3557c3 Author: David Howells Date: Wed May 31 12:00:08 2023 +0100 chelsio: Convert chtls_sendpage() to use MSG_SPLICE_PAGES Convert chtls_sendpage() to use sendmsg() with MSG_SPLICE_PAGES rather than directly splicing in the pages itself. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Ayush Sawal cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: netdev@vger.kernel.org Signed-off-by: Paolo Abeni commit 116f7b361ebbb6095257c27da327e27000488214 Author: David Howells Date: Wed May 31 12:00:07 2023 +0100 chelsio: Support MSG_SPLICE_PAGES Make Chelsio's TLS offload sendmsg() support MSG_SPLICE_PAGES, splicing in pages from the source iterator if possible and copying the data in otherwise. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Ayush Sawal cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: netdev@vger.kernel.org Signed-off-by: Paolo Abeni commit 99e8dd39f34333d745e6c220be5d166e85214e6c Author: Charles Keepax Date: Thu Jun 1 11:10:36 2023 +0100 regmap: Add missing cache_only checks The current behaviour around cache_only is slightly inconsistent, most paths will only check cache_only if cache_bypass is false, and will return -EBUSY if a read attempts to go to the hardware whilst cache_only is true. However, a couple of paths will not check cache_only at all. The most notable of these being regmap_raw_read which will check cache_only in the case it processes the transaction one register at a time, but not in the case it handles them as a block. In the typical case a device has been put into cache_only whilst powered down this can cause physical reads to happen whilst the device is unavailable. Add a check in regmap_raw_read and move the check in regmap_noinc_read, adding a check for cache_bypass, such that all paths are covered and consistent. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20230601101036.1499612-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 02534c8e967b51940ae7c0cd99befe216f1c2c8d Author: Charles Keepax Date: Thu Jun 1 11:10:35 2023 +0100 regmap: regmap-irq: Move handle_post_irq to before pm_runtime_put Typically handle_post_irq is going to be used to manage some additional chip specific hardware operations required on each IRQ, these are very likely to want the chip to be resumed. For example the current in tree user max77620 uses this to toggle a global mask bit, which would obviously want the device resumed. It is worth noting this device does not specify the runtime_pm flag in regmap_irq_chip, so there is no actual issue. Move the callback to before the pm_runtime_put, so it will be called whilst the device is still resumed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20230601101036.1499612-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 089adf33701426869dd50d1b8b8a4abd25ae39ae Author: Trevor Wu Date: Thu Jun 1 11:49:39 2023 +0800 ASoC: SOF: mediatek: add adsp debug dump Add mt8188 and mt8186 .dbg_dump callback to print some information when DSP panic occurs. Signed-off-by: Trevor Wu Reviewed-by: Pierre-Louis Bossart Reviewed-by: Yaochun Hung Reviewed-by: Péter Ujfalusi Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230601034939.15802-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 8f4007e87ef9637aa557340762d6c3bbcbbd5669 Author: Richard Fitzgerald Date: Wed May 31 18:01:58 2023 +0100 firmware: cs_dsp: Log that a bin file was loaded Change the message at the start of bin file loading from cs_dsp_dbg() to cs_dsp_info() so that there is confirmation in the kernel log that a bin file was loaded, and the name of the file. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20230531170158.2744700-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit fd4762b6b5cfa27bf44f5d624ce74b7dce4a479c Author: Walker Chen Date: Fri May 26 22:54:01 2023 +0800 ASoC: starfive: Add JH7110 TDM driver Add tdm driver support for the StarFive JH7110 SoC. Signed-off-by: Walker Chen Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230526145402.450-3-walker.chen@starfivetech.com Signed-off-by: Mark Brown commit d9afe0d36cc27dcacbcecf02fe803a30d544698c Author: Walker Chen Date: Fri May 26 22:54:00 2023 +0800 ASoC: dt-bindings: Add TDM controller bindings for StarFive JH7110 Add bindings for TDM driver which supports multi-channel audio playback and capture on JH7110 platform. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Walker Chen Link: https://lore.kernel.org/r/20230526145402.450-2-walker.chen@starfivetech.com Signed-off-by: Mark Brown commit 9df6a4870dc371136e90330cfbbc51464ee66993 Author: Tianjia Zhang Date: Thu Jun 1 14:42:44 2023 +0800 integrity: Fix possible multiple allocation in integrity_inode_get() When integrity_inode_get() is querying and inserting the cache, there is a conditional race in the concurrent environment. The race condition is the result of not properly implementing "double-checked locking". In this case, it first checks to see if the iint cache record exists before taking the lock, but doesn't check again after taking the integrity_iint_lock. Fixes: bf2276d10ce5 ("ima: allocating iint improvements") Signed-off-by: Tianjia Zhang Cc: Dmitry Kasatkin Cc: # v3.10+ Signed-off-by: Mimi Zohar commit 4d6366e6ff43dcf6c23156c017829a926403bd7d Author: Thierry Reding Date: Tue May 30 12:53:08 2023 +0200 pinctrl: tegra: Consistently refer to SoC data The SoC-specific data is stored in pmx->soc and that's used throughout the driver to access this data. The probe function has access to a local version of that copy and uses it in some occasions. Replace them with the more standard pmx->soc access for more consistency. Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20230530105308.1292852-2-thierry.reding@gmail.com Signed-off-by: Linus Walleij commit fad57233501beb5bd25f037cb9128a533e710600 Author: Thierry Reding Date: Tue May 30 12:53:07 2023 +0200 pinctrl: tegra: Duplicate pinmux functions table The function table is filled with group information based on other instance-specific data at runtime. However, the function table can be shared between multiple instances, causing the ->probe() function for one instance to overwrite the table of a previously probed instance. Fix this by sharing only the function names and allocating a separate function table for each instance. Fixes: 5a0047360743 ("pinctrl: tegra: Separate Tegra194 instances") Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20230530105308.1292852-1-thierry.reding@gmail.com Signed-off-by: Linus Walleij commit 43049f17b5262826ef64a19762a096782398ef8f Author: Thomas Zimmermann Date: Tue May 30 17:12:28 2023 +0200 drm/i915: Implement dedicated fbdev I/O helpers Implement dedicated fbdev helpers for framebuffer I/O instead of using DRM's helpers. Use an fbdev generator macro for deferred I/O to create the fbdev callbacks. i915 was the only caller of the DRM helpers, so remove them from the helper module. i915's fbdev emulation is still incomplete as it doesn't implement deferred I/O and damage handling for mmaped pages. v4: * generate deferred-I/O helpers * use initializer macros for fb_ops v2: * use FB_IO_HELPERS options Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: "Ville Syrjälä" Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-14-tzimmermann@suse.de commit c6baad68d4e9e5c4c085045c70b99352d4825e05 Author: Thomas Zimmermann Date: Tue May 30 17:12:27 2023 +0200 drm/fbdev-generic: Implement dedicated fbdev I/O helpers Implement dedicated fbdev helpers for framebuffer I/O instead of using DRM's helpers. Use an fbdev generator macro for deferred I/O to create the callbacks. Fbdev-generic was the only caller of the DRM helpers, so remove them from the helper module. v4: * generate deferred-I/O helpers * use initializer macros for fb_ops v2: * use FB_SYS_HELPERS_DEFERRED option Signed-off-by: Thomas Zimmermann Tested-by: Sui Jingfeng Reviewed-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-13-tzimmermann@suse.de commit 4a2262c121130026306a36888f74f0736fc3fb1c Author: Thomas Zimmermann Date: Tue May 30 17:12:26 2023 +0200 drm/msm: Use regular fbdev I/O helpers Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Msm does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. Msm's fbdev emulation has been incomplete as it didn't implement damage handling. Partilly fix this by implementing damage handling for write and draw operation. It is still missing for mmaped pages. v4: * use initializer macros for struct fb_ops * partially support damage handling v2: * use FB_SYS_HELPERS option Signed-off-by: Thomas Zimmermann Reviewed-by: Dmitry Baryshkov Acked-by: Sam Ravnborg Cc: Rob Clark Cc: Abhinav Kumar Cc: Dmitry Baryshkov Cc: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-12-tzimmermann@suse.de commit c51b36207c04bad501ddd47a3d3fe0dbfd611474 Author: Thomas Zimmermann Date: Tue May 30 17:12:25 2023 +0200 drm/fb-helper: Export helpers for marking damage areas Export drm_fb_helper_damage() and drm_fb_helper_damage_range(), which handle damage areas for fbdev emulation. This is a temporary export that allows to move the DRM I/O helpers for fbdev into drivers. Only fbdev-generic and i915 need them. Both will be updated to implement damage handling by themselves and the exported functions will be removed. v4: * update interfaces Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-11-tzimmermann@suse.de commit e1d49d763eaadce0332add0d60e5a73eaa08d8fe Author: Thomas Zimmermann Date: Tue May 30 17:12:24 2023 +0200 drm/tegra: Use regular fbdev I/O helpers Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Tegra does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v4: * use initializer macros for struct fb_ops v2: * use FB_SYS_HELPERS option Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Cc: Thierry Reding Cc: Mikko Perttunen Cc: Jonathan Hunter Acked-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-10-tzimmermann@suse.de commit 95da53d63dcf8c1b24a43206593fcdb1fe82dfb2 Author: Thomas Zimmermann Date: Tue May 30 17:12:23 2023 +0200 drm/omapdrm: Use regular fbdev I/O helpers Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Omapdrm does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v4: * use initializer macros for struct fb_ops v2: * use FB_SYS_HELPERS option Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Cc: Tomi Valkeinen Reviewed-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-9-tzimmermann@suse.de commit 75bd32f5ce94bc365ba0b9b68bcf9de84a391d37 Author: Youghandhar Chintala Date: Fri May 26 12:41:08 2023 +0300 wifi: ath10k: Trigger STA disconnect after reconfig complete on hardware restart Currently, on WCN3990, the station disconnect after hardware recovery is not working as expected. This is because of setting the IEEE80211_SDATA_DISCONNECT_HW_RESTART flag very early in the hardware recovery process even before the driver invokes ieee80211_hw_restart(). On the contrary, mac80211 expects this flag to be set after ieee80211_hw_restart() is invoked for it to trigger station disconnect. Set the IEEE80211_SDATA_DISCONNECT_HW_RESTART flag in ath10k_reconfig_complete() instead to fix this. The other targets are not affected by this change, since the hardware params flag is not set. Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1 Fixes: 2c3fc50591ff ("ath10k: Trigger sta disconnect on hardware restart") Signed-off-by: Youghandhar Chintala Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230518101515.3820-1-quic_youghand@quicinc.com commit 2d4f9093e2d8531ad0a2bb98fe5b36dc8addf2a2 Author: Nidhi Jain Date: Fri May 26 12:41:07 2023 +0300 wifi: ath11k: Add HTT stats for PHY reset case New HTT stats are added with stats type 37 to provide PHY reset stats and PHY reset counter stats. PHY reset stats are used to display the current PHY-related operation information such as band, CCA threshold, current operating channel etc., PHY reset counter stats are used to display the PHY reset counter values like calibration counts, temperature based recalibration counts etc., Usage: echo 37 > /sys/kernel/debug/ieee80211/phyX/ath11k/htt_stats_type cat /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats Output: HTT_PHY_RESET_STATS_TLV: pdev_id = 0 chan_mhz = 5180 chan_band_center_freq1 = 5210 chan_band_center_freq2 = 0 chan_phy_mode = 18 chan_flags = 0x8 chan_num = 36 reset_cause = 0x50000 prev_reset_cause = 0x50000 phy_warm_reset_src = 0x0 rx_gain_tbl_mode = 0 xbar_val = 0xfac688 force_calibration = 0 phyrf_mode = 0 phy_homechan = 0 phy_tx_ch_mask = 0x3 phy_rx_ch_mask = 0x3 phybb_ini_mask = 0x5 phyrf_ini_mask = 0x0 phy_dfs_en_mask = 0x0 phy_sscan_en_mask = 0x0 phy_synth_sel_mask = 0x0 phy_adfs_freq = 0 cck_fir_settings = 0x0 phy_dyn_pri_chan = 6 cca_thresh = 0x26232020 dyn_cca_status = 0 rxdesense_thresh_hw = 0xcfe0afe rxdesense_thresh_sw = 0xcfe0afe HTT_PHY_RESET_COUNTERS_TLV: pdev_id = 0 cf_active_low_fail_cnt = 0 cf_active_low_pass_cnt = 0 phy_off_through_vreg_cnt = 0 force_calibration_cnt = 0 rf_mode_switch_phy_off_cnt = 0 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Nidhi Jain Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230517141242.2754293-1-quic_mkenna@quicinc.com commit 8aeba427296bff6a6051686f1d139c89a0b00e4c Author: Sowmiya Sree Elavalagan Date: Fri May 26 12:41:07 2023 +0300 wifi: ath11k: Allow ath11k to boot without caldata in ftm mode Currently, if ath11k is unable to load the calibration data file it will always exit. However the calibration data may not be present in factory test mode, so update the logic to allow the driver to execute in FTM mode even if downloading the calibration data fails. Tested-on : IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Sowmiya Sree Elavalagan Signed-off-by: Raj Kumar Bhagat Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230517135934.16408-5-quic_rajkbhag@quicinc.com commit b43310e44edc823a7f02af1e1e2b4e8a9abc7d91 Author: Govindaraj Saminathan Date: Fri May 26 12:41:07 2023 +0300 wifi: ath11k: factory test mode support Add support to process factory test mode commands (FTM) for calibration. By default firmware start with NORMAL mode and to process the FTM commands firmware needs to be restarted in FTM mode using module parameter ftm_mode. The pre-request is all the radios should be down before starting the test. When start command ATH11K_TM_CMD_TESTMODE_START is received, ar->state is set to Test Mode. If the FTM command or event length is greater than 256 bytes, it will be broken down into multiple segments and encoded with TLV header if it is segmented commands, else it is sent to firmware as it is. On receiving UTF event from firmware, if it is segmented event, the driver will wait until it receives all the segments and notify the complete data to user application. In case the segmented sequence are missed or lost from the firmware, driver will skip the already received partial data. In case of unsegmented UTF event from firmware, driver notifies the data to the user application as it comes. Applications handles the data further. Command to boot in ftm mode: insmod ath11k ftm_mode=1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Govindaraj Saminathan Co-developed-by: Sowmiya Sree Elavalagan Signed-off-by: Sowmiya Sree Elavalagan Signed-off-by: Raj Kumar Bhagat Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230517135934.16408-4-quic_rajkbhag@quicinc.com commit 86f85575a3f6a20cef1c8bb98e78585fe3a53ccc Author: Govindaraj Saminathan Date: Fri May 26 12:41:06 2023 +0300 wifi: ath11k: remove unused function ath11k_tm_event_wmi() The function ath11k_tm_event_wmi() is only defined and it is not used anywhere. Hence remove the unused. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Govindaraj Saminathan Signed-off-by: Raj Kumar Bhagat Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230517135934.16408-2-quic_rajkbhag@quicinc.com commit 859cc65f4d97e23cc4388f6e3bc12f6dadef4aaa Author: Thomas Zimmermann Date: Tue May 30 17:12:22 2023 +0200 drm/fbdev-dma: Use regular fbdev I/O helpers Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Fbdev-dma does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v4: * use initializer macros for struct fb_ops v2: * use FB_SYS_HELPERS option Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-8-tzimmermann@suse.de commit 6ebf23bf5ea3ba541cced9d7dee782c62f613f9b Author: Thomas Zimmermann Date: Tue May 30 17:12:21 2023 +0200 drm/radeon: Use regular fbdev I/O helpers Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Radeon does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v4: * use initializer macros for struct fb_ops v2: * use FB_IO_HELPERS option Signed-off-by: Thomas Zimmermann Acked-by: Alex Deucher Acked-by: Sam Ravnborg Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-7-tzimmermann@suse.de commit 7fca1dd909b3c1a0d7f2478fa939880d7b885491 Author: Thomas Zimmermann Date: Tue May 30 17:12:20 2023 +0200 drm/gma500: Use regular fbdev I/O helpers Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Gma500 does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v4: * use initializer macros for struct fb_ops v2: * use FB_IO_HELPERS option Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Cc: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-6-tzimmermann@suse.de commit ac9dc1b1b98e2177bd638d5af123669014152f3f Author: Thomas Zimmermann Date: Tue May 30 17:12:19 2023 +0200 drm/exynos: Use regular fbdev I/O helpers Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Exynos does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v4: * use initializer macros for struct fb_ops v3: * don't reorder Makefile rules (Sam) v2: * use FB_IO_HELPERS option Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Krzysztof Kozlowski Cc: Alim Akhtar Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-5-tzimmermann@suse.de commit eb958c99f6d4c5ff5f72e6b668b96e217929f8c5 Author: Thomas Zimmermann Date: Tue May 30 17:12:18 2023 +0200 drm/armada: Use regular fbdev I/O helpers Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Armada does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v4: * use initializer macros for struct fb_ops v2: * use FB_IO_HELPERS option Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Cc: Russell King Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-4-tzimmermann@suse.de commit f1061fa641b8b15c7815d58c20a6c29f2f1f5337 Author: Thomas Zimmermann Date: Tue May 30 17:12:17 2023 +0200 fbdev: Add initializer macros for struct fb_ops For framebuffers in I/O and system memory, add macros that set struct fb_ops to the respective callback functions. For deferred I/O, add macros that generate callback functions with damage handling. Add initializer macros that set struct fb_ops to the generated callbacks. These macros can remove a lot boilerplate code from fbdev drivers. The drivers are supposed to use the macro that is required for its framebuffer. Each macro is split into smaller helpers, so that drivers with non-standard callbacks can pick and customize callbacks as needed. There are individual helper macros for read/write, mmap and drawing. v5: * fix whitespace errors (Jingfeng) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-3-tzimmermann@suse.de commit 3b99ee5751c2dfa4b88bb00f573c78735563c4d7 Author: Thomas Zimmermann Date: Tue May 30 17:12:16 2023 +0200 fbdev: Add Kconfig options to select different fb_ops helpers Many fbdev drivers use the same set of fb_ops helpers. Add Kconfig options to select them at once. This will help with making DRM's fbdev emulation code more modular, but can also be used to simplify fbdev's driver configs. v3: * fix select statement (Jingfeng) Signed-off-by: Thomas Zimmermann Reviewed-by: Sui Jingfeng Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-2-tzimmermann@suse.de commit 139a57a9918ede7205e56070e41ba00a5f62799e Author: Jason Gunthorpe Date: Tue May 16 21:35:28 2023 -0300 iommu/fsl: Use driver_managed_dma to allow VFIO to work The FSL driver is mangling the iommu_groups to not have a group for its PCI bridge/controller (eg the thing passed to fsl_add_bridge()). Robin says this is so FSL could work with VFIO which would be blocked by having a probed driver on the platform_device in the same group. This is supported by comments from FSL: https://lore.kernel.org/all/C5ECD7A89D1DC44195F34B25E172658D459471@039-SN2MPN1-013.039d.mgd.msft.net .. PCIe devices share the same device group as the PCI controller. This becomes a problem while assigning the devices to the guest, as you are required to unbind all the PCIe devices including the controller from the host. PCIe controller can't be unbound from the host, so we simply delete the controller iommu_group. However, today, we use driver_managed_dma to allow PCI infrastructure devices that are 'security safe' to co-exist in groups and still allow VFIO to work. Set this flag for the fsl_pci_driver. Change fsl_pamu_device_group() so that it no longer removes the controller from any groups. For check_pci_ctl_endpt_part() mode this creates an extra group that contains only the controller. Otherwise force the controller's single group to be the group of all the PCI devices on the controller's hose. VFIO continues to work because of driver_managed_dma. Remove the iommu_group_remove_device() calls from fsl_pamu and lightly restructure its fsl_pamu_device_group() function. Signed-off-by: Jason Gunthorpe Tested-by: Michael Ellerman Link: https://lore.kernel.org/r/3-v2-ce71068deeec+4cf6-fsl_rm_groups_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 7977a08e113268edd2f69432596b3a2a56f27298 Author: Jason Gunthorpe Date: Tue May 16 21:35:27 2023 -0300 iommu/fsl: Move ENODEV to fsl_pamu_probe_device() The expectation is for the probe op to return ENODEV if the iommu is not able to support the device. Move the check for fsl,liodn to fsl_pamu_probe_device() simplify fsl_pamu_device_group() Signed-off-by: Jason Gunthorpe Tested-by: Michael Ellerman Link: https://lore.kernel.org/r/2-v2-ce71068deeec+4cf6-fsl_rm_groups_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 5f6489723df9a292328a8defc02227d660eea1b9 Author: Jason Gunthorpe Date: Tue May 16 21:35:26 2023 -0300 iommu/fsl: Always allocate a group for non-pci devices fsl_pamu_device_group() is only called if dev->iommu_group is NULL, so iommu_group_get() always returns NULL. Remove this test and just allocate a group. Call generic_device_group() for this like the other drivers. Signed-off-by: Jason Gunthorpe Tested-by: Michael Ellerman Link: https://lore.kernel.org/r/1-v2-ce71068deeec+4cf6-fsl_rm_groups_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 33675759a5fa150fb2815089fefe8e5d039354a6 Merge: 54df4868fb728 85d712f033d23 Author: Thomas Zimmermann Date: Thu Jun 1 11:31:39 2023 +0200 Merge drm/drm-next into drm-misc-next Backmerging from drm-next to get commit e24e6d695377 ("drm/i915/display: Implement fb_mmap callback function"). Signed-off-by: Thomas Zimmermann commit 88ca89202f8e8afb5225eb5244d79cd67c15d744 Author: Wen Gong Date: Fri May 26 12:41:06 2023 +0300 wifi: ath11k: add support default regdb while searching board-2.bin for WCN6855 Sometimes board-2.bin does not have the regdb data which matched the parameters such as vendor, device, subsystem-vendor, subsystem-device and etc. Add default regdb data with 'bus=%s' into board-2.bin for WCN6855, then ath11k use 'bus=pci' to search regdb data in board-2.bin for WCN6855. kernel: [ 122.515808] ath11k_pci 0000:03:00.0: boot using board name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262' kernel: [ 122.517240] ath11k_pci 0000:03:00.0: boot firmware request ath11k/WCN6855/hw2.0/board-2.bin size 6179564 kernel: [ 122.517280] ath11k_pci 0000:03:00.0: failed to fetch regdb data for bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262 from ath11k/WCN6855/hw2.0/board-2.bin kernel: [ 122.517464] ath11k_pci 0000:03:00.0: boot using board name 'bus=pci' kernel: [ 122.518901] ath11k_pci 0000:03:00.0: boot firmware request ath11k/WCN6855/hw2.0/board-2.bin size 6179564 kernel: [ 122.518915] ath11k_pci 0000:03:00.0: board name kernel: [ 122.518917] ath11k_pci 0000:03:00.0: 00000000: 62 75 73 3d 70 63 69 bus=pci kernel: [ 122.518918] ath11k_pci 0000:03:00.0: boot found match regdb data for name 'bus=pci' kernel: [ 122.518920] ath11k_pci 0000:03:00.0: boot found regdb data for 'bus=pci' kernel: [ 122.518921] ath11k_pci 0000:03:00.0: fetched regdb Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230517133959.8224-1-quic_wgong@quicinc.com commit 1798db0e623643dca5218056d419a7fa0f96bfd2 Author: Krzysztof Kozlowski Date: Sat Apr 22 00:31:52 2023 +0200 arm64: tegra: Add missing cache properties on Tegra210 As all level 2 and level 3 caches are unified, add required cache-unified property to fix warnings like: tegra210-p2371-0000.dtb: l2-cache: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 1a55fc4012d977de5f88fc7f07535783c9f8d86c Author: Andy Shevchenko Date: Sat May 27 14:40:57 2023 +0300 gpiolib: Unify allocation and initialization of GPIO valid mask Now that the of_gpiochip_add() doesn't use valid mask, we may unify GPIO valid mask allocation and initialization. With this it makes a symmetry to the similar which we done for IRQ chip. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 05a854c565d635710bb50e19c89df87e6df971ad Author: Andy Shevchenko Date: Sat May 27 14:40:56 2023 +0300 gpiolib: Consolidate the allocated mask freeing APIs There is a common API to allocate a mask, but more than one duplicative counterparts. Consolidate the latter into a single common API beneath. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 9df8c63c2b814be8c40d44d21dabaf074058c98b Author: Andy Shevchenko Date: Tue May 30 01:14:46 2023 +0300 gpiolib: Kill unused GPIOF_OPEN_* There is no use of the GPIOF_OPEN_* in the kernel. Kill it for good. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 2f804aca48322f02a8f44cca540663845ee80fb1 Author: Andy Shevchenko Date: Tue May 30 01:14:45 2023 +0300 gpiolib: Kill unused GPIOF_EXPORT and Co There is no use of the GPIOF_EXPORT in the kernel. Kill it for good. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit ea2b62f305893992156a798f665847e0663c9f41 Author: Prince Kumar Maurya Date: Tue May 30 18:31:41 2023 -0700 fs/sysv: Null check to prevent null-ptr-deref bug sb_getblk(inode->i_sb, parent) return a null ptr and taking lock on that leads to the null-ptr-deref bug. Reported-by: syzbot+aad58150cbc64ba41bdc@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=aad58150cbc64ba41bdc Signed-off-by: Prince Kumar Maurya Message-Id: <20230531013141.19487-1-princekumarmaurya06@gmail.com> Signed-off-by: Christian Brauner commit 54df4868fb728bebbb0fb7c3f187eba383e922b5 Author: Fabio Estevam Date: Wed May 31 19:44:07 2023 -0300 dt-bindings: samsung,mipi-dsim: Use port-base reference Use port-base reference for port@1. This fixes the following schema warning: imx8mp-dhcom-pdk3.dtb: dsi@32e60000: ports:port@1:endpoint: Unevaluated properties are not allowed ('data-lanes' was unexpected) From schema: Documentation/devicetree/bindings/display/bridge/samsung,mipi-dsim.yaml Fixes: 1f0d40d88f7a ("dt-bindings: bridge: Convert Samsung MIPI DSIM bridge to yaml") Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski [narmstrong: removed line break between tags] Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230531224407.1611952-1-festevam@gmail.com commit 8258d997b874bc0d3d0f4fe813a7527b1efec492 Author: Matt Ranostay Date: Wed May 31 23:53:38 2023 +0200 dt-bindings: ti-serdes-mux: Add defines for J784S4 SoC There are 4 lanes in the single instance of J784S4 SERDES. Each SERDES lane mux can select up to 4 different IPs. Define all the possible functions. Signed-off-by: Matt Ranostay Acked-by: Krzysztof Kozlowski Signed-off-by: Siddharth Vadapalli Signed-off-by: Peter Rosin Link: https://lore.kernel.org/r/755a14f1-92ad-ce4b-3fde-2a4b0650475c@axentia.se Signed-off-by: Greg Kroah-Hartman commit 5ccf40288ca0b4a0d000bee03829263a527cb46c Author: Jean Delvare Date: Wed May 31 23:53:27 2023 +0200 mux: mmio: drop obsolete dependency on COMPILE_TEST Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it is possible to test-build any driver which depends on OF on any architecture by explicitly selecting OF. Therefore depending on COMPILE_TEST as an alternative is no longer needed. It is actually better to always build such drivers with OF enabled, so that the test builds are closer to how each driver will actually be built on its intended target. Building them without OF may not test much as the compiler will optimize out potentially large parts of the code. In the worst case, this could even pop false positive warnings. Dropping COMPILE_TEST here improves the quality of our testing and avoids wasting time on non-existent issues. As a minor optimization, this also lets us drop of_match_ptr(), as we now know what it will resolve to, we might as well save cpp some work. Signed-off-by: Jean Delvare Signed-off-by: Peter Rosin Link: https://lore.kernel.org/r/bc790b4e-1cb4-4ef5-3da8-9d0e6b613bc7@axentia.se Signed-off-by: Greg Kroah-Hartman commit 243ff7e6a03533fd5f34036b4a2c297d844ffdc0 Author: Randy Dunlap Date: Wed May 31 22:03:25 2023 -0700 usb: typec: mux: fix static inline syntax error Fix build error when USB_SUPPORT is not set or TYPEC is not set by dropping an extraneous semi-colon: In file included from ../drivers/phy/qualcomm/phy-qcom-qmp-combo.c:23: ../include/linux/usb/typec_mux.h:77:1: error: expected identifier or '(' before '{' token 77 | { | ^ ../include/linux/usb/typec_mux.h:76:33: warning: 'fwnode_typec_mux_get' used but never defined 76 | static inline struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode); | ^~~~~~~~~~~~~~~~~~~~ Fixes: 3524fe31538c ("usb: typec: mux: Remove alt mode parameters from the API") Signed-off-by: Randy Dunlap Cc: Heikki Krogerus Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Link: https://lore.kernel.org/r/20230601050325.26883-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit 735c9ee9a374769b78c716de3c19a6c9440ede85 Merge: 6f4b98147b8df 7df4af51deb3c Author: Jakub Kicinski Date: Wed May 31 23:02:28 2023 -0700 Merge branch 'wangxun-netdev-features-support' Mengyuan Lou says: ==================== Wangxun netdev features support Implement tx_csum and rx_csum to support hardware checksum offload. Implement ndo_vlan_rx_add_vid and ndo_vlan_rx_kill_vid. Implement ndo_set_features. Enable macros in netdev features which wangxun can support. ==================== Link: https://lore.kernel.org/r/20230530022632.17938-1-mengyuanlou@net-swift.com Signed-off-by: Jakub Kicinski commit 7df4af51deb3cf10a23ad6f6ec3079f5af3c049c Author: Mengyuan Lou Date: Tue May 30 10:26:32 2023 +0800 net: txgbe: Implement vlan add and remove ops txgbe add ndo_vlan_rx_add_vid and ndo_vlan_rx_kill_vid. Signed-off-by: Mengyuan Lou Signed-off-by: Jakub Kicinski commit 6670f1ece2c8c069428ed00c8344b8dbbdcf9748 Author: Mengyuan Lou Date: Tue May 30 10:26:31 2023 +0800 net: txgbe: Add netdev features support Add features and hw_features that ngbe can support. Signed-off-by: Mengyuan Lou Signed-off-by: Jakub Kicinski commit 361bf4f47cee800b9740d8e1f8ba73ccc248a934 Author: Mengyuan Lou Date: Tue May 30 10:26:30 2023 +0800 net: ngbe: Implement vlan add and remove ops ngbe add ndo_vlan_rx_add_vid and ndo_vlan_rx_kill_vid. Signed-off-by: Mengyuan Lou Signed-off-by: Jakub Kicinski commit 50a908a0bd8b9e589fcdcc26f2acd57a253eca8d Author: Mengyuan Lou Date: Tue May 30 10:26:29 2023 +0800 net: ngbe: Add netdev features support Add features and hw_features that ngbe can support. Signed-off-by: Mengyuan Lou Signed-off-by: Jakub Kicinski commit 6dbedcffcf543afe1297f86fd6620327482a3a98 Author: Mengyuan Lou Date: Tue May 30 10:26:28 2023 +0800 net: libwx: Implement xx_set_features ops Implement wx_set_features function which to support ndo_set_features. Signed-off-by: Mengyuan Lou Signed-off-by: Jakub Kicinski commit f3b03c655f67834cb25174ac6f2b099c9e68c74d Author: Mengyuan Lou Date: Tue May 30 10:26:27 2023 +0800 net: wangxun: Implement vlan add and kill functions Implement vlan add/kill functions which add and remove vlan id in hardware. Signed-off-by: Mengyuan Lou Signed-off-by: Jakub Kicinski commit ef4f3c19f912820c15a6de0aedcc0fda67c7dd3a Author: Mengyuan Lou Date: Tue May 30 10:26:26 2023 +0800 net: wangxun: libwx add rx offload functions Add rx offload functions for wx_clean_rx_irq which supports ngbe and txgbe to implement rx offload function. Signed-off-by: Mengyuan Lou Signed-off-by: Jakub Kicinski commit 3403960cdf86c967442dccc2bec981e0093f716e Author: Mengyuan Lou Date: Tue May 30 10:26:25 2023 +0800 net: wangxun: libwx add tx offload functions Add tx offload functions for wx_xmit_frame_ring which includes wx_encode_tx_desc_ptype, wx_tso and wx_tx_csum. which supports ngbe and txgbe to implement tx offload function. Signed-off-by: Mengyuan Lou Signed-off-by: Jakub Kicinski commit 6f4b98147b8dfcabacb19b5c6abd087af66d0049 Author: Jakub Kicinski Date: Tue May 30 18:55:23 2023 -0700 devlink: make health report on unregistered instance warn just once Devlink health is involved in error recovery. Machines in bad state tend to be fairly unreliable, and occasionally get stuck in error loops. Even with a reasonable grace period devlink health may get a thousand reports in an hour. In case of reporting on an unregistered devlink instance the subsequent reports don't add much value. Switch to WARN_ON_ONCE() to avoid flooding dmesg and fleet monitoring dashboards. Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20230531015523.48961-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 6f7aee27b1bb5c5aab0813af20dda172b6a6ecab Merge: 748b442800e87 dbb050d2bfc8a Author: Jakub Kicinski Date: Wed May 31 22:33:46 2023 -0700 Merge branch 'add-support-for-vsc85xx-dt-rgmii-delays' Harini Katakam says: ==================== Add support for VSC85xx DT RGMII delays Provide an option to change RGMII delay value via devicetree. ==================== Link: https://lore.kernel.org/r/20230529122017.10620-1-harini.katakam@amd.com Signed-off-by: Jakub Kicinski commit dbb050d2bfc8a91dfa3d020c51633c077a53d18b Author: Harini Katakam Date: Mon May 29 17:50:17 2023 +0530 phy: mscc: Add support for RGMII delay configuration Add support for optional rx/tx-internal-delay-ps from devicetree. - When rx/tx-internal-delay-ps is/are specified, these take priority - When either is absent, 1) use 2ns for respective settings if rgmii-id/rxid/txid is/are present 2) use 0.2ns for respective settings if mode is rgmii Signed-off-by: Harini Katakam Signed-off-by: Jakub Kicinski commit 31605c01fb242806f5b8c9d08abe11328d514206 Author: Harini Katakam Date: Mon May 29 17:50:16 2023 +0530 phy: mscc: Use PHY_ID_MATCH_VENDOR to minimize PHY ID table All the PHY devices variants specified have the same mask and hence can be simplified to one vendor look up for 0x00070400. Any individual config can be identified by PHY_ID_MATCH_EXACT in the respective structure. Signed-off-by: Harini Katakam Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 748b442800e877a93a4fa1256418d0b66bdc55ce Author: Heiner Kallweit Date: Sun May 28 19:39:59 2023 +0200 net: don't set sw irq coalescing defaults in case of PREEMPT_RT If PREEMPT_RT is set, then assume that the user focuses on minimum latency. Therefore don't set sw irq coalescing defaults. This affects the defaults only, users can override these settings via sysfs. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/f9439c7f-c92c-4c2c-703e-110f96d841b7@gmail.com Signed-off-by: Jakub Kicinski commit 467e6cc73ef290f0099b1b86cec4f14060984916 Merge: f762326b2baa8 0818a6903c808 Author: Martin K. Petersen Date: Wed May 31 20:35:48 2023 -0400 Merge patch series "UFS host controller driver patches" Bart Van Assche says: Please consider these four UFS host controller driver patches for the next merge window. Link: https://lore.kernel.org/r/20230524203659.1394307-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 0818a6903c8081a17da4b1f50ff156537f99b02f Author: Bart Van Assche Date: Wed May 24 13:36:22 2023 -0700 scsi: ufs: core: Simplify driver shutdown All UFS host drivers call ufshcd_shutdown(). Hence, instead of calling ufshcd_shutdown() from the host driver .shutdown() callback, inline that function into ufshcd_wl_shutdown(). Reviewed-by: Adrian Hunter Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230524203659.1394307-5-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit b251f6c5fe3b57898896df06a5cf90865596ee5e Author: Bart Van Assche Date: Wed May 24 13:36:21 2023 -0700 scsi: ufs: core: Move ufshcd_wl_shutdown() Move the definition of ufshcd_wl_shutdown() to make the next patch in this series easier to review. Reviewed-by: Adrian Hunter Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230524203659.1394307-4-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 549e91a9bbaa0ee480f59357868421a61d369770 Author: Bart Van Assche Date: Wed May 24 13:36:20 2023 -0700 scsi: ufs: core: Fix handling of lrbp->cmd ufshcd_queuecommand() may be called two times in a row for a SCSI command before it is completed. Hence make the following changes: - In the functions that submit a command, do not check the old value of lrbp->cmd nor clear lrbp->cmd in error paths. - In ufshcd_release_scsi_cmd(), do not clear lrbp->cmd. See also scsi_send_eh_cmnd(). This commit prevents that the following appears if a command times out: WARNING: at drivers/ufs/core/ufshcd.c:2965 ufshcd_queuecommand+0x6f8/0x9a8 Call trace: ufshcd_queuecommand+0x6f8/0x9a8 scsi_send_eh_cmnd+0x2c0/0x960 scsi_eh_test_devices+0x100/0x314 scsi_eh_ready_devs+0xd90/0x114c scsi_error_handler+0x2b4/0xb70 kthread+0x16c/0x1e0 Fixes: 5a0b0cb9bee7 ("[SCSI] ufs: Add support for sending NOP OUT UPIU") Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230524203659.1394307-3-bvanassche@acm.org Acked-by: Adrian Hunter Signed-off-by: Martin K. Petersen commit fe8637f7708c16765ecf4035813efbfdd2c9be10 Author: Bart Van Assche Date: Wed May 24 13:36:19 2023 -0700 scsi: ufs: core: Increase the START STOP UNIT timeout from one to ten seconds One UFS vendor asked to increase the UFS timeout from 1 s to 3 s. Another UFS vendor asked to increase the UFS timeout from 1 s to 10 s. Hence this patch that increases the UFS timeout to 10 s. This patch can cause the total timeout to exceed 20 s, the Android shutdown timeout. This is fine since the loop around ufshcd_execute_start_stop() exists to deal with unit attentions and because unit attentions are reported quickly. Fixes: dcd5b7637c6d ("scsi: ufs: Reduce the START STOP UNIT timeout") Fixes: 8f2c96420c6e ("scsi: ufs: core: Reduce the power mode change timeout") Acked-by: Adrian Hunter Reviewed-by: Stanley Chu Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230524203659.1394307-2-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit f762326b2baa86ae647e2ba6832bc87e238f68ad Author: Sathya Prakash Date: Thu Jun 1 00:10:25 2023 +0530 scsi: mpi3mr: Propagate sense data for admin queue SCSI I/O Copy the sense data to internal driver buffer when the firmware completes any SCSI I/O command sent through admin queue with sense data for further use. Fixes: 506bc1a0d6ba ("scsi: mpi3mr: Add support for MPT commands") Cc: Signed-off-by: Sathya Prakash Signed-off-by: Sumit Saxena Link: https://lore.kernel.org/r/20230531184025.3803-1-sumit.saxena@broadcom.com Signed-off-by: Martin K. Petersen commit bc5fef019632d89183d9946150b775635ca73981 Merge: 14ce2c261d6cc ab248643d3d68 Author: Martin K. Petersen Date: Wed May 31 20:19:31 2023 -0400 Merge patch series "ufs: core: mcq: Add ufshcd_abort() and error handler support in MCQ mode" Bao D. Nguyen says: This patch series enables support for ufshcd_abort() and error handler in MCQ mode. Link: https://lore.kernel.org/r/cover.1685396241.git.quic_nguyenb@quicinc.com Signed-off-by: Martin K. Petersen commit ab248643d3d68b30f95ee9c238a5a20a06891204 Author: Bao D. Nguyen Date: Mon May 29 15:12:26 2023 -0700 scsi: ufs: core: Add error handling for MCQ mode Add support for error handling for MCQ mode. Suggested-by: Can Guo Co-developed-by: Stanley Chu Signed-off-by: Stanley Chu Signed-off-by: Bao D. Nguyen Link: https://lore.kernel.org/r/f0d923ee1f009f171a55c258d044e814ec0917ab.1685396241.git.quic_nguyenb@quicinc.com Reviewed-by: Stanley Chu Tested-by: Stanley Chu Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit 57d6ef4601c0b7975aab5144c7c3760846362e1c Author: Bao D. Nguyen Date: Mon May 29 15:12:25 2023 -0700 scsi: ufs: mcq: Use ufshcd_mcq_poll_cqe_lock() in MCQ mode In preparation for adding MCQ error handler support, update the MCQ code to use the ufshcd_mcq_poll_cqe_lock() in interrupt context instead of using ufshcd_mcq_poll_cqe_nolock(). This is to keep synchronization between MCQ interrupt and error handler contexts because both need to access the MCQ hardware in separate contexts. Signed-off-by: Bao D. Nguyen Link: https://lore.kernel.org/r/6ae727ad2a4040469b8f0632b55e0577d80da11b.1685396241.git.quic_nguyenb@quicinc.com Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Tested-by: Stanley Chu Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit f1304d4420777f82a1d844c606db3d9eca841765 Author: Bao D. Nguyen Date: Mon May 29 15:12:24 2023 -0700 scsi: ufs: mcq: Added ufshcd_mcq_abort() Add ufshcd_mcq_abort() to support UFS abort in MCQ mode. Signed-off-by: Bao D. Nguyen Link: https://lore.kernel.org/r/c80c0adadf09ac1d909ed53b36d54737f62c2332.1685396241.git.quic_nguyenb@quicinc.com Reviewed-by: Stanley Chu Tested-by: Stanley Chu Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit adf452611677d048203398f489e2175a9068f9f7 Author: Bao D. Nguyen Date: Mon May 29 15:12:23 2023 -0700 scsi: ufs: mcq: Add support for cleaning up MCQ resources Update ufshcd_clear_cmd() to clean up the MCQ resources similar to the function ufshcd_utrl_clear() does for SDB mode. Update ufshcd_try_to_abort_task() to support MCQ mode so that this function can be invoked in either mcq or SDB mode. Signed-off-by: Bao D. Nguyen Link: https://lore.kernel.org/r/dc6d30b3ee55e2072c162b2c08504ba349b87139.1685396241.git.quic_nguyenb@quicinc.com Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Tested-by: Stanley Chu Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit 8d7290348992f27242dd6a696fa2eede709f0b14 Author: Bao D. Nguyen Date: Mon May 29 15:12:22 2023 -0700 scsi: ufs: mcq: Add supporting functions for MCQ abort Add supporting functions to handle UFS abort in MCQ mode. Signed-off-by: Bao D. Nguyen Link: https://lore.kernel.org/r/d452c5ad62dc863cc067ec82daa0885ec98bd508.1685396241.git.quic_nguyenb@quicinc.com Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Tested-by: Stanley Chu Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit 7aa12d2fe89d7b95ad01ca38a291c7ec3efe7599 Author: Bao D. Nguyen Date: Mon May 29 15:12:21 2023 -0700 scsi: ufs: core: Update the ufshcd_clear_cmds() functionality In the ufshcd_clear_cmds(), the 2nd parameter would be the bit mask of the command to be cleared in the transfer request door bell register. This bit mask mechanism does not scale well in MCQ mode when the queue depth becomes much greater than 64. Change the 2nd parameter to the function to be the task_tag number of the corresponding bit to be cleared in the door bell register. By doing so, MCQ mode with a large queue depth can reuse this function. Since the behavior of this function is changed from handling multiple commands into a single command, rename ufshcd_clear_cmds() into ufshcd_clear_cmd(). Signed-off-by: Bao D. Nguyen Link: https://lore.kernel.org/r/8411fb5363acc90519bced30ea2c2ac582ff2340.1685396241.git.quic_nguyenb@quicinc.com Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Tested-by: Stanley Chu Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit a8f9a36e46344ea5bdc301c2fde0389a463bf0a3 Author: Bao D. Nguyen Date: Mon May 29 15:12:20 2023 -0700 scsi: ufs: core: Combine 32-bit command_desc_base_addr_lo/hi The UTP command descriptor base address is a 57-bit field in the UTP transfer request descriptor. Combine the two 32-bit command_desc_base_addr_lo/hi fields into a 64-bit for better handling of this field. Signed-off-by: Bao D. Nguyen Link: https://lore.kernel.org/r/4e6f7f5a15000cdae77c3014b477264f57bf572c.1685396241.git.quic_nguyenb@quicinc.com Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Tested-by: Stanley Chu Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit e4c26a1b74b559f86905de6443e592f248473fff Author: Niklas Cassel Date: Fri May 19 12:40:02 2023 +0200 ata: libata-eh: Clarify ata_eh_qc_retry() behavior at call site While the function documentation for ata_eh_qc_retry() is clear, from simply reading the single function that calls ata_eh_qc_retry(), it is not clear that ata_eh_qc_retry() might not retry the command. Add a comment in the single function that calls ata_eh_qc_retry() to clarify the behavior. [Damien] Added curly braces to "if () else" with multi-line comment. Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 14ce2c261d6cce89023a1df770d83df859e89f7e Author: Christophe JAILLET Date: Sat May 27 20:06:37 2023 +0200 scsi: fnic: Use vzalloc() Use vzalloc() instead of hand writing it with vmalloc()+memset(). This is less verbose. This also fixes some style issues :) Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/a1179941a6d440140513e681f4f3a1b92c8d83ae.1685210773.git.christophe.jaillet@wanadoo.fr Signed-off-by: Martin K. Petersen commit 4851c39aae3a917d09983e1c6948fa9d749b5448 Author: Changyuan Lyu Date: Fri May 26 23:51:55 2023 +0000 scsi: pm80xx: Add fatal error checks Add fatal error checking for the pm8001_phy_control() and pm8001_lu_reset() functions. Signed-off-by: Changyuan Lyu Signed-off-by: Pranav Prasad Link: https://lore.kernel.org/r/20230526235155.433243-1-pranavpp@google.com Signed-off-by: Martin K. Petersen commit b58b2ba351b07f546a8c1fb4eb46303231c24e95 Author: Niklas Schnelle Date: Mon May 22 12:50:36 2023 +0200 scsi: Add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-32-schnelle@linux.ibm.com Signed-off-by: Martin K. Petersen commit c3f903472ffacd2f776e119315a084d5b458b9ef Author: Niklas Schnelle Date: Mon May 22 12:50:26 2023 +0200 scsi: message: fusion: Add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-22-schnelle@linux.ibm.com Signed-off-by: Martin K. Petersen commit 6e8a669e61af80d69d5ee16e0ddf3160178a63bc Author: Justin Tee Date: Tue May 30 12:14:05 2023 -0700 scsi: lpfc: Fix incorrect big endian type assignments in FDMI and VMID paths The kernel test robot reported sparse warnings regarding the improper usage of beXX_to_cpu() macros. Change the flagged FDMI and VMID member variables to __beXX and redo the beXX_to_cpu() macros appropriately. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230530191405.21580-1-justintee8345@gmail.com Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305261159.lTW5NYrv-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202305260751.NWFvhLY5-lkp@intel.com/ Signed-off-by: Martin K. Petersen commit 21be4d0344c90c1769324dd880b8339d89f87c38 Merge: 2516cb8822956 b93f9eb8f4cde Author: Martin K. Petersen Date: Wed May 31 18:15:07 2023 -0400 Merge patch series "lpfc: Update lpfc to revision 14.2.0.13" Justin Tee says: Update lpfc to revision 14.2.0.13 This patch set contains discovery bug fixes, firmware logging improvements, clean up of CQ handling, and statistics collection enhancements. The patches were cut against Martin's 6.5/scsi-queue tree. Link: https://lore.kernel.org/r/20230523183206.7728-1-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit b93f9eb8f4cde7b0907d3f59b047cac6c3c2ae5f Author: Justin Tee Date: Tue May 23 11:32:06 2023 -0700 scsi: lpfc: Copyright updates for 14.2.0.13 patches Update copyrights to 2023 for files modified in the 14.2.0.13 patch set. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230523183206.7728-10-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 48abf8b4b563b38c994fd6e3be082a0dcff91be3 Author: Justin Tee Date: Tue May 23 11:32:05 2023 -0700 scsi: lpfc: Update lpfc version to 14.2.0.13 Update lpfc version to 14.2.0.13 Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230523183206.7728-9-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 93190ac1d4e7aa5fc959cf6a2bd294c1dfe6ee47 Author: Justin Tee Date: Tue May 23 11:32:04 2023 -0700 scsi: lpfc: Enhance congestion statistics collection Various improvements are made for collecting congestion statistics: - Pre-existing logic is replaced with use of an hrtimer for increased reporting accuracy. - Congestion timestamp information is reorganized into a single struct. - Common statistic collection logic is refactored into a helper routine. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230523183206.7728-8-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 6a84d015082ef8ef1d933230abc3fb1f6774d1d3 Author: Justin Tee Date: Tue May 23 11:32:03 2023 -0700 scsi: lpfc: Clean up SLI-4 CQE status handling There is mishandling of SLI-4 CQE status values larger than what is allowed by the LPFC_IOCB_STATUS_MASK of 4 bits. The LPFC_IOCB_STATUS_MASK is a leftover SLI-3 construct and serves no purpose in SLI-4 path. Remove the LPFC_IOCB_STATUS_MASK and clean up general CQE status handling in SLI-4 completion paths. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230523183206.7728-7-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit b9951e1cffaec55cecdc3a7fae7c81dbd15c7d11 Author: Justin Tee Date: Tue May 23 11:32:02 2023 -0700 scsi: lpfc: Change firmware upgrade logging to KERN_NOTICE instead of TRACE_EVENT A firmware upgrade does not necessitate dumping of phba->dbg_log[] to kmsg via LOG_TRACE_EVENT. A simple KERN_NOTICE log message should suffice to notify the user of successful or unsuccessful firmware upgrade. As such, firmware upgrade log messages are updated to use KERN_NOTICE instead of LOG_TRACE_EVENT. Additionally, in order to notify the user of reset type for instantiating newly downloaded firmware, lpfc_log_msg's default KERN_LEVEL is updated to 5 or KERN_NOTICE. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230523183206.7728-6-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 9914a3d033d3e1d836a43e93e9738e7dd44a096a Author: Justin Tee Date: Tue May 23 11:32:01 2023 -0700 scsi: lpfc: Revise NPIV ELS unsol rcv cmpl logic to drop ndlp based on nlp_state When NPIV ports are zoned to devices that support both initiator and target mode, a remote device's initiated PRLI results in unintended final kref clean up of the device's ndlp structure. This disrupts NPIV ports' discovery for target devices that support both initiator and target mode. Modify the NPIV lpfc_drop_node clause such that we allow the ndlp to live so long as it was in NLP_STE_PLOGI_ISSUE, NLP_STE_REG_LOGIN_ISSUE, or NLP_STE_PRLI_ISSUE nlp_state. This allows lpfc's issued PRLI completion routine to determine if the final kref clean up should execute rather than a remote device's issued PRLI. Fixes: db651ec22524 ("scsi: lpfc: Correct used_rpi count when devloss tmo fires with no recovery") Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230523183206.7728-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 73ded37869f8c57d0beae0d5b6434c107f780ae0 Author: Justin Tee Date: Tue May 23 11:32:00 2023 -0700 scsi: lpfc: Account for fabric domain ctlr device loss recovery Pre-existing device loss recovery logic via the NLP_IN_RECOV_POST_DEV_LOSS flag only handled Fabric Port Login, Fabric Controller, Management, and Name Server addresses. Fabric domain controllers fall under the same category for usage of the NLP_IN_RECOV_POST_DEV_LOSS flag. Add a default case statement to mark an ndlp for device loss recovery. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230523183206.7728-4-justintee8345@gmail.com Acked-by: Martin Wilck Signed-off-by: Martin K. Petersen commit fd57a687d44118c0a3859f61a110f6e12804dd16 Author: Justin Tee Date: Tue May 23 11:31:59 2023 -0700 scsi: lpfc: Clear NLP_IN_DEV_LOSS flag if already in rediscovery In dev_loss_tmo callback routine, we early return if the ndlp is in a state of rediscovery. This occurs when a target proactively PLOGIs or PRLIs after an RSCN before the dev_loss_tmo callback routine is scheduled to run. Move clear of the NLP_IN_DEV_LOSS flag before the ndlp state check in such cases. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230523183206.7728-3-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit a4157aaf0fb458c867b76f6cd63cb57fa91da318 Author: Justin Tee Date: Tue May 23 11:31:58 2023 -0700 scsi: lpfc: Fix use-after-free rport memory access in lpfc_register_remote_port() Due to a target port D_ID swap, it is possible for the lpfc_register_remote_port() routine to touch post mortem fc_rport memory when trying to access fc_rport->dd_data. The D_ID swap causes a simultaneous call to lpfc_unregister_remote_port(), where fc_remote_port_delete() reclaims fc_rport memory. Remove the fc_rport->dd_data->pnode NULL assignment because the following line reassigns ndlp->rport with an fc_rport object from fc_remote_port_add() anyways. The pnode nullification is superfluous. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230523183206.7728-2-justintee8345@gmail.com Acked-by: Martin Wilck Signed-off-by: Martin K. Petersen commit 2516cb882295694623811f2a1b2d33aa5fc9139c Author: Azeem Shaikh Date: Tue May 30 16:41:31 2023 +0000 scsi: ufs: Replace all non-returning strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230530164131.987213-1-azeemshaikh38@gmail.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 41e5d6f64d76435b4fd6856ddddb8e7c62087333 Author: Azeem Shaikh Date: Tue May 30 16:23:21 2023 +0000 scsi: smartpqi: Replace all non-returning strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230530162321.984035-1-azeemshaikh38@gmail.com Reviewed-by: Kees Cook Acked-by: Don Brace Signed-off-by: Martin K. Petersen commit af0ce90200c93203f042814c5c6e795a9110d5f7 Author: Azeem Shaikh Date: Tue May 30 16:03:23 2023 +0000 scsi: sym53c8xx: Replace all non-returning strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230530160323.412484-1-azeemshaikh38@gmail.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit dbe37c71d1246ec2c5f851aeede12db44ffd5d2c Author: Azeem Shaikh Date: Tue May 30 16:02:48 2023 +0000 scsi: message: fusion: Replace all non-returning strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230530160248.411637-1-azeemshaikh38@gmail.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 4dae0262fb990873adad012dc8338f99cbca8574 Author: Azeem Shaikh Date: Tue May 30 15:58:18 2023 +0000 scsi: libfcoe: Replace all non-returning strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230530155818.368562-1-azeemshaikh38@gmail.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 73be26b12dfd209e136da01dd7eefc85adc4df8d Author: Azeem Shaikh Date: Tue May 30 15:57:45 2023 +0000 scsi: lpfc: Replace all non-returning strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230530155745.343032-1-azeemshaikh38@gmail.com Reviewed-by: Justin Tee Signed-off-by: Martin K. Petersen commit 0b3dee602abf4a102a7a506d4b1c765355b27685 Author: Ben Dooks Date: Wed May 31 10:57:13 2023 +0100 PCI: Add PCI_EXT_CAP_ID_PL_32GT define Add the define for PCI_EXT_CAP_ID_PL_32GT for drivers that will want this whilst doing Gen5/Gen6 accesses. Link: https://lore.kernel.org/r/20230531095713.293229-1-ben.dooks@codethink.co.uk Signed-off-by: Ben Dooks Signed-off-by: Ben Dooks Signed-off-by: Bjorn Helgaas commit 09d199b6dcb6bd94a1f00cfbfa1ee7d3841444b0 Author: Jonathan McDowell Date: Wed May 10 13:02:28 2023 +0100 ARM: dts: axp209: Add iio-hwmon node for internal temperature This adds a DT node to hook up the internal temperature ADC to the iio-hwmon driver. The various voltage + current ADCs are consumed and exposed by their respective drivers, but this is not and is always available. Naming chosen to match the axp20x_ prefix the power sensors use. Signed-off-by: Jonathan McDowell Reviewed-by: Jernej Skrabec Link: https://lore.kernel.org/r/2a9bd53a65c4a154cccba622c60cbffcdceaeb95.1683719613.git.noodles@earth.li Signed-off-by: Jernej Skrabec commit c7ea52ed614227a3e3eaafdbd7b477d0129ab6ed Author: Jonathan McDowell Date: Wed May 10 13:02:02 2023 +0100 ARM: dts: sun5i: Add port E pinmux settings for mmc2 These alternate pins for mmc2 are brought out to the 40 pin U14 header on the C.H.I.P and can be used to add an external MMC device with a 4 bit interface. See https://byteporter.com/ntc-chip-micro-sd-slot/ for further details on how. Signed-off-by: Jonathan McDowell Reviewed-by: Jernej Skrabec Link: https://lore.kernel.org/r/7949169f581cab37175602188f44bc26e79a45c0.1683719613.git.noodles@earth.li Signed-off-by: Jernej Skrabec commit efb09e4ea81a7d513e3c4c81b8108c2b8066bc66 Author: Jonathan McDowell Date: Wed May 10 13:01:43 2023 +0100 ARM: dts: sun5i: chip: Enable bluetooth The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked up on UART3. Support for this didn't exist in mainline when the DTS was initially added, but it does now, so enable it. Signed-off-by: Jonathan McDowell Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/49ff7f3cc79838a55a89baae09a4ba12c88573fb.1683719613.git.noodles@earth.li Signed-off-by: Jernej Skrabec commit 21912a653d7dc9b79f3b7e9884179d7b7d593448 Author: Peter Xu Date: Thu Apr 27 16:11:12 2023 -0400 KVM: selftests: Allow dumping per-vcpu info for uffd threads There's one PER_VCPU_DEBUG in per-vcpu uffd threads but it's never hit. Trigger that when quit in normal ways (kick pollfd[1]), meanwhile fix the number of nanosec calculation. Signed-off-by: Peter Xu Reviewed-by: James Houghton Link: https://lore.kernel.org/r/20230427201112.2164776-3-peterx@redhat.com Signed-off-by: Sean Christopherson commit ba125de35da5184c5325bef5c4c89f6928ce8875 Author: Peter Xu Date: Thu Apr 27 16:11:11 2023 -0400 KVM: selftests: Setup vcpu_alias only for minor mode test This fixes two things: - Unbreaks MISSING mode test on anonymous memory type - Prefault alias mem before uffd thread creations, otherwise the uffd thread timing will be inaccurate when guest mem size is large, because it'll take prefault time into total time. Signed-off-by: Peter Xu Reviewed-by: James Houghton Link: https://lore.kernel.org/r/20230427201112.2164776-2-peterx@redhat.com Signed-off-by: Sean Christopherson commit 8ed0753b527dc00e759ec1e9e46c0ce9240c0f49 Author: Ashutosh Dixit Date: Wed May 24 14:56:29 2023 -0700 drm/i915/pmu: Make PMU sample array two-dimensional No functional changes but we can remove some unsightly index computation and read/write functions if we convert the PMU sample array from a one-dimensional to a two-dimensional array. v2: Retain read/store helpers (Tvrtko) Suggested-by: Tvrtko Ursulin Reviewed-by: Andrzej Hajda Reviewed-by: Tvrtko Ursulin Signed-off-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230524215629.97920-3-ashutosh.dixit@intel.com commit ab12902528f414cbb68d0da2b0d518b0ef10e696 Author: Ashutosh Dixit Date: Wed May 24 14:56:28 2023 -0700 drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked pmu_needs_timer() keeps the timer running even when GT is parked, ostensibly to sample requested/actual frequencies. However frequency_sample() has the following: /* Report 0/0 (actual/requested) frequency while parked. */ if (!intel_gt_pm_get_if_awake(gt)) return; The above code prevents frequencies to be sampled while the GT is parked. So we might as well turn off the sampling timer itself in this case and save CPU cycles/power. v2: Instead of turning freq bits off, return false, since no counters will run after this change when GT is parked (Tvrtko) v3: Remove gpu_active argument of pmu_needs_timer (Andrzej) Signed-off-by: Ashutosh Dixit Reviewed-by: Tvrtko Ursulin Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230524215629.97920-2-ashutosh.dixit@intel.com commit 09a36015d9a0940214c080f95afc605c47648bbd Author: Ashutosh Dixit Date: Tue May 23 13:40:42 2023 -0700 drm/i915/perf: Clear out entire reports after reading if not power of 2 size Clearing out report id and timestamp as means to detect unlanded reports only works if report size is power of 2. That is, only when report size is a sub-multiple of the OA buffer size can we be certain that reports will land at the same place each time in the OA buffer (after rewind). If report size is not a power of 2, we need to zero out the entire report to be able to detect unlanded reports reliably. v2: Add Fixes tag (Umesh) Fixes: 1cc064dce4ed ("drm/i915/perf: Add support for OA media units") Reviewed-by: Umesh Nerlige Ramappa Reviewed-by: Lionel Landwerlin Signed-off-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230523204042.4180641-1-ashutosh.dixit@intel.com commit b7a7ce1bb77b19ff2859d365da96285340fbc145 Author: Arnd Bergmann Date: Wed May 17 15:11:02 2023 +0200 vdso/timens: Always provide arch_get_vdso_data() prototype for vdso The arch_get_vdso_data() function is defined separately on each architecture, but only called when CONFIG_TIME_NS is set. If the definition is a global function, this causes a W=1 warning without TIME_NS: arch/x86/entry/vdso/vma.c:35:19: error: no previous prototype for 'arch_get_vdso_data' [-Werror=missing-prototypes] Move the prototype out of the #ifdef block to reliably turn off that warning. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230517131102.934196-15-arnd@kernel.org commit b866e7e7f995e14500d316a2e70977dee48cf690 Author: Linus Walleij Date: Thu Apr 20 23:17:35 2023 +0200 misc: sram: Generate unique names for subpools The current code will, if we do not specify unique labels for the SRAM subnodes, fail to register several nodes named the same. Example: sram@40020000 { (...) sram@0 { (...) }; sram@1000 { (...) }; }; Since the child->name in both cases will be "sram" the gen_pool_create() will fail because the name is not unique. Use dev_name() for the device as this will have bus ID set to the fully translated address for the node, and that will always be unique. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-sram-v2-2-6e62ad551faa@linaro.org Signed-off-by: Greg Kroah-Hartman commit ca3222ac4477250f74bcb324652e92563d606439 Author: Linus Walleij Date: Thu Apr 20 23:17:34 2023 +0200 dt-bindings: sram: Add compatible for ST-Ericsson U8500 eSRAM This adds an SoC-specific binding for the banks of eSRAM available in the ST-Ericsson U8500. Acked-by: Rob Herring Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-sram-v2-1-6e62ad551faa@linaro.org Signed-off-by: Greg Kroah-Hartman commit a5cb804b68b4072e685bd76831ee647c489db4c8 Author: Michal Simek Date: Tue May 16 15:46:14 2023 +0200 firmware: xilinx: Switch Michal Simek's email to new one @xilinx.com is still working but better to switch to new amd.com after AMD/Xilinx acquisition. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/36d119221aa12369c601cd37160306aeb84fc973.1684244767.git.michal.simek@amd.com Signed-off-by: Greg Kroah-Hartman commit b290df06811852d4cc36f4b8a2a30c2063197a74 Author: Yue Zhao Date: Thu May 4 00:29:44 2023 +0800 lkdtm: replace ll_rw_block with submit_bh Function ll_rw_block was removed in commit 79f597842069 ("fs/buffer: remove ll_rw_block() helper"). There is no unified function to sumbit read or write buffer in block layer for now. Consider similar sematics, we can choose submit_bh() to replace ll_rw_block() as predefined crash point. In submit_bh(), it also takes read or write flag as the first argument and invoke submit_bio() to submit I/O request to block layer. Fixes: 79f597842069 ("fs/buffer: remove ll_rw_block() helper") Signed-off-by: Yue Zhao Acked-by: Kees Cook Link: https://lore.kernel.org/r/20230503162944.3969-1-findns94@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7810f4dc879500b413bafab18ff870a68f38329a Author: Dave Jiang Date: Fri May 5 14:28:55 2023 -0700 base/node: Use 'property' to identify an access parameter Usage of 'attr' and 'name' in the context of a sysfs attribute definition are confusing because those read as being related to: struct attribute .name Rename 'name' to 'property' in preparation for renaming 'struct node_hmem_attr' to a more generic name that can be used in more contexts ('struct access_coordinate'), and not be confused with 'struct attribute'. Suggested-by: Dan Williams Reviewed-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/168332213518.2189163.18377767521423011290.stgit@djiang5-mobl3 Signed-off-by: Greg Kroah-Hartman commit cd00bc2ca42705bf141a2bf6fb5224c7ae628dbe Author: James Seo Date: Mon May 8 19:47:05 2023 -0700 driver core: device.h: add some missing kerneldocs struct device_attribute, struct dev_ext_attribute, dev_name(), and the DEVICE_ATTR() macros lack kerneldocs, preventing them from appearing in the driver core documentation and from being cross-referenced elsewhere. Add the missing kerneldocs (except for DEVICE_ATTR_IGNORE_LOCKDEP(), which is only meaningful on debug builds with CONFIG_DEBUG_LOCK_ALLOC defined, and is aliased to DEVICE_ATTR() otherwise). Tested-by: Randy Dunlap Acked-by: Randy Dunlap Signed-off-by: James Seo Link: https://lore.kernel.org/r/20230509024702.1977991-1-james@equiv.tech Signed-off-by: Greg Kroah-Hartman commit 84596e1ab09a2a2d4d4898444c01ca08b64cb7bd Author: Michal Wajdeczko Date: Tue May 9 22:11:03 2023 +0200 drm/i915/guc: Drop legacy CTB definitions We've already switched to new HXG definitions some time ago, drop legacy CTB definitions to avoid mistakes. Signed-off-by: Michal Wajdeczko Cc: Piotr Piórkowski Cc: John Harrison Reviewed-by: Piotr Piórkowski Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230509201103.538-1-michal.wajdeczko@intel.com commit 6543960cd3bdb9fabdd0567ab02f4d1168ee96d9 Author: Takashi Sakamoto Date: Tue May 30 19:52:48 2023 +0900 Documentation: Kunit: add MODULE_LICENSE to sample code The sample code has Kconfig for tristate configuration. In the case, it could be friendly to developers that the code has MODULE_LICENSE, since the missing MODULE_LICENSE brings error to modpost when the code is built as loadable kernel module. Signed-off-by: Takashi Sakamoto Reviewed-by: David Gow Signed-off-by: Shuah Khan commit d17ed982e4497070e4575ecd8c5afcfcb7210b8b Merge: 422db30713ac8 c041d33bf7ec7 Author: Arnaldo Carvalho de Melo Date: Wed May 31 15:31:56 2023 -0300 Merge tag 'perf-tools-fixes-for-v6.4-2-2023-05-30' into perf-tools-next perf tools fixes for v6.4: 2nd batch - Fix BPF CO-RE naming convention for checking the availability of fields on 'union perf_mem_data_src' on the running kernel. - Remove the use of llvm-strip on BPF skel object files, not needed, fixes a build breakage when the llvm package, that contains it in most distros, isn't installed. - Fix tools that use both evsel->{bpf_counter_list,bpf_filters}, removing them from a union. - Remove extra "--" from the 'perf ftrace latency' --use-nsec option, previously it was working only when using the '-n' alternative. - Don't stop building when both binutils-devel and a C++ compiler isn't available to compile the alternative C++ demangle support code, disable that feature instead. - Sync the linux/in.h and coresight-pmu.h header copies with the kernel sources. - Fix relative include path to cs-etm.h. Signed-off-by: Arnaldo Carvalho de Melo commit c0b92cc56295af02410378b4f85957578d4ea1c6 Author: Niklas Schnelle Date: Mon May 22 12:50:38 2023 +0200 speakup: add HAS_IOPORT dependency for SPEAKUP_SERIALIO In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. SPEAKUP_SERIALIO thus needs to depend on HAS_IOPORT. Reviewed-by: Samuel Thibault Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-34-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 34ff9e5101b9106e32da89ef96a97610595cbb68 Author: Niklas Schnelle Date: Mon May 22 12:50:31 2023 +0200 pcmcia: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. Add dependencies for those drivers that use them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-27-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit ce3e8ec08dacba16292e1c6948f2983d1d3f1eea Author: Niklas Schnelle Date: Mon May 22 12:50:28 2023 +0200 parport: PC style parport depends on HAS_IOPORT In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. As PC style parport uses these functions we need to handle this dependency. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-24-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 14360031f804b17c1707c316475db42c84853cf1 Author: Niklas Schnelle Date: Mon May 22 12:50:25 2023 +0200 mISDN: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. With that the !S390 dependency on ISDN can be removed as all drivers without HAS_IOPORT requirement now build. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Acked-by: Jakub Kicinski Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-21-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit e7f3dd801ecfa9eeb936133122dcecd433f76c4d Author: Niklas Schnelle Date: Mon May 22 12:50:15 2023 +0200 firmware: dmi-sysfs: handle HAS_IOPORT=n In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to guard sections of code calling them as alternative access methods. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-11-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 67d91a1e310afa9cbe1bb61169a2d3b8ca40ba67 Author: Niklas Schnelle Date: Mon May 22 12:50:12 2023 +0200 counter: add HAS_IOPORT_MAP dependency The 104_QUAD_8 counter driver uses devm_ioport_map() without depending on HAS_IOPORT_MAP. This means the driver is not usable on platforms such as s390 which do not support I/O port mapping. Add the missing HAS_IOPORT_MAP dependency to make this explicit. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-8-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit b5c75b68b7ded84d4c82118974ce3975a4dcaa74 Author: Niklas Schnelle Date: Mon May 22 12:50:11 2023 +0200 comedi: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-7-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 1fbb0b203574bb162fbbdc078f2b0907983995bd Author: Niklas Schnelle Date: Mon May 22 12:50:08 2023 +0200 char: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-4-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 30480b988f88c279752f3202a26b6fee5f586aef Author: Muchun Song Date: Tue May 23 10:40:17 2023 +0800 kernfs: fix missing kernfs_idr_lock to remove an ID from the IDR The root->ino_idr is supposed to be protected by kernfs_idr_lock, fix it. Fixes: 488dee96bb62 ("kernfs: allow creating kernfs objects with arbitrary uid/gid") Signed-off-by: Muchun Song Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230523024017.24851-1-songmuchun@bytedance.com Signed-off-by: Greg Kroah-Hartman commit 6bea9ea6bb21ccee2aad0aa2a845499e0aa2f7f9 Author: Vladislav Efanov Date: Wed May 17 15:50:25 2023 +0300 isa: Remove unnecessary checks The isa_dev->dev.platform_data is initialized with incoming parameter isa_driver. After it isa_dev->dev.platform_data is checked for NULL, but incoming parameter isa_driver is not NULL since it is dereferenced many times before this check. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Vladislav Efanov Acked-by: William Breathitt Gray Link: https://lore.kernel.org/r/20230517125025.434005-1-VEfanov@ispras.ru Signed-off-by: Greg Kroah-Hartman commit 54aa5b6044f89af046bcb7a9d0ca6408c0ebdd1f Author: Jesse Brandeburg Date: Thu May 11 09:45:01 2023 -0700 MAINTAINERS: add entry for auxiliary bus When auxiliary bus was added to the kernel the MAINTAINERS file wasn't updated with a mention of the files, contributors and reviewers. Fix that oversight by adding Dave and Ira, with GregKH as (same as current) owner. CC: Greg Kroah-Hartman Signed-off-by: Jesse Brandeburg Acked-by: Dave Ertman Acked-by: Ira Weiny Link: https://lore.kernel.org/r/20230511164501.3859674-1-jesse.brandeburg@intel.com Signed-off-by: Greg Kroah-Hartman commit 266bff73451afb2c98541acac41386ef4f08bb5e Author: Ivan Orlov Date: Sun May 14 21:23:53 2023 +0400 debugfs: Correct the 'debugfs_create_str' docs The documentation of the 'debugfs_create_str' says that the function returns a pointer to a dentry created, or an ERR_PTR in case of error. Actually, this is not true: this function doesn't return anything at all. Correct the documentation correspondingly. Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230514172353.52878-1-ivan.orlov0322@gmail.com Signed-off-by: Greg Kroah-Hartman commit ab7f17fb5b776933dd1a3431ae02bc2e394e2cba Author: Prathu Baronia Date: Thu May 18 19:16:56 2023 +0530 amba: move to_amba_device() to use container_of_const to_amba_device() now properly keeps the const-ness of the dev pointer passed into it, while as before it could be lost. Signed-off-by: Prathu Baronia Link: https://lore.kernel.org/r/20230518134656.9559-1-prathubaronia2011@gmail.com Signed-off-by: Greg Kroah-Hartman commit c9d9d11b8575a14d87e07950974950f975ba4b54 Author: Peter Colberg Date: Tue May 30 23:07:37 2023 -0400 uio: dfl: add vendor-specific feature id Add a Device Feature List (DFL) feature id as a generic mechanism to expose a vendor-specific FPGA IP to user space. The feature id is intended for use with IPs that do not need any kernel services beyond exposure to user space through the UIO DFL driver. The feature id is used in, e.g., Intel Oak Springs Canyon IPUs to expose various IPs to user space, e.g., Network Controller Sideband Interface (NC-SI), BaseNIC, and VirtIO management. Link: https://github.com/OPAE/dfl-feature-id Signed-off-by: Peter Colberg Signed-off-by: Matthew Gerlach Reviewed-by: Russ Weight Link: https://lore.kernel.org/r/20230531030737.12989-1-peter.colberg@intel.com Signed-off-by: Greg Kroah-Hartman commit 282c22a8bbeabd272c048ae243238638c9b7cefe Author: Zhangfei Gao Date: Thu May 11 17:59:21 2023 +0800 uacce: vma_close clears q->qfrs when freeing qfrs vma_close frees qfrs but not clears q->qfrs, which still points to the freed object, leading to subsequent mmap fail. So vma_close clears q->qfrs as well. Suggested-by: Al Viro Signed-off-by: Zhangfei Gao Link: https://lore.kernel.org/r/20230511095921.9331-3-zhangfei.gao@linaro.org Signed-off-by: Greg Kroah-Hartman commit df1b056d489d98c7c45fa89627102dd34b44496f Author: Zhangfei Gao Date: Thu May 11 17:59:20 2023 +0800 uacce: use q->mapping to replace inode->i_mapping The inode can be different in a container, for example, a docker and host both open the same uacce parent device, which uses the same uacce struct but different inode, so uacce->inode is not enough. What's worse, when docker stops, the inode will be destroyed as well, causing use-after-free in uacce_remove. So use q->mapping to replace uacce->inode->i_mapping. Signed-off-by: Weili Qian Signed-off-by: Zhangfei Gao Link: https://lore.kernel.org/r/20230511095921.9331-2-zhangfei.gao@linaro.org Signed-off-by: Greg Kroah-Hartman commit 24ee010bdabb15c601ab6ce2007ad32f4ef4a880 Author: Christophe JAILLET Date: Mon Apr 24 09:00:53 2023 +0200 misc: smpro-errmon: Remove the unneeded include This driver does not use i2c, so there is no point in including Remove it. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/002f7afb1a2935bc2357c4b1450b757f40902a8c.1682319647.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit f5070bf0e7e70e1ed3aaf422f8ae54ce70aa1bbe Author: Bo Svangård Date: Sat Apr 22 21:59:33 2023 +0200 misc/xilinx_sdfec: remove redundant _{open, release} function The functions are redundant as they are empty and performed by the misc driver. Signed-off-by: Bo Svangård Acked-by: Michal Simek Link: https://lore.kernel.org/r/20230422195933.523874-1-bo.svangard@sylog.se Signed-off-by: Greg Kroah-Hartman commit 2aa5ac633259843f656eb6ecff4cf01e8e810c5e Author: Sui Jingfeng Date: Wed May 31 18:27:44 2023 +0800 PCI: Add pci_clear_master() stub for non-CONFIG_PCI Add a pci_clear_master() stub when CONFIG_PCI is not set so drivers that support both PCI and platform devices don't need #ifdefs or extra Kconfig symbols for the PCI parts. [bhelgaas: commit log] Fixes: 6a479079c072 ("PCI: Add pci_clear_master() as opposite of pci_set_master()") Link: https://lore.kernel.org/r/20230531102744.2354313-1-suijingfeng@loongson.cn Signed-off-by: Sui Jingfeng Signed-off-by: Bjorn Helgaas Reviewed-by: Geert Uytterhoeven commit d3c6e265681285e046e0725dcbf5465482371e62 Author: Bjorn Helgaas Date: Tue Apr 18 16:13:00 2023 -0500 PCI: Expand comment about sorting pci_ids.h entries Clarify the request to sort Vendor ID and Device ID entries by numeric value, not alphabetically. Signed-off-by: Bjorn Helgaas commit d09a61024f6b78c6a08892fc916cdafd87b50365 Author: Alice Ryhl Date: Wed May 31 14:59:39 2023 +0000 rust: task: add `Send` marker to `Task` When a type also implements `Sync`, the meaning of `Send` is just "this type may be accessed mutably from threads other than the one it is created on". That's ok for this type. Signed-off-by: Alice Ryhl Reviewed-by: Andreas Hindborg Reviewed-by: Gary Guo Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Benno Lossin Link: https://lore.kernel.org/r/20230531145939.3714886-5-aliceryhl@google.com Signed-off-by: Miguel Ojeda commit be7724cdbbca22e0cbde1edf30941a7aa4378ded Author: Alice Ryhl Date: Wed May 31 14:59:38 2023 +0000 rust: specify when `ARef` is thread safe An `ARef` behaves just like the `Arc` when it comes to thread safety, so we can reuse the thread safety comments from `Arc` here. This is necessary because without this change, the Rust compiler will assume that things are not thread safe even though they are. Signed-off-by: Alice Ryhl Reviewed-by: Andreas Hindborg Reviewed-by: Boqun Feng Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Benno Lossin Link: https://lore.kernel.org/r/20230531145939.3714886-4-aliceryhl@google.com Signed-off-by: Miguel Ojeda commit d701e061cb14f589f8c4f48fd7fbe81c0e34b7e7 Author: Alice Ryhl Date: Wed May 31 14:59:37 2023 +0000 rust: sync: reword the `Arc` safety comment for `Sync` The safety comment on `impl Sync for Arc` references the Send safety comment. This commit avoids that in case the two comments drift apart in the future. Suggested-by: Andreas Hindborg Signed-off-by: Alice Ryhl Reviewed-by: Andreas Hindborg Reviewed-by: Boqun Feng Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Benno Lossin Link: https://lore.kernel.org/r/20230531145939.3714886-3-aliceryhl@google.com Signed-off-by: Miguel Ojeda commit f8110cd157833e721f50f779dc70f8ae5b429832 Author: Alice Ryhl Date: Wed May 31 14:59:36 2023 +0000 rust: sync: reword the `Arc` safety comment for `Send` The safety comment on `impl Send for Arc` talks about "directly" accessing the value, when it really means "accessing the value with a mutable reference". This commit clarifies that. Suggested-by: Boqun Feng Signed-off-by: Alice Ryhl Reviewed-by: Andreas Hindborg Reviewed-by: Boqun Feng Reviewed-by: Gary Guo Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Benno Lossin Link: https://lore.kernel.org/r/20230531145939.3714886-2-aliceryhl@google.com Signed-off-by: Miguel Ojeda commit 47329ba14b5aac1ac975544eee71ecc888557d23 Author: Alice Ryhl Date: Wed May 17 20:08:14 2023 +0000 rust: sync: implement `AsRef` for `Arc` This trait lets you use `Arc` in code that is generic over smart pointer types. The `AsRef` trait should be implemented on all smart pointers. The standard library also implements it on the ordinary `Arc`. Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Benno Lossin Reviewed-by: Gary Guo Reviewed-by: Andreas Hindborg Link: https://lore.kernel.org/r/20230517200814.3157916-2-aliceryhl@google.com Signed-off-by: Miguel Ojeda commit bd780aea671eda9660837c05d9ba58de22ceecad Author: Alice Ryhl Date: Wed May 17 20:08:13 2023 +0000 rust: sync: add `Arc::ptr_eq` Add a method for comparing whether two `Arc` pointers reference the same underlying object. This comparison can already be done by getting a reference to the inner values and comparing whether the references have the same address. However, writing `Arc::ptr_eq(a, b)` is generally less error-prone than doing the same check on the references, since you might otherwise accidentally compare the two `&Arc` references instead, which wont work because those are pointers to pointers to the inner value, when you just want to compare the pointers to the inner value. Also, this method might optimize better because getting a reference to the inner value involves offsetting the pointer, which this method does not need to do. Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Alice Ryhl Reviewed-by: Benno Lossin Reviewed-by: Gary Guo Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Andreas Hindborg Link: https://lore.kernel.org/r/20230517200814.3157916-1-aliceryhl@google.com Signed-off-by: Miguel Ojeda commit e37b654c379e514357ccadb22c6291d3471fa5e5 Author: Alice Ryhl Date: Thu May 4 06:48:54 2023 +0000 rust: error: add missing error codes This adds the error codes from `include/linux/errno.h` to the list of Rust error constants. These errors were not included originally, because they are not supposed to be visible from userspace. However, they are still a perfectly valid error to use when writing a kernel driver. For example, you might want to return ERESTARTSYS if you receive a signal during a call to `schedule`. This patch inserts an annotation to skip rustfmt on the list of error codes. Without it, three of the error codes are split over several lines, which looks terribly inconsistent. Signed-off-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Link: https://lore.kernel.org/r/20230504064854.774820-1-aliceryhl@google.com Signed-off-by: Miguel Ojeda commit 66bd7533ef19bf8a3515ce702013aba368f58df3 Author: Alice Ryhl Date: Wed May 3 14:10:16 2023 +0000 rust: str: add conversion from `CStr` to `CString` These methods can be used to copy the data in a temporary c string into a separate allocation, so that it can be accessed later even if the original is deallocated. The API in this change mirrors the standard library API for the `&str` and `String` types. The `ToOwned` trait is not implemented because it assumes that allocations are infallible. Reviewed-by: Benno Lossin Signed-off-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Andreas Hindborg Link: https://lore.kernel.org/r/20230503141016.683634-1-aliceryhl@google.com Signed-off-by: Miguel Ojeda commit 4a59081c09cbfe17505baf3db50ebb9b97290bae Author: Alice Ryhl Date: Tue May 2 12:40:15 2023 +0000 rust: error: allow specifying error type on `Result` Currently, if the `kernel::error::Result` type is in scope (which is often is, since it's in the kernel's prelude), you cannot write `Result` when you want to use a different error type than `kernel::error::Error`. To solve this we change the error type from being hard-coded to just being a default generic parameter. This still lets you write `Result` when you just want to use the `Error` error type, but also lets you write `Result` when necessary. Signed-off-by: Alice Ryhl Reviewed-by: Benno Lossin Reviewed-by: Asahi Lina Reviewed-by: Andreas Hindborg Reviewed-by: Gary Guo Link: https://lore.kernel.org/r/20230502124015.356001-1-aliceryhl@google.com Signed-off-by: Miguel Ojeda commit 309786c2393c7b3375c232b137e52613c8099327 Author: Benno Lossin Date: Mon Apr 24 08:11:49 2023 +0000 rust: init: update macro expansion example in docs Also improve the explaining comments. Signed-off-by: Benno Lossin Reviewed-by: Gary Guo Reviewed-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Link: https://lore.kernel.org/r/20230424081112.99890-4-benno.lossin@proton.me Signed-off-by: Miguel Ojeda commit 52b7bb46ae79fb6ff0fd806e22f5b4f5c66b71f0 Author: Benno Lossin Date: Mon Apr 24 08:11:43 2023 +0000 rust: macros: replace Self with the concrete type in #[pin_data] When using `#[pin_data]` on a struct that used `Self` in the field types, a type error would be emitted when trying to use `pin_init!`. Since an internal type would be referenced by `Self` instead of the defined struct. This patch fixes this issue by replacing all occurrences of `Self` in the `#[pin_data]` macro with the concrete type circumventing the issue. Since rust allows type definitions inside of blocks, which are expressions, the macro also checks for these and emits a compile error when it finds `trait`, `enum`, `union`, `struct` or `impl`. These keywords allow creating new `Self` contexts, which conflicts with the current implementation of replacing every `Self` ident. If these were allowed, some `Self` idents would be replaced incorrectly. Signed-off-by: Benno Lossin Reported-by: Alice Ryhl Reviewed-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Gary Guo Link: https://lore.kernel.org/r/20230424081112.99890-3-benno.lossin@proton.me [ Added newline in commit message ] Signed-off-by: Miguel Ojeda commit e957b9cda31d5114905b0485af02d332fbd079d7 Author: Benno Lossin Date: Mon Apr 24 08:11:38 2023 +0000 rust: macros: refactor generics parsing of `#[pin_data]` into its own function Other macros might also want to parse generics. Additionally this makes the code easier to read, as the next commit will introduce more code in `#[pin_data]`. Also add more comments to explain how parsing generics work. Signed-off-by: Benno Lossin Reviewed-by: Alice Ryhl Reviewed-by: Gary Guo Reviewed-by: Martin Rodriguez Reboredo Link: https://lore.kernel.org/r/20230424081112.99890-2-benno.lossin@proton.me Signed-off-by: Miguel Ojeda commit b8342addded0099610902775617917fdee6edde8 Author: Benno Lossin Date: Mon Apr 24 08:11:33 2023 +0000 rust: macros: fix usage of `#[allow]` in `quote!` When using `quote!` as part of an expression that was not the last one in a function, the `#[allow(clippy::vec_init_then_push)]` attribute would be present on an expression, which is not allowed. This patch refactors that part of the macro to use a statement instead. Signed-off-by: Benno Lossin Reviewed-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Gary Guo Link: https://lore.kernel.org/r/20230424081112.99890-1-benno.lossin@proton.me Signed-off-by: Miguel Ojeda commit 6883b29c6cae6077a095fac0ef69f30d0880d362 Author: Miguel Ojeda Date: Mon Mar 6 23:09:59 2023 +0100 docs: rust: point directly to the standalone installers The Quick Start guide points to the Rust programming language front page when it mentions the possibility of using the standalone installers instead of `rustup`. This was done to have a hopefully stable link, but it is not too helpful: readers need to figure out how to reach the standalone installers from there. Thus point directly to the page (and anchor) with the table that contains the standalone installers (plus signing key etc.). If the link breaks in the future, we can always update it as needed. And anyway having the full link includes the domain and gives more information about where the old docs were in such a broken link case, which may help. Link: https://lore.kernel.org/linux-doc/CANiq72=gpzQyh1ExGbBWWNdgH-mTATdG5F600jKD1=NLLCn7wg@mail.gmail.com/ Reviewed-by: Vincenzo Palazzo Link: https://lore.kernel.org/r/20230306220959.240235-1-ojeda@kernel.org [ Removed "install ``rustup``" ] Signed-off-by: Miguel Ojeda commit 73b3108dfd9d53ea565c0777a27007c1c621467d Author: Steve Wahl Date: Fri May 19 14:07:52 2023 -0500 x86/platform/uv: Update UV[23] platform code for SNC Previous Sub-NUMA Clustering changes need not just a count of blades present, but a count that includes any missing ids for blades not present; in other words, the range from lowest to highest blade id. Signed-off-by: Steve Wahl Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230519190752.3297140-9-steve.wahl%40hpe.com commit 89827568a82d5856f3c8d329d3c2bc0f47385eb9 Author: Steve Wahl Date: Fri May 19 14:07:51 2023 -0500 x86/platform/uv: Remove remaining BUG_ON() and BUG() calls Replace BUG and BUG_ON with WARN_ON_ONCE and carry on as best as we can. Signed-off-by: Steve Wahl Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230519190752.3297140-8-steve.wahl%40hpe.com commit 8a50c58519271dd24ba760bb282875f6ad66ee71 Author: Steve Wahl Date: Fri May 19 14:07:50 2023 -0500 x86/platform/uv: UV support for sub-NUMA clustering Sub-NUMA clustering (SNC) invalidates previous assumptions of a 1:1 relationship between blades, sockets, and nodes. Fix these assumptions and build tables correctly when SNC is enabled. Signed-off-by: Steve Wahl Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230519190752.3297140-7-steve.wahl%40hpe.com commit 45e9f9a99529a54a7ed195eea4aad102b9eadb23 Author: Steve Wahl Date: Fri May 19 14:07:49 2023 -0500 x86/platform/uv: Helper functions for allocating and freeing conversion tables Add alloc_conv_table() and FREE_1_TO_1_TABLE() to reduce duplicated code among the conversion tables we use. Signed-off-by: Steve Wahl Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230519190752.3297140-6-steve.wahl%40hpe.com commit 35bd896ccc2fa8dfb20df705a44e9d26665f1085 Author: Steve Wahl Date: Fri May 19 14:07:48 2023 -0500 x86/platform/uv: When searching for minimums, start at INT_MAX not 99999 Using a starting value of INT_MAX rather than 999999 or 99999 means this algorithm won't fail should the numbers being compared ever exceed this value. Signed-off-by: Steve Wahl Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230519190752.3297140-5-steve.wahl%40hpe.com commit e4860f03779cadff011a7a8685c7157ebc133bda Author: Steve Wahl Date: Fri May 19 14:07:47 2023 -0500 x86/platform/uv: Fix printed information in calc_mmioh_map Fix incorrect mask names and values in calc_mmioh_map() that caused it to print wrong NASID information. And an unused blade position is not an error condition, but will yield an invalid NASID value, so change the invalid NASID message from an error to a debug message. Signed-off-by: Steve Wahl Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230519190752.3297140-4-steve.wahl%40hpe.com commit 8c646cee0ae3c0a19a7d9fdb847c45c729cae945 Author: Steve Wahl Date: Fri May 19 14:07:46 2023 -0500 x86/platform/uv: Introduce helper function uv_pnode_to_socket. Add and use uv_pnode_to_socket() function, which parallels other helper functions in here, and will enable avoiding duplicate code in an upcoming patch. Signed-off-by: Steve Wahl Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230519190752.3297140-3-steve.wahl%40hpe.com commit fd27bea340012412a5ad1476b0a40381d7407550 Author: Steve Wahl Date: Fri May 19 14:07:45 2023 -0500 x86/platform/uv: Add platform resolving #defines for misc GAM_MMIOH_REDIRECT* Upcoming changes will require use of new #defines UVH_RH_GAM_MMIOH_REDIRECT_CONFIG0_NASID_MASK and UVH_RH_GAM_MMIOH_REDIRECT_CONFIG1_NASID_MASK, which provide the appropriate values on different uv platforms. Also, fix typo that defined a couple of "*_CONFIG0_*" values twice where "*_CONFIG1_*" was intended. Signed-off-by: Steve Wahl Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230519190752.3297140-2-steve.wahl%40hpe.com commit 7b1a78babd0d2cd27aa07255dee0c2d7ac0f31e3 Author: Randy Dunlap Date: Sun May 21 15:52:16 2023 -0700 soc/fsl/qe: fix usb.c build errors Fix build errors in soc/fsl/qe/usb.c when QUICC_ENGINE is not set. This happens when PPC_EP88XC is set, which selects CPM1 & CPM. When CPM is set, USB_FSL_QE can be set without QUICC_ENGINE being set. When USB_FSL_QE is set, QE_USB deafults to y, which causes build errors when QUICC_ENGINE is not set. Making QE_USB depend on QUICC_ENGINE prevents QE_USB from defaulting to y. Fixes these build errors: drivers/soc/fsl/qe/usb.o: in function `qe_usb_clock_set': usb.c:(.text+0x1e): undefined reference to `qe_immr' powerpc-linux-ld: usb.c:(.text+0x2a): undefined reference to `qe_immr' powerpc-linux-ld: usb.c:(.text+0xbc): undefined reference to `qe_setbrg' powerpc-linux-ld: usb.c:(.text+0xca): undefined reference to `cmxgcr_lock' powerpc-linux-ld: usb.c:(.text+0xce): undefined reference to `cmxgcr_lock' Fixes: 5e41486c408e ("powerpc/QE: add support for QE USB clocks routing") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Link: https://lore.kernel.org/all/202301101500.pillNv6R-lkp@intel.com/ Suggested-by: Michael Ellerman Cc: Christophe Leroy Cc: Leo Li Cc: Masahiro Yamada Cc: Nicolas Schier Cc: Qiang Zhao Cc: linuxppc-dev Cc: linux-arm-kernel@lists.infradead.org Cc: Kumar Gala Acked-by: Nicolas Schier Signed-off-by: Li Yang commit 8f0c17bf6bf33b1dc4b9ebf33650f7e60b7d5c55 Author: Bartosz Golaszewski Date: Tue Apr 11 15:04:42 2023 +0200 scsi: dt-bindings: ufs: qcom: Add compatible for sa8775p Add the compatible string for the UFS on sa8775p platforms. Signed-off-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230411130446.401440-2-brgl@bgdev.pl Reviewed-by: Krzysztof Kozlowski Signed-off-by: Martin K. Petersen commit 5225229b8fdfb3e65520c43547ecf9a737161c3f Author: Johannes Thumshirn Date: Wed May 31 04:50:35 2023 -0700 floppy: use __bio_add_page for adding single page to bio The floppy code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/33c445a3b431270c72d9be03d5da1b08ae983920.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 34848c910b911838e1e83e1370cb988b578c8860 Author: Johannes Thumshirn Date: Wed May 31 04:50:34 2023 -0700 zram: use __bio_add_page for adding single page to bio The zram writeback code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Reviewed-by: Sergey Senozhatsky Reviewed-by: Christoph Hellwig Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/cfd141dd7773315879a126f2aa81b7f698bc0e10.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 0fa5b08cf6e17b0a64ffcc5894d8efe186691ab8 Author: Johannes Thumshirn Date: Wed May 31 04:50:33 2023 -0700 zonefs: use __bio_add_page for adding single page to bio The zonefs superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Acked-by: Damien Le Moal Reviewed-by: Christoph Hellwig Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/04c9978ccaa0fc9871cd4248356638d98daccf0c.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit effa7ddeeba782406c81b572791a142fbdaf6b05 Author: Johannes Thumshirn Date: Wed May 31 04:50:32 2023 -0700 gfs2: use __bio_add_page for adding single page to bio The GFS2 superblock reading code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Reviewed-by: Andreas Gruenbacher Reviewed-by: Christoph Hellwig Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/087c67d4e4973f949d3519c1e4822784ce583c5a.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 2896db174ced7a800863223f9e74543b98271ba0 Author: Johannes Thumshirn Date: Wed May 31 04:50:31 2023 -0700 jfs: logmgr: use __bio_add_page to add single page to bio The JFS IO code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Acked-by: Dave Kleikamp Reviewed-by: Christoph Hellwig Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/9fb5ed86d19f6e0b6f64dfc4109a48ff8ff24497.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 6eea4ff8528d6a5b9f0eeb47992e48a8f44b5b8f Author: Johannes Thumshirn Date: Wed May 31 04:50:30 2023 -0700 md: raid5: use __bio_add_page to add single page to new bio The raid5-ppl submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. For adding consecutive pages, the return is actually checked and a new bio is allocated if adding the page fails. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/27e6bcd762354bff74602e89159cdd12ae3d1fa9.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit b0a2f17cad9d3fa564d67c543f5d19343401fefd Author: Johannes Thumshirn Date: Wed May 31 04:50:29 2023 -0700 md: raid5-log: use __bio_add_page to add single page The raid5 log metadata submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/832a810d6c9e71f88b0a39cb076a8c70e8bcb821.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 3c383235c51dcd6198d37ac3ac06e2acad79f981 Author: Johannes Thumshirn Date: Wed May 31 04:50:28 2023 -0700 md: use __bio_add_page to add single page The md-raid superblock writing code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-of_-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Reviewed-by: Christoph Hellwig Acked-by: Song Liu Link: https://lore.kernel.org/r/ca196f5e650e318106dbb4496eb6cbac4bc800bd.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 741af75d4027b1229fc6e62f4e3c4378dfe04897 Author: Johannes Thumshirn Date: Wed May 31 04:50:27 2023 -0700 fs: buffer: use __bio_add_page to add single page to bio The buffer_head submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Gou Hao Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/84ff2dcbe81b258a73ad900adb5266e208b61a4d.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit fc8ac3e539561aff1c0a255d701d9412d425373c Author: Johannes Thumshirn Date: Wed May 31 04:50:26 2023 -0700 dm: dm-zoned: use __bio_add_page for adding single metadata page dm-zoned uses bio_add_page() for adding a single page to a freshly created metadata bio. Use __bio_add_page() instead as adding a single page to a new bio is always guaranteed to succeed. This brings us a step closer to marking bio_add_page() __must_check Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/55a0c8dad7550379647873b579dc7cfbe0191f96.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 8f11f79f193c935da617375ba5ea4e768a73a094 Author: Johannes Thumshirn Date: Wed May 31 04:50:25 2023 -0700 drbd: use __bio_add_page to add page to bio The drbd code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/435007afac14f3766455559059d21843771fae53.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit cb58bf91b138c1a8b18cca9503308789e26e3522 Author: Johannes Thumshirn Date: Wed May 31 04:50:24 2023 -0700 swap: use __bio_add_page to add page to bio The swap code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Reviewed-by: Christoph Hellwig Signed-off-by: Johannes Thumshirn Link: https://lore.kernel.org/r/5bdafd9de806b2dab92302b30eb7a3a5f10c37d9.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe commit 23caa33d36e7e6f75597b333634d9e54fb40001b Author: Avri Altman Date: Wed May 31 10:00:09 2023 +0300 scsi: ufs: core: Do not open code SZ_x Do not open code SZ_x. Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20230531070009.4593-1-avri.altman@wdc.com Reviewed-by: Bean Huo Reviewed-by: Stanley Chu Reviewed-by: Keoseong Park Signed-off-by: Martin K. Petersen commit 8f8d4be9fb69ce0aa8f87570d9a71413ff726982 Author: Miguel Ojeda Date: Wed Apr 19 01:30:48 2023 +0200 .gitattributes: set diff driver for Rust source code files Git supports a builtin Rust diff driver [1] since v2.23.0 (2019). It improves the choice of hunk headers in some cases, such as diffs within methods, since those are indented in Rust within an `impl` block, and therefore the default diff driver would pick the outer `impl` block instead (rather than the method where the changed code is). For instance, with the default diff driver: @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter { // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`. let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos); + test_diff_driver(); + if len_to_copy > 0 { // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end` // yet, so it is valid for write per the type invariants. With the Rust diff driver: @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result { // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`. let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos); + test_diff_driver(); + if len_to_copy > 0 { // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end` // yet, so it is valid for write per the type invariants. Thus set the `rust` diff driver for `*.rs` source files. The Rust repository also does so since 2020 [2]. Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1] Link: https://github.com/rust-lang/rust/pull/78882 [2] Reviewed-by: Gary Guo Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Benno Lossin Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org [ Added link to Rust repository ] Signed-off-by: Miguel Ojeda commit 1ccf164ec866cb8575ab9b2e219fca875089c60e Author: David Howells Date: Fri May 26 22:41:42 2023 +0100 block: Use iov_iter_extract_pages() and page pinning in direct-io.c Change the old block-based direct-I/O code to use iov_iter_extract_pages() to pin user pages or leave kernel pages unpinned rather than taking refs when submitting bios. This makes use of the preceding patches to not take pins on the zero page (thereby allowing insertion of zero pages in with pinned pages) and to get additional pins on pages, allowing an extracted page to be used in multiple bios without having to re-extract it. Signed-off-by: David Howells cc: Christoph Hellwig cc: David Hildenbrand cc: Lorenzo Stoakes cc: Andrew Morton cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox cc: Jan Kara cc: Jeff Layton cc: Jason Gunthorpe cc: Logan Gunthorpe cc: Hillf Danton cc: Christian Brauner cc: Linus Torvalds cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-kernel@vger.kernel.org cc: linux-mm@kvack.org Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230526214142.958751-4-dhowells@redhat.com Signed-off-by: Jens Axboe commit 1101fb8f89e5fc548c4d0ad66750e98980291815 Author: David Howells Date: Fri May 26 22:41:41 2023 +0100 mm: Provide a function to get an additional pin on a page Provide a function to get an additional pin on a page that we already have a pin on. This will be used in fs/direct-io.c when dispatching multiple bios to a page we've extracted from a user-backed iter rather than redoing the extraction. Signed-off-by: David Howells cc: Christoph Hellwig cc: David Hildenbrand cc: Lorenzo Stoakes cc: Andrew Morton cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox cc: Jan Kara cc: Jeff Layton cc: Jason Gunthorpe cc: Logan Gunthorpe cc: Hillf Danton cc: Christian Brauner cc: Linus Torvalds cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-kernel@vger.kernel.org cc: linux-mm@kvack.org Reviewed-by: Christoph Hellwig Acked-by: David Hildenbrand Link: https://lore.kernel.org/r/20230526214142.958751-3-dhowells@redhat.com Signed-off-by: Jens Axboe commit c8070b78751955e59b42457b974bea4a4fe00187 Author: David Howells Date: Fri May 26 22:41:40 2023 +0100 mm: Don't pin ZERO_PAGE in pin_user_pages() Make pin_user_pages*() leave a ZERO_PAGE unpinned if it extracts a pointer to it from the page tables and make unpin_user_page*() correspondingly ignore a ZERO_PAGE when unpinning. We don't want to risk overrunning a zero page's refcount as we're only allowed ~2 million pins on it - something that userspace can conceivably trigger. Add a pair of functions to test whether a page or a folio is a ZERO_PAGE. Signed-off-by: David Howells cc: Christoph Hellwig cc: David Hildenbrand cc: Lorenzo Stoakes cc: Andrew Morton cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox cc: Jan Kara cc: Jeff Layton cc: Jason Gunthorpe cc: Logan Gunthorpe cc: Hillf Danton cc: Christian Brauner cc: Linus Torvalds cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-kernel@vger.kernel.org cc: linux-mm@kvack.org Reviewed-by: Lorenzo Stoakes Reviewed-by: Christoph Hellwig Acked-by: David Hildenbrand Link: https://lore.kernel.org/r/20230526214142.958751-2-dhowells@redhat.com Signed-off-by: Jens Axboe commit 2ef23e4b537be3b417080bdade7ef48cf9f95266 Merge: 0e5e41ee3d738 078f4f4b34d6c Author: Martin K. Petersen Date: Wed May 31 11:45:16 2023 -0400 Merge patch series "ufs: Do not requeue while ungating the clock" Bart Van Assche says: In the traces we recorded while testing zoned storage we noticed that UFS commands are requeued while the clock is being ungated. Command requeueing makes it harder than necessary to preserve the command order. Hence this patch series that modifies the SCSI core and also the UFS driver such that clock ungating does not trigger command requeueing. Link: https://lore.kernel.org/r/20230529202640.11883-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 078f4f4b34d6c2dadabb363d3fc6c84b32927dea Author: Bart Van Assche Date: Mon May 29 13:26:40 2023 -0700 scsi: ufs: Ungate the clock synchronously Ungating the clock asynchronously causes ufshcd_queuecommand() to return SCSI_MLQUEUE_HOST_BUSY and hence causes commands to be requeued. This is suboptimal. Allow ufshcd_queuecommand() to sleep such that clock ungating does not trigger command requeuing. Remove the ufshcd_scsi_block_requests() and ufshcd_scsi_unblock_requests() calls because these are no longer needed. The flush_work(&hba->clk_gating.ungate_work) call is sufficient to make the SCSI core wait for clock ungating to complete. Acked-by: Adrian Hunter Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230529202640.11883-6-bvanassche@acm.org Reviewed-by: Bean Huo Reviewed-by: Bao D. Nguyen Signed-off-by: Martin K. Petersen commit 4b68b7f9c46d90c541d39c8b397a86ac0ca4c765 Author: Bart Van Assche Date: Mon May 29 13:26:39 2023 -0700 scsi: ufs: Declare ufshcd_{hold,release}() once ufshcd_hold() and ufshcd_release are declared twice: once in drivers/ufs/core/ufshcd-priv.h and a second time in include/ufs/ufshcd.h. Remove the declarations from ufshcd-priv.h. Fixes: dd11376b9f1b ("scsi: ufs: Split the drivers/scsi/ufs directory") Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230529202640.11883-5-bvanassche@acm.org Reviewed-by: Adrian Hunter Reviewed-by: Keoseong Park Signed-off-by: Martin K. Petersen commit 6c03c8e9b729a1ca2131a187233f8836a66a277b Author: Bart Van Assche Date: Mon May 29 13:26:38 2023 -0700 scsi: ufs: Conditionally enable the BLK_MQ_F_BLOCKING flag Prepare for adding code in ufshcd_queuecommand() that may sleep. Acked-by: Adrian Hunter Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230529202640.11883-4-bvanassche@acm.org Reviewed-by: Bean Huo Signed-off-by: Martin K. Petersen commit b125bb99559e3639764b8d169e3e9b80858fa2af Author: Bart Van Assche Date: Mon May 29 13:26:37 2023 -0700 scsi: core: Support setting BLK_MQ_F_BLOCKING Prepare for adding code in ufshcd_queuecommand() that may sleep. This patch is similar to a patch posted last year by Mike Christie. See also https://lore.kernel.org/all/20220308003957.123312-2-michael.christie@oracle.com/ Cc: Mike Christie Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230529202640.11883-3-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit c854bcdf5e18a3b672e363138f2f6657a1803170 Author: Bart Van Assche Date: Mon May 29 13:26:36 2023 -0700 scsi: core: Rework scsi_host_block() Make scsi_host_block() easier to read by converting it to the widely used early-return style. See also commit f983622ae605 ("scsi: core: Avoid calling synchronize_rcu() for each device in scsi_host_block()"). Reviewed-by: Mike Christie Reviewed-by: Ming Lei Cc: Ye Bin Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230529202640.11883-2-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit d0c76d9430c155692995a7372158809ec9962ed7 Merge: 8315d8adc048b e1f653ce847ba Author: Mark Brown Date: Wed May 31 16:37:39 2023 +0100 ASoC: minor cleanup for soc_get_playback_capture() Merge series from Kuninori Morimoto : This is minor cleanup patches for soc_get_playback_capture(). commit 0e5e41ee3d73823d65b33463d557b8b6833b457d Author: Christophe JAILLET Date: Mon May 29 09:35:08 2023 +0200 scsi: virtio_scsi: Remove a useless function call 'inq_result' is known to be NULL. There is no point calling kfree(). Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/08740635cdb0f8293e57c557b22e048daae50961.1685345683.git.christophe.jaillet@wanadoo.fr Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Martin K. Petersen commit 3ed03f4da06ede71ac53cf25b9441a372e9f2487 Author: Miguel Ojeda Date: Tue Apr 18 23:43:47 2023 +0200 rust: upgrade to Rust 1.68.2 This is the first upgrade to the Rust toolchain since the initial Rust merge, from 1.62.0 to 1.68.2 (i.e. the latest). # Context The kernel currently supports only a single Rust version [1] (rather than a minimum) given our usage of some "unstable" Rust features [2] which do not promise backwards compatibility. The goal is to reach a point where we can declare a minimum version for the toolchain. For instance, by waiting for some of the features to be stabilized. Therefore, the first minimum Rust version that the kernel will support is "in the future". # Upgrade policy Given we will eventually need to reach that minimum version, it would be ideal to upgrade the compiler from time to time to be as close as possible to that goal and find any issues sooner. In the extreme, we could upgrade as soon as a new Rust release is out. Of course, upgrading so often is in stark contrast to what one normally would need for GCC and LLVM, especially given the release schedule: 6 weeks for Rust vs. half a year for LLVM and a year for GCC. Having said that, there is no particular advantage to updating slowly either: kernel developers in "stable" distributions are unlikely to be able to use their distribution-provided Rust toolchain for the kernel anyway [3]. Instead, by routinely upgrading to the latest instead, kernel developers using Linux distributions that track the latest Rust release may be able to use those rather than Rust-provided ones, especially if their package manager allows to pin / hold back / downgrade the version for some days during windows where the version may not match. For instance, Arch, Fedora, Gentoo and openSUSE all provide and track the latest version of Rust as they get released every 6 weeks. Then, when the minimum version is reached, we will stop upgrading and decide how wide the window of support will be. For instance, a year of Rust versions. We will probably want to start small, and then widen it over time, just like the kernel did originally for LLVM, see commit 3519c4d6e08e ("Documentation: add minimum clang/llvm version"). # Unstable features stabilized This upgrade allows us to remove the following unstable features since they were stabilized: - `feature(explicit_generic_args_with_impl_trait)` (1.63). - `feature(core_ffi_c)` (1.64). - `feature(generic_associated_types)` (1.65). - `feature(const_ptr_offset_from)` (1.65, *). - `feature(bench_black_box)` (1.66, *). - `feature(pin_macro)` (1.68). The ones marked with `*` apply only to our old `rust` branch, not mainline yet, i.e. only for code that we may potentially upstream. With this patch applied, the only unstable feature allowed to be used outside the `kernel` crate is `new_uninit`, though other code to be upstreamed may increase the list. Please see [2] for details. # Other required changes Since 1.63, `rustdoc` triggers the `broken_intra_doc_links` lint for links pointing to exported (`#[macro_export]`) `macro_rules`. An issue was opened upstream [4], but it turns out it is intended behavior. For the moment, just add an explicit reference for each link. Later we can revisit this if `rustdoc` removes the compatibility measure. Nevertheless, this was helpful to discover a link that was pointing to the wrong place unintentionally. Since that one was actually wrong, it is fixed in a previous commit independently. Another change was the addition of `cfg(no_rc)` and `cfg(no_sync)` in upstream [5], thus remove our original changes for that. Similarly, upstream now tests that it compiles successfully with `#[cfg(not(no_global_oom_handling))]` [6], which allow us to get rid of some changes, such as an `#[allow(dead_code)]`. In addition, remove another `#[allow(dead_code)]` due to new uses within the standard library. Finally, add `try_extend_trusted` and move the code in `spec_extend.rs` since upstream moved it for the infallible version. # `alloc` upgrade and reviewing There are a large amount of changes, but the vast majority of them are due to our `alloc` fork being upgraded at once. There are two kinds of changes to be aware of: the ones coming from upstream, which we should follow as closely as possible, and the updates needed in our added fallible APIs to keep them matching the newer infallible APIs coming from upstream. Instead of taking a look at the diff of this patch, an alternative approach is reviewing a diff of the changes between upstream `alloc` and the kernel's. This allows to easily inspect the kernel additions only, especially to check if the fallible methods we already have still match the infallible ones in the new version coming from upstream. Another approach is reviewing the changes introduced in the additions in the kernel fork between the two versions. This is useful to spot potentially unintended changes to our additions. To apply these approaches, one may follow steps similar to the following to generate a pair of patches that show the differences between upstream Rust and the kernel (for the subset of `alloc` we use) before and after applying this patch: # Get the difference with respect to the old version. git -C rust checkout $(linux/scripts/min-tool-version.sh rustc) git -C linux ls-tree -r --name-only HEAD -- rust/alloc | cut -d/ -f3- | grep -Fv README.md | xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH git -C linux diff --patch-with-stat --summary -R > old.patch git -C linux restore rust/alloc # Apply this patch. git -C linux am rust-upgrade.patch # Get the difference with respect to the new version. git -C rust checkout $(linux/scripts/min-tool-version.sh rustc) git -C linux ls-tree -r --name-only HEAD -- rust/alloc | cut -d/ -f3- | grep -Fv README.md | xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH git -C linux diff --patch-with-stat --summary -R > new.patch git -C linux restore rust/alloc Now one may check the `new.patch` to take a look at the additions (first approach) or at the difference between those two patches (second approach). For the latter, a side-by-side tool is recommended. Link: https://rust-for-linux.com/rust-version-policy [1] Link: https://github.com/Rust-for-Linux/linux/issues/2 [2] Link: https://lore.kernel.org/rust-for-linux/CANiq72mT3bVDKdHgaea-6WiZazd8Mvurqmqegbe5JZxVyLR8Yg@mail.gmail.com/ [3] Link: https://github.com/rust-lang/rust/issues/106142 [4] Link: https://github.com/rust-lang/rust/pull/89891 [5] Link: https://github.com/rust-lang/rust/pull/98652 [6] Reviewed-by: Björn Roy Baron Reviewed-by: Gary Guo Reviewed-By: Martin Rodriguez Reboredo Tested-by: Ariel Miculas Tested-by: David Gow Tested-by: Boqun Feng Link: https://lore.kernel.org/r/20230418214347.324156-4-ojeda@kernel.org [ Removed `feature(core_ffi_c)` from `uapi` ] Signed-off-by: Miguel Ojeda commit 401f8ef3193f9e3bbd454023152868c9aca6dc9d Author: Damien Le Moal Date: Tue May 23 16:47:01 2023 +0900 scsi: ata: libata-scsi: Fix ata_msense_control kdoc comment Add missing description of the spg argument of ata_msense_control(). Fixes: df60f9c64576 ("scsi: ata: libata: Add ATA feature control sub-page translation") Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230523074701.293502-1-dlemoal@kernel.org Reviewed-by: Johannes Thumshirn Reviewed-by: Niklas Cassel Signed-off-by: Martin K. Petersen commit 339020091e246e708c1381acf74c5f8e3fe4d2b5 Author: Dan Carpenter Date: Mon May 22 14:09:17 2023 +0300 scsi: qla2xxx: Fix end of loop test This loop will exit successfully when "found" is false or in the failure case it times out with "wait_iter" set to -1. The test for timeouts is impossible as is. Fixes: b843adde8d49 ("scsi: qla2xxx: Fix mem access after free") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/cea5a62f-b873-4347-8f8e-c67527ced8d2@kili.mountain Signed-off-by: Martin K. Petersen commit 88e9664434c994e97a9f6f8cdd1535495c660cea Author: Jani Nikula Date: Fri May 26 00:06:53 2023 +0300 drm/i915: use localized __diag_ignore_all() instead of per file Use localized __diag_push(), __diag_ignore_all() with rationale, and __diag_pop() for specific initializations instead of blanket disabling of -Woverride-init across several files. Signed-off-by: Jani Nikula Reviewed-by: Gustavo Sousa Link: https://patchwork.freedesktop.org/patch/msgid/20230525210653.1048972-1-jani.nikula@intel.com commit 8b566edbdbfb5cde31a322c57932694ff48125ed Author: Bart Van Assche Date: Thu May 18 12:31:59 2023 -0700 scsi: core: Only kick the requeue list if necessary Instead of running the request queue of each device associated with a host every 3 ms (BLK_MQ_RESOURCE_DELAY) while host error handling is in progress, run the request queue after error handling has finished. Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc: John Garry Cc: Mike Christie Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230518193159.1166304-4-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 8bb1c6243c4ba397958fe67837e075bd1bb8d3b4 Author: Bart Van Assche Date: Thu May 18 12:31:58 2023 -0700 scsi: core: Trace SCSI sense data If a command fails, SCSI sense data is essential to determine why it failed. Hence make the sense key, ASC and ASCQ codes available in the ftrace output. Cc: Niklas Cassel Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc: John Garry Cc: Mike Christie Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230518193159.1166304-3-bvanassche@acm.org Reviewed-by: Ming Lei Reviewed-by: Niklas Cassel Signed-off-by: Martin K. Petersen commit 416dace649c45fdbf7a9d62dfc060fdbee9c8bea Author: Bart Van Assche Date: Thu May 18 12:31:57 2023 -0700 scsi: core: Use min() instead of open-coding it Use min() instead of open-coding it in scsi_normalize_sense(). Reviewed-by: Christoph Hellwig Reviewed-by: Benjamin Block Cc: Douglas Gilbert Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230518193159.1166304-2-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 6dd032ba4474bc35216a76195889b2127d2aeaaa Merge: b2b56a1632304 8e0285ab95a9b Author: Bartosz Golaszewski Date: Wed May 31 17:01:34 2023 +0200 Merge tag 'gpio-omap-descriptors-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio into gpio/for-next This removes all usage of global GPIO numbers from arch/arm/mach-omap[12]. The patches have been reviewed and tested by everyone who showed interest which was one person that tested on OSK1 and Nokia 770, and we smoked out the bugs and also addressed all review comments. Any remaining problems can certainly be fixed in-tree. commit 2ce977df10c179138e2723b25c2d2c055a3e3cc6 Author: Ma Jun Date: Wed May 31 13:30:51 2023 +0800 drm/ttm: Remove redundant code in ttm_tt_init_fields Remove redundant assignment code for ttm->caching as it's overwritten just a few lines later. v2: - Update the commit message. Signed-off-by: Ma Jun Reviewed-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230531053051.3453509-1-Jun.Ma2@amd.com commit ff3cfcb0d46adc541283a507560f88b7d7114dbe Author: Thomas Gleixner Date: Wed May 31 09:44:26 2023 +0200 x86/smpboot: Fix the parallel bringup decision The decision to allow parallel bringup of secondary CPUs checks CC_ATTR_GUEST_STATE_ENCRYPT to detect encrypted guests. Those cannot use parallel bootup because accessing the local APIC is intercepted and raises a #VC or #VE, which cannot be handled at that point. The check works correctly, but only for AMD encrypted guests. TDX does not set that flag. As there is no real connection between CC attributes and the inability to support parallel bringup, replace this with a generic control flag in x86_cpuinit and let SEV-ES and TDX init code disable it. Fixes: 0c7ffa32dbd6 ("x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it") Reported-by: Kirill A. Shutemov Signed-off-by: Thomas Gleixner Tested-by: Tom Lendacky Tested-by: Kirill A. Shutemov Link: https://lore.kernel.org/r/87ilc9gd2d.ffs@tglx commit 3b1ddbb62e7e7d2433781cd2f59d77c2f9aee934 Merge: 7877cb91f1081 ef7d0f5d03b9e Author: Arnd Bergmann Date: Wed May 31 16:33:56 2023 +0200 Merge tag 'virt-to-pfn-for-arch-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into asm-generic This is an attempt to harden the typing on virt_to_pfn() and pfn_to_virt(). Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as arguments without warnings. For symmetry, we do the same with pfn_to_virt(). The problem with this inconsistent typing was pointed out by Russell King: https://lore.kernel.org/linux-arm-kernel/YoJDKJXc0MJ2QZTb@shell.armlinux.org.uk/ And confirmed by Andrew Morton: https://lore.kernel.org/linux-mm/20220701160004.2ffff4e5ab59a55499f4c736@linux-foundation.org/ So the recognition of the problem is widespread. These platforms have been chosen as initial conversion targets: - ARM - ARM64/Aarch64 - asm-generic (including for example x86) - m68k The idea is that if this goes in, it will block further misuse of the function signatures due to the large compile coverage, and then I can go in and fix the remaining architectures on a one-by-one basis. Some of the patches have been circulated before but were not picked up by subsystem maintainers, so now the arch tree is target for this series. It has passed zeroday builds after a lot of iterations in my personal tree, but there could be some randconfig outliers. New added or deeply hidden problems appear all the time so some minor fallout can be expected. * tag 'virt-to-pfn-for-arch-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator: m68k/mm: Make pfn accessors static inlines arm64: memory: Make virt_to_pfn() a static inline ARM: mm: Make virt_to_pfn() a static inline asm-generic/page.h: Make pfn accessors static inlines xen/netback: Pass (void *) to virt_to_page() netfs: Pass a pointer to virt_to_page() cifs: Pass a pointer to virt_to_page() in cifsglob cifs: Pass a pointer to virt_to_page() riscv: mm: init: Pass a pointer to virt_to_page() ARC: init: Pass a pointer to virt_to_pfn() in init m68k: Pass a pointer to virt_to_pfn() virt_to_page() fs/proc/kcore.c: Pass a pointer to virt_addr_valid() commit eed7a146b86cf95441d5563c7a99cd02f8a6c3a4 Author: Miguel Ojeda Date: Tue Apr 18 23:43:46 2023 +0200 rust: arc: fix intra-doc link in `Arc::init` `Arc::init` refers to `Arc::pin_init` via an intra-doc link using the text `pin_init`, rather than more explicitly, which makes `rustdoc` point it to the `pin_init!` macro instead. This is required for the compiler upgrade since the newer `rustdoc` would trigger the `broken_intra_doc_links` lint [1], but in this case the macro was not the intended target to begin with, and so the actual fix is to make it point to the right place, regardless of the upgrade. Thus make it more explicit. Fixes: 92c4a1e7e81c ("rust: init/sync: add `InPlaceInit` trait to pin-initialize smart pointers") Link: https://github.com/rust-lang/rust/issues/106142 [1] Reviewed-by: Gary Guo Reviewed-by: Benno Lossin Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Björn Roy Baron Tested-by: Ariel Miculas Tested-by: David Gow Tested-by: Boqun Feng Link: https://lore.kernel.org/r/20230418214347.324156-3-ojeda@kernel.org Signed-off-by: Miguel Ojeda commit f438c1dd9ec2687b9d1e72e36cc44318634671a0 Author: Miguel Ojeda Date: Tue Apr 18 23:43:45 2023 +0200 rust: alloc: clarify what is the upstream version It may be unclear for readers which upstream Rust version these files are based on. They may be unaware that they are intended to match the minimum (and only, so far) supported version of Rust in the kernel. Thus clarify it. Reviewed-by: Benno Lossin Reviewed-by: Björn Roy Baron Reviewed-by: Gary Guo Reviewed-by: Martin Rodriguez Reboredo Tested-by: Ariel Miculas Tested-by: David Gow Tested-by: Boqun Feng Link: https://lore.kernel.org/r/20230418214347.324156-2-ojeda@kernel.org Signed-off-by: Miguel Ojeda commit 3496d1c64a0fcc9bae3ed40decc3ecd7f8ac072f Author: Peter Zijlstra Date: Fri Feb 10 10:10:57 2023 +0000 x86/nospec: Shorten RESET_CALL_DEPTH RESET_CALL_DEPTH is a pretty fat monster and blows up UNTRAIN_RET to 20 bytes: 19: 48 c7 c0 80 00 00 00 mov $0x80,%rax 20: 48 c1 e0 38 shl $0x38,%rax 24: 65 48 89 04 25 00 00 00 00 mov %rax,%gs:0x0 29: R_X86_64_32S pcpu_hot+0x10 Shrink it by 4 bytes: 0: 31 c0 xor %eax,%eax 2: 48 0f ba e8 3f bts $0x3f,%rax 7: 65 48 89 04 25 00 00 00 00 mov %rax,%gs:0x0 Shrink RESET_CALL_DEPTH_FROM_CALL by 5 bytes by only setting %al, the other bits are shifted out (the same could be done for RESET_CALL_DEPTH, but the XOR+BTS sequence has less dependencies due to the zeroing). Suggested-by: Andrew Cooper Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230515093020.729622326@infradead.org commit 3ecd5a728903b3057012043f98464c20cea1cdbb Author: Serge Semin Date: Wed May 31 01:17:25 2023 +0300 spi: dw: Drop empty line from DebugFS init function Just drop a redundant empty line from the dw_spi_debugfs_init() function left in the framework of the commit 0178f1e5d984 ("spi-dw-core.c: Fix error checking for debugfs_create_dir") after removing the last return statement. Signed-off-by: Serge Semin Link: https://lore.kernel.org/r/20230530221725.26319-1-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit d5786c88cacbb859f465e8e93c26154585c1008d Author: Alexander Stein Date: Wed May 31 09:28:49 2023 +0200 spi: spi-fsl-lpspi: downgrade log level for pio mode Having no DMA is not an error. The simplest reason is not having it configured. SPI will still be usable, so raise a warning instead to get still some attention. Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20230531072850.739021-1-alexander.stein@ew.tq-group.com Signed-off-by: Mark Brown commit 8315d8adc048bd7f8eb7ee5722ecef4e6e7d52ff Author: David Lin Date: Wed May 31 15:53:35 2023 +0800 ASoC: nau8825: Add the management of headset detection for power saving The patch is to manage HSD feature for power saving. The detail is to disable HSD feature after the headset detection is done. When the jack is inserted, the HSD feature will be enabled again. Signed-off-by: David Lin Link: https://lore.kernel.org/r/20230531075334.168637-1-CTLIN0@nuvoton.com Signed-off-by: Mark Brown commit e1f653ce847bab7285dd135cabe3ce544e574c75 Author: Kuninori Morimoto Date: Tue May 30 00:50:08 2023 +0000 ASoC: soc-pcm.c: tidyup playback/capture_only at soc_get_playback_capture() soc_get_playback_capture() (A) returns number of substreams for playback/capture, and then, we can use playback/capture_only flag (X)(Y). (A) static int soc_get_playback_capture(...) { ... (X) if (dai_link->playback_only) { (*) *playback = 1; *capture = 0; } (Y) if (dai_link->capture_only) { *playback = 0; (*) *capture = 1; } ... } But this flag should not have effect to opposite side stream (*). This patch tidyup it. Signed-off-by: Kuninori Morimoto Reviewed-by: Amadeusz Sławiński Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87sfbezlq8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit c3e9b6d6ef5a0a3e841c3aa29e7afc48a0b73806 Author: Kuninori Morimoto Date: Tue May 30 00:50:01 2023 +0000 ASoC: soc-pcm.c: use temporary variable at soc_get_playback_capture() soc_get_playback_capture() (A) returns number of substreams for playback/capture (B). (A) static int soc_get_playback_capture(..., (B) int *playback, int *capture) { ... for_each_xxx(...) { if (xxx) return -EINVAL; => *playback = 1; ... => *capture = 1; ... } ... } But, it is directly updating playback/capture which is the result of this function even though it might be error. It should be updated in case of succeed only. This patch updates it. Signed-off-by: Kuninori Morimoto Reviewed-by: Amadeusz Sławiński Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87ttvuzlqe.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a1c0221fa5baeae6c9dc30294c2c6d01f1f4379b Author: Kuninori Morimoto Date: Tue May 30 00:49:56 2023 +0000 ASoC: soc-pcm.c: cleanup soc_get_playback_capture() error soc_get_playback_capture() (A) checks dai_link status, and indicate error if it was not matching (B). (A) static int soc_get_playback_capture(...) { ... ^ if (dai_link->dynamic && dai_link->num_cpus > 1) { | dev_err(rtd->dev, (B) "DPCM doesn't support Multi CPU for Front-Ends yet\n"); | return -EINVAL; v } ... } We can use 100 char for 1 line today. This patch cleanup error code line. Signed-off-by: Kuninori Morimoto Reviewed-by: Amadeusz Sławiński Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87v8gazlqk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit cfcb31c456b15e298f88fb5ebedf7b32b009d32d Author: Kuninori Morimoto Date: Tue May 30 00:49:50 2023 +0000 ASoC: soc-pcm.c: use dai_link on soc_get_playback_capture() soc_get_playback_capture() (A) is using rtd->dai_link->xxx everywhere. Because of that, 1 line is unnecessarily long and not readable. (A) static int soc_get_playback_capture(...) { if (rtd->dai_link->dynamic ...) { ^^^^^^^^^^^^^ ... } else { int cpu_capture = rtd->dai_link->c2c_params ? ^^^^^^^^^^^^^ ... } if (rtd->dai_link->playback_only) { ^^^^^^^^^^^^^ ... } ... } This patch uses variable "dai_link" to be clear code. Nothing changes the meanings. Signed-off-by: Kuninori Morimoto Reviewed-by: Amadeusz Sławiński Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87wn0qzlqp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 092830cf550667d5fa6286605167d232f2c1f61e Author: Kuninori Morimoto Date: Tue May 30 00:49:43 2023 +0000 ASoC: soc-pcm.c: indicate error if stream has no playback no capture soc_get_playback_capture() (A) returns number of substreams for playback/capture (B). ASoC will probe the Sound Card and mapps CPU<->Codec pair. (A) static int soc_get_playback_capture(..., (B) int *playback, int *capture) { ... if (rtd->dai_link->playback_only) { *playback = 1; *capture = 0; } if (rtd->dai_link->capture_only) { *playback = 0; *capture = 1; } (C) return 0; } But it might be no playback no capture if it returns playback=0, capture=0. It is very difficult to notice about it. This patch indicates error at (C) then. Signed-off-by: Kuninori Morimoto Reviewed-by: Amadeusz Sławiński Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87y1l6zlqx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 60548b825b082cedf89b275c21c28b1e1d030e50 Author: Jesper Dangaard Brouer Date: Tue May 30 16:30:41 2023 +0200 samples/bpf: xdp1 and xdp2 reduce XDPBUFSIZE to 60 Default samples/pktgen scripts send 60 byte packets as hardware adds 4-bytes FCS checksum, which fulfils minimum Ethernet 64 bytes frame size. XDP layer will not necessary have access to the 4-bytes FCS checksum. This leads to bpf_xdp_load_bytes() failing as it tries to copy 64-bytes from an XDP packet that only have 60-bytes available. Fixes: 772251742262 ("samples/bpf: fixup some tools to be able to support xdp multibuffer") Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann Reviewed-by: Tariq Toukan Link: https://lore.kernel.org/bpf/168545704139.2996228.2516528552939485216.stgit@firesoul commit 9b68f30b68701e98abcec331a2cf3df972d910f8 Author: Jarkko Sakkinen Date: Fri May 26 14:21:02 2023 +0300 net: Use umd_cleanup_helper() bpfilter_umh_cleanup() is the same function as umd_cleanup_helper(). Drop the redundant function. Signed-off-by: Jarkko Sakkinen Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230526112104.1044686-1-jarkko@kernel.org commit ffadc372529e268b54c5b98f56da07d8024fa1cb Author: Azeem Shaikh Date: Tue May 30 15:56:59 2023 +0000 bpf: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. This is not the case here, however, in an effort to remove strlcpy() completely [2], lets replace strlcpy() here with strscpy(). No return values were used, so a direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Signed-off-by: Daniel Borkmann Reviewed-by: Kees Cook Link: https://lore.kernel.org/bpf/20230530155659.309657-1-azeemshaikh38@gmail.com commit 0d2da4b595d03009db7dfb5ebf01c547b89b0ad8 Author: Su Hui Date: Wed May 31 12:32:51 2023 +0800 bpf/tests: Use struct_size() Use struct_size() instead of hand writing it. This is less verbose and more informative. Signed-off-by: Su Hui Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20230531043251.989312-1-suhui@nfschina.com commit 84a9582fd203063cd4d301204971ff2cd8327f1a Author: Tony Lindgren Date: Thu May 25 14:30:30 2023 +0300 serial: core: Start managing serial controllers to enable runtime PM We want to enable runtime PM for serial port device drivers in a generic way. To do this, we want to have the serial core layer manage the registered physical serial controller devices. To manage serial controllers, let's set up a struct bus and struct device for the serial core controller as suggested by Greg and Jiri. The serial core controller devices are children of the physical serial port device. The serial core controller device is needed to support multiple different kind of ports connected to single physical serial port device. Let's also set up a struct device for the serial core port. The serial core port instances are children of the serial core controller device. With the serial core port device we can now flush pending TX on the runtime PM resume as suggested by Johan. Suggested-by: Andy Shevchenko Suggested-by: Greg Kroah-Hartman Suggested-by: Jiri Slaby Suggested-by: Johan Hovold Signed-off-by: Tony Lindgren Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230525113034.46880-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit ae62c49c0ceff20dc7c1fad4a5b8f91d64b4f628 Author: Arnd Bergmann Date: Wed May 17 22:20:07 2023 +0200 serial: 8250: omap: convert to modern PM ops The new uart_write() function is only called from suspend/resume code, causing a build warning when those are left out: drivers/tty/serial/8250/8250_omap.c:169:13: error: 'uart_write' defined but not used [-Werror=unused-function] Remove the #ifdefs and use the modern pm_ops/pm_sleep_ops and their wrappers to let the compiler see where it's used but still drop the dead code. Fixes: 398cecc24846 ("serial: 8250: omap: Fix imprecise external abort for omap_8250_pm()") Signed-off-by: Arnd Bergmann Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230517202012.634386-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit c53aab20762255ee03e65dd66b3cba3887ad39d1 Author: Geert Uytterhoeven Date: Mon May 15 08:57:06 2023 +0200 serial: 8250: omap: Move uart_write() inside PM section If CONFIG_PM is not set (e.g. m68k/allmodconfig): drivers/tty/serial/8250/8250_omap.c:169:13: error: ‘uart_write’ defined but not used [-Werror=unused-function] 169 | static void uart_write(struct omap8250_priv *priv, u32 reg, u32 val) | ^~~~~~~~~~ Fix tis by moving uart_write() inside the existing section protected by #ifdef CONFIG_PM. Reported-by: noreply@ellerman.id.au Link: http://kisskb.ellerman.id.au/kisskb/buildresult/14925095/ Fixes: 398cecc24846e867 ("serial: 8250: omap: Fix imprecise external abort for omap_8250_pm()") Signed-off-by: Geert Uytterhoeven Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230515065706.1723477-1-geert@linux-m68k.org Signed-off-by: Greg Kroah-Hartman commit d2d4bd217ccd474cfe70bba7bb1b26563249679d Author: Uwe Kleine-König Date: Wed May 24 14:27:52 2023 +0200 serial: 8250-fsl: Expand description of the MPC83xx UART's misbehaviour After working quite a bit on erratic behaviour of the MPC83xx UART I (think I) understood the problem. Expand the description accoringly to conserve the knowledge for the future. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230524122754.481816-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 6eb6b6f0a012993070b26dacb5ea1ff5fc233c18 Author: Dmitry Baryshkov Date: Wed May 31 03:02:59 2023 +0300 drm/bridge: display-connector: handle hdmi-pwr supply On some devices the +5V Power pin of the HDMI connector and/or the ESD protection logic is powered on by a separate regulator. Instead of declaring this regulator as always-on, make hdmi-connector support the additional hdmi-pwr supply. Signed-off-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230531000259.3758235-4-dmitry.baryshkov@linaro.org commit 99304fd0050314a0c998c28300393ec574998db9 Author: Dmitry Baryshkov Date: Wed May 31 03:02:58 2023 +0300 drm/bridge: display-connector: rename dp_pwr to connector_pwr In preparation to adding support for the hdmi_pwr supply, rename dp_pwr structure field to the generic connector_pwr. Reviewed-by: Laurent Pinchart Signed-off-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230531000259.3758235-3-dmitry.baryshkov@linaro.org commit 41b74821751466457dc8b87606ac4d71ec568d4e Author: Dmitry Baryshkov Date: Wed May 31 03:02:57 2023 +0300 dt-bindings: display: hdmi-connector: add hdmi-pwr supply Follow the dp-connector example and add hdmi-pwr supply to drive the 5V pin of the HDMI connector (together with some simple glue logic possibly attached to the connector). Reviewed-by: Laurent Pinchart Acked-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230531000259.3758235-2-dmitry.baryshkov@linaro.org commit e2a9f0a32464f435dbdb190ff7dbf09745703b60 Merge: 3e36c49069866 85d712f033d23 Author: Jani Nikula Date: Wed May 31 12:01:51 2023 +0300 Merge drm/drm-next into drm-intel-next Sync the drm-intel-gt-next changes back to drm-intel-next via drm-next. Signed-off-by: Jani Nikula commit 60cbd38bb0ad9e4395fba9c6994f258f1d6cad51 Merge: 5dedf5c485e0d 4802fca8d1af9 Author: David S. Miller Date: Wed May 31 10:00:30 2023 +0100 Merge branch 'xstats-for-tc-taprio' Vladimir Oltean says: ==================== xstats for tc-taprio As a result of this discussion: https://lore.kernel.org/intel-wired-lan/20230411055543.24177-1-muhammad.husaini.zulkifli@intel.com/ it became apparent that tc-taprio should make an effort to standardize statistics counters related to the 802.1Qbv scheduling as implemented by the NIC. I'm presenting here one counter suggested by the standard, and one counter defined by the NXP ENETC controller from LS1028A. Both counters are reported globally and per traffic class - drivers get different callbacks for reporting both of these, and get to choose what to report in both cases. The iproute2 counterpart is available here for testing: https://github.com/vladimiroltean/iproute2/commits/taprio-xstats ==================== Signed-off-by: David S. Miller commit 4802fca8d1af9687a0fd71b729d96726f05192ad Author: Vladimir Oltean Date: Tue May 30 12:19:48 2023 +0300 net: enetc: report statistics counters for taprio Report the "win_drop" counter from the unstructured ethtool -S as TCA_TAPRIO_OFFLOAD_STATS_WINDOW_DROPS to the Qdisc layer. It is available both as a global counter as well as a per-TC one. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 5353599aa74524acbf48c5e78683534f6bdd1ed3 Author: Vladimir Oltean Date: Tue May 30 12:19:47 2023 +0300 net: enetc: refactor enetc_setup_tc_taprio() to have a switch/case for cmd Make enetc_setup_tc_taprio() more amenable to future extensions, like reporting statistics. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 6c1adb650c8d85c6cb471dbc900c2468f462995a Author: Vladimir Oltean Date: Tue May 30 12:19:46 2023 +0300 net/sched: taprio: add netlink reporting for offload statistics counters Offloading drivers may report some additional statistics counters, some of them even suggested by 802.1Q, like TransmissionOverrun. In my opinion we don't have to limit ourselves to reporting counters only globally to the Qdisc/interface, especially if the device has more detailed reporting (per traffic class), since the more detailed info is valuable for debugging and can help identifying who is exceeding its time slot. But on the other hand, some devices may not be able to report both per TC and global stats. So we end up reporting both ways, and use the good old ethtool_put_stat() strategy to determine which statistics are supported by this NIC. Statistics which aren't set are simply not reported to netlink. For this reason, we need something dynamic (a nlattr nest) to be reported through TCA_STATS_APP, and not something daft like the fixed-size and inextensible struct tc_codel_xstats. A good model for xstats which are a nlattr nest rather than a fixed struct seems to be cake. # Global stats $ tc -s qdisc show dev eth0 root # Per-tc stats $ tc -s class show dev eth0 Signed-off-by: Vladimir Oltean Acked-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit 2d800bc500fb3fb07a0fb42e2d0a1356fb9e1e8f Author: Vladimir Oltean Date: Tue May 30 12:19:45 2023 +0300 net/sched: taprio: replace tc_taprio_qopt_offload :: enable with a "cmd" enum Inspired from struct flow_cls_offload :: cmd, in order for taprio to be able to report statistics (which is future work), it seems that we need to drill one step further with the ndo_setup_tc(TC_SETUP_QDISC_TAPRIO) multiplexing, and pass the command as part of the common portion of the muxed structure. Since we already have an "enable" variable in tc_taprio_qopt_offload, refactor all drivers to check for "cmd" instead of "enable", and reject every other command except "replace" and "destroy" - to be future proof. Signed-off-by: Vladimir Oltean Reviewed-by: Horatiu Vultur # for lan966x Acked-by: Kurt Kanzenbach # hellcreek Reviewed-by: Muhammad Husaini Zulkifli Reviewed-by: Gerhard Engleder Signed-off-by: David S. Miller commit dced11ef84fb310f4ddfa74d1c09687b8f845d1b Author: Vladimir Oltean Date: Tue May 30 12:19:44 2023 +0300 net/sched: taprio: don't overwrite "sch" variable in taprio_dump_class_stats() In taprio_dump_class_stats() we don't need a reference to the root Qdisc once we get the reference to the child corresponding to this traffic class, so it's okay to overwrite "sch". But in a future patch we will need the root Qdisc too, so create a dedicated "child" pointer variable to hold the child reference. This also makes the code adhere to a more conventional coding style. Signed-off-by: Vladimir Oltean Acked-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit 5dedf5c485e0dbbcdbcda995f029a696d7fa9c9a Merge: 3ea903e2a523e 372188c86e4b2 Author: David S. Miller Date: Wed May 31 09:56:08 2023 +0100 Merge branch 'dsa-marvell-mv88e6071-and-6020-support' Lukasz Majewski says: ==================== dsa: marvell: Add support for mv88e6071 and 6020 switches After the commit (SHA1: 7e9517375a14f44ee830ca1c3278076dd65fcc8f); "net: dsa: mv88e6xxx: fix max_mtu of 1492 on 6165, 6191, 6220, 6250, 6290" the error when mv88e6020 or mv88e6071 is used is not present anymore. As a result patches for adding max frame size are not required to provide working setup with aforementioned switches. ==================== Signed-off-by: David S. Miller commit 372188c86e4b2adbac41d998ed96ade83eff5494 Author: Lukasz Majewski Date: Tue May 30 10:39:16 2023 +0200 net: dsa: mv88e6xxx: add support for MV88E6071 switch A mv88e6250 family switch with 5 internal PHYs, 2 RMIIs and no PTP support. Signed-off-by: Lukasz Majewski Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 71d94a432a15eb710069f5111a1b4459d7e7cd87 Author: Matthias Schiffer Date: Tue May 30 10:39:15 2023 +0200 net: dsa: mv88e6xxx: add support for MV88E6020 switch A mv88e6250 family switch with 2 PHY and RMII ports and no PTP support. Signed-off-by: Matthias Schiffer Signed-off-by: Lukasz Majewski Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit dd4144e54e811729b2a1ff28e1dab380aad5293e Author: Lukasz Majewski Date: Tue May 30 10:39:14 2023 +0200 net: dsa: Define .set_max_frame_size() callback for mv88e6250 SoC family Switches from mv88e6250 family (including mv88e6020 and mv88e6071) need the possibility to setup the maximal frame size, as they support frames up to 2048 bytes. Signed-off-by: Lukasz Majewski Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 98b503c7fb13a17a47d8ebf15fa8f7c10118e75c Author: Martin Blumenstingl Date: Tue May 16 22:30:29 2023 +0200 ARM: dts: meson8: correct uart_B and uart_C clock references On Meson8 uart_B and uart_C do not work, because they are relying on incorrect clocks. Change the references of pclk to the correct CLKID (UART1 for uart_B and UART2 for uart_C), to allow use of the two uarts. This was originally reported by Hans-Frieder Vogt for Meson8b [0], but the same bug is also present in meson8.dtsi [0] https://lore.kernel.org/linux-amlogic/trinity-bf20bcb9-790b-4ab9-99e3-0831ef8257f4-1680878185420@3c-app-gmx-bap55/ Fixes: 57007bfb5469 ("ARM: dts: meson8: Fix the UART device-tree schema validation") Reported-by: Hans-Frieder Vogt # for meson8b.dtsi Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230516203029.1031174-1-martin.blumenstingl@googlemail.com Signed-off-by: Neil Armstrong commit 3ea903e2a523e9655e425ba8eae13733e9e80ac9 Author: Uwe Kleine-König Date: Tue May 30 08:39:36 2023 +0200 net: dsa: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit b1f2abcf817d82b54764d1474424649feda6fe1b Author: Parav Pandit Date: Mon May 29 16:44:30 2023 +0300 net: Make gro complete function to return void tcp_gro_complete() function only updates the skb fields related to GRO and it always returns zero. All the 3 drivers which are using it do not check for the return value either. Change it to return void instead which simplifies its callers as error handing becomes unnecessary. Signed-off-by: Parav Pandit Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit f209c8ec43a80594e74bbded78cfc9264e6b05af Merge: 6cd8ec58c1bf6 4f53c27f772e2 Author: David S. Miller Date: Wed May 31 09:42:09 2023 +0100 Merge branch 'net-led-hw-control-api' Christian Marangi says: ==================== leds: introduce new LED hw control APIs Since this series is cross subsystem between LED and netdev, a stable branch was created to facilitate merging process. This is based on top of branch ib-leds-netdev-v6.5 present here [1] and rebased on top of net-next since the LED stable branch got merged. This is a continue of [2]. It was decided to take a more gradual approach to implement LEDs support for switch and phy starting with basic support and then implementing the hw control part when we have all the prereq done. This is the main part of the series, the one that actually implement the hw control API. Some history about this feature and why ======================================= This proposal is highly requested by the entire net community but the API is not strictly designed for net usage but for a more generic usage. Initial version were very flexible and designed to try to support every aspect of the LED driver with many complex function that served multiple purpose. There was an idea to have sw only and hw only LEDs and sw only and hw only LEDs. With some heads up from Andrew from the net mailing list, it was suggested to implement a more basic yet easy to implement system. These API strictly work with a designated trigger to offload their function. This may be confused with hw blink offload but LED may have an even more advanced configuration where the entire aspect of the trigger is offloaded and completely handled by the hardware. An example of this usage are PHY or switch port LEDs. Almost every of these kind of device have multiple LED attached and provide info of the current port state. Currently we lack any support of them but these device always provide a way to configure them, from basic feature like turning the LED off or no (implemented in previous series related to this feature) or even entirely driven by the hw and power on/off/blink based on some events, like tx/rx traffic, ethernet cable attached, link speed of 10mbps, 100mbps, 1000mbps or more. They can also support multiple logic like blink with traffic only if a particular link speed is attached. (an example of this is when a LED is designated to be turned on only with 100mbps link speed and configured to blink on traffic and a secondary LED of a different color is present to serve the same function but only when the link speed is 1000mbps) These case are very common for a PHY or a switch but they were never standardized so OEM support all kind of variant and configuration. Again with Andrew we compared some feature and we reached a common set of modes that are for sure present in every kind of devices. And this concludes history and why. What is present in this series ============================== This patch contain the required API to support this feature, I decided on the name of hw control to quickly describe this feature. I documented each require API in the related Documentation for leds-class so I think it might me redundant to expose them here. Feel free to tell me how to improve it if anything is not clear. On an abstract idea, this feature require this: - The trigger needs to make use of it, this is currently implemented for the netdev trigger but other trigger can be expanded if the device expose these function. An idea might be a anything that handle a storage disk and have the LED configurable to blink when there is any activity to the disk. - The LED driver needs to expose and implement these new API. Currently a LED driver supports only a trigger. The trigger should use the related helper to check if the LED can be driven hy hardware. The different modes a trigger support are exposed in the kernel include leds.h header and are used by the LED driver to understand what to do. From a user standpoint, he should enable modes as usual from sysfs and if anything is not supported warned. Final words and missing piece from this series ============================================== I honestly hope this feature can finally be implemented. This series originally had also additional modes and logic to add to the netdev trigger, but I decided to strip them and implement only the API and support basic tx and rx. After this is merged, I will quickly propose these additional modes. Currently this is limited to tx and rx and this is what the current user qca8k use. Marvell PHY support link and a generic blink with any kind of traffic (both rx and tx). qca8k switch supports keeping the LED on based on link speed. The next series will add the concept of hw control only modes to the netdev trigger and support for these additional modes: - link_10 - link_100 - link_1000 - activity The current implementation is voluntary basic and limited to put the ground work and have something easy to implement and usable. 99% part of the logic is done on the trigger side, leaving to the LED driver only the validating and the apply part. As shown for the PHY led binding, people are really intrested in this feature as quickly after they were merged, people were already working on adding support for it. [1] https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git/?h=ib-leds-netdev-6.5 [2] https://lore.kernel.org/lkml/20230216013230.22978-1-ansuelsmth@gmail.com/ Changes in v4: - Added review tag from Andrew. - Move default interval to a define to keep them synced. - Apply suggested reword to improve Documentation rst. Changes in v3: - Rebased on top of net-next Changes in v2: - Drop helper as currently used only by one trigger - Improve Documentation and document return error of some functions - Squash some patch to reduce series size - Drop trigger mode mask as currently not used - Rework hw control validating function to a simple implementation Changes from previous v8 series: - Rewrite Documentation from scratch and move to separate commit - Strip additional trigger modes (to propose in a different series) - Strip from qca8k driver additional modes (to implement in the different series) - Split the netdev chages to smaller piece to permit easier review Changelog in the previous v8 series: (stripped of unrelated changes) v8: - Improve the documentation of the new feature - Rename to a more symbolic name - Fix some bug in netdev trigger (not using BIT()) - Add more define for qca8k-leds driver - Drop interval support - Fix many bugs in the validate option in the netdev trigger v7: - Fix qca8k leds documentation warning - Remove RFC tag v6: - Back to RFC. - Drop additional trigger - Rework netdev trigger to support common modes used by switch and hardware only triggers - Refresh qca8k leds logic and driver v5: - Move out of RFC. (no comments from Andrew this is the right path?) - Fix more spelling mistake (thx Randy) - Fix error reported by kernel test bot - Drop the additional HW_CONTROL flag. It does simplify CONFIG handling and hw control should be available anyway to support triggers as module. v4: - Rework implementation and drop hw_configure logic. We now expand blink_set. - Address even more spelling mistake. (thx a lot Randy) - Drop blink option and use blink_set delay. v3: - Rework start/stop as Andrew asked. - Use test_bit API to check flag passed to hw_control_configure. - Added a new cmd to hw_control_configure to reset any active blink_mode. - Refactor all the patches to follow this new implementation. v2: - Fix spelling mistake (sorry) - Drop patch 02 "permit to declare supported offload triggers". Change the logic, now the LED driver declare support for them using the configure_offload with the cmd TRIGGER_SUPPORTED. - Rework code to follow this new implementation. - Update Documentation to better describe how this offload implementation work. ==================== Signed-off-by: David S. Miller commit 4f53c27f772e27e4cf4e5507d6f4d5980002cb6a Author: Andrew Lunn Date: Mon May 29 18:32:43 2023 +0200 net: dsa: qca8k: add op to get ports netdev In order that the LED trigger can blink the switch MAC ports LED, it needs to know the netdev associated to the port. Add the callback to return the struct device of the netdev. Add an helper function qca8k_phy_to_port() to convert the phy back to dsa_port index, as we reference LED port based on the internal PHY index and needs to be converted back. Signed-off-by: Andrew Lunn Signed-off-by: Christian Marangi Signed-off-by: David S. Miller commit e0256648c831af13cbfe4a1787327fcec01c2807 Author: Christian Marangi Date: Mon May 29 18:32:42 2023 +0200 net: dsa: qca8k: implement hw_control ops Implement hw_control ops to drive Switch LEDs based on hardware events. Netdev trigger is the declared supported trigger for hw control operation and supports the following mode: - tx - rx When hw_control_set is called, LEDs are set to follow the requested mode. Each LEDs will blink at 4Hz by default. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 947acacab5ea151291b861cdfbde16ff5cf1b08c Author: Christian Marangi Date: Mon May 29 18:32:41 2023 +0200 leds: trigger: netdev: expose netdev trigger modes in linux include Expose netdev trigger modes to make them accessible by LED driver that will support netdev trigger for hw control. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 0316cc5629d15880dd3f097d221c55ca648bcd61 Author: Christian Marangi Date: Mon May 29 18:32:40 2023 +0200 leds: trigger: netdev: init mode if hw control already active On netdev trigger activation, hw control may be already active by default. If this is the case and a device is actually provided by hw_control_get_device(), init the already active mode and set the bool to hw_control bool to true to reflect the already set mode in the trigger_data. Co-developed-by: Andrew Lunn Signed-off-by: Andrew Lunn Signed-off-by: Christian Marangi Signed-off-by: David S. Miller commit 33ec0b53befff2c0a7f3aa19ff08556d60585d6b Author: Andrew Lunn Date: Mon May 29 18:32:39 2023 +0200 leds: trigger: netdev: validate configured netdev The netdev which the LED should blink for is configurable in /sys/class/led/foo/device_name. Ensure when offloading that the configured netdev is the same as the netdev the LED is associated with. If it is not, only perform software blinking. Signed-off-by: Andrew Lunn Signed-off-by: Christian Marangi Signed-off-by: David S. Miller commit 7c145a34ba6e380616af93262fcab9fc7261d851 Author: Christian Marangi Date: Mon May 29 18:32:38 2023 +0200 leds: trigger: netdev: add support for LED hw control Add support for LED hw control for the netdev trigger. The trigger on calling set_baseline_state to configure a new mode, will do various check to verify if hw control can be used for the requested mode in can_hw_control() function. It will first check if the LED driver supports hw control for the netdev trigger, then will use hw_control_is_supported() and finally will call hw_control_set() to apply the requested mode. To use such mode, interval MUST be set to the default value and net_dev MUST be set. If one of these 2 value are not valid, hw control will never be used and normal software fallback is used. The default interval value is moved to a define to make sure they are always synced. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit c84c80c7388f887b10dafd70fc55bc6c5fe9fa5a Author: Christian Marangi Date: Mon May 29 18:32:37 2023 +0200 leds: trigger: netdev: reject interval store for hw_control Reject interval store with hw_control enabled. It's are currently not supported and MUST be set to the default value with hw control enabled. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 6352f25f9fadba59d5df2ba7139495759ccc81d5 Author: Christian Marangi Date: Mon May 29 18:32:36 2023 +0200 leds: trigger: netdev: add basic check for hw control support Add basic check for hw control support. Check if the required API are defined and check if the defined trigger supported in hw control for the LED driver match netdev. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 4fd1b6d47a7a38e81fdc6f8be2ccd4216b3f93db Author: Christian Marangi Date: Mon May 29 18:32:35 2023 +0200 leds: trigger: netdev: introduce check for possible hw control Introduce function to check if the requested mode can use hw control in preparation for hw control support. Currently everything is handled in software so can_hw_control will always return false. Add knob with the new value hw_control in trigger_data struct to set hw control possible. Useful for future implementation to implement in set_baseline_state() the required function to set the requested mode using LEDs hw control ops and in other function to reject set if hw control is currently active. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 28a6a2ef18ad840a390d519840c303b03040961c Author: Andrew Lunn Date: Mon May 29 18:32:34 2023 +0200 leds: trigger: netdev: refactor code setting device name Move the code into a helper, ready for it to be called at other times. No intended behaviour change. Signed-off-by: Andrew Lunn Signed-off-by: Christian Marangi Signed-off-by: David S. Miller commit 8aa2fd7b66980ecd2e45e95af61cf7eafede1211 Author: Christian Marangi Date: Mon May 29 18:32:33 2023 +0200 Documentation: leds: leds-class: Document new Hardware driven LEDs APIs Document new Hardware driven LEDs APIs. Some LEDs can be programmed to be driven by hardware. This is not limited to blink but also to turn off or on autonomously. To support this feature, a LED needs to implement various additional ops and needs to declare specific support for the supported triggers. Add documentation for each required value and API to make hw control possible and implementable by both LEDs and triggers. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 052c38eb17e866c5b4cd43924e7a5e20167b55c0 Author: Andrew Lunn Date: Mon May 29 18:32:32 2023 +0200 leds: add API to get attached device for LED hw control Some specific LED triggers blink the LED based on events from a device or subsystem. For example, an LED could be blinked to indicate a network device is receiving packets, or a disk is reading blocks. To correctly enable and request the hw control of the LED, the trigger has to check if the network interface or block device configured via a /sys/class/led file match the one the LED driver provide for hw control for. Provide an API call to get the device which the LED blinks for. Signed-off-by: Andrew Lunn Signed-off-by: Christian Marangi Signed-off-by: David S. Miller commit ed554d3f945179c5b159bddfad7be34b403fe11a Author: Christian Marangi Date: Mon May 29 18:32:31 2023 +0200 leds: add APIs for LEDs hw control Add an option to permit LED driver to declare support for a specific trigger to use hw control and setup the LED to blink based on specific provided modes. Add APIs for LEDs hw control. These functions will be used to activate hardware control where a LED will use the provided flags, from an unique defined supported trigger, to setup the LED to be driven by hardware. Add hw_control_is_supported() to ask the LED driver if the requested mode by the trigger are supported and the LED can be setup to follow the requested modes. Deactivate hardware blink control by setting brightness to LED_OFF via the brightness_set() callback. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit df25edbac31ea87b488789d44a362063542b5967 Author: Peter Zijlstra Date: Mon May 15 11:28:05 2023 +0200 x86/alternatives: Add longer 64-bit NOPs By adding support for longer NOPs there are a few more alternatives that can turn into a single instruction. Add up to NOP11, the same limit where GNU as .nops also stops generating longer nops. This is because a number of uarchs have severe decode penalties for more than 3 prefixes. [ bp: Sync up with the version in tools/ while at it. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230515093020.661756940@infradead.org commit 6cd8ec58c1bf65adcdf346fe241ba69e0b56e6bd Author: Xin Long Date: Mon May 29 10:52:13 2023 -0400 tipc: delete tipc_mtu_bad from tipc_udp_enable Since commit a4dfa72d0acd ("tipc: set default MTU for UDP media"), it's been no longer using dev->mtu for b->mtu, and the issue described in commit 3de81b758853 ("tipc: check minimum bearer MTU") doesn't exist in UDP bearer any more. Besides, dev->mtu can still be changed to a too small mtu after the UDP bearer is created even with tipc_mtu_bad() check in tipc_udp_enable(). Note that NETDEV_CHANGEMTU event processing in tipc_l2_device_event() doesn't really work for UDP bearer. So this patch deletes the unnecessary tipc_mtu_bad from tipc_udp_enable. Signed-off-by: Xin Long Reviewed-by: Tung Nguyen Link: https://lore.kernel.org/r/282f1f5cc40e6cad385aa1c60569e6c5b70e2fb3.1685371933.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit c23515ad4ea822e83b06c8e0941cc51ebcaa647e Merge: e180a33cf4636 12899f299803d Author: Jakub Kicinski Date: Tue May 30 23:54:35 2023 -0700 Merge branch 'net-dsa-mv88e6xxx-add-88e6361-support' Alexis Lothoré says: ==================== net: dsa: mv88e6xxx: add 88E6361 support This series brings initial support for Marvell 88E6361 switch. MV88E6361 is a 8 ports switch with 5 integrated Gigabit PHYs and 3 2.5Gigabit SerDes interfaces. It is in fact a new variant in the 88E639X/88E6193X/88E6191X family with a subset of existing features: - port 0: MII, RMII, RGMII, 1000BaseX, 2500BaseX - port 3 to 7: triple speed internal phys - port 9 and 10: 1000BaseX, 25000BaseX Since said family is already well supported in mv88e6xxx driver, adding initial support for this new switch mostly consists in finding the ID exposed in its identification register, adding a proper description in switch description tables in mv88e6xxx driver, and enforcing 88E6361 specificities in mv88e6393x_XXX methods. - first 4 commits introduce an internal phy offset field for switches which have internal phys but not starting from port 0 - 5th commit is a fix on existing switches based on first commits - 6th commit is a slight modification to prepare 886361 support - last commit introduces 88E6361 support in 88E6393X family This initial support has been tested with two samples of a custom board with the following hardware configuration: - a main CPU connected to MV88E6361 using port 0 as CPU port - port 9 wired to a SFP cage - port 10 wired to a G.Hn transceiver The following setup was used: PC <-ethernet-> (copper SFP) - Board 1 - (G.hn) <-phone line(RJ11)-> (G.hn) Board 2 The unit 1 has been configured to bridge SFP port and G.hn port together, which allowed to successfully ping Board 2 from PC. ==================== Link: https://lore.kernel.org/r/20230529080246.82953-1-alexis.lothore@bootlin.com Signed-off-by: Jakub Kicinski commit 12899f299803d293d8e4d46d67cf2cc1380b9faa Author: Alexis Lothoré Date: Mon May 29 10:02:46 2023 +0200 net: dsa: mv88e6xxx: enable support for 88E6361 switch Marvell 88E6361 is an 8-port switch derived from the 88E6393X/88E9193X/88E6191X switches family. It can benefit from the existing mv88e6xxx driver by simply adding the proper switch description in the driver. Main differences with other switches from this family are: - 8 ports exposed (instead of 11): ports 1, 2 and 8 not available - No 5GBase-x nor SFI/USXGMII support Signed-off-by: Alexis Lothoré Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 18e1b7422dffe4c0f897fa63eb074f79d1d9d0a0 Author: Alexis Lothoré Date: Mon May 29 10:02:45 2023 +0200 net: dsa: mv88e6xxx: pass mv88e6xxx_chip structure to port_max_speed_mode Some switches families have minor differences on supported link speed for ports. Instead of redefining a new port_max_speed_mode for each different configuration, allow to pass mv88e6xxx_chip structure to allow differentiating those chips by known chip id Signed-off-by: Alexis Lothoré Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 2f93493970dfa46779f134f1fb2cd803b8c80ea4 Author: Alexis Lothoré Date: Mon May 29 10:02:44 2023 +0200 net: dsa: mv88e6xxx: fix 88E6393X family internal phys layout 88E6393X/88E6193X/88E6191X switches have in fact 8 internal PHYs, but those are not present starting at port 0: supported ports go from 1 to 8 Signed-off-by: Alexis Lothoré Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 3ba89b28adb21a5d5d78e905e2c3972816606bb4 Author: Alexis Lothoré Date: Mon May 29 10:02:43 2023 +0200 net: dsa: mv88e6xxx: add field to specify internal phys layout mv88e6xxx currently assumes that switch equipped with internal phys have those phys mapped contiguously starting from port 0 (see mv88e6xxx_phy_is_internal). However, some switches have internal PHYs but NOT starting from port 0. For example 88e6393X, 88E6193X and 88E6191X have integrated PHYs available on ports 1 to 8 To properly support this offset, add a new field to allow specifying an internal PHYs layout. If field is not set, default layout is assumed (start at port 0) Signed-off-by: Alexis Lothoré Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 7a2dd00be869f0bcdcb13f4272913ba7371ab583 Author: Alexis Lothoré Date: Mon May 29 10:02:42 2023 +0200 net: dsa: mv88e6xxx: use mv88e6xxx_phy_is_internal in mv88e6xxx_port_ppu_updates Make sure to use existing helper to get internal PHYs count instead of redoing it manually Signed-off-by: Alexis Lothoré Reviewed-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit ca345931907ff1893f02f5fe1349b16c9fc27e4c Author: Alexis Lothoré Date: Mon May 29 10:02:41 2023 +0200 net: dsa: mv88e6xxx: pass directly chip structure to mv88e6xxx_phy_is_internal Since this function is a simple helper, we do not need to pass a full dsa_switch structure, we can directly pass the mv88e6xxx_chip structure. Doing so will allow to share this function with any other function not manipulating dsa_switch structure but needing info about number of internal phys Signed-off-by: Alexis Lothoré Reviewed-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 9229a9483d80ba1cc7a75a552afff3e5afdf99e0 Author: Alexis Lothoré Date: Mon May 29 10:02:40 2023 +0200 dt-bindings: net: dsa: marvell: add MV88E6361 switch to compatibility list Marvell MV88E6361 is an 8-port switch derived from the 88E6393X/88E9193X/88E6191X switches family. Since its functional behavior is very close to switches from this family, it can benefit from existing drivers for this family, so add it to the list of compatible switches Signed-off-by: Alexis Lothoré Reviewed-by: Andrew Lunn Acked-by: Conor Dooley Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit e180a33cf4636721de9c3e694aaad31e77fcdeb1 Merge: 2e246bca98659 8c33266ae26aa Author: Jakub Kicinski Date: Tue May 30 23:37:02 2023 -0700 Merge branch 'add-layer-2-miss-indication-and-filtering' Ido Schimmel says: ==================== Add layer 2 miss indication and filtering tl;dr ===== This patchset adds a single bit to the tc skb extension to indicate that a packet encountered a layer 2 miss in the bridge and extends flower to match on this metadata. This is required for non-DF (Designated Forwarder) filtering in EVPN multi-homing which prevents decapsulated BUM packets from being forwarded multiple times to the same multi-homed host. Background ========== In a typical EVPN multi-homing setup each host is multi-homed using a set of links called ES (Ethernet Segment, i.e., LAG) to multiple leaf switches in a rack. These switches act as VTEPs and are not directly connected (as opposed to MLAG), but can communicate with each other (as well as with VTEPs in remote racks) via spine switches over L3. When a host sends a BUM packet over ES1 to VTEP1, the VTEP will flood it to other VTEPs in the network, including those connected to the host over ES1. The receiving VTEPs must drop the packet and not forward it back to the host. This is called "split-horizon filtering" (SPH) [1]. FRR configures SPH filtering using two tc filters. The first, an ingress filter that matches on packets received from VTEP1 and marks them using a fwmark (firewall mark). The second, an egress filter configured on the LAG interface connected to the host that matches on the fwmark and drops the packets. Example: # tc filter add dev vxlan0 ingress pref 1 proto all flower enc_src_ip $VTEP1_IP action skbedit mark 101 # tc filter add dev bond0 egress pref 1 handle 101 fw action drop Motivation ========== For each ES, only one VTEP is elected by the control plane as the DF. The DF is responsible for forwarding decapsulated BUM traffic to the host over the ES. The non-DF VTEPs must drop such traffic as otherwise the host will receive multiple copies of BUM traffic. This is called "non-DF filtering" [2]. Filtering of multicast and broadcast traffic can be achieved using the following flower filter: # tc filter add dev bond0 egress pref 1 proto all flower indev vxlan0 dst_mac 01:00:00:00:00:00/01:00:00:00:00:00 action drop Unlike broadcast and multicast traffic, it is not currently possible to filter unknown unicast traffic. The classification into unknown unicast is performed by the bridge driver, but is not visible to other layers. Implementation ============== The proposed solution is to add a single bit to the tc skb extension that is set by the bridge for packets that encountered an FDB or MDB miss. The flower classifier is extended to be able to match on this new metadata bit in a similar fashion to existing metadata options such as 'indev'. A bit that is set for every flooded packet would also work, but it does not allow us to differentiate between registered and unregistered multicast traffic which might be useful in the future. A relatively generic name is chosen for this bit - 'l2_miss' - to allow its use to be extended to other layer 2 devices such as VXLAN, should a use case arise. With the above, the control plane can implement a non-DF filter using the following tc filters: # tc filter add dev bond0 egress pref 1 proto all flower indev vxlan0 dst_mac 01:00:00:00:00:00/01:00:00:00:00:00 action drop # tc filter add dev bond0 egress pref 2 proto all flower indev vxlan0 l2_miss true action drop The first drops broadcast and multicast traffic and the second drops unknown unicast traffic. Testing ======= A test exercising the different permutations of the 'l2_miss' bit is added in patch #8. Patchset overview ================= Patch #1 adds the new bit to the tc skb extension and sets it in the bridge driver for packets that encountered a miss. The marking of the packets and the use of this extension is protected by the 'tc_skb_ext_tc' static key in order to keep performance impact to a minimum when the feature is not in use. Patch #2 extends the flow dissector to dissect this information from the tc skb extension into the 'FLOW_DISSECTOR_KEY_META' key. Patch #3 extends the flower classifier to be able to match on the new layer 2 miss metadata. The classifier enables the 'tc_skb_ext_tc' static key upon the installation of the first filter that matches on 'l2_miss' and disables the key upon the removal of the last filter that matches on it. Patch #4 rejects matching on the new metadata in drivers that already support the 'FLOW_DISSECTOR_KEY_META' key. Patches #5-#6 are small preparations in mlxsw. Patch #7 extends mlxsw to be able to match on layer 2 miss. Patch #8 adds a selftest. iproute2 patches can be found here [3]. [1] https://datatracker.ietf.org/doc/html/rfc7432#section-8.3 [2] https://datatracker.ietf.org/doc/html/rfc7432#section-8.5 [3] https://github.com/idosch/iproute2/tree/submit/non_df_filter_v1 [4] https://lore.kernel.org/netdev/20230518113328.1952135-1-idosch@nvidia.com/ [5] https://lore.kernel.org/netdev/20230509070446.246088-1-idosch@nvidia.com/ ==================== Link: https://lore.kernel.org/r/20230529114835.372140-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 8c33266ae26aa462409f8959624a95aea7831763 Author: Ido Schimmel Date: Mon May 29 14:48:35 2023 +0300 selftests: forwarding: Add layer 2 miss test cases Add test cases to verify that the bridge driver correctly marks layer 2 misses only when it should and that the flower classifier can match on this metadata. Example output: # ./tc_flower_l2_miss.sh TEST: L2 miss - Unicast [ OK ] TEST: L2 miss - Multicast (IPv4) [ OK ] TEST: L2 miss - Multicast (IPv6) [ OK ] TEST: L2 miss - Link-local multicast (IPv4) [ OK ] TEST: L2 miss - Link-local multicast (IPv6) [ OK ] TEST: L2 miss - Broadcast [ OK ] Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit caa4c58ab5d9078097067cdd8a350ff6796df0ba Author: Ido Schimmel Date: Mon May 29 14:48:34 2023 +0300 mlxsw: spectrum_flower: Add ability to match on layer 2 miss Add the 'fdb_miss' key element to supported key blocks and make use of it to match on layer 2 miss. The key is only supported on Spectrum-{2,3,4}. An error is returned for Spectrum-1 since the key element is not present in any of its key blocks. Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit 0b9cd74b8d1e07111a048e8eeb15f54f2ed9cbe2 Author: Ido Schimmel Date: Mon May 29 14:48:33 2023 +0300 mlxsw: spectrum_flower: Do not force matching on iif Currently, mlxsw only supports the 'ingress_ifindex' field in the 'FLOW_DISSECTOR_KEY_META' key, but subsequent patches are going to add support for the 'l2_miss' field as well. It is valid to only match on 'l2_miss' without 'ingress_ifindex', so do not force matching on it. Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit d04e265096784b4cebeb627b21f0f27410d20dc4 Author: Ido Schimmel Date: Mon May 29 14:48:32 2023 +0300 mlxsw: spectrum_flower: Split iif parsing to a separate function Currently, mlxsw only supports the 'ingress_ifindex' field in the 'FLOW_DISSECTOR_KEY_META' key, but subsequent patches are going to add support for the 'l2_miss' field as well. Split the parsing of the 'ingress_ifindex' field to a separate function to avoid nesting. No functional changes intended. Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit f4356947f0297b0962fdd197672db7edf9f58be6 Author: Ido Schimmel Date: Mon May 29 14:48:31 2023 +0300 flow_offload: Reject matching on layer 2 miss Adjust drivers that support the 'FLOW_DISSECTOR_KEY_META' key to reject filters that try to match on the newly added layer 2 miss field. Add an extack message to clearly communicate the failure reason to user space. The following users were not patched: 1. mtk_flow_offload_replace(): Only checks that the key is present, but does not do anything with it. 2. mlx5_tc_ct_set_tuple_match(): Used as part of netfilter offload, which does not make use of the new field, unlike tc. 3. get_netdev_from_rule() in nfp: Likewise. Example: # tc filter add dev swp1 egress pref 1 proto all flower skip_sw l2_miss true action drop Error: mlxsw_spectrum: Can't match on "l2_miss". We have an error talking to the kernel Acked-by: Elad Nachman Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit 1a432018c0cdf51a77a2e134b19ba6cab4c29c89 Author: Ido Schimmel Date: Mon May 29 14:48:30 2023 +0300 net/sched: flower: Allow matching on layer 2 miss Add the 'TCA_FLOWER_L2_MISS' netlink attribute that allows user space to match on packets that encountered a layer 2 miss. The miss indication is set as metadata in the tc skb extension by the bridge driver upon FDB or MDB lookup miss and dissected by the flow dissector to the 'FLOW_DISSECTOR_KEY_META' key. The use of this skb extension is guarded by the 'tc_skb_ext_tc' static key. As such, enable / disable this key when filters that match on layer 2 miss are added / deleted. Tested: # cat tc_skb_ext_tc.py #!/usr/bin/env -S drgn -s vmlinux refcount = prog["tc_skb_ext_tc"].key.enabled.counter.value_() print(f"tc_skb_ext_tc reference count is {refcount}") # ./tc_skb_ext_tc.py tc_skb_ext_tc reference count is 0 # tc filter add dev swp1 egress proto all handle 101 pref 1 flower src_mac 00:11:22:33:44:55 action drop # tc filter add dev swp1 egress proto all handle 102 pref 2 flower src_mac 00:11:22:33:44:55 l2_miss true action drop # tc filter add dev swp1 egress proto all handle 103 pref 3 flower src_mac 00:11:22:33:44:55 l2_miss false action drop # ./tc_skb_ext_tc.py tc_skb_ext_tc reference count is 2 # tc filter replace dev swp1 egress proto all handle 102 pref 2 flower src_mac 00:01:02:03:04:05 l2_miss false action drop # ./tc_skb_ext_tc.py tc_skb_ext_tc reference count is 2 # tc filter del dev swp1 egress proto all handle 103 pref 3 flower # tc filter del dev swp1 egress proto all handle 102 pref 2 flower # tc filter del dev swp1 egress proto all handle 101 pref 1 flower # ./tc_skb_ext_tc.py tc_skb_ext_tc reference count is 0 Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit d5ccfd90df7fd0a50038a68634c131b8fd081bac Author: Ido Schimmel Date: Mon May 29 14:48:29 2023 +0300 flow_dissector: Dissect layer 2 miss from tc skb extension Extend the 'FLOW_DISSECTOR_KEY_META' key with a new 'l2_miss' field and populate it from a field with the same name in the tc skb extension. This field is set by the bridge driver for packets that incur an FDB or MDB miss. The next patch will extend the flower classifier to be able to match on layer 2 misses. Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit 7b4858df3bf7a8d43ed6b58f411543a040c56f10 Author: Ido Schimmel Date: Mon May 29 14:48:28 2023 +0300 skbuff: bridge: Add layer 2 miss indication For EVPN non-DF (Designated Forwarder) filtering we need to be able to prevent decapsulated traffic from being flooded to a multi-homed host. Filtering of multicast and broadcast traffic can be achieved using the following flower filter: # tc filter add dev bond0 egress pref 1 proto all flower indev vxlan0 dst_mac 01:00:00:00:00:00/01:00:00:00:00:00 action drop Unlike broadcast and multicast traffic, it is not currently possible to filter unknown unicast traffic. The classification into unknown unicast is performed by the bridge driver, but is not visible to other layers such as tc. Solve this by adding a new 'l2_miss' bit to the tc skb extension. Clear the bit whenever a packet enters the bridge (received from a bridge port or transmitted via the bridge) and set it if the packet did not match an FDB or MDB entry. If there is no skb extension and the bit needs to be cleared, then do not allocate one as no extension is equivalent to the bit being cleared. The bit is not set for broadcast packets as they never perform a lookup and therefore never incur a miss. A bit that is set for every flooded packet would also work for the current use case, but it does not allow us to differentiate between registered and unregistered multicast traffic, which might be useful in the future. To keep the performance impact to a minimum, the marking of packets is guarded by the 'tc_skb_ext_tc' static key. When 'false', the skb is not touched and an skb extension is not allocated. Instead, only a 5 bytes nop is executed, as demonstrated below for the call site in br_handle_frame(). Before the patch: ``` memset(skb->cb, 0, sizeof(struct br_input_skb_cb)); c37b09: 49 c7 44 24 28 00 00 movq $0x0,0x28(%r12) c37b10: 00 00 p = br_port_get_rcu(skb->dev); c37b12: 49 8b 44 24 10 mov 0x10(%r12),%rax memset(skb->cb, 0, sizeof(struct br_input_skb_cb)); c37b17: 49 c7 44 24 30 00 00 movq $0x0,0x30(%r12) c37b1e: 00 00 c37b20: 49 c7 44 24 38 00 00 movq $0x0,0x38(%r12) c37b27: 00 00 ``` After the patch (when static key is disabled): ``` memset(skb->cb, 0, sizeof(struct br_input_skb_cb)); c37c29: 49 c7 44 24 28 00 00 movq $0x0,0x28(%r12) c37c30: 00 00 c37c32: 49 8d 44 24 28 lea 0x28(%r12),%rax c37c37: 48 c7 40 08 00 00 00 movq $0x0,0x8(%rax) c37c3e: 00 c37c3f: 48 c7 40 10 00 00 00 movq $0x0,0x10(%rax) c37c46: 00 #ifdef CONFIG_HAVE_JUMP_LABEL_HACK static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { asm_volatile_goto("1:" c37c47: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) br_tc_skb_miss_set(skb, false); p = br_port_get_rcu(skb->dev); c37c4c: 49 8b 44 24 10 mov 0x10(%r12),%rax ``` Subsequent patches will extend the flower classifier to be able to match on the new 'l2_miss' bit and enable / disable the static key when filters that match on it are added / deleted. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Acked-by: Jakub Kicinski Signed-off-by: Jakub Kicinski commit 5b4560cf15602a4217d2f5664cf031d98780f0f0 Author: Prathu Baronia Date: Thu May 18 16:03:24 2023 +0530 arm: omap1: replace printk() with pr_err macro Use pr_err() macro instead of printk(KERN_ERR "..."). Signed-off-by: Prathu Baronia Message-Id: <20230518103324.881394-1-quic_pbaronia@quicinc.com> Signed-off-by: Tony Lindgren commit b5b2e006c98f97f2c83aeeb6e7e8fb32198cc43a Author: Franziska Naepelt Date: Tue May 30 20:24:03 2023 +0200 ARM: omap: Fix checkpatch issues This removes the following checkpatch issues: - ERROR: space required after that ',' (ctx:VxV) - WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Franziska Naepelt Message-Id: <20230530182403.35646-1-franziska.naepelt@gmail.com> [tony@atomide.com: add space also around '-' in addition to ','] Signed-off-by: Tony Lindgren commit 445d5be64be82c11505c41d75a4bde3af41d619b Author: Andreas Kemnade Date: Mon Mar 13 12:04:09 2023 +0100 ARM: dts: omap4: add initial support for Epson Moverio BT-200 Add the devices working with current drivers for the Epson Moverio BT-200 AR glasses consisting of a control unit and the glasses itself. Signed-off-by: Andreas Kemnade Message-Id: <20230313110409.2294154-1-andreas@kemnade.info> Signed-off-by: Tony Lindgren commit 17ff149eee01110e5d545ad7b936d48aff43407f Author: Alexander Shiyan Date: Wed May 24 12:11:56 2023 +0300 ARM: dts: am335x-myirtech: Add missing NAND wait pin definition The NAND wait pin is connected to the GPMC, but this is not mentioned in the DT bindings. Let's fix this. Signed-off-by: Alexander Shiyan Message-Id: <20230524091157.775960-1-eagle.alexander923@gmail.com> Signed-off-by: Tony Lindgren commit 3e36c490698660ba4fa7cedfab03f3ed81a07192 Author: Suraj Kandpal Date: Mon May 29 16:37:40 2023 +0530 drm/i915/hdcp: Rename comp_mutex to hdcp_mutex Rename comp_mutex to hdcp_mutex as it does not just protect component related variables which was a terminology used when hdcp was to be binded as a mei component from MTL we use gsc cs which does not use the component binding path for HDCP. Cc: Jani Nikula Cc: Ankit Nautiyal Signed-off-by: Suraj Kandpal Reviewed-by: Chaitanya Kumar Borah Signed-off-by: Ankit Nautiyal Link: https://patchwork.freedesktop.org/patch/msgid/20230529110740.1522985-4-suraj.kandpal@intel.com commit 5c8ec987997ab444df18813e0a3f565f366d05d1 Author: Suraj Kandpal Date: Mon May 29 16:37:39 2023 +0530 drm/i915/hdcp: Move away from master naming to arbiter Rename variables to move away from master convention to arbiter %s/hdcp.master/hdcp.arbiter %s/i915_hdcp_master/i915_hdcp_arbiter %s/comp_master/comp_arbiter --v2 - delete i915_hdcp_comp_master redundant declaration [Chaitanya] - use %s/foo/bar/ format in commit message to show changes [Chaitanya] --v3 - replace i915_hdcp_comp_master declaration with i915_hdcp_arbiter to avoid any compile fail with old compilers [Chaitanya] Cc: Chaitanya Kumar Borah Cc: Ankit Nautiyal Cc: Jani Nikula Signed-off-by: Suraj Kandpal Reviewed-by: Chaitanya Kumar Borah Signed-off-by: Ankit Nautiyal Link: https://patchwork.freedesktop.org/patch/msgid/20230529110740.1522985-3-suraj.kandpal@intel.com commit 401e6cd974a708d4c191fda3bdacd6a67c5b30bf Author: Suraj Kandpal Date: Mon May 29 16:37:38 2023 +0530 drm/i915/hdcp: Rename dev_priv to i915 Rename dev_priv to i915 to keep up with latest code standards. Cc: Ankit Nautiyal Cc: Jani Nikula Signed-off-by: Suraj Kandpal Reviewed-by: Chaitanya Kumar Borah Signed-off-by: Ankit Nautiyal Link: https://patchwork.freedesktop.org/patch/msgid/20230529110740.1522985-2-suraj.kandpal@intel.com commit b2a2ab039bd58f51355e33d7d3fc64605d7f870d Author: Stephan Gerhold Date: Tue May 30 17:54:46 2023 +0200 opp: Fix use-after-free in lazy_opp_tables after probe deferral When dev_pm_opp_of_find_icc_paths() in _allocate_opp_table() returns -EPROBE_DEFER, the opp_table is freed again, to wait until all the interconnect paths are available. However, if the OPP table is using required-opps then it may already have been added to the global lazy_opp_tables list. The error path does not remove the opp_table from the list again. This can cause crashes later when the provider of the required-opps is added, since we will iterate over OPP tables that have already been freed. E.g.: Unable to handle kernel NULL pointer dereference when read CPU: 0 PID: 7 Comm: kworker/0:0 Not tainted 6.4.0-rc3 PC is at _of_add_opp_table_v2 (include/linux/of.h:949 drivers/opp/of.c:98 drivers/opp/of.c:344 drivers/opp/of.c:404 drivers/opp/of.c:1032) -> lazy_link_required_opp_table() Fix this by calling _of_clear_opp_table() to remove the opp_table from the list and clear other allocated resources. While at it, also add the missing mutex_destroy() calls in the error path. Cc: stable@vger.kernel.org Suggested-by: Viresh Kumar Fixes: 7eba0c7641b0 ("opp: Allow lazy-linking of required-opps") Signed-off-by: Stephan Gerhold Signed-off-by: Viresh Kumar commit 72a597aed1d9eb9ce21f68e4284ef3598d67cda9 Author: Uwe Kleine-König Date: Tue May 30 09:42:16 2023 +0200 drm/panel-edp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. panel_edp_remove() always returned zero, so convert it to return void without any loss and then just drop the return from panel_edp_platform_remove(). Signed-off-by: Uwe Kleine-König Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230530074216.2195962-1-u.kleine-koenig@pengutronix.de commit 59272ad8d9e8ea6398a96f8c6d62da284bf2ae6e Author: Uwe Kleine-König Date: Fri Mar 10 23:41:28 2023 +0100 bus: fsl-mc: Make remove function return void The value returned by an fsl-mc driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero and then device removal continues unconditionally.) So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour, all callbacks were prepared to return 0 before. Signed-off-by: Uwe Kleine-König Reviewed-by: Ioana Ciornei Tested-by: Ioana Ciornei # sanity checks Reviewed-by: Laurentiu Tudor Tested-by: Laurentiu Tudor Signed-off-by: Li Yang commit c27ea8e6325cad44c8c5bc2e8e7cc7635f358f31 Author: Uwe Kleine-König Date: Fri Mar 10 23:41:27 2023 +0100 soc: fsl: dpio: Suppress duplicated error reporting on device remove Returning an error code from a fsl_mc_driver's remove callback results in a generic error message, otherwise the value is ignored and the device gets unbound. As the only error path in dpaa2_dpio_remove() already emits an error message, return zero unconditionally to suppress another (less helpful) error report. Signed-off-by: Uwe Kleine-König Reviewed-by: Ioana Ciornei Tested-by: Ioana Ciornei # sanity checks Reviewed-by: Laurentiu Tudor Tested-by: Laurentiu Tudor Signed-off-by: Li Yang commit b3134039c5b3cf879841e3ec84c8cbf7675554ec Author: Uwe Kleine-König Date: Fri Mar 10 23:41:26 2023 +0100 bus: fsl-mc: fsl-mc-allocator: Improve error reporting Instead of silently returning an error in the remove callback (which yields a generic and little informing error message), annotate each error path of fsl_mc_resource_pool_remove_device() with an error message and return zero in the remove callback to suppress the error message. Note that changing the return value has no other effect than suppressing the error message by the fsl_mc bus driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Ioana Ciornei Tested-by: Ioana Ciornei # sanity checks Reviewed-by: Laurentiu Tudor Tested-by: Laurentiu Tudor Signed-off-by: Li Yang commit e0ac89361cfb45d7c84de81563367745d2056f16 Author: Uwe Kleine-König Date: Fri Mar 10 23:41:25 2023 +0100 bus: fsl-mc: fsl-mc-allocator: Drop if block with always wrong condition If fsl_mc_is_allocatable(mc_dev) evaluates to false, the driver won't have bound to that device and then fsl_mc_allocator_remove() is never called for that device. fsl_mc_allocator_remove() is the only caller of fsl_mc_resource_pool_remove_device(), so the same check can be removed from there. Signed-off-by: Uwe Kleine-König Reviewed-by: Ioana Ciornei Tested-by: Ioana Ciornei # sanity checks Reviewed-by: Laurentiu Tudor Tested-by: Laurentiu Tudor Signed-off-by: Li Yang commit f8fce8318366ad4a85aba7a6c9fca900876b01f9 Author: Uwe Kleine-König Date: Fri Mar 10 23:41:24 2023 +0100 bus: fsl-mc: dprc: Push down error message from fsl_mc_driver_remove() The error message emitted in fsl_mc_driver_remove() is very generic. Replace it by a message that mentions the reason for the failure. Returning zero instead of a negative value has no side effect apart from suppressing the generic error message. The first if condition in dprc_remove() can never be true, as this would prevent successful probing of the device and then .remove wasn't called. So this can just be dropped. Signed-off-by: Uwe Kleine-König Reviewed-by: Ioana Ciornei Tested-by: Ioana Ciornei # sanity checks Reviewed-by: Laurentiu Tudor Tested-by: Laurentiu Tudor Signed-off-by: Li Yang commit b816b9444c105b159ffc710579a204b75ed61261 Author: Uwe Kleine-König Date: Fri Mar 10 23:41:23 2023 +0100 bus: fsl-mc: Only warn once about errors on device unbind If a platform driver's remove function returns an error code, this results in a (generic and little helpful) error message. Otherwise the value is ignored. As fsl_mc_driver_remove() already emit an error message, return 0 also in the error case. The only effect is to suppress the device core's error message. Signed-off-by: Uwe Kleine-König Reviewed-by: Ioana Ciornei Tested-by: Ioana Ciornei # sanity checks Reviewed-by: Laurentiu Tudor Tested-by: Laurentiu Tudor Signed-off-by: Li Yang commit 332af828ce78f9c49c65ff35b9fe171060c9d045 Author: Uwe Kleine-König Date: Fri May 26 11:07:09 2023 +0200 drm: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Kieran Bingham Reviewed-by: Javier Martinez Canillas Reviewed-by: Martyn Welch Reviewed-by: Douglas Anderson Reviewed-by: Guenter Roeck Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230526090709.1517297-1-u.kleine-koenig@pengutronix.de commit 26f15e5de15f7917358af0fda4291b74a3285989 Author: Arnd Bergmann Date: Wed May 17 14:50:34 2023 +0200 ubsan: add prototypes for internal functions Most of the functions in ubsan that are only called from generated code don't have a prototype, which W=1 builds warn about: lib/ubsan.c:226:6: error: no previous prototype for '__ubsan_handle_divrem_overflow' [-Werror=missing-prototypes] lib/ubsan.c:307:6: error: no previous prototype for '__ubsan_handle_type_mismatch' [-Werror=missing-prototypes] lib/ubsan.c:321:6: error: no previous prototype for '__ubsan_handle_type_mismatch_v1' [-Werror=missing-prototypes] lib/ubsan.c:335:6: error: no previous prototype for '__ubsan_handle_out_of_bounds' [-Werror=missing-prototypes] lib/ubsan.c:352:6: error: no previous prototype for '__ubsan_handle_shift_out_of_bounds' [-Werror=missing-prototypes] lib/ubsan.c:394:6: error: no previous prototype for '__ubsan_handle_builtin_unreachable' [-Werror=missing-prototypes] lib/ubsan.c:404:6: error: no previous prototype for '__ubsan_handle_load_invalid_value' [-Werror=missing-prototypes] Add prototypes for all of these to lib/ubsan.h, and remove the one that was already present in ubsan.c. Signed-off-by: Arnd Bergmann Reviewed-by: Fangrui Song Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230517125102.930491-1-arnd@kernel.org commit d0f90841cba1931ee8284297deda53f098de5c82 Author: Kees Cook Date: Wed May 17 13:13:52 2023 -0700 checkpatch: Check for strcpy and strncpy too Warn about strcpy(), strncpy(), and strlcpy(). Suggest strscpy() and include pointers to the open KSPP issues for each, which has further details and replacement procedures. Cc: Andy Whitcroft Cc: Joe Perches Cc: Dwaipayan Ray Cc: Lukas Bulwahn Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230517201349.never.582-kees@kernel.org commit d0c2d66fcc8db748edfe60e3b443eaff931f50e9 Author: Azeem Shaikh Date: Wed May 17 14:53:23 2023 +0000 ftrace: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Acked-by: Masami Hiramatsu (Google) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230517145323.1522010-1-azeemshaikh38@gmail.com commit dd06e72e68bcb4070ef211be100d2896e236c8fb Author: Kees Cook Date: Wed May 17 12:08:44 2023 -0700 Compiler Attributes: Add __counted_by macro In an effort to annotate all flexible array members with their run-time size information, the "element_count" attribute is being introduced by Clang[1] and GCC[2] in future releases. This annotation will provide the CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE features the ability to perform run-time bounds checking on otherwise unknown-size flexible arrays. Even though the attribute is under development, we can start the annotation process in the kernel. This requires defining a macro for it, even if we have to change the name of the actual attribute later. Since it is likely that this attribute may change its name to "counted_by" in the future (to better align with a future total bytes "sized_by" attribute), name the wrapper macro "__counted_by", which also reads more clearly (and concisely) in structure definitions. [1] https://reviews.llvm.org/D148381 [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896 Cc: Bill Wendling Cc: Qing Zhao Cc: Gustavo A. R. Silva Cc: Nick Desaulniers Cc: Nathan Chancellor Cc: Tom Rix Cc: llvm@lists.linux.dev Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Nathan Chancellor Acked-by: Miguel Ojeda Link: https://lore.kernel.org/r/20230517190841.gonna.796-kees@kernel.org commit e910c8e3aa02dc456e2f4c32cb479523c326b534 Author: Arnd Bergmann Date: Tue May 23 10:19:35 2023 +0200 autofs: use flexible array in ioctl structure Commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") introduced a warning for the autofs_dev_ioctl structure: In function 'check_name', inlined from 'validate_dev_ioctl' at fs/autofs/dev-ioctl.c:131:9, inlined from '_autofs_dev_ioctl' at fs/autofs/dev-ioctl.c:624:8: fs/autofs/dev-ioctl.c:33:14: error: 'strchr' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread] 33 | if (!strchr(name, '/')) | ^~~~~~~~~~~~~~~~~ In file included from include/linux/auto_dev-ioctl.h:10, from fs/autofs/autofs_i.h:10, from fs/autofs/dev-ioctl.c:14: include/uapi/linux/auto_dev-ioctl.h: In function '_autofs_dev_ioctl': include/uapi/linux/auto_dev-ioctl.h:112:14: note: source object 'path' of size 0 112 | char path[0]; | ^~~~ This is easily fixed by changing the gnu 0-length array into a c99 flexible array. Since this is a uapi structure, we have to be careful about possible regressions but this one should be fine as they are equivalent here. While it would break building with ancient gcc versions that predate c99, it helps building with --std=c99 and -Wpedantic builds in user space, as well as non-gnu compilers. This means we probably also want it fixed in stable kernels. Cc: stable@vger.kernel.org Cc: Kees Cook Cc: Gustavo A. R. Silva" Signed-off-by: Arnd Bergmann Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230523081944.581710-1-arnd@kernel.org commit b45861ed66ded8b31c718ed096c993dfba2b07df Author: Kees Cook Date: Mon May 22 14:28:46 2023 -0700 lkdtm/bugs: Switch from 1-element array to flexible array The testing for ARRAY_BOUNDS just wants an uninstrumented array, and the proper flexible array definition is fine for that. Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Reviewed-by: Bill Wendling Signed-off-by: Kees Cook commit 7391928025f28cd4cab43e59d2b4e36509b9337e Author: Azeem Shaikh Date: Tue May 9 01:41:36 2023 +0000 befs: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated. In an effort to remove strlcpy() completely, replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230509014136.2095900-1-azeemshaikh38@gmail.com commit 2f088dfc1878108748018af0d2e3748ba9eee1e9 Author: Kees Cook Date: Fri May 12 14:22:12 2023 -0700 md/raid5: Convert stripe_head's "dev" to flexible array member Replace old-style 1-element array of "dev" in struct stripe_head with modern C99 flexible array. In the future, we can additionally annotate it with the run-time size, found in the "disks" member. Cc: Song Liu Cc: linux-raid@vger.kernel.org Reviewed-by: Christoph Hellwig Acked-by: Song Liu Signed-off-by: Kees Cook Link: https://lore.kernel.org/lkml/20230522212114.gonna.589-kees@kernel.org/ --- It looks like this memory calculation: memory = conf->min_nr_stripes * (sizeof(struct stripe_head) + max_disks * ((sizeof(struct bio) + PAGE_SIZE))) / 1024; ... was already buggy (i.e. it included the single "dev" bytes in the result). However, I'm not entirely sure if that is the right analysis, since "dev" is not related to struct bio nor PAGE_SIZE? commit 36650a357eac3e525edbd31db4fe45841b05dc3b Author: Christophe JAILLET Date: Sun May 28 18:20:25 2023 +0200 binfmt: Slightly simplify elf_fdpic_map_file() There is no point in initializing 'load_addr' and 'seg' here, they are both re-written just before being used below. Doing so, 'load_addr' can be moved in the #ifdef CONFIG_MMU section. Signed-off-by: Christophe JAILLET Acked-by: "Eric W. Biederman" Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/4f5e4096ad7f17716e924b5bd080e5709fc0b84b.1685290790.git.christophe.jaillet@wanadoo.fr commit e6302d5a285b41209ada308ced6f9562cf1c616f Author: Christophe JAILLET Date: Sun May 28 18:20:24 2023 +0200 binfmt: Use struct_size() Use struct_size() instead of hand-writing it. It is less verbose, more robust and more informative. Signed-off-by: Christophe JAILLET Acked-by: "Eric W. Biederman" Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/53150beae5dc04dac513dba391a2e4ae8696a7f3.1685290790.git.christophe.jaillet@wanadoo.fr commit 01e6aac78b1c5c9e7115c15f5dbf942959b8f3ad Author: Luis Chamberlain Date: Thu May 18 13:37:41 2023 -0700 signal: move show_unhandled_signals sysctl to its own file The show_unhandled_signals sysctl is the only sysctl for debug left on kernel/sysctl.c. We've been moving the syctls out from kernel/sysctl.c so to help avoid merge conflicts as the shared array gets out of hand. This change incurs simplifies sysctl registration by localizing it where it should go for a penalty in size of increasing the kernel by 23 bytes, we accept this given recent cleanups have actually already saved us 1465 bytes in the prior commits. ./scripts/bloat-o-meter vmlinux.3-remove-dev-table vmlinux.4-remove-debug-table add/remove: 3/1 grow/shrink: 0/1 up/down: 177/-154 (23) Function old new delta signal_debug_table - 128 +128 init_signal_sysctls - 33 +33 __pfx_init_signal_sysctls - 16 +16 sysctl_init_bases 85 59 -26 debug_table 128 - -128 Total: Before=21256967, After=21256990, chg +0.00% Reviewed-by: Joel Granados Signed-off-by: Luis Chamberlain commit 996ef312f27fa8ee8715c6ec77b6a3cdb748bdca Author: Luis Chamberlain Date: Thu May 18 13:40:15 2023 -0700 sysctl: remove empty dev table Now that all the dev sysctls have been moved out we can remove the dev sysctl base directory. We don't need to create base directories, they are created for you as if using 'mkdir -p' with register_syctl() and register_sysctl_init(). For details refer to sysctl_mkdir_p() usage. We save 90 bytes with this changes: ./scripts/bloat-o-meter vmlinux.2.remove-sysctl-table vmlinux.3-remove-dev-table add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-90 (-90) Function old new delta sysctl_init_bases 111 85 -26 dev_table 64 - -64 Total: Before=21257057, After=21256967, chg -0.00% The empty dev table has been in place since the v2.5.0 days because back then ordering was essentialy. But later commit 7ec66d06362d ("sysctl: Stop requiring explicit management of sysctl directories"), merged as of v3.4-rc1, the entire ordering of directories was replaced by allowing sysctl directory autogeneration. This new mechanism introduced on v3.4 allows for sysctl directories to automatically be created for sysctl tables when they are needed and automatically removes them when no sysctl tables use them. That commit also added a dedicated struct ctl_dir as a new type for these autogenerated directories. Reviewed-by: Joel Granados Signed-off-by: Luis Chamberlain commit a5606b94cd3d843b424a01e061dd0cadbcb0bb8c Author: Michal Wajdeczko Date: Fri May 26 16:55:38 2023 -0700 drm/i915/guc: Track all sent actions to GuC For easier debug of any unexpected error responses from GuC that might be related to non-blocking fast requests, track action code (and stack if under DEBUG_GUC config) for every H2G request. Signed-off-by: Michal Wajdeczko Signed-off-by: John Harrison Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230526235538.2230780-4-John.C.Harrison@Intel.com commit d9911020ca0e1354b4169b5bd8dea9ff123253a4 Author: Michal Wajdeczko Date: Fri May 26 16:55:37 2023 -0700 drm/i915/guc: Update log for unsolicited CTB response Instead of printing message fence twice, include HXG header of the unexpected message and its len. Signed-off-by: Michal Wajdeczko Signed-off-by: John Harrison Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230526235538.2230780-3-John.C.Harrison@Intel.com commit edfd93e60bf29668a84cbb7ada848060a47cb940 Author: Michal Wajdeczko Date: Fri May 26 16:55:36 2023 -0700 drm/i915/guc: Use FAST_REQUEST for non-blocking H2G calls In addition to the already defined REQUEST HXG message format, which is used when sender expects some confirmation or data, HXG protocol includes definition of the FAST REQUEST message, that may be used when sender does not expect any useful data to be returned. Using this instead of GUC_HXG_TYPE_EVENT for non-blocking CTB requests will allow GuC to send back GUC_HXG_TYPE_RESPONSE_FAILURE in case of errors. Note that it is not possible to return such errors to the caller, since this is for non-blocking calls and the related fence is not stored. Instead such messages are treated as unexpected, which will give an indication of potential GuC misprogramming that warrants extra debugging effort. Signed-off-by: Michal Wajdeczko Signed-off-by: John Harrison Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230526235538.2230780-2-John.C.Harrison@Intel.com commit 56f413f2cd373d6ed7c4ecb2e0e3e740cc2fdc8c Author: Colin Ian King Date: Mon Apr 17 18:53:22 2023 +0100 KVM: selftests: Fix spelling mistake "miliseconds" -> "milliseconds" There is a spelling mistake in the help for the -p option. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20230417175322.53249-1-colin.i.king@gmail.com Signed-off-by: Sean Christopherson commit 5efde6d73d58ec1ba6e22cc0cbc89fbdb38e632c Author: Sean Christopherson Date: Wed Apr 5 17:17:24 2023 -0700 KVM: selftests: Refactor stable TSC check to use TEST_REQUIRE() Refactor the nested TSC scaling test's check on a stable system TSC to use TEST_REQUIRE() to do the heavy lifting when the system doesn't have a stable TSC. Using a helper+TEST_REQUIRE() eliminates the need for gotos and a custom message. Cc: Hao Ge Cc: Vipin Sharma Link: https://lore.kernel.org/r/20230406001724.706668-1-seanjc@google.com Signed-off-by: Sean Christopherson commit cec5fe700799b3f863d25cf883f02e5735598ab5 Author: Ondrej Mosnacek Date: Mon May 29 16:05:27 2023 +0200 selinux: make labeled NFS work when mounted before policy load Currently, when an NFS filesystem that supports passing LSM/SELinux labels is mounted during early boot (before the SELinux policy is loaded), it ends up mounted without the labeling support (i.e. with Fedora policy all files get the generic NFS label system_u:object_r:nfs_t:s0). This is because the information that the NFS mount supports passing labels (communicated to the LSM layer via the kern_flags argument of security_set_mnt_opts()) gets lost and when the policy is loaded the mount is initialized as if the passing is not supported. Fix this by noting the "native labeling" in newsbsec->flags (using a new SE_SBNATIVE flag) on the pre-policy-loaded call of selinux_set_mnt_opts() and then making sure it is respected on the second call from delayed_superblock_init(). Additionally, make inode_doinit_with_dentry() initialize the inode's label from its extended attributes whenever it doesn't find it already intitialized by the filesystem. This is needed to properly initialize pre-existing inodes when delayed_superblock_init() is called. It should not trigger in any other cases (and if it does, it's still better to initialize the correct label instead of leaving the inode unlabeled). Fixes: eb9ae686507b ("SELinux: Add new labeling type native labels") Tested-by: Scott Mayhew Signed-off-by: Ondrej Mosnacek [PM: fixed 'Fixes' tag format] Signed-off-by: Paul Moore commit e38096d95f4d7e8cc15280b4a3515eee31925561 Author: Yonghong Song Date: Tue May 30 13:50:34 2023 -0700 selftests/bpf: Add a test where map key_type_id with decl_tag type Add two selftests where map creation key/value type_id's are decl_tags. Without previous patch, kernel warnings will appear similar to the one in the previous patch. With the previous patch, both kernel warnings are silenced. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230530205034.266643-1-yhs@fb.com Signed-off-by: Martin KaFai Lau commit e6c2f594ed961273479505b42040782820190305 Author: Yonghong Song Date: Tue May 30 13:50:29 2023 -0700 bpf: Silence a warning in btf_type_id_size() syzbot reported a warning in [1] with the following stacktrace: WARNING: CPU: 0 PID: 5005 at kernel/bpf/btf.c:1988 btf_type_id_size+0x2d9/0x9d0 kernel/bpf/btf.c:1988 ... RIP: 0010:btf_type_id_size+0x2d9/0x9d0 kernel/bpf/btf.c:1988 ... Call Trace: map_check_btf kernel/bpf/syscall.c:1024 [inline] map_create+0x1157/0x1860 kernel/bpf/syscall.c:1198 __sys_bpf+0x127f/0x5420 kernel/bpf/syscall.c:5040 __do_sys_bpf kernel/bpf/syscall.c:5162 [inline] __se_sys_bpf kernel/bpf/syscall.c:5160 [inline] __x64_sys_bpf+0x79/0xc0 kernel/bpf/syscall.c:5160 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd With the following btf [1] DECL_TAG 'a' type_id=4 component_idx=-1 [2] PTR '(anon)' type_id=0 [3] TYPE_TAG 'a' type_id=2 [4] VAR 'a' type_id=3, linkage=static and when the bpf_attr.btf_key_type_id = 1 (DECL_TAG), the following WARN_ON_ONCE in btf_type_id_size() is triggered: if (WARN_ON_ONCE(!btf_type_is_modifier(size_type) && !btf_type_is_var(size_type))) return NULL; Note that 'return NULL' is the correct behavior as we don't want a DECL_TAG type to be used as a btf_{key,value}_type_id even for the case like 'DECL_TAG -> STRUCT'. So there is no correctness issue here, we just want to silence warning. To silence the warning, I added DECL_TAG as one of kinds in btf_type_nosize() which will cause btf_type_id_size() returning NULL earlier without the warning. [1] https://lore.kernel.org/bpf/000000000000e0df8d05fc75ba86@google.com/ Reported-by: syzbot+958967f249155967d42a@syzkaller.appspotmail.com Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230530205029.264910-1-yhs@fb.com Signed-off-by: Martin KaFai Lau commit 5945d8b9a8e2501b0046ec34b12ef9c115bd77e6 Author: Chris Wilson Date: Wed May 17 19:27:54 2023 +0530 drm/i915/gem: Use large rings for compute contexts Allow compute contexts to submit the maximal amount of work without blocking userspace. The original size for user LRC ring's (SZ_16K) was chosen to minimise memory consumption, without being so small as to frequently stall in the middle of workloads. With the main consumers being GL / media pipelines of 2 or 3 batches per frame, we want to support ~10 requests in flight to allow for the application to control throttling without stalling within a frame. v2: - cover with else part Signed-off-by: Chris Wilson Signed-off-by: Tejas Upadhyay Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230517135754.1110291-1-tejas.upadhyay@intel.com commit 3f4bf7aa315bf55b2a569bf77f61ff81c7e11fc1 Author: Miaohe Lin Date: Wed May 24 18:25:14 2023 +0800 sched/deadline: remove unused dl_bandwidth The default deadline bandwidth control structure has been removed since commit eb77cf1c151c ("sched/deadline: Remove unused def_dl_bandwidth") leading to unused init_dl_bandwidth() and struct dl_bandwidth. Remove them to clean up the code. Signed-off-by: Miaohe Lin Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20230524102514.407486-1-linmiaohe@huawei.com commit 7aa55f2a5902646a19db89dab9961867724b27b8 Author: Arnd Bergmann Date: Mon May 22 21:50:21 2023 +0200 sched/fair: Move unused stub functions to header These four functions have a normal definition for CONFIG_FAIR_GROUP_SCHED, and empty one that is only referenced when FAIR_GROUP_SCHED is disabled but CGROUP_SCHED is still enabled. If both are turned off, the functions are still defined but the misisng prototype causes a W=1 warning: kernel/sched/fair.c:12544:6: error: no previous prototype for 'free_fair_sched_group' kernel/sched/fair.c:12546:5: error: no previous prototype for 'alloc_fair_sched_group' kernel/sched/fair.c:12553:6: error: no previous prototype for 'online_fair_sched_group' kernel/sched/fair.c:12555:6: error: no previous prototype for 'unregister_fair_sched_group' Move the alternatives into the header as static inline functions with the correct combination of #ifdef checks to avoid the warning without adding even more complexity. Signed-off-by: Arnd Bergmann Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20230522195021.3456768-6-arnd@kernel.org commit f7df852ad6dbb84644e75df7402d9a34f39f31bd Author: Arnd Bergmann Date: Mon May 22 21:50:20 2023 +0200 sched: Make task_vruntime_update() prototype visible Having the prototype next to the caller but not visible to the callee causes a W=1 warning: kernel/sched/fair.c:11985:6: error: no previous prototype for 'task_vruntime_update' [-Werror=missing-prototypes] Move this to a header, as we do for all other function declarations. Signed-off-by: Arnd Bergmann Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20230522195021.3456768-5-arnd@kernel.org commit c0bdfd72fbfb7319581bd5bb09b4f10979385bac Author: Arnd Bergmann Date: Mon May 22 21:50:19 2023 +0200 sched/fair: Hide unused init_cfs_bandwidth() stub init_cfs_bandwidth() is only used when CONFIG_FAIR_GROUP_SCHED is enabled, and without this causes a W=1 warning for the missing prototype: kernel/sched/fair.c:6131:6: error: no previous prototype for 'init_cfs_bandwidth' The normal implementation is only defined for CONFIG_CFS_BANDWIDTH, so the stub exists when CFS_BANDWIDTH is disabled but FAIR_GROUP_SCHED is enabled. Signed-off-by: Arnd Bergmann Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20230522195021.3456768-4-arnd@kernel.org commit 378be384e01f13fc44d0adc70873de525586ad74 Author: Arnd Bergmann Date: Mon May 22 21:50:18 2023 +0200 sched: Add schedule_user() declaration The schedule_user() function is used on powerpc and sparc architectures, but only ever called from assembler, so it has no prototype, causing a harmless W=1 warning: kernel/sched/core.c:6730:35: error: no previous prototype for 'schedule_user' [-Werror=missing-prototypes] Add a prototype in sched/sched.h to shut up the warning. Signed-off-by: Arnd Bergmann Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20230522195021.3456768-3-arnd@kernel.org commit d55ebae3f3122b07689cc4c34043114e09ce904c Author: Arnd Bergmann Date: Mon May 22 21:50:17 2023 +0200 sched: Hide unused sched_update_scaling() This function is only used when CONFIG_SMP is enabled, without that there is no caller and no prototype: kernel/sched/fair.c:688:5: error: no previous prototype for 'sched_update_scaling' [-Werror=missing-prototypes Hide the definition in the same #ifdef check as the declaration. Fixes: 8a99b6833c88 ("sched: Move SCHED_DEBUG sysctl to debugfs") Signed-off-by: Arnd Bergmann Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20230522195021.3456768-2-arnd@kernel.org commit 29cd55fe69e37722c797504cffeb9f9e13df1faf Author: Xiu Jianfeng Date: Mon May 29 21:00:18 2023 +0800 selinux: cleanup exit_sel_fs() declaration exit_sel_fs() has been removed since commit f22f9aaf6c3d ("selinux: remove the runtime disable functionality"). Signed-off-by: Xiu Jianfeng Signed-off-by: Paul Moore commit d388f06aced3b9fe2fb167f48ceedf75ea7629f8 Author: James Clark Date: Tue May 9 10:49:38 2023 +0100 devres: Provide krealloc_array There is no krealloc_array equivalent in devres. Users would have to do their own multiplication overflow check so provide one. Reviewed-by: Jonathan Cameron Signed-off-by: James Clark Link: https://lore.kernel.org/r/20230509094942.396150-2-james.clark@arm.com Signed-off-by: Greg Kroah-Hartman commit 9e6aa7c22d0777da16cec0d056382c9bd181aa78 Author: James Clark Date: Tue May 9 10:49:41 2023 +0100 serial: qcom_geni: Comment use of devm_krealloc rather than devm_krealloc_array Now that devm_krealloc_array is available, add a comment justifying not changing this occurrence to avoid any future auto fixups. Link: https://lore.kernel.org/all/20230318173402.20a4f60d@jic23-huawei/ Reviewed-by: Jonathan Cameron Signed-off-by: James Clark Link: https://lore.kernel.org/r/20230509094942.396150-5-james.clark@arm.com Signed-off-by: Greg Kroah-Hartman commit 7c054b2cbac388a86ed6a85b831c044a0325e150 Author: James Clark Date: Tue May 9 10:49:40 2023 +0100 iio: adc: Use devm_krealloc_array Now that it exists, use it instead of doing the multiplication and checking for overflow manually. Reviewed-by: Jonathan Cameron Signed-off-by: James Clark Link: https://lore.kernel.org/r/20230509094942.396150-4-james.clark@arm.com Signed-off-by: Greg Kroah-Hartman commit c5f7548445b6adc48c9076073a6f20b8806e9a87 Author: James Clark Date: Tue May 9 10:49:39 2023 +0100 hwmon: pmbus: Use devm_krealloc_array Now that it exists, use it instead of doing the multiplication manually. Acked-by: Guenter Roeck Reviewed-by: Jonathan Cameron Signed-off-by: James Clark Link: https://lore.kernel.org/r/20230509094942.396150-3-james.clark@arm.com Signed-off-by: Greg Kroah-Hartman commit b48aa6a3577cccd13ea21392540f6cde437dd04d Merge: f2d4aa7e97eb6 60413129ee2b3 Author: Mark Brown Date: Tue May 30 20:41:29 2023 +0100 ES8316 audio codec fixes on Rock5B Merge series from Cristian Ciocaltea : This patch series handles a few issues related to the ES8316 audio codec, discovered while doing some testing on the Rock 5B board. commit 7dcdad6f32c96af6e6fb2afe83ec4028dbe1da44 Author: Johan Hovold Date: Tue May 23 11:52:48 2023 +0200 interconnect: drop unused icc_get() interface The icc_get() interface can be used to lookup an interconnect path based on global node ids. There has never been any users of this interface and all lookups are currently done from the devicetree. Remove the unused icc_get() interface. Reviewed-by: Konrad Dybcio Signed-off-by: Johan Hovold Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230523095248.25211-1-johan+linaro@kernel.org Signed-off-by: Georgi Djakov commit 2997d94b5dd0e8b10076f5e0b6f18410c73e28bd Author: Shawn Wang Date: Mon May 15 14:04:48 2023 +0800 x86/resctrl: Only show tasks' pid in current pid namespace When writing a task id to the "tasks" file in an rdtgroup, rdtgroup_tasks_write() treats the pid as a number in the current pid namespace. But when reading the "tasks" file, rdtgroup_tasks_show() shows the list of global pids from the init namespace, which is confusing and incorrect. To be more robust, let the "tasks" file only show pids in the current pid namespace. Fixes: e02737d5b826 ("x86/intel_rdt: Add tasks files") Signed-off-by: Shawn Wang Signed-off-by: Borislav Petkov (AMD) Acked-by: Reinette Chatre Acked-by: Fenghua Yu Tested-by: Reinette Chatre Link: https://lore.kernel.org/all/20230116071246.97717-1-shawnwang@linux.alibaba.com/ commit 55c33e5ee6d3dff13125bdd32b7fa98260680a31 Author: Douglas Anderson Date: Tue May 30 11:13:48 2023 -0700 spi: spi-qcom-qspi: Add newline to PIO fallback warning A warning added in commit b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") was missing a newline. Add it. Reported-by: Stephen Boyd Closes: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4573857/comment/44331d65_79128099/ Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20230530111348.1.Ibd1f4827e18a26dc802cd6e5ac300d83dc1bc41c@changeid Signed-off-by: Mark Brown commit 60413129ee2b38a80347489270af7f6e1c1de4d0 Author: Cristian Ciocaltea Date: Tue May 30 21:11:39 2023 +0300 ASoC: es8316: Do not set rate constraints for unsupported MCLKs When using the codec through the generic audio graph card, there are at least two calls of es8316_set_dai_sysclk(), with the effect of limiting the allowed sample rates according to the MCLK/LRCK ratios supported by the codec: 1. During audio card setup, to set the initial MCLK - see asoc_simple_init_dai(). 2. Before opening a stream, to update MCLK, according to the stream sample rate and the multiplication factor - see asoc_simple_hw_params(). In some cases the initial MCLK might be set to a frequency that doesn't match any of the supported ratios, e.g. 12287999 instead of 12288000, which is only 1 Hz below the supported clock, as that is what the hardware reports. This creates an empty list of rate constraints, which is further passed to snd_pcm_hw_constraint_list() via es8316_pcm_startup(), and causes the following error on the very first access of the sound card: $ speaker-test -D hw:Analog,0 -F S16_LE -c 2 -t wav Broken configuration for playback: no configurations available: Invalid argument Setting of hwparams failed: Invalid argument Note that all subsequent retries succeed thanks to the updated MCLK set at point 2 above, which uses a computed frequency value instead of a reading from the hardware registers. Normally this would have mitigated the issue, but es8316_pcm_startup() executes before the 2nd call to es8316_set_dai_sysclk(), hence it cannot make use of the updated constraints. Since es8316_pcm_hw_params() performs anyway a final validation of MCLK against the stream sample rate and the supported MCLK/LRCK ratios, fix the issue by ensuring that sysclk_constraints list is only set when at least one supported sample rate is autodetected by the codec. Fixes: b8b88b70875a ("ASoC: add es8316 codec driver") Signed-off-by: Cristian Ciocaltea Link: https://lore.kernel.org/r/20230530181140.483936-3-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 6f073429037cd79d7311cd8236311c53f5ea8f01 Author: Cristian Ciocaltea Date: Tue May 30 21:11:38 2023 +0300 ASoC: es8316: Increment max value for ALC Capture Target Volume control The following error occurs when trying to restore a previously saved ALSA mixer state (tested on a Rock 5B board): $ alsactl --no-ucm -f /tmp/asound.state store hw:Analog $ alsactl --no-ucm -I -f /tmp/asound.state restore hw:Analog alsactl: set_control:1475: Cannot write control '2:0:0:ALC Capture Target Volume:0' : Invalid argument According to ES8316 datasheet, the register at address 0x2B, which is related to the above mixer control, contains by default the value 0xB0. Considering the corresponding ALC target bits (ALCLVL) are 7:4, the control is initialized with 11, which is one step above the maximum value allowed by the driver: ALCLVL | dB gain -------+-------- 0000 | -16.5 0001 | -15.0 0010 | -13.5 .... | ..... 0111 | -6.0 1000 | -4.5 1001 | -3.0 1010 | -1.5 .... | ..... 1111 | -1.5 The tests performed using the VU meter feature (--vumeter=TYPE) of arecord/aplay confirm the specs are correct and there is no measured gain if the 1011-1111 range would have been mapped to 0 dB: dB gain | VU meter % --------+----------- -6.0 | 30-31 -4.5 | 35-36 -3.0 | 42-43 -1.5 | 50-51 0.0 | 50-51 Increment the max value allowed for ALC Capture Target Volume control, so that it matches the hardware default. Additionally, update the related TLV to prevent an artificial extension of the dB gain range. Fixes: b8b88b70875a ("ASoC: add es8316 codec driver") Signed-off-by: Cristian Ciocaltea Link: https://lore.kernel.org/r/20230530181140.483936-2-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 1ad3f701c3999904d0c6cdea299df16c6cd9878d Author: Jonathan Cameron Date: Fri May 26 10:58:22 2023 +0100 cxl/pci: Find and register CXL PMU devices CXL PMU devices can be found from entries in the Register Locator DVSEC. Reviewed-by: Dan Williams Reviewed-by: Dave Jiang Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230526095824.16336-4-Jonathan.Cameron@huawei.com Signed-off-by: Dan Williams commit d717d7f3df18494baafd9595fb4bcb9c380d7389 Author: Jonathan Cameron Date: Fri May 26 10:58:21 2023 +0100 cxl: Add functions to get an instance of / count regblocks of a given type Until the recently release CXL 3.0 specification, there was only ever one instance of any given register block pointed to by the Register Block Locator DVSEC. Now, the specification allows for multiple CXL PMU instances, each with their own register block. To enable this add cxl_find_regblock_instance() that takes an index parameter and use that to implement cxl_count_regblock() and cxl_find_regblock(). Signed-off-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20230526095824.16336-3-Jonathan.Cameron@huawei.com Signed-off-by: Dan Williams commit 143f83e2003a4c3ca0c2558254129569048e0759 Author: Jonathan Cameron Date: Fri May 26 10:58:20 2023 +0100 perf: Allow a PMU to have a parent Some PMUs have well defined parents such as PCI devices. As the device_initialize() and device_add() are all within pmu_dev_alloc() which is called from perf_pmu_register() there is no opportunity to set the parent from within a driver. Add a struct device *parent field to struct pmu and use that to set the parent. Reviewed-by: Dan Williams Reviewed-by: Greg Kroah-Hartman Acked-by: Peter Zijlstra (Intel) Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230526095824.16336-2-Jonathan.Cameron@huawei.com Signed-off-by: Dan Williams commit c4fb6880edc15866a530c7b8f2698ae65f80cfab Author: Krzysztof Kozlowski Date: Tue May 30 16:48:49 2023 +0200 spi: dt-bindings: restrict node name suffixes Make the pattern matching node names a bit stricter to improve DTS consistency. The pattern is restricted to: 1. Only one unit address or one -N suffix, 2. -N suffixes to decimal numbers. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230530144851.92059-6-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit fdc523137457d3547900e3dfbe5fcdd49675f6ba Merge: fe73245592fef 0c331fd1dccfb Author: Mark Brown Date: Tue May 30 18:38:18 2023 +0100 spi: Merge up fixes to help CI Get the fixes into CI for development. commit 2e246bca986598bdc9d7cae64cf0995257328a5d Merge: bc638eabfed90 4b5ed2b5a1455 Author: Jakub Kicinski Date: Tue May 30 10:32:22 2023 -0700 Merge branch 'devlink-move-port-ops-into-separate-structure' Jiri Pirko says: ==================== devlink: move port ops into separate structure In devlink, some of the objects have separate ops registered alongside with the object itself. Port however have ops in devlink_ops structure. For drivers what register multiple kinds of ports with different ops this is not convenient. This patchset changes does following changes: 1) Introduces devlink_port_ops with functions that allow devlink port to be registered passing a pointer to driver port ops. (patch #1) 2) Converts drivers to define port_ops and register ports passing the ops pointer. (patches #2, #3, #4, #6, #8, and #9) 3) Moves ops from devlink_ops struct to devlink_port_ops. (patches #5, #7, #10-15) No functional changes. ==================== Link: https://lore.kernel.org/r/20230526102841.2226553-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 4b5ed2b5a145543bd901b97f33bcac55a574253b Author: Jiri Pirko Date: Fri May 26 12:28:41 2023 +0200 devlink: save devlink_port_ops into a variable in devlink_port_function_validate() Now when the original ops variable is removed, introduce it again but this time for devlink_port_ops. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 216ba9f4adc8f2e452edb9a58d2dfbfc11608c00 Author: Jiri Pirko Date: Fri May 26 12:28:40 2023 +0200 devlink: move port_del() to devlink_port_ops Move port_del() from devlink_ops into newly introduced devlink_port_ops. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 216aa67f3e981a0cfb0a7c3b0d4c107823ef6c56 Author: Jiri Pirko Date: Fri May 26 12:28:39 2023 +0200 devlink: move port_fn_state_get/set() to devlink_port_ops Move port_fn_state_get/set() from devlink_ops into newly introduced devlink_port_ops. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 4a490d7154b3d84c7e451502306a53b6607b6566 Author: Jiri Pirko Date: Fri May 26 12:28:38 2023 +0200 devlink: move port_fn_migratable_get/set() to devlink_port_ops Move port_fn_migratable_get/set() from devlink_ops into newly introduced devlink_port_ops. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 933c13275c4933ad68f107ed93ae9b0658b19ad0 Author: Jiri Pirko Date: Fri May 26 12:28:37 2023 +0200 devlink: move port_fn_roce_get/set() to devlink_port_ops Move port_fn_roce_get/set() from devlink_ops into newly introduced devlink_port_ops. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 71c93e37cf3d0528e5d17ecc0b1b07db2086db67 Author: Jiri Pirko Date: Fri May 26 12:28:36 2023 +0200 devlink: move port_fn_hw_addr_get/set() to devlink_port_ops Move port_fn_hw_addr_get/set() from devlink_ops into newly introduced devlink_port_ops. Signed-off-by: Jiri Pirko Acked-by: Martin Habets Signed-off-by: Jakub Kicinski commit aa3aff8264f2a6b463a24a5453aff7afa3483425 Author: Jiri Pirko Date: Fri May 26 12:28:35 2023 +0200 mlx5: register devlink ports with ops Use newly introduce devlink port registration function variant and register devlink port passing ops. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 7bfb3d0a83b66567ccf2b19110bbb787c56089aa Author: Jiri Pirko Date: Fri May 26 12:28:34 2023 +0200 sfc: register devlink port with ops Use newly introduce devlink port registration function variant and register devlink port passing ops. Signed-off-by: Jiri Pirko Acked-by: Martin Habets Signed-off-by: Jakub Kicinski commit 65a4c44bf9375a5d13287ee1e389b512e83f37eb Author: Jiri Pirko Date: Fri May 26 12:28:33 2023 +0200 devlink: move port_type_set() op into devlink_port_ops Move port_type_set() from devlink_ops into newly introduced devlink_port_ops. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 8a756d91d26c1fe941d6839b41d385a4f84ac453 Author: Jiri Pirko Date: Fri May 26 12:28:32 2023 +0200 mlx4: register devlink port with ops Use newly introduce devlink port registration function variant and register devlink port passing ops. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit f58a3e4dfe241393ce383363583190903f140da5 Author: Jiri Pirko Date: Fri May 26 12:28:31 2023 +0200 devlink: move port_split/unsplit() ops into devlink_port_ops Move port_split/unsplit() from devlink_ops into newly introduced devlink_port_ops. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit ab8ccc6c134779a26af3e613578f5b2ac820a649 Author: Jiri Pirko Date: Fri May 26 12:28:30 2023 +0200 nfp: devlink: register devlink port with ops Use newly introduce devlink port registration function variant and register devlink port passing ops. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 865a1a1b97b6779f1e775b075dd534a43de64cfd Author: Jiri Pirko Date: Fri May 26 12:28:29 2023 +0200 mlxsw_core: register devlink port with ops Use newly introduce devlink port registration function variant and register devlink port passing ops. Signed-off-by: Jiri Pirko Reviewed-by: Petr Machata Tested-by: Petr Machata Signed-off-by: Jakub Kicinski commit b2857685372bb0ac5c8b2d5079cd8126aeef1e6b Author: Jiri Pirko Date: Fri May 26 12:28:28 2023 +0200 ice: register devlink port for PF with ops Use newly introduce devlink port registration function variant and register devlink port passing ops. Signed-off-by: Jiri Pirko Reviewed-by: Jesse Brandeburg Reviewed-by: Michal Wilczynski Signed-off-by: Jakub Kicinski commit 6acdf43d8abe32082356d56a07598e513bbb59f4 Author: Jiri Pirko Date: Fri May 26 12:28:27 2023 +0200 devlink: introduce port ops placeholder In devlink, some of the objects have separate ops registered alongside with the object itself. Port however have ops in devlink_ops structure. For drivers what register multiple kinds of ports with different ops this is not convenient. Introduce devlink_port_ops and a set of functions that allow drivers to pass ops pointer during port registration. Signed-off-by: Jiri Pirko Signed-off-by: Jakub Kicinski commit 20dea72a393c6d5572088b8ad01dbb9e9aca64ce Author: Bjorn Andersson Date: Tue May 30 21:54:54 2023 +0530 arm64: dts: qcom: sc8180x: Introduce Lenovo Flex 5G Introduce support for the Lenovo Flex 5G laptop, built on the Qualcomm SC8180X platform. Supported peripherals includes keyboard, touchpad, UFS storage, external USB and WiFi. Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530162454.51708-16-vkoul@kernel.org commit 2ce38cc1e8fea4e251e4563e436104369bf3b322 Author: Bjorn Andersson Date: Tue May 30 21:54:53 2023 +0530 arm64: dts: qcom: sc8180x: Introduce Primus Introduce support for the SC8180X reference device, aka Primus, with debug UART, regulators, UFS and USB support. Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530162454.51708-15-vkoul@kernel.org commit d3302290f59e8533a56a8fa2455357f843d8dcf6 Author: Vinod Koul Date: Tue May 30 21:54:52 2023 +0530 arm64: dts: qcom: sc8180x: Add pmics SC8180X based platforms have PM8150, PM8150C, PMC8180 and SMB2351 PMICs, so add these as well Co-developed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530162454.51708-14-vkoul@kernel.org commit 494dec9b6f541451b2e82905b0eebd9a4ac9848b Author: Vinod Koul Date: Tue May 30 21:54:51 2023 +0530 arm64: dts: qcom: sc8180x: Add display and gpu nodes This patch adds gpu, gmu, gpucc, dispcc and finally the mdss node with dsi0/1, dp0/1 and edp subnodes as found in this SoC Co-developed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530162454.51708-13-vkoul@kernel.org commit b080f53a8f44eeaa9db9628d8d339ab5a2afb5bd Author: Vinod Koul Date: Tue May 30 21:54:50 2023 +0530 arm64: dts: qcom: sc8180x: Add remoteprocs, wifi and usb nodes This patch adds remoteprocs, wifi and usb and usb phy nodes for this SoC Co-developed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530162454.51708-12-vkoul@kernel.org commit d20b6c84f56ae3a9823cc0fa5cfad330536ba0d1 Author: Vinod Koul Date: Tue May 30 21:54:49 2023 +0530 arm64: dts: qcom: sc8180x: Add PCIe instances This patch adds PCIe instances found on this SoC Co-developed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530162454.51708-11-vkoul@kernel.org commit 0018761d1564f64d567e119fd9156c473b4592d7 Author: Vinod Koul Date: Tue May 30 21:54:48 2023 +0530 arm64: dts: qcom: sc8180x: Add QUPs This patch adds qup instances and i2c, spi, serial ports Co-developed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530162454.51708-10-vkoul@kernel.org commit d1d3ca03554e51be44546638f83169bb05b20ef8 Author: Vinod Koul Date: Tue May 30 21:54:47 2023 +0530 arm64: dts: qcom: sc8180x: Add thermal zones This patch adds tsens nodes and thermal zones for sc8180x SoC Co-developed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530162454.51708-9-vkoul@kernel.org commit f3be8a111d7eaf4e291b6c2d51dd0adb39934b32 Author: Vinod Koul Date: Tue May 30 21:54:46 2023 +0530 arm64: dts: qcom: sc8180x: Add interconnects and lmh This add interconnect nodes and add LMH to sc8180x SoC dtsi Co-developed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530162454.51708-8-vkoul@kernel.org commit 8575f197b077001591ef3ff709cdee48785daf0d Author: Bjorn Andersson Date: Tue May 30 21:54:45 2023 +0530 arm64: dts: qcom: Introduce the SC8180x platform Introduce a base dtsi for the Qualcomm SC8180x platform, with CPUs, global clock controller, SMMU, rpmh clocks, rpmh power-domains, CPUfreq etc Signed-off-by: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230530162454.51708-7-vkoul@kernel.org commit a378f6a40fac4a2f1812adea7017613d2bd5dab6 Author: Thomas Weißschuh Date: Tue May 30 19:10:00 2023 +0200 block: constify the whole_disk device_attribute The struct is never modified so it can be const. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20230419-const-partition-v3-4-4e14e48be367@weissschuh.net Signed-off-by: Jens Axboe commit 0bd478005cfc7f50ccb769744d952e9687ee75b4 Author: Thomas Weißschuh Date: Tue May 30 19:09:59 2023 +0200 block: constify struct part_attr_group The struct is never modified so it can be const. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20230419-const-partition-v3-3-4e14e48be367@weissschuh.net Signed-off-by: Jens Axboe commit cdb37f73cf05631c4f7401f2cd99878733c0c3d9 Author: Thomas Weißschuh Date: Tue May 30 19:09:58 2023 +0200 block: constify struct part_type part_type The struct is never modified so it can be const. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20230419-const-partition-v3-2-4e14e48be367@weissschuh.net Signed-off-by: Jens Axboe commit 539050f92ea7666bca17c2c380d8071d2f93dcde Author: Thomas Weißschuh Date: Tue May 30 19:09:57 2023 +0200 block: constify partition prober array The array is never modified so it can be const. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202304191640.SkNk7kVN-lkp@intel.com/ Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20230419-const-partition-v3-1-4e14e48be367@weissschuh.net Signed-off-by: Jens Axboe commit fe73245592fef75a7c41180a3fbb07c9a75f622e Merge: 0bbb363f86f22 b229a7f530ebe Author: Mark Brown Date: Tue May 30 17:43:31 2023 +0100 spi: add SPI_MOSI_IDLE_LOW mode bit Merge series from Boerge Struempfel : Some spi controller switch the mosi line to high, whenever they are idle. This may not be desired in all use cases. For example neopixel leds can get confused and flicker due to misinterpreting the idle state. Therefore, we introduce a new spi-mode bit, with which the idle behaviour can be overwritten on a per device basis. commit 0bbb363f86f2215571741bc945f6b9ec132ea1b8 Merge: 0178f1e5d9845 6f089e986778d Author: Mark Brown Date: Tue May 30 17:43:24 2023 +0100 spi: mt65xx: Convert to platform remove callback Merge series from Uwe Kleine-König : Hello, compared to (implicit) v1 sent in March with Message-Id: <20230309094704.2568531-1-u.kleine-koenig@pengutronix.de>, I reworked patch 1 on feedback by AngeloGioacchino Del Regno. Patches 2 and 3 got his Reviewed-by. Best regards Uwe Uwe Kleine-König (3): spi: mt65xx: Properly handle failures in .remove() spi: mt65xx: Convert to platform remove callback returning void spi: mt65xx: Don't disguise a "return 0" as "return ret" drivers/spi/spi-mt65xx.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) base-commit: ac9a78681b921877518763ba0e89202254349d1b -- 2.39.2 commit f2d4aa7e97eb60f426b92b95da712a6b3c18dc9a Merge: b07693bfb5498 0f7b6a4330978 Author: Mark Brown Date: Tue May 30 17:43:11 2023 +0100 ASoC: topology: allow for partial dailink stream_name Merge series from Pierre-Louis Bossart : The topology file and the machine driver rely on common definitions for the dailink stream_name. To avoid any backwards-compatibility problems, the machine driver stream names are set in stone and cannot be modified. This is problematic when we try to name some of the topology widgets after the stream_name, since the widget name is limited to 44 characters tools/include/uapi/sound/asound.h:#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44 Existing examples include "Analog Playback and Capture" for HDaudio dailinks, which leaves less than 20 chars to identify widgets/controls with a meaningful name. Since the 44-char limit is part of the UAPI definitions, we assumed there is no way to increase it. This patchset suggests instead a partial match which allows topology files to use a shorter stream_name, which in turn allows for self-explanatory widget names that comply with the 44-char limit. This should not break any existing setup but with the introduction of a partial match new dailinks should be named carefully to avoid confusions between e.g. 'link1' and 'link10'. The last patch fixes such an issue in the 'nocodec' test topology used by Intel. commit b07693bfb5498196791fb605b00257cb6405f716 Merge: c3079282fdf72 0f3d5585ad20a Author: Mark Brown Date: Tue May 30 17:43:05 2023 +0100 ASoC: SOF: add mt8188 audio support Merge series from Trevor Wu : This adds mt8188 audio support. commit 1eac0f956608e5bfb5a588ac2a7e98a8e1928e75 Author: Dmitry Baryshkov Date: Sun May 21 22:52:00 2023 +0300 dt-bindings: phy: qcom,qmp-usb: fix bindings error Merge two allOf clauses, which sneaked in in two different patches. Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml:109:1: found duplicate key "allOf" with value "[]" (original value: "[]") Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml:109:1: [error] duplication of key "allOf" in mapping (key-duplicates) Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml:109:1: found duplicate key "allOf" with value "[]" (original value: "[]") Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml: ignoring, error parsing file Fixes: 2daece5eb51e ("dt-bindings: phy: qcom,qmp-usb: Drop legacy bindings and move to newer one (SM6115 & QCM2290)") Signed-off-by: Dmitry Baryshkov Reviewed-by: Conor Dooley Reviewed-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20230521195200.11967-1-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit b53d4a27234955810362f91be679afc12e4c3237 Author: Mostafa Saleh Date: Tue May 30 15:08:45 2023 +0000 KVM: arm64: Use BTI for nvhe CONFIG_ARM64_BTI_KERNEL compiles the kernel to support ARMv8.5-BTI. However, the nvhe code doesn't make use of it as it doesn't map any pages with Guarded Page(GP) bit. kvm pgtable code is modified to map executable pages with GP bit if BTI is enabled for the kernel. At hyp init, SCTLR_EL2.BT is set to 1 to match EL1 configuration (SCTLR_EL1.BT1) set in bti_enable(). One difference between kernel and nvhe code, is that the kernel maps .text with GP while nvhe maps all the executable pages, this makes nvhe code need to deal with special initialization code coming from other executable sections (.idmap.text). For this we need to add bti instruction at the beginning of __kvm_handle_stub_hvc as it can be called by __host_hvc through branch instruction(br) and unlike SYM_FUNC_START, SYM_CODE_START doesn’t add bti instruction at the beginning, and it can’t be modified to add it as it is used with vector tables. Another solution which is more intrusive is to convert __kvm_handle_stub_hvc to a function and inject “bti jc” instead of “bti c” in SYM_FUNC_START Signed-off-by: Mostafa Saleh Link: https://lore.kernel.org/r/20230530150845.2856828-1-smostafa@google.com Signed-off-by: Oliver Upton commit 84af914404dbc01f388c440cac72428784b8a161 Author: Dmitry Rokosov Date: Tue May 23 16:53:51 2023 +0300 clk: meson: a1: add Amlogic A1 Peripherals clock controller driver Introduce Peripherals clock controller for Amlogic A1 SoC family. A1 SoC has four clock controllers on the board: PLL, Peripherals, CPU, and Audio. This patchset adds support for Amlogic A1 Peripherals clock driver and allows to generate clocks for all A1 SoC peripheral IPs. Signed-off-by: Jian Hu Signed-off-by: Dmitry Rokosov Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230523135351.19133-7-ddrokosov@sberdevices.ru Signed-off-by: Jerome Brunet commit 28f3be518081b2127f98105fa9735a19812a33ca Author: Dmitry Rokosov Date: Tue May 23 16:53:49 2023 +0300 clk: meson: a1: add Amlogic A1 PLL clock controller driver Introduce PLL clock controller for Amlogic A1 SoC family. The clock unit is an APB slave module that is designed for generating all of the internal and system clocks. The SoC uses an external 24MHz crystal; there are 4 internal PLLs: SYS_PLL/HIFI_PLL/USB_PLL/(FIXPLL), these PLLs generate 27 clock sources. Signed-off-by: Jian Hu Signed-off-by: Dmitry Rokosov Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230523135351.19133-5-ddrokosov@sberdevices.ru Signed-off-by: Jerome Brunet commit b6ec400aa153b27e056b2dfc5e830b724c053a04 Author: Dmitry Rokosov Date: Tue May 23 16:53:47 2023 +0300 clk: meson: introduce new pll power-on sequence for A1 SoC family Modern meson PLL IPs are a little bit different from early known PLLs. The main difference is located in the init/enable/disable sequences; the rate logic is the same. In A1 PLL, the PLL enable sequence is different, so add new optional pll reg bits and use the new power-on sequence to enable the PLL: 1. enable the pll, delay for 10us 2. enable the pll self-adaption current module, delay for 40us 3. enable the lock detect module Signed-off-by: Jian Hu Acked-by: Martin Blumenstingl Signed-off-by: Dmitry Rokosov Link: https://lore.kernel.org/r/20230523135351.19133-3-ddrokosov@sberdevices.ru Signed-off-by: Jerome Brunet commit 02f1e17c4106a24fabb27e1419cbcb144b4faa1b Author: Dmitry Rokosov Date: Tue May 23 16:53:46 2023 +0300 clk: meson: make pll rst bit as optional Compared with the previous SoCs, self-adaption current module is newly added for A1, and there is no reset parameter except the fixed pll. Since we use clk-pll generic driver for A1 pll implementation, rst bit should be optional to support new behavior. Signed-off-by: Jian Hu Acked-by: Martin Blumenstingl Signed-off-by: Dmitry Rokosov Link: https://lore.kernel.org/r/20230523135351.19133-2-ddrokosov@sberdevices.ru Signed-off-by: Jerome Brunet commit 98872da6c6b6c78d15ca9231ed99461cbcc5612f Author: Dmitry Rokosov Date: Tue May 23 16:53:50 2023 +0300 dt-bindings: clock: meson: add A1 Peripherals clock controller bindings Add documentation and dt bindings for the Amlogic A1 Peripherals clock controller. A1 PLL clock controller has references to A1 Peripherals clock controller objects, so reflect them in the schema. Signed-off-by: Jian Hu Signed-off-by: Dmitry Rokosov Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230523135351.19133-6-ddrokosov@sberdevices.ru Signed-off-by: Jerome Brunet commit e6c6ddb397e2b1b084996b72a745c7b7b5974f10 Author: Dmitry Rokosov Date: Tue May 23 16:53:48 2023 +0300 dt-bindings: clock: meson: add A1 PLL clock controller bindings Add the documentation and dt bindings for Amlogic A1 PLL clock controller. Also include new A1 clock controller dt bindings to MAINTAINERS. Signed-off-by: Jian Hu Signed-off-by: Dmitry Rokosov Reviewed-by: Rob Herring Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230523135351.19133-4-ddrokosov@sberdevices.ru Signed-off-by: Jerome Brunet commit 9defeb9f0a2a036e58fc4314fcfe64ac286e74f0 Merge: 87fe0214d7aae 08880713ceec0 Author: Mark Brown Date: Tue May 30 16:29:12 2023 +0100 regulator: core: Fix error checking and messages Merge series from Geert Uytterhoeven : This patch series corrects an error check, fixes error messages when debugfs is not enabled, and improves debugfs error handling in the regulator core. commit 422db30713ac84080a8c4b3efa9dd560b654ed57 Author: Ian Rogers Date: Mon May 29 19:14:33 2023 -0700 perf kvm powerpc: Add missing rename opf pmu_have_event() to perf_pmus__have_event() Missed function rename from pmu_have_event to perf_pmus__have_event made the perf build fail on powerpc. Committer notes: The perf_pmus__have_event() is declared in util/pmus.h, so use it instead of by now needless util/pmu.h. Fixes: 1eaf496ed386934f ("perf pmu: Separate pmu and pmus") Reported-by: Stephen Rothwell Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230530021433.3107580-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 925bac3caa46c5790d21ee236869b017090aad2d Author: Dmitry Baryshkov Date: Sun May 7 22:07:35 2023 +0300 ARM: dts: qcom: apq8074-dragonboard: enable DSI panel Enable MDSS, GPU and DSI panel output on the APQ8074 dragonboard. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230507190735.2333145-5-dmitry.baryshkov@linaro.org commit 1ca793c3714a754488c782eb0d68b279d811b977 Author: Dmitry Baryshkov Date: Sun May 7 22:07:34 2023 +0300 ARM: dts: qcom: apq8074-dragonboard: enable adsp and MSS Enable ADSP and Modem DSPs on APQ8074 dragonboard. The MSS region differs from the one defined in the msm8974, so it overriden locally. The modem is specified use mba.mbn instead of mbn.b00 (for the sake of similarity with other platforms). This requires a patch for remoteproc to be applied [1]. [1] https://lore.kernel.org/all/20230507172041.2320279-1-dmitry.baryshkov@linaro.org/ Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230507190735.2333145-4-dmitry.baryshkov@linaro.org commit e60c230588d88036f974cec7e93361e2c4f62226 Author: Dmitry Baryshkov Date: Sun May 7 22:07:33 2023 +0300 ARM: dts: qcom: apq8074-dragonboard: Set DMA as remotely controlled Add the qcom,controlled-remotely property for the blsp2_bam controller node. This board requires this, otherwise the board stalls during the boot for some reason (most probably because TZ mishandles the protection error and keeps on looping somewhere inside). Fixes: 62bc81792223 dts: msm8974: Add blsp2_bam dma node Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230507190735.2333145-3-dmitry.baryshkov@linaro.org commit b41fb001bebff28dd05a7c74e728ce7f024856ac Author: Luca Weiss Date: Sun Apr 30 20:20:57 2023 +0200 ARM: dts: qcom: apq8026-huawei-sturgeon: Add vibrator The watch has a DRV2605 for haptics. Add a node for it based on the values found in the downstream board file. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230430-drv260x-improvements-v1-5-1fb28b4cc698@z3ntu.xyz commit 9cf9832d4f5f7659159a036ccae2e10f6eeadf5d Author: Matti Lehtimäki Date: Sat May 20 15:19:33 2023 +0300 ARM: dts: qcom: msm8226: Add IMEM node This enables userspace to signal the bootloader to go into the bootloader or recovery mode. The magic values can be found in both the downstream kernel and the LK kernel (bootloader). Signed-off-by: Matti Lehtimäki Reviewed-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230520121933.15533-5-matti.lehtimaki@gmail.com commit a22a576af30d4366ff13662c8b57c951374c7674 Author: Matti Lehtimäki Date: Sat May 20 15:19:32 2023 +0300 ARM: dts: qcom: msm8226: Add rpm-stats device node Add device node for the rpm-stats pseudo device. Signed-off-by: Matti Lehtimäki Reviewed-by: Konrad Dybcio Reviewed-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230520121933.15533-4-matti.lehtimaki@gmail.com commit 38cd0f2d86f1dbfef2bef4e2b0a8b19d32a82760 Author: Matti Lehtimäki Date: Sat May 20 15:19:31 2023 +0300 ARM: dts: qcom: msm8226: Add PMU node Enable perf events on MSM8226 devices by adding the PMU node. Signed-off-by: Matti Lehtimäki Reviewed-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230520121933.15533-3-matti.lehtimaki@gmail.com commit fd817375091b35c4368244a9872158eb719534b0 Author: Rohit Agarwal Date: Thu May 18 23:17:53 2023 +0530 ARM: dts: qcom: sdx65-mtp: Enable PCIe EP Enable PCIe Endpoint controller on the SDX65 MTP board based on Qualcomm SDX65 platform. Signed-off-by: Rohit Agarwal Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1684432073-28490-6-git-send-email-quic_rohiagar@quicinc.com commit 2e69f6882b69ea98e785469481bf9a4d111e3b96 Author: Rohit Agarwal Date: Thu May 18 23:17:52 2023 +0530 ARM: dts: qcom: sdx65-mtp: Enable PCIe PHY Enable PCIe PHY on SDX65 MTP for PCIe EP. Signed-off-by: Rohit Agarwal Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1684432073-28490-5-git-send-email-quic_rohiagar@quicinc.com commit 9c0bb38414a45a03d1100f033ab6f96bedffe43a Author: Rohit Agarwal Date: Thu May 18 23:17:51 2023 +0530 ARM: dts: qcom: sdx65: Add support for PCIe EP Add support for PCIe Endpoint controller on the Qualcomm SDX65 platform. Signed-off-by: Rohit Agarwal Reviewed-by: Manivannan Sadhasivam Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1684432073-28490-4-git-send-email-quic_rohiagar@quicinc.com commit 57b60d03d5a682d366a4850b1f69c53fc13beb22 Author: Rohit Agarwal Date: Thu May 18 23:17:50 2023 +0530 ARM: dts: qcom: sdx65: Add support for PCIe PHY Add devicetree support for PCIe PHY used in SDX65 platform. This PHY is used by the PCIe EP controller. Signed-off-by: Rohit Agarwal Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1684432073-28490-3-git-send-email-quic_rohiagar@quicinc.com commit d2f1bd8f0b91ce77951d983a094c157b2efd789c Author: Krzysztof Kozlowski Date: Fri Apr 21 21:54:37 2023 +0200 ARM: dts: qcom: msm8974: align WCNSS Bluetooth node name with bindings Bindings expect WCNSS Bluetooth child to be named "bluetooth": remoteproc@fb204000: smd-edge:wcnss: 'bt' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230421195437.31513-1-krzysztof.kozlowski@linaro.org commit 05e916f1db2fff88f316b6f94929b4b3b8414498 Author: Krzysztof Kozlowski Date: Thu Apr 20 09:50:53 2023 +0200 ARM: dts: qcom: apq8084: correct thermal sensor unit-address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc/thermal-sensor@fc4a8000: simple-bus unit address format error, expected "fc4a9000" Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420075053.41976-10-krzysztof.kozlowski@linaro.org commit 26fe8ec355328c35e2768cb9758341c0256dc953 Author: Krzysztof Kozlowski Date: Thu Apr 20 09:50:52 2023 +0200 ARM: dts: qcom: msm8960-cdp: move regulator out of simple-bus Regulators is not a bus, so drop incomplete simple-bus usage to fix dtbs W=1 warning: Warning (simple_bus_reg): /regulators/gpio-regulator: missing or empty reg/ranges property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420075053.41976-9-krzysztof.kozlowski@linaro.org commit 600efc01c98d3369d1fc5caee531159c43bc3939 Author: Krzysztof Kozlowski Date: Thu Apr 20 09:50:51 2023 +0200 ARM: dts: qcom: apq8060-dragonboard: move regulators out of simple-bus Regulators is not a bus, so drop incomplete simple-bus usage to fix dtbs W=1 warnings: Warning (simple_bus_reg): /regulators/regulator-fixed: missing or empty reg/ranges property Warning (simple_bus_reg): /regulators/xc622a331mrg: missing or empty reg/ranges property Warning (simple_bus_reg): /regulators/nds332p: missing or empty reg/ranges property Warning (simple_bus_reg): /regulators/txb0104rgyr: missing or empty reg/ranges property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420075053.41976-8-krzysztof.kozlowski@linaro.org commit 8b96065dd257f74ed03645978d2e076894d864b2 Author: Krzysztof Kozlowski Date: Thu Apr 20 09:50:50 2023 +0200 ARM: dts: qcom: ipq8064: align USB node names with bindings Bindings expect USB controller node names to be named "usb". Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420075053.41976-7-krzysztof.kozlowski@linaro.org commit 51500b3aac5d2fc102d607c3517f7a1ee2f29dca Author: Krzysztof Kozlowski Date: Thu Apr 20 09:50:49 2023 +0200 ARM: dts: qcom: ipq8064: correct LED node names GPIO LEDs is not a bus, so drop unit-address and also start suffix numbering from 0: Warning (unit_address_vs_reg): /soc/leds/led@7: node has a unit name, but no reg or ranges property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420075053.41976-6-krzysztof.kozlowski@linaro.org commit 24643b229c3d93cc4c7368e00dad89d300dd5e8a Author: Krzysztof Kozlowski Date: Thu Apr 20 09:50:48 2023 +0200 ARM: dts: qcom: ipq8064: drop invalid GCC thermal-sensor unit-address GCC comes with syscon compatible so the thermal-sensor child node should not have unit-address (bindings also do not expect it): Warning (unit_address_vs_reg): /soc/clock-controller@900000/thermal-sensor@900000: node has a unit name, but no reg or ranges property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420075053.41976-5-krzysztof.kozlowski@linaro.org commit 1c7d01ba0f36ad7f7c5f6f7fd7b69375d97350e7 Author: Krzysztof Kozlowski Date: Thu Apr 20 09:50:47 2023 +0200 ARM: dts: qcom: ipq8064: drop leading 0 from unit-address Unit-address should not start with 0: Warning (simple_bus_reg): /soc/syscon@03000000: simple-bus unit address format error, expected "3000000" Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420075053.41976-4-krzysztof.kozlowski@linaro.org commit dcbd24008bfa9b2fc63ea34092b036f3f76b35db Author: Krzysztof Kozlowski Date: Thu Apr 20 09:50:46 2023 +0200 ARM: dts: qcom: msm8974: correct pronto unit-address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc/remoteproc@fb21b000: simple-bus unit address format error, expected "fb204000" Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420075053.41976-3-krzysztof.kozlowski@linaro.org commit fd9936dfe45765bd74c8100b8e228675482cd3ca Author: Krzysztof Kozlowski Date: Thu Apr 20 09:50:45 2023 +0200 ARM: dts: qcom: sdx55: correct rsc unit-address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc/rsc@17840000: simple-bus unit address format error, expected "17830000" Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420075053.41976-2-krzysztof.kozlowski@linaro.org commit e054c9c38f439613a2c4dd81db46909ba532b1b9 Author: Krzysztof Kozlowski Date: Thu Apr 20 09:50:44 2023 +0200 ARM: dts: qcom: ipq4019: correct syscon unit-address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc/syscon@1fcb000: simple-bus unit address format error, expected "1fc0000" Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420075053.41976-1-krzysztof.kozlowski@linaro.org commit edcbdd57de499305e2a3737d4a73fe387f71d84c Author: Krzysztof Kozlowski Date: Thu Apr 20 09:28:11 2023 +0200 ARM: dts: qcom: ipq4019: fix broken NAND controller properties override After renaming NAND controller node name from "qpic-nand" to "nand-controller", the board DTS/DTSI also have to be updated: Warning (unit_address_vs_reg): /soc/qpic-nand@79b0000: node has a unit name, but no reg or ranges property Cc: Fixes: 9e1e00f18afc ("ARM: dts: qcom: Fix node name for NAND controller node") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420072811.36947-1-krzysztof.kozlowski@linaro.org commit 392a1aab14542a9e393f89c985679cf3ac161156 Author: Krzysztof Kozlowski Date: Thu Apr 20 08:53:18 2023 +0200 ARM: dts: qcom: msm8974: drop unit addresses from USB phys The ulpi node does not allow children to have unit address: Warning (unit_address_vs_reg): /soc/usb@f9a55000/ulpi/phy@a: node has a unit name, but no reg or ranges property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420065318.23503-1-krzysztof.kozlowski@linaro.org commit a0f19091d4f5bbe97485592257b88007eb5b1998 Author: Linus Walleij Date: Fri Apr 14 15:57:47 2023 +0200 ARM: dts: qcom: msm8660: Fix regulator node names commit 04715461abf7 altered the node names in a DTSI file used by qcom-apq8060-dragonboard.dts breaking the board. Align the node names in the DTS file and the board boots again. Cc: stable@vger.kernel.org Fixes: 85055a1eecc1 ("ARM: dts: qcom-msm8660: align RPM regulators node name with bindings") Signed-off-by: Linus Walleij Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230414135747.34994-1-linus.walleij@linaro.org commit 922c0cb578ac9104a22c11a093cc1e0575c35a39 Author: Uwe Kleine-König Date: Tue May 30 09:19:13 2023 +0200 usb: typec: qcom-pmic-typec: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: Konrad Dybcio Acked-by: Bryan O'Donoghue Acked-by: Heikki Krogerus Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230530071913.2192214-7-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 40f7b7f65a0584821a8fa4abb1c64fb2ba79aebf Author: Uwe Kleine-König Date: Tue May 30 09:19:12 2023 +0200 usb: xhci-tegra: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230530071913.2192214-6-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit bcfe934e2efb8d7075911233ae00f82f3e025533 Author: Uwe Kleine-König Date: Tue May 30 09:19:11 2023 +0200 usb: xhci-plat: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). To convert the xhci-plat driver, change the prototype of xhci_plat_remove() to return void. As this function is exported and used by the xhci-rcar driver, convert this driver at the same time accordingly. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230530071913.2192214-5-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit d89dfff5eaebc888d9acc6ff1021a33a99d43136 Author: Uwe Kleine-König Date: Tue May 30 09:19:10 2023 +0200 usb: xhci-mtk: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230530071913.2192214-4-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 3a8d85c43d594e40cc31bb2b68b6987c4b8ef168 Author: Uwe Kleine-König Date: Tue May 30 09:19:09 2023 +0200 usb: xhci-histb: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230530071913.2192214-3-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit b519f44b7807c1e2a2a2f860f2125a88eb10c3e3 Author: Uwe Kleine-König Date: Tue May 30 09:19:08 2023 +0200 usb: dwc2/platform: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Acked-by: Minas Harutyunyan Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230530071913.2192214-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 56dcc717ecf5bc2ff2f686346ceb72da0e706203 Author: Uwe Kleine-König Date: Tue May 30 09:36:33 2023 +0200 usb: misc: onboard_hub: Don't warn twice about problems during remove If onboard_hub_power_off() called by onboard_hub_remove() fails it emits an error message. Forwarding the returned error value to the driver core results in another error message. As the return value is otherwise ignored, just drop the return value. There is no side effect apart from suppressing the core's warning. Instead of returning zero unconditionally, convert to .remove_new() which has the same semantics as .remove() that unconditionally returns zero. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230530073633.2193618-1-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit b229a7f530ebea90c8e21b56872f3102e3d54461 Author: Boerge Struempfel Date: Tue May 30 16:16:41 2023 +0200 spi: spidev_test Add three missing spi mode bits Added the three missing spi mode bits SPI_3WIRE_HIZ, SPI_RX_CPHA_FLIP, and SPI_MOSI_IDLE_LOW. Signed-off-by: Boerge Struempfel Link: https://lore.kernel.org/r/20230530141641.1155691-6-boerge.struempfel@gmail.com Signed-off-by: Mark Brown commit 113f36f2dce3a5a1aacbfa700c44080ec37ee3a0 Author: Boerge Struempfel Date: Tue May 30 16:16:40 2023 +0200 spi: spidev_test: Sorted the options into logical groups In order to increase usability, the command line options are sorted into logical groups. In addition, the usage string was sorted alphabetically, and the missing parameters '8','i' and 'o' were added. Furthermore, the option descriptions were moved further to the right, in order to allow for longer option names. Signed-off-by: Boerge Struempfel Link: https://lore.kernel.org/r/20230530141641.1155691-5-boerge.struempfel@gmail.com Signed-off-by: Mark Brown commit 5cc223ca4858ec40bd2b8522ebc51c0d4963e51f Author: Boerge Struempfel Date: Tue May 30 16:16:39 2023 +0200 spi: spidev: add two new spi mode bits Allow userspace to set SPI_MOSI_IDLE_LOW and the SPI_3WIRE_HIZ mode bit using the SPI_IOC_WR_MODE32 ioctl. Signed-off-by: Boerge Struempfel Link: https://lore.kernel.org/r/20230530141641.1155691-4-boerge.struempfel@gmail.com Signed-off-by: Mark Brown commit 6a983ff5102ff0d859df05ca3f5cf2f6a17c0fad Author: Boerge Struempfel Date: Tue May 30 16:16:38 2023 +0200 spi: spi-imx: add support for SPI_MOSI_IDLE_LOW mode bit By default, the spi-imx controller pulls the mosi line high, whenever it is idle. This behaviour can be inverted per CS by setting the corresponding DATA_CTL bit in the config register of the controller. Also, since the controller mode-bits have to be touched anyways, the SPI_CPOL and SPI_CPHA are replaced by the combined SPI_MODE_X_MASK flag. Signed-off-by: Boerge Struempfel Link: https://lore.kernel.org/r/20230530141641.1155691-3-boerge.struempfel@gmail.com Signed-off-by: Mark Brown commit a45baa079e2a6b7a5516354c6ff08702232384f5 Author: Boerge Struempfel Date: Tue May 30 16:16:37 2023 +0200 spi: add SPI_MOSI_IDLE_LOW mode bit Some spi controller switch the mosi line to high, whenever they are idle. This may not be desired in all use cases. For example neopixel leds can get confused and flicker due to misinterpreting the idle state. Therefore, we introduce a new spi-mode bit, with which the idle behaviour can be overwritten on a per device basis. Signed-off-by: Boerge Struempfel Link: https://lore.kernel.org/r/20230530141641.1155691-2-boerge.struempfel@gmail.com Signed-off-by: Mark Brown commit bc638eabfed90fdc798fd5765e67e41abea76152 Author: Wei Fang Date: Mon May 29 10:26:15 2023 +0800 net: fec: remove last_bdp from fec_enet_txq_xmit_frame() The last_bdp is initialized to bdp, and both last_bdp and bdp are not changed. That is to say that last_bdp and bdp are always equal. So bdp can be used directly. Signed-off-by: Wei Fang Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230529022615.669589-1-wei.fang@nxp.com Signed-off-by: Paolo Abeni commit aac2fa20132e390e87270e3a738e86abcf1aea8b Author: Bagas Sanjaya Date: Mon May 22 07:54:35 2023 +0700 fs: udf: udftime: Replace LGPL boilerplate with SPDX identifier Replace license boilerplate in udftime.c with SPDX identifier for LGPL-2.0. Cc: Paul Eggert Cc: Richard Fontana Cc: Pali Rohár Signed-off-by: Bagas Sanjaya Reviewed-by: Jilayne Lovejoy Signed-off-by: Jan Kara Message-Id: <20230522005434.22133-3-bagasdotme@gmail.com> commit 5ce345541ee43333bfbd99a2ea56b1a0a167c457 Author: Bagas Sanjaya Date: Mon May 22 07:54:34 2023 +0700 fs: udf: Replace GPL 2.0 boilerplate license notice with SPDX identifier The notice refers to full GPL 2.0 text on now defunct MIT FTP site [1]. Replace it with appropriate SPDX license identifier. Cc: Thomas Gleixner Cc: Pali Rohár Link: https://web.archive.org/web/20020809115410/ftp://prep.ai.mit.edu/pub/gnu/GPL [1] Signed-off-by: Bagas Sanjaya Signed-off-by: Jan Kara Message-Id: <20230522005434.22133-2-bagasdotme@gmail.com> commit 576215cffdefc1f0ceebffd87abb390926e6b037 Author: Jan Kara Date: Thu May 25 16:17:10 2023 +0200 fs: Drop wait_unfrozen wait queue wait_unfrozen waitqueue is used only in quota code to wait for filesystem to become unfrozen. In that place we can just use sb_start_write() - sb_end_write() pair to achieve the same. So just remove the waitqueue. Reviewed-by: Christian Brauner Message-Id: <20230525141710.7595-1-jack@suse.cz> Signed-off-by: Jan Kara commit 0f7b6a433097808e7f3e82f837ccc1353f070e4a Author: Ranjani Sridharan Date: Fri May 26 15:41:49 2023 -0500 ASoC: SOF: Intel: HDA: Limit the number of dai drivers for nocodec mode With a common kernel config for nocodec and codec modes, the number of DAI drivers will be set to 15 for nocodec as well. So adjust this when set the machine params for the nocodec mode if the debug flag is set. Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20230526204149.456068-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit fe88788779fc30a4117dc2f9db4b50182679bb67 Author: Ranjani Sridharan Date: Fri May 26 15:41:48 2023 -0500 ASoC: SOF: topology: Use partial match for connecting DAI link and DAI widget This allows setting shorter names for the widget stream names in topology. For example, in the case of HDA Analog DAI link, the stream name is "Analog Playback and Capture". But it is enough to match "Analog" in the DAI link stream name with a widget's stream name. This is needed to set more meaningful names for the DAI widgets using the stream name in topology. Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20230526204149.456068-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e018e0b346706d0a0d7d7f884f3850cc0903abc2 Author: Ranjani Sridharan Date: Fri May 26 15:41:47 2023 -0500 ASoC: topology: Allow partial matching when finding DAI link This allows for setting shorter link names in topology. For example, for the HDA Analog DAI link, just "Analog" would suffice instead of "Analog Playback and Capture" Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20230526204149.456068-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0178f1e5d9845a31024eddd37e93a182e2dbab5d Author: Osama Muhammad Date: Sun May 21 03:40:25 2023 +0500 spi-dw-core.c: Fix error checking for debugfs_create_dir This patch fixes the error checking in spi-dw-core.c in debugfs_create_dir. The DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes. Signed-off-by: Osama Muhammad Link: https://lore.kernel.org/r/20230520224025.14928-1-osmtendev@gmail.com Signed-off-by: Mark Brown commit 81ea9a0710bcf74934446f63898f0186aeb2b5b8 Author: Lars-Peter Clausen Date: Sun May 28 12:58:30 2023 -0700 spi: spi-sn-f-ospi: Make read-only array `width_available` static const The `width_available` array is currently placed on the `f_ospi_supports_op_width()` function's stack. But the array is never modified. Make it `static const`. This makes the code slightly smaller and more efficient. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20230528195830.164669-3-lars@metafoo.de Signed-off-by: Mark Brown commit 282152fa9d54a84a486b93a913934c21503fb5db Author: Lars-Peter Clausen Date: Sun May 28 12:58:29 2023 -0700 spi: spi-sn-f-ospi: Use min_t instead of opencoding it Use `min_t` instead of `min` with casting the individual arguments. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20230528195830.164669-2-lars@metafoo.de Signed-off-by: Mark Brown commit 5363073dfcf087393c0587e9217ef50b1d63fcce Author: Lars-Peter Clausen Date: Sun May 28 12:58:28 2023 -0700 spi: spi-sn-f-ospi: Use devm_clk_get_enabled() Replace the combination of devm_clk_get_enable() plus clk_prepare_enable() with devm_clk_get_enabled(). Slightly reduces the amount of boilerplate code. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20230528195830.164669-1-lars@metafoo.de Signed-off-by: Mark Brown commit 6f089e986778d3657247fdc2b38bd38de796732b Author: Uwe Kleine-König Date: Tue May 30 10:16:48 2023 +0200 spi: mt65xx: Don't disguise a "return 0" as "return ret" Because of the earlier if (ret) return ret; ret is always zero at the end of mtk_spi_suspend(). Write it as explicit return 0 for slightly improved clearness. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230530081648.2199419-4-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit df7e47196fcef5d5611caa65f91d813578cf3efd Author: Uwe Kleine-König Date: Tue May 30 10:16:47 2023 +0200 spi: mt65xx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230530081648.2199419-3-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 22f407278ea43df46f90cece6595e5e8a0d5447c Author: Uwe Kleine-König Date: Tue May 30 10:16:46 2023 +0200 spi: mt65xx: Properly handle failures in .remove() Returning an error code in a platform driver's remove function is wrong most of the time and there is an effort to make the callback return void. To prepare this rework the function not to exit early. There wasn't a real problem because if pm runtime resume failed the only step missing was pm_runtime_disable() which isn't an issue. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230530081648.2199419-2-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 87fe0214d7aae5e1152953710489c5ab5469b388 Author: Fabio Estevam Date: Sat May 27 17:50:46 2023 -0300 dt-bindings: pfuze100.yaml: Add an entry for interrupts The PFUZE100 PMIC has an interrupt pin that can be connected to the host SoC. Describe it in the dt-bindings to avoid warnings like: imx6q-zii-rdu2.dtb: pmic@8: 'interrupt-parent', 'interrupts' do not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/regulator/pfuze100.yaml Signed-off-by: Fabio Estevam Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230527205048.418360-1-festevam@gmail.com Signed-off-by: Mark Brown commit 959c34765cf1d0688077ec5f41f9b71a9e70a6f1 Author: Marek Vasut Date: Thu May 18 04:39:46 2023 +0200 regulator: stm32-pwr: Fix regulator disabling The following shows up in the kernel log on systems using the STM32MP15xx USBPHYC: " regulator regulator.19: regulator disable timed out! reg18: failed to disable: -ETIMEDOUT " This 'regulator.19' is 'pwr@50001000' 'reg18' in stm32mp151.dts DT, or "Power control (PWR)" register "PWR_CR3" bits "REG18" on STM32MP15xx reference manual. The reason for the timeout seems to be the poll which this patch changes. When turning this regulator OFF, PWR_CR3 reads 0xf0000000 , then REG18_EN bit is cleared, and then this poll waits until REG18_RDY bit is cleared as well, but that never happens, the PWR_CR3 keeps reading 0xe0000000 . I am not sure whether this should happen, I suspect the 1V8 supply is always READY when the 1V8 input is present, and the regulator can only ever be enabled/disabled using the REG18_EN bit, but the REG18_READY bit is never cleared again. This patch adjusts the poll to check whether REG18_EN has been cleared on regulator disable, but retains the check for REG18_READY in regulator enable as there it makes sense to verify the regulator is really READY. Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230518023946.530381-1-marex@denx.de Signed-off-by: Mark Brown commit c3079282fdf7285b4133d6d1a7901b7923d6db09 Author: Min-Hua Chen Date: Sat May 20 05:16:36 2023 +0800 ASoC: ti: davinci-mcasp: Use pcm_for_each_format() macro Use pcm_for_each_format for the PCM format iteration and fix the following sparse warnings. sound/soc/ti/davinci-mcasp.c:1336:26: sparse: warning: restricted snd_pcm_format_t degrades to integer sound/soc/ti/davinci-mcasp.c:1358:26: sparse: warning: restricted snd_pcm_format_t degrades to integer sound/soc/ti/davinci-mcasp.c:1438:26: sparse: warning: restricted snd_pcm_format_t degrades to integer No functional changes. Signed-off-by: Min-Hua Chen Link: https://lore.kernel.org/r/20230519211636.3699-1-minhuadotchen@gmail.com Signed-off-by: Mark Brown commit e89f45edb747ed88e97a5771dd6d3dd1eb517873 Author: Venkata Prasad Potturu Date: Tue May 30 16:37:58 2023 +0530 ASoC: amd: vangogh: Add check for acp config flags in vangogh platform We have SOF and generic ACP support enabled for Vangogh platform on some machines. Since we have same PCI id used for probing, add check for machine configuration flag to avoid conflict with newer pci drivers. Such machine flag has been initialized via dmi match on few Vangogh based machines. If no flag is specified probe and register older platform device. Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/20230530110802.674939-1-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown commit 0f3d5585ad20a23bf70d09deae2e0d84e745055e Author: Trevor Wu Date: Tue May 23 10:59:32 2023 +0800 ASoC: SOF: mediatek: add mt8188 audio support Add mt8188 dai driver and specify of_machine to support mt8188 audio. Signed-off-by: Trevor Wu Reviewed-by: Pierre-Louis Bossart Reviewed-by: Yaochun Hung Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20230523025933.30494-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 33e20b07bec4991c169e3c6ff28c2126583724fc Author: Thomas Gleixner Date: Tue May 30 12:46:22 2023 +0200 x86/realmode: Make stack lock work in trampoline_compat() The stack locking and stack assignment macro LOAD_REALMODE_ESP fails to work when invoked from the 64bit trampoline entry point: trampoline_start64 trampoline_compat LOAD_REALMODE_ESP <- lock Accessing tr_lock is only possible from 16bit mode. For the compat entry point this needs to be pa_tr_lock so that the required relocation entry is generated. Otherwise it locks the non-relocated address which is aside of being wrong never cleared in secondary_startup_64() causing all but the first CPU to get stuck on the lock. Make the macro take an argument lock_pa which defaults to 0 and rename it to LOCK_AND_LOAD_REALMODE_ESP to make it clear what this is about. Fixes: f6f1ae9128d2 ("x86/smpboot: Implement a bit spinlock to protect the realmode stack") Reported-by: Kirill A. Shutemov Signed-off-by: Thomas Gleixner Tested-by: Kirill A. Shutemov Link: https://lore.kernel.org/r/87h6rujdvl.ffs@tglx commit a5961bed5429cf1134d7f539b4ed60317012f84d Author: Wells Lu Date: Sun May 28 20:34:37 2023 +0800 pinctrl: sunplus: Add check for kmalloc Fix Smatch static checker warning: potential null dereference 'configs'. (kmalloc returns null) Fixes: aa74c44be19c ("pinctrl: Add driver for Sunplus SP7021") Signed-off-by: Wells Lu Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/1685277277-12209-1-git-send-email-wellslutw@gmail.com Signed-off-by: Linus Walleij commit bc590b47549225a03c6b36bbc1aede75c917767b Author: Heiner Kallweit Date: Sun May 28 19:35:12 2023 +0200 r8169: check for PCI read error in probe Check whether first PCI read returns 0xffffffff. Currently, if this is the case, the user sees the following misleading message: unknown chip XID fcf, contact r8169 maintainers (see MAINTAINERS file) Signed-off-by: Heiner Kallweit Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/75b54d23-fefe-2bf4-7e80-c9d3bc91af11@gmail.com Signed-off-by: Paolo Abeni commit 3ea3c9cff7f982b42126a009140cb73a53ecd647 Author: Andy Shevchenko Date: Sun May 28 17:25:31 2023 +0300 dsa: lan9303: Remove stray gpiod_unexport() call There is no gpiod_export() and gpiod_unexport() looks pretty much stray. The gpiod_export() and gpiod_unexport() shouldn't be used in the code, GPIO sysfs is deprecated. That said, simply drop the stray call. Signed-off-by: Andy Shevchenko Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230528142531.38602-1-andriy.shevchenko@linux.intel.com Signed-off-by: Paolo Abeni commit bb269633f3da56ec65e4e5aa9d9fca0ef8b3d373 Author: Christophe JAILLET Date: Sat May 27 21:40:08 2023 +0200 liquidio: Use vzalloc() Use vzalloc() instead of hand writing it with vmalloc()+memset(). This is less verbose. Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/93b010824d9d92376e8d49b9eb396a0fa0c0ac80.1685216322.git.christophe.jaillet@wanadoo.fr Signed-off-by: Paolo Abeni commit 1b997aef4f54a8c590dbef54fbcb84ad9babc496 Author: James Hilliard Date: Sun May 21 01:50:44 2023 -0600 serial: Indicate fintek option may also be required for RS232 support The current config comment for SERIAL_8250_FINTEK implies that this option is only needed when one wants to support RS485. As it turns out we also need to enable this option for RS232 support to function correctly on some variants. For example for variants such as the F71869AD attempting to use multiple RS232 ports simultaneously without this option enabled can result in data corruption. Signed-off-by: James Hilliard Link: https://lore.kernel.org/r/20230521075046.3539376-1-james.hilliard1@gmail.com Signed-off-by: Greg Kroah-Hartman commit 20ec397d694b05d3e7150e3ba15047c53e7e6b94 Author: Sherry Sun Date: Mon May 22 10:51:11 2023 +0800 tty: serial: fsl_lpuart: Check the return value of dmaengine_tx_status Coverity reports the Unchecked return value (CHECKED_RETURN) warning: Calling dmaengine_tx_status without checking return value. So here add the return value check for dmaengine_tx_status() function to make coverity happy. Fixes: cf9aa72d2f91 ("tty: serial: fsl_lpuart: optimize the timer based EOP logic") Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20230522025111.3747-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit 0d07703be74fec50eb09213aba69aa33a2631669 Author: Uwe Kleine-König Date: Thu May 25 23:01:47 2023 +0200 serial: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230525210147.734737-1-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit d0b309a5d3f4648fd4fb1a255a7ae9fb98d87be3 Author: John Ogness Date: Thu May 25 11:37:59 2023 +0206 serial: 8250: synchronize and annotate UART_IER access The UART_IER register is modified twice by each console write (serial8250_console_write()) under the port lock. Any driver code that accesses UART_IER must do so with the port locked in order to ensure consistent values, even when for read accesses. Add locking, lockdep notation, and/or comments everywhere UART_IER is accessed. The added locking is not fixing a real problem because it occurs where the console is not active. However, adding the locking to these non-critical paths greatly simplifies UART_IER access tracking by establishing a general policy that all UART_IER access is performed with the port locked. Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230525093159.223817-9-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 25614735a647693c1260f253dc3ab32127697806 Author: John Ogness Date: Thu May 25 11:37:58 2023 +0206 serial: 8250: lock port for UART_IER access in omap8250_irq() omap8250_irq() accesses UART_IER. This register is modified twice by each console write (serial8250_console_write()) under the port lock. omap8250_irq() must also take the port lock to guanentee synchronized access to UART_IER. Since the port lock is already being taken for the stop_rx() callback and since it is safe to call cancel_delayed_work() while holding the port lock, simply extend the port lock region to include UART_IER access. Fixes: 1fe0e1fa3209 ("serial: 8250_omap: Handle optional overrun-throttle-ms property") Signed-off-by: John Ogness Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230525093159.223817-8-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 8b45503776b6e2c53abbb217970236ed54bd261b Author: John Ogness Date: Thu May 25 11:37:57 2023 +0206 serial: 8250: lock port for omap8250_restore_regs() omap8250_restore_regs() accesses UART_IER. This register is modified twice by each console write (serial8250_console_write()) under the port lock. However, not all calls to omap8250_restore_regs() are under the port lock. Add the missing port locking around omap8250_restore_regs() calls. Add lockdep notation to the omap8250_restore_regs(). Note that this is not fixing a real problem because the serial devices are resumed before console printing is enabled. However, adding this locking allows for clean locking semantics for omap8250_restore_regs() so that lockdep can be used to identify possible problems in the future. It also simplifies synchronization of UART_IER in general by not needing to rely on such implementation details. Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230525093159.223817-7-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 87660fb4041f58d5fdfa58f4d3d35385dcc8320d Author: John Ogness Date: Thu May 25 11:37:56 2023 +0206 serial: 8250: lock port for rx_dma() callback The rx_dma() callback (omap_8250_rx_dma) accesses UART_IER. This register is modified twice by each console write (serial8250_console_write()) under the port lock. However, not all calls to the rx_dma() callback are under the port lock. Add the missing port locking around rx_dma() callback calls. Add lockdep notation to the omap_8250_rx_dma(). Note that this is not fixing a real problem because: 1. Currently DMA is forced off for 8250_omap consoles. 2. The serial devices are resumed before console printing is enabled. However, adding this locking allows for clean locking semantics for the rx_dma() callback so that lockdep can be used to identify possible problems in the future. It also simplifies synchronization of UART_IER in general by not needing to rely on implementation details such as 1 and 2. Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230525093159.223817-6-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 51e45fba14bf08b66bca764a083c7f2e2ff62f01 Author: John Ogness Date: Thu May 25 11:37:55 2023 +0206 serial: core: lock port for start_rx() in uart_resume_port() The only user of the start_rx() callback (qcom_geni) directly calls its own stop_rx() callback. Since stop_rx() requires that the port->lock is taken and interrupts are disabled, the start_rx() callback has the same requirement. Fixes: cfab87c2c271 ("serial: core: Introduce callback for start_rx and do stop_rx in suspend only if this callback implementation is present.") Signed-off-by: John Ogness Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20230525093159.223817-5-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit ca73a892c5bec4b08a2fa22b3015e98ed905abb7 Author: John Ogness Date: Thu May 25 11:37:54 2023 +0206 serial: 8250: lock port for stop_rx() in omap8250_irq() The uarts_ops stop_rx() callback expects that the port->lock is taken and interrupts are disabled. Fixes: 1fe0e1fa3209 ("serial: 8250_omap: Handle optional overrun-throttle-ms property") Signed-off-by: John Ogness Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230525093159.223817-4-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit abcb0cf1f5b2d99b1d117a4dbce334120e358d6d Author: John Ogness Date: Thu May 25 11:37:53 2023 +0206 serial: core: lock port for stop_rx() in uart_suspend_port() The uarts_ops stop_rx() callback expects that the port->lock is taken and interrupts are disabled. Fixes: c9d2325cdb92 ("serial: core: Do stop_rx in suspend path for console if console_suspend is disabled") Signed-off-by: John Ogness Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20230525093159.223817-3-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit b1207d86169d16581101f93b2906cefd0e940ff1 Author: John Ogness Date: Thu May 25 11:37:52 2023 +0206 serial: 8250: lock port in startup() callbacks uart_ops startup() callback is called without interrupts disabled and without port->lock locked, relatively late during the boot process (from the call path of console_on_rootfs()). If the device is a console, it was already previously registered and could be actively printing messages. The console printing function serial8250_console_write() modifies the interrupt register (UART_IER) under the port->lock with the pattern: read, clear, restore. Since some startup() callbacks are modifying UART_IER without the port->lock locked, it is possible that the value intended to be written by the startup() callback will get overwritten and be lost. CPU0 CPU1 serial8250_console_write omap_8250_startup -------------------------- ----------------- spin_lock(port->lock) oldval = read(UART_IER) uart_console_write() write(newval, UART_IER) write(oldval, UART_IER) spin_unlock(port->lock) Add port->lock synchronization to the 8250 startup() callbacks where they need to access UART_IER. This avoids racing with serial8250_console_write(). Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230525093159.223817-2-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit e003498ec055eef3847e5433273df1e151b9af4b Author: Takashi Sakamoto Date: Tue May 30 19:25:32 2023 +0900 firewire: fix build failure due to missing module license The added KUnit test has no MODULE_LICENSE even if built for tristate. It brings build failure in linux-next integration. This commit releases the test under GPL and fixes the bug. Reported-by: Stephen Rothwell Closes: https://lore.kernel.org/lkml/20230530122450.1603af75@canb.auug.org.au/ Fixes: dc7c51638f46 ("firewire: add KUnit test to check layout of UAPI structures") Link: https://lore.kernel.org/r/20230530102532.56386-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit d20dd0ea14072e8a90ff864b2c1603bd68920b4b Merge: 7fa28bc68512a 972c6d8346333 Author: Paolo Abeni Date: Tue May 30 11:50:07 2023 +0200 Merge branch 'microchip_t1s-update-on-microchip-10base-t1s-phy-driver' Parthiban Veerasooran says: ==================== microchip_t1s: Update on Microchip 10BASE-T1S PHY driver This patch series contain the below updates, - Fixes on the Microchip LAN8670/1/2 10BASE-T1S PHYs support in the net/phy/microchip_t1s.c driver. - Adds support for the Microchip LAN8650/1 Rev.B0 10BASE-T1S Internal PHYs in the net/phy/microchip_t1s.c driver. ==================== Link: https://lore.kernel.org/r/20230526152348.70781-1-Parthiban.Veerasooran@microchip.com Signed-off-by: Paolo Abeni commit 972c6d8346333437ae784271e74129b3f0583248 Author: Parthiban Veerasooran Date: Fri May 26 20:53:48 2023 +0530 net: phy: microchip_t1s: add support for Microchip LAN865x Rev.B0 PHYs Add support for the Microchip LAN865x Rev.B0 10BASE-T1S Internal PHYs (LAN8650/1). The LAN865x combines a Media Access Controller (MAC) and an internal 10BASE-T1S Ethernet PHY to access 10BASE‑T1S networks. As LAN867X and LAN865X are using the same function for the read_status, rename the function as lan86xx_read_status. Reviewed-by: Andrew Lunn Signed-off-by: Parthiban Veerasooran Reviewed-by: Ramón Nordin Rodriguez Signed-off-by: Paolo Abeni commit b4010beb347d63acd5715cd66eb791988128b7b8 Author: Parthiban Veerasooran Date: Fri May 26 20:53:47 2023 +0530 net: phy: microchip_t1s: remove unnecessary interrupts disabling code By default, except Reset Complete interrupt in the Interrupt Mask 2 Register all other interrupts are disabled/masked. As Reset Complete status is already handled, it doesn't make sense to disable it. Reviewed-by: Ramón Nordin Rodriguez Tested-by: Ramón Nordin Rodriguez Reviewed-by: Andrew Lunn Signed-off-by: Parthiban Veerasooran Signed-off-by: Paolo Abeni commit 1d7650b8ce6041be4ea0436ad7a69c057b4d22f8 Author: Parthiban Veerasooran Date: Fri May 26 20:53:46 2023 +0530 net: phy: microchip_t1s: fix reset complete status handling As per the datasheet DS-LAN8670-1-2-60001573C.pdf, the Reset Complete status bit in the STS2 register has to be checked before proceeding to the initial configuration. Reading STS2 register will also clear the Reset Complete interrupt which is non-maskable. Reviewed-by: Andrew Lunn Signed-off-by: Parthiban Veerasooran Reviewed-by: Ramón Nordin Rodriguez Tested-by: Ramón Nordin Rodriguez Signed-off-by: Paolo Abeni commit 6f12765ecad399d3cc5f58fcaf7f3c69c275326c Author: Parthiban Veerasooran Date: Fri May 26 20:53:45 2023 +0530 net: phy: microchip_t1s: update LAN867x PHY supported revision number As per AN1699, the initial configuration in the driver applies to LAN867x Rev.B1 hardware revision. 0x0007C160 (Rev.A0) and 0x0007C161 (Rev.B0) never released to production and hence they don't need to be supported. Reviewed-by: Ramón Nordin Rodriguez Reviewed-by: Andrew Lunn Signed-off-by: Parthiban Veerasooran Signed-off-by: Paolo Abeni commit 221a5344806c3b8c2b172777b1b59f65228dbd8a Author: Parthiban Veerasooran Date: Fri May 26 20:53:44 2023 +0530 net: phy: microchip_t1s: replace read-modify-write code with phy_modify_mmd Replace read-modify-write code in the lan867x_config_init function to avoid handling data type mismatch and to simplify the code. Reviewed-by: Andrew Lunn Signed-off-by: Parthiban Veerasooran Reviewed-by: Ramón Nordin Rodriguez Signed-off-by: Paolo Abeni commit ca33db4a86023f1158dc2b3587ca3c90d2a0705e Author: Parthiban Veerasooran Date: Fri May 26 20:53:43 2023 +0530 net: phy: microchip_t1s: modify driver description to be more generic Remove LAN867X from the driver description as this driver is common for all the Microchip 10BASE-T1S PHYs. Reviewed-by: Ramón Nordin Rodriguez Reviewed-by: Andrew Lunn Signed-off-by: Parthiban Veerasooran Signed-off-by: Paolo Abeni commit 5d50eef380b21eb71894797b344cff0b56059580 Author: Shyam Sundar S K Date: Thu May 25 19:49:28 2023 +0530 platform/x86/amd: pmc: Add helper function to check the cpu id Add a helper routine to check the underlying cpu id, that can be used across the PMC driver to remove the duplicate code. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230525141929.866385-4-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit be8325fb3d8ca1b0148b4cb765ef196dcb2d9192 Author: Shyam Sundar S K Date: Thu May 25 19:49:27 2023 +0530 platform/x86/amd: pmc: Get STB DRAM size from PMFW Recent PMFW's have support for querying the STB DRAM size. Add this support to the driver. Reviewed-by: Ilpo Järvinen Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20230525141929.866385-3-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit a0d61b070d90f16b5f842d5b4f027e5e6b35a32a Author: Shyam Sundar S K Date: Thu May 25 19:49:26 2023 +0530 platform/x86/amd: pmc: Pass true/false to bool argument Pass true/false to the bool argument of the amd_pmc_send_cmd() function, instead of 1/0 to match the function signature. Reviewed-by: Ilpo Järvinen Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20230525141929.866385-2-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 1d9e93fad549bc38f593147479ee063f2872c170 Author: Krzysztof Kozlowski Date: Sat May 13 13:29:31 2023 +0200 memory: brcmstb_dpfe: fix testing array offset after use Code should first check for valid value of array offset, then use it as the index. Fixes smatch warning: drivers/memory/brcmstb_dpfe.c:443 __send_command() error: testing array offset 'cmd' after use. Fixes: 2f330caff577 ("memory: brcmstb: Add driver for DPFE") Acked-by: Markus Mayer Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20230513112931.176066-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 6a988251c4e53da33107c1975f578904c0635b43 Author: Artur Weber Date: Fri May 19 21:06:25 2023 +0200 ARM: dts: s5pv210: Fix typo in comments, fix pinctrl header Change 'specfic' to 'specific' and make the pinctrl DTSI header more like the s3c64xx pinctrl DTSI (previously it was copied from the main s5pv210 DTSI, and not changed to match the new contents). Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230519190625.7844-4-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit 316c31fba6eda4543d5e234b13d0c0605a83a643 Author: Artur Weber Date: Fri May 19 21:06:24 2023 +0200 ARM: dts: s3c64xx: Fix some typos in comments Change 'specfic' to 'specific'. Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230519190625.7844-3-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit 2f6905307a7bb998e819c03097f3cc54a51b015a Author: Artur Weber Date: Fri May 19 21:06:23 2023 +0200 ARM: dts: exynos: Fix some typos in comments Change 'specfic' to 'specific', 'optiosn' to 'options' and remove duplicated 'are listed' in DTSI heading comments. Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230519190625.7844-2-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit 5364e37799c83d405175b2e1e1065c7c247949b3 Author: Raphael Gallais-Pou Date: Mon May 29 11:13:59 2023 +0200 ARM: dts: stm32: fix ltdc warnings in stm32mp15 boards Those concern: * "#size-cells" and "#address-cells" wrongly used * residual "reg" property appearing on endpoints where it could be avoided Signed-off-by: Raphael Gallais-Pou Reviewed-by: Marek Vasut Signed-off-by: Alexandre Torgue commit f7164b346a9009e5b70671bb72e32e1cc22a90b4 Author: Raphael Gallais-Pou Date: Mon May 29 11:13:58 2023 +0200 ARM: dts: stm32: fix dsi warnings on stm32mp15 boards Fixes DSI related warnings: * "#size-cells" and "#address-cells" wrongly used * Changed 'panel-dsi@0' to 'panel@0' according to dsi-controller.yaml Signed-off-by: Raphael Gallais-Pou Reviewed-by: Marek Vasut Signed-off-by: Alexandre Torgue commit 5769b45abedca0b9d14145e156c180af36139416 Author: Adam Ford Date: Sun May 28 08:27:27 2023 -0500 dt-bindings: bridge: samsung-dsim: Make some flags optional In the event a device is connected to the samsung-dsim controller that doesn't support the burst-clock, the driver is able to get the requested pixel clock from the attached device or bridge. In these instances, the samsung,burst-clock-frequency isn't needed, so remove it from the required list. The pll-clock frequency can be set by the device tree entry for samsung,pll-clock-frequency, but in some cases, the pll-clock may have the same clock rate as sclk_mipi clock. If they are equal, this flag is not needed since the driver will use the sclk_mipi rate as a fallback. Signed-off-by: Adam Ford Reviewed-by: Conor Dooley Reviewed-by: Fabio Estevam Reviewed-by: Jagan Teki Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230528132727.3933-1-aford173@gmail.com commit 45e418bd528f5c1ed6b8de7596cf523f10f74b7b Author: Raphael Gallais-Pou Date: Mon May 29 11:13:57 2023 +0200 dt-bindings: display: st,stm32-dsi: Remove unnecessary fields "#address-cells" and "#size-cells" are two properties that are not mandatory. For instance, the DSI could refer to a bridge outside the scope of the node rather than include a 'panel@0' subnode. By doing so, address and size fields become then unnecessary, creating a warning at build time. Signed-off-by: Raphael Gallais-Pou Acked-by: Conor Dooley Reviewed-by: Marek Vasut Signed-off-by: Alexandre Torgue commit 0c211488ef36db3d52c8b8ae9931e508272f5a11 Author: Raphael Gallais-Pou Date: Mon May 29 11:13:56 2023 +0200 ARM: dts: stm32: fix warnings on stm32f469-disco board Several warnings appear when building and checking stm32f429 device-tree: arch/arm/boot/dts/stm32f469-disco.dts:182.28-184.5: Warning (unit_address_vs_reg): /soc/display-controller@40016800/port/endpoint@0: node has a unit name, but no reg or ranges property .../arch/arm/boot/dts/stm32f469-disco.dtb: dsi@40016c00: Unevaluated properties are not allowed ('panel-dsi@0' was unexpected) From schema: .../Documentation/devicetree/bindings/display/st,stm32-dsi.yaml Fix those. Signed-off-by: Raphael Gallais-Pou Reviewed-by: Marek Vasut Signed-off-by: Alexandre Torgue commit 7fa28bc68512ae541c9e855ad354b9cc3a08263b Merge: eee2e03c8ffe3 d0dec3333040b Author: Paolo Abeni Date: Tue May 30 09:48:22 2023 +0200 Merge branch 'microchip-dsa-driver-improvements' Oleksij Rempel says: ==================== Microchip DSA Driver Improvements changes v2: - set .max_register = U8_MAX, it should be more readable - clarify in the RMW error handling patch, logging behavior expectation. I'd like to share a set of patches for the Microchip DSA driver. These patches were chosen from a bigger set because they are simpler and should be easier to review. The goal is to make the code easier to read, get rid of unused code, and handle errors better. ==================== Link: https://lore.kernel.org/r/20230526073445.668430-1-o.rempel@pengutronix.de Signed-off-by: Paolo Abeni commit d0dec3333040bc41b160ee9b2fd1b4eb91452cd3 Author: Oleksij Rempel Date: Fri May 26 09:34:45 2023 +0200 net: dsa: microchip: Add register access control for KSZ8873 chip This update introduces specific register access boundaries for the KSZ8873 and KSZ8863 chips within the DSA Microchip driver. The outlined ranges target global control registers, port registers, and advanced control registers. Signed-off-by: Oleksij Rempel Signed-off-by: Paolo Abeni commit ae1ad12e9da4de8f0540258b197131f96cc24c6f Author: Oleksij Rempel Date: Fri May 26 09:34:44 2023 +0200 net: dsa: microchip: ksz8: Prepare ksz8863_smi for regmap register access validation This patch prepares the ksz8863_smi part of ksz8 driver to utilize the regmap register access validation feature. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit bb4609d27f89cf6d4c6021690c02a10a94719464 Author: Oleksij Rempel Date: Fri May 26 09:34:43 2023 +0200 net: dsa: microchip: remove ksz_port:on variable The only place where this variable would be set to false is the ksz8_config_cpu_port() function. But it is done in a bogus way: for (i = 0; i < dev->phy_port_cnt; i++) { if (i == dev->phy_port_cnt) <--- will be never executed. break; p->on = 1; So, we never have a situation where p->on = 0. In this case, we can just remove it. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Reviewed-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit b8311f46c6f5a2030f43c764e742015867293493 Author: Vladimir Oltean Date: Fri May 26 09:34:42 2023 +0200 net: dsa: microchip: add an enum for regmap widths It is not immediately obvious that this driver allocates, via the KSZ_REGMAP_TABLE() macro, 3 regmaps for register access: dev->regmap[0] for 8-bit access, dev->regmap[1] for 16-bit and dev->regmap[2] for 32-bit access. In future changes that add support for reg_fields, each field will have to specify through which of the 3 regmaps it's going to go. Add an enum now, to denote one of the 3 register access widths, and make the code go through some wrapper functions for easier review and further modification. Signed-off-by: Vladimir Oltean Signed-off-by: Oleksij Rempel Signed-off-by: Paolo Abeni commit 2f0d579956e87a67c43e225c85488ff7a13bc3b8 Author: Oleksij Rempel Date: Fri May 26 09:34:41 2023 +0200 net: dsa: microchip: improving error handling for 8-bit register RMW operations This patch refines the error handling mechanism for 8-bit register read-modify-write operations. In case of a failure, it now logs an error message detailing the problematic offset. This enhancement aids in debugging by providing more precise information when these operations encounter issues. Furthermore, the ksz_prmw8() function has been updated to return error values rather than void, enabling calling functions to appropriately respond to errors. Additionally, in case of an error that affects both the current and future accesses, the PHY driver will log the errors consistently, akin to the existing behavior in all ksz_read*/ksz_write* helpers. Signed-off-by: Oleksij Rempel Signed-off-by: Paolo Abeni commit ca027ae58eaab3632966158ce440a7f50da52bef Author: Uwe Kleine-König Date: Fri May 26 23:40:03 2023 +0200 ARM: s3c: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Andi Shyti Link: https://lore.kernel.org/r/20230526214003.2134595-1-u.kleine-koenig@pengutronix.de Signed-off-by: Krzysztof Kozlowski commit 0cf765e598712addec34d0208cc1418c151fefb2 Author: Marek Vasut Date: Thu May 18 02:42:32 2023 +0200 ARM: dts: stm32: Shorten the AV96 HDMI sound card name Fix the following error in kernel log due to too long sound card name: " asoc-audio-graph-card sound: ASoC: driver name too long 'STM32MP1-AV96-HDMI' -> 'STM32MP1-AV96-H' " Fixes: e027da342772 ("ARM: dts: stm32: Add bindings for audio on AV96") Signed-off-by: Marek Vasut Signed-off-by: Alexandre Torgue commit 2b384e01fd12275b93ba777b40ec8b868c965e2d Merge: 7877cb91f1081 b4d81fab1ed0b Author: Marc Zyngier Date: Tue May 30 08:34:41 2023 +0100 Merge branch irq/gic-v3-asr8601 into irq/irqchip-next * irq/gic-v3-asr8601: : Workaround for the ASR8601 SoC that couples a GIC500 with : CPUs that use affinities that cannot be handled by the GIC... irqchip/gic-v3: Work around affinity issues on ASR8601 irqchip/gic-v3: Improve affinity helper Signed-off-by: Marc Zyngier commit 033c2d8ab2835a7f13e1a9c6813b412935e77140 Author: Mika Westerberg Date: Wed May 24 14:03:55 2023 +0300 thunderbolt: Log DisplayPort adapter rate and lanes on discovery This may be helpful when debugging possible issues around DisplayPort port tunneling. Signed-off-by: Mika Westerberg commit eee2e03c8ffe3a4e27cc49762931c5d31cd481af Merge: 45402f04c5821 93b230b549bcb Author: Jakub Kicinski Date: Mon May 29 22:05:40 2023 -0700 Merge branch 'netlink-specs-add-ynl-spec-for-ovs_flow' Donald Hunter says: ==================== netlink: specs: add ynl spec for ovs_flow Add a ynl specification for ovs_flow. The spec is sufficient to dump ovs flows but some attrs have been left as binary blobs because ynl doesn't support C arrays in struct definitions yet. Patches 1-3 add features for genetlink-legacy specs Patch 4 is the ovs_flow netlink spec ==================== Link: https://lore.kernel.org/r/20230527133107.68161-1-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski commit 93b230b549bcb4daed82d617f3f6f9d6d118befe Author: Donald Hunter Date: Sat May 27 14:31:07 2023 +0100 netlink: specs: add ynl spec for ovs_flow Add a ynl specification for ovs_flow. This spec is sufficient to dump ovs flows. Some attrs are left as binary blobs because ynl doesn't support C arrays in struct definitions yet. Signed-off-by: Donald Hunter Signed-off-by: Jakub Kicinski commit 313a7a808ca8ca0fe08e2175eb145479bd86937e Author: Donald Hunter Date: Sat May 27 14:31:06 2023 +0100 tools: ynl: Support enums in struct members in genetlink-legacy Support decoding scalars as enums in struct members for genetlink-legacy specs. Signed-off-by: Donald Hunter Signed-off-by: Jakub Kicinski commit 5ac18889bde04ed2d4f2559da01e9b160234525c Author: Donald Hunter Date: Sat May 27 14:31:05 2023 +0100 tools: ynl: Initialise fixed headers to 0 in genetlink-legacy This eliminates the need for e.g. --json '{"dp-ifindex":0}' which is not too big a deal for ovs but will get tiresome for fixed header structs that have many members. Signed-off-by: Donald Hunter Signed-off-by: Jakub Kicinski commit 6d6bae63053d547e96fe4d2c9c8b4fc595bfc5ac Author: Donald Hunter Date: Sat May 27 14:31:04 2023 +0100 doc: ynl: Add doc attr to struct members in genetlink-legacy spec Make it possible to document the meaning of struct member attributes in genetlink-legacy specs. Signed-off-by: Donald Hunter Signed-off-by: Jakub Kicinski commit 45402f04c5821a0c42c5d8b17e4abad504e598bb Author: Simon Horman Date: Fri May 26 15:45:13 2023 +0200 devlink: Spelling corrections Make some minor spelling corrections in comments. Found by inspection. Signed-off-by: Simon Horman Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20230526-devlink-spelling-v1-1-9a3e36cdebc8@kernel.org Signed-off-by: Jakub Kicinski commit ef1bc119ceb52d22a83f72b8dfce1dd64a3cca05 Author: Dan Carpenter Date: Fri May 26 16:39:15 2023 +0300 net: fix signedness bug in skb_splice_from_iter() The "len" variable needs to be signed for the error handling to work correctly. Fixes: 2e910b95329c ("net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES") Signed-off-by: Dan Carpenter Reviewed-by: David Howells Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/366861a7-87c8-4bbf-9101-69dd41021d07@kili.mountain Signed-off-by: Jakub Kicinski commit 404621fab27310c231bab9a3999eab858390cb45 Author: Russell King (Oracle) Date: Fri May 26 12:44:43 2023 +0100 net: dpaa2-mac: use correct interface to free mdiodev Rather than using put_device(&mdiodev->dev), use the proper interface provided to dispose of the mdiodev - that being mdio_device_free(). Signed-off-by: Russell King (Oracle) Reviewed-by: Simon Horman Reviewed-by: Ioana Ciornei Tested-by: Ioana Ciornei Link: https://lore.kernel.org/r/E1q2VsB-008QlZ-El@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 3ed018fb262801a1a1cdd7918ee3d7e7071bd252 Merge: 75455b906d824 b7d5d0438e01c Author: Jakub Kicinski Date: Mon May 29 21:46:55 2023 -0700 Merge branch 'net-pcs-add-helpers-to-xpcs-and-lynx-to-manage-mdiodev' Russell King says: ==================== net: pcs: add helpers to xpcs and lynx to manage mdiodev This morning, we have had two instances where the destruction of the MDIO device associated with XPCS and Lynx has been wrong. Rather than allowing this pattern of errors to continue, let's make it easier for driver authors to get this right by adding a helper. The changes are essentially: 1. Add two new mdio device helpers to manage the underlying struct device reference count. Note that the existing mdio_device_free() doesn't actually free anything, it merely puts the reference count. 2. Make the existing _create() and _destroy() PCS driver methods increment and decrement this refcount using these helpers. This results in no overall change, although drivers may hang on to the mdio device for a few cycles longer. 3. Add _create_mdiodev() which creates the mdio device before calling the existing _create() method. Once the _create() method has returned, we put the reference count on the mdio device. If _create() was successful, then the reference count taken there will "hold" the mdio device for the lifetime of the PCS (in other words, until _destroy() is called.) However, if _create() failed, then dropping the refcount at this point will free the mdio device. This is the exact behaviour we desire. 4. Convert users that create a mdio device and then call the PCS's _create() method over to the new _create_mdiodev() method, and simplify the cleanup. We also have DPAA2 and fmem_memac that look up their PCS rather than creating it. These could also drop their reference count on the MDIO device immediately after calling lynx_pcs_create(), which would then mean we wouldn't need lynx_get_mdio_device() and the associated complexity to put the device in dpaa2_pcs_destroy() and pcs_put(). Note that DPAA2 bypasses the mdio device's abstractions by calling put_device() directly. ==================== Link: https://lore.kernel.org/r/ZHCGZ8IgAAwr8bla@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit b7d5d0438e01c7c61db5fc87d92ad8cb1166f217 Author: Russell King (Oracle) Date: Fri May 26 11:14:50 2023 +0100 net: enetc: use lynx_pcs_create_mdiodev() Use the newly introduced lynx_pcs_create_mdiodev() which simplifies the creation and destruction of the lynx PCS. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 5767c6a8d9b7893db16702b67287cadeeff57a4a Author: Russell King (Oracle) Date: Fri May 26 11:14:44 2023 +0100 net: dsa: ocelot: use lynx_pcs_create_mdiodev() Use the newly introduced lynx_pcs_create_mdiodev() which simplifies the creation and destruction of the lynx PCS. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 86b5f2d8cd7828c881036d30ce3a4e711a071726 Author: Russell King (Oracle) Date: Fri May 26 11:14:39 2023 +0100 net: pcs: lynx: add lynx_pcs_create_mdiodev() Add lynx_pcs_create_mdiodev() to simplify the creation of the mdio device associated with lynx PCS. In order to allow lynx_pcs_destroy() to clean this up, we need to arrange for lynx_pcs_create() to take a refcount on the mdiodev, and lynx_pcs_destroy() to put it. Adding the refcounting to lynx_pcs_create()..lynx_pcs_destroy() will be transparent to existing users of these interfaces. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Reviewed-by: Ioana Ciornei Tested-by: Ioana Ciornei Signed-off-by: Jakub Kicinski commit 727e373f897d06214ffc59f820a356a5bc458789 Author: Russell King (Oracle) Date: Fri May 26 11:14:34 2023 +0100 net: stmmac: use xpcs_create_mdiodev() Use the new xpcs_create_mdiodev() creator, which simplifies the creation and destruction of the mdio device associated with xpcs. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 9a5d500cffdb3652215172b7c5829ca7b41e9efe Author: Russell King (Oracle) Date: Fri May 26 11:14:29 2023 +0100 net: pcs: xpcs: add xpcs_create_mdiodev() Add xpcs_create_mdiodev() to simplify the creation of the mdio device associated with the XPCS. In order to allow xpcs_destroy() to clean this up, we need to arrange for xpcs_create() to take a refcount on the mdiodev, and xpcs_destroy() to put it. Adding the refcounting to xpcs_create()..xpcs_destroy() will be transparent to existing users of these interfaces. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit c4933fa88a68c69205753601044949d516c4db10 Author: Russell King (Oracle) Date: Fri May 26 11:14:24 2023 +0100 net: mdio: add mdio_device_get() and mdio_device_put() Add two new operations for a mdio device to manage the refcount on the underlying struct device. This will be used by mdio PCS drivers to simplify the creation and destruction handling, making it easier for users to get it correct. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit fe971f9163b67b5338dfe4a0e4ce1cfa1b6cd325 Author: Takashi Sakamoto Date: Tue May 30 08:12:40 2023 +0900 firewire: cdev: implement new event relevant to phy packet with time stamp In 1394 OHCI, the OUTPUT_LAST descriptor of Asynchronous Transmit (AT) context has timeStamp field, in which 1394 OHCI controller record the isochronous cycle when the packet was sent for the request subaction. Additionally, the trailing quadlet of Asynchronous Receive (AR) context has timeStamp field as well in which 1394 OHCI controller record the isochronous cycle when the packet arrived. The time stamps are also available for the cases to send and receive phy packet. This commit implements new events with time stamp field for user space. Link: https://lore.kernel.org/r/20230529113406.986289-13-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit e27b3939128a1d99a4c84f35e4f3897dae73ccd0 Author: Takashi Sakamoto Date: Tue May 30 08:12:40 2023 +0900 firewire: cdev: add new event to notify phy packet with time stamp This commit adds new event to notify event of phy packet with time stamp field. Unlike the fw_cdev_event_request3 and fw_cdev_event_response2, the size of new structure, fw_cdev_event_phy_packet2, is multiples of 8, thus padding is not required to keep the same size between System V ABI for different architectures. It is noticeable that for the case of ping request 1394 OHCI controller does not record the isochronous cycle at which the packet was sent for the request subaction. Instead, it records round-trip count measured by hardware at 42.195 MHz resolution. Cc: kunit-dev@googlegroups.com Link: https://lore.kernel.org/r/20230529113406.986289-12-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 1ef147710b54d47f4108c802d8ee6f3d27fe922d Author: Takashi Sakamoto Date: Tue May 30 08:12:40 2023 +0900 firewire: cdev: code refactoring to dispatch event for phy packet In 1394 OHCI, both Asynchronous Transmit (AT) and Asynchronous Receive (AR) contexts are used to deliver the phy packet of IEEE 1394. The time stamp is available as well as the usual asynchronous transaction. This commit is a preparation for future commit to handle the time stamp. Link: https://lore.kernel.org/r/20230529113406.986289-11-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit d8527cab6c311da34193b7c04f4d363fc2d72458 Author: Takashi Sakamoto Date: Tue May 30 08:12:40 2023 +0900 firewire: cdev: implement new event to notify response subaction with time stamp The callback function now receives an argument for time stamps relevant to asynchronous transaction. This commit implements a new event to notify response subaction with the time stamps for user space. Link: https://lore.kernel.org/r/20230529113406.986289-10-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit fc2b52cf2e0e48938b65e20fae7099e54ef74c76 Author: Takashi Sakamoto Date: Tue May 30 08:12:40 2023 +0900 firewire: cdev: add new event to notify response subaction with time stamp This commit adds new event to notify event of response subaction with time stamp field. Current compiler implementation of System V ABI selects one of structure members which has the maximum alignment size in the structure to decide the size of structure. In the case of fw_cdev_event_request3 structure, it is closure member which has 8 byte storage. The size of alignment for the type of 8 byte storage differs depending on architectures; 4 byte for i386 architecture and 8 byte for the others including x32 architecture. It is inconvenient to device driver developer to use structure layout which varies between architectures since the developer takes care of ioctl compat layer. This commit adds 32 bit member for padding to keep the size of structure as multiples of 8. Cc: kunit-dev@googlegroups.com Link: https://lore.kernel.org/r/20230529113406.986289-9-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 147e9d3af34a92ff567c58b0e89099d26787faba Author: Takashi Sakamoto Date: Tue May 30 08:12:40 2023 +0900 firewire: cdev: code refactoring to operate event of response This commit is a preparation to handle time stamp of asynchronous transaction for user space application. Link: https://lore.kernel.org/r/20230529113406.986289-8-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 39ce342c3a4b763d774c531323d6573af389f332 Author: Takashi Sakamoto Date: Tue May 30 08:12:40 2023 +0900 firewire: core: implement variations to send request and wait for response with time stamp In the previous commit, the core function of Linux FireWire subsystem was changed for two cases to operate asynchronous transaction with or without time stamp. This commit changes kernel API for the two cases. Current kernel API, fw_send_request(), is changed to be static inline function to call __fw_send_request(), which receives two argument for union and flag of callback function. The new kernel API, fw_send_request_with_tstamp() is also added as static inline function, too. When calling, the two arguments are copied to internal structure, then used in softIRQ context. Link: https://lore.kernel.org/r/20230529113406.986289-7-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit dcadfd7f7c74ef9ee415e072a19bdf6c085159eb Author: Takashi Sakamoto Date: Tue May 30 08:12:40 2023 +0900 firewire: core: use union for callback of transaction completion In 1394 OHCI, the OUTPUT_LAST descriptor of Asynchronous Transmit (AT) request context has timeStamp field, in which 1394 OHCI controller record the isochronous cycle when the packet was sent for the request subaction. Additionally, for the case of split transaction in IEEE 1394, Asynchronous Receive (AT) request context is used for response subaction to finish the transaction. The trailer quadlet of descriptor in the context has timeStamp field, in which 1394 OHCI controller records the isochronous cycle when the packet arrived. Current implementation of 1394 OHCI controller driver stores values of both fields to internal structure as time stamp, while Linux FireWire subsystem provides no way to access to it. When using asynchronous transaction service provided by the subsystem, callback function is passed to kernel API. The prototype of callback function has the lack of argument for the values. This commit adds a new callback function for the purpose. It has an additional argument to point to the constant array with two elements. For backward compatibility to kernel space, a new union is also adds to wrap two different prototype of callback function. The fw_transaction structure has the union as a member and a boolean flag to express which function callback is available. The core function is changed to handle the two cases; with or without time stamp. For the error path to process transaction, the isochronous cycle is computed by current value of CYCLE_TIMER register in 1394 OHCI controller. Especially for the case of timeout of split transaction, the expected isochronous cycle is computed. Link: https://lore.kernel.org/r/20230529113406.986289-6-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 865efffb2d11402bc6f96c7e390b89384e9d209d Author: Takashi Sakamoto Date: Tue May 30 08:12:40 2023 +0900 firewire: cdev: implement new event to notify request subaction with time stamp In 1394 OHCI, the trailer quadlet of descriptor in Asynchronous Receive (AR) request context has timeStamp field, in which the 1394 OHCI controller record the isochronous cycle when the packet arrived. Current implementation of 1394 OHCI controller driver stores the value of field to internal structure as time stamp, while the implementation of FireWire character device doesn't have a field for the time stamp, thus it is not available in user space. The time stamp is convenient to some kind of application in which data from several sources are compared in isochronous cycle unit. This commit implement the new event, fw_cdev_event_request3, with an additional field, tstamp. Link: https://lore.kernel.org/r/20230529113406.986289-5-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 7c22d4a92bb26f2357b27446138c8be54f88caed Author: Takashi Sakamoto Date: Tue May 30 08:12:39 2023 +0900 firewire: cdev: add new event to notify request subaction with time stamp This commit adds new event to notify event of request subaction with time stamp field. Current compiler implementation of System V ABI selects one of structure members which has the maximum alignment size in the structure to decide the size of structure. In the case of fw_cdev_event_request3 structure, it is closure member which has 8 byte storage. The size of alignment for the type of 8 byte storage differs depending on architectures; 4 byte for i386 architecture and 8 byte for the others including x32 architecture. It is inconvenient to device driver developer to use structure layout which varies between architectures since the developer takes care of ioctl compat layer. This commit adds 32 bit member for padding to keep the size of structure as multiples of 8. Cc: kunit-dev@googlegroups.com Link: https://lore.kernel.org/r/20230529113406.986289-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 6add87e9764dd308006b078cbdbf36d5a611cc9b Author: Takashi Sakamoto Date: Tue May 30 08:12:39 2023 +0900 firewire: cdev: add new version of ABI to notify time stamp at request/response subaction of transaction This commit adds new version of ABI for future new events with time stamp for request/response subaction of asynchronous transaction to user space. Link: https://lore.kernel.org/r/20230529113406.986289-3-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit dc7c51638f4660cc6c72b5c8151970341b6d9587 Author: Takashi Sakamoto Date: Tue May 30 08:12:39 2023 +0900 firewire: add KUnit test to check layout of UAPI structures In future commits, some new structure will be added to express new type of event. They are exposed to user space as the part of UAPI. It is likely to get trouble in ioctl compatibility layer for 32 bit binaries in 64 bit host machine since the layout of structure could differ depending on System V ABI for these architectures. Actually the subsystem already got such trouble at v2.6.27. It is preferable to decide the layout of structure carefully so that the layer is free from such trouble. This commit utilizes KUnit framework to check the layout of structure for the purpose. A test is added for the existent issue. Cc: kunit-dev@googlegroups.com Link: https://lore.kernel.org/r/20230529113406.986289-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 0ebee0a6f73e7169fb2ee59587aad2880438485a Author: Dan Carpenter Date: Tue May 23 13:27:28 2023 +0300 interconnect: qcom: rpm: allocate enough data in probe() This was not allocating enough bytes. There are two issue here. First, there was a typo where it was taking the size of the pointer instead of the size of the struct, "sizeof(qp->intf_clks)" vs "sizeof(*qp->intf_clks)". Second, it's an array of "cd_num" clocks so we need to allocate space for more than one element. Fixes: 2e2113c8a64f ("interconnect: qcom: rpm: Handle interface clocks") Signed-off-by: Dan Carpenter Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/e0fa275c-ae63-4342-9c9e-0ffaf6314da1@kili.mountain Signed-off-by: Georgi Djakov commit e81a16e77259294cd4ff0a9c1fbe5aa0e311a47d Author: Luca Weiss Date: Mon May 29 10:41:15 2023 +0200 soc: qcom: ocmem: Add OCMEM hardware version print It might be useful to know what hardware version of the OCMEM block the SoC contains. Add a debug print for that. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230509-ocmem-hwver-v3-1-e51f3488e0f4@z3ntu.xyz commit 154f23a8d70cd39158cfdcfb71c112f687352da4 Author: Stephan Gerhold Date: Mon May 29 14:47:03 2023 +0200 arm64: dts: qcom: msm8916: Move aliases to boards MSM8939 has the aliases defined separately for each board (because there could be (theoretically) a board where the slots are numbered differently. To make MSM8916 and MSM8939 more consistent do the same for all MSM8916 boards and move aliases there. Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230525-msm8916-labels-v1-6-bec0f5fb46fb@gerhold.net commit 274cf2bdd6c94da2bf293f5a6c9a5f712dd4b01e Author: Stephan Gerhold Date: Mon May 29 14:47:02 2023 +0200 arm64: dts: qcom: pm8916: Rename &wcd_codec -> &pm8916_codec All definitions in pm8916.dtsi use the &pm8916_ label prefix, only the codec uses the &wcd_codec label. &wcd_codec is confusing because the codec on MSM8916 is split into a "wcd-digital" and "wcd-analog" part and both could be described with &wcd_codec. Let's just name it &pm8916_codec so it's consistent with all other PMIC device nodes. Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230525-msm8916-labels-v1-5-bec0f5fb46fb@gerhold.net commit 835f939501769253eb7eb2dc5389b8592a63a3ed Author: Stephan Gerhold Date: Mon May 29 14:47:01 2023 +0200 arm64: dts: qcom: msm8916/39: Clean up MDSS labels Right now MDSS related definitions cannot be properly grouped together in board DTs because the labels do not use consistent prefixes. The DSI PHY label is particularly weird because the DSI number is at the end (&dsi_phy0) while DSI itself is called &dsi0. Follow the example of more recent SoCs and give all the MDSS related nodes a consistent label that allows proper grouping. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230525-msm8916-labels-v1-4-bec0f5fb46fb@gerhold.net commit fdfc21f65023dbbfe11dcd8f106230668ba8d9e5 Author: Stephan Gerhold Date: Mon May 29 14:47:00 2023 +0200 arm64: dts: qcom: msm8916/39: Use consistent name for I2C/SPI pinctrl Make the labels for the BLSP I2C/SPI pinctrl consistent with the one used for UART by adding the missing blsp_ prefix. This allows having them properly grouped together. The nodes are only reordered in msm8939.dtsi for now since the pinctrl definitions in msm8916-pins.dtsi are currently still unordered anyway. (I will try fixing this in a future patch.) Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230525-msm8916-labels-v1-3-bec0f5fb46fb@gerhold.net commit c310ca82e229124e7b373125d82ea8fdbf2f9f81 Author: Stephan Gerhold Date: Mon May 29 14:46:59 2023 +0200 arm64: dts: qcom: msm8916/39: Rename &blsp1_uartN -> &blsp_uartN For some reason the BLSP UART controllers have a label with a number behind blsp (&blsp1_uartN) while I2C/SPI are named without (&blsp_i2cN). This is confusing, especially for proper node ordering in board DTs. Right now all board DTs are ordered as if the number behind blsp does not exist (&blsp_i2cN comes before &blsp1_uartN). Strictly speaking correct ordering would be the other way around ('1' comes before '_'). End this confusion by giving the UART controllers consistent labels. There is just one BLSP on MSM8916/39 so the number is redundant. Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230525-msm8916-labels-v1-2-bec0f5fb46fb@gerhold.net commit 41e22c2ff38eaea777f1158071539e659aa7980d Author: Stephan Gerhold Date: Mon May 29 14:46:58 2023 +0200 arm64: dts: qcom: msm8916: Rename &msmgpio -> &tlmm MSM8916 is the only ARM64 Qualcomm SoC that is still using the old &msmgpio name. Change this to &tlmm to avoid confusion. Note that the node ordering does not change because the MSM8916 device trees have pinctrl separated at the bottom (similar to sc7180). Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230525-msm8916-labels-v1-1-bec0f5fb46fb@gerhold.net commit b4d81fab1ed0b302c71a869e5b93d81dfbfd3175 Author: zhengyan Date: Mon May 22 19:06:43 2023 +0800 irqchip/gic-v3: Work around affinity issues on ASR8601 The ASR8601 SoC combines ARMv8.2 CPUs from ARM with a GIC-500, also from ARM. However, the two are incompatible as the former expose an affinity in the form of (cluster, core, thread), while the latter can only deal with (cluster, core). If nothing is done, the GIC simply cannot route interrupts to the CPUs. Implement a workaround that shifts the affinity down by a level, ensuring the delivery of interrupts despite the implementation mismatch. Signed-off-by: zhengyan [maz: rewrote commit message, reimplemented the workaround in a manageable way] Signed-off-by: Marc Zyngier commit 5da80b28bf25c3458c7beb23794ff53622ce7eb4 Author: Thomas Gleixner Date: Fri May 26 21:38:47 2023 +0200 x86/smp: Initialize cpu_primary_thread_mask late Marking primary threads in the cpumask during early boot is only correct in certain configurations, but broken e.g. for the legacy hyperthreading detection. This is due to the complete mess in the CPUID evaluation code which initializes smp_num_siblings only half during early init and fixes it up later when identify_boot_cpu() is invoked. So using smp_num_siblings before identify_boot_cpu() leads to incorrect results. Fixing the early CPU init code to provide the proper data is a larger scale surgery as the code has dependencies on data structures which are not initialized during early boot. Move the initialization of cpu_primary_thread_mask wich depends on smp_num_siblings being correct to an early initcall so that it is set up correctly before SMP bringup. Fixes: f54d4434c281 ("x86/apic: Provide cpu_primary_thread mask") Reported-by: "Kirill A. Shutemov" Signed-off-by: Thomas Gleixner Tested-by: Kirill A. Shutemov Link: https://lore.kernel.org/r/87sfbhlwp9.ffs@tglx commit eaa53a85748d58c4398c5c9acaa8d01d92adbb67 Author: Bhupesh Sharma Date: Tue May 16 20:35:11 2023 +0530 arm64: dts: qcom: qrb4210-rb2: Enable USB node Enable the USB controller and HS/SS PHYs on qrb4210-rb2 board. Reviewed-by: Dmitry Baryshkov Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516150511.2346357-5-bhupesh.sharma@linaro.org commit 9dd5f6dba72928e1f16b259fb1c984f80bfa4120 Author: Bhupesh Sharma Date: Tue May 16 20:35:10 2023 +0530 arm64: dts: qcom: sm6115: Add USB SS qmp phy node Add USB superspeed qmp phy node to dtsi. Make sure that the various board dts files (which include sm4250.dtsi file) continue to work as intended. Reviewed-by: Dmitry Baryshkov Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516150511.2346357-4-bhupesh.sharma@linaro.org commit 42bdf378644b5d0a73bd42c031d4d321ad41047e Author: Frank Wunderlich Date: Sun Feb 5 18:48:33 2023 +0100 arm64: dts: mt7986: set Wifi Leds low-active for BPI-R3 Leds for Wifi are low-active, so add property to devicetree. Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230205174833.107050-1-linux@fw-web.de Signed-off-by: Matthias Brugger commit cfde46c6add54280339f256ae1aeb75560911b85 Author: Frank Wunderlich Date: Fri Apr 21 15:20:45 2023 +0200 arm64: dts: mt7986: add PWM to BPI-R3 Add pwm node and pinctrl to BananaPi R3 devicetree. Signed-off-by: Frank Wunderlich Link: https://lore.kernel.org/r/20230421132047.42166-6-linux@fw-web.de Signed-off-by: Matthias Brugger commit eabb04df46c6ca47efcb02db3285163ab6d603d2 Author: Daniel Golle Date: Fri Apr 21 15:20:44 2023 +0200 arm64: dts: mt7986: add PWM This adds pwm node to mt7986. Signed-off-by: Daniel Golle Signed-off-by: Frank Wunderlich Link: https://lore.kernel.org/r/20230421132047.42166-5-linux@fw-web.de Signed-off-by: Matthias Brugger commit 3c65cbb7c5ebb4247968936899580c7f508ed223 Author: Marc Zyngier Date: Mon May 29 16:21:42 2023 +0100 irqchip/gic-v3: Improve affinity helper The GICv3 driver uses multiple formats for the affinity, all derived from a reading of MPDR_EL1 on one CPU or another. Simplify the handling of these affinity by moving the access to the CPU affinity via cpu_logical_map() inside the helper, and rename it accordingly. This will be helpful to support some more broken hardware. Signed-off-by: Marc Zyngier commit 380d18fb2758058bf4bf037aebfafcf7b7ecbca5 Author: AngeloGioacchino Del Regno Date: Wed May 17 12:11:08 2023 +0200 arm64: mediatek: Propagate chassis-type where possible The chassis-type string identifies the form-factor of the system: add this property to all device trees of devices for which the form factor is known. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230517101108.205654-1-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 492061bfc045d815aa5414c1a5eaf373c2fb89fe Author: Krzysztof Kozlowski Date: Sat Apr 22 00:31:57 2023 +0200 arm64: dts: mediatek: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified properties to fix warnings like: mt7622-rfb1.dtb: l2-cache: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230421223157.115367-1-krzysztof.kozlowski@linaro.org Signed-off-by: Matthias Brugger commit ea6c5f21efecbaa3a14cb21c5bc0e23c84473a11 Author: Douglas Anderson Date: Mon May 15 13:13:54 2023 -0700 arm64: dts: mediatek: mt8195: Add mediatek,broken-save-restore-fw to cherry Firmware shipped on mt8195 Chromebooks is affected by the GICR save/restore issue as described by the patch ("dt-bindings: interrupt-controller: arm,gic-v3: Add quirk for Mediatek SoCs w/ broken FW"). Add the quirk property. Fixes: 5eb2e303ec6b ("arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato") Reviewed-by: Julius Werner Signed-off-by: Douglas Anderson Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230515131353.v2.5.Ia0b6ebbaa351e3cd67e201355b9ae67783c7d718@changeid Signed-off-by: Matthias Brugger commit d72cfbd6fcf7cd02084991eee47ecc9f4b4c1e69 Author: Douglas Anderson Date: Mon May 15 13:13:53 2023 -0700 arm64: dts: mediatek: mt8192: Add mediatek,broken-save-restore-fw to asurada Firmware shipped on mt8192 Chromebooks is affected by the GICR save/restore issue as described by the patch ("dt-bindings: interrupt-controller: arm,gic-v3: Add quirk for Mediatek SoCs w/ broken FW"). Add the quirk property. Fixes: 331fae2fc922 ("arm64: dts: mediatek: Introduce MT8192-based Asurada board family") Reviewed-by: Julius Werner Signed-off-by: Douglas Anderson Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230515131353.v2.4.Ie7e600278ffbed55a1e5a58178203787b1449b35@changeid Signed-off-by: Matthias Brugger commit 42127f578ebde652d1373e0233356fbd351675c4 Author: Douglas Anderson Date: Mon May 15 13:13:52 2023 -0700 arm64: dts: mediatek: mt8183: Add mediatek,broken-save-restore-fw to kukui Firmware shipped on mt8183 Chromebooks is affected by the GICR save/restore issue as described by the patch ("dt-bindings: interrupt-controller: arm,gic-v3: Add quirk for Mediatek SoCs w/ broken FW"). Add the quirk property. Fixes: cd894e274b74 ("arm64: dts: mt8183: Add krane-sku176 board") Reviewed-by: Julius Werner Signed-off-by: Douglas Anderson Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230515131353.v2.3.I525a2ed4260046d43c885ee1275e91707743df1c@changeid Signed-off-by: Matthias Brugger commit 57bf5b2d1002cfd6e8d363fc2caebe415bf33ba4 Author: Jiapeng Chong Date: Fri May 5 14:19:50 2023 +0800 soc: mediatek: mtk-mutex: Remove unnecessary .owner Remove .owner field if calls are used which set it automatically. ./drivers/soc/mediatek/mtk-mutex.c:1054:3-8: No need to set .owner here. The core will do it. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4869 Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20230505061950.25977-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Matthias Brugger commit 58d7dae894f2ce0118a9e0255ee539cd413860a3 Author: AngeloGioacchino Del Regno Date: Mon Apr 24 13:25:23 2023 +0200 arm64: dts: mediatek: cherry: Enable PCI-Express ports for WiFi On the Cherry platform, a MT7621 WiFi+Bluetooth combo is connected over PCI-Express (for WiFi) and USB (for BT): enable the PCIe ports to enable enumerating this chip. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai Reviewed-by: Chen-Yu Tsai Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230424112523.1436926-5-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit f8fdf9ed5bfc4ed900d34d5b075a052c84e8145c Author: AngeloGioacchino Del Regno Date: Mon Apr 24 13:25:21 2023 +0200 arm64: dts: mediatek: mt8195: Assign dp-intf aliases Assign aliases for the primary and secondary dp-intf IP to properly and reliably enable DisplayPort functionality. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai Reviewed-by: Chen-Yu Tsai Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230424112523.1436926-3-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 7b4e372c36fcd33c74ba3cbd65fa534b9c558184 Author: Gao Xiang Date: Sat May 27 04:14:57 2023 +0800 erofs: adapt managed inode operations into folios This patch gets rid of erofs_try_to_free_cached_page() and fold it into .release_folio(). It also moves managed inode operations into zdata.c, which simplifies the code a bit. No logic changes. Signed-off-by: Gao Xiang Reviewed-by: Yue Hu Link: https://lore.kernel.org/r/20230526201459.128169-5-hsiangkao@linux.alibaba.com commit 967c28b23f6c89bb8eef6a046ea88afe0d7c1029 Author: Gao Xiang Date: Sat May 27 04:14:56 2023 +0800 erofs: kill hooked chains to avoid loops on deduplicated compressed images After heavily stressing EROFS with several images which include a hand-crafted image of repeated patterns for more than 46 days, I found two chains could be linked with each other almost simultaneously and form a loop so that the entire loop won't be submitted. As a consequence, the corresponding file pages will remain locked forever. It can be _only_ observed on data-deduplicated compressed images. For example, consider two chains with five pclusters in total: Chain 1: 2->3->4->5 -- The tail pcluster is 5; Chain 2: 5->1->2 -- The tail pcluster is 2. Chain 2 could link to Chain 1 with pcluster 5; and Chain 1 could link to Chain 2 at the same time with pcluster 2. Since hooked chains are all linked locklessly now, I have no idea how to simply avoid the race. Instead, let's avoid hooked chains completely until I could work out a proper way to fix this and end users finally tell us that it's needed to add it back. Actually, this optimization can be found with multi-threaded workloads (especially even more often on deduplicated compressed images), yet I'm not sure about the overall system impacts of not having this compared with implementation complexity. Fixes: 267f2492c8f7 ("erofs: introduce multi-reference pclusters (fully-referenced)") Signed-off-by: Gao Xiang Reviewed-by: Yue Hu Link: https://lore.kernel.org/r/20230526201459.128169-4-hsiangkao@linux.alibaba.com commit 6ab5eed6002edc5a29b683285e90459a7df6ce2b Author: Gao Xiang Date: Sat May 27 04:14:55 2023 +0800 erofs: avoid on-stack pagepool directly passed by arguments On-stack pagepool is used so that short-lived temporary pages could be shared within a single I/O request (e.g. among multiple pclusters). Moving the remaining frontend-related uses into z_erofs_decompress_frontend to avoid too many arguments. Signed-off-by: Gao Xiang Reviewed-by: Yue Hu Link: https://lore.kernel.org/r/20230526201459.128169-3-hsiangkao@linux.alibaba.com commit 05b63d2beb8b0f752d1f5cdd051c8bdbf532cedd Author: Gao Xiang Date: Sat May 27 04:14:54 2023 +0800 erofs: allocate extra bvec pages directly instead of retrying If non-bootstrap bvecs cannot be kept in place (very rarely), an extra short-lived page is allocated. Let's just allocate it immediately rather than do unnecessary -EAGAIN return first and retry as a cleanup. Also it's unnecessary to use __GFP_NOFAIL here since we could gracefully fail out this case instead. Signed-off-by: Gao Xiang Reviewed-by: Yue Hu Link: https://lore.kernel.org/r/20230526201459.128169-2-hsiangkao@linux.alibaba.com commit 56ad9b2110699a80eb5f49413add2bf4b90bb285 Author: Geert Uytterhoeven Date: Tue May 23 17:52:44 2023 +0200 PCI: rcar-host: Remove unused static pcie_base and pcie_dev After the L1 link state transition exception handler rework, the static copies of the remapped PCIe controller address and the PCIe device pointer became unused. Remove them. Link: https://lore.kernel.org/r/f29a8c37bd906dfbe23208cc2b089da17e339a75.1684857051.git.geert+renesas@glider.be Fixes: 6e36203bc14ce147 ("PCI: rcar: Use PCI_SET_ERROR_RESPONSE after read which triggered an exception") Signed-off-by: Geert Uytterhoeven Signed-off-by: Lorenzo Pieralisi Reviewed-by: Yoshihiro Shimoda commit 046895105d9666ab56e86ce8dd9786f8003125c6 Author: Bhupesh Sharma Date: Thu May 18 02:47:53 2023 +0530 usb: misc: eud: Fix indentation issues Fix a couple of indentation issues in EUD driver. Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20230517211756.2483552-4-bhupesh.sharma@linaro.org Signed-off-by: Greg Kroah-Hartman commit f16135918b5f8b510db014ecf0a069e34c02382e Author: Bhupesh Sharma Date: Thu May 18 02:47:51 2023 +0530 usb: misc: eud: Fix eud sysfs path (use 'qcom_eud') The eud sysfs enablement path is currently mentioned in the Documentation as: /sys/bus/platform/drivers/eud/.../enable Instead it should be: /sys/bus/platform/drivers/qcom_eud/.../enable Fix the same. Fixes: 9a1bf58ccd44 ("usb: misc: eud: Add driver support for Embedded USB Debugger(EUD)") Reviewed-by: Konrad Dybcio Acked-by: Manivannan Sadhasivam Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20230517211756.2483552-2-bhupesh.sharma@linaro.org Signed-off-by: Greg Kroah-Hartman commit fba985aaf46391066773f3bf3a08fb6e75b37673 Author: Sebastian Reichel Date: Mon May 22 18:29:37 2023 +0200 usb: host: ohci-platform: increase max clock number to 4 Rockchip RK3588 OHCI requires 4 clocks to be enabled. Acked-by: Alan Stern Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230522162937.53190-4-sebastian.reichel@collabora.com Signed-off-by: Greg Kroah-Hartman commit 06abc973d8e1cd3fcc8250d8bcf28906c8a83ba7 Author: Sebastian Reichel Date: Mon May 22 18:29:36 2023 +0200 dt-bindings: usb: Add RK3588 EHCI Add compatible for RK3588 EHCI. As far as I know it's fully compatible with generic-ehci. Acked-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230522162937.53190-3-sebastian.reichel@collabora.com Signed-off-by: Greg Kroah-Hartman commit 25ff1eeac7547b68a74f4f3b6fa3ce635a4f636f Author: Sebastian Reichel Date: Mon May 22 18:29:35 2023 +0200 dt-bindings: usb: Add RK3588 OHCI Add compatible for RK3588 OHCI. As far as I know it's fully compatible with generic-ohci. Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230522162937.53190-2-sebastian.reichel@collabora.com Signed-off-by: Greg Kroah-Hartman commit db3c4e366287cc2ed7b15e74a85bc5a12f5be4b8 Author: Shenwei Wang Date: Tue May 23 13:44:12 2023 -0500 usb: cdns3: imx: Rework system PM to avoid duplicated operations The current implementation uses the same callbacks for system PM and runtime PM suspend/resume without any state checking. This can cause the clocks to be prepared/unprepared twice, leading to kernel warning issues. This patch resolves the double prepare/unprepare issues by separating the runtime PM and system PM handling. Signed-off-by: Shenwei Wang Reviewed-by: Frank Li Link: https://lore.kernel.org/r/20230523184412.204582-1-shenwei.wang@nxp.com Signed-off-by: Greg Kroah-Hartman commit 622cc875dd2b1e560235e85726c818e58d3541ef Author: Uwe Kleine-König Date: Thu May 18 22:26:36 2023 +0200 usb: host: fhci-hcd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20230518202636.273407-1-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 7126a2aeabae696f73d9497f32c5d212d7311916 Author: Uwe Kleine-König Date: Wed May 17 20:15:28 2023 +0200 usb: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. While touching hd3ss3220.c fix a minor white space issue in the definition of struct hd3ss3220_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517181528.167115-1-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 3124387537bc94251e65c2841062d14736380ec4 Author: Frank Li Date: Thu May 18 16:49:46 2023 -0400 usb: cdns3: optimize OUT transfer by copying only actual received data Previously, the entire length of the request, which is equal to or greater than the actual data, was dma synced and memcpy when using the bounce buffer. Actually only the actual data indicated by request->actual need be synced and copied. Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20230518204947.3770236-2-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman commit 2a1c4639d6d6bcee27f74e38f83ffb43579c4733 Author: Frank Li Date: Thu May 18 16:49:45 2023 -0400 usb: cdns3: improve handling of unaligned address case When the address of a request was not aligned with an 8-byte boundary, the USB DMA was unable to process it, necessitating the use of an internal bounce buffer. In these cases, the request->buf had to be copied to/from this bounce buffer. However, if this unaligned address scenario arises, it is unnecessary to perform heavy cache maintenance operations like usb_gadget_map(unmap)_request_by_dev() on the request->buf, as the DMA does not utilize it at all. it can be skipped at this case. iperf3 tests on the rndis case: Transmit speed (TX): Improved from 299Mbps to 440Mbps Receive speed (RX): Improved from 290Mbps to 500Mbps Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20230518204947.3770236-1-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman commit bfb46b424652a3396b92ca3c96c169ade9b45b8d Author: Minda Chen Date: Thu May 18 19:27:49 2023 +0800 usb: cdns3: Add StarFive JH7110 USB driver Adds Specific Glue layer to support USB peripherals on StarFive JH7110 SoC. There is a Cadence USB3 core for JH7110 SoCs, the cdns core is the child of this USB wrapper module device. Signed-off-by: Minda Chen Acked-by: Peter Chen Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230518112750.57924-7-minda.chen@starfivetech.com Signed-off-by: Greg Kroah-Hartman commit 8486eb8068ccfea99864544327a7d18f8a1e231e Author: Frank Li Date: Wed May 17 11:25:45 2023 -0400 dt-bindings: usb: cdns-imx8qm: add imx8qm cdns3 glue layer NXP imx8qm integrates 1 cdns3 IP. This is glue layer device bindings. Signed-off-by: Frank Li Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230517152545.3404508-2-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman commit 7a053bf2b36622996356018a7a224c20d0ddcea9 Author: Frank Li Date: Wed May 17 11:25:44 2023 -0400 usb: cdns3: imx: simplify clock name usage Simplifies the clock names in imx_cdns3_core_clks[]. Such as, renaming "usb3_lpm_clk" to "lpm". The "usb3" prefix and "clk" suffix were redundant. Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20230517152545.3404508-1-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman commit 6f5bd24f50feef22923af431826e1f74f3ffbf00 Author: Xu Yang Date: Wed May 17 16:19:05 2023 +0800 usb: chipidea: imx: remove one duplicated reg define Remove one duplicated definition of MX7D_USB_OTG_PHY_CFG1. Signed-off-by: Li Jun Signed-off-by: Xu Yang Link: https://lore.kernel.org/r/20230517081907.3410465-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman commit 8e6bd945e6dde64fbc60ec3fe252164493a8d3a2 Author: Arnd Bergmann Date: Tue May 16 22:17:42 2023 +0200 usb: hide unused usbfs_notify_suspend/resume functions The declaration is in an #ifdef, which causes warnings when building with 'make W=1' and without CONFIG_PM: drivers/usb/core/devio.c:742:6: error: no previous prototype for 'usbfs_notify_suspend' drivers/usb/core/devio.c:747:6: error: no previous prototype for 'usbfs_notify_resume' Use the same #ifdef check around the function definitions to avoid the warnings and slightly shrink the USB core. Fixes: 7794f486ed0b ("usbfs: Add ioctls for runtime power management") Signed-off-by: Arnd Bergmann Reviewed-by: Sebastian Reichel Acked-by: Alan Stern Link: https://lore.kernel.org/r/20230516202103.558301-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 342161c11403ea00e9febc16baab1d883d589d04 Author: Li Yang Date: Thu Apr 20 22:08:31 2023 +0800 usb: phy: phy-tahvo: fix memory leak in tahvo_usb_probe() Smatch reports: drivers/usb/phy/phy-tahvo.c: tahvo_usb_probe() warn: missing unwind goto? After geting irq, if ret < 0, it will return without error handling to free memory. Just add error handling to fix this problem. Fixes: 0d45a1373e66 ("usb: phy: tahvo: add IRQ check") Signed-off-by: Li Yang Reviewed-by: Dongliang Mu Link: https://lore.kernel.org/r/20230420140832.9110-1-lidaxian@hust.edu.cn Signed-off-by: Greg Kroah-Hartman commit 93e60cd5e00e63f29e896453e10c7ede4cd8e882 Author: Andy Shevchenko Date: Tue Apr 11 14:48:24 2023 +0300 extcon: Drop unneeded assignments In one case the assignment is duplicative, in the other, it's better to move it into the loop — the user of it. Signed-off-by: Andy Shevchenko Acked-by: Chanwoo Choi Signed-off-by: Chanwoo Choi commit ef753fb4e86607afc6228d8632705122bc67f29a Author: Andy Shevchenko Date: Tue Apr 11 14:48:23 2023 +0300 extcon: Use sizeof(*pointer) instead of sizeof(type) It is preferred to use sizeof(*pointer) instead of sizeof(type). The type of the variable can change and one needs not change the former (unlike the latter). No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit 7bba9e81a6fbf00daa4063c41da6b250d339f43b Author: Andy Shevchenko Date: Tue Apr 11 14:48:22 2023 +0300 extcon: Use unique number for the extcon device ID The use of atomic variable is still racy when we do not control which device has been unregistered and there is a (theoretical) possibility of the overflow that may cause a duplicate extcon device ID number to be allocated next time a device is registered. Replace above mentioned approach by using IDA framework. Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit 566825a31f65da111270abac35662502706e7c8a Author: Andy Shevchenko Date: Wed Mar 22 16:40:02 2023 +0200 extcon: Remove dup device name in the message and unneeded error check The device name is already printed with dev_err(), no need to repeat. The device pointer itself is not supposed to be an error point, drop that check. Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit 9b4aea51cbcaefacaac655392f360bb3929ab63d Author: Andy Shevchenko Date: Wed Mar 22 16:40:01 2023 +0200 extcon: Use dev_of_node(dev) instead of dev->of_node The dev_of_node function should be preferred. In the result we may drop unneeded NULL check of the pointer to the device object. Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit 0146f56b91a8ad287e7c94ea340b95a7040d29cf Author: Andy Shevchenko Date: Wed Mar 22 16:40:00 2023 +0200 extcon: Use device_match_of_node() helper Instead of open coding, use device_match_of_node() helper. Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit 2b5e61f5069c29df7119af683ea1cf3c3f20a4bd Author: Andy Shevchenko Date: Wed Mar 22 16:39:56 2023 +0200 extcon: Amend kernel documentation of struct extcon_dev First of all, the @lock description is missing. Add it. Second, correct the terminator value for the mutual exclusive cabling. Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit 6ee0a22e8694074877550bf4284cc4085f86dd4f Author: Andy Shevchenko Date: Wed Mar 22 16:39:55 2023 +0200 extcon: Use sysfs_emit() to instead of sprintf() Follow the advice of the Documentation/filesystems/sysfs.rst that show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit 6e4e8670c03b4fcac54bca8b62e5465182caeb26 Author: Andy Shevchenko Date: Wed Mar 22 16:39:54 2023 +0200 extcon: Use DECLARE_BITMAP() to declare bit arrays Bit arrays has a specific type helper for the declaration. Use it instead of homegronw equivalent. Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit 73346b9965ebda2feb7fef8629e9b28baee820e3 Author: Andy Shevchenko Date: Wed Mar 22 16:39:53 2023 +0200 extcon: Fix kernel doc of property capability fields to avoid warnings Kernel documentation has to be synchronized with a code, otherwise the validator is not happy: Function parameter or member 'usb_bits' not described in 'extcon_cable' Function parameter or member 'chg_bits' not described in 'extcon_cable' Function parameter or member 'jack_bits' not described in 'extcon_cable' Function parameter or member 'disp_bits' not described in 'extcon_cable' Describe the fields added in the past. Fixes: ceaa98f442cf ("extcon: Add the support for the capability of each property") Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit 7e77e0b7a9f4cdf91cb0950749b40c840ea63efc Author: Andy Shevchenko Date: Wed Mar 22 16:39:52 2023 +0200 extcon: Fix kernel doc of property fields to avoid warnings Kernel documentation has to be synchronized with a code, otherwise the validator is not happy: Function parameter or member 'usb_propval' not described in 'extcon_cable' Function parameter or member 'chg_propval' not described in 'extcon_cable' Function parameter or member 'jack_propval' not described in 'extcon_cable' Function parameter or member 'disp_propval' not described in 'extcon_cable' Describe the fields added in the past. Fixes: 067c1652e7a7 ("extcon: Add the support for extcon property according to extcon type") Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit 65acf9c6539b1bf082bc593a9517ef718335d8aa Author: Arnd Bergmann Date: Wed Mar 22 12:16:51 2023 +0100 extcon: usbc-tusb320: add USB_ROLE_SWITCH dependency When CONFIG_USB_ROLE_SWITCH=m, tusb320 cannot be built-in: ld.lld: error: undefined symbol: fwnode_usb_role_switch_get >>> referenced by extcon-usbc-tusb320.c >>> drivers/extcon/extcon-usbc-tusb320.o:(tusb320_probe) in archive vmlinux.a ld.lld: error: undefined symbol: usb_role_switch_set_role >>> referenced by extcon-usbc-tusb320.c >>> drivers/extcon/extcon-usbc-tusb320.o:(tusb320_state_update_handler) in archive vmlinux.a Add the appropriate Kconfig dependency to prevent this configuration but still allow the driver to be built-in when USB_ROLE_SWITCH is disabled. Fixes: df101446a402 ("extcon: usbc-tusb320: add usb_role_switch support") Signed-off-by: Arnd Bergmann Reviewed-by: Alvin Šipraga Signed-off-by: Chanwoo Choi commit 4a680fcd60d4476236e1b8e34585d480aeda677f Author: Krzysztof Kozlowski Date: Tue May 16 10:34:32 2023 +0200 dt-bindings: usb: usb251xb: correct swap-dx-lanes type to uint32 The "swap-dx-lanes" was never described as uint8 in original TXT bindings and Linux driver expects uint32. Fix the type to match Linux driver expectation. Fixes: fff61d4ccf3d ("dt-bindings: usb: usb251xb: Convert to YAML schema") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Marek Vasut Acked-by: Conor Dooley Reviewed-by: Richard Leitner Link: https://lore.kernel.org/r/20230516083432.18579-1-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit df101446a402bb1bc164f3445d2f028a1dbec6ac Author: Alvin Šipraga Date: Sat Mar 18 16:05:54 2023 +0100 extcon: usbc-tusb320: add usb_role_switch support The connector child node of the TUSB320 device might be linked with a dual-role capable USB controller. Add driver support for detecting a usb_role_switch and setting its state in the typec interrupt handler. This follows similar practice in other drivers in the typec subsystem, which this extcon driver can opt-in to. Signed-off-by: Alvin Šipraga Acked-by: Heikki Krogerus Signed-off-by: Chanwoo Choi commit 18eb81d804c41c98b7e831560ebb933375496529 Author: Alvin Šipraga Date: Sat Mar 18 16:05:53 2023 +0100 extcon: usbc-tusb320: add accessory detection support The TUSB320 can detect the following types of accessory: - Audio Accessory - Audio Accessory with charge-thru - Debug Accessory (DFP) - Debug Accessory (UFP) Moreover, the typec subsystem can be informed of this through the typec_set_mode() function. The information will be propagated to any linked typec muxes. Add the necessary support to the driver. Note that for the Debug Accessory modes, an educated guess was made that for the USB data role, DFP implies HOST and UFP implies DEVICE. But this might want to be made configurable at a later date. Signed-off-by: Alvin Šipraga Acked-by: Heikki Krogerus Signed-off-by: Chanwoo Choi commit 04151575c507e7ea3aa6dee73ff9970d699641d3 Author: Bumwoo Lee Date: Mon Mar 20 12:19:39 2023 +0900 extcon: Add extcon_alloc_groups to simplify extcon register function The alloc groups is functionalized from extcon_dev_register. Signed-off-by: Bumwoo Lee Acked-by: MyungJoo Ham commit 3e70a014abcdf7e795ee7f446dde4160dfe354a4 Author: Bumwoo Lee Date: Mon Mar 20 12:19:38 2023 +0900 extcon: Add extcon_alloc_muex to simplify extcon register function The mutual exclusive part is functionalized from extcon_dev_register. Signed-off-by: Bumwoo Lee Acked-by: MyungJoo Ham commit 3d9138e5bdcf9f0277904441cbf4cb1407ed8603 Author: Bumwoo Lee Date: Mon Mar 20 12:19:37 2023 +0900 extcon: Add extcon_alloc_cables to simplify extcon register function The cable allocation part is functionalized from extcon_dev_register. Signed-off-by: Bumwoo Lee Acked-by: MyungJoo Ham commit 7f4c9bc29ba72c5e3d0f9eaa91cabac9cd3342c9 Author: Bumwoo Lee Date: Thu Mar 2 18:01:40 2023 +0900 extcon: Remove redundant null checking for class create_extcon_class() is already Null checking. Signed-off-by: Bumwoo Lee Acked-by: MyungJoo Ham commit c95fb88fb6e4bd92720a183014d9160e627e4c4b Author: Andy Shevchenko Date: Mon Mar 13 19:41:48 2023 +0900 extcon: palmas: Remove unused of_gpio.h of_gpio.h provides a single function, which is not used in this driver. Remove unused header. Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit fe551bc9dcc6a557831dfe1544c1653ab24347a6 Author: Bryan O'Donoghue Date: Wed Dec 28 13:30:58 2022 +0000 extcon: qcom-spmi: Switch to platform_get_irq_byname_optional Valid configurations for the extcon interrupt declarations are - usb_id - usb_vbus - (usb_id | usb_vbus) In the case of a standalone usb_id or usb_vbus failure to find one of the interrupts shouldn't generate a warning message. A warning is already in place if both IRQs are missing. Switch to using platform_get_irq_byname_optional() in order to facilitate this behaviour. Suggested-by: Marijn Suijten Signed-off-by: Bryan O'Donoghue Reviewed-by: Marijn Suijten Signed-off-by: Chanwoo Choi commit 347774f7fc34448a44df3933164520b521791128 Author: Bryan O'Donoghue Date: Wed Dec 28 13:30:57 2022 +0000 dt-bindings: pm8941-misc: Fix usb_id and usb_vbus definitions dts validation is throwing an error for me on 8916 and 8939 with extcon@1300. In that case we have usb_vbus but not usb_id. It wasn't immediately obvious if there was a valid use-case for the existing code for usb_id in isolation, however discussing further, we concluded that usb_id, usb_vbus or (usb_id | usb_vbus) are valid combinations as an external IC may be responsible for usb_id or usb_vbus. Expand the definition with anyOf to capture the three different valid modes. Fixes: 4fcdd677c4ea ("bindings: pm8941-misc: Add support for VBUS detection") Reviewed-by: Rob Herring Reviewed-by: Marijn Suijten Signed-off-by: Bryan O'Donoghue Signed-off-by: Chanwoo Choi commit 33ea262b2b693c63df5f6de96ae81c39f2648836 Author: Luca Weiss Date: Wed Dec 28 22:46:37 2022 +0100 dt-bindings: pm8941-misc: rename misc node name The spmi-pmic bindings is now using usb-detect@ for this node, so adjust the example to match. Acked-by: Rob Herring Reviewed-by: Neil Armstrong Signed-off-by: Luca Weiss Signed-off-by: Chanwoo Choi commit 07c8eb325f29a4a967f939b9fe6cce09f35e25e9 Author: Andy Shevchenko Date: Mon Jan 2 22:29:19 2023 +0200 extcon: axp288: Replace open coded acpi_dev_put() Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put(). Signed-off-by: Andy Shevchenko Signed-off-by: Chanwoo Choi commit 3adbaa30d973093a4f37927baf9596cca51b593d Author: Alvin Šipraga Date: Wed Mar 15 15:15:47 2023 +0100 extcon: usbc-tusb320: Unregister typec port on driver removal The driver can register a typec port if suitable firmware properties are present. But if the driver is removed through sysfs unbind, rmmod or similar, then it does not clean up after itself and the typec port device remains registered. This can be seen in sysfs, where stale typec ports get left over in /sys/class/typec. In order to fix this we have to add an i2c_driver remove function and call typec_unregister_port(), which is a no-op in the case where no typec port is created and the pointer remains NULL. In the process we should also put the fwnode_handle when the typec port isn't registered anymore, including if an error occurs during probe. The typec subsystem does not increase or decrease the reference counter for us, so we track it in the driver's private data. Note that the conditional check on TYPEC_PWR_MODE_PD was removed in the probe path because a call to tusb320_set_adv_pwr_mode() will perform an even more robust validation immediately after, hence there is no functional change here. Fixes: bf7571c00dca ("extcon: usbc-tusb320: Add USB TYPE-C support") Cc: stable@vger.kernel.org Signed-off-by: Alvin Šipraga Signed-off-by: Chanwoo Choi commit dc54ce3e603b0cde997465a4511fae41c0447bab Author: Niklas Schnelle Date: Mon May 22 12:50:42 2023 +0200 usb: uhci: handle HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to guard sections of code calling them as alternative access methods with CONFIG_HAS_IOPORT checks. For uhci-hcd there are a lot of I/O port uses that do have MMIO alternatives all selected by uhci_has_pci_registers() so this can be handled by UHCI_IN/OUT macros and making uhci_has_pci_registers() constant 0 if CONFIG_HAS_IOPORT is unset. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Reviewed-by: Alan Stern Link: https://lore.kernel.org/r/20230522105049.1467313-38-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 04c3140312693a939ae55c8e368b79a0b8475c82 Author: Chen-Yu Tsai Date: Mon Apr 24 18:04:09 2023 +0800 arm64: dts: mediatek: mt8192-asurada-hayato: Enable Bluetooth Hayato's Realtek WiFi/BT module has it's Bluetooth function wired to UART1. Add and enable the relevant device nodes for it. Signed-off-by: Chen-Yu Tsai Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20230424100409.2992418-1-wenst@chromium.org Signed-off-by: Matthias Brugger commit be3d5a493b666a8faed8c08ece0fce7a9c9cc741 Author: Niklas Schnelle Date: Mon May 22 12:50:41 2023 +0200 usb: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-37-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit a83bfdca8b2098999e3edfb87e98925e019eb818 Author: Sukrut Bellary Date: Thu May 18 01:40:33 2023 -0700 PM / devfreq: mtk-cci: Fix variable deferencing before NULL check smatch warning: drivers/devfreq/mtk-cci-devfreq.c:135 mtk_ccifreq_target() warn: variable dereferenced before check 'drv' (see line 130) This is based on static analysis only. Compilation tested. Signed-off-by: Sukrut Bellary Signed-off-by: Chanwoo Choi commit ccb69e228ea48f8ea1e4a7dfeedf501329a9fdf4 Author: Marek Szyprowski Date: Thu May 18 09:44:03 2023 +0200 PM / devfreq: exynos: add Exynos PPMU as a soft module dependency Commit adf8238ef403 ("ARM: dts: exynos: move exynos-bus nodes out of soc in Exynos4412") changed the order of the exynos-bus nodes, what results in different probe order of the Exynos Bus devices. Although the driver properly handles the deferred probe and all devices seems to be finally properly registered, this change revealed some kind of a bug related to PPMU counters registration and passive governor operation. Usually in 1 of 10 boots this results in complete board freeze during loading of the kernel modules. To avoid that freeze, ensure that the Exynos PPMU driver is already loaded before the Exynos Bus driver starts probing. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 983f37ee08acb60435744f1b1e2afea2d2a09c48 Author: Daniel Golle Date: Wed Apr 19 20:16:29 2023 +0100 arm64: dts: mt7622: handle interrupts from MT7531 switch on BPI-R64 Since commit ba751e28d442 ("net: dsa: mt7530: add interrupt support") the mt7530 driver can act as an interrupt controller. Wire up irq line of the MT7531 switch on the BananaPi BPi-R64 board, so the status of the PHYs of the five 1000Base-T ports doesn't need to be polled any more. Signed-off-by: Daniel Golle Link: https://lore.kernel.org/r/ZEA-DV_OsmFg5egL@makrotopia.org Signed-off-by: Matthias Brugger commit 4a3a2c32a5ee163bc8f195b04751f165aa4d9c83 Author: Christophe JAILLET Date: Mon May 8 09:42:15 2023 +0200 PM / devfreq: Reorder fields in 'struct devfreq_dev_status' Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct devfreq_dev_status' from 72 to 64 bytes. This structure is used both to allocate static variables or is embedded in some other structures. In both cases, reducing its size is nice to have. Moreover, the whole structure now fits in a single cache line on x86_64. Finally, it makes the order of code match the order of the above kernel doc. Signed-off-by: Christophe JAILLET Acked-by: MyungJoo Ham Signed-off-by: Chanwoo Choi commit d278f43f25beedfd0cb784d1dd0a9e7e8c8f123f Author: Daniel Golle Date: Wed Apr 19 20:15:53 2023 +0100 arm64: dts: mt7622: declare SPI-NAND present on BPI-R64 The SPI-NOR node in the device tree of the BananaPi R64 has most likely been copied from the reference board's device tree even though the R64 comes with an SPI-NAND chip rather than SPI-NOR. Setup the Serial NAND Flash Interface (SNFI) controller, enable hardware BCH error detection and correction engine and add the SPI-NAND chip including basic partitions, Signed-off-by: Daniel Golle Link: https://lore.kernel.org/r/ZEA96dmaXqTpk8u8@makrotopia.org Signed-off-by: Matthias Brugger commit c3ff12a92bd7072170978b8b41c2fa41b038139a Author: Avichal Rakesh Date: Mon May 8 16:11:03 2023 -0700 usb: gadget: uvc: queue empty isoc requests if no video buffer is available ISOC transfers expect a certain cadence of requests being queued. Not keeping up with the expected rate of requests results in missed ISOC transfers (EXDEV). The application layer may or may not produce video frames to match this expectation, so uvc gadget driver must handle cases where the application is not queuing up buffers fast enough to fulfill ISOC requirements. Currently, uvc gadget driver waits for new video buffer to become available before queuing up usb requests. With this patch the gadget driver queues up 0 length usb requests whenever there are no video buffers available. The USB controller's complete callback is used as the limiter for how quickly the 0 length packets will be queued. Video buffers are still queued as soon as they become available. Link: https://lore.kernel.org/CAMHf4WKbi6KBPQztj9FA4kPvESc1fVKrC8G73-cs6tTeQby9=w@mail.gmail.com/ Signed-off-by: Avichal Rakesh Link: https://lore.kernel.org/r/20230508231103.1621375-1-arakesh@google.com Signed-off-by: Greg Kroah-Hartman commit e5990469943c711cb00bfde6338d2add6c6d0bfe Author: Prashanth K Date: Tue May 9 18:57:52 2023 +0530 usb: gadget: u_serial: Avoid spinlock recursion in __gs_console_push When serial console over USB is enabled, gs_console_connect queues gs_console_work, where it acquires the spinlock and queues the usb request, and this request goes to gadget layer. Now consider a situation where gadget layer prints something to dmesg, this will eventually call gs_console_write() which requires cons->lock. And this causes spinlock recursion. Avoid this by excluding usb_ep_queue from the spinlock. spin_lock_irqsave //needs cons->lock gs_console_write . . _printk __warn_printk dev_warn/pr_err . . [USB Gadget Layer] . . usb_ep_queue gs_console_work __gs_console_push // acquires cons->lock process_one_work Signed-off-by: Prashanth K Link: https://lore.kernel.org/r/1683638872-6885-1-git-send-email-quic_prashk@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 2f6ecb89fe8feb2b60a53325b0eeb9866d88909a Author: Prashanth K Date: Fri May 5 14:48:37 2023 +0530 usb: gadget: u_serial: Add null pointer check in gserial_suspend Consider a case where gserial_disconnect has already cleared gser->ioport. And if gserial_suspend gets called afterwards, it will lead to accessing of gser->ioport and thus causing null pointer dereference. Avoid this by adding a null pointer check. Added a static spinlock to prevent gser->ioport from becoming null after the newly added null pointer check. Fixes: aba3a8d01d62 ("usb: gadget: u_serial: add suspend resume callbacks") Signed-off-by: Prashanth K Link: https://lore.kernel.org/r/1683278317-11774-1-git-send-email-quic_prashk@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 24520e51fffb56f3931084b1426cb2404bda095a Author: Bryan O'Donoghue Date: Mon May 15 14:36:35 2023 +0100 dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add orientation-switch as optional orientation-switch it the standard declaration to inform the Type-C mux layer that a remote-endpoint is capable of processing orientation change messages. Add as an optional since not all versions of the dp-phy currently support the orientation-switch. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230515133643.3621656-4-bryan.odonoghue@linaro.org Signed-off-by: Greg Kroah-Hartman commit 581d79f7deedac1f45edbbf1e185f5e601565426 Author: Bryan O'Donoghue Date: Mon May 15 14:36:34 2023 +0100 dt-bindings: regulator: qcom,usb-vbus-regulator: Mark regulator-*-microamp required The VBUS driver needs to know the regulator-min-microamp and regulator-max-microamp so they should both be marked as required. regulator.yaml defines those two dependencies so include regulator.yaml. We need to change from additionalProperties: false to unevaluatedProperties: false. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230515133643.3621656-3-bryan.odonoghue@linaro.org Signed-off-by: Greg Kroah-Hartman commit 4c186faa7bb36d457939dd5bd4b8e6d5f9251cd6 Author: Bryan O'Donoghue Date: Mon May 15 14:36:33 2023 +0100 dt-bindings: regulator: qcom,usb-vbus-regulator: Mark reg as required The regulator code needs to know the location of the register to write to to switch on/off. Right now we have a driver that does this, a yaml that partially describes it and no dts that uses it. Switching on the VBUS for sm8250 shows that we haven't documented reg as a required property, do so now. Acked-by: Krzysztof Kozlowski Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230515133643.3621656-2-bryan.odonoghue@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3524fe31538c1a1de1da2571b1f313f9469edf51 Author: Heikki Krogerus Date: Fri May 26 16:14:34 2023 +0300 usb: typec: mux: Remove alt mode parameters from the API The alt mode descriptor parameters are not used anymore. Signed-off-by: Heikki Krogerus Reviewed-by: Bjorn Andersson Tested-by: Bjorn Andersson Acked-by: Prashant Malani Link: https://lore.kernel.org/r/20230526131434.46920-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 4aebc4f89f00a4cbfb0142c619e181f260e36546 Author: Heikki Krogerus Date: Fri May 26 16:14:33 2023 +0300 usb: typec: mux: Clean up mux_fwnode_match() Removing the "svid" and "accessory" device property checks. Those properties are not supported on any platform. Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/lkml/20230522215348.uoyboow26n2o3tel@ripper/ Reviewed-by: Bjorn Andersson Tested-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526131434.46920-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 3c90c5a7fd425daaa62c4f82b4699aabd8e4edaa Author: Min-Hua Chen Date: Wed May 24 00:23:12 2023 +0800 usb: typec: ucsi: correctly access opcode hdr->opcode is __le32 type, use le32_to_cpu() to cast opcode to integer in the switch..case statement to fix the following sparse warnings: drivers/usb/typec/ucsi/ucsi_glink.c:248:20: sparse: warning: restricted __le32 degrades to integer drivers/usb/typec/ucsi/ucsi_glink.c:248:20: sparse: warning: restricted __le32 degrades to integer drivers/usb/typec/ucsi/ucsi_glink.c:248:20: sparse: warning: restricted __le32 degrades to integer No functional change. Signed-off-by: Min-Hua Chen Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230523162314.114274-1-minhuadotchen@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7b7efc925042ef72f8a64a14226a76e8c98c7732 Author: Mario Limonciello Date: Thu May 18 11:11:50 2023 -0500 usb: typec: ucsi: Mark dGPUs as DEVICE scope power_supply_is_system_supplied() checks whether any power supplies are present that aren't batteries to decide whether the system is running on DC or AC. Downstream drivers use this to make performance decisions. Navi dGPUs include an UCSI function that has been exported since commit 17631e8ca2d3 ("i2c: designware: Add driver support for AMD NAVI GPU"). This UCSI function registers a power supply since commit 992a60ed0d5e ("usb: typec: ucsi: register with power_supply class") but this is not a system power supply. As the power supply for a dGPU is only for powering devices connected to dGPU, create a device property to indicate that the UCSI endpoint is only for the scope of `POWER_SUPPLY_SCOPE_DEVICE`. Link: https://lore.kernel.org/lkml/20230516182541.5836-2-mario.limonciello@amd.com/ Reviewed-by: Evan Quan Tested-by: Evan Quan Signed-off-by: Mario Limonciello Reviewed-by: Heikki Krogerus Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230518161150.92959-1-mario.limonciello@amd.com Signed-off-by: Greg Kroah-Hartman commit 097fb3ee710d4de83b8d4f5589e8ee13e0f0541e Author: Vladislav Efanov Date: Wed May 17 20:25:18 2023 +0300 usb: dwc3: qcom: Fix potential memory leak Function dwc3_qcom_probe() allocates memory for resource structure which is pointed by parent_res pointer. This memory is not freed. This leads to memory leak. Use stack memory to prevent memory leak. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI") Signed-off-by: Vladislav Efanov Acked-by: Shawn Guo Link: https://lore.kernel.org/r/20230517172518.442591-1-VEfanov@ispras.ru Signed-off-by: Greg Kroah-Hartman commit c722576b2454c44934e27bd73fdf828e720fb237 Author: Tom Rix Date: Mon May 15 07:40:43 2023 -0400 usb: typec: qcom: set pm8150b_typec_res storage-class-specifier to static smatch reports drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:323:29: warning: symbol 'pm8150b_typec_res' was not declared. Should it be static? This variable is only used in its defining file, so it should be static Signed-off-by: Tom Rix Reviewed-by: Bryan O'Donoghue Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230515114043.3452010-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman commit 06042d7b32a71c6a423948f8c7fd4bd13572bdf3 Author: Uwe Kleine-König Date: Wed May 3 19:36:22 2023 +0200 usbip: Use _FORTIFY_SOURCE=2 instead of (implicitly) =1 _FORTIFY_SOURCE=2 uses more and stricter checks. This is what e.g. Debian recommends to build packages with. While at it fix a typo in the output of ./configure --help. Signed-off-by: Uwe Kleine-König Reviewed-By: Hongren Zheng Link: https://lore.kernel.org/r/20230503173622.1072787-1-ukleinek@debian.org Signed-off-by: Greg Kroah-Hartman commit 0c7f35d26b1dc45ab27e3ea8ff7f6a8a88a18174 Author: Galen Guyer Date: Mon May 8 17:21:20 2023 -0400 usbip: give a more helpful error message if vhdi_hcd isn't loaded Suggest loading vhdi_hcd if it's not loaded to make error message less opaque Signed-off-by: Galen Guyer Reviewed-By: Hongren Zheng Acked-by: Shuah Khan Link: https://lore.kernel.org/r/20230508212120.435329-1-galen@galenguyer.com Signed-off-by: Greg Kroah-Hartman commit 0f2c1f801a67ec2dc01efc10f2ea78ce06c35602 Author: Alexander Usyskin Date: Mon May 22 13:12:10 2023 +0300 mei: bus-fixup: fix buffer type The __mei_cl_recv and __mei_cl_send accepts u8 buffer. Fix buffer type from char to u8. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20230522101210.2207395-2-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 783aa47033a22cad9ed7ffdbb337dcfbf7acc65b Author: Alexander Usyskin Date: Mon May 22 13:12:09 2023 +0300 mei: bus: drop useless cldev null check cldev cannot be NULL when derived with to_mei_cl_device(). Drop useless NULL-checks. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20230522101210.2207395-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 128f20c018661439dca8afa523ac066e1a4210ad Author: Niklas Schnelle Date: Tue May 16 13:00:13 2023 +0200 misc: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230516110038.2413224-18-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit f050bb8f56c6417c0f7ec18d32e709a9c97b57d4 Author: Uwe Kleine-König Date: Thu May 18 00:01:35 2023 +0200 misc: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. While touching these drivers, fix alignment in apds990x.c and bh1770glc.c. Signed-off-by: Uwe Kleine-König Reviewed-by: Luca Ceresoli Reviewed-by: Jean Delvare Link: https://lore.kernel.org/r/20230517220135.170379-1-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 3ba589b5fe684305bf23c1c7e27bb93d4b9552cf Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:14 2023 +0200 dt-bindings: phy: mediatek,dsi-phy: Add compatible for MT6795 Helio X10 Add a compatible string for MediaTek Helio X10 MT6795: this SoC uses the same DSI PHY as MT8173. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Reviewed-by: Alexandre Mergnat Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230412112739.160376-3-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 5a65dcccf483c59bf87beadbf64196b4faa2b993 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:37 2023 +0200 arm64: dts: mediatek: mt6795-xperia-m5: Add eMMC, MicroSD slot, SDIO Configure and enable the MMC0/1/2 controllers, used for the eMMC chip, MicroSD card slot and SDIO (WiFi) respectively. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230412112739.160376-26-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit e83a6b4bd66db07ea76b829c21a20c2b3a3aa53f Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:36 2023 +0200 arm64: dts: mediatek: mt6795-xperia-m5: Add MT6331 Combo PMIC This smartphone uses the Helio X10 standard MT6331+MT6332 combo PMICs: include the mt6331 devicetree and add the required interrupt. Note that despite there being two interrupts, one for MT6331 and one for MT6332, in configurations using the companion PMIC, the interrupt of the latter fires for both events on MT6331 and for ones on MT6332, while the interrupt for the main PMIC fires only for events of the main PMIC. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230412112739.160376-25-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit aef783f3e0cab893371fb5a3701bba41d1fffc94 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:35 2023 +0200 arm64: dts: mediatek: Add MT6331 PMIC devicetree MT6331 is the primary PMIC for the MediaTek Helio X10 MT6795 smartphone platforms: add a devicetree describing its regulators, Real Time Clock and PMIC-keys. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230412112739.160376-24-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit c01a6cc6fdf805c8992c1d94fddd6486a5a76dd7 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:33 2023 +0200 arm64: dts: mediatek: mt6795: Add PMIC Wrapper node Add the pwrap node: this is used to communicate with the PMIC(s). Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230412112739.160376-22-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 06254e9f244a656abaf89b87c366f991e5bb9a96 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:30 2023 +0200 arm64: dts: mediatek: mt6795: Add support for IOMMU and LARBs Add nodes for the multimedia IOMMU and its LARBs: this includes all but the MJC LARB, which cannot currently be used and will be added later. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230412112739.160376-19-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit d9acc19bc5beddd255c1a067cf437dbb4e4d67aa Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:29 2023 +0200 arm64: dts: mediatek: mt6795: Add MMSYS node for multimedia clocks Add the MultiMedia System node, providing clocks for the multimedia hardware blocks and their IOMMU/SMIs. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230412112739.160376-18-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 6e9b7cd6b84d027f81f796c43cfd9922723865a7 Author: Randy Dunlap Date: Sun Apr 30 17:16:17 2023 -0700 accessibility: use C99 array init Use C99 array initializer syntax for consistency with other array initializers around it and to eliminate a sparse warning: drivers/accessibility/speakup/main.c:1290:26: sparse: warning: obsolete array initializer, use C99 syntax Fixes: f43241aafedb ("accessibility: speakup: Specify spk_vars among module parameters") Signed-off-by: Randy Dunlap Cc: Mushahid Hussain Cc: William Hubbs Cc: Chris Brannon Cc: Kirk Reiser Cc: Samuel Thibault Cc: speakup@linux-speakup.org Cc: Greg Kroah-Hartman Reviewed-by: Samuel Thibault Link: https://lore.kernel.org/r/20230501001617.9152-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit fee3d8eeca1a9121fff0436937b606affdbcfe7a Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:28 2023 +0200 arm64: dts: mediatek: mt6795: Add support for the CMDQ/GCE mailbox In preparation for adding multimedia blocks, add the CMDQ/GCE mailbox. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230412112739.160376-17-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 2fe1e67e6987b6f05329740da79c8150a2205b0d Author: Nathan Chancellor Date: Fri May 26 08:47:40 2023 -0700 x86/csum: Fix clang -Wuninitialized in csum_partial() Clang warns: arch/x86/lib/csum-partial_64.c:74:20: error: variable 'result' is uninitialized when used here [-Werror,-Wuninitialized] return csum_tail(result, temp64, odd); ^~~~~~ arch/x86/lib/csum-partial_64.c:48:22: note: initialize the variable 'result' to silence this warning unsigned odd, result; ^ = 0 1 error generated. The only initialization and uses of result in csum_partial() were moved into csum_tail() but result is still being passed by value to csum_tail() (clang's -Wuninitialized does not do interprocedural analysis to realize that result is always assigned in csum_tail() however). Sink the declaration of result into csum_tail() to clear up the warning. Closes: https://lore.kernel.org/202305262039.3HUYjWJk-lkp@intel.com/ Fixes: 688eb8191b47 ("x86/csum: Improve performance of `csum_partial`") Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230526-csum_partial-wuninitialized-v1-1-ebc0108dcec1%40kernel.org commit c55953358dfba2feaa81c9b01a82d9a4267e79bd Author: AngeloGioacchino Del Regno Date: Wed Apr 12 13:27:13 2023 +0200 dt-bindings: pwm: Add compatible for MediaTek MT6795 Add a compatible string for MediaTek Helio X10 MT6795's display PWM block: this is the same as MT8173. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Acked-by: Uwe Kleine-König Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20230412112739.160376-2-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 1e5b6725199f276b02be8539b7545e1553cfd61e Author: Balsam CHIHI Date: Wed Apr 5 12:09:07 2023 +0200 arm64: dts: mediatek: mt8195: Add AP domain thermal zones Add AP Domain thermal zones for the mt8195 and specify the targeted temperature thresholds. Signed-off-by: Balsam CHIHI Link: https://lore.kernel.org/r/20230405100907.53740-1-bchihi@baylibre.com Signed-off-by: Matthias Brugger commit 7e07d3322de2a683890395688225c76674b94a73 Author: Allen-KH Cheng Date: Fri Mar 24 10:12:58 2023 +0800 arm64: dts: mediatek: mt8186: Add display nodes Add display nodes and the GCE (Global Command Engine) properties to the display nodes in order to enable the usage of the CMDQ (Command Queue), which is required for operating the display. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230324021258.15863-7-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 4121884773afa0030423f36a81d90c43a686c019 Author: Allen-KH Cheng Date: Fri Mar 24 10:12:57 2023 +0800 arm64: dts: mediatek: mt8186: Add GCE node Add the Global Command Engine (GCE) node for MT8186 SoC Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230324021258.15863-6-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 4dad4f32bad614e3f0c7491a34a19ee4ec47ff84 Author: Allen-KH Cheng Date: Fri Mar 24 10:12:56 2023 +0800 arm64: dts: mediatek: mt8186: Add ADSP node Add ADSP node for MT8186 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230324021258.15863-5-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 36cfc08f3dd8b5ac7d33d7e53da7c994be7fd186 Author: Allen-KH Cheng Date: Fri Mar 24 10:12:55 2023 +0800 arm64: dts: mediatek: mt8186: Add SPMI node Add SPMI node for MT8186 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230324021258.15863-4-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 54e94ca9e3087f6a42025c42e0e2a22df8d2d0e5 Author: Allen-KH Cheng Date: Fri Mar 24 10:12:54 2023 +0800 dt-bindings: spmi: spmi-mtk-pmif: Document mediatek,mt8195-spmi as fallback of mediatek,mt8186-spmi The mt8186-spmi is used as compatible with mt8195-spmi on the MT8186, document this situation. Signed-off-by: Allen-KH Cheng Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20230324021258.15863-3-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit f6c3e61c54863247594fe0cf506da590d5415b74 Author: Allen-KH Cheng Date: Fri Mar 24 10:12:53 2023 +0800 arm64: dts: mediatek: mt8186: Add MTU3 nodes Add MTU3 nodes for MT8186 SoC. Signed-off-by: Allen-KH Cheng Tested-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230324021258.15863-2-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 11696c5e89245a1d360f75be3dfc4960b25a265a Author: Biju Das Date: Tue May 2 11:09:08 2023 +0100 drm: Place Renesas drivers in a separate dir Create vendor specific renesas directory and move renesas drivers to that directory. Signed-off-by: Biju Das Acked-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit b7f61f9c7ec402633c10f6456415cab04d3838d5 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 15:12:16 2023 +0200 soc: mediatek: pwrap: Add support for MT6795 Helio X10 Add the necessary bits to support the MT6795 Helio X10 smartphone SoC: this is always paired with a MT6331 PMIC, with MT6332 companion. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230412131216.198313-7-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 10f5c409a81a327743f15441f7fed3975e7a5a0f Author: AngeloGioacchino Del Regno Date: Wed Apr 12 15:12:15 2023 +0200 soc: mediatek: mtk-pmic-wrap: Add support for MT6331 w/ MT6332 companion Add support for the MT6331 PMIC and for its companion MT6332 PMIC. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230412131216.198313-6-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 41ae95aaa0d7576a5be1d9fd9225beafc179e019 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 15:12:14 2023 +0200 soc: mediatek: mtk-pmic-wrap: Add support for companion PMICs Some PMICs are designed to work with a companion part, which provides more regulators and/or companion devices such as LED controllers, display backlight controllers, battery charging, fuel gauge, etc: this kind of PMICs are usually present in smartphone platforms, where tight integration is required. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230412131216.198313-5-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 2eb27302346520908f89ee4db80fdba12c686278 Author: AngeloGioacchino Del Regno Date: Wed Apr 12 15:12:13 2023 +0200 soc: mediatek: pwrap: Add kerneldoc for struct pwrap_slv_type In preparation for adding new members with name abbreviations describe the struct pwrap_slv_type with kerneldoc to enhance human readability. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230412131216.198313-4-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit db9f132122afe5b2a7bb9ba132b9e562b9ca1aef Author: AngeloGioacchino Del Regno Date: Wed Apr 12 15:12:12 2023 +0200 soc: mediatek: pwrap: Move PMIC read test sequence in function The PMIC read test is performed in two places: pwrap_init_dual_io() and pwrap_init_sidly(). In preparation for adding support for PMICs requiring a companion part, move this sequence to a new function pwrap_pmic_read_test(). Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230412131216.198313-3-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit e829f1fc942f0190d169636f4a33f85cc4509fbd Author: AngeloGioacchino Del Regno Date: Wed Apr 12 15:12:11 2023 +0200 dt-bindings: soc: mediatek: pwrap: Add compatible for MT6795 Helio X10 Add a compatible for the PMIC Wrapper found on the MT6795 Helio X10 SoC. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230412131216.198313-2-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 2da4b728f994a1f9189a8066b0be90b615768764 Author: Wolfram Sang Date: Tue May 9 09:48:17 2023 +0200 drm: rcar-du: remove R-Car H3 ES1.* workarounds R-Car H3 ES1.* was only available to an internal development group and needed a lot of quirks and workarounds. These become a maintenance burden now, so our development group decided to remove upstream support for this SoC and prevent booting it. Public users only have ES2 onwards. Signed-off-by: Wolfram Sang Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit e8c6b47f49884950322a46ae9bc7e06e8d3d7e9d Author: Amjad Ouled-Ameur Date: Thu May 25 10:33:19 2023 +0200 arm64: dts: mediatek: Add CPU Idle support MT8365 has 3 CPU Idle states: - MCDI_CPU. (Multi-Core-Deep-Idle) - MCDI_CLUSTER. - DPIDLE. (Deep-Idle) Signed-off-by: Amjad Ouled-Ameur Reviewed-by: AngeloGioacchino Del Regno Tested-by: Kevin Hilman Signed-off-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230203-evk-board-support-v8-10-7019f3fd0adf@baylibre.com Signed-off-by: Matthias Brugger commit a5fe2dbab90cf5ff007d3b6c6e83b11d19f67684 Author: Alexandre Mergnat Date: Thu May 25 10:33:18 2023 +0200 arm64: dts: mediatek: add cpufreq support for mt8365-evk In order to have cpufreq support, this patch adds proc-supply and sram-supply for each CPU. Reviewed-by: AngeloGioacchino Del Regno Tested-by: Kevin Hilman Signed-off-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230203-evk-board-support-v8-9-7019f3fd0adf@baylibre.com Signed-off-by: Matthias Brugger commit 27205cec69b0f62223836acf5789f04c9c004275 Author: Alexandre Mergnat Date: Thu May 25 10:33:17 2023 +0200 arm64: dts: mediatek: add OPP support for mt8365 SoC In order to have cpufreq support, this patch adds generic Operating Performance Points support. Reviewed-by: AngeloGioacchino Del Regno Tested-by: Kevin Hilman Signed-off-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230203-evk-board-support-v8-8-7019f3fd0adf@baylibre.com Signed-off-by: Matthias Brugger commit 2c3df90c20727e2b76251bc9fe44e70bf22e124b Author: Alexandre Mergnat Date: Thu May 25 10:33:16 2023 +0200 arm64: dts: mediatek: add ethernet support for mt8365-evk - Enable "vibr" and "vsim2" regulators to power the ethernet chip. Tested-by: Kevin Hilman Signed-off-by: Alexandre Mergnat Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230203-evk-board-support-v8-7-7019f3fd0adf@baylibre.com Signed-off-by: Matthias Brugger commit 0899813f248aebc21b4f73f7914572b5468de79a Author: Alexandre Mergnat Date: Thu May 25 10:33:15 2023 +0200 arm64: dts: mediatek: add usb controller support for mt8365-evk This patch add support for SuperSpeed USB, in OTG mode, on micro connector. It also add support for the Extensible Host Controller Interface USB. Reviewed-by: AngeloGioacchino Del Regno Tested-by: Kevin Hilman Signed-off-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230203-evk-board-support-v8-6-7019f3fd0adf@baylibre.com Signed-off-by: Matthias Brugger commit 6e8270afad054ec480d4a06c99fa30472a30c793 Author: Alexandre Mergnat Date: Thu May 25 10:33:14 2023 +0200 arm64: dts: mediatek: add mmc support for mt8365-evk - Add EMMC support on mmc0 (internal memory) - Add SD-UHS support on mmc1 (external memory) Reviewed-by: AngeloGioacchino Del Regno Tested-by: Kevin Hilman Signed-off-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230203-evk-board-support-v8-5-7019f3fd0adf@baylibre.com Signed-off-by: Matthias Brugger commit 56e9f0f4aa30146d2f50ec0d3ebe9294f9c8507e Author: Alexandre Mergnat Date: Thu May 25 10:33:13 2023 +0200 arm64: dts: mediatek: add mt6357 PMIC support for mt8365-evk This power management system chip integration helps to manage regulators and keys. Reviewed-by: AngeloGioacchino Del Regno Tested-by: Kevin Hilman Signed-off-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230203-evk-board-support-v8-4-7019f3fd0adf@baylibre.com Signed-off-by: Matthias Brugger commit 751ec3da08b431bbffb3425746154cb3af4972ce Author: Alexandre Mergnat Date: Thu May 25 10:33:12 2023 +0200 arm64: dts: mediatek: add watchdog support for mt8365 SoC Add watchdog support. Reviewed-by: AngeloGioacchino Del Regno Tested-by: Kevin Hilman Signed-off-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230203-evk-board-support-v8-3-7019f3fd0adf@baylibre.com Signed-off-by: Matthias Brugger commit d8572531736f2182b5587eab1b32a883be05b4e0 Author: Uwe Kleine-König Date: Thu May 25 22:42:58 2023 +0200 pinctrl: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230525204258.711186-1-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 6171212e9fc7b45a4c4f4736896f590389b95150 Author: Lizhe Date: Sat May 20 01:07:16 2023 +0800 pinctrl: microchip: Remove redundant clearing of IRQ_TYPE_SENSE_MASK Before executing microchip_sgpio_irq_set_type(), type has already been cleared IRQ_TYPE_SENSE_MASK, see __irq_set_trigger(). Signed-off-by: Lizhe Link: https://lore.kernel.org/r/20230519170716.3459-1-sensor1010@163.com Signed-off-by: Linus Walleij commit b17f3a3ef5ee29e35ea8726cfa7e60169fe11d0e Author: Alexandre Mergnat Date: Thu May 25 10:33:11 2023 +0200 arm64: defconfig: enable Mediatek PMIC key Some Mediatek PMIC devices can manage Power and Home keys (buttons). This patch enable the driver which handle the 2 keys managed by the Mediatek PMIC. Tested-by: Kevin Hilman Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230203-evk-board-support-v8-2-7019f3fd0adf@baylibre.com Signed-off-by: Matthias Brugger commit b1da1c17f6b1af1f91715db3dd5117a5d7589b7d Author: Alexandre Mergnat Date: Thu May 25 10:33:10 2023 +0200 arm64: defconfig: enable MT6357 regulator Enable the power regulator support of MediaTek MT6357 PMIC. This driver supports the control of different power rails of device through regulator interface. Tested-by: Kevin Hilman Signed-off-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230203-evk-board-support-v8-1-7019f3fd0adf@baylibre.com Signed-off-by: Matthias Brugger commit 148efa63bab383993a06770c2c05cfb9ed29a193 Author: Krzysztof Kozlowski Date: Thu May 11 19:54:49 2023 +0200 fpga: dfl-fme: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Reviewed-by: Russ Weight Signed-off-by: Krzysztof Kozlowski Acked-by: Xu Yilun Link: https://lore.kernel.org/r/20230511175449.282069-1-krzysztof.kozlowski@linaro.org Signed-off-by: Xu Yilun commit 44825e5ead0f3e8dda4bbc1c20175c42942659ab Author: Jonathan McDowell Date: Tue May 16 18:47:29 2023 +0100 pinctrl: axp209: Add support for GPIO3 on the AXP209 The AXP209 device has a 4th GPIO which has a slightly different register setup, where the control + status bits are held in a single register rather than sharing AXP20X_GPIO20_SS with GPIOs 0-2. Signed-off-by: Jonathan McDowell Reviewed-by: Jernej Skrabec Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/dde40307f0ebc23b9841c32e702b481ab5193dc4.1684258957.git.noodles@earth.li Signed-off-by: Linus Walleij commit 0f9367525ad32eef888400106312709053798a53 Author: Rohit Agarwal Date: Thu May 18 21:27:12 2023 +0530 pinctrl: qcom: Add SDX75 pincontrol driver Add initial Qualcomm SDX75 pinctrl driver to support pin configuration with pinctrl framework for SDX75 SoC. While at it, reordering the SDX65 entry. Signed-off-by: Rohit Agarwal Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1684425432-10072-4-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Linus Walleij commit 1921dc00a7557623d36f055bf65daceb1b8b8045 Author: Rohit Agarwal Date: Thu May 18 21:27:11 2023 +0530 MAINTAINERS: Update the entry for pinctrl maintainers Update the entry for pinctrl bindings maintainer as the current one checks only in the .txt files. Signed-off-by: Rohit Agarwal Reviewed-by: Krzysztof Kozlowski Reviewed-by: Bhupesh Sharma Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1684425432-10072-3-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Linus Walleij commit 1dc3f8812cc5fe82c097811ea8251d7f8af5d54d Author: Rohit Agarwal Date: Thu May 18 21:27:10 2023 +0530 dt-bindings: pinctrl: qcom: Add SDX75 pinctrl devicetree compatible Add device tree binding Documentation details for Qualcomm SDX75 pinctrl driver. Signed-off-by: Rohit Agarwal Reviewed-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1684425432-10072-2-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Linus Walleij commit ef7d0f5d03b9e65c9daa8dfe8b405b10566055eb Author: Linus Walleij Date: Thu Jun 2 09:48:29 2022 +0200 m68k/mm: Make pfn accessors static inlines Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as arguments without warnings. For symmetry, do the same with pfn_to_virt(). Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Linus Walleij commit c94b1a012f93327a4fe16ab9455331f37e69242f Author: Linus Walleij Date: Mon May 30 10:46:39 2022 +0200 arm64: memory: Make virt_to_pfn() a static inline Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as arguments without warnings. Since arm64 is using to provide __phys_to_pfn() we need to move the inclusion of that header up, so we can resolve the static inline at compile time. Acked-by: Catalin Marinas Signed-off-by: Linus Walleij commit a9ff6961601d9aa0c42b6eb7d850371f31b1f5e6 Author: Linus Walleij Date: Thu Jun 2 10:18:32 2022 +0200 ARM: mm: Make virt_to_pfn() a static inline Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as arguments without warnings. Doing this is a bit intrusive: virt_to_pfn() requires PHYS_PFN_OFFSET and PAGE_SHIFT to be defined, and this is defined in , so this must be included *before* . The use of macros were obscuring the unclear inclusion order here, as the macros would eventually be resolved, but a static inline like this cannot be compiled with unresolved macros. The naive solution to include at the top of does not work, because sometimes includes at the end of itself, which would create a confusing inclusion loop. So instead, take the approach to always unconditionally include at the end of arch/arm uses explicitly in a lot of places, however it turns out that if we just unconditionally include into and switch all inclusions of to instead, we enforce the right order and will always have access to the definitions. Put an inclusion guard in place making it impossible to include explicitly. Link: https://lore.kernel.org/linux-mm/20220701160004.2ffff4e5ab59a55499f4c736@linux-foundation.org/ Signed-off-by: Linus Walleij commit 2d78057f0dd41c5e24b824a3ea254a0672ec73eb Author: Linus Walleij Date: Wed Jun 1 11:47:06 2022 +0200 asm-generic/page.h: Make pfn accessors static inlines Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as arguments without warnings. For symmetry we do the same change for pfn_to_virt. Immediately define virt_to_pfn and pfn_to_virt to the static inline after the static inline since this style of defining functions is used for the generic helpers. Signed-off-by: Linus Walleij commit e36bfc0bc3ceb3ace1ff0ed5f9ed781395b6cbc5 Author: Linus Walleij Date: Tue May 23 16:03:42 2023 +0200 xen/netback: Pass (void *) to virt_to_page() virt_to_page() takes a virtual address as argument but the driver passes an unsigned long, which works because the target platform(s) uses polymorphic macros to calculate the page. Since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix this up by an explicit (void *) cast. Cc: Wei Liu Cc: Paul Durrant Cc: xen-devel@lists.xenproject.org Cc: netdev@vger.kernel.org Acked-by: Wei Liu Signed-off-by: Linus Walleij commit ee5971613da37b92ceb5cadfe878074eabcd5deb Author: Linus Walleij Date: Fri Mar 24 11:22:54 2023 +0100 netfs: Pass a pointer to virt_to_page() Like the other calls in this function virt_to_page() expects a pointer, not an integer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix this up with an explicit cast. Signed-off-by: Linus Walleij commit 605a97e8398af21ba8ea6e6f3ffe069e09e24277 Author: Linus Walleij Date: Fri Mar 31 14:28:11 2023 +0200 cifs: Pass a pointer to virt_to_page() in cifsglob Like the other calls in this function virt_to_page() expects a pointer, not an integer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix this up with an explicit cast. Acked-by: Tom Talpey Signed-off-by: Linus Walleij commit 1db3af8ed8f7cfe01ff27af3d42b6c658e18ad50 Author: Linus Walleij Date: Fri Mar 24 11:17:48 2023 +0100 cifs: Pass a pointer to virt_to_page() Like the other calls in this function virt_to_page() expects a pointer, not an integer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix this up with an explicit cast. Acked-by: Tom Talpey Signed-off-by: Linus Walleij commit a7d270d71aca0ea3cfe3973770ed40206f603475 Author: Linus Walleij Date: Tue Jun 7 16:31:34 2022 +0200 riscv: mm: init: Pass a pointer to virt_to_page() Functions that work on a pointer to virtual memory such as virt_to_pfn() and users of that function such as virt_to_page() are supposed to pass a pointer to virtual memory, ideally a (void *) or other pointer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix this in the RISCV mm init code, so we can implement a strongly typed virt_to_pfn(). Reviewed-by: Alexandre Ghiti Signed-off-by: Linus Walleij commit c8092025495a17261525ce53feec7e261714c988 Author: Linus Walleij Date: Fri Jun 3 11:01:05 2022 +0200 ARC: init: Pass a pointer to virt_to_pfn() in init Functions that work on a pointer to virtual memory such as virt_to_pfn() and users of that function such as virt_to_page() are supposed to pass a pointer to virtual memory, ideally a (void *) or other pointer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix up the offending call in arch/arc with an explicit cast. Signed-off-by: Linus Walleij commit 8f246087724a2f902a5deb2013f73b7516b2276e Author: Linus Walleij Date: Fri Jun 3 10:40:24 2022 +0200 m68k: Pass a pointer to virt_to_pfn() virt_to_page() Functions that work on a pointer to virtual memory such as virt_to_pfn() and users of that function such as virt_to_page() are supposed to pass a pointer to virtual memory, ideally a (void *) or other pointer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix up the offending calls in arch/m68k with explicit casts. The page table include will include different variants of the defines depending on whether you build for classic m68k, ColdFire or Sun3, so fix all variants. Delete Coldfire pte_pagenr() which was using unsigned long semantics from __pte_page(). Tested-by: Geert Uytterhoeven Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Linus Walleij commit 9b2d38b4e4a4651ac6efc8ca1a1882c0d4f12937 Author: Linus Walleij Date: Mon Aug 29 15:08:04 2022 +0200 fs/proc/kcore.c: Pass a pointer to virt_addr_valid() The virt_addr_valid() should be passed a pointer, the current code passing a long unsigned int is just exploiting the unintentional polymorphism of these calls being implemented as preprocessor macros. Signed-off-by: Linus Walleij commit 06b9a183d93a3dbfcefc380e6763f4dea0dc104b Merge: 35216718c9ac2 5d32cead772c3 Author: Linus Walleij Date: Mon May 29 11:22:55 2023 +0200 Merge tag 'renesas-pinctrl-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v6.5 - Fix whitespace. commit b8b9e8b35d3856499c0b2e8188885257828b7fa5 Author: Al Viro Date: Tue Dec 13 20:53:47 2022 -0500 ext2_find_entry()/ext2_dotdot(): callers don't need page_addr anymore ... and that's how it should've been done in the first place Signed-off-by: Al Viro Reviewed-by: Fabio M. De Francesco Tested-by: Fabio M. De Francesco Signed-off-by: Jan Kara commit dae42837ba6dd441e4a569996d5f62986ffe01ed Author: Al Viro Date: Tue Dec 13 20:31:39 2022 -0500 ext2_{set_link,delete_entry}(): don't bother with page_addr ext2_set_link() simply doesn't use it anymore and ext2_delete_entry() can easily obtain it from the directory entry pointer... Signed-off-by: Al Viro Reviewed-by: Fabio M. De Francesco Tested-by: Fabio M. De Francesco Signed-off-by: Jan Kara commit 91f646fb971f4401216a2dff5c568bcbce79a923 Author: Al Viro Date: Tue Dec 13 20:14:50 2022 -0500 ext2_put_page(): accept any pointer within the page eliminates the need to keep the pointer to the first byte within the page if we are guaranteed to have pointers to some byte in the same page at hand. Don't backport without commit 88d7b12068b9 ("highmem: round down the address passed to kunmap_flush_on_unmap()"). Signed-off-by: Al Viro Reviewed-by: Fabio M. De Francesco Tested-by: Fabio M. De Francesco Signed-off-by: Jan Kara commit 46022375abe8160b6c952a2ca0ea7988be6b888d Author: Al Viro Date: Tue Dec 13 20:07:28 2022 -0500 ext2_get_page(): saner type We need to pass to caller both the page reference and pointer to the first byte in the now-mapped page. The former always has the same type, the latter varies from caller to caller. So make it void *ext2_get_page(...., struct page **page) rather than struct page *ext2_get_page(..., void **page_addr) and avoid the casts... Signed-off-by: Al Viro Reviewed-by: Fabio M. De Francesco Tested-by: Fabio M. De Francesco Signed-off-by: Jan Kara commit 86008392695bd7a910b9d1452c828f9c7d1a6a1f Author: Al Viro Date: Tue Dec 13 20:26:27 2022 -0500 ext2: use offset_in_page() instead of open-coding it as subtraction Signed-off-by: Al Viro Reviewed-by: Fabio M. De Francesco Tested-by: Fabio M. De Francesco Signed-off-by: Jan Kara commit 8f1dca19b1e11785f42e70da796942154f63aef9 Author: Al Viro Date: Wed Jan 11 15:21:52 2023 -0500 ext2_rename(): set_link and delete_entry may fail Signed-off-by: Al Viro Reviewed-by: Fabio M. De Francesco Tested-by: Fabio M. De Francesco Signed-off-by: Jan Kara commit c60738de85f40b0b9f5cb23c21f9246e5a47908c Author: Junyan Ye Date: Mon May 8 12:36:41 2023 +0800 PCI: ftpci100: Release the clock resources Smatch reported: 1. drivers/pci/controller/pci-ftpci100.c:526 faraday_pci_probe() warn: 'clk' from clk_prepare_enable() not released on lines: 442,451,462,478,512,517. 2. drivers/pci/controller/pci-ftpci100.c:526 faraday_pci_probe() warn: 'p->bus_clk' from clk_prepare_enable() not released on lines: 451,462,478,512,517. The clock resource is obtained by devm_clk_get(), and then clk_prepare_enable() makes the clock resource ready for use. After that, clk_disable_unprepare() should be called to release the clock resource when it is no longer needed. However, while doing some error handling in faraday_pci_probe(), clk_disable_unprepare() is not called to release clk and p->bus_clk before returning. These return lines are exactly 442, 451, 462, 478, 512, 517. Fix this warning by replacing devm_clk_get() with devm_clk_get_enabled(), which is equivalent to devm_clk_get() + clk_prepare_enable(). And with devm_clk_get_enabled(), the clock will automatically be disabled, unprepared and freed when the device is unbound from the bus. Link: https://lore.kernel.org/r/20230508043641.23807-1-yejunyan@hust.edu.cn Fixes: b3c433efb8a3 ("PCI: faraday: Fix wrong pointer passed to PTR_ERR()") Fixes: 2eeb02b28579 ("PCI: faraday: Add clock handling") Fixes: 783a862563f7 ("PCI: faraday: Use pci_parse_request_of_pci_ranges()") Fixes: d3c68e0a7e34 ("PCI: faraday: Add Faraday Technology FTPCI100 PCI Host Bridge driver") Fixes: f1e8bd21e39e ("PCI: faraday: Convert IRQ masking to raw PCI config accessors") Signed-off-by: Junyan Ye Signed-off-by: Lorenzo Pieralisi Reviewed-by: Dongliang Mu Reviewed-by: Linus Walleij commit 796e9149a2fcdba5543e247abd8d911a399bb9a6 Author: Yue Hu Date: Thu May 25 15:26:05 2023 +0800 erofs: clean up z_erofs_pcluster_readmore() `end` parameter is no needed since it's pointless for !backmost, we can handle it with backmost internally. And we only expand the trailing edge, so the newstart can be replaced with ->headoffset. Also, remove linux/prefetch.h inclusion since that is not used anymore after commit 386292919c25 ("erofs: introduce readmore decompression strategy"). Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20230525072605.17857-1-zbestahu@gmail.com [ Gao Xiang: update commit description. ] Signed-off-by: Gao Xiang commit ef4b4b46c6aaf8edeea9a79320627fe10993f153 Author: Yue Hu Date: Wed May 24 14:39:44 2023 +0800 erofs: remove the member readahead from struct z_erofs_decompress_frontend The struct member is only used to add REQ_RAHEAD during I/O submission. So it is cleaner to pass it as a parameter than keep it in the struct. Also, rename function z_erofs_get_sync_decompress_policy() to z_erofs_is_sync_decompress() for better clarity and conciseness. Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20230524063944.1655-1-zbestahu@gmail.com Signed-off-by: Gao Xiang commit 597e2953ae9b4a391e883c1f1a4cda5878e2dbed Author: Yue Hu Date: Wed Apr 26 16:44:49 2023 +0800 erofs: fold in z_erofs_decompress() No need this helper since it's just a simple wrapper for decompress method and only one caller. So, let's fold in directly instead. Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20230426084449.12781-1-zbestahu@gmail.com Signed-off-by: Gao Xiang commit 94f89950850e1421c46fb44bc94c433cbe5dba00 Author: Pierre-Louis Bossart Date: Thu May 18 10:41:19 2023 +0800 soundwire: cadence: revisit parity injection We want to wait for the CONFIG_UPDATE bit to clear before doing something else. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230518024119.164160-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit ffc363d970d1d04be0f12b2252aa21aaef3ecfd0 Author: Pierre-Louis Bossart Date: Thu May 18 10:41:18 2023 +0800 soundwire: intel/cadence: update hardware reset sequence Combining hardware reset with the multi-link mode leads to a shortened hardware reset pattern observed on the bus. The updated hardware programming sequence is to first enable the clock with the sync_arm/sync_go pattern, and only in a second step to issue the hardware reset sequence. Since there is no longer a dependency between sync_arm/sync_go and hw_reset, the behavior of sdw_cdns_exit_reset() is changed to wait for the self-clearing CONFIG_UPDATE to go back to zero, Link: https://github.com/thesofproject/linux/issues/4170 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230518024119.164160-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 46b56a5cd2ff496c0707ae3deae849f12b86e534 Author: Pierre-Louis Bossart Date: Thu May 18 10:41:17 2023 +0800 soundwire: intel_bus_common: enable interrupts last It's not clear why we enabled interrupts in the Cadence IP first. The logical programming sequence should be to first start the bus, and only second to enable the interrupts. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230518024119.164160-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit ccc6cf1573b92f15cca79b674d555bef0fdf3059 Author: Pierre-Louis Bossart Date: Thu May 18 10:42:15 2023 +0800 soundwire: intel_bus_common: update error log We use __func__ in all calls of sdw_cdns_check_self_clearing_bits(), except in one case. Likely an editing miss when the code was refactored. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230518024215.164281-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 1ec33e22b8bd10136c415c6c1b924bf32057354d Author: Uwe Kleine-König Date: Thu May 18 22:08:23 2023 +0200 soundwire: amd: Improve error message in remove callback Returning an error code in the remove callback yields to an error message remove callback returned a non-zero value. This will be ignored. After that the device is removed anyhow. Improve the error message to at least say what the actual problem is. While touching that code, convert the driver to the .remove_new() callback which returns no value with the same effect as returning zero in a .remove() callback. As the return value is ignored by the core the only effect of this patch is to improve the error message. (And the motivating effect is that there is one less driver using .remove().) Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230518200823.249795-1-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 217f5e0de397fafc94d25a8f7baf71920bea4a04 Author: Krzysztof Kozlowski Date: Wed May 17 18:37:50 2023 +0200 soundwire: debugfs: fix unbalanced pm_runtime_put() If pm_runtime_resume_and_get() failed with -EACCES, the driver continued execution and finally called pm_runtime_put_autosuspend(). Since pm_runtime_resume_and_get() drops the usage counter on every error, this lead to double decrement of that counter. Fixes: b275bf45ba1d ("soundwire: debugfs: Switch to sdw_read_no_pm") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230517163750.997629-2-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 9f9914b178a7935d2d94ee3e1bf55f2b42b18528 Author: Krzysztof Kozlowski Date: Wed May 17 18:37:49 2023 +0200 soundwire: qcom: fix unbalanced pm_runtime_put() This reverts commit 57ed510b0547 ("soundwire: qcom: use pm_runtime_resume_and_get()") which introduced unbalanced pm_runtime_put(), when device did not have runtime PM enabled. If pm_runtime_resume_and_get() failed with -EACCES, the driver continued execution and finally called pm_runtime_put_autosuspend(). Since pm_runtime_resume_and_get() drops the usage counter on every error, this lead to double decrement of that counter visible in certain debugfs actions on unattached devices (still in reset state): $ cat /sys/kernel/debug/soundwire/master-0-0/sdw:0:0217:f001:00:0/registers qcom-soundwire 3210000.soundwire-controller: swrm_wait_for_wr_fifo_avail err write overflow soundwire sdw-master-0: trf on Slave 1 failed:-5 read addr e36 count 1 soundwire sdw:0:0217:f001:00:0: Runtime PM usage count underflow! Fixes: 57ed510b0547 ("soundwire: qcom: use pm_runtime_resume_and_get()") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230517163750.997629-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 4830bfa2c812689e6007f42536eeb86df08f9d29 Author: Srinivas Kandagatla Date: Thu May 25 14:38:12 2023 +0100 soundwire: qcom: set clk stop need reset flag at runtime WSA Soundwire controller needs an full reset if clock stop support is not available in slave devices. WSA881x does not support clock stop however WSA883x supports clock stop. Make setting this flag at runtime to address above issue. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230525133812.30841-5-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul commit 671ca2ef12fecefa959ec4bccbcb8e728820fd6f Author: Srinivas Kandagatla Date: Thu May 25 14:38:11 2023 +0100 soundwire: qcom: add software workaround for bus clash interrupt assertion Sometimes Hard reset does not clear some of the registers, this sometimes results in firing a bus clash interrupt. Add workaround for this during power up sequence, as suggested by hardware manual. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230525133812.30841-4-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul commit 9ac4a4441a393599a2d50148ee979b8754c97b2b Author: Srinivas Kandagatla Date: Thu May 25 14:38:10 2023 +0100 soundwire: qcom: wait for fifo to be empty before suspend Wait for Fifo to be empty before going to suspend or before bank switch happens. Just to make sure that all the reads/writes are done. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230525133812.30841-3-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul commit b79ead08a7d995262aa2e7f676c93e0263fc3be1 Author: Robert Marko Date: Sat May 27 11:52:28 2023 +0200 dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ8074 Document IPQ8074 compatible for Qcom NVMEM CPUFreq driver. Signed-off-by: Robert Marko Acked-by: Conor Dooley Signed-off-by: Viresh Kumar commit b2b2029eb17888117a9dad3b111db004f2e7353b Author: Vibhore Vardhan Date: Fri May 26 09:43:54 2023 -0500 cpufreq: dt-platdev: Blacklist ti,am62a7 SoC Add ti,am62a7 SoC to the blacklist as the ti-cpufreq driver will handle creating the cpufreq-dt platform device after it completes so it is not created twice. Based on AM625 CPUFreq patch series by Dave Gerlach. Signed-off-by: Vibhore Vardhan Reviewed-by: Dhruva Gole Signed-off-by: Viresh Kumar commit 5008e4c8c31c65bbe080cbfc1383602d1abf076e Author: Vibhore Vardhan Date: Fri May 26 09:43:53 2023 -0500 cpufreq: ti-cpufreq: Add support for AM62A7 Add support for TI K3 AM62A7 SoC to read speed and revision values from hardware and pass to OPP layer. AM62A7 has the same A53 and efuse configuration as AM625. Thus, soc_data from AM625 is reused. Based on AM625 CPUFreq patch series by Dave Gerlach. Signed-off-by: Vibhore Vardhan Reviewed-by: Dhruva Gole Signed-off-by: Viresh Kumar commit 40ca06d71d60677a8424798610c97a46e4140a21 Author: Gustavo A. R. Silva Date: Wed Feb 16 13:53:06 2022 -0600 uapi: wireless: Replace zero-length array with flexible-array member Zero-length and one-element arrays are deprecated, and we are moving towards adopting C99 flexible-array members, instead. Address the following warnings seen under GCC-13 and -fstrict-flex-arrays=3 enabled: drivers/staging/ks7010/ks_wlan_net.c:1597:50: warning: array subscript 0 is outside array bounds of ‘__u8[0]’ {aka ‘unsigned char[]’} [-Warray-bounds=] drivers/staging/ks7010/ks_wlan_net.c:1603:61: warning: array subscript 16 is outside array bounds of ‘__u8[0]’ {aka ‘unsigned char[]’} [-Warray-bounds=] drivers/staging/ks7010/ks_wlan_net.c:1604:61: warning: array subscript 24 is outside array bounds of ‘__u8[0]’ {aka ‘unsigned char[]’} [-Warray-bounds=] drivers/staging/ks7010/ks_wlan_net.c:1600:61: warning: array subscript 16 is outside array bounds of ‘__u8[0]’ {aka ‘unsigned char[]’} [-Warray-bounds=] drivers/staging/ks7010/ks_wlan_net.c:1586:50: warning: array subscript 0 is outside array bounds of ‘__u8[0]’ {aka ‘unsigned char[]’} [-Warray-bounds=] This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/21 Link: https://github.com/KSPP/linux/issues/261 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva commit f5bb4e381290883a014a9e865ee2c430447ef953 Author: Uwe Kleine-König Date: Fri May 26 23:47:03 2023 +0200 platform/chrome: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20230526214703.2135137-1-u.kleine-koenig@pengutronix.de commit 85d712f033d23bb56a373e29465470c036532d46 Merge: b8887e796e06b 0fbcf57077c47 Author: Dave Airlie Date: Mon May 29 06:21:50 2023 +1000 Merge tag 'drm-intel-gt-next-2023-05-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-next UAPI Changes: - New getparam for querying PXP support and load status Cross-subsystem Changes: - GSC/MEI proxy driver Driver Changes: Fixes/improvements/new stuff: - Avoid clearing pre-allocated framebuffers with the TTM backend (Nirmoy Das) - Implement framebuffer mmap support (Nirmoy Das) - Disable sampler indirect state in bindless heap (Lionel Landwerlin) - Avoid out-of-bounds access when loading HuC (Lucas De Marchi) - Actually return an error if GuC version range check fails (John Harrison) - Get mutex and rpm ref just once in hwm_power_max_write (Ashutosh Dixit) - Disable PL1 power limit when loading GuC firmware (Ashutosh Dixit) - Block in hwmon while waiting for GuC reset to complete (Ashutosh Dixit) - Provide sysfs for SLPC efficient freq (Vinay Belgaumkar) - Add support for total context runtime for GuC back-end (Umesh Nerlige Ramappa) - Enable fdinfo for GuC backends (Umesh Nerlige Ramappa) - Don't capture Gen8 regs on Xe devices (John Harrison) - Fix error capture for virtual engines (John Harrison) - Track patch level versions on reduced version firmware files (John Harrison) - Decode another GuC load failure case (John Harrison) - GuC loading and firmware table handling fixes (John Harrison) - Fix confused register capture list creation (John Harrison) - Dump error capture to kernel log (John Harrison) - Dump error capture to dmesg on CTB error (John Harrison) - Disable rps_boost debugfs when SLPC is used (Vinay Belgaumkar) Future platform enablement: - Disable stolen memory backed FB for A0 [mtl] (Nirmoy Das) - Various refactors for multi-tile enablement (Andi Shyti, Tejas Upadhyay) - Extend Wa_22011802037 to MTL A-step (Madhumitha Tolakanahalli Pradeep) - WA to clear RDOP clock gating [mtl] (Haridhar Kalvala) - Set has_llc=0 [mtl] (Fei Yang) - Define MOCS and PAT tables for MTL (Madhumitha Tolakanahalli Pradeep) - Add PTE encode function [mtl] (Fei Yang) - fix mocs selftest [mtl] (Fei Yang) - Workaround coherency issue for Media [mtl] (Fei Yang) - Add workaround 14018778641 [mtl] (Tejas Upadhyay) - Implement Wa_14019141245 [mtl] (Radhakrishna Sripada) - Fix the wa number for Wa_22016670082 [mtl] (Radhakrishna Sripada) - Use correct huge page manager for MTL (Jonathan Cavitt) - GSC/MEI support for Meteorlake (Alexander Usyskin, Daniele Ceraolo Spurio) - Define GuC firmware version for MTL (John Harrison) - Drop FLAT CCS check [mtl] (Pallavi Mishra) - Add MTL for remapping CCS FBs [mtl] (Clint Taylor) - Meteorlake PXP enablement (Alan Previn) - Do not enable render power-gating on MTL (Andrzej Hajda) - Add MTL performance tuning changes (Radhakrishna Sripada) - Extend Wa_16014892111 to MTL A-step (Radhakrishna Sripada) - PMU multi-tile support (Tvrtko Ursulin) - End support for set caching ioctl [mtl] (Fei Yang) Driver refactors: - Use i915 instead of dev_priv insied the file_priv structure (Andi Shyti) - Use proper parameter naming in for_each_engine() (Andi Shyti) - Use gt_err for GT info (Tejas Upadhyay) - Consolidate duplicated capture list code (John Harrison) - Capture list naming clean up (John Harrison) - Use kernel-doc -Werror when CONFIG_DRM_I915_WERROR=y (Jani Nikula) - Preparation for using PAT index (Fei Yang) - Use pat_index instead of cache_level (Fei Yang) Miscellaneous: - Fix memory leaks in i915 selftests (Cong Liu) - Record GT error for gt failure (Tejas Upadhyay) - Migrate platform-dependent mock hugepage selftests to live (Jonathan Cavitt) - Update the SLPC selftest (Vinay Belgaumkar) - Throw out set() wrapper (Jani Nikula) - Large driver kernel doc cleanup (Jani Nikula) - Fix probe injection CI failures after recent change (John Harrison) - Make unexpected firmware versions an error in debug builds (John Harrison) - Silence UBSAN uninitialized bool variable warning (Ashutosh Dixit) - Fix memory leaks in function live_nop_switch (Cong Liu) Merges: - Merge drm/drm-next into drm-intel-gt-next (Joonas Lahtinen) Signed-off-by: Dave Airlie # Conflicts: # drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZG5SxCWRSkZhTDtY@tursulin-desk commit 12a875055c15279c4f2db14cb0b593d81d16fc0b Author: Anup Sharma Date: Sat May 20 16:25:38 2023 +0530 iio: temperature: tmp006: Add OF device matching support Adds an of_device_id table entry to the driver, enabling device matching through device tree. With this update, the driver can now match devices using both the i2c_device_id entry and the newly added of_device_id table. Signed-off-by: Anup Sharma Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/72746bdfd8f74171943e41759b891c7af40627ec.1684579603.git.anupnewsmail@gmail.com Signed-off-by: Jonathan Cameron commit 7ad78a4074a3a357e94b0026639375d86d86b37b Author: Anup Sharma Date: Sat May 20 16:23:07 2023 +0530 dt-bindings: iio: temperature: Add support for tmp006 Add devicetree binding document for TMP006, IR thermopile sensor. Signed-off-by: Anup Sharma Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/3bbda3b1402a26cdafc95c7685679f2311365cad.1684579603.git.anupnewsmail@gmail.com Signed-off-by: Jonathan Cameron commit 8ff55fe553b327ab8bcd91133d6a4b1b506f629e Author: Uwe Kleine-König Date: Wed May 24 17:16:42 2023 +0200 staging: iio: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230524151646.486847-2-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit b4a4be8471846d96b0ac52a0e9e7d48005cc97e2 Author: Roger Quadros Date: Sun May 28 18:48:12 2023 +0300 USB: fix up merge of 6.4-rc4 into usb-next The merge of 6.4-rc4 got the changes in drivers/usb/dwc3/gadget.c completely incorrect, so fix it up properly. Link: https://lore.kernel.org/r/f604f836-7858-6140-4ec1-9ba95cba6991@kernel.org Fixes: 7e530d32a365 ("Merge 6.4-rc4 into usb-next") Signed-off-by: Greg Kroah-Hartman commit c6e9da9d556673b07e0ba4f00580904286787f22 Author: David Tadokoro Date: Sun May 28 12:40:10 2023 -0300 staging: rtl8192e: clean unnecessary braces warning on r8192E_phy.c Clean a checkpatch.pl warning of type "braces {} are not necessary for single statement blocks" on r8192E_phy.c file. Signed-off-by: David Tadokoro Link: https://lore.kernel.org/r/20230528154010.3068-1-davidbtadokoro@usp.br Signed-off-by: Greg Kroah-Hartman commit 8b5e7c33b3693aa12b5ce1cd0930f7b8bb978281 Author: Franziska Naepelt Date: Sun May 28 12:48:02 2023 +0200 iio: amplifiers: ad8366 Fix whitespace issue This removes the following checkpatch issue: - ERROR: space prohibited before that ',' (ctx:WxW) Signed-off-by: Franziska Naepelt Link: https://lore.kernel.org/r/20230528104802.22011-1-franziska.naepelt@gmail.com Signed-off-by: Jonathan Cameron commit 7e530d32a3655f15f1cf92e8aabed1bc3a21ee36 Merge: 19b3cf44e18c2 7877cb91f1081 Author: Greg Kroah-Hartman Date: Sun May 28 15:25:53 2023 +0100 Merge 6.4-rc4 into usb-next We need the USB fixes in here and this resolves merge conflicts in: drivers/usb/dwc3/gadget.c drivers/usb/gadget/udc/core.c Signed-off-by: Greg Kroah-Hartman commit 71b6b438f301733c150508f656e1cdb5285067e6 Author: Andy Shevchenko Date: Sun May 28 17:01:47 2023 +0300 staging: pi433: Remove stray gpiod_unexport() call There is no gpiod_export() and gpiod_unexport() looks pretty much stray. If user space tools somehow belong to that, they should be fixed, the gpiod_export() and gpiod_unexport() shouldn't be used in a new code, GPIO sysfs is deprecated. That said, and taking into account staging state of the driver, simply drop the stray call. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230528140147.32427-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 8a29f74b7498de8b23bbbbc665b9c14ad07175d4 Merge: c21c0f9a20a96 7877cb91f1081 Author: Greg Kroah-Hartman Date: Sun May 28 14:55:30 2023 +0100 Merge v6.4-rc4 into char-misc-next We need the binder fixes in here for future changes and testing. Signed-off-by: Greg Kroah-Hartman commit 200323768787a0ee02e01c35c1aff13dc9d77dde Author: Ian Rogers Date: Fri May 26 11:34:01 2023 -0700 libsubcmd: Avoid two path statics, removing 8192 bytes from .bss Use a single stack allocated buffer and avoid 8,192 bytes in .bss. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Ross Zwisler Cc: Sean Christopherson Cc: Steven Rostedt (VMware) Cc: Tiezhu Yang Cc: Yang Jihong Link: https://lore.kernel.org/r/20230526183401.2326121-17-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f50b8357f8955c899b704db88ffc180c5bf3f680 Author: Ian Rogers Date: Fri May 26 11:34:00 2023 -0700 perf test pmu: Avoid 2 static path arrays Avoid two static paths that contributed 8,192 bytes to .bss are only used duing the perf parse pmu test. This change helps FORTIFY triggering 2 warnings like: ``` tests/pmu.c: In function ‘test__pmu’: tests/pmu.c:121:43: error: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 4090 [-Werror=format-truncation=] 121 | snprintf(buf, sizeof(buf), "rm -f %s/*\n", dir); ``` So make buf a little larger. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Ross Zwisler Cc: Sean Christopherson Cc: Steven Rostedt (VMware) Cc: Tiezhu Yang Cc: Yang Jihong Link: https://lore.kernel.org/r/20230526183401.2326121-16-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7a3fb8b5c4607b133a71d3f695d0f2653facec13 Author: Ian Rogers Date: Fri May 26 11:33:59 2023 -0700 tools api fs: Dynamically allocate cgroupfs mount point cache, removing 4128 bytes from .bss Move the cgroupfs_cache_entry 4128 byte array out of .bss. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Ross Zwisler Cc: Sean Christopherson Cc: Steven Rostedt (VMware) Cc: Tiezhu Yang Cc: Yang Jihong Link: https://lore.kernel.org/r/20230526183401.2326121-15-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d9c26d45dbb51fe610f64b490f38f6ad15a00d7c Author: Ian Rogers Date: Fri May 26 11:33:58 2023 -0700 perf scripting-engines: Move static to local variable, remove 16384 from .bss Avoid 16,384 bytes in .bss by stack allocating two bitmaps. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Ross Zwisler Cc: Sean Christopherson Cc: Steven Rostedt (VMware) Cc: Tiezhu Yang Cc: Yang Jihong Link: https://lore.kernel.org/r/20230526183401.2326121-14-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 370ce164defd18069518e8b7faa6c92aad740257 Author: Ian Rogers Date: Fri May 26 11:33:57 2023 -0700 perf path: Make mkpath thread safe, remove 16384 bytes from .bss Avoid 4 static arrays for paths, pass in a char[] buffer to use. Makes mkpath thread safe for the small number of users. Also removes 16,384 bytes from .bss. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Ross Zwisler Cc: Sean Christopherson Cc: Steven Rostedt (VMware) Cc: Tiezhu Yang Cc: Yang Jihong Link: https://lore.kernel.org/r/20230526183401.2326121-13-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 430952e6d7a02bbf4d2d4a6d3baa7ce4b66052d7 Author: Ian Rogers Date: Fri May 26 11:33:56 2023 -0700 perf probe: Dynamically allocate params memory Avoid 14,432 bytes in .bss by dynamically allocating params. Signed-off-by: Ian Rogers Link: https://lore.kernel.org/r/20230526183401.2326121-12-irogers@google.com Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Mark Rutland Cc: Ross Zwisler Cc: Steven Rostedt (Google) Cc: Sean Christopherson Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Masami Hiramatsu (Google) Cc: Namhyung Kim Cc: Leo Yan Cc: Andi Kleen Cc: Alexander Shishkin Cc: Kan Liang Cc: Tiezhu Yang Cc: Ingo Molnar Cc: Paolo Bonzini Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ddc27bb8a9a5c0236ae65c3451d9c7024040d11d Author: Ian Rogers Date: Fri May 26 11:33:55 2023 -0700 perf timechart: Make large arrays dynamic Allocate start time and state arrays when command starts rather than using 114,688 bytes in .bss. Signed-off-by: Ian Rogers Link: https://lore.kernel.org/r/20230526183401.2326121-11-irogers@google.com Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Mark Rutland Cc: Ross Zwisler Cc: Steven Rostedt (Google) Cc: Sean Christopherson Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Masami Hiramatsu (Google) Cc: Namhyung Kim Cc: Leo Yan Cc: Andi Kleen Cc: Alexander Shishkin Cc: Kan Liang Cc: Tiezhu Yang Cc: Ingo Molnar Cc: Paolo Bonzini Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit eef4fee5e52071d563d9a851df1c09869215ee15 Author: Ian Rogers Date: Fri May 26 11:33:54 2023 -0700 perf lock: Dynamically allocate lockhash_table lockhash_table is 32,768 bytes in .bss, make it a memory allocation so that the space is freed for non-lock perf commands. Signed-off-by: Ian Rogers Link: https://lore.kernel.org/r/20230526183401.2326121-10-irogers@google.com Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Mark Rutland Cc: Ross Zwisler Cc: Steven Rostedt (Google) Cc: Sean Christopherson Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Masami Hiramatsu (Google) Cc: Namhyung Kim Cc: Leo Yan Cc: Andi Kleen Cc: Alexander Shishkin Cc: Kan Liang Cc: Tiezhu Yang Cc: Ingo Molnar Cc: Paolo Bonzini Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 92294b906e6c55d67ef929a4762d9878d5cb75ac Author: Ian Rogers Date: Fri May 26 11:33:53 2023 -0700 perf daemon: Dynamically allocate path to perf Avoid a PATH_MAX array in __daemon (the .data section) by dynamically allocating the memory. Signed-off-by: Ian Rogers Link: https://lore.kernel.org/r/20230526183401.2326121-9-irogers@google.com Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Mark Rutland Cc: Ross Zwisler Cc: Steven Rostedt (Google) Cc: Sean Christopherson Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Masami Hiramatsu (Google) Cc: Namhyung Kim Cc: Leo Yan Cc: Andi Kleen Cc: Alexander Shishkin Cc: Kan Liang Cc: Tiezhu Yang Cc: Ingo Molnar Cc: Paolo Bonzini Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 20dcad8f03117e50df569d18f6709d68807fedb8 Author: Ian Rogers Date: Fri May 26 11:33:52 2023 -0700 tools lib api fs tracing_path: Remove two unused MAX_PATH paths tracing_mnt was set but never written. tracing_events_path was set and read on errors paths, but its value is exactly tracing_path with a "/events" appended, so we can derive the value in the error paths. There appears to have been a missing "/" when tracing_events_path was initialized. Signed-off-by: Ian Rogers Link: https://lore.kernel.org/r/20230526183401.2326121-8-irogers@google.com Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Mark Rutland Cc: Ross Zwisler Cc: Steven Rostedt (Google) Cc: Sean Christopherson Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Masami Hiramatsu (Google) Cc: Namhyung Kim Cc: Leo Yan Cc: Andi Kleen Cc: Alexander Shishkin Cc: Kan Liang Cc: Tiezhu Yang Cc: Ingo Molnar Cc: Paolo Bonzini Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 89df62c3ca1746177e5f1bae540b6b85c27aadcd Author: Ian Rogers Date: Fri May 26 11:33:51 2023 -0700 tools api fs: Avoid large static PATH_MAX arrays Change struct fs to have a pointer to a dynamically allocated array rather than an array. This reduces the size of fs__entries from 24,768 bytes to 240 bytes. Read paths into a stack allocated array and strdup. Fix off-by-1 fscanf %s in fs__read_mounts caught by address sanitizer. Signed-off-by: Ian Rogers Link: https://lore.kernel.org/r/20230526183401.2326121-7-irogers@google.com Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Mark Rutland Cc: Ross Zwisler Cc: Steven Rostedt (Google) Cc: Sean Christopherson Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Masami Hiramatsu (Google) Cc: Namhyung Kim Cc: Leo Yan Cc: Andi Kleen Cc: Alexander Shishkin Cc: Kan Liang Cc: Tiezhu Yang Cc: Ingo Molnar Cc: Paolo Bonzini Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 1fc88e5a2d5358c9a8ae9fc992b75d34ed360339 Author: Ian Rogers Date: Fri May 26 11:33:50 2023 -0700 perf trace beauty: Make MSR arrays const to move it to .data.rel.ro Allows the movement of 46,072 bytes from .data to .data.rel.ro. Signed-off-by: Ian Rogers Link: https://lore.kernel.org/r/20230526183401.2326121-6-irogers@google.com Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Mark Rutland Cc: Ross Zwisler Cc: Steven Rostedt (Google) Cc: Sean Christopherson Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Masami Hiramatsu (Google) Cc: Namhyung Kim Cc: Leo Yan Cc: Andi Kleen Cc: Alexander Shishkin Cc: Kan Liang Cc: Tiezhu Yang Cc: Ingo Molnar Cc: Paolo Bonzini Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 60995604d11a5588ddd813030e2adc3b77e9af50 Author: Ian Rogers Date: Fri May 26 11:33:49 2023 -0700 perf trace: Make some large static arrays const to move it to .data.rel.ro Allows the movement of 33,128 bytes from .data to .data.rel.ro. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Ross Zwisler Cc: Sean Christopherson Cc: Steven Rostedt (VMware) Cc: Tiezhu Yang Cc: Yang Jihong Link: https://lore.kernel.org/r/20230526183401.2326121-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7c1d862eda7f11cabd6941caee1404aad2d41458 Author: Ian Rogers Date: Fri May 26 11:33:48 2023 -0700 perf test x86: intel-pt-test data is immutable so mark it const This allows the movement of 5,808 bytes from .data to .rodata. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Ross Zwisler Cc: Sean Christopherson Cc: Steven Rostedt (VMware) Cc: Tiezhu Yang Cc: Yang Jihong Link: https://lore.kernel.org/r/20230526183401.2326121-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit b1d870a8bbd8389823a86f33c7832afc442be353 Author: Ian Rogers Date: Fri May 26 11:33:47 2023 -0700 perf test x86: insn-x86 test data is immutable so mark it const This allows the movement of some sizeable data arrays (168,624 bytes) to .data.relro. Without PIE or the strings it could be moved to .rodata. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Ross Zwisler Cc: Sean Christopherson Cc: Steven Rostedt (VMware) Cc: Tiezhu Yang Cc: Yang Jihong Link: https://lore.kernel.org/r/20230526183401.2326121-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5c6e7c21ae94bd01cd2a808f806dace6b31956f3 Author: Ian Rogers Date: Fri May 26 11:33:46 2023 -0700 perf header: Make nodes dynamic in write_mem_topology() Avoid a large static array, dynamically allocate the nodes avoiding a hard coded limited as well. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: K Prateek Nayak Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Ross Zwisler Cc: Sean Christopherson Cc: Steven Rostedt (VMware) Cc: Tiezhu Yang Cc: Yang Jihong Link: https://lore.kernel.org/r/20230526183401.2326121-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 797b9ec8c4bc9ec89f633a9b2c710b7b64753ca4 Author: Ian Rogers Date: Fri May 26 12:44:42 2023 -0700 perf evsel: Don't let for_each_group() treat the head of the list as one of its nodes Address/memory sanitizer was reporting issues in evsel__group_pmu_name because the for_each_group_evsel loop didn't terminate when the head was reached, the head would then be cast and accessed as an evsel leading to invalid memory accesses. Fix for_each_group_member and for_each_group_evsel to terminate at the list head. Note, evsel__group_pmu_name no longer iterates the group, but the problem is present regardless. Fixes: 717e263fc354d53d ("perf report: Show group description when event group is enabled") Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Cc: Sandipan Das Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230526194442.2355872-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a90cc5a9eeab45eaf9e47740366b8cf98c3aeb83 Author: Ian Rogers Date: Fri May 26 12:44:41 2023 -0700 perf evsel: Don't let evsel__group_pmu_name() traverse unsorted group Previously the evsel__group_pmu_name would iterate the evsel's group, however, the list of evsels aren't yet sorted and so the loop may terminate prematurely. It is also not desirable to iterate the list of evsels during list_sort as the list may be broken. Precompute the group_pmu_name for the evsel before sorting, as part of the computation and only if necessary, iterate the whole list looking for group members so that being sorted isn't necessary. Move the group pmu name computation to parse-events.c given the closer dependency on the behavior of parse_events__sort_events_and_fix_groups. Fixes: 7abf0bccaaec7704 ("perf evsel: Add function to compute group PMU name") Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Changbin Du Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Cc: Sandipan Das Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230526194442.2355872-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1df380ff3018521bd1b129dff60984b61ade8cee Author: Masahiro Yamada Date: Mon May 22 01:04:23 2023 +0900 modpost: remove *_sections[] arrays Use PATTERNS() macros to remove unneeded array definitions. Signed-off-by: Masahiro Yamada commit abc23979ac90396c5a5dff03dcea198b5bd0c50d Author: Masahiro Yamada Date: Mon May 22 01:04:22 2023 +0900 modpost: merge bad_tosec=ALL_EXIT_SECTIONS entries in sectioncheck table There is no distinction between TEXT_TO_ANY_EXIT and DATA_TO_ANY_EXIT. Just merge them. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 19b3cf44e18c202d696354d1947b9a74fbad046e Author: Uwe Kleine-König Date: Thu May 18 01:02:39 2023 +0200 usbip: vhci_hcd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Shuah Khan Link: https://lore.kernel.org/r/20230517230239.187727-98-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit fc4ecc0cd5618759094ad0ed8a654789b15cb4e7 Author: Uwe Kleine-König Date: Thu May 18 01:02:38 2023 +0200 usb: typec: ucsi: acpi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230517230239.187727-97-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 72d70bf73cfc616ad5f439f57b215cbbe69ec3e0 Author: Uwe Kleine-König Date: Thu May 18 01:02:37 2023 +0200 usb: typec: wcove: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Guenter Roeck Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230517230239.187727-96-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 529ae3fe7b5c8fbab06d785bdf804d2ac8bf06a9 Author: Uwe Kleine-König Date: Thu May 18 01:02:36 2023 +0200 usb: typec: tcpci_mt6360: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Heikki Krogerus Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20230517230239.187727-95-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 42c78cfa003dd3f6c86d9baa7f167ed085f773e7 Author: Uwe Kleine-König Date: Thu May 18 01:02:35 2023 +0200 usb: typec: tcpci_mt6360: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Guenter Roeck Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230517230239.187727-94-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit ef0a3642b320c96adfd7951db35f7f0a0a535d39 Author: Uwe Kleine-König Date: Thu May 18 01:02:33 2023 +0200 usb: typec: intel_pmc_mux: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230517230239.187727-92-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 08cfceeeea1eebfe70b02d8f411398347a9a711d Author: Uwe Kleine-König Date: Thu May 18 01:02:32 2023 +0200 usb: typec: mux: gpio-sbu: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Bjorn Andersson Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230517230239.187727-91-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 61b013f9e1f7b82a5fd45949ce8d3ac3874cc287 Author: Uwe Kleine-König Date: Thu May 18 01:02:31 2023 +0200 usb: roles: intel_xhci: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-90-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 456a91ce7de4b9157fd5013c1e4dd8dd3c6daccb Author: Uwe Kleine-König Date: Thu May 18 01:02:30 2023 +0200 usb: renesas_usbhs: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20230517230239.187727-89-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 81a7d006ed174b6697192552422da781c6551363 Author: Uwe Kleine-König Date: Thu May 18 01:02:29 2023 +0200 usb: misc: usb3503: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-88-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit b6b64b67c8ac08f370338cd1f8e807487043a400 Author: Uwe Kleine-König Date: Thu May 18 01:02:28 2023 +0200 usb: misc: eud: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio Reviewed-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20230517230239.187727-87-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e0d53e4f7fd84cb41ece77c3f02c18699cc82736 Author: Uwe Kleine-König Date: Thu May 18 01:02:27 2023 +0200 usb: isp1760: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20230517230239.187727-86-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit d4323e83505247d2aca1e2488f69da9aab8ad03f Author: Masahiro Yamada Date: Mon May 22 01:04:21 2023 +0900 modpost: merge fromsec=DATA_SECTIONS entries in sectioncheck table You can merge these entries. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit f0c8aa5c8dca41db6dc6905a1663cd4eeaa8856c Author: Uwe Kleine-König Date: Thu May 18 01:02:22 2023 +0200 usb: uhci-platform: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-81-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 18cb7c4d53d061a56bd76b74e3a8a7f4747d3dad Author: Uwe Kleine-König Date: Thu May 18 01:02:21 2023 +0200 usb: uhci-grlib: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-80-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 32dbe25eee71a58a94c15cfd62de08d7cf6adb8e Author: Uwe Kleine-König Date: Thu May 18 01:02:20 2023 +0200 usb: sl811-hcd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-79-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 90995d53ab35ec304d04a4e446d9fb97841d3a1b Author: Uwe Kleine-König Date: Thu May 18 01:02:19 2023 +0200 usb: r8a66597-hcd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-78-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit aae652bc7b47f08bf08ab78d6a276415cc35c677 Author: Uwe Kleine-König Date: Thu May 18 01:02:18 2023 +0200 usb: oxu210hp-hcd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-77-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 1a232291741cf7d80f8cdd40e7eb5c869001b65b Author: Uwe Kleine-König Date: Thu May 18 01:02:17 2023 +0200 usb: ohci-st: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Patrice Chotard Link: https://lore.kernel.org/r/20230517230239.187727-76-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 106f477c08820b473e200f14187d65deef28ed95 Author: Uwe Kleine-König Date: Thu May 18 01:02:16 2023 +0200 usb: ohci-spear: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-75-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 982366fc0716046c41f418817b8b64458f19558e Author: Uwe Kleine-König Date: Thu May 18 01:02:15 2023 +0200 usb: ohci-sm501: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-74-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit a0f2863ab384de2f6b784f0ca9c063868f560636 Author: Uwe Kleine-König Date: Thu May 18 01:02:14 2023 +0200 usb: ohci-s3c2410: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-73-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 8c5f41ac18bb38505af9904837b90b51b6821f64 Author: Uwe Kleine-König Date: Thu May 18 01:02:13 2023 +0200 usb: ohci-pxa27x: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-72-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 7b0b81006ec64f38645462a56d9639acf1adad73 Author: Uwe Kleine-König Date: Thu May 18 01:02:12 2023 +0200 usb: ohci-ppc-of: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-71-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 18b93fc987c43523d9b1b87f6f12e4d9d2792944 Author: Uwe Kleine-König Date: Thu May 18 01:02:11 2023 +0200 usb: ohci-platform: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20230517230239.187727-70-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e399d0147febd1fec002f7accdd97112bc3bc64f Author: Uwe Kleine-König Date: Thu May 18 01:02:10 2023 +0200 usb: ohci-omap: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-69-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 70a52ca2ef1f99ed0dd69e3df562bf3480a76141 Author: Uwe Kleine-König Date: Thu May 18 01:02:09 2023 +0200 usb: ohci-nxp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-68-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 16fe06cdfdace6df20229f9fe8b31d7e4851c5c8 Author: Uwe Kleine-König Date: Thu May 18 01:02:08 2023 +0200 usb: ohci-exynos: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-67-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 9053f4b186341a6443bfbf74e5accaf100d974f7 Author: Uwe Kleine-König Date: Thu May 18 01:02:07 2023 +0200 usb: ohci-da8xx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-66-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit a87a68c70cd283631c3fb73393f33171ad17c61f Author: Uwe Kleine-König Date: Thu May 18 01:02:06 2023 +0200 usb: ohci-at91: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230517230239.187727-65-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 9e60ab3ee6094da6dc08ac46a6c27139be572d72 Author: Uwe Kleine-König Date: Thu May 18 01:02:05 2023 +0200 usb: octeon-hcd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-64-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 66426dbb1a0de6046f5ab271c653d5ae8a1b3713 Author: Uwe Kleine-König Date: Thu May 18 01:02:04 2023 +0200 usb: isp1362-hcd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-63-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 00b92772800b6bfb3f5198c0975aa3b33c657250 Author: Uwe Kleine-König Date: Thu May 18 01:02:03 2023 +0200 usb: isp116x-hcd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-62-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 29ac274b996e6c55092e24df2ee703c412d91e58 Author: Uwe Kleine-König Date: Thu May 18 01:02:02 2023 +0200 usb: fsl-mph-dr-of: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-61-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit a30125d975f2c1fa94b0bdd5baea830b5c4fda52 Author: Uwe Kleine-König Date: Thu May 18 01:02:01 2023 +0200 usb: ehci-xilinx-of: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-60-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 756caf5d11fe699cbdd0b5a3c5253bb0d38b5b7b Author: Uwe Kleine-König Date: Thu May 18 01:02:00 2023 +0200 usb: ehci-st: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Patrice Chotard Link: https://lore.kernel.org/r/20230517230239.187727-59-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit b87578faa6c3afb22506476bb093c85ce341e120 Author: Uwe Kleine-König Date: Thu May 18 01:01:59 2023 +0200 usb: ehci-spear: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-58-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit a9a49024640c2547efc646e6794f2eb14243a4f4 Author: Uwe Kleine-König Date: Thu May 18 01:01:58 2023 +0200 usb: ehci-sh: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-57-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 095486c46305c15c9a1252753dd9e596e86da0d6 Author: Uwe Kleine-König Date: Thu May 18 01:01:57 2023 +0200 usb: ehci-ppc-of: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-56-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit b700b067f69e12f0a78c1de6d622b69b29ed6660 Author: Uwe Kleine-König Date: Thu May 18 01:01:56 2023 +0200 usb: ehci-platform: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20230517230239.187727-55-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit c554264609c257acadf0d77dcf9232202769acff Author: Uwe Kleine-König Date: Thu May 18 01:01:55 2023 +0200 usb: ehci-orion: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-54-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 1bd418b6aafd086228d6cfb238db494fdcb88cfd Author: Uwe Kleine-König Date: Thu May 18 01:01:54 2023 +0200 usb: ehci-omap: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-53-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 7d6d8199575d3d5b288ac127384736f4f8bd3968 Author: Uwe Kleine-König Date: Thu May 18 01:01:53 2023 +0200 usb: ehci-npcm7xx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-52-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 450955d77ae35e0bc11d6fa997376765520acc61 Author: Uwe Kleine-König Date: Thu May 18 01:01:52 2023 +0200 usb: ehci-mv: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-51-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 3861844766ab16ed23403cecab787e1ab2cd4cc4 Author: Uwe Kleine-König Date: Thu May 18 01:01:51 2023 +0200 usb: ehci-grlib: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-50-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 453fb0aaee9b5799ac6758fb0fe3ca91cc0d0148 Author: Uwe Kleine-König Date: Thu May 18 01:01:50 2023 +0200 usb: ehci-fsl: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-49-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 1043c6ba7d746b630d33d876244345335243f781 Author: Uwe Kleine-König Date: Thu May 18 01:01:49 2023 +0200 usb: ehci-exynos: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-48-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 8ea6a6ab52295d9e8f8383f4deab7ec8f6e6f6b7 Author: Uwe Kleine-König Date: Thu May 18 01:01:48 2023 +0200 usb: ehci-brcm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20230517230239.187727-47-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 5cad5686f2fbc36892425ad96e9c8ef1c8b66186 Author: Uwe Kleine-König Date: Thu May 18 01:01:47 2023 +0200 usb: ehci-atmel: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230517230239.187727-46-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit cffdf49d739b3dc555c742dcf6cceb52e9a9a0df Author: Uwe Kleine-König Date: Thu May 18 01:01:46 2023 +0200 usb: gadget/udc-xilinx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-45-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 48c125b55aa29ba55b9331add94f55b5d7b4c2dc Author: Uwe Kleine-König Date: Thu May 18 01:01:45 2023 +0200 usb: gadget/tegra-xudc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-44-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit dad23c87a48e844dca18445b7e1677e4ce25d6fc Author: Uwe Kleine-König Date: Thu May 18 01:01:44 2023 +0200 usb: gadget/snps_udc_plat: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-43-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 98f2a546ac5c2c8b821ac2b9e2cd9e9102e77a54 Author: Uwe Kleine-König Date: Thu May 18 01:01:43 2023 +0200 usb: gadget/rzv2m_usb3drd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20230517230239.187727-42-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit cc3ee267e4c56c1cb09709f923128b32e4e19015 Author: Uwe Kleine-König Date: Thu May 18 01:01:42 2023 +0200 usb: gadget/renesas_usbf: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Herve Codina Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230517230239.187727-41-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 3ffd57792621fee59d271934d66c158b6c45b84a Author: Uwe Kleine-König Date: Thu May 18 01:01:41 2023 +0200 usb: gadget/renesas_usb3: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20230517230239.187727-40-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 9da2fa8fb8d445561b7d84cd7238c8a000ae5d84 Author: Uwe Kleine-König Date: Thu May 18 01:01:40 2023 +0200 usb: gadget/r8a66597-udc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20230517230239.187727-39-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 570d6d89783b0fb875524be6d279ba7c7c012f79 Author: Uwe Kleine-König Date: Thu May 18 01:01:39 2023 +0200 usb: gadget/pxa27x_udc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-38-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 9225afafc1b8ccf31529a6064c8599be93bfbf2b Author: Uwe Kleine-König Date: Thu May 18 01:01:38 2023 +0200 usb: gadget/omap_udc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-37-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e4707226011cf376b8f7da5d66cec73e2a2300a6 Author: Uwe Kleine-König Date: Thu May 18 01:01:37 2023 +0200 usb: gadget/net2272: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-36-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 7a0bfca4b379df8410605b99601c5bc966afff18 Author: Uwe Kleine-König Date: Thu May 18 01:01:36 2023 +0200 usb: gadget/mv_udc_core: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-35-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit d5d4b4f2377a31a16171fbbee0c9b3710530a972 Author: Uwe Kleine-König Date: Thu May 18 01:01:35 2023 +0200 usb: gadget/mv_u3d_core: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-34-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 9c78fc7bb731ac5aa2f333a135727a78cdda4bec Author: Uwe Kleine-König Date: Thu May 18 01:01:34 2023 +0200 usb: gadget/m66592-udc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20230517230239.187727-33-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit a864e8f27738a4e6429a13fe117f0d6ea7401c3a Author: Uwe Kleine-König Date: Thu May 18 01:01:33 2023 +0200 usb: gadget/fusb300_udc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-32-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 43efe68158fc83b1b11f1562b6c66b16280c41f0 Author: Uwe Kleine-König Date: Thu May 18 01:01:32 2023 +0200 usb: gadget/fsl_qe_udc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-31-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 2dd3f64fcc11f77d7c66b3f47d0631f8f85d642a Author: Uwe Kleine-König Date: Thu May 18 01:01:31 2023 +0200 usb: gadget/dummy_hcd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-30-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit ee8455c07c7b6330e446b77d4f026547c81c33a0 Author: Uwe Kleine-König Date: Thu May 18 01:01:30 2023 +0200 usb: bdc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20230517230239.187727-29-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 0621dacef2f451172f4a1b8fe19ee7a362edda65 Author: Uwe Kleine-König Date: Thu May 18 01:01:29 2023 +0200 usb: gadget/bcm63xx_udc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-28-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e28137b056ced4e014a2e2206b8d59236c40d369 Author: Uwe Kleine-König Date: Thu May 18 01:01:28 2023 +0200 usb: gadget/atmel_usba_udc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230517230239.187727-27-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit ba170e197541702b56c1e5ff49c4379a3e59b1ae Author: Uwe Kleine-König Date: Thu May 18 01:01:27 2023 +0200 usb: gadget: aspeed: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-26-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 530bf2c69cda96577c1a8d7213c702fd5f1064cc Author: Uwe Kleine-König Date: Thu May 18 01:01:26 2023 +0200 usb: gadget: hid: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-25-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 2c16f04d24b164af99c86fa1912f48e6bb2e9125 Author: Uwe Kleine-König Date: Thu May 18 01:01:25 2023 +0200 usb: fotg210: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20230517230239.187727-24-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 5b3eb973bf385b6e62368d2428e6b3cba3a0b260 Author: Uwe Kleine-König Date: Thu May 18 01:01:24 2023 +0200 usb: dwc3-xilinx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230517230239.187727-23-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 2f6453761e7c928367a58b49f451a2ddfc191ab2 Author: Uwe Kleine-König Date: Thu May 18 01:01:23 2023 +0200 usb: dwc3-st: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230517230239.187727-22-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit d662268dcca8c0ec72e0bf0b49738a3c0226a254 Author: Uwe Kleine-König Date: Thu May 18 01:01:22 2023 +0200 usb: dwc3-qcom: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230517230239.187727-21-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit abe04efc13edf253a57c1f92b8e83c443a4d670a Author: Uwe Kleine-König Date: Thu May 18 01:01:21 2023 +0200 usb: dwc3-omap: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230517230239.187727-20-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 86a2b452179becbeee1da60a37960326fe843f31 Author: Uwe Kleine-König Date: Thu May 18 01:01:20 2023 +0200 usb: dwc3-of-simple: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230517230239.187727-19-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 3ffea6e0f34c767cbce35e3c541661d0ba18beed Author: Uwe Kleine-König Date: Thu May 18 01:01:19 2023 +0200 usb: dwc3-meson-g12a: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Martin Blumenstingl Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230517230239.187727-18-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 039e3dede538e59432badcd3cdd7d7d808c87efd Author: Uwe Kleine-König Date: Thu May 18 01:01:18 2023 +0200 usb: dwc3-keystone: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230517230239.187727-17-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 3791a3e6f45552bfae3695dc6a5f4b4f237ffca1 Author: Uwe Kleine-König Date: Thu May 18 01:01:17 2023 +0200 usb: dwc3-imx8mp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230517230239.187727-16-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 8257d5f548d6212e62a6d4230a04a5db6d01b487 Author: Uwe Kleine-König Date: Thu May 18 01:01:16 2023 +0200 usb: dwc3-exynos: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230517230239.187727-15-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 890258e22117ed2378d1afc20a351cb46df3e787 Author: Uwe Kleine-König Date: Thu May 18 01:01:15 2023 +0200 usb: dwc3-am62: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230517230239.187727-14-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 0176568702a554effa493de04f51cbe7e4862ef2 Author: Uwe Kleine-König Date: Thu May 18 01:01:14 2023 +0200 usb: core: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230517230239.187727-13-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 4f5bcf19bd2ab8ac4c94bb39951f43e0c5ecd2b0 Author: Uwe Kleine-König Date: Thu May 18 01:01:12 2023 +0200 usb: common: usb-conn-gpio: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-11-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 49e71736dac7124175f30b9c6e696d3c9b1067fa Author: Uwe Kleine-König Date: Thu May 18 01:01:11 2023 +0200 usb: chipidea/core: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-10-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 87202eae1daab035fb0d1a3c71cdc6f35091556c Author: Uwe Kleine-König Date: Thu May 18 01:01:10 2023 +0200 usb: chipidea/ci_hdrc_usb2: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-9-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 906ede9c779e69ce0b6cef4b750b93c7f5c69cf1 Author: Uwe Kleine-König Date: Thu May 18 01:01:09 2023 +0200 usb: chipidea/ci_hdrc_tegra: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-8-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 1c74875cc5dbadd80e4bdadeba37f7d97e7a9c38 Author: Uwe Kleine-König Date: Thu May 18 01:01:08 2023 +0200 usb: chipidea/ci_hdrc_msm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-7-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit ad593ed671feb49e93a77653886c042f68b6cdfd Author: Uwe Kleine-König Date: Thu May 18 01:01:07 2023 +0200 usb: chipidea/ci_hdrc_imx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-6-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit defbfca6945ec5f3362e15ee4ec15180117240c3 Author: Uwe Kleine-König Date: Thu May 18 01:01:06 2023 +0200 usb: cdns3-ti: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-5-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 5411fa0ec65626180e3eddeb30633fc5e2313c01 Author: Uwe Kleine-König Date: Thu May 18 01:01:05 2023 +0200 usb: cdns3-plat: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-4-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit cfab1b8be9ab744d4b1064a8af59c758a2084b1d Author: Uwe Kleine-König Date: Thu May 18 01:01:04 2023 +0200 usb: cdns3-imx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-3-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e8fa2dd9e2bc12f8386f3d5b897d8ea025ee8b7b Author: Uwe Kleine-König Date: Thu May 18 01:01:03 2023 +0200 usb: c67x00-drv: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517230239.187727-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit a9bb3e5d57293773d7f925dd07e45f6e13e94947 Author: Masahiro Yamada Date: Mon May 22 01:04:13 2023 +0900 modpost: remove is_shndx_special() check from section_rel(a) This check is unneeded. Without it, sec_name() will returns the null string "", then section_mismatch() will return immediately. Anyway, special section indices rarely appear in these loops. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 04ed3b476306c1b4c6e544e40d10f477c8193435 Author: Masahiro Yamada Date: Mon May 22 01:04:12 2023 +0900 modpost: replace r->r_offset, r->r_addend with faddr, taddr r_offset/r_addend holds the offset address from/to which a symbol is referenced. It is unclear unless you are familiar with ELF. Rename them to faddr, taddr, respectively. The prefix 'f' means 'from', 't' means 'to'. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit a23e7584ecf33df2b27ac176185c7b030ab0736f Author: Masahiro Yamada Date: Mon May 22 01:04:11 2023 +0900 modpost: unify 'sym' and 'to' in default_mismatch_handler() find_tosym() takes 'sym' and stores the return value to another variable 'to'. You can use the same variable because we want to replace the original one when appropriate. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 05bb0704672dec59cbdc6b901130098ecfe7a846 Author: Masahiro Yamada Date: Mon May 22 01:04:09 2023 +0900 modpost: remove unused argument from secref_whitelist() secref_whitelist() does not use the argument 'mismatch'. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit b36be72b5a7bf607c3e3c771bce4c41d99483038 Author: Uwe Kleine-König Date: Wed May 24 17:16:46 2023 +0200 staging: most: Switch i2c driver back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230524151646.486847-6-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 28f5930b66ed12a4729be0a507460c191460cb46 Author: Uwe Kleine-König Date: Wed May 24 17:16:45 2023 +0200 staging: olpc_dcon: Switch i2c driver back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230524151646.486847-5-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 5d88ce5052d2dcac3e4192f7280ab075a544828a Author: Bagas Sanjaya Date: Wed May 17 16:04:17 2023 +0700 drivers: staging: wlan-ng: Remove GPL/MPL boilerplate Remove the license boilerplate as there is already SPDX license identifier added in b24413180f5600 ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license") which fulfills the same intention as the boilerplate. Cc: Dan Carpenter Cc: Kate Stewart Cc: Philippe Ombredanne Cc: Thomas Gleixner Reviewed-by: Simon Horman Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20230517090418.1093091-4-bagasdotme@gmail.com Signed-off-by: Greg Kroah-Hartman commit e152c58d7a48194d6b530d8e004d650fd01568b6 Author: Arnd Bergmann Date: Tue May 16 22:25:55 2023 +0200 staging: vchiq_arm: mark vchiq_platform_init() static This function has no callers from other files, and the declaration was removed a while ago, causing a W=1 warning: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:465:5: error: no previous prototype for 'vchiq_platform_init' Marking it static solves this problem but introduces a new warning since gcc determines that 'g_fragments_base' is never initialized in some kernel configurations: In file included from include/linux/string.h:254, from include/linux/bitmap.h:11, from include/linux/cpumask.h:12, from include/linux/mm_types_task.h:14, from include/linux/mm_types.h:5, from include/linux/buildid.h:5, from include/linux/module.h:14, from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:8: In function 'memcpy_to_page', inlined from 'free_pagelist' at drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:433:4: include/linux/fortify-string.h:57:33: error: argument 2 null where non-null expected [-Werror=nonnull] include/linux/highmem.h:427:9: note: in expansion of macro 'memcpy' 427 | memcpy(to + offset, from, len); | ^~~~~~ Add a NULL pointer check for this in addition to the static annotation to avoid both. Fixes: 89cc4218f640 ("staging: vchiq_arm: drop unnecessary declarations") Signed-off-by: Arnd Bergmann Reviewed-by: Florian Fainelli Reviewed-by: Umang Jain Link: https://lore.kernel.org/r/20230516202603.560554-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 8942c3f19b3f6cbe5b74ee610d6b5e3ec1ec13fa Author: Michael Straube Date: Thu May 18 18:32:01 2023 +0200 staging: rtl8192e: add missing spaces around operators Add missing spaces around operators to improve readability and clear checkpatch issues. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20230518163201.14463-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2305232c94d2fcefa9e26ba68af73586508ba555 Author: Philipp Hortmann Date: Tue May 16 21:22:06 2023 +0200 staging: rtl8192e: Unlock wx_mutex not in rtllib_wx_set_scan On start of rtllib_wx_set_scan lock was taken with mutex_lock(&ieee->wx_mutex). Unlocking was done at the end of schedule_work(&ieee->wx_sync_scan_wq) which lead to the error "lock held when returning to user space!". Pushing lock to beginning of ieee->wx_sync_scan_wq to improve overview. Removed lock from rtllib_wx_set_scan as ieee->state, ieee->iw_mode and ieee->proto_started are not protected in many other places. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230516192206.GA7710@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman commit 35a70c0305f5e0805006b91a995610ef881e2091 Author: Philipp Hortmann Date: Sun May 14 22:40:33 2023 +0200 staging: rtl8192e: Exclude scan_mutex in rtllib_softmac_stop_scan Exclude scan_mutex from cancel_delayed_work_sync(&ieee->softmac_scan_wq) as ieee->softmac_scan_wq takes scan_mutex as well. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230514204033.GA20187@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman commit dffef6de4db2ddbf1d456e618d06b128b9d0018b Author: Atin Bainada Date: Sat May 13 21:44:31 2023 +0000 staging: rtl8723bs: replace ternary operator with if-else block replace the ternary operator used for assignment of pHalData->ant_path with an if-else block for better readability Signed-off-by: Atin Bainada Link: https://lore.kernel.org/r/20230513214338.79833-1-hi@atinb.me Signed-off-by: Greg Kroah-Hartman commit 09201af57ca4d98a992413b39d51aa1f70beb98c Author: Philipp Hortmann Date: Sat May 13 20:09:40 2023 +0200 staging: rtl8192e: Remove undefined function LedControlHandler Remove function LedControlHandler as it is not defined. Remove resulting unused local variables bLedBlinking, type, fc and LedAction. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e3c29c3db33d314dffb673f8e563da0fb1f2b22f.1683960685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit b17bbcfbf3c80650a8e4e51389e00c4a3d9a6367 Author: Philipp Hortmann Date: Sat May 13 20:09:34 2023 +0200 staging: rtl8192e: Remove undefined function UpdateBeaconInterruptHandler Remove function UpdateBeaconInterruptHandler as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/7cc71096fb1e6fee755dd96de0095ef1fb6d51e1.1683960685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4e2ae4fffd96f0e1aa31988a8ae4d0ca93cd64f1 Author: Philipp Hortmann Date: Sat May 13 20:09:23 2023 +0200 staging: rtl8192e: Remove undefined function SetFwCmdHandler Remove function SetFwCmdHandler as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e141f44176aab38e11d7211ed79cebda68aea5ed.1683960685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit ccffcebb7783ddd3cc9b6791bcc79c5eb64b8bb3 Author: Philipp Hortmann Date: Sat May 13 20:09:17 2023 +0200 staging: rtl8192e: Remove undefined function set_security Remove function set_security as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/bdc9bc3a70ca2b5d86bdd2cb5c815d0b3c67972f.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit ab2f13f29038a42528de55d45e06e98c36083246 Author: Philipp Hortmann Date: Sat May 13 20:09:09 2023 +0200 staging: rtl8192e: Remove undefined function hard_start_xmit Remove function hard_start_xmit as it is not defined. Equation !ieee->hard_start_xmit always evaluates to true. When (*ieee->hard_start_xmit)(txb, dev) == 0 is called the my computer is freezing. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/603a143ba506ca031d7bd70a844b9f080872d601.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 42618f6fbde5212b3b6d378e2419d691f7912605 Author: Philipp Hortmann Date: Sat May 13 20:09:03 2023 +0200 staging: rtl8192e: Remove undefined function reset_port Remove function reset_port as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/faa1fa979b214f709012a8bd65debbcc2bb59049.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 03477a4641373c4496a2e93f5f45e3fb5fc6d6c8 Author: Philipp Hortmann Date: Sat May 13 20:08:56 2023 +0200 staging: rtl8192e: Remove functions rtllib_start_hw_scan and stop Remove functions rtllib_start_hw_scan and rtllib_stop_hw_scan as they are not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/868524470321b8936f63d3ea06ba86c34fc89bb7.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 27b644c575287ce815eb3decab538aad47f762a4 Author: Philipp Hortmann Date: Sat May 13 20:08:50 2023 +0200 staging: rtl8192e: Remove undefined function data_hard_resume Remove function data_hard_resume as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/07048d775759fffe1d1c63d0416214da8311129a.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit a634e894981abbfec0ce3981803fb95a641b9aef Author: Philipp Hortmann Date: Sat May 13 20:08:43 2023 +0200 staging: rtl8192e: Remove undefined function data_hard_stop Remove function data_hard_stop as it is not defined. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4cc180b9538d6c9c32ff0f56646a642fa217a4a4.1683960684.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit da812f15af4f9e0096f8932178e9192fcb0329d3 Author: Niklas Schnelle Date: Mon May 22 12:50:39 2023 +0200 staging: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-35-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 17b53f10aba7c17e92bcf713179bc577cba059b7 Author: Masahiro Yamada Date: Mon May 22 01:04:06 2023 +0900 Revert "modpost: skip ELF local symbols during section mismatch check" This reverts commit a4d26f1a0958bb1c2b60c6f1e67c6f5d43e2647b. The variable 'fromsym' never starts with ".L" since commit 87e5b1e8f257 ("module: Sync code of is_arm_mapping_symbol()"). In other words, Pattern 6 is now dead code. Previously, the .LANCHOR1 hid the symbols listed in Pattern 2. 87e5b1e8f257 provided a better solution. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit c584476d477e7617478dc9a305350629aa155f5c Author: Masahiro Yamada Date: Sun May 21 22:23:36 2023 +0900 doc: Add tar requirement to changes.rst tar is used to build the kernel with CONFIG_IKHEADERS. GNU tar 1.28 or later is required. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 49c386ebbb43394ff4773ce24f726f6afc4c30c8 Author: Masahiro Yamada Date: Sun May 21 22:23:35 2023 +0900 Revert "kheaders: substituting --sort in archive creation" This reverts commit 700dea5a0bea9f64eba89fae7cb2540326fdfdc1. The reason for that commit was --sort=ORDER introduced in tar 1.28 (2014). More than 3 years have passed since then. Requiring GNU tar 1.28 should be fine now because we require GCC 5.1 (2015). Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 42877c38ac78e456fd9e149842a96a3576fb36e5 Author: Osama Muhammad Date: Thu May 25 20:38:37 2023 +0500 HSI: omap_ssi_port: Drop error checking for debugfs_create_dir This patch fixes the error checking in omap_ssi_port.c. The DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes. Signed-off-by: Osama Muhammad Signed-off-by: Sebastian Reichel commit a782318023f339213f29372e2ecae696c0ca4a69 Author: Kathiravan T Date: Tue May 9 21:31:33 2023 +0530 arm64: dts: qcom: ipq5332: add support for the RDP442 variant Add the initial device tree support for the Reference Design Platform(RDP) 442 based on IPQ5332 family of SoC. This patch carries the support for Console UART, SPI NOR, eMMC and I2C. Signed-off-by: Kathiravan T Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230509160133.3794-3-quic_kathirav@quicinc.com commit 68c4c67156ec0e0e1abe11a90e4bb9bfe34ca722 Author: Kathiravan T Date: Tue May 9 21:31:32 2023 +0530 dt-bindings: arm: qcom: document MI01.3 board based on IPQ5332 family Document the MI01.3 (Reference Design Platform 442) board based on IPQ5332 family of SoCs. Signed-off-by: Kathiravan T Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230509160133.3794-2-quic_kathirav@quicinc.com commit 6390213bb5bb06c3babada641c2f679501d1bfba Author: Andrew Lunn Date: Thu May 25 20:26:06 2023 +0200 ARM: dts: vf610: ZII: Add missing phy-mode and fixed links The DSA framework has got more picky about always having a phy-mode for the CPU port. The Vybrid FEC is a Fast Ethrnet using RMII. Additionally, the cpu label has never actually been used in the binding, so remove it. Lastly, for DSA links between switches, add a fixed-link node indicating the expected speed/duplex of the link. Signed-off-by: Andrew Lunn Signed-off-by: Shawn Guo commit 62c9f9c1d4debaa28ba10b23c1dc7be573602898 Author: Fabio Estevam Date: Wed May 24 22:12:26 2023 -0300 ARM: dts: imx6qdl-icore-rqs: Use the 'vmmc-supply' property 'vmcc-supply' is not a valid property. Use 'vmmc-supply' supply instead. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 7fe4e51820caee89899e53ef66b4058f3fb28222 Author: Fabio Estevam Date: Wed May 24 19:46:25 2023 -0300 ARM: dts: vfxxx: Remove invalid wdog property The 'clock-names' property is not a valid property for wdog. Remove it to fix the following DT check warning: vf610-zii-ssmb-dtu.dtb: watchdog@4003e000: Unevaluated properties are not allowed ('clock-names' was unexpected) From schema: /Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.yaml Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit a211ff74773f59cc492346a8d203302b100d56c0 Author: Fabio Estevam Date: Wed May 24 19:46:24 2023 -0300 ARM: dts: imx35: Remove invalid wdog property The 'clock-names' property is not a valid property for wdog. Remove it to fix the following DT check warning: watchdog@53fdc000: Unevaluated properties are not allowed ('clock-names' was unexpected) From schema: Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.yaml Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit b3cea7201551e7f82dd8ea7971e8248e320dd8e7 Author: Fabio Estevam Date: Wed May 24 19:34:40 2023 -0300 ARM: dts: imx7d-flex-concentrator: Remove invalid ecspi property The 'num-chipselects' property is not a valid property for ecspi. Remove it to fix the following DT check warning: spi@30630000: Unevaluated properties are not allowed ('num-chipselects' was unexpected) From schema: Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 80ad9b634eff7f4232947a6551b049cc955fb91d Author: Fabio Estevam Date: Wed May 24 19:26:11 2023 -0300 ARM: dts: imx6ull-phytec-tauri: Remove invalid property The 'rs485-rts-active-high' property is not a valid property and is not documented anywhere. Remove it to fix the following DT schema warning: serial@21f0000: Unevaluated properties are not allowed ('rs485-rts-active-high' was unexpected) Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit e8b4c363255ac5ead34f731716b83b1744c278ac Author: Wei Fang Date: Thu May 25 16:08:25 2023 +0800 arm64: dts: imx93: add fsl,stop-mode property to support WOL Add fsl,stop-mode property for FEC to support Wake-on-LAN (WOL) feature. Otherwise, the WOL feature of FEC does not work. Signed-off-by: Wei Fang Signed-off-by: Shawn Guo commit f9acd1a110b577a9adf3f11d0aee973bd792ed29 Author: Fabio Estevam Date: Wed May 24 10:10:08 2023 -0300 ARM: dts: imx7d-smegw01: Pass Ethernet aliases Pass Ethernet aliases, so that the bootloader can properly pass MAC address to Linux. This fixes the problem of getting a random MAC address for eth1 in Linux. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 353791ce48c8e0683e863493f4c35a6bba94b7d9 Author: Fabio Estevam Date: Wed May 24 10:10:07 2023 -0300 ARM: dts: imx7d-smegw01: Use pinctrl-0 for pinctrl_rfkill Use pinctrl-0 for pinctrl_rfkill to fix the following 'make CHECK_DTBS=y imx7d-smegw01.dtb' warning: regulator-wlan-rfkill: 'pinctrl-0' is a dependency of 'pinctrl-names' Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 1b2b6039bd76f2ece9c0ba82b8116c4eb6ab2445 Author: Fabio Estevam Date: Wed May 24 10:10:06 2023 -0300 ARM: dts: imx7d-smegw01: Pass 'gpr' to the pinctrl groups Pass 'gpr' to the pinctrl groups to fix the following 'make CHECK_DTBS=y imx7d-smegw01.dtb' warning: pinctrl@30330000: 'rfkillrp', 'usbotg1', 'usbotg1-pwr', 'usbotg1-pwr-gpio' do not match any of the regexes: 'grp$', 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/pinctrl/fsl,imx7d-pinctrl.yaml Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0cf099dfe405c42d4596931cdac1e2f3734a9c27 Author: Fabio Estevam Date: Wed May 24 10:10:05 2023 -0300 ARM: dts: imx7d-smegw01: Remove unneeded #address-cells/#size-cells Remove the unneeded #address-cells/#size-cells from sram@0 to fix the following 'make CHECK_DTBS=y imx7d-smegw01.dtb' warning: sram@0: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected) From schema: Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yaml Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 04a0b7b88402caf01fe5ebd0df28c3d956c61a50 Author: Marek Vasut Date: Sat May 27 12:22:33 2023 +0200 arm64: dts: imx8mp: Enable SAI audio on MX8MP DHCOM PDK2 and PDK3 Add SAI I2S and audio bindings on MX8MP DHCOM PDK2 and PDK3. The VDDA is supplied from on-carrier-board regulator, the VDDIO is supplied from always-on on-SoM regulator. Except for different I2C bus used to connect the codec, the implementation is virtually identical on both carrier boards. Align regulator-avdd name to regulator-3p3vdd on PDK3, since this is the VDDA supply and it is the same on both carrier boards. Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit 4d4ed48f9bda5ce9954b5af23548e68f166066ac Author: Tim Harvey Date: Mon May 22 12:32:17 2023 -0700 arm64: dts: imx8mm-venice-gw700x: remove invalid props from fan-controller Remove the invalid #address-cells and #size-cells nodes from the fan-controller. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 785167f21d6fb440d14f629a3c44978048ed0be5 Author: Tim Harvey Date: Mon May 22 12:32:19 2023 -0700 ARM: dts: imx6qdl-gw5912: remove invalid nodes from fan-controller Remove the invalid #address-cells and #size-cells nodes from the fan-controller. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 64719d28a36a6369db64ffd171177a9197f0cb59 Author: Tim Harvey Date: Mon May 22 12:32:18 2023 -0700 ARM: dts: imx6qdl-gw54xx: remove invalid nodes from fan-controller Remove the invalid #address-cells and #size-cells nodes from the fan-controller. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit b74edf626c4f99b3fc7f426bb47e5e52a3bcc4a8 Author: Fabio Estevam Date: Tue May 23 20:52:32 2023 -0300 ARM: dts: imx6sx: Add LDB support i.MX6SX has an LVDS controller that is connected to the eLCDIF. Add support for it. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 6b9da260703096b366ec0fe78d87053e8f577776 Author: Ian Rogers Date: Sat May 27 00:22:10 2023 -0700 perf pmu: Remove is_pmu_hybrid Users have been removed or switched to using pmu->is_core with perf_pmus__num_core_pmus() > 1. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-35-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 94f9eb95d954bee0149fd1ce84c239c9e09ae9d8 Author: Ian Rogers Date: Sat May 27 00:22:09 2023 -0700 perf pmus: Remove perf_pmus__has_hybrid perf_pmus__has_hybrid was used to detect when there was >1 core PMU, this can be achieved with perf_pmus__num_core_pmus that doesn't depend upon is_pmu_hybrid and PMU name comparisons. When modifying the function calls take the opportunity to improve comments, enable/simplify tests that were previously failing for hybrid but now pass and to simplify generic code. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-34-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 002c4845758e87efee8ec6ba6e6f9f1bcf0c3330 Author: Ian Rogers Date: Sat May 27 00:22:08 2023 -0700 perf pmus: Add function to return count of core PMUs Add perf_pmus__num_core_pmus that will count core PMUs holding the result in a static. Reuse for perf_pmus__num_mem_pmus. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-33-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1dd5f78d8337a7a69c9b76886a82e87524e56a51 Author: Ian Rogers Date: Sat May 27 00:22:07 2023 -0700 perf pmus: Ensure all PMUs are read for find_by_type perf_pmus__find_by_type may be called for something like a raw event, in which case the PMU isn't guaranteed to have been looked up. Add a second check to make sure all PMUs are loaded. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-32-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8e7d8a2eef3e48223a46e3ba676ce01a881a8519 Author: Ian Rogers Date: Sat May 27 00:22:06 2023 -0700 perf pmus: Avoid repeated sysfs scanning perf_pmus__scan will process every directory in sysfs to see if it is a PMU, attempting to add it if not already in the pmus list. Add two booleans to record whether this scanning has been done for core or all PMUs. Skip scanning in the event that scanning has already occurred. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-31-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 9d6a1df9b2eef52ad03a594b1237a16dbbe34e83 Author: Ian Rogers Date: Sat May 27 00:22:05 2023 -0700 perf pmus: Allow just core PMU scanning Scanning all PMUs is expensive as all PMUs sysfs entries are loaded, benchmarking shows more than 4x the cost: ``` $ perf bench internals pmu-scan -i 1000 Computing performance of sysfs PMU event scan for 1000 times Average core PMU scanning took: 989.231 usec (+- 1.535 usec) Average PMU scanning took: 4309.425 usec (+- 74.322 usec) ``` Add new perf_pmus__scan_core routine that scans just core PMUs. Replace perf_pmus__scan calls with perf_pmus__scan_core when non-core PMUs are being ignored. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-30-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 15c57a8037c9683fb5c09ecc576a333c02d6f105 Author: Ian Rogers Date: Sat May 27 00:22:04 2023 -0700 perf pmus: Split pmus list into core and other Split the pmus list into core and other. This will later allow for the core and other pmus to be populated separately. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-29-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1eaf496ed386934f1c2439a120fe84a05194f91a Author: Ian Rogers Date: Sat May 27 00:22:03 2023 -0700 perf pmu: Separate pmu and pmus Separate and hide the pmus list in pmus.[ch]. Move pmus functionality out of pmu.[ch] into pmus.[ch] renaming pmus functions which were prefixed perf_pmu__ to perf_pmus__. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-28-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 875375ea91d8044baddcb62d8333b58f687de444 Author: Ian Rogers Date: Sat May 27 00:22:02 2023 -0700 perf x86 mem: minor refactor to is_mem_loads_aux_event Find the PMU and then the event off of it. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-27-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f24ebe8053514936d4e8cffb707af3a275fa32e5 Author: Ian Rogers Date: Sat May 27 00:22:01 2023 -0700 perf pmus: Prefer perf_pmu__scan over perf_pmus__for_each_pmu perf_pmus__for_each_pmu doesn't lazily initialize pmus making its use error prone. Just use perf_pmu__scan as this only impacts non-performance critical tests. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-26-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 597a4276fb326163b90754ef7b2a550a6b2b4054 Author: Ian Rogers Date: Sat May 27 00:22:00 2023 -0700 perf pmu: Remove perf_pmu__hybrid_pmus list Rather than iterate hybrid PMUs, inhererently Intel specific, iterate all PMUs checking whether they are core. To only get hybrid cores, first call perf_pmu__has_hybrid. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-25-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit abe9544ea78a2e0c3cc92b4410a57a9c0732293f Author: Ian Rogers Date: Sat May 27 00:21:59 2023 -0700 perf mem: Avoid hybrid PMU list Add perf_pmu__num_mem_pmus that scans/counts the number of PMUs for mem events. Switch perf_pmu__for_each_hybrid_pmu to iterating all PMUs and only handling is_core ones. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-24-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3d88055f081056be6448a2628ad815d88d7ed570 Author: Ian Rogers Date: Sat May 27 00:21:58 2023 -0700 perf stat: Avoid hybrid PMU list perf_pmu__is_hybrid implicitly uses the hybrid PMU list. Instead return false if hybrid isn't present, if it is then see if any evsel's PMUs are core. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-23-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ec6a4a8bd3a554674eaa4ac3f423e1a5347427ee Author: Ian Rogers Date: Sat May 27 00:21:57 2023 -0700 perf metrics: Remove perf_pmu__is_hybrid use Switch from perf_pmu__is_hybrid to avoid implicitly using the hybrid PMU list. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-22-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 178ddf3bad981380ad284ba1d70013cf1fdef981 Author: Ian Rogers Date: Sat May 27 00:21:56 2023 -0700 perf header: Avoid hybrid PMU list in write_pmu_caps Avoid perf_pmu__for_each_hybrid_pmu by iterating all PMUs are dumping the core ones. This will eventually allow removal of the hybrid PMU list. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-21-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5d9fb6667642ce1e382afd37184ec6acf1bb7626 Author: Ian Rogers Date: Sat May 27 00:21:55 2023 -0700 perf evsel: Compute is_hybrid from PMU being core Short-cut when has_hybrid is false, otherwise return if the evsel's PMU is core. Add a comment for the some what surprising no PMU cases of hardware and legacy cache events. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-20-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1215795cebb24578afd378b23d206014327558c4 Author: Ian Rogers Date: Sat May 27 00:21:54 2023 -0700 perf topology: Avoid hybrid list for hybrid topology Avoid perf_pmu__for_each_hybrid_pmu in hybrid_topology__new by scanning all PMUs and processing the is_core ones. Add early exit for non-hybrid. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-19-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit dd64647ecbba7572e41489c9bc54980aeb434bc2 Author: Ian Rogers Date: Sat May 27 00:21:53 2023 -0700 perf x86: Iterate hybrid PMUs as core PMUs Rather than iterating over a separate hybrid list, iterate all PMUs with the hybrid ones having is_core as true. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-18-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ab1a1c77a38ad1efea4396f271ccde53b58c1b8e Author: Ian Rogers Date: Sat May 27 00:21:52 2023 -0700 perf pmu: Rewrite perf_pmu__has_hybrid to avoid list Rather than list empty on perf_pmu__hybrid_pmus, detect if any core PMUs match the hybrid name. Computed values held in statics to avoid recomputation. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-17-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 4ced2c246e2c9c90a7ea96f4bcd31a0b696b8dd6 Author: Ian Rogers Date: Sat May 27 00:21:51 2023 -0700 perf pmu: Remove perf_pmu__hybrid_mounted perf_pmu__hybrid_mounted is used to detect whether cpu_core or cpu_atom is mounted with a non-empty cpus file by pmu_lookup. Discussion [1] showed the empty cpus file check to be redundant and so pmu_lookup needn't have a call to perf_pmu__hybrid_mounted. Checking hybrid_mounted in pmu_is_uncore is redundant as the next cpumask read will fail returning false. Reduce the scope of perf_pmu__find_hybrid_pmu by making it static. [1] https://lore.kernel.org/lkml/20230524221831.1741381-17-irogers@google.com/ Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-16-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit b167b530eb83dfd791061e1d312236bffde772a4 Author: Ian Rogers Date: Sat May 27 00:21:50 2023 -0700 perf evlist: Reduce scope of evlist__has_hybrid Function is only used in printout, reduce scope to stat-display.c. Remove the now empty evlist-hybrid.c and evlist-hybrid.h. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-15-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7b100989b4f6bce7090ef89badf4091b1730d14c Author: Ian Rogers Date: Sat May 27 00:21:49 2023 -0700 perf evlist: Remove __evlist__add_default __evlist__add_default adds a cycles event to a typically empty evlist and was extended for hybrid with evlist__add_default_hybrid, as more than 1 PMU was necessary. Rather than have dedicated logic for the cycles event, this change switches to parsing 'cycles:P' which will handle wildcarding the PMUs appropriately for hybrid. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-14-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit b4388dfa3ae5aca7d4d3bbc9b80fe5e483ef78e9 Author: Ian Rogers Date: Sat May 27 00:21:48 2023 -0700 perf evlist: Remove evlist__warn_hybrid_group Parse events now corrects PMU groups in parse_events__sort_events_and_fix_groups and so this warning is no longer possible. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-13-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5ac72634482143a8be5e04e5d09a2026f6a94315 Author: Ian Rogers Date: Sat May 27 00:21:47 2023 -0700 perf tools: Warn if no user requested CPUs match PMU's CPUs In commit 1d3351e631fc ("perf tools: Enable on a list of CPUs for hybrid") perf on hybrid will warn if a user requested CPU doesn't match the PMU of the given event but only for hybrid PMUs. Make the logic generic for all PMUs and remove the hybrid logic. Warn if a CPU is requested that isn't present/offline for events not on the core. Warn if a CPU is requested for a core PMU, but the CPU isn't within the cpu map of that PMU. For example on a 16 (0-15) CPU system: ``` $ perf stat -e imc_free_running/data_read/,cycles -C 16 true WARNING: A requested CPU in '16' is not supported by PMU 'uncore_imc_free_running_1' (CPUs 0-15) for event 'imc_free_running/data_read/' WARNING: A requested CPU in '16' is not supported by PMU 'uncore_imc_free_running_0' (CPUs 0-15) for event 'imc_free_running/data_read/' WARNING: A requested CPU in '16' is not supported by PMU 'cpu' (CPUs 0-15) for event 'cycles' Performance counter stats for 'CPU(s) 16': MiB imc_free_running/data_read/ cycles 0.000575312 seconds time elapsed ``` Remove evlist__fix_hybrid_cpus that previously produced the warnings and also perf_pmu__cpus_match that worked with evlist__fix_hybrid_cpus to change CPU maps for hybrid CPUs, something that is no longer necessary as CPU map propagation properly intersects user requested CPUs with the core PMU's CPU map. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-12-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8ec984d53714dfa538f3f5b1e22a309ac18edf63 Author: Ian Rogers Date: Sat May 27 00:21:46 2023 -0700 perf target: Remove unused hybrid value Previously this was used to modify CPU map propagation, but it is now unnecessary as map propagation ensure core PMUs only have valid PMUs in the CPU map from user requested CPUs. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-11-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 42249160cc6837396acf3358bc724612ce24d035 Author: Ian Rogers Date: Sat May 27 00:21:45 2023 -0700 perf evlist: Allow has_user_cpus to be set on hybrid Now that CPU map propagation only sets valid CPUs for core PMUs, there is no reason to disable "has_user_cpus" for hybrid. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-10-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ef91871c960ed1e9e790ed66840835fac87614b7 Author: Ian Rogers Date: Sat May 27 00:21:44 2023 -0700 perf evlist: Propagate user CPU maps intersecting core PMU maps The CPU map for a non-core PMU gives a default CPU value for perf_event_open. For core PMUs the CPU map lists all CPUs the evsel may be opened on. If there are >1 core PMU, the CPU maps will list the CPUs for that core PMU, but the user_requested_cpus may contain CPUs that are invalid for the PMU and cause perf_event_open to fail. To avoid this, when propagating the CPU map for core PMUs intersect it with the CPU map of the PMU (the evsel's "own_cpus"). Add comments to __perf_evlist__propagate_maps to explain its somewhat complex behavior. Fix the related comments for system_wide in struct perf_evsel. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-9-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a0c41caebab2fa224454d50dd4e29ae008ead25f Author: Ian Rogers Date: Sat May 27 00:21:43 2023 -0700 perf pmu: Add CPU map for "cpu" PMUs A typical "cpu" PMU has no "cpus" or "cpumask" file meaning the CPU map is set to NULL, which also encodes an empty CPU map. Update pmu_cpumask so that if the "cpu" PMU fails to load a CPU map, use a default of all online PMUs. Remove const from cpu_map__online for the sake of reference counting. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1578e63d3ac292abb95767ec197a4ddd094523ce Author: Ian Rogers Date: Sat May 27 00:21:42 2023 -0700 perf evsel: Add is_pmu_core inorder to interpret own_cpus The behaviour of handling cpu maps varies for core and other PMUs. For core PMUs the cpu map lists all valid CPUs, whereas for other PMUs the map is the default CPU. Add a flag in the evsel to indicate if a PMU is core to help with later interpreting of the cpu maps and populate it when the evsel is created during parsing. When propagating cpu maps, core PMUs should intersect the cpu map of the PMU with the user requested one. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8a2240f256f5c549600e1d0bda438d2b04731b2b Author: Otavio Salvador Date: Tue May 23 18:28:29 2023 -0300 ARM: imx_v6_v7_defconfig: Remove KERNEL_LZO config The KERNEL_GZIP is used in most config and is the default, there is no clear reason to diverge so let default be used. Signed-off-by: Otavio Salvador Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit e20d1f2fa29707d1fad7a667737257b9494043fd Author: Ian Rogers Date: Sat May 27 00:21:41 2023 -0700 perf pmu: Add is_core to pmu Cache is_pmu_core in the pmu to avoid recomputation. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 4bf7e81aadfdfb6f2e5197c5d3cf50ab9ddfb286 Author: Ian Rogers Date: Sat May 27 00:21:40 2023 -0700 perf pmu: Detect ARM and hybrid PMUs with sysfs is_arm_pmu_core detects a core PMU via the presence of a "cpus" file rather than a "cpumask" file. This pattern holds for hybrid PMUs so rename the function and remove redundant perf_pmu__is_hybrid tests. Add a new helper is_pmu_hybrid similar to is_pmu_core. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 916ce34ac9f542a828293da171a442a497d1f9d2 Author: Ian Rogers Date: Sat May 27 00:21:39 2023 -0700 libperf cpumap: Add "any CPU"/dummy test function It is common in the code currently to test a map for "empty" when in fact the "any CPU"/dummy value of -1 is being sought. Add a new function to enable this and document the behavior of two other functions. The term "any CPU" comes from perf_event_open, where the value is consumed, but it is more typical in the code to see this value/map referred to as the dummy value. This could be misleading due to the dummy event and also dummy not being intention revealing, so it is hoped to migrate the code to referring to this as "any CPU". Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 74c075cab1e793fe8418f15eb6e6c88d2197ce1d Author: Ian Rogers Date: Sat May 27 00:21:38 2023 -0700 perf cpumap: Add equal function Equality is a useful property to compare after merging and intersecting maps. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7d1b529f164d33ad4514b272bcec65036873d717 Author: Ian Rogers Date: Sat May 27 00:21:37 2023 -0700 perf cpumap: Add internal nr and cpu accessors These accessors assume the map is non-null. Rewrite functions to use rather than direct accesses. This also fixes a build regression for REFCNT_CHECKING in the intersect function. Suggested-by: Arnaldo Carvalho de Melo Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230527072210.2900565-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit caa90a7bd3bef1814e680da9e2538c1a813aa8a9 Author: Ian Rogers Date: Fri May 26 22:55:17 2023 -0700 perf test python: Put perf python at start of sys.path This avoids picking up a system installed version of the perf python module. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230527055517.2711487-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit eb2a7d92dd9f94c0ec9e7c0620e83a993e35eec8 Author: Haibo Chen Date: Fri May 19 14:27:31 2023 +0800 ARM: dts: imx6sll-evk: avoid underscores in node name usdhc1 and usdhc3 node name contain underscores, so replace the '_' by '-'. Signed-off-by: Haibo Chen Signed-off-by: Shawn Guo commit c5e341aacd3af5f4dbf3b320d0a75cfe56157470 Author: Haibo Chen Date: Fri May 19 14:27:30 2023 +0800 ARM: dts: imx6sll-evk: add eMMC node support On imx6sll-evk board, eMMC is connect on the usdhc2. Signed-off-by: Haibo Chen Signed-off-by: Shawn Guo commit 0d5b288c2110e8a7c74daf90a5e030c44a08ae1c Author: Tim Harvey Date: Tue May 16 12:00:41 2023 -0700 arm64: dts: freescale: Add imx8mp-venice-gw7905-2x The Gateworks imx8mp-venice-gw7905-2x consists of a SOM + baseboard. The GW702x SOM contains the following: - i.MX8M Plus SoC - LPDDR4 memory - eMMC Boot device - Gateworks System Controller (GSC) with integrated EEPROM, button controller, and ADC's - PMIC - RGMII PHY (eQoS) - SOM connector providing: - eQoS GbE MII - 1x SPI - 2x I2C - 4x UART - 2x USB 3.0 - 1x PCI - 1x SDIO (4-bit 3.3V) - 1x SDIO (4-bit 3.3V/1.8V) - GPIO The GW7905 Baseboard contains the following: - GPS - microSD - off-board I/O connector with I2C, SPI, GPIO - EERPOM - PCIe clock generator - 1x full-length miniPCIe socket with PCI/USB3 (via mux) and USB2.0 - 1x half-length miniPCIe socket with USB2.0 and USB3.0 - USB 3.0 HUB - USB Type-C with USB PD Sink capability and peripheral support - USB Type-C with USB 3.0 host support Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 20d0b83e712b92163ddcfb313288272720272733 Author: Marek Vasut Date: Mon May 15 18:24:24 2023 +0200 arm64: dts: imx8mp: Add TC9595 bridge on DH electronics i.MX8M Plus DHCOM Add TC9595 DSI-to-DPI and DSI-to-(e)DP bridge to DH electronics i.MX8M Plus DHCOM SoM . The bridge is populated on the SoM, but disabled by default unless used for display output. Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit a101ba8587fae1dfd7b1bfb13397000a381b0774 Author: Alexander Stein Date: Wed May 17 12:11:07 2023 +0200 ARM: dts: imx6qdl: Add HDMI to TQMa6x/MBa6 This adds support for a COTS monitor connected to X17. 4k monitors can be used, but are limited to 1080p. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 50b1e9ece16c5fa680ae1c6fdc660b1f065e9b40 Author: Tim Harvey Date: Tue May 16 12:00:40 2023 -0700 dt-bindings: arm: Add Gateworks i.MX8M GW7905-2x board Add DT compatible string for a Gateworks GW7905-2x board based on the i.MX8MPlus from NXP. Signed-off-by: Tim Harvey Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 0a207b6b1892efafef80ad2fb21761f3b0f6f13a Author: Krzysztof Kozlowski Date: Mon May 15 15:20:00 2023 +0200 soundwire: qcom: drop unused struct qcom_swrm_ctrl members Drop unused members from the driver state container: struct qcom_swrm_ctrl. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230515132000.399745-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 3d912d1a28da59a95e046feff3ea2bc38e00138e Author: Chao Song Date: Mon May 15 16:13:01 2023 +0800 soundwire: intel: read AC timing control register before updating it Start from ACE1.x, DOAISE is added to AC timing control register bit 5, it combines with DOAIS to get effective timing, and has the default value 1. The current code fills DOAIS, DACTQE and DODS bits to a variable initialized to zero, and updates the variable to AC timing control register. With this operation, We change DOAISE to 0, and force a much more aggressive timing. The timing is even unable to form a working waveform on SDA pin on Meteorlake. This patch uses read-modify-write operation for the AC timing control register access, thus makes sure those bits not supposed and intended to change are not touched. Signed-off-by: Chao Song Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515081301.12921-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 6dd0776ddde8ae187c04803c53becd55eccf4fc3 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:42 2023 +0800 soundwire: intel: use substream for .free callback The interface is not needed for IPC3 but will be needed for ACE2.x+IPC4 combinations, with the substream information passed as a parameter. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-27-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 0127104507b1cfb7d79e0c56668431145f873bbf Author: Pierre-Louis Bossart Date: Mon May 15 15:10:41 2023 +0800 soundwire: intel: remove .free callback implementation The interface is not needed for IPC3 solution but will be needed with an updated parameter list for ACE2.x+IPC4 combinations. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-26-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 8bff8c49c85b073e5086d98b0a47a9ad7b52198a Author: Pierre-Louis Bossart Date: Mon May 15 15:10:40 2023 +0800 soundwire: intel: use substream for .trigger callback The interface is not needed for IPC3 but will be needed for ACE2.x+IPC4 combinations, with the substream information passed as a parameter. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-25-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 02428406a0b0016c9a4d286f98bac8d9af0c1bed Author: Pierre-Louis Bossart Date: Mon May 15 15:10:39 2023 +0800 soundwire: intel: remove .trigger callback implementation The interface is not needed for IPC3 solutions but will be needed with an updated parameter list for ACE2.x+IPC4 combinations. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-24-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 1d905d355ef329d2e4fbe04569dea7cb041419c1 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:38 2023 +0800 ASoC: SOF/soundwire: re-add substream in params_stream structure An earlier simplification to only pass the direction is no longer suitable, all the ACE2.x HDaudio DMA management relies on access to the substream structure. This patch is an iso-functionality change, the HDaudio DMA parts will be provided separately. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-23-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 32c3aa85fb9b19fc0fcb705e3406eec75e8b8f5a Author: Pierre-Louis Bossart Date: Mon May 15 15:10:37 2023 +0800 soundwire: intel_ace2x: add pre/post bank switch callbacks The .pre_ and .post_switch callbacks are mandatory. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-22-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit bcf71917c9ddd6714126e6115bfa26ea482d7afb Author: Pierre-Louis Bossart Date: Mon May 15 15:10:36 2023 +0800 soundwire: intel_ace2x: add new_peripheral_assigned callback Add the abstraction needed to only program the LSDIID registers for the HDaudio extended links. It's perfectly fine to program this register multiple times in case devices lose sync and reattach. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-21-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 6bac0d8d1b4c2dd0fc90b64451ffb88a206adda0 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:35 2023 +0800 soundwire: bus: add new manager callback to deal with peripheral enumeration When a peripheral reports as ATTACHED, the manager may need to follow a programming sequence, e.g. to assign DMA resources and/or assign a command queue for that peripheral. This patch adds an optional callback, which will be invoked every time the peripheral attaches. This might be overkill in some scenarios, and one could argue that this should be invoked only on the first attachment. The bus does not however track this first attachment with any existing state-mirroring variable, and using dev_num_sticky would not work across suspend-resume cycles. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-20-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 7ba18639a9f00eab530b10e417fffccdbeb9418f Author: Pierre-Louis Bossart Date: Mon May 15 15:10:34 2023 +0800 soundwire: intel_ace2x: add check_cmdsync_unlocked helper This is the last callback needed for all bus management routines on new hardware. Same concept as before, just different register. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-19-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit b8e39bc4c20f97b0077a90f7e129b066fcdfdc69 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:33 2023 +0800 soundwire: intel_ace2x: enable wake support The WAKEEN and WAKESTS registers were moved to the per-link SHIM_VS area. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-18-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit f90ba30170f2330ed050cf4b795723fe9730f418 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:32 2023 +0800 soundwire: intel_ace2x: use common helpers for bus start/stop The sequences are so far identical, so the abstraction is a bit over-engineered. In time we will simplify if there is no need to special case or work-around programming sequences. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-17-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 4d1e2464a1104b85f47bb8d5f60698b265aceda5 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:31 2023 +0800 soundwire: intel_ace2x: add sync_arm/sync_go helpers Same functionality as before, but with the registers moved to the HDaudio multi-link area. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-16-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit d2f0daf6f1278128af9e7b0b79a4c3f9614f7ec5 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:30 2023 +0800 soundwire: intel_ace2x: add DAI registration The code is similar to the previous implementation, the only difference is that the PDI descriptors are now in different areas. Using common helpers proves tricky with multiple changed registers, workarounds that are no longer necessary. It's simpler to duplicate the intel_register_dai() function rather than try to add multiple levels of abstraction and indirections. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-15-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit f40bb2446f1e27f14fff97b811ed862ef73a6583 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:29 2023 +0800 soundwire: intel_ace2x: configure link PHY Unlike previous hardware generations, the glue-to-master transition is not managed by software, instead the transitions are managed as part of the power-up/down sequences controlled by SPA/CPA bits. The only thing that's required is to configure the link PHY for 'normal' operation instead of the PHY test mode. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-14-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit d3565643dda3260dcb7c17b57759e35a02908d17 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:28 2023 +0800 soundwire: intel_ace2x: set SYNCPRD before powering-up The registers used for multi-link synchronization are no longer in the SHIM but in the HDaudio multi-link capability space. Use helpers to configure the SYNCPRD value, and wait for SYNCPU to change after powering-up. Note that the SYNCPRD value is shared between all sublinks, for obvious reasons if those links are supposed to be synchronized. The value of SYNCPRD is programmed only once for all sublinks. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-13-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 806f5abd9ce7af9b0140976095e57614364d4011 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:27 2023 +0800 soundwire: intel_ace2x: add link power-up/down helpers only power-up/down for now, the frequency is not set. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-12-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 312316d5a16c46ae0630dda574b243dba06195c6 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:26 2023 +0800 soundwire: intel_ace2x: add debugfs support Add access to registers in SHIM and SHIM_VS (vendor-specific) areas. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-11-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit e52cae0bb40c238c0ac1e6c2ff1fb63037fe741c Author: Pierre-Louis Bossart Date: Mon May 15 15:10:25 2023 +0800 soundwire: intel_init: use eml_lock parameter Now that the ASoC/SOF/HDAudio parts has retrieved the mutex and set the parameter, we can use it to share the same synchronization across the two domains. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-10-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit be1798d0d7153bb9900fd6a05f4f34b9bee2c287 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:24 2023 +0800 ASoC: SOF: Intel: hda: retrieve SoundWire eml_lock and pass pointer Use new helper and interface to make sure the HDaudio and SoundWire parts use the same mutex when accessing shared registers. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Acked-by: Mark Brown Link: https://lore.kernel.org/r/20230515071042.2038-9-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit ec2c9dbe5392cd17b7b1144918350d67cfbb9ff7 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:23 2023 +0800 soundwire: intel: add eml_lock in the interface for new platforms In existing Intel/SoundWire systems, all the SoundWire configuration is 'self-contained', with the 'shim_lock' mutex used to protect access to shared registers in multi-link configurations. With the move of part of the SoundWire registers to the HDaudio multi-link structure, we need a unified lock. The hda-mlink implementation provides an 'eml_lock' that is used to protect shared registers such as LCTL and LSYNC, we can pass it to the SoundWire side. There is no issue with possible dangling pointers since the SoundWire auxiliary devices are children of the PCI device, so the 'eml_lock' cannot be removed while the SoundWire side is in use. This patch only adds the interface for now. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-8-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 881cf1e9df731e6dc238ca83067c17c782e2a059 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:22 2023 +0800 ASoC/soundwire: intel: pass hdac_bus pointer for link management The hdac_bus pointer is used to access the extended link information and handle power management. Pass it from the SOF driver down to the auxiliary devices. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Acked-by: Mark Brown Link: https://lore.kernel.org/r/20230515071042.2038-7-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit e40e0e11fe64a0ac93fb11c3c448b844516bc6ee Author: Pierre-Louis Bossart Date: Mon May 15 15:10:21 2023 +0800 soundwire: intel/cadence: set ip_offset at run-time Select relevant ip-offset depending on hardware version. This offset is used to access MCP_ or IP_MCP_ registers with a fixed offset. For existing platforms, the offset is exactly zero. Starting with LunarLake, the offset is 0x4000. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-6-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 6ab915b9c355caa1f80e9e383892052523f49d1f Author: Pierre-Louis Bossart Date: Mon May 15 15:10:20 2023 +0800 soundwire/ASOC: Intel: update offsets for LunarLake The previous settings are not applicable, use a flag to determine what the register layout is. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Acked-by: Mark Brown Link: https://lore.kernel.org/r/20230515071042.2038-5-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 6f23f4e2c62b086d92b6ee707843e8bf821283d7 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:19 2023 +0800 soundwire: intel_ace2x: add empty new ops for LunarLake The register map and programming sequences for the ACE2.x IP are completely different and need to be abstracted with a different set of callbacks. This initial patch adds a new file, follow-up patches will add each required callback. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 27c433ce081ffbd59e6c785770c871d1785c3b41 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:18 2023 +0800 soundwire: intel: add ACE2.x SHIM definitions With the HDaudio extended link integration, the SHIM and IP registers are split in blocks a) SHIM generic registers b) IP registers (same offsets for Cadence IP as before) c) SHIM vendor-specific registers Add offsets and definitions as defined in the hardware specifications. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230515071042.2038-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 4f5706f16c99d70a610eaade8273ea99152d2959 Author: Pierre-Louis Bossart Date: Mon May 15 15:10:17 2023 +0800 ASoC: SOF: Intel: shim: add enum for ACE 2.0 IP used in LunarLake Add the new enum needed for SoundWire IP selection. The LunarLake PCI descriptors and DSP parts will be added at a later time. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Acked-by: Mark Brown Link: https://lore.kernel.org/r/20230515071042.2038-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit ec5d218e1e443dd6fea7e77983c3f97b9e09a74a Author: Sebastian Reichel Date: Fri May 26 19:22:55 2023 +0200 arm64: dts: rockchip: add PMIC to rk3588-evb1 This adds PMIC support for the RK3588 EVB. Co-developed-by: shengfei Xu Signed-off-by: shengfei Xu Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230526172255.68236-1-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 3a9181a43b94c119da9f332cfc048d4b42119db3 Author: Jagan Teki Date: Tue May 16 22:04:54 2023 +0530 arm64: dts: rockchip: Add rk3588 Edgeble Neu6 Model B IO Neural Compute Module 6B(Neu6B) IO board is an industrial form factor ready-to-use IO board from Edgeble AI. IO board offers plenty of peripherals and connectivity options and this patch enables basic eMMC and UART which is enough to successfully boot Linux. General features: - microSD slot - 1x HDMI Out - 1x HDMI In - 2x DP - 1x eDP - 2x MIPI DSI connector - 4x MIPI CSI2 connector - 2x USB Host - 2x USB 3.0 OTG/Host - 1x SATA - 1x 2.5Gbps Ethernet - 1x 4G/5G mini PCIe - 1x M.2 E-Key slot - 1x Onboard PoE - 1x RS485, RS232, CAN - 1x Audio, MIC port - RTC battery slot - 40-pin GPIO expansion Neu6B needs to mount on top of this IO board in order to create a complete Edgeble Neural Compute Module 6B(Neu6B) IO platform. Add support for Edgeble Neu6 Model B IO Board. Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20230516163454.997736-4-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 5f06c3f508f73a7c9ae804e1f2a655b4d14d73b3 Author: Jagan Teki Date: Tue May 16 22:04:53 2023 +0530 arm64: dts: rockchip: Add rk3588 Edgeble Neu6 Model B SoM Neural Compute Module 6B(Neu6B) is a 96boards SoM-CB compute module based on Rockchip RK3588J from Edgeble AI. General features: - Rockchip RK3588J - up to 32GB LPDDR4x - up to 128GB eMMC - 2x MIPI CSI2 FPC On module WiFi6/BT5 is available in the following Neu6 variants. Neu6B needs to mount on top of associated Edgeble Neu6B IO boards for creating complete platform solutions. Enable eMMC for now to boot Linux successfully. Add support for Edgeble Neu6 Model B SoM. Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20230516163454.997736-3-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 06d26d5b52f9d1571b0a52666775074dd93beb46 Author: Marek Vasut Date: Tue May 16 10:57:13 2023 +0200 dt-bindings: arm: fsl: Fix syntax error Fix the following error by replacing tab indent with spaces. " Documentation/devicetree/bindings/arm/fsl.yaml:930:46: [error] syntax error: found character '\t' that cannot start any token (syntax) " Fixes: d2bf7abfd235 ("dt-bindings: arm: fsl: Add Emtop SoM & Baseboard") Signed-off-by: Marek Vasut Reviewed-by: Conor Dooley Signed-off-by: Shawn Guo commit 0c45fb7faf6f57aeb8b17c77195d113b3fc06cd3 Author: Marek Vasut Date: Tue May 16 10:13:54 2023 +0200 arm64: dts: imx8mp: Add DeWarp Engine DT node Add DT node for the DeWarp Engine of the i.MX8MP. Signed-off-by: Marek Vasut Reviewed-by: Alexander Stein Signed-off-by: Shawn Guo commit 0275a471839d461c2009cbf9024844972769b138 Author: Marek Vasut Date: Tue May 16 10:13:53 2023 +0200 arm64: dts: imx8mp: Sort AIPS4 nodes Sort AIPS4 nodes by node unit-address . No functional change . Suggested-by: Alexander Stein Signed-off-by: Marek Vasut Reviewed-by: Alexander Stein Signed-off-by: Shawn Guo commit d8f9d8126582d27c5fe51eb0fa22bb73d5d768b3 Author: Alexander Stein Date: Tue May 16 10:04:20 2023 +0200 arm64: dts: imx8mp: Add analog audio output on i.MX8MP TQMa8MPxL/MBa8MPxL Enable SAI3, add the codec and pinctrl nodes to enable audio support on MBa8MPxL. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit b0d051afedad32623fa933ac2c44e77b8174f00a Author: Alexander Stein Date: Tue May 16 07:50:06 2023 +0200 arm64: dts: imx8mp: move noc node to correct position The base address of NOC is bigger than aips5, but smaller than aips4. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 1f1784a59caf3eefd127908a1a3cf224017ff9c7 Author: Sascha Hauer Date: Wed May 24 12:39:34 2023 +0200 wifi: rtw88: usb: silence log flooding error message When receiving more rx packets than the kernel can handle the driver drops the packets and issues an error message. This is bad for two reasons. The logs are flooded with myriads of messages, but then time consumed for printing messages in that critical code path brings down the device. After some time of excessive rx load the driver responds with: rtw_8822cu 1-1:1.2: failed to get tx report from firmware rtw_8822cu 1-1:1.2: firmware failed to report density after scan rtw_8822cu 1-1:1.2: firmware failed to report density after scan The device stops working until being replugged. Fix this by lowering the priority to debug level and also by ratelimiting it. Fixes: a82dfd33d1237 ("wifi: rtw88: Add common USB chip support") Signed-off-by: Sascha Hauer Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230524103934.1019096-1-s.hauer@pengutronix.de commit 072210c725c4938682e58236eeeb19a2ddd0b817 Author: Dongliang Mu Date: Thu Mar 16 21:32:36 2023 +0800 wifi: ray_cs: add sanity check on local->sram/rmem/amem The ray_config uses ray_release as its unified error handling function. However, it does not know if local->sram/rmem/amem succeeds or not. Fix this by adding sanity check on local->sram/rmem/amem in the ray_relase. Signed-off-by: Dongliang Mu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230316133236.556198-3-dzm91@hust.edu.cn commit daef020558bc34e8031263aa7cf9e803d709f93a Author: Dongliang Mu Date: Thu Mar 16 21:32:35 2023 +0800 wifi: ray_cs: remove one redundant del_timer In ray_detach, it and its child function ray_release both call del_timer(_sync) on the same timer. Fix this by removing the del_timer_sync in the ray_detach, and revising the del_timer to del_timer_sync. Signed-off-by: Dongliang Mu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230316133236.556198-2-dzm91@hust.edu.cn commit 64d45a1a27159229fd55deab9eb2001add8adc9b Author: Marek Vasut Date: Mon May 15 17:51:02 2023 +0200 arm64: dts: imx8mp: Describe PCIe clock generator on DH electronics i.MX8M Plus DHCOM on PDK3 The PDK3 carrier board contains a PCIe clock generator which is used to supply the PCIe clock lanes. This generator is always on, unless external CLKREQ signal toggles an output off, but this is handled in hardware. The generator does however have I2C interface, describe it in DT. Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit 171342e6af06e66a099103f95ede9333aeec28c0 Author: Alexander Stein Date: Mon May 15 07:44:29 2023 +0200 ARM: dts: imx6qdl-mba6: add mac address for USB ethernet controller The mac address is stored in mainboard eeprom. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 0e4daea31d8312dd9f957a62717d4b5f31ef494c Merge: d5b3d02d0b107 44c026a73be80 Author: Greg Kroah-Hartman Date: Sat May 27 08:32:07 2023 +0100 Merge 6.4-rc3 into tty-next We need the serial/tty fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 9f7579423d2d619064dc84cfa8068e3c83b09e3f Author: Jagadeesh Kona Date: Wed May 24 23:48:00 2023 +0530 arm64: dts: qcom: sm8550: Add graphics clock controller Add device node for graphics clock controller on Qualcomm SM8550 platform. Signed-off-by: Jagadeesh Kona Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524181800.28717-4-quic_jkona@quicinc.com commit 540c910c65a94fb4622b9dd03d71adc0e82d94e9 Author: Namhyung Kim Date: Wed May 24 14:06:00 2023 -0700 perf test: Fix perf stat JSON output test The recent --per-cache option test caused a problem. According to the option name, I think it should check args.per_cache instead of args.per_cache_instance. $ sudo ./perf test -v 99 99: perf stat JSON output linter : --- start --- test child forked, pid 3086101 Checking json output: no args [Success] Checking json output: system wide [Success] Checking json output: interval [Success] Checking json output: event [Success] Checking json output: per thread [Success] Checking json output: per node [Success] Checking json output: system wide no aggregation [Success] Checking json output: per core [Success] Checking json output: per cache_instance Test failed for input: ... Traceback (most recent call last): File "linux/tools/perf/tests/shell/lib/perf_json_output_lint.py", line 88, in elif args.per_core or args.per_socket or args.per_node or args.per_die or args.per_cache_instance: AttributeError: 'Namespace' object has no attribute 'per_cache_instance' test child finished with -1 ---- end ---- perf stat JSON output linter: FAILED! Fixes: bfce728db3179042 ("pert tests: Add tests for new "perf stat --per-cache" aggregation option") Signed-off-by: Namhyung Kim Tested-by: K Prateek Nayak Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230524210600.3095830-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5cebb33fd929dc67812072741408dfcd1a7db4a7 Author: Ian Rogers Date: Fri May 26 14:53:37 2023 -0700 perf tests: Organize cpu_map tests into a single suite Go from 4 suites to a single suite with 4 test cases. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230526215410.2435674-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 237d41d4a2d7d45e41f5450636d1cf689cba0e8a Author: Ian Rogers Date: Fri May 26 14:53:36 2023 -0700 perf cpumap: Add intersect function The merge function gives the union of two cpu maps. Add an intersect function which is necessary, for example, when intersecting a PMUs supported CPUs with user requested. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ali Saidi Cc: Athira Rajeev Cc: Dmitrii Dolgov <9erthalion6@gmail.com> Cc: Huacai Chen Cc: Ingo Molnar Cc: James Clark Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Ming Wang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Sandipan Das Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230526215410.2435674-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8368050625f53dd13f1df7b116e3ea1bcb155702 Merge: a1f6bef21355d 778af143adc88 Author: Bjorn Andersson Date: Fri May 26 18:27:58 2023 -0700 Merge branch 'sm8450-sm8550-gpucc-binding' into arm64-for-6.5 Introduce DeviceTree bindings for SM8450 and SM8550 GPU clock controller, to introduce the constants necessary to referr to these clocks. commit 6ac2230b55d392e6294ea9f406619ed39fd9050f Author: Ian Rogers Date: Wed May 17 10:38:04 2023 -0700 perf vendor events intel: Add metricgroup descriptions for all models Add metric group descriptions created by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py The descriptions add some additional detail in perf list. Committer notes: Removed unrelated changes to tools/perf/pmu-events/arch/x86/mapfile.csv that removed AMD mappings and ended up breaking the build with things like: CC /tmp/build/perf-tools-next/pmu-events/pmu-events.o /tmp/build/perf-tools-next/pmu-events/pmu-events.c:23808:39: error: ‘pmu_metrics__amdzen4’ defined but not used [-Werror=unused-const-variable=] 23808 | static const struct compact_pmu_event pmu_metrics__amdzen4[] = { | ^~~~~~~~~~~~~~~~~~~~ /tmp/build/perf-tools-next/pmu-events/pmu-events.c:23316:39: error: ‘pmu_events__amdzen4’ defined but not used [-Werror=unused-const-variable=] 23316 | static const struct compact_pmu_event pmu_events__amdzen4[] = { | ^~~~~~~~~~~~~~~~~~~ Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-16-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 66c6e0c1002771754c27ea5e14eeaa1405e3d088 Author: Ian Rogers Date: Wed May 17 10:38:03 2023 -0700 perf jevents: Add support for metricgroup descriptions Metrics have a field where the groups they belong to are listed like the following from tools/perf/pmu-events/arch/x86/skylakex/skx-metrics.json: "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group", "MetricName": "tma_frontend_bound", The metric groups are shown in 'perf list' like the following where TopdownL1 is a metric group: TopdownL1: tma_backend_bound [This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend] tma_bad_speculation [This category represents fraction of slots wasted due to incorrect speculations] tma_frontend_bound [This category represents fraction of slots where the processor's Frontend undersupplies its Backend] tma_retiring [This category represents fraction of slots utilized by useful work i.e. issued uops that eventually get retired] This patch adds support for a new json file in each model directory called metricgroups.json that comprises a dictionary containing entries that map from a metric group to a description: { ... "TopdownL1": "Metrics for top-down breakdown at level 1", ... } perf list is then updated to support this changing the above output to: TopdownL1: [Metrics for top-down breakdown at level 1] Committer notes: Added a (int) cast to the ARRAY_SIZE() introduced in this patch to address: /tmp/build/perf-tools-next/pmu-events/pmu-events.c: In function ‘describe_metricgroup’: /var/home/acme/git/perf-tools-next/tools/include/linux/kernel.h:102:25: error: overflow in conversion from ‘long unsigned int’ to ‘int’ changes value from ‘18446744073709551615’ to ‘-1’ [-Werror=overflow] 102 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) | ^ /tmp/build/perf-tools-next/pmu-events/pmu-events.c:61603:29: note: in expansion of macro ‘ARRAY_SIZE’ 61603 | int low = 0, high = ARRAY_SIZE(metricgroups) - 1; | ^~~~~~~~~~ cc1: all warnings being treated as errors Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-15-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit bfae40744b337928b1e65bf40efd91e715a5d808 Author: Jagadeesh Kona Date: Wed May 24 23:47:59 2023 +0530 clk: qcom: gpucc-sm8550: Add support for graphics clock controller Add support for gpucc driver on SM8550, which provides clocks for the graphics subsystem. Co-developed-by: Taniya Das Signed-off-by: Taniya Das Signed-off-by: Jagadeesh Kona Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524181800.28717-3-quic_jkona@quicinc.com commit 728692d49edce3cdc77be92f3c79a6c56f81e531 Author: Konrad Dybcio Date: Wed May 17 18:40:41 2023 +0200 clk: qcom: Add support for SM8450 GPUCC The GPUCC manages the clocks for the Adreno GPU found on the sm8450 SoCs. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517-topic-waipio-gpucc-v1-4-4f40e282af1d@linaro.org commit d4113d5f2bc9b58d3243df0edd2c42247181dbdd Author: Konrad Dybcio Date: Wed May 17 18:40:40 2023 +0200 clk: qcom: gcc-sm8450: Enable hw_clk_ctrl Enable hardware clock control on all RCGs. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517-topic-waipio-gpucc-v1-3-4f40e282af1d@linaro.org commit a0e0ec7424c99a0459b44fbf0459de9728be37ab Author: Konrad Dybcio Date: Wed May 17 18:40:39 2023 +0200 clk: qcom: rcg2: Make hw_clk_ctrl toggleable Certain SoCs use the HW_CLK_CTRL feature on some of the clocks they host. This allows the clocks to be turned on automatically when a downstream branch tries to change rate or config. Make it togglable so that we can utilize this. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517-topic-waipio-gpucc-v1-2-4f40e282af1d@linaro.org commit 6de1bd74050d8ff0b40a48fec810d38cafa80772 Merge: 8fd492e77ff71 778af143adc88 Author: Bjorn Andersson Date: Fri May 26 18:22:17 2023 -0700 Merge branch 'sm8450-sm8550-gpucc-binding' into clk-for-6.5 Bring GPUCC DeviceTree bindings for SM8450 and SM8550 in through a topic branch to allow sharing it with the DeviceTree source tree as well. commit 778af143adc8813d8851be401f71dfb80b9144eb Author: Jagadeesh Kona Date: Wed May 24 23:47:58 2023 +0530 dt-bindings: clock: qcom: Add SM8550 graphics clock controller Add device tree bindings for the graphics clock controller on Qualcomm SM8550 platform. Signed-off-by: Jagadeesh Kona Acked-by: Conor Dooley Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524181800.28717-2-quic_jkona@quicinc.com commit 63f4e4b6f54cdde98ca9c484724d4012989e3454 Author: Konrad Dybcio Date: Wed May 17 18:40:38 2023 +0200 dt-bindings: clock: Add Qcom SM8450 GPUCC Add device tree bindings for the graphics clock controller on Qualcomm Technology Inc's SM8450 SoCs. Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517-topic-waipio-gpucc-v1-1-4f40e282af1d@linaro.org commit 7d0f03d104e576da2a7689d0eb8560c67efc03ff Author: Robert Marko Date: Fri May 26 22:48:02 2023 +0200 cpufreq: qcom-nvmem: use helper to get SMEM SoC ID Now that SMEM exports a helper to get the SMEM SoC ID lets utilize it. Currently qcom_cpufreq_get_msm_id() is encoding the returned SMEM SoC ID into an enum, however there is no reason to do so and we can just match directly on the SMEM SoC ID as returned by qcom_smem_get_soc_id(). Signed-off-by: Robert Marko Acked-by: Viresh Kumar Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526204802.3081168-5-robimarko@gmail.com commit 865d7e719262e9845a3c847040fbd4d84c8b5bd9 Author: Robert Marko Date: Fri May 26 22:48:01 2023 +0200 cpufreq: qcom-nvmem: use SoC ID-s from bindings SMEM SoC ID-s are now stored in DT bindings so lets use those instead of defining them in the driver again. Signed-off-by: Robert Marko Reviewed-by: Konrad Dybcio Reviewed-by: Bjorn Andersson Acked-by: Viresh Kumar Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526204802.3081168-4-robimarko@gmail.com commit 17051d2c3cd696439adb900e9af547ba162fb982 Author: Robert Marko Date: Fri May 26 22:48:00 2023 +0200 soc: qcom: smem: introduce qcom_smem_get_soc_id() Introduce a helper to return the SoC SMEM ID, which is used to identify the exact SoC model as there may be differences in the same SoC family. Currently, cpufreq-nvmem does this completely in the driver and there has been more interest expresed for other drivers to use this information so lets expose a common helper to prevent redoing it in individual drivers since this field is present on every SMEM table version. Signed-off-by: Robert Marko Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526204802.3081168-3-robimarko@gmail.com commit 10615007483b6938da9df290fe5bf460f6a07c60 Author: Robert Marko Date: Fri May 26 22:47:59 2023 +0200 soc: qcom: smem: Switch to EXPORT_SYMBOL_GPL() SMEM has been GPL licensed from the start, and there is no reason to use EXPORT_SYMBOL() so switch to the GPL version. Signed-off-by: Robert Marko Reviewed-by: Konrad Dybcio Reviewed-by: Trilok Soni Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526204802.3081168-2-robimarko@gmail.com commit ec001bb71e4476f7f5be9db693d5f43e65b9d8cb Author: Robert Marko Date: Fri May 26 22:47:58 2023 +0200 soc: qcom: socinfo: move SMEM item struct and defines to a header Move SMEM item struct and related defines to a header in order to be able to reuse them in the SMEM driver instead of duplicating them. Signed-off-by: Robert Marko Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526204802.3081168-1-robimarko@gmail.com commit bcb889891371c3cf767f2b9e8768cfe2fdd3810f Author: Christian Marangi Date: Fri May 26 13:55:11 2023 +0200 soc: qcom: mdt_loader: Fix unconditional call to scm_pas_mem_setup Commit ebeb20a9cd3f ("soc: qcom: mdt_loader: Always invoke PAS mem_setup") dropped the relocate check and made pas_mem_setup run unconditionally. The code was later moved with commit f4e526ff7e38 ("soc: qcom: mdt_loader: Extract PAS operations") to qcom_mdt_pas_init() effectively losing track of what was actually done. The assumption that PAS mem_setup can be done anytime was effectively wrong, with no good reason and this caused regression on some SoC that use remoteproc to bringup ath11k. One example is IPQ8074 SoC that effectively broke resulting in remoteproc silently die and ath11k not working. On this SoC FW relocate is not enabled and PAS mem_setup was correctly skipped in previous kernel version resulting in correct bringup and function of remoteproc and ath11k. To fix the regression, reintroduce the relocate check in qcom_mdt_pas_init() and correctly skip PAS mem_setup where relocate is not enabled. Fixes: ebeb20a9cd3f ("soc: qcom: mdt_loader: Always invoke PAS mem_setup") Tested-by: Robert Marko Co-developed-by: Robert Marko Signed-off-by: Robert Marko Signed-off-by: Christian Marangi Cc: stable@vger.kernel.org Reviewed-by: Mukesh Ojha Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526115511.3328-1-ansuelsmth@gmail.com commit a1f6bef21355da77101eca1a35c30408ad74ef67 Author: Shazad Hussain Date: Fri May 26 19:01:21 2023 +0530 arm64: dts: qcom: sa8775p-ride: enable i2c11 This enables the i2c11 node on sa8775p-ride board for A2B controller and audio port expander. Signed-off-by: Shazad Hussain Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526133122.16443-6-quic_shazhuss@quicinc.com commit 445a523d462432dd9001c899e2c3ced60d23994b Author: Shazad Hussain Date: Fri May 26 19:01:20 2023 +0530 arm64: dts: qcom: sa8775p: add uart5 and uart9 nodes Add remaining uart5 and uart9 nodes for UART bus present on sa8775p SoC. Signed-off-by: Shazad Hussain Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526133122.16443-5-quic_shazhuss@quicinc.com commit 1b2d7ad5ac14df4657e629a0b681fd966d43a74e Author: Shazad Hussain Date: Fri May 26 19:01:19 2023 +0530 arm64: dts: qcom: sa8775p: add missing spi nodes Add the missing nodes of the SPI buses present on sa8775p platform. Signed-off-by: Shazad Hussain Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526133122.16443-4-quic_shazhuss@quicinc.com commit ee2f5f906d69d96350c2b59fddef75a76d23e877 Author: Shazad Hussain Date: Fri May 26 19:01:18 2023 +0530 arm64: dts: qcom: sa8775p: add missing i2c nodes Add the missing nodes for the i2c buses present on sa8775p Soc. Signed-off-by: Shazad Hussain Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526133122.16443-3-quic_shazhuss@quicinc.com commit 07e3e17205794c8df6b55c65117ca6a6502a37d7 Author: Shazad Hussain Date: Fri May 26 19:01:17 2023 +0530 arm64: dts: qcom: sa8775p: add the QUPv3 #0 and #3 node Add zeroth and third instance of the QUPv3 engine to the sa8775p.dtsi. Signed-off-by: Shazad Hussain Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526133122.16443-2-quic_shazhuss@quicinc.com commit 75455b906d82424d8704ec3a60127353ff9698b2 Merge: 4781e965e655b 4266f41feaeee Author: Jakub Kicinski Date: Fri May 26 17:26:00 2023 -0700 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2023-05-26 We've added 54 non-merge commits during the last 10 day(s) which contain a total of 76 files changed, 2729 insertions(+), 1003 deletions(-). The main changes are: 1) Add the capability to destroy sockets in BPF through a new kfunc, from Aditi Ghag. 2) Support O_PATH fds in BPF_OBJ_PIN and BPF_OBJ_GET commands, from Andrii Nakryiko. 3) Add capability for libbpf to resize datasec maps when backed via mmap, from JP Kobryn. 4) Move all the test kfuncs for CI out of the kernel and into bpf_testmod, from Jiri Olsa. 5) Big batch of xsk selftest improvements to prep for multi-buffer testing, from Magnus Karlsson. 6) Show the target_{obj,btf}_id in tracing link's fdinfo and dump it via bpftool, from Yafang Shao. 7) Various misc BPF selftest improvements to work with upcoming LLVM 17, from Yonghong Song. 8) Extend bpftool to specify netdevice for resolving XDP hints, from Larysa Zaremba. 9) Document masking in shift operations for the insn set document, from Dave Thaler. 10) Extend BPF selftests to check xdp_feature support for bond driver, from Lorenzo Bianconi. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (54 commits) bpf: Fix bad unlock balance on freeze_mutex libbpf: Ensure FD >= 3 during bpf_map__reuse_fd() libbpf: Ensure libbpf always opens files with O_CLOEXEC selftests/bpf: Check whether to run selftest libbpf: Change var type in datasec resize func bpf: drop unnecessary bpf_capable() check in BPF_MAP_FREEZE command libbpf: Selftests for resizing datasec maps libbpf: Add capability for resizing datasec maps selftests/bpf: Add path_fd-based BPF_OBJ_PIN and BPF_OBJ_GET tests libbpf: Add opts-based bpf_obj_pin() API and add support for path_fd bpf: Support O_PATH FDs in BPF_OBJ_PIN and BPF_OBJ_GET commands libbpf: Start v1.3 development cycle bpf: Validate BPF object in BPF_OBJ_PIN before calling LSM bpftool: Specify XDP Hints ifname when loading program selftests/bpf: Add xdp_feature selftest for bond device selftests/bpf: Test bpf_sock_destroy selftests/bpf: Add helper to get port using getsockname bpf: Add bpf_sock_destroy kfunc bpf: Add kfunc filter function to 'struct btf_kfunc_id_set' bpf: udp: Implement batching for sockets iterator ... ==================== Link: https://lore.kernel.org/r/20230526222747.17775-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 4f521bab5bfc854ec0dab7ef560dfa75247e615d Author: Maninder Singh Date: Fri May 26 12:51:23 2023 +0530 kallsyms: remove unsed API lookup_symbol_attrs with commit '7878c231dae0 ("slab: remove /proc/slab_allocators")' lookup_symbol_attrs usage is removed. Thus removing redundant API. Signed-off-by: Maninder Singh Reviewed-by: Kees Cook Signed-off-by: Luis Chamberlain commit d67790ddf0219aa0ad3e13b53ae0a7619b3425a2 Author: Kees Cook Date: Mon May 22 14:18:13 2023 -0700 overflow: Add struct_size_t() helper While struct_size() is normally used in situations where the structure type already has a pointer instance, there are places where no variable is available. In the past, this has been worked around by using a typed NULL first argument, but this is a bit ugly. Add a helper to do this, and replace the handful of instances of the code pattern with it. Instances were found with this Coccinelle script: @struct_size_t@ identifier STRUCT, MEMBER; expression COUNT; @@ - struct_size((struct STRUCT *)\(0\|NULL\), + struct_size_t(struct STRUCT, MEMBER, COUNT) Suggested-by: Christoph Hellwig Cc: Jesse Brandeburg Cc: Tony Nguyen Cc: "David S. Miller" Cc: Eric Dumazet Cc: Paolo Abeni Cc: James Smart Cc: Keith Busch Cc: Jens Axboe Cc: Sagi Grimberg Cc: HighPoint Linux Team Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Kashyap Desai Cc: Sumit Saxena Cc: Shivasharan S Cc: Don Brace Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Guo Xuenan Cc: Gwan-gyeong Mun Cc: Nick Desaulniers Cc: Daniel Latypov Cc: kernel test robot Cc: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org Cc: linux-nvme@lists.infradead.org Cc: linux-scsi@vger.kernel.org Cc: megaraidlinux.pdl@broadcom.com Cc: storagedev@microchip.com Cc: linux-xfs@vger.kernel.org Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook Acked-by: Martin K. Petersen Reviewed-by: Darrick J. Wong Reviewed-by: Gustavo A. R. Silva Reviewed-by: Christoph Hellwig Acked-by: Jakub Kicinski Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/r/20230522211810.never.421-kees@kernel.org commit 7f09a3a09fb7e8a809a2eeef2b6b0c3e4f54cd52 Author: Azeem Shaikh Date: Mon May 22 15:52:45 2023 +0000 drm/amd/pm: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Acked-by: Alex Deucher Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230522155245.2336818-1-azeemshaikh38@gmail.com commit 992b8fe106abb6fe4a1583891e686c6aaa70f70e Author: Azeem Shaikh Date: Mon May 22 15:50:32 2023 +0000 drm/radeon: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Acked-by: Alex Deucher Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230522155032.2336283-1-azeemshaikh38@gmail.com commit c7dce4c5d9f6b17feec5ec6056453d019ee4d13b Author: Azeem Shaikh Date: Tue May 16 14:39:56 2023 +0000 tracing: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement with strlcpy is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Acked-by: Masami Hiramatsu (Google) Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230516143956.1367827-1-azeemshaikh38@gmail.com commit 7afbe5defb52f721fe7b04c7e36e0c60cecdeea8 Author: Azeem Shaikh Date: Wed May 17 14:29:55 2023 +0000 scsi: 3w-9xxx: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230517142955.1519572-1-azeemshaikh38@gmail.com commit 038d40edc4c1038ce88c95a2d4f7cb46b9533bdd Author: Azeem Shaikh Date: Wed May 17 14:30:49 2023 +0000 scsi: aacraid: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230517143049.1519806-1-azeemshaikh38@gmail.com commit 8d82557e4b5e948690db9d23bdde34fc1afa120f Author: Azeem Shaikh Date: Wed May 17 14:31:30 2023 +0000 scsi: bnx2i: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230517143130.1519941-1-azeemshaikh38@gmail.com commit 2f4113b330810ab71efa0bd4bbd0655154cd2a70 Author: Azeem Shaikh Date: Wed May 17 14:35:09 2023 +0000 scsi: qedi: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230517143509.1520387-1-azeemshaikh38@gmail.com commit 3b92d34ac06a4bb05a349641cb22373f1ae33f0b Author: Azeem Shaikh Date: Wed May 17 14:34:09 2023 +0000 scsi: ibmvscsi: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Acked-by: Tyrel Datwyler Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230517143409.1520298-1-azeemshaikh38@gmail.com commit 023cfa6fc200fc179dbf8e1857cc7140fa1466f9 Author: Sean Christopherson Date: Thu Apr 13 16:19:14 2023 -0700 KVM: VMX: Use proper accessor to read guest CR4 in handle_desc() Use kvm_is_cr4_bit_set() to read guest CR4.UMIP when sanity checking that a descriptor table VM-Exit occurs if and only if guest.CR4.UMIP=1. UMIP can't be guest-owned, i.e. using kvm_read_cr4_bits() to decache guest- owned bits isn't strictly necessary, but eliminating raw reads of vcpu->arch.cr4 is desirable as it makes it easy to visually audit KVM for correctness. Opportunistically add a compile-time assertion that UMIP isn't guest-owned as letting the guest own UMIP isn't compatible with emulation (or any CR4 bit that is emulated by KVM). Opportunistically change the WARN_ON() to a ONCE variant. When the WARN fires, it fires _a lot_, and spamming the kernel logs ends up doing more harm than whatever led to KVM's unnecessary emulation. Reported-by: Robert Hoo Link: https://lore.kernel.org/all/20230310125718.1442088-4-robert.hu@intel.com Link: https://lore.kernel.org/r/20230413231914.1482782-3-seanjc@google.com Signed-off-by: Sean Christopherson commit 3243b93c16d90c2d63cf30655276ffdf5bb65bf7 Author: Sean Christopherson Date: Thu Apr 13 16:19:13 2023 -0700 KVM: VMX: Treat UMIP as emulated if and only if the host doesn't have UMIP Advertise UMIP as emulated if and only if the host doesn't natively support UMIP, otherwise vmx_umip_emulated() is misleading when the host _does_ support UMIP. Of the four users of vmx_umip_emulated(), two already check for native support, and the logic in vmx_set_cpu_caps() is relevant if and only if UMIP isn't natively supported as UMIP is set in KVM's caps by kvm_set_cpu_caps() when UMIP is present in hardware. That leaves KVM's stuffing of X86_CR4_UMIP into the default cr4_fixed1 value enumerated for nested VMX. In that case, checking for (lack of) host support is actually a bug fix of sorts, as enumerating UMIP support based solely on descriptor table exiting works only because KVM doesn't sanity check MSR_IA32_VMX_CR4_FIXED1. E.g. if a (very theoretical) host supported UMIP in hardware but didn't allow UMIP+VMX, KVM would advertise UMIP but not actually emulate UMIP. Of course, KVM would explode long before it could run a nested VM on said theoretical CPU, as KVM doesn't modify host CR4 when enabling VMX, i.e. would load an "illegal" value into vmcs.HOST_CR4. Reported-by: Robert Hoo Link: https://lore.kernel.org/all/20230310125718.1442088-2-robert.hu@intel.com Link: https://lore.kernel.org/r/20230413231914.1482782-2-seanjc@google.com Signed-off-by: Sean Christopherson commit 82dc11b82b001ca8024663b3e7990b59f600841f Author: Xiaoyao Li Date: Mon Apr 10 08:50:17 2023 -0400 KVM: VMX: Move the comment of CR4.MCE handling right above the code Move the comment about keeping the hosts CR4.MCE loaded in hardware above the code that actually modifies the hardware CR4 value. No functional change indented. Signed-off-by: Xiaoyao Li Link: https://lore.kernel.org/r/20230410125017.1305238-3-xiaoyao.li@intel.com [sean: elaborate in changelog] Signed-off-by: Sean Christopherson commit 8fd492e77ff71f68f7311c22f7bc960182465cd7 Author: Dmitry Baryshkov Date: Sun May 7 20:53:34 2023 +0300 clk: qcom: mmcc-msm8974: use clk_rcg2_shared_ops for mdp_clk_src clock The mdp_clk_src clock should not be turned off. Instead it should be 'parked' to the XO, as most of other mdp_clk_src clocks. Fix that by using the clk_rcg2_shared_ops. Fixes: d8b212014e69 ("clk: qcom: Add support for MSM8974's multimedia clock controller (MMCC)") Signed-off-by: Dmitry Baryshkov Tested-by: Luca Weiss Acked-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230507175335.2321503-1-dmitry.baryshkov@linaro.org commit 334006b78ca84b7619d7dd313d5b6b39007e9528 Author: Xiaoyao Li Date: Mon Apr 10 08:50:16 2023 -0400 KVM: VMX: Use kvm_read_cr4() to get cr4 value Directly use vcpu->arch.cr4 is not recommended since it gets stale value if the cr4 is not available. Use kvm_read_cr4() instead to ensure correct value. Signed-off-by: Xiaoyao Li Link: https://lore.kernel.org/r/20230410125017.1305238-2-xiaoyao.li@intel.com Signed-off-by: Sean Christopherson commit c77612a07d18d4425fd8ddd532a8a9b8e1970c53 Author: Krzysztof Kozlowski Date: Sun May 7 19:45:16 2023 +0200 arm64: dts: qcom: apq8096: fix fixed regulator name property Correct the typo in 'regulator-name' property. apq8096-ifc6640.dtb: v1p05-regulator: 'regulator-name' is a required property apq8096-ifc6640.dtb: v1p05-regulator: Unevaluated properties are not allowed ('reglator-name' was unexpected) Fixes: 6cbdec2d3ca6 ("arm64: dts: qcom: msm8996: Introduce IFC6640") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230507174516.264936-3-krzysztof.kozlowski@linaro.org commit 3e8188b4b6c76bfa5c5389384bea2719a1271327 Author: Krzysztof Kozlowski Date: Sun May 7 19:45:15 2023 +0200 arm64: dts: qcom: msm8996: correct MMCC clocks order Re-order the clocks for MMCC clock controller node to match the bindings (Linux driver takes by name): msm8996-mtp.dtb: clock-controller@8c0000: clock-names:1: 'gpll0' was expected msm8996-mtp.dtb: clock-controller@8c0000: clock-names:2: 'gcc_mmss_noc_cfg_ahb_clk' was expected Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230507174516.264936-2-krzysztof.kozlowski@linaro.org commit 9903258a937b47b78d18c7cb8e342ccbb671d8c2 Author: Krzysztof Kozlowski Date: Sun May 7 19:45:14 2023 +0200 arm64: dts: qcom: msm8916: correct LPASS CPU clocks order Re-order the clocks for LPASS CPU node to match the bindings (Linux driver takes by name): msm8916-asus-z00l.dtb: audio-controller@7708000: clock-names:1: 'mi2s-bit-clk0' was expected msm8916-asus-z00l.dtb: audio-controller@7708000: clock-names:2: 'mi2s-bit-clk1' was expected msm8916-asus-z00l.dtb: audio-controller@7708000: clock-names:3: 'mi2s-bit-clk2' was expected msm8916-asus-z00l.dtb: audio-controller@7708000: clock-names:4: 'mi2s-bit-clk3' was expected msm8916-asus-z00l.dtb: audio-controller@7708000: clock-names:5: 'pcnoc-mport-clk' was expected msm8916-asus-z00l.dtb: audio-controller@7708000: clock-names:6: 'pcnoc-sway-clk' was expected Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230507174516.264936-1-krzysztof.kozlowski@linaro.org commit 0aa2811cf5eb2355cd91035b4a76a6120a5c6382 Author: Vijaya Krishna Nivarthi Date: Mon Apr 24 15:02:40 2023 +0530 arm64: dts: qcom: sdm845: Add stream-id of qspi to iommus As part of DMA mode support to qspi driver. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1682328761-17517-5-git-send-email-quic_vnivarth@quicinc.com commit cc406006126e89c5330ff5c75da20deb5cafedf8 Author: Vijaya Krishna Nivarthi Date: Mon Apr 24 15:02:39 2023 +0530 arm64: dts: qcom: sc7280: Add stream-id of qspi to iommus As part of DMA mode support to qspi driver. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1682328761-17517-4-git-send-email-quic_vnivarth@quicinc.com commit 8164116023acb6dd600776a3391d5b0cd7699adc Author: Vijaya Krishna Nivarthi Date: Mon Apr 24 15:02:38 2023 +0530 arm64: dts: qcom: sc7180: Add stream-id of qspi to iommus As part of DMA mode support to qspi driver. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1682328761-17517-3-git-send-email-quic_vnivarth@quicinc.com commit 24cf51a2e4519c230fd5cbf281c73043e8bf1eeb Author: Krzysztof Kozlowski Date: Thu Apr 20 20:07:44 2023 +0200 arm64: dts: qcom: msm8996: correct /soc/bus ranges The bus@0 node should have reg or ranges to fix dtbs W=1 warnings: Warning (unit_address_vs_reg): /soc@0/bus@0: node has a unit name, but no reg or ranges property Warning (simple_bus_reg): /soc@0/bus@0: missing or empty reg/ranges property Signed-off-by: Krzysztof Kozlowski Tested-by: Konrad Dybcio # MSM8996 Kagura Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420180746.860934-1-krzysztof.kozlowski@linaro.org commit 5b85de0d51776cae7c165ec2785d1be06ebc9f21 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:19:21 2023 +0200 arm64: dts: qcom: sdm630-nile: correct duplicated reserved memory node SoC DTSI already comes with 85800000 reserved memory node, so assume the author wanted to update its length. This fixes dtbs W=1 warning: Warning (unique_unit_address_if_enabled): /reserved-memory/qhee-code@85800000: duplicate unit-address (also used in node /reserved-memory/reserved@85800000) Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211921.79871-1-krzysztof.kozlowski@linaro.org commit 7510e80f4ac707efc7e964120525ef759a02f171 Author: Kathiravan T Date: Mon Apr 17 16:26:07 2023 +0530 clk: qcom: ipq5332: fix the order of SLEEP_CLK and XO clock The order of DT_SLEEP_CLK and DT_XO are swapped and it is incorrect. Due to which the clocks for which the parent should be XO is having parent as SLEEP_CLK and vice versa. So fix the same by re-ordering the entries. Fixes: 3d89d52970fd ("clk: qcom: add Global Clock controller (GCC) driver for IPQ5332 SoC") Reported-by: Devi Priya Signed-off-by: Kathiravan T Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417105607.4091-1-quic_kathirav@quicinc.com commit 81c1ef89a45eccd5603f1e27e281d14fefcb81f9 Author: Kathiravan T Date: Mon Apr 17 10:13:42 2023 +0530 clk: qcom: ipq5332: fix the src parameter in ftbl_gcc_apss_axi_clk_src 480MHz is derived from P_GPLL4_OUT_AUX not from P_GPLL4_OUT_MAIN. Update the freq_tbl with the correct src. Fixes: 3d89d52970fd ("clk: qcom: add Global Clock controller (GCC) driver for IPQ5332 SoC") Reported-by: Manikanta Mylavarapu Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417044342.9406-1-quic_kathirav@quicinc.com commit a2d8dcd48e132967eb8596a02a06185db8fbcb92 Author: Krzysztof Kozlowski Date: Sun Apr 16 14:37:30 2023 +0200 arm64: dts: qcom: sm6125-sprout: align ADC channel node names with bindings Bindings expect ADC channel node names to follow specific pattern: sm6125-xiaomi-laurel-sprout.dtb: adc@3100: 'adc-chan@4d', 'adc-chan@4e', 'adc-chan@52', 'adc-chan@54' do not match any of the regexes: ... Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230416123730.300863-6-krzysztof.kozlowski@linaro.org commit ec888e6cff94af8fc5889824d98b1f1df65f3131 Author: Krzysztof Kozlowski Date: Sun Apr 16 14:37:29 2023 +0200 arm64: dts: qcom: sm8550-qrd: add missing PCIE1 PHY AUX clock frequency The SM8550 DTSI defines a fixed PCIE1 PHY AUX clock and expects boards to define frequency. Use the same as in MTP8550 to fix: sm8550-qrd.dtb: pcie-1-phy-aux-clk: 'clock-frequency' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230416123730.300863-5-krzysztof.kozlowski@linaro.org commit 2438aba45f65b723763299a7b34eddfc40923680 Author: Krzysztof Kozlowski Date: Sun Apr 16 14:37:28 2023 +0200 arm64: dts: qcom: sm8250: add missing qcom,smmu-500 fallback Since commit 6c84bbd103d8 ("dt-bindings: arm-smmu: Add generic qcom,smmu-500 bindings") the SMMU is supposed to use qcom,smmu-500 compatible fallback: ['qcom,sm8250-smmu-500', 'qcom,adreno-smmu', 'qcom,smmu-500', 'arm,mmu-500'] is too long 'qcom,sm8250-smmu-500' is not one of ['qcom,msm8996-smmu-v2', 'qcom,msm8998-smmu-v2', 'qcom,sdm630-smmu-v2'] 'qcom,sm8250-smmu-500' is not one of ['qcom,msm8996-smmu-v2', 'qcom,sc7180-smmu-v2', 'qcom,sdm630-smmu-v2', 'qcom,sdm845-smmu-v2' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230416123730.300863-4-krzysztof.kozlowski@linaro.org commit 395aba1b1912d059a13345531fd4090caf51da38 Author: Krzysztof Kozlowski Date: Sun Apr 16 14:37:27 2023 +0200 arm64: dts: qcom: qdu1000: add missing qcom,smmu-500 fallback Since commit 6c84bbd103d8 ("dt-bindings: arm-smmu: Add generic qcom,smmu-500 bindings") the SMMU is supposed to use qcom,smmu-500 compatible fallback: ['qcom,qdu1000-smmu-500', 'arm,mmu-500'] is too short ['qcom,qdu1000-smmu-500', 'arm,mmu-500'] is too long Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230416123730.300863-3-krzysztof.kozlowski@linaro.org commit e6e0e706940b64e3a77e0a4840037692f109bd5f Author: Krzysztof Kozlowski Date: Sun Apr 16 14:37:26 2023 +0200 arm64: dts: qcom: ipq8074: drop incorrect SPI bus spi-max-frequency The spi-max-frequency property belongs to SPI devices, not SPI controller: ipq8074-hk01.dtb: spi@78b5000: Unevaluated properties are not allowed ('spi-max-frequency' was unexpected) Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230416123730.300863-2-krzysztof.kozlowski@linaro.org commit b8420d478aa3fc739fcdba6b4b945850b356cb3b Author: Krzysztof Kozlowski Date: Sun Apr 16 14:37:25 2023 +0200 arm64: dts: qcom: ipq6018: drop incorrect SPI bus spi-max-frequency The spi-max-frequency property belongs to SPI devices, not SPI controller: ipq6018-cp01-c1.dtb: spi@78b5000: Unevaluated properties are not allowed ('spi-max-frequency' was unexpected) Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230416123730.300863-1-krzysztof.kozlowski@linaro.org commit 63d56adf04b5795e54440dc5b7afddecb2966863 Author: Konrad Dybcio Date: Fri Apr 14 13:06:36 2023 +0200 clk: qcom: dispcc-qcm2290: Fix GPLL0_OUT_DIV handling GPLL0_OUT_DIV (.fw_name = "gcc_disp_gpll0_div_clk_src") was previously made to reuse the same parent enum entry as GPLL0_OUT_MAIN (.fw_name = "gcc_disp_gpll0_clk_src") in parent_map_2. Resolve it by introducing its own entry in the parent enum and correctly assigning it in disp_cc_parent_map_2[]. Fixes: cc517ea3333f ("clk: qcom: Add display clock controller driver for QCM2290") Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230412-topic-qcm_dispcc-v2-2-bce7dd512fe4@linaro.org commit 92dfee0fc889b5b00ffb6b1de87ce64c483bcb7b Author: Konrad Dybcio Date: Fri Apr 14 13:06:35 2023 +0200 clk: qcom: dispcc-qcm2290: Fix BI_TCXO_AO handling BI_TCXO_AO (.fw_name = "bi_tcxo_ao") was previously made to reuse the same parent enum entry as BI_TCXO (.fw_name = "bi_tcxo") in parent_map_2. Resolve it by introducing its own entry in the parent enum and correctly assigning it in disp_cc_parent_map_2[]. Fixes: cc517ea3333f ("clk: qcom: Add display clock controller driver for QCM2290") Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230412-topic-qcm_dispcc-v2-1-bce7dd512fe4@linaro.org commit 0cd4e90cb2dec02ff859f5c98f744f43a23aea65 Author: Vignesh Viswanathan Date: Fri May 26 16:36:53 2023 +0530 arm64: dts: qcom: add few more reserved memory region In IPQ SoCs, bootloader will collect the system RAM contents upon crash for the post morterm analysis. If we don't reserve the memory region used by bootloader, obviously linux will consume it and upon next boot on crash, bootloader will be loaded in the same region, which will lead to loose some of the data, sometimes we may miss out critical information. So lets reserve the region used by the bootloader. Similarly SBL copies some data into the reserved region and it will be used in the crash scenario. So reserve 1MB for SBL as well. While at it, drop the size padding in the reserved memory region, wherever applicable. Signed-off-by: Vignesh Viswanathan Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526110653.27777-4-quic_viswanat@quicinc.com commit 9b2406aaba7841863ac041225316c1ec1c86ea36 Author: Vignesh Viswanathan Date: Fri May 26 16:36:52 2023 +0530 arm64: dts: qcom: enable the download mode support Like any other Qualcomm SoCs, IPQ8074 and IPQ6018 also supports the download mode to collect the RAM dumps if system crashes, to perform the post mortem analysis. Add support for the same. Signed-off-by: Vignesh Viswanathan Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526110653.27777-3-quic_viswanat@quicinc.com commit 349b5bed539b491b7894a5186a895751fd8ba6c7 Author: Robert Marko Date: Fri May 26 21:08:55 2023 +0200 clk: qcom: ipq6018: fix networking resets Networking resets in IPQ6018 all use bitmask as they require multiple bits to be set and cleared instead of a single bit. So, current networking resets have the same register and bit 0 set which is clearly incorrect. Fixes: d9db07f088af ("clk: qcom: Add ipq6018 Global Clock Controller support") Signed-off-by: Robert Marko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526190855.2941291-2-robimarko@gmail.com commit f4f0c8acee0e41c5fbae7a7ad06087668ddce0d6 Author: Robert Marko Date: Fri May 26 21:08:54 2023 +0200 clk: qcom: gcc-ipq6018: update UBI32 PLL Update the UBI32 alpha PLL config to the latest values from the downstream QCA 5.4 kernel. Signed-off-by: Robert Marko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526190855.2941291-1-robimarko@gmail.com commit b92b0d2f75820540182e4edf9b57ead7ef344d45 Author: Neil Armstrong Date: Sat May 27 00:52:10 2023 +0530 arm64: dts: qcom: sm8450: add crypto nodes Add crypto engine (CE) and CE BAM related nodes and definitions for the SM8450 SoC. Tested-by: Anders Roxell Tested-by: Linux Kernel Functional Testing Signed-off-by: Neil Armstrong [Bhupesh: Corrected the compatible list] Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526192210.3146896-12-bhupesh.sharma@linaro.org commit f1040a7fe8f069d2259ab3dab9190210005ceb33 Author: Bhupesh Sharma Date: Sat May 27 00:52:09 2023 +0530 arm64: dts: qcom: sm8350: Add Crypto Engine support Add crypto engine (CE) and CE BAM related nodes and definitions to 'sm8350.dtsi'. Co-developed-by and Signed-off-by: Robert Foss [Bhupesh: Switch to '#interconnect-cells = <2>', available since commit 4f287e31ff5f] Tested-by: Anders Roxell Tested-by: Linux Kernel Functional Testing Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526192210.3146896-11-bhupesh.sharma@linaro.org commit c58be6c87f482b6bdba804ee0a2d7b588e6a2d6a Author: Bhupesh Sharma Date: Sat May 27 00:52:08 2023 +0530 arm64: dts: qcom: sm8250: Add Crypto Engine support Add crypto engine (CE) and CE BAM related nodes and definitions to 'sm8250.dtsi'. Co-developed-by and Signed-off-by: Vladimir Zapolskiy Tested-by: Anders Roxell Tested-by: Linux Kernel Functional Testing Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526192210.3146896-10-bhupesh.sharma@linaro.org commit f7f485f3dc09d21c58f46756a7e6463c29a0f85b Author: Bhupesh Sharma Date: Sat May 27 00:52:07 2023 +0530 arm64: dts: qcom: sm8150: Add Crypto Engine support Add crypto engine (CE) and CE BAM related nodes and definitions to 'sm8150.dtsi'. Tested-by: Anders Roxell Tested-by: Linux Kernel Functional Testing Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526192210.3146896-9-bhupesh.sharma@linaro.org commit 61baef687d81ffda97ac26db8f100b5b27069477 Author: Bhupesh Sharma Date: Sat May 27 00:52:06 2023 +0530 arm64: dts: qcom: sm6115: Add Crypto Engine support Add crypto engine (CE) and CE BAM related nodes and definitions to 'sm6115.dtsi'. Reviewed-by: Konrad Dybcio Tested-by: Konrad Dybcio Tested-by: Anders Roxell Tested-by: Linux Kernel Functional Testing Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526192210.3146896-8-bhupesh.sharma@linaro.org commit 20bf3ac438fd2f6f9a98bc5cbddb5024cd31560f Author: Bhupesh Sharma Date: Sat May 27 00:52:03 2023 +0530 arm64: dts: qcom: sdm845: Fix the slimbam DMA engine compatible string As per documentation, Qualcomm SDM845 SoC supports SLIMBAM DMA engine v1.7.4, so use the correct compatible strings. Reviewed-by: Konrad Dybcio Tested-by: Anders Roxell Tested-by: Linux Kernel Functional Testing Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526192210.3146896-5-bhupesh.sharma@linaro.org commit 31dfb8014f6bbebf06ca5084a072f755d8dd9797 Author: Bhupesh Sharma Date: Sat May 27 00:52:02 2023 +0530 arm64: dts: qcom: sdm8550: Fix the BAM DMA engine compatible string As per documentation, Qualcomm SM8550 SoC supports BAM DMA engine v1.7.4, so use the correct compatible strings. Reviewed-by: Konrad Dybcio Tested-by: Anders Roxell Tested-by: Linux Kernel Functional Testing Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526192210.3146896-4-bhupesh.sharma@linaro.org commit d9824f70e52c736498c9177688cee5aa789e560c Author: Alex Williamson Date: Tue May 23 16:52:50 2023 -0600 vfio/pci: Also demote hiding standard cap messages Apply the same logic as commit 912b625b4dcf ("vfio/pci: demote hiding ecap messages to debug level") for the less common case of hiding standard capabilities. Reviewed-by: Oleksandr Natalenko Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20230523225250.1215911-1-alex.williamson@redhat.com Signed-off-by: Alex Williamson commit 05e6b82f395c406333253d6c492d884e7f14ef46 Author: Kathiravan T Date: Fri May 26 18:23:05 2023 +0530 arm64: dts: qcom: ipq9574: add QFPROM node IPQ9574 has efuse region to determine the various HW quirks. Lets add the initial support and the individual fuses will be added as they are required. Reviewed-by: Konrad Dybcio Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526125305.19626-5-quic_kathirav@quicinc.com commit 546f0617a22a481f3ca1f7e058aea0c40517c64e Author: Kathiravan T Date: Fri May 26 18:23:04 2023 +0530 arm64: dts: qcom: ipq6018: add QFPROM node IPQ6018 has efuse region to determine the various HW quirks. Lets add the initial support and the individual fuses will be added as they are required. Signed-off-by: Kathiravan T Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526125305.19626-4-quic_kathirav@quicinc.com commit 2f34a2aa4c88f4882e3c5df8c9b78f8bbd3f564f Author: Kathiravan T Date: Fri May 26 18:23:03 2023 +0530 arm64: dts: qcom: ipq5332: add QFPROM node IPQ5332 has efuse region to determine the various HW quirks. Lets add the initial support and the individual fuses will be added as they are required. Reviewed-by: Konrad Dybcio Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526125305.19626-3-quic_kathirav@quicinc.com commit 8fa13a6e61a799b102b3314c623d27cb8c078d21 Author: Kathiravan T Date: Fri May 26 18:23:02 2023 +0530 dt-bindings: nvmem: qfprom: add compatible for few IPQ SoCs Add the QFPROM compatible for IPQ5332, IPQ6018 and IPQ9574 Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526125305.19626-2-quic_kathirav@quicinc.com commit 8a465494d62215ca531dfa0cde993779a77e61aa Author: Devi Priya Date: Fri May 26 21:01:52 2023 +0530 arm64: dts: qcom: ipq9574: add support for RDP453 variant Add the initial device tree support for the Reference Design Platform (RDP) 453 based on IPQ9574 family of SoCs. This patch adds support for Console UART, SPI NOR and SMPA1 regulator node. Signed-off-by: Devi Priya Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526153152.777-3-quic_devipriy@quicinc.com commit b866fba43698479fef5dd301313e8a73e28c789e Author: Devi Priya Date: Fri May 26 21:01:51 2023 +0530 dt-bindings: arm: qcom: document AL02-C8 board based on IPQ9574 family Document AL02-C8 (Reference Design Platform 453) board based on IPQ9574 family of SoCs. Signed-off-by: Devi Priya Acked-by: Conor Dooley Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230526153152.777-2-quic_devipriy@quicinc.com commit aa261f13dae60850be30de95c7eb6ffb6059a6b7 Author: Devi Priya Date: Tue May 16 19:20:13 2023 +0530 arm64: dts: qcom: ipq9574: add support for RDP449 variant Add the initial device tree support for the Reference Design Platform (RDP) 449 based on IPQ9574 family of SoCs. This patch adds support for Console UART, SPI NOR and SMPA1 regulator node. Signed-off-by: Devi Priya Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516135013.3547-3-quic_devipriy@quicinc.com commit 2e4cd263b97d0254e6bbd88b2feb4df6c4a9ad0d Author: Devi Priya Date: Tue May 16 19:20:12 2023 +0530 dt-bindings: arm: qcom: document AL02-C6 board based on IPQ9574 family Document AL02-C6 (Reference Design Platform 449) board based on IPQ9574 family of SoCs. Signed-off-by: Devi Priya Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516135013.3547-2-quic_devipriy@quicinc.com commit d8a83f8d2e730d4e05e8fc8e1faccbee0f95ca12 Author: Devi Priya Date: Wed May 10 16:13:59 2023 +0530 arm64: dts: qcom: ipq9574: add support for RDP418 variant Add the initial device tree support for the Reference Design Platform (RDP) 418 based on IPQ9574 family of SoCs. This patch adds support for Console UART, SPI NOR, eMMC and SMPA1 regulator node. Co-developed-by: Anusha Rao Signed-off-by: Anusha Rao Signed-off-by: Devi Priya Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230510104359.16678-3-quic_devipriy@quicinc.com commit e3c98aac28bd8964031ebb057cb6e48fc492d256 Author: Devi Priya Date: Wed May 10 16:13:58 2023 +0530 dt-bindings: arm: qcom: document AL02-C2 board based on IPQ9574 family Document AL02-C2 (Reference Design Platform 418) board based on IPQ9574 family of SoCs. Signed-off-by: Devi Priya Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230510104359.16678-2-quic_devipriy@quicinc.com commit 8f0ae6bc0098f63a008820f80c08b01ea2167da3 Author: Devi Priya Date: Wed May 17 22:55:27 2023 +0530 arm64: dts: qcom: ipq9574: Add cpufreq support Add cpu freq nodes in the device tree to bump cpu frequency above 800MHz. Reviewed-by: Konrad Dybcio Co-developed-by: Praveenkumar I Signed-off-by: Praveenkumar I Signed-off-by: Devi Priya Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517172527.1968-4-quic_devipriy@quicinc.com commit 56ba2b3aeb4b76549a7759e79bd44330cd9b885a Author: Devi Priya Date: Wed May 17 22:55:26 2023 +0530 arm64: dts: qcom: ipq9574: Add SMPA1 regulator node Add support for SMPA1 regulator node in IPQ9574. Reviewed-by: Konrad Dybcio Co-developed-by: Praveenkumar I Signed-off-by: Praveenkumar I Signed-off-by: Devi Priya Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517172527.1968-3-quic_devipriy@quicinc.com commit 8cc864a4375dd62023a2880050bf618a225cb907 Author: Devi Priya Date: Wed May 17 22:55:25 2023 +0530 arm64: dts: qcom: ipq9574: Add RPM related nodes Add RPM Glink & RPM message RAM nodes to support frequency scaling on IPQ9574. Reviewed-by: Konrad Dybcio Co-developed-by: Praveenkumar I Signed-off-by: Praveenkumar I Signed-off-by: Devi Priya Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517172527.1968-2-quic_devipriy@quicinc.com commit 3098f34977480c9aa75cf328501f1b47ec49fec7 Author: Devi Priya Date: Thu Apr 6 11:43:14 2023 +0530 arm64: defconfig: Enable ipq6018 apss clock and PLL controller The PLL and IPQ6018 APSS clock controller are used on several IPQ platforms to clock the CPU. Hence it should be enabled and built-in. Signed-off-by: Devi Priya Acked-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230406061314.10916-6-quic_devipriy@quicinc.com commit 84c4a652db1cf764ebaeea56e6e3372cc52bf708 Author: Devi Priya Date: Thu Apr 6 11:43:13 2023 +0530 arm64: dts: qcom: ipq9574: Add support for APSS clock controller Add the APCS & A73 PLL nodes to support CPU frequency scaling. Signed-off-by: Devi Priya Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230406061314.10916-5-quic_devipriy@quicinc.com commit 20beb85f7a018da6fc5d07d343a1622902d38d24 Author: Devi Priya Date: Thu Apr 6 11:43:11 2023 +0530 clk: qcom: apss-ipq-pll: Add support for IPQ9574 Add the compatible and configuration values for A73 Huayra PLL found on IPQ9574. Co-developed-by: Praveenkumar I Signed-off-by: Praveenkumar I Signed-off-by: Devi Priya Acked-by: Stephen Boyd Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230406061314.10916-3-quic_devipriy@quicinc.com commit 17035787e20090a5ea347f1b8dfe867263419d26 Author: Devi Priya Date: Thu Apr 6 11:43:10 2023 +0530 dt-bindings: clock: qcom,a53pll: add IPQ9574 compatible IPQ9574 uses A73 PLL of type Huayra. Add the IPQ9574 A73 compatible to A53 bindings as the PLL properties match with that of A53. Acked-by: Krzysztof Kozlowski Signed-off-by: Devi Priya Acked-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230406061314.10916-2-quic_devipriy@quicinc.com commit d9556c5c6c51aad2c2f760ce953735afa9162f94 Author: Devi Priya Date: Tue Apr 25 14:10:10 2023 +0530 arm64: dts: qcom: ipq9574: rename al02-c7 dts to rdp433 Rename the dts after Reference Design Platform(RDP) to adopt standard naming convention. Acked-by: Konrad Dybcio Signed-off-by: Devi Priya Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230425084010.15581-7-quic_devipriy@quicinc.com commit 83022f6484b11a60dbf9a95a88c7ef8e59c4b19c Author: Luca Weiss Date: Fri Apr 7 09:45:44 2023 +0200 arm64: dts: qcom: pm7250b: add missing spmi-vadc include This file is using definitions from the spmi-vadc header, so we need to include it. Fixes: 11975b9b8135 ("arm64: dts: qcom: Add pm7250b PMIC") Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230407-pm7250b-sid-v1-1-fc648478cc25@fairphone.com commit 62c68e7cee332e08e625af3bca3318814086490d Author: Dmitry Torokhov Date: Tue May 23 14:04:32 2023 -0700 HID: ensure timely release of driver-allocated resources More and more drivers rely on devres to manage their resources, however if bus' probe() and release() methods are not trivial and control some of resources as well (for example enable or disable clocks, or attach device to a power domain), we need to make sure that driver-allocated resources are released immediately after driver's remove() method returns, and not postponed until driver core gets around to releasing resources. In case of HID we should not try to close the report and release associated memory until after all devres callbacks are executed. To fix that we open a new devres group before calling driver's probe() and explicitly release it when we return from driver's remove(). This is similar to what we did for I2C bus in commit 5b5475826c52 ("i2c: ensure timely release of driver-allocated resources"). It is tempting to try and move this into driver core, but actually doing so is challenging, we need to split bus' remove() method into pre- and post-remove methods, which would make the logic even less clear. Reported-by: Stephen Boyd Link: https://lore.kernel.org/r/20230505232417.1377393-1-swboyd@chromium.org Signed-off-by: Dmitry Torokhov Signed-off-by: Jiri Kosina commit 207733f9266194b3cd90ddae723a1f82eb64030b Author: Dmitry Torokhov Date: Tue May 23 14:04:31 2023 -0700 HID: split apart hid_device_probe to make logic more apparent hid_device_probe() has a complex flow and locks and unlocks a mutex. Move the most of the logic into __hid_device_probe() and hid_check_device_match() and leave the locking in hid_device_probe() which makes the code more clear. Signed-off-by: Dmitry Torokhov Signed-off-by: Jiri Kosina commit 762b33eb90c9cc9227bf035cf2cf6f1458afecdb Author: Like Xu Date: Tue May 23 11:29:47 2023 +0800 KVM: x86/mmu: Assert on @mmu in the __kvm_mmu_invalidate_addr() Add assertion to track that "mmu == vcpu->arch.mmu" is always true in the context of __kvm_mmu_invalidate_addr(). for_each_shadow_entry_using_root() and kvm_sync_spte() operate on vcpu->arch.mmu, but the only reason that doesn't cause explosions is because handle_invept() frees roots instead of doing a manual invalidation. As of now, there are no major roadblocks to switching INVEPT emulation over to use kvm_mmu_invalidate_addr(). Suggested-by: Sean Christopherson Signed-off-by: Like Xu Link: https://lore.kernel.org/r/20230523032947.60041-1-likexu@tencent.com Signed-off-by: Sean Christopherson commit 12ced095956a517dc0c8c8f9264e29fd67124302 Author: Uros Bizjak Date: Tue Apr 25 13:39:32 2023 +0200 KVM: x86/mmu: Add comment on try_cmpxchg64 usage in tdp_mmu_set_spte_atomic Commit aee98a6838d5 ("KVM: x86/mmu: Use try_cmpxchg64 in tdp_mmu_set_spte_atomic") removed the comment that iter->old_spte is updated when different logical CPU modifies the page table entry. Although this is what try_cmpxchg does implicitly, it won't hurt if this fact is explicitly mentioned in a restored comment. Cc: Paolo Bonzini Cc: Sean Christopherson Cc: David Matlack Signed-off-by: Uros Bizjak Link: https://lore.kernel.org/r/20230425113932.3148-1-ubizjak@gmail.com [sean: extend comment above try_cmpxchg64()] Signed-off-by: Sean Christopherson commit 76021e96d781e1fe8de02ebe52f3eb276716b6b0 Author: Sean Christopherson Date: Sat Feb 11 01:07:19 2023 +0000 KVM: Protect vcpu->pid dereference via debugfs with RCU Wrap the vcpu->pid dereference in the debugfs hook vcpu_get_pid() with proper RCU read (un)lock. Unlike the code in kvm_vcpu_ioctl(), vcpu_get_pid() is not a simple access; the pid pointer is passed to pid_nr() and fully dereferenced if the pointer is non-NULL. Failure to acquire RCU could result in use-after-free of the old pid if a different task invokes KVM_RUN and puts the last reference to the old vcpu->pid between vcpu_get_pid() reading the pointer and dereferencing it in pid_nr(). Fixes: e36de87d34a7 ("KVM: debugfs: expose pid of vcpu threads") Link: https://lore.kernel.org/r/20230211010719.982919-1-seanjc@google.com Signed-off-by: Sean Christopherson commit 15d5daa0a7006b9bd4dcc49f90e7ac8ddbe102f2 Author: Arnd Bergmann Date: Wed May 17 15:18:07 2023 +0200 kallsyms: remove unused arch_get_kallsym() helper The arch_get_kallsym() function was introduced so that x86 could override it, but that override was removed in bf904d2762ee ("x86/pti/64: Remove the SYSCALL64 entry trampoline"), so now this does nothing except causing a warning about a missing prototype: kernel/kallsyms.c:662:12: error: no previous prototype for 'arch_get_kallsym' [-Werror=missing-prototypes] 662 | int __weak arch_get_kallsym(unsigned int symnum, unsigned long *value, Restore the old behavior before d83212d5dd67 ("kallsyms, x86: Export addresses of PTI entry trampolines") to simplify the code and avoid the warning. Signed-off-by: Arnd Bergmann Tested-by: Alan Maguire [mcgrof: fold in bpf selftest fix] Signed-off-by: Luis Chamberlain commit ef1560b670bd28ca3230c7f5ad29c6a211fb1adb Author: Md Sadre Alam Date: Thu May 25 16:35:26 2023 +0530 mtd: spinand: gigadevice: add support for GD5F2GQ5xExxH This is 2Gb SLC NAND flash with 4b/512b on-die ECC capability. Signed-off-by: Md Sadre Alam Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230525110526.21998-1-quic_mdalam@quicinc.com commit 67d0109fb7aef2a378e885a4127f411a04042160 Author: Liu Ying Date: Wed May 10 17:24:50 2023 +0800 drm: lcdif: Add i.MX93 LCDIF compatible string With all previous preparations done to make it possible for the single LCDIF embedded in i.MX93 SoC to drive multiple displays simultaneously, add i.MX93 LCDIF compatible string as the last step of adding i.MX93 LCDIF support. Tested-by: Alexander Stein Reviewed-by: Alexander Stein Reviewed-by: Marek Vasut Signed-off-by: Liu Ying Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20230510092450.4024730-7-victor.liu@nxp.com commit dbb32d8564de455b7cd47482d8d65bc70ee44927 Author: Liu Ying Date: Wed May 10 17:24:49 2023 +0800 drm: lcdif: Add multiple encoders and first bridges support The single LCDIF embedded in i.MX93 SoC may drive multiple displays simultaneously. Look at LCDIF output port's remote port parents to find all enabled first bridges. Add an encoder for each found bridge and attach the bridge to the encoder. This is a preparation for adding i.MX93 LCDIF support. Tested-by: Alexander Stein Acked-by: Alexander Stein Signed-off-by: Liu Ying Reviewed-by: Marek Vasut Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20230510092450.4024730-6-victor.liu@nxp.com commit c62a7b9ca72472f66c86db69bb0d1bb45c3f372b Author: Liu Ying Date: Wed May 10 17:24:48 2023 +0800 drm: lcdif: Check consistent bus format and flags across first bridges The single LCDIF embedded in i.MX93 SoC may drive multiple displays simultaneously. Check bus format and flags across first bridges in ->atomic_check() to ensure they are consistent. This is a preparation for adding i.MX93 LCDIF support. Acked-by: Alexander Stein Tested-by: Alexander Stein Reviewed-by: Marek Vasut Signed-off-by: Liu Ying Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20230510092450.4024730-5-victor.liu@nxp.com commit 5befcdcaf062abcd362c2e761b069424d9e3b2a4 Author: Liu Ying Date: Wed May 10 17:24:47 2023 +0800 drm: lcdif: Determine bus format and flags in ->atomic_check() Instead of determining LCDIF output bus format and bus flags in ->atomic_enable(), do that in ->atomic_check(). This is a preparation for the upcoming patch to check consistent bus format and bus flags across all first downstream bridges in ->atomic_check(). New lcdif_crtc_state structure is introduced to cache bus format and bus flags states in ->atomic_check() so that they can be read in ->atomic_enable(). Tested-by: Alexander Stein Reviewed-by: Alexander Stein Reviewed-by: Marek Vasut Signed-off-by: Liu Ying Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20230510092450.4024730-4-victor.liu@nxp.com commit 3f07432025890f1a49c30132420fb0e623a84a20 Author: Liu Ying Date: Wed May 10 17:24:46 2023 +0800 drm: lcdif: Drop unnecessary NULL pointer check on lcdif->bridge A valid bridge is already found in lcdif_attach_bridge() and set to lcdif->bridge, so lcdif->bridge cannot be a NULL pointer. Drop the unnecessary NULL pointer check in KMS stage. Tested-by: Alexander Stein Reviewed-by: Alexander Stein Signed-off-by: Liu Ying Reviewed-by: Marek Vasut Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20230510092450.4024730-3-victor.liu@nxp.com commit fff8013f15204a902977e7520b0ef7648a655aa9 Author: Liu Ying Date: Wed May 10 17:24:45 2023 +0800 dt-bindings: lcdif: Add i.MX93 LCDIF support There is one LCDIF embedded in i.MX93 SoC to connect with MIPI DSI controller through LCDIF cross line pattern(controlled by mediamix blk-ctrl) or connect with LVDS display bridge(LDB) directly or connect with a parallel display through parallel display format(also controlled by mediamix blk-ctrl). i.MX93 LCDIF IP is essentially the same to i.MX8MP LCDIF IP. Add device tree binding for i.MX93 LCDIF. Acked-by: Krzysztof Kozlowski Reviewed-by: Marek Vasut Reviewed-by: Alexander Stein Signed-off-by: Liu Ying Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20230510092450.4024730-2-victor.liu@nxp.com commit eb07c4f39c3e858a7d0cc4bb15b8a304f83f0497 Author: Vlastimil Babka Date: Tue May 23 09:06:34 2023 +0200 mm/slab: rename CONFIG_SLAB to CONFIG_SLAB_DEPRECATED As discussed at LSF/MM [1] [2] and with no objections raised there, deprecate the SLAB allocator. Rename the user-visible option so that users with CONFIG_SLAB=y get a new prompt with explanation during make oldconfig, while make olddefconfig will just switch to SLUB. In all defconfigs with CONFIG_SLAB=y remove the line so those also switch to SLUB. Regressions due to the switch should be reported to linux-mm and slab maintainers. [1] https://lore.kernel.org/all/4b9fc9c6-b48c-198f-5f80-811a44737e5f@suse.cz/ [2] https://lwn.net/Articles/932201/ Signed-off-by: Vlastimil Babka Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: David Rientjes Acked-by: Geert Uytterhoeven # m68k Acked-by: Helge Deller # parisc commit 3e39448ad9b29ee1beb409210812b1a3df11de3f Author: Uwe Kleine-König Date: Thu May 25 23:10:47 2023 +0200 spi: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230525211047.735789-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 33f2d12d040059bce36dbd8ab9ecc7a580bd4d77 Author: Thierry Reding Date: Thu May 25 11:42:37 2023 +0200 dt-bindings: usb: tegra-xudc: Remove extraneous PHYs The USB device controller on Tegra210 and later supports one USB 2/3 port, so only a single pair of PHYs is needed. Drop any of the extra PHYs from the bindings. Acked-by: Conor Dooley Signed-off-by: Thierry Reding commit 47d56cadb9e28da5b1bc5bad7e15120310aa118b Author: Ville Syrjälä Date: Thu Apr 13 19:49:14 2023 +0300 drm/i915: Implement CTM property support for VLV VLV has a so called "wide gamut color correction" unit (WGC). What it is is a 3x3 matrix similar to the later CHV CGM CSC, with less precisions/range. In fact CHV also has the WGC but using it there doesn't really make sense when you have the superior CGM CSC around. Hook up the necessary stuff to expose the WGC as the CTM crtc property. One additional crazy idea that came to mind would be to use the WGC as an output CSC on CHV for YCbCr output. But it would be incompatible with the legacy LUT usage. In fact since the WGC lacks post-offsets we'd probably have to use the legacy LUT to do that final part of the RGB->YCbCr conversion. Sounds doable, but perhaps not worth the hassle. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230413164916.4221-6-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 2a7318b2586684e842f58cb7eeada2d8cb5d8151 Author: Jon Hunter Date: Fri May 26 12:17:27 2023 +0100 arm64: tegra: Fix PCIe regulator for Orin Jetson AGX The PCIe slot on the Jetson Orin AGX is not working and PCIe cards are not detected. The regulator for the 3.3V regulator for the PCIe is using the wrong GPIO for turning on the regulator. Fix this by updating the 3.3V regulator to use the correct GPIO. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 78776086371bf8aba4314a52a46c52d946984c61 Author: Ville Syrjälä Date: Thu Apr 13 19:49:13 2023 +0300 drm/i915: Always enable CGM CSC on CHV On CHV toggling the CGM CSC on/off while the pipe is running leads to underruns. Looks like we'd have to do the toggling strictly inside the start_of_vblank-frame_start window to avoid this, but that window is less than a scanline so there's no way we can guarantee hitting it. As a workaround let's just leave the CGM CSC permanently enabled. Fortunately the CGM gamma/degamma units don't seem to suffer from this malady. I also tried turning off CGM unit clock gating, but that did not help. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230413164916.4221-5-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 2587c63aaaf47f6f4ea9d90047910534a3ecf432 Author: Ville Syrjälä Date: Thu Apr 13 19:49:12 2023 +0300 drm/i915: Fix CHV CGM CSC coefficient sign handling The CHV CGM CSC coefficients are in s4.12 two's complement format. Fix the CTM->CGM conversion to handle that correctly instead of pretending that the hw coefficients are also in some sign-magnitude format. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230413164916.4221-4-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit d9ce4e430790ba4f45e5febd7b4bd87b0f23563e Author: Ville Syrjälä Date: Thu Apr 13 19:49:11 2023 +0300 drm/i915: Expose crtc CTM property on ilk/snb The ilk/snb code is internally fully capable of handling the CTM property, so expose it. Note that we still choose not to expose DEGAMMA_LUT though. The hardware is capable if degamma or gamma, but not both simultanously due to lack of the split gamma mode. Exposing both LUTs might encourage userspace to try enabling both at the same time. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230413164916.4221-3-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit b1eaa8b2a55c9d5d22f5d2929f4d9973d6392241 Author: Michal Wajdeczko Date: Wed May 17 13:18:16 2023 +0200 kunit: Update kunit_print_ok_not_ok function There is no need use opaque test_or_suite pointer and is_test flag as we don't use anything from the suite struct. Always expect test pointer and use NULL as indication that provided results are from the suite so we can treat them differently. Since results could be from nested tests, like parameterized tests, add explicit level parameter to properly indent output messages and thus allow to reuse this function from other places. While around, remove small code duplication near skip directive. Signed-off-by: Michal Wajdeczko Cc: David Gow Cc: Rae Moar Reviewed-by: David Gow Signed-off-by: Shuah Khan commit b08f75b9bb0196a626a804e76970733f0a05de94 Author: Michal Wajdeczko Date: Wed May 17 13:18:15 2023 +0200 kunit: Fix reporting of the skipped parameterized tests Logs from the parameterized tests that were skipped don't include SKIP directive thus they are displayed as PASSED. Fix that. Signed-off-by: Michal Wajdeczko Cc: David Gow Reviewed-by: Rae Moar Reviewed-by: David Gow Signed-off-by: Shuah Khan commit d273b72846d636a7a9072587b5c53e7c0aeb791b Author: Michal Wajdeczko Date: Wed May 17 13:18:14 2023 +0200 kunit/test: Add example test showing parameterized testing Use of parameterized testing is documented [1] but such use case is not present in demo kunit test. Add small subtest for that. [1] https://kernel.org/doc/html/latest/dev-tools/kunit/usage.html#parameterized-testing Signed-off-by: Michal Wajdeczko Cc: David Gow Reviewed-by: David Gow Signed-off-by: Shuah Khan commit edc24de71648d500928ddf2d575cd2f3ae9f9103 Merge: db967cf828fc1 21e5a2d10c8f3 Author: Arnd Bergmann Date: Fri May 26 16:38:52 2023 +0200 Merge tag 'sram-for-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into soc/drivers This fixes a small bug in the SRAM misc driver and adds a compatible for SRAMs to the SRAM bindings. * tag 'sram-for-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: misc: sram: Generate unique names for subpools dt-bindings: sram: Add compatible for ST-Ericsson U8500 eSRAM Link: https://lore.kernel.org/r/CACRpkdbEQ7nTnJTj5WMtxvH057fDSbX5tNs5j4Y=5KSBMpa-Sw@mail.gmail.com Signed-off-by: Arnd Bergmann commit c98d58987931764b610115e4fbd1df702b2a959e Merge: 1bf42cfed0e68 e2b96ceb554ec Author: Arnd Bergmann Date: Fri May 26 16:28:43 2023 +0200 Merge tag 's32g2-dt-6.5' of https://github.com/chesterlintw/linux-s32g into soc/dt DT changes for v6.5: - Add missing cache properties for s32g2 and s32v234. * tag 's32g2-dt-6.5' of https://github.com/chesterlintw/linux-s32g: arm64: dts: s32: add missing cache properties Link: https://lore.kernel.org/r/ZHC8PO8lDjTae7nV@linux-8mug Signed-off-by: Arnd Bergmann commit 0b47a62ea65e1836945f09eafd99d0dd2bf92093 Merge: 88813f05b8347 8e0285ab95a9b Author: Arnd Bergmann Date: Fri May 26 15:53:43 2023 +0200 Merge tag 'gpio-omap-descriptors-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio into soc/arm This removes all usage of global GPIO numbers from arch/arm/mach-omap[12]. The patches have been reviewed and tested by everyone who showed interest which was one person that tested on OSK1 and Nokia 770, and we smoked out the bugs and also addressed all review comments. Any remaining problems can certainly be fixed in-tree. * tag 'gpio-omap-descriptors-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: ARM/musb: omap2: Remove global GPIO numbers from TUSB6010 ARM: omap2: Rewrite WLAN quirk to use GPIO descriptors ARM: omap2: Get USB hub reset GPIO from descriptor ARM/gpio: Push OMAP2 quirk down into TWL4030 driver ARM: omap1: Exorcise the legacy GPIO header ARM: omap1: Make serial wakeup GPIOs use descriptors ARM: omap1: Fix up the Nokia 770 board device IRQs ARM/mmc: Convert old mmci-omap to GPIO descriptors Input: ads7846 - Convert to use software nodes ARM: omap1: Remove reliance on GPIO numbers from SX1 ARM: omap1: Remove reliance on GPIO numbers from PalmTE ARM: omap1: Drop header on AMS Delta ARM/mfd/gpio: Fixup TPS65010 regression on OMAP1 OSK1 Signed-off-by: Arnd Bergmann commit b2b56a16323043b49dea915bc47408b30b91b0b6 Author: Prathamesh Shete Date: Wed May 24 16:20:21 2023 +0530 gpio: tegra186: Check GPIO pin permission before access. This change checks if we have the necessary permission to access the GPIO. For devices that have support for virtualisation we need to check both the TEGRA186_GPIO_VM_REG and the TEGRA186_GPIO_SCR_REG registers. For device that do not have virtualisation support for GPIOs we only need to check the TEGRA186_GPIO_SCR_REG register. Signed-off-by: Manish Bhardwaj Signed-off-by: Prathamesh Shete Acked-by: Thierry Reding Reviewed-by: Linus Walleij Acked-by: Jon Hunter Signed-off-by: Bartosz Golaszewski commit 6516c3d5d6161d81087c1e9c683480fd2597a0c3 Author: Jonathan McDowell Date: Tue May 16 18:47:13 2023 +0100 dt-bindings: gpio: Add GPIO3 for AXP209 GPIO binding schema The AXP209 has a 4th GPIO, so add it in preparation for support in the driver. Signed-off-by: Jonathan McDowell Acked-by: Jernej Skrabec Acked-by: Conor Dooley Acked-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit db967cf828fc134ba17c5e4539b1a3687cdd3f2d Author: Arnd Bergmann Date: Tue May 16 22:12:12 2023 +0200 arm-cci: add cci_enable_port_for_self prototype The cci_enable_port_for_self() is called from assembler, so add the prototype only to shut up the W=1 warning: drivers/bus/arm-cci.c:298:25: error: no previous prototype for 'cci_enable_port_for_self' [-Werror=missing-prototypes] Link: https://lore.kernel.org/r/20230516201218.556437-1-arnd@kernel.org Signed-off-by: Arnd Bergmann commit eaae5a8977d680355bb6a4f867c5fcc0633b2732 Merge: 2336ce7f456f8 afb39e2bd36af Author: Arnd Bergmann Date: Fri May 26 13:42:50 2023 +0200 Merge tag 'reset-for-v6.5' of git://git.pengutronix.de/pza/linux into soc/drivers Reset controller updates for v6.5 Use devm_platform_ioremap_resource() instead of platform_get_resource() and devm_ioremap_resource() in various drivers, simplify the stih407 Kconfig and use regmap_field_read_poll_timeout() instead of open-coded waiting, and use dev_err_probe() in the meson-audio-arb reset driver. With its platform gone, remove the now obsolete oxnas reset driver. Drop depends on the non-user-visible CONFIG_AUXILIARY_BUS symbol. * tag 'reset-for-v6.5' of git://git.pengutronix.de/pza/linux: reset: mpfs: select AUXILIARY_BUS reset: starfive: select AUXILIARY_BUS reset: oxnas: remove obsolete reset driver reset: sti: simplify driver's config and build reset: meson-audio-arb: Use dev_err_probe() reset: sti: rely on regmap_field_read_poll_timeout for ack wait reset: brcmstb-rescal: Use devm_platform_ioremap_resource() reset: meson: Use devm_platform_ioremap_resource() reset: reset-hsdk: Use devm_platform_ioremap_resource() reset: lpc18xx: Use devm_platform_ioremap_resource() reset: axs10x: Use devm_platform_ioremap_resource() reset: ath79: Use devm_platform_ioremap_resource() Link: https://lore.kernel.org/r/20230511133235.874566-1-p.zabel@pengutronix.de Signed-off-by: Arnd Bergmann commit 2336ce7f456f8bcad84123836e4de4635adc8557 Merge: 44c026a73be80 cb9a39aacd3d6 Author: Arnd Bergmann Date: Fri May 26 13:41:18 2023 +0200 Merge tag 'renesas-drivers-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/drivers Renesas driver updates for v6.5 - Enable watchdog reset support on R-Car V3U. * tag 'renesas-drivers-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: rcar-rst: Allow WDT reset on R-Car V3U Link: https://lore.kernel.org/r/cover.1685094242.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 795acd67c58480b8a2afe7ef1f3666c2f141729c Author: Krzysztof Kozlowski Date: Wed May 17 16:30:11 2023 +0200 arm64: defconfig: Enable ARCH_SPARX5 and ARCH_REALTEK Enable Microchip SparX-5 (ARCH_SPARX5) with its MMC controller and Realtek (ARCH_REALTEK) so their DTS will get built with defconfig and maybe platforms could be booted from it. Signed-off-by: Krzysztof Kozlowski Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230517143011.549319-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 8c86942c02c5add74ba19fcb48d13b213f28e010 Merge: 44c026a73be80 3f1e1ad9230f8 Author: Arnd Bergmann Date: Fri May 26 13:38:53 2023 +0200 Merge tag 'renesas-arm-defconfig-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/defconfig Renesas ARM defconfig updates for v6.5 - Refresh shmobile_defconfig for v6.4-rc1. * tag 'renesas-arm-defconfig-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: shmobile: defconfig: Refresh for v6.4-rc1 Link: https://lore.kernel.org/r/cover.1685094240.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 1bf42cfed0e68543e09dfa8f15b478b2fe3824c5 Merge: c45585623710c 18cbbdd846c5d Author: Arnd Bergmann Date: Fri May 26 13:37:35 2023 +0200 Merge tag 'renesas-dts-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/dt Renesas DTS updates for v6.5 - Add partial display support for the RZ/G2L and RZ/V2L SoCs and the RZ/G2L{,C} SMARC EVK development boards, - Add camera support for the RZ/GV2L SoC and the RZ/V2L and RZ/G2LC SMARC EVK development boards, - Add Multi-Function Timer Pulse Unit 3 support for the RZ/G2L and RZ/V2L SoCs, - Add PWM support for the R-Car V3U SoC. * tag 'renesas-dts-for-v6.5-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: dts: renesas: r8a779a0: Add PWM nodes arm64: dts: renesas: r9a07g054: Add MTU3a node arm64: dts: renesas: r9a07g044: Add MTU3a node arm64: dts: renesas: rzg2lc-smarc: Enable CRU, CSI support arm64: dts: renesas: rzv2l-smarc: Enable CRU, CSI support arm64: dts: renesas: r9a07g054: Add CSI and CRU nodes arm64: dts: renesas: rzg2lc-smarc: Link DSI with ADV7535 arm64: dts: renesas: rzg2l-smarc: Link DSI with ADV7535 arm64: dts: renesas: r9a07g054: Add DSI node arm64: dts: renesas: r9a07g044: Add DSI node arm64: dts: renesas: r9a07g054: Add vspd node arm64: dts: renesas: r9a07g044: Add vspd node arm64: dts: renesas: r9a07g054: Add fcpvd node arm64: dts: renesas: r9a07g044: Add fcpvd node Link: https://lore.kernel.org/r/cover.1685094244.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit c45585623710c828a1433f086e9b1001c781e303 Merge: 6a023136126c3 21f475946d899 Author: Arnd Bergmann Date: Fri May 26 13:37:02 2023 +0200 Merge tag 'dt-cleanup-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt into soc/dt Minor improvements in ARM DTS for v6.5 Minor improvements to fix dtbs_check warnings: 1. STE: Align UART nodes with bindings. 2. EN7523: add missing cache properties. * tag 'dt-cleanup-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt: ARM: dts: en7523: add missing cache properties ARM: dts: ste: align UART node name with bindings Link: https://lore.kernel.org/r/20230517131255.471002-2-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 6a023136126c3d94133e538f19c2bef8dd418edc Merge: 44c026a73be80 d5e64404e77c1 Author: Arnd Bergmann Date: Fri May 26 13:36:07 2023 +0200 Merge tag 'dt64-cleanup-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt into soc/dt Minor improvements in ARM64 DTS for v6.5 Mostly minor improvements to fix dtbs_check warnings: 1. mba6ulx: use non-deprecated property for GPIO keys wake-up, 2. Add missing cache properties (APM, Amazon, HiSilicon, Realtek, Synaptics, AllWinner, Microchip). Few older minor and major fixes which were waiting on mailing lists for longer time for Microchip SparX-5: 1. Fix secondary CPU bring-up and crash when talking to PSCI on reference boards (Robert Marko), 2. Simplify CPU address-cells (Robert Marko), 3. Align pinctrl node names with bindings (Michael Walle). * tag 'dt64-cleanup-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt: arm64: dts: sparx5: rename pinctrl nodes arm64: dts: microchip: sparx5: correct CPU address-cells arm64: dts: microchip: sparx5: do not use PSCI on reference boards arm64: dts: microchip: add missing cache properties arm64: dts: allwinner: a64: add missing cache properties arm64: dts: synaptics: add missing cache properties arm64: dts: realtek: add missing cache properties arm64: dts: hisilicon: add missing cache properties arm64: dts: amazon: add missing cache properties arm64: dts: apm: add missing cache properties arm64: dts: mba6ulx: correct GPIO keys wakeup Link: https://lore.kernel.org/r/20230517131255.471002-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 88813f05b834756dfcadb7fbd7bf8f21e69b7811 Author: Arnd Bergmann Date: Tue May 16 17:31:09 2023 +0200 ARM: versatile: mark mmc_status() static mmc_status() is only used in the file it is defined in, and no longer has an 'extern' declaration: arch/arm/mach-versatile/versatile.c:56:14: error: no previous prototype for 'mmc_status' Fixes: 16956fed35fe ("ARM: versatile: switch to DT only booting and remove legacy code") Link: https://lore.kernel.org/r/20230516153109.514251-14-arnd@kernel.org Signed-off-by: Arnd Bergmann commit 5e40c79a513bff9b9f5c00d469de31d7318e3252 Author: Arnd Bergmann Date: Tue May 16 17:31:08 2023 +0200 ARM: spear: include "pl080.h" for pl080_get_signal() prototype pl080_get_signal() and pl080_put_signal() are declared in pl080.h and defined in pl080.c, but this file is missing an include of the header: arch/arm/mach-spear/pl080.c:27:5: error: no previous prototype for 'pl080_get_signal' arch/arm/mach-spear/pl080.c:62:6: error: no previous prototype for 'pl080_put_signal' Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20230516153109.514251-13-arnd@kernel.org Signed-off-by: Arnd Bergmann commit 6475f4bb3fbd24b4b2b7c41b3777a62b20b016e2 Author: Arnd Bergmann Date: Tue May 16 17:31:07 2023 +0200 ARM: sa1100: address missing prototype warnings There are three warnings for mach-sa1100 when building with W=1: arch/arm/common/sa1111.c:699:1: error: no previous prototype for 'sa1111_configure_smc' [-Werror=missing-prototypes] 699 | sa1111_configure_smc(struct sa1111 *sachip, int sdram, unsigned int drac, | ^~~~~~~~~~~~~~~~~~~~ arch/arm/mach-sa1100/assabet.c:718:13: error: no previous prototype for 'assabet_init_irq' [-Werror=missing-prototypes] 718 | void __init assabet_init_irq(void) | ^~~~~~~~~~~~~~~~ arch/arm/mach-sa1100/pm.c:126:12: error: no previous prototype for 'sa11x0_pm_init' [-Werror=missing-prototypes] 126 | int __init sa11x0_pm_init(void) | ^~~~~~~~~~~~~~ The first two are only used locally and can be 'static', while the last one needs to include the right header. Link: https://lore.kernel.org/r/20230516153109.514251-12-arnd@kernel.org Signed-off-by: Arnd Bergmann commit a9ae9c526cc232b69b0bc9d668e303c90600e848 Author: Arnd Bergmann Date: Tue May 16 17:31:06 2023 +0200 ARM: pxa: fix missing-prototypes warnings The PXA platform has a number of configurations that end up with a warning like these when building with W=1: drivers/hwmon/max1111.c:83:5: error: no previous prototype for 'max1111_read_channel' [-Werror=missing-prototypes] arch/arm/mach-pxa/reset.c:86:6: error: no previous prototype for 'pxa_restart' [-Werror=missing-prototypes] arch/arm/mach-pxa/mfp-pxa2xx.c:254:5: error: no previous prototype for 'keypad_set_wake' [-Werror=missing-prototypes] drivers/clk/pxa/clk-pxa25x.c:70:14: error: no previous prototype for 'pxa25x_get_clk_frequency_khz' [-Werror=missing-prototypes] drivers/clk/pxa/clk-pxa25x.c:325:12: error: no previous prototype for 'pxa25x_clocks_init' [-Werror=missing-prototypes] drivers/clk/pxa/clk-pxa27x.c:74:14: error: no previous prototype for 'pxa27x_get_clk_frequency_khz' [-Werror=missing-prototypes] drivers/clk/pxa/clk-pxa27x.c:102:6: error: no previous prototype for 'pxa27x_is_ppll_disabled' [-Werror=missing-prototypes] drivers/clk/pxa/clk-pxa27x.c:470:12: error: no previous prototype for 'pxa27x_clocks_init' [-Werror=missing-prototypes] arch/arm/mach-pxa/pxa27x.c:44:6: error: no previous prototype for 'pxa27x_clear_otgph' [-Werror=missing-prototypes] arch/arm/mach-pxa/pxa27x.c:58:6: error: no previous prototype for 'pxa27x_configure_ac97reset' [-Werror=missing-prototypes] arch/arm/mach-pxa/spitz_pm.c:170:15: error: no previous prototype for 'spitzpm_read_devdata' [-Werror=missing-prototypes] The problem is that there is a declaration for each of these, but it's only seen by the caller and not the callee. Moving these into appropriate header files ensures that both use the same calling conventions and it avoids the warnings. Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20230516153109.514251-11-arnd@kernel.org Signed-off-by: Arnd Bergmann commit f8ef1233939495c405a9faa4bd1ae7d3f581bae4 Author: Arnd Bergmann Date: Tue May 16 17:31:05 2023 +0200 ARM: orion5x: fix d2net gpio initialization The DT version of this board has a custom file with the gpio device. However, it does nothing because the d2net_init() has no caller or prototype: arch/arm/mach-orion5x/board-d2net.c:101:13: error: no previous prototype for 'd2net_init' Call it from the board-dt file as intended. Fixes: 94b0bd366e36 ("ARM: orion5x: convert d2net to Device Tree") Reviewed-by: Andrew Lunn Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230516153109.514251-10-arnd@kernel.org Signed-off-by: Arnd Bergmann commit 861bc1d2886d47bd57a2cbf2cda87fdbe3eb9d08 Author: Arnd Bergmann Date: Tue May 16 17:31:04 2023 +0200 ARM: omap2: fix missing tick_broadcast() prototype omap2 contains a hack to define tick_broadcast() on non-SMP configurations in place of the normal SMP definition. This one causes a warning because of a missing prototype: arch/arm/mach-omap2/board-generic.c:44:6: error: no previous prototype for 'tick_broadcast' Make sure to always include the header with the declaration. Fixes: d86ad463d670 ("ARM: OMAP2+: Fix regression for using local timer on non-SMP SoCs") Acked-by: Aaro Koskinen Link: https://lore.kernel.org/r/20230516153109.514251-9-arnd@kernel.org Signed-off-by: Arnd Bergmann commit 94c1c0a29bfccf94c70afef5d89734bce778add6 Author: Arnd Bergmann Date: Tue May 16 17:31:03 2023 +0200 ARM: omap1: add missing include The omap_serial_wakeup_init() declaration is not visible where it is defined, so make sure "common.h" is included here, avoiding: arch/arm/mach-omap1/serial.c:221:12: error: no previous prototype for 'omap_serial_wakeup_init' [-Werror=missing-prototypes] Acked-by: Tony Lindgren Acked-by: Aaro Koskinen Link: https://lore.kernel.org/r/20230516153109.514251-8-arnd@kernel.org Signed-off-by: Arnd Bergmann commit ecd2a5769d09e57b6d9cafdbcf91c13f31286b06 Author: Arnd Bergmann Date: Tue May 16 17:31:02 2023 +0200 ARM: lpc32xx: add missing include lpc32xx_loopback_set() is defined in linux/soc/nxp/lpc32xx-misc.h but this is not included before the function definition. arch/arm/mach-lpc32xx/serial.c:63:6: error: no previous prototype for 'lpc32xx_loopback_set' Fixes: ffba29c9ebd0 ("serial: lpc32xx: allow compile testing") Acked-by: Vladimir Zapolskiy Link: https://lore.kernel.org/r/20230516153109.514251-7-arnd@kernel.org Signed-off-by: Arnd Bergmann commit 5692520a040b7029f0ba94b1128d564f44a68e8d Author: Arnd Bergmann Date: Tue May 16 17:31:00 2023 +0200 ARM: imx: add missing include imx25_pm_init() is declared in common.h but this is not included before its definition: arch/arm/mach-imx/pm-imx25.c:31:13: error: no previous prototype for 'imx25_pm_init' Link: https://lore.kernel.org/r/20230516153109.514251-5-arnd@kernel.org Signed-off-by: Arnd Bergmann commit 774f60dd6abc85ba01f4969a091991c089d22ed0 Author: Arnd Bergmann Date: Tue May 16 17:30:59 2023 +0200 ARM: highbank: add missing include highbank_pm_init() is declared in core.h this is not included in the file that defines it. arch/arm/mach-highbank/pm.c:43:13: error: no previous prototype for 'highbank_pm_init' Acked-by: Andre Przywara Link: https://lore.kernel.org/r/20230516153109.514251-4-arnd@kernel.org Signed-off-by: Arnd Bergmann commit 419013740ea1e4343d8ade535d999f59fa28e460 Author: Arnd Bergmann Date: Tue May 16 17:30:58 2023 +0200 ARM: ep93xx: fix missing-prototype warnings ep93xx_clocksource_read() is only called from the file it is declared in, while ep93xx_timer_init() is declared in a header that is not included here. arch/arm/mach-ep93xx/timer-ep93xx.c:120:13: error: no previous prototype for 'ep93xx_timer_init' arch/arm/mach-ep93xx/timer-ep93xx.c:63:5: error: no previous prototype for 'ep93xx_clocksource_read' Fixes: 000bc17817bf ("ARM: ep93xx: switch to GENERIC_CLOCKEVENTS") Acked-by: Alexander Sverdlin Link: https://lore.kernel.org/r/20230516153109.514251-3-arnd@kernel.org Signed-off-by: Arnd Bergmann commit 30955b4afc2bbea9046c60df994297fac5edc02c Author: Arnd Bergmann Date: Tue May 16 17:30:57 2023 +0200 ARM: davinci: fix davinci_cpufreq_init() declaration The davinci_cpufreq_init() declaration is only seen by its caller but not the definition: drivers/cpufreq/davinci-cpufreq.c:153:12: error: no previous prototype for 'davinci_cpufreq_init' Move it into the platform_data header that is already used an interface between the two places. Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230516153109.514251-2-arnd@kernel.org Signed-off-by: Arnd Bergmann commit 898a9e3f56db9860ab091d4bf41b6caa99aafc3d Author: Raphael Gallais-Pou Date: Mon May 15 14:38:18 2023 +0200 drm/stm: ltdc: fix late dereference check In ltdc_crtc_set_crc_source(), struct drm_crtc was dereferenced in a container_of() before the pointer check. This could cause a kernel panic. Fix this smatch warning: drivers/gpu/drm/stm/ltdc.c:1124 ltdc_crtc_set_crc_source() warn: variable dereferenced before check 'crtc' (see line 1119) Reported-by: kernel test robot Closes: https://lore.kernel.org/lkml/202212241802.zeLFZCXB-lkp@intel.com/ Reported-by: Dan Carpenter Closes: https://lore.kernel.org/lkml/202212241802.zeLFZCXB-lkp@intel.com/ Signed-off-by: Raphael Gallais-Pou Acked-by: Philippe Cornu Signed-off-by: Philippe Cornu Link: https://patchwork.freedesktop.org/patch/msgid/20230515123818.93971-1-raphael.gallais-pou@foss.st.com commit 4781e965e655b0f1736856908f861939dac79b4e Author: Florian Fainelli Date: Thu May 25 10:59:15 2023 -0700 net: phy: broadcom: Register dummy IRQ handler In order to have our interrupt descriptor fully setup and in particular the action, ensure that we register a full fledged interrupt handler. This also allow us to set the interrupt polarity and flow through the same call. This is specifically necessary for kernel/irq/pm.c::suspend_device_irq to set the interrupt descriptor to the IRQD_WAKEUP_ARMED state and enable the interrupt for wake-up since it was still in a disabled state. Without an interrupt descriptor we would have ran into cases where the wake-up interrupt is not capable of waking up the system, specifically if we resumed the system ACPI S5 using the Ethernet PHY. In that case the Ethernet PHY interrupt would be pending by the time the kernel booted, which it would acknowledge but then we could never use it as a wake-up source again. Fixes: 8baddaa9d4ba ("net: phy: broadcom: Add support for Wake-on-LAN") Suggested-by: Doug Berger Debugged-by: Doug Berger Signed-off-by: Florian Fainelli Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit f26f03b3031938ad46c3fb617745e9fd4a289ce7 Author: Neal Cardwell Date: Thu May 25 10:57:36 2023 -0400 tcp: remove unused TCP_SYNQ_INTERVAL definition Currently TCP_SYNQ_INTERVAL is defined but never used. According to "git log -S TCP_SYNQ_INTERVAL net-next/main" it seems the last references to TCP_SYNQ_INTERVAL were removed by 2015 commit fa76ce7328b2 ("inet: get rid of central tcp/dccp listener timer") Signed-off-by: Neal Cardwell Reviewed-by: Simon Horman Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 4266f41feaeee2521749ce2cfb52eafd4e2947c5 Author: Daniel Borkmann Date: Fri May 26 12:13:56 2023 +0200 bpf: Fix bad unlock balance on freeze_mutex Commit c4c84f6fb2c4 ("bpf: drop unnecessary bpf_capable() check in BPF_MAP_FREEZE command") moved the permissions check outside of the freeze_mutex in the map_freeze() handler. The error paths still jumps to the err_put which tries to unlock the freeze_mutex even though it was not locked in the first place. Fix it. Fixes: c4c84f6fb2c4 ("bpf: drop unnecessary bpf_capable() check in BPF_MAP_FREEZE command") Reported-by: syzbot+8982e75c2878b9ffeac5@syzkaller.appspotmail.com Signed-off-by: Daniel Borkmann commit 34235f54b021ca75ab89d8af8d7f1fc420eaded0 Author: Yang Li Date: Fri Apr 21 16:34:02 2023 +0800 drm/stm: dsi: Use devm_platform_ioremap_resource() Convert platform_get_resource(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li Acked-by: Raphael Gallais-Pou Signed-off-by: Philippe Cornu Link: https://patchwork.freedesktop.org/patch/msgid/20230421083402.21364-1-yang.lee@linux.alibaba.com commit 4aadd2920b81b3d7e5c8ac63c7d5d673f3c8aaeb Author: Andrii Nakryiko Date: Thu May 25 15:13:11 2023 -0700 libbpf: Ensure FD >= 3 during bpf_map__reuse_fd() Improve bpf_map__reuse_fd() logic and ensure that dup'ed map FD is "good" (>= 3) and has O_CLOEXEC flags. Use fcntl(F_DUPFD_CLOEXEC) for that, similarly to ensure_good_fd() helper we already use in low-level APIs that work with bpf() syscall. Suggested-by: Lennart Poettering Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230525221311.2136408-2-andrii@kernel.org commit 59842c5451fe830737600276ba9dee4595341d77 Author: Andrii Nakryiko Date: Thu May 25 15:13:10 2023 -0700 libbpf: Ensure libbpf always opens files with O_CLOEXEC Make sure that libbpf code always gets FD with O_CLOEXEC flag set, regardless if file is open through open() or fopen(). For the latter this means to add "e" to mode string, which is supported since pretty ancient glibc v2.7. Also drop the outdated TODO comment in usdt.c, which was already completed. Suggested-by: Lennart Poettering Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230525221311.2136408-1-andrii@kernel.org commit aafeeaf3d2a8a91a5407c774c578abec79dcff00 Author: Philipp Zabel Date: Wed May 24 14:29:25 2023 +0100 media: video-mux: update driver to active state Drop the open coded pad format array, use subdev active state instead. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5aa8de7ad14f3bb7c39a67a63767de50b5fe122d Author: Philipp Zabel Date: Wed May 24 14:29:24 2023 +0100 media: video-mux: fix error paths Move notifier cleanup into video_mux_async_register() to avoid calling v4l2_async_nf_unregister() when v4l2_async_subdev_nf_register() failed. In case video_mux_async_register() fails, call media_entity_cleanup(). Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fe1b585ce91da47af7e7f8985428099d52eeca3c Author: Gustavo A. R. Silva Date: Wed May 24 01:20:38 2023 +0100 media: pci: cx18-av-vbi: Replace one-element array with flexible-array member One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array members in struct vbi_anc_data. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bd947783a2177f9083c4bde5b9db45df2d5adc8b Author: Artur Weber Date: Fri May 19 19:28:53 2023 +0100 media: Revert "media: exynos4-is: Remove dependency on obsolete SoC support" Support for the Exynos4212 SoC was originally dropped as there were no boards using it. We will be adding a device that uses it, so add it back. This reverts commit 2d41a0c9ae51ac363d107f2510022106e7234b33. Signed-off-by: Artur Weber Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 645dec333f5f9451ea0f888a8dd9ececa7300424 Author: Uwe Kleine-König Date: Wed May 24 16:16:44 2023 +0100 media: staging: max96712: Switch i2c driver back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 962508e31c77de6daee780233084e521b9724cd0 Author: Yunfei Dong Date: Thu May 25 02:40:09 2023 +0100 media: mediatek: vcodec: using empty lat buffer as the last one Adding one empty lat buffer with parameter 'is_empty_flag = true' used to flush core work queue decode. Queue the empty lat buffer to core list when driver need to flush decode. It's mean core already decode all existed lat buffer when get empty lat buffer, then wake up core decode done event, the driver will exit when getting core dec done event. Fixes: d227af847ac2 ("media: mediatek: vcodec: add core decode done event") Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 297160d411e3271c5a6c7df2edda30a1508afb34 Author: Yunfei Dong Date: Thu May 25 02:40:08 2023 +0100 media: mediatek: vcodec: move core context from device to each instance There are so many lat buffer in core context list, some instances maybe be scheduled for a very long time. Moving the core context to each instance, it only be used to control lat buffer of each instance. And the core work queue of each instance is scheduled by system. Fixes: 2cfca6c1bf80 ("media: mediatek: vcodec: move lat_buf to the top of core list") Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2864e304faec04c2674328aad0e820a9cd84cdec Author: Yunfei Dong Date: Thu May 25 02:40:07 2023 +0100 media: mediatek: vcodec: using decoder status instead of core work count Adding the definition of decoder status to separate different decoder period for core hardware. core_work_cnt is the number of core work queued to work queue, the control is very complex, leading to some unreasonable test result. Using parameter status to indicate whether queue core work to work queue. Fixes: 2e0ef56d81cb ("media: mediatek: vcodec: making sure queue_work successfully") Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 15ff9e7f49bc107fce067d8b0ea5ebf4bd9fc9cf Author: Yunfei Dong Date: Thu May 25 02:40:06 2023 +0100 media: mediatek: vcodec: Avoid unneeded error logging Since the LAT decoder works faster than its CORE, getting the trans buffer may be done only after CORE finishes processing: avoid printing an error if the decode function returns -EAGAIN, as this means that the buffer from CORE is not yet available, but will be at a later time. Also change the log level for calls to vdec_msg_queue_dqbuf() in H264 and VP9 LAT decoder drivers to avoid excessive logging. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2f16c95e7aa9716f7332b30d578dc496399d7d8f Author: Hans Verkuil Date: Tue Apr 18 08:46:52 2023 +0100 media: staging: media: imx: initialize hs_settle to avoid warning Initialize hs_settle to 0 to avoid this compiler warning: imx8mq-mipi-csi2.c: In function 'imx8mq_mipi_csi_start_stream.part.0': imx8mq-mipi-csi2.c:91:55: warning: 'hs_settle' may be used uninitialized [-Wmaybe-uninitialized] 91 | #define GPR_CSI2_1_S_PRG_RXHS_SETTLE(x) (((x) & 0x3f) << 2) | ^~ imx8mq-mipi-csi2.c:357:13: note: 'hs_settle' was declared here 357 | u32 hs_settle; | ^~~~~~~~~ It's a false positive, but it is too complicated for the compiler to detect that. Signed-off-by: Hans Verkuil Reviewed-by: Martin Kepplinger Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2a7d6b9c55baabfbad03946f2b0c695df72cfb06 Author: Vaishnav Achath Date: Fri Apr 21 11:04:30 2023 +0100 media: v4l2-mc: Drop subdev check in v4l2_create_fwnode_links_to_pad() While updating v4l2_create_fwnode_links_to_pad() to accept non-subdev sinks, the check is_media_entity_v4l2_subdev() was not removed which prevented the function from being used with non-subdev sinks, Drop the unnecessary check. Fixes: bd5a03bc5be8 ("media: Accept non-subdev sinks in v4l2_create_fwnode_links_to_pad()") Signed-off-by: Vaishnav Achath Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit eba7dbc5eba06a503ba78fdfb4488dbaaeed9471 Merge: 9b66ee06e5ca2 267d7692f6cd5 Author: David S. Miller Date: Fri May 26 10:39:41 2023 +0100 Merge branch 'mv88e6xxx-phylink-prepare' Russell King says: ==================== net: dsa: mv88e6xxx: prepare for phylink_pcs conversion These two patches provide some preparation for converting the mv88e6xxx DSA driver to use phylink_pcs rather than bolting the serdes bits into the MAC calls. In order to correctly drive mv88e6xxx hardware when the PCS code is split, we need to force the link down while changing the configuration of a port. This is provided for via the mac_prepare() and mac_finish() methods, but DSA does not forward these on to DSA drivers. Patch 1 adds support to the DSA core to forward these two methods to DSA drivers, and patch 2 moves the code from mv88e6xxx_mac_config() into the respective methods. ==================== Signed-off-by: David S. Miller commit 267d7692f6cd5c9b8796324cdd54db594ca8d3e4 Author: Russell King (Oracle) Date: Thu May 25 11:38:50 2023 +0100 net: dsa: mv88e6xxx: move link forcing to mac_prepare/mac_finish Move the link forcing out of mac_config() and into the mac_prepare() and mac_finish() methods. This results in no change to the order in which these operations are performed, but does mean when we convert mv88e6xxx to phylink_pcs support, we will continue to preserve this ordering. Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit dd805cf3e80e038aeb06902399ce9bd6fafb4ff3 Author: Russell King (Oracle) Date: Thu May 25 11:38:44 2023 +0100 net: dsa: add support for mac_prepare() and mac_finish() calls Add DSA support for the phylink mac_prepare() and mac_finish() calls. These were introduced as part of the PCS support to allow MACs to perform preparatory steps prior to configuration, and finalisation steps after the MAC and PCS has been configured. Introducing phylink_pcs support to the mv88e6xxx DSA driver needs some code moved out of its mac_config() stage into the mac_prepare() and mac_finish() stages, and this commit facilitates such code in DSA drivers. Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 342527f35338d9373f307e24662f174008b571b2 Author: P Praneesh Date: Thu May 25 20:07:57 2023 +0300 wifi: ath12k: Add support to parse new WMI event for 6 GHz regulatory In order to support different power levels of 6 GHz AP and client, new WMI event for regulatory (WMI_REG_CHAN_LIST_CC_EXT_EVENTID) has been added in firmware to provide new parameters required for 6 GHz regulatory rules. Firmware advertises its capability of handling new event in WMI service ready event. Based on that, host needs to set host_service_flags in WMI init command to indicate that host supports processing of this WMI event. Based on advertised host capability, firmware sends event WMI_REG_CHAN_LIST_CC_EXT_EVENTID. This new event contains 2G/5G/6G reg rules with additional power value fields for 6GHz and regd is built accordingly. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-02903-QCAHKSWPL_SILICONZ-1 Signed-off-by: P Praneesh Signed-off-by: Ramya Gnanasekar Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230502142018.20301-1-quic_rgnanase@quicinc.com commit 9b66ee06e5ca2698d0ba12a7ad7188cb724279e7 Author: Jakub Kicinski Date: Wed May 24 10:09:01 2023 -0700 net: ynl: prefix uAPI header include with uapi/ To keep things simple we used to include the uAPI header in the kernel in the #include format. This works well enough, most of the genl families should have headers in include/net/ so linux/$family.h ends up referring to the uAPI header, anyway. And if it doesn't no big deal, we'll just include more info than we need. Unless that is there is a naming conflict. Someone recently created include/linux/psp.h which will be a problem when supporting the PSP protocol. (I'm talking about work-in-progress patches, but it's just a proof that assuming lack of name conflicts was overly optimistic.) Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 08264f85c5c05ecc38d409c84d48cfb00ccd3bc4 Author: Jani Nikula Date: Thu May 25 12:49:42 2023 +0300 drm/i915/gsc: use system include style for drm headers Use <> instead of "" for including headers from include/. Fixes: 8a9bf29546a1 ("drm/i915/gsc: add initial support for GSC proxy") Cc: Daniele Ceraolo Spurio Cc: Alan Previn Signed-off-by: Jani Nikula Reviewed-by: Luca Coelho Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230525094942.941123-1-jani.nikula@intel.com commit e34f78b970ea51d17841f6168e50223efc690c76 Author: Mark Brown Date: Tue May 23 22:49:00 2023 +0100 arm64/cpufeature: Use helper for ECV CNTPOFF cpufeature The newly added support for ECV CNTPOFF open codes the recently added helper ARM64_CPUID_FIELDS(), make use of the helper. No functional change. Signed-off-by: Mark Brown Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20230523-arm64-ecv-helper-v1-1-506dfb5fb199@kernel.org Signed-off-by: Catalin Marinas commit cb5aa637943857f7f937a51d1e621dbe925f9f67 Author: Mark Brown Date: Mon May 22 15:28:00 2023 +0100 kselftest/arm64: Add a smoke test for ptracing hardware break/watch points There was a report that the hardware breakpoints and watch points weren't reporting the debug architecture version as expected, they were reporting a version of 0 which is not defined in the architecture. This happens when running in a KVM guest if the host has a debug architecture version not supported by KVM, it in turn confuses GDB which rejects any debug architecture version it does not know about. Add a test that covers that situation and while we're at it reports the debug architecture version and number of slots available to aid with figuring out problems that may arise. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230414-arm64-test-hw-breakpoint-v2-1-90a19e3b1059@kernel.org Signed-off-by: Catalin Marinas commit ca7d05007d0a95615a51cb5a624775db8c450f43 Author: Pieter Jansen van Vuuren Date: Wed May 24 10:36:38 2023 +0100 sfc: handle VI shortage on ef100 by readjusting the channels When fewer VIs are allocated than what is allowed we can readjust the channels by calling efx_mcdi_alloc_vis() again. Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Martin Habets Reviewed-by: Simon Horman Reviewed-by: Edward Cree Signed-off-by: David S. Miller commit 1f9d4ba6839cc77717ed603fc6df1f36995da76d Author: Mark Brown Date: Thu May 11 15:05:15 2023 +0900 arm64/esr: Add decode of ISS2 to data abort reporting The architecture has added more information about faults to ISS2 within ESR. Add decode of this to our data abort fault decode to aid diagnostics. Features that are not currently enabled are included here for completeness. Since the architecture specifies the values of bits within ISS2 in terms of ISS2 rather than in terms of the register as a whole we do so for our definitions as well, this makes it easier to review bitfield definitions. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230417-arm64-iss2-dabt-decode-v3-2-c1fa503e503a@kernel.org Signed-off-by: Catalin Marinas commit de847275449a99343393a5f2a4179cf7f4d12372 Author: Mark Brown Date: Thu May 11 15:05:14 2023 +0900 arm64/esr: Use GENMASK() for the ISS mask We express the mask for ESR_ELx.ISS in a non-standard manner, not using the standard helpers. In preparation for adding decode for ISS2 convert to use GENMASK(). No functional change. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230417-arm64-iss2-dabt-decode-v3-1-c1fa503e503a@kernel.org Signed-off-by: Catalin Marinas commit 35c812050ebdfe5ce576cf04d1d43d02dc2dfe19 Author: Nathan Chancellor Date: Wed May 24 08:38:27 2023 -0700 drm/i915: Fix clang -Wimplicit-fallthrough in intel_async_flip_check_hw() Clang warns: drivers/gpu/drm/i915/display/intel_display.c:6012:3: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] case I915_FORMAT_MOD_X_TILED: ^ drivers/gpu/drm/i915/display/intel_display.c:6012:3: note: insert 'break;' to avoid fall-through case I915_FORMAT_MOD_X_TILED: ^ break; 1 error generated. Clang is a little more pedantic than GCC, which does not warn when falling through to a case that is just break or return. Clang's version is more in line with the kernel's own stance in deprecated.rst, which states that all switch/case blocks must end in either break, fallthrough, continue, goto, or return. Add the missing break to silence the warning. Fixes: 937859485aef ("drm/i915: Support Async Flip on Linear buffers") Reported-by: kernel test robot Closes: https://lore.kernel.org/202305241902.UvHtMoxa-lkp@intel.com/ Reported-by: Naresh Kamboju Closes: https://lore.kernel.org/CA+G9fYv68V3ewK0Qj-syQj7qX-hQr0H1MFL=QFNuDoE_J2Zu-g@mail.gmail.com/ Reported-by: Tom Rix Closes: https://lore.kernel.org/all/20230523125116.1669057-1-trix@redhat.com/ Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230524-intel_async_flip_check_hw-implicit-fallthrough-v1-1-83de89e376a1@kernel.org commit da56a1bfbab55189595e588f1d984bdfb5cf5924 Author: Ajay Agarwal Date: Wed Apr 12 15:04:25 2023 +0530 PCI: dwc: Wait for link up only if link is started In dw_pcie_host_init() regardless of whether the link has been started or not, the code waits for the link to come up. Even in cases where start_link() is not defined the code ends up spinning in a loop for 1 second. Since in some systems dw_pcie_host_init() gets called during probe, this one second loop for each pcie interface instance ends up extending the boot time. Wait for the link up in only if the start_link() is defined. Link: https://lore.kernel.org/r/20230412093425.3659088-1-ajayagarwal@google.com Tested-by: Will McVicker Signed-off-by: Sajid Dalvi Signed-off-by: Ajay Agarwal Signed-off-by: Lorenzo Pieralisi commit 35070674f488eefaeb753a13df11199d10328ff8 Author: Neil Armstrong Date: Fri May 26 09:27:16 2023 +0200 Revert "dt-bindings: bridge: samsung-dsim: Make some flags optional" This reverts commit cfaf76d349837f695c8aa6d7077847fec4231fe5 which was applied without review due to a bad tool manipulation. Acked-by: Conor Dooley Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230526-revert-bad-binding-v1-1-67329ad1bd80@linaro.org commit f24b49550814fdee4a98b9552e35e243ccafd4a8 Author: Dario Binacchi Date: Tue May 16 10:50:39 2023 +0200 drm/panel: simple: fix active size for Ampire AM-480272H3TMQW-T01H The previous setting was related to the overall dimension and not to the active display area. In the "PHYSICAL SPECIFICATIONS" section, the datasheet shows the following parameters: ---------------------------------------------------------- | Item | Specifications | unit | ---------------------------------------------------------- | Display area | 98.7 (W) x 57.5 (H) | mm | ---------------------------------------------------------- | Overall dimension | 105.5(W) x 67.2(H) x 4.96(D) | mm | ---------------------------------------------------------- Fixes: 966fea78adf2 ("drm/panel: simple: Add support for Ampire AM-480272H3TMQW-T01H") Signed-off-by: Dario Binacchi Reviewed-by: Neil Armstrong [narmstrong: fixed Fixes commit id length] Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230516085039.3797303-1-dario.binacchi@amarulasolutions.com commit c857946a4e262e0f798fe7625fadf85bf1190fc4 Author: Kurt Kanzenbach Date: Tue May 23 13:15:18 2023 +0200 net/core: Enable socket busy polling on -RT Busy polling is currently not allowed on PREEMPT_RT, because it disables preemption while invoking the NAPI callback. It is not possible to acquire sleeping locks with disabled preemption. For details see commit 20ab39d13e2e ("net/core: disable NET_RX_BUSY_POLL on PREEMPT_RT"). However, strict cyclic and/or low latency network applications may prefer busy polling e.g., using AF_XDP instead of interrupt driven communication. The preempt_disable() is used in order to prevent the poll_owner and NAPI owner to be preempted while owning the resource to ensure progress. Netpoll performs busy polling in order to acquire the lock. NAPI is locked by setting the NAPIF_STATE_SCHED flag. There is no busy polling if the flag is set and the "owner" is preempted. Worst case is that the task owning NAPI gets preempted and NAPI processing stalls. This is can be prevented by properly prioritising the tasks within the system. Allow RX_BUSY_POLL on PREEMPT_RT if NETPOLL is disabled. Don't disable preemption on PREEMPT_RT within the busy poll loop. Tested on x86 hardware with v6.1-RT and v6.3-RT on Intel i225 (igc) with AF_XDP/ZC sockets configured to run in busy polling mode. Suggested-by: Sebastian Andrzej Siewior Signed-off-by: Kurt Kanzenbach Signed-off-by: David S. Miller commit 410bb21319f69c2ec28aeafe530d00ed2f6a1c54 Author: Geert Uytterhoeven Date: Wed May 24 14:32:11 2023 +0200 drm/panel: simple: Add Ampire AM-800480L1TMQW-T00H Add support for the Ampire AM-800480L1TMQW-T00H 5" WVGA TFT LCD panel. Signed-off-by: Geert Uytterhoeven Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/244d9471e0ed248ff2dea8ded3a5384a1c51904b.1684931026.git.geert+renesas@glider.be commit d3a6c2b60f07c64631b9437032d8f079341b7a16 Author: Geert Uytterhoeven Date: Wed May 24 14:32:10 2023 +0200 dt-bindings: display: panel-simple: Add Ampire AM-800480L1TMQW-T00H Document support for the Ampire AM-800480L1TMQW-T00H 5" WVGA TFT LCD panel. Signed-off-by: Geert Uytterhoeven Acked-by: Conor Dooley Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/422adef8c4941fa56fdadacb3d362a9fb387455e.1684931026.git.geert+renesas@glider.be commit cfaf76d349837f695c8aa6d7077847fec4231fe5 Author: Adam Ford Date: Thu May 25 22:05:59 2023 -0500 dt-bindings: bridge: samsung-dsim: Make some flags optional In the event a device is connected to the samsung-dsim controller that doesn't support the burst-clock, the driver is able to get the requested pixel clock from the attached device or bridge. In these instances, the samsung,burst-clock-frequency isn't needed, so remove it from the required list. The pll-clock frequency can be set by the device tree entry for samsung,pll-clock-frequency, but in some cases, the pll-clock may have the same clock rate as sclk_mipi clock. If they are equal, this flag is not needed since the driver will use the sclk_mipi rate as a fallback. Signed-off-by: Adam Ford Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230526030559.326566-8-aford173@gmail.com commit bb0e13b9e223b218c9f242f8d340a332b4381042 Author: Adam Ford Date: Thu May 25 22:05:58 2023 -0500 drm: bridge: samsung-dsim: Support non-burst mode The high-speed clock is hard-coded to the burst-clock frequency specified in the device tree. However, when using devices like certain bridge chips without burst mode and varying resolutions and refresh rates, it may be necessary to set the high-speed clock dynamically based on the desired pixel clock for the connected device. This also removes the need to set a clock speed from the device tree for non-burst mode operation, since the pixel clock rate is the rate requested from the attached device like a bridge chip. This should have no impact for people using burst-mode and setting the burst clock rate is still required for those users. If the burst clock is not present, change the error message to dev_info indicating the clock use the pixel clock. Signed-off-by: Adam Ford Tested-by: Chen-Yu Tsai Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Tested-by: Marek Szyprowski Reviewed-by: Jagan Teki Tested-by: Jagan Teki # imx8mm-icore Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230526030559.326566-7-aford173@gmail.com commit 89691775f5735fca9dc40e119edcbb52a25b9612 Author: Adam Ford Date: Thu May 25 22:05:57 2023 -0500 drm: bridge: samsung-dsim: Dynamically configure DPHY timing The DPHY timings are currently hard coded. Since the input clock can be variable, the phy timings need to be variable too. To facilitate this, we need to cache the hs_clock based on what is generated from the PLL. The phy_mipi_dphy_get_default_config_for_hsclk function configures the DPHY timings in pico-seconds, and a small macro converts those timings into clock cycles based on the hs_clk. Signed-off-by: Adam Ford Signed-off-by: Lucas Stach Tested-by: Chen-Yu Tsai Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Tested-by: Michael Walle Tested-by: Marek Szyprowski Reviewed-by: Jagan Teki Tested-by: Jagan Teki # imx8mm-icore Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230526030559.326566-6-aford173@gmail.com commit 171b3b1e0f8b8c894f2388e1cf765a56f831ee5e Author: Adam Ford Date: Thu May 25 22:05:56 2023 -0500 drm: bridge: samsung-dsim: Select GENERIC_PHY_MIPI_DPHY In order to support variable DPHY timings, it's necessary to enable GENERIC_PHY_MIPI_DPHY so phy_mipi_dphy_get_default_config can be used to determine the nominal values for a given resolution and refresh rate. Signed-off-by: Adam Ford Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Tested-by: Chen-Yu Tsai Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230526030559.326566-5-aford173@gmail.com commit 33d8d14c83bf67aa0d262961a6fda9c40f3c1052 Author: Adam Ford Date: Thu May 25 22:05:55 2023 -0500 drm: bridge: samsung-dsim: Fetch pll-clock-frequency automatically Make the pll-clock-frequency optional. If it's present, use it to maintain backwards compatibility with existing hardware. If it is absent, read clock rate of "sclk_mipi" to determine the rate. Since it can be optional, change the message from an error to dev_info. Signed-off-by: Adam Ford Tested-by: Chen-Yu Tsai Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Tested-by: Marek Szyprowski Reviewed-by: Jagan Teki Tested-by: Jagan Teki # imx8mm-icore Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230526030559.326566-4-aford173@gmail.com commit 54f1a83c72250b182fa7722b0c5f6eb5e769598d Author: Adam Ford Date: Thu May 25 22:05:54 2023 -0500 drm: bridge: samsung-dsim: Fix PMS Calculator on imx8m[mnp] According to Table 13-45 of the i.MX8M Mini Reference Manual, the min and max values for M and the frequency range for the VCO_out calculator were incorrect. This information was contradicted in other parts of the mini, nano and plus manuals. After reaching out to my NXP Rep, when confronting him about discrepencies in the Nano manual, he responded with: "Yes it is definitely wrong, the one that is part of the NOTE in MIPI_DPHY_M_PLLPMS register table against PMS_P, PMS_M and PMS_S is not correct. I will report this to Doc team, the one customer should be take into account is the Table 13-40 DPHY PLL Parameters and the Note above." These updated values also match what is used in the NXP downstream kernel. To fix this, make new variables to hold the min and max values of m and the minimum value of VCO_out, and update the PMS calculator to use these new variables instead of using hard-coded values to keep the backwards compatibility with other parts using this driver. Fixes: 4d562c70c4dc ("drm: bridge: samsung-dsim: Add i.MX8M Mini/Nano support") Signed-off-by: Adam Ford Reviewed-by: Lucas Stach Tested-by: Chen-Yu Tsai Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Tested-by: Marek Szyprowski Reviewed-by: Jagan Teki Tested-by: Jagan Teki # imx8mm-icore Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230526030559.326566-3-aford173@gmail.com commit a617b33f7e513f25becf843bc97f8f1658c16337 Author: Lucas Stach Date: Thu May 25 22:05:53 2023 -0500 drm: bridge: samsung-dsim: fix blanking packet size calculation Scale the blanking packet sizes to match the ratio between HS clock and DPI interface clock. The controller seems to do internal scaling to the number of active lanes, so we don't take those into account. Signed-off-by: Lucas Stach Signed-off-by: Adam Ford Tested-by: Chen-Yu Tsai Tested-by: Frieder Schrempf Tested-by: Marek Szyprowski Reviewed-by: Jagan Teki Tested-by: Jagan Teki # imx8mm-icore Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230526030559.326566-2-aford173@gmail.com commit 1a56fcf08ae463a4564d111356091b2bdb6c7bce Author: Rob Clark Date: Thu May 25 08:52:24 2023 -0700 drm/amdgpu: Fix no-procfs build Fixes undefined symbol when PROC_FS is not enabled. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305251510.U0R2as7k-lkp@intel.com/ Fixes: 376c25f8ca47 ("drm/amdgpu: Switch to fdinfo helper") Signed-off-by: Rob Clark Reviewed-by: Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230525155227.560094-1-robdclark@gmail.com commit b8887e796e06b1de4db899f49d531d220f94f393 Merge: 33a86170888b7 4bd65789ba847 Author: Dave Airlie Date: Fri May 26 14:23:28 2023 +1000 Merge tag 'drm-misc-next-2023-05-24' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v6.5: UAPI Changes: Cross-subsystem Changes: * fbdev: Move framebuffer I/O helpers to , fix naming * firmware: Init sysfb as early as possible Core Changes: * DRM scheduler: Rename interfaces * ttm: Store ttm_device_funcs in .rodata * Replace strlcpy() with strscpy() in various places * Cleanups Driver Changes: * bridge: analogix: Fix endless probe loop; samsung-dsim: Support swapping clock/data polarity; tc358767: Use devm_ Cleanups; * gma500: Fix I/O-memory access * panel: boe-tv101wum-nl6: Improve initialization; sharp-ls043t1le001: Mode fixes; simple: Add BOE EV121WXM-N10-1850 plus DT bindings; AddS6D7AA0 plus DT bindings; Cleanups * ssd1307x: Style fixes * sun4i: Release clocks * msm: Fix I/O-memory access * nouveau: Cleanups * shmobile: Support Renesas; Enable framebuffer console; Various fixes * vkms: Fix RGB565 conversion Signed-off-by: Dave Airlie # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAmRuBXEACgkQaA3BHVML # eiPLkwgAqCa7IuSDQhFMWVOI0EJpPPEHtHM8SCT1Pp8aniXk23Ru+E16c5zck53O # uf4tB+zoFrwD9npy60LIvX1OZmXS1KI4+ZO8itYFk6GSjxqbTWbjNFREBeWFdIpa # OG54nEqjFQZzEXY+gJYDpu5zqLy3xLN07ZgQkcMyfW3O/Krj4LLzfQTDl+jP5wkO # 7/v5Eu5CG5QjupMxIjb4e+ruUflp73pynur5bhZsfS1bPNGFTnxHlwg7NWnBXU7o # Hg23UYfCuZZWPmuO26EeUDlN33rCoaycmVgtpdZft2eznca5Mg74Loz1Qc3GQfjw # LLvKsAIlBcZvEIhElkzhtXitBoe7LQ== # =/9zV # -----END PGP SIGNATURE----- # gpg: Signature made Wed 24 May 2023 22:39:13 AEST # gpg: using RSA key 7217FBAC8CE9CF6344A168E5680DC11D530B7A23 # gpg: Can't check signature: No public key # Conflicts: # MAINTAINERS From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230524124237.GA25416@linux-uq9g commit d6f1e0bfe532b2ec725d9f768ca305af7aa1029a Merge: 78dbc2468de44 50fb587e6a56d Author: Jakub Kicinski Date: Thu May 25 20:56:19 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. Signed-off-by: Jakub Kicinski commit 78dbc2468de446833771a3484007ad4a3effd0fa Merge: d4031ec844bc5 d1b9e1391ab2d Author: Jakub Kicinski Date: Thu May 25 20:37:28 2023 -0700 Merge tag 'ib-leds-netdev-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds Lee Jones says: ==================== Immutable branch between LEDs and netdev due for the v6.5 merge window Andrew Lunn says: Christian Marangi and I will be continuing the work of offloading LED blinking to Ethernet MAC and PHY LED controllers. The next set of patches is again cross subsystem, LEDs and netdev. It also requires some patches you have in for-leds-next: a286befc24e8 leds: trigger: netdev: Use mutex instead of spinlocks 509412749002 leds: trigger: netdev: Convert device attr to macro 0fd93ac85826 leds: trigger: netdev: Rename add namespace to netdev trigger enum modes eb31ca4531a0 leds: trigger: netdev: Drop NETDEV_LED_MODE_LINKUP from mode 3fc498cf54b4 leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename I'm assuming the new series will get nerged via netdev, with your Acked-by. Could you create a stable branch with these patches which can be pulled into netdev? * tag 'ib-leds-netdev-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: leds: trigger: netdev: Use mutex instead of spinlocks leds: trigger: netdev: Convert device attr to macro leds: trigger: netdev: Rename add namespace to netdev trigger enum modes leds: trigger: netdev: Drop NETDEV_LED_MODE_LINKUP from mode leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename ==================== Link: https://lore.kernel.org/r/20230525111521.GA411262@google.com Signed-off-by: Jakub Kicinski commit d4031ec844bc52fe7f2f844e9c476727fd6b8240 Merge: 657d42cf5df64 ad42a35bdfc6d Author: Jakub Kicinski Date: Thu May 25 19:56:10 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. Conflicts: net/ipv4/raw.c 3632679d9e4f ("ipv{4,6}/raw: fix output xfrm lookup wrt protocol") c85be08fc4fa ("raw: Stop using RTO_ONLINK.") https://lore.kernel.org/all/20230525110037.2b532b83@canb.auug.org.au/ Adjacent changes: drivers/net/ethernet/freescale/fec_main.c 9025944fddfe ("net: fec: add dma_wmb to ensure correct descriptor values") 144470c88c5d ("net: fec: using the standard return codes when xdp xmit errors") Signed-off-by: Jakub Kicinski commit 321a64b328156fd43d3be589c24905a641c7995b Author: Daniel Müller Date: Thu May 25 23:22:48 2023 +0000 selftests/bpf: Check whether to run selftest The sockopt test invokes test__start_subtest and then unconditionally asserts the success. That means that even if deny-listed, any test will still run and potentially fail. Evaluate the return value of test__start_subtest() to achieve the desired behavior, as other tests do. Signed-off-by: Daniel Müller Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230525232248.640465-1-deso@posteo.net commit 78ef970385ea4d02a44af2776e4f4c74d4fce3d4 Author: Tejun Heo Date: Thu May 25 12:15:36 2023 -1000 rxrpc: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not necessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Cc: David Howells Cc: Marc Dionne Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: linux-afs@lists.infradead.org Cc: netdev@vger.kernel.org commit 022acfa632607735833eab34487a098c1ee9a7fc Author: Tejun Heo Date: Thu May 25 12:15:33 2023 -1000 net: qrtr: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not necessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Cc: Manivannan Sadhasivam Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: linux-arm-msm@vger.kernel.org Cc: netdev@vger.kernel.org commit 72b1fe6cc6523908bfc339d07d18cb0f3469a643 Author: Tejun Heo Date: Thu May 25 12:15:29 2023 -1000 net: wwan: t7xx: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not necessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Cc: Chandrashekar Devegowda Cc: Intel Corporation Cc: Chiranjeevi Rapolu Cc: Liu Haijun Cc: M Chetan Kumar Cc: Ricardo Martinez Cc: Loic Poulain Cc: Sergey Ryazanov Cc: Johannes Berg Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: netdev@vger.kernel.org commit 57bbf99ce9639c46eec43081d30e2763c135c653 Author: Tejun Heo Date: Thu May 25 12:15:02 2023 -1000 dm integrity: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not necessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Cc: Alasdair Kergon Cc: Mike Snitzer Cc: dm-devel@redhat.com Cc: linux-kernel@vger.kernel.org commit 4432b507445acf3f8e09ce253d4ca852c177b625 Author: Paul Moore Date: Wed May 24 23:19:53 2023 -0400 lsm: fix a number of misspellings A random collection of spelling fixes for source files in the LSM layer. Reviewed-by: Casey Schaufler Signed-off-by: Paul Moore commit b087f59779b00f73738fdf6a63915aabf77c7d39 Author: Geert Uytterhoeven Date: Wed May 10 15:26:00 2023 +0200 dt-bindings: interrupt-controller: sifive,plic: Sort compatible values Restore alphabetical sort order of the supported SiFive-compatible values. Signed-off-by: Geert Uytterhoeven Reviewed-by: Conor Dooley Acked-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley commit 1bd2339df1b545b544283f7b896ef651d93e32cf Author: Geert Uytterhoeven Date: Wed May 10 15:27:24 2023 +0200 dt-bindings: timer: sifive,clint: Clean up compatible value section Replace the sentences in the description listing some supported variants by comments on the individual compatible values, to ease future maintenance. While at it, restore alphabetical sort order. Signed-off-by: Geert Uytterhoeven Reviewed-by: Conor Dooley Acked-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley commit d031f4e8b493df299123fbb4ec13db870584ed28 Author: Tetsuo Handa Date: Thu May 11 23:48:45 2023 +0900 reiserfs: Initialize sec->length in reiserfs_security_init(). syzbot is reporting that sec->length is not initialized. Since security_inode_init_security() returns 0 when initxattrs is provided but call_int_hook(inode_init_security) returned -EOPNOTSUPP, control will reach to "if (sec->length && ...) {" without initializing sec->length. Reported-by: syzbot Closes: https://syzkaller.appspot.com/bug?extid=00a3779539a23cbee38c Signed-off-by: Tetsuo Handa Fixes: 52ca4b6435a4 ("reiserfs: Switch to security_inode_init_security()") Signed-off-by: Paul Moore commit 18c8ae813156a6855f026de80fffb91e1a28ab3d Author: Zqiang Date: Thu May 25 12:00:38 2023 +0800 workqueue: Disable per-cpu CPU hog detection when wq_cpu_intensive_thresh_us is 0 If workqueue.cpu_intensive_thresh_us is set to 0, the detection mechanism for CPU-hogging per-cpu work item will keep triggering spuriously: workqueue: process_srcu hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND workqueue: gc_worker hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND workqueue: gc_worker hogged CPU for >0us 8 times, consider switching to WQ_UNBOUND workqueue: wait_rcu_exp_gp hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND workqueue: kfree_rcu_monitor hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND workqueue: kfree_rcu_monitor hogged CPU for >0us 8 times, consider switching to WQ_UNBOUND workqueue: reg_todo hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND This commit therefore disables the CPU-hog detection mechanism when workqueue.cpu_intensive_thresh_us is set to 0. tj: Patch description updated and the condition check on cpu_intensive_thresh_us separated into a separate if statement for readability. Signed-off-by: Zqiang Signed-off-by: Tejun Heo commit 688eb8191b475db5acfd48634600b04fd3dda9ad Author: Noah Goldstein Date: Wed May 10 20:10:02 2023 -0500 x86/csum: Improve performance of `csum_partial` 1) Add special case for len == 40 as that is the hottest value. The nets a ~8-9% latency improvement and a ~30% throughput improvement in the len == 40 case. 2) Use multiple accumulators in the 64-byte loop. This dramatically improves ILP and results in up to a 40% latency/throughput improvement (better for more iterations). Results from benchmarking on Icelake. Times measured with rdtsc() len lat_new lat_old r tput_new tput_old r 8 3.58 3.47 1.032 3.58 3.51 1.021 16 4.14 4.02 1.028 3.96 3.78 1.046 24 4.99 5.03 0.992 4.23 4.03 1.050 32 5.09 5.08 1.001 4.68 4.47 1.048 40 5.57 6.08 0.916 3.05 4.43 0.690 48 6.65 6.63 1.003 4.97 4.69 1.059 56 7.74 7.72 1.003 5.22 4.95 1.055 64 6.65 7.22 0.921 6.38 6.42 0.994 96 9.43 9.96 0.946 7.46 7.54 0.990 128 9.39 12.15 0.773 8.90 8.79 1.012 200 12.65 18.08 0.699 11.63 11.60 1.002 272 15.82 23.37 0.677 14.43 14.35 1.005 440 24.12 36.43 0.662 21.57 22.69 0.951 952 46.20 74.01 0.624 42.98 53.12 0.809 1024 47.12 78.24 0.602 46.36 58.83 0.788 1552 72.01 117.30 0.614 71.92 96.78 0.743 2048 93.07 153.25 0.607 93.28 137.20 0.680 2600 114.73 194.30 0.590 114.28 179.32 0.637 3608 156.34 268.41 0.582 154.97 254.02 0.610 4096 175.01 304.03 0.576 175.89 292.08 0.602 There is no such thing as a free lunch, however, and the special case for len == 40 does add overhead to the len != 40 cases. This seems to amount to be ~5% throughput and slightly less in terms of latency. Testing: Part of this change is a new kunit test. The tests check all alignment X length pairs in [0, 64) X [0, 512). There are three cases. 1) Precomputed random inputs/seed. The expected results where generated use the generic implementation (which is assumed to be non-buggy). 2) An input of all 1s. The goal of this test is to catch any case a carry is missing. 3) An input that never carries. The goal of this test si to catch any case of incorrectly carrying. More exhaustive tests that test all alignment X length pairs in [0, 8192) X [0, 8192] on random data are also available here: https://github.com/goldsteinn/csum-reproduction The reposity also has the code for reproducing the above benchmark numbers. Signed-off-by: Noah Goldstein Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230511011002.935690-1-goldstein.w.n%40gmail.com commit 47e75a4aaf97e562444eddcbfc77955f3f0e8013 Author: Tony Lindgren Date: Tue May 23 09:52:35 2023 +0300 arm64: dts: broadcom: Unify pinctrl-single pin group nodes for stingray We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Let's also correct the pinctrl controller #size-cells to 0 while at it. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230523065236.14524-1-tony@atomide.com Signed-off-by: Florian Fainelli commit 9d7121f1d2faa0b50bf5b462adcd2dd91970c45e Author: Rafał Miłecki Date: Sat May 20 13:26:01 2023 +0200 ARM: dts: BCM5301X: Use updated device "compatible" strings Northstar binding was updated to use minus/hyphen char between model and version for all devices. Signed-off-by: Rafał Miłecki Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230520112601.11821-2-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 42d5b302bf1807af46f65b97bb6c8652d0e12782 Author: Rafał Miłecki Date: Sat May 20 13:26:00 2023 +0200 dt-bindings: arm: bcm: unify version notation of Northstar devices Always use a minus/hyphen char to separate model from version. This unifies binding's "compatible" strings. Signed-off-by: Rafał Miłecki Reviewed-by: Linus Walleij Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230520112601.11821-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 4c857a719bf9c5ddbcf3bd92398632041bff50d0 Author: JP Kobryn Date: Wed May 24 17:13:23 2023 -0700 libbpf: Change var type in datasec resize func This changes a local variable type that stores a new array id to match the return type of btf__add_array(). Signed-off-by: JP Kobryn Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20230525001323.8554-1-inwardvessel@gmail.com commit 1d5d24abc6c0908c116953290be4f8523f65efb7 Author: Kamal Dasu Date: Fri May 19 12:56:58 2023 -0400 MAINTAINERS: Replace my email address Switch to the corporate email address for Broadcom related entries. Signed-off-by: Kamal Dasu Link: https://lore.kernel.org/r/20230519165658.29296-1-kamal.dasu@broadcom.com Signed-off-by: Florian Fainelli commit c4c84f6fb2c4dc4c0f5fd927b3c3d3fd28b7030e Author: Andrii Nakryiko Date: Wed May 24 15:54:19 2023 -0700 bpf: drop unnecessary bpf_capable() check in BPF_MAP_FREEZE command Seems like that extra bpf_capable() check in BPF_MAP_FREEZE handler was unintentionally left when we switched to a model that all BPF map operations should be allowed regardless of CAP_BPF (or any other capabilities), as long as process got BPF map FD somehow. This patch replaces bpf_capable() check in BPF_MAP_FREEZE handler with writeable access check, given conceptually freezing the map is modifying it: map becomes unmodifiable for subsequent updates. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230524225421.1587859-2-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 061b0cb9327b80d7a0f63a33e7c3e2a91a71f142 Author: Fedor Pchelkin Date: Wed May 17 18:03:17 2023 +0300 wifi: ath9k: don't allow to overwrite ENDPOINT0 attributes A bad USB device is able to construct a service connection response message with target endpoint being ENDPOINT0 which is reserved for HTC_CTRL_RSVD_SVC and should not be modified to be used for any other services. Reject such service connection responses. Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: fb9987d0f748 ("ath9k_htc: Support for AR9271 chipset.") Reported-by: syzbot+b68fbebe56d8362907e8@syzkaller.appspotmail.com Signed-off-by: Fedor Pchelkin Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230516150427.79469-1-pchelkin@ispras.ru commit 27044b57f8a5328f4f7517f8a15d9fe3171ab279 Author: Gustavo A. R. Silva Date: Wed May 17 18:03:17 2023 +0300 wifi: wil6210: wmi: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated, and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations alone in structs with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members alone in structs. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/288 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Simon Horman Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/ZGKHM+MWFsuqzTjm@work commit cbb3debbb1630132a39e90058861f1c1d01dffb6 Author: Gustavo A. R. Silva Date: Wed May 17 18:03:16 2023 +0300 wifi: wil6210: fw: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated, and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations alone in structs with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members alone in structs. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/287 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Simon Horman Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/ZGKHByxujJoygK+l@work commit c152aed4dcc21e6d496e700148fdd85c2b0ff09c Author: Arnd Bergmann Date: Tue May 16 18:06:42 2023 +0200 arm64: add alt_cb_patch_nops prototype alt_cb_patch_nops() is called through an inline asm macro, so it does not need a prototype for the caller, but adding it avoids this W=1 build warning: arch/arm64/kernel/alternative.c:295:14: error: no previous prototype for 'alt_cb_patch_nops' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-16-arnd@kernel.org Signed-off-by: Catalin Marinas commit e13d32e99264e0b63b01417e2f2db627f4507b97 Author: Arnd Bergmann Date: Tue May 16 18:06:41 2023 +0200 arm64: move early_brk64 prototype to header The prototype used for calling early_brk64() is in the file that calls it, which is the wrong place, as it is not included for the definition: arch/arm64/kernel/traps.c:1100:12: error: no previous prototype for 'early_brk64' [-Werror=missing-prototypes] Move it to an appropriate header instead. Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-15-arnd@kernel.org Signed-off-by: Catalin Marinas commit 8ada7aab02ee9b07c8539a5c9cc452520b183a72 Author: Arnd Bergmann Date: Tue May 16 18:06:40 2023 +0200 arm64: signal: include asm/exception.h The do_notify_resume() is in a header that is not included for the definition, which causes a W=1 warning: arch/arm64/kernel/signal.c:1280:6: error: no previous prototype for 'do_notify_resume' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-14-arnd@kernel.org Signed-off-by: Catalin Marinas commit a7f5cb606e9993daf2d129efc5e3b6ca46ad9227 Author: Arnd Bergmann Date: Tue May 16 18:06:39 2023 +0200 arm64: kaslr: add kaslr_early_init() declaration kaslr_early_init() is called from assembler code and does not need a declaration to work, but adding one anyway shuts up this W=1 warning: arch/arm64/kernel/pi/kaslr_early.c:88:16: error: no previous prototype for 'kaslr_early_init' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-13-arnd@kernel.org Signed-off-by: Catalin Marinas commit 1a1183938946fc1e06425d830a85e5aad63c049d Author: Arnd Bergmann Date: Tue May 16 18:06:38 2023 +0200 arm64: flush: include linux/libnvdimm.h The two cache management functions are declared in libnvdimm.h but provided by architecture specific code. Without including the header, this causes a W=1 warning: arch/arm64/mm/flush.c:96:6: error: no previous prototype for 'arch_wb_cache_pmem' [-Werror=missing-prototypes] arch/arm64/mm/flush.c:104:6: error: no previous prototype for 'arch_invalidate_pmem' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-12-arnd@kernel.org Signed-off-by: Catalin Marinas commit 60a0aab7463ee69296692d980b96510ccce3934e Author: Arnd Bergmann Date: Tue May 16 18:06:37 2023 +0200 arm64: module-plts: inline linux/moduleloader.h module_frob_arch_sections() is declared in moduleloader.h, but that is not included before the definition: arch/arm64/kernel/module-plts.c:286:5: error: no previous prototype for 'module_frob_arch_sections' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-11-arnd@kernel.org Signed-off-by: Catalin Marinas commit b925b4314c9155b32d17e9dfda37d64c229063b7 Author: Arnd Bergmann Date: Tue May 16 18:06:36 2023 +0200 arm64: hide unused is_valid_bugaddr() When generic BUG() support is disabled, this function has no declaration and no callers but causes a W=1 warning: arch/arm64/kernel/traps.c:950:5: error: no previous prototype for 'is_valid_bugaddr' [-Werror=missing-prototypes] Add an #ifdef that matches the one around the declaration. Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-10-arnd@kernel.org Signed-off-by: Catalin Marinas commit fbc0cd6f60443264af0b7aed050cae2ef38036f9 Author: Arnd Bergmann Date: Tue May 16 18:06:35 2023 +0200 arm64: efi: add efi_handle_corrupted_x18 prototype This functions is only called from assembler and lacks a prototype, which is seen from this W=1 warning: arch/arm64/kernel/efi.c:155:25: error: no previous prototype for 'efi_handle_corrupted_x18' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-9-arnd@kernel.org Signed-off-by: Catalin Marinas commit 68a879b55346588de936c99a04e665d9cdc326e6 Author: Arnd Bergmann Date: Tue May 16 18:06:34 2023 +0200 arm64: cpuidle: fix #ifdef for acpi functions The acpi_processor_ffh_lpi_* functions are defined whenever CONFIG_ACPI is enabled, but only called and declared when CONFIG_ACPI_PROCESSOR_IDLE is also enabled. Without that, a W=1 build triggers missing-prototope warnings, so the #ifdef needs to be adapted: arch/arm64/kernel/cpuidle.c:60:5: error: no previous prototype for 'acpi_processor_ffh_lpi_probe' [-Werror=missing-prototypes] arch/arm64/kernel/cpuidle.c:65:15: error: no previous prototype for 'acpi_processor_ffh_lpi_enter' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-8-arnd@kernel.org Signed-off-by: Catalin Marinas commit 05d557a5cf59b08590cfc1bfc44bfdc0f9ac9681 Author: Arnd Bergmann Date: Tue May 16 18:06:33 2023 +0200 arm64: kvm: add prototypes for functions called in asm A lot of kvm specific functions are called only from assembler and have no extern prototype, but that causes a W=1 warnings: arch/arm64/kvm/handle_exit.c:365:24: error: no previous prototype for 'nvhe_hyp_panic_handler' [-Werror=missing-prototypes] arch/arm64/kvm/va_layout.c:188:6: error: no previous prototype for 'kvm_patch_vector_branch' [-Werror=mi ssing-prototypes] arch/arm64/kvm/va_layout.c:287:6: error: no previous prototype for 'kvm_get_kimage_voffset' [-Werror=mis sing-prototypes] arch/arm64/kvm/va_layout.c:293:6: error: no previous prototype for 'kvm_compute_final_ctr_el0' [-Werror= missing-prototypes] arch/arm64/kvm/hyp/vhe/switch.c:259:17: error: no previous prototype for 'hyp_panic' [-Werror=missing-pr arch/arm64/kvm/hyp/nvhe/switch.c:389:17: error: no previous prototype for 'kvm_unexpected_el2_exception' arch/arm64/kvm/hyp/nvhe/switch.c:384:28: error: no previous prototype for 'hyp_panic_bad_stack' [-Werror arch/arm64/kvm/hyp/nvhe/hyp-main.c:383:6: error: no previous prototype for 'handle_trap' [-Werror=missin arch/arm64/kvm/hyp/nvhe/psci-relay.c:203:28: error: no previous prototype for 'kvm_host_psci_cpu_entry' [-Werror=missing-prototypes] Declare those in asm/kvm_asm.h, which already has related declarations. Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-7-arnd@kernel.org Signed-off-by: Catalin Marinas commit 010089e9d3fe689e439fe3b78ed859a0782fbad0 Author: Arnd Bergmann Date: Tue May 16 18:06:32 2023 +0200 arm64: spectre: provide prototypes for internal functions The helpers in proton-pack.c are called from assembler and have no prototype in a header, which causes a W=1 warning: arch/arm64/kernel/proton-pack.c:568:13: error: no previous prototype for 'spectre_v4_patch_fw_mitigation_enable' [-Werror=missing-prototypes] arch/arm64/kernel/proton-pack.c:588:13: error: no previous prototype for 'smccc_patch_fw_mitigation_conduit' [-Werror=missing-prototypes] arch/arm64/kernel/proton-pack.c:1064:14: error: no previous prototype for 'spectre_bhb_patch_loop_mitigation_enable' [-Werror=missing-prototypes] arch/arm64/kernel/proton-pack.c:1075:14: error: no previous prototype for 'spectre_bhb_patch_fw_mitigation_enabled' [-Werror=missing-prototypes] Add these to asm/spectre.h, which contains related declarations already. Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-6-arnd@kernel.org Signed-off-by: Catalin Marinas commit ec3a3db7100ddebb32ed5b1052c1cd1136057230 Author: Arnd Bergmann Date: Tue May 16 18:06:31 2023 +0200 arm64: move cpu_suspend_set_dbg_restorer() prototype to header The cpu_suspend_set_dbg_restorer() function is called by the hw_breakpoint code but defined in another file. Since the declaration is in the same file as the caller, the compiler warns about the definition without a prior prototype: arch/arm64/kernel/suspend.c:35:13: error: no previous prototype for 'cpu_suspend_set_dbg_restorer' [-Werror=missing-prototypes] Move it into the corresponding header instead to avoid the warning. Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-5-arnd@kernel.org Signed-off-by: Catalin Marinas commit 6ac19f96515e1f5198503701d3aecf60d5bc83e5 Author: Arnd Bergmann Date: Tue May 16 18:06:30 2023 +0200 arm64: avoid prototype warnings for syscalls With W=1 warnings enabled, there are lots of complaints about missing prototypes for system calls, plus a few other related ones: arch/arm64/kernel/sys_compat.c:68:6: error: no previous prototype for 'compat_arm_syscall' [-Werror=missing-prototypes] arch/arm64/include/asm/syscall_wrapper.h:76:32: error: no previous prototype for '__arm64_sys_io_setup' [-Werror=missing-prototypes] arch/arm64/include/asm/syscall_wrapper.h:41:32: error: no previous prototype for '__arm64_compat_sys_io_setup' [-Werror=missing-prototypes] arch/arm64/include/asm/syscall_wrapper.h:76:32: error: no previous prototype for '__arm64_sys_io_destroy' [-Werror=missing-prototypes] arch/arm64/include/asm/syscall_wrapper.h:76:32: error: no previous prototype for '__arm64_sys_io_submit' [-Werror=missing-prototypes] Add declarations to the syscall macros to avoid all of these, plus one for the compat syscall entry. Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-4-arnd@kernel.org Signed-off-by: Catalin Marinas commit aea197160d7426d876a8040f370373cf412e3ad6 Author: Arnd Bergmann Date: Tue May 16 18:06:29 2023 +0200 arm64: add scs_patch_vmlinux prototype scs_patch_vmlinux() is only called from assembler code, so there is no prototype, but adding one avoids this warning: arch/arm64/kernel/patch-scs.c:254:24: error: no previous prototype for function 'scs_patch_vmlinux' [-Werror,-Wmissing-prototypes] Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-3-arnd@kernel.org Signed-off-by: Catalin Marinas commit 320a93d4df48a378ebf923639fa62770676b80db Author: Arnd Bergmann Date: Tue May 16 18:06:28 2023 +0200 arm64: xor-neon: mark xor_arm64_neon_*() static The only references to these functions are in the same file, and there is no prototype, which causes a harmless warning: arch/arm64/lib/xor-neon.c:13:6: error: no previous prototype for 'xor_arm64_neon_2' [-Werror=missing-prototypes] arch/arm64/lib/xor-neon.c:40:6: error: no previous prototype for 'xor_arm64_neon_3' [-Werror=missing-prototypes] arch/arm64/lib/xor-neon.c:76:6: error: no previous prototype for 'xor_arm64_neon_4' [-Werror=missing-prototypes] arch/arm64/lib/xor-neon.c:121:6: error: no previous prototype for 'xor_arm64_neon_5' [-Werror=missing-prototypes] Fixes: cc9f8349cb33 ("arm64: crypto: add NEON accelerated XOR implementation") Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20230516160642.523862-2-arnd@kernel.org Signed-off-by: Catalin Marinas commit 4f8d66a9fb2edcd05c1e563456a55a08910bfb37 Author: Christophe JAILLET Date: Sat May 20 10:13:22 2023 +0200 wifi: ray_cs: Fix an error handling path in ray_probe() Should ray_config() fail, some resources need to be released as already done in the remove function. While at it, remove a useless and erroneous comment. The probe is ray_probe(), not ray_attach(). Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions") Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/8c544d18084f8b37dd108e844f7e79e85ff708ff.1684570373.git.christophe.jaillet@wanadoo.fr commit 391af06a02e7642039ac5f6c4b2c034ab0992b5d Author: Christophe JAILLET Date: Sat May 20 10:05:08 2023 +0200 wifi: wl3501_cs: Fix an error handling path in wl3501_probe() Should wl3501_config() fail, some resources need to be released as already done in the remove function. Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions") Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/7cc9c9316489b7d69b36aeb0edd3123538500b41.1684569865.git.christophe.jaillet@wanadoo.fr commit dd9e329af7236e34c566d3705ea32a63069b9b13 Author: Frieder Schrempf Date: Wed May 3 18:33:07 2023 +0200 drm/bridge: ti-sn65dsi83: Fix enable/disable flow to meet spec The datasheet describes the following initialization flow including minimum delay times between each step: 1. DSI data lanes need to be in LP-11 and the clock lane in HS mode 2. toggle EN signal 3. initialize registers 4. enable PLL 5. soft reset 6. enable DSI stream 7. check error status register To meet this requirement we need to make sure the host bridge's pre_enable() is called first by using the pre_enable_prev_first flag. Furthermore we need to split enable() into pre_enable() which covers steps 2-5 from above and enable() which covers step 7 and is called after the host bridge's enable(). Signed-off-by: Frieder Schrempf Fixes: ceb515ba29ba ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver") Tested-by: Alexander Stein #TQMa8MxML/MBa8Mx Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230503163313.2640898-3-frieder@fris.de commit 0c14d3130654fe459fca3067d2d4317fc607bc71 Author: Frieder Schrempf Date: Wed May 3 18:33:06 2023 +0200 drm: bridge: samsung-dsim: Fix i.MX8M enable flow to meet spec According to the documentation [1] the proper enable flow is: 1. Enable DSI link and keep data lanes in LP-11 (stop state) 2. Disable stop state to bring data lanes into HS mode Currently we do this all at once within enable(), which doesn't allow to meet the requirements of some downstream bridges. To fix this we now enable the DSI in pre_enable() and force it into stop state using the FORCE_STOP_STATE bit in the ESCMODE register until enable() is called where we reset the bit. We currently do this only for i.MX8M as Exynos uses a different init flow where samsung_dsim_init() is called from samsung_dsim_host_transfer(). [1] https://docs.kernel.org/gpu/drm-kms-helpers.html#mipi-dsi-bridge-operation Signed-off-by: Frieder Schrempf Reviewed-by: Neil Armstrong Tested-by: Alexander Stein #TQMa8MxML/MBa8Mx Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230503163313.2640898-2-frieder@fris.de commit abd686b8c38a094631884aa7b8cb04cc32b6608a Author: Alexander Stein Date: Tue May 16 09:19:49 2023 +0200 drm/bridge: tc358767: explicitly set readable registers This map was created from register map from datasheet (section 5.1.2). Unused registers are stated by address, so they show up in debugfs as well. Signed-off-by: Alexander Stein Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230516071949.375264-1-alexander.stein@ew.tq-group.com commit 6b92e4351a29af52c285fe235e6e4d1a75de04b2 Author: Christophe JAILLET Date: Sat May 20 09:53:14 2023 +0200 wifi: atmel: Fix an error handling path in atmel_probe() Should atmel_config() fail, some resources need to be released as already done in the remove function. While at it, remove a useless and erroneous comment. The probe is atmel_probe(), not atmel_attach(). Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions") Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1e65f174607a83348034197fa7d603bab10ba4a9.1684569156.git.christophe.jaillet@wanadoo.fr commit 67a81d911c01225f426cc6bee2373df044c1a9b7 Author: Christophe JAILLET Date: Sat May 20 09:38:22 2023 +0200 wifi: orinoco: Fix an error handling path in orinoco_cs_probe() Should orinoco_cs_config() fail, some resources need to be released as already done in the remove function. While at it, remove a useless and erroneous comment. The probe is orinoco_cs_probe(), not orinoco_cs_attach(). Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions") Signed-off-by: Christophe JAILLET Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/e24735ce4d82901d5f7ea08419eea53bfdde3d65.1684568286.git.christophe.jaillet@wanadoo.fr commit 925244325159824385209e3e0e3f91fa6bf0646c Author: Christophe JAILLET Date: Sat May 20 09:29:46 2023 +0200 wifi: orinoco: Fix an error handling path in spectrum_cs_probe() Should spectrum_cs_config() fail, some resources need to be released as already done in the remove function. While at it, remove a useless and erroneous comment. The probe is spectrum_cs_probe(), not spectrum_cs_attach(). Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions") Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/c0bc0c21c58ca477fc5521607615bafbf2aef8eb.1684567733.git.christophe.jaillet@wanadoo.fr commit 47e612268ea02f7d2bcbaa47528698b5be61a8cf Author: Arnd Bergmann Date: Tue May 23 13:32:35 2023 +0200 wifi: rtw89: use flexible array member in rtw89_btc_btf_tlv struct rtw89_btc_btf_tlv contains a one-byte member that is intended as a flexible array: In function 'fortify_memcpy_chk', inlined from '_append_tdma' at drivers/net/wireless/realtek/rtw89/coex.c:1579:3: include/linux/fortify-string.h:583:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 583 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Make this actually use a flexible array to let the compiler understand. Signed-off-by: Arnd Bergmann Reviewed-by: Ping-Ke Shih Reviewed-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230523113241.2772811-1-arnd@kernel.org commit 56fc4d482783f5e45a6a2b3ec0d9f557908cdf77 Author: Colin Ian King Date: Mon May 22 09:59:24 2023 +0100 wifi: rtw89: 8851b: rfk: Fix spelling mistake KIP_RESOTRE -> KIP_RESTORE There is a spelling mistake in a literal string. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230522085924.913649-1-colin.i.king@gmail.com commit 68012b44dfc723a114748a5e67f98a99b2943852 Author: Ping-Ke Shih Date: Mon May 22 20:25:13 2023 +0800 wifi: rtw89: use struct to access register-based H2C/C2H The register-based H2C/C2H are used to exchange commands and events with firmware. The exchange data is limited, but it is relatively simple, because it can work before HCI initialization. To make these code clean, use struct to access them. This patch doesn't change logic at all. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230522122513.13559-6-pkshih@realtek.com commit c26700d2df01d084ee904ca872fd4db67e772c6f Author: Ping-Ke Shih Date: Mon May 22 20:25:12 2023 +0800 wifi: rtw89: use struct and le32_get_bits() to access RX descriptor RX descriptor is to provide basic and important information related to packets, such as packet size, security, MAC ID and so on. Change to use struct to access these fields, and not change logic at all. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230522122513.13559-5-pkshih@realtek.com commit 332debb80488e98f6083238bdf61e6f953d5c180 Author: Ping-Ke Shih Date: Mon May 22 20:25:11 2023 +0800 wifi: rtw89: use struct and le32_get_bits() to access received PHY status IEs PHY status IEs generated by BB hardware is to provide more detail information related to received packets, such as RSSI and bandwidth. To avoid type casting, change buf type from u8* to void* as well. This patch doesn't change logic at all. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230522122513.13559-4-pkshih@realtek.com commit 88bdc3ff956cd9267777ae8557de46bbf2d49e32 Author: Ping-Ke Shih Date: Mon May 22 20:25:10 2023 +0800 wifi: rtw89: use struct and le32_get_bits to access RX info If received packet type is PPDU status, RX info provides information attached by MAC hardware, and mention how long BB information attached. This conversion patch doesn't change logic at all. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230522122513.13559-3-pkshih@realtek.com commit de9f93385d0f318b3eba0c1026fd2ec8fba2e982 Author: Ping-Ke Shih Date: Mon May 22 20:25:09 2023 +0800 wifi: rtw89: add chip_ops::query_rxdesc() and rxd_len as helpers to support newer chips The next generation chips use different RX descriptor format, so add a chip_ops to hook suitable handlers. Also, the length of RX descriptor is different, so add a variable to store the length according to chip and descriptor content dynamically. Then, the code can be more general. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230522122513.13559-2-pkshih@realtek.com commit 14820388aafb10cd051b0883e92326f5f2012ed4 Author: Ping-Ke Shih Date: Fri May 19 11:15:00 2023 +0800 wifi: rtw89: 8851b: add 8851be to Makefile and Kconfig Since 8851BE is ready, so add 8851BE to Makefile and Kconfig. Currently, it can support STA, AP and monitor modes with good performance. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230519031500.21087-8-pkshih@realtek.com commit c4ff50149885723f24ef9bc3b0220ee20bca3e03 Author: Chin-Yen Lee Date: Fri May 19 11:14:59 2023 +0800 wifi: rtw89: add tx_wake notify for 8851B 8851B has the same issue: management frames get stuck when WiFi chip enters low PS mode, so we also add notify wake function to trigger WiFi chip wake before forwarding management frames. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230519031500.21087-7-pkshih@realtek.com commit 4cfad52a5df718a615f8de5ba14370d99537db4c Author: Ping-Ke Shih Date: Fri May 19 11:14:58 2023 +0800 wifi: rtw89: enlarge supported length of read_reg debugfs entry The register ranges of upcoming chips are different from current, and even existing chips have different ranges, so support longer length to dump registers. Then, user space can decide the ranges according to chip. Since arbitrary length (e.g. 7) would be a little complicated, so simply make length a multiple of 16. The output looks like 18620000h : 8580801f 82828282 82828282 080800fd Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230519031500.21087-6-pkshih@realtek.com commit 791af3fb2decc11b2994f7020378dffecd654fcd Author: Ping-Ke Shih Date: Fri May 19 11:14:57 2023 +0800 wifi: rtw89: 8851b: add RF configurations RF configurations include RF calibrations and getting thermal value. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230519031500.21087-5-pkshih@realtek.com commit 92aa2643235d72bb01206259362d4e0a845ba02a Author: Ping-Ke Shih Date: Fri May 19 11:14:56 2023 +0800 wifi: rtw89: 8851b: add MAC configurations to chip_info These configurations include path control, TX grant, TX scheduler, register-based H2C/C2H and so on. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230519031500.21087-4-pkshih@realtek.com commit 68a2cb6b0669bf96bbb203cbb81e57ad122ded42 Author: Ping-Ke Shih Date: Fri May 19 11:14:55 2023 +0800 wifi: rtw89: 8851b: fill BB related capabilities to chip_info These capabilities include helpers of BT coexistence, RX PPDU status parser, DIG (dynamic initial gain) and CFO (center frequency offset) settings. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230519031500.21087-3-pkshih@realtek.com commit 76f2516f79373e17974ce03c52eba4cfea8483e9 Author: Ping-Ke Shih Date: Fri May 19 11:14:54 2023 +0800 wifi: rtw89: 8851b: add TX power related functions Get TX power value from tables according to selected country and channel, and set proper power to registers. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230519031500.21087-2-pkshih@realtek.com commit 8b21c08ef7df41aa615439beac323a7b3b1df0e6 Author: Zong-Zhe Yang Date: Tue May 16 16:24:41 2023 +0800 wifi: rtw89: refine packet offload handling under SER H2C of packet offload needs to wait FW ACK by C2H. But, it's possible that packet offload happens during SER (system error recovery), e.g. SER L2 which restarts HW. More, packet offload flow isn't deferrable. So, the H2C wait may get `ret == 1` (unreachable). However, the logic FW deals with packet offload is simple enough, just clone content. It means that as long as the H2C is issued successfully, the thing will succeed sooner or later. Therefore, after we add a debug log when receiving ACK to packet offload, it would be acceptable that during SER, packet offload don't really wait for ACK. And, if debugging, we can still check its debug logs. Besides, we can expect that if we see SER before receiving ACK to packet offload, those debug logs of the ACK have a time difference. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230516082441.11154-4-pkshih@realtek.com commit b79a84fbbdb0a715b130ab470c241db211539dfb Author: Zong-Zhe Yang Date: Tue May 16 16:24:40 2023 +0800 wifi: rtw89: tweak H2C TX waiting function for SER Some specific H2C (host to chip command) needs waiting until FW ACK by C2H (chip to host event). However, during SER (system error recovery), most interrupts are disabled, so we can't receive C2H immediately. It causes this kind of H2C TX waits will always time out during SER. To save time spent by SER, we don't do these redundant waits. And, to make a difference from -ETIMEDOUT in other cases, we make the function return 1 for SER case. When some H2C callers really catch `ret == 1` at runtime, they can determine whether it's reasonable or not, and consider how to resolve their flow if needed. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230516082441.11154-3-pkshih@realtek.com commit cda66049bab5273c61f09a4ea8c09d1de4d64fc0 Author: Zong-Zhe Yang Date: Tue May 16 16:24:39 2023 +0800 wifi: rtw89: ser: reset total_sta_assoc and tdls_peer when L2 The total_sta_assoc and the tdls_peer are used for statistics accodring to stations' information. L2 (Level 2) SER (system error recovery) will call ieee80211_restart_hw() which re-invokes sta_state ops. And then, the total_sta_assoc and tdls_peer will be re-increased. In case wrong statistics results, we reset them in SER L2 handling. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230516082441.11154-2-pkshih@realtek.com commit a3b125ceb45e1acd21c9bcb6d3a5c52897d536e6 Author: Martin Blumenstingl Date: Mon May 22 22:24:25 2023 +0200 wifi: rtw88: Add support for the SDIO based RTL8723DS chipset Wire up RTL8723DS chipset support using the rtw88 SDIO HCI code as well as the existing RTL8723D chipset code. Reviewed-by: Ping-Ke Shih Signed-off-by: Martin Blumenstingl Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230522202425.1827005-5-martin.blumenstingl@googlemail.com commit 09fcdbd28404b7e02cc9fc4862ae5b43b76867c0 Author: Martin Blumenstingl Date: Mon May 22 22:24:24 2023 +0200 mmc: sdio: Add/rename SDIO ID of the RTL8723DS SDIO wifi cards RTL8723DS comes in two variant and each of them has their own SDIO ID: - 0xd723 can connect two antennas. The WiFi part is still 1x1 so the second antenna can be dedicated to Bluetooth - 0xd724 can only connect one antenna so it's shared between WiFi and Bluetooth Add a new entry for the single antenna RTL8723DS (0xd724) which can be found on the MangoPi MQ-Quad. Also rename the existing RTL8723DS entry (0xd723) so it's name reflects that it's the variant with support for two antennas. Reviewed-by: Ping-Ke Shih Signed-off-by: Martin Blumenstingl Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230522202425.1827005-4-martin.blumenstingl@googlemail.com commit 9be20a82232779c59979527dfc8febca3182fee2 Author: Martin Blumenstingl Date: Mon May 22 22:24:23 2023 +0200 wifi: rtw88: rtw8723d: Implement RTL8723DS (SDIO) efuse parsing The efuse of the SDIO RTL8723DS chip has only one known member: the mac address is at offset 0x11a. Add a struct rtw8723ds_efuse describing this and use it for copying the mac address when the SDIO bus is used. Reviewed-by: Ping-Ke Shih Signed-off-by: Martin Blumenstingl Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230522202425.1827005-3-martin.blumenstingl@googlemail.com commit e967229ead0e6c5047a1cfd5a0db58ceb930800b Author: Martin Blumenstingl Date: Mon May 22 22:24:22 2023 +0200 wifi: rtw88: sdio: Check the HISR RX_REQUEST bit in rtw_sdio_rx_isr() rtw_sdio_rx_isr() is responsible for receiving data from the wifi chip and is called from the SDIO interrupt handler when the interrupt status register (HISR) has the RX_REQUEST bit set. After the first batch of data has been processed by the driver the wifi chip may have more data ready to be read, which is managed by a loop in rtw_sdio_rx_isr(). It turns out that there are cases where the RX buffer length (from the REG_SDIO_RX0_REQ_LEN register) does not match the data we receive. The following two cases were observed with a RTL8723DS card: - RX length is smaller than the total packet length including overhead and actual data bytes (whose length is part of the buffer we read from the wifi chip and is stored in rtw_rx_pkt_stat.pkt_len). This can result in errors like: skbuff: skb_over_panic: text:ffff8000011924ac len:3341 put:3341 (one case observed was: RX buffer length = 1536 bytes but rtw_rx_pkt_stat.pkt_len = 1546 bytes, this is not valid as it means we need to read beyond the end of the buffer) - RX length looks valid but rtw_rx_pkt_stat.pkt_len is zero Check if the RX_REQUEST is set in the HISR register for each iteration inside rtw_sdio_rx_isr(). This mimics what the RTL8723DS vendor driver does and makes the driver only read more data if the RX_REQUEST bit is set (which seems to be a way for the card's hardware or firmware to tell the host that data is ready to be processed). For RTW_WCPU_11AC chips this check is not needed. The RTL8822BS vendor driver for example states that this check is unnecessary (but still uses it) and the RTL8822CS drops this check entirely. Reviewed-by: Ping-Ke Shih Signed-off-by: Martin Blumenstingl Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230522202425.1827005-2-martin.blumenstingl@googlemail.com commit 040a22191879ad77fd904b3aaf10d3aa16adb068 Author: Niklas Schnelle Date: Mon May 22 12:50:48 2023 +0200 wifi: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Acked-by: Kalle Valo Signed-off-by: Niklas Schnelle Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230522105049.1467313-44-schnelle@linux.ibm.com commit 211ceca377f40ff46aef8ceb6e26cf4e7efecaf1 Author: Ard Biesheuvel Date: Tue Apr 18 16:36:04 2023 +0200 arm64: entry: Simplify tramp_alias macro and tramp_exit routine The tramp_alias macro constructs the virtual alias of a symbol in the trampoline text mapping, based on its kernel text address, and does so in a way that is more convoluted than necessary. So let's simplify that. Also, now that the address of the vector table is kept in a per-CPU variable, there is no need to defer the load and the assignment of VBAR_EL1 to tramp_exit(). This means we can use a PC-relative reference to the per-CPU variable instead of storing its absolute address in a global variable in the trampoline rodata. And given that tramp_alias no longer needs a temp register, this means we can restore X30 earlier as well, and only leave X29 for tramp_exit() to restore. While at it, give some related symbols static linkage, considering that they are only referenced from the object file that defines them. Signed-off-by: Ard Biesheuvel Reviewed-by: Will Deacon Link: https://lore.kernel.org/r/20230418143604.1176437-3-ardb@kernel.org Signed-off-by: Catalin Marinas commit 0936243cabf0caf46f1a42606325ab93cfa05a6a Author: Ard Biesheuvel Date: Tue Apr 18 16:36:03 2023 +0200 arm64: entry: Preserve/restore X29 even for compat tasks Currently, the KPTI trampoline code for returning to user space takes care to only preserve X29 into FAR_EL1 for native tasks, as compat tasks don't have access to this register anyway, and so preserving it is not necessary. It also means it does not need to be restored, and so we have two code paths for returning back to user space: the native one that restores X29 from FAR_EL1, and the compat one that leaves X29 clobbered, containing the value of TTBR1_EL1, which carries a physical address pointing somewhere into the kernel image. This is needlessly complex, and given that FAR_EL1 becomes UNKNOWN after an exception return anway, the only benefit of avoiding the preserve and restore is that we can skip the system register write and read. So let's simplify this, and collapse the two code paths into one that always preserves X29 into FAR_EL1, and always restores it again after the TTBR switch. Signed-off-by: Ard Biesheuvel Reviewed-by: Will Deacon Link: https://lore.kernel.org/r/20230418143604.1176437-2-ardb@kernel.org Signed-off-by: Catalin Marinas commit f026be0e1e881e3395c3d5418ffc8c2a2203c3f3 Author: Pavel Begunkov Date: Mon May 15 13:54:43 2023 +0100 nvme: optimise io_uring passthrough completion Use IOU_F_TWQ_LAZY_WAKE via iou_cmd_exec_in_task_lazy() for passthrough commands completion. It further delays the execution of task_work for DEFER_TASKRUN until there are enough of task_work items queued to meet the waiting criteria, which reduces the number of wake ups we issue. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ecdfacd0967a22d88b7779e2efd09e040825d0f8.1684154817.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 5f3139fc46993b2d653a7aa5cdfe66a91881fd06 Author: Pavel Begunkov Date: Mon May 15 13:54:42 2023 +0100 io_uring/cmd: add cmd lazy tw wake helper We want to use IOU_F_TWQ_LAZY_WAKE in commands. First, introduce a new cmd tw helper accepting TWQ flags, and then add io_uring_cmd_do_in_task_laz() that will pass IOU_F_TWQ_LAZY_WAKE and imply the "lazy" semantics, i.e. it posts no more than 1 CQE and delaying execution of this tw should not prevent forward progress. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/5b9f6716006df7e817f18bd555aee2f8f9c8b0c3.1684154817.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit c7853b55116e644e1fd4f0e5d8ea7c5dc89d71b8 Author: David Gow Date: Thu May 25 12:21:31 2023 +0800 Documentation: kunit: Add usage notes for kunit_add_action() Add some basic documentation for kunit_add_action() and related deferred action functions. Reviewed-by: Rae Moar Signed-off-by: David Gow Signed-off-by: Shuah Khan commit 57e3cded99e9c840bc5310878d0a7f4e7768a296 Author: David Gow Date: Thu May 25 12:21:30 2023 +0800 kunit: kmalloc_array: Use kunit_add_action() The kunit_add_action() function is much simpler and cleaner to use that the full KUnit resource API for simple things like the kunit_kmalloc_array() functionality. Replacing it allows us to get rid of a number of helper functions, and leaves us with no uses of kunit_alloc_resource(), which has some usability problems and is going to have its behaviour modified in an upcoming patch. Note that we need to use kunit_defer_trigger_all() to implement kunit_kfree(). Reviewed-by: Benjamin Berg Reviewed-by: Maxime Ripard Tested-by: Maxime Ripard Signed-off-by: David Gow Signed-off-by: Shuah Khan commit 00e63f8afcfc6bf93d75141c51d35e8a40e86363 Author: David Gow Date: Thu May 25 12:21:29 2023 +0800 kunit: executor_test: Use kunit_add_action() Now we have the kunit_add_action() function, we can use it to implement kfree_at_end() and free_subsuite_at_end() without the need for extra helper functions. Reviewed-by: Benjamin Berg Reviewed-by: Maxime Ripard Tested-by: Maxime Ripard Signed-off-by: David Gow Signed-off-by: Shuah Khan commit b9dce8a1ed3efe0f5c0957f4605140f204226a0f Author: David Gow Date: Thu May 25 12:21:28 2023 +0800 kunit: Add kunit_add_action() to defer a call until test exit Many uses of the KUnit resource system are intended to simply defer calling a function until the test exits (be it due to success or failure). The existing kunit_alloc_resource() function is often used for this, but was awkward to use (requiring passing NULL init functions, etc), and returned a resource without incrementing its reference count, which -- while okay for this use-case -- could cause problems in others. Instead, introduce a simple kunit_add_action() API: a simple function (returning nothing, accepting a single void* argument) can be scheduled to be called when the test exits. Deferred actions are called in the opposite order to that which they were registered. This mimics the devres API, devm_add_action(), and also provides kunit_remove_action(), to cancel a deferred action, and kunit_release_action() to trigger one early. This is implemented as a resource under the hood, so the ordering between resource cleanup and deferred functions is maintained. Reviewed-by: Benjamin Berg Reviewed-by: Maxime Ripard Tested-by: Maxime Ripard Signed-off-by: David Gow Signed-off-by: Shuah Khan commit f1134f738fad68c51a44216ab0f68a0f086a1a5e Author: Bryan O'Donoghue Date: Fri Apr 7 20:49:05 2023 +0100 arm64: dts: qcom: Add msm8939 Sony Xperia M4 Aqua Add a basic booting DTS for the Sony Xperia M4 Aqua aka "tulip". Tulip is paired with: - wcn3660 - smb1360 battery charger - 720p Truly NT35521 Panel Reviewed-by: Konrad Dybcio Signed-off-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230407194905.611461-6-bryan.odonoghue@linaro.org commit 273a3dc13eb746c7b7abe7ea682811a8dacc89d6 Author: Bryan O'Donoghue Date: Fri Apr 7 20:49:04 2023 +0100 arm64: dts: qcom: Add Square apq8039-t2 board The apq8039-t2 is an apq8039 based board paired with a wcn3680b WiFi chipset. Co-developed-by: Shawn Guo Signed-off-by: Shawn Guo Co-developed-by: Jun Nie Signed-off-by: Jun Nie Co-developed-by: Benjamin Li Signed-off-by: Benjamin Li Co-developed-by: James Willcox Signed-off-by: James Willcox Co-developed-by: Leo Yan Signed-off-by: Leo Yan Co-developed-by: Joseph Gates Signed-off-by: Joseph Gates Co-developed-by: Max Chen Signed-off-by: Max Chen Co-developed-by: Zac Crosby Signed-off-by: Zac Crosby Reviewed-by: Konrad Dybcio Signed-off-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230407194905.611461-5-bryan.odonoghue@linaro.org commit 1e6dfe47ba020a192d743c7c820b469fd7253813 Author: Stephan Gerhold Date: Fri Apr 7 20:49:03 2023 +0100 arm64: dts: qcom: Add msm8939-pm8916.dtsi include The msm8939-pm8916.dtsi include configures the regulator supplies of MSM8939 used together with PM8916, as recommended by Qualcomm. In rare cases where boards deviate from the recommended design they can just avoid using this include. Signed-off-by: Stephan Gerhold Reviewed-by: Konrad Dybcio Signed-off-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230407194905.611461-4-bryan.odonoghue@linaro.org commit 61550c6c156c3715baf54ab2cdd678c8c35b3803 Author: Bryan O'Donoghue Date: Fri Apr 7 20:49:02 2023 +0100 arm64: dts: qcom: Add msm8939 SoC Add msm8939 a derivative SoC of msm8916. This SoC contains a number of key differences to msm8916. - big.LITTLE Octa Core - quad 1.5GHz + quad 1.0GHz - DRAM 1x800 LPDDR3 - Camera 4+4 lane CSI - Venus @ 1080p60 HEVC - DSI x 2 - Adreno A405 - WiFi wcn3660/wcn3680b 802.11ac Co-developed-by: Shawn Guo Signed-off-by: Shawn Guo Co-developed-by: Jun Nie Signed-off-by: Jun Nie Co-developed-by: Benjamin Li Signed-off-by: Benjamin Li Co-developed-by: James Willcox Signed-off-by: James Willcox Co-developed-by: Leo Yan Signed-off-by: Leo Yan Co-developed-by: Joseph Gates Signed-off-by: Joseph Gates Co-developed-by: Max Chen Signed-off-by: Max Chen Co-developed-by: Zac Crosby Signed-off-by: Zac Crosby Co-developed-by: Vincent Knecht Signed-off-by: Vincent Knecht Co-developed-by: Stephan Gerhold Signed-off-by: Stephan Gerhold Reviewed-by: Konrad Dybcio Signed-off-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230407194905.611461-3-bryan.odonoghue@linaro.org commit 8051c8b83ac076ab7f4fc80cff5e7f8cc3b1eefb Author: Bryan O'Donoghue Date: Fri Apr 7 20:49:01 2023 +0100 dt-bindings: vendor-prefixes: Add Square Add vendor prefix for Square (https://squareup.com). Acked-by: Krzysztof Kozlowski Signed-off-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230407194905.611461-2-bryan.odonoghue@linaro.org commit 11aaa0ec9c1848bb68df9c7e6eedab6d5b0a3cca Author: Alain Volmat Date: Sat Feb 4 21:29:40 2023 +0100 media: sti: c8sectpfe: drop of_match_ptr() to avoid unused variables When CONFIG_OF is not set, "of_match_ptr()" compiles to NULL, which leaves unused, leading to warning such as: drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c:1175:34: warning: unused variable 'c8sectpfe_match' [-Wunused-const-variable] Drop the of_match_ptr usage to avoid such warning. Reported-by: kernel test robot Signed-off-by: Alain Volmat Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 7d4be90b3deb6b32fb99644a158e6cff0a0520f4 Author: Dmitry Torokhov Date: Fri Feb 3 15:13:48 2023 -0800 media: c8sectpfe: switch to using gpiod API This switches the driver from using legacy gpio API and to the newer gpiod API. Since ordinary gpiod APIs operate on logical and not electrical levels, handling of the reset GPIO is adjusted accordingly. Signed-off-by: Dmitry Torokhov Reviewed-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit a650b821fa57989deab9f7274a33af6ffab28e7e Author: Niklas Söderlund Date: Sat Feb 11 15:55:19 2023 +0100 media: rcar-vin: Add support for R-Car V4H Add support for R-Car V4H. The V4H uses the ISP Channel Selector as its only possible video input source. Even tho V4H is a Gen3 board the VIN interface is very close to the one found on the V3U, for this reason mark it as a Gen3 model internally. Signed-off-by: Niklas Söderlund Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 8e85c1ad3d49f5a51947d74b66b7b6a255fd370c Author: Niklas Söderlund Date: Sat Feb 11 15:54:36 2023 +0100 media: rcar-isp: Add support for R-Car V4H Add support for R-Car V4H. The ISP Channel Selector is used to route channels to the different VIN modules. The ISP CS found in the V4H is very similar to the one found on the V3U. Signed-off-by: Niklas Söderlund Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 6311a0d0220f18c436391b75a5c217f9d27b9b49 Author: Niklas Söderlund Date: Sat Feb 11 15:46:14 2023 +0100 media: staging: max96712: Add support for 3-lane C-PHY Add basic support for outputting the test patterns on a 3-lane CSI-2 C-PHY bus. As the driver only can output frames form its internal test pattern generator, enabling C-PHY output is as simple as setting the output mode to C-PHY instead of D-PHY. Signed-off-by: Niklas Söderlund [Sakari Ailus: Wrap long lines.] Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 9f43234ef07c5d1978b02e5996927c110666d96e Author: Laurent Pinchart Date: Wed Apr 19 09:07:12 2023 +0200 media: imx: imx7-media-csi: Init default format with __imx7_csi_video_try_fmt() Use the __imx7_csi_video_try_fmt() helper function to initialize the default format at probe time. This improves consistency by using the same code path for both default initialization and validation at runtime, and allows dropping the now unused imx7_csi_find_pixel_format() function. Signed-off-by: Laurent Pinchart Signed-off-by: Alexander Stein Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit bef1bb620ca6932950dc7897412acb09de525c33 Author: Alexander Stein Date: Wed Apr 19 09:07:11 2023 +0200 media: imx: imx7-media-csi: Relax width constraints for non-8bpp formats The driver unconditionally aligns the image width to multiples of 8 pixels. The real alignment constraint is 8 bytes, as indicated by the CSI_IMAG_PARA.IMAGE_WIDTH documentation that calls for 8 pixel alignment for 8bpp formats and 4 pixel alignment for other formats. Signed-off-by: Alexander Stein Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 79bb4c7df8af769615a1f049aa85cbe6ecc84ec6 Author: Alexander Stein Date: Wed Apr 19 09:07:10 2023 +0200 media: imx: imx7-media-csi: Remove incorrect interlacing support The driver doesn't currently support interlacing, but due to legacy leftovers, it accepts values for the pixel format "field" field other than V4L2_FIELD_NONE. Fix it by hardcoding V4L2_FIELD_NONE. Proper interlacing support can be implemented later if desired. Signed-off-by: Alexander Stein Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 6f482c4729d9040945f6d1e7ca1171eba9b5a5d6 Author: Alexander Stein Date: Wed Apr 19 09:07:09 2023 +0200 media: imx: imx7-media-csi: Get rid of superfluous call to imx7_csi_mbus_fmt_to_pix_fmt There is no need to convert input pixformat to mbus_framefmt and back again. Instead apply pixformat width constrains directly. Assign compose values before adjusting pixformat height/width. Signed-off-by: Alexander Stein Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 04fc06f6dc1592ed5d675311ac50d8fba5db62ab Author: Martin Kepplinger Date: Tue Apr 25 11:47:47 2023 +0200 media: hi846: fix usage of pm_runtime_get_if_in_use() pm_runtime_get_if_in_use() does not only return nonzero values when the device is in use, it can return a negative errno too. And especially during resuming from system suspend, when runtime pm is not yet up again, -EAGAIN is being returned, so the subsequent pm_runtime_put() call results in a refcount underflow. Fix system-resume by handling -EAGAIN of pm_runtime_get_if_in_use(). Signed-off-by: Martin Kepplinger Fixes: e8c0882685f9 ("media: i2c: add driver for the SK Hynix Hi-846 8M pixel camera") Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit e103484c76ab0898e6cf5067b1e3d45019a4fe0b Author: Niklas Söderlund Date: Mon Apr 24 20:59:33 2023 +0200 media: rcar-csi2: Prepare for C-PHY support Gen4 will support both D-PHY and C-PHY, while Gen3 only supports D-PHY. Add two flags to the device information structure to be able to record what each SoC supports. Extend the device node parsing to accept both CSI_2 D-PHY and C-PHY buses, while at the same time taking the SoC support into account. Signed-off-by: Niklas Söderlund [Sakari Ailus: Line wrap.] Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit a73116db88299af2c2b2aa69d7df5ccf5a1c6f75 Author: Niklas Söderlund Date: Mon Apr 24 20:59:32 2023 +0200 media: rcar-csi2: Prepare for Gen4 support Prepare the driver for supporting R-Car Gen4. The starting of the receiver and how to enter standby differs between Gen3 and Gen4, create function pointers in the device info structure to control the different behavior. Signed-off-by: Niklas Söderlund Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 0827b58dabff5b2ba624e8c776573ddb18172c01 Author: Bingbu Cao Date: Sun Apr 23 16:06:55 2023 +0800 media: i2c: add ov01a10 image sensor driver Add v4l2 device driver for OmniVision ov01a10 image sensor, ov01a10 image sensor can deliver 1280x800 resolution BGGR10 images at 60 fps. Signed-off-by: Yating Wang Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 59a95979638664a905cd46845e7cac1b3ff942f7 Author: Geert Uytterhoeven Date: Wed Apr 26 12:18:24 2023 +0200 media: renesas: fdp1: Identify R-Car Gen2 versions On R-Car M2-W: rcar_fdp1 fe940000.fdp1: FDP1 Unidentifiable (0x02010101) rcar_fdp1 fe944000.fdp1: FDP1 Unidentifiable (0x02010101) Although the IP Internal Data Register on R-Car Gen2 is documented to contain all zeros, the actual register contents seem to match the FDP1 version ID of R-Car H3 ES1.*, which has just been removed. Fortunately this version is not used for any other purposes yet. Fix this by re-adding the ID, now using an R-Car Gen2-specific name. Fixes: af4273b43f2b ("media: renesas: fdp1: remove R-Car H3 ES1.* handling") Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 6c01e6f3f27b7baee6264e490eb608939fec9bbf Author: Daniel Scally Date: Tue May 2 11:35:47 2023 +0100 media: st-mipid02: Propagate format from sink to source pad When setting formats on the sink pad, propagate the adjusted format over to the subdev's source pad. Use the MIPID02_SOURCE macro to fetch the pad's try format rather than relying on the pad field of the format to facilitate this - the function is specific to the source pad anyway. Signed-off-by: Daniel Scally [Sakari Ailus: Line wrap, fix subject] Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 306c3190b30d4d6a098888b9d7d4cefaa0ddcb91 Author: Daniel Scally Date: Tue May 2 11:35:46 2023 +0100 media: i2c: Correct format propagation for st-mipid02 Format propagation in the st-mipid02 driver is incorrect in that when setting format for V4L2_SUBDEV_FORMAT_TRY on the source pad, the _active_ rather than _try_ format from the sink pad is propagated. This causes problems with format negotiation - update the function to propagate the correct format. Fixes: 642bb5e88fed ("media: st-mipid02: MIPID02 CSI-2 to PARALLEL bridge driver") Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit ad5929547b545f6335f7a65cd5dd978967a02be3 Author: Alexander Stein Date: Tue May 2 16:15:43 2023 +0200 media: video-mux: Add missing media_entity_cleanup upon async register fail Although media_entity_pads_init has been called, a call to media_entity_cleanup in the cleanup code was missing. Signed-off-by: Alexander Stein Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit cd78824dd989ad733b650f42e078095ff231a215 Author: Krzysztof Kozlowski Date: Thu May 11 19:54:41 2023 +0200 media: i2c: video: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Reviewed-by: Matt Ranostay Acked-by: Sakari Ailus Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit eeaa47d182fedfe68b8fd40ef3798761c8904791 Author: Jacopo Mondi Date: Fri May 5 09:16:19 2023 +0200 media: ov5640: Drop dead code using frame_interval The ov5640_update_pixel_rate() function handles the parallel and MIPI CSI-2 cases separately. When running on a parallel setup the V4L2_CID_PIXEL_RATE value is calculated at the beginning of the function using the values configured with the frame_interval operations, and then the function immediately returns. The remaining of the function handles the MIPI CSI-2 configuration and should not use the 'current_fr' and 'def_fps' fields as those are only relevant for parallel mode. Drop a small section of dead code that updates vblank using frame_interval on a MIPI CSI-2 setup. Signed-off-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 25affde33b234b214b3e8f49a703b78a4b3bf8ca Author: Jacopo Mondi Date: Fri May 5 09:16:18 2023 +0200 media: ov5640: Remove unused 'framerate' parameter The 'current framerate' parameter passed to ov5640_try_fmt_internal() is unsued. Drop it. Signed-off-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit afe25fbc5d078556986fcd1df9dc9140adffff26 Author: Guoniu.zhou Date: Tue May 9 14:56:45 2023 +0800 media: ov5640: correct comments for default VGA to avoid confusion When OV5640 work at DVP mode, the default initialization settings make it output 30 frames per second. But when it work at CSI-2 mode the default link frequency will make it output 60 frames per second, so correct the comments to make it more clear. Signed-off-by: Guoniu.zhou Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 290cebd13a6e111c4e998c9b712ec20e9a3e9e17 Author: Niklas Söderlund Date: Tue May 9 21:00:31 2023 +0200 dt-bindings: i2c: maxim,max96712: Require setting bus-type property The MAX96712 can support both a CSI-2 C-PHY and D-PHY bus. The initial staging driver however only supported D-PHY and the bus-type property was left optional. In preparation for adding C-PHY support to the staging driver make the bus-type property mandatory as it is needed to select the correct PHY mode. Without the bus-type property present, the driver falls-back to D-PHY mode, so the change is functionally backward compatible with old DTS files lacking the property. The only in-tree DTS file (renesas/r8a779a0-falcon-csi-dsi.dtsi) that lacked the property uses D-PHY and have been updated. Signed-off-by: Niklas Söderlund Reviewed-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit e3269ea5148d39119c4a603b4391e0adbe32af37 Author: Shravan Chippa Date: Fri Apr 14 18:03:11 2023 +0530 media: i2c: imx334: update pixel, hblank and link frequency Update pixel_rate and link frequency for 1920x1080@30 while changing mode. Update vblank value while changing mode Add support to handle multiple link frequencies. Add dummy ctrl cases for pixel_rate and link frequency to avoid error while changing the modes dynamically. Update default link frequency from device tree max link frequency value. Update init_cfg() function to update the link frequency menu_skip_mask value. Suggested-by: Sakari Ailus Signed-off-by: Shravan Chippa [Sakari Ailus: Document menu_skip_mask, remove extra blank line.] Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 25857a007d521acee63012876ba00d94112c2ba3 Author: Sakari Ailus Date: Mon Apr 17 12:29:59 2023 +0300 media: ipu3-cio2: Fix container_of() macro wrapper arguments The argument of the to_sensor_asd() is called the same as the field name for the container_of() macro, so it only works if the argument name is "asd". Fix it. Also switch to container_of_const(). Reviewed-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 950e9a295b984b011bcbfb90af167e4e20a077f3 Author: Sakari Ailus Date: Mon Apr 24 15:22:37 2023 +0300 media: uapi: Fix [GS]_ROUTING ACTIVE flag value The value of the V4L2_SUBDEV_ROUTE_FL_ACTIVE is 1, not 0. Use hexadecimal numbers as is done elsewhere in the documentation. Cc: stable@vger.kernel.org # for >= v6.3 Fixes: ea73eda50813 ("media: Documentation: Add GS_ROUTING documentation") Signed-off-by: Sakari Ailus Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil commit 8e4a559769795ae6fc6395231766bc223b36913b Author: Krzysztof Kozlowski Date: Thu Apr 20 09:24:42 2023 +0200 media: dt-bindings: qcom: camss: correct unit address Match unit-address to first reg entry. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Acked-by: Rob Herring Reviewed-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit 1e82d01b88eda8c4907e5901b9f5a7ff39970320 Author: Christophe JAILLET Date: Sat Apr 15 18:28:58 2023 +0200 media: ov5693: Simplify an error message dev_err_probe() already display the error code. There is no need to duplicate it explicitly in the error message. Signed-off-by: Christophe JAILLET Reviewed-by: Daniel Scally Signed-off-by: Hans Verkuil commit 98b9564243805810b7d412368e512bd7b1c3837e Author: Sakari Ailus Date: Mon Apr 24 12:52:12 2023 +0300 media: uapi: Use unsigned int values for assigning bits in u32 fields Use unsigned int values annoted by "U" for u32 fields. While this is a good practice, there doesn't appear to be a bug that this patch would fix. The patch has been generated using the following command: perl -i -pe 's/\([0-9]+\K < Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit e6a4702394383888961fc6cae7b99f387db03de4 Author: Sakari Ailus Date: Wed Apr 26 12:50:39 2023 +0300 media: Documentation: Rename meta format files Rename meta format files, using "metafmt" prefix instead of "pixfmt-meta". These are metadata formats, not pixel formats. Signed-off-by: Sakari Ailus Cc: Bingbu Cao Cc: Dafna Hirschfeld Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 4fd463e9389f9c5ea00a327b4ff01daf5869e774 Author: Sakari Ailus Date: Tue Apr 25 13:23:00 2023 +0300 media: mc: Make media_get_pad_index() use pad type flag Use the pad flag specifying the pad type instead of a boolean in preparation for internal source pads. Also make the loop variable unsigned. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 7ab9484332d9688df1ce4b87d3adfcb4ded9b903 Author: Sakari Ailus Date: Tue May 2 12:14:08 2023 +0300 media: pci: ipu3-cio2: Obtain remote pad from endpoint Use the endpoint fwnode to find out the remote pad, instead of using the first source pad found. Also improve error messages. Signed-off-by: Sakari Ailus Reviewed-by: Bingbu Cao Signed-off-by: Hans Verkuil commit ec178312b81448b30947b2cb66b849e4bf43d941 Author: Sakari Ailus Date: Fri May 5 16:27:49 2023 +0300 media: mc: Make media_entity_get_fwnode_pad() fwnode argument const fwnode_graph_parse_endpoint() fwnode argument is now const, therefore make media_entity_get_fwnode_pad() fwnode argument const as well. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 71511a24eeec900b1a7e81b5f141c95313624ade Author: Sakari Ailus Date: Tue Mar 28 15:54:59 2023 +0300 Documentation: v4l: Document rotation and orientation for sensor drivers Document how rotation and orientation should be taken into account in writing camera sensor drivers. Signed-off-by: Sakari Ailus Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil commit a73206f33bd1e7f9c7579a0555e2ad634455fddf Author: Jack Zhu Date: Wed Mar 15 11:00:40 2023 +0800 media: admin-guide: Update rkisp1.rst Update Rockchip ISP1 driver file path Signed-off-by: Jack Zhu Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 1b3565dbc6aa124f34674e3dcf6966f663817e05 Author: Dan Carpenter Date: Wed Feb 22 16:59:51 2023 +0300 media: i2c: imx296: fix error checking in imx296_read_temperature() The "& IMX296_TMDOUT_MASK" means that "tmdout" can't be negative so the error checking will not work. Fixes: cb33db2b6ccf ("media: i2c: IMX296 camera sensor driver") Signed-off-by: Dan Carpenter Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 2674486aac7d9c95ceb77daf7c30f862d4295c1c Author: Yunfei Dong Date: Wed May 24 16:07:39 2023 +0800 media: mediatek: vcodec: support stateless hevc decoder Add mediatek hevc decoder linux driver which use the stateless API in MT8195. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Tested-by: Nicolas Dufresne Tested-by: Nathan Hebert Signed-off-by: Hans Verkuil [hverkuil: add () around 'flag' in macro] commit ae440c5da33cdb90a109f2df2a0360c67b3fab7e Author: Benjamin Gaignard Date: Wed May 24 16:07:38 2023 +0800 media: uapi: HEVC: Add num_delta_pocs_of_ref_rps_idx field Some drivers firmwares parse by themselves slice header and need num_delta_pocs_of_ref_rps_idx value to parse slice header short_term_ref_pic_set(). Use one of the 4 reserved bytes to store this value without changing the v4l2_ctrl_hevc_decode_params structure size and padding. This value also exist in DXVA API. Signed-off-by: Benjamin Gaignard Signed-off-by: Yunfei Dong Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil [hverkuil: fix typo in num_delta_pocs_of_ref_rps_idx doc] commit aaeb31c00e61f6bdc2e4a3c2c491c5455ed3f7b5 Author: Uwe Kleine-König Date: Sun May 14 14:04:07 2023 +0200 media: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Hans Verkuil commit 72a6127e9305ccf517ca962533c90c75bac39a57 Author: Geert Uytterhoeven Date: Tue May 23 17:16:00 2023 +0200 media: Add common header file with JPEG marker definitions When compile-testing on mips/RB532 with W=1: arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition 13 | #define RST (1 << 15) | drivers/media/platform/mediatek/jpeg/mtk_jpeg_dec_parse.c:15: warning: "RST" redefined 15 | #define RST 0xd0 | drivers/media/platform/renesas/rcar_jpu.c:77: warning: "RST" redefined 77 | #define RST 0xd0 | "RST" is indeed a name too short to be conflict-free. Fix this by creating a common header file, containing definitions for all JPEG markers used, prefixed by "JPEG_MARKER_", based on the existing private definitions in the Samsung S5P JPEG driver, and convert all affected drivers. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304152346.hJOPxPRh-lkp@intel.com/ Link: https://lore.kernel.org/oe-kbuild-all/202304150059.bHUyuriy-lkp@intel.com/ Signed-off-by: Geert Uytterhoeven Acked-by: Andrzej Pietrasiewicz (s5p-jpeg) Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit e01c3ec7d60c3ede6f7a58ac6a8bb031f8c245f8 Author: Jiapeng Chong Date: Fri May 5 14:06:17 2023 +0800 media: nxp: remove unneeded semicolon No functional modification involved. ./drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c:226:2-3: Unneeded semicolon. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4868 Signed-off-by: Jiapeng Chong Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit ecdbab337da1c72a8bb9e2162a271943e3559a52 Author: Fei Shao Date: Mon May 15 14:16:10 2023 +0800 media: mediatek: vcodec: mtk_vcodec_dec_hw: Use devm_pm_runtime_enable() Convert pm_runtime_enable() to the managed version, and clean up error handling and unnecessary .remove() callback accordingly. Signed-off-by: Fei Shao Reviewed-by: Alexandre Mergnat Suggested-by: Chen-Yu Tsai Signed-off-by: Hans Verkuil commit bf950e1f3030ab310cdbc386e0ad3e531bc32de4 Author: Michael Tretter Date: Tue May 23 11:03:09 2023 +0200 media: rockchip: rga: use v4l2_m2m_buf_copy_metadata The v4l2_m2m_buf_copy_metadata function correctly copies the metadata of the buffer. Use that function instead of open-coding the metadata copy. Signed-off-by: Michael Tretter Signed-off-by: Hans Verkuil commit 6f489a966fbeb0da63d45c2c66a8957eab604bf6 Author: Duoming Zhou Date: Tue May 23 07:59:32 2023 +0800 media: usb: siano: Fix warning due to null work_func_t function pointer The previous commit ebad8e731c1c ("media: usb: siano: Fix use after free bugs caused by do_submit_urb") adds cancel_work_sync() in smsusb_stop_streaming(). But smsusb_stop_streaming() may be called, even if the work_struct surb->wq has not been initialized. As a result, the warning will occur. One of the processes that could lead to warning is shown below: smsusb_probe() smsusb_init_device() if (!dev->in_ep || !dev->out_ep || align < 0) { smsusb_term_device(intf); smsusb_stop_streaming() cancel_work_sync(&dev->surbs[i].wq); __cancel_work_timer() __flush_work() if (WARN_ON(!work->func)) // work->func is null The log reported by syzbot is shown below: WARNING: CPU: 0 PID: 897 at kernel/workqueue.c:3066 __flush_work+0x798/0xa80 kernel/workqueue.c:3063 Modules linked in: CPU: 0 PID: 897 Comm: kworker/0:2 Not tainted 6.2.0-rc1-syzkaller #0 RIP: 0010:__flush_work+0x798/0xa80 kernel/workqueue.c:3066 ... RSP: 0018:ffffc9000464ebf8 EFLAGS: 00010246 RAX: 1ffff11002dbb420 RBX: 0000000000000021 RCX: 1ffffffff204fa4e RDX: dffffc0000000000 RSI: 0000000000000001 RDI: ffff888016dda0e8 RBP: ffffc9000464ed98 R08: 0000000000000001 R09: ffffffff90253b2f R10: 0000000000000001 R11: 0000000000000000 R12: ffff888016dda0e8 R13: ffff888016dda0e8 R14: ffff888016dda100 R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffd4331efe8 CR3: 000000000b48e000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __cancel_work_timer+0x315/0x460 kernel/workqueue.c:3160 smsusb_stop_streaming drivers/media/usb/siano/smsusb.c:182 [inline] smsusb_term_device+0xda/0x2d0 drivers/media/usb/siano/smsusb.c:344 smsusb_init_device+0x400/0x9ce drivers/media/usb/siano/smsusb.c:419 smsusb_probe+0xbbd/0xc55 drivers/media/usb/siano/smsusb.c:567 ... This patch adds check before cancel_work_sync(). If surb->wq has not been initialized, the cancel_work_sync() will not be executed. Reported-by: syzbot+27b0b464864741b18b99@syzkaller.appspotmail.com Fixes: ebad8e731c1c ("media: usb: siano: Fix use after free bugs caused by do_submit_urb") Signed-off-by: Duoming Zhou Signed-off-by: Hans Verkuil commit da4ede4b7fd6aa341b69e3a9d2517b8df5e744fd Author: Randy Dunlap Date: Sat May 20 16:41:42 2023 -0700 media: mtk-jpeg: move data/code inside CONFIG_OF blocks Lots of data and functions here are not needed when CONFIG_OF is not set, so move them inside #ifdef CONFIG_OF blocks to prevent the warnings. ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1645:29: warning: ‘mtk_jpeg_clocks’ defined but not used [-Wunused-variable] 1645 | static struct clk_bulk_data mtk_jpeg_clocks[] = { ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1640:29: warning: ‘mt8173_jpeg_dec_clocks’ defined but not used [-Wunused-variable] 1640 | static struct clk_bulk_data mt8173_jpeg_dec_clocks[] = { ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1481:20: warning: ‘mtk_jpeg_dec_irq’ defined but not used [-Wunused-function] 1481 | static irqreturn_t mtk_jpeg_dec_irq(int irq, void *priv) ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1461:20: warning: ‘mtk_jpeg_enc_irq’ defined but not used [-Wunused-function] 1461 | static irqreturn_t mtk_jpeg_enc_irq(int irq, void *priv) ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1180:13: warning: ‘mtk_jpegdec_worker’ defined but not used [-Wunused-function] 1180 | static void mtk_jpegdec_worker(struct work_struct *work) ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:986:13: warning: ‘mtk_jpegenc_worker’ defined but not used [-Wunused-function] 986 | static void mtk_jpegenc_worker(struct work_struct *work) ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:79:28: warning: ‘mtk_jpeg_dec_formats’ defined but not used [-Wunused-variable] 79 | static struct mtk_jpeg_fmt mtk_jpeg_dec_formats[] = { ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:31:28: warning: ‘mtk_jpeg_enc_formats’ defined but not used [-Wunused-variable] 31 | static struct mtk_jpeg_fmt mtk_jpeg_enc_formats[] = { ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1222:20: warning: ‘mtk_jpeg_enc_done’ defined but not used [-Wunused-function] 1222 | static irqreturn_t mtk_jpeg_enc_done(struct mtk_jpeg_dev *jpeg) ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1072:12: warning: ‘mtk_jpegdec_set_hw_param’ defined but not used [-Wunused-function] 1072 | static int mtk_jpegdec_set_hw_param(struct mtk_jpeg_ctx *ctx, ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1060:12: warning: ‘mtk_jpegdec_put_hw’ defined but not used [-Wunused-function] 1060 | static int mtk_jpegdec_put_hw(struct mtk_jpeg_dev *jpeg, int hw_id) ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1038:12: warning: ‘mtk_jpegdec_get_hw’ defined but not used [-Wunused-function] 1038 | static int mtk_jpegdec_get_hw(struct mtk_jpeg_ctx *ctx) ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:977:12: warning: ‘mtk_jpegenc_put_hw’ defined but not used [-Wunused-function] 977 | static int mtk_jpegenc_put_hw(struct mtk_jpeg_dev *jpeg, int hw_id) ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:963:12: warning: ‘mtk_jpegenc_set_hw_param’ defined but not used [-Wunused-function] 963 | static int mtk_jpegenc_set_hw_param(struct mtk_jpeg_ctx *ctx, ../drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:941:12: warning: ‘mtk_jpegenc_get_hw’ defined but not used [-Wunused-function] 941 | static int mtk_jpegenc_get_hw(struct mtk_jpeg_ctx *ctx) Signed-off-by: Randy Dunlap Reported-by: kernel test robot Link: https://lore.kernel.org/linux-media/202305042146.j4ZxuvpM-lkp@intel.com/ Cc: Bin Liu Cc: oushixiong Cc: Mauro Carvalho Chehab Cc: Hans Verkuil Cc: linux-media@vger.kernel.org Signed-off-by: Hans Verkuil commit d5b7eb477c286f6ceccbb38704136eea0e6b09ca Author: Andrey Konovalov Date: Fri May 19 00:52:35 2023 +0300 media: camss: set VFE bpl_alignment to 16 for sdm845 and sm8250 From the experiments with camera sensors using SGRBG10_1X10/3280x2464 and SRGGB10_1X10/3280x2464 formats, it becomes clear that on sdm845 and sm8250 VFE outputs the lines padded to a length multiple of 16 bytes. As in the current driver the value of the bpl_alignment is set to 8 bytes, the frames captured in formats with the bytes-per-line value being not a multiple of 16 get corrupted. Set the bpl_alignment of the camss video output device to 16 for sdm845 and sm8250 to fix that. Signed-off-by: Andrey Konovalov Tested-by: Bryan O'Donoghue Acked-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit 26ae58f65e64fa7ba61d64bae752e59e08380c6a Author: Marek Vasut Date: Thu May 18 15:36:49 2023 +0200 media: videodev2.h: Fix struct v4l2_input tuner index comment VIDIOC_ENUMINPUT documentation describes the tuner field of struct v4l2_input as index: Documentation/userspace-api/media/v4l/vidioc-enuminput.rst " * - __u32 - ``tuner`` - Capture devices can have zero or more tuners (RF demodulators). When the ``type`` is set to ``V4L2_INPUT_TYPE_TUNER`` this is an RF connector and this field identifies the tuner. It corresponds to struct :c:type:`v4l2_tuner` field ``index``. For details on tuners see :ref:`tuner`. " Drivers I could find also use the 'tuner' field as an index, e.g.: drivers/media/pci/bt8xx/bttv-driver.c bttv_enum_input() drivers/media/usb/go7007/go7007-v4l2.c vidioc_enum_input() However, the UAPI comment claims this field is 'enum v4l2_tuner_type': include/uapi/linux/videodev2.h This field being 'enum v4l2_tuner_type' is unlikely as it seems to be never used that way in drivers, and documentation confirms it. It seem this comment got in accidentally in the commit which this patch fixes. Fix the UAPI comment to stop confusion. This was pointed out by Dmitry while reviewing VIDIOC_ENUMINPUT support for strace. Fixes: 6016af82eafc ("[media] v4l2: use __u32 rather than enums in ioctl() structs") Signed-off-by: Marek Vasut Signed-off-by: Hans Verkuil commit c82d4d9353b02bf531ff43654863e7497a1caebe Author: Atin Bainada Date: Thu May 18 09:17:47 2023 +0000 media: av7110: Remove unnecessary (void*) conversions No need cast (void*) to (struct dvb_demux_feed *) or (struct av7110 *). Signed-off-by: Atin Bainada Signed-off-by: Hans Verkuil commit 17ae8136549f512e3fbc78cb78402df6a211cfb5 Author: Su Hui Date: Fri May 12 09:41:59 2023 +0800 media: pci: remove unnecessary (void*) conversions No need cast (void*) to (struct dst_state *), (struct cx18_stream *), (struct saa7164_port *) or (struct budget *). Signed-off-by: Su Hui Signed-off-by: Hans Verkuil commit afa8516c86fe153e8eb7daba41d6f46c64783b20 Author: Su Hui Date: Wed May 10 09:29:44 2023 +0800 media: platform: Remove unnecessary (void*) conversions No need cast (void*) to (struct stdemux *),(struct hva_h264_ctx *) or (struct hva_h264_task *). Signed-off-by: Su Hui Signed-off-by: Hans Verkuil commit eff540df5f80667eadf7a4a117b8a7655a47c7ea Author: Su Hui Date: Tue May 9 15:40:01 2023 +0800 media: usb: remove unnecessary (void*) conversions No need cast (void*) to (struct dvb_usb_device *) or (struct filter_info *). Signed-off-by: Su Hui Signed-off-by: Hans Verkuil [hverkuil: drop the obsolete dvb-usb/az6027.c and dvb-usb/pctv452e.c changes] commit 7f7ac101236bd020681f122089b611eca8e507ac Author: Lukas Bulwahn Date: Mon May 8 06:13:39 2023 +0200 media: stk1160: Simplify the build config definition Commit dfb9f94e8e5e ("[media] stk1160: Build as a module if SND is m and audio support is selected") had to introduce some complex config dependency handling to compile for all combinations of configs VIDEO_STK1160 and VIDEO_STK1160_AC97. Later, commit e36e6b5f26c1 ("[media] stk1160: Remove stk1160-mixer and setup internal AC97 codec automatically") removes the config VIDEO_STK1160_AC97, which renders the previous dependency handling unnecessary. The commit already simplified the dependency of the remaining config VIDEO_STK1160, but it misses the opportunity to merge VIDEO_STK1160 and VIDEO_STK1160_COMMON. So, do that now and simplify the build config definition of the STK1160 USB video capture support. Signed-off-by: Lukas Bulwahn Signed-off-by: Hans Verkuil commit 076b6289b2c12d76fab248659896682830fa7766 Author: Ming Qian Date: Sat May 6 16:47:35 2023 +0800 media: amphion: initiate a drain of the capture queue in dynamic resolution change The last buffer from before the change must be marked with the V4L2_BUF_FLAG_LAST flag, similarly to the Drain sequence above. initiate a drain of the capture queue in dynamic resolution change Fixes: 6de8d628df6e ("media: amphion: add v4l2 m2m vpu decoder stateful driver") Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil commit e75d25a0c9bea52d50894e3d72c9ab486f165ac9 Author: Alexander Stein Date: Tue May 2 16:09:02 2023 +0200 media: staging: media: imx6-mipi-csi2: Add log_status core callback This prints all register values. Signed-off-by: Alexander Stein Signed-off-by: Hans Verkuil commit f93ff8b7dd0c713feccfe7215651febb6de5bf68 Author: Daniel Lundberg Pedersen Date: Mon May 1 16:57:07 2023 +0200 media: docs: vidioc-g-ext-ctrls.rst: Update p_s32 and p_s64 types The pointer types of p_s32 and p_s64 in v4l2_ext_control has been updated, match the change in documentation. Signed-off-by: Daniel Lundberg Pedersen Signed-off-by: Hans Verkuil commit 3f6375a2d1956739c6c8ffa3a862c9278d346940 Author: Daniel Lundberg Pedersen Date: Mon May 1 16:57:06 2023 +0200 media: videodev2.h: Fix p_s32 and p_s64 pointer types Use the intended pointer types for p_s32 and p_64 in the union of the struct v4l2_ext_control. Fixes: e77eb66342c7 ("videodev2.h: add p_s32 and p_s64 pointers") Signed-off-by: Daniel Lundberg Pedersen Signed-off-by: Hans Verkuil commit 8217af0984f962e64a756488d5e33c0cf57b327c Author: Bryan O'Donoghue Date: Mon May 1 11:39:14 2023 +0100 media: MAINTAINERS: Add myself as Venus reviewer I'd like to be looped in on changes to venus so that I can help ensure no obvious regressions creep in. I'm happy to run some simple tests for venus on the hardware I have access to - db410c - db820 - rb3 - rb5 and one of rb1 / rb2 in the future when they are delivered. Signed-off-by: Bryan O'Donoghue Reviewed-by: Javier Martinez Canillas Signed-off-by: Hans Verkuil commit b2aa8ac6f97e26d788948fb60dcc5625c9633f4e Author: Christophe JAILLET Date: Tue Apr 25 15:25:46 2023 +0200 media: common: saa7146: Avoid a leak in vmalloc_to_sg() Commit in Fixes turned a BUG() into a "normal" memory allocation failure. While at it, it introduced a memory leak. So fix it. Also update the comment on top of the function to reflect what has been change by the commit in Fixes. Fixes: 40e986c99624 ("media: common: saa7146: replace BUG_ON by WARN_ON") Signed-off-by: Christophe JAILLET Signed-off-by: Hans Verkuil commit 4a35700018065a3f40b9d5dd84829f7086594c9f Author: Nícolas F. R. A. Prado Date: Tue Apr 18 17:50:52 2023 -0400 Revert "media: mediatek: vcodec: Fix bitstream crop information error" This reverts commit cd61f3c6794bea2b717fe6083ca2ad189db75418. That commit's purpose was to prevent the padding from being decoded when userspace didn't set a selection, relying on the default one. However, as described in the Step 6 of the Initialization procedure for the Memory-to-Memory Stateful Video Encoder Interface [1]: "Set the visible resolution for the stream metadata via VIDIOC_S_SELECTION() on the OUTPUT queue if it is desired to be different than the full OUTPUT resolution." And from the Note: "To avoid encoding the padding, the client needs to explicitly configure this selection target" Hence the behavior in the original commit doesn't follow the interface and needs to be reverted. This fixes the following v4l2-compliance failure observed on mt8192-asurada-spherion: fail: v4l2-test-formats.cpp(924): sel.r.width != fmt.g_width() test VIDIOC_S_FMT: FAIL [1] https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/dev-encoder.html#initialization Signed-off-by: Nícolas F. R. A. Prado Tested-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil commit 56b5c3e67b0f9af3f45cf393be048ee8d8a92694 Author: Yunfei Dong Date: Mon Apr 17 16:17:40 2023 +0800 media: v4l2-mem2mem: add lock to protect parameter num_rdy Getting below error when using KCSAN to check the driver. Adding lock to protect parameter num_rdy when getting the value with function: v4l2_m2m_num_src_bufs_ready/v4l2_m2m_num_dst_bufs_ready. kworker/u16:3: [name:report&]BUG: KCSAN: data-race in v4l2_m2m_buf_queue kworker/u16:3: [name:report&] kworker/u16:3: [name:report&]read-write to 0xffffff8105f35b94 of 1 bytes by task 20865 on cpu 7: kworker/u16:3:  v4l2_m2m_buf_queue+0xd8/0x10c Signed-off-by: Pina Chen Signed-off-by: Yunfei Dong Signed-off-by: Hans Verkuil commit f0b4a2c037c0ab1affdf0937aee84314ab9c4fee Author: Max Staudt Date: Fri Apr 14 16:24:19 2023 +0900 media: vivid: Extend FPS rates offered by simulated webcam This adds an option for higher frame rates from a simulated webcam. Currently, vivid emulates (amongst other things) a webcam with somewhat limited bandwidth - higher resolutions deliver fewer frames per second. $ yavta --enum-formats -c /dev/video0 Device /dev/video0 opened. Device `vivid' on `platform:vivid-000' (driver 'vivid') supports video, capture, without mplanes. - Available formats: Format 0: YUYV (56595559) Type: Video capture (1) Name: YUYV 4:2:2 Frame size: 320x180 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60) Frame size: 640x360 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40) Frame size: 640x480 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25) Frame size: 1280x720 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25) Frame size: 1920x1080 (1/1, 1/2, 1/4, 1/5) Frame size: 3840x2160 (1/1, 1/2) In some test cases, it is useful to allow for higher frame rates, as configurations such as 720p@30 FPS have become commonplace now. This patch allows: 0- 719p - 120fps 720-1079p - 60fps 1080-2159p - 30fps 2160p - 15fps $ yavta --enum-formats -c /dev/video0 Device /dev/video0 opened. Device `vivid' on `platform:vivid-000' (driver 'vivid') supports video, capture, without mplanes. - Available formats: Format 0: YUYV (56595559) Type: Video capture (1) Name: YUYV 4:2:2 Frame size: 320x180 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60, 1/120) Frame size: 640x360 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60, 1/120) Frame size: 640x480 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60, 1/120) Frame size: 1280x720 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60) Frame size: 1920x1080 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30) Frame size: 3840x2160 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15) Passes: v4l2-compliance 1.25.0-5039 from v4l-utils git ccc08732823f Signed-off-by: Max Staudt Reviewed-by: Ricardo Ribalda Signed-off-by: Hans Verkuil [hverkuil: unsigned -> unsigned int] commit e1d2ccc2cdd6333584aa3d5386dc667d0837c48f Author: Ming Qian Date: Fri Apr 14 09:55:43 2023 +0800 media: amphion: drop repeated codec data for vc1g format For format V4L2_PIX_FMT_VC1_ANNEX_G, the separate codec data is required only once. The repeated codec data may introduce some decoding error. so drop the repeated codec data. It's amphion vpu's limitation Fixes: e670f5d672ef ("media: amphion: only insert the first sequence startcode for vc1l format") Signed-off-by: Ming Qian Tested-by: xiahong.bao Signed-off-by: Hans Verkuil commit 668ee1a3a1870381225002c246972419b98e4253 Author: Ming Qian Date: Fri Apr 14 09:55:42 2023 +0800 media: amphion: drop repeated codec data for vc1l format For format V4L2_PIX_FMT_VC1_ANNEX_L, the codec data is replaced with startcode, and then driver drop it, otherwise it may led to decoding error. It's amphion vpu's limitation Driver has dropped the first codec data, but need to drop the repeated codec data too. Fixes: e670f5d672ef ("media: amphion: only insert the first sequence startcode for vc1l format") Signed-off-by: Ming Qian Tested-by: xiahong.bao Signed-off-by: Hans Verkuil commit 8111496ceb52870157e663d747c71f5520ec9c94 Author: Angel Alberto Carretero Date: Wed Apr 12 19:51:01 2023 +0200 media: imx: utils: Enclose IMX_BUS_FMTS macro in parenthesis Conform to kernel coding style by wrapping macro in parenthesis. Issue found by checkpatch. Signed-off-by: Angel Alberto Carretero Signed-off-by: Hans Verkuil commit 59cea5a3e519c5c7d26878364d576c12f77d4f78 Author: Benjamin Gaignard Date: Thu Mar 23 14:17:04 2023 +0100 media: verisilicon: Simplify error handling in tile_buffer_reallocate() Rework allocation errors cases handling to simply it by removing useless tests. Signed-off-by: Benjamin Gaignard Reported-by: Markus Elfring Signed-off-by: Hans Verkuil commit fdaca63186f59fc664b346c45b76576624b48e57 Author: Daniil Dulov Date: Tue Mar 14 10:04:49 2023 -0700 media: usb: Check az6007_read() return value If az6007_read() returns error, there is no sence to continue. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 3af2f4f15a61 ("[media] az6007: Change the az6007 read/write routine parameter") Signed-off-by: Daniil Dulov Signed-off-by: Hans Verkuil commit b8ed1ceb4a2653a2d5529b3afb79343d77efb3ce Author: Deepak R Varma Date: Sat Feb 11 16:39:50 2023 +0530 media: platform: mtk-mdp3: release node reference before returning The iterator for_each_child_of_node() increments the refcount of the child node it is processing. Release such a reference when the loop needs to break due to an error during its execution. Issue identified using for_each_child.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma Signed-off-by: Hans Verkuil commit e5f29bb9c4350dd9692f3b98eb8538dbbebccbaf Author: Lad Prabhakar Date: Wed Nov 23 10:50:22 2022 +0000 media: platform: rzg2l-cru: rzg2l-csi2: Enclose the macro in parentheses Fix the below error reported by checkpatch: ERROR: Macros with complex values should be enclosed in parentheses CSIDPHYSKW0_UTIL_DL1_SKW_ADJ(1) | \ CSIDPHYSKW0_UTIL_DL2_SKW_ADJ(1) | \ CSIDPHYSKW0_UTIL_DL3_SKW_ADJ(1) Signed-off-by: Lad Prabhakar Signed-off-by: Hans Verkuil commit e740d199cf0ff1e53ddc2ab067c0a09b55845d68 Author: Luca Ceresoli Date: Tue Apr 18 10:00:54 2023 +0200 staging: media: tegra-video: add support for Tegra20 parallel input The VI peripheral of Tegra supports capturing from MIPI CSI-2 or parallel video (called VIP in the docs). The staging tegra-video driver currently implements MIPI CSI-2 video capture for Tegra210. Add support for parallel video capture (VIP) on Tegra20. With the generalizations added to the VI driver in previous commits, this is only a matter of adding the vip.c and tegra20.c implementations and registering them. Unfortunately there was no documentation available for the VI or VIP peripherals of Tegra20 (or any other Tegra chips). This implementation has been based entirely on the code from a vendor kernel based on Linux 3.1 and massively adapted to fit into the tegra-video driver. Parts of this code is definitely non-optimal to say the least (especially tegra20_vi_enable() and the single-frame capture logic), but it was impossible to improve it. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil [hverkuil: fix host1x_client_unregister usage: it's now a void func] commit 657d42cf5df64d9f32caab73ba2d2284879a37b0 Author: Niklas Schnelle Date: Wed May 24 09:54:10 2023 +0200 s390/ism: Set DMA coherent mask A future change will convert the DMA API implementation from the architecture specific arch/s390/pci/pci_dma.c to using the common code drivers/iommu/dma-iommu.c which the utilizes the same IOMMU hardware through the s390-iommu driver. Unlike the s390 specific DMA API this requires devices to correctly set the coherent mask to be allowed to use IOVAs >2^32 in dma_alloc_coherent(). This was however not done for ISM devices. ISM requires such addresses since currently the DMA aperture for PCI devices starts at 2^32 and all calls to dma_alloc_coherent() would thus fail. Link: https://lore.kernel.org/all/20230310-dma_iommu-v9-1-65bb8edd2beb@linux.ibm.com/ Reviewed-by: Alexandra Winter Reviewed-by: Matthew Rosato Reviewed-by: Pierre Morel Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230524075411.3734141-1-schnelle@linux.ibm.com Signed-off-by: Paolo Abeni commit 8f38f8fa7261819eb7d4fb369dc3bfab72259033 Author: Lu Hongfei Date: Thu May 25 19:17:03 2023 +0800 led: qcom-lpg: Fix resource leaks in for_each_available_child_of_node() loops Ensure child node references are decremented properly in the error path. Signed-off-by: Lu Hongfei Link: https://lore.kernel.org/r/20230525111705.3055-1-luhongfei@vivo.com Signed-off-by: Lee Jones commit 28598e218076f77cbd44b7762aa5f935356aebd4 Author: Neil Armstrong Date: Thu May 25 13:54:22 2023 +0200 dt-bindings: leds: qcom-lpg: Document PM8550 compatible The PM8550 PWM modules are compatible with the PM8350c PWM modules, document the PM8350c PWM compatible as fallback for the PM8550 PWM. Signed-off-by: Neil Armstrong Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230522-topic-sm8550-upstream-pm8550-lpg-v2-1-c5117f1d41f9@linaro.org Signed-off-by: Lee Jones commit 0e2fb41d6c5818e7afaef6a1f3df93e4b37f229c Author: Dylan Van Assche Date: Thu May 18 15:31:11 2023 +0200 dt-bindings: leds: qcom,spmi-flash-led: Add PMI8998 Document compatible for PMI8998 Torch and Flash LED controller. Signed-off-by: Dylan Van Assche Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230518133113.273880-2-me@dylanvanassche.be Signed-off-by: Lee Jones commit ece1f480a49e7d1ce57ec7eb7b847321206d0db0 Author: Luca Weiss Date: Tue May 23 22:41:30 2023 +0200 Documentation: leds: Add "rgb:status" path The path /sys/class/leds/rgb:status is already widely used with the qcom-lpg driver and others. Document it. Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20230414-pmi632-v3-3-079d2cada699@z3ntu.xyz Signed-off-by: Lee Jones commit e063b1923ab655fd364dfb4562b14eb33fd6638f Author: Krzysztof Kozlowski Date: Tue May 16 17:02:00 2023 +0200 dt-bindings: leds: qcom,spmi-flash-led: Add PM8550 Document compatible for PM8550 Torch and Flash LED controller. Signed-off-by: Krzysztof Kozlowski Acked-by: Conor Dooley Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230516150202.188655-1-krzysztof.kozlowski@linaro.org Signed-off-by: Lee Jones commit 36af333a753a22b10771af7d11a28b01183c4190 Author: Azeem Shaikh Date: Wed May 24 14:48:23 2023 +0000 leds: as3645a: Replace strlcpy with strscpy Part of a tree-wide effort to remove deprecated strlcpy()[1] and replace it with strscpy()[2]. No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230524144824.2360607-1-azeemshaikh38@gmail.com Signed-off-by: Lee Jones commit 75c8cb2f4cb218aaf4ea68cab08d6dbc96eeae15 Author: Martin Botka Date: Wed May 24 01:00:10 2023 +0100 mfd: axp20x: Add support for AXP313a PMIC The AXP313a is a PMIC chip produced by X-Powers, it can be connected via an I2C bus. The name AXP1530 seems to appear as well, and this is what is used in the BSP driver. From all we know it's the same chip, just a different name. However we have only seen AXP313a chips in the wild, so go with this name. Compared to the other AXP PMICs it's a rather simple affair: just three DCDC converters, three LDOs, and no battery charging support. Describe the regmap and the MFD bits, along with the registers exposed via I2C. Aside from the various regulators, also describe the power key interrupts, and adjust the shutdown handler routine to use a different register than the other PMICs. Eventually advertise the device using the new compatible string. Signed-off-by: Martin Botka Signed-off-by: Andre Przywara Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20230524000012.15028-2-andre.przywara@arm.com Signed-off-by: Lee Jones commit 623a71385312ee288d59e319b90922e6e6943766 Author: Christophe JAILLET Date: Tue May 23 20:17:52 2023 +0200 net/mlx4: Use bitmap_weight_and() Use bitmap_weight_and() instead of hand writing it. This saves a few LoC and is slightly faster, should it mater. Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/a29c2348a062408bec45cee2601b2417310e5ea7.1684865809.git.christophe.jaillet@wanadoo.fr Signed-off-by: Paolo Abeni commit 2d6180147e924b76b75b8b1e59bbf0c59c2a29d2 Author: Marek Vasut Date: Tue May 23 20:31:51 2023 +0200 leds: gpio: Configure per-LED pin control Each gpio-leds DT node DT subnode can have a pinctrl property assigned to it, parse the DT subnode pinctrl properties and configure each pin accordingly. Tested-by: Christoph Niedermaier Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230523183151.5460-1-marex@denx.de Signed-off-by: Lee Jones commit a8b09e6fe3eee4525ef6b6d5bd0e69c785e2f757 Author: Geert Uytterhoeven Date: Tue May 23 17:38:37 2023 +0200 dt-bindings: backlight: pwm: Make power-supply not required make dtbs_check: arch/arm/boot/dts/renesas/r8a7742-iwg21d-q7.dtb: backlight: 'power-supply' is a required property From schema: Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml As that backlight device node already has an "enable-gpios" property to control the power supplied to the backlight, it sounds a bit silly to have to add a "power-supply" property just to silence this warning. In addition, as of commit deaeeda2051fa280 ("backlight: pwm_bl: Don't rely on a disabled PWM emiting inactive state"), the Linux driver considers the power supply optional. Fix this by synchronizing the bindings with actual driver behavior by making the "power-supply" optional. Fixes: deaeeda2051fa280 ("backlight: pwm_bl: Don't rely on a disabled PWM emiting inactive state") Signed-off-by: Geert Uytterhoeven Acked-by: Conor Dooley Link: https://lore.kernel.org/r/29943059c80c8db0db437f9548f084a67326647b.1684856131.git.geert+renesas@glider.be Signed-off-by: Lee Jones commit bf4a35e9201d30b63a8d276797d6ecfaa596ccd3 Author: Azeem Shaikh Date: Tue May 23 02:14:51 2023 +0000 leds: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230523021451.2406362-1-azeemshaikh38@gmail.com Signed-off-by: Lee Jones commit d6e3896b7c22278c6f4a9b166211fdddf1c86c3a Author: Azeem Shaikh Date: Tue May 23 02:12:28 2023 +0000 leds: blinkm: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230523021228.2406112-1-azeemshaikh38@gmail.com Signed-off-by: Lee Jones commit e01134eb13c55445da6c16c440946757bf761651 Author: Geert Uytterhoeven Date: Tue May 23 17:40:41 2023 +0200 backlight: pwm_bl: Remove unneeded checks for valid GPIOs All of gpiod_set_value_cansleep() and gpiod_direction_output() handle NULL GPIO pointers just fine, so there is no need to check for that in the caller. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/00be8237e0e2bc9b179177b5490f175d657261a2.1684856337.git.geert+renesas@glider.be Signed-off-by: Lee Jones commit 29554f2e9138d60012d0e0d53e6792f5f4da1fb6 Author: Uwe Kleine-König Date: Sun May 21 16:38:44 2023 +0200 backlight: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Also fix two indention inconsistencies in the neighbourhood. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230521143844.375244-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones commit ae9c48087f50f2373e62dc2e0fb63178e256f351 Author: Maximilian Weigand Date: Wed May 10 10:52:39 2023 +0200 backlight: lm3630a: Turn off both led strings when display is blank Use backlight_is_blank() to determine if the led strings should be turned off in the update_status() functions of both strings. Signed-off-by: Maximilian Weigand Reviewed-by: Daniel Thompson Reviewed-by: Sam Ravnborg Link: https://lore.kernel.org/r/20230510085239.1253896-1-mweigand2017@gmail.com Signed-off-by: Lee Jones commit 77036e09b0c8c8ef8dd0ddc105813970653f9ce1 Author: Jianhua Lu Date: Sat Apr 29 00:02:46 2023 +0800 dt-bindings: leds: backlight: ktz8866: Add reg property and update example The kinetic,ktz8866 is a I2C driver, so add the missing reg property. And update example to make it clear. Signed-off-by: Jianhua Lu Reviewed-by: Krzysztof Kozlowski Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20230428160246.16982-1-lujianhua000@gmail.com Signed-off-by: Lee Jones commit e8f8b3323039e4c60c626ce853eca7b36b0aaa8f Merge: ae4899bb486f7 7016eb738651e Author: Paolo Abeni Date: Thu May 25 13:20:47 2023 +0200 Merge branch 'net-tcp-make-txhash-use-consistent-for-ipv4' Antoine Tenart says: ==================== net: tcp: make txhash use consistent for IPv4 Series is divided in two parts. First two commits make the txhash (used for the skb hash in TCP) to be consistent for all IPv4/TCP packets (IPv6 doesn't have the same issue). Last commit improve a hash-related doc. One example is when using OvS with dp_hash, which uses skb->hash, to select a path. We'd like packets from the same flow to be consistent, as well as the hash being stable over time when using net.core.txrehash=0. Same applies for kernel ECMP which also can use skb->hash. ==================== Link: https://lore.kernel.org/r/20230523161453.196094-1-atenart@kernel.org Signed-off-by: Paolo Abeni commit 0113cea8fd729ea6187e8d330f74a7e2a73bd970 Author: Niklas Schnelle Date: Mon May 22 12:50:22 2023 +0200 leds: Add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Acked-by: Pavel Machek Link: https://lore.kernel.org/r/20230522105049.1467313-18-schnelle@linux.ibm.com Signed-off-by: Lee Jones commit 7016eb738651ed1dfeef2bbf266bc7dac734067d Author: Antoine Tenart Date: Tue May 23 18:14:53 2023 +0200 Documentation: net: net.core.txrehash is not specific to listening sockets The net.core.txrehash documentation mentions this knob is for listening sockets only, while sk_rethink_txhash can be called on SYN and RTO retransmits on all TCP sockets. Remove the listening socket part. Signed-off-by: Antoine Tenart Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit c0a8966e2bc7d31f77a7246947ebc09c1ff06066 Author: Antoine Tenart Date: Tue May 23 18:14:52 2023 +0200 net: ipv4: use consistent txhash in TIME_WAIT and SYN_RECV When using IPv4/TCP, skb->hash comes from sk->sk_txhash except in TIME_WAIT and SYN_RECV where it's not set in the reply skb from ip_send_unicast_reply. Those packets will have a mismatched hash with others from the same flow as their hashes will be 0. IPv6 does not have the same issue as the hash is set from the socket txhash in those cases. This commits sets the hash in the reply skb from ip_send_unicast_reply, which makes the IPv4 code behaving like IPv6. Signed-off-by: Antoine Tenart Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit 4fbfde4e272065943cbcf2d016f0679456cb4f75 Author: Antoine Tenart Date: Tue May 23 18:14:51 2023 +0200 net: tcp: make the txhash available in TIME_WAIT sockets for IPv4 too Commit c67b85558ff2 ("ipv6: tcp: send consistent autoflowlabel in TIME_WAIT state") made the socket txhash also available in TIME_WAIT sockets but for IPv6 only. Make it available for IPv4 too as we'll use it in later commits. Signed-off-by: Antoine Tenart Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit 7cdafe6cc4a6ee94c56a5c96d6edd80d066d5a3b Author: Amir Goldstein Date: Wed May 24 18:48:25 2023 +0300 exportfs: check for error return value from exportfs_encode_*() The exportfs_encode_*() helpers call the filesystem ->encode_fh() method which returns a signed int. All the in-tree implementations of ->encode_fh() return a positive integer and FILEID_INVALID (255) for error. Fortify the callers for possible future ->encode_fh() implementation that will return a negative error value. name_to_handle_at() would propagate the returned error to the users if filesystem ->encode_fh() method returns an error. Reported-by: Dan Carpenter Link: https://lore.kernel.org/linux-fsdevel/ca02955f-1877-4fde-b453-3c1d22794740@kili.mountain/ Signed-off-by: Amir Goldstein Reviewed-by: Jeff Layton Signed-off-by: Jan Kara Message-Id: <20230524154825.881414-1-amir73il@gmail.com> commit a95aef69a740f5a1c7d70f2b58552207edaef99a Author: Amir Goldstein Date: Tue May 2 15:48:17 2023 +0300 fanotify: support reporting non-decodeable file handles fanotify users do not always need to decode the file handles reported with FAN_REPORT_FID. Relax the restriction that filesystem needs to support NFS export and allow reporting file handles from filesystems that only support ecoding unique file handles. Even filesystems that do not have export_operations at all can fallback to use the default FILEID_INO32_GEN encoding, but we use the existence of export_operations as an indication that the encoded file handles will be sufficiently unique and that user will be able to compare them to filesystem objects using AT_HANDLE_FID flag to name_to_handle_at(2). For filesystems that do not support NFS export, users will have to use the AT_HANDLE_FID of name_to_handle_at(2) if they want to compare the object in path to the object fid reported in an event. Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara Message-Id: <20230502124817.3070545-5-amir73il@gmail.com> commit 96b2b072ee62be8ae68c8ecf14854c4d0505a8f8 Author: Amir Goldstein Date: Tue May 2 15:48:16 2023 +0300 exportfs: allow exporting non-decodeable file handles to userspace Some userspace programs use st_ino as a unique object identifier, even though inode numbers may be recycable. This issue has been addressed for NFS export long ago using the exportfs file handle API and the unique file handle identifiers are also exported to userspace via name_to_handle_at(2). fanotify also uses file handles to identify objects in events, but only for filesystems that support NFS export. Relax the requirement for NFS export support and allow more filesystems to export a unique object identifier via name_to_handle_at(2) with the flag AT_HANDLE_FID. A file handle requested with the AT_HANDLE_FID flag, may or may not be usable as an argument to open_by_handle_at(2). To allow filesystems to opt-in to supporting AT_HANDLE_FID, a struct export_operations is required, but even an empty struct is sufficient for encoding FIDs. Acked-by: Jeff Layton Acked-by: Chuck Lever Signed-off-by: Amir Goldstein Acked-by: Christian Brauner Signed-off-by: Jan Kara Message-Id: <20230502124817.3070545-4-amir73il@gmail.com> commit af7320ecae0ce646fd2c4a88341a3fbc243553da Author: Yang Li Date: Thu May 11 15:08:20 2023 +0800 leds: trigger: netdev: Remove NULL check before dev_{put, hold} The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there is no need to check before using dev_{put, hold}, remove it to silence the warnings: ./drivers/leds/trigger/ledtrig-netdev.c:291:3-10: WARNING: NULL check before dev_{put, hold} functions is not needed. ./drivers/leds/trigger/ledtrig-netdev.c:401:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=4929 Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20230511070820.52731-1-yang.lee@linux.alibaba.com Signed-off-by: Lee Jones commit 82f80ef5f337e6c66392c58a968244b98542acd2 Author: Hans de Goede Date: Wed May 10 18:22:34 2023 +0200 leds: Clear LED_INIT_DEFAULT_TRIGGER when clearing current trigger Not all triggers use LED_INIT_DEFAULT_TRIGGER, which means that it will not get cleared when the default trigger is a trigger which does not use it such as "default-on". If the default trigger then later gets replaced by a trigger which does check LED_INIT_DEFAULT_TRIGGER, such as "timer" then that trigger will behave as if it is the default trigger which it should not do. To fix this clear the LED_INIT_DEFAULT_TRIGGER flag when clearing the current trigger, so that it will not be set for any subsequently set (non default) triggers. Signed-off-by: Hans de Goede Reviewed-by: Jacek Anaszewski Tested-by: Yauhen Kharuzhy Link: https://lore.kernel.org/r/20230510162234.291439-5-hdegoede@redhat.com Signed-off-by: Lee Jones commit 22720a87d0a9667c003bcffd38d15228b3a40f8c Author: Hans de Goede Date: Wed May 10 18:22:33 2023 +0200 leds: Fix oops about sleeping in led_trigger_blink() led_trigger_blink() calls led_blink_set() from a RCU read-side critical section so led_blink_set() must not sleep. Note sleeping was not allowed before the switch to RCU either because a spinlock was held before. led_blink_set() does not sleep when sw-blinking is used, but many LED controller drivers with hw blink support have a blink_set function which may sleep, leading to an oops like this one: [ 832.605062] ------------[ cut here ]------------ [ 832.605085] Voluntary context switch within RCU read-side critical section! [ 832.605119] WARNING: CPU: 2 PID: 370 at kernel/rcu/tree_plugin.h:318 rcu_note_context_switch+0x4ee/0x690 [ 832.606453] Call Trace: [ 832.606466] [ 832.606487] __schedule+0x9f/0x1480 [ 832.606527] schedule+0x5d/0xe0 [ 832.606549] schedule_timeout+0x79/0x140 [ 832.606572] ? __pfx_process_timeout+0x10/0x10 [ 832.606599] wait_for_completion_timeout+0x6f/0x140 [ 832.606627] i2c_dw_xfer+0x101/0x460 [ 832.606659] ? psi_group_change+0x168/0x400 [ 832.606680] __i2c_transfer+0x172/0x6d0 [ 832.606709] i2c_smbus_xfer_emulated+0x27d/0x9c0 [ 832.606732] ? __schedule+0x430/0x1480 [ 832.606753] ? preempt_count_add+0x6a/0xa0 [ 832.606778] ? get_nohz_timer_target+0x18/0x190 [ 832.606796] ? lock_timer_base+0x61/0x80 [ 832.606817] ? preempt_count_add+0x6a/0xa0 [ 832.606842] __i2c_smbus_xfer+0xa2/0x3f0 [ 832.606862] i2c_smbus_xfer+0x66/0xf0 [ 832.606882] i2c_smbus_read_byte_data+0x41/0x70 [ 832.606901] ? _raw_spin_unlock_irqrestore+0x23/0x40 [ 832.606922] ? __pm_runtime_suspend+0x46/0xc0 [ 832.606946] cht_wc_byte_reg_read+0x2e/0x60 [ 832.606972] _regmap_read+0x5c/0x120 [ 832.606997] _regmap_update_bits+0x96/0xc0 [ 832.607023] regmap_update_bits_base+0x5b/0x90 [ 832.607053] cht_wc_leds_brightness_get+0x412/0x910 [leds_cht_wcove] [ 832.607094] led_blink_setup+0x28/0x100 [ 832.607119] led_trigger_blink+0x40/0x70 [ 832.607145] power_supply_update_leds+0x1b7/0x1c0 [ 832.607174] power_supply_changed_work+0x67/0xe0 [ 832.607198] process_one_work+0x1c8/0x3c0 [ 832.607222] worker_thread+0x4d/0x380 [ 832.607243] ? __pfx_worker_thread+0x10/0x10 [ 832.607258] kthread+0xe9/0x110 [ 832.607279] ? __pfx_kthread+0x10/0x10 [ 832.607300] ret_from_fork+0x2c/0x50 [ 832.607337] [ 832.607344] ---[ end trace 0000000000000000 ]--- Add a new led_blink_set_nosleep() function which defers the actual led_blink_set() call to a workqueue when necessary to fix this. This also fixes an existing race where a pending led_set_brightness() has been deferred to set_brightness_work and might then race with a later led_cdev->blink_set() call. Note this race is only an issue with triggers mixing led_trigger_event() and led_trigger_blink() calls, sysfs API calls and led_trigger_blink_oneshot() are not affected. Note rather then adding a separate blink_set_blocking callback this uses the presence of the already existing brightness_set_blocking callback to detect if the blinking call should be deferred to set_brightness_work. Signed-off-by: Hans de Goede Reviewed-by: Jacek Anaszewski Tested-by: Yauhen Kharuzhy Link: https://lore.kernel.org/r/20230510162234.291439-4-hdegoede@redhat.com Signed-off-by: Lee Jones commit fa15d8c69238b352cc143cb9d8f2ca4594b94022 Author: Hans de Goede Date: Wed May 10 18:22:32 2023 +0200 leds: Fix set_brightness_delayed() race When a trigger wants to switch from blinking to LED on it needs to call: led_set_brightness(LED_OFF); led_set_brightness(LED_FULL); To first call disables blinking and the second then turns the LED on (the power-supply charging-blink-full-solid triggers do this). These calls happen immediately after each other, so it is possible that set_brightness_delayed() from the first call has not run yet when the led_set_brightness(LED_FULL) call finishes. If this race hits then this is causing problems for both sw- and hw-blinking: For sw-blinking set_brightness_delayed() clears delayed_set_value when LED_BLINK_DISABLE is set causing the led_set_brightness(LED_FULL) call effects to get lost when hitting the race, resulting in the LED turning off instead of on. For hw-blinking if the race hits delayed_set_value has been set to LED_FULL by the time set_brightness_delayed() runs. So led_cdev->brightness_set_blocking() is never called with LED_OFF as argument and the hw-blinking is never disabled leaving the LED blinking instead of on. Fix both issues by adding LED_SET_BRIGHTNESS and LED_SET_BRIGHTNESS_OFF work_flags making this 2 separate actions to be run by set_brightness_delayed(). Signed-off-by: Hans de Goede Reviewed-by: Jacek Anaszewski Tested-by: Yauhen Kharuzhy Link: https://lore.kernel.org/r/20230510162234.291439-3-hdegoede@redhat.com Signed-off-by: Lee Jones commit e298d8a38b2341865f9feb04591aabb109e8bb13 Author: Hans de Goede Date: Wed May 10 18:22:31 2023 +0200 leds: Change led_trigger_blink[_oneshot]() delay parameters to pass-by-value led_blink_set[_oneshot]()'s delay_on and delay_off function parameters are pass by reference, so that hw-blink implementations can report back the actual achieved delays when the values have been rounded to something the hw supports. This is really only interesting for the sysfs API / the timer trigger. Other triggers don't really care about this and none of the callers of led_trigger_blink[_oneshot]() do anything with the returned delay values. Change the led_trigger_blink[_oneshot]() delay parameters to pass-by-value, there are 2 reasons for this: 1. led_cdev->blink_set() may sleep, while led_trigger_blink() may not. So on hw where led_cdev->blink_set() sleeps the call needs to be deferred to a workqueue, in which case the actual achieved delays are unknown (this is a preparation patch for the deferring). 2. Since the callers don't care about the actual achieved delays, allowing callers to directly pass a value leads to simpler code for most callers. Signed-off-by: Hans de Goede Reviewed-by: Jacek Anaszewski Tested-by: Yauhen Kharuzhy Acked-by: Greg Kroah-Hartman Acked-by: Sebastian Reichel Acked-by: Florian Westphal Link: https://lore.kernel.org/r/20230510162234.291439-2-hdegoede@redhat.com Signed-off-by: Lee Jones commit d9ff8a8eecf8ad70aadc54cce39208b3957f2c6a Author: Uwe Kleine-König Date: Wed May 17 20:05:59 2023 +0200 leds: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517180559.166329-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones commit b0f379bd6e9c2dcf1209f99612783d5f9357b33a Author: Geert Uytterhoeven Date: Tue May 9 17:07:47 2023 +0200 leds: Make LEDS_TI_LMU_COMMON invisible Currently, LEDS_LM3697 and LEDS_LM36274 depend on LEDS_TI_LMU_COMMON, which contains the common code to support TI LMU devices. This means the user is asked about the common code first, followed by the individual drivers, if their dependencies are met. Simplify this, and reduce the number of questions by making LEDS_TI_LMU_COMMON invisible, and letting it be selected when needed. Signed-off-by: Geert Uytterhoeven Acked-by: Pavel Machek Link: https://lore.kernel.org/r/91f6efaa48c36320e58b6a312025ae9b39ee206b.1683644796.git.geert+renesas@glider.be Signed-off-by: Lee Jones commit 91fe1bda4672c31aa93d018176e6cf62c6ccb657 Author: Dylan Van Assche Date: Sun May 7 19:29:41 2023 +0200 leds: flash: leds-qcom-flash: Disable LED when changing brightness The Qualcomm PMI8998 PMIC requires the LED to be disabled when configuring the brightness. Always disable the LED when setting the brightness and re-enable it afterwards. Signed-off-by: Dylan Van Assche Link: https://lore.kernel.org/r/20230507172941.364852-3-me@dylanvanassche.be Signed-off-by: Lee Jones commit 0ae8dc1a1a998c7b6b866cb83de83bea5740fb8e Author: Dylan Van Assche Date: Sun May 7 19:29:40 2023 +0200 leds: flash: leds-qcom-flash: Add PMI8998 support Add subtype for the Qualcomm PMI8998 PMIC to support it besides the PM8150 PMIC which has the same registers. Adjust the driver to recognize both PMIC subtypes as a 3 channel LED driver. Signed-off-by: Dylan Van Assche Link: https://lore.kernel.org/r/20230507172941.364852-2-me@dylanvanassche.be Signed-off-by: Lee Jones commit ea0c0a85363380e7e80405d47cf63ce84cbc7b65 Author: Hans de Goede Date: Sun Apr 30 21:59:52 2023 +0200 leds: cht-wcove: Use breathing when LED_INIT_DEFAULT_TRIGGER is set The desired default behavior of LED1 / the charge LED is breathing while charging and on/solid when full. Since triggers cannot select breathing, blink_set() gets called when charging. Use breathing when the default "charging-blink-full-solid" trigger is used to achieve the desired default behavior. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430195952.862527-6-hdegoede@redhat.com Signed-off-by: Lee Jones commit ca3167f238f347b39567ba46af6ac4f0d732aacf Author: Hans de Goede Date: Sun Apr 30 21:59:51 2023 +0200 leds: cht-wcove: Set default trigger for charging LED Set a default trigger for the charging LED based on the machine-model as set by the PMIC MFD driver. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430195952.862527-5-hdegoede@redhat.com Signed-off-by: Lee Jones commit 5b916aa755551058c0e88e45a8c7db31d7718d59 Author: Hans de Goede Date: Sun Apr 30 21:59:50 2023 +0200 leds: cht-wcove: Add support for breathing mode use hw_pattern sysfs API The hw-blinking of the LED controller in the Whiskey Cove PMIC can also be used for a hw-breathing effect. As discussed during review of v2 of the submission of the new leds-cht-wcove driver, the LED subsystem already supports breathing mode on several other LED controllers using the hw_pattern interface. Implement a pattern_set callback to implement breathing mode modelled after the breathing mode supported by the SC27xx breathing light and Crane EL15203000 LED drivers. The Whiskey Cove PMIC's breathing mode is closer to the EL15203000 one then to the SC27xx one since it does not support staying high / low for a specific time, it only supports rise and fall times. As such the supported hw_pattern and the documentation for this is almost a 1:1 copy of the pattern/docs for the EL15203000 breathing mode. Suggested-by: Jacek Anaszewski Link: https://lore.kernel.org/all/6beed61c-1fc6-6525-e873-a8978f5fbffb@gmail.com/ Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430195952.862527-4-hdegoede@redhat.com Signed-off-by: Lee Jones commit 9697e2f01f1364acea110e808fde4386b0cc159f Author: Hans de Goede Date: Sun Apr 30 21:59:49 2023 +0200 leds: cht-wcove: Add suspend/resume handling When LED1 is showing the tablet is charging and then the device gets suspended followed by unplugging the charger, then it will incorrectly still show it is charging. To avoid this turn both LEDs off on suspend, just like the PMIC always turns them off when the tablet is powered off (even if the tablet is charging). If hw-control is supported for LED1, then restore the initial hw-control settings to let the hw control LED1 while suspended. To restore the state the LEDs had before suspending, save it before turning the LEDs off and restore it on resume. Acked-by: Pavel Machek Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430195952.862527-3-hdegoede@redhat.com Signed-off-by: Lee Jones commit 047da762b9a937d60c16e2c8392c326e5ab11a1d Author: Yauhen Kharuzhy Date: Sun Apr 30 21:59:48 2023 +0200 leds: Add Intel Cherry Trail Whiskey Cove PMIC LED driver Add support for LEDs connected to the Intel Cherry Trail Whiskey Cove PMIC. Charger and general-purpose LEDs are supported. Hardware blinking is implemented, breathing is not. This driver was tested with Lenovo Yoga Book notebook. Changes by Hans de Goede (in response to review of v2): - Since the PMIC is connected to the battery any changes we make to the LED settings are permanent, even surviving reboot / poweroff. Save LED1 register settings on probe() and if auto-/hw-control was enabled on probe() restore the settings on remove() and shutdown(). - Delay switching LED1 to software control mode to first brightness write. - Use dynamically allocated drvdata instead of a global drvdata variable. - Ensure the LED is on when activating blinking. - Fix CHT_WC_LED_EFF_BREATHING val ((3 << 1) rather then BIT(3)). Link: https://lore.kernel.org/r/20190212205901.13037-2-jekhor@gmail.com Signed-off-by: Yauhen Kharuzhy Co-developed-by: Hans de Goede Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430195952.862527-2-hdegoede@redhat.com Signed-off-by: Lee Jones commit 38b24e25f1b97955b0e794d9d42f2187579de9b4 Author: Nishanth Menon Date: Mon Apr 24 10:14:37 2023 -0500 dt-bindings: leds: Drop redundant cpus enum match Commit e91a4d5deb96 ("dt-bindings: leds: Document commonly used LED triggers") introduced a enum match for cpu, while a pattern '^cpu[0-9]*$' already exists. This causes linux,default-trigger = "cpu" to have more than one match and generates the following dtbs_check warning: arch/arm64/boot/dts/ti/k3-j721e-beagleboneai64.dtb: leds: led-2:linux,default-trigger: More than one condition true in oneOf schema: {'$ref': '/schemas/types.yaml#/definitions/string', 'oneOf': [{'items': [{'enum': ['backlight', 'default-on', 'heartbeat', 'disk-activity', 'disk-read', 'disk-write', 'timer', 'pattern', 'audio-micmute', 'audio-mute', 'bluetooth-power', 'cpu', 'flash', 'kbd-capslock', 'mtd', 'nand-disk', 'none', 'torch', 'usb-gadget', 'usb-host', 'usbport']}], 'maxItems': 1, 'minItems': 1, 'type': 'array'}, {'items': [{'pattern': '^cpu[0-9]*$'}], 'maxItems': 1, 'minItems': 1, 'type': 'array'}, {'items': [{'pattern': '^hci[0-9]+-power$'}], 'maxItems': 1, 'minItems': 1, 'type': 'array'}, {'items': [{'pattern': '^mmc[0-9]+$'}], 'maxItems': 1, 'minItems': 1, 'type': 'array'}, {'items': [{'pattern': '^phy[0-9]+tx$'}], 'maxItems': 1, 'minItems': 1, 'type': 'array'}]} Drop the explicit match against cpu since the pattern match already covers the same. Fixes: e91a4d5deb96 ("dt-bindings: leds: Document commonly used LED triggers") Signed-off-by: Nishanth Menon Acked-by: Manivannan Sadhasivam Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230424151437.256073-1-nm@ti.com commit e7c3044fba5dbe3e34849dc5806d5bba12bd458f Author: Luca Weiss Date: Tue Apr 18 18:43:21 2023 +0200 dt-bindings: mfd: qcom-spmi-pmic: Add PMI632 compatible Document support for the pmi632, often found with the sdm632 SoC. Signed-off-by: Luca Weiss Acked-by: Pavel Machek Acked-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230414-pmi632-v2-5-98bafa909c36@z3ntu.xyz commit d11a79dd047e18dd0b76bc9abebb8470858856d6 Author: Luca Weiss Date: Tue Apr 18 18:43:20 2023 +0200 leds: qcom-lpg: Add support for PMI632 LPG The PMI632 PMIC contains 5 PWM channels, 3 of which can be used for LEDs. For the LED pattern it doesn't have LUT like other PMICs but uses SDAM instead. This is not currently implemented in the driver but since LPG works fine without it, add support for the PMIC now. Signed-off-by: Luca Weiss Acked-by: Pavel Machek Reviewed-by: Konrad Dybcio Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230414-pmi632-v2-4-98bafa909c36@z3ntu.xyz commit 8e25e2a0af551e084c596c03999f7e8ef7205778 Author: Luca Weiss Date: Tue Apr 18 18:43:19 2023 +0200 dt-bindings: leds: qcom-lpg: Add compatible for PMI632 LPG block Document the availability of an LPG configuration for the PMI632 PMIC in the Qualcomm Light Pulse Generator driver. Signed-off-by: Luca Weiss Acked-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230414-pmi632-v2-3-98bafa909c36@z3ntu.xyz commit 54a7bef5aa8d5247a78d79460bac47849b91a28b Author: Maarten Zanders Date: Fri Apr 21 09:53:05 2023 +0200 leds: lp55xx: Configure internal charge pump The LP55xx range of devices have an internal charge pump which can (automatically) increase the output voltage towards the LED's, boosting the output voltage to 4.5V. Implement this option from the devicetree. When the setting is not present it will operate in automatic mode as before. Tested on LP55231. Datasheet analysis shows that LP5521, LP5523 and LP8501 are identical in topology and are modified in the same way. Signed-off-by: Maarten Zanders Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230421075305.37597-3-maarten.zanders@mind.be commit 91e47d4083dd935f547ea55d0dffeeba4b210b4b Author: Maarten Zanders Date: Fri Apr 21 09:53:04 2023 +0200 dt-bindings: leds-lp55xx: Add ti,charge-pump-mode Add a binding to configure the internal charge pump for lp55xx. Signed-off-by: Maarten Zanders Reviewed-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230421075305.37597-2-maarten.zanders@mind.be commit 08880713ceec023dd94d634f1e8902728c385939 Author: Geert Uytterhoeven Date: Thu May 25 13:13:59 2023 +0200 regulator: core: Streamline debugfs operations If CONFIG_DEBUG_FS is not set: regulator: Failed to create debugfs directory ... regulator-dummy: Failed to create debugfs directory As per the comments for debugfs_create_dir(), errors returned by this function should be expected, and ignored: * If debugfs is not enabled in the kernel, the value -%ENODEV will be * returned. * * NOTE: it's expected that most callers should _ignore_ the errors returned * by this function. Other debugfs functions handle the fact that the "dentry" * passed to them could be an error and they don't crash in that case. * Drivers should generally work fine even if debugfs fails to init anyway. Adhere to the debugfs spirit, and streamline all operations by: 1. Demoting the importance of the printed error messages to debug level, like is already done in create_regulator(), 2. Further ignoring any returned errors, as by design, all debugfs functions are no-ops when passed an error pointer. Fixes: 2bf1c45be3b8f3a3 ("regulator: Fix error checking for debugfs_create_dir") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2f8bb6e113359ddfab7b59e4d4274bd4c06d6d0a.1685013051.git.geert+renesas@glider.be Signed-off-by: Mark Brown commit 2715bb11cfff964aa33946847f9527cfbd4874f5 Author: Geert Uytterhoeven Date: Thu May 25 13:13:58 2023 +0200 regulator: core: Fix more error checking for debugfs_create_dir() In case of failure, debugfs_create_dir() does not return NULL, but an error pointer. Most incorrect error checks were fixed, but the one in create_regulator() was forgotten. Fix the remaining error check. Fixes: 2bf1c45be3b8f3a3 ("regulator: Fix error checking for debugfs_create_dir") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/ee980a108b5854dd8ce3630f8f673e784e057d17.1685013051.git.geert+renesas@glider.be Signed-off-by: Mark Brown commit d1b9e1391ab2dc80e9db87fe8b2de015c651e4c9 Author: Christian Marangi Date: Wed Apr 19 23:07:43 2023 +0200 leds: trigger: netdev: Use mutex instead of spinlocks Some LEDs may require to sleep while doing some operation like setting brightness and other cleanup. For this reason, using a spinlock will cause a sleep under spinlock warning. It should be safe to convert this to a sleepable lock since: - sysfs read/write can sleep - netdev_trig_work is a work queue and can sleep - netdev _trig_notify can sleep The spinlock was used when brightness didn't support sleeping, but this changed and now it supported with brightness_set_blocking(). Convert to mutex lock to permit sleeping using brightness_set_blocking(). Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230419210743.3594-6-ansuelsmth@gmail.com commit 164b67d53476a9d114be85c885bd31f783835be4 Author: Christian Marangi Date: Wed Apr 19 23:07:42 2023 +0200 leds: trigger: netdev: Convert device attr to macro Convert link tx and rx device attr to a common macro to reduce common code and in preparation for additional attr. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230419210743.3594-5-ansuelsmth@gmail.com commit bdec9cb83936e0ac4cb87fed5b49fad0175f7dec Author: Christian Marangi Date: Wed Apr 19 23:07:41 2023 +0200 leds: trigger: netdev: Rename add namespace to netdev trigger enum modes Rename NETDEV trigger enum modes to a more symbolic name and add a namespace to them. Also add __TRIGGER_NETDEV_MAX to identify the max modes of the netdev trigger. This is a cleanup to drop the define and no behaviour change are intended. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230419210743.3594-4-ansuelsmth@gmail.com commit e2f24cb1b5daf9a4f6f3ba574c1fa74aab9807a4 Author: Christian Marangi Date: Wed Apr 19 23:07:40 2023 +0200 leds: trigger: netdev: Drop NETDEV_LED_MODE_LINKUP from mode Putting NETDEV_LED_MODE_LINKUP in the same list of the netdev trigger modes is wrong as it's used to set the link state of the device and not to set a blink mode as it's done by NETDEV_LED_LINK, NETDEV_LED_TX and NETDEV_LED_RX. It's also wrong to put this state in the same bitmap of the netdev trigger mode and should be external to it. Drop NETDEV_LED_MODE_LINKUP from mode list and convert to a simple bool that will be true or false based on the carrier link. No functional change intended. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230419210743.3594-3-ansuelsmth@gmail.com commit cee4bd16c3195a701be683f7da9e88c6e11acb73 Author: Christian Marangi Date: Wed Apr 19 23:07:39 2023 +0200 leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename Dev can be renamed also while up for supported device. We currently wrongly clear the NETDEV_LED_MODE_LINKUP flag on NETDEV_CHANGENAME event. Fix this by rechecking if the carrier is ok on NETDEV_CHANGENAME and correctly set the NETDEV_LED_MODE_LINKUP bit. Fixes: 5f820ed52371 ("leds: trigger: netdev: fix handling on interface rename") Cc: stable@vger.kernel.org # v5.5+ Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230419210743.3594-2-ansuelsmth@gmail.com commit eeb036ab9ca90bcc0abf917a14983fb8a66b7a28 Author: Luca Ceresoli Date: Tue Apr 18 10:00:53 2023 +0200 staging: media: tegra-video: add H/V flip controls Tegra20 can do horizontal and vertical image flip, but Tegra210 cannot (either the hardware, or this driver). In preparation to adding Tegra20 support, add a flag in struct tegra_vi_soc so the generic vi.c code knows whether the flip controls should be added or not. Also provide a generic implementation that simply sets two flags in the channel struct. The Tegra20 implementation will enable flipping at stream start based on those flags. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit b4e2572267a1e91ba6e4813b4d71517cccccdbea Author: Luca Ceresoli Date: Tue Apr 18 10:00:52 2023 +0200 staging: media: tegra-video: add hooks for planar YUV and H/V flip Tegra20 supports planar YUV422 capture, which can be implemented by writing U and V base address registers in addition to the "main" base buffer address register. It also supports H and V flip, which among others requires to write the start address (i.e. the 1st offset to write, at the end of the buffer or line) in more registers for Y and, for planar formats, U and V. Add minimal hooks in VI to allow per-SoC optional support to those features: - variables in struct tegra_vi for the U and V buffer base offsets - variables in struct tegra_vi for the Y, U and V buffer start offsets - an optional per-soc VI operation to compute those values on queue setup Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit 4cbd8479cd2ea6d36597ad7c16860a074d804f85 Author: Luca Ceresoli Date: Tue Apr 18 10:00:51 2023 +0200 staging: media: tegra-video: add syncpts for Tegra20 to struct tegra_vi In preparation to implement Tegra20 parallel video capture, add a variable to hold the required syncpt and document all the syncpt variables. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit 89a0f667cb20c53dd9164d72a565a146af0fd11e Author: Luca Ceresoli Date: Tue Apr 18 10:00:50 2023 +0200 staging: media: tegra-video: move syncpt init/free to a per-soc op tegra_channel_host1x_syncpt_init() gets the host1x syncpts needed for the Tegra210 implementation, and tegra_channel_host1x_syncpts_free() puts them. Tegra20 needs to get and put a different syncpt. In preparation for adding Tegra20 support, move these functions to new ops in the soc-specific `struct tegra_vi_ops` . No functional changes. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit ef9435a5b4066e6935b922702446b555565898c9 Author: Luca Ceresoli Date: Tue Apr 18 10:00:49 2023 +0200 staging: media: tegra-video: add a per-soc enable/disable op The Tegra20 VI needs an additional operation to enable the VI, add an operation for that. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit 3bc46d752eab89ff2ddbd49cba931cf49d9c5dfb Author: Luca Ceresoli Date: Tue Apr 18 10:00:48 2023 +0200 staging: media: tegra-video: move MIPI calibration calls from VI to CSI The CSI module does not handle all the MIPI lane calibration procedure, leaving a small part of it to the VI module. In doing this, tegra_channel_enable_stream() (vi.c) manipulates the private data of the upstream subdev casting it to struct 'tegra_csi_channel', which will be wrong after introducing a VIP (parallel video input) channel. This prevents adding support for the VIP module. It also breaks the logical isolation between modules. Since the lane calibration requirement does not exist in the parallel input module, moving the calibration function to a per-module op is not optimal. Instead move the calibration procedure in the CSI module, together with the rest of the calibration procedures. After this change, tegra_channel_enable_stream() just calls v4l2_subdev_call() to ask for a stream start/stop to the CSI module, which in turn knows all the CSI-specific details to implement it. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit aabec712ce0e5ca2e47904dbc4326de614dc0bbf Author: Luca Ceresoli Date: Tue Apr 18 10:00:47 2023 +0200 staging: media: tegra-video: move default format to soc-specific data The tegra_default_format in vi.c is specific to Tegra210 CSI. In preparation for adding Tegra20 VIP support, move the default format to a new field in the soc-specific `struct tegra_vi_soc`. Instead of an entire format struct, only store a pointer to an item in the existing format array. No functional changes. The format pointed to is the same that used to be in vi.c. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit 1a3ea975d794181056157412183e4c23ea87353b Author: Luca Ceresoli Date: Tue Apr 18 10:00:46 2023 +0200 staging: media: tegra-video: move tegra_channel_fmt_align to a per-soc op tegra_channel_fmt_align() takes care of the size constraints, alignment and rounding requirements of the Tegra210 VI peripheral. Tegra20 has different constraints. In preparation for adding Tegra20 support, move this function to a new op in the soc-specific `struct tegra_vi_ops` . Also move to tegra210.c the T210-specific defines used in the moved code. No functional changes. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit c973880dfbe2b1cf85276c2e6f4fc3478d24d649 Author: Luca Ceresoli Date: Tue Apr 18 10:00:45 2023 +0200 staging: media: tegra-video: Kconfig: allow TPG only on Tegra210 We are about to add support for the Tegra20 parallel video capture, which has no TPG. In preparation for that, limit the VIDEO_TEGRA_TPG option to Tegra210 which is the only implementation currently provided by this driver. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit 21bd264c1c2608388387f7dcf6916091c9a023e9 Author: Luca Ceresoli Date: Tue Apr 18 10:00:44 2023 +0200 staging: media: tegra-video: remove unneeded include There is only a pointer reference to struct tegra_vi in video.h, thus vi.h is not needed. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit 44977bdc157f4619e919ea448f51ef247ab44f57 Author: Luca Ceresoli Date: Tue Apr 18 10:00:43 2023 +0200 staging: media: tegra-video: move tegra210_csi_soc to C file This declaration is used only in csi.c, no need to export it elsewhere. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit 983d22f6deb16aca1727ac3713a539650ef37e81 Author: Luca Ceresoli Date: Tue Apr 18 10:00:42 2023 +0200 staging: media: tegra-video: move private struct declaration to C file struct tegra_vi_graph_entity is an internal implementation detail of the VI module. Move its declaration from vi.h to vi.c. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit 26b44232f581b2baa8a2e767b52db33a9c7e839b Author: Luca Ceresoli Date: Tue Apr 18 10:00:41 2023 +0200 staging: media: tegra-video: slightly simplify cleanup on errors of_node_put(node) does nothing if node == NULL, so it can be moved to the cleanup section at the bottom. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit 40ecb38e5c961174f86bfb4d5b1d2ae821cc45c2 Author: Luca Ceresoli Date: Tue Apr 18 10:00:40 2023 +0200 staging: media: tegra-video: improve error messages tegra_vi_channels_alloc() can primarily fail for two reasons: 1. "ports" node not found 2. port_num > vi->soc->vi_max_channels Case 1 prints nothing, case 2 has a dev_err(). The caller [tegra_vi_init()] has a generic dev_err() on any failure. This mean that in case 2 we print two messages, and in case 1 we only print a generic message. Remove the generic message and add a specific message when case 1 happens, so that we always have one specific message without even increasing the number of dev_dbg*() calls. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit 6309986d7e42f68d6d13eccd81dfd7f3e2c3d92b Author: Luca Ceresoli Date: Tue Apr 18 10:00:39 2023 +0200 staging: media: tegra-video: fix typos in comment Add "skip" in "so we can *skip* the current channel" or it doesn't make sense. Also add articles where appropriate to fix English grammar. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit 2f229d40490534e76ab06c4b3a5627ae08620997 Author: Luca Ceresoli Date: Tue Apr 18 10:00:38 2023 +0200 staging: media: tegra-video: document tegra_channel_get_remote_source_subdev Clarify what this function does. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit b48ece9bb81b2a0e84dfd08432c4f5cdb81f84c0 Author: Luca Ceresoli Date: Tue Apr 18 10:00:37 2023 +0200 staging: media: tegra-video: improve documentation of tegra_video_format fields Some fields are irrelevant for Tegra20/VIP. Add a note to clarify that. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit f17aa778ac36298a8b5648984de6f1b8c8d87705 Author: Luca Ceresoli Date: Tue Apr 18 10:00:36 2023 +0200 dt-bindings: display: tegra: vi: add 'vip' property and example The Tegra20 VI peripheral can receive parallel input from the VIP parallel input module. Add it to the allowed properties and augment the existing nvidia,tegra20-vi example to show a 'vip' property. Signed-off-by: Luca Ceresoli Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil commit 7e3d507ab040c0f21f680c6e23d8432623867b3c Author: Luca Ceresoli Date: Tue Apr 18 10:00:35 2023 +0200 dt-bindings: display: tegra: add Tegra20 VIP VIP is the parallel video capture component within the video input subsystem of Tegra20 (and other Tegra chips, apparently). Signed-off-by: Luca Ceresoli Reviewed-by: Krzysztof Kozlowski Reviewed-by: Dmitry Osipenko Signed-off-by: Hans Verkuil commit dcb2d27444baeba91701bcab38d60c219cb47463 Author: Qii Wang Date: Tue May 23 19:26:08 2023 +0800 spi: mediatek: advertise the availability of Dual and Quad mode this patch advertise the availability of Dual and Quad SPI mode for ipm design. Signed-off-by: Qii Wang Signed-off-by: Tim.Kuo Link: https://lore.kernel.org/r/20230523112608.10298-1-qii.wang@mediatek.com Signed-off-by: Mark Brown commit b8cabec75b691fe194de99b5ff011dcbbd629c08 Merge: 6c594a820f8fa a511637502b1c Author: Mark Brown Date: Thu May 25 10:55:24 2023 +0100 regulator: Merge up fixes So we can base some new debugfs work on it. commit 13e75f4b03217226f110c5bb5d11720adb5ca9d1 Author: Vitaly Rodionov Date: Wed May 24 13:52:36 2023 +0100 ASoC: cs42l42: Add PLL ratio table values Add 4.8Mhz 9.6Mhz and 19.2MHz SCLK values for MCLK 12MHz and 12.288MHz requested by Intel. Signed-off-by: Vitaly Rodionov Reviewed-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20230524125236.57149-1-vitalyr@opensource.cirrus.com Signed-off-by: Mark Brown commit f9f46d05003ea6120fa27e01628770a2dac0fa75 Author: Charles Keepax Date: Wed May 10 10:25:34 2023 +0100 ASoC: cs35l45: Relicense to GPL only Cirrus never intended to upstream dual licensed code, convert to GPL only. Signed-off-by: Charles Keepax Acked-by: Pierre-Louis Bossart Acked-by: Uwe Kleine-König Reviewed-by: Richard Fitzgerald Reviewed-by: Vlad Karpovich Link: https://lore.kernel.org/r/20230510092534.3919120-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit f7241589f7bcc6783d416ab1dd7832d4b2a2aa72 Merge: 0006fa2d3fa03 77700b81bd0e4 Author: Takashi Iwai Date: Thu May 25 10:33:11 2023 +0200 Merge branch 'topic/midi20' into for-next Pull yet more fixes for UMP core. All about the legacy MIDI support code. Signed-off-by: Takashi Iwai commit 77700b81bd0e47d89d50eb4b3f2f323492f79998 Author: Takashi Iwai Date: Thu May 25 10:31:24 2023 +0200 ALSA: ump: Fix parsing of 0xFx command The MIDI 1.0 parser retrieved the 0xFx command with a wrong bit shift, resulting in the bogus type. Fix the bit shift size. Fixes: 0b5288f5fe63 ("ALSA: ump: Add legacy raw MIDI support") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/0fbc0b27-54b8-4cda-800e-37e7a03fed39@kili.mountain Suggested-by: Dan Carpenter Link: https://lore.kernel.org/r/20230525083124.15277-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit ab2335daa6ef70df56c98c216261a93e28ae52b3 Author: Takashi Iwai Date: Thu May 25 10:31:23 2023 +0200 ALSA: ump: Drop redundant check of note-on with zero velocity The check of a note-on event with zero velocity is done twice, and the latter one is superfluous. Let's drop it. Fixes: 0b5288f5fe63 ("ALSA: ump: Add legacy raw MIDI support") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/4683198a-84f6-4238-9e87-c70667d84523@kili.mountain Suggested-by: Dan Carpenter Link: https://lore.kernel.org/r/20230525083124.15277-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit ae4899bb486f73e6d3d55a82b40482b2c5529a98 Author: Russell King (Oracle) Date: Tue May 23 16:31:50 2023 +0100 net: phylink: provide phylink_pcs_config() and phylink_pcs_link_up() Add two helper functions for calling PCS methods. phylink_pcs_config() allows us to handle PCS configuration specifics in one location, rather than the two call sites. phylink_pcs_link_up() gives us consistency. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1q1TzK-007Exd-Rs@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit aaa3fc4ce98b7b37531c330f975270d27b1179ea Author: Rudraksha Gupta Date: Wed May 24 19:03:37 2023 -0400 dt-bindings: arm: qcom: Add missing msm8960 The list of supported 'SoC's didn't include msm8960 even though qcom,msm8960-cdp exists. Signed-off-by: Rudraksha Gupta Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524230338.120619-1-guptarud@gmail.com commit 0c4f10917d22e6f36080617bfe71de1ae854ee58 Author: Luca Weiss Date: Tue May 23 22:41:29 2023 +0200 arm64: dts: qcom: sdm632-fairphone-fp3: Add notification LED The phone features a notification LED connected to the pmi632. Configure the RGB led found on it. Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230414-pmi632-v3-2-079d2cada699@z3ntu.xyz commit a1f0f2ebb044c7248c3f30b98de0f151505bd4bd Author: Luca Weiss Date: Tue May 23 22:41:28 2023 +0200 arm64: dts: qcom: Add PMI632 PMIC The PMI632, commonly found on SoCs with SDM632 has various standard functions like ADC, GPIOs, LPG and more. Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230414-pmi632-v3-1-079d2cada699@z3ntu.xyz commit 8587d217ec3c09268d2023758e5fd6dbc3529c2b Author: Dylan Van Assche Date: Thu May 18 15:31:13 2023 +0200 arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs The SHIFT6mq (axolotl) is an SDM845-based smartphone with 2 flash LEDs. One LED is white, the other one is yellow. Define both LEDs in the DTS so they can be used as flash or torch and enable the flash LED controller to control them in PMI8998. Signed-off-by: Dylan Van Assche Reviewed-by: Konrad Dybcio Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230518133113.273880-4-me@dylanvanassche.be commit 9139bb56734a14c156d3ef736c22a06bd1a9d22c Author: Dylan Van Assche Date: Thu May 18 15:31:12 2023 +0200 arm64: dts: qcom: pmi8998: add flash LED controller Qualcomm PMIC PMI8998 has a 3 channel flash LED driver which is used by many phones for 1 or 2 flash LEDs. Each LED can be used in flash mode or torch mode. Add the flash LED controller node to PMI8998 DTS. Signed-off-by: Dylan Van Assche Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230518133113.273880-3-me@dylanvanassche.be commit b5de1a9ff1f2f90c7c1b9b243e754fea6ce1a8e1 Author: Bhupesh Sharma Date: Thu May 18 13:30:31 2023 +0530 arm64: dts: qcom: sm6115: Add CPU idle-states Add CPU idle-state nodes and power-domains in Qualcomm sm6115 SoC dtsi. Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230518080031.2509250-1-bhupesh.sharma@linaro.org commit 8bbd35771f903a9d14fe95bcba8c7b9f07aeb958 Author: Stephan Gerhold Date: Wed May 17 20:48:47 2023 +0200 arm64: dts: qcom: msm8916-pm8916: Mark always-on regulators Some of the regulators must be always-on to ensure correct operation of the system, e.g. PM8916 L2 for the LPDDR RAM, L5 for most digital I/O and L7 for the CPU PLL (strictly speaking the CPU PLL might only need an active-only vote but this is not supported for regulators in mainline currently). The RPM firmware seems to enforce that internally, these supplies stay on even if we vote for them to power off (and there is no other processor running). This means it's pointless to keep sending enable/disable requests because they will just be ignored. Also, drivers are much more likely to get a wrong impression of the regulator status, because regulator_is_enabled() will return false when there are no users, even though the regulator is always on. Describe this properly by marking the regulators as always-on. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230510-msm8916-regulators-v1-8-54d4960a05fc@gerhold.net commit b0a8f16ae4a0eb423122256691849b3ebc64efc2 Author: Stephan Gerhold Date: Wed May 17 20:48:46 2023 +0200 arm64: dts: qcom: msm8916: Define regulator constraints next to usage Right now each MSM8916 device has a huge block of regulator constraints with allowed voltages for each regulator. For lack of better documentation these voltages are often copied as-is from the vendor device tree, without much extra thought. Unfortunately, the voltages in the vendor device trees are often misleading or even wrong, e.g. because: - There is a large voltage range allowed and the actual voltage is only set somewhere hidden in some messy vendor driver. This is often the case for pm8916_{l14,l15,l16} because they have a broad range of 1.8-3.3V by default. - The voltage is actually wrong but thanks to the voltage constraints in the RPM firmware it still ends up applying the correct voltage. To have proper regulator constraints it is important to review them in context of the usage. The current setup in the MSM8916 device trees makes this quite hard because each device duplicates the standard voltages for components of the SoC and mixes those with minor device-specific additions and dummy voltages for completely unused regulators. The actual usage of the regulators for the SoC components is in msm8916-pm8916.dtsi, so it can and should also define the related voltage constraints. These are not board-specific but defined in the APQ8016E/PM8916 Device Specification. The board DT can then focus on describing the actual board-specific regulators, which makes it much easier to review and spot potential mistakes there. Note that this commit does not make any functional change. All used regulators still have the same regulator constraints as before. Unused regulators do not have regulator constraints anymore because most of these were too broad or even entirely wrong. They should be added back with proper voltage constraints when there is an actual usage. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230510-msm8916-regulators-v1-7-54d4960a05fc@gerhold.net commit f193264986b5944216e574b9962616f2524aac08 Author: Stephan Gerhold Date: Wed May 17 20:48:45 2023 +0200 arm64: dts: qcom: msm8916-pm8916: Clarify purpose Goal of the msm8916-pm8916.dtsi is to reduce the boilerplate necessary to create a device tree for a typical board with the MSM8916 SoC combined with the PM8916 PMIC. > 99% of all MSM8916 boards use the same standard setup where many of the PM8916 regulators have a fixed purpose and only some are left up for board-specific use. While MSM8916 (and perhaps MSM8939 soon) is currently the only platform with such an include, it has definitely proven useful. With more than 30 boards using it (not all of them upstream yet) it simplifies the review a lot and reduces the chance of configuring the standard components incorrectly. In preparation of extending its scope slightly, add a comment at the top that clearly explains what the .dtsi represents and when it should (or should not) be used. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230510-msm8916-regulators-v1-6-54d4960a05fc@gerhold.net commit 38218822a72fd31e89affc7fc457d527f65581aa Author: Stephan Gerhold Date: Wed May 17 20:48:44 2023 +0200 arm64: dts: qcom: pm8916: Move default regulator "-supply"s Some of the power supplies for the analog audio codec in PM8916 are wired externally. While most boards use the regulators currently specified in pm8916.dtsi, in theory it could be connected differently. We already have msm8916-pm8916.dtsi that models that standard setup used by most devices so move the -supply properties there and keep the base pm8916.dtsi independent. Currently all MSM8916 boards in mainline make use of msm8916-pm8916.dtsi, so it is not necessary to adjust any other boards. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230510-msm8916-regulators-v1-5-54d4960a05fc@gerhold.net commit a5cf21b14666c42912327c7bece38711f6e0d708 Author: Stephan Gerhold Date: Wed May 17 20:48:43 2023 +0200 arm64: dts: qcom: msm8916: Disable audio codecs by default Not every device has something connected to the digital audio codec in MSM8916 and/or the analog audio codec in PM8916. Disable those by default so the hardware is only powered up when necessary. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230510-msm8916-regulators-v1-4-54d4960a05fc@gerhold.net commit 355750828c5519c88de6ac0d09202d2a7e5892c5 Author: Stephan Gerhold Date: Wed May 17 20:48:42 2023 +0200 arm64: dts: qcom: msm8916: Fix regulator constraints The regulator constraints for most MSM8916 devices (except DB410c) were originally taken from Qualcomm's msm-3.10 vendor device tree (for lack of better documentation). Unfortunately it turns out that Qualcomm's voltages are slightly off as well and do not match the voltage constraints applied by the RPM firmware. This means that we sometimes request a specific voltage but the RPM firmware actually applies a much lower or higher voltage. This is particularly critical for pm8916_l11 which is used as SD card VMMC regulator: The SD card can choose a voltage from the current range of 1.8 - 2.95V. If it chooses to run at 1.8V we pretend that this is fine but the RPM firmware will still silently end up configuring 2.95V. This can be easily reproduced with a multimeter or by checking the SPMI hardware registers of the regulator. Fix this by making the voltages match the actual "specified range" in the PM8916 Device Specification which is enforced by the RPM firmware. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230510-msm8916-regulators-v1-3-54d4960a05fc@gerhold.net commit 5500f823db38db073d30557af159b77fb1f2bf26 Author: Stephan Gerhold Date: Wed May 17 20:48:41 2023 +0200 arm64: dts: qcom: apq8016-sbc: Fix 1.8V power rail on LS expansion The 96Boards specification expects a 1.8V power rail on the low-speed expansion connector that is able to provide at least 0.18W / 100 mA. According to the DB410c hardware user manual this is done by connecting both L15 and L16 in parallel with up to 55mA each (for 110 mA total) [1]. Unfortunately the current regulator setup in the DB410c device tree does not implement the specification correctly and only provides 5 mA: - Only L15 is marked always-on, so L16 is never enabled. - Without specifying a load the regulator is put into LPM where it can only provide 5 mA. Fix this by: - Adding proper voltage constraints for L16. - Making L16 always-on. - Adding regulator-system-load for both L15 and L16. 100 mA should be available in total, so specify 50 mA for each. (The regulator hardware can only be in normal (55 mA) or low-power mode (5 mA) so this will actually result in the expected 110 mA total...) [1]: https://www.96boards.org/documentation/consumer/dragonboard/dragonboard410c/hardware-docs/hardware-user-manual.md.html#power-supplies Cc: Srinivas Kandagatla Fixes: 828dd5d66f0f ("arm64: dts: apq8016-sbc: make 1.8v available on LS expansion") Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230510-msm8916-regulators-v1-2-54d4960a05fc@gerhold.net commit e27654df20d77ad7549a3cf6739ebaa3aa59a088 Author: Stephan Gerhold Date: Wed May 17 20:48:40 2023 +0200 arm64: dts: qcom: apq8016-sbc: Fix regulator constraints For some reason DB410c has completely bogus regulator constraints that actually just correspond to the programmable voltages which are already provided by the regulator driver. Some of them are not just outside the recommended operating conditions of the APQ8016E SoC but even exceed the absolute maximum ratings, potentially risking permanent device damage. In practice it's not quite as dangerous thanks to the RPM firmware: It turns out that it has its own voltage constraints and silently clamps all regulator requests. For example, requesting 3.3V for L5 (allowed by the current regulator constraints!) still results in 1.8V being programmed in the actual regulator hardware. Experimentation with various voltages shows that the internal RPM voltage constraints roughly correspond to the safe "specified range" in the PM8916 Device Specification (rather than the "programmable range" used inside apq8016-sbc.dtsi right now). Combine those together with some fixed voltages used in the old msm-3.10 device tree from Qualcomm to give DB410c some actually valid voltage constraints. Cc: Srinivas Kandagatla Fixes: 4c7d53d16d77 ("arm64: dts: apq8016-sbc: add regulators support") Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230510-msm8916-regulators-v1-1-54d4960a05fc@gerhold.net commit 05860f678c686afebc781c1fe8233bf997f2435b Author: Jianhua Lu Date: Wed May 17 21:33:40 2023 +0800 arm64: dts: qcom: sm8250-xiaomi-elish: remove redundant empty line Remove a redundant empty line introduced by commit 51c4c2bd6f31 ("arm64: dts: qcom: sm8250-xiaomi-elish-boe: Add mdss and dsi panel") Signed-off-by: Jianhua Lu Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517133340.21111-1-lujianhua000@gmail.com commit 9ef42640504e09ecc79530b6e532ebf48305516b Author: Kathiravan T Date: Wed May 17 12:58:06 2023 +0530 arm64: dts: qcom: ipq9574: add few device nodes Add QUP(SPI / I2C) peripheral, PRNG, WDOG and the remaining UART nodes. While at it, enable the SPI NOR in RDP433 board. Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517072806.13170-1-quic_kathirav@quicinc.com commit fdb0038e96659f08dae575aae6b4b6b22884d17b Author: Krzysztof Kozlowski Date: Tue May 16 17:45:39 2023 +0200 arm64: dts: qcom: sm8550-qrd: add display and panel Enable Display Subsystem with Visionox VTDR6130 Panel (same as on MTP8550). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516154539.238655-3-krzysztof.kozlowski@linaro.org commit fbeffa580e30fe7fb748e4ccc39c2b18a137c055 Author: Krzysztof Kozlowski Date: Tue May 16 17:45:38 2023 +0200 arm64: dts: qcom: sm8550-mtp: drop redundant MDP status MDP in sm8550.dtsi is not disabled (although its parent MDSS is), so board DTS does not have to enable it. Suggested-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516154539.238655-2-krzysztof.kozlowski@linaro.org commit 5ef00c06ea5e4e0de1f63d2c620f671750f73f9b Author: Krzysztof Kozlowski Date: Tue May 16 17:45:37 2023 +0200 arm64: dts: qcom: sm8550: enable DISPCC by default Enable the Display Clock Controller by default in SoC DTSI so unused clocks can be turned off. It does not require any external resources, so as core SoC component should be always available to boards. Suggested-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516154539.238655-1-krzysztof.kozlowski@linaro.org commit a158f00cdf68852850df231526ce0df0bb7dc1b4 Author: Krzysztof Kozlowski Date: Tue May 16 17:02:02 2023 +0200 arm64: dts: qcom: sm8550-qrd: add flash LEDs Enable PM8550 PMIC flash LED controller and add two flash LEDs using four current outputs. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516150202.188655-3-krzysztof.kozlowski@linaro.org commit cf51d2be057b19f2ef72233788c3211f0781678d Author: Krzysztof Kozlowski Date: Tue May 16 17:02:01 2023 +0200 arm64: dts: qcom: pm8550: add flash LED controller Add node for PM8550 PMIC flash LED controller. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516150202.188655-2-krzysztof.kozlowski@linaro.org commit fbd47f83c5a94f6e3772b4087c97292601857e68 Author: Luca Weiss Date: Tue May 16 08:56:14 2023 +0200 arm64: dts: qcom: sm6350: Move wifi node to correct place Somehow wifi was placed further up in the file than where it should be. Move it down so the nodes are sorted by reg again. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516-sm6350-order-v1-1-5c3b7c4cd761@fairphone.com commit ec8bb9c5b1c6963db3ed09e4a9148ae85804b962 Author: Konrad Dybcio Date: Tue May 16 02:53:06 2023 +0200 arm64: dts: qcom: sm8450: Add missing RPMhPD OPP levels We need more granularity for things like the GPU. Add the missing levels. This unfortunately requires some re-indexing, resulting in an ugly diff. Signed-off-by: Konrad Dybcio Reviewed-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516005306.952821-1-konrad.dybcio@linaro.org commit 4a9f8f8f2adaa05abfdec7c588c8dab3281048f0 Author: Nikita Travkin Date: Mon May 15 14:37:44 2023 +0500 arm64: dts: qcom: Add Acer Aspire 1 Acer Aspire 1 is a WoA laptop based on Snapdragon 7c gen1 platform. The laptop design is similar to trogdor in the choice of primary components but the specifics on usage of those differ slightly. Add the devicetree for the laptop with support for most of the hardware present. Signed-off-by: Nikita Travkin Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515093744.289045-5-nikita@trvn.ru commit aaffd364118bbc5b20c0a92f82780ea22e1c3f07 Author: Nikita Travkin Date: Mon May 15 14:37:43 2023 +0500 dt-bindings: arm: qcom: Add Acer Aspire 1 Acer Aspire 1 is a laptop based on sc7180. Document it's compatible. Signed-off-by: Nikita Travkin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515093744.289045-4-nikita@trvn.ru commit 39238382c4991d7d9442de4aa6636b19355be1e9 Author: Nikita Travkin Date: Mon May 15 14:37:42 2023 +0500 arm64: dts: qcom: sc7180: Drop redundant disable in mdp mdss is useless without a display controller which makes explicitly enabling mdp redundant. Have it enabled by default to drop the extra node for all users. Signed-off-by: Nikita Travkin Reviewed-by: Konrad Dybcio Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515093744.289045-3-nikita@trvn.ru commit 43926a3cb19180b4fc6cd0d72bbefc7e93592f91 Author: Nikita Travkin Date: Mon May 15 14:37:41 2023 +0500 arm64: dts: qcom: sc7180: Don't enable lpass clocks by default lpass clocks are usually blocked from HLOS by the firmware and instead are managed by the ADSP. Mark them as reserved and explicitly enable in the CrOS boards that have special, cooperative firmware. The IDP board gets lpass clocks disabled as it doesn't make use of sound anyway and might use Qualcomm firmware that blocks those clocks. [1] [1] https://lore.kernel.org/all/ZBJhmDd3zK%2FAiwBD@google.com/ Signed-off-by: Nikita Travkin Reviewed-by: Konrad Dybcio Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515093744.289045-2-nikita@trvn.ru commit a541667c86a9a0510d17f01461072a80fd6cfffd Author: Krzysztof Kozlowski Date: Fri May 12 18:04:52 2023 +0200 arm64: dts: qcom: sm8550-mtp: add WCD9385 audio-codec Add Qualcomm Aqstic WCD9385 audio codec on two Soundwire interfaces: RX and TX. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230512160452.206585-2-krzysztof.kozlowski@linaro.org commit 83fae950c9924112ee08792370934e7ab3acd782 Author: Krzysztof Kozlowski Date: Fri May 12 18:04:51 2023 +0200 arm64: dts: qcom: sm8550-qrd: add WCD9385 audio-codec Add Qualcomm Aqstic WCD9385 audio codec on two Soundwire interfaces: RX and TX. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230512160452.206585-1-krzysztof.kozlowski@linaro.org commit 06a9f50c20b5d5fcec9cb0d44b759c4183c7bbd5 Author: Yang Xiwen Date: Sat May 6 00:32:51 2023 +0800 arm64: dts: qcom: msm8916-ufi: make UDC dual mode It's possible to use this device with a (non-standard) hub to get USB working in host mode, but dr_mode="peripheral" prevents the UDC to do so. Remove dr_mode="peripheral" and add usb-role-switch so that it defaults to otg mode and can be switched to host mode in userspace. Signed-off-by: Yang Xiwen Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/TYZPR04MB632102315884225B7343533B96729@TYZPR04MB6321.apcprd04.prod.outlook.com commit a5317b23fe6f26307f4c821d56d694c893887675 Author: Luca Weiss Date: Sat Apr 22 13:39:16 2023 +0200 arm64: dts: qcom: msm8953: Add BLSP DMAs for I2C MSM8953 has two DMA controllers for the various I2C, SPI and UART busses. Add the nodes and configure all the I2C nodes so that the driver can use the DMA. Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230422-msm8953-blsp-dma-v1-1-0024801bb587@z3ntu.xyz commit 5a60e72c3eff0747cc779b8067cd795acf6beecd Author: Luca Weiss Date: Fri Apr 21 23:56:22 2023 +0200 arm64: dts: qcom: pm8953: add GPIOs Add a node for the GPIOs found on the pm8953. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230421-pm8953-gpio-v1-3-3d33e2de47e3@z3ntu.xyz commit 188e26bc67896cb89aca0821b366833e9abf829e Author: Krzysztof Kozlowski Date: Thu Apr 20 08:36:10 2023 +0200 arm64: dts: qcom: sm6125: add unit address to soc node "soc" node is supposed to have unit address: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420063610.11068-7-krzysztof.kozlowski@linaro.org commit cefb40777a6c695e754d918cf5a5551169e40965 Author: Krzysztof Kozlowski Date: Thu Apr 20 08:36:09 2023 +0200 arm64: dts: qcom: sdm630: add unit address to soc node "soc" node is supposed to have unit address: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420063610.11068-6-krzysztof.kozlowski@linaro.org commit 77462beddbfc700d36fe1f24d77b545fe3d6db44 Author: Krzysztof Kozlowski Date: Thu Apr 20 08:36:08 2023 +0200 arm64: dts: qcom: msm8998: add unit address to soc node "soc" node is supposed to have unit address: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420063610.11068-5-krzysztof.kozlowski@linaro.org commit b67f5c337f894109a8a9c40f7dbb74de9cf07d57 Author: Krzysztof Kozlowski Date: Thu Apr 20 08:36:07 2023 +0200 arm64: dts: qcom: msm8996: add unit address to soc node "soc" node is supposed to have unit address: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420063610.11068-4-krzysztof.kozlowski@linaro.org commit f7fd546dd693f64404bbbdc154b3dac0aee1f3bb Author: Krzysztof Kozlowski Date: Thu Apr 20 08:36:06 2023 +0200 arm64: dts: qcom: msm8994: add unit address to soc node "soc" node is supposed to have unit address: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420063610.11068-3-krzysztof.kozlowski@linaro.org commit da6aa1111a17db11367817ddc10c5a6c188cdc44 Author: Krzysztof Kozlowski Date: Thu Apr 20 08:36:05 2023 +0200 arm64: dts: qcom: ipq8074: add unit address to soc node "soc" node is supposed to have unit address: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420063610.11068-2-krzysztof.kozlowski@linaro.org commit 393595d4ffbd0a1fafd5548f8de1b8487a037cf2 Author: Krzysztof Kozlowski Date: Thu Apr 20 08:36:04 2023 +0200 arm64: dts: qcom: ipq6018: add unit address to soc node "soc" node is supposed to have unit address: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230420063610.11068-1-krzysztof.kozlowski@linaro.org commit 4a0156b8862665a3e31c8280607388e3001ace3d Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:56 2023 +0200 arm64: dts: qcom: sdm845-polaris: add missing touchscreen child node reg Add missing reg property to touchscreen child node to fix dtbs W=1 warnings: Warning (unit_address_vs_reg): /soc@0/geniqup@ac0000/i2c@a98000/touchscreen@20/rmi4-f12@12: node has a unit name, but no reg or ranges property Fixes: be497abe19bf ("arm64: dts: qcom: Add support for Xiaomi Mi Mix2s") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Reviewed-by: Molly Sophia Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-18-krzysztof.kozlowski@linaro.org commit 950a4fe6ec8498799d1c7bd31a489a718f94a87e Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:55 2023 +0200 arm64: dts: qcom: sm8550: correct pinctrl unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/pinctrl@f000000: simple-bus unit address format error, expected "f100000" Fixes: ffc50b2d3828 ("arm64: dts: qcom: Add base SM8550 dtsi") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-17-krzysztof.kozlowski@linaro.org commit 3cbf49ef16962ab6d99a3659cb34a33c5f147b50 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:54 2023 +0200 arm64: dts: qcom: sm8550: correct crypto unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/crypto@1de0000: simple-bus unit address format error, expected "1dfa000" Fixes: 433477c3bf0b ("arm64: dts: qcom: sm8550: add QCrypto nodes") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-16-krzysztof.kozlowski@linaro.org commit a560ab70c6e28ba784a824611d3f58969d8fadba Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:53 2023 +0200 arm64: dts: qcom: sm8350: correct USB phy unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/phy@88e9000: simple-bus unit address format error, expected "88e8000" Fixes: 2458a305e80e ("arm64: dts: qcom: sm8350: switch to combo usb3/dp phy") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-15-krzysztof.kozlowski@linaro.org commit ab98c21bc9246f421a6ae70e69f1b73cea6f85e3 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:52 2023 +0200 arm64: dts: qcom: sm8350: correct PCI phy unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/phy@1c0f000: simple-bus unit address format error, expected "1c0e000" Fixes: 6daee40678a0 ("arm64: dts: qcom: sm8350: add PCIe devices") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-14-krzysztof.kozlowski@linaro.org commit 41d6bca799b3f40d4d3c22dd4545aeac7c210e33 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:51 2023 +0200 arm64: dts: qcom: sm8350: correct DMA controller unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/dma-controller@900000: simple-bus unit address format error, expected "9800000" Fixes: bc08fbf49bc8 ("arm64: dts: qcom: sm8350: Define GPI DMA engines") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-13-krzysztof.kozlowski@linaro.org commit 2358b43256080459fcc5642265ed4fec75558f8c Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:50 2023 +0200 arm64: dts: qcom: sm6115: correct thermal-sensor unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/thermal-sensor@4410000: simple-bus unit address format error, expected "4411000" Fixes: 7b74cba6b13f ("arm64: dts: qcom: sm6115: Add TSENS node") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-12-krzysztof.kozlowski@linaro.org commit a05b913a27e46926ba60ba2bcacc7ec7a8403e4c Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:49 2023 +0200 arm64: dts: qcom: sdm845: correct camss unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/camss@a00000: simple-bus unit address format error, expected "acb3000" Fixes: d48a6698a6b7 ("arm64: dts: qcom: sdm845: Add CAMSS ISP node") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-11-krzysztof.kozlowski@linaro.org commit c8b7faa7e9913a94444b3f00b6480e53a174fcfd Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:48 2023 +0200 arm64: dts: qcom: sdm630: correct camss unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc/camss@ca00000: simple-bus unit address format error, expected "ca00020" Fixes: f3d5d3cc6971 ("arm64: dts: qcom: sdm630: Configure the camera subsystem") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-10-krzysztof.kozlowski@linaro.org commit e959ced1d0e5ef0b1f66a0c2d0e1ae80790e5ca5 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:47 2023 +0200 arm64: dts: qcom: msm8996: correct camss unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc/camss@a00000: simple-bus unit address format error, expected "a34000" Fixes: e0531312e78f ("arm64: dts: qcom: msm8996: Add CAMSS support") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-9-krzysztof.kozlowski@linaro.org commit 24f0f6a8059c7108d4ee3476c95db1e7ff4feb79 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:46 2023 +0200 arm64: dts: qcom: msm8994: correct SPMI unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc/spmi@fc4c0000: simple-bus unit address format error, expected "fc4cf000" Fixes: b0ad598f8ec0 ("arm64: dts: qcom: msm8994: Add SPMI PMIC arbiter device") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-8-krzysztof.kozlowski@linaro.org commit 80284797a4cb8ceae71e3c403bafc6648263a060 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:45 2023 +0200 arm64: dts: qcom: msm8976: correct MMC unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/mmc@7824000: simple-bus unit address format error, expected "7824900" Warning (simple_bus_reg): /soc@0/mmc@7864000: simple-bus unit address format error, expected "7864900" Warning (simple_bus_reg): /soc@0/mmc@7a24000: simple-bus unit address format error, expected "7a24900" Fixes: 0484d3ce0902 ("arm64: dts: qcom: Add DTS for MSM8976 and MSM8956 SoCs") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Marijn Suijten Reviewed-by: Konrad Dybcio Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-7-krzysztof.kozlowski@linaro.org commit 751038676e3075a5cb816034f7d5ba6e95f4486d Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:44 2023 +0200 arm64: dts: qcom: msm8953: correct WCNSS unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/remoteproc@a21b000: simple-bus unit address format error, expected "a204000" Fixes: b12428640ebe ("arm64: dts: MSM8953: Add wcnss nodes") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-6-krzysztof.kozlowski@linaro.org commit 1c06b93461ec9df8a5878947db4a9d2d1cb72855 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:43 2023 +0200 arm64: dts: qcom: msm8953: correct IOMMU unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/iommu@1e00000: simple-bus unit address format error, expected "1e20000" Fixes: c0b9575a3606 ("arm64: dts: qcom: msm8953: add APPS IOMMU") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-5-krzysztof.kozlowski@linaro.org commit 1f9a41bb0bba7b373c26a6f2cc8d35cc3159c861 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:42 2023 +0200 arm64: dts: qcom: msm8916: correct WCNSS unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/remoteproc@a21b000: simple-bus unit address format error, expected "a204000" Fixes: 88106096cbf8 ("ARM: dts: msm8916: Add and enable wcnss node") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-4-krzysztof.kozlowski@linaro.org commit 72644bc76d5145c098c268829554a0b98fab1de1 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:41 2023 +0200 arm64: dts: qcom: msm8916: correct MMC unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/mmc@7824000: simple-bus unit address format error, expected "7824900" Warning (simple_bus_reg): /soc@0/mmc@7864000: simple-bus unit address format error, expected "7864900" Fixes: c4da5a561627 ("arm64: dts: qcom: Add msm8916 sdhci configuration nodes") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-3-krzysztof.kozlowski@linaro.org commit 48798d992ce276cf0d57bf75318daf8eabd02aa4 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:40 2023 +0200 arm64: dts: qcom: msm8916: correct camss unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc@0/camss@1b00000: simple-bus unit address format error, expected "1b0ac00" Fixes: 58f479f90a7c ("arm64: dts: qcom: msm8916: Add CAMSS support") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-2-krzysztof.kozlowski@linaro.org commit 085058786a7890dd44ec623fe5ac74db870f6b93 Author: Krzysztof Kozlowski Date: Wed Apr 19 23:18:39 2023 +0200 arm64: dts: qcom: ipq6018: correct qrng unit address Match unit-address to reg entry to fix dtbs W=1 warnings: Warning (simple_bus_reg): /soc/qrng@e1000: simple-bus unit address format error, expected "e3000" Fixes: 5bf635621245 ("arm64: dts: ipq6018: Add a few device nodes") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230419211856.79332-1-krzysztof.kozlowski@linaro.org commit 935e538fd6b8e30151ee822313c01005bd2865ad Author: Arnaud Vrac Date: Mon Apr 17 18:49:46 2023 +0200 arm64: dts: qcom: msm8998: add blsp spi nodes Add pinctrl and qup nodes in msm8998 device tree to support spi. Values were ported from downstream msm-4.4 kernel. Signed-off-by: Arnaud Vrac Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417-msm8998-spi-v2-1-b314c6d9ea31@freebox.fr commit 3e459be2a315dd017cbed6a86c23e636987b493f Author: Konrad Dybcio Date: Thu Apr 13 02:37:36 2023 +0200 arm64: dts: qcom: msm8996-tone: Enable LPG LEDs Enable the notification LED(s) wired up to the PMI8994(6) LPG. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230413-tone_led-v1-1-bc3c73393bfa@linaro.org commit 6ce42cb4b7dc67fdb670930cc72732fa3fc8df2e Author: Konrad Dybcio Date: Wed Apr 12 22:24:51 2023 +0200 arm64: dts: qcom: sm8250-edo: Enable Venus Enable Venus on Edo phones. The firmware is signed, as per usual. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230412-edo_venus-v1-1-bcfc82e0efc3@linaro.org commit 644ab8bb42b596f16d01fb140088afb616f67cd8 Author: Konrad Dybcio Date: Tue Apr 11 20:14:44 2023 +0200 arm64: dts: qcom: sm8150-kumano: Enable SDHCI2 Set up and enable SDHCI2 to enable the microSD slot on Kumano devices. Signed-off-by: Konrad Dybcio Reviewed-by: Marijn Suijten Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230315-topic-kumano_dts0-v2-4-0ca7fa521b86@linaro.org commit 7a740ec3045bfa3b476ea94dd2d70bc3ac5d0a0f Author: Konrad Dybcio Date: Tue Apr 11 20:14:43 2023 +0200 arm64: dts: qcom: sm8150-kumano: Set up camera fixed regulators Sony - as per usual - used a whole bunch of GPIO-gated fixed voltage regulators for camera sensors on Kumano. Describe them and the corresponding pins. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230315-topic-kumano_dts0-v2-3-0ca7fa521b86@linaro.org commit b949d8032fa287633faf895dc3669a7fd6720071 Author: Konrad Dybcio Date: Tue Apr 11 20:14:42 2023 +0200 arm64: dts: qcom: sm8150-kumano: Add GPIO line names for TLMM Sony ever so graciously provides GPIO line names in their downstream kernel (though sometimes they are not 100% accurate and you can judge that by simply looking at them and with what drivers they are used). Add these to the common DTSI to better document the hardware. The pin assignment for TLMM is identical on both devices. Great job! Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230315-topic-kumano_dts0-v2-2-0ca7fa521b86@linaro.org commit 20fd55b2b0acd496cc6d3cb98832fe2438939ac4 Author: Konrad Dybcio Date: Tue Apr 11 20:14:41 2023 +0200 arm64: dts: qcom: sm8150-kumano: Add GPIO line names for PMIC GPIOs Sony ever so graciously provides GPIO line names in their downstream kernel (though sometimes they are not 100% accurate and you can judge that by simply looking at them and with what drivers they are used). Add these to the Griffin and Bahamut device trees to better document the hardware. They are the same on both devices! Very nice! Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230315-topic-kumano_dts0-v2-1-0ca7fa521b86@linaro.org commit d9ef7a805a709a0b07341857d97a25598a7f92da Author: Dmitry Baryshkov Date: Sun Apr 9 21:21:45 2023 +0300 arm64: dts: qcom: pm8998: don't use GIC_SPI for SPMI interrupts Unlike typical GIC interrupts, first cell for SPMI interrupts is the USID rather than GIC_SPI/GIC_PPI/GIC_LPI qualifier. Fix the resin interrupt to use USID value 0x0 rather than GIC_SPI define. Fixes: f86ae6f23a9e ("arm64: dts: qcom: sagit: add initial device tree for sagit") Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230409182145.122895-1-dmitry.baryshkov@linaro.org commit 22ff170d4551756e3e4ef57253c43e8c3fffefed Author: Jagadeesh Kona Date: Wed May 24 20:22:03 2023 +0530 arm64: dts: qcom: sm8550: Add video clock controller Add device node for video clock controller on Qualcomm SM8550 platform. Signed-off-by: Jagadeesh Kona Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524145203.13153-5-quic_jkona@quicinc.com commit 3c678552b00f90387de14ae965ab6c0bafe8ea12 Author: Taniya Das Date: Wed May 24 19:36:56 2023 +0530 arm64: dts: qcom: sm8450: Add video clock controller Add device node for video clock controller on Qualcomm SM8450 platform. Signed-off-by: Taniya Das Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524140656.7076-4-quic_tdas@quicinc.com commit e23893dbc304a2a35ecbaeabbc7d0fb20fc6acd8 Merge: cb0c14dae63fa 1e910b2ba0edd Author: Bjorn Andersson Date: Wed May 24 21:50:07 2023 -0700 Merge branch '20230524140656.7076-2-quic_tdas@quicinc.com' into HEAD Merge the SM8450 Video Clock Controller DeviceTree binding topic branch in order to get access to the clock constants defined by the binding. commit 7a52084ae14f49582b0ce19106cdad094499e204 Author: Krzysztof Kozlowski Date: Tue May 16 12:52:41 2023 +0200 dt-bindings: clock: qcom,gcc-sc7280: document CX power domain The GCC clock controller needs CX power domain, at least according to DTS: sc7280-herobrine-crd-pro.dtb: clock-controller@100000: Unevaluated properties are not allowed ('power-domains' was unexpected) Acked-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516105241.30091-3-krzysztof.kozlowski@linaro.org commit 21a95637a3fda45e6d3fd7a57d6ada204e28e484 Author: Krzysztof Kozlowski Date: Tue May 16 12:52:40 2023 +0200 dt-bindings: clock: qcom,gcc-sc7180: document CX power domain The GCC clock controller needs CX power domain, at least according to DTS: sc7180-trogdor-pompom-r3.dtb: clock-controller@100000: Unevaluated properties are not allowed ('power-domains' was unexpected) Acked-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516105241.30091-2-krzysztof.kozlowski@linaro.org commit 2310ab77f1ee2611e34345ca1746c9e8aaa5bc31 Author: Krzysztof Kozlowski Date: Tue May 16 12:52:39 2023 +0200 dt-bindings: clock: qcom,gcc-sm8250: add missing bi_tcxo_ao clock The initial SM8250 GCC driver added in commit 3e5770921a88 ("clk: qcom: gcc: Add global clock controller driver for SM8250") already consumed it on the clock. This fixes warnings like: sm8250-xiaomi-elish-csot.dtb: clock-controller@100000: clock-names: ['bi_tcxo', 'bi_tcxo_ao', 'sleep_clk'] is too long Fixes: 98394efb48f5 ("dt-bindings: clock: Add SM8250 GCC clock bindings") Reviewed-by: Konrad Dybcio Acked-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516105241.30091-1-krzysztof.kozlowski@linaro.org commit ab7f00379fe90506e5e9af4e03e6935fb8deb9fd Author: Krzysztof Kozlowski Date: Sun May 14 13:47:11 2023 +0200 clk: qcom: restrict drivers per ARM/ARM64 There is no point to allow selecting clock controller drivers for Qualcomm ARMv7 SoCs when building ARM64 kernel, and vice versa. This makes kernel configuration more difficult as many do not remember the Qualcomm SoCs model names/numbers. No features should be lost because: 1. There won't be a single image for ARMv7 and ARMv8/9 SoCs. 2. Newer ARMv8/9 SoCs won't be running in arm32 emulation mode. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230514114711.18258-1-krzysztof.kozlowski@linaro.org commit 108cdc09b2dea5110533bba495b6953ca9c7c2a9 Author: Imran Shaik Date: Fri May 12 17:53:47 2023 +0530 clk: qcom: Add GCC driver support for SDX75 Add Global Clock Controller (GCC) support for SDX75 platform. Signed-off-by: Imran Shaik Signed-off-by: Taniya Das Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230512122347.1219-6-quic_tdas@quicinc.com commit 1c2360ff58162ab3a91c619ab8172c0061174151 Author: Imran Shaik Date: Fri May 12 17:53:46 2023 +0530 clk: qcom: rpmh: Add RPMH clocks support for SDX75 Add support for RPMH clocks for SDX75 platform. Signed-off-by: Imran Shaik Signed-off-by: Taniya Das Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230512122347.1219-5-quic_tdas@quicinc.com commit 379d72721bc4308fbc038e9858b7d2e9191725b5 Author: Imran Shaik Date: Fri May 12 17:53:45 2023 +0530 dt-bindings: clock: qcom: Add RPMHCC for SDX75 Add compatible string for qcom RPMHCC for SDX75 platform. Signed-off-by: Imran Shaik Signed-off-by: Taniya Das Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230512122347.1219-4-quic_tdas@quicinc.com commit 9092d1083a6253757c7f9449340173443c81768c Author: Imran Shaik Date: Fri May 12 17:53:43 2023 +0530 clk: qcom: branch: Extend the invert logic for branch2 clocks Add support to handle the invert logic for branch2 clocks. Invert branch halt would indicate the clock ON when CLK_OFF bit is '1' and OFF when CLK_OFF bit is '0'. Signed-off-by: Imran Shaik Signed-off-by: Taniya Das Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230512122347.1219-2-quic_tdas@quicinc.com commit 521302ca64f28161c12cb29949566a450d24a98f Merge: e9a2db5caf9f2 1c305ea86bc32 Author: Bjorn Andersson Date: Wed May 24 21:02:47 2023 -0700 Merge branch '20230512122347.1219-3-quic_tdas@quicinc.com' into clk-for-6.5 Merge SDX75 Global Clock Controller DeviceTree binding through a topic branch, to allow inclusion in DeviceTree source as well. commit e9a2db5caf9f219d9cf570cb0965710344c85519 Author: Luca Weiss Date: Sat May 6 22:10:32 2023 +0200 clk: qcom: smd-rpm: conditionally enable scaling before doing handover On older platforms like msm8226, msm8974 and msm8916 the driver in the downstream kernel enables scaling first before doing the handover of the clocks. While this normally doesn't seem to cause noticeable problems, on apq8026-asus-sparrow this causes the device to immediately reboot, perhaps due to older rpm firmware that becomes unhappy. On newer platforms the order has swapped and enabling scaling is done after the handover, so let's introduce this behavior only conditionally for msm8226 and msm8974 for now. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230506-rpmcc-scaling-handover-v1-1-374338a8dfd9@z3ntu.xyz commit bbd899f53412b79cbc46e7144437bb75302b1b80 Author: Christian Marangi Date: Mon Apr 17 19:44:08 2023 +0200 clk: qcom: gcc-sdm660: drop redundant F define The same exact F frequency table entry is defined in clk-rcg.h Drop the redundant define to cleanup code. Signed-off-by: Christian Marangi Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417174408.23722-2-ansuelsmth@gmail.com commit 923f7d678b2ae3d522543058514d5605c185633b Author: Christian Marangi Date: Mon Apr 17 19:44:07 2023 +0200 clk: qcom: gcc-ipq6018: drop redundant F define The same exact F frequency table entry is defined in clk-rcg.h Drop the redundant define to cleanup code. Signed-off-by: Christian Marangi Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417174408.23722-1-ansuelsmth@gmail.com commit 2f9b2096465da9f7eada1c3b297689b666a015cf Author: Krzysztof Kozlowski Date: Sat Apr 8 16:37:29 2023 +0200 dt-bindings: clock: qcom,gcc-msm8953: split to separate schema The Qualcomm MSM8953 GCC clock controller has clock inputs, thus existing gcc-other.yaml was not describing it fully. Move the binding to its own schema file and document the clocks based on DTS. Add driver contributors as its maintainers. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230408143729.84097-1-krzysztof.kozlowski@linaro.org commit 7bf654a0d95e75b415f454e10627309d650762d0 Author: Konrad Dybcio Date: Mon Apr 3 19:48:07 2023 +0200 clk: qcom: gcc-qcm2290: Mark RCGs shared where applicable The vast majority of shared RCGs were not marked as such. Fix it. Fixes: 496d1a13d405 ("clk: qcom: Add Global Clock Controller driver for QCM2290") Signed-off-by: Konrad Dybcio Acked-by: Shawn Guo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230403174807.345185-1-konrad.dybcio@linaro.org commit f53153a37969c185d51e388ad51a23807e2605a1 Author: Jagadeesh Kona Date: Wed May 24 20:22:02 2023 +0530 clk: qcom: videocc-sm8550: Add video clock controller driver for SM8550 Add support for the video clock controller for video clients to be able to request for videocc clocks on SM8550 platform. Co-developed-by: Taniya Das Signed-off-by: Taniya Das Signed-off-by: Jagadeesh Kona Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524145203.13153-4-quic_jkona@quicinc.com commit c7d91f26f0f70f03a09bb6cdbfa1b7df28ab121e Author: Jagadeesh Kona Date: Wed May 24 20:22:01 2023 +0530 dt-bindings: clock: qcom: Add SM8550 video clock controller Add compatible string for SM8550 video clock controller. Signed-off-by: Jagadeesh Kona Acked-by: Conor Dooley Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524145203.13153-3-quic_jkona@quicinc.com commit 34d54e5833db4cfa4d18cc0a4b6f86fe4730a47d Author: Jagadeesh Kona Date: Wed May 24 20:22:00 2023 +0530 clk: qcom: clk-alpha-pll: Add support to configure PLL_TEST_CTL_U2 The lucid ole pll reuses lucid evo ops but it has an additional test control register which is required to be programmed, add support to program the same. Signed-off-by: Jagadeesh Kona Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524145203.13153-2-quic_jkona@quicinc.com commit 441fe711be3842552e32fe884bd9f47f170892cb Author: Taniya Das Date: Wed May 24 19:36:55 2023 +0530 clk: qcom: videocc-sm8450: Add video clock controller driver for SM8450 Add support for the video clock controller driver for peripheral clock clients to be able to request for video cc clocks. Signed-off-by: Taniya Das Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524140656.7076-3-quic_tdas@quicinc.com commit cc8d2cf5cd6268c297ede3490b9dad0b9e23ab13 Merge: fd0b5b106fcab 1e910b2ba0edd Author: Bjorn Andersson Date: Wed May 24 21:44:51 2023 -0700 Merge branch '20230524140656.7076-2-quic_tdas@quicinc.com' into HEAD Merge the SM8450 Video Clock Controller DeviceTree binding through a topic branch, in order to be able to use the introduced constants in changes on DeviceTree source branch as well. commit fd0b5b106fcab4b1127c72eb818e0e24f0447fc7 Author: Konrad Dybcio Date: Thu Apr 20 19:32:51 2023 +0200 clk: qcom: Introduce SM8350 VIDEOCC Add support for the Video Clock Controller found on the SM8350 SoC. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230413-topic-lahaina_vidcc-v4-2-86c714a66a81@linaro.org commit 6d6a98aaa76f46dc91ac2f2bcd628ceb8bf95460 Merge: 56e5ae0116aef 2aae5eaa941e3 Author: Bjorn Andersson Date: Wed May 24 21:46:48 2023 -0700 Merge branch '20230413-topic-lahaina_vidcc-v4-1-86c714a66a81@linaro.org' into HEAD Merge the Video Clock Controller DeviceTree bindings through a topic branch, in order to be able to use the introduced constants in the DeviceTree source branch as well. commit 2aae5eaa941e356b5f6e78c207c7dc3a93286622 Author: Konrad Dybcio Date: Thu Apr 20 19:32:50 2023 +0200 dt-bindings: clock: Add SM8350 VIDEOCC SM8350, like most recent higher-end chips has a separate clock controller block just for the Venus IP. Document it. The binding was separated as the driver, unlike the earlier ones, doesn't expect clock-names to keep it easier to maintain. Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230413-topic-lahaina_vidcc-v4-1-86c714a66a81@linaro.org commit 1e910b2ba0edd639cc89b5495a3a832b28f77c7f Author: Taniya Das Date: Wed May 24 19:36:54 2023 +0530 dt-bindings: clock: qcom: Add SM8450 video clock controller Add device tree bindings for the video clock controller on Qualcomm SM8450 platform. Signed-off-by: Taniya Das Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230524140656.7076-2-quic_tdas@quicinc.com commit 2e43c85b0d96c6ae2ab60132313bb7a814bcfb44 Author: Konrad Dybcio Date: Mon May 22 23:23:39 2023 +0200 MAINTAINERS: Add Konrad Dybcio as linux-arm-msm co-maintainer As discussed with Bjorn Andersson in private, step up to co-maintainership. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230522-topic-maintainers-v1-1-2b91eb8e4f65@linaro.org commit 13ac2620f0c0ee7f463a486baf5a56ab9d8b7fdb Author: Matti Lehtimäki Date: Sat May 20 15:19:30 2023 +0300 dt-bindings: sram: qcom,imem: Document MSM8226 Add compatible for MSM8226 IMEM. Signed-off-by: Matti Lehtimäki Acked-by: Conor Dooley Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230520121933.15533-2-matti.lehtimaki@gmail.com commit 1c305ea86bc32b3f38413ef3dbb1f3c288da024e Author: Imran Shaik Date: Fri May 12 17:53:44 2023 +0530 dt-bindings: clock: qcom: Add GCC clocks for SDX75 Add support for qcom global clock controller bindings for SDX75 platform. Signed-off-by: Imran Shaik Signed-off-by: Taniya Das Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230512122347.1219-3-quic_tdas@quicinc.com commit 311bbc884b2edcf584b67d331be85ce43b27586f Author: Krzysztof Kozlowski Date: Mon Apr 10 19:52:32 2023 +0200 ARM: dts: qcom: msm8974: do not use underscore in node name (again) Align RPM requests node with DT schema by using hyphen instead of underscore. Fixes: f300826d27be ("ARM: dts: qcom-msm8974: Sort and clean up nodes") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230410175232.22317-1-krzysztof.kozlowski@linaro.org commit 7f6e0028a0ca4317aeb070084e72d44ca39ace7e Author: Kathiravan T Date: Tue May 9 09:05:31 2023 +0530 soc: qcom: socinfo: Add Soc ID for IPQ5312 and IPQ5302 Add the SoC ID for IPQ5312 and IPQ5302, which belong to the family of IPQ5332 SoC. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230509033531.21468-3-quic_kathirav@quicinc.com commit fe78d73a914d86070ac15c9a6d1f885ce5bc4a69 Author: Kathiravan T Date: Tue May 9 09:05:30 2023 +0530 dt-bindings: arm: qcom,ids: add SoC ID for IPQ5312 and IPQ5302 Add the SoC ID for IPQ5312 and IPQ5302, which belong to the family of IPQ5332 SoC. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230509033531.21468-2-quic_kathirav@quicinc.com commit 0369a5906e46a2431a8fe04aa79cba6583e53e73 Author: Robert Marko Date: Sat Apr 29 21:33:36 2023 +0200 soc: qcom: socinfo: Add IDs for IPQ5018 family Add SOC IDs for the IPQ5018 family. Signed-off-by: Robert Marko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230429193336.600629-2-robimarko@gmail.com commit e5b03cd101bd3dbbc7cbbe4c6e55a37070386494 Author: Robert Marko Date: Sat Apr 29 21:33:35 2023 +0200 dt-bindings: arm: qcom,ids: Add IDs for IPQ5018 family Add SOC IDs for the IPQ5018 family. Signed-off-by: Robert Marko Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230429193336.600629-1-robimarko@gmail.com commit a77b2a0b12801a232226d227636236ed89b77043 Author: Konrad Dybcio Date: Thu Apr 20 19:36:18 2023 +0200 soc: qcom: Introduce RPM master stats driver Introduce a driver to query and expose detailed, per-subsystem (as opposed to the existing qcom_stats driver which exposes SoC-wide data) about low power mode states of a given RPM master. That includes the APSS (ARM), MPSS (modem) and other remote cores, depending on the platform configuration. This is a vastly cleaned up and restructured version of a similar driver found in msm-5.4. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230405-topic-master_stats-v6-2-2277b4433748@linaro.org commit 0be4392435a6a0e16b3eb56a8815ebdbcd44e1a7 Author: Konrad Dybcio Date: Thu Apr 20 19:36:17 2023 +0200 dt-bindings: soc: qcom: Add RPM Master stats The RPM MSG RAM contains per-RPM-master (e.g. APPS, ADSP etc.) sleep statistics. They let one assess which core is actively preventing the system from entering a true low-power mode. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230405-topic-master_stats-v6-1-2277b4433748@linaro.org commit 56310520308ab863030e9baa9a8f63bb31c94e27 Author: Tejun Heo Date: Thu Apr 20 16:50:38 2023 -1000 soc: qcom: qmi: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Cc: Andy Gross Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230421025046.4008499-15-tj@kernel.org commit c72e31718a8fb9bc070ee99f273446e05caa687d Author: Uwe Kleine-König Date: Sat Apr 15 22:18:48 2023 +0200 soc: qcom: ramp_controller: Improve error message for failure in .remove() When a platform_driver's .remove() callback returns an error, the driver core emits remove callback returned a non-zero value. This will be ignored. . Replace this by a more specific error message. Then convert to .remove_new() which is equivalent to returning zero unconditionally in .remove(). See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for its rationale. Signed-off-by: Uwe Kleine-König Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230415201848.3779001-1-u.kleine-koenig@pengutronix.de commit 1252ea653bff14eb1a2184245a977ecb8505be68 Author: Krzysztof Kozlowski Date: Mon Apr 10 20:10:36 2023 +0200 dt-bindings: soc: qcom: smd-rpm: allow MSM8226 over SMD The MSM8226 RPM uses SMD, so it must allow qcom,smd-channels: qcom-msm8226-samsung-s3ve3g.dtb: rpm-requests: qcom,smd-channels: False schema does not allow ['rpm_requests'] Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230410181036.25943-1-krzysztof.kozlowski@linaro.org commit 4b819e7e89fedc90150a78152bfa6e6e3534e64b Author: Min-Hua Chen Date: Tue May 23 00:07:56 2023 +0800 soc: qcom: rpmpd: use correct __le32 type Use cpu_to_le32 to cast constants to __le32 before comparing them with __le32 type pd->key. This fixes the following sparse warnings: drivers/soc/qcom/rpmpd.c:895:31: sparse: warning: restricted __le32 degrades to integer drivers/soc/qcom/rpmpd.c:896:15: sparse: warning: restricted __le32 degrades to integer Signed-off-by: Min-Hua Chen Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230522160757.284165-1-minhuadotchen@gmail.com commit 56e5ae0116aef87273cf1812d608645b076e4f02 Author: Mantas Pucka Date: Tue Apr 25 12:11:49 2023 +0300 clk: qcom: gcc-ipq6018: Use floor ops for sdcc clocks SDCC clocks must be rounded down to avoid overclocking the controller. Fixes: d9db07f088af ("clk: qcom: Add ipq6018 Global Clock Controller support") Signed-off-by: Mantas Pucka Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1682413909-24927-1-git-send-email-mantas@8devices.com commit cb0c14dae63fae037db41174fc95a59dea0ecf77 Author: Robert Marko Date: Wed Apr 26 20:56:47 2023 +0200 arm64: dts: qcom: ipq8074: Add QUP5 SPI node Add node to support the QUP5 SPI controller inside of IPQ8074. Some devices use this bus in order to manage external switches. Signed-off-by: Robert Marko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230426185647.180166-1-robimarko@gmail.com commit e0a6590d8ceb7d6c4e35b5b5eb368d9fb800487f Author: Luca Weiss Date: Thu Apr 27 22:34:29 2023 +0200 ARM: dts: qcom: msm8974-hammerhead: Add vibrator The Nexus 5 has a vibrator connected to the clock output of GP1_CLK which we can use with the clk-pwm driver, then we can use that pwm with pwm-vibrator to get haptics functionality. This patch is based on Brian Masney's previous patch with clk-vibrator. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Reviewed-by: Caleb Connolly Reviewed-by: Brian Masney Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230427-hammerhead-vibra-v1-4-e87eeb94da51@z3ntu.xyz commit ffd853c2ea3e39853f0bffc7364c73c12170c595 Author: Konrad Dybcio Date: Mon May 1 14:57:13 2023 +0200 clk: qcom: smd-rpm: Make BI_TCXO_AO critical We should never let go of the active-only XO vote, as otherwise the RPM may decide that there are no online users and it can be shut down, resulting in a total, uncontrolled system collapse. Guarantee this through adding the CLK_IS_CRITICAL flag. Signed-off-by: Konrad Dybcio Tested-by: Matti Lehtimäki Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230501-topic-rpmcc_xo_a-v1-3-93f18e47b607@linaro.org commit 2dd117943f2339d8aba8b139f55edc5e07e1d359 Author: Konrad Dybcio Date: Mon May 1 14:57:12 2023 +0200 clk: qcom: smd-rpm: Make DEFINE_CLK_SMD_RPM_BRANCH_A accept flags In preparation for supporting keepalive clocks which can never be shut off (as the platform would fall apart otherwise), make the DEFINE_CLK_SMD_RPM_BRANCH_A macro accept clock flags for the active-only clock. Signed-off-by: Konrad Dybcio Tested-by: Matti Lehtimäki Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230501-topic-rpmcc_xo_a-v1-2-93f18e47b607@linaro.org commit 24abad60396865caf5ff8ccfa294894617456524 Author: Konrad Dybcio Date: Mon May 1 14:57:11 2023 +0200 clk: qcom: smd-rpm_ Make __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX accept flags In preparation for supporting keepalive clocks which can never be shut off (as the platform would fall apart otherwise), make the __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX macro accept clock flags for the active-only clock. Signed-off-by: Konrad Dybcio Tested-by: Matti Lehtimäki Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230501-topic-rpmcc_xo_a-v1-1-93f18e47b607@linaro.org commit caa2347d0224116d5083afa670c46094e0ceeff3 Author: Konrad Dybcio Date: Mon May 1 15:04:00 2023 +0200 clk: qcom: smd-rpm: Keep one rpm handle for all clocks For no apparent reason (as there's just one RPM per SoC), all clocks currently store a copy of a pointer to smd_rpm. Introduce a single, global one to save up on space in each clk definition. bloat-o-meter reports: Total: Before=41887, After=40843, chg -2.49% Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230501130400.107771-1-konrad.dybcio@linaro.org commit 3e4d179532423f299554cd0dedabdd9d2fdd238d Author: Taniya Das Date: Mon May 1 19:59:32 2023 +0530 clk: qcom: camcc-sc7180: Add parent dependency to all camera GDSCs Camera titan top GDSC is a parent supply to all other camera GDSCs. Titan top GDSC is required to be enabled before enabling any other camera GDSCs and it should be disabled only after all other camera GDSCs are disabled. Ensure this behavior by marking titan top GDSC as parent of all other camera GDSCs. Fixes: 15d09e830bbc ("clk: qcom: camcc: Add camera clock controller driver for SC7180") Signed-off-by: Taniya Das Acked-by: Stephen Boyd Reviewed-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230501142932.13049-1-quic_tdas@quicinc.com commit 93fe463652504bba298a68b56334729cdf92c0c3 Author: Andrew Halaney Date: Mon May 1 16:24:46 2023 -0500 arm64: dts: qcom: sa8155p-adp: Move mtl nodes into ethernet node The mtl nodes aren't evaluated unless they're under the node with the compatible. Move them so they're now evaluated in case future patchsets modify them incorrectly. An example of this can be seen in the link. Link: https://lore.kernel.org/linux-arm-msm/20230414145844.wyg6pt623pzqwh5l@halaney-x13s/ Signed-off-by: Andrew Halaney Reviewed-by: Brian Masney Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230501212446.2570364-5-ahalaney@redhat.com commit 0ff4f6a380214fcf85a5b5ad64ff481d9bd1dfc6 Author: Andrew Halaney Date: Mon May 1 16:24:45 2023 -0500 arm64: dts: qcom: sa8155p-adp: Remove unneeded rgmii_phy information Using interrupts-extended already indicates what the interrupt-parent is, so drop the explicit interrupt-parent. The comment about this being the phy-intr is not helpful either, since this is the only interrupt in the phy node. Suggested-by: Konrad Dybcio Reviewed-by: Konrad Dybcio Signed-off-by: Andrew Halaney Reviewed-by: Brian Masney Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230501212446.2570364-4-ahalaney@redhat.com commit 674631c35f8670017d3bbd51a5b52f8b953f6816 Author: Andrew Halaney Date: Mon May 1 16:24:44 2023 -0500 arm64: dts: qcom: Make -cells decimal The property logically makes sense in decimal, and is the standard used elsewhere. Suggested-by: Konrad Dybcio Signed-off-by: Andrew Halaney Reviewed-by: Krzysztof Kozlowski Reviewed-by: Brian Masney Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230501212446.2570364-3-ahalaney@redhat.com commit eee7369de0c3cca7aacab3874663d460fb7a5b06 Author: Andrew Halaney Date: Mon May 1 16:24:43 2023 -0500 arm64: dts: qcom: sa8155p-adp: Make compatible the first property As stated at the below link in another review, compatible is always the first property. Follow suit here to avoid copying incorrectly in the future. Link: https://lore.kernel.org/netdev/20230331215804.783439-1-ahalaney@redhat.com/T/#ma76b4116bbb9e49ee4bcf699e40935d80965b3f3 Reviewed-by: Konrad Dybcio Signed-off-by: Andrew Halaney Reviewed-by: Brian Masney Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230501212446.2570364-2-ahalaney@redhat.com commit 6ade5ce20c466298c04b10fe66091b9055aa9988 Author: Bhupesh Sharma Date: Tue May 2 15:09:59 2023 +0530 dt-bindings: soc: qcom: eud: Fix compatible string in the example As noted by Konrad while reviewing [1], the example node in the EUD yaml documentation has a compatible string with no space after a comma. Fix the same. [1]. https://lore.kernel.org/linux-arm-msm/20221231131945.3286639-1-bhupesh.sharma@linaro.org Signed-off-by: Bhupesh Sharma Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230502093959.1258889-3-bhupesh.sharma@linaro.org commit 9ee402ccfeb1638a039f2e0d455300b5f8600a81 Author: Bhupesh Sharma Date: Tue May 2 15:09:58 2023 +0530 arm64: dts: qcom: sc7280: Fix EUD dt node syntax As noted by Konrad while reviewing [1], fix the EUD and DWC3 node syntax in sc7280 dtsi file. While at it also fix the errors reported by '$ make dtbs_check' for the EUD node: arch/arm64/boot/dts/qcom/sc7280-crd-r3.dtb: eud@88e0000: ports: 'oneOf' conditional failed, one must be fixed: 'port' is a required property '#address-cells' is a required property '#size-cells' is a required property From schema: Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml [1]. https://lore.kernel.org/linux-arm-msm/20221231131945.3286639-1-bhupesh.sharma@linaro.org Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230502093959.1258889-2-bhupesh.sharma@linaro.org commit 138c427ade7bad3f4f764b506ce4f1079bfc22ee Author: Neil Armstrong Date: Wed May 3 16:13:29 2023 +0200 arm64: dts: qcom: pmk8550: add reboot-mode node using sdam_2 nvmem Introduce sdam_2 node, which is to be used via nvmem for power on reasons during reboot. Add supported PoN reasons supported via sdam_2 node. Signed-off-by: Neil Armstrong Reviewed-by: Krzysztof Kozlowski Tested-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230503-topic-sm8450-upstream-reboot-reason-v1-2-c5ac3dd5b49f@linaro.org commit 399a3c34b390afda183b7b0bd91afeee3a4cfc0f Author: Neil Armstrong Date: Wed May 3 16:13:28 2023 +0200 arm64: dts: qcom: pmk8350: add reboot-mode node using sdam_2 nvmem Introduce sdam_2 node, which is to be used via nvmem for power on reasons during reboot. Add supported PoN reasons supported via sdam_2 node. Signed-off-by: Neil Armstrong Reviewed-by: Krzysztof Kozlowski Tested-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230503-topic-sm8450-upstream-reboot-reason-v1-1-c5ac3dd5b49f@linaro.org commit 8721e18ca6960f3c5a6a7f58245d9ab084ad09dd Author: Dmitry Baryshkov Date: Thu May 4 19:04:30 2023 +0300 arm64: dts: qcom: enable dual ("bonded") DSI mode for DB845c Now as both lt9611 and drm/msm drivers were updated to handle the 4k modes over DSI, enable "bonded" DSI mode on DB845c. This way the board utilizes both DSI links and thus can support 4k on the HDMI output. Cc: Amit Pundir Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230504160430.4014206-1-dmitry.baryshkov@linaro.org commit 853c064b57491d739bfd0cc35ff75c5ea9c5e8f5 Author: Dmitry Baryshkov Date: Mon May 8 18:33:19 2023 +0300 clk: qcom: mmcc-msm8974: remove oxili_ocmemgx_clk After the internal discussions, it looks like this clock is managed by RPM itself. Linux kernel should not touch it on its own, as this causes disagreement with RPM. Shutting down this clock causes the OCMEM<->GPU interface to stop working, resulting in GPU hangchecks/timeouts. Fixes: d8b212014e69 ("clk: qcom: Add support for MSM8974's multimedia clock controller (MMCC)") Suggested-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Tested-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230508153319.2371645-1-dmitry.baryshkov@linaro.org commit a30e62bf6bf4d3230fa9164c7e174e32b9be7ba5 Author: Kathiravan T Date: Mon May 8 22:01:45 2023 +0530 clk: qcom: gcc: ipq5332: Use floor ops for SDCC clocks SDCC clocks must be rounded down to avoid overclocking the controller. Fixes: 3d89d52970fd ("clk: qcom: add Global Clock controller (GCC) driver for IPQ5332 SoC") Signed-off-by: Kathiravan T Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230508163145.9678-1-quic_kathirav@quicinc.com commit 210d12c8197a551caa2979be421aa42381156aec Author: Gokul krishna Krishnakumar Date: Mon May 8 17:18:21 2023 -0700 soc: qcom: mdt_loader: Enhance split binary detection It may be that the offset of the first program header lies inside the mdt's filesize, in this case the loader would incorrectly assume that the bins were not split and in this scenario the firmware authentication fails. This change updates the logic used by the mdt loader to understand whether the firmware images are split or not. It figures this out by checking if each programs header's segment lies within the file or not. Co-developed-by: Melody Olvera Signed-off-by: Melody Olvera Signed-off-by: Gokul krishna Krishnakumar Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230509001821.24010-1-quic_gokukris@quicinc.com commit 659db0789c2e66c5d6a52d57008e3a7401a3ffff Author: Xiu Jianfeng Date: Wed May 24 14:54:31 2023 +0800 cgroup: Update out-of-date comment in cgroup_migrate() Commit 674b745e22b3 ("cgroup: remove rcu_read_lock()/rcu_read_unlock() in critical section of spin_lock_irq()") has removed the rcu_read_lock, which makes the comment out-of-date, so update it. tj: Updated the comment a bit. Signed-off-by: Xiu Jianfeng Signed-off-by: Tejun Heo commit c8f6219be2e58d7f676935ae90b64abef5d0966a Author: Zqiang Date: Wed May 24 11:53:39 2023 +0800 workqueue: Fix WARN_ON_ONCE() triggers in worker_enter_idle() Currently, pool->nr_running can be modified from timer tick, that means the timer tick can run nested inside a not-irq-protected section that's in the process of modifying nr_running. Consider the following scenario: CPU0 kworker/0:2 (events) worker_clr_flags(worker, WORKER_PREP | WORKER_REBOUND); ->pool->nr_running++; (1) process_one_work() ->worker->current_func(work); ->schedule() ->wq_worker_sleeping() ->worker->sleeping = 1; ->pool->nr_running--; (0) .... ->wq_worker_running() .... CPU0 by interrupt: wq_worker_tick() ->worker_set_flags(worker, WORKER_CPU_INTENSIVE); ->pool->nr_running--; (-1) ->worker->flags |= WORKER_CPU_INTENSIVE; .... ->if (!(worker->flags & WORKER_NOT_RUNNING)) ->pool->nr_running++; (will not execute) ->worker->sleeping = 0; .... ->worker_clr_flags(worker, WORKER_CPU_INTENSIVE); ->pool->nr_running++; (0) .... worker_set_flags(worker, WORKER_PREP); ->pool->nr_running--; (-1) .... worker_enter_idle() ->WARN_ON_ONCE(pool->nr_workers == pool->nr_idle && pool->nr_running); if the nr_workers is equal to nr_idle, due to the nr_running is not zero, will trigger WARN_ON_ONCE(). [ 2.460602] WARNING: CPU: 0 PID: 63 at kernel/workqueue.c:1999 worker_enter_idle+0xb2/0xc0 [ 2.462163] Modules linked in: [ 2.463401] CPU: 0 PID: 63 Comm: kworker/0:2 Not tainted 6.4.0-rc2-next-20230519 #1 [ 2.463771] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 [ 2.465127] Workqueue: 0x0 (events) [ 2.465678] RIP: 0010:worker_enter_idle+0xb2/0xc0 ... [ 2.472614] Call Trace: [ 2.473152] [ 2.474182] worker_thread+0x71/0x430 [ 2.474992] ? _raw_spin_unlock_irqrestore+0x28/0x50 [ 2.475263] kthread+0x103/0x120 [ 2.475493] ? __pfx_worker_thread+0x10/0x10 [ 2.476355] ? __pfx_kthread+0x10/0x10 [ 2.476635] ret_from_fork+0x2c/0x50 [ 2.477051] This commit therefore add the check of worker->sleeping in wq_worker_tick(), if the worker->sleeping is not zero, directly return. tj: Updated comment and description. Reported-by: Naresh Kamboju Reported-by: Linux Kernel Functional Testing Tested-by: Anders Roxell Closes: https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230519/testrun/17078554/suite/boot/test/clang-nightly-lkftconfig/log Signed-off-by: Zqiang Signed-off-by: Tejun Heo commit 57e2c2f2d94cfd551af91cedfa1af6d972487197 Author: Alexander Aring Date: Wed May 24 12:02:04 2023 -0400 fs: dlm: fix mismatch of plock results from userspace When a waiting plock request (F_SETLKW) is sent to userspace for processing (dlm_controld), the result is returned at a later time. That result could be incorrectly matched to a different waiting request in cases where the owner field is the same (e.g. different threads in a process.) This is fixed by comparing all the properties in the request and reply. The results for non-waiting plock requests are now matched based on list order because the results are returned in the same order they were sent. Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit fcf1fa29c8ea75bf104c35ce29b65ce2ba6a6a9d Merge: 3b22f98e5a05f 08b0895675736 Author: Andrii Nakryiko Date: Wed May 24 11:11:34 2023 -0700 Merge branch 'libbpf: capability for resizing datasec maps' JP Kobryn says: ==================== Due to the way the datasec maps like bss, data, rodata are memory mapped, they cannot be resized with bpf_map__set_value_size() like non-datasec maps can. This series offers a way to allow the resizing of datasec maps, by having the mapped regions resized as needed and also adjusting associated BTF info if possible. The thought behind this is to allow for use cases where a given datasec needs to scale to for example the number of CPU's present. A bpf program can have a global array in a data section with an initial length and before loading the bpf program, the array length could be extended to match the CPU count. The selftests included in this series perform this scaling to an arbitrary value to demonstrate how it can work. ==================== Signed-off-by: Andrii Nakryiko commit 08b0895675736c49f7b172eac7d5c042fc71c3ec Author: JP Kobryn Date: Tue May 23 17:45:37 2023 -0700 libbpf: Selftests for resizing datasec maps This patch adds test coverage for resizing datasec maps. The first two subtests resize the bss and custom data sections. In both cases, an initial array (of length one) has its element set to one. After resizing the rest of the array is filled with ones as well. A BPF program is then run to sum the respective arrays and back on the userspace side the sum is checked to be equal to the number of elements. The third subtest attempts to perform resizing under conditions that will result in either the resize failing or the BTF info being cleared. Signed-off-by: JP Kobryn Signed-off-by: Andrii Nakryiko Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20230524004537.18614-3-inwardvessel@gmail.com commit 9d0a23313b1aa107df857e8441ea2ed74811ea17 Author: JP Kobryn Date: Tue May 23 17:45:36 2023 -0700 libbpf: Add capability for resizing datasec maps This patch updates bpf_map__set_value_size() so that if the given map is memory mapped, it will attempt to resize the mapped region. Initial contents of the mapped region are preserved. BTF is not required, but after the mapping is resized an attempt is made to adjust the associated BTF information if the following criteria is met: - BTF info is present - the map is a datasec - the final variable in the datasec is an array ... the resulting BTF info will be updated so that the final array variable is associated with a new BTF array type sized to cover the requested size. Note that the initial resizing of the memory mapped region can succeed while the subsequent BTF adjustment can fail. In this case, BTF info is dropped from the map by clearing the key and value type. Signed-off-by: JP Kobryn Signed-off-by: Andrii Nakryiko Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20230524004537.18614-2-inwardvessel@gmail.com commit 50da4496761b44752dfdf8096cbee399058aa7da Author: Vinod Koul Date: Sat Mar 25 17:54:39 2023 +0530 dt-bindings: phy: qcom,qmp-ufs: fix the sc8180x regs sc8180x ufs phy requires to describe five reg areas for the phy to work, so move the description to the correct place documenting tx, rx lane 1, 2 and pcs. Acked-by: Krzysztof Kozlowski Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20230325122444.249507-8-vkoul@kernel.org Signed-off-by: Vinod Koul commit 91e648fcccf38fed558c7c5330d77e229bbf24ef Author: Vinod Koul Date: Sat Mar 25 17:54:35 2023 +0530 dt-bindings: phy: qcom,qmp-pcie: fix the sc8180x regs sc8180x pcie phy requires to describe six reg areas for the phy to work, so move the description to the correct place documenting tx, rx lane 1, 2 and pcs and pcs misc. Acked-by: Krzysztof Kozlowski Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20230325122444.249507-4-vkoul@kernel.org Signed-off-by: Vinod Koul commit ab23ed6e73ecd198bf577077677beaded0a9e718 Author: Arnd Bergmann Date: Wed May 17 15:10:58 2023 +0200 PM: suspend: add a arch_resume_nosmt() prototype The arch_resume_nosmt() has a __weak definition, plus an x86 specific override, but no prototype that ensures the two have the same arguments. This causes a W=1 warning: arch/x86/power/hibernate.c:189:5: error: no previous prototype for 'arch_resume_nosmt' [-Werror=missing-prototypes] Add the prototype in linux/suspend.h, which is included in both places. Signed-off-by: Arnd Bergmann Signed-off-by: Rafael J. Wysocki commit 847aea98e01cf084efcb84490b3060af343d1458 Author: Wang Honghui Date: Thu May 4 17:18:24 2023 +0800 PM: hibernate: Correct spelling mistake in a comment Fix a typo in a comment in kernel/power/snapshot.c Signed-off-by: Wang Honghui [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 40613da52b13fb21c5566f10b287e0ca8c12c4e9 Author: Igor Mammedov Date: Mon Apr 24 21:15:57 2023 +0200 PCI: acpiphp: Reassign resources on bridge if necessary When using ACPI PCI hotplug, hotplugging a device with large BARs may fail if bridge windows programmed by firmware are not large enough. Reproducer: $ qemu-kvm -monitor stdio -M q35 -m 4G \ -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=on \ -device id=rp1,pcie-root-port,bus=pcie.0,chassis=4 \ disk_image wait till linux guest boots, then hotplug device: (qemu) device_add qxl,bus=rp1 hotplug on guest side fails with: pci 0000:01:00.0: [1b36:0100] type 00 class 0x038000 pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x03ffffff] pci 0000:01:00.0: reg 0x14: [mem 0x00000000-0x03ffffff] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00001fff] pci 0000:01:00.0: reg 0x1c: [io 0x0000-0x001f] pci 0000:01:00.0: BAR 0: no space for [mem size 0x04000000] pci 0000:01:00.0: BAR 0: failed to assign [mem size 0x04000000] pci 0000:01:00.0: BAR 1: no space for [mem size 0x04000000] pci 0000:01:00.0: BAR 1: failed to assign [mem size 0x04000000] pci 0000:01:00.0: BAR 2: assigned [mem 0xfe800000-0xfe801fff] pci 0000:01:00.0: BAR 3: assigned [io 0x1000-0x101f] qxl 0000:01:00.0: enabling device (0000 -> 0003) Unable to create vram_mapping qxl: probe of 0000:01:00.0 failed with error -12 However when using native PCIe hotplug '-global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off' it works fine, since kernel attempts to reassign unused resources. Use the same machinery as native PCIe hotplug to (re)assign resources. Link: https://lore.kernel.org/r/20230424191557.2464760-1-imammedo@redhat.com Signed-off-by: Igor Mammedov Signed-off-by: Bjorn Helgaas Acked-by: Michael S. Tsirkin Acked-by: Rafael J. Wysocki Cc: stable@vger.kernel.org commit e8afd0d9fccc27c8ad263db5cf5952cfcf72d6fe Author: Rongguang Wei Date: Fri May 12 10:15:18 2023 +0800 PCI: pciehp: Cancel bringup sequence if card is not present If a PCIe hotplug slot has an Attention Button, the normal hot-add flow is: - Slot is empty and slot power is off - User inserts card in slot and presses Attention Button - OS blinks Power Indicator for 5 seconds - After 5 seconds, OS turns on Power Indicator, turns on slot power, and enumerates the device Previously, if a user pressed the Attention Button on an *empty* slot, pciehp logged the following messages and blinked the Power Indicator until a second button press: [0.000] pciehp: Button press: will power on in 5 sec [0.001] # Power Indicator starts blinking [5.001] # 5 second timeout; slot is empty, so we should cancel the request to power on and turn off Power Indicator [7.000] # Power Indicator still blinking [8.000] # possible card insertion [9.000] pciehp: Button press: canceling request to power on The first button press incorrectly left the slot in BLINKINGON_STATE, so the second was interpreted as a "cancel power on" event regardless of whether a card was present. If the slot is empty, turn off the Power Indicator and return from BLINKINGON_STATE to OFF_STATE after 5 seconds, effectively canceling the request to power on. Putting the slot in OFF_STATE also means the second button press will correctly request a slot power on if the slot is occupied. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20230512021518.336460-1-clementwei90@163.com Fixes: d331710ea78f ("PCI: pciehp: Become resilient to missed events") Suggested-by: Lukas Wunner Signed-off-by: Rongguang Wei Signed-off-by: Bjorn Helgaas Reviewed-by: Lukas Wunner commit 2e41e3ca4729455e002bcb585f0d3749ee66d572 Author: Kai-Heng Feng Date: Tue May 2 17:04:34 2023 +0200 PM: suspend: Fix pm_suspend_target_state handling for !CONFIG_PM Move the pm_suspend_target_state definition for CONFIG_SUSPEND unset from the wakeup code into the headers so as to allow it to still be used elsewhere when CONFIG_SUSPEND is not set. Signed-off-by: Kai-Heng Feng [ rjw: Changelog and subject edits ] Signed-off-by: Rafael J. Wysocki commit 5054133a88622943783e370ede795e725f39a485 Author: Bjorn Helgaas Date: Mon May 22 16:27:17 2023 -0500 PCI: pciehp: Simplify Attention Button logging Previously, pressing the Attention Button always logged two lines, the first from pciehp_ist() and the second from pciehp_handle_button_press(): Attention button pressed Powering on due to button press Since pciehp_handle_button_press() always logs the more detailed message, remove the generic "Attention button pressed" message. Reword the pciehp_handle_button_press() to be of the form: Button press: will power on in 5 sec Button press: will power off in 5 sec Button press: canceling request to power on Button press: canceling request to power off Button press: ignoring invalid state %#x Link: https://lore.kernel.org/r/20230522214051.619337-1-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Lukas Wunner commit 9eef7f9da928c54149199e7b3215b82c2d595ccd Author: Zhang Rui Date: Wed Apr 19 10:44:19 2023 +0800 powercap: intel_rapl: Introduce RAPL TPMI interface driver The TPMI (Topology Aware Register and PM Capsule Interface) provides a flexible, extendable and PCIe enumerable MMIO interface for PM features. Intel RAPL (Running Average Power Limit) is one of the features that benefit from this. Using TPMI Interface has advantage over traditional MSR (Model Specific Register) interface, where a thread needs to be scheduled on the target CPU to read or write. Also the RAPL features vary between CPU models, and hence lot of model specific code. Here TPMI provides an architectural interface by providing hierarchical tables and fields, which will not need any model specific implementation. TPMI interface uses a PCI VSEC structure to expose the location of MMIO interface for PM feature enumeration and control. The Intel VSEC driver parses VSEC structures present in the PCI configuration space of the given device and creates an auxiliary device object for each of them. In particular, it creates an auxiliary device object representing TPMI that can be bound to by an auxiliary driver. Then the TPMI enumeration driver binds to the TPMI auxiliary device object created by the Intel VSEC driver, parses the PM Feature Structure (PFS) present in the TPMI MMIO region and creates device nodes for PM features described in the PFS. This RAPL TPMI Interface driver binds the RAPL auxiliary device created by the TPMI enumeration driver and expose the RAPL control to userspace via powercap sysfs class. RAPL TPMI details are published in the following document: https://github.com/intel/tpmi_power_management/blob/main/RAPL_TPMI_public_disclosure_FINAL.docx Note, for now, the RAPL TPMI Interface and RAPL MSR Interface cannot co-exists on the same platform (RAPL TPMI Interface is not supported on any platforms in the CPU model list for RAPL MSR Interface). Thus register the RAPL TPMI powercap control type with name "intel-rapl", the same as RAPL MSR Interface, so that it is transparent to userspace. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit e12dee18b89f1b0d4fc070eda4843f9d806645ca Author: Zhang Rui Date: Wed Apr 19 10:44:18 2023 +0800 powercap: intel_rapl: Introduce core support for TPMI interface Compared with existing RAPL MSR/MMIO Interface, the RAPL TPMI Interface 1. has per Power Limit register, thus has per Power Limit Lock and Enable bit. 2. doesn't have Power Limit Clamp bit. 3. the Power Limit Lock and Enable bits have different bit offsets. These mean RAPL TPMI Interface needs its own primitive information. RAPL TPMI Interface also has per domain unit register but with a different register layout. This requires a TPMI specific rapl_defaults call to decode the unit register. Introduce the RAPL core support for TPMI Interface. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit b4288ce788aaf160f2a706672af2eaef417bb057 Author: Zhang Rui Date: Wed Apr 19 10:44:17 2023 +0800 powercap: intel_rapl: Introduce RAPL I/F type Different RAPL Interfaces may have different primitive information and rapl_defaults calls. To better distinguish this difference in the RAPL framework code, introduce a new enum to represent different types of RAPL Interfaces. No functional change. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit bf44b9011df3d6e34a23be77d86540553ba2bbe2 Author: Zhang Rui Date: Wed Apr 19 10:44:16 2023 +0800 powercap: intel_rapl: Make cpu optional for rapl_package MSR RAPL Interface always removes a rapl_package when all the CPUs in that rapl_package are offlined. This is because it relies on an online CPU to access the MSR. But for RAPL Interface using MMIO registers, when all the cpus within the rapl_package are offlined, 1. the register can still be accessed 2. monitoring and setting the Power Pimits for the rapl_package is still meaningful because of uncore power. This means that, a valid rapl_package doesn't rely on one or more cpus being onlined. For this sense, make cpu optional for rapl_package. A rapl_package can be registered either using a CPU id to represent the physical package/die, or using the physical package id directly. Note that, the thermal throttling interrupt is not disabled via MSR_IA32_PACKAGE_THERM_INTERRUPT for such rapl_package at the moment. If it is still needed in the future, this can be achieved by selecting an onlined CPU using the physical package id. Note that, processor_thermal_rapl, the current MMIO RAPL Interface driver, can also be converted to register using a package id instead. But this is not done right now because processor_thermal_rapl driver works on single-package systems only, and offlining the only package will not happen. So keep the previous logic. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit 693c1d7868cf710382c39c2d64cbb55e72b36d66 Author: Zhang Rui Date: Wed Apr 19 10:44:15 2023 +0800 powercap: intel_rapl: Remove redundant cpu parameter For rapl_packages that rely on online CPUs to work, rp->lead_cpu always has a valid CPU id. Remove the redundant cpu parameter in rapl_check_domain(), rapl_detect_domains() and .check_unit() callbacks. No functional change. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit f442bd2742174eed6993315ec621275df13f311d Author: Zhang Rui Date: Wed Apr 19 10:44:14 2023 +0800 powercap: intel_rapl: Add support for lock bit per Power Limit With RAPL MSR/MMIO Interface, each RAPL domain has one Power Limit register. Each Power Limit register has one lock bit which tells the OS if the power limit register can be used or not. Depending on the number of power limits supported by the power limit register, the lock bit may apply to one or more power limits. With RAPL TPMI Interface, each RAPL domain has multiple Power Limits, and each Power Limit has its own register, with a lock bit. To handle this, introduce support for lock bit per Power Limit. For existing RAPL MSR/MMIO Interfaces, the lock bit in the Power Limit register applies to all the Power Limits controlled by this register. Remove the per domain DOMAIN_STATE_BIOS_LOCKED flag at the same time because it can be replaced by the per Power Limit lock. No functional change intended. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit 9050a9cd5e4c848e265915d6e7b1f731e6e1e0e6 Author: Zhang Rui Date: Wed Apr 19 10:44:13 2023 +0800 powercap: intel_rapl: Cleanup Power Limits support The same set of operations are shared by different Powert Limits, including Power Limit get/set, Power Limit enable/disable, clamping enable/disable, time window get/set, and max power get/set, etc. But the same operation for different Power Limit has different primitives because they use different registers/register bits. A lot of dirty/duplicate code was introduced to handle this difference. Introduce a universal way to issue Power Limit operations. Instead of using hardcoded primitive name directly, use Power Limit id + operation type, and hide all the Power Limit difference details in a central place, get_pl_prim(). Two helpers, rapl_read_pl_data() and rapl_write_pl_data(), are introduced at the same time to simplify the code for issuing Power Limit operations. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit a38f300bb23c896d2d132a4502086d4bfec2a25e Author: Zhang Rui Date: Wed Apr 19 10:44:12 2023 +0800 powercap: intel_rapl: Use bitmap for Power Limits Currently, a RAPL package is registered with the number of Power Limits supported in each RAPL domain. But this doesn't tell which Power Limits are available. Using the number of Power Limits supported to guess the availability of each Power Limit is fragile. Use bitmap to represent the availability of each Power Limit. Note that PL1 is mandatory thus it does not need to be set explicitly by the RAPL Interface drivers. No functional change intended. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit 045610c383bd6b740bb7e7c780d6f7729249e60d Author: Zhang Rui Date: Wed Apr 19 10:44:11 2023 +0800 powercap: intel_rapl: Change primitive order The same set of operations are shared by different Powert Limits, including Power Limit get/set, Power Limit enable/disable, clamping enable/disable, time window get/set, and max power get/set, etc. But the same operation for different Power Limit has different primitives because they use different registers/register bits. A lot of dirty/duplicate code was introduced to handle this difference. Instead of using hardcoded primitive name directly, using Power Limit id + operation type is much cleaner. For this sense, move POWER_LIMIT1/POWER_LIMIT2/POWER_LIMIT4 to the beginning of enum rapl_primitives so that they can be reused as Power Limit ids. No functional change. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit 11edbe5c66d624e2e1eec8929d3668d76a574c3b Author: Zhang Rui Date: Wed Apr 19 10:44:10 2023 +0800 powercap: intel_rapl: Use index to initialize primitive information Currently, the RAPL primitive information array is required to be initialized in the order of enum rapl_primitives. This can break easily, especially when different RAPL Interfaces may support different sets of primitives. Convert the code to initialize the primitive information using array index explicitly. No functional change. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit cb532e728ee2880be53264752e74945fd2d917ac Author: Zhang Rui Date: Wed Apr 19 10:44:09 2023 +0800 powercap: intel_rapl: Support per domain energy/power/time unit RAPL MSR/MMIO Interface has package scope unit register but some RAPL domains like Dram/Psys may use a fixed energy unit value instead of the default unit value on certain platforms. RAPL TPMI Interface supports per domain unit register. For the above reasons, add support for per domain unit register and per domain energy/power/time unit. When per domain unit register is not available, use the package scope unit register as the per domain unit register for each RAPL domain so that this change is transparent to MSR/MMIO Interface. No functional change intended. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit 98ff639a7289067247b3ef9dd5d1e922361e7365 Author: Zhang Rui Date: Wed Apr 19 10:44:08 2023 +0800 powercap: intel_rapl: Support per Interface primitive information RAPL primitive information is Interface specific. Although current MSR and MMIO Interface share the same RAPL primitives, new Interface like TPMI has its own RAPL primitive information. Save the primitive information in the Interface private structure. Plus, using variant name "rp" for struct rapl_primitive_info is confusing because "rp" is also used for struct rapl_package. Use "rpi" as the variant name for struct rapl_primitive_info, and rename the previous rpi[] array to avoid conflict. No functional change. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit e8e28c2af16b279b6c37d533e1e73effb197cf2e Author: Zhang Rui Date: Wed Apr 19 10:44:07 2023 +0800 powercap: intel_rapl: Support per Interface rapl_defaults rapl_defaults is Interface specific. Although current MSR and MMIO Interface share the same rapl_defaults, new Interface like TPMI need its own rapl_defaults callbacks. Save the rapl_defaults information in the Interface private structure. No functional change. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit 1488ac990ac886b1209aa9f94c0c66022bcc8827 Author: Zhang Rui Date: Wed Apr 19 10:44:06 2023 +0800 powercap: intel_rapl: Allow probing without CPUID match Currently, CPU model checks is used to 1. get proper rapl_defaults callbacks for RAPL MSR/MMIO Interface. 2. create a platform device node for the intel_rapl_msr driver to probe. Both of these are only mandatory for the RAPL MSR/MMIO Interface. Make the CPUID match optional. Signed-off-by: Zhang Rui Tested-by: Wang Wendy Signed-off-by: Rafael J. Wysocki commit 31cb1304ad8bd27b7d2abd8669fb887fb47d8eaf Author: Zhang Rui Date: Wed Apr 19 10:44:05 2023 +0800 powercap: intel_rapl: Remove unused field in struct rapl_if_priv After commit f1e8d7560d30 ("powercap/intel_rapl: enumerate Psys RAPL domain together with package RAPL domain"), the platform_rapl_domain field is not used anymore. Remove it from rapl_if_priv structure. Fixes: f1e8d7560d30 ("powercap/intel_rapl: enumerate Psys RAPL domain together with package RAPL domain") Signed-off-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit 95c08508e237ba2444786581bfcc7df1ff54c35b Author: Matt Roper Date: Tue May 23 12:56:09 2023 -0700 drm/i915/display: Move feature test macros to intel_display_device.h It makes sense to keep the display feature test macros centralized within the display code. Signed-off-by: Matt Roper Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230523195609.73627-7-matthew.d.roper@intel.com commit 12e6f6dc78e4f4a418648fb1a9c0cd2ae9b3430b Author: Matt Roper Date: Tue May 23 12:56:08 2023 -0700 drm/i915/display: Handle GMD_ID identification in display code For platforms with GMD_ID support (i.e., everything MTL and beyond), identification of the display IP present should be based on the contents of the GMD_ID register rather than a PCI devid match. Note that since GMD_ID readout requires access to the PCI BAR, a slight change to the driver init sequence is needed --- pci_enable_device() is now called before i915_driver_create(). v2: - Fix use of uninitialized i915 pointer in error path if pci_enable_device() fails before the i915 device is created. (lkp) - Use drm_device parameter to intel_display_device_probe. This goes against i915 conventions, but since the primary goal here is to make it easy to call this function from other drivers (like Xe) and since we don't need anything from the i915 structure, this seems like an exception where drm_device is a more natural fit. v3: - Go back do drm_i915_private for intel_display_device_probe. (Jani) - Move forward decl to top of header. (Jani) Signed-off-by: Matt Roper Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230523195609.73627-6-matthew.d.roper@intel.com commit 69d439818fe501e8c9e50d963a53cb596e36f9f7 Author: Matt Roper Date: Tue May 23 12:56:07 2023 -0700 drm/i915/display: Make display responsible for probing its own IP Rather than selecting the display IP and feature flags at the same time the general PCI probing happens, move this step into the display code itself so that it can be more easily re-used outside of i915 (i.e., by the Xe driver). v2: - Make intel_display_device_probe() always return a non-NULL pointer and simplify copying of runtime_defaults. (Andrzej) v3: - Redefine INTEL_VGA_DEVICE/INTEL_QUANTA_DEVICE to eliminate a cast and an include of linux/mod_devicetable.h. (Jani) - Keep explicit memcpy for runtime defaults. (Jani) Cc: Andrzej Hajda Signed-off-by: Matt Roper Reviewed-by: Andrzej Hajda Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230523195609.73627-5-matthew.d.roper@intel.com commit e5d1c8722083f0332dcd3c85fa1273d85fb6bed8 Author: Nikita Zhandarovich Date: Tue Apr 18 06:07:43 2023 -0700 PM: domains: fix integer overflow issues in genpd_parse_state() Currently, while calculating residency and latency values, right operands may overflow if resulting values are big enough. To prevent this, albeit unlikely case, play it safe and convert right operands to left ones' type s64. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: 30f604283e05 ("PM / Domains: Allow domain power states to be read from DT") Signed-off-by: Nikita Zhandarovich Acked-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 18e0deeed8c80d8ec0adfff3312252028739ce52 Author: Matt Roper Date: Tue May 23 12:56:06 2023 -0700 drm/i915/display: Move display runtime info to display structure Move the runtime info specific to display into display-specific structures as has already been done with the constant display info. v2: - Rename __runtime to __runtime_defaults for more clarity on the purpose. (Andrzej) - Move introduction of DISPLAY_INFO() to previous patch. (Andrzej) - Drop NO_DISPLAY macro. (Andrzej) v3: - Use "{}" instead of "{ 0 }" for empty struct init. (Jani) Cc: Andrzej Hajda Signed-off-by: Matt Roper Reviewed-by: Andrzej Hajda Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230523195609.73627-4-matthew.d.roper@intel.com commit 8a5ad2ea6b8778c2c6713182641a85a2b497675f Merge: 41a45ea49d3a7 883a98ede4b67 Author: Jakub Kicinski Date: Wed May 24 09:13:30 2023 -0700 Merge branch 'net-pcs-xpcs-cleanups-for-clause-73-support' Russell King says: ==================== net: pcs: xpcs: cleanups for clause 73 support This series cleans up xpcs code, moving much of the clause 73 code out of the driver into places where others can make use of it. Specifically, we add a helper to convert a clause 73 advertisement to ethtool link modes to mdio.h, and a helper to resolve the clause 73 negotiation state to phylink, which includes the pause modes. In doing this cleanup, several issues were identified with the original xpcs implementation: 1) it masks the link partner advertisement with its own advertisement so userspace can't see what the full link partner advertisement was. 2) it was always setting pause modes irrespective of the advertisements on either end of the link. 3) it was reading the STAT1 registers multiple times. Reading STAT1 has the side effect of unlatching the link-down status, so multiple reads should be avoided. This patch series addresses the first two first by addressing the issues, and then by moving over to the new helpers. The third issue is solved by restructuring the xpcs code. ==================== Link: https://lore.kernel.org/r/ZGyR/jDyYTYzRklg@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 883a98ede4b67369569f2bd163015b31b03c3278 Author: Russell King (Oracle) Date: Tue May 23 11:16:29 2023 +0100 net: pcs: xpcs: avoid reading STAT1 more than once Avoid reading the STAT1 registers more than once while getting the PCS state, as this register contains latching-low bits that are lost after the first read. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 21234ef16665a78cf8b07182453a8395463865c8 Author: Russell King (Oracle) Date: Tue May 23 11:16:24 2023 +0100 net: pcs: xpcs: use phylink_resolve_c73() helper Use phylink_resolve_c73() to resolve the clause 73 autonegotiation result. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 428d603fcaeb3c8135f9983c35619925f1a56f49 Author: Russell King (Oracle) Date: Tue May 23 11:16:18 2023 +0100 net: pcs: xpcs: correct pause resolution xpcs was indicating symmetric pause should be enabled regardless of the advertisements by either party. Fix this to use linkmode_resolve_pause() now that we're no longer obliterating the link partner's advertisement by logically anding it with our own. This is transitional, the function will be entirely replaced with phylink_resolve_c73() in the following patch. Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 1f94ba198bda5738bd26cb7633dca4b33a43dff2 Author: Russell King (Oracle) Date: Tue May 23 11:16:13 2023 +0100 net: pcs: xpcs: correct lp_advertising contents lp_advertising is supposed to reflect the link partner's advertisement unmodified by the local advertisement, but xpcs bitwise ands it with the local advertisement prior to calculating the resolution of the negotiation. Fix this by moving the bitwise and to xpcs_resolve_lpa_c73() so it can place the results in a temporary bitmap before passing that to ixpcs_get_max_usxgmii_speed(). Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 3f0360e09c8d92bb0a99c6eeeb2f3f6e7732955e Author: Russell King (Oracle) Date: Tue May 23 11:16:08 2023 +0100 net: pcs: xpcs: use mii_c73_to_linkmode() helper Convert xpcs clause 73 reading to use the newly introduced mii_c73_to_linkmode() helper to translate the link partner advertisement to an ethtool bitmap. Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 6f7b89b45f1e9d8bdf8b4c4dcb8029633905ea85 Author: Russell King (Oracle) Date: Tue May 23 11:16:03 2023 +0100 net: pcs: xpcs: clean up reading clause 73 link partner advertisement Read the clause 73 link partner advertisement in a loop and then translate to the ethtool modes. Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit dad987484eaaa7cd7f7f7459f4aee1470d8ec8ef Author: Russell King (Oracle) Date: Tue May 23 11:15:58 2023 +0100 net: phylink: add function to resolve clause 73 negotiation Add a function to resolve clause 73 negotiation according to the priority resolution function described in clause 73.3.6. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit dc7a51411ec5381a567d02bee683c99713c411d9 Author: Russell King (Oracle) Date: Tue May 23 11:15:53 2023 +0100 net: phylink: remove duplicated linkmode pause resolution Phylink had two chunks of code virtually the same for resolving the negotiated pause modes. Factor this down to one function. Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit e9261467ae86a6544bb602a55a1eab52696e71e3 Author: Russell King (Oracle) Date: Tue May 23 11:15:48 2023 +0100 net: mdio: add clause 73 to ethtool conversion helper Add a helper to convert a clause 73 advertisement to an ethtool bitmap. Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 90d63a150b85fd1debb9c01237fb78faee02746a Author: Rob Clark Date: Wed May 24 08:59:37 2023 -0700 drm/doc: Relax fdinfo string constraints The restriction about no whitespace, etc, really only applies to the usage of strings in keys. Values can contain anything (other than newline). Signed-off-by: Rob Clark Acked-by: Tvrtko Ursulin Acked-by: Dave Airlie Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230524155956.382440-8-robdclark@gmail.com commit 3e9757f5ddb98238226ad68a1609aa313de35adb Author: Rob Clark Date: Wed May 24 08:59:36 2023 -0700 drm/msm: Add memory stats to fdinfo Use the new helper to export stats about memory usage. v2: Drop unintended hunk v3: Rebase Signed-off-by: Rob Clark Reviewed-by: Emil Velikov Acked-by: Dave Airlie Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230524155956.382440-7-robdclark@gmail.com commit 686b21b5f6ca2f8a716f9a4ade07246dbfb2713e Author: Rob Clark Date: Wed May 24 08:59:35 2023 -0700 drm: Add fdinfo memory stats Add support to dump GEM stats to fdinfo. v2: Fix typos, change size units to match docs, use div_u64 v3: Do it in core v4: more kerneldoc v5: doc fixes v6: Actually use u64, bit more comment docs Signed-off-by: Rob Clark Reviewed-by: Emil Velikov Reviewed-by: Daniel Vetter Acked-by: Tvrtko Ursulin Acked-by: Dave Airlie Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230524155956.382440-6-robdclark@gmail.com commit 376c25f8ca47084c4f0aff0f14684780756ccef4 Author: Rob Clark Date: Wed May 24 08:59:34 2023 -0700 drm/amdgpu: Switch to fdinfo helper v2: Rebase on drm-misc-next Signed-off-by: Rob Clark Reviewed-by: Christian König Acked-by: Dave Airlie Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230524155956.382440-5-robdclark@gmail.com commit 51d86ee5e07ccef85af04ee9850b0baa107999b6 Author: Rob Clark Date: Wed May 24 08:59:33 2023 -0700 drm/msm: Switch to fdinfo helper Now that we have a common helper, use it. v2: Rebase on drm-misc-next Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Acked-by: Dave Airlie Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230524155956.382440-4-robdclark@gmail.com commit 3f09a0cd4ea3b9d34495450d686227d48e7ec648 Author: Rob Clark Date: Wed May 24 08:59:32 2023 -0700 drm: Add common fdinfo helper Handle a bit of the boiler-plate in a single case, and make it easier to add some core tracked stats. This also ensures consistent behavior across drivers for standardised fields. v2: Update drm-usage-stats.rst, 64b client-id, rename drm_show_fdinfo v3: Rebase on drm-misc-next Reviewed-by: Daniel Vetter Signed-off-by: Rob Clark Acked-by: Dave Airlie Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230524155956.382440-3-robdclark@gmail.com commit 0020582a8afe9a8570f80ec503c59bf049a616de Author: Rob Clark Date: Wed May 24 08:59:31 2023 -0700 drm/docs: Fix usage stats typos Fix a couple missing ':'s. Signed-off-by: Rob Clark Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230524155956.382440-2-robdclark@gmail.com commit 5af5169d758275490ab00e209a09dc1d6b85e535 Author: Matt Roper Date: Tue May 23 12:56:05 2023 -0700 drm/i915: Convert INTEL_INFO()->display to a pointer Rather than embeddeding the display's device info within the main device info structure, just provide a pointer to the display-specific structure. This is in preparation for moving the display device info definitions into the display code itself and for eventually allowing the pointer to be assigned at runtime on platforms that use GMD_ID for device identification. In the future, this will also eventually allow the same display device info structures to be used outside the current i915 code (e.g., from the Xe driver). v2: - Move introduction of DISPLAY_INFO() to this patch. (Andrzej) v3: - Also use DISPLAY_INFO() in intel_display_reg_defs.h. (Andrzej) - Use "{}" instead of "{ 0 }" for empty struct init. (Jani) Signed-off-by: Matt Roper Acked-by: Lucas De Marchi Reviewed-by: Andrzej Hajda Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230523195609.73627-3-matthew.d.roper@intel.com commit 05aa8e0135094ae3d1e6837b5457a740266d7cfc Author: Matt Roper Date: Tue May 23 12:56:04 2023 -0700 drm/i915/display: Move display device info to header under display/ Moving display-specific substructure definitions will help keep display more self-contained and make it easier to re-use in other drivers (i.e., Xe) in the future. Signed-off-by: Matt Roper Reviewed-by: Andrzej Hajda Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230523195609.73627-2-matthew.d.roper@intel.com commit 403b6fb8dac1e9407c04652cedd92285c5ae9aa5 Author: David Howells Date: Mon May 22 21:57:44 2023 +0100 block: convert bio_map_user_iov to use iov_iter_extract_pages This will pin pages or leave them unaltered rather than getting a ref on them as appropriate to the iterator. The pages need to be pinned for DIO rather than having refs taken on them to prevent VM copy-on-write from malfunctioning during a concurrent fork() (the result of the I/O could otherwise end up being visible to/affected by the child process). Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard cc: Al Viro cc: Jens Axboe cc: Jan Kara cc: Matthew Wilcox cc: Logan Gunthorpe cc: linux-block@vger.kernel.org Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230522205744.2825689-7-dhowells@redhat.com Signed-off-by: Jens Axboe commit a7e689dd1c06e0cbd6d216a6868e33099d8fc8d8 Author: David Howells Date: Mon May 22 21:57:43 2023 +0100 block: Convert bio_iov_iter_get_pages to use iov_iter_extract_pages This will pin pages or leave them unaltered rather than getting a ref on them as appropriate to the iterator. The pages need to be pinned for DIO rather than having refs taken on them to prevent VM copy-on-write from malfunctioning during a concurrent fork() (the result of the I/O could otherwise end up being affected by/visible to the child process). Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard cc: Al Viro cc: Jens Axboe cc: Jan Kara cc: Matthew Wilcox cc: Logan Gunthorpe cc: linux-block@vger.kernel.org Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230522205744.2825689-6-dhowells@redhat.com Signed-off-by: Jens Axboe commit fd363244e883323e1ac9412d96fd22b51e255b0c Author: David Howells Date: Mon May 22 21:57:42 2023 +0100 block: Add BIO_PAGE_PINNED and associated infrastructure Add BIO_PAGE_PINNED to indicate that the pages in a bio are pinned (FOLL_PIN) and that the pin will need removing. Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard cc: Al Viro cc: Jens Axboe cc: Jan Kara cc: Matthew Wilcox cc: Logan Gunthorpe cc: linux-block@vger.kernel.org Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230522205744.2825689-5-dhowells@redhat.com Signed-off-by: Jens Axboe commit e51bab4e20586fb3afc30536b776a97ed8ffb681 Author: Christoph Hellwig Date: Mon May 22 21:57:41 2023 +0100 block: Replace BIO_NO_PAGE_REF with BIO_PAGE_REFFED with inverted logic Replace BIO_NO_PAGE_REF with a BIO_PAGE_REFFED flag that has the inverted meaning is only set when a page reference has been acquired that needs to be released by bio_release_pages(). Signed-off-by: Christoph Hellwig Signed-off-by: David Howells Reviewed-by: John Hubbard cc: Al Viro cc: Jens Axboe cc: Jan Kara cc: Matthew Wilcox cc: Logan Gunthorpe cc: linux-block@vger.kernel.org Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230522205744.2825689-4-dhowells@redhat.com Signed-off-by: Jens Axboe commit 09e8c253415b8eb9ca29a2131d2ebf17743534c5 Author: David Howells Date: Mon May 22 21:57:40 2023 +0100 block: Fix bio_flagged() so that gcc can better optimise it Fix bio_flagged() so that multiple instances of it, such as: if (bio_flagged(bio, BIO_PAGE_REFFED) || bio_flagged(bio, BIO_PAGE_PINNED)) can be combined by the gcc optimiser into a single test in assembly (arguably, this is a compiler optimisation issue[1]). The missed optimisation stems from bio_flagged() comparing the result of the bitwise-AND to zero. This results in an out-of-line bio_release_page() being compiled to something like: <+0>: mov 0x14(%rdi),%eax <+3>: test $0x1,%al <+5>: jne 0xffffffff816dac53 <+7>: test $0x2,%al <+9>: je 0xffffffff816dac5c <+11>: movzbl %sil,%esi <+15>: jmp 0xffffffff816daba1 <__bio_release_pages> <+20>: jmp 0xffffffff81d0b800 <__x86_return_thunk> However, the test is superfluous as the return type is bool. Removing it results in: <+0>: testb $0x3,0x14(%rdi) <+4>: je 0xffffffff816e4af4 <+6>: movzbl %sil,%esi <+10>: jmp 0xffffffff816dab7c <__bio_release_pages> <+15>: jmp 0xffffffff81d0b7c0 <__x86_return_thunk> instead. Also, the MOVZBL instruction looks unnecessary[2] - I think it's just 're-booling' the mark_dirty parameter. Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard cc: Jens Axboe cc: linux-block@vger.kernel.org Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108370 [1] Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108371 [2] Link: https://lore.kernel.org/r/167391056756.2311931.356007731815807265.stgit@warthog.procyon.org.uk/ # v6 Reviewed-by: Christian Brauner Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230522205744.2825689-3-dhowells@redhat.com Signed-off-by: Jens Axboe commit a450f49708ea2ccabd1c5d2fe8a702ca5ef77941 Author: David Howells Date: Mon May 22 21:57:39 2023 +0100 iomap: Don't get an reference on ZERO_PAGE for direct I/O block zeroing ZERO_PAGE can't go away, no need to hold an extra reference. Signed-off-by: David Howells Reviewed-by: David Hildenbrand Reviewed-by: John Hubbard Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig cc: Al Viro cc: linux-fsdevel@vger.kernel.org Reviewed-by: Christian Brauner Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230522205744.2825689-2-dhowells@redhat.com Signed-off-by: Jens Axboe commit bbeb087e5a6f849e776874cfce1e3c2414b13bb1 Merge: 5a80bd075f3bc 9eee8bd81421c Author: Jens Axboe Date: Wed May 24 08:42:22 2023 -0600 Merge branch 'for-6.5/splice' into for-6.5/block Merge splice bits as subsequent block cleanups and improvements for DIO depend on them. * for-6.5/splice: (31 commits) splice: kdoc for filemap_splice_read() and copy_splice_read() iov_iter: Kill ITER_PIPE splice: Remove generic_file_splice_read() splice: Use filemap_splice_read() instead of generic_file_splice_read() cifs: Use filemap_splice_read() trace: Convert trace/seq to use copy_splice_read() zonefs: Provide a splice-read wrapper xfs: Provide a splice-read wrapper orangefs: Provide a splice-read wrapper ocfs2: Provide a splice-read wrapper ntfs3: Provide a splice-read wrapper nfs: Provide a splice-read wrapper f2fs: Provide a splice-read wrapper ext4: Provide a splice-read wrapper ecryptfs: Provide a splice-read wrapper ceph: Provide a splice-read wrapper afs: Provide a splice-read wrapper 9p: Add splice_read wrapper net: Make sock_splice_read() use copy_splice_read() by default tty, proc, kernfs, random: Use copy_splice_read() ... commit 9eee8bd81421c5e961cbb1a3c3fa1a06fad545e8 Author: David Howells Date: Mon May 22 14:50:18 2023 +0100 splice: kdoc for filemap_splice_read() and copy_splice_read() Provide kerneldoc comments for filemap_splice_read() and copy_splice_read(). Signed-off-by: David Howells cc: Christian Brauner cc: Christoph Hellwig cc: Jens Axboe cc: Steve French cc: Al Viro cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20230522135018.2742245-32-dhowells@redhat.com Signed-off-by: Jens Axboe commit 3fc40265ae2b48a7475c41c5c0b256374c419f4b Author: David Howells Date: Mon May 22 14:50:17 2023 +0100 iov_iter: Kill ITER_PIPE The ITER_PIPE-type iterator was only used by generic_file_splice_read() and that has been replaced and removed. This leaves ITER_PIPE unused - so remove it too. Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20230522135018.2742245-31-dhowells@redhat.com Signed-off-by: Jens Axboe commit c6585011bc1d8934cc78046c50fc94590fb2ab24 Author: David Howells Date: Mon May 22 14:50:16 2023 +0100 splice: Remove generic_file_splice_read() Remove generic_file_splice_read() as it has been replaced with calls to filemap_splice_read() and copy_splice_read(). With this, ITER_PIPE is no longer used. Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner cc: Jens Axboe cc: Steve French cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20230522135018.2742245-30-dhowells@redhat.com Signed-off-by: Jens Axboe commit 2cb1e08985e3dc59d0a4ebf770a87e3e2410d985 Author: David Howells Date: Mon May 22 14:50:15 2023 +0100 splice: Use filemap_splice_read() instead of generic_file_splice_read() Replace pointers to generic_file_splice_read() with calls to filemap_splice_read(). Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20230522135018.2742245-29-dhowells@redhat.com Signed-off-by: Jens Axboe commit ab82513126f8b426080038517b7d290adff377bb Author: David Howells Date: Mon May 22 14:50:14 2023 +0100 cifs: Use filemap_splice_read() Make cifs use filemap_splice_read() rather than doing its own version of generic_file_splice_read(). Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Paulo Alcantara (SUSE) cc: Jens Axboe cc: Steve French cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20230522135018.2742245-28-dhowells@redhat.com Signed-off-by: Jens Axboe commit 5bd4990f19b0fedbba5511b44c1cd1fdb7061f3c Author: David Howells Date: Mon May 22 14:50:13 2023 +0100 trace: Convert trace/seq to use copy_splice_read() For the splice from the trace seq buffer, just use copy_splice_read(). In the future, something better can probably be done by gifting pages from seq->buf into the pipe, but that would require changing seq->buf into a vmap over an array of pages. Signed-off-by: David Howells cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Steven Rostedt cc: Masami Hiramatsu cc: linux-kernel@vger.kernel.org cc: linux-trace-kernel@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-27-dhowells@redhat.com Signed-off-by: Jens Axboe commit 6ef48ec391c8733c89fce33b5a6a2747aa1b8178 Author: David Howells Date: Mon May 22 14:50:12 2023 +0100 zonefs: Provide a splice-read wrapper Provide a splice_read wrapper for zonefs. This does some checks before proceeding and locks the inode across the call to filemap_splice_read() and a size check in case of truncation. Splicing from direct I/O is handled by the caller. Signed-off-by: David Howells cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Darrick J. Wong cc: linux-xfs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Acked-by: Damien Le Moal Link: https://lore.kernel.org/r/20230522135018.2742245-26-dhowells@redhat.com Signed-off-by: Jens Axboe commit 54919f94ec52549b7efcd074567ccb68c49830df Author: David Howells Date: Mon May 22 14:50:11 2023 +0100 xfs: Provide a splice-read wrapper Provide a splice_read wrapper for XFS. This does a stat count and a shutdown check before proceeding, then emits a new trace line and locks the inode across the call to filemap_splice_read() and adds to the stats afterwards. Splicing from direct I/O or DAX is handled by the caller. Signed-off-by: David Howells Reviewed-by: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Darrick J. Wong cc: linux-xfs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-25-dhowells@redhat.com Signed-off-by: Jens Axboe commit 6bbf64beabc1bdcd96474c5eb26f38258c4aea44 Author: David Howells Date: Mon May 22 14:50:10 2023 +0100 orangefs: Provide a splice-read wrapper Provide a splice_read wrapper for ocfs2. This increments the read stats and then locks the inode across the call to filemap_splice_read() and a revalidation of the mapping. Splicing from direct I/O is done by the caller. Signed-off-by: David Howells cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Mike Marshall cc: Martin Brandenburg cc: devel@lists.orangefs.org cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-24-dhowells@redhat.com Signed-off-by: Jens Axboe commit 94aca682a4eb10fe32bf3f124de9f30b9249cae0 Author: David Howells Date: Mon May 22 14:50:09 2023 +0100 ocfs2: Provide a splice-read wrapper Provide a splice_read wrapper for ocfs2. This emits trace lines and does an atime lock/update before calling filemap_splice_read(). Splicing from direct I/O is handled by the caller. A couple of new tracepoints are added for this purpose. Signed-off-by: David Howells Reviewed-by: Joseph Qi cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Mark Fasheh cc: Joel Becker cc: ocfs2-devel@oss.oracle.com cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-23-dhowells@redhat.com Signed-off-by: Jens Axboe commit 51494398807111ee0f78e03c485c422195f8cf98 Author: David Howells Date: Mon May 22 14:50:08 2023 +0100 ntfs3: Provide a splice-read wrapper Provide a splice_read wrapper for NTFS3 to perform various checks before allowing the operation to proceed. Signed-off-by: David Howells cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Konstantin Komarov cc: ntfs3@lists.linux.dev cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-22-dhowells@redhat.com Signed-off-by: Jens Axboe commit a7db503401eecfdab4fa6e7df9dd7214cb8759a4 Author: David Howells Date: Mon May 22 14:50:07 2023 +0100 nfs: Provide a splice-read wrapper Provide a splice_read wrapper for NFS. This locks the inode around filemap_splice_read() and revalidates the mapping. Splicing from direct I/O is handled by the caller. Signed-off-by: David Howells cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Trond Myklebust cc: Anna Schumaker cc: linux-nfs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-21-dhowells@redhat.com Signed-off-by: Jens Axboe commit ceb11d0e2da275ca763de25cd129cf7cce56509b Author: David Howells Date: Mon May 22 14:50:06 2023 +0100 f2fs: Provide a splice-read wrapper Provide a splice_read wrapper for f2fs. This does some checks and tracing before calling filemap_splice_read() and will update the iostats afterwards. Direct I/O is handled by the caller. Signed-off-by: David Howells cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Jaegeuk Kim cc: Chao Yu cc: linux-f2fs-devel@lists.sourceforge.net cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-20-dhowells@redhat.com Signed-off-by: Jens Axboe commit fa6c46e7c271f155c9ba3ba3457175c0a71eb918 Author: David Howells Date: Mon May 22 14:50:05 2023 +0100 ext4: Provide a splice-read wrapper Provide a splice_read wrapper for Ext4. This does the inode shutdown check before proceeding. Splicing from DAX files and O_DIRECT fds is handled by the caller. Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Acked-by: Theodore Ts'o cc: Al Viro cc: Jens Axboe cc: Andreas Dilger cc: linux-ext4@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-19-dhowells@redhat.com Signed-off-by: Jens Axboe commit 390df3b830e758e970a0ba928a97f8bbd5385f0c Author: David Howells Date: Mon May 22 14:50:04 2023 +0100 ecryptfs: Provide a splice-read wrapper Provide a splice_read wrapper for ecryptfs to update the access time on the lower file after the operation. Splicing from a direct I/O fd will update the access time when ->read_iter() is called. Signed-off-by: David Howells cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Tyler Hicks cc: ecryptfs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-18-dhowells@redhat.com Signed-off-by: Jens Axboe commit ccfdf7cbb5fe332f8d17b6eca88d96d881dd77b9 Author: David Howells Date: Mon May 22 14:50:03 2023 +0100 ceph: Provide a splice-read wrapper Provide a splice_read wrapper for Ceph. This does the inode shutdown check before proceeding and jumps to copy_splice_read() if the file has inline data or is a synchronous file. We try and get FILE_RD and either FILE_CACHE and/or FILE_LAZYIO caps and hold them across filemap_splice_read(). If we fail to get FILE_CACHE or FILE_LAZYIO capabilities, we use copy_splice_read() instead. Signed-off-by: David Howells Reviewed-by: Xiubo Li cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Ilya Dryomov cc: Jeff Layton cc: ceph-devel@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-17-dhowells@redhat.com Signed-off-by: Jens Axboe commit d96d96eebb06d41010a86cf56b4d9ea47f597152 Author: David Howells Date: Mon May 22 14:50:02 2023 +0100 afs: Provide a splice-read wrapper Provide a splice_read wrapper for AFS to call afs_validate() before going into generic_file_splice_read() so that we're likely to have a callback promise from the server. Signed-off-by: David Howells cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Marc Dionne cc: linux-afs@lists.infradead.org cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-16-dhowells@redhat.com Signed-off-by: Jens Axboe commit c829d0bd33ac0df8cece64e50ec71a63f17790f8 Author: David Howells Date: Mon May 22 14:50:01 2023 +0100 9p: Add splice_read wrapper Add a splice_read wrapper for 9p. We should use copy_splice_read() if 9PL_DIRECT is set and filemap_splice_read() otherwise. Note that this doesn't seem to be particularly related to O_DIRECT. Signed-off-by: David Howells cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Dominique Martinet cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: Christian Schoenebeck cc: v9fs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-15-dhowells@redhat.com Signed-off-by: Jens Axboe commit 67178fd066d53d5a6cada1cdc6399d02b68b708e Author: David Howells Date: Mon May 22 14:50:00 2023 +0100 net: Make sock_splice_read() use copy_splice_read() by default Make sock_splice_read() use copy_splice_read() by default as file_splice_read() will return immediately with 0 as a socket has no pagecache and is a zero-size file. Signed-off-by: David Howells cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: netdev@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-14-dhowells@redhat.com Signed-off-by: Jens Axboe commit b0072734ffaa3f5fec64058d0d3333765d789bc0 Author: David Howells Date: Mon May 22 14:49:59 2023 +0100 tty, proc, kernfs, random: Use copy_splice_read() Use copy_splice_read() for tty, procfs, kernfs and random files rather than going through generic_file_splice_read() as they just copy the file into the output buffer and don't splice pages. This avoids the need for them to have a ->read_folio() to satisfy filemap_splice_read(). Signed-off-by: David Howells Acked-by: Greg Kroah-Hartman cc: Christoph Hellwig cc: Jens Axboe cc: Al Viro cc: John Hubbard cc: David Hildenbrand cc: Matthew Wilcox cc: Miklos Szeredi cc: Arnd Bergmann cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-13-dhowells@redhat.com Signed-off-by: Jens Axboe commit a1be2935d0914ce44e8fcc4e73b3cc6256f96140 Author: David Howells Date: Mon May 22 14:49:58 2023 +0100 coda: Implement splice-read Implement splice-read for coda by passing the request down a layer rather than going through generic_file_splice_read() which is going to be changed to assume that ->read_folio() is present on buffered files. Signed-off-by: David Howells Acked-by: Jan Harkes cc: Christoph Hellwig cc: Jens Axboe cc: Al Viro cc: John Hubbard cc: David Hildenbrand cc: Matthew Wilcox cc: coda@cs.cmu.edu cc: codalist@coda.cs.cmu.edu cc: linux-unionfs@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-12-dhowells@redhat.com Signed-off-by: Jens Axboe commit d4120d87a0ed197f87c1ce1c8af4177120c2549b Author: David Howells Date: Mon May 22 14:49:57 2023 +0100 overlayfs: Implement splice-read Implement splice-read for overlayfs by passing the request down a layer rather than going through generic_file_splice_read() which is going to be changed to assume that ->read_folio() is present on buffered files. Signed-off-by: David Howells Acked-by: Christian Brauner cc: Christoph Hellwig cc: Jens Axboe cc: Al Viro cc: John Hubbard cc: David Hildenbrand cc: Matthew Wilcox cc: Miklos Szeredi cc: Amir Goldstein cc: linux-unionfs@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-11-dhowells@redhat.com Signed-off-by: Jens Axboe commit bd194b187115da7b98b660b049315f6c9c8267d1 Author: David Howells Date: Mon May 22 14:49:56 2023 +0100 shmem: Implement splice-read The new filemap_splice_read() has an implicit expectation via filemap_get_pages() that ->read_folio() exists if ->readahead() doesn't fully populate the pagecache of the file it is reading from[1], potentially leading to a jump to NULL if this doesn't exist. shmem, however, (and by extension, tmpfs, ramfs and rootfs), doesn't have ->read_folio(), Work around this by equipping shmem with its own splice-read implementation, based on filemap_splice_read(), but able to paste in zero_page when there's a page missing. Signed-off-by: David Howells cc: Daniel Golle cc: Guenter Roeck cc: Christoph Hellwig cc: Jens Axboe cc: Al Viro cc: John Hubbard cc: David Hildenbrand cc: Matthew Wilcox cc: Hugh Dickins cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/Y+pdHFFTk1TTEBsO@makrotopia.org/ [1] Link: https://lore.kernel.org/r/20230522135018.2742245-10-dhowells@redhat.com Signed-off-by: Jens Axboe commit b85930a07738a95047a51dc5bc06b18fd91a9799 Author: David Howells Date: Mon May 22 14:49:55 2023 +0100 splice: Make splice from a DAX file use copy_splice_read() Make a read splice from a DAX file go directly to copy_splice_read() to do the reading as filemap_splice_read() is unlikely to find any pagecache to splice. I think this affects only erofs, Ext2, Ext4, fuse and XFS. Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner Reviewed-by: Theodore Ts'o Reviewed-by: Gao Xiang cc: Al Viro cc: Jens Axboe cc: linux-erofs@lists.ozlabs.org cc: linux-ext4@vger.kernel.org cc: linux-xfs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-9-dhowells@redhat.com Signed-off-by: Jens Axboe commit aa3dbde878961dd333cdd3c326b93e6c84a23ed4 Author: David Howells Date: Mon May 22 14:49:54 2023 +0100 splice: Make splice from an O_DIRECT fd use copy_splice_read() Make a read splice from a file descriptor that's open O_DIRECT use copy_splice_read() to do the reading as filemap_splice_read() is unlikely to find any pagecache to splice. Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner cc: Al Viro cc: Jens Axboe cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-8-dhowells@redhat.com Signed-off-by: Jens Axboe commit 123856f0e83f457a3a24d15f561a1dd5f0d4b482 Author: David Howells Date: Mon May 22 14:49:53 2023 +0100 splice: Check for zero count in vfs_splice_read() Make vfs_splice_read() return immediately if the length is 0. Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner cc: Jens Axboe cc: Al Viro cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-7-dhowells@redhat.com Signed-off-by: Jens Axboe commit 6a3f30b8bdb23842aff5eea65b6a7693c49f5506 Author: David Howells Date: Mon May 22 14:49:52 2023 +0100 splice: Make do_splice_to() generic and export it Rename do_splice_to() to vfs_splice_read() and export it so that it can be used as a helper when calling down to a lower layer filesystem as it performs all the necessary checks[1]. Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner cc: Miklos Szeredi cc: Jens Axboe cc: Al Viro cc: John Hubbard cc: David Hildenbrand cc: Matthew Wilcox cc: linux-unionfs@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/CAJfpeguGksS3sCigmRi9hJdUec8qtM9f+_9jC1rJhsXT+dV01w@mail.gmail.com/ [1] Link: https://lore.kernel.org/r/20230522135018.2742245-6-dhowells@redhat.com Signed-off-by: Jens Axboe commit e69f37bce1b412161e11715adde30dadba0268a2 Author: David Howells Date: Mon May 22 14:49:51 2023 +0100 splice: Clean up copy_splice_read() a bit Do a couple of cleanups to copy_splice_read(): (1) Cast to struct page **, not void *. (2) Simplify the calculation of the number of pages to keep/reclaim in copy_splice_read(). Suggested-by: Christoph Hellwig Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20230522135018.2742245-5-dhowells@redhat.com Signed-off-by: Jens Axboe commit 69df79a4511117f377d6a5909b47bd4fb541b978 Author: David Howells Date: Mon May 22 14:49:50 2023 +0100 splice: Rename direct_splice_read() to copy_splice_read() Rename direct_splice_read() to copy_splice_read() to better reflect as to what it does. Suggested-by: Christoph Hellwig Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner cc: Steve French cc: Jens Axboe cc: Al Viro cc: linux-cifs@vger.kernel.org cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20230522135018.2742245-4-dhowells@redhat.com Signed-off-by: Jens Axboe commit 83aeff881e53fab5b46e4ceb5fb47fa0a22acba9 Author: David Howells Date: Mon May 22 14:49:49 2023 +0100 splice: Make filemap_splice_read() check s_maxbytes Make filemap_splice_read() check s_maxbytes analogously to filemap_read(). Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner cc: Steve French cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20230522135018.2742245-3-dhowells@redhat.com Signed-off-by: Jens Axboe commit c37222082f23c456664d1c3182a714670ab8f9a4 Author: David Howells Date: Mon May 22 14:49:48 2023 +0100 splice: Fix filemap_splice_read() to use the correct inode Fix filemap_splice_read() to use file->f_mapping->host, not file->f_inode, as the source of the file size because in the case of a block device, file->f_inode points to the block-special file (which is typically 0 length) and not the backing store. Fixes: 07073eb01c5f ("splice: Add a func to do a splice from a buffered file without ITER_PIPE") Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner cc: Steve French cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20230522135018.2742245-2-dhowells@redhat.com Signed-off-by: Jens Axboe commit 5a80bd075f3bce24793ae1aeb06066895ec5aef0 Author: Hengqi Chen Date: Sat May 20 08:40:57 2023 +0000 block: introduce block_io_start/block_io_done tracepoints Currently, several BCC ([0]) tools (biosnoop/biostacks/biotop) use kprobes to blk_account_io_start/blk_account_io_done to implement their functionalities. This is fragile because the target kernel functions may be renamed ([1]) or inlined ([2]). So introduce two new tracepoints for such use cases. [0]: https://github.com/iovisor/bcc [1]: https://github.com/iovisor/bcc/issues/3954 [2]: https://github.com/iovisor/bcc/issues/4261 Tested-by: Francis Laniel Signed-off-by: Hengqi Chen Tested-by: Yonghong Song Link: https://lore.kernel.org/r/20230520084057.1467003-1-hengqi.chen@gmail.com Signed-off-by: Jens Axboe commit 9a2cb1b31c040e2f1b313e2f7921f0f5e6b66d82 Author: Azeem Shaikh Date: Mon May 22 15:52:28 2023 +0000 drm/i915: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230522155228.2336755-1-azeemshaikh38@gmail.com commit d2e527f0d8d1124b1fab93e2e7b2c6a114c0e5a2 Author: Vlastimil Babka Date: Tue May 23 09:26:35 2023 +0200 mm/slab: remove HAVE_HARDENED_USERCOPY_ALLOCATOR With SLOB removed, both remaining allocators support hardened usercopy, so remove the config and associated #ifdef. Signed-off-by: Vlastimil Babka Reviewed-by: David Hildenbrand Reviewed-by: Lorenzo Stoakes Reviewed-by: Kees Cook Acked-by: David Rientjes Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit 8e0285ab95a9baf374f2c13eb152221c8ecb3f28 Author: Linus Walleij Date: Sun Apr 30 21:38:24 2023 +0200 ARM/musb: omap2: Remove global GPIO numbers from TUSB6010 The TUSB6010 (MUSB) device is picking up some GPIO lines hardcoded by number and passing on to the TUSB6010 device when registering it. Instead of nasty workarounds, provide a GPIO descriptor table and then make the TUSB6010 MUSB glue driver pick up the GPIO lines directly, convert it to an IRQ and pass down to the MUSB driver. OMAP2 is the only system using the TUSB6010. Stash the GPIO descriptors in the glue layer and use then to power up and down the TUSB6010 on-demand, instead of using boardfile callbacks. Since the OMAP2 boards are the only boards using the .set_power() and .board_set_power() callbacks, we can just delete them as the power is now handled directly in the TUSB6010 glue code. Cc: Bin Liu Cc: linux-usb@vger.kernel.org Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Acked-by: Greg Kroah-Hartman Signed-off-by: Linus Walleij commit 078dc5194c0ac1b8e2fc088be2168a1104e16f72 Author: Linus Walleij Date: Mon May 1 11:05:23 2023 +0200 ARM: omap2: Rewrite WLAN quirk to use GPIO descriptors The OMAP2 platform data quirk is using the global GPIO numberspace to obtain two WLAN GPIOs to drive power and xcvr reset GPIO lines during start-up. Rewrite the quirk to use a GPIO descriptor table so we avoid using global GPIO numbers. This gets rid of the final dependency on the legacy header from the OMAP2/3 platforms. Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Signed-off-by: Linus Walleij commit 94075d16beefc2304e756e3b23d8ecf0f36eecd7 Author: Linus Walleij Date: Mon May 1 11:05:22 2023 +0200 ARM: omap2: Get USB hub reset GPIO from descriptor This switches the USB hub GPIO reset line handling in the OMAP2 pdata quirks over to using GPIO descriptors to avoid using the global GPIO numberspace. Since the GPIOs are exported and assumedly used by some kind of userspace we cannot simply use hogs in the device tree. Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Signed-off-by: Linus Walleij commit d5f4fa60d63aa54ae33339895b88d8932b6037ed Author: Linus Walleij Date: Mon May 1 11:05:21 2023 +0200 ARM/gpio: Push OMAP2 quirk down into TWL4030 driver The TWL4030 GPIO driver has a custom platform data .set_up() callback to call back into the platform and do misc stuff such as hog and export a GPIO for WLAN PWR on a specific OMAP3 board. Avoid all the kludgery in the platform data and the boardfile and just put the quirks right into the driver. Make it conditional on OMAP3. I think the exported GPIO is used by some kind of userspace so ordinary DTS hogs will probably not work. Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Signed-off-by: Linus Walleij commit c729baa8604226a8f878296bd145ab4046c80b12 Author: Linus Walleij Date: Sun Apr 30 19:56:37 2023 +0200 ARM: omap1: Exorcise the legacy GPIO header After fixing all the offending users referencing the global GPIO numberspace in OMAP1, a few sites still remain including the legacy header for no reason. Delete the last remaining users, and OMAP1 is free from legacy GPIO dependencies. Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Signed-off-by: Linus Walleij commit df89de979f0e09e1896d59312362ce1657b848eb Author: Linus Walleij Date: Sun Apr 30 19:51:30 2023 +0200 ARM: omap1: Make serial wakeup GPIOs use descriptors The code in serial.c looks up GPIOs corresponding to a line on the UART when muxed in as GPIO to use this as a wakeup on serial activity for OMAP1. Utilize the NULL device to define some board-specific GPIO lookups and use these to immediately look up the same GPIOs, set as input and convert to IRQ numbers, then set these to wakeup IRQs. This is ugly but should work. This is only needed on the OSK1 and Nokia 770 devices that use the OMAP16xx. Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Signed-off-by: Linus Walleij commit 084b6f216778b4109123b396b531f12ff6c354e9 Author: Linus Walleij Date: Sun Apr 30 11:12:54 2023 +0200 ARM: omap1: Fix up the Nokia 770 board device IRQs The platform devices on the Nokia 770 is using some board-specific IRQs that get statically assigned to platform devices in the boardfile. This does not work with dynamic IRQ chip bases. Utilize the NULL device to define some board-specific GPIO lookups and use these to immediately look up the same GPIOs, convert to IRQ numbers and pass as resources to the devices. This is ugly but should work. Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Signed-off-by: Linus Walleij commit e519f0bb64efc2c9c8b67bb2d114dda458bdc34d Author: Linus Walleij Date: Mon May 8 23:20:07 2023 +0200 ARM/mmc: Convert old mmci-omap to GPIO descriptors A recent change to the OMAP driver making it use a dynamic GPIO base created problems with some old OMAP1 board files, among them Nokia 770, SX1 and also the OMAP2 Nokia n8x0. Fix up all instances of GPIOs being used for the MMC driver by pushing the handling of power, slot selection and MMC "cover" into the driver as optional GPIOs. This is maybe not the most perfect solution as the MMC framework have some central handlers for some of the stuff, but it at least makes the situtation better and solves the immediate issue. Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Acked-by: Ulf Hansson Signed-off-by: Linus Walleij commit 767d83361aaa6a1ecb4d5b89eeb38a267239917a Author: Linus Walleij Date: Mon May 8 23:20:06 2023 +0200 Input: ads7846 - Convert to use software nodes The Nokia 770 is using GPIOs from the global numberspace on the CBUS node to pass down to the LCD controller. This regresses when we let the OMAP GPIO driver use dynamic GPIO base. The Nokia 770 now has dynamic allocation of IRQ numbers, so this needs to be fixed for it to work. As this is the only user of LCD MIPID we can easily augment the driver to use a GPIO descriptor instead and resolve the issue. The platform data .shutdown() callback wasn't even used in the code, but we encode a shutdown asserting RESET in the remove() callback for completeness sake. The CBUS also has the ADS7846 touchscreen attached. Populate the devices on the Nokia 770 CBUS I2C using software nodes instead of platform data quirks. This includes the LCD and the ADS7846 touchscreen so the conversion just brings the LCD along with it as software nodes is an all-or-nothing design pattern. The ADS7846 has some limited support for using GPIO descriptors, let's convert it over completely to using device properties and then fix all remaining boardfile users to provide all platform data using software nodes. Dump the of includes and of_match_ptr() in the ADS7846 driver as part of the job. Since we have to move ADS7846 over to obtaining the GPIOs it is using exclusively from descriptors, we provide descriptor tables for the two remaining in-kernel boardfiles using ADS7846: - PXA Spitz - MIPS Alchemy DB1000 development board It was too hard for me to include software node conversion of these two remaining users at this time: the spitz is using a hscync callback in the platform data that would require further GPIO descriptor conversion of the Spitz, and moving the hsync callback down into the driver: it will just become too big of a job, but it can be done separately. The MIPS Alchemy DB1000 is simply something I cannot test, so take the easier approach of just providing some GPIO descriptors in this case as I don't want the patch to grow too intrusive. As we see that several device trees have incorrect polarity flags and just expect to bypass the gpiolib polarity handling, fix up all device trees too, in a separate patch. Suggested-by: Dmitry Torokhov Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Acked-by: Dmitry Torokhov Reviewed-by: Dmitry Torokhov Signed-off-by: Linus Walleij commit 480c82daa3e41873421dc2c9e2918ad7e21d7a0b Author: Linus Walleij Date: Sun Apr 30 17:45:29 2023 +0200 ARM: omap1: Remove reliance on GPIO numbers from SX1 It appears this happens because the OMAP driver now allocates GPIO numbers dynamically, so all that is references by number is a bit up in the air. Utilize the NULL device to define some board-specific GPIO lookups and use these to immediately look up the same GPIOs, convert to IRQ numbers and pass as resources to the devices. This is ugly but should work. Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Signed-off-by: Linus Walleij commit 4c40db6249ff1da335b276bdd6c3c3462efbc2ab Author: Linus Walleij Date: Sun Apr 30 11:56:23 2023 +0200 ARM: omap1: Remove reliance on GPIO numbers from PalmTE It appears this happens because the OMAP driver now allocates GPIO numbers dynamically, so all that is references by number is a bit up in the air. Utilize the NULL device to define some board-specific GPIO lookups and use these to immediately look up the same GPIOs, convert to IRQ numbers and pass as resources to the devices. This is ugly but should work. Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Signed-off-by: Linus Walleij commit fa1ae0cd897b089b5cc05ab471518ad13db2d567 Author: Linus Walleij Date: Sun Apr 30 11:40:28 2023 +0200 ARM: omap1: Drop header on AMS Delta The AMS Delta board uses GPIO descriptors exclusively and does not have any dependencies on the legacy header, so just drop it. Acked-by: Janusz Krzysztofik Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Signed-off-by: Linus Walleij commit c32c81f3dbdfd68f6ab20a29ad86f811aed36e4e Author: Linus Walleij Date: Sun Apr 30 11:35:05 2023 +0200 ARM/mfd/gpio: Fixup TPS65010 regression on OMAP1 OSK1 Aaro reports problems on the OSK1 board after we altered the dynamic base for GPIO allocations. It appears this happens because the OMAP driver now allocates GPIO numbers dynamically, so all that is references by number is a bit up in the air. Let's bite the bullet and try to just move the gpio_chip in the tps65010 MFD driver over to using dynamic allocations. Alter everything in the OSK1 board file to use a GPIO descriptor table and lookups. Utilize the NULL device to define some board-specific GPIO lookups and use these to immediately look up the same GPIOs, convert to IRQ numbers and pass as resources to the devices. This is ugly but should work. The .setup() callback for tps65010 was used for some GPIO hogging, but since the OSK1 is the only user in the entire kernel we can alter the signatures to something that is helpful and make a clean transition. Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Cc: Christophe Leroy Cc: andy.shevchenko@gmail.com Cc: Andreas Kemnade Acked-by: Lee Jones Reviewed-by: Lee Jones Reported-by: Aaro Koskinen Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij commit 4bd65789ba847f39e37e0041c10aad5dff1760b6 Author: Geert Uytterhoeven Date: Tue May 23 17:31:37 2023 +0200 drm: shmobile: Make DRM_SHMOBILE visible on Renesas SoC platforms The LCD Controller supported by the drm-shmob driver is present on SuperH SH-Mobile SoCs, and on Renesas ARM SH/R-Mobile SoCs. Unfortunately its config option is not visible on either, so the user can never enable the support. Fix this by dropping the dependency on ARM (for SuperH), and by widening the dependency range to ARCH_RENESAS (for ARM). Signed-off-by: Geert Uytterhoeven Reviewed-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/40ac67e0887d833ab4a3f1ec24828dedf0d8e108.1684854992.git.geert+renesas@glider.be commit 79972f160f20c82b56a248daf056ef9befcc8912 Author: Geert Uytterhoeven Date: Tue May 23 17:31:36 2023 +0200 drm: shmobile: Add missing call to drm_fbdev_generic_setup() Set up generic fbdev emulation, to enable support for the Linux console. Use 16 as the preferred depth, as that is a good compromise between colorfulness and resource utilization, and the default of the fbdev driver. Suggested-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Reviewed-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/c836938112fda21762bc9eb2741ccd0cbf1197ef.1684854992.git.geert+renesas@glider.be commit 5afe82398ffe5eac5678e74ed2bc24fc95edc2b5 Author: Geert Uytterhoeven Date: Tue May 23 17:31:35 2023 +0200 drm: shmobile: Switch to drm_crtc_init_with_planes() The SH-Mobile DRM driver uses the legacy drm_crtc_init(), which advertizes only the formats in safe_modeset_formats[] (XR24 and AR24) as being supported. Switch to drm_crtc_init_with_planes(), and advertize all supported (A)RGB modes, so we can use RGB565 as the default mode for the console. Signed-off-by: Geert Uytterhoeven Reviewed-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/2098de3d33bc479a8569da7dcbafdb685ff0a13a.1684854992.git.geert+renesas@glider.be commit 2a98bad77970103fec992dabba6fad417693c849 Author: Geert Uytterhoeven Date: Tue May 23 17:31:34 2023 +0200 drm: shmobile: Add support for DRM_FORMAT_XRGB8888 DRM_FORMAT_XRGB8888 aka XR24 is the modus francus of DRM, and should be supported by all drivers. The handling for DRM_FORMAT_XRGB8888 is similar to DRM_FORMAT_ARGB8888, just ignore the alpha channel. Signed-off-by: Geert Uytterhoeven Reviewed-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/888cde6d1f70f1610931c4a89801060bb6765ff2.1684854992.git.geert+renesas@glider.be commit d92b057f9270d83b4d71ef0a8f97b9eeb2be7a3f Author: Geert Uytterhoeven Date: Tue May 23 17:31:33 2023 +0200 drm: shmobile: Use %p4cc to print fourcc codes Replace the printing of hexadecimal fourcc format codes by pretty-printed format names, using the "%p4cc" format specifier. Signed-off-by: Geert Uytterhoeven Reviewed-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/1a63e5afc8a85f7ae10f7f4395c2d065ba1aeb59.1684854992.git.geert+renesas@glider.be commit 5565a8e1a09a3ed2ac438a9e4f4c84c11037611d Author: Azeem Shaikh Date: Tue May 23 02:19:43 2023 +0000 dma-buf/sw_sync: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/msgid/20230523021943.2406847-1-azeemshaikh38@gmail.com commit 3a48d2127f4dbd767d43bf8280b67d585e701f75 Author: Mark Brown Date: Tue May 23 22:22:27 2023 +0100 regmap: Load register defaults in blocks rather than register by register Currently we use the normal single register write function to load the default values into the cache, resulting in a large number of reallocations when there are blocks of registers as we extend the memory region we are using to store the values. Instead scan through the list of defaults for blocks of adjacent registers and do a single allocation and insert for each such block. No functional change. We do not take advantage of the maple tree preallocation, this is purely at the regcache level. It is not clear to me yet if the maple tree level would help much here or if we'd have more overhead from overallocating and then freeing maple tree data. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230523-regcache-maple-load-defaults-v1-1-0c04336f005d@kernel.org Signed-off-by: Mark Brown commit 4c8a49244c6abc5fb829d81abaaf2435ad2a44bf Author: Kent Overstreet Date: Tue May 9 15:58:47 2023 -0400 bcache: Convert to lock_cmp_fn Replace one of bcache's lockdep_set_novalidate_class() usage with the newly introduced custom lock nesting annotation. [peterz: changelog] Signed-off-by: Kent Overstreet Signed-off-by: Peter Zijlstra (Intel) Acked-by: Coly Li Link: https://lkml.kernel.org/r/20230509195847.1745548-2-kent.overstreet@linux.dev commit 0006fa2d3fa0320a385bd19c9c98b70ad3db7197 Author: Oswald Buddenhagen Date: Tue May 23 22:07:09 2023 +0200 ALSA: emu10k1: fix multi-channel capture config for E-MU cards On SB cards the number of captured channels is derived from the voice mask mixer control. But for E-MU cards this wasn't actually "wired up", so changing the mask would simply mess up the recording. We could fix that, but the channel routing through the FPGA makes the masking redundant. So instead we hide the control, and let the user specify the PCM channel count the traditional way. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230523200709.236059-5-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 848ec6cf413d151eaae11ada2953d9078f8bcda9 Author: Oswald Buddenhagen Date: Tue May 23 22:07:08 2023 +0200 ALSA: emu10k1: don't restrict capture channel count to powers of two The hardware can deal with primes up to 7 and power-of-two multiples thereof; the limitation is reflected by the possible buffer sizes. Note that setting the voice mask will not allow more than 16 channels even on Sound Blaster Audigy anymore, as 32 seems a bit excessive (the code overall appears to think so, just not in this case). Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230523200709.236059-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 872e5b2b5ee3f5b346d58dc4b89f0ca92065b61e Author: Oswald Buddenhagen Date: Tue May 23 22:07:07 2023 +0200 ALSA: emu10k1: fix support for 24 kHz capture We need to specify that the hardware supports non-standard rates, as otherwise the sound core creates a constraint which limits the rate to the specified standard rates. That also made the rate constraint we were already adding meaningless. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230523200709.236059-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit d2baa153c328efbbc3c4b939662e058b2cb544fd Author: Oswald Buddenhagen Date: Tue May 23 22:07:06 2023 +0200 ALSA: emu10k1: fix capture buffer size confusion The buffer size register sets the size of the whole buffer, not just one period. We actually handled it like that, except that the constraint was set on the wrong parameter. The period size is implicitly constrained by the buffer size and the fixed period count of 2. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230523200709.236059-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 66dd59b7aa55d0ea6c0eebfbfe4353eadaac5e1b Author: Eric Biggers Date: Sat May 20 10:31:05 2023 -0700 crypto: Kconfig - warn about performance overhead of CRYPTO_STATS Make the help text for CRYPTO_STATS explicitly mention that it reduces the performance of the crypto API. Signed-off-by: Eric Biggers Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit b04b076fb56560b39d695ac3744db457e12278fd Author: Randy Dunlap Date: Fri May 19 15:33:34 2023 -0700 crypto: nx - fix build warnings when DEBUG_FS is not enabled Fix build warnings when DEBUG_FS is not enabled by using an empty do-while loop instead of a value: In file included from ../drivers/crypto/nx/nx.c:27: ../drivers/crypto/nx/nx.c: In function 'nx_register_algs': ../drivers/crypto/nx/nx.h:173:33: warning: statement with no effect [-Wunused-value] 173 | #define NX_DEBUGFS_INIT(drv) (0) ../drivers/crypto/nx/nx.c:573:9: note: in expansion of macro 'NX_DEBUGFS_INIT' 573 | NX_DEBUGFS_INIT(&nx_driver); ../drivers/crypto/nx/nx.c: In function 'nx_remove': ../drivers/crypto/nx/nx.h:174:33: warning: statement with no effect [-Wunused-value] 174 | #define NX_DEBUGFS_FINI(drv) (0) ../drivers/crypto/nx/nx.c:793:17: note: in expansion of macro 'NX_DEBUGFS_FINI' 793 | NX_DEBUGFS_FINI(&nx_driver); Also, there is no need to build nx_debugfs.o when DEBUG_FS is not enabled, so change the Makefile to accommodate that. Fixes: ae0222b7289d ("powerpc/crypto: nx driver code supporting nx encryption") Fixes: aef7b31c8833 ("powerpc/crypto: Build files for the nx device driver") Signed-off-by: Randy Dunlap Cc: Breno Leitão Cc: Nayna Jain Cc: Paulo Flabiano Smorigo Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Herbert Xu commit 357132b5c4913ee2fd58a4b832e769fca998039d Author: Martin Kaiser Date: Fri May 19 18:11:19 2023 +0200 hwrng: imx-rngc - don't init of_device_id's data We have no device-specific data for fsl,imx25-rngb. There's no need to set .data = NULL, this is the default. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit ac2cc2406e5d3b5898392dfc5e67db3af3ddfcf8 Author: Martin Kaiser Date: Fri May 19 18:11:18 2023 +0200 hwrng: imx-rngc - mark the probe function as __init Mark the imx_rngc_probe function as __init. There's no need to support hotplugging in the imx-rngc driver. We use module_platform_driver_probe, the probe function will only be called at startup. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit 44777807fbf2cbb0c5a6c049f382b428302e5200 Author: Martin Kaiser Date: Fri May 19 18:04:33 2023 +0200 hwrng: imx-rngc - use BIT(x) for register bit defines Rewrite the defines for register bits to use BIT(x) instead of writing out the 32-bit number. This makes it easier to compare the code with the register descriptions in the reference manual. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit cbd077813505765273f639aef13a10d81107e1aa Author: Martin Kaiser Date: Fri May 19 18:04:32 2023 +0200 hwrng: imx-rngc - use bitfield macros to read rng type Use the mechanism from bitfield.h to read the rng type field in the version_id register. This makes the code a tiny bit simpler. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit 97ecafc4f6566f538bbde09d3a8baae4a3419eef Author: Martin Kaiser Date: Fri May 19 18:04:31 2023 +0200 hwrng: imx-rngc - simpler check for available random bytes The "level" field in the status register contains the number of random bytes that are available in the FIFO. Use GENMASK to extract this field. We only want to check if level is 0 or if we can read another byte. There's no need for the shift or the level variable. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit b7be31b0d5088507b745bfa014798e52fad6dc7a Author: Herbert Xu Date: Fri May 19 17:04:04 2023 +0800 crypto: shash - Allow cloning on algorithms with no init_tfm Some shash algorithms are so simple that they don't have an init_tfm function. These can be cloned trivially. Check this before failing in crypto_clone_shash. Signed-off-by: Herbert Xu Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit ed51bba18f563594b5ddf7aaa5fd61abe5e474ae Author: Herbert Xu Date: Fri May 19 16:28:37 2023 +0800 crypto: cmac - Add support for cloning Allow cmac to be cloned. The underlying cipher needs to support cloning by not having a cra_init function (all implementations of aes that do not require a fallback can be cloned). Signed-off-by: Herbert Xu Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit 51d8d6d0f4bedb6a4e9afb20857bb592424de144 Author: Herbert Xu Date: Fri May 19 16:28:35 2023 +0800 crypto: cipher - Add crypto_clone_cipher Allow simple ciphers to be cloned, if they don't have a cra_init function. This basically rules out those ciphers that require a fallback. In future simple ciphers will be eliminated, and replaced with a linear skcipher interface. When that happens this restriction will disappear. Signed-off-by: Herbert Xu Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit cf2eddc931ab6e4dd96d38bd75ef8aac3422a8f4 Author: Herbert Xu Date: Fri May 19 16:28:32 2023 +0800 crypto: cmac - Use modern init_tfm/exit_tfm Use the modern init_tfm/exit_tfm interface instead of the obsolete cra_init/cra_exit interface. Signed-off-by: Herbert Xu Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit 4e3901fa8452f7c26b999f3e93c5f18b4b03e9cf Author: Arnd Bergmann Date: Tue May 16 22:28:48 2023 +0200 crypto: aegis128-neon - add header for internal prototypes gcc warns if prototypes are only visible to the caller but not the callee: crypto/aegis128-neon-inner.c:134:6: warning: no previous prototype for 'crypto_aegis128_init_neon' [-Wmissing-prototypes] crypto/aegis128-neon-inner.c:164:6: warning: no previous prototype for 'crypto_aegis128_update_neon' [-Wmissing-prototypes] crypto/aegis128-neon-inner.c:221:6: warning: no previous prototype for 'crypto_aegis128_encrypt_chunk_neon' [-Wmissing-prototypes] crypto/aegis128-neon-inner.c:270:6: warning: no previous prototype for 'crypto_aegis128_decrypt_chunk_neon' [-Wmissing-prototypes] crypto/aegis128-neon-inner.c:316:5: warning: no previous prototype for 'crypto_aegis128_final_neon' [-Wmissing-prototypes] The prototypes cannot be in the regular aegis.h, as the inner neon code cannot include normal kernel headers. Instead add a new header just for the functions provided by this file. Signed-off-by: Arnd Bergmann Signed-off-by: Herbert Xu commit f4ab59503989cce2c12a3c6337779218a5538ddd Author: Oswald Buddenhagen Date: Tue May 23 22:07:09 2023 +0200 ALSA: emu10k1: make channel count of multi-channel playback flexible There is no reason to nail it to 16 channels. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230523200709.236023-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 11ee59bdac36ae4b500301a6a3ccf586d3968d92 Author: Oswald Buddenhagen Date: Tue May 23 22:07:08 2023 +0200 ALSA: emu10k1: add synchronized start of multi-channel playback We use independent voices for the channels, so we need to make an effort to ensure that they are actually in sync. The hardware doesn't provide atomicity, so we may need to retry a few times, due to NMIs, PCI contention, and the wrong phase of the moon. Solution inspired by kX-project. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230523200709.236023-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 6dbecb9b51321bfaf8e7f26fc163d547abcbee86 Author: Oswald Buddenhagen Date: Tue May 23 22:07:07 2023 +0200 ALSA: emu10k1: don't limit multi-channel playback to two periods For unclear reasons, the extra voice was set up with half the buffer size instead of the period size. Commit 27ae958cf6 ("emu10k1 driver - add multichannel device hw:x,3 [2-8/8]") mentions half-loop interrupts, so maybe this was an artifact of an earlier iteration of the patch. While at it, also fix periods_min of the regular playback - one period makes just no sense. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230523200709.236023-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 01bc4ac9da94f972aabc33fc658609e2732a26e2 Merge: 8ce1bb9a59353 44c026a73be80 Author: Mark Brown Date: Wed May 24 11:02:23 2023 +0100 spi: Merge up v6.4-rc3 Merge up v6.4-rc3 in order to get fixes to improve the stability of my CI. commit 6c594a820f8fa5ec3619715e32ff5314852ee26b Merge: e6beda565b2b1 44c026a73be80 Author: Mark Brown Date: Wed May 24 11:01:38 2023 +0100 regulator: Merge up v6.4-rc3 Merge up v6.4-rc3 in order to get fixes to improve the stability of my CI. commit 6a038f0183dd5d3e289f6c1fe6962de9b31f8fd2 Author: Artur Weber Date: Wed May 24 10:43:24 2023 +0200 drm/panel: samsung-s6d7aa0: use pointer for drm_mode in panel desc struct Fixes compilation issues with older GCC versions and Clang after changes introduced in commit 6810bb390282 ("drm/panel: Add Samsung S6D7AA0 panel controller driver"). Tested with GCC 13.1.1, GCC 6.4.0 and Clang 16.0.3. Fixes the following errors with Clang: drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:312:14: error: initializer element is not a compile-time constant .drm_mode = s6d7aa0_lsl080al02_mode, ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:415:14: error: initializer element is not a compile-time constant .drm_mode = s6d7aa0_lsl080al03_mode, ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:443:14: error: initializer element is not a compile-time constant .drm_mode = s6d7aa0_ltl101at01_mode, ^~~~~~~~~~~~~~~~~~~~~~~ 3 errors generated. Fixes the following errors with GCC: drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:312:14: error: initializer element is not constant .drm_mode = s6d7aa0_lsl080al02_mode, ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:312:14: note: (near initialization for 's6d7aa0_lsl080al02_desc.drm_mode') drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:415:14: error: initializer element is not constant .drm_mode = s6d7aa0_lsl080al03_mode, ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:415:14: note: (near initialization for 's6d7aa0_lsl080al03_desc.drm_mode') drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:443:14: error: initializer element is not constant .drm_mode = s6d7aa0_ltl101at01_mode, ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:443:14: note: (near initialization for 's6d7aa0_ltl101at01_desc.drm_mode') Reported-by: Nathan Chancellor Link: https://lore.kernel.org/lkml/20230523180212.GA1401867@dev-arch.thelio-3990X Reported-by: kernelci.org bot Link: https://lore.kernel.org/llvm/646c6def.a70a0220.58c1a.903d@mx.google.com Fixes: 6810bb390282 ("drm/panel: Add Samsung S6D7AA0 panel controller driver") Signed-off-by: Artur Weber Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230524084324.11840-1-aweber.kernel@gmail.com commit 721255b9826bd11c7a38b585905fc2dd0fb94e52 Author: Shanker Donthineni Date: Fri May 19 08:49:02 2023 -0500 genirq: Use a maple tree for interrupt descriptor management The current implementation uses a static bitmap for interrupt descriptor allocation and a radix tree to pointer store the pointer for lookup. However, the size of the bitmap is constrained by the build time macro MAX_SPARSE_IRQS, which may not be sufficient to support high-end servers, particularly those with GICv4.1 hardware, which require a large interrupt space to cover LPIs and vSGIs. Replace the bitmap and the radix tree with a maple tree, which not only stores pointers for lookup, but also provides a mechanism to find free ranges. That removes the build time hardcoded upper limit. Signed-off-by: Shanker Donthineni Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230519134902.1495562-4-sdonthineni@nvidia.com commit 5e630aa8d9fcd4c0cb6d5d09422009533aba979a Author: Shanker Donthineni Date: Fri May 19 08:49:01 2023 -0500 genirq: Encapsulate sparse bitmap handling Move the open coded sparse bitmap handling into helper functions as a preparatory step for converting the sparse interrupt management to a maple tree. No functional change. Signed-off-by: Shanker Donthineni Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230519134902.1495562-3-sdonthineni@nvidia.com commit bc06a9e0874239cb6d4eebcb0ecd1a91ad9272db Author: Shanker Donthineni Date: Fri May 19 08:49:00 2023 -0500 genirq: Use hlist for managing resend handlers The current implementation utilizes a bitmap for managing interrupt resend handlers, which is allocated based on the SPARSE_IRQ/NR_IRQS macros. However, this method may not efficiently utilize memory during runtime, particularly when IRQ_BITMAP_BITS is large. Address this issue by using an hlist to manage interrupt resend handlers instead of relying on a static bitmap memory allocation. Additionally, a new function, clear_irq_resend(), is introduced and called from irq_shutdown to ensure a graceful teardown of the interrupt. Signed-off-by: Shanker Donthineni Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230519134902.1495562-2-sdonthineni@nvidia.com commit 41a45ea49d3a74777c8e36b1fe644467bf91a273 Merge: 47469d2d5913a 9277649c66fe7 Author: David S. Miller Date: Wed May 24 10:34:26 2023 +0100 Merge branch 'devlink-port_del-new-cleanup' Jiri Pirko says: ==================== devlink: small port_new/del() cleanup This patchset cleans up couple of leftovers after recent devlink locking changes. Previously, both port_new/dev() commands were called without holding instance lock. Currently all devlink commands are called with instance lock held. The first patch just removes redundant port notification. The second one removes couple of outdated comments. The last patch changes port_dev() to have devlink_port pointer as an arg instead of port_index, which makes it similar to the rest of port related ops. ==================== Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 9277649c66fe7cb0e2f8adb09621556bcfb052c7 Author: Jiri Pirko Date: Tue May 23 14:38:01 2023 +0200 devlink: pass devlink_port pointer to ops->port_del() instead of index Historically there was a reason why port_dev() along with for example port_split() did get port_index instead of the devlink_port pointer. With the locking changes that were done which ensured devlink instance mutex is hold for every command, the port ops could get devlink_port pointer directly. Change the forgotten port_dev() op to be as others and pass devlink_port pointer instead of port_index. Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 1bb1b57898504da4e10d48b901556278e161c7fd Author: Jiri Pirko Date: Tue May 23 14:38:00 2023 +0200 devlink: remove no longer true locking comment from port_new/del() All commands are called holding instance lock. Remove the outdated comment that says otherwise. Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit c496daeb863093a046e0bb8db7265bf45d91775a Author: Jiri Pirko Date: Tue May 23 14:37:59 2023 +0200 devlink: remove duplicate port notification The notification about created port is send from devl_port_register() function called from ops->port_new(). No need to send it again here, so remove the call and the helper function. Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 4ceb0c70d0dae0f1327c4cfda3826b98a885f735 Author: Claudiu Beznea Date: Mon May 22 15:48:12 2023 +0300 ARM: dts: at91: sama5d2: remove extra line Remove extra line from the definition of slow clock controller. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230522124812.107227-1-claudiu.beznea@microchip.com commit aa4b92c5234878d55da96d387ea4d3695ca5e4ab Author: Danila Chernetsov Date: Fri May 19 00:21:46 2023 +0900 ntfs: do not dereference a null ctx on error In ntfs_mft_data_extend_allocation_nolock(), if an error condition occurs prior to 'ctx' being set to a non-NULL value, avoid dereferencing the NULL 'ctx' pointer in error handling. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Danila Chernetsov Reviewed-by: Namjae Jeon Signed-off-by: Christian Brauner commit b7a9a503c38d665c05a789132b632d81ec0b2703 Author: David Sterba Date: Tue May 23 18:26:28 2023 +0200 fs: use UB-safe check for signed addition overflow in remap_verify_area The following warning pops up with enabled UBSAN in tests fstests/generic/303: [23127.529395] UBSAN: Undefined behaviour in fs/read_write.c:1725:7 [23127.529400] signed integer overflow: [23127.529403] 4611686018427322368 + 9223372036854775807 cannot be represented in type 'long long int' [23127.529412] CPU: 4 PID: 26180 Comm: xfs_io Not tainted 5.2.0-rc2-1.ge195904-vanilla+ #450 [23127.556999] Hardware name: empty empty/S3993, BIOS PAQEX0-3 02/24/2008 [23127.557001] Call Trace: [23127.557060] dump_stack+0x67/0x9b [23127.557070] ubsan_epilogue+0x9/0x40 [23127.573496] handle_overflow+0xb3/0xc0 [23127.573514] do_clone_file_range+0x28f/0x2a0 [23127.573547] vfs_clone_file_range+0x35/0xb0 [23127.573564] ioctl_file_clone+0x8d/0xc0 [23127.590144] do_vfs_ioctl+0x300/0x700 [23127.590160] ksys_ioctl+0x70/0x80 [23127.590203] ? trace_hardirqs_off_thunk+0x1a/0x1c [23127.590210] __x64_sys_ioctl+0x16/0x20 [23127.590215] do_syscall_64+0x5c/0x1d0 [23127.590224] entry_SYSCALL_64_after_hwframe+0x49/0xbe [23127.590231] RIP: 0033:0x7ff6d7250327 [23127.590241] RSP: 002b:00007ffe3a38f1d8 EFLAGS: 00000206 ORIG_RAX: 0000000000000010 [23127.590246] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007ff6d7250327 [23127.590249] RDX: 00007ffe3a38f220 RSI: 000000004020940d RDI: 0000000000000003 [23127.590252] RBP: 0000000000000000 R08: 00007ffe3a3c80a0 R09: 00007ffe3a3c8080 [23127.590255] R10: 000000000fa99fa0 R11: 0000000000000206 R12: 0000000000000000 [23127.590260] R13: 0000000000000000 R14: 3fffffffffff0000 R15: 00007ff6d750a20c As loff_t is a signed type, we should use the safe overflow checks instead of relying on compiler implementation. The bogus values are intentional and the test is supposed to verify the boundary conditions. Signed-off-by: David Sterba Message-Id: <20230523162628.17071-1-dsterba@suse.com> Signed-off-by: Christian Brauner commit 493f349e38d022057b3b6e13f589f108269c42b0 Author: Yuwei Guan Date: Fri May 19 18:53:21 2023 +0800 memblock: Add flags and nid info in memblock debugfs Currently, the memblock debugfs can display the count of memblock_type and the base and end of the reg. However, when memblock_mark_*() or memblock_set_node() is executed on some range, the information in the existing debugfs cannot make it clear why the address is not consecutive. For example, cat /sys/kernel/debug/memblock/memory 0: 0x0000000080000000..0x00000000901fffff 1: 0x0000000090200000..0x00000000905fffff 2: 0x0000000090600000..0x0000000092ffffff 3: 0x0000000093000000..0x00000000973fffff 4: 0x0000000097400000..0x00000000b71fffff 5: 0x00000000c0000000..0x00000000dfffffff 6: 0x00000000e2500000..0x00000000f87fffff 7: 0x00000000f8800000..0x00000000fa7fffff 8: 0x00000000fa800000..0x00000000fd3effff 9: 0x00000000fd3f0000..0x00000000fd3fefff 10: 0x00000000fd3ff000..0x00000000fd7fffff 11: 0x00000000fd800000..0x00000000fd901fff 12: 0x00000000fd902000..0x00000000fd909fff 13: 0x00000000fd90a000..0x00000000fd90bfff 14: 0x00000000fd90c000..0x00000000ffffffff 15: 0x0000000880000000..0x0000000affffffff So we can add flags and nid to this debugfs. For example, cat /sys/kernel/debug/memblock/memory 0: 0x0000000080000000..0x00000000901fffff 0 NONE 1: 0x0000000090200000..0x00000000905fffff 0 NOMAP 2: 0x0000000090600000..0x0000000092ffffff 0 NONE 3: 0x0000000093000000..0x00000000973fffff 0 NOMAP 4: 0x0000000097400000..0x00000000b71fffff 0 NONE 5: 0x00000000c0000000..0x00000000dfffffff 0 NONE 6: 0x00000000e2500000..0x00000000f87fffff 0 NONE 7: 0x00000000f8800000..0x00000000fa7fffff 0 NOMAP 8: 0x00000000fa800000..0x00000000fd3effff 0 NONE 9: 0x00000000fd3f0000..0x00000000fd3fefff 0 NOMAP 10: 0x00000000fd3ff000..0x00000000fd7fffff 0 NONE 11: 0x00000000fd800000..0x00000000fd901fff 0 NOMAP 12: 0x00000000fd902000..0x00000000fd909fff 0 NONE 13: 0x00000000fd90a000..0x00000000fd90bfff 0 NOMAP 14: 0x00000000fd90c000..0x00000000ffffffff 0 NONE 15: 0x0000000880000000..0x0000000affffffff 0 NONE Signed-off-by: Yuwei Guan Reviewed-by: Anshuman Khandual Reviewed-by: Kefeng Wang Link: https://lore.kernel.org/r/20230519105321.333-1-ssawgyw@gmail.com Signed-off-by: Mike Rapoport (IBM) commit fc493f83a25835c14cd96379c1a07459230881bc Author: Claudio Migliorelli Date: Sun Apr 23 15:29:35 2023 +0200 Fix some coding style errors in memblock.c This patch removes the initialization of some static variables to 0 and `false` in the memblock source file, according to the coding style guidelines. Signed-off-by: Claudio Migliorelli Link: https://lore.kernel.org/r/87r0sa7mm8.fsf@mail.polimi.it Signed-off-by: Mike Rapoport (IBM) commit b842f4f55810b5d94dbbdda00f38dce38ec1bbb6 Author: Claudio Migliorelli Date: Sat Feb 25 19:07:11 2023 +0100 Add tests for memblock_alloc_node() This test is aimed at verifying the memblock_alloc_node() to work as expected, so setting the correct NUMA node for the new allocated region. The memblock_alloc_node() is called directly without using any stub. The core check is between the requested NUMA node and the `nid` field inside the memblock_region structure. These two are supposed to be equal for the test to succeed. Signed-off-by: Claudio Migliorelli Link: https://lore.kernel.org/r/ea5e938e-6b74-b188-af59-4b94b18bc0@mail.polimi.it Signed-off-by: Mike Rapoport (IBM) commit 35216718c9ac2aef934ea9cd229572d4996807b2 Author: Dan Carpenter Date: Mon May 22 10:44:54 2023 +0300 pinctrl: at91: fix a couple NULL vs IS_ERR() checks The devm_kasprintf_strarray() function doesn't return NULL on error, it returns error pointers. Update the checks accordingly. Fixes: f494c1913cbb ("pinctrl: at91: use devm_kasprintf() to avoid potential leaks (part 2)") Signed-off-by: Dan Carpenter Reviewed-by: Claudiu Beznea Reviewed-by: Andy Shevchenko Acked-by: Ryan Wanner Link: https://lore.kernel.org/r/5697980e-f687-47a7-9db8-2af34ae464bd@kili.mountain Signed-off-by: Linus Walleij commit 772be1da8e51ad087b88372e8df10ba4a571f9af Author: Ryan Wanner Date: Wed May 17 13:54:04 2023 +0200 pinctrl: at91-pio4: Enable Push-Pull configuration Enable push-pull configuration. Remove integer value argument from open-drain configuration as it is discarded when pinconf function is called from gpiolib. Add push-pull do debug and get functions. Signed-off-by: Ryan Wanner Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/d898c31277f6bce6f7d830edf4332ff605498c7b.1684313910.git.Ryan.Wanner@microchip.com [Fix two coding style issues] Signed-off-by: Linus Walleij commit 93bd39f05fc8be54224e37e7ee7ea074e1e5e029 Author: Ryan Wanner Date: Wed May 17 13:54:05 2023 +0200 dt-bindings: pinctrl: at91-pio4: Add push-pull support Add generic push-pull support for pio4 driver. Signed-off-by: Ryan Wanner Acked-by: Conor Dooley Reviewed-by: Conor Dooley Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/048a41d1dcb3da0e845986a73eaac61a54c69269.1684313910.git.Ryan.Wanner@microchip.com Signed-off-by: Linus Walleij commit 47469d2d5913af91f21316230f066692cb6a4c9f Merge: 59088b5a946ee bddd2e561b0ad Author: David S. Miller Date: Wed May 24 08:46:54 2023 +0100 Merge branch 'tools-ynl-byteorder' Donald Hunter says: ==================== tools: ynl: Add byte-order support for struct members This patchset adds support to ynl for handling byte-order in struct members. The first patch is a refactor to use predefined Struct() objects instead of generating byte-order specific formats on the fly. The second patch adds byte-order handling for struct members. ==================== Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit bddd2e561b0ad5ca42e16fb26a20fc806d521912 Author: Donald Hunter Date: Tue May 23 10:37:48 2023 +0100 tools: ynl: Handle byte-order in struct members Add support for byte-order in struct members in the genetlink-legacy spec. Signed-off-by: Donald Hunter Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 7c2435ef76e5f2d9fac44b241e4a54113f6eafbf Author: Donald Hunter Date: Tue May 23 10:37:47 2023 +0100 tools: ynl: Use dict of predefined Structs to decode scalar types Use a dict of predefined Struct() objects to decode scalar types in native, big or little endian format. This removes the repetitive code for the scalar variants and ensures all the signed variants are supported. Signed-off-by: Donald Hunter Signed-off-by: David S. Miller commit 59088b5a946ee8a6603a9a84781670cedb01c40d Author: Russell King (Oracle) Date: Mon May 22 16:58:08 2023 +0100 net: phy: avoid kernel warning dump when stopping an errored PHY When taking a network interface down (or removing a SFP module) after the PHY has encountered an error, phy_stop() complains incorrectly that it was called from HALTED state. The reason this is incorrect is that the network driver will have called phy_start() when the interface was brought up, and the fact that the PHY has a problem bears no relationship to the administrative state of the interface. Taking the interface administratively down (which calls phy_stop()) is always the right thing to do after a successful phy_start() call, whether or not the PHY has encountered an error. Signed-off-by: Russell King (Oracle) Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 18731fe01d3de0721c7f6ba326e838a034d3114e Merge: a695641c8eaac 0e26371db5488 Author: David S. Miller Date: Wed May 24 08:22:06 2023 +0100 Merge branch 'RTO_ONLINK' Guillaume Nault says: ==================== ipv4: Remove RTO_ONLINK from udp, ping and raw sockets. udp_sendmsg(), ping_v4_sendmsg() and raw_sendmsg() use similar patterns for restricting their route lookup to on-link hosts. Although they use slightly different code, they all use RTO_ONLINK to override the least significant bit of their tos value. RTO_ONLINK is used to restrict the route scope even when the scope is set to RT_SCOPE_UNIVERSE. Therefore it isn't necessary: we can properly set the scope to RT_SCOPE_LINK instead. Removing RTO_ONLINK will allow to convert .flowi4_tos to dscp_t in the future, thus allowing to properly separate the DSCP from the ECN bits in the networking stack. This patch series defines a common helper to figure out what's the scope of the route lookup. This unifies the way udp, ping and raw sockets get their routing scope and removes their dependency on RTO_ONLINK. ==================== Signed-off-by: David S. Miller commit 0e26371db548834052a8f0c3e138c5ff07e253a0 Author: Guillaume Nault Date: Mon May 22 16:38:07 2023 +0200 udp: Stop using RTO_ONLINK. Use ip_sendmsg_scope() to properly initialise the scope in flowi4_init_output(), instead of overriding tos with the RTO_ONLINK flag. The objective is to eventually remove RTO_ONLINK, which will allow converting .flowi4_tos to dscp_t. Now that the scope is determined by ip_sendmsg_scope(), we need to check its result to set the 'connected' variable. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: David S. Miller commit c85be08fc4fa44f07167be0377ebaa8d36b1dd58 Author: Guillaume Nault Date: Mon May 22 16:38:02 2023 +0200 raw: Stop using RTO_ONLINK. Use ip_sendmsg_scope() to properly initialise the scope in flowi4_init_output(), instead of overriding tos with the RTO_ONLINK flag. The objective is to eventually remove RTO_ONLINK, which will allow converting .flowi4_tos to dscp_t. The MSG_DONTROUTE and SOCK_LOCALROUTE cases were already handled by raw_sendmsg() (SOCK_LOCALROUTE was handled by the RT_CONN_FLAGS*() macros called by get_rtconn_flags()). However, opt.is_strictroute wasn't taken into account. Therefore, a side effect of this patch is to now honour opt.is_strictroute, and thus align raw_sendmsg() with ping_v4_sendmsg() and udp_sendmsg(). Since raw_sendmsg() was the only user of get_rtconn_flags(), we can now remove this function. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 726de790f66029a7654b3e748f8d3e7888a30ae5 Author: Guillaume Nault Date: Mon May 22 16:37:57 2023 +0200 ping: Stop using RTO_ONLINK. Define a new helper to figure out the correct route scope to use on TX, depending on socket configuration, ancillary data and send flags. Use this new helper to properly initialise the scope in flowi4_init_output(), instead of overriding tos with the RTO_ONLINK flag. The objective is to eventually remove RTO_ONLINK, which will allow converting .flowi4_tos to dscp_t. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: David S. Miller commit e7684f3baefe9c36db40c19389eb4a93189a114f Merge: 03a58514d494f dafb82e7d3976 Author: Takashi Iwai Date: Wed May 24 09:10:09 2023 +0200 Merge branch 'topic/midi20' into for-next Pull a fixup for build error on big-endian archs. Signed-off-by: Takashi Iwai commit dafb82e7d39767f11660705a518a551251fbdfe4 Author: Stephen Rothwell Date: Wed May 24 13:54:48 2023 +1000 ALSA: ump: Correct snd_ump_midi1_msg_program definition The #endif is placed obviously at a wrong position, which caused a build error on the big endian machine. Fixes: 0b5288f5fe63 ("ALSA: ump: Add legacy raw MIDI support") Signed-off-by: Stephen Rothwell Link: https://lore.kernel.org/r/20230524135448.3ecad334@canb.auug.org.au Signed-off-by: Takashi Iwai commit 907514a7dc4c574136e8fb576b014be05d25813a Author: Jisheng Zhang Date: Sun May 21 18:02:52 2023 +0800 dmaengine: sprd: Don't set chancnt The dma framework will calculate the dma channels chancnt, setting it ourself is wrong. Signed-off-by: Jisheng Zhang Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/20230521100252.3197-6-jszhang@kernel.org Signed-off-by: Vinod Koul commit a10119a8b49bbd59c1bea4dfe5ea75d08d8506e5 Author: Jisheng Zhang Date: Sun May 21 18:02:51 2023 +0800 dmaengine: hidma: Don't set chancnt The dma framework will calculate the dma channels chancnt, setting it ourself is wrong. Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20230521100252.3197-5-jszhang@kernel.org Signed-off-by: Vinod Koul commit c68533337cad07e9239b7cac42d4e07f844ba95b Author: Jisheng Zhang Date: Sun May 21 18:02:50 2023 +0800 dmaengine: plx_dma: Don't set chancnt The dma framework will calculate the dma channels chancnt, setting it ourself is wrong. Signed-off-by: Jisheng Zhang Acked-by: Logan Gunthorpe Link: https://lore.kernel.org/r/20230521100252.3197-4-jszhang@kernel.org Signed-off-by: Vinod Koul commit d27afd7ae6a316fac4d1f613db2de02ce1e872a4 Author: Jisheng Zhang Date: Sun May 21 18:02:49 2023 +0800 dmaengine: axi-dmac: Don't set chancnt The dma framework will calculate the dma channels chancnt, setting it ourself is wrong. Signed-off-by: Jisheng Zhang Acked-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20230521100252.3197-3-jszhang@kernel.org Signed-off-by: Vinod Koul commit 3a4905c59832896f811f8b3e840be936ae598dd1 Author: Jisheng Zhang Date: Sun May 21 18:02:48 2023 +0800 dmaengine: dw-axi-dmac: Don't set chancnt The dma framework will calculate the dma channels chancnt, setting it ourself is wrong. Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20230521100252.3197-2-jszhang@kernel.org Signed-off-by: Vinod Koul commit 8975dd41a9dbca3b47f7b8dac5bc4dfb23011000 Author: Stephan Gerhold Date: Fri May 19 13:00:13 2023 +0200 dmaengine: qcom: bam_dma: allow omitting num-{channels,ees} The bam_dma driver needs to know the number of channels and execution environments (EEs) at probe time. If we are in full control of the BAM controller this information can be obtained from the BAM identification registers (BAM_REVISION/BAM_NUM_PIPES). When the BAM is "controlled remotely" it is more complicated. The BAM might not be on at probe time, so reading the registers could fail. This is why the information must be added to the device tree in this case, using "num-channels" and "qcom,num-ees". However, there are also some BAM instances that are initialized by something else but we still have a clock that allows to turn it on when needed. This can be set up in the DT with "qcom,controlled-remotely" and "clocks" and is already supported by the bam_dma driver. Examples for this are the typical BLSP BAM instances on older SoCs, QPIC BAM (for NAND) and the crypto BAM on some SoCs. In this case, there is no need to read "num-channels" and "qcom,num-ees" from the DT. The BAN can be turned on using the clock so we can just read it from the BAM registers like in the normal case. Check for the BAM clock earlier and skip reading "num-channels" and "qcom,num-ees" if it is present to allow simplifying the DT description a bit. Signed-off-by: Stephan Gerhold Reviewed-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20230518-bamclk-dt-v2-1-a1a857b966ca@gerhold.net Signed-off-by: Vinod Koul commit 353d5c241e83c4de04ca5ec0d7922bfb0809aa25 Author: Cai Huoqing Date: Sat May 20 13:08:52 2023 +0800 dmaengine: dw-edma: Add HDMA DebugFS support Add HDMA DebugFS support to show registers content Signed-off-by: Cai Huoqing Reviewed-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Tested-by: Serge Semin Link: https://lore.kernel.org/r/20230520050854.73160-5-cai.huoqing@linux.dev Signed-off-by: Vinod Koul commit e74c39573d35e9ac441090ff8183aa3dc2540649 Author: Cai Huoqing Date: Sat May 20 13:08:51 2023 +0800 dmaengine: dw-edma: Add support for native HDMA Add support for HDMA NATIVE, as long the IP design has set the compatible register map parameter-HDMA_NATIVE, which allows compatibility for native HDMA register configuration. The HDMA Hyper-DMA IP is an enhancement of the eDMA embedded-DMA IP. And the native HDMA registers are different from eDMA, so this patch add support for HDMA NATIVE mode. HDMA write and read channels operate independently to maximize the performance of the HDMA read and write data transfer over the link When you configure the HDMA with multiple read channels, then it uses a round robin (RR) arbitration scheme to select the next read channel to be serviced.The same applies when you have multiple write channels. The native HDMA driver also supports a maximum of 16 independent channels (8 write + 8 read), which can run simultaneously. Both SAR (Source Address Register) and DAR (Destination Address Register) are aligned to byte. Signed-off-by: Cai Huoqing Reviewed-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Tested-by: Serge Semin Link: https://lore.kernel.org/r/20230520050854.73160-4-cai.huoqing@linux.dev Signed-off-by: Vinod Koul commit f9c3403f1fabf6b21dad67a2a0641ea18a48de21 Author: Cai Huoqing Date: Sat May 20 13:08:50 2023 +0800 dmaengine: dw-edma: Create a new dw_edma_core_ops structure to abstract controller operation The structure dw_edma_core_ops has a set of the pointers abstracting out the DW eDMA vX and DW HDMA Native controllers. And use dw_edma_v0_core_register to set up operation. Signed-off-by: Cai Huoqing Reviewed-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Tested-by: Serge Semin Link: https://lore.kernel.org/r/20230520050854.73160-3-cai.huoqing@linux.dev Signed-off-by: Vinod Koul commit 487517557f97809c38ff99f726ec991ab6aa8a73 Author: Cai Huoqing Date: Sat May 20 13:08:49 2023 +0800 dmaengine: dw-edma: Rename dw_edma_core_ops structure to dw_edma_plat_ops The dw_edma_core_ops structure contains a set of the operations: device IRQ numbers getter, CPU/PCI address translation. Based on the functions semantics the structure name "dw_edma_plat_ops" looks more descriptive since indeed the operations are platform-specific. The "dw_edma_core_ops" name shall be used for a structure with the IP-core specific set of callbacks in order to abstract out DW eDMA and DW HDMA setups. Such structure will be added in one of the next commit in the framework of the set of changes adding the DW HDMA device support. Anyway the renaming was necessary to distinguish two types of the implementation callbacks: 1. DW eDMA/hDMA IP-core specific operations: device-specific CSR setups in one or another aspect of the DMA-engine initialization. 2. DW eDMA/hDMA platform specific operations: the DMA device environment configs like IRQs, address translation, etc. Signed-off-by: Cai Huoqing Reviewed-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Tested-by: Serge Semin Link: https://lore.kernel.org/r/20230520050854.73160-2-cai.huoqing@linux.dev Signed-off-by: Vinod Koul commit f1138fda1b0db43ff63d19923f8e84951c0c4d1c Author: Mika Westerberg Date: Fri Mar 24 18:30:00 2023 +0200 thunderbolt: Drop retimer vendor check This is not needed anymore as we already handle unknown vendor in NVM functions. Signed-off-by: Mika Westerberg commit 88a9ded93453dea6748572242faf30f199be4f41 Author: Mika Westerberg Date: Fri Mar 24 20:44:56 2023 +0200 thunderbolt: dma_test: Update MODULE_DESCRIPTION Make the description match the core driver and the networking with Thunderbolt/USB4 prefix. No functional changes. Signed-off-by: Mika Westerberg commit 714e57aa3bcd9c35b856343d68e82ae0cab4e181 Author: Mika Westerberg Date: Fri Mar 24 20:43:49 2023 +0200 thunderbolt: Add MODULE_DESCRIPTION Add description about the driver to the module. No functional changes. Signed-off-by: Mika Westerberg commit 7ee20d0afb69dfc79ef50d184d4b571f9064f9ba Author: Mika Westerberg Date: Thu Sep 8 13:17:26 2022 +0300 thunderbolt: Allow specifying custom credits for DMA tunnels The default ones should be find but this allows the user to tweak the credits to get more performance out of the P2P connection. Signed-off-by: Mika Westerberg commit ccdb0900a0c3b0b56af5f547cceb64ee8d09483f Author: Mika Westerberg Date: Mon Feb 27 12:45:09 2023 +0200 thunderbolt: Add debug log for link controller power quirk Add a debug log to this quirk as well so we can see what quirks have been applied when debugging. Signed-off-by: Mika Westerberg commit f14d177e0be652ef7b265753f08f2a7d31935668 Author: Mika Westerberg Date: Fri Feb 3 15:57:59 2023 +0200 thunderbolt: Log function name of the called quirk This is useful when debugging whether a quirk has been matched or not. Signed-off-by: Mika Westerberg commit 814c96c959cfc147ecf8bf9ae3f34b8361316316 Author: Mika Westerberg Date: Fri Mar 31 13:01:32 2023 +0300 thunderbolt: Check for ring 0 in tb_tunnel_alloc_dma() Ring 0 cannot be used for anything else than control channel messages. For this reason add a check to tb_tunnel_alloc_dma() and fail if someone tries to do that. Signed-off-by: Mika Westerberg commit cb0b50b813f6198b7d44ae8e169803440333577a Author: Sebastian Andrzej Siewior Date: Tue May 9 15:49:02 2023 +0200 module: Remove preempt_disable() from module reference counting. The preempt_disable() section in module_put() was added in commit e1783a240f491 ("module: Use this_cpu_xx to dynamically allocate counters") while the per-CPU counter were switched to another API. The API requires that during the RMW operation the CPU remained the same. This counting API was later replaced with atomic_t in commit 2f35c41f58a97 ("module: Replace module_ref with atomic_t refcnt") Since this atomic_t replacement there is no need to keep preemption disabled while the reference counter is modified. Remove preempt_disable() from module_put(), __module_get() and try_module_get(). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Luis Chamberlain commit 48e7fbf6623137b35b19677caa096945a0ef3497 Author: Herbert Xu Date: Tue May 23 10:33:38 2023 +0800 crypto: starfive - Depend on AMBA_PL08X instead of selecting it A platform option like AMBA should never be selected by a driver. Use a dependency instead. Also remove the depenency on DMADEVICES because the driver builds just fine without it. Instead add a dependency on HAS_DMA for dma mapping support. Reported-by: Stephen Rothwell Reported-by: Conor Dooley Signed-off-by: Herbert Xu Reviewed-by: Conor Dooley Signed-off-by: Herbert Xu commit b8cbc0855a22fe386c704ee29fb21282f999b995 Author: Joel Granados Date: Tue May 23 14:22:20 2023 +0200 sysctl: Remove register_sysctl_table This is part of the general push to deprecate register_sysctl_paths and register_sysctl_table. After removing all the calling functions, we remove both the register_sysctl_table function and the documentation check that appeared in check-sysctl-docs awk script. We save 595 bytes with this change: ./scripts/bloat-o-meter vmlinux.1.refactor-base-paths vmlinux.2.remove-sysctl-table add/remove: 2/8 grow/shrink: 1/0 up/down: 1154/-1749 (-595) Function old new delta count_subheaders - 983 +983 unregister_sysctl_table 29 184 +155 __pfx_count_subheaders - 16 +16 __pfx_unregister_sysctl_table.part 16 - -16 __pfx_register_leaf_sysctl_tables.constprop 16 - -16 __pfx_count_subheaders.part 16 - -16 __pfx___register_sysctl_base 16 - -16 unregister_sysctl_table.part 136 - -136 __register_sysctl_base 478 - -478 register_leaf_sysctl_tables.constprop 524 - -524 count_subheaders.part 547 - -547 Total: Before=21257652, After=21257057, chg -0.00% [mcgrof: remove register_leaf_sysctl_tables and append_path too and add bloat-o-meter stats] Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain Acked-by: Christian Brauner commit 2f5edd03ca0d7221a88236b344b84f3fc301b1e3 Author: Joel Granados Date: Tue May 23 14:22:19 2023 +0200 sysctl: Refactor base paths registrations This is part of the general push to deprecate register_sysctl_paths and register_sysctl_table. The old way of doing this through register_sysctl_base and DECLARE_SYSCTL_BASE macro is replaced with a call to register_sysctl_init. The 5 base paths affected are: "kernel", "vm", "debug", "dev" and "fs". We remove the register_sysctl_base function and the DECLARE_SYSCTL_BASE macro since they are no longer needed. In order to quickly acertain that the paths did not actually change I executed `find /proc/sys/ | sha1sum` and made sure that the sha was the same before and after the commit. We end up saving 563 bytes with this change: ./scripts/bloat-o-meter vmlinux.0.base vmlinux.1.refactor-base-paths add/remove: 0/5 grow/shrink: 2/0 up/down: 77/-640 (-563) Function old new delta sysctl_init_bases 55 111 +56 init_fs_sysctls 12 33 +21 vm_base_table 128 - -128 kernel_base_table 128 - -128 fs_base_table 128 - -128 dev_base_table 128 - -128 debug_base_table 128 - -128 Total: Before=21258215, After=21257652, chg -0.00% [mcgrof: modified to use register_sysctl_init() over register_sysctl() and add bloat-o-meter stats] Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain Tested-by: Stephen Rothwell Acked-by: Christian Brauner commit 19c4e618a1bc3d0cad1f04c857be8076cb05bbb2 Author: Joel Granados Date: Tue May 23 14:22:18 2023 +0200 sysctl: stop exporting register_sysctl_table We make register_sysctl_table static because the only function calling it is in fs/proc/proc_sysctl.c (__register_sysctl_base). We remove it from the sysctl.h header and modify the documentation in both the header and proc_sysctl.c files to mention "register_sysctl" instead of "register_sysctl_table". This plus the commits that remove register_sysctl_table from parport save 217 bytes: ./scripts/bloat-o-meter .bsysctl/vmlinux.old .bsysctl/vmlinux.new add/remove: 0/1 grow/shrink: 5/1 up/down: 458/-675 (-217) Function old new delta __register_sysctl_base 8 286 +278 parport_proc_register 268 379 +111 parport_device_proc_register 195 247 +52 kzalloc.constprop 598 608 +10 parport_default_proc_register 62 69 +7 register_sysctl_table 291 - -291 parport_sysctl_template 1288 904 -384 Total: Before=8603076, After=8602859, chg -0.00% Signed-off-by: Joel Granados Reviewed-by: Luis Chamberlain Signed-off-by: Luis Chamberlain commit 9ad0a4e7c2dd101be78e8621c204cec742ee1ce7 Author: Joel Granados Date: Tue May 23 14:22:17 2023 +0200 parport: Removed sysctl related defines The partport driver used to rely on defines to include different directories in sysctl. Now that we have made the transition to register_sysctl from regsiter_sysctl_table, they are no longer needed. Signed-off-by: Joel Granados Reviewed-by: Luis Chamberlain Signed-off-by: Luis Chamberlain commit 02ea13480f3ffea36a1f9e549b503402f0b299ca Author: Joel Granados Date: Tue May 23 14:22:16 2023 +0200 parport: Remove register_sysctl_table from parport_default_proc_register This is part of the general push to deprecate register_sysctl_paths and register_sysctl_table. Simply change the full path "dev/parport/default" to point to an already existing set of table entries (vars). We also remove the unused elements from parport_default_table. To make sure the resulting directory structure did not change we made sure that `find /proc/sys/dev/ | sha1sum` was the same before and after the change. Signed-off-by: Joel Granados Reviewed-by: Luis Chamberlain Signed-off-by: Luis Chamberlain commit 4199a64a1c13c58a48917d1eb6492c32b4496bd9 Author: Joel Granados Date: Tue May 23 14:22:15 2023 +0200 parport: Remove register_sysctl_table from parport_device_proc_register This is part of the general push to deprecate register_sysctl_paths and register_sysctl_table. We use a temp allocation to include both port and device name in proc. Allocated mem is freed at the end. The unused parport_device_sysctl_template struct elements that are not used are removed. Signed-off-by: Joel Granados Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202305150948.pHgIh7Ql-lkp@intel.com/ Reported-by: Dan Carpenter Reviewed-by: Luis Chamberlain Signed-off-by: Luis Chamberlain commit 93810936a6bfbc538771914836fca24570e3bcc5 Author: Joel Granados Date: Tue May 23 14:22:14 2023 +0200 parport: Remove register_sysctl_table from parport_proc_register This is part of the general push to deprecate register_sysctl_paths and register_sysctl_table. Register dev/parport/PORTNAME and dev/parport/PORTNAME/devices. Temporary allocation for name is freed at the end of the function. Remove all the struct elements that are no longer used in the parport_device_sysctl_template struct. Add parport specific defines that hide the base path sizes. To make sure the resulting directory structure did not change we made sure that `find /proc/sys/dev/ | sha1sum` was the same before and after the change. Signed-off-by: Joel Granados Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202305150948.pHgIh7Ql-lkp@intel.com/ Reported-by: Dan Carpenter Reviewed-by: Luis Chamberlain Signed-off-by: Luis Chamberlain commit 7c0bf4dad6bf44eef4a573985dd053de77688df1 Author: Joel Granados Date: Tue May 23 14:22:13 2023 +0200 parport: Move magic number "15" to a define Put the size of a parport name behind a define so we can use it in other files. This is a preparation patch to be able to use this size in parport/procfs.c. Signed-off-by: Joel Granados Reviewed-by: Luis Chamberlain Signed-off-by: Luis Chamberlain commit a695641c8eaac268ad7e373c7e33c00b88b2bcbf Author: Coco Li Date: Mon May 22 13:15:52 2023 -0700 gve: Support IPv6 Big TCP on DQ Add support for using IPv6 Big TCP on DQ which can handle large TSO/GRO packets. See https://lwn.net/Articles/895398/. This can improve the throughput and CPU usage. Perf test result: ip -d link show $DEV gso_max_size 185000 gso_max_segs 65535 tso_max_size 262143 tso_max_segs 65535 gro_max_size 185000 For performance, tested with neper using 9k MTU on hardware that supports 200Gb/s line rate. In single streams when line rate is not saturated, we expect throughput improvements. When the networking is performing at line rate, we expect cpu usage improvements. Tcp_stream (unidirectional stream test, T=thread, F=flow): skb=180kb, T=1, F=1, no zerocopy: throughput average=64576.88 Mb/s, sender stime=8.3, receiver stime=10.68 skb=64kb, T=1, F=1, no zerocopy: throughput average=64862.54 Mb/s, sender stime=9.96, receiver stime=12.67 skb=180kb, T=1, F=1, yes zerocopy: throughput average=146604.97 Mb/s, sender stime=10.61, receiver stime=5.52 skb=64kb, T=1, F=1, yes zerocopy: throughput average=131357.78 Mb/s, sender stime=12.11, receiver stime=12.25 skb=180kb, T=20, F=100, no zerocopy: throughput average=182411.37 Mb/s, sender stime=41.62, receiver stime=79.4 skb=64kb, T=20, F=100, no zerocopy: throughput average=182892.02 Mb/s, sender stime=57.39, receiver stime=72.69 skb=180kb, T=20, F=100, yes zerocopy: throughput average=182337.65 Mb/s, sender stime=27.94, receiver stime=39.7 skb=64kb, T=20, F=100, yes zerocopy: throughput average=182144.20 Mb/s, sender stime=47.06, receiver stime=39.01 Signed-off-by: Ziwei Xiao Signed-off-by: Coco Li Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230522201552.3585421-1-ziweixiao@google.com Signed-off-by: Jakub Kicinski commit 51c78a4d532efe9543a4df019ff405f05c6157f6 Merge: 57910a47ffe99 57d44a354a43e Author: Jakub Kicinski Date: Tue May 23 20:48:53 2023 -0700 Merge branch 'splice-net-replace-sendpage-with-sendmsg-msg_splice_pages-part-1' David Howells says: ==================== splice, net: Replace sendpage with sendmsg(MSG_SPLICE_PAGES), part 1 Here's the first tranche of patches towards providing a MSG_SPLICE_PAGES internal sendmsg flag that is intended to replace the ->sendpage() op with calls to sendmsg(). MSG_SPLICE_PAGES is a hint that tells the protocol that it should splice the pages supplied if it can and copy them if not. This will allow splice to pass multiple pages in a single call and allow certain parts of higher protocols (e.g. sunrpc, iwarp) to pass an entire message in one go rather than having to send them piecemeal. This should also make it easier to handle the splicing of multipage folios. A helper, skb_splice_from_iter() is provided to do the work of splicing or copying data from an iterator. If a page is determined to be unspliceable (such as being in the slab), then the helper will give an error. Note that this facility is not made available to userspace and does not provide any sort of callback. This set consists of the following parts: (1) Define the MSG_SPLICE_PAGES flag and prevent sys_sendmsg() from being able to set it. (2) Add an extra argument to skb_append_pagefrags() so that something other than MAX_SKB_FRAGS can be used (sysctl_max_skb_frags for example). (3) Add the skb_splice_from_iter() helper to handle splicing pages into skbuffs for MSG_SPLICE_PAGES that can be shared by TCP, IP/UDP and AF_UNIX. (4) Implement MSG_SPLICE_PAGES support in TCP. (5) Make do_tcp_sendpages() just wrap sendmsg() and then fold it in to its various callers. (6) Implement MSG_SPLICE_PAGES support in IP and make udp_sendpage() just a wrapper around sendmsg(). (7) Implement MSG_SPLICE_PAGES support in IP6/UDP6. (8) Implement MSG_SPLICE_PAGES support in AF_UNIX. (9) Make AF_UNIX copy unspliceable pages. Link: https://lore.kernel.org/r/20230316152618.711970-1-dhowells@redhat.com/ # v1 Link: https://lore.kernel.org/r/20230329141354.516864-1-dhowells@redhat.com/ # v2 Link: https://lore.kernel.org/r/20230331160914.1608208-1-dhowells@redhat.com/ # v3 Link: https://lore.kernel.org/r/20230405165339.3468808-1-dhowells@redhat.com/ # v4 Link: https://lore.kernel.org/r/20230406094245.3633290-1-dhowells@redhat.com/ # v5 Link: https://lore.kernel.org/r/20230411160902.4134381-1-dhowells@redhat.com/ # v6 Link: https://lore.kernel.org/r/20230515093345.396978-1-dhowells@redhat.com/ # v7 Link: https://lore.kernel.org/r/20230518113453.1350757-1-dhowells@redhat.com/ # v8 ==================== Link: https://lore.kernel.org/r/20230522121125.2595254-1-dhowells@redhat.com Signed-off-by: Jakub Kicinski commit 57d44a354a43edba4ef9963327d4657d12edbfbc Author: David Howells Date: Mon May 22 13:11:25 2023 +0100 unix: Convert unix_stream_sendpage() to use MSG_SPLICE_PAGES Convert unix_stream_sendpage() to use sendmsg() with MSG_SPLICE_PAGES rather than directly splicing in the pages itself. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Kuniyuki Iwashima cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit a0dbf5f818f9082d2262c1f8a8c0aab68364341f Author: David Howells Date: Mon May 22 13:11:24 2023 +0100 af_unix: Support MSG_SPLICE_PAGES Make AF_UNIX sendmsg() support MSG_SPLICE_PAGES, splicing in pages from the source iterator if possible and copying the data in otherwise. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Kuniyuki Iwashima cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit c49cf26632910581ee1173d75c0fca322ccaf4bb Author: David Howells Date: Mon May 22 13:11:23 2023 +0100 ip: Remove ip_append_page() ip_append_page() is no longer used with the removal of udp_sendpage(), so remove it. Signed-off-by: David Howells cc: Willem de Bruijn cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 7ac7c987850c3ec617c778f7bd871804dc1c648d Author: David Howells Date: Mon May 22 13:11:22 2023 +0100 udp: Convert udp_sendpage() to use MSG_SPLICE_PAGES Convert udp_sendpage() to use sendmsg() with MSG_SPLICE_PAGES rather than directly splicing in the pages itself. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Willem de Bruijn cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 6d8192bd69bb431ef6b2558be3b5746b706cd252 Author: David Howells Date: Mon May 22 13:11:21 2023 +0100 ip6, udp6: Support MSG_SPLICE_PAGES Make IP6/UDP6 sendmsg() support MSG_SPLICE_PAGES. This causes pages to be spliced from the source iterator if possible, copying the data if not. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Willem de Bruijn cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 7da0dde68486b2d5bd7c689a9b327b77efecdfd0 Author: David Howells Date: Mon May 22 13:11:20 2023 +0100 ip, udp: Support MSG_SPLICE_PAGES Make IP/UDP sendmsg() support MSG_SPLICE_PAGES. This causes pages to be spliced from the source iterator. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: Willem de Bruijn cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 5367f9bbb86a9fa377f8cfc673d9b8a446f3e917 Author: David Howells Date: Mon May 22 13:11:19 2023 +0100 tcp: Fold do_tcp_sendpages() into tcp_sendpage_locked() Fold do_tcp_sendpages() into its last remaining caller, tcp_sendpage_locked(). Signed-off-by: David Howells cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit c2ff29e99a764769eb2ce3a1a5585013633ee9a6 Author: David Howells Date: Mon May 22 13:11:18 2023 +0100 siw: Inline do_tcp_sendpages() do_tcp_sendpages() is now just a small wrapper around tcp_sendmsg_locked(), so inline it, allowing do_tcp_sendpages() to be removed. This is part of replacing ->sendpage() with a call to sendmsg() with MSG_SPLICE_PAGES set. Signed-off-by: David Howells Reviewed-by: Bernard Metzler Reviewed-by: Tom Talpey cc: Jason Gunthorpe cc: Leon Romanovsky cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit e117dcfd646e84a50999a395df3d724feb28b173 Author: David Howells Date: Mon May 22 13:11:17 2023 +0100 tls: Inline do_tcp_sendpages() do_tcp_sendpages() is now just a small wrapper around tcp_sendmsg_locked(), so inline it, allowing do_tcp_sendpages() to be removed. This is part of replacing ->sendpage() with a call to sendmsg() with MSG_SPLICE_PAGES set. Signed-off-by: David Howells cc: Boris Pismenny cc: John Fastabend cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 7f8816ab4bae9dd42c5720fdad4b102532d4e43a Author: David Howells Date: Mon May 22 13:11:16 2023 +0100 espintcp: Inline do_tcp_sendpages() do_tcp_sendpages() is now just a small wrapper around tcp_sendmsg_locked(), so inline it, allowing do_tcp_sendpages() to be removed. This is part of replacing ->sendpage() with a call to sendmsg() with MSG_SPLICE_PAGES set. Signed-off-by: David Howells cc: Steffen Klassert cc: Herbert Xu cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit ebf2e8860eea66e2c4764316b80c6a5ee5f336ee Author: David Howells Date: Mon May 22 13:11:15 2023 +0100 tcp_bpf: Inline do_tcp_sendpages as it's now a wrapper around tcp_sendmsg do_tcp_sendpages() is now just a small wrapper around tcp_sendmsg_locked(), so inline it. This is part of replacing ->sendpage() with a call to sendmsg() with MSG_SPLICE_PAGES set. Signed-off-by: David Howells cc: John Fastabend cc: Jakub Sitnicki cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit c5c37af6ecad955acad82a440b812eb9cd73f77f Author: David Howells Date: Mon May 22 13:11:14 2023 +0100 tcp: Convert do_tcp_sendpages() to use MSG_SPLICE_PAGES Convert do_tcp_sendpages() to use sendmsg() with MSG_SPLICE_PAGES rather than directly splicing in the pages itself. do_tcp_sendpages() can then be inlined in subsequent patches into its callers. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 270a1c3de47e49dd2fc18f48e46b101e48050e78 Author: David Howells Date: Mon May 22 13:11:13 2023 +0100 tcp: Support MSG_SPLICE_PAGES Make TCP's sendmsg() support MSG_SPLICE_PAGES. This causes pages to be spliced or copied (if it cannot be spliced) from the source iterator. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 2e910b95329c2dc7feffbec00907f9e02d1a850a Author: David Howells Date: Mon May 22 13:11:12 2023 +0100 net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES Add a function to handle MSG_SPLICE_PAGES being passed internally to sendmsg(). Pages are spliced into the given socket buffer if possible and copied in if not (e.g. they're slab pages or have a zero refcount). Signed-off-by: David Howells cc: David Ahern cc: Al Viro cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 96449f90240713bd9bd653d6b15266a1044cfa7b Author: David Howells Date: Mon May 22 13:11:11 2023 +0100 net: Pass max frags into skb_append_pagefrags() Pass the maximum number of fragments into skb_append_pagefrags() rather than using MAX_SKB_FRAGS so that it can be used from code that wants to specify sysctl_max_skb_frags. Signed-off-by: David Howells cc: David Ahern cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit b841b901c452d92610f739a36e54978453528876 Author: David Howells Date: Mon May 22 13:11:10 2023 +0100 net: Declare MSG_SPLICE_PAGES internal sendmsg() flag Declare MSG_SPLICE_PAGES, an internal sendmsg() flag, that hints to a network protocol that it should splice pages from the source iterator rather than copying the data if it can. This flag is added to a list that is cleared by sendmsg syscalls on entry. This is intended as a replacement for the ->sendpage() op, allowing a way to splice in several multipage folios in one go. Signed-off-by: David Howells Reviewed-by: Willem de Bruijn cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski commit 57910a47ffe993c2724a916b9e003d84ff0c0df7 Author: Jaco Coetzee Date: Mon May 22 16:13:35 2023 +0200 nfp: add L4 RSS hashing on UDP traffic Add layer 4 RSS hashing on UDP traffic to allow for the utilization of multiple queues for multiple connections on the same IP address. Previously, since the introduction of the driver, RSS hashing was only performed on the source and destination IP addresses of UDP packets thereby limiting UDP traffic to a single queue for multiple connections on the same IP address. The transport layer is now included in RSS hashing for UDP traffic, which was not previously the case. The reason behind the previous limitation is unclear - either a historic limitation of the NFP device, or an oversight. Signed-off-by: Jaco Coetzee Acked-by: Simon Horman Signed-off-by: Louis Peens Link: https://lore.kernel.org/r/20230522141335.22536-1-louis.peens@corigine.com Signed-off-by: Jakub Kicinski commit ac2e8e3cfe48439a2403b3d616fb654db313e362 Author: Josua Mayer Date: Mon May 22 17:52:42 2023 +0300 net: sfp: add support for HXSX-ATRI-1 copper SFP+ module Walsun offers commercial ("C") and industrial ("I") variants of multi-rate copper SFP+ modules. Add quirk for HXSX-ATRI-1 using same parameters as the already supported commercial variant HXSX-ATRC-1. Signed-off-by: Josua Mayer Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20230522145242.30192-2-josua@solid-run.com/ Signed-off-by: Jakub Kicinski commit d617ef039fb8eec48a3424f79327220e0b7cbff7 Author: Kees Cook Date: Tue May 23 09:55:02 2023 -0700 fscrypt: Replace 1-element array with flexible array 1-element arrays are deprecated and are being replaced with C99 flexible arrays[1]. As sizes were being calculated with the extra byte intentionally, propagate the difference so there is no change in binary output. [1] https://github.com/KSPP/linux/issues/79 Cc: Eric Biggers Cc: "Theodore Y. Ts'o" Cc: Jaegeuk Kim Cc: Gustavo A. R. Silva Cc: linux-fscrypt@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230523165458.gonna.580-kees@kernel.org Signed-off-by: Eric Biggers commit 633c8b9409f564ce4b7f7944c595ffac27ed1ff4 Author: Jaegeuk Kim Date: Fri May 5 12:16:54 2023 -0700 f2fs: fix the wrong condition to determine atomic context Should use !in_task for irq context. Cc: stable@vger.kernel.org Fixes: 1aa161e43106 ("f2fs: fix scheduling while atomic in decompression path") Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e067dc3c6b9c419bac43c6a0be2d85f44681f863 Author: Daeho Jeong Date: Wed May 3 13:53:49 2023 -0700 f2fs: maintain six open zones for zoned devices To keep six open zone constraints, make them not to be open over six open zones. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 857466436c49892608c0fb2da8a00219862d3bdd Merge: abd35adfa9a13 dc0ff0fa3a9bf Author: Mark Brown Date: Tue May 23 23:11:42 2023 +0100 ASoC: da7219: Add jack insertion detection polarity Merge series from David Rau : This patchset adds the support of DA7219 Jack insertion detection polarity selection. The first patch replaces the old txt binding with a new schema binding. The second patch adds `dlg,jack-ins-det-pty` property for Jack insertion detection polarity selection. The last patch adds the driver support for this topic. The series has been verified on the DA7219 development kit. commit db1d1e8b9867aae5c3e61ad7859abfcc4a6fd6c7 Author: Jeff Layton Date: Mon Apr 17 12:55:51 2023 -0400 IMA: use vfs_getattr_nosec to get the i_version IMA currently accesses the i_version out of the inode directly when it does a measurement. This is fine for most simple filesystems, but can be problematic with more complex setups (e.g. overlayfs). Make IMA instead call vfs_getattr_nosec to get this info. This allows the filesystem to determine whether and how to report the i_version, and should allow IMA to work properly with a broader class of filesystems in the future. Reported-and-Tested-by: Stefan Berger Reviewed-by: Christian Brauner Signed-off-by: Jeff Layton Signed-off-by: Mimi Zohar commit 90d0d6009c0f6b0693ac58096c655a2df61e0d50 Merge: 53632462666c3 44c026a73be80 Author: Mark Brown Date: Tue May 23 23:03:49 2023 +0100 regmap: Merge up v6.4-rc3 Merge up v6.4-rc3 to get fixes which make my CI more stable. commit b00315628095075da4af8d6d519d85d95117de09 Author: Dana Elfassy Date: Tue May 23 14:49:42 2023 -0700 Input: tests - add test to cover all input_grab_device() function Currently input_grab_device() isn't covered by any tests Thus, adding a test to cover the cases: 1. The device is grabbed successfully 2. Trying to grab a device that is already grabbed by another input handle Signed-off-by: Dana Elfassy Tested-by: Javier Martinez Canillas Reviewed-by: Javier Martinez Canillas Reviewed-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20230522215514.722564-1-dangel101@gmail.com Signed-off-by: Dmitry Torokhov commit 6c8017c6a58d06c2fcce3b034944ad056ccf02ce Author: Reinette Chatre Date: Thu May 11 08:44:38 2023 -0700 vfio/pci: Clear VFIO_IRQ_INFO_NORESIZE for MSI-X Dynamic MSI-X is supported. Clear VFIO_IRQ_INFO_NORESIZE to provide guidance to user space. Signed-off-by: Reinette Chatre Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/fd1ef2bf6ae972da8e2805bc95d5155af5a8fb0a.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson commit e4163438e01583194d043c07adce326b29786f94 Author: Reinette Chatre Date: Thu May 11 08:44:37 2023 -0700 vfio/pci: Support dynamic MSI-X pci_msix_alloc_irq_at() enables an individual MSI-X interrupt to be allocated after MSI-X enabling. Use dynamic MSI-X (if supported by the device) to allocate an interrupt after MSI-X is enabled. An MSI-X interrupt is dynamically allocated at the time a valid eventfd is assigned. This is different behavior from a range provided during MSI-X enabling where interrupts are allocated for the entire range whether a valid eventfd is provided for each interrupt or not. The PCI-MSIX API requires that some number of irqs are allocated for an initial set of vectors when enabling MSI-X on the device. When dynamic MSIX allocation is not supported, the vector table, and thus the allocated irq set can only be resized by disabling and re-enabling MSI-X with a different range. In that case the irq allocation is essentially a cache for configuring vectors within the previously allocated vector range. When dynamic MSI-X allocation is supported, the API still requires some initial set of irqs to be allocated, but also supports allocating and freeing specific irq vectors both within and beyond the initially allocated range. For consistency between modes, as well as to reduce latency and improve reliability of allocations, and also simplicity, this implementation only releases irqs via pci_free_irq_vectors() when either the interrupt mode changes or the device is released. Signed-off-by: Reinette Chatre Link: https://lore.kernel.org/lkml/20230403211841.0e206b67.alex.williamson@redhat.com/ Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/956c47057ae9fd45591feaa82e9ae20929889249.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson commit dd27a707003818fc8435d8621527d4b3af7d2ab1 Author: Reinette Chatre Date: Thu May 11 08:44:36 2023 -0700 vfio/pci: Probe and store ability to support dynamic MSI-X Not all MSI-X devices support dynamic MSI-X allocation. Whether a device supports dynamic MSI-X should be queried using pci_msix_can_alloc_dyn(). Instead of scattering code with pci_msix_can_alloc_dyn(), probe this ability once and store it as a property of the virtual device. Suggested-by: Alex Williamson Signed-off-by: Reinette Chatre Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/f1ae022c060ecb7e527f4f53c8ccafe80768da47.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson commit 9cd0f6d5cbb6fda09aa83beb8146c287a552017e Author: Reinette Chatre Date: Thu May 11 08:44:35 2023 -0700 vfio/pci: Use bitfield for struct vfio_pci_core_device flags struct vfio_pci_core_device contains eleven boolean flags. Boolean flags clearly indicate their usage but space usage starts to be a concern when there are many. An upcoming change adds another boolean flag to struct vfio_pci_core_device, thereby increasing the concern that the boolean flags are consuming unnecessary space. Transition the boolean flags to use bitfields. On a system that uses one byte per boolean this reduces the space consumed by existing flags from 11 bytes to 2 bytes with room for a few more flags without increasing the structure's size. Suggested-by: Jason Gunthorpe Signed-off-by: Reinette Chatre Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/cf34bf0499c889554a8105eeb18cc0ab673005be.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson commit 9387cf59dc6f987db875148dd596c45bc60813f8 Author: Reinette Chatre Date: Thu May 11 08:44:34 2023 -0700 vfio/pci: Update stale comment In preparation for surrounding code change it is helpful to ensure that existing comments are accurate. Remove inaccurate comment about direct access and update the rest of the comment to reflect the purpose of writing the cached MSI message to the device. Suggested-by: Alex Williamson Link: https://lore.kernel.org/lkml/20230330164050.0069e2a5.alex.williamson@redhat.com/ Signed-off-by: Reinette Chatre Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/5b605ce7dcdab5a5dfef19cec4d73ae2fdad3ae1.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson commit 63972f63a63f9c3b113cac34dc8692a7c9ae671d Author: Reinette Chatre Date: Thu May 11 08:44:33 2023 -0700 vfio/pci: Remove interrupt context counter struct vfio_pci_core_device::num_ctx counts how many interrupt contexts have been allocated. When all interrupt contexts are allocated simultaneously num_ctx provides the upper bound of all vectors that can be used as indices into the interrupt context array. With the upcoming support for dynamic MSI-X the number of interrupt contexts does not necessarily span the range of allocated interrupts. Consequently, num_ctx is no longer a trusted upper bound for valid indices. Stop using num_ctx to determine if a provided vector is valid. Use the existence of allocated interrupt. This changes behavior on the error path when user space provides an invalid vector range. Behavior changes from early exit without any modifications to possible modifications to valid vectors within the invalid range. This is acceptable considering that an invalid range is not a valid scenario, see link to discussion. The checks that ensure that user space provides a range of vectors that is valid for the device are untouched. Signed-off-by: Reinette Chatre Link: https://lore.kernel.org/lkml/20230316155646.07ae266f.alex.williamson@redhat.com/ Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/e27d350f02a65b8cbacd409b4321f5ce35b3186d.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson commit b156e48fffa9f1caea490e4812a1451adb5c0ef4 Author: Reinette Chatre Date: Thu May 11 08:44:32 2023 -0700 vfio/pci: Use xarray for interrupt context storage Interrupt context is statically allocated at the time interrupts are allocated. Following allocation, the context is managed by directly accessing the elements of the array using the vector as index. The storage is released when interrupts are disabled. It is possible to dynamically allocate a single MSI-X interrupt after MSI-X is enabled. A dynamic storage for interrupt context is needed to support this. Replace the interrupt context array with an xarray (similar to what the core uses as store for MSI descriptors) that can support the dynamic expansion while maintaining the custom that uses the vector as index. With a dynamic storage it is no longer required to pre-allocate interrupt contexts at the time the interrupts are allocated. MSI and MSI-X interrupt contexts are only used when interrupts are enabled. Their allocation can thus be delayed until interrupt enabling. Only enabled interrupts will have associated interrupt contexts. Whether an interrupt has been allocated (a Linux irq number exists for it) becomes the criteria for whether an interrupt can be enabled. Signed-off-by: Reinette Chatre Link: https://lore.kernel.org/lkml/20230404122444.59e36a99.alex.williamson@redhat.com/ Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/40e235f38d427aff79ae35eda0ced42502aa0937.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson commit 8850336588fbcccdca484b91631819eabaafd915 Author: Reinette Chatre Date: Thu May 11 08:44:31 2023 -0700 vfio/pci: Move to single error path Enabling and disabling of an interrupt involves several steps that can fail. Cleanup after failure is done when the error is encountered, resulting in some repetitive code. Support for dynamic contexts will introduce more steps during interrupt enabling and disabling. Transition to centralized exit path in preparation for dynamic contexts to eliminate duplicate error handling code. Signed-off-by: Reinette Chatre Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/72dddae8aa710ce522a74130120733af61cffe4d.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson commit d977e0f7663961368f6442589e52d27484c2f5c2 Author: Reinette Chatre Date: Thu May 11 08:44:30 2023 -0700 vfio/pci: Prepare for dynamic interrupt context storage Interrupt context storage is statically allocated at the time interrupts are allocated. Following allocation, the interrupt context is managed by directly accessing the elements of the array using the vector as index. It is possible to allocate additional MSI-X vectors after MSI-X has been enabled. Dynamic storage of interrupt context is needed to support adding new MSI-X vectors after initial allocation. Replace direct access of array elements with pointers to the array elements. Doing so reduces impact of moving to a new data structure. Move interactions with the array to helpers to mostly contain changes needed to transition to a dynamic data structure. No functional change intended. Signed-off-by: Reinette Chatre Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/eab289693c8325ede9aba99380f8b8d5143980a4.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson commit 6578ed85c7d63693669bfede01e0237d0e24211a Author: Reinette Chatre Date: Thu May 11 08:44:29 2023 -0700 vfio/pci: Remove negative check on unsigned vector User space provides the vector as an unsigned int that is checked early for validity (vfio_set_irqs_validate_and_prepare()). A later negative check of the provided vector is not necessary. Remove the negative check and ensure the type used for the vector is consistent as an unsigned int. Signed-off-by: Reinette Chatre Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/28521e1b0b091849952b0ecb8c118729fc8cdc4f.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson commit a65f35cfd504e5135540939cffd4323083190b36 Author: Reinette Chatre Date: Thu May 11 08:44:28 2023 -0700 vfio/pci: Consolidate irq cleanup on MSI/MSI-X disable vfio_msi_disable() releases all previously allocated state associated with each interrupt before disabling MSI/MSI-X. vfio_msi_disable() iterates twice over the interrupt state: first directly with a for loop to do virqfd cleanup, followed by another for loop within vfio_msi_set_block() that removes the interrupt handler and its associated state using vfio_msi_set_vector_signal(). Simplify interrupt cleanup by iterating over allocated interrupts once. Signed-off-by: Reinette Chatre Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/837acb8cbe86a258a50da05e56a1f17c1a19abbe.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson commit 3615536c921bda1a7166e78281b8316d6c363cc1 Author: Geert Uytterhoeven Date: Tue May 23 14:42:15 2023 -0700 Input: gpio-keys - use input_report_key() Use the input_report_key() helper instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/185f3320e39000159d4bd843fd3119b94c30d607.1684854795.git.geert+renesas@glider.be Signed-off-by: Dmitry Torokhov commit 912b625b4dcf23f6c16a950227715c75ef027e7b Author: Oleksandr Natalenko Date: Thu May 4 15:16:54 2023 +0200 vfio/pci: demote hiding ecap messages to debug level Seeing a burst of messages like this: vfio-pci 0000:98:00.0: vfio_ecap_init: hiding ecap 0x19@0x1d0 vfio-pci 0000:98:00.0: vfio_ecap_init: hiding ecap 0x25@0x200 vfio-pci 0000:98:00.0: vfio_ecap_init: hiding ecap 0x26@0x210 vfio-pci 0000:98:00.0: vfio_ecap_init: hiding ecap 0x27@0x250 vfio-pci 0000:98:00.1: vfio_ecap_init: hiding ecap 0x25@0x200 vfio-pci 0000:b1:00.0: vfio_ecap_init: hiding ecap 0x19@0x1d0 vfio-pci 0000:b1:00.0: vfio_ecap_init: hiding ecap 0x25@0x200 vfio-pci 0000:b1:00.0: vfio_ecap_init: hiding ecap 0x26@0x210 vfio-pci 0000:b1:00.0: vfio_ecap_init: hiding ecap 0x27@0x250 vfio-pci 0000:b1:00.1: vfio_ecap_init: hiding ecap 0x25@0x200 is of little to no value for an ordinary user. Hence, use pci_dbg() instead of pci_info(). Signed-off-by: Oleksandr Natalenko Acked-by: Cédric Le Goater Tested-by: YangHang Liu Link: https://lore.kernel.org/r/20230504131654.24922-1-oleksandr@natalenko.name Signed-off-by: Alex Williamson commit e6beda565b2b1084f9a2cca5c73ae08f1e58c34e Merge: 15a1cd245d5b3 f991a220a4472 Author: Mark Brown Date: Tue May 23 22:43:03 2023 +0100 mfd/pinctrl/regulator: Add RK806 Support Merge series from Sebastian Reichel : All existing boards using RK3588/RK3588s use RK806 PMICs. This series is now the main blocker for full upstream support of those boards and it would be good to have it merged for 6.5 :) The patches have been tested on multiple different platforms and are mainly missing an Ack from Mark or Liam for the rk808-regulator changes. Merging must happen through a single tree, since the pinctrl and regulator drivers rely on the register definitions from the include file added by the MFD patch. My suggested merge strategy is that Lee creates an immutable branch for the regulator/pinctrl tree once all Acks have been collected. commit abd35adfa9a13a8cabdec8a86d87450043719bd3 Merge: ad45067aa5761 db38d86d0c54e Author: Mark Brown Date: Tue May 23 22:42:57 2023 +0100 Improve support for sof_ipc{3|4}_bytes_ext_put Merge series from Daniel Baluta : This patch series provides better handling of cases where sending a data blob to FW results in a validation error. In this case we restore to the last good known value instead of keeping the data that firwmare rejected. commit ad45067aa57610ff41f268f944a27c80cfea11c1 Merge: d8b44d8df4d93 104ce27bcbfb2 Author: Mark Brown Date: Tue May 23 22:42:50 2023 +0100 ASoC: mt6359: kselftest fix and driver extension Merge series from Trevor Wu : The patch series includes a kselftest fix and changes for extending driver capability to support more use cases. commit 3b22f98e5a05feee20699df0870dc5d47c9b61dd Author: Andrii Nakryiko Date: Tue May 23 10:00:13 2023 -0700 selftests/bpf: Add path_fd-based BPF_OBJ_PIN and BPF_OBJ_GET tests Add a selftest demonstrating using detach-mounted BPF FS using new mount APIs, and pinning and getting BPF map using such mount. This demonstrates how something like container manager could setup BPF FS, pin and adjust all the necessary objects in it, all before exposing BPF FS to a particular mount namespace. Also add a few subtests validating all meaningful combinations of path_fd and pathname. We use mounted /sys/fs/bpf location for these. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230523170013.728457-5-andrii@kernel.org commit f1674dc79fd276aeef6cad738a5f25ed2ba6d329 Author: Andrii Nakryiko Date: Mon May 15 17:01:58 2023 -0700 libbpf: Add opts-based bpf_obj_pin() API and add support for path_fd Add path_fd support for bpf_obj_pin() and bpf_obj_get() operations (through their opts-based variants). This allows to take advantage of new kernel-side support for O_PATH-based pin/get location specification. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230523170013.728457-4-andrii@kernel.org commit cb8edce28073a906401c9e421eca7c99f3396da1 Author: Andrii Nakryiko Date: Mon May 15 16:48:06 2023 -0700 bpf: Support O_PATH FDs in BPF_OBJ_PIN and BPF_OBJ_GET commands Current UAPI of BPF_OBJ_PIN and BPF_OBJ_GET commands of bpf() syscall forces users to specify pinning location as a string-based absolute or relative (to current working directory) path. This has various implications related to security (e.g., symlink-based attacks), forces BPF FS to be exposed in the file system, which can cause races with other applications. One of the feedbacks we got from folks working with containers heavily was that inability to use purely FD-based location specification was an unfortunate limitation and hindrance for BPF_OBJ_PIN and BPF_OBJ_GET commands. This patch closes this oversight, adding path_fd field to BPF_OBJ_PIN and BPF_OBJ_GET UAPI, following conventions established by *at() syscalls for dirfd + pathname combinations. This now allows interesting possibilities like working with detached BPF FS mount (e.g., to perform multiple pinnings without running a risk of someone interfering with them), and generally making pinning/getting more secure and not prone to any races and/or security attacks. This is demonstrated by a selftest added in subsequent patch that takes advantage of new mount APIs (fsopen, fsconfig, fsmount) to demonstrate creating detached BPF FS mount, pinning, and then getting BPF map out of it, all while never exposing this private instance of BPF FS to outside worlds. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Reviewed-by: Christian Brauner Link: https://lore.kernel.org/bpf/20230523170013.728457-4-andrii@kernel.org commit bce487a439d3c06e43178d2a430b13acb7d64ba1 Author: Tejun Heo Date: Tue May 23 11:23:22 2023 -1000 media: amphion: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not necessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Acked-by: Hans Verkuil Cc: Ming Qian Cc: Shijie Qin Cc: Zhou Peng Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Tejun Heo commit f3ae82534ab221f24225dbf03120462e8ae64636 Author: Jean-Baptiste Maneyrol Date: Mon May 22 09:32:10 2023 +0000 iio: imu: inv_icm42600: avoid frequent timestamp jitter We are currently synchronizing every time the data timestamp with the IT timestamp, leading to system jitter jamming timestamps. To fix that and keep it simple, let's just synchronize when the delta is bigger than the acceptable jitter, and keep synchronization at the jitter value. The result is much stable timestamps reflecting better the real physical value. Example @50Hz delta timestamp, * before: 20.123ms, 19.721ms, 20.023ms, 20.353ms, 19.821ms, ... * after: 20.173ms, 20.173ms, 20.173ms, 20.40ms, 20.173ms, ... Refactorize code and delete the unnecessary handling of multiple FIFO data. Signed-off-by: Jean-Baptiste Maneyrol Link: https://lore.kernel.org/r/20230522093210.817212-1-inv.git-commit@tdk.com Signed-off-by: Jonathan Cameron commit 6e42f3710d00bd51b02e9a19b583f6f2f9294d53 Author: Matti Vaittinen Date: Mon May 8 13:39:49 2023 +0300 MAINTAINERS: Add ROHM BU27008 Add myself as a maintainer for ROHM BU27008 color sensor driver. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/31e25a41135ab0a86645b5078af797802b32f9c7.1683541225.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 41ff93d14f784695b5019bc1451dfd4eb2b30d9d Author: Matti Vaittinen Date: Mon May 8 13:39:29 2023 +0300 iio: light: ROHM BU27008 color sensor The ROHM BU27008 is a sensor with 5 photodiodes (red, green, blue, clear and IR) with four configurable channels. Red and green being always available and two out of the rest three (blue, clear, IR) can be selected to be simultaneously measured. Typical application is adjusting LCD backlight of TVs, mobile phones and tablet PCs. Add initial support for the ROHM BU27008 color sensor. - raw_read() of RGB and clear channels - triggered buffer w/ DRDY interrtupt Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/2594162f0e44148cffb1fb05f1d6edfde6bd11bc.1683541225.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 2a4deb8488077016f1221c29b85ba4e168a5ba66 Author: Matti Vaittinen Date: Mon May 8 13:31:35 2023 +0300 iio: kx022a: Use new iio_validate_own_trigger() The new generic iio_validate_own_trigger() can be used as validate_trigger callback for verifying the used trigger belongs to same device as the iio_dev. Use the generic function instead of rolling own one. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/cbd585e4787f62dc1a343a51b629ce73dd7d5426.1683541225.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 517985ebc53119a2c2590d29d4056e3f17ef8375 Author: Matti Vaittinen Date: Mon May 8 13:31:17 2023 +0300 iio: trigger: Add simple trigger_validation helper Some triggers can only be attached to the IIO device that corresponds to the same physical device. Implement generic helper which can be used as a validate_trigger callback for such devices. Suggested-by: Jonathan Cameron Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/51cd3e3e74a6addf8d333f4a109fb9c5a11086ee.1683541225.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 4bef3adbd4ba40ec3b81c0adf288fb44a2d0aaf2 Author: Matti Vaittinen Date: Mon May 8 13:30:55 2023 +0300 dt-bindings: iio: light: ROHM BU27008 The ROHM BU27008 is a sensor with 5 photodiodes (red, green, blue, clear and IR) with four configurable channels. Red and green being always available and two out of the rest three (blue, clear, IR) can be selected to be simultaneously measured. Typical application is adjusting LCD backlight of TVs, mobile phones and tablet PCs. Add BU27008 dt-bindings. Signed-off-by: Matti Vaittinen Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/f24196e11ee73511312b629daa20c7d783d8bf6c.1683541225.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 7699e975e54a47de79de9fcc4b83df61ecd86cd5 Author: Marek Vasut Date: Wed May 10 12:22:51 2023 +0200 iio: mlx90614: Add MLX90615 support Add support for MLX90615 Infra Red Thermometer, which seems to be the predecesor of MLX90614 . There are significant differences in the register layout compared to MLX90614, but the functionality of the device is virtually identical. The following differences have been identified: - RAM/EEPROM/SLEEP access opcodes are different - RAM/EEPROM registers are at different offsets - EEPROM emissivity and configuration registers are at different offsets - EEPROM configuration register bits are shuffled around - EEPROM emissivity settings are 14 bit on MLX90615 , 16 bit on MLX90614 - MLX90615 can only ever support one sensor, MLX90614 could support two - FIR filter is set to fixed settings on MLX90615 - IIR filter coefficients are different This patch fills in the MLX90615 specific description and quirk handling. The IIR filter coefficients were provided by Melexis as follows: 0b0000 - Forbidden value 0b0001 - 100% - settling time = refresh rate = 205ms (around 5Hz) 0b0010 - 50% - settling time = 2050ms (around 0.5Hz) 0b0011 - 33% - settling time = 36900ms (around 0.3Hz) 0b0100 - 25% - settling time = 5125ms (around 0.2Hz) 0b0101 - 20% - settling time = 6355ms (around 0.15Hz) 0b0110 - 17% - settling time = 7790ms (around 0.13Hz) 0b0111 - 14% - settling time = 9225ms (around 0.1Hz) Signed-off-by: Marek Vasut Acked-by: Crt Mori Link: https://lore.kernel.org/r/20230510102251.10118-6-marex@denx.de Signed-off-by: Jonathan Cameron commit 3d5ead238bc85ecca115481a91b63548f156a7f7 Author: Marek Vasut Date: Wed May 10 12:22:50 2023 +0200 iio: mlx90614: Factor our register IO and constants into model specific descriptor Factor out all the differences between MLX90614 and other similar chips into a structure which describes the chip and allows abstracting out the differences from the driver code. No functional change. This patch moves all the RAM and EEPROM IO opcodes into the descriptor structure and combines them, instead of combining the opcode and offset in macros. Acked-by: Crt Mori Tested-by: Crt Mori Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230510102251.10118-5-marex@denx.de Signed-off-by: Jonathan Cameron commit 8a0377bf671da3a4737d5bff2a974c3049cedbfe Author: Marek Vasut Date: Wed May 10 12:22:49 2023 +0200 iio: mlx90614: Drop MLX90614_CONST_EMISSIVITY_RESOLUTION The MLX90614_CONST_EMISSIVITY_RESOLUTION can be calculated from MLX90614_CONST_RAW_EMISSIVITY_MAX, perform the calculation inline and drio the MLX90614_CONST_EMISSIVITY_RESOLUTION. Signed-off-by: Marek Vasut Acked-by: Crt Mori Link: https://lore.kernel.org/r/20230510102251.10118-4-marex@denx.de Signed-off-by: Jonathan Cameron commit 02214837287640f94f5fb7d1bf3e696101230507 Author: Marek Vasut Date: Wed May 10 12:22:48 2023 +0200 iio: mlx90614: Drop unused register macros To simplify addition of support for new parts, drop unused register macros. No functional change. Acked-by: Crt Mori Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230510102251.10118-3-marex@denx.de Signed-off-by: Jonathan Cameron commit 4c077429b42245f9aae855027758c9e6d05bcf33 Author: Marek Vasut Date: Wed May 10 12:22:47 2023 +0200 iio: mlx90614: Sort headers Sort the headers alphabetically. No functional change. Acked-by: Crt Mori Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230510102251.10118-2-marex@denx.de Signed-off-by: Jonathan Cameron commit aac997a8a815ae1d708c24c8187264fd7869a81f Author: Marek Vasut Date: Wed May 10 12:22:46 2023 +0200 dt-bindings: iio: temperature: melexis,mlx90614: Document MLX90615 support Document support for MLX90615 Infra Red Thermometer, which seems to be the predecesor of MLX90614 . There are significant differences in the register layout compared to MLX90614, but the functionality of the device is virtually identical. Acked-by: Crt Mori Acked-by: Krzysztof Kozlowski Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230510102251.10118-1-marex@denx.de Signed-off-by: Jonathan Cameron commit ccadf1310fb0bc8d2cbcd14f94a6279c12ea9bee Author: Davidlohr Bueso Date: Tue May 23 10:09:27 2023 -0700 cxl/mbox: Add background cmd handling machinery This adds support for handling background operations, as defined in the CXL 3.0 spec. Commands that can take too long (over ~2 seconds) can run in the background asynchronously (to the hardware). The driver will deal with such commands synchronously, blocking all other incoming commands for a specified period of time, allowing time-slicing the command such that the caller can send incremental requests to avoid monopolizing the driver/device. Any out of sync (timeout) between the driver and hardware is just disregarded as an invalid state until the next successful submission. Such timeouts are considered a rare occurrence, either a real device problem or a driver issue that needs to reduce the size of the background operation to fit the timeout. On devices where mbox interrupts are supported, this will still use a poller that will wakeup in the specified wait intervals. The irq handler will simply awake the blocked cmd, which is also safe vs a task that is either waking (timing out) or already awoken. Similarly any irq setup error during the probing falls back to polling, thus avoids unnecessarily erroring out. Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20230523170927.20685-5-dave@stgolabs.net Signed-off-by: Dan Williams commit 9f7a320d167cd7f310114cf25009ceedf6a323ed Author: Davidlohr Bueso Date: Tue May 23 10:09:26 2023 -0700 cxl/pci: Introduce cxl_request_irq() Factor out common functionality/semantics for cxl shared interrupts into a new helper on top of devm_request_irq(). Suggested-by: Dan Williams Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20230523170927.20685-4-dave@stgolabs.net Signed-off-by: Dan Williams commit f279d0bc13505a25a8b6a307b806312116c2efd2 Author: Davidlohr Bueso Date: Tue May 23 10:09:25 2023 -0700 cxl/pci: Allocate irq vectors earlier during probe Move the cxl_alloc_irq_vectors() call further up in the probing in order to allow for mailbox interrupt usage. No change in semantics. Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20230523170927.20685-3-dave@stgolabs.net Signed-off-by: Dan Williams commit f6239d3f8ce4ebc5a5cfa3657377bd5007ae1547 Author: Davidlohr Bueso Date: Tue May 23 10:09:24 2023 -0700 rcuwait: Support timeouts The rcuwait utility provides an efficient and safe single wait/wake mechanism. It is used in situations where queued wait is the wrong semantics, and often too bulky. For example, cases where the wait is already done under a lock. In the past, rcuwait has been extended to support beyond only uninterruptible sleep, and similarly, there are users that can benefit for the addition of timeouts. As such, tntroduce rcuwait_wait_event_timeout(), with semantics equivalent to calls for queued wait counterparts. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20230523170927.20685-2-dave@stgolabs.net Signed-off-by: Dan Williams commit d8b44d8df4d932db3d88b2e79c67ffbd2c72e4dd Author: Anup Sharma Date: Fri May 5 19:00:42 2023 +0530 ASoC: dt-bindings: rt1016: Convert to dtschema Convert the RT1016 Stereo Audio Amplifier bindings to DT schema Signed-off-by: Anup Sharma Link: https://lore.kernel.org/r/ZFUFAmBJXvkQAG7m@yoga Signed-off-by: Mark Brown commit 1ca04f21b204e99dd704146231adfb79ea2fb366 Author: Dan Carpenter Date: Mon May 22 10:46:11 2023 +0300 remoteproc: stm32: Fix error code in stm32_rproc_parse_dt() There is a cut and paste bug so this code was returning the wrong variable. It should have been "ddata->hold_boot_rst" instead of "ddata->rst". Fixes: de598695a2ad ("remoteproc: stm32: Allow hold boot management by the SCMI reset controller") Signed-off-by: Dan Carpenter Reviewed-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/6f457246-6446-42cb-81ae-d37221d726b1@kili.mountain Signed-off-by: Mathieu Poirier commit ba674435e428168e01390c4e34bedc5ee9015834 Merge: a23b51b2c31c4 a9392efae9f5d Author: Mark Brown Date: Tue May 23 20:49:28 2023 +0100 ASoC: do not include runtime_pm.h if not needed Merge series from Claudiu Beznea : Series removes the pm_runtime.h inclusion in files where APIs exported though pm_runtime.h are not used. In case of files that make use of pm.h which comes form pm_runtime.h added patch 2/2. commit a23b51b2c31c47036d0a9ae498094c428b1d8015 Merge: ed67a3404a880 1b167ba8a2015 Author: Mark Brown Date: Tue May 23 20:49:22 2023 +0100 ASoC: SOF: Intel: mtl: Enable multicore support Merge series from Peter Ujfalusi : The following series will enable multicore support on MTL platforms similarly to other Intel platforms. The TGL patch is included to simplify the core_put implementation. Multicore support can be enabled by updated topologies, with current set of tplg files this series is not introducing any runtime change. commit 2b001b94073be6097b1a4a21defc5cfbb7aa2f9f Author: Andrii Nakryiko Date: Tue May 23 10:00:11 2023 -0700 libbpf: Start v1.3 development cycle Bump libbpf.map to v1.3.0 to start a new libbpf version cycle. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230523170013.728457-3-andrii@kernel.org commit 8bfbd046a3a8883c476eab1de6eb526f62bdc9d1 Author: Christian Göttsche Date: Thu May 11 14:32:12 2023 +0200 selinux: deprecated fs ocon The object context type `fs`, not to be confused with the well used object context type `fscon`, was introduced in the initial git commit 1da177e4c3f4 ("Linux-2.6.12-rc2") but never actually used since. The paper "A Security Policy Configuration for the Security-Enhanced Linux" [1] mentions it under `7.2 File System Contexts` but also states: Currently, this configuration is unused. The policy statement defining such object contexts is `fscon`, e.g.: fscon 2 3 gen_context(system_u:object_r:conA_t,s0) \ gen_context(system_u:object_r:conB_t,s0) It is not documented at selinuxproject.org or in the SELinux notebook and not supported by the Reference Policy buildsystem - the statement is not properly sorted - and thus not used in the Reference or Fedora Policy. Print a warning message at policy load for each such object context: SELinux: void and deprecated fs ocon 02:03 This topic was initially highlighted by Nicolas Iooss [2]. [1]: https://media.defense.gov/2021/Jul/29/2002815735/-1/-1/0/SELINUX-SECURITY-POLICY-CONFIGURATION-REPORT.PDF [2]: https://lore.kernel.org/selinux/CAJfZ7=mP2eJaq2BfO3y0VnwUJaY2cS2p=HZMN71z1pKjzaT0Eg@mail.gmail.com/ Signed-off-by: Christian Göttsche [PM: tweaked deprecation comment, description line wrapping] Signed-off-by: Paul Moore commit bfce728db31790420758de3173c3e7185ba57cb1 Author: K Prateek Nayak Date: Wed May 17 22:57:45 2023 +0530 pert tests: Add tests for new "perf stat --per-cache" aggregation option Add tests for the new "--per-cache" option in 'perf stat' for CSV and JSON generation as well as for the JSON linting. Suggested-by: Gautham Shenoy Signed-off-by: K Prateek Nayak Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ananth Narayan Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Cc: Stephane Eranian Cc: Wen Pu Link: https://lore.kernel.org/r/20230517172745.5833-6-kprateek.nayak@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit aab667ca8837e45fda0204bed7b59abd634c0b2b Author: K Prateek Nayak Date: Wed May 17 22:57:44 2023 +0530 perf stat: Add "--per-cache" aggregation option and document it This patch adds support for "--per-cache" option for aggregation at a particular cache level and documents the same. Following is the output of 'perf stat' with aggregation at L3 for the event "ls_dmnd_fills_from_sys.ext_cache_remote" on a dual socket 3rd Generation EPYC Processor (2 x 64C/128T - 16 LLCs) when running hackbench pinned to 4 LLCs: $ sudo perf stat --per-cache=L3 -a -e ls_dmnd_fills_from_sys.ext_cache_remote -- \ taskset -c 0-15,64-79,128-143,192-207 \ perf bench sched messaging -p -t -l 100000 -g 8 ... Performance counter stats for 'system wide': S0-D0-L3-ID0 16 9,500,803 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID8 16 6,338,099 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID16 16 355,005 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID24 16 22,067 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID32 16 16,321 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID40 16 11,619 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID48 16 4,238 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID56 16 31,158 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID64 16 28,242,452 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID72 16 22,906,973 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID80 16 72,898 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID88 16 56,907 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID96 16 20,456 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID104 16 40,913 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID112 16 78,113 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID120 16 37,897 ls_dmnd_fills_from_sys.ext_cache_remote Also support 'perf stat record' and 'perf stat report' with the ability to specify a different cache level to aggregate data at when running 'perf stat report'. $ sudo perf stat record --per-cache=L2 -a -e ls_dmnd_fills_from_sys.ext_cache_remote -- \ taskset -c 0-15,64-79,128-143,192-207 \ perf bench sched messaging -p -t -l 100000 -g 8 ... Performance counter stats for 'system wide': S0-D0-L2-ID0 2 1,442,061 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L2-ID1 2 1,548,994 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L2-ID2 2 1,553,557 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L2-ID3 2 1,420,122 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L2-ID4 2 1,465,461 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L2-ID5 2 1,455,153 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L2-ID6 2 1,595,237 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L2-ID7 2 1,499,321 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L2-ID8 2 1,919,025 ls_dmnd_fills_from_sys.ext_cache_remote ... S1-D1-L2-ID127 2 21,295 ls_dmnd_fills_from_sys.ext_cache_remote $ sudo perf stat report --per-cache=L3 Performance counter stats for 'perf stat record --per-cache=L2 -a -e ls_dmnd_fills_from_sys.ext_cache_remote --\ taskset -c 0-15,64-79,128-143,192-207 \ perf bench sched messaging -p -t -l 100000 -g 8': S0-D0-L3-ID0 16 11,979,906 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID8 16 14,257,202 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID16 16 377,484 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID24 16 27,224 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID32 16 26,816 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID40 16 14,461 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID48 16 10,499 ls_dmnd_fills_from_sys.ext_cache_remote S0-D0-L3-ID56 16 53,817 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID64 16 27,361,987 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID72 16 37,299,024 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID80 16 84,125 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID88 16 64,561 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID96 16 13,403 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID104 16 20,138 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID112 16 93,220 ls_dmnd_fills_from_sys.ext_cache_remote S1-D1-L3-ID120 16 35,465 ls_dmnd_fills_from_sys.ext_cache_remote On the above system, the domain covered by S0-D0-L3-ID0 contains S0-D0-L2-ID0 to S0-D0-L2-ID7, the corresponding count for L3-ID0 is equal to the sum of counts for L2-ID0 to L2-ID7. Add documentation for the newly introduced "--per-cache" option. Suggested-by: Gautham Shenoy Signed-off-by: K Prateek Nayak Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ananth Narayan Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Cc: Stephane Eranian Cc: Wen Pu Link: https://lore.kernel.org/r/20230517172745.5833-5-kprateek.nayak@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 4b87406a3b590888edf02705a815eb62e122e9ba Author: K Prateek Nayak Date: Wed May 17 22:57:43 2023 +0530 perf stat record: Save cache level information When aggregating based on cache-topology, in addition to the aggregation mode, knowing the cache level at which data is aggregated is necessary to ensure consistency when running 'perf stat record' and later 'perf stat report'. Save the cache level for aggregation as a part of the env data that can be later retrieved when running perf stat report. Suggested-by: Gautham Shenoy Signed-off-by: K Prateek Nayak Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ananth Narayan Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Cc: Stephane Eranian Cc: Wen Pu Link: https://lore.kernel.org/r/20230517172745.5833-4-kprateek.nayak@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 995ed074b829f293586028560f2f27f47889df64 Author: K Prateek Nayak Date: Wed May 17 22:57:42 2023 +0530 perf stat: Setup the foundation to allow aggregation based on cache topology Processors based on chiplet architecture, such as AMD EPYC and Hygon do not expose the chiplet details in the sysfs CPU topology information. However, this information can be derived from the per CPU cache level information from the sysfs. 'perf stat' has already supported aggregation based on topology information using core ID, socket ID, etc. It'll be useful to aggregate based on the cache topology to detect problems like imbalance and cache-to-cache sharing at various cache levels. This patch lays the foundation for aggregating data in 'perf stat' based on the processor's cache topology. The cmdline option to aggregate data based on the cache topology is added in Patch 4 of the series while this patch sets up all the necessary functions and variables required to support the new aggregation option. The patch also adds support to display per-cache aggregation, or save it as a JSON or CSV, as splitting it into a separate patch would break builds when compiling with "-Werror=switch-enum" where the compiler will complain about the lack of handling for the AGGR_CACHE case in the output functions. Committer notes: Don't use perf_stat_config in tools/perf/util/cpumap.c, this would make code that is in util/, thus not really specific to a single builtin, use a specific builtin config structure. Move the functions introduced in this patch from tools/perf/util/cpumap.c since it needs access to builtin specific and is not strictly needed to live in the util/ directory. With this 'perf test python' is back building. Suggested-by: Gautham Shenoy Signed-off-by: K Prateek Nayak Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ananth Narayan Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Cc: Stephane Eranian Cc: Wen Pu Link: https://lore.kernel.org/r/20230517172745.5833-3-kprateek.nayak@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 104ce27bcbfb204001a300498aa192235bd0836f Author: Trevor Wu Date: Mon May 8 15:15:32 2023 +0800 ASoC: mediatek: mt6359: update route for lineout mux Originally, lineout playback source can only be DAC_3RD. Some SoC masters only support stereo MTKAIF outputs, so lineout path can't be used in such case. MTKAIF connections are as follows. MOSI0 -> DAC_L MOSI1 -> DAC_R MOSI2 -> DAC_3rd In the patch, lineout playback source can be chosen between DAC_L and DAC_3rd, so sound can be outputted via lineout even though SoC only supports stereo MTKAIF outputs. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20230508071532.21665-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 24f398e74ba0a53bc95421f7eb139f4dc0207bb2 Author: Trevor Wu Date: Mon May 8 15:15:31 2023 +0800 ASoC: mediatek: mt6359: add mtkaif gpio setting Add mtkaif gpio driving to increase signal strength and smt setting to prevent from overshooting. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20230508071532.21665-4-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit acd4d219798769a6c1080bcfa7953e165dd8d681 Author: Trevor Wu Date: Mon May 8 15:15:30 2023 +0800 ASoC: mediatek: mt6359: fix kselftest error of playback gain kselftest tries to read/write the default value. The default register value of playback gain is 0x1F(mute), but max gain we specified is 0x12. The range of the control is 0x0~0x12 and mute(0x1F) is only used in the driver internally. To solve the problem, implement a new callback mt6359_get_playback_volsw to report user configured volume instead of the register value. In addition, update max of "Headset Volume" to 0x12, so it can match the maximum seen on latest data sheet. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20230508071532.21665-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 1a3eb4bb9826fd317358113ca048ed60184c6442 Author: Trevor Wu Date: Mon May 8 15:15:29 2023 +0800 ASoC: mediatek: mt6359: add supply for MTKAIF There are three output data pins MISO0, MISO1 and MISO2 for mt6359. UL_SRC should be enabled when MISO0 or MISO1 is used, and UL_SRC_34 should be enabled when MISO2 is used. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20230508071532.21665-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit db38d86d0c54e0dbea063e915ce3e1fe394af444 Author: Paul Olaru Date: Wed May 3 11:10:49 2023 +0300 ASoC: sof: Improve sof_ipc4_bytes_ext_put function The function is improved in the way that if the firmware returns a validation error on the newly sent bytes, then the kernel will automatically restore to the old bytes value for a given kcontrol. This way, if the firmware rejects a data blob then the kernel will also reject it, instead of saving it for the next suspend/resume cycle. The old behaviour is that the kernel would save it anyway and on next firmware boot it would apply the previously-rejected configuration, leading to errors during playback. Additionally, the function also saves previously validated configurations, so that if the firmware does end up rejecting a new bytes value the kernel can send an old, previously-valid configuration. Reviewed-by: Daniel Baluta Reviewed-by: Péter Ujfalusi Signed-off-by: Paul Olaru Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20230503081049.73847-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 299f6c752f8f7dabb62fe4df62ebd233b58402bd Author: Paul Olaru Date: Wed May 3 11:10:48 2023 +0300 ASoC: sof: Improve sof_ipc3_bytes_ext_put function The function is improved in the way that if the firmware returns a validation error on the newly sent bytes, then the kernel will automatically restore to the old bytes value for a given kcontrol. This way, if the firmware rejects a data blob then the kernel will also reject it, instead of saving it for the next suspend/resume cycle. The old behaviour is that the kernel would save it anyway and on next firmware boot it would apply the previously-rejected configuration, leading to errors during playback. Additionally, the function also saves previously validated configurations, so that if the firmware does end up rejecting a new bytes value the kernel can send an old, previously-valid configuration. Reviewed-by: Daniel Baluta Reviewed-by: Péter Ujfalusi Signed-off-by: Paul Olaru Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20230503081049.73847-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 8ce1bb9a5935385e9ef65bda1e8ca923c7fbb887 Author: Rasmus Villemoes Date: Tue Apr 25 15:45:26 2023 +0200 spi: spi-imx: set max_native_cs for imx51/imx53/imx6 variants The ecspi IP block on imx51/imx53/imx6 have four native chip selects. Tell that to the spi core so that any non-gpio chip selects get validated against that upper bound. Also set the SPI_MASTER_GPIO_SS so that the core verifies that, in the case where both native and gpio chip selects are in use, there is at least one leftover native chip select (or "channel", in the ecspi language) for use by the slaves sitting on gpio chip selects. Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20230425134527.483607-3-linux@rasmusvillemoes.dk Signed-off-by: Mark Brown commit d9032b304541e1f560349e461611f25d67f44a49 Author: Rasmus Villemoes Date: Tue Apr 25 15:45:25 2023 +0200 spi: spi-imx: use "controller" variable consistently in spi_imx_probe() Near the top of the function, spi_imx->controller is set to controller (and is of course never modified again). The rest of the function uses a mix of the two expressions. For consistency, readability and better code generation, drop all the spi_imx-> indirections. Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20230425134527.483607-2-linux@rasmusvillemoes.dk Signed-off-by: Mark Brown commit f991a220a44726c54c2332569a2a80bf074aa775 Author: Sebastian Reichel Date: Thu May 4 19:36:18 2023 +0200 regulator: rk808: add rk806 support Add rk806 support to the existing rk808 regulator driver. This has been implemented using shengfei Xu's rk806 specific driver from the vendor tree as reference. Co-developed-by: shengfei Xu Signed-off-by: shengfei Xu Reviewed-by: Matti Vaittinen Tested-by: Diederik de Haas # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-15-sebastian.reichel@collabora.com Signed-off-by: Mark Brown commit 22a94021e7d2b456c6abb59ad0a7ce4e94933d4a Author: Sebastian Reichel Date: Thu May 4 19:36:17 2023 +0200 regulator: rk808: revert to synchronous probing The rk808 driver registers a bunch of regulator devices in a loop. If one of the later regulators fails to register (usually because its input supply is not yet available) everything will be unrolled (i.e. previously registered regulators will be unregistered). With asynchronous registration there might already be consumers, though. We do not have the necessary infrastructure to properly unregister the consumer device, so this scenario should be avoided. First checking all input supplies or disallowing usage of the regulators until all are registered does not work, since there can be self-references (e.g. DCDC channels providing the supply of LDOs). The only sensible solution I found is registering the regulator devices asynchronously, so that we do not have to unroll. Since this is a major rework let's revert back to synchronous probing for now to fix the issue at hand. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-14-sebastian.reichel@collabora.com Signed-off-by: Mark Brown commit 5111c931f36cebe77d4ce66964c348e6eb4afca0 Author: Sebastian Reichel Date: Thu May 4 19:36:16 2023 +0200 regulator: rk808: cleanup parent device usage By overridering the device's of_node a bit earlier we can get the GPIOs and any other DT properties from our own device instead of relying on the parent device. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-13-sebastian.reichel@collabora.com Signed-off-by: Mark Brown commit 1b9e86d445a0f5c6d8dcbaf11508cb5dfb5848a8 Author: Sebastian Reichel Date: Thu May 4 19:36:15 2023 +0200 regulator: rk808: fix asynchronous probing If the probe routine fails with -EPROBE_DEFER after taking over the OF node from its parent driver, reprobing triggers pinctrl_bind_pins() and that will fail. Fix this by setting of_node_reused, so that the device does not try to setup pin muxing. For me this always happens once the driver is marked to prefer async probing and never happens without that flag. Fixes: 259b93b21a9f ("regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14") Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-12-sebastian.reichel@collabora.com Signed-off-by: Mark Brown commit 431cb97b763133fba8b1c68c1ed089315f25e4dd Author: Sebastian Reichel Date: Thu May 4 19:36:14 2023 +0200 regulator: expose regulator_find_closest_bigger Expose and document the table lookup logic used by regulator_set_ramp_delay_regmap, so that it can be reused for devices that cannot be configured via regulator_set_ramp_delay_regmap. Tested-by: Diederik de Haas # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-11-sebastian.reichel@collabora.com Signed-off-by: Mark Brown commit 0f2b1cb89ccdbdcedf7143f4153a4da700a05f48 Author: Alexander Aring Date: Fri May 19 11:21:27 2023 -0400 fs: dlm: make F_SETLK use unkillable wait_event While a non-waiting posix lock request (F_SETLK) is waiting for user space processing (in dlm_controld), wait for that processing to complete with an unkillable wait_event(). This makes F_SETLK behave the same way for F_RDLCK, F_WRLCK and F_UNLCK. F_SETLKW continues to use wait_event_killable(). Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit dc0ff0fa3a9bf9f7be3a9530f8f6079324f54fa5 Author: David Rau Date: Tue May 23 16:18:21 2023 +0000 ASoC: da7219: Add Jack insertion detection polarity Add support of selecting insertion detection polarity - Default polarity (Low) - Inverted polarity (High) Correct the keywords of parsing `dlg,jack-det-rate` bases on the new DT binding. Signed-off-by: David Rau Link: https://lore.kernel.org/r/20230523161821.4260-4-David.Rau.opensource@dm.renesas.com Signed-off-by: Mark Brown commit c28dc3bdfcd9e93b6cf1f3f0bb3c51e819fc977f Author: David Rau Date: Tue May 23 16:18:20 2023 +0000 ASoC: dt-bindings: da7219: Add jack-ins-det-pty property Add `dlg,jack-ins-det-pty` property for Jack insertion detection polarity selection. Signed-off-by: David Rau Link: https://lore.kernel.org/r/20230523161821.4260-3-David.Rau.opensource@dm.renesas.com Signed-off-by: Mark Brown commit 345585b776e6f6f1cab846eb3efbef32c53fc0e3 Author: David Rau Date: Tue May 23 16:18:19 2023 +0000 ASoC: dt-bindings: dialog,da7219: convert to dtschema - Convert Dialog DA7219 bindings to DT schema format. - Remove unused `dlg,ldo-lvl` property. Signed-off-by: David Rau Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230523161821.4260-2-David.Rau.opensource@dm.renesas.com Signed-off-by: Mark Brown commit 7a2280e8dcd2f1f436db9631287c0b21cf6a92b0 Author: Nirmoy Das Date: Mon May 22 14:42:05 2023 +0200 drm/i915: Wait for active retire before i915_active_fini() i915_active_fini() finalizes the debug object, which can occur before the active retires and deactivates the debug object. Wait for one final time before calling i915_active_fini(); Closes:: https://gitlab.freedesktop.org/drm/intel/-/issues/8311 Signed-off-by: Nirmoy Das Reviewed-by: Rodrigo Vivi Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230522124205.368-1-nirmoy.das@intel.com commit 37cee4876a45a5c3da79a83d34ed4f3c68548aef Author: Azeem Shaikh Date: Mon May 22 15:52:10 2023 +0000 drm/bridge: dw-hdmi: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230522155210.2336690-1-azeemshaikh38@gmail.com commit 1464e48d69ab7a50a377c9d39f5e5eb3cee2722e Author: Nícolas F. R. A. Prado Date: Thu May 18 15:39:02 2023 -0400 drm/bridge: anx7625: Prevent endless probe loop During probe, the driver registers i2c dummy devices and populates the aux bus, which registers a device for the panel. After doing that, the driver can still defer probe if needed. This ordering of operations is troublesome however, because the deferred probe work will retry probing all pending devices every time a new device is registered. Therefore, if modules need to be loaded in order to satisfy the dependencies for this driver to complete probe, the kernel will stall, since it'll keep trying to probe the anx7625 driver, but never succeed, given that modules would only be loaded after the deferred probe work completes. Two changes are required to avoid this issue: * Move of_find_mipi_dsi_host_by_node(), which can defer probe, to before anx7625_register_i2c_dummy_clients() and devm_of_dp_aux_populate_ep_devices(), which register devices. * Make use of the done_probing callback when populating the aux bus, so that the bridge registration is only done after the panel is probed. This is required because the panel might need to defer probe, but the aux bus population needs the i2c dummy devices working, so this call couldn't just be moved to an earlier point in probe. One caveat is that if the panel is described outside the aux bus, the probe loop issue can still happen, but we don't have a way to avoid it in that case since there's no callback available. With this patch applied, it's possible to boot on mt8192-asurada-spherion with CONFIG_DRM_ANALOGIX_ANX7625=y CONFIG_MTK_MMSYS=m CONFIG_BACKLIGHT_PWM=y and also with CONFIG_DRM_ANALOGIX_ANX7625=y CONFIG_MTK_MMSYS=y CONFIG_BACKLIGHT_PWM=m Fixes: adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel") Fixes: 269332997a16 ("drm/bridge: anx7625: Return -EPROBE_DEFER if the dsi host was not found") Reported-by: "kernelci.org bot" Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230518193902.891121-1-nfraprado@collabora.com commit a13bd91be22318768d55470cbc0b0f4488ef9edf Author: Yu Kuai Date: Fri Apr 14 16:40:08 2023 +0800 block/rq_qos: protect rq_qos apis with a new lock commit 50e34d78815e ("block: disable the elevator int del_gendisk") move rq_qos_exit() from disk_release() to del_gendisk(), this will introduce some problems: 1) If rq_qos_add() is triggered by enabling iocost/iolatency through cgroupfs, then it can concurrent with del_gendisk(), it's not safe to write 'q->rq_qos' concurrently. 2) Activate cgroup policy that is relied on rq_qos will call rq_qos_add() and blkcg_activate_policy(), and if rq_qos_exit() is called in the middle, null-ptr-dereference will be triggered in blkcg_activate_policy(). 3) blkg_conf_open_bdev() can call blkdev_get_no_open() first to find the disk, then if rq_qos_exit() from del_gendisk() is done before rq_qos_add(), then memory will be leaked. This patch add a new disk level mutex 'rq_qos_mutex': 1) The lock will protect rq_qos_exit() directly. 2) For wbt that doesn't relied on blk-cgroup, rq_qos_add() can only be called from disk initialization for now because wbt can't be destructed until rq_qos_exit(), so it's safe not to protect wbt for now. Hoever, in case that rq_qos dynamically destruction is supported in the furture, this patch also protect rq_qos_add() from wbt_init() directly, this is enough because blk-sysfs already synchronize writers with disk removal. 3) For iocost and iolatency, in order to synchronize disk removal and cgroup configuration, the lock is held after blkdev_get_no_open() from blkg_conf_open_bdev(), and is released in blkg_conf_exit(). In order to fix the above memory leak, disk_live() is checked after holding the new lock. Fixes: 50e34d78815e ("block: disable the elevator int del_gendisk") Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230414084008.2085155-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 712fd23a90eed6a73ea5135a500e59d30356d4f1 Author: Li Nan Date: Mon May 22 16:53:55 2023 +0800 block: remove redundant req_op in blk_rq_is_passthrough op &= REQ_OP_MASK in blk_op_is_passthrough() is exactly what req_op() do. Therefore, it is redundant to call req_op() for blk_op_is_passthrough(). Signed-off-by: Li Nan Reviewed-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20230522085355.1740772-1-linan666@huaweicloud.com Signed-off-by: Jens Axboe commit dfa6570eb5ce2f24059caadbe2ed70034b5337bc Author: Rafał Miłecki Date: Mon May 15 10:33:08 2023 +0200 ARM: dts: BCM5301X: Specify MAC addresses on Luxul devices Use NRAM (NVMEM device) and its "et0macaddr" variable (NVMEM cell) to point Ethernet devices to their MAC addresses. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20230515083308.7612-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 19571b46d8997d20c10b7194a3ee5772500ce725 Author: Stanislav Jakubek Date: Mon May 8 15:59:30 2023 +0200 dt-bindings: soc: bcm: add missing dt-binding document for bcm23550-cdc Broadcom BCM23550 has a Cluster Dormant Control block that keeps the CPU in idle state. A command needs to be sent to this block to bring the CPU into running state. This has been in use in mainline Linux since ~2016, but was never documented. Add a dt-binding document for it. Signed-off-by: Stanislav Jakubek Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230508135930.GA27583@standask-GA-A55M-S2HP Signed-off-by: Florian Fainelli commit 3b3e35b279bee5e51580c648399e20323467f58c Author: Rafał Miłecki Date: Mon May 15 17:19:21 2023 +0200 ARM: dts: BCM5301X: Relicense AXI interrupts code to the GPL 2.0+ / MIT Those entries were added by: 1. Hauke in commits dec378827c4a ("ARM: BCM5301X: Add IRQs to Broadcom's bus-axi in DTS file") and 1f80de6863ca ("ARM: BCM5301X: add IRQ numbers for PCIe controller") 2. Florian in the commit 2cd0c0202f13 ("ARM: dts: BCM5301X: Add SRAB interrupts") Move them to the bcm-ns.dtsi which uses dual licensing. That syncs more Northstar code to be based on the same licensing schema. Signed-off-by: Rafał Miłecki Cc: Hauke Mehrtens Cc: Florian Fainelli Acked-by: Hauke Mehrtens Link: https://lore.kernel.org/r/20230515151921.25021-2-zajec5@gmail.com Signed-off-by: Florian Fainelli commit b3b3cd885ed39cb4b38319a1c4fa4e41db6fee72 Author: Rafał Miłecki Date: Mon May 15 17:19:20 2023 +0200 ARM: dts: BCM5301X: Relicense Hauke's code to the GPL 2.0+ / MIT Move code added by Hauke to the bcm-ns.dtsi which uses dual licensing. That syncs more Northstar code to be based on the same licensing schema. Signed-off-by: Rafał Miłecki Cc: Hauke Mehrtens Acked-by: Hauke Mehrtens Link: https://lore.kernel.org/r/20230515151921.25021-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 06c6796e0304234da65e70577f354cb194086521 Author: Thomas Gleixner Date: Tue May 23 01:12:26 2023 +0200 cpu/hotplug: Fix off by one in cpuhp_bringup_mask() cpuhp_bringup_mask() iterates over a cpumask and starts all present CPUs up to a caller provided upper limit. The limit variable is decremented and checked for 0 before invoking cpu_up(), which is obviously off by one and prevents the bringup of the last CPU when the limit is equal to the number of present CPUs. Move the decrement and check after the cpu_up() invocation. Fixes: 18415f33e2ac ("cpu/hotplug: Allow "parallel" bringup up to CPUHP_BP_KICK_AP_STATE") Reported-by: Mark Brown Signed-off-by: Thomas Gleixner Tested-by: Mark Brown Link: https://lore.kernel.org/r/87wn10ufj9.ffs@tglx commit 2b72cec9eef19d73c2a4a3e603004fdf2d93d9e6 Author: K Prateek Nayak Date: Wed May 17 22:57:41 2023 +0530 perf: Extract building cache level for a CPU into separate function build_caches() builds the complete cache topology of the system by iterating over all CPU, building and comparing cache levels of each CPU, keeping only the unique ones at the end. Extract the unit that build the cache levels for a single CPU into a separate function. Expose this function, and the MAX_CACHE_LVL value to be used elsewhere in perf too. Signed-off-by: K Prateek Nayak Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ananth Narayan Cc: Gautham Shenoy Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Cc: Stephane Eranian Cc: Wen Pu Link: https://lore.kernel.org/r/20230517172745.5833-2-kprateek.nayak@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit bc4e41210e337d5df3ecd8a9a07cfd6f2d63815b Author: Ian Rogers Date: Wed May 17 10:38:02 2023 -0700 perf vendor events intel: Update tigerlake events/metrics Update tigerlake events to v1.12 including the new events MEM_LOAD_MISC_RETIRED.UC and SQ_MISC.BUS_LOCK. Metrics are updated to make TMA info metric names synchronized. Events and metrics were generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-14-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d97b82aead504a631033ebbf49cbe104dc603926 Author: Ian Rogers Date: Wed May 17 10:38:01 2023 -0700 perf vendor events intel: Update snowridgex events Update snowridgex to v1.21 that marks deprecated a number of events and adds improves descriptions. The events data was generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-13-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit b522c8aff810b06810d7791f1ece07758ed26194 Author: Ian Rogers Date: Wed May 17 10:38:00 2023 -0700 perf vendor events intel: Update skylake/skylakex events/metrics Update skylake events to v60 and skylakex events to v1.30, adding the events FP_ARITH_INST_RETIRED.4_FLOPS, FP_ARITH_INST_RETIRED.8_FLOPS, FP_ARITH_INST_RETIRED.SCALAR, FP_ARITH_INST_RETIRED.VECTOR and INT_MISC.CLEARS_COUNT. Metrics are updated to make TMA info metric names synchronized. Events and metrics were generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-12-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 9a5511eadea316f184940f92dfc5da1eecb0bfd9 Author: Ian Rogers Date: Wed May 17 10:37:59 2023 -0700 perf vendor events intel: Update sapphirerapids events/metrics Update sapphirerapids events to v1.13 improving event descriptions. Metrics are updated to make TMA info metric names synchronized. Events and metrics were generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-11-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 98f17fb413037393f3046fa5d9687ced1e4eb9c3 Author: Ian Rogers Date: Wed May 17 10:37:58 2023 -0700 perf vendor events intel: Update sandybridge metrics Metrics are updated to make TMA info metric names synchronized. Metrics were generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-10-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e08d2ae9bfc225edaea795e74c58934bdb91d27c Author: Ian Rogers Date: Wed May 17 10:37:57 2023 -0700 perf vendor events intel: Update jaketown metrics Metrics are updated to make TMA info metric names synchronized. Metrics were generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-9-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit b27d3ece5c9b70a87f68f0e52d68fb6eb828cbf8 Author: Ian Rogers Date: Wed May 17 10:37:56 2023 -0700 perf vendor events intel: Update ivybridge/ivytown metrics Metrics are updated to make TMA info metric names synchronized. Metrics were generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 545dbda74dbcca9df8a90afcfd28f5224e548b35 Author: Ian Rogers Date: Wed May 17 10:37:55 2023 -0700 perf vendor events intel: Update icelake/icelakex events/metrics Update icelake events to v1.18 including the new events MEM_LOAD_MISC_RETIRED.UC and SQ_MISC.BUS_LOCK. Metrics are updated to make TMA info metric names synchronized. Events and metrics were generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit c9e7771f28d083dab1afccdd72c3712e31aea4d5 Author: Ian Rogers Date: Wed May 17 10:37:54 2023 -0700 perf vendor events intel: Update haswell(x) metrics Metrics are updated to make TMA info metric names synchronized. Metrics were generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 27aebf378b0d8ecb69fa7db88ef016cfb8e6e37a Author: Ian Rogers Date: Wed May 17 10:37:53 2023 -0700 perf vendor events intel: Update elkhartlake events Update elkhartlake to v1.04 that marks deprecated a number of events and adds additional description to MEM_BOUND_STALLS.IFETCH. The events data was generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8c61edb840df87f2a5e370c7dfe954d07cf4db2d Author: Ian Rogers Date: Wed May 17 10:37:52 2023 -0700 perf vendor events intel: Update cascadelakex events/metrics Update cascadelakex to v1.18 including the new events INT_MISC.CLEARS_COUNT, FP_ARITH_INST_RETIRED.VECTOR, FP_ARITH_INST_RETIRED.SCALAR, FP_ARITH_INST_RETIRED.8_FLOPS and FP_ARITH_INST_RETIRED.4_FLOPS. Metrics are updated to make TMA info metric names synchronized. Events and metrics were generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7d124303d620cc29baba318bb313edf794c9ef60 Author: Ian Rogers Date: Wed May 17 10:37:51 2023 -0700 perf vendor events intel: Update broadwell variant events/metrics Update broadwell events to v28, broadwellde to v10, broadwellx to v21. Including the new events FP_ARITH_INST_RETIRED.VECTOR, and FP_ARITH_INST_RETIRED.4_FLOPS. Metrics are updated to make TMA info metric names synchronized. Events and metrics were generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit c04fcf7c8c4dfdcbfca8b8ec3e7e1fcb6d99e3e3 Author: Ian Rogers Date: Wed May 17 10:37:50 2023 -0700 perf vendor events intel: Update alderlake events/metrics Update events to v21 including the new event SQ_MISC.BUS_LOCK and improved comments. Metrics are updated to make TMA info metric names synchronized. Events and metrics were generated by: https://github.com/intel/perfmon/blob/main/scripts/create_perf_json.py Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230517173805.602113-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ed67a3404a8806a57c0015ce97bd3e6d61e7aa22 Author: Harshit Mogalapalli Date: Thu May 18 23:44:01 2023 -0700 ASoC: SOF: Intel: hda-dai: Fix locking in hda_ipc4_pre_trigger() hda_ipc4_pre_trigger() has two issues: 1. In the default case, we are returning without unlocking the mutex. 2. In case SNDRV_PCM_TRIGGER_STOP: when ret is less than zero it goes to out, unlocks but returns zero instead of a negative value. Fix this by changing the final return value to 'ret' instead of zero, and initialize 'ret' to zero in the start of the function. Fixes: 225f37b578a9 ("ASoC: SOF: ipc4-pcm: reset all pipelines during FE DAI hw_free") Signed-off-by: Harshit Mogalapalli Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230519064404.1659637-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Mark Brown commit fcbc3aaccfd57c7e71eac36bf1a8f063f19ceefa Author: Yang Li Date: Tue May 16 16:11:16 2023 +0800 ASoC: SOF: ipc4-topology: Fix an unsigned comparison which can never be negative The return value from the call to sof_ipc4_get_valid_bits() is int. However, the return value is being assigned to an unsigned int variable 'out_ref_valid_bits', so making it an int. Eliminate the following warning: ./sound/soc/sof/ipc4-topology.c:1537:6-24: WARNING: Unsigned expression compared with zero: out_ref_valid_bits < 0 Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4985 Signed-off-by: Yang Li Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230516081116.71370-1-yang.lee@linux.alibaba.com Signed-off-by: Mark Brown commit e7d85427ef898afe66c4c1b7e06e5659cec6b640 Author: Andrii Nakryiko Date: Mon May 22 16:29:14 2023 -0700 bpf: Validate BPF object in BPF_OBJ_PIN before calling LSM Do a sanity check whether provided file-to-be-pinned is actually a BPF object (prog, map, btf) before calling security_path_mknod LSM hook. If it's not, LSM hook doesn't have to be triggered, as the operation has no chance of succeeding anyways. Suggested-by: Christian Brauner Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Reviewed-by: Christian Brauner Link: https://lore.kernel.org/bpf/20230522232917.2454595-2-andrii@kernel.org commit f46392ee3dec24066e5fb260d9bd497b4cd4d191 Author: Larysa Zaremba Date: Wed May 17 18:01:04 2023 +0200 bpftool: Specify XDP Hints ifname when loading program Add ability to specify a network interface used to resolve XDP hints kfuncs when loading program through bpftool. Usage: bpftool prog load [...] xdpmeta_dev Writing just 'dev ' instead of 'xdpmeta_dev' is a very probable mistake that results in not very descriptive errors, so 'bpftool prog load [...] dev ' syntax becomes deprecated, followed by 'bpftool map create [...] dev ' for consistency. Now, to offload program, execute: bpftool prog load [...] offload_dev To offload map: bpftool map create [...] offload_dev 'dev ' still performs offloading in the commands above, but now triggers a warning and is excluded from bash completion. 'xdpmeta_dev' and 'offload_dev' are mutually exclusive options, because 'xdpmeta_dev' basically makes a program device-bound without loading it onto the said device. For now, offloaded programs cannot use XDP hints [0], but if this changes, using 'offload_dev ' should cover this case. [0] https://lore.kernel.org/bpf/a5a636cc-5b03-686f-4be0-000383b05cfc@linux.dev Signed-off-by: Larysa Zaremba Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20230517160103.1088185-1-larysa.zaremba@intel.com commit 6cc385d2cdb410fd7a774100bf865ae2da9c709b Author: Lorenzo Bianconi Date: Wed May 17 15:41:33 2023 +0200 selftests/bpf: Add xdp_feature selftest for bond device Introduce selftests to check xdp_feature support for bond driver. Signed-off-by: Lorenzo Bianconi Signed-off-by: Daniel Borkmann Reviewed-by: Jussi Maki Link: https://lore.kernel.org/bpf/64cb8f20e6491f5b971f8d3129335093c359aad7.1684329998.git.lorenzo@kernel.org commit 122333d6bd229af279cdb35d1b874b71b3b9ccfb Author: Nikolay Borisov Date: Fri May 5 15:03:32 2023 +0300 x86/tdx: Wrap exit reason with hcall_func() TDX reuses VMEXIT "reasons" in its guest->host hypercall ABI. This is confusing because there might not be a VMEXIT involved at *all*. These instances are supposed to document situation and reduce confusion by wrapping VMEXIT reasons with hcall_func(). The decompression code does not follow this convention. Unify the TDX decompression code with the other TDX use of VMEXIT reasons. No functional changes. Signed-off-by: Nikolay Borisov Signed-off-by: Dave Hansen Acked-by: Kirill A. Shutemov Link: https://lore.kernel.org/all/20230505120332.1429957-1-nik.borisov%40suse.com commit 19b60accb67b63609ff2186db7a113d9508a17ae Author: Basavaraj Natikar Date: Tue May 9 12:28:57 2023 +0530 HID: amd_sfh: Split sensor and HID initialization for SFH1.1 Sensors are enabled independently of HID device initialization. Sensor initialization should be kept separate in this case, while HID devices should be initialized according to the sensor state. Hence split sensor initialization and HID initialization for SFH1.1 into separate blocks. Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit c0709c6c9bc6b3a3423da3bea51db36308776604 Author: Basavaraj Natikar Date: Tue May 9 12:28:56 2023 +0530 HID: amd_sfh: Remove duplicate cleanup for SFH1.1 A duplicate cleanup is performed that is not necessary. As a result, remove duplicate cleanup and use common cleanup. Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 5ca505c6b0259606361d8f95b0811b783d4e78f7 Author: Basavaraj Natikar Date: Tue May 9 12:28:55 2023 +0530 HID: amd_sfh: Split sensor and HID initialization Sensors are enabled independently of HID device initialization. Sensor initialization should be kept separate in this case, while HID devices should be initialized according to the sensor state. Hence split sensor initialization and HID initialization into separate blocks. Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit e295709054d59e35be44794dd125efee528ccceb Author: Basavaraj Natikar Date: Tue May 9 12:28:54 2023 +0530 HID: amd_sfh: Remove duplicate cleanup A number of duplicate cleanups are performed that are not necessary. As a result, remove duplicate cleanups and use common cleanup. Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 6d2427494c72ebc9fd0511437907b4bbc52cdb55 Author: Basavaraj Natikar Date: Tue May 9 12:28:53 2023 +0530 HID: amd_sfh: Remove unnecessary log There is a duplicate log message that is not necessary. Hence remove unnecessary log message. Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 50931b44dc751784cdc5721bf30a79093c2c9fe9 Author: Bhupesh Sharma Date: Tue May 16 13:29:08 2023 +0530 arm64: dts: qcom: qrb4210-rb2: Enable aDSP and cDSP remoteproc nodes Enable the aDSP and cDSP remoteproc nodes on Qualcomm QRB4210 RB2 board. Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516075908.2323372-4-bhupesh.sharma@linaro.org commit 14e6c47b628788a8c8634bc59b2dd50d68a74de3 Author: Bhupesh Sharma Date: Tue May 16 13:29:07 2023 +0530 arm64: dts: qcom: qrb4210-rb2: Fix CD gpio for SDHC2 Card-Detect (CD) gpio for SDHC2 is an active GPIO line. Fix the same. This allows the uSD card to be properly detected on the board. Fixes: 8d58a8c0d930 ("arm64: dts: qcom: Add base qrb4210-rb2 board dts") Reviewed-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516075908.2323372-3-bhupesh.sharma@linaro.org commit 10254fb73fdadec81e47a776e149863a13030291 Author: Bhupesh Sharma Date: Tue May 16 13:29:06 2023 +0530 arm64: dts: qcom: qrb4210-rb2: Add SD pinctrl states Add the default and sleep pinctrl states for SDHC1 & 2 controllers on QRB4210 RB2 board. Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516075908.2323372-2-bhupesh.sharma@linaro.org commit 34a7cdf075410c30ca88c85627520dda74d3bd30 Author: Konrad Dybcio Date: Mon May 15 15:04:16 2023 +0200 arm64: dts: qcom: qrb4210-rb2: Enable CAN bus controller Enable the Microchip mcp2518fd hosted on the SPI5 bus. Signed-off-by: Konrad Dybcio Reviewed-and-Tested-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515-topic-rb2-bits-v1-5-a52d154a639d@linaro.org commit 42be4edd8910a5f998a5bd993f42ea7112dd8f80 Author: Konrad Dybcio Date: Mon May 15 15:04:15 2023 +0200 arm64: dts: qcom: qrb4210-rb2: Enable load setting on SDHCI VQMMC The MMC core calls regulator_set_load on VQMMC, enable loadsetting to make it effective. Fixes: 8d58a8c0d930 ("arm64: dts: qcom: Add base qrb4210-rb2 board dts") Signed-off-by: Konrad Dybcio Reviewed-and-Tested-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515-topic-rb2-bits-v1-4-a52d154a639d@linaro.org commit fd888ed763415c31cf0ea7f044bd6cf429832f0e Author: Konrad Dybcio Date: Mon May 15 15:04:14 2023 +0200 arm64: dts: qcom: qrb4210-rb2: Add GPIO LEDs Add the three LEDs (blue/yellow/green) connected to TLMM GPIOs. Signed-off-by: Konrad Dybcio Reviewed-and-Tested-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515-topic-rb2-bits-v1-3-a52d154a639d@linaro.org commit f7b01e07e89ced85975345b12cb63538ee07e91c Author: Konrad Dybcio Date: Mon May 15 15:04:13 2023 +0200 arm64: dts: qcom: qrb4210-rb2: Enable display out The RB2 has a HDMI output via an LT9611UXC bridge. Set it up. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov Reviewed-and-Tested-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515-topic-rb2-bits-v1-2-a52d154a639d@linaro.org commit e130889286881e561a2904c5da44c3cbf5d5cd79 Author: Konrad Dybcio Date: Mon May 15 15:04:12 2023 +0200 arm64: dts: qcom: qrb4210-rb2: Describe fixed regulators The board hosts a whole lot of fixed regulators. Describe them. Signed-off-by: Konrad Dybcio Reviewed-and-Tested-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515-topic-rb2-bits-v1-1-a52d154a639d@linaro.org commit d97a6332c5841df4fb03aef996a7139465d68ca8 Author: Krzysztof Kozlowski Date: Tue May 16 15:30:11 2023 +0200 arm64: dts: qcom: sm8550-qrd: add USB OTG Add missing parts of USB stack to enable USB OTG mode. The QRD8550 comes with one USB Type-C port. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516133011.108093-2-krzysztof.kozlowski@linaro.org commit b8ae83eb0c9648a3f9c386cfb191e31139050143 Author: Krzysztof Kozlowski Date: Tue May 16 15:30:10 2023 +0200 arm64: dts: qcom: sm8550-qrd: add PCIe0 Add PCIe0 nodes used with WCN7851 device. The PCIe1 is not connected, thus skip pcie_1_phy_aux_clk input clock to GCC. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230516133011.108093-1-krzysztof.kozlowski@linaro.org commit e6c7e2711df6520487782537f38c3a80a972b922 Author: Luke D. Jones Date: Wed May 3 15:47:11 2023 +1200 HID: asus: reformat the hotkey mapping block Older formatting of this block was beginning to get somewhat cluttered. Condensing the block and putting comments to the side makes it easier to read and scan the scancodes plus keycodes. Signed-off-by: Luke D. Jones Signed-off-by: Jiri Kosina commit 73920f615159b3539520657612b006ee24ea83f0 Author: Luke D. Jones Date: Wed May 3 15:47:10 2023 +1200 HID: asus: add keycodes for 0x6a, 0x4b, and 0xc7 These two keys are found on some models with dual display. - 0x6a is intended for controlling the secondary screen brightness. - 0x4b is intended for toggling the arrow keys between arrows and page up / page down. This key is found on a slightly modified keyboard layout. - 0xc7 is intended to cycle through keybvoard brightnesses (upwards) but there is not suitable existing code for this behaviour. Using `KEY_KBDILLUMTOGGLE` is different behaviour to Windows but at least is picked up by many desktops already. Signed-off-by: Luke D. Jones Signed-off-by: Jiri Kosina commit 74e47b2c52ed43701bf59a98bc703b7c246ba43e Author: Luke D. Jones Date: Wed May 3 15:47:09 2023 +1200 HID: asus: Add support for ASUS ROG Z13 keyboard Add support for the ROG Z13 keyboard. This is a variant of the last few ASUS ROG keyboards and has much of the same functionality. Signed-off-by: Luke D. Jones Signed-off-by: Jiri Kosina commit 1b167ba8a20152041d3af0c0cbbfd710f1e93e4b Author: Rander Wang Date: Tue May 23 13:32:17 2023 +0300 ASoC: SOF: Intel: tgl: unify core_put on IPC3 & IPC4 path Firmware may do context saving before powering off primary core, so driver needs to send ipc msg by set_core_state. In IPC4 path, firmware needs to save current context to IMR before powering off primary core. Firmware does nothing for set_core_state message in IPC3 path. So IPC4 and IPC3 can share the same operation sequence. Signed-off-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230523103217.20412-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit c6d15567a4d5dd51ecccc332d514c6dc21bce652 Author: Rander Wang Date: Tue May 23 13:32:16 2023 +0300 ASoC: SOF: Intel: mtl: add core_get & put support on MeterLake platforms In core_get case, driver can power up primary core and don't need to send ipc message to fw. Non-primary core should be powered up by fw with ipc message. In core_put case, driver should first send ipc message to fw to disable dsp core then power down primary core if the target is primary core. Signed-off-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230523103217.20412-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit a9392efae9f5de42673cfc1b81ac6fb88bdb26b2 Author: Claudiu Beznea Date: Wed May 17 12:49:03 2023 +0300 ASoC: use pm.h instead of runtime_pm.h Do not include pm_runtime.h header in files where runtime PM support is not implemented. Use pm.h instead as suspend to RAM specific implementation is available. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230517094903.2895238-3-claudiu.beznea@microchip.com Signed-off-by: Mark Brown commit 2f3092e77f98fcfc0d653846591401bfe2a5232e Author: Claudiu Beznea Date: Wed May 17 12:49:02 2023 +0300 ASoC: do not include pm_runtime.h if not used Do not include pm_runtime.h header in files where APIs exported by pm_runtime.h are not used. Signed-off-by: Claudiu Beznea Acked-by: Jarkko Nikula # for omap-mcbsp-st.c Link: https://lore.kernel.org/r/20230517094903.2895238-2-claudiu.beznea@microchip.com Signed-off-by: Mark Brown commit b0c536d88ed260d75eb3076690ca9630cafd1b90 Author: Thomas Zimmermann Date: Mon May 22 21:17:01 2023 +0200 drm/msm: Use struct fb_info.screen_buffer The fbdev framebuffer is in system memory. Store the address in the field 'screen_buffer'. Fixes the following sparse warning. ../drivers/gpu/drm/msm/msm_fbdev.c:124:26: warning: incorrect type in assignment (different address spaces) ../drivers/gpu/drm/msm/msm_fbdev.c:124:26: expected char [noderef] __iomem *screen_base ../drivers/gpu/drm/msm/msm_fbdev.c:124:26: got void * Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230522191701.13406-1-tzimmermann@suse.de commit aa25aacc3e3d1367d6674763a636a9fd5ffd12da Author: Thomas Zimmermann Date: Mon May 22 21:06:37 2023 +0200 drm/gma500: Clear fbdev framebuffer with fb_memset_io() The fbdev framebuffer is I/O memory, so clear it with fb_memset_io(). Fixes the following sparse warning: ../drivers/gpu/drm/gma500/fbdev.c:234:20: warning: incorrect type in argument 1 (different address spaces) ../drivers/gpu/drm/gma500/fbdev.c:234:20: expected void *s ../drivers/gpu/drm/gma500/fbdev.c:234:20: got char [noderef] __iomem *screen_base Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20230522190637.7039-1-tzimmermann@suse.de commit b002bac7b4847aa11a6a56d14b2d75d4118f9591 Author: Neil Armstrong Date: Tue May 23 09:15:48 2023 +0200 arm64: dts: qcom: sm8450-hdk: Add QMP & DP to SuperSpeed graph With support for the QMP combo phy to react to USB Type-C switch events, introduce it as the next hop for the SuperSpeed lanes of the Type-C connector, and connect the output of the DisplayPort controller to the QMP combo phy. This allows the TCPM to perform orientation switching of both USB and DisplayPort signals. Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230503-topic-sm8450-graphics-dp-next-v3-4-6c43d293995f@linaro.org commit a3e42da4f712ca7fb3c9b1543f11ad82100e9914 Author: Neil Armstrong Date: Tue May 23 09:15:47 2023 +0200 arm64: dts: qcom: sm8350-hdk: Add QMP & DP to SuperSpeed graph With support for the QMP combo phy to react to USB Type-C switch events, introduce it as the next hop for the SuperSpeed lanes of the Type-C connector, and connect the output of the DisplayPort controller to the QMP combo phy. This allows the TCPM to perform orientation switching of both USB and DisplayPort signals. Reviewed-by: Konrad Dybcio Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230503-topic-sm8450-graphics-dp-next-v3-3-6c43d293995f@linaro.org commit e5167da381a71eeeac13d8ec299ac7c597622b23 Author: Neil Armstrong Date: Tue May 23 09:15:46 2023 +0200 arm64: dts: qcom: sm8450: add ports subnodes in usb1 qmpphy node Add the USB3+DP Combo QMP PHY port subnodes in the SM8450 SoC DTSI to avoid duplication in the devices DTs. Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230503-topic-sm8450-graphics-dp-next-v3-2-6c43d293995f@linaro.org commit d831312557e7308cdb59da5b3a228175e8d7738d Author: Neil Armstrong Date: Tue May 23 09:15:45 2023 +0200 arm64: dts: qcom: sm8350: add ports subnodes in usb1 qmpphy node Add the USB3+DP Combo QMP PHY port subnodes in the SM8350 SoC DTSI to avoid duplication in the devices DTs. Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230503-topic-sm8450-graphics-dp-next-v3-1-6c43d293995f@linaro.org commit 5294c2d78f4ae96864e3f25c1fbc93191083973e Author: Neil Armstrong Date: Tue May 23 09:15:49 2023 +0200 arm64: defconfig: enable FSA4480 driver as module Enable the FSA4480 driver as module for Qualcomm HDK8350 and HDK8450 platforms to permit USB-C Altmode support. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230503-topic-sm8450-graphics-dp-next-v3-5-6c43d293995f@linaro.org commit 4b11fa4f0737aae1a3fc3cdf367acd4ebb5bc941 Author: Neil Armstrong Date: Tue May 23 09:15:50 2023 +0200 qcom: pmic_glink: enable altmode for SM8450 Create a separate bitmask for sm8550 and enable altmode aux driver for sm8450 platform to enable pmic-glink altmode events. Signed-off-by: Neil Armstrong Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230503-topic-sm8450-graphics-dp-next-v3-6-6c43d293995f@linaro.org commit de6d1f0c4919852514459f1876d7168212e5e1cd Author: Bjorn Andersson Date: Mon May 22 18:03:48 2023 -0700 dt-bindings: clock: qcom: Accept power-domains for GPUCC In many designs the power-domains provided by the GPU clock controller are powered by some GFX rail, add power-domains as a valid property to allow this to be specified. Signed-off-by: Bjorn Andersson Acked-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230523010348.63043-1-quic_bjorande@quicinc.com commit 03a58514d494fe50c6a6cb56604bb7bd4f46e676 Merge: 7195fb46dafb8 6b39e30dce181 Author: Takashi Iwai Date: Tue May 23 14:14:41 2023 +0200 Merge branch 'topic/midi20' into for-next This is a (largish) patch set for adding the support of MIDI 2.0 functionality, mainly targeted for USB devices. MIDI 2.0 is a complete overhaul of the 40-years old MIDI 1.0. Unlike MIDI 1.0 byte stream, MIDI 2.0 uses packets in 32bit words for Universal MIDI Packet (UMP) protocol. It supports both MIDI 1.0 commands for compatibility and the extended MIDI 2.0 commands for higher resolutions and more functions. For supporting the UMP, the patch set extends the existing ALSA rawmidi and sequencer interfaces, and adds the USB MIDI 2.0 support to the standard USB-audio driver. The rawmidi for UMP has a different device name (/dev/snd/umpC*D*) and it reads/writes UMP packet data in 32bit CPU-native endianness. For the old MIDI 1.0 applications, the legacy rawmidi interface is provided, too. As default, USB-audio driver will take the alternate setting for MIDI 2.0 interface, and the compatibility with MIDI 1.0 is provided via the rawmidi common layer. However, user may let the driver falling back to the old MIDI 1.0 interface by a module option, too. A UMP-capable rawmidi device can create the corresponding ALSA sequencer client(s) to support the UMP Endpoint and UMP Group connections. As a nature of ALSA sequencer, arbitrary connections between clients/ports are allowed, and the ALSA sequencer core performs the automatic conversions for the connections between a new UMP sequencer client and a legacy MIDI 1.0 sequencer client. It allows the existing application to use MIDI 2.0 devices without changes. The MIDI-CI, which is another major extension in MIDI 2.0, isn't covered by this patch set. It would be implemented rather in user-space. Roughly speaking, the first half of this patch set is for extending the rawmidi and USB-audio, and the second half is for extending the ALSA sequencer interface. The patch set is based on 6.4-rc2 kernel, but all patches can be cleanly applicable on 6.2 and 6.3 kernels, too (while 6.1 and older kernels would need minor adjustment for uapi header changes). The updates for alsa-lib and alsa-utils will follow shortly later. The author thanks members of MIDI Association OS/API Working Group, especially Andrew Mee, for great helps for the initial design and debugging / testing the drivers. Link: https://lore.kernel.org/r/20230523075358.9672-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 7195fb46dafb8750ed4055804cb131f376eb854e Author: Oswald Buddenhagen Date: Tue May 23 12:46:12 2023 +0200 ALSA: emu10k1: pass raw FX send config to snd_emu10k1_pcm_init_voice() ... instead of passing in a high-level mixer struct. Let the higher-level functions handle the differences between the voice types. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230523104612.198884-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit f5192e33810afde77cf8cba75f70af4348577fba Author: Oswald Buddenhagen Date: Tue May 23 12:46:11 2023 +0200 ALSA: emu10k1: introduce higher-level voice manipulation functions This adds snd_emu10k1_pcm_init_{voices,extra_voice}() and snd_emu10k1_playback_{un,}mute_voices() to slightly abstract by voice function and potential stereo property. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230523104612.198884-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit e34cd89a6af7f6504ae477902e358df234b88d30 Author: Arnd Bergmann Date: Fri May 19 10:25:52 2023 +0200 platform/x86: lenovo-yogabook: add I2C dependency The added platform_driver support fails to link when I2C core support is not rechable: x86_64-linux-ld: drivers/platform/x86/lenovo-yogabook.o: in function `yogabook_pdev_probe': lenovo-yogabook.c:(.text+0x5a5): undefined reference to `i2c_bus_type' Add a Kconfig dependency to enforce a working configuration. Fixes: 6df1523fa0b7 ("platform/x86: lenovo-yogabook: Add platform driver support") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230519082606.375471-1-arnd@kernel.org Signed-off-by: Hans de Goede commit 6b39e30dce18114e3fc27074cee9a2b91a3639d1 Author: Takashi Iwai Date: Tue May 23 09:53:58 2023 +0200 ALSA: docs: Add MIDI 2.0 documentation Add the brief document for describing the MIDI 2.0 implementation on Linux kernel. Both rawmidi and sequencer API extensions are described. Acked-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-38-tiwai@suse.de Signed-off-by: Takashi Iwai commit d2b706077792a366fac8c1db2f1b4406ad7da482 Author: Takashi Iwai Date: Tue May 23 09:53:57 2023 +0200 ALSA: seq: Add UMP group filter Add a new filter bitmap for UMP groups for reducing the unnecessary read/write when the client is connected to UMP EP seq port. The new group_filter field contains the bitmap for the groups, i.e. when the bit is set, the corresponding group is filtered out and the messages to that group won't be delivered. The filter bitmap consists of each bit of 1-based UMP Group number. The bit 0 is reserved for the future use. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-37-tiwai@suse.de Signed-off-by: Takashi Iwai commit e85b9260569dc3893bc084ec18ef48e199525ef8 Author: Takashi Iwai Date: Tue May 23 09:53:56 2023 +0200 ALSA: seq: Print UMP Endpoint and Block information in proc outputs This patch enhances the /proc/asound/seq/clients output to show a few more information about the assigned UMP Endpoint and Blocks. The "Groups" are shown in 1-based group number to align with the sequencer client name and port number. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-36-tiwai@suse.de Signed-off-by: Takashi Iwai commit d2d247e35eeea8331150d7708211a013aabccb5b Author: Takashi Iwai Date: Tue May 23 09:53:55 2023 +0200 ALSA: seq: Add ioctls for client UMP info query and setup Add new ioctls for sequencer clients to query and set the UMP endpoint and block information. As a sequencer client corresponds to a UMP Endpoint, one UMP Endpoint information can be assigned at most to a single sequencer client while multiple UMP block infos can be assigned by passing the type with the offset of block id (i.e. type = block_id + 1). For the kernel client, only SNDRV_SEQ_IOCTL_GET_CLIENT_UMP_INFO is allowed. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-35-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4025f0e627e127c79d372c6227b9a200406329f9 Author: Takashi Iwai Date: Tue May 23 09:53:54 2023 +0200 ALSA: seq: ump: Create UMP Endpoint port for broadcast Create a sequencer port for broadcasting the all group inputs at the port number 0. This corresponds to a UMP Endpoint connection; application can read all UMP events from this port no matter which group the UMP packet belongs to. Unlike seq ports for other UMP groups, a UMP Endpoint port has no SND_SEQ_PORT_TYPE_MIDI_GENERIC bit, so that it won't be treated as a normal MIDI 1.0 device from legacy applications. The port is named as "MIDI 2.0" to align with representations on other operation systems. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-34-tiwai@suse.de Signed-off-by: Takashi Iwai commit 81fd444aa371261cd33f31d4ffd80faeeeab0cc9 Author: Takashi Iwai Date: Tue May 23 09:53:53 2023 +0200 ALSA: seq: Bind UMP device This patch introduces a new ALSA sequencer client for the kernel UMP object, snd-seq-ump-client. It's a UMP version of snd-seq-midi driver, while this driver creates a sequencer client per UMP endpoint which contains (fixed) 16 ports. The UMP rawmidi device is opened in APPEND mode for output, so that multiple sequencer clients can share the same UMP endpoint, as well as the legacy UMP rawmidi devices that are opened in APPEND mode, too. For input, on the other hand, the incoming data is processed on the fly in the dedicated hook, hence it doesn't open a rawmidi device. The UMP packet group is updated upon delivery depending on the target sequencer port (which corresponds to the actual UMP group). Each sequencer port sets a new port type bit, SNDRV_SEQ_PORT_TYPE_MIDI_UMP, in addition to the other standard types for MIDI. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-33-tiwai@suse.de Signed-off-by: Takashi Iwai commit 329ffe11a014834fdef9167c7ea24bd459829f86 Author: Takashi Iwai Date: Tue May 23 09:53:52 2023 +0200 ALSA: seq: Allow suppressing UMP conversions A sequencer client like seq_dummy rather doesn't want to convert UMP events but receives / sends as is. Add a new event filter flag to suppress the automatic UMP conversion and applies accordingly. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-32-tiwai@suse.de Signed-off-by: Takashi Iwai commit e9e02819a98a50fefe2f8016b1e5237742637cd1 Author: Takashi Iwai Date: Tue May 23 09:53:51 2023 +0200 ALSA: seq: Automatic conversion of UMP events This patch enables the automatic conversion of UMP events from/to the legacy ALSA sequencer MIDI events. Also, as UMP itself has two different modes (MIDI 1.0 and MIDI 2.0), yet another converters between them are needed, too. Namely, we have conversions between the legacy and UMP like: - seq legacy event -> seq UMP MIDI 1.0 event - seq legacy event -> seq UMP MIDI 2.0 event - seq UMP MIDI 1.0 event -> seq legacy event - seq UMP MIDI 2.0 event -> seq legacy event and the conversions between UMP MIDI 1.0 and 2.0 clients like: - seq UMP MIDI 1.0 event -> seq UMP MIDI 2.0 event - seq UMP MIDI 2.0 event -> seq UMP MIDI 1.0 event The translation is per best-effort; some MIDI 2.0 specific events are ignored when translated to MIDI 1.0. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-31-tiwai@suse.de Signed-off-by: Takashi Iwai commit a3ca3b30800da0a334e2d6eb68d123ec8e2d2bf6 Author: Takashi Iwai Date: Tue May 23 09:53:50 2023 +0200 ALSA: seq: Add UMP group number to snd_seq_port_info Add yet more new filed "ump_group" to snd_seq_port_info for specifying the associated UMP Group number for each sequencer port. This will be referred in the upcoming automatic UMP conversion in sequencer core. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-30-tiwai@suse.de Signed-off-by: Takashi Iwai commit ff166a9d19fab3d77f50e9413df046fb1d7c01cc Author: Takashi Iwai Date: Tue May 23 09:53:49 2023 +0200 ALSA: seq: Add port direction to snd_seq_port_info Add a new field "direction" to snd_seq_port_info for allowing a client to tell the expected direction of the port access. A port might still allow subscriptions for read/write (e.g. for MIDI-CI) even if the primary usage of the port is a single direction (either input or output only). This new "direction" field can help to indicate such cases. When the direction is unspecified at creating a port and the port has either read or write capability, the corresponding direction bits are set automatically as default. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-29-tiwai@suse.de Signed-off-by: Takashi Iwai commit 177ccf811df4a893df339a72dc732bb26b66d055 Author: Takashi Iwai Date: Tue May 23 09:53:48 2023 +0200 ALSA: seq: Support MIDI 2.0 UMP Endpoint port This is an extension to ALSA sequencer infrastructure to support the MIDI 2.0 UMP Endpoint port. It's a "catch-all" port that is supposed to be present for each UMP Endpoint. When this port is read via subscription, it sends any events from all ports (UMP Groups) found in the same client. A UMP Endpoint port can be created with the new capability bit SNDRV_SEQ_PORT_CAP_UMP_ENDPOINT. Although the port assignment isn't strictly defined, it should be the port number 0. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-28-tiwai@suse.de Signed-off-by: Takashi Iwai commit 74661932ac5ecb12e4378f41083be6ac17804e71 Author: Takashi Iwai Date: Tue May 23 09:53:47 2023 +0200 ALSA: seq: Add port inactive flag This extends the ALSA sequencer port capability bit to indicate the "inactive" flag. When this flag is set, the port is essentially invisible, and doesn't appear in the port query ioctls, while the direct access and the connection to this port are still allowed. The active/inactive state can be flipped dynamically, so that it can be visible at any time later. This feature is introduced basically for UMP; some UMP Groups in a UMP Block may be unassigned, hence those are practically invisible. On ALSA sequencer, the corresponding sequencer ports will get this new "inactive" flag to indicate the invisible state. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-27-tiwai@suse.de Signed-off-by: Takashi Iwai commit 46397622a3fa8372b8fda0f04b33d16923b03b1b Author: Takashi Iwai Date: Tue May 23 09:53:46 2023 +0200 ALSA: seq: Add UMP support Starting from this commit, we add the basic support of UMP (Universal MIDI Packet) events on ALSA sequencer infrastructure. The biggest change here is that, for transferring UMP packets that are up to 128 bits, we extend the data payload of ALSA sequencer event record when the client is declared to support for the new UMP events. A new event flag bit, SNDRV_SEQ_EVENT_UMP, is defined and it shall be set for the UMP packet events that have the larger payload of 128 bits, defined as struct snd_seq_ump_event. For controlling the UMP feature enablement in kernel, a new Kconfig, CONFIG_SND_SEQ_UMP is introduced. The extended event for UMP is available only when this Kconfig item is set. Similarly, the size of the internal snd_seq_event_cell also increases (in 4 bytes) when the Kconfig item is set. (But the size increase is effective only for 32bit architectures; 64bit archs already have padding there.) Overall, when CONFIG_SND_SEQ_UMP isn't set, there is no change in the event and cell, keeping the old sizes. For applications that want to access the UMP packets, first of all, a sequencer client has to declare the user-protocol to match with the latest one via the new SNDRV_SEQ_IOCTL_USER_PVERSION; otherwise it's treated as if a legacy client without UMP support. Then the client can switch to the new UMP mode (MIDI 1.0 or MIDI 2.0) with a new field, midi_version, in snd_seq_client_info. When switched to UMP mode (midi_version = 1 or 2), the client can write the UMP events with SNDRV_SEQ_EVENT_UMP flag. For reads, the alignment size is changed from snd_seq_event (28 bytes) to snd_seq_ump_event (32 bytes). When a UMP sequencer event is delivered to a legacy sequencer client, it's ignored or handled as an error. Conceptually, ALSA sequencer client and port correspond to the UMP Endpoint and Group, respectively; each client may have multiple ports and each port has the fixed number (16) of channels, total up to 256 channels. As of this commit, ALSA sequencer core just sends and receives the UMP events as-is from/to clients. The automatic conversions between the legacy events and the new UMP events will be implemented in a later patch. Along with this commit, bump the sequencer protocol version to 1.0.3. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-26-tiwai@suse.de Signed-off-by: Takashi Iwai commit afb72505e4614a2ccefe3440d37dec3a2273c330 Author: Takashi Iwai Date: Tue May 23 09:53:45 2023 +0200 ALSA: seq: Introduce SNDRV_SEQ_IOCTL_USER_PVERSION ioctl For the future extension of ALSA sequencer ABI, introduce a new ioctl SNDRV_SEQ_IOCTL_USER_PVERSION. This is similar like the ioctls used in PCM and other interfaces, for an application to specify its supporting ABI version. The use of this ioctl will be mandatory for the upcoming UMP support. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-25-tiwai@suse.de Signed-off-by: Takashi Iwai commit 1359905383834ed5fc294fad3954d40dbcf770af Author: Takashi Iwai Date: Tue May 23 09:53:44 2023 +0200 ALSA: seq: Prohibit creating ports with special numbers Some port numbers are special, such as 254 for subscribers and 255 for broadcast. Return error if application tries to create such a port. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-24-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4f92eb792e9336a46480655ed18e8b59e2a6505c Author: Takashi Iwai Date: Tue May 23 09:53:43 2023 +0200 ALSA: seq: Check validity before creating a port object The client type and the port info validity check should be done before actually creating a port, instead of unnecessary create-and-scratch. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-23-tiwai@suse.de Signed-off-by: Takashi Iwai commit 7c3f0d3d3a1147f7eee79e090d0b047ab5fd3068 Author: Takashi Iwai Date: Tue May 23 09:53:42 2023 +0200 ALSA: seq: Check the conflicting port at port creation We didn't check if a port with the given port number has been already present at creating a new port. Check it and return -EBUSY properly if the port number conflicts. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-22-tiwai@suse.de Signed-off-by: Takashi Iwai commit 94c5b717ada970c0136a9369f620d11773b38a51 Author: Takashi Iwai Date: Tue May 23 09:53:41 2023 +0200 ALSA: seq: Drop dead code for the old broadcast support The broadcast and multicast supports have been never enabled. Let's drop the dead code. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-21-tiwai@suse.de Signed-off-by: Takashi Iwai commit d0c8308fc58b3f02868388b294a94d501c816900 Author: Takashi Iwai Date: Tue May 23 09:53:40 2023 +0200 ALSA: seq: Treat snd_seq_client object directly in client drivers Introduce the new helpers, snd_seq_kernel_client_get() and _put() for kernel client drivers to treat the snd_seq_client more directly. This allows us to reduce the exported symbols and APIs at each time we need to access some field in future. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-20-tiwai@suse.de Signed-off-by: Takashi Iwai commit ea46f79709b6262f12c8ca24f32bfe8d638152ee Author: Takashi Iwai Date: Tue May 23 09:53:39 2023 +0200 ALSA: seq: Add snd_seq_expand_var_event_at() helper Create a new variant of snd_seq_expand_var_event() for expanding the data starting from the given byte offset. It'll be used by the new UMP sequencer code later. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-19-tiwai@suse.de Signed-off-by: Takashi Iwai commit f80e6d60d677be1d4dbbcdbf97379b8fbcf97ff0 Author: Takashi Iwai Date: Tue May 23 09:53:38 2023 +0200 ALSA: seq: Clear padded bytes at expanding events There can be a small memory hole that may not be cleared at expanding an event with the variable length type. Make sure to clear it. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-18-tiwai@suse.de Signed-off-by: Takashi Iwai commit f4487c42aae596f02e0cb02a028d2a107ec1737d Author: Takashi Iwai Date: Tue May 23 09:53:37 2023 +0200 ALSA: usb-audio: Inform inconsistent protocols in GTBs When parsing Group Terminal Blocks, we overwrote the preferred protocol and the protocol capabilities silently from the last parsed GTB. This patch adds the information print indicating the unexpected overrides instead of silent action. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-17-tiwai@suse.de Signed-off-by: Takashi Iwai commit ec362b63c4b560006666998c582edc76a2f77910 Author: Takashi Iwai Date: Tue May 23 09:53:36 2023 +0200 ALSA: usb-audio: Enable the legacy raw MIDI support Attach the legacy rawmidi devices when enabled in Kconfig accordingly. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-16-tiwai@suse.de Signed-off-by: Takashi Iwai commit 0b5288f5fe63eab687c14e5940b9e0d532b129f2 Author: Takashi Iwai Date: Tue May 23 09:53:35 2023 +0200 ALSA: ump: Add legacy raw MIDI support This patch extends the UMP core code to support the legacy MIDI 1.0 rawmidi devices. When the new kconfig CONFIG_SND_UMP_LEGACY_RAWMIDI is set, the UMP core allows to attach an additional rawmidi device for each UMP Endpoint. The rawmidi device contains 16 substreams where each substream corresponds to a UMP Group belonging to the EP. The device reads/writes the legacy MIDI 1.0 byte streams and translates from/to UMP packets. The legacy rawmidi devices are exclusive with the UMP rawmidi devices, hence both of them can't be opened at the same time unless the UMP rawmidi is opened in APPEND mode. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-15-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6b41e64a5d17ec01380bc7ad10afd90e63beca19 Author: Takashi Iwai Date: Tue May 23 09:53:34 2023 +0200 ALSA: ump: Redirect rawmidi substream access via own helpers This is a code refactoring for abstracting the rawmidi access to the UMP's own helpers. It's a preliminary work for the later code refactoring of the UMP layer. Until now, we access to the rawmidi substream directly from the driver via rawmidi access helpers, but after this change, the driver is supposed to access via the newly introduced snd_ump_ops and receive/transmit via snd_ump_receive() and snd_ump_transmit() helpers. As of this commit, those are merely wrappers for the rawmidi substream, and no much function change is seen here. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-14-tiwai@suse.de Signed-off-by: Takashi Iwai commit d9c99876868c861afd0e9ce2cea407bbc446b3c9 Author: Takashi Iwai Date: Tue May 23 09:53:33 2023 +0200 ALSA: usb-audio: Create UMP blocks from USB MIDI GTBs USB MIDI spec defines the Group Terminal Blocks (GTB) that associate multiple UMP Groups. Those correspond to snd_ump_block entities in ALSA UMP abstraction, and now we create those UMP Block objects for each UMP Endpoint from the parsed GTB information. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-13-tiwai@suse.de Signed-off-by: Takashi Iwai commit 51701400a94e999c3109c84f88273a9face51c4b Author: Takashi Iwai Date: Tue May 23 09:53:32 2023 +0200 ALSA: usb-audio: Trim superfluous "MIDI" suffix from UMP EP name A single USB audio device may have multiple interfaces for different purposes (e.g. audio, MIDI and HID), where the iInterface descriptor of each interface may contain an own suffix, e.g. "MIDI" for a MIDI interface. as such a suffix is superfluous as a rawmidi and UMP Endpoint name, this patch trims the superfluous "MIDI" suffix from the name string. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-12-tiwai@suse.de Signed-off-by: Takashi Iwai commit 06cf3bf09d83944382b36c7617277619f25f49e4 Author: Takashi Iwai Date: Tue May 23 09:53:31 2023 +0200 ALSA: usb-audio: Get UMP EP name string from USB interface USB descriptor may provide a nicer name for USB interface, and we may take it as the UMP Endpoint name. The UMP EP name is copied as the rawmidi name, too. Also, fill the UMP block product_id field from the iSerialNumber string of the USB device descriptor as a recommended unique id, too. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-11-tiwai@suse.de Signed-off-by: Takashi Iwai commit ff49d1df79aef7580fe3ac99d17c3f886655d080 Author: Takashi Iwai Date: Tue May 23 09:53:30 2023 +0200 ALSA: usb-audio: USB MIDI 2.0 UMP support This patch provides a basic support for USB MIDI 2.0. As of this patch, the driver creates a UMP device per MIDI I/O endpoints, which serves as a dumb terminal to read/write UMP streams. A new Kconfig CONFIG_SND_USB_AUDIO_MIDI_V2 manages whether to enable or disable the MIDI 2.0 support. Also, the driver provides a new module option, midi2_enable, to allow disabling the MIDI 2.0 at runtime, too. When MIDI 2.0 support is disabled, the driver tries to fall back to the already existing MIDI 1.0 device (each MIDI 2.0 device is supposed to provide the MIDI 1.0 interface at the altset 0). For now, the driver doesn't manage any MIDI-CI or other protocol setups by itself, but relies on the default protocol given via the group terminal block descriptors. The MIDI 1.0 messages on MIDI 2.0 device will be automatically converted in ALSA sequencer in a later patch. As of this commit, the driver accepts merely the rawmidi UMP accesses. The driver builds up the topology in the following way: - Create an object for each MIDI endpoint belonging to the USB interface - Find MIDI EP "pairs" that share the same GTB; note that MIDI EP is unidirectional, while UMP is (normally) bidirectional, so two MIDI EPs can form a single UMP EP - A UMP endpoint object is created for each I/O pair - For remaining "solo" MIDI EPs, create unidirectional UMP EPs - Finally, parse GTBs and fill the protocol bits on each UMP So the driver may support multiple UMP Endpoints in theory, although most devices are supposed to have a single UMP EP that can contain up to 16 groups -- which should be large enough. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-10-tiwai@suse.de Signed-off-by: Takashi Iwai commit f8ddb0fb3289dfb6f064b1f0573fd4f032189e9e Author: Takashi Iwai Date: Tue May 23 09:53:29 2023 +0200 ALSA: usb-audio: Define USB MIDI 2.0 specs Define new structs and constants from USB MIDI 2.0 specification, to be used in the upcoming MIDI 2.0 support in USB-audio driver. A new class-specific endpoint descriptor and group terminal block descriptors are defined. Acked-by: Greg Kroah-Hartman Acked-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-9-tiwai@suse.de Signed-off-by: Takashi Iwai commit bb1bf4fa5953418c131796ee745c59899d34a149 Author: Takashi Iwai Date: Tue May 23 09:53:28 2023 +0200 ALSA: usb-audio: Manage number of rawmidis globally We're going to create rawmidi objects for MIDI 2.0 in a different code from the current code for USB-MIDI 1.0. As a preliminary work, this patch adds the number of rawmidi objects to keep globally in a USB-audio card instance, so that it can be referred from both MIDI 1.0 and 2.0 code. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-8-tiwai@suse.de Signed-off-by: Takashi Iwai commit fa030f666d2431be5310c0c0fef254e2e205d4cc Author: Takashi Iwai Date: Tue May 23 09:53:27 2023 +0200 ALSA: ump: Additional proc output UMP devices may have more interesting information than the traditional rawmidi. Extend the rawmidi_global_ops to allow the optional proc info output and show some more bits in the proc file for UMP. Note that the "Groups" field shows the first and the last UMP Groups, and both numbers are 1-based (i.e. the first group is 1). Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-7-tiwai@suse.de Signed-off-by: Takashi Iwai commit 30fc139260d46e9bdc06e46eec91e9ff61eb387e Author: Takashi Iwai Date: Tue May 23 09:53:26 2023 +0200 ALSA: ump: Add ioctls to inquiry UMP EP and Block info via control API It'd be convenient to have ioctls to inquiry the UMP Endpoint and UMP Block information directly via the control API without opening the rawmidi interface, just like SNDRV_CTL_IOCTL_RAWMIDI_INFO. This patch extends the rawmidi ioctl handler to support those; new ioctls, SNDRV_CTL_IOCTL_UMP_ENDPOINT_INFO and SNDRV_CTL_IOCTL_UMP_BLOCK_INFO, return the snd_ump_endpoint and snd_ump_block data that is specified by the device field, respectively. Suggested-by: Jaroslav Kysela Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-6-tiwai@suse.de Signed-off-by: Takashi Iwai commit 127ae6f6dad2edb2201e27b7e6fa72994b537fad Author: Takashi Iwai Date: Tue May 23 09:53:25 2023 +0200 ALSA: rawmidi: Skip UMP devices at SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE Applications may look for rawmidi devices with the ioctl SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE. Returning a UMP device from this ioctl may confuse the existing applications that support only the legacy rawmidi. This patch changes the code to skip the UMP devices from the lookup for avoiding the confusion, and introduces a new ioctl to look for the UMP devices instead. Along with this change, bump the CTL protocol version to 2.0.9. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-5-tiwai@suse.de Signed-off-by: Takashi Iwai commit e3a8a5b726bdd903de52bee6ba7c935c09d07ee8 Author: Takashi Iwai Date: Tue May 23 09:53:24 2023 +0200 ALSA: rawmidi: UMP support This patch adds the support helpers for UMP (Universal MIDI Packet) in ALSA core. The basic design is that a rawmidi instance is assigned to each UMP Endpoint. A UMP Endpoint provides a UMP stream, typically bidirectional (but can be also uni-directional, too), which may hold up to 16 UMP Groups, where each UMP (input/output) Group corresponds to the traditional MIDI I/O Endpoint. Additionally, the ALSA UMP abstraction provides the multiple UMP Blocks that can be assigned to each UMP Endpoint. A UMP Block is a metadata to hold the UMP Group clusters, and can represent the functions assigned to each UMP Group. A typical implementation of UMP Block is the Group Terminal Blocks of USB MIDI 2.0 specification. For distinguishing from the legacy byte-stream MIDI device, a new device "umpC*D*" will be created, instead of the standard (MIDI 1.0) devices "midiC*D*". The UMP instance can be identified by the new rawmidi info bit SNDRV_RAWMIDI_INFO_UMP, too. A UMP rawmidi device reads/writes only in 4-bytes words alignment, stored in CPU native endianness. The transmit and receive functions take care of the input/out data alignment, and may return zero or aligned size, and the params ioctl may return -EINVAL when the given input/output buffer size isn't aligned. A few new UMP-specific ioctls are added for obtaining the new UMP endpoint and block information. As of this commit, no ALSA sequencer instance is attached to UMP devices yet. They will be supported by later patches. Along with those changes, the protocol version for rawmidi is bumped to 2.0.3. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit fb3bd1215909866d6105224abe1566fd52695859 Author: Takashi Iwai Date: Tue May 23 09:53:23 2023 +0200 ALSA: rawmidi: Add ioctl callback to snd_rawmidi_global_ops A new callback, ioctl, is added to snd_rawmidi_global_ops for allowing the driver to deal with the own ioctls. This is another preparation patch for the upcoming UMP support. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit 09b62892ddeeb38c11979979e3c65a14dba5fdc6 Author: Takashi Iwai Date: Tue May 23 09:53:22 2023 +0200 ALSA: rawmidi: Pass rawmidi directly to snd_rawmidi_kernel_open() snd_rawmidi_kernel_open() is used only internally from ALSA sequencer, so far, and parsing the card / device matching table at each open is redundant, as each sequencer client already gets the rawmidi object beforehand. This patch optimizes the path by passing the rawmidi object directly at snd_rawmidi_kernel_open(). This is also a preparation for the upcoming UMP rawmidi I/O support. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230523075358.9672-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit b6e4686ca8c3932ed0eee66c016c05c870e44f5d Author: Charles Keepax Date: Tue May 23 10:01:24 2023 +0100 spi: spi-cadence: Add missing kernel doc for clk_rate in cdns_spi Add the missing kernel documentation to silence the build warning. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20230523090124.3132-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit f9d790c578d4e0f715213cc7f2f6f2b0d2d91988 Author: David Lin Date: Tue May 23 16:33:04 2023 +0800 ASoC: nau8825: Add pre-charge actions for input Adding pre-charge actions to make FEPGA power stable faster. It improve the recording quality at the beginning. Thus, it is also meaningfully to decrease the final adc delay time. Signed-off-by: David Lin Link: https://lore.kernel.org/r/20230523083303.98436-1-CTLIN0@nuvoton.com Signed-off-by: Mark Brown commit 1d4a84632b90d88316986b05bcdfe715399a33db Author: Venkata Prasad Potturu Date: Tue May 23 12:50:01 2023 +0530 ASoC: SOF: amd: Add pci revision id check Add pci revision id check for renoir and rembrandt platforms. Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/20230523072009.2379198-1-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown commit c5e4d83872ae2900aa142b0505eeb2a5026173a7 Author: Aidan MacDonald Date: Tue May 9 13:42:38 2023 +0100 mips: dts: ingenic: x1000: Add AIC device tree node Add a node for the on-board I2S audio controller. Signed-off-by: Aidan MacDonald Signed-off-by: Thomas Bogendoerfer commit 1004be040f46790271516a1e1560014f97cc3ebd Author: Keguang Zhang Date: Thu May 11 20:06:48 2023 +0800 MIPS: Loongson32: Remove reset.c Commit 2a31bf20808a ("watchdog: loongson1_wdt: Implement restart handler") implmented .restart ops, Then, _machine_restart is no longer needed. The _machine_halt and pm_power_off are also unnecessary, which contain no hardware operations. Therefore, remove the entire reset.c and related header file. Update the Makefile accordingly. Signed-off-by: Keguang Zhang Signed-off-by: Thomas Bogendoerfer commit b2e3406a38f0f48b1dfb81e5bb73d243ff6af179 Author: Ratheesh Kannoth Date: Mon May 22 07:34:04 2023 +0530 octeontx2-pf: Add support for page pool Page pool for each rx queue enhance rx side performance by reclaiming buffers back to each queue specific pool. DMA mapping is done only for first allocation of buffers. As subsequent buffers allocation avoid DMA mapping, it results in performance improvement. Image | Performance ------------ | ------------ Vannila | 3Mpps | with this | 42Mpps change | --------------------------- Signed-off-by: Ratheesh Kannoth Link: https://lore.kernel.org/r/20230522020404.152020-1-rkannoth@marvell.com Signed-off-by: Paolo Abeni commit 745b7908ecdbec3a3077cd770264c59cdc0efdfd Author: Aidan MacDonald Date: Fri May 5 15:24:00 2023 +0100 mips: dts: ingenic: Remove unnecessary AIC clocks The "ext" and "pll half" clocks don't belong in the DT. They are not consumed directly by the AIC and are only used as the parent clocks of the "i2s" clock. An operating system should be able to figure out that information itself because it presumably knows the layout of the clock tree. Removing these from the DT should be safe from a compatibility point of view because the jz4740-i2s driver in Linux does not, and never did depend on them. Signed-off-by: Aidan MacDonald Link: https://lore.kernel.org/all/20221028103418.17578-1-aidanmacdonald.0x0@gmail.com/ Reviewed-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 6d255623d7982df54a8b1bd4eea8a71b21de43fd Author: Yang Li Date: Fri Apr 28 14:11:09 2023 +0800 gpio: brcmstb: Use devm_platform_get_and_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li Acked-by: Florian Fainelli Acked-by: Doug Berger Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 3b8d8ccc39942cb4eced890c9776567b1e4117eb Author: Raag Jadav Date: Mon May 22 10:28:06 2023 +0530 gpio: tangier: calculate number of ctx using temporary variable Utilize a temporary variable to calculate number of ctx from ngpio inside ->probe() implementation. While at it, include math.h for using DIV_ROUND_UP(). Signed-off-by: Raag Jadav Signed-off-by: Bartosz Golaszewski commit 0fbcf57077c47b444e91b9ce8a243e6f7f53693d Author: Fei Yang Date: Thu May 18 22:11:02 2023 -0700 drm/i915/mtl: end support for set caching ioctl The design is to keep Buffer Object's caching policy immutable through out its life cycle. This patch ends the support for set caching ioctl from MTL onward. While doing that we also set BO's to be 1-way coherent at creation time because GPU is no longer automatically snooping CPU cache. For userspace components needing to fine tune the caching policy for BO's, a follow up patch will extend the GEM_CREATE uAPI to allow them specify caching mode at BO creation time. Signed-off-by: Fei Yang Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230519051103.3404990-2-fei.yang@intel.com commit b41cabb7be3c8113af0357366bd5e41a34b05a50 Author: Uwe Kleine-König Date: Sat May 20 19:47:35 2023 +0200 gpio: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 5cb957a188c7c71f6fdae6bc5a730eb7cbb676ca Author: Tony Lindgren Date: Wed May 17 12:54:43 2023 +0300 ARM: dts: Unify pinctrl-single pin group nodes for dra7 We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren commit 7a75ed229f35267438eeae6ec42926307185c4ea Author: Tony Lindgren Date: Wed May 17 12:55:25 2023 +0300 ARM: dts: Unify pinctrl-single pin group nodes for am4 We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren commit d73ab823ee9c2bba919eaffc8cc6bb7d71222c17 Author: Tony Lindgren Date: Wed May 17 12:25:03 2023 +0300 ARM: dts: Unify pinctrl-single pin group nodes for am33xx We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren commit c99b88740223ce85f050f9a1e023857f70deec4f Author: Tony Lindgren Date: Wed May 17 13:35:51 2023 +0300 ARM: dts: Unify pinctrl-single pin group nodes for ti81xx We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren commit e141d4a73f57f820511e292d72521b0fad8e334f Author: Tony Lindgren Date: Wed May 17 12:53:49 2023 +0300 ARM: dts: Unify pinctrl-single pin group nodes for omap5 We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren commit 7fff6f6d6e198ad619fea9dbbe9731999af56070 Author: Tony Lindgren Date: Wed May 17 12:52:53 2023 +0300 ARM: dts: Unify pinctrl-single pin group nodes for omap4 We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren commit c872f0d7780ad31ff791893822593588b71e2209 Author: Tony Lindgren Date: Wed May 17 12:37:00 2023 +0300 ARM: dts: Unify pinctrl-single pin group nodes for omap2 We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren commit 46bab63e1dcf5aa683a47d431aeff79106c0794b Author: Tony Lindgren Date: Wed May 17 12:26:19 2023 +0300 ARM: dts: Unify pinctrl-single pin group nodes for omap3 We want to unify the pinctrl-single pin group nodes to use naming "pins". Otherwise non-standad pin group names will add make dtbs checks errors when the pinctrl-single yaml binding gets merged. Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: Rob Herring Signed-off-by: Tony Lindgren commit 4ffec92e70ac5097b9f67ec154065305b16a3b46 Author: Tony Lindgren Date: Wed May 17 13:32:25 2023 +0300 ARM: dts: gta04: Move model property out of pinctrl node The model property should be at the top level, let's move it out of the pinctrl node. Fixes: d2eaf949d2c3 ("ARM: dts: omap3-gta04a5one: define GTA04A5 variant with OneNAND") Cc: Andreas Kemnade Cc: H. Nikolaus Schaller Signed-off-by: Tony Lindgren commit d1c20885d3b01e6a62e920af4b227abd294d22f3 Author: Biju Das Date: Thu May 18 16:23:34 2023 +0100 clk: renesas: rzg2l: Fix CPG_SIPLL5_CLK1 register write As per the RZ/G2L HW(Rev.1.30 May2023) manual, there are no "write enable" bits in the CPG_SIPLL5_CLK1 register. So fix the CPG_SIPLL5_CLK register write by removing the "write enable" bits. Fixes: 1561380ee72f ("clk: renesas: rzg2l: Add FOUTPOSTDIV clk support") Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230518152334.514922-1-biju.das.jz@bp.renesas.com [geert: Remove CPG_SIPLL5_CLK1_*_WEN bit definitions] Signed-off-by: Geert Uytterhoeven commit 7061b6af34686e7e2364b7240cfb061293218f2d Author: Jean-Philippe Brucker Date: Mon May 15 12:39:50 2023 +0100 iommu/virtio: Return size mapped for a detached domain When map() is called on a detached domain, the domain does not exist in the device so we do not send a MAP request, but we do update the internal mapping tree, to be replayed on the next attach. Since this constitutes a successful iommu_map() call, return *mapped in this case too. Fixes: 7e62edd7a33a ("iommu/virtio: Add map/unmap_pages() callbacks implementation") Signed-off-by: Jean-Philippe Brucker Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230515113946.1017624-3-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit 809d0810e3520da669d231303608cdf5fe5c1a70 Author: Jean-Philippe Brucker Date: Mon May 15 12:39:48 2023 +0100 iommu/virtio: Detach domain on endpoint release When an endpoint is released, for example a PCIe VF being destroyed or a function hot-unplugged, it should be detached from its domain. Send a DETACH request. Fixes: edcd69ab9a32 ("iommu: Add virtio-iommu driver") Reported-by: Akihiko Odaki Link: https://lore.kernel.org/all/15bf1b00-3aa0-973a-3a86-3fa5c4d41d2c@daynix.com/ Signed-off-by: Jean-Philippe Brucker Tested-by: Akihiko Odaki Link: https://lore.kernel.org/r/20230515113946.1017624-2-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit 5957c19305b10c73090b1390653ddf7e5e21aa35 Author: Jason Gunthorpe Date: Thu May 11 01:42:15 2023 -0300 iommu: Tidy the control flow in iommu_group_store_type() Use a normal "goto unwind" instead of trying to be clever with checking !ret and manually managing the unlock. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/17-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit e996c12d76d0b1aa8d5f082c6074e82398061943 Author: Jason Gunthorpe Date: Thu May 11 01:42:14 2023 -0300 iommu: Remove __iommu_group_for_each_dev() The last two users of it are quite trivial, just open code the one line loop. Reviewed-by: Lu Baolu Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/16-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 1000dccd5d134951d5fd37a7ad85ad7b19b825fc Author: Jason Gunthorpe Date: Thu May 11 01:42:13 2023 -0300 iommu: Allow IOMMU_RESV_DIRECT to work on ARM For now several ARM drivers do not allow mappings to be created until a domain is attached. This means they do not technically support IOMMU_RESV_DIRECT as it requires the 1:1 maps to work continuously. Currently if the platform requests these maps on ARM systems they are silently ignored. Work around this by trying again to establish the direct mappings after the domain is attached if the pre-attach attempt failed. In the long run the drivers will be fixed to fully setup domains when they are created without waiting for attachment. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/15-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit d99be00f42eac9fc35a164f3f6c8c7a56b295aa9 Author: Jason Gunthorpe Date: Thu May 11 01:42:12 2023 -0300 iommu: Consolidate the default_domain setup to one function Make iommu_change_dev_def_domain() general enough to setup the initial default_domain or replace it with a new default_domain. Call the new function iommu_setup_default_domain() and make it the only place in the code that stores to group->default_domain. Consolidate the three copies of the default_domain setup sequence. The flow flow requires: - Determining the domain type to use - Checking if the current default domain is the same type - Allocating a domain - Doing iommu_create_device_direct_mappings() - Attaching it to devices - Store group->default_domain This adjusts the domain allocation from the prior patch to be able to detect if each of the allocation steps is already the domain we already have, which is a more robust version of what change default domain was already doing. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/14-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit fcbb0a4d738ce3ccc06d2c73ba227cce5094d885 Author: Jason Gunthorpe Date: Thu May 11 01:42:11 2023 -0300 iommu: Revise iommu_group_alloc_default_domain() Robin points out that the fallback to guessing what domains the driver supports should only happen if the driver doesn't return a preference from its ops->def_domain_type(). Re-organize iommu_group_alloc_default_domain() so it internally uses iommu_def_domain_type only during the fallback and makes it clearer how the fallback sequence works. Make iommu_group_alloc_default_domain() return the domain so the return based logic is cleaner and to prepare for the next patch. Remove the iommu_alloc_default_domain() function as it is now trivially just calling iommu_group_alloc_default_domain(). Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/13-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 8b4eb75ee50e6f4606f88debf44aeb47937057d4 Author: Jason Gunthorpe Date: Thu May 11 01:42:10 2023 -0300 iommu: Consolidate the code to calculate the target default domain type Put all the code to calculate the default domain type into one function. Make the function able to handle the iommu_change_dev_def_domain() by taking in the target domain type and erroring out if the target type isn't reachable. This makes it really clear that specifying a 0 type during iommu_change_dev_def_domain() will have the same outcome as the normal probe path. Remove the obfuscating use of __iommu_group_for_each_dev() and related struct __group_domain_type. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/12-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit dfddd54dc77c4519ee3c94e7462b1c035c69a031 Author: Jason Gunthorpe Date: Thu May 11 01:42:09 2023 -0300 iommu: Remove the assignment of group->domain during default domain alloc group->domain should only be set once all the device's drivers have had their ops->attach_dev() called. iommu_group_alloc_default_domain() doesn't do this, so it shouldn't set the value. The previous patches organized things so that each caller of iommu_group_alloc_default_domain() follows up with calling __iommu_group_set_domain_internal() that does set the group->domain. Reviewed-by: Kevin Tian Reviewed-by: Lu Baolu Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/11-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 152431e4fe7f1aac8aa6cc57bfe58d2d2596be4d Author: Jason Gunthorpe Date: Thu May 11 01:42:08 2023 -0300 iommu: Do iommu_group_create_direct_mappings() before attach The iommu_probe_device() path calls iommu_create_device_direct_mappings() after attaching the device. IOMMU_RESV_DIRECT maps need to be continually in place, so if a hotplugged device has new ranges the should have been mapped into the default domain before it is attached. Move the iommu_create_device_direct_mappings() call up. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/10-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit e7f85dfbbc9cf8660174c45c213571aaa518df85 Author: Jason Gunthorpe Date: Thu May 11 01:42:07 2023 -0300 iommu: Fix iommu_probe_device() to attach the right domain The general invariant is that all devices in an iommu_group are attached to group->domain. We missed some cases here where an owned group would not get the device attached. Rework this logic so it follows the default domain flow of the bus_iommu_probe() - call iommu_alloc_default_domain(), then use __iommu_group_set_domain_internal() to set up all the devices. Finally always attach the device to the current domain if it is already set. This is an unlikely functional issue as iommufd uses iommu_attach_group(). It is possible to hot plug in a new group member, add a vfio driver to it and then hot add it to an existing iommufd. In this case it is required that the core code set the iommu_domain properly since iommufd won't call iommu_attach_group() again. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/9-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 2f74198ae006c50a4188ae02c10e2c7b0b8142da Author: Jason Gunthorpe Date: Thu May 11 01:42:06 2023 -0300 iommu: Replace iommu_group_do_dma_first_attach with __iommu_device_set_domain Since __iommu_device_set_domain() now knows how to handle deferred attach we can just call it directly from the only call site. Reviewed-by: Kevin Tian Reviewed-by: Lu Baolu Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/8-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 0046a4337eae148510173680f82b483f7c3b7ded Author: Jason Gunthorpe Date: Thu May 11 01:42:05 2023 -0300 iommu: Remove iommu_group_do_dma_first_attach() from iommu_group_add_device() This function is only used to construct the groups, it should not be operating the iommu driver. External callers in VFIO and POWER do not have any iommu drivers on the devices so group->domain will be NULL. The only internal caller is from iommu_probe_device() which already calls iommu_group_do_dma_first_attach(), meaning we are calling it twice in the only case it matters. Since iommu_probe_device() is the logical place to sort out the group's domain, remove the call from iommu_group_add_device(). Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/7-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit d257344c661950986e6129407f7169f54e0bb4cf Author: Jason Gunthorpe Date: Thu May 11 01:42:04 2023 -0300 iommu: Replace __iommu_group_dma_first_attach() with set_domain Reorganize the attach_deferred logic to set dev->iommu->attach_deferred immediately during probe and then have __iommu_device_set_domain() check it and not attach the default_domain. This is to prepare for removing the group->domain set from iommu_group_alloc_default_domain() by calling __iommu_group_set_domain() to set the group->domain. Reviewed-by: Lu Baolu Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/6-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 4c8ad9da05662141928fe4ed001d3775fd95221c Author: Jason Gunthorpe Date: Thu May 11 01:42:03 2023 -0300 iommu: Use __iommu_group_set_domain() in iommu_change_dev_def_domain() This is missing re-attach error handling if the attach fails, use the common code. The ugly "group->domain = prev_domain" will be cleaned in a later patch. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/5-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit ecd60dc5d22b2ac2a68d9bf84bed0cf96b654cde Author: Jason Gunthorpe Date: Thu May 11 01:42:02 2023 -0300 iommu: Use __iommu_group_set_domain() for __iommu_attach_group() The error recovery here matches the recovery inside __iommu_group_set_domain(), so just use it directly. Reviewed-by: Kevin Tian Reviewed-by: Lu Baolu Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/4-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit dcf40ed3a20d727be054c4a20db47b32cb5036d4 Author: Jason Gunthorpe Date: Thu May 11 01:42:01 2023 -0300 iommu: Make __iommu_group_set_domain() handle error unwind Let's try to have a consistent and clear strategy for error handling during domain attach failures. There are two broad categories, the first is callers doing destruction and trying to set the domain back to a previously good domain. These cases cannot handle failure during destruction flows and must succeed, or at least avoid a UAF on the current group->domain which is likely about to be freed. Many of the drivers are well behaved here and will not hit the WARN_ON's or a UAF, but some are doing hypercalls/etc that can fail unpredictably and don't meet the expectations. The second case is attaching a domain for the first time in a failable context, failure should restore the attachment back to group->domain using the above unfailable operation. Have __iommu_group_set_domain_internal() execute a common algorithm that tries to achieve this, and in the worst case, would leave a device "detached" or assigned to a global blocking domain. This relies on some existing common driver behaviors where attach failure will also do detatch and true IOMMU_DOMAIN_BLOCK implementations that are not allowed to ever fail. Name the first case with __iommu_group_set_domain_nofail() to make it clear. Pull all the error handling and WARN_ON generation into __iommu_group_set_domain_internal(). Avoid the obfuscating use of __iommu_group_for_each_dev() and be more careful about what should happen during failures by only touching devices we've already touched. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/3-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 3006b15b364a34a2a19b45bb2948dd6a83c5e1fe Author: Jason Gunthorpe Date: Thu May 11 01:42:00 2023 -0300 iommu: Add for_each_group_device() Convenience macro to iterate over every struct group_device in the group. Replace all open coded list_for_each_entry's with this macro. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/2-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 4db0e5f8875ef12be6e946770ed7ef0b9c2b80ff Author: Jason Gunthorpe Date: Thu May 11 01:41:59 2023 -0300 iommu: Replace iommu_group_device_count() with list_count_nodes() No reason to wrapper a standard function, just call the library directly. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/1-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 1ebc72ceef2613ba39eaad6caa723a4ff0a04473 Author: Ryan Wanner Date: Wed May 17 13:54:06 2023 +0200 ARM: dts: at91: Return to boolean properties Returning back to commit 0dc23d1a8e17 ("arm: dts: at91: Fix boolean properties with values") as pinctrl driver no longer expects an integer value and expects a simple boolean property. Signed-off-by: Ryan Wanner Acked-by: Nicolas Ferre Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/6f06be9e393c02563bc877498c8af75daf3b47f8.1684313910.git.Ryan.Wanner@microchip.com commit ef026e592baa01dd7402511e5ced90f4b3ac3d2c Author: Bjorn Andersson Date: Wed May 17 16:52:17 2023 -0700 arm64: dts: qcom: sc8280xp: Add SDC2 and enable on CRD The CRD has Micro SD slot, introduce the necessary DeviceTree nodes for enabling this. Signed-off-by: Bjorn Andersson Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517235217.1728548-1-quic_bjorande@quicinc.com commit 42b08375498e74f094425fad10d10c338fd29858 Author: Bjorn Andersson Date: Sun May 14 20:27:43 2023 -0700 arm64: dts: qcom: sc8280xp-x13s: Add QMP to SuperSpeed graph Following the CRD, connect the two QMP phys inbetween the USB Type-C connectors and the DisplayPort controller, to handle orientation switching. Tested-by: Abel Vesa Tested-by: Steev Klimaszewski Tested-by: Neil Armstrong # on HDK8450 Tested-by: Johan Hovold # X13s Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515032743.400170-9-quic_bjorande@quicinc.com commit 507ceaa5ca9fac0d9fe2521c29d7d6237c1214f4 Author: Bjorn Andersson Date: Sun May 14 20:27:42 2023 -0700 arm64: dts: qcom: sc8280xp-crd: Add QMP to SuperSpeed graph With support for the QMP combo phy to react to USB Type-C switch events, introduce it as the next hop for the SuperSpeed lanes of the two USB Type-C connectors, and connect the output of the DisplayPort controller to the QMP combo phy. This allows the TCPM to perform orientation switching of both USB and DisplayPort signals. Tested-by: Abel Vesa Tested-by: Steev Klimaszewski Tested-by: Neil Armstrong # on HDK8450 Tested-by: Johan Hovold # X13s Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515032743.400170-8-quic_bjorande@quicinc.com commit 62a41dc7166385e3ebf1d5795103bc8e3794838b Merge: de5c9bf40c458 f5d87b47a1d9d Author: Jakub Kicinski Date: Mon May 22 19:12:31 2023 -0700 Merge tag 'mlx5-updates-2023-05-19' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2023-05-19 mlx5 misc changes and code clean up: The following series contains general changes for improving E-Switch driver behavior. 1) improving condition checking 2) Code clean up 3) Using metadata matching on send-to-vport rules. 4) Using RoCE v2 instead of v1 for loopback rules. * tag 'mlx5-updates-2023-05-19' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: E-Switch, Initialize E-Switch for eswitch manager net/mlx5: devlink, Only show PF related devlink warning when needed net/mlx5: E-Switch, Use metadata matching for RoCE loopback rule net/mlx5: E-Switch, Use RoCE version 2 for loopback traffic net/mlx5e: E-Switch, Add a check that log_max_l2_table is valid net/mlx5e: E-Switch: move debug print of adding mac to correct place net/mlx5e: E-Switch, Check device is PF when stopping esw offloads net/mlx5: Remove redundant vport_group_manager cap check net/mlx5e: E-Switch, Use metadata for vport matching in send-to-vport rules net/mlx5e: E-Switch, Allow get vport api if esw exists net/mlx5e: E-Switch, Update when to set other vport context net/mlx5e: Remove redundant __func__ arg from fs_err() calls net/mlx5e: E-Switch, Remove flow_source check for metadata matching net/mlx5: E-Switch, Remove redundant check net/mlx5: Remove redundant esw multiport validate function ==================== Acked-by: Jakub Kicinski Link: https://lore.kernel.org/r/20230519175557.15683-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit de5c9bf40c4582729f64f66d9cf4920d50beb897 Author: Russell King (Oracle) Date: Sat May 20 11:41:42 2023 +0100 net: phylink: require supported_interfaces to be filled We have been requiring the supported_interfaces bitmap to be filled in by MAC drivers that have a mac_select_pcs() method. Now that all MAC drivers fill in the supported_interfaces bitmap, it is time to enforce this. We have already required supported_interfaces to be set in order for optical SFPs to be configured in commit f81fa96d8a6c ("net: phylink: use phy_interface_t bitmaps for optical modules"). Refuse phylink creation if supported_interfaces is empty, and remove code to deal with cases where this mask is empty. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/E1q0K1u-006EIP-ET@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 5859a99b52254be356d3cca2e40f7f371ef24b0a Author: Russell King (Oracle) Date: Sat May 20 11:18:30 2023 +0100 net: sfp: add support for a couple of copper multi-rate modules Add support for the Fiberstore SFP-10G-T and Walsun HXSX-ATRC-1 modules. Internally, the PCB silkscreen has what seems to be a part number of WT_502. Fiberstore use v2.2 whereas Walsun use v2.6. These modules contain a Marvell AQrate AQR113C PHY, accessible through I2C 0x51 using the "rollball" protocol. In both cases, the PHY is programmed to use 10GBASE-R with pause-mode rate adaption. Unlike the other rollball modules, these only need a four second delay before we can talk to the PHY. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/E1q0JfS-006Dqc-8t@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 6f640df149adf785184656a076b79d90fc4c86cc Author: Tejun Heo Date: Mon May 22 15:13:03 2023 -1000 scsi: NCR5380: Use default @max_active for hostdata->work_q hostdata->work_q only hosts a single work item, hostdata->main_task, and thus doesn't need explicit concurrency limit. Let's use the default @max_active. This doesn't cost anything and clearly expresses that @max_active doesn't matter. Signed-off-by: Tejun Heo Acked-by: Finn Thain Acked-by: "Martin K. Petersen" Cc: Michael Schmitz Cc: "James E.J. Bottomley" Cc: linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org commit 9284d3b9a3609db30a528947ec4e5178055cd268 Author: Ismael Ferreras Morezuelas Date: Mon May 22 17:21:07 2023 -0700 Input: xpad - spelling fixes for "Xbox" The Linux kernel is notorious for misspelling X-Box, X-box, XBox or XBOX; the official spelling is actually just Xbox. Plain and simple. Tried to respect the existing notes but still following the style guide. No functional changes intended. This only affects ancillary parts. Signed-off-by: Ismael Ferreras Morezuelas Link: https://lore.kernel.org/r/401b1d94-1348-15fd-b48f-a80e8885c7a4@gmail.com Signed-off-by: Dmitry Torokhov commit f047d1e38bdfda2e9b9bf82ffa761711acacbd69 Author: Randy Dunlap Date: Thu May 18 14:27:49 2023 -0700 scsi: docs: sym53c8xx_2: Shorten chapter heading Make the chapter heading concise yet still descriptive. This makes the subsystem table of contents more readable (IMO). Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230518212749.18266-12-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: Matthew Wilcox Signed-off-by: Martin K. Petersen commit 7c891fe3db3a27c467efe33a98cd8479fe021b9b Author: Randy Dunlap Date: Thu May 18 14:27:48 2023 -0700 scsi: docs: ncr53c8xx: Shorten chapter heading Make the chapter heading concise yet still descriptive. This makes the subsystem table of contents more readable (IMO). Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230518212749.18266-11-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Martin K. Petersen commit 0176d3395a3afbd8bccf881d3b7cf126ae096654 Author: Randy Dunlap Date: Thu May 18 14:27:47 2023 -0700 scsi: docs: megaraid: Clarify chapter heading Include "Megaraid" in the chapter heading so that it is clear what subject the document is about. This improves viewing in the TOC. Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230518212749.18266-10-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: Kashyap Desai Cc: Sumit Saxena Cc: Shivasharan S Cc: megaraidlinux.pdl@broadcom.com Signed-off-by: Martin K. Petersen commit b636a0297e4fbb47a0a15b635c61fafbbe339b26 Author: Randy Dunlap Date: Thu May 18 14:27:46 2023 -0700 scsi: docs: g_NCR5380: Shorten chapter heading Make the chapter heading be concise yet still descriptive. This makes the subsystem table of contents more readable (IMO). Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230518212749.18266-9-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: Finn Thain Cc: Michael Schmitz Acked-by: Finn Thain Signed-off-by: Martin K. Petersen commit 8ebddfeef518156cc28bb6b079c38a43a52786f5 Author: Randy Dunlap Date: Thu May 18 14:27:45 2023 -0700 scsi: docs: scsi-generic: Multiple cleanups Make the heading be concise yet still descriptive. This makes the subsystem table of contents more readable (IMO). Spell "CDROM" as "CD-ROM". Capitalize "Linux". Use https instead of http for URLs. Drop the Linux Documentation Project URL for the SCSI generic HOWTO since it hasn't been updated since 2002. Use Doug Gilbert's URL for it instead. Drop some outdated documentation & references. Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230518212749.18266-8-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: Doug Gilbert Signed-off-by: Martin K. Petersen commit 66fcd6026c71a2a33a1b6a71fd2b1ee9bd89f48c Author: Randy Dunlap Date: Thu May 18 14:27:44 2023 -0700 scsi: docs: scsi_fc_transport: Fix typo in heading Fix the typo "Tansport" to be "Transport". Update email address for James Smart. Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230518212749.18266-7-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: James Smart Signed-off-by: Martin K. Petersen commit 573a43f26d80a24b14ef5da817fdda0e28ec3e9a Author: Randy Dunlap Date: Thu May 18 14:27:43 2023 -0700 scsi: docs: dc395x: Shorten the chapter heading Make the heading be concise yet still descriptive. This makes the subsystem table of contents more readable (IMO). Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230518212749.18266-6-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: Oliver Neukum Cc: Ali Akcaagac Cc: Jamie Lenehan Cc: dc395x@twibble.org Signed-off-by: Martin K. Petersen commit a292835f69c62ea0de2501b8733f8a30a561d620 Author: Randy Dunlap Date: Thu May 18 14:27:42 2023 -0700 scsi: docs: scsi-changer: Shorten the chapter heading Make the heading be concise yet still descriptive. This makes the subsystem table of contents more readable (IMO). Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230518212749.18266-5-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: Gerd Knorr Signed-off-by: Martin K. Petersen commit 1d3e21238f5042bbe3634612c7916f13ea77feef Author: Randy Dunlap Date: Thu May 18 14:27:41 2023 -0700 scsi: docs: arcmsr: Use a chapter heading for clarity Add a chapter heading so that the document sections are not all at the same level, mucking up the SCSI subsystem contents. Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230518212749.18266-4-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Martin K. Petersen commit c4e672ac8c4961b73d45571aeddd436f71379251 Author: Randy Dunlap Date: Thu May 18 14:27:40 2023 -0700 scsi: docs: introduction: Multiple cleanups Modify URLs to use https instead of http. Remove ancient URLs that don't work. Change "scsi" in text to "SCSI". Change "cdrom" in text to "CD-ROM". Drop the reference to "autoclean" for modules since I can't find it in any current documentation. Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230518212749.18266-3-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Martin K. Petersen commit 682b07d2ff54c5bb755b96e86b973c2ad9a56b5a Author: Randy Dunlap Date: Thu May 18 14:27:39 2023 -0700 scsi: docs: Organize the SCSI documentation Break the SCSI documentation up into categories: Introduction, APIs, driver parameters, and host adapter drivers instead of alphabetical by document file name (i.e., no organization). Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20230518212749.18266-2-rdunlap@infradead.org Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Martin K. Petersen commit 50cd8714a12b1b8ac42139d2b453b2c1d406f0a9 Author: Niklas Schnelle Date: Mon May 22 14:52:24 2023 -0700 Input: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230522105049.1467313-16-schnelle@linux.ibm.com Signed-off-by: Dmitry Torokhov commit e90644b0ce2d700a65579ac74ff594414e8ba30f Author: Gustavo A. R. Silva Date: Wed May 17 15:22:45 2023 -0600 scsi: lpfc: Replace one-element array with flexible-array member One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array members in a couple of structures, and refactor the rest of the code, accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/295 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/6c6dcab88524c14c47fd06b9332bd96162656db5.1684358315.git.gustavoars@kernel.org Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 144679dfb5840d58fd37a14f7b3a268531ec3b79 Author: Christophe JAILLET Date: Sun May 7 17:23:49 2023 +0200 scsi: mpi3mr: Fix the type used for pointers to bitmap Bitmaps are "unsigned long[]", so better use "unsigned long *" instead of a plain "void *" when dealing with pointers to bitmaps. This is more informative. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/8bdf9148ce1a5d01aac11c46c8617b477813457e.1683473011.git.christophe.jaillet@wanadoo.fr Signed-off-by: Martin K. Petersen commit 2e2fe5ac695a00ab03cab4db1f4d6be07168ed9d Author: Yuchen Yang Date: Fri May 5 22:12:55 2023 +0800 scsi: 3w-xxxx: Add error handling for initialization failure in tw_probe() Smatch complains that: tw_probe() warn: missing error code 'retval' This patch adds error checking to tw_probe() to handle initialization failure. If tw_reset_sequence() function returns a non-zero value, the function will return -EINVAL to indicate initialization failure. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Yuchen Yang Link: https://lore.kernel.org/r/20230505141259.7730-1-u202114568@hust.edu.cn Reviewed-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit a1f871f9f30124669d7afbdb8754f0826f49b564 Author: Keoseong Park Date: Wed May 3 19:46:30 2023 +0900 scsi: ufs: core: Return earlier if ufshcd_hba_init_crypto_capabilities() fails The 'err' variable is used only as the result of ufshcd_hba_init_crypto_capabilities(), so return 'err' immediately when failed. If it is not an error, explicitly return 0. Signed-off-by: Keoseong Park Link: https://lore.kernel.org/r/20230503104630epcms2p8b82734102ffb920531e9264604086372@epcms2p8 Signed-off-by: Martin K. Petersen commit 8b60e2189fcd8b10b592608256eb97aebfcff147 Merge: 7907ad748bdba 18bd7718b5c48 Author: Martin K. Petersen Date: Mon May 22 17:09:51 2023 -0400 Merge patch series "Add Command Duration Limits support" Niklas Cassel says: This series adds support for Command Duration Limits. The series is based on linux tag: v6.4-rc1 The series can also be found in git: https://github.com/floatious/linux/commits/cdl-v7 ================= CDL in ATA / SCSI ================= Command Duration Limits is defined in: T13 ATA Command Set - 5 (ACS-5) and T10 SCSI Primary Commands - 6 (SPC-6) respectively (a simpler version of CDL is defined in T10 SPC-5). CDL defines Duration Limits Descriptors (DLD). 7 DLDs for read commands and 7 DLDs for write commands. Simply put, a DLD contains a limit and a policy. A command can specify that a certain limit should be applied by setting the DLD index field (3 bits, so 0-7) in the command itself. The DLD index points to one of the 7 DLDs. DLD index 0 means no descriptor, so no limit. DLD index 1-7 means DLD 1-7. A DLD can have a few different policies, but the two major ones are: -Policy 0xF (abort), command will be completed with command aborted error (ATA) or status CHECK CONDITION (SCSI), with sense data indicating that the command timed out. -Policy 0xD (complete-unavailable), command will be completed without error (ATA) or status GOOD (SCSI), with sense data indicating that the command timed out. Note that the command will not have transferred any data to/from the device when the command timed out, even though the command returned success. Regardless of the CDL policy, in case of a CDL timeout, the I/O will result in a -ETIME error to user-space. The DLDs are defined in the CDL log page(s) and are readable and writable. Reading and writing the CDL DLDs are outside the scope of the kernel. If a user wants to read or write the descriptors, they can do so using a user-space application that sends passthrough commands, such as cdl-tools: https://github.com/westerndigitalcorporation/cdl-tools ================================ The introduction of ioprio hints ================================ What the kernel does provide, is a method to let I/O use one of the CDL DLDs defined in the device. Note that the kernel will simply forward the DLD index to the device, so the kernel currently does not know, nor does it need to know, how the DLDs are defined inside the device. The way that the CDL DLD index is supplied to the kernel is by introducing a new 10 bit "ioprio hint" field within the existing 16 bit ioprio definition. Currently, only 6 out of the 16 ioprio bits are in use, the remaining 10 bits are unused, and are currently explicitly disallowed to be set by the kernel. For now, we only add ioprio hints representing CDL DLD index 1-7. Additional ioprio hints for other QoS features could be defined in the future. A theoretical future work could be to make an I/O scheduler aware of these hints. E.g. for CDL, an I/O scheduler could make use of the duration limit in each descriptor, and take that information into account while scheduling commands. Right now, the ioprio hints will be ignored by the I/O schedulers. ============================== How to use CDL from user-space ============================== Since CDL is mutually exclusive with NCQ priority (see ncq_prio_enable and sas_ncq_prio_enable in Documentation/ABI/testing/sysfs-block-device), CDL has to be explicitly enabled using: echo 1 > /sys/block/$bdev/device/cdl_enable Since the ioprio hints are supplied through the existing I/O priority API, it should be simple for an application to make use of the ioprio hints. It simply has to reuse one of the new macros defined in include/uapi/linux/ioprio.h: IOPRIO_PRIO_HINT() or IOPRIO_PRIO_VALUE_HINT(), and supply one of the new hints defined in include/uapi/linux/ioprio.h: IOPRIO_HINT_DEV_DURATION_LIMIT_[1-7], which indicates that the I/O should use the corresponding CDL DLD index 1-7. By reusing the I/O priority API, the user can both define a DLD to use per AIO (io_uring sqe->ioprio or libaio iocb->aio_reqprio) or per-thread (ioprio_set()). ======= Testing ======= With the following fio patches: https://github.com/floatious/fio/commits/cdl fio adds support for ioprio hints, such that CDL can be tested using e.g.: fio --ioengine=io_uring --cmdprio_percentage=10 --cmdprio_hint=DLD_index A simple way to test is to use a DLD with a very short duration limit, and send large reads. Regardless of the CDL policy, in case of a CDL timeout, the I/O will result in a -ETIME error to user-space. We also provide a CDL test suite located in the cdl-tools repo, see: https://github.com/westerndigitalcorporation/cdl-tools#testing-a-system-command-duration-limits-support We have tested this patch series using: -real hardware -the following QEMU implementation: https://github.com/floatious/qemu/tree/cdl (NOTE: the QEMU implementation requires you to define the CDL policy at compile time, so you currently need to recompile QEMU when switching between policies.) =================== Further information =================== For further information about CDL, see Damien's slides: Presented at SDC 2021: https://www.snia.org/sites/default/files/SDC/2021/pdfs/SNIA-SDC21-LeMoal-Be-On-Time-command-duration-limits-Feature-Support-in%20Linux.pdf Presented at Lund Linux Con 2022: https://drive.google.com/file/d/1I6ChFc0h4JY9qZdO1bY5oCAdYCSZVqWw/view?usp=sharing ================ Changes since V6 ================ -Rebased series on v6.4-rc1. -Picked up Reviewed-by tags from Hannes (Thank you Hannes!) -Picked up Reviewed-by tag from Christoph (Thank you Christoph!) -Changed KernelVersion from 6.4 to 6.5 for new sysfs attributes. For older change logs, see previous patch series versions: https://lore.kernel.org/linux-scsi/20230406113252.41211-1-nks@flawful.org/ https://lore.kernel.org/linux-scsi/20230404182428.715140-1-nks@flawful.org/ https://lore.kernel.org/linux-scsi/20230309215516.3800571-1-niklas.cassel@wdc.com/ https://lore.kernel.org/linux-scsi/20230124190308.127318-1-niklas.cassel@wdc.com/ https://lore.kernel.org/linux-scsi/20230112140412.667308-1-niklas.cassel@wdc.com/ https://lore.kernel.org/linux-scsi/20221208105947.2399894-1-niklas.cassel@wdc.com/ Link: https://lore.kernel.org/r/20230511011356.227789-1-nks@flawful.org Signed-off-by: Martin K. Petersen commit 18bd7718b5c489b3161b6c2ab4685d57c1e2da3b Author: Niklas Cassel Date: Thu May 11 03:13:52 2023 +0200 scsi: ata: libata: Handle completion of CDL commands using policy 0xD A CDL timeout for policy 0xF is defined as a NCQ error, just with a CDL specific sk/asc/ascq in the sense data. Therefore, the existing code in libata does not need to be modified to handle a policy 0xF CDL timeout. For Command Duration Limits policy 0xD: The device shall complete the command without error with the additional sense code set to DATA CURRENTLY UNAVAILABLE. Since a CDL timeout for policy 0xD is not an error, we cannot use the NCQ Command Error log (10h). Instead, we need to read the Sense Data for Successful NCQ Commands log (0Fh). In the success case, just like in the error case, we cannot simply read a log page from the interrupt handler itself, since reading a log page involves sending a READ LOG DMA EXT or READ LOG EXT command. Therefore, we add a new EH action ATA_EH_GET_SUCCESS_SENSE. When a command completes without error, and when the ATA_SENSE bit is set, this new action is set as pending, and EH is scheduled. This way, similar to the NCQ error case, the log page will be read from EH context. An alternative would have been to add a new kthread or workqueue to handle this. However, extending EH can be done with minimal changes and avoids the need to synchronize a new kthread/workqueue with EH. Co-developed-by: Damien Le Moal Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-20-nks@flawful.org Signed-off-by: Martin K. Petersen commit eafe804bda7ba01da562c43351068b8a76a579af Author: Damien Le Moal Date: Thu May 11 03:13:51 2023 +0200 scsi: ata: libata: Set read/write commands CDL index For devices supporting the command duration limits feature, translate the dld field of read and write operation to set the command duration limit index field of the command task file when the duration limit feature is enabled. The function ata_set_tf_cdl() is introduced to do this. For unqueued (non NCQ) read and write operations, this function sets the command duration limit index set as the lower 3 bits of the feature field. For queued NCQ read/write commands, the index is set as the lower 3 bits of the auxiliary field. The flag ATA_QCFLAG_HAS_CDL is introduced to indicate that a command taskfile has a non zero cdl field. Signed-off-by: Damien Le Moal Reviewed-by: Igor Pylypiv Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-19-nks@flawful.org Signed-off-by: Martin K. Petersen commit df60f9c64576d6d05b59ec5c34addcd61ef1efb0 Author: Damien Le Moal Date: Thu May 11 03:13:50 2023 +0200 scsi: ata: libata: Add ATA feature control sub-page translation Add support for the ATA feature control sub-page of the control mode page to enable/disable the command duration limits feature using the cdl_ctrl field of the ATA feature control sub-page. Both mode sense and mode select translation are supported. For mode sense, the ata device flag ATA_DFLAG_CDL_ENABLED is used to cache the status of the command duration limits feature. Enabling this feature is done using a SET FEATURES command with a cdl action set to 1 when the page cdl_ctrl field value is 0x2 (T2A and T2B pages supported). If this field is 0, CDL is disabled using the SET FEATURES command with a cdl action set to 0. Since a device CDL and NCQ priority features should not be used simultaneously, ata_mselect_control_ata_feature() returns an error when attempting to enable CDL with the device priority feature enabled. Conversely, the function ata_ncq_prio_enable_store() used to enable the use of the device NCQ priority feature through sysfs is modified to return an error if the device CDL feature is enabled. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-18-nks@flawful.org Signed-off-by: Martin K. Petersen commit 673b2fe6ff1da29d9e70bd484903964772dcae3d Author: Damien Le Moal Date: Thu May 11 03:13:49 2023 +0200 scsi: ata: libata-scsi: Add support for CDL pages mode sense Modify ata_scsiop_mode_sense() and ata_msense_control() to support mode sense access to the T2A and T2B sub-pages of the control mode page. ata_msense_control() is modified to support sub-pages. The T2A sub-page is generated using the read descriptors of the command duration limits log page 18h. The T2B sub-page is generated using the write descriptors of the same log page. With the addition of these sub-pages, getting all sub-pages of the control mode page is also supported by increasing the value of ATA_SCSI_RBUF_SIZE from 576B up to 2048B to ensure that all sub-pages fit in the fill buffer. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-17-nks@flawful.org Signed-off-by: Martin K. Petersen commit 0de558015286374443cb1920d32bbf54bd045eb7 Author: Damien Le Moal Date: Thu May 11 03:13:48 2023 +0200 scsi: ata: libata-scsi: Handle CDL bits in ata_scsiop_maint_in() For a scsi MAINTENANCE_IN/MI_REPORT_SUPPORTED_OPERATION_CODES operation, add the translation of the rwcdlp and cdlp bits for the READ 16 and WRITE 16 commands. If the ATA device does not support command duration limits, these bits are always 0. If the ATA device supports command duration limits, the rwcdlp bit is set to 1 for READ 16 and WRITE 16 and the cdlp bits are set to 0x1 for READ 16 and 0x2 for WRITE 16. These correspond to the T2A mode page containing the read descriptors and to the T2B mode page containing the write descriptors, as defined in SAT-5. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-16-nks@flawful.org Signed-off-by: Martin K. Petersen commit 62e4a60e0cdb540b314061469e025fd834ff300c Author: Damien Le Moal Date: Thu May 11 03:13:47 2023 +0200 scsi: ata: libata: Detect support for command duration limits Use the supported capabilities identify device data log page to detect if a device supports the command duration limits feature. For devices supporting this feature, set the device flag ATA_DFLAG_CDL. To support SCSI-ATA translation, retrieve the command duration limits log page 18h and cache this page content using the cdl array added to the ata_device data structure. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-15-nks@flawful.org Signed-off-by: Martin K. Petersen commit 24aeebbf8ea94b5c0cde06350b06e79f5beb28ae Author: Niklas Cassel Date: Thu May 11 03:13:46 2023 +0200 scsi: ata: libata: Change ata_eh_request_sense() to not set CHECK_CONDITION Currently, ata_eh_request_sense() unconditionally sets the scsicmd->result to SAM_STAT_CHECK_CONDITION. For Command Duration Limits policy 0xD: The device shall complete the command without error (SAM_STAT_GOOD) with the additional sense code set to DATA CURRENTLY UNAVAILABLE. It is perfectly fine to have sense data for a command that returned completion without error. In order to support for CDL policy 0xD, we have to remove this assumption that having sense data means that the command failed (SAM_STAT_CHECK_CONDITION). Change ata_eh_request_sense() to not set SAM_STAT_CHECK_CONDITION, and instead move the setting of SAM_STAT_CHECK_CONDITION to the single caller that wants SAM_STAT_CHECK_CONDITION set, that way ata_eh_request_sense() can be reused in a follow-up patch that adds support for CDL policy 0xD. The only caller of ata_eh_request_sense() is protected by: if (!(qc->flags & ATA_QCFLAG_SENSE_VALID)), so we can remove this duplicated check from ata_eh_request_sense() itself. Additionally, ata_eh_request_sense() is only called from ata_eh_analyze_tf(), which is only called when iteratating the QCs using ata_qc_for_each_raw(), which does not include the internal tag, so cmd can never be NULL (all non-internal commands have qc->scsicmd set), so remove the !cmd check as well. Reviewed-by: Hannes Reinecke Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-14-nks@flawful.org Signed-off-by: Martin K. Petersen commit 91a8967ca7f4b8eabe021b1ba974a992cfca2a07 Author: Niklas Cassel Date: Thu May 11 03:13:45 2023 +0200 scsi: ata: libata-scsi: Remove unnecessary !cmd checks There is no need to check if !cmd as this can only happen for ATA internal commands which uses the ATA internal tag (32). Most users of ata_scsi_set_sense() are from _xlat functions that translate a scsicmd to an ATA command. These obviously have a qc->scsicmd. ata_scsi_qc_complete() can also call ata_scsi_set_sense() via ata_gen_passthru_sense() / ata_gen_ata_sense(), called via ata_scsi_qc_complete(). This callback is only called for translated commands, so it also has a qc->scsicmd. ata_eh_analyze_ncq_error(): the NCQ error log can only contain a 0-31 value, so it will never be able to get the ATA internal tag (32). ata_eh_request_sense(): only called by ata_eh_analyze_tf(), which is only called when iteratating the QCs using ata_qc_for_each_raw(), which does not include the internal tag. Since there is no existing call site where cmd can be NULL, remove the !cmd check from ata_scsi_set_sense() and ata_scsi_set_sense_information(). Suggested-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-13-nks@flawful.org Signed-off-by: Martin K. Petersen commit 390e2d1a587405a522dc6b433d45648f895a352c Author: Niklas Cassel Date: Thu May 11 03:13:44 2023 +0200 scsi: sd: Handle read/write CDL timeout failures Commands using a duration limit descriptor that has limit policies set to a value other than 0x0 may be failed by the device if one of the limits are exceeded. For such commands, since the failure is the result of the user duration limit configuration and workload, the commands should not be retried and terminated immediately. Furthermore, to allow the user to differentiate these "soft" failures from hard errors due to hardware problem, a different error code than EIO should be returned. There are 2 cases to consider: (1) The failure is due to a limit policy failing the command with a check condition sense key, that is, any limit policy other than 0xD. For this case, scsi_check_sense() is modified to detect failures with the ABORTED COMMAND sense key and the COMMAND TIMEOUT BEFORE PROCESSING or COMMAND TIMEOUT DURING PROCESSING or COMMAND TIMEOUT DURING PROCESSING DUE TO ERROR RECOVERY additional sense code. For these failures, a SUCCESS disposition is returned so that scsi_finish_command() is called to terminate the command. (2) The failure is due to a limit policy set to 0xD, which result in the command being terminated with a GOOD status, COMPLETED sense key, and DATA CURRENTLY UNAVAILABLE additional sense code. To handle this case, the scsi_check_sense() is modified to return a SUCCESS disposition so that scsi_finish_command() is called to terminate the command. In addition, scsi_decide_disposition() has to be modified to see if a command being terminated with GOOD status has sense data. This is as defined in SCSI Primary Commands - 6 (SPC-6), so all according to spec, even if GOOD status commands were not checked before. If scsi_check_sense() detects sense data representing a duration limit, scsi_check_sense() will set the newly introduced SCSI ML byte SCSIML_STAT_DL_TIMEOUT. This SCSI ML byte is checked in scsi_noretry_cmd(), so that a command that failed because of a CDL timeout cannot be retried. The SCSI ML byte is also checked in scsi_result_to_blk_status() to complete the command request with the BLK_STS_DURATION_LIMIT status, which result in the user seeing ETIME errors for the failed commands. Co-developed-by: Damien Le Moal Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-12-nks@flawful.org Signed-off-by: Martin K. Petersen commit e59e80cfef60366ce4dda96e9322a0b5947158a6 Author: Damien Le Moal Date: Thu May 11 03:13:43 2023 +0200 scsi: sd: Set read/write command CDL index Introduce the command duration limits helper function sd_cdl_dld() to set the DLD bits of READ/WRITE 16 and READ/WRITE 32 commands to indicate to the device the command duration limit descriptor to apply to the commands. When command duration limits are enabled, sd_cdl_dld() obtains the index of the descriptor to apply to the command using the hints field of the request IO priority value (hints IOPRIO_HINT_DEV_DURATION_LIMIT_1 to IOPRIO_HINT_DEV_DURATION_LIMIT_7). If command duration limits is disabled (which is the default), the limit index "0" is always used to indicate "no limit" for a command. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-11-nks@flawful.org Signed-off-by: Martin K. Petersen commit 1b22cfb14142aba7742d307c4f8d7006f919308c Author: Damien Le Moal Date: Thu May 11 03:13:42 2023 +0200 scsi: core: Allow enabling and disabling command duration limits Add the sysfs scsi_device attribute cdl_enable to allow a user to enable or disable a device command duration limits feature. CDL is disabled by default. This feature must be explicitly enabled by a user by setting the cdl_enable attribute to 1. The new function scsi_cdl_enable() does not do anything beside setting the cdl_enable field of struct scsi_device in the case of a (real) SCSI device (e.g. a SAS HDD). For ATA devices, the command duration limits feature needs to be enabled/disabled using the ATA feature sub-page of the control mode page. To do so, the scsi_cdl_enable() function checks if this mode page is supported using scsi_mode_sense(). If it is, scsi_mode_select() is used to enable and disable CDL. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-10-nks@flawful.org Signed-off-by: Martin K. Petersen commit 624885209f31eb9985bf51abe204ecbffe2fdeea Author: Damien Le Moal Date: Thu May 11 03:13:41 2023 +0200 scsi: core: Detect support for command duration limits Introduce the function scsi_cdl_check() to detect if a device supports command duration limits (CDL). Support for the READ 16, WRITE 16, READ 32 and WRITE 32 commands are checked using the function scsi_report_opcode() to probe the rwcdlp and cdlp bits as they indicate the mode page defining the command duration limits descriptors that apply to the command being tested. If any of these commands support CDL, the field cdl_supported of struct scsi_device is set to 1 to indicate that the device supports CDL. Support for CDL for a device is advertizes through sysfs using the new cdl_supported device attribute. This attribute value is 1 for a device supporting CDL and 0 otherwise. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-9-nks@flawful.org Signed-off-by: Martin K. Petersen commit 152e52fb6ff180e97d64585e87fea44c49b8bda8 Author: Damien Le Moal Date: Thu May 11 03:13:40 2023 +0200 scsi: core: Support Service Action in scsi_report_opcode() The REPORT_SUPPORTED_OPERATION_CODES command allows checking for support of commands that have the same opcode but different service actions, such as READ 32 and WRITE 32. However, the current implementation of scsi_report_opcode() only allows checking an operation code without a service action differentiation. Add the "sa" argument to scsi_report_opcode() to allow passing a service action. If a non-zero service action is specified, the reporting options field value is set to 3 to have the service action field taken into account by the device. If no service action field is specified (zero), the reporting options field is set to 1 as before. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-8-nks@flawful.org Signed-off-by: Martin K. Petersen commit a6cdc35fab0d813d54744abe2af07d6c49c07d6e Author: Damien Le Moal Date: Thu May 11 03:13:39 2023 +0200 scsi: core: Support retrieving sub-pages of mode pages Allow scsi_mode_sense() to retrieve sub-pages of mode pages by adding the subpage argument. Change all the current caller sites to specify the subpage 0. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-7-nks@flawful.org Signed-off-by: Martin K. Petersen commit 734326937b65cec7ffd00bfbbce0f791ac4aac84 Author: Niklas Cassel Date: Thu May 11 03:13:38 2023 +0200 scsi: core: Rename and move get_scsi_ml_byte() SCSI has two different getters: - get_XXX_byte() (in scsi_cmnd.h) which takes a struct scsi_cmnd *, and - XXX_byte() (in scsi.h) which takes a scmd->result. The proper name for get_scsi_ml_byte() should thus be without the get_ prefix, as it takes a scmd->result. Rename the function to rectify this. (This change was suggested by Mike Christie.) Additionally, move get_scsi_ml_byte() to scsi_priv.h since both scsi_lib.c and scsi_error.c will need to use this helper in a follow-up patch. Cc: Mike Christie Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-6-nks@flawful.org Signed-off-by: Martin K. Petersen commit 3d848ca1ebc8d8864f25bd461914c93eff82a2d2 Author: Niklas Cassel Date: Thu May 11 03:13:37 2023 +0200 scsi: core: Allow libata to complete successful commands via EH In SCSI, we get the sense data as part of the completion, for ATA however, we need to fetch the sense data as an extra step. For an aborted ATA command the sense data is fetched via libata's ->eh_strategy_handler(). For Command Duration Limits policy 0xD: The device shall complete the command without error with the additional sense code set to DATA CURRENTLY UNAVAILABLE. In order to handle this policy in libata, we intend to send a successful command via SCSI EH, and let libata's ->eh_strategy_handler() fetch the sense data for the good command. This is similar to how we handle an aborted ATA command, just that we need to read the Successful NCQ Commands log instead of the NCQ Command Error log. When we get a SATA completion with successful commands, ATA_SENSE will be set, indicating that some commands in the completion have sense data. The sense_valid bitmask in the Sense Data for Successful NCQ Commands log will inform exactly which commands that had sense data, which might be a subset of all the commands that was completed in the same completion. (Yet all will have ATA_SENSE set, since the status is per completion.) The successful commands that have e.g. a "DATA CURRENTLY UNAVAILABLE" sense data will have a SCSI ML byte set, so scsi_eh_flush_done_q() will not set the scmd->result to DID_TIME_OUT for these commands. However, the successful commands that did not have sense data, must not get their result marked as DID_TIME_OUT by SCSI EH. Add a new flag SCMD_FORCE_EH_SUCCESS, which tells SCSI EH to not mark a command as DID_TIME_OUT, even if it has scmd->result == SAM_STAT_GOOD. This will be used by libata in a subsequent commit. Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-5-nks@flawful.org Signed-off-by: Martin K. Petersen commit dffc480d2df1772d6092f46f2b4c5e0de941bd47 Author: Damien Le Moal Date: Thu May 11 03:13:36 2023 +0200 scsi: block: Introduce BLK_STS_DURATION_LIMIT Introduce the new block I/O status BLK_STS_DURATION_LIMIT for LLDDs to report command that failed due to a command duration limit being exceeded. This new status is mapped to the ETIME error code to allow users to differentiate "soft" duration limit failures from other more serious hardware related errors. If we compare BLK_STS_DURATION_LIMIT with BLK_STS_TIMEOUT: -BLK_STS_DURATION_LIMIT means that the drive gave a reply indicating that the command duration limit was exceeded before the command could be completed. This I/O status is mapped to ETIME for user space. -BLK_STS_TIMEOUT means that the drive never gave a reply at all. This I/O status is mapped to ETIMEDOUT for user space. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-4-nks@flawful.org Signed-off-by: Martin K. Petersen commit 6c913257226a25879bfd6226e0ee265e98904ce6 Author: Damien Le Moal Date: Thu May 11 03:13:35 2023 +0200 scsi: block: Introduce ioprio hints I/O priorities currently only use 6-bits of the 16-bits ioprio value: the 3-upper bits are used to define up to 8 priority classes (4 of which are valid) and the 3 lower bits of the value are used to define a priority level for the real-time and best-effort class. The remaining 10-bits between the I/O priority class and level are unused, and in fact, cannot be used by the user as doing so would either result in the value being completely ignored, or in an error returned by ioprio_check_cap(). Use these 10-bits of an ioprio value to allow a user to specify I/O hints. An I/O hint is defined as a 10-bitsvalue, allowing up to 1023 different hints to be specified, with the value 0 being reserved as the "no hint" case. An I/O hint can apply to any I/O that specifies a valid priority class other than NONE, regardless of the I/O priority level specified. To do so, the macros IOPRIO_PRIO_HINT() and IOPRIO_PRIO_VALUE_HINT() are introduced in include/uapi/linux/ioprio.h to respectively allow a user to get and set a hint in an ioprio value. To support the ATA and SCSI command duration limits feature, 7 hints are defined: IOPRIO_HINT_DEV_DURATION_LIMIT_1 to IOPRIO_HINT_DEV_DURATION_LIMIT_7, allowing a user to specify which command duration limit descriptor should be applied to the commands serving an I/O. Specifying these hints has for now no effect whatsoever if the target block devices do not support the command duration limits feature. However, in the future, block I/O schedulers can be modified to optimize I/O issuing order based on these hints, even for devices that do not support the command duration limits feature. Given that the 7 duration limits hints defined have no effect on any block layer component, the actual definition of the duration limits implied by these hints remains at the device level. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-3-nks@flawful.org Signed-off-by: Martin K. Petersen commit eca2040972b411ec27483bf75dc8b84e730e88ff Author: Damien Le Moal Date: Thu May 11 03:13:34 2023 +0200 scsi: block: ioprio: Clean up interface definition The I/O priority user interface defines the 16-bits ioprio values as the combination of the upper 3-bits for an I/O priority class and the lower 13-bits as priority data. However, the kernel only uses the lower 3-bits of the priority data to define priority levels for the RT and BE priority classes. The data part of an ioprio value is completely ignored for the IDLE and NONE classes. This is enforced by checks done in ioprio_check_cap(), which is called for all paths that allow defining an I/O priority for I/Os: the per-context ioprio_set() system call, aio interface and io_uring interface. Clarify this fact in the uapi ioprio.h header file and introduce the IOPRIO_PRIO_LEVEL_MASK and IOPRIO_PRIO_LEVEL() macros for users to define and get priority levels in an ioprio value. The coarser macro IOPRIO_PRIO_DATA() is retained for backward compatibility with old applications already using it. There is no functional change introduced with this. In-kernel users of the IOPRIO_PRIO_DATA() macro which are explicitly handling I/O priority data as a priority level are modified to use the new IOPRIO_PRIO_LEVEL() macro without any functional change. Since f2fs is the only user of this macro not explicitly using that value as a priority level, it is left unchanged. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20230511011356.227789-2-nks@flawful.org Signed-off-by: Martin K. Petersen commit 7907ad748bdba8ac9ca47f0a650cc2e5d2ad6e24 Merge: 16853cd8f6d44 394f811848827 Author: Martin K. Petersen Date: Mon May 22 16:35:02 2023 -0400 Merge patch series "Use block pr_ops in LIO" Mike Christie says: The patches in this thread allow us to use the block pr_ops with LIO's target_core_iblock module to support cluster applications in VMs. They were built over Linus's tree. They also apply over linux-next and Martin's tree and Jens's trees. Currently, to use windows clustering or linux clustering (pacemaker + cluster labs scsi fence agents) in VMs with LIO and vhost-scsi, you have to use tcmu or pscsi or use a cluster aware FS/framework for the LIO pr file. Setting up a cluster FS/framework is pain and waste when your real backend device is already a distributed device, and pscsi and tcmu are nice for specific use cases, but iblock gives you the best performance and allows you to use stacked devices like dm-multipath. So these patches allow iblock to work like pscsi/tcmu where they can pass a PR command to the backend module. And then iblock will use the pr_ops to pass the PR command to the real devices similar to what we do for unmap today. The patches are separated in the following groups: Patch 1 - 2: - Add block layer callouts for reading reservations and rename reservation error code. Patch 3 - 5: - SCSI support for new callouts. Patch 6: - DM support for new callouts. Patch 7 - 13: - NVMe support for new callouts. Patch 14 - 18: - LIO support for new callouts. This patchset has been tested with the libiscsi PGR ops and with window's failover cluster verification test. Note that for scsi backend devices we need this patchset: https://lore.kernel.org/linux-scsi/20230123221046.125483-1-michael.christie@oracle.com/T/#m4834a643ffb5bac2529d65d40906d3cfbdd9b1b7 to handle UAs. To reduce the size of this patchset that's being done separately to make reviewing easier. And to make merging easier this patchset and the one above do not have any conflicts so can be merged in different trees. Link: https://lore.kernel.org/r/20230407200551.12660-1-michael.christie@oracle.com Signed-off-by: Martin K. Petersen commit 883f8fe87686d1deef2614b1d3a23ca7e5193dff Author: Azeem Shaikh Date: Wed May 10 21:11:46 2023 +0000 vboxsf: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Hans de Goede Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230510211146.3486600-1-azeemshaikh38@gmail.com commit 8ca25e00cf817b635f4e80d59b6d07686d74eff0 Author: Azeem Shaikh Date: Fri May 12 15:57:49 2023 +0000 NFS: Prefer strscpy over strlcpy calls strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. Check for strscpy()'s return value of -E2BIG on truncate for safe replacement with strlcpy(). This is part of a tree-wide cleanup to remove the strlcpy() function entirely from the kernel [2]. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230512155749.1356958-1-azeemshaikh38@gmail.com commit 59e45c758ca1b9893ac923dd63536da946ac333b Author: Alexander Aring Date: Fri May 19 11:21:26 2023 -0400 fs: dlm: interrupt posix locks only when process is killed If a posix lock request is waiting for a result from user space (dlm_controld), do not let it be interrupted unless the process is killed. This reverts commit a6b1533e9a57 ("dlm: make posix locks interruptible"). The problem with the interruptible change is that all locks were cleared on any signal interrupt. If a signal was received that did not terminate the process, the process could continue running after all its dlm posix locks had been cleared. A future patch will add cancelation to allow proper interruption. Cc: stable@vger.kernel.org Fixes: a6b1533e9a57 ("dlm: make posix locks interruptible") Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 30ad0627f169f56180e668e7223eaa43aa190a75 Author: Azeem Shaikh Date: Wed May 10 22:12:37 2023 +0000 dlm: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230510221237.3509484-1-azeemshaikh38@gmail.com commit df8fc4e934c12b906d08050d7779f292b9c5c6b5 Author: Kees Cook Date: Wed May 17 16:18:11 2023 -0700 kbuild: Enable -fstrict-flex-arrays=3 The -fstrict-flex-arrays=3 option is now available with the release of GCC 13[1] and Clang 16[2]. This feature instructs the compiler to treat only C99 flexible arrays as dynamically sized for the purposes of object size calculations. In other words, the ancient practice of using 1-element arrays, or the GNU extension of using 0-sized arrays, as a dynamically sized array is disabled. This allows CONFIG_UBSAN_BOUNDS, CONFIG_FORTIFY_SOURCE, and other object-size aware features to behave unambiguously in the face of trailing arrays: only C99 flexible arrays are considered to be dynamically sized. For yet more detail, see: https://people.kernel.org/kees/bounded-flexible-arrays-in-c Enabling this will help track down any outstanding cases of fake flexible arrays that need attention in kernel code. [1] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-fstrict-flex-arrays [2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fstrict-flex-arrays Cc: Masahiro Yamada Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Nicolas Schier Cc: linux-kbuild@vger.kernel.org Co-developed-by: "Gustavo A. R. Silva" Signed-off-by: "Gustavo A. R. Silva" Signed-off-by: Kees Cook commit c33080cdc0cab7e72c5e4841cb7533d18a3130dc Author: Azeem Shaikh Date: Wed May 17 14:49:10 2023 +0000 cgroup: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Signed-off-by: Tejun Heo commit c847f4e203046a2c93d8a1cf0348315c0b655a60 Author: Alexander Aring Date: Fri May 19 11:21:25 2023 -0400 fs: dlm: fix cleanup pending ops when interrupted Immediately clean up a posix lock request if it is interrupted while waiting for a result from user space (dlm_controld.) This largely reverts the recent commit b92a4e3f86b1 ("fs: dlm: change posix lock sigint handling"). That previous commit attempted to defer lock cleanup to the point in time when a result from user space arrived. The deferred approach was not reliable because some dlm plock ops may not receive replies. Cc: stable@vger.kernel.org Fixes: b92a4e3f86b1 ("fs: dlm: change posix lock sigint handling") Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 68d12418261090b4f5b8d1b2067d15062e858e01 Author: Anup Sharma Date: Fri May 19 13:11:24 2023 +0530 perf test: Add test validating JSON generated by 'perf data convert --to-json' This commit adds support for testing the JSON output generated by the 'perf data' command's conversion to JSON functionality. The test script now includes a step to ensure that the resulting JSON file contains valid data. Changes: V1 -> V2: Added a check for the existence of the result output file. Replaced the usage of jq with json.load for validating the JSON format. Checks using ShellCheck and checkpatch, addressing and resolving warnings. Removed the unnecessary root permission check. Modified the 'perf record' command to avoid requiring root permissions. Committer testing: $ perf test to-json 115: 'perf data convert --to-json' command test : Ok $ perf test -v to-json Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc 115: 'perf data convert --to-json' command test : --- start --- test child forked, pid 1746867 Testing Perf Data Convertion Command to JSON Perf Data Converter Command to JSON [SUCCESS] Validating Perf Data Converted JSON file The file contains valid JSON format [SUCCESS] test child finished with 0 ---- end ---- 'perf data convert --to-json' command test: Ok $ Signed-off-by: Anup Sharma Acked-by: Ian Rogers Link: https://lore.kernel.org/r/ZGcoJBAGlknjsA/n@yoga Tested-by: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Anup Sharma Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org [ Fixup indentation to use consistently tabs, not a mixture of spaces and tabs, have 'if ... ; then' on the same line ] Signed-off-by: Arnaldo Carvalho de Melo commit 92655fbda5c05950a411eaabc19e025e86e2a291 Author: Alexander Aring Date: Fri May 19 11:21:24 2023 -0400 fs: dlm: return positive pid value for F_GETLK The GETLK pid values have all been negated since commit 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks"). Revert this for local pids, and leave in place negative pids for remote owners. Cc: stable@vger.kernel.org Fixes: 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks") Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit a495108ea99c64ce6b5727cb163162ba28e27bff Author: Gaosheng Cui Date: Thu May 11 09:27:15 2023 +0800 capability: fix kernel-doc warnings in capability.c Fix all kernel-doc warnings in capability.c: kernel/capability.c:477: warning: Function parameter or member 'idmap' not described in 'privileged_wrt_inode_uidgid' kernel/capability.c:493: warning: Function parameter or member 'idmap' not described in 'capable_wrt_inode_uidgid' Signed-off-by: Gaosheng Cui Acked-by: Serge Hallyn Signed-off-by: Paul Moore commit 1ad549cf980c0967497572c49f4f99eed7c500b8 Author: Frank Jungclaus Date: Fri May 19 21:55:55 2023 +0200 can: esd_usb: Make use of existing kernel macros Make use of existing kernel macros: - Use the unit suffixes from linux/units.h for the controller clock frequencies - Use the BIT() and the GENMASK() macro to set specific bits in some constants - Use CAN_MAX_DLEN (instead of directly using the value 8) for the maximum CAN payload length Additionally: - Spend some commenting for the previously changed constants - Add the current year to the copyright notice - While adding the header linux/units.h to the list of include files also sort that list alphabetically Suggested-by: Vincent MAILHOL Link: https://lore.kernel.org/all/CAMZ6RqLaDNy-fZ2G0+QMhUEckkXLL+ZyELVSDFmqpd++aBzZQg@mail.gmail.com/ Link: https://lore.kernel.org/all/CAMZ6RqKdg5YBufa0C+ttzJvoG=9yuti-8AmthCi4jBbd08JEtw@mail.gmail.com/ Suggested-by: Marc Kleine-Budde Link: https://lore.kernel.org/all/20230518-grower-film-ea8b5f853f3e-mkl@pengutronix.de/ Signed-off-by: Frank Jungclaus Link: https://lore.kernel.org/r/20230519195600.420644-2-frank.jungclaus@esd.eu [mkl: remove hex constants in comments after BIT()] Signed-off-by: Marc Kleine-Budde commit 7cdda6998ee55140e64894e25048df7157344fc9 Merge: a9650b7f6fc09 4e111f0cf0ee9 Author: Arnaldo Carvalho de Melo Date: Mon May 22 15:22:46 2023 -0300 Merge remote-tracking branch 'acme/perf-tools' into perf-tools-next To pick up fixes that were already merged upstream. Signed-off-by: Arnaldo Carvalho de Melo commit d7588f02e8d8a795702cf06cbbb4303c48b02a61 Author: Marcel Hellwig Date: Mon Apr 17 10:52:04 2023 +0200 can: dev: add transceiver capabilities to xilinx_can Currently the xilinx_can driver does not support adding a phy like the "ti,tcan1043" to its devicetree. This code makes it possible to add such phy, so that the kernel makes sure that the PHY is in operational state, when the link is set to an "up" state. Signed-off-by: Marcel Hellwig Link: https://lore.kernel.org/r/20230417085204.179268-1-git@cookiesoft.de [mkl: call phy_power_off() after pm_runtime_put()] [mkl: remove error message for phy_power_on() failure] [mkl: update kernel-doc for struct xcan_priv] Signed-off-by: Marc Kleine-Budde commit 843b84640349e56ab96812cd68c19ed7021f4606 Author: Carsten Schmidt Date: Tue May 16 14:53:32 2023 +0200 can: kvaser_usb: Add len8_dlc support Add support for the Classical CAN raw DLC functionality to send and receive DLC values from 9 .. 15. v1: https://lore.kernel.org/all/20230506105529.4023-1-carsten.schmidt-achim@t-online.de Signed-off-by: Carsten Schmidt Tested-by: Jimmy Assarsson Signed-off-by: Jimmy Assarsson Link: https://lore.kernel.org/r/20230516125332.82894-1-extja@kvaser.com Signed-off-by: Marc Kleine-Budde commit 906bd0fb137ffc361b3ce0d0db07f288db5582ea Author: Tvrtko Ursulin Date: Fri May 19 08:49:46 2023 -0700 drm/i915/pmu: Export counters from all tiles Start exporting frequency and RC6 counters from all tiles. Existing counters keep their names and config values and new one use the namespace added in the previous patch, with the "-gtN" added to their names. Interrupts counter is an odd one off. Because it is the global device counters (not only GT) we choose not to add per tile versions for now. Signed-off-by: Tvrtko Ursulin Signed-off-by: Aravind Iddamsetty Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20230519154946.3751971-8-umesh.nerlige.ramappa@intel.com commit bc4be0a38b63b6d4d00a58b10e164f56049be2c2 Author: Tvrtko Ursulin Date: Fri May 19 08:49:45 2023 -0700 drm/i915/pmu: Prepare for multi-tile non-engine counters Reserve some bits in the counter config namespace which will carry the tile id and prepare the code to handle this. No per tile counters have been added yet. v2: - Fix checkpatch issues - Use 4 bits for gt id in non-engine counters. Drop FIXME. - Set MAX GTs to 4. Drop FIXME. v3: (Ashutosh, Tvrtko) - Drop BUG_ON that would never fire - Make enable u64 - Pull in some code from next patch v4: Set I915_PMU_MAX_GTS to 2 (Tvrtko) v5: s/u64/u32 where needed (Ashutosh) Signed-off-by: Tvrtko Ursulin Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230519154946.3751971-7-umesh.nerlige.ramappa@intel.com commit b319cc594e666061b22331da654606b92730343a Author: Tvrtko Ursulin Date: Fri May 19 08:49:44 2023 -0700 drm/i915/pmu: Add reference counting to the sampling timer We do not want to have timers per tile and waste CPU cycles and energy via multiple wake-up sources, for a relatively un-important task of PMU sampling, so keeping a single timer works well. But we also do not want the first GT which goes idle to turn off the timer. Add some reference counting, via a mask of unparked GTs, to solve this. v2: Drop the check for unparked in i915_sample (Ashutosh) v3: Revert v2 (Tvrtko) Signed-off-by: Tvrtko Ursulin Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230519154946.3751971-6-umesh.nerlige.ramappa@intel.com commit da5d51672874936c08810e63d6dfc670263d5e15 Author: Tvrtko Ursulin Date: Fri May 19 08:49:43 2023 -0700 drm/i915/pmu: Transform PMU parking code to be GT based Trivial prep work for full multi-tile enablement later. Signed-off-by: Tvrtko Ursulin Signed-off-by: Vinay Belgaumkar Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20230519154946.3751971-5-umesh.nerlige.ramappa@intel.com commit 08322dabb5cbce75e210d8df4774fc078ed7161c Author: Tvrtko Ursulin Date: Fri May 19 08:49:42 2023 -0700 drm/i915/pmu: Skip sampling engines with no enabled counters As we have more and more engines do not waste time sampling the ones no- one is monitoring. Signed-off-by: Tvrtko Ursulin Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20230519154946.3751971-4-umesh.nerlige.ramappa@intel.com commit e367d3c45158ba34bb684227d87c52d8d840fd67 Author: Tvrtko Ursulin Date: Fri May 19 08:49:41 2023 -0700 drm/i915/pmu: Support PMU for all engines Given how the metrics are already exported, we also need to run sampling over engines from all GTs. Problem of GT frequencies is left for later. Signed-off-by: Tvrtko Ursulin Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20230519154946.3751971-3-umesh.nerlige.ramappa@intel.com commit a644fde77ff73ee54970c0fc5a64cf7624c8b5b1 Author: Tvrtko Ursulin Date: Fri May 19 08:49:40 2023 -0700 drm/i915/pmu: Change bitmask of enabled events to u32 Having it as u64 was a confusing (but harmless) mistake. Also add some asserts to make sure the internal field does not overflow in the future. v2: Fix WARN_ON firing for INTERRUPT event (Umesh) Signed-off-by: Tvrtko Ursulin Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230519154946.3751971-2-umesh.nerlige.ramappa@intel.com commit 35d6df53b91632e8b20d3bd23510e68799c47a25 Author: Azeem Shaikh Date: Wed May 10 22:12:37 2023 +0000 dlm: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Signed-off-by: David Teigland commit 304e9c83e80d5cbe20ab64ffa1fac9fc51d30bc9 Author: Amir Goldstein Date: Tue May 2 15:48:15 2023 +0300 exportfs: add explicit flag to request non-decodeable file handles So far, all callers of exportfs_encode_inode_fh(), except for fsnotify's show_mark_fhandle(), check that filesystem can decode file handles, but we would like to add more callers that do not require a file handle that can be decoded. Introduce a flag to explicitly request a file handle that may not to be decoded later and a wrapper exportfs_encode_fid() that sets this flag and convert show_mark_fhandle() to use the new wrapper. This will be used to allow adding fanotify support to filesystems that do not support NFS export. Acked-by: Jeff Layton Acked-by: Chuck Lever Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara Message-Id: <20230502124817.3070545-3-amir73il@gmail.com> commit b52878275ce54b5d3a654ed24dfb169c1c501998 Author: Amir Goldstein Date: Tue May 2 15:48:14 2023 +0300 exportfs: change connectable argument to bit flags Convert the bool connectable arguemnt into a bit flags argument and define the EXPORT_FS_CONNECTABLE flag as a requested property of the file handle. We are going to add a flag for requesting non-decodeable file handles. Acked-by: Jeff Layton Acked-by: Chuck Lever Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara Message-Id: <20230502124817.3070545-2-amir73il@gmail.com> commit a2c2690f0d747c973c6a384ab8cd88faa806e5a5 Author: Christophe JAILLET Date: Sun Apr 16 11:16:36 2023 +0200 mtd: st_spi_fsm: Use the devm_clk_get_enabled() helper function Use the devm_clk_get_enabled() helper function instead of hand-writing it. It saves some line of codes. Signed-off-by: Christophe JAILLET Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/4025ec3980a956b0e776024e88ec960afc457501.1681636580.git.christophe.jaillet@wanadoo.fr commit 32261d10943b7fffa864f9a532e2b40a813df79b Author: Florian Fainelli Date: Tue May 9 12:10:48 2023 -0700 iommu: Suppress empty whitespaces in prints If IOMMU_CMD_LINE_DMA_API or IOMMU_CMD_LINE_STRICT are not set in iommu_cmd_line, we will be emitting a whitespace before the newline. Signed-off-by: Florian Fainelli Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230509191049.1752259-1-f.fainelli@gmail.com Signed-off-by: Joerg Roedel commit a4fdd976227240b06ced89b5df88a1a1f388f092 Author: Robin Murphy Date: Thu May 4 22:10:56 2023 +0100 iommu: Use flush queue capability It remains really handy to have distinct DMA domain types within core code for the sake of default domain policy selection, but we can now hide that detail from drivers by using the new capability instead. Signed-off-by: Robin Murphy Tested-by: Jerry Snitselaar # amd, intel, smmu-v3 Reviewed-by: Jerry Snitselaar Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/1c552d99e8ba452bdac48209fa74c0bdd52fd9d9.1683233867.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 4a20ce0ff68eb6fc4b1e8f25139c93b312f21229 Author: Robin Murphy Date: Thu May 4 22:10:55 2023 +0100 iommu: Add a capability for flush queue support Passing a special type to domain_alloc to indirectly query whether flush queues are a worthwhile optimisation with the given driver is a bit clunky, and looking increasingly anachronistic. Let's put that into an explicit capability instead. Signed-off-by: Robin Murphy Reviewed-by: Lu Baolu Tested-by: Jerry Snitselaar # amd, intel, smmu-v3 Reviewed-by: Jerry Snitselaar Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/f0086a93dbccb92622e1ace775846d81c1c4b174.1683233867.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 63def6c17134141a17997e06d914d1b573ddceaf Merge: 97e6d8cb57c1a f9d1fe7e81b87 Author: Mark Brown Date: Mon May 22 16:32:40 2023 +0100 ASoC: topology: Clean up error messages handling Merge series from Amadeusz Sławiński : Series of patches cleaning up error messages when loading topology. In few places instead of logging in place of failure message is logged in caller. Additionally there are places where both caller and failing function log error, leading to unnecessary logs. Clean all of the above up. commit 75a616168b7810c30aa26819153c64df43bc9d9e Author: Carlos Bilbao Date: Thu Apr 20 17:30:06 2023 +0000 iommu/amd: Update copyright notice The most recent changes to AMD'S IOMMU, such as level 5 guest page table support date to the year 2023. Update copyright statement accordingly. Signed-off-by: Carlos Bilbao Link: https://lore.kernel.org/r/20230420173006.3100682-1-carlos.bilbao@amd.com Signed-off-by: Joerg Roedel commit 354440a7618746096cca4a2254594c00c86dc597 Author: Jerry Snitselaar Date: Thu Apr 20 01:07:18 2023 -0700 iommu/amd: Use page mode macros in fetch_pte() Use the page mode macros instead of magic numbers in fetch_pte. Cc: Robin Murphy Cc: Will Deacon Cc: Suravee Suthikulpanit Cc: Joerg Roedel Signed-off-by: Jerry Snitselaar Reviewed-by: Vasant Hegde Link: https://lore.kernel.org/r/20230420080718.523132-1-jsnitsel@redhat.com Signed-off-by: Joerg Roedel commit 5d62bacc059bb4f783e1d2ad88874abb6056f404 Author: Zhen Lei Date: Fri Apr 21 15:24:21 2023 +0800 iommu/iova: Optimize iova_magazine_alloc() Only the member 'size' needs to be initialized to 0. Clearing the array pfns[], which is about 1 KiB in size, not only wastes time, but also causes cache pollution. Acked-by: Robin Murphy Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20230421072422.869-1-thunder.leizhen@huawei.com Signed-off-by: Joerg Roedel commit 97e6d8cb57c1ac529233fb831eb2b80d516b3bc5 Merge: 17cf9faeba463 d8a2c98793495 Author: Mark Brown Date: Mon May 22 15:48:54 2023 +0100 ASoC: SOF: ipc4: Querry CPC value from firmware's Merge series from Peter Ujfalusi : The MOD_INIT_INSTANCE message contains a CPC (Cycles Per Chunk/processing unit) parameter. This CPC value is used by the firmware to calculate the total cycles needed by the enabled module instances and based on this it can decide to set the frequency of the DSP core(s). The manifest section of the firmware image contains a module configuration section, where a per module table of configurations are listed with measured CPC values as triplet of IBS/IBS/CPC (Input/Output buffer size - corresponding to the selected audio format). In case the CPC value is 0 (missing from the manifest or the configuration cannot be matched) the firmware will force the DSP cores to maximum speed to avoid audio glitches due to starvation. In these cases the kernel will print a warning message to let the SOF developers know about the gap and provide information to correct it with a firmware update. commit 36a52ae64ba85f075998921ae1881c01f29ddf31 Author: Niklas Schnelle Date: Mon May 22 12:50:37 2023 +0200 ALSA: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Acked-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230522105049.1467313-33-schnelle@linux.ibm.com Signed-off-by: Takashi Iwai commit 3dde7aa2fad5df0cf623f73e775f516997a74e89 Author: Michal Simek Date: Tue May 16 15:47:15 2023 +0200 MAINTAINERS: Remove Hyun and Anurag from maintainer list There is no activity from them for these drivers. All of them have Laurent as active maintainer and their emails no longer works that's why remove them from the list. Reviewed-by: Laurent Pinchart Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/18700dda117076510baf87a090acbb29cb3ba3ba.1684244832.git.michal.simek@amd.com commit cf0c4bc9e4e132b1992548ca8db30ec328b45403 Author: Tom Rix Date: Wed May 17 09:31:12 2023 -0400 drm/nouveau/acr/ga102: set variable ga102_gsps storage-class-specifier to static smatch reports drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c:49:1: warning: symbol 'ga102_gsps' was not declared. Should it be static? This variable is only used in its defining file, so it should be static Signed-off-by: Tom Rix Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20230517133112.873856-1-trix@redhat.com commit 79802863a01999bb90c790f8fbc80c5c2f9c8fea Author: Krzysztof Kozlowski Date: Thu May 11 19:54:43 2023 +0200 drm/nouveau: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Reviewed-by: Lyude Paul Signed-off-by: Krzysztof Kozlowski Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20230511175443.281970-1-krzysztof.kozlowski@linaro.org commit 504e72ed3a1b1c0d4450712a42ae6070d3a05a8e Author: Arnd Bergmann Date: Mon Apr 17 23:03:23 2023 +0200 drm/nouveau: dispnv50: fix missing-prototypes warning nv50_display_create() is declared in another header, along with a couple of declarations that are now outdated: drivers/gpu/drm/nouveau/dispnv50/disp.c:2517:1: error: no previous prototype for 'nv50_display_create' Fixes: ba801ef068c1 ("drm/nouveau/kms: display destroy/init/fini hooks can be static") Signed-off-by: Arnd Bergmann Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20230417210329.2469722-1-arnd@kernel.org commit 74629c49e66cc6d36c46ac4e3f059780873ceedf Author: Marek Vasut Date: Sun May 14 08:46:25 2023 -0300 drm: bridge: samsung-dsim: Implement support for clock/data polarity swap Implement support for DSI clock and data lane DN/DP polarity swap by means of decoding 'lane-polarities' DT property. The controller does support DN/DP swap of clock lane and all data lanes, the controller does not support polarity swap of individual data lane bundles, add a check which verifies all data lanes have the same polarity. This has been validated on an imx8mm board that actually has the MIPI DSI clock lanes inverted. Signed-off-by: Marek Vasut Signed-off-by: Fabio Estevam Reviewed-by: Jagan Teki Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230514114625.98372-2-festevam@gmail.com commit ec7743c9c48a14aa884d27f2feee1da30810ce0a Author: Fabio Estevam Date: Sun May 14 08:46:24 2023 -0300 dt-bindings: samsung,mipi-dsim: Add 'lane-polarities' The Samsung DSIM IP block allows the inversion of the clock and data lanes. Add an optional property called 'lane-polarities' that describes the polarities of the MIPI DSI clock and data lanes. This property is useful for properly describing the hardware when the board designer decided to switch the polarities of the MIPI DSI clock and/or data lanes. Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230514114625.98372-1-festevam@gmail.com commit ffe4dfe0baddaf61318bd275cacd64d4dbbbe724 Author: David Keisar Schmidt Date: Sun Apr 16 20:22:55 2023 +0300 mm/slab_common: Replace invocation of weak PRNG The Slab allocator randomization inside slab_common.c uses the prandom_u32 PRNG. That was added to prevent attackers to obtain information on the heap state. However, this PRNG turned out to be weak, as noted in commit c51f8f88d705 To fix it, we have changed the invocation of prandom_u32_state to get_random_u32 to ensure the PRNG is strong. Since a modulo operation is applied right after that, in the Fisher-Yates shuffle, we used get_random_u32_below, to achieve uniformity. Signed-off-by: David Keisar Schmidt Signed-off-by: Vlastimil Babka commit f7e466e951a15bc7cec496f22f6276b854d3c310 Author: David Keisar Schmidt Date: Sun Apr 16 20:22:42 2023 +0300 mm/slab: Replace invocation of weak PRNG The Slab allocator randomization uses the prandom_u32 PRNG. That was added to prevent attackers to obtain information on the heap state, by randomizing the freelists state. However, this PRNG turned out to be weak, as noted in commit c51f8f88d705 To fix it, we have changed the invocation of prandom_u32_state to get_random_u32 to ensure the PRNG is strong. Since a modulo operation is applied right after that, we used get_random_u32_below, to achieve uniformity. In addition, we changed the freelist_init_state union to struct, since the rnd_state inside which is used to store the state of prandom_u32, is not needed anymore, since get_random_u32 maintains its own state. Signed-off-by: David Keisar Schmidt Signed-off-by: Vlastimil Babka commit 8040cbf5e1da2fe86558239b92927a947c79ecd6 Author: Xiongwei Song Date: Thu Apr 13 22:34:52 2023 +0800 slub: Don't read nr_slabs and total_objects directly We have node_nr_slabs() to read nr_slabs, node_nr_objs() to read total_objects in a kmem_cache_node, so no need to access the two members directly. Signed-off-by: Xiongwei Song Signed-off-by: Vlastimil Babka commit 4f174a8bacebf57ffa18be0439b9ed7ee6d00c70 Author: Xiongwei Song Date: Thu Apr 13 22:34:51 2023 +0800 slub: Remove slabs_node() function When traversing nodes one by one, the get_node() function called in for_each_kmem_cache_node macro, no need to call get_node() again in slabs_node(), just reading nr_slabs field should be enough. However, the node_nr_slabs() function can do this. Hence, the slabs_node() function is not needed anymore. Signed-off-by: Xiongwei Song Signed-off-by: Vlastimil Babka commit c6c17c4dc36684fe119a1d40eb41ea65677bdfae Author: Xiongwei Song Date: Thu Apr 13 22:34:50 2023 +0800 slub: Remove CONFIG_SMP defined check As CONFIG_SMP is one of dependencies of CONFIG_SLUB_CPU_PARTIAL, so if CONFIG_SLUB_CPU_PARTIAL is defined then CONFIG_SMP must be defined, no need to check CONFIG_SMP definition here. Signed-off-by: Xiongwei Song Signed-off-by: Vlastimil Babka commit 81bd31793fd3be4fec2818e2267997f56ac18fb2 Author: Xiongwei Song Date: Thu Apr 13 22:34:49 2023 +0800 slub: Put objects_show() into CONFIG_SLUB_DEBUG enabled block The SO_ALL|SO_OBJECTS pair is only used when enabling CONFIG_SLUB_DEBUG option, so the objects_show() definition should be surrounded by CONFIG_SLUB_DEBUG too. Signed-off-by: Xiongwei Song Signed-off-by: Vlastimil Babka commit 35973232b5cddd8b03dac2730cd1ca53137d1cd4 Author: Xiongwei Song Date: Thu Apr 13 22:34:48 2023 +0800 slub: Correct the error code when slab_kset is NULL The -ENOSYS is inproper when kset_create_and_add call returns a NULL pointer, the failure more likely is because lacking memory, hence returning -ENOMEM is better. Signed-off-by: Xiongwei Song Signed-off-by: Vlastimil Babka commit 444f20c29e8b41a5aef5c34e3eab84e8d1cc4511 Author: zhaoxinchao Date: Tue Apr 18 10:05:23 2023 +0800 mm/slab: correct return values in comment for _kmem_cache_create() __kmem_cache_create() returns 0 on success and non-zero on failure. The comment is wrong in two instances, so fix the first one and remove the second one. Also make the comment non-doc, because it doesn't describe an API function, but SLAB-specific implementation. Signed-off-by: zhaoxinchao Signed-off-by: Vlastimil Babka commit 23b76ba20e8737aca29e91af5b47a16b15fb1999 Author: Horatiu Vultur Date: Fri Apr 21 13:37:58 2023 +0200 ARM: dts: lan966x: Add support for SMA connectors The pcb8309 has 2 SMA connectors which are connected to the lan966x chip. The lan966x can generate 1PPS output on one of them and it can receive 1PPS input on the other one. Signed-off-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230421113758.3465678-1-horatiu.vultur@microchip.com commit 3ecb546333089195b6a1508cb58627b0797a26ca Author: Claudiu Beznea Date: Wed May 17 12:41:18 2023 +0300 ARM: dts: at91: use clock-controller name for sckc nodes Use clock-controller generic name for slow clock controller nodes. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230517094119.2894220-5-claudiu.beznea@microchip.com commit f4f15c5cdc289db798ab0bf32fe83a6701946ef9 Author: Claudiu Beznea Date: Wed May 17 12:41:17 2023 +0300 ARM: dts: at91: at91sam9n12: witch sckc to new clock bindings Switch slow clock controller to new clock bindings. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230517094119.2894220-4-claudiu.beznea@microchip.com commit 9a7b010116a430d74dc30a214ea55a58a2863d71 Author: Claudiu Beznea Date: Wed May 17 12:41:19 2023 +0300 dt-bindings: clocks: at91sam9x5-sckc: convert to yaml Convert Atmel slow clock controller documentation to yaml. Signed-off-by: Claudiu Beznea Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230517094119.2894220-6-claudiu.beznea@microchip.com commit fffc869be43df2fc68e8b396c744ea1f954d3589 Author: Claudiu Beznea Date: Wed May 17 12:41:16 2023 +0300 dt-bindings: clocks: atmel,at91rm9200-pmc: convert to yaml Convert Atmel PMC documentation to yaml. Along with it clock names were adapted according to the current available device trees as different controller versions accept different clock (some of them have 3 clocks as input, some has 2 clocks as inputs and some with 2 input clocks uses different clock names). Signed-off-by: Claudiu Beznea Reviewed-by: Conor Dooley Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230517094119.2894220-3-claudiu.beznea@microchip.com commit 937859485aefed1d9df72feb6ea74a84ff5cfa46 Author: Arun R Murthy Date: Tue Sep 6 09:48:06 2022 +0530 drm/i915: Support Async Flip on Linear buffers Starting from Gen12 Async Flip is supported on linear buffers. This patch enables support for async on linear buffer. UseCase: In Hybrid graphics, for hardware unsupported pixel formats it will be converted to linear memory and then composed. v2: Added use case v3: Added FIXME for ICL indicating the restrictions Signed-off-by: Arun R Murthy Reviewed-by: Stanislav Lisovskiy Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20220906041806.4095575-1-arun.r.murthy@intel.com commit 6a4be6984595b164b6f281c5b242dbdf1c06d528 Author: Andrew Cooper Date: Mon May 22 11:57:38 2023 +0100 x86/apic: Fix use of X{,2}APIC_ENABLE in asm with older binutils "x86/smpboot: Support parallel startup of secondary CPUs" adds the first use of X2APIC_ENABLE in assembly, but older binutils don't tolerate the UL suffix. Switch to using BIT() instead. Fixes: 7e75178a0950 ("x86/smpboot: Support parallel startup of secondary CPUs") Reported-by: Jeffrey Hugo Signed-off-by: Andrew Cooper Signed-off-by: Thomas Gleixner Tested-by: Jeffrey Hugo Link: https://lore.kernel.org/r/20230522105738.2378364-1-andrew.cooper3@citrix.com commit 72b44f6577f15f37fe964c8dcc42a7c5736e604c Author: Finn Thain Date: Tue May 16 11:22:05 2023 +1000 nubus: Don't list slot resources by default Some Nubus card ROMs contain many slot resources. A single Radius video card produced well over a thousand entries under /proc/bus/nubus/. Populating /proc/bus/nubus/ on a slow machine with several such cards installed takes long enough that the user may think that the system is wedged. All those procfs entries also consume significant RAM though they are not normally needed (except by developers). Omit these resources from /proc/bus/nubus/ by default and add a kernel parameter to enable them when needed. On the test machine, this saved 300 kB and 10 seconds. Cc: Brad Boyer Reviewed-by: Brad Boyer Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/71ed7fb234a5f7381a50253b0d841a656d53e64c.1684200125.git.fthain@linux-m68k.org Signed-off-by: Geert Uytterhoeven commit b7629ce6f492eb2d48b9ee1dab5980c7278514c1 Author: Finn Thain Date: Wed Mar 22 11:54:32 2023 +1100 nubus: Remove proc entries before adding them The config ROMs on some Nubus cards contain mistakes such as resource duplication. This results in a warning from proc_register(): NuBus: Scanning NuBus slots. ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at fs/proc/generic.c:376 proc_register+0xbc/0xda proc_dir_entry '24/5' already registered Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 6.1.0-5-m68k #1 Debian 6.1.12-1 Stack from 00829d18: 00829d18 00451507 00451507 00000000 00000009 0038c57c 00451507 00386bae 00442945 0045f062 00000178 00868580 00868f50 00386c42 0045f062 00000178 00166fc8 00000009 00000000 00829d78 008685e4 0037f9ec 00000025 00248808 0045f0df 00829d94 00166fc8 0045f062 00000178 00000009 0045f0df 008689e4 008685e4 fafe3a20 00868980 00829df3 00829e32 00000024 00829dc0 00167332 00868980 00868580 00829e40 00248d36 00829df3 00008124 00868980 00248b0c Call Trace: [<0038c57c>] dump_stack+0xc/0x10 [<00386bae>] __warn+0x70/0xbc [<00386c42>] warn_slowpath_fmt+0x48/0x66 [<00166fc8>] proc_register+0xbc/0xda [<0037f9ec>] memcmp+0x0/0x56 [<00248808>] nubus_get_rsrc_str+0x0/0x5e [<00166fc8>] proc_register+0xbc/0xda [<00167332>] proc_create_single_data+0x40/0x48 [<00248d36>] nubus_proc_add_rsrc_mem+0x68/0xa4 [<00008124>] amiga_mksound+0xb8/0xc8 [<00248b0c>] nubus_proc_rsrc_show+0x0/0xa4 [<00386180>] memset+0x0/0x94 [<0024864a>] nubus_readdir+0x0/0x66 [<00560f35>] nubus_get_vendorinfo.isra.0+0x87/0x10e [<00560fb4>] nubus_get_vendorinfo.isra.0+0x106/0x10e [<00248d72>] nubus_proc_add_rsrc+0x0/0x8e [<001f6f50>] __dynamic_pr_debug+0x0/0x96 [<0038741e>] _printk+0x0/0x18 [<0016fafe>] kernfs_link_sibling+0x9a/0xaa [<00561cb0>] nubus_init+0x660/0x79c [<0037f7c6>] strcpy+0x0/0x1c [<0003f58c>] parse_args+0x0/0x308 [<00002104>] do_one_initcall+0x0/0x184 [<00561650>] nubus_init+0x0/0x79c [<00010000>] frc1_dst+0xe/0x14 [<00002172>] do_one_initcall+0x6e/0x184 [<0037f7c6>] strcpy+0x0/0x1c [<0003f58c>] parse_args+0x0/0x308 [<00002104>] do_one_initcall+0x0/0x184 [<0054b25c>] kernel_init_freeable+0x192/0x19c [<00561650>] nubus_init+0x0/0x79c [<0038c6c4>] kernel_init+0x0/0xec [<0038c6d8>] kernel_init+0x14/0xec [<0038c6c4>] kernel_init+0x0/0xec [<0000297c>] ret_from_kernel_thread+0xc/0x14 ---[ end trace 0000000000000000 ]--- This particular card (a Radius video card) contains a duplicated resource hence the /proc/bus/nubus/a/1/24/5 entry got registered twice. (A date resource has ID 5, the vendor info directory has ID 24) The solution for this is to remove a potentially pre-existing entry before adding the procfs entry for the resource. Reported-and-tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/dd1b560bbe426b351cdbb3bbf89414753c3d0117.1679446472.git.fthain@linux-m68k.org Signed-off-by: Geert Uytterhoeven commit 0e96647cff9224db564a1cee6efccb13dbe11ee2 Author: Finn Thain Date: Tue Mar 14 19:51:59 2023 +1100 nubus: Partially revert proc_create_single_data() conversion The conversion to proc_create_single_data() introduced a regression whereby reading a file in /proc/bus/nubus results in a seg fault: # grep -r . /proc/bus/nubus/e/ Data read fault at 0x00000020 in Super Data (pc=0x1074c2) BAD KERNEL BUSERR Oops: 00000000 Modules linked in: PC: [<001074c2>] PDE_DATA+0xc/0x16 SR: 2010 SP: 38284958 a2: 01152370 d0: 00000001 d1: 01013000 d2: 01002790 d3: 00000000 d4: 00000001 d5: 0008ce2e a0: 00000000 a1: 00222a40 Process grep (pid: 45, task=142f8727) Frame format=B ssw=074d isc=2008 isb=4e5e daddr=00000020 dobuf=01199e70 baddr=001074c8 dibuf=ffffffff ver=f Stack from 01199e48: 01199e70 00222a58 01002790 00000000 011a3000 01199eb0 015000c0 00000000 00000000 01199ec0 01199ec0 000d551a 011a3000 00000001 00000000 00018000 d003f000 00000003 00000001 0002800d 01052840 01199fa8 c01f8000 00000000 00000029 0b532b80 00000000 00000000 00000029 0b532b80 01199ee4 00103640 011198c0 d003f000 00018000 01199fa8 00000000 011198c0 00000000 01199f4c 000b3344 011198c0 d003f000 00018000 01199fa8 00000000 00018000 011198c0 Call Trace: [<00222a58>] nubus_proc_rsrc_show+0x18/0xa0 [<000d551a>] seq_read+0xc4/0x510 [<00018000>] fp_fcos+0x2/0x82 [<0002800d>] __sys_setreuid+0x115/0x1c6 [<00103640>] proc_reg_read+0x5c/0xb0 [<00018000>] fp_fcos+0x2/0x82 [<000b3344>] __vfs_read+0x2c/0x13c [<00018000>] fp_fcos+0x2/0x82 [<00018000>] fp_fcos+0x2/0x82 [<000b8aa2>] sys_statx+0x60/0x7e [<000b34b6>] vfs_read+0x62/0x12a [<00018000>] fp_fcos+0x2/0x82 [<00018000>] fp_fcos+0x2/0x82 [<000b39c2>] ksys_read+0x48/0xbe [<00018000>] fp_fcos+0x2/0x82 [<000b3a4e>] sys_read+0x16/0x1a [<00018000>] fp_fcos+0x2/0x82 [<00002b84>] syscall+0x8/0xc [<00018000>] fp_fcos+0x2/0x82 [<0000c016>] not_ext+0xa/0x18 Code: 4e5e 4e75 4e56 0000 206e 0008 2068 ffe8 <2068> 0020 2008 4e5e 4e75 4e56 0000 2f0b 206e 0008 2068 0004 2668 0020 206b ffe8 Disabling lock debugging due to kernel taint Segmentation fault The proc_create_single_data() conversion does not work because single_open(file, nubus_proc_rsrc_show, PDE_DATA(inode)) is not equivalent to the original code. Fixes: 3f3942aca6da ("proc: introduce proc_create_single{,_data}") Cc: Christoph Hellwig Cc: stable@vger.kernel.org # 5.6+ Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/d4e2a586e793cc8d9442595684ab8a077c0fe726.1678783919.git.fthain@linux-m68k.org Signed-off-by: Geert Uytterhoeven commit d49b9b07725f5dfa3344dc3eed59b8ccc0a0ddbc Merge: efc3001f8b44b 0ef4479d13af4 Author: David S. Miller Date: Mon May 22 12:44:44 2023 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== ice: allow matching on meta data Michal Swiatkowski says: This patchset is intended to improve the usability of the switchdev slow path. Without matching on a meta data values slow path works based on VF's MAC addresses. It causes a problem when the VF wants to use more than one MAC address (e.g. when it is in trusted mode). Parse all meta data in the same place where protocol type fields are parsed. Add description for the currently implemented meta data. It is important to note that depending on DDP not all described meta data can be available. Using not available meta data leads to error returned by function which is looking for correct words in profiles read from DDP. There is also one small improvement, remove of rx field in rule info structure (patch 2). It is redundant. ==================== Signed-off-by: David S. Miller commit efc3001f8b44bf5da0f178bd726a73c73f370707 Author: Uwe Kleine-König Date: Sat May 20 19:21:04 2023 +0200 nfc: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Reviewed-by: Luca Ceresoli Signed-off-by: David S. Miller commit fe79bd65c819cc520aa66de65caae8e4cea29c5a Author: Pavel Begunkov Date: Fri May 19 14:30:36 2023 +0100 net/tcp: refactor tcp_inet6_sk() Don't keep hand coded offset caluclations and replace it with container_of(). It should be type safer and a bit less confusing. It also makes it with a macro instead of inline function to preserve constness, which was previously casted out like in case of tcp_v6_send_synack(). Signed-off-by: Pavel Begunkov Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 4b159f5048b90844679dad08afb3240c1957aba1 Author: Russell King Date: Fri May 19 14:03:59 2023 +0100 net: phy: add helpers for comparing phy IDs There are several places which open code comparing PHY IDs. Provide a couple of helpers to assist with this, using a slightly simpler test than the original: - phy_id_compare() compares two arbitary PHY IDs and a mask of the significant bits in the ID. - phydev_id_compare() compares the bound phydev with the specified PHY ID, using the bound driver's mask. Signed-off-by: Russell King Reviewed-by: Simon Horman Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 8b6b7c1190c3da1137d320c3de5e8d7f69baba5b Author: Russell King (Oracle) Date: Fri May 19 11:33:04 2023 +0100 net: altera: tse: remove mac_an_restart() function The mac_an_restart() method will only be called if the driver sets legacy_pre_march2020, which the altera tse driver does not do. Therefore, providing a stub is unnecessary. Fixes: fef2998203e1 ("net: altera: tse: convert to phylink") Signed-off-by: Russell King (Oracle) Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 17cf9faeba463d24e7c497ff8137a8c8414644dc Author: Christophe JAILLET Date: Sat May 20 16:58:24 2023 +0200 ASoC: rt5682s: Use the devm_clk_get_optional() helper Use devm_clk_get_optional() instead of hand writing it. This saves some LoC and improves the semantic. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/f538c24ad7b1926478347a03b5b7f0432e195e3b.1684594691.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 0b855cbbd769940fcaf49b2371a05235d8499d5d Author: Christophe JAILLET Date: Sat May 20 16:54:06 2023 +0200 ASoC: cs53l30: Use the devm_clk_get_optional() helper Use devm_clk_get_optional() instead of hand writing it. This saves some LoC and improves the semantic. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/3219effee5c7f190530bdb1ef8ec35cb142e3611.1684594433.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 374628fb668e50b42fe81f2a63af616182415bcd Author: Christophe JAILLET Date: Sat May 20 17:00:50 2023 +0200 ASoC: stm32: sai: Use the devm_clk_get_optional() helper Use devm_clk_get_optional() instead of hand writing it. This saves some LoC and improves the semantic. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/f7987f18dadf77bfa09969fd4c82d5a0f4e4e3b7.1684594838.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit f364eb563164f52dcc42ea265a66510c6f15f829 Author: Christophe JAILLET Date: Sat May 20 16:56:00 2023 +0200 ASoC: rt5659: Use the devm_clk_get_optional() helper Use devm_clk_get_optional() instead of hand writing it. This saves some LoC and improves the semantic. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/5b44b2fddd8973e949e4ae2132971b147cfd1ec1.1684594544.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit c0998e0142af8037e4a0ee84dd01cd20cbe0c76e Author: Christophe JAILLET Date: Sat May 20 16:50:54 2023 +0200 ASoC: cs42l51: Use the devm_clk_get_optional() helper Use devm_clk_get_optional() instead of hand writing it. This saves some LoC and improves the semantic. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/3debf3bb7ea504ee9ca2d8eb0f948a426681cbdd.1684594240.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 8c03fd5fbd3e5a534675dffd5647166e919e1fc2 Author: Christophe JAILLET Date: Sat May 20 12:21:58 2023 +0200 ASoC: atmel: sam9g20_wm8731: Remove the unneeded include This driver does not use i2c, so there is no point in including Remove it. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/9b39a59f5829d200d7d1fac4e993dbf8ce05836d.1684578051.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit ef44ba21995e80e19e7056593067cb4bfaad0bde Author: Christophe JAILLET Date: Sat May 20 16:48:19 2023 +0200 ASoC: adau1761: Use the devm_clk_get_optional() helper Use devm_clk_get_optional() instead of hand writing it. This saves some LoC and improves the semantic. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/ab0fe7e7ecf965df84b9516ba65428af9b3805c1.1684594081.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit f9d1fe7e81b87378e7bb4a0be9c6fb29bbaa73c0 Author: Amadeusz Sławiński Date: Fri May 19 21:56:11 2023 +0200 ASoC: topology: Remove redundant log soc_tplg_valid_header() logs all the failures in detail already. Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230519195611.4068853-6-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit db756c5c35dfcf820c2b0d7eec526e8dfe79a96d Author: Amadeusz Sławiński Date: Fri May 19 21:56:10 2023 +0200 ASoC: topology: Remove redundant log soc_tplg_dapm_complete() logs all the failures in detail already. Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230519195611.4068853-5-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 5308540278d776e10519db144cb0cf3b3dd7ffbf Author: Amadeusz Sławiński Date: Fri May 19 21:56:09 2023 +0200 ASoC: topology: Do not split message string on multiple lines Kernel coding guidelines recommend to not split string unnecessarily. While at it adapt the other print present in the function to 100 characters line limit. Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230519195611.4068853-4-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 2316c11fa97779d06bfd7990f45b13a7b6ec1dae Author: Amadeusz Sławiński Date: Fri May 19 21:56:08 2023 +0200 ASoC: topology: Remove redundant logs soc_tplg_add_kcontrol() logs all the failures in detail already. Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230519195611.4068853-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit ec5dffcd428f54c117158c7b2cd79a1e14aa5b70 Author: Amadeusz Sławiński Date: Fri May 19 21:56:07 2023 +0200 ASoC: topology: Log control load errors in soc_tplg_control_load() Simplify code by logging any errors in function that does the actual work instead of doing so in its callers. Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230519195611.4068853-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit d8a2c987934959dd1f27de75401625650cd25e47 Author: Peter Ujfalusi Date: Mon May 22 13:13:13 2023 +0300 ASoC: SOF: ipc4-loader/topology: Query the CPC value from manifest The manifest's firmware module configuration section contains the measured CPC values along with a matching IBS/OBS values. The CPC can be looked up by looking for a matching IBS/OBS entry. In case of multiple matches we will use the highest CPC value. If there is no mod_cfg or no CPC value (all 0) or no match was found then print warning message and use 0 as CPC value. Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230522101313.12519-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 9caa90180512581821d7498132f952ebd4ba05ad Author: Peter Ujfalusi Date: Mon May 22 13:13:12 2023 +0300 ASoC: SOF: ipc4-topology: Do not use the CPC value from topology Stop parsing the CPC value from topology to module_base_cfg. The CPC value is only set for few modules in topology which makes the CPC handling inconsistent. Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230522101313.12519-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 19c745d1fd1a61a04a0b44623c70c4e71b6f274a Author: Peter Ujfalusi Date: Mon May 22 13:13:11 2023 +0300 ASoC: SOF: ipc4-topology: Rename sof_ipc4_update_pipeline_mem_usage() to be generic Rename sof_ipc4_update_pipeline_mem_usage() to sof_ipc4_update_resource_usage() in order to be re-usable for generic resource storage, calculation of a module, like CPC adjustment. Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230522101313.12519-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit fe04f300035d497a066172a9a9331439cc8300f6 Author: Peter Ujfalusi Date: Mon May 22 13:13:10 2023 +0300 ASoC: SOF: ipc4-loader: Save a pointer to fm_config in sof_ipc4_fw_module Save a pointer to the firmware module configuration area in sof_ipc4_fw_module struct for later use. Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230522101313.12519-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit d474809e9284848b6cb57a885f3252b86a0b485f Author: Peter Ujfalusi Date: Mon May 22 13:13:09 2023 +0300 ASoC: SOF: ipc4-loader: Drop unused bss_size from struct sof_ipc4_fw_module The bss_size is only set, but not used by the code, remove it. Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20230522101313.12519-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit dbb99d78522ae3d3f0d69fe7a8a0544a829f1d8e Author: Arnd Bergmann Date: Fri May 19 11:32:38 2023 +0200 net: ipconfig: move ic_nameservers_fallback into #ifdef block The new variable is only used when IPCONFIG_BOOTP is defined and otherwise causes a warning: net/ipv4/ipconfig.c:177:12: error: 'ic_nameservers_fallback' defined but not used [-Werror=unused-variable] Move it next to the user. Fixes: 81ac2722fa19 ("net: ipconfig: Allow DNS to be overwritten by DHCPACK") Signed-off-by: Arnd Bergmann Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 2ae9c66b04554bf5b3eeaab8c12a0bfb9f28ebde Author: Wei Fang Date: Fri May 19 10:01:13 2023 +0800 net: fec: remove useless fec_enet_reset_skb() This patch is a cleanup for fec driver. The fec_enet_reset_skb() is used to free skb buffers for tx queues and is only invoked in fec_restart(). However, fec_enet_bd_init() also resets skb buffers and is invoked in fec_restart() too. So fec_enet_reset_skb() is redundant and useless. Signed-off-by: Wei Fang Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit e4ac7cc6e5a45306049ac2337dea0e636adf36be Author: Wei Fang Date: Fri May 19 09:48:25 2023 +0800 net: fec: turn on XDP features The XDP features are supported since the commit 66c0e13ad236 ("drivers: net: turn on XDP features"). Currently, the fec driver supports NETDEV_XDP_ACT_BASIC, NETDEV_XDP_ACT_REDIRECT and NETDEV_XDP_ACT_NDO_XMIT. So turn on these XDP features for fec driver. Signed-off-by: Wei Fang Signed-off-by: David S. Miller commit d08f92bdfb2dc4a2a14237cfd8a22c568781797c Author: Claudiu Beznea Date: Wed May 17 12:41:15 2023 +0300 ARM: dts: at91: use clock-controller name for PMC nodes Use clock-controller generic name for PMC nodes. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230517094119.2894220-2-claudiu.beznea@microchip.com commit 08e4dd1d12acc02244b119790c8e50bbf3618a89 Author: Peter Rosin Date: Fri Apr 28 10:06:35 2023 +0200 ARM: dts: at91: tse850: add properties for gpio-line-names Signal names are one-to-one copies from the schematics, except VBUS which is an unnamed signal there. Signed-off-by: Peter Rosin [claudiu.beznea: add 1 indentation tab before index based comment] Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/32995b53-7f73-936f-a81d-5f1969f64910@axentia.se commit 0dd53308f74fcb16aa4e5cb90739b831c4a558de Author: Artur Weber Date: Fri May 19 19:03:54 2023 +0200 MAINTAINERS: Add entry for Samsung S6D7AA0 LCD panel controller driver Add myself as maintainer of the Samsung S6D7AA0 panel driver. Signed-off-by: Artur Weber Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230519170354.29610-4-aweber.kernel@gmail.com commit 6810bb390282bb75801832f31d088236503fee89 Author: Artur Weber Date: Fri May 19 19:03:53 2023 +0200 drm/panel: Add Samsung S6D7AA0 panel controller driver Initial driver for S6D7AA0-controlled panels. Currently, the following panels are supported: - S6D7AA0-LSL080AL02 (Samsung Galaxy Tab 3 8.0) - S6D7AA0-LSL080AL03 (Samsung Galaxy Tab A 8.0 2015) - S6D7AA0-LTL101AT01 (Samsung Galaxy Tab A 9.7 2015) It should be possible to extend this driver to work with other panels using this IC. Tested-by: Nikita Travkin #ltl101at01 Signed-off-by: Artur Weber Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230519170354.29610-3-aweber.kernel@gmail.com commit dda445651475b5a2a2941adcf1420fe3e9521bcd Author: Artur Weber Date: Fri May 19 19:03:52 2023 +0200 dt-bindings: display: panel: Add Samsung S6D7AA0 LCD panel controller Add bindings for the S6D7AA0 LCD panel controller, including the S6D7AA0-LSL080AL02 panel used in the Samsung Galaxy Tab 3 8.0 family of tablets, and the S6D7AA0-LSL080AL03 and S6D7AA0-LTL101AT01 panels used in the Samsung Galaxy Tab A 8.0 and 9.7 2015. Signed-off-by: Artur Weber Reviewed-by: Conor Dooley Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230519170354.29610-2-aweber.kernel@gmail.com commit 861601ff7f757f34f0584dc1f78ebb7a1f541e77 Author: Krzysztof Kozlowski Date: Thu May 11 19:54:46 2023 +0200 drm/i915: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Acked-by: Jani Nikula Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jani Nikula Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230511175446.282041-1-krzysztof.kozlowski@linaro.org commit a31988510689e6116921d6c67521c6cf472737f6 Author: Rob Herring Date: Fri Mar 10 08:47:01 2023 -0600 clk: microchip: Use of_property_read_bool() for boolean properties It is preferred to use typed property access functions (i.e. of_property_read_ functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to of_property_read_bool(). Signed-off-by: Rob Herring Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230310144701.1541573-1-robh@kernel.org commit f3e788d9ec71c4efbe220fe2ca46368602b698f6 Author: Conor Dooley Date: Thu Mar 9 20:44:48 2023 +0000 clk: microchip: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIRE As part of converting RISC-V SOC_FOO symbols to ARCH_FOO to match the use of such symbols on other architectures, convert the Microchip FPGA clock drivers to use the new symbol. Signed-off-by: Conor Dooley Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230309204452.969574-2-conor@kernel.org commit a499a6b203ebbc5fb9f055d13c78f87ce2e59eaa Author: Bartosz Golaszewski Date: Mon May 15 11:25:15 2023 +0200 pinctrl: qcom: sa8775p: add the wakeirq map The SA8775P TLMM driver is missing the GPIO-to-wakeup-pin mapping. This adds it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230515092515.180920-1-brgl@bgdev.pl Signed-off-by: Linus Walleij commit 6c93a21d92666b44787ee32d054d48751799aad0 Author: Dmitry Baryshkov Date: Sat May 20 02:40:25 2023 +0300 drm/msm/dpu: move PINGPONG_NONE check to dpu_lm_init() Move the check for lm->pingpong being not NONE from dpu_rm_init() to dpu_lm_init(), following the change to dpu_hw_intf_init(). Suggested-by: Marijn Suijten Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/538206/ Link: https://lore.kernel.org/r/20230519234025.2864377-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 76c40f1463585ab0927a832be302ebae0178e5a0 Author: Dmitry Baryshkov Date: Sat May 20 02:40:24 2023 +0300 drm/msm/dpu: use PINGPONG_NONE for LMs with no PP attached On msm8998/sdm845 some LM blocks do not have corresponding PINGPONG block. Currently the driver uses PINGPONG_MAX for such cases. Switch that to use PINGPONG_NONE instead, which is more logical. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/538205/ Link: https://lore.kernel.org/r/20230519234025.2864377-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit f89fdc862be4c390652116d22b5c20b0837cc8cd Author: Dmitry Baryshkov Date: Sat May 20 02:40:23 2023 +0300 drm/msm/dpu: remove futile checks from dpu_rm_init() dpu_rm_init() contains checks for block->id values. These were logical in the vendor driver, when one can not be sure which values were passed from DT. In the upstream driver this is not necessary: the catalog is a part of the driver, we control specified IDs. Suggested-by: Marijn Suijten Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/538204/ Link: https://lore.kernel.org/r/20230519234025.2864377-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 50883f733c8ec10dd2d36466d3e53e3cb341bc10 Author: Dmitry Baryshkov Date: Sat May 20 02:40:22 2023 +0300 drm/msm/dpu: replace IS_ERR_OR_NULL with IS_ERR during DSC init Using IS_ERR_OR_NULL() together with PTR_ERR() is a typical mistake. If the value is NULL, then the function will return 0 instead of a proper return code. Moreover dpu_hw_dsc_init() can not return NULL. Replace the IS_ERR_OR_NULL() call with IS_ERR(). This follows the commit 740828c73a36 ("drm/msm/dpu: fix error handling in dpu_rm_init"), which removed IS_ERR_OR_NULL() from RM init code, but then the commit f2803ee91a41 ("drm/msm/disp/dpu1: Add DSC support in RM") added it for DSC init. Suggested-by: Marijn Suijten Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/538203/ Link: https://lore.kernel.org/r/20230519234025.2864377-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit a7129231edf329a00e92dbd2d741f6da728a4a06 Author: Konrad Dybcio Date: Fri May 19 20:49:59 2023 +0200 drm/msm/dpu: Set DPU_DATA_HCTL_EN for in INTF_SC7180_MASK DPU5 and newer targets enable this unconditionally. Move it from the SC7280 mask to the SC7180 one. Fixes: 7e6ee55320f0 ("drm/msm/disp/dpu1: enable DATA_HCTL_EN for sc7280 target") Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Konrad Dybcio Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/538159/ Link: https://lore.kernel.org/r/20230508-topic-hctl_en-v2-1-e7bea9f1f5dd@linaro.org [DB: removed BIT(DPU_INTF_DATA_COMPRESS), which is not yet merged] Signed-off-by: Dmitry Baryshkov commit babbd0a5f3c5239cc081fed870b7f010d41bacde Author: Dmitry Baryshkov Date: Sat Apr 29 04:23:53 2023 +0300 drm/msm/dpu: access CSC/CSC10 registers directly Stop using _sspp_subblk_offset() to get offset of the csc_blk. Inline this function and use ctx->cap->sblk->csc_blk.base directly. As this was the last user, drop _sspp_subblk_offset() too. Reviewed-by: Jeykumar Sankaran Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/534747/ Link: https://lore.kernel.org/r/20230429012353.2569481-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit be7057e0d40be7f2d938c809d93f5efa9b365246 Author: Dmitry Baryshkov Date: Sat Apr 29 04:23:52 2023 +0300 drm/msm/dpu: access QSEED registers directly Stop using _sspp_subblk_offset() to get offset of the scaler_blk. Inline this function and use ctx->cap->sblk->scaler_blk.base directly. Reviewed-by: Jeykumar Sankaran Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/534746/ Link: https://lore.kernel.org/r/20230429012353.2569481-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 7e3d6c548b4de7018aa74bb2416d14cff11ea5a1 Author: Dmitry Baryshkov Date: Sat Apr 29 04:23:51 2023 +0300 drm/msm/dpu: drop SSPP's SRC subblock The src_blk declares a lame copy of main SSPP register space. It's offset is always 0. It's length has been fixed to 0x150, while SSPP's length is now correct. Drop the src_blk and access SSPP registers without additional subblock lookup. Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/534745/ Link: https://lore.kernel.org/r/20230429012353.2569481-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit f1584d89c1cdf893c11e2da645b0101c857cf77e Author: Marijn Suijten Date: Thu Apr 27 00:37:36 2023 +0200 drm/msm/dpu: Remove intr_rdptr from DPU >= 5.0.0 pingpong config Now that newer DPU platforms use a readpointer-done interrupt on the INTF block, stop providing the unused interrupt on the PINGPONG block. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/534238/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-22-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit e955a3f0d86e4a789364af62495ac37546eb71c8 Author: Marijn Suijten Date: Thu Apr 27 00:37:35 2023 +0200 drm/msm/dpu: Implement tearcheck support on INTF block Since DPU 5.0.0 the TEARCHECK registers and interrupts moved out of the PINGPONG block and into the INTF. Implement the necessary callbacks in the INTF block, and use these callbacks together with the INTF_TEAR interrupts. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534234/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-21-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit bb9f1880ca902114569e17887626ee80c759a47c Author: Marijn Suijten Date: Thu Apr 27 00:37:34 2023 +0200 drm/msm/dpu: Merge setup_- and enable_tearcheck pingpong callbacks These functions are always called consecutively and are best bundled together for simplicity, especially when the same structure of callbacks will be replicated later on the interface block for INTF TE support. The enable_tearcheck(false) case is now replaced with a more obvious disable_tearcheck(), encapsulating the original register write with 0. Suggested-by: Dmitry Baryshkov Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534217/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-20-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit 0272b9c3b5729ba4170b15953747259dbcde5c88 Author: Marijn Suijten Date: Thu Apr 27 00:37:33 2023 +0200 drm/msm/dpu: Add TEAR-READ-pointer interrupt to INTF block All SoCs since DPU 5.0.0 have the tear interrupt registers moved out of the PINGPONG block and into the INTF block. The new interrupts are described in dpu_hw_interrupts.c, now wire them up in individual SoC catalog files by setting the intr_tear_rd_ptr to the IRQ index spcified in the offset table and enabling this set of DPU interrupts via the mdss_irqs bitmask. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534236/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-19-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit ec6e9b673ad56d019716298c15901d3a46e65c77 Author: Marijn Suijten Date: Thu Apr 27 00:37:32 2023 +0200 drm/msm/dpu: Describe TEAR interrupt registers for DSI interfaces All SoCs since DPU 5.0.0 have the tear interrupt registers moved out of the PINGPONG block and into the INTF block. Wire up the IRQ register masks in the interrupt table for enabling, reading and clearing them. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534244/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-18-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit a38a9949a96399ecbe213837b2341babe3262423 Author: Marijn Suijten Date: Thu Apr 27 00:37:31 2023 +0200 drm/msm/dpu: Factor out shared interrupt register in INTF_BLK macro As the INTF block is going to attain more interrupts that don't share the same MDP_SSPP_TOP0_INTR register, factor out the _reg argument for the caller to construct the right interrupt index (register and bit index) to not make the interrupt bit arguments depend on one of multiple interrupt register indices. This brings us more in line with how PP_BLK specifies its interrupts and allows for better wrapping in the arrays. Signed-off-by: Marijn Suijten Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534222/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-17-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit c31ec42ebb45aaa4f668037525b8df140563ca6a Author: Konrad Dybcio Date: Thu Apr 27 00:37:30 2023 +0200 drm/msm/dpu: Move dpu_hw_{tear_check, pp_vsync_info} to dpu_hw_mdss.h Now that newer SoCs since DPU 5.0.0 manage tearcheck in the INTF instead of PINGPONG block, move the struct definition to a common file. Also, bring in documentation from msm-4.19 techpack while at it. Signed-off-by: Konrad Dybcio [Marijn: Also move dpu_hw_pp_vsync_info] Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534232/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-16-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit a2ff096803b30de95c6428ade638726ee3897b8e Author: Marijn Suijten Date: Thu Apr 27 00:37:29 2023 +0200 drm/msm/dpu: Disable MDP vsync source selection on DPU 5.0.0 and above Since hardware revision 5.0.0 the TE configuration moved out of the PINGPONG block into the INTF block, including vsync source selection that was previously part of MDP top. Writing to the MDP_VSYNC_SEL register has no effect anymore and is omitted downstream via the DPU/SDE_MDP_VSYNC_SEL feature flag. This flag is only added to INTF blocks used by hardware prior to 5.0.0. The code that writes to these registers in the INTF block will follow in subsequent patches. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534220/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-15-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit fe9d66cf6e8d2f6651e55ae57026464a080c2f2a Author: Marijn Suijten Date: Thu Apr 27 00:37:28 2023 +0200 drm/msm/dpu: Disable pingpong TE on DPU 5.0.0 and above Since hardware revision 5.0.0 the TE configuration moved out of the PINGPONG block into the INTF block. Writing these registers has no effect, and is omitted downstream via the DPU/SDE_PINGPONG_TE feature flag. This flag is only added to PINGPONG blocks used by hardware prior to 5.0.0. The existing PP_BLK_TE macro has been removed in favour of directly passing this feature flag, which has thus far been the only difference with PP_BLK. PP_BLK_DITHER has been left in place as its embedded feature flag already excludes this DPU_PINGPONG_TE bit and differs by setting the block length to zero, as it only contains a DITHER subblock. The code that writes to these registers in the INTF block will follow in subsequent patches. Signed-off-by: Marijn Suijten Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534240/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-14-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit 4a7c38ec7d8efe96c4d8b4d5fc0efb5b06db58e9 Author: Marijn Suijten Date: Thu Apr 27 00:37:27 2023 +0200 drm/msm/dpu: Move autorefresh disable from CMD encoder to pingpong This autorefresh disable logic in the physical command-mode encoder consumes three callbacks to the pingpong block, and will explode in unnecessary complexity when the same callbacks need to be called on the interface block instead to accommodate INTF TE support. To clean this up, move the logic into the pingpong block under a disable_autorefresh callback, replacing the aforementioned three get_autorefresh, setup_autorefresh and get_vsync_info callbacks. The same logic will have to be replicated to the interface block when it receives INTF TE support, but it is less complex than constantly switching on a "has_intf_te" boolean to choose a callback. Suggested-by: Dmitry Baryshkov Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534230/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-13-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit a2623e72c52b2cf258b34675a8ff38c66e7d26fb Author: Marijn Suijten Date: Thu Apr 27 00:37:26 2023 +0200 drm/msm/dpu: Drop unused poll_timeout_wr_ptr PINGPONG callback This callback was migrated from downstream when DPU1 was first introduced to mainline, but never used by any component. Drop it to save some lines and unnecessary confusion. Suggested-by: Dmitry Baryshkov Signed-off-by: Marijn Suijten Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534215/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-12-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit f0408020bfdaeef168e46eead3cbcfc7fd16f314 Author: Marijn Suijten Date: Thu Apr 27 00:37:25 2023 +0200 drm/msm/dpu: Take INTF index as parameter in interrupt register defines Instead of hardcoding many register defines for every INTF and AD4 index with a fixed stride, turn the defines into singular chunks of math that compute the address using the base and this fixed stride multiplied by the index given as argument to the definitions. MDP_SSPP_TOP0_OFF is dropped as that constant is zero anyway, and all register offsets related to it live in dpu_hwio.h. Suggested-by: Dmitry Baryshkov Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534221/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-11-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit d80d7f8912a8cbec16ec55793f4b20fc5e76640f Author: Marijn Suijten Date: Thu Apr 27 00:37:24 2023 +0200 drm/msm/dpu: Sort INTF registers numerically A bunch of registers were appended at the end in e.g. commit 91143873a05d ("drm/msm/dpu: Add MISR register support for interface") rather than being inserted in a place that maintains numerical sorting: restore said numerical sorting. Signed-off-by: Marijn Suijten Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/534213/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-10-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit d9388af508436091adc1bce492caebab4586b2dd Author: Marijn Suijten Date: Thu Apr 27 00:37:23 2023 +0200 drm/msm/dpu: Remove extraneous register define indentation A bunch of registers are indented with two extra spaces, looking as if these are values corresponding to the previous register which is not the case, rather these are simply also register offsets and should only have a single space separating them and the #define keyword. Signed-off-by: Marijn Suijten Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/534218/ Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-9-27ce1a5ab5c6@somainline.org Signed-off-by: Dmitry Baryshkov commit 853b292b92d50d1b30628c92229e93d670304e51 Author: Marijn Suijten Date: Thu May 18 23:29:08 2023 +0200 drm/msm/dpu: Use V4.0 PCC DSPP sub-block in SC7[12]80 According to various downstream sources the PCC sub-block inside DSPP is version 4.0 since DPU 4.0 and higher, including SC7[12]80 at DPU version 6.2 and 7.2 respectively. After correcting the version this struct becomes identical to sm8150_dspp_sblk which is used all across the catalog: replace uses of sc7180_dspp_sblk with that and remove the struct definition for sc7180_dspp_sblk entirely. Fixes: 4259ff7ae509e ("drm/msm/dpu: add support for pcc color block in dpu driver") Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/537899/ Link: https://lore.kernel.org/r/20230518-dpu-sc7180-pcc-version-v1-1-ec9ca4949e3e@somainline.org Signed-off-by: Dmitry Baryshkov commit 3ce166380567d8385b776d7b72b603e0d2379e18 Author: Abhinav Kumar Date: Wed May 3 15:39:05 2023 -0700 drm/msm/dpu: add writeback support for sc7280 Add writeback support for sc7280. This was validated with kms_writeback test case in IGT. Signed-off-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/535244/ Link: https://lore.kernel.org/r/20230503223905.24754-1-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 52788338110c06846cb62ad54569659b0cc59970 Author: Dmitry Baryshkov Date: Sun Apr 30 00:25:12 2023 +0300 drm/msm/dpu: drop unused SSPP sub-block information The driver doesn't support hsic/memcolor and pcc SSPP subblocks. Drop corresponding definitions. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/534766/ Link: https://lore.kernel.org/r/20230429212512.2947245-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 732c2c5298219bc21da3396bc09deb3589295349 Author: Abhinav Kumar Date: Fri Apr 28 15:36:46 2023 -0700 drm/msm/dpu: drop DSPP_MSM8998_MASK from hw catalog Since GC and IGC masks have now been dropped, DSPP_MSM8998_MASK is the same as DSPP_SC7180_MASK. Since DSPP_SC7180_MASK is used more than DSPP_MSM8998_MASK, lets drop the latter. Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/534726/ Link: https://lore.kernel.org/r/20230428223646.23595-4-quic_abhinavk@quicinc.com [DB: fixed typo in commit message] Signed-off-by: Dmitry Baryshkov commit 9fd5aa5ae701a2c6fd7111e7365533c28439c00e Author: Abhinav Kumar Date: Fri Apr 28 15:36:45 2023 -0700 drm/msm/dpu: remove GC and IGC related code from dpu catalog Gamma Correction (GC) and Inverse Gamma Correction(IGC) is currently unused. In addition dpu_dspp_sub_blks didn't even have an igc member describing the block. Drop related code from the dpu hardware catalog otherwise this becomes a burden to carry across chipsets in the catalog. changes in v3: - drop IGC related code from dpu_hw_catalog too - update commit text accordingly Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/534725/ Link: https://lore.kernel.org/r/20230428223646.23595-3-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 7debb6bb699db088d7b3c14ccef634e7241b3831 Author: Abhinav Kumar Date: Fri Apr 28 15:36:44 2023 -0700 drm/msm/dpu: remove DPU_DSPP_IGC handling in dspp flush Inverse gamma correction blocks (IGC) are not used today so lets remove the usage of DPU_DSPP_IGC in the DSPP flush to make it easier to remove IGC from the catalog. We can add this back when IGC is properly supported in DPU with one of the standard DRM properties. changes in v3: - minor change dspp -> DSPP in commit text Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/534724/ Link: https://lore.kernel.org/r/20230428223646.23595-2-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 198d8c9c0abf0d952756480b020e3b453df01695 Author: Abhinav Kumar Date: Fri Apr 28 15:36:43 2023 -0700 drm/msm/dpu: remove DPU_DSPP_GC handling in dspp flush Gamma correction blocks (GC) are not used today so lets remove the usage of DPU_DSPP_GC in the dspp flush to make it easier to remove GC from the catalog. We can add this back when GC is properly supported in DPU with one of the standard DRM properties. changes in v3: - drop the link tag which was auto added before Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/534723/ Link: https://lore.kernel.org/r/20230428223646.23595-1-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit babdb815ef04572a940e78e533d7e90fc505b77f Author: Marijn Suijten Date: Wed Apr 26 01:11:11 2023 +0200 drm/msm/dpu: Pass catalog pointers in RM to replace for-loop ID lookups The Resource Manager already iterates over all available blocks from the catalog, only to pass their ID to a dpu_hw_xxx_init() function which uses an _xxx_offset() helper to search for and find the exact same catalog pointer again to initialize the block with, fallible error handling and all. Instead, pass const pointers to the catalog entries directly to these _init functions and drop the for loops entirely, saving on both readability complexity and unnecessary cycles at boot. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/533861/ Link: https://lore.kernel.org/r/20230418-dpu-drop-useless-for-lookup-v3-3-e8d869eea455@somainline.org Signed-off-by: Dmitry Baryshkov commit 94fdd55b93b46fcd6bc8415ad15b008b45031b1b Author: Marijn Suijten Date: Wed Apr 26 01:11:10 2023 +0200 drm/msm/dpu: Drop unused members from HW structs Some of these members were initialized while never read, while others were not even assigned any pointer value at all. Drop them to save some space, and above all confusion when looking at or accidentally dereferencing these members. Signed-off-by: Marijn Suijten Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/533862/ Link: https://lore.kernel.org/r/20230418-dpu-drop-useless-for-lookup-v3-2-e8d869eea455@somainline.org Signed-off-by: Dmitry Baryshkov commit 10036161efbf573fa5b2e42463e5bffe6f9bfb6d Author: Dmitry Baryshkov Date: Fri Apr 21 01:25:58 2023 +0300 drm/msm/dpu: stop mapping the regdma region Stop mapping the regdma region. The driver does not support regdma. Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/533150/ Link: https://lore.kernel.org/r/20230420222558.1208887-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 078f766e165097c03629cc1a8f7e1a7b7ec0e79b Author: Dmitry Baryshkov Date: Fri Apr 21 01:25:57 2023 +0300 drm/msm/dpu: drop the regdma configuration The regdma is currently not used by the current driver. We have no way to practically verify that the regdma is described correctly. Drop it now. Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/533148/ Link: https://lore.kernel.org/r/20230420222558.1208887-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 8d6dad490afcc05ca7306ee2bac32774302e4aec Author: Arnaud Vrac Date: Wed Apr 19 16:41:16 2023 +0200 drm/msm/dpu: set max cursor width to 512x512 Override the default max cursor size reported to userspace of 64x64. MSM8998 hw cursor planes support 512x512 size, and other chips use DMA SSPPs. Signed-off-by: Arnaud Vrac Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/532903/ Link: https://lore.kernel.org/r/20230419-dpu-tweaks-v1-9-d1bac46db075@freebox.fr Signed-off-by: Dmitry Baryshkov commit c95771905c494aa5c2abbb56b3e2f7d4aa3b34f9 Author: Arnaud Vrac Date: Wed Apr 19 16:41:15 2023 +0200 drm/msm/dpu: fix cursor block register bit offset in msm8998 hw catalog This matches the value for both fbdev and sde implementations in the downstream msm-4.4 repository. Signed-off-by: Arnaud Vrac Fixes: 94391a14fc27 ("drm/msm/dpu1: Add MSM8998 to hw catalog") Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/532899/ Link: https://lore.kernel.org/r/20230419-dpu-tweaks-v1-8-d1bac46db075@freebox.fr Signed-off-by: Dmitry Baryshkov commit 95a808328e9918e5716610313f6aec7600108ede Author: Arnaud Vrac Date: Wed Apr 19 16:41:10 2023 +0200 drm/msm/dpu: use hsync/vsync polarity set by the encoder Do not override the hsync/vsync polarity passed by the encoder when setting up intf timings. The same logic was used in both the encoder and intf code to set the DP and DSI polarities, so those interfaces are not impacted. However for HDMI, the polarities were overriden to static values based on the vertical resolution, instead of using the actual mode polarities. Signed-off-by: Arnaud Vrac Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/532901/ Link: https://lore.kernel.org/r/20230419-dpu-tweaks-v1-3-d1bac46db075@freebox.fr Signed-off-by: Dmitry Baryshkov commit e6f756af381f80c064d1f94077b150f8d95b3dab Author: Dmitry Baryshkov Date: Sat Apr 15 20:19:26 2023 +0300 drm/msm/dpu: add HDMI output support MSM8998 and the older Qualcomm platforms support HDMI outputs. Now as DPU encoder is ready, add support for using INTF_HDMI. Signed-off-by: Dmitry Baryshkov Reviewed-by: Arnaud Vrac Tested-by: Arnaud Vrac # on msm8998 Patchwork: https://patchwork.freedesktop.org/patch/532371/ Link: https://lore.kernel.org/r/20230415171926.85774-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 4d4c2b2537a334f57bb39a26e2e116ceadfdc13d Author: Jia Jie Ho Date: Fri May 19 21:42:33 2023 +0800 crypto: starfive - Fix driver dependencies Kconfig updated to depend on DMADEVICES instead of selecting it. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202305191929.Eq4OVZ6D-lkp@intel.com/ Signed-off-by: Jia Jie Ho Signed-off-by: Herbert Xu commit 9e28f7a74581204807f20ae46568939038e327aa Author: Adrián Larumbe Date: Sat May 20 18:00:35 2023 +0100 OPP: rate-limit debug messages when no change in OPP is required Otherwise, when enabling a debug build and dynamic debug in the kernel, it quickly floods the kernel ring buffer and makes debugging of other subsystems almost impossible, unless manually disabled. Signed-off-by: Adrián Larumbe Signed-off-by: Viresh Kumar commit 4b9abbc132b86e2ce65090798186836f48f33382 Author: Tim Van Patten Date: Mon May 15 14:25:52 2023 -0600 platform/chrome: cros_ec_lpc: Move host command to prepare/complete Update cros_ec_lpc_pm_ops to call cros_ec_lpc_prepare() during PM .prepare() and cros_ec_lpc_complete() during .complete(). This moves the host command that the AP sends and allows the EC to log entry/exit of AP's suspend/resume more accurately. Reviewed-by: Raul E Rangel Signed-off-by: Tim Van Patten Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20230515142552.1.I17cae37888be3a8683911991602f18e482e7a621@changeid commit b230235b386589d8f0d631b1c77a95ca79bb0732 Author: Ahmed S. Darwish Date: Mon May 15 19:32:17 2023 +0200 docs: Set minimal gtags / GNU GLOBAL version to 6.6.5 Kernel build now uses the gtags "-C (--directory)" option, available since GNU GLOBAL v6.6.5. Update the documentation accordingly. Signed-off-by: Ahmed S. Darwish Cc: Link: https://lists.gnu.org/archive/html/info-global/2020-09/msg00000.html Signed-off-by: Masahiro Yamada commit e1b37563caffc410bb4b55f153ccb14dede66815 Author: Ahmed S. Darwish Date: Mon May 15 19:32:16 2023 +0200 scripts/tags.sh: Resolve gtags empty index generation gtags considers any file outside of its current working directory "outside the source tree" and refuses to index it. For O= kernel builds, or when "make" is invoked from a directory other then the kernel source tree, gtags ignores the entire kernel source and generates an empty index. Force-set gtags current working directory to the kernel source tree. Due to commit 9da0763bdd82 ("kbuild: Use relative path when building in a subdir of the source tree"), if the kernel build is done in a sub-directory of the kernel source tree, the kernel Makefile will set the kernel's $srctree to ".." for shorter compile-time and run-time warnings. Consequently, the list of files to be indexed will be in the "../*" form, rendering all such paths invalid once gtags switches to the kernel source tree as its current working directory. If gtags indexing is requested and the build directory is not the kernel source tree, index all files in absolute-path form. Note, indexing in absolute-path form will not affect the generated index, as paths in gtags indices are always relative to the gtags "root directory" anyway (as evidenced by "gtags --dump"). Signed-off-by: Ahmed S. Darwish Cc: Signed-off-by: Masahiro Yamada commit ac263349b91bf34b7c8419f5645c84b4f88de846 Author: Masahiro Yamada Date: Mon May 15 00:27:28 2023 +0900 modpost: rename find_elf_symbol() and find_elf_symbol2() find_elf_symbol() and find_elf_symbol2() are not good names. Rename them to find_tosym(), find_fromsym(), respectively. Signed-off-by: Masahiro Yamada commit 9990ca35870b7c57d39f8b325d676dfd028035b4 Author: Masahiro Yamada Date: Mon May 15 00:27:27 2023 +0900 modpost: pass section index to find_elf_symbol2() find_elf_symbol2() converts the section index to the section name, then compares the two strings in each iteration. This is slow. It is faster to compare the section indices (i.e. integers) directly. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit dbf7cc2e4e78dfecad02ff17ff5c9971b42da462 Author: Masahiro Yamada Date: Mon May 15 00:27:26 2023 +0900 modpost: pass 'tosec' down to default_mismatch_handler() default_mismatch_handler() does not need to compute 'tosec' because it is calculated by the caller. Pass it down to default_mismatch_handler() instead of calling sec_name() twice. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 856567d5599e7df75d7cad1fef1311d7c1854200 Author: Masahiro Yamada Date: Mon May 15 00:27:25 2023 +0900 modpost: squash extable_mismatch_handler() into default_mismatch_handler() Merging these two reduces several lines of code. The extable section mismatch is already distinguished by EXTABLE_TO_NON_TEXT. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit f4c35484e7f11458c1834b88ee55b746cdabbb09 Author: Masahiro Yamada Date: Mon May 15 00:27:24 2023 +0900 modpost: clean up is_executable_section() SHF_EXECINSTR is a bit flag (#define SHF_EXECINSTR 0x4). Compare the masked flag to '!= 0'. There is no good reason to stop modpost immediately even if a special section index is given. You will get a section mismatch error anyway. Also, change the return type to bool. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit fc5fa862c49a4d9e23617fbda7d249d2c1b72e56 Author: Masahiro Yamada Date: Mon May 15 00:27:23 2023 +0900 modpost: squash report_sec_mismatch() into default_mismatch_handler() report_sec_mismatch() and default_mismatch_handler() are small enough to be merged together. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit faee9defd8fc376864efb39b87d59f667deeb488 Author: Masahiro Yamada Date: Mon May 15 00:27:22 2023 +0900 modpost: squash report_extable_warnings() into extable_mismatch_handler() Collect relevant code into one place to clarify all the cases are covered by 'if () ... else if ... else ...'. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 6691e6f5fc3e9fa76c9a50970fa851829df7d9f2 Author: Masahiro Yamada Date: Mon May 15 00:27:21 2023 +0900 modpost: remove get_prettyname() This is the last user of get_pretty_name() - it is just used to distinguish whether the symbol is a function or not. It is not valuable information. Signed-off-by: Masahiro Yamada commit 6c90d36be3e5140c93d3af360d012fa26966304a Author: Masahiro Yamada Date: Mon May 15 00:27:20 2023 +0900 modpost: remove fromsym info in __ex_table section mismatch warning report_extable_warnings() prints "from" in a pretty form, but we know it is always located in the __ex_table section, i.e. a collection of struct exception_table_entry. It is very likely to fail to get the symbol name and ends up with meaningless message: ... in reference from the (unknown reference) (unknown) to ... Signed-off-by: Masahiro Yamada commit d0acc76a49aa917c1a455d11d32d34a01e8b2835 Author: Masahiro Yamada Date: Mon May 15 00:27:19 2023 +0900 modpost: remove broken calculation of exception_table_entry size find_extable_entry_size() is completely broken. It has awesome comments about how to calculate sizeof(struct exception_table_entry). It was based on these assumptions: - struct exception_table_entry has two fields - both of the fields have the same size Then, we came up with this equation: (offset of the second field) * 2 == (size of struct) It was true for all architectures when commit 52dc0595d540 ("modpost: handle relocations mismatch in __ex_table.") was applied. Our mathematics broke when commit 548acf19234d ("x86/mm: Expand the exception table logic to allow new handling options") introduced the third field. Now, the definition of exception_table_entry is highly arch-dependent. For x86, sizeof(struct exception_table_entry) is apparently 12, but find_extable_entry_size() sets extable_entry_size to 8. I could fix it, but I do not see much value in this code. extable_entry_size is used just for selecting a slightly different error message. If the first field ("insn") references to a non-executable section, The relocation at %s+0x%lx references section "%s" which is not executable, IOW it is not possible for the kernel to fault at that address. Something is seriously wrong and should be fixed. If the second field ("fixup") references to a non-executable section, The relocation at %s+0x%lx references section "%s" which is not executable, IOW the kernel will fault if it ever tries to jump to it. Something is seriously wrong and should be fixed. Merge the two error messages rather than adding even more complexity. Change fatal() to error() to make it continue running and catch more possible errors. Fixes: 548acf19234d ("x86/mm: Expand the exception table logic to allow new handling options") Signed-off-by: Masahiro Yamada commit 64f140417d818aa374788acc9cb8328165747262 Author: Masahiro Yamada Date: Fri May 12 01:24:22 2023 +0900 modpost: error out if addend_*_rel() is not implemented for REL arch The section mismatch check relies on the relocation entries. For REL, the addend value is implicit, so we need some code to compute it. Currently, EM_386, EM_ARM, and EM_MIPS are supported. This commit makes sure we covered all the cases. I believe the other architectures use RELA, where the explicit r_addend field exists. Signed-off-by: Masahiro Yamada commit 81d362732bac05f656cdc4bbe776ac20cfd30c45 Author: Andrew Davis Date: Mon Mar 6 16:47:52 2023 -0600 kbuild: Disallow DTB overlays to built from .dts named source files As a follow up to the series allowing DTB overlays to built from .dtso files. Now that all overlays have been renamed, remove the ability to build from overlays from .dts files to prevent any files with the old name from accidental being added. Signed-off-by: Andrew Davis Reviewed-by: Geert Uytterhoeven Acked-by: Andy Shevchenko Signed-off-by: Masahiro Yamada commit c876c3f182a5cc16711962efdd9bf56b9fb84317 Author: Marc Zyngier Date: Mon May 15 18:00:16 2023 +0100 KVM: arm64: Relax trapping of CTR_EL0 when FEAT_EVT is available CTR_EL0 can often be used in userspace, and it would be nice if KVM didn't have to emulate it unnecessarily. While it isn't possible to trap the cache configuration registers independently from CTR_EL0 in the base ARMv8.0 architecture, FEAT_EVT allows these cache configuration registers (CCSIDR_EL1, CCSIDR2_EL1, CLIDR_EL1 and CSSELR_EL1) to be trapped independently by setting HCR_EL2.TID4. Switch to using TID4 instead of TID2 in the cases where FEAT_EVT is available *and* that KVM doesn't need to sanitise CTR_EL0 to paper over mismatched cache configurations. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230515170016.965378-1-maz@kernel.org Signed-off-by: Oliver Upton commit 0f840ff7910c0bc05b5567467aa1c19bd9a4ffad Author: Andreas Klinger Date: Tue May 16 13:33:15 2023 +0200 MAINTAINERS: Add Honeywell mprls0025pa sensor Add myself as a maintainer for Honeywell mprls0025pa sensor. Signed-off-by: Andreas Klinger Link: https://lore.kernel.org/r/ZGNp+1uNAxi3uxjM@arbad Signed-off-by: Jonathan Cameron commit 713337d9143ed1ccc70e2dab6633e8e6b0186ad5 Author: Andreas Klinger Date: Tue May 16 13:32:45 2023 +0200 iio: pressure: Honeywell mprls0025pa pressure sensor Honeywell mprls0025pa is a series of pressure sensors. Add initial I2C support. Note: - IIO buffered mode is supported - SPI mode is not supported Signed-off-by: Andreas Klinger Link: https://lore.kernel.org/r/ZGNp3SqyOJeEcLsj@arbad Signed-off-by: Jonathan Cameron commit a765c985e69671054f397046b1d94d8c6e34149e Author: Andreas Klinger Date: Tue May 16 13:32:13 2023 +0200 dt-bindings: iio: pressure: Support Honeywell mprls0025pa sensor Honeywell mprls0025pa is a pressure sensor series. There are many different models with different pressure ranges, units and transfer functions. The range and transfer function need to be set up in the dt. Therefore new properties honeywell,pmin-pascal, honeywell,pmax-pascal, honeywell,transfer-function are introduced. Add dt-bindings. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Andreas Klinger Link: https://lore.kernel.org/r/ZGNpve4ux5KJ3BNQ@arbad Signed-off-by: Jonathan Cameron commit 7cf15f4275f5b478035c1422a15fe049829cc34c Author: Uwe Kleine-König Date: Mon May 15 22:50:48 2023 +0200 iio: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230515205048.19561-1-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 8274a04ff1dc76bfc412d389123eb2a5f474549d Author: Jagan Teki Date: Tue May 16 22:04:52 2023 +0530 arm64: dts: rockchip: Add Rockchip RK3588J Rockchip RK3588J is the industrial-grade version of RK3588 SoC and is operated with -40 °C to +85 °C temparature. Add rk3588j specific dtsi for adding rk3588j specific operating points and other changes to be add in future. Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20230516163454.997736-2-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit addc72dc55118a1e80f8c77767a5c94000248d3d Author: Jagan Teki Date: Tue May 16 22:04:51 2023 +0530 dt-bindings: arm: rockchip: Add Edgeble Neural Compute Module 6B Neural Compute Module 6B(Neu6B) is a 96boards SoM-CB compute module based on Rockchip RK3588J from Edgeble AI. Edgeble Neural Compute Module 6B(Neu6B) IO board is an industrial form factor evaluation board from Edgeble AI. Neu6B needs to mount on top of this IO board in order to create complete Edgeble Neural Compute Module 6B(Neu6B) IO platform. This patch add dt-bindings for Edgeble Neu6 Model B SoM based IO board. Signed-off-by: Jagan Teki Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230516163454.997736-1-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 0c3391f8bb06b744df521651534cd99e3d77e0a8 Author: Michael Tretter Date: Fri Jan 20 10:14:22 2023 +0100 arm64: dts: rockchip: Add RGA2 support to rk356x The rk3568 also features a RGA2 block. Add the necessary device tree node. Acked-by: Nicolas Frattaroli Signed-off-by: Michael Tretter Acked-by: Nicolas Dufresne Link: https://lore.kernel.org/r/20230119-rk3568-rga-v1-2-43d4d14365e6@pengutronix.de Signed-off-by: Heiko Stuebner commit 9b12ceb5a80d1fb45d293265de100e33b5843943 Author: Michael Tretter Date: Fri Jan 20 10:14:21 2023 +0100 media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga Add a new compatible for the rk3568 Rockchip SoC, which also features an RGA, which is called RGA2 in the TRM Part2. It is the same core as used on the rk3288, which documents the same RGA2. Specify a new compatible for the rk3568 to be able to handle unknown SoC-specific differences in the driver. Acked-by: Krzysztof Kozlowski Signed-off-by: Michael Tretter Reviewed-by: Ezequiel Garcia Acked-by: Sakari Ailus Acked-by: Nicolas Dufresne Link: https://lore.kernel.org/r/20230119-rk3568-rga-v1-1-43d4d14365e6@pengutronix.de Signed-off-by: Heiko Stuebner commit 130733a10079102a78b51bf19bf4e4fa4d119c67 Author: Konrad Dybcio Date: Fri Apr 7 22:14:50 2023 +0200 interconnect: qcom: msm8996: Promote to core_initcall The interconnect driver is (or soon will be) vital to many other devices, as it's not a given that the bootloader will set up enough bandwidth for us or that the values we come into are reasonable. Promote the driver to core_initcall to ensure the consumers (i.e. most "meaningful" parts of the SoC) can probe without deferrals. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230228-topic-qos-v8-8-ee696a2c15a9@linaro.org Signed-off-by: Georgi Djakov commit 1ff7aedcdcdd4fe02201269ab428b09491e5cf6e Author: Konrad Dybcio Date: Fri Apr 7 22:14:49 2023 +0200 interconnect: qcom: rpm: Don't use clk_get_optional for bus clocks anymore Commit dd42ec8ea5b9 ("interconnect: qcom: rpm: Use _optional func for provider clocks") relaxed the requirements around probing bus clocks. This was a decent solution for making sure MSM8996 would still boot with old DTs, but now that there's a proper fix in place that both old and new DTs will be happy about, revert back to the safer variant of the function. Fixes: dd42ec8ea5b9 ("interconnect: qcom: rpm: Use _optional func for provider clocks") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230228-topic-qos-v8-7-ee696a2c15a9@linaro.org Signed-off-by: Georgi Djakov commit a867cf9b65eadc172bc73e56b13458742d4d050e Author: Konrad Dybcio Date: Fri Apr 7 22:14:48 2023 +0200 interconnect: qcom: icc-rpm: Enforce 2 or 0 bus clocks For SMD RPM bus scaling to work, we need a pair of sleep-wake clocks. The variable number of them we previously supported was only a hack to keep the clocks required for QoS register access, but now that these are separated, we can leave bus_clks to the actual bus clocks. In cases where there is no actual bus scaling (such as A0NoC on MSM8996 and GNoC on SDM660 where the HLOS is only supposed to program the QoS registers and the bus is either static or controlled remotely), allow for no clock scaling with a boolean property. Remove all the code related to allowing an arbitrary number of bus_clks, replace the number by BUS_CLK_MAX (= 2) and guard the bus clock paths to ensure they are not taken on non-scaling buses. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230228-topic-qos-v8-6-ee696a2c15a9@linaro.org Signed-off-by: Georgi Djakov commit 2e2113c8a64f2668baca28a82144a4f0dc22a217 Author: Konrad Dybcio Date: Thu May 18 21:58:01 2023 +0200 interconnect: qcom: rpm: Handle interface clocks Some (but not all) providers (or their specific nodes) require specific clocks to be turned on before they can be accessed. Failure to ensure that results in a seemingly random system crash (which would usually happen at boot with the interconnect driver built-in), resulting in the platform not booting up properly. Limit the number of bus_clocks to 2 (which is the maximum that SMD RPM interconnect supports anyway) and handle non-scaling clocks separately. Update MSM8996 and SDM660 drivers to make sure they do not regress with this change. This unfortunately has to be done in one patch to prevent either compile errors or broken bisect. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230518195801.2556998-1-konrad.dybcio@linaro.org Signed-off-by: Georgi Djakov commit 525ff9c2965770762b81d679820552a208070d59 Author: Arnd Bergmann Date: Tue Jan 17 17:40:35 2023 +0100 workqueue: fix enum type for gcc-13 In gcc-13, the WORK_STRUCT_WQ_DATA_MASK constant is a signed 64-bit type on 32-bit architectures because the enum definition has both negative numbers and numbers above LONG_MAX in it: kernel/workqueue.c: In function 'get_work_pwq': kernel/workqueue.c:709:24: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 709 | return (void *)(data & WORK_STRUCT_WQ_DATA_MASK); | ^ kernel/workqueue.c: In function 'get_work_pool': kernel/workqueue.c:737:25: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 737 | return ((struct pool_workqueue *) | ^ kernel/workqueue.c: In function 'get_work_pool_id': kernel/workqueue.c:759:25: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 759 | return ((struct pool_workqueue *) | ^ Change the enum definition to ensure all values can fit into the range of 'unsigned long' on all architectures. Signed-off-by: Arnd Bergmann Tested-by: Thierry Reding Tested-by: Lai Jiangshan Signed-off-by: Tejun Heo commit 658888050998d0f0f7d8eca0c4dbb304bfa408bb Author: Miaohe Lin Date: Sun May 21 00:06:34 2023 +0800 cgroup/cpuset: remove unneeded header files Remove some unnecessary header files. No functional change intended. Signed-off-by: Miaohe Lin Signed-off-by: Tejun Heo commit b8b637d770ef7aa9bc3971670cc8532b1f0d757e Author: Ming Lei Date: Sat May 20 23:11:34 2023 +0800 ublk: fix build warning on iov_iter_get_pages2 Return type of iov_iter_get_pages2() is ssize_t instead of size_t, so fix it. Fixes: 981f95a571e3 ("ublk: cleanup ublk_copy_user_pages") Reported-by: kernel test robot Reported-by: Julia Lawall Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230520151134.459679-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 1e0a97f84d73ea1182740f62069690c7f3271abb Author: Dmitry Baryshkov Date: Mon May 1 04:12:57 2023 +0300 drm/msm/dsi: don't allow enabling 14nm VCO with unprogrammed rate If the dispcc uses CLK_OPS_PARENT_ENABLE (e.g. on QCM2290), CCF can try enabling VCO before the rate has been programmed. This can cause clock lockups and/or other boot issues. Program the VCO to the minimal PLL rate if the read rate is 0 Hz. Cc: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Reported-by: Vladimir Zapolskiy Reported-by: Konrad Dybcio Reviewed-by: Konrad Dybcio Fixes: f079f6d999cb ("drm/msm/dsi: Add PHY/PLL for 8x96") Patchwork: https://patchwork.freedesktop.org/patch/534813/ Link: https://lore.kernel.org/r/20230501011257.3460103-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit d8dd416cb420163f9631a01ddcce78628a6a5962 Author: Douglas Anderson Date: Tue Jan 31 14:18:26 2023 -0800 drm/msm/dsi: More properly handle errors in regards to dsi_mgr_bridge_power_on() In commit 7d8e9a90509f ("drm/msm/dsi: move DSI host powerup to modeset time") the error handling with regards to dsi_mgr_bridge_power_on() got a bit worse. Specifically if we failed to power the bridge on then nothing would really notice. The modeset function couldn't return an error and thus we'd blindly go forward and try to do the pre-enable. In commit ec7981e6c614 ("drm/msm/dsi: don't powerup at modeset time for parade-ps8640") we added a special case to move the powerup back to pre-enable time for ps8640. When we did that, we didn't try to recover the old/better error handling just for ps8640. In the patch ("drm/msm/dsi: Stop unconditionally powering up DSI hosts at modeset") we've now moved the powering up back to exclusively being during pre-enable. That means we can add the better error handling back in, so let's do it. To do so we'll add a new function dsi_mgr_bridge_power_off() that's matches how errors were handled prior to commit 7d8e9a90509f ("drm/msm/dsi: move DSI host powerup to modeset time"). NOTE: Now that we have dsi_mgr_bridge_power_off(), it feels as if we should be calling it in dsi_mgr_bridge_post_disable(). That would make some sense, but doing so would change the current behavior and thus should be a separate patch. Specifically: * dsi_mgr_bridge_post_disable() always calls dsi_mgr_phy_disable() even in the slave-DSI case of bonded DSI. We'd need to add special handling for this if it's truly needed. * dsi_mgr_bridge_post_disable() calls msm_dsi_phy_pll_save_state() midway through the poweroff. * dsi_mgr_bridge_post_disable() has a different order of some of the poweroffs / IRQ disables. For now we'll leave dsi_mgr_bridge_post_disable() alone. Signed-off-by: Douglas Anderson Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/521059/ Link: https://lore.kernel.org/r/20230131141756.RFT.v2.3.I3c87b53c4ab61a7d5e05f601a4eb44c7e3809a01@changeid Signed-off-by: Dmitry Baryshkov commit 9e15123eca7942caa8a3e1f58ec0df7d088df149 Author: Douglas Anderson Date: Tue Jan 31 14:18:25 2023 -0800 drm/msm/dsi: Stop unconditionally powering up DSI hosts at modeset In commit 7d8e9a90509f ("drm/msm/dsi: move DSI host powerup to modeset time"), we moved powering up DSI hosts to modeset time. This wasn't because it was an elegant design, but there were no better options. That commit actually ended up breaking ps8640, and thus was born commit ec7981e6c614 ("drm/msm/dsi: don't powerup at modeset time for parade-ps8640") as a temporary hack to un-break ps8640 by moving it to the old way of doing things. It turns out that ps8640 _really_ doesn't like its pre_enable() function to be called after dsi_mgr_bridge_power_on(). Specifically (from experimentation, not because I have any inside knowledge), it looks like the assertion of "RST#" in the ps8640 runtime resume handler seems like it's not allowed to happen after dsi_mgr_bridge_power_on() Recently, Dave Stevenson's series landed allowing bridges some control over pre_enable ordering. The meaty commit for our purposes is commit 4fb912e5e190 ("drm/bridge: Introduce pre_enable_prev_first to alter bridge init order"). As documented by that series, if a bridge doesn't set "pre_enable_prev_first" then we should use the old ordering. Now that we have the commit ("drm/bridge: tc358762: Set pre_enable_prev_first") we can go back to the old ordering, which also allows us to remove the ps8640 special case. One last note is that even without reverting commit 7d8e9a90509f ("drm/msm/dsi: move DSI host powerup to modeset time"), if you _just_ revert the ps8640 special case and try it out then it doesn't seem to fail anymore. I spent time bisecting / debugging this and it turns out to be mostly luck, so we still want this patch to make sure it's solid. Specifically the reason it sorta works these days is because we implemented wait_hpd_asserted() in ps8640 now, plus the magic of "pm_runtime" autosuspend. The fact that we have wait_hpd_asserted() implemented means that we actually power the bridge chip up just a wee bit earlier and then the bridge happens to stay on because of autosuspend and thus ends up powered before dsi_mgr_bridge_power_on(). Cc: Dave Stevenson Cc: Dmitry Baryshkov Cc: Abhinav Kumar Signed-off-by: Douglas Anderson Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/521058/ Link: https://lore.kernel.org/r/20230131141756.RFT.v2.2.I4cfeab9d0e07e98ead23dd0736ab4461e6c69002@changeid Signed-off-by: Dmitry Baryshkov commit 32a31bd41be148cac0dae3ff0f2555027c6853b7 Author: Arnd Bergmann Date: Tue May 16 22:22:07 2023 +0200 HSI: fix ssi_waketest() declaration The ssi_waketest() function definition causes a 'make W=1' warning because the declaration is hidden away in ssi_protocol.c: drivers/hsi/controllers/omap_ssi_core.c:147:6: error: no previous prototype for 'ssi_waketest' Move it into a header file instead. Fixes: dc7bf5d71868 ("HSI: Introduce driver for SSI Protocol") Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Signed-off-by: Sebastian Reichel commit 76aa53e20e77a4de3b9b5cbdf405fa13ff9be6de Author: Niklas Schnelle Date: Tue May 16 13:00:08 2023 +0200 iio: ad7606: Kconfig: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230516110038.2413224-13-schnelle@linux.ibm.com Signed-off-by: Jonathan Cameron commit 787eb0c0cb7b504dd3e9822e1a90f6d351c39b93 Author: Krzysztof Kozlowski Date: Sun May 7 19:39:21 2023 +0200 dt-bindings: iio: st,lsm6dsx: reference common schema for mount-matrix Reference iio.yaml schema from dtschema to allow already used mount-matrix property: msm8953-xiaomi-daisy.dtb: imu@6a: Unevaluated properties are not allowed ('mount-matrix' was unexpected) Signed-off-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230507173923.263741-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 5361613b1997a1ef0d274eddf144690f7878c6b6 Author: Herve Codina Date: Tue May 9 18:08:52 2023 +0200 MAINTAINERS: add the Renesas X9250 driver entry After contributing the driver, add myself as the maintainer for the Renesas X9250 IIO driver. Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20230509160852.158101-4-herve.codina@bootlin.com Signed-off-by: Jonathan Cameron commit 66bfc528a6fd5225e59ea4bbca0665aad38f1567 Author: Herve Codina Date: Tue May 9 18:08:51 2023 +0200 iio: potentiometer: Add support for the Renesas X9250 potentiometers The Renesas X9250 integrates four digitally controlled potentiometers. On each potentiometer, the X9250T has a 100 kOhms total resistance and the X9250U has a 50 kOhms total resistance. Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20230509160852.158101-3-herve.codina@bootlin.com Signed-off-by: Jonathan Cameron commit a1d2c9b3029de24505c09430931966b96fe1b678 Author: Jonathan Corbet Date: Sat May 20 08:07:04 2023 -0600 docs: process: fix a typoed cross-reference Commit 329ac9af902e added a cross-reference missing a hyphen; add one from my emergency hyphen stash. Reported-by: kernel test robot Fixes: 329ac9af902e ("docs: submitting-patches: Discuss interleaved replies") Closes: https://lore.kernel.org/oe-kbuild-all/202305201652.POM84URe-lkp@intel.com/ Signed-off-by: Jonathan Corbet commit 712c7364655f69827d0b96f69594886ecbfb412f Author: Christoph Hellwig Date: Sat May 20 06:45:03 2023 +0200 block: don't plug in blkdev_write_iter For direct I/O writes that issues more than a single bio, the plugging is already done in __blkdev_direct_IO. For synchronous buffered writes the plugging is done deep down in writeback_inodes_wb / wb_writeback. For the other cases there is no point in plugging as as single bio or no bio at all is submitted. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230520044503.334444-1-hch@lst.de Signed-off-by: Jens Axboe commit e2a1f85bf9f509afd09b5d3308e3489b65845c28 Author: Yang Yang Date: Sun May 14 09:33:38 2023 -0700 sched/psi: Avoid resetting the min update period when it is unnecessary Psi_group's poll_min_period is determined by the minimum window size of psi_trigger when creating new triggers. While destroying a psi_trigger, there is no need to reset poll_min_period if the psi_trigger being destroyed did not have the minimum window size, since in this condition poll_min_period will remain the same as before. Signed-off-by: Yang Yang Signed-off-by: Peter Zijlstra (Intel) Acked-by: Suren Baghdasaryan Link: https://lkml.kernel.org/r/20230514163338.834345-1-surenb@google.com commit 4040fc51ca37b198bb43f716e1868fe7ff5d731c Author: Gustavo A. R. Silva Date: Fri May 19 14:54:46 2023 -0600 ALSA: mixart: Replace one-element arrays with simple object declarations One-element arrays are deprecated, and we are replacing them with flexible array members instead. However, in this case it seems those one-element arrays have never actually been used as fake flexible arrays. See this code that dates from Linux-2.6.12-rc2 initial git repository build (commit 1da177e4c3f4 ("Linux-2.6.12-rc2")): sound/pci/mixart/mixart_core.h: 215 struct mixart_stream_state_req 216 { 217 u32 delayed; 218 u64 scheduler; 219 u32 reserved4np[3]; 220 u32 stream_count; /* set to 1 for instance */ 221 struct mixart_flow_info stream_info; /* could be an array[stream_count] */ 222 } __attribute__((packed)); sound/pci/mixart/mixart.c: 388 389 memset(&stream_state_req, 0, sizeof(stream_state_req)); 390 stream_state_req.stream_count = 1; 391 stream_state_req.stream_info.stream_desc.uid_pipe = stream->pipe->group_uid; 392 stream_state_req.stream_info.stream_desc.stream_idx = stream->substream->number; 393 So, taking the code above as example, replace multiple one-element arrays with simple object declarations, and refactor the rest of the code, accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/296 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/ZGfiFjcL8+r3mayq@work Signed-off-by: Takashi Iwai commit a915d60426d4348a0b91f9870e299056fd604a32 Author: Oswald Buddenhagen Date: Thu May 18 16:09:47 2023 +0200 ALSA: emu10k1: revamp playback voice allocator Instead of separate voices, we now allocate non-interleaved channels, which may in turn contain two interleaved voices each. The higher-level code keeps only one pointer per channel. The channels are not allocated in one block any more, as there is no reason to do that. As a consequence of that, and because it is cleaner regardless, we now let the allocator store these pointers at a specified location, rather than returning only the first one and having the calling code deduce the remaining ones. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518140947.3725394-8-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit b4fea2d3f25b5f3ad6b230f91e61151165f6d023 Author: Oswald Buddenhagen Date: Thu May 18 16:09:46 2023 +0200 ALSA: emu10k1: make snd_emu10k1_voice_alloc() assign voices' epcm The voice allocator clearly knows about the field (it resets it), so it's more consistent (and leads to less duplicated code) to have the constructor take it as a parameter. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518140947.3725394-7-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit bdb3b567b84e321c51786aba2a05ec23bb90bfdf Author: Oswald Buddenhagen Date: Fri May 19 20:41:22 2023 +0200 ALSA: emu10k1: centralize freeing PCM voices This saves some code duplication; no functional change. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230519184122.3808185-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 18f558876ff0361e8ceb537cdf6fec8936ff6f72 Merge: 9343184cb31fe 1a8bc2299f402 Author: Martin KaFai Lau Date: Fri May 19 17:45:47 2023 -0700 Merge branch 'bpf: Add socket destroy capability' Aditi Ghag says: ==================== This patch set adds the capability to destroy sockets in BPF. We plan to use the capability in Cilium to force client sockets to reconnect when their remote load-balancing backends are deleted. The other use case is on-the-fly policy enforcement where existing socket connections prevented by policies need to be terminated. The use cases, and more details around the selected approach were presented at LPC 2022 - https://lpc.events/event/16/contributions/1358/. RFC discussion - https://lore.kernel.org/netdev/CABG=zsBEh-P4NXk23eBJw7eajB5YJeRS7oPXnTAzs=yob4EMoQ@mail.gmail.com/T/#u. v8 patch series - https://lore.kernel.org/bpf/20230517175359.527917-1-aditi.ghag@isovalent.com/ v9 highlights: Address review comments: Martin: - Rearranged the kfunc filter patch, and added the missing break statement. - Squashed the extended selftest/bpf patch. Yonghong: - Revised commit message for patch 1. (Below notes are same as v8 patch series that are still relevant. Refer to earlier patch series versions for other notes.) - I hit a snag while writing the kfunc where verifier complained about the `sock_common` type passed from TCP iterator. With kfuncs, there don't seem to be any options available to pass BTF type hints to the verifier (equivalent of `ARG_PTR_TO_BTF_ID_SOCK_COMMON`, as was the case with the helper). As a result, I changed the argument type of the sock_destory kfunc to `sock_common`. ==================== Signed-off-by: Martin KaFai Lau commit 1a8bc2299f4028e9bac36020ffaaec27a0dfb9c1 Author: Aditi Ghag Date: Fri May 19 22:51:57 2023 +0000 selftests/bpf: Test bpf_sock_destroy The test cases for destroying sockets mirror the intended usages of the bpf_sock_destroy kfunc using iterators. The destroy helpers set `ECONNABORTED` error code that we can validate in the test code with client sockets. But UDP sockets have an overriding error code from `disconnect()` called during abort, so the error code validation is only done for TCP sockets. The failure test cases validate that the `bpf_sock_destroy` kfunc is not allowed from program attach types other than BPF trace iterator, and such programs fail to load. Signed-off-by: Aditi Ghag Link: https://lore.kernel.org/r/20230519225157.760788-10-aditi.ghag@isovalent.com Signed-off-by: Martin KaFai Lau commit 176ba657e6aaa61df637558a57acd8b7bf043cb4 Author: Aditi Ghag Date: Fri May 19 22:51:56 2023 +0000 selftests/bpf: Add helper to get port using getsockname The helper will be used to programmatically retrieve and pass ports in userspace and kernel selftest programs. Suggested-by: Stanislav Fomichev Signed-off-by: Aditi Ghag Link: https://lore.kernel.org/r/20230519225157.760788-9-aditi.ghag@isovalent.com Signed-off-by: Martin KaFai Lau commit 4ddbcb886268af8d12a23e6640b39d1d9c652b1b Author: Aditi Ghag Date: Fri May 19 22:51:55 2023 +0000 bpf: Add bpf_sock_destroy kfunc The socket destroy kfunc is used to forcefully terminate sockets from certain BPF contexts. We plan to use the capability in Cilium load-balancing to terminate client sockets that continue to connect to deleted backends. The other use case is on-the-fly policy enforcement where existing socket connections prevented by policies need to be forcefully terminated. The kfunc also allows terminating sockets that may or may not be actively sending traffic. The kfunc can currently be called only from BPF TCP and UDP iterators where users can filter, and terminate selected sockets. More specifically, it can only be called from BPF contexts that ensure socket locking in order to allow synchronous execution of protocol specific `diag_destroy` handlers. The previous commit that batches UDP sockets during iteration facilitated a synchronous invocation of the UDP destroy callback from BPF context by skipping socket locks in `udp_abort`. TCP iterator already supported batching of sockets being iterated. To that end, `tracing_iter_filter` callback filter is added so that verifier can restrict the kfunc to programs with `BPF_TRACE_ITER` attach type, and reject other programs. The kfunc takes `sock_common` type argument, even though it expects, and casts them to a `sock` pointer. This enables the verifier to allow the sock_destroy kfunc to be called for TCP with `sock_common` and UDP with `sock` structs. Furthermore, as `sock_common` only has a subset of certain fields of `sock`, casting pointer to the latter type might not always be safe for certain sockets like request sockets, but these have a special handling in the diag_destroy handlers. Additionally, the kfunc is defined with `KF_TRUSTED_ARGS` flag to avoid the cases where a `PTR_TO_BTF_ID` sk is obtained by following another pointer. eg. getting a sk pointer (may be even NULL) by following another sk pointer. The pointer socket argument passed in TCP and UDP iterators is tagged as `PTR_TRUSTED` in {tcp,udp}_reg_info. The TRUSTED arg changes are contributed by Martin KaFai Lau . Signed-off-by: Aditi Ghag Link: https://lore.kernel.org/r/20230519225157.760788-8-aditi.ghag@isovalent.com Signed-off-by: Martin KaFai Lau commit e924e80ee6a39bc28d2ef8f51e19d336a98e3be0 Author: Aditi Ghag Date: Fri May 19 22:51:54 2023 +0000 bpf: Add kfunc filter function to 'struct btf_kfunc_id_set' This commit adds the ability to filter kfuncs to certain BPF program types. This is required to limit bpf_sock_destroy kfunc implemented in follow-up commits to programs with attach type 'BPF_TRACE_ITER'. The commit adds a callback filter to 'struct btf_kfunc_id_set'. The filter has access to the `bpf_prog` construct including its properties such as `expected_attached_type`. Signed-off-by: Aditi Ghag Link: https://lore.kernel.org/r/20230519225157.760788-7-aditi.ghag@isovalent.com Signed-off-by: Martin KaFai Lau commit dcbe4ea1985d3123836794be021c39cb33954f9f Merge: 20d5e0ef252a1 c4dc8dc32bd1f Author: Jakub Kicinski Date: Fri May 19 21:52:18 2023 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-05-18 (igc, igb, e1000e) This series contains updates to igc, igb, and e1000e drivers. Kurt Kanzenbach adds calls to txq_trans_cond_update() for XDP transmit on igc. Tom Rix makes definition of igb_pm_ops conditional on CONFIG_PM for igb. Baozhu Ni adds a missing kdoc description on e1000e. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: e1000e: Add @adapter description to kdoc igb: Define igb_pm_ops conditionally on CONFIG_PM igc: Avoid transmit queue timeout for XDP ==================== Link: https://lore.kernel.org/r/20230518170942.418109-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit f80dd11dd1d07ada04a9fcd57032fa82e136462d Author: Bart Van Assche Date: Fri May 19 15:03:46 2023 -0700 block: BFQ: Move an invariant check Check bfqq->dispatched for each BFQ queue instead of checking it for an invalid bfqq pointer. Fixes: 3e49c1e4a615 ("block: BFQ: Add several invariant checks") Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230519220347.3643295-1-bvanassche@acm.org Signed-off-by: Jens Axboe commit 1172d5b8beca6b899deb9f7f2850e7e47ec16198 Author: Ming Lei Date: Fri May 19 14:50:30 2023 +0800 ublk: support user copy Currently copy between io request buffer(pages) and userspace buffer is done inside ublk_map_io() or ublk_unmap_io(). This way performs very well in case of pre-allocated userspace io buffer. For dynamically allocated or external userspace backend io buffer, UBLK_F_NEED_GET_DATA is added for ublk server to provide buffer by one extra command communication for WRITE request. For READ, userspace simply provides buffer, but can't know when the buffer is done[1]. Add UBLK_F_USER_COPY by moving io data copy out of kernel by providing read()/write() on /dev/ublkcN, and simply let ublk server do the io data copy. This way makes both side cleaner, the cost is that one extra syscall for copy io data between request and backend buffer. With UBLK_F_USER_COPY, it actually becomes possible to run per-io zero copy now, such as, only do zero copy for big size IO, so it can be thought as one prep patch for supporting zero copy. Meantime zero copy still needs to expose read()/write() buffer for some corner case, such as passthrough IO. [1] READ buffer in UBLK_F_NEED_GET_DATA https://lore.kernel.org/linux-block/116d8a56-0881-56d3-9bcc-78ff3e1dc4e5@linux.alibaba.com/T/#m23bd4b8634c0a054e6797063167b469949a247bb ublksrv loop usercopy code: https://github.com/ming1/ubdsrv/commits/usercopy Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230519065030.351216-8-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 62fe99cef94a5900cac3bf15fd03ee8baad1a99c Author: Ming Lei Date: Fri May 19 14:50:29 2023 +0800 ublk: add read()/write() support for ublk char device Support pread()/pwrite() on ublk char device for reading/writing request io buffer, so data copy between io request buffer and userspace buffer can be moved to ublk server from ublk driver. Then UBLK_F_NEED_GET_DATA becomes not necessary, so ublk server can allocate buffer without one extra round uring command communication for userspace to provide buffer. IO buffer can be located by iocb->ki_pos which encodes buffer offset, io tag and queue id info, and type of iocb->ki_pos is u64, so it is big enough for holding reasonable queue depth, nr_queues and max io buffer size. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230519065030.351216-7-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 38f2dd34410f9070b60969a07ff7d8743b4fd56c Author: Ming Lei Date: Fri May 19 14:50:28 2023 +0800 ublk: support to copy any part of request pages Add 'offset' to 'struct ublk_map_data', so that ublk_copy_user_pages() can be used to copy any sub-buffer(linear mapped) of the request. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230519065030.351216-6-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 8284066946e6d9cc979566ce698fe24e7ca0b31e Author: Ming Lei Date: Fri May 19 14:50:27 2023 +0800 ublk: grab request reference when the request is handled by userspace Add one reference counter into request pdu data, and hold this reference in the request's lifetime. Prepare for supporting to move request data copy into userspace, which needs to copy request data by read()/write() on /dev/ublkcN, so we have to guarantee that read()/write() is done on one valid/active request, and that will be enhanced by holding the io request reference in read()/write(). Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230519065030.351216-5-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 981f95a571e3ca20a496c0b77dbf6b06039c6648 Author: Ming Lei Date: Fri May 19 14:50:26 2023 +0800 ublk: cleanup ublk_copy_user_pages Clean up ublk_copy_user_pages() by using iov_iter_get_pages2, and code gets simplified a lot and becomes much more readable than before. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230519065030.351216-4-ming.lei@redhat.com Signed-off-by: Jens Axboe commit f236a21459a5cdd828b93f363946e116773494f6 Author: Ming Lei Date: Fri May 19 14:50:25 2023 +0800 ublk: cleanup io cmd code path by adding ublk_fill_io_cmd() Add one small helper to cleanup io command hanlding code path. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230519065030.351216-3-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 29dc5d06613f2438ec20a4ba5e0a5a740584d346 Author: Ming Lei Date: Fri May 19 14:50:24 2023 +0800 ublk: kill queuing request by task_work_add task_work_add() is used from early ublk development stage for handling request in batch. However, since commit 7d4a93176e01 ("ublk_drv: don't forward io commands in reserve order"), we can get similar batch processing with io_uring_cmd_complete_in_task(), and similar performance data is observed between task_work_add() and io_uring_cmd_complete_in_task(). Meantime we can kill one fast code path, which is actually seldom used given it is common to build ublk driver as module. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20230519065030.351216-2-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 5498bf28d8f2bd63a46ad40f4427518615fb793f Author: Pavel Begunkov Date: Fri May 19 15:21:16 2023 +0100 io_uring: annotate offset timeout races It's racy to read ->cached_cq_tail without taking proper measures (usually grabbing ->completion_lock) as timeout requests with CQE offsets do, however they have never had a good semantics for from when they start counting. Annotate racy reads with data_race(). Reported-by: syzbot+cb265db2f3f3468ef436@syzkaller.appspotmail.com Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/4de3685e185832a92a572df2be2c735d2e21a83d.1684506056.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 9a67aa52a42b31ad44220cc218df3b75a5cd5d05 Author: Christoph Hellwig Date: Fri May 19 06:40:50 2023 +0200 blk-mq: don't use the requeue list to queue flush commands Currently both requeues of commands that were already sent to the driver and flush commands submitted from the flush state machine share the same requeue_list struct request_queue, despite requeues doing head insertions and flushes not. Switch to using two separate lists instead. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230519044050.107790-8-hch@lst.de Signed-off-by: Jens Axboe commit 1e82fadfc6b96ca79f69d0bcf938d31032bb43d2 Author: Christoph Hellwig Date: Fri May 19 06:40:49 2023 +0200 blk-mq: do not do head insertions post-pre-flush commands blk_flush_complete_seq currently queues requests that write data after a pre-flush from the flush state machine at the head of the queue. This doesn't really make sense, as the original request bypassed all queue lists by directly diverting to blk_insert_flush from blk_mq_submit_bio. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230519044050.107790-7-hch@lst.de Signed-off-by: Jens Axboe commit 615939a2ae734e3e68c816d6749d1f5f79c62ab7 Author: Christoph Hellwig Date: Fri May 19 06:40:48 2023 +0200 blk-mq: defer to the normal submission path for post-flush requests Requests with the FUA bit on hardware without FUA support need a post flush before returning to the caller, but they can still be sent using the normal I/O path after initializing the flush-related fields and end I/O handler. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Link: https://lore.kernel.org/r/20230519044050.107790-6-hch@lst.de Signed-off-by: Jens Axboe commit be4c427809b0a746aff54dbb8ef663f0184291d0 Author: Bart Van Assche Date: Fri May 19 06:40:47 2023 +0200 blk-mq: use the I/O scheduler for writes from the flush state machine Send write requests issued by the flush state machine through the normal I/O submission path including the I/O scheduler (if present) so that I/O scheduler policies are applied to writes with the FUA flag set. Separate the I/O scheduler members from the flush members in struct request since now a request may pass through both an I/O scheduler and the flush machinery. Note that the actual flush requests, which have no bio attached to the request still bypass the I/O schedulers. Signed-off-by: Bart Van Assche [hch: rebased] Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230519044050.107790-5-hch@lst.de Signed-off-by: Jens Axboe commit 360f264834e34d08530c2fb9b67e3ffa65318761 Author: Christoph Hellwig Date: Fri May 19 06:40:46 2023 +0200 blk-mq: defer to the normal submission path for non-flush flush commands If blk_insert_flush decides that a command does not need to use the flush state machine, return false and let blk_mq_submit_bio handle it the normal way (including using an I/O scheduler) instead of doing a bypass insert. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230519044050.107790-4-hch@lst.de Signed-off-by: Jens Axboe commit c1075e548ce6e6b5c7b71f2b05d344164ebc52bb Author: Christoph Hellwig Date: Fri May 19 06:40:45 2023 +0200 blk-mq: reflow blk_insert_flush Use a switch statement to decide on the disposition of a flush request instead of multiple if statements, out of which one does checks that are more complex than required. Also warn on a malformed request early on instead of doing a BUG_ON later. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Bart Van Assche Link: https://lore.kernel.org/r/20230519044050.107790-3-hch@lst.de Signed-off-by: Jens Axboe commit 0b573692f19501dfe2aeaf37b272ec07f60c70b9 Author: Christoph Hellwig Date: Fri May 19 06:40:44 2023 +0200 blk-mq: factor out a blk_rq_init_flush helper Factor out a helper from blk_insert_flush that initializes the flush machine related fields in struct request, and don't bother with the full memset as there's just a few fields to initialize, and all but one already have explicit initializers. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Bart Van Assche Link: https://lore.kernel.org/r/20230519044050.107790-2-hch@lst.de Signed-off-by: Jens Axboe commit bda2795a630b2f6c417675bfbf4d90ef7503dfc7 Author: Christoph Hellwig Date: Mon May 8 07:44:05 2023 -0700 fs: remove the special !CONFIG_BLOCK def_blk_fops def_blk_fops always returns -ENODEV, which dosn't match the return value of a non-existing block device with CONFIG_BLOCK, which is -ENXIO. Just remove the extra implementation and fall back to the default no_open_fops that always returns -ENXIO. Fixes: 9361401eb761 ("[PATCH] BLOCK: Make it possible to disable the block layer [try #6]") Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230508144405.41792-1-hch@lst.de Signed-off-by: Jens Axboe commit c96dac8d369ffd713a45f4e5c30f23c47a1671f0 Author: Aditi Ghag Date: Fri May 19 22:51:53 2023 +0000 bpf: udp: Implement batching for sockets iterator Batch UDP sockets from BPF iterator that allows for overlapping locking semantics in BPF/kernel helpers executed in BPF programs. This facilitates BPF socket destroy kfunc (introduced by follow-up patches) to execute from BPF iterator programs. Previously, BPF iterators acquired the sock lock and sockets hash table bucket lock while executing BPF programs. This prevented BPF helpers that again acquire these locks to be executed from BPF iterators. With the batching approach, we acquire a bucket lock, batch all the bucket sockets, and then release the bucket lock. This enables BPF or kernel helpers to skip sock locking when invoked in the supported BPF contexts. The batching logic is similar to the logic implemented in TCP iterator: https://lore.kernel.org/bpf/20210701200613.1036157-1-kafai@fb.com/. Suggested-by: Martin KaFai Lau Signed-off-by: Aditi Ghag Link: https://lore.kernel.org/r/20230519225157.760788-6-aditi.ghag@isovalent.com Signed-off-by: Martin KaFai Lau commit e4fe1bf13e09019578b9b93b942fff3d76ed5793 Author: Aditi Ghag Date: Fri May 19 22:51:52 2023 +0000 udp: seq_file: Remove bpf_seq_afinfo from udp_iter_state This is a preparatory commit to remove the field. The field was previously shared between proc fs and BPF UDP socket iterators. As the follow-up commits will decouple the implementation for the iterators, remove the field. As for BPF socket iterator, filtering of sockets is exepected to be done in BPF programs. Suggested-by: Martin KaFai Lau Signed-off-by: Aditi Ghag Link: https://lore.kernel.org/r/20230519225157.760788-5-aditi.ghag@isovalent.com Signed-off-by: Martin KaFai Lau commit 7625d2e9741c1f6e08ee79c28a1e27bbb5071805 Author: Aditi Ghag Date: Fri May 19 22:51:51 2023 +0000 bpf: udp: Encapsulate logic to get udp table This is a preparatory commit that encapsulates the logic to get udp table in iterator inside udp_get_table_afinfo, and renames the function to `udp_get_table_seq` accordingly. Suggested-by: Martin KaFai Lau Signed-off-by: Aditi Ghag Link: https://lore.kernel.org/r/20230519225157.760788-4-aditi.ghag@isovalent.com Signed-off-by: Martin KaFai Lau commit f44b1c515833c59701c86f92d47b4edd478fb0f3 Author: Aditi Ghag Date: Fri May 19 22:51:50 2023 +0000 udp: seq_file: Helper function to match socket attributes This is a preparatory commit to refactor code that matches socket attributes in iterators to a helper function, and use it in the proc fs iterator. Signed-off-by: Aditi Ghag Link: https://lore.kernel.org/r/20230519225157.760788-3-aditi.ghag@isovalent.com Signed-off-by: Martin KaFai Lau commit 9378096e8a656fb5c4099b26b1370c56f056eab9 Author: Aditi Ghag Date: Fri May 19 22:51:49 2023 +0000 bpf: tcp: Avoid taking fast sock lock in iterator This is a preparatory commit to replace `lock_sock_fast` with `lock_sock`,and facilitate BPF programs executed from the TCP sockets iterator to be able to destroy TCP sockets using the bpf_sock_destroy kfunc (implemented in follow-up commits). Previously, BPF TCP iterator was acquiring the sock lock with BH disabled. This led to scenarios where the sockets hash table bucket lock can be acquired with BH enabled in some path versus disabled in other. In such situation, kernel issued a warning since it thinks that in the BH enabled path the same bucket lock *might* be acquired again in the softirq context (BH disabled), which will lead to a potential dead lock. Since bpf_sock_destroy also happens in a process context, the potential deadlock warning is likely a false alarm. Here is a snippet of annotated stack trace that motivated this change: ``` Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&h->lhash2[i].lock); local_bh_disable(); lock(&h->lhash2[i].lock); kernel imagined possible scenario: local_bh_disable(); /* Possible softirq */ lock(&h->lhash2[i].lock); *** Potential Deadlock *** process context: lock_acquire+0xcd/0x330 _raw_spin_lock+0x33/0x40 ------> Acquire (bucket) lhash2.lock with BH enabled __inet_hash+0x4b/0x210 inet_csk_listen_start+0xe6/0x100 inet_listen+0x95/0x1d0 __sys_listen+0x69/0xb0 __x64_sys_listen+0x14/0x20 do_syscall_64+0x3c/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc bpf_sock_destroy run from iterator: lock_acquire+0xcd/0x330 _raw_spin_lock+0x33/0x40 ------> Acquire (bucket) lhash2.lock with BH disabled inet_unhash+0x9a/0x110 tcp_set_state+0x6a/0x210 tcp_abort+0x10d/0x200 bpf_prog_6793c5ca50c43c0d_iter_tcp6_server+0xa4/0xa9 bpf_iter_run_prog+0x1ff/0x340 ------> lock_sock_fast that acquires sock lock with BH disabled bpf_iter_tcp_seq_show+0xca/0x190 bpf_seq_read+0x177/0x450 ``` Also, Yonghong reported a deadlock for non-listening TCP sockets that this change resolves. Previously, `lock_sock_fast` held the sock spin lock with BH which was again being acquired in `tcp_abort`: ``` watchdog: BUG: soft lockup - CPU#0 stuck for 86s! [test_progs:2331] RIP: 0010:queued_spin_lock_slowpath+0xd8/0x500 Call Trace: _raw_spin_lock+0x84/0x90 tcp_abort+0x13c/0x1f0 bpf_prog_88539c5453a9dd47_iter_tcp6_client+0x82/0x89 bpf_iter_run_prog+0x1aa/0x2c0 ? preempt_count_sub+0x1c/0xd0 ? from_kuid_munged+0x1c8/0x210 bpf_iter_tcp_seq_show+0x14e/0x1b0 bpf_seq_read+0x36c/0x6a0 bpf_iter_tcp_seq_show lock_sock_fast __lock_sock_fast spin_lock_bh(&sk->sk_lock.slock); /* * Fast path return with bottom halves disabled and * sock::sk_lock.slock held.* */ ... tcp_abort local_bh_disable(); spin_lock(&((sk)->sk_lock.slock)); // from bh_lock_sock(sk) ``` With the switch to `lock_sock`, it calls `spin_unlock_bh` before returning: ``` lock_sock lock_sock_nested spin_lock_bh(&sk->sk_lock.slock); : spin_unlock_bh(&sk->sk_lock.slock); ``` Acked-by: Yonghong Song Acked-by: Stanislav Fomichev Signed-off-by: Aditi Ghag Link: https://lore.kernel.org/r/20230519225157.760788-2-aditi.ghag@isovalent.com Signed-off-by: Martin KaFai Lau commit d54fbea3bbbe04cdc944db94eb11c8bda30438b8 Author: Dmitry Baryshkov Date: Wed May 17 13:28:07 2023 +0300 drm/display/dsc: add YCbCr 4:2:2 and 4:2:0 RC parameters Include RC parameters for YCbCr 4:2:2 and 4:2:0 configurations. Reviewed-by: Suraj Kandpal Signed-off-by: Dmitry Baryshkov Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230517102807.2181589-9-dmitry.baryshkov@linaro.org Acked-by: Dave Airlie commit 3b292112f075db4810a556c4538b772e655fd4e6 Author: Dmitry Baryshkov Date: Wed May 17 13:28:06 2023 +0300 drm/display/dsc: include the rest of pre-SCR parameters DSC model contains pre-SCR RC parameters for other bpp/bpc combinations, include them here for completeness. The values were generated from the 'pre_scr_cfg_files_for_reference' files found in DSC models 20210623. The same fileset is a part of DSC model 20161212. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230517102807.2181589-8-dmitry.baryshkov@linaro.org Acked-by: Dave Airlie commit e3290f883127159e3aa7957f30bd4266602d403e Author: Dmitry Baryshkov Date: Wed May 17 13:28:05 2023 +0300 drm/display/dsc: split DSC 1.2 and DSC 1.1 (pre-SCR) parameters The array of rc_parameters contains a mixture of parameters from DSC 1.1 and DSC 1.2 standards. Split these tow configuration arrays in preparation to adding more configuration data. Signed-off-by: Dmitry Baryshkov Reviewed-by: Suraj Kandpal Reviewed-by: Suraj Kandpal Reviewed-by: Suraj Kandpal Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230517102807.2181589-7-dmitry.baryshkov@linaro.org Acked-by: Dave Airlie commit 74fe874cf1407d4731f0a2c713d31ac78a5b32bd Author: Dmitry Baryshkov Date: Wed May 17 13:28:04 2023 +0300 drm/display/dsc: use flat array for rc_parameters lookup Next commits are going to add support for additional RC parameter lookup tables. These tables are going to use different bpp/bpc combinations, thus it makes little sense to keep the 2d array for RC parameters. Switch to using the flat array. Reviewed-by: Jani Nikula Signed-off-by: Dmitry Baryshkov Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230517102807.2181589-6-dmitry.baryshkov@linaro.org Acked-by: Dave Airlie commit 9ff6b5256de3843ee6a2ee91737554d96852963d Author: Dmitry Baryshkov Date: Wed May 17 13:28:03 2023 +0300 drm/i915/dsc: stop using interim structure for calculated params Stop using an interim structure rc_parameters for storing calculated params and then setting drm_dsc_config using that structure. Instead put calculated params into the struct drm_dsc_config directly. Reviewed-by: Jani Nikula Signed-off-by: Dmitry Baryshkov Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230517102807.2181589-5-dmitry.baryshkov@linaro.org commit 2b470e5531f57c1b9bfa129cca0ee17a2ecd2183 Author: Dmitry Baryshkov Date: Wed May 17 13:28:02 2023 +0300 drm/i915/dsc: move DSC tables to DRM DSC helper Move DSC RC tables to DRM DSC helper. No additional code changes and/or cleanups are a part of this commit, it will be cleaned up in the followup commits. Reviewed-by: Jani Nikula Signed-off-by: Dmitry Baryshkov Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230517102807.2181589-4-dmitry.baryshkov@linaro.org Acked-by: Dave Airlie commit 169219213c144abf0f2cc86886df218159dbe4b7 Author: Dmitry Baryshkov Date: Wed May 17 13:28:01 2023 +0300 drm/i915/dsc: move rc_buf_thresh values to common helper The rc_buf_thresh values are common to all DSC implementations. Move them to the common helper together with the code to propagate them to the drm_dsc_config. Reviewed-by: Jani Nikula Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230517102807.2181589-3-dmitry.baryshkov@linaro.org Acked-by: Dave Airlie commit a8c4b36ecac1d71bfde8d1f64a30ce694c4fc44d Author: Dmitry Baryshkov Date: Wed May 17 13:28:00 2023 +0300 drm/i915/dsc: change DSC param tables to follow the DSC model After cross-checking DSC models (20150914, 20161212, 20210623) change values in rc_parameters tables to follow config files present inside the DSC model. Handle two places, where i915 tables diverged from the model, by patching the rc values in the code. Note: I left one case uncorrected, 8bpp/10bpc/range_max_qp[0], because the table in the VESA DSC 1.1 sets it to 4. Reviewed-by: Jani Nikula Signed-off-by: Dmitry Baryshkov Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230517102807.2181589-2-dmitry.baryshkov@linaro.org commit 25553494b275a1a4cf06e4a7aa4073817cb2b846 Author: Cong Liu Date: Wed May 17 13:02:03 2023 +0800 drm/i915: Fix memory leaks in function live_nop_switch Be sure to properly free the allocated memory before exiting the live_nop_switch function. Signed-off-by: Cong Liu Suggested-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230517050204.4111874-1-liucong2@kylinos.cn commit 3af0356c162c299a8216576b644eb72715e97cb2 Author: Jens Axboe Date: Fri May 19 09:51:31 2023 -0600 io_uring: maintain ordering for DEFER_TASKRUN tw list We use lockless lists for the local and deferred task_work, which means that when we queue up events for processing, we ultimately process them in reverse order to how they were received. This usually doesn't matter, but for some cases, it does seem to make a big difference. Do the right thing and reverse the list before processing it, so that we know it's processed in the same order in which it was received. This makes a rather big difference for some medium load network tests, where consistency of performance was a bit all over the place. Here's a case that has 4 connections each doing two sends and receives: io_uring port=10002: rps:161.13k Bps: 1.45M idle=256ms io_uring port=10002: rps:107.27k Bps: 0.97M idle=413ms io_uring port=10002: rps:136.98k Bps: 1.23M idle=321ms io_uring port=10002: rps:155.58k Bps: 1.40M idle=268ms and after the change: io_uring port=10002: rps:205.48k Bps: 1.85M idle=140ms user=40ms io_uring port=10002: rps:203.57k Bps: 1.83M idle=139ms user=20ms io_uring port=10002: rps:218.79k Bps: 1.97M idle=106ms user=30ms io_uring port=10002: rps:217.88k Bps: 1.96M idle=110ms user=20ms io_uring port=10002: rps:222.31k Bps: 2.00M idle=101ms user=0ms io_uring port=10002: rps:218.74k Bps: 1.97M idle=102ms user=20ms io_uring port=10002: rps:208.43k Bps: 1.88M idle=125ms user=40ms using more of the time to actually process work rather than sitting idle. No effects have been observed at the peak end of the spectrum, where performance is still the same even with deep batch depths (and hence more items to sort). Signed-off-by: Jens Axboe commit fa578bf50e0b52fe0489480c0e311683cd60ffb6 Author: Hans de Goede Date: Tue May 9 14:41:00 2023 +0200 ACPI: LPSS: Add pwm_lookup_table entry for second PWM on CHT/BSW devices BSW PWM2 is used for backlight control for fixed (etched into the glass) touch controls on some models. Add an entry for the second PWM controller to bsw_pwm_lookup, so that drivers can use pwm_get() to get a reference to it. These touch-controls have specialized drivers which bind to different devices on different models, so the consumer-device-name in the lookup table entry is set to NULL, so that only con-id matching is used. The con-id is set to "pwm_soc_lpss_2" which describes the PWM controller rather than the usual approach of describing its function. The specialized (model specific) drivers which need access to the PWM controller know they need the "pwm_soc_lpss_2" con-id. Reviewed-by: Andy Shevchenko Acked-by: Uwe Kleine-König Signed-off-by: Hans de Goede Reviewed-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki commit e45076007e358ff1e934ab009cf68ee723f6f1fd Author: Chunfeng Yun Date: Sat May 13 17:22:18 2023 +0800 phy: mediatek: tphy: add debugfs files These debugfs files are mainly used to make eye diagram test easier, especially helpful to do HQA test for a new IC without efuse enabled. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20230513092218.21139-2-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 91694772067203a554354a08bfad294b81fff5ad Author: Chunfeng Yun Date: Sat May 13 17:22:17 2023 +0800 phy: core: add debugfs files Add a debugfs root for phy class, and create a debugfs directory under the root when create phy, then phy drivers can add debugfs files. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20230513092218.21139-1-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit f5d87b47a1d9dc14c048c84935397d97833ac706 Author: Roi Dayan Date: Sun Apr 23 13:39:57 2023 +0300 net/mlx5e: E-Switch, Initialize E-Switch for eswitch manager Initialize eswitch instance for a function which is eswitch manager but not a vport group manager. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 0279b5454c0e8344f30fcac90db76cf17b6b76c7 Author: Roi Dayan Date: Tue May 2 12:44:47 2023 +0300 net/mlx5: devlink, Only show PF related devlink warning when needed Limit the PF related warning to show if device is actually a PF. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 7eb197fd83a355214346feddd55fe3336125953f Author: Roi Dayan Date: Mon Apr 24 12:15:54 2023 +0300 net/mlx5: E-Switch, Use metadata matching for RoCE loopback rule Use metadata matching for RoCE loopback rule if device is configured to use metadata for source port matching. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 63c85ad0cd811ed43653a5e17b7c4172ad1bb023 Author: Li Jun Date: Tue May 16 18:20:20 2023 +0200 phy: fsl-imx8mp-usb: add support for phy tuning Add USB PHY parameter tuning for USB certifications. Reviewed-by: Haibo Chen Signed-off-by: Li Jun [j.zink: ported to v6.3-rc1 from NXP downstream repo + cleanups] Signed-off-by: Johannes Zink Link: https://lore.kernel.org/r/20230516-lustige-usb-phy-dinge-v2-2-3383a0de34ac@pengutronix.de Signed-off-by: Vinod Koul commit c24246d07a942887fb62cd76229c89efdee6d948 Author: Roi Dayan Date: Mon Apr 24 12:11:13 2023 +0300 net/mlx5: E-Switch, Use RoCE version 2 for loopback traffic Could be port initializing eswitch doesn't support RoCE version 1 but all ports should support RoCE version 2. Signed-off-by: Roi Dayan Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit b2e75563dc3926ff6ec7344ada456758340ef37b Author: Johannes Zink Date: Tue May 16 18:20:19 2023 +0200 dt-bindings: phy: imx8mq-usb: add phy tuning properties Add optional properties for tuning of usb phy. Signed-off-by: Johannes Zink Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230516-lustige-usb-phy-dinge-v2-1-3383a0de34ac@pengutronix.de Signed-off-by: Vinod Koul commit 3d7c5f78b8cef1376de95443632212f9042d7e78 Author: Roi Dayan Date: Thu Apr 20 12:19:25 2023 +0300 net/mlx5e: E-Switch, Add a check that log_max_l2_table is valid If log_max_l2_table is 0 there is no really room for one L2 address. and should be treated as not supported. Do the check in MPFS init and for vport context events which both used to update L2 address. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 292243d13b1821434599fef7b4ea62110ea771c1 Author: Roi Dayan Date: Sun Apr 23 15:24:00 2023 +0300 net/mlx5e: E-Switch: move debug print of adding mac to correct place Move the debug print inside the if clause that actually does the change. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit bea416c7e970399b438b801a9f3ffa24c4ddf855 Author: Roi Dayan Date: Sun Apr 23 10:53:18 2023 +0300 net/mlx5e: E-Switch, Check device is PF when stopping esw offloads Checking sriov is done on the pci device so it can return true on other devices like SF but nothing should be done in this case. Add a check that the device is PF. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 6cb9318a2534b7081eb9f375a720972f811665f6 Author: Roi Dayan Date: Thu Apr 20 12:14:41 2023 +0300 net/mlx5: Remove redundant vport_group_manager cap check It's enough to check for esw_manager cap for get the esw flow table caps. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 29bcb6e4fe7072ccea2a1c8b357ffd8e88f334bb Author: Roi Dayan Date: Sun Apr 2 13:59:08 2023 +0300 net/mlx5e: E-Switch, Use metadata for vport matching in send-to-vport rules Like other rules use metadata matching if supported instead of source_port. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 99db5669f6635a9719beb2e78ebf5887cde03a26 Author: Roi Dayan Date: Sun Apr 2 14:19:54 2023 +0300 net/mlx5e: E-Switch, Allow get vport api if esw exists We could have an esw manager device which is not a vport group manager. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit c97c9fe48ae3ccca75fb6001a3bd2bfcb094dbd7 Author: Roi Dayan Date: Sun Apr 2 14:13:25 2023 +0300 net/mlx5e: E-Switch, Update when to set other vport context Other vport context should be set if vport number is not 0. In case of ECPF, vport 0 represents the host PF representor so also need to set other vport context. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 806815bf3c1d885e686ddc0e75d941078dcf56ae Author: Roi Dayan Date: Thu Mar 30 12:25:25 2023 +0300 net/mlx5e: Remove redundant __func__ arg from fs_err() calls fs_err() already logs the function name. remote the arg so the function name will not be logged twice. Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed commit edab80b89337b826566ff7fdbbc8ae2dcfb22fee Author: Roi Dayan Date: Tue Jan 31 12:06:45 2023 +0200 net/mlx5e: E-Switch, Remove flow_source check for metadata matching There is no reason to check for flow_source cap to allow metadata matching. When flow_source match is being used the flow_source cap is being checked. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 2abe501751ed8dbd390be5c2f8d51125e3662814 Author: Roi Dayan Date: Thu Mar 23 10:01:38 2023 +0200 net/mlx5: E-Switch, Remove redundant check The call to mlx5_eswitch_enable() also does the same check and if E-Switch not supported it returns 0 without any change. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit c511822fe2c96478d86b6bc3404bb45ebad7556b Author: Roi Dayan Date: Wed Mar 22 13:27:43 2023 +0200 net/mlx5: Remove redundant esw multiport validate function The function didn't validate the value and doesn't require value validation as it will always be valid true or false values. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 1904c3f578dce06760160cc5b728c960cd7db633 Author: Bjorn Andersson Date: Sun May 14 20:27:41 2023 -0700 phy: qcom-qmp-combo: Introduce drm_bridge The QMP combo PHY sits in an of_graph connected between the DisplayPort controller and a USB Type-C connector (or possibly a redriver). The TCPM needs to be able to convey the HPD signal to the DisplayPort controller, but no directly link is provided by DeviceTree so the signal needs to "pass through" the QMP combo phy. Handle this by introducing a drm_bridge which upon initialization finds the next bridge (i.e. the usb-c-connector) and chain this together. This way HPD changes in the connector will propagate to the DisplayPort driver. The connector bridge is resolved lazily, as the TCPM is expected to be able to resolve the typec mux and switch at probe time, so the QMP combo phy will probe before the TCPM. Acked-by: Neil Armstrong Tested-by: Bryan O'Donoghue Reviewed-by: Bryan O'Donoghue Tested-by: Abel Vesa Tested-by: Steev Klimaszewski Tested-by: Neil Armstrong # on HDK8450 Tested-by: Johan Hovold # X13s Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515032743.400170-7-quic_bjorande@quicinc.com Signed-off-by: Vinod Koul commit 2851117f8f4218043e4c05d24494fee66e932cbe Author: Bjorn Andersson Date: Sun May 14 20:27:40 2023 -0700 phy: qcom-qmp-combo: Introduce orientation switching The data lanes of the QMP PHY is swapped in order to handle changing orientation of the USB Type-C cable. Register a typec_switch device to allow a TCPM to configure the orientation. The newly introduced orientation variable is adjusted based on the request, and the initialized components are brought down and up again. To keep track of what parts needs to be cycled new variables to keep track of the individual init_count is introduced. Both the USB and the DisplayPort altmode signals are properly switched. For DisplayPort the controller will after the TCPM having established orientation power on the PHY, so this is not done implicitly, but for USB the PHY typically is kept initialized across the switch, and must therefore then be reinitialized. This is based on initial work by Wesley Cheng. Link: https://lore.kernel.org/r/20201009082843.28503-3-wcheng@codeaurora.org/ Reviewed-by: Johan Hovold Reviewed-by: Neil Armstrong Tested-by: Abel Vesa Tested-by: Steev Klimaszewski Tested-by: Neil Armstrong # on HDK8450 Tested-by: Johan Hovold # X13s Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515032743.400170-6-quic_bjorande@quicinc.com Signed-off-by: Vinod Koul commit 815891eee668795deea07f5d1eb43e0d6089c930 Author: Bjorn Andersson Date: Sun May 14 20:27:39 2023 -0700 phy: qcom-qmp-combo: Introduce orientation variable In multiple places throughout the driver code has been written in prepration for handling of orientation switching. Introduce a typec_orientation in qmp_combo and fill out the various "placeholders" with the associated logic. By initializing the orientation to "normal" this change has no functional impact, but reduces the size of the upcoming introduction of dynamic orientation switching. Reviewed-by: Neil Armstrong Tested-by: Abel Vesa Tested-by: Steev Klimaszewski Tested-by: Neil Armstrong # on HDK8450 Tested-by: Johan Hovold # X13s Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515032743.400170-5-quic_bjorande@quicinc.com Signed-off-by: Vinod Koul commit 77cbca3a12d3b9501973bdecd28f28b5c2184bf2 Author: Bjorn Andersson Date: Sun May 14 20:27:38 2023 -0700 phy: qcom-qmp-combo: Extend phy_mutex to all phy_ops The phy core ensures mutual exclusion across the ops for a given phy, but the upcoming introduction of USB Type-C orientation switching might race with the DisplayPort phy operations. So extend the mutual exclusion to cover the remaining ops as well, to avoid concurrent reconfiguration of the hardware. Reported-by: Johan Hovold Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515032743.400170-4-quic_bjorande@quicinc.com Signed-off-by: Vinod Koul commit 02545aa31008e1f4fb6875cdd13c415ddf95a24c Author: Bjorn Andersson Date: Sun May 14 20:27:37 2023 -0700 phy: qcom-qmp-combo: Move phy_mutex out of com_init/exit With the upcoming introduction of USB Type-C orientation switching the region of mutual exclusion needs to be extended to cover both the common init/exit as well as the individual functions. So move the phy_mutex one step up the stack. Reviewed-by: Johan Hovold Tested-by: Abel Vesa Tested-by: Steev Klimaszewski Tested-by: Neil Armstrong # on HDK8450 Tested-by: Johan Hovold # X13s Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515032743.400170-3-quic_bjorande@quicinc.com Signed-off-by: Vinod Koul commit 6c0237db15fa26eccafb4c875ff0e70b11f9322f Author: Bjorn Andersson Date: Sun May 14 20:27:36 2023 -0700 dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp: Add ports and orientation-switch The QMP combo phy can be connected to a TCPM, a USB controller and a DisplayPort controller for handling USB Type-C orientation switching and propagating HPD signals. Extend the binding to allow these connections to be described. Tested-by: Abel Vesa Tested-by: Steev Klimaszewski Tested-by: Neil Armstrong # on HDK8450 Tested-by: Johan Hovold # X13s Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515032743.400170-2-quic_bjorande@quicinc.com Signed-off-by: Vinod Koul commit 940797d6d53fb5ce2f83b3fa56dd47a66ee912a4 Merge: afa92949124ab 2a881183dc5ab Author: Vinod Koul Date: Fri May 19 23:16:43 2023 +0530 Merge branch 'fixes' into next This brings in the Qcom qmp patch fixes into next as well commit afa92949124abc25ddab1789dd654214e2e1b040 Author: Frank Li Date: Wed May 17 12:16:46 2023 -0400 dt-bindings: phy: cdns,salvo: add property cdns,usb2-disconnect-threshold-microvolt Add cdns,usb2-disconnect-threshold-microvolt property to address fake USB disconnection issue during enumeration or suspend state for difference platform. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20230517161646.3418250-7-Frank.Li@nxp.com Signed-off-by: Vinod Koul commit e8c3336134cbef4cc88c25c3e245683ccd6a69bb Author: Frank Li Date: Wed May 17 12:16:45 2023 -0400 phy: cadence: salvo: Add cdns,usb2-disconnect-threshold-microvolt property Add cdns,usb2-disconnect-threshold-microvolt property to address fake USB disconnection issue during enumeration or suspend state for difference platform. Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20230517161646.3418250-6-Frank.Li@nxp.com Signed-off-by: Vinod Koul commit 3ad5cebe9c3a53bc3204816d1425f92b387d32b1 Author: Peter Chen Date: Wed May 17 12:16:44 2023 -0400 phy: cadence: salvo: add .set_mode API For NXP platform design, the PHY can't know VBUS well, it causes the FSM in controller seeing the disconnection at L1 use case. With .set_mode API introduced, the controller driver could force PHY seeing B Session VALID when it is at the device mode (VBUS is there), and keep FSM working well. Signed-off-by: Peter Chen Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20230517161646.3418250-5-Frank.Li@nxp.com Signed-off-by: Vinod Koul commit fe5516651e19f1d4d2e239e142e51320e2b2c18c Author: Peter Chen Date: Wed May 17 12:16:43 2023 -0400 phy: cadence: salvo: add bist fix Very limited parts may fail to work on full speed mode (both host and device modes) for USB3 port due to higher threshold in full speed receiver of USB2.0 PHY. One example failure symptom is, the enumeration is failed when connecting full speed USB mouse to USB3 port, especially under high temperature. The workaround is to configure threshold voltage value of single ended receiver by setting USB2.0 PHY register AFE_RX_REG5[2:0] to 3'b101. Signed-off-by: Peter Chen Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20230517161646.3418250-4-Frank.Li@nxp.com Signed-off-by: Vinod Koul commit 1492498d1301760e1d0fa21691354df9ad86bb4b Author: Peter Chen Date: Wed May 17 12:16:42 2023 -0400 phy: cadence: salvo: decrease delay value to zero for txvalid For USB2 L1 use cases, some hosts may start transferring less than 20us after End of Resume, it causes the host seeing corrupt packet from the device side. The reason is the delay time between PHY powers up and txvalid is 20us. To fix it, we change the delay value as 0us. Signed-off-by: Peter Chen Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20230517161646.3418250-3-Frank.Li@nxp.com Signed-off-by: Vinod Koul commit 88bc4cda5e27a63061d83ba031bc69526180c3a1 Author: Peter Chen Date: Wed May 17 12:16:41 2023 -0400 phy: cadence: salvo: add access for USB2PHY There is an offset for USB2PHY in SALVO phy, add offset parameter for read and write API to cover both USB2 and USB3 PHY control. Signed-off-by: Peter Chen Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20230517161646.3418250-2-Frank.Li@nxp.com Signed-off-by: Vinod Koul commit 3bc7fb9ac9307583f11c991ae72369499a604621 Author: Marijn Suijten Date: Wed Apr 12 00:43:08 2023 +0200 MAINTAINERS: Add Marijn Suijten as drm/msm reviewer As I get more and more active in the drm/msm space, yet sometimes miss out on patches (where I was involved in previous discussions), add myself as reviewer to make this involvement clear. Signed-off-by: Marijn Suijten Acked-by: Dmitry Baryshkov Acked-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/531770/ Link: https://lore.kernel.org/r/20230411224308.440550-1-marijn.suijten@somainline.org Signed-off-by: Dmitry Baryshkov commit 234fcb978f61f53bc05c276f6204332fde2b4951 Author: Clint Taylor Date: Mon May 15 16:17:25 2023 -0700 drm/i915/hdmi: C20 computed PLL frequencies Use algorithm to generate HDMI C20 PLL clock frequencies. v2: checkpatch fixes BSPEC: 64568 Cc: Radhakrishna Sripada Cc: Mika Kahola Cc: Anusha Srivatsa Reviewed-by: Gustavo Sousa Signed-off-by: Clint Taylor [mattrope: Wrapped one overly long line] Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230515231725.3815199-3-clinton.a.taylor@intel.com commit 9343184cb31fef673566ff37c41a9f418deb9de3 Merge: effcf62416240 d7e45eb4802bb Author: Alexei Starovoitov Date: Fri May 19 10:06:45 2023 -0700 Merge branch 'bpf: Show target_{obj,btf}_id for tracing link' Yafang Shao says: ==================== The target_btf_id can help us understand which kernel function is linked by a tracing prog. The target_btf_id and target_obj_id have already been exposed to userspace, so we just need to show them. For some other link types like perf_event and kprobe_multi, it is not easy to find which functions are attached either. We may support ->fill_link_info for them in the future. v1->v2: - Skip showing them in the plain output for the old kernels. (Quentin) - Coding improvement. (Andrii) ==================== Signed-off-by: Alexei Starovoitov commit d7e45eb4802bbb3343624711e43d23b22fe7cc55 Author: Yafang Shao Date: Wed May 17 10:31:26 2023 +0000 bpftool: Show target_{obj,btf}_id in tracing link info The target_btf_id can help us understand which kernel function is linked by a tracing prog. The target_btf_id and target_obj_id have already been exposed to userspace, so we just need to show them. The result as follows, $ tools/bpf/bpftool/bpftool link show 2: tracing prog 13 prog_type tracing attach_type trace_fentry target_obj_id 1 target_btf_id 13964 pids trace(10673) $ tools/bpf/bpftool/bpftool link show -j [{"id":2,"type":"tracing","prog_id":13,"prog_type":"tracing","attach_type":"trace_fentry","target_obj_id":1,"target_btf_id":13964,"pids":[{"pid":10673,"comm":"trace"}]}] Signed-off-by: Yafang Shao Acked-by: Song Liu Link: https://lore.kernel.org/r/20230517103126.68372-3-laoar.shao@gmail.com Signed-off-by: Alexei Starovoitov commit e859e429511afb21d3f784bd0ccdf500d40b73ef Author: Yafang Shao Date: Wed May 17 10:31:25 2023 +0000 bpf: Show target_{obj,btf}_id in tracing link fdinfo The target_btf_id can help us understand which kernel function is linked by a tracing prog. The target_btf_id and target_obj_id have already been exposed to userspace, so we just need to show them. The result as follows, $ cat /proc/10673/fdinfo/10 pos: 0 flags: 02000000 mnt_id: 15 ino: 2094 link_type: tracing link_id: 2 prog_tag: a04f5eef06a7f555 prog_id: 13 attach_type: 24 target_obj_id: 1 target_btf_id: 13964 Signed-off-by: Yafang Shao Acked-by: Song Liu Link: https://lore.kernel.org/r/20230517103126.68372-2-laoar.shao@gmail.com Signed-off-by: Alexei Starovoitov commit cb7b04c83e9006c39af6d806761fc628573920e8 Author: Clint Taylor Date: Mon May 15 16:17:24 2023 -0700 drm/i915: Add 16bit register/mask operators Add the support macros to define/extract bits as 16bits. v2: checkpatch fixes Reviewed-by: Gustavo Sousa Signed-off-by: Clint Taylor Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230515231725.3815199-2-clinton.a.taylor@intel.com commit 5a7a86bfa2cd79c80e4f3bdb01feb15edd08b92b Author: Dmitry Baryshkov Date: Sat Apr 15 20:19:25 2023 +0300 drm/msm/dpu: simplify intf allocation code Rather than passing DRM_MODE_ENCODER_* and letting dpu_encoder to guess, which intf type we mean, pass INTF_DSI/INTF_DP directly. This is required to support HDMI output in DPU, as both DP and HDMI encoders are DRM_MODE_ENCODER_TMDS. Thus dpu_encoder code can not make a difference between HDMI and DP outputs. Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Reviewed-by: Arnaud Vrac Tested-by: Arnaud Vrac Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/532370/ Link: https://lore.kernel.org/r/20230415171926.85774-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 23bdc972daf436412d55ad7fb2f1bf430a001ffd Author: Dmitry Baryshkov Date: Sat Apr 8 03:27:50 2023 +0300 drm/msm/dpu: use CTL_SC7280_MASK for sm8450's ctl_0 On sm8450 platform the CTL_0 doesn't differ from the rest of CTL blocks, so switch it to CTL_SC7280_MASK too. Some background: original commit 100d7ef6995d ("drm/msm/dpu: add support for SM8450") had all (relevant at that time) bit spelled individually. Then commit 0e91bcbb0016 ("drm/msm/dpu: Add SM8350 to hw catalog"), despite being a mismerge, correctly changed all other CTL entries to use CTL_SC7280_MASK, except CTL_0. While the current BLOCK_SOC_MASK style is not ideal (and while we are working on a better scheme), let's follow its usage as a least minimal surprise. For example, sc8280xp, a close associate of sm8450, also uses CTL_SC7280_MASK. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/531493/ Link: https://lore.kernel.org/r/20230408002750.2722304-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit f5abecfe339e4d8183fbb208da674f4a49b7f722 Author: Dmitry Baryshkov Date: Sat Apr 8 03:27:49 2023 +0300 drm/msm/dpu: enable DSPP and DSC on sc8180x Enable DSPP and DSC hardware blocks on sc8180x platform. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/531490/ Link: https://lore.kernel.org/r/20230408002750.2722304-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 800d28a4988d842d11e95d3dea491520ebf4991d Author: Dmitry Baryshkov Date: Sat Apr 8 03:27:48 2023 +0300 drm/msm/dpu: enable DSPP_2/3 for LM_2/3 on sm8450 Mark DSPP_2 and DSPP_3 as used for LM_2 and LM_3 Fixes: 100d7ef6995d ("drm/msm/dpu: add support for SM8450") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/531491/ Link: https://lore.kernel.org/r/20230408002750.2722304-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit f26e0acc3e07ebec228503a995492925690380db Author: Dmitry Baryshkov Date: Sat Apr 8 03:27:47 2023 +0300 drm/msm/dpu: enable DPU_CTL_SPLIT_DISPLAY for sc8280xp Theoretically, since sm8150 we should be using a single CTL for the split panel case, but since we do not support it for now, fallback to DPU_CTL_SPLIT_DISPLAY. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/531489/ Link: https://lore.kernel.org/r/20230408002750.2722304-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 58fab79731db95776ff743035a06094bb528547d Author: Konrad Dybcio Date: Tue Mar 21 22:35:56 2023 +0100 dt-bindings: display: msm: sm8350-mdss: Fix DSI compatible The DSI compatible changed between patchset revisions, but that wasn't reflected in the bindings. Fix it. Fixes: 430e11f42bff ("dt-bindings: display: msm: Add qcom, sm8350-mdss binding") Signed-off-by: Konrad Dybcio Acked-by: Krzysztof Kozlowski Reviewed-by: David Heidelberg Patchwork: https://patchwork.freedesktop.org/patch/528037/ Link: https://lore.kernel.org/r/20230321213557.1737905-1-konrad.dybcio@linaro.org Signed-off-by: Dmitry Baryshkov commit 8c1ee346da583718fb0a7791a1f84bdafb103caf Author: Kalesh AP Date: Thu May 18 23:48:17 2023 -0700 RDMA/bnxt_re: Remove unnecessary checks The NULL check inside bnxt_qplib_del_sgid() and bnxt_qplib_add_sgid() always return false as the "sgid_tbl" inside "rdev->qplib_res" is a static memory. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Link: https://lore.kernel.org/r/1684478897-12247-8-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 07d5ce14b2aa22dc6a92f9769035281b68250d3e Author: Kalesh AP Date: Thu May 18 23:48:16 2023 -0700 RDMA/bnxt_re: Return directly without goto jumps When there is no cleanup to be done, return directly. This will help eliminating unnecessary local variables and goto labels. This patch fixes such occurrences in qplib_fp.c file. Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters") Fixes: 159fb4ceacd7 ("RDMA/bnxt_re: introduce a function to allocate swq") Link: https://lore.kernel.org/r/1684478897-12247-7-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 43774bc156614346fe5dacabc8e8c229167f2536 Author: Kalesh AP Date: Thu May 18 23:48:15 2023 -0700 RDMA/bnxt_re: Fix to remove an unnecessary log During destroy_qp, driver sets the qp handle in the existing CQEs belonging to the QP being destroyed to NULL. As a result, a poll_cq after destroy_qp can report unnecessary messages. Remove this noise from system logs. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Link: https://lore.kernel.org/r/1684478897-12247-6-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit b989f90cef0af48aa5679b6a75476371705ec53c Author: Kalesh AP Date: Thu May 18 23:48:14 2023 -0700 RDMA/bnxt_re: Remove a redundant check inside bnxt_re_update_gid The NULL check inside bnxt_re_update_gid() always return false. If sgid_tbl->tbl is not allocated, then dev_init would have failed. Fixes: 5fac5b1b297f ("RDMA/bnxt_re: Add vlan tag for untagged RoCE traffic when PFC is configured") Link: https://lore.kernel.org/r/1684478897-12247-5-git-send-email-selvin.xavier@broadcom.com Reviewed-by: Saravanan Vajravel Reviewed-by: Damodharam Ammepalli Reviewed-by: Ajit Khaparde Signed-off-by: Selvin Xavier Signed-off-by: Kalesh AP Signed-off-by: Jason Gunthorpe commit ff2e4bfd162cf66a112a81509e419805add44d64 Author: Kalesh AP Date: Thu May 18 23:48:13 2023 -0700 RDMA/bnxt_re: Use unique names while registering interrupts bnxt_re currently uses the names "bnxt_qplib_creq" and "bnxt_qplib_nq-0" while registering IRQs. There is no way to distinguish the IRQs of different device ports when there are multiple IB devices registered. This could make the scenarios worse where one want to pin IRQs of a device port to certain CPUs. Fixed the code to use unique names which has PCI BDF information while registering interrupts like: "bnxt_re-nq-0@pci:0000:65:00.0" and "bnxt_re-creq@pci:0000:65:00.1". Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Link: https://lore.kernel.org/r/1684478897-12247-4-git-send-email-selvin.xavier@broadcom.com Reviewed-by: Bhargava Chenna Marreddy Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 9b3ee47796f529e5bc31a355d6cb756d68a7079a Author: Kalesh AP Date: Thu May 18 23:48:12 2023 -0700 RDMA/bnxt_re: Fix to remove unnecessary return labels If there is no cleanup needed then just return directly. This cleans up the code and improve readability. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Link: https://lore.kernel.org/r/1684478897-12247-3-git-send-email-selvin.xavier@broadcom.com Reviewed-by: Kashyap Desai Reviewed-by: Saravanan Vajravel Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit ab112ee7899d6171da5acd77a7ed7ae103f488de Author: Selvin Xavier Date: Thu May 18 23:48:11 2023 -0700 RDMA/bnxt_re: Disable/kill tasklet only if it is enabled When the ulp hook to start the IRQ fails because the rings are not available, tasklets are not enabled. In this case when the driver is unloaded, driver calls CREQ tasklet_kill. This causes an indefinite hang as the tasklet is not enabled. Driver shouldn't call tasklet_kill if it is not enabled. So using the creq->requested and nq->requested flags to identify if both tasklets/irqs are registered. Checking this flag while scheduling the tasklet from ISR. Also, added a cleanup for disabling tasklet, in case request_irq fails during start_irq. Check for return value for bnxt_qplib_rcfw_start_irq and in case the bnxt_qplib_rcfw_start_irq fails, return bnxt_re_start_irq without attempting to start NQ IRQs. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Link: https://lore.kernel.org/r/1684478897-12247-2-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 4f96bb37e645cafbfde2f6f40aabc5dcd188295d Author: Dmitry Baryshkov Date: Thu Feb 9 15:38:34 2023 +0200 dt-bindings: display/msm/gmu: add Adreno 660 support Add Adreno A660 to the A635 clause to define all version-specific properties. There is no need to add it to the top-level clause, since top-level compatible uses pattern to define compatible strings. Acked-by: Rob Herring Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/521835/ Link: https://lore.kernel.org/r/20230209133839.762631-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 0ef4479d13af4c5516920520d9cf7bcfe801b353 Author: Michal Swiatkowski Date: Fri Apr 7 18:52:19 2023 +0200 ice: use src VSI instead of src MAC in slow-path The use of a source MAC to direct packets from the VF to the corresponding port representor is only ok if there is only one MAC on a VF. To support this functionality when the number of MACs on a VF is greater, it is necessary to match a source VSI instead of a source MAC. Let's use the new switch API that allows matching on metadata. If MAC isn't used in match criteria there is no need to handle adding rule after virtchnl command. Instead add new rule while port representor is being configured. Remove rule_added field, checking for sp_rule can be used instead. Remove also checking for switchdev running in deleting rule as it can be called from unroll context when running flag isn't set. Checking for sp_rule covers both context (with and without running flag). Rules are added in eswitch configuration flow, so there is no need to have replay function. Signed-off-by: Michal Swiatkowski Reviewed-by: Piotr Raczynski Reviewed-by: Simon Horman Reviewed-by: Leon Romanovsky Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen commit 03592a14b9383bbe1c0d56e7ac4005cea10e711a Author: Michal Swiatkowski Date: Fri Apr 7 18:52:18 2023 +0200 ice: allow matching on meta data Add meta data matching criteria in the same place as protocol matching criteria. There is no need to add meta data as special words after parsing all lookups. Trade meta data in the same why as other lookups. The one difference between meta data lookups and protocol lookups is that meta data doesn't impact how the packets looks like. Because of that ignore it when filling testing packet. Match on tunnel type meta data always if tunnel type is different than TNL_LAST. Signed-off-by: Michal Swiatkowski Reviewed-by: Piotr Raczynski Reviewed-by: Simon Horman Reviewed-by: Leon Romanovsky Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen commit 17c6d8357da1ae6a5d92c15efe68f877c3e8b968 Author: Michal Swiatkowski Date: Fri Apr 7 18:52:17 2023 +0200 ice: specify field names in ice_prot_ext init Anonymous initializers are now discouraged. Define ICE_PROTCOL_ENTRY macro to rewrite anonymous initializers to named one. No functional changes here. Suggested-by: Alexander Lobakin Signed-off-by: Michal Swiatkowski Reviewed-by: Simon Horman Reviewed-by: Leon Romanovsky Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen commit 40fd749245f2ee32874e563051957cc614cf11e4 Author: Michal Swiatkowski Date: Fri Apr 7 18:52:16 2023 +0200 ice: remove redundant Rx field from rule info Information about the direction is currently stored in sw_act.flag. There is no need to duplicate it in another field. Setting direction flag doesn't mean that there is a match criteria for direction in rule. It is only a information for HW from where switch id should be collected (VSI or port). In current implementation of advance rule handling, without matching for direction meta data, we can always set one the same flag and everything will work the same. Ability to match on direction meta data will be added in follow up patches. Recipe 0, 3 and 9 loaded from package has direction match criteria, but they are handled in other function. Move ice_adv_rule_info fields to avoid holes. Signed-off-by: Michal Swiatkowski Reviewed-by: Piotr Raczynski Reviewed-by: Simon Horman Reviewed-by: Leon Romanovsky Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen commit 3655c5900f4d49881ad09e3893e5f5516b06a9f1 Author: Luben Tuikov Date: Wed May 17 19:35:50 2023 -0400 drm/sched: Rename to drm_sched_wakeup_if_can_queue() Rename drm_sched_wakeup() to drm_sched_wakeup_if_canqueue() since the former is misleading, as it wakes up the GPU scheduler _only if_ more jobs can be queued to the underlying hardware. This distinction is important to make, since the wake conditional in the GPU scheduler thread wakes up when other conditions are also true, e.g. when there are jobs to be cleaned. For instance, a user might want to wake up the scheduler only because there are more jobs to clean, but whether we can queue more jobs is irrelevant. v2: Separate "canqueue" to "can_queue". (Alex D.) Cc: Christian König Cc: Alex Deucher Signed-off-by: Luben Tuikov Link: https://lore.kernel.org/r/20230517233550.377847-2-luben.tuikov@amd.com Reviewed-by: Alex Deucher commit e072700869dd96405a9c3752d3741a79bca6e2e2 Author: Luben Tuikov Date: Wed May 17 19:35:49 2023 -0400 drm/sched: Rename to drm_sched_can_queue() Rename drm_sched_ready() to drm_sched_can_queue(). "ready" can mean many things and is thus meaningless in this context. Instead, rename to a name which precisely conveys what is being checked. Cc: Christian König Cc: Alex Deucher Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Link: https://lore.kernel.org/r/20230517233550.377847-1-luben.tuikov@amd.com commit ecd01b69a5f8edda731d8a7cfe33c9ffa0c85700 Author: Michal Swiatkowski Date: Fri Apr 7 18:52:15 2023 +0200 ice: define meta data to match in switch Add description for each meta data. Redefine tunnel mask to match only tunneled MAC and tunneled VLAN. It shouldn't try to match other flags (previously it was 0xff, it is redundant). VLAN mask was 0xd000, change it to 0xf000. 4 last bits are flags depending on the same field in packets (VLAN tag). Because of that, It isn't harmful to match also on ITAG. Group all MDID and MDID offsets into enums to keep things organized. Signed-off-by: Michal Swiatkowski Reviewed-by: Piotr Raczynski Reviewed-by: Simon Horman Reviewed-by: Leon Romanovsky Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen commit 911afb9f9516a8ea2db1d15b18436c19a591dc5c Author: Ajay Agarwal Date: Thu May 4 16:43:01 2023 +0530 PCI/ASPM: Remove unnecessary ASPM_STATE_L1SS check Previously aspm_l1ss_init() checked if ASPM_STATE_L1SS is supported before calling aspm_calc_l12_info(), only for that function to return if ASPM_STATE_L1_2_MASK is not supported. Simplify the logic by directly checking for ASPM_STATE_L1_2_MASK. Link: https://lore.kernel.org/r/20230504111301.229358-6-ajayagarwal@google.com Signed-off-by: Ajay Agarwal Signed-off-by: Bjorn Helgaas commit 05a55d9ca1457295db73f127e39ec3b18f0b32b2 Author: Ajay Agarwal Date: Thu May 4 16:43:00 2023 +0530 PCI/ASPM: Rename L1.2-specific functions from 'l1ss' to 'l12' The functions aspm_calc_l1ss_info() and calc_l1ss_pwron() perform calculations and register programming specific to L1.2 state. Rename them to aspm_calc_l12_info() and calc_l12_pwron() respectively. Link: https://lore.kernel.org/r/20230504111301.229358-5-ajayagarwal@google.com Signed-off-by: Ajay Agarwal Signed-off-by: Bjorn Helgaas commit 329ac9af902e441bae13803a4d7126aaf5984188 Author: Kees Cook Date: Thu May 11 11:41:35 2023 -0700 docs: submitting-patches: Discuss interleaved replies Top-posting has been strongly discouraged in Linux development, but this was actually not written anywhere in the common documentation about sending patches and replying to reviews. Add a section about trimming and interleaved replies. Acked-by: Greg Kroah-Hartman Signed-off-by: Kees Cook Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230511184131.gonna.399-kees@kernel.org commit 80950a546089690ff6f02ca15930b9be695a668a Author: Ajay Agarwal Date: Thu May 4 16:42:59 2023 +0530 PCI/ASPM: Set ASPM_STATE_L1 when driver enables L1.1 or L1.2 Previously pci_enable_link_state(PCIE_LINK_STATE_L1_1) enabled only ASPM_STATE_L1_1 and did not enable ASPM_STATE_L1. The L1.1 state only works when L1 is enabled, so enable ASPM_STATE_L1 in addition, and do the same for L1.2. The only current caller is vmd_pm_enable_quirk(), which enables *all* ASPM states, so this should have no functional effect. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20230504111301.229358-4-ajayagarwal@google.com Signed-off-by: Ajay Agarwal Signed-off-by: Bjorn Helgaas commit d6534e3c86668211fc6945017396c0c0d9e7daa4 Author: Jakub Kicinski Date: Wed May 10 19:02:04 2023 -0700 MAINTAINERS: direct process doc changes to a dedicated ML It's hard to keep track of changes to the process docs. Subsystem maintainers should probably know what's going on, to ensure reasonably uniform developer experience across trees. We also need a place where process discussions can be held (i.e. designated mailing list which can be CCed on naturally arising discussions). I'm using workflows@ in this RFC, but a new list may be better. No change to the patch flow intended. Signed-off-by: Jakub Kicinski Reviewed-by: Kees Cook Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230511020204.910178-1-kuba@kernel.org commit 42b0a5e691087c7e7ccbb8da87d51b301a9ddeb1 Author: Daisuke Matsuda Date: Thu May 18 16:00:27 2023 +0900 RDMA/rxe: Fix comments about removed tasklets The commit 9b4b7c1f9f54 ("RDMA/rxe: Add workqueue support for rxe tasks") removed tasklets and replaced them with a workqueue, but relevant comments are still remaining in the source code. Fixes: 9b4b7c1f9f54 ("RDMA/rxe: Add workqueue support for rxe tasks") Link: https://lore.kernel.org/r/20230518070027.942715-1-matsuda-daisuke@fujitsu.com Signed-off-by: Daisuke Matsuda Reviewed-by: Bob Pearson Acked-by: Zhu Yanjun Signed-off-by: Jason Gunthorpe commit 2017e3cae0c48c4f178386538712b50549a7d9a5 Author: James Seo Date: Tue May 9 10:55:48 2023 -0700 Documentation: core-api: Add error pointer functions to kernel-api Bring the error pointer functions (e.g. ERR_PTR(), PTR_ERR()) into the docs build so that they can be cross-referenced elsewhere. List them as kernel library functions in the kernel-api document. Nowhere else seems to fit, and they need to go *somewhere*. Signed-off-by: James Seo Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230509175543.2065835-4-james@equiv.tech commit 4d744ce9d5d7cf0e3ab68d0cf160194da6504eb8 Author: James Seo Date: Tue May 9 10:55:46 2023 -0700 err.h: Add missing kerneldocs for error pointer functions Add kerneldocs for ERR_PTR(), PTR_ERR(), PTR_ERR_OR_ZERO(), IS_ERR(), and IS_ERR_OR_NULL(). Doing so will help convert hundreds of mentions of them in existing documentation into automatic cross-references. Also add kerneldocs for IS_ERR_VALUE(). Doing so adds no automatic cross-references, but this macro has a slightly different use case than the functionally similar IS_ERR(), and documenting it may be helpful to readers who encounter it in existing code. ERR_CAST() already has kerneldocs and has not been touched. Signed-off-by: James Seo Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230509175543.2065835-3-james@equiv.tech commit 34d9f62e04568451682a76f1016dbb3e3b3e9bc0 Author: James Seo Date: Tue May 9 10:55:43 2023 -0700 Documentation: conf.py: Add __force to c_id_attributes Fixes the following error in the docs build that occurs with recent versions of Sphinx when parsing kerneldocs for a function with the '__force' macro in its signature: ./include/linux/err.h:51: WARNING: Error in declarator or parameters Error in declarator or parameters Invalid C declaration: Expected identifier, got keyword: void [error at 35] void * ERR_CAST (__force const void *ptr) -----------------------------------^ Currently, almost all of the few in-signature occurrences of '__force' are in the error pointer functions. Of those, ERR_CAST() is the only one with kerneldocs, but the kerneldocs aren't even being used to generate documentation. This change will allow all the error pointer functions to be properly documented. In addition to '__force', also defines '__nocast', '__safe', and '__private'. These are not currently used in any function signatures and do not need to be added to the docs config. Signed-off-by: James Seo Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230509175543.2065835-2-james@equiv.tech commit f41dd67da6460588f541edee6c2344743c8e3bdc Author: Yan-Jie Wang Date: Wed May 3 16:15:31 2023 +0800 docs: clarify KVM related kernel parameters' descriptions The descriptions of certain KVM related kernel parameters can be confusing. They state "Disable ...," which may make people think that setting them to 1 will disable the associated feature when in fact the opposite is true. This commit addresses this issue by revising the descriptions of these parameters by using "Control..." rather than "Enable/Disable...". 1==enabled or 0==disabled can be communicated by the description of default value such as "1 (enabled)" or "0 (disabled)". Also update the description of KVM's default value for kvm-intel.nested as it is enabled by default. Signed-off-by: Yan-Jie Wang Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230503081530.19956-1-yanjiewtw@gmail.com commit 3c591cc954d56e351c48c26f4076f056ab141ff1 Author: Costa Shulyupin Date: Tue May 2 04:50:40 2023 +0300 docs: consolidate human interface subsystems to make the page more organized as requested Signed-off-by: Costa Shulyupin Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230502015040.329394-1-costa.shul@redhat.com commit f02c20d9f1567ac483c62342a4d6ac33790e3b2e Author: Natesh Sharma Date: Thu Apr 27 14:07:06 2023 +0530 docs: admin-guide: Add information about intel_pstate active mode Information about intel_pstate active mode is added in the doc. This operation mode could be used to set on the hardware when it's not activated. Status of the mode could be checked from sysfs file i.e., /sys/devices/system/cpu/intel_pstate/status. The information is already available in cpu-freq/intel-pstate.txt documentation. Signed-off-by: Natesh Sharma Signed-off-by: Jonathan Corbet [jc: reformatted for width ] Link: https://lore.kernel.org/r/20230427083706.49882-1-nsharma@redhat.com commit 0babf89c9cca7e074d6e59893e462e4886f481cc Author: Nikita Zhandarovich Date: Wed May 10 07:35:37 2023 -0700 hwmon: (f71882fg) prevent possible division by zero In the unlikely event that something goes wrong with the device and its registers, the fan_from_reg() function may return 0. This value will cause a division-by-zero error in the show_pwm() function. To prevent this, test the value of fan_from_reg(data->fan_full_speed[nr]) against 0 before performing the division. If the division-by-zero error is avoided, assign 0 to the val variable. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: df9ec2dae094 ("hwmon: (f71882fg) Reorder symbols to get rid of a few forward declarations") Signed-off-by: Nikita Zhandarovich Link: https://lore.kernel.org/r/20230510143537.145060-1-n.zhandarovich@fintech.ru Signed-off-by: Guenter Roeck commit f573db7aa528f11820dcc811bc7791b231d22b1c Author: Herbert Xu Date: Fri May 19 20:41:55 2023 +0800 crypto: arm64/sha256-glue - Include module.h Include module.h in arch/arm64/crypto/sha256-glue.c as it uses various macros (such as MODULE_AUTHOR) that are defined there. Also fix the ordering of types.h. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305191953.PIB1w80W-lkp@intel.com/ Signed-off-by: Herbert Xu commit 20d5e0ef252a151ea6585cfccf32def81a624666 Author: Uwe Kleine-König Date: Thu May 18 22:30:49 2023 +0200 net: arc: Make arc_emac_remove() return void The function returns zero unconditionally. Change it to return void instead which simplifies its callers as error handing becomes unnecessary. Signed-off-by: Uwe Kleine-König Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 41be14c71bae05c8daa3de5ae7fd7c2a7bc0d057 Author: Arnd Bergmann Date: Fri May 19 11:34:38 2023 +0200 dmaengine: ste_dma40: use proper format string for resource_size_t A fixup for a printk format string warning causes an out-of-bounds variable access as the %pR string expects a struct resource instead of a plain resource_size_t. Change both to the special %pap and %pap helpers for these types. Fixes: 5a1a3b9c19dd ("dmaengine: ste_dma40: Get LCPA SRAM from SRAM node") Fixes: ef1e1c41a11d ("dmaengine: ste_dma40: use correct print specfier for resource_size_t") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230519093447.4097040-1-arnd@kernel.org Signed-off-by: Vinod Koul commit eb1cfd09f788e39948a82be8063e54e40dd018d9 Author: Kent Overstreet Date: Tue May 9 15:58:46 2023 -0400 lockdep: Add lock_set_cmp_fn() annotation This implements a new interface to lockdep, lock_set_cmp_fn(), for defining a custom ordering when taking multiple locks of the same class. This is an alternative to subclasses, but can not fully replace them since subclasses allow lock hierarchies with other clasees inter-twined, while this relies on pure class nesting. Specifically, if A is our nesting class then: A/0 <- B <- A/1 Would be a valid lock order with subclasses (each subclass really is a full class from the validation PoV) but not with this annotation, which requires all nesting to be consecutive. Example output: | ============================================ | WARNING: possible recursive locking detected | 6.2.0-rc8-00003-g7d81e591ca6a-dirty #15 Not tainted | -------------------------------------------- | kworker/14:3/938 is trying to acquire lock: | ffff8880143218c8 (&b->lock l=0 0:2803368){++++}-{3:3}, at: bch_btree_node_get.part.0+0x81/0x2b0 | | but task is already holding lock: | ffff8880143de8c8 (&b->lock l=1 1048575:9223372036854775807){++++}-{3:3}, at: __bch_btree_map_nodes+0xea/0x1e0 | and the lock comparison function returns 1: | | other info that might help us debug this: | Possible unsafe locking scenario: | | CPU0 | ---- | lock(&b->lock l=1 1048575:9223372036854775807); | lock(&b->lock l=0 0:2803368); | | *** DEADLOCK *** | | May be due to missing lock nesting notation | | 3 locks held by kworker/14:3/938: | #0: ffff888005ea9d38 ((wq_completion)bcache){+.+.}-{0:0}, at: process_one_work+0x1ec/0x530 | #1: ffff8880098c3e70 ((work_completion)(&cl->work)#3){+.+.}-{0:0}, at: process_one_work+0x1ec/0x530 | #2: ffff8880143de8c8 (&b->lock l=1 1048575:9223372036854775807){++++}-{3:3}, at: __bch_btree_map_nodes+0xea/0x1e0 [peterz: extended changelog] Signed-off-by: Kent Overstreet Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230509195847.1745548-1-kent.overstreet@linux.dev commit ee4d21aa4a227466c5635831e950c7276db797db Author: Lukas Bulwahn Date: Fri May 19 06:13:07 2023 +0200 MAINTAINERS: remove broken entries in QUALCOMM TYPEC PORT MANAGER DRIVER Commit a4422ff22142 ("usb: typec: qcom: Add Qualcomm PMIC Type-C driver") adds the section QUALCOMM TYPEC PORT MANAGER DRIVER in MAINTAINERS with two file entries for header files in include/dt-bindings/usb/typec/. However, these files are not added to the repository with this commit or any commit in the related patch series. Probably, these file entries are just needless leftover after the work went through some refactoring. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Remove the two file entries for non-existent header files. Signed-off-by: Lukas Bulwahn Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230519041307.32322-1-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6405fee9b0d04ea8a5a2a7fa671f8f45765d8dcb Author: Shaomin Deng Date: Sat Nov 5 11:31:35 2022 -0400 ntfs: Remove unneeded semicolon Remove the unneeded semicolon after curly braces. Signed-off-by: Shaomin Deng Reviewed-by: Namjae Jeon Message-Id: <20221105153135.5975-1-dengshaomin@cdjrlc.com> Signed-off-by: Christian Brauner commit 253f3137ebfd0b2385fbc4f078bccb2a4097406d Author: Deming Wang Date: Mon Feb 6 04:18:15 2023 -0500 ntfs: Correct spelling We should use this replace thie. Signed-off-by: Deming Wang Reviewed-by: Namjae Jeon Message-Id: <20230206091815.1687-1-wangdeming@inspur.com> Signed-off-by: Christian Brauner commit 04faa6cfd44972c2e36b6528a4719e3880db0c90 Author: Colin Ian King Date: Tue Apr 18 16:36:07 2023 +0100 ntfs: remove redundant initialization to pointer cb_sb_start The pointer cb_sb_start is being initialized with a value that is never read, it is being re-assigned the same value later on when it is first being used. The initialization is redundant and can be removed. Cleans up clang scan build warning: fs/ntfs/compress.c:164:6: warning: Value stored to 'cb_sb_start' during its initialization is never read [deadcode.DeadStores] u8 *cb_sb_start = cb; /* Beginning of the current sb in the cb. */ Signed-off-by: Colin Ian King Reviewed-by: Namjae Jeon Message-Id: <20230418153607.3125704-1-colin.i.king@gmail.com> Signed-off-by: Christian Brauner commit 7883d1b28a2b0e62edcacea22de6b36a1918b15a Author: Jia Jie Ho Date: Mon May 15 20:53:55 2023 +0800 crypto: starfive - Add hash and HMAC support Adding hash/HMAC support for SHA-2 and SM3 to StarFive cryptographic module. Co-developed-by: Huan Feng Signed-off-by: Huan Feng Signed-off-by: Jia Jie Ho Signed-off-by: Herbert Xu commit 42ef0e944b0119e9987819af0a5a04d32d5e5edf Author: Jia Jie Ho Date: Mon May 15 20:53:53 2023 +0800 crypto: starfive - Add crypto engine support Adding device probe and DMA init for StarFive cryptographic module. Co-developed-by: Huan Feng Signed-off-by: Huan Feng Signed-off-by: Jia Jie Ho Signed-off-by: Herbert Xu commit 4b66c6aa285e65c634188c5ef3da1af06488e5bc Author: Jia Jie Ho Date: Mon May 15 20:53:52 2023 +0800 dt-bindings: crypto: Add StarFive crypto module Add documentation to describe StarFive cryptographic engine. Co-developed-by: Huan Feng Signed-off-by: Huan Feng Signed-off-by: Jia Jie Ho Reviewed-by: Rob Herring Signed-off-by: Herbert Xu commit 271e3830377ab5a7512c01eca95ae39a6e7bdfcf Author: Pankaj Gupta Date: Fri May 12 20:40:33 2023 +0530 crypto: caam - Fix soc_id matching Since, CAAM driver is probed before soc_device_attribute done as part of: - drivers/soc/imx/soc-imx8m.c (for i.MX8M) - drivers/firmware/imx/ele_mu.c (EdgeLock Enclave kernel driver, for i.MX8ULP) It is needed to return -EPROBE_DEFER, after calling soc_device_match() in drivers/crypto/caam/ctrl.c. soc_device_match returns NULL for: - i.MX8M - i.MX8ULP, can be considered that the SoC device has not been probed yet. Hence, it returns -EPROBE_DEFER directly. caam: imx: change to use of_match_node in run_descriptor_deco0 Providing imx8m_machine_match to match: - i.MX8M{Q,M,N,P}, - i.MX8ULP, so as to start using of_match_node, to simplify the code. Signed-off-by: Alice Guo Signed-off-by: Pankaj Gupta Reviewed-by: Dong Aisheng Reviewed-by: Horia Geanta Acked-by: Peng Fan Acked-by: Alice Guo Signed-off-by: Herbert Xu commit a69c500018b97edec48ce9d41620748761322c83 Author: Tero Kristo Date: Fri May 12 16:10:44 2023 +0530 crypto: sa2ul - change unsafe data size limit to 255 bytes 256 bytes is quite often used in performance benchmarks and this size appears to be also working just fine, so mark it as safe so that we do not fallback to software implementation for this packet size. Otherwise there is a strange bump up in crypto performance at 256 byte packet size. Signed-off-by: Tero Kristo Signed-off-by: Jayesh Choudhary Signed-off-by: Herbert Xu commit 6c19f3bfff0344cdc02e7b074062a9acd026f010 Author: Herbert Xu Date: Thu May 11 12:30:29 2023 +0800 crypto: lib/sha256 - Use generic code from sha256_base Instead of duplicating the sha256 block processing code, reuse the common code from crypto/sha256_base.h. Signed-off-by: Herbert Xu commit 70d391a86317f77c30d4c0aa898b5fe0f75687b9 Author: Herbert Xu Date: Thu May 11 12:29:36 2023 +0800 crypto: lib/sha256 - Remove redundant and unused sha224_update The function sha224_update is exactly the same as sha256_update. Moreover it's not even used in the kernel so it can be removed. Signed-off-by: Herbert Xu commit 83b3432fc5b7128f9904a13b5d5c539c68b57447 Merge: af53b00fa3aca 1a8edfcffa280 Author: Mark Brown Date: Fri May 19 12:32:36 2023 +0900 ASoC: cs35l56: Bugfixes and efficiency improvement Merge series from Richard Fitzgerald : First two patches are bugfixes. Third patch skips the overhead of rebooting the amp after applying firmware files when we know that it isn't necessary. commit af53b00fa3aca3410c89900a34e5d727a27c36e2 Merge: 98be58f2b517b f1fcbaa18b28d Author: Mark Brown Date: Fri May 19 12:32:04 2023 +0900 Merge tag 'v6.4-rc2' into asoc-6.5 to get fixes for CI Linux 6.4-rc2 commit 640c48a0880d0af72bc2fcbfc07fe86f650fdb12 Merge: bf9233f913eb1 985de45923e29 Author: Jakub Kicinski Date: Thu May 18 20:06:34 2023 -0700 Merge branch 'mptcp-refactor-inet_accept-and-mib-updates' Mat Martineau says: ==================== mptcp: Refactor inet_accept() and MIB updates Patches 1 and 2 refactor inet_accept() to provide a new __inet_accept() that's usable with locked sockets, and then make use of that helper to simplify mptcp_stream_accept(). Patches 3 and 4 add some new MIBS related to MPTCP address advertisement and update related selftest scripts. Patch 5 modifies the selftests to ensure MIBS are only printed once when a test case fails. ==================== Link: https://lore.kernel.org/r/20230516-send-net-next-20220516-v1-0-e91822b7b6e0@kernel.org Signed-off-by: Jakub Kicinski commit 985de45923e29087a2dcf34bb71f24641d6cc55f Author: Paolo Abeni Date: Wed May 17 12:16:18 2023 -0700 selftests: mptcp: centralize stats dumping If a test case fails, the mptcp_join.sh script can dump the netns MIBs multiple times, leading to confusing output. Let's dump such info only once per test-case, when needed. This additionally allow removing some code duplication. Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 0639fa230a21062567222bd99f2996e9da6c232c Author: Paolo Abeni Date: Wed May 17 12:16:17 2023 -0700 selftests: mptcp: add explicit check for new mibs Instead of duplicating the all existing TX check with the TX side, add the new ones on selected test cases. Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 45b1a1227a7aaa99254551c513406c7aa904e968 Author: Paolo Abeni Date: Wed May 17 12:16:16 2023 -0700 mptcp: introduces more address related mibs Currently we don't track explicitly a few events related to address management suboption handling; this patch adds new mibs for ADD_ADDR and RM_ADDR options tx and for missed tx events due to internal storage exhaustion. The self-tests must be updated to properly handle different mibs with the same/shared prefix. Additionally removes a couple of warning tracking the loss event. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/378 Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit e76c8ef5cc5b77debe711717f61a3fbf24904873 Author: Paolo Abeni Date: Wed May 17 12:16:15 2023 -0700 mptcp: refactor mptcp_stream_accept() Rewrite the mptcp socket accept op, leveraging the new __inet_accept() helper. This way we can avoid acquiring the new socket lock twice and we can avoid a couple of indirect calls. Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 711bdd5141d81ab21dbe0a533024d594210d5ba4 Author: Paolo Abeni Date: Wed May 17 12:16:14 2023 -0700 inet: factor out locked section of inet_accept() in a new helper No functional changes intended. The new helper will be used by the MPTCP protocol in the next patch to avoid duplicating a few LoC. Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit bf9233f913eb17d784ffbfff4ff55bc0772f3063 Merge: 643510ce07b24 ebdf098a0e1be Author: Jakub Kicinski Date: Thu May 18 20:04:59 2023 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-05-17 (ice, MAINTAINERS) This series contains updates to ice driver and MAINTAINERS file. Paul refactors PHY to link mode reporting and updates some PHY types to report more accurate link modes for ice. Dave removes mutual exclusion policy between LAG and SR-IOV in ice driver. Jesse updates link for Intel Wired LAN in the MAINTAINERS file. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: MAINTAINERS: update Intel Ethernet links ice: Remove LAG+SRIOV mutual exclusion ice: update PHY type to ethtool link mode mapping ice: refactor PHY type to ethtool link mode ice: update ICE_PHY_TYPE_HIGH_MAX_INDEX ==================== Link: https://lore.kernel.org/r/20230517165530.3179965-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 643510ce07b244122dd197a95e1a855bfdc49121 Merge: 90223c1136b29 fc082b39d0a29 Author: Jakub Kicinski Date: Thu May 18 19:52:35 2023 -0700 Merge branch 'net-sfp-add-support-for-control-of-rate-selection' Russell King says: ==================== net: sfp: add support for control of rate selection This series introduces control of the rate selection SFP pins (or their soft state in the I2C diagnostics EEPROM). Several SNIA documents (referenced in the commits) describe the various different modes for these, and we implement them all for maximum compatibility, but as we know, SFP modules tend to do their own thing, so that may not be sufficient. In order to implement this, we need to change the locking arrangement in the SFP layer - we need to make st_mutex (state mutex) able to be taken from within the rtnl lock and sm_mutex (state machine mutex). Essentially, st_mutex protects the hard (gpio) and soft state signals. So, patches 2 through 5 rejig the locking so that st_mutex is only ever taken when we want to fiddle with the signal state variables, read or write the GPIOs, or read or write the soft state. Patch 1 adds a helper that makes the locking rejig a little easier as it combines the update of sfp->state with setting the updated control state to the module. Patch 6 adds code to phylink to give the signalling rate for various PHY interface modes that are relevant to SFPs - this is the baud rate of the encoded signal, not the data rate, which is what matters for SFPs. This rate is passed through the SFP bus layer into the SFP socket driver, which initially has a stub sfp_set_signal_rate(). Patch 7 adds the code to the SFP socket driver to parse the rate selection data in the EEPROM, configure which RS signals need to be driven, and the signalling rate threshold. We fill in sfp_set_signal_rate() to set the rate select pins as appropriate. ==================== Link: https://lore.kernel.org/r/ZGSuTY8GqjM+sqta@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit fc082b39d0a29891ab4b54c88a40f42385103f71 Author: Russell King (Oracle) Date: Wed May 17 11:38:17 2023 +0100 net: sfp: add support for rate selection Add support for parsing the rate select thresholds and switching of the RS0 and RS1 signals to the transceiver. This is complicated by various revisions of SFF-8472 and interaction of SFF-8431, SFF-8079 and INF-8074. Reviewed-by: Simon Horman Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit dc18582211b34bce8250ddf3cac2a2230e192120 Author: Russell King (Oracle) Date: Wed May 17 11:38:12 2023 +0100 net: sfp: add support for setting signalling rate Add support to the SFP layer to allow phylink to set the signalling rate for a SFP module. The rate given will be in units of kilo-baud (1000 baud). Reviewed-by: Simon Horman Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 1974fd3bf0f04589dea1a4a76273bbc8fd5760f6 Author: Russell King (Oracle) Date: Wed May 17 11:38:07 2023 +0100 net: sfp: change st_mutex locking Change st_mutex's use within SFP such that it only protects the various state members, as it was originally supposed to, and isn't held while making various calls outside the driver. Reviewed-by: Simon Horman Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 97a492050aa5e15507fd7b8774e7adaf8d6e4bb5 Author: Russell King (Oracle) Date: Wed May 17 11:38:02 2023 +0100 net: sfp: move sm_mutex into sfp_check_state() Provide an unlocked version of sfp_sm_event() which can be used by sfp_check_state() to avoid having to keep re-taking the lock if several signals have changed state. Reviewed-by: Simon Horman Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit a9fe964e7aaeb3fc06a91c21269d0ac8b5afcea8 Author: Russell King (Oracle) Date: Wed May 17 11:37:57 2023 +0100 net: sfp: swap order of rtnl and st_mutex locks Swap the order of the rtnl and st_mutex locks - st_mutex is now nested beneath rtnl lock instead of rtnl being beneath st_mutex. This will allow us to hold st_mutex only while manipulating the module's hardware or software control state. Reviewed-by: Simon Horman Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit d47e5a430dfd8b15739a118e4a2add5fa90347fd Author: Russell King (Oracle) Date: Wed May 17 11:37:52 2023 +0100 net: sfp: move rtnl lock to cover reading state As preparation to moving st_mutex inside rtnl_lock, we need to first move the rtnl lock to cover reading the state. Reviewed-by: Simon Horman Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 418c1214741cf3ac5e420382a85c4f8a40586024 Author: Russell King (Oracle) Date: Wed May 17 11:37:47 2023 +0100 net: sfp: add helper to modify signal states There are a couple of locations in the code where we modify sfp->state, and then call sfp_set_state(, sfp->state) to update the outputs/soft state to control the module. Provide a helper which takes a mask and new state so that this is encapsulated in one location. Reviewed-by: Simon Horman Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 1a8edfcffa2803afc0ef3a6a48819230cdbda2c9 Author: Simon Trimmer Date: Thu May 18 16:02:50 2023 +0100 ASoC: cs35l56: In secure mode skip SHUTDOWN and RESET around fw download If the device is in secure mode it's unnecessary to send a SHUTDOWN and SYSTEM_RESET around the firmware download. It could only be patching insecure tunings. A tuning patch doesn't need a SHUTDOWN and only needs a REINIT afterwards. This will reduce the overhead of exiting system suspend in secure mode. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/Message-Id: <20230518150250.1121006-4-rf@opensource.cirrus.com> Signed-off-by: Mark Brown commit c9001a2754528fa5da20e8674b3afbd8c134cc91 Author: Simon Trimmer Date: Thu May 18 16:02:49 2023 +0100 ASoC: cs35l56: sdw_write_no_pm() should be performed under a pm_runtime request SoundWire bus accesses must be performed under the guard of a pm_runtime request, in this case the write was being performed just after the request had been put() and so the bus could not be guaranteed to be available. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/Message-Id: <20230518150250.1121006-3-rf@opensource.cirrus.com> Signed-off-by: Mark Brown commit 608f1b0dbddec6b2fd766c10bcce2b651995e936 Author: Simon Trimmer Date: Thu May 18 16:02:48 2023 +0100 ASoC: cs35l56: Move DSP part string generation so that it is done only once Each time we go through dsp_work() it does a devm_kasprintf() to allocate memory to hold the part name string. It's not strictly a memory leak because devm will free it all if the driver is removed. But we keep allocating more and more memory to hold the same string. Move the allocation so that it is performed after the version and secured state information is gathered and handle allocation errors. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/Message-Id: <20230518150250.1121006-2-rf@opensource.cirrus.com> Signed-off-by: Mark Brown commit 6ac392815628f317fcfdca1a39df00b9cc4ebc8b Author: Christian Brauner Date: Wed May 3 13:18:42 2023 +0200 fs: allow to mount beneath top mount Various distributions are adding or are in the process of adding support for system extensions and in the future configuration extensions through various tools. A more detailed explanation on system and configuration extensions can be found on the manpage which is listed below at [1]. System extension images may – dynamically at runtime — extend the /usr/ and /opt/ directory hierarchies with additional files. This is particularly useful on immutable system images where a /usr/ and/or /opt/ hierarchy residing on a read-only file system shall be extended temporarily at runtime without making any persistent modifications. When one or more system extension images are activated, their /usr/ and /opt/ hierarchies are combined via overlayfs with the same hierarchies of the host OS, and the host /usr/ and /opt/ overmounted with it ("merging"). When they are deactivated, the mount point is disassembled — again revealing the unmodified original host version of the hierarchy ("unmerging"). Merging thus makes the extension's resources suddenly appear below the /usr/ and /opt/ hierarchies as if they were included in the base OS image itself. Unmerging makes them disappear again, leaving in place only the files that were shipped with the base OS image itself. System configuration images are similar but operate on directories containing system or service configuration. On nearly all modern distributions mount propagation plays a crucial role and the rootfs of the OS is a shared mount in a peer group (usually with peer group id 1): TARGET SOURCE FSTYPE PROPAGATION MNT_ID PARENT_ID / / ext4 shared:1 29 1 On such systems all services and containers run in a separate mount namespace and are pivot_root()ed into their rootfs. A separate mount namespace is almost always used as it is the minimal isolation mechanism services have. But usually they are even much more isolated up to the point where they almost become indistinguishable from containers. Mount propagation again plays a crucial role here. The rootfs of all these services is a slave mount to the peer group of the host rootfs. This is done so the service will receive mount propagation events from the host when certain files or directories are updated. In addition, the rootfs of each service, container, and sandbox is also a shared mount in its separate peer group: TARGET SOURCE FSTYPE PROPAGATION MNT_ID PARENT_ID / / ext4 shared:24 master:1 71 47 For people not too familiar with mount propagation, the master:1 means that this is a slave mount to peer group 1. Which as one can see is the host rootfs as indicated by shared:1 above. The shared:24 indicates that the service rootfs is a shared mount in a separate peer group with peer group id 24. A service may run other services. Such nested services will also have a rootfs mount that is a slave to the peer group of the outer service rootfs mount. For containers things are just slighly different. A container's rootfs isn't a slave to the service's or host rootfs' peer group. The rootfs mount of a container is simply a shared mount in its own peer group: TARGET SOURCE FSTYPE PROPAGATION MNT_ID PARENT_ID /home/ubuntu/debian-tree / ext4 shared:99 61 60 So whereas services are isolated OS components a container is treated like a separate world and mount propagation into it is restricted to a single well known mount that is a slave to the peer group of the shared mount /run on the host: TARGET SOURCE FSTYPE PROPAGATION MNT_ID PARENT_ID /propagate/debian-tree /run/host/incoming tmpfs master:5 71 68 Here, the master:5 indicates that this mount is a slave to the peer group with peer group id 5. This allows to propagate mounts into the container and served as a workaround for not being able to insert mounts into mount namespaces directly. But the new mount api does support inserting mounts directly. For the interested reader the blogpost in [2] might be worth reading where I explain the old and the new approach to inserting mounts into mount namespaces. Containers of course, can themselves be run as services. They often run full systems themselves which means they again run services and containers with the exact same propagation settings explained above. The whole system is designed so that it can be easily updated, including all services in various fine-grained ways without having to enter every single service's mount namespace which would be prohibitively expensive. The mount propagation layout has been carefully chosen so it is possible to propagate updates for system extensions and configurations from the host into all services. The simplest model to update the whole system is to mount on top of /usr, /opt, or /etc on the host. The new mount on /usr, /opt, or /etc will then propagate into every service. This works cleanly the first time. However, when the system is updated multiple times it becomes necessary to unmount the first update on /opt, /usr, /etc and then propagate the new update. But this means, there's an interval where the old base system is accessible. This has to be avoided to protect against downgrade attacks. The vfs already exposes a mechanism to userspace whereby mounts can be mounted beneath an existing mount. Such mounts are internally referred to as "tucked". The patch series exposes the ability to mount beneath a top mount through the new MOVE_MOUNT_BENEATH flag for the move_mount() system call. This allows userspace to seamlessly upgrade mounts. After this series the only thing that will have changed is that mounting beneath an existing mount can be done explicitly instead of just implicitly. Today, there are two scenarios where a mount can be mounted beneath an existing mount instead of on top of it: (1) When a service or container is started in a new mount namespace and pivot_root()s into its new rootfs. The way this is done is by mounting the new rootfs beneath the old rootfs: fd_newroot = open("/var/lib/machines/fedora", ...); fd_oldroot = open("/", ...); fchdir(fd_newroot); pivot_root(".", "."); After the pivot_root(".", ".") call the new rootfs is mounted beneath the old rootfs which can then be unmounted to reveal the underlying mount: fchdir(fd_oldroot); umount2(".", MNT_DETACH); Since pivot_root() moves the caller into a new rootfs no mounts must be propagated out of the new rootfs as a consequence of the pivot_root() call. Thus, the mounts cannot be shared. (2) When a mount is propagated to a mount that already has another mount mounted on the same dentry. The easiest example for this is to create a new mount namespace. The following commands will create a mount namespace where the rootfs mount / will be a slave to the peer group of the host rootfs / mount's peer group. IOW, it will receive propagation from the host: mount --make-shared / unshare --mount --propagation=slave Now a new mount on the /mnt dentry in that mount namespace is created. (As it can be confusing it should be spelled out that the tmpfs mount on the /mnt dentry that was just created doesn't propagate back to the host because the rootfs mount / of the mount namespace isn't a peer of the host rootfs.): mount -t tmpfs tmpfs /mnt TARGET SOURCE FSTYPE PROPAGATION └─/mnt tmpfs tmpfs Now another terminal in the host mount namespace can observe that the mount indeed hasn't propagated back to into the host mount namespace. A new mount can now be created on top of the /mnt dentry with the rootfs mount / as its parent: mount --bind /opt /mnt TARGET SOURCE FSTYPE PROPAGATION └─/mnt /dev/sda2[/opt] ext4 shared:1 The mount namespace that was created earlier can now observe that the bind mount created on the host has propagated into it: TARGET SOURCE FSTYPE PROPAGATION └─/mnt /dev/sda2[/opt] ext4 master:1 └─/mnt tmpfs tmpfs But instead of having been mounted on top of the tmpfs mount at the /mnt dentry the /opt mount has been mounted on top of the rootfs mount at the /mnt dentry. And the tmpfs mount has been remounted on top of the propagated /opt mount at the /opt dentry. So in other words, the propagated mount has been mounted beneath the preexisting mount in that mount namespace. Mount namespaces make this easy to illustrate but it's also easy to mount beneath an existing mount in the same mount namespace (The following example assumes a shared rootfs mount / with peer group id 1): mount --bind /opt /opt TARGET SOURCE FSTYPE MNT_ID PARENT_ID PROPAGATION └─/opt /dev/sda2[/opt] ext4 188 29 shared:1 If another mount is mounted on top of the /opt mount at the /opt dentry: mount --bind /tmp /opt The following clunky mount tree will result: TARGET SOURCE FSTYPE MNT_ID PARENT_ID PROPAGATION └─/opt /dev/sda2[/tmp] ext4 405 29 shared:1 └─/opt /dev/sda2[/opt] ext4 188 405 shared:1 └─/opt /dev/sda2[/tmp] ext4 404 188 shared:1 The /tmp mount is mounted beneath the /opt mount and another copy is mounted on top of the /opt mount. This happens because the rootfs / and the /opt mount are shared mounts in the same peer group. When the new /tmp mount is supposed to be mounted at the /opt dentry then the /tmp mount first propagates to the root mount at the /opt dentry. But there already is the /opt mount mounted at the /opt dentry. So the old /opt mount at the /opt dentry will be mounted on top of the new /tmp mount at the /tmp dentry, i.e. @opt->mnt_parent is @tmp and @opt->mnt_mountpoint is /tmp (Note that @opt->mnt_root is /opt which is what shows up as /opt under SOURCE). So again, a mount will be mounted beneath a preexisting mount. (Fwiw, a few iterations of mount --bind /opt /opt in a loop on a shared rootfs is a good example of what could be referred to as mount explosion.) The main point is that such mounts allows userspace to umount a top mount and reveal an underlying mount. So for example, umounting the tmpfs mount on /mnt that was created in example (1) using mount namespaces reveals the /opt mount which was mounted beneath it. In (2) where a mount was mounted beneath the top mount in the same mount namespace unmounting the top mount would unmount both the top mount and the mount beneath. In the process the original mount would be remounted on top of the rootfs mount / at the /opt dentry again. This again, is a result of mount propagation only this time it's umount propagation. However, this can be avoided by simply making the parent mount / of the @opt mount a private or slave mount. Then the top mount and the original mount can be unmounted to reveal the mount beneath. These two examples are fairly arcane and are merely added to make it clear how mount propagation has effects on current and future features. More common use-cases will just be things like: mount -t btrfs /dev/sdA /mnt mount -t xfs /dev/sdB --beneath /mnt umount /mnt after which we'll have updated from a btrfs filesystem to a xfs filesystem without ever revealing the underlying mountpoint. The crux is that the proposed mechanism already exists and that it is so powerful as to cover cases where mounts are supposed to be updated with new versions. Crucially, it offers an important flexibility. Namely that updates to a system may either be forced or can be delayed and the umount of the top mount be left to a service if it is a cooperative one. This adds a new flag to move_mount() that allows to explicitly move a beneath the top mount adhering to the following semantics: * Mounts cannot be mounted beneath the rootfs. This restriction encompasses the rootfs but also chroots via chroot() and pivot_root(). To mount a mount beneath the rootfs or a chroot, pivot_root() can be used as illustrated above. * The source mount must be a private mount to force the kernel to allocate a new, unused peer group id. This isn't a required restriction but a voluntary one. It avoids repeating a semantical quirk that already exists today. If bind mounts which already have a peer group id are inserted into mount trees that have the same peer group id this can cause a lot of mount propagation events to be generated (For example, consider running mount --bind /opt /opt in a loop where the parent mount is a shared mount.). * Avoid getting rid of the top mount in the kernel. Cooperative services need to be able to unmount the top mount themselves. This also avoids a good deal of additional complexity. The umount would have to be propagated which would be another rather expensive operation. So namespace_lock() and lock_mount_hash() would potentially have to be held for a long time for both a mount and umount propagation. That should be avoided. * The path to mount beneath must be mounted and attached. * The top mount and its parent must be in the caller's mount namespace and the caller must be able to mount in that mount namespace. * The caller must be able to unmount the top mount to prove that they could reveal the underlying mount. * The propagation tree is calculated based on the destination mount's parent mount and the destination mount's mountpoint on the parent mount. Of course, if the parent of the destination mount and the destination mount are shared mounts in the same peer group and the mountpoint of the new mount to be mounted is a subdir of their ->mnt_root then both will receive a mount of /opt. That's probably easier to understand with an example. Assuming a standard shared rootfs /: mount --bind /opt /opt mount --bind /tmp /opt will cause the same mount tree as: mount --bind /opt /opt mount --beneath /tmp /opt because both / and /opt are shared mounts/peers in the same peer group and the /opt dentry is a subdirectory of both the parent's and the child's ->mnt_root. If a mount tree like that is created it almost always is an accident or abuse of mount propagation. Realistically what most people probably mean in this scenarios is: mount --bind /opt /opt mount --make-private /opt mount --make-shared /opt This forces the allocation of a new separate peer group for the /opt mount. Aferwards a mount --bind or mount --beneath actually makes sense as the / and /opt mount belong to different peer groups. Before that it's likely just confusion about what the user wanted to achieve. * Refuse MOVE_MOUNT_BENEATH if: (1) the @mnt_from has been overmounted in between path resolution and acquiring @namespace_sem when locking @mnt_to. This avoids the proliferation of shadow mounts. (2) if @to_mnt is moved to a different mountpoint while acquiring @namespace_sem to lock @to_mnt. (3) if @to_mnt is unmounted while acquiring @namespace_sem to lock @to_mnt. (4) if the parent of the target mount propagates to the target mount at the same mountpoint. This would mean mounting @mnt_from on @mnt_to->mnt_parent and then propagating a copy @c of @mnt_from onto @mnt_to. This defeats the whole purpose of mounting @mnt_from beneath @mnt_to. (5) if the parent mount @mnt_to->mnt_parent propagates to @mnt_from at the same mountpoint. If @mnt_to->mnt_parent propagates to @mnt_from this would mean propagating a copy @c of @mnt_from on top of @mnt_from. Afterwards @mnt_from would be mounted on top of @mnt_to->mnt_parent and @mnt_to would be unmounted from @mnt->mnt_parent and remounted on @mnt_from. But since @c is already mounted on @mnt_from, @mnt_to would ultimately be remounted on top of @c. Afterwards, @mnt_from would be covered by a copy @c of @mnt_from and @c would be covered by @mnt_from itself. This defeats the whole purpose of mounting @mnt_from beneath @mnt_to. Cases (1) to (3) are required as they deal with races that would cause bugs or unexpected behavior for users. Cases (4) and (5) refuse semantical quirks that would not be a bug but would cause weird mount trees to be created. While they can already be created via other means (mount --bind /opt /opt x n) there's no reason to repeat past mistakes in new features. Link: https://man7.org/linux/man-pages/man8/systemd-sysext.8.html [1] Link: https://brauner.io/2023/02/28/mounting-into-mount-namespaces.html [2] Link: https://github.com/flatcar/sysext-bakery Link: https://fedoraproject.org/wiki/Changes/Unified_Kernel_Support_Phase_1 Link: https://fedoraproject.org/wiki/Changes/Unified_Kernel_Support_Phase_2 Link: https://github.com/systemd/systemd/pull/26013 Reviewed-by: Seth Forshee (DigitalOcean) Message-Id: <20230202-fs-move-mount-replace-v4-4-98f3d80d7eaa@kernel.org> Signed-off-by: Christian Brauner commit 64f44b27ae9184e13ebbca230fa83da02a10f283 Author: Christian Brauner Date: Wed May 3 13:18:41 2023 +0200 fs: use a for loop when locking a mount Currently, lock_mount() uses a goto to retry the lookup until it succeeded in acquiring the namespace_lock() preventing the top mount from being overmounted. While that's perfectly fine we want to lookup the mountpoint on the parent of the top mount in later patches. So adapt the code to make this easier to implement. Also, the for loop is arguably a little cleaner and makes the code easier to follow. No functional changes intended. Reviewed-by: Seth Forshee (DigitalOcean) Message-Id: <20230202-fs-move-mount-replace-v4-3-98f3d80d7eaa@kernel.org> Signed-off-by: Christian Brauner commit 104026c2e49f39399088dfcd6abf5415b655d6fe Author: Christian Brauner Date: Wed May 3 13:18:40 2023 +0200 fs: properly document __lookup_mnt() The comment on top of __lookup_mnt() states that it finds the first mount implying that there could be multiple mounts mounted at the same dentry with the same parent. On older kernels "shadow mounts" could be created during mount propagation. So if a mount @m in the destination propagation tree already had a child mount @p mounted at @mp then any mount @n we propagated to @m at the same @mp would be appended after the preexisting mount @p in @mount_hashtable. This was a completely direct way of creating shadow mounts. That direct way is gone but there are still subtle ways to create shadow mounts. For example, when attaching a source mnt @mnt to a shared mount. The root of the source mnt @mnt might be overmounted by a mount @o after we finished path lookup but before we acquired the namespace semaphore to copy the source mount tree @mnt. After we acquired the namespace lock @mnt is copied including @o covering it. After we attach @mnt to a shared mount @dest_mnt we end up propagation it to all it's peer and slaves @d. If @d already has a mount @n mounted on top of it we tuck @mnt beneath @n. This means, we mount @mnt at @d and mount @n on @mnt. Now we have both @o and @n mounted on the same mountpoint at @mnt. Explain this in the documentation as this is pretty subtle. Reviewed-by: Seth Forshee (DigitalOcean) Message-Id: <20230202-fs-move-mount-replace-v4-2-98f3d80d7eaa@kernel.org> Signed-off-by: Christian Brauner commit 78aa08a8cab6731ab8f8241a9eb0b5021a648dd6 Author: Christian Brauner Date: Wed May 3 13:18:39 2023 +0200 fs: add path_mounted() Add a small helper to check whether a path refers to the root of the mount instead of open-coding this everywhere. Reviewed-by: Seth Forshee (DigitalOcean) Message-Id: <20230202-fs-move-mount-replace-v4-1-98f3d80d7eaa@kernel.org> Signed-off-by: Christian Brauner commit 3e49c1e4a6152b6ad758a28ecce8fb470f46f6ed Author: Bart Van Assche Date: Tue May 16 15:38:53 2023 -0700 block: BFQ: Add several invariant checks If anything goes wrong with the counters that track the number of requests, I/O locks up. Make such scenarios easier to debug by adding invariant checks for the request counters. Additionally, check that BFQ queues are empty before these are freed. Cc: Jan Kara Cc: Yu Kuai Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230516223853.1385255-1-bvanassche@acm.org Signed-off-by: Jens Axboe commit a036e698c231ba884daa37196be3ac6c6dce1d75 Author: Bart Van Assche Date: Wed May 17 10:42:29 2023 -0700 block: mq-deadline: Fix handling of at-head zoned writes Before dispatching a zoned write from the FIFO list, check whether there are any zoned writes in the RB-tree with a lower LBA for the same zone. This patch ensures that zoned writes happen in order even if at_head is set for some writes for a zone and not for others. Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230517174230.897144-12-bvanassche@acm.org Signed-off-by: Jens Axboe commit 0effb390c4bac1a484f0ca6ad3f1d183fcde882b Author: Bart Van Assche Date: Wed May 17 10:42:28 2023 -0700 block: mq-deadline: Handle requeued requests correctly Start dispatching from the start of a zone instead of from the starting position of the most recently dispatched request. If a zoned write is requeued with an LBA that is lower than already inserted zoned writes, make sure that it is submitted first. Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Cc: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230517174230.897144-11-bvanassche@acm.org Signed-off-by: Jens Axboe commit 83c46ed675579fe84354bd07b0d81b525a2b1ebb Author: Bart Van Assche Date: Wed May 17 10:42:27 2023 -0700 block: mq-deadline: Track the dispatch position Track the position (sector_t) of the most recently dispatched request instead of tracking a pointer to the next request to dispatch. This patch is the basis for patch "Handle requeued requests correctly". Without this patch it would be significantly more complicated to make sure that zoned writes are dispatched in LBA order per zone. Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230517174230.897144-10-bvanassche@acm.org Signed-off-by: Jens Axboe commit b2097bd24b438d49d82a5c317be4dc74b626236a Author: Bart Van Assche Date: Wed May 17 10:42:26 2023 -0700 block: mq-deadline: Reduce lock contention blk_mq_free_requests() calls dd_finish_request() indirectly. Prevent nested locking of dd->lock and dd->zone_lock by moving the code for freeing requests. Reviewed-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Cc: Ming Lei Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230517174230.897144-9-bvanassche@acm.org Signed-off-by: Jens Axboe commit 3b463cbea908a9c8d4b9eda09765070506864cbe Author: Bart Van Assche Date: Wed May 17 10:42:25 2023 -0700 block: mq-deadline: Simplify deadline_skip_seq_writes() Make the deadline_skip_seq_writes() code shorter without changing its functionality. Reviewed-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Cc: Ming Lei Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230517174230.897144-8-bvanassche@acm.org Signed-off-by: Jens Axboe commit e0d85cde95bba7d40caa3bf9bc41ee810f0e96df Author: Bart Van Assche Date: Wed May 17 10:42:24 2023 -0700 block: mq-deadline: Clean up deadline_check_fifo() Change the return type of deadline_check_fifo() from 'int' into 'bool'. Use time_is_before_eq_jiffies() instead of time_after_eq(). No functionality has been changed. Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Cc: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230517174230.897144-7-bvanassche@acm.org Signed-off-by: Jens Axboe commit 19821fee3ed42e5b294e95814892d0ad6a9890c9 Author: Bart Van Assche Date: Wed May 17 10:42:23 2023 -0700 block: Introduce blk_rq_is_seq_zoned_write() Introduce the function blk_rq_is_seq_zoned_write(). This function will be used in later patches to preserve the order of zoned writes that require write serialization. This patch includes an optimization: instead of using rq->q->disk->part0->bd_queue to check whether or not the queue is associated with a zoned block device, use rq->q->disk->queue. Cc: Christoph Hellwig Cc: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230517174230.897144-6-bvanassche@acm.org Signed-off-by: Jens Axboe commit a370798201b537f78288e4ef5e0f7fc70889e7ee Author: Bart Van Assche Date: Wed May 17 10:42:22 2023 -0700 block: Introduce op_needs_zoned_write_locking() Introduce a helper function for checking whether write serialization is required if the operation will be sent to a zoned device. A second caller for op_needs_zoned_write_locking() will be introduced in the next patch in this series. Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Cc: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230517174230.897144-5-bvanassche@acm.org Signed-off-by: Jens Axboe commit 3ddbe2a7e0d4a155a805f69c906c9beed30d4cc4 Author: Bart Van Assche Date: Wed May 17 10:42:21 2023 -0700 block: Fix the type of the second bdev_op_is_zoned_write() argument Change the type of the second argument of bdev_op_is_zoned_write() from blk_opf_t into enum req_op because this function expects an operation without flags as second argument. Reviewed-by: Johannes Thumshirn Reviewed-by: Pankaj Raghav Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Cc: Ming Lei Fixes: 8cafdb5ab94c ("block: adapt blk_mq_plug() to not plug for writes that require a zone lock") Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230517174230.897144-4-bvanassche@acm.org Signed-off-by: Jens Axboe commit 4f51644ccff1e4bf159e86da3d9695a1a33ca231 Author: Bart Van Assche Date: Wed May 17 10:42:20 2023 -0700 block: Simplify blk_req_needs_zone_write_lock() Remove the blk_rq_is_passthrough() check because it is redundant: blk_req_needs_zone_write_lock() also calls bdev_op_is_zoned_write() and the latter function returns false for pass-through requests. Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Cc: Ming Lei Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230517174230.897144-3-bvanassche@acm.org Signed-off-by: Jens Axboe commit 45b46b6f157169b452772430566772506e25687a Author: Bart Van Assche Date: Wed May 17 10:42:19 2023 -0700 block: mq-deadline: Add a word in a source code comment Add the missing word "and". Cc: Damien Le Moal Suggested-by: Damien Le Moal Fixes: 945ffb60c11d ("mq-deadline: add blk-mq adaptation of the deadline IO scheduler") Signed-off-by: Bart Van Assche Tested-by: Damien Le Moal Link: https://lore.kernel.org/r/20230517174230.897144-2-bvanassche@acm.org Signed-off-by: Jens Axboe commit dd6216bb16e83e349d5d987227328031b0b0d30d Author: Christoph Hellwig Date: Thu May 18 07:31:01 2023 +0200 blk-mq: make sure elevator callbacks aren't called for passthrough request In case of q->elevator, passthrough request can still be marked as RQF_ELV, so some elevator callbacks will be called for them. Fix this by splitting RQF_SCHED_TAGS, which is set for all requests that are issued on a queue that uses an I/O scheduler, and RQF_USE_SCHED for non-flush, non-passthrough requests on such a queue. Roughly based on two different patches from Ming Lei . Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20230518053101.760632-4-hch@lst.de Signed-off-by: Jens Axboe commit fdcab6cddef24a26b86d798814b3c25057e53c21 Author: Christoph Hellwig Date: Thu May 18 07:31:00 2023 +0200 blk-mq: remove RQF_ELVPRIV RQF_ELVPRIV is set for all non-flush requests that have RQF_ELV set. Expand this condition in the two users of the flag and remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Reviewed-by: Bart Van Assche Link: https://lore.kernel.org/r/20230518053101.760632-3-hch@lst.de Signed-off-by: Jens Axboe commit d97217e7f024bbe9aa62aea070771234c2879358 Author: Ming Lei Date: Thu May 18 07:30:59 2023 +0200 blk-mq: don't queue plugged passthrough requests into scheduler Passthrough requests should never be queued to the I/O scheduler, as scheduling these opaque requests doesn't make sense, and I/O schedulers might require req->bio to be always valid. We never let passthrough requests insert into the scheduler before commit 1c2d2fff6dc0 ("block: wire-up support for passthrough plugging"), restore this behavior even for passthrough requests issued under a plug. [hch: use blk_mq_insert_requests for passthrough requests, fix up the commit message and comments] Reported-by: Guangwu Zhang Closes: https://lore.kernel.org/linux-block/CAGS2=YosaYaUTEMU3uaf+y=8MqSrhL7sYsJn8EwbaM=76p_4Qg@mail.gmail.com/ Investigated-by: Yu Kuai Fixes: 1c2d2fff6dc0 ("block: wire-up support for passthrough plugging") Signed-off-by: Ming Lei Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230518053101.760632-2-hch@lst.de Signed-off-by: Jens Axboe commit 33a86170888b7e4aa0cea94ebb9c67180139cea9 Merge: f1fcbaa18b28d 4795c78768bcb Author: Dave Airlie Date: Fri May 19 11:37:52 2023 +1000 Merge tag 'drm-misc-next-2023-05-11' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 6.5: UAPI Changes: Cross-subsystem Changes: - arch: Consolidate Core Changes: - aperture: Ignore firmware framebuffers with non-primary devices - fbdev: Use fbdev's I/O helpers - sysfs: Expose DRM connector ID - tests: More tests for drm_rect Driver Changes: - armada: Implement fbdev emulation as a client - bridge: - fsl-ldb: Support i.MX6SX - lt9211: Remove blanking packets - lt9611: Remove blanking packets - tc358768: Implement input bus formats reporting, fix various timings and clocks settings - ti-sn65dsi86: Implement wait_hpd_asserted - nouveau: Improve NULL pointer checks before dereference - panel: - nt36523: Support Lenovo J606F - st7703: Support Anbernic RG353V-V2 - new panels: InnoLux G070ACE-L01 - sun4i: Fix MIPI-DSI dotclock - vc4: RGB Range toggle property, BT601 and BT2020 support for HDMI - vkms: Convert to drmm helpers, Add reflection and rotation support Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/2pxmxdzsk2ekjy6xvbpj67zrhtwvkkhfspuvdm5pfm5i54hed6@sooct7yq6z4w commit d5fb8726f1dea70543a93ab1d7332857f157b7f3 Author: Bart Van Assche Date: Thu May 18 15:27:08 2023 -0700 block: Decode all flag names in the debugfs output See also: * Commit 4d337cebcb1c ("blk-mq: avoid to touch q->elevator without any protection"). * Commit 414dd48e882c ("blk-mq: add tagset quiesce interface"). Cc: Christoph Hellwig Cc: Damien Le Moal Cc: Ming Lei Cc: Chaitanya Kulkarni Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230518222708.1190867-1-bvanassche@acm.org Signed-off-by: Jens Axboe commit ed18185b77c8e3164523b9ee0a97d8063eba7992 Author: Tejun Heo Date: Thu May 18 14:50:10 2023 -1000 media: coda: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Reviewed-by: Philipp Zabel Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org commit 8ae5c4d1366a063d59f9340fc12356658f78d699 Author: Tejun Heo Date: Thu May 18 14:42:22 2023 -1000 crypto: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Acked-by: Herbert Xu Cc: Boris Brezillon Cc: Arnaud Ebalard Cc: Srujana Challa Cc: "David S. Miller" Cc: Shijith Thotton Cc: Vladis Dronov Cc: Vincent Mailhol Cc: Wolfram Sang Cc: Alexander Lobakin Cc: Minghao Chi Cc: ye xingchen Cc: linux-crypto@vger.kernel.org commit 1e80449e8d4bd954c775db76dd809ad55cdef687 Author: Tejun Heo Date: Thu May 18 14:40:29 2023 -1000 wifi: ath10/11/12k: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Acked-by: Kalle Valo Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org commit 98ffe02529117095fad0399ce16235d66b8b5f8d Author: William Breathitt Gray Date: Mon Apr 17 15:50:50 2023 -0400 counter: 104-quad-8: Migrate to the regmap API The regmap API supports IO port accessors so we can take advantage of regmap abstractions rather than handling access to the device registers directly in the driver. With regmap we get boundary checks, read-write permissions, operation synchronization locks, and more for free. Most important of all, rather than rolling our own we utilize implementations that are known to work and gain from any future improvements and fixes that come. Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/1f1f7920d2be94aedb6fdf49f429fe6137c8cb24.1681753140.git.william.gray@linaro.org/ Signed-off-by: William Breathitt Gray commit 142c8622b5b28f4fa2b5609c69474e03e723779f Author: William Breathitt Gray Date: Mon Apr 17 15:50:49 2023 -0400 counter: 104-quad-8: Utilize helper functions to handle PR, FLAG and PSC The Preset Register (PR), Flag Register (FLAG), and Filter Clock Prescaler (PSC) have common usage patterns. Wrap up such usage into dedicated functions to improve code clarity. Link: https://lore.kernel.org/r/a2d663337bf2907e0283023c06b1ddcbb32f7f6d.1681753140.git.william.gray@linaro.org/ Signed-off-by: William Breathitt Gray commit 4d8df1689fadec2be9fb585c24f291d0bc3af532 Author: William Breathitt Gray Date: Mon Apr 17 15:50:48 2023 -0400 counter: 104-quad-8: Refactor to buffer states for CMR, IOR, and IDR The 104-quad-8 driver buffers the device configuration states separately, however each device has only three control registers: CMR, IOR, and IDR. Refactoring to buffer the states of these control registers rather than each configuration separately results in succinct code that more closely matches what is happening on the device. Link: https://lore.kernel.org/r/48071415aed43ecdd8595174191b0d906205a9e3.1681753140.git.william.gray@linaro.org/ Signed-off-by: William Breathitt Gray commit 398abaabfaf7d648c22ce87a231102fcdd2c9e60 Author: William Breathitt Gray Date: Mon Apr 17 15:50:47 2023 -0400 counter: 104-quad-8: Utilize bitfield access macros The 104-QUAD-8 features several registers with various bitfields. Utilize bitfield access macros such as u8_get_bits() and u8_encode_bits() to make the code easier to read and the intent clearer. Suggested-by: Jonathan Cameron Link: https://lore.kernel.org/r/7cea5ad049c75d8d1c6f25e288aa743a8d2a25d8.1681753140.git.william.gray@linaro.org/ Signed-off-by: William Breathitt Gray commit 58b18011d08dc90e89a02df487474db560e6b231 Author: Tejun Heo Date: Thu May 18 14:35:25 2023 -1000 wifi: mwifiex: Use default @max_active for workqueues These workqueues only host a single work item and thus doen't need explicit concurrency limit. Let's use the default @max_active. This doesn't cost anything and clearly expresses that @max_active doesn't matter. Signed-off-by: Tejun Heo Reviewed-by: Brian Norris Acked-by: Kalle Valo Cc: Amitkumar Karwar Cc: Ganapathi Bhat Cc: Sharvari Harisangam Cc: Xinming Hu Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org commit 2d5153526f929838b0912ded26862840f72745f4 Author: Arnd Bergmann Date: Wed May 17 14:55:09 2023 +0200 dax: fix missing-prototype warnings dev_dax_probe declaration for this function was removed with the only caller outside of device.c. Mark it static to avoid a W=1 warning: drivers/dax/device.c:399:5: error: no previous prototype for 'dev_dax_probe' Similarly, run_dax() causes a warning, but this one is because the declaration needs to be included: drivers/dax/super.c:337:6: error: no previous prototype for 'run_dax' Fixes: 83762cb5c7c4 ("dax: Kill DEV_DAX_PMEM_COMPAT") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230517125532.931157-1-arnd@kernel.org Signed-off-by: Dan Williams commit 31345a0f59015fada9d15c3e737ed8d27ef5be40 Author: Florian Fainelli Date: Tue May 16 16:28:05 2023 -0700 MAINTAINERS: Replace my email address Switch to the corporate email address for Broadcom related entries. Link: https://lore.kernel.org/r/20230516232806.2922593-1-florian.fainelli@broadcom.com Signed-off-by: Florian Fainelli commit 98be58f2b517b212b57b8493dab92312a52614ac Merge: 9b6d1b0cb0ad3 6f2c1e7c2546f Author: Mark Brown Date: Fri May 19 07:27:08 2023 +0900 Add Chameleon v3 ASoC audio Merge series from Paweł Anikiel : The Google Chameleon v3 is a device made for testing audio and video paths of other devices. This patchset adds support for ASoC audio on this device. It has two audio sources: HDMI audio from the it68051 chip (RX only), and analog audio from the ssm2603 chip (RX and TX). The patchset adds the ASoC platform and codec drivers. commit 25edb25d7972414022c1fa098e2d85876bd7fab2 Author: Ajay Agarwal Date: Thu May 4 16:42:58 2023 +0530 PCI/ASPM: Set only ASPM_STATE_L1 when driver enables L1 Previously pci_enable_link_state(PCIE_LINK_STATE_L1) enabled L1SS as well as L1. Enable only ASPM_STATE_L1 when the caller enables L1. The only current caller is vmd_pm_enable_quirk(), which enables *all* ASPM states, so this should have no functional effect. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20230504111301.229358-3-ajayagarwal@google.com Signed-off-by: Ajay Agarwal Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan commit fb097dcd5a28c0a2325632405c76a66777a6bed9 Author: Ajay Agarwal Date: Thu May 4 16:42:57 2023 +0530 PCI/ASPM: Disable only ASPM_STATE_L1 when driver disables L1 Previously pci_disable_link_state(PCIE_LINK_STATE_L1) disabled L1SS as well as L1. This is unnecessary since pcie_config_aspm_link() takes care that L1SS is not enabled if L1 is disabled. Disable only ASPM_STATE_L1 when the caller disables L1. No functional changes intended. This is consistent with aspm_attr_store_common(), which disables only L1, not L1SS, when L1 is disabled via the sysfs "l1_aspm" file. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20230504111301.229358-2-ajayagarwal@google.com Signed-off-by: Ajay Agarwal Signed-off-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan commit 90223c1136b2930751116fb7de9675f55843f3ad Merge: 1ecaf17d097c9 1f594fe7c9074 Author: Jakub Kicinski Date: Thu May 18 14:39:34 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Conflicts: drivers/net/ethernet/freescale/fec_main.c 6ead9c98cafc ("net: fec: remove the xdp_return_frame when lack of tx BDs") 144470c88c5d ("net: fec: using the standard return codes when xdp xmit errors") Signed-off-by: Jakub Kicinski commit c1b2093dce23158e758818443e059e3fcd54633e Author: Maksim Kiselev Date: Wed May 10 11:11:12 2023 +0300 riscv: dts: allwinner: d1: Add SPI controllers node Some boards form the MangoPi family (MQ\MQ-Dual\MQ-R) may have an optional SPI flash that connects to the SPI0 controller. This controller is the same for R329/D1/R528/T113s SoCs and should be supported by the sun50i-r329-spi driver. So let's add its DT nodes. Signed-off-by: Maksim Kiselev Acked-by: Conor Dooley Reviewed-by: Andre Przywara Reviewed-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230510081121.3463710-6-bigunclemax@gmail.com Signed-off-by: Jernej Skrabec commit 456d8aa37d0f56fc9e985e812496e861dcd6f2f2 Author: Ding Hui Date: Sun May 7 11:40:57 2023 +0800 PCI/ASPM: Disable ASPM on MFD function removal to avoid use-after-free Struct pcie_link_state->downstream is a pointer to the pci_dev of function 0. Previously we retained that pointer when removing function 0, and subsequent ASPM policy changes dereferenced it, resulting in a use-after-free warning from KASAN, e.g.: # echo 1 > /sys/bus/pci/devices/0000:03:00.0/remove # echo powersave > /sys/module/pcie_aspm/parameters/policy BUG: KASAN: slab-use-after-free in pcie_config_aspm_link+0x42d/0x500 Call Trace: kasan_report+0xae/0xe0 pcie_config_aspm_link+0x42d/0x500 pcie_aspm_set_policy+0x8e/0x1a0 param_attr_store+0x162/0x2c0 module_attr_store+0x3e/0x80 PCIe spec r6.0, sec 7.5.3.7, recommends that software program the same ASPM Control value in all functions of multi-function devices. Disable ASPM and free the pcie_link_state when any child function is removed so we can discard the dangling pcie_link_state->downstream pointer and maintain the same ASPM Control configuration for all functions. [bhelgaas: commit log and comment] Debugged-by: Zongquan Qin Suggested-by: Bjorn Helgaas Fixes: b5a0a9b59c81 ("PCI/ASPM: Read and set up L1 substate capabilities") Link: https://lore.kernel.org/r/20230507034057.20970-1-dinghui@sangfor.com.cn Signed-off-by: Ding Hui Signed-off-by: Bjorn Helgaas commit de2bdfb7f79d5c655eb056d459e02be2c7f13c8b Author: Ludwig Kormann Date: Wed May 10 13:15:28 2023 +0200 arm: dts: sunxi: Add ICnova A20 ADB4006 board Add board support for ICnova A20 SomPi compute module on ICnova ADB4006 development board. Specification: SoM - Processor: Allwinner A20 Cortex-A7 Dual Core at 1GHz - 512MB DDR3 RAM - Fast Ethernet (Phy: Realtek RTL8201CP) ADB4006 - I2C - 2x USB 2.0 - 1x Fast Ethernet port - 1x SATA - 2x buttons (PWRON, Boot) - 2x LEDS - serial console - HDMI - µSD-Card slot - Audio Line-In / Line-Out - GPIO pinheaders https://wiki.in-circuit.de/index.php5?title=ICnova_ADB4006 https://wiki.in-circuit.de/index.php5?title=ICnova_A20_SODIMM Reviewed-by: Andre Przywara Signed-off-by: Ludwig Kormann Reviewed-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230510111528.2155582-3-ludwig.kormann@ict42.de Signed-off-by: Jernej Skrabec commit f3781521af7f9de723a95a6236dcd4cc88854533 Author: Ludwig Kormann Date: Wed May 10 13:15:27 2023 +0200 dt-bindings: arm: sunxi: add ICnova A20 ADB4006 binding Document board compatible names for In-Circuit ICnova A20 ADB4006 development board. Reviewed-by: Andre Przywara Acked-by: Krzysztof Kozlowski Signed-off-by: Ludwig Kormann Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230510111528.2155582-2-ludwig.kormann@ict42.de Signed-off-by: Jernej Skrabec commit ec4c54584c504f98c77073c6795936e96f278a15 Author: Roman Beranek Date: Fri May 5 07:21:08 2023 +0200 ARM: dts: sunxi: rename tcon's clock output While the rate of TCON0's DCLK matches dotclock for parallel and LVDS outputs, this doesn't hold for DSI. According manuals from Allwinner, DCLK is an abbreviation of Data Clock, not dotclock, so go with that instead. Signed-off-by: Roman Beranek Acked-by: Jernej Skrabec Acked-by: Maxime Ripard Link: https://lore.kernel.org/r/20230505052110.67514-3-me@crly.cz Signed-off-by: Jernej Skrabec commit ca1170b69968233b34d26432245eddf7d265186b Author: Roman Beranek Date: Fri May 5 07:21:07 2023 +0200 clk: sunxi-ng: a64: force select PLL_MIPI in TCON0 mux TCON0's source clock can be fed from either PLL_MIPI, or PLL_VIDEO0(2X), however MIPI DSI output only seems to work when PLL_MIPI is selected and thus the choice must be hardcoded in. Currently, this driver can't propagate rate change from N-K-M clocks (such as PLL_MIPI) upwards. This prevents PLL_VIDEO0 from participating in setting of the TCON0 data clock rate, limiting the precision with which a target pixel clock can be matched. For outputs with fixed TCON0 divider, that is DSI and LVDS, the dotclock can deviate up to 8% off target. Signed-off-by: Roman Beranek Reviewed-by: Jernej Skrabec Acked-by: Maxime Ripard Link: https://lore.kernel.org/r/20230505052110.67514-2-me@crly.cz Signed-off-by: Jernej Skrabec commit 1ecaf17d097c91a7bd2979c57f7c81c5eeaf526b Merge: 02f8fc1a67c16 e05b5362166b1 Author: Jakub Kicinski Date: Thu May 18 14:05:48 2023 -0700 Merge tag 'nf-next-2023-05-18' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Florian Westphal says: ==================== Netfilter updates for net-next nftables updates: 1. Allow key existence checks with maps. At the moment the kernel requires userspace to pass a destination register for the associated value, make this optional so userspace can query if the key exists, just like with normal sets. 2. nftables maintains a counter per set that holds the number of elements. This counter gets decremented on element removal, but its only incremented if the set has a upper maximum value. Increment unconditionally, this will allow us to update the maximum value later on. 3. At DCCP option maching, from Jeremy Sowden. 4. use struct_size macro, from Christophe JAILLET. Conntrack: 5. Squash holes in struct nf_conntrack_expect, also Christophe JAILLET. 6. Allow clash resolution for GRE Protocol to avoid a packet drop, from Faicker Mo. Flowtable: Simplify route logic and split large functions into smaller chunks, from Pablo Neira Ayuso. * tag 'nf-next-2023-05-18' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next: netfilter: flowtable: split IPv6 datapath in helper functions netfilter: flowtable: split IPv4 datapath in helper functions netfilter: flowtable: simplify route logic netfilter: conntrack: allow insertion clash of gre protocol netfilter: nft_set_pipapo: Use struct_size() netfilter: Reorder fields in 'struct nf_conntrack_expect' netfilter: nft_exthdr: add boolean DCCP option matching netfilter: nf_tables: always increment set element count netfilter: nf_tables: relax set/map validation checks ==================== Link: https://lore.kernel.org/r/20230518100759.84858-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit 454a348714954f7b626c027a90c3967278e3f93b Author: Arnd Bergmann Date: Tue May 16 21:35:49 2023 +0200 x86/platform: Avoid missing-prototype warnings for OLPC There are two functions in the olpc platform that have no prototype: arch/x86/platform/olpc/olpc_dt.c:237:13: error: no previous prototype for 'olpc_dt_fixup' [-Werror=missing-prototypes] arch/x86/platform/olpc/olpc-xo1-pm.c:73:26: error: no previous prototype for 'xo1_do_sleep' [-Werror=missing-prototypes] The first one should just be marked 'static' as there are no other callers, while the second one is called from assembler and is just a false-positive warning that can be silenced by adding a prototype. Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-21-arnd%40kernel.org commit 4d312ac057da57b4a844ec8af14236e74b652efe Author: Arnd Bergmann Date: Tue May 16 21:35:47 2023 +0200 x86/mm: Add early_memremap_pgprot_adjust() prototype early_memremap_pgprot_adjust() is a __weak function with a local prototype, but x86 has a custom implementation that does not see the prototype, causing a W=1 warning: arch/x86/mm/ioremap.c:785:17: error: no previous prototype for 'early_memremap_pgprot_adjust' [-Werror=missing-prototypes] Move the declaration into the global linux/io.h header to avoid this. Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-19-arnd%40kernel.org commit 3b939ba0c21115de99d8e2966eaa2c4e74733d00 Author: Arnd Bergmann Date: Tue May 16 21:35:46 2023 +0200 x86/usercopy: Include arch_wb_cache_pmem() declaration arch_wb_cache_pmem() is declared in a global header but defined by the architecture. On x86, the implementation needs to include the header to avoid this warning: arch/x86/lib/usercopy_64.c:39:6: error: no previous prototype for 'arch_wb_cache_pmem' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-18-arnd%40kernel.org commit 3e0bd4dd35406a130de02c1660e32f6c40121d35 Author: Arnd Bergmann Date: Tue May 16 21:35:45 2023 +0200 x86/vdso: Include vdso/processor.h __vdso_getcpu is declared in a header but this is not included before the definition, causing a W=1 warning: arch/x86/entry/vdso/vgetcpu.c:13:1: error: no previous prototype for '__vdso_getcpu' [-Werror=missing-prototypes] arch/x86/entry/vdso/vdso32/../vgetcpu.c:13:1: error: no previous prototype for '__vdso_getcpu' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-17-arnd%40kernel.org commit e9c2a283e7d9d4e207b5ab4aa1723d62ee2ecbee Author: Arnd Bergmann Date: Tue May 16 21:35:44 2023 +0200 x86/mce: Add copy_mc_fragile_handle_tail() prototype copy_mc_fragile_handle_tail() is only called from assembler, but 'make W=1' complains about a missing prototype: arch/x86/lib/copy_mc.c:26:1: warning: no previous prototype for ‘copy_mc_fragile_handle_tail’ [-Wmissing-prototypes] 26 | copy_mc_fragile_handle_tail(char *to, char *from, unsigned len) Add the prototype to avoid the warning. Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-16-arnd%40kernel.org commit 29bf464cb8ee1b119d23aec88cbf17f9941610ad Author: Arnd Bergmann Date: Tue May 16 21:35:43 2023 +0200 x86/fbdev: Include asm/fb.h as needed fb_is_primary_device() is defined as a global function on x86, unlike the others that have an inline version. The file that defines is however needs to include the declaration to avoid a warning: arch/x86/video/fbdev.c:14:5: error: no previous prototype for 'fb_is_primary_device' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-15-arnd%40kernel.org commit 8a3e82d38674066f4cbed3588b78b0d9b8b15ed7 Author: Arnd Bergmann Date: Tue May 16 21:35:42 2023 +0200 x86/hibernate: Declare global functions in suspend.h Three functions that are defined in x86 specific code to override generic __weak implementations cause a warning because of a missing prototype: arch/x86/power/cpu.c:298:5: error: no previous prototype for 'hibernate_resume_nonboot_cpu_disable' [-Werror=missing-prototypes] arch/x86/power/hibernate.c:129:5: error: no previous prototype for 'arch_hibernation_header_restore' [-Werror=missing-prototypes] arch/x86/power/hibernate.c:91:5: error: no previous prototype for 'arch_hibernation_header_save' [-Werror=missing-prototypes] Move the declarations into a global header so it can be included by any file defining one of these. Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-14-arnd%40kernel.org commit f34f0d3c10eb4d3160fc6fe7a2482cb78d3b0c12 Author: Arnd Bergmann Date: Tue May 16 21:35:40 2023 +0200 x86/entry: Add do_SYSENTER_32() prototype The 32-bit system call entry points can be called on both 32-bit and 64-bit kernels, but on the former the declarations are hidden: arch/x86/entry/common.c:238:24: error: no previous prototype for 'do_SYSENTER_32' [-Werror=missing-prototypes] Move them all out of the #ifdef block to avoid the warnings. Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-12-arnd%40kernel.org commit 056b44a4d10907ec8153863b2a0564e808ef1440 Author: Arnd Bergmann Date: Tue May 16 21:35:38 2023 +0200 x86/quirks: Include linux/pnp.h for arch_pnpbios_disabled() arch_pnpbios_disabled() is defined in architecture code on x86, but this does not include the appropriate header, causing a warning: arch/x86/kernel/platform-quirks.c:42:13: error: no previous prototype for 'arch_pnpbios_disabled' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-10-arnd%40kernel.org commit b963d12aa66ce02b948cd69a20eea5d1d1e0137e Author: Arnd Bergmann Date: Tue May 16 21:35:37 2023 +0200 x86/mm: Include asm/numa.h for set_highmem_pages_init() The set_highmem_pages_init() function is declared in asm/numa.h, which must be included in the file that defines it to avoid a W=1 warning: arch/x86/mm/highmem_32.c:7:13: error: no previous prototype for 'set_highmem_pages_init' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-9-arnd%40kernel.org commit c9664839305dfaccd098b1606c197b0eb21056dc Author: Arnd Bergmann Date: Tue May 16 21:35:36 2023 +0200 x86: Avoid missing-prototype warnings for doublefault code Two functions in the 32-bit doublefault code are lacking a prototype: arch/x86/kernel/doublefault_32.c:23:36: error: no previous prototype for 'doublefault_shim' [-Werror=missing-prototypes] 23 | asmlinkage noinstr void __noreturn doublefault_shim(void) | ^~~~~~~~~~~~~~~~ arch/x86/kernel/doublefault_32.c:114:6: error: no previous prototype for 'doublefault_init_cpu_tss' [-Werror=missing-prototypes] 114 | void doublefault_init_cpu_tss(void) The first one is only called from assembler, while the second one is declared in doublefault.h, but this file is not included. Include the header file and add the other declaration there as well. Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-8-arnd%40kernel.org commit 16db7e9c6e974a0935494cd31179c819d4cbf86e Author: Arnd Bergmann Date: Tue May 16 21:35:35 2023 +0200 x86/fpu: Include asm/fpu/regset.h The fpregs_soft_set/fpregs_soft_get functions are declared in a header that is not included in the file that defines them, causing a W=1 warning: /home/arnd/arm-soc/arch/x86/math-emu/fpu_entry.c:638:5: error: no previous prototype for 'fpregs_soft_set' [-Werror=missing-prototypes] 638 | int fpregs_soft_set(struct task_struct *target, | ^~~~~~~~~~~~~~~ /home/arnd/arm-soc/arch/x86/math-emu/fpu_entry.c:690:5: error: no previous prototype for 'fpregs_soft_get' [-Werror=missing-prototypes] 690 | int fpregs_soft_get(struct task_struct *target, Include the file here to avoid the warning. Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-7-arnd%40kernel.org commit 2eb5d1df2aa657ccc65cfab67e65eb9f97cef4d6 Author: Arnd Bergmann Date: Tue May 16 21:35:34 2023 +0200 x86: Add dummy prototype for mk_early_pgtbl_32() 'make W=1' warns about a function without a prototype in the x86-32 head code: arch/x86/kernel/head32.c:72:13: error: no previous prototype for 'mk_early_pgtbl_32' [-Werror=missing-prototypes] This is called from assembler code, so it does not actually need a prototype. I could not find an appropriate header for it, so just declare it in front of the definition to shut up the warning. Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-6-arnd%40kernel.org commit 0253b04d5b2683f5a4fdcf655b1cae6739d5ab30 Author: Arnd Bergmann Date: Tue May 16 21:35:31 2023 +0200 x86/pci: Mark local functions as 'static' Two functions in this file are global but have no prototype in a header and are not called from elsewhere, so they should be static: arch/x86/pci/ce4100.c:86:6: error: no previous prototype for 'sata_revid_init' [-Werror=missing-prototypes] arch/x86/pci/ce4100.c:175:5: error: no previous prototype for 'bridge_read' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-3-arnd%40kernel.org commit 26c3379a6912ab7f5115cea31123a57de8d2ce8a Author: Arnd Bergmann Date: Tue May 16 21:35:30 2023 +0200 x86/ftrace: Move prepare_ftrace_return prototype to header On 32-bit builds, the prepare_ftrace_return() function only has a global definition, but no prototype before it, which causes a warning: arch/x86/kernel/ftrace.c:625:6: warning: no previous prototype for ‘prepare_ftrace_return’ [-Wmissing-prototypes] 625 | void prepare_ftrace_return(unsigned long ip, unsigned long *parent, Move the prototype that is already needed for some configurations into a header file where it can be seen unconditionally. Signed-off-by: Arnd Bergmann Signed-off-by: Dave Hansen Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/all/20230516193549.544673-2-arnd%40kernel.org commit f219050af06d83f436945880fc9c04db3bb2860f Author: Dmitry Torokhov Date: Thu May 11 11:52:47 2023 -0700 Input: libps2 - do not discard non-ack bytes when controlling LEDs Upon receiving a PS/2 command the device and controller are supposed to stop sending normal data (scancodes or movement packets) and instead immediately start delivering ACK/NAK and command response. Unfortunately often EC has an output buffer which may contain latched data by the time the EC receives a command from the host. The kernel used to ignore such data, but that may cause "stuck" keys if the data dropped happens to be a break code or a part of a break code. This occasionally happens, for example, on Chromebooks when the kernel tries to toggle CapsLock LED on a keyboard while user releases Alt+Search keyboard shortcut. Fix this by passing the first non-ACK byte to the normal handler for a handful of PS/2 commands that are expected to be used during normal device operation (as opposed to probe/configuration time). Reviewed-by: Raul E Rangel Link: https://lore.kernel.org/r/20230511185252.386941-8-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit c4c7eac8ee78d896635ce05d7a1c3f813fcbe24c Author: Dmitry Torokhov Date: Mon May 15 16:14:29 2023 -0700 Input: libps2 - introduce common interrupt handler Instead of exposing inner workings of libps2 to drivers such as atkbd and psmouse, have them define pre-receive and receive callbacks, and provide a common handler that can be used with underlying serio port. While at this add kerneldoc to the module. Link: https://lore.kernel.org/r/ZGK81cxqjr/KS1kA@google.com Signed-off-by: Dmitry Torokhov commit 7d674f9150c361e5b992551b46516d41eede3722 Author: Dmitry Torokhov Date: Thu May 11 11:52:45 2023 -0700 Input: libps2 - fix aborting PS/2 commands When aborting PS/2 command the kernel should [re]set all flags before waking up waiters, otherwise waiting thread may read obsolete values of flags. Reported-by: Raul Rangel Reviewed-by: Raul E Rangel Link: https://lore.kernel.org/r/20230511185252.386941-6-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 1db0fd245b6016c21097b5ae01aeb447484de951 Author: Dmitry Torokhov Date: Thu May 11 11:52:44 2023 -0700 Input: libps2 - fix NAK handling Do not try to process "resend" or "reject" responses from the device as normal response data for a command. Reviewed-by: Raul E Rangel Link: https://lore.kernel.org/r/20230511185252.386941-5-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit df9fe0e653c28756ab98f58175f8c58baf156ef1 Author: Dmitry Torokhov Date: Thu May 11 11:52:43 2023 -0700 Input: libps2 - rework handling of command response It is not entirely correct that libps2 sets PS2_FLAG_CMD1 after the device acknowledges each byte sent to the device by the host. Rework the code so that PS2_FLAG_CMD1 and PS2_FLAG_CMD are set only once, at the beginning of PS/2 command execution. Reviewed-by: Raul E Rangel Link: https://lore.kernel.org/r/20230511185252.386941-4-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit fc522f3bdf43efa75b54775978b6b6c19d0d997d Author: Dmitry Torokhov Date: Thu May 11 11:52:42 2023 -0700 Input: libps2 - remove special handling of ACK for command byte When getting unexpected data while waiting for an acknowledgement it does not matter what command phase is currently executed, and ps2_handle_ack() should indicate that no further processing is needed for the received data byte. Remove PS2_FLAG_ACK_CMD and associated handling. Note that while it is possible to make ps2_handle_ack (and ps2_handle_repsonse) return void, it will be done when the code will be converted to common PS/2 interrupt handler later. Reviewed-by: Raul E Rangel Link: https://lore.kernel.org/r/20230511185252.386941-3-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 100e16959c3ca8cb7be788ed3e2c5867481f35f6 Author: Dmitry Torokhov Date: Thu May 11 11:52:41 2023 -0700 Input: libps2 - attach ps2dev instances as serio port's drvdata In preparation of having unified interrupt handler for PS/2 devices, instead of attaching instances of psmouse and atkbd structures as serio's driver data, switch to attaching ps2dev instances. Reviewed-by: Raul Rangel Link: https://lore.kernel.org/r/20230511185252.386941-2-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit bd5d93df86a7ddf98a2a37e9c3751e3cb334a66c Author: Hans de Goede Date: Wed May 17 11:23:59 2023 +0200 ACPI: video: Add backlight=native DMI quirk for Lenovo ThinkPad X131e (3371 AMD version) Linux defaults to picking the non-working ACPI video backlight interface on the Lenovo ThinkPad X131e (3371 AMD version). Add a DMI quirk to pick the working native radeon_bl0 interface instead. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 48436f2e9834b46b47b038b605c8142a1c07bc85 Author: Hans de Goede Date: Wed May 17 11:23:58 2023 +0200 ACPI: video: Add backlight=native DMI quirk for Apple iMac11,3 Linux defaults to picking the non-working ACPI video backlight interface on the Apple iMac11,3 . Add a DMI quirk to pick the working native radeon_bl0 interface instead. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit f91280f35895d6dcb53f504968fafd1da0b00397 Author: Hans de Goede Date: Sat Apr 29 18:34:58 2023 +0200 ACPI: x86: Add ACPI_QUIRK_UART1_SKIP for Lenovo Yoga Book yb1-x90f/l The Lenovo Yoga Book yb1-x90f/l 2-in-1 which ships with Android as Factory OS has (another) bug in its DSDT where the UART resource for the BTH0 ACPI device contains "\\_SB.PCIO.URT1" as path to the UART. Note that is with a letter 'O' instead of the number '0' which is wrong. This causes Linux to instantiate a standard /dev/ttyS? device for the UART instead of a /sys/bus/serial device, which in turn causes bluetooth to not work. Similar DSDT bugs have been encountered before and to work around those the acpi_quirk_skip_serdev_enumeration() helper exists. Previous devices had the broken resource pointing to the first UART, while the BT HCI was on the second UART, which ACPI_QUIRK_UART1_TTY_UART2_SKIP deals with. Add a new ACPI_QUIRK_UART1_SKIP quirk for skipping enumeration of UART1 instead for the Yoga Book case and add this quirk to the existing DMI quirk table entry for the yb1-x90f/l . This leaves the UART1 controller unbound allowing the x86-android-tablets module to manually instantiate a serdev for it fixing bluetooth. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit eb14232fb7713fa6258fa876d6d387c03ec21868 Author: Christian Göttsche Date: Fri May 12 11:21:55 2023 +0200 selinux: make header files self-including Include all necessary headers in header files to enable third party applications, like LSP servers, to resolve all used symbols. ibpkey.h: include "flask.h" for SECINITSID_UNLABELED initial_sid_to_string.h: include for NULL Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 14c3555f055dd0819381148bf5b569cc5ba9ddfb Author: Arnd Bergmann Date: Wed May 17 22:23:39 2023 +0200 arm64: kvm: avoid overflow in integer division The newly added kvm_mmu_split_nr_page_tables() function uses DIV_ROUND_DOWN_ULL() to divide 64-bit addresses, but this requires a 32-bit divisior, and PUD_SIZE may exceed that when 64KB pages are used: arch/arm64/kvm/mmu.c: In function 'kvm_mmu_split_nr_page_tables': include/linux/math.h:42:64: error: conversion from 'long unsigned int' to 'u32' {aka 'unsigned int'} changes value from '68719476736' to '0' [-Werror=overflow] 42 | DIV_ROUND_DOWN_ULL((unsigned long long)(ll) + (d) - 1, (d)) | ^~~ include/linux/math.h:39:47: note: in definition of macro 'DIV_ROUND_DOWN_ULL' 39 | #define DIV_ROUND_DOWN_ULL(ll, d) div_u64(ll, d) | ^ arch/arm64/kvm/mmu.c:95:22: note: in expansion of macro 'DIV_ROUND_UP_ULL' 95 | n += DIV_ROUND_UP_ULL(range, PUD_SIZE); | ^~~~~~~~~~~~~~~~ Since this code is only used on 64-bit targets, DIV_ROUND_UP() can deal with this more easily, as it already takes 64-bit arguments. Fixes: e7bf7a490c68 ("KVM: arm64: Split huge pages when dirty logging is enabled") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230517202352.793673-1-arnd@kernel.org Signed-off-by: Oliver Upton commit ed99135f7621459ef873991115372ba1afe88a04 Author: Christian Göttsche Date: Thu May 11 14:31:47 2023 +0200 selinux: keep context struct members in sync Commit 53f3517ae087 ("selinux: do not leave dangling pointer behind") reset the `str` field of the `context` struct in an OOM error branch. In this struct the fields `str` and `len` are coupled and should be kept in sync. Set the length to zero according to the string be set to NULL. Fixes: 53f3517ae087 ("selinux: do not leave dangling pointer behind") Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 9b6d1b0cb0ad37bb69fe8ee127236d77c2574a28 Merge: cbbc0ec6dea09 b932f21f66786 Author: Mark Brown Date: Fri May 19 02:11:12 2023 +0900 ASoC: codecs: do not store status in state containe Merge series from Krzysztof Kozlowski : Many SoundWire CODEC drivers store the device status in a member variable in the driver data but never reference this, and in any case the SoundWire core stores this information for drivers so it would be redundant even if used. commit 85c3222dddc6697dc7513623983a2ba748ba710e Author: Paolo Abeni Date: Thu Apr 20 19:17:14 2023 +0200 selinux: Implement mptcp_add_subflow hook Newly added subflows should inherit the LSM label from the associated MPTCP socket regardless of the current context. This patch implements the above copying sid and class from the MPTCP socket context, deleting the existing subflow label, if any, and then re-creating the correct one. The new helper reuses the selinux_netlbl_sk_security_free() function, and the latter can end-up being called multiple times with the same argument; we additionally need to make it idempotent. Signed-off-by: Paolo Abeni Acked-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Paul Moore commit e3d9387f002612093dbeaa272f7930ce5108033f Author: Paolo Abeni Date: Thu Apr 20 19:17:13 2023 +0200 security, lsm: Introduce security_mptcp_add_subflow() MPTCP can create subflows in kernel context, and later indirectly expose them to user-space, via the owning MPTCP socket. As discussed in the reported link, the above causes unexpected failures for server, MPTCP-enabled applications. Let's introduce a new LSM hook to allow the security module to relabel the subflow according to the owning user-space process, via the MPTCP socket owning the subflow. Note that the new hook requires both the MPTCP socket and the new subflow. This could allow future extensions, e.g. explicitly validating the MPTCP <-> subflow linkage. Link: https://lore.kernel.org/mptcp/CAHC9VhTNh-YwiyTds=P1e3rixEDqbRTFj22bpya=+qJqfcaMfg@mail.gmail.com/ Signed-off-by: Paolo Abeni Acked-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Paul Moore commit 1a365a2b24cda48ff8d441e91663a6c0ab1353a9 Author: Radhakrishna Sripada Date: Wed May 17 16:31:11 2023 -0700 drm/i915/mtl: Extend Wa_16014892111 to MTL A-step Like DG2, MTL a-step hardware is subject to Wa_16014892111 which requires that any changes made to the DRAW_WATERMARK register be done via an INDIRECT_CTX batch buffer rather than through a regular context workaround. The bspec gives the same non-default recommended tuning value for DRAW_WATERMARK as DG2, so we can re-use the INDIRECT_CTX code to apply that tuning setting on A-step hardware. Application of the tuning setting on B-step and later does not need INDIRECT_CTX handling and is already done in mtl_ctx_workarounds_init() as usual. v2: Limit the WA for A-step v3: Update the commit message. v4: Reorder platform checks and update commit message. Bspec: 68331 Cc: Haridhar Kalvala Cc: Gustavo Sousa Reviewed-by: Matt Roper Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230517233111.297542-2-radhakrishna.sripada@intel.com commit 5f12c8d0a761af5dda2e798b1af56ff967442b83 Author: Radhakrishna Sripada Date: Wed May 17 16:31:10 2023 -0700 drm/i915/mtl: Add MTL performance tuning changes MTL reuses the tuning parameters for DG2. Extend the dg2 performance tuning parameters to MTL. v2: Add DRAW_WATERMARK tuning parameter. v3: Limit DRAW_WATERMARK tuning to non A0 step. v4: Reorder platform checks. Restrict Blend fill caching optimization to Render GT. v5: Move mtl tuning params to its own function Bspec: 68331 Cc: Haridhar Kalvala Cc: Matt Roper Reviewed-by: Gustavo Sousa Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230517233111.297542-1-radhakrishna.sripada@intel.com commit 25e7976db86bed5f1826bdd5c59e5be424a9d91f Author: Andrzej Hajda Date: Thu May 18 16:50:52 2023 +0200 drm/i915/mtl: do not enable render power-gating on MTL Multiple CI tests fails with forcewake ack timeouts if render power gating is enabled. BSpec 52698 states it should be 0 for MTL, but apparently this info is outdated. Anyway since the patch makes MTL pass basic tests added FIXME tag informing this is temporary workaround. v2: added FIXME tag Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4983 Signed-off-by: Andrzej Hajda Reviewed-by: Nirmoy Das Reviewed-by: Rodrigo Vivi Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230517-mtl_disable_render_pg-v2-1-0b51180a43f0@intel.com commit 615ed9ece01814a94fb544226cb3f4e03f06851d Author: Mika Kahola Date: Fri May 12 15:00:03 2023 +0300 drm/i915/mtl: Fix expected reg value for Thunderbolt PLL disabling While disabling Thunderbolt PLL, we request PLL to be stopped and wait for ACK bit to be cleared. The expected value should be '0' instead of '~XELPDP_TBT_CLOCK_ACK' or otherwise we incorrectly receive dmesg warn "PHY PLL not unlocked in 10us". Signed-off-by: Mika Kahola Reviewed-by: Imre Deak Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230512120003.587360-1-mika.kahola@intel.com commit c4dc8dc32bd1fa0ed04d25f2e4004d854c163c39 Author: Baozhu Ni Date: Wed May 17 09:27:26 2023 +0800 e1000e: Add @adapter description to kdoc Provide a description for the kernel doc of the @adapter of e1000e_trigger_lsc() Signed-off-by: Baozhu Ni Reviewed-by: Simon Horman Signed-off-by: Tony Nguyen commit 7271522b729b80d9581f4b3debef0e942d3a1049 Author: Tom Rix Date: Fri Apr 28 16:00:09 2023 -0400 igb: Define igb_pm_ops conditionally on CONFIG_PM For s390, gcc with W=1 reports drivers/net/ethernet/intel/igb/igb_main.c:186:32: error: 'igb_pm_ops' defined but not used [-Werror=unused-const-variable=] 186 | static const struct dev_pm_ops igb_pm_ops = { | ^~~~~~~~~~ The only use of igb_pm_ops is conditional on CONFIG_PM. The definition of igb_pm_ops should also be conditional on CONFIG_PM Signed-off-by: Tom Rix Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 95b681485563c64585de78662ee52d06b7fa47d9 Author: Kurt Kanzenbach Date: Wed Apr 12 09:36:11 2023 +0200 igc: Avoid transmit queue timeout for XDP High XDP load triggers the netdev watchdog: |NETDEV WATCHDOG: enp3s0 (igc): transmit queue 2 timed out The reason is the Tx queue transmission start (txq->trans_start) is not updated in XDP code path. Therefore, add it for all XDP transmission functions. Signed-off-by: Kurt Kanzenbach Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 0ac2a08f42ce5c06d5d1216eac59c046961acd4f Author: Dmitry Baryshkov Date: Fri May 12 03:13:32 2023 +0300 interconnect: add clk-based icc provider support For some devices it is useful to export clocks as interconnect providers, if the clock corresponds to bus bandwidth. For example, on MSM8996 the cluster interconnect clock should be scaled according to the cluster frequencies. Exporting it as an interconnect allows one to properly describe this as the cluster bandwidth requirements. Tested-by: Yassine Oudjana Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230512001334.2983048-3-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov commit 375cccc6593650ab9436d3d5fad7eabd7085fff3 Author: Dmitry Baryshkov Date: Fri May 12 03:13:31 2023 +0300 dt-bindings: interconnect/msm8996-cbf: add defines to be used by CBF On msm8996 CBF interconnects power and performance CPU clusters. Add corresponding interconnect defines to be used in device trees. Acked-by: Krzysztof Kozlowski Tested-by: Yassine Oudjana Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230512001334.2983048-2-dmitry.baryshkov@linaro.org Signed-off-by: Georgi Djakov commit 325bec7157b3859b45b9471447f5d130ab8a8723 Author: Julien Panis Date: Thu May 11 11:51:22 2023 +0200 mfd: tps6594: Add driver for TI TPS6594 PMIC This patch adds support for TPS6594 PMIC MFD core. It provides communication through the I2C and SPI interfaces, and supports protocols with embedded CRC data fields for safety applications. Signed-off-by: Julien Panis Link: https://lore.kernel.org/r/20230511095126.105104-3-jpanis@baylibre.com Signed-off-by: Lee Jones commit 632c60ecd25dbacee54d5581fe3aeb834b57010a Author: Dan Carpenter Date: Wed Apr 19 17:23:01 2023 +0300 clk: imx: scu: use _safe list iterator to avoid a use after free This loop is freeing "clk" so it needs to use list_for_each_entry_safe(). Otherwise it dereferences a freed variable to get the next item on the loop. Fixes: 77d8f3068c63 ("clk: imx: scu: add two cells binding support") Signed-off-by: Dan Carpenter Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/0793fbd1-d2b5-4ec2-9403-3c39343a3e2d@kili.mountain Signed-off-by: Abel Vesa commit 82a9fa6e9e3c769f7edc62810c9718997cada53d Author: Oswald Buddenhagen Date: Thu May 18 16:09:44 2023 +0200 ALSA: emu10k1: make freeing untouched playback voices cheap This allows us to drop the code that tries to preserve already allocated voices upon repeated hw_param callback invocations. Getting it right for multi-channel voices would otherwise get a bit hairy. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518140947.3725394-5-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit b840f8d8fcb3df9e65bb6782a9072897b6ea117d Author: Oswald Buddenhagen Date: Thu May 18 16:09:43 2023 +0200 ALSA: emu10k1: improve voice status display in /proc Eliminate the MIDI type, as there is no such thing - the MPU401 port doesn't have anything to do with voices. For clarity, differentiate between regular and extra voices. Don't atomize the enum into bits in the table display. Simplify/optimize the storage. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518140947.3725394-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 3eb5b1d0a11d1daf85243eb06f813cf83752e1d0 Author: Oswald Buddenhagen Date: Thu May 18 16:09:42 2023 +0200 ALSA: emu10k1: don't forget to reset reclaimed synth voices The subsequent allocation may still fail after freeing some voices, so we shouldn't leave them in their programmed state. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518140947.3725394-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit f26a4cf087cbfc9dc71bb3812e8e11ccac0d4d61 Author: Oswald Buddenhagen Date: Thu May 18 16:09:41 2023 +0200 ALSA: emu10k1: simplify freeing synth voices snd_emu10k1_voice_free() resets the hardware itself, so doing that in the calling function as well is redundant. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518140947.3725394-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit fccd6f31a450d58109f64eda2dd9294e160fb0aa Author: Oswald Buddenhagen Date: Thu May 18 16:03:39 2023 +0200 ALSA: emu10k1: enable bit-exact playback, part 4: send amounts On Audigy, the send amounts are merely targets, presumably to avoid sound distortion due to sudden changes, which the EMU8K docu explicitly warns about. However, that "soft-start" would prevent bit-for-bit reproduction, so we now force the current send amounts to their final values at PCM playback init. One might want to do that for the MIDI synthesizer as well, though it seems mostly pointless due to the attack phase each note has anyway. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518140339.3722279-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 08e55ae996cbdbd76c3eb12fcad6cc79cba7ddbc Author: Oswald Buddenhagen Date: Thu May 18 16:03:38 2023 +0200 ALSA: emu10k1: enable bit-exact playback, part 3: pitch CPF_CURRENTPITCH starts swerving towards PTRX_PITCHTARGET as soon as that is set. In practice this means that CPF_FRACADDRESS may acquire a non-zero value before we manage to force CPF_CURRENTPITCH to the final value, which would prevent bit-for-bit reproduction. To avoid that this state persists, we now reset CPF_FRACADDRESS when setting CPF_CURRENTPITCH, and to (mostly) avoid that it progresses too far in the first place (possibly even reaching CCCA_CURRADDR), we write PTRX and CPF in one critical section (though NMIs, etc. still make this unreliable). Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518140339.3722279-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 6077af232cf58bfa4203c2364f99e0218aac7667 Author: Peng Fan Date: Sat May 6 17:08:56 2023 +0800 clk: imx: drop imx_unregister_clocks There is no user using imx_unregister_clocks, so drop it. Signed-off-by: Peng Fan Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20230506090856.3599035-1-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa commit 5c2664cc09f94ba11c61908d5c7dac1c35d6dee8 Author: Oswald Buddenhagen Date: Thu May 18 16:03:39 2023 +0200 ALSA: emu10k1: fix terminating synthesizer voices Make terminate_voice() actually do at all what it's supposed to do: instantly and completely shut down the note. The bogus behavior was mostly harmless, as usually the voice is freed right afterwards, which implicitly terminates it anyway. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518140339.3722308-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit df335e9a8bcb58be3b7388cff556f06eeb3d024f Author: Oswald Buddenhagen Date: Thu May 18 16:03:38 2023 +0200 ALSA: emu10k1: fix synthesizer sample playback position and caching Compensate for the cache delay, and actually populate the cache. Without these, the playback would start with garbage (which would be (mostly?) masqueraded by the attack phase). Unlike for the PCM voices, this doesn't try to compensate for the interpolator read-ahead, because it's pointless to be super-exact here. Note that this code is probably still broken for particularly short samples, because we ignore the loop-related parts of CCR. But I'm not going to reverse-engineer that now ... Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518140339.3722308-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 816967d55f425a647137ef884d8e92f2baf541dc Author: Tom Rix Date: Thu May 18 08:38:26 2023 -0400 ALSA: emu10k1: set variables emu1010_routing_info and emu1010_pads_info storage-class-specifier to static smatch reports sound/pci/emu10k1/emumixer.c:519:39: warning: symbol 'emu1010_routing_info' was not declared. Should it be static? sound/pci/emu10k1/emumixer.c:859:36: warning: symbol 'emu1010_pads_info' was not declared. Should it be static? These variables are only used in their defining file, so it should be static Signed-off-by: Tom Rix Reviewed-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518123826.925752-1-trix@redhat.com Signed-off-by: Takashi Iwai commit 02f8fc1a67c160b2faab2c9e9439026deb076971 Merge: b50a8b0d57ab1 d38ddd56d90eb Author: Paolo Abeni Date: Thu May 18 15:32:12 2023 +0200 Merge branch 'net-lan966x-add-support-for-pcp-dei-dscp' Horatiu Vultur says: ==================== net: lan966x: Add support for PCP, DEI, DSCP This patch series extends lan966x to offload to the hardware the following features: - PCP: this configuration is per port both at ingress and egress. - App trust: which allows to specify a trust order of app selectors. This can be PCP or DSCP or DSCP/PCP. - default priority - DSCP: this configuration is shared between the ports both at ingress and egress. ==================== Link: https://lore.kernel.org/r/20230516201408.3172428-1-horatiu.vultur@microchip.com Signed-off-by: Paolo Abeni commit d38ddd56d90eb156b2708637403fd8a936c0113a Author: Horatiu Vultur Date: Tue May 16 22:14:08 2023 +0200 net: lan966x: Add support for DSCP rewrite Add support for DSCP rewrite in lan966x driver. On egress DSCP is rewritten from either classified DSCP, or frame DSCP. Classified DSCP is determined by the Analyzer Classifier on ingress, and is mapped from classified QoS class and DP level. Classification of DSCP is by default enabled for all ports. It is required that DSCP is trusted for the egress port *and* rewrite table is not empty, in order to rewrite DSCP based on classified DSCP, otherwise DSCP is always rewritten from frame DSCP. Reviewed-by: Daniel Machon Signed-off-by: Horatiu Vultur Signed-off-by: Paolo Abeni commit 363f98b96a43f11cb4c6e4d69199d656d2e5b373 Author: Horatiu Vultur Date: Tue May 16 22:14:07 2023 +0200 net: lan966x: Add support for PCP rewrite Add support for rewrite of PCP and DEI value, based on QoS and DP level. The DCB rewrite table is queried for mappings between priority and PCP/DEI. The classified DP level is then encoded in the DEI bit, if a mapping for DEI exists. Reviewed-by: Daniel Machon Signed-off-by: Horatiu Vultur Signed-off-by: Paolo Abeni commit f8ba50ea13fb38da26aea8e1cba2ab30493e2c71 Author: Horatiu Vultur Date: Tue May 16 22:14:06 2023 +0200 net: lan966x: Add support for offloading default prio Add support for offloading default prio. Reviewed-by: Daniel Machon Reviewed-by: Piotr Raczynski Signed-off-by: Horatiu Vultur Signed-off-by: Paolo Abeni commit 0c88d98108c615d9a8c1325857d44792c8924b16 Author: Horatiu Vultur Date: Tue May 16 22:14:05 2023 +0200 net: lan966x: Add support for offloading dscp table Add support for offloading dscp app entries. The dscp values are global for all lan966x ports. Reviewed-by: Daniel Machon Signed-off-by: Horatiu Vultur Signed-off-by: Paolo Abeni commit 10c71a97eeeb0fb703225203059d2aeac79acb2a Author: Horatiu Vultur Date: Tue May 16 22:14:04 2023 +0200 net: lan966x: Add support for apptrust Make use of set/getapptrust() to implement per-selector trust and trust order. Reviewed-by: Daniel Machon Signed-off-by: Horatiu Vultur Signed-off-by: Paolo Abeni commit a83e463036ef491ba0f7b99f82a12c902a285245 Author: Horatiu Vultur Date: Tue May 16 22:14:03 2023 +0200 net: lan966x: Add support for offloading pcp table Add support for offloading pcp app entries. Lan966x has 8 priority queues per port and for each priority it also has a drop precedence. Reviewed-by: Daniel Machon Reviewed-by: Piotr Raczynski Signed-off-by: Horatiu Vultur Signed-off-by: Paolo Abeni commit 1fd22211354a94cb5afa7d7dab1a8e2c5ec1eed8 Author: Horatiu Vultur Date: Tue May 16 22:14:02 2023 +0200 net: lan966x: Add registers to configure PCP, DEI, DSCP Add the registers that are needed to configure the PCP, DEI and DSCP of the switch both at ingress and also at egress. Reviewed-by: Daniel Machon Reviewed-by: Piotr Raczynski Signed-off-by: Horatiu Vultur Signed-off-by: Paolo Abeni commit 2437d5ea2191f3059246a1a7ac6fc4c8cc004dec Author: Baoquan He Date: Sat May 6 19:16:28 2023 +0800 dmaengine: make QCOM_HIDMA depend on HAS_IOMEM On s390 systems (aka mainframes), it has classic channel devices for networking and permanent storage that are currently even more common than PCI devices. Hence it could have a fully functional s390 kernel with CONFIG_PCI=n, then the relevant iomem mapping functions [including ioremap(), devm_ioremap(), etc.] are not available. Here let QCOM_HIDMA depend on HAS_IOMEM so that it won't be built to cause below compiling error if PCI is unset. -------------------------------------------------------- ld: drivers/dma/qcom/hidma.o: in function `hidma_probe': hidma.c:(.text+0x4b46): undefined reference to `devm_ioremap_resource' ld: hidma.c:(.text+0x4b9e): undefined reference to `devm_ioremap_resource' make[1]: *** [scripts/Makefile.vmlinux:35: vmlinux] Error 1 make: *** [Makefile:1264: vmlinux] Error 2 Signed-off-by: Baoquan He Reviewed-by: Niklas Schnelle Cc: Andy Gross Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Vinod Koul Cc: linux-arm-msm@vger.kernel.org Cc: dmaengine@vger.kernel.org Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230506111628.712316-3-bhe@redhat.com Signed-off-by: Vinod Koul commit 401f022cc5a2f0c521767d82c352d83aed944834 Author: Vinod Koul Date: Wed May 17 12:14:34 2023 +0530 dmaengine: ste_dma40: fix typo in enum documentation s/40_command/d40_command to fix the below warning reported: drivers/dma/ste_dma40.c:151: warning: expecting prototype for enum 40_command. Prototype was for enum d40_command instead Reviewed-by: Linus Walleij Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20230517064434.141091-2-vkoul@kernel.org Signed-off-by: Vinod Koul commit ef1e1c41a11d37069029bc0563c2fa6915d9880b Author: Vinod Koul Date: Wed May 17 12:14:33 2023 +0530 dmaengine: ste_dma40: use correct print specfier for resource_size_t We should use %pR for printing resource_size_t, so update that fixing the warning: drivers/dma/ste_dma40.c:3556:25: warning: format specifies type 'unsigned int' but the argument has type 'resource_size_t' (aka 'unsigned long long') [-Wformat] Reported-by: kernel test robot Fixes: 5a1a3b9c19dd ("dmaengine: ste_dma40: Get LCPA SRAM from SRAM node") Reviewed-by: Linus Walleij Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20230517064434.141091-1-vkoul@kernel.org Signed-off-by: Vinod Koul commit 32882f657e7811abb6a883653b68dce0539a693e Author: Konrad Dybcio Date: Fri Apr 7 22:14:46 2023 +0200 interconnect: qcom: rpm: Set QoS registers only once The QoS registers are (or according to Qualcomm folks, on most platforms) persistent until a full chip reboot. Move the QoS-setting functions to the probe function so that we don't needlessly do it over and over again. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230228-topic-qos-v8-4-ee696a2c15a9@linaro.org Signed-off-by: Georgi Djakov commit ca545907c712f0045468ae66e1bf52dc69922ebe Author: Konrad Dybcio Date: Fri Apr 7 22:14:45 2023 +0200 interconnect: qcom: rpm: Drop unused parameters The QoS-setting functions do not care about the bandwidth values passed. Drop them. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230228-topic-qos-v8-3-ee696a2c15a9@linaro.org Signed-off-by: Georgi Djakov commit 1a12928e25627e02126ad2d1c12cfdba79d6bd94 Author: Konrad Dybcio Date: Fri Apr 7 22:14:44 2023 +0200 interconnect: qcom: rpm: Rename icc provider num_clocks to num_bus_clocks In preparation for handling non-scaling clocks that we still have to enable, rename num_clocks to more descriptive num_bus_clocks. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230228-topic-qos-v8-2-ee696a2c15a9@linaro.org Signed-off-by: Georgi Djakov commit 6643b532b3c3412a2e2c351aed100ab4fb31884c Author: Konrad Dybcio Date: Fri Apr 7 22:14:43 2023 +0200 interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks Rename the "clocks" (and _names) fields of qcom_icc_desc to "bus_clocks" in preparation for introducing handling of clocks that need to be enabled but not voted on with aggregate frequency. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230228-topic-qos-v8-1-ee696a2c15a9@linaro.org Signed-off-by: Georgi Djakov commit 46055699e5f81db8c70946609f445c572983eca5 Author: Oswald Buddenhagen Date: Thu May 18 11:31:34 2023 +0200 ALSA: emu10k1: introduce and use snd_emu10k1_ptr_write_multiple() While this nicely denoises the code, the real intent is being able to write many registers pseudo-atomically, which will come in handy later. Idea stolen from kX-project. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518093134.3697955-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 6797400ef4abb4359c225a207c1f3ca28591f51c Author: Oswald Buddenhagen Date: Thu May 18 11:30:47 2023 +0200 ALSA: emu10k1: fix handling of half-loop interrupts We'd try to iterate the voices twice without resetting the pointer. This went unnoticed, because the code isn't actually in use. Amends commit 27ae958cf6 ("emu10k1 driver - add multichannel device hw:x,3 [2-8/8]"). Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518093047.3697887-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 9436f0151d30b80873eda80341304524db9e8149 Author: Oswald Buddenhagen Date: Thu May 18 11:30:46 2023 +0200 ALSA: emu10k1: simplify interrupt handler, part 3 Handle the "timeout" (actually the retry counter) such that it's more obvious and causes less cost in the normal case. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518093047.3697887-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 016027741f97457087b81bf304f1cb807bdeffe0 Author: Oswald Buddenhagen Date: Thu May 18 11:30:45 2023 +0200 ALSA: emu10k1: simplify interrupt handler, part 2 Remove weird INTE_* clearing code. The bits were a subset of the actually handled interrupts, which kind of contradicted the stated purpose. I suppose it would make sense to complete the set and negate it, but interrupts being enabled out of the blue is neither something that happens a lot, nor should it result in just one error message, IMO. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518093047.3697887-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 583307bafb264a1a42a1ffc8cdf6493f9deda414 Author: Oswald Buddenhagen Date: Thu May 18 11:30:44 2023 +0200 ALSA: emu10k1: simplify interrupt handler, part 1 IPR_CHANNELNUMBERMASK cannot be non-zero when IPR_CHANNELLOOP is unset, so join marking them as handled. This logically reverts part of commit f453e20d8a0 ("ALSA update 0.9.3a"), which made the inverse change with no explanation. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518093047.3697887-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 0be0a62fd08414e3cd67c8fb898b2bb9e74eb225 Author: Oswald Buddenhagen Date: Thu May 18 11:22:24 2023 +0200 ALSA: emu10k1: fix PCM playback buffer size constraints The period_bytes_min parameter and the buffer_bytes minimum constraint made no sense at all, as they didn't reflect any hardware limitation. Instead, apply a frame-based period_size minimum constraint, which is derived from the cache size (it would be actually possible to go below that, but it would require special handling, and it would be practically impossible to keep up with the IRQ rate anyway). Sync up the constraints of the EFX playback with those of the regular playback, as there is no reason for them to diverge. N.b., the maximum buffer size is actually arbitrary - the hardware could go waay beyond 128 KiB. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230518092224.3696958-9-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 912d7af473f163ccdeb02aaabc3534177936b86c Author: Alexander Stein Date: Fri Apr 21 13:55:17 2023 +0200 clk: imx6ul: retain early UART clocks during kernel init Make sure to keep UART clocks enabled during kernel init if earlyprintk or earlycon are active. Signed-off-by: Alexander Stein Reviewed-by: Peng Fan Link: https://lore.kernel.org/r/20230421115517.1940990-1-alexander.stein@ew.tq-group.com Signed-off-by: Abel Vesa commit 120e1aa2f2e60b55f9d20c2fe1c6144739e00dc4 Author: Yeqi Fu Date: Thu May 18 13:25:15 2023 +0800 spi: hisi-kunpeng: Fix error checking The function debugfs_create_dir returns ERR_PTR if an error occurs, and the appropriate way to verify for errors is to use the inline function IS_ERR. The patch will substitute the null-comparison with IS_ERR. Suggested-by: Ivan Orlov Date: Wed May 17 17:15:16 2023 +0200 ASoC: mediatek: mt8192-mt6359: Remove " Jack" from Headphone pin name Function jack_kctl_name_gen() will remove the redundant " Jack" from the name, if present, and then it will add it back, so that all of the controls are named "(pin-name) Jack". Remove " Jack" from the Headphone pin name to spare some CPU cycles. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno Date: Thu May 18 09:27:53 2023 +0200 ASoC: codecs: rt722-sdca: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Thu May 18 09:27:52 2023 +0200 ASoC: codecs: rt715: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Thu May 18 09:27:51 2023 +0200 ASoC: codecs: rt715-sdca: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Thu May 18 09:27:50 2023 +0200 ASoC: codecs: rt712-sdca: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Thu May 18 09:27:49 2023 +0200 ASoC: codecs: rt712-sdca-dmic: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Thu May 18 09:27:48 2023 +0200 ASoC: codecs: rt711: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Thu May 18 09:27:47 2023 +0200 ASoC: codecs: rt711-sdca: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Thu May 18 09:27:46 2023 +0200 ASoC: codecs: rt700: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Thu May 18 09:27:45 2023 +0200 ASoC: codecs: rt5682: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Thu May 18 09:27:44 2023 +0200 ASoC: codecs: rt1318: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Thu May 18 09:27:43 2023 +0200 ASoC: codecs: rt1316: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Thu May 18 09:27:42 2023 +0200 ASoC: codecs: rt1308: do not store status in state container Driver in its update status callback stores Soundwire device status in state container but it never uses it later. Simplify the code a bit. Signed-off-by: Krzysztof Kozlowski Date: Sun Apr 16 12:00:04 2023 -0300 clk: imx: imx6sx: Remove CLK_SET_RATE_PARENT from the LDB clocks On the i.MX6SX, it is common to use the LDB and LCDIF with the same parent clock, such as the IMX6SX_CLK_PLL5_VIDEO_DIV, for example. Due to the CLK_SET_RATE_PARENT flag, the LDB clock would try to set the clock parent rate, which can mess with the required clock rate calculated from the eLCDIF driver. To prevent this problem, remove the CLK_SET_RATE_PARENT flag from the LDB clocks, so that a correct clock relationship can be achieved. Signed-off-by: Fabio Estevam Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230416150004.16834-1-festevam@gmail.com Signed-off-by: Abel Vesa commit 8d81d3a0e97d54d6f6b58fb8ea011b1fa0991f6f Author: Serge Semin Date: Thu May 11 22:09:02 2023 +0300 MAINTAINERS: Add myself as the DW eDMA driver reviewer The driver original maintainer has been inactive for almost two years now. It doesn't positively affect the new patches tests and reviews process. Since the DW eDMA engine has been embedded into the PCIe controllers in several our SoCs we will be interested in helping with the updates review. Signed-off-by: Serge Semin Acked-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20230511190902.28896-15-Sergey.Semin@baikalelectronics.ru Signed-off-by: Vinod Koul commit 20d54e48d9c705091a025afff5839da2ea606f6b Author: Thomas Zimmermann Date: Fri May 12 12:24:44 2023 +0200 fbdev: Rename fb_mem*() helpers Update the names of the fb_mem*() helpers to be consistent with their regular counterparts. Hence, fb_memset() now becomes fb_memset_io(), fb_memcpy_fromfb() now becomes fb_memcpy_fromio() and fb_memcpy_tofb() becomes fb_memcpy_toio(). No functional changes. v6: * update new file fb_io_fops.c Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Sam Ravnborg Reviewed-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-8-tzimmermann@suse.de commit 8f8eaa1b023580f7dce7fe8d73539b093edea65b Author: Thomas Zimmermann Date: Fri May 12 12:24:43 2023 +0200 fbdev: Move framebuffer I/O helpers into Implement framebuffer I/O helpers, such as fb_read*() and fb_write*(), in the architecture's header file or the generic one. The common case has been the use of regular I/O functions, such as __raw_readb() or memset_io(). A few architectures used plain system- memory reads and writes. Sparc used helpers for its SBus. The architectures that used special cases provide the same code in their __raw_*() I/O helpers. So the patch replaces this code with the __raw_*() functions and moves it to for all architectures. v8: * remove garbage after commit-message tags v6: * fix fb_readq()/fb_writeq() on 64-bit mips (kernel test robot) v5: * include in ; fix s390 build v4: * ia64, loongarch, sparc64: add fb_mem*() to arch headers to keep current semantics (Arnd) v3: * implement all architectures with generic helpers * support reordering and native byte order (Geert, Arnd) Signed-off-by: Thomas Zimmermann Tested-by: Sui Jingfeng Reviewed-by: Arnd Bergmann Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-7-tzimmermann@suse.de commit 8ff1541da3908b504cb53e5384d5deae2b9c6e1a Author: Thomas Zimmermann Date: Fri May 12 12:24:42 2023 +0200 fbdev: Include instead of Replace include statements for with . Fixes the coding style: if a header is available in asm/ and linux/, it is preferable to include the header from linux/. This only affects a few source files, most of which already include . Suggested-by: Sam Ravnborg Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Sui Jingfeng Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-6-tzimmermann@suse.de commit e1d534ac5b764a573789d4e1d79be6fb7abb1d78 Author: Thomas Zimmermann Date: Fri May 12 12:24:41 2023 +0200 fbdev: Include in various drivers The code uses writel() and similar I/O-memory helpers. Include the header file to get the declarations. Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Sam Ravnborg Reviewed-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-5-tzimmermann@suse.de commit 30745abe9bb8c67f4ac5486cd810cbb72e3afa16 Author: Thomas Zimmermann Date: Fri May 12 12:24:40 2023 +0200 ipu-v3: Include The code uses readl() and writel(). Include the header file to get the declarations. Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Sam Ravnborg Reviewed-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-4-tzimmermann@suse.de commit 2df418ff8be6c5e96bf92d74ce341342dc9080fe Author: Thomas Zimmermann Date: Fri May 12 12:24:39 2023 +0200 fbdev/matrox: Remove trailing whitespaces Fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Sam Ravnborg Reviewed-by: Sui Jingfeng Tested-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-3-tzimmermann@suse.de commit bb47f218fd015b8530364271463f6cbc4d15b814 Author: Thomas Zimmermann Date: Fri May 12 12:24:38 2023 +0200 fbdev/hitfb: Cast I/O offset to address Cast I/O offsets to pointers to use them with I/O functions. The I/O functions expect pointers of type 'volatile void __iomem *', but the offsets are plain integers. Build warnings are ../drivers/video/fbdev/hitfb.c: In function 'hitfb_accel_wait': ../arch/x86/include/asm/hd64461.h:18:33: warning: passing argument 1 of 'fb_readw' makes pointer from integer without a cast [-Wint-conversion] 18 | #define HD64461_IO_OFFSET(x) (HD64461_IOBASE + (x)) | ^~~~~~~~~~~~~~~~~~~~~~ | | | unsigned int ../arch/x86/include/asm/hd64461.h:93:33: note: in expansion of macro 'HD64461_IO_OFFSET' 93 | #define HD64461_GRCFGR HD64461_IO_OFFSET(0x1044) /* Accelerator Configuration Register */ | ^~~~~~~~~~~~~~~~~ ../drivers/video/fbdev/hitfb.c:47:25: note: in expansion of macro 'HD64461_GRCFGR' 47 | while (fb_readw(HD64461_GRCFGR) & HD64461_GRCFGR_ACCSTATUS) ; | ^~~~~~~~~~~~~~ In file included from ../arch/x86/include/asm/fb.h:15, from ../include/linux/fb.h:19, from ../drivers/video/fbdev/hitfb.c:22: ../include/asm-generic/fb.h:52:57: note: expected 'const volatile void *' but argument is of type 'unsigned int' 52 | static inline u16 fb_readw(const volatile void __iomem *addr) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ This patch only fixes the build warnings. It's not clear if the I/O offsets can legally be passed to the I/O helpers. It was apparently broken in 2007 when custom inw()/outw() helpers got removed by commit 34a780a0afeb ("sh: hp6xx pata_platform support."). Fixing the driver would require setting the I/O base address. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305102136.eMjTSPwH-lkp@intel.com/ Signed-off-by: Thomas Zimmermann Cc: Artur Rojek Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-2-tzimmermann@suse.de commit e05b5362166b18a224c30502e81416e4d622d3e4 Author: Pablo Neira Ayuso Date: Thu May 11 07:35:35 2023 +0200 netfilter: flowtable: split IPv6 datapath in helper functions Add context structure and helper functions to look up for a matching IPv6 entry in the flowtable and to forward packets. No functional changes are intended. Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit a10fa0b489d627911895b64c6530636748dd7911 Author: Pablo Neira Ayuso Date: Thu May 11 07:35:34 2023 +0200 netfilter: flowtable: split IPv4 datapath in helper functions Add context structure and helper functions to look up for a matching IPv4 entry in the flowtable and to forward packets. No functional changes are intended. Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit fa502c86566680ac62bc28ec883a069bf7a2aa5e Author: Pablo Neira Ayuso Date: Thu May 11 07:35:33 2023 +0200 netfilter: flowtable: simplify route logic Grab reference to dst from skbuff earlier to simplify route caching. Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit d671fd82eaa9bceedd48ea2b0679a9a6bbcd6532 Author: Faicker Mo Date: Sun Apr 23 10:29:57 2023 +0800 netfilter: conntrack: allow insertion clash of gre protocol NVGRE tunnel is used in the VM-to-VM communications. The VM packets are encapsulated in NVGRE and sent from the host. For NVGRE there are two tuples(outer sip and outer dip) in the host conntrack item. Insertion clashes are more likely to happen if the concurrent connections are sent from the VM. Signed-off-by: Faicker Mo Signed-off-by: Florian Westphal commit a2a0ffb0846895923991aa87e022dc228d53c125 Author: Christophe JAILLET Date: Fri May 5 23:26:34 2023 +0200 netfilter: nft_set_pipapo: Use struct_size() Use struct_size() instead of hand writing it. This is less verbose and more informative. Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Signed-off-by: Florian Westphal commit 61e03e912da8212c3de2529054502e8388dfd484 Author: Christophe JAILLET Date: Mon May 8 18:53:14 2023 +0200 netfilter: Reorder fields in 'struct nf_conntrack_expect' Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nf_conntrack_expect' from 264 to 256 bytes. This structure deserve a dedicated cache, so reducing its size looks nice. Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Signed-off-by: Florian Westphal commit b9f9a485fb0eb80b0e2b90410b28cbb9b0e85687 Author: Jeremy Sowden Date: Tue May 9 22:19:45 2023 +0100 netfilter: nft_exthdr: add boolean DCCP option matching The xt_dccp iptables module supports the matching of DCCP packets based on the presence or absence of DCCP options. Extend nft_exthdr to add this functionality to nftables. Link: https://bugzilla.netfilter.org/show_bug.cgi?id=930 Signed-off-by: Jeremy Sowden Signed-off-by: Florian Westphal commit d4b7f29eb85c93893bc27388b37709efbc3c9a0e Author: Florian Westphal Date: Thu May 11 22:45:35 2023 +0200 netfilter: nf_tables: always increment set element count At this time, set->nelems counter only increments when the set has a maximum size. All set elements decrement the counter unconditionally, this is confusing. Increment the counter unconditionally to make this symmetrical. This would also allow changing the set maximum size after set creation in a later patch. Signed-off-by: Florian Westphal commit a4878eeae39048e6abe85891c714b49dc13fc08c Author: Florian Westphal Date: Fri May 12 14:19:47 2023 +0200 netfilter: nf_tables: relax set/map validation checks Its currently not allowed to perform queries on a map, for example: table t { map m { typeof ip saddr : meta mark .. chain c { ip saddr @m counter will fail, because kernel requires that userspace provides a destination register when the referenced set is a map. However, internally there is no real distinction between sets and maps, maps are just sets where each key is associated with a value. Relax this so that maps can be used just like sets. This allows to have rules that query if a given key exists without making use of the associated value. This also permits != checks which don't work for map lookups. When no destination reg is given for a map, then permit this for named maps. Data and dump paths need to be updated to consider priv->dreg_set instead of the 'set-is-a-map' check. Checks in reduce and validate callbacks are not changed, this can be relaxed later if a need arises. Signed-off-by: Florian Westphal commit fa75064d92fdec157d75375bca06c77fb30c25df Author: Oswald Buddenhagen Date: Wed May 17 19:42:56 2023 +0200 ALSA: emu10k1: refactor PCM playback address handling Pull the special handling of extra voices out of snd_emu10k1_pcm_init_voice(), simplify snd_emu10k1_playback_pointer(), and make the logic overall clearer. Also, add verbose comments. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230517174256.3657060-9-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 9581128a213461cf2f82dd09558b7066d363360c Author: Oswald Buddenhagen Date: Wed May 17 19:42:55 2023 +0200 ALSA: emu10k1: refactor PCM playback cache filling Rename snd_emu10k1_playback_invalidate_cache() to the more apt snd_emu10k1_playback_fill_cache(), and factor out snd_emu10k1_playback_prepare_voices(), which calls the former for all channels. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230517174256.3657060-8-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 9e72666b9ee1140b7ecc66abc30b1c694ed7a6a0 Author: Oswald Buddenhagen Date: Wed May 17 19:42:54 2023 +0200 ALSA: emu10k1: improve API of low-level voice manipulation functions Originally, there was a 1:1 relationship between the PCM streams' and the low-level voices' parameters. The addition of multi-channel playback partially invalidated that, but didn't introduce proper layering, so things kept working only by virtue of the multi-channel device never having two channels (yet). The upcoming addition of 32-bit playback would complete upending the relationships. So this patch detaches the low-level parameters from the high-level ones: we pass pre-calculated bit width and stereo flags to the low-level manipulation functions instead of calculating them in-place from the stream parameters. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230517174256.3657060-7-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 5b1cd21f0f05757e724e18a599b391689f8565fc Author: Oswald Buddenhagen Date: Wed May 17 19:42:52 2023 +0200 ALSA: emu10k1: fix PCM playback cache and interrupt handling The cache causes a fixed delay regardless of stream parameters. Consequently, all that "cache invalidate size" calculation stuff was garbage (which can be traced right back to Creative's OSS driver). This also removes the definitions of registers CD1..CDF, because they are accessed only relative to CD0 anyway. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230517174256.3657060-5-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit cd6dceb197ca5ec70a3ed4c6aec50f9abdf85f8e Author: Oswald Buddenhagen Date: Wed May 17 19:42:51 2023 +0200 ALSA: emu10k1: skip pointless cache setup for extra voices Given that the data is going to be ignored anyway, and that the cache does not influence interrupt timing (which is the purpose of the extra voices), it's pointless to pre-fill the cache. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230517174256.3657060-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit be3b7629e13a5861b6988d46912212ac9f24c369 Author: Oswald Buddenhagen Date: Wed May 17 19:42:50 2023 +0200 ALSA: emu10k1: remove pointless displacement of the extra voices The idea is to make the extra voice lag behind the "real" voices, but moving the buffer address around doesn't contribute to that, as the CCCA write below uses the same address. The exact address is unimportant, as the data is discarded anyway. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230517174256.3657060-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 1e5323bd7725c1e3a5bd65af210ea7d54ccdbd00 Author: Oswald Buddenhagen Date: Wed May 17 19:42:49 2023 +0200 Revert "ALSA: emu10k1 - delay the PCM interrupts (add pcm_irq_delay parameter)" This workaround fails to address the underlying problem, which is actually wholly self-made. Subsequent patches will fix it. This reverts commit 56385a12d9bb9e173751f74b6c430742018cafc0. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230517174256.3657060-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit af7fd0276ed76357974ebb0e5b5968b4b4e84781 Author: Oswald Buddenhagen Date: Wed May 17 19:42:48 2023 +0200 ALSA: emu10k1: pass frame instead of byte addresses ... to snd_emu10k1_pcm_init_voice(). This makes the code arguably less convoluted. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230517174256.3657060-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit b50a8b0d57ab1ef11492171e98a030f48682eac3 Author: Christophe JAILLET Date: Sat May 6 18:04:16 2023 +0200 net: openvswitch: Use struct_size() Use struct_size() instead of hand writing it. This is less verbose and more informative. Signed-off-by: Christophe JAILLET Acked-by: Eelco Chaudron Link: https://lore.kernel.org/r/e7746fbbd62371d286081d5266e88bbe8d3fe9f0.1683388991.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit b1cf7a5615157e958c2bdac9aa981676c07a10d9 Author: Gustavo A. R. Silva Date: Mon May 15 13:22:48 2023 -0600 mlxfw: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations alone in structs with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members alone in structs. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/285 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/ZGKGiBxP0zHo6XSK@work Signed-off-by: Jakub Kicinski commit fe6559fab328972a2c8687d322fa54ab6d08f209 Author: Gustavo A. R. Silva Date: Mon May 15 13:23:46 2023 -0600 net: libwx: Replace zero-length array with flexible-array member Zero-length arrays as fake flexible arrays are deprecated, and we are moving towards adopting C99 flexible-array members instead. Transform zero-length array into flexible-array member in struct wx_q_vector. Link: https://github.com/KSPP/linux/issues/21 Link: https://github.com/KSPP/linux/issues/286 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Simon Horman Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/ZGKGwtsobVZecWa4@work Signed-off-by: Jakub Kicinski commit 8a1dd1e547c1a037692e7a6da6a76108108c72b1 Author: Tejun Heo Date: Wed May 17 17:02:09 2023 -1000 workqueue: Track and monitor per-workqueue CPU time usage Now that wq_worker_tick() is there, we can easily track the rough CPU time consumption of each workqueue by charging the whole tick whenever a tick hits an active workqueue. While not super accurate, it provides reasonable visibility into the workqueues that consume a lot of CPU cycles. wq_monitor.py is updated to report the per-workqueue CPU times. v2: wq_monitor.py was using "cputime" as the key when outputting in json format. Use "cpu_time" instead for consistency with other fields. Signed-off-by: Tejun Heo commit 6363845005202148b8409ec3082e80845c19d309 Author: Tejun Heo Date: Wed May 17 17:02:08 2023 -1000 workqueue: Report work funcs that trigger automatic CPU_INTENSIVE mechanism Workqueue now automatically marks per-cpu work items that hog CPU for too long as CPU_INTENSIVE, which excludes them from concurrency management and prevents stalling other concurrency-managed work items. If a work function keeps running over the thershold, it likely needs to be switched to use an unbound workqueue. This patch adds a debug mechanism which tracks the work functions which trigger the automatic CPU_INTENSIVE mechanism and report them using pr_warn() with exponential backoff. v3: Documentation update. v2: Drop bouncing to kthread_worker for printing messages. It was to avoid introducing circular locking dependency through printk but not effective as it still had pool lock -> wci_lock -> printk -> pool lock loop. Let's just print directly using printk_deferred(). Signed-off-by: Tejun Heo Suggested-by: Peter Zijlstra commit 616db8779b1e3f93075df691432cccc5ef3c3ba0 Author: Tejun Heo Date: Wed May 17 17:02:08 2023 -1000 workqueue: Automatically mark CPU-hogging work items CPU_INTENSIVE If a per-cpu work item hogs the CPU, it can prevent other work items from starting through concurrency management. A per-cpu workqueue which intends to host such CPU-hogging work items can choose to not participate in concurrency management by setting %WQ_CPU_INTENSIVE; however, this can be error-prone and difficult to debug when missed. This patch adds an automatic CPU usage based detection. If a concurrency-managed work item consumes more CPU time than the threshold (10ms by default) continuously without intervening sleeps, wq_worker_tick() which is called from scheduler_tick() will detect the condition and automatically mark it CPU_INTENSIVE. The mechanism isn't foolproof: * Detection depends on tick hitting the work item. Getting preempted at the right timings may allow a violating work item to evade detection at least temporarily. * nohz_full CPUs may not be running ticks and thus can fail detection. * Even when detection is working, the 10ms detection delays can add up if many CPU-hogging work items are queued at the same time. However, in vast majority of cases, this should be able to detect violations reliably and provide reasonable protection with a small increase in code complexity. If some work items trigger this condition repeatedly, the bigger problem likely is the CPU being saturated with such per-cpu work items and the solution would be making them UNBOUND. The next patch will add a debug mechanism to help spot such cases. v4: Documentation for workqueue.cpu_intensive_thresh_us added to kernel-parameters.txt. v3: Switch to use wq_worker_tick() instead of hooking into preemptions as suggested by Peter. v2: Lai pointed out that wq_worker_stopping() also needs to be called from preemption and rtlock paths and an earlier patch was updated accordingly. This patch adds a comment describing the risk of infinte recursions and how they're avoided. Signed-off-by: Tejun Heo Acked-by: Peter Zijlstra Cc: Linus Torvalds Cc: Lai Jiangshan commit bdf8b9bfc131864f0fcef268b34123acfb6a1b59 Author: Tejun Heo Date: Wed May 17 17:02:08 2023 -1000 workqueue: Improve locking rule description for worker fields * Some worker fields are modified only by the worker itself while holding pool->lock thus making them safe to read from self, IRQ context if the CPU is running the worker or while holding pool->lock. Add 'K' locking rule for them. * worker->sleeping is currently marked "None" which isn't very descriptive. It's used only by the worker itself. Add 'S' locking rule for it. A future patch will depend on the 'K' rule to access worker->current_* from the scheduler ticks. Signed-off-by: Tejun Heo commit c54d5046a06b90adb3d1188f0741a88692854354 Author: Tejun Heo Date: Wed May 17 17:02:08 2023 -1000 workqueue: Move worker_set/clr_flags() upwards They are going to be used in wq_worker_stopping(). Move them upwards. Signed-off-by: Tejun Heo Cc: Lai Jiangshan commit 3a46c9833c1fad3b4a91bbbeb856810c7e1d8e47 Author: Tejun Heo Date: Wed May 17 17:02:08 2023 -1000 workqueue: Re-order struct worker fields struct worker was laid out with the intent that all fields that are modified for each work item execution are in the first cacheline. However, this hasn't been true for a while with the addition of ->last_func. Let's just collect hot fields together at the top. Move ->sleeping in the hole after ->current_color and move ->lst_func right below. While at it, drop the cacheline comment which isn't useful anymore. Signed-off-by: Tejun Heo Cc: Lai Jiangshan commit 725e8ec59c56c65fb92e343c10a8842cd0d4f194 Author: Tejun Heo Date: Wed May 17 17:02:08 2023 -1000 workqueue: Add pwq->stats[] and a monitoring script Currently, the only way to peer into workqueue operations is through tracing. While possible, it isn't easy or convenient to monitor per-workqueue behaviors over time this way. Let's add pwq->stats[] that track relevant events and a drgn monitoring script - tools/workqueue/wq_monitor.py. It's arguable whether this needs to be configurable. However, it currently only has several counters and the runtime overhead shouldn't be noticeable given that they're on pwq's which are per-cpu on per-cpu workqueues and per-numa-node on unbound ones. Let's keep it simple for the time being. v2: Patch reordered to earlier with fewer fields. Field will be added back gradually. Help message improved. Signed-off-by: Tejun Heo Cc: Lai Jiangshan commit 4fc6a939aba4c0aa723b9da8363d262d3d60e57e Author: Devi Priya Date: Tue Apr 25 14:10:09 2023 +0530 arm64: dts: qcom: ipq9574: Drop bias_pll_ubi_nc_clk input Drop unused bias_pll_ubi_nc_clk input to the clock controller. Signed-off-by: Devi Priya Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230425084010.15581-6-quic_devipriy@quicinc.com commit 6fb45762691d12d9812c41d20b2f5db1412047ae Author: Devi Priya Date: Tue Apr 25 14:10:05 2023 +0530 arm64: dts: qcom: ipq9574: Update the size of GICC & GICV regions Update the size of GICC and GICV regions to 8kB as the GICC_DIR & GICV_DIR registers lie in the second 4kB region. Also, add target CPU encoding. Fixes: 97cb36ff52a1 ("arm64: dts: qcom: Add ipq9574 SoC and AL02 board support") Signed-off-by: Devi Priya Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230425084010.15581-2-quic_devipriy@quicinc.com commit 50205122b01e7d7a0604dbe6809f77cbf5c5b529 Author: Devi Priya Date: Tue Apr 25 14:10:08 2023 +0530 clk: qcom: gcc-ipq9574: constify struct clk_init_data Make the clk_init_data struct constant. Signed-off-by: Devi Priya Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230425084010.15581-5-quic_devipriy@quicinc.com commit 5439a5be0337548c849b92683e4cca37cb211524 Author: Devi Priya Date: Tue Apr 25 14:10:07 2023 +0530 clk: qcom: gcc-ipq9574: Clean up included headers Some included headers aren't actually used anywhere, while other headers with the declaration of functions and structures aren't directly included. Get rid of the unused ones, and add the ones that should be included directly. Signed-off-by: Devi Priya Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230425084010.15581-4-quic_devipriy@quicinc.com commit 3f2c154e1b3d31fd13bac4bfbb632db3168dfdb6 Author: Devi Priya Date: Tue Apr 25 14:10:06 2023 +0530 dt-bindings: clock: qcom,ipq9574-gcc: Add maintainer Add Bjorn andersson to the maintainer's list. Signed-off-by: Devi Priya Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230425084010.15581-3-quic_devipriy@quicinc.com commit 5d8d9330921770fb953e8e749bbd049ac0fae988 Author: André Apitzsch Date: Wed May 17 08:32:31 2023 +0200 arm64: dts: qcom: msm8916-longcheer-l8910: Add front flash LED l8910 uses OCP8110 flash LED driver. Add it to the device tree. Tested-by: Stephan Gerhold Signed-off-by: André Apitzsch Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230514-x5_front_flash-v2-1-845a8bb0483b@apitzsch.eu commit 99d33ee61cb06e1235dab404b33d4694fe18088f Author: Konrad Dybcio Date: Wed May 17 22:12:52 2023 +0200 arm64: dts: qcom: sm8550: Add missing RPMhPD OPP levels We need more granularity for things like the GPU. Add the missing levels. This unfortunately requires some re-indexing, resulting in an ugly diff. Rename the nodes to prevent that in the future. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517-topic-kailua-rpmhpd-v2-3-3063ce19c491@linaro.org commit 1738600082987ddcf9cfce753ae3c581c8e46933 Author: Konrad Dybcio Date: Wed May 17 22:12:51 2023 +0200 dt-bindings: power: qcom,rpmpd: Format RPMh levels better After adding the missing levels with a nice, easy-to-read diff, reformat the defines to make them nice to look at.. Acked-by: Krzysztof Kozlowski Acked-by: Conor Dooley Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517-topic-kailua-rpmhpd-v2-2-3063ce19c491@linaro.org commit 4755e880b08d963db24a1b3a710ee0e62f36aa49 Author: Konrad Dybcio Date: Wed May 17 22:12:50 2023 +0200 dt-bindings: power: qcom,rpmpd: add missing RPMH levels There are a lot of RPMh levels that we haven't included yet.. some sadly turned out to be necessary, add them! Acked-by: Krzysztof Kozlowski Acked-by: Conor Dooley Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230517-topic-kailua-rpmhpd-v2-1-3063ce19c491@linaro.org commit 2b967894f80aac2c7421eb545c32ed995f8d9877 Author: Bartosz Golaszewski Date: Mon May 15 14:19:08 2023 +0200 arm64: dts: qcom: sa8775p: mark the UFS controller as dma-coherent The UFS controller is cache coherent, so mark it as such in the dtsi. Fixes: be543efeee17 ("arm64: dts: qcom: sa8775p: add UFS nodes") Signed-off-by: Bartosz Golaszewski Suggested-by: Manivannan Sadhasivam Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230515121908.303432-1-brgl@bgdev.pl commit 6f22587c915c34a4ee02c314cfdb708b11b5eafb Author: Vinay Belgaumkar Date: Tue May 16 08:49:05 2023 -0700 drm/i915/guc/slpc: Disable rps_boost debugfs rps_boost debugfs shows host turbo related info. This is not valid when SLPC is enabled. guc_slpc_info already shows the number of boosts. Add num_waiters there as well and disable rps_boost when SLPC is enabled. v2: Replace Bug with Link to resolve checkpatch warning Link: https://gitlab.freedesktop.org/drm/intel/-/issues/7632 Reviewed-by: Ashutosh Dixit Signed-off-by: Vinay Belgaumkar Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230516154905.1048006-1-vinay.belgaumkar@intel.com commit 9fe0731bc345230e8ce125056b9407c63960f74e Author: Oswald Buddenhagen Date: Wed May 17 18:48:00 2023 +0200 ALSA: emu10k1: remove runtime 64-bit divisions 32-bit platforms don't like these. As we're actually dealing with constants, factor out the calculations and pass them in as additional arguments. To keep the call sites clean, wrap the actual functions in macros which generate the arguments. Fixes: bb5ceb43b7bf ("ALSA: emu10k1: fix non-zero mixer control defaults in highres mode") Fixes: 1298bc978afb ("ALSA: emu10k1: enable bit-exact playback, part 1: DSP attenuation") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305171622.jKTovBvy-lkp@intel.com/ Reported-by: Linux Kernel Functional Testing Reported-by: Christophe Leroy Closes: https://lore.kernel.org/r/CA+G9fYsShNP=LALHdMd-Btx3PBtO_CjyBNgpStr9fPGXNbRvdg@mail.gmail.com Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230517164800.3650699-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit a7dae5daf4bf50de01ebdd192bf52c2e8cd80c75 Author: Kamal Heib Date: Mon May 15 15:11:42 2023 -0400 RDMA/irdma: Move iw device ops initialization Move the initialization of the iw device ops to be under the declaration of the irdma_iw_dev_ops. Link: https://lore.kernel.org/r/20230515191142.413633-4-kheib@redhat.com Signed-off-by: Kamal Heib Reviewed-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit bc89be9443afb2190dddfabce87f390cf521eceb Author: Kamal Heib Date: Mon May 15 15:11:41 2023 -0400 RDMA/irdma: Return void from irdma_init_rdma_device() The return value from irdma_init_rdma_device() is always 0 - change it to be void. Link: https://lore.kernel.org/r/20230515191142.413633-3-kheib@redhat.com Signed-off-by: Kamal Heib Reviewed-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit ab4e8fc1746ffef46c6e0a1c254eeb1618d5ffb1 Author: Kamal Heib Date: Mon May 15 15:11:40 2023 -0400 RDMA/irdma: Return void from irdma_init_iw_device() The return value from irdma_init_iw_device() is always 0 - change it to be void. Link: https://lore.kernel.org/r/20230515191142.413633-2-kheib@redhat.com Signed-off-by: Kamal Heib Reviewed-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit a2741c58ac677e5de35bba7dec6376579dd513cd Author: Jens Axboe Date: Wed May 17 12:23:41 2023 -0600 io_uring/net: don't retry recvmsg() unnecessarily If we're doing multishot receives, then we always end up doing two trips through sock_recvmsg(). For protocols that sanely set msghdr->msg_inq, then we don't need to waste time picking a new buffer and attempting a new receive if there's nothing there. Signed-off-by: Jens Axboe commit 08e4044243a668ea2801cebffcb7c07df568ed3f Author: Nick Desaulniers Date: Fri Apr 7 14:54:06 2023 -0700 ubsan: remove cc-option test for UBSAN_TRAP -fsanitize-undefined-trap-on-error has been supported since GCC 5.1 and Clang 3.2. The minimum supported version of these according to Documentation/process/changes.rst is 5.1 and 11.0.0 respectively. Drop this cc-option check. Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230407215406.768464-1-ndesaulniers@google.com commit 9b4b7c1f9f54120940e243251e2b1407767b3381 Author: Bob Pearson Date: Fri Apr 28 12:13:22 2023 -0500 RDMA/rxe: Add workqueue support for rxe tasks Replace tasklets by work queues for the three main rxe tasklets: rxe_requester, rxe_completer and rxe_responder. work queues are a more modern way to process work from an IRQ and provide more control over how that work is run for future patches. Link: https://lore.kernel.org/r/20230428171321.5774-1-rpearsonhpe@gmail.com Signed-off-by: Ian Ziemba Signed-off-by: Bob Pearson Reviewed-by: Daisuke Matsuda Tested-by: Daisuke Matsuda Signed-off-by: Jason Gunthorpe commit 4fd5556608bfa9c2bf276fc115ef04288331aded Author: Hans de Goede Date: Sat Apr 29 12:38:41 2023 +0200 ACPI: button: Add lid disable DMI quirk for Nextbook Ares 8A The LID0 device on the Nextbook Ares 8A tablet always reports lid closed causing userspace to suspend the device as soon as booting is complete. Add a DMI quirk to disable the broken lid functionality. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 69d6b37695c1f2320cfa330e1e1636d50dd5040a Author: Hans de Goede Date: Sat Apr 29 12:38:40 2023 +0200 ACPI: x86: Add skip i2c clients quirk for Nextbook Ares 8A The Nextbook Ares 8A is a x86 ACPI tablet which ships with Android x86 as factory OS. Its DSDT contains a bunch of I2C devices which are not actually there (the Android x86 kernel fork ignores I2C devices described in the DSDT). On this specific model this just not cause resource conflicts, one of the probe() calls for the non existing i2c_clients actually ends up toggling a GPIO or executing a _PS3 after a failed probe which turns the tablet off. Add a ACPI_QUIRK_SKIP_I2C_CLIENTS for the Nextbook Ares 8 to the acpi_quirk_skip_dmi_ids table to avoid the bogus i2c_clients and to fix the tablet turning off during boot because of this. Also add the "10EC5651" HID for the RealTek ALC5651 codec used in this tablet to the list of HIDs for which not to skipi2c_client instantiation, since the Intel SST sound driver relies on the codec being instantiated through ACPI. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 7d41bcb7f32fbeac05d6fab553821a228af18bee Author: Jens Axboe Date: Wed May 17 12:20:44 2023 -0600 io_uring/net: push IORING_CQE_F_SOCK_NONEMPTY into io_recv_finish() Rather than have this logic in both io_recv() and io_recvmsg_multishot(), push it into the handler they both call when finishing a receive operation. Signed-off-by: Jens Axboe commit 88fc8b8463b024df556d5c4245f2c273f22d83a1 Author: Jens Axboe Date: Wed May 17 12:18:13 2023 -0600 io_uring/net: initalize msghdr->msg_inq to known value We can't currently tell if ->msg_inq was set when we ask for msg_get_inq, initialize it to -1U so we can tell apart if it was set and there's no data left, or if it just wasn't set at all by the protocol. Signed-off-by: Jens Axboe commit bf34e697931f64b21c82232e98b3d1f566214e40 Author: Jens Axboe Date: Wed May 17 12:15:00 2023 -0600 io_uring/net: initialize struct msghdr more sanely for io_recv() We only need to clear the input fields on the first invocation, not when potentially doing a retry. Signed-off-by: Jens Axboe commit d8bde56dfd86a0bba9206de8574e58c8aaac4f0f Author: Uwe Kleine-König Date: Wed May 17 09:55:42 2023 -0700 Input: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230517164645.162294-1-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit d86ff3333cb1d5f42d8898fb5fdb304e143c0237 Author: Anisse Astier Date: Wed May 17 17:38:12 2023 +0200 efivarfs: expose used and total size When writing EFI variables, one might get errors with no other message on why it fails. Being able to see how much is used by EFI variables helps analyzing such issues. Since this is not a conventional filesystem, block size is intentionally set to 1 instead of PAGE_SIZE. x86 quirks of reserved size are taken into account; so that available and free size can be different, further helping debugging space issues. With this patch, one can see the remaining space in EFI variable storage via efivarfs, like this: $ df -h /sys/firmware/efi/efivars/ Filesystem Size Used Avail Use% Mounted on efivarfs 176K 106K 66K 62% /sys/firmware/efi/efivars Signed-off-by: Anisse Astier [ardb: - rename efi_reserved_space() to efivar_reserved_space() - whitespace/coding style tweaks] Signed-off-by: Ard Biesheuvel commit ebdf098a0e1be8081dc5c92948f9a12eebf53638 Author: Jesse Brandeburg Date: Thu May 11 09:43:06 2023 -0700 MAINTAINERS: update Intel Ethernet links Freshen up some links, and remove the non-kernel related Sourceforge link. Signed-off-by: Jesse Brandeburg Signed-off-by: Tony Nguyen commit 1c769b1a303f7a3b447fc7244340b77823bdbfdc Author: Dave Ertman Date: Tue May 16 13:30:55 2023 +0200 ice: Remove LAG+SRIOV mutual exclusion There was a change previously to stop SR-IOV and LAG from existing on the same interface. This was to prevent the violation of LACP (Link Aggregation Control Protocol). The method to achieve this was to add a no-op Rx handler onto the netdev when SR-IOV VFs were present, thus blocking bonding, bridging, etc from claiming the interface by adding its own Rx handler. Also, when an interface was added into a aggregate, then the SR-IOV capability was set to false. There are some users that have in house solutions using both SR-IOV and bridging/bonding that this method interferes with (e.g. creating duplicate VFs on the bonded interfaces and failing between them when the interface fails over). It makes more sense to provide the most functionality possible, the restriction on co-existence of these features will be removed. No additional functionality is currently being provided beyond what existed before the co-existence restriction was put into place. It is up to the end user to not implement a solution that would interfere with existing network protocols. Reviewed-by: Michal Swiatkowski Signed-off-by: Dave Ertman Signed-off-by: Wojciech Drewek Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 49eb1c1f2f05fe948b209ad359283355d3428d89 Author: Paul Greenwalt Date: Wed Apr 26 11:50:47 2023 -0700 ice: update PHY type to ethtool link mode mapping Some link modes can be more accurately reported due to newer link mode values that have been added to the kernel; update those PHY type to report modes that better reflect the link mode. Signed-off-by: Paul Greenwalt Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 9136e1f1e5c3f3409b09764556f33fd6353cad60 Author: Paul Greenwalt Date: Wed Apr 26 11:50:46 2023 -0700 ice: refactor PHY type to ethtool link mode Refactor ice_phy_type_to_ethtool to use phy_type_[low|high]_lkup table to map PHY type to AQ link speed and ethtool link mode. This removes complexity and simplifies future changes. Signed-off-by: Paul Greenwalt Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 578fb0926c127d1b11b01b0102605efde9be9f41 Author: Paul Greenwalt Date: Wed Apr 26 11:50:45 2023 -0700 ice: update ICE_PHY_TYPE_HIGH_MAX_INDEX ICE_PHY_TYPE_HIGH_MAX_INDEX should be the maximum index value and not the length/number of ICE_PHY_TYPE_HIGH. This is not an issue because this define is only used when calling ice_get_link_speed_based_on_phy_type(), which will return ICE_AQ_LINK_SPEED_UNKNOWN for any invalid index. The caller of ice_get_link_speed_based_on_phy_type(), ice_update_phy_type() checks that the return value is a valid link speed before using it and ICE_AQ_LINK_SPEED_UNKNOWN is not. However, update the define to reflect the correct value. Signed-off-by: Paul Greenwalt Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit e455ca40dbcf2cd50d1e59bf4b2752b300bcdad4 Author: Arnd Bergmann Date: Wed May 17 15:10:52 2023 +0200 audit: avoid missing-prototype warnings Building with 'make W=1' reveals two function definitions without a previous prototype in the audit code: lib/compat_audit.c:32:5: error: no previous prototype for 'audit_classify_compat_syscall' [-Werror=missing-prototypes] kernel/audit.c:1813:14: error: no previous prototype for 'audit_serial' [-Werror=missing-prototypes] The first one needs a declaration from linux/audit.h but cannot include that header without causing conflicting (compat) syscall number definitions, so move the it into linux/audit_arch.h. The second one is declared conditionally based on CONFIG_AUDITSYSCALL but needed as a local function even when that option is disabled, so move the declaration out of the #ifdef block. Signed-off-by: Arnd Bergmann Signed-off-by: Paul Moore commit f47d6140b7a4c858d82d263e7577ff6fb5279a9c Author: Alexander Stein Date: Wed May 17 14:21:06 2023 +0200 drm/bridge: tc358767: Switch to devm MIPI-DSI helpers DSI device registering and attaching needs to be undone upon deregistration. This fixes module unload/load. Fixes: bbfd3190b656 ("drm/bridge: tc358767: Add DSI-to-DPI mode support") Signed-off-by: Alexander Stein Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230517122107.1766673-1-alexander.stein@ew.tq-group.com commit 216abe45cf4addba4e4c1eb2fae24762ffdefe9e Author: Oswald Buddenhagen Date: Tue May 16 11:36:12 2023 +0200 ALSA: emu10k1: make struct snd_emu1010 less wasteful Shrink the {in,out}put_source arrays and their data type to what is actually necessary. To be still on the safe side, add some static asserts. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536508-11-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 6f3609f8a3da1214cd78f8a8a2ee2dab8fcc4505 Author: Oswald Buddenhagen Date: Tue May 16 11:36:11 2023 +0200 ALSA: emu10k1: add explicit support for E-MU 0404 Unlike the other models, this is actually a distinct card, rather than an E-MU 1010 with different "dongles". It is stereo only, and supports no ADAT (there is no trace of ADAT in the manual, switching the output mode to ADAT has no effect, and switching the input mode to ADAT just breaks input (presumably ... my only ADAT source is the card's output)). Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536508-10-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit f69d705d3972fae19b4b00c7643efdd3d2953f25 Author: Oswald Buddenhagen Date: Tue May 16 11:36:10 2023 +0200 ALSA: emu10k1: improve mixer controls for E-MU 1010 rev2 card This card has rather different inputs/outputs due to switching from the AudioDock to the MicroDock. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536508-9-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 97f1582e92c91e77bcf4af3dbf445c6694eb2dff Author: Oswald Buddenhagen Date: Tue May 16 11:36:09 2023 +0200 ALSA: emu10k1: make E-MU mixer control creation more data-driven The more card models are handled separately, the more code duplication this saves. add_emu1010_source_mixers() is factored out the save duplication in a later commit. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536508-8-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 1fc710f06aa8f33abab4fdded9463eefdff7d390 Author: Oswald Buddenhagen Date: Tue May 16 11:36:08 2023 +0200 ALSA: emu10k1: make E-MU I/O routing init data-driven ... and move it to the mixer init, as it's logically part of it. As a side effect, this fixes the initial values of the input destination mixer controls, which would have previously remained at "Silent" despite different defaults. This didn't really matter, though, as ALSA state restoration would hide that bug beyond first use. Note that this completely does away with clearing the output routing registers, as it was rather pointless - we just programmed the FPGA (resetting it first if necessary), so everything is zeroed anyway (that's documented by Xilinx, and as further evidence, some of the loops terminated too early, and we didn't bother clearing the high channels of the input routes at all, all with no observed adverse effects). As a drive-by, this also fixes some capture channel defaults - any EMU_SRC_*2 isn't a sensible value in 1x clock mode. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536508-7-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit cc766807a208bfa06c204be784ec099fb25c87a4 Author: Oswald Buddenhagen Date: Tue May 16 11:36:07 2023 +0200 ALSA: emu10k1: fix return value of snd_emu1010_dac_pads_put() It returned zero even if the value had changed. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536508-6-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 511cbe8f59e30cd09a04c1dbafe6337d9111e88a Author: Oswald Buddenhagen Date: Tue May 16 11:36:06 2023 +0200 ALSA: emu10k1: un-hardcode E-MU mixer control callbacks somewhat Instead of hard-coding the card-specific arrays and their sizes in each function, use a more data-driven approach. As a drive-by, also hide the unavailable I2S input destinations on the 1616 cardbus card. Also as a drive-by, use more assignments at variable declaration for brevity. This also removes the pointless masking of kctl.private_value. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536508-5-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 536438f1def68eb56fe611c07d2a6ec73ab4a5b1 Author: Oswald Buddenhagen Date: Tue May 16 11:36:05 2023 +0200 ALSA: emu10k1: make mixer control mass creation less wasteful Define arrays of strings instead of snd_kcontrol_new. While at it, move the E-MU source & destination enum defs next to their hardware defs, which is a lot more logical and will come in handy in a followup commit. And add some static asserts to verify that the array sizes match. This also applies the compactization from the previous commit to the destination registers. While reshuffling the arrays anyway, switch the order of the HAMOA_DAC & HANA_SPDIF output destinations for the 1010 card, so they follow a more regular pattern. This should have no functional impact. The code is somewhat de-duplicated by the extraction of add_ctls(). Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536508-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit dc39bb3e4c25b784899cce572e539055898b2c73 Author: Oswald Buddenhagen Date: Tue May 16 11:36:04 2023 +0200 ALSA: emu10k1: compactize E-MU routing source arrays Use macros to avoid duplication. Arguably, this is somewhat less legible, but future additions would grow this part of the file to completely unmanageable dimensions. The EMU*_COMMON_TEXTS macros will save duplication in a future commit; I pulled them ahead to reduce churn. While rewriting the tables anyway, rearrange them such that each card's strings and registers are adjacent. Also, add some static asserts to verify that the array sizes match. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536508-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 9b00a1e9b1aedd70fd397335f5e41609b6e6109b Author: Oswald Buddenhagen Date: Tue May 16 11:36:03 2023 +0200 ALSA: emu10k1: make some initializer arrays less wasteful - Use bit fields in struct snd_emu_chip_details - Use shorts in the E-MU routing register arrays Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536508-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 51d652f4587f22b619028f4113dd262b80a82489 Author: Oswald Buddenhagen Date: Tue May 16 11:36:12 2023 +0200 ALSA: emu10k1: factor out snd_emu10k1_compose_audigy_sendamounts() Saves a bit of code duplication. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536451-7-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 77e067d0fa0511daec7e4c72ec3f830e5faaee9e Author: Oswald Buddenhagen Date: Tue May 16 11:36:11 2023 +0200 ALSA: emu10k1: skip needless setting of some voice registers Many registers are meaningless for stereo slaves and the extra voices. This patch cleans up these unnecessary register writes. snd_emu10k1_playback_{trigger,stop}_voice() is not called for stereo slaves any more. snd_emu10k1_playback_prepare_voice() is renamed to snd_emu10k1_playback_unmute_voice(), as this better reflects its remaining function. It's not called for the extra voices any more. Accordingly, snd_emu10k1_playback_mute_voice() is factored out from snd_emu10k1_playback_stop_voice(), and is called selectively as well. This doesn't add conditionals which would avoid initializing sub-registers, as that wouldn't pull its weight. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536451-6-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 35a60d1edff4dec9a31862a3515676cd0fafe4e4 Author: Oswald Buddenhagen Date: Tue May 16 11:36:10 2023 +0200 ALSA: emu10k1: rewire {en,dis}abling interrupts for PCM playback We now enable ints even before triggering, and disable them only after stopping - otherwise there is a race condition we may plausibly run into when we pause/resume near the end of the buffer. Updating the epcm->running flag is moved the same way, as it affects the *_pointer() functions, which are called by the interrupt handler. Also, factor these out to own functions, for clarity. For multi-channel, the extra voice is now triggered after all regular voices - we wouldn't want to receive an int before all channels have passed the period boundary. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536451-5-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit a61c695aee87ba9c9f6b2996f98e933e3c33a049 Author: Oswald Buddenhagen Date: Tue May 16 11:36:09 2023 +0200 ALSA: emu10k1: remove useless resets of stop-on-loop-end bits We initialize them at card init and don't touch them later, so there is no need to reset them again at voice start. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536451-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 94dabafea04e49448cfbb7c2d86ac0db2dbd5df9 Author: Oswald Buddenhagen Date: Tue May 16 11:36:08 2023 +0200 ALSA: emu10k1: cleanup envelope register init We (rightfully) don't enable the envelope engine for PCM voices, so any related setup is entirely pointless - the EMU8K documentation makes that very clear, and the fact that the various open drivers all use different values to no observable detriment pretty much confirms it. The remaining initializations are regrouped for clarity. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536451-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 155e3d3bf0cdf88430a6e6da629316d9cf766cc7 Author: Oswald Buddenhagen Date: Tue May 16 11:36:07 2023 +0200 ALSA: emu10k1: straighten out FX send init The mixer structures were filled in two places: on driver init, and when the devices are opened. The latter made the former pointless, so we remove the former. This implies that mixer dumps may now return all zeroes, which is OK, as restoring them is meaningless as well. Things were even weirder for the (generally unused) secondary sends: Some of the initialization loops were forgotten when support for Audigy was added, thus creating the technically illegal state of multiple sends being routed to the same FX accumulator (though it apparently doesn't matter when the amount is zero). The global multi-channel init used some rather bizarre values for the secondary sends, and the init on open actually forgot to re-initialize them. We now use a not really more useful, but simpler formula. The direct register init was also bogus. This doesn't really matter, as the value is overwritten when a voice comes into use, but still. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230516093612.3536451-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 24cdfcb4ccbb75d85d70460a69f3105fda33d385 Author: Min-Hua Chen Date: Wed May 17 06:38:05 2023 +0800 ALSA: compat_ioctl: use correct snd_ctl_elem_type_t type SNDRV_CTL_ELEM_TYPE_* are type of snd_ctl_elem_type_t, we have to __force cast them to int when comparing them with int to fix the following sparse warnings. sound/core/control_compat.c:203:14: sparse: warning: restricted snd_ctl_elem_type_t degrades to integer sound/core/control_compat.c:205:14: sparse: warning: restricted snd_ctl_elem_type_t degrades to integer sound/core/control_compat.c:207:14: sparse: warning: restricted snd_ctl_elem_type_t degrades to integer sound/core/control_compat.c:209:14: sparse: warning: restricted snd_ctl_elem_type_t degrades to integer sound/core/control_compat.c:237:21: sparse: warning: restricted snd_ctl_elem_type_t degrades to integer sound/core/control_compat.c:238:21: sparse: warning: restricted snd_ctl_elem_type_t degrades to integer sound/core/control_compat.c:270:21: sparse: warning: restricted snd_ctl_elem_type_t degrades to integer sound/core/control_compat.c:271:21: sparse: warning: restricted snd_ctl_elem_type_t degrades to integer Signed-off-by: Min-Hua Chen Link: https://lore.kernel.org/r/20230516223806.185683-1-minhuadotchen@gmail.com Signed-off-by: Takashi Iwai commit 156d3008429511234df7f2ff504eef19d66042dd Merge: 3f2da9fc17f66 df8e3729ffc0a Author: Kalle Valo Date: Wed May 17 17:59:59 2023 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v6.5. Major changes: ath11k * Multiple Basic Service Set Identifier (MBSSID) and Enhanced MBSSID Advertisement (EMA) support in AP mode commit effcf62416240e5ec0eded0ea2644c48d2c7c9f1 Author: Yonghong Song Date: Tue May 16 21:04:09 2023 -0700 selftests/bpf: Make bpf_dynptr_is_rdonly() prototyype consistent with kernel Currently kernel kfunc bpf_dynptr_is_rdonly() has prototype ... __bpf_kfunc bool bpf_dynptr_is_rdonly(struct bpf_dynptr_kern *ptr) ... while selftests bpf_kfuncs.h has: extern int bpf_dynptr_is_rdonly(const struct bpf_dynptr *ptr) __ksym; Such a mismatch might cause problems although currently it is okay in selftests. Fix it to prevent future potential surprise. Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230517040409.4024618-1-yhs@fb.com commit 12852f8e0f70d9a5263e2834c5483268b08b5e9c Author: Yonghong Song Date: Tue May 16 21:04:04 2023 -0700 selftests/bpf: Fix dynptr/test_dynptr_is_null With latest llvm17, dynptr/test_dynptr_is_null subtest failed in my testing VM. The failure log looks like below: All error logs: tester_init:PASS:tester_log_buf 0 nsec process_subtest:PASS:obj_open_mem 0 nsec process_subtest:PASS:Can't alloc specs array 0 nsec verify_success:PASS:dynptr_success__open 0 nsec verify_success:PASS:bpf_object__find_program_by_name 0 nsec verify_success:PASS:dynptr_success__load 0 nsec verify_success:PASS:bpf_program__attach 0 nsec verify_success:FAIL:err unexpected err: actual 4 != expected 0 #65/9 dynptr/test_dynptr_is_null:FAIL The error happens for bpf prog test_dynptr_is_null in dynptr_success.c: if (bpf_dynptr_is_null(&ptr2)) { err = 4; goto exit; } The bpf_dynptr_is_null(&ptr) unexpectedly returned a non-zero value and the control went to the error path. Digging further, I found the root cause is due to function signature difference between kernel and user space. In kernel, we have ... __bpf_kfunc bool bpf_dynptr_is_null(struct bpf_dynptr_kern *ptr) ... while in bpf_kfuncs.h we have: extern int bpf_dynptr_is_null(const struct bpf_dynptr *ptr) __ksym; The kernel bpf_dynptr_is_null disasm code: ffffffff812f1a90 : ffffffff812f1a90: f3 0f 1e fa endbr64 ffffffff812f1a94: 0f 1f 44 00 00 nopl (%rax,%rax) ffffffff812f1a99: 53 pushq %rbx ffffffff812f1a9a: 48 89 fb movq %rdi, %rbx ffffffff812f1a9d: e8 ae 29 17 00 callq 0xffffffff81464450 <__asan_load8_noabort> ffffffff812f1aa2: 48 83 3b 00 cmpq $0x0, (%rbx) ffffffff812f1aa6: 0f 94 c0 sete %al ffffffff812f1aa9: 5b popq %rbx ffffffff812f1aaa: c3 retq Note that only 1-byte register %al is set and the other 7-bytes are not touched. In bpf program, the asm code for the above bpf_dynptr_is_null(&ptr2): 266: 85 10 00 00 ff ff ff ff call -0x1 267: b4 01 00 00 04 00 00 00 w1 = 0x4 268: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 Basically, 4-byte subregister is tested. This might cause error as the value other than the lowest byte might not be 0. This patch fixed the issue by using the identical func prototype across kernel and selftest user space. The fixed bpf asm code: 267: 85 10 00 00 ff ff ff ff call -0x1 268: 54 00 00 00 01 00 00 00 w0 &= 0x1 269: b4 01 00 00 04 00 00 00 w1 = 0x4 270: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230517040404.4023912-1-yhs@fb.com commit 8819495a754e71d3c3fde991c26ad832af995136 Author: Dave Thaler Date: Tue May 9 18:08:45 2023 +0000 bpf, docs: Shift operations are defined to use a mask Update the documentation regarding shift operations to explain the use of a mask, since otherwise shifting by a value out of range (like negative) is undefined. Signed-off-by: Dave Thaler Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20230509180845.1236-1-dthaler1968@googlemail.com commit 0211cc1e4fbbc81853227147bf0982c47362c567 Author: Suman Anna Date: Fri Apr 14 10:25:42 2023 +0530 soc: ti: pruss: Add helper functions to set GPI mode, MII_RT_event and XFR The PRUSS CFG module is represented as a syscon node and is currently managed by the PRUSS platform driver. Add easy accessor functions to set GPI mode, MII_RT event enable/disable and XFR (XIN XOUT) enable/disable to enable the PRUSS Ethernet usecase. These functions reuse the generic pruss_cfg_update() API function. Signed-off-by: Suman Anna Co-developed-by: Grzegorz Jaszczyk Signed-off-by: Grzegorz Jaszczyk Signed-off-by: Puranjay Mohan Reviewed-by: Roger Quadros Reviewed-by: Tony Lindgren Reviewed-by: Simon Horman Reviewed-by: Mathieu Poirier Signed-off-by: MD Danish Anwar Link: https://lore.kernel.org/r/20230414045542.3249939-5-danishanwar@ti.com Signed-off-by: Nishanth Menon commit 51b5760e56ef19106a3c4487a66d186d46ccc6f4 Author: Suman Anna Date: Fri Apr 14 10:25:41 2023 +0530 soc: ti: pruss: Add pruss_cfg_read()/update(), pruss_cfg_get_gpmux()/set_gpmux() APIs Add two new generic API pruss_cfg_read() and pruss_cfg_update() to the PRUSS platform driver to read and program respectively a register within the PRUSS CFG sub-module represented by a syscon driver. These APIs are internal to PRUSS driver. Add two new helper functions pruss_cfg_get_gpmux() & pruss_cfg_set_gpmux() to get and set the GP MUX mode for programming the PRUSS internal wrapper mux functionality as needed by usecases. Various useful registers and macros for certain register bit-fields and their values have also been added. Signed-off-by: Suman Anna Co-developed-by: Grzegorz Jaszczyk Signed-off-by: Grzegorz Jaszczyk Signed-off-by: Puranjay Mohan Reviewed-by: Roger Quadros Reviewed-by: Tony Lindgren Reviewed-by: Simon Horman Acked-by: Mathieu Poirier Signed-off-by: MD Danish Anwar Link: https://lore.kernel.org/r/20230414045542.3249939-4-danishanwar@ti.com Signed-off-by: Nishanth Menon commit b789ca1e3380ab63b60c3356c026a7e8eb26ba01 Author: Andrew F. Davis Date: Fri Apr 14 10:25:40 2023 +0530 soc: ti: pruss: Add pruss_{request,release}_mem_region() API Add two new API - pruss_request_mem_region() & pruss_release_mem_region(), to the PRUSS platform driver to allow client drivers to acquire and release the common memory resources present within a PRU-ICSS subsystem. This allows the client drivers to directly manipulate the respective memories, as per their design contract with the associated firmware. Co-developed-by: Suman Anna Signed-off-by: Suman Anna Signed-off-by: Andrew F. Davis Co-developed-by: Grzegorz Jaszczyk Signed-off-by: Grzegorz Jaszczyk Reviewed-by: Roger Quadros Acked-by: Mathieu Poirier Reviewed-by: Tony Lindgren Reviewed-by: Simon Horman Signed-off-by: MD Danish Anwar Link: https://lore.kernel.org/r/20230414045542.3249939-3-danishanwar@ti.com Signed-off-by: Nishanth Menon commit 67d1b0a1030fb20d54b720df6e976c06b893fb00 Author: Tero Kristo Date: Fri Apr 14 10:25:39 2023 +0530 soc: ti: pruss: Add pruss_get()/put() API Add two new get and put API, pruss_get() and pruss_put() to the PRUSS platform driver to allow client drivers to request a handle to a PRUSS device. This handle will be used by client drivers to request various operations of the PRUSS platform driver through additional API that will be added in the following patches. The pruss_get() function returns the pruss handle corresponding to a PRUSS device referenced by a PRU remoteproc instance. The pruss_put() is the complimentary function to pruss_get(). Co-developed-by: Suman Anna Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Co-developed-by: Grzegorz Jaszczyk Signed-off-by: Grzegorz Jaszczyk Signed-off-by: Puranjay Mohan Reviewed-by: Roger Quadros Reviewed-by: Tony Lindgren Reviewed-by: Simon Horman Acked-by: Mathieu Poirier Signed-off-by: MD Danish Anwar Link: https://lore.kernel.org/r/20230414045542.3249939-2-danishanwar@ti.com Signed-off-by: Nishanth Menon commit 2c99754ea0f90ed4a7ab0db9879e57a266b01bfc Author: Niklas Schnelle Date: Tue May 16 13:00:05 2023 +0200 gpio: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit e752f9b924a1fd1afcf36e51b03dfa9c3096a3bd Author: Simon Horman Date: Thu May 11 16:54:36 2023 +0200 soc: ti: pruss: Allow compile-testing Allow compile testing of TI PRU-ICSS Subsystem Platform drivers. This allows for improved build-test coverage. No functional change intended. Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20230511-ti-pruss-compile-testing-v1-1-56291309a60c@kernel.org Signed-off-by: Nishanth Menon commit 413552b360e72604b8c0cf3f60f9e6f01c8ff963 Author: Simon Horman Date: Tue Apr 18 13:41:48 2023 +0200 soc: ti: pruss: Avoid cast to incompatible function type Rather than casting clk_unregister_mux to an incompatible function type provide a trivial wrapper with the correct signature for the use-case. Reported by clang-16 with W=1: drivers/soc/ti/pruss.c:158:38: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] ret = devm_add_action_or_reset(dev, (void(*)(void *))clk_unregister_mux, No functional change intended. Compile tested only. Signed-off-by: Simon Horman Reviewed-by: MD Danish Anwar Reviewed-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20230418-pruss-clk-cb-v1-1-549a7e7febe4@kernel.org Signed-off-by: Nishanth Menon commit 9f60d9d310b94c5869a5b6a2f1707b90bd60245c Author: Yang Li Date: Fri Apr 28 14:28:25 2023 +0800 soc: ti: smartreflex: Use devm_platform_ioremap_resource() Convert platform_get_resource(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li Reviewed-by: Dhruva Gole Link: https://lore.kernel.org/r/20230428062825.126448-1-yang.lee@linux.alibaba.com Signed-off-by: Nishanth Menon commit 2a36c26fe3b8e2cf39e15e80ba1abc889a75da4f Author: Pengcheng Yang Date: Sat May 6 11:07:19 2023 +0800 bpftool: Support bpffs mountpoint as pin path for prog loadall Currently, when using prog loadall and the pin path is a bpffs mountpoint, bpffs will be repeatedly mounted to the parent directory of the bpffs mountpoint path. For example, a `bpftool prog loadall test.o /sys/fs/bpf` will trigger this. Signed-off-by: Pengcheng Yang Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/1683342439-3677-1-git-send-email-yangpc@wangsu.com commit f04a32b2c5b539e3c097cb5c7c1df12a8f4a0cf0 Author: Alexey Gladkov Date: Wed May 17 11:49:46 2023 +0200 selftests/bpf: Do not use sign-file as testcase The sign-file utility (from scripts/) is used in prog_tests/verify_pkcs7_sig.c, but the utility should not be called as a test. Executing this utility produces the following error: selftests: /linux/tools/testing/selftests/bpf: urandom_read ok 16 selftests: /linux/tools/testing/selftests/bpf: urandom_read selftests: /linux/tools/testing/selftests/bpf: sign-file not ok 17 selftests: /linux/tools/testing/selftests/bpf: sign-file # exit=2 Also, urandom_read is mistakenly used as a test. It does not lead to an error, but should be moved over to TEST_GEN_FILES as well. The empty TEST_CUSTOM_PROGS can then be removed. Fixes: fc97590668ae ("selftests/bpf: Add test for bpf_verify_pkcs7_signature() kfunc") Signed-off-by: Alexey Gladkov Signed-off-by: Daniel Borkmann Reviewed-by: Roberto Sassu Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/ZEuWFk3QyML9y5QQ@example.org Link: https://lore.kernel.org/bpf/88e3ab23029d726a2703adcf6af8356f7a2d3483.1684316821.git.legion@kernel.org commit 9c3a985f88fa4de82bf4bda906095ce6444e9039 Merge: 86634ba3dfc78 ac9a78681b921 Author: Rodrigo Vivi Date: Wed May 17 09:30:24 2023 -0400 Merge drm/drm-next into drm-intel-next Backmerge to get some hwmon dependencies. Signed-off-by: Rodrigo Vivi commit 86634ba3dfc789497805da3d5774fcc1953cbe41 Author: Jani Nikula Date: Tue May 16 12:44:06 2023 +0300 drm/i915: tweak language in fastset pipe config compare logging The "fastset mismatch" debug logging has been slightly confusing, leading people to believe some error happened. Change it to the more informative "fastset requirement not met", and add a final message about this leading to full modeset. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal Acked-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230516094406.2675307-1-jani.nikula@intel.com commit d5e64404e77c19ec5bd687b34a11eec0263f1aa8 Author: Michael Walle Date: Wed Apr 20 21:46:00 2022 +0200 arm64: dts: sparx5: rename pinctrl nodes The pinctrl device tree binding will be converted to YAML format. Rename the pin nodes so they end with "-pins" to match the schema. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220420194600.3416282-1-michael@walle.cc Link: https://lore.kernel.org/r/20220319204628.1759635-5-michael@walle.cc Signed-off-by: Krzysztof Kozlowski commit a34ebb17546d209cbb0b9b2c94303f25749557d7 Author: Robert Marko Date: Tue Feb 21 11:50:38 2023 +0100 arm64: dts: microchip: sparx5: correct CPU address-cells There is no reason for CPU node #address-cells to be set at 2, so lets change them to 1 and update the reg property accordingly. Signed-off-by: Robert Marko Link: https://lore.kernel.org/r/20230221105039.316819-2-robert.marko@sartura.hr Signed-off-by: Krzysztof Kozlowski commit 70be83708c925b3f72c508e4756e48ad2330c830 Author: Robert Marko Date: Tue Feb 21 11:50:37 2023 +0100 arm64: dts: microchip: sparx5: do not use PSCI on reference boards PSCI is not implemented on SparX-5 at all, there is no ATF and U-boot that is shipped does not implement it as well. I have tried flashing the latest BSP 2022.12 U-boot which did not work. After contacting Microchip, they confirmed that there is no ATF for the SoC nor PSCI implementation which is unfortunate in 2023. So, disable PSCI as otherwise kernel crashes as soon as it tries probing PSCI with, and the crash is only visible if earlycon is used. Since PSCI is not implemented, switch core bringup to use spin-tables which are implemented in the vendor U-boot and actually work. Tested on PCB134 with eMMC (VSC5640EV). Fixes: 6694aee00a4b ("arm64: dts: sparx5: Add basic cpu support") Signed-off-by: Robert Marko Acked-by: Steen Hegelund Link: https://lore.kernel.org/r/20230221105039.316819-1-robert.marko@sartura.hr Signed-off-by: Krzysztof Kozlowski commit f217d94fc632fece2a41030c2eebc4ed34a48b2a Author: Krzysztof Kozlowski Date: Sat Apr 22 00:31:55 2023 +0200 arm64: dts: microchip: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified and cache-level properties to fix warnings like: sparx5_pcb125.dtb: l2-cache0: 'cache-level' is a required property Link: https://lore.kernel.org/r/20230421223155.115339-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit af2eab1a824349cfb0f6a720ad06eea48e9e6b74 Author: Krzysztof Kozlowski Date: Wed May 17 10:26:02 2023 +0200 dt-bindings: net: nxp,sja1105: document spi-cpol/cpha Some boards use SJA1105 Ethernet Switch with SPI CPHA, while ones with SJA1110 use SPI CPOL, so document this to fix dtbs_check warnings: arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dtb: ethernet-switch@0: Unevaluated properties are not allowed ('spi-cpol' was unexpected) Reviewed-by: Conor Dooley Reviewed-by: Vladimir Oltean Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 96ba44c637b0d30535374f328186a370accab208 Author: Jaco Kroon Date: Wed May 17 10:00:03 2023 +0200 net/pppoe: make number of hash bits configurable When running large numbers of pppoe connections, a bucket size of 16 may be too small and 256 may be more appropriate. This sacrifices some RAM but should result in faster processing of incoming PPPoE frames. On our systems we run upwards of 150 PPPoE connections at any point in time, and we suspect we're starting to see the effects of this small number of buckets. The legal values according to pppoe.c is anything that when 8 is divided by that results in a modulo of 0, ie, 1, 2, 4 and 8. The size of the per-underlying-interface structure is: sizeof(rwlock_t) + sizeof(pppox_sock*) * PPPOE_HASH_SIZE. Assuming a 64-bit pointer this will result in just over a 2KiB structure for PPPOE_HASH_BITS=8, which will likely result in a 4KiB allocation, which for us at least is acceptable. Not sure what the minimum allocation size is, and thus if values of 1 and 2 truly make sense. Default results in historic sizing and behaviour. Signed-off-by: Jaco Kroon Signed-off-by: David S. Miller commit f220125b999b2c9694149c6bda2798d8096f47ed Author: Borislav Petkov (AMD) Date: Mon May 15 16:07:26 2023 +0200 x86/retbleed: Add __x86_return_thunk alignment checks Add a linker assertion and compute the 0xcc padding dynamically so that __x86_return_thunk is always cacheline-aligned. Leave the SYM_START() macro in as the untraining doesn't need ENDBR annotations anyway. Suggested-by: Andrew Cooper Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Andrew Cooper Link: https://lore.kernel.org/r/20230515140726.28689-1-bp@alien8.de commit 3b1583868691b6fb7d5f7452711cba0481e72292 Author: Arnaud Pouliquen Date: Wed May 17 09:48:30 2023 +0200 ARM: dts: stm32: fix m4_rproc references to use SCMI for stm32mp15 Fixes stm32mp15*-scmi DTS files introduced in [1]: This patch fixes the node which uses the MCU reset and adds the missing HOLD_BOOT which is also handled by the SCMI reset service. This change cannot be applied as a fix on commit [1], the management of the hold boot impacts also the stm32_rproc driver. [1] 'commit 5b7e58313a77 ("ARM: dts: stm32: Add SCMI version of STM32 boards (DK1/DK2/ED1/EV1)")' Signed-off-by: Arnaud Pouliquen Signed-off-by: Alexandre Torgue commit 9c994fcf52284ac4cdeee1633373d69e05e30b23 Author: Arnaud Pouliquen Date: Wed May 17 09:48:29 2023 +0200 ARM: dts: stm32: Update Cortex-M4 reset declarations on stm32mp15 Since the introduction of the SCMI for the management of the MCU hold boot in OP-TEE, management of the hold boot by SMC call is deprecated. - Clean the st,syscfg-tz which allows to determine if the trust zone is enable. - Add reset-names properties to be able to differentiate the MCU reset and the MCU HOLD BOOT. Signed-off-by: Arnaud Pouliquen Signed-off-by: Alexandre Torgue commit ebdffe5b1fffa62c91800474c25e3c9f63be2aad Author: Arnd Bergmann Date: Wed May 17 11:52:53 2023 +0200 gpio: sa1100: include sa1100_init_gpio() is declared in a machine specific header so it can be called from platform code, but the definition is in the device driver, which causes a warning: drivers/gpio/gpio-sa1100.c:310:13: error: no previous prototype for 'sa1100_init_gpio' [-Werror=missing-prototypes] It's already possible to include mach/generic.h from drivers, so add this one here as well. Signed-off-by: Arnd Bergmann Signed-off-by: Bartosz Golaszewski commit 4cf381bf8e5a4554ddd5f2672c103afac02eba1b Author: Andrew Davis Date: Mon May 15 12:42:24 2023 -0500 gpio: sch311x: Use devm_gpiochip_add_data() to simplify remove path Use devm version of gpiochip_add() function to handle removal for us. Signed-off-by: Andrew Davis Signed-off-by: Bartosz Golaszewski commit 81b010990bfb1d6b359849326ed058599a0fe3bf Author: Andrew Davis Date: Mon May 15 12:45:18 2023 -0500 gpio: tps65086: Use devm_gpiochip_add_data() to simplify remove path Use devm version of gpiochip add function to handle removal for us. While here update copyright and module author. Signed-off-by: Andrew Davis Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit fbc8ab2ccd8547ea536a21a2f7d9e005f2bacc53 Author: Andrew Davis Date: Mon May 15 12:40:26 2023 -0500 gpio: twl4030: Use devm_gpiochip_add_data() to simplify remove path Use devm version of gpiochip add function to handle removal for us. Signed-off-by: Andrew Davis Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 2148a7ac3b1a27400551a8f4d4fe39e2fd2b63ec Author: Andrew Davis Date: Mon May 15 12:44:08 2023 -0500 gpio: tpic2810: Use devm_gpiochip_add_data() to simplify remove path Use devm version of gpiochip add function to handle removal for us. While here update copyright and module author. Signed-off-by: Andrew Davis Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 7f9f7f9b1e83058e90d5fe885ee5181ddaaa7d45 Author: Fabio Estevam Date: Tue May 16 10:11:57 2023 -0300 ARM: dts: armada-xp: Replace deprecated spi-gpio properties As stated in Documentation/devicetree/bindings/spi/spi-gpio.yaml, 'gpio-mosi' and 'gpio-sck' are deprecated properties. Use the recommeded 'mosi-gpios' and 'sck-gpios' instead. Signed-off-by: Fabio Estevam Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit ae1c0d6eb45a7839396337ea597090542b294c7d Author: Krzysztof Kozlowski Date: Sat Apr 22 00:31:59 2023 +0200 arm64: dts: marvell: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified properties to fix warnings like: ac5-98dx35xx-rd.dtb: l2-cache: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit 1ad797597a80ebe1c62b12403460d71e215f417b Author: Jani Nikula Date: Thu Mar 9 14:37:00 2023 +0200 drm/ttm: let struct ttm_device_funcs be placed in rodata Make the struct ttm_device_funcs pointers const so the data can be placed in rodata. Cc: Christian Koenig Cc: Huang Rui Signed-off-by: Jani Nikula Reviewed-by: Christian König Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230309123700.528641-1-jani.nikula@intel.com commit c83ae452d2644f921985a6d8a2f4affeded570dd Merge: 030d71fd93b1f 011670cc340cb Author: David S. Miller Date: Wed May 17 09:27:32 2023 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== ice: support dynamic interrupt allocation Piotr Raczynski says: This patchset reimplements MSIX interrupt allocation logic to allow dynamic interrupt allocation after MSIX has been initially enabled. This allows current and future features to allocate and free interrupts as needed and will help to drastically decrease number of initially preallocated interrupts (even down to the API hard limit of 1). Although this patchset does not change behavior in terms of actual number of allocated interrupts during probe, it will be subject to change. First few patches prepares to introduce dynamic allocation by moving interrupt allocation code to separate file and update allocation API used in the driver to the currently preferred one. Due to the current contract between ice and irdma driver which is directly accessing msix entries allocated by ice driver, even after moving away from older pci_enable_msix_range function, still keep msix_entries array for irdma use. Next patches refactors and removes redundant code from SRIOV related logic as it also make it easier to move away from static allocation scheme. Last patches actually enables dynamic allocation of MSIX interrupts. First, introduce functions to allocate and free interrupts individually. This sets ground for the rest of the changes even if that patch still allocates the interrupts from the preallocated pool. Since this patch starts to keep interrupt details in ice_q_vector structure we can get rid of functions that calculates base vector number and register offset for the interrupt as it is equal to the interrupt index. Only keep separate register offset functions for the VF VSIs. Next, replace homegrown interrupt tracker with much simpler xarray based approach. As new API always allocate interrupts one by one, also track interrupts in the same manner. Lastly, extend the interrupt tracker to deal both with preallocated and dynamically allocated vectors and use pci_msix_alloc_irq_at and pci_msix_free_irq functions. Since not all architecture supports dynamic allocation, check it before trying to allocate a new interrupt. As previously mentioned, this patchset does not change number of initially allocated interrupts during init phase but now it can and will likely be changed. Patch 1-3 -> move code around and use newer API Patch 4-5 -> refactor and remove redundant SRIOV code Patch 6 -> allocate every interrupt individually Patch 7 -> replace homegrown interrupt tracker with xarray Patch 8 -> allow dynamic interrupt allocation --- v2: Patch 4 - simplify ice_vsi_setup_vector_base and account for num_avail_sw_msix Patch 8 - prevent q_vector leak in case vf ctrl VSI error v1: https://lore.kernel.org/netdev/20230509170048.2235678-1-anthony.l.nguyen@intel.com/ ==================== Signed-off-by: David S. Miller commit df8e3729ffc0aa645839693f74ee7b6d999cdf64 Author: Maharaja Kennadyrajan Date: Tue May 9 20:07:24 2023 +0300 wifi: ath11k: Send HT fixed rate in WMI peer fixed param Due to the firmware behavior with HT fixed rate setting, HT fixed rate MCS with NSS > 1 are treated as NSS = 1 HT rates in the firmware and enables the HT fixed rate of NSS = 1. This leads to HT fixed rate is always configured for NSS = 1 even though the user sets NSS = 2 or > 1 HT fixed MCS in the set bitrate command. Currently HT fixed MCS is sent via WMI peer assoc command. Fix this issue, by sending the HT fixed rate MCS in WMI peer fixed param instead of sending in peer assoc command. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230504092033.3542456-3-quic_mkenna@quicinc.com commit 570eec3d40505c30babbe3b8f85a38496c975ab2 Author: Maharaja Kennadyrajan Date: Tue May 9 20:07:23 2023 +0300 wifi: ath11k: Relocate the func ath11k_mac_bitrate_mask_num_ht_rates() and change hweight16 to hweight8 Relocate the function ath11k_mac_bitrate_mask_num_ht_rates() definition to call this function from other functions which helps to avoid the compilation error (function not defined). ht_mcs[] is 1 byte array and it is enough to use hweight8() instead of hweight16(). Hence, fixed the same. Tested on: Compile tested only. Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230504092033.3542456-2-quic_mkenna@quicinc.com commit 1fd2c3f93c3e232290a25a8ef8a48d0fb6c702ad Author: Aishwarya R Date: Tue May 9 20:07:23 2023 +0300 wifi: ath12k: increase vdev setup timeout When vdev start/stop happens, response from firmware is received with delay and hence there is a timeout before VDEV can be up/down. Also, with maximum peers connected and when vdev stop occurs, firmware will take time to clean up all the peers and vap queues. In such cases as well, vdev start/stop response is sent by firmware with delay. Increase the vdev setup timeout as recommended by firmware team. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-02903-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aishwarya R Signed-off-by: Ramya Gnanasekar Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428091041.20033-1-quic_rgnanase@quicinc.com commit 1178c93c0ab70f8f758b529ef40386e1a3cc5646 Author: Bhupesh Sharma Date: Tue May 16 20:35:09 2023 +0530 phy: qcom-qmp-usb: add support for updated qcm2290 / sm6115 binding Add support for the new qcm2290 / sm6115 binding. The USB QMP phy on these devices supports 2 lanes. Note that the binding now does not describe every register subregion and instead the driver holds the corresponding offsets. While at it also include support for PCS_MISC region which was left out earlier. Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20230516150511.2346357-3-bhupesh.sharma@linaro.org Signed-off-by: Vinod Koul commit 2daece5eb51e18de377ce893a7e520fd8d9aeb32 Author: Bhupesh Sharma Date: Tue May 16 20:35:08 2023 +0530 dt-bindings: phy: qcom,qmp-usb: Drop legacy bindings and move to newer one (SM6115 & QCM2290) 'qcom,msm8996-qmp-usb3-phy.yaml' defines bindings for several PHYs which predate USB -> USB+DP migration. Since SM6115 and QCM2290 nodes for USB QMP phy are being added to dtsi files by followup patches, move these bindings instead to the newer style 'qcom,sc8280xp-qmp-usb3-uni-phy.yaml' file. Since no device trees use these bindings presently, so we have no ABI breakages with this patch. Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20230516150511.2346357-2-bhupesh.sharma@linaro.org Signed-off-by: Vinod Koul commit 1c677f238f92ba0a329b7c13220f38b396872806 Author: Serge Semin Date: Thu May 11 22:09:01 2023 +0300 MAINTAINERS: Add Manivannan to DW eDMA driver maintainers list Manivannan has been very active in reviewing the bits coming to the DW eDMA driver. Let's add him to the driver maintainers list. Signed-off-by: Serge Semin Acked-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20230511190902.28896-14-Sergey.Semin@baikalelectronics.ru Signed-off-by: Vinod Koul commit 9d71a11b6b07b01e21127184cdd47b40fbcbe5d4 Author: Serge Semin Date: Thu May 11 22:09:00 2023 +0300 MAINTAINERS: Demote Gustavo Pimentel to DW EDMA driver reviewer No maintaining actions from Gustavo have been noticed for over a year. Demote him to being the DW eDMA driver reviewer for now. Signed-off-by: Serge Semin Acked-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20230511190902.28896-13-Sergey.Semin@baikalelectronics.ru Signed-off-by: Vinod Koul commit d705a8c73acbe523cb602228d411a73f288bf34c Author: Jani Nikula Date: Tue May 16 15:29:26 2023 +0300 drm/i915: fix intel_display_irq.c include order I meant to sort the includes before submitting commit 2b874a027810 ("drm/i915/irq: split out display irq handling") but forgot, and it wasn't noticed in review either. Sort the includes. Cc: Gustavo Sousa Signed-off-by: Jani Nikula Reviewed-by: Gustavo Sousa Link: https://patchwork.freedesktop.org/patch/msgid/20230516122926.2720581-1-jani.nikula@intel.com commit 030d71fd93b1f0fe6e844c1d790f70c80d828c79 Author: Subbaraya Sundeep Date: Tue May 16 17:10:31 2023 +0530 octeontx2-pf: mcs: Support VLAN in clear text Detect whether macsec secy is running on top of VLAN which implies transmitting VLAN tag in clear text before macsec SecTag. In this case configure hardware to insert SecTag after VLAN tag. Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit 3f2da9fc17f66af17a1349d4d32f6a6ba245b94d Author: Ping-Ke Shih Date: Sat May 13 13:44:25 2023 +0800 wifi: rtw89: 8851b: rfk: add TSSI TSSI is transmitter signal strength indication, which is a close-loop hardware circuit to feedback actual transmitting power as a reference for next transmission. When we setup channel to connect an AP, it does full calibration. When switching bands or channels, it needs to reset hardware status to prevent use wrong feedback of previous transmission. To do TX power compensation reflecting current temperature, it loads tables of compensation values into registers according to channel and band group. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230513054425.9689-4-pkshih@realtek.com commit 0194a95cbe721a1eff4af2587b09213b088281b0 Author: Ping-Ke Shih Date: Sat May 13 13:44:24 2023 +0800 wifi: rtw89: 8851b: rfk: add DPK DPK is short for digital pre-distortion calibration. It can adjusts digital waveform according to PA linear characteristics dynamically to enhance TX EVM. Do this calibration when we are going to run on AP channel. To prevent power offset out of boundary, it monitors thermal and set proper boundary to register. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230513054425.9689-3-pkshih@realtek.com commit fe8a168266eb65d41ebee0b801fffb5278f92a1b Author: Ping-Ke Shih Date: Sat May 13 13:44:23 2023 +0800 wifi: rtw89: 8851b: rfk: add RX DCK RX DCK is receiver DC calibration. With this calibration, we have proper DC offset to reflect correct received signal strength indicator. Do this calibration when bringing up interface and going to run on AP channel. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230513054425.9689-2-pkshih@realtek.com commit f4244d7fbc9163a44272c0a9d86fd0784d28f386 Author: Ping-Ke Shih Date: Fri May 12 14:12:20 2023 +0800 wifi: rtw89: 8851b: add to parse efuse content Parse efuse content to recognize MAC address, RFE type, XTAL offset and so on. And, parse offset of PHY capability to retrieve TX power calibration data. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230512061220.16544-7-pkshih@realtek.com commit e948213fb8560f6d6af6058351758f13a35c9f8d Author: Ping-Ke Shih Date: Fri May 12 14:12:19 2023 +0800 wifi: rtw89: 8851b: add set channel function Set MAC/BB/RF registers according to channel we are going to set. In additional, certain channels or bands need more deals, such as enable CCK in 2 GHz band, spur elimination at certain frequencies. The set channel helper is used to save/restore states before/after setting channel, and does reset BB to prevent hardware getting stuck in abnormal state during switching channel and receiving data. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230512061220.16544-6-pkshih@realtek.com commit 31df6df89f9394bc544a4ebad62584d56bff1677 Author: Ping-Ke Shih Date: Fri May 12 14:12:18 2023 +0800 wifi: rtw89: 8851b: add basic power on function Add basic functions to power on chip and enable and access BB/RF, as well as reset and hardware settings of BB. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230512061220.16544-5-pkshih@realtek.com commit 4885b17ebb92b3cc54e1064ffe52f688ca83d5c7 Author: Ping-Ke Shih Date: Fri May 12 14:12:17 2023 +0800 wifi: rtw89: 8851b: add BT coexistence support function Add 8851B specific parameters of BT coexistence. Since 8851B has special two antenna hardware module with antenna diversity, BT coexistence needs to recognize this, so add some fields to store these information for further use. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230512061220.16544-4-pkshih@realtek.com commit f03bd0429f9bc2718ee250b05eb48dc081d4f6b7 Author: Ping-Ke Shih Date: Fri May 12 14:12:16 2023 +0800 wifi: rtw89: 8851b: configure GPIO according to RFE type Though 8851BE is a 1x1 chip, but it has two antenna hardware module that needs additional configuration to help choose antenna we are going to use. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230512061220.16544-3-pkshih@realtek.com commit 40bb2ab49c369b78d1cb37ed63b8a85f3102b239 Author: Ping-Ke Shih Date: Fri May 12 14:12:15 2023 +0800 wifi: rtw89: 8851b: add to read efuse version to recognize hardware version B 8851B hardware version A and B use different firmware, but register version code of these two are the same, so add this helper to read efuse version to determine which version is installed. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230512061220.16544-2-pkshih@realtek.com commit fa0583c202433c3d359a1b0579f52da16e25e4df Author: Yuya Tajima Date: Mon May 15 15:34:27 2023 +0000 seg6: Cleanup duplicates of skb_dst_drop calls In processing IPv6 segment routing header (SRH), several functions call skb_dst_drop before ip6_route_input. However, ip6_route_input calls skb_dst_drop within it, so there is no need to call skb_dst_drop in advance. Signed-off-by: Yuya Tajima Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 81cf1ade0bb3a42023dd1694ed080c4adb7dafd3 Merge: 833e24aeb4d9a a7533584728d3 Author: David S. Miller Date: Wed May 17 08:38:42 2023 +0100 Merge branch 'tcp-io_uring-zc-opts' Merge branch 'tcp-io_uring-zc-opts' Pavel Begunkov says: ==================== minor tcp io_uring zc optimisations Patch 1 is a simple cleanup, patch 2 gives removes 2 atomics from the io_uring zc TCP submission path, which yielded extra 0.5% for my throughput CPU bound tests based on liburing/examples/send-zerocopy.c ==================== Reviewed-by: David Ahern Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit a7533584728d366f11b210d0e8a2fad03109c669 Author: Pavel Begunkov Date: Mon May 15 17:06:37 2023 +0100 net/tcp: optimise io_uring zc ubuf refcounting io_uring keeps a reference to ubuf_info during submission, so if tcp_sendmsg_locked() sees msghdr::msg_ubuf in can be sure the buffer will be kept alive and doesn't need to additionally pin it. Signed-off-by: Pavel Begunkov Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit eea96a3e2c909a055005ac65dde356b36cabc4ed Author: Pavel Begunkov Date: Mon May 15 17:06:36 2023 +0100 net/tcp: don't peek at tail for io_uring zc Move tcp_write_queue_tail() to SOCK_ZEROCOPY specific flag as zerocopy setup for msghdr->ubuf_info doesn't need to peek into the last request. Signed-off-by: Pavel Begunkov Reviewed-by: David Ahern Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit ef104443bffa004f631729dfc924f0b84abbd602 Author: Arnd Bergmann Date: Tue May 16 21:57:29 2023 +0200 procfs: consolidate arch_report_meminfo declaration The arch_report_meminfo() function is provided by four architectures, with a __weak fallback in procfs itself. On architectures that don't have a custom version, the __weak version causes a warning because of the missing prototype. Remove the architecture specific prototypes and instead add one in linux/proc_fs.h. Signed-off-by: Arnd Bergmann Acked-by: Dave Hansen # for arch/x86 Acked-by: Helge Deller # parisc Reviewed-by: Alexander Gordeev Message-Id: <20230516195834.551901-1-arnd@kernel.org> Signed-off-by: Christian Brauner commit 788557fb23702dbd21767a69894a53c1aa58bb60 Author: Sui Jingfeng <15330273260@189.cn> Date: Wed May 17 12:16:02 2023 +0800 drm/drm_atomic_helper.c: fix a typo Signed-off-by: Sui Jingfeng Acked-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230517041602.3225325-1-suijingfeng@loongson.cn commit f620596fa347170852da499e778a5736d79a4b79 Author: Tony Lindgren Date: Wed May 17 10:04:16 2023 +0300 bus: ti-sysc: Fix dispc quirk masking bool variables Fix warning drivers/bus/ti-sysc.c:1806 sysc_quirk_dispc() warn: masking a bool. While at it let's add a comment for what were doing to make the code a bit easier to follow. Fixes: 7324a7a0d5e2 ("bus: ti-sysc: Implement display subsystem reset quirk") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/linux-omap/a8ec8a68-9c2c-4076-bf47-09fccce7659f@kili.mountain/ Signed-off-by: Tony Lindgren commit 247c8d2f9837a3e29e3b6b7a4aa9c36c37659dd4 Author: Arnd Bergmann Date: Tue May 16 21:56:12 2023 +0200 fs: pipe: reveal missing function protoypes A couple of functions from fs/pipe.c are used both internally and for the watch queue code, but the declaration is only visible when the latter is enabled: fs/pipe.c:1254:5: error: no previous prototype for 'pipe_resize_ring' fs/pipe.c:758:15: error: no previous prototype for 'account_pipe_buffers' fs/pipe.c:764:6: error: no previous prototype for 'too_many_pipe_buffers_soft' fs/pipe.c:771:6: error: no previous prototype for 'too_many_pipe_buffers_hard' fs/pipe.c:777:6: error: no previous prototype for 'pipe_is_unprivileged_user' Make the visible unconditionally to avoid these warnings. Fixes: c73be61cede5 ("pipe: Add general notification queue support") Signed-off-by: Arnd Bergmann Message-Id: <20230516195629.551602-1-arnd@kernel.org> Signed-off-by: Christian Brauner commit df67cb4c58fbb80399a99d47a554a67829f90dda Author: Arnd Bergmann Date: Tue May 16 21:54:38 2023 +0200 fs: d_path: include internal.h make W=1 warns about a missing prototype that is defined but not visible at point where simple_dname() is defined: fs/d_path.c:317:7: error: no previous prototype for 'simple_dname' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann Message-Id: <20230516195444.551461-1-arnd@kernel.org> Signed-off-by: Christian Brauner commit 21e5a2d10c8f319be4126f320855429842473640 Author: Linus Walleij Date: Thu Apr 20 23:17:35 2023 +0200 misc: sram: Generate unique names for subpools The current code will, if we do not specify unique labels for the SRAM subnodes, fail to register several nodes named the same. Example: sram@40020000 { (...) sram@0 { (...) }; sram@1000 { (...) }; }; Since the child->name in both cases will be "sram" the gen_pool_create() will fail because the name is not unique. Use dev_name() for the device as this will have bus ID set to the fully translated address for the node, and that will always be unique. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-sram-v2-2-6e62ad551faa@linaro.org commit 38bd22dac71ef7b1dbaa44fdc99f7722c116a01d Author: Linus Walleij Date: Thu Apr 20 23:17:34 2023 +0200 dt-bindings: sram: Add compatible for ST-Ericsson U8500 eSRAM This adds an SoC-specific binding for the banks of eSRAM available in the ST-Ericsson U8500. Acked-by: Rob Herring Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-sram-v2-1-6e62ad551faa@linaro.org commit 88e4607034ee49e09e32d91d083dced5c2f4f127 Author: Vladimir Sementsov-Ogievskiy Date: Thu Apr 20 15:04:09 2023 +0300 coredump: require O_WRONLY instead of O_RDWR The motivation for this patch has been to enable using a stricter apparmor profile to prevent programs from reading any coredump in the system. However, this became something else. The following details are based on Christian's and Linus' archeology into the history of the number "2" in the coredump handling code. To make sure we're not accidently introducing some subtle behavioral change into the coredump code we set out on a voyage into the depths of history.git to figure out why this was O_RDWR in the first place. Coredump handling was introduced over 30 years ago in commit ddc733f452e0 ("[PATCH] Linux-0.97 (August 1, 1992)"). The original code used O_WRONLY: open_namei("core",O_CREAT | O_WRONLY | O_TRUNC,0600,&inode,NULL) However, this changed in 1993 and starting with commit 9cb9f18b5d26 ("[PATCH] Linux-0.99.10 (June 7, 1993)") the coredump code suddenly used the constant "2": open_namei("core",O_CREAT | 2 | O_TRUNC,0600,&inode,NULL) This was curious as in the same commit the kernel switched from constants to proper defines in other places such as KERNEL_DS and USER_DS and O_RDWR did already exist. So why was "2" used? It turns out that open_namei() - an early version of what later turned into filp_open() - didn't accept O_RDWR. A semantic quirk of the open() uapi is the definition of the O_RDONLY flag. It would seem natural to define: #define O_RDWR (O_RDONLY | O_WRONLY) but that isn't possible because: #define O_RDONLY 0 This makes O_RDONLY effectively meaningless when passed to the kernel. In other words, there has never been a way - until O_PATH at least - to open a file without any permission; O_RDONLY was always implied on the uapi side while the kernel does in fact allow opening files without permissions. The trouble comes when trying to map the uapi flags onto the corresponding file mode flags FMODE_{READ,WRITE}. This mapping still happens today and is causing issues to this day (We ran into this during additions for openat2() for example.). So the special value "3" was used to indicate that the file was opened for special access: f->f_flags = flag = flags; f->f_mode = (flag+1) & O_ACCMODE; if (f->f_mode) flag++; This allowed the file mode to be set to FMODE_READ | FMODE_WRITE mapping the O_{RDONLY,WRONLY,RDWR} flags into the FMODE_{READ,WRITE} flags. The special access then required read-write permissions and 0 was used to access symlinks. But back when ddc733f452e0 ("[PATCH] Linux-0.97 (August 1, 1992)") added coredump handling open_namei() took the FMODE_{READ,WRITE} flags as an argument. So the coredump handling introduced in ddc733f452e0 ("[PATCH] Linux-0.97 (August 1, 1992)") was buggy because O_WRONLY shouldn't have been passed. Since O_WRONLY is 1 but open_namei() took FMODE_{READ,WRITE} it was passed FMODE_READ on accident. So 9cb9f18b5d26 ("[PATCH] Linux-0.99.10 (June 7, 1993)") was a bugfix for this and the 2 didn't really mean O_RDWR, it meant FMODE_WRITE which was correct. The clue is that FMODE_{READ,WRITE} didn't exist yet and thus a raw "2" value was passed. Fast forward 5 years when around 2.2.4pre4 (February 16, 1999) this code was changed to: - dentry = open_namei(corefile,O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600); ... + file = filp_open(corefile,O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600); At this point the raw "2" should have become O_WRONLY again as filp_open() didn't take FMODE_{READ,WRITE} but O_{RDONLY,WRONLY,RDWR}. Another 17 years later, the code was changed again cementing the mistake and making it almost impossible to detect when commit 378c6520e7d2 ("fs/coredump: prevent fsuid=0 dumps into user-controlled directories") replaced the raw "2" with O_RDWR. And now, here we are with this patch that sent us on a quest to answer the big questions in life such as "Why are coredump files opened with O_RDWR?" and "Is it safe to just use O_WRONLY?". So with this commit we're reintroducing O_WRONLY again and bringing this code back to its original state when it was first introduced in commit ddc733f452e0 ("[PATCH] Linux-0.97 (August 1, 1992)") over 30 years ago. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20230420120409.602576-1-vsementsov@yandex-team.ru> [brauner@kernel.org: completely rewritten commit message] Signed-off-by: Linus Torvalds Signed-off-by: Christian Brauner commit 56f0440f27b48948122e5a739fc55c11b23bc821 Author: Linus Walleij Date: Thu Apr 27 14:10:03 2023 +0200 ARM: dts: ux500: Add eSRAM nodes The U8500 has 640 KB of eSRAM, split into 5 banks of 128 KB each. Add this to the device tree, with ESRAM 0, 1+2 and 3+4 as separate devices, since these have different power domains. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-dma40-cleanup-v2-8-cdaa68a4b863@linaro.org commit bd0e450371efa69b985b801c5c67d6faac4d05a7 Author: Linus Walleij Date: Mon May 8 09:08:11 2023 +0200 ARM: dts: ux500: Fix STMPE device nodes The STMPE device nodes need to be augmented to fit with current naming policies. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230508070811.965762-1-linus.walleij@linaro.org commit 0a03767e9a73cd919eb9fff40582e7a3d9232c6d Author: Linus Walleij Date: Mon Apr 17 09:56:59 2023 +0200 ARM: dts: ux500: Disable charging on HREF boards The HREF boards are usually used without battery and not using active charging. Disable it. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417075659.3162603-1-linus.walleij@linaro.org commit cff36398bd4c7d322d424433db437f3c3391c491 Author: Andrii Nakryiko Date: Tue May 16 11:04:09 2023 -0700 bpf: drop unnecessary user-triggerable WARN_ONCE in verifierl log It's trivial for user to trigger "verifier log line truncated" warning, as verifier has a fixed-sized buffer of 1024 bytes (as of now), and there are at least two pieces of user-provided information that can be output through this buffer, and both can be arbitrarily sized by user: - BTF names; - BTF.ext source code lines strings. Verifier log buffer should be properly sized for typical verifier state output. But it's sort-of expected that this buffer won't be long enough in some circumstances. So let's drop the check. In any case code will work correctly, at worst truncating a part of a single line output. Reported-by: syzbot+8b2a08dfbd25fd933d75@syzkaller.appspotmail.com Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230516180409.3549088-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 34e78bab67c5de43e685c63cd8c27e0cd3239897 Merge: 0697e4394210b 7cd6df4f5ec27 Author: Alexei Starovoitov Date: Tue May 16 22:31:52 2023 -0700 Merge branch 'seltests/xsk: prepare for AF_XDP multi-buffer testing' Magnus Karlsson says: ==================== Prepare the AF_XDP selftests test framework code for the upcoming multi-buffer support in AF_XDP. This so that the multi-buffer patch set does not become way too large. In that upcoming patch set, we are only including the multi-buffer tests together with any framework code that depends on the new options bit introduced in the AF_XDP multi-buffer implementation itself. Currently, the test framework is based on the premise that a packet consists of a single fragment and thus occupies a single buffer and a single descriptor. Multi-buffer breaks this assumption, as that is the whole purpose of it. Now, a packet can consist of multiple buffers and therefore consume multiple descriptors. The patch set starts with some clean-ups and simplifications followed by patches that make sure that the current code works even when a packet occupies multiple buffers. The actual code for sending and receiving multi-buffer packets will be included in the AF_XDP multi-buffer patch set as it depends on a new bit being used in the options field of the descriptor. Patch set anatomy: 1: The XDP program was unnecessarily changed many times. Fixes this. 2: There is no reason to generate a full UDP/IPv4 packet as it is never used. Simplify the code by just generating a valid Ethernet frame. 3: Introduce a more complicated payload pattern that can detect fragments out of bounds in a multi-buffer packet and other errors found in single-fragment packets. 4: As a convenience, dump the content of the faulty packet at error. 5: To simplify the code, make the usage of the packet stream for Tx and Rx more similar. 6: Store the offset of the packet in the buffer in the struct pkt definition instead of the address in the umem itself and introduce a simple buffer allocator. The address only made sense when all packets consumed a single buffer. Now, we do not know beforehand how many buffers a packet will consume, so we instead just allocate a buffer from the allocator and specify the offset within that buffer. 7: Test for huge pages only once instead of before each test that needs it. 8: Populate the fill ring based on how many frags are needed for each packet. 9: Change the data generation code so it can generate data for multi-buffer packets too. 10: Adjust the packet pacing algorithm so that it can cope with multi-buffer packets. The pacing algorithm is present so that Tx does not send too many packets/frames to Rx that it starts to drop packets. That would ruin the tests. v1 -> v2: * Fixed spelling error in patch #6 [Simon] * Fixed compilation error with llvm in patch #7 [Daniel] Thanks: Magnus ==================== Signed-off-by: Alexei Starovoitov commit 7cd6df4f5ec278888b4c3ab12b291c2124b46c1c Author: Magnus Karlsson Date: Tue May 16 12:31:09 2023 +0200 selftests/xsk: adjust packet pacing for multi-buffer support Modify the packet pacing algorithm so that it works with multi-buffer packets. This algorithm makes sure we do not send too many buffers to the receiving thread so that packets have to be dropped. The previous algorithm made the assumption that each packet only consumes one buffer, but that is not true anymore when multi-buffer support gets added. Instead, we find out what the largest packet size is in the packet stream and assume that each packet will consume this many buffers. This is conservative and overly cautious as there might be smaller packets in the stream that need fewer buffers per packet. But it keeps the algorithm simple. Also simplify it by removing the pthread conditional and just test if there is enough space in the Rx thread before trying to send one more batch. Also makes the tests run faster. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230516103109.3066-11-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 2f6eae0df1a80bb636f43f1b954678da0a10fa49 Author: Magnus Karlsson Date: Tue May 16 12:31:08 2023 +0200 selftests/xsk: generate data for multi-buffer packets Add the ability to generate data in the packets that are correct for multi-buffer packets. The ethernet header should only go into the first fragment followed by data and the others should only have data. We also need to modify the pkt_dump function so that it knows what fragment has an ethernet header so it can print this. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230516103109.3066-10-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 86e41755b43227858ef04b452c25b9dbcf667622 Author: Magnus Karlsson Date: Tue May 16 12:31:07 2023 +0200 selftests/xsk: populate fill ring based on frags needed Populate the fill ring based on the number of frags a packet needs. With multi-buffer support, a packet might require more than a single fragment/buffer, so the function xsk_populate_fill_ring() needs to consider how many buffers a packet will consume, and put that many buffers on the fill ring for each packet it should receive. As we are still not sending any multi-buffer packets, the function will only produce one buffer per packet at the moment. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230516103109.3066-9-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 041b68f688a38865434d7b8fbfe64beb03e54ff2 Author: Magnus Karlsson Date: Tue May 16 12:31:06 2023 +0200 selftests/xsx: test for huge pages only once Test for hugepages only once at the beginning of the execution of the whole test suite, instead of before each test that needs huge pages. These are the tests that use unaligned mode. As more unaligned tests will be added, so the current system just does not scale. With this change, there are now three possible outcomes of a test run: fail, pass, or skip. To simplify the handling of this, the function testapp_validate_traffic() now returns this value to the main loop. As this function is used by nearly all tests, it meant a small change to most of them. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230516103109.3066-8-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit d9f6d9709f87236f9a33de0d42dae8402b812e19 Author: Magnus Karlsson Date: Tue May 16 12:31:05 2023 +0200 selftests/xsk: store offset in pkt instead of addr Store the offset in struct pkt instead of the address. This is important since address is only meaningful in the context of a packet that is stored in a single umem buffer and thus a single Tx descriptor. If the packet, in contrast need to be represented by multiple buffers in the umem, storing the address makes no sense since the packet will consist of multiple buffers in the umem at various addresses. This change is in preparation for the upcoming multi-buffer support in AF_XDP and the corresponding tests. So instead of indicating the address, we instead indicate the offset of the packet in the first buffer. The actual address of the buffer is allocated from the umem with a new function called umem_alloc_buffer(). This also means we can get rid of the use_fill_for_addr flag as the addresses fed into the fill ring will always be the offset from the pkt specification in the packet stream plus the address of the allocated buffer from the umem. No special casing needed. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230516103109.3066-7-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 69fc03d220a318a4df2c6f0612b17225e71a6069 Author: Magnus Karlsson Date: Tue May 16 12:31:04 2023 +0200 selftests/xsk: add packet iterator for tx to packet stream Convert the current variable rx_pkt_nb to an iterator that can be used for both Rx and Tx. This to simplify the code and making Tx more like Rx that already has this feature. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230516103109.3066-6-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 7a8a6762822a1f5249eec356e7ea31f98161fba0 Author: Magnus Karlsson Date: Tue May 16 12:31:03 2023 +0200 selftests/xsk: dump packet at error Dump the content of the packet when a test finds that packets are received out of order, the length is wrong, or some other packet error. Use the already existing pkt_dump function for this and call it when the above errors are detected. Get rid of the command line option for dumping packets as it is not useful to print out thousands of good packets followed by the faulty one you would like to see. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230516103109.3066-5-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit feb973a9094ff92fb8c141be5d2e762f9ab36a7a Author: Magnus Karlsson Date: Tue May 16 12:31:02 2023 +0200 selftests/xsk: add varying payload pattern within packet Add a varying payload pattern within the packet. Instead of having just a packet number that is the same for all words in a packet, make each word different in the packet. The upper 16-bits are set to the packet number and the lower 16-bits are the sequence number of the words in this packet. So the 3rd packet's 5th 32-bit word of data will contain the number (2<<32) | 4 as they are numbered from 0. This will make it easier to detect fragments that are out of order when starting to test multi-buffer support. The member payload in the packet is renamed pkt_nb to reflect that it is now only a pkt_nb, not the real payload as seen above. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230516103109.3066-4-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit df82d2e89c41d1dc6f02a881f0cddac8252bb441 Author: Magnus Karlsson Date: Tue May 16 12:31:01 2023 +0200 selftests/xsk: generate simpler packets with variable length Implement support for generating pkts with variable length. Before this patch, they were all 64 bytes, exception for some packets of zero length and some that were too large. This feature will be used to test multi-buffer support for which large packets are needed. The packets are also made simpler, just a valid Ethernet header followed by a sequence number. This so that it will become easier to implement packet generation when each packet consists of multiple fragments. There is also a maintenance burden associated with carrying all this code for generating proper UDP/IP packets, especially since they are not needed. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230516103109.3066-3-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit d2e541494935a659b67e51aa3d1945bb3b799c4e Author: Magnus Karlsson Date: Tue May 16 12:31:00 2023 +0200 selftests/xsk: do not change XDP program when not necessary Do not change the XDP program for the Tx thread when not needed. It was erroneously compared to the XDP program for the Rx thread, which is always going to be different, which meant that the code made unnecessary switches to the same program it had before. This did not affect functionality, just performance. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230516103109.3066-2-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 0697e4394210b9f7d83c32c9236a47fdeddf9ac0 Merge: de58ef414d8d7 65eb006d85a2a Author: Alexei Starovoitov Date: Tue May 16 22:09:24 2023 -0700 Merge branch 'bpf: Move kernel test kfuncs into bpf_testmod' Jiri Olsa says: ==================== hi, I noticed several times in discussions that we should move test kfuncs into kernel module, now perhaps even more pressing with all the kfunc effort. This patchset moves all the test kfuncs into bpf_testmod. I added bpf_testmod/bpf_testmod_kfunc.h header that is shared between bpf_testmod kernel module and BPF programs. v4 changes: - s390 supports long calls [1] now, so it can call now kfuncs from module [Ilya] - added acks [David] - cleanups for ptr_to_u64 function [David] - use relative path for bpf_testmod_kfunc.h include [Andrii] - new libbpf fix (patch 1) for gen_loader v3 changes: - added acks [David] - added bpf_testmod.ko make dependency for bpf test progs [David] - better handling of __ksym and refcount_t in bpf_testmod_kfunc.h [David] - removed 'extern' from kfuncs declarations [David] - typo in header guard macro [David] - use only stdout in un/load_bpf_testmod v2 changes: - add 74bc3a5acc82 into bpf-next/master CI, so the test would pass https://github.com/kernel-patches/vmtest/pull/192 - remove extra externs [Artem] - using un/load_bpf_testmod in other tests - rebased thanks, jirka [1] 1cf3bfc60f98 bpf: Support 64-bit pointers to kfuncs ==================== Signed-off-by: Alexei Starovoitov commit 65eb006d85a2ac0b23464808099726bd826e9877 Author: Jiri Olsa Date: Mon May 15 15:37:56 2023 +0200 bpf: Move kernel test kfuncs to bpf_testmod Moving kernel test kfuncs into bpf_testmod kernel module, and adding necessary init calls and BTF IDs records. We need to keep following structs in kernel: struct prog_test_ref_kfunc struct prog_test_member (embedded in prog_test_ref_kfunc) The reason is because they need to be marked as rcu safe (check test prog mark_ref_as_untrusted_or_null) and such objects are being required to be defined only in kernel at the moment (see rcu_safe_kptr check in kernel). We need to keep also dtor functions for both objects in kernel: bpf_kfunc_call_test_release bpf_kfunc_call_memb_release We also keep the copy of these struct in bpf_testmod_kfunc.h, because other test functions use them. This is unfortunate, but this is just temporary solution until we are able to these structs them to bpf_testmod completely. As suggested by David adding bpf_testmod.ko make dependency for bpf programs, so they are rebuilt if we change the bpf_testmod.ko module. Also adding missing __bpf_kfunc to bpf_kfunc_call_test4 functions. Signed-off-by: Jiri Olsa Acked-by: David Vernet Link: https://lore.kernel.org/r/20230515133756.1658301-11-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 6e2b50fa818bea4fc9a2d33f31a9633803a406ff Author: Jiri Olsa Date: Mon May 15 15:37:55 2023 +0200 selftests/bpf: Remove extern from kfuncs declarations There's no need to keep the extern in kfuncs declarations. Suggested-by: David Vernet Acked-by: David Vernet Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20230515133756.1658301-10-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit f26ebdd3e4e4e1f5f08522b087ab9ec7216e9a3b Author: Jiri Olsa Date: Mon May 15 15:37:54 2023 +0200 selftests/bpf: Allow to use kfunc from testmod.ko in test_verifier Currently the test_verifier allows test to specify kfunc symbol and search for it in the kernel BTF. Adding the possibility to search for kfunc also in bpf_testmod module when it's not found in kernel BTF. To find bpf_testmod btf we need to get back SYS_ADMIN cap. Acked-by: David Vernet Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20230515133756.1658301-9-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit b23b385fa18f2196872bc3337c98ddd221c2827b Author: Jiri Olsa Date: Mon May 15 15:37:53 2023 +0200 selftests/bpf: Load bpf_testmod for verifier test Loading bpf_testmod kernel module for verifier test. We will move all the tests kfuncs into bpf_testmod in following change. Acked-by: David Vernet Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20230515133756.1658301-8-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 11642eb92b3bc67171b23abff0d062758c5a4730 Author: Jiri Olsa Date: Mon May 15 15:37:52 2023 +0200 selftests/bpf: Use un/load_bpf_testmod functions in tests Now that we have un/load_bpf_testmod helpers in testing_helpers.h, we can use it in other tests and save some lines. Acked-by: David Vernet Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20230515133756.1658301-7-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit b58f3f0e6f3cbea56be39d8fb190b37f049505bb Author: Jiri Olsa Date: Mon May 15 15:37:51 2023 +0200 selftests/bpf: Do not unload bpf_testmod in load_bpf_testmod Do not unload bpf_testmod in load_bpf_testmod, instead call unload_bpf_testmod separatelly. This way we will be able use un/load_bpf_testmod functions in other tests that un/load bpf_testmod module. Acked-by: David Vernet Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20230515133756.1658301-6-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit d18decca69e36480247a73086336f4a44a08e36f Author: Jiri Olsa Date: Mon May 15 15:37:50 2023 +0200 selftests/bpf: Use only stdout in un/load_bpf_testmod functions We are about to use un/load_bpf_testmod functions in couple tests and it's better to print output to stdout, so it's aligned with tests ASSERT macros output, which use stdout as well. Acked-by: David Vernet Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20230515133756.1658301-5-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 45db310984bfea977177fb5fc0ea23ab430129bd Author: Jiri Olsa Date: Mon May 15 15:37:49 2023 +0200 selftests/bpf: Move test_progs helpers to testing_helpers object Moving test_progs helpers to testing_helpers object so they can be used from test_verifier in following changes. Also adding missing ifndef header guard to testing_helpers.h header. Using stderr instead of env.stderr because un/load_bpf_testmod helpers will be used outside test_progs. Also at the point of calling them in test_progs the std files are not hijacked yet and stderr is the same as env.stderr. Acked-by: David Vernet Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20230515133756.1658301-4-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 8e9af82171247e2a8d2c08a3dea709d03884a815 Author: Jiri Olsa Date: Mon May 15 15:37:48 2023 +0200 selftests/bpf: Move kfunc exports to bpf_testmod/bpf_testmod_kfunc.h Move all kfunc exports into separate bpf_testmod_kfunc.h header file and include it in tests that need it. We will move all test kfuncs into bpf_testmod in following change, so it's convenient to have declarations in single place. The bpf_testmod_kfunc.h is included by both bpf_testmod and bpf programs that use test kfuncs. As suggested by David, the bpf_testmod_kfunc.h includes vmlinux.h and bpf/bpf_helpers.h for bpf programs build, so the declarations have proper __ksym attribute and we can resolve all the structs. Note in kfunc_call_test_subprog.c we can no longer use the sk_state define from bpf_tcp_helpers.h (because it clashed with vmlinux.h) and we need to address __sk_common.skc_state field directly. Acked-by: David Vernet Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20230515133756.1658301-3-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 10cb8622b6958c2d47961d6a42c76e6c9f1c08f3 Author: Jiri Olsa Date: Mon May 15 15:37:47 2023 +0200 libbpf: Store zero fd to fd_array for loader kfunc relocation When moving some of the test kfuncs to bpf_testmod I hit an issue when some of the kfuncs that object uses are in module and some in vmlinux. The problem is that both vmlinux and module kfuncs get allocated btf_fd_idx index into fd_array, but we store to it the BTF fd value only for module's kfunc, not vmlinux's one because (it's zero). Then after the program is loaded we check if fd_array[btf_fd_idx] != 0 and close the fd. When the object has kfuncs from both vmlinux and module, the fd from fd_array[btf_fd_idx] from previous load will be stored in there for vmlinux's kfunc, so we close unrelated fd (of the program we just loaded in my case). Fixing this by storing zero to fd_array[btf_fd_idx] for vmlinux kfuncs, so the we won't close stale fd. Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20230515133756.1658301-2-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 833e24aeb4d9a4803af3b836464df01293ce9041 Merge: e7480a44d7c4c 2a3e163602906 Author: Jakub Kicinski Date: Tue May 16 20:58:58 2023 -0700 Merge tag 'linux-can-next-for-6.5-20230515' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2023-05-15 The 1st patch is by Ji-Ze Hong and adds support for the Fintek F81604 USB-CAN adapter. Jiapeng Chong's patch removes unnecessary dev_err() functions from the bxcan driver. The next patch is by me an makes a CAN internal header file self contained. The remaining 19 patches are by Uwe Kleine-König, they all convert the platform driver remove callback to return void. * tag 'linux-can-next-for-6.5-20230515' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: (22 commits) can: xilinx: Convert to platform remove callback returning void can: ti_hecc: Convert to platform remove callback returning void can: sun4i_can: Convert to platform remove callback returning void can: softing: Convert to platform remove callback returning void can: sja1000_platform: Convert to platform remove callback returning void can: sja1000_isa: Convert to platform remove callback returning void can: rcar: Convert to platform remove callback returning void can: mscan: mpc5xxx_can: Convert to platform remove callback returning void can: m_can: Convert to platform remove callback returning void can: janz-ican3: Convert to platform remove callback returning void can: ifi_canfd: Convert to platform remove callback returning void can: grcan: Convert to platform remove callback returning void can: flexcan: Convert to platform remove callback returning void can: ctucanfd: Convert to platform remove callback returning void can: length: make header self contained can: cc770_platform: Convert to platform remove callback returning void can: bxcan: Remove unnecessary print function dev_err() can: cc770_isa: Convert to platform remove callback returning void can: usb: f81604: add Fintek F81604 support can: c_can: Convert to platform remove callback returning void ... ==================== Link: https://lore.kernel.org/r/20230515205759.1003118-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit de58ef414d8d7a0a635cd331b3b013d8216c4e60 Author: Yonghong Song Date: Tue May 16 14:49:45 2023 -0700 selftests/bpf: Fix s390 sock_field test failure llvm patch [1] enabled cross-function optimization for func arguments (ArgumentPromotion) at -O2 level. And this caused s390 sock_fields test failure ([2]). The failure is gone right now as patch [1] was reverted in [3]. But it is possible that patch [3] will be reverted again and then the test failure in [2] will show up again. So it is desirable to fix the failure regardless. The following is an analysis why sock_field test fails with llvm patch [1]. The main problem is in static __noinline bool sk_dst_port__load_word(struct bpf_sock *sk) { __u32 *word = (__u32 *)&sk->dst_port; return word[0] == bpf_htons(0xcafe); } static __noinline bool sk_dst_port__load_half(struct bpf_sock *sk) { __u16 *half = (__u16 *)&sk->dst_port; return half[0] == bpf_htons(0xcafe); } ... int read_sk_dst_port(struct __sk_buff *skb) { ... sk = skb->sk; ... if (!sk_dst_port__load_word(sk)) RET_LOG(); if (!sk_dst_port__load_half(sk)) RET_LOG(); ... } Through some cross-function optimization by ArgumentPromotion optimization, the compiler does: static __noinline bool sk_dst_port__load_word(__u32 word_val) { return word_val == bpf_htons(0xcafe); } static __noinline bool sk_dst_port__load_half(__u16 half_val) { return half_val == bpf_htons(0xcafe); } ... int read_sk_dst_port(struct __sk_buff *skb) { ... sk = skb->sk; ... __u32 *word = (__u32 *)&sk->dst_port; __u32 word_val = word[0]; ... if (!sk_dst_port__load_word(word_val)) RET_LOG(); __u16 half_val = word_val >> 16; if (!sk_dst_port__load_half(half_val)) RET_LOG(); ... } In current uapi bpf.h, we have struct bpf_sock { ... __be16 dst_port; /* network byte order */ __u16 :16; /* zero padding */ ... }; But the old kernel (e.g., 5.6) we have struct bpf_sock { ... __u32 dst_port; /* network byte order */ ... }; So for backward compatability reason, 4-byte load of dst_port is converted to 2-byte load internally. Specifically, 'word_val = word[0]' is replaced by 2-byte load by the verifier and this caused the trouble for later sk_dst_port__load_half() where half_val becomes 0. Typical usr program won't have such a code pattern tiggering the above bug, so let us fix the test failure with source code change. Adding an empty asm volatile statement seems enough to prevent undesired transformation. [1] https://reviews.llvm.org/D148269 [2] https://lore.kernel.org/bpf/e7f2c5e8-a50c-198d-8f95-388165f1e4fd@meta.com/ [3] https://reviews.llvm.org/rG141be5c062ecf22bd287afffd310e8ac4711444a Tested-by: Ilya Leoshkevich Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230516214945.1013578-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit 24a86d833bc5509ad34343dd6c649ea11ed1cad3 Author: Andrii Nakryiko Date: Mon May 15 13:48:33 2023 -0700 selftests/bpf: improve netcnt test robustness Change netcnt to demand at least 10K packets, as we frequently see some stray packet arriving during the test in BPF CI. It seems more important to make sure we haven't lost any packet than enforcing exact number of packets. Cc: Stanislav Fomichev Signed-off-by: Andrii Nakryiko Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20230515204833.2832000-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit e7480a44d7c4ce4691fa6bcdb0318f0d81fe4b12 Author: Jakub Kicinski Date: Tue May 16 20:41:12 2023 -0700 Revert "net: Remove low_thresh in ip defrag" This reverts commit b2cbac9b9b28730e9e53be20b6cdf979d3b9f27e. We have multiple reports of obvious breakage from this patch. Reported-by: Ido Schimmel Link: https://lore.kernel.org/all/ZGIRWjNcfqI8yY8W@shredder/ Link: https://lore.kernel.org/all/CADJHv_sDK=0RrMA2FTZQV5fw7UQ+qY=HG21Wu5qb0V9vvx5w6A@mail.gmail.com/ Reported-by: syzbot+a5e719ac7c268e414c95@syzkaller.appspotmail.com Reported-by: syzbot+a03fd670838d927d9cd8@syzkaller.appspotmail.com Fixes: b2cbac9b9b28 ("net: Remove low_thresh in ip defrag") Link: https://lore.kernel.org/r/20230517034112.1261835-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit a0e35a648faf9170e0c32c98b22e66f0a2d964d3 Merge: e641577eb6e82 108598c39eefb Author: Jakub Kicinski Date: Tue May 16 19:50:05 2023 -0700 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2023-05-16 We've added 57 non-merge commits during the last 19 day(s) which contain a total of 63 files changed, 3293 insertions(+), 690 deletions(-). The main changes are: 1) Add precision propagation to verifier for subprogs and callbacks, from Andrii Nakryiko. 2) Improve BPF's {g,s}setsockopt() handling with wrong option lengths, from Stanislav Fomichev. 3) Utilize pahole v1.25 for the kernel's BTF generation to filter out inconsistent function prototypes, from Alan Maguire. 4) Various dyn-pointer verifier improvements to relax restrictions, from Daniel Rosenberg. 5) Add a new bpf_task_under_cgroup() kfunc for designated task, from Feng Zhou. 6) Unblock tests for arm64 BPF CI after ftrace supporting direct call, from Florent Revest. 7) Add XDP hint kfunc metadata for RX hash/timestamp for igc, from Jesper Dangaard Brouer. 8) Add several new dyn-pointer kfuncs to ease their usability, from Joanne Koong. 9) Add in-depth LRU internals description and dot function graph, from Joe Stringer. 10) Fix KCSAN report on bpf_lru_list when accessing node->ref, from Martin KaFai Lau. 11) Only dump unprivileged_bpf_disabled log warning upon write, from Kui-Feng Lee. 12) Extend test_progs to directly passing allow/denylist file, from Stephen Veiss. 13) Fix BPF trampoline memleak upon failure attaching to fentry, from Yafang Shao. 14) Fix emitting struct bpf_tcp_sock type in vmlinux BTF, from Yonghong Song. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (57 commits) bpf: Fix memleak due to fentry attach failure bpf: Remove bpf trampoline selector bpf, arm64: Support struct arguments in the BPF trampoline bpftool: JIT limited misreported as negative value on aarch64 bpf: fix calculation of subseq_idx during precision backtracking bpf: Remove anonymous union in bpf_kfunc_call_arg_meta bpf: Document EFAULT changes for sockopt selftests/bpf: Correctly handle optlen > 4096 selftests/bpf: Update EFAULT {g,s}etsockopt selftests bpf: Don't EFAULT for {g,s}setsockopt with wrong optlen libbpf: fix offsetof() and container_of() to work with CO-RE bpf: Address KCSAN report on bpf_lru_list bpf: Add --skip_encoding_btf_inconsistent_proto, --btf_gen_optimized to pahole flags for v1.25 selftests/bpf: Accept mem from dynptr in helper funcs bpf: verifier: Accept dynptr mem as mem in helpers selftests/bpf: Check overflow in optional buffer selftests/bpf: Test allowing NULL buffer in dynptr slice bpf: Allow NULL buffers in bpf_dynptr_slice(_rw) selftests/bpf: Add testcase for bpf_task_under_cgroup bpf: Add bpf_task_under_cgroup() kfunc ... ==================== Link: https://lore.kernel.org/r/20230515225603.27027-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 16853cd8f6d44d774f683d670be38c7d91eb32b8 Author: Bagas Sanjaya Date: Wed May 10 16:39:33 2023 +0700 scsi: dc395x: Documentation: Reword original driver attribution The Linux kernel isn't in 2.6.x anymore, but rather the major version has advanced much (currently 6.x). Reword the attribution. Also, replace 404'ed 2.4 driver link with web.archive.org snapshot [1]. Link: https://web.archive.org/web/20140129181343/http://www.garloff.de/kurt/linux/dc395/ [1] Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20230510093933.19985-4-bagasdotme@gmail.com Signed-off-by: Martin K. Petersen commit 7a94a131aa109e146067b90b29e9ba47c0a72a49 Author: Bagas Sanjaya Date: Wed May 10 16:39:32 2023 +0700 scsi: dc395x: Documentation: Replace non-functional twibble.org list Sync mailing list address in the documentation to follow MAINTAINERS. Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20230510093933.19985-3-bagasdotme@gmail.com Signed-off-by: Martin K. Petersen commit 332aac6f0dc0012a5f32daa51370ca374531dc85 Author: Bagas Sanjaya Date: Wed May 10 16:39:31 2023 +0700 scsi: MAINTAINERS: Drop DC395x list and site Emails to DC395x list bounce (550 error) and visiting the site returns 404 page. Drop both twibble.org links. The driver should now be covered by linux-scsi list. Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20230510093933.19985-2-bagasdotme@gmail.com Signed-off-by: Martin K. Petersen commit 21b382460d659fc4ac0c86c1b3a02e6bf8ef2418 Author: Jason Yan Date: Tue May 16 19:01:31 2023 +0800 scsi: MAINTAINERS: Add a libsas entry John has been reviewing libsas patches for years. And I have been contributing to libsas for years and I am interested in reviewing and testing libsas patches too. So add a libsas entry and add John and me as reviewer. Cc: John Garry Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20230516110131.388634-1-yanaijie@huawei.com Reviewed-by: Damien Le Moal Acked-by: Niklas Cassel Signed-off-by: Martin K. Petersen commit 37f1663c91934f664fb850306708094a324c227c Author: Azeem Shaikh Date: Tue May 16 02:54:04 2023 +0000 scsi: qla2xxx: Replace all non-returning strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230516025404.2843867-1-azeemshaikh38@gmail.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 41300cc989c26ef2429ae8225b3b42dfc6b6036e Author: Azeem Shaikh Date: Tue May 16 02:53:55 2023 +0000 scsi: qla4xxx: Replace all non-returning strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230516025355.2835898-1-azeemshaikh38@gmail.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 0871237a946e2b16e82048d92d69058fddb9172a Author: Azeem Shaikh Date: Tue May 16 02:53:22 2023 +0000 scsi: target: Replace all non-returning strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230516025322.2804923-1-azeemshaikh38@gmail.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit f2156989bf3014c67707d73ccd202b2ada09080b Author: Brad Larson Date: Mon May 15 11:16:00 2023 -0700 spi: cdns: Add compatible for AMD Pensando Elba SoC Document the cadence qspi controller compatible for AMD Pensando Elba SoC boards. The Elba qspi fifo size is 1024. Signed-off-by: Brad Larson Date: Mon May 15 11:16:05 2023 -0700 spi: cadence-quadspi: Add compatible for AMD Pensando Elba SoC The AMD Pensando Elba SoC has the Cadence QSPI controller integrated. The quirk CQSPI_NEEDS_APB_AHB_HAZARD_WAR is added and if enabled a dummy readback from the controller is performed to ensure synchronization. Signed-off-by: Brad Larson Date: Tue May 16 01:33:45 2023 +0000 scsi: bfa: Replace all non-returning strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Link: https://lore.kernel.org/r/20230516013345.723623-1-azeemshaikh38@gmail.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 15a1cd245d5b3cc6cf42ca9ceacf9a6dfc2e33b4 Author: Axel Lin Date: Tue May 16 16:23:33 2023 +0800 regulator: tps6287x: Fix missing .n_voltages setting Otherwise, regulator_list_voltage() will return -EINVAL. Signed-off-by: Axel Lin Date: Tue May 16 13:44:48 2023 +0800 ASoC: dt-bindings: nau8810: Convert to dtschema Convert the NAU8810 audio CODEC bindings to DT schema. Signed-off-by: David Lin Date: Wed May 17 06:36:59 2023 +0800 ASoC: tegra: tegra210_adx: fix snd_pcm_format_t type use snd_pcm_format_t instead of unsigned int to fix the following sparse warnings: sound/soc/tegra/tegra210_adx.c:125:14: sparse: warning: restricted snd_pcm_format_t degrades to integer sound/soc/tegra/tegra210_adx.c:128:14: sparse: warning: restricted snd_pcm_format_t degrades to integer sound/soc/tegra/tegra210_adx.c:131:14: sparse: warning: restricted snd_pcm_format_t degrades to integer Signed-off-by: Min-Hua Chen Date: Tue May 16 13:49:45 2023 +0800 ASoC: dt-bindings: nau8315: Convert to dtschema Convert the NAU8315 audio CODEC bindings to DT schema. Signed-off-by: David Lin Date: Mon May 8 13:30:33 2023 +0200 ASoC: dt-bindings: Add Google Chameleon v3 i2s device Add binding for google,chv3-i2s device. Signed-off-by: Paweł Anikiel Date: Mon May 8 13:30:34 2023 +0200 ASoC: dt-bindings: Add Google Chameleon v3 audio codec Add binding for google,chv3-codec device. Signed-off-by: Paweł Anikiel Date: Mon May 8 13:30:32 2023 +0200 ASoC: Add Google Chameleon v3 codec driver Add driver for the codec IP present on Google Chameleon v3 Signed-off-by: Paweł Anikiel Date: Mon May 8 13:30:31 2023 +0200 ASoC: Add Google Chameleon v3 i2s driver Add driver for the i2s IP present on Google Chameleon v3 Signed-off-by: Paweł Anikiel Date: Tue May 16 21:36:51 2023 -0400 Merge patch series "scsi: hisi_sas: Some misc changes" Xiang Chen says: This series contains some fixes including: - Configure initial value of some registers according to HBA model - Change DMA setup lock timeout from 100ms to 2.5s - Fix warnings detected by sparse Link: https://lore.kernel.org/r/1684118481-95908-1-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Martin K. Petersen commit c0328cc595124579328462fc45d7a29a084cf357 Author: Xingui Yang Date: Mon May 15 10:41:21 2023 +0800 scsi: hisi_sas: Fix warnings detected by sparse This patch fixes the following warning: drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:2168:43: sparse: sparse: restricted __le32 degrades to integer Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304161254.NztCVZIO-lkp@intel.com/ Signed-off-by: Xingui Yang Signed-off-by: Xiang Chen Link: https://lore.kernel.org/r/1684118481-95908-4-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Martin K. Petersen commit a090fc97617b1b2d0dc8dcb418cc614573a1a8be Author: Xingui Yang Date: Mon May 15 10:41:20 2023 +0800 scsi: hisi_sas: Change DMA setup lock timeout to 2.5s DMA setup lock timeout protection is added when DMA setup frames are received. It's a function outside the protocol and used to prevent SATA disk I/Os from being delivered for a long time. The default value is 100ms, it's too strict and easily triggered timeout when the disk is overloaded or faulty. Based on the average I/O latency of 300 disks, we adjust the value to 2.5s. Signed-off-by: Xingui Yang Signed-off-by: Yihang Li Signed-off-by: Xiang Chen Link: https://lore.kernel.org/r/1684118481-95908-3-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Martin K. Petersen commit b68daae9660b45a0bb3ac9df1f1746d15693d254 Author: Yihang Li Date: Mon May 15 10:41:19 2023 +0800 scsi: hisi_sas: Configure initial value of some registers according to HBA model For SAS HBAs of 920 and previous version, we use init_reg_v3_hw() to set some registers which are related to HW boards. For SAS HBAs of 920B and later version, those HW registers are set through firmware. And different HBA models are distinguished through pci_dev->revision. Signed-off-by: Yihang Li Signed-off-by: Xiang Chen Link: https://lore.kernel.org/r/1684118481-95908-2-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Martin K. Petersen commit aa67380056a43277da11a5550669f5a80057ce2d Author: Kees Cook Date: Thu May 11 15:10:00 2023 -0700 scsi: megaraid_sas: Convert union megasas_sgl to flex-arrays In the ongoing effort to replace all fake flexible arrays with true flexible arrays, replace the sge32, sge64, and sge_skinny members of union megasas_sgl with true flexible arrays. No binary differences are seen after this change; sizes were already being manually calculated using the member struct sizes directly. Cc: Kashyap Desai Cc: Sumit Saxena Cc: Shivasharan S Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Gustavo A. R. Silva Cc: megaraidlinux.pdl@broadcom.com Cc: linux-scsi@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230511220957.never.919-kees@kernel.org Signed-off-by: Martin K. Petersen commit 7e79881d92e8d52c45992ed4d669985c167fa0ad Author: Krzysztof Kozlowski Date: Thu May 11 19:52:04 2023 +0200 scsi: ufs: hwmon: Constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230511175204.281038-1-krzysztof.kozlowski@linaro.org Signed-off-by: Martin K. Petersen commit 60592fb6b67c653beaa2e7acad9a9d7aa0b71dff Author: Fangrui Song Date: Fri May 12 02:25:28 2023 +0000 coredump, vmcore: Set p_align to 4 for PT_NOTE Tools like readelf/llvm-readelf use p_align to parse a PT_NOTE program header as an array of 4-byte entries or 8-byte entries. Currently, there are workarounds[1] in place for Linux to treat p_align==0 as 4. However, it would be more appropriate to set the correct alignment so that tools do not have to rely on guesswork. FreeBSD coredumps set p_align to 4 as well. [1]: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=82ed9683ec099d8205dc499ac84febc975235af6 [2]: https://reviews.llvm.org/D150022 Signed-off-by: Fangrui Song Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230512022528.3430327-1-maskray@google.com commit 55c84a5cf2c72a821719823ef2ebef01b119025b Author: Kees Cook Date: Tue Apr 4 14:24:27 2023 -0700 fortify: strcat: Move definition to use fortified strlcat() Move the definition of fortified strcat() to after strlcat() to use it for bounds checking. Signed-off-by: Kees Cook commit 605395cd7ceded5842c8ba6763ea24feee690c87 Author: Kees Cook Date: Sun Apr 2 23:00:05 2023 -0700 fortify: Add protection for strlcat() The definition of strcat() was defined in terms of unfortified strlcat(), but that meant there was no bounds checking done on the internal strlen() calls, and the (bounded) copy would be performed before reporting a failure. Additionally, pathological cases (i.e. unterminated destination buffer) did not make calls to fortify_panic(), which will make future unit testing more difficult. Instead, explicitly define a fortified strlcat() wrapper for strcat() to use. Signed-off-by: Kees Cook commit 21a2c74b0a2a784228c9e3af63cff96d0dea7b8a Author: Kees Cook Date: Fri Apr 7 12:27:10 2023 -0700 fortify: Use const variables for __member_size tracking The sizes reported by __member_size should never change in a given function. Mark them as such. Suggested-by: Miguel Ojeda Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20230407192717.636137-4-keescook@chromium.org commit 3bf301e1ab85e18ed0e337ce124dc71d6d7b5fd7 Author: Kees Cook Date: Tue Apr 4 15:43:35 2023 -0700 string: Add Kunit tests for strcat() family Add tests to make sure the strcat() family of functions behave correctly. Signed-off-by: Kees Cook commit a9dc8d0442294b426b1ebd4ec6097c82ebe282e0 Author: Kees Cook Date: Sun Mar 26 13:53:27 2023 -0700 fortify: Allow KUnit test to build without FORTIFY In order for CI systems to notice all the skipped tests related to CONFIG_FORTIFY_SOURCE, allow the FORTIFY_SOURCE KUnit tests to build with or without CONFIG_FORTIFY_SOURCE. Signed-off-by: Kees Cook commit 4d9060981f886ba881aa3e8de688433c1f1ed11f Author: Kees Cook Date: Sun Apr 2 19:56:34 2023 -0700 kunit: tool: Enable CONFIG_FORTIFY_SOURCE under UML Since commit ba38961a069b ("um: Enable FORTIFY_SOURCE"), it's possible to run the FORTIFY tests under UML. Enable CONFIG_FORTIFY_SOURCE when running with --alltests to gain additional coverage, and by default under UML. Signed-off-by: Kees Cook commit ead62aa370a81c4fb42a44c4edeafe13e0a3a703 Author: Arne Welzel Date: Sat May 13 11:18:40 2023 +0200 fortify: strscpy: Fix flipped q and p docstring typo Fix typo in the strscpy() docstring where q and p were flipped. Signed-off-by: Arne Welzel Signed-off-by: Kees Cook commit 2d47c6956ab3c8b580a59d7704aab3e2a4882b6c Author: Kees Cook Date: Tue Apr 4 19:23:59 2023 -0700 ubsan: Tighten UBSAN_BOUNDS on GCC The use of -fsanitize=bounds on GCC will ignore some trailing arrays, leaving a gap in coverage. Switch to using -fsanitize=bounds-strict to match Clang's stricter behavior. Cc: Marco Elver Cc: Masahiro Yamada Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Nicolas Schier Cc: Tom Rix Cc: Josh Poimboeuf Cc: Miroslav Benes Cc: linux-kbuild@vger.kernel.org Cc: llvm@lists.linux.dev Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230405022356.gonna.338-kees@kernel.org commit eae36cb82440bc14e3299e46efdf2bdcc381880c Author: Niklas Schnelle Date: Tue May 16 13:00:23 2023 +0200 power: reset: add HAS_IOPORT dependencies In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Signed-off-by: Sebastian Reichel commit f6eeea8d7097a82d1460537146dee670d5014f13 Author: John Harrison Date: Tue Apr 18 11:17:44 2023 -0700 drm/i915/guc: Dump error capture to dmesg on CTB error In the past, There have been sporadic CTB failures which proved hard to reproduce manually. The most effective solution was to dump the GuC log at the point of failure and let the CI system do the repro. It is preferable not to dump the GuC log via dmesg for all issues as it is not always necessary and is not helpful for end users. But rather than trying to re-invent the code to do this each time it is wanted, commit the code but for DEBUG_GUC builds only. v2: Use IS_ENABLED for testing config options. Signed-off-by: John Harrison Reviewed-by: Vinay Belgaumkar Link: https://patchwork.freedesktop.org/patch/msgid/20230418181744.3251240-3-John.C.Harrison@Intel.com commit 6197cff30df44e4db85fed545fecb7df00ff8cd0 Author: John Harrison Date: Tue Apr 18 11:17:43 2023 -0700 drm/i915: Dump error capture to kernel log This is useful for getting debug information out in certain situations, such as failing kernel selftests and CI runs that don't log error captures. It is especially useful for things like retrieving GuC logs as GuC operation can't be tracked by adding printk or ftrace entries. v2: Add CONFIG_DRM_I915_DEBUG_GEM wrapper (review feedback by Rodrigo). Signed-off-by: John Harrison Reviewed-by: Vinay Belgaumkar Link: https://patchwork.freedesktop.org/patch/msgid/20230418181744.3251240-2-John.C.Harrison@Intel.com commit 2a1d18a5dc5056825b8e9527d188130da6256efc Author: Osama Muhammad Date: Tue May 16 23:29:27 2023 +0500 ras/debugfs: Fix error checking for debugfs_create_dir() Check the return value of debugfs_create_dir() properly. [ bp: Rewrite commit message. ] Signed-off-by: Osama Muhammad Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230516182927.9171-1-osmtendev@gmail.com commit ceb434d56826b39ff9d5700804c4b22cb091c1a2 Author: Vaishnav Achath Date: Fri May 5 20:09:29 2023 +0530 dmaengine: ti: k3-udma: Add support for J721S2 CSI BCDMA instance J721S2 has dedicated BCDMA instance for Camera Serial Interface RX and TX. The BCDMA instance supports RX and TX channels but block copy channels are not present, add support for the same. Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20230505143929.28131-3-vaishnav.a@ti.com Signed-off-by: Vinod Koul commit 6de80a0cc7d24292ed83d1696f61ebfee2b854f1 Author: Vaishnav Achath Date: Fri May 5 20:09:28 2023 +0530 dt-bindings: dma: ti: Add J721S2 BCDMA Add bindings for J721S2 BCDMA instance dedicated for Camera Serial Interface. Unlike AM62A CSI BCDMA, this instance has RX and TX channels but lacks block copy channels. Signed-off-by: Vaishnav Achath Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230505143929.28131-2-vaishnav.a@ti.com Signed-off-by: Vinod Koul commit b8e27cb0e4ed0e8c4bb858989ecb361d537bd9f0 Author: Kishon Vijay Abraham I Date: Thu May 11 09:17:04 2023 +0530 dmaengine: ti: k3-psil-j721s2: Add PSI-L thread map for main CPSW2G Add PSI-L thread map for main CPSW2G. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Siddharth Vadapalli Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230511034704.656155-1-s-vadapalli@ti.com Signed-off-by: Vinod Koul commit 64273b51a5156cae177394b3d9f036e0e61ca703 Author: Michal Simek Date: Fri May 12 13:40:33 2023 +0200 dt-bindings: dma: xilinx: Add power-domains to xlnx,zynqmp-dpdma DP DMA has own power domain that's why describe required power-domain property. Signed-off-by: Michal Simek Acked-by: Conor Dooley Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/8f5651634df338743f95a7253a741f9ddc92487d.1683891609.git.michal.simek@amd.com Signed-off-by: Vinod Koul commit a12ab1378a88b38f3af8b1a899b7d8526324ba6f Author: Marc Zyngier Date: Wed Apr 26 17:23:30 2023 +0000 KVM: arm64: Use local TLBI on permission relaxation Broadcast TLB invalidations (TLBIs) targeting the Inner Shareable Domain are usually less performant than their non-shareable variant. In particular, we observed some implementations that take millliseconds to complete parallel broadcasted TLBIs. It's safe to use non-shareable TLBIs when relaxing permissions on a PTE in the KVM case. According to the ARM ARM (0487I.a) section D8.13.1 "Using break-before-make when updating translation table entries", permission relaxation does not need break-before-make. Specifically, R_WHZWS states that these are the only changes that require a break-before-make sequence: changes of memory type (Shareability or Cacheability), address changes, or changing the block size. Signed-off-by: Marc Zyngier Signed-off-by: Ricardo Koller Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-13-ricarkol@google.com Signed-off-by: Oliver Upton commit 6acf51666d039857421b6f8a3660301c82649fa5 Author: Ricardo Koller Date: Wed Apr 26 17:23:29 2023 +0000 KVM: arm64: Split huge pages during KVM_CLEAR_DIRTY_LOG This is the arm64 counterpart of commit cb00a70bd4b7 ("KVM: x86/mmu: Split huge pages mapped by the TDP MMU during KVM_CLEAR_DIRTY_LOG"), which has the benefit of splitting the cost of splitting a memslot across multiple ioctls. Split huge pages on the range specified using KVM_CLEAR_DIRTY_LOG. And do not split when enabling dirty logging if KVM_DIRTY_LOG_INITIALLY_SET is set. Signed-off-by: Ricardo Koller Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-12-ricarkol@google.com Signed-off-by: Oliver Upton commit 3005f6f29447d4f397c2ba67119fdea222ee51d3 Author: Ricardo Koller Date: Wed Apr 26 17:23:28 2023 +0000 KVM: arm64: Open-code kvm_mmu_write_protect_pt_masked() Move the functionality of kvm_mmu_write_protect_pt_masked() into its caller, kvm_arch_mmu_enable_log_dirty_pt_masked(). This will be used in a subsequent commit in order to share some of the code in kvm_arch_mmu_enable_log_dirty_pt_masked(). Signed-off-by: Ricardo Koller Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-11-ricarkol@google.com Signed-off-by: Oliver Upton commit e7bf7a490c68b0b64bc05aa0a4f09f6044037db1 Author: Ricardo Koller Date: Wed Apr 26 17:23:27 2023 +0000 KVM: arm64: Split huge pages when dirty logging is enabled Split huge pages eagerly when enabling dirty logging. The goal is to avoid doing it while faulting on write-protected pages, which negatively impacts guest performance. A memslot marked for dirty logging is split in 1GB pieces at a time. This is in order to release the mmu_lock and give other kernel threads the opportunity to run, and also in order to allocate enough pages to split a 1GB range worth of huge pages (or a single 1GB huge page). Note that these page allocations can fail, so eager page splitting is best-effort. This is not a correctness issue though, as huge pages can still be split on write-faults. Eager page splitting only takes effect when the huge page mapping has been existing in the stage-2 page table. Otherwise, the huge page will be mapped to multiple non-huge pages on page fault. The benefits of eager page splitting are the same as in x86, added with commit a3fe5dbda0a4 ("KVM: x86/mmu: Split huge pages mapped by the TDP MMU when dirty logging is enabled"). For example, when running dirty_log_perf_test with 64 virtual CPUs (Ampere Altra), 1GB per vCPU, 50% reads, and 2MB HugeTLB memory, the time it takes vCPUs to access all of their memory after dirty logging is enabled decreased by 44% from 2.58s to 1.42s. Signed-off-by: Ricardo Koller Reviewed-by: Shaoqin Huang Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-10-ricarkol@google.com Signed-off-by: Oliver Upton commit ce2b60223800c801b4b519c07aff3aa9c75c2b6d Author: Ricardo Koller Date: Wed Apr 26 17:23:26 2023 +0000 KVM: arm64: Add kvm_uninit_stage2_mmu() Add kvm_uninit_stage2_mmu() and move kvm_free_stage2_pgd() into it. A future commit will add some more things to do inside of kvm_uninit_stage2_mmu(). Signed-off-by: Ricardo Koller Reviewed-by: Shaoqin Huang Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-9-ricarkol@google.com Signed-off-by: Oliver Upton commit 6bd92b9d8b02a67d67b6d7351ad5c81321a02017 Author: Ricardo Koller Date: Wed Apr 26 17:23:25 2023 +0000 KVM: arm64: Refactor kvm_arch_commit_memory_region() Refactor kvm_arch_commit_memory_region() as a preparation for a future commit to look cleaner and more understandable. Also, it looks more like its x86 counterpart (in kvm_mmu_slot_apply_flags()). Signed-off-by: Ricardo Koller Reviewed-by: Shaoqin Huang Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-8-ricarkol@google.com Signed-off-by: Oliver Upton commit 8f5a3eb7513fc4deae511ce91af1c2c23874a8a7 Author: Ricardo Koller Date: Wed Apr 26 17:23:24 2023 +0000 KVM: arm64: Add kvm_pgtable_stage2_split() Add a new stage2 function, kvm_pgtable_stage2_split(), for splitting a range of huge pages. This will be used for eager-splitting huge pages into PAGE_SIZE pages. The goal is to avoid having to split huge pages on write-protection faults, and instead use this function to do it ahead of time for large ranges (e.g., all guest memory in 1G chunks at a time). Signed-off-by: Ricardo Koller Reviewed-by: Shaoqin Huang Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-7-ricarkol@google.com Signed-off-by: Oliver Upton commit 2f440b72e852be428540579b5813ba2b8236578d Author: Ricardo Koller Date: Wed Apr 26 17:23:23 2023 +0000 KVM: arm64: Add KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE Add a capability for userspace to specify the eager split chunk size. The chunk size specifies how many pages to break at a time, using a single allocation. Bigger the chunk size, more pages need to be allocated ahead of time. Suggested-by: Oliver Upton Signed-off-by: Ricardo Koller Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-6-ricarkol@google.com Signed-off-by: Oliver Upton commit 26f457142d7ee2da20a5b701862230e4961423d9 Author: Ricardo Koller Date: Wed Apr 26 17:23:22 2023 +0000 KVM: arm64: Export kvm_are_all_memslots_empty() Export kvm_are_all_memslots_empty(). This will be used by a future commit when checking before setting a capability. Signed-off-by: Ricardo Koller Reviewed-by: Shaoqin Huang Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-5-ricarkol@google.com Signed-off-by: Oliver Upton commit e7c05540c694b2f53a4d25e360c39984d521ccb1 Author: Ricardo Koller Date: Wed Apr 26 17:23:21 2023 +0000 KVM: arm64: Add helper for creating unlinked stage2 subtrees Add a stage2 helper, kvm_pgtable_stage2_create_unlinked(), for creating unlinked tables (which is the opposite of kvm_pgtable_stage2_free_unlinked()). Creating an unlinked table is useful for splitting level 1 and 2 entries into subtrees of PAGE_SIZE PTEs. For example, a level 1 entry can be split into PAGE_SIZE PTEs by first creating a fully populated tree, and then use it to replace the level 1 entry in a single step. This will be used in a subsequent commit for eager huge-page splitting (a dirty-logging optimization). Signed-off-by: Ricardo Koller Reviewed-by: Shaoqin Huang Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-4-ricarkol@google.com Signed-off-by: Oliver Upton commit 02f10845f435fbda4aa2385d4c3a9730c4a5c75a Author: Ricardo Koller Date: Wed Apr 26 17:23:20 2023 +0000 KVM: arm64: Add KVM_PGTABLE_WALK flags for skipping CMOs and BBM TLBIs Add two flags to kvm_pgtable_visit_ctx, KVM_PGTABLE_WALK_SKIP_BBM_TLBI and KVM_PGTABLE_WALK_SKIP_CMO, to indicate that the walk should not perform TLB invalidations (TLBIs) in break-before-make (BBM) nor cache maintenance operations (CMO). This will be used by a future commit to create unlinked tables not accessible to the HW page-table walker. Signed-off-by: Ricardo Koller Reviewed-by: Shaoqin Huang Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-3-ricarkol@google.com Signed-off-by: Oliver Upton commit c14d08c5adb25f397638be3d8dd7f4738fb38272 Author: Ricardo Koller Date: Wed Apr 26 17:23:19 2023 +0000 KVM: arm64: Rename free_removed to free_unlinked Normalize on referring to tables outside of an active paging structure as 'unlinked'. A subsequent change to KVM will add support for building page tables that are not part of an active paging structure. The existing 'removed_table' terminology is quite clunky when applied in this context. Signed-off-by: Ricardo Koller Reviewed-by: Oliver Upton Reviewed-by: Shaoqin Huang Reviewed-by: Gavin Shan Link: https://lore.kernel.org/r/20230426172330.1439644-2-ricarkol@google.com Signed-off-by: Oliver Upton commit 2893f6bc9d4076c48f8dd717b71baa29fe6adcae Author: Linus Walleij Date: Tue May 16 14:55:37 2023 +0200 dmaengine: ste_dma40: Return error codes properly This makes the probe() and its subfunction d40_hw_detect_init() return proper error codes. One effect of this is that deferred probe, e.g from the clock, will start to work, would it happen. Also it is better design. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-dma40-cleanup-v3-7-60bfa6785968@linaro.org Signed-off-by: Vinod Koul commit 339f5041089a22646372d3ebdeec94c25e8d4e29 Author: Linus Walleij Date: Tue May 16 14:55:36 2023 +0200 dmaengine: ste_dma40: Use managed resources This switches the DMA40 driver to use a bunch of managed resources and strip down the errorpath. The result is pretty neat and makes the driver way more readable. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-dma40-cleanup-v3-6-60bfa6785968@linaro.org Signed-off-by: Vinod Koul commit e59d81e9173ae4b5037a81a08b1c5a6915b333e3 Author: Linus Walleij Date: Tue May 16 14:55:35 2023 +0200 dmaengine: ste_dma40: Pass dev to OF function The OF platform data population function only wants to use struct device *dev, so pass that instead. This change makes the compiler realize that the local platform data variable is unused, so drop that too. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-dma40-cleanup-v3-5-60bfa6785968@linaro.org Signed-off-by: Vinod Koul commit 42ae6f1695beed57958e7a2554e6d52dddc56e43 Author: Linus Walleij Date: Tue May 16 14:55:34 2023 +0200 dmaengine: ste_dma40: Remove platform data The Ux500 is device tree-only since ages. Delete the platform data header and push it into or next to the driver instead. Drop the non-DT probe path since this will not happen. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-dma40-cleanup-v3-4-60bfa6785968@linaro.org Signed-off-by: Vinod Koul commit fb85a8c51784f46b4ddd8bdad3c6bcacd0e5ad2b Author: Linus Walleij Date: Tue May 16 14:55:33 2023 +0200 dmaengine: ste_dma40: Add dev helper variable The &pdev->dev device pointer is used so many times in the probe() and d40_hw_detect_init() functions that a local *dev variable makes the code way easier to read. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-dma40-cleanup-v3-3-60bfa6785968@linaro.org Signed-off-by: Vinod Koul commit 5a1a3b9c19ddeddc6b0c2ea1da7fbe6624c04c7e Author: Linus Walleij Date: Tue May 16 14:55:32 2023 +0200 dmaengine: ste_dma40: Get LCPA SRAM from SRAM node Instead of passing the reserved SRAM as a "reg" field look for a phandle to the LCPA SRAM memory so we can use the proper SRAM device tree bindings for the SRAM. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-dma40-cleanup-v3-2-60bfa6785968@linaro.org Signed-off-by: Vinod Koul commit 4f080c77ec53ec619304c0bbee5f6762fe3207a0 Author: Linus Walleij Date: Tue May 16 14:55:31 2023 +0200 dt-bindings: dma: dma40: Prefer to pass sram through phandle Extend the DMA40 bindings so that we can pass two SRAM segments as phandles instead of directly referring to the memory address in the second reg cell. This enables more granular control over the SRAM, and adds the optiona LCLA SRAM segment as well. Deprecate the old way of passing LCPA as a second reg cell, make sram compulsory. Reviewed-by: Rob Herring Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230417-ux500-dma40-cleanup-v3-1-60bfa6785968@linaro.org Signed-off-by: Vinod Koul commit 011670cc340cbc1131677fe233b1a52acee969ee Author: Piotr Raczynski Date: Mon May 15 21:03:19 2023 +0200 ice: add dynamic interrupt allocation Currently driver can only allocate interrupt vectors during init phase by calling pci_alloc_irq_vectors. Change that and make use of new pci_msix_alloc_irq_at/pci_msix_free_irq API and enable to allocate and free more interrupts after MSIX has been enabled. Since not all platforms supports dynamic allocation, check it with pci_msix_can_alloc_dyn. Extend the tracker to keep track how many interrupts are allocated initially so when all such vectors are already used, additional interrupts are automatically allocated dynamically. Remember each interrupt allocation method to then free appropriately. Since some features may require interrupts allocated dynamically add appropriate VSI flag and take it into account when allocating new interrupt. Reviewed-by: Michal Swiatkowski Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Piotr Raczynski Signed-off-by: Tony Nguyen commit cfebc0a36ea5518d6b32a6999da5accf0a94fafa Author: Piotr Raczynski Date: Mon May 15 21:03:18 2023 +0200 ice: track interrupt vectors with xarray Replace custom interrupt tracker with generic xarray data structure. Remove all code responsible for searching for a new entry with xa_alloc, which always tries to allocate at the lowes possible index. As a result driver is always using a contiguous region of the MSIX vector table. New tracker keeps ice_irq_entry entries in xarray as opaque for the rest of the driver hiding the entry details from the caller. Reviewed-by: Jacob Keller Reviewed-by: Michal Swiatkowski Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Piotr Raczynski Signed-off-by: Tony Nguyen commit 4aad5335969f25c4dc966a15c5497db3718538bb Author: Piotr Raczynski Date: Mon May 15 21:03:17 2023 +0200 ice: add individual interrupt allocation Currently interrupt allocations, depending on a feature are distributed in batches. Also, after allocation there is a series of operations that distributes per irq settings through that batch of interrupts. Although driver does not yet support dynamic interrupt allocation, keep allocated interrupts in a pool and add allocation abstraction logic to make code more flexible. Keep per interrupt information in the ice_q_vector structure, which yields ice_vsi::base_vector redundant. Also, as a result there are a few functions that can be removed. Reviewed-by: Jacob Keller Reviewed-by: Michal Swiatkowski Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Piotr Raczynski Signed-off-by: Tony Nguyen commit 524012c69ee1421d4a343291a0cfc1998ccba99a Author: Piotr Raczynski Date: Mon May 15 21:03:16 2023 +0200 ice: remove redundant SRIOV code Remove redundant code from ice_get_max_valid_res_idx that has no effect. ice_pf::irq_tracker is initialized during driver probe, there is no reason to check it again. Also it is not possible for pf::sriov_base_vector to be lower than the tracker length, remove WARN_ON that will never happen. Get rid of ice_get_max_valid_res_idx helper function completely since it can never return negative value. Reviewed-by: Jacob Keller Reviewed-by: Michal Swiatkowski Reviewed-by: Simon Horman Tested-by: Rafal Romanowski Signed-off-by: Piotr Raczynski Signed-off-by: Tony Nguyen commit 369bb5a2a9a76ab6ea2945962d09baa21b4e1a4f Author: Piotr Raczynski Date: Mon May 15 21:03:15 2023 +0200 ice: refactor VF control VSI interrupt handling All VF control VSIs share the same interrupt vector. Currently, a helper function dedicated for that directly sets ice_vsi::base_vector. Use helper that returns pointer to first found VF control VSI instead. Reviewed-by: Jacob Keller Reviewed-by: Simon Horman Tested-by: Rafal Romanowski Signed-off-by: Piotr Raczynski Signed-off-by: Tony Nguyen commit 4c84cced9304303ed1c73e35277891249e3cc2cd Author: Krzysztof Kozlowski Date: Sat Apr 22 00:31:37 2023 +0200 arm64: dts: allwinner: a64: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified property to fix warnings like: sun50i-a64-pine64-lts.dtb: l2-cache: 'cache-unified' is a required property Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230421223137.115015-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 3740a577eaaa224db6e4bd3b6fdaea2fb3729814 Author: Krzysztof Kozlowski Date: Sat Apr 22 00:31:45 2023 +0200 arm64: dts: synaptics: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified and cache-level properties to fix warnings like: berlin4ct-stb.dtb: cache: 'cache-level' is a required property berlin4ct-stb.dtb: cache: 'cache-unified' is a required property Link: https://lore.kernel.org/r/20230421223145.115129-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 7a242135a44d32a6a8563fc74f11d5a100b7cf0a Author: Krzysztof Kozlowski Date: Sat Apr 22 00:31:50 2023 +0200 arm64: dts: realtek: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified and cache-level properties to fix warnings like: rtd1293-ds418j.dtb: l2-cache: 'cache-level' is a required property rtd1293-ds418j.dtb: l2-cache: 'cache-unified' is a required property Link: https://lore.kernel.org/r/20230421223151.115243-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit a0936e9edf16750867b65c8f2017352f1ea3dea8 Author: Krzysztof Kozlowski Date: Sat Apr 22 00:32:14 2023 +0200 arm64: dts: hisilicon: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified properties to fix warnings like: hi3660-hikey960.dtb: l2-cache0: 'cache-unified' is a required property Link: https://lore.kernel.org/r/20230421223215.115666-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 05018936a1fe07b92a612d1fd1511224ba8a1a34 Author: Piotr Raczynski Date: Mon May 15 21:03:14 2023 +0200 ice: use preferred MSIX allocation api Move away from using pci_enable_msix_range/pci_disable_msix and use pci_alloc_irq_vectors/pci_free_irq_vectors instead. As a result stop tracking msix_entries since with newer API entries are handled by MSIX core. However, due to current design of communication with RDMA driver which accesses ice_pf::msix_entries directly, keep using the array just for RDMA driver use. Reviewed-by: Michal Swiatkowski Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Piotr Raczynski Signed-off-by: Tony Nguyen commit 9f921604a91c637eb57e57668045ca5c21f49f05 Author: Krzysztof Kozlowski Date: Sat Apr 22 00:31:40 2023 +0200 arm64: dts: amazon: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified properties to fix warnings like: alpine-v3-evp.dtb: cache@0: 'cache-unified' is a dependency of 'cache-size' Link: https://lore.kernel.org/r/20230421223141.115072-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit afe87cfe820e74cc5fc59359445bcfd93ff0ab07 Author: Piotr Raczynski Date: Mon May 15 21:03:13 2023 +0200 ice: use pci_irq_vector helper function Currently, driver gets interrupt number directly from ice_pf::msix_entries array. Use helper function dedicated to do just that. While at it use a variable to store interrupt number in ice_free_irq_msix_misc instead of calling the helper function twice. Reviewed-by: Michal Swiatkowski Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Piotr Raczynski Signed-off-by: Tony Nguyen commit 0022cec7edecd5ea6796dfe0d75330c55dd07a67 Author: Krzysztof Kozlowski Date: Sat Apr 22 00:31:39 2023 +0200 arm64: dts: apm: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified and cache-level properties to fix warnings like: apm-mustang.dtb: l2-cache-0: 'cache-level' is a required property apm-mustang.dtb: l2-cache-0: 'cache-unified' is a required property Link: https://lore.kernel.org/r/20230421223139.115044-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 21f475946d89911e31bccd02f8a7ce40b8f52a70 Author: Krzysztof Kozlowski Date: Sun Apr 23 17:08:24 2023 +0200 ARM: dts: en7523: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified and cache-level properties to fix warnings like: en7523-evb.dtb: l2-cache0: 'cache-level' is a required property en7523-evb.dtb: l2-cache0: 'cache-unified' is a required property Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230423150824.118430-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 38e97a98e371c615f67d144ee9e4f7087c0a41e8 Author: Piotr Raczynski Date: Mon May 15 21:03:12 2023 +0200 ice: move interrupt related code to separate file Keep interrupt handling code in a dedicated file. This helps keep driver structured better and prepares for more functionality added to this file. Reviewed-by: Jacob Keller Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Piotr Raczynski Signed-off-by: Tony Nguyen commit 519ce291168af247c7c0fd122c754b74bcf08117 Author: Cong Yang Date: Tue May 9 10:51:53 2023 +0800 drm/panel: Modify innolux hj110iz panel initial code There is a problem of screen shake on the old panel. So increase the panel GOP component pull-down circuit size in hardware, and update the initialization code at the same time. The new initialization code mainly modifles the following. a)adjusted for GOP timing. When Display sleep in, raise all GOP signals to VGHO and then drop to GND. b)Increased the Vertical back Porch and Vertical pulse width, so need to update vsync_end and vtotal and CLK in drm_display_mode. Signed-off-by: Cong Yang Reviewed-by: Douglas Anderson [dianders: fixed spelling mistake in subject] Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230509025153.1321446-1-yangcong5@huaqin.corp-partner.google.com commit b195a9d7f72139fe5c51e81684a698c7a8a5f34f Author: Steffen Trumtrar Date: Fri May 5 08:01:58 2023 +0200 ARM: dts: stm32: add STM32MP1-based Phytec board Add the Phytec STM32MP1-3 Dev board. The devboard uses a Phytec stm32m157c-som. Signed-off-by: Steffen Trumtrar Signed-off-by: Alexandre Torgue commit 27538a18a4fcc7e8e20c9f71f9a622685a9d7c7b Author: Steffen Trumtrar Date: Fri May 5 08:01:57 2023 +0200 ARM: dts: stm32: add STM32MP1-based Phytec SoM The Phytec STM32MP1 based SoMs feature up to 1 GB DDR3LP RAM, up to 1 GB eMMC, up to 16 MB QSPI and up to 128 GB NAND flash. Signed-off-by: Steffen Trumtrar Signed-off-by: Alexandre Torgue commit e90227f0f3837ae2552196f26cbd48e576690d70 Author: Steffen Trumtrar Date: Fri May 5 08:01:56 2023 +0200 dt-bindings: arm: stm32: Add Phytec STM32MP1 board The Phytec STM32MP1 based SoMs feature up to 1 GB DDR3LP RAM, up to 1 GB eMMC, up to 16 MB QSPI and up to 128 GB NAND flash. Signed-off-by: Steffen Trumtrar Acked-by: Krzysztof Kozlowski Signed-off-by: Alexandre Torgue commit d4b5f1a5a099d28169e05e138c91e69e00e5ab11 Author: Steffen Trumtrar Date: Fri May 5 08:01:55 2023 +0200 ARM: dts: stm32: Add sleep pinmux for SPI1 pins_a on stm32mp15 Add a sleep mux option for the SPI1 pins_a mux. This is used on the Phycore STM32MP1. Signed-off-by: Steffen Trumtrar Signed-off-by: Alexandre Torgue commit 37f92e6930bd68830f3299f905fa8f208cc7a250 Author: Steffen Trumtrar Date: Fri May 5 08:01:54 2023 +0200 ARM: dts: stm32: Add idle/sleep pinmux for USART3 on stm32mp15 Add idle and sleep mux option for the USART3 pins_a. This is used on the Phycore STM32MP1. Signed-off-by: Steffen Trumtrar Signed-off-by: Alexandre Torgue commit 559b33d2a8c546c06a4e398da064e4a787ea4aab Author: Steffen Trumtrar Date: Fri May 5 08:01:53 2023 +0200 ARM: dts: stm32: Add pinmux for USART1 pins on stm32mp15 Add a mux option for the USART1 pins. This is used on the Phycore STM32MP1. Signed-off-by: Steffen Trumtrar Signed-off-by: Alexandre Torgue commit 2f18e152217d9d784e3ca8270547917cfc7d7440 Author: Steffen Trumtrar Date: Fri May 5 08:01:52 2023 +0200 ARM: dts: stm32: Add new pinmux for sdmmc2_d47 on stm32mp15 Add another option for the SDMMC_D47 pins. This is used on the Phycore STM32MP1. Signed-off-by: Steffen Trumtrar Signed-off-by: Alexandre Torgue commit 8b8d017f5334f01646ab04bf4c5c33d9886f0d5c Author: Steffen Trumtrar Date: Fri May 5 08:01:51 2023 +0200 ARM: dts: stm32: Add new pinmux for sdmmc1_b4 on stm32mp15 Add another option for the SDMMC_B4 pins. It is almost identical to sdmmc1_b4_pins_a but the SDMMC1_D2 pin. This is used on the Phycore STM32MP1. Signed-off-by: Steffen Trumtrar Signed-off-by: Alexandre Torgue commit ab7a5cba8231306fce1125b4aadc9edda076902c Author: Steffen Trumtrar Date: Fri May 5 08:01:50 2023 +0200 ARM: dts: stm32: Add alternate pinmux for sai2b on stm32mp15 Add another option for the SAI2B pins. This is used on the Phycore STM32MP1. Signed-off-by: Steffen Trumtrar Reviewed-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit 303f3fe1d88f7e45e0ab63f37c0949953b69fc10 Author: Steffen Trumtrar Date: Fri May 5 08:01:49 2023 +0200 ARM: dts: stm32: Add alternate pinmux for ethernet for stm32mp15 Add another option for the ethernet0 pins. It is almost identical to ethernet0_rgmii_pins_c apart from TXD0/1. This is used on the Phycore STM32MP1. Signed-off-by: Steffen Trumtrar Signed-off-by: Alexandre Torgue commit 786bb02458819df7a833361c6c7448a4925a89ce Author: Pankaj Raghav Date: Thu May 11 14:15:44 2023 +0200 brd: use XArray instead of radix-tree to index backing pages XArray was introduced to hold large array of pointers with a simple API. XArray API also provides array semantics which simplifies the way we store and access the backing pages, and the code becomes significantly easier to understand. No performance difference was noticed between the two implementation using fio with direct=1 [1]. [1] Performance in KIOPS: | radix-tree | XArray | Diff | | | write | 315 | 313 | -0.6% randwrite | 286 | 290 | +1.3% read | 330 | 335 | +1.5% randread | 309 | 312 | +0.9% Signed-off-by: Pankaj Raghav Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20230511121544.111648-1-p.raghav@samsung.com Signed-off-by: Jens Axboe commit a3c10035d12f5ec10915d5c00c2e8f7d7c066182 Author: Alexander Stein Date: Tue May 16 10:05:53 2023 +0200 eeprom: at24: Use dev_err_probe for nvmem register failure When using nvmem layouts it is possible devm_nvmem_register returns -EPROBE_DEFER, resulting in an 'empty' in /sys/kernel/debug/devices_deferred. Use dev_err_probe for providing additional information. Signed-off-by: Alexander Stein Signed-off-by: Bartosz Golaszewski commit 8d087a09c7017f1425f3f1d36807eb4988410942 Author: Siddharth Vadapalli Date: Fri Mar 31 11:55:21 2023 +0530 phy: ti: gmii-sel: Enable USXGMII mode for J784S4 TI's J784S4 SoC supports USXGMII mode with the CPSW9G instance's MAC ports 1 and 2. Add USXGMII mode to the extra_modes member of J784S4's SoC data. Signed-off-by: Siddharth Vadapalli Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230331062521.529005-3-s-vadapalli@ti.com Signed-off-by: Vinod Koul commit efd658807d3fb838ba79bedecfe45cc838283ac4 Author: Siddharth Vadapalli Date: Fri Mar 31 11:55:20 2023 +0530 phy: ti: gmii-sel: Add support for CPSW9G GMII SEL in J784S4 Each of the CPSW9G ports in TI's J784S4 SoC support modes such as QSGMII. Add a new compatible for it and allow the usage of "ti,qsgmii-main-ports" property for J784S4. Signed-off-by: Siddharth Vadapalli Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230331062521.529005-2-s-vadapalli@ti.com Signed-off-by: Vinod Koul commit 2de2e49b3226cc6252c7dbf1a543e7546db416d3 Author: Siddharth Vadapalli Date: Thu Mar 9 12:05:14 2023 +0530 phy: ti: gmii-sel: Enable SGMII mode for J721E TI's J721E SoC supports SGMII mode with the CPSW9G instance of the CPSW Ethernet Switch. Thus, enable it by adding SGMII mode to the list of the corresponding extra_modes member. Signed-off-by: Siddharth Vadapalli Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230309063514.398705-4-s-vadapalli@ti.com Signed-off-by: Vinod Koul commit 178b65152149628a59d9805c11b18527141a2b7b Author: Siddharth Vadapalli Date: Thu Mar 9 12:05:13 2023 +0530 phy: ti: gmii-sel: Enable SGMII mode for J7200 TI's J7200 SoC supports SGMII mode with the CPSW5G instance of the CPSW Ethernet Switch. Thus, enable it by adding SGMII mode to the list of the corresponding extra_modes member. Signed-off-by: Siddharth Vadapalli Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230309063514.398705-3-s-vadapalli@ti.com Signed-off-by: Vinod Koul commit 6a301188420ae53d8606ef4c5584fc015574e1f9 Author: Siddharth Vadapalli Date: Thu Mar 9 12:05:12 2023 +0530 phy: ti: gmii-sel: Add support for SGMII mode Add support to configure the CPSW MAC's PHY in SGMII mode if the SoC supports it. The extra_modes member of the phy_gmii_sel_soc_data struct corresponding to the SoC is used to determine whether or not the SoC supports SGMII mode. Signed-off-by: Siddharth Vadapalli Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230309063514.398705-2-s-vadapalli@ti.com Signed-off-by: Vinod Koul commit 7a5f349e592c254f3c1ac34665b6c3905576efc2 Author: Dario Binacchi Date: Tue May 16 10:52:19 2023 +0200 ARM: dts: stm32: use RCC macro for CRC node on stm32f746 The patch replaces the number 12 with the appropriate numerical constant already defined in the file stm32f7-rcc.h. Signed-off-by: Dario Binacchi Signed-off-by: Alexandre Torgue commit 1541fbaca0d9c68e46d2593112a578f1c13fd312 Author: Yang Li Date: Fri Apr 28 13:27:58 2023 +0800 phy: freescale: imx8m-pcie: Use devm_platform_ioremap_resource() Convert platform_get_resource(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20230428052758.38636-1-yang.lee@linux.alibaba.com Signed-off-by: Vinod Koul commit fdab47868e3d42a2d996daf848ba6a94f1b56d43 Author: David Yang Date: Tue May 9 14:04:45 2023 +0800 phy: hisilicon: Allow building phy-hisi-inno-usb2 on ARM32 Support for inno-usb2-phy on Hi3798MV100 was added into existing driver, while Hi3798MV100 is a A9 ARM32-only SoC. Signed-off-by: David Yang Link: https://lore.kernel.org/r/20230509060449.1151113-3-mmyangfl@gmail.com Signed-off-by: Vinod Koul commit 3940ffc6549206d79707887c5bf3ecd58769f1ee Author: David Yang Date: Tue May 9 14:04:44 2023 +0800 phy: hisilicon: Add inno-usb2-phy driver for Hi3798MV100 Adopt existing phy-hisi-inno-usb2 driver to Hi3798MV100, with a slightly different TEST register convention. Signed-off-by: David Yang Link: https://lore.kernel.org/r/20230509060449.1151113-2-mmyangfl@gmail.com Signed-off-by: Vinod Koul commit f64df08226038ba472a5f124e28ebc3b75e3b3ae Author: Artur Weber Date: Mon May 1 21:55:20 2023 +0200 phy: Revert "phy: Remove SOC_EXYNOS4212 dep. from PHY_EXYNOS4X12_USB" Support for the Exynos4212 SoC was originally dropped as there were no boards using it. We will be adding a device that uses it, so add it back. This reverts commit fee7e1d50c6e6da1d99035181ba5a5c88f5bb526. Signed-off-by: Artur Weber Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230501195525.6268-9-aweber.kernel@gmail.com Signed-off-by: Vinod Koul commit 6e76ac595855db27bbdaef337173294a6fd6eb2c Author: Josh Triplett Date: Sat Apr 29 01:40:30 2023 +0900 io_uring: Add io_uring_setup flag to pre-register ring fd and never install it With IORING_REGISTER_USE_REGISTERED_RING, an application can register the ring fd and use it via registered index rather than installed fd. This allows using a registered ring for everything *except* the initial mmap. With IORING_SETUP_NO_MMAP, io_uring_setup uses buffers allocated by the user, rather than requiring a subsequent mmap. The combination of the two allows a user to operate *entirely* via a registered ring fd, making it unnecessary to ever install the fd in the first place. So, add a flag IORING_SETUP_REGISTERED_FD_ONLY to make io_uring_setup register the fd and return a registered index, without installing the fd. This allows an application to avoid touching the fd table at all, and allows a library to never even momentarily install a file descriptor. This splits out an io_ring_add_registered_file helper from io_ring_add_registered_fd, for use by io_uring_setup. Signed-off-by: Josh Triplett Link: https://lore.kernel.org/r/bc8f431bada371c183b95a83399628b605e978a3.1682699803.git.josh@joshtriplett.org Signed-off-by: Jens Axboe commit 03d89a2de25bbc5c77e61a0cf77663978c4b6ea7 Author: Jens Axboe Date: Fri Nov 5 17:20:54 2021 -0600 io_uring: support for user allocated memory for rings/sqes Currently io_uring applications must call mmap(2) twice to map the rings themselves, and the sqes array. This works fine, but it does not support using huge pages to back the rings/sqes. Provide a way for the application to pass in pre-allocated memory for the rings/sqes, which can then suitably be allocated from shmfs or via mmap to get huge page support. Particularly for larger rings, this reduces the TLBs needed. If an application wishes to take advantage of that, it must pre-allocate the memory needed for the sq/cq ring, and the sqes. The former must be passed in via the io_uring_params->cq_off.user_data field, while the latter is passed in via the io_uring_params->sq_off.user_data field. Then it must set IORING_SETUP_NO_MMAP in the io_uring_params->flags field, and io_uring will then map the existing memory into the kernel for shared use. The application must not call mmap(2) to map rings as it otherwise would have, that will now fail with -EINVAL if this setup flag was used. The pages used for the rings and sqes must be contigious. The intent here is clearly that huge pages should be used, otherwise the normal setup procedure works fine as-is. The application may use one huge page for both the rings and sqes. Outside of those initialization changes, everything works like it did before. Signed-off-by: Jens Axboe commit 9c189eee73af1825ea9c895fafad469de5f82641 Author: Jens Axboe Date: Fri Nov 5 17:15:46 2021 -0600 io_uring: add ring freeing helper We do rings and sqes separately, move them into a helper that does both the freeing and clearing of the memory. Signed-off-by: Jens Axboe commit e27cef86a0edd4ef7f8b4670f508a03b509cbbb2 Author: Jens Axboe Date: Fri Nov 5 17:13:52 2021 -0600 io_uring: return error pointer from io_mem_alloc() In preparation for having more than one time of ring allocator, make the existing one return valid/error-pointer rather than just NULL. Signed-off-by: Jens Axboe commit 9b1b58cacc65ecee29bd85988c9ff957a84b43f4 Author: Jens Axboe Date: Fri Nov 5 17:11:34 2021 -0600 io_uring: remove sq/cq_off memset We only have two reserved members we're not clearing, do so manually instead. This is in preparation for using one of these members for a new feature. Signed-off-by: Jens Axboe commit c598c335da420715670b1adac846e4f3ebd01e40 Author: Imre Deak Date: Fri May 12 22:55:13 2023 +0300 drm/i915/tc: Reset TypeC PHYs left enabled in DP-alt mode after the sink disconnects If the output on a DP-alt link with its sink disconnected is kept enabled for too long (about 20 sec), then some IOM/TCSS firmware timeout will cause havoc on the PCI bus, at least for other GFX devices on it which will stop powering up. Since user space is not guaranteed to do a disabling modeset in time, switch such disconnected but active links to TBT mode - which is without such shortcomings - with a 2 second delay. If the above condition is detected already during the driver load/system resume sanitization step disable the output instead, as at that point no user space or kernel client depends on a consistent output state yet and because subsequent atomic modeset on such connectors - without the actual sink capabilities available - can fail. An active/disconnected port as above will also block the HPD status of other active/disconnected ports to get updated (stuck in the connected state), until the former port is disabled, its PHY is disconnected and a ~10 ms delay has elapsed. This means the link state for all TypeC ports/CRTCs must be rechecked after a CRTC is disabled due to the above reason. For this disconnect the PHY synchronously after the CRTC/port is disabled and recheck all CRTCs for the above condition whenever such a port is disabled. To account for a race condition during driver loading where the sink is disconnected after the above sanitization step and before the HPD interrupts get enabled, do an explicit check/link reset if needed from the encoder's late_register hook, which is called after the HPD interrupts are enabled already. v2: - Handle an active/disconnected port blocking the HPD state update of another active/disconnected port. - Cancel the delayed work resetting the link also from the encoder enable/suspend/shutdown hooks. - Rebase on the earlier intel_modeset_lock_ctx_retry() addition, fixing here the missed atomic state reset in case of a retry. - Fix handling of an error return from intel_atomic_get_crtc_state(). - Recheck if the port needs to be reset after all the atomic state is locked and async commits are waited on. v3: - Add intel_crtc_needs_link_reset(), instead of open-coding it, keep intel_crtc_has_encoders(). (Ville) - Fix state dumping and use a bitmask to track disabled CRTCs in intel_sanitize_all_crtcs(). (Ville) - Set internal in intel_atomic_state right after allocating it. (Ville) - Recheck all CRTCs (not yet force-disabled) after a CRTC is force-disabled for any reason (not only due to a link state) in intel_sanitize_all_crtcs(). - Reduce delay after CRTC disabling to 20ms, and use the simpler msleep(). - Clarify code comment about HPD behaviour in intel_sanitize_all_crtcs(). - Move all the TC link reset logic to intel_tc.c . - Cancel the link reset work synchronously during system suspend, driver unload and shutdown. v4: - Rebased on previous patch, which allows calling the TC port suspend/cleanup handlers without modeset locks held; remove the display driver suspended assert from the link reset work accordingly. v5: (Ville) - Remove reset work canceling from intel_ddi_pre_pll_enable(). - Track a crtc vs. pipe mask in intel_sanitize_all_crtcs(). - Add reset_link_commit() to clarify the intel_modeset_lock_ctx_retry loop. Cc: Kai-Heng Feng Cc: Ville Syrjälä Tested-by: Kai-Heng Feng Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5860 Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230512195513.2699-2-imre.deak@intel.com commit b61fad5f7e5d859d95a413c3a57f59d007951fa6 Author: Imre Deak Date: Fri May 12 22:55:12 2023 +0300 drm/i915/tc: Call TypeC port flush_work/cleanup without modeset locks held Call the TypeC port flush_work and cleanup handlers without the modeset locks held. These don't require the locks, as the work takes - as it should be able to at any point in time - any locks it needs and by the time cleanup is called and after cleanup returns the encoder is not in use. This is required by the next patch canceling a TypeC port work synchronously during encoder suspend and shutdown, where the work can take modeset locks as well, hence the canceling must be done without holding the locks. I also considered moving the modeset locking down to each encoder suspend()/shutdown() hook instead, however locking the full modeset state for each encoder separately would be odd, and the bigger change - affecting all encoders - is beyond the scope of this patchset. v2: - Add a TODO: comment to remove modeset locks if no encoder depends on this. (Ville) Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230512195513.2699-1-imre.deak@intel.com commit 60ded7cc86f363161e37dc41c548b2ab3e1af5ce Author: Imre Deak Date: Wed May 10 13:31:29 2023 +0300 drm/i915: Factor out a helper for handling atomic modeset locks/state This patch simplifying the handling of modeset locks and atomic state for an atomic commit is based on https://lore.kernel.org/all/20210715184954.7794-2-ville.syrjala@linux.intel.com/ adding the helper to i915. I find this approach preferrable than open-coding the corresponding steps (fixed for me an atomic state reset during a DEADLK retry, which I missed in the open-coded version) and also better than the existing DRM_MODESET_LOCK_ALL_BEGIN/END macros for the reasons described in the above original patchset. This change takes the helper into use only for atomic commits during DDI hotplug handling, as a preparation for a follow-up patch adding a similar commit started from the same spot. Other places doing a driver-internal atomic commit is to be converted by a follow-up patchset. Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-13-imre.deak@intel.com commit 7e4460c34b011ae15a898256ad0682e3f34a94d1 Author: Imre Deak Date: Wed May 10 13:31:28 2023 +0300 drm/i915/dp: Factor out intel_dp_get_active_pipes() Factor out a helper used by a follow up patch to reset an active DP link. No functional changes. Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-12-imre.deak@intel.com commit f45156ff18bae00ee56ed6aa2a937a8e93e56d7f Author: Imre Deak Date: Wed May 10 13:31:27 2023 +0300 drm/i915/dp: Prevent link training fallback on disconnected port Prevent downgrading the link training maximum lane count/rate if the sink is disconnected - and so the link training failure is expected. In such cases modeset failures due to the reduced max link params would be just confusing for user space (instead of which the correct thing it should act on is the sink disconnect signaled by a hotplug event, requiring a disabling modeset). v2: - Check the actual HPD state to handle the forced connector state case. (Vinod) Cc: Ville Syrjälä Cc: Vinod Govindapillai Reviewed-by: Ville Syrjälä (v1) Reviewed-by: Vinod Govindapillai Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-11-imre.deak@intel.com commit 9031c6d4f78a1e801695d0c4d97724455c6e2a61 Author: Imre Deak Date: Wed May 10 13:31:26 2023 +0300 drm/i915/dp: Convert link training error to debug message on disconnected sink If a sink is disconnected it's expected that link training actions will fail on it, so downgrade the error messages about such actions to be a debug message. Such - expected - link training failures are more frequent after a follow up patch, after which an active TypeC link is reset after the sink is disconnected which also involves a link training. v2: - Check the actual HPD state to handle the forced connector state case. (Vinod) Cc: Ville Syrjälä Cc: Vinod Govindapillai Reviewed-by: Ville Syrjälä (v1) Reviewed-by: Vinod Govindapillai Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-10-imre.deak@intel.com commit f48eab29028769bb83e5fc9ff0b0ece56b1ba5b2 Author: Imre Deak Date: Wed May 10 13:31:25 2023 +0300 drm/i915/dp: Add link training debug and error printing helpers Add functions for printing link training debug and error messages, both to prepare for the next patch, which downgrades an error to a debug message if the sink is disconnected and to remove some code duplication. v2: (Ville) - Always print the connector prefix. - Preserve the drm_dbg_kms() debug category. v3: - Keep printing the name of functions calling the helpers. (Jani) Cc: Ville Syrjälä Cc: Jani Nikula Reviewed-by: Ville Syrjälä (v2) Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-9-imre.deak@intel.com commit e826839e18b77edb9be622a505d34e883985df48 Author: Imre Deak Date: Wed May 10 13:31:24 2023 +0300 drm/i915: Add support for disabling any CRTCs during HW readout/sanitization During HW readout/sanitization CRTCs can be disabled only if they don't have an attached encoder (and so the encoder disable hooks don't need to be called). An upcoming patch will need to disable CRTCs also with an attached encoder, so add support for this. For bigjoiner configs the encoder disabling hooks require the slave CRTC states, so add these too to the atomic state. Since the connector atomic state is already up-to-date when the CRTC is disabled the connector state needs to be updated (reset) after the CRTC is disabled, make this so. Follow the proper order of disabling first all bigjoiner slaves, then any port synced CRTC slaves followed by the CRTC originally requested to be disabled. v2: - Fix calculating the bigjoiner_masters mask in a port sync config, (Ville) - Keep _noatomic suffix in intel_crtc_disable_noatomic(). (Ville) - Rebase on full CRTC state reset in this patchset, not requiring resetting the bigjoiner state separately and (instead) resetting the full atomic CRTC and related global state after all linked pipes got disabled. - Disable portsync slaves before a portsync master. - Disable a portsync master if a linked portsync slave is disabled. v3: (Ville) - Use s/u32/u8 for transcoder and pipe masks. - Use is_power_of_2() instead of hweight()==1. Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-8-imre.deak@intel.com commit 26281d3597254546161fb5d1dce80e1111a282fe Author: Imre Deak Date: Wed May 10 13:31:23 2023 +0300 drm/i915: Factor out set_encoder_for_connector() Factor out a function setting the encoder and CRTC in the connector atomic state, required by a follow up patch. No functional changes. Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-7-imre.deak@intel.com commit 3ad41442d7bf5b3af0de927e14ed92b39da68224 Author: Imre Deak Date: Wed May 10 13:31:22 2023 +0300 drm/i915: Separate intel_crtc_disable_noatomic_begin/complete() Split calling the CRTC/encoder disabling hooks and updating the CRTC and DPLL object states from updating the CRTC and atomic state and other global state (BW, CDCLK, DBUF) into separate functions. When disabling a bigjoiner configuration the latter step can be done only after all the linked pipes are disabled, so this change prepares for that. No functional changes. Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-6-imre.deak@intel.com commit db4069fcbdc5c8bc03424934a3395b39b71d9dc6 Author: Imre Deak Date: Wed May 10 13:31:21 2023 +0300 drm/i915: Update connector atomic state before crtc sanitize-disabling During HW state readout/sanitization an up-to-date connector atomic state will be required by a follow-up patch, which can disable CRTCs with an encoder (and calling the correct encoder hooks happens via the connector atomic state encoder pointer). So update the connector state already before the CRTC sanitize/disable step. For now this doesn't make a difference, since intel_modeset_update_connector_atomic_state() will update/enable the atomic state only for connectors that have an enabled encoder/CRTC. Such CRTCs/encoders will not be affected by intel_sanitize_crtc(). v2: Add comment about why the connector state needs to be up-to-date. Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-5-imre.deak@intel.com commit 7ff9a17e372e5152a77ec657949a3c9250720fa4 Author: Imre Deak Date: Wed May 10 13:31:20 2023 +0300 drm/i915: Make the CRTC state consistent during sanitize-disabling Make sure that the CRTC state is reset correctly, as expected after disabling the CRTC. In particular this change will: - Zero all the CSC blob pointers after intel_crtc_free_hw_state() has freed them. - Zero the shared DPLL and port PLL pointers and clear the corresponding CRTC reference flag in the PLL state. - Reset all the transcoder and pipe fields. v2: - Reset fully the CRTC state. (Ville) - Clear pipe active flags in the DPLL state. v3: - Clear only the CRTC reference flag and add a helper for this. (Ville) v4: - Rebased on previous patch, adding intel_unreference_shared_dpll_crtc() separately. (Ville) Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-4-imre.deak@intel.com commit 0694cab1d5a425139d9cda08332f59fb79248ff3 Author: Imre Deak Date: Wed May 10 13:31:19 2023 +0300 drm/i915: Add helpers to reference/unreference a DPLL for a CRTC Add helpers to reference/unreference a shared DPLL tracking the use of it by a given CRTC. This prepares for the next patch, which unreferences a DPLL during CRTC HW-readout/sanitization. Suggested-by: Ville Syrjälä Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-3-imre.deak@intel.com commit 7eeef32719f6af935a1554813e6bc206446339cd Author: Imre Deak Date: Wed May 10 13:31:18 2023 +0300 drm/i915: Fix PIPEDMC disabling for a bigjoiner configuration For a bigjoiner configuration display->crtc_disable() will be called first for the slave CRTCs and then for the master CRTC. However slave CRTCs will be actually disabled only after the master CRTC is disabled (from the encoder disable hooks called with the master CRTC state). Hence the slave PIPEDMCs can be disabled only after the master CRTC is disabled, make this so. intel_encoders_post_pll_disable() must be called only for the master CRTC, as for the other two encoder disable hooks. While at it fix this up as well. This didn't cause a problem, since intel_encoders_post_pll_disable() will call the corresponding hook only for an encoder/connector connected to the given CRTC, however slave CRTCs will have no associated encoder/connector. Fixes: 3af2ff0840be ("drm/i915: Enable a PIPEDMC whenever its corresponding pipe is enabled") Cc: Rodrigo Vivi Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230510103131.1618266-2-imre.deak@intel.com commit e641577eb6e82cbb89dde7cfc44ef2541c42278c Merge: 8b33485128ad9 4f693a8f5617f Author: Paolo Abeni Date: Tue May 16 15:39:09 2023 +0200 Merge branch 'spdx-conversion-for-bonding-8390-and-i825xx-drivers' Bagas Sanjaya says: ==================== SPDX conversion for bonding, 8390, and i825xx drivers This series is SPDX conversion for bonding, 8390, and i825xx driver subsystems. It is splitted from v2 of my SPDX conversion series in response to Didi's GPL full name fixes [1] to make it easily digestible. The conversion in this series is divided by each subsystem and by license type. [1]: https://lore.kernel.org/linux-spdx/20230512100620.36807-1-bagasdotme@gmail.com/ ==================== Link: https://lore.kernel.org/r/20230515060714.621952-1-bagasdotme@gmail.com Signed-off-by: Paolo Abeni commit 4f693a8f5617f23aeedf0d6a91a516901eccf88b Author: Bagas Sanjaya Date: Mon May 15 13:07:15 2023 +0700 net: ethernet: i825xx: sun3_8256: Add SPDX license identifier The boilerplate reads that sun3_8256 driver is an extension to Linux kernel core, hence add SPDX license identifier for GPL 2.0. Cc: Greg Kroah-Hartman Cc: Michael Hipp Cc: Sam Creasey Signed-off-by: Bagas Sanjaya Signed-off-by: Paolo Abeni commit 9ac40d080befb4a0501e42ce31bdaa596f2b0f05 Author: Bagas Sanjaya Date: Mon May 15 13:07:14 2023 +0700 net: ethernet: i825xx: Replace unversioned GPL (GPL 1.0) notice with SPDX identifier Replace unversioned GPL boilerplate notice with corresponding SPDX license identifier, which is GPL 1.0+. Cc: Donald Becker Cc: Richard Hirst Cc: Sam Creasey Signed-off-by: Bagas Sanjaya Signed-off-by: Paolo Abeni commit 9f07af05d0e4255ae9da2dfe240484a73433c5e4 Author: Bagas Sanjaya Date: Mon May 15 13:07:13 2023 +0700 net: ethernet: 8390: Replace GPL 2.0 boilerplate with SPDX identifier The boilerplate refers to COPYING in the top-level directory of kernel tree. Replace it with corresponding SPDX license identifier. Cc: Donald Becker Cc: Peter De Schrijver Cc: Topi Kanerva Cc: Alain Malek Cc: Bruce Abbott Cc: Geert Uytterhoeven Cc: Richard Fontana Acked-by: Greg Ungerer Signed-off-by: Bagas Sanjaya Signed-off-by: Paolo Abeni commit dc3eb2f4ec09e90b77ee8c28f73912b022462e8e Author: Bagas Sanjaya Date: Mon May 15 13:07:12 2023 +0700 net: ethernet: 8390: Convert unversioned GPL notice to SPDX license identifier Replace boilerplate notice for unversioned GPL to SPDX tag for GPL 1.0+. For ne2k-pci.c, only add SPDX tag and keep the boilerplate instead, since the boilerplate notes that it must be preserved. Cc: David A. Hinds Cc: Donald Becker Cc: Alan Cox Cc: Geert Uytterhoeven Cc: Richard Fontana Signed-off-by: Bagas Sanjaya Signed-off-by: Paolo Abeni commit 613a014191f584556a96e070d0767761912ccf61 Author: Bagas Sanjaya Date: Mon May 15 13:07:11 2023 +0700 net: bonding: Add SPDX identifier to remaining files Previous batches of SPDX conversion missed bond_main.c and bonding_priv.h because these files doesn't mention intended GPL version. Add SPDX identifier to these files, assuming GPL 1.0+. Cc: Thomas Davis Cc: Christophe JAILLET Cc: Stephen Hemminger Reviewed-by: Simon Horman Signed-off-by: Bagas Sanjaya Signed-off-by: Paolo Abeni commit 6245ce4ab670166efcdae843c35c14e4c0811aa3 Author: Josh Poimboeuf Date: Tue Apr 18 14:27:54 2023 -0700 objtool: Move noreturn function list to separate file This makes it a little cleaner and easier to maintain. Suggested-by: Peter Zijlstra Reviewed-by: Miroslav Benes Link: https://lore.kernel.org/r/cecacf07a69a244c74474c18b7652627de67a528.1681853186.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit d59fec29b131f30b27343d54bdf1071ee98eda8e Author: Josh Poimboeuf Date: Tue Apr 18 14:27:53 2023 -0700 tools/lib/subcmd: Replace NORETURN usage with __noreturn NORETURN is redundant with __noreturn, just use the latter. Reviewed-by: Miroslav Benes Link: https://lore.kernel.org/r/c7c83d1e6b3d2b0c3e65dd3790c22c772d3b2527.1681853186.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 34245659debd194cbd4148d2ee5176306bdf8899 Author: Josh Poimboeuf Date: Tue Apr 18 14:27:52 2023 -0700 objtool: Remove superfluous global_noreturns entries lbug_with_loc() no longer exists, and resume_play_dead() is static (objtool only checks globals and weaks). Reviewed-by: Miroslav Benes Link: https://lore.kernel.org/r/2725d7f2ccc2361c6903de9ebaa2b5bb304f7ac2.1681853186.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 55eeab2a8a11b71586ef0ad3adf532ca5f97d4be Author: Josh Poimboeuf Date: Tue Apr 18 14:27:51 2023 -0700 objtool: Ignore exc_double_fault() __noreturn warnings This is a hack, but it works for now. Problem is, exc_double_fault() may or may not return, depending on whether CONFIG_X86_ESPFIX64 is set. But objtool has no visibility to the kernel config. "Fix" it by silencing the exc_double_fault() __noreturn warning. This removes the following warning: vmlinux.o: warning: objtool: xenpv_exc_double_fault+0xd: exc_double_fault() is missing a __noreturn annotation Reviewed-by: Miroslav Benes Link: https://lore.kernel.org/r/a45b085071d3a7d049a20f9e78754452336ecbe8.1681853186.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit fedb724c3db5490234ddde0103811c28c2fedae0 Author: Josh Poimboeuf Date: Tue Apr 18 14:27:50 2023 -0700 objtool: Detect missing __noreturn annotations Most "unreachable instruction" warnings these days seem to actually be the result of a missing __noreturn annotation. Add an explicit check for that. Reviewed-by: Miroslav Benes Link: https://lore.kernel.org/r/6e2b93d8c65eaed6c4166a358269dc0ef01f890c.1681853186.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit ced23d2e3762ecfb859ae65d3a351218edff7205 Author: Josh Poimboeuf Date: Tue Apr 18 14:27:49 2023 -0700 objtool: Include backtrace in verbose mode Include backtrace in verbose mode. This makes it easy to gather all the information needed for diagnosing objtool warnings. Reviewed-by: Miroslav Benes Link: https://lore.kernel.org/r/c255224fabcf7e64bac232fec1c77c9fc2d7d7ab.1681853186.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit ca653464dd097fe64e69f1735e9f348b2a0f8037 Author: Josh Poimboeuf Date: Tue Apr 18 14:27:48 2023 -0700 objtool: Add verbose option for disassembling affected functions When a warning is associated with a function, add an option to disassemble that function. This makes it easier for reporters to submit the information needed to diagnose objtool warnings. Reviewed-by: Miroslav Benes Link: https://lore.kernel.org/r/dd0fe13428ede186f09c74059a8001f4adcea5fc.1681853186.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 5e3992fe72748ed3892be876f09d4d990548b7af Author: Josh Poimboeuf Date: Tue Apr 18 14:27:47 2023 -0700 objtool: Limit unreachable warnings to once per function Unreachable instruction warnings are limited to once per object file. That no longer makes sense for vmlinux validation, which might have more unreachable instructions lurking in other places. Change it to once per function. Note this affects some other (much rarer) non-fatal warnings as well. In general I think one-warning-per-function makes sense, as related warnings can accumulate quickly and we want to eventually get back to failing the build with -Werror anyway. Reviewed-by: Miroslav Benes Link: https://lore.kernel.org/r/9d38f881bfc34e031c74e4e90064ccb3e49f599a.1681853186.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit 89da5a69a831f20df6463fd524e1578e12a8f46f Author: Josh Poimboeuf Date: Wed Apr 12 13:31:05 2023 -0700 x86/unwind/orc: Add 'unwind_debug' cmdline option Sometimes the one-line ORC unwinder warnings aren't very helpful. Add a new 'unwind_debug' cmdline option which will dump the full stack contents of the current task when an error condition is encountered. Reviewed-by: Miroslav Benes Link: https://lore.kernel.org/r/6afb9e48a05fd2046bfad47e69b061b43dfd0e0e.1681331449.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf commit dc1d05536f44cee16e46e86316e6718b2c0d8872 Author: ndesaulniers@google.com Date: Mon Apr 17 15:00:06 2023 -0700 start_kernel: Omit prevent_tail_call_optimization() for newer toolchains prevent_tail_call_optimization() was added in commit a9a3ed1eff36 ("x86: Fix early boot crash on gcc-10, third try") to work around stack canaries getting inserted into functions that would initialize the stack canary in the first place. Now that we have no_stack_protector function attribute (gcc-11+, clang-7+) and use it on start_kernel(), remove the call to prevent_tail_call_optimization() such that we may one day remove it outright. Reviewed-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Signed-off-by: Nick Desaulniers Link: https://lore.kernel.org/r/20230412-no_stackp-v2-2-116f9fe4bbe7@google.com Signed-off-by: Josh Poimboeuf commit 514ca14ed5444b911de59ed3381dfd195d99fe4b Author: ndesaulniers@google.com Date: Mon Apr 17 15:00:05 2023 -0700 start_kernel: Add __no_stack_protector function attribute Back during the discussion of commit a9a3ed1eff36 ("x86: Fix early boot crash on gcc-10, third try") we discussed the need for a function attribute to control the omission of stack protectors on a per-function basis; at the time Clang had support for no_stack_protector but GCC did not. This was fixed in gcc-11. Now that the function attribute is available, let's start using it. Callers of boot_init_stack_canary need to use this function attribute unless they're compiled with -fno-stack-protector, otherwise the canary stored in the stack slot of the caller will differ upon the call to boot_init_stack_canary. This will lead to a call to __stack_chk_fail() then panic. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94722 Link: https://lore.kernel.org/all/20200316130414.GC12561@hirez.programming.kicks-ass.net/ Tested-by: Nathan Chancellor Acked-by: Michael Ellerman (powerpc) Acked-by: Miguel Ojeda Acked-by: Peter Zijlstra (Intel) Signed-off-by: Nick Desaulniers Link: https://lore.kernel.org/r/20230412-no_stackp-v2-1-116f9fe4bbe7@google.com Signed-off-by: Josh Poimboeuf Signed-off-by: ndesaulniers@google.com commit 070a10d6fe1b2f4cc5d6c38b478cc059461eabe9 Author: Krzysztof Kozlowski Date: Sat May 13 13:35:10 2023 +0200 pinctrl: qcom: sc8180x: gracefully handle missing IO memory resource If device was probed with incorrect DT or ACPI tables, the IO memory resource would be missing and driver would derefernce NULL pointer in sc8180x_pinctrl_add_tile_resources(). Add simplep check if IO memory resource was provided to silence Smatch warning: drivers/pinctrl/qcom/pinctrl-sc8180x.c:1664 sc8180x_pinctrl_add_tile_resources() error: potentially dereferencing uninitialized 'mres'. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230513113510.177666-1-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 95f0e3a209b0045a56a06987d85981280f523270 Author: Jiapeng Chong Date: Thu Mar 30 10:00:14 2023 +0800 x86/unwind/orc: Use swap() instead of open coding it Swap is a function interface that provides exchange function. To avoid code duplication, we can use swap function. ./arch/x86/kernel/unwind_orc.c:235:16-17: WARNING opportunity for swap(). Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4641 Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20230330020014.40489-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Josh Poimboeuf commit 6a16d1a5ba8c54b997b1cd10342ff3971652554d Author: Rohit Agarwal Date: Mon May 15 12:16:10 2023 +0530 pinctrl: qcom: Refactor generic qcom pinctrl driver Reuse the generic pingroup struct from pinctrl.h in msm_pingroup along with the macro defined. Signed-off-by: Rohit Agarwal Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1684133170-18540-3-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Linus Walleij commit c7a291dbbce9ca43d780d360fe92bfe9c6c39fe1 Author: Rohit Agarwal Date: Mon May 15 12:16:09 2023 +0530 pinctrl: qcom: Remove the msm_function struct Remove the msm_function struct to reuse the generic pinfunction struct. Also, define a generic PINFUNCTION macro that can be used across qcom target specific pinctrl files to avoid code repetition. Signed-off-by: Rohit Agarwal Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1684133170-18540-2-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Linus Walleij commit a8874ada13255bd98c3566fad3b1c23e55e5bfdb Author: Varadarajan Narayanan Date: Tue May 9 17:24:06 2023 +0530 phy: qcom: qmp: Update IPQ9574 USB Phy initialization Sequence Updated USB QMP PHY Init sequence based on HPG for IPQ9574. Reused clock and reset list from existing targets. Reviewed-by: Dmitry Baryshkov Signed-off-by: Praveenkumar I Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/4f15c21f28e2a1332fbdb04d60641cbbf05c6f15.1683630932.git.quic_varada@quicinc.com Signed-off-by: Vinod Koul commit 5eaba7b5de931afb829e47221a218ffcfcc143c1 Author: Varadarajan Narayanan Date: Tue May 9 17:24:05 2023 +0530 phy: qcom-qusb2: add QUSB2 support for IPQ9574 Add the phy init sequence for the Super Speed ports found on IPQ9574. Reviewed-by: Dmitry Baryshkov Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/7c67e9e92227add6544009092adbd400c3cb47db.1683630932.git.quic_varada@quicinc.com Signed-off-by: Vinod Koul commit b225e9124b49e4ee2b0dd88c9c29d64905c273bd Author: Varadarajan Narayanan Date: Tue May 9 17:24:02 2023 +0530 dt-bindings: phy: qcom,qmp-usb: Add IPQ9574 USB3 PHY * Add dt-bindings for USB3 PHY found on Qualcomm IPQ9574 * Making power-domains as optional since IPQ9574 doesn't have GDSCs Signed-off-by: Varadarajan Narayanan Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/064614c5b28f6d813634ad14a59b0bf94ac334b7.1683630932.git.quic_varada@quicinc.com Signed-off-by: Vinod Koul commit fc1ec000b60bdc985e36459c940eedbbdc640057 Author: Varadarajan Narayanan Date: Tue May 9 17:24:01 2023 +0530 dt-bindings: phy: qcom,qusb2: Document IPQ9574 compatible Document the compatible string used for the qusb2 phy in IPQ9574. Acked-by: Krzysztof Kozlowski Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/d55c95a6bfeef3f49fdbcde9bc97157374e81a65.1683630932.git.quic_varada@quicinc.com Signed-off-by: Vinod Koul commit 45fe0dc4ea2efff3eff4e54e31e679224c095c2a Author: Michal Simek Date: Tue May 2 15:12:49 2023 +0200 arm64: xilinx: Use zynqmp prefix for SOM dt overlays U-Boot is using zynqmp- prefix to compose DT name for board detection that's why also generate DT in this format in the kernel. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/49c1b8c992929610ba17b9c6edf5d40d4b28d2ed.1683033163.git.michal.simek@amd.com commit 5be4fbbfbec320dfb08530f0297fa2fe7aa1e836 Author: Michal Simek Date: Tue May 2 15:35:51 2023 +0200 arm64: zynqmp: Add phase tags marking bootph-all as phase tag was added to dt-schema (dtschema/schemas/bootph.yaml) to cover U-Boot challenges with DT. That's why add it also to Linux to be aligned with bootloader requirement. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/48b554aef75d11e6ad2ef7d21f22accb35432112.1683034376.git.michal.simek@amd.com commit 7b91ccd5d2657a526fcb54a082087921f3997c53 Author: Michal Simek Date: Tue May 2 15:35:50 2023 +0200 arm64: zynqmp: Describe bus-width for SD card on KV260 SD card is connected with 4 data lines which should be described properly. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/b4046d2f593047400c190e438fd9d05128c293d9.1683034376.git.michal.simek@amd.com commit 255118de7689211b9d2f1e0da2dc63ef63ea3ff6 Author: Michal Simek Date: Tue May 2 15:35:49 2023 +0200 arm64: zynqmp: Enable AMS on SOM and other zcu10x boards AMS is used for monitoring system. Used for measuring voltages and especially temperatures. Origin interface is IIO but via iio-hwmon it can be moved to hwmon framework too (done for SOM and zcu100). Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/e1e1621ac1cee7f36ef20606bb3795e130de9609.1683034376.git.michal.simek@amd.com commit 6d1a2bea2410ed046b8422952743be03259f7f2f Author: Michal Simek Date: Tue May 2 15:35:47 2023 +0200 arm64: zynqmp: Enable DP driver for SOMs DP DMA is already enabled that's why there is no reason to keep DP disabled. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/15d16b4de933bfae108df6ca368eb2cdf916aa02.1683034376.git.michal.simek@amd.com commit 116de80adad7a4f1eddff7aa13d801b3c3596eab Author: Michal Simek Date: Tue May 2 15:35:46 2023 +0200 arm64: zynqmp: Setup clock for DP and DPDMA Clocks are coming from shared HW design where these frequencies should be aligned with PLL setup. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/807e22371394222f728ff7d6b190a96a12145439.1683034376.git.michal.simek@amd.com commit fc57b6c9298f49073fdb6de0532b76b0f98337e4 Author: Michal Simek Date: Tue May 2 15:35:45 2023 +0200 arm64: zynqmp: Switch to ethernet-phy-id in kv260 Use ethernet-phy-id compatible string to properly describe phy reset on kv260 boards. Previous description wasn't correct because reset was done for mdio bus to operate and it was in this case used for different purpose which was eth phy reset. With ethernet-phy-id phy reset happens only for the phy via phy framework. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/4b139e942c2a808eecbb30226b6ea5303348390a.1683034376.git.michal.simek@amd.com commit 60a990542425b5fc71c879e84ca0848730d7aa3b Author: Piyush Mehta Date: Tue May 2 15:35:44 2023 +0200 arm64: zynqmp: Disable USB3.0 for zc1751-xm016-dc2 The board zynqmp-zc1751-xm016-dc2 support only USB2.0 that's why remove USB3.0 DT configuration. Signed-off-by: Piyush Mehta Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/ad019501a851c5730427af948b636316f10b2e3b.1683034376.git.michal.simek@amd.com commit c506fe31d7220b088abd9312867849bc2ecf3f51 Author: Michal Simek Date: Tue May 2 15:35:43 2023 +0200 arm64: zynqmp: Add pinctrl emmc description to SM-K26 Production SOM has emmc on it and make sense to describe pin description to be able use EMMC if it is not configured via psu_init. (Still some regs are not handled but this is one step in that direction) Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/f61c16e2fd7c91c2be6d6b67c902037580dbd364.1683034376.git.michal.simek@amd.com commit 56bb4ed4da7c38d1cdc2f11f8a66eb50ecac25a6 Author: Michal Simek Date: Tue May 2 15:35:42 2023 +0200 arm64: zynqmp: Add gpio labels for modepin gpio Using label helps with better chip identification. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/12b2fcd94e528c8ca7117f6741aae36b5942b430.1683034376.git.michal.simek@amd.com commit 5ac5794afb3699047a4f58f20627df5ac7ba594c Author: Amit Kumar Mahapatra Date: Tue May 2 15:35:40 2023 +0200 arm64: zynqmp: Add mtd partition for secure OS storage area Update MTD partitions of Kria device trees to allocate 128KB of QSPI memory for secure OS. Increased "SHA256" partition size & changed starting address of "User" partition to accommodate the new partition "Secure OS Storage" Signed-off-by: Amit Kumar Mahapatra Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/20dd23821118999c6fec2bad52ea446d1a66fefb.1683034376.git.michal.simek@amd.com commit 637902f7c407268391434c2bd3455d35d3a74c84 Author: Michal Simek Date: Tue May 2 15:35:39 2023 +0200 arm64: zynqmp: Use assigned-clock-rates for setting up SD clock in SOM With limited low level configuration done via psu-init only IPs connected on SOM are initialized and configured. All IPs connected to carrier card are not initialized. There is a need to do proper reset, pin configuration and also clock setting. The patch targets the last part which is setting up proper clock for EMMC on production SOMs and SD on kv260-revB. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/cf5a4e412e1674500a71a0b1eed7fa8393f37ae9.1683034376.git.michal.simek@amd.com commit 4a7f7eadd7f740c69cdc0a041e0e589d25ddfbbe Author: Srinivas Neeli Date: Tue May 2 15:35:38 2023 +0200 arm64: zynqmp: Add linux,code for gpio button BTN_MISC looks like the most reasonable option for this button. Button is used by firmware to indicate (after reset, power up) that user wants to do firmware upgrade via firmware update utility. For bootloader or OS is this just user button which is worth to have it mapped. Also button can be used as a wakeup source and pressing it for more time can generate more chars that's why also adding wakeup-source and autorepeat properties. Signed-off-by: Srinivas Neeli Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/4e20661f43b1fb8432fa5fcda5c1cb50d0a27475.1683034376.git.michal.simek@amd.com commit e05d2f969cb558da5c74c1e5c6aaf506806f4563 Author: Michal Simek Date: Tue May 2 15:35:37 2023 +0200 arm64: zynqmp: Add dmas, dp, rtc, watchdogs and opp nodes for SOM There are couple of IPs which are enabled in origin HW design which are missing in SOM dt. Add them to match default setup. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/5d3777fdf91d114effe1921255a7ad71ef30d277.1683034376.git.michal.simek@amd.com commit 9660efc2af37f3c12dc6e6a5511ad99e0addc297 Author: Marek Vasut Date: Fri May 5 23:37:29 2023 +0200 ARM: dts: stm32: Move ethernet MAC EEPROM from SoM to carrier boards The ethernet MAC EEPROM is not populated on the SoM itself, it has to be populated on each carrier board. Move the EEPROM into the correct place in DTs, i.e. the carrier board DTs. Add label to the EEPROM too. Fixes: 7e76f82acd9e1 ("ARM: dts: stm32: Split Avenger96 into DHCOR SoM and Avenger96 board") Signed-off-by: Marek Vasut Signed-off-by: Alexandre Torgue commit e0040abb8d5bb2215f8ee08e0e2d05052a004288 Author: Marek Vasut Date: Fri Apr 7 23:01:52 2023 +0200 ARM: dts: stm32: Replace deprecated st,hw-flow-ctrl with uart-has-rtscts Replace deprecated st,hw-flow-ctrl with uart-has-rtscts . No functional change. Signed-off-by: Marek Vasut Signed-off-by: Alexandre Torgue commit a5ae12c87df6b77d4a676c5fbcd23b93f155321e Author: Damien Le Moal Date: Tue May 16 20:06:15 2023 +0900 ata: pata_parport: Fix on26 module code indentation and style Fix the header, indentation and coding style in the on26 pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit 012f2059e3c073090fa7dd57f582f6ca77583aaa Author: Damien Le Moal Date: Tue May 16 19:06:19 2023 +0900 ata: pata_parport: Fix on20 module code indentation and style Fix the header, indentation and coding style in the on20 pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit ece68db971f27eddb71311bab09440fdece0c803 Author: Damien Le Moal Date: Tue May 16 18:54:08 2023 +0900 ata: pata_parport: Fix ktti module code indentation and style Fix the header, indentation and coding style in the ktti pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit 65db10ca726e197728c5fcbf9a617cb365e0dc53 Author: Damien Le Moal Date: Tue May 16 18:38:47 2023 +0900 ata: pata_parport: Fix kbic module code indentation and style Fix the header, indentation and coding style in the kbic pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit bd91cbfa3c319b04ee429c85c95c5d945f13d0cf Author: Damien Le Moal Date: Tue May 16 18:16:46 2023 +0900 ata: pata_parport: Fix friq module code indentation and style Fix the header, indentation and coding style in the friq pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit 6b427116ea02dcf1d45edc7e7fde5b7e5925d4cc Author: Damien Le Moal Date: Tue May 16 17:08:26 2023 +0900 ata: pata_parport: Fix fit3 module code indentation and style Fix the header, indentation and coding style in the fit3 pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit 0d5e81729f4f3ac85e0d7ee888a1281d987f97cf Author: Damien Le Moal Date: Tue May 16 16:58:21 2023 +0900 ata: pata_parport: Fix fit2 module code indentation and style Fix the header, indentation and coding style in the fit2 pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit 8be319717be2f121893a467de80ba05ad2a64067 Author: Damien Le Moal Date: Mon May 15 21:27:29 2023 +0900 ata: pata_parport: Fix epia module code indentation and style Fix the header, indentation and coding style in the epia pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit 3cb41685f7c7c8f2ac53eb925a468868b6fe81ec Author: Damien Le Moal Date: Mon May 15 20:36:12 2023 +0900 ata: pata_parport: Fix epat module code indentation and style Fix the header, indentation and coding style in the epat pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit d6332c12c2265b88ac455e65464f6c70b2d9e618 Author: Damien Le Moal Date: Mon May 15 20:17:25 2023 +0900 ata: pata_parport: Fix dstr module code indentation and style Fix the header, indentation and coding style in the dstr pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit 630b64bc870e27e049e15adabbbe13e5e74a00c6 Author: Damien Le Moal Date: Mon May 15 20:00:59 2023 +0900 ata: pata_parport: Fix comm module code indentation and style Fix the header, indentation and coding style in the comm pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit ec52d5241e844a1c0a65313708446907d32d70c8 Author: Damien Le Moal Date: Mon May 15 19:50:09 2023 +0900 ata: pata_parport: Fix bpck6 module code indentation and style Fix the header, indentation and coding style in the bpck6 pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit ab0695eecc47edd9cf97fc18aecfdb45e880a0dd Author: Damien Le Moal Date: Mon May 15 16:32:51 2023 +0900 ata: pata_parport: Fix aten module code indentation and style Fix the header, indentation and coding style in the aten pata parport protocol module to suppress warnings from smatch and other static code analyzers. No functional changes. Signed-off-by: Damien Le Moal commit f19c694f744f5efd68d0b9ed9e0728a093d43393 Author: Damien Le Moal Date: Mon May 8 22:46:39 2023 +0900 ata: pata_parport: Fix frpw module code indentation and style Fix the header, indentation and coding style in the frpw pata parport protocol module to suppress smatch warnings such as: drivers/ata/pata_parport/frpw.c:234 frpw_test_proto() warn: inconsistent indenting No functional changes. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202305061212.EPgEMLXl-lkp@intel.com/ Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 22e395d001f846cc8b566d6a00ff8551daeaf38f Author: Damien Le Moal Date: Mon May 8 09:34:11 2023 +0900 ata: pata_parport: Fix bpck module code indentation and style Fix the header, indentation and coding style in the bpck pata parport protocol module to suppress smatch warnings such as: drivers/ata/pata_parport/bpck.c:66 bpck_read_regr() warn: inconsistent indenting No functional changes. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202305021913.nCMzH5Zj-lkp@intel.com/ Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit e2ff42b4f1caf37ce8fca06f69e4970d6fa5ad69 Author: Chirag Parekh Date: Tue May 2 15:52:41 2023 +0200 ARM: zynq: dts: Add SCL & SDA GPIO entries for recovery Wire i2c pinmuxing gpio recovery for zc702. Signed-off-by: Chirag Parekh Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/5eb73d1150648e782795e35c30fccb983b3e0db7.1683035557.git.michal.simek@amd.com commit 12e2e17de2cd555f795d9f7cff049ecbc2b17cf8 Author: Yahu Gao Date: Mon May 15 10:36:58 2023 +0800 ata: libata-core: Simplify if condition in ata_dev_revalidate() Simplify the condition used in ata_dev_revalidate() to not issue identify commands to port multiplier devices. Signed-off-by: Yahu Gao Signed-off-by: Damien Le Moal commit 028d125a30ff5646b3ad22445080d8f2946d67d7 Author: Michal Simek Date: Tue May 2 15:35:32 2023 +0200 arm64: zynqmp: Fix usb reset over bootmode pins on zcu100 The commit 53ba1b2bdaf7 ("arm64: dts: zynqmp: Add mode-pin GPIO controller DT node") added usb phy reset over bootmode pins by default on usb0 only. zcu100 is using usb0 as peripheral and usb1 as host. Unfortunately reset line is shared for both usb ulpi phys but usb_rst_b is connected to usb5744 hub which is used only in host mode. Especially this chip requires reset to operate properly that's why better assign gpio reset to usb1 instead of usb0. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/d117473da3bab39a82fe900cecd8ca78df9adeda.1683034376.git.michal.simek@amd.com commit 3effc177f12d5062bf39496aa6db23d29924678b Author: Michal Simek Date: Tue May 2 15:35:34 2023 +0200 arm64: zynqmp: Sync node name address with reg (mailbox) Address in node name should match with the first reg property in DT. Reviewed-by: Laurent Pinchart Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/5d8e80383912b8ff75409764efb75f3b85917087.1683034376.git.michal.simek@amd.com commit 6ae507f09e29ae2f492b9c4cec97aad1f84aa8ab Author: Sai Krishna Potthuri Date: Tue May 2 15:35:36 2023 +0200 arm64: zynqmp: Add resets property to sdhci nodes Add "resets" property to sdhci nodes. Resets property is used to reset the SD host controller when dynamic configuration support is enabled. Signed-off-by: Sai Krishna Potthuri Reviewed-by: Laurent Pinchart Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/8f8592d6454c024c8f8b92e56c9009c65ad1d54a.1683034376.git.michal.simek@amd.com commit 9a18fb598162f4626497ace3090e1a2cb40aa7e4 Author: Michal Simek Date: Tue May 2 15:35:48 2023 +0200 arm64: zynqmp: Rename ams_ps/pl node names Fix child node names to be aligned with commit 39dd2d1e251d ("dt-bindings: iio: adc: Add Xilinx AMS binding documentation") which requires names as ams-ps@ and ams-pl@. Reviewed-by: Laurent Pinchart Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/373136eccf8d22cdfb499adbc8d5f5510d6c1035.1683034376.git.michal.simek@amd.com commit 04127a3d30bd7ef7956b894724ca031728154e54 Author: Patrick Delaunay Date: Tue May 16 12:31:11 2023 +0200 ARM: dts: stm32: remove extra space in stm32mp15xx-dkx.dtsi Remove unnecessary space in device tree stm32mp15xx-dkx.dtsi. Signed-off-by: Patrick Delaunay Signed-off-by: Alexandre Torgue commit e40879b6d7d858b03813cd53c17dfef9c297f525 Author: Yazen Ghannam Date: Fri Jan 8 04:00:35 2021 +0000 x86/MCE: Check a hw error's address to determine proper recovery action Make sure that machine check errors with a usable address are properly marked as poison. This is needed for errors that occur on memory which have MCG_STATUS[RIPV] clear - i.e., the interrupted process cannot be restarted reliably. One example is data poison consumption through the instruction fetch units on AMD Zen-based systems. The MF_MUST_KILL flag is passed to memory_failure() when MCG_STATUS[RIPV] is not set. So the associated process will still be killed. What this does, practically, is get rid of one more check to kill_current_task with the eventual goal to remove it completely. Also, make the handling identical to what is done on the notifier path (uc_decode_notifier() does that address usability check too). The scenario described above occurs when hardware can precisely identify the address of poisoned memory, but execution cannot reliably continue for the interrupted hardware thread. [ bp: Massage commit message. ] Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Tony Luck Link: https://lore.kernel.org/r/20230322005131.174499-1-tony.luck@intel.com commit 1582e1d1b244e195c869957e08f06c53aa78c688 Author: Sumit Gupta Date: Thu May 11 23:02:11 2023 +0530 arm64: tegra: Add CPU OPP tables and interconnects property Add OPP table and interconnects property to scale DDR frequency with CPU frequency for better performance. Each operating point entry of the OPP table has CPU freq to per MC channel bandwidth mapping. One table is added for each cluster even though the table data is same because the bandwidth request is per cluster. This is done because OPP framework creates a single icc path and hence single bandwidth request if the table is marked as 'opp-shared' and shared among all clusters. For us, the OPP table data is same but the MC Client ID argument to interconnects property is different for each cluster. So, having per cluster table makes different icc path for each cluster and helps to make per cluster BW requests. Signed-off-by: Sumit Gupta Signed-off-by: Thierry Reding commit c95711d7dbc41cc0eb8927313f8482b2b07c8280 Author: Shubhi Garg Date: Mon May 8 10:27:33 2023 +0000 arm64: tegra: Add support for IGX Orin Add support for the NVIDIA IGX Orin development kit having P3701 module with P3740 carrier board. Signed-off-by: Shubhi Garg Signed-off-by: Thierry Reding commit 49cbf04cda26082b9c03bbf2d7e1d81ff70a92c9 Merge: ac9a78681b921 b0dae3df0546a Author: Thierry Reding Date: Tue May 16 12:13:07 2023 +0200 Merge branch 'for-6.5/dt-bindings' into for-6.5/arm64/dt commit 9365bf006f53d04b69d560ef7e2bf4be4c4d693a Author: Sumit Gupta Date: Thu May 11 23:02:10 2023 +0530 PCI: tegra194: Add interconnect support in Tegra234 Add support to request DRAM bandwidth (BW) with Memory Interconnect in Tegra234 SoC. The DRAM BW required for different modes depends on the link speed (Gen-1/2/3/4) and width/lanes (x1/x2/x4/x8). Currently, the DRAM frequency is always set to the maximum available but that results in the highest power consumption. The Memory Interconnect is a software feature which uses Interconnect framework (ICC). It adds the capability for Memory Controller (MC) clients to request bandwidth and therefore scale DRAM frequency dynamically depending on the required link speed so that the DRAM energy consumption can be optimized. Suggested-by: Manikanta Maddireddy Signed-off-by: Sumit Gupta Acked-by: Lorenzo Pieralisi Signed-off-by: Thierry Reding commit 205b3d02d57ce6dce96f6d2b9c230f56a9bf9817 Author: Sumit Gupta Date: Thu May 11 23:02:09 2023 +0530 PCI: tegra194: Fix possible array out of bounds access Add check to fix the possible array out of bounds violation by making speed equal to GEN1_CORE_CLK_FREQ when its value is more than the size of "pcie_gen_freq" array. This array has size of four but possible speed (CLS) values are from "0 to 0xF". So, "speed - 1" values are "-1 to 0xE". Suggested-by: Bjorn Helgaas Signed-off-by: Sumit Gupta Link: https://lore.kernel.org/lkml/72b9168b-d4d6-4312-32ea-69358df2f2d0@nvidia.com/ Acked-by: Lorenzo Pieralisi Signed-off-by: Thierry Reding commit 9422644d2ca7c3530c5b4b55d36bca79646ee138 Merge: ac9a78681b921 e852af72a7f21 Author: Thierry Reding Date: Tue May 16 12:11:27 2023 +0200 Merge branch 'for-6.5/memory' into for-6.5/pci commit e852af72a7f21f4d25994365af86a92438d68014 Author: Sumit Gupta Date: Thu May 11 23:02:08 2023 +0530 memory: tegra: Make CPU cluster BW request a multiple of MC channels Make CPU cluster's bandwidth (BW) request a multiple of MC channels. CPU OPP tables have BW info per MC channel. But, the actual BW depends on the number of MC channels which can change as per the boot config. Get the number of MC channels which are actually enabled in current boot configuration and multiply the BW request from a CPU cluster with the number of enabled MC channels. This is not required to be done for other MC clients. Signed-off-by: Sumit Gupta Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 80b19e09c8fb04a6397278b1c16403042629614f Author: Sumit Gupta Date: Thu May 11 23:02:06 2023 +0530 memory: tegra: Add software memory clients in Tegra234 Add dummy memory controller clients to represent CPU clusters. They will be used by the CPUFREQ driver to scale DRAM FREQ with the CPU FREQ. Signed-off-by: Sumit Gupta Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit aecc83f11dd8712f9b0bcdb4cf1eb0f30f12b226 Author: Sumit Gupta Date: Thu May 11 23:02:05 2023 +0530 memory: tegra: Add memory clients for Tegra234 Add few isochronous (ISO) and non-ISO memory clients. ISO clients have guaranteed bandwidth requirement. PCIe clients added to the memory client table represent each controller in Tegra234. Signed-off-by: Sumit Gupta Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 9a38cb27668e275ed912e67388cf11f454a24cc6 Author: Sumit Gupta Date: Thu May 11 23:02:04 2023 +0530 memory: tegra: Add interconnect support for DRAM scaling in Tegra234 Add Interconnect framework support to dynamically set the DRAM bandwidth from different clients. Both the MC and EMC drivers are added as ICC providers. The path for any request is: MC-Client[1-n] -> MC -> EMC -> EMEM/DRAM MC client's request for bandwidth will go to the MC driver which passes the client request info like BPMP Client ID, Client type and the Bandwidth to the BPMP-FW. The final DRAM freq to achieve the requested bandwidth is set by the BPMP-FW based on the passed parameters. Signed-off-by: Sumit Gupta Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit f382b1fe71ca487b686fa9deefcc0714f50e6f6c Merge: ac9a78681b921 b0dae3df0546a Author: Thierry Reding Date: Tue May 16 12:10:47 2023 +0200 Merge branch 'for-6.5/dt-bindings' into for-6.5/memory commit b0dae3df0546a5968ef8ea5b396d3de9b3a2295a Author: Sumit Gupta Date: Thu May 11 23:02:07 2023 +0530 dt-bindings: tegra: Add ICC IDs for dummy memory clients Add ICC IDs for dummy software clients representing CCPLEX clusters. Signed-off-by: Sumit Gupta Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 3db59e1ca693455d0710dc217455fe81d0d32dce Author: Patrick Delaunay Date: Fri Apr 7 20:31:57 2023 +0200 ARM: dts: stm32: add part number for STM32MP15x The STM32MP15x Device Part Number is located in the first 8 bits of OTP4, this patch add its description as the NVMEM cell. Signed-off-by: Patrick Delaunay Signed-off-by: Alexandre Torgue commit 6e335cd789bee7a7111c4fe6d46b1d63cde81511 Author: Ritesh Harjani (IBM) Date: Fri Apr 21 15:16:17 2023 +0530 ext2: Add direct-io trace points This patch adds the trace point to ext2 direct-io apis in fs/ext2/file.c Here is how the output looks like a.out-467865 [006] 6758.170968: ext2_dio_write_begin: dev 7:12 ino 0xe isize 0x1000 pos 0x0 len 4096 flags DIRECT|WRITE aio 1 ret 0 a.out-467865 [006] 6758.171061: ext2_dio_write_end: dev 7:12 ino 0xe isize 0x1000 pos 0x0 len 0 flags DIRECT|WRITE aio 1 ret -529 kworker/3:153-444162 [003] 6758.171252: ext2_dio_write_endio: dev 7:12 ino 0xe isize 0x1000 pos 0x0 len 4096 flags DIRECT|WRITE aio 1 ret 0 a.out-468222 [001] 6761.628924: ext2_dio_read_begin: dev 7:12 ino 0xe isize 0x1000 pos 0x0 len 4096 flags DIRECT aio 1 ret 0 a.out-468222 [001] 6761.629063: ext2_dio_read_end: dev 7:12 ino 0xe isize 0x1000 pos 0x0 len 0 flags DIRECT aio 1 ret -529 a.out-468428 [005] 6763.937454: ext2_dio_write_begin: dev 7:12 ino 0xe isize 0x1000 pos 0x0 len 4096 flags DIRECT aio 0 ret 0 a.out-468428 [005] 6763.937829: ext2_dio_write_endio: dev 7:12 ino 0xe isize 0x1000 pos 0x0 len 4096 flags DIRECT aio 0 ret 0 a.out-468428 [005] 6763.937847: ext2_dio_write_end: dev 7:12 ino 0xe isize 0x1000 pos 0x1000 len 0 flags DIRECT aio 0 ret 4096 a.out-468609 [000] 6765.702878: ext2_dio_read_begin: dev 7:12 ino 0xe isize 0x1000 pos 0x0 len 4096 flags DIRECT aio 0 ret 0 a.out-468609 [000] 6765.703243: ext2_dio_read_end: dev 7:12 ino 0xe isize 0x1000 pos 0x1000 len 0 flags DIRECT aio 0 ret 4096 Reported-and-tested-by: Disha Goel [Need to add CFLAGS_trace for fixing unable to find trace file problem] Signed-off-by: Ritesh Harjani (IBM) Signed-off-by: Jan Kara Message-Id: commit fb5de4358e1aa4753dce73c4dc1aca73ff39cedd Author: Ritesh Harjani (IBM) Date: Fri Apr 21 15:16:15 2023 +0530 ext2: Move direct-io to use iomap This patch converts ext2 direct-io path to iomap interface. - This also takes care of DIO_SKIP_HOLES part in which we return -ENOTBLK from ext2_iomap_begin(), in case if the write is done on a hole. - This fallbacks to buffered-io in case of DIO_SKIP_HOLES or in case of a partial write or if any error is detected in ext2_iomap_end(). We try to return -ENOTBLK in such cases. - For any unaligned or extending DIO writes, we pass IOMAP_DIO_FORCE_WAIT flag to ensure synchronous writes. - For extending writes we set IOMAP_F_DIRTY in ext2_iomap_begin because otherwise with dsync writes on devices that support FUA, generic_write_sync won't be called and we might miss inode metadata updates. - Since ext2 already now uses _nolock vartiant of sync write. Hence there is no inode lock problem with iomap in this patch. - ext2_iomap_ops are now being shared by DIO, DAX & fiemap path Tested-by: Disha Goel Reviewed-by: Christoph Hellwig Signed-off-by: Ritesh Harjani (IBM) Signed-off-by: Jan Kara Message-Id: <610b672a52f2a7ff6dc550fd14d0f995806232a5.1682069716.git.ritesh.list@gmail.com> commit d05307042500e3f2c06fc2f9e76e8db31d61c7c0 Author: Ritesh Harjani (IBM) Date: Fri Apr 21 15:16:14 2023 +0530 ext2: Use generic_buffers_fsync() implementation Next patch converts ext2 to use iomap interface for DIO. iomap layer can call generic_write_sync() -> ext2_fsync() from iomap_dio_complete while still holding the inode_lock(). Now writeback from other paths doesn't need inode_lock(). It seems there is also no need of an inode_lock() for sync_mapping_buffers(). It uses it's own mapping->private_lock for it's buffer list handling. Hence this patch is in preparation to move ext2 to iomap. This uses generic_buffers_fsync() which does not take any inode_lock() in ext2_fsync(). Tested-by: Disha Goel Signed-off-by: Ritesh Harjani (IBM) Signed-off-by: Jan Kara Message-Id: <76d206a464574ff91db25bc9e43479b51ca7e307.1682069716.git.ritesh.list@gmail.com> commit 5b5b4ff8f92daec4475318c0ec4cb4ed43de9eb6 Author: Ritesh Harjani (IBM) Date: Fri Apr 21 15:16:13 2023 +0530 ext4: Use generic_buffers_fsync_noflush() implementation ext4 when got converted to iomap for dio, it copied __generic_file_fsync implementation to avoid taking inode_lock in order to avoid any deadlock (since iomap takes an inode_lock while calling generic_write_sync()). The previous patch already added generic_buffers_fsync*() which does not take any inode_lock(). Hence kill the redundant code and use generic_buffers_fsync_noflush() function instead. Tested-by: Disha Goel Signed-off-by: Ritesh Harjani (IBM) Signed-off-by: Jan Kara Message-Id: commit 31b2ebc0929e964f4edfbfa7129d43f7e3c17165 Author: Ritesh Harjani (IBM) Date: Fri Apr 21 15:16:12 2023 +0530 fs/buffer.c: Add generic_buffers_fsync*() implementation Some of the higher layers like iomap takes inode_lock() when calling generic_write_sync(). Also writeback already happens from other paths without inode lock, so it's difficult to say that we really need sync_mapping_buffers() to take any inode locking here. Having said that, let's add generic_buffers_fsync/_noflush() implementation in buffer.c with no inode_lock/unlock() for now so that filesystems like ext2 and ext4's nojournal mode can use it. Ext4 when got converted to iomap for direct-io already copied it's own variant of __generic_file_fsync() without lock. This patch adds generic_buffers_fsync() & generic_buffers_fsync_noflush() implementations for use in filesystems like ext2 & ext4 respectively. Later we can review other filesystems as well to see if we can make generic_buffers_fsync/_noflush() which does not take any inode_lock() as the default path. Tested-by: Disha Goel Reviewed-by: Christoph Hellwig Signed-off-by: Ritesh Harjani (IBM) Signed-off-by: Jan Kara Message-Id: commit fcced95b6ba2a507a83b8b3e0358a8ac16b13e35 Author: Ritesh Harjani (IBM) Date: Fri Apr 21 15:16:11 2023 +0530 ext2/dax: Fix ext2_setsize when len is page aligned PAGE_ALIGN(x) macro gives the next highest value which is multiple of pagesize. But if x is already page aligned then it simply returns x. So, if x passed is 0 in dax_zero_range() function, that means the length gets passed as 0 to ->iomap_begin(). In ext2 it then calls ext2_get_blocks -> max_blocks as 0 and hits bug_on here in ext2_get_blocks(). BUG_ON(maxblocks == 0); Instead we should be calling dax_truncate_page() here which takes care of it. i.e. it only calls dax_zero_range if the offset is not page/block aligned. This can be easily triggered with following on fsdax mounted pmem device. dd if=/dev/zero of=file count=1 bs=512 truncate -s 0 file [79.525838] EXT2-fs (pmem0): DAX enabled. Warning: EXPERIMENTAL, use at your own risk [79.529376] ext2 filesystem being mounted at /mnt1/test supports timestamps until 2038 (0x7fffffff) [93.793207] ------------[ cut here ]------------ [93.795102] kernel BUG at fs/ext2/inode.c:637! [93.796904] invalid opcode: 0000 [#1] PREEMPT SMP PTI [93.798659] CPU: 0 PID: 1192 Comm: truncate Not tainted 6.3.0-rc2-xfstests-00056-g131086faa369 #139 [93.806459] RIP: 0010:ext2_get_blocks.constprop.0+0x524/0x610 <...> [93.835298] Call Trace: [93.836253] [93.837103] ? lock_acquire+0xf8/0x110 [93.838479] ? d_lookup+0x69/0xd0 [93.839779] ext2_iomap_begin+0xa7/0x1c0 [93.841154] iomap_iter+0xc7/0x150 [93.842425] dax_zero_range+0x6e/0xa0 [93.843813] ext2_setsize+0x176/0x1b0 [93.845164] ext2_setattr+0x151/0x200 [93.846467] notify_change+0x341/0x4e0 [93.847805] ? lock_acquire+0xf8/0x110 [93.849143] ? do_truncate+0x74/0xe0 [93.850452] ? do_truncate+0x84/0xe0 [93.851739] do_truncate+0x84/0xe0 [93.852974] do_sys_ftruncate+0x2b4/0x2f0 [93.854404] do_syscall_64+0x3f/0x90 [93.855789] entry_SYSCALL_64_after_hwframe+0x72/0xdc CC: stable@vger.kernel.org Fixes: 2aa3048e03d3 ("iomap: switch iomap_zero_range to use iomap_iter") Reviewed-by: Darrick J. Wong Signed-off-by: Ritesh Harjani (IBM) Signed-off-by: Jan Kara Message-Id: <046a58317f29d9603d1068b2bbae47c2332c17ae.1682069716.git.ritesh.list@gmail.com> commit bcdbd3b7888e1db89b7b2f7c78237c9ed5c2ebb1 Author: Oswald Buddenhagen Date: Sun May 14 19:03:23 2023 +0200 ALSA: emu10k1: enable bit-exact playback, part 2: voice attenuation The voice volume is a raw fractional multiplier that can't actually represent 1.0. To still enable real pass-through, we now set the volume to 0.5 (which results in no loss of precision, as the FX bus provides fractional values) and scale up the samples in DSP code. To maintain backwards compatibility with existing configuration files, we rescale the values in the mixer controls. The range is extended upwards from 0xffff to 0x1fffd, which actually introduces the possibility of specifying an amplification. There is still a minor incompatibility with user space, namely if someone loaded custom DSP code. They'll just get half the volume, so this doesn't seem like a big deal. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230514170323.3408834-8-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit d94436465152465555c8e5efbe611db40c9749f7 Author: Stefan Kristiansson Date: Thu May 11 16:20:48 2023 +0300 soc/tegra: fuse: Add support for Tegra264 Add support for Tegra264 to the fuse handling code. Signed-off-by: Stefan Kristiansson Signed-off-by: Peter De Schrijver Signed-off-by: Thierry Reding commit f5a08ed51ed780a312fa07daaf1edb92b78e06f8 Author: Krzysztof Kozlowski Date: Thu May 11 19:56:27 2023 +0200 platform/x86: toshiba: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230511175627.282246-4-krzysztof.kozlowski@linaro.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit ddd4e9d78057383704a84cbe462bb63598c9baef Author: Krzysztof Kozlowski Date: Thu May 11 19:56:26 2023 +0200 platform/x86: system76: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230511175627.282246-3-krzysztof.kozlowski@linaro.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 1180bdfdeca15d178af43fc60ab85e34277afff1 Author: Krzysztof Kozlowski Date: Thu May 11 19:56:25 2023 +0200 platform/x86: hp: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230511175627.282246-2-krzysztof.kozlowski@linaro.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit a1c3f6976ba32a8463edb4ae422178ca8037531f Author: Krzysztof Kozlowski Date: Thu May 11 19:56:24 2023 +0200 platform/x86: gigabyte: constify pointers to hwmon_channel_info Statically allocated array of pointers to hwmon_channel_info can be made const for safety. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230511175627.282246-1-krzysztof.kozlowski@linaro.org Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit e9d1b2d0f7d02f75127b3bc243c0f69f8bd05f04 Author: Liming Sun Date: Thu May 11 10:49:24 2023 -0400 mlxbf-bootctl: Add sysfs file for BlueField boot log This commit adds sysfs interface to be used to write into the boot log which is 1KB HW buffer on BlueField SoC. The same log buffer is also used by firmware code like ATF/UEFI, and can be displayed by userspace tools or from external host via USB/PCIe. Signed-off-by: Liming Sun Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20230511144924.171585-1-limings@nvidia.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 506ed33d0767edbada4c8fc7c268b1730c14791e Author: Shyam Sundar S K Date: Tue May 16 13:15:31 2023 +0530 platform/x86/amd/pmf: Fix compiler warnings in static slider This patch fixes warnings with -Wmissing-prototypes: warning: no previous prototype for 'source_as_str' [-Wmissing-prototypes] warning: no previous prototype for 'slider_as_str' [-Wmissing-prototypes] Fixes: a82ebb3d800d ("platform/x86/amd/pmf: Add PMF acpi debug support") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305160220.REQc5T2y-lkp@intel.com/ Suggested-by: Patil Rajesh Reddy Signed-off-by: Shyam Sundar S K Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230516074531.2885235-1-Shyam-sundar.S-k@amd.com Signed-off-by: Hans de Goede commit 81d6b37b69b8b5d1a4c81d2e208b41888d4283df Author: Francesco Dolcini Date: Mon May 15 20:44:08 2023 +0200 drm/bridge: tc358768: remove unneeded semicolon Remove unneeded stray semicolon. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202305152341.oiSjRpv6-lkp@intel.com/ Signed-off-by: Francesco Dolcini Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230515184408.9421-1-francesco@dolcini.it commit 728cb3f061e2b3a002fd76d91c2449b1497b6640 Author: Anup Sharma Date: Sat May 13 15:42:17 2023 +0530 gpu: drm: bridge: No need to set device_driver owner There is no need to exclusively set the .owner member of the struct device_driver when defining the platform_driver struct. The Linux core takes care of setting the .owner member as part of the call to module_platform_driver() helper function. Issue identified using the platform_no_drv_owner.cocci Coccinelle semantic patch as: drivers/gpu/drm/bridge/samsung-dsim.c:1957:6-11: No need to set .owner here. The core will do it. No functional changes are intended. Signed-off-by: Anup Sharma Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/ZF9igb/nvL6GRBsq@yoga commit adbcfcc92b5aaffdee4c5e62c077919014c483d9 Author: Marek Vasut Date: Mon May 15 18:20:33 2023 +0200 dt-bindings: display: bridge: tc358867: Document TC358867/TC9595 compatible The TC358867/TC9595 devices are compatible with the predecessor TC358767. Document compatible strings for the new devices, so they can be discerned in board DTs. Update the title to match description in the process. Signed-off-by: Marek Vasut Reviewed-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230515162033.66986-1-marex@denx.de commit e45c5f1ad76968798b62add0396f85d9838aaca2 Author: Suraj Kandpal Date: Mon May 15 16:57:26 2023 +0530 drm/i915/hdcp: Fill hdcp2_streamid_type and k in appropriate places stream_id and k(no of streams) should be set in intel_hdcp_set_content_streams. stream_type should be set in intel_hdcp_required_content_stream. --v5 -add missing stream_id assignment [Ankit] Cc: Ankit Nautiyal Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230515112726.689116-1-suraj.kandpal@intel.com commit a6d82f1b7ada6154668f1b5ff751a845aa540637 Author: Suraj Kandpal Date: Mon May 15 16:02:24 2023 +0530 drm/i915/hdcp: Fix modeset locking issue in hdcp mst Since topology state is being added to drm_atomic_state now all drm_modeset_lock required are being taken from core. This raises an issue when we try to loop over connector and assign vcpi id to our streams as we did not have atomic state to derive acquire_ctx from. We fill in stream info if dpmst encoder is found before enabling hdcp. intel_hdcp_required_stream will be broken which will only set the content type. --v2 -move prepare streams to beginning of intel_hdcp_enable to avoid checking of mst encoder twice [Ankit] --v3 -break intel_required_content_stream to two part and set the stream_id at the beginning [Ankit] --v4 -change return types for intel_hdcp_prepare_stream and intel_hdcp_required content_stream [Ankit] -rename intel_hdcp_set_content_stream to intel_hdcp_set_stream [Ankit] -place intel_hdcp_set_streams above caller [Ankit] Cc: Jani Nikula Cc: Ankit Nautiyal Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230515103225.688830-4-suraj.kandpal@intel.com commit 415beb1fa63cf06e3b696822e94f977171921a2a Author: Suraj Kandpal Date: Mon May 15 16:02:23 2023 +0530 drm/i915/hdcp: Remove enforce_type0 check outside loop Remove enforce_type0 check outside the loop since it does not make sense to keep it there as we use the same digport and continue checking it again and again Cc: Ankit Nautiyal Signed-off-by: Suraj Kandpal Reviewed-by: Jani Nikula Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230515103225.688830-3-suraj.kandpal@intel.com commit 4c4279a8d58d146dc39b150226ee974652de4eef Author: Suraj Kandpal Date: Mon May 15 16:02:22 2023 +0530 drm/i915/hdcp: add intel_atomic_state argument to hdcp_enable function Pass all the parameter in intel_encoder->enable() to intel_hdcp_enable as we need intel_atomic_state later down to get acquire_ctx. Cc: Jani Nikula Cc: Ankit Nautiyal Signed-off-by: Suraj Kandpal Reviewed-by: Jani Nikula Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230515103225.688830-2-suraj.kandpal@intel.com commit 8b33485128ad932f807f4535e0b440733d8b5808 Author: Yunsheng Lin Date: Mon May 15 13:01:07 2023 +0800 net: skbuff: update comment about pfmemalloc propagating __skb_fill_page_desc_noacc() is not doing any pfmemalloc propagating, and yet it has a comment about that, commit 84ce071e38a6 ("net: introduce __skb_fill_page_desc_noacc") may have accidentally moved it to __skb_fill_page_desc_noacc(), so move it back to __skb_fill_page_desc() which is supposed to be doing pfmemalloc propagating. Signed-off-by: Yunsheng Lin CC: Pavel Begunkov Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20230515050107.46397-1-linyunsheng@huawei.com Signed-off-by: Paolo Abeni commit 2b874a027810d50b627408f51c59b9648f778a19 Author: Jani Nikula Date: Mon May 15 13:17:38 2023 +0300 drm/i915/irq: split out display irq handling Split (non-hotplug) display irq handling out of i915_irq.[ch] into display/intel_display_irq.[ch]. v3: - Preserve [I915_MAX_PIPES] harder (kernel test robot) v2: - Rebase - Preserve [I915_MAX_PIPES] in functions (kernel test robot) Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230515101738.2399816-3-jani.nikula@intel.com commit da38ba98645d789ddda2a584d40e2de00139e98b Author: Jani Nikula Date: Mon May 15 13:17:37 2023 +0300 drm/i915/irq: split out hotplug irq handling Split hotplug irq handling out of i915_irq.[ch] into display/intel_hotplug_irq.[ch]. The line between the new intel_hotplug_irq.[ch] and the existing intel_hotplug.[ch] needs further clarification, but the first step is to move the stuff out of i915_irq.[ch]. Reviewed-by: Rodrigo Vivi Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230515101738.2399816-2-jani.nikula@intel.com commit 08d8f43045af8589671d4462190d27765653cdf8 Author: Jani Nikula Date: Mon May 15 13:17:36 2023 +0300 drm/i915/irq: convert gen8_de_irq_handler() to void The return value is not used for anything. Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230515101738.2399816-1-jani.nikula@intel.com commit 518a1742f47792b5ea905b6cc4ecb05b77defd88 Author: David Lin Date: Mon May 15 14:55:58 2023 +0800 ASoC: dt-bindings: nau8824: Convert to dtschema Convert the NAU8824 audio CODEC bindings to DT schema. Signed-off-by: David Lin Date: Mon May 15 00:52:43 2023 +0200 ASoC: dt-bindings: ssm2518: Convert to dtschema Convert the ADI SSM2518 audio CODEC bindings to DT schema. Signed-off-by: Marek Vasut Date: Mon May 15 13:08:47 2023 +0000 bpf: Fix memleak due to fentry attach failure If it fails to attach fentry, the allocated bpf trampoline image will be left in the system. That can be verified by checking /proc/kallsyms. This meamleak can be verified by a simple bpf program as follows: SEC("fentry/trap_init") int fentry_run() { return 0; } It will fail to attach trap_init because this function is freed after kernel init, and then we can find the trampoline image is left in the system by checking /proc/kallsyms. $ tail /proc/kallsyms ffffffffc0613000 t bpf_trampoline_6442453466_1 [bpf] ffffffffc06c3000 t bpf_trampoline_6442453466_1 [bpf] $ bpftool btf dump file /sys/kernel/btf/vmlinux | grep "FUNC 'trap_init'" [2522] FUNC 'trap_init' type_id=119 linkage=static $ echo $((6442453466 & 0x7fffffff)) 2522 Note that there are two left bpf trampoline images, that is because the libbpf will fallback to raw tracepoint if -EINVAL is returned. Fixes: e21aa341785c ("bpf: Fix fexit trampoline.") Signed-off-by: Yafang Shao Signed-off-by: Daniel Borkmann Acked-by: Song Liu Cc: Jiri Olsa Link: https://lore.kernel.org/bpf/20230515130849.57502-2-laoar.shao@gmail.com commit a9650b7f6fc09d1659d7851384200b8ebec52cb6 Author: Ilkka Koskinen Date: Thu Apr 27 15:32:20 2023 -0700 perf vendor events arm64: Add AmpereOne core PMU events Add JSON files for AmpereOne core PMU events. Reviewed-by: John Garry Signed-off-by: Doug Rady Signed-off-by: Ilkka Koskinen Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230427223220.1068356-1-ilkka@os.amperecomputing.com Signed-off-by: Arnaldo Carvalho de Melo commit 40bf1cb07ee72480dd831d7a13e42728dfad35e2 Author: Changbin Du Date: Sat May 13 15:40:00 2023 +0800 perf ftrace: Flush output after each writing The pager will result stdout in full buffering mode instead of line buffering. We need to make the trace visible timely. Signed-off-by: Changbin Du Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230513074000.733550-1-changbin.du@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 18618dd0de3d2566da2eb651bf3e168803d8dbc5 Author: Aidan MacDonald Date: Wed May 10 12:50:46 2023 +0100 dt-bindings: power: supply: axp20x: Add AXP192 compatible The AXP192 is most similar to the AXP202, but the current limits are different and the USB OTG status register has a different address (0x04 instead of 0x02). Signed-off-by: Aidan MacDonald Acked-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel commit af1dcd3d2d37c85b7ff9315227a5cf28e1b80d1b Author: Aidan MacDonald Date: Wed May 10 12:50:45 2023 +0100 power: supply: axp20x_usb_power: Add support for AXP192 Add support for the AXP192. It is most similar to the AXP202 but the current limits are different and the USB OTG status register has a different address (0x04 instead of 0x02). Signed-off-by: Aidan MacDonald Signed-off-by: Sebastian Reichel commit 830087b11e1a60f86e1614043b8caeb9c74b340a Author: Aidan MacDonald Date: Wed May 10 12:50:44 2023 +0100 power: supply: axp20x_usb_power: Remove variant IDs from VBUS polling check Use an explicit boolean flag instead of a check based on the variant ID. Since this is the last use of variant IDs in the driver, also remove the IDs. Signed-off-by: Aidan MacDonald Signed-off-by: Sebastian Reichel commit 305398bfce771179f82940f428714651e6f3ad76 Author: Aidan MacDonald Date: Wed May 10 12:50:43 2023 +0100 power: supply: axp20x_usb_power: Use regmap field for VBUS disabling The POWER_SUPPLY_PROP_ONLINE property allows controlling the VBUS enable state on supported PMICs. Switch to regmap fields to reduce dependence on variant IDs. Signed-off-by: Aidan MacDonald Signed-off-by: Sebastian Reichel commit 70b3b6d9a8b4175e73914fa749c988a6c977f778 Author: Aidan MacDonald Date: Wed May 10 12:50:42 2023 +0100 power: supply: axp20x_usb_power: Use regmap fields for USB BC feature Replace the use of variant IDs with a regmap field, to reduce dependence on variant IDs. Signed-off-by: Aidan MacDonald Signed-off-by: Sebastian Reichel commit 05c14ac245e908fa8fa9d61ec0a378b4afc8e3a2 Author: Aidan MacDonald Date: Wed May 10 12:50:41 2023 +0100 power: supply: axp20x_usb_power: Use regmap fields for VBUS monitor feature Use regmap fields to describe the VBUS valid bit and VBUS monitor enable bit. This allows the driver to easily support other chips, eg. the AXP192, that have the VBUS valid bit in a different register. Signed-off-by: Aidan MacDonald Signed-off-by: Sebastian Reichel commit 28ca77c9bb8c895ed13163d8b74dafdc90cf44e1 Author: Aidan MacDonald Date: Wed May 10 12:50:40 2023 +0100 power: supply: axp20x_usb_power: Simplify USB current limit handling Handle the USB current limit with a lookup table and regmap field, which minimizes code duplication. Invalid or unlimited values are denoted by -1 entries, and can't be selected from userspace. Signed-off-by: Aidan MacDonald Signed-off-by: Sebastian Reichel commit 2a3e16360290642202450dad67847824157cccae Merge: 6882011e8854c 0816e1dd5ea8e Author: Marc Kleine-Budde Date: Mon May 15 22:54:22 2023 +0200 Merge patch series "can: Convert to platform remove callback returning void" Uwe Kleine-König says: this series converts the drivers below drivers/net/can to the .remove_new() callback of struct platform_driver(). The motivation is to make the remove callback less prone for errors and wrong assumptions. See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for a more detailed rationale. All drivers already returned zero unconditionally in their .remove() callback, so converting them to .remove_new() is trivial. Link: https://lore.kernel.org/r/20230512212725.143824-1-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 0816e1dd5ea8ee78ca31f9e94eb0025a7b13f636 Author: Uwe Kleine-König Date: Fri May 12 23:27:25 2023 +0200 can: xilinx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-20-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 9587b93b775545cc4b0d9815caa7d75dea4a9d0d Author: Uwe Kleine-König Date: Fri May 12 23:27:24 2023 +0200 can: ti_hecc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-19-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit aaa278e646c036961c69b65ec97cd69f92ddbc2e Author: Uwe Kleine-König Date: Fri May 12 23:27:23 2023 +0200 can: sun4i_can: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Gerhard Bertelsmann Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230512212725.143824-18-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 737aec8a8f13019642255276da1a55d8c969db51 Author: Uwe Kleine-König Date: Fri May 12 23:27:22 2023 +0200 can: softing: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-17-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit bc79adfbd1fd02738ca956da1715634c0e643b5f Author: Uwe Kleine-König Date: Fri May 12 23:27:21 2023 +0200 can: sja1000_platform: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-16-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 0367b598afbe81ba9b4881f923e0aeb8c7babdea Author: Uwe Kleine-König Date: Fri May 12 23:27:20 2023 +0200 can: sja1000_isa: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-15-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit ae08f87afff708ad5414f29eab00fec2e9fa155e Author: Uwe Kleine-König Date: Fri May 12 23:27:19 2023 +0200 can: rcar: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230512212725.143824-14-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 36157299e67bd11effcb961fd7ffb67f16e9f4e3 Author: Uwe Kleine-König Date: Fri May 12 23:27:18 2023 +0200 can: mscan: mpc5xxx_can: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-13-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 2d7c33d032ffec3b57b2c7841ad26b392bbe30b9 Author: Uwe Kleine-König Date: Fri May 12 23:27:17 2023 +0200 can: m_can: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-12-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 3ac96f45aac6b35af20f860bed4976023b0589f0 Author: Uwe Kleine-König Date: Fri May 12 23:27:16 2023 +0200 can: janz-ican3: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-11-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit a5095a9810187b30d57b8c565024972eae7b7025 Author: Uwe Kleine-König Date: Fri May 12 23:27:15 2023 +0200 can: ifi_canfd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-10-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 6aa62362f14d07d7541fb723b0365d7f513a9090 Author: Uwe Kleine-König Date: Fri May 12 23:27:14 2023 +0200 can: grcan: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-9-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 55216590c9cf545f15e443953fe97cd8fe52407b Author: Uwe Kleine-König Date: Fri May 12 23:27:13 2023 +0200 can: flexcan: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-8-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 45413bf759193d9c677746b5e52b96d60d9fa94f Author: Uwe Kleine-König Date: Fri May 12 23:27:12 2023 +0200 can: ctucanfd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Pavel Pisa Link: https://lore.kernel.org/r/20230512212725.143824-7-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 6882011e8854c6cb227770fccb57ed70a88a716f Author: Marc Kleine-Budde Date: Sun Apr 23 13:06:39 2023 +0200 can: length: make header self contained Include the headers that "can/length.h" depends on. Fixes: bdd2e413192d ("can: dev: move length related code into seperate file") Link: https://lore.kernel.org/all/20230509122854.350426-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 86eb8a19b477a878779c0e9d2888580ed14a59b6 Author: Uwe Kleine-König Date: Fri May 12 23:27:11 2023 +0200 can: cc770_platform: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-6-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit cca7d85ad80cda5658acac06bb99461329c41d70 Author: Jiapeng Chong Date: Sat May 6 16:07:25 2023 +0800 can: bxcan: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq_byname() already prints an error. ./drivers/net/can/bxcan.c:970:2-9: line 970 is redundant because platform_get_irq() already prints an error. ./drivers/net/can/bxcan.c:964:2-9: line 964 is redundant because platform_get_irq() already prints an error. ./drivers/net/can/bxcan.c:958:2-9: line 958 is redundant because platform_get_irq() already prints an error. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4878 Signed-off-by: Jiapeng Chong Reviewed-by: Simon Horman Link: https://lore.kernel.org/all/20230506080725.68401-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Marc Kleine-Budde commit 938100762293641ba1359b2a3cd6d2134ffaa8f2 Author: Uwe Kleine-König Date: Fri May 12 23:27:10 2023 +0200 can: cc770_isa: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-5-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 88da17436973e463bed59bea79771fb03a21555e Author: Ji-Ze Hong Date: Tue May 9 15:38:21 2023 +0800 can: usb: f81604: add Fintek F81604 support This patch adds support for Fintek USB to 2CAN controller. Changelog: v7: https://lore.kernel.org/all/20230509073821.25289-1-peter_hong@fintek.com.tw 1. Fix consistency of coding style for "break" in f81604_register_urbs(). 2. Remove goto statement in f81604_open(). v6: https://lore.kernel.org/all/20230505022317.22417-1-peter_hong@fintek.com.tw 1. Remove non-used define and change constant mask to GENMASK(). 2. Move some variables declaration from function start to block start. 3. Move some variables initization into declaration. 4. Change variable "id" in f81604_start_xmit() only for CAN ID usage. v5: https://lore.kernel.org/all/20230420024403.13830-1-peter_hong@fintek.com.tw 1. Change all u8 *buff to struct f81604_int_data/f81604_can_frame. 2. Change all netdev->dev_id to netdev->dev_port. 3. Remove over design for f81604_process_rx_packet(). This device only report a frame at once, so the f81604_process_rx_packet() are reduced to process 1 frame. v4: https://lore.kernel.org/all/20230413084253.1524-1-peter_hong@fintek.com.tw 1. Remove f81604_prepare_urbs/f81604_remove_urbs() and alloc URB/buffer dynamically in f81604_register_urbs(), using "urbs_anchor" for manage all rx/int URBs. 2. Add F81604 to MAINTAINERS list. 3. Change handle_clear_reg_work/handle_clear_overrun_work to single clear_reg_work and using bitwise "clear_flags" to record it. 4. Move __f81604_set_termination in front of f81604_probe() to avoid rarely racing condition. 5. Add __aligned to struct f81604_int_data / f81604_sff / f81604_eff. 6. Add aligned operations in f81604_start_xmit/f81604_process_rx_packet(). 7. Change lots of CANBUS functions first parameter from struct usb_device* to struct f81604_port_priv *priv. But remain f81604_write / f81604_read / f81604_update_bits() as struct usb_device* for __f81604_set_termination() in probe() stage. 8. Simplify f81604_read_int_callback() and separate into f81604_handle_tx / f81604_handle_can_bus_errors() functions. v3: https://lore.kernel.org/all/20230327051048.11589-1-peter_hong@fintek.com.tw 1. Change CAN clock to using MEGA units. 2. Remove USB set/get retry, only remain SJA1000 reset/operation retry. 3. Fix all numberic constant to define. 4. Add terminator control. (only 0 & 120 ohm) 5. Using struct data to represent INT/TX/RX endpoints data instead byte arrays. 6. Error message reports changed from %d to %pe for mnemotechnic values. 7. Some bit operations are changed to FIELD_PREP(). 8. Separate TX functions from f81604_read_int_callback(). 9. cf->can_id |= CAN_ERR_CNT in f81604_read_int_callback to report valid TX/RX error counts. 10. Move f81604_prepare_urbs/f81604_remove_urbs() from CAN open/close() to USB probe/disconnect(). 11. coding style refactoring. v2: https://lore.kernel.org/all/20230321081152.26510-1-peter_hong@fintek.com.tw 1. coding style refactoring. 2. some const number are defined to describe itself. 3. fix wrong usage for can_get_echo_skb() in f81604_write_bulk_callback(). v1: https://lore.kernel.org/all/20230317093352.3979-1-peter_hong@fintek.com.tw Signed-off-by: Ji-Ze Hong (Peter Hong) Reviewed-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230509073821.25289-1-peter_hong@fintek.com.tw [mkl: add changelog, fix printf format] Signed-off-by: Marc Kleine-Budde commit 1708caf4c47da8d61b6f5848d74e0a6d285449c2 Author: Uwe Kleine-König Date: Fri May 12 23:27:09 2023 +0200 can: c_can: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-4-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit cba8ed7f00434484d494cd75ef2ea8fc7fc4e0b1 Author: Uwe Kleine-König Date: Fri May 12 23:27:08 2023 +0200 can: bxcan: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512212725.143824-3-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 03ef5a4b322f342453a135ca8f376c09fd379024 Author: Uwe Kleine-König Date: Fri May 12 23:27:07 2023 +0200 can: at91_can: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230512212725.143824-2-u.kleine-koenig@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 6d491b37e70daeb963e3b589b746d99b8b4b1357 Author: Namhyung Kim Date: Wed May 10 23:27:25 2023 -0700 perf annotate browser: Add '<' and '>' keys for navigation hists__find_annotations() allows to move to next or previous symbols for annotation using the arrow keys. But TUI annotate_browser__run() uses the RIGHT key as ENTER to handle jump/call instructions. That makes the navigation to the next function impossible. I'd like to change it back to move the next symbol but I'm afraid if some users get confused. So I added a new pair of keys to handle that. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230511062725.514752-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 94f0705eee70cb256d21c9abe7ce44ffbe093555 Author: Namhyung Kim Date: Wed May 10 23:27:24 2023 -0700 perf annotate: Parse x86 SIB addressing properly When the source argument of the "mov" instruction looks like below, it didn't parse the whole operand and just stopped at the first comma. mov (%rbx,%rax,1),%rcx Fix it by checking the parentheses and move it to the closing one. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230511062725.514752-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 983034cd0d212b23a63efb48ecc47d55d70ee301 Author: Namhyung Kim Date: Wed May 10 23:27:23 2023 -0700 perf annotate: Handle "decq", "incq", "testq", "tzcnt" instructions on x86 I found that the "decq", "incq", "testq", "tzcnt" instructions didn't parse the operands properly. Add them to the "x86__instructions" table to fix the issue. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230511062725.514752-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 61b3d2107d2aae5dc86bbbbd0c9f6151d694cdc4 Author: Ben Hutchings Date: Sat May 13 22:37:43 2023 +0200 perf doc: Add support for KBUILD_BUILD_TIMESTAMP When building man pages from a Git checkout, we consistently set the man page date based on when the input was last changed. Otherwise, it defaults to the build time, which is not reproducible. Allow the date to be set through the KBUILD_BUILD_TIMESTAMP variable, as for timestamps in the kernel itself. Signed-off-by: Ben Hutchings Acked-by: Ian Rogers Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Salvatore Bonaccorso Link: https://lore.kernel.org/r/ZF/1F1P+b9qZ/vVH@decadent.org.uk Signed-off-by: Arnaldo Carvalho de Melo commit 21a165133c85d072051aa214099ad46a49239c46 Author: Ben Hutchings Date: Sat May 13 22:37:24 2023 +0200 perf doc: Define man page date when using asciidoctor When building perf documentation with asciidoc, we use "git log" to find the last commit date of each doc source and pass that to asciidoc to use as the man page date. When using asciidoctor, however, the current date is always used instead. Defining perf_date like we do for asciidoc also doesn't work because we're not using DocBook as an intermediate format. The asciidoctor man page backend looks for the variable "docdate", so set that instead. Signed-off-by: Ben Hutchings Acked-by: Ian Rogers Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Salvatore Bonaccorso Link: https://lore.kernel.org/r/ZF/1BOahN/i6xbBx@decadent.org.uk Signed-off-by: Arnaldo Carvalho de Melo commit 47e79cbeea4b3891ad476047f4c68543eb51c8e0 Author: Yafang Shao Date: Mon May 15 13:08:48 2023 +0000 bpf: Remove bpf trampoline selector After commit e21aa341785c ("bpf: Fix fexit trampoline."), the selector is only used to indicate how many times the bpf trampoline image are updated and been displayed in the trampoline ksym name. After the trampoline is freed, the selector will start from 0 again. So the selector is a useless value to the user. We can remove it. If the user want to check whether the bpf trampoline image has been updated or not, the user can compare the address. Each time the trampoline image is updated, the address will change consequently. Jiri also pointed out another issue that perf is still using the old name "bpf_trampoline_%lu", so this change can fix the issue in perf. Fixes: e21aa341785c ("bpf: Fix fexit trampoline.") Signed-off-by: Yafang Shao Signed-off-by: Daniel Borkmann Acked-by: Song Liu Cc: Jiri Olsa Link: https://lore.kernel.org/bpf/ZFvOOlrmHiY9AgXE@krava Link: https://lore.kernel.org/bpf/20230515130849.57502-3-laoar.shao@gmail.com commit 1298bc978afba0a507cedd0a91e53267ca152804 Author: Oswald Buddenhagen Date: Sun May 14 19:03:22 2023 +0200 ALSA: emu10k1: enable bit-exact playback, part 1: DSP attenuation Fractional multiplication with the maximal value 2^31-1 causes some tiny distortion. Instead, we want to multiply with the full 2^31. The catch is of course that this cannot be represented in the DSP's signed 32 bit registers. One way to deal with this is to encode 1.0 as a negative number and special-case it. As a matter of fact, the SbLive! code path already contained such code, though the controls never actually exercised it. A more efficient approach is to use negative values, which actually extend to -2^31. Accordingly, for all the volume adjustments we now use the MAC1 instruction which negates the X operand. The range of the controls in highres mode is extended downwards, so -1 is the new zero/mute. At maximal excursion, real zero is not mute any more, but I don't think anyone will notice this behavior change. ;-) That also required making the min/max/values in the control structs signed. This technically changes the user space interface, but it seems implausible that someone would notice - the numbers were actually treated as if they were signed anyway (and in the actual mixer iface they _are_). And without this change, the min value didn't even make sense in the first place (and no-one noticed, because it was always 0). Tested-by: Jonathan Dowland Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230514170323.3408834-7-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit de0dc31070a54d146bb5e7e5a739c9588034165c Author: Oswald Buddenhagen Date: Sun May 14 19:03:21 2023 +0200 ALSA: emu10k1: skip mic capture PCM for cards without AC97 codec The microphone capture device is a feature of the AC97 codec, so its availability should be coupled to the presence of that codec. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230514170323.3408834-6-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 6175ccd1a98136203bf88279cebcc6514ec15bdd Author: Oswald Buddenhagen Date: Sun May 14 19:03:20 2023 +0200 ALSA: emu10k1: omit non-applicable mixer controls for E-MU cards The E-MU cards don't try very hard to be Sound Blasters. All sound I/O goes through the Hana FPGA, thus making the regular extin/out controls useless. Still showing them just serves to clutter up the interface and confuse the user. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230514170323.3408834-5-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 1a38ae579606dae836dced573d5ffa78cce6fc48 Author: Oswald Buddenhagen Date: Sun May 14 19:03:19 2023 +0200 ALSA: emu10k1: validate min/max values of translated controls User space could pass arbitrary ranges, which were uncritically accepted. This could lead to table lookups out of range. I don't think that this is a security issue, as it only allowed someone with CAP_SYS_ADMIN to crash the kernel, but still. Setting an invalid translation mode will also be rejected now. That did no harm, but it's still better to detect errors. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230514170323.3408834-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit bb5ceb43b7bfa166fd5d739d51ad46c1cfb225e3 Author: Oswald Buddenhagen Date: Sun May 14 19:03:18 2023 +0200 ALSA: emu10k1: fix non-zero mixer control defaults in highres mode The default value needs to be scaled. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230514170323.3408834-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit a746516d75fd734e6af1d9a53bacbdef790e76d1 Author: Oswald Buddenhagen Date: Sun May 14 19:03:17 2023 +0200 ALSA: emu10k1: polish audigy GPR allocation - Pull ahead all fixed allocations, so we don't rely on the semi- dynamic ones not crossing the arbitrarily determined limit - Use an enum for the fixed allocations - Stop arbitrarily wasting registers on unexplained "reservations" - Don't reserve two regs for the master volume control - it's mono Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230514170323.3408834-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 2e9bd50f117ea3f638802627a196949f7eefcf02 Author: Oswald Buddenhagen Date: Sun May 14 19:03:23 2023 +0200 ALSA: emu10k1: optimize mask calculation in snd_emu10k1_ptr_read() Unlike in snd_emu10k1_ptr_write(), we don't need to keep the value's bits in place, so we can save one shift. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230514170323.3408798-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 2093dcfc04e1477efd47d3acf0adc4582dc5f4f6 Author: Oswald Buddenhagen Date: Sun May 14 19:03:22 2023 +0200 ALSA: emu10k1: merge common paths in snd_emu10k1_ptr_{read,write}() Avoids some code duplication. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230514170323.3408798-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 3676cd4bc8e69192246851edad164127d71ffee2 Author: Oswald Buddenhagen Date: Sun May 14 19:03:21 2023 +0200 ALSA: emu10k1: validate parameters of snd_emu10k1_ptr_{read,write}() Rather than applying masks to the provided values, make assertions about them being valid - otherwise we'd just try to paper over bugs. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230514170323.3408798-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 60571ac9ea621d3d1404f78bc0f27b709e82f2fd Author: Oswald Buddenhagen Date: Sun May 14 19:03:20 2023 +0200 ALSA: emu10k1: automate encoding of sub-register definitions The idea to encode the bitfield manipulation in the register address is quite clever, but doing that by hand is ugly and error-prone. So derive it automatically from the mask instead. Macros cannot #define other macros, so we now declare enums instead. This also adds macros for decoding the register definitions. These will be used by later commits. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230514170323.3408798-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit ce2544b2d05ee84cb9be1e05bf3e1a98c72b15dc Author: Zhouyi Zhou Date: Sun Mar 26 08:24:34 2023 +0800 torture: Remove duplicated argument -enable-kvm for ppc64 The qemu argument -enable-kvm is duplicated because the qemu_args bash variable in kvm-test-1-run.sh already provides it. This commit therefore removes the ppc64-specific copy in functions.sh. Signed-off-by: Zhouyi Zhou Signed-off-by: Paul E. McKenney Reviewed-by: Joel Fernandes (Google) commit 9e5d61c013a2c8b18f1205b6cd488a24ebce2d39 Author: Zqiang Date: Tue Mar 21 10:12:34 2023 +0800 doc/rcutorture: Add description of rcutorture.stall_cpu_block If you build a kernel with CONFIG_PREEMPTION=n and CONFIG_PREEMPT_COUNT=y, then run the rcutorture tests specifying stalls as follows: runqemu kvm slirp nographic qemuparams="-m 1024 -smp 4" \ bootparams="console=ttyS0 rcutorture.stall_cpu=30 \ rcutorture.stall_no_softlockup=1 rcutorture.stall_cpu_block=1" -d The tests will produce the following splat: [ 10.841071] rcu-torture: rcu_torture_stall begin CPU stall [ 10.841073] rcu_torture_stall start on CPU 3. [ 10.841077] BUG: scheduling while atomic: rcu_torture_sta/66/0x0000000 .... [ 10.841108] Call Trace: [ 10.841110] [ 10.841112] dump_stack_lvl+0x64/0xb0 [ 10.841118] dump_stack+0x10/0x20 [ 10.841121] __schedule_bug+0x8b/0xb0 [ 10.841126] __schedule+0x2172/0x2940 [ 10.841157] schedule+0x9b/0x150 [ 10.841160] schedule_timeout+0x2e8/0x4f0 [ 10.841192] schedule_timeout_uninterruptible+0x47/0x50 [ 10.841195] rcu_torture_stall+0x2e8/0x300 [ 10.841199] kthread+0x175/0x1a0 [ 10.841206] ret_from_fork+0x2c/0x50 This is because the rcutorture.stall_cpu_block=1 module parameter causes rcu_torture_stall() to invoke schedule_timeout_uninterruptible() within an RCU read-side critical section. This in turn results in a quiescent state (which prevents the stall) and a sleep in an atomic context (which produces the above splat). Although this code is operating as designed, the design has proven to be counterintuitive to many. This commit therefore updates the description in kernel-parameters.txt accordingly. [ paulmck: Apply Joel Fernandes feedback. ] Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit 90564f1e3dd66052af29e2c29cba3dc98b6604d0 Author: Florent Revest Date: Thu May 11 16:05:07 2023 +0200 bpf, arm64: Support struct arguments in the BPF trampoline This extends the BPF trampoline JIT to support attachment to functions that take small structures (up to 128bit) as argument. This is trivially achieved by saving/restoring a number of "argument registers" rather than a number of arguments. The AAPCS64 section 6.8.2 describes the parameter passing ABI. "Composite types" (like C structs) below 16 bytes (as enforced by the BPF verifier) are provided as part of the 8 argument registers as explained in the section C.12. Signed-off-by: Florent Revest Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Acked-by: Xu Kuohai Link: https://lore.kernel.org/bpf/20230511140507.514888-1-revest@chromium.org commit 04cb8453a91c7c22f60ddadb6cef0d19abb33bb5 Author: Alan Maguire Date: Fri May 12 12:31:34 2023 +0100 bpftool: JIT limited misreported as negative value on aarch64 On aarch64, "bpftool feature" reports an incorrect BPF JIT limit: $ sudo /sbin/bpftool feature Scanning system configuration... bpf() syscall restricted to privileged users JIT compiler is enabled JIT compiler hardening is disabled JIT compiler kallsyms exports are enabled for root skipping kernel config, can't open file: No such file or directory Global memory limit for JIT compiler for unprivileged users is -201326592 bytes This is because /proc/sys/net/core/bpf_jit_limit reports $ sudo cat /proc/sys/net/core/bpf_jit_limit 68169519595520 ...and an int is assumed in read_procfs(). Change read_procfs() to return a long to avoid negative value reporting. Fixes: 7a4522bbef0c ("tools: bpftool: add probes for /proc/ eBPF parameters") Reported-by: Nicky Veitch Signed-off-by: Alan Maguire Signed-off-by: Daniel Borkmann Acked-by: Jiri Olsa Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20230512113134.58996-1-alan.maguire@oracle.com commit d84b1a6708eec06b6cd9d33c5e0177bbd6ba4813 Author: Andrii Nakryiko Date: Mon May 15 11:07:10 2023 -0700 bpf: fix calculation of subseq_idx during precision backtracking Subsequent instruction index (subseq_idx) is an index of an instruction that was verified/executed by verifier after the currently processed instruction. It is maintained during precision backtracking processing and is used to detect various subprog calling conditions. This patch fixes the bug with incorrectly resetting subseq_idx to -1 when going from child state to parent state during backtracking. If we don't maintain correct subseq_idx we can misidentify subprog calls leading to precision tracking bugs. One such case was triggered by test_global_funcs/global_func9 test where global subprog call happened to be the very last instruction in parent state, leading to subseq_idx==-1, triggering WARN_ONCE: [ 36.045754] verifier backtracking bug [ 36.045764] WARNING: CPU: 13 PID: 2073 at kernel/bpf/verifier.c:3503 __mark_chain_precision+0xcc6/0xde0 [ 36.046819] Modules linked in: aesni_intel(E) crypto_simd(E) cryptd(E) kvm_intel(E) kvm(E) irqbypass(E) i2c_piix4(E) serio_raw(E) i2c_core(E) crc32c_intel) [ 36.048040] CPU: 13 PID: 2073 Comm: test_progs Tainted: G W OE 6.3.0-07976-g4d585f48ee6b-dirty #972 [ 36.048783] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 [ 36.049648] RIP: 0010:__mark_chain_precision+0xcc6/0xde0 [ 36.050038] Code: 3d 82 c6 05 bb 35 32 02 01 e8 66 21 ec ff 0f 0b b8 f2 ff ff ff e9 30 f5 ff ff 48 c7 c7 f3 61 3d 82 4c 89 0c 24 e8 4a 21 ec ff <0f> 0b 4c0 With the fix precision tracking across multiple states works correctly now: mark_precise: frame0: last_idx 45 first_idx 38 subseq_idx -1 mark_precise: frame0: regs=r8 stack= before 44: (61) r7 = *(u32 *)(r10 -4) mark_precise: frame0: regs=r8 stack= before 43: (85) call pc+41 mark_precise: frame0: regs=r8 stack= before 42: (07) r1 += -48 mark_precise: frame0: regs=r8 stack= before 41: (bf) r1 = r10 mark_precise: frame0: regs=r8 stack= before 40: (63) *(u32 *)(r10 -48) = r1 mark_precise: frame0: regs=r8 stack= before 39: (b4) w1 = 0 mark_precise: frame0: regs=r8 stack= before 38: (85) call pc+38 mark_precise: frame0: parent state regs=r8 stack=: R0_w=scalar() R1_w=map_value(off=4,ks=4,vs=8,imm=0) R6=1 R7_w=scalar() R8_r=P0 R10=fpm mark_precise: frame0: last_idx 36 first_idx 28 subseq_idx 38 mark_precise: frame0: regs=r8 stack= before 36: (18) r1 = 0xffff888104f2ed14 mark_precise: frame0: regs=r8 stack= before 35: (85) call pc+33 mark_precise: frame0: regs=r8 stack= before 33: (18) r1 = 0xffff888104f2ed10 mark_precise: frame0: regs=r8 stack= before 32: (85) call pc+36 mark_precise: frame0: regs=r8 stack= before 31: (07) r1 += -4 mark_precise: frame0: regs=r8 stack= before 30: (bf) r1 = r10 mark_precise: frame0: regs=r8 stack= before 29: (63) *(u32 *)(r10 -4) = r7 mark_precise: frame0: regs=r8 stack= before 28: (4c) w7 |= w0 mark_precise: frame0: parent state regs=r8 stack=: R0_rw=scalar() R6=1 R7_rw=scalar() R8_rw=P0 R10=fp0 fp-48_r=mmmmmmmm mark_precise: frame0: last_idx 27 first_idx 16 subseq_idx 28 mark_precise: frame0: regs=r8 stack= before 27: (85) call pc+31 mark_precise: frame0: regs=r8 stack= before 26: (b7) r1 = 0 mark_precise: frame0: regs=r8 stack= before 25: (b7) r8 = 0 Note how subseq_idx starts out as -1, then is preserved as 38 and then 28 as we go up the parent state chain. Reported-by: Alexei Starovoitov Fixes: fde2a3882bd0 ("bpf: support precision propagation in the presence of subprogs") Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230515180710.1535018-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 103d6e9d61e012d9f7d0aae33529924f9a3d78d9 Author: Bitterblue Smith Date: Sat May 13 23:48:27 2023 +0300 wifi: rtl8xxxu: Rename some registers Give proper names: RF6052_REG_UNKNOWN_56 -> RF6052_REG_PAD_TXG RF6052_REG_UNKNOWN_DF -> RF6052_REG_GAIN_CCA And fix typos: REG_OFDM0_AGCR_SSI_TABLE -> REG_OFDM0_AGC_RSSI_TABLE REG_BB_ACCEESS_CTRL -> REG_BB_ACCESS_CTRL Signed-off-by: Bitterblue Smith Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/40157253-76bd-8b23-06e0-3365139b5395@gmail.com commit c98411dc8cf6c15b8dbbfb37475bcc08b8958880 Author: Bitterblue Smith Date: Sat May 13 23:47:38 2023 +0300 wifi: rtl8xxxu: Support new chip RTL8192FU This is a newer chip, similar to the RTL8710BU in that it uses the same PHY status structs. Features: 2.4 GHz, b/g/n mode, 2T2R, 300 Mbps. It can allegedly have Bluetooth, but that's not implemented here. This chip can have many RFE (RF front end) types, of which types 1 and 5 are the only ones tested. Many of the other types need different initialisation tables. They can be added if someone wants them. The vendor driver v5.8.6.2_35538.20191028_COEX20190910-0d02 from https://github.com/BrightX/rtl8192fu was used as reference, with additional device IDs taken from https://github.com/kelebek333/rtl8192fu-dkms. The vendor driver also claims to support devices with ID 0bda:a725, but that is found in some bluetooth-only devices, so it's not supported here. Signed-off-by: Bitterblue Smith Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/7dcf9fb9-1c97-ac28-5286-2236e287a18c@gmail.com commit 87807f77a03d0271211b75f84b2a8b88f4e8e5d4 Author: Matthias Brugger Date: Tue May 9 12:04:20 2023 +0200 wifi: brcmfmac: wcc: Add debug messages The message is attach and detach function are merly for debugging, change them from pr_err to pr_debug. Signed-off-by: Matthias Brugger Reviewed-by: Hans de Goede Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230509100420.26094-1-matthias.bgg@kernel.org commit 7583e8fbdc49a4dbd916d14863cf1deeddb982f9 Author: Lukas Bulwahn Date: Wed May 10 08:57:13 2023 +0200 x86/cpu: Remove X86_FEATURE_NAMES While discussing to change the visibility of X86_FEATURE_NAMES (see Link) in order to remove CONFIG_EMBEDDED, Boris suggested to simply make the X86_FEATURE_NAMES functionality unconditional. As the need for really tiny kernel images has gone away and kernel images with !X86_FEATURE_NAMES are hardly tested, remove this config and the whole ifdeffery in the source code. Suggested-by: Borislav Petkov Signed-off-by: Lukas Bulwahn Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/all/20230509084007.24373-1-lukas.bulwahn@gmail.com/ Link: https://lore.kernel.org/r/20230510065713.10996-3-lukas.bulwahn@gmail.com commit 424e23fd6c30ec204c1c77919066ae777577a4f9 Author: Lukas Bulwahn Date: Wed May 10 08:57:12 2023 +0200 x86/Kconfig: Make X86_FEATURE_NAMES non-configurable in prompt While discussing to change the visibility of X86_FEATURE_NAMES (see Link) in order to remove CONFIG_EMBEDDED, Boris suggested to simply make the X86_FEATURE_NAMES functionality unconditional. As a first step, make X86_FEATURE_NAMES disappear from Kconfig. So, as X86_FEATURE_NAMES defaults to yes, to disable it, one now needs to modify the .config file before compiling the kernel. Suggested-by: Borislav Petkov Signed-off-by: Lukas Bulwahn Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/all/20230509084007.24373-1-lukas.bulwahn@gmail.com/ commit de598695a2adc2affe7ce2e8787b5c01ce3aa661 Author: Arnaud Pouliquen Date: Fri May 12 11:39:24 2023 +0200 remoteproc: stm32: Allow hold boot management by the SCMI reset controller The hold boot can be managed by the SCMI controller as a reset. If the "hold_boot" reset is defined in the device tree, use it. Else use the syscon controller directly to access to the register. The support of the SMC call is deprecated but kept for legacy support. Signed-off-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20230512093926.661509-3-arnaud.pouliquen@foss.st.com commit ef7129db96cb1ecf627ca82677f34ac3b37edab2 Author: Arnaud Pouliquen Date: Fri May 12 11:39:23 2023 +0200 dt-bindings: remoteproc: st,stm32-rproc: Rework reset declarations With the introduction of the SCMI (System Control and Management Interface), it is now possible to use the SCMI to handle the hold boot instead of a dedicated SMC call. As consequence two configurations are possible: - without SCMI server on OP-TEE: use the Linux rcc reset service and use syscon for the MCU hold boot - With SCMI server on OP-TEE: use the SCMI reset service for both the MCU reset and the MCU hold boot. This patch: - make optional and deprecated the use of the property st,syscfg-tz which was used to check if the trusted Zone was enable to use scm call, to manage the hold boot. The reset controller phandle is used instead to select the configurations. - make st,syscfg-holdboot optional - adds properties check on resets definitions. - adds an example of the SCMI reset service usage. Signed-off-by: Arnaud Pouliquen Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230512093926.661509-2-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit 6361b7de262aca8704abfaade5166a940f7cc571 Author: Xingyu Wu Date: Tue May 9 23:17:23 2023 +0800 riscv: dts: starfive: jh7110: Add watchdog node Add the watchdog node for the Starfive JH7110 SoC. Signed-off-by: Xingyu Wu Reviewed-by: Walker Chen Signed-off-by: Conor Dooley commit 435ac3fbfbc64a4557862a612058383748a3c7f0 Author: Xingyu Wu Date: Tue May 9 23:17:22 2023 +0800 riscv: dts: starfive: jh7100: Add watchdog node Add watchdog node for the StarFive JH7100 RISC-V SoC. Reviewed-by: Emil Renner Berthing Signed-off-by: Xingyu Wu Signed-off-by: Conor Dooley commit caec5ebe77f97d948dcf46f07d622bda7f1f6dfd Author: Jens Axboe Date: Tue May 9 09:19:10 2023 -0600 io_uring: rely solely on FMODE_NOWAIT Now that we have both sockets and block devices setting FMODE_NOWAIT appropriately, we can get rid of all the odd special casing in __io_file_supports_nowait() and rely soley on FMODE_NOWAIT and O_NONBLOCK rather than special case sockets and (in particular) bdevs. Link: https://lore.kernel.org/r/20230509151910.183637-4-axboe@kernel.dk Signed-off-by: Jens Axboe commit e9833d8701028b5dd62895e68f4a280aad359172 Author: Jens Axboe Date: Tue May 9 09:19:09 2023 -0600 block: mark bdev files as FMODE_NOWAIT if underlying device supports it We set this unconditionally, but it really should be dependent on if the underlying device is nowait compliant. Cc: linux-block@vger.kernel.org Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230509151910.183637-3-axboe@kernel.dk Signed-off-by: Jens Axboe commit fe34db062b8036f72e97c2b9eaa7e9fbb725ead2 Author: Jens Axboe Date: Tue May 9 09:19:08 2023 -0600 net: set FMODE_NOWAIT for sockets The socket read/write functions deal with O_NONBLOCK and IOCB_NOWAIT just fine, so we can flag them as being FMODE_NOWAIT compliant. With this, we can remove socket special casing in io_uring when checking if a file type is sane for nonblocking IO, and it's also the defined way to flag file types as such in the kernel. Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Reviewed-by: Paolo Abeni Link: https://lore.kernel.org/r/20230509151910.183637-2-axboe@kernel.dk Signed-off-by: Jens Axboe commit fc1d62b3588b74153c0823f7ad59925e586732de Merge: 25428a9da7035 5a56c5335d36d Author: Mark Brown Date: Tue May 16 00:30:14 2023 +0900 ASoC: SOF: ipc4-topology: Improve the audio format Merge series from Peter Ujfalusi : Improve the logic to account for the current restrictions in topology while making it extensible for future topology modifications. The current topology definitions assume that input/output formats come in pairs. For example even if there's only 1 output format for a module, we add 3 output formats to match that of the input format count with the same parameters. This is unnecessary but we have to deal with it until the topologies are modified. Additionally, choosing the input/output audio format should depend only on the pipeline params or the runtime FE hw_params depending on where the module is in the pipeline. This series modifies the logic for selection based on this and removes unnecessary dependencies between the input and output formats. commit 25428a9da703539837dee040a18019bb16db1453 Merge: fe0d5b9a4d6bb 739ee993c3859 Author: Mark Brown Date: Tue May 16 00:30:08 2023 +0900 ASoC: mediatek: mt8188: revise AFE driver Merge series from Trevor Wu : The series of patches consists of four major changes. First, remove redundant supply for ADDA DAI dirver. Second, revise ETDM control including APLL dynamic switch via DAPM, so APLL can be enabled when it is really required. Third, update AFE probe function. Bus protection change was dropped at the previous patch because the dependent change was not accepted at that time. Finally, correct some binding errors and add required clocks. commit 924764aa5f2e705f46f548611e6a9d6b986ae880 Author: Sebastian Reichel Date: Thu May 4 19:36:13 2023 +0200 pinctrl: rk805: Add rk806 pinctrl support Add support for rk806 dvs pinctrl to the existing rk805 driver. This has been implemented using shengfei Xu's rk806 specific driver from the vendor tree as reference. Co-developed-by: shengfei Xu Signed-off-by: shengfei Xu Reviewed-by: Linus Walleij Acked-by: Linus Walleij Tested-by: Diederik de Haas # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-10-sebastian.reichel@collabora.com Signed-off-by: Lee Jones commit 210f418f8ace9f056c337f7945e0ae3e242b3389 Author: Sebastian Reichel Date: Thu May 4 19:36:12 2023 +0200 mfd: rk8xx: Add rk806 support Add support for SPI connected rk806, which is used by the RK3588 evaluation boards. The PMIC is advertised to support I2C and SPI, but the evaluation boards all use SPI. Thus only SPI support is added here. Tested-by: Diederik de Haas # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-9-sebastian.reichel@collabora.com Signed-off-by: Lee Jones commit 706a4141d40fd98a884824b3d97b19b0ecb7e9a8 Author: Sebastian Reichel Date: Thu May 4 19:36:11 2023 +0200 dt-bindings: mfd: Add rk806 binding Add DT binding document for Rockchip's RK806 PMIC. Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-8-sebastian.reichel@collabora.com Signed-off-by: Lee Jones commit 74413bd611b4fd21fdf90e369780b2f8543447a4 Author: Sebastian Reichel Date: Thu May 4 19:36:10 2023 +0200 mfd: rk8xx-i2c: Use device_get_match_data Simplify the device identification logic by supplying the relevant information via of_match_data. This also removes the dev_info() printing the chip version, since that's supplied by the match data now. Due to lack of hardware this change is compile-tested only. Tested-by: Diederik de Haas # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-7-sebastian.reichel@collabora.com Signed-off-by: Lee Jones commit c20e8c5b1203af3726561ee5649b147194e0618e Author: Sebastian Reichel Date: Thu May 4 19:36:09 2023 +0200 mfd: rk808: Split into core and i2c Split rk808 into a core and an i2c part in preparation for SPI support. Acked-by: Alexandre Belloni # for RTC Tested-by: Diederik de Haas # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-6-sebastian.reichel@collabora.com Signed-off-by: Lee Jones commit 049449976f549605a6913d468b61356a9950a6a2 Author: Sebastian Reichel Date: Thu May 4 19:36:08 2023 +0200 mfd: rk808: Replace 'struct i2c_client' with 'struct device' Put 'struct device' pointer into the MFD platform_data instead of the 'struct i2c_client' pointer. This simplifies the code and prepares the MFD for SPI support. Tested-by: Diederik de Haas # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-5-sebastian.reichel@collabora.com Signed-off-by: Lee Jones commit e31a5c5cfeab70d3554e237daf9e319265cbb411 Author: Srivatsa S. Bhat (VMware) Date: Fri May 12 09:49:56 2023 -0700 MAINTAINERS: Update Srivatsa S. Bhat's maintained areas I have decided to change employers and I'm not sure if I'll be able to spend as much time on the subsystems/drivers I maintain. So, I would like to remove myself from the maintainer role. Remove Srivatsa from the maintainers entry and add Ajay Kaher as an additional reviewer/maintainer for the respective areas. Also, add an entry to CREDITS for Srivatsa. [ bp: Merge all three into one patch, adjust commit message. ] Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Borislav Petkov (AMD) Acked-by: Alexey Makhalov Acked-by: Ajay Kaher Acked-by: Juergen Gross Link: https://lore.kernel.org/r/20230512164958.575174-1-srivatsa@csail.mit.edu commit fe0d5b9a4d6bb1781b462ab5f649d2085492643a Merge: 8d7c1a577598e 95d06196c83c9 Author: Mark Brown Date: Tue May 16 00:17:58 2023 +0900 ASoC: Factor out control notification support Merge series from Charles Keepax : This series introduces and uses a helper for notifying control changes to userspace. commit e714b50bdf3cf45076c601276e9e3da00ea05319 Author: Sebastian Reichel Date: Thu May 4 19:36:07 2023 +0200 mfd: rk808: Use dev_err_probe Use dev_err_probe instead of dev_err in probe function, which simplifies code a little bit and prints the error code. Also drop possibly incorrect printing of chip id registers while touching the error message. Tested-by: Diederik de Haas # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-4-sebastian.reichel@collabora.com Signed-off-by: Lee Jones commit 8d7c1a577598e4c709855b07c8df92b0c6fc4220 Merge: 3959cd3dcbc2a 225f37b578a9f Author: Mark Brown Date: Tue May 16 00:17:51 2023 +0900 ASoC: SOF: Intel/ipc4: Do not reset BE DAI pipeline Merge series from Peter Ujfalusi : Do not reset pipelines during the stop/suspend triggers in the BE DAI ops as the BE DAI pipeline needs to be left in the PAUSED state. It should only be reset during hw_free. This simplification is already done for the FE pipelines and the DAI trigger only toggles the states between PAUSED and RUNNING. commit 3959cd3dcbc2ae8ad4f0b1ed30cfd5a08263d55f Merge: 6f59901832278 fdecd4aaf80af Author: Mark Brown Date: Tue May 16 00:17:44 2023 +0900 ASoC: SOF: Intel: hda-dai: prepare LNL support Merge series from Pierre-Louis Bossart : The HDAudio support has not changed much since CometLake/2019: the code was reshuffled for IPC4 support and we used hdac_hda for external and Display Audio codec, but the hda-dai code was only used for HDAudio codecs. In the LunarLake architecture, all endpoints (HDaudio, SSP, DMIC, SoundWire) are handled with the HDaudio DMA, which requires us to revisit the definitions of HDA_LINK, and remove the mutual exclusion between NOCODEC and HDA_LINK: we do want the ability to test SSP/DMIC in NOCODEC mode even with an HDA DMA. This code change exposed a number of issues, with a useless .prepare callback, a DAI number mismatch and the need to support SoundWire which is handled by a different component in drivers/soundwire/intel_ace2.c. commit 6f599018322781cbb1f1d28ae6e3703d3f3a1b5e Merge: d904942aeaa6a dfe25fea968dc Author: Mark Brown Date: Tue May 16 00:17:37 2023 +0900 ASoC: Intel: machine driver updates Merge series from Pierre-Louis Bossart : Several updates for RPL/MTL/LNL, and one fix for SoundWire TGL device. commit 4fec8a5a85c495851007084e632b7f3f87cb7bdb Author: Sebastian Reichel Date: Thu May 4 19:36:06 2023 +0200 mfd: rk808: Convert to device managed resources Fully convert the driver to device managed resources. Tested-by: Diederik de Haas # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-3-sebastian.reichel@collabora.com Signed-off-by: Lee Jones commit 2dc51ca822e4633e244e7f7bdc51e76a77dca939 Author: Sebastian Reichel Date: Thu May 4 19:36:05 2023 +0200 clk: RK808: Reduce 'struct rk808' usage Reduce usage of 'struct rk808' (driver data of the parent MFD), so that only the chip variant field is still being accessed directly. This allows restructuring the MFD driver to support SPI based PMICs. Acked-by: Stephen Boyd Tested-by: Diederik de Haas # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230504173618.142075-2-sebastian.reichel@collabora.com Signed-off-by: Lee Jones commit 4f1192559707eaa7adef307f5b9ad3a444b248f8 Author: Christian Kujau Date: Sat Feb 18 22:29:44 2023 +0100 Documentation/process: Explain when tip branches get merged into mainline Explain when tip branches get merged into mainline. Suggested-by: Borislav Petkov Signed-off-by: Christian Kujau Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/8a1fd8b7-9fe3-b2b5-406e-fa6f5e03e7c0@nerdbynature.de commit be06fedcec0d5796f3a383f0e4409cf1296e75a9 Author: Shubhi Garg Date: Mon May 8 10:27:32 2023 +0000 dt-bindings: tegra: Document compatible for IGX Document the compatible strings used for Nvidia IGX Orin Development kit which uses P3701 SKU8 and P3740 carrier board. Signed-off-by: Shubhi Garg Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 6c79e42169fe10308d72051950c411b3524c7aa9 Author: Hristo Venev Date: Thu May 11 20:45:07 2023 +0300 EDAC/amd64: Add support for ECC on family 19h model 60h-7Fh Ryzen 9 7950X uses model 61h. Treat it as Epyc 9004, but with 2 channels instead of 12. With two 32GB dual-rank DIMMs the sizes appear to be reported correctly: EDAC MC0: Giving out device to module amd64_edac controller F19h_M60h: DEV 0000:00:18.3 (INTERRUPT) EDAC amd64: F19h_M60h detected (node 0). EDAC MC: UMC0 chip selects: EDAC amd64: MC: 0: 0MB 1: 0MB EDAC amd64: MC: 2: 16384MB 3: 16384MB EDAC MC: UMC1 chip selects: EDAC amd64: MC: 0: 0MB 1: 0MB EDAC amd64: MC: 2: 16384MB 3: 16384MB AMD64 EDAC driver v3.5.0 ECC errors can also be detected: mce: [Hardware Error]: Machine check events logged [Hardware Error]: Corrected error, no action required. [Hardware Error]: CPU:0 (19:61:2) MC21_STATUS[Over|CE|MiscV|AddrV|-|-|SyndV|CECC|-|-|-]: 0xdc2040000400011b [Hardware Error]: Error Addr: 0x00000007ff7e93c0 [Hardware Error]: IPID: 0x0000009600050f00, Syndrome: 0x000100010a801203 [Hardware Error]: Unified Memory Controller Ext. Error Code: 0, DRAM ECC error. EDAC MC0: 1 CE Cannot decode normalized address on mc#0csrow#3channel#0 (csrow:3 channel:0 page:0x0 offset:0x0 grain:64 syndrome:0x1) [Hardware Error]: cache level: L3/GEN, tx: GEN, mem-tx: RD According to Mario Limonciello, the same code should also work for models 70h-7Fh (follow thread in Link). [ bp: Massage, the translation logic updates are pending. ] Signed-off-by: Hristo Venev Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20230425201239.324476-1-hristo@venev.name Link: https://lore.kernel.org/r/20230511174506.875153-2-hristo@venev.name commit 4d585f48ee6b38c54c075b151c5efd2ff65f8ffd Author: Dave Marchevsky Date: Wed May 10 14:30:47 2023 -0700 bpf: Remove anonymous union in bpf_kfunc_call_arg_meta For kfuncs like bpf_obj_drop and bpf_refcount_acquire - which take user-defined types as input - the verifier needs to track the specific type passed in when checking a particular kfunc call. This requires tracking (btf, btf_id) tuple. In commit 7c50b1cb76ac ("bpf: Add bpf_refcount_acquire kfunc") I added an anonymous union with inner structs named after the specific kfuncs tracking this information, with the goal of making it more obvious which kfunc this data was being tracked / expected to be tracked on behalf of. In a recent series adding a new user of this tuple, Alexei mentioned that he didn't like this union usage as it doesn't really help with readability or bug-proofing ([0]). In an offline convo we agreed to have the tuple be fields (arg_btf, arg_btf_id), with comments in bpf_kfunc_call_arg_meta definition enumerating the uses of the fields by kfunc-specific handling logic. Such a pattern is used by struct bpf_reg_state without trouble. Accordingly, this patch removes the anonymous union in favor of arg_btf and arg_btf_id fields and comment enumerating their current uses. The patch also removes struct btf_and_id, which was only being used by the removed union's inner structs. This is a mechanical change, existing linked_list and rbtree tests will validate that correct (btf, btf_id) are being passed. [0]: https://lore.kernel.org/bpf/20230505021707.vlyiwy57vwxglbka@dhcp-172-26-102-232.dhcp.thefacebook.com Signed-off-by: Dave Marchevsky Link: https://lore.kernel.org/r/20230510213047.1633612-1-davemarchevsky@fb.com Signed-off-by: Alexei Starovoitov commit ab87f558dcfb2562c3497e89600dec798a446665 Author: Maíra Canal Date: Fri May 12 07:40:45 2023 -0300 drm/vkms: Fix RGB565 pixel conversion Currently, the pixel conversion isn't rounding the fixed-point values before assigning it to the RGB coefficients, which is causing the IGT pixel-format tests to fail. So, use the drm_fixp2int_round() fixed-point helper to round the values when assigning it to the RGB coefficients. Tested with igt@kms_plane@pixel-format and igt@kms_plane@pixel-format-source-clamping. [v2]: * Use drm_fixp2int_round() to fix the pixel conversion instead of casting the values to s32 (Melissa Wen). Fixes: 89b03aeaef16 ("drm/vkms: fix 32bit compilation error by replacing macros") Signed-off-by: Maíra Canal Reviewed-by: Arthur Grillo Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230512104044.65034-2-mcanal@igalia.com commit 8b25320887d7feac98875546ea0f521628b745bb Author: Maíra Canal Date: Fri May 12 07:40:44 2023 -0300 drm: Add fixed-point helper to get rounded integer values Create a new fixed-point helper to allow us to return the rounded value of our fixed point value. [v2]: * Create the function drm_fixp2int_round() (Melissa Wen). [v3]: * Use drm_fixp2int() instead of shifting manually (Arthur Grillo). Signed-off-by: Maíra Canal Reviewed-by: Arthur Grillo Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230512104044.65034-1-mcanal@igalia.com commit 7d3ee229ea51a17afc1e53272e2a8f377cc82ba2 Author: Uwe Kleine-König Date: Thu Apr 13 08:16:42 2023 +0200 powerpc: Drop MPC5200 LocalPlus bus FIFO driver While mpc5200b.dtsi contains a device that this driver can bind to, the only purpose of a bound device is to be used by the four exported functions mpc52xx_lpbfifo_submit(), mpc52xx_lpbfifo_abort(), mpc52xx_lpbfifo_poll() and mpc52xx_lpbfifo_start_xfer(). However there are no callers to this function and so the driver is effectively superfluous and can be deleted. Also drop some defines and a struct from that are unused now together with the declarations of the four mentioned functions. Signed-off-by: Uwe Kleine-König Signed-off-by: Michael Ellerman Link: https://msgid.link/20230413061642.kqkor4wkt7lp2mhp@pengutronix.de commit da5311a4b852eaf2c0feac8b28884a8d8a801dfc Author: Tom Rix Date: Fri Apr 28 18:12:40 2023 -0400 powerpc/spufs: remove unneeded if-checks For ppc64, gcc with W=1 reports arch/powerpc/platforms/cell/spu_base.c:330:17: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 330 | ; | ^ arch/powerpc/platforms/cell/spu_base.c:333:17: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 333 | ; | ^ These if-checks do not do anything so remove them. Signed-off-by: Tom Rix Fixes: 67207b9664a8 ("[PATCH] spufs: The SPU file system, base") Reviewed-by: Christophe Leroy Acked-by: Arnd Bergmann Signed-off-by: Michael Ellerman Link: https://msgid.link/20230428221240.2679194-1-trix@redhat.com commit 9d87ab41743fa3658d568859d64936b37f058b60 Author: Randy Dunlap Date: Fri Apr 28 21:35:03 2023 -0700 powerpc: delete empty config entry for PPC_86xx Drop an unused and empty "config" entry for PPC_86xx. It has no keyword entries under it and the following line's "menuconfig" for the same Kconfig symbol is what kconfig uses. Fixes: d8267c1a3686 ("powerpc: Add 82xx/83xx/86xx to 6xx Multiplatform") Signed-off-by: Randy Dunlap Signed-off-by: Michael Ellerman Link: https://msgid.link/20230429043503.19385-1-rdunlap@infradead.org commit 63b5dbfdb770254c4fdb58d22b62458308685592 Author: Shyam Sundar S K Date: Wed May 10 20:17:51 2023 +0530 platform/x86/amd/pmf: Add PMF debug facilities At times, when the mode transitions fail to happen, the current driver does not give enough debug information on why the transition failed or the default preset values did not load. Having an on-demand logs guarded by CONFIG would be helpful in such cases. Co-developed-by: Patil Rajesh Reddy Signed-off-by: Patil Rajesh Reddy Signed-off-by: Shyam Sundar S K Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20230510144751.66601-2-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit a82ebb3d800d7baf72122e82ab7c9b240d0a8a56 Author: Shyam Sundar S K Date: Wed May 10 20:17:50 2023 +0530 platform/x86/amd/pmf: Add PMF acpi debug support PMF driver maintains an internal config store for each PMF feature after the feature init happens. Having a debug mechanism to triage in-field issues w.r.t to mode switch not happening based on the OEM fed values via the ACPI method to PMF driver is becoming the need of the hour. Add support to get more ACPI debug spew guarded by a CONFIG. Co-developed-by: Patil Rajesh Reddy Signed-off-by: Patil Rajesh Reddy Signed-off-by: Shyam Sundar S K Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20230510144751.66601-1-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 812562b8d881ce6d33fed8052b3a10b718430fb5 Author: Shuijing Li Date: Mon May 15 17:49:55 2023 +0800 drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence For "boe,tv105wum-nw0" this special panel, it is stipulated in the panel spec that MIPI needs to keep the LP11 state before the lcm_reset pin is pulled high. Signed-off-by: Shuijing Li Signed-off-by: Xinlei Lee Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230515094955.15982-3-shuijing.li@mediatek.com commit fe7f4e8d496552f880d7368b482d2ccac33780b7 Author: Shuijing Li Date: Mon May 15 17:49:54 2023 +0800 drm/panel: boe-tv101wum-nl6: Remove extra delay Reduce the delay after LCM reset by removing an extra delay in the initialization commands array. The required delay of at least 6ms after reset is guaranteed by boe_panel_prepare(). Signed-off-by: Shuijing Li Signed-off-by: Xinlei Lee Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230515094955.15982-2-shuijing.li@mediatek.com commit c0d68601cbcefaf69018b3e7aff2687316950ace Author: Ian Rogers Date: Fri May 12 23:34:47 2023 -0700 perf test: Add cputype testing to perf stat Check a bogus PMU fails and that a known PMU succeeds. Limit to PMUs known cpu, cpu_atom and armv8_pmuv3_0 ones. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230513063447.464691-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit fbac266f095de92b93e7c91c71cdca432c2c9275 Author: Heiko Carstens Date: Tue Apr 25 13:42:11 2023 +0200 s390: select ARCH_SUPPORTS_INT128 s390 has instructions to support 128 bit arithmetics, e.g. a 64 bit multiply instruction with a 128 bit result. Also 128 bit integer artithmetics are already used in s390 specific architecture code (see e.g. read_persistent_clock64()). Therefore select ARCH_SUPPORTS_INT128. However limit this to clang for now, since gcc generates inefficient code, which may lead to stack overflows, when compiling lib/crypto/curve25519-hacl64.c which depends on ARCH_SUPPORTS_INT128. The gcc generated functions have 6kb stack frames, compared to only 1kb of the code generated with clang. If the kernel is compiled with -Os library calls for __ashlti3(), __ashrti3(), and __lshrti3() may be generated. Similar to arm64 and riscv provide assembler implementations for these functions. Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 190c6854e9ea0290e6af0ec28ee76c4f90d57cb8 Author: Arnaldo Carvalho de Melo Date: Fri May 12 16:27:16 2023 -0300 perf build: Don't use -ftree-loop-distribute-patterns and -gno-variable-location-views in the python feature test when building with clang-13 Using -ftree-loop-distribute-patterns and -gno-variable-location-views in the python feature test when building with clang-16 results in: 16 80.04 clearlinux:latest : FAIL clang version 16.0.1 clang-16: error: unknown argument: '-gno-variable-location-views' clang-16: error: unknown argument: '-gno-variable-location-views' clang-16: error: optimization flag '-ftree-loop-distribute-patterns' is not supported [-Werror,-Wignored-optimization-argument] clang-16: error: optimization flag '-ftree-loop-distribute-patterns' is not supported [-Werror,-Wignored-optimization-argument] error: command '/usr/sbin/clang' failed with exit code 1 Noticed when building on a docker.io/library/clearlinux:latest container. Signed-off-by: Arnaldo Carvalho de Melo commit 1f2597cd3686955a4d64e01909dbfe625a2a35a1 Author: Thomas Richter Date: Thu Apr 27 10:33:31 2023 +0200 s390/pai_ext: replace atomic_t with refcount_t The s390 PMU of PAI extension 1 NNPA counters uses atomic_t for reference counting. Replace this with the proper data type refcount_t. No functional change. Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Signed-off-by: Alexander Gordeev commit 9a1bc9ea01e2e95ed56801ed946b310f5562abfc Author: Ian Rogers Date: Tue May 2 15:38:51 2023 -0700 perf parse-events: Reduce scope of is_event_supported Move to print-events.c and make static. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-45-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ecc758cee6a1088f2e2e684a09fea650472a47f0 Author: Thomas Richter Date: Mon Apr 24 08:53:55 2023 +0200 s390/pai_crypto: replace atomic_t with refcount_t The s390 PMU of PAI crypto counters uses atomic_t for reference counting. Replace this with the proper data type refcount_t. No functional change. Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Signed-off-by: Alexander Gordeev commit 718eabe1f329acedf1470aed67632d65dca5088c Author: Ian Rogers Date: Tue May 2 15:38:50 2023 -0700 perf stat: Don't disable TopdownL1 metric on hybrid Now that hybrid bugs are fixed sufficient to run TopdownL1 metrics, don't implicitly disable them for hybrid. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-44-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8a4859c50fb79fcbbf74963162389b1d3a87e484 Author: Ian Rogers Date: Tue May 2 15:38:49 2023 -0700 perf metrics: Be PMU specific in event match Ids/events from a metric are turned into an event string and parsed; setup_metric_events matches the id back to the parsed evsel. With hybrid the same event may exist on both PMUs with the same name and be being used by metrics at the same time. A metric on cpu_core therefore shouldn't match against evsels on cpu_atom, or the metric will compute the wrong value. Make the matching sensitive to the PMU being parsed. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-43-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d6b7dd1107ee24c68f8540f34b0a0483ed5fac07 Author: Ian Rogers Date: Tue May 2 15:38:48 2023 -0700 perf jevents: Don't rewrite metrics across PMUs Don't rewrite metrics across PMUs as the result events likely won't be found. Identify metrics with a pair of PMU name and metric name. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-42-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1b8012b26f78b2dd124214256481c8643e4465e9 Author: Ian Rogers Date: Tue May 2 15:38:47 2023 -0700 perf vendor events intel: Correct alderlake metrics Fix the metrics tma_memory_bound on alderlake cpu_core and tma_microcode_sequencer on alderlake cpu_atom, where metrics had be rewritten across PMUs. Fix MEM_BOUND_STALLS_AT_RET_CORRECTION which is an aux metric but lacks a hash prefix. Add PMU prefixes for cpu_core/cpu_atom events to avoid wildcard opening the events. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-41-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit dae47d3940a77e1639edb0c5f0596f43bcff8bf8 Author: Ian Rogers Date: Tue May 2 15:38:46 2023 -0700 perf stat: Command line PMU metric filtering Wire up the --cputype value to limit which metrics are parsed. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-40-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit bd3846d0fea2e8e3375fc54a6556561726f466cf Author: Ian Rogers Date: Tue May 2 15:38:45 2023 -0700 perf metrics: Be PMU specific for referenced metrics. Hybrid systems may define the same metric for different PMUs, this can cause confusion of events. To avoid this make the referenced metric searches PMU specific, matching that in the table. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-39-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5136e43c6139d4d400effb33643eb171dc4c3bfa Author: Ian Rogers Date: Tue May 2 15:38:44 2023 -0700 perf parse-events: Don't reorder atom cpu events On hybrid systems the topdown events don't share a fixed counter on the atom core, so they don't require the sorting the perf metric supporting PMUs do. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-38-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 52c7b4d3f9c12c44b8392765c73cced3be99cec6 Author: Ian Rogers Date: Tue May 2 15:38:43 2023 -0700 perf parse-events: Don't auto merge hybrid wildcard events Bring back the behavior of not auto-merging hybrid events by delegating to a test in pmu. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-37-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 2aadca4b35427a7c65acc6aa415b38758128b22c Author: Ian Rogers Date: Tue May 2 15:38:42 2023 -0700 perf parse-events: Avoid error when assigning a legacy cache term Avoid the parser error: ''' $ perf stat -e 'cycles/name=l1d/' true event syntax error: 'cycles/name=l1d/' \___ parser error ''' by combining the name and legacy cache cases in the parser. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-36-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e831f3ccf9920fa099d4ebb9d57214cc7ecd2e70 Author: Ian Rogers Date: Tue May 2 15:38:41 2023 -0700 perf parse-events: Avoid error when assigning a term Avoid the parser error: ''' $ perf stat -e 'cycles/name=name/' true event syntax error: 'cycles/name=name/' \___ parser error ''' by turning the term back to a string if it is on the right. Add PMU and generic parsing tests. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-35-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5ea8f2ccffb23983f02012a2731464586b10fbf3 Author: Ian Rogers Date: Tue May 2 15:38:40 2023 -0700 perf parse-events: Support hardware events as terms An event like "cpu/instructions/" typically parses due to there being a sysfs event called instructions. On hybrid recursive parsing means that the hardware event is encoded in the attribute, with the PMU being placed in the high bits of the config: ''' $ perf stat -vv -e 'cpu_core/cycles/' true ... ------------------------------------------------------------ perf_event_attr: size 136 config 0x400000000 sample_type IDENTIFIER read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING disabled 1 inherit 1 enable_on_exec 1 exclude_guest 1 ------------------------------------------------------------ ''' Make this behavior the default by adding a new term type and token for hardware events. The token gathers both the numeric config and the parsed name, so that if the token appears like "cycles/name=cycles/" then the token can be handled like a name. The numeric value isn't sufficient to distinguish say "cpu-cycles" from "cycles". Extend the parse-events test so that all current non-PMU hardware parsing tests, also test with the PMU cpu - more than half the change. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-34-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit aefde50a446b56f592a589e12e89935bea3b85f9 Author: Ian Rogers Date: Tue May 2 15:38:39 2023 -0700 perf test: Fix parse-events tests for >1 core PMU Remove assumptions of just 1 core PMU. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-33-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 003be8c4f71753092bbb86fa9d7ad26dd9fb98db Author: Ian Rogers Date: Tue May 2 15:38:37 2023 -0700 perf stat: Make cputype filter generic Rather than limit the --cputype argument for "perf list" and "perf stat" to hybrid PMUs of just cpu_atom and cpu_core, allow any PMU. Note, that if cpu_atom isn't mounted but a filter of cpu_atom is requested, then this will now fail. As such a filter would never succeed, no events can come from that unmounted PMU, then this behavior could never have been useful and failing is clearer. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-31-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 411ad22ecf0281d666a82aa7f4de90c70365da7d Author: Ian Rogers Date: Tue May 2 15:38:36 2023 -0700 perf parse-events: Add pmu filter To support the cputype argument added to "perf stat" for hybrid it is necessary to filter events during wildcard matching. Add a scanner argument for the filter and checking it when wildcard matching. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-30-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 24d80818ce2216ee37308b3b087944efb2479b80 Author: Ian Rogers Date: Tue May 2 15:38:35 2023 -0700 perf parse-events: Minor type safety cleanup Use the typed parse_state rather than void* _parse_state when available. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-29-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 996e54bbee825d25706796672926dbac826a0818 Author: Ian Rogers Date: Tue May 2 15:38:34 2023 -0700 perf parse-events: Remove now unused hybrid logic The event parser no longer needs to recurse in case of a legacy cache event in a PMU, the necessary wild card logic has moved to perf_pmu__supports_legacy_cache and perf_pmu__supports_wildcard_numeric. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-28-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8bc75f699c14142021d9ecbf5556ded13a403b64 Author: Ian Rogers Date: Tue May 2 15:38:33 2023 -0700 perf parse-events: Support wildcards on raw events Legacy raw events like r1a open as PERF_TYPE_RAW on non-hybrid systems and on each hybrid PMU on hybrid systems. Rather than iterate hybrid PMUs add a perf_pmu__supports_wildcard_numeric function that says when a numeric event should be opened upon it. If the parsed event specifies the type of the PMU then don't wildcard match PMUs, use the specified PMU type. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-27-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d7f21df0c991f0909a992c0c7e2d31d4c46d40b4 Author: Ian Rogers Date: Tue May 2 15:38:32 2023 -0700 perf print-events: Print legacy cache events for each PMU Mirroring parse_events_add_cache, list the legacy name alongside its alias with the PMU. Remove the now unnecessary hybrid logic. Note, the alias output removes the event type descriptor, so: L1-dcache-loads [Hardware cache event] becomes: L1-dcache-loads OR cpu/L1-dcache-loads/ Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-26-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 2bdf4d7ea9b66e54948297194d564a71504a5bda Author: Ian Rogers Date: Tue May 2 15:38:31 2023 -0700 perf parse-events: Wildcard legacy cache events It is inconsistent that "perf stat -e instructions-retired" wildcard opens on all PMUs while legacy cache events like "perf stat -e L1-dcache-load-miss" do not. A behavior introduced by hybrid is that a legacy cache event like L1-dcache-load-miss should wildcard open on all hybrid PMUs. Previously hybrid would call to is_event_supported for each PMU, a failure of which results in the event not being added. This isn't done in this case as the parser should just create perf_event_attr and the later open should fail, or the counter give "". If this wants to be avoided then the PMU can be named with the event. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-25-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 6fd1e5191591f9d55afe4d23fa35af2a5cf8f81f Author: Ian Rogers Date: Tue May 2 15:38:30 2023 -0700 perf parse-events: Support PMUs for legacy cache events Allow a legacy cache event to be both, for example, "L1-dcache-load-miss" and "cpu/L1-dcache-load-miss/" by introducing a new legacy cache term type. The term type is processed in config_term_pmu, setting both the type in perf_event_attr and the config. The code to determine the config is factored out of parse_events_add_cache and shared. If the PMU doesn't support legacy events, currently just core/hybrid PMUs do, then the term is treated like a PE_NAME term - as before. If only terms are being parsed, such as for perf_pmu__new_alias, then the PE_LEGACY_CACHE token is always parsed as PE_NAME. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-24-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 68911aef3d76e74594b8f2dd018693c57d435355 Author: Ian Rogers Date: Tue May 2 15:38:29 2023 -0700 perf test x86 hybrid: Add hybrid extended type checks Assert hybrid extended types are as expected. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-23-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8d8632887d74d06df5ef370427a8e2856e011546 Author: Ian Rogers Date: Tue May 2 15:38:28 2023 -0700 perf test x86 hybrid: Update test expectations Don't assume evlist order. Switch to a loop rather than depend on evlist order for raw events test. Update hybrid event expectations. Previous values were based on parsing legacy hardware events from sysfs, update to the correct PMU specific legacy values. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-22-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ae4aa00a1a9358e0007f6edc71b018a0b0d21190 Author: Ian Rogers Date: Tue May 2 15:38:27 2023 -0700 perf test: Move x86 hybrid tests to arch/x86 The tests use x86 hybrid specific PMUs. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-21-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 70c90e4a6b2fbe775b662eafefae51f64d627790 Author: Ian Rogers Date: Tue May 2 15:38:25 2023 -0700 perf parse-events: Avoid scanning PMUs before parsing The event parser needs to handle two special cases: 1) legacy events like L1-dcache-load-miss. These event names don't appear in JSON or sysfs, and lookup tables are used for the config value. 2) raw events where 'r0xead' is the same as 'read' unless the PMU has an event called 'read' in which case the event has priority. The previous parser to handle these cases would scan all PMUs for components of event names. These components would then be used to classify in the lexer whether the token should be part of a legacy event, a raw event or an event. The grammar would handle legacy event tokens or recombining the tokens back into a regular event name. The code wasn't PMU specific and had issues around events like AMD's branch-brs that would fail to parse as it expects brs to be a suffix on a legacy event style name: $ perf stat -e branch-brs true event syntax error: 'branch-brs' \___ parser error This change removes processing all PMUs by using the lexer in the form of a regular expression matcher. The lexer will return the token for the longest matched sequence of characters, and in the event of a tie the first. The legacy events are a fixed number of regular expressions, and by matching these before a name token its possible to generate an accurate legacy event token with everything else matching as a name. Because of the lexer change the handling of hyphens in the grammar can be removed as hyphens just become a part of the name. To handle raw events and terms the parser is changed to defer trying to evaluate whether something is a raw event until the PMU is known in the grammar. Once the PMU is known, the events of the PMU can be scanned for the 'read' style problem. A new term type is added for these raw terms, used to enable deferring the evaluation. While this change is large, it has stats of: 170 insertions(+), 436 deletions(-) the bulk of the change is deleting the old approach. It isn't possible to break apart the code added due to the dependencies on how the parts of the parsing work. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-19-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 442eeb77044705f2952a88a1c5d4a902f444bf02 Author: Ian Rogers Date: Tue May 2 15:38:24 2023 -0700 perf print-events: Avoid unnecessary strlist The strlist in print_hwcache_events holds the event names as they are generated, and then it is iterated and printed. This is unnecessary and each event can just be printed as it is processed. Rename the variable i to res, to be more intention revealing and consistent with other code. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-18-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit cae256ae75cf2d62187c0477e2e08da71d537fc5 Author: Ian Rogers Date: Tue May 2 15:38:23 2023 -0700 perf parse-events: Set pmu_name whenever a pmu is given Change add_event to always set pmu_name when possible as not all code checks both pmu->name and evsel->pmu_name, for example, uniquify_counter in stat-display.c. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-17-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit c9aeb2e9cc8ee02c6ad469a910a3aa9b083b76cf Author: Ian Rogers Date: Tue May 2 15:38:22 2023 -0700 perf parse-events: Set attr.type to PMU type early Set attr.type to PMU type early so that later terms can override the value. Setting the value in perf_pmu__config means that earlier steps, like config_term_pmu, can override the value. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-16-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a8af6e48c6220992430cd55713679f49c23ac6d2 Author: Ian Rogers Date: Tue May 2 15:38:21 2023 -0700 perf test: Roundtrip name, don't assume 1 event per name Opening hardware names and a legacy cache event on a hybrid PMU opens it on each PMU. Parsing and checking indexes fails, as the parsed index is double the expected. Avoid checking the index by just comparing the names immediately after the parse. This change removes hard coded hybrid logic and removes assumptions about the expansion of an event. On hybrid the PMUs may or may not support an event and so using a distance isn't a consistent solution. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-15-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 4a7c4eafb74860fd7cb1eecbd2606cdd26809d0a Author: Ian Rogers Date: Tue May 2 15:38:20 2023 -0700 perf test: Test more with config_cache test__checkevent_config_cache checks the parsing of "L1-dcache-misses/name=cachepmu/". Don't just check that the name is set correctly, also validate the rest of the perf_event_attr for L1-dcache-misses. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-14-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 9854934b055cfc37b3acdff5323dd2060745a774 Author: Ian Rogers Date: Tue May 2 15:38:19 2023 -0700 perf test: Mask configs with extended types then test Add helper to test the config of an evsel. Dependent on the type of the evsel, mask the config so that high-bits containing the extended PMU type are ignored. Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-13-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8f8c106886983f7963df76d33bf9e42df8ec3e8a Author: Ian Rogers Date: Tue May 2 15:38:18 2023 -0700 perf test: Use valid for PMU tests Rather than skip all tests in test__events_pmu if PMU cpu isn't present, use the per-test valid test. This allows the running of software PMU tests on hybrid and arm systems. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-12-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5a52817e388bc2beaceff7b2059988987491cb59 Author: Ian Rogers Date: Tue May 2 15:38:17 2023 -0700 perf test: Test more sysfs events Parse events for all PMUs, and not just cpu, in test "Parsing of all PMU events from sysfs". Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-11-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit cde61c605252d3ee2eba3cc966f4871819108955 Author: Ian Rogers Date: Tue May 2 15:38:16 2023 -0700 perf vendor events intel: Add tigerlake metric constraints Previously these constraints were disabled as they contained topdown events. Since: https://lore.kernel.org/all/20230312021543.3060328-9-irogers@google.com/ the topdown events are correctly grouped even if no group exists. This change was created by PR: https://github.com/intel/perfmon/pull/71 Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-10-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit cbd393afa3ff6ef951e40c3bfbe7538aaf72c9aa Author: Ian Rogers Date: Tue May 2 15:38:15 2023 -0700 perf vendor events intel: Add sapphirerapids metric constraints Previously these constraints were disabled as they contained topdown events. Since: https://lore.kernel.org/all/20230312021543.3060328-9-irogers@google.com/ the topdown events are correctly grouped even if no group exists. This change was created by PR: https://github.com/intel/perfmon/pull/71 Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-9-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f215040aa24534aa8d4c4bf657387f7252e64370 Author: Ian Rogers Date: Tue May 2 15:38:14 2023 -0700 perf vendor events intel: Add icelakex metric constraints Previously these constraints were disabled as they contained topdown events. Since: https://lore.kernel.org/all/20230312021543.3060328-9-irogers@google.com/ the topdown events are correctly grouped even if no group exists. This change was created by PR: https://github.com/intel/perfmon/pull/71 Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit aea8abd7d435262f1db443b163147545098d517f Author: Ian Rogers Date: Tue May 2 15:38:13 2023 -0700 perf vendor events intel: Add icelake metric constraints Previously these constraints were disabled as they contained topdown events. Since: https://lore.kernel.org/all/20230312021543.3060328-9-irogers@google.com/ the topdown events are correctly grouped even if no group exists. This change was created by PR: https://github.com/intel/perfmon/pull/71 Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0d9b41daa5907756a31772d8af8ac5ff25cf17c1 Author: Krzysztof Kozlowski Date: Sat May 13 13:52:04 2023 +0200 nfc: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect() If sock->service_name is NULL, the local variable service_name_tlv_length will not be assigned by nfc_llcp_build_tlv(), later leading to using value frmo the stack. Smatch warning: net/nfc/llcp_commands.c:442 nfc_llcp_send_connect() error: uninitialized symbol 'service_name_tlv_length'. Fixes: de9e5aeb4f40 ("NFC: llcp: Fix usage of llcp_add_tlv()") Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 0f1cb4d777281ca3360dbc8959befc488e0c327e Author: Javier Martinez Canillas Date: Fri May 12 14:02:31 2023 +0200 drm/ssd130x: Fix include guard name This is a leftover from an early iteration of the driver when it was still named ssd1307 instead of ssd130x. Change it for consistency with the rest. Signed-off-by: Javier Martinez Canillas Reviewed-by: Sam Ravnborg Reviewed-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230512120232.304603-1-javierm@redhat.com commit 2a61d97fb0ff17411aeb808c145209dbcfc34506 Author: Ian Rogers Date: Tue May 2 15:38:12 2023 -0700 perf vendor events intel: Add alderlake metric constraints Previously these constraints were disabled as they contained topdown events. Since: https://lore.kernel.org/all/20230312021543.3060328-9-irogers@google.com/ the topdown events are correctly grouped even if no group exists. This change was created by PR: https://github.com/intel/perfmon/pull/71 Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Adrian Hunter Cc: Ahmad Yasin Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Caleb Biggers Cc: Edward Baker Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kang Minchul Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Rob Herring Cc: Samantha Alt Cc: Stephane Eranian Cc: Sumanth Korikkar Cc: Suzuki Poulouse Cc: Thomas Richter Cc: Tiezhu Yang Cc: Weilin Wang Cc: Xing Zhengjun Cc: Yang Jihong Link: https://lore.kernel.org/r/20230502223851.2234828-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0c7ffa32dbd6b09a87fea4ad1de8b27145dfd9a6 Author: Thomas Gleixner Date: Fri May 12 23:07:56 2023 +0200 x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it Implement the validation function which tells the core code whether parallel bringup is possible. The only condition for now is that the kernel does not run in an encrypted guest as these will trap the RDMSR via #VC, which cannot be handled at that point in early startup. There was an earlier variant for AMD-SEV which used the GHBC protocol for retrieving the APIC ID via CPUID, but there is no guarantee that the initial APIC ID in CPUID is the same as the real APIC ID. There is no enforcement from the secure firmware and the hypervisor can assign APIC IDs as it sees fit as long as the ACPI/MADT table is consistent with that assignment. Unfortunately there is no RDMSR GHCB protocol at the moment, so enabling AMD-SEV guests for parallel startup needs some more thought. Intel-TDX provides a secure RDMSR hypercall, but supporting that is outside the scope of this change. Fixup announce_cpu() as e.g. on Hyper-V CPU1 is the secondary sibling of CPU0, which makes the @cpu == 1 logic in announce_cpu() fall apart. [ mikelley: Reported the announce_cpu() fallout Originally-by: David Woodhouse Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205257.467571745@linutronix.de commit 7e75178a0950c5ceffa2ca3225701b69752f7d3a Author: David Woodhouse Date: Fri May 12 23:07:55 2023 +0200 x86/smpboot: Support parallel startup of secondary CPUs In parallel startup mode the APs are kicked alive by the control CPU quickly after each other and run through the early startup code in parallel. The real-mode startup code is already serialized with a bit-spinlock to protect the real-mode stack. In parallel startup mode the smpboot_control variable obviously cannot contain the Linux CPU number so the APs have to determine their Linux CPU number on their own. This is required to find the CPUs per CPU offset in order to find the idle task stack and other per CPU data. To achieve this, export the cpuid_to_apicid[] array so that each AP can find its own CPU number by searching therein based on its APIC ID. Introduce a flag in the top bits of smpboot_control which indicates that the AP should find its CPU number by reading the APIC ID from the APIC. This is required because CPUID based APIC ID retrieval can only provide the initial APIC ID, which might have been overruled by the firmware. Some AMD APUs come up with APIC ID = initial APIC ID + 0x10, so the APIC ID to CPU number lookup would fail miserably if based on CPUID. Also virtualization can make its own APIC ID assignements. The only requirement is that the APIC IDs are consistent with the APCI/MADT table. For the boot CPU or in case parallel bringup is disabled the control bits are empty and the CPU number is directly available in bit 0-23 of smpboot_control. [ tglx: Initial proof of concept patch with bitlock and APIC ID lookup ] [ dwmw2: Rework and testing, commit message, CPUID 0x1 and CPU0 support ] [ seanc: Fix stray override of initial_gs in common_cpu_up() ] [ Oleksandr Natalenko: reported suspend/resume issue fixed in x86_acpi_suspend_lowlevel ] [ tglx: Make it read the APIC ID from the APIC instead of using CPUID, split the bitlock part out ] Co-developed-by: Thomas Gleixner Co-developed-by: Brian Gerst Signed-off-by: Thomas Gleixner Signed-off-by: Brian Gerst Signed-off-by: David Woodhouse Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205257.411554373@linutronix.de commit f6f1ae9128d2a080ecdd55f85e8a0ca3ed1d58eb Author: Thomas Gleixner Date: Fri May 12 23:07:53 2023 +0200 x86/smpboot: Implement a bit spinlock to protect the realmode stack Parallel AP bringup requires that the APs can run fully parallel through the early startup code including the real mode trampoline. To prepare for this implement a bit-spinlock to serialize access to the real mode stack so that parallel upcoming APs are not going to corrupt each others stack while going through the real mode startup code. Co-developed-by: David Woodhouse Signed-off-by: David Woodhouse Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205257.355425551@linutronix.de commit bea629d57d006733d155bdb65ba4867788da69b6 Author: Thomas Gleixner Date: Fri May 12 23:07:51 2023 +0200 x86/apic: Save the APIC virtual base address For parallel CPU brinugp it's required to read the APIC ID in the low level startup code. The virtual APIC base address is a constant because its a fix-mapped address. Exposing that constant which is composed via macros to assembly code is non-trivial due to header inclusion hell. Aside of that it's constant only because of the vsyscall ABI requirement. Once vsyscall is out of the picture the fixmap can be placed at runtime. Avoid header hell, stay flexible and store the address in a variable which can be exposed to the low level startup code. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205257.299231005@linutronix.de commit 18415f33e2ac4ab382cbca8b5ff82a9036b5bd49 Author: Thomas Gleixner Date: Fri May 12 23:07:50 2023 +0200 cpu/hotplug: Allow "parallel" bringup up to CPUHP_BP_KICK_AP_STATE There is often significant latency in the early stages of CPU bringup, and time is wasted by waking each CPU (e.g. with SIPI/INIT/INIT on x86) and then waiting for it to respond before moving on to the next. Allow a platform to enable parallel setup which brings all to be onlined CPUs up to the CPUHP_BP_KICK_AP state. While this state advancement on the control CPU (BP) is single-threaded the important part is the last state CPUHP_BP_KICK_AP which wakes the to be onlined CPUs up. This allows the CPUs to run up to the first sychronization point cpuhp_ap_sync_alive() where they wait for the control CPU to release them one by one for the full onlining procedure. This parallelism depends on the CPU hotplug core sync mechanism which ensures that the parallel brought up CPUs wait for release before touching any state which would make the CPU visible to anything outside the hotplug control mechanism. To handle the SMT constraints of X86 correctly the bringup happens in two iterations when CONFIG_HOTPLUG_SMT is enabled. The control CPU brings up the primary SMT threads of each core first, which can load the microcode without the need to rendevouz with the thread siblings. Once that's completed it brings up the secondary SMT threads. Co-developed-by: David Woodhouse Signed-off-by: David Woodhouse Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205257.240231377@linutronix.de commit f54d4434c281f38b975d58de47adeca671beff4f Author: Thomas Gleixner Date: Fri May 12 23:07:48 2023 +0200 x86/apic: Provide cpu_primary_thread mask Make the primary thread tracking CPU mask based in preparation for simpler handling of parallel bootup. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205257.186599880@linutronix.de commit 8b5a0f957cc5ca1f68486163d4da4683be3b47aa Author: Thomas Gleixner Date: Fri May 12 23:07:46 2023 +0200 x86/smpboot: Enable split CPU startup The x86 CPU bringup state currently does AP wake-up, wait for AP to respond and then release it for full bringup. It is safe to be split into a wake-up and and a separate wait+release state. Provide the required functions and enable the split CPU bringup, which prepares for parallel bringup, where the bringup of the non-boot CPUs takes two iterations: One to prepare and wake all APs and the second to wait and release them. Depending on timing this can eliminate the wait time completely. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205257.133453992@linutronix.de commit a631be92b996c5db9b368e8b96305d22fb8c4180 Author: Thomas Gleixner Date: Fri May 12 23:07:45 2023 +0200 cpu/hotplug: Provide a split up CPUHP_BRINGUP mechanism The bring up logic of a to be onlined CPU consists of several parts, which are considered to be a single hotplug state: 1) Control CPU issues the wake-up 2) To be onlined CPU starts up, does the minimal initialization, reports to be alive and waits for release into the complete bring-up. 3) Control CPU waits for the alive report and releases the upcoming CPU for the complete bring-up. Allow to split this into two states: 1) Control CPU issues the wake-up After that the to be onlined CPU starts up, does the minimal initialization, reports to be alive and waits for release into the full bring-up. As this can run after the control CPU dropped the hotplug locks the code which is executed on the AP before it reports alive has to be carefully audited to not violate any of the hotplug constraints, especially not modifying any of the various cpumasks. This is really only meant to avoid waiting for the AP to react on the wake-up. Of course an architecture can move strict CPU related setup functionality, e.g. microcode loading, with care before the synchronization point to save further pointless waiting time. 2) Control CPU waits for the alive report and releases the upcoming CPU for the complete bring-up. This allows that the two states can be split up to run all to be onlined CPUs up to state #1 on the control CPU and then at a later point run state #2. This spares some of the latencies of the full serialized per CPU bringup by avoiding the per CPU wakeup/wait serialization. The assumption is that the first AP already waits when the last AP has been woken up. This obvioulsy depends on the hardware latencies and depending on the timings this might still not completely eliminate all wait scenarios. This split is just a preparatory step for enabling the parallel bringup later. The boot time bringup is still fully serialized. It has a separate config switch so that architectures which want to support parallel bringup can test the split of the CPUHP_BRINGUG step separately. To enable this the architecture must support the CPU hotplug core sync mechanism and has to be audited that there are no implicit hotplug state dependencies which require a fully serialized bringup. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205257.080801387@linutronix.de commit 6d712b9b3a58018259fb40ddd498d1f7dfa1f4ec Author: David Woodhouse Date: Fri May 12 23:07:43 2023 +0200 cpu/hotplug: Reset task stack state in _cpu_up() Commit dce1ca0525bf ("sched/scs: Reset task stack state in bringup_cpu()") ensured that the shadow call stack and KASAN poisoning were removed from a CPU's stack each time that CPU is brought up, not just once. This is not incorrect. However, with parallel bringup the idle thread setup will happen at a different step. As a consequence the cleanup in bringup_cpu() would be too late. Move the SCS/KASAN cleanup to the generic _cpu_up() function instead, which already ensures that the new CPU's stack is available, purely to allow for early failure. This occurs when the CPU to be brought up is in the CPUHP_OFFLINE state, which should correctly do the cleanup any time the CPU has been taken down to the point where such is needed. Signed-off-by: David Woodhouse Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Mark Rutland Tested-by: Mark Rutland Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205257.027075560@linutronix.de commit bc088f9a0d5bdf12bb18980739336dfcc092e55b Author: Thomas Gleixner Date: Fri May 12 23:07:41 2023 +0200 cpu/hotplug: Remove unused state functions All users converted to the hotplug core mechanism. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.972894276@linutronix.de commit 72b11aa7f8f93449141544cecb21b2963416902d Author: Thomas Gleixner Date: Fri May 12 23:07:40 2023 +0200 riscv: Switch to hotplug core state synchronization Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Acked-by: Palmer Dabbelt Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.916055844@linutronix.de commit 51e0efe1f26ec900ad80025b9faa2bec9575f1b2 Author: Thomas Gleixner Date: Fri May 12 23:07:38 2023 +0200 parisc: Switch to hotplug core state synchronization Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.859920443@linutronix.de commit c8d2bcc467c8a1a85983c24e0331cf19fe94668f Author: Thomas Gleixner Date: Fri May 12 23:07:37 2023 +0200 MIPS: SMP_CPS: Switch to hotplug core state synchronization Switch to the CPU hotplug core state tracking and synchronization mechanim. This unfortunately requires to add dead reporting to the non CPS platforms as CPS is the only user, but it allows an overall consolidation of this functionality. No functional change intended. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.803238859@linutronix.de commit 7202e979645715318f2f21a324cb8a506e12fa76 Author: Thomas Gleixner Date: Fri May 12 23:07:35 2023 +0200 csky/smp: Switch to hotplug core state synchronization Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.747254502@linutronix.de commit b3091f172fed63ee59d1746f088bdcc76a79a79c Author: Thomas Gleixner Date: Fri May 12 23:07:33 2023 +0200 arm64: smp: Switch to hotplug core state synchronization Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Mark Rutland Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.690926018@linutronix.de commit 5490e769cdc7230cb93e804e656cce19d6c82253 Author: Thomas Gleixner Date: Fri May 12 23:07:32 2023 +0200 ARM: smp: Switch to hotplug core state synchronization Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.635326070@linutronix.de commit 5356297d12d9ee6f70d09485878904bc41bac422 Author: Thomas Gleixner Date: Fri May 12 23:07:30 2023 +0200 cpu/hotplug: Remove cpu_report_state() and related unused cruft No more users. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.582584351@linutronix.de commit 2711b8e2b71fa3cce9c28b0f07b75882f141adfe Author: Thomas Gleixner Date: Fri May 12 23:07:29 2023 +0200 x86/smpboot: Switch to hotplug core state synchronization The new AP state tracking and synchronization mechanism in the CPU hotplug core code allows to remove quite some x86 specific code: 1) The AP alive synchronization based on cpumasks 2) The decision whether an AP can be brought up again Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.529657366@linutronix.de commit 6f0621238b7e7680d5e26c00aa4cd473314d05b2 Author: Thomas Gleixner Date: Fri May 12 23:07:27 2023 +0200 cpu/hotplug: Add CPU state tracking and synchronization The CPU state tracking and synchronization mechanism in smpboot.c is completely independent of the hotplug code and all logic around it is implemented in architecture specific code. Except for the state reporting of the AP there is absolutely nothing architecture specific and the sychronization and decision functions can be moved into the generic hotplug core code. Provide an integrated variant and add the core synchronization and decision points. This comes in two flavours: 1) DEAD state synchronization Updated by the architecture code once the AP reaches the point where it is ready to be torn down by the control CPU, e.g. by removing power or clocks or tear down via the hypervisor. The control CPU waits for this state to be reached with a timeout. If the state is reached an architecture specific cleanup function is invoked. 2) Full state synchronization This extends #1 with AP alive synchronization. This is new functionality, which allows to replace architecture specific wait mechanims, e.g. cpumasks, completely. It also prevents that an AP which is in a limbo state can be brought up again. This can happen when an AP failed to report dead state during a previous off-line operation. The dead synchronization is what most architectures use. Only x86 makes a bringup decision based on that state at the moment. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.476305035@linutronix.de commit ab24eb9abb9c60c45119370731735b79ed79f36c Author: Thomas Gleixner Date: Fri May 12 23:07:25 2023 +0200 x86/xen/hvm: Get rid of DEAD_FROZEN handling No point in this conditional voodoo. Un-initializing the lock mechanism is safe to be called unconditionally even if it was already invoked when the CPU died. Remove the invocation of xen_smp_intr_free() as that has been already cleaned up in xen_cpu_dead_hvm(). Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.423407127@linutronix.de commit 2de7fd26d90729c4e3430f9924b199dea810a9bc Author: Thomas Gleixner Date: Fri May 12 23:07:24 2023 +0200 x86/xen/smp_pv: Remove wait for CPU online Now that the core code drops sparse_irq_lock after the idle thread synchronized, it's pointless to wait for the AP to mark itself online. Whether the control CPU runs in a wait loop or sleeps in the core code waiting for the online operation to complete makes no difference. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.369512093@linutronix.de commit e464640cf7af12f3c2748065936b95eae1f735ba Author: Thomas Gleixner Date: Fri May 12 23:07:22 2023 +0200 x86/smpboot: Remove wait for cpu_online() Now that the core code drops sparse_irq_lock after the idle thread synchronized, it's pointless to wait for the AP to mark itself online. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.316417181@linutronix.de commit 22b612e2d53f6e13ce7b55ed565a104512f0eb00 Author: Thomas Gleixner Date: Fri May 12 23:07:21 2023 +0200 cpu/hotplug: Rework sparse_irq locking in bringup_cpu() There is no harm to hold sparse_irq lock until the upcoming CPU completes in cpuhp_online_idle(). This allows to remove cpu_online() synchronization from architecture code. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.263722880@linutronix.de commit c8b7fb09d1bcfa61d4211f61542e1291e7b4cbad Author: Thomas Gleixner Date: Fri May 12 23:07:19 2023 +0200 x86/smpboot: Remove cpu_callin_mask Now that TSC synchronization is SMP function call based there is no reason to wait for the AP to be set in smp_callin_mask. The control CPU waits for the AP to set itself in the online mask anyway. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.206394064@linutronix.de commit 9d349d47f0e39b4d1b68793ded2459daa1f948f0 Author: Thomas Gleixner Date: Fri May 12 23:07:17 2023 +0200 x86/smpboot: Make TSC synchronization function call based Spin-waiting on the control CPU until the AP reaches the TSC synchronization is just a waste especially in the case that there is no synchronization required. As the synchronization has to run with interrupts disabled the control CPU part can just be done from a SMP function call. The upcoming AP issues that call async only in the case that synchronization is required. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.148255496@linutronix.de commit d4f28f07c2fe736bce8ca415a86fb74c629200f3 Author: Thomas Gleixner Date: Fri May 12 23:07:16 2023 +0200 x86/smpboot: Move synchronization masks to SMP boot code The usage is in smpboot.c and not in the CPU initialization code. The XEN_PV usage of cpu_callout_mask is obsolete as cpu_init() not longer waits and cacheinfo has its own CPU mask now, so cpu_callout_mask can be made static too. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.091511483@linutronix.de commit a32226fa3b7d33d380494cf94cf1d4f8ebb70004 Author: Thomas Gleixner Date: Fri May 12 23:07:14 2023 +0200 x86/cpu/cacheinfo: Remove cpu_callout_mask dependency cpu_callout_mask is used for the stop machine based MTRR/PAT init. In preparation of moving the BP/AP synchronization to the core hotplug code, use a private CPU mask for cacheinfo and manage it in the starting/dying hotplug state. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.035041005@linutronix.de commit e94cd1503b153ea753f0c4ed9d5ed12e7abd1306 Author: Thomas Gleixner Date: Fri May 12 23:07:12 2023 +0200 x86/smpboot: Get rid of cpu_init_secondary() The synchronization of the AP with the control CPU is a SMP boot problem and has nothing to do with cpu_init(). Open code cpu_init_secondary() in start_secondary() and move wait_for_master_cpu() into the SMP boot code. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.981999763@linutronix.de commit 2b3be65d2e4f4bb9358b039b99ad1a391dd3c311 Author: David Woodhouse Date: Fri May 12 23:07:11 2023 +0200 x86/smpboot: Split up native_cpu_up() into separate phases and document them There are four logical parts to what native_cpu_up() does on the BSP (or on the controlling CPU for a later hotplug): 1) Wake the AP by sending the INIT/SIPI/SIPI sequence. 2) Wait for the AP to make it as far as wait_for_master_cpu() which sets that CPU's bit in cpu_initialized_mask, then sets the bit in cpu_callout_mask to let the AP proceed through cpu_init(). 3) Wait for the AP to finish cpu_init() and get as far as the smp_callin() call, which sets that CPU's bit in cpu_callin_mask. 4) Perform the TSC synchronization and wait for the AP to actually mark itself online in cpu_online_mask. In preparation to allow these phases to operate in parallel on multiple APs, split them out into separate functions and document the interactions a little more clearly in both the BP and AP code paths. No functional change intended. Signed-off-by: David Woodhouse Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.928917242@linutronix.de commit c7f15dd3f0e9f1d12d1ae21f0bbd61302ef3abcf Author: Thomas Gleixner Date: Fri May 12 23:07:09 2023 +0200 x86/smpboot: Remove unnecessary barrier() Peter stumbled over the barrier() after the invocation of smp_callin() in start_secondary(): "...this barrier() and it's comment seem weird vs smp_callin(). That function ends with an atomic bitop (it has to, at the very least it must not be weaker than store-release) but also has an explicit wmb() to order setup vs CPU_STARTING. There is no way the smp_processor_id() referred to in this comment can land before cpu_init() even without the barrier()." The barrier() along with the comment was added in 2003 with commit d8f19f2cac70 ("[PATCH] x86-64 merge") in the history tree. One of those well documented combo patches of that time which changes world and some more. The context back then was: /* * Dont put anything before smp_callin(), SMP * booting is too fragile that we want to limit the * things done here to the most necessary things. */ cpu_init(); smp_callin(); + /* otherwise gcc will move up smp_processor_id before the cpu_init */ + barrier(); Dprintk("cpu %d: waiting for commence\n", smp_processor_id()); Even back in 2003 the compiler was not allowed to reorder that smp_processor_id() invocation before the cpu_init() function call. Especially not as smp_processor_id() resolved to: asm volatile("movl %%gs:%c1,%0":"=r" (ret__):"i"(pda_offset(field)):"memory"); There is no trace of this change in any mailing list archive including the back then official x86_64 list discuss@x86-64.org, which would explain the problem this change solved. The debug prints are gone by now and the the only smp_processor_id() invocation today is farther down in start_secondary() after locking vector_lock which itself prevents reordering. Even if the compiler would be allowed to reorder this, the code would still be correct as GSBASE is set up early in the assembly code and is valid when the CPU reaches start_secondary(), while the code at the time when this barrier was added did the GSBASE setup in cpu_init(). As the barrier has zero value, remove it. Reported-by: Peter Zijlstra Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.875713771@linutronix.de commit cded367976587ed4d160ed7d6bb118992a8b82ab Author: Thomas Gleixner Date: Fri May 12 23:07:08 2023 +0200 x86/smpboot: Restrict soft_restart_cpu() to SEV Now that the CPU0 hotplug cruft is gone, the only user is AMD SEV. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.822234014@linutronix.de commit 5475abbde77f6d78a052a81e5d5de70e59f7181e Author: Thomas Gleixner Date: Fri May 12 23:07:06 2023 +0200 x86/smpboot: Remove the CPU0 hotplug kludge This was introduced with commit e1c467e69040 ("x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI") to eventually support physical hotplug of CPU0: "We'll change this code in the future to wake up hard offlined CPU0 if real platform and request are available." 11 years later this has not happened and physical hotplug is not officially supported. Remove the cruft. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.768845190@linutronix.de commit e59e74dc48a309cb848ffc3d76a0d61aa6803c05 Author: Thomas Gleixner Date: Fri May 12 23:07:04 2023 +0200 x86/topology: Remove CPU0 hotplug option This was introduced together with commit e1c467e69040 ("x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI") to eventually support physical hotplug of CPU0: "We'll change this code in the future to wake up hard offlined CPU0 if real platform and request are available." 11 years later this has not happened and physical hotplug is not officially supported. Remove the cruft. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.715707999@linutronix.de commit 666e1156b2c514f045827f50263ed2eb9d78671b Author: Thomas Gleixner Date: Fri May 12 23:07:03 2023 +0200 x86/smpboot: Rename start_cpu0() to soft_restart_cpu() This is used in the SEV play_dead() implementation to re-online CPUs. But that has nothing to do with CPU0. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.662319599@linutronix.de commit 134a12827bc59484c4d4a3ceabf178c831febbb8 Author: Thomas Gleixner Date: Fri May 12 23:07:01 2023 +0200 x86/smpboot: Avoid pointless delay calibration if TSC is synchronized When TSC is synchronized across sockets then there is no reason to calibrate the delay for the first CPU which comes up on a socket. Just reuse the existing calibration value. This removes 100ms pointlessly wasted time from CPU hotplug per socket. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.608773568@linutronix.de commit ba831b7b1a517ba7f25d6fa9736a8092d07b0c74 Author: Thomas Gleixner Date: Fri May 12 23:07:00 2023 +0200 cpu/hotplug: Mark arch_disable_smp_support() and bringup_nonboot_cpus() __init No point in keeping them around. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.551974164@linutronix.de commit 5107e3ebb868d99872e1b64b054ccfcdad79d5d7 Author: Thomas Gleixner Date: Fri May 12 23:06:58 2023 +0200 x86/smpboot: Cleanup topology_phys_to_logical_pkg()/die() Make topology_phys_to_logical_pkg_die() static as it's only used in smpboot.c and fixup the kernel-doc warnings for both functions. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.493750666@linutronix.de commit 60aebc9559492cea6a9625f514a8041717e3a2e4 Author: Huacai Chen Date: Mon Jul 4 09:17:04 2022 +0800 drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync Consider a configuration like this: 1, efifb (or simpledrm) is built-in; 2, a native display driver (such as radeon) is also built-in. As Javier said, this is not a common configuration (the native display driver is usually built as a module), but it can happen and cause some trouble. In this case, since efifb, radeon and sysfb are all in device_initcall() level, the order in practise is like this: efifb registered at first, but no "efi-framebuffer" device yet. radeon registered later, and /dev/fb0 created. sysfb_init() comes at last, it registers "efi-framebuffer" and then causes an error message "efifb: a framebuffer is already registered". Make sysfb_init() to be subsys_ initcall_sync() can avoid this. And Javier Martinez Canillas is trying to make a more general solution in commit 873eb3b11860 ("fbdev: Disable sysfb device registration when removing conflicting FBs"). However, this patch still makes sense because it can make the screen display as early as possible (We cannot move to subsys_initcall, since sysfb_init() should be executed after PCI enumeration). Reviewed-by: Javier Martinez Canillas Signed-off-by: Huacai Chen Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220704011704.1418055-1-chenhuacai@loongson.cn commit 225f37b578a9f6462afd46c976e31977f765c38b Author: Ranjani Sridharan Date: Mon May 15 14:20:22 2023 +0300 ASoC: SOF: ipc4-pcm: reset all pipelines during FE DAI hw_free Do not reset pipelines during the stop/suspend triggers in the BE DAI ops as the BE DAI pipeline needs to be left in the PAUSED state. It should only be reset during hw_free. This simplification is already done for the FE pipelines and the DAI trigger only toggles the states between PAUSED and RUNNING. But because the FE DAI hw_free is invoked first and all the pipelines are freed during this op, we need to make sure that the BE DAI pipeline also gets reset before it is freed. So do not skip the pipelines that have the skip_during_fe_trigger flag set when resetting pipelines. Also, because the pipeline state changes are split between the FE and BE DAI ops now, protect the BE DAI pipeline state changes with the pipeline_state_mutex as well. Signed-off-by: Ranjani Sridharan Date: Mon May 15 14:20:21 2023 +0300 ASoC: SOF: Intel: hda-dai-ops: Split the get_hext_stream() op for IPC4 Introduce a separate op implementation for get_hext_stream() for IPC4. This op will also be used to set the skip_during_fe_trigger flag for the BE DAI pipeline. With this change, we can remove the flag setting in sof_ipc4_dai_config() which will further simplify support for DMIC/SSP/Soundwire in the LunarLake platform. Signed-off-by: Ranjani Sridharan Date: Fri May 12 14:42:25 2023 +0800 ASoC: SOF: Simplify the calculation of variables ./sound/soc/sof/pcm.c:372:27-29: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot Date: Fri May 12 13:56:42 2023 +0300 ASoC: SOF: ipc4-topology: Use set_get_data() to send LARGE_CONFIG message Instead of open coding the sending of sink format of the copier with LARGE_CONFIG_SET message, use the proper function to do so. Signed-off-by: Peter Ujfalusi Date: Fri May 12 13:17:02 2023 -0500 ASoC: SOF: Intel: remove mutual exclusion between NOCODEC and HDA_LINK The nocodec mode served two purposes so far a) generate a test driver for DMIC/SSP without any codec connected b) make sure the use of snd_hdac_ libraries was contained b) is no longer an option for LunarLake, the HDaudio DMA is used for DMIC/SSP and the HDA_LINK option needs to be enabled. Signed-off-by: Pierre-Louis Bossart Date: Fri May 12 13:17:01 2023 -0500 ASoC: SOF: Intel: hda-dai: use HDA_LINK instead of HDA_AUDIO_CODEC For LunarLake support, we will have to use HDAudio DMA-based DAIs even for SSP/DMIC/SoundWire. That's completely different to the HDA_AUDIO_CODEC, the DAI ops deal with DMA configuration and that can happen in the absence of any HDAudio codec. Signed-off-by: Pierre-Louis Bossart Date: Fri May 12 13:17:00 2023 -0500 ASoC: SOF: Intel: hda-dai: mark functions as __maybe_unused hda_dai_hw_params, hda_dai_trigger(), hda_dai_hw_free are currently only used for HDaudio codec support, but will be reused for SSP/DMIC/SoundWire in the LunarLake/ACE2.x case. To avoid 'defined but not used' errors or added complexity in Kconfig, mark all these functions as __maybe_used. When SSP/DMIC/SoundWire are added, some of these changes may be reverted. For now this avoids compilation warnings. Signed-off-by: Pierre-Louis Bossart Date: Wed May 3 07:22:08 2023 +0800 fs: fix incorrect fmode_t casts Use __FMODE_NONOTIFY instead of FMODE_NONOTIFY to fixes the following sparce warnings: fs/overlayfs/file.c:48:37: sparse: warning: restricted fmode_t degrades to integer fs/overlayfs/file.c:128:13: sparse: warning: restricted fmode_t degrades to integer fs/open.c:1159:21: sparse: warning: restricted fmode_t degrades to integer Signed-off-by: Min-Hua Chen Message-Id: <20230502232210.119063-1-minhuadotchen@gmail.com> Signed-off-by: Christian Brauner commit caf7ad845e90f8ac29d7342bea6d9f1fc392c953 Author: Pierre-Louis Bossart Date: Fri May 12 13:16:59 2023 -0500 ASoC: SOF: Intel: hda-dai: move hda_dai_prepare() code Before we change the Kconfig support, move code around. No functionality change with this commit in isolation. Signed-off-by: Pierre-Louis Bossart Date: Fri May 12 13:16:58 2023 -0500 ASoC: SOF: Intel: Kconfig: move selection of PROBE_WORK_QUEUE The probe workqueue is only needed if we have a Display Audio codec. Signed-off-by: Pierre-Louis Bossart Date: Fri May 12 13:16:57 2023 -0500 ASoC: SOF: Intel: clarify initialization when HDA_AUDIO_CODEC is not used For LunarLake support, we need to enable HDA_LINK but we also want the ability to remove HDaudio codec support, e.g. for 'nocodec' tests. This requires a small change in the bus initialization without any codec-specific callbacks provided. Signed-off-by: Pierre-Louis Bossart Date: Fri May 12 13:16:56 2023 -0500 ASoC: SOF: Intel: fix DAI number mismatch The number of DAIs was based on a Kconfig option and the declaration on another. Fix before changing the dependencies. Signed-off-by: Pierre-Louis Bossart Date: Fri May 12 13:16:55 2023 -0500 ASoC: SOF: Intel: hda-dai: remove use of cpu_dai->component drvdata The existing code relies on conversions from cpu_dai to the sdev structure pointer based on the cpu_dai component. This works fine for HDaudio but will not work for SoundWire DAIs which are registered by a different component. That's a problem preventing reuse of the HDaudio DMA stream allocation for SoundWire DAIs starting with the LunarLake platform. This patch introduces a set of helpers to perform the conversion, and an indirect way of retrieving the sdev pointer based on the swidget->comp intermediate pointer. Suggested-by: Ranjani Sridharan Date: Fri May 12 13:16:54 2023 -0500 ASoC: SOF: Intel: hda-dai: simplify .prepare callback The code has been cleaned-up multiple times, but while adding the new abstractions for DMIC/SSP/SoundWire it appears that we don't really need a specific sequence for .prepare, and we can reuse what .hw_params already does. Signed-off-by: Pierre-Louis Bossart Date: Mon May 15 13:33:36 2023 +0300 ASoC: SOF: ipc4-topology: Modify input audio format selection logic The current selection logic assumes that input and output formats always come in pairs in topology. Handle this special case by checking if all input formats are the same. And for the case where there are multiple supported input audio formats, modify the selection logic to pick the audio formats based on the reference params which is either the FE hw_params or the pipeline params based on the type of module. Signed-off-by: Ranjani Sridharan Date: Mon May 15 13:33:35 2023 +0300 ASoC: SOF: ipc4-topology: New helper to check if all output formats are the same Add a helper function to check if all formats are identical. Signed-off-by: Ranjani Sridharan Date: Mon May 15 13:33:34 2023 +0300 ASoC: SOF: ipc4-topology: Modify the output format selection logic Modify the output format selection when there are multiple output formats available to choose the one that matches the reference params. The reference params depend on the type of module. In the case of processing modules, the reference params are based on the selected input audio format. This would be the case when a processing module does not perform any format conversion during processing. The only special case is the copier module. The copier module is capable of format conversion but it is only used in the case when the output is fixed to a single format. In the case of a module copier, when there are multiple formats, the reference params is based on the selected input params and the output format must match that of the selected input format. In the case of host copier, the reference params should be based on the input audio format for playback and the FE hw_params for capture. In the case DAI copier, the reference params should be based on the input audio format for capture and the FE hw_params for playback when there is no format conversion in the pipeline from the host to the DAI. Signed-off-by: Ranjani Sridharan Date: Mon May 15 13:33:33 2023 +0300 ASoC: SOF: ipc4-topology: Add a new helper function to get the valid bits Add a new helper function sof_ipc4_get_valid_bits() to get the valid bits in the PCM params. Signed-off-by: Ranjani Sridharan Date: Mon May 15 13:33:32 2023 +0300 ASoC: SOF: ipc4-topology: Handle output format special case The current topologies have input/output formats in pairs and even though there are multiple output formats, they are all the same. Handle this case as if there were only one format in topology. Also, add a check for the number of output formats and reports errors where applicable. Signed-off-by: Ranjani Sridharan Date: Mon May 15 13:33:31 2023 +0300 ASoC: SOF: ipc4-topology: Rename sof_ipc4_init_audio_fmt() Rename it to sof_ipc4_init_input_audio_fmt() as it only does input format selection now. Signed-off-by: Ranjani Sridharan Date: Mon May 15 13:33:30 2023 +0300 ASoC: SOF: ipc4-topology: Move the call to init output format In preparation for changing the logic for input/output format selection, move the call to sof_ipc4_init_output_audio_fmt() into the individual widget prepare ops. Signed-off-by: Ranjani Sridharan Date: Mon May 15 13:33:29 2023 +0300 ASoC: SOF: ipc4-topology: Add a helper function for output format selection Add a helper function to select the output format. Signed-off-by: Ranjani Sridharan Date: Mon May 15 13:33:28 2023 +0300 ASoC: SOF: ipc4-topology: Handle input/output audio format special case When there is only one input/output format specified in topology, there is no need to search for a matching format, simply pick the available one. This is in preparation to modify and split the selection logic for the input and output audio formats. Signed-off-by: Ranjani Sridharan Date: Fri May 12 12:33:05 2023 -0500 ASoC: Intel: sof_sdw: add quirk for LNL RVP We should use RT711_JD2_100K for on board rt711 Signed-off-by: Peter Ujfalusi Date: Fri May 12 12:33:04 2023 -0500 ASoC: Intel: soc-acpi: add tables for LunarLake These tables are used for 'nocodec' and SoundWire mockups+RVP tests. The LNL RVP has a single rt711-sdca SoundWire codec. Co-developed-by: Peter Ujfalusi Date: Fri May 12 12:33:03 2023 -0500 ASoC: Intel: sof_sdw: add new mapping for HP Spectre x360 A BIOS/DMI update seems to have broken some devices, let's add a new mapping. Link: https://github.com/thesofproject/linux/issues/4323 Signed-off-by: Pierre-Louis Bossart Date: Fri May 12 12:33:02 2023 -0500 ASoC: Intel: sof_sdw: start set codec init function with an adr index Currently, set_codec_init_func always start with link->adr_d[0] because we assumed all adr_d on the same link are the same devices. The assumption is no longer valid when different devices on the same sdw link are supported. Fixes: c8db7b50128b ("ASoC: Intel: sof_sdw: support different devices on the same sdw link") Signed-off-by: Bard Liao Date: Fri May 12 12:33:01 2023 -0500 ASoC: Intel: soc-acpi: add support for MTL SDCA boards The description and board layout is changed and different from previous ones for CometLake and Tigerlake. The new codec layout for MTL is: SDW0: RT711 Headphone SDW1: RT714 DMIC SDW2: RT1316 Speaker SDW3: RT1316 Speaker The previous codec layout for CML and TGL is: SDW0: RT711 Headphone SDW1: RT1316 Speaker SDW2: RT1316 Speaker SDW3: RT714 DMIC Signed-off-by: Chao Song Date: Fri May 12 12:33:00 2023 -0500 ASoC: Intel: sof_sdw: add quirk for MTL RVP We should use RT711_JD2_100K for on board rt711. Signed-off-by: Bard Liao Date: Fri May 12 12:32:59 2023 -0500 ASoC: Intel: sof_sdw: remove SOF_SDW_TGL_HDMI for MeteorLake devices Topologies support three HDMI links on MeteorLake devices only. Fixes: 18489174e4fb ("ASoC: intel: sof_sdw: add RT711 SDCA card for MTL platform") Signed-off-by: Bard Liao Date: Fri May 12 12:32:58 2023 -0500 ASoC: Intel: Add rpl_max98373_8825 driver Boards were using this in older kernels before adl and rpl ids were split. Add this back to maintain support. Signed-off-by: Terry Cheong Date: Fri May 12 13:28:32 2023 +0100 ASoC: wm_adsp: Update to use new component control notify helepr Signed-off-by: Charles Keepax Date: Fri May 12 13:28:31 2023 +0100 ASoC: ak4118: Update to use new component control notify helper Update the driver to use the new ASoC core control notify helper. This also fixes a bug where the control would not be found if the CODEC was given a name prefix. Signed-off-by: Charles Keepax Date: Fri May 12 13:28:30 2023 +0100 ASoC: soc-component: Add notify control helper function Add a function to allow ASoC drivers to easily notify an ALSA control change. This function will automatically add any component naming prefix into the control name. Signed-off-by: Charles Keepax Date: Wed May 10 11:55:26 2023 +0800 ASoC: dt-bindings: mediatek,mt8188-afe: add audio properties Add apll1_d4 to clocks for switching the parent of top_a1sys_hp dynamically and add property "mediatek,infracfg" for bus protection. Because no mt8188 upstream dts exists, the change won't break anything. In addition, apll2_d4, apll12_div4, top_a2sys and top_aud_iec are also included in clocks, because these clocks are possibly used in the future. Signed-off-by: Trevor Wu Date: Wed May 10 11:55:25 2023 +0800 ASoC: dt-bindings: mediatek,mt8188-afe: correct clock name The original clock names are different from the list in driver code. Correct the mismatched binding names in the patch. Because no mt8188 upstream dts exists, it doesn't affect the existing dts file. Fixes: 692d25b67e10 ("ASoC: dt-bindings: mediatek,mt8188-afe: add audio afe document") Signed-off-by: Trevor Wu Date: Wed May 10 11:55:24 2023 +0800 ASoC: mediatek: mt8188: add required clocks apll2_d4, apll12_div4, top_a2sys and top_aud_iec are possibly used in the future. To prevent from breaking binding ABI after any mt8188 dts upstream, add these clocks to clock list in advance. Signed-off-by: Trevor Wu Date: Wed May 10 11:55:23 2023 +0800 ASoC: mediatek: mt8188: add bus protection Add bus protection for reset controller. Signed-off-by: Trevor Wu Date: Wed May 10 11:55:22 2023 +0800 ASoC: mediatek: mt8188: combine afe component registration There is no benefit to separate two components for AFE, so DAI driver registration is moved to dev_snd_soc_register_component to merge these two components. Signed-off-by: Trevor Wu Date: Wed May 10 11:55:21 2023 +0800 ASoC: mediatek: mt8188: refine APLL control Currently, APLL is only used in ETDM module, so APLL and APLL tuner don't need to be enabled when AFE is used. Integrate APLL control into ETDM DAPM routes, so that APLL can be enabled when it is really required. Signed-off-by: Trevor Wu Date: Wed May 10 11:55:20 2023 +0800 ASoC: mediatek: mt8188: revise ETDM control flow Replace register controls in snd_soc_dai_ops with snd_soc_dapm_widgets. startup, shutdown and trigger ops are removed, and create DAPM_SUPPLY to handle mclk, clock gating and etdm enabling. Additionally, mclk setup sequence is also updated because of new supply enabling sequence. Signed-off-by: Trevor Wu Date: Wed May 10 11:55:19 2023 +0800 ASoC: mediatek: mt8188: complete set_tdm_slot function User can configures slot number of TDM mode via set_tdm_slot callback. Signed-off-by: Trevor Wu Date: Wed May 10 11:55:18 2023 +0800 ASoC: mediatek: mt8188: remove supply AUDIO_HIRES AUDIO_HIRES is not required in MT8188. Because top_audio_h is disabled when hires clock is not used, set_parent is a redundant operation. Signed-off-by: Trevor Wu Date: Fri May 12 13:14:20 2023 +0900 ASoC: Merge up fixes for CI Avoid tripping over fixed issues in CI. commit 1168f095417643f663caa341211e117db552989f Author: Fabian Frederick Date: Sat May 6 06:56:12 2023 +0200 jffs2: reduce stack usage in jffs2_build_xattr_subsystem() Use kcalloc() for allocation/flush of 128 pointers table to reduce stack usage. Function now returns -ENOMEM or 0 on success. stackusage Before: ./fs/jffs2/xattr.c:775 jffs2_build_xattr_subsystem 1208 dynamic,bounded After: ./fs/jffs2/xattr.c:775 jffs2_build_xattr_subsystem 192 dynamic,bounded Also update definition when CONFIG_JFFS2_FS_XATTR is not enabled Tested with an MTD mount point and some user set/getfattr. Many current target on OpenWRT also suffer from a compilation warning (that become an error with CONFIG_WERROR) with the following output: fs/jffs2/xattr.c: In function 'jffs2_build_xattr_subsystem': fs/jffs2/xattr.c:887:1: error: the frame size of 1088 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] 887 | } | ^ Using dynamic allocation fix this compilation warning. Fixes: c9f700f840bd ("[JFFS2][XATTR] using 'delete marker' for xdatum/xref deletion") Reported-by: Tim Gardner Reported-by: kernel test robot Reported-by: Ron Economos Reported-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Fabian Frederick Signed-off-by: Christian Marangi Cc: stable@vger.kernel.org Message-Id: <20230506045612.16616-1-ansuelsmth@gmail.com> Signed-off-by: Christian Brauner commit 55650b2fddb958e42036c5b07ed82983ce532865 Author: Anuradha Weeraman Date: Sat May 6 23:59:27 2023 +0530 fs/open.c: Fix W=1 kernel doc warnings fs/open.c: In functions 'setattr_vfsuid' and 'setattr_vfsgid': warning: Function parameter or member 'attr' not described - Fix warning by removing kernel-doc for these as they are static inline functions and not required to be exposed via kernel-doc. fs/open.c: warning: Excess function parameter 'opened' description in 'finish_open' warning: Excess function parameter 'cred' description in 'vfs_open' - Fix by removing the parameters from the kernel-doc as they are no longer required by the function. Signed-off-by: Anuradha Weeraman Message-Id: <20230506182928.384105-1-anuradha@debian.org> Signed-off-by: Christian Brauner commit d1e4632b304c594d6f0d4cb7581350e5a6fc33b7 Author: Yang Li Date: Mon May 15 16:56:45 2023 +0800 octeontx2-pf: mcs: Remove unneeded semicolon ./drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c:242:2-3: Unneeded semicolon ./drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c:476:2-3: Unneeded semicolon Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4947 Signed-off-by: Yang Li Signed-off-by: David S. Miller commit 621b6783c73100067c844c3be0b254c2f350e8ec Author: Ashutosh Dixit Date: Fri May 12 13:37:35 2023 -0700 drm/i915/hwmon: Silence UBSAN uninitialized bool variable warning Loading i915 on UBSAN enabled kernels (CONFIG_UBSAN/CONFIG_UBSAN_BOOL) causes the following warning: UBSAN: invalid-load in drivers/gpu/drm/i915/gt/uc/intel_uc.c:558:2 load of value 255 is not a valid value for type '_Bool' Call Trace: dump_stack_lvl+0x57/0x7d ubsan_epilogue+0x5/0x40 __ubsan_handle_load_invalid_value.cold+0x43/0x48 __uc_init_hw+0x76a/0x903 [i915] ... i915_driver_probe+0xfb1/0x1eb0 [i915] i915_pci_probe+0xbe/0x2d0 [i915] The warning happens because during probe i915_hwmon is still not available which results in the output boolean variable *old remaining uninitialized. Silence the warning by initializing the variable to an arbitrary value. v2: Move variable initialization to the declaration (Andi) Signed-off-by: Ashutosh Dixit Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230512203735.2635237-1-ashutosh.dixit@intel.com commit c515a4443cb8c8802751223b13855d1575db8cad Author: Anup Sharma Date: Sat May 13 16:36:54 2023 +0530 net: ethernet: microchip: vcap: Remove extra semicolon Remove the extra semicolon at end. Issue identified using semicolon.cocci Coccinelle semantic patch. drivers/net/ethernet/microchip/vcap/vcap_api.c:1124:3-4: Unneeded semicolon drivers/net/ethernet/microchip/vcap/vcap_api.c:1165:3-4: Unneeded semicolon drivers/net/ethernet/microchip/vcap/vcap_api.c:1239:3-4: Unneeded semicolon drivers/net/ethernet/microchip/vcap/vcap_api.c:1287:3-4: Unneeded semicolon Signed-off-by: Anup Sharma Changes: V1 -> V2: Target tree included in the subject line. Signed-off-by: David S. Miller commit 6b9bd7c35d32be464591ba704a80ab2db4f2ea4a Author: Jani Nikula Date: Fri May 12 21:16:58 2023 +0300 drm/i915/display: add i915 parameter to I915_STATE_WARN() Add i915 parameter to I915_STATE_WARN() and use device based logging. Done using cocci + hand edited where there was no i915 local variable ready. v2: avoid null deref in verify_connector_state() Reviewed-by: Rodrigo Vivi Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230512181658.1735594-1-jani.nikula@intel.com commit b8e6185bcf5cf41c0195d496bbfe48e5f0ffb3a6 Author: Jani Nikula Date: Fri May 12 14:04:43 2023 +0300 drm/i915/display: remove I915_STATE_WARN_ON() Remove the unused macro. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230512110444.1448231-3-jani.nikula@intel.com commit fe735c34ef06a1d08218569370875967e337608f Author: Jani Nikula Date: Fri May 12 14:04:42 2023 +0300 drm/i915/crtc: replace I915_STATE_WARN_ON() with I915_STATE_WARN() Describe the assertion better. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230512110444.1448231-2-jani.nikula@intel.com commit a44bebf6afa8114c1bf0f69f5623b7394737a0c8 Author: Jani Nikula Date: Fri May 12 14:04:41 2023 +0300 drm/i915/dpll: drop a useless I915_STATE_WARN_ON() In general, we don't do assertions that a function gets called on the right platforms, and if we did, it should not be a state warn. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230512110444.1448231-1-jani.nikula@intel.com commit 11a3b0ac33d95aa84be426e801f800997262a225 Author: Christoph Niedermaier Date: Fri May 12 17:07:11 2023 +0200 cpufreq: imx6q: don't warn for disabling a non-existing frequency It is confusing if a warning is given for disabling a non-existent frequency of the operating performance points (OPP). In this case the function dev_pm_opp_disable() returns -ENODEV. Check the return value and avoid the output of a warning in this case. Avoid code duplication by using a separate function. Signed-off-by: Christoph Niedermaier [ Viresh : Updated commit subject ] Signed-off-by: Viresh Kumar commit f2eb43f0b8c25e58b299ae2593d805c35c98f82f Author: Juha-Pekka Heikkila Date: Sun May 14 21:42:40 2023 +0300 drm/i915/mtl: Add handling for MTL ccs modifiers Add Tile4 ccs modifiers w/ auxbuffer handling Implement Wa_14017240301 Bspec: 49251, 49252, 49253 Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Matt Atwood Reviewed-by: Mika Kahola Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230514184240.6184-2-juhapekka.heikkila@gmail.com commit c7c12de893f808bd7c1215fe9056262295e5203b Author: Juha-Pekka Heikkila Date: Sun May 14 21:42:39 2023 +0300 drm/fourcc: define Intel Meteorlake related ccs modifiers Add Tile4 type ccs modifiers with aux buffer needed for MTL Bspec: 49251, 49252, 49253 Cc: dri-devel@lists.freedesktop.org Cc: Jani Nikula Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Matt Atwood Acked-by: Thomas Zimmermann Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230514184240.6184-1-juhapekka.heikkila@gmail.com commit cb9a39aacd3d6387b6f1f178a96eadceba90454e Author: Wolfram Sang Date: Wed Apr 19 22:15:11 2023 +0200 soc: renesas: rcar-rst: Allow WDT reset on R-Car V3U V3U firmware misses to enable WDT resets. Because there won't be any updates to the firmware anymore, enable that in Linux. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230419201511.31648-1-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 3f1e1ad9230f8b1c415b432841db2b2850450fd4 Author: Geert Uytterhoeven Date: Wed May 10 09:56:43 2023 +0200 ARM: shmobile: defconfig: Refresh for v6.4-rc1 Refresh the defconfig for Renesas ARM systems: - Move CONFIG_PCI_RCAR_GEN2=y (moved in commit 81c362e798d41592 ("PCI: Sort controller Kconfig entries by vendor")), - Drop CONFIG_SERIAL_8250_PCI1XXXX=n (no longer auto-enabled since commit 5d943b5d69c032de ("serial: 8250_pci1xxxx: Disable SERIAL_8250_PCI1XXXX config by default")). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/420669d925bf4a8527c80dd294568df3b0556058.1683705341.git.geert+renesas@glider.be commit 57f1915fc746315880ce28520134812d7035abd2 Merge: b2cbac9b9b287 efe103065ccb4 Author: David S. Miller Date: Mon May 15 09:31:08 2023 +0100 Merge branch 'octeontx2-pf-HTB' Hariprasad Kelam says: ==================== octeontx2-pf: HTB offload support octeontx2 silicon and CN10K transmit interface consists of five transmit levels starting from MDQ, TL4 to TL1. Once packets are submitted to MDQ, hardware picks all active MDQs using strict priority, and MDQs having the same priority level are chosen using round robin. Each packet will traverse MDQ, TL4 to TL1 levels. Each level contains an array of queues to support scheduling and shaping. As HTB supports classful queuing mechanism by supporting rate and ceil and allow the user to control the absolute bandwidth to particular classes of traffic the same can be achieved by configuring shapers and schedulers on different transmit levels. This series of patches adds support for HTB offload, Patch1: Allow strict priority parameter in HTB offload mode. Patch2: Rename existing total tx queues for better readability Patch3: defines APIs such that the driver can dynamically initialize/ deinitialize the send queues. Patch4: Refactors transmit alloc/free calls as preparation for QOS offload code. Patch5: moves rate limiting logic to common header which will be used by qos offload code. Patch6: Adds actual HTB offload support. Patch7: exposes qos send queue stats over ethtool. Patch8: Add documentation about htb offload flow in driver ==================== Signed-off-by: David S. Miller commit efe103065ccb4984c094d1547d71d498129cdd89 Author: Hariprasad Kelam Date: Sat May 13 14:21:43 2023 +0530 docs: octeontx2: Add Documentation for QOS Add QOS example configuration along with tc-htb commands Signed-off-by: Hariprasad Kelam Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 6cebb6a4b114783af5f4747ffe3ec87d94eccf52 Author: Hariprasad Kelam Date: Sat May 13 14:21:42 2023 +0530 octeontx2-pf: ethtool expose qos stats This patch extends ethtool stats support for QoS send queues as well. upon the number of transmit channels change request, Ensures the real number of transmit queues are equal to active QoS send queues plus configured transmit queues. ethtool -S eth0 txq_qos0: bytes: 3021391800 txq_qos0: frames: 1998275 txq_qos1: bytes: 4619766312 txq_qos1: frames: 3055401 ... ... Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit 5e6808b4c68d7882971514ab3279926eb07c8b2d Author: Naveen Mamindlapalli Date: Sat May 13 14:21:41 2023 +0530 octeontx2-pf: Add support for HTB offload This patch registers callbacks to support HTB offload. Below are features supported, - supports traffic shaping on the given class by honoring rate and ceil configuration. - supports traffic scheduling, which prioritizes different types of traffic based on strict priority values. - supports the creation of leaf to inner classes such that parent node rate limits apply to all child nodes. Signed-off-by: Naveen Mamindlapalli Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit cb748a7ebad79b35a4cb652c2148fbebdcd860f3 Author: Hariprasad Kelam Date: Sat May 13 14:21:40 2023 +0530 octeontx2-pf: Prepare for QOS offload This patch moves rate limiting definitions to a common header file and adds csr definitions required for QOS code. Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit 6b4b2ded9c4282deea421eef144ab0ced954721c Author: Hariprasad Kelam Date: Sat May 13 14:21:39 2023 +0530 octeontx2-pf: Refactor schedular queue alloc/free calls 1. Upon txschq free request, the transmit schedular config in hardware is not getting reset. This patch adds necessary changes to do the same. 2. Current implementation calls txschq alloc during interface initialization and in response handler updates the default txschq array. This creates a problem for htb offload where txsch alloc will be called for every tc class. This patch addresses the issue by reading txschq response in mbox caller function instead in the response handler. 3. Current otx2_txschq_stop routine tries to free all txschq nodes allocated to the interface. This creates a problem for htb offload. This patch introduces the otx2_txschq_free_one to free txschq in a given level. Signed-off-by: Hariprasad Kelam Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit ab6dddd2a669a0ecc2ce07485c7a15fadbb5a0aa Author: Subbaraya Sundeep Date: Sat May 13 14:21:38 2023 +0530 octeontx2-pf: qos send queues management Current implementation is such that the number of Send queues (SQs) are decided on the device probe which is equal to the number of online cpus. These SQs are allocated and deallocated in interface open and c lose calls respectively. This patch defines new APIs for initializing and deinitializing Send queues dynamically and allocates more number of transmit queues for QOS feature. Signed-off-by: Subbaraya Sundeep Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham Reviewed-by: Simon Horman Reviewed-by: Jacob Keller Signed-off-by: David S. Miller commit 508c58f76ca510956625c945f9b8eb104f2c8208 Author: Hariprasad Kelam Date: Sat May 13 14:21:37 2023 +0530 octeontx2-pf: Rename tot_tx_queues to non_qos_queues current implementation is such that tot_tx_queues contains both xdp queues and normal tx queues. which will be allocated in interface open calls and deallocated on interface down calls respectively. With addition of QOS, where send quees are allocated/deallacated upon user request Qos send queues won't be part of tot_tx_queues. So this patch renames tot_tx_queues to non_qos_queues. Signed-off-by: Hariprasad Kelam Reviewed-by: Simon Horman Reviewed-by: Jacob Keller Signed-off-by: David S. Miller commit 12e7789ad5b476e945aba8edb1161c633cb7db31 Author: Naveen Mamindlapalli Date: Sat May 13 14:21:36 2023 +0530 sch_htb: Allow HTB priority parameter in offload mode The current implementation of HTB offload returns the EINVAL error for unsupported parameters like prio and quantum. This patch removes the error returning checks for 'prio' parameter and populates its value to tc_htb_qopt_offload structure such that driver can use the same. Add prio parameter check in mlx5 driver, as mlx5 devices are not capable of supporting the prio parameter when htb offload is used. Report error if prio parameter is set to a non-default value. Signed-off-by: Naveen Mamindlapalli Co-developed-by: Rahul Rameshbabu Signed-off-by: Rahul Rameshbabu Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham Reviewed-by: Simon Horman Reviewed-by: Jacob Keller Signed-off-by: David S. Miller commit 3631c363b7c1d203a84d35e1f3d76160d8bd1961 Author: Jani Nikula Date: Fri May 12 14:14:46 2023 +0300 drm/i915/bios: add helper for reading SPI Add helper for reading SPI to not duplicate the write&read combo everywhere. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230512111446.1524038-1-jani.nikula@intel.com commit e5cfa586d5131979feed2820dee18689a4075e64 Author: Russell King Date: Sat May 13 11:21:24 2023 +0100 ARM: dts: armada388-clearfog: add missing phy-modes The DSA framework has got more picky about always having a phy-mode, particularly for the CPU port. Add the missing phy-mode properties for every port which does not have an integrated PHY. Add a phy-mode property to the ethernet interface facing the switch as this was configured using SGMII - as the switch is actually using 1000base-x, let's have some consistency between the two link partners. Additionally, the cpu label has never actually been used in the binding, so remove it. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit b2cbac9b9b28730e9e53be20b6cdf979d3b9f27e Author: Angus Chen Date: Fri May 12 09:01:52 2023 +0800 net: Remove low_thresh in ip defrag As low_thresh has no work in fragment reassembles,del it. And Mark it deprecated in sysctl Document. Signed-off-by: Angus Chen Signed-off-by: David S. Miller commit c642256b91770e201519d037a91f255a617a4602 Author: Azeem Shaikh Date: Wed May 10 22:11:19 2023 +0000 vfs: Replace all non-returning strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Message-Id: <20230510221119.3508930-1-azeemshaikh38@gmail.com> Signed-off-by: Christian Brauner commit 6d4ff8aed3b3f3afe12b40ff7e48815fc9688889 Merge: befcc1fce564b 8130e94e888bf Author: David S. Miller Date: Mon May 15 08:37:17 2023 +0100 Merge tag 'wireless-next-2023-05-12' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle valo says: ==================== wireless-next patches for v6.5 The first pull request for v6.5 and only driver changes this time. rtl8xxxu has been making lots of progress lately and now has AP mode support. Major changes: rtl8xxxu * AP mode support, initially only for rtl8188f rtw89 * provide RSSI, EVN and SNR statistics via debugfs * support U-NII-4 channels on 5 GHz band ==================== Signed-off-by: David S. Miller commit 38f1755a3e59a3f88e33030f8e4ee0421de2f05a Author: Min-Hua Chen Date: Fri May 12 00:46:25 2023 +0800 fs: use correct __poll_t type Fix the following sparse warnings by using __poll_t instead of unsigned type. fs/eventpoll.c:541:9: sparse: warning: restricted __poll_t degrades to integer fs/eventfd.c:67:17: sparse: warning: restricted __poll_t degrades to integer Signed-off-by: Min-Hua Chen Message-Id: <20230511164628.336586-1-minhuadotchen@gmail.com> Signed-off-by: Christian Brauner commit 6986f05b557bf1efea5bac8dbdffb7ee89d0cf77 Author: Suraj Kandpal Date: Fri May 5 09:45:12 2023 +0530 drm/i915/hdcp: Check if media_gt exists Check if media_gt exists if we are using gsc cs --v2 -correct typo [Ankit] -assign gsc variable if gt exists [Ankit] --v3 -declare gsc and gt variables in if block [Ankit] --v4 -add fixes tag [Ankit] Fixes: 883631771038 ("drm/i915/mtl: Add HDCP GSC interface") Cc: Tomas Winkler Cc: Rodrigo Vivi Cc: Uma Shankar Cc: Anshuman Gupta Cc: Ankit Nautiyal Signed-off-by: Suraj Kandpal Reviewed-by: Gustavo Sousa Reviewed-by: Ankit Nautiyal Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230505041512.585486-1-suraj.kandpal@intel.com commit 8bc27fa5d7763d376a992a1638475987ed4807e7 Author: Mauro Carvalho Chehab Date: Mon May 15 06:43:43 2023 +0100 docs: uapi: media: ignore new DVB-S2X FEC values Some new FEC values was added to support DVB-S2X. They're properly documented, but its addition adds some extra warnings to htmldocs build. So, add them to the ignore list. Fixes: 1825788e2a96 ("media: dvb: add missing DVB-S2X FEC parameter values") Reported-by: Stephen Rothwell Signed-off-by: Mauro Carvalho Chehab commit 2cbf475a04b2ae3d722bbe41742e5d874a027fc3 Author: Rob Barnes Date: Tue May 9 23:26:24 2023 +0000 platform/chrome: cros_ec: Report EC panic as uevent Create a uevent when an EC panic is detected. This will allow udev rules to trigger when a panic occurs. For example, a udev rule could be added to capture an EC coredump. This approach avoids the need to stuff all the processing into the driver. Signed-off-by: Rob Barnes Reviewed-by: Prashant Malani Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20230509232624.3120347-1-robbarnes@google.com commit cbd3ef64eb9d1be9ec647411547bc7bb8409b11f Author: Himanshu Bhavani Date: Sat May 13 17:01:24 2023 +0530 arm64: dts: Add support for Emtop SoM & Baseboard Add device tree support for the i.MX8MM Based Emtop SOM-IMX8MMLPD4 (V1) and IMX8M Mini Baseboard (V1). Currently supported are serial console, eMMC. Signed-off-by: Himanshu Bhavani Signed-off-by: Shawn Guo commit b954d70abe528112aaac31eaf7c65ebd6a982790 Author: Peng Fan Date: Wed May 10 16:31:53 2023 +0800 arm64: dts: imx93-11x11-evk: enable wdog3 Enable wdog3 to support watchdog feature Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit afbd37e878244a3f4d167cb405cd38300592e0b4 Author: Peng Fan Date: Wed May 10 16:31:52 2023 +0800 arm64: dts: imx93: add cpuidle node Add cpuidle node to support cpu idle. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit f2d03ba997cb5370060874f03e4c61c18bdf6a54 Author: Peng Fan Date: Wed May 10 16:31:51 2023 +0800 arm64: dts: imx93: reorder device nodes Reorder device nodes per address - Move eqos node after fec node - Move mediamix node after mlmix node Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 5a866baab1e0254ac8922c7598df48f2c12e86d8 Author: Peng Fan Date: Wed May 10 16:31:50 2023 +0800 arm64: dts: imx93: add ocotp node Add i.MX93 OCOTP node Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 84e29d79be2d5ced59816f458609b7d0c393e89c Author: Peng Fan Date: Wed May 10 16:31:49 2023 +0800 arm64: dts: imx93: add watchdog node Add watchdog[1-5] nodes Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 50552fa6ec91531634f29f9f89e09195ba5bfbbc Author: Himanshu Bhavani Date: Sat May 13 17:01:26 2023 +0530 dt-bindings: vendor-prefixes: Add Emtop Add vendor prefix for Emtop Embedded Solutions (https://www.emtop-tech.com/) Signed-off-by: Himanshu Bhavani Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit d2bf7abfd2352dd45cc99b2ce8c7344ac539a656 Author: Himanshu Bhavani Date: Sat May 13 17:01:25 2023 +0530 dt-bindings: arm: fsl: Add Emtop SoM & Baseboard Add support for i.MX8MM based Emtop SOM-IMX8MMLPD4 and IMX8MM Mini Baseboard Signed-off-by: Himanshu Bhavani Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 9230758996c3ff0b5cf8e8506731c956bfb351bf Author: Krzysztof Kozlowski Date: Mon Apr 17 10:09:39 2023 +0200 arm64: dts: qcom: sc8280xp: correct GIC child node name GIC child node is supposed to be named msi-controller: sa8295p-adp.dtb: interrupt-controller@17a00000: gic-its@17a40000: False schema does not allow Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417080939.28648-3-krzysztof.kozlowski@linaro.org commit 7df522338d63c42946eb82f8af7dba8c363bd725 Author: Krzysztof Kozlowski Date: Mon Apr 17 10:09:38 2023 +0200 arm64: dts: qcom: sm8150: drop snps,dw-pcie fallback compatible Qualcomm PCI express root complex does not use snps,dw-pcie fallback: ['qcom,pcie-sm8150', 'snps,dw-pcie'] is too long Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417080939.28648-2-krzysztof.kozlowski@linaro.org commit 83254172fa7f4d4a400f2ff441f111e424dd5ee0 Author: Krzysztof Kozlowski Date: Mon Apr 17 10:09:37 2023 +0200 arm64: dts: qcom: sm8150: add missing qcom,smmu-500 fallback Since commit 6c84bbd103d8 ("dt-bindings: arm-smmu: Add generic qcom,smmu-500 bindings") the SMMU is supposed to use qcom,smmu-500 compatible fallback. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417080939.28648-1-krzysztof.kozlowski@linaro.org commit e10094bf590696a7f845790485cc3f753b2fd94a Author: Krzysztof Kozlowski Date: Mon Apr 17 10:08:15 2023 +0200 arm64: dts: qcom: sm8150: drop incorrect serial properties Drop incorrect and unused serial properties - address/size-cells and reg-names: sa8155p-adp.dtb: geniqup@ac0000: serial@a84000: Unevaluated properties are not allowed ('#address-cells', '#size-cells', 'reg-names' were unexpected) Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417080818.28398-1-krzysztof.kozlowski@linaro.org commit 0dc608855195c8f79e499e2a608b26e56e259810 Author: Bartosz Golaszewski Date: Thu May 4 18:17:54 2023 +0200 dt-bindings: soc: qcom: aoss-qmp: add compatible for sa8775p Document the AOSS QMP compatible for SA8775P. Signed-off-by: Bartosz Golaszewski Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230504161755.197417-1-brgl@bgdev.pl commit d3db273c8a11f377d867c49f95c7e7dc6ae26184 Author: Bartosz Golaszewski Date: Thu May 4 18:17:55 2023 +0200 arm64: dts: qcom: sa8775p: enable AOSS Enable the always-on subsystem controller on SA8775P platforms for use by upcoming support for other peripherals. Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230504161755.197417-2-brgl@bgdev.pl commit 4eefaf51f716be584bbc4f548d368255c682a3b9 Author: Shazad Hussain Date: Fri Apr 28 18:38:24 2023 +0530 arm64: dts: qcom: sa8775p-ride: enable USB nodes Enable usb0, usb1 and usb2 nodes and their respective phy's. Signed-off-by: Shazad Hussain Reviewed-by: Dmitry Baryshkov Tested-by: Adrien Thierry Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230428130824.23803-7-quic_shazhuss@quicinc.com commit de1001525c1aa21380349ffbef8154149ef637e8 Author: Shazad Hussain Date: Fri Apr 28 18:38:23 2023 +0530 arm64: dts: qcom: sa8775p: add USB nodes Add nodes for the USB and it's PHY on sa8775p platform. Signed-off-by: Shazad Hussain Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230428130824.23803-6-quic_shazhuss@quicinc.com commit 09b701b89a761e5e9566d65326d5fe0e94eaa48f Author: Bartosz Golaszewski Date: Thu Apr 27 18:12:18 2023 +0200 arm64: dts: qcom: sa8775p: add the watchdog node Now that the hypervisor issue is fixed, we can add the watchdog node for sa8775p platforms. Signed-off-by: Bartosz Golaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230427161218.201828-1-brgl@bgdev.pl commit 6c92689a0a57b40c758a12c1ca668d6a36a805a6 Author: Parikshit Pareek Date: Mon Apr 17 16:55:36 2023 +0200 arm64: dts: qcom: sa8775p: pmic: add the sdam_0 node Introduce sdam_0 node, which is to be used via nvmem for power on reasons during reboot. Add supported PoN reaons supported via sdam_0 node. Signed-off-by: Parikshit Pareek Signed-off-by: Bartosz Golaszewski Tested-by: Eric Chanudet Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417145536.414490-4-brgl@bgdev.pl commit 40d5835998705c28b985b1325114114c6007546e Author: Parikshit Pareek Date: Mon Apr 17 16:55:34 2023 +0200 arm64: dts: qcom: sa8775p: pmic: remove the PON modes On this PMIC, the PON peripheral does not provide passing reboot modes over HLOS. They must be passed over SDAM. Remove the reboot-mode properties as we'll provide a proper SDAM node in a later commit. Fixes: d2d9a592746c ("arm64: dts: qcom: sa8775p: add the Power On device node") Signed-off-by: Parikshit Pareek Signed-off-by: Bartosz Golaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417145536.414490-2-brgl@bgdev.pl commit 8125a56125114d91843918cc6ef95367c4c39fc7 Author: Bartosz Golaszewski Date: Mon Apr 17 14:58:40 2023 +0200 arm64: defconfig: enable the SA8775P GPUCC driver Enable the GPUCC module for SA8775P platforms in the arm64 defconfig. Signed-off-by: Bartosz Golaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417125844.400782-2-brgl@bgdev.pl commit 1a1ff00c1626c898feb8ceb93aa7b335a9923980 Author: Bartosz Golaszewski Date: Mon Apr 17 14:58:44 2023 +0200 arm64: dts: qcom: sa8775p: add the GPU IOMMU node Add the Adreno GPU IOMMU for sa8775p-based platforms. Signed-off-by: Bartosz Golaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417125844.400782-6-brgl@bgdev.pl commit 597cfc178829ac2e6f68736ec73417968a0810a5 Author: Bartosz Golaszewski Date: Mon Apr 17 14:58:42 2023 +0200 arm64: dts: qcom: sa8775p: add the GPU clock controller node Add the GPUCC node for sa8775p platforms. Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417125844.400782-4-brgl@bgdev.pl commit 2dba7a613a6ea4c2f97abd770262f64ce53f7575 Author: Bartosz Golaszewski Date: Mon Apr 17 14:58:41 2023 +0200 arm64: dts: qcom: sa8775p: add the pcie smmu node Add the PCIe SMMU node for sa8775p platforms. Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230417125844.400782-3-brgl@bgdev.pl commit 35c45a1125fc0772b95aa41acc25deddcf5492be Author: Bartosz Golaszewski Date: Tue Apr 11 15:04:46 2023 +0200 arm64: dts: qcom: sa8775p-ride: enable UFS Enable the UFS and its PHY on sa8775p-ride. Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230411130446.401440-6-brgl@bgdev.pl commit be543efeee17b93edaac61e49c6361d2209bd3d3 Author: Bartosz Golaszewski Date: Tue Apr 11 15:04:45 2023 +0200 arm64: dts: qcom: sa8775p: add UFS nodes Add nodes for the UFS and its PHY on sa8775p platforms. Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230411130446.401440-5-brgl@bgdev.pl commit 86c96823d4b5f0403d0418b89c614682a01ce28e Author: Bartosz Golaszewski Date: Fri Apr 14 14:30:16 2023 +0200 arm64: dts: qcom: sa8775p: add the PMU node Add the PMU node for sa8775p platforms. Signed-off-by: Bartosz Golaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230414123016.176457-1-brgl@bgdev.pl commit 0e59d9e210912e037ec28bd057d06481100f0ba5 Author: Dang Huynh Date: Sat May 13 08:05:05 2023 +0700 arm64: dts: qcom: Add Fxtec Pro1X (QX1050) DTS The F(x)tec Pro1X is a mobile phone released by FX Technologies Ltd in 2022. The phone is exactly the same as the Pro1 released in 2019 with some changes: - MSM8998 -> SM6115 - Camera button is no longer multistate - Only one 48MP back camera - A new keyboard layout picked by the community. This commit has the following features working: - Display (using simplefb) - UFS - Power and volume buttons - Pinctrl - RPM Regulators - USB (Device Mode) To get a successful boot run: cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/\ sm6115-fxtec-pro1x.dtb > .Image.gz-dtb mkbootimg --kernel .Image.gz-dtb \ --ramdisk initrd.img \ --base 0x0 \ --kernel_offset 0x8000 \ --ramdisk_offset 0x1000000 \ --second_offset 0xf00000 \ --tags_offset 0x100 \ --pagesize 4096 \ --cmdline "CMDLINE HERE" \ -o qx1050-boot.img fastboot flash boot qx1050-boot.img fastboot erase dtbo fastboot reboot Signed-off-by: Dang Huynh Reviewed-by: Caleb Connolly Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230505-fxtec-pro1x-support-v3-2-0c9c7f58b205@riseup.net commit 775d08f3954174c030d41bc31a145c027e98b7f7 Author: Dang Huynh Date: Sat May 13 08:05:04 2023 +0700 dt-bindings: arm: qcom: Add Fxtec Pro1X Document F(x)tec Pro1X as a SM6115 device. Signed-off-by: Dang Huynh Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230505-fxtec-pro1x-support-v3-1-0c9c7f58b205@riseup.net commit 57827e87be5447559cc3495567349ff002a6b33a Author: Andrew Halaney Date: Mon May 1 15:51:05 2023 -0500 arm64: dts: qcom: sa8540p-ride: Add ethernet nodes Enable both the MACs found on the board. ethernet0 and ethernet1 both ultimately go to a series of on board switches which aren't managed by this processor. ethernet0 is connected to a Marvell 88EA1512 phy via RGMII. That goes to the series of switches via SGMII on the "media" side of the phy. RGMII_SGMII mode is enabled via devicetree register descriptions. The switch on the "media" side has auto-negotiation disabled, so configuration from userspace similar to: ethtool -s eth0 autoneg off speed 1000 duplex full is necessary to get traffic flowing on that interface. ethernet1 is in a mac2mac/fixed-link configuration going to the same series of switches directly via RGMII. Tested-by: Brian Masney Signed-off-by: Andrew Halaney Reviewed-by: Brian Masney Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230501205105.2518373-3-ahalaney@redhat.com commit b405d8d500e59e1edc51d934a766ea6127e1e69d Author: Andrew Halaney Date: Mon May 1 15:51:04 2023 -0500 arm64: dts: qcom: sc8280xp: Add ethernet nodes This platform has 2 MACs integrated in it, go ahead and describe them. Reviewed-by: Konrad Dybcio Tested-by: Brian Masney Signed-off-by: Andrew Halaney Reviewed-by: Brian Masney Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230501205105.2518373-2-ahalaney@redhat.com commit 9f34baf67e4d08908fd94ff29c825bb673295336 Author: Joy Chakraborty Date: Fri May 12 10:47:45 2023 +0000 spi: dw: Round of n_bytes to power of 2 n_bytes variable in the driver represents the number of bytes per word that needs to be sent/copied to fifo. Bits/word can be between 8 and 32 bits from the client but in memory they are a power of 2, same is mentioned in spi.h header: " * @bits_per_word: Data transfers involve one or more words; word sizes * like eight or 12 bits are common. In-memory wordsizes are * powers of two bytes (e.g. 20 bit samples use 32 bits). * This may be changed by the device's driver, or left at the * default (0) indicating protocol words are eight bit bytes. * The spi_transfer.bits_per_word can override this for each transfer. " Hence, round of n_bytes to a power of 2 to avoid values like 3 which would generate unalligned/odd accesses to memory/fifo. * tested on Baikal-T1 based system with DW SPI-looped back interface transferring a chunk of data with DFS:8,12,16. Fixes: a51acc2400d4 ("spi: dw: Add support for 32-bits max xfer size") Suggested-by: Andy Shevchenko Date: Fri May 12 10:47:44 2023 +0000 spi: dw: Add DMA address widths capability check Store address width capabilities of DMA controller during init and check the same per transfer to make sure the bits/word requirement can be met. Current DW DMA driver requires both tx and rx channel to be configured and functional hence a subset of both tx and rx channel address width capability is checked with the width requirement(n_bytes) for a transfer. * tested on Baikal-T1 based system with DW SPI-looped back interface transferring a chunk of data with DFS:8,12,16. Signed-off-by: Joy Chakraborty Date: Fri May 12 10:47:43 2023 +0000 spi: dw: Add DMA directional capability check Check capabilities of DMA controller during init to make sure it is capable of handling MEM2DEV for tx channel, DEV2MEM for rx channel. Current DW DMA driver requires both tx and rx channel to be configured and functional for any kind of transfers to take effect including half duplex. Hence, check for both tx and rx direction and fail on unavailbility of either. * tested on Baikal-T1 based system with DW SPI-looped back interface transferring a chunk of data with DFS:8,12,16. Signed-off-by: Joy Chakraborty Date: Mon May 8 13:42:36 2023 +0200 arm64: dts: imx8mp: Add analog audio output on i.MX8MP EVK Enable SAI3 on i.MX8MP EVK, add WM8960 codec binding and regulator. This is all that is needed to get analog audio output operational on i.MX8MP EVK. Acked-by: Peng Fan Reviewed-by: Fabio Estevam Reviewed-by: Marco Felsch Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit b86c3afabb4f4ea146c206508527eb2a15485bcc Author: Marek Vasut Date: Mon May 8 13:42:35 2023 +0200 arm64: dts: imx8mp: Add SAI, SDMA, AudioMIX Add all SAI nodes, SDMA2 and SDMA3 nodes, and AudioMIX node. This is needed to get audio operational on i.MX8MP . Acked-by: Peng Fan Reviewed-by: Fabio Estevam Reviewed-by: Luca Ceresoli Reviewed-by: Marco Felsch Tested-by: Adam Ford #imx8mp-beacon-kit Tested-by: Alexander Stein Tested-by: Luca Ceresoli Tested-by: Richard Leitner Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit ad775ac13d01513f8a35235e5b2304623549ee7c Author: Adam Ford Date: Sun May 7 10:15:47 2023 -0500 arm64: defconfig: Enable video capture drivers on imx8mm/imx8mn The imx8m Mini and imx8m Nano both use the same CSIS driver for interfacing with sensors and cameras. The Mini routes the CSIS output to the imx7-CSI driver, and the Nano routes the CSIS through the imx8-isi driver like the one used on the imx8mp. Enable the drivers necessary to facilitate capture on both of these two platforms. Signed-off-by: Adam Ford Reviewed-by: Laurent Pinchart Signed-off-by: Shawn Guo commit 6bc3ea47332648a4211926ba7afc1e1fb935c71a Author: Adam Ford Date: Sun May 7 10:15:48 2023 -0500 arm64: dts: imx8mn-beacon: Add support for OV5640 Camera The baseboard has a very specific pinout for the TD Next 5640 camera which uses an OV5640 sensor. Enable it as part of the deveopment kit baseboard instead of an overlay. Enable the camera with the following media-ctl -l "'ov5640 1-0010':0 -> 'csis-32e30000.mipi-csi':0 [1]" media-ctl -v -V "'ov5640 1-0010':0 [fmt:UYVY8_1X16/640x480 field:none]" media-ctl -v -V "'crossbar':0 [fmt:UYVY8_1X16/640x480 field:none]" media-ctl -v -V "'mxc_isi.0':0 [fmt:UYVY8_1X16/640x480 field:none]" Signed-off-by: Adam Ford Signed-off-by: Shawn Guo commit ae9279f301b53e25a2b2635500fbd6f9b8249a61 Author: Adam Ford Date: Sun May 7 10:15:46 2023 -0500 arm64: dts: imx8mn: Add CSI and ISI Nodes The CSI in the imx8mn is the same as what is used in the imx8mm, but it's routed to the ISI on the Nano. Add both the ISI and CSI nodes, and pointing them to each other. Since the CSI capture is dependent on an attached camera, mark both ISI and CSI as disabled by default. Signed-off-by: Adam Ford Signed-off-by: Shawn Guo commit 6de27598cf30bf0956731a3853b2def9fe22d8c5 Author: Krzysztof Kozlowski Date: Sat May 6 08:42:55 2023 +0200 ARM: dts: imx7ulp: add address/size-cells to OCOTP The OCOTP node should have address/size-cells so the cells can have unit address: imx7ulp-evk.dtb: efuse@410a6000: '#address-cells' is a required property imx7ulp-evk.dtb: efuse@410a6000: '#size-cells' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Peng Fan Signed-off-by: Shawn Guo commit a23a3041c733e068bed5ece88acb45fe0edf0413 Merge: 2a3f9d4def27c f1fcbaa18b28d Author: Mauro Carvalho Chehab Date: Sun May 14 22:55:40 2023 +0100 Merge tag 'v6.4-rc2' into media_stage Linux 6.4-rc2 * tag 'v6.4-rc2': (162 commits) Linux 6.4-rc2 parisc: Fix encoding of swp_entry due to added SWP_EXCLUSIVE flag ext4: bail out of ext4_xattr_ibody_get() fails for any reason ext4: add bounds checking in get_max_inline_xattr_value_size() ext4: add indication of ro vs r/w mounts in the mount message ext4: fix deadlock when converting an inline directory in nojournal mode ext4: improve error recovery code paths in __ext4_remount() ext4: improve error handling from ext4_dirhash() ext4: don't clear SB_RDONLY when remounting r/w until quota is re-enabled ext4: check iomap type only if ext4_iomap_begin() does not fail ext4: avoid a potential slab-out-of-bounds in ext4_group_desc_csum ext4: fix data races when using cached status extents ext4: avoid deadlock in fs reclaim with page writeback ext4: fix invalid free tracking in ext4_xattr_move_to_block() ext4: remove a BUG_ON in ext4_mb_release_group_pa() ext4: allow ext4_get_group_info() to fail cxl: Add missing return to cdat read error path tools/testing/cxl: Use DEFINE_STATIC_SRCU() x86/retbleed: Fix return thunk alignment Documentation/block: drop the request.rst file ... commit a7eb54d44045d424624d3ac7d02feb8ef96744ec Author: Uwe Kleine-König Date: Fri May 12 22:46:46 2023 +0200 ata: libata: Make ata_platform_remove_one return void The function returned zero unconditionally, so the function returning an int is something between useless and irritating. With the goal to make platform drivers' remove function return void, it's helpful to convert the function accordingly. This converts several drivers to the new .remove_new callback that was introduced to smoothen the platform driver conversion. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec Acked-by: Serge Semin Reviewed-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit 2a3f9d4def27c5b30563d11c548ac606ab0066ac Author: Athanasios Oikonomou Date: Tue Jan 10 07:14:21 2023 +0000 media: dvb: bump DVB API version Bump the DVB API version in order userspace to be aware of the changes recently implemented in enumerations for DVB-S2(X) and DVB-C2. Related: commit 6508a50fe84f ("media: dvb: add DVB-C2 and DVB-S2X parameter values") Link: https://lore.kernel.org/linux-media/20230110071421.31498-1-athoik@gmail.com Cc: Robert Schlabbach Signed-off-by: Athanasios Oikonomou Signed-off-by: Mauro Carvalho Chehab commit 1825788e2a96764ae9ad4641191b2aebec6d2b84 Author: Athanasios Oikonomou Date: Wed Jan 11 19:46:08 2023 +0000 media: dvb: add missing DVB-S2X FEC parameter values This commit is adding the missing short FEC Missed on commit 6508a50fe84f9858e8b59b53dce3847aaeeab744 More info: https://dvb.org/wp-content/uploads/2021/02/A083-2r2_DVB-S2X_Draft-EN-302-307-2-v131_Feb_2021.pdf Table 1: S2X System configurations and application areas Please note that 128APSK, 256APSK and 256APSK-L and FEC 29/45, 31/45 are still missing from enums. Link: https://lore.kernel.org/linux-media/20230111194608.1853-1-athoik@gmail.com Cc: Robert Schlabbach Cc: Tom Richardson Signed-off-by: Athanasios Oikonomou Signed-off-by: Mauro Carvalho Chehab commit b37d9c995aef9487040d07326c9e7e560cf23396 Author: Mauro Carvalho Chehab Date: Sat May 13 08:04:32 2023 +0100 media: dw2102: return -EIO instead of -1 for mac address read errors The dvb-usb core function only checks if the returned value is zero, so it doesn't actually matter the error code. Still, returning -1 as an error condition is something that we don't do upstream. So, change the logic to return -EIO in case of I2C transfer failures. Signed-off-by: Mauro Carvalho Chehab commit 663e7460b123271c64be7024cadef86dbb4d8463 Author: Yu Zhe Date: Mon Mar 20 06:40:39 2023 +0000 media: dvb-usb: remove unnecessary (void*) conversions Pointer variables of void * type do not require type cast. Link: https://lore.kernel.org/linux-media/20230320064039.5670-1-yuzhe@nfschina.com Signed-off-by: Yu Zhe Signed-off-by: Mauro Carvalho Chehab commit a41ef7869166c3705e858c0813d59cf844889265 Author: Yu Zhe Date: Mon Mar 20 07:08:28 2023 +0000 media: c8sectpfe: dvb: remove unnecessary (void*) conversions Pointer variables of void * type do not require type cast. Link: https://lore.kernel.org/linux-media/20230320070828.13322-1-yuzhe@nfschina.com Signed-off-by: Yu Zhe Signed-off-by: Mauro Carvalho Chehab commit 633733f5c2aa66583450a107dd0f22786ac30400 Author: Mauro Carvalho Chehab Date: Sat Dec 3 06:09:31 2022 +0000 media: dvbdev.h: do some kernel-doc cleanups Some kernel-doc warnings in were introduced. A fixup patch addressed them was already merged, but Randy's approach from: https://lore.kernel.org/linux-media/20221203060931.19953-1-rdunlap@infradead.org Had some advantages, as it moves the @dvbdev to the right place inside dvb_remove_device() documentation and it makes clearer about what refcounter struct dvb_device refers to. So, apply the changes suggested by Randy. Suggested-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab commit f28701cc24fcfd7f7b2fdd8b87e529b2034314d7 Author: Mauro Carvalho Chehab Date: Sat May 13 18:14:27 2023 +0100 media: dvbdev: fix most coding style issues As we're doing several changes here, address coding style issues, as reported by checkpatch.pl. Signed-off-by: Mauro Carvalho Chehab commit b87f4ff57db90677f2c52b1c42c900b142231e00 Author: Johannes Schneider Date: Wed May 3 17:20:05 2023 +0200 arm64: dts: add NXP i.MX8MM-EVKB support Add the i.MX8MM-EVKB [1] devicetree support. The EVKB is basically the same device except for the different used PMIC. [1] https://www.nxp.com/design/development-boards/ \ i-mx-evaluation-and-development-boards/ \ evaluation-kit-for-the-i-mx-8m-mini-applications-processor:8MMINILPD4-EVK Signed-off-by: Johannes Schneider [m.felsch@pengutronix.de: Adapt the commit message] [m.felsch@pengutronix.de: Include Shawns feedback] [m.felsch@pengutronix.de: Fix the regulator settings] Signed-off-by: Marco Felsch Signed-off-by: Shawn Guo commit e6e81f10ca7455e9c8367c85d9f0bfac5b0c463f Author: Johannes Schneider Date: Wed May 3 17:20:04 2023 +0200 dt-bindings: arm: fsl: Add i.MX8MM-EVKB Add DT compatible for the imx8mm EVKB [1]. [1] https://www.nxp.com/design/development-boards/ \ i-mx-evaluation-and-development-boards/ \ evaluation-kit-for-the-i-mx-8m-mini-applications-processor:8MMINILPD4-EVK Signed-off-by: Johannes Schneider [m.felsch@pengutronix.de: Adapt the commit message] [m.felsch@pengutronix.de: Adapt the yaml comment] Signed-off-by: Marco Felsch Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 4088f98e2580cc66d6cb7d1aaa5c92fb237a96bb Author: Hugo Villeneuve Date: Mon May 1 13:02:50 2023 -0400 arm64: dts: imx8mn-var-som: add SOM EEPROM The 4Kbit EEPROM located on the SOM contains hardware configuration options, manufacturing infos and ethernet MAC address. Signed-off-by: Hugo Villeneuve Signed-off-by: Shawn Guo commit c290d09a998c810d11cca972810849fe7c2ec711 Author: Krzysztof Kozlowski Date: Sat Apr 22 00:32:06 2023 +0200 arm64: dts: freescale: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified properties to fix warnings like: fsl-ls2080a-simu.dtb: l2-cache3: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit d2bd947176f855ea5a07fa9cce7bf15b0ce0467f Author: Krzysztof Kozlowski Date: Sat Apr 22 00:32:04 2023 +0200 arm64: dts: imx: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified properties to fix warnings like: imx8dxl-evk.dtb: l2-cache0: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski Acked-by: Peng Fan Signed-off-by: Shawn Guo commit 6d81b2f20c191e82a4bd6272e9ef4ec485b35c63 Author: Alexander Stein Date: Fri Apr 21 14:20:53 2023 +0200 ARM: dts: mba6ulx: add missing vcc supplies to i2c devices This fixes the warnings: pca953x 3-0020: supply vcc not found, using dummy regulator pca953x 3-0021: supply vcc not found, using dummy regulator pca953x 3-0022: supply vcc not found, using dummy regulator at24 3-0051: supply vcc not found, using dummy regulator Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 2b4e22a2b9e2c7f94f53ecd8cc78a37605dc387f Author: Fabio Estevam Date: Tue Apr 18 10:10:30 2023 -0300 ARM: imx_v6_v7_defconfig: Remove firmware loader helper Testing on a imx6dl board with a QCA9377 SDIO Wifi chip shows that the QCA9377 firmware takes more than three minutes to start getting loaded, which is a very inconvenient behavior. CONFIG_FW_LOADER_USER_HELPER and CONFIG_FW_LOADER_USER_HELPER_FALLBACK were selected by commit 30fdd51be161 ("ARM: imx_v6_v7_defconfig: add CONFIG_FW_LOADER_USER_HELPER") By removing the CONFIG_FW_LOADER_USER_HELPER and CONFIG_FW_LOADER_USER_HELPER_FALLBACK options the QCA9377 firmware is loaded around 10 seconds after boot, which is the expected behavior. The motivation for commit 30fdd51be161 ("ARM: imx_v6_v7_defconfig: add CONFIG_FW_LOADER_USER_HELPER") was related to loading the SDMA firmware,and at the time of that commit, the SDMA driver was loaded as built-in. Now that the SDMA driver is selected as a kernel module, its firmware can be successfully loaded as well without the need of CONFIG_FW_LOADER_USER_HELPER and CONFIG_FW_LOADER_USER_HELPER_FALLBACK. Remove the selection of these two options. Also, successfully tested the loading of the VPU firmware without these options. Signed-off-by: Fabio Estevam Tested-by: Otavio Salvador Signed-off-by: Shawn Guo commit 9da15c4c850dd53309e07d5611f33655f8f8c05d Author: Laurent Pinchart Date: Tue Apr 18 18:31:04 2023 +0300 arm64: dts: imx8mp: Add ISI DT node Add a DT node for the i.MX8MP ISI instance, and model to connection to two CSI-2 receivers (CSIS). Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Signed-off-by: Shawn Guo commit dae1b3fd06e8416fdfbc7440a62d5cd845c633a7 Author: Laurent Pinchart Date: Tue Apr 18 18:31:03 2023 +0300 arm64: dts: imx8mp: Add CSIS DT nodes Add DT nodes for the two CSI-2 receivers of the i.MX8MP. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Signed-off-by: Shawn Guo commit ac0d46d5e38b3d380f742181ee879561ce6bd2f1 Author: Stefan Wahren Date: Fri Apr 14 11:19:47 2023 +0200 ARM: dts: imx6ul: Add clock and PGC node to GPC According to fsl,imx-gpc.yaml the General Power Control requires a ipg clock and a Power Gating Control node. So add them to fix the dtbs_check warnings on i.MX6UL boards: gpc@20dc000: 'clocks' is a required property gpc@20dc000: 'clock-names' is a required property gpc@20dc000: 'pgc' is a required property Suggested-by: Jacky Bai Signed-off-by: Stefan Wahren Signed-off-by: Shawn Guo commit e9f5cd85f1f931bb7b64031492f7051187ccaac7 Author: Stefan Wahren Date: Fri Apr 14 11:19:46 2023 +0200 ARM: dts: imx: Adjust dma-apbh node name Currently the dtbs_check generates warnings like this: $nodename:0: 'dma-apbh@110000' does not match '^dma-controller(@.*)?$' So fix all affected dma-apbh node names. Signed-off-by: Stefan Wahren Signed-off-by: Shawn Guo commit 7cbfdc4ec908586968b84edf5c845ae5db57181b Author: Krzysztof Kozlowski Date: Sun Mar 26 22:45:02 2023 +0200 arm64: dts: imx8mq-mnt-reform2: drop invalid simple-panel compatible "simple-panel" compatible is not documented and nothing in Linux kernel binds to it: imx8mq-mnt-reform2.dtb: panel: compatible: ['innolux,n125hce-gn1', 'simple-panel'] is too long Signed-off-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 79b3604d6221220770fb52619e1f55ee04b2c1b7 Merge: bdeeed3498c78 6b6a23d5d8e85 Author: Martin KaFai Lau Date: Sat May 13 16:20:16 2023 -0700 Merge branch 'bpf: Don't EFAULT for {g,s}setsockopt with wrong optlen' Stanislav Fomichev says: ==================== optval larger than PAGE_SIZE leads to EFAULT if the BPF program isn't careful enough. This is often overlooked and might break completely unrelated socket options. Instead of EFAULT, let's ignore BPF program buffer changes. See the first patch for more info. In addition, clearly document this corner case and reset optlen in our selftests (in case somebody copy-pastes from them). v6: - no changes; resending due to screwing up v5 series with the unrelated patch v5: - goto in the selftest (Martin) - set IP_TOS to zero to avoid endianness complications (Martin) v4: - ignore retval as well when optlen > PAGE_SIZE (Martin) v3: - don't hard-code PAGE_SIZE (Martin) - reset orig_optlen in getsockopt when kernel part succeeds (Martin) ==================== Signed-off-by: Martin KaFai Lau commit 6b6a23d5d8e857e0dda1bbe5043cf4d5e9c711d3 Author: Stanislav Fomichev Date: Thu May 11 10:04:56 2023 -0700 bpf: Document EFAULT changes for sockopt And add examples for how to correctly handle large optlens. This is less relevant now when we don't EFAULT anymore, but that's still the correct thing to do. Signed-off-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20230511170456.1759459-5-sdf@google.com Signed-off-by: Martin KaFai Lau commit e01b4a72f132c1ca63e3ed851bef9b3c62ae6149 Author: Stanislav Fomichev Date: Thu May 11 10:04:55 2023 -0700 selftests/bpf: Correctly handle optlen > 4096 Even though it's not relevant in selftests, the people might still copy-paste from them. So let's take care of optlen > 4096 cases explicitly. Signed-off-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20230511170456.1759459-4-sdf@google.com Signed-off-by: Martin KaFai Lau commit 989a4a7dbff21399da42e808a4ae134023546f41 Author: Stanislav Fomichev Date: Thu May 11 10:04:54 2023 -0700 selftests/bpf: Update EFAULT {g,s}etsockopt selftests Instead of assuming EFAULT, let's assume the BPF program's output is ignored. Remove "getsockopt: deny arbitrary ctx->retval" because it was actually testing optlen. We have separate set of tests for retval. Signed-off-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20230511170456.1759459-3-sdf@google.com Signed-off-by: Martin KaFai Lau commit 29ebbba7d46136cba324264e513a1e964ca16c0a Author: Stanislav Fomichev Date: Thu May 11 10:04:53 2023 -0700 bpf: Don't EFAULT for {g,s}setsockopt with wrong optlen With the way the hooks implemented right now, we have a special condition: optval larger than PAGE_SIZE will expose only first 4k into BPF; any modifications to the optval are ignored. If the BPF program doesn't handle this condition by resetting optlen to 0, the userspace will get EFAULT. The intention of the EFAULT was to make it apparent to the developers that the program is doing something wrong. However, this inadvertently might affect production workloads with the BPF programs that are not too careful (i.e., returning EFAULT for perfectly valid setsockopt/getsockopt calls). Let's try to minimize the chance of BPF program screwing up userspace by ignoring the output of those BPF programs (instead of returning EFAULT to the userspace). pr_info_once those cases to the dmesg to help with figuring out what's going wrong. Fixes: 0d01da6afc54 ("bpf: implement getsockopt and setsockopt hooks") Suggested-by: Martin KaFai Lau Signed-off-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20230511170456.1759459-2-sdf@google.com Signed-off-by: Martin KaFai Lau commit befcc1fce564bdb20ee55be981a355b0a7d0eac5 Author: Edward Cree Date: Fri May 12 16:35:58 2023 +0100 sfc: fix use-after-free in efx_tc_flower_record_encap_match() When writing error messages to extack for pseudo collisions, we can't use encap->type as encap has already been freed. Fortunately the same value is stored in local variable em_type, so use that instead. Fixes: 3c9561c0a5b9 ("sfc: support TC decap rules matching on enc_ip_tos") Reported-by: Simon Horman Signed-off-by: Edward Cree Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit a0b7955310a445fc0d45a0ac576bad8720cd6057 Author: Russell King (Oracle) Date: Fri May 12 17:58:37 2023 +0100 net: phylink: constify fwnode arguments Both phylink_create() and phylink_fwnode_phy_connect() do not modify the fwnode argument that they are passed, so lets constify these. Reviewed-by: Simon Horman Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 144470c88c5d9a4cab81da22a26c129e6702c6cf Author: Shenwei Wang Date: Fri May 12 08:20:10 2023 -0500 net: fec: using the standard return codes when xdp xmit errors This patch standardizes the inconsistent return values for unsuccessful XDP transmits by using standardized error codes (-EBUSY or -ENOMEM). Signed-off-by: Shenwei Wang Reviewed-by: Simon Horman Reviewed-by: Horatiu Vultur Signed-off-by: David S. Miller commit 314cf958de2a784dd3984190311e15aa1fbf2717 Author: Daire McNamara Date: Fri May 12 13:20:32 2023 +0100 net: macb: Shorten max_tx_len to 4KiB - 56 on mpfs On mpfs, with SRAM configured for 4 queues, setting max_tx_len to GEM_TX_MAX_LEN=0x3f0 results multiple AMBA errors. Setting max_tx_len to (4KiB - 56) removes those errors. The details are described in erratum 1686 by Cadence The max jumbo frame size is also reduced for mpfs to (4KiB - 56). Signed-off-by: Daire McNamara Reviewed-by: Conor Dooley Reviewed-by: Simon Horman Reviewed-by: Claudiu Beznea Signed-off-by: David S. Miller commit b332af5398a3aa1a2fdd69bb6968a8f866cc39aa Author: Jakob Koschel Date: Fri May 12 13:36:10 2023 +0200 w1: Replace usage of found with dedicated list iterator variable To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable instead of a found boolean [1]. This removes the need to use a found variable and simply checking if the variable was set, can determine if the break/goto was hit. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20230509-w1-replace-usage-of-found-with-tmp-list-iterator-variable-v3-1-e07c9603fd9d@gmail.com Signed-off-by: Krzysztof Kozlowski commit f1b5dfe63f6a9eb17948cbaee4da4b66f51ac794 Author: Kuniyuki Iwashima Date: Wed May 10 14:54:43 2023 -0700 ping: Convert hlist_nulls to plain hlist. Since introduced in commit c319b4d76b9e ("net: ipv4: add IPPROTO_ICMP socket kind"), ping socket does not use SLAB_TYPESAFE_BY_RCU nor check nulls marker in loops. Signed-off-by: Kuniyuki Iwashima Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit d5e7d19683a2329a0e791b43f1d39623247be165 Merge: 305c041899971 278fda0d52f67 Author: David S. Miller Date: Sat May 13 19:47:56 2023 +0100 Merge branch 'skb_frag_fill_page_desc' Yunsheng Lin says: ==================== net: introduce skb_frag_fill_page_desc() Most users use __skb_frag_set_page()/skb_frag_off_set()/ skb_frag_size_set() to fill the page desc for a skb frag. It does not make much sense to calling __skb_frag_set_page() without calling skb_frag_off_set(), as the offset may depend on whether the page is head page or tail page, so add skb_frag_fill_page_desc() to fill the page desc for a skb frag. In the future, we can make sure the page in the frag is head page of compound page or a base page, if not, we may warn about that and convert the tail page to head page and update the offset accordingly, if we see a warning about that, we also fix the caller to fill the head page in the frag. when the fixing is done, we may remove the warning and converting. In this way, we can remove the compound_head() or use page_ref_*() like the below case: https://elixir.bootlin.com/linux/latest/source/net/core/page_pool.c#L881 https://elixir.bootlin.com/linux/latest/source/include/linux/skbuff.h#L3383 It may also convert net stack to use the folio easier. V1: repost with all the ack/review tags included. RFC: remove a local variable as pointed out by Simon. ==================== Signed-off-by: David S. Miller commit 278fda0d52f67244044384abd7dd5b3a5b3a5604 Author: Yunsheng Lin Date: Thu May 11 09:12:13 2023 +0800 net: remove __skb_frag_set_page() The remaining users calling __skb_frag_set_page() with page being NULL seems to be doing defensive programming, as shinfo->nr_frags is already decremented, so remove them. Signed-off-by: Yunsheng Lin Reviewed-by: Leon Romanovsky Reviewed-by: Michael Chan Reviewed-by: Jesse Brandeburg Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit b51f4113ebb02011f0ca86abc3134b28d2071b6a Author: Yunsheng Lin Date: Thu May 11 09:12:12 2023 +0800 net: introduce and use skb_frag_fill_page_desc() Most users use __skb_frag_set_page()/skb_frag_off_set()/ skb_frag_size_set() to fill the page desc for a skb frag. Introduce skb_frag_fill_page_desc() to do that. net/bpf/test_run.c does not call skb_frag_off_set() to set the offset, "copy_from_user(page_address(page), ...)" and 'shinfo' being part of the 'data' kzalloced in bpf_test_init() suggest that it is assuming offset to be initialized as zero, so call skb_frag_fill_page_desc() with offset being zero for this case. Also, skb_frag_set_page() is not used anymore, so remove it. Signed-off-by: Yunsheng Lin Reviewed-by: Leon Romanovsky Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit dd731888d1e0ee93af2daca5e545d5a58c45119b Author: Herve Codina Date: Tue May 9 18:08:50 2023 +0200 dt-bindings: iio: potentiometer: Add the Renesas X9250 potentiometers The Renesas X9250 is a quad digitally controlled potentiometers. Signed-off-by: Herve Codina Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230509160852.158101-2-herve.codina@bootlin.com Signed-off-by: Jonathan Cameron commit 23cf1846f4395c61e2dd4309a344e937689702fd Author: Hermes Zhang Date: Fri May 5 13:48:53 2023 +0800 iio: imu: mpu6050: Add support for the ICM 20600 IMU The Invensense ICM-20600 is a 6-axis MotionTracking device that combines a 3-axis gyroscope and an 3-axis accelerometer. It is very similar to the ICM20602 imu which is already supported by the mpu6050 driver. The main difference is that the ICM-20600 has a different WHOAMI value. Signed-off-by: Hermes Zhang Acked-by: Jean-Baptiste Maneyrol Link: https://lore.kernel.org/r/20230505054853.2155326-3-chenhuiz@axis.com Signed-off-by: Jonathan Cameron commit 757c49215f961871d30ad633836099cacb4dcac7 Author: Hermes Zhang Date: Fri May 5 13:48:52 2023 +0800 dt-bindings: iio: imu: mpu6050: Add icm20600 bindings to mpu6050 ICM-20600 is almost same as ICM-20602 which already support in mpu6050 driver. Specify "invensense,icm20602" as a fallback compatible Signed-off-by: Hermes Zhang Reviewed-by: Krzysztof Kozlowski Acked-by: Jean-Baptiste Maneyrol Link: https://lore.kernel.org/r/20230505054853.2155326-2-chenhuiz@axis.com Signed-off-by: Jonathan Cameron commit 538af6e5856b1aa971975c747a2974a74db48928 Author: Aakarsh Jain Date: Tue Mar 28 17:17:29 2023 +0530 dt-bindings: media: s5p-mfc: convert bindings to json-schema Convert s5p-mfc bindings to DT schema format using json-schema. Signed-off-by: Aakarsh Jain Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230328114729.61436-1-aakarsh.jain@samsung.com Signed-off-by: Krzysztof Kozlowski commit 3d0b126029d92b659afd8ffa8ee4fe751ff3996c Author: Marijn Suijten Date: Tue May 2 01:17:37 2023 +0200 iio: adc: qcom-spmi-vadc: Propagate fw node label to userspace Set the read_label() callback to return a friendly name provided in DT (firmware), in order to make in_{therm,voltage}X_label attributes show up in sysfs for userspace to consume a channel name. This is particularly useful for custom thermistors being attached to otherwise generically named GPIOs, where the name is known by the board DT. If the channel name isn't set in DT, use the datasheet_name hardcoded in the driver instead. Note that this doesn't fall back to fwnode_get_name() as that provides suboptimally readable names, with an @xx address suffix from board DT. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230502-iio-adc-propagate-fw-node-label-v3-5-6be5db6e6b5a@somainline.org Signed-off-by: Jonathan Cameron commit ac0abf75e1a94425f1cd503e1a895e003e2f40d6 Author: Marijn Suijten Date: Tue May 2 01:17:36 2023 +0200 iio: adc: qcom-spmi-adc5: Remove unnecessary datasheet_name NULL check datasheet_name is statically filled by a macro for every channel, and is nor should ever be set to NULL. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230502-iio-adc-propagate-fw-node-label-v3-4-6be5db6e6b5a@somainline.org Signed-off-by: Jonathan Cameron commit 0744ef3b2b63e705aee9cc26bbbf290480335880 Author: Marijn Suijten Date: Tue May 2 01:17:35 2023 +0200 iio: adc: qcom-spmi-adc5: Fall back to datasheet_name instead of fwnode name Since the migration to fwnode_get_name in commit 4f47a236a23d ("iio: adc: qcom-spmi-adc5: convert to device properties") the resulting adc5_channel_prop::channel_name (renamed from datasheet_name in the previous patch) - which is propagated into iio_chan_spec::extend_name - was containing the DT node name including @xx suffix if a "label" property is not present, while adc5_channels::datasheet_name was thus far set by the macros but always remained unread. Put it to use instead of using a confusing name containing @xx in sysfs filenames (again, when "label" is not set). Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230502-iio-adc-propagate-fw-node-label-v3-3-6be5db6e6b5a@somainline.org Signed-off-by: Jonathan Cameron commit e93cde03abf72fd7c98c08107dbeb3b9dfe9dca5 Author: Marijn Suijten Date: Tue May 2 01:17:34 2023 +0200 iio: adc: qcom-spmi-adc5: Use driver datasheet_name instead of DT label iio_chan_spec::datasheet_name expects a channel/pin name on the hardware part, i.e. from its datasheet, instead of a friendly name from DT which typically describes the use of said channel. GPIO channels are commonly specialized in QCOM board DTS based on what a - typically thermistor - is connected to. Also rename adc5_channel_prop::datasheet_name to channel_name to that effect. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230502-iio-adc-propagate-fw-node-label-v3-2-6be5db6e6b5a@somainline.org Signed-off-by: Jonathan Cameron commit 123627ad03d9915f6a6ecb69bb86a80da69ee972 Author: Marijn Suijten Date: Tue May 2 01:17:33 2023 +0200 iio: core: Point users of extend_name field to read_label callback As mentioned and discussed in [1] extend_name should not be used for full channel labels (and most drivers seem to only use it to express a short type of a channel) as this affects sysfs filenames, while the label name is supposed to be extracted from the *_label sysfs file instead. This appears to have been unclear to some drivers as extend_name is also used when read_label is unset, achieving an initial goal of providing sensible names in *_label sysfs files without noticing that sysfs filenames are (negatively and likely unintentionally) affected as well. Point readers of iio_chan_spec::extend_name to iio_info::read_label by mentioning deprecation and side-effects of this field. [1]: https://lore.kernel.org/linux-arm-msm/20221221223432.si2aasbleiicayfl@SoMainline.org/ Suggested-by: Jonathan Cameron Signed-off-by: Marijn Suijten Link: https://lore.kernel.org/r/20230502-iio-adc-propagate-fw-node-label-v3-1-6be5db6e6b5a@somainline.org Signed-off-by: Jonathan Cameron commit a508fbfed333aea05e4ac42d98803a031cda8ce8 Author: Matti Vaittinen Date: Thu May 4 10:58:52 2023 +0300 iio: kx022a: Probe asynchronously Devices which may take a while to initialize during probe and which have no strong reason to probe synchronously can request asynchronous probing as default probe strategy. This can speed-up start times on some platforms. The KX022A gets probe delayed for at least two reasons. It enables the supply regulator, (which is likely to have ramp-up delay if it was disabled) and additionally it delays while the sensor itself is initializing. Changing to asynchronous probing may cause problems. Some of which are discussed in: https://lore.kernel.org/all/06db017f-e985-4434-8d1d-02ca2100cca0@sirena.org.uk/ Enable asynchronous probing for KX022A. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/24cea76c282a28b7a4dba297ab627176f8097907.1683185765.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 4cd56dbd764e27468c7115575ac200c284406439 Author: Matti Vaittinen Date: Thu May 4 10:57:13 2023 +0300 iio: bu27034: Probe asynchronously Devices which may take a while to initialize during probe and which have no strong reason to probe synchronously can request asynchronous probing as default probe strategy. This can speed-up start times on some platforms. The BU27034 gets probe delayed for at least two reasons. It enables the supply regulator, (which is likely to have ramp-up delay if it was disabled) and additionally it delays while the sensor itself is initializing. Changing to asynchronous probing may cause problems. Some of which are discussed in: https://lore.kernel.org/all/06db017f-e985-4434-8d1d-02ca2100cca0@sirena.org.uk/ Enabling async probing for the ROHM BU27034 should be fairly safe to try though as there is no in-tree users for it yet. If the async probing appears to be an issue we can switch easily back to synchronous (or better yet, fix the actual problem). Enable asynchronous probing for BU27034. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/e7088793e1868c77b1894b30cd026e8ed043ea7c.1683185765.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit e0b7972461b082be7168deb217ab7daaa8d425f0 Author: Marijn Suijten Date: Mon Apr 10 22:29:17 2023 +0200 dt-bindings: iio: adc: Require generic `channel` name for channel nodes As discussed in [1] it is more convenient to use a generic `channel` node name for ADC channels while storing a friendly - board-specific instead of PMIC-specific - name in the label, if/when desired to overwrite the channel description already contained (but previously unused) in the driver [2]. The same `channel` node name pattern has also been set in iio/adc/adc.yaml, but this generic binding is not inherited as base for qcom,spmi-vadc bindings due to not having any other generic elements in common, besides the node name rule and reg property. Replace the .* name pattern with the `channel` literal, but leave the label property optional for bindings to choose to fall back a channel label hardcoded in the driver [2] instead. [1]: https://lore.kernel.org/linux-arm-msm/20221106193018.270106-1-marijn.suijten@somainline.org/T/#u [2]: https://lore.kernel.org/linux-arm-msm/20230116220909.196926-4-marijn.suijten@somainline.org/ Signed-off-by: Marijn Suijten Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230410202917.247666-6-marijn.suijten@somainline.org Signed-off-by: Jonathan Cameron commit 26e46ef7758922e983a9a2f688369f649cc1a635 Author: Nuno Sá Date: Thu Feb 16 11:14:52 2023 +0100 iio: buffer: fix coding style warnings Just cosmetics. No functional change intended... Signed-off-by: Nuno Sá Reviewed-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20230216101452.591805-4-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit 9a9608418292bb8733805c3f3123dfe0454fadac Author: Stefan Windfeldt-Prytz Date: Wed Apr 26 13:57:30 2023 +0200 iio: light: Add support for TI OPT4001 light sensor This driver uses the continuous mode of the chip and integration time can be configured through sysfs. The constants for calculating lux value differs between packaging so it uses different compatible string for the two versions "ti,opt4001-picostar" and "ti,opt4001-sot-5x3" since the device id is the same. Datasheet: https://www.ti.com/lit/gpn/opt4001 Signed-off-by: Stefan Windfeldt-Prytz Link: https://lore.kernel.org/r/20230323-add-opt4001-driver-v3-2-62e121dab294@axis.com Signed-off-by: Jonathan Cameron commit 480abd88c04a56f1817985f6854333a5ea2d26fa Author: Stefan Windfeldt-Prytz Date: Wed Apr 26 13:57:29 2023 +0200 dt-bindings: iio: light: Document TI OPT4001 light sensor Add devicetree bindings for opt4001 ambient light sensor. Signed-off-by: Stefan Windfeldt-Prytz Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230323-add-opt4001-driver-v3-1-62e121dab294@axis.com Signed-off-by: Jonathan Cameron commit b8ddd02281401658b41d491bfa02d152cba806a5 Author: Christophe JAILLET Date: Mon Apr 24 09:11:51 2023 +0200 iio: adc: palmas: Remove the unneeded include This driver does not use i2c, so there is no point in including Remove it. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/9d23cd04d7f99dc8d813584aae5268b57f92fcd8.1682320298.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron commit e88d989fb01fa06b0fe77be3ce9041c7a4ea9f9c Author: Frank Wunderlich Date: Fri Apr 21 15:20:42 2023 +0200 dt-bindings: iio: adc: Add support for MT7986 Add compatible string and specific clock property for mt7986. Signed-off-by: Frank Wunderlich Link: https://lore.kernel.org/r/20230421132047.42166-3-linux@fw-web.de Signed-off-by: Jonathan Cameron commit 7b0d54ae76e3c6e4f0222c5af3e3d7531f62b58e Author: Sean Nyekjaer Date: Fri Apr 21 10:38:58 2023 +0200 iio: adc: stm32-adc: add debug info if dt uses legacy channel config Since nearly all stm32 dt's are using the legacy adc channel config, we should warn users about using it. Signed-off-by: Sean Nyekjaer Link: https://lore.kernel.org/r/20230421083858.2613289-1-sean@geanix.com Signed-off-by: Jonathan Cameron commit 5b24fdd991e53f10514cb6a6096f76bf555ffeac Author: Marius Hoch Date: Fri Apr 21 01:26:31 2023 +0200 iio: light: al3320a: Handle ACPI device CALS0001 This sensor can be found as CALS0001 on the Lenovo Yoga Tablet 2 series. Tested on a Lenovo Yoga Tablet 2 1051-F. Signed-off-by: Marius Hoch Tested-by: Hans de Goede Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230420232631.68864-1-mail@mariushoch.de Signed-off-by: Jonathan Cameron commit b4d32eb31f49358ad9de1baed92844e7a4cc5de0 Author: Christophe JAILLET Date: Sat Apr 15 18:25:41 2023 +0200 iio: accel: bma400: Simplify an error message dev_err_probe() already display the error code. There is no need to duplicate it explicitly in the error message. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/9373d41b0a1f3dc3fc0d31c1daaa19d9a7ec4dcd.1681575924.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron commit 773aa06d706ce1c2055b7a3f1616c2978ca66dac Author: Marius Hoch Date: Sun Apr 16 01:11:30 2023 +0200 dt-bindings: iio: st-sensors: Add LSM303D accelerometer+magnetometer Same as the lsm9ds0, except that the lsm303d doesn't feature a gyroscope. Signed-off-by: Marius Hoch Acked-by: Krzysztof Kozlowski Tested-by: Hans de Goede Link: https://lore.kernel.org/r/20230415231130.115094-7-mail@mariushoch.de Signed-off-by: Jonathan Cameron commit 69ee1fb21340cb83df531175f298010697a87448 Author: Marius Hoch Date: Sun Apr 16 01:11:29 2023 +0200 iio: Comment that the LSM303D also has the Magnetometer DRDY Per its datasheet, the LSM303D also features that pin. Signed-off-by: Marius Hoch Reviewed-by: Linus Walleij Tested-by: Hans de Goede Link: https://lore.kernel.org/r/20230415231130.115094-6-mail@mariushoch.de Signed-off-by: Jonathan Cameron commit 598e971fabf8c7c560896394b06175330b1c1aba Author: Marius Hoch Date: Sun Apr 16 01:11:28 2023 +0200 iio: st_sensors: Add ACPI support for lsm303d to the LSM9DS0 IMU driver The lsm303d can be found as ACCL0001 on various Lenovo devices, including the Lenovo Yoga Tablet 2 1051-F, where I tested this patch. Dropped SPI support as per discussion in thread linked below. Signed-off-by: Marius Hoch Acked-by: Linus Walleij Tested-by: Hans de Goede Link: https://lore.kernel.org/r/20230415231130.115094-5-mail@mariushoch.de Signed-off-by: Jonathan Cameron commit c0f68439ae06c8612e4d64e24b70a5c82fcdede6 Author: Marius Hoch Date: Sun Apr 16 01:11:27 2023 +0200 iio: st_sensors: Add lsm303d support to the LSM9DS0 IMU driver The lsm303d is basically the lsm9ds0 without the gyroscope (which the LSM9DS0 IMU driver doesn't handle), as far as I can tell. Signed-off-by: Marius Hoch Reviewed-by: Linus Walleij Tested-by: Hans de Goede Link: https://lore.kernel.org/r/20230415231130.115094-4-mail@mariushoch.de Signed-off-by: Jonathan Cameron commit a9e19f636036567284ef41008b930f5730acd974 Author: Marius Hoch Date: Sun Apr 16 01:11:26 2023 +0200 iio: magnetometer: st_accel: Add LSM303D The lsm303d has the same register mapping as the lsm9ds0, thus we can just re-use that. Tested on a Lenovo Yoga Tablet 2 1051-F. Signed-off-by: Marius Hoch Reviewed-by: Linus Walleij Tested-by: Hans de Goede Link: https://lore.kernel.org/r/20230415231130.115094-3-mail@mariushoch.de Signed-off-by: Jonathan Cameron commit 9445368bca2f62cadfcf98e06219f784ae94dce0 Author: Marius Hoch Date: Sun Apr 16 01:11:25 2023 +0200 iio: accel: st_accel: Add LSM303D The lsm303d has the same register mapping as the lsm9ds0, thus we can just re-use that. Tested on a Lenovo Yoga Tablet 2 1051-F. Signed-off-by: Marius Hoch Reviewed-by: Linus Walleij Tested-by: Hans de Goede Link: https://lore.kernel.org/r/20230415231130.115094-2-mail@mariushoch.de Signed-off-by: Jonathan Cameron commit ef513aa7aa5038d2f53e9f2932af5006f37ed0b6 Author: Luca Weiss Date: Fri Apr 14 01:17:49 2023 +0200 dt-bindings: iio: adc: qcom,spmi-vadc: Allow 1/16 for pre-scaling The channel ADC5_USB_IN_V_16 is using 1/16 pre-scaling on at least pm7250b and pmi632. Allow that in the schema. Signed-off-by: Luca Weiss Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230414-pmi632-v1-5-fe94dc414832@z3ntu.xyz Signed-off-by: Jonathan Cameron commit bcac467b7ca045224bd0f35e245b8edfcb1c452e Author: Cristian Ciocaltea Date: Thu May 4 23:06:48 2023 +0300 arm64: dts: rockchip: Add rk3588 OTP node Add DT node for Rockchip RK3588/RK3588S OTP memory. Co-developed-by: Finley Xiao Signed-off-by: Finley Xiao Signed-off-by: Cristian Ciocaltea Tested-by: Vincent Legoll [moved cpu-version subnode down, to be sorted by address] Link: https://lore.kernel.org/r/20230504200648.1119866-9-cristian.ciocaltea@collabora.com Signed-off-by: Heiko Stuebner commit d211665c5a833873ee37e501af58adbf028e6b5f Author: Tianling Shen Date: Sat May 13 21:53:07 2023 +0800 arm64: dts: rockchip: Add FriendlyARM NanoPi R2C Plus The NanoPi R2C Plus is a small variant of NanoPi R2C with a on-board eMMC flash (8G) included. Signed-off-by: Tianling Shen Link: https://lore.kernel.org/r/20230513135307.26554-2-cnsztl@gmail.com Signed-off-by: Heiko Stuebner commit 8788595d66b9d6ac62d844af013edc3b393d8aef Author: Tianling Shen Date: Sat May 13 21:53:06 2023 +0800 dt-bindings: arm: rockchip: add FriendlyARM NanoPi R2C Plus Add devicetree binding documentation for the NanoPi R2C Plus. Acked-by: Krzysztof Kozlowski Signed-off-by: Tianling Shen Link: https://lore.kernel.org/r/20230513135307.26554-1-cnsztl@gmail.com Signed-off-by: Heiko Stuebner commit 87c692fde46a511aa365d220588d0566125f4035 Author: Chris Morgan Date: Fri May 12 14:16:33 2023 -0500 arm64: dts: rockchip: Update leds for Anbernic RGxx3 Series Each of the LEDs on the RGxx3 which is currently controlled via GPIO can also be controlled via a PWM. Change each of the LEDs to PWM so that users have the ability to adjust the brightness of the LEDs according to their preference. Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20230512191633.33416-1-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 4d83538aab4ccb59abdbf7f39568761a8b7d7ea1 Author: Chris Morgan Date: Fri May 12 11:20:39 2023 -0500 arm64: dts: rockchip: add Anbernic RG353PS Add support for the Anbernic RG353PS. This device is identical in form factor to the RG353P and has the following hardware differences: - No touchscreen is present on i2c2 (or at all). - Only contains 1GB of RAM. - Has no eMMC. - Only appears to ship with the 2nd revision of the display panel. Note that the display panel has been added to the st7703 panel driver in a separate commit series. Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20230512162039.31132-3-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 4e959380ba823cdf4e643ff247b8359e1bcbf683 Author: Chris Morgan Date: Fri May 12 11:20:38 2023 -0500 dt-bindings: arm: rockchip: add Anbernic RG353PS Add devicetree binding for Anbernic RG353PS. This device is identical to the RG353P, except it does not have a touchscreen, does not have an eMMC, only includes 1GB of RAM, and ships with only the 2nd revision panel based on a Sitronix ST7703 controller. Support for the panel has been added in a separate commit. Signed-off-by: Chris Morgan Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230512162039.31132-2-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit d42a2a89121071cc8dd285235253a4c739641635 Author: Borislav Petkov (AMD) Date: Sat May 13 16:01:39 2023 +0200 x86/alternatives: Fix section mismatch warnings Fix stuff like: WARNING: modpost: vmlinux.o: section mismatch in reference: \ __optimize_nops (section: .text) -> debug_alternative (section: .init.data) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230513160146.16039-1-bp@alien8.de commit 305c041899971ff210ad5f9c50249d179c95ada4 Author: Vladimir Nikishkin Date: Fri May 12 11:40:34 2023 +0800 selftests: net: vxlan: Add tests for vxlan nolocalbypass option. Add test to make sure that the localbypass option is on by default. Add test to change vxlan localbypass to nolocalbypass and check that packets are delivered to userspace. Signed-off-by: Vladimir Nikishkin Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 69474a8a5837be63f13c6f60a7d622b98ed5c539 Author: Vladimir Nikishkin Date: Fri May 12 11:40:33 2023 +0800 net: vxlan: Add nolocalbypass option to vxlan. If a packet needs to be encapsulated towards a local destination IP, the packet will undergo a "local bypass" and be injected into the Rx path as if it was received by the target VXLAN device without undergoing encapsulation. If such a device does not exist, the packet will be dropped. There are scenarios where we do not want to perform such a bypass, but instead want the packet to be encapsulated and locally received by a user space program for post-processing. To that end, add a new VXLAN device attribute that controls whether a "local bypass" is performed or not. Default to performing a bypass to maintain existing behavior. Signed-off-by: Vladimir Nikishkin Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 7eef636ecc58b3bf330cd25d9129e2f2d379a65a Merge: ba79e9a73284f 7e400ff35cbe3 Author: David S. Miller Date: Sat May 13 16:56:29 2023 +0100 Merge branch 'broadcom-phy-wol' Florian Fainelli says: ==================== Support for Wake-on-LAN for Broadcom PHYs This patch series adds support for Wake-on-LAN to the Broadcom PHY driver. Specifically the BCM54210E/B50212E are capable of supporting Wake-on-LAN using an external pin typically wired up to a system's GPIO. These PHY operate a programmable Ethernet MAC destination address comparator which will fire up an interrupt whenever a match is received. Because of that, it was necessary to introduce patch #1 which allows the PHY driver's ->suspend() routine to be called unconditionally. This is necessary in our case because we need a hook point into the device suspend/resume flow to enable the wake-up interrupt as late as possible. Patch #2 adds support for the Broadcom PHY library and driver for Wake-on-LAN proper with the WAKE_UCAST, WAKE_MCAST, WAKE_BCAST, WAKE_MAGIC and WAKE_MAGICSECURE. Note that WAKE_FILTER is supportable, however this will require further discussions and be submitted as a RFC series later on. Patch #3 updates the GENET driver to defer to the PHY for Wake-on-LAN if the PHY supports it, thus allowing the MAC to be powered down to conserve power. Changes in v3: - collected Reviewed-by tags - explicitly use return 0 in bcm54xx_phy_probe() (Paolo) Changes in v2: - introduce PHY_ALWAYS_CALL_SUSPEND and only have the Broadcom PHY driver set this flag to minimize changes to the suspend flow to only drivers that need it - corrected possibly uninitialized variable in bcm54xx_set_wakeup_irq (Simon) ==================== Signed-off-by: David S. Miller commit 7e400ff35cbe3b25fc1da1586b6cd9bc426dfb1c Author: Florian Fainelli Date: Thu May 11 10:21:10 2023 -0700 net: bcmgenet: Add support for PHY-based Wake-on-LAN If available, interrogate the PHY to find out whether we can use it for Wake-on-LAN. This can be a more power efficient way of implementing that feature, especially when the MAC is powered off in low power states. Reviewed-by: Simon Horman Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit 8baddaa9d4bac939004b5058f3ade7e2bf0a6e43 Author: Florian Fainelli Date: Thu May 11 10:21:09 2023 -0700 net: phy: broadcom: Add support for Wake-on-LAN Add support for WAKE_UCAST, WAKE_MCAST, WAKE_BCAST, WAKE_MAGIC and WAKE_MAGICSECURE. This is only supported with the BCM54210E and compatible Ethernet PHYs. Using the in-band interrupt or an out of band GPIO interrupts are supported. Broadcom PHYs will generate a Wake-on-LAN level low interrupt on LED4 as soon as one of the supported patterns is being matched. That includes generating such an interrupt even if the PHY is operated during normal modes. If WAKE_UCAST is selected, this could lead to the LED4 interrupt firing up for every packet being received which is absolutely undesirable from a performance point of view. Because the Wake-on-LAN configuration can be set long before the system is actually put to sleep, we cannot have an interrupt service routine to clear on read the interrupt status register and ensure that new packet matches will be detected. It is desirable to enable the Wake-on-LAN interrupt as late as possible during the system suspend process such that we limit the number of interrupts to be handled by the system, but also conversely feed into the Linux's system suspend way of dealing with interrupts in and around the points of no return. Reviewed-by: Simon Horman Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit a7e3448086d580abadccff399316c6eb5ecdedbf Author: Florian Fainelli Date: Thu May 11 10:21:08 2023 -0700 net: phy: Allow drivers to always call into ->suspend() A few PHY drivers are currently attempting to not suspend the PHY when Wake-on-LAN is enabled, however that code is not currently executing at all due to an early check in phy_suspend(). This prevents PHY drivers from making an appropriate decisions and put the hardware into a low power state if desired. In order to allow the PHY drivers to opt into getting their ->suspend routine to be called, add a PHY_ALWAYS_CALL_SUSPEND bit which can be set. A boolean that tracks whether the PHY or the attached MAC has Wake-on-LAN enabled is also provided for convenience. If phydev::wol_enabled then the PHY shall not prevent its own Wake-on-LAN detection logic from working and shall not prevent the Ethernet MAC from receiving packets for matching. Reviewed-by: Simon Horman Reviewed-by: Andrew Lunn Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller commit c21c0f9a20a963f5a1874657a4e3d657503f7815 Author: Chuang Zhang Date: Mon Apr 24 19:05:15 2023 +0800 Binder: Add async from to transaction record This commit adds support for getting the pid and tid information of the sender for asynchronous transfers in binderfs transfer records. In previous versions, it was not possible to obtain this information from the transfer records. While this information may not be necessary for all use cases, it can be useful in some scenarios. Signed-off-by: Chuang Zhang Acked-by: Carlos Llamas Link: https://lore.kernel.org/r/0c1e8bd37c68dd1518bb737b06b768cde9659386.1682333709.git.zhangchuang3@xiaomi.com Signed-off-by: Greg Kroah-Hartman commit 800936191a26a5aba5caa3cbd70a4154b45eb94a Author: Chuang Zhang Date: Mon Apr 24 19:05:14 2023 +0800 Binder: Add timestamp to transaction record This patch adds a timestamp field to the binder_transaction structure to track the time consumed during transmission when reading binder_transaction records. Signed-off-by: Chuang Zhang Acked-by: Carlos Llamas Link: https://lore.kernel.org/r/5ac8c0d09392290be789423f0dd78a520b830fab.1682333709.git.zhangchuang3@xiaomi.com Signed-off-by: Greg Kroah-Hartman commit 1f3413dc8eb0de023c5ec5994aef8225262d0f19 Author: Yogesh Hegde Date: Wed May 10 20:40:04 2023 +0530 staging: rtl8192e: Refactor tmp_ofdm_index variable assignment Refactor tmp_ofdm_index variable assignment to avoid multiple assignments which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/af7bc22ec142c33cf7346c1ab13d192b55095d1e.1683730854.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 94c41266111b66c6c6de621bafde0c8fafcd6f7d Author: Yogesh Hegde Date: Wed May 10 20:39:42 2023 +0530 staging: rtl8192e: Rename tmpCCK20Mindex and tmpCCK40Mindex Rename variable tmpCCK20Mindex to tmp_cck_20m_index and tmpCCK40Mindex to tmp_cck_40m_index to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/3e8b6cd85e6e4fcc934cc1d813f5f594cef8ff92.1683730854.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9c2501d68eaf9e9e550079e5d48d99bcd3687918 Author: Yogesh Hegde Date: Wed May 10 20:39:25 2023 +0530 staging: rtl8192e: Rename tmpOFDMindex and tmpCCKindex Rename variable tmpOFDMindex to tmp_ofdm_index and tmpCCKindex to tmp_cck_index to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/48098479094e4562fe196cbce813476041a664df.1683730854.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2151bbbdf7529ce21b96e084ec2f0973412f79b2 Author: Yogesh Hegde Date: Wed May 10 20:39:07 2023 +0530 staging: rtl8192e: Rename tmpRegA and TempCCk Rename variable tmpRegA to tmp_reg, TempCCk to tmp_cck to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/c9c67f832db3a776c04f26e0afb083ae3ba99c07.1683730854.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit d5b3d02d0b107345f2a6ecb5b06f98356f5c97ab Author: Uwe Kleine-König Date: Fri May 12 19:38:10 2023 +0200 serial: Make uart_remove_one_port() return void The return value is only ever used as a return value for remove callbacks of platform drivers. This return value is ignored by the driver core. (The only effect is an error message, but uart_remove_one_port() already emitted one in this case.) So the return value isn't used at all and uart_remove_one_port() can be changed to return void without any loss. Also this better matches the Linux device model as remove functions are not supposed to fail. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512173810.131447-3-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 6bd6cd29c92401a101993290051fa55078238a52 Author: Uwe Kleine-König Date: Fri May 12 19:38:09 2023 +0200 serial: stm32: Ignore return value of uart_remove_one_port() in .remove() Returning early from stm32_usart_serial_remove() results in a resource leak as several cleanup functions are not called. The driver core ignores the return value and there is no possibility to clean up later. uart_remove_one_port() only returns non-zero if there is some inconsistency (i.e. stm32_usart_driver.state[port->line].uart_port == NULL). This should never happen, and even if it does it's a bad idea to exit early in the remove callback without cleaning up. This prepares changing the prototype of struct platform_driver::remove to return void. See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for further details about this quest. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230512173810.131447-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 72fc578b220c417787384ac7c3e235e98f218be6 Author: Ilpo Järvinen Date: Thu May 11 15:10:29 2023 +0300 serial: 8250_rt288x: Remove unnecessary UART_REG_UNMAPPED As unmapped registers are at the tail of the array, the ARRAY_SIZE() condition will catch them just fine. No need to define special value for them. Convert the arrays to u8 as all entiries are now positive. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230511121029.13128-7-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 33e3b0eb755074a870fd926ebd84de52e7302090 Author: Ilpo Järvinen Date: Thu May 11 15:10:28 2023 +0300 serial: 8250_rt288x: Name non-standard divisor latch reg Instead of a literal, add proper name for the non-standard divisor latch register. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230511121029.13128-6-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit b334214ea08d941af376fec853621d856b12bc81 Author: Ilpo Järvinen Date: Thu May 11 15:10:27 2023 +0300 serial: 8250: RT288x/Au1xxx code away from core A non-trivial amount of RT288x/Au1xxx code is encapsulated into ifdeffery in 8250_port / 8250_early and some if UPIO_AU blocks. Create a separate file from them. Also handle errors properly in the cases where RT288x/Au1xxx code is not configured. It seems that 0x1000 mapsize is likely overkill but I've kept it the same as previously (the value was shrunk to that value in commit b2b13cdfd05e ("SERIAL 8250: Fixes for Alchemy UARTs.")). Seemingly, the driver only needs to access register at 0x28 for the divisor latch. The Kconfig side is a bit tricky. As SERIAL_8250_RT288X is bool it can only be =y. It is possible to have SERIAL_8250=m + SERIAL_8250_RT288X=y which required altering when 8250/ is included or the rt288x would not be built. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230511121029.13128-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 30c61f53fdf23e8a396dca8378615b4900edff6f Author: Ilpo Järvinen Date: Thu May 11 15:10:26 2023 +0300 serial: 8250: Add dl_read/write, bugs and mapsize into plat_serial8250_port Add mapsize, bugs, and divisor latch read/write functions (->dl_read/write()) into plat_serial8250_port to carry the setup necessary for RT288x/Au1xxx devices over to uart port. Document the added members with kerneldoc style but do not enable kerneldoc yet as there are many fields which remain undocumented. While at it, convert .bugs in struct uart_8250_port to u16 to match it with the type used in struct plat_serial8250_port. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230511121029.13128-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 98658ae8f3925d05c2d0c67749ff6cf47b9077a5 Author: Ilpo Järvinen Date: Thu May 11 15:10:25 2023 +0300 serial: 8250: Document uart_8250_port's ->dl_read/write() Add documentation for the struct uart_8250_port divisor latch function pointers. Documentation is in kernel doc format but don't enable kernel doc yet as many other fields remain undocumented. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230511121029.13128-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit b245aa0cc583c3efa0335c50f309a32e5fec8ab7 Author: Ilpo Järvinen Date: Thu May 11 15:10:24 2023 +0300 serial: 8250: Change dl_read/write to handle value as u32 Divisor latch read/write functions currently handle the value is int. As the value is related to HW context, u32 makes much more sense than a signed type. While at it, name the parameters in the callback signature. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230511121029.13128-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 9d86719f8769244dc99b8cb6091c41eae3fd684f Author: Tony Lindgren Date: Mon May 8 14:19:02 2023 +0300 serial: 8250: Allow using ports higher than SERIAL_8250_RUNTIME_UARTS We already allocate CONFIG_SERIAL_8250_NR_UARTS, but only allow using CONFIG_SERIAL_8250_RUNTIME_UARTS uarts unless nr_uarts module params is set. This causes issues for using distro kernels on SoCs with a large number of serial ports. Let's allow up to CONFIG_SERIAL_8250_NR_UARTS instead. To do this, we init the ports as needed if the initial uarts was too low. This way there's no need to set the value for CONFIG_SERIAL_8250_RUNTIME_UARTS to some SoC specific higher value. Typically the default value of 4 can be used as set for legacy reasons. Note that limiting the number of intial uarts still works as before unless a serial console on a higher port is specified. In this case we will increase the nr_ports up to the console port specified. Suggested-by: Andrew Davis Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230508111903.39339-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit db86bb6ed4979ed8a987057f9098ea88f85e48be Author: Tony Lindgren Date: Mon May 8 11:20:14 2023 +0300 serial: 8250: omap: Shut down on remove for console uart When unbinding the console uart, we want to power down the uart hardware on remove. For the console uart, the normal shutdown path will never get called as the cons_filp stays open. Let's rearrange the dma related functions a bit so we can call driver shutdown also on console uart rebind. Currently we set up->dma on probe, but that causes issues calling omap_8250_shutdown() on remove. The dma startup will not get called on the next rebind as we still have up->dma set from probe. Note that serial8250_release_dma() already checks for dma so we can remove the check for it in 8205_omap driver. With these changes we also avoid hogging dma virtual channels for the unused uarts that may be limited on some devices. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230508082014.23083-5-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit fef4f600319e35b7121c3ea6005ee38626f4f959 Author: Tony Lindgren Date: Mon May 8 11:20:13 2023 +0300 serial: 8250: omap: Fix life cycle issues for interrupt handlers We have the struct uart_8250_port instance recycled on device rebind while the struct omap8250_priv instance is not. For the console uart, __tty_hangup() does not call tty->ops->hangup() as cons_filp stays open, and uart shutdown won't get called. This means we have a stale priv->wakeirq handler around after unbind, and port->irq is not freed on unbind. There's no need to claim the interrupts on startup. We can fix this and simplify the driver a bit by claiming the interrupts in probe, and clearing them on remove. For the device interrupt, we can use devm_request_irq(). To do this, we change omap8250_irq() to use struct omap8250_priv data directly so we don't have to wait for the assigned port from serial8250_register_8250_port(). We must also drop IRQF_SHARED to set IRQ_NOAUTOEN to avoid spurious interrupts until the port has been registered. There's no need for IRQF_SHARED for 8250_omap, the serial port interrupt lines are dedicated lines. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230508082014.23083-4-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 398cecc24846e867b9f90a0bd22730e3df6b05be Author: Tony Lindgren Date: Mon May 8 11:20:12 2023 +0300 serial: 8250: omap: Fix imprecise external abort for omap_8250_pm() We must idle the uart only after serial8250_unregister_port(). Otherwise unbinding the uart via sysfs while doing cat on the port produces an imprecise external abort: mem_serial_in from omap_8250_pm+0x44/0xf4 omap_8250_pm from uart_hangup+0xe0/0x194 uart_hangup from __tty_hangup.part.0+0x37c/0x3a8 __tty_hangup.part.0 from uart_remove_one_port+0x9c/0x22c uart_remove_one_port from serial8250_unregister_port+0x60/0xe8 serial8250_unregister_port from omap8250_remove+0x6c/0xd0 omap8250_remove from platform_remove+0x28/0x54 Turns out the driver needs to have runtime PM functional before the driver probe calls serial8250_register_8250_port(). And it needs runtime PM after driver remove calls serial8250_unregister_port(). On probe, we need to read registers before registering the port in omap_serial_fill_features_erratas(). We do that with custom uart_read() already. On remove, after serial8250_unregister_port(), we need to write to the uart registers to idle the device. Let's add a custom uart_write() for that. Currently the uart register access depends on port->membase to be initialized, which won't work after serial8250_unregister_port(). Let's use priv->membase instead, and use it for runtime PM related functions to remove the dependency to port->membase for early and late register access. Note that during use, we need to check for a valid port in the runtime PM related functions. This is needed for the optional wakeup configuration. We now need to set the drvdata a bit earlier so it's available for the runtime PM functions. With the port checks in runtime PM functions, the old checks for priv in omap8250_runtime_suspend() and omap8250_runtime_resume() functions are no longer needed and are removed. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230508082014.23083-3-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit b9ab22c2bc8652324a803b3e2be69838920b4025 Author: Tony Lindgren Date: Mon May 8 11:20:11 2023 +0300 serial: 8250: omap: Fix freeing of resources on failed register If serial8250_register_8250_port() fails, the SoC can hang as the deferred PMQoS work will still run as is not flushed and removed. Fixes: 61929cf0169d ("tty: serial: Add 8250-core based omap driver") Signed-off-by: Tony Lindgren Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230508082014.23083-2-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 6d8c1fca0a6ee4915781ded60000b3cc2c076e29 Author: Hongyu Xie Date: Mon May 1 15:09:09 2023 +0800 serial: pl011: set UART011_CR_RXE in pl011_set_termios after port shutdown UART011_CR_RXE is set in pl011_startup() during normal initialization, and cleared by pl011_disable_uart() during port shutdown. You can use a none-console port in poll mode like kgdboc does with tty_find_polling_driver() after a port shutdown. But pl011_startup() is not called in tty_find_polling_driver(). So you need to set UART011_CR_RXE to reenable receive function. Not sure setting UART011_CR_RXE in pl011_set_termios() is a good idea through. Signed-off-by: Hongyu Xie Link: https://lore.kernel.org/r/20230501070909.1144547-1-xiehongyu1@kylinos.cn Signed-off-by: Greg Kroah-Hartman commit cf9aa72d2f91defea23fe29b9e8e941bb2486d5c Author: Shenwei Wang Date: Wed May 10 15:33:59 2023 -0500 tty: serial: fsl_lpuart: optimize the timer based EOP logic DMA transfer may end prematurely due to the DMA Rx timeout even during an active transfer because a constant timeout does not accurately simulate an EOP (End Of Package) event. This patch uses a timer to simulate the hardware EOP event. The timer should only complete a DMA transfer once the idle period satisfies a specified interval which is baud rate dependent. The problem has been observed with low baud rates but could occur also with high baud rates. Make the DMA Rx timeout baud rate dependent and check the DMA residue count before copying data to the TTY buffer. If the residue count remains unchanged since the last interrupt, that indicates no new data was received. In this case, the DMA should complete as an EOP event. Otherwise, new data was received during the interval and the EOP condition is not met so restart the DMA Rx timeout Signed-off-by: Shenwei Wang Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230510203359.1353469-1-shenwei.wang@nxp.com Signed-off-by: Greg Kroah-Hartman commit a4422ff221429c600c3dc5d0394fb3738b89d040 Author: Bryan O'Donoghue Date: Mon May 8 15:23:02 2023 +0100 usb: typec: qcom: Add Qualcomm PMIC Type-C driver This commit adds a QCOM PMIC TCPM driver with an initial pm8150b block. The driver is layered as follows: qcom_pmic_typec.c : Responsible for registering with TCPM and arbitrates access to the Type-C and PDPHY hardware blocks in one place. This presents a single TCPM device to device to the Linux TCPM layer. qcom_pmic_typec_pdphy.c: Responsible for interfacing with the PDPHY hardware and processing power-delivery related calls from TCPM. This hardware binding can be extended to facilitate similar hardware in different PMICs. qcom_pmic_typec_port.c: Responsible for notifying and processing Type-C related calls from TCPM. Similar to the pdphy this layer can be extended to handle the specifics of different Qualcomm PMIC Type-C port managers. This code provides all of the same functionality as the existing qcom typec driver plus power-delivery as well. As a result commit 6c8cf3695176 ("usb: typec: Add QCOM PMIC typec detection driver") can be deleted entirely. References code from Jonathan Marek, Jack Pham, Wesley Cheng, Hemant Kumar, Guru Das Srinagesh and Ashay Jaiswal. Acked-by: Heikki Krogerus Reviewed-by: Guenter Roeck Reviewed-by: Caleb Connolly Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230508142308.1656410-8-bryan.odonoghue@linaro.org Signed-off-by: Greg Kroah-Hartman commit 00bb478b829e68b856681002f52b00f8581316e6 Author: Bryan O'Donoghue Date: Mon May 8 15:23:00 2023 +0100 dt-bindings: usb: Add Qualcomm PMIC Type-C Add a description for the Type-C silicon interface inside Qualcomm's PM8150b hardware block. Based on original work by Wesley. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Wesley Cheng Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230508142308.1656410-6-bryan.odonoghue@linaro.org Signed-off-by: Greg Kroah-Hartman commit 6bae03b0484b54f699d69339fbec5658e885c224 Author: Dmitry Rokosov Date: Fri May 12 00:04:55 2023 +0300 usb: dwc3-meson-g12a: support OTG switch for all IP versions From now, the Amlogic A1 USB controller is capable of switching between host and gadget modes based on the status of the OTG_ID signal or via manual USB role change. Previously, only the Amlogic A1 IP version did not use OTG support for host only mode, but this is no longer applicable. Therefore, the 'otg_switch_supported' option can now be removed as it is no longer required. Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230511210455.6634-4-ddrokosov@sberdevices.ru Signed-off-by: Greg Kroah-Hartman commit a9889e71b5e90665bfa90d8dd350caa2d3ee7797 Author: Dmitry Rokosov Date: Fri May 12 00:04:54 2023 +0300 dt-bindings: usb: dwc2: add support for Amlogic A1 SoC USB peripheral Provide the appropriate compatible string for the DWC2 IP that is found inside the Amlogic A1 SoC and used in peripheral mode. Signed-off-by: Dmitry Rokosov Acked-by: Rob Herring Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230511210455.6634-3-ddrokosov@sberdevices.ru Signed-off-by: Greg Kroah-Hartman commit be877fbf8968f870279c8384b41c6bd6c3863068 Author: Dmitry Rokosov Date: Fri May 12 00:04:53 2023 +0300 usb: dwc2: support dwc2 IP for Amlogic A1 SoC family The Amlogic A1 uses dwc2 Synopsys IP as its USB peripheral (gadget) endpoint, with different DWC2 parameters when compared to previous Amlogic SoCs. Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Acked-by: Minas Harutyunyan Link: https://lore.kernel.org/r/20230511210455.6634-2-ddrokosov@sberdevices.ru Signed-off-by: Greg Kroah-Hartman commit d34f9bafa78da2a561c67d9daf55fc4d1d80edf0 Author: Krishna Kurapati Date: Wed May 10 13:22:52 2023 +0530 usb: gadget: udc: Handle gadget_connect failure during bind operation In the event, gadget_connect call (which invokes pullup) fails, propagate the error to udc bind operation which inturn sends the error to configfs. The userspace can then retry enumeartion if it chooses to. Signed-off-by: Krishna Kurapati Acked-by: Alan Stern Link: https://lore.kernel.org/r/20230510075252.31023-3-quic_kriskura@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 813f44d57e19ccaa7330e829bd913515be42719d Author: Krishna Kurapati Date: Wed May 10 13:22:51 2023 +0530 usb: dwc3: gadget: Bail out in pullup if soft reset timeout happens If the core soft reset timeout happens, avoid setting up event buffers and starting gadget as the writes to these registers may not reflect when in reset and setting the run stop bit can lead the controller to access wrong event buffer address resulting in a crash. Signed-off-by: Krishna Kurapati Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230510075252.31023-2-quic_kriskura@quicinc.com Signed-off-by: Greg Kroah-Hartman commit ada050c69108bc34be13ecc11f7fad0f20ebadc4 Author: Christophe JAILLET Date: Fri May 5 19:15:08 2023 +0200 usb: dwc2: Fix some error handling paths dwc2_driver_probe() calls dwc2_lowlevel_hw_init() which deassert some reset lines. Should an error happen in dwc2_lowlevel_hw_init() after calling reset_control_deassert() or in the probe after calling dwc2_lowlevel_hw_init(), the reset lines remain deasserted. Add some devm_add_action_or_reset() calls to re-assert the lines if needed. Update the remove function accordingly. This change is compile-tested only. Fixes: 83f8da562f8b ("usb: dwc2: Add reset control to dwc2") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/c64537b5339342bd00f7c2152b8fc23792b9f95a.1683306479.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 2f28c3c9c34742d501b623acf8ebfe3a7faed8a3 Author: Roy Luo Date: Thu May 4 00:01:29 2023 +0000 usb: dwc3: Add error logs for unknown endpoint events In cases where the controller somehow fails to write to event buffer memory (e.g. due to incorrect MMU config), the driver would receive all-zero dwc3 events. However, the abnormal event is silently dropped as a regular ep0out event. Add error logs when an unknown endpoint event is received to highlight the anomaly. Signed-off-by: Roy Luo Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230504000129.728316-1-royluo@google.com Signed-off-by: Greg Kroah-Hartman commit 02be19e914b8ec5b4e355508daf640dde761d300 Author: Michal Simek Date: Fri May 12 14:39:41 2023 +0200 dt-bindings: usb: Add support for Microchip usb5744 hub controller The Microchip usb5744 is a SS/HS USB 3.0 hub controller with 4 ports. Add description for USB related aspects of the USB5744 hub, it as well cover the option of connecting the controller as an i2c slave. When i2c interface is connected hub needs to be initialized first. Hub itself has fixed i2c address 0x2D but hardcoding address is not good idea because address can be shifted by i2c address translator in the middle. Signed-off-by: Piyush Mehta Signed-off-by: Michal Simek Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/067fb163bfe3162c596a6c69c96c43ac78288628.1683895176.git.michal.simek@amd.com Signed-off-by: Greg Kroah-Hartman commit 397376765249555800749d012b301609c62ae963 Author: Henry Lin Date: Fri May 12 16:04:23 2023 +0800 usb: xhci: tegra: enable stream protocol support This commit enables stream transfer protocol for Tegra XHCI. Signed-off-by: Henry Lin Signed-off-by: Jim Lin Link: https://lore.kernel.org/r/20230512080423.27978-1-jilin@nvidia.com Signed-off-by: Greg Kroah-Hartman commit 424e02931e2bad6f8c442fd3d548379123bf1b13 Author: Stanley Chang Date: Wed May 10 15:51:29 2023 +0800 usb: xhci: plat: remove error log for failure to get usb-phy Remove this log to avoid non-error conditions. If CONFIG_USB_PHY is disabled, the following error message appears: [ 0.231609] xhci-hcd f10f0000.usb3: xhci_plat_probe get usb3phy fail (ret=-6) [ 0.239716] xhci-hcd f10f8000.usb3: xhci_plat_probe get usb3phy fail (ret=-6) In this case, devm_usb_get_phy_by_phandle is declared static inline and returns -ENXIO. It is easy to pinpoint the failure to get the usb-phy using the debug log in drivers/usb/phy/phy.c. Therefore, it can be removed. Signed-off-by: Stanley Chang Tested-by: Klaus Kudielka Link: https://lore.kernel.org/r/20230510075129.28047-1-stanley_chang@realtek.com Signed-off-by: Greg Kroah-Hartman commit ec5eb43813a4c775b5abf20f50461037bca7c4e5 Author: Stanley Chang Date: Fri May 5 10:50:54 2023 +0800 usb: dwc3: core: add support for realtek SoCs custom's global register start address The Realtek RTD SoCs were designed with the global register address offset at 0x8100. The default address offset is constant at DWC3_GLOBALS_REGS_START (0xc100). Therefore, add a check if the compatible name of the parent is realtek,rtd-dwc3, then global register start address will remap to 0x8100. Signed-off-by: Stanley Chang Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230505025104.18321-1-stanley_chang@realtek.com Signed-off-by: Greg Kroah-Hartman commit 1c024241d018cf9fc17aa8d95c3fe77d671d7142 Author: Basavaraj Natikar Date: Fri Apr 28 19:30:56 2023 +0530 xhci: Improve the XHCI system resume time Avoid extra 120ms delay during system resume. The xHC controller may signal wake up to 120ms before showing which usb device caused the wake on the xHC port registers. The xhci driver therefore checks for port activity up to 120ms during resume, making sure that the hub driver can see the port change, and won't immediately runtime suspend back due to no port activity. This is however only needed for runtime resume as system resume will resume all child hubs and other child usb devices anyway. Fixes: 253f588c70f6 ("xhci: Improve detection of device initiated wake signal.") Signed-off-by: Basavaraj Natikar Acked-by: Mathias Nyman Link: https://lore.kernel.org/r/20230428140056.1318981-3-Basavaraj.Natikar@amd.com Signed-off-by: Greg Kroah-Hartman commit 1f7d5520719dd1fed1a2947679f6cc26a55f1e6b Author: Basavaraj Natikar Date: Fri Apr 28 19:30:55 2023 +0530 USB: Extend pci resume function to handle PM events Currently, the pci_resume method has only a flag indicating whether the system is resuming from hibernation. In order to handle all PM events like AUTO_RESUME (runtime resume from device in D3), RESUME (system resume from s2idle, S3 or S4 states) etc change the pci_resume method to handle all PM events. Signed-off-by: Basavaraj Natikar Acked-by: Alan Stern Acked-by: Mathias Nyman Link: https://lore.kernel.org/r/20230428140056.1318981-2-Basavaraj.Natikar@amd.com Signed-off-by: Greg Kroah-Hartman commit 1cce2b71ef7aa7e01f894c2c720fd7febda402c5 Author: Andrew Lunn Date: Sat Apr 8 17:28:01 2023 +0200 arm64: dts: freescale: ZII: Add missing phy-mode The DSA framework has got more picky about always having a phy-mode for the CPU port. The imx8mq Ethernet is being configured to RMII. Set the switch phy-mode based on this. Additionally, the cpu label has never actually been used in the binding, so remove it. Signed-off-by: Andrew Lunn Reviewed-by: Vladimir Oltean Signed-off-by: Shawn Guo commit 0eea5c60c15fedd61dede52883745ab7e6a28562 Author: Andrew Lunn Date: Sat Apr 8 17:28:00 2023 +0200 ARM: dts: imx6qdl: Add missing phy-mode and fixed links The DSA framework has got more picky about always having a phy-mode for the CPU port. Add a phy-mode based on what the SoC ethernet is using. For RGMII mode, have the switch add the delays. Additionally, the cpu label has never actually been used in the binding, so remove it. Lastly add a fixed-link node indicating the expected speed/duplex of the link to the SoC. Signed-off-by: Andrew Lunn Reviewed-by: Vladimir Oltean Signed-off-by: Shawn Guo commit 5c9347e80b0ab2da6f1d5ec174378af40b25b3e6 Author: Andrew Lunn Date: Sat Apr 8 17:27:59 2023 +0200 ARM: dts: imx51: ZII: Add missing phy-mode The DSA framework has got more picky about always having a phy-mode for the CPU port. The imx51 Ethernet supports MII, and RMII. Set the switch phy-mode based on how the SoC Ethernet port has been configured. Additionally, the cpu label has never actually been used in the binding, so remove it. Signed-off-by: Andrew Lunn Reviewed-by: Vladimir Oltean Signed-off-by: Shawn Guo commit 63a208bf7c372f1ec800c6f54215673362007b85 Author: Fabio Estevam Date: Fri Apr 7 13:14:44 2023 -0300 ARM: dts: imx28-cfa: Replace deprecated spi-gpio properties As stated in Documentation/devicetree/bindings/spi/spi-gpio.yaml, 'gpio-miso', 'gpio-mosi' and 'gpio-sck' are deprecated properties. Use the recommeded 'miso-gpios', 'mosi-gpios' and 'sck-gpios' instead. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 49855ff5daa140bcdceb288978cd7cfc57594006 Author: Fabio Estevam Date: Fri Apr 7 13:14:43 2023 -0300 ARM: dts: imx28-tx28: Replace deprecated spi-gpio properties As stated in Documentation/devicetree/bindings/spi/spi-gpio.yaml, 'gpio-miso', 'gpio-mosi' and 'gpio-sck' are deprecated properties. Use the recommeded 'miso-gpios', 'mosi-gpios' and 'sck-gpios' instead. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 7aac4615ea0e7c7ea4e1a343b0f1da6822a2c53f Author: Fabio Estevam Date: Fri Apr 7 13:14:42 2023 -0300 ARM: dts: imx6ul-tx6ul: Replace deprecated spi-gpio properties As stated in Documentation/devicetree/bindings/spi/spi-gpio.yaml, 'gpio-miso', 'gpio-mosi' and 'gpio-sck' are deprecated properties. Use the recommeded 'miso-gpios', 'mosi-gpios' and 'sck-gpios' instead. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit b5b5d74068c59ded4e466daf5d9fe2767fb6330b Author: Fabio Estevam Date: Fri Apr 7 13:14:41 2023 -0300 ARM: dts: vf610-zii-dev-rev-b: Replace deprecated spi-gpio properties As stated in Documentation/devicetree/bindings/spi/spi-gpio.yaml, 'gpio-miso', 'gpio-mosi' and 'gpio-sck' are deprecated properties. Use the recommeded 'miso-gpios', 'mosi-gpios' and 'sck-gpios' instead. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 48800d49c9976a73c8e184d0e288c058466931db Author: Fabio Estevam Date: Fri Apr 7 13:14:40 2023 -0300 ARM: dts: imx51-zii-rdu1: Replace deprecated spi-gpio properties As stated in Documentation/devicetree/bindings/spi/spi-gpio.yaml, 'gpio-miso', 'gpio-mosi' and 'gpio-sck' are deprecated properties. Use the recommeded 'miso-gpios', 'mosi-gpios' and 'sck-gpios' instead. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit b5ed9750483248f8b4da29f881b583ef0f43e716 Author: Fabio Estevam Date: Fri Apr 7 13:14:39 2023 -0300 ARM: dts: imx6ul-14x14-evk: Replace deprecated spi-gpio properties As stated in Documentation/devicetree/bindings/spi/spi-gpio.yaml, 'gpio-mosi' and 'gpio-sck' are deprecated properties. Use the recommeded 'mosi-gpios' and 'sck-gpios' instead. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 969dd087b9395298804c9fe2802fde6e67c888e4 Author: Fabio Estevam Date: Fri Apr 7 13:14:38 2023 -0300 ARM: dts: imx7d-sdb: Replace deprecated spi-gpio properties As stated in Documentation/devicetree/bindings/spi/spi-gpio.yaml, 'gpio-mosi' and 'gpio-sck' are deprecated properties. Use the recommeded 'mosi-gpios' and 'sck-gpios' instead. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 145e2732a5e979f37a8dcb88b1ed6d3123213dea Author: Christoph Niedermaier Date: Fri Apr 7 12:49:43 2023 +0200 ARM: dts: imx6ull-dhcor: Add Marantec maveo box Add support for Marantec maveo box. The system is used to get a smart conntection to a door drive. It has USB, WiFi, Bluetooth, Zigbee and NFC interfaces. The core of this system is a soldered i.MX6ULL DHCOR SoM from DH electronics. Signed-off-by: Christoph Niedermaier Signed-off-by: Shawn Guo commit 97dadebe5fa69a32b82fb64cfec87d2e8c63ed2e Author: Christoph Niedermaier Date: Fri Apr 7 12:49:42 2023 +0200 ARM: dts: imx6ull-dhcor: Remove mmc aliases from DHCOR SoM To be able to define mmc aliases correctly for a DHCOR board remove mmc aliases from the DHCOR SoM layer. All DHCOM SoM boards are based on the DHCOR SoM, as the DHCOR SoM is soldered on top of the DHCOM SoM. As a result, remove the mmc /delete-property/ entries from the aliases node in the DHCOM SoM layer, because this is already removed in the DHCOR SoM layer below. Signed-off-by: Christoph Niedermaier Signed-off-by: Shawn Guo commit b1f8ac879346bd8415e405dd9b6c032007b3198e Author: Christoph Niedermaier Date: Fri Apr 7 12:49:41 2023 +0200 dt-bindings: arm: fsl: Add Marantec maveo box as a DHCOR i.MX6ULL SoM based board Add Marantec maveo box. The system is used to get a smart conntection to a door drive. The core of this system is a soldered i.MX6ULL DHCOR SoM from DH electronics. Signed-off-by: Christoph Niedermaier Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit bdeeed3498c7871c17465bb4f11d1bc67f9098af Author: Andrii Nakryiko Date: Mon May 8 23:55:02 2023 -0700 libbpf: fix offsetof() and container_of() to work with CO-RE It seems like __builtin_offset() doesn't preserve CO-RE field relocations properly. So if offsetof() macro is defined through __builtin_offset(), CO-RE-enabled BPF code using container_of() will be subtly and silently broken. To avoid this problem, redefine offsetof() and container_of() in the form that works with CO-RE relocations more reliably. Fixes: 5fbc220862fc ("tools/libpf: Add offsetof/container_of macro in bpf_helpers.h") Reported-by: Lennart Poettering Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230509065502.2306180-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit ee9fd0ac3017c4313be91a220a9ac4c99dde7ad4 Author: Martin KaFai Lau Date: Wed May 10 21:37:48 2023 -0700 bpf: Address KCSAN report on bpf_lru_list KCSAN reported a data-race when accessing node->ref. Although node->ref does not have to be accurate, take this chance to use a more common READ_ONCE() and WRITE_ONCE() pattern instead of data_race(). There is an existing bpf_lru_node_is_ref() and bpf_lru_node_set_ref(). This patch also adds bpf_lru_node_clear_ref() to do the WRITE_ONCE(node->ref, 0) also. ================================================================== BUG: KCSAN: data-race in __bpf_lru_list_rotate / __htab_lru_percpu_map_update_elem write to 0xffff888137038deb of 1 bytes by task 11240 on cpu 1: __bpf_lru_node_move kernel/bpf/bpf_lru_list.c:113 [inline] __bpf_lru_list_rotate_active kernel/bpf/bpf_lru_list.c:149 [inline] __bpf_lru_list_rotate+0x1bf/0x750 kernel/bpf/bpf_lru_list.c:240 bpf_lru_list_pop_free_to_local kernel/bpf/bpf_lru_list.c:329 [inline] bpf_common_lru_pop_free kernel/bpf/bpf_lru_list.c:447 [inline] bpf_lru_pop_free+0x638/0xe20 kernel/bpf/bpf_lru_list.c:499 prealloc_lru_pop kernel/bpf/hashtab.c:290 [inline] __htab_lru_percpu_map_update_elem+0xe7/0x820 kernel/bpf/hashtab.c:1316 bpf_percpu_hash_update+0x5e/0x90 kernel/bpf/hashtab.c:2313 bpf_map_update_value+0x2a9/0x370 kernel/bpf/syscall.c:200 generic_map_update_batch+0x3ae/0x4f0 kernel/bpf/syscall.c:1687 bpf_map_do_batch+0x2d9/0x3d0 kernel/bpf/syscall.c:4534 __sys_bpf+0x338/0x810 __do_sys_bpf kernel/bpf/syscall.c:5096 [inline] __se_sys_bpf kernel/bpf/syscall.c:5094 [inline] __x64_sys_bpf+0x43/0x50 kernel/bpf/syscall.c:5094 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd read to 0xffff888137038deb of 1 bytes by task 11241 on cpu 0: bpf_lru_node_set_ref kernel/bpf/bpf_lru_list.h:70 [inline] __htab_lru_percpu_map_update_elem+0x2f1/0x820 kernel/bpf/hashtab.c:1332 bpf_percpu_hash_update+0x5e/0x90 kernel/bpf/hashtab.c:2313 bpf_map_update_value+0x2a9/0x370 kernel/bpf/syscall.c:200 generic_map_update_batch+0x3ae/0x4f0 kernel/bpf/syscall.c:1687 bpf_map_do_batch+0x2d9/0x3d0 kernel/bpf/syscall.c:4534 __sys_bpf+0x338/0x810 __do_sys_bpf kernel/bpf/syscall.c:5096 [inline] __se_sys_bpf kernel/bpf/syscall.c:5094 [inline] __x64_sys_bpf+0x43/0x50 kernel/bpf/syscall.c:5094 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0x01 -> 0x00 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 11241 Comm: syz-executor.3 Not tainted 6.3.0-rc7-syzkaller-00136-g6a66fdd29ea1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 ================================================================== Reported-by: syzbot+ebe648a84e8784763f82@syzkaller.appspotmail.com Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230511043748.1384166-1-martin.lau@linux.dev Signed-off-by: Alexei Starovoitov commit 7b99f75942da332e3f4f865e55a10fec95a30d4f Author: Alan Maguire Date: Wed May 10 14:02:41 2023 +0100 bpf: Add --skip_encoding_btf_inconsistent_proto, --btf_gen_optimized to pahole flags for v1.25 v1.25 of pahole supports filtering out functions with multiple inconsistent function prototypes or optimized-out parameters from the BTF representation. These present problems because there is no additional info in BTF saying which inconsistent prototype matches which function instance to help guide attachment, and functions with optimized-out parameters can lead to incorrect assumptions about register contents. So for now, filter out such functions while adding BTF representations for functions that have "."-suffixes (foo.isra.0) but not optimized-out parameters. This patch assumes that below linked changes land in pahole for v1.25. Issues with pahole filtering being too aggressive in removing functions appear to be resolved now, but CI and further testing will confirm. Signed-off-by: Alan Maguire Acked-by: Jiri Olsa Link: https://lore.kernel.org/r/20230510130241.1696561-1-alan.maguire@oracle.com Signed-off-by: Alexei Starovoitov commit d3b52f71d18513c209465ba65e0c524b9733351b Author: Adrian Hunter Date: Mon Apr 24 08:51:07 2023 +0300 perf script: Refine printing of dso offset (dsoff) Print dso offset only for object files, and in those cases force using the dso->long_name if the dso->name starts with '[' or the dso is kcore, in order to avoid special names such as [vdso], or mixing up kcore with vmlinux. Signed-off-by: Adrian Hunter Cc: Changbin Du Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20230424055107.12105-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 24f0af6d038af461c97433cd80b688eb0346a466 Author: Adrian Hunter Date: Mon Apr 24 08:51:06 2023 +0300 perf dso: Declare dso const as needed Declare dso const, so that functions can be called with const struct *dso. Signed-off-by: Adrian Hunter Cc: Changbin Du Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20230424055107.12105-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit af9eb56bfed273a85b8c3f99d3ed7ff979c36ae0 Author: Changbin Du Date: Tue Apr 18 11:18:25 2023 +0800 perf script: Add new output field 'dsoff' to print dso offset This adds a new 'dsoff' field to print dso offset for resolved symbols, and the offset is appended to dso name. Default output: $ perf script ls 2695501 3011030.487017: 500000 cycles: 152cc73ef4b5 get_common_indices.constprop.0+0x155 (/usr/lib/x86_64-linux-gnu/ld-2.31.so) ls 2695501 3011030.487018: 500000 cycles: ffffffff99045b3e [unknown] ([unknown]) ls 2695501 3011030.487018: 500000 cycles: ffffffff9968e107 [unknown] ([unknown]) ls 2695501 3011030.487018: 500000 cycles: ffffffffc1f54afb [unknown] ([unknown]) ls 2695501 3011030.487018: 500000 cycles: ffffffff9968382f [unknown] ([unknown]) ls 2695501 3011030.487019: 500000 cycles: ffffffff99e00094 [unknown] ([unknown]) ls 2695501 3011030.487019: 500000 cycles: 152cc718a8d0 __errno_location@plt+0x0 (/usr/lib/x86_64-linux-gnu/libselinux.so.1) Display 'dsoff' field: $ perf script -F +dsoff ls 2695501 3011030.487017: 500000 cycles: 152cc73ef4b5 get_common_indices.constprop.0+0x155 (/usr/lib/x86_64-linux-gnu/ld-2.31.so+0x1c4b5) ls 2695501 3011030.487018: 500000 cycles: ffffffff99045b3e [unknown] ([unknown]) ls 2695501 3011030.487018: 500000 cycles: ffffffff9968e107 [unknown] ([unknown]) ls 2695501 3011030.487018: 500000 cycles: ffffffffc1f54afb [unknown] ([unknown]) ls 2695501 3011030.487018: 500000 cycles: ffffffff9968382f [unknown] ([unknown]) ls 2695501 3011030.487019: 500000 cycles: ffffffff99e00094 [unknown] ([unknown]) ls 2695501 3011030.487019: 500000 cycles: 152cc718a8d0 __errno_location@plt+0x0 (/usr/lib/x86_64-linux-gnu/libselinux.so.1+0x68d0) ls 2695501 3011030.487019: 500000 cycles: ffffffff992a6db0 [unknown] ([unknown]) Signed-off-by: Changbin Du Acked-by: Adrian Hunter Cc: Alexander Shishkin Cc: Hui Wang Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230418031825.1262579-4-changbin.du@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 2b433fadb1db6f64a9edf22de668118de7e287ed Author: Changbin Du Date: Tue Apr 18 11:18:24 2023 +0800 perf map: Add helper map__fprintf_dsoname_dsoff This adds a helper function map__fprintf_dsoname_dsoff() to print dsoname with optional dso offset. Suggested-by: Adrian Hunter Signed-off-by: Changbin Du Acked-by: Adrian Hunter Cc: Alexander Shishkin Cc: Hui Wang Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230418031825.1262579-3-changbin.du@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 2d4c53973f014983d59a7aa4e980007db315fee0 Author: Paran Lee Date: Wed Mar 15 14:15:01 2023 +0900 perf tools riscv: Add support for riscv lookup_binutils_path Add RISC-V binutils path on lookup triplets. Reviewed-by: Palmer Dabbelt Signed-off-by: Paran Lee Acked-by: Ian Rogers Acked-by: Palmer Dabbelt Cc: Albert Ou Cc: Anton Blanchard Cc: Daniel Axtens Cc: Jiri Olsa Cc: Michael Ellerman Cc: Namhyung Kim Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: linux-riscv@lists.infradead.org Link: https://lore.kernel.org/r/20230315051500.13064-1-p4ranlee@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 8ba3ba992fc2e456f4211ac4dc80dcb7775e722f Author: John Harrison Date: Thu May 11 18:35:44 2023 -0700 drm/i915/guc: Fix confused register capture list creation The GuC has a completely separate engine class enum when referring to register capture lists, which combines render and compute. The driver was using the 'normal' GuC specific engine class enum instead. That meant that it thought it was defining a capture list for compute engines, the list was actually being applied to the GSC engine. And if a platform didn't have a render engine, then it would get no compute register captures at all. Fix that. Signed-off-by: John Harrison Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20230512013544.3367606-1-John.C.Harrison@Intel.com commit e2b96ceb554ec964e536dd443217d514684f6c49 Author: Krzysztof Kozlowski Date: Sat Apr 22 00:32:02 2023 +0200 arm64: dts: s32: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified properties to fix warnings like: s32g274a-evb.dtb: l2-cache1: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Matthias Brugger Signed-off-by: Chester Lin Link: https://lore.kernel.org/r/20230421223202.115472-1-krzysztof.kozlowski@linaro.org commit db2ce1ab0508cd95efb4be938a146472c56c9461 Author: John Harrison Date: Wed May 10 13:55:56 2023 -0700 drm/i1915/guc: Fix probe injection CI failures after recent change A recent change bumped a 'notice' message up to 'error' level for debug builds to help trap incorrect configurations in CI systems. Unfortunately, the error condition in question is triggered by the error injection probe test. So change the message again to be 'probe error' level instead. Signed-off-by: John Harrison Fixes: 760133d42f0a ("drm/i915/uc: Make unexpected firmware versions an error in debug builds") Cc: John Harrison Cc: Daniele Ceraolo Spurio Cc: Rodrigo Vivi Cc: Alan Previn Cc: Lucas De Marchi Cc: Jani Nikula Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230510205556.312999-1-John.C.Harrison@Intel.com commit 647c16ac7b15fc8fe6ab679690ac2ffe7c53abd3 Author: Krzysztof Kozlowski Date: Fri Apr 7 20:45:41 2023 +0200 dt-bindings: pinctrl: qcom,sm7150-tlmm: simplify with unevaluatedProperties All Qualcomm SoC Top Level Mode Multiplexer pin controllers have similar capabilities regarding pin properties, thus we can just accept entire set provided by qcom,tlmm-common.yaml schema. Link: https://lore.kernel.org/r/20230407184546.161168-35-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit f69ba355d32e50a19f37ae6c3a7ee56cfae3e6d8 Author: Krzysztof Kozlowski Date: Fri Apr 7 20:45:24 2023 +0200 dt-bindings: pinctrl: qcom,qcm2290-tlmm: simplify with unevaluatedProperties All Qualcomm SoC Top Level Mode Multiplexer pin controllers have similar capabilities regarding pin properties, thus we can just accept entire set provided by qcom,tlmm-common.yaml schema. Link: https://lore.kernel.org/r/20230407184546.161168-18-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit aeffc733e66fb40491ff79c1a53ef8cf6390ee13 Author: Krzysztof Kozlowski Date: Fri Apr 7 20:45:31 2023 +0200 dt-bindings: pinctrl: qcom,sc8280xp-tlmm: simplify with unevaluatedProperties All Qualcomm SoC Top Level Mode Multiplexer pin controllers have similar capabilities regarding pin properties, thus we can just accept entire set provided by qcom,tlmm-common.yaml schema. Link: https://lore.kernel.org/r/20230407184546.161168-25-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 8625372628afd9627a28427427037e2b13b75949 Author: Krzysztof Kozlowski Date: Fri Apr 7 20:45:10 2023 +0200 dt-bindings: pinctrl: qcom,ipq9574-tlmm: simplify with unevaluatedProperties All Qualcomm SoC Top Level Mode Multiplexer pin controllers have similar capabilities regarding pin properties, thus we can just accept entire set provided by qcom,tlmm-common.yaml schema. Link: https://lore.kernel.org/r/20230407184546.161168-4-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit d2408e043e7296017420aa5929b3bba4d5e61013 Author: Borislav Petkov (AMD) Date: Fri May 12 14:05:11 2023 +0200 x86/alternative: Optimize returns patching Instead of decoding each instruction in the return sites range only to realize that that return site is a jump to the default return thunk which is needed - X86_FEATURE_RETHUNK is enabled - lift that check before the loop and get rid of that loop overhead. Add comments about what gets patched, while at it. Signed-off-by: Borislav Petkov (AMD) Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230512120952.7924-1-bp@alien8.de commit a0bb549e60dc267bbd85d1b1948de8e7fc7f0928 Author: Michal Simek Date: Tue May 2 15:51:01 2023 +0200 Revert "arm64: dts: zynqmp: Add address-cells property to interrupt controllers" This reverts commit c6badbd2d321c19d4f55ee56b0ef12bb3352feac. Long time ago this was discussed with Rob at link below that there is no need to add address-cells to gpio and interrupt nodes that's why reverting this patch for ZynqMP. Also there is no visible DTC warning which was seen in past. Link: https://lore.kernel.org/r/91e3405245c89f134676449cf3822285798d2ed2.1612189652.git.michal.simek@xilinx.com Reviewed-by: Krzysztof Kozlowski Reviewed-by: Laurent Pinchart Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/e3312910db0922bb8c24a8e681de41709ca11bdf.1683035456.git.michal.simek@amd.com commit a9d37bd427ba0c873ebeef6fbd74410669cb2c54 Author: Varalaxmi Bingi Date: Tue May 2 15:53:35 2023 +0200 ARM: zynq: dts: Setting default i2c clock frequency to 400kHz Setting default i2c clock frequency for Zynq to maximum rate of 400kHz. Current default value is 100kHz. Signed-off-by: Varalaxmi Bingi Acked-by: Krzysztof Kozlowski Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/4dde5d1eb8e4572dae4295a19a4c83002a58e5da.1683035611.git.michal.simek@amd.com commit 370b0e900fb0f1c74cb1ecf9f92306b6e52039e8 Author: Michal Simek Date: Wed May 3 09:40:15 2023 +0200 arm64: zynqmp: Change zc1275 board name to zcu1275 Internal board zc1275 was released also to public which ends up with adding missing 'u' to board name. Reflect this change by renaming DT files. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/9b50c72c4e634b2c72758eed6275920eedbda06f.1683099606.git.michal.simek@amd.com commit 6efb0b43ebe0dcf035da8656ecc4aa265c78b1da Author: Michal Simek Date: Wed May 3 09:40:14 2023 +0200 dt-bindings: arm: xilinx: Change zc1275 board name to zcu1275 Internal board zc1275 was released also to public which ends up with adding missing 'u' to board name. Reflect this change by renaming DT files. Acked-by: Krzysztof Kozlowski Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/4ba0eb85629ec5f07902a93fb75d13fff9697eb8.1683099606.git.michal.simek@amd.com commit 37e7894910cc0664b25259bd154e8093af9efdf7 Author: Parth Gajjar Date: Tue Mar 21 00:06:19 2023 -0700 arm64: zynqmp: Add mali-400 gpu node for zynqmp Add mali-400 gpu node for zynqmp. Enabled gpu node for xilinx boards. Signed-off-by: Parth Gajjar Signed-off-by: Vishal Sagar Link: https://lore.kernel.org/r/20230321070619.29440-3-parth.gajjar@amd.com Signed-off-by: Michal Simek commit 80550562f6bb51304c9a762f0d56632e28191525 Author: Parth Gajjar Date: Tue Mar 21 00:06:18 2023 -0700 dt-bindings: gpu: mali-utgard: Add xlnx,zynqmp-mali compatible Xilinx zynqmp SoC contains Mali400, so add its specific compatible to bindings. Signed-off-by: Parth Gajjar Signed-off-by: Vishal Sagar Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230321070619.29440-2-parth.gajjar@amd.com Signed-off-by: Michal Simek commit e2ebc05da260d216c2158e17409982ad1e4f3b58 Author: Nava kishore Manne Date: Wed May 3 10:31:58 2023 +0530 firmware: xilinx: Update the zynqmp_pm_fpga_load() API Update the zynqmp_pm_fpga_load() API to handle the firmware error’s properly. Signed-off-by: Nava kishore Manne Link: https://lore.kernel.org/r/20230503050158.1936467-1-nava.kishore.manne@amd.com Signed-off-by: Michal Simek commit c58da0ba3e5c86e51e2c1557afaf6f71e00c4533 Author: Dan Carpenter Date: Fri Apr 21 13:44:54 2023 +0300 driver: soc: xilinx: use _safe loop iterator to avoid a use after free The hash_for_each_possible() loop dereferences "eve_data" to get the next item on the list. However the loop frees eve_data so it leads to a use after free. Use hash_for_each_possible_safe() instead. Fixes: c7fdb2404f66 ("drivers: soc: xilinx: add xilinx event management driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/761e0e4a-4caf-4a71-8f47-1c6ad908a848@kili.mountain Signed-off-by: Michal Simek commit be11d67a144db79408a19642d0a8d65fb9f52105 Author: Rob Herring Date: Fri Mar 10 08:47:24 2023 -0600 soc: xilinx: Use of_property_present() for testing DT property presence It is preferred to use typed property access functions (i.e. of_property_read_ functions) rather than low-level of_get_property/of_find_property functions for reading properties. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230310144725.1545315-1-robh@kernel.org Signed-off-by: Michal Simek commit ac52578d6e8d300dd50f790f29a24169b1edd26c Author: Herbert Xu Date: Thu May 4 11:59:32 2023 +0800 hwrng: virtio - Fix race on data_avail and actual data The virtio rng device kicks off a new entropy request whenever the data available reaches zero. When a new request occurs at the end of a read operation, that is, when the result of that request is only needed by the next reader, then there is a race between the writing of the new data and the next reader. This is because there is no synchronisation whatsoever between the writer and the reader. Fix this by writing data_avail with smp_store_release and reading it with smp_load_acquire when we first enter read. The subsequent reads are safe because they're either protected by the first load acquire, or by the completion mechanism. Also remove the redundant zeroing of data_idx in random_recv_done (data_idx must already be zero at this point) and data_avail in request_entropy (ditto). Reported-by: syzbot+726dc8c62c3536431ceb@syzkaller.appspotmail.com Fixes: f7f510ec1957 ("virtio: An entropy device, as suggested by hpa.") Signed-off-by: Herbert Xu Acked-by: Michael S. Tsirkin Signed-off-by: Herbert Xu commit a4855a8c9b0ee284a008770721ad4cf1d8d932eb Author: Srujana Challa Date: Tue Apr 25 19:36:20 2023 +0530 crypto: octeontx2 - hardware configuration for inline IPsec On OcteonTX2/OctoenTX3 variants of silicon, Admin function (AF) handles resource allocation and configuration for PFs and their VFs. PFs request the AF directly, via mailboxes. Unlike PFs, VFs cannot send a mailbox request directly. A VF sends mailbox messages to its parent PF, with which it shares a mailbox region. The PF then forwards these messages to the AF. This patch adds code to configure inline-IPsec HW resources for CPT VFs as CPT VFs cannot send a mailbox request directly to AF. Signed-off-by: Srujana Challa Signed-off-by: Herbert Xu commit 5c553114ce7633e76626136b43577553027d01ff Author: Srujana Challa Date: Tue Apr 25 19:36:19 2023 +0530 crypto: octeontx2 - add support for AF to CPT PF uplink mbox This patch adds support for AF -> CPT PF uplink mailbox messages and adds a mailbox handler to submit a CPT instruction from AF as current architecture doesn't allow AF to submit CPT instruction directly to HW. Signed-off-by: Srujana Challa Signed-off-by: Herbert Xu commit dee3590c34a0475e92fcd60f58a417552e4518ff Author: David Yang Date: Tue Apr 25 01:20:21 2023 +0800 crypto: engine - Fix struct crypto_engine_op doc Remove redundant underscore and fix some grammar in prepare_request doc. Signed-off-by: David Yang Acked-by: Randy Dunlap Signed-off-by: Herbert Xu commit 903e6ada01f305eb6c82a27f48bf1ea18eb38a99 Author: David Yang Date: Sat Apr 22 00:56:49 2023 +0800 hwrng: histb - Move driver to drivers/char/hw_random/histb-rng.c Move to drivers/char/hw_random since histb-(t)rng does not provide cryptography pseudo rng. histb-rng is pretty like hisi-rng, but after investigation, we confirm there is no RNG_PHY_SEED register on histb-rng so a separate driver is needed. Still we rename relevant function names to match those in hisi-rng. Link: https://lore.kernel.org/r/20230401164448.1393336-1-mmyangfl@gmail.com Signed-off-by: David Yang Signed-off-by: Herbert Xu commit 69f1c387ba700f69e9fdad6d6ce44a3bb774dbff Author: Stephan Müller Date: Fri Apr 21 08:08:23 2023 +0200 crypto: jitter - add interface for gathering of raw entropy The test interface allows a privileged process to capture the raw unconditioned noise that is collected by the Jitter RNG for statistical analysis. Such testing allows the analysis how much entropy the Jitter RNG noise source provides on a given platform. The obtained data is the time stamp sampled by the Jitter RNG. Considering that the Jitter RNG inserts the delta of this time stamp compared to the immediately preceding time stamp, the obtained data needs to be post-processed accordingly to obtain the data the Jitter RNG inserts into its entropy pool. The raw entropy collection is provided to obtain the raw unmodified time stamps that are about to be added to the Jitter RNG entropy pool and are credited with entropy. Thus, this patch adds an interface which renders the Jitter RNG insecure. This patch is NOT INTENDED FOR PRODUCTION SYSTEMS, but solely for development/test systems to verify the available entropy rate. Access to the data is given through the jent_raw_hires debugfs file. The data buffer should be multiples of sizeof(u32) to fill the entire buffer. Using the option jitterentropy_testing.boot_raw_hires_test=1 the raw noise of the first 1000 entropy events since boot can be sampled. This test interface allows generating the data required for analysis whether the Jitter RNG is in compliance with SP800-90B sections 3.1.3 and 3.1.4. If the test interface is not compiled, its code is a noop which has no impact on the performance. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit bb897c55042e9330bcf88b4b13cbdd6f9fabdd5e Author: Stephan Müller Date: Fri Apr 21 08:08:04 2023 +0200 crypto: jitter - replace LFSR with SHA3-256 Using the kernel crypto API, the SHA3-256 algorithm is used as conditioning element to replace the LFSR in the Jitter RNG. All other parts of the Jitter RNG are unchanged. The application and use of the SHA-3 conditioning operation is identical to the user space Jitter RNG 3.4.0 by applying the following concept: - the Jitter RNG initializes a SHA-3 state which acts as the "entropy pool" when the Jitter RNG is allocated. - When a new time delta is obtained, it is inserted into the "entropy pool" with a SHA-3 update operation. Note, this operation in most of the cases is a simple memcpy() onto the SHA-3 stack. - To cause a true SHA-3 operation for each time delta operation, a second SHA-3 operation is performed hashing Jitter RNG status information. The final message digest is also inserted into the "entropy pool" with a SHA-3 update operation. Yet, this data is not considered to provide any entropy, but it shall stir the entropy pool. - To generate a random number, a SHA-3 final operation is performed to calculate a message digest followed by an immediate SHA-3 init to re-initialize the "entropy pool". The obtained message digest is one block of the Jitter RNG that is returned to the caller. Mathematically speaking, the random number generated by the Jitter RNG is: aux_t = SHA-3(Jitter RNG state data) Jitter RNG block = SHA-3(time_i || aux_i || time_(i-1) || aux_(i-1) || ... || time_(i-255) || aux_(i-255)) when assuming that the OSR = 1, i.e. the default value. This operation implies that the Jitter RNG has an output-blocksize of 256 bits instead of the 64 bits of the LFSR-based Jitter RNG that is replaced with this patch. The patch also replaces the varying number of invocations of the conditioning function with one fixed number of invocations. The use of the conditioning function consistent with the userspace Jitter RNG library version 3.4.0. The code is tested with a system that exhibited the least amount of entropy generated by the Jitter RNG: the SiFive Unmatched RISC-V system. The measured entropy rate is well above the heuristically implied entropy value of 1 bit of entropy per time delta. On all other tested systems, the measured entropy rate is even higher by orders of magnitude. The measurement was performed using updated tooling provided with the user space Jitter RNG library test framework. The performance of the Jitter RNG with this patch is about en par with the performance of the Jitter RNG without the patch. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 3908edf868c34ed42e1a0a4c68f142a76a707999 Author: Herbert Xu Date: Thu Apr 20 18:05:41 2023 +0800 crypto: hash - Make crypto_ahash_alg helper available Move the crypto_ahash_alg helper into include/crypto/internal so that drivers can use it. Signed-off-by: Herbert Xu commit c7535fb2ddf695fbb8b2c2b935307e33556082de Author: Herbert Xu Date: Thu Apr 20 18:05:16 2023 +0800 crypto: hash - Add statesize to crypto_ahash As ahash drivers may need to use fallbacks, their state size is thus variable. Deal with this by making it an attribute of crypto_ahash. Signed-off-by: Herbert Xu commit a4ca033d3294bedbcc44046efeb54873631f5faf Author: Dan Carpenter Date: Wed Apr 19 17:26:04 2023 +0300 crypto: ixp4xx - silence uninitialized variable warning Smatch complains that "dma" is uninitialized if dma_pool_alloc() fails. This is true, but also harmless. Anyway, move the assignment after the error checking to silence this warning. Fixes: 586d492f2856 ("crypto: ixp4xx - fix building wiht 64-bit dma_addr_t") Signed-off-by: Dan Carpenter Reviewed-by: Arnd Bergmann Acked-by: Linus Walleij Signed-off-by: Herbert Xu commit 3e522591f9f97d954fca8141727f958f6002684c Author: Herbert Xu Date: Wed Apr 19 17:34:30 2023 +0800 crypto: arm/sha512-neon - Fix clang function cast warnings Instead of casting the function which upsets clang for some reason, change the assembly function siganture instead. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304081828.zjGcFUyE-lkp@intel.com/ Signed-off-by: Herbert Xu commit 547ea1b1ea488609b8c33b1bebaa0f03e1d28049 Author: Herbert Xu Date: Wed Apr 19 17:31:49 2023 +0800 crypto: arm/sha256-neon - Fix clang function cast warnings Instead of casting the function which upsets clang for some reason, change the assembly function siganture instead. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304081828.zjGcFUyE-lkp@intel.com/ Signed-off-by: Herbert Xu commit e95c09e3a89c663868e9ca225082a05e483c83fd Author: Herbert Xu Date: Wed Apr 19 17:27:40 2023 +0800 crypto: arm/sha1-neon - Fix clang function cast warnings Instead of casting the function which upsets clang for some reason, change the assembly function siganture instead. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304081828.zjGcFUyE-lkp@intel.com/ Signed-off-by: Herbert Xu commit e051910cd94db6f71588295dcd579b5c669bab8a Author: Herbert Xu Date: Wed Apr 19 16:37:59 2023 +0800 hwrng: Kconfig - Add HAS_IOMEM dependencies for exynos/meson/mtk/npcm Add missing dependencies on HAS_IOMEM as otherwise they will trigger failed builds with COMPILE_TEST enabled. Also add dependencies on OF where appropriate. Change the default so that these drivers are not enabled just because COMPILE_TEST is turned on. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304191106.swKbBeDh-lkp@intel.com/ Signed-off-by: Herbert Xu Acked-by: Łukasz Stelmach Signed-off-by: Herbert Xu commit da2f2a039facd6d36c42d876e4b71dd80e91db0a Author: Horia GeantA Date: Mon Apr 17 20:28:39 2023 +0200 crypto: caam - refactor RNG initialization RNG (re-)initialization will be needed on pm resume path, thus refactor the corresponding code out of the probe callback. Signed-off-by: Horia GeantA Signed-off-by: Leonard Crestez Signed-off-by: Dong Aisheng Signed-off-by: Meenakshi Aggarwal Reviewed-by: Gaurav Jain Signed-off-by: Herbert Xu commit ba79e9a73284f576f336814125571432a2b3940f Merge: d3616dc7793ff b6583d5e9e94a Author: David S. Miller Date: Fri May 12 10:37:02 2023 +0100 Merge branch 'sfc-decap' Edward Cree says: ==================== sfc: more flexible encap matches on TC decap rules This series extends the TC offload support on EF100 to support optionally matching on the IP ToS and UDP source port of the outer header in rules performing tunnel decapsulation. Both of these fields allow masked matches if the underlying hardware supports it (current EF100 hardware supports masking on ToS, but only exact-match on source port). Given that the source port is typically populated from a hash of inner header entropy, it's not clear whether filtering on it is useful, but since we can support it we may as well expose the capability. ==================== Signed-off-by: David S. Miller commit b6583d5e9e94adce1be61ec59fef4e129f0bc68a Author: Edward Cree Date: Thu May 11 20:47:31 2023 +0100 sfc: support TC decap rules matching on enc_src_port Allow efx_tc_encap_match entries to include a udp_sport and a udp_sport_mask. As with enc_ip_tos, use pseudos to enforce that all encap matches within a given tuple have the same udp_sport_mask. Note that since we use a single layer of pseudos for both fields, two matches that differ in (say) udp_sport value aren't permitted to have different ip_tos_mask, even though this would technically be safe. Current userland TC does not support setting enc_src_port; this patch was tested with an iproute2 patched to support it. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 3c9561c0a5b988be3dfd24ea1de2301b95efc640 Author: Edward Cree Date: Thu May 11 20:47:30 2023 +0100 sfc: support TC decap rules matching on enc_ip_tos Allow efx_tc_encap_match entries to include an ip_tos and ip_tos_mask. To avoid partially-overlapping Outer Rules (which can lead to undefined behaviour in the hardware), store extra "pseudo" entries in our encap_match hashtable, which are used to enforce that all Outer Rule entries within a given tuple (or IPv6 equivalent) have the same ip_tos_mask. The "direct" encap_match entry takes a reference on the "pseudo", allowing it to be destroyed when all "direct" entries using it are removed. efx_tc_em_pseudo_type is an enum rather than just a bool because in future an additional pseudo-type will be added to support Conntrack offload. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 56beb35d85e290b71372d7ee1093621f6abb6e96 Author: Edward Cree Date: Thu May 11 20:47:29 2023 +0100 sfc: populate enc_ip_tos matches in MAE outer rules Currently tc.c will block them before they get here, but following patch will change that. Use the extack message from efx_mae_check_encap_match_caps() instead of writing a new one, since there's now more being fed in than just an IP version. Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 28fa3ac487c6d30aaa10570481c27b6adfc492b3 Author: Edward Cree Date: Thu May 11 20:47:28 2023 +0100 sfc: release encap match in efx_tc_flow_free() When force-freeing leftover entries from our match_action_ht, call efx_tc_delete_rule(), which releases all the rule's resources, rather than open-coding it. The open-coded version was missing a call to release the rule's encap match (if any). It probably doesn't matter as everything's being torn down anyway, but it's cleaner this way and prevents further error messages potentially being logged by efx_tc_encap_match_free() later on. Move efx_tc_flow_free() further down the file to avoid introducing a forward declaration of efx_tc_delete_rule(). Fixes: 17654d84b47c ("sfc: add offloading of 'foreign' TC (decap) rules") Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit d3616dc7793ffab17f3362fb439bfc1f887e6d8e Author: wuych Date: Fri May 12 10:44:03 2023 +0800 net: liquidio: lio_main: Remove unnecessary (void*) conversions Pointer variables of void * type do not require type cast. Signed-off-by: wuych Signed-off-by: David S. Miller commit 2598619e012cee5273a2821441b9a051ad931249 Author: Alexander Mikhalitsyn Date: Thu May 11 15:25:06 2023 +0200 sctp: add bpf_bypass_getsockopt proto callback Implement ->bpf_bypass_getsockopt proto callback and filter out SCTP_SOCKOPT_PEELOFF, SCTP_SOCKOPT_PEELOFF_FLAGS and SCTP_SOCKOPT_CONNECTX3 socket options from running eBPF hook on them. SCTP_SOCKOPT_PEELOFF and SCTP_SOCKOPT_PEELOFF_FLAGS options do fd_install(), and if BPF_CGROUP_RUN_PROG_GETSOCKOPT hook returns an error after success of the original handler sctp_getsockopt(...), userspace will receive an error from getsockopt syscall and will be not aware that fd was successfully installed into a fdtable. As pointed by Marcelo Ricardo Leitner it seems reasonable to skip bpf getsockopt hook for SCTP_SOCKOPT_CONNECTX3 sockopt too. Because internaly, it triggers connect() and if error is masked then userspace will be confused. This patch was born as a result of discussion around a new SCM_PIDFD interface: https://lore.kernel.org/all/20230413133355.350571-3-aleksandr.mikhalitsyn@canonical.com/ Fixes: 0d01da6afc54 ("bpf: implement getsockopt and setsockopt hooks") Cc: Daniel Borkmann Cc: Christian Brauner Cc: Stanislav Fomichev Cc: Neil Horman Cc: Marcelo Ricardo Leitner Cc: Xin Long Cc: linux-sctp@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org Suggested-by: Stanislav Fomichev Acked-by: Stanislav Fomichev Signed-off-by: Alexander Mikhalitsyn Acked-by: Xin Long Signed-off-by: David S. Miller commit e7ea5080ef3fd433b42acda80138e6c7dd8371eb Merge: c1bc7d73c9642 ceec9f272432b Author: David S. Miller Date: Fri May 12 09:43:56 2023 +0100 Merge branch 'selftests-fcnal' Guillaume Nault says: ==================== selftests: fcnal: Test SO_DONTROUTE socket option. The objective is to cover kernel paths that use the RTO_ONLINK flag in .flowi4_tos. This way we'll be able to safely remove this flag in the future by properly setting .flowi4_scope instead. With these selftests in place, we can make sure this won't introduce regressions. For more context, the final objective is to convert .flowi4_tos to dscp_t, to ensure that ECN bits don't influence route and fib-rule lookups (see commit a410a0cf9885 ("ipv6: Define dscp_t and stop taking ECN bits into account in fib6-rules")). These selftests only cover IPv4, as SO_DONTROUTE has no effect on IPv6 sockets. v2: - Use two different nettest options for setting SO_DONTROUTE either on the server or on the client socket. - Use the above feature to run a single 'nettest -B' instance per test (instead of having two nettest processes for server and client). ==================== Signed-off-by: David S. Miller commit ceec9f272432b03168376d6487e7e7817d215f07 Author: Guillaume Nault Date: Thu May 11 16:39:46 2023 +0200 selftests: fcnal: Test SO_DONTROUTE on raw and ping sockets. Use ping -r to test the kernel behaviour with raw and ping sockets having the SO_DONTROUTE option. Since ipv4_ping_novrf() is called with different values of net.ipv4.ping_group_range, then it tests both raw and ping sockets (ping uses ping sockets if its user ID belongs to ping_group_range and raw sockets otherwise). With both socket types, sending packets to a neighbour (on link) host, should work. When the host is behind a router, sending should fail. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: David S. Miller commit a431327c4faacf978defa94dd0da1710d0c69801 Author: Guillaume Nault Date: Thu May 11 16:39:39 2023 +0200 selftests: fcnal: Test SO_DONTROUTE on UDP sockets. Use nettest --client-dontroute to test the kernel behaviour with UDP sockets having the SO_DONTROUTE option. Sending packets to a neighbour (on link) host, should work. When the host is behind a router, sending should fail. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: David S. Miller commit dd017c72dde677cef5a5a965ca71ac4736b53452 Author: Guillaume Nault Date: Thu May 11 16:39:32 2023 +0200 selftests: fcnal: Test SO_DONTROUTE on TCP sockets. Use nettest --{client,server}-dontroute to test the kernel behaviour with TCP sockets having the SO_DONTROUTE option. Sending packets to a neighbour (on link) host, should work. When the host is behind a router, sending should fail. Client and server sockets are tested independently, so that we can cover different TCP kernel paths. SO_DONTROUTE also affects the syncookies path. So ipv4_tcp_dontroute() is made to work with or without syncookies, to cover both paths. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: David S. Miller commit aeefbb574c38025fd65a1b053c41595ba13b2408 Author: Guillaume Nault Date: Thu May 11 16:39:25 2023 +0200 selftests: Add SO_DONTROUTE option to nettest. Add --client-dontroute and --server-dontroute options to nettest. They allow to set the SO_DONTROUTE option to the client and server sockets respectively. This will be used by the following patches to test the SO_DONTROUTE kernel behaviour with TCP and UDP. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: David S. Miller commit c1bc7d73c96425db12bb92fbf24c37fd1c9ac329 Author: Simon Horman Date: Thu May 11 17:07:12 2023 +0200 bonding: Always assign be16 value to vlan_proto The type of the vlan_proto field is __be16. And most users of the field use it as such. In the case of setting or testing the field for the special VLAN_N_VID value, host byte order is used. Which seems incorrect. It also seems somewhat odd to store a VLAN ID value in a field that is otherwise used to store Ether types. Address this issue by defining BOND_VLAN_PROTO_NONE, a big endian value. 0xffff was chosen somewhat arbitrarily. What is important is that it doesn't overlap with any valid VLAN Ether types. I don't believe the problems described above are a bug because VLAN_N_VID in both little-endian and big-endian byte order does not conflict with any supported VLAN Ether types in big-endian byte order. Reported by sparse as: .../bond_main.c:2857:26: warning: restricted __be16 degrades to integer .../bond_main.c:2863:20: warning: restricted __be16 degrades to integer .../bond_main.c:2939:40: warning: incorrect type in assignment (different base types) .../bond_main.c:2939:40: expected restricted __be16 [usertype] vlan_proto .../bond_main.c:2939:40: got int No functional changes intended. Compile tested only. Signed-off-by: Simon Horman Acked-by: Jay Vosburgh Signed-off-by: David S. Miller commit deb2e484baf90ed776626894ea7ee5db7fbe839b Merge: 0fae8847563b0 eefca7ec51426 Author: David S. Miller Date: Fri May 12 09:24:08 2023 +0100 Merge branch 'net-handshake-fixes' Chuck Lever says: ==================== Bug fixes for net/handshake Please consider these for merge via net-next. Paolo observed that there is a possible leak of sock->file. I haven't looked into that yet, but it seems to be separate from the fixes in this series, so no need to hold these up. Changes since v2: - Address Paolo comment regarding handshake_dup() Changes since v1: - Rework "Fix handshake_dup() ref counting" - Unpin sock->file when a handshake is cancelled ==================== Signed-off-by: David S. Miller commit eefca7ec514262aef08d0ef261552f2f604bd851 Author: Chuck Lever Date: Thu May 11 11:49:50 2023 -0400 net/handshake: Enable the SNI extension to work properly Enable the upper layer protocol to specify the SNI peername. This avoids the need for tlshd to use a DNS lookup, which can return a hostname that doesn't match the incoming certificate's SubjectName. Fixes: 2fd5532044a8 ("net/handshake: Add a kernel API for requesting a TLSv1.3 handshake") Reviewed-by: Simon Horman Signed-off-by: Chuck Lever Signed-off-by: David S. Miller commit f921bd41001ccff2249f5f443f2917f7ef937daf Author: Chuck Lever Date: Thu May 11 11:49:17 2023 -0400 net/handshake: Unpin sock->file if a handshake is cancelled If user space never calls DONE, sock->file's reference count remains elevated. Enable sock->file to be freed eventually in this case. Reported-by: Jakub Kacinski Fixes: 3b3009ea8abb ("net/handshake: Create a NETLINK service for handling handshake requests") Signed-off-by: Chuck Lever Signed-off-by: David S. Miller commit e36a93e1723eb09c8393604ddc8ef2966f592597 Author: Chuck Lever Date: Thu May 11 11:48:45 2023 -0400 net/handshake: handshake_genl_notify() shouldn't ignore @flags Reported-by: Dan Carpenter Fixes: 3b3009ea8abb ("net/handshake: Create a NETLINK service for handling handshake requests") Reviewed-by: Simon Horman Signed-off-by: Chuck Lever Signed-off-by: David S. Miller commit 7301034026d0efe0e86af0cb685405da120583d4 Author: Chuck Lever Date: Thu May 11 11:48:13 2023 -0400 net/handshake: Fix uninitialized local variable trace_handshake_cmd_done_err() simply records the pointer in @req, so initializing it to NULL is sufficient and safe. Reported-by: Dan Carpenter Fixes: 3b3009ea8abb ("net/handshake: Create a NETLINK service for handling handshake requests") Reviewed-by: Simon Horman Signed-off-by: Chuck Lever Signed-off-by: David S. Miller commit 2200c1a87074548f0a36e5aae5ad283ce2ac43b2 Author: Chuck Lever Date: Thu May 11 11:47:40 2023 -0400 net/handshake: Fix handshake_dup() ref counting If get_unused_fd_flags() fails, we ended up calling fput(sock->file) twice. Reported-by: Dan Carpenter Suggested-by: Paolo Abeni Fixes: 3b3009ea8abb ("net/handshake: Create a NETLINK service for handling handshake requests") Signed-off-by: Chuck Lever Signed-off-by: David S. Miller commit b16d76fe9a27d337c16972a71d959bcf0c96c2e6 Author: Chuck Lever Date: Thu May 11 11:47:09 2023 -0400 net/handshake: Remove unneeded check from handshake_dup() handshake_req_submit() now verifies that the socket has a file. Fixes: 3b3009ea8abb ("net/handshake: Create a NETLINK service for handling handshake requests") Reviewed-by: Simon Horman Signed-off-by: Chuck Lever Signed-off-by: David S. Miller commit 0fae8847563b0c990f8cffcb8d3668fbcaca4919 Author: Yang Li Date: Thu May 11 15:21:19 2023 +0800 ipvlan: Remove NULL check before dev_{put, hold} The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there is no need to check before using dev_{put, hold}, remove it to silence the warning: ./drivers/net/ipvlan/ipvlan_core.c:559:3-11: WARNING: NULL check before dev_{put, hold} functions is not needed. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4930 Signed-off-by: Yang Li Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 48c0db05a1bf60067cdee062a6bfad6db5c1f602 Author: Subbaraya Sundeep Date: Thu May 11 11:47:12 2023 +0530 octeontx2-pf: mcs: Offload extended packet number(XPN) feature The macsec hardware block supports XPN cipher suites also. Hence added changes to offload XPN feature. Changes include configuring SecY policy to XPN cipher suite, Salt and SSCI values. 64 bit packet number is passed instead of 32 bit packet number. Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit 7f88efc8162cc6d516cacf1d82edc923b423483f Author: Uwe Kleine-König Date: Wed May 10 22:02:47 2023 +0200 net: samsung: sxgbe: Make sxgbe_drv_remove() return void sxgbe_drv_remove() returned zero unconditionally, so it can be converted to return void without losing anything. The upside is that it becomes more obvious in its callers that there is no error to handle. Signed-off-by: Uwe Kleine-König Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 59f038a09c62d77de91387ddcff66e54d99f2ec9 Author: Oswald Buddenhagen Date: Wed May 10 19:39:09 2023 +0200 ALSA: emu10k1: simplify tone control switch DSP code Instead of using lots of instructions to mix wet and dry signals, simply skip over the whole code block if tone control is disabled. This also allows us doing away with the "shadow" playback channels. Tested-by: Jonathan Dowland Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230510173917.3073107-7-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit f549466b8b8519260e49460543dff9b37f280cc9 Author: Oswald Buddenhagen Date: Wed May 10 19:39:08 2023 +0200 ALSA: emu10k1: apply channel delay hack to all E-MU cards Evidently, the channel delay bug exists in all E-MU cards; it's in the Hana FPGA program, and was never fixed. Note that the implementation is somewhat lazy - to localize the code paths, we actually waste a GPR and a DSP instruction by keeping two delay registers for the same physical source. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230510173917.3073107-6-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 4c7bfbcf7516b0804ba0204e865f885baca604e4 Author: Oswald Buddenhagen Date: Wed May 10 19:39:07 2023 +0200 ALSA: emu10k1: simplify snd_emu10k1_audigy_dsp_convert_32_to_2x16() Instead of spending lots of instructions on masking and transplanting the sign bit, sidestep the issue by replacing the last bit shift with a wrapping addition to self. Solution stolen from kX-project, after I pondered other ideas first. Also, the function really doesn't need to return a constant int value. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230510173917.3073107-5-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 4102ac29759586e86cf129d66fc5ad5406a431a8 Author: Oswald Buddenhagen Date: Wed May 10 19:39:06 2023 +0200 ALSA: emu10k1: fix+optimize E-MU stereo capture DSP code Presumably, JDC added the seemingly superfluous indirection over the temporary register because without it he'd get only zero readings. However, switching the X and Y operands (or using EMU32 as the A operand in the temporary load) works just fine. Presumably a DSP bug? The original code was also actually buggy, though: both channels used the left volume control. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230510173917.3073107-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 8cabf83c7aa54530e699be56249fb44f9505c4f3 Author: Oswald Buddenhagen Date: Wed May 10 19:39:05 2023 +0200 ALSA: emu10k1: roll up loops in DSP setup code for Audigy There is no apparent reason for the massive code duplication. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230510173917.3073107-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 2a3fa40aefbe7de6cca3c6d56711ab336dfe34ae Author: Oswald Buddenhagen Date: Wed May 10 19:39:04 2023 +0200 ALSA: emu10k1: make tone control switch mono It controls the whole surround set, so stereo can't work. As a consequence, only the left channel was paid attention to. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230510173917.3073107-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 6e4e9fbd5ba01eed13cb086ea645f8513370761d Author: Jani Nikula Date: Thu May 11 18:21:53 2023 +0300 drm/i915/gt: drop dependency on VLV_DISPLAY_BASE CHV_FUSE_GT (0x182168) is purely about GT fuses, therefore belongs in intel_gt_regs.h, is in the gcfgmmio unit, but is technically in the VLV display base area. Add VLV_GUNIT_BASE to drop dependency on VLV_DISPLAY_BASE and thus display/intel_display_reg_defs.h in intel_gt_regs.h. v2: Add VLV_GUNIT_BASE (Ville) Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230511152153.986676-1-jani.nikula@intel.com commit a8661af513040ed522e27d0e5339b3f757c1a351 Author: Oswald Buddenhagen Date: Wed May 10 19:37:22 2023 +0200 ALSA: emu10k1: don't create regular S/PDIF controls for E-MU cards These ports are unused on these cards. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230510173722.3072439-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 53632462666c378774f7665960f0ab67ac22f77a Merge: e12ff28764937 0a3a56875500a Author: Mark Brown Date: Fri May 12 13:29:46 2023 +0900 regmap-irq: Cleanups and remove unused Merge series from Aidan MacDonald : This is a straightforward patch series, mostly just removing a bunch of old features that were only used by a handful of drivers. - 1/4 and 2/4 remove unused, deprecated functionality - 3/4 makes the behavior of .handle_mask_sync() a bit more consistent w.r.t. mask and unmask registers, to aid maintainability. - 4/4 removes now-unused "inverted mask/unmask" compatibility code. commit 7590c6a897c51df5f55779ec80542794982d6631 Merge: deeb7855f5d7e 4ac690bbae02e Author: Mark Brown Date: Fri May 12 13:08:20 2023 +0900 ASoC SSM3515 codec driver Merge series from Martin Povišer : Analog Devices SSM3515 is a simple speaker amp that Apple is using in their 2021 iMacs, possibly elsewhere. commit f603a3f083aeb9438865975c28b27be0afaae0c1 Author: Maksim Kiselev Date: Wed May 10 11:11:08 2023 +0300 spi: sun6i: add DT bindings for Allwinner R329/D1/R528/T113s SPI Listed above Allwinner SoCs has two SPI controllers. First is the regular SPI controller and the second one has additional functionality for MIPI-DBI Type C. Add compatible strings for these controllers Signed-off-by: Maksim Kiselev Date: Wed May 10 11:11:11 2023 +0300 spi: sun6i: add support for R329/D1/R528/T113s SPI controllers These SoCs has two SPI controllers. One of it is quite similar to previous ones, but with internal clock divider removed; the other added MIPI DBI Type-C offload based on the first one. Add basical support for these controllers. As we're not going to support the DBI functionality now, just implement the two kinds of controllers as the same. Co-developed-by: Icenowy Zheng Date: Wed May 10 11:11:10 2023 +0300 spi: sun6i: add quirk for in-controller clock divider Previously SPI controllers in Allwinner SoCs has a clock divider inside. However now the clock divider is removed and to set the transfer clock rate it's only needed to set the SPI module clock to the target value and configure a proper work mode. According to the datasheet there are three work modes: | SPI Sample Mode | SDM(bit13) | SDC(bit11) | Run Clock | |-------------------------|------------|------------|-----------| | normal sample | 1 | 0 | <= 24 MHz | | delay half cycle sample | 0 | 0 | <= 40 MHz | | delay one cycle sample | 0 | 1 | >= 80 MHz | Add a quirk for this kind of SPI controllers. Co-developed-by: Icenowy Zheng Date: Wed May 10 11:11:09 2023 +0300 spi: sun6i: change OF match data to a struct As we're adding more properties to the OF match data, convert it to a struct now. Signed-off-by: Icenowy Zheng Date: Thu May 11 16:27:35 2023 +0200 regmap: mmio: Allow passing an empty config->reg_stride Regmap's stride is used for MMIO regmaps to check the correctness of reg_width. However, it's acceptable to pass an empty config->reg_stride, in that case the actual stride used is 1. There are valid cases now to pass an empty stride, when using down/upshifting of register address. In this case, the stride value loses its sense, so ignore the reg_width when the stride isn't set. Signed-off-by: Maxime Chevallier Date: Thu May 11 10:13:42 2023 +0100 regmap-irq: Drop backward compatibility for inverted mask/unmask All users must now specify .mask_unmask_non_inverted = true to ensure they are using the expected semantics: 1s disable IRQs in the mask registers, and enable IRQs in the unmask registers. Signed-off-by: Aidan MacDonald Date: Thu May 11 10:13:41 2023 +0100 regmap-irq: Minor adjustments to .handle_mask_sync() If a .handle_mask_sync() callback is provided it supersedes all inbuilt handling of mask registers, and judging by the commit 69af4bcaa08d ("regmap-irq: Add handle_mask_sync() callback") it is intended to completely replace all default IRQ masking logic. The implementation has two minor inconsistencies, which can be fixed without breaking compatibility: (1) mask_base must be set to enable .handle_mask_sync(), even though mask_base is otherwise unused. This is easily fixed because mask_base is already optional. (2) Unmask registers aren't accounted for -- they are part of the default IRQ masking logic and are just a bit-inverted version of mask registers. It would be a bad idea to allow them to be used at the same time as .handle_mask_sync(), as the result would be confusing and unmaintainable, so make sure this can't happen. Signed-off-by: Aidan MacDonald Date: Thu May 11 10:13:40 2023 +0100 regmap-irq: Remove support for not_fixed_stride No remaining users, use a custom .get_irq_reg() callback instead. Signed-off-by: Aidan MacDonald Date: Thu May 11 10:13:39 2023 +0100 regmap-irq: Remove type registers No remaining users, these have been replaced by config registers. Signed-off-by: Aidan MacDonald Date: Thu May 11 23:04:11 2023 +0800 ASoC: amd: yc: Add MECHREVO Jiaolong Series MRID6 into DMI table This model requires an additional detection quirk to enable the internal microphone. Signed-off-by: Rsplwe Date: Thu May 11 19:36:08 2023 +0800 ASoC: dt-bindings: nau8825: Convert to dtschema Convert the NAU8825 audio CODEC bindings to DT schema. Signed-off-by: David Lin Date: Thu May 11 17:05:46 2023 +0200 ASoC: ssm3515: Add new amp driver The Analog Devices' SSM3515 is a mono audio amplifier with digital input, equipped on Apple's 2021 iMacs. Add an ASoC driver for it, and register both the driver code and schema in MAINTAINERS. Signed-off-by: Martin Povišer Date: Thu May 11 17:05:45 2023 +0200 ASoC: dt-bindings: Add adi,ssm3515 amp schema Add a DT schema for the SSM3515 amp by Analog Devices. It's a simple mono amplifier with digital input. Signed-off-by: Martin Povišer Date: Tue May 9 06:28:56 2023 +0200 net: enc28j60: Use threaded interrupt instead of workqueue The Microchip ENC28J60 SPI Ethernet driver schedules a work item from the interrupt handler because accesses to the SPI bus may sleep. On PREEMPT_RT (which forces interrupt handling into threads) this old-fashioned approach unnecessarily increases latency because an interrupt results in first waking the interrupt thread, then scheduling the work item. So, a double indirection to handle an interrupt. Avoid by converting the driver to modern threaded interrupt handling. Signed-off-by: Philipp Rosenberger Signed-off-by: Zhi Han [lukas: rewrite commit message, linewrap request_threaded_irq() call] Signed-off-by: Lukas Wunner Reviewed-by: Piotr Raczynski Link: https://lore.kernel.org/r/342380d989ce26bc49f0e5d45fbb0416a5f7809f.1683606193.git.lukas@wunner.de Signed-off-by: Jakub Kicinski commit 41e65d8790bd96d1caa3cb136a57ac45a131e66d Author: Alan Previn Date: Thu May 11 16:17:38 2023 -0700 drm/i915/pxp: Enable PXP with MTL-GSC-CS Enable PXP with MTL-GSC-CS: add the has_pxp into device info and increase the debugfs teardown timeouts to align with new GSC-CS + firmware specs. Now that we have 3 places that are selecting pxp timeouts based on tee vs gsccs back-end, let's add a helper. Signed-off-by: Alan Previn Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230511231738.1077674-9-alan.previn.teres.alexis@intel.com commit 9e134ed720b6e69a5c857743daedd403101ca078 Author: Alan Previn Date: Thu May 11 16:17:37 2023 -0700 drm/i915/pxp: On MTL, KCR enabling doesn't wait on tee component On legacy platforms, KCR HW enabling is done at the time the mei component interface is bound. It's also disabled during unbind. However, for MTL onwards, we don't depend on a tee component to start sending GSC-CS firmware messages. Thus, immediately enable (or disable) KCR HW on PXP's init, fini and resume. Signed-off-by: Alan Previn Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230511231738.1077674-8-alan.previn.teres.alexis@intel.com commit d1da138f245d4fb46b21d2ddb19504a2831d813f Author: Alan Previn Date: Thu May 11 16:17:36 2023 -0700 drm/i915/uapi/pxp: Add a GET_PARAM for PXP Because of the additional firmware, component-driver and initialization depedencies required on MTL platform before a PXP context can be created, UMD calling for PXP creation as a way to get-caps can take a long time. An actual real world customer stack has seen this happen in the 4-to-8 second range after the kernel starts (which sees MESA's init appear in the middle of this range as the compositor comes up). To avoid unncessary delays experienced by the UMD for get-caps purposes, add a GET_PARAM for I915_PARAM_PXP_SUPPORT. However, some failures can still occur after all the depedencies are met (such as firmware init flow failure, bios configurations or SOC fusing not allowing PXP enablement). Those scenarios will only be known to user space when it attempts creating a PXP context and is documented in the GEM UAPI headers. While making this change, create a helper that is common to both GET_PARAM caller and intel_pxp_start since the latter does similar checks. Signed-off-by: Alan Previn Reviewed-by: Daniele Ceraolo Spurio Acked-by: Jordan Justen Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230511231738.1077674-7-alan.previn.teres.alexis@intel.com commit 99afb7cc8c44578615200ea4806b183e1e35a81d Author: Alan Previn Date: Thu May 11 16:17:35 2023 -0700 drm/i915/pxp: Add ARB session creation and cleanup Add MTL's function for ARB session creation using PXP firmware version 4.3 ABI structure format. While relooking at the ARB session creation flow in intel_pxp_start, let's address missing UAPI documentation. Without actually changing backward compatible behavior, update i915's drm-uapi comments that describe the possible error values when creating a context with I915_CONTEXT_PARAM_PROTECTED_CONTENT: Since the first merge of PXP support on ADL, i915 returns -ENXIO if a dependency such as firmware or component driver was yet to be loaded or returns -EIO if the creation attempt failed when requested by the PXP firmware (specific firmware error responses are reported in dmesg). Add MTL's function for ARB session invalidation but this reuses PXP firmware version 4.2 ABI structure format. For both cases, in the back-end gsccs functions for sending messages to the firmware inspect the GSC-CS-Mem-Header's pending-bit which means the GSC firmware is busy and we should retry. Given the last hw requirement, lets also update functions in front-end layer that wait for session creation or teardown completion to use new worst case timeout periods. Signed-off-by: Alan Previn Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230511231738.1077674-6-alan.previn.teres.alexis@intel.com commit dc9ac125d81faf4761574a9f613ebc8eb35717e1 Author: Alan Previn Date: Thu May 11 16:17:34 2023 -0700 drm/i915/pxp: Add GSC-CS backend to send GSC fw messages Add GSC engine based method for sending PXP firmware packets to the GSC firmware for MTL (and future) products. Use the newly added helpers to populate the GSC-CS memory header and send the message packet to the FW by dispatching the GSC_HECI_CMD_PKT instruction on the GSC engine. We use non-priveleged batches for submission to GSC engine which require two buffers for the request: - a buffer for the HECI packet that contains PXP FW commands - a batch-buffer that contains the engine instruction for sending the HECI packet to the GSC firmware. Thus, add the allocation and freeing of these buffers in gsccs init and fini. The GSC-fw may reply to commands with a SUCCESS but with an additional pending-bit set in the reply packet. This bit means the GSC-FW is currently busy and the caller needs to try again with the gsc_message_handle the fw returned. Thus, add a wrapper to continuously retry send_message while replaying the gsc_message_handle. Retries need to follow the arch-spec count and delay until GSC-FW replies with the real SUCCESS or timeout after that spec'd delay. The GSC-fw requires a non-zero host_session_handle provided by the caller to enable gsc_message_handle tracking. Thus, allocate the host_session_handle at init and destroy it at fini (the latter requiring an FYI to the gsc-firmware). Signed-off-by: Alan Previn Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230511231738.1077674-5-alan.previn.teres.alexis@intel.com commit e5e1e6d28ebcc0fe52567b1301c23f05d4c79df7 Author: Alan Previn Date: Thu May 11 16:17:33 2023 -0700 drm/i915/pxp: Add MTL helpers to submit Heci-Cmd-Packet to GSC Add helper functions into a new file for heci-packet-submission. The helpers will handle generating the MTL GSC-CS Memory-Header and submission of the Heci-Cmd-Packet instructions to the engine. NOTE1: These common functions for heci-packet-submission will be used by different i915 callers: 1- GSC-SW-Proxy: This is pending upstream publication awaiting a few remaining opens 2- MTL-HDCP: An equivalent patch has also been published at: https://patchwork.freedesktop.org/series/111876/. (Patch 1) 3- PXP: This series. NOTE2: A difference in this patch vs what is appearing is in bullet 2 above is that HDCP (and SW-Proxy) will be using priveleged submission (GGTT and common gsc-uc-context) while PXP will be using non-priveleged PPGTT, context and batch buffer. Therefore this patch will only slightly overlap with the MTL-HDCP patches despite have very similar function names (emit_foo vs emit_nonpriv_foo). This is because HECI_CMD_PKT instructions require different flows and hw-specific code when done via PPGTT based submission (not different from other engines). MTL-HDCP contains the same intel_gsc_mtl_header_t structures as this but the helpers there are different. Both add the same new file names. NOTE3: Additional clarity about the heci-cmd-pkt layout and where the common helpers come in: - On MTL, when an i915 subsystem needs to send a command request to the security firmware, it will send that via the GSC- engine-command-streamer. - However those commands, (lets call them "gsc_specific_fw_api" calls), are not understood by the GSC command streamer hw. - The GSC CS only looks at the GSC_HECI_CMD_PKT instruction and passes it along to the GSC firmware. - The GSC FW on the other hand needs additional metadata to know which usage service is being called (PXP, HDCP, proxy, etc) along with session specific info. Thus an extra header called GSC-CS HECI Memory Header, (C) in below diagram is prepended before the FW specific API, (D). - Thus, the structural layout of the request submitted would need to look like the diagram below (for non-priv PXP). - In the diagram, the common helper for HDCP, (GSC-Sw-Proxy) and PXP (i.e. new function intel_gsc_uc_heci_cmd_emit_mtl_header) will populate blob (C) while additional helpers, different for PPGGTT (this patch) vs GGTT (HDCP series) will populate blobs (A) and (B) below. ___________________________________________________________ (A) | MI_BATCH_BUFFER_START (ppgtt, batchbuff-addr, ...) | | | | | _|________________________________________________ | | (B)| GSC_HECI_CMD_PKT (pkt-addr-in, pkt-size-in, | | | | pkt-addr-out, pkt-size-out) |-------- | | MI_BATCH_BUFFER_END | | | | |________________________________________________| | | | | | |_________________________________________________________| | | --------------------------------------------------------- | \|/ ______V___________________________________________ | _________________________________________ | |(C)| | | | | struct intel_gsc_mtl_header { | | | | validity marker | | | | heci_clent_id | | | | ... | | | | } | | | |_______________________________________| | |(D)| | | | | struct gsc_fw_specific_api_foobar { | | | | ... | | | | For an example, see | | | | 'struct pxp43_create_arb_in' at | | | | intel_pxp_cmd_interface_43.h | | | | | | | | } | | | | Struture depends on command type | | | | struct gsc_fw_specific_api_foobar { | | | |_______________________________________| | |________________________________________________| That said, this patch provides basic helpers but leaves the PXP subsystem (i.e. the caller) to handle (D) and everything else such as input/output size verification or handling the responses from security firmware (for example, requiring a retry). Signed-off-by: Alan Previn Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230511231738.1077674-4-alan.previn.teres.alexis@intel.com commit 5adacf19f6c3fa7d6119878246e9a253867e14c9 Author: Alan Previn Date: Thu May 11 16:17:32 2023 -0700 drm/i915/pxp: Add MTL hw-plumbing enabling for KCR operation Add MTL hw-plumbing enabling for KCR operation under PXP which includes: 1. Updating 'pick-gt' to get the media tile for KCR interrupt handling 2. Adding MTL's KCR registers for PXP operation (init, status-checking, etc.). While doing #2, lets create a separate registers header file for PXP to be consistent with other i915 global subsystems. Signed-off-by: Alan Previn Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230511231738.1077674-3-alan.previn.teres.alexis@intel.com commit d6bf74de0772e233f97a82cc4dad2ec14b14fb28 Author: Alan Previn Date: Thu May 11 16:17:31 2023 -0700 drm/i915/pxp: Add GSC-CS back-end resource init and cleanup For MTL, the PXP back-end transport uses the GSC engine to submit HECI packets through the HW to the GSC firmware for PXP arb session management. This submission uses a non-priveleged batch buffer, a buffer for the command packet and of course a context targeting the GSC-CS. Thus for MTL, we need to allocate and free a set of execution submission resources for the management of the arbitration session. Lets start with the context creation first since that object and its usage is very straight-forward. We'll add the buffer allocation and freeing later when we introduce the gsccs' send-message function. Do this one time allocation of gsccs specific resources in a new gsccs source file with intel_pxp_gsccs_init / fini functions and hook them up from the PXP front-end. Signed-off-by: Alan Previn Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230511231738.1077674-2-alan.previn.teres.alexis@intel.com commit a5ce66ad292b681ffe245e1c0e8840484da76784 Author: David Gow Date: Wed May 10 13:38:32 2023 +0800 kunit: example: Provide example exit functions Add an example .exit and .suite_exit function to the KUnit example suite. Given exit functions are a bit more subtle than init functions (due to running in a different kthread, and running even after tests or test init functions fail), providing an easy place to experiment with them is useful. Reviewed-by: Rae Moar Signed-off-by: David Gow Signed-off-by: Shuah Khan commit cdc87bda607518e70b6a6745cd593458d725b5a7 Author: David Gow Date: Wed May 10 13:38:31 2023 +0800 Documentation: kunit: Warn that exit functions run even if init fails KUnit's exit functions will run even if the corresponding init function fails. It's easy, when writing an exit function, to assume the init function succeeded, and (for example) access uninitialised memory or dereference NULL pointers. Note that this case exists and should be handled in the documentation. Suggested-by: Benjamin Berg Link: https://lore.kernel.org/linux-kselftest/a39af0400abedb2e9b31d84c37551cecc3eed0e1.camel@sipsolutions.net/ Reviewed-by: Sadiya Kazi Signed-off-by: David Gow Signed-off-by: Shuah Khan commit 410f07492eaef600fe817eef9fd272f6692a451a Author: David Gow Date: Wed May 10 13:38:30 2023 +0800 Documentation: kunit: Note that assertions should not be used in cleanup As assertions abort the test cleanup process, they should be avoided from within a suite's exit function, or from within resource 'free' functions. Unlike with initialisation or main test execution, no further cleanup will be performed after a failed assertion, potentially causing a leak of resources. Reviewed-by: Sadiya Kazi Signed-off-by: David Gow Signed-off-by: Shuah Khan commit 55e8c1b49ac5a7f5567430cc83f2d270d8b7ce46 Author: David Gow Date: Wed May 10 13:38:29 2023 +0800 kunit: Always run cleanup from a test kthread KUnit tests run in a kthread, with the current->kunit_test pointer set to the test's context. This allows the kunit_get_current_test() and kunit_fail_current_test() macros to work. Normally, this pointer is still valid during test shutdown (i.e., the suite->exit function, and any resource cleanup). However, if the test has exited early (e.g., due to a failed assertion), the cleanup is done in the parent KUnit thread, which does not have an active context. Instead, in the event test terminates early, run the test exit and cleanup from a new 'cleanup' kthread, which sets current->kunit_test, and better isolates the rest of KUnit from issues which arise in test cleanup. If a test cleanup function itself aborts (e.g., due to an assertion failing), there will be no further attempts to clean up: an error will be logged and the test failed. For example: # example_simple_test: test aborted during cleanup. continuing without cleaning up This should also make it easier to get access to the KUnit context, particularly from within resource cleanup functions, which may, for example, need access to data in test->priv. Reviewed-by: Benjamin Berg Reviewed-by: Maxime Ripard Tested-by: Maxime Ripard Signed-off-by: David Gow Signed-off-by: Shuah Khan commit c9f9c6c875d14a107dabcf4579fcab95ed30af31 Author: Prashant Malani Date: Mon May 8 18:34:27 2023 +0000 platform/chrome: cros_typec_switch: Add Pin D support The ChromeOS EC's mux interface allows us to specify whether the port should be configured for Pin Assignment D in DisplayPort alternate mode (i.e 2 lanes USB + 2 lanes DP). Update the function that determines mux state to account for Pin Assignment D and return the appropriate mux setting. Cc: Heikki Krogerus Signed-off-by: Prashant Malani Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230508183428.1893357-1-pmalani@chromium.org commit 23fc8df26dead16687ae6eb47b0561a4a832e2f6 Author: Qiuxu Zhuo Date: Wed Mar 22 19:42:41 2023 +0800 rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale Running the 'kfree_rcu_test' test case [1] results in a splat [2]. The root cause is the kfree_scale_thread thread(s) continue running after unloading the rcuscale module. This commit fixes that isue by invoking kfree_scale_cleanup() from rcu_scale_cleanup() when removing the rcuscale module. [1] modprobe rcuscale kfree_rcu_test=1 // After some time rmmod rcuscale rmmod torture [2] BUG: unable to handle page fault for address: ffffffffc0601a87 #PF: supervisor instruction fetch in kernel mode #PF: error_code(0x0010) - not-present page PGD 11de4f067 P4D 11de4f067 PUD 11de51067 PMD 112f4d067 PTE 0 Oops: 0010 [#1] PREEMPT SMP NOPTI CPU: 1 PID: 1798 Comm: kfree_scale_thr Not tainted 6.3.0-rc1-rcu+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015 RIP: 0010:0xffffffffc0601a87 Code: Unable to access opcode bytes at 0xffffffffc0601a5d. RSP: 0018:ffffb25bc2e57e18 EFLAGS: 00010297 RAX: 0000000000000000 RBX: ffffffffc061f0b6 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff962fd0de RDI: ffffffff962fd0de RBP: ffffb25bc2e57ea8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000000 R13: 0000000000000000 R14: 000000000000000a R15: 00000000001c1dbe FS: 0000000000000000(0000) GS:ffff921fa2200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffc0601a5d CR3: 000000011de4c006 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? kvfree_call_rcu+0xf0/0x3a0 ? kthread+0xf3/0x120 ? kthread_complete_and_exit+0x20/0x20 ? ret_from_fork+0x1f/0x30 Modules linked in: rfkill sunrpc ... [last unloaded: torture] CR2: ffffffffc0601a87 ---[ end trace 0000000000000000 ]--- Fixes: e6e78b004fa7 ("rcuperf: Add kfree_rcu() performance Tests") Reviewed-by: Davidlohr Bueso Reviewed-by: Joel Fernandes (Google) Signed-off-by: Qiuxu Zhuo Signed-off-by: Paul E. McKenney commit bf5ddd736509a7d9077c0b6793e6f0852214dbea Author: Qiuxu Zhuo Date: Wed Mar 22 19:42:40 2023 +0800 rcu/rcuscale: Move rcu_scale_*() after kfree_scale_cleanup() This code-movement-only commit moves the rcu_scale_cleanup() and rcu_scale_shutdown() functions to follow kfree_scale_cleanup(). This is code movement is in preparation for a bug-fix patch that invokes kfree_scale_cleanup() from rcu_scale_cleanup(). Signed-off-by: Qiuxu Zhuo Signed-off-by: Paul E. McKenney Reviewed-by: Joel Fernandes (Google) commit b409afe0268faeb77267f028ea85f2d93438fced Author: Paul E. McKenney Date: Tue Mar 21 16:40:08 2023 -0700 rcutorture: Correct name of use_softirq module parameter The BUSTED-BOOST and TREE03 scenarios specify a mythical tree.use_softirq module parameter, which means a failure to get full test coverage. This commit therefore corrects the name to rcutree.use_softirq. Fixes: e2b949d54392 ("rcutorture: Make TREE03 use real-time tree.use_softirq setting") Signed-off-by: Paul E. McKenney Reviewed-by: Joel Fernandes (Google) commit f8619c300f49c5831d344d35df93d3af447efc97 Author: Paul E. McKenney Date: Mon Mar 6 20:48:13 2023 -0800 locktorture: Add long_hold to adjust lock-hold delays This commit adds a long_hold module parameter to allow testing diagnostics for excessive lock-hold times. Also adjust torture_param() invocations for longer line length while in the area. Signed-off-by: Paul E. McKenney Reviewed-by: Joel Fernandes (Google) commit fbde57d2d2995375305917b3c944bc861beb84d4 Author: Frederic Weisbecker Date: Wed Mar 29 18:02:03 2023 +0200 rcu/nocb: Make shrinker iterate only over NOCB CPUs Callbacks can only be queued as lazy on NOCB CPUs, therefore iterating over the NOCB mask is enough for both counting and scanning. Just lock the mostly uncontended barrier mutex on counting as well in order to keep rcu_nocb_mask stable. Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit 401b0de3ae4fa49d1014c8941e26d9a25f37e7cf Author: Paul E. McKenney Date: Wed Apr 26 11:11:29 2023 -0700 rcu-tasks: Stop rcu_tasks_invoke_cbs() from using never-onlined CPUs The rcu_tasks_invoke_cbs() function relies on queue_work_on() to silently fall back to WORK_CPU_UNBOUND when the specified CPU is offline. However, the queue_work_on() function's silent fallback mechanism relies on that CPU having been online at some time in the past. When queue_work_on() is passed a CPU that has never been online, workqueue lockups ensue, which can be bad for your kernel's general health and well-being. This commit therefore checks whether a given CPU has ever been online, and, if not substitutes WORK_CPU_UNBOUND in the subsequent call to queue_work_on(). Why not simply omit the queue_work_on() call entirely? Because this function is flooding callback-invocation notifications to all CPUs, and must deal with possibilities that include a sparse cpu_possible_mask. This commit also moves the setting of the rcu_data structure's ->beenonline field to rcu_cpu_starting(), which executes on the incoming CPU before that CPU has ever enabled interrupts. This ensures that the required workqueues are present. In addition, because the incoming CPU has not yet enabled its interrupts, there cannot yet have been any softirq handlers running on this CPU, which means that the WARN_ON_ONCE(!rdp->beenonline) within the RCU_SOFTIRQ handler cannot have triggered yet. Fixes: d363f833c6d88 ("rcu-tasks: Use workqueues for multiple rcu_tasks_invoke_cbs() invocations") Reported-by: Tejun Heo Signed-off-by: Paul E. McKenney commit 15d44dfa40305da1648de4bf001e91cc63148725 Author: Paul E. McKenney Date: Thu Apr 27 10:50:47 2023 -0700 rcu: Make rcu_cpu_starting() rely on interrupts being disabled Currently, rcu_cpu_starting() is written so that it might be invoked with interrupts enabled. However, it is always called when interrupts are disabled, either by rcu_init(), notify_cpu_starting(), or from a call point prior to the call to notify_cpu_starting(). But why bother requiring that interrupts be disabled? The purpose is to allow the rcu_data structure's ->beenonline flag to be set after all early processing has completed for the incoming CPU, thus allowing this flag to be used to determine when workqueues have been set up for the incoming CPU, while still allowing this flag to be used as a diagnostic within rcu_core(). This commit therefore makes rcu_cpu_starting() rely on interrupts being disabled. Signed-off-by: Paul E. McKenney commit a24c1aab652ebacf9ea62470a166514174c96fe1 Author: Paul E. McKenney Date: Fri Apr 7 16:47:34 2023 -0700 rcu: Mark rcu_cpu_kthread() accesses to ->rcu_cpu_has_work The rcu_data structure's ->rcu_cpu_has_work field can be modified by any CPU attempting to wake up the rcuc kthread. Therefore, this commit marks accesses to this field from the rcu_cpu_kthread() function. This data race was reported by KCSAN. Not appropriate for backporting due to failure being unlikely. Signed-off-by: Paul E. McKenney commit 9146eb25495ea8bfb5010192e61e3ed5805ce9ef Author: Paul E. McKenney Date: Fri Apr 7 16:05:38 2023 -0700 rcu: Mark additional concurrent load from ->cpu_no_qs.b.exp The per-CPU rcu_data structure's ->cpu_no_qs.b.exp field is updated only on the instance corresponding to the current CPU, but can be read more widely. Unmarked accesses are OK from the corresponding CPU, but only if interrupts are disabled, given that interrupt handlers can and do modify this field. Unfortunately, although the load from rcu_preempt_deferred_qs() is always carried out from the corresponding CPU, interrupts are not necessarily disabled. This commit therefore upgrades this load to READ_ONCE. Similarly, the diagnostic access from synchronize_rcu_expedited_wait() might run with interrupts disabled and from some other CPU. This commit therefore marks this load with data_race(). Finally, the C-language access in rcu_preempt_ctxt_queue() is OK as is because interrupts are disabled and this load is always from the corresponding CPU. This commit adds a comment giving the rationale for this access being safe. This data race was reported by KCSAN. Not appropriate for backporting due to failure being unlikely. Signed-off-by: Paul E. McKenney commit f51164a808b5bf1d81fc37eb53ab1eae59c79f2d Author: Paul E. McKenney Date: Fri Mar 31 09:05:56 2023 -0700 rcu: Employ jiffies-based backstop to callback time limit Currently, if there are more than 100 ready-to-invoke RCU callbacks queued on a given CPU, the rcu_do_batch() function sets a timeout for invocation of the series. This timeout defaulting to three milliseconds, and may be adjusted using the rcutree.rcu_resched_ns kernel boot parameter. This timeout is checked using local_clock(), but the overhead of this function combined with the common-case very small callback-invocation overhead means that local_clock() is checked every 32nd invocation. This works well except for longer-than average callbacks. For example, a series of 500-microsecond-duration callbacks means that local_clock() is checked only once every 16 milliseconds, which makes it difficult to enforce a three-millisecond timeout. This commit therefore adds a Kconfig option RCU_DOUBLE_CHECK_CB_TIME that enables backup timeout checking using the coarser grained but lighter weight jiffies. If the jiffies counter detects a timeout, then local_clock() is consulted even if this is not the 32nd callback. This prevents the aforementioned 16-millisecond latency blow. Reported-by: Domas Mituzas Signed-off-by: Paul E. McKenney commit fea1c1f0101783f24d00e065ecd3d6e90292f887 Author: Paul E. McKenney Date: Tue Mar 21 16:43:54 2023 -0700 rcu: Check callback-invocation time limit for rcuc kthreads Currently, a callback-invocation time limit is enforced only for callbacks invoked from the softirq environment, the rationale being that when callbacks are instead invoked from rcuc and rcuoc kthreads, these callbacks cannot be holding up other softirq vectors. Which is in fact true. However, if an rcuc kthread spends too much time invoking callbacks, it can delay quiescent-state reports from its CPU, which can also be a problem. This commit therefore applies the callback-invocation time limit to callback invocation from the rcuc kthreads as well as from softirq. Signed-off-by: Paul E. McKenney commit 7a3cc29136960c45eff362a7304dd4f6eaf34cdd Author: Peter Zijlstra Date: Mon Mar 20 18:37:51 2023 +0100 rcu: Remove RCU_NONIDLE() Since there are now exactly _zero_ users of RCU_NONIDLE(), make it go away before someone else decides to (ab)use it. [ paulmck: Remove extraneous whitespace. ] Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland Acked-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit e1bd2334f165aa7bef7f9fa2b0bef97a85614963 Author: Paul E. McKenney Date: Thu May 11 11:59:09 2023 -0700 rcu: Add more RCU files to kernel-api.rst Recent changes and additions to RCU have not been reflected in Documentation/core-api/kernel-api.rst, which makes it harder to find the kernel-doc headers in recently added RCU files. Therefore, add those files. Signed-off-by: Paul E. McKenney Cc: Jonathan Corbet Cc: Luis Chamberlain Cc: Kees Cook Cc: Liam Beguin Cc: commit 17caa38a988e8f73e392f1f5ec2afb854552edcc Author: Krzysztof Kozlowski Date: Thu May 11 11:36:39 2023 -0700 dt-bindings: input: cypress,cyapa: convert to dtschema Convert the Cypress All Points Addressable (APA) I2C Touchpad / Trackpad bindings to DT schema. Reviewed-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230511102559.175088-1-krzysztof.kozlowski@linaro.org Signed-off-by: Dmitry Torokhov commit 2c085f3a8f23c9b444e8b99d93c15d7ce870fc4e Author: Roberto Sassu Date: Mon May 8 19:02:34 2023 +0200 smack: Record transmuting in smk_transmuted smack_dentry_create_files_as() determines whether transmuting should occur based on the label of the parent directory the new inode will be added to, and not the label of the directory where it is created. This helps for example to do transmuting on overlayfs, since the latter first creates the inode in the working directory, and then moves it to the correct destination. However, despite smack_dentry_create_files_as() provides the correct label, smack_inode_init_security() does not know from passed information whether or not transmuting occurred. Without this information, smack_inode_init_security() cannot set SMK_INODE_CHANGED in smk_flags, which will result in the SMACK64TRANSMUTE xattr not being set in smack_d_instantiate(). Thus, add the smk_transmuted field to the task_smack structure, and set it in smack_dentry_create_files_as() to smk_task if transmuting occurred. If smk_task is equal to smk_transmuted in smack_inode_init_security(), act as if transmuting was successful but without taking the label from the parent directory (the inode label was already set correctly from the current credentials in smack_inode_alloc_security()). Signed-off-by: Roberto Sassu Signed-off-by: Casey Schaufler commit 3a3d8fce31a49363cc31880dce5e3b0617c9c38b Author: Roberto Sassu Date: Mon May 8 19:02:33 2023 +0200 smack: Retrieve transmuting information in smack_inode_getsecurity() Enhance smack_inode_getsecurity() to retrieve the value for SMACK64TRANSMUTE from the inode security blob, similarly to SMACK64. This helps to display accurate values in the situation where the security labels come from mount options and not from xattrs. Signed-off-by: Roberto Sassu Signed-off-by: Casey Schaufler commit 46384ac7a61885ee29cf918777d5f81a6446e9e6 Author: Poovendhan Selvaraj Date: Thu May 11 13:28:14 2023 +0530 arm64: dts: qcom: ipq9574: Add SMEM support Add the required nodes to support SMEM Signed-off-by: Poovendhan Selvaraj Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230511075814.2370-3-quic_poovendh@quicinc.com commit 590db411752dd8ef6504113643fc6c4f68660ffd Author: Poovendhan Selvaraj Date: Thu May 11 13:28:13 2023 +0530 arm64: dts: qcom: ipq9574: Enable the download mode support Enable the support for download mode to collect the crashdumps if system crashes, to debug crashes extensively. Signed-off-by: Poovendhan Selvaraj Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230511075814.2370-2-quic_poovendh@quicinc.com commit bc88ba0cad64a4aa85f9deca79c6f3addcd21795 Merge: 285b2a46953ce 6e27831b91a0b Author: Jakub Kicinski Date: Thu May 11 09:06:26 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes. No conflicts. Signed-off-by: Jakub Kicinski commit 685282a3b39be5be000d28c8b88a3e0cae195104 Author: Jani Nikula Date: Thu May 4 19:57:29 2023 +0300 drm/i915/irq: relocate gmbus and dp aux irq handlers Move gmbus and dp aux irq handlers to their respective files. It should be up to them what to do with the irq, not the generic irq code. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/e825385fc03cb3d53c1f0b66712eea42dad69d59.1683219363.git.jani.nikula@intel.com commit 9275277d53248d3f529d7ce66a6954241ae4d5cb Author: Fei Yang Date: Tue May 9 09:52:00 2023 -0700 drm/i915: use pat_index instead of cache_level Currently the KMD is using enum i915_cache_level to set caching policy for buffer objects. This is flaky because the PAT index which really controls the caching behavior in PTE has far more levels than what's defined in the enum. In addition, the PAT index is platform dependent, having to translate between i915_cache_level and PAT index is not reliable, and makes the code more complicated. From UMD's perspective there is also a necessity to set caching policy for performance fine tuning. It's much easier for the UMD to directly use PAT index because the behavior of each PAT index is clearly defined in Bspec. Having the abstracted i915_cache_level sitting in between would only cause more ambiguity. PAT is expected to work much like MOCS already works today, and by design userspace is expected to select the index that exactly matches the desired behavior described in the hardware specification. For these reasons this patch replaces i915_cache_level with PAT index. Also note, the cache_level is not completely removed yet, because the KMD still has the need of creating buffer objects with simple cache settings such as cached, uncached, or writethrough. For kernel objects, cache_level is used for simplicity and backward compatibility. For Pre-gen12 platforms PAT can have 1:1 mapping to i915_cache_level, so these two are interchangeable. see the use of LEGACY_CACHELEVEL. One consequence of this change is that gen8_pte_encode is no longer working for gen12 platforms due to the fact that gen12 platforms has different PAT definitions. In the meantime the mtl_pte_encode introduced specfically for MTL becomes generic for all gen12 platforms. This patch renames the MTL PTE encode function into gen12_pte_encode and apply it to all gen12. Even though this change looks unrelated, but separating them would temporarily break gen12 PTE encoding, thus squash them in one patch. Special note: this patch changes the way caching behavior is controlled in the sense that some objects are left to be managed by userspace. For such objects we need to be careful not to change the userspace settings.There are kerneldoc and comments added around obj->cache_coherent, cache_dirty, and how to bypass the checkings by i915_gem_object_has_cache_level. For full understanding, these changes need to be looked at together with the two follow-up patches, one disables the {set|get}_caching ioctl's and the other adds set_pat extension to the GEM_CREATE uAPI. Bspec: 63019 Cc: Chris Wilson Signed-off-by: Fei Yang Reviewed-by: Andi Shyti Reviewed-by: Matt Roper Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230509165200.1740-3-fei.yang@intel.com commit 5e352e32aec23570ea948f039e25faf9b9ba362b Author: Fei Yang Date: Tue May 9 09:51:59 2023 -0700 drm/i915: preparation for using PAT index This patch is a preparation for replacing enum i915_cache_level with PAT index. Caching policy for buffer objects is set through the PAT index in PTE, the old i915_cache_level is not sufficient to represent all caching modes supported by the hardware. Preparing the transition by adding some platform dependent data structures and helper functions to translate the cache_level to pat_index. cachelevel_to_pat: a platform dependent array mapping cache_level to pat_index. max_pat_index: the maximum PAT index recommended in hardware specification Needed for validating the PAT index passed in from user space. i915_gem_get_pat_index: function to convert cache_level to PAT index. obj_to_i915(obj): macro moved to header file for wider usage. I915_MAX_CACHE_LEVEL: upper bound of i915_cache_level for the convenience of coding. Cc: Chris Wilson Cc: Matt Roper Signed-off-by: Fei Yang Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230509165200.1740-2-fei.yang@intel.com commit b6c881b248ef9d629ec2365808cb4894991c0837 Author: Peter Zijlstra Date: Wed Feb 8 18:10:54 2023 +0100 x86/alternative: Complicate optimize_nops() some more Because: SMP alternatives: ffffffff810026dc: [2:44) optimized NOPs: eb 2a eb 28 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc is quite daft, make things more complicated and have the NOP runlength detection eat the preceding JMP if they both end at the same target. SMP alternatives: ffffffff810026dc: [0:44) optimized NOPs: eb 2a cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230208171431.433132442@infradead.org commit 6c480f22212826425b57932f09b1f0abbec85485 Author: Peter Zijlstra Date: Wed Feb 8 18:10:53 2023 +0100 x86/alternative: Rewrite optimize_nops() some Address two issues: - it no longer hard requires single byte NOP runs - now it accepts any NOP and NOPL encoded instruction (but not the more complicated 32bit NOPs). - it writes a single 'instruction' replacement. Specifically, ORC unwinder relies on the tail NOP of an alternative to be a single instruction. In particular, it relies on the inner bytes not being executed. Once the max supported NOP length has been reached (currently 8, could easily be extended to 11 on x86_64), switch to JMP.d8 and INT3 padding to achieve the same result. Objtool uses this guarantee in the analysis of alternative/overlapping CFI state for the ORC unwinder data. Every instruction edge gets a CFI state and the more instructions the larger the chance of conflicts. [ bp: - Add a comment over add_nop() to explain why it does it this way - Make add_nops() PARAVIRT only as it is used solely there now ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230208171431.373412974@infradead.org commit 6c19974d1e83fba2cca1cbea2fbf250f093eb5ed Author: Linus Walleij Date: Mon May 8 14:35:09 2023 +0200 dt-bindings: gpio: Convert STMPE GPIO to YAML schema This rewrites the STMPE GPIO bindings to a YAML schema. We add the properties that are used in the widely used STMPE GPIO device nodes found in the wild, most notably interrupt support, so interrupt-cells and interrupt-controller is now part of the bindings. Signed-off-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit 2bea1d7c594dd0643db23a8131c689384d0e5d8c Author: Ville Syrjälä Date: Tue May 9 19:02:06 2023 +0300 drm/i915: Nuke intel_bios_is_port_dp_dual_mode() Now that we have encoder->devdata everwhere we don't need the intel_bios_is_port_dp_dual_mode() wrapper any more. And while at it let's include it in the child device log dump as well since the logic in there is a bit more complex than just DP&&HDMI. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230509160206.25971-3-ville.syrjala@linux.intel.com Acked-by: Gustavo Sousa commit 3d7af6cfed6c2df11388b7ac0630ad8015f9e915 Author: Ville Syrjälä Date: Tue May 9 19:02:05 2023 +0300 drm/i915: Flip VBT DDC pin maps around Swap the roles of the index vs. value for the VBT DDC pin mapping tables. This is not strictly necessary for DDC pins but it will make this work exactly like the AUX CH mapping tables where the role reversal is necessary (or at least makes things easier). Consistency is good. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230509160206.25971-2-ville.syrjala@linux.intel.com Reviewed-by: Gustavo Sousa commit 5a0fc7a0df6b3525bf3b33fb27eb8d47f7826dc2 Author: Ville Syrjälä Date: Tue May 9 19:02:04 2023 +0300 drm/i915: Split map_aux_ch() into per-platform arrays The big switch+if statement mess in map_aux_ch() is illegible. Split up into cleaner per-platform arrays like we already have for the gmbus pins. We use enum aux_ch as the index and the VBT thing as the value. Slightly non-intuitive perhaps but if we did it the other way around we'd have problems with AUX_CH_A being zero, and thus any non-populated element would look like AUX_CH_A. v2: flip the index vs. value around TODO: Didn't bother with the platform variants beyond the ones that really need remapping, which means if the VBT is bogus we end up with a nonexistent aux ch. Might be nice to check this a bit better. Yet another bitmask in device info? Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230509160206.25971-1-ville.syrjala@linux.intel.com Reviewed-by: Gustavo Sousa commit 0cad796a226997e176c71bd4e04a3d426ba4fcc3 Author: Ville Syrjälä Date: Tue May 9 20:14:11 2023 +0300 drm/i915: Use REG_BIT() & co. for AUX CH registers Modernize the DP AUX CH register definitions with REG_BIT() & co. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230509171411.7184-1-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander commit 9f8c1fe320e8014b1d2cd0d8bfcca299223f7604 Author: Ville Syrjälä Date: Wed Apr 26 16:50:19 2023 +0300 drm/i915: Define more PS_CTRL bits To avoid annoying spec lookups let's define more PS_CTRL bits in the header. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230426135019.7603-8-ville.syrjala@linux.intel.com Reviewed-by: Luca Coelho commit 413d2e2fd052c57e66ebce988882fb58d33966ab Author: Jani Nikula Date: Thu May 11 11:55:53 2023 +0300 drm/i915/hdcp: drop display/ prefix from include The display prefix is unnecessary within the display sub-directory. Cc: Alan Previn Cc: Suraj Kandpal Cc: Uma Shankar Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal Link: https://patchwork.freedesktop.org/patch/msgid/20230511085553.799321-1-jani.nikula@intel.com commit 8130e94e888bf90e495f88d1a1e63c43e1cfbc18 Author: Chin-Yen Lee Date: Mon May 8 16:43:35 2023 +0800 wifi: rtw89: suppress the log for specific SER called CMDPSR_FRZTO For 8852CE, there is abnormal state called CMDPSR_FRZTO, which occasionally happens in some platforms, and could be found by firmware and fixed in current SER flow, so we add suppress function to avoid verbose message for this resolved case. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230508084335.42953-4-pkshih@realtek.com commit 56617fd02adbf2ce7e18469895846ba82150cb1f Author: Zong-Zhe Yang Date: Mon May 8 16:43:34 2023 +0800 wifi: rtw89: ser: L1 add pre-M0 and post-M0 states Newer FW re-design SER (syetem error recovery) L1 (level 1) flow. New L1 flow will expect two extra states before original L1 flow. * Before: fw --- M1 --> driver fw <-- M2 --- driver fw --- M3 --> driver fw <-- M4 --- driver fw --- M5 --> driver * After: fw --- pre-M0 --> driver fw <-- post-M0 --- driver fw --- M1 --> driver fw <-- M2 --- driver fw --- M3 --> driver fw <-- M4 --- driver fw --- M5 --> driver Then before M1, FW gets one more interval to deal with things that FW should have handled well. To consider backward/forward compatibility, FW and driver won't change flow from M1 to M5. (only except that halt trigger control will change a little bit.) So, there will be two differnt starting points of SER L1. * old FW: SER L1 starts from M1 * new FW: SER L1 starts from pre-M0 Then, driver adds the new SER L1 entry and also keep the original one instead of changing it. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230508084335.42953-3-pkshih@realtek.com commit aa70fa4f7dd80e4e495c30ff10a6c373c26902e0 Author: Zong-Zhe Yang Date: Mon May 8 16:43:33 2023 +0800 wifi: rtw89: pci: fix interrupt enable mask for HALT C2H of RTL8851B RTL8851B keeps almost the same interrupt flow as RTL8852A and RTL8852B. But, it uses a different bitmask for interrupt indicator of FW HALT C2H. So, we make a chip judgement in pci when configuring interrupt mask. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230508084335.42953-2-pkshih@realtek.com commit e3b77c06c8863a53a0d80f7dcaff923c590e3edd Author: Zong-Zhe Yang Date: Mon May 8 16:12:11 2023 +0800 wifi: rtw89: support U-NII-4 channels on 5GHz band U-NII-4 band, i.e 5.9GHz channels, can be supported by chip 8852C, 8852B and 8851B. But, it is not supported by chip 8852A. Flag support_unii4 is added in chip info and defined by chip accordingly to indicate that. We reference this flag of runtime chip to decide whether to register 5.9GHz channels. After that, we consider if U-NII-4 band is allowed by our regulatory rule of U-NII-4. If chip::support_unii4 but not regd::allow_unii4, we stll do not register 5.9GHz channels. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230508081211.38760-4-pkshih@realtek.com commit a002f98123dd5e6b6d66c1b42a37dfd6e25ade4c Author: Zong-Zhe Yang Date: Mon May 8 16:12:10 2023 +0800 wifi: rtw89: regd: judge UNII-4 according to BIOS and chip For realtek regulatory, there are following two kinds of configurations to determine whether to allow UNII-4 band, i.e. 5.9GHz channels. 1. default setting according to whether chip support it or not 2. evaluate realtek ACPI DSM with RTW89_ACPI_DSM_FUNC_59G_EN (func. 6) If (1) is false, we won't try (2) and just disallow UNII-4. Otherwise, if (2) is not supported or returns a non-specific value, we follow the default setting either. Besides, this commit aims to add decision logic in rtw89 regulatory. Actually, driver doesn't register UNII-4 yet. That will be handled by another commit. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230508081211.38760-3-pkshih@realtek.com commit e897b0bef38a8b40101c0e6e009395506c256460 Author: Zong-Zhe Yang Date: Mon May 8 16:12:09 2023 +0800 wifi: rtw89: introduce realtek ACPI DSM method Introduce realtek ACPI DSM method to get required BIOS configurations. It will be used in the following commits. And, enum rtw89_acpi_dsm_func is added for listing the functions which are currently recognized. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230508081211.38760-2-pkshih@realtek.com commit d9aef04fcfa81ee4fb2804a21a3712b7bbd936af Author: Christophe JAILLET Date: Sat May 6 15:53:15 2023 +0200 wifi: mwifiex: Fix the size of a memory allocation in mwifiex_ret_802_11_scan() The type of "mwifiex_adapter->nd_info" is "struct cfg80211_wowlan_nd_info", not "struct cfg80211_wowlan_nd_match". Use struct_size() to ease the computation of the needed size. The current code over-allocates some memory, so is safe. But it wastes 32 bytes. Fixes: 7d7f07d8c5d3 ("mwifiex: add wowlan net-detect support") Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/7a6074fb056d2181e058a3cc6048d8155c20aec7.1683371982.git.christophe.jaillet@wanadoo.fr commit e2ff1181b3d48257aab26bfd2165f3c7d271499f Author: Dan Carpenter Date: Wed May 3 18:09:55 2023 +0300 wifi: rtw88: unlock on error path in rtw_ops_add_interface() Call mutex_unlock(&rtwdev->mutex); before returning on this error path. Fixes: f0e741e4ddbc ("wifi: rtw88: add bitmap for dynamic port settings") Signed-off-by: Dan Carpenter Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/ddd10a74-5982-4f65-8c59-c1cca558d239@kili.mountain commit 7acd69507088b968beda8c2693591211fab333df Author: Amisha Patel Date: Tue May 9 17:29:08 2023 +0000 wifi: wilc1000: Increase ASSOC response buffer In recent access points, information element is longer as they include additional data which exceeds 256 bytes. To accommodate longer association response, increase the ASSOC response buffer. Signed-off-by: Amisha Patel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230509172811.4953-1-amisha.patel@microchip.com commit 9ce4bb09123e9754996e358bd808d39f5d112899 Author: Amisha Patel Date: Fri Apr 21 18:10:20 2023 +0000 wifi: wilc1000: fix for absent RSN capabilities WFA testcase Mandatory WFA testcase CT_Security_WPA2Personal_STA_RSNEBoundsVerification-AbsentRSNCap, performs bounds verfication on Beacon and/or Probe response frames. It failed and observed the reason to be absence of cipher suite and AKM suite in RSN information. To fix this, enable the RSN flag before extracting RSN capabilities. Fixes: cd21d99e595e ("wifi: wilc1000: validate pairwise and authentication suite offsets") Signed-off-by: Amisha Patel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421181005.4865-1-amisha.patel@microchip.com commit 285b2a46953cecea207c53f7c6a7a76c9bbab303 Merge: ccce324dabfe2 33f4cefb26e98 Author: Paolo Abeni Date: Thu May 11 13:05:19 2023 +0200 Merge branch 'net-mvneta-reduce-size-of-tso-header-allocation' Russell King says: ==================== net: mvneta: reduce size of TSO header allocation With reference to https://forum.turris.cz/t/random-kernel-exceptions-on-hbl-tos-7-0/18865/ https://github.com/openwrt/openwrt/pull/12375#issuecomment-1528842334 It appears that mvneta attempts an order-6 allocation for the TSO header memory. While this succeeds early on in the system's life time, trying order-6 allocations later can result in failure due to memory fragmentation. Firstly, the reason it's so large is that we take the number of transmit descriptors, and allocate a TSO header buffer for each, and each TSO header is 256 bytes. The driver uses a simple mechanism to determine the address - it uses the transmit descriptor index as an index into the TSO header memory. (The first obvious question is: do there need to be this many? Won't each TSO header always have at least one bit of data to go with it? In other words, wouldn't the maximum number of TSO headers that a ring could accept be the number of ring entries divided by 2?) There is no real need for this memory to be an order-6 allocation, since nothing in hardware requires this buffer to be contiguous. Therefore, this series splits this order-6 allocation up into 32 order-1 allocations (8k pages on 4k page platforms), each giving 32 TSO headers per page. In order to do this, these patches: 1) fix a horrible transmit path error-cleanup bug - the existing code unmaps from the first descriptor that was allocated at interface bringup, not the first descriptor that the packet is using, resulting in the wrong descriptors being unmapped. 2) since xdp support was added, we now have buf->type which indicates what this transmit buffer contains. Use this to mark TSO header buffers. 3) get rid of IS_TSO_HEADER(), instead using buf->type to determine whether this transmit buffer needs to be DMA-unmapped. 4) move tso_build_hdr() into mvneta_tso_put_hdr() to keep all the TSO header building code together. 5) split the TSO header allocation into chunks of order-1 pages. This has now been tested by the Turris folk and has been found to fix the allocation error. ==================== Link: https://lore.kernel.org/r/ZFtuhJOC03qpASt2@shell.armlinux.org.uk Signed-off-by: Paolo Abeni commit 33f4cefb26e98c3cfe68ee7c88b766aa786b8733 Author: Russell King (Oracle) Date: Wed May 10 11:16:03 2023 +0100 net: mvneta: allocate TSO header DMA memory in chunks Now that we no longer need to check whether the DMA address is within the TSO header DMA memory range for the queue, we can allocate the TSO header DMA memory in chunks rather than one contiguous order-6 chunk, which can stress the kernel's memory subsystems to allocate. Instead, use order-1 (8k) allocations, which will result in 32 order-1 pages containing 32 TSO headers. Signed-off-by: Russell King (Oracle) Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit d41eb5557668096b0a57646107e6fc4631ba9cf1 Author: Russell King (Oracle) Date: Wed May 10 11:15:58 2023 +0100 net: mvneta: move tso_build_hdr() into mvneta_tso_put_hdr() Move tso_build_hdr() into mvneta_tso_put_hdr() so that all the TSO header building code is in one place. Signed-off-by: Russell King (Oracle) Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit f00ba4f41acc050c959803f290a0f0c03dc0da5c Author: Russell King (Oracle) Date: Wed May 10 11:15:53 2023 +0100 net: mvneta: use buf->type to determine whether to dma-unmap Now that we use a different buffer type for TSO headers, we can use buf->type to determine whether the original buffer was DMA-mapped or not. The rules are: MVNETA_TYPE_XDP_TX - from a DMA pool, no unmap is required MVNETA_TYPE_XDP_NDO - dma_map_single()'d MVNETA_TYPE_SKB - normal skbuff, dma_map_single()'d MVNETA_TYPE_TSO - from the TSO buffer area This means we only need to call dma_unmap_single() on the XDP_NDO and SKB types of buffer, and we no longer need the private IS_TSO_HEADER() which relies on the TSO region being contiguously allocated. Signed-off-by: Russell King (Oracle) Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit b0bd1b07c3add928e33282a52ad64a3f011d4fb7 Author: Russell King (Oracle) Date: Wed May 10 11:15:48 2023 +0100 net: mvneta: mark mapped and tso buffers separately Mark dma-mapped skbs and TSO buffers separately, so we can use buf->type to identify their differences. Signed-off-by: Russell King (Oracle) Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit fef99e840d465bad6549dd8775a5f967a711d171 Author: Russell King (Oracle) Date: Wed May 10 11:15:42 2023 +0100 net: mvneta: fix transmit path dma-unmapping on error The transmit code assumes that the transmit descriptors that are used begin with the first descriptor in the ring, but this may not be the case. Fix this by providing a new function that dma-unmaps a range of numbered descriptor entries, and use that to do the unmapping. Signed-off-by: Russell King (Oracle) Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit 7c4f1f1830648bbdce02b13ff5f215c7400e7ea0 Author: Krzysztof Kozlowski Date: Sat Mar 4 13:33:41 2023 +0100 arm64: dts: mba6ulx: correct GPIO keys wakeup gpio-keys,wakeup is a deprecated property. Link: https://lore.kernel.org/r/20230304123341.34223-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit dcfce7c2cee481853e7717890e1e2d6daba354c4 Author: Viresh Kumar Date: Wed Apr 12 08:47:56 2023 +0530 cpufreq: sparc: Don't allocate cpufreq_driver dynamically There is no point allocating the cpufreq driver dynamically and add so much complexity in the driver. Do what is done for other cpufreq drivers and statically allocate the cpufreq driver. Reported-by: Markus Elfring Signed-off-by: Viresh Kumar Acked-by: Rafael J. Wysocki commit cc386f5c670d58fbc41dc7ee8f2281aa74b58f9e Author: Krzysztof Kozlowski Date: Mon Jan 23 16:15:18 2023 +0100 ARM: dts: ste: align UART node name with bindings Bindings expect UART/serial node names to be "serial". Link: https://lore.kernel.org/r/20230123151519.369158-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 5668d088ee4ea05db9daaae0645d1d1f579b20f9 Author: Pawel Dembicki Date: Mon Oct 3 09:34:43 2022 +0200 ARM: dts: kirkwood: Add Endian 4i Edge 200 board Add Endian 4i Edge 200 is 5-port firewall. It have also clone: Endian UTM Mini (The same hardware, with added WLAN card). Hardware: - SoC: Marvell 88F6281-A1 ARMv5TE Processor 1.2GHz - Ram: 512MB (4x Nanya NT5TU128M8GE-AC) - NAND Flash: 512MB (Micron 29F4G08AAC) - Lan 1-4: 4x GBE (Marvell 88E6171R-TFJ2) - Lan 5: 1x GBE (Marvell 88E1116R-NNC1) - Storage: MicroSD Slot - MCPIE: MiniPCIe Slot present [fitted with SparkLan WPEA-110N/E (Atheros AR9280 chipset) in Endian UTM Mini WLAN only] - USB: 1x USB 2.0 port - Console: RJ-45 port - LEDs: 3x GPIO controlled Signed-off-by: Pawel Dembicki Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 1c23553a66b0db947b25de3df08d69c32fc74626 Author: Sean Anderson Date: Thu Apr 13 12:05:55 2023 -0400 dt-bindings: Convert gpio-mmio to yaml This is a generic binding for simple MMIO GPIO controllers. Although we have a single driver for these controllers, they were previously spread over several files. Consolidate them. The register descriptions are adapted from the comments in the source. There is no set order for the registers, and some registers may be omitted. Because of this, reg-names is mandatory, and no order is specified. Rename brcm,bcm6345-gpio to brcm,bcm63xx-gpio to reflect that bcm6345 has moved. Signed-off-by: Sean Anderson Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Signed-off-by: Bartosz Golaszewski commit f8d1af2475ec13385cacb299567fd0e45ca747d2 Author: Yang Li Date: Fri Apr 28 14:09:38 2023 +0800 gpio: ixp4xx: Use devm_platform_ioremap_resource() Convert platform_get_resource(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li Signed-off-by: Bartosz Golaszewski commit 8e84a8e69e3fa6aeb7720962f978bbd5a369c989 Author: Krzysztof Kozlowski Date: Sun May 7 16:48:07 2023 +0200 gpio: davinci: correct non-kerneldoc comment Drop kerneldoc annotation from regular comment to fix: gpio-davinci.c:716: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit 9ab24b0486681ecc059ee766e00d9570c6311e08 Author: Christophe JAILLET Date: Tue Apr 25 15:11:19 2023 +0200 cpufreq: tegra194: Fix an error handling path in tegra194_cpufreq_probe() If the probe needs to be deferred, some resources still need to be released. So branch to the error handling path instead of returning directly. Fixes: f41e1442ac5b ("cpufreq: tegra194: add OPP support and set bandwidth") Signed-off-by: Christophe JAILLET Reviewed-by: Sumit Gupta Acked-by: Thierry Reding Signed-off-by: Viresh Kumar commit 4b4c0d37164c296efbdbceacb8d2535a3910b13e Author: Mason Huo Date: Fri Apr 21 11:14:30 2023 +0800 cpufreq: dt-platdev: Add JH7110 SOC to the allowlist Add the compatible strings for supporting the generic cpufreq driver on the StarFive JH7110 SoC. Signed-off-by: Mason Huo Signed-off-by: Viresh Kumar commit 8bb7c7bca5b70f3cd22d95b4d36029295c4274f6 Author: Liu Ying Date: Mon May 8 16:38:26 2023 +0800 drm/panel: panel-simple: Add BOE EV121WXM-N10-1850 panel support Add BOE EV121WXM-N10-1850 12.1" WXGA (1280x800) TFT LCD panel support. The panel has a LVDS display interface. The panel's product specification can be found at: http://www.onetech.com.tw/files/EV121WXM-N10-1850ProductSpecification_20180801.pdf Signed-off-by: Liu Ying Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230508083826.1016206-3-victor.liu@nxp.com commit 0bd5bd65cd2e4d1335ea6c17cd2c8664decbc630 Author: Liu Ying Date: Mon May 8 16:38:25 2023 +0800 dt-bindings: display: simple: Add BOE EV121WXM-N10-1850 panel Add BOE EV121WXM-N10-1850 12.1" WXGA (1280x800) TFT LCD panel compatible string. The panel has a LVDS display interface. The panel's product specification can be found at: http://www.onetech.com.tw/files/EV121WXM-N10-1850ProductSpecification_20180801.pdf Acked-by: Krzysztof Kozlowski Signed-off-by: Liu Ying Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230508083826.1016206-2-victor.liu@nxp.com commit 7e8ba34d357127e2c93f18123d09b5c817156512 Author: Dmitry Baryshkov Date: Sun May 7 20:26:39 2023 +0300 drm/panel: sharp-ls043t1le01: drop dummy functions and data fields Drop sharp_nt_panel_disable() and sharp_nt_panel_enable(), which bear no useful code. Also drop sharp_nt_panel::enable and sharp_nt_panel::mode fields which also provide no use now. Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230507172639.2320934-2-dmitry.baryshkov@linaro.org commit dee23b2c9e3ff46d59c5d45e1436eceb878e7c9a Author: Dmitry Baryshkov Date: Sun May 7 20:26:38 2023 +0300 drm/panel: sharp-ls043t1le01: adjust mode settings Using current settings causes panel flickering on APQ8074 dragonboard. Adjust panel settings to follow the vendor-provided mode. This also enables MIPI_DSI_MODE_VIDEO_SYNC_PULSE, which is also specified by the vendor dtsi for the mentioned dragonboard. Fixes: ee0172383190 ("drm/panel: Add Sharp LS043T1LE01 MIPI DSI panel") Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230507172639.2320934-1-dmitry.baryshkov@linaro.org commit ccce324dabfe2143519daf50ed8b1ef1d0c542f7 Author: David Morley Date: Tue May 9 18:05:58 2023 +0000 tcp: make the first N SYN RTO backoffs linear Currently the SYN RTO schedule follows an exponential backoff scheme, which can be unnecessarily conservative in cases where there are link failures. In such cases, it's better to aggressively try to retransmit packets, so it takes routers less time to find a repath with a working link. We chose a default value for this sysctl of 4, to follow the macOS and IOS backoff scheme of 1,1,1,1,1,2,4,8, ... MacOS and IOS have used this backoff schedule for over a decade, since before this 2009 IETF presentation discussed the behavior: https://www.ietf.org/proceedings/75/slides/tcpm-1.pdf This commit makes the SYN RTO schedule start with a number of linear backoffs given by the following sysctl: * tcp_syn_linear_timeouts This changes the SYN RTO scheme to be: init_rto_val for tcp_syn_linear_timeouts, exp backoff starting at init_rto_val For example if init_rto_val = 1 and tcp_syn_linear_timeouts = 2, our backoff scheme would be: 1, 1, 1, 2, 4, 8, 16, ... Signed-off-by: David Morley Signed-off-by: Yuchung Cheng Signed-off-by: Neal Cardwell Tested-by: David Morley Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20230509180558.2541885-1-morleyd.kernel@gmail.com Signed-off-by: Paolo Abeni commit 123ee07ba5b7123e0ce0e0f9d64938026c16a2ce Author: XuDong Liu Date: Sun Apr 30 19:23:46 2023 +0800 drm: sun4i_tcon: use devm_clk_get_enabled in `sun4i_tcon_init_clocks` Smatch reports: drivers/gpu/drm/sun4i/sun4i_tcon.c:805 sun4i_tcon_init_clocks() warn: 'tcon->clk' from clk_prepare_enable() not released on lines: 792,801. In the function sun4i_tcon_init_clocks(), tcon->clk and tcon->sclk0 are not disabled in the error handling, which affects the release of these variable. Although sun4i_tcon_bind(), which calls sun4i_tcon_init_clocks(), use sun4i_tcon_free_clocks to disable the variables mentioned, but the error handling branch of sun4i_tcon_init_clocks() ignores the required disable process. To fix this issue, use the devm_clk_get_enabled to automatically balance enable and disabled calls. As original implementation use sun4i_tcon_free_clocks() to disable clk explicitly, we delete the related calls and error handling that are no longer needed. Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") Fixes: b14e945bda8a ("drm/sun4i: tcon: Prepare and enable TCON channel 0 clock at init") Fixes: 8e9240472522 ("drm/sun4i: support TCONs without channel 1") Fixes: 34d698f6e349 ("drm/sun4i: Add has_channel_0 TCON quirk") Signed-off-by: XuDong Liu Reviewed-by: Dongliang Mu Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230430112347.4689-1-m202071377@hust.edu.cn commit c7895b75865bb4413c7f29f1dcb7fd0593e9255c Merge: d40b28d642d52 2f6860e6133fc Author: Mark Brown Date: Thu May 11 15:01:27 2023 +0900 ASoC: qcom: add display port module support. Merge series from Srinivas Kandagatla : This patchset adds support to displayport on AudioReach. Patches are tested on X13s with two display ports. commit 8a690c151134df1ac8d71db4370b71f132d0fba6 Author: M Chetan Kumar Date: Tue May 9 22:06:35 2023 +0530 net: wwan: iosm: clean up unused struct members Below members are unused. - td_tag member defined in struct ipc_pipe. - adb_finish_timer & params defined in struct iosm_mux. Remove it to avoid unexpected usage. Signed-off-by: M Chetan Kumar Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/92ee483d79dfc871ed7408da8fec60b395ff3a9c.1683649868.git.m.chetan.kumar@linux.intel.com Signed-off-by: Jakub Kicinski commit c930192572db454371764f1efa81be9ff14e6961 Author: M Chetan Kumar Date: Tue May 9 22:06:22 2023 +0530 net: wwan: iosm: remove unused enum definition ipc_time_unit enum is defined but not used. Remove it to avoid unexpected usage. Signed-off-by: M Chetan Kumar Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/8295a6138f13c686590ee4021384ee992f717408.1683649868.git.m.chetan.kumar@linux.intel.com Signed-off-by: Jakub Kicinski commit 796fb97a8cd9f893026458d606a270d4d5799543 Author: M Chetan Kumar Date: Tue May 9 22:05:55 2023 +0530 net: wwan: iosm: remove unused macro definition IOSM_IF_ID_PAYLOAD is defined but not used. Remove it to avoid unexpected usage. Signed-off-by: M Chetan Kumar Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/0697e811cb7f10b4fd8f99e66bda1329efdd3d1d.1683649868.git.m.chetan.kumar@linux.intel.com Signed-off-by: Jakub Kicinski commit 26cd10a0b9761bffd4669a429f8a33cbccef5bbd Author: Jaewon Kim Date: Wed May 10 20:39:42 2023 +0900 spi: s3c64xx: Disable IRQ mode when using DMA Fixing the problem of enabling DMA mode and IRQ mode at the same time. In this case, a value of more than 6bits is written to RDY_LVL, it can cause an invasion of other registers, potentially leading to SPI transfer failure. Fixes: 1ee806718d5e ("spi: s3c64xx: support interrupt based pio mode") Signed-off-by: Jaewon Kim Date: Tue May 9 12:00:56 2023 +0100 regmap-irq: Remove virtual registers No remaining users, and it's been replaced by config registers. Signed-off-by: Aidan MacDonald Date: Tue May 9 12:00:55 2023 +0100 regmap-irq: Fix typo in documentation for .get_irq_reg() It refers to a non-existent "num_type_settings" value, which is an old name I'd used during development of config registers and later dropped because it wasn't very clear. The correct bound for the range is num_config_regs, which can be verified by checking the implementation. Signed-off-by: Aidan MacDonald Date: Tue May 9 13:42:37 2023 +0100 ASoC: ingenic: Add compatible string for X1000 SoC The audio controller in the X1000 is similar to the JZ47xx SoCs. Signed-off-by: Aidan MacDonald Date: Tue May 9 13:42:36 2023 +0100 ASoC: jz4740-i2s: Add support for X1000 SoC The X1000's AIC is similar to the AIC found on other Ingenic SoCs. It has symmetric playback/capture rates like the JZ4740, but more flexible clocking when outputting the system or bit clocks. Signed-off-by: Aidan MacDonald Date: Tue May 9 12:22:02 2023 +0100 ASoC: qcom: q6apm: add support to display ports in lpass dais This patch adds support to q6apm lpass display port dais. This support is required to get DP audio on x13s. Signed-off-by: Srinivas Kandagatla Date: Tue May 9 12:22:01 2023 +0100 ASoC: qcom: q6dsp: add support to more display ports Existing code base only supports one display port, this patch adds support upto 8 display ports. This support is required to allow platforms like X13s which have 3 display ports, and some of the Qualcomm SoCs there are upto 7 Display ports. Signed-off-by: Srinivas Kandagatla Date: Tue May 9 12:22:00 2023 +0100 ASoC: qcom: audioreach: add support for DISPLAY PORT SINK module Add support for DISPLAY PORT SINK module and associated configuration. Signed-off-by: Srinivas Kandagatla Date: Tue May 9 12:21:59 2023 +0100 ASoC: qcom: q6dsp-common: move channel allocation to common move hdmi/dp channel allocation to a common function q6dsp_get_channel_allocation() so that we can reuse this across q6afe and q6apm drivers. Signed-off-by: Srinivas Kandagatla Date: Wed May 10 17:27:55 2023 -0700 Input: adxl34x - do not hardcode interrupt trigger type Instead of hardcoding IRQ trigger type to IRQF_TRIGGER_HIGH, let's respect the settings specified in the firmware description. Fixes: e27c729219ad ("Input: add driver for ADXL345/346 Digital Accelerometers") Signed-off-by: Marek Vasut Acked-by: Michael Hennerich Link: https://lore.kernel.org/r/20230509203555.549158-1-marex@denx.de Signed-off-by: Dmitry Torokhov commit ad527ca87e4ea42d7baad2ce710b44069287931b Author: Marek Vasut Date: Sun May 7 15:39:06 2023 +0200 clk: rs9: Fix .driver_data content in i2c_device_id The .driver_data content in i2c_device_id table must match the .data content in of_device_id table, else device_get_match_data() would return bogus value on i2c_device_id match. Align the two tables. The i2c_device_id table is now converted from of_device_id using 's@.compatible = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@' Fixes: 892e0ddea1aa ("clk: rs9: Add Renesas 9-series PCIe clock generator driver") Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230507133906.15061-3-marek.vasut+renesas@mailbox.org Reviewed-by: Geert Uytterhoeven Signed-off-by: Stephen Boyd commit b5e10beeafaa3266559c582dde7534ae3fe8cefb Author: Marek Vasut Date: Sun May 7 15:39:05 2023 +0200 clk: vc7: Fix .driver_data content in i2c_device_id The .driver_data content in i2c_device_id table must match the .data content in of_device_id table, else device_get_match_data() would return bogus value on i2c_device_id match. Align the two tables. The i2c_device_id table is now converted from of_device_id using 's@.compatible = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@' Fixes: 48c5e98fedd9 ("clk: Renesas versaclock7 ccf device driver") Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230507133906.15061-2-marek.vasut+renesas@mailbox.org Reviewed-by: Geert Uytterhoeven Signed-off-by: Stephen Boyd commit be3471c5bd9b921c9adfab7948e8021611639164 Author: Marek Vasut Date: Sun May 7 15:39:04 2023 +0200 clk: vc5: Fix .driver_data content in i2c_device_id The .driver_data content in i2c_device_id table must match the .data content in of_device_id table, else device_get_match_data() would return bogus value on i2c_device_id match. Align the two tables. The i2c_device_id table is now converted from of_device_id using 's@.compatible = "idt,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@' Fixes: 9adddb01ce5f ("clk: vc5: Add structure to describe particular chip features") Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230507133906.15061-1-marek.vasut+renesas@mailbox.org Reviewed-by: Luca Ceresoli Reviewed-by: Geert Uytterhoeven Signed-off-by: Stephen Boyd commit 5f17cdb06e2a90b8318120933afe46b9fb01c129 Author: Chen-Yu Tsai Date: Fri Apr 21 19:11:25 2023 +0800 clk: mediatek: Enable all MT8192 clocks by default Currently the base MT8192 clock drivers are enabled by default, but all the other clock drivers need to be enabled by hand. This is extremely confusing and inconvenient for end users. For the MT8192 platform to be useful, most if not all the clock drivers driving the hardware blocks need to be enabled. Enable them by default whenever MT8192 base clock driver is enabled. Signed-off-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20230421111125.2397368-1-wenst@chromium.org Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: Alexandre Mergnat Signed-off-by: Stephen Boyd commit 48f2c681df4329b50fc92516c10e0398ca127242 Author: Uwe Kleine-König Date: Sat Apr 1 14:00:00 2023 +0200 pstore/ram: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Guilherme G. Piccoli Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230401120000.2487153-1-u.kleine-koenig@pengutronix.de commit 62279db5a3234d2d51310062fa2253b3a0de6fcf Author: Uwe Kleine-König Date: Thu Apr 27 14:55:31 2023 +0200 clk: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230427125531.622202-1-u.kleine-koenig@pengutronix.de Signed-off-by: Stephen Boyd commit a65615df5b458c7dcbbc3f6984a2063e77e445b3 Author: Uwe Kleine-König Date: Sun Apr 30 21:02:33 2023 +0200 clk: mediatek: Convert all remaining drivers to platform_driver's .remove_new() The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert all mediatek clk drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230430190233.878921-4-u.kleine-koenig@pengutronix.de Signed-off-by: Stephen Boyd commit b3bc72757e63dbbb3abdb0ab8a4ccf3d9b081cce Author: Uwe Kleine-König Date: Sun Apr 30 21:02:32 2023 +0200 clk: mediatek: Make mtk_clk_pdev_remove() return void This function returns 0 unconditionally. Make it return no value instead and convert the drivers making use of it to platform_driver's .remove_new(). This makes the semantics in the callers of mtk_clk_simple_remove() clearer and prepares for the quest to make platform driver's remove function return void. There is no semantic change. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230430190233.878921-3-u.kleine-koenig@pengutronix.de Signed-off-by: Stephen Boyd commit 61ca6ee782435a50f5ee816aa219dfa9ccc97c9a Author: Uwe Kleine-König Date: Sun Apr 30 21:02:31 2023 +0200 clk: mediatek: Make mtk_clk_simple_remove() return void __mtk_clk_simple_remove() and so also mtk_clk_simple_remove() return zero unconditionally. Make them return no value instead and convert the drivers making use of it to platform_driver's .remove_new(). This makes the semantics in the callers of mtk_clk_simple_remove() clearer and prepares for the quest to make platform driver's remove function return void. There is no semantic change. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230430190233.878921-2-u.kleine-koenig@pengutronix.de Signed-off-by: Stephen Boyd commit 0153431c85af3d4470ac8c59a3f854a3926dff86 Author: Thomas Weißschuh Date: Mon Feb 27 03:21:27 2023 +0000 efi: make kobj_type structure constant Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definition to prevent modification at runtime. Signed-off-by: Thomas Weißschuh Signed-off-by: Ard Biesheuvel commit 42a8af0fa4333701e0e318d3877f45bd6d51ce49 Author: Thomas Weißschuh Date: Mon Feb 27 03:09:36 2023 +0000 efi: x86: make kobj_type structure constant Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definition to prevent modification at runtime. Signed-off-by: Thomas Weißschuh Signed-off-by: Ard Biesheuvel commit 4795c78768bcbd58d4ffab650674d314dc6dd772 Author: Roman Beranek Date: Fri May 5 07:21:10 2023 +0200 drm: sun4i: calculate proper DCLK rate for DSI In DSI mode, TCON0's data clock is required to run at 1/4 the per-lane bit rate. Signed-off-by: Roman Beranek Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230505052110.67514-5-me@crly.cz commit 71ffeafb13380b73f41bc16495962371c0fda596 Author: Roman Beranek Date: Fri May 5 07:21:09 2023 +0200 drm: sun4i: rename sun4i_dotclock to sun4i_tcon_dclk While the rate of TCON0's DCLK matches dotclock for parallel and LVDS outputs, this doesn't hold for DSI. The 'D' in DCLK actually stands for 'Data' according to Allwinner's manuals. The clock is mostly referred to as dclk throughout this driver already anyway, so stick with that. Signed-off-by: Roman Beranek Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230505052110.67514-4-me@crly.cz commit b34348a0d7c513f78c70f4459a99c991f43688d5 Author: Yazen Ghannam Date: Mon Apr 10 14:09:59 2023 -0500 EDAC/amd64: Remove module version string The AMD64 EDAC module version information is not exposed through ABI like MODULE_VERSION(). Instead it is printed during module init. Version numbers can be confusing in cases where module updates are partly backported resulting in a difference between upstream and backported module versions. Remove the AMD64 EDAC module version information to avoid user confusion. Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230410190959.3367528-1-yazen.ghannam@amd.com commit 14e4ec9c3e9164c6719f98d8a3065c487be2aaa5 Author: Borislav Petkov (AMD) Date: Sun Feb 26 21:04:26 2023 +0100 x86/lib/memmove: Decouple ERMS from FSRM Up until now it was perceived that FSRM is an improvement to ERMS and thus it was made dependent on latter. However, there are AMD BIOSes out there which allow for disabling of either features and thus preventing kernels from booting due to the CMP disappearing and thus breaking the logic in the memmove() function. Similar observation happens on some VM migration scenarios. Patch the proper sequences depending on which feature is enabled. Reported-by: Daniel Verkamp Reported-by: Jiri Slaby Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/Y/yK0dyzI0MMdTie@zn.tnic commit 270a69c4485d7d07516d058bcc0473c90ee22185 Author: Peter Zijlstra Date: Wed Feb 8 18:10:52 2023 +0100 x86/alternative: Support relocations in alternatives A little while ago someone (Kirill) ran into the whole 'alternatives don't do relocations nonsense' again and I got annoyed enough to actually look at the code. Since the whole alternative machinery already fully decodes the instructions it is simple enough to adjust immediates and displacement when needed. Specifically, the immediates for IP modifying instructions (JMP, CALL, Jcc) and the displacement for RIP-relative instructions. [ bp: Massage comment some more and get rid of third loop in apply_relocation(). ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230208171431.313857925@infradead.org commit 6becb5026b8192e0ed6619d6e7793c2f1288244f Author: Peter Zijlstra Date: Wed Feb 8 18:10:51 2023 +0100 x86/alternative: Make debug-alternative selective Using debug-alternative generates a *LOT* of output, extend it a bit to select which of the many rewrites it reports on. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230208171431.253636689@infradead.org commit 059fa492027e99c167f4c53822c0900ca9bc254a Author: Ilia.Gavrilov Date: Wed May 10 09:23:40 2023 +0000 sctp: fix a potential OOB access in sctp_sched_set_sched() The 'sched' index value must be checked before accessing an element of the 'sctp_sched_ops' array. Otherwise, it can lead to OOB access. Note that it's harmless since the 'sched' parameter is checked before calling 'sctp_sched_set_sched'. Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE. Acked-by: Marcelo Ricardo Leitner Reviewed-by: Xin Long Reviewed-by: Simon Horman Signed-off-by: Ilia.Gavrilov Signed-off-by: David S. Miller commit 6096bc0555726c1cdded8486d8800cd4d81eb764 Author: wuych Date: Wed May 10 14:06:49 2023 +0800 net: liquidio: lio_vf_main: Remove unnecessary (void*) conversions Pointer variables of void * type do not require type cast. Signed-off-by: wuych Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit bd9424efc4825ecfc84cd81be777df71ba4404d1 Author: Subbaraya Sundeep Date: Wed May 10 13:58:09 2023 +0530 macsec: Use helper macsec_netdev_priv for offload drivers Now macsec on top of vlan can be offloaded to macsec offloading devices so that VLAN tag is sent in clear text on wire i.e, packet structure is DMAC|SMAC|VLAN|SECTAG. Offloading devices can simply enable NETIF_F_HW_MACSEC feature in netdev->vlan_features for this to work. But the logic in offloading drivers to retrieve the private structure from netdev needs to be changed to check whether the netdev received is real device or a vlan device and get private structure accordingly. This patch changes the offloading drivers to use helper macsec_netdev_priv instead of netdev_priv. Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 2f0f556713f08515f3017fd35309b1f00fbc8932 Author: Liang Li Date: Tue May 9 09:09:19 2023 +0000 selftests: bonding: delete unnecessary line "ip link set dev "$devbond1" nomaster" This line code in bond-eth-type-change.sh is unnecessary. Because $devbond1 was not added to any master device. Signed-off-by: Liang Li Acked-by: Hangbin Liu Reviewed-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 5e316a818e75c585dc7b601e8b51823a4059d408 Author: Lorenzo Bianconi Date: Tue May 9 11:05:16 2023 +0200 net: veth: make PAGE_POOL_STATS optional Since veth is very likely to be enabled and there are some drivers (e.g. mlx5) where CONFIG_PAGE_POOL_STATS is optional, make CONFIG_PAGE_POOL_STATS optional for veth too in order to keep it optional instead of required. Suggested-by: Jiri Benc Signed-off-by: Lorenzo Bianconi Reviewed-by: Simon Horman Acked-by: Jesper Dangaard Brouer Acked-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 65718c4d5266d22dd23c1d9d63a01acaa1b0805d Merge: 81ac2722fa198 85f050002ba99 Author: David S. Miller Date: Wed May 10 09:51:11 2023 +0100 Merge branch 'lan966x-es0-vcap' Horatiu Vultur says: ==================== net: lan966x: Add support for ES0 VCAP Provide the Egress Stage 0 (ES0) VCAP (Versatile Content-Aware Processor) support for the lan966x platform. The ES0 VCAP has only 1 lookup which is accessible with a TC chain id 10000000. Currently only one action is support which is vlan pop. Also it is possible to link the IS1 to ES0 using 'goto chain 10000000'. ==================== Signed-off-by: David S. Miller commit 85f050002ba99150168078adab6d0f38c0463494 Author: Horatiu Vultur Date: Tue May 9 09:26:45 2023 +0200 net: lan966x: Add TC support for ES0 VCAP Enable the TC command to use the lan966x ES0 VCAP. Currently support only one action which is vlan pop, other will be added later. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 96b6c8a662a39a9ce3a0dac929e23c8a8d454f37 Author: Horatiu Vultur Date: Tue May 9 09:26:44 2023 +0200 net: lan966x: Add ES0 VCAP keyset configuration for lan966x Add ES0 VCAP port keyset configuration for lan966x and also update debugfs to show the keyset configuration. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 011be872643446a9b7c4485cfc8b5f50b0f93a13 Author: Horatiu Vultur Date: Tue May 9 09:26:43 2023 +0200 net: lan966x: Add ES0 VCAP model Provide ES0 (egress stage 0) VCAP model for lan966x. This provides rewriting functionality in the gress path. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 81ac2722fa198fbfac62575259cf85163f3eeef0 Author: Martin Wetterwald Date: Mon May 8 19:44:47 2023 +0200 net: ipconfig: Allow DNS to be overwritten by DHCPACK Some DHCP server implementations only send the important requested DHCP options in the final BOOTP reply (DHCPACK). One example is systemd-networkd. However, RFC2131, in section 4.3.1 states: > The server MUST return to the client: > [...] > o Parameters requested by the client, according to the following > rules: > > -- IF the server has been explicitly configured with a default > value for the parameter, the server MUST include that value > in an appropriate option in the 'option' field, ELSE I've reported the issue here: https://github.com/systemd/systemd/issues/27471 Linux PNP DHCP client implementation only takes into account the DNS servers received in the first BOOTP reply (DHCPOFFER). This usually isn't an issue as servers are required to put the same values in the DHCPOFFER and DHCPACK. However, RFC2131, in section 4.3.2 states: > Any configuration parameters in the DHCPACK message SHOULD NOT > conflict with those in the earlier DHCPOFFER message to which the > client is responding. The client SHOULD use the parameters in the > DHCPACK message for configuration. When making Linux PNP DHCP client (cmdline ip=dhcp) interact with systemd-networkd DHCP server, an interesting "protocol misunderstanding" happens: Because DNS servers were only specified in the DHCPACK and not in the DHCPOFFER, Linux will not catch the correct DNS servers: in the first BOOTP reply (DHCPOFFER), it sees that there is no DNS, and sets as fallback the IP of the DHCP server itself. When the second BOOTP reply comes (DHCPACK), it's already too late: the kernel will not overwrite the fallback setting it has set previously. This patch makes the kernel overwrite its DNS fallback by DNS servers specified in the DHCPACK if any. Signed-off-by: Martin Wetterwald Signed-off-by: David S. Miller commit bc9d1f0cecd2407cfb2364a7d4be2f52d1d46a9d Author: John Paul Adrian Glaubitz Date: Wed May 3 14:57:41 2023 +0200 sh: j2: Use ioremap() to translate device tree address into kernel memory Addresses the following warning when building j2_defconfig: arch/sh/kernel/cpu/sh2/probe.c: In function 'scan_cache': arch/sh/kernel/cpu/sh2/probe.c:24:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 24 | j2_ccr_base = (u32 __iomem *)of_flat_dt_translate_address(node); | Fixes: 5a846abad07f ("sh: add support for J-Core J2 processor") Reviewed-by: Geert Uytterhoeven Tested-by: Rob Landley Signed-off-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230503125746.331835-1-glaubitz@physik.fu-berlin.de Signed-off-by: John Paul Adrian Glaubitz commit 9d142ed484a3d517e779fc3c16028a720762643f Author: Lorenzo Bianconi Date: Mon May 8 22:45:23 2023 +0200 net: veth: rely on napi_build_skb in veth_convert_skb_to_xdp_buff Since veth_convert_skb_to_xdp_buff routine runs in veth_poll() NAPI, rely on napi_build_skb() instead of build_skb() to reduce skb allocation cost. Signed-off-by: Lorenzo Bianconi Reviewed-by: Yunsheng Lin Link: https://lore.kernel.org/r/0f822c0b72f8b71555c11745cb8fb33399d02de9.1683578488.git.lorenzo@kernel.org Signed-off-by: Jakub Kicinski commit af8eacf2b42e0a736a7a2a1379fb6c0b7fd66da4 Author: Teoh Ji Sheng Date: Mon May 8 22:43:40 2023 +0800 net: stmmac: xgmac: add ethtool per-queue irq statistic support Commit af9bf70154eb ("net: stmmac: add ethtool per-queue irq statistic support") introduced ethtool per-queue statistics support to display number of interrupts generated by DMA tx and DMA rx for DWMAC4 core. This patch extend the support to XGMAC core. Signed-off-by: Teoh Ji Sheng Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230508144339.3014402-1-ji.sheng.teoh@intel.com Signed-off-by: Jakub Kicinski commit 341d3bda8cfabcf57c635ddd9a87f78c8e812532 Merge: 505e315bc7f53 a86f8601c8f06 Author: Jakub Kicinski Date: Tue May 9 19:55:32 2023 -0700 Merge branch 'net-stmmac-convert-to-platform-remove-callback-returning-void' Uwe Kleine-König says: ==================== net: stmmac: Convert to platform remove callback returning void (implicit) v1 of this series is available at https://lore.kernel.org/netdev/20230402143025.2524443-1-u.kleine-koenig@pengutronix.de Changes since then: - Added various Reviewed-by: and Acked-by: tags received for v1 - Removed a variable in an earlier patch to make all intermediate steps compilable, spotted by Simon Horman - Rebased to v6.4-rc1 (which needed a slight adaption to cope for 4bd3bb7b4526 ("net: stmmac: Add glue layer for StarFive JH7110 SoC")) ==================== Link: https://lore.kernel.org/r/20230508142637.1449363-1-u.kleine-koenig@pengutronix.de Signed-off-by: Jakub Kicinski commit a86f8601c8f067d38bdb972885df4c0f5ed82738 Author: Uwe Kleine-König Date: Mon May 8 16:26:37 2023 +0200 net: stmmac: dwmac-tegra: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: Simon Horman Acked-by: Thierry Reding Signed-off-by: Uwe Kleine-König Reviewed-by: Michal Kubiak Signed-off-by: Jakub Kicinski commit cc708d4ed7b3d8d93c0e7f64c14a56d2b545e37a Author: Uwe Kleine-König Date: Mon May 8 16:26:36 2023 +0200 net: stmmac: dwmac-sun8i: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Acked-by: Jernej Skrabec Reviewed-by: Simon Horman Signed-off-by: Uwe Kleine-König Reviewed-by: Michal Kubiak Signed-off-by: Jakub Kicinski commit fec3f552140ec5d10e3fb8eecbf8fd7f80476d02 Author: Uwe Kleine-König Date: Mon May 8 16:26:35 2023 +0200 net: stmmac: dwmac-stm32: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: Simon Horman Signed-off-by: Uwe Kleine-König Reviewed-by: Michal Kubiak Signed-off-by: Jakub Kicinski commit b394982a10d93d772c962fb18f9a5f8c24f1d351 Author: Uwe Kleine-König Date: Mon May 8 16:26:34 2023 +0200 net: stmmac: dwmac-sti: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: Simon Horman Signed-off-by: Uwe Kleine-König Reviewed-by: Michal Kubiak Signed-off-by: Jakub Kicinski commit 903cc461c901d854546096e01aa4bf32d2438c94 Author: Uwe Kleine-König Date: Mon May 8 16:26:33 2023 +0200 net: stmmac: dwmac-rk: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: Simon Horman Signed-off-by: Uwe Kleine-König Reviewed-by: Michal Kubiak Signed-off-by: Jakub Kicinski commit 5580b559a80a3559a3b395a053f83e196aa801af Author: Uwe Kleine-König Date: Mon May 8 16:26:32 2023 +0200 net: stmmac: dwmac-qcom-ethqos: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: Simon Horman Signed-off-by: Uwe Kleine-König Reviewed-by: Bhupesh Sharma Reviewed-by: Michal Kubiak Signed-off-by: Jakub Kicinski commit 360cd89064b6e466b046680e79fd833325225a3f Author: Uwe Kleine-König Date: Mon May 8 16:26:31 2023 +0200 net: stmmac: dwmac-dwc-qos-eth: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: Simon Horman Signed-off-by: Uwe Kleine-König Reviewed-by: Michal Kubiak Signed-off-by: Jakub Kicinski commit f4d05c41976170e29aac1bc51df22fb6989d1427 Author: Uwe Kleine-König Date: Mon May 8 16:26:30 2023 +0200 net: stmmac: dwmac-visconti: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: Simon Horman Signed-off-by: Uwe Kleine-König Acked-by: Nobuhiro Iwamatsu Reviewed-by: Michal Kubiak Signed-off-by: Jakub Kicinski commit c5f3ffe35cc92cce6292b5304409f3edc9281d66 Author: Uwe Kleine-König Date: Mon May 8 16:26:29 2023 +0200 net: stmmac: dwmac-qcom-ethqos: Drop an if with an always false condition The remove callback is only ever called after .probe() returned successfully. After that get_stmmac_bsp_priv() always return non-NULL. Side note: The early exit would also be a bug because the return value of qcom_ethqos_remove() is ignored by the device core and the device is unbound unconditionally. So exiting early resulted in a dangerous resource leak as all devm allocated resources (some memory and the register mappings) are freed but the network device stays around. Using the network device afterwards probably oopses. Reviewed-by: Simon Horman Signed-off-by: Uwe Kleine-König Reviewed-by: Michal Kubiak Signed-off-by: Jakub Kicinski commit b9bc44fe068d6e44504f6f3eb03a325fd6843d60 Author: Uwe Kleine-König Date: Mon May 8 16:26:28 2023 +0200 net: stmmac: dwmac-visconti: Make visconti_eth_clock_remove() return void The function returns zero unconditionally. Change it to return void instead which simplifies one caller as error handing becomes unnecessary. Signed-off-by: Uwe Kleine-König Reviewed-by: Simon Horman Acked-by: Nobuhiro Iwamatsu Reviewed-by: Michal Kubiak Signed-off-by: Jakub Kicinski commit 3246627f11c56b4ec875b7225ba9b4fe0d53c271 Author: Uwe Kleine-König Date: Mon May 8 16:26:27 2023 +0200 net: stmmac: Make stmmac_pltfr_remove() return void The function returns zero unconditionally. Change it to return void instead which simplifies some callers as error handing becomes unnecessary. The function is also used for some drivers as remove callback. Switch these to the .remove_new() callback. For some others no error can happen in the remove callback now, convert them to .remove_new(), too. Acked-by: Jernej Skrabec Reviewed-by: Simon Horman Reviewed-by: Martin Blumenstingl Reviewed-by: Michal Kubiak Signed-off-by: Uwe Kleine-König Signed-off-by: Jakub Kicinski commit 505e315bc7f53ca9c1f0e604f40e026fbcc41ed1 Merge: 559ae55cfc334 21e26a71f5d3c Author: Jakub Kicinski Date: Tue May 9 19:45:01 2023 -0700 Merge branch 'virtio_net-refactor-xdp-codes' Xuan Zhuo says: ==================== virtio_net: refactor xdp codes Due to historical reasons, the implementation of XDP in virtio-net is relatively chaotic. For example, the processing of XDP actions has two copies of similar code. Such as page, xdp_page processing, etc. The purpose of this patch set is to refactor these code. Reduce the difficulty of subsequent maintenance. Subsequent developers will not introduce new bugs because of some complex logical relationships. In addition, the supporting to AF_XDP that I want to submit later will also need to reuse the logic of XDP, such as the processing of actions, I don't want to introduce a new similar code. In this way, I can reuse these codes in the future. ==================== Link: https://lore.kernel.org/r/20230508061417.65297-1-xuanzhuo@linux.alibaba.com Signed-off-by: Jakub Kicinski commit 21e26a71f5d3cae2551abcda318263a6a8c15206 Author: Xuan Zhuo Date: Mon May 8 14:14:17 2023 +0800 virtio_net: introduce virtnet_build_skb() This logic is used in multiple places, now we separate it into a helper. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit 19e8c85e336d17ae43cf730590fe6337ea238af0 Author: Xuan Zhuo Date: Mon May 8 14:14:16 2023 +0800 virtio_net: introduce receive_small_build_xdp Simplifying receive_small() function. Bringing the logic relating to build_skb together. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit aef76506bc64bbf567490cbe437c26f1aadeee90 Author: Xuan Zhuo Date: Mon May 8 14:14:15 2023 +0800 virtio_net: small: remove skip_xdp Because the skb build code is not shared between xdp and non-xdp, and the xdp code in receive_small() is simpler, so "skip_xdp" is not needed. We can remove it. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit 7af70fc169bd254aea780115b0f355956f84902b Author: Xuan Zhuo Date: Mon May 8 14:14:14 2023 +0800 virtio_net: small: avoid code duplication in xdp scenarios Avoid the problem that some variables(headroom and so on) will repeat the calculation when process xdp. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit fc8ce84b09bcc7306f3128f783967ecbfa617207 Author: Xuan Zhuo Date: Mon May 8 14:14:13 2023 +0800 virtio_net: small: remove the delta In the case of XDP-PASS, skb_reserve uses the "delta" to compatible non-XDP, now that is not shared between xdp and non-xdp, so we can remove this logic. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit c5f3e72f04c02cc2a0671adbb16224e61dc4bd8a Author: Xuan Zhuo Date: Mon May 8 14:14:12 2023 +0800 virtio_net: introduce receive_small_xdp() The purpose of this patch is to simplify the receive_small(). Separate all the logic of XDP of small into a function. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit 59ba3b1a88a8251d8fd0ef847afb59aa83a47126 Author: Xuan Zhuo Date: Mon May 8 14:14:11 2023 +0800 virtio_net: merge: remove skip_xdp Now, the logic of merge xdp process is simple, we can remove the skip_xdp. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit d8f2835a4746f26523cb512dc17e2b0a00dd31a9 Author: Xuan Zhuo Date: Mon May 8 14:14:10 2023 +0800 virtio_net: introduce receive_mergeable_xdp() The purpose of this patch is to simplify the receive_mergeable(). Separate all the logic of XDP into a function. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit 4cb00b13c064088352a4f2ca4a8279010ad218a8 Author: Xuan Zhuo Date: Mon May 8 14:14:09 2023 +0800 virtio_net: virtnet_build_xdp_buff_mrg() auto release xdp shinfo virtnet_build_xdp_buff_mrg() auto release xdp shinfo then the caller no need to careful the xdp shinfo. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit 80f50f918c6e2d3f46aae717e6b04271298ab1c0 Author: Xuan Zhuo Date: Mon May 8 14:14:08 2023 +0800 virtio_net: separate the logic of freeing the rest mergeable buf This patch introduce a new function that frees the rest mergeable buf. The subsequent patch will reuse this function. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit bb2c1e9e75be4a059fa795aac58b805091c9dae7 Author: Xuan Zhuo Date: Mon May 8 14:14:07 2023 +0800 virtio_net: separate the logic of freeing xdp shinfo This patch introduce a new function that releases the xdp shinfo. The subsequent patch will reuse this function. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit 00765f8ed74240419091a1708c195405b55fe243 Author: Xuan Zhuo Date: Mon May 8 14:14:06 2023 +0800 virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp At present, we have two similar logic to perform the XDP prog. Therefore, this patch separates the code of executing XDP, which is conducive to later maintenance. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit dbe4fec2447dd215964aad88b0e06f96c6958ee9 Author: Xuan Zhuo Date: Mon May 8 14:14:05 2023 +0800 virtio_net: optimize mergeable_xdp_get_buf() The previous patch, in order to facilitate review, I do not do any modification. This patch has made some optimization on the top. * remove some repeated logics in this function. * add fast check for passing without any alloc. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit ad4858beb824aeba53deeae660ea7fab9e624bc0 Author: Xuan Zhuo Date: Mon May 8 14:14:04 2023 +0800 virtio_net: introduce mergeable_xdp_get_buf() Separating the logic of preparation for xdp from receive_mergeable. The purpose of this is to simplify the logic of execution of XDP. The main logic here is that when headroom is insufficient, we need to allocate a new page and calculate offset. It should be noted that if there is new page, the variable page will refer to the new page. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit 363d8ce4b94719a87dad865e2829f1dba0f7ef71 Author: Xuan Zhuo Date: Mon May 8 14:14:03 2023 +0800 virtio_net: mergeable xdp: put old page immediately In the xdp implementation of virtio-net mergeable, it always checks whether two page is used and a page is selected to release. This is complicated for the processing of action, and be careful. In the entire process, we have such principles: * If xdp_page is used (PASS, TX, Redirect), then we release the old page. * If it is a drop case, we will release two. The old page obtained from buf is release inside err_xdp, and xdp_page needs be relased by us. But in fact, when we allocate a new page, we can release the old page immediately. Then just one is using, we just need to release the new page for drop case. On the drop path, err_xdp will release the variable "page", so we only need to let "page" point to the new xdp_page in advance. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Signed-off-by: Jakub Kicinski commit 559ae55cfc334c91c62d2ea054a3345611363ee0 Author: Lukas Bulwahn Date: Tue May 9 09:12:07 2023 +0200 net: skbuff: remove special handling for SLOB Commit c9929f0e344a ("mm/slob: remove CONFIG_SLOB") removes CONFIG_SLOB. Now, we can also remove special handling for socket buffers with the SLOB allocator. The code with HAVE_SKB_SMALL_HEAD_CACHE=1 is now the default behavior for all allocators. Remove an unnecessary distinction between SLOB and SLAB/SLUB allocator after the SLOB allocator is gone. Signed-off-by: Lukas Bulwahn Reviewed-by: Leon Romanovsky Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20230509071207.28942-1-lukas.bulwahn@gmail.com Signed-off-by: Jakub Kicinski commit a731a43e8669a0b430c79a3e38890c27a5847a76 Author: Yinjun Zhang Date: Tue May 9 09:58:17 2023 +0200 nfp: improve link modes reading process Avoid reading link modes from management firmware every time when `ethtool_get_link_ksettings` is called, only communicate with management firmware when necessary like we do for eth_table info. This change can ease the situation that when large number of vlan sub-interfaces are created and their information is requested by some monitoring process like PCP [1] through ethool ioctl frequently. [1] https://pcp.io Signed-off-by: Yinjun Zhang Acked-by: Simon Horman Signed-off-by: Louis Peens Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20230509075817.10566-1-louis.peens@corigine.com Signed-off-by: Jakub Kicinski commit edff5e9a99e0ed9463999455b2604c3154eb7ab3 Author: Zqiang Date: Thu Mar 23 12:00:11 2023 +0800 rcu-tasks: Clarify the cblist_init_generic() function's pr_info() output This commit uses rtp->name instead of __func__ and outputs the value of rcu_task_cb_adjust, thus reducing console-log output. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit 5fc8cbe4cf0fd34ded8045c385790c3bf04f6785 Author: Shigeru Yoshida Date: Wed Aug 3 01:22:05 2022 +0900 rcu-tasks: Avoid pr_info() with spin lock in cblist_init_generic() pr_info() is called with rtp->cbs_gbl_lock spin lock locked. Because pr_info() calls printk() that might sleep, this will result in BUG like below: [ 0.206455] cblist_init_generic: Setting adjustable number of callback queues. [ 0.206463] [ 0.206464] ============================= [ 0.206464] [ BUG: Invalid wait context ] [ 0.206465] 5.19.0-00428-g9de1f9c8ca51 #5 Not tainted [ 0.206466] ----------------------------- [ 0.206466] swapper/0/1 is trying to lock: [ 0.206467] ffffffffa0167a58 (&port_lock_key){....}-{3:3}, at: serial8250_console_write+0x327/0x4a0 [ 0.206473] other info that might help us debug this: [ 0.206473] context-{5:5} [ 0.206474] 3 locks held by swapper/0/1: [ 0.206474] #0: ffffffff9eb597e0 (rcu_tasks.cbs_gbl_lock){....}-{2:2}, at: cblist_init_generic.constprop.0+0x14/0x1f0 [ 0.206478] #1: ffffffff9eb579c0 (console_lock){+.+.}-{0:0}, at: _printk+0x63/0x7e [ 0.206482] #2: ffffffff9ea77780 (console_owner){....}-{0:0}, at: console_emit_next_record.constprop.0+0x111/0x330 [ 0.206485] stack backtrace: [ 0.206486] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.19.0-00428-g9de1f9c8ca51 #5 [ 0.206488] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014 [ 0.206489] Call Trace: [ 0.206490] [ 0.206491] dump_stack_lvl+0x6a/0x9f [ 0.206493] __lock_acquire.cold+0x2d7/0x2fe [ 0.206496] ? stack_trace_save+0x46/0x70 [ 0.206497] lock_acquire+0xd1/0x2f0 [ 0.206499] ? serial8250_console_write+0x327/0x4a0 [ 0.206500] ? __lock_acquire+0x5c7/0x2720 [ 0.206502] _raw_spin_lock_irqsave+0x3d/0x90 [ 0.206504] ? serial8250_console_write+0x327/0x4a0 [ 0.206506] serial8250_console_write+0x327/0x4a0 [ 0.206508] console_emit_next_record.constprop.0+0x180/0x330 [ 0.206511] console_unlock+0xf7/0x1f0 [ 0.206512] vprintk_emit+0xf7/0x330 [ 0.206514] _printk+0x63/0x7e [ 0.206516] cblist_init_generic.constprop.0.cold+0x24/0x32 [ 0.206518] rcu_init_tasks_generic+0x5/0xd9 [ 0.206522] kernel_init_freeable+0x15b/0x2a2 [ 0.206523] ? rest_init+0x160/0x160 [ 0.206526] kernel_init+0x11/0x120 [ 0.206527] ret_from_fork+0x1f/0x30 [ 0.206530] [ 0.207018] cblist_init_generic: Setting shift to 1 and lim to 1. This patch moves pr_info() so that it is called without rtp->cbs_gbl_lock locked. Signed-off-by: Shigeru Yoshida Tested-by: "Zhang, Qiang1" Signed-off-by: Paul E. McKenney commit b96a8b0b5be40f9bc9e45819f14b32ea9cdce73f Author: Frederic Weisbecker Date: Wed Mar 29 18:02:02 2023 +0200 rcu/nocb: Recheck lazy callbacks under the ->nocb_lock from shrinker The ->lazy_len is only checked locklessly. Recheck again under the ->nocb_lock to avoid spending more time on flushing/waking if not necessary. The ->lazy_len can still increment concurrently (from 1 to infinity) but under the ->nocb_lock we at least know for sure if there are lazy callbacks at all (->lazy_len > 0). Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit 7625926086765123251f765d91fc3a70617d334d Author: Frederic Weisbecker Date: Wed Mar 29 18:02:01 2023 +0200 rcu/nocb: Fix shrinker race against callback enqueuer The shrinker resets the lazy callbacks counter in order to trigger the pending lazy queue flush though the rcuog kthread. The counter reset is protected by the ->nocb_lock against concurrent accesses...except for one of them. Here is a list of existing synchronized readers/writer: 1) The first lazy enqueuer (incrementing ->lazy_len to 1) does so under ->nocb_lock and ->nocb_bypass_lock. 2) The further lazy enqueuers (incrementing ->lazy_len above 1) do so under ->nocb_bypass_lock _only_. 3) The lazy flush checks and resets to 0 under ->nocb_lock and ->nocb_bypass_lock. The shrinker protects its ->lazy_len reset against cases 1) and 3) but not against 2). As such, setting ->lazy_len to 0 under the ->nocb_lock may be cancelled right away by an overwrite from an enqueuer, leading rcuog to ignore the flush. To avoid that, use the proper bypass flush API which takes care of all those details. Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit 5c83cedbaaad6dfe290e50658a204556ac5ac683 Author: Frederic Weisbecker Date: Wed Mar 29 18:02:00 2023 +0200 rcu/nocb: Protect lazy shrinker against concurrent (de-)offloading The shrinker may run concurrently with callbacks (de-)offloading. As such, calling rcu_nocb_lock() is very dangerous because it does a conditional locking. The worst outcome is that rcu_nocb_lock() doesn't lock but rcu_nocb_unlock() eventually unlocks, or the reverse, creating an imbalance. Fix this with protecting against (de-)offloading using the barrier mutex. Although if the barrier mutex is contended, which should be rare, then step aside so as not to trigger a mutex VS allocation dependency chain. Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit 6b706e5603c44ff0b6f43c2e26e0d590e1d265f8 Author: Zqiang Date: Tue Apr 18 20:27:02 2023 +0800 rcu/kvfree: Make drain_page_cache() take early return if cache is disabled If the rcutree.rcu_min_cached_objs kernel boot parameter is set to zero, then krcp->page_cache_work will never be triggered to fill page cache. In addition, the put_cached_bnode() will not fill page cache. As a result krcp->bkvcache will always be empty, so there is no need to acquire krcp->lock to get page from krcp->bkvcache. This commit therefore makes drain_page_cache() return immediately if the rcu_min_cached_objs is zero. Signed-off-by: Zqiang Reviewed-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney commit 60888b77a06ea16665e4df980bb86b418253e268 Author: Zqiang Date: Wed Apr 12 22:31:27 2023 +0800 rcu/kvfree: Make fill page cache start from krcp->nr_bkv_objs When the fill_page_cache_func() function is invoked, it assumes that the cache of pages is completely empty. However, there can be some time between triggering execution of this function and its actual invocation. During this time, kfree_rcu_work() might run, and might fill in part or all of this cache of pages, thus invalidating the fill_page_cache_func() function's assumption. This will not overfill the cache because put_cached_bnode() will reject the extra page. However, it will result in a needless allocation and freeing of one extra page, which might not be helpful under lowish-memory conditions. This commit therefore causes the fill_page_cache_func() to explicitly account for pages that have been placed into the cache shortly before it starts running. Signed-off-by: Zqiang Reviewed-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney commit 021a5ff8474379cd6c23e9b0e97aa27e5ff66a8b Author: Uladzislau Rezki (Sony) Date: Tue Apr 11 15:13:41 2023 +0200 rcu/kvfree: Do not run a page work if a cache is disabled By default the cache size is 5 pages per CPU, but it can be disabled at boot time by setting the rcu_min_cached_objs to zero. When that happens, the current code will uselessly set an hrtimer to schedule refilling this cache with zero pages. This commit therefore streamlines this process by simply refusing the set the hrtimer when rcu_min_cached_objs is zero. Signed-off-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney commit 309a4316507767f8078d30c9681dc76f4299b0f1 Author: Zqiang Date: Sat Apr 8 22:25:30 2023 +0800 rcu/kvfree: Use consistent krcp when growing kfree_rcu() page cache The add_ptr_to_bulk_krc_lock() function is invoked to allocate a new kfree_rcu() page, also known as a kvfree_rcu_bulk_data structure. The kfree_rcu_cpu structure's lock is used to protect this operation, except that this lock must be momentarily dropped when allocating memory. It is clearly important that the lock that is reacquired be the same lock that was acquired initially via krc_this_cpu_lock(). Unfortunately, this same krc_this_cpu_lock() function is used to re-acquire this lock, and if the task migrated to some other CPU during the memory allocation, this will result in the kvfree_rcu_bulk_data structure being added to the wrong CPU's kfree_rcu_cpu structure. This commit therefore replaces that second call to krc_this_cpu_lock() with raw_spin_lock_irqsave() in order to explicitly acquire the lock on the correct kfree_rcu_cpu structure, thus keeping things straight even when the task migrates. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit 1e237994d9c9a5ae47ae13030585a413a29469e6 Author: Zqiang Date: Wed Apr 5 10:13:59 2023 +0800 rcu/kvfree: Invoke debug_rcu_bhead_unqueue() after checking bnode->gp_snap If kvfree_rcu_bulk() sees that the required grace period has failed to elapse, it leaks the memory because readers might still be using it. But in that case, the debug-objects subsystem still marks the relevant structures as having been freed, even though they are instead being leaked. This commit fixes this mismatch by invoking debug_rcu_bhead_unqueue() only when we are actually going to free the objects. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit f32276a37652a9ce05db27cdfb40ac3e3fc98f9f Author: Uladzislau Rezki (Sony) Date: Tue Apr 4 16:13:00 2023 +0200 rcu/kvfree: Add debug check for GP complete for kfree_rcu_cpu list Under low-memory conditions, kvfree_rcu() will use each object's rcu_head structure to queue objects in a singly linked list headed by the kfree_rcu_cpu structure's ->head field. This list is passed to call_rcu() as a unit, but there is no indication of which grace period this list needs to wait for. This in turn prevents adding debug checks in the kfree_rcu_work() as was done for the two page-of-pointers channels in the kfree_rcu_cpu structure. This commit therefore adds a ->head_free_gp_snap field to the kfree_rcu_cpu_work structure to record this grace-period number. It also adds a WARN_ON_ONCE() to kfree_rcu_monitor() that checks to make sure that the required grace period has in fact elapsed. [ paulmck: Fix kerneldoc issue raised by Stephen Rothwell. ] Signed-off-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney commit cdfa0f6fa6b7183c062046043b649b9a91e3ac52 Author: Paul E. McKenney Date: Mon Apr 3 16:49:14 2023 -0700 rcu/kvfree: Add debug to check grace periods This commit adds debugging checks to verify that the required RCU grace period has elapsed for each kvfree_rcu_bulk_data structure that arrives at the kvfree_rcu_bulk() function. These checks make use of that structure's ->gp_snap field, which has been upgraded from an unsigned long to an rcu_gp_oldstate structure. This upgrade reduces the chances of false positives to nearly zero, even on 32-bit systems, for which this structure carries 64 bits of state. Cc: Ziwei Dai Signed-off-by: Paul E. McKenney commit 7e3f926bf4538cb4988b3e3f8bc1cb4a603b2ef6 Author: Uladzislau Rezki (Sony) Date: Wed Feb 1 16:09:54 2023 +0100 rcu/kvfree: Eliminate k[v]free_rcu() single argument macro The kvfree_rcu() and kfree_rcu() APIs are hazardous in that if you forget the second argument, it works, but might sleep. This sleeping can be a correctness bug from atomic contexts, and even in non-atomic contexts it might introduce unacceptable latencies. This commit therefore removes the single-argument kvfree_rcu() and kfree_rcu() macros. Code that would have previously used these single-argument kvfree_rcu() and kfree_rcu() macros should instead use kvfree_rcu_mightsleep() or kfree_rcu_mightsleep(). [ paulmck: Apply Joel Fernandes feedback. ] Signed-off-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) commit 1da82598cfc22f43fb0a3bd47774f7e886cc8b62 Author: Paul E. McKenney Date: Sat Mar 18 13:51:10 2023 -0700 srcu: Remove extraneous parentheses from srcu_read_lock() etc. This commit removes extraneous parentheses from srcu_read_lock(), srcu_read_lock_nmisafe(), srcu_read_unlock(), and srcu_read_unlock_nmisafe(). Looks like someone was once a macro. Cc: Christoph Hellwig Tested-by: Sachin Sant Tested-by: "Zhang, Qiang1" Signed-off-by: Paul E. McKenney commit 5d80155b17b3125bce873ae3c939b1bb7c11d92b Author: Zqiang Date: Mon Apr 24 19:51:07 2023 +0800 MAINTAINERS: Update qiang1.zhang@intel.com to qiang.zhang1211@gmail.com The qiang1.zhang@intel.com email address will no longer be used, so this commit updates to qiang.zhang1211@gmail.com. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit fb6112497bfe6defef46e58da0d5f291c11bd819 Author: Paul E. McKenney Date: Tue Mar 21 17:33:07 2023 -0700 doc: Document the rcutree.rcu_resched_ns module parameter This commit adds kernel-parameters.txt documentation for the rcutree.rcu_resched_ns module parameter. Signed-off-by: Paul E. McKenney commit 51823ca651364f68bd3ad33d848c1542fffdd627 Author: Paul E. McKenney Date: Tue Mar 21 17:28:40 2023 -0700 doc: Get rcutree module parameters back into alpha order This commit puts the rcutree module parameters back into proper alphabetical order. Signed-off-by: Paul E. McKenney commit 228354ed692faa08f40f2630658c0771f77da457 Author: Rong Tao Date: Sat Apr 22 22:27:38 2023 +0800 tools/counter: Makefile: Remove lingering 'include' directories on make clean `make` creates 'include' directories where necessary, so remove them as appropriate on `make clean`. Signed-off-by: Rong Tao Link: https://lore.kernel.org/r/tencent_F85E314661100B0CE2845EB27E2E2F558C09@qq.com/ Signed-off-by: William Breathitt Gray commit 6a9a092eb25851e16ecacc04ca2b155635d4e52f Author: Rong Tao Date: Sat Apr 22 22:35:53 2023 +0800 tools/counter: Add .gitignore Ignore counter_example and include/linux/counter.h. Signed-off-by: Rong Tao Link: https://lore.kernel.org/r/tencent_3E0341A1C9AC8FCB7915E7D791D117445707@qq.com/ Signed-off-by: William Breathitt Gray commit 5272145d5cccd7cb73a8ce4b0b90c1c6b37a6a66 Author: Uwe Kleine-König Date: Thu Apr 13 23:23:39 2023 +0200 counter: stm32-timer-cnt: Reset TIM_TISEL to its default value in probe The driver assumes that the input selection register (TIM_TISEL) is at its reset default value. Usually this is the case, but the bootloader might have modified it. This bases on a similar patch submitted by Olivier Moysan for pwm-stm32. Reviewed-by: Fabrice Gasnier Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230413212339.3611722-1-u.kleine-koenig@pengutronix.de/ Signed-off-by: William Breathitt Gray commit a4ec431fbf6b9533d2bb21fa328d88c1436106cf Author: William Breathitt Gray Date: Mon Apr 10 09:45:16 2023 -0400 counter: 104-quad-8: Remove reference in Kconfig to 25-bit counter value Support for 25-bit counter values was removed in commit 4aa3b75c7460 ("counter: 104-quad-8: Fix race condition between FLAG and CNTR reads"). Adjust the Kconfig description of CONFIG_104_QUAD_8 to remove reference of 25-bit counter values. Link: https://lore.kernel.org/r/20230410134516.102886-1-william.gray@linaro.org/ Signed-off-by: William Breathitt Gray commit 0ac448e0d29d6ba978684b3fa2e3ac7294ec2475 Author: Mike Pastore Date: Sun May 7 02:35:19 2023 -0500 PCI: Delay after FLR of Solidigm P44 Pro NVMe Prevent KVM hang when a Solidgm P44 Pro NVMe is passed through to a guest via IOMMU and the guest is subsequently rebooted. A similar issue was identified and patched by 51ba09452d11 ("PCI: Delay after FLR of Intel DC P3700 NVMe") and the same fix can be applied for this case. (Intel spun off their NAND and SSD business as Solidigm and sold it to SK Hynix in late 2021.) Link: https://lore.kernel.org/r/20230507073519.9737-1-mike@oobak.org Signed-off-by: Mike Pastore Signed-off-by: Bjorn Helgaas commit 4eaa40bdabff8f5be634f151f8e564a8976f0572 Author: Stanislav Jakubek Date: Mon May 8 14:45:32 2023 +0200 ARM: dts: bcm-mobile: align SDHCI node name with bindings Bindings expect SDHCI/MMC node names to be "mmc". Signed-off-by: Stanislav Jakubek Link: https://lore.kernel.org/r/88c64da50a1af868d8b14054c440e5ff96a63399.1683548624.git.stano.jakubek@gmail.com Signed-off-by: Florian Fainelli commit d15121be7485655129101f3960ae6add40204463 Author: Paolo Abeni Date: Mon May 8 08:17:44 2023 +0200 Revert "softirq: Let ksoftirqd do its job" This reverts the following commits: 4cd13c21b207 ("softirq: Let ksoftirqd do its job") 3c53776e29f8 ("Mark HI and TASKLET softirq synchronous") 1342d8080f61 ("softirq: Don't skip softirq execution when softirq thread is parking") in a single change to avoid known bad intermediate states introduced by a patch series reverting them individually. Due to the mentioned commit, when the ksoftirqd threads take charge of softirq processing, the system can experience high latencies. In the past a few workarounds have been implemented for specific side-effects of the initial ksoftirqd enforcement commit: commit 1ff688209e2e ("watchdog: core: make sure the watchdog_worker is not deferred") commit 8d5755b3f77b ("watchdog: softdog: fire watchdog even if softirqs do not get to run") commit 217f69743681 ("net: busy-poll: allow preemption in sk_busy_loop()") commit 3c53776e29f8 ("Mark HI and TASKLET softirq synchronous") But the latency problem still exists in real-life workloads, see the link below. The reverted commit intended to solve a live-lock scenario that can now be addressed with the NAPI threaded mode, introduced with commit 29863d41bb6e ("net: implement threaded-able napi poll loop support"), which is nowadays in a pretty stable status. While a complete solution to put softirq processing under nice resource control would be preferable, that has proven to be a very hard task. In the short term, remove the main pain point, and also simplify a bit the current softirq implementation. Signed-off-by: Paolo Abeni Signed-off-by: Thomas Gleixner Tested-by: Jason Xing Reviewed-by: Jakub Kicinski Reviewed-by: Eric Dumazet Reviewed-by: Sebastian Andrzej Siewior Cc: "Paul E. McKenney" Cc: Peter Zijlstra Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/netdev/305d7742212cbe98621b16be782b0562f1012cb6.camel@redhat.com Link: https://lore.kernel.org/r/57e66b364f1b6f09c9bc0316742c3b14f4ce83bd.1683526542.git.pabeni@redhat.com commit 47f64e7ef95a58e5c56f2ec62cbadbe868661149 Author: Arnd Bergmann Date: Thu Apr 20 23:36:04 2023 +0200 remoteproc: imx_dsp_rproc: use modern pm_ops Without CONFIG_PM, the driver warns about unused functions: drivers/remoteproc/imx_dsp_rproc.c:1210:12: error: 'imx_dsp_runtime_suspend' defined but not used [-Werror=unused-function] 1210 | static int imx_dsp_runtime_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/remoteproc/imx_dsp_rproc.c:1178:12: error: 'imx_dsp_runtime_resume' defined but not used [-Werror=unused-function] 1178 | static int imx_dsp_runtime_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~ Change the old SET_SYSTEM_SLEEP_PM_OPS()/SET_RUNTIME_PM_OPS() helpers to their modern replacements that avoid the warning, and remove the now unnecessary __maybe_unused annotations on the other PM helper functions. Signed-off-by: Arnd Bergmann Reviewed-by: Mukesh Ojha Reviewed-by: Iuliana Prodan Link: https://lore.kernel.org/r/20230420213610.2219080-1-arnd@kernel.org Signed-off-by: Mathieu Poirier commit 52ca331bb75661d3f9890f82a4ea9ee0e28df666 Author: Uwe Kleine-König Date: Thu May 4 21:44:53 2023 +0200 remoteproc: wkup_m3: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230504194453.1150368-19-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit 797c4a0d3103b1f9d58ff6f3d30090e4140d8cc5 Author: Uwe Kleine-König Date: Thu May 4 21:44:52 2023 +0200 remoteproc: stm32: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20230504194453.1150368-18-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit b8b87e8819f428385c95c3dcd8385113133d60c4 Author: Uwe Kleine-König Date: Thu May 4 21:44:51 2023 +0200 remoteproc: st: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Patrice Chotard Link: https://lore.kernel.org/r/20230504194453.1150368-17-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit d1d8d4428c5f6468fcae44581769f9043f331554 Author: Uwe Kleine-König Date: Thu May 4 21:44:50 2023 +0200 remoteproc: virtio: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230504194453.1150368-16-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit ed6118747552da0a918b416911d982db55598452 Author: Uwe Kleine-König Date: Thu May 4 21:44:49 2023 +0200 remoteproc: rcar: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230504194453.1150368-15-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit 07336df6696bac3a7049f31e972acaaaf05e3101 Author: Uwe Kleine-König Date: Thu May 4 21:44:48 2023 +0200 remoteproc: qcom_wcnss: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Caleb Connolly Link: https://lore.kernel.org/r/20230504194453.1150368-14-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit 63c4e0de00ca4af4d641bc19591210ad95b64dec Author: Uwe Kleine-König Date: Thu May 4 21:44:47 2023 +0200 remoteproc: qcom_q6v5_wcss: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Caleb Connolly Link: https://lore.kernel.org/r/20230504194453.1150368-13-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit 57c05a6f080eba7a91a2691daaac18a68e35d3fa Author: Uwe Kleine-König Date: Thu May 4 21:44:46 2023 +0200 remoteproc: qcom_q6v5_pas: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Caleb Connolly Link: https://lore.kernel.org/r/20230504194453.1150368-12-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit a5f813ee1058e53b5276e659aa95f7d706453d7e Author: Uwe Kleine-König Date: Thu May 4 21:44:45 2023 +0200 remoteproc: qcom_q6v5_mss: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Caleb Connolly Link: https://lore.kernel.org/r/20230504194453.1150368-11-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit 52c800940612dc7ece9257922b87905c949fa492 Author: Uwe Kleine-König Date: Thu May 4 21:44:44 2023 +0200 remoteproc: qcom_q6v5_adsp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Caleb Connolly Link: https://lore.kernel.org/r/20230504194453.1150368-10-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit d6b862fd2d255746d5d919229c2598681c3c019e Author: Uwe Kleine-König Date: Thu May 4 21:44:43 2023 +0200 remoteproc: pru: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230504194453.1150368-9-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit 141adf29c2d2ca64475efaffffd0590ad8395c13 Author: Uwe Kleine-König Date: Thu May 4 21:44:42 2023 +0200 remoteproc: omap: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230504194453.1150368-8-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit da84267b2cb16877a087d18bc5beb0d32e33a85e Author: Uwe Kleine-König Date: Thu May 4 21:44:41 2023 +0200 remoteproc: mtk_scp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20230504194453.1150368-7-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit ad12305938947ba93bc35dca6bd11d738f2e25c0 Author: Uwe Kleine-König Date: Thu May 4 21:44:40 2023 +0200 remoteproc: meson_mx_ao_arc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230504194453.1150368-6-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit fd811cce9b92635799ba5c6de657e4a53c68adf6 Author: Artur Weber Date: Mon May 1 21:55:24 2023 +0200 dt-bindings: arm: samsung: Add Samsung Galaxy Tab3 family boards Add the compatible strings for the Samsung Galaxy Tab 3 8.0 series of tablets. Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230501195525.6268-13-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit 41bf1a9f9fbdec5dd1ba69fe26157f42e44dcee4 Author: Artur Weber Date: Mon May 1 21:55:22 2023 +0200 ARM: dts: exynos: Re-introduce Exynos4212 DTSI Support for the Exynos4212 SoC was originally dropped as there were no boards using it. We will be adding a device that uses it, so add it back. This reverts commit bca9085e0ae93253bc93ce218c85ac7d7e7f1831. Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230501195525.6268-11-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit b4354b9761437ba136329e3f2ea1386e8d483e1c Author: Artur Weber Date: Mon May 1 21:55:21 2023 +0200 ARM: dts: exynos: Move common Exynos4x12 definitions to exynos4x12.dtsi In preparation for the re-introduction of the Exynos4212, move their shared definitions to a separate file. Rename the pinctrl definitions accordingly, and adapt the Exynos4412 DTSI to these changes. This reverts part of commit bca9085e0ae9 ("ARM: dts: exynos: remove Exynos4212 support (dead code)"). Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230501195525.6268-10-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit 514a935fd0d4d522a08257f5acbc5439174c7cf0 Author: Artur Weber Date: Mon May 1 21:55:16 2023 +0200 soc: samsung: exynos-pmu: Re-introduce Exynos4212 support Support for the Exynos4212 SoC was originally dropped as there were no boards using it. We will be adding a device that uses it, so add it back. This reverts commit c40610198f35e8264f9175dafe74db6288a07eda. Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230501195525.6268-5-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit 8a19d4a1508c62ff28ba427c3209cdb57379d325 Author: Artur Weber Date: Mon May 1 21:55:13 2023 +0200 dt-bindings: soc: samsung: exynos-pmu: add Exynos4212 compatible Support for the Exynos4212 SoC was originally dropped as there were no boards using it. We will be adding a device that uses it, so add back the relevant compatible. This reverts part of commit c40610198f35 ("soc: samsung: Remove Exynos4212 related dead code"). Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230501195525.6268-2-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit 10f19fdeb6a5bd52c0af897336e44e2d98a888bc Author: Uwe Kleine-König Date: Thu May 4 21:44:39 2023 +0200 remoteproc: keystone: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230504194453.1150368-5-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit 40b4ffe5e921a8db911a7e5ffe3ad8da86ac0dfd Author: Artur Weber Date: Mon May 1 21:55:18 2023 +0200 clk: samsung: Re-add support for Exynos4212 CPU clock Support for the Exynos4212 SoC was originally dropped as there were no boards using it. We will be adding a device that uses it, so add it back. This reverts commit c9194fb623b0158029a268376df09fe28a2a2b05. Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230501195525.6268-7-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit 48b359732e166d0f5d53649e21eac8d9343b8e13 Author: Artur Weber Date: Mon May 1 21:55:17 2023 +0200 clk: samsung: Add Exynos4212 compatible to CLKOUT driver Support for the Exynos4212 SoC was originally dropped as there were no boards using it. We will be adding a device that uses it, so add it back. This reverts commit d5cd103b06f9d766295d18798de484528eb120ea. Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230501195525.6268-6-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit 5b40732af063c3fa2085b247129f065276c4947c Author: Artur Weber Date: Mon May 1 21:55:14 2023 +0200 dt-bindings: clock: samsung,exynos: add Exynos4212 clock compatible Support for the Exynos4212 SoC was originally dropped as there were no boards using it. We will be adding a device that uses it, so add back the relevant compatible. Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230501195525.6268-3-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit 94ea6edd4926398a1d3fcedf4a1d218c7d80c873 Author: Uwe Kleine-König Date: Thu May 4 21:44:38 2023 +0200 remoteproc: imx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Iuliana Prodan Link: https://lore.kernel.org/r/20230504194453.1150368-4-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit 31c1a5b70475a7e3bed89903edec4ac1a68057c4 Author: Uwe Kleine-König Date: Thu May 4 21:44:37 2023 +0200 remoteproc: imx_dsp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Iuliana Prodan Link: https://lore.kernel.org/r/20230504194453.1150368-3-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit 5d886f9775676e8d681742b8073bc2f7ffdad68c Author: Uwe Kleine-König Date: Thu May 4 21:44:36 2023 +0200 remoteproc: da8xx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230504194453.1150368-2-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier commit 4e486a650162a20e5c3c7987715f8297c84c85f4 Author: Artur Weber Date: Mon May 1 21:55:15 2023 +0200 ARM: exynos: Re-introduce Exynos4212 support Support for the Exynos4212 SoC was originally dropped as there were no boards using it. We will be adding a device that uses it, so add back the relevant code. This reverts commit 9e43eca3c87476f75680f472ff3ebcd85f357b86. Signed-off-by: Artur Weber Link: https://lore.kernel.org/r/20230501195525.6268-4-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski commit 87bd401138161008fdb82fbca6e213af117bfeb9 Author: Aloka Dixit Date: Fri May 5 16:11:28 2023 +0300 wifi: ath11k: EMA beacon support Add new function ath11k_mac_setup_bcn_tmpl_ema() which invokes the new API provided by MAC80211 to retrieve EMA beacons. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit Co-developed-by: John Crispin Signed-off-by: John Crispin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230405221648.17950-8-quic_alokad@quicinc.com commit 335a92765d308dfe22826f5562cd4b4389b45e71 Author: Aloka Dixit Date: Fri May 5 16:11:28 2023 +0300 wifi: ath11k: MBSSID beacon support - Split ath11k_mac_setup_bcn_tmpl() to move the beacon retrieval and WMI command to a new function, ath11k_mac_setup_bcn_tmpl_legacy(). In the original function add checks to use the transmitting interface when MBSSID is enabled. - Set rsnie_present and wpaie_present fields for the non-transmitting interfaces when MBSSID is enabled. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit Co-developed-by: John Crispin Signed-off-by: John Crispin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230405221648.17950-7-quic_alokad@quicinc.com commit cb9bea773c85e372931cd7a177db4165adf29d95 Author: Aloka Dixit Date: Fri May 5 16:11:28 2023 +0300 wifi: ath11k: refactor vif parameter configurations Security parameters for each non-transmitting profile can be different when MBSSID is enabled and this information is included in the MBSSID element in the Beacon frame. Current implementation to set rsnie_present and wpaie_present does not parse this element hence it applies only to the transmitting interface. Move the code to a separate function to make additions for non-transmitting interfaces cleaner. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230405221648.17950-6-quic_alokad@quicinc.com commit c82dc33f252fd8883be66f2d0230af0fd734c683 Author: Aloka Dixit Date: Fri May 5 16:11:27 2023 +0300 wifi: ath11k: MBSSID parameter configuration in AP mode Include MBSSID parameters in WMI vdev up operation. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit Co-developed-by: John Crispin Signed-off-by: John Crispin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230405221648.17950-5-quic_alokad@quicinc.com commit cf604e72bc6e6db68c7fcaa8779b03ec14b8d2fa Author: Aloka Dixit Date: Fri May 5 16:11:27 2023 +0300 wifi: ath11k: rename MBSSID fields in wmi_vdev_up_cmd Rename trans_bssid to tx_vdev_bssid to make it similar to vdev_bssid. Rename profile_num to nontx_profile_cnt, and profile_idx to nontx_profile_idx which makes it clear that these store configurations related to MBSSID non-transmitting profiles. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230405221648.17950-4-quic_alokad@quicinc.com commit 5a81610acf66c4ad6e1a1fbd09f3f555fca863b1 Author: Aloka Dixit Date: Fri May 5 16:11:27 2023 +0300 wifi: ath11k: MBSSID configuration during vdev create/start Configure multiple BSSID flags and index of the transmitting interface in vdev create/start commands depending on the service bit WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit Co-developed-by: John Crispin Signed-off-by: John Crispin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230405221648.17950-3-quic_alokad@quicinc.com commit a08dbb04d7365a04d52882143cf196005bfc88c3 Author: Aloka Dixit Date: Fri May 5 16:11:27 2023 +0300 wifi: ath11k: driver settings for MBSSID and EMA Advertise the driver support for multiple BSSID (MBSSID) and enhanced multi-BSSID advertisements (EMA) by setting extended capabilities. Configure mbssid_max_interfaces and ema_max_profile_periodicity fields in structure wiphy which are used to advertise maximum number of interfaces and profile periodicity supported by the driver. Add new WMI fields to configure maximum vdev count supported for MBSSID and profile periodicity in case of EMA. Setting WMI_RSRC_CFG_FLAG2_CALC_NEXT_DTIM_COUNT_SET flag indicates that the firmware should track and update the DTIM counts for each non-transmitted profile. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit Co-developed-by: John Crispin Signed-off-by: John Crispin Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230405221648.17950-2-quic_alokad@quicinc.com commit 695df2f417d25202bdac9cde3c82d2acb6492b4d Author: Arnd Bergmann Date: Fri May 5 16:11:25 2023 +0300 wifi: ath: work around false-positive stringop-overread warning In a rare arm64 randconfig build, I got multiple warnings for ath11k and ath12k: In function 'ath11k_peer_assoc_h_ht', inlined from 'ath11k_peer_assoc_prepare' at drivers/net/wireless/ath/ath11k/mac.c:2665:2: drivers/net/wireless/ath/ath11k/mac.c:1709:13: error: 'ath11k_peer_assoc_h_ht_masked' reading 10 bytes from a region of size 0 [-Werror=stringop-overread] 1709 | if (ath11k_peer_assoc_h_ht_masked(ht_mcs_mask)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This happens whenever gcc-13 fails to inline one of the functions that take a fixed-length array argument but gets passed a pointer. Change these functions to all take a regular pointer argument instead. Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230417205447.1800912-1-arnd@kernel.org commit 5f2ea10a808aef0086ad46240fab0a3e7ae90e95 Author: Nikunj Kela Date: Sat May 6 11:24:28 2023 -0700 firmware: arm_scmi: Augment SMC/HVC to allow optional parameters This change adds support for passing shmem channel address as parameters in smc/hvc call. The address is split into 4KB-page and offset. This is useful when multiple scmi instances are using same smc-id and firmware needs to distinguish among the instances. Signed-off-by: Nikunj Kela Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20230506182428.25343-3-quic_nkela@quicinc.com Signed-off-by: Sudeep Holla commit 8f9d530cffc1c035974a320c51c67abfdddf01ac Author: Nikunj Kela Date: Sat May 6 11:24:27 2023 -0700 dt-bindings: firmware: arm,scmi: support for parameter in smc/hvc call Currently, smc/hvc calls are made with smc-id only. The parameters are all set to zeros. This change defines a new compatible string that can be used to pass shmem address(4KB-page, offset) as two parameters in SMC/HVC doorbell. This is useful when multiple scmi instances are used with common smc-id. Signed-off-by: Nikunj Kela Reviewed-by: Rob Herring Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20230506182428.25343-2-quic_nkela@quicinc.com Signed-off-by: Sudeep Holla commit 854f5cc5b7355ceebf2bdfed97ea8f3c5d47a0c3 Author: Paul E. McKenney Date: Fri Apr 28 16:47:07 2023 -0700 Further upgrade queue_work_on() comment The current queue_work_on() docbook comment says that the caller must ensure that the specified CPU can't go away, and further says that the penalty for failing to nail down the specified CPU is that the workqueue handler might find itself executing on some other CPU. This is true as far as it goes, but fails to note what happens if the specified CPU never was online. Therefore, further expand this comment to say that specifying a CPU that was never online will result in a splat. Signed-off-by: Paul E. McKenney Cc: Lai Jiangshan Cc: Tejun Heo Signed-off-by: Tejun Heo commit ff32fcca64437f679a2bf1c0a19d5def389a18e2 Merge: 79c87edd18ec4 ac9a78681b921 Author: Maxime Ripard Date: Tue May 9 15:03:40 2023 +0200 Merge drm/drm-next into drm-misc-next Start the 6.5 release cycle. Signed-off-by: Maxime Ripard commit 79c87edd18ec49f5b6fb40175bd1b1fea9398fdb Author: Maíra Canal Date: Mon May 8 11:10:39 2023 -0300 MAINTAINERS: Add Maira to VKMS maintainers I've been contributing to VKMS with improvements, reviews, testing and debugging. Therefore, add myself as a co-maintainer of the VKMS driver. Acked-by: Melissa Wen Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230508141038.327160-1-mairacanal@riseup.net commit f6b980646b93a8c585b4ed991b8a34e8fc6ef847 Author: Juergen Gross Date: Tue May 2 14:09:16 2023 +0200 x86/mtrr: Remove physical address size calculation The physical address width calculation in mtrr_bp_init() can easily be replaced with using the already available value x86_phys_bits from struct cpuinfo_x86. The same information source can be used in mtrr/cleanup.c, removing the need to pass that value on to mtrr_cleanup(). In print_mtrr_state() use x86_phys_bits instead of recalculating it from size_or_mask. Move setting of size_or_mask and size_and_mask into a dedicated new function in mtrr/generic.c, enabling to make those 2 variables static, as they are used in generic.c only now. Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Tested-by: Michael Kelley Link: https://lore.kernel.org/r/20230502120931.20719-2-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) commit da86eb9611840772a459693832e54c63cbcc040a Author: Borislav Petkov (AMD) Date: Mon May 8 12:44:28 2023 +0200 x86/coco: Get rid of accessor functions cc_vendor is __ro_after_init and thus can be used directly. No functional changes. Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230508121957.32341-1-bp@alien8.de commit 06ffe5b25eeded829d5b2dd93ba868f3c75720d6 Author: Hans de Goede Date: Sun Apr 30 18:58:07 2023 +0200 platform/x86: lenovo-yogabook: Rename lenovo-yogabook-wmi to lenovo-yogabook The lenovo-yogabook-wmi.c code now consists of both a platform and a WMI driver and it does not use WMI at all when used on the Android model. Rename the module from lenovo-yogabook-wmi to lenovo-yogabook to reflect this. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-20-hdegoede@redhat.com commit fc4f1d88bc6b1780b9c807fab0b79755e7996116 Author: Hans de Goede Date: Sun Apr 30 18:58:06 2023 +0200 platform/x86: lenovo-yogabook: Add keyboard backlight control to platform driver On the Android yb1-x90f/l models there is not ACPI method to control the keyboard backlight brightness. Instead the second PWM controller is exposed directly to the OS there. Add support for controlling keyboard backlight brightness on the Android model by using the PWM subsystem to directly control the PWM. The Android model also requires explicitly turning the backlight off on suspend, which on the Windows model was done automatically. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-19-hdegoede@redhat.com commit 6df1523fa0b7991ea9c8e2ef8f9a238b19309a5d Author: Hans de Goede Date: Sun Apr 30 18:58:05 2023 +0200 platform/x86: lenovo-yogabook: Add platform driver support The Lenovo Yoga Book 1 comes in 2 versions. Version 1: The yb1-x91f/l currently supported by lenovo-yogabook-wmi, which has a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. Version 2: The yb1-x90f/l which is the same hardware shipping with Android as factory OS. This version has a very different BIOS and ACPI tables which lack the WMI interface. Instead the x86-android-tablets.ko code which does devices instantiation for devices missing from ACPI on various x86 Android tablets will instantiate a platform device for the keyboard half touch-kbd/digitizer toggle functionality. This patch adds a platform driver to the lenovo-yogabook code which binds to the platform device instantiated by x86-android-tablets.ko offering touch-kbd/digitizer toggle functionality on the Android model. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-18-hdegoede@redhat.com commit 37b599ae3fc98bc471790b09915369bba49635dd Author: Hans de Goede Date: Sun Apr 30 18:58:04 2023 +0200 platform/x86: lenovo-yogabook: Add YB_KBD_BL_MAX define Add a define for the max brightness level instead of hardcoding this to 255 in multiple places. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-17-hdegoede@redhat.com commit 1c4a2e08a84effc7bd20fb68df3455c930ee175e Author: Hans de Goede Date: Sun Apr 30 18:58:03 2023 +0200 platform/x86: lenovo-yogabook: Group WMI specific code together Group WMI specific code together. Note this just moves a bunch of code-blocks around, not a single line is changed. This is a preparation patch for making lenovo-yogabook-wmi also work on the Android version of the Yoga Book 1 which does not have a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-16-hdegoede@redhat.com commit fe2d4d792e854de5c6efea5d9d036c07e11661d3 Author: Hans de Goede Date: Sun Apr 30 18:58:02 2023 +0200 platform/x86: lenovo-yogabook: Drop _wmi_ from remaining generic symbols Change the yogabook_wmi_ prefix of remaining generic (non WMI specific) symbols to yogabook_ . This is a preparation patch for making lenovo-yogabook-wmi also work on the Android version of the Yoga Book 1 which does not have a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-15-hdegoede@redhat.com commit 6555daf9a711c135cb718ce8baaf126232d9ff37 Author: Hans de Goede Date: Sun Apr 30 18:58:01 2023 +0200 platform/x86: lenovo-yogabook: Add a yogabook_toggle_digitizer_mode() helper function Add a yogabook_toggle_digitizer_mode() helper function. This is a preparation patch for making lenovo-yogabook-wmi also work on the Android version of the Yoga Book 1 which does not have a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-14-hdegoede@redhat.com commit f771ec85b626c3e30362841cbc7b82f398e64469 Author: Hans de Goede Date: Sun Apr 30 18:58:00 2023 +0200 platform/x86: lenovo-yogabook: Abstract kbd backlight setting Abstract kbd backlight setting. This is a preparation patch for making lenovo-yogabook-wmi also work on the Android version of the Yoga Book 1 which does not have a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-13-hdegoede@redhat.com commit 9acf236e95996f56e9d4d1d6e92008b86d4925b4 Author: Hans de Goede Date: Sun Apr 30 18:57:59 2023 +0200 platform/x86: lenovo-yogabook: Stop checking adev->power.state lenovo-yogabook-wmi: controls the power-state itself and stores this in data->flags so there is no need to poke inside ACPI device internals. This is a preparation patch for making lenovo-yogabook-wmi also work on the Android version of the Yoga Book 1 which does not have a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-12-hdegoede@redhat.com commit 01d126ff33c30f15f7984ead6ffdc4088051dc98 Author: Hans de Goede Date: Sun Apr 30 18:57:58 2023 +0200 platform/x86: lenovo-yogabook: Split probe() into generic and WMI specific parts Split probe() and remove() into generic and WMI specific parts. This is a preparation patch for making lenovo-yogabook-wmi also work on the Android version of the Yoga Book 1 which does not have a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-11-hdegoede@redhat.com commit 76d6778fb21ee5e86b1de102d12b6480fa4fad9e Author: Hans de Goede Date: Sun Apr 30 18:57:57 2023 +0200 platform/x86: lenovo-yogabook: Use PMIC LED driver for pen icon LED control Use the (new) PMIC LED driver for pen icon LED control instead of using custom WMI calls for this. This will also work on the Android version of the Lenovo Yoga Book 1, where there is no WMI interface for this. The dev_id of the lookup is set using dev_name() so that it will also work for both the Windows YB1 WMI-device as well as the Android YB1 platform-device. While at it also move the gpio_lookup to using dev_name() for the dev_id. Note this also removes the need to turn of the LED during suspend since the PMIC LED driver now already does that. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-10-hdegoede@redhat.com commit a6673cfc6b56a2dc41de416f5ea397943297b79a Author: Hans de Goede Date: Sun Apr 30 18:57:56 2023 +0200 platform/x86: lenovo-yogabook: Add dev local variable to probe() Add a "struct device *dev" local variable to probe(). This is a preparation patch for making lenovo-yogabook-wmi also work on the Android version of the Yoga Book 1 which does not have a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. While at it also move the dev_set_drvdata() call to the end of probe(). Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-9-hdegoede@redhat.com commit 55b809df481ad862ec6b2081c658bd8bfdeec157 Author: Hans de Goede Date: Sun Apr 30 18:57:55 2023 +0200 platform/x86: lenovo-yogabook: Store dev instead of wdev in drvdata struct Store a "struct device *dev" instead of a "struct wmi_device *wdev;" in the "struct yogabook_wmi" driver-data. This is a preparation patch for making lenovo-yogabook-wmi also work on the Android version of the Yoga Book 1 which does not have a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-8-hdegoede@redhat.com commit 2c437ed302d4ad47cf325a4367e535639f3f16f9 Author: Hans de Goede Date: Sun Apr 30 18:57:54 2023 +0200 platform/x86: lenovo-yogabook: Switch to DEFINE_SIMPLE_DEV_PM_OPS() Switch to DEFINE_SIMPLE_DEV_PM_OPS() so that the __maybe_unused can be dropped from the suspend/resume callbacks. While at it also drop the _wmi_ part from the callback names in preparation for making lenovo-yogabook-wmi also work on the Android version of the Yoga Book 1 which does not have a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-7-hdegoede@redhat.com commit 017ad809680c1e59d0b744ccd28e2e94899b4099 Author: Hans de Goede Date: Sun Apr 30 18:57:53 2023 +0200 platform/x86: lenovo-yogabook: Simplify gpio lookup table cleanup After the devm_gpiod_get("backside_hall_sw") call the gpio lookup table is no longer necessary. Remove it directly after this call instead using a devm reset-action for this. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-6-hdegoede@redhat.com commit 9e6380d6573181c555ca1b5019b08d19a9ee581c Author: Hans de Goede Date: Sun Apr 30 18:57:52 2023 +0200 platform/x86: lenovo-yogabook: Set default keyboard backligh brightness on probe() Set default keyboard backlight brightness on probe(), this fixes the backlight being off after a rmmod + modprobe. Fixes: c0549b72d99d ("platform/x86: lenovo-yogabook-wmi: Add driver for Lenovo Yoga Book") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-5-hdegoede@redhat.com commit 711bcc0cb34e96a60e88d7b0260862781de3e530 Author: Hans de Goede Date: Sun Apr 30 18:57:51 2023 +0200 platform/x86: lenovo-yogabook: Reprobe devices on remove() Ensure that both the keyboard touchscreen and the digitizer have their driver bound after remove(). Without this modprobing lenovo-yogabook-wmi after a rmmod fails because lenovo-yogabook-wmi defers probing until both devices have their driver bound. Fixes: c0549b72d99d ("platform/x86: lenovo-yogabook-wmi: Add driver for Lenovo Yoga Book") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-4-hdegoede@redhat.com commit 9148cd2eb4450a8e9c49c8a14201fb82f651128f Author: Hans de Goede Date: Sun Apr 30 18:57:50 2023 +0200 platform/x86: lenovo-yogabook: Fix work race on remove() When yogabook_wmi_remove() runs yogabook_wmi_work might still be running and using the devices which yogabook_wmi_remove() puts. To avoid this move to explicitly cancelling the work rather then using devm_work_autocancel(). This requires also making the yogabook_backside_hall_irq handler non devm managed, so that it cannot re-queue the work while yogabook_wmi_remove() runs. Fixes: c0549b72d99d ("platform/x86: lenovo-yogabook-wmi: Add driver for Lenovo Yoga Book") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230430165807.472798-3-hdegoede@redhat.com commit 6f37c034313701a0d5a4255ad4e7c38db2d50844 Author: Thomas Weißschuh Date: Sun May 7 22:45:36 2023 +0200 platform/x86: gigabyte-wmi: remove allowlist Having to maintain a per-system allowlist is burdensome and confusing for users, drop it. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20230325-gigabyte-wmi-unrestrict-v2-1-0a54bc8e70d2@weissschuh.net Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d7296af803337a0a5b8edb2dd78b23cf1f68d56f Author: Armin Wolf Date: Sun Apr 30 22:31:53 2023 +0200 platform/x86: dell-sysman: Improve instance detection The WMI driver core already knows how many WMI object instances are available, use this information instead of probing the WMI object manually. Compile-tested only. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20230430203153.5587-3-W_Armin@gmx.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 2a2b13ae50cf70e07b471301ff50299f31d81c1d Author: Armin Wolf Date: Sun Apr 30 22:31:52 2023 +0200 platform/x86: wmi: Allow retrieving the number of WMI object instances Currently, the WMI driver core knows how many instances of a given WMI object exist, but WMI drivers cannot access this information. At the same time, some current and upcoming WMI drivers want to have access to this information. Add wmi_instance_count() and wmidev_instance_count() to allow WMI drivers to get the number of WMI object instances. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20230430203153.5587-2-W_Armin@gmx.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 94e86ef1b801d213dfb8543633dec86abb1a457d Author: Grygorii Strashko Date: Mon May 8 12:33:59 2023 +0530 net: phy: dp83869: support mii mode when rgmii strap cfg is used The DP83869 PHY on TI's k3-am642-evm supports both MII and RGMII interfaces and is configured by default to use RGMII interface (strap). However, the board design allows switching dynamically to MII interface for testing purposes by applying different set of pinmuxes. To support switching to MII interface, update the DP83869 PHY driver to configure OP_MODE_DECODE.RGMII_MII_SEL(bit 5) properly when MII PHY interface mode is requested. Signed-off-by: Grygorii Strashko Signed-off-by: Siddharth Vadapalli Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230508070359.357474-1-s-vadapalli@ti.com Signed-off-by: Paolo Abeni commit 24f7b9a0650561cea1a20e54f8a55522cbff10ab Author: Hans de Goede Date: Fri May 5 22:59:01 2023 +0200 platform/x86: x86-android-tablets: Add support for extra buttons on Cyberbook T116 The Cyberbook T116 rugged tablet comes in both Windows and Android versions and even on the Android version the DSDT is mostly sane. This tablet has 2 extra general purpose buttons in the row with the power + volume-buttons, labeled P and F. Use the x86-android-tablets infra to create a gpio-button device for these 2 extra buttons. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230505205901.42649-2-hdegoede@redhat.com commit 6dc6c0c13d2caa5263289a95d99fcc41cfdb6962 Author: Hans de Goede Date: Fri May 5 22:59:00 2023 +0200 platform/x86: x86-android-tablets: Add support for more then 1 gpio_key Modify the gpio_keys support in x86_android_tablet_init() for tablets which have more then 1 key/button which needs to be handled by the gpio_keys driver. This requires copying over the struct gpio_keys_button from the x86_gpio_button struct array to a new gpio_keys_button struct array, as an added benefit this allows marking the per model x86_gpio_button arrays __initconst so that they all can be freed after module init(). Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230505205901.42649-1-hdegoede@redhat.com commit fbc29478aa60662711679a8b0b56962b35db8df6 Author: Hans de Goede Date: Sat Apr 29 20:02:30 2023 +0200 platform/x86: x86-android-tablets: Add Lenovo Yoga Book lid switch Add x86_gpio_button info for the yb1-x90f/l describing the lid switch on the Lenovo Yoga Book Android models. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230429180230.97716-2-hdegoede@redhat.com commit d190a7786eafe17670c3a63326a8f97a4497449e Author: Hans de Goede Date: Sat Apr 29 20:02:29 2023 +0200 platform/x86: x86-android-tablets: Fix Bluetooth on Lenovo Yoga Book The Lenovo Yoga Book yb1-x90f/l has (another) bug in its DSDT where the UART resource for the BTH0 ACPI device contains "\\_SB.PCIO.URT1" as path to the UART. Note that is with a letter 'O' instead of the number '0' which is wrong. Add a x86_serdev_info entry to make the x86-android-tablets module manually setup the /sys/bus/serial device for the Bluetooth UART to fix Bluetooth not working due to this bug. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230429180230.97716-1-hdegoede@redhat.com commit c91050661032ef91a359d537d2b99a211ee6bd10 Author: Hans de Goede Date: Sat Apr 29 12:50:57 2023 +0200 platform/x86: x86-android-tablets: Add Nextbook Ares 8A data The Nextbook Ares 8A is a x86 ACPI tablet which ships with Android x86 as factory OS. Its DSDT contains a bunch of I2C devices which are not actually there, causing various resource conflicts. Enumeration of these is skipped through the acpi_quirk_skip_i2c_client_enumeration(). Add support for manually instantiating the I2C devices which are actually present on this tablet by adding the necessary device info to the x86-android-tablets module. Note the Ares 8A is the Cherry Trail (CHT) model, the regular Ares 8 is Bay Trail (BYT) based and was already supported. This also updates the comments for the BYT model to point out this is the BYT model. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230429105057.7697-3-hdegoede@redhat.com commit 392442bcd2f900427389a0ffe273f9704441e30c Author: Hans de Goede Date: Sat Apr 29 12:50:56 2023 +0200 platform/x86: x86-android-tablets: Remove unnecessary invalid_aei_gpiochip settings Since commit 5adc409340b1 ("ACPI: x86: Introduce an acpi_quirk_skip_gpio_event_handlers() helper") the ACPI GPIO code will not register any GPIO event handlers at all for devices which have the ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS set in their DMI table entry in drivers/acpi/x86/utils.c . This includes the Nextbook Ares 8 and the Asus ME176C and TF103C models, so x86-android-tablets no longer needs to disable the GPIO event handlers on these, since they have never been registered at all. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230429105057.7697-2-hdegoede@redhat.com commit d2beb6f22fb08587015a16e25ccceeae6bd719d9 Author: Hans de Goede Date: Sat Apr 29 12:50:55 2023 +0200 platform/x86: x86-android-tablets: Add ALS sensor support for Yoga Tablet 2 1050/830 series The Yoga Tablet 2 1050/830 series have an AL3320A ambient light sensor, add this to the list of i2c_clients to instantiate on these models. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230429105057.7697-1-hdegoede@redhat.com commit f4a31a428d0d2fcd52e874b3e63c52de5839bfa0 Author: Jonathan Singer Date: Wed Apr 26 14:48:54 2023 -0400 platform/x86: hp-wmi: Add HP Envy special key support Previously, some support for certain keys on the HP keyboard has been added already in commit 3ee5447b2048 ("platform/x86: hp-wmi: Handle Omen Key event"), however this as tested did not allow even the fn+esc key on my HP Envy which uses the same keycode on my HP Envy x360 laptop to work --the keycode rather than being passed in as a separate int from WMI, was being passed in as the event_data for the HPWMI_OMEN_KEY event. This patch, as tested was able to properly get the keycode for fn+esc, and for fn+f12 which is supposed to be a programmable key according to HP's keyboard diagram and is thus mapped to KEY_PROG2. The fn+f8 key combination (mute microphone) was a standard HPWMI_BEZEL_BUTTON key, however it did not previously have an entry in the sparse keymap. This patch preserves the original HPWMI_OMEN_KEY behavior for laptops that use it by only taking the keycode from the event_data only when the event_data is nonzero. Signed-off-by: Jonathan Singer Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20230426184852.2100-2-jes965@nyu.edu Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 604915f1c7b22a9c6ecbd6e16b092cdd5981f21e Author: Jonathan Singer Date: Wed Apr 26 14:48:52 2023 -0400 platform/x86: hp-wmi: Add HP WMI camera switch Previously, when the camera toggle switch was hit, the hp-wmi driver would report an invalid event code. By adding a case for that in the event handling switch statement we can eliminate that error code and enable a framework for potential further kernel handling of that key. This change was tested on my HP Envy x360 15-ey0023dx laptop, but it would likely work for any HP laptop with a camera toggle button. Now we emit an SW_CAMERA_LENS_COVER event, on a device that gets created on the first such event so as to not report incorrectly the state of the camera shutter before we can know its state. Signed-off-by: Jonathan Singer Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20230426184852.2100-1-jes965@nyu.edu Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 01c10f88c9b7ab5767922531167f933cac32e9e9 Author: Srinivas Pandruvada Date: Tue Apr 18 10:13:40 2023 -0700 platform/x86/intel-uncore-freq: tpmi: Provide cluster level control The new generation of CPUs have granular control at a cluster level. Each package/die can have multiple power domains, which further can have multiple fabric clusters. The TPMI interface allows control at fabric cluster level. Use the updated uncore sysfs feature to expose controls at cluster level. At each cluster level there is a control for maximum and minimum uncore frequency. Also present current uncore frequency at a cluster level. Signed-off-by: Srinivas Pandruvada Reviewed-by: Zhang Rui Tested-by: Wendy Wang Link: https://lore.kernel.org/r/20230418171340.681662-4-srinivas.pandruvada@linux.intel.com Signed-off-by: Hans de Goede commit 9b8dea80e3cb22e1fed4f974841116e10a3dbb35 Author: Srinivas Pandruvada Date: Tue Apr 18 10:13:39 2023 -0700 platform/x86/intel-uncore-freq: Support for cluster level controls An SoC can contain multiple power domains with individual or collection of mesh partitions. This partition is called fabric cluster. Certain type of meshes will need to run at the same frequency, they will be placed in the same fabric cluster. Benefit of fabric cluster is that it offers a scalable mechanism to deal with partitioned fabrics in a SoC. The current sysfs interface supports control at package and die level. This interface is not enough to support more granular control at fabric cluster level. SoCs with the support of TPMI (Topology Aware Register and PM Capsule Interface), can have multiple power domains. Each power domain can contain one or more fabric clusters. To support such granular controls, enhance uncore common to optionally create new directories to provide controls at fabric cluster level. It is also important to have flexibility to change granularity for future version of SoCs. If the directory name contains scope like: "package_*_die_*_power_domain_*_cluster_*", then this is not expandable. The cpufreq policies also have different scopes. There the scope of the policy (affected_cpus) specified by attributes inside each policy. So, follow the same model for uncore frequency scaling sysfs as: "sys/devices/system/cpu/cpufreq/policy*" Allow client drivers to optionally support granular control for each fabric cluster. Here, the directory name will be "uncore" suffixed with an unique instance number. For example: uncore00, uncore01 etc. Attributes in the directory identify package id, power domain and fabric cluster id. This interface is expandable even if some new level of granularity is introduced. A new sysfs attribute can identify new level. For compatibility with the existing sysfs and provide easy way to set limits for each fabric cluster in the package/die, the existing control at package/die levels are still provided. For majority of users, this is an easy approach. For example: On a single package/die system, with three power domains and one fabric cluster per power domain: $tree -L 2 /sys/devices/system/cpu/intel_uncore_frequency/ /sys/devices/system/cpu/intel_uncore_frequency/ ├── package_00_die_00 │   ├── current_freq_khz │   ├── initial_max_freq_khz │   ├── initial_min_freq_khz │   ├── max_freq_khz │   └── min_freq_khz ├── uncore00 │   ├── current_freq_khz │   ├── domain_id │   ├── fabric_cluster_id │   ├── initial_max_freq_khz │   ├── initial_min_freq_khz │   ├── max_freq_khz │   ├── min_freq_khz │   └── package_id ├── uncore01 │   ├── current_freq_khz │   ├── domain_id │   ├── fabric_cluster_id │   ├── initial_max_freq_khz │   ├── initial_min_freq_khz │   ├── max_freq_khz │   ├── min_freq_khz │   └── package_id └── uncore02 ├── current_freq_khz ├── domain_id ├── fabric_cluster_id ├── initial_max_freq_khz ├── initial_min_freq_khz ├── max_freq_khz ├── min_freq_khz └── package_id The attribute for cluster id is "fabric_cluster_id" instead of just "cluster_id" is to avoid confusion with usage of term clusters in other part of the Linux kernel. Signed-off-by: Srinivas Pandruvada Reviewed-by: Zhang Rui Tested-by: Wendy Wang Link: https://lore.kernel.org/r/20230418171340.681662-3-srinivas.pandruvada@linux.intel.com Signed-off-by: Hans de Goede commit 8a54e2253e4c25e5b61c9a9bee157bb52da5d432 Author: Srinivas Pandruvada Date: Thu Apr 20 15:05:14 2023 -0700 platform/x86/intel-uncore-freq: Uncore frequency control via TPMI Implement support of uncore frequency control via TPMI (Topology Aware Register and PM Capsule Interface). This driver provides the similar functionality as the current uncore frequency driver using MSRs. The hardware interface to read/write is basically substitution of MSR 0x620 and 0x621. There are specific MMIO offset and bits to get/set minimum and maximum uncore ratio, similar to MSRs. The scope of the uncore MSRs is package/die. But new generation of CPUs have more granular control at a cluster level. Each package/die can have multiple power domains, which further can have multiple clusters. The TPMI interface allows control at cluster level. The primary use case for uncore sysfs is to set maximum and minimum uncore frequency to reduce power consumption or latency. The current uncore sysfs control is per package/die. This is enough for the majority of users as workload will move to different power domains as it moves between different CPUs. The current uncore sysfs provides controls at package/die level. When user sets maximum/minimum limits, the driver sets the same limits to each cluster. Here number of power domains = number of resources in this aux device. There are offsets and bits to discover number of clusters and offset for each cluster level controls. The TPMI documentation can be downloaded from: https://github.com/intel/tpmi_power_management Signed-off-by: Srinivas Pandruvada Reviewed-by: Zhang Rui Tested-by: Wendy Wang Link: https://lore.kernel.org/r/20230420220514.747573-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 334e3516f23360e0690511fb43052959111f51b4 Author: Armin Wolf Date: Mon May 8 22:42:41 2023 +0200 platform/x86: dell-ddv: Update ABI documentation Synchronize the ABI documentation with the driver documentation and direct users to the latter in case the search for more detailed information. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20230508204241.11076-2-W_Armin@gmx.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit b64c1a157d78f8e74fce96f7a14ee7084d8bbbce Author: Armin Wolf Date: Mon May 8 22:42:40 2023 +0200 platform/x86: dell-ddv: Add documentation The WMI interface used by the dell-wmi-ddv driver contains many methods which are currently unused, making it difficult to document these inside the drivers source code. Create the necessary documentation based on current knowledge so that all details of the WMI interface can be written down for later use. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20230508204241.11076-1-W_Armin@gmx.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit bf4f93c4ca4b6f41e81e83131cf9458d27cf62ee Author: Armin Wolf Date: Tue Apr 25 00:29:39 2023 +0200 platform/x86: wmi: Add device specific documentation Add a place for device-specific documentation of WMI drivers. The first entry is documentation for the wmi-bmof driver, with additional documentation being expected to follow. Signed-off-by: Armin Wolf Tested-by: Randy Dunlap Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20230424222939.208137-5-W_Armin@gmx.de Signed-off-by: Hans de Goede commit e8f8b448c168d7f2f93c9586cf789dee5d61182d Author: Armin Wolf Date: Tue Apr 25 00:29:38 2023 +0200 platform/x86: wmi: Add documentation Add documentation for the WMI subsystem. The documentation describes both the ACPI WMI interface and the driver API for interacting with the WMI driver core. The information regarding the ACPI interface was retrieved from the Ubuntu kernel references and the Windows driver samples available on GitHub. The documentation is supposed to help driver developers writing WMI drivers, as many modern machines designed to run Windows provide an ACPI WMI interface. Signed-off-by: Armin Wolf Tested-by: Randy Dunlap Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20230424222939.208137-4-W_Armin@gmx.de Signed-off-by: Hans de Goede commit d54bd4bc7b9ae9505f53440894b8c239c521f3da Author: Armin Wolf Date: Tue Apr 25 00:29:37 2023 +0200 platform/x86: wmi: Mark GUID-based WMI interface as deprecated The WMI driver core supports a more mordern bus-based interface for interacting with WMI devices. The older GUID-based interface depends on each WMI GUID and notification id being unique on a given system, which turned out is not the case. Mark the older interface as deprecated since new WMI drivers should use the bus-based interface to avoid this issues. Signed-off-by: Armin Wolf Tested-by: Randy Dunlap Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20230424222939.208137-3-W_Armin@gmx.de Signed-off-by: Hans de Goede commit b4cc979588ee94b179e28c6f3f5c2d6197ea6461 Author: Armin Wolf Date: Tue Apr 25 00:29:36 2023 +0200 platform/x86: wmi: Add kernel doc comments Add kernel doc comments useful for documenting the functions/structs used to interact with the WMI driver core. Signed-off-by: Armin Wolf Tested-by: Randy Dunlap Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20230424222939.208137-2-W_Armin@gmx.de Signed-off-by: Hans de Goede commit 5d32cead772c3d074947cb7277dea7532133037b Author: Marek Vasut Date: Sun May 7 15:01:20 2023 +0200 pinctrl: renesas: Fix spaces followed by tabs Perform 's@ \t@\t\t@g' so we wouldn't have spaces followed by tabs. No functional change. Picked from U-Boot commit 0cf207ec01c ("WS cleanup: remove SPACE(s) followed by TAB") Signed-off-by: Marek Vasut Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230507130120.7587-1-marek.vasut+renesas@mailbox.org Signed-off-by: Geert Uytterhoeven commit 3312bb4ad09ca6423bd4a5b15a94588a8962fb8e Author: Jani Nikula Date: Thu May 4 13:35:08 2023 +0300 drm/i915: taint kernel when force probing unsupported devices For development and testing purposes, the i915.force_probe module parameter and DRM_I915_FORCE_PROBE kconfig option allow probing of devices that aren't supported by the driver. The i915.force_probe module parameter is "unsafe" and setting it taints the kernel. However, using the kconfig option does not. Always taint the kernel when force probing a device that is not supported. v2: Drop "depends on EXPERT" to avoid build breakage (kernel test robot) Fixes: 7ef5ef5cdead ("drm/i915: add force_probe module parameter to replace alpha_support") Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: Daniel Vetter Cc: Dave Airlie Acked-by: Daniel Vetter Reviewed-by: Rodrigo Vivi Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230504103508.1818540-1-jani.nikula@intel.com commit 850d174696c3542cd39ca196bc7ade1ba7ceddf7 Merge: 7f5d6036ca005 5a7bec81bd229 Author: Mark Brown Date: Tue May 9 18:31:38 2023 +0900 ASoC: add and use asoc_dummy_dlc Merge series from Kuninori Morimoto : Many ASoC drivers are using dummy DAI. I have 2 concern about it. 1st one is there is no guarantee that local strings ("snd-soc-dummy-dai", "snd-soc-dummy") are kept until the card was binded if it was added at subfunction. 2nd one is we can use common snd_soc_dai_link_component for it. This patch-set adds common asoc_dummy_dlc, and use it. commit 6fa9df2b5e563674e0b22d740e27b0df8960ba1c Author: Jani Nikula Date: Thu May 4 15:34:44 2023 +0300 drm/connector: document enum drm_connector_tv_mode DRM_MODE_TV_MODE_MAX Add documentation for the DRM_MODE_TV_MODE_MAX enumerator to fix the kernel-doc warning: include/drm/drm_connector.h:204: warning: Enum value 'DRM_MODE_TV_MODE_MAX' not described in enum 'drm_connector_tv_mode' Signed-off-by: Jani Nikula Reviewed-by: Simon Ser Link: https://patchwork.freedesktop.org/patch/msgid/20230504123444.1843795-1-jani.nikula@intel.com commit c2258a94fae556797085b58c0b6839c41826bd3d Author: Krzysztof Kozlowski Date: Sat Apr 22 00:32:10 2023 +0200 arm64: dts: amlogic: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified properties to fix warnings like: meson-a1-ad401.dtb: l2-cache0: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230421223211.115612-1-krzysztof.kozlowski@linaro.org Signed-off-by: Neil Armstrong commit d542ce8d4769cdef6a7bc3437e59cfed9c68f0e4 Author: hfdevel@gmx.net Date: Fri Apr 7 16:36:25 2023 +0200 ARM: dts: meson8b: correct uart_B and uart_C clock references With the current device tree for meson8b, uarts B (e.g. available on pins 8/10 on Odroid-C1) and C (pins 3/5 on Odroid-C1) do not work, because they are relying on incorrect clocks. Change the references of pclk to the correct CLKID, to allow use of the two uarts. Fixes: 3375aa77135f ("ARM: dts: meson8b: Fix the UART device-tree schema validation") Signed-off-by: Hans-Frieder Vogt Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/trinity-bf20bcb9-790b-4ab9-99e3-0831ef8257f4-1680878185420@3c-app-gmx-bap55 Signed-off-by: Neil Armstrong commit cb3f4e8cacfa7b32ed8b9dff1282c0d4aaf42e88 Author: Kelvin Zhang Date: Fri Apr 7 18:27:04 2023 +0800 dt-bindings: arm: amlogic: add C3 bindings Document the new C3 SoC/board device tree bindings. C3 is an advanced edge AI processor designed for smart IP camera applications, which does not belong to Meson series. Therefore, modify the title field accordingly. Signed-off-by: Kelvin Zhang Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230407102704.1055152-1-kelvin.zhang@amlogic.com Signed-off-by: Neil Armstrong commit 7f5d6036ca0059f749414380e19bfc346961353c Author: Jack Yu Date: Fri Apr 21 11:01:16 2023 +0800 ASoC: rt722-sdca: Add RT722 SDCA driver This is the initial codec driver for rt722-sdca. Signed-off-by: Jack Yu Date: Tue May 9 15:34:56 2023 +0900 ASoC: MediaTek MT8195/86 Cleanups Merge series from AngeloGioacchino Del Regno : This series performs some cleanups for mainly MT8195 and switches both MT8195 and MT8186's SOF driver to the snd_sof_ipc_process_reply() helper. commit cf27b7d9a574f3383be0ed1953cceda9a715eb51 Merge: f050e56de8059 7b0518fbf2bef Author: Mark Brown Date: Tue May 9 15:22:50 2023 +0900 regulator: Add support for TPS6287x Merge series from Mårten Lindahl : This series adds basic support for TI's TPS62870/TPS62871/TPS62872/ TPS62873 high-frequency single-channel step-down converters with an I2C interface. The devices can operate in power save mode for maximum efficiency, or forced-PWM mode for best transient performance and lowest output voltage ripple. All chip variants have four output voltage ranges and the driver changes active range depending on the requested voltage setting. There are differences in the electrical characteristics and packaging between the variants, but the register interfaces are identical. commit f050e56de80591fee55bedbdf5b6b998c740cd0c Author: Krzysztof Kozlowski Date: Sun May 7 16:46:56 2023 +0200 regulator: tps65219: Fix matching interrupts for their regulators The driver's probe() first registers regulators in a loop and then in a second loop passes them as irq data to the interrupt handlers. However the function to get the regulator for given name tps65219_get_rdev_by_name() was a no-op due to argument passed by value, not pointer, thus the second loop assigned always same value - from previous loop. The interrupts, when fired, where executed with wrong data. Compiler also noticed it: drivers/regulator/tps65219-regulator.c: In function ‘tps65219_get_rdev_by_name’: drivers/regulator/tps65219-regulator.c:292:60: error: parameter ‘dev’ set but not used [-Werror=unused-but-set-parameter] Fixes: c12ac5fc3e0a ("regulator: drivers: Add TI TPS65219 PMIC regulators support") Cc: Date: Mon May 8 15:14:08 2023 +0200 regulator: Add support for TI TPS6287x regulators Add support for Texas Instruments TPS6287x, single-channel synchronous step-down converters with four output voltage ranges. Signed-off-by: Mårten Lindahl Date: Mon May 8 15:14:07 2023 +0200 regulator: dt-bindings: Add bindings for TPS6287x Add bindings for the TPS62870/TPS62871/TPS62872/TPS62873 voltage regulators. Signed-off-by: Mårten Lindahl Date: Mon May 8 13:52:28 2023 -1000 wifi: iwlwifi: Use default @max_active for trans_pcie->rba.alloc_wq trans_pcie->rba.alloc_wq only hosts a single work item and thus doesn't need explicit concurrency limit. Let's use the default @max_active. This doesn't cost anything and clearly expresses that @max_active doesn't matter. Signed-off-by: Tejun Heo Acked-by: Johannes Berg Cc: Kalle Valo Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Gregory Greenman Cc: Avraham Stern Cc: Kees Cook Cc: Mordechay Goodstein Cc: "Haim, Dreyfuss" Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org commit 715557b02c08222066ee677c0f22e7ff59a1112a Author: Tejun Heo Date: Mon May 8 13:52:28 2023 -1000 xen/pvcalls: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Acked-by: Juergen Gross Cc: Stefano Stabellini Cc: Oleksandr Tyshchenko Cc: xen-devel@lists.xenproject.org commit 255c1273c2d43d494f32033283bfa1c7b285e654 Author: Tejun Heo Date: Mon May 8 13:52:28 2023 -1000 virt: acrn: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Acked-by: Greg Kroah-Hartman Cc: Fei Li commit 289f97467480266f9bd8cac7f1e05a478d523f79 Author: Tejun Heo Date: Mon May 8 13:52:28 2023 -1000 net: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Reviewed-by: Sunil Goutham Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Ratheesh Kannoth Cc: Srujana Challa Cc: Geetha sowjanya Cc: netdev@vger.kernel.org commit 25c8c0d91ddb688f37e5f30a5342740b5a78e1cf Author: Tejun Heo Date: Mon May 8 13:52:27 2023 -1000 net: thunderx: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Reviewed-by: Sunil Goutham Acked-by: Jakub Kicinski Cc: "David S. Miller" Cc: Eric Dumazet Cc: Paolo Abeni Cc: linux-arm-kernel@lists.infradead.org Cc: netdev@vger.kernel.org commit 44d69dd9ada17147141c8aa692f044d20bf20107 Author: Tejun Heo Date: Mon May 8 13:52:27 2023 -1000 greybus: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Acked-by: Greg Kroah-Hartman Acked-by: Johan Hovold Acked-by: Alex Elder Cc: greybus-dev@lists.linaro.org commit bd545224663399435a395b8a4ff2fd4b67892ffa Author: Tejun Heo Date: Mon May 8 13:52:27 2023 -1000 powerpc, workqueue: Use alloc_ordered_workqueue() to create ordered workqueues BACKGROUND ========== When multiple work items are queued to a workqueue, their execution order doesn't match the queueing order. They may get executed in any order and simultaneously. When fully serialized execution - one by one in the queueing order - is needed, an ordered workqueue should be used which can be created with alloc_ordered_workqueue(). However, alloc_ordered_workqueue() was a later addition. Before it, an ordered workqueue could be obtained by creating an UNBOUND workqueue with @max_active==1. This originally was an implementation side-effect which was broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered"). Because there were users that depended on the ordered execution, 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") made workqueue allocation path to implicitly promote UNBOUND workqueues w/ @max_active==1 to ordered workqueues. While this has worked okay, overloading the UNBOUND allocation interface this way creates other issues. It's difficult to tell whether a given workqueue actually needs to be ordered and users that legitimately want a min concurrency level wq unexpectedly gets an ordered one instead. With planned UNBOUND workqueue updates to improve execution locality and more prevalence of chiplet designs which can benefit from such improvements, this isn't a state we wanna be in forever. This patch series audits all callsites that create an UNBOUND workqueue w/ @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. WHAT TO LOOK FOR ================ The conversions are from alloc_workqueue(WQ_UNBOUND | flags, 1, args..) to alloc_ordered_workqueue(flags, args...) which don't cause any functional changes. If you know that fully ordered execution is not ncessary, please let me know. I'll drop the conversion and instead add a comment noting the fact to reduce confusion while conversion is in progress. If you aren't fully sure, it's completely fine to let the conversion through. The behavior will stay exactly the same and we can always reconsider later. As there are follow-up workqueue core changes, I'd really appreciate if the patch can be routed through the workqueue tree w/ your acks. Thanks. Signed-off-by: Tejun Heo Acked-by: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Nathan Lynch Cc: linuxppc-dev@lists.ozlabs.org commit 2ef269ef1ac006acf974793d975539244d77b28f Author: Dietmar Eggemann Date: Mon May 8 09:58:54 2023 +0200 cgroup/cpuset: Free DL BW in case can_attach() fails cpuset_can_attach() can fail. Postpone DL BW allocation until all tasks have been checked. DL BW is not allocated per-task but as a sum over all DL tasks migrating. If multiple controllers are attached to the cgroup next to the cpuset controller a non-cpuset can_attach() can fail. In this case free DL BW in cpuset_cancel_attach(). Finally, update cpuset DL task count (nr_deadline_tasks) only in cpuset_attach(). Suggested-by: Waiman Long Signed-off-by: Dietmar Eggemann Signed-off-by: Juri Lelli Reviewed-by: Waiman Long Signed-off-by: Tejun Heo commit 85989106feb734437e2d598b639991b9185a43a6 Author: Dietmar Eggemann Date: Mon May 8 09:58:53 2023 +0200 sched/deadline: Create DL BW alloc, free & check overflow interface While moving a set of tasks between exclusive cpusets, cpuset_can_attach() -> task_can_attach() calls dl_cpu_busy(..., p) for DL BW overflow checking and per-task DL BW allocation on the destination root_domain for the DL tasks in this set. This approach has the issue of not freeing already allocated DL BW in the following error cases: (1) The set of tasks includes multiple DL tasks and DL BW overflow checking fails for one of the subsequent DL tasks. (2) Another controller next to the cpuset controller which is attached to the same cgroup fails in its can_attach(). To address this problem rework dl_cpu_busy(): (1) Split it into dl_bw_check_overflow() & dl_bw_alloc() and add a dedicated dl_bw_free(). (2) dl_bw_alloc() & dl_bw_free() take a `u64 dl_bw` parameter instead of a `struct task_struct *p` used in dl_cpu_busy(). This allows to allocate DL BW for a set of tasks too rather than only for a single task. Signed-off-by: Dietmar Eggemann Signed-off-by: Juri Lelli Signed-off-by: Tejun Heo commit c0f78fd5edcf29b2822ac165f9248a6c165e8554 Author: Juri Lelli Date: Mon May 8 09:58:52 2023 +0200 cgroup/cpuset: Iterate only if DEADLINE tasks are present update_tasks_root_domain currently iterates over all tasks even if no DEADLINE task is present on the cpuset/root domain for which bandwidth accounting is being rebuilt. This has been reported to introduce 10+ ms delays on suspend-resume operations. Skip the costly iteration for cpusets that don't contain DEADLINE tasks. Reported-by: Qais Yousef Link: https://lore.kernel.org/lkml/20230206221428.2125324-1-qyousef@layalina.io/ Signed-off-by: Juri Lelli Reviewed-by: Waiman Long Signed-off-by: Tejun Heo commit 6c24849f5515e4966d94fa5279bdff4acf2e9489 Author: Juri Lelli Date: Mon May 8 09:58:51 2023 +0200 sched/cpuset: Keep track of SCHED_DEADLINE task in cpusets Qais reported that iterating over all tasks when rebuilding root domains for finding out which ones are DEADLINE and need their bandwidth correctly restored on such root domains can be a costly operation (10+ ms delays on suspend-resume). To fix the problem keep track of the number of DEADLINE tasks belonging to each cpuset and then use this information (followup patch) to only perform the above iteration if DEADLINE tasks are actually present in the cpuset for which a corresponding root domain is being rebuilt. Reported-by: Qais Yousef Link: https://lore.kernel.org/lkml/20230206221428.2125324-1-qyousef@layalina.io/ Signed-off-by: Juri Lelli Reviewed-by: Waiman Long Signed-off-by: Tejun Heo commit 111cd11bbc54850f24191c52ff217da88a5e639b Author: Juri Lelli Date: Mon May 8 09:58:50 2023 +0200 sched/cpuset: Bring back cpuset_mutex Turns out percpu_cpuset_rwsem - commit 1243dc518c9d ("cgroup/cpuset: Convert cpuset_mutex to percpu_rwsem") - wasn't such a brilliant idea, as it has been reported to cause slowdowns in workloads that need to change cpuset configuration frequently and it is also not implementing priority inheritance (which causes troubles with realtime workloads). Convert percpu_cpuset_rwsem back to regular cpuset_mutex. Also grab it only for SCHED_DEADLINE tasks (other policies don't care about stable cpusets anyway). Signed-off-by: Juri Lelli Reviewed-by: Waiman Long Signed-off-by: Tejun Heo commit ad3a557daf6915296a43ef97a3e9c48e076c9dd8 Author: Juri Lelli Date: Mon May 8 09:58:49 2023 +0200 cgroup/cpuset: Rename functions dealing with DEADLINE accounting rebuild_root_domains() and update_tasks_root_domain() have neutral names, but actually deal with DEADLINE bandwidth accounting. Rename them to use 'dl_' prefix so that intent is more clear. No functional change. Suggested-by: Qais Yousef Signed-off-by: Juri Lelli Reviewed-by: Waiman Long Signed-off-by: Tejun Heo commit c52df19e3759055cf07d1c0030c46ea958163aa9 Author: Paul Moore Date: Fri May 5 18:49:44 2023 -0400 selinux: small cleanups in selinux_audit_rule_init() A few small tweaks to selinux_audit_rule_init(): - Adjust how we use the @rc variable so we are not doing any extra work in the common/success case. - Related to the above, rework the 'out' jump label so that the success and error paths are different, simplifying both. - Cleanup some of the vertical whitespace while we are making the other changes. Signed-off-by: Paul Moore commit 4158cb600006371f4359f6ef23a0f1a7255e8843 Author: Christian Göttsche Date: Thu Apr 20 17:05:03 2023 +0200 selinux: declare read-only data arrays const The array of mount tokens in only used in match_opt_prefix() and never modified. The array of symtab names is never modified and only used in the DEBUG_HASHES configuration as output. The array of files for the SElinux filesystem sub-directory `ss` is similar to the other `struct tree_descr` usages only read from to construct the containing entries. Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 4595ae8c4a10a005a24c0994b710c9575f5b46b9 Author: Christian Göttsche Date: Thu Apr 20 17:05:02 2023 +0200 selinux: retain const qualifier on string literal in avtab_hash_eval() The second parameter `tag` of avtab_hash_eval() is only used for printing. In policydb_index() it is called with a string literal: avtab_hash_eval(&p->te_avtab, "rules"); Signed-off-by: Christian Göttsche [PM: slight formatting tweak in description] Signed-off-by: Paul Moore commit aeb060ec71547a3fb7f68b8091538e94c5c5187f Author: Christian Göttsche Date: Thu Apr 20 17:05:01 2023 +0200 selinux: drop return at end of void function avc_insert() Commit 539813e4184a ("selinux: stop returning node from avc_insert()") converted the return value of avc_insert() to void but left the now unnecessary trailing return statement. Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 757010002b97ad0ed89a3b4499c93d23cae429eb Author: Christian Göttsche Date: Thu Apr 20 17:05:00 2023 +0200 selinux: avc: drop unused function avc_disable() Since commit f22f9aaf6c3d ("selinux: remove the runtime disable functionality") the function avc_disable() is no longer used. Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 3d9047a06477ffd630a37e733f2a656e08c6d3aa Author: Christian Göttsche Date: Thu Apr 20 17:04:59 2023 +0200 selinux: adjust typos in comments Found by codespell(1) Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 53f3517ae0870fcb398afbba8ff901d0267772b3 Author: Christian Göttsche Date: Thu Apr 20 17:04:58 2023 +0200 selinux: do not leave dangling pointer behind In case mls_context_cpy() fails due to OOM set the free'd pointer in context_cpy() to NULL to avoid it potentially being dereferenced or free'd again in future. Freeing a NULL pointer is well-defined and a hard NULL dereference crash is at least not exploitable and should give a workable stack trace. Fixes: 12b29f34558b ("selinux: support deferred mapping of contexts") Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 6f933aa7dfd0bb84b7935168f1d45abec4f702c1 Author: Paul Moore Date: Fri May 5 18:48:35 2023 -0400 selinux: more Makefile tweaks A few small tweaks to improve the SELinux Makefile: - Define a new variable, 'genhdrs', to represent both flask.h and av_permissions.h; this should help ensure consistent processing for both generated headers. - Move the 'ccflags-y' variable closer to the top, just after the main 'obj-$(CONFIG_SECURITY_SELINUX)' definition to make it more visible and improve the grouping in the Makefile. - Rework some of the vertical whitespace to improve some of the grouping in the Makefile. Reviewed-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit 79a8ec38d2d05963297cd9df316b77f978ebba66 Author: Stanislav Jakubek Date: Sun Apr 23 14:39:12 2023 +0200 ARM: dts: bcm23550: Add SoC-specific I2C compatible Add BCM23550-specific compatible for brcm,kona-i2c nodes. While not currently used by the i2c-bcm-kona driver, they can serve for further customization, if required. Done in preparation for dt-binding coversion to DT schema. Signed-off-by: Stanislav Jakubek Link: https://lore.kernel.org/r/9875ec0211187e4f5e2a4379c63eacdb69b31d7a.1682252615.git.stano.jakubek@gmail.com Signed-off-by: Florian Fainelli commit d3c8e2c5757153bbfad70019ec1decbca86f3def Author: Rafał Miłecki Date: Wed May 3 14:28:30 2023 +0200 ARM: dts: BCM5301X: Drop "clock-names" from the SPI node There is no such property in the SPI controller binding documentation. Also Linux driver doesn't look for it. This fixes: arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: spi@18029200: Unevaluated properties are not allowed ('clock-names' was unexpected) From schema: Documentation/devicetree/bindings/spi/brcm,spi-bcm-qspi.yaml Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20230503122830.3200-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 916553449561c4f0b61c71b751b7bb583f5dddd4 Author: Rafał Miłecki Date: Wed May 3 14:16:11 2023 +0200 ARM: dts: BCM5301X: Relicense Florian's code to the GPL 2.0+ / MIT All BCM5301X device DTS files use dual licensing. Try the same for SoC. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20230503121611.1629-2-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 915fac07f053418d0ab9075af64da2872ca8a7f8 Author: Rafał Miłecki Date: Wed May 3 14:16:10 2023 +0200 ARM: dts: BCM5301X: Relicense Rafał's code to the GPL 2.0+ / MIT All BCM5301X device DTS files use dual licensing. Try the same for SoC. Introduce a new .dtsi file with a proper SPDX tag. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20230503121611.1629-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 0db4bb045b038ee8c832d4f19013fd88e8d7fd05 Author: Krzysztof Kozlowski Date: Sun Apr 23 17:09:43 2023 +0200 ARM: dts: broadcom: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified properties to fix warnings like: bcm963148.dtb: l2-cache0: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: William Zhang Link: https://lore.kernel.org/r/20230423150943.118576-1-krzysztof.kozlowski@linaro.org Signed-off-by: Florian Fainelli commit 0709e55ed13e256994e440a4e0d62dc1cf3fc6a3 Author: Krzysztof Kozlowski Date: Sat Apr 22 00:32:08 2023 +0200 arm64: dts: broadcom: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified properties to fix warnings like: bcm94908.dtb: l2-cache0: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: William Zhang Link: https://lore.kernel.org/r/20230421223208.115555-1-krzysztof.kozlowski@linaro.org Signed-off-by: Florian Fainelli commit 08c3eab525efb31406494282552a23f33a8a921a Author: Christophe JAILLET Date: Mon Apr 17 22:51:46 2023 +0200 f2fs: remove some dead code 'ret' is known to be 0 at the point. So these lines of code should just be removed. Signed-off-by: Christophe JAILLET Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 1223e432d9e16df39ba51f496c6ad3d7d560f612 Author: Li Zetao Date: Mon Apr 24 23:46:48 2023 +0000 f2fs: remove redundant goto statement in f2fs_read_single_page() After the commit "0a4ee518185", this "goto" statement was redundant, remote it for clean code. Signed-off-by: Li Zetao Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 7cd2e5f75b86a1befa99834f3ed1d735eeff69e6 Author: Yangtao Li Date: Wed Apr 26 00:47:11 2023 +0800 f2fs: do not allow to defragment files have FI_COMPRESS_RELEASED If a file has FI_COMPRESS_RELEASED, all writes for it should not be allowed. Fixes: 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE") Signed-off-by: Qi Han Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 888ca6edac81e919fa7accb3b4f1d363e3c1e5f8 Author: Yangtao Li Date: Wed Apr 26 00:06:11 2023 +0800 f2fs: add sanity check for proc_mkdir Return -ENOMEM when proc_mkdir failed. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b62e71be2110d8b52bf5faf3c3ed7ca1a0c113a5 Author: Chao Yu Date: Sun Apr 23 23:49:15 2023 +0800 f2fs: support errors=remount-ro|continue|panic mountoption This patch supports errors=remount-ro|continue|panic mount option for f2fs. f2fs behaves as below in three different modes: mode continue remount-ro panic access ops normal noraml N/A syscall errors -EIO -EROFS N/A mount option rw ro N/A pending dir write keep keep N/A pending non-dir write drop keep N/A pending node write drop keep N/A pending meta write keep keep N/A By default it uses "continue" mode. [Yangtao helps to clean up function's name] Signed-off-by: Yangtao Li Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 5b8ff071b57e0a50a0e6eb8db55d159a68853f6b Author: Radhakrishna Sripada Date: Fri May 5 16:45:44 2023 -0700 drm/i915/mtl: Fix the wa number for Wa_22016670082 Fixes the right lineage number for the workaround. Fixes: a7fa1537b791 ("drm/i915/mtl: Implement Wa_14019141245") Cc: Matt Roper Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Roper Reviewed-by: Tejas Upadhyay Link: https://patchwork.freedesktop.org/patch/msgid/20230505234544.4029535-1-radhakrishna.sripada@intel.com commit b8039b4e40094e81351221275ed61ee7643cdb91 Author: Krzysztof Kozlowski Date: Fri Apr 21 21:02:02 2023 +0200 ARM: dts: s5pv210: remove empty camera pinctrl configuration The camera's pinctrl configuration is simply empty and not effective. Remove it to fix dtbs_check warnings like: s5pv210-torbreck.dtb: camera@fa600000: pinctrl-0: True is not of type 'array' Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20230421190202.15471-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit b77904ba177a9c67b6dbc3637fdf1faa22df6e5c Author: Krzysztof Kozlowski Date: Fri Apr 21 11:57:21 2023 +0200 ARM: dts: s5pv210: add dummy 5V regulator for backlight on SMDKv210 Backlight is supplied by DC5V regulator. The DTS has no PMIC node, so just add a regulator-fixed to solve it and fix dtbs_check warning: s5pv210-smdkv210.dtb: backlight: 'power-supply' is a required property Link: https://lore.kernel.org/r/20230421095721.31857-4-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 6175f658ae07804f7c347903b8c6781e0914d3e6 Author: Krzysztof Kozlowski Date: Fri Apr 21 11:57:20 2023 +0200 ARM: dts: s5pv210: re-order MFC clock names to match Exynos and bindings Align the order of two MFC clocks with Exynos4 DTS and MFC bindings Link: https://lore.kernel.org/r/20230328114729.61436-1-aakarsh.jain@samsung.com Link: https://lore.kernel.org/r/20230421095721.31857-3-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 64f92c24aa57f8bfc389fe6638f0ffb7e4605928 Author: Krzysztof Kozlowski Date: Fri Apr 21 11:57:19 2023 +0200 ARM: dts: s5pv210: align USB node name with bindings Bindings expect USB HSOTG controller node to be named "usb": s5pv210-torbreck.dtb: hsotg@ec000000: $nodename:0: 'hsotg@ec000000' does not match '^usb(@.*)?' Link: https://lore.kernel.org/r/20230421095721.31857-2-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 7e98d368887c08a6cb79e79684f851e9bd9a3550 Author: Krzysztof Kozlowski Date: Fri Apr 21 11:57:18 2023 +0200 ARM: dts: s5pv210: align pin configuration nodes with bindings Bindings expect that pins in initial and sleep states nodes end with '-pin': s5pv210-fascinate4g.dtb: pinctrl@e0200000: sleep-state: 'gpa0-0', ... 'mp07-7' do not match any of the regexes: '^(pin-[a-z0-9-]+|[a-z0-9-]+-pin)$', 'pinctrl-[0-9]+' Link: https://lore.kernel.org/r/20230421095721.31857-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 043dc30113758f6b18194227447979e100d3061f Author: Krzysztof Kozlowski Date: Tue Feb 7 22:00:16 2023 +0100 ARM: dts: exynos: Remove empty camera pinctrl configuration in Odroid X/U3 The camera's pinctrl configuration is simply empty and not effective. Remove it to fix dtbs_check warning: arch/arm/boot/dts/exynos4412-odroidx.dt.yaml: camera: pinctrl-0: True is not of type 'array' Link: https://lore.kernel.org/r/20230207210020.677007-3-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 5f7255459587c5f0297eaa2dfb551f936789b082 Author: Krzysztof Kozlowski Date: Tue Feb 7 22:00:15 2023 +0100 ARM: dts: exynos: Remove empty camera pinctrl configuration in Universal C210 The camera's pinctrl configuration is simply empty and not effective. Remove it to fix dtbs_check warning: arch/arm/boot/dts/exynos4210-universal_c210.dt.yaml: camera: pinctrl-0: True is not of type 'array' Link: https://lore.kernel.org/r/20230207210020.677007-2-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 8a9e495b3a07e04a7d86d9c706a38e69863348ae Author: Krzysztof Kozlowski Date: Tue Feb 7 22:00:14 2023 +0100 ARM: dts: exynos: Remove empty camera pinctrl configuration in Trats The camera's pinctrl configuration is simply empty and not effective. Remove it to fix dtbs_check warning: arch/arm/boot/dts/exynos4210-trats.dt.yaml: camera: pinctrl-0: True is not of type 'array' Link: https://lore.kernel.org/r/20230207210020.677007-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 0070e0fcc522aebe2461714074f7637cab70e688 Author: Krzysztof Kozlowski Date: Tue Feb 7 20:32:54 2023 +0100 ARM: dts: s5pv210: drop simple-bus from FIMC The FIMC camera node wrapper is not a bus, so using simple-bus fallback compatible just to instantiate its children nodes was never correct. The change is not backwards compatible and expects the FIMC driver to populate its children. Link: https://lore.kernel.org/r/20230207193254.550236-2-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit a1ca56099819f4b2c52bfe23b7be13b0d53a2a4a Author: Krzysztof Kozlowski Date: Tue Feb 7 20:32:53 2023 +0100 ARM: dts: exynos: drop simple-bus from FIMC in Exynos4 The FIMC camera node wrapper is not a bus, so using simple-bus fallback compatible just to instantiate its children nodes was never correct. Dropping simple-bus node fixes warnings: exynos4210-smdkv310.dtb: camera: $nodename:0: 'camera' does not match '^([a-z][a-z0-9\\-]+-bus|bus|localbus|soc|axi|ahb|apb)(@.+)?$' The change is not backwards compatible and expects the FIMC driver to populate its children. Link: https://lore.kernel.org/r/20230207193254.550236-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit bcf784985e35fc39d682f0dde750162e7f54a1f0 Author: Luca Weiss Date: Mon May 8 09:41:54 2023 -0700 Input: pwm-vibra - add support for enable GPIO Some pwm vibrators have a dedicated enable GPIO that needs to be set high so that the vibrator works. Add support for that optionally. Signed-off-by: Luca Weiss Reviewed-by: Brian Masney Reviewed-by: Sebastian Reichel Reviewed-by: Caleb Connolly Link: https://lore.kernel.org/r/20230427-hammerhead-vibra-v1-3-e87eeb94da51@z3ntu.xyz Signed-off-by: Dmitry Torokhov commit 29ebf697f18d9eeaa8d53c7bd16c4e6962508019 Author: Luca Weiss Date: Mon May 8 09:41:40 2023 -0700 Input: pwm-vibra - add newline to dev_err prints Make sure all printed messages end with a newline. Signed-off-by: Luca Weiss Reviewed-by: Caleb Connolly Reviewed-by: Brian Masney Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230427-hammerhead-vibra-v1-2-e87eeb94da51@z3ntu.xyz Signed-off-by: Dmitry Torokhov commit 54e663340a64df8f87ea4d5a8e0f66bac6db4f65 Author: Luca Weiss Date: Mon May 8 09:41:28 2023 -0700 dt-bindings: input: pwm-vibrator: Add enable-gpio Some pwm vibrators have a dedicated enable GPIO that needs to be set high so that the vibrator works. Document that. Signed-off-by: Luca Weiss Reviewed-by: Sebastian Reichel Reviewed-by: Brian Masney Acked-by: Krzysztof Kozlowski Reviewed-by: Caleb Connolly Link: https://lore.kernel.org/r/20230427-hammerhead-vibra-v1-1-e87eeb94da51@z3ntu.xyz Signed-off-by: Dmitry Torokhov commit 13fdc081fbe997fbd6addc8eafc240655c2fc7e8 Author: Nishanth Menon Date: Mon Apr 24 09:49:43 2023 -0500 arm64: dts: ti: k3-am65-main: Remove "syscon" nodes added for pcieX_ctrl Remove "syscon" nodes added for pcieX_ctrl and have the PCIe node point to the parent with an offset argument. This change is as discussed in [1]. [1] http://lore.kernel.org/r/CAL_JsqKiUcO76bo1GoepWM1TusJWoty_BRy2hFSgtEVMqtrvvQ@mail.gmail.com Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230424144949.244135-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 9b8c6da0b5850bd9645d0f9b4a892e69cb7ec662 Author: Krzysztof Kozlowski Date: Sat Apr 22 00:31:43 2023 +0200 arm64: dts: ti: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified properties to fix warnings like: k3-am6528-iot2050-basic-pg2.dtb: l3-cache0: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski Acked-by: Nishanth Menon Link: https://lore.kernel.org/r/20230421223143.115099-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vignesh Raghavendra commit ffc449e016e269ce4d19e648bae584f8e5afd59f Author: Nishanth Menon Date: Wed Apr 19 17:59:13 2023 -0500 arm64: dts: ti: k3-am65: Drop aliases iot boards have always defined their own aliases and with the base-board defining it's own aliases, there are no pending boards depending on common aliases defined in SoC level. aliases are meant to be defined appropriately based on the exposed interfaces at a board level, drop the aliases defined at SoC level. Signed-off-by: Nishanth Menon Reviewed-by: Kamlesh Gurudasani Link: https://lore.kernel.org/r/20230419225913.663448-8-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 692e8888a84357232574caba74f60ceea7364016 Author: Nishanth Menon Date: Wed Apr 19 17:59:12 2023 -0500 arm64: dts: ti: k3-am654-base-board: Add aliases Introduce aliases compatible with the base definition, but focussed on the interfaces that have been exposed on the platform. Signed-off-by: Nishanth Menon Reviewed-by: Kamlesh Gurudasani Link: https://lore.kernel.org/r/20230419225913.663448-7-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 895e2f4f9852e54c0e6d16ddea9882b9b2065eae Author: Nishanth Menon Date: Wed Apr 19 17:59:11 2023 -0500 arm64: dts: ti: k3-am654-base-board: Add board detect eeprom Enable AT24CM01 on the base board using the corresponding compatible. Signed-off-by: Nishanth Menon Reviewed-by: Kamlesh Gurudasani Link: https://lore.kernel.org/r/20230419225913.663448-6-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 282621ed6e790ccf7288c4c0aadbb34f1fe25c11 Author: Nishanth Menon Date: Wed Apr 19 17:59:10 2023 -0500 arm64: dts: ti: k3-am654-base-board: Add missing PMIC Add the missing vdd_mpu PMIC. Signed-off-by: Nishanth Menon Reviewed-by: Kamlesh Gurudasani Link: https://lore.kernel.org/r/20230419225913.663448-5-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 5292f504827c56406975b463eda1270d144cf06f Author: Nishanth Menon Date: Wed Apr 19 17:59:09 2023 -0500 arm64: dts: ti: k3-am654-base-board: Add VTT GPIO regulator for DDR Hold the DDR vtt regulator active for functionality. Signed-off-by: Nishanth Menon Reviewed-by: Kamlesh Gurudasani Link: https://lore.kernel.org/r/20230419225913.663448-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit ec1b54824f022a7e65d858abbe74f5d7effc9817 Author: Nishanth Menon Date: Wed Apr 19 17:59:08 2023 -0500 arm64: dts: ti: k3-am654-base-board: Rename regulator node name Rename the regulator node names to the standard regulator-0.. numbers. Signed-off-by: Nishanth Menon Reviewed-by: Kamlesh Gurudasani Link: https://lore.kernel.org/r/20230419225913.663448-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 3ae28642a110485f71091f0a631492e78b396b2b Author: Nishanth Menon Date: Wed Apr 19 17:59:07 2023 -0500 arm64: dts: ti: k3-am654-base-board: Add missing pinmux wkup_uart, mcu_uart and mcu_i2c Many of the definitions depend on pinmux done by the bootloader. Be explicit about the pinmux for functionality and completeness. Signed-off-by: Nishanth Menon Reviewed-by: Kamlesh Gurudasani Link: https://lore.kernel.org/r/20230419225913.663448-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 804702e4c2aa5eae4611e9389833631a6b22e913 Author: Nishanth Menon Date: Mon Apr 17 20:27:16 2023 -0500 arm64: dts: ti: k3-am62a: Add watchdog nodes Add nodes for watchdogs: - 5 in main domain - 1 in MCU domain - 1 in wakeup domain Signed-off-by: Nishanth Menon Reviewed-by: Tony Lindgren Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230418012717.1230882-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 68dd81a75192248a2c29650d21da495069c74ffa Author: Nishanth Menon Date: Mon Apr 17 20:27:15 2023 -0500 arm64: dts: ti: k3-am62a: Add general purpose timers Similar to commit 3308a31c507c ("arm64: dts: ti: k3-am62: Add general purpose timers for am62"), there are 12 general purpose timers on am62a7 split between 8 in main and 4 in mcu domains. The 4 in mcu domain do not have interrupts that are routable to a53. We configure the timers with the 25 MHz input clock by default as the 32.768 kHz clock may not be wired on the device. We leave the MCU domain timers clock mux unconfigured, and mark the MCU domain timers reserved. The MCU domain timers are likely reserved by the software for the ESM module. Signed-off-by: Nishanth Menon Reviewed-by: Tony Lindgren Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230418012717.1230882-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit cf82a026f54f54c241903add9b9bdbeb2a449db0 Author: Nishanth Menon Date: Wed Apr 19 09:12:22 2023 -0500 arm64: dts: ti: k3-j721s2-common-proc-board: Drop bootargs Drop bootargs from the dts. The console arguments are already covered in stdout-path property and earlycon is a debug property that should be enabled only when debug is desired and not as default. Link: https://lore.kernel.org/linux-arm-kernel/81134eb9-2b7d-05bc-3035-a47f020861a8@linaro.org/ Suggested-by: Krzysztof Kozlowski Acked-by: Krzysztof Kozlowski Reviewed-by: Roger Quadros Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230419141222.383567-6-nm@ti.com Signed-off-by: Vignesh Raghavendra commit f920c49f1e46a99c410e2aaf486ffb7ce3d12270 Author: Nishanth Menon Date: Wed Apr 19 09:12:21 2023 -0500 arm64: dts: ti: k3-j7200-common-proc-board: Drop bootargs Drop bootargs from the dts. The console arguments are already covered in stdout-path property and earlycon is a debug property that should be enabled only when debug is desired and not as default. Link: https://lore.kernel.org/linux-arm-kernel/81134eb9-2b7d-05bc-3035-a47f020861a8@linaro.org/ Suggested-by: Krzysztof Kozlowski Acked-by: Krzysztof Kozlowski Reviewed-by: Roger Quadros Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230419141222.383567-5-nm@ti.com Signed-off-by: Vignesh Raghavendra commit af2cda7df7769d3353170b6a72d73bc4ea703480 Author: Nishanth Menon Date: Wed Apr 19 09:12:20 2023 -0500 arm64: dts: ti: k3-j721e-*: Drop bootargs Drop bootargs from the dts. The console arguments are already covered in stdout-path property and earlycon is a debug property that should be enabled only when debug is desired and not as default. Link: https://lore.kernel.org/linux-arm-kernel/81134eb9-2b7d-05bc-3035-a47f020861a8@linaro.org/ Suggested-by: Krzysztof Kozlowski Acked-by: Krzysztof Kozlowski Reviewed-by: Roger Quadros Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230419141222.383567-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit da4159a776593f802ee211ad4823f3aed31e5375 Author: Nishanth Menon Date: Wed Apr 19 09:12:19 2023 -0500 arm64: dts: ti: k3-am65*: Drop bootargs Drop bootargs from the dts. earlycon is a debug property that should be enabled only when debug is desired and not as default - see referenced link on discussion on this topic. Cc: Jan Kiszka Link: https://lore.kernel.org/linux-arm-kernel/81134eb9-2b7d-05bc-3035-a47f020861a8@linaro.org/ Suggested-by: Krzysztof Kozlowski Acked-by: Krzysztof Kozlowski Reviewed-by: Roger Quadros Signed-off-by: Nishanth Menon Acked-by: Jan Kiszka Link: https://lore.kernel.org/r/20230419141222.383567-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit d525ef9c7f077bfa8202b4b47ca9242ab936a1dc Author: Nishanth Menon Date: Wed Apr 19 09:12:18 2023 -0500 arm64: dts: ti: k3-am62x-sk-common: Drop bootargs Drop bootargs from the dts. The console arguments are already covered in stdout-path property and earlycon is a debug property that should be enabled only when debug is desired and not as default. Link: https://lore.kernel.org/linux-arm-kernel/81134eb9-2b7d-05bc-3035-a47f020861a8@linaro.org/ Suggested-by: Krzysztof Kozlowski Acked-by: Krzysztof Kozlowski Reviewed-by: Roger Quadros Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230419141222.383567-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 6a98a6e40fdf0e105b5f25a58641f30901acdb34 Author: Brandon Pollack Date: Tue Apr 25 08:02:40 2023 +0000 Documentation: vkms: clarify devres managed reference cleanup added documentation to drm_dev_unregister clarifying that devres managed devices allocated with devm_drm_dev_alloc do not require calls to drm_dev_put. Reviewed-by: Daniel Vetter Signed-off-by: Brandon Pollack Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230425080240.3582324-1-brpol@chromium.org commit bb3d657872215942cf87dd194904a7543fce3cc4 Author: Nishanth Menon Date: Fri Apr 14 02:33:28 2023 -0500 arm64: dts: ti: k3-am642-sk|evm: Drop bootargs, add aliases Drop bootargs and add aliases based on base pinout of SK as per [1] and evm per [2]. Indices chosen attempt to maintain some level of consistency with existing aliases. While at this, drop a extra EoL. While this patch could be split, it seems trivial to add additional cleanup steps. [1] https://www.ti.com/lit/df/sprr432/sprr432.pdf [2] https://www.ti.com/lit/zip/swrr171 Signed-off-by: Nishanth Menon Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230414073328.381336-11-nm@ti.com Signed-off-by: Vignesh Raghavendra commit aca16cefdd25cdcd284212f840b70b07101f2548 Author: Nishanth Menon Date: Fri Apr 14 02:33:27 2023 -0500 arm64: dts: ti: k3-am642-evm: Add VTT GPIO regulator for DDR Hold the DDR vtt regulator active for functionality. Signed-off-by: Nishanth Menon Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230414073328.381336-10-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 61ee5572075dfc16b480103763091b603cb06aa1 Author: Nishanth Menon Date: Fri Apr 14 02:33:26 2023 -0500 arm64: dts: ti: k3-am642-evm: Rename regulator node name Rename the regulator node names to the standard regulator-0.. numbers. Signed-off-by: Nishanth Menon Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230414073328.381336-9-nm@ti.com Signed-off-by: Vignesh Raghavendra commit e3e1d9ab65ebbd95907b6951637cd6809c69afc7 Author: Nishanth Menon Date: Fri Apr 14 02:33:25 2023 -0500 arm64: dts: ti: k3-am642-evm: Describe main_uart1 pins Describe the main_uart1 pins even though it is a reserved node for hardware complete description. This is used by other users of device tree to help configure the SoC per board requirements. Signed-off-by: Nishanth Menon Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230414073328.381336-8-nm@ti.com Signed-off-by: Vignesh Raghavendra commit cf3b25bc3cc0b66cfaae9614620228a5c2246ecb Author: Nishanth Menon Date: Fri Apr 14 02:33:24 2023 -0500 arm64: dts: ti: k3-am642-evm: Enable main_i2c0 and eeprom Enable AT24CM01 on the base board using the corresponding compatible. Signed-off-by: Nishanth Menon Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230414073328.381336-7-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 826b6679bd08694ad7a830eb30608c3e5a780941 Author: Nishanth Menon Date: Fri Apr 14 02:33:23 2023 -0500 arm64: dts: ti: k3-am642-sk: Rename regulator node name Rename the regulator node names to the standard regulator-0.. numbers. Signed-off-by: Nishanth Menon Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230414073328.381336-6-nm@ti.com Signed-off-by: Vignesh Raghavendra commit c8da2f207168d2c93f7fa7bff92f6b395c342e4a Author: Nishanth Menon Date: Fri Apr 14 02:33:22 2023 -0500 arm64: dts: ti: k3-am642-sk: Describe main_uart1 pins Describe the main_uart1 pins even though it is a reserved node for hardware complete description. This is used by other users of device tree to help configure the SoC per board requirements. Signed-off-by: Nishanth Menon Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230414073328.381336-5-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 1d79ca01e62096e87686244cdf4864f338ccd200 Author: Nishanth Menon Date: Fri Apr 14 02:33:21 2023 -0500 arm64: dts: ti: k3-am642-sk: Enable main_i2c0 and eeprom Enable AT24C512C on the base board. Signed-off-by: Nishanth Menon Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230414073328.381336-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 744545ffec14f74f26f57828afa685f6f4eadd9e Author: Nishanth Menon Date: Fri Apr 14 02:33:20 2023 -0500 arm64: dts: ti: k3-am642-sk: Fix mmc1 pinmux Fix the pinmux for pulldirection to get stable sdcard behavior. Signed-off-by: Nishanth Menon Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230414073328.381336-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 9972b45776aba937d0db67f8080ec627a924f56e Author: Nishanth Menon Date: Fri Apr 14 02:33:19 2023 -0500 arm64: dts: ti: k3-am64: Add general purpose timers There are 11 general purpose timers on am64 that can be used for things like PWM using pwm-omap-dmtimer driver. There are also additional four timers in the MCU domain that do not have interrupts routable for Linux. We configure the timers with the 25 MHz input clock by default as the 32.768 kHz clock may not be wired on the device. We leave the MCU domain timers clock mux unconfigured, and mark the MCU domain timers reserved. The MCU domain timers are likely reserved by the software for the ESM module. Compared to am65, the timers on am64 do not have a dedicated IO mux for the timers. On am62, the timers have different interrupts, clocks and power domains compared to am65, and the MCU timers are at a different IO address. Compared to AM62, the AM64 times have different clocks and count in main domain are different as well. Signed-off-by: Nishanth Menon Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230414073328.381336-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 986866c3dfb0f930c5cc109a6c509c1391d96b5f Author: Christophe JAILLET Date: Mon Apr 24 10:39:56 2023 +0200 usb: typec: mux: Remove some unneeded includes This driver includes many header files that are unneeded. Remove them and add where devm_kzalloc() is defined. Signed-off-by: Christophe JAILLET Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/1db1e8bd253cbb652835c0cef6a0a2bb9a4970eb.1682325582.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 78227fa03c6854e8ca23911309c763d909653c6e Author: Geert Uytterhoeven Date: Tue May 2 12:06:38 2023 +0200 Documentation: kunit: Modular tests should not depend on KUNIT=y When the documentation was updated for modular tests, the dependency on "KUNIT=y" was forgotten to be updated, now encouraging people to create tests that cannot be enabled when the KUNIT framework itself is modular. Fix this by changing the dependency to "KUNIT". Document when it is appropriate (and required) to depend on "KUNIT=y". Fixes: c9ef2d3e3f3b ("KUnit: Docs: make start.rst example Kconfig follow style.rst") Signed-off-by: Geert Uytterhoeven Reviewed-by: David Gow Signed-off-by: Shuah Khan commit e30f65c4b3d671115bf2a9d9ef142285387f2aff Author: Daniel Latypov Date: Mon May 1 11:16:10 2023 -0700 kunit: tool: undo type subscripts for subprocess.Popen Writing `subprocess.Popen[str]` requires python 3.9+. kunit.py has an assertion that the python version is 3.7+, so we should try to stay backwards compatible. This conflicts a bit with commit 1da2e6220e11 ("kunit: tool: fix pre-existing `mypy --strict` errors and update run_checks.py"), since mypy complains like so > kunit_kernel.py:95: error: Missing type parameters for generic type "Popen" [type-arg] Note: `mypy --strict --python-version 3.7` does not work. We could annotate each file with comments like `# mypy: disable-error-code="type-arg" but then we might still get nudged to break back-compat in other files. This patch adds a `mypy.ini` file since it seems like the only way to disable specific error codes for all our files. Note: run_checks.py doesn't need to specify `--config_file mypy.ini`, but I think being explicit is better, particularly since most kernel devs won't be familiar with how mypy works. Fixes: 695e26030858 ("kunit: tool: add subscripts for type annotations where appropriate") Reported-by: SeongJae Park Link: https://lore.kernel.org/linux-kselftest/20230501171520.138753-1-sj@kernel.org Signed-off-by: Daniel Latypov Tested-by: SeongJae Park Reviewed-by: David Gow Signed-off-by: Shuah Khan commit e7e444dfc2fa195deb4ae5cc5d67de51caa98fc4 Author: Daniel Watson Date: Fri Apr 28 19:26:48 2023 -0700 staging: rtl8723bs: use tabs for indentation Use tabs for indentation to conform to styleguide. Signed-off-by: Daniel Watson Link: https://lore.kernel.org/r/ZEyAaC0riuuBJO14@trent-reznor Signed-off-by: Greg Kroah-Hartman commit 718ac8c8bd6a87d5fa2554089acb8c4f65dd5304 Author: John Grace Date: Mon Apr 24 20:48:53 2023 -0400 staging: rtl8192e: avoid CamelCase Linux kernel coding-style suggests to not use mixed-case names. Fix checkpatch issue by changing the variable name from camel case to snake case. Signed-off-by: John Grace Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/ZEcjdUR/bnln7Z1J@iris Signed-off-by: Greg Kroah-Hartman commit e7e0b078c9b396fc3de5f105c63235e70b876e5f Author: Yogesh Hegde Date: Mon Apr 24 23:35:25 2023 +0530 staging: rtl8192e: Remove unused sens and max_sens from r8192_priv struct The 'sens' and 'max_sens' fields in the 'r8192_priv' structure are no longer used by the driver. This commit removes these fields. Suggested-by: Philipp Hortmann Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/e117e958ada5695975deecfcd442703fd11bba3f.1682358035.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3877f73207c3a3d9ed033de5d627769595e324b5 Author: Yogesh Hegde Date: Mon Apr 24 23:35:07 2023 +0530 staging: rtl8192e: Remove unused _rtl92e_wx_set_sens function After removal of rf_set_sens variable, the _rtl92e_wx_set_sens function always returns an error code. This commit removes the unused function and the respective ioctl. Suggested-by: Philipp Hortmann Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/439386d2940fe70ec2092e87211df5e7946aab82.1682358035.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 03b9a1ab7cebd4db01cfd719a294c8f6a7bae922 Author: Yogesh Hegde Date: Mon Apr 24 23:34:38 2023 +0530 staging: rtl8192e: Remove unused _rtl92e_wx_get_sens function After removal of rf_set_sens variable, the _rtl92e_wx_get_sens function always returns an error code. This commit removes the unused function and the respective ioctl. Suggested-by: Philipp Hortmann Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/eae80c4e2ac7f386c853cf824135b988c3666031.1682358035.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3a4d000ae7fefe8d85fe54db373624dfb9b64c66 Author: Yogesh Hegde Date: Mon Apr 24 23:34:07 2023 +0530 staging: rtl8192e: Remove unused rf_set_sens variable The rf_set_sens variable is declared but never set, so it is always NULL. This commit cleans up the unused rf_set_sens variable and removes the associated code that relied on it. Specifically, the following changes have been made: - Removed the `range->sensitivity` assignment, which was never used. - Removed the sensitivity level get implementation, which always returns an error code. - Removed the sensitivity level set implementation, which always returns an error code. - Removed the `rf_set_sens` variable. Suggested-by: Philipp Hortmann Signed-off-by: Yogesh Hegde Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/5a9767fab76b1836ea7881994ffb3593c1ab12bf.1682358035.git.yogi.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 77f2760e7111ddcfb3ab1eb7d242ec38ed9480e2 Author: Stephan Snyman Date: Thu Apr 20 15:32:09 2023 +0200 staging: rtl8192e: add missing braces {} Add missing braces to if/else statements to adhere to the Linux kernel coding-style guidelines. These issues were reported by checkpatch.pl "CHECK: braces {} should be used on all arms of this statement" Signed-off-by: Stephan Snyman Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230420133209.4661-1-rooiratel@tinyglitch.net Signed-off-by: Greg Kroah-Hartman commit 9fd3210602877d0909886387157386f65cfba415 Author: Luke Koch Date: Thu Apr 20 18:50:00 2023 +0200 staging: wlan-ng: replace rate macros Change p80211msg_dot11req_scan_results rate members to struct arrays instead of individually numbered member structs. Replace macros to set rates with loops to avoid checkpatch warning and adhere to linux coding style. Reported by checkpatch: CHECK: Macro argument reuse 'N' - possible side-effects? Signed-off-by: Luke Koch Link: https://lore.kernel.org/r/ZEFtOH83frrrireN@kernelhacking.kernelhacking.example.com Signed-off-by: Greg Kroah-Hartman commit b2ad431f6469b58914ee7254302c6dc97f688e54 Author: Rong Tao Date: Fri Apr 28 15:55:49 2023 +0800 tools/x86/kcpuid: Add .gitignore Ignore kcpuid ELF file. [ bp: Drop the '/' before the name. ] Signed-off-by: Rong Tao Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/tencent_F0318BF0724705EC156C341E11DE4040E805@qq.com commit 0150d1bfbedf29d7473ae458815781488f62d11d Author: Borislav Petkov (AMD) Date: Wed Apr 26 11:41:07 2023 +0200 tools/x86/kcpuid: Dump the correct CPUID function in error The tool uses the 16 least significant bits of the CPUID leaf as an index into its array of CPUID function field descriptions. However, when that index is non-existent, it uses the same, truncated index to report it, which is wrong: $ kcpuid -l 0x80000034 ERR: invalid input index (0x34) Use the original index number in the error message. Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230426094107.27348-1-bp@alien8.de commit cbbe077815144ad98fd2ea724d9ec3dade09ca92 Author: Luca Weiss Date: Fri Apr 21 23:56:21 2023 +0200 pinctrl: qcom: spmi-gpio: Add PM8953 support Add support for the 8 GPIOs found on PM8953. Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20230421-pm8953-gpio-v1-2-3d33e2de47e3@z3ntu.xyz Signed-off-by: Linus Walleij commit 2c0743152127ea8d6cf92d7969aaf62b024418ac Author: Luca Weiss Date: Fri Apr 21 23:56:20 2023 +0200 dt-bindings: pinctrl: qcom,pmic-gpio: add PM8953 Document the 8 GPIOs found on PM8953. Signed-off-by: Luca Weiss Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230421-pm8953-gpio-v1-1-3d33e2de47e3@z3ntu.xyz Signed-off-by: Linus Walleij commit 65f6c7c91cb2ebacbf155e0f881f81e79f90d138 Author: Mario Limonciello Date: Fri Apr 21 07:06:24 2023 -0500 pinctrl: amd: Revert "pinctrl: amd: disable and mask interrupts on probe" commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe") was well intentioned to mask a firmware issue on a surface laptop, but it has a few problems: 1. It had a bug in the loop handling for iteration 63 that lead to other problems with GPIO0 handling. 2. It disables interrupts that are used internally by the SOC but masked by default. 3. It masked a real firmware problem in some chromebooks that should have been caught during development but wasn't. There has been a lot of other development around s2idle; particularly around handling of the spurious wakeups. If there is still a problem on the original reported surface laptop it should be avoided by adding a quirk to gpiolib-acpi for that system instead. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20230421120625.3366-5-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit 0cf9e48ff22e15f3f0882991f33d23ccc5ae1d01 Author: Kornel Dulęba Date: Fri Apr 21 07:06:23 2023 -0500 pinctrl: amd: Detect and mask spurious interrupts Leverage gpiochip_line_is_irq to check whether a pin has an irq associated with it. The previous check ("irq == 0") didn't make much sense. The irq variable refers to the pinctrl irq, and has nothing do to with an individual pin. On some systems, during suspend/resume cycle, the firmware leaves an interrupt enabled on a pin that is not used by the kernel. Without this patch that caused an interrupt storm. Cc: stable@vger.kernel.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=217315 Signed-off-by: Kornel Dulęba Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20230421120625.3366-4-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit a855724dc08b8cb0c13ab1e065a4922f1e5a7552 Author: Mario Limonciello Date: Fri Apr 21 07:06:22 2023 -0500 pinctrl: amd: Fix mistake in handling clearing pins at startup commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe") had a mistake in loop iteration 63 that it would clear offset 0xFC instead of 0x100. Offset 0xFC is actually `WAKE_INT_MASTER_REG`. This was clearing bits 13 and 15 from the register which significantly changed the expected handling for some platforms for GPIO0. Cc: stable@vger.kernel.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=217315 Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20230421120625.3366-3-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit 968ab9261627fa305307e3935ca1a32fcddd36cb Author: Mario Limonciello Date: Fri Apr 21 07:06:21 2023 -0500 pinctrl: amd: Detect internal GPIO0 debounce handling commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe") had a mistake in loop iteration 63 that it would clear offset 0xFC instead of 0x100. Offset 0xFC is actually `WAKE_INT_MASTER_REG`. This was clearing bits 13 and 15 from the register which significantly changed the expected handling for some platforms for GPIO0. commit b26cd9325be4 ("pinctrl: amd: Disable and mask interrupts on resume") actually fixed this bug, but lead to regressions on Lenovo Z13 and some other systems. This is because there was no handling in the driver for bit 15 debounce behavior. Quoting a public BKDG: ``` EnWinBlueBtn. Read-write. Reset: 0. 0=GPIO0 detect debounced power button; Power button override is 4 seconds. 1=GPIO0 detect debounced power button in S3/S5/S0i3, and detect "pressed less than 2 seconds" and "pressed 2~10 seconds" in S0; Power button override is 10 seconds ``` Cross referencing the same master register in Windows it's obvious that Windows doesn't use debounce values in this configuration. So align the Linux driver to do this as well. This fixes wake on lid when WAKE_INT_MASTER_REG is properly programmed. Cc: stable@vger.kernel.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=217315 Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20230421120625.3366-2-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit cdf7e616120065007687fe1df0412154f259daec Author: Christophe JAILLET Date: Sun Apr 16 23:43:41 2023 +0200 pinctrl: bcm2835: Handle gpiochip_add_pin_range() errors gpiochip_add_pin_range() can fail, so better return its error code than a hard coded '0'. Fixes: d2b67744fd99 ("pinctrl: bcm2835: implement hook for missing gpio-ranges") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/98c3b5890bb72415145c9fe4e1d974711edae376.1681681402.git.christophe.jaillet@wanadoo.fr Signed-off-by: Linus Walleij commit 057e1ae7443cefb4c59923a574512b7bc69683f8 Merge: dd69654cd32ac d2ae5d42464e9 Author: Mark Brown Date: Mon May 8 22:34:26 2023 +0900 spi: dw: DW SPI DMA Driver updates Merge series from Joy Chakraborty : This Patch series adds support for 32 bits per word trasfers using DMA and some defensive checks around dma controller capabilities. commit 67fce5963b202acc410776cc180c307192dca9d2 Author: Krzysztof Kozlowski Date: Fri Apr 7 17:03:26 2023 +0200 power: supply: hwmon: constify pointers to hwmon_channel_info Statically allocated array of pointed to hwmon_channel_info can be made const for safety. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel commit 04408952fe2aa60db266cfa8f6db22a6ff3e1971 Author: Thomas Zimmermann Date: Fri Apr 28 14:24:52 2023 +0200 drm/fb-helper: Use fb_{cfb,sys}_{read, write}() Implement DRM fbdev helpers for reading and writing framebuffer memory with the respective fbdev functions. Removes duplicate code. v2: * rename fb_cfb_() to fb_io_() (Geert) Signed-off-by: Thomas Zimmermann Tested-by: Sui Jingfeng Reviewed-by: Javier Martinez Canillas Acked-by: Helge Deller Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-20-tzimmermann@suse.de commit 6121cd9ef911432b14c2a17aefaf8cd2f3cfcdff Author: Thomas Zimmermann Date: Fri Apr 28 14:24:51 2023 +0200 fbdev: Move I/O read and write code into helper functions Move the existing I/O read and write code for I/O memory into the new helpers fb_cfb_read() and fb_cfb_write(). Make them the default fp_ops. No functional changes. In the near term, the new functions will be useful to the DRM subsystem, which currently provides it's own implementation. It can then use the shared code. In the longer term, it might make sense to revise the I/O helper's default status and make them opt-in by the driver. Systems that don't use them would not contain the code any longer. v2: * add detailed commit message (Javier) * rename fb_cfb_() to fb_io_() (Geert) * add fixes that got lost while moving the code (Geert) Signed-off-by: Thomas Zimmermann Tested-by: Sui Jingfeng Reviewed-by: Javier Martinez Canillas Acked-by: Helge Deller Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-19-tzimmermann@suse.de commit 3f8974f68f408f4983443b745a3cf95b06112469 Author: Thomas Zimmermann Date: Fri Apr 28 14:24:50 2023 +0200 fbdev: Validate info->screen_{base, buffer} in fb_ops implementations Push the test for info->screen_base from fb_read() and fb_write() into the implementations of struct fb_ops.{fb_read,fb_write}. In cases where the driver operates on info->screen_buffer, test this field instead. While bothi fields, screen_base and screen_buffer, are stored in the same location, they refer to different address spaces. For correctness, we want to test each field in exactly the code that uses it. v2: * also test screen_base in pvr2fb (Geert) * also test screen_buffer in ivtvfb, arcfb, broadsheetfb, hecubafb, metronomefb and ssd1307fb (Geert) * give a rational for the change (Geert) Signed-off-by: Thomas Zimmermann Tested-by: Sui Jingfeng Reviewed-by: Javier Martinez Canillas Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-18-tzimmermann@suse.de commit 453bd91302f16ddb8a2f5eb3df9fda3206dbacef Author: Thomas Zimmermann Date: Fri Apr 28 14:24:49 2023 +0200 fbdev: Don't re-validate info->state in fb_ops implementations The file-op entry points fb_read() and fb_write() verify that info->state has been set to FBINFO_STATE_RUNNING. Remove the same test from the implementations of struct fb_ops.{fb_read,fb_write}. v2: * also remove test from ivtvfb, braodsheetfb, hecubafb and metronomefb (Geert) Signed-off-by: Thomas Zimmermann Tested-by: Sui Jingfeng Reviewed-by: Javier Martinez Canillas Reviewed-by: Geert Uytterhoeven Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-17-tzimmermann@suse.de commit f06875dc4c4f5d8895519857e441d407e88280e4 Author: Thomas Zimmermann Date: Fri Apr 28 14:24:48 2023 +0200 fbdev: Use screen_buffer in fb_sys_{read,write}() Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. Since the fb_sys_{read,write}() functions operate on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of all the casting needed due to not using the correct data type. v2: * add detailed commit message (Javier) Signed-off-by: Thomas Zimmermann Tested-by: Sui Jingfeng Reviewed-by: Javier Martinez Canillas Reviewed-by: Geert Uytterhoeven Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-16-tzimmermann@suse.de commit 921b7383f34802726a7f45b6b38ef62bae0df4d6 Author: Thomas Zimmermann Date: Fri Apr 28 14:24:47 2023 +0200 fbdev: Return number of bytes read or written Always return the number of bytes read or written within the framebuffer. Only return an errno code if framebuffer memory was not touched. This is the semantics required by POSIX and makes fb_read() and fb_write() compatible with IGT tests. [1] This bug has been fixed for fb_write() long ago by commit 6a2a88668e90 ("[PATCH] fbdev: Fix return error of fb_write"). The code in fb_read() and the corresponding fb_sys_() helpers was forgotten. It can happen that copy_{from, to}_user() only partially copies the given buffer. Take this into account when calculating the number of bytes. v2: * consider return value from copy_{from,to}_user() (Geert) Signed-off-by: Thomas Zimmermann Tested-by: Sui Jingfeng Reviewed-by: Javier Martinez Canillas Reviewed-by: Geert Uytterhoeven Acked-by: Helge Deller Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/tests/fbdev.c # 1 Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-15-tzimmermann@suse.de commit 254a4fda50590c5458f012220df3d0dc2f11fd6e Author: Thomas Zimmermann Date: Fri Apr 28 14:24:46 2023 +0200 fbdev/xen-fbfront: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-14-tzimmermann@suse.de commit 5a2c399d609bff499fdebfc5d80d8a5fc720630e Author: Thomas Zimmermann Date: Fri Apr 28 14:24:45 2023 +0200 fbdev/vfb: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-13-tzimmermann@suse.de commit 962a3faf32666a31c5a05c2a69023a4abab6389f Author: Thomas Zimmermann Date: Fri Apr 28 14:24:44 2023 +0200 fbdev/udlfb: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-12-tzimmermann@suse.de commit 6ca49268e0c328b441cd0f3387ee8568e33ffdc5 Author: Thomas Zimmermann Date: Fri Apr 28 14:24:43 2023 +0200 fbdev/smscufx: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-11-tzimmermann@suse.de commit bdb616479eff419d5f881efbf1485ed098cbdbce Author: Thomas Zimmermann Date: Fri Apr 28 14:24:42 2023 +0200 fbdev/ps3fb: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-10-tzimmermann@suse.de commit 867187821e5eb02f37e03d98d5f3c9cb65faaa11 Author: Thomas Zimmermann Date: Fri Apr 28 14:24:41 2023 +0200 fbdev/metronomefb: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-9-tzimmermann@suse.de commit 3907e683c09e36e52a6faf5ff91e8834e1bb2a85 Author: Thomas Zimmermann Date: Fri Apr 28 14:24:40 2023 +0200 fbdev/hecubafb: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-8-tzimmermann@suse.de commit ada45eda25f28115bd14680b15aa1144e268f266 Author: Thomas Zimmermann Date: Fri Apr 28 14:24:39 2023 +0200 fbdev/broadsheetfb: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-7-tzimmermann@suse.de commit f5eccc49d88ba516cc3433ae4f5f3ace3b125cbd Author: Thomas Zimmermann Date: Fri Apr 28 14:24:38 2023 +0200 fbdev/au1200fb: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-6-tzimmermann@suse.de commit 8112bafc3403196efff5b8b63a62a52ae1bd3e4c Author: Thomas Zimmermann Date: Fri Apr 28 14:24:37 2023 +0200 fbdev/arcfb: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-5-tzimmermann@suse.de commit cb18dfa930acaced019bfb8b9f1b5be0b66ded96 Author: Thomas Zimmermann Date: Fri Apr 28 14:24:36 2023 +0200 hid/hid-picolcd_fb: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-4-tzimmermann@suse.de commit 029cd092f23fb1b372adf8697be1846a1df0492d Author: Thomas Zimmermann Date: Fri Apr 28 14:24:35 2023 +0200 auxdisplay/ht16k33: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-3-tzimmermann@suse.de commit 11f373c3c1ef04faadcdf6abfcc403b65a20412e Author: Thomas Zimmermann Date: Fri Apr 28 14:24:34 2023 +0200 auxdisplay/cfag12864bfb: Use struct fb_info.screen_buffer Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-2-tzimmermann@suse.de commit dd69654cd32acad1a32d8e1c7b085a34db9d47e5 Merge: 97a03a9b93611 b5762d95607e7 Author: Mark Brown Date: Mon May 8 22:25:26 2023 +0900 spi: Add DMA mode support to spi-qcom-qspi Merge series from Vijaya Krishna Nivarthi : There are large number of QSPI irqs that fire during boot/init and later on every suspend/resume. This could be made faster by doing DMA instead of PIO. Below is comparison for number of interrupts raised in 2 scenarios... Boot up and stabilise Suspend/Resume Sequence PIO DMA ======================= Boot-up 69088 19284 S/R 5066 3430 Speed test results... spi-nor read times in sec after 2 min uptime ============================================ PIO - Iterations-1000, min=3.18, max=3.74, avg=3.53 DMA - Iterations-1000, min=1.21, max=2.28, avg=1.79 spi-nor write times in sec after 2 min uptime ============================================= PIO - Iterations-1000, min=3.20, max=8.24, avg=3.58 DMA - Iterations-1000, min=1.25, max=5.13, avg=1.82 Further testing performed... a) multiple entries in sgt (simulated by max_dma_len = 1024) b) fallback to pio (simulated by dma setup failure) commit 0f88130e8a6fd185b0aeb5d8e286083735f2585a Author: Juergen Gross Date: Mon Mar 6 13:32:59 2023 +0100 x86/mm: Fix __swp_entry_to_pte() for Xen PV guests Normally __swp_entry_to_pte() is never called with a value translating to a valid PTE. The only known exception is pte_swap_tests(), resulting in a WARN splat in Xen PV guests, as __pte_to_swp_entry() did translate the PFN of the valid PTE to a guest local PFN, while __swp_entry_to_pte() doesn't do the opposite translation. Fix that by using __pte() in __swp_entry_to_pte() instead of open coding the native variant of it. For correctness do the similar conversion for __swp_entry_to_pmd(). Fixes: 05289402d717 ("mm/debug_vm_pgtable: add tests validating arch helpers for core MM features") Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230306123259.12461-1-jgross@suse.com commit 97a03a9b9361108bbd82446661367e0082a68518 Merge: 5fd7c99ecf45c 1ee806718d5ef Author: Mark Brown Date: Mon May 8 22:25:20 2023 +0900 Improve polling mode of s3c64xx driver Merge series from Jaewon Kim : Previously, polling mode was supported as quirk for SOC without DMA. In order to use it more flexibly, it is supported when there is no dmas property in devicetree, and the issue of using excessive CPU usage in polling mode is solved by adding sleep during transfer time and supporting interrupt mode. Changes in V3. - Fix patch commit message. - Change of_find_property() to of_property_present() with code cleanup - Remove cpu_relax() related patch. - Changes use_irq variable type to bool Changes in V2. - Switched to polling mode if there is no dmas property in devicetree. - Add cpu_releax() in polling loop - Add lower limit in IRQ mode Jaewon Kim (3): spi: s3c64xx: change polling mode to optional spi: s3c64xx: add sleep during transfer spi: s3c64xx: support interrupt based pio mode drivers/spi/spi-s3c64xx.c | 81 +++++++++++++++++++---- include/linux/platform_data/spi-s3c64xx.h | 1 + 2 files changed, 70 insertions(+), 12 deletions(-) -- 2.17.1 commit a4bb75c4f19db711676e6bf6a278d932a5e7667b Author: Jaroslav Kysela Date: Tue May 2 13:55:36 2023 +0200 ALSA: uapi: pcm: control the filling of the silence samples for drain Introduce SNDRV_PCM_INFO_PERFECT_DRAIN and SNDRV_PCM_HW_PARAMS_NO_DRAIN_SILENCE flags to fully control the filling of the silence samples in the drain ioctl. Actually, the configurable silencing is going to be implemented in the user space [1], but drivers (hardware) may not require this operation. Those flags do the bidirectional setup for this operation: 1) driver may notify the presence of the perfect drain 2) user space may not require the filling of the silence samples to inhibit clicks If we decide to move this operation to the kernel space in future, the SNDRV_PCM_INFO_PERFECT_DRAIN flag may handle this situation without double "silence" processing (user + kernel space). The ALSA API should be universal, so forcing the behaviour (modifying of the ring buffer with any samples) for the drain operation is not ideal. [1] https://lore.kernel.org/alsa-devel/20230502115010.986325-1-perex@perex.cz/ [ fixed a typo in comment by tiwai ] Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230502115536.986900-1-perex@perex.cz Signed-off-by: Takashi Iwai commit 32fe18d0340d88e8ab6e5ecf57211276b9ac39bf Author: Hans de Goede Date: Sat Apr 15 18:07:34 2023 +0200 power: supply: twl4030_madc_battery: Refactor twl4030_madc_bat_ext_changed() twl4030_madc_bat_ext_changed() is a wrapper around "power_supply_changed(psy);" and it has the same prototype. Remove it, replacing it with making the external_power_changed callback directly point to power_supply_changed. Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 1269774ac3c8b5845ce12cb686165f3e4850b91e Author: Hans de Goede Date: Sat Apr 15 18:07:33 2023 +0200 power: supply: max17042_battery: Refactor max17042_external_power_changed() max17042_external_power_changed() is a wrapper around "power_supply_changed(psy);" and it has the same prototype. Remove it, replacing it with making the external_power_changed callback directly point to power_supply_changed. Cc: Marek Szyprowski Cc: Sebastian Krzyszkowiak Cc: Purism Kernel Team Signed-off-by: Hans de Goede Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel commit 5aaa12873d9b610a052bafea5d4c8593ad66e390 Author: Maíra Canal Date: Tue Apr 18 10:05:26 2023 -0300 drm/vkms: drop "Rotation" TODO Now that VKMS supports all values of rotation and reflection, drop the "Rotation" task from the TODO list. Signed-off-by: Maíra Canal Reviewed-by: Melissa Wen Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230418130525.128733-7-mcanal@igalia.com commit cd0755508d81736d026bc25647a89dfc79162d95 Author: Maíra Canal Date: Tue Apr 18 10:05:25 2023 -0300 drm/vkms: add rotate-270 property Currently, vkms supports the rotate-90, rotate-180, reflect-x and reflect-y properties. Therefore, improve the vkms IGT test coverage by adding the rotate-270 property to vkms. The rotation was implement by software: rotate the way the blending occurs by making the source x axis be the destination y axis and the source y axis be the destination x axis and reverse-read the axis. Now, vkms supports all possible rotation values. Tested with igt@kms_rotation_crc@primary-rotation-270 [1], and igt@kms_rotation_crc@sprite-rotation-270 [1]. [1] https://patchwork.freedesktop.org/series/116025/ Signed-off-by: Maíra Canal Reviewed-by: Melissa Wen Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230418130525.128733-6-mcanal@igalia.com commit cf7f8c671c830302bd382ac640591ee3d6381ad3 Author: Maíra Canal Date: Tue Apr 18 10:05:24 2023 -0300 drm/vkms: add rotate-90 property Currently, vkms only supports the rotate-180, reflect-x and reflect-y properties. Therefore, improve the vkms IGT test coverage by adding the rotate-90 property to vkms. The rotation was implement by software: rotate the way the blending occurs by making the source x axis be the destination y axis and the source y axis be the destination x axis. Tested with igt@kms_rotation_crc@primary-rotation-90 [1], igt@kms_rotation_crc@sprite-rotation-90 [1], and igt@kms_rotation_crc@sprite-rotation-90-pos-100-0 [1]. [1] https://patchwork.freedesktop.org/series/116025/ Signed-off-by: Maíra Canal Reviewed-by: Melissa Wen Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230418130525.128733-5-mcanal@igalia.com commit 1ce76fae2bc14dd776b0c237456d8bd117c0e617 Author: Maíra Canal Date: Tue Apr 18 10:05:23 2023 -0300 drm/vkms: add reflect-y and rotate-180 property Currently, vkms only supports the reflect-x property. Therefore, add the reflect-y property to vkms through a software implementation of the operation. This is possible by reverse reading the y axis during the blending. Note that, by implementing the reflect-x and reflect-y properties, it is also possible to add the rotate-180 property, as it is a combination of those two properties. Tested with igt@kms_rotation_crc@primary-reflect-y [1], igt@kms_rotation_crc@sprite-reflect-y [1], igt@kms_rotation_crc@primary-rotation-180, igt@kms_rotation_crc@sprite-rotation-180, and igt@kms_rotation_crc@cursor-rotation-180. [1] https://patchwork.freedesktop.org/series/116025/ Signed-off-by: Maíra Canal Reviewed-by: Melissa Wen Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230418130525.128733-4-mcanal@igalia.com commit 4a9820343579f65635500d9f9b268ec6d07496e0 Author: Maíra Canal Date: Tue Apr 18 10:05:22 2023 -0300 drm/vkms: add rotate-0 and reflect-x property Currently, vkms doesn't support any reflection property. Therefore, add the reflect-x property to vkms through a software implementation of the operation. This is possible by reverse reading the x axis during the blending. Tested with igt@kms_rotation_crc@primary-reflect-x [1] and igt@kms_rotation_crc@sprite-reflect-x [1]. [1] https://patchwork.freedesktop.org/series/116025/ Signed-off-by: Maíra Canal Reviewed-by: Melissa Wen Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230418130525.128733-3-mcanal@igalia.com commit 3cc52437d93c52b4ac26ed0467a9bd89106a9675 Author: Christophe JAILLET Date: Sat Apr 15 18:49:55 2023 +0200 power: supply: rk817: Simplify an error message dev_err_probe() already display the error code. There is no need to duplicate it explicitly in the error message. Signed-off-by: Christophe JAILLET Signed-off-by: Sebastian Reichel commit aafbf04f958df9d65551946da450f05e2536c45a Author: Uwe Kleine-König Date: Fri Apr 14 19:12:35 2023 +0200 power: reset: gpio-restart: Convert to platform remove callback returning void Returning an error code from a remove callback makes the driver core emit a generic (and so little helpful) error message and after that the error code is ignored and the device unbound. As gpio_restart_remove() already emits an error message, suppressing the generic error is no loss. Then convert to .remove_new() which is equivalent to returning 0 unconditionally in .remove(). See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for its rational. Signed-off-by: Uwe Kleine-König Signed-off-by: Sebastian Reichel commit e281d5cad1f3924edf1042441b98c25204ae0def Author: Nathan Fontenot Date: Tue May 2 12:42:32 2023 -0500 x86/microcode/amd: Remove unneeded pointer arithmetic Remove unneeded pointer increment arithmetic, the pointer is set at the beginning of the loop. Signed-off-by: Nathan Fontenot Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230502174232.73880-1-nathan.fontenot@amd.com commit 0262fa16660e9563bb51dc9a0aefa5091628f821 Author: Bartosz Golaszewski Date: Mon Apr 17 16:55:35 2023 +0200 dt-bindings: power: reset: convert nvmem-reboot-mode bindings to YAML Convert the DT binding document for nvmem-reboot-mode from .txt to YAML. Signed-off-by: Bartosz Golaszewski Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel commit 97dd69b1ade166f3200546e5fb7984986cafcf81 Author: Daisuke Nojiri Date: Mon Apr 17 15:16:10 2023 -0700 power: supply: cros_pchg: Sync port status on resume When a stylus is removed (or attached) during suspend, the device detach (or attach) events can be lost. This patch makes the peripheral device charge driver retrieve the latest status from the EC on resume. BUG=b:276414488 TEST=Redrix Signed-off-by: Daisuke Nojiri Signed-off-by: Sebastian Reichel commit d41dab4c031edaa460a484113394327aa52dc0bd Author: Konrad Dybcio Date: Wed Apr 19 12:41:06 2023 +0200 dt-bindings: power: reset: qcom-pon: Only allow reboot-mode pre-pmk8350 As pointed out by Shazad [1], PMICs using a separate HLOS+PBS scheme (so PMK8350 and newer) are expected to pass reboot mode data through SDAM, as the reboot mode registers are absent in the HLOS reg space. Limit the reboot-mode.yaml inclusion to PMICs without a separate PBS region. [1] https://lore.kernel.org/linux-arm-msm/12f13183-c381-25f7-459e-62e0c2b19498@quicinc.com/ Fixes: 03fccdc76dce ("dt-bindings: power: reset: qcom-pon: Add new compatible "qcom,pmk8350-pon"") Signed-off-by: Konrad Dybcio Acked-by: Rob Herring Signed-off-by: Sebastian Reichel commit 37a19366e10b95380bf33e7a8b02509980399d7e Author: Borislav Petkov (AMD) Date: Mon Feb 27 17:03:52 2023 +0100 x86/microcode/AMD: Get rid of __find_equiv_id() Merge it into its only call site. No functional changes. Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230227160352.7260-1-bp@alien8.de commit 131c0c768266f8ace220d87e2889a5bb063c8160 Author: Hermes Zhang Date: Thu May 4 17:30:37 2023 +0800 power: supply: bq256xx: Apply TS_IGNORE from devicetree TS_IGNORE is default off in bq256xx chip. For some HW which doesn't have the NTC, we need to set TS_IGNORE to 1 to make the charge work. The new "ti,no-thermistor" is introduced to toggle it. Signed-off-by: Hermes Zhang Signed-off-by: Sebastian Reichel commit da8a240f51e2f3ce4d77719f21904a1ca05cb721 Author: Hermes Zhang Date: Thu May 4 17:30:36 2023 +0800 dt-bindings: power: supply: bq256xx: Add ti,no-thermistor property Add a new property ti,no-thermistor to indicate that no thermistor is connected to the TS pin of the chip. Signed-off-by: Hermes Zhang Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel commit 44ef1604ae9492a7d9238ea79aa0cc7b4c4de860 Merge: 79c67c54f64cc fcb405111a24c Author: Martin K. Petersen Date: Mon May 8 07:56:37 2023 -0400 Merge patch series "smartpqi updates" Don Brace says: These patches are based on Martin Petersen's 6.4/scsi-queue tree https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 6.4/scsi-queue This set of changes consists of: * Map entire BAR 0. The driver was mapping up to and including the controller registers, but not all of BAR 0. * Add PCI IDs to support new controllers. * Clean up some code by removing unnecessary NULL checks. This cleanup is a result of a Coverity report. * Correct a rare memory leak whenever pqi_sas_port_add_rhpy() returns an error. This was Suggested by: Yang Yingliang * Remove atomic operations on variable raid_bypass_cnt. Accuracy is not required for driver operation. Change type from atomic_t to unsigned int. * Correct a rare drive hot-plug removal issue where we get a NULL io_request. We added a check for this condition. * Turn on NCQ priority for AIO requests to disks comprising RAID devices. * Correct byte aligned writew() operations on some ARM servers. Changed the writew() to two writeb() operations. * Change how the driver checks for a sanitize operation in progress. We were using TEST UNIT READY. We removed the TEST UNIT READY code and are now using the controller's firmware information in order to avoid issues caused by drives failing to complete TEST UNIT READY. * Some customers have been requesting that we add the NUMA node to /sys/block/sd/device like the nvme driver does. * Update the copyright information to match the current year. * Bump the driver version to 2.1.22-040. Link: https://lore.kernel.org/r/20230428153712.297638-1-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 79c67c54f64ccae5b0a302f6ec67a6b7b8a55b24 Merge: 44fcce673561e 14a8f116cdc0c Author: Martin K. Petersen Date: Mon May 8 07:55:25 2023 -0400 Merge patch series "scsi: pm80xx: Enhanced debug logs for HW events" Pranav Prasad says: This patch series enhances debug logs for pm80xx HW events, and provides a minor fix in the case of a hard reset. The log enhancement involves changing the log severity level to enable logging for HW events which consequently help debug disk discovery issues. 1. Changed log severity level from MSG to EVENT for HW events. Enhanced the HW event logs by adding the phyid. 2. Enabled INIT logging. 3. Log portid along with the PHY_UP event. 4. Print phyid and portid sent as part of device registration request. 5. Log port state during HW events. 6. Update phy_state and phy_attached to correct values after a hard reset. Link: https://lore.kernel.org/r/20230418190101.696345-1-pranavpp@google.com Signed-off-by: Martin K. Petersen commit 44fcce673561ebd02014125c5cb37649d7b053d0 Merge: 92d685a96bb05 cf3cd61e76607 Author: Martin K. Petersen Date: Mon May 8 07:54:31 2023 -0400 Merge patch series "scsi: libsas: remove empty branches and code simplification" Jason Yan says: Three patches to remove two empty branches and a little code simplification. Link: https://lore.kernel.org/r/20230421093744.1583609-1-yanaijie@huawei.com Signed-off-by: Martin K. Petersen commit 92d685a96bb054ebf44360d38dc94fc17a9ba34a Merge: 808e87a5119ba eb91eb809c8df Author: Martin K. Petersen Date: Mon May 8 07:52:50 2023 -0400 Merge patch series "qla2xxx driver update" Nilesh Javali says: Please apply the qla2xxx driver enhancement and bug fixes to the scsi tree at your earliest convenience. Link: https://lore.kernel.org/r/20230428075339.32551-1-njavali@marvell.com Signed-off-by: Martin K. Petersen commit 808e87a5119ba7dab6b1b6ccb5120262fa9f28fb Merge: 19c9322e36a0c fd9ffa6c747f8 Author: Martin K. Petersen Date: Mon May 8 07:51:05 2023 -0400 Merge patch series "lpfc: Update lpfc to revision 14.2.0.12" Justin Tee says: Update lpfc to revision 14.2.0.12 This patch set contains fixes flagged by code analyzer tools, introduces a new CQE status to handle DMA errors, and replaces the usage of blk interrupts with threaded interrupts. The patches were cut against Martin's 6.4/scsi-queue tree. Link: https://lore.kernel.org/r/20230417191558.83100-1-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 7a503071e06db4409b7066b8ecca9f3da03dd3b1 Author: Daniel Machon Date: Mon Apr 17 20:03:35 2023 +0200 phy: sparx5-serdes: add skip_cmu_cfg check when configuring lanes Add a check for skip_cmu_cfg when configuring the serdes lane. All individual serdeses are reset upon first configuration. Resetting the serdes involves reconfiguring it with preset values. The serdesmode is required to determine the clock-providing CMU, therefore make sure the serdes is not reconfigured if the serdesmode is not set. Signed-off-by: Daniel Machon Link: https://lore.kernel.org/r/20230417180335.2787494-8-daniel.machon@microchip.com Signed-off-by: Vinod Koul commit 2db7289f59987a97160f8fadfe5aaece325f610b Author: Daniel Machon Date: Mon Apr 17 20:03:34 2023 +0200 phy: sparx5-serdes: remove power up of all CMUs CMUs should not be powered up by default anymore, so remove responsible code. Signed-off-by: Daniel Machon Link: https://lore.kernel.org/r/20230417180335.2787494-7-daniel.machon@microchip.com Signed-off-by: Vinod Koul commit 96bb1664257c7d7507c7b324a952603e2b0a625e Author: Daniel Machon Date: Mon Apr 17 20:03:33 2023 +0200 phy: sparx5-serdes: power on CMUs individually Power on the CMU instance, that provides the clock for the serdes, given the specified serdes mode and index. The CMU instance is looked up, using a preset map of serdes mode and index to CMU index. Signed-off-by: Daniel Machon Link: https://lore.kernel.org/r/20230417180335.2787494-6-daniel.machon@microchip.com Signed-off-by: Vinod Koul commit 044f3a1a8d331ef1a96a8445cafb8a23376cbf52 Author: Daniel Machon Date: Mon Apr 17 20:03:32 2023 +0200 phy: sparx5-serdes: power down all CMUs by default All CMUs are powered up initially. This uses needless power. This patch makes sure all CMUs are powered down by default. This involves configuring a number reference clock and power-down registers of the CMU. Individual CMUs are later powered up, when the serdes lanes are configured. Signed-off-by: Daniel Machon Link: https://lore.kernel.org/r/20230417180335.2787494-5-daniel.machon@microchip.com Signed-off-by: Vinod Koul commit 238a583fe42de3ba4baae3c03dd8c7da902fea44 Author: Daniel Machon Date: Mon Apr 17 20:03:31 2023 +0200 phy: sparx5-serdes: reorder CMU functions Reorder CMU functions, as some of them are now required by the serdes functions. No functional changes. Signed-off-by: Daniel Machon Link: https://lore.kernel.org/r/20230417180335.2787494-4-daniel.machon@microchip.com Signed-off-by: Vinod Koul commit 3d61a1f83effc3a7f2238d389e06f00110f0acdc Author: Daniel Machon Date: Mon Apr 17 20:03:30 2023 +0200 phy: sparx5-serdes: configure optimal quiet mode for serdes lanes All the serdes lanes of the sparx5 will transition between normal mode and quiet mode, depending on activity. Make sure that the quiet mode is configured optimally for all lanes initially. Although not much, this will save a small amount of power. Signed-off-by: Daniel Machon Link: https://lore.kernel.org/r/20230417180335.2787494-3-daniel.machon@microchip.com Signed-off-by: Vinod Koul commit 86c2cfb1ab556a1cb35a9f64a38d6f5c8a46ebde Author: Daniel Machon Date: Mon Apr 17 20:03:29 2023 +0200 phy: sparx5-serdes: add registers required for SD/CMU power down Add registers required to configure serdeses and CMUs for initial power down. Signed-off-by: Daniel Machon Link: https://lore.kernel.org/r/20230417180335.2787494-2-daniel.machon@microchip.com Signed-off-by: Vinod Koul commit 72a5ce33b8d17a6646be0e0573eb7cc5fed76e06 Author: Swapnil Jakhade Date: Tue Apr 18 19:31:57 2023 +0200 phy: cadence-torrent: Add USB + DP multilink configuration Add USB + DP no SSC multilink configuration sequences. Signed-off-by: Swapnil Jakhade Link: https://lore.kernel.org/r/20230418173157.25607-5-sjakhade@cadence.com Signed-off-by: Vinod Koul commit ede775a87bee11a8ef9181c5769dd44938e7f54f Author: Swapnil Jakhade Date: Tue Apr 18 19:31:56 2023 +0200 phy: cadence-torrent: Add PCIe + DP multilink configuration for 100MHz refclk Add multilink DP configuration support for 100MHz reference clock rate. This is the only clock rate supported currently for multilink PHY configurations. Also, add PCIe + DP multiprotocol multilink register configuration sequences for 100MHz refclk with no SSC. Signed-off-by: Swapnil Jakhade Link: https://lore.kernel.org/r/20230418173157.25607-4-sjakhade@cadence.com Signed-off-by: Vinod Koul commit c756cc1621efa911bc54ae2aa3651564fa94e0da Author: Swapnil Jakhade Date: Tue Apr 18 19:31:55 2023 +0200 phy: cadence-torrent: Prepare driver for multilink DP support This patch prepares driver for multilink DP support as well as for multiprotocol PHY configurations involving DP as one of the required protocols. This needs changes in functions configuring default single link DP with master lane 0 to support non-zero master lane values and associated PLL configurations. Signed-off-by: Swapnil Jakhade Link: https://lore.kernel.org/r/20230418173157.25607-3-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 1b0524fc2137be74702ac1c7a71e82631a9e0681 Author: Swapnil Jakhade Date: Tue Apr 18 19:31:54 2023 +0200 phy: cadence-torrent: Add function to get PLL to be configured for DP Torrent PHY PLL0 or PLL1 is used for DP depending on the single link or multilink protocol configuration for which PHY is configured. In multilink configurations with other protocols, either PLL0 or PLL1 will be used for DP. For single link DP, both PLLs need to be configured at POR. Signed-off-by: Swapnil Jakhade Link: https://lore.kernel.org/r/20230418173157.25607-2-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 19c9322e36a0c8726b901d6c8adb7c9d785da393 Author: Dan Carpenter Date: Wed May 3 13:40:59 2023 +0300 scsi: ufs: ufs-mediatek: Delete some dead code There is already a test for "if (val == state)" earlier so it's not possible here. Delete the dead code. Fixes: 9006e3986f66 ("scsi: ufs-mediatek: Do not gate clocks if auto-hibern8 is not entered yet") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/68fce64f-4970-45f1-807e-6c0eecdfcdc2@kili.mountain Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Stanley Chu Signed-off-by: Martin K. Petersen commit f025312b089474a54e4859f3453771314d9e3d4f Author: Jinhong Zhu Date: Tue May 2 22:00:21 2023 +0800 scsi: qedf: Fix NULL dereference in error handling Smatch reported: drivers/scsi/qedf/qedf_main.c:3056 qedf_alloc_global_queues() warn: missing unwind goto? At this point in the function, nothing has been allocated so we can return directly. In particular the "qedf->global_queues" have not been allocated so calling qedf_free_global_queues() will lead to a NULL dereference when we check if (!gl[i]) and "gl" is NULL. Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.") Signed-off-by: Jinhong Zhu Link: https://lore.kernel.org/r/20230502140022.2852-1-jinhongzhu@hust.edu.cn Reviewed-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 9a4327fd8864ff78d97e9a3c3c3c992353d06fee Author: Keoseong Park Date: Thu Apr 27 18:44:20 2023 +0900 scsi: ufs: core: Change the module parameter macro of use_mcq_mode mcq_mode_ops uses only param_{set,get}_bool(). Therefore, convert module_param_cb() to module_param() and remove the mcq_mode_ops. Signed-off-by: Keoseong Park Link: https://lore.kernel.org/r/20230427094420epcms2p1043333a3e0c0cf58e66164e0b83b3b02@epcms2p1 Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 2a954832015df3dc4266f73bed1b3c8b4cb9919b Author: Harshit Mogalapalli Date: Tue Apr 18 23:42:56 2023 -0700 scsi: mpi3mr: Use -ENOMEM instead of -1 in mpi3mr_expander_add() smatch warnings: drivers/scsi/mpi3mr/mpi3mr_transport.c:1449 mpi3mr_expander_add() warn: returning -1 instead of -ENOMEM is sloppy No functional change. Reported-by: kernel test robot Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/202303202027.ZeDQE5Ug-lkp@intel.com/ Signed-off-by: Harshit Mogalapalli Link: https://lore.kernel.org/r/20230419064256.2532069-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Martin K. Petersen commit fcb405111a24cf9fc0dcd09f47bcd5f0968c4a9d Author: Don Brace Date: Fri Apr 28 10:37:12 2023 -0500 scsi: smartpqi: Update version to 2.1.22-040 Reviewed-by: Gerry Morong Reviewed-by: Scott Benesh Reviewed-by: Mike McGowen Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-13-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 49fd52d4991f431bc2e68cd5682a7c7496fb3783 Author: Don Brace Date: Fri Apr 28 10:37:11 2023 -0500 scsi: smartpqi: Update copyright to 2023 Update copyright to current year. Reviewed-by: Scott Benesh Reviewed-by: Mike McGowen Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-12-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit d2c7583f27cc138354a1cd3c990923de7fd2126a Author: Don Brace Date: Fri Apr 28 10:37:10 2023 -0500 scsi: smartpqi: Add sysfs entry for NUMA node in /sys/block/sdX/device Although NUMA node is a PCIe device level attribute, it was requested the NUMA node be added for each exposed device similar to NVMe disks. Example for NVMe: /sys/block/nvme1c1n1/device/numa_node Example for smartpqi: /sys/block/sdh/device/numa_node cat /sys/block/sdh/device/numa_node 0 Reviewed-by: David Strahan Reviewed-by: Mike McGowen Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-11-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 2eddf98d01520d6bcd7d5a703a85206ba84bd179 Author: Kevin Barnett Date: Fri Apr 28 10:37:09 2023 -0500 scsi: smartpqi: Stop sending driver-initiated TURs Stop sending driver-initiated TURs to physical devices during driver load/rescan. Note: This does not affect SML initiated TURs. Some Linux kernels can cause lengthy delays in OS boot if the kernel detects that a drive is being sanitized/erased. We were using TURs to detect if a sanitize/erase was in progress. Some devices do not return the TUR in a timely manner, causing driver load/rescan stalls. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Mike McGowen Signed-off-by: Kevin Barnett Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-10-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit c23efd9eadd8d07c0e88b52296d9f74350e7af7f Author: Don Brace Date: Fri Apr 28 10:37:08 2023 -0500 scsi: smartpqi: Fix byte aligned writew for ARM servers Correct OOPs on ARM servers during driver init. The driver attempts to update FW with max_feature_supported value using a writew() kernel call using a byte aligned address. This fails on some ARM systems. Change the writew() to two writeb() calls to update this value. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Mike McGowen Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-9-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 68f7920492be3d193d31b5a6b97e8501d2306b17 Author: Gilbert Wu Date: Fri Apr 28 10:37:07 2023 -0500 scsi: smartpqi: Add support for RAID NCQ priority Enable NCQ priority feature for the RAID path when AIO path is disabled. Move function pqi_is_io_high_priority() up to avoid adding a prototype. Remove unused argument ctrl_info. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Mike McGowen Reviewed-by: Kevin Barnett Signed-off-by: Gilbert Wu Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-8-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 5c9e3c1c5276cf1f0de47f97eddf48ae1e7fd083 Author: Murthy Bhat Date: Fri Apr 28 10:37:06 2023 -0500 scsi: smartpqi: Validate block layer host tag Prevent OS crashes when a drive is hot removed during I/O stress test. The I/O request pointer can be invalid if block layer provides incorrect multi-queue host tag. This can lead to invalid I/O request pointer dereference. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Mike McGowen Reviewed-by: Kevin Barnett Signed-off-by: Murthy Bhat Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-7-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 80d560d94fa9b28069c62e1a64ae4a03d5f43fbc Author: Mike McGowen Date: Fri Apr 28 10:37:05 2023 -0500 scsi: smartpqi: Remove contention for raid_bypass_cnt Reduce CPU contention when incrementing variable raid_bypass_cnt. Remove the atomic operations for this variable by changing the atomic to an unsigned int and replace atomic operations with standard operations. The value is only checked that it is increasing and accuracy is not required. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Mike McGowen Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-6-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 2312e844dc8d5fd66f179baa3d848d2613e4f81f Author: Don Brace Date: Fri Apr 28 10:37:04 2023 -0500 scsi: smartpqi: Fix rare SAS transport memory leak Free rphy when pqi_sas_port_add_rphy() returns an error. If pqi_sas_port_add_rphy() returns an error, the 'rphy' allocated in sas_end_device_alloc() needs to be freed. It should be noted that no issues were ever reported. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Mike McGowen Reviewed-by: Kevin Barnett Suggested-by: Yang Yingliang Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-5-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 889cda36db99e3ef0c9a6d2e6c64de725913394b Author: Kevin Barnett Date: Fri Apr 28 10:37:03 2023 -0500 scsi: smartpqi: Remove NULL pointer check Remove an unnecessary check for a NULL pointer. This unnecessary check was flagged by Coverity. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Mike McGowen Signed-off-by: Kevin Barnett Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-4-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit fe0375d48513ce0e3d98dbcec5508e1dd09dc5b2 Author: David Strahan Date: Fri Apr 28 10:37:02 2023 -0500 scsi: smartpqi: Add new controller PCI IDs All PCI ID entries in Hex. Add PCI IDs for ZTE controllers: VID / DID / SVID / SDID ---- ---- ---- ---- ZTE SmartROC3200 RS344-16i 4G 9005 / 028f / 1cf2 / 0804 ZTE SmartROC3200 RS345-16i 8G 9005 / 028f / 1cf2 / 0805 ZTE SmartIOC2200 RS346-16i 9005 / 028f / 1cf2 / 0806 ZTE SmartROC3200 RM344-16i 4G 9005 / 028f / 1cf2 / 54da ZTE SmartROC3200 RM345-16i 8G 9005 / 028f / 1cf2 / 54db ZTE SmartIOC2200 RM346-16i 9005 / 028f / 1cf2 / 54dc Add PCI IDs for ByteDance controllers: VID / DID / SVID / SDID ---- ---- ---- ---- ByteHBA JGH43014-8 9005 / 028f / 1e93 / 1005 Add PCI IDs for IBM controllers: VID / DID / SVID / SDID ---- ---- ---- ---- IBM 4-Port 24G SAS 9005 / 028f / 1014 / 0718 Add PCI IDs for Cloudnine controllers: VID / DID / SVID / SDID ---- ---- ---- ---- SmartHBA P6600-8i 9005 / 028f / 1f51 / 1001 SmartRAID P7604-8i 9005 / 028f / 1f51 / 1002 SmartHBA P6600-8e 9005 / 028f / 1f51 / 1003 SmartRAID P7604-8e 9005 / 028f / 1f51 / 1004 SmartHBA P6600-16i 9005 / 028f / 1f51 / 1005 SmartRAID P7608-16i 9005 / 028f / 1f51 / 1006 SmartHBA P6600-8i8e 9005 / 028f / 1f51 / 1007 SmartRAID P7608-8i8e 9005 / 028f / 1f51 / 1008 SmartHBA P6600-16e 9005 / 028f / 1f51 / 1009 SmartRAID P7608-16e 9005 / 028f / 1f51 / 100a Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Reviewed-by: Mike McGowen Signed-off-by: David Strahan Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-3-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 3e7e55aa3df2d58b1d27e3380d293da525cf5a3b Author: Mike McGowen Date: Fri Apr 28 10:37:01 2023 -0500 scsi: smartpqi: Map full length of PCI BAR 0 Map full length of PCI BAR 0 at driver init. During driver initialization, the driver must make a kernel call to map the controller registers into kernel address space. A parameter to this call is the length of the memory to be mapped. The driver was specifying the wrong length. Reviewed-by: Scott Benesh Reviewed-by: Kevin Barnett Signed-off-by: Mike McGowen Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20230428153712.297638-2-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit eb91eb809c8dfe7a7cc7aedd0670cdc2bb1174b9 Author: Nilesh Javali Date: Fri Apr 28 00:53:39 2023 -0700 scsi: qla2xxx: Update version to 10.02.08.300-k Update version to 10.02.08.300-k. Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230428075339.32551-8-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit fc0cba0c7be8261a1625098bd1d695077ec621c9 Author: Quinn Tran Date: Fri Apr 28 00:53:38 2023 -0700 scsi: qla2xxx: Wait for io return on terminate rport System crash due to use after free. Current code allows terminate_rport_io to exit before making sure all IOs has returned. For FCP-2 device, IO's can hang on in HW because driver has not tear down the session in FW at first sign of cable pull. When dev_loss_tmo timer pops, terminate_rport_io is called and upper layer is about to free various resources. Terminate_rport_io trigger qla to do the final cleanup, but the cleanup might not be fast enough where it leave qla still holding on to the same resource. Wait for IO's to return to upper layer before resources are freed. Cc: stable@vger.kernel.org Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230428075339.32551-7-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit b843adde8d490934d042fbe9e3e46697cb3a64d2 Author: Quinn Tran Date: Fri Apr 28 00:53:37 2023 -0700 scsi: qla2xxx: Fix mem access after free System crash, where driver is accessing scsi layer's memory (scsi_cmnd->device->host) to search for a well known internal pointer (vha). The scsi_cmnd was released back to upper layer which could be freed, but the driver is still accessing it. 7 [ffffa8e8d2c3f8d0] page_fault at ffffffff86c010fe [exception RIP: __qla2x00_eh_wait_for_pending_commands+240] RIP: ffffffffc0642350 RSP: ffffa8e8d2c3f988 RFLAGS: 00010286 RAX: 0000000000000165 RBX: 0000000000000002 RCX: 00000000000036d8 RDX: 0000000000000000 RSI: ffff9c5c56535188 RDI: 0000000000000286 RBP: ffff9c5bf7aa4a58 R8: ffff9c589aecdb70 R9: 00000000000003d1 R10: 0000000000000001 R11: 0000000000380000 R12: ffff9c5c5392bc78 R13: ffff9c57044ff5c0 R14: ffff9c56b5a3aa00 R15: 00000000000006db ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 8 [ffffa8e8d2c3f9c8] qla2x00_eh_wait_for_pending_commands at ffffffffc0646dd5 [qla2xxx] 9 [ffffa8e8d2c3fa00] __qla2x00_async_tm_cmd at ffffffffc0658094 [qla2xxx] Remove access of freed memory. Currently the driver was checking to see if scsi_done was called by seeing if the sp->type has changed. Instead, check to see if the command has left the oustanding_cmds[] array as sign of scsi_done was called. Cc: stable@vger.kernel.org Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230428075339.32551-6-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 9ae615c5bfd37bd091772969b1153de5335ea986 Author: Quinn Tran Date: Fri Apr 28 00:53:36 2023 -0700 scsi: qla2xxx: Fix hang in task management Task management command hangs where a side band chip reset failed to nudge the TMF from it's current send path. Add additional error check to block TMF from entering during chip reset and along the TMF path to cause it to bail out, skip over abort of marker. Cc: stable@vger.kernel.org Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230428075339.32551-5-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 6a87679626b51b53fbb6be417ad8eb083030b617 Author: Quinn Tran Date: Fri Apr 28 00:53:35 2023 -0700 scsi: qla2xxx: Fix task management cmd fail due to unavailable resource Task management command failed with status 2Ch which is a result of too many task management commands sent to the same target. Hence limit task management commands to 8 per target. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304271952.NKNmoFzv-lkp@intel.com/ Cc: stable@vger.kernel.org Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230428075339.32551-4-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 9803fb5d27597ea98f2e05b0b6cfc48ae808458e Author: Quinn Tran Date: Fri Apr 28 00:53:34 2023 -0700 scsi: qla2xxx: Fix task management cmd failure Task management cmd failed with status 30h which means FW is not able to finish processing one task management before another task management for the same lun. Hence add wait for completion of marker to space it out. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304271802.uCZfwQC1-lkp@intel.com/ Cc: stable@vger.kernel.org Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230428075339.32551-3-njavali@marvell.com Reviewed-by: Himanshu Madhani > Signed-off-by: Martin K. Petersen commit d90171dd0da50212f5950cc708240831e82f2f91 Author: Quinn Tran Date: Fri Apr 28 00:53:33 2023 -0700 scsi: qla2xxx: Multi-que support for TMF Add queue flush for task management command, before placing it on the wire. Do IO flush for all Request Q's. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304271702.GpIL391S-lkp@intel.com/ Cc: stable@vger.kernel.org Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20230428075339.32551-2-njavali@marvell.com Reviewed-by: Himanshu Madhani > Signed-off-by: Martin K. Petersen commit cf3cd61e76607801081adc35ae288b90921e6097 Author: Jason Yan Date: Fri Apr 21 17:37:44 2023 +0800 scsi: libsas: factor out sas_check_fanout_expander_topo() To be consistent with sas_check_edge_expander_topo(), factor out sas_check_fanout_expander_topo(). And remove the comment since we are not spilling over 80 colums now. Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20230421093744.1583609-4-yanaijie@huawei.com Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit ba9be7e70e15dd75375131826f4b8a484efec4d0 Author: Jason Yan Date: Fri Apr 21 17:37:43 2023 +0800 scsi: libsas: Remove an empty branch in sas_check_parent_topology() There is an empty "all good" branch in sas_check_parent_topology(). We can reverse the test statement and remove the empty branch. Moreover, factor out a helper sas_check_edge_expander_topo() to make the code more readable. Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20230421093744.1583609-3-yanaijie@huawei.com Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit e3be011e828037be60fc91fa2d1791f9ee612a46 Author: Jason Yan Date: Fri Apr 21 17:37:42 2023 +0800 scsi: libsas: Simplify sas_check_eeds() In sas_check_eeds() there is an empty branch. We can reverse the test expression and then remove the empty branch. Also the test expression is a little bit complex so it deserves an individual function. And make the continuing prototype lines indented after the opening parenthesis to follow the standard coding style. Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20230421093744.1583609-2-yanaijie@huawei.com Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit fd9ffa6c747f8868640dff783bb52cb0761dba19 Author: Justin Tee Date: Mon Apr 17 12:15:58 2023 -0700 scsi: lpfc: Update lpfc version to 14.2.0.12 Update lpfc version to 14.2.0.12. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230417191558.83100-8-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit a7b94c159210cdb9393fa6e69f8d085e43c0607b Author: Justin Tee Date: Mon Apr 17 12:15:57 2023 -0700 scsi: lpfc: Replace blk_irq_poll intr handler with threaded IRQ It has been determined that the threaded IRQ API accomplishes effectively the same performance metrics as blk_irq_poll. As blk_irq_poll is mostly scheduled by the softirqd and handled in softirq context, this is not entirely desired from a Fibre Channel driver context. A threaded IRQ model fits cleaner. This patch replaces the blk_irq_poll logic with threaded IRQ. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230417191558.83100-7-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 5fc849d8056d6f51bc8cd43cbcd85d4e71aa1ee2 Author: Justin Tee Date: Mon Apr 17 12:15:56 2023 -0700 scsi: lpfc: Add new RCQE status for handling DMA failures A new RCQE status value indicating DMA failure when transferring asynchronously received data to an RQE is introduced. Such errors are unexpected and handlers are updated to log KERN_ERR and dump lpfc's debug trace buffer to kmsg. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230417191558.83100-6-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 779d61dfb9eab964b3cd243718fd27b35f9db776 Author: Justin Tee Date: Mon Apr 17 12:15:55 2023 -0700 scsi: lpfc: Update congestion warning notification period The CMF_SYNC_WQE command is updated to use an 8-bit field sync period. All related variables used to calculate congestion warning notifications are updated to 8-bit fields accordingly. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230417191558.83100-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 78e9e35004fd42ca6d539f3ba5c600a189241633 Author: Justin Tee Date: Mon Apr 17 12:15:54 2023 -0700 scsi: lpfc: Match lock ordering of lpfc_cmd->buf_lock and hbalock for abort paths The SCSI version of the abort handler routine, lpfc_abort_handler(), takes the lpfc_cmd->buf_lock and then phba->hbalock. Make the same change for the NVMe abort path, lpfc_nvme_fcp_abort(), to have consistent lock ordering logic between the two abort paths. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230417191558.83100-4-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 97f975823f8196d970bd795087b514271214677a Author: Justin Tee Date: Mon Apr 17 12:15:53 2023 -0700 scsi: lpfc: Fix double free in lpfc_cmpl_els_logo_acc() caused by lpfc_nlp_not_used() Smatch detected a double free path because lpfc_nlp_not_used() releases an ndlp object before reaching lpfc_nlp_put() at the end of lpfc_cmpl_els_logo_acc(). Remove the outdated lpfc_nlp_not_used() routine. In lpfc_mbx_cmpl_ns_reg_login(), replace the call with lpfc_nlp_put(). In lpfc_cmpl_els_logo_acc(), replace the call with lpfc_unreg_rpi() and keep the lpfc_nlp_put() at the end of the routine. If ndlp's rpi was registered, then lpfc_unreg_rpi()'s completion routine performs the final ndlp clean up after lpfc_nlp_put() is called from lpfc_cmpl_els_logo_acc(). Otherwise if ndlp has no rpi registered, the lpfc_nlp_put() at the end of lpfc_cmpl_els_logo_acc() is the final ndlp clean up. Fixes: 4430f7fd09ec ("scsi: lpfc: Rework locations of ndlp reference taking") Cc: # v5.11+ Reported-by: Dan Carpenter Link: https://lore.kernel.org/all/Y3OefhyyJNKH%2Fiaf@kili/ Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230417191558.83100-3-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 84c868a702f520a75af8a6f0bf8084135e09c510 Author: Justin Tee Date: Mon Apr 17 12:15:52 2023 -0700 scsi: lpfc: Fix verbose logging for SCSI commands issued to SES devices For SES LUNs with scsi_device sector_size member set to zero, there is no point to log an LBA. When verbose FCP driver logging is enabled, sanity check sector_size before calling scsi_get_lba() on a scsi_cmnd. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20230417191558.83100-2-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 14a8f116cdc0cbfdb939f145b02173af82083b91 Author: Changyuan Lyu Date: Wed Apr 19 17:55:02 2023 +0000 scsi: pm80xx: Add GET_NVMD timeout during probe Add a wait timeout to prevent the kernel from waiting for the GET_NVMD response forever during probe. Add a check for the controller state before issuing GET_NVMD request. Signed-off-by: Changyuan Lyu Signed-off-by: Pranav Prasad Link: https://lore.kernel.org/r/20230419175502.919999-1-pranavpp@google.com Signed-off-by: Martin K. Petersen commit 3aa65f7e25acb44d9043d236206e844295cf8c6a Author: Changyuan Lyu Date: Tue Apr 18 19:01:01 2023 +0000 scsi: pm80xx: Update PHY state after hard reset Update phy_attached, phy_state, and port_state to correct values after a hard rest. Without this patch, after a successful hard reset, phy_attached is still 0, as a result, any following hard reset will cause a PHY START to be issued first. Signed-off-by: Changyuan Lyu Signed-off-by: Pranav Prasad Link: https://lore.kernel.org/r/20230418190101.696345-7-pranavpp@google.com Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit d309422d7dc6619fb6aa713317e0b0010b8985f3 Author: Akshat Jain Date: Tue Apr 18 19:01:00 2023 +0000 scsi: pm80xx: Log port state during HW event Log port state during PHY_DOWN event to understand reasoning for PHY_DOWNs. Signed-off-by: Akshat Jain Signed-off-by: Pranav Prasad Link: https://lore.kernel.org/r/20230418190101.696345-6-pranavpp@google.com Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit 5f797120d853dc993a3ea11ebb9adb73ed48bd81 Author: Akshat Jain Date: Tue Apr 18 19:00:59 2023 +0000 scsi: pm80xx: Log phy_id and port_id in the device registration request Print phy_id and port_id sent as part of device registration request. Signed-off-by: Akshat Jain Signed-off-by: Pranav Prasad Link: https://lore.kernel.org/r/20230418190101.696345-5-pranavpp@google.com Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit a6cf6b8bd6e20808f3681dcefd241090cd4b5d97 Author: Akshat Jain Date: Tue Apr 18 19:00:58 2023 +0000 scsi: pm80xx: Print port_id in HW events Log port_id and phy_id along with the PHY_UP event. Signed-off-by: Akshat Jain Signed-off-by: Pranav Prasad Link: https://lore.kernel.org/r/20230418190101.696345-4-pranavpp@google.com Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit 6a516506aad6a6aae8b70c3dd9e180d060426f1b Author: Akshat Jain Date: Tue Apr 18 19:00:57 2023 +0000 scsi: pm80xx: Enable init logging Enable init logging to debug drive discovery issues. Signed-off-by: Akshat Jain Signed-off-by: Pranav Prasad Link: https://lore.kernel.org/r/20230418190101.696345-3-pranavpp@google.com Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit b7d26c1d8c51632cfce1cb1f0db7b125bc6533f6 Author: Akshat Jain Date: Tue Apr 18 19:00:56 2023 +0000 scsi: pm80xx: Log some HW events by default Log the following hw_event logs under EVENT log severity to help debug disk issues: HW_EVENT_LINK_ERR_INVALID_DWORD HW_EVENT_LINK_ERR_DISPARITY_ERROR HW_EVENT_LINK_ERR_CODE_VIOLATION HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH HW_EVENT_LINK_ERR_PHY_RESET_FAILED HW_EVENT_INBOUND_CRC_ERROR HW_EVENT_PHY_ERROR HW_EVENT_SAS_PHY_UP HW_EVENT_SATA_PHY_UP HW_EVENT_SATA_SPINUP_HOLD HW_EVENT_PHY_DOWN HW_EVENT_PORT_INVALID HW_EVENT_MALFUNCTION HW_EVENT_PORT_RESET_TIMER_TMO HW_EVENT_PORT_RECOVERY_TIMER_TMO HW_EVENT_HARD_RESET_RECEIVED HW_EVENT_ID_FRAME_TIMEOUT HW_EVENT_PORT_RECOVER Signed-off-by: Akshat Jain Signed-off-by: Pranav Prasad Link: https://lore.kernel.org/r/20230418190101.696345-2-pranavpp@google.com Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit d8c66cbbdd4fa9ef84497ee509f15aff94a98a59 Author: Bartosz Golaszewski Date: Wed Apr 19 14:09:14 2023 +0200 dt-bindings: phy: qmp-ufs: tweak clock and clock-names for sa8775p maxItems is already globally set to 3. To make the binding easier to read and remove redundancy, set minItems to 3 for sa8775p as this platform requires exactly three clocks. Signed-off-by: Bartosz Golaszewski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230419120914.173715-1-brgl@bgdev.pl Signed-off-by: Vinod Koul commit d96a432cc86aaa7d4ca202471c9ab094ca786fab Author: Krzysztof Kozlowski Date: Sun Apr 16 17:12:33 2023 +0200 dt-bindings: phy: qcom,edp-phy: allow power-domains At least on SC8280XP the eDP PHY is part of power domain: sc8280xp-crd.dtb: phy@220c2a00: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230416151233.346336-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 3d56c7364389fce14547803fef56d6f2cab5d366 Author: Wolfram Sang Date: Wed Apr 19 15:02:34 2023 +0200 memory: renesas-rpc-if: Fix PHYCNT.STRTIM setting According to the datasheets, the Strobe Timing Adjustment bit (STRTIM) setting is different on R-Car SoCs, i.e. R-Car M3 ES1.* : STRTIM[2:0] is set to 0x6 other R-Car Gen3: STRTIM[2:0] is set to 0x7 other R-Car Gen4: STRTIM[3:0] is set to 0xf To fix this issue, a DT match data was added to specify the setting for special use cases. Signed-off-by: Cong Dang Signed-off-by: Hai Pham [wsa: rebased, restructured, added Gen4 support] Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230419130234.44321-1-wsa+renesas@sang-engineering.com Signed-off-by: Krzysztof Kozlowski commit 0df2a5e99d0cb10a3da93fd71dd6753af5adc79f Author: Krzysztof Kozlowski Date: Fri Apr 7 17:01:21 2023 +0200 w1: therm: constify pointers to hwmon_channel_info Statically allocated array of pointed to hwmon_channel_info can be made const for safety. Link: https://lore.kernel.org/r/20230407150121.79887-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit f710ac5442f630a7b8dc25e30e25d30a4a38e796 Author: Borislav Petkov (AMD) Date: Tue Mar 28 22:17:12 2023 +0200 x86/sev: Get rid of special sev_es_enable_key A SEV-ES guest is active on AMD when CC_ATTR_GUEST_STATE_ENCRYPT is set. I.e., MSR_AMD64_SEV, bit 1, SEV_ES_Enabled. So no need for a special static key. No functional changes. Signed-off-by: Borislav Petkov (AMD) Acked-by: Tom Lendacky Link: https://lore.kernel.org/r/20230328201712.25852-3-bp@alien8.de commit 1eaf282e2c7d062a946980758df013f09f934a54 Author: Borislav Petkov (AMD) Date: Tue Mar 28 22:17:11 2023 +0200 x86/coco: Mark cc_platform_has() and descendants noinstr Those will be used in code regions where instrumentation is not allowed so mark them as such. No functional changes. Signed-off-by: Borislav Petkov (AMD) Acked-by: Tom Lendacky Link: https://lore.kernel.org/r/20230328201712.25852-2-bp@alien8.de commit 8bd2d6e11c99da27e748b168945cbae8a8cfb0e7 Author: Shazad Hussain Date: Fri Apr 28 18:38:22 2023 +0530 phy: qcom-qmp: Add SA8775P USB3 UNI phy The SA8775P platform has 5nm USB3 UNI phy attached to the USB0 and USB1 controllers. Add QMP PHY config, pcs entries and support for the new compatible for SA8775P platform. Signed-off-by: Shazad Hussain Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230428130824.23803-5-quic_shazhuss@quicinc.com Signed-off-by: Vinod Koul commit bfd73c859eb8856070ef01ce29d375cdc0364887 Author: Shazad Hussain Date: Fri Apr 28 18:38:21 2023 +0530 dt-bindings: phy: qcom,sc8280xp-qmp-usb3-uni: Add SA8775P USB PHY binding Add compatible string for Qualcomm QMP Super Speed (SS) UNI PHY found in SA8775P. Signed-off-by: Shazad Hussain Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230428130824.23803-4-quic_shazhuss@quicinc.com Signed-off-by: Vinod Koul commit 66dc9a2cf578688efdad5b5193c44efdbb7e36ba Author: Shazad Hussain Date: Fri Apr 28 18:38:20 2023 +0530 dt-bindings: phy: qcom,usb-snps-femto-v2: Add bindings for SA8775P Document the compatible string for USB phy found in Qualcomm SA8775P SoC Signed-off-by: Shazad Hussain Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230428130824.23803-3-quic_shazhuss@quicinc.com Signed-off-by: Vinod Koul commit 70e5df113833c9ebf24b7779e37a5c341fbefe63 Author: Shazad Hussain Date: Fri Apr 28 18:38:19 2023 +0530 dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P Add the compatible string for SA8775P SoC from Qualcomm. Signed-off-by: Shazad Hussain Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230428130824.23803-2-quic_shazhuss@quicinc.com Signed-off-by: Vinod Koul commit a8025faec70ad5021995f849197c9437ca3cde48 Author: Stanislav Jakubek Date: Thu Apr 27 21:07:25 2023 +0200 dt-bindings: phy: brcm,kona-usb2-phy: convert to YAML Convert Broadcom Kona family USB 2.0 PHY bindings to DT schema. Signed-off-by: Stanislav Jakubek Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230427190725.GA7730@standask-GA-A55M-S2HP Signed-off-by: Vinod Koul commit 58247b9fedd6d7f7dcbeaf6bb57fd7a99403a1bb Author: Dmitry Rokosov Date: Wed Apr 26 13:29:18 2023 +0300 phy: amlogic: enable/disable clkin during Amlogic USB PHY init/exit Previously, all Amlogic boards used the XTAL clock as the default board clock for the USB PHY input, so there was no need to enable it. However, with the introduction of new Amlogic SoCs like the A1 family, the USB PHY now uses a gated clock. Hence, it is necessary to enable this gated clock during the PHY initialization sequence, or disable it during the PHY exit, as appropriate. Signed-off-by: Dmitry Rokosov Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20230426102922.19705-2-ddrokosov@sberdevices.ru Signed-off-by: Vinod Koul commit b9279e9b28bb8754495f66d70902fa35c8fa7f53 Author: Stanislav Lisovskiy Date: Sat May 6 17:42:17 2023 +0300 drm/i915: Fix wrong condition in bxt_set_cdclk for DG2 By my own mistake, after adding !IS_DG2 into wrong branch, bxt_set_cdclk started to execute code intended for platforms gen < 11, which is wrong. Move IS_DG2 check to better place. Fixes: ceb0cc3b4288 ("drm/i915: Communicate display power demands to pcode") Signed-off-by: Stanislav Lisovskiy Reviewed-by: Vinod Govindapillai Link: https://patchwork.freedesktop.org/patch/msgid/20230506144217.26075-1-stanislav.lisovskiy@intel.com commit a6fcdd8d95f7486150b3faadfea119fc3dfc3b74 Author: 晏艳(采苓) Date: Sat May 6 15:42:53 2023 +0800 sched/debug: Correct printing for rq->nr_uninterruptible Commit e6fe3f422be1 ("sched: Make multiple runqueue task counters 32-bit") changed the type for rq->nr_uninterruptible from "unsigned long" to "unsigned int", but left wrong cast print to /sys/kernel/debug/sched/debug and to the console. For example, nr_uninterruptible's value is fffffff7 with type "unsigned int", (long)nr_uninterruptible shows 4294967287 while (int)nr_uninterruptible prints -9. So using int cast fixes wrong printing. Signed-off-by: Yan Yan Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230506074253.44526-1-yanyan.yan@antgroup.com commit bf2dc42d6beb890c995b8b09f881ef1b37259107 Author: Tim C Chen Date: Thu May 4 09:09:51 2023 -0700 sched/topology: Propagate SMT flags when removing degenerate domain When a degenerate cluster domain for core with SMT CPUs is removed, the SD_SHARE_CPUCAPACITY flag in the local child sched group was not propagated to the new parent. We need this flag to properly determine whether the local sched group is SMT. Set the flag in the local child sched group of the new parent sched domain. Signed-off-by: Tim Chen Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ricardo Neri Link: https://lkml.kernel.org/r/73cf0959eafa53c02e7ef6bf805d751d9190e55d.1683156492.git.tim.c.chen@linux.intel.com commit 519fabc7aaba3f0847cf37d5f9a5740c370eb777 Author: Suren Baghdasaryan Date: Thu Mar 2 17:13:46 2023 -0800 psi: remove 500ms min window size limitation for triggers Current 500ms min window size for psi triggers limits polling interval to 50ms to prevent polling threads from using too much cpu bandwidth by polling too frequently. However the number of cgroups with triggers is unlimited, so this protection can be defeated by creating multiple cgroups with psi triggers (triggers in each cgroup are served by a single "psimon" kernel thread). Instead of limiting min polling period, which also limits the latency of psi events, it's better to limit psi trigger creation to authorized users only, like we do for system-wide psi triggers (/proc/pressure/* files can be written only by processes with CAP_SYS_RESOURCE capability). This also makes access rules for cgroup psi files consistent with system-wide ones. Add a CAP_SYS_RESOURCE capability check for cgroup psi file writers and remove the psi window min size limitation. Suggested-by: Sudarshan Rajagopalan Signed-off-by: Suren Baghdasaryan Signed-off-by: Peter Zijlstra (Intel) Acked-by: Michal Hocko Acked-by: Johannes Weiner Link: https://lore.kernel.org/all/cover.1676067791.git.quic_sudaraja@quicinc.com/ commit 044f0e27dec6e30bb8875a4a12c5f2594964e93f Author: Chen Yu Date: Thu Apr 6 13:31:48 2023 -0700 x86/sched: Add the SD_ASYM_PACKING flag to the die domain of hybrid processors Intel Meteor Lake hybrid processors have cores in two separate dies. The cores in one of the dies have higher maximum frequency. Use the SD_ASYM_ PACKING flag to give higher priority to the die with CPUs of higher maximum frequency. Suggested-by: Ricardo Neri Signed-off-by: Chen Yu Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230406203148.19182-13-ricardo.neri-calderon@linux.intel.com commit 046a5a95c3b0425cfe79e43021d8ee90c1c4f8c9 Author: Ricardo Neri Date: Thu Apr 6 13:31:47 2023 -0700 x86/sched/itmt: Give all SMT siblings of a core the same priority X86 does not have the SD_ASYM_PACKING flag in the SMT domain. The scheduler knows how to handle SMT and non-SMT cores of different priority. There is no reason for SMT siblings of a core to have different priorities. Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Len Brown Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-12-ricardo.neri-calderon@linux.intel.com commit 995998ebdebd09b85c28cc46068d8a0744113837 Author: Ricardo Neri Date: Thu Apr 6 13:31:46 2023 -0700 x86/sched: Remove SD_ASYM_PACKING from the SMT domain flags There is no difference between any of the SMT siblings of a physical core. Do not do asym_packing load balancing at this level. Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-11-ricardo.neri-calderon@linux.intel.com commit ca528cc501896a808dc79c3c0544369d23b331c8 Author: Ricardo Neri Date: Thu Apr 6 13:31:45 2023 -0700 sched/topology: Remove SHARED_CHILD from ASYM_PACKING Only x86 and Power7 use ASYM_PACKING. They use it differently. Power7 has cores of equal priority, but the SMT siblings of a core have different priorities. Parent scheduling domains do not need (nor have) the ASYM_PACKING flag. SHARED_CHILD is not needed. Using SHARED_PARENT would cause the topology debug code to complain. X86 has cores of different priority, but all the SMT siblings of the core have equal priority. It needs ASYM_PACKING at the MC level, but not at the SMT level (it also needs it at upper levels if they have scheduling groups of different priority). Removing ASYM_PACKING from the SMT domain causes the topology debug code to complain. Remove SHARED_CHILD for now. We still need a topology check that satisfies both architectures. Suggested-by: Valentin Schneider Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-10-ricardo.neri-calderon@linux.intel.com commit 40b4d3dc328265c8ec6688657d74813edf785c83 Author: Ricardo Neri Date: Thu Apr 6 13:31:44 2023 -0700 sched/topology: Check SDF_SHARED_CHILD in highest_flag_domain() Do not assume that all the children of a scheduling domain have a given flag. Check whether it has the SDF_SHARED_CHILD meta flag. Suggested-by: Ionela Voinescu Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230406203148.19182-9-ricardo.neri-calderon@linux.intel.com commit c9ca07886aaa40225a29e5c1e46ac31d2e14f53a Author: Ricardo Neri Date: Thu Apr 6 13:31:43 2023 -0700 sched/fair: Do not even the number of busy CPUs via asym_packing Now that find_busiest_group() triggers load balancing between a fully_ busy SMT2 core and an idle non-SMT core, it is no longer needed to force balancing via asym_packing. Use asym_packing only as intended: when there is high-priority CPU that is idle. After this change, the same logic apply to SMT and non-SMT local groups. It makes less sense having a separate function to deal specifically with SMT. Fold the logic in asym_smt_can_pull_tasks() into sched_asym(). Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-8-ricardo.neri-calderon@linux.intel.com commit 43726bdedd29797d8e1fee2e7300a6d2b9a74ba8 Author: Ricardo Neri Date: Thu Apr 6 13:31:42 2023 -0700 sched/fair: Use the busiest group to set prefer_sibling The prefer_sibling setting acts on the busiest group to move excess tasks to the local group. This should be done as per request of the child of the busiest group's sched domain, not the local group's. Using the flags of the child domain of the local group works fortuitously if both groups have child domains. There are cases, however, in which the busiest group's sched domain has child but the local group's does not. Consider, for instance a non-SMT core (or an SMT core with only one online sibling) doing load balance with an SMT core at the MC level. SD_PREFER_SIBLING of the busiest group's child domain will not be honored. We are left with a fully busy SMT core and an idle non-SMT core. Suggested-by: Dietmar Eggemann Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-7-ricardo.neri-calderon@linux.intel.com commit 5fd6d7f43958cb62da105c8413eac3e78480f09a Author: Ricardo Neri Date: Thu Apr 6 13:31:41 2023 -0700 sched/fair: Keep a fully_busy SMT sched group as busiest When comparing two fully_busy scheduling groups, keep the current busiest group if it represents an SMT core. Tasks in such scheduling group share CPU resources and need more help than tasks in a non-SMT fully_busy group. Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-6-ricardo.neri-calderon@linux.intel.com commit 18ad34532755feb5b9f4284b07769b1bfec18ab3 Author: Ricardo Neri Date: Thu Apr 6 13:31:40 2023 -0700 sched/fair: Let low-priority cores help high-priority busy SMT cores Using asym_packing priorities within an SMT core is straightforward. Just follow the priorities that hardware indicates. When balancing load from an SMT core, also consider the idle state of its siblings. Priorities do not reflect that an SMT core divides its throughput among all its busy siblings. They only makes sense when exactly one sibling is busy. Indicate that active balance is needed if the destination CPU has lower priority than the source CPU but the latter has busy SMT siblings. Make find_busiest_queue() not skip higher-priority SMT cores with more than busy sibling. Suggested-by: Valentin Schneider Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-5-ricardo.neri-calderon@linux.intel.com commit ef7657d4d2d6a8456aa624010de456c32a135fe9 Author: Ricardo Neri Date: Thu Apr 6 13:31:39 2023 -0700 sched/fair: Simplify asym_packing logic for SMT cores Callers of asym_smt_can_pull_tasks() check the idle state of the destination CPU and its SMT siblings, if any. No extra checks are needed in such function. Since SMT cores divide capacity among its siblings, priorities only really make sense if only one sibling is active. This is true for SMT2, SMT4, SMT8, etc. Do not use asym_packing load balance for this case. Instead, let find_busiest_group() handle imbalances. When balancing non-SMT cores or at higher scheduling domains (e.g., between MC scheduling groups), continue using priorities. Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Len Brown Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-4-ricardo.neri-calderon@linux.intel.com commit eefefa716c9fa6aa73159f09954b7eeba4cafd09 Author: Ricardo Neri Date: Thu Apr 6 13:31:38 2023 -0700 sched/fair: Only do asym_packing load balancing from fully idle SMT cores When balancing load between cores, all the SMT siblings of the destination CPU, if any, must be idle. Otherwise, pulling new tasks degrades the throughput of the busy SMT siblings. The overall throughput of the system remains the same. When balancing load within an SMT core this consideration is not relevant. Follow the priorities that hardware indicates. Suggested-by: Valentin Schneider Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-3-ricardo.neri-calderon@linux.intel.com commit 8b36d07f1d63de102d464f44a89704bc62d00811 Author: Ricardo Neri Date: Thu Apr 6 13:31:37 2023 -0700 sched/fair: Move is_core_idle() out of CONFIG_NUMA asym_packing needs this function to determine whether an SMT core is a suitable destination for load balancing. Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-2-ricardo.neri-calderon@linux.intel.com commit 10d95a317ec12ec7dd4587a646c6bd6aa03c7ded Author: Dapeng Mi Date: Thu May 4 15:21:28 2023 +0800 perf/x86/intel: Define bit macros for FixCntrCtl MSR Define bit macros for FixCntrCtl MSR and replace the bit hardcoding with these bit macros. This would make code be more human-readable. Perf commands 'perf stat -e "instructions,cycles,ref-cycles"' and 'perf record -e "instructions,cycles,ref-cycles"' pass. Signed-off-by: Dapeng Mi Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230504072128.3653470-1-dapeng1.mi@linux.intel.com commit 78075d947534013b4575687d19ebcbbb6d3addcd Author: Ravi Bangoria Date: Thu May 4 16:30:03 2023 +0530 perf test: Add selftest to test IBS invocation via core pmu events IBS pmu can be invoked via fixed set of core pmu events with 'precise_ip' set to 1. Add a simple event open test for all these events. Without kernel fix: $ sudo ./perf test -vv 76 76: AMD IBS via core pmu : --- start --- test child forked, pid 6553 Using CPUID AuthenticAMD-25-1-1 type: 0x0, config: 0x0, fd: 3 - Pass type: 0x0, config: 0x1, fd: -1 - Pass type: 0x4, config: 0x76, fd: -1 - Fail type: 0x4, config: 0xc1, fd: -1 - Fail type: 0x4, config: 0x12, fd: -1 - Pass test child finished with -1 ---- end ---- AMD IBS via core pmu: FAILED! With kernel fix: $ sudo ./perf test -vv 76 76: AMD IBS via core pmu : --- start --- test child forked, pid 7526 Using CPUID AuthenticAMD-25-1-1 type: 0x0, config: 0x0, fd: 3 - Pass type: 0x0, config: 0x1, fd: -1 - Pass type: 0x4, config: 0x76, fd: 3 - Pass type: 0x4, config: 0xc1, fd: 3 - Pass type: 0x4, config: 0x12, fd: -1 - Pass test child finished with 0 ---- end ---- AMD IBS via core pmu: Ok Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230504110003.2548-5-ravi.bangoria@amd.com commit 9551fbb64d094cc105964716224adeb7765df8fd Author: Ravi Bangoria Date: Thu May 4 16:30:02 2023 +0530 perf/core: Remove pmu linear searching code Searching for the right pmu by iterating over all pmus is no longer required since all pmus now *must* be present in the 'pmu_idr' list. So, remove linear searching code. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230504110003.2548-4-ravi.bangoria@amd.com commit 2fad201fe38ff9a692acedb1990ece2c52a29f95 Author: Ravi Bangoria Date: Thu May 4 16:30:01 2023 +0530 perf/ibs: Fix interface via core pmu events Although, IBS pmus can be invoked via their own interface, indirect IBS invocation via core pmu events is also supported with fixed set of events: cpu-cycles:p, r076:p (same as cpu-cycles:p) and r0C1:p (micro-ops) for user convenience. This indirect IBS invocation is broken since commit 66d258c5b048 ("perf/core: Optimize perf_init_event()"), which added RAW pmu under 'pmu_idr' list and thus if event_init() fails with RAW pmu, it started returning error instead of trying other pmus. Forward precise events from core pmu to IBS by overwriting 'type' and 'config' in the kernel copy of perf_event_attr. Overwriting will cause perf_init_event() to retry with updated 'type' and 'config', which will automatically forward event to IBS pmu. Without patch: $ sudo ./perf record -C 0 -e r076:p -- sleep 1 Error: The r076:p event is not supported. With patch: $ sudo ./perf record -C 0 -e r076:p -- sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.341 MB perf.data (37 samples) ] Fixes: 66d258c5b048 ("perf/core: Optimize perf_init_event()") Reported-by: Stephane Eranian Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230504110003.2548-3-ravi.bangoria@amd.com commit 0d6d062ca27ec7ef547712d34dcfcfb952bcef53 Author: Ravi Bangoria Date: Thu May 4 16:30:00 2023 +0530 perf/core: Rework forwarding of {task|cpu}-clock events Currently, PERF_TYPE_SOFTWARE is treated specially since task-clock and cpu-clock events are interfaced through it but internally gets forwarded to their own pmus. Rework this by overwriting event->attr.type in perf_swevent_init() which will cause perf_init_event() to retry with updated type and event will automatically get forwarded to right pmu. With the change, SW pmu no longer needs to be treated specially and can be included in 'pmu_idr' list. Suggested-by: Peter Zijlstra Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230504110003.2548-2-ravi.bangoria@amd.com commit 9d2edccb154bd98baf7f1e21d23f799e4f5e8359 Author: Lukas Bulwahn Date: Mon May 8 06:04:33 2023 +0200 ARM: s3c: remove obsolete config S3C64XX_SETUP_IDE Commit 0d297df03890 ("ARM: s3c: simplify platform code") removes the line in Makefile.s3c64xx to configure the inclusion of setup-ide-s3c64xx.c, with CONFIG_S3C64XX_SETUP_IDE. So, since then, config S3C64XX_SETUP_IDE has no effect and any further purpose. Remove the obsolete config S3C64XX_SETUP_IDE. Signed-off-by: Lukas Bulwahn Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230508040433.13648-1-lukas.bulwahn@gmail.com Signed-off-by: Krzysztof Kozlowski commit 9420c9719f03d9c42b79fe8080fbd81900032087 Author: Charles Keepax Date: Tue Apr 18 15:06:50 2023 +0100 soundwire: bus: Don't filter slave alerts It makes sense to have only a single point responsible for ensuring that all currently pending IRQs are handled. The current code in sdw_handle_slave_alerts confusingly splits this process in two. This code will loop until the asserted IRQs are cleared but it will only handle IRQs that were already asserted when it was called. This means the caller must also loop (either manually, or through its IRQ mechanism) until the IRQs are all handled. It makes sense to either do all the looping in sdw_handle_slave_alerts or do no looping there and let the host controller repeatedly call it until things are handled. There are realistically two sensible host controllers, those that will generate an IRQ when the alert status changes and those that will generate an IRQ continuously whilst the alert status is high. The current code will work fine for the second of those systems but not the first with out additional looping in the host controller. Removing the code that filters out new IRQs whilst the handler is running enables both types of host controller to be supported and simplifies the code. The code will still only loop up to SDW_READ_INTR_CLEAR_RETRY times, so it shouldn't be possible for it to get completely stuck handling IRQs forever, and if you are generating IRQs faster than you can handle them you likely have bigger problems anyway. This fixes an issue on the Cadence SoundWire IP, which only generates IRQs on an alert status change, where an alert which arrives whilst another alert is being handled will never be handled and will block all future alerts from being handled. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230418140650.297279-1-ckeepax@opensource.cirrus.com Signed-off-by: Vinod Koul commit 946233bb23becc2898db31ad785d94fe80aa15dc Author: Oswald Buddenhagen Date: Fri Apr 28 11:59:41 2023 +0200 ALSA: emu10k1: minor E-MU naming fixups - Fix mixer source port names. These will require some users to re-adjust their mixer settings, which seems acceptable: - The S/PDIF port is on the main 1010 card, not the 0202 daughter card - The 1616m CardBus card has all inputs on the dock, so there is no point in specifying it - Conversely, the 1010 card has "dispersed" inputs, so say where the ADAT port is, consistently with the S/PDIF port - The 1616m CardBus card is actually named E-MU 02 (due to the headphone output jack it has) - Fix capitalization of "E-MU" Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230428095941.1706335-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit e24d0b658fb3b4078e4b92c1d1df0d7da9b762cc Author: Krzysztof Kozlowski Date: Tue Apr 18 11:54:47 2023 +0200 soundwire: qcom: use tabs for indentation in defines Use consistently only tabs to indent the value in defines. Reviewed-by: Srinivas Kandagatla Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230418095447.577001-8-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 312355a6a9f688e48d044283b87abf22d2e56aee Author: Krzysztof Kozlowski Date: Tue Apr 18 11:54:46 2023 +0200 soundwire: qcom: add support for v2.0.0 controller Add support for Qualcomm Soundwire Controller with a bit different register layout. Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230418095447.577001-7-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 6378fe11207ab1f203d089af3e7db336f0b9f299 Author: Krzysztof Kozlowski Date: Tue Apr 18 11:54:45 2023 +0200 soundwire: qcom: prepare for handling different register layouts Currently the driver supports Qualcomm Soundwire controller versions from v1.3 till v1.7 which mostly have same register layout. With coming Qualcomm Soundwire v2.0, several registers were moved and changed, thus a different register layout will have to be supported. Prepare for this by: 1. Renaming few register defines to indicate v1.3 (earliest supported) version, 2. Add a simple table for mapping register to its offset, 3. Change the code to use the mapping table. Since only few registers differ, this solution seems easier then switching to regmap fields. Reviewed-by: Srinivas Kandagagatla Tested-by: Srinivas Kandagagatla Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230418095447.577001-6-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 6f76e79153d588ebb00becbfc200ec3b983e353e Author: Krzysztof Kozlowski Date: Tue Apr 18 11:54:44 2023 +0200 soundwire: qcom: use consistently 'ctrl' as state variable name The pointer to 'struct qcom_swrm_ctrl' was called sometimes 'swrm' and sometimes 'ctrl' variable. Choose one - 'ctrl' - so the code will be consistent and easier to read. No functional change. Reviewed-by: Srinivas Kandagagatla Tested-by: Srinivas Kandagagatla Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230418095447.577001-5-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit a8dffaa0f826176b344f5f909d197aedd22db578 Author: Krzysztof Kozlowski Date: Tue Apr 18 11:54:43 2023 +0200 soundwire: qcom: allow 16-bit sample interval for ports The port sample interval was always 16-bit, split into low and high bytes. This split was unnecessary, although harmless for older devices because all of them used only lower byte (so values < 0xff). With support for Soundwire controller on Qualcomm SM8550 and its devices, both bytes will be used, thus add a new 'qcom,ports-sinterval' property to allow 16-bit sample intervals. Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230418095447.577001-4-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit a536bf5afa28420514d975f0852a778ea8291e1a Author: Krzysztof Kozlowski Date: Tue Apr 18 11:54:42 2023 +0200 dt-bindings: soundwire: qcom: add 16-bit sample interval The port sample interval was always 16-bit, split into low and high bytes. This split was unnecessary, although harmless for older devices because all of them used only lower byte (so values < 0xff). With support for Soundwire controller on Qualcomm SM8550 and its devices, both bytes will be used, thus add a new 'qcom,ports-sinterval' property to allow 16-bit sample intervals. Reviewed-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20230418095447.577001-3-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 505bdb9dff2eb1d097a231eb1946df01c3c5d405 Author: Krzysztof Kozlowski Date: Tue Apr 18 11:54:41 2023 +0200 dt-bindings: soundwire: qcom: add Qualcomm Soundwire v2.0.0 Add compatible for Qualcomm Soundwire v2.0.0 controller, which comes with several differences against v1.7.0 in register layout and more ports (thus increase maxItems of each port-related property to 16). Reviewed-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230418095447.577001-2-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 06405d8ee8c3bac5b3a4ddda58f6431187a3be48 Author: Oswald Buddenhagen Date: Fri Apr 28 11:59:41 2023 +0200 ALSA: emu10k1: remove now superfluous mixer locking Since commit 5bbb1ab5bd ("control: use counting semaphore as write lock for ELEM_WRITE operation"), mixer values have been fully read-write locked. This means that it is now unnecessary to apply any additional locks to values that are accessed solely by mixer callbacks. Values that are read outside mixer callbacks still need write locking. There are no cases of mixer values being written outside mixer callbacks, so no read locks remain in mixer callbacks. Note that the removed locks refer only to the emu data structure, not the card's registers as the lock's name suggests. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230428095941.1706278-7-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit afb39e2bd36af1d80913bb6851caece829526217 Author: Philipp Zabel Date: Tue May 2 12:20:41 2023 +0200 reset: mpfs: select AUXILIARY_BUS CONFIG_AUXILIARY_BUS is not a user-visible symbol, replace 'depends on' with 'select'. Cc: Daire McNamara Suggested-by: Arnd Bergmann Reviewed-by: Conor Dooley Reviewed-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230502102041.1418397-1-p.zabel@pengutronix.de Signed-off-by: Philipp Zabel commit 52990390f91c1c39ca742fc8f390b29891d95127 Author: Philipp Zabel Date: Tue May 2 12:20:50 2023 +0200 reset: starfive: select AUXILIARY_BUS CONFIG_AUXILIARY_BUS is not a user-visible symbol, replace 'depends on' with 'select'. Suggested-by: Arnd Bergmann Reviewed-by: Hal Feng Reviewed-by: Arnd Bergmann Reviewed-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20230502102050.1418417-1-p.zabel@pengutronix.de Signed-off-by: Philipp Zabel commit ac59ed9cdb80bdb7f6584af5253790f51a9404a7 Author: Neil Armstrong Date: Fri Mar 31 10:34:55 2023 +0200 reset: oxnas: remove obsolete reset driver Due to lack of maintainance and stall of development for a few years now, and since no new features will ever be added upstream, remove support for OX810 and OX820 peripheral reset. Signed-off-by: Neil Armstrong Acked-by: Daniel Golle Acked-by: Arnd Bergmann Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20230331-topic-oxnas-upstream-remove-v1-17-5bd58fd1dd1f@linaro.org Signed-off-by: Philipp Zabel commit 20a6a4d7226691473cde40ed1e1f03964cbd5be7 Author: Lukas Bulwahn Date: Thu Mar 30 13:23:47 2023 +0200 reset: sti: simplify driver's config and build With commit 64933513e461 ("reset: sti: Remove STiH415/6 reset support"), there is only one sti reset driver left and there no need to define a dedicated config STI_RESET_SYSCFG, which is selected by the config for the STiH407 reset driver. Simply add reset-syscfg.c to the build for the STiH407 reset driver. Signed-off-by: Lukas Bulwahn Reviewed-by: Patrice Chotard Link: https://lore.kernel.org/r/20230330112347.31137-2-lukas.bulwahn@gmail.com Signed-off-by: Philipp Zabel commit da46de512f8b9febdb085594815c91b45c940bef Author: Ye Xingchen Date: Thu Mar 23 16:53:44 2023 +0800 reset: meson-audio-arb: Use dev_err_probe() Replace the open-code with dev_err_probe() to simplify the code. Signed-off-by: Ye Xingchen Reviewed-by: Philipp Zabel Link: https://lore.kernel.org/r/202303231653447704556@zte.com.cn Signed-off-by: Philipp Zabel commit 2db4da59485f9c25837acc8024fc58b7a4143aaa Author: Alain Volmat Date: Fri Feb 10 23:43:31 2023 +0100 reset: sti: rely on regmap_field_read_poll_timeout for ack wait Use regmap_field_read_poll_timeout function when waiting for the ack bit upon performing the reset control. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard Link: https://lore.kernel.org/r/20230210224332.98482-1-avolmat@me.com Signed-off-by: Philipp Zabel commit fdcfdb230c67c7f37df2fdfa5369f560f4a06c9d Author: Ye Xingchen Date: Thu Feb 16 10:52:12 2023 +0800 reset: brcmstb-rescal: Use devm_platform_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to Use devm_platform_ioremap_resource(), as this is exactly what this function does. Suggested-by: Philipp Zabel Signed-off-by: Ye Xingchen Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/202302161052126378140@zte.com.cn Signed-off-by: Philipp Zabel commit cabf1ce35764ff74cb67d633d1b8eeface1b90f6 Author: Ye Xingchen Date: Thu Feb 16 10:54:59 2023 +0800 reset: meson: Use devm_platform_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to Use devm_platform_ioremap_resource(), as this is exactly what this function does. Suggested-by: Philipp Zabel Signed-off-by: Ye Xingchen Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/202302161054598138273@zte.com.cn Signed-off-by: Philipp Zabel commit 1d81ba35df80a67e242878b7630d323c7bbfbb00 Author: Ye Xingchen Date: Thu Feb 16 10:56:30 2023 +0800 reset: reset-hsdk: Use devm_platform_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to Use devm_platform_ioremap_resource(), as this is exactly what this function does. Suggested-by: Philipp Zabel Signed-off-by: Ye Xingchen Link: https://lore.kernel.org/r/202302161056304138337@zte.com.cn Signed-off-by: Philipp Zabel commit 68fda5a961cb36bfbc634ae55543f871e1ddcf5e Author: Ye Xingchen Date: Thu Feb 16 10:53:36 2023 +0800 reset: lpc18xx: Use devm_platform_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to Use devm_platform_ioremap_resource(), as this is exactly what this function does. Suggested-by: Philipp Zabel Signed-off-by: Ye Xingchen Link: https://lore.kernel.org/r/202302161053360618204@zte.com.cn Signed-off-by: Philipp Zabel commit 9bf9276f371e9247ac77c20955f127d1dbce9220 Author: Ye Xingchen Date: Thu Feb 16 10:50:33 2023 +0800 reset: axs10x: Use devm_platform_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to Use devm_platform_ioremap_resource(), as this is exactly what this function does. Suggested-by: Philipp Zabel Signed-off-by: Ye Xingchen Link: https://lore.kernel.org/r/202302161050336958071@zte.com.cn Signed-off-by: Philipp Zabel commit 41ccb3a0eb57741eebd72e51e011ef098bb1493d Author: Ye Xingchen Date: Thu Feb 16 10:49:10 2023 +0800 reset: ath79: Use devm_platform_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to Use devm_platform_ioremap_resource(), as this is exactly what this function does. Suggested-by: Philipp Zabel Signed-off-by: Ye Xingchen Link: https://lore.kernel.org/r/202302161049100728015@zte.com.cn Signed-off-by: Philipp Zabel commit 37bb927d5bb45b5dafaf9769bbed974e28621654 Author: Oswald Buddenhagen Date: Fri Apr 28 11:59:40 2023 +0200 ALSA: core: update comment on snd_card.controls_rwsem Since commit 5bbb1ab5bd ("control: use counting semaphore as write lock for ELEM_WRITE operation"), this has been locking the controls including their values, not just the list of controls. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230428095941.1706278-6-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 0da6bfe857ea9399498876cbe6ef428637b6e475 Author: Clint Taylor Date: Fri May 5 16:40:05 2023 +0200 drm/i915/mtl: Add MTL for remapping CCS FBs Add support for remapping CCS FBs on MTL to remove the restriction of the power-of-two sized stride and the 2MB surface offset alignment for these FBs. Signed-off-by: Clint Taylor Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Radhakrishna Sripada Signed-off-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230505144005.23480-2-nirmoy.das@intel.com commit 00b9dd061eb31c8619878f187e509eabbbdb681a Author: Pallavi Mishra Date: Fri May 5 16:40:04 2023 +0200 drm/i915/mtl: Drop FLAT CCS check Remove FLAT CCS check from XY_FAST_COLOR_BLT usage, thus enabling MTL to use it. Signed-off-by: Pallavi Mishra Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti Signed-off-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230505144005.23480-1-nirmoy.das@intel.com commit 35d1d5824ffe1cfc849aa1694488d779dc79a920 Author: Oswald Buddenhagen Date: Fri Apr 28 11:59:39 2023 +0200 ALSA: emu10k1: fix locking in snd_emu1010_fpga_link_dst_src_write() This is a multi-register operation, which must be locked in its entirety. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230428095941.1706278-5-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 50164f69f8c71377bfa3d356b8a6bc18b2197a45 Author: Oswald Buddenhagen Date: Fri Apr 28 11:59:38 2023 +0200 ALSA: emu10k1: use the right lock in snd_emu10k1_shared_spdif_put() The function does read-modify-write cycles on the card's registers, and doesn't access mutable members of the emu data structure. I suppose this might have been a mixup due to the lock names being logically swapped. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230428095941.1706278-4-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 18cbbdd846c5d74bd56fd1f229d074e1f7068fc8 Author: Phong Hoang Date: Tue May 2 19:06:18 2023 +0200 arm64: dts: renesas: r8a779a0: Add PWM nodes This patch adds PWM nodes for R-Car V3U (r8a779a0) SoC. Signed-off-by: Phong Hoang [wsa: rebased] Tested-by: Kieran Bingham Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20230502170618.55967-3-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 71781147dabdd0b256542bb51122f376db740b0d Author: Oswald Buddenhagen Date: Fri Apr 28 11:59:37 2023 +0200 ALSA: emu10k1: remove pointless locks from /proc code emu_lock locks the card's registers, but that's necessary only for multi-register access, incl. read-modify-write cycles. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230428095941.1706278-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit 16cafbd97759ba66c79bdede4250074f026839f3 Author: Oswald Buddenhagen Date: Fri Apr 28 11:59:36 2023 +0200 ALSA: emu10k1: remove pointless locks from timer code Contrary to its name, reg_lock locks the emu data structure, not the registers. As the functions access only data which is set once at card initialization, there is no point in locking it. Actually locking the registers would be pointless as well, as snd_emu10k1_intr_{en,dis}able() does its own locking, and TIMER is accessed only in this one place. Locking snd_emu10k1_timer_{start,stop}() against each other also wouldn't buy us anything; the functions interleaving their I/O accesses wouldn't introduce new problems. Signed-off-by: Oswald Buddenhagen Link: https://lore.kernel.org/r/20230428095941.1706278-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai commit b61cf04c49c3dfa70a0d6725d3eb40bf9b35cf71 Author: Nirmal Patel Date: Fri Feb 24 13:28:11 2023 -0700 PCI: vmd: Reset VMD config register between soft reboots VMD driver can disable or enable MSI remapping by changing VMCONFIG_MSI_REMAP register. This register needs to be set to the default value during soft reboots. Drives failed to enumerate when Windows boots after performing a soft reboot from Linux. Windows doesn't support MSI remapping disable feature and stale register value hinders Windows VMD driver initialization process. Adding vmd_shutdown function to make sure to set the VMCONFIG register to the default value. Link: https://lore.kernel.org/r/20230224202811.644370-1-nirmal.patel@linux.intel.com Fixes: ee81ee84f873 ("PCI: vmd: Disable MSI-X remapping when possible") Signed-off-by: Nirmal Patel Signed-off-by: Lorenzo Pieralisi Reviewed-by: Jon Derrick commit 0e12f830236928b6fadf40d917a7527f0a048d2f Author: Siddharth Vadapalli Date: Wed Mar 15 12:38:00 2023 +0530 PCI: cadence: Fix Gen2 Link Retraining process The Link Retraining process is initiated to account for the Gen2 defect in the Cadence PCIe controller in J721E SoC. The errata corresponding to this is i2085, documented at: https://www.ti.com/lit/er/sprz455c/sprz455c.pdf The existing workaround implemented for the errata waits for the Data Link initialization to complete and assumes that the link retraining process at the Physical Layer has completed. However, it is possible that the Physical Layer training might be ongoing as indicated by the PCI_EXP_LNKSTA_LT bit in the PCI_EXP_LNKSTA register. Fix the existing workaround, to ensure that the Physical Layer training has also completed, in addition to the Data Link initialization. Link: https://lore.kernel.org/r/20230315070800.1615527-1-s-vadapalli@ti.com Fixes: 4740b969aaf5 ("PCI: cadence: Retrain Link to work around Gen2 training defect") Signed-off-by: Siddharth Vadapalli Signed-off-by: Lorenzo Pieralisi Reviewed-by: Vignesh Raghavendra commit dd123dd01def6ad917703542cf7263865bed3239 Author: Biju Das Date: Mon Apr 17 10:01:58 2023 +0100 arm64: dts: renesas: r9a07g054: Add MTU3a node Add MTU3a node to R9A07G054 (RZ/V2L) SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230417090159.191346-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 26336d66d0216b7366f80ce9fca5f98d271d43ba Author: Biju Das Date: Mon Apr 17 10:01:57 2023 +0100 arm64: dts: renesas: r9a07g044: Add MTU3a node Add MTU3a node to R9A07G044 (RZ/G2L) SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230417090159.191346-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 0c63a51990872d3396f144fea41155c89a0f1a93 Author: Lad Prabhakar Date: Thu Apr 13 12:40:16 2023 +0100 arm64: dts: renesas: rzg2lc-smarc: Enable CRU, CSI support Enable CRU, CSI on RZ/G2LC SMARC EVK and tie the CSI to the OV5645 sensor using Device Tree overlay. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230413114016.16068-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 3cf6b4c685e635bf184ac01b09ea647f103f0c83 Author: Lad Prabhakar Date: Wed Apr 12 19:56:08 2023 +0100 arm64: dts: renesas: rzv2l-smarc: Enable CRU, CSI support Enable CRU, CSI on RZ/V2L SMARC EVK and tie the CSI to the OV5645 sensor using Device Tree overlay. RZ/G2L SMARC EVK and RZ/V2L SMARC EVK have the same connections for connecting the CSI to OV5645 sensor so just reuse the existing r9a07g044l2-smarc-cru-csi-ov5645.dtso and create a symbolic link to this file for RZ/V2L SMARC EVK. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230412185608.64628-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a3c95a54727a81a4f3bd65b05c2e8542b2821ec3 Author: Lad Prabhakar Date: Wed Apr 12 19:56:07 2023 +0100 arm64: dts: renesas: r9a07g054: Add CSI and CRU nodes Add CSI and CRU nodes to r9a07g054 (RZ/V2L) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230412185608.64628-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 961eed28296853a81d792654f392773800df91db Author: Biju Das Date: Tue Apr 11 11:03:46 2023 +0100 arm64: dts: renesas: rzg2lc-smarc: Link DSI with ADV7535 Enable DSI and ADV7535 and link DSI with ADV7535 on RZ/G2LC SMARC EVK. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230411100346.299768-9-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 6affac45357d88c7c67418617133df82454efabd Author: Biju Das Date: Tue Apr 11 11:03:45 2023 +0100 arm64: dts: renesas: rzg2l-smarc: Link DSI with ADV7535 Enable DSI and ADV7535 and link DSI with ADV7535 on RZ/G2L SMARC EVK. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230411100346.299768-8-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 33de13da4e2df73daeb38f94f2771a5ae031947d Author: Biju Das Date: Tue Apr 11 11:03:44 2023 +0100 arm64: dts: renesas: r9a07g054: Add DSI node Add DSI node to RZ/V2L SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230411100346.299768-7-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 862b676c3cadc8a1b1600f08408cdc5e030036e6 Author: Biju Das Date: Tue Apr 11 11:03:43 2023 +0100 arm64: dts: renesas: r9a07g044: Add DSI node Add DSI node to RZ/G2L SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230411100346.299768-6-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 79572c7f326ab977e1e9138643e4371067aec844 Author: Biju Das Date: Tue Apr 11 11:03:42 2023 +0100 arm64: dts: renesas: r9a07g054: Add vspd node Add vspd node to RZ/V2L SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230411100346.299768-5-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 9af677e0747965f30b6c3540d464d34e22da5336 Author: Biju Das Date: Tue Apr 11 11:03:41 2023 +0100 arm64: dts: renesas: r9a07g044: Add vspd node Add vspd node to RZ/G2L SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230411100346.299768-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit fad741768e7b9572fad05fe4523c76a236c4056a Author: Biju Das Date: Tue Apr 11 11:03:40 2023 +0100 arm64: dts: renesas: r9a07g054: Add fcpvd node Add fcpvd node to RZ/V2L SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230411100346.299768-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 7e16774770c57c5cad4d18acceec381673d44970 Author: Biju Das Date: Tue Apr 11 11:03:39 2023 +0100 arm64: dts: renesas: r9a07g044: Add fcpvd node Add fcpvd node to RZ/G2L SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230411100346.299768-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit c0aba9f328019fa8ba1b771ba0146ac61ce561ad Author: Rohit Agarwal Date: Fri Mar 31 11:48:18 2023 +0530 dt-bindings: PCI: qcom: Add SDX65 SoC Add PCIe EP compatible string for SDX65 SoC. Link: https://lore.kernel.org/r/1680243502-23744-2-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Rohit Agarwal Signed-off-by: Lorenzo Pieralisi Reviewed-by: Manivannan Sadhasivam Acked-by: Krzysztof Kozlowski commit b8e392245105b50706f18418054821e71e637288 Author: Luc Ma Date: Mon May 8 08:09:16 2023 +0800 drm/vram-helper: fix function names in vram helper doc Refer to drmm_vram_helper_init() instead of the non-existent drmm_vram_helper_alloc_mm(). Fixes: a5f23a72355d ("drm/vram-helper: Managed vram helpers") Signed-off-by: Luc Ma Reviewed-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/64583db2.630a0220.eb75d.8f51@mx.google.com commit 7f91fe3a71aa43700eac2650e3b01d50cbbb6f48 Author: Wolfram Sang Date: Tue May 2 19:06:17 2023 +0200 clk: renesas: r8a779a0: Add PWM clock Tested-by: Kieran Bingham Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20230502170618.55967-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 51cbbcd6469b2a32e222ec220039af20a16f2769 Author: Liang He Date: Wed Jun 15 20:51:05 2022 +0800 w1: Add missing of_node_put() in w1.c In __w1_attach_slave_device, we really need not to use of_node_put in normal path as the reference is escaped by sl. However, we need of_node_put in the fail path before put_device. Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220615125105.3966317-1-windhl@126.com [krzysztof: fix whitespace / checkpatch] Signed-off-by: Krzysztof Kozlowski commit ecaed1a26f7215f48420a9c02e229b84b5fbb882 Author: Jason Wang Date: Sun May 8 10:34:00 2022 +0800 w1: no need to initialise statics to 0 Static variables do not need to be initialised to 0, because compiler will initialise all uninitialised statics to 0. Thus, remove the unneeded initializations. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20220508023400.102244-1-wangborong@cdjrlc.com Signed-off-by: Krzysztof Kozlowski commit ee896c5bf21cbac3bed8f958507a449168e965d3 Author: Colin Ian King Date: Sun May 22 20:46:22 2022 +0100 w1: ds2438: remove redundant initialization of variable crc Variable crc is being initialized with a value that is never read, it is being re-assigned later on. The initialization is redundant and can be removed. Cleans up clang scan build warning: warning: Value stored to 'crc' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220522194622.13277-1-colin.i.king@gmail.com Signed-off-by: Krzysztof Kozlowski commit 7f25058c96a0631f4a1ccb4c70831c52e71decf2 Author: Julia Lawall Date: Sat May 21 13:10:16 2022 +0200 w1: w1_therm: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220521111145.81697-6-Julia.Lawall@inria.fr Signed-off-by: Krzysztof Kozlowski commit 1aa75bf5174c8243505a27476422060fce630cb1 Author: Haowen Bai Date: Thu Mar 10 18:29:29 2022 +0800 w1: w1_therm: Use max() instead of doing it manually Fix following coccicheck warning: drivers/w1/slaves/w1_therm.c:1452:18-19: WARNING opportunity for max() Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1646908169-8050-1-git-send-email-baihaowen@meizu.com Signed-off-by: Krzysztof Kozlowski commit 83f3fcf96fcc7e5405b37d9424c7ef26bfa203f8 Author: Dan Carpenter Date: Wed May 19 17:17:45 2021 +0300 w1: fix loop in w1_fini() The __w1_remove_master_device() function calls: list_del(&dev->w1_master_entry); So presumably this can cause an endless loop. Fixes: 7785925dd8e0 ("[PATCH] w1: cleanups.") Signed-off-by: Dan Carpenter Signed-off-by: Krzysztof Kozlowski commit 9033ff4c0fc65f3f168ee029b7e302a999c152ca Author: Colin Ian King Date: Wed Jul 21 11:34:51 2021 +0100 w1: remove redundant initialization to variable result The variable result is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210721103451.43026-1-colin.king@canonical.com Signed-off-by: Krzysztof Kozlowski commit a8c4dda94115c4079d3aaa35ba238f2376b6aa53 Author: zuoqilin Date: Fri Jun 18 17:24:18 2021 +0800 w1: Simplify the atribute show There is no necessary to define variable assignment, return directly. Signed-off-by: zuoqilin Link: https://lore.kernel.org/r/20210618092418.1424-1-zuoqilin1@163.com Signed-off-by: Krzysztof Kozlowski commit 4f5a5badb4eee46e43dc45be5e6058bff767eb80 Author: Krzysztof Kozlowski Date: Wed Nov 20 21:38:26 2019 +0800 w1: Fix Kconfig indentation Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20191120133826.12964-1-krzk@kernel.org Signed-off-by: Krzysztof Kozlowski commit 5dfd3c73ff81618fee0ef682b6fd7779863f41e4 Author: Wolfram Sang Date: Thu Aug 18 23:01:21 2022 +0200 w1: sgi: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210121.7589-1-wsa+renesas@sang-engineering.com Signed-off-by: Krzysztof Kozlowski commit 388f22fe5d91d707352b4b743368b30e21d9d9bf Author: Lizhe Date: Sun Mar 19 12:41:07 2023 +0800 w1: Remove driver match function If there is no driver match function, the driver core assumes that each candidate pair (driver, device) matches, see driver_match_device(). Drop the bus's match function that always returned 1 and so implements the same behaviour as when there is no match function Signed-off-by: Lizhe Link: https://lore.kernel.org/r/20230319044107.311555-1-sensor1010@163.com Signed-off-by: Krzysztof Kozlowski commit dca5480ab7b77a889088ab7cac81934604510ac7 Author: Stefan Wahren Date: Thu Apr 27 13:21:52 2023 +0200 w1: w1_therm: fix locking behavior in convert_t The commit 67b392f7b8ed ("w1_therm: optimizing temperature read timings") accidentially inverted the logic for lock handling of the bus mutex. Before: pullup -> release lock before sleep no pullup -> release lock after sleep After: pullup -> release lock after sleep no pullup -> release lock before sleep This cause spurious measurements of 85 degree (powerup value) on the Tarragon board with connected 1-w temperature sensor (w1_therm.w1_strong_pull=0). In the meantime a new feature for polling the conversion completion has been integrated in these branches with commit 021da53e65fd ("w1: w1_therm: Add sysfs entries to control conversion time and driver features"). But this feature isn't available for parasite power mode, so handle this separately. Link: https://lore.kernel.org/regressions/2023042645-attentive-amends-7b0b@gregkh/T/ Fixes: 67b392f7b8ed ("w1_therm: optimizing temperature read timings") Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/20230427112152.12313-1-stefan.wahren@i2se.com Signed-off-by: Krzysztof Kozlowski commit 5fd7c99ecf45c8ee8a9b1268f0ffc91cc6271da2 Author: Vijaya Krishna Nivarthi Date: Tue Apr 25 14:12:08 2023 +0530 spi: spi-geni-qcom: Correct CS_TOGGLE bit in SPI_TRANS_CFG The CS_TOGGLE bit when set is supposed to instruct FW to toggle CS line between words. The driver with intent of disabling this behaviour has been unsetting BIT(0). This has not caused any trouble so far because the original BIT(1) is untouched and BIT(0) likely wasn't being used. Correct this to prevent a potential future bug. Signed-off-by: Vijaya Krishna Nivarthi Date: Fri May 5 14:41:59 2023 +0800 spi: lpspi: run transfer speed_hz sanity check Avoid config.speed_hz is 0 when it is a divisor. Signed-off-by: Han Xu Date: Wed May 3 10:20:36 2023 +0200 dt-bindings: spi: zynqmp-qspi: Add power-domains and iommus properties ZynqMP QSPI IP core has own power domain and also iommu ID that's why describe optional power-domains and iommus properties. Signed-off-by: Michal Simek Date: Thu Apr 27 12:33:11 2023 +0000 spi: dw: Move dw_spi_can_dma() Move dw_spi_can_dma() implementation below dw_spi_dma_convert_width() for handing compile dependency in future patches. * tested on Baikal-T1 based system with DW SPI-looped back interface transferring a chunk of data with DFS:8,12,16. Signed-off-by: Joy Chakraborty Date: Thu Apr 27 12:33:10 2023 +0000 spi: dw: Add 32 bpw support to SPI DW DMA driver Add Support for AxSize = 4 bytes configuration from dw dma driver if n_bytes i.e. number of bytes per write to fifo is 4. Number of bytes written to fifo per write is depended on the bits/word configuration being used which the DW core driver translates to n_bytes. Hence, for bits per word values between 17 and 32 n_bytes should be equal to 4. * tested on Baikal-T1 based system with DW SPI-looped back interface transferring a chunk of data with DFS:8,12,16. Signed-off-by: Joy Chakraborty Date: Tue May 2 15:28:13 2023 +0900 spi: s3c64xx: support interrupt based pio mode Support interrupt based pio mode to optimize cpu usage. When transmitting data size is larget than 32 bytes, operates with interrupt based pio mode. By using the FIFORDY INT, an interrupt can be triggered when the desired size of data has been received. Using this, we can support interrupt based pio mode. Signed-off-by: Jaewon Kim Date: Tue May 2 15:28:12 2023 +0900 spi: s3c64xx: add sleep during transfer In polling mode, the status register is continuously read to check data transfer completion. It can cause excessive CPU usage. To reduce this, we can calculate the transfer time and put the sleep during transfer. When test on ExynosAuto9 SADK board, throughput remained the same, but 100% CPU utilization decreased to 40%. Signed-off-by: Jaewon Kim Date: Tue May 2 15:28:11 2023 +0900 spi: s3c64xx: change polling mode to optional Previously, Polling mode was supported as quirk for SOC without DMA. To provide more flexible support for polling mode, it changed to polling mode when the 'dmas' property is not present in the devicetree, rather than using a quirk. Signed-off-by: Jaewon Kim Date: Mon Apr 24 15:02:41 2023 +0530 spi: spi-qcom-qspi: Add DMA mode support Current driver supports only PIO mode. HW supports DMA, so add DMA mode support to the driver for better performance for larger xfers. Signed-off-by: Vijaya Krishna Nivarthi Date: Mon Apr 24 15:02:37 2023 +0530 spi: dt-bindings: qcom,spi-qcom-qspi: Add iommus Add iommus binding for DMA mode support Signed-off-by: Vijaya Krishna Nivarthi Date: Sat May 6 00:02:18 2023 +0200 regulator: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Date: Fri Apr 7 07:47:33 2023 -0400 regmap-irq: Drop map from handle_mask_sync() parameters Remove the map parameter from the struct regmap_irq_chip callback handle_mask_sync() because it can be passed via the irq_drv_data parameter instead. The gpio-104-dio-48e driver is the only consumer of this callback and is thus updated accordingly. Reviewed-by: Linus Walleij Date: Mon Mar 20 10:50:15 2023 -0400 gpio: 104-dio-48e: Implement struct dio48e_gpio A private data structure struct dio48e_gpio is introduced to facilitate passage of the regmap and IRQ mask state for the device to the callback dio48e_handle_mask_sync(). This is in preparation for the removal of the handle_mask_sync() map parameter in a subsequent patch. Signed-off-by: William Breathitt Gray Date: Fri May 5 15:55:22 2023 +0800 ASoC: fsl_sai: MCLK bind with TX/RX enable bit On i.MX8MP, the sai MCLK is bound with TX/RX enable bit, which means the TX/RE enable bit need to be enabled then MCLK can be output on PAD. Some codec (for example: WM8962) needs the MCLK output earlier, otherwise there will be issue for codec configuration. Add new soc data "mclk_with_tere" for this platform and enable the MCLK output in startup stage. As "mclk_with_tere" only applied to i.MX8MP, currently The soc data is shared with i.MX8MN, so need to add an i.MX8MN own soc data with "mclk_with_tere" disabled. Signed-off-by: Shengjiu Wang Date: Fri May 5 08:45:38 2023 +0800 ASoC: codecs: wcd938x: Remove unneeded semicolon ./sound/soc/codecs/wcd938x-sdw.c:1274:2-3: Unneeded semicolon Reported-by: Abaci Robot Date: Sat May 6 16:22:09 2023 +0530 ASoC: dt-bindings: nau8540: Convert to dtschema Convert the NAU8540 audio CODEC bindings to DT schema Signed-off-by: Anup Sharma V2: Adhere to the correct procedure by including the maintainer's name. Drop Mark from maintainer. Link: https://lore.kernel.org/r/ZFYxWVdE9YkMKvXv@yoga Signed-off-by: Mark Brown Date: Wed Apr 26 17:52:02 2023 +0530 ASoC: amd: ps: refactor acp power on and reset functions. Instead of a busy waiting while loop using udelay in acp63_power_on and acp63_reset functions use readl_poll_timeout function to check the condition. Signed-off-by: Syed Saba Kareem Date: Wed Apr 26 17:52:01 2023 +0530 ASoC: amd: ps: remove the register read and write wrappers. Instead of acp63_readl() and acp63_writel() wrappers readl and writel functions can be used directly. Remove acp63_readl() and acp63_writel() wrappers. Signed-off-by: Syed Saba Kareem Date: Tue Apr 25 11:57:16 2023 +0200 ASoC: Switch i2c drivers back to use .probe() After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König Date: Thu Apr 20 18:02:12 2023 +0000 ASoC: amd: ps: Update copyright notice The most recent changes to ASoC, such as new module parameters, date to the year 2023. Update copyright statement accordingly. Signed-off-by: Carlos Bilbao Date: Fri May 5 08:35:21 2023 +0300 ASoC: dwc: extend supported formats The COMP1_TX_WORDSIZE_0/COMP2_RX_WORDSIZE_0 fields in the comp registers indicate the maximum wordsize supported. DWC I2S controller can operate with any smaller wordsize. So extend the formats to let I2S to operate in any allowed modes. Signed-off-by: Maxim Kochetkov Date: Tue Apr 25 18:22:46 2023 +0100 ASoC: rt5682: Use a maple tree based register cache regmap has introduced a maple tree based register cache which makes use of this more advanced data structure which has been added to the kernel recently. Maple trees are much flatter than rbtrees, meaning that they do not grow to such depths when the register map is sparse which makes access a bit more efficient. The maple tree cache type is still a bit of a work in progress but should be effective for some devices already. RT5682 seems like a good candidate for maple tree. It only supports single register read/write operations so will gain minimal benefit from storing the register data in device native format like rbtree does (none for SoundWire) and has some sparsity in the register map which is a good fit for maple tree. Convert to use maple tree. There should be little if any visible difference at runtime. Signed-off-by: Mark Brown Date: Fri Apr 21 16:48:10 2023 -0500 ASoC: dt-bindings: More dropping unneeded quotes Another batch of dropping unneeded quotes on $id and $schema which were missed in the last round. Once all these are fixed, checking for this can be enabled in yamllint. Signed-off-by: Rob Herring Date: Sun May 7 19:45:43 2023 +0200 ASoC: dt-bindings: google,sc7180-trogdor: allow up to four codec DAIs SC7180 Trogdor sound cards come with multiple audio amplifiers, so allow up to four of them to fix dtbs_check warnings like: sc7180-trogdor-homestar-r3.dtb: sound: dai-link@1:codec:sound-dai: [[275], [276], [277], [278]] is too long Signed-off-by: Krzysztof Kozlowski Date: Fri Apr 21 17:35:46 2023 +0100 ASoC: rt715: Use maple tree register cache regmap has introduced a maple tree based register cache which makes use of this more advanced data structure which has been added to the kernel recently. Maple trees are much flatter than rbtrees, meaning that they do not grow to such depths when the register map is sparse which makes access a bit more efficient. The maple tree cache type is still a bit of a work in progress but should be effective for some devices already. RT715 seems like a good candidate for maple tree. It is a SoundWire MBQ device and therefore supports only single register read/write operations which do not use raw I/O and will therefore save the cost of converting to and from device native format when accessing the cache while not having a negative impact from the current lack of bulk operations in maple tree cache sync. It has a moderately large and quite sparse register map which is a good fit for storing in a maple tree. Convert to use maple tree. There should be little if any visible difference at runtime. Signed-off-by: Mark Brown Date: Thu May 4 10:16:18 2023 +0300 ASoC: dt-bindings: designware-i2s: add optional resets Some SoC may have resets for I2S subsystem. So add optional resets support. Signed-off-by: Maxim Kochetkov Date: Thu May 4 10:16:17 2023 +0300 ASoC: dwc: add optional reset support Some SoC may have resets for I2S subsystem. So add optional reset support. Signed-off-by: Maxim Kochetkov Date: Wed May 3 13:34:12 2023 +0200 ASoC: mediatek: mt8195-afe-pcm: Simplify with dev_err_probe() Shorten the probe function by switching to dev_err_probe() where possible. Signed-off-by: AngeloGioacchino Del Regno Date: Wed May 3 13:34:11 2023 +0200 ASoC: mediatek: mt8195-afe-pcm: Simplify runtime PM during probe Use devm_pm_runtime_enable() and pm_runtime_resume_and_get() to to simplify the probe function. Signed-off-by: AngeloGioacchino Del Regno Date: Wed May 3 13:34:13 2023 +0200 ASoC: mediatek: mt8195-afe-pcm: Clean up unnecessary functions Function mt8195_afe_init_registers() performs just a single call to regmap_multi_reg_write(), it returns int and it's not error checked; move that call to the probe function and also add some error check. While at it, also move the contents of mt8195_afe_parse_of() to the probe function as well: since this is getting a handle to topckgen and since that's optional, the ifdef for CONFIG_SND_SOC_MT6359 can also be removed. Signed-off-by: AngeloGioacchino Del Regno Date: Wed May 3 13:34:10 2023 +0200 ASoC: SOF: mediatek: mt8186: Use snd_sof_ipc_process_reply() helper Function mt8186_get_reply() performs practically the same operation as the common snd_sof_ipc_get_reply() helper: removing the custom function allows us to simply perform a call to the sof-priv helper snd_sof_ipc_process_reply(), simplifying and shortening this driver and getting all the benefits of using a common API. Signed-off-by: AngeloGioacchino Del Regno Date: Wed May 3 13:34:09 2023 +0200 ASoC: SOF: mediatek: mt8195: Use snd_sof_ipc_process_reply() helper Function mt8195_get_reply() performs practically the same operation as the common snd_sof_ipc_get_reply() helper: removing the custom function allows us to simply perform a call to the sof-priv helper snd_sof_ipc_process_reply(), simplifying and shortening this driver and getting all the benefits of using a common API. Signed-off-by: AngeloGioacchino Del Regno Date: Mon Apr 24 02:37:38 2023 +0000 ASoC: soc-topology.c: add comment for Platform/Codec Not only Platform but Codec also might be overwritten on Topology. This patch adds comment about it not to use asoc_dummy_dlc here. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:37:24 2023 +0000 ASoC: simple_card_utils.c: use asoc_dummy_dlc Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:37:17 2023 +0000 ASoC: intel: skylake: use asoc_dummy_dlc Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:37:11 2023 +0000 ASoC: intel: sof: use asoc_dummy_dlc Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:37:06 2023 +0000 ASoC: intel: avs: use asoc_dummy_dlc Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:36:59 2023 +0000 ASoC: meson: use asoc_dummy_dlc Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:36:52 2023 +0000 ASoC: atmel: use asoc_dummy_dlc Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:36:44 2023 +0000 ASoC: qcom: use asoc_dummy_dlc Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:36:37 2023 +0000 ASoC: fsl: use asoc_dummy_dlc Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:36:28 2023 +0000 ASoC: amd: use asoc_dummy_dlc Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:36:19 2023 +0000 ASoC: sof: use asoc_dummy_dlc Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:36:04 2023 +0000 ASoC: ti: use asoc_dummy_dlc Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 24 02:35:32 2023 +0000 ASoC: soc-utils.c: add asoc_dummy_dlc ASoC uses dummy Component, sharing snd_soc_dai_link_component for it is better idea. This patch adds it. Signed-off-by: Kuninori Morimoto Date: Mon Apr 17 11:47:28 2023 +0800 riscv: dts: starfive: Add PMU controller node Add the pmu controller node for the StarFive JH7110 SoC. The PMU needs to be used by other modules, e.g. VPU,ISP,etc. Reviewed-by: Conor Dooley Reviewed-by: Hal Feng Signed-off-by: Walker Chen Signed-off-by: Conor Dooley commit b3bd64bc457ca778258cfb3e392d9296f11b396e Author: Conor Dooley Date: Thu May 4 23:06:06 2023 +0100 MAINTAINERS: exclude maintained subdirs in RISC-V misc DT entry The Allwinner & Renesas stuff doesn't go through my tree, so it is a wee bit misleading to have them match against the "misc" entry in MAINTAINERS. Signed-off-by: Conor Dooley commit b9f8ca655d803a49266e73e26729882418407166 Author: Tianling Shen Date: Sat May 6 14:11:08 2023 +0800 arm64: dts: rockchip: Add Lunzn Fastrhino R68S It's similar to Fastrhino R66S with the following changes: + 2/4GB LPDDR4 RAM + 2x 1000 Base-T (native, RTL8211f) + ADC button + 16GB eMMC on-board - No SD card slot Signed-off-by: Tianling Shen Link: https://lore.kernel.org/r/20230506061108.17658-3-cnsztl@gmail.com Signed-off-by: Heiko Stuebner commit c79dab407afddaf405ee8a825f434fab89fbf0c6 Author: Tianling Shen Date: Sat May 6 14:11:07 2023 +0800 arm64: dts: rockchip: Add Lunzn Fastrhino R66S Lunzn Fastrhino R66S is a high-performance mini router. Specification: - Rockchip RK3568 - 1/2GB LPDDR4 RAM - SD card slot - 2x USB 3.0 Port - 2x 2500 Base-T (PCIe, r8125b) - 12v DC Jack Signed-off-by: Tianling Shen Link: https://lore.kernel.org/r/20230506061108.17658-2-cnsztl@gmail.com Signed-off-by: Heiko Stuebner commit 1f8af7aa2796653f5c3c0ed5c4df564ac5b7aba3 Author: Tianling Shen Date: Sat May 6 14:11:06 2023 +0800 dt-bindings: Add doc for Fastrhino R66S / R68S Add devicetree binding documentation for the Lunzn Fastrhino R66S and R68S boards. Acked-by: Krzysztof Kozlowski Signed-off-by: Tianling Shen Link: https://lore.kernel.org/r/20230506061108.17658-1-cnsztl@gmail.com Signed-off-by: Heiko Stuebner commit 09d5fef31f9058e3b39e3a6b8870b6fb9f28091d Author: Cristian Ciocaltea Date: Wed Apr 19 21:13:09 2023 +0300 arm64: dts: rockchip: Add rk3588 timer Add DT node for Rockchip RK3588/RK3588S SoC timer. Signed-off-by: Cristian Ciocaltea Link: https://lore.kernel.org/r/20230419181309.338354-4-cristian.ciocaltea@collabora.com Signed-off-by: Heiko Stuebner commit 06cdac8e840767f801bbd94ed991354a206adf1f Author: Sebastian Reichel Date: Tue Apr 18 16:21:09 2023 +0200 arm64: dts: rockchip: add GIC ITS support to rk3588 Add the two Interrupt Translation Service (ITS) IPs that are part of the GIC-600. They are mainly required for PCIe Message Signalled Interrupts (MSI). Co-developed-by: Kever Yang Signed-off-by: Kever Yang Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230418142109.49762-3-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 7224aefbdf66280880b0fd90c516bb968232ed2c Author: Sebastian Reichel Date: Mon Apr 3 22:23:01 2023 +0200 dt-bindings: soc: rockchip: add rk3588 usb2phy syscon The usb2phy is accessible via a syscon registers on RK3588, similar to rk3399. Signed-off-by: Sebastian Reichel Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230403202307.120562-2-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 814f5a42520ebf0bf26a06e2d0ddd1c7d08f32c2 Author: Boris Brezillon Date: Mon Apr 3 21:32:50 2023 +0200 soc: rockchip: power-domain: add rk3588 mem module support On RK3588 it's also possible to power down the memory used by the particular power domains via PMU_MEM_PWR_GATE_SFTCON. This adds support for this feature. Tested-by: Vincent Legoll Co-Developed-by: Finley Xiao Signed-off-by: Finley Xiao Signed-off-by: Boris Brezillon Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230403193250.108693-3-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 6e61c5fa4d43d4c3f780f74ba6b08dba80bd653a Merge: e04ddf179c2ac 798e48fc28fa6 Author: Alexei Starovoitov Date: Sat May 6 16:42:58 2023 -0700 Merge branch 'Dynptr Verifier Adjustments' Daniel Rosenberg says: ==================== These patches relax a few verifier requirements around dynptrs. Patches 1-3 are unchanged from v2, apart from rebasing Patch 4 is the same as in v1, see https://lore.kernel.org/bpf/CA+PiJmST4WUH061KaxJ4kRL=fqy3X6+Wgb2E2rrLT5OYjUzxfQ@mail.gmail.com/ Patch 5 adds a test for the change in Patch 4 ==================== Signed-off-by: Alexei Starovoitov commit 798e48fc28fa64aa4eca6e8a404fa20ac8f7c09e Author: Daniel Rosenberg Date: Fri May 5 18:31:34 2023 -0700 selftests/bpf: Accept mem from dynptr in helper funcs This ensures that buffers retrieved from dynptr_data are allowed to be passed in to helpers that take mem, like bpf_strncmp Signed-off-by: Daniel Rosenberg Link: https://lore.kernel.org/r/20230506013134.2492210-6-drosen@google.com Signed-off-by: Alexei Starovoitov commit 2012c867c8005d72c949e274133df429ece78808 Author: Daniel Rosenberg Date: Fri May 5 18:31:33 2023 -0700 bpf: verifier: Accept dynptr mem as mem in helpers This allows using memory retrieved from dynptrs with helper functions that accept ARG_PTR_TO_MEM. For instance, results from bpf_dynptr_data can be passed along to bpf_strncmp. Signed-off-by: Daniel Rosenberg Link: https://lore.kernel.org/r/20230506013134.2492210-5-drosen@google.com Signed-off-by: Alexei Starovoitov commit 3881fdfed21ff129a23979c0a92df6d3c5f49aa9 Author: Daniel Rosenberg Date: Fri May 5 18:31:32 2023 -0700 selftests/bpf: Check overflow in optional buffer This ensures we still reject invalid memory accesses in buffers that are marked optional. Signed-off-by: Daniel Rosenberg Link: https://lore.kernel.org/r/20230506013134.2492210-4-drosen@google.com Signed-off-by: Alexei Starovoitov commit 1ce33b6c846fbe0439eeee477b767de4bc3ad35f Author: Daniel Rosenberg Date: Fri May 5 18:31:31 2023 -0700 selftests/bpf: Test allowing NULL buffer in dynptr slice bpf_dynptr_slice(_rw) no longer requires a buffer for verification. If the buffer is needed, but not present, the function will return NULL. Signed-off-by: Daniel Rosenberg Link: https://lore.kernel.org/r/20230506013134.2492210-3-drosen@google.com Signed-off-by: Alexei Starovoitov commit 3bda08b63670c39be390fcb00e7718775508e673 Author: Daniel Rosenberg Date: Fri May 5 18:31:30 2023 -0700 bpf: Allow NULL buffers in bpf_dynptr_slice(_rw) bpf_dynptr_slice(_rw) uses a user provided buffer if it can not provide a pointer to a block of contiguous memory. This buffer is unused in the case of local dynptrs, and may be unused in other cases as well. There is no need to require the buffer, as the kfunc can just return NULL if it was needed and not provided. This adds another kfunc annotation, __opt, which combines with __sz and __szk to allow the buffer associated with the size to be NULL. If the buffer is NULL, the verifier does not check that the buffer is of sufficient size. Signed-off-by: Daniel Rosenberg Link: https://lore.kernel.org/r/20230506013134.2492210-2-drosen@google.com Signed-off-by: Alexei Starovoitov commit e04ddf179c2acb6de841016e5bcf29b26705b4ec Merge: f4dea9689c5fe 49e0263ab40f1 Author: Alexei Starovoitov Date: Sat May 6 13:56:38 2023 -0700 Merge branch 'Introduce a new kfunc of bpf_task_under_cgroup' Feng zhou says: ==================== Trace sched related functions, such as enqueue_task_fair, it is necessary to specify a task instead of the current task which within a given cgroup. ==================== Signed-off-by: Alexei Starovoitov commit 49e0263ab40f15a11cefa397bb17a0204505cead Author: Feng Zhou Date: Sat May 6 11:15:45 2023 +0800 selftests/bpf: Add testcase for bpf_task_under_cgroup test_progs: Tests new kfunc bpf_task_under_cgroup(). The bpf program saves the new task's pid within a given cgroup to the remote_pid, which is convenient for the user-mode program to verify the test correctness. The user-mode program creates its own mount namespace, and mounts the cgroupsv2 hierarchy in there, call the fork syscall, then check if remote_pid and local_pid are unequal. Signed-off-by: Feng Zhou Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230506031545.35991-3-zhoufeng.zf@bytedance.com Signed-off-by: Alexei Starovoitov commit b5ad4cdc46c7d6e7f8d2c9e24b6c9a1edec95154 Author: Feng Zhou Date: Sat May 6 11:15:44 2023 +0800 bpf: Add bpf_task_under_cgroup() kfunc Add a kfunc that's similar to the bpf_current_task_under_cgroup. The difference is that it is a designated task. When hook sched related functions, sometimes it is necessary to specify a task instead of the current task. Signed-off-by: Feng Zhou Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230506031545.35991-2-zhoufeng.zf@bytedance.com Signed-off-by: Alexei Starovoitov commit e1141b0c625e495006c814edc3ffc58ef9ee86b5 Author: Marek Vasut Date: Sat May 6 11:40:03 2023 -0700 Input: ili210x - probe even if no resolution information Probe the touch controller driver even if resolution information is not available. This can happen e.g. in case the touch controller suffered a failed firmware update and is stuck in bootloader mode. Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230217025200.203833-1-marex@denx.de Signed-off-by: Dmitry Torokhov commit 8ddce13ae696bf40397eac7ba2e9003113f94030 Author: Marek Vasut Date: Tue Apr 4 00:12:33 2023 +0200 drm/bridge: lt9611: Do not generate HFP/HBP/HSA and EOT packet Do not generate the HS front and back porch gaps, the HSA gap and EOT packet, as these packets are not required. This makes the bridge work with Samsung DSIM on i.MX8MM and i.MX8MP. Signed-off-by: Marek Vasut Reviewed-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230403221233.500485-2-marex@denx.de commit b18f1ecaaf4aa8704a02de1accf8c94fa06f1ceb Author: Marek Vasut Date: Tue Apr 4 00:12:32 2023 +0200 drm/bridge: lt9211: Do not generate HFP/HBP/HSA and EOT packet Do not generate the HS front and back porch gaps, the HSA gap and EOT packet, as these packets are not required. This makes the bridge work with Samsung DSIM on i.MX8MM and i.MX8MP. Signed-off-by: Marek Vasut Reviewed-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230403221233.500485-1-marex@denx.de commit 760133d42f0adc92b8408ad5544c98f8aefbc75f Author: John Harrison Date: Tue May 2 16:40:07 2023 -0700 drm/i915/uc: Make unexpected firmware versions an error in debug builds If the DEBUG_GEM config option is set then escalate the 'unexpected firmware version' message from a notice to an error. This will ensure that the CI system treats such occurences as a failure and logs a bug about it (or fails the pre-merge testing). Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230502234007.1762014-7-John.C.Harrison@Intel.com commit bef550c952a71df6a6e86b11bdac5b10dac29163 Author: John Harrison Date: Tue May 2 16:40:06 2023 -0700 drm/i915/uc: Reject duplicate entries in firmware table It was noticed that duplicate entries in the firmware table could cause an infinite loop in the firmware loading code if that entry failed to load. Duplicate entries are a bug anyway and so should never happen. Ensure they don't by tweaking the table validation code to reject duplicates. For full m/m/p files, that can be done by simply tweaking the patch level check to reject matching values. For reduced version entries, the filename itself must be compared. v2: Improve comment (review by Daniele) Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230502234007.1762014-6-John.C.Harrison@Intel.com commit edba77891b58a1f0626daf8598717b8efb307bc8 Author: John Harrison Date: Tue May 2 16:40:05 2023 -0700 drm/i915/uc: Enhancements to firmware table validation The validation of the firmware table was being done inside the code for scanning the table for the next available firmware blob. Which is unnecessary. So pull it out into a separate function that is only called once per blob type at init time. Also, drop the CONFIG_SELFTEST requirement and make errors terminal. It was mentioned that potential issues with backports would not be caught by regular pre-merge CI as that only occurs on tip not stable branches. Making the validation unconditional and failing driver load on detecting of a problem ensures that such backports will also be validated correctly. This requires adding a firmware global flag to indicate an issue with any of the per firmware tables. This is done rather than adding a new state enum as a new enum value would be a much more invasive change - lots of places would need updating to support the new error state. Note also that this change means that a table error will cause the driver to wedge even on platforms that don't require firmware files. This is intentional as per the above backport concern - someone doing backports is not guaranteed to test on every platform that they may potential affect. So forcing a failure on all platforms ensures that the problem will be noticed and corrected immediately. v2: Change to unconditionally fail module load on a validation error (review feedback/discussion with Daniele). v3: Add a new flag to track table validation errors (review feedback/discussion with Daniele). Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230502234007.1762014-5-John.C.Harrison@Intel.com commit c354feb5895fe80fd3f896443015cf53d5cf98e8 Author: John Harrison Date: Tue May 2 16:40:03 2023 -0700 drm/i915/guc: Print status register when waiting for GuC to load If the GuC load is taking an excessively long time, the wait loop currently prints the GT frequency. Extend that to include the GuC status as well so we can see if the GuC is actually making progress or not. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230502234007.1762014-3-John.C.Harrison@Intel.com commit 6b8bfff56b2140396fd28088ad2dca4463aef9c9 Author: John Harrison Date: Tue May 2 16:40:02 2023 -0700 drm/i915/guc: Decode another GuC load failure case Explain another potential firmware failure mode and early exit the long wait if hit. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230502234007.1762014-2-John.C.Harrison@Intel.com commit 5672bd308ef23b81eb40dd2963f925fd671a66c2 Author: Philipp Puschmann Date: Fri May 5 11:48:45 2023 -0700 Input: edt-ft5x06 - add delay after waking up The touch controller needs some time to wake-up after setting the wake-up gpio. Without having a delay after wake-up probing regularly fails in edt_ft5x06_ts_identify() with an error (i.e. EREMOTEIO) that was caused by a failed i2c transfer. The datasheet sets the wake-up time to 5 ms, although it is not entirely clear. Signed-off-by: Philipp Puschmann Link: https://lore.kernel.org/r/20230505115823.545803-1-p.puschmann@pironex.com Signed-off-by: Dmitry Torokhov commit 3c98b8dbdced5d93cc7dfed0a1991fb265488bd9 Author: Maximilian Weigand Date: Fri May 5 11:30:12 2023 -0700 Input: cyttsp5 - implement proper sleep and wakeup procedures The touchscreen can be put into a deep sleep state that prevents it from emitting touch irqs. Put the touchscreen into deep sleep during suspend if it is not marked as a wakeup source. This also fixes a problem with the touchscreen getting unresponsive after system resume when a falling edge trigger is used for the interrupt. When left on during suspend, the touchscreen would pull the interrupt line down in response to touch events, leaving the interrupt effectively disabled after resume. Signed-off-by: Maximilian Weigand Reviewed-by: Alistair Francis Link: https://lore.kernel.org/r/20230504120316.408687-2-mweigand2017@gmail.com Signed-off-by: Dmitry Torokhov commit c73b4db076faf827d0656665ef5e97b76926b60f Author: Dmitry Torokhov Date: Fri May 5 11:16:29 2023 -0700 Input: tests - fix input_test_match_device_id test Properly initialize input_device_id structure in input_test_match_device_id test to make sure it contains no garbage causing the test to randomly fail. Fixes: fdefcbdd6f36 ("Input: Add KUnit tests for some of the input core helper functions") Reported-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Link: https://lore.kernel.org/r/ZFLI7T2qZTGJ1UUK@google.com Signed-off-by: Dmitry Torokhov commit e4a5e4442a8065c6959e045c061de801d545226d Author: Francesco Dolcini Date: Thu Apr 27 16:29:34 2023 +0200 drm/bridge: tc358768: remove unused variable Remove the unused phy_delay_nsk variable, before it was wrongly used to compute some register value, the fixed computation is no longer using it and therefore can be removed. Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-10-francesco@dolcini.it commit bac7842cd179572e8e0fc2d7b5254e40c6e9e057 Author: Francesco Dolcini Date: Thu Apr 27 16:29:33 2023 +0200 drm/bridge: tc358768: fix THS_TRAILCNT computation Correct computation of THS_TRAILCNT register. This register must be set to a value that ensure that THS_TRAIL > 60 ns + 4 x UI and THS_TRAIL > 8 x UI and THS_TRAIL < TEOT with TEOT = 105 ns + (12 x UI) with the actual value of THS_TRAIL being (1 + THS_TRAILCNT) x ByteClk cycle + ((1 to 2) + 2) xHSBYTECLK cycle + - (PHY output delay) with PHY output delay being about (8 + (5 to 6)) x MIPIBitClk cycle in the BitClk conversion. Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-9-francesco@dolcini.it commit 3666aad8185af8d0ce164fd3c4974235417d6d0b Author: Francesco Dolcini Date: Thu Apr 27 16:29:32 2023 +0200 drm/bridge: tc358768: fix TXTAGOCNT computation Correct computation of TXTAGOCNT register. This register must be set to a value that ensure that the TTA-GO period = (4 x TLPX) with the actual value of TTA-GO being 4 x (TXTAGOCNT + 1) x (HSByteClk cycle) Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-8-francesco@dolcini.it commit 77a089328da791118af9692543a5eedc79eb5fd4 Author: Francesco Dolcini Date: Thu Apr 27 16:29:31 2023 +0200 drm/bridge: tc358768: fix THS_ZEROCNT computation Correct computation of THS_ZEROCNT register. This register must be set to a value that ensure that THS_PREPARE + THS_ZERO > 145ns + 10*UI with the actual value of (THS_PREPARE + THS_ZERO) being ((1 to 2) + 1 + (TCLK_ZEROCNT + 1) + (3 to 4)) x ByteClk cycle + + HSByteClk x (2 + (1 to 2)) + (PHY delay) with PHY delay being about (8 + (5 to 6)) x MIPIBitClk cycle in the BitClk conversion. Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-7-francesco@dolcini.it commit ee18698e212b1659dd0850d7e2ae0f22e16ed3d3 Author: Francesco Dolcini Date: Thu Apr 27 16:29:30 2023 +0200 drm/bridge: tc358768: fix TCLK_TRAILCNT computation Correct computation of TCLK_TRAILCNT register. The driver does not implement non-continuous clock mode, so the actual value doesn't make a practical difference yet. However this change also ensures that the value does not write to reserved registers bits in case of under/overflow. This register must be set to a value that ensures that TCLK-TRAIL > 60ns and TEOT <= (105 ns + 12 x UI) with the actual value of TCLK-TRAIL being (TCLK_TRAILCNT + (1 to 2)) xHSByteClkCycle + (2 + (1 to 2)) * HSBYTECLKCycle - (PHY output delay) with PHY output delay being about (2 to 3) x MIPIBitClk cycle in the BitClk conversion. Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-2-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-3-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-4-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-5-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-2-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-3-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-4-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-5-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-2-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-3-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-4-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-5-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-2-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-3-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-4-francesco@dolcini.it Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-5-francesco@dolcini.it commit f9cf811374f42fca31ac34aaf59ee2ae72b89879 Author: Francesco Dolcini Date: Thu Apr 27 16:29:29 2023 +0200 drm/bridge: tc358768: fix TCLK_ZEROCNT computation Correct computation of TCLK_ZEROCNT register. This register must be set to a value that ensure that (TCLK-PREPARECNT + TCLK-ZERO) > 300ns with the actual value of (TCLK-PREPARECNT + TCLK-ZERO) being (1 to 2) + (TCLK_ZEROCNT + 1)) x HSByteClkCycle + (PHY output delay) with PHY output delay being about (2 to 3) x MIPIBitClk cycle in the BitClk conversion. Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-5-francesco@dolcini.it commit ffd2e4bbea626d565b9817312b0fcfb382fecb88 Author: Francesco Dolcini Date: Thu Apr 27 16:29:28 2023 +0200 drm/bridge: tc358768: fix PLL target frequency Correctly compute the PLL target frequency, the current formula works correctly only when the input bus width is 24bit, actually to properly compute the PLL target frequency what is relevant is the bits-per-pixel on the DSI link. No regression expected since the DSI format is currently hard-coded as MIPI_DSI_FMT_RGB888. Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-4-francesco@dolcini.it commit 6a4020b4c63911977aaf8047f904a300d15de739 Author: Francesco Dolcini Date: Thu Apr 27 16:29:27 2023 +0200 drm/bridge: tc358768: fix PLL parameters computation According to Toshiba documentation the PLL input clock after the divider should be not less than 4MHz, fix the PLL parameters computation accordingly. Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-3-francesco@dolcini.it commit 75a8aeac2573ab258c53676eba9b3796ea691988 Author: Francesco Dolcini Date: Thu Apr 27 16:29:26 2023 +0200 drm/bridge: tc358768: always enable HS video mode Always enable HS video mode setting the TXMD bit, without this change no video output is present with DSI sinks that are setting MIPI_DSI_MODE_LPM flag (tested with LT8912B DSI-HDMI bridge). Previously the driver was enabling HS mode only when the DSI sink was not explicitly setting the MIPI_DSI_MODE_LPM, however this is not correct. The MIPI_DSI_MODE_LPM is supposed to indicate that the sink is willing to receive data in low power mode, however clearing the TC358768_DSI_CONTROL_TXMD bit will make the TC358768 send video in LP mode that is not the intended behavior. Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-2-francesco@dolcini.it commit e541022b1ce2fe598b90cd96c88cf6fd2f7550d7 Author: John Harrison Date: Thu May 4 13:22:52 2023 -0700 drm/i915/mtl: Define GuC firmware version for MTL First release of GuC for Meteorlake. Signed-off-by: John Harrison Reviewed-by: Lucas De Marchi Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230504202252.1104212-3-John.C.Harrison@Intel.com commit dafa65d185fa0e946e602b53cb7f9694b7584456 Author: Ville Syrjälä Date: Mon Nov 7 21:46:04 2022 +0200 drm/i915: Pick one HDMI port for infoframe/audio transmission on g4x On g4x the hardware has only one audio/video DIP block. Thus only one HDMI port can transmit audio/infoframes at a time. Currently we pretend that multiple ports can do it at the same time, but that doesn't actually work for two reasons: - the state of the single hw block will get clobbered by the multiple ports, leading to state checker failures - the hardware will automagically disable audio/infoframe transmission when enabled on multiple ports To fix this let's allow only one of the ports to transmit audio/infoframes at a time. We'll just go over all the HDMI ports and pick the first one that is otherwise capable of audio/infoframes. Further HDMI ports will be treated as if they had a DVI sink connected. In order to compute this consistently we'll also need to always add all HDMI ports to the atomic state. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221107194604.15227-6-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 34682d6006ca31e8a4961104dba15d556db533b4 Author: Ville Syrjälä Date: Mon Nov 7 21:46:03 2022 +0200 drm/i915: Move has_hdmi_sink out from intel_hdmi_compute_config() We'll be wanting to compute has_hdmi_sink a bit differently for some platforms. To that end compute it in the encoder .compute_config_hook() before we call intel_hdmi_compute_config(). intel_hdmi_compute_has_hdmi_sink() will do the basic lifting beyond any platform specific stuff. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20221107194604.15227-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit d41e14fabc16043664f153b89d3d5d26f7069ff7 Author: John Harrison Date: Thu May 4 13:22:51 2023 -0700 drm/i915/uc: Track patch level versions on reduced version firmware files When reduced version firmware files were added (matching major component being the only strict requirement), the minor version was still tracked and a notification reported if it was older. However, the patch version should really be tracked as well for the same reasons. The KMD can work without the change but if the effort has been taken to release a new firmware with the change then there must be a valid reason for doing so - important bug fix, security fix, etc. And in that case it would be good to alert the user if they are missing out on that new fix. v2: Use correct patch version number and drop redunant debug print (review by Daniele / CI results). Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230504202252.1104212-2-John.C.Harrison@Intel.com commit f4dea9689c5fea3d07170c2cb0703e216f1a0922 Author: Pengcheng Yang Date: Fri May 5 16:50:58 2023 +0800 samples/bpf: Fix buffer overflow in tcp_basertt Using sizeof(nv) or strlen(nv)+1 is correct. Fixes: c890063e4404 ("bpf: sample BPF_SOCKET_OPS_BASE_RTT program") Signed-off-by: Pengcheng Yang Link: https://lore.kernel.org/r/1683276658-2860-1-git-send-email-yangpc@wangsu.com Signed-off-by: Alexei Starovoitov commit 69535186297b37e6e0a16290766666f4e8a55793 Author: Will Hawkins Date: Thu Apr 27 22:30:15 2023 -0400 bpf, docs: Update llvm_relocs.rst with typo fixes Correct a few typographical errors and fix some mistakes in examples. Signed-off-by: Will Hawkins Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230428023015.1698072-2-hawkinsw@obs.cr Signed-off-by: Alexei Starovoitov commit 1dc565764dc7a4b6477db0bc0202d26f74ad2a0e Author: Ankit Nautiyal Date: Thu Apr 27 18:26:05 2023 +0530 drm/i915/dp: Rearrange check for illegal mode and comments in mode_valid Check for MODE_H_ILLEGAL before calculating max rates, lanes etc. Move comments about compressed bpp U6.4 format closer to where it is used. Signed-off-by: Ankit Nautiyal Reviewed-by: Ville Syrjälä Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230427125605.487769-7-ankit.k.nautiyal@intel.com commit 5814227de13333463ace7146d2455ecabcc8e657 Author: Ankit Nautiyal Date: Thu Apr 27 18:26:04 2023 +0530 drm/i915/dp: Add helper to get sink_format Common function to get the sink format for a given mode for DP. Signed-off-by: Ankit Nautiyal Reviewed-by: Ville Syrjälä Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230427125605.487769-6-ankit.k.nautiyal@intel.com commit 523156799441f2625d4acbb0ba0904128e06622e Author: Ankit Nautiyal Date: Thu Apr 27 18:26:03 2023 +0530 drm/i915/display: Use sink_format instead of ycbcr420_output flag Start passing the sink_format, to all functions that take a bool ycbcr420_output as parameter. This will make the functions generic, and will serve as a slight step towards 4:2:2 support later. v2: Rebased. v3: Correct the checks in places concerned with pipe output. (Ville) Other minor styling and refactoring fixes, as suggested by Ville. Suggested-by: Ville Syrjälä Signed-off-by: Ankit Nautiyal Reviewed-by: Ville Syrjälä Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230427125605.487769-5-ankit.k.nautiyal@intel.com commit 9cca0fe329599109ed69e3c9583a8c4287feaf9b Author: Ankit Nautiyal Date: Thu Apr 27 18:26:02 2023 +0530 drm/i915/dp: Configure PCON for conversion of output_format to YCbCr444 Handle the case with DP to HDMI PCON, where sink_format is set to YCbCr444. In that case PCON is required to be configured to convert from given output_format to YCbCR444. v2: Drop drm_WARN for invalid case, let MISSING_CASE catch it. (Ville) Signed-off-by: Ankit Nautiyal Reviewed-by: Ville Syrjälä Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230427125605.487769-4-ankit.k.nautiyal@intel.com commit 68910c2a903d518b3f7386901cf0d6a053d1c028 Author: Ankit Nautiyal Date: Thu Apr 27 18:26:01 2023 +0530 drm/i915/dp: Replace intel_dp.dfp members with the new crtc_state sink_format The decision to use DFP output format conversion capabilities should be during compute_config phase. This patch uses the members of intel_dp->dfp to only store the format conversion capabilities of the DP device and uses the crtc_state sink_format member, to program the protocol-converter for colorspace/format conversion. v2: Use sink_format to determine the color conversion config for the pcon (Ville). v3: Fix typo: missing 'break' in switch case (lkp kernel test robot). v4: Add helper to check if DP supports YCBCR420. v5: Simplify logic for computing output_format, based on the given sink_format. (Ville). Added scaler constraint for YCbCr420 output. v6: Split the patch for Scaler constraint for Ycbcr420. v7: Simplify the policy for selecting output_format: Always try for RGB first, followed by YCBCR444, and finally by YCBCR420. v8: Removed redundant comments, minor refactoring. (Ville) v9: Added member for ycbcr420 passthrough cap, fixed minor issues. (Ville) Signed-off-by: Ankit Nautiyal Reviewed-by: Ville Syrjälä Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230427125605.487769-3-ankit.k.nautiyal@intel.com commit a04d27cdafb1caf95e6dc15ac72374c36e38acad Author: Ankit Nautiyal Date: Thu Apr 27 18:26:00 2023 +0530 drm/i915/display: Add new member to configure PCON color conversion The decision to use DFP output format conversion capabilities should be during compute_config phase. This patch adds new member to crtc_state to represent the final output_format to the sink. In case of a DFP this can be different than the output_format, as per the format conversion done via the PCON. This will help to store only the format conversion capabilities of the DP device in intel_dp->dfp, and use crtc_state to compute and store the configuration for color/format conversion for a given mode. v2: modified the new member to crtc_state to represent the final output_format that eaches the sink, after possible conversion by PCON kind of devices. (Ville) v3: Addressed comments from Ville: -Added comments to clarify difference between sink_format and output_format. -Corrected the order of setting sink_format and output_format. -Added readout for sink_format in get_pipe_config hooks. v4: Set sink_format for intel_sdvo too. (Ville) v5: Rebased. v6: Fixed condition to go for YCbCr420 format for dp and hdmi. (Ville) v7: Fix the condition to set sink_format for HDMI. Set hdmi output_format simply as sink_format. (Ville) Signed-off-by: Ankit Nautiyal Reviewed-by: Ville Syrjälä (v3) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230427125605.487769-2-ankit.k.nautiyal@intel.com commit 2bdba9d4a3baa758c2ca7f5b37b35c7b3391dc42 Author: Brian Norris Date: Mon Jan 9 17:18:17 2023 -0800 drm/rockchip: vop: Leave vblank enabled in self-refresh If we disable vblank when entering self-refresh, vblank APIs (like DRM_IOCTL_WAIT_VBLANK) no longer work. But user space is not aware when we enter self-refresh, so this appears to be an API violation -- that DRM_IOCTL_WAIT_VBLANK fails with EINVAL whenever the display is idle and enters self-refresh. The downstream driver used by many of these systems never used to disable vblank for PSR, and in fact, even upstream, we didn't do that until radically redesigning the state machine in commit 6c836d965bad ("drm/rockchip: Use the helpers for PSR"). Thus, it seems like a reasonable API fix to simply restore that behavior, and leave vblank enabled. Note that this appears to potentially unbalance the drm_crtc_vblank_{off,on}() calls in some cases, but: (a) drm_crtc_vblank_on() documents this as OK and (b) if I do the naive balancing, I find state machine issues such that we're not in sync properly; so it's easier to take advantage of (a). This issue was exposed by IGT's kms_vblank tests, and reported by KernelCI. The bug has been around a while (longer than KernelCI noticed), but was only exposed once self-refresh was bugfixed more recently, and so KernelCI could properly test it. Some other notes in: https://lore.kernel.org/dri-devel/Y6OCg9BPnJvimQLT@google.com/ Re: renesas/master bisection: igt-kms-rockchip.kms_vblank.pipe-A-wait-forked on rk3399-gru-kevin == Backporting notes: == Marking as 'Fixes' commit 6c836d965bad ("drm/rockchip: Use the helpers for PSR"), but it probably depends on commit bed030a49f3e ("drm/rockchip: Don't fully disable vop on self refresh") as well. We also need the previous patch ("drm/atomic: Allow vblank-enabled + self-refresh "disable""), of course. v3: * no update v2: * skip unnecessary lock/unlock Fixes: 6c836d965bad ("drm/rockchip: Use the helpers for PSR") Cc: Reported-by: "kernelci.org bot" Link: https://lore.kernel.org/dri-devel/Y5itf0+yNIQa6fU4@sirena.org.uk/ Signed-off-by: Brian Norris Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230109171809.v3.2.Ic07cba4ab9a7bd3618a9e4258b8f92ea7d10ae5a@changeid commit 9d0e3cac3517942a6e00eeecfe583a98715edb16 Author: Brian Norris Date: Mon Jan 9 17:18:16 2023 -0800 drm/atomic: Allow vblank-enabled + self-refresh "disable" The self-refresh helper framework overloads "disable" to sometimes mean "go into self-refresh mode," and this mode activates automatically (e.g., after some period of unchanging display output). In such cases, the display pipe is still considered "on", and user-space is not aware that we went into self-refresh mode. Thus, users may expect that vblank-related features (such as DRM_IOCTL_WAIT_VBLANK) still work properly. However, we trigger the WARN_ONCE() here if a CRTC driver tries to leave vblank enabled. Add a different expectation: that CRTCs *should* leave vblank enabled when going into self-refresh. This patch is preparation for another patch -- "drm/rockchip: vop: Leave vblank enabled in self-refresh" -- which resolves conflicts between the above self-refresh behavior and the API tests in IGT's kms_vblank test module. == Some alternatives discussed: == It's likely that on many display controllers, vblank interrupts will turn off when the CRTC is disabled, and so in some cases, self-refresh may not support vblank. To support such cases, we might consider additions to the generic helpers such that we fire vblank events based on a timer. However, there is currently only one driver using the common self-refresh helpers (i.e., rockchip), and at least as of commit bed030a49f3e ("drm/rockchip: Don't fully disable vop on self refresh"), the CRTC hardware is powered enough to continue to generate vblank interrupts. So we chose the simpler option of leaving vblank interrupts enabled. We can reevaluate this decision and perhaps augment the helpers if/when we gain a second driver that has different requirements. v3: * include discussion summary v2: * add 'ret != 0' warning case for self-refresh * describe failing test case and relation to drm/rockchip patch better Cc: # dependency for "drm/rockchip: vop: Leave # vblank enabled in self-refresh" Signed-off-by: Brian Norris Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230109171809.v3.1.I3904f697863649eb1be540ecca147a66e42bfad7@changeid commit 51f7008239de011370c5067bbba07f0207f06b72 Author: Nikita Zhandarovich Date: Tue Apr 18 07:04:30 2023 -0700 drm/i915/dp: prevent potential div-by-zero drm_dp_dsc_sink_max_slice_count() may return 0 if something goes wrong on the part of the DSC sink and its DPCD register. This null value may be later used as a divisor in intel_dsc_compute_params(), which will lead to an error. In the unlikely event that this issue occurs, fix it by testing the return value of drm_dp_dsc_sink_max_slice_count() against zero. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: a4a157777c80 ("drm/i915/dp: Compute DSC pipe config in atomic check") Signed-off-by: Nikita Zhandarovich Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230418140430.69902-1-n.zhandarovich@fintech.ru commit 91dce40914337bc47ac95e00f2b055169ee53697 Author: Christophe JAILLET Date: Wed Apr 26 22:48:59 2023 +0200 wifi: ath11k: Use list_count_nodes() ath11k_wmi_fw_stats_num_vdevs() and ath11k_wmi_fw_stats_num_bcn() really look the same as list_count_nodes(), so use the latter instead of hand writing it. The first ones use list_for_each_entry() and the other list_for_each(), but they both count the number of nodes in the list. While at it, also remove to prototypes of non-existent functions. Based on the names and prototypes, it is likely that they should be equivalent to list_count_nodes(). Compile tested only. Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/941484caae24b89d20524b1a5661dd1fd7025492.1682542084.git.christophe.jaillet@wanadoo.fr commit fd7bc9d9d4678321f0641810513cf7173f5c533c Author: Christophe JAILLET Date: Wed Apr 26 22:49:07 2023 +0200 wifi: ath10k: Use list_count_nodes() ath10k_wmi_fw_stats_num_peers() and ath10k_wmi_fw_stats_num_vdevs() really look the same as list_count_nodes(), so use the latter instead of hand writing it. The first ones use list_for_each_entry() and the other list_for_each(), but they both count the number of nodes in the list. Compile tested only. Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/e6ec525c0c5057e97e33a63f8a4aa482e5c2da7f.1682541872.git.christophe.jaillet@wanadoo.fr commit b719ebc37a1eacd4fd4f1264f731b016e5ec0c6e Author: Alexander Wetzel Date: Thu Mar 23 17:55:27 2023 +0100 wifi: ath10k: Serialize wake_tx_queue ops Serialize the ath10k implementation of the wake_tx_queue ops. ath10k_mac_op_wake_tx_queue() must not run concurrent since it's using ieee80211_txq_schedule_start(). The intend of this patch is to sort out an issue discovered in the discussion referred to by the Link tag. I can't test it with real hardware and thus just implemented the per-ac queue lock Felix suggested. One obvious alternative to the per-ac lock would be to bring back the txqs_lock commit bb2edb733586 ("ath10k: migrate to mac80211 txq scheduling") dropped. Fixes: bb2edb733586 ("ath10k: migrate to mac80211 txq scheduling") Reported-by: Felix Fietkau Link: https://lore.kernel.org/r/519b5bb9-8899-ae7c-4eff-f3116cdfdb56@nbd.name CC: Signed-off-by: Alexander Wetzel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230323165527.156414-1-alexander@wetzel-home.de commit e995f3f602a3fd9c8e0f97f59b37002d4ab5ec83 Author: Karthik M Date: Fri Apr 28 20:01:37 2023 +0300 wifi: ath12k: fix potential wmi_mgmt_tx_queue race condition During stress test with maximum VAPs and peer connected, below warning is seen: [ 1079.110967] ath12k_pci 0004:01:00.0: mgmt tx queue is full [ 1079.117708] ath12k_pci 0004:01:00.0: failed to queue management frame -28 [ 1079.123191] ath12k_pci 0004:01:00.0: mgmt tx queue is full [ 1079.129960] ath12k_pci 0004:01:00.0: failed to queue management frame -28 [ 1079.135641] ath12k_pci 0004:01:00.0: mgmt tx queue is full This is caused by potential race condition while accessing skb_queue_len(). When ath12k_mgmt_over_wmi_tx_work() and ath12k_mac_mgmt_tx() is called concurrently, then skb_queue_len() might fetch list length which is modified by skb_queue_tail() or skb_dequeue(). Replace skb_queue_len() with skb_queue_len_lockless() which will prevent concurrent modified access using READ_ONCE(). And also use '>=', in case we queue a few SKBs simultaneously. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthik M Signed-off-by: Ramya Gnanasekar Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230419095758.19998-1-quic_rgnanase@quicinc.com commit 5189a8dba849f0153f30561e3ac257e0be01abdd Author: Karthik M Date: Fri Apr 28 20:01:37 2023 +0300 wifi: ath12k: add wait operation for tx management packets for flush from mac80211 Transmission of management packets are done in a work queue. Sometimes the workqueue does not finish Tx immediately, then it lead after the next step of vdev delete finished, it start to send the management packet to firmware and lead firmware crash. ieee80211_set_disassoc() have logic of ieee80211_flush_queues() after it send_deauth_disassoc() to ath12k, its purpose is make sure the deauth was actually sent, so it need to change ath12k to match the purpose of mac80211. To address these issues wait for Tx management as well as Tx data packets. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthik M Signed-off-by: Ramya Gnanasekar Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230419095738.19859-1-quic_rgnanase@quicinc.com commit f3dc7bb037d813ab7da84f488dd485f0fce66347 Author: Wang Jikai Date: Fri Apr 21 09:22:00 2023 +0000 wifi: mt7601u: delete dead code checking debugfs returns Smatch reports that: drivers/net/wireless/mediatek/mt7601u/debugfs.c:130 mt7601u_init_debugfs() warn: 'dir' is an error pointer or valid". Debugfs code is not supposed to need error checking so instead of changing this to if (IS_ERR()) the correct thing is to just delete the dead code. Signed-off-by: Wang Jikai Acked-by: Jakub Kicinski Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421092200.24456-1-wangjikai@hust.edu.cn commit c401bde6ead489938385867ce3a6d5faf9fb6aba Author: Christophe JAILLET Date: Wed Apr 26 21:32:36 2023 +0200 wifi: mwifiex: Use list_count_nodes() mwifiex_wmm_list_len() is the same as list_count_nodes(), so use the latter instead of hand writing it. Turn 'ba_stream_num' and 'ba_stream_max' in size_t to keep the same type as what is returned by list_count_nodes(). Signed-off-by: Christophe JAILLET Reviewed-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/e77ed7f719787cb8836a93b6a6972f4147e40bc6.1682537509.git.christophe.jaillet@wanadoo.fr commit 9d4f491b860ea6d04471c3342093b86a46eee63e Author: Dan Carpenter Date: Fri Apr 21 13:44:04 2023 +0300 wifi: rtw89: fix rtw89_read_chip_ver() for RTL8852B and RTL8851B The if statement is reversed so it will not record the chip version. This was detected using Smatch: drivers/net/wireless/realtek/rtw89/core.c:3593 rtw89_read_chip_ver() error: uninitialized symbol 'val'. Fixes: a6fb2bb84654 ("wifi: rtw89: read version of analog hardware") Signed-off-by: Dan Carpenter Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/e4d912a2-37f8-4068-8861-7b9494ae731b@kili.mountain commit a83c6bb22745168dbe6592a9872f262615ee174b Author: Ping-Ke Shih Date: Mon Apr 24 14:52:42 2023 +0800 wifi: rtw89: 8851b: rfk: add IQK IQ signal calibration is a very important calibration to yield good RF performance. We do this calibration only if we are going to run on AP channel. During scanning phase, without this calibration RF performance is still acceptable because it transmits with low data rate at this phase. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230424065242.17477-6-pkshih@realtek.com commit 93fbbeedca3bc93abfe5711b62c8749061c66bc0 Author: Ping-Ke Shih Date: Mon Apr 24 14:52:41 2023 +0800 wifi: rtw89: 8851b: rfk: add DACK DACK (digital-to-analog converters calibration) is used to calibrate DAC to output good quality signals. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230424065242.17477-5-pkshih@realtek.com commit ae546f0a23904761edeee1a154b94fb38b6195c0 Author: Ping-Ke Shih Date: Mon Apr 24 14:52:40 2023 +0800 wifi: rtw89: 8851b: rfk: add RCK RCK is synchronize RC calibration. Driver triggers this calibration and sets the result to register. This calibration is needed once when interface is going to up. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230424065242.17477-4-pkshih@realtek.com commit 27d5559fd169676496c65a1d07678115c90dfd34 Author: Ping-Ke Shih Date: Mon Apr 24 14:52:39 2023 +0800 wifi: rtw89: 8851b: rfk: add AACK Automatic amplitude control calibration (AACK) is the calibration to ensure the oscillator is biased for a constant output amplitude. We do this calibration if card does power on. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230424065242.17477-3-pkshih@realtek.com commit 2a59fe291fb3f1cbe6f08b96b47af84b9fd5b207 Author: Ping-Ke Shih Date: Mon Apr 24 14:52:38 2023 +0800 wifi: rtw89: 8851b: add set_channel_rf() Add to set RF registers according to the channel we want to switch. The callers will be added afterward. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230424065242.17477-2-pkshih@realtek.com commit 85d1539c0273402911cee89cde1190cd4aec731f Author: Ping-Ke Shih Date: Fri Apr 21 10:45:51 2023 +0800 wifi: rtw89: 8851b: add DLE mem and HFC quota Configure DLE (data link engine) memory size for operating modes. Similarly, HFC standing for HCI flow control is used to set quota according to operating modes, which are SCC or download firmware. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421024551.29994-9-pkshih@realtek.com commit 2273dd724a6c6083e126828e56ff9a0a78913449 Author: Chih-Kang Chang Date: Fri Apr 21 10:45:50 2023 +0800 wifi: rtw89: 8851b: add support WoWLAN to 8851B Add WoWLAN stub to 8851B, and decalre this chip can support magic packet and disconnect wakeup. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421024551.29994-8-pkshih@realtek.com commit b6335d91607d6297d3f586e8a4dc6ce8f90652e7 Author: Ping-Ke Shih Date: Fri Apr 21 10:45:49 2023 +0800 wifi: rtw89: change naming of BA CAM from V1 to V0_EXT BA CAM of 8852C has more entries and more fields of H2C, and needs initialization before using. Due to differences from 8852A/8852B, we name it as V1 before. However, real V1 of BA CAM is introduced now, so change it to V0_EXT to avoid confusing with firmware design. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421024551.29994-7-pkshih@realtek.com commit ce816ab54bc927f893e17e7e6b9b68e30dd4b4a1 Author: Ping-Ke Shih Date: Fri Apr 21 10:45:48 2023 +0800 wifi: rtw89: use chip_info::small_fifo_size to choose debug_mask Previously, 8852B has smaller FIFO size than others, so I use chip_id to choose debug_mask before. 8851B has similar design, so add a field to chip_info as a general expression. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421024551.29994-6-pkshih@realtek.com commit 0789881aa3703b2ceb4c0f9a9c7d69f3fb7efd8d Author: Chia-Yuan Li Date: Fri Apr 21 10:45:47 2023 +0800 wifi: rtw89: add CFO XTAL registers field to support 8851B Since CFO XTAL registers of 8851B is different from 8852A, add a chip_info field to define their difference. Other chips use another interface, so fill NULL to this field. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421024551.29994-5-pkshih@realtek.com commit a24be8bbcbd22cfa53134f6dd399f026874aaa72 Author: Ping-Ke Shih Date: Fri Apr 21 10:45:46 2023 +0800 wifi: rtw89: 8851b: add NCTL post table NCTL (nano-controller) is used to assist RF calibration that sends commands to NCTL so it can reduce IO from driver. 8851B needs additional settings, so add a table to do things. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421024551.29994-4-pkshih@realtek.com commit 99ff8da56322cda9eb9b37021e27b127c2d1cad8 Author: Ping-Ke Shih Date: Fri Apr 21 10:45:45 2023 +0800 wifi: rtw89: 8851be: add 8851BE PCI entry and fill PCI capabilities Add PCI entry to 8851BE with its device ID 10ec:b851, also fill PCI info according to its capabilities. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421024551.29994-3-pkshih@realtek.com commit c8d89bf6b82f421dda16526233aba264d1331332 Author: Ping-Ke Shih Date: Fri Apr 21 10:45:44 2023 +0800 wifi: rtw89: 8851b: add 8851B basic chip_info 8851B is a 1x1 80 MHz bandwidth chip working on 2/5 GHz. Add these basic information, and more settings will be added by functions. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421024551.29994-2-pkshih@realtek.com commit b9b632f43f1c8b59ea3d23f7ea941616322dab5a Author: Zong-Zhe Yang Date: Wed Apr 19 11:46:03 2023 +0000 wifi: rtw89: scan offload wait for FW done ACK The following are scan offload related H2C (host to chip) function types. * H2C_FUNC_ADD_SCANOFLD_CH * H2C_FUNC_SCANOFLD Before doing FW scan, we will continuously send multiple H2Cs with above types which are used to tell FW the scan configuration of this time. But, if FW doesn't handle one of these H2Cs well, the FW scan process might not run as expected and driver should notice it early. So, this commits makes scan offload related H2Cs wait for FW done ACK via rtw89_wait_for_cond() and rtw89_complete_cond(). And, we check the return code of these H2Cs from FW. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/a15f4bd594f71d7602ea67698b035805143700c9.camel@realtek.com commit 32bb12eb73dceeb78c04a46c333f6f319cf1cebd Author: Zong-Zhe Yang Date: Wed Apr 19 11:46:01 2023 +0000 wifi: rtw89: mac: handle C2H receive/done ACK in interrupt context We have some MAC H2Cs (host to chip packets), which have no clear individual C2Hs (chip to host packets) to indicate FW execution response, but they are going to require to wait for FW completion. So, we have to deal with this via common MAC C2H receive/done ACKs. This commit changes the context, where common MAC C2H receive/done ACK handlers are executed, to interrupt context. And, code comments are added to prevent future commits from using it incorrectly. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/c4d766885e00b9f9dcf7954a80096c8b9d21149b.camel@realtek.com commit 8febd68be526c9f256c5490dd4b094a70e1b91ba Author: Zong-Zhe Yang Date: Wed Apr 19 11:45:58 2023 +0000 wifi: rtw89: packet offload wait for FW response The H2Cs (host to chip packets) related to packet offload functions need to wait for FW responses in case FW state machine gets wrong and makes driver status no longer able to align FW one. In flow, driver may continuously send multiple H2Cs of packet offload series. If somehow FW doesn't deal with the former yet but the latter has gotten in, it might cause the problem mentioned above. So, we block these H2Cs by rtw89_wait_for_cond(). And then, when the corresponding C2Hs (chip to host packets) is received, we call rtw89_complete_cond(). Besides, RTW89_MAC_C2H_FUNC_PKT_OFLD_RSP's C2H handler should be executed in interrupt context to make our wait/complete process work as expected. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/9ae8c1f105901c65e3171276a9fd6c99ae51803f.camel@realtek.com commit 3ea1cd8d027f189c044de142d58c4b0162396db3 Author: Zong-Zhe Yang Date: Wed Apr 19 11:45:55 2023 +0000 wifi: rtw89: refine packet offload delete flow of 6 GHz probe There are two places where offload packets of 6 GHz probe would be deleted from FW, i.e. calling rtw89_fw_h2c_del_pkt_offload(). * rtw89_core_cancel_6ghz_probe_tx() * rtw89_release_pkt_list() It is possible that we try to delete the same one from FW twice. Although it might not be a big problem for now, it will depend on the runtime chip firmware. So, we add a check to avoid it. In case things becomes complex due to racing problem, we don't choose to do list_del(info->list) and kfree(info) in both sides. Besides, rtw89_fw_h2c_del_pkt_offload() will needs to wait for completion after the follow-up commit. However, rtw89_core_cancel_6ghz_probe_tx() was called in interrupt context. So, we move the stuffs of calling rtw89_fw_h2c_del_pkt_offload() from rtw89_core_cancel_6ghz_probe_tx() into a work. Then, we also need a check there before we call it. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/091966e5709cd7caecf9b81f7fd6388ae2b70a7e.camel@realtek.com commit 25a7e5072ef1901e671e6f39df40b5028b241804 Author: Zong-Zhe Yang Date: Wed Apr 19 11:45:51 2023 +0000 wifi: rtw89: release bit in rtw89_fw_h2c_del_pkt_offload() We have a pair of FW functions, rtw89_fw_h2c_add_pkt_offload() and rtw89_fw_h2c_del_pkt_offload(). The rtw89_fw_h2c_add_pkt_offload() acquires the bit itself, but the bit needs to be released by the caller of rtw89_fw_h2c_del_pkt_offload(). This looks asymmetrical and is not friendly to callers. Second, if callers always releases the bits, it might make driver unaligned to bitmap status of FW after some failures of calling rtw89_fw_h2c_del_pkt_offload(). So, this commit move bit release into rtw89_fw_h2c_del_pkt_offload(). In general, driver will call rtw89_fw_h2c_add_pkt_offload() and rtw89_fw_h2c_del_pkt_offload(), and then, SW bitmap can align with FW one. There is one exception when notify_fw is false. It happens when driver detects FW problems and is going to reset FW. Only in this case, driver needs to release bits outside rtw89_fw_h2c_del_pkt_offload(). Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/8cf5d45c5b04e7b680d4eb9dda62056cdce14cec.camel@realtek.com commit 5feecb40e735b7cb4173328fabfc49ddc2b3b1bc Author: Eric Huang Date: Tue Apr 18 09:28:20 2023 +0800 wifi: rtw89: add EVM for antenna diversity Take EVM into consideration when doing antenna diversity, and the priority is higher than RSSI. Since EVM is more relevant to performance than RSSI, especially in OTA environment. Signed-off-by: Eric Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230418012820.5139-8-pkshih@realtek.com commit e3715859c75322fae560c46384f944006f367515 Author: Eric Huang Date: Tue Apr 18 09:28:19 2023 +0800 wifi: rtw89: add RSSI based antenna diversity RSSI statistics are grouped by CCK, OFDM or non-legacy rate. These statistics will be collected in training state for both (main/aux) antenna. There is a time period (ANTDIV_DELAY) for rate adaptive settle down before start collect statistics when switch antenna. Antenna diversity checks packet count from training state for each group and use the most one as the final RSSI for comparison, and then choose the better one as target antenna. Signed-off-by: Eric Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230418012820.5139-7-pkshih@realtek.com commit a90c613d099ff63587b60bfcfb0f4f1a7bb83252 Author: Eric Huang Date: Tue Apr 18 09:28:18 2023 +0800 wifi: rtw89: initialize antenna for antenna diversity Initialize basic antenna switch settings according to hardware module design, and set to default antenna A. The set antenna function will be called dynamically to switch antenna according to EVM and RSSI. Signed-off-by: Eric Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230418012820.5139-6-pkshih@realtek.com commit 4bb223a19f9b8c226b357ceedad47a00d88fef3a Author: Ping-Ke Shih Date: Tue Apr 18 09:28:17 2023 +0800 wifi: rtw89: add EVM and SNR statistics to debugfs To help debug performance problem, add EVM and SNR statistics to debugfs that shows EVM: [(26.75, 26.75) (25.75, 25.75)] SNR: 40 Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230418012820.5139-5-pkshih@realtek.com commit f6b24241cbec5236c061f90d52acb3d9430f2d43 Author: Ping-Ke Shih Date: Tue Apr 18 09:28:16 2023 +0800 wifi: rtw89: add RSSI statistics for the case of antenna diversity to debugfs RSSI strength is only from PHY path A, but there are two antenna for the module which supports antenna diversity. So, set RSSI value to index 1 of RSSI array if current antenna is on antenna B. Then, debugfs can show two RSSI values with a asterisk mark on selected antenna. RSSI: -23 dBm (raw=174, prev=173) [-26, -23*] Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230418012820.5139-4-pkshih@realtek.com commit f48453e058d763e895bde7b072f25b7b519a3500 Author: Ping-Ke Shih Date: Tue Apr 18 09:28:15 2023 +0800 wifi: rtw89: set capability of TX antenna diversity TX antenna diversity is a mechanism to select a proper antenna from two antenna for single one hardware PHY chip. It chooses antenna with better EVM or RSSI, and use GPIO to control SPDT to switch selected antenna. RFE type from efuse is used to define if a module can support TX antenna diversity when (type % 3) is 2. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230418012820.5139-3-pkshih@realtek.com commit 9805500606c256cf61ef73a767d7e797fe5ba18e Author: Ping-Ke Shih Date: Tue Apr 18 09:28:14 2023 +0800 wifi: rtw89: use struct rtw89_phy_sts_ie0 instead of macro to access PHY IE0 status To be more clear to know where it gets information from PHY IE0 data, change to use struct and standard le32_get_bits() to access. This doesn't change logic at all. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230418012820.5139-2-pkshih@realtek.com commit 83ac5457998ed464032665375dea56da8776a861 Author: Jani Nikula Date: Tue May 2 18:37:41 2023 +0300 drm/i915: use kernel-doc -Werror when CONFIG_DRM_I915_WERROR=y With CONFIG_DRM_I915_WERROR=y, we enable kernel-doc check for both objects and headers. Now that the kernel-doc warnings have been fixed, also enable kernel-doc -Werror to fail the build on kernel-doc warnings. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/68ffcad0e6ff2b6cd70c6df28822f967898ce197.1683041799.git.jani.nikula@intel.com commit 1d5b09f8daf859247a1ea65b0d732a24d88980d8 Author: Stanislav Lisovskiy Date: Fri May 5 11:22:12 2023 +0300 drm/i915: Fix NULL ptr deref by checking new_crtc_state intel_atomic_get_new_crtc_state can return NULL, unless crtc state wasn't obtained previously with intel_atomic_get_crtc_state, so we must check it for NULLness here, just as in many other places, where we can't guarantee that intel_atomic_get_crtc_state was called. We are currently getting NULL ptr deref because of that, so this fix was confirmed to help. Fixes: 74a75dc90869 ("drm/i915/display: move plane prepare/cleanup to intel_atomic_plane.c") Signed-off-by: Stanislav Lisovskiy Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230505082212.27089-1-stanislav.lisovskiy@intel.com commit ceb0cc3b428825fefae0123d2061ad3e06e2a0f7 Author: Stanislav Lisovskiy Date: Thu May 4 12:39:59 2023 +0300 drm/i915: Communicate display power demands to pcode Display to communicate display pipe count/CDCLK/voltage configuration to Pcode for more accurate power accounting for DG2. Existing sequence is only sending the voltage value to the Pcode. Adding new sequence with current cdclk associate with voltage value masking. Adding pcode request when any pipe power well will disable or enable. v2: - Make intel_cdclk_need_serialize static to make CI compiler happy. v3: - Removed redundant return(Jani Nikula) - Changed intel_cdclk_power_usage_to_pcode_(pre|post)_notification to be static and also naming to intel_cdclk_pcode_(pre|post)_notify(Jani Nikula) - Changed u8 to be u16 for cdclk parameter in intel_pcode_notify function, as according to BSpec it requires 10 bits(Jani Nikula) - Replaced dev_priv's with i915's(Jani Nikula) - Simplified expression in intel_cdclk_need_serialize(Jani Nikula) - Removed redundant kernel-doc and indentation(Jani Nikula) v4: - Fixed some checkpatch warnings v5: - According to HW team comments that change should affect only DG2, fix correspodent platform check to account this. v6: - Added one more missing IS_DG2 check(Vinod Govindapillai) Signed-off-by: Stanislav Lisovskiy Reviewed-by: Vinod Govindapillai Link: https://patchwork.freedesktop.org/patch/msgid/20230504093959.12085-1-stanislav.lisovskiy@intel.com commit c6948d8c221a8a61ebeb69567fd1a6c820127b53 Author: Jani Nikula Date: Thu May 4 12:23:20 2023 +0300 drm/i915/ttm: fix i915_ttm_to_gem() kernel-doc drivers/gpu/drm/i915/gem/i915_gem_ttm.h:50: warning: Function parameter or member 'bo' not described in 'i915_ttm_to_gem' v2: Fix return value documentation while at it (Rodrigo) Signed-off-by: Jani Nikula Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230504092320.1787627-1-jani.nikula@intel.com commit 9d7fe94d35522115734b3c2c37cad3257c88c43b Author: Jani Nikula Date: Tue May 2 18:37:39 2023 +0300 drm/i915/scatterlist: fix kernel-doc Can't document function pointer members as if they are functions. drivers/gpu/drm/i915/i915_scatterlist.h:160: warning: Incorrect use of kernel-doc format: * release() - Free the memory of the struct i915_refct_sgt Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/a0c099707ec4f1911b14b0f286848a298b2b29e0.1683041799.git.jani.nikula@intel.com commit 08272a5a41876af38209def142de272e580d446e Author: Jani Nikula Date: Tue May 2 18:37:27 2023 +0300 drm/i915/gem: fix function pointer member kernel-doc You can't document function pointer member as functions. drivers/gpu/drm/i915/gem/i915_gem_region.h:25: warning: Incorrect use of kernel-doc format: * process_obj - Process the current object drivers/gpu/drm/i915/gem/i915_gem_region.h:35: warning: Function parameter or member 'process_obj' not described in 'i915_gem_apply_to_region_ops' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/a2a81f9ee78591def0534c81a63dbc652c44bbd3.1683041799.git.jani.nikula@intel.com commit e971121350e72ff34a0c1d140127703cc2c085c2 Author: Jani Nikula Date: Tue May 2 18:37:22 2023 +0300 drm/i915/vma: fix struct i915_vma_bindinfo kernel-doc You can't document both a sub-struct type and a struct member at the same time. Separate them. drivers/gpu/drm/i915/i915_vma_resource.h:91: warning: Incorrect use of kernel-doc format: * struct i915_vma_bindinfo - Information needed for async bind drivers/gpu/drm/i915/i915_vma_resource.h:129: warning: Function parameter or member 'bi' not described in 'i915_vma_resource' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/89ab5cf179566c429383cc57db746038f75cba0d.1683041799.git.jani.nikula@intel.com commit 77005533777267736fca64fa376b8a835cb8806b Author: Zhang Shurong Date: Thu Apr 27 01:02:21 2023 +0800 wifi: rtw88: fix incorrect error codes in rtw_debugfs_set_* If there is a failure during copy_from_user or user-provided data buffer is invalid, rtw_debugfs_set_* should return negative error code instead of a positive value count. Fix this bug by returning correct error code. Signed-off-by: Zhang Shurong Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/tencent_53140CC2A3468101955F02EB66AA96780B05@qq.com commit 225622256b1b7156624e281e1c0251c292ea24cd Author: Zhang Shurong Date: Thu Apr 27 01:02:20 2023 +0800 wifi: rtw88: fix incorrect error codes in rtw_debugfs_copy_from_user If there is a failure during copy_from_user or user-provided data buffer is invalid, rtw_debugfs_copy_from_user should return negative error code instead of a positive value count. Fix this bug by returning correct error code. Moreover, the check of buffer against null is removed since it will be handled by copy_from_user. Signed-off-by: Zhang Shurong Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/tencent_D2EB102CC7435C0110154E62ECA6A7D67505@qq.com commit 271a588d34ed1dd771bc85a224b05ccdacce1de8 Author: Martin Kaiser Date: Thu Apr 27 20:59:36 2023 +0200 wifi: rtl8xxxu: rtl8xxxu_rx_complete(): remove unnecessary return Remove a return statement at the end of a void function. This fixes a checkpatch warning. WARNING: void function return statements are not generally useful 6206: FILE: ./drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:6206: + return; +} Signed-off-by: Martin Kaiser Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230427185936.923777-1-martin@kaiser.cx commit 6dc28456aa172b6e4dcc8e0914026b4026ae0a05 Author: Bitterblue Smith Date: Tue Apr 25 16:01:00 2023 +0300 wifi: rtl8xxxu: Support USB RX aggregation for the newer chips The driver can receive several frames in the same USB transfer. Add the code to handle this in rtl8xxxu_parse_rxdesc24(), even though currently all the relevant chips send only one frame per USB transfer (RTL8723BU, RTL8192EU, RTL8188FU, RTL8710BU). This was tested with RTL8188FU, RTL8192EU, RTL8710BU, and RTL8192FU. Signed-off-by: Bitterblue Smith Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/16d2d1ff-6438-10c9-347f-6e14dd358ccf@gmail.com commit b9a07c443a82432c4679a5a026b53e1e454d9a40 Author: Martin Kaistra Date: Fri Apr 28 17:08:33 2023 +0200 wifi: rtl8xxxu: Set maximum number of supported stations Set maximum number of associated stations supported in AP mode. For 8188f, the maximum number of supported macids is 16, reserve one for broadcast/multicast frames. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-19-martin.kaistra@linutronix.de commit b468481c9ad39449695376efd381ce3737e32aab Author: Martin Kaistra Date: Fri Apr 28 17:08:32 2023 +0200 wifi: rtl8xxxu: Declare AP mode support for 8188f Everything is in place now for AP mode, we can tell the system that we support it. Put the feature behind a flag in priv->fops, because it is not (yet) implemented for all chips. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-18-martin.kaistra@linutronix.de commit 19b396c241cfdcb4431491d07ff586f78436754a Author: Martin Kaistra Date: Fri Apr 28 17:08:31 2023 +0200 wifi: rtl8xxxu: Remove usage of tx_info->control.rates[0].flags As this driver uses HAS_RATE_CONTROL, rate_flags will not be provided by mac80211. Stop using tx_info->control.rates[0].flags and ieee80211_get_rts_cts_rate() and use rts_threshold and bss_conf.use_cts_prot instead to determine when to use RTS and CTS. Send RTS with 24M rate like the vendor drivers. Also set this RTS rate for ampdu_enable = true, because we also enable RTS for these frames. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-17-martin.kaistra@linutronix.de commit 07342528f7c8b7ca156ee6d8c132e42579b37bb9 Author: Martin Kaistra Date: Fri Apr 28 17:08:30 2023 +0200 wifi: rtl8xxxu: Remove usage of ieee80211_get_tx_rate() As this driver uses HAS_RATE_CONTROL, tx_rates will not be provided by mac80211. For some frames c->control.rates[0].idx is negative, which means ieee80211_get_tx_rate() will print a warning and return NULL. Only management frames have USE_DRIVER_RATE set, so for all others the rate info of txdesc is ignored anyway. Remove call to ieee80211_get_tx_rate() and send management frames with 1M (rate info = 0). Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-16-martin.kaistra@linutronix.de commit 66dcb574418eac0b09121d37ea0b52dede021887 Author: Martin Kaistra Date: Fri Apr 28 17:08:29 2023 +0200 wifi: rtl8xxxu: Clean up filter configuration When RCR_CHECK_BSSID_MATCH is set in AP mode, we don't receive any data frames. Rearrange RCR bits to filter flags to match other realtek drivers and remove RCR_CHECK_BSSID_MATCH in AP mode. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-15-martin.kaistra@linutronix.de commit 89819a6511441bac45f2f04f10880895e01a6ce7 Author: Martin Kaistra Date: Fri Apr 28 17:08:28 2023 +0200 wifi: rtl8xxxu: Enable hw seq for mgmt/non-QoS data frames Beacon frames are generated by the HW and therefore contain a HW generated seq number. Enable HW sequence number for other frames to match that. mac80211 will tell us via IEEE80211_TX_CTL_ASSIGN_SEQ when that is necessary. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-14-martin.kaistra@linutronix.de commit 769f326322e7328eeedc94fd33979683347fa7c7 Author: Martin Kaistra Date: Fri Apr 28 17:08:27 2023 +0200 wifi: rtl8xxxu: Add parameter macid to update_rate_mask The HW maintains a rate_mask for each connection, referenced by the macid. Add a parameter to update_rate_mask and add the macid to the h2c call in the gen2 implementation. Also extend refresh_rate_mask to get the macid from sta_info. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-13-martin.kaistra@linutronix.de commit 9aa45598d0540b7797673bb29d458ec16e42513d Author: Martin Kaistra Date: Fri Apr 28 17:08:26 2023 +0200 wifi: rtl8xxxu: Put the macid in txdesc Add a parameter macid to fill_txdesc(), implement setting it for the gen2 version. This is used to tell the HW who the recipient of the packet is, so that the appropriate data rate can be selected. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-12-martin.kaistra@linutronix.de commit 726e478ce1b3f8738c4e6f6a9683b64dcfb5b219 Author: Martin Kaistra Date: Fri Apr 28 17:08:25 2023 +0200 wifi: rtl8xxxu: Add sta_add() and sta_remove() callbacks In AP mode, sta_add() gets called when a new STA gets associated to us. Call rtl8xxxu_refresh_rate_mask() to set a rate mask for the newly connected STA (referenced by the macid) and then send a media connnect report. Ignore the call to sta_add() in station mode. Reserve one macid for broadcast/multicast packets in init. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-11-martin.kaistra@linutronix.de commit 40d02ff2b1868dbf3c3f33aadfe4200b6614f52b Author: Martin Kaistra Date: Fri Apr 28 17:08:24 2023 +0200 wifi: rtl8xxxu: Add parameter force to rtl8xxxu_refresh_rate_mask In AP mode, when multiple STAs connect to us, we need to set an initial rate mask for each of them. This initialisation should happen regardless of the rssi_level saved in the priv struct. Add a parameter called force to rtl8xxxu_refresh_rate_mask() which will be used for this initialisation. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-10-martin.kaistra@linutronix.de commit 2be2eed4c39b962df15c33813f741e0f8f68fd65 Author: Martin Kaistra Date: Fri Apr 28 17:08:23 2023 +0200 wifi: rtl8xxxu: Add parameter role to report_connect This allows to tell the HW if a connection is made to a STA or an AP. Add the implementation for the gen2 version. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-9-martin.kaistra@linutronix.de commit d59a105acc03e1f36b522017e57cccae2243abe2 Author: Martin Kaistra Date: Fri Apr 28 17:08:22 2023 +0200 wifi: rtl8xxxu: Actually use macid in rtl8xxxu_gen2_report_connect The report_connect function has had a macid parameter from the beginning, but it has not been used, because in STA mode, the value was always zero. As it can now have different values in AP mode, actually wire it up to the H2C command. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-8-martin.kaistra@linutronix.de commit fd5440f9311fa8ebeded0551be90a972118b1598 Author: Martin Kaistra Date: Fri Apr 28 17:08:21 2023 +0200 wifi: rtl8xxxu: Allow creating interface in AP mode Use the sequence from the vendor driver for setting up the beacon related registers. Also set the MAC address register here, in case the MAC address for the new interface should be different from what was set in rtl8xxxu_init_device(). This happens for example with the hostapd config option "bssid". Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-7-martin.kaistra@linutronix.de commit 20d59515489442e8899158514f9997662cb47ce5 Author: Martin Kaistra Date: Fri Apr 28 17:08:20 2023 +0200 wifi: rtl8xxxu: Allow setting rts threshold to -1 The default setting in hostapd.conf for rts threshold is -1, which means disabled. Allow to set it. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-6-martin.kaistra@linutronix.de commit f5db4d11fda182eea4e639e80b0404f7b8a43c01 Author: Martin Kaistra Date: Fri Apr 28 17:08:19 2023 +0200 wifi: rtl8xxxu: Add set_tim() callback Update beacon content if TIM bitmap maintained by mac80211 is changed. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-5-martin.kaistra@linutronix.de commit cde8848cad0bb4f03388f07d65e5fa0e8d35861b Author: Martin Kaistra Date: Fri Apr 28 17:08:18 2023 +0200 wifi: rtl8xxxu: Add beacon functions Add a workqueue to update the beacon contents asynchronously and implement downloading the beacon to the HW and starting beacon tx like the vendor driver. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-4-martin.kaistra@linutronix.de commit 25ed009cc0aafd946008e323da5da43311ed4ac7 Author: Martin Kaistra Date: Fri Apr 28 17:08:17 2023 +0200 wifi: rtl8xxxu: Select correct queue for beacon frames Use the special beacon queue for beacon frames instead of the management frame queue. They will be put in a special area called reserved page and send out periodically when in AP mode. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-3-martin.kaistra@linutronix.de commit ac48499e2bf5b06e09e256039e56e695e9c2c667 Author: Martin Kaistra Date: Fri Apr 28 17:08:16 2023 +0200 wifi: rtl8xxxu: Add start_ap() callback This gets called at the start of AP mode operation. Set bssid, beacon interval and send a connect report to the HW. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230428150833.218605-2-martin.kaistra@linutronix.de commit fbc0b0253001c397a481d258a88ce5f08996574f Merge: 7866fc6aa0deb c91ab90cea7ae Author: Alexei Starovoitov Date: Thu May 4 22:35:36 2023 -0700 Merge branch 'Add precision propagation for subprogs and callbacks' Andrii Nakryiko says: ==================== As more and more real-world BPF programs become more complex and increasingly use subprograms (both static and global), scalar precision tracking and its (previously weak) support for BPF subprograms (and callbacks as a special case of that) is becoming more and more of an issue and limitation. Couple that with increasing reliance on state equivalence (BPF open-coded iterators have a hard requirement for state equivalence to converge and successfully validate loops), and it becomes pretty critical to address this limitation and make precision tracking universally supported for BPF programs of any complexity and composition. This patch set teaches BPF verifier to support SCALAR precision backpropagation across multiple frames (for subprogram calls and callback simulations) and addresses most practical situations (SCALAR stack loads/stores using registers other than r10 being the last remaining limitation, though thankfully rarely used in practice). Main logic is explained in details in patch #8. The rest are preliminary preparations, refactorings, clean ups, and fixes. See respective patches for details. Patch #8 has also veristat comparison of results for selftests, Cilium, and some of Meta production BPF programs before and after these changes. v2->v3: - drop bitcnt and ifs from bt_xxx() helpers (Alexei); v1->v2: - addressed review feedback form Alexei, adjusted commit messages, comments, added verbose(), WARN_ONCE(), etc; - re-ran all the tests and veristat on selftests, cilium, and meta-internal code: no new changes and no kernel warnings. ==================== Signed-off-by: Alexei Starovoitov commit c91ab90cea7ae61334c7026daf310f5875dfdee7 Author: Andrii Nakryiko Date: Thu May 4 21:33:17 2023 -0700 selftests/bpf: revert iter test subprog precision workaround Now that precision propagation is supported fully in the presence of subprogs, there is no need to work around iter test. Revert original workaround. This reverts be7dbd275dc6 ("selftests/bpf: avoid mark_all_scalars_precise() trigger in one of iter tests"). Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230505043317.3629845-11-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 3ef3d2177b1a5484908c53d19269b964c488c20f Author: Andrii Nakryiko Date: Thu May 4 21:33:16 2023 -0700 selftests/bpf: add precision propagation tests in the presence of subprogs Add a bunch of tests validating verifier's precision backpropagation logic in the presence of subprog calls and/or callback-calling helpers/kfuncs. We validate the following conditions: - subprog_result_precise: static subprog r0 result precision handling; - global_subprog_result_precise: global subprog r0 precision shortcutting, similar to BPF helper handling; - callback_result_precise: similarly r0 marking precise for callback-calling helpers; - parent_callee_saved_reg_precise, parent_callee_saved_reg_precise_global: propagation of precision for callee-saved registers bypassing static/global subprogs; - parent_callee_saved_reg_precise_with_callback: same as above, but in the presence of callback-calling helper; - parent_stack_slot_precise, parent_stack_slot_precise_global: similar to above, but instead propagating precision of stack slot (spilled SCALAR reg); - parent_stack_slot_precise_with_callback: same as above, but in the presence of callback-calling helper; - subprog_arg_precise: propagation of precision of static subprog's input argument back to caller; - subprog_spill_into_parent_stack_slot_precise: negative test validating that verifier currently can't support backtracking of stack access with non-r10 register, we validate that we fallback to forcing precision for all SCALARs. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230505043317.3629845-10-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit fde2a3882bd07876c144f2e00f7ae6893c378180 Author: Andrii Nakryiko Date: Thu May 4 21:33:15 2023 -0700 bpf: support precision propagation in the presence of subprogs Add support precision backtracking in the presence of subprogram frames in jump history. This means supporting a few different kinds of subprogram invocation situations, all requiring a slightly different handling in precision backtracking handling logic: - static subprogram calls; - global subprogram calls; - callback-calling helpers/kfuncs. For each of those we need to handle a few precision propagation cases: - what to do with precision of subprog returns (r0); - what to do with precision of input arguments; - for all of them callee-saved registers in caller function should be propagated ignoring subprog/callback part of jump history. N.B. Async callback-calling helpers (currently only bpf_timer_set_callback()) are transparent to all this because they set a separate async callback environment and thus callback's history is not shared with main program's history. So as far as all the changes in this commit goes, such helper is just a regular helper. Let's look at all these situation in more details. Let's start with static subprogram being called, using an exxerpt of a simple main program and its static subprog, indenting subprog's frame slightly to make everything clear. frame 0 frame 1 precision set ======= ======= ============= 9: r6 = 456; 10: r1 = 123; fr0: r6 11: call pc+10; fr0: r1, r6 22: r0 = r1; fr0: r6; fr1: r1 23: exit fr0: r6; fr1: r0 12: r1 = fr0: r0, r6 13: r1 += r0; fr0: r0, r6 14: r1 += r6; fr0: r6 15: exit As can be seen above main function is passing 123 as single argument to an identity (`return x;`) subprog. Returned value is used to adjust map pointer offset, which forces r0 to be marked as precise. Then instruction #14 does the same for callee-saved r6, which will have to be backtracked all the way to instruction #9. For brevity, precision sets for instruction #13 and #14 are combined in the diagram above. First, for subprog calls, r0 returned from subprog (in frame 0) has to go into subprog's frame 1, and should be cleared from frame 0. So we go back into subprog's frame knowing we need to mark r0 precise. We then see that insn #22 sets r0 from r1, so now we care about marking r1 precise. When we pop up from subprog's frame back into caller at insn #11 we keep r1, as it's an argument-passing register, so we eventually find `10: r1 = 123;` and satify precision propagation chain for insn #13. This example demonstrates two sets of rules: - r0 returned after subprog call has to be moved into subprog's r0 set; - *static* subprog arguments (r1-r5) are moved back to caller precision set. Let's look at what happens with callee-saved precision propagation. Insn #14 mark r6 as precise. When we get into subprog's frame, we keep r6 in frame 0's precision set *only*. Subprog itself has its own set of independent r6-r10 registers and is not affected. When we eventually made our way out of subprog frame we keep r6 in precision set until we reach `9: r6 = 456;`, satisfying propagation. r6-r10 propagation is perhaps the simplest aspect, it always stays in its original frame. That's pretty much all we have to do to support precision propagation across *static subprog* invocation. Let's look at what happens when we have global subprog invocation. frame 0 frame 1 precision set ======= ======= ============= 9: r6 = 456; 10: r1 = 123; fr0: r6 11: call pc+10; # global subprog fr0: r6 12: r1 = fr0: r0, r6 13: r1 += r0; fr0: r0, r6 14: r1 += r6; fr0: r6; 15: exit Starting from insn #13, r0 has to be precise. We backtrack all the way to insn #11 (call pc+10) and see that subprog is global, so was already validated in isolation. As opposed to static subprog, global subprog always returns unknown scalar r0, so that satisfies precision propagation and we drop r0 from precision set. We are done for insns #13. Now for insn #14. r6 is in precision set, we backtrack to `call pc+10;`. Here we need to recognize that this is effectively both exit and entry to global subprog, which means we stay in caller's frame. So we carry on with r6 still in precision set, until we satisfy it at insn #9. The only hard part with global subprogs is just knowing when it's a global func. Lastly, callback-calling helpers and kfuncs do simulate subprog calls, so jump history will have subprog instructions in between caller program's instructions, but the rules of propagating r0 and r1-r5 differ, because we don't actually directly call callback. We actually call helper/kfunc, which at runtime will call subprog, so the only difference between normal helper/kfunc handling is that we need to make sure to skip callback simulatinog part of jump history. Let's look at an example to make this clearer. frame 0 frame 1 precision set ======= ======= ============= 8: r6 = 456; 9: r1 = 123; fr0: r6 10: r2 = &callback; fr0: r6 11: call bpf_loop; fr0: r6 22: r0 = r1; fr0: r6 fr1: 23: exit fr0: r6 fr1: 12: r1 = fr0: r0, r6 13: r1 += r0; fr0: r0, r6 14: r1 += r6; fr0: r6; 15: exit Again, insn #13 forces r0 to be precise. As soon as we get to `23: exit` we see that this isn't actually a static subprog call (it's `call bpf_loop;` helper call instead). So we clear r0 from precision set. For callee-saved register, there is no difference: it stays in frame 0's precision set, we go through insn #22 and #23, ignoring them until we get back to caller frame 0, eventually satisfying precision backtrack logic at insn #8 (`r6 = 456;`). Assuming callback needed to set r0 as precise at insn #23, we'd backtrack to insn #22, switching from r0 to r1, and then at the point when we pop back to frame 0 at insn #11, we'll clear r1-r5 from precision set, as we don't really do a subprog call directly, so there is no input argument precision propagation. That's pretty much it. With these changes, it seems like the only still unsupported situation for precision backpropagation is the case when program is accessing stack through registers other than r10. This is still left as unsupported (though rare) case for now. As for results. For selftests, few positive changes for bigger programs, cls_redirect in dynptr variant benefitting the most: [vmuser@archvm bpf]$ ./veristat -C ~/subprog-precise-before-results.csv ~/subprog-precise-after-results.csv -f @veristat.cfg -e file,prog,insns -f 'insns_diff!=0' File Program Insns (A) Insns (B) Insns (DIFF) ---------------------------------------- ------------- --------- --------- ---------------- pyperf600_bpf_loop.bpf.linked1.o on_event 2060 2002 -58 (-2.82%) test_cls_redirect_dynptr.bpf.linked1.o cls_redirect 15660 2914 -12746 (-81.39%) test_cls_redirect_subprogs.bpf.linked1.o cls_redirect 61620 59088 -2532 (-4.11%) xdp_synproxy_kern.bpf.linked1.o syncookie_tc 109980 86278 -23702 (-21.55%) xdp_synproxy_kern.bpf.linked1.o syncookie_xdp 97716 85147 -12569 (-12.86%) Cilium progress don't really regress. They don't use subprogs and are mostly unaffected, but some other fixes and improvements could have changed something. This doesn't appear to be the case: [vmuser@archvm bpf]$ ./veristat -C ~/subprog-precise-before-results-cilium.csv ~/subprog-precise-after-results-cilium.csv -e file,prog,insns -f 'insns_diff!=0' File Program Insns (A) Insns (B) Insns (DIFF) ------------- ------------------------------ --------- --------- ------------ bpf_host.o tail_nodeport_nat_ingress_ipv6 4983 5003 +20 (+0.40%) bpf_lxc.o tail_nodeport_nat_ingress_ipv6 4983 5003 +20 (+0.40%) bpf_overlay.o tail_nodeport_nat_ingress_ipv6 4983 5003 +20 (+0.40%) bpf_xdp.o tail_handle_nat_fwd_ipv6 12475 12504 +29 (+0.23%) bpf_xdp.o tail_nodeport_nat_ingress_ipv6 6363 6371 +8 (+0.13%) Looking at (somewhat anonymized) Meta production programs, we see mostly insignificant variation in number of instructions, with one program (syar_bind6_protect6) benefitting the most at -17%. [vmuser@archvm bpf]$ ./veristat -C ~/subprog-precise-before-results-fbcode.csv ~/subprog-precise-after-results-fbcode.csv -e prog,insns -f 'insns_diff!=0' Program Insns (A) Insns (B) Insns (DIFF) ------------------------ --------- --------- ---------------- on_request_context_event 597 585 -12 (-2.01%) read_async_py_stack 43789 43657 -132 (-0.30%) read_sync_py_stack 35041 37599 +2558 (+7.30%) rrm_usdt 946 940 -6 (-0.63%) sysarmor_inet6_bind 28863 28249 -614 (-2.13%) sysarmor_inet_bind 28845 28240 -605 (-2.10%) syar_bind4_protect4 154145 147640 -6505 (-4.22%) syar_bind6_protect6 165242 137088 -28154 (-17.04%) syar_task_exit_setgid 21289 19720 -1569 (-7.37%) syar_task_exit_setuid 21290 19721 -1569 (-7.37%) do_uprobe 19967 19413 -554 (-2.77%) tw_twfw_ingress 215877 204833 -11044 (-5.12%) tw_twfw_tc_in 215877 204833 -11044 (-5.12%) But checking duration (wall clock) differences, that is the actual time taken by verifier to validate programs, we see a sometimes dramatic improvements, all the way to about 16x improvements: [vmuser@archvm bpf]$ ./veristat -C ~/subprog-precise-before-results-meta.csv ~/subprog-precise-after-results-meta.csv -e prog,duration -s duration_diff^ | head -n20 Program Duration (us) (A) Duration (us) (B) Duration (us) (DIFF) ---------------------------------------- ----------------- ----------------- -------------------- tw_twfw_ingress 4488374 272836 -4215538 (-93.92%) tw_twfw_tc_in 4339111 268175 -4070936 (-93.82%) tw_twfw_egress 3521816 270751 -3251065 (-92.31%) tw_twfw_tc_eg 3472878 284294 -3188584 (-91.81%) balancer_ingress 343119 291391 -51728 (-15.08%) syar_bind6_protect6 78992 64782 -14210 (-17.99%) ttls_tc_ingress 11739 8176 -3563 (-30.35%) kprobe__security_inode_link 13864 11341 -2523 (-18.20%) read_sync_py_stack 21927 19442 -2485 (-11.33%) read_async_py_stack 30444 28136 -2308 (-7.58%) syar_task_exit_setuid 10256 8440 -1816 (-17.71%) Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230505043317.3629845-9-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit c50c0b57a515826b5d2e1ce85cd85f24f0da10c2 Author: Andrii Nakryiko Date: Thu May 4 21:33:14 2023 -0700 bpf: fix mark_all_scalars_precise use in mark_chain_precision When precision backtracking bails out due to some unsupported sequence of instructions (e.g., stack access through register other than r10), we need to mark all SCALAR registers as precise to be safe. Currently, though, we mark SCALARs precise only starting from the state we detected unsupported condition, which could be one of the parent states of the actual current state. This will leave some registers potentially not marked as precise, even though they should. So make sure we start marking scalars as precise from current state (env->cur_state). Further, we don't currently detect a situation when we end up with some stack slots marked as needing precision, but we ran out of available states to find the instructions that populate those stack slots. This is akin the `i >= func->allocated_stack / BPF_REG_SIZE` check and should be handled similarly by falling back to marking all SCALARs precise. Add this check when we run out of states. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230505043317.3629845-8-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit f655badf2a8fc028433d9583bf86a6b473721f09 Author: Andrii Nakryiko Date: Thu May 4 21:33:13 2023 -0700 bpf: fix propagate_precision() logic for inner frames Fix propagate_precision() logic to perform propagation of all necessary registers and stack slots across all active frames *in one batch step*. Doing this for each register/slot in each individual frame is wasteful, but the main problem is that backtracking of instruction in any frame except the deepest one just doesn't work. This is due to backtracking logic relying on jump history, and available jump history always starts (or ends, depending how you view it) in current frame. So, if prog A (frame #0) called subprog B (frame #1) and we need to propagate precision of, say, register R6 (callee-saved) within frame #0, we actually don't even know where jump history that corresponds to prog A even starts. We'd need to skip subprog part of jump history first to be able to do this. Luckily, with struct backtrack_state and __mark_chain_precision() handling bitmasks tracking/propagation across all active frames at the same time (added in previous patch), propagate_precision() can be both fixed and sped up by setting all the necessary bits across all frames and then performing one __mark_chain_precision() pass. This makes it unnecessary to skip subprog parts of jump history. We also improve logging along the way, to clearly specify which registers' and slots' precision markings are propagated within which frame. Each frame will have dedicated line and all registers and stack slots from that frame will be reported in format similar to precision backtrack regs/stack logging. E.g.: frame 1: propagating r1,r2,r3,fp-8,fp-16 frame 0: propagating r3,r9,fp-120 Fixes: 529409ea92d5 ("bpf: propagate precision across all frames, not just the last one") Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230505043317.3629845-7-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 1ef22b6865a73a8aed36d43375fe8c7b30869326 Author: Andrii Nakryiko Date: Thu May 4 21:33:12 2023 -0700 bpf: maintain bitmasks across all active frames in __mark_chain_precision Teach __mark_chain_precision logic to maintain register/stack masks across all active frames when going from child state to parent state. Currently this should be mostly no-op, as precision backtracking usually bails out when encountering subprog entry/exit. It's not very apparent from the diff due to increased indentation, but the logic remains the same, except everything is done on specific `fr` frame index. Calls to bt_clear_reg() and bt_clear_slot() are replaced with frame-specific bt_clear_frame_reg() and bt_clear_frame_slot(), where frame index is passed explicitly, instead of using current frame number. We also adjust logging to emit affected frame number. And we also add better logging of human-readable register and stack slot masks, similar to previous patch. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230505043317.3629845-6-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit d9439c21a9e4769bfd83a03ab39056164d44ac31 Author: Andrii Nakryiko Date: Thu May 4 21:33:11 2023 -0700 bpf: improve precision backtrack logging Add helper to format register and stack masks in more human-readable format. Adjust logging a bit during backtrack propagation and especially during forcing precision fallback logic to make it clearer what's going on (with log_level=2, of course), and also start reporting affected frame depth. This is in preparation for having more than one active frame later when precision propagation between subprog calls is added. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230505043317.3629845-5-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 407958a0e980b9e1842ab87b5a1040521e1e24e9 Author: Andrii Nakryiko Date: Thu May 4 21:33:10 2023 -0700 bpf: encapsulate precision backtracking bookkeeping Add struct backtrack_state and straightforward API around it to keep track of register and stack masks used and maintained during precision backtracking process. Having this logic separately allow to keep high-level backtracking algorithm cleaner, but also it sets us up to cleanly keep track of register and stack masks per frame, allowing (with some further logic adjustments) to perform precision backpropagation across multiple frames (i.e., subprog calls). Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230505043317.3629845-4-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit e0bf462276b6ee23203365eacb5c599f42a5a084 Author: Andrii Nakryiko Date: Thu May 4 21:33:09 2023 -0700 bpf: mark relevant stack slots scratched for register read instructions When handling instructions that read register slots, mark relevant stack slots as scratched so that verifier log would contain those slots' states, in addition to currently emitted registers with stack slot offsets. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230505043317.3629845-3-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 5956f3011604f03be073cba0fbe5f399b4d779ec Author: Andrii Nakryiko Date: Thu May 4 21:33:08 2023 -0700 veristat: add -t flag for adding BPF_F_TEST_STATE_FREQ program flag Sometimes during debugging it's important that BPF program is loaded with BPF_F_TEST_STATE_FREQ flag set to force verifier to do frequent state checkpointing. Teach veristat to do this when -t ("test state") flag is specified. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20230505043317.3629845-2-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 7866fc6aa0deb2294eb781fc3ac94b7d4c6eb242 Author: Kenjiro Nakayama Date: Thu May 4 12:54:43 2023 +0900 libbpf: Fix comment about arc and riscv arch in bpf_tracing.h To make comments about arc and riscv arch in bpf_tracing.h accurate, this patch fixes the comment about arc and adds the comment for riscv. Signed-off-by: Kenjiro Nakayama Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230504035443.427927-1-nakayamakenjiro@gmail.com commit e62206682a2f51a8f4d37a204791e5e8ae4d9eab Author: Ville Syrjälä Date: Wed Apr 26 16:50:18 2023 +0300 drm/i915: Use REG_BIT() & co. for pipe scaler registers Pimp the skl+ scaler register bits with REG_BIT()/etc. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230426135019.7603-7-ville.syrjala@linux.intel.com commit 6ec91794ce4aad0e92a16028885a7b139fe363ae Author: Ville Syrjälä Date: Wed Apr 26 16:50:17 2023 +0300 drm/i915: Define bitmasks for skl+ scaler window pos/size Define and use the bitmasks for the x/y components of the skl+ scaler window pos/size registers. We stick to the full 16 bits mask here even though the hardware limits are actually lower. The current (ADL) hardware maximums are in fact: 14 bits for X size, 13 bits for X pos, 13 bits for Y size/pos. Yes, that is correct, X pos has less bits than the X size for some reason. But that doesn't actually matter for now as we don't currently even support such wide displays without the use of bigjoiner (due to max plane width limit). v2: Switch back to full 16bit masks since that's what we use transcoder timign regs and PIPESRC as well Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230426135019.7603-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 576032f2b3db7ed5994a165ca0e4b6808c637f0f Author: Ville Syrjälä Date: Wed Apr 26 16:50:16 2023 +0300 drm/i915: s/PS_COEE_INDEX_AUTO_INC/PS_COEF_INDEX_AUTO_INC/ Fix a typo in the PS_COEF_INDEX_AUTO_INC define. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230426135019.7603-5-ville.syrjala@linux.intel.com commit ebb4e2b03acc3a9b58a8bc32b239e6af2166e84f Author: Ville Syrjälä Date: Wed Apr 26 16:50:15 2023 +0300 drm/i915: Rename skl+ scaler binding bits Rename the scaler binding bits to match the spec more closely. Also call the parameters 'plane_id' to make it a bit more clear what to pass in. v2: Don't break gvt Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230426135019.7603-4-ville.syrjala@linux.intel.com commit 33d233f5cf9b9f1ce8f38480c45317dc0eecafa2 Author: Ville Syrjälä Date: Wed Apr 26 16:50:14 2023 +0300 drm/i915: Remove dead scaler register defines We have some duplicated scaler register defines that are never used. Remove them. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230426135019.7603-3-ville.syrjala@linux.intel.com commit 4883c804fc794dbd9f9668e73b3d266a52ae6c0c Author: Ville Syrjälä Date: Wed Apr 26 16:50:13 2023 +0300 drm/i915: Define bitmasks for ilk pfit window pos/size Define and use the bitmasks for the x/y components of the ilk+ panel filter window pos/size registers. Note that we stick to the full 16 bit mask even though the actual hardware limits are lower (and somewhat platform dependent). BDW is actually limited to 13 bits horizontal and 12 bits vertical, with the high bits being hardwired to zero. HSW should have the same limits as BDW. And pre-HSW should be limited to 12bits in both directions as that's already the limit of the transcoder timing registers. Curiously on HSW and earlier platforms all 16 bits can actually be set, but presumably the hardware ignores the high bits. v2: Switch back to full 16bit masks since that's what we use transcoder timign regs and PIPESRC as well Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230426135019.7603-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 31cc65b4c7e37eaf645be2d5fdcade56e3fdf8f2 Author: Daniele Ceraolo Spurio Date: Tue May 2 09:38:54 2023 -0700 drm/i915/gsc: add support for GSC proxy interrupt The GSC notifies us of a proxy request via the HECI2 interrupt. The interrupt must be enabled both in the HECI layer and in our usual gt irq programming; for the latter, the interrupt is enabled via the same enable register as the GSC CS, but it does have its own mask register. When the interrupt is received, we also need to de-assert it in both layers. The handling of the proxy request is deferred to the same worker that we use for GSC load. New flags have been added to distinguish between the init case and the proxy interrupt. v2: Make sure not to set the reset bit when enabling/disabling the GSC interrupts, fix defines (Alan) v3: rebase on proxy status register check Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20230502163854.317653-5-daniele.ceraolospurio@intel.com commit 8a9bf29546a13efd3ed7784b890c2534e995348f Author: Daniele Ceraolo Spurio Date: Tue May 2 09:38:53 2023 -0700 drm/i915/gsc: add initial support for GSC proxy The GSC uC needs to communicate with the CSME to perform certain operations. Since the GSC can't perform this communication directly on platforms where it is integrated in GT, i915 needs to transfer the messages from GSC to CSME and back. The proxy flow is as follow: 1 - i915 submits a request to GSC asking for the message to CSME 2 - GSC replies with the proxy header + payload for CSME 3 - i915 sends the reply from GSC as-is to CSME via the mei proxy component 4 - CSME replies with the proxy header + payload for GSC 5 - i915 submits a request to GSC with the reply from CSME 6 - GSC replies either with a new header + payload (same as step 2, so we restart from there) or with an end message. After GSC load, i915 is expected to start the first proxy message chain, while all subsequent ones will be triggered by the GSC via interrupt. To communicate with the CSME, we use a dedicated mei component, which means that we need to wait for it to bind before we can initialize the proxies. This usually happens quite fast, but given that there is a chance that we'll have to wait a few seconds the GSC work has been moved to a dedicated WQ to not stall other processes. v2: fix code style, includes and variable naming (Alan) v3: add extra check for proxy status, fix includes and comments Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20230502163854.317653-4-daniele.ceraolospurio@intel.com commit 1dd924f6885b1f3bddc586c39467dc9471729c5e Author: Alexander Usyskin Date: Tue May 2 09:38:52 2023 -0700 mei: gsc_proxy: add gsc proxy driver Add GSC proxy driver. It to allows messaging between GSC component on Intel graphics card and CSE device. Cc: Alan Previn Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Signed-off-by: Daniele Ceraolo Spurio Acked-by: Greg Kroah-Hartman Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20230502163854.317653-3-daniele.ceraolospurio@intel.com commit e7b05d95cc1bfa1e61557358d936ebb33b0ae4be Author: Alexander Usyskin Date: Tue May 2 09:38:51 2023 -0700 drm/i915/mtl: Define GSC Proxy component interface GSC Proxy component is used for communication between the Intel graphics driver and MEI driver. Cc: Alan Previn Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Signed-off-by: Daniele Ceraolo Spurio Acked-by: Greg Kroah-Hartman Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20230502163854.317653-2-daniele.ceraolospurio@intel.com commit 8b2a7394e51d6a49edeae8fc640b8c23a4ab649d Author: Jani Nikula Date: Tue May 2 18:37:40 2023 +0300 drm/i915/scatterlist: fix kernel-doc parameter documentation drivers/gpu/drm/i915/i915_scatterlist.h:164: warning: Function parameter or member 'release' not described in 'i915_refct_sgt_ops' drivers/gpu/drm/i915/i915_scatterlist.h:187: warning: Function parameter or member 'rsgt' not described in 'i915_refct_sgt_put' drivers/gpu/drm/i915/i915_scatterlist.h:198: warning: Function parameter or member 'rsgt' not described in 'i915_refct_sgt_get' drivers/gpu/drm/i915/i915_scatterlist.h:214: warning: Function parameter or member 'rsgt' not described in '__i915_refct_sgt_init' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/0b31edbb33116c8002dd1e72d3ad25efe5dd0176.1683041799.git.jani.nikula@intel.com commit 70b9933c09b8687edff5c2f833dc2a72c1b40362 Author: Jani Nikula Date: Tue May 2 18:37:38 2023 +0300 drm/i915/pxp: fix kernel-doc for member dev_link Add /** to make it a kernel-doc. drivers/gpu/drm/i915/pxp/intel_pxp_types.h:96: warning: Function parameter or member 'dev_link' not described in 'intel_pxp' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/84f89a3332fa323888f1e3241fb51ae10417ecd7.1683041799.git.jani.nikula@intel.com commit 7bc30374f84c5588c952e47248595b1c38d06906 Author: Jani Nikula Date: Tue May 2 18:37:37 2023 +0300 drm/i915/pmu: drop kernel-doc The comments are closer to not being kernel-doc. drivers/gpu/drm/i915/i915_pmu.h:21: warning: cannot understand function prototype: 'enum i915_pmu_tracked_events ' drivers/gpu/drm/i915/i915_pmu.h:32: warning: cannot understand function prototype: 'enum ' drivers/gpu/drm/i915/i915_pmu.h:41: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * How many different events we track in the global PMU mask. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/7656b8f58b088c108a2a32f7089329740efabba1.1683041799.git.jani.nikula@intel.com commit 8802628237ac73bf5a6f878ea0cbd8a4c39a55a1 Author: Jani Nikula Date: Tue May 2 18:37:36 2023 +0300 drm/i915/active: fix kernel-doc for function parameters drivers/gpu/drm/i915/i915_active.h:66: warning: Function parameter or member 'active' not described in '__i915_active_fence_init' drivers/gpu/drm/i915/i915_active.h:66: warning: Function parameter or member 'fence' not described in '__i915_active_fence_init' drivers/gpu/drm/i915/i915_active.h:66: warning: Function parameter or member 'fn' not described in '__i915_active_fence_init' drivers/gpu/drm/i915/i915_active.h:89: warning: Function parameter or member 'active' not described in 'i915_active_fence_set' drivers/gpu/drm/i915/i915_active.h:89: warning: Function parameter or member 'rq' not described in 'i915_active_fence_set' drivers/gpu/drm/i915/i915_active.h:102: warning: Function parameter or member 'active' not described in 'i915_active_fence_get' drivers/gpu/drm/i915/i915_active.h:122: warning: Function parameter or member 'active' not described in 'i915_active_fence_isset' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/7f201c6cb715e4b3cece78ffa893a75610ecd27d.1683041799.git.jani.nikula@intel.com commit 1c519e0628f19e2790ddfa4cb512921047e8f65a Author: Jani Nikula Date: Tue May 2 18:37:35 2023 +0300 drm/i915/guc: add intel_guc_state_capture member docs for ads_null_cache and max_mmio_per_node drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:216: warning: Function parameter or member 'ads_null_cache' not described in 'intel_guc_state_capture' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:216: warning: Function parameter or member 'max_mmio_per_node' not described in 'intel_guc_state_capture' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/c83878163221ed3684a6de5d5e1c5373ddd5c06f.1683041799.git.jani.nikula@intel.com commit f05e526e44cb11e70c5b7d8bb55d7e0c6fb10990 Author: Jani Nikula Date: Tue May 2 18:37:34 2023 +0300 drm/i915/guc: drop lots of kernel-doc markers The documentation is closer to not being kernel-doc, so just drop the kernel-doc markers. drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:27: warning: Function parameter or member 'size' not described in '__guc_capture_bufstate' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:27: warning: Function parameter or member 'data' not described in '__guc_capture_bufstate' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:27: warning: Function parameter or member 'rd' not described in '__guc_capture_bufstate' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:27: warning: Function parameter or member 'wr' not described in '__guc_capture_bufstate' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:59: warning: Function parameter or member 'link' not described in '__guc_capture_parsed_output' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:59: warning: Function parameter or member 'is_partial' not described in '__guc_capture_parsed_output' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:59: warning: Function parameter or member 'eng_class' not described in '__guc_capture_parsed_output' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:59: warning: Function parameter or member 'eng_inst' not described in '__guc_capture_parsed_output' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:59: warning: Function parameter or member 'guc_id' not described in '__guc_capture_parsed_output' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:59: warning: Function parameter or member 'lrca' not described in '__guc_capture_parsed_output' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:59: warning: Function parameter or member 'reginfo' not described in '__guc_capture_parsed_output' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:62: warning: wrong kernel-doc identifier on line: * struct guc_debug_capture_list_header / struct guc_debug_capture_list drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:80: warning: wrong kernel-doc identifier on line: * struct __guc_mmio_reg_descr / struct __guc_mmio_reg_descr_group drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:105: warning: wrong kernel-doc identifier on line: * struct guc_state_capture_header_t / struct guc_state_capture_t / drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:163: warning: Function parameter or member 'is_valid' not described in '__guc_capture_ads_cache' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:163: warning: Function parameter or member 'ptr' not described in '__guc_capture_ads_cache' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:163: warning: Function parameter or member 'size' not described in '__guc_capture_ads_cache' drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h:163: warning: Function parameter or member 'status' not described in '__guc_capture_ads_cache' drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:491: warning: Function parameter or member 'marker' not described in 'guc_log_buffer_state' drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:491: warning: Function parameter or member 'read_ptr' not described in 'guc_log_buffer_state' drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:491: warning: Function parameter or member 'write_ptr' not described in 'guc_log_buffer_state' drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:491: warning: Function parameter or member 'size' not described in 'guc_log_buffer_state' drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:491: warning: Function parameter or member 'sampled_write_ptr' not described in 'guc_log_buffer_state' drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:491: warning: Function parameter or member 'wrap_offset' not described in 'guc_log_buffer_state' drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:491: warning: Function parameter or member 'flush_to_file' not described in 'guc_log_buffer_state' drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:491: warning: Function parameter or member 'buffer_full_cnt' not described in 'guc_log_buffer_state' drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:491: warning: Function parameter or member 'reserved' not described in 'guc_log_buffer_state' drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:491: warning: Function parameter or member 'flags' not described in 'guc_log_buffer_state' drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h:491: warning: Function parameter or member 'version' not described in 'guc_log_buffer_state' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/9c210d53fdbd6da5fac42e435855d269504919d7.1683041799.git.jani.nikula@intel.com commit 3a21c6b4298d9d0c99c8dee28edcf317d68cd93e Author: Jani Nikula Date: Tue May 2 18:37:33 2023 +0300 drm/i915/guc: add dbgfs_node member kernel-doc drivers/gpu/drm/i915/gt/uc/intel_guc.h:274: warning: Function parameter or member 'dbgfs_node' not described in 'intel_guc' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/b0f681dd82289dd86da78c6242411e8d812e51a1.1683041799.git.jani.nikula@intel.com commit 1f5cf999bedcdff85f84b7dc4d780cbb515b6c2f Author: Jani Nikula Date: Tue May 2 18:37:32 2023 +0300 drm/i915/engine: hide preempt_hang selftest member from kernel-doc drivers/gpu/drm/i915/gt/intel_engine_types.h:293: warning: Function parameter or member 'preempt_hang' not described in 'intel_engine_execlists' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/dafd771bb75cf14965dd3b666987c58a438de134.1683041799.git.jani.nikula@intel.com commit e798a3b30dcb729fa9b9dc88de00984dc1f5aa04 Author: Jani Nikula Date: Tue May 2 18:37:31 2023 +0300 drm/i915/gtt: fix i915_vm_resv_put() kernel-doc parameter name drivers/gpu/drm/i915/gt/intel_gtt.h:515: warning: Function parameter or member 'vm' not described in 'i915_vm_resv_put' drivers/gpu/drm/i915/gt/intel_gtt.h:515: warning: Excess function parameter 'resv' description in 'i915_vm_resv_put' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/c22e58e770019667980b3617f6e963b76d7e79a7.1683041799.git.jani.nikula@intel.com commit 71ca9b87a72bdc1dbe434d25c97eb14be58b4e00 Author: Jani Nikula Date: Tue May 2 18:37:30 2023 +0300 drm/i915/context: fix kernel-doc parameter descriptions drivers/gpu/drm/i915/gt/intel_context.h:108: warning: Function parameter or member 'ce' not described in 'intel_context_lock_pinned' drivers/gpu/drm/i915/gt/intel_context.h:123: warning: Function parameter or member 'ce' not described in 'intel_context_is_pinned' drivers/gpu/drm/i915/gt/intel_context.h:142: warning: Function parameter or member 'ce' not described in 'intel_context_unlock_pinned' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/8359a1cef6b5ab268a9dcc1a382281b6e39cfa64.1683041799.git.jani.nikula@intel.com commit 9c55105be0a78942328882224c23965483e578a9 Author: Jani Nikula Date: Tue May 2 18:37:29 2023 +0300 drm/i915/engine: fix kernel-doc function name for intel_engine_cleanup_common() drivers/gpu/drm/i915/gt/intel_engine_cs.c:1525: warning: expecting prototype for intel_engines_cleanup_common(). Prototype was for intel_engine_cleanup_common() instead Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/33f8dfdf38be3e16675971e6983e3e300d4301a6.1683041799.git.jani.nikula@intel.com commit faa19ce89b0b2eb91c37e2c26b6be93e2e2cb47a Author: Jani Nikula Date: Tue May 2 18:37:26 2023 +0300 drm/i915/gem: fix i915_gem_object_lookup_rcu() kernel-doc parameter name drivers/gpu/drm/i915/gem/i915_gem_object.h:94: warning: Function parameter or member 'file' not described in 'i915_gem_object_lookup_rcu' drivers/gpu/drm/i915/gem/i915_gem_object.h:94: warning: Excess function parameter 'filp' description in 'i915_gem_object_lookup_rcu' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/80c96863b7a0755aaa07efb49bcccd9ba620c6d7.1683041799.git.jani.nikula@intel.com commit d7b7332c0e9901ec7e6e73ca75b6c4cd398d5aaf Author: Jani Nikula Date: Tue May 2 18:37:25 2023 +0300 drm/i915/request: drop kernel-doc The documentation is closer to not being kernel-doc. Just drop the kernel-doc /** indicators. drivers/gpu/drm/i915/i915_request.h:176: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Request queue structure. drivers/gpu/drm/i915/i915_request.h:477: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Returns true if seq1 is later than seq2. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/62a7a0f6e5b33e59ef4339304d01e7ef7ee04430.1683041799.git.jani.nikula@intel.com commit 88629feedcc4678ac21991a1154477d1c1dca19f Author: Jani Nikula Date: Tue May 2 18:37:24 2023 +0300 drm/i915/error: fix i915_capture_error_state() kernel-doc drivers/gpu/drm/i915/i915_gpu_error.c:2174: warning: Function parameter or member 'dump_flags' not described in 'i915_capture_error_state' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20524292b002800975d82d23b5bd47da878f1733.1683041799.git.jani.nikula@intel.com commit 9570b039075192923d3bd26a7892a708eef1a483 Author: Jani Nikula Date: Tue May 2 18:37:23 2023 +0300 drm/i915/perf: fix i915_perf_ioctl_version() kernel-doc drivers/gpu/drm/i915/i915_perf.c:5307: warning: Function parameter or member 'i915' not described in 'i915_perf_ioctl_version' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/b93ddb95a15d1376936349b32c7facb35c76be82.1683041799.git.jani.nikula@intel.com commit 28487ecb96b0bd1ff27a3e8ae8bc027af6e448e1 Author: Jani Nikula Date: Tue May 2 18:37:21 2023 +0300 drm/i915/vma: document struct i915_vma_resource wakeref member drivers/gpu/drm/i915/i915_vma_resource.h:129: warning: Function parameter or member 'wakeref' not described in 'i915_vma_resource' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/50389365e095dc564ab5f1f1e3647934163ffefa.1683041799.git.jani.nikula@intel.com commit 144c3f7b190981a659b8fe9179ddd1f46baadee7 Author: Jani Nikula Date: Tue May 2 18:37:20 2023 +0300 drm/i915/utils: drop kernel-doc from __wait_for() The parameters aren't documented, and the file isn't included in Sphinx build anyway, so demote the kernel-doc to a regular comment. drivers/gpu/drm/i915/i915_utils.h:284: warning: Function parameter or member 'OP' not described in '__wait_for' drivers/gpu/drm/i915/i915_utils.h:284: warning: Function parameter or member 'COND' not described in '__wait_for' drivers/gpu/drm/i915/i915_utils.h:284: warning: Function parameter or member 'US' not described in '__wait_for' drivers/gpu/drm/i915/i915_utils.h:284: warning: Function parameter or member 'Wmin' not described in '__wait_for' drivers/gpu/drm/i915/i915_utils.h:284: warning: Function parameter or member 'Wmax' not described in '__wait_for' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/e6e33a7f03c4a78739fa96e6ae74eb272ae147e7.1683041799.git.jani.nikula@intel.com commit e1172b617a93c2133750c4ff586f20f46e1e42c0 Author: Jani Nikula Date: Tue May 2 18:37:19 2023 +0300 drm/i915/vma: fix kernel-doc function name for i915_vma_size() drivers/gpu/drm/i915/i915_vma.h:145: warning: expecting prototype for i915_vma_offset(). Prototype was for i915_vma_size() instead Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/9fd58398ba6f86c55cc7a7c62efeab70c3311d59.1683041799.git.jani.nikula@intel.com commit 67f2dd9f38abf4d994a5bc5131ce684e594d66a8 Author: Jani Nikula Date: Tue May 2 18:37:18 2023 +0300 drm/i915/gvt: fix intel_vgpu_alloc_resource() kernel-doc parameter drivers/gpu/drm/i915/gvt/aperture_gm.c:344: warning: Function parameter or member 'conf' not described in 'intel_vgpu_alloc_resource' drivers/gpu/drm/i915/gvt/aperture_gm.c:344: warning: Excess function parameter 'param' description in 'intel_vgpu_alloc_resource' Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/9213214c9caa296ebd349a5d5b44c2bbb45cdf99.1683041799.git.jani.nikula@intel.com commit 8a91b29f1f50ce7742cdbe5cf11d17f128511f3f Author: Alexander Stein Date: Thu May 4 08:53:16 2023 +0200 drm/bridge: ti-sn65dsi83: Fix enable error path If PLL locking failed, the regulator needs to be disabled again. Fixes: 5664e3c907e2 ("drm/bridge: ti-sn65dsi83: Add vcc supply regulator support") Signed-off-by: Alexander Stein Reviewed-by: Laurent Pinchart Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230504065316.2640739-1-alexander.stein@ew.tq-group.com commit e4730ae44240ae1a2e247bfc7f916813567acb92 Author: John Harrison Date: Fri Apr 28 11:56:36 2023 -0700 drm/i915/guc: Fix error capture for virtual engines GuC based register dumps in error capture logs were basically broken for virtual engines. This can be seen in igt@gem_exec_balancer@hang: [IGT] gem_exec_balancer: starting subtest hang [drm] GPU HANG: ecode 12:4:e1524110, in gem_exec_balanc [6388] [drm] GT0: GUC: No register capture node found for 0x1005 / 0xFEDC311D [drm] GPU HANG: ecode 12:4:00000000, in gem_exec_balanc [6388] [IGT] gem_exec_balancer: exiting, ret=0 The test causes a hang on both engines of a virtual engine context. The engine instance zero hang gets a valid error capture but the non-instance-zero hang does not. Fix that by scanning through the list of pending register captures when a hang notification for a virtual engine is received. That way, the hang can be assigned to the correct physical engine prior to starting the error capture process. So later on, when the error capture handler tries to find the engine register list, it looks for one on the correct engine. Also, sneak in a missing blank line before a comment in the node search code. v2: Fix null pointer deref on non-GuC platforms. Signed-off-by: John Harrison Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20230428185636.457407-5-John.C.Harrison@Intel.com commit 44e36855bdb72cc2ade0153dce4a08a5b830a3a6 Author: John Harrison Date: Fri Apr 28 11:56:35 2023 -0700 drm/i915/guc: Capture list naming clean up Don't use 'xe_lp*' prefixes for register lists that are common with Gen8. Don't add Xe only GSC registers to pre-Xe devices that don't even have a GSC engine. Fix Xe_LP name. Don't use GEN9 as a prefix for register lists that contain all GEN8 registers. Rename the 'default_' register list prefix to 'gen8_' as that is the more accurate name. Signed-off-by: John Harrison Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20230428185636.457407-4-John.C.Harrison@Intel.com commit 684ee005d670a1b6360ba53db24b808f7584c89b Author: John Harrison Date: Fri Apr 28 11:56:34 2023 -0700 drm/i915/guc: Consolidate duplicated capture list code Remove 99% duplicated steered register list code. Also, include the pre-Xe steered registers in the pre-Xe list generation. Signed-off-by: John Harrison Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20230428185636.457407-3-John.C.Harrison@Intel.com commit b049132d61336f643d8faf2f6574b063667088cf Author: John Harrison Date: Fri Apr 28 11:56:33 2023 -0700 drm/i915/guc: Don't capture Gen8 regs on Xe devices A pair of pre-Xe registers were being included in the Xe capture list. GuC was rejecting those as being invalid and logging errors about them. So, stop doing it. Signed-off-by: John Harrison Reviewed-by: Alan Previn Fixes: dce2bd542337 ("drm/i915/guc: Add Gen9 registers for GuC error state capture.") Cc: Alan Previn Cc: Umesh Nerlige Ramappa Cc: Lucas De Marchi Cc: John Harrison Cc: Jani Nikula Cc: Matt Roper Cc: Balasubramani Vivekanandan Cc: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230428185636.457407-2-John.C.Harrison@Intel.com commit 629f59ade8fc399beee839cb81369510c9c982b6 Author: Dan Carpenter Date: Tue May 2 15:59:56 2023 +0300 drm/udl: delete dead code The "unode" pointer cannot be NULL here and checking for it causes Smatch warnings: drivers/gpu/drm/udl/udl_main.c:259 udl_get_urb_locked() warn: can 'unode' even be NULL? Fortunately, it's just harmless dead code which can be removed. It's left over from commit c5c354a3a472 ("drm/udl: Fix inconsistent urbs.count value during udl_free_urb_list()"). Reported-by: kernel test robot Signed-off-by: Dan Carpenter Reviewed-by: Thomas Zimmermann Reviewed-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/e0e35421-8746-43b6-971e-e25d1cd1d6a7@kili.mountain commit 725859b98a8eeb50c9a711b323e0cffc367873ea Author: Tejas Upadhyay Date: Fri Apr 28 18:29:52 2023 +0530 drm/i915/selftests: Use gt_err for GT info It will be more informative regarding GT if we use gt_err instead. Cc: Andi Shyti Signed-off-by: Tejas Upadhyay Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230428125952.4037964-3-tejas.upadhyay@intel.com commit 860cf3bd715b3455e1c708386e773a669a2350ee Author: Tejas Upadhyay Date: Fri Apr 28 18:29:51 2023 +0530 drm/i915/gt: Use gt_err for GT info It will be more informative regarding GT if we use gt_err instead. Cc: Andi Shyti Signed-off-by: Tejas Upadhyay Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230428125952.4037964-2-tejas.upadhyay@intel.com commit 03877d621db082610c9b7602c6e8cd6ebcb75a8f Author: Christian König Date: Thu Apr 27 14:05:43 2023 +0200 drm/scheduler: mark jobs without fence as canceled When no hw fence is provided for a job that means that the job didn't executed. Signed-off-by: Christian König Reviewed-by: Luben Tuikov Link: https://patchwork.freedesktop.org/patch/msgid/20230427122726.1290170-1-christian.koenig@amd.com commit fedf99200ab086c42a572fca1d7266b06cdc3e3f Author: Kui-Feng Lee Date: Tue May 2 11:14:18 2023 -0700 bpf: Print a warning only if writing to unprivileged_bpf_disabled. Only print the warning message if you are writing to "/proc/sys/kernel/unprivileged_bpf_disabled". The kernel may print an annoying warning when you read "/proc/sys/kernel/unprivileged_bpf_disabled" saying WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB attacks! However, this message is only meaningful when the feature is disabled or enabled. Signed-off-by: Kui-Feng Lee Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20230502181418.308479-1-kuifeng@meta.com commit bf6882aebd0ea67558764d44ddeffc7d253c6eb8 Author: Yonghong Song Date: Tue May 2 11:05:43 2023 -0700 bpf: Emit struct bpf_tcp_sock type in vmlinux BTF In one of our internal testing, we found a case where - uapi struct bpf_tcp_sock is in vmlinux.h where vmlinux.h is not generated from the testing kernel - struct bpf_tcp_sock is not in vmlinux BTF The above combination caused bpf load failure as the following memory access struct bpf_tcp_sock *tcp_sock = ...; ... tcp_sock->snd_cwnd ... needs CORE relocation but the relocation cannot be resolved since the kernel BTF does not have corresponding type. Similar to other previous cases (nf_conn___init, tcp6_sock, mctcp_sock, etc.), add the type to vmlinux BTF with BTF_EMIT_TYPE macro. Signed-off-by: Yonghong Song Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230502180543.1832140-1-yhs@fb.com commit 3516fa162a01f6611c3c129ce9529bdc720d36b7 Author: Dmitry Torokhov Date: Tue May 2 13:16:57 2023 -0700 Input: avoid calling input_set_abs_val() in the event handling core input_abs_set_val() can nominally call input_alloc_absinfo() which may allocate memory with GFP_KERNEL flag. This does not happen when input_abs_set_val() is called by the input core to set current MT slot when handling a new input event, but it trips certain static analyzers. Rearrange the code to access the relevant structures directly. Reported-by: Teng Qi Reviewed-by: Peter Hutterer Link: https://lore.kernel.org/r/ZFBg379uuHjf+YEM@google.com Signed-off-by: Dmitry Torokhov commit e0f41f836f5e861bdcaf4719f160b62dbb8e9485 Author: Geert Uytterhoeven Date: Tue May 2 09:42:29 2023 -0700 Input: tests - modular KUnit tests should not depend on KUNIT=y While KUnit tests that cannot be built as a loadable module must depend on "KUNIT=y", this is not true for modular tests, where it adds an unnecessary limitation. Fix this by relaxing the dependency to "KUNIT". Fixes: fdefcbdd6f361841 ("Input: Add KUnit tests for some of the input core helper functions") Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Link: https://lore.kernel.org/r/483c4f520e4acc6357ebba3e605977b4c56374df.1683022164.git.geert+renesas@glider.be Signed-off-by: Dmitry Torokhov commit fd75f3694b1dd5070408ea4a58ca7f8e0a3fcbcd Author: Geert Uytterhoeven Date: Tue May 2 09:41:46 2023 -0700 Input: tests - fix use-after-free and refcount underflow in input_test_exit() With CONFIG_DEBUG_SLAB=y: # Subtest: input_core 1..3 input: Test input device as /devices/virtual/input/input1 8<--- cut here --- Unable to handle kernel paging request at virtual address 6b6b6dd7 when read ... __lock_acquire from lock_acquire+0x26c/0x300 lock_acquire from _raw_spin_lock_irqsave+0x50/0x64 _raw_spin_lock_irqsave from devres_remove+0x20/0x7c devres_remove from devres_destroy+0x8/0x24 devres_destroy from input_free_device+0x2c/0x60 input_free_device from kunit_try_run_case+0x70/0x94 [kunit] Without CONFIG_DEBUG_SLAB=y: KTAP version 1 # Subtest: input_core 1..3 input: Test input device as /devices/virtual/input/input1 ------------[ cut here ]------------ WARNING: CPU: 0 PID: 694 at lib/refcount.c:28 refcount_warn_saturate+0x54/0x100 refcount_t: underflow; use-after-free. ... Call Trace: [<0037cad4>] dump_stack+0xc/0x10 [<00377614>] __warn+0x7e/0xb4 [<0037768c>] warn_slowpath_fmt+0x42/0x62 [<001eee1c>] refcount_warn_saturate+0x54/0x100 [<000b1d34>] kfree_const+0x0/0x20 [<0036290a>] __kobject_del+0x0/0x6e [<001eee1c>] refcount_warn_saturate+0x54/0x100 [<00362a1a>] kobject_put+0xa2/0xb6 [<11965770>] kunit_generic_run_threadfn_adapter+0x0/0x1c [kunit] As per the comments for input_allocate_device() and input_register_device(), input_free_device() must be called only to free devices that have not been registered. input_unregister_device() already calls input_put_device(), thus leading to a use-after-free. Moreover, the kunit_suite.exit() method is called after every test case, even on failures. As the test itself already does cleanups in its failure paths, this may lead to a second use-after-free. Fix the first issue by dropping the call to input_allocate_device() from input_test_exit(). Fix the second issue by making the cleanup code conditional on a successful test. Fixes: fdefcbdd6f361841 ("Input: Add KUnit tests for some of the input core helper functions") Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Link: https://lore.kernel.org/r/957b3b309a44d39fb6e38b2a526b250f69ea3d2c.1683022164.git.geert+renesas@glider.be Signed-off-by: Dmitry Torokhov commit 1324680a80ebf6eaba112bd54efa19e23081797d Author: Umesh Nerlige Ramappa Date: Thu Apr 27 15:47:05 2023 -0700 drm/i915/fdinfo: Enable fdinfo for GuC backends Enable fdinfo for GuC based platforms with the exception that long running contexts will not provide reliable busyness data unless they switch out at some reasonable point in time. Link: https://gitlab.freedesktop.org/drm/intel/issues/8303 Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230427224705.2785566-3-umesh.nerlige.ramappa@intel.com commit 5aa857db54ad2e963d65e234f7e4c183cd89c993 Author: Umesh Nerlige Ramappa Date: Thu Apr 27 15:47:04 2023 -0700 i915/pmu: Add support for total context runtime for GuC back-end GPU accumulates the context runtime in a 32 bit counter - CTX_TIMESTAMP in the context image. This value is saved/restored on context switches. KMD accumulates these values into a 64 bit counter taking care of any overflows as needed. This count provides the basis for client specific busyness in the fdinfo interface. KMD accumulation happens just before the context is unpinned and when context switches out. This works for execlist back-end since execlist scheduling has visibility into context switches. With GuC mode, KMD does not have visibility into context switches and this counter is accumulated only when context is unpinned. Context is unpinned once the context scheduling is successfully disabled. Disabling context scheduling is an asynchronous operation. Also if a context is servicing frequent requests, scheduling may never be disabled on it. For GuC mode, since updates to the context runtime may be delayed, add hooks to update the context runtime in a worker thread as well as when a user queries for it. Limitation: - If a context is never switched out or runs for a long period of time, the runtime value of CTX_TIMESTAMP may never be updated, so the counter value may be unreliable. This patch does not support such cases. Such support must be available from the GuC FW and it is WIP. This patch is an extract from previous work authored by John/Umesh here - https://patchwork.freedesktop.org/patch/496441/?series=105085&rev=4 v2: (Ashutosh) - Drop COPS_RUNTIME_ACTIVE_TOTAL - s/guc_context_update_clks/__guc_context_update_stats - Pin context before accessing in guc_timestamp_ping - In guc_context_unpin, use spinlock to serialize access to runtime stats Signed-off-by: Umesh Nerlige Ramappa Co-developed-by: John Harrison Signed-off-by: John Harrison Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230427224705.2785566-2-umesh.nerlige.ramappa@intel.com commit bfdede3a58ea970333d77a05144a7bcec13cf515 Author: Jani Nikula Date: Thu Sep 1 15:47:10 2022 +0300 drm/rockchip: cdn-dp: call drm_connector_update_edid_property() unconditionally Calling drm_connector_update_edid_property() should be done unconditionally instead of depending on the number of modes added. Also match the call order in inno_hdmi and rk3066_hdmi. Cc: Sandy Huang Cc: Heiko Stübner Signed-off-by: Jani Nikula Reviewed-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/bb733eccfb389533cc6e207689be845164a1ed91.1662036058.git.jani.nikula@intel.com commit 851c1aaed86260a8b5de9d03a31a5f8b0cd18dc0 Author: Jani Nikula Date: Thu Sep 1 15:47:09 2022 +0300 drm/sti/sti_hdmi: convert to using is_hdmi from display info Prefer the parsed results for is_hdmi in display info over calling drm_detect_hdmi_monitor(). Remove the now redundant hdmi_monitor member from struct sti_hdmi. Cc: Alain Volmat Signed-off-by: Jani Nikula Acked-by: Alain Volmat Link: https://patchwork.freedesktop.org/patch/msgid/74fbd7a83712009734534d92e5499d4d87f0c53b.1662036058.git.jani.nikula@intel.com commit f60500f31e99fe5e641071d2ed4a8164a8050701 Author: Arun R Murthy Date: Tue Apr 25 08:29:44 2023 +0530 drm/i915/display/dp: 128/132b LT requirement For 128b/132b LT prior to LT DPTX should set power state, DP channel coding and then link rate. v2: added separate function to avoid code duplication(Jani N) v3: DP2.1 section 3.5.2.16 is ordered, 3.5.1.2 is unordered and hence discarding Signed-off-by: Arun R Murthy Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230425025944.151744-1-arun.r.murthy@intel.com commit da3a99afd2575e744fe52cf661ce3f12feedd675 Author: Jani Nikula Date: Fri Apr 21 16:59:48 2023 +0300 drm/i915/rc6: throw out set() wrapper Remove useless indirection that's just misdirection for the readers. Signed-off-by: Jani Nikula Reviewed-by: Matt Roper Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230421135948.2029121-1-jani.nikula@intel.com commit 3a2df60200a03f78173f1fd831aa54c08464dcde Author: Biswarup Pal Date: Mon May 1 20:19:19 2023 -0700 Input: uinput - allow injecting event times Currently, uinput doesn't use the input_set_timestamp API, so any event injected using uinput is not accurately timestamped in terms of measuring when the actual event happened. Hence, call the input_set_timestamp API from uinput in order to provide a more accurate sense of time for the event. Propagate only the timestamps which are a) positive, b) within a pre-defined offset (10 secs) from the current time, and c) not in the future. Signed-off-by: Biswarup Pal Reviewed-by: Peter Hutterer Reviewed-by: Siarhei Vishniakou Link: https://lore.kernel.org/r/20230427000152.1407471-1-biswarupp@google.com Signed-off-by: Dmitry Torokhov commit 9780432158de0a0da88c3b506d6bdf63da43bc75 Author: André Apitzsch Date: Mon May 1 20:16:52 2023 -0700 Input: atmel_mxt_ts - support capacitive keys Add support for touch keys found in some Atmel touch controller configurations. Reviewed-by: Claudiu Beznea Reviewed-by: Linus Walleij Signed-off-by: André Apitzsch Link: https://lore.kernel.org/r/20230407-atmel_keys-v2-2-92446a4343cb@apitzsch.eu Signed-off-by: Dmitry Torokhov commit 272a26186a587430e8649058c91eab43c39857dd Author: André Apitzsch Date: Mon May 1 20:16:37 2023 -0700 dt-bindings: input: atmel,maxtouch: add linux,keycodes In some configurations the touch controller can support the touch keys. Document the linux,keycodes property that enables those keys and specifies the keycodes that should be used to report the key events. Reviewed-by: Linus Walleij Acked-by: Krzysztof Kozlowski Signed-off-by: André Apitzsch Link: https://lore.kernel.org/r/20230407-atmel_keys-v2-1-92446a4343cb@apitzsch.eu Signed-off-by: Dmitry Torokhov commit 7b9c13dd4d0ebbe89dfd7e1ecd09696037622101 Author: Michał Mirosław Date: Mon May 1 17:39:45 2023 -0700 Input: i8042 - add missing include include uses ENODEV when included with !IS_ENABLED(CONFIG_SERIO_I8042) and so need to include it. Signed-off-by: Michał Mirosław Link: https://lore.kernel.org/r/49fd4d400d1ab62095e5ed75a6637f883c0d071b.1682795105.git.mirq-linux@rere.qmqm.pl Signed-off-by: Dmitry Torokhov commit dbe836576f12743a7d2d170ad4ad4fd324c4d47a Author: Duoming Zhou Date: Mon May 1 17:37:02 2023 -0700 Input: cyttsp4_core - change del_timer_sync() to timer_shutdown_sync() The watchdog_timer can schedule tx_timeout_task and watchdog_work can also arm watchdog_timer. The process is shown below: ----------- timer schedules work ------------ cyttsp4_watchdog_timer() //timer handler schedule_work(&cd->watchdog_work) ----------- work arms timer ------------ cyttsp4_watchdog_work() //workqueue callback function cyttsp4_start_wd_timer() mod_timer(&cd->watchdog_timer, ...) Although del_timer_sync() and cancel_work_sync() are called in cyttsp4_remove(), the timer and workqueue could still be rearmed. As a result, the possible use after free bugs could happen. The process is shown below: (cleanup routine) | (timer and workqueue routine) cyttsp4_remove() | cyttsp4_watchdog_timer() //timer cyttsp4_stop_wd_timer() | schedule_work() del_timer_sync() | | cyttsp4_watchdog_work() //worker | cyttsp4_start_wd_timer() | mod_timer() cancel_work_sync() | | cyttsp4_watchdog_timer() //timer | schedule_work() del_timer_sync() | kfree(cd) //FREE | | cyttsp4_watchdog_work() // reschedule! | cd-> //USE This patch changes del_timer_sync() to timer_shutdown_sync(), which could prevent rearming of the timer from the workqueue. Fixes: 17fb1563d69b ("Input: cyttsp4 - add core driver for Cypress TMA4XX touchscreen devices") Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20230421082919.8471-1-duoming@zju.edu.cn Signed-off-by: Dmitry Torokhov commit 90c6491139115e1f3a9e9467fa56fc4515df3f27 Author: Maximilian Weigand Date: Mon May 1 17:15:29 2023 -0700 dt-bindings: input: cypress,tt21000 - add wakeup-source entry to documentation The touchscreen can be used to wake up systems from sleep and therefore the wakeup-source entry should be included in the documentation. Signed-off-by: Maximilian Weigand Reviewed-by: Alistair Francis Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230501113010.891786-6-mweigand@mweigand.net Signed-off-by: Dmitry Torokhov commit 14d55bc3606b17765d39210c012e7782ee423d84 Author: Maximilian Weigand Date: Mon May 1 17:13:25 2023 -0700 Input: cyttsp5 - remove unused code The removed lines are remnants of the vendor driver and are not used in the upstream driver. Signed-off-by: Maximilian Weigand Reviewed-by: Alistair Francis Link: https://lore.kernel.org/r/20230501113010.891786-3-mweigand@mweigand.net Signed-off-by: Dmitry Torokhov commit d09dbc7a018c4d479d7ab0d3b4f6a3211b110923 Author: Luca Weiss Date: Mon May 1 17:02:56 2023 -0700 Input: drv260x - fix magnitude handling First of all, previously the 16-bit magnitude was written as-is to the device which actually discarded the upper 8 bits since the device has 8-bit registers only. This meant that a strong_magnitude of 0xFF00 would result in 0. To correct this shift the strong_magnitude / weak_magnitude input values so we discard the lower 8 bits and keep the upper bits instead. Secondly the RTP mode that is used by default interprets the values as signed (2s complement), so 0x81 = 0%, 0x00 = 50%, 0x7F = 100%. This doesn't match the FF_RUMBLE interface at all, so let's tell the device to interpret the data as unsigned instead which gets us 0x00 = 0% and 0xFF = 100%. As last change switch ERM to using "Closed-Loop Mode, Unidirectional" instead of "Open-Loop Mode" since it's recommended by the datasheet compared to open loop and better matches our use case of 0% - 100% vibration. Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20230430-drv260x-improvements-v1-4-1fb28b4cc698@z3ntu.xyz Signed-off-by: Dmitry Torokhov commit 980626ec1ca82a10dc04026a79dcbade23cc3438 Author: Luca Weiss Date: Mon May 1 17:02:10 2023 -0700 Input: drv260x - remove unused .reg_defaults Since the driver has disabled regmap caching with REGCACHE_NONE, it's warning us that we provide defaults that are not used. Remove them. [ 0.561159] drv260x-haptics 0-005a: No cache used with register defaults set! Fixes: 7132fe4f5687 ("Input: drv260x - add TI drv260x haptics driver") Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20230430-drv260x-improvements-v1-3-1fb28b4cc698@z3ntu.xyz Signed-off-by: Dmitry Torokhov commit efef661dfa6bf8cbafe4cd6a97433fcef0118967 Author: Luca Weiss Date: Mon May 1 17:01:45 2023 -0700 Input: drv260x - sleep between polling GO bit When doing the initial startup there's no need to poll without any delay and spam the I2C bus. Let's sleep 15ms between each attempt, which is the same time as used in the vendor driver. Fixes: 7132fe4f5687 ("Input: drv260x - add TI drv260x haptics driver") Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20230430-drv260x-improvements-v1-2-1fb28b4cc698@z3ntu.xyz Signed-off-by: Dmitry Torokhov commit 116721a560d66dee488f291a1d218b5fc6050678 Author: Luca Weiss Date: Mon May 1 16:59:37 2023 -0700 Input: drv260x - fix typo in register value define ANANLOG should be ANALOG. Fix the typo. Fixes: 7132fe4f5687 ("Input: drv260x - add TI drv260x haptics driver") Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20230430-drv260x-improvements-v1-1-1fb28b4cc698@z3ntu.xyz Signed-off-by: Dmitry Torokhov commit 577c34b3be6e55ade4e0391022b9a539b20d77c5 Merge: c39028b333f3a 64276f01dce85 Author: Andrii Nakryiko Date: Mon May 1 15:30:02 2023 -0700 Merge branch 'selftests/bpf: test_progs can read test lists from file' Stephen Veiss says: ==================== BPF selftests have ALLOWLIST and DENYLIST files, used to control which tests are run in CI. These files are currently parsed by a shell script. [1] This patchset allows those files to be specified directly on the test_progs command line (eg, as -a @ALLOWLIST). This also fixes a bug in the existing test filter code causing unnecessary duplicate top-level test filter entries to be created. [1] https://github.com/kernel-patches/vmtest/blob/57feb460047b69f891cf4afe3cc860794a2ced17/ci/vmtest/run_selftests.sh#L21-L27 --- v2: - error handling style changes per reviewer comments - fdopen return value checking in test_parse_test_list_file v1: https://lore.kernel.org/bpf/20230425225401.1075796-1-sveiss@meta.com/ ==================== Signed-off-by: Andrii Nakryiko commit 64276f01dce85f72853617e513622b5645497d81 Author: Stephen Veiss Date: Thu Apr 27 15:53:33 2023 -0700 selftests/bpf: Test_progs can read test lists from file Improve test selection logic when using -a/-b/-d/-t options. The list of tests to include or exclude can now be read from a file, specified as @. The file contains one name (or wildcard pattern) per line, and comments beginning with # are ignored. These options can be passed multiple times to read more than one file. Signed-off-by: Stephen Veiss Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20230427225333.3506052-3-sveiss@meta.com commit 0a5c0de8b66f9789422f04de7304e374a2ea8df5 Author: Stephen Veiss Date: Thu Apr 27 15:53:32 2023 -0700 selftests/bpf: Extract insert_test from parse_test_list Split the logic to insert new tests into test filter sets out from parse_test_list. Fix the subtest insertion logic to reuse an existing top-level test filter, which prevents the creation of duplicate top-level test filters each with a single subtest. Signed-off-by: Stephen Veiss Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20230427225333.3506052-2-sveiss@meta.com commit c39028b333f3a3a765c5c0b9726b8e38aedf0ba1 Author: Martin KaFai Lau Date: Thu Apr 27 18:36:38 2023 -0700 libbpf: btf_dump_type_data_check_overflow needs to consider BTF_MEMBER_BITFIELD_SIZE The btf_dump/struct_data selftest is failing with: [...] test_btf_dump_struct_data:FAIL:unexpected return value dumping fs_context unexpected unexpected return value dumping fs_context: actual -7 != expected 264 [...] The reason is in btf_dump_type_data_check_overflow(). It does not use BTF_MEMBER_BITFIELD_SIZE from the struct's member (btf_member). Instead, it is using the enum size which is 4. It had been working till the recent commit 4e04143c869c ("fs_context: drop the unused lsm_flags member") removed an integer member which also removed the 4 bytes padding at the end of the fs_context. Missing this 4 bytes padding exposed this bug. In particular, when btf_dump_type_data_check_overflow() reaches the member 'phase', -E2BIG is returned. The fix is to pass bit_sz to btf_dump_type_data_check_overflow(). In btf_dump_type_data_check_overflow(), it does a different size check when bit_sz is not zero. The current fs_context: [3600] ENUM 'fs_context_purpose' encoding=UNSIGNED size=4 vlen=3 'FS_CONTEXT_FOR_MOUNT' val=0 'FS_CONTEXT_FOR_SUBMOUNT' val=1 'FS_CONTEXT_FOR_RECONFIGURE' val=2 [3601] ENUM 'fs_context_phase' encoding=UNSIGNED size=4 vlen=7 'FS_CONTEXT_CREATE_PARAMS' val=0 'FS_CONTEXT_CREATING' val=1 'FS_CONTEXT_AWAITING_MOUNT' val=2 'FS_CONTEXT_AWAITING_RECONF' val=3 'FS_CONTEXT_RECONF_PARAMS' val=4 'FS_CONTEXT_RECONFIGURING' val=5 'FS_CONTEXT_FAILED' val=6 [3602] STRUCT 'fs_context' size=264 vlen=21 'ops' type_id=3603 bits_offset=0 'uapi_mutex' type_id=235 bits_offset=64 'fs_type' type_id=872 bits_offset=1216 'fs_private' type_id=21 bits_offset=1280 'sget_key' type_id=21 bits_offset=1344 'root' type_id=781 bits_offset=1408 'user_ns' type_id=251 bits_offset=1472 'net_ns' type_id=984 bits_offset=1536 'cred' type_id=1785 bits_offset=1600 'log' type_id=3621 bits_offset=1664 'source' type_id=42 bits_offset=1792 'security' type_id=21 bits_offset=1856 's_fs_info' type_id=21 bits_offset=1920 'sb_flags' type_id=20 bits_offset=1984 'sb_flags_mask' type_id=20 bits_offset=2016 's_iflags' type_id=20 bits_offset=2048 'purpose' type_id=3600 bits_offset=2080 bitfield_size=8 'phase' type_id=3601 bits_offset=2088 bitfield_size=8 'need_free' type_id=67 bits_offset=2096 bitfield_size=1 'global' type_id=67 bits_offset=2097 bitfield_size=1 'oldapi' type_id=67 bits_offset=2098 bitfield_size=1 Fixes: 920d16af9b42 ("libbpf: BTF dumper support for typed data") Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20230428013638.1581263-1-martin.lau@linux.dev commit ee9634282d875083b2a172f0181f5fe6be50c524 Author: Mika Kahola Date: Fri Apr 28 12:54:33 2023 +0300 drm/i915/mtl: Enable TC ports Finally, we can enable TC ports for Meteorlake. Reviewed-by: Clint Taylor Signed-off-by: Mika Kahola Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-14-mika.kahola@intel.com commit dac6ce66db3e3bdb5dc66f6713929b125612ef01 Author: Anusha Srivatsa Date: Fri Apr 28 12:54:32 2023 +0300 drm/i915/mtl: Pin assignment for TypeC Unlike previous platforms that used PORT_TX_DFLEXDPSP for max_lane calculation, MTL uses only PORT_TX_DFLEXPA1 from which the max_lanes has to be calculated. Bspec: 50235, 65380 Reviewed-by: Matt Atwood Signed-off-by: Anusha Srivatsa Signed-off-by: Jose Roberto de Souza Signed-off-by: Mika Kahola Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-13-mika.kahola@intel.com commit 4366750a0d2d587ae8335944d723eb43a6c0d94a Author: Imre Deak Date: Fri Apr 28 12:54:31 2023 +0300 drm/i915/mtl: TypeC HPD live status query The HPD live status for MTL has to be read from different set of registers. MTL deserves a new function for this purpose and cannot reuse the existing HPD live status detection Reviewed-by: Matt Atwood Signed-off-by: Anusha Srivatsa Signed-off-by: Imre Deak Signed-off-by: Mika Kahola Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-12-mika.kahola@intel.com commit 6f0423b06a0cd55133bafb7a69fd2ac1ff7a6750 Author: Mika Kahola Date: Fri Apr 28 12:54:30 2023 +0300 drm/i915/mtl: Power up TCSS Add register writes to enable powering up Type-C subsystem i.e. TCSS. For MeteorLake we need to request TCSS to power up and check the TCSS power state after 500 us. In addition, for PICA we need to set/clear the Type-C PHY ownnership bit when Type-C device is connected/disconnected. Reviewed-by: Matt Atwood Signed-off-by: Mika Kahola Signed-off-by: Imre Deak Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-11-mika.kahola@intel.com commit c0f3faaf936b67e124e9159fb1223a689cf9e15e Author: Gustavo Sousa Date: Fri Apr 28 12:54:29 2023 +0300 drm/i915/mtl: Define mask for DDI AUX interrupts Xe_LPD+ defines interrupt bits for only DDI ports in the DE Port Interrupt registers. The bits for Type-C ports are defined in the PICA interrupt registers. BSpec: 50064 Reviewed-by: Radhakrishna Sripada Signed-off-by: Gustavo Sousa Signed-off-by: Mika Kahola Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-10-mika.kahola@intel.com commit 7dee06bc0ff5ac7341ee3cde8161e58dc43dd9b0 Author: Mika Kahola Date: Fri Apr 28 12:54:28 2023 +0300 drm/i915/mtl: Readout Thunderbolt HW state Readout hw state for Thunderbolt. Reviewed-by: Radhakrishna Sripada Signed-off-by: Mika Kahola Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-9-mika.kahola@intel.com commit 73fc3abcb79732c2c9d4745d61b6859f587f01a3 Author: Mika Kahola Date: Fri Apr 28 12:54:27 2023 +0300 drm/i915/mtl: Enabling/disabling sequence Thunderbolt pll Enabling and disabling sequence for Thunderbolt PLL. Bspec: 64568 v2: Use intel_de_wait_for_register() (RK) Reviewed-by: Radhakrishna Sripada Signed-off-by: Mika Kahola Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-8-mika.kahola@intel.com commit 237e7be0bf57c2dd36f074d3b03a3291db3b3abf Author: Mika Kahola Date: Fri Apr 28 12:54:26 2023 +0300 drm/i915/mtl: For DP2.0 10G and 20G rates use MPLLA Use MPLLA for DP2.0 rates 10G and 20G, when ssc is enabled. v2: Fix typo in commit message (Animesh) Reviewed-by: Radhakrishna Sripada Reviewed-by: Arun R Murthy Signed-off-by: Mika Kahola Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-7-mika.kahola@intel.com commit ac50317e2659143bd1111b1785b5c0fa0ac1f6bf Author: Mika Kahola Date: Fri Apr 28 12:54:25 2023 +0300 drm/i915/mtl: Add voltage swing sequence for C20 DP1.4 and DP20 voltage swing sequence for C20 phy. Bspec: 65449, 67636, 67610 Reviewed-by: Arun R Murthy Signed-off-by: Mika Kahola Signed-off-by: Clint Taylor Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-6-mika.kahola@intel.com commit f1f9e62737abc4b6481a9a814526bd3e2cfd4d2f Author: Mika Kahola Date: Fri Apr 28 12:54:24 2023 +0300 drm/i915/mtl: C20 port clock calculation Calculate port clock with C20 phy. BSpec: 64568 Reviewed-by: Radhakrishna Sripada Reviewed-by: Arun R Murthy Signed-off-by: Mika Kahola Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-5-mika.kahola@intel.com commit f968a25381acbe147c675fdd7a048f170e6cf44b Author: Mika Kahola Date: Fri Apr 28 12:54:23 2023 +0300 drm/i915/mtl: Dump C20 pll hw state As we already do with C10 chip, let's dump the pll hw state for C20 as well. Reviewed-by: Radhakrishna Sripada Reviewed-by: Arun R Murthy Signed-off-by: Mika Kahola Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-4-mika.kahola@intel.com commit 929f527a7b70a5a7810f83c5e8941657413596c3 Author: Mika Kahola Date: Fri Apr 28 12:54:22 2023 +0300 drm/i915/mtl: C20 HW readout Create a table for C20 DP1.4, DP2.0 and HDMI2.1 rates. The PLL settings are based on table, not for algorithmic alternative. For DP 1.4 only MPLLB is in use. Once register settings are done, we read back C20 HW state. BSpec: 64568 v2: Updated pll tables (RK) MPLLB selection fix (RK) Signed-off-by: Mika Kahola Signed-off-by: Arun R Murthy Signed-off-by: Ankit Nautiyal Reviewed-by: Radhakrishna Sripada Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-3-mika.kahola@intel.com commit 62618c7f117eedfd99b2f857885ed004d31df739 Author: Mika Kahola Date: Fri Apr 28 12:54:21 2023 +0300 drm/i915/mtl: C20 PLL programming C20 phy PLL programming sequence for DP, DP2.0, HDMI2.x non-FRL and HDMI2.x FRL. This enables C20 MPLLA and MPLLB programming sequence. add 4 lane support for c20. v2: Add 6.48Gbps and 6.75Gbps modes for eDP (RK) Fix lane check (RK) Fix multiline commenting (Arun) use usleep_range() instead of msleep() (Andi) Reviewed-by: Arun R Murthy Signed-off-by: José Roberto de Souza Signed-off-by: Mika Kahola Signed-off-by: Bhanuprakash Modem Signed-off-by: Imre Deak Signed-off-by: Arun R Murthy Reviewed-by: Radhakrishna Sripada Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230428095433.4109054-2-mika.kahola@intel.com commit c5c51b2420625faa1f0e363f21dba1de53806ff7 Author: Won Chung Date: Thu Apr 27 16:58:13 2023 +0000 drm/sysfs: Link DRM connectors to corresponding Type-C connectors Create a symlink pointing to USB Type-C connector for DRM connectors when they are created. The link will be created only if the firmware is able to describe the connection beween the two connectors. Currently, even if a display uses a USB Type-C port, there is no way for the userspace to find which port is used for which display. With the symlink, display information would be accessible from Type-C connectors and port information would be accessible from DRM connectors. Associating the two subsystems, userspace would have potential to expose and utilize more complex information. ChromeOS intend to use this information for metrics collection. For example, we want to tell which port is deriving which displays. Also, combined with USB PD information, we can tell whether user is charging their device through display. Chromium patch for parsing the symlink from the kernel is at http://crrev.com/c/4317207. We already have a framework in typec port-mapper.c where it goes through component devices and runs the bind functions for those with matching _PLD (physical location of device). https://elixir.bootlin.com/linux/v5.18.1/source/drivers/usb/typec/ port-mapper.c Since _PLD is ACPI specific field, this linking would only work on ACPI x86 as long as _PLD field for Type-C connectors and DRM connectors are correctly added to the firmware. Currently, USB ports and USB4 ports are added as components to create a symlink with Type C connector. USB: https://lore.kernel.org/all/20211223082349.45616-1-heikki.krogerus @linux.intel.com/ USB4: https://lore.kernel.org/all/20220418175932.1809770-3-wonchung@google.com/ So, we follow the same pattern in this patch. Signed-off-by: Won Chung Acked-by: Heikki Krogerus Reviewed-by: Manasi Navare Signed-off-by: Manasi Navare Link: https://patchwork.freedesktop.org/patch/msgid/20230427165813.2844530-1-wonchung@google.com commit f0038cffa843697501c442eff4468e3ab37031f1 Author: Won Chung Date: Wed Mar 29 01:44:55 2023 +0000 drm/sysfs: Expose DRM connector id in each connector sysfs Expose DRM connector id in device sysfs so that we can map the connector id to the connector syspath. Currently, even if we can derive the connector id from modeset, we do not have a way to find the corresponding connector's syspath. This is helpful when determining the root connector of MST tree. When a tree of multiple MST hub is connected to the system, modeset describes the tree in the PATH blob. For example, consider the following scenario. +-------------+ | Source | +-------------+ | (Device) | | BranchX | | | | (MST) | | [conn6]--->| [port1]--->DisplayA +-------------+ | | | | +-------------+ | | | BranchY | | | | (MST) | | [port2]--->| [port1]----->DisplayB +-------------+ | | | [port2]----->DisplayC +-------------+ DPMST connector of DisplayA would have "mst:6-1" PATH. DPMST connector of DisplayB would have "mst:6-2-1" PATH. DPMST connector of DisplayC would have "mst:6-2-2" PATH. Given that connector id of 6 is the root of the MST connector tree, we can utilize this patch to parse through DRM connectors sysfs and find which connector syspath corresponds to the root connector (id == 6). ChromeOS intend to use this information for metrics collection. For example, we want to tell which port is deriving which displays even with a MST hub. Chromium patch for parsing DRM connector id from the kernel is at http://crrev.com/c/4317207. Signed-off-by: Won Chung Reviewed-by: Manasi Navare Signed-off-by: Manasi Navare Link: https://patchwork.freedesktop.org/patch/msgid/20230329014455.1990104-1-wonchung@google.com commit 0be05a75de2916421e88e0d64b001984f54df0bd Author: Markus Elfring Date: Sun Apr 16 17:30:46 2023 +0200 drm/bridge: it6505: Move a variable assignment behind a null pointer check in receive_timing_debugfs_show() The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “receive_timing_debugfs_show”. Thus avoid the risk for undefined behaviour by moving the assignment for the variable “vid” behind the null pointer check. This issue was detected by using the Coccinelle software. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Markus Elfring Link: https://patchwork.freedesktop.org/patch/msgid/fa69384f-1485-142b-c4ee-3df54ac68a89@web.de Reviewed-by: Robert Foss Signed-off-by: Robert Foss commit c73bd1706c0cdb5627d312efdc656baf48e0247f Author: Vinay Belgaumkar Date: Tue Apr 25 17:39:42 2023 -0700 drm/i915/selftest: Update the SLPC selftest Use the new efficient frequency toggling interface. Also create a helper function to restore the frequencies after the test is done. v2: Restore max freq first and then min. Signed-off-by: Vinay Belgaumkar Reviewed-by: Andi Shyti Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230426003942.1924347-2-vinay.belgaumkar@intel.com commit 55f9720dbf23ed640a51ea5564c22305efa8a467 Author: Vinay Belgaumkar Date: Tue Apr 25 17:39:41 2023 -0700 drm/i915/guc/slpc: Provide sysfs for efficient freq SLPC enables use of efficient freq at init by default. It is possible for GuC to request frequencies that are higher than the 'software' max if user has set it lower than the efficient level. Scenarios/tests that require strict fixing of freq below the efficient level will need to disable it through this interface. v2: Keep just one interface to toggle sysfs. With this, user will be completely responsible for toggling efficient frequency if need be. There will be no implicit disabling when user sets min < RP1 (Ashutosh) v3: Remove unused label, review comments (Ashutosh) v4: Toggle efficient freq usage in SLPC selftest and checkpatch fixes v5: Review comments (Andi) and add a separate patch for selftest updates Fixes: 95ccf312a1e4 ("drm/i915/guc/slpc: Allow SLPC to use efficient frequency") Signed-off-by: Vinay Belgaumkar Reviewed-by: Rodrigo Vivi Reviewed-by: Ashutosh Dixit Reviewed-by: Andi Shyti Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230426003942.1924347-1-vinay.belgaumkar@intel.com commit e2ceb1de2f83aafd8003f0b72dfd4b7441e97d14 Author: Maxime Bizon Date: Fri Apr 21 16:54:45 2023 +0200 wifi: ath11k: fix registration of 6Ghz-only phy without the full channel range Because of what seems to be a typo, a 6Ghz-only phy for which the BDF does not allow the 7115Mhz channel will fail to register: WARNING: CPU: 2 PID: 106 at net/wireless/core.c:907 wiphy_register+0x914/0x954 Modules linked in: ath11k_pci sbsa_gwdt CPU: 2 PID: 106 Comm: kworker/u8:5 Not tainted 6.3.0-rc7-next-20230418-00549-g1e096a17625a-dirty #9 Hardware name: Freebox V7R Board (DT) Workqueue: ath11k_qmi_driver_event ath11k_qmi_driver_event_work pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : wiphy_register+0x914/0x954 lr : ieee80211_register_hw+0x67c/0xc10 sp : ffffff800b123aa0 x29: ffffff800b123aa0 x28: 0000000000000000 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000006 x24: ffffffc008d51418 x23: ffffffc008cb0838 x22: ffffff80176c2460 x21: 0000000000000168 x20: ffffff80176c0000 x19: ffffff80176c03e0 x18: 0000000000000014 x17: 00000000cbef338c x16: 00000000d2a26f21 x15: 00000000ad6bb85f x14: 0000000000000020 x13: 0000000000000020 x12: 00000000ffffffbd x11: 0000000000000208 x10: 00000000fffffdf7 x9 : ffffffc009394718 x8 : ffffff80176c0528 x7 : 000000007fffffff x6 : 0000000000000006 x5 : 0000000000000005 x4 : ffffff800b304284 x3 : ffffff800b304284 x2 : ffffff800b304d98 x1 : 0000000000000000 x0 : 0000000000000000 Call trace: wiphy_register+0x914/0x954 ieee80211_register_hw+0x67c/0xc10 ath11k_mac_register+0x7c4/0xe10 ath11k_core_qmi_firmware_ready+0x1f4/0x570 ath11k_qmi_driver_event_work+0x198/0x590 process_one_work+0x1b8/0x328 worker_thread+0x6c/0x414 kthread+0x100/0x104 ret_from_fork+0x10/0x20 ---[ end trace 0000000000000000 ]--- ath11k_pci 0002:01:00.0: ieee80211 registration failed: -22 ath11k_pci 0002:01:00.0: failed register the radio with mac80211: -22 ath11k_pci 0002:01:00.0: failed to create pdev core: -22 Signed-off-by: Maxime Bizon Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421145445.2612280-1-mbizon@freebox.fr commit 33f83a23f4cccc3a30cc41aa0e01b66900001052 Author: Christophe JAILLET Date: Tue Apr 25 13:57:19 2023 +0200 wifi: ath12k: Remove some dead code ATH12K_HE_MCS_MAX = 11, so this test and the following one are the same. Remove the one with the hard coded 11 value. Signed-off-by: Christophe JAILLET Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/c17edf0811156a33bae6c5cf1906d751cc87edd4.1682423828.git.christophe.jaillet@wanadoo.fr commit f24292e827088bba8de7158501ac25a59b064953 Author: Fedor Pchelkin Date: Wed Apr 26 17:35:01 2023 +0300 wifi: ath9k: avoid referencing uninit memory in ath9k_wmi_ctrl_rx For the reasons also described in commit b383e8abed41 ("wifi: ath9k: avoid uninit memory read in ath9k_htc_rx_msg()"), ath9k_htc_rx_msg() should validate pkt_len before accessing the SKB. For example, the obtained SKB may have been badly constructed with pkt_len = 8. In this case, the SKB can only contain a valid htc_frame_hdr but after being processed in ath9k_htc_rx_msg() and passed to ath9k_wmi_ctrl_rx() endpoint RX handler, it is expected to have a WMI command header which should be located inside its data payload. Implement sanity checking inside ath9k_wmi_ctrl_rx(). Otherwise, uninit memory can be referenced. Tested on Qualcomm Atheros Communications AR9271 802.11n . Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: fb9987d0f748 ("ath9k_htc: Support for AR9271 chipset.") Reported-and-tested-by: syzbot+f2cb6e0ffdb961921e4d@syzkaller.appspotmail.com Signed-off-by: Fedor Pchelkin Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230424183348.111355-1-pchelkin@ispras.ru commit 3e56c80931c7615250fe4bf83f93b57881969266 Author: Peter Seiderer Date: Wed Apr 26 17:35:00 2023 +0300 wifi: ath9k: fix AR9003 mac hardware hang check register offset calculation Fix ath9k_hw_verify_hang()/ar9003_hw_detect_mac_hang() register offset calculation (do not overflow the shift for the second register/queues above five, use the register layout described in the comments above ath9k_hw_verify_hang() instead). Fixes: 222e04830ff0 ("ath9k: Fix MAC HW hang check for AR9003") Reported-by: Gregg Wonderly Link: https://lore.kernel.org/linux-wireless/E3A9C354-0CB7-420C-ADEF-F0177FB722F4@seqtechllc.com/ Signed-off-by: Peter Seiderer Acked-by: Toke Høiland-Jørgensen Reviewed-by: Simon Horman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230422212423.26065-1-ps.report@gmx.net commit 99e7e3b60080d913ff2f94943f4af1f1b76a1c06 Author: Ville Syrjälä Date: Wed Apr 12 01:29:26 2023 +0300 drm/uapi: Document CTM matrix better Document in which order the CTM matrix elements are stored. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230411222931.15127-2-ville.syrjala@linux.intel.com Reviewed-by: Xaver Hugl Acked-by: Simon Ser commit eee44c2903e5222632536f86ad5cf0ff9bbfc61b Author: Jonathan Cavitt Date: Wed Apr 26 23:28:49 2023 +0200 drm/i915: Use correct huge page manager for MTL MTL currently uses gen8_ppgtt_insert_huge when managing huge pages. This is because MTL reports as not supporting 64K pages, or more accurately, the system that reports whether a platform has 64K pages reports false for MTL. This is only half correct, as the 64K page support reporting system only cares about 64K page support for LMEM, which MTL doesn't have. MTL should be using xehpsdv_ppgtt_insert_huge. However, simply changing over to using that manager doesn't resolve the issue because MTL is expecting the virtual address space for the page table to be flushed after initialization, so we must also add a flush statement there. Signed-off-by: Jonathan Cavitt Reviewed-by: Matthew Auld Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230425-hugepage-migrate-v8-2-7868d54eaa27@intel.com commit d59ce1ff8e6830fab60b688f33a89ef48c94b5d8 Author: Jonathan Cavitt Date: Wed Apr 26 23:28:48 2023 +0200 drm/i915: Migrate platform-dependent mock hugepage selftests to live Convert the igt_mock_ppgtt_huge_fill and igt_mock_ppgtt_64K mock selftests into live selftests as their requirements have recently become platform-dependent. Additionally, apply necessary platform dependency checks to these tests. v8: - handle properly 64K and 2M pages v9: - do not expect 64K pages if 2M are present - fix hex printing - obey commit message line limit Signed-off-by: Jonathan Cavitt Co-developed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230425-hugepage-migrate-v8-1-7868d54eaa27@intel.com commit fa83c12132f71302f7d4b02758dc0d46048d3f5f Author: Hans de Goede Date: Tue Apr 25 21:44:41 2023 +0200 drm/i915/dsi: Use unconditional msleep() instead of intel_dsi_msleep() The intel_dsi_msleep() helper skips sleeping if the MIPI-sequences have a version of 3 or newer and the panel is in vid-mode. This is based on the big comment around line 730 which starts with "Panel enable/disable sequences from the VBT spec.", where the "v3 video mode seq" column does not have any wait t# entries. Checking the Windows driver shows that it does always honor the VBT delays independent of the version of the VBT sequences. Commit 6fdb335f1c9c ("drm/i915/dsi: Use unconditional msleep for the panel_on_delay when there is no reset-deassert MIPI-sequence") switched to a direct msleep() instead of intel_dsi_msleep() when there is no MIPI_SEQ_DEASSERT_RESET sequence, to fix the panel on an Acer Aspire Switch 10 E SW3-016 not turning on. And now testing on a Nextbook Ares 8A shows that panel_on_delay must always be honored otherwise the panel will not turn on. Instead of only always using regular msleep() for panel_on_delay do as Windows does and always use regular msleep() everywhere were intel_dsi_msleep() is used and drop the intel_dsi_msleep() helper. Changes in v2: - Replace all intel_dsi_msleep() calls instead of just the intel_dsi_msleep(panel_on_delay) call Cc: stable@vger.kernel.org Fixes: 6fdb335f1c9c ("drm/i915/dsi: Use unconditional msleep for the panel_on_delay when there is no reset-deassert MIPI-sequence") Signed-off-by: Hans de Goede Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230425194441.68086-1-hdegoede@redhat.com commit 31f4f810d533e7ed9a835c5f946eceaec015ce10 Author: Martin KaFai Lau Date: Thu Apr 27 20:37:44 2023 -0700 selftests/bpf: Add fexit_sleep to DENYLIST.aarch64 It is reported that the fexit_sleep never returns in aarch64. The remaining tests cannot start. Put this test into DENYLIST.aarch64 for now so that other tests can continue to run in the CI. Acked-by: Manu Bretelle Reported-by: Manu Bretelle Signed-off-by: Martin KaFai Lau commit f1f5553d91a11663a5761b78e61f70c1db0bbd2f Author: Yonghong Song Date: Tue Apr 25 10:47:44 2023 -0700 selftests/bpf: Fix selftest test_global_funcs/global_func1 failure with latest clang The selftest test_global_funcs/global_func1 failed with the latest clang17. The reason is due to upstream ArgumentPromotionPass ([1]), which may manipulate static function parameters and cause inlining although the funciton is marked as noinline. The original code: static __attribute__ ((noinline)) int f0(int var, struct __sk_buff *skb) { return skb->len; } __attribute__ ((noinline)) int f1(struct __sk_buff *skb) { ... return f0(0, skb) + skb->len; } ... SEC("tc") __failure __msg("combined stack size of 4 calls is 544") int global_func1(struct __sk_buff *skb) { return f0(1, skb) + f1(skb) + f2(2, skb) + f3(3, skb, 4); } After ArgumentPromotionPass, the code is translated to static __attribute__ ((noinline)) int f0(int var, int skb_len) { return skb_len; } __attribute__ ((noinline)) int f1(struct __sk_buff *skb) { ... return f0(0, skb->len) + skb->len; } ... SEC("tc") __failure __msg("combined stack size of 4 calls is 544") int global_func1(struct __sk_buff *skb) { return f0(1, skb->len) + f1(skb) + f2(2, skb) + f3(3, skb, 4); } And later llvm InstCombine phase recognized that f0() simplify returns the value of the second argument and removed f0() completely and the final code looks like: __attribute__ ((noinline)) int f1(struct __sk_buff *skb) { ... return skb->len + skb->len; } ... SEC("tc") __failure __msg("combined stack size of 4 calls is 544") int global_func1(struct __sk_buff *skb) { return skb->len + f1(skb) + f2(2, skb) + f3(3, skb, 4); } If f0() is not inlined, the verification will fail with stack size 544 for a particular callchain. With f0() inlined, the maximum stack size is 512 which is in the limit. Let us add a `asm volatile ("")` in f0() to prevent ArgumentPromotionPass from hoisting the code to its caller, and this fixed the test failure. [1] https://reviews.llvm.org/D148269 Signed-off-by: Yonghong Song Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230425174744.1758515-1-yhs@fb.com commit bf06c9393493a2862d4670beda2928423c774ff3 Author: Xueming Feng Date: Thu Apr 27 20:03:13 2023 +0800 bpftool: Dump map id instead of value for map_of_maps types When using `bpftool map dump` with map_of_maps, it is usually more convenient to show the inner map id instead of raw value. We are changing the plain print behavior to show inner_map_id instead of hex value, this would help with quick look up of inner map with `bpftool map dump id `. To avoid disrupting scripted behavior, we will add a new `inner_map_id` field to json output instead of replacing value. plain print: ``` $ bpftool map dump id 138 Without Patch: key: fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 27 16 06 00 value: 8b 00 00 00 Found 1 element With Patch: key: fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 27 16 06 00 inner_map_id: 139 Found 1 element ``` json print: ``` $ bpftool -p map dump id 567 Without Patch: [{ "key": ["0xc0","0x00","0x02","0x05","0x27","0x16","0x06","0x00" ], "value": ["0x38","0x02","0x00","0x00" ] } ] With Patch: [{ "key": ["0xc0","0x00","0x02","0x05","0x27","0x16","0x06","0x00" ], "value": ["0x38","0x02","0x00","0x00" ], "inner_map_id": 568 } ] ``` Signed-off-by: Xueming Feng Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230427120313.43574-1-kuro@kuroa.me Signed-off-by: Martin KaFai Lau commit 6ec7be9a2d2b09815f69fc2183ec31857eaa6e27 Author: Kal Conley Date: Sun Apr 23 20:01:56 2023 +0200 xsk: Use pool->dma_pages to check for DMA Compare pool->dma_pages instead of pool->dma_pages_cnt to check for an active DMA mapping. pool->dma_pages needs to be read anyway to access the map so this compiles to more efficient code. Signed-off-by: Kal Conley Signed-off-by: Daniel Borkmann Reviewed-by: Xuan Zhuo Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20230423180157.93559-1-kal.conley@dectris.com commit a4644119208444f84d9ffcd4d0af630046c2de98 Author: Florent Revest Date: Thu Apr 27 16:32:07 2023 +0200 selftests/bpf: Update the aarch64 tests deny list Now that ftrace supports direct call on arm64, BPF tracing programs work on that architecture. This fixes the vast majority of BPF selftests except for: - multi_kprobe programs which require fprobe, not available on arm64 yet - tracing_struct which requires trampoline support to access struct args This patch updates the list of BPF selftests which are known to fail so the BPF CI can validate the tests which pass now. Signed-off-by: Florent Revest Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20230427143207.635263-1-revest@chromium.org commit bb323478767d4b4d78380bc9e2c0971ca33442af Author: Jesper Dangaard Brouer Date: Tue Apr 18 15:31:03 2023 +0200 selftests/bpf: xdp_hw_metadata track more timestamps To correlate the hardware RX timestamp with something, add tracking of two software timestamps both clock source CLOCK_TAI (see description in man clock_gettime(2)). XDP metadata is extended with xdp_timestamp for capturing when XDP received the packet. Populated with BPF helper bpf_ktime_get_tai_ns(). I could not find a BPF helper for getting CLOCK_REALTIME, which would have been preferred. In userspace when AF_XDP sees the packet another software timestamp is recorded via clock_gettime() also clock source CLOCK_TAI. Example output shortly after loading igc driver: poll: 1 (0) skip=1 fail=0 redir=2 xsk_ring_cons__peek: 1 0x12557a8: rx_desc[1]->addr=100000000009000 addr=9100 comp_addr=9000 rx_hash: 0x82A96531 with RSS type:0x1 rx_timestamp: 1681740540304898909 (sec:1681740540.3049) XDP RX-time: 1681740577304958316 (sec:1681740577.3050) delta sec:37.0001 (37000059.407 usec) AF_XDP time: 1681740577305051315 (sec:1681740577.3051) delta sec:0.0001 (92.999 usec) 0x12557a8: complete idx=9 addr=9000 The first observation is that the 37 sec difference between RX HW vs XDP timestamps, which indicate hardware is likely clock source CLOCK_REALTIME, because (as of this writing) CLOCK_TAI is initialised with a 37 sec offset. The 93 usec (microsec) difference between XDP vs AF_XDP userspace is the userspace wakeup time. On this hardware it was caused by CPU idle sleep states, which can be reduced by tuning /dev/cpu_dma_latency. View current requested/allowed latency bound via: hexdump --format '"%d\n"' /dev/cpu_dma_latency More explanation of the output and how this can be used to identify clock drift for the HW clock can be seen here[1]: [1] https://github.com/xdp-project/xdp-project/blob/master/areas/hints/xdp_hints_kfuncs02_driver_igc.org Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Acked-by: Song Yoong Siang Link: https://lore.kernel.org/bpf/168182466298.616355.2544377890818617459.stgit@firesoul commit d677266755c6e55c43b6755673a1eeae3d452e87 Author: Jesper Dangaard Brouer Date: Tue Apr 18 15:30:57 2023 +0200 igc: Add XDP hints kfuncs for RX timestamp The NIC hardware RX timestamping mechanism adds an optional tailored header before the MAC header containing packet reception time. Optional depending on RX descriptor TSIP status bit (IGC_RXDADV_STAT_TSIP). In case this bit is set driver does offset adjustments to packet data start and extracts the timestamp. The timestamp need to be extracted before invoking the XDP bpf_prog, because this area just before the packet is also accessible by XDP via data_meta context pointer (and helper bpf_xdp_adjust_meta). Thus, an XDP bpf_prog can potentially overwrite this and corrupt data that we want to extract with the new kfunc for reading the timestamp. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann Acked-by: Song Yoong Siang Link: https://lore.kernel.org/bpf/168182465791.616355.2583922957423587914.stgit@firesoul commit 8416814fffa9cfa74c18da149f522dd9e1850987 Author: Jesper Dangaard Brouer Date: Tue Apr 18 15:30:52 2023 +0200 igc: Add XDP hints kfuncs for RX hash This implements XDP hints kfunc for RX-hash (xmo_rx_hash). The HW rss hash type is handled via mapping table. This igc driver (default config) does L3 hashing for UDP packets (excludes UDP src/dest ports in hash calc). Meaning RSS hash type is L3 based. Tested that the igc_rss_type_num for UDP is either IGC_RSS_TYPE_HASH_IPV4 or IGC_RSS_TYPE_HASH_IPV6. This patch also updates AF_XDP zero-copy function igc_clean_rx_irq_zc() to use the xdp_buff wrapper struct igc_xdp_buff. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann Acked-by: Song Yoong Siang Link: https://lore.kernel.org/bpf/168182465285.616355.2701740913376314790.stgit@firesoul commit 73b7123de0cfa4f6609677e927ab02cb05b593c2 Author: Jesper Dangaard Brouer Date: Tue Apr 18 15:30:47 2023 +0200 igc: Add igc_xdp_buff wrapper for xdp_buff in driver Driver specific metadata data for XDP-hints kfuncs are propagated via tail extending the struct xdp_buff with a locally scoped driver struct. Zero-Copy AF_XDP/XSK does similar tricks via struct xdp_buff_xsk. This xdp_buff_xsk struct contains a CB area (24 bytes) that can be used for extending the locally scoped driver into. The XSK_CHECK_PRIV_TYPE define catch size violations build time. The changes needed for AF_XDP zero-copy in igc_clean_rx_irq_zc() is done in next patch, because the member rx_desc isn't available at this point. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann Acked-by: Song Yoong Siang Link: https://lore.kernel.org/bpf/168182464779.616355.3761989884165609387.stgit@firesoul commit 84214ab4689f962b4bfc47fc9a5838d25ac4274d Author: Jesper Dangaard Brouer Date: Tue Apr 18 15:30:42 2023 +0200 igc: Enable and fix RX hash usage by netstack When function igc_rx_hash() was introduced in v4.20 via commit 0507ef8a0372 ("igc: Add transmit and receive fastpath and interrupt handlers"), the hardware wasn't configured to provide RSS hash, thus it made sense to not enable net_device NETIF_F_RXHASH feature bit. The NIC hardware was configured to enable RSS hash info in v5.2 via commit 2121c2712f82 ("igc: Add multiple receive queues control supporting"), but forgot to set the NETIF_F_RXHASH feature bit. The original implementation of igc_rx_hash() didn't extract the associated pkt_hash_type, but statically set PKT_HASH_TYPE_L3. The largest portions of this patch are about extracting the RSS Type from the hardware and mapping this to enum pkt_hash_types. This was based on Foxville i225 software user manual rev-1.3.1 and tested on Intel Ethernet Controller I225-LM (rev 03). For UDP it's worth noting that RSS (type) hashing have been disabled both for IPv4 and IPv6 (see IGC_MRQC_RSS_FIELD_IPV4_UDP + IGC_MRQC_RSS_FIELD_IPV6_UDP) because hardware RSS doesn't handle fragmented pkts well when enabled (can cause out-of-order). This results in PKT_HASH_TYPE_L3 for UDP packets, and hash value doesn't include UDP port numbers. Not being PKT_HASH_TYPE_L4, have the effect that netstack will do a software based hash calc calling into flow_dissect, but only when code calls skb_get_hash(), which doesn't necessary happen for local delivery. For QA verification testing I wrote a small bpftrace prog: [0] https://github.com/xdp-project/xdp-project/blob/master/areas/hints/monitor_skb_hash_on_dev.bt Fixes: 2121c2712f82 ("igc: Add multiple receive queues control supporting") Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann Acked-by: Song Yoong Siang Link: https://lore.kernel.org/bpf/168182464270.616355.11391652654430626584.stgit@firesoul commit 74fc8801edc279fb5f778eb91df48e4d3cd951a2 Author: Kui-Feng Lee Date: Fri Apr 21 14:41:31 2023 -0700 bpftool: Show map IDs along with struct_ops links. A new link type, BPF_LINK_TYPE_STRUCT_OPS, was added to attach struct_ops to links. (226bc6ae6405) It would be helpful for users to know which map is associated with the link. The assumption was that every link is associated with a BPF program, but this does not hold true for struct_ops. It would be better to display map_id instead of prog_id for struct_ops links. However, some tools may rely on the old assumption and need a prog_id. The discussion on the mailing list suggests that tools should parse JSON format. We will maintain the existing JSON format by adding a map_id without removing prog_id. As for plain text format, we will remove prog_id from the header line and add a map_id for struct_ops links. Signed-off-by: Kui-Feng Lee Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20230421214131.352662-1-kuifeng@meta.com commit 4b733b2c38b7c9304bbb92cf88f1b23f43ca575d Author: Tom Rix Date: Sun Apr 23 10:53:00 2023 -0400 drm/meson: set variables meson_hdmi_* storage-class-specifier to static smatch has several similar warnings to drivers/gpu/drm/meson/meson_venc.c:189:28: warning: symbol 'meson_hdmi_enci_mode_480i' was not declared. Should it be static? These variables are only used in their defining file so should be static Signed-off-by: Tom Rix Acked-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230423145300.3937831-1-trix@redhat.com commit 1a986518b8a517637f70cd6d7d494bd0cbbf6145 Author: Joe Stringer Date: Sat Apr 22 10:20:54 2023 -0700 docs/bpf: Add LRU internals description and graph Extend the bpf hashmap docs to include a brief description of the internals of the LRU map type (setting appropriate API expectations), including the original commit message from Martin and a variant on the graph that I had presented during my Linux Plumbers Conference 2022 talk on "Pressure feedback for LRU map types"[0]. The node names in the dot file correspond roughly to the functions where the logic for those decisions or steps is defined, to help curious developers to cross-reference and update this logic if the details of the LRU implementation ever differ from this description. [0] https://lpc.events/event/16/contributions/1368/ Signed-off-by: Joe Stringer Signed-off-by: Daniel Borkmann Reviewed-by: Bagas Sanjaya Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20230422172054.3355436-2-joe@isovalent.com commit af0335d2926e1c597c247956cd608b6e8c9d6463 Author: Joe Stringer Date: Sat Apr 22 10:20:53 2023 -0700 docs/bpf: Add table to describe LRU properties Depending on the map type and flags for LRU, different properties are global or percpu. Add a table to describe these. Signed-off-by: Joe Stringer Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20230422172054.3355436-1-joe@isovalent.com commit 0ed9208cb120086f1b600199c548f00544406fa5 Author: Chris Morgan Date: Wed Apr 26 09:32:13 2023 -0500 drm/panel: st7703: Add Anbernic RG353V-V2 Panel Support The Anbernic RG353V-V2 is a 5 inch panel used in a new revision of the Anbernic RG353V handheld gaming device. Add support for it. Unfortunately it appears this controller is not able to support 120hz or 100hz mode like the first revision panel. Signed-off-by: Chris Morgan Reviewed-by: Guido Günther Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230426143213.4178586-4-macroalpha82@gmail.com commit e0310564a7e31d7359a6831226aa9b559c6728a0 Author: Chris Morgan Date: Wed Apr 26 09:32:12 2023 -0500 drm/panel: st7703: Rename CMD_UNKNOWN_C6 to CMD_SETECO A later revision of the datasheet for the ST7703 refers to this command as "SETECO". Signed-off-by: Chris Morgan Reviewed-by: Guido Günther Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230426143213.4178586-3-macroalpha82@gmail.com commit e41fef1e43ae86aecc466e8c9e449d7bf71596a7 Author: Chris Morgan Date: Wed Apr 26 09:32:11 2023 -0500 dt-bindings: panel: Add Anbernic RG353V-V2 panel compatible The Anbernic RG353V-V2 panel is a 3.5 inch 640x480 MIPI-DSI LCD panel. It's based on the ST7703 LCD controller just like rocktech,jh057n00900. It's used in a 2nd revision of the Anbernic RG353V handheld gaming device. Like the first revision of the RG353V the control chip is known but the panel itself is unknown, so name it for the device. Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski Acked-by: Guido Günther Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230426143213.4178586-2-macroalpha82@gmail.com commit b3e8701dd1fa25fc59cffa68240326efccff0336 Author: Daniel Borkmann Date: Tue Apr 4 14:05:58 2023 +0000 selftests/bpf: Add test case to assert precise scalar path pruning Add a test case to check for precision marking of safe paths. Ensure that the verifier will not prematurely prune scalars contributing to registers needing precision. Signed-off-by: Daniel Borkmann commit d911ba7ceafd29606df4018bbd87a1642f9e6d88 Author: Joanne Koong Date: Thu Apr 20 00:14:14 2023 -0700 selftests/bpf: Add tests for dynptr convenience helpers Add various tests for the added dynptr convenience helpers. Signed-off-by: Joanne Koong Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230420071414.570108-6-joannelkoong@gmail.com commit 361f129f3cc185af6667aca0bec0be9a020a8abc Author: Joanne Koong Date: Thu Apr 20 00:14:13 2023 -0700 bpf: Add bpf_dynptr_clone The cloned dynptr will point to the same data as its parent dynptr, with the same type, offset, size and read-only properties. Any writes to a dynptr will be reflected across all instances (by 'instance', this means any dynptrs that point to the same underlying data). Please note that data slice and dynptr invalidations will affect all instances as well. For example, if bpf_dynptr_write() is called on an skb-type dynptr, all data slices of dynptr instances to that skb will be invalidated as well (eg data slices of any clones, parents, grandparents, ...). Another example is if a ringbuf dynptr is submitted, any instance of that dynptr will be invalidated. Changing the view of the dynptr (eg advancing the offset or trimming the size) will only affect that dynptr and not affect any other instances. One example use case where cloning may be helpful is for hashing or iterating through dynptr data. Cloning will allow the user to maintain the original view of the dynptr for future use, while also allowing views to smaller subsets of the data after the offset is advanced or the size is trimmed. Signed-off-by: Joanne Koong Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230420071414.570108-5-joannelkoong@gmail.com commit 26662d7347a058ca497792c4b22ac91cc415cbf6 Author: Joanne Koong Date: Thu Apr 20 00:14:12 2023 -0700 bpf: Add bpf_dynptr_size bpf_dynptr_size returns the number of usable bytes in a dynptr. Signed-off-by: Joanne Koong Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20230420071414.570108-4-joannelkoong@gmail.com commit 540ccf96ddbc173474c32e595787d5622253be3d Author: Joanne Koong Date: Thu Apr 20 00:14:11 2023 -0700 bpf: Add bpf_dynptr_is_null and bpf_dynptr_is_rdonly bpf_dynptr_is_null returns true if the dynptr is null / invalid (determined by whether ptr->data is NULL), else false if the dynptr is a valid dynptr. bpf_dynptr_is_rdonly returns true if the dynptr is read-only, else false if the dynptr is read-writable. If the dynptr is null / invalid, false is returned by default. Signed-off-by: Joanne Koong Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20230420071414.570108-3-joannelkoong@gmail.com commit 987d0242d189661f78b77cc4d77f843b15600fed Author: Joanne Koong Date: Thu Apr 20 00:14:10 2023 -0700 bpf: Add bpf_dynptr_adjust Add a new kfunc int bpf_dynptr_adjust(struct bpf_dynptr_kern *ptr, u32 start, u32 end); which adjusts the dynptr to reflect the new [start, end) interval. In particular, it advances the offset of the dynptr by "start" bytes, and if end is less than the size of the dynptr, then this will trim the dynptr accordingly. Adjusting the dynptr interval may be useful in certain situations. For example, when hashing which takes in generic dynptrs, if the dynptr points to a struct but only a certain memory region inside the struct should be hashed, adjust can be used to narrow in on the specific region to hash. Signed-off-by: Joanne Koong Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20230420071414.570108-2-joannelkoong@gmail.com commit 0602d59376d391c460925daa3f8ba2b286cdcb4b Author: Suraj Kandpal Date: Tue Apr 18 18:44:25 2023 +0530 drm/i915/display: Increase AUX timeout for Type-C Type-C PHYs are taking longer than expected for Aux IO Power Enabling. Workaround: Increase the timeout. ---v2 -change style on how we mention WA [Ankit] -fix bat error by creating new func that is only called for aux power well scenarios so we can avoid null pointer error as it is called everywhere. --v3 -Add non-default enable_timeout to power well descriptor which avoids adding more platform checks [Imre] --v4 -Remove Bspec link from top to bottom remove WA link from commit put it on comment [Jani] -enable_timeout in ms and add .fixed_enable_delay too [Imre] --v5 -move power_wells instead of duplicating them [Imre] Bspec: 55480 Cc: Jani Nikula Cc: Imre Deak Signed-off-by: Suraj Kandpal Reviewed-by: Imre Deak Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230418131425.1285088-1-suraj.kandpal@intel.com commit 40aeab044a352b9af106960542257c1b9b652e8a Author: Rodrigo Vivi Date: Wed Apr 19 15:19:13 2023 -0400 drm/doc/rfc: Introduce the merge plan for the Xe driver. Let’s establish a merge plan for Xe, by writing down clear pre-merge goals, in order to avoid unnecessary delays. This initial document starts with a TODO list containing items with clear and measurable key results. Xe’s initial pull request should only be sent to dri-devel after all the items are clearly resolved. Since many of them involve some level of a community consensus, in many cases, the consensus will be reached in follow-up patches to this document with more details of the API or helpers that will be developed or modified. Besides of the items that are highlighted in this document, it is important to highlight that Oded, has been volunteered to give the overall ack on Xe driver as the way to confirm that it looks good for upstream. v2: Incorporated Daniel's feedback: - Do not make long-running compute a blocker. - Add a mention to drm-exec that that ties to vm_bind and long-running compute jobs. Then I also added GPUVA since I recently noticed that this ties also to the work Matt is doing on that front. - Added the devcoredump section. - Add the mention to Oded being volunteered for the overall ack. v3: Reword a bit the Async VM_BIND to incorporate Daniel's feedback on ensuring the async vmbind consensus explicitly include Mesa, besides other kernel drivers. Cc: Dave Airlie Cc: Daniel Vetter Cc: Oded Gabbay Signed-off-by: Rodrigo Vivi Signed-off-by: Francois Dugast Signed-off-by: Luis Strano Signed-off-by: Matthew Brost Signed-off-by: Thomas Hellström Signed-off-by: Maarten Lankhorst Acked-by: Daniel Vetter Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230419191913.158807-1-rodrigo.vivi@intel.com commit a7fa1537b791cfb2ea3895ac448ab1455a4405f8 Author: Radhakrishna Sripada Date: Tue Apr 25 11:30:11 2023 -0700 drm/i915/mtl: Implement Wa_14019141245 Enable strict RAR to prevent spurious GPU hangs. v1.1: Rebase Bspec: 51762 Cc: Rodrigo Vivi Signed-off-by: Radhakrishna Sripada Reviewed-by:Haridhar Kalvala Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20230425183011.865085-1-radhakrishna.sripada@intel.com commit 655bd3b954cf18ae4e1ff69ebbf4a20b562f580b Author: Ashutosh Dixit Date: Thu Apr 20 09:40:41 2023 -0700 drm/i915/hwmon: Block waiting for GuC reset to complete Instead of erroring out when GuC reset is in progress, block waiting for GuC reset to complete which is a more reasonable uapi behavior. v2: Avoid race between wake_up_all and waiting for wakeup (Rodrigo) v3: Remove timeout when blocked (Tvrtko) Signed-off-by: Ashutosh Dixit Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230420164041.1428455-4-ashutosh.dixit@intel.com commit 1b44019a93e2bc6088d777b3d3072df5f40f9324 Author: Ashutosh Dixit Date: Thu Apr 20 09:40:40 2023 -0700 drm/i915/guc: Disable PL1 power limit when loading GuC firmware On dGfx, the PL1 power limit being enabled and set to a low value results in a low GPU operating freq. It also negates the freq raise operation which is done before GuC firmware load. As a result GuC firmware load can time out. Such timeouts were seen in the GL #8062 bug below (where the PL1 power limit was enabled and set to a low value). Therefore disable the PL1 power limit when allowed by HW when loading GuC firmware. v2: - Take mutex (to disallow writes to power1_max) across GuC reset/fw load - Add hwm_power_max_restore to error return code path v3 (Jani N): - Add/remove explanatory comments - Function renames - Type corrections - Locking annotation v4: - Don't hold the lock across GuC reset (Rodrigo) - New locking scheme (suggested by Rodrigo) - Eliminate rpm_get in power_max_disable/restore, not needed (Tvrtko) v5: - Fix uninitialized pl1en variable compile warning reported by kernel build robot by creating new err_rps label Link: https://gitlab.freedesktop.org/drm/intel/-/issues/8062 Signed-off-by: Ashutosh Dixit Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230420164041.1428455-3-ashutosh.dixit@intel.com commit d81268ee1c1073471cf0e8adb0fc9d026b602c3b Author: Ashutosh Dixit Date: Thu Apr 20 09:40:39 2023 -0700 drm/i915/hwmon: Get mutex and rpm ref just once in hwm_power_max_write In preparation for follow-on patches, refactor hwm_power_max_write to take hwmon_lock and runtime pm wakeref at start of the function and release them at the end, therefore acquiring these just once each. Signed-off-by: Ashutosh Dixit Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230420164041.1428455-2-ashutosh.dixit@intel.com commit bddc18913bd44adae5c828fd514d570f43ba1576 Author: Radhakrishna Sripada Date: Thu Apr 20 15:12:47 2023 -0700 drm/i915/mtl: Add the missing CPU transcoder mask in intel_device_info CPU transcoder mask is used to iterate over the available CPU transcoders in the macro for_each_cpu_transcoder(). The macro is broken on MTL and got highlighted when audio state was being tracked for each transcoder added in [1]. Add the missing CPU transcoder mask which is similar to ADL-P mask but without DSI transcoders. [1]: https://patchwork.freedesktop.org/patch/523723/ Fixes: 7835303982d1 ("drm/i915/mtl: Add MeteorLake PCI IDs") Cc: Ville Syrjälä Signed-off-by: Radhakrishna Sripada Acked-by: Haridhar Kalvala Reviewed-by: Gustavo Sousa Link: https://patchwork.freedesktop.org/patch/msgid/20230420221248.2511314-1-radhakrishna.sripada@intel.com commit 09c2c8c94b3d3b3c259b05bdd5f67f3a0a8e2063 Author: Maíra Canal Date: Thu Apr 20 20:22:28 2023 -0300 drm/vkms: drop full alpha blending TODO Now that VKMS supports full alpha blending on all planes, drop the "ARGB format on primary plane" and "Full alpha blending on all planes" tasks from the TODO list. Signed-off-by: Maíra Canal Reviewed-by: Melissa Wen Reviewed-by: Arthur Grillo Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230420232228.273340-2-mcanal@igalia.com commit a03f028542779fbdb0130b6a5e15445c94a859e8 Author: Maíra Canal Date: Thu Apr 20 20:22:27 2023 -0300 drm/vkms: allow full alpha blending on all planes Before commit bc0d7fdefec6 ("drm: vkms: Supports to the case where primary plane doesn't match the CRTC"), the composition was executed on top of the primary plane. Therefore, the primary plane was not able to support the alpha channel. After commit bc0d7fdefec6, this is possible, as the composition is now executed on top of the CRTC. So, allow all planes to support the alpha channel, making full alpha blending possible in vkms. Signed-off-by: Maíra Canal Reviewed-by: Melissa Wen Reviewed-by: Arthur Grillo Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230420232228.273340-1-mcanal@igalia.com commit 80ab31799002166ac7c660bacfbff4f85bc29107 Author: John Harrison Date: Fri Apr 21 15:47:42 2023 -0700 drm/i915/guc: Actually return an error if GuC version range check fails Dan Carpenter pointed out that 'err' was not being set in the case where the GuC firmware version range check fails. Fix that. Note that while this is a bug fix for a previous patch (see Fixes tag below). It is an exceedingly low risk bug. The range check is asserting that the GuC firmware version is within spec. So it should not be possible to ever have a firmware file that fails this check. If larger version numbers are required in the future, that would be a backwards breaking spec change and thus require a major version bump, in which case an old i915 driver would not load that new version anyway. Fixes: 9bbba0667f37 ("drm/i915/guc: Use GuC submission API version number") Reported-by: Dan Carpenter Signed-off-by: John Harrison Cc: John Harrison Cc: Daniele Ceraolo Spurio Cc: Alan Previn Cc: Umesh Nerlige Ramappa Cc: Rodrigo Vivi Cc: Matthew Brost Cc: Andi Shyti Cc: Matthew Auld Cc: Tvrtko Ursulin Cc: Lucas De Marchi Cc: Jani Nikula Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230421224742.2357198-1-John.C.Harrison@Intel.com commit e671fb86ecc03ce15a89cda8553621248ccf620c Author: Carl Huang Date: Fri Apr 21 12:44:57 2023 +0300 wifi: ath12k: send WMI_PEER_REORDER_QUEUE_SETUP_CMDID when ADDBA session starts Low receive throughput is seen on WCN7850 because ADDBA related parameters are not updated to firmware when receive ADDBA session starts. Fix it by sending WMI_PEER_REORDER_QUEUE_SETUP_CMDID again to firmware to update the ADDBA related parameters for chips which have false reoq_lut_support in hw_params. For chips which have true reoq_lut_support in hw_params don't need this command to send to firmware. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230404070158.3368530-1-quic_cjhuang@quicinc.com commit 34c5625a459a7dff745bcd862962688b5c795762 Author: Carl Huang Date: Fri Apr 21 12:44:57 2023 +0300 wifi: ath12k: set PERST pin no pull request for WCN7850 The PCIe PERST pin is currently pulled down on WCN7850 and it causes some power leakage. Fix it by notifying firmware not to pull down PCIe PERST pin in QMI message for WCN7850. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230404032057.3236122-3-quic_cjhuang@quicinc.com commit 9981a3ac5887efaff8d2a9e3fb0d48612d8cf733 Author: Carl Huang Date: Fri Apr 21 12:44:56 2023 +0300 wifi: ath12k: add qmi_cnss_feature_bitmap field to hardware parameters Currently the CNSS (Connectivity Subsystem) QMI feature is assigned to qmi_wlanfw_host_cap_req_msg_v01 request directly, this prevents chip-specific CNSS features from being added easily. Solve this by adding a new field qmi_cnss_feature_bitmap to hw_params so chip-specific CNSS features can be assigned to this field and later assigned to qmi_wlanfw_host_cap_req_msg_v01 request. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230404032057.3236122-2-quic_cjhuang@quicinc.com commit 94545f27155df50d2db7a1c896ca6b8e81fb62d1 Author: Thomas Zimmermann Date: Mon Apr 24 10:47:51 2023 +0200 arch/x86: Include in fbdev source file Move the implementation of fb_pgprotect() to fbdev.c and include . Fixes the following warning: ../arch/x86/video/fbdev.c:14:5: warning: no previous prototype for 'fb_is_primary_device' [-Wmissing-prototypes] 14 | int fb_is_primary_device(struct fb_info *info) | ^~~~~~~~~~~~~~~~~~~~ Just including results in a number of built-in errors about undefined function. Moving fb_pgprotect() to the source file avoids the required include statements in the header. The function is only called occasionally from fb_mmap(), [1] so having it as static inline had no benefit. While at it, fix the codying style in fbdev.c. Link: https://elixir.bootlin.com/linux/v6.3-rc7/source/drivers/video/fbdev/core/fbmem.c#L1404 # 1 Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230424084751.14641-1-tzimmermann@suse.de commit 47d8b3029684ce257e23022286b0861f72ac3f03 Author: Tejas Upadhyay Date: Mon Apr 24 15:47:49 2023 +0530 drm/i915/mtl: Add workaround 14018778641 WA 18018781329 is applicable now across all MTL steppings. V2: - Remove IS_MTL check, code already running for MTL - Matt Cc: Matt Roper Signed-off-by: Tejas Upadhyay Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230424101749.3719600-1-tejas.upadhyay@intel.com commit e991b5244d89096943af7dcd506faecb57b9377d Author: Tejas Upadhyay Date: Mon Apr 24 19:06:07 2023 +0530 drm/i915/selftest: Record GT error for gt failure igt_live_test has pr_err dumped in case of some GT failures. It will be more informative regarding GT if we use gt_err instead. Cc: Andi Shyti Signed-off-by: Tejas Upadhyay Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230424133607.3736825-1-tejas.upadhyay@intel.com commit bca774c387548421efb5b533434b8408be0517b3 Author: Imre Deak Date: Mon Apr 24 23:02:05 2023 +0300 drm/i915/adlp+: Disable DC5/6 states for TC port DDI/AUX and for combo port AUX On ADLP+ Bspec allows DC5/6 to be enabled while power well 2 is enabled. Since the AUX and DDI power wells (except for port A/B) are also backed by power well 2, this would suggest that DC5/6 can be enabled while any of these AUX or DDI port functionalities are used. As opposed to this AUX transfers will time out on ADLP TypeC ports while DC6 is enabled. Until the restriction for DC5/6 is clarified in Bspec let's assume that the intention is to allow for using these power states while pipe A/B is enabled, but only for combo ports which can be used with eDP outputs. Similarly assume that AUX transaction initiated by the driver on any port requires DC states to be disabled. Cc: Matt Roper Cc: Radhakrishna Sripada Fixes: 88c487938414 ("drm/i915: Use separate "DC off" power well for ADL-P and DG2") Signed-off-by: Imre Deak Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230424200205.1732941-1-imre.deak@intel.com commit cec5ccef85bd0128cf895612de54a9d21d2015d0 Author: Francesco Dolcini Date: Thu Mar 30 11:59:41 2023 +0200 drm/bridge: tc358768: Add atomic_get_input_bus_fmts() implementation Add atomic_get_input_bus_fmts() implementation, tc358768 has a parallel RGB input interface with the actual bus format depending on the amount of parallel input data lines. Without this change when the tc358768 is used with less than 24bit the color mapping is completely wrong. Signed-off-by: Francesco Dolcini Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230330095941.428122-7-francesco@dolcini.it commit b2751a4c5b5a7dcdfcea437f403c94a018cda5c9 Author: Dave Stevenson Date: Mon Mar 6 11:46:50 2023 +0100 drm/vc4: hdmi: Add BT.2020 Support Even though we report that we support the BT.2020 Colorspace, we were always using the BT.709 conversion matrices. Let's add the BT.2020 ones. Signed-off-by: Dave Stevenson Reviewed-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20221207-rpi-hdmi-improvements-v3-9-bdd54f66884e@cerno.tech Signed-off-by: Maxime Ripard commit 8297ee3f2d1277ddaa6de14c9520ddd9a1afa610 Author: Dave Stevenson Date: Mon Mar 6 11:46:49 2023 +0100 drm/vc4: hdmi: Add BT.601 Support Even though we report that we support the BT601 Colorspace, we were always using the BT.709 conversion matrices. Let's add the BT601 ones. Signed-off-by: Dave Stevenson Reviewed-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20221207-rpi-hdmi-improvements-v3-8-bdd54f66884e@cerno.tech Signed-off-by: Maxime Ripard commit 1eaa6eedb8cf602476d3bf602e090fb26cbfaf1e Author: Dave Stevenson Date: Mon Mar 6 11:46:48 2023 +0100 drm/vc4: hdmi: Add a function to retrieve the CSC matrix The CSC matrix to use depends on the output format, its range and the colorspace. Since we're going to add more colorspaces, let's move the CSC matrix retrieval to a function. Signed-off-by: Dave Stevenson Reviewed-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20221207-rpi-hdmi-improvements-v3-7-bdd54f66884e@cerno.tech Signed-off-by: Maxime Ripard commit 1d239901770ef8c31ed4ab7c45d6e8f5715783b6 Author: Dave Stevenson Date: Mon Mar 6 11:46:47 2023 +0100 drm/vc4: hdmi: Rework the CSC matrices organization The CSC matrices were stored as separate matrix for each colorspace, and if we wanted a limited or full RGB output. This created some gaps in our support and we would not always pick the relevant matrix. Let's rework our data structure to store one per colorspace, and then a matrix for limited range and one for full range. This makes us add a new matrix to support full range BT709 YUV output. Signed-off-by: Dave Stevenson Link: https://lore.kernel.org/r/20221207-rpi-hdmi-improvements-v3-6-bdd54f66884e@cerno.tech Signed-off-by: Maxime Ripard commit e3337aea097ffac21ccebd18114656eb88937517 Author: Dave Stevenson Date: Mon Mar 6 11:46:46 2023 +0100 drm/vc4: hdmi: Swap CSC matrix channels for YUV444 YUV444 and YUV422 actually require the same matrix, but programmed differently. We've dealt with it in the past by having two matrices, with the one for YUV444 reordered to accomodate the hardware. This gets in the way of subsequent reworks so let's define a function that will take the coefficients swap into account, and remove the now redundant YUV444 matrix. Signed-off-by: Dave Stevenson Reviewed-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20221207-rpi-hdmi-improvements-v3-5-bdd54f66884e@cerno.tech Signed-off-by: Maxime Ripard commit 7186004485c9b737faae5aad6b8118dd0bc0face Author: Dave Stevenson Date: Mon Mar 6 11:46:45 2023 +0100 drm/vc4: hdmi: Rename full range helper The VC4 HDMI driver has a helper function to figure out whether full range or limited range RGB is being used called vc4_hdmi_is_full_range_rgb(). We'll need it to support other colorspaces, so let's rename it to vc4_hdmi_is_full_range(). Signed-off-by: Dave Stevenson Reviewed-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20221207-rpi-hdmi-improvements-v3-4-bdd54f66884e@cerno.tech Signed-off-by: Maxime Ripard commit d6020f4b26179481c7cb13aa94d7abcdfd8a4326 Author: Dave Stevenson Date: Mon Mar 6 11:46:44 2023 +0100 drm/vc4: hdmi: Add Broadcast RGB property to allow override of RGB range Copy Intel's "Broadcast RGB" property semantics to add manual override of the HDMI pixel range for monitors that don't abide by the content of the AVI Infoframe. Signed-off-by: Dave Stevenson Reviewed-by: Hans Verkuil Link: https://lore.kernel.org/r/20221207-rpi-hdmi-improvements-v3-3-bdd54f66884e@cerno.tech Signed-off-by: Maxime Ripard commit bb1b6094c099668e21b1b47c9327c01f5c395997 Author: Maxime Ripard Date: Mon Mar 6 11:46:43 2023 +0100 drm/vc4: hdmi: Update all the planes if the TV margins are changed On VC4, the TV margins on the HDMI connector are implemented by scaling the planes. However, if only the TV margins or the connector are changed by a new state, the planes ending up on that connector won't be. Thus, they won't be updated properly and we'll effectively ignore that change until the next commit affecting these planes. Let's make sure to add all the planes attached to the connector so that we can update them properly. Reviewed-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20221207-rpi-hdmi-improvements-v3-2-bdd54f66884e@cerno.tech Signed-off-by: Maxime Ripard commit 5a46e490e47e4d821c382288108f193fc88a9282 Author: Maxime Ripard Date: Mon Mar 6 11:46:42 2023 +0100 drm/vc4: Switch to container_of_const container_of_const() allows to preserve the pointer constness and is thus more flexible than inline functions. Let's switch all our instances of container_of() to container_of_const(). Reviewed-by: Javier Martinez Canillas Link: https://lore.kernel.org/r/20221207-rpi-hdmi-improvements-v3-1-bdd54f66884e@cerno.tech Signed-off-by: Maxime Ripard commit a161b6dba6e0e8132921a6b948d311cdf67f3476 Author: Fei Yang Date: Mon Apr 24 11:29:02 2023 -0700 drm/i915/mtl: workaround coherency issue for Media This patch implements Wa_22016122933. In MTL, memory writes initiated by the Media tile update the whole cache line, even for partial writes. This creates a coherency problem for cacheable memory if both CPU and GPU are writing data to different locations within a single cache line. This patch circumvents the issue by making CPU/GPU shared memory uncacheable (WC on CPU side, and PAT index 2 for GPU). Additionally, it ensures that CPU writes are visible to the GPU with an intel_guc_write_barrier(). While fixing the CTB issue, we noticed some random GSC firmware loading failure because the share buffers are cacheable (WB) on CPU side but uncached on GPU side. To fix these issues we need to map such shared buffers as WC on CPU side. Since such allocations are not all done through GuC allocator, to avoid too many code changes, the i915_coherent_map_type() is now hard coded to return WC for MTL. v2: Simplify the commit message(Matt). BSpec: 45101 Signed-off-by: Fei Yang Reviewed-by: Andi Shyti Acked-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Matt Roper Signed-off-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230424182902.3663500-3-fei.yang@intel.com commit 341ad0e8e254267704e0b87e35ad23aba5c02359 Author: Fei Yang Date: Mon Apr 24 11:29:01 2023 -0700 drm/i915/mtl: Add PTE encode function PTE encode functions are platform dependent. This patch implements PTE functions for MTL, and ensures the correct PTE encode function is used by calling pte_encode function pointer instead of the hardcoded gen8 version of PTE encode. Fixes: b76c0deef627 ("drm/i915/mtl: Define MOCS and PAT tables for MTL") Signed-off-by: Fei Yang Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti Acked-by: Nirmoy Das Signed-off-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230424182902.3663500-2-fei.yang@intel.com commit b91075866e58e6b073689958f246834ad0b2c79c Author: Alex Deucher Date: Mon Apr 10 12:02:29 2023 -0400 drm/amdgpu/gfx11: update gpu_clock_counter logic This code was written prior to previous updates to this logic for other chips. The RSC registers are part of SMUIO which is an always on block so there is no need to disable gfxoff. Additionally add the carryover and preemption checks. v2: rebase Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 179661ad45cb18ba7702ebafde5f22aea47be5e0 Author: Likun Gao Date: Fri Apr 21 11:30:18 2023 +0800 drm/amdgpu: support psp vbflash sysfs for MP0 13_0_10 Add support for PSP vbflash sysfs interface with MP0 version v13.0.10. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f38129bb081758176dd78304faaee95007fb8838 Author: Aurabindo Pillai Date: Tue Mar 21 10:25:04 2023 -0400 Revert "drm/amd/display: disable SubVP + DRR to prevent underflow" This reverts commit 80c6d6804f31451848a3956a70c2bcb1f07cfcb0. The orignal commit was intended as a workaround to prevent underflow and flickering when using one normal monitor and the other high refresh rate monitor (> 120Hz). This patch is being reverted in favour of a software solution to enable SubVP+DRR Signed-off-by: Aurabindo Pillai Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 612c5ad50c3e5505e674b7cc50bf6527bc0adee6 Author: Aric Cyr Date: Sun Apr 16 20:35:01 2023 -0400 drm/amd/display: 3.2.233 This DC version brings along: - Improvements in the SubVP feature - Keep disable aux-i delay as 0 - Add p-state debugging and improvements - Fix in secure display context creation - add option to use custom backlight caps - Lowering min Z8 residency time - Restore rptr/wptr for DMCUB as workaround - Update FW feature caps struct Acked-by: Rodrigo Siqueira Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 5a096b73c8fed3a9987ba15378285df360e2284b Author: Michael Strauss Date: Tue Apr 11 12:44:54 2023 -0400 drm/amd/display: Keep disable aux-i delay as 0 [WHY] Current Aux-I sequence checks for local_sink which isn't populated on MST links [HOW] Leave disable aux-i delay as 0 for MST cases Cc: stable@vger.kernel.org Tested-by: Daniel Wheeler Reviewed-by: George Shen Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Michael Strauss Signed-off-by: Alex Deucher commit 1938bcdc4b530d6413e03f238c2df56f99f17220 Author: Alvin Lee Date: Wed Apr 12 17:06:46 2023 -0400 drm/amd/display: Query GECC enable for SubVP disable - We want to disable SubVP if Graphics Error Correction/Correcting Code (GECC) is enabled. - After reading feature caps from DMCUB during init, use the GECC enable/disable info to determine if SubVP can be enabled or not. Tested-by: Daniel Wheeler Reviewed-by: Nicholas Kazlauskas Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 87f0c16e0eeb672fb888b4e173edff0252e02757 Author: Alvin Lee Date: Mon Apr 17 10:23:05 2023 -0400 drm/amd/display: Enable SubVP for high refresh rate displays [Description] - Add debug option to enable SubVP for high refresh rate displays - For now limit the enabled modes based on a table in debug options - Currently disabled by default Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit c8cefb99fc811304fff9590677994531ff0ac992 Author: Alvin Lee Date: Wed Apr 12 15:42:41 2023 -0400 drm/amd/display: For no plane case set pstate support in validation - Previously update_clocks was overriding pstate support if it checked that there were no planes - However, P-State support should be determined in validation phase instead - This fixes an issue where a transition from FPO -> no planes expects UCLK MAX, but update_clocks was overriding to set UCLK to min Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 9c25ab167df412a5474dedfd0e7743e76bc89cbe Author: Sung Lee Date: Mon Apr 10 14:15:14 2023 -0400 drm/amd/display: Add p-state debugging [WHY] P-State related issues are fairly common but currently there is no way to debug these issues after the fact. [HOW] Add helpful registers to HW state queries Tested-by: Daniel Wheeler Reviewed-by: Aric Cyr Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Sung Lee Signed-off-by: Alex Deucher commit 469a62938a45ef382c9cb7b9fec6c6c1fcd781c0 Author: Gabe Teeger Date: Thu Apr 6 17:03:06 2023 -0400 drm/amd/display: update extended blank for dcn314 onwards [Why] Flickering and underflow was observed when testing extended blank on dcn314. [What] Vstartup is contrainted by vblank_nom, so adjusting it to include non-adjusted vtotal in its calculation during freesync video means that Vstartup is not changed when vtotal changes. This fixed the flickering + underflow. dc_extended_blank_supported function was removed because extended blank is only relevant to when zstate is supported. The increased vtotal during freesync can be passed to dml regardless of whether extended blank is supported or not, so this function is not needed. Updates were made recently in dml to the calculation of min_dst_y_next_start. Dml input for dcn314 will now always use the newer calculation for min_dst_y_next_start. Dml input for older dcn versions remains untouched. The variable optimized_min_dst_y_next_start is replaced everywhere with min_dst_y_next_start, and the updated dml allows min_dst_y_next_start to increase to an optimized value during freesync video, then return to default when freesync is disengaged. Also removed registry key for controlling extended blank feature. Tested-by: Daniel Wheeler Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Gabe Teeger Signed-off-by: Alex Deucher commit f477c7b5ec3e4ef87606671b340abf3bdb0cccff Author: Alan Liu Date: Mon Apr 10 11:35:44 2023 +0800 drm/amd/display: Fix in secure display context creation [Why & How] We need to store CRTC information in secure_display_ctx, so postpone the call to amdgpu_dm_crtc_secure_display_create_contexts() until we initialize all CRTCs. Cc: stable@vger.kernel.org Tested-by: Daniel Wheeler Reviewed-by: Wayne Lin Acked-by: Rodrigo Siqueira Signed-off-by: Alan Liu Signed-off-by: Alex Deucher commit 1068e987ad0be83a109147fe7fa0891700e8d80e Author: Leo (Hanghong) Ma Date: Tue Mar 28 16:26:29 2023 -0400 drm/amd/display: Update scaler recout data for visual confirm [Why] Our QA found visual confirm color is not as expected for Auto Color Management feature test after enable it. [How] Calculate scaler recout data when visual confirm enabled to update the visual confirm bar on the display. Tested-by: Daniel Wheeler Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Leo (Hanghong) Ma Signed-off-by: Alex Deucher commit 7a1187eab0111ac52ec216f2c18cb7822fec4a4c Author: Aurabindo Pillai Date: Tue Mar 21 11:31:22 2023 -0400 drm/amd/display: Program OTG vtotal min/max selectors unconditionally OTG_V_TOTAL_MIN/MAX_SEL bits are required to be programmed to 1 if writes to OTG timing registers need to be honoured. This is usually needed only when freesync is active. However, SubVP + DRR requires that we're able to change timing even without freesync being active (but supported). By unconditionally writing this bit to 1, we remove an unnecessary dependency so that DMCUB can change OTG timing whenever it wants. Signed-off-by: Aurabindo Pillai Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 5e9252d8415f50095c854c85cf9ebcc894e9ac0d Author: Josip Pavic Date: Mon Apr 3 10:42:06 2023 -0400 drm/amd/display: add option to use custom backlight caps [Why & How] Provide option for vendors to specify a custom brightness-to-backlight conversion profile. Tested-by: Daniel Wheeler Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Josip Pavic Signed-off-by: Alex Deucher commit b5389eca7b39026452dfc1d2cd5b05448c631298 Author: Leo Chen Date: Tue Apr 11 10:49:38 2023 -0400 drm/amd/display: Lowering min Z8 residency time [Why & How] Per HW team request, we're lowering the minimum Z8 residency time to 2000us. This enables Z8 support for additional modes we were previously blocking like 2k>60hz Cc: stable@vger.kernel.org Tested-by: Daniel Wheeler Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: Leo Chen Signed-off-by: Alex Deucher commit b058e3999021e04cd16d1e487732e20ad1f4b4f6 Author: Alvin Lee Date: Mon Apr 10 17:17:07 2023 -0400 drm/amd/display: Enable SubVP on PSR panels if single stream Enable SubVP on PSR panels now that we have FW support Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 9ba90d760e9354c124fa9bbea08017d96699a82c Author: Dmytro Laktyushkin Date: Fri Dec 9 15:13:18 2022 -0500 drm/amd/display: add pixel rate based CRB allocation support This feature is meant to unblock PSTATE for certain high end display configs on dcn315. This is achieved by allocating CRB to detile buffer based on display requirements to meet pstate latency hiding needs. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Rodrigo Siqueira Signed-off-by: Dmytro Laktyushkin Signed-off-by: Alex Deucher commit ee7be8f3de1ccc9665281fe996f9b6d45191ec1a Author: Alvin Lee Date: Mon Apr 10 14:37:27 2023 -0400 drm/amd/display: Limit DCN32 8 channel or less parts to DPM1 for FPO - Due to hardware related QoS issues, we need to limit certain SKUs with less memory channels to DPM1 and above. - At DPM0 + workload running, the urgent return latency can exceed 15us (the expected maximum is 4us) which results in underflow Cc: stable@vger.kernel.org Tested-by: Daniel Wheeler Reviewed-by: Saaem Rizvi Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 8f3589bb6fcea397775398cba4fbcc46829a60ed Author: JinZe.Xu Date: Mon Apr 10 23:23:37 2023 +0800 drm/amd/display: Restore rptr/wptr for DMCUB as workaround [Why] States may be desync after resume. [How] Sync sw state with hw state. Tested-by: Daniel Wheeler Reviewed-by: Nicholas Kazlauskas Acked-by: Rodrigo Siqueira Signed-off-by: JinZe.Xu Signed-off-by: Alex Deucher commit 278d3de6754e778cb676b7e1b10782eff1971010 Author: Alvin Lee Date: Mon Apr 10 13:52:21 2023 -0400 drm/amd/display: Update FW feature caps struct Reorder FW feature caps struct variable order to ensure backwards compatability is maintained for older FW Tested-by: Daniel Wheeler Reviewed-by: Sung Lee Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 0ba4a784a14592abed41873e339eab78ceb6e230 Author: Alex Hung Date: Wed Apr 5 13:47:41 2023 -0600 drm/amd/display: implement force function in amdgpu_dm_connector_funcs [Why] When userspace (IGT) inserts EDID with audio data (ELD), EDID is not updated. [How] Implements force function (amdgpu_dm_connector_funcs_force) in amdgpu_dm_connector_funcs to create emulated sink and to handle EDID. Tested-by: Daniel Wheeler Reviewed-by: Hersen Wu Acked-by: Rodrigo Siqueira Signed-off-by: Alex Hung Signed-off-by: Wenchieh Chien Signed-off-by: Alex Deucher commit 267e2d8e8e60ed59e74cf888f6b74bd5202e7384 Author: Aric Cyr Date: Sun Apr 9 23:08:25 2023 -0400 drm/amd/display: 3.2.232 Acked-by: Rodrigo Siqueira Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 93aac179a44be000aa8a025963011c752c23d92e Author: Anthony Koo Date: Sat Apr 8 02:51:46 2023 -0400 drm/amd/display: [FW Promotion] Release 0.0.163.0 Add feature caps for Subvp + PSR so driver is back compatible Tested-by: Daniel Wheeler Acked-by: Rodrigo Siqueira Signed-off-by: Anthony Koo Signed-off-by: Alex Deucher commit 445d85e3c1dfd8c45b24be6f1527f1e117256d0e Author: Alex Deucher Date: Tue Mar 21 13:59:13 2023 -0400 drm/amdgpu: add debugfs interface for reading MQDs Provide a debugfs interface to access the MQD. Useful for debugging issues with the CP and MES hardware scheduler. v2: fix missing unreserve/unmap when pos >= size (Alex) Reviewed-by: Christian König Signed-off-by: Alex Deucher commit b185c31847856d9fa3008f727a824db163df0801 Author: Alex Deucher Date: Tue Mar 21 13:28:33 2023 -0400 drm/amdgpu: track MQD size for gfx and compute It varies by generation and we need to know the size to expose this via debugfs. Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 8a93c691248e7ff2b3944107a1ead2671b6854f2 Author: Alex Deucher Date: Fri Mar 10 13:17:11 2023 -0500 drm/amdgpu: bump driver version number for CP GFX shadow So UMDs can determine whether the kernel supports this. Mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21986 Signed-off-by: Alex Deucher commit 3af470cbcc9f40e47fe9b16882f60cd20b438095 Author: Xiaogang Chen Date: Fri Apr 21 13:35:01 2023 -0500 drm/amdkfd: Fix an issue at userptr buffer validation process. amdgpu_ttm_tt_get_user_pages can fail(-EFAULT). If it failed mem has no associated hmm range or user_pages associated. Keep it at process_info->userptr_inval_list and mark mem->invalid until following scheduled attempts can valid it. Signed-off-by: Xiaogang Chen Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9fa8cc0c444562fa19e20ca20f1c70e15b9d8c13 Author: Michael Strauss Date: Mon Apr 3 11:43:50 2023 -0400 drm/amd/display: Convert Delaying Aux-I Disable To Monitor Patch [WHY] 32ms delay was added to resolve issue with a specific sink, however this same delay also introduces erroneous link training failures with certain sink devices. [HOW] Only apply the 32ms delay for offending devices instead of globally. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Michael Strauss Signed-off-by: Alex Deucher commit 550e5d23f14784e2a625c25fe0c9d498589c9256 Author: Hersen Wu Date: Tue Apr 4 13:44:18 2023 -0400 drm/amd/display: assign edid_blob_ptr with edid from debugfs [Why] implementation change of drm_edid_override_set since linux kernel 6.1, edid from debugfs is saved into connector->edid_override immediatey, not saved to connector->edid_blob_ptr at the same time. [How] call new drm_edid function drm_connector_update_edid_property to assign connector->edid_blob_ptr with override edid from debugfs. Tested-by: Daniel Wheeler Reviewed-by: Chao-kai Wang Acked-by: Rodrigo Siqueira Signed-off-by: Hersen Wu Signed-off-by: Alex Deucher commit 1ba91b54a9051205c2110ed43a7dc5650d49ca0e Author: Alex Deucher Date: Thu Mar 9 15:28:25 2023 -0500 drm/amdgpu: add support for new GFX shadow size query Use the new callback to fetch the data. Return an error if not supported. UMDs should use this query to check whether shadow buffers are supported and if so what size they should be. v2: return an error rather than a zerod structure. v3: drop GDS, move into dev_info structure. Data will be 0 if not supported. v4: drop local variable r Signed-off-by: Alex Deucher commit 02527099ddc74244b9d94c93ec54e123fcee5899 Author: Alex Deucher Date: Thu Mar 9 15:10:14 2023 -0500 drm/amdgpu: add get_gfx_shadow_info callback for gfx11 Used to get the size and alignment requirements for the gfx shadow buffer for preemption. v2: use FW version check to determine whether to return a valid size here return an error if not supported (Alex) v3: drop GDS (Alex) v4: make amdgpu_gfx_shadow_info mandatory (Alex) Signed-off-by: Alex Deucher commit 0db0c0379d15cd811214bdb631a0b6bdcdd22c84 Author: Alex Deucher Date: Thu Mar 9 14:56:07 2023 -0500 drm/amdgpu: add gfx shadow callback To provide IP specific shadow sizes. UMDs will use this to query the kernel driver for the size of the shadow buffers. v2: make callback return an int (Alex) v3: drop GDS (Alex) Reviewed-by: Christian König Signed-off-by: Alex Deucher commit edd9038000352ba846cba9dfb84d8c397c3b6499 Author: Alex Deucher Date: Thu Mar 9 13:43:13 2023 -0500 drm/amdgpu: add UAPI to query GFX shadow sizes Add UAPI to query the GFX shadow buffer requirements for preemption on GFX11. UMDs need to specify the shadow areas for preemption. v2: move into existing asic info query drop GDS as its use is determined by the UMD (Marek) v3: Update comments to note that alignment is base virtual alignment (Alex) Reviewed-by: Marek Olšák Signed-off-by: Alex Deucher commit 38be7796f310cd2bc84dcc40c4fd1964df39a5b0 Author: Alex Deucher Date: Thu Mar 16 11:33:43 2023 -0400 drm/amdgpu: don't require a job for cond_exec and shadow We need to reset the shadow state every time we submit an IB and there needs to be a COND_EXEC packet after the SET_Q_PREEMPTION_MODE packet for it to work properly, so we should emit both of these packets regardless of whether there is a job present or not. Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 46c1282e5a31c33a6973affbcc765eac1f3f5d1c Author: Christian König Date: Wed Mar 8 21:17:59 2023 +0100 drm/amdgpu: add gfx11 emit shadow callback Add ring callback for gfx to update the CP firmware with the new shadow information before we process the IB. v2: add implementation for new packet (Alex) v3: add current FW version checks (Alex) v4: only initialize shadow on first use Only set IB_VMID when a valid shadow buffer is present (Alex) v5: Pass parameters rather than job to new ring callback (Alex) Reviewed-by: Christian König Signed-off-by: Christian König Signed-off-by: Alex Deucher commit ac9287055ff16a092416c76a19006764e4c6a978 Author: Christian König Date: Thu Mar 9 15:40:48 2023 -0500 drm/amdgpu: add gfx shadow CS IOCTL support Add support for submitting the shadow update packet when submitting an IB. Needed for MCBP on GFX11. v2: update API for CSA (Alex) v3: fix ordering; SET_Q_PREEMPTION_MODE most come before COND_EXEC Add missing check for AMDGPU_CHUNK_ID_CP_GFX_SHADOW in amdgpu_cs_pass1() Only initialize shadow on first use (Alex) v4: Pass parameters rather than job to new ring callback (Alex) v5: squash in change to call SET_Q_PREEMPTION_MODE/COND_EXEC before RELEASE_MEM to complete the UMDs use of the shadow (Alex) Reviewed-by: Christian König Signed-off-by: Christian König Signed-off-by: Alex Deucher commit 043dc33f443fd7abaf3fe076897503ce3d5dbc26 Author: Alex Deucher Date: Thu Mar 9 13:48:11 2023 -0500 drm/amdgpu/UAPI: add new CS chunk for GFX shadow buffers For GFX11, the UMD needs to allocate some shadow buffers to be used for preemption. The UMD allocates the buffers and passes the GPU virtual address to the kernel since the kernel will program the packet that specified these addresses as part of its IB submission frame. v2: UMD passes shadow init to tell kernel when to initialize the shadow Reviewed-by: Christian König Signed-off-by: Alex Deucher commit b418e7193965a5f064a0e422ccf25e6203f265b5 Author: Alex Deucher Date: Mon Mar 20 13:22:44 2023 -0400 drm/amdgpu/gfx11: check the CP FW version CP GFX shadow support Only set the supported flag if we have new enough CP FW. v2: update to the final firmware versions Acked-by: Christian König Signed-off-by: Alex Deucher commit 31d7c3a4fc3d312a0646990767647925d5bde540 Author: Jack Xiao Date: Fri Apr 21 14:20:38 2023 +0800 drm/amdgpu: fix memory leak in mes self test The fences associated with mes queue have to be freed up during amdgpu_ring_fini. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 89d8445e4f5cfaf5c017c0bafb05f8bbaac59bf9 Author: Alex Deucher Date: Mon Mar 20 12:22:49 2023 -0400 drm/amdgpu/gfx11: add FW version check for new CP GFX shadow feature Use this to determine if we support the new SET_Q_PREEMPTION_MODE packet. Signed-off-by: Alex Deucher commit 322d716a3e8a74fb75cd0f657647be4df253fd2f Author: Maíra Canal Date: Tue Apr 18 10:05:21 2023 -0300 drm/vkms: isolate pixel conversion functionality Currently, the pixel conversion functions repeat the same loop to iterate the rows. Instead of repeating the same code for each pixel format, create a function to wrap the loop and isolate the pixel conversion functionality. Suggested-by: Arthur Grillo Signed-off-by: Maíra Canal Reviewed-by: Arthur Grillo Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230418130525.128733-2-mcanal@igalia.com commit 8356b97906503a02125c8d03c9b88a61ea46a05a Author: Arthur Grillo Date: Tue Apr 18 20:01:46 2023 -0300 drm/test: Add test cases for drm_rect_rotate_inv() Insert a parameterized test for the drm_rect_rotate_inv() to ensure its correctness and prevent future regressions. The test covers all rotation modes. It uses the same test cases from drm_test_rect_rotate(). Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230418230146.461129-6-arthurgrillo@riseup.net commit b5d88ec0ee3d0c75d2eb515efc335d031134bd75 Author: Arthur Grillo Date: Tue Apr 18 20:01:45 2023 -0300 drm/tests: Add test cases for drm_rect_rotate() Insert a parameterized test for the drm_rect_rotate() to ensure correctness and prevent future regressions. All possible rotation modes are covered by the test. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230418230146.461129-5-arthurgrillo@riseup.net commit 881e2a9cc11fb53b1de10d951a11a69d23035bbf Author: Arthur Grillo Date: Tue Apr 18 20:01:44 2023 -0300 drm/tests: Add test cases for drm_rect_calc_vscale() Insert parameterized test for the drm_rect_calc_vscale() to ensure correctness and prevent future regressions. Besides the test for the usual case, tests the exceptions. It uses the same struct from drm_rect_calc_hscale(). Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230418230146.461129-4-arthurgrillo@riseup.net commit 1f01f2247e3c4ed55c96afccd0072cd31793c604 Author: Arthur Grillo Date: Tue Apr 18 20:01:43 2023 -0300 drm/tests: Add test cases for drm_rect_calc_hscale() Insert parameterized test for the drm_rect_calc_hscale() to ensure correctness and prevent future regressions. Besides the test for the usual case, tests the exceptions. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230418230146.461129-3-arthurgrillo@riseup.net commit 96c3161926c6aa81365f074e9c408ca31b7ca756 Author: Arthur Grillo Date: Tue Apr 18 20:01:42 2023 -0300 drm/tests: Add test cases for drm_rect_intersect() Insert parameterized tests for the drm_rect_intersect() to ensure correctness and prevent future regressions. Also, create a helper for testing if two drm_rects are equal. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230418230146.461129-2-arthurgrillo@riseup.net commit f452cbd326dfa57c6f4ca8bc37879bf189f29cff Merge: 70102d77ff22d 289af45508ca8 Author: Thomas Zimmermann Date: Mon Apr 24 13:54:50 2023 +0200 Merge drm/drm-next into drm-misc-next Backmerging to get the exynos fbdev updates. Signed-off-by: Thomas Zimmermann commit 70102d77ff22dd88a0111b1c3bac5099ac5d0425 Author: Christian König Date: Mon Apr 17 17:32:11 2023 +0200 drm/scheduler: add drm_sched_entity_error and use rcu for last_scheduled Switch to using RCU handling for the last scheduled job and add a function to return the error code of it. Signed-off-by: Christian König Reviewed-by: Luben Tuikov Link: https://patchwork.freedesktop.org/patch/msgid/20230420115752.31470-2-christian.koenig@amd.com commit 539f9ee4b52a8bec95ff064e22dd2fb1e258e818 Author: Christian König Date: Mon Apr 17 13:36:02 2023 +0200 drm/scheduler: properly forward fence errors When a hw fence is signaled with an error properly forward that to the finished fence. Signed-off-by: Christian König Reviewed-by: Luben Tuikov Link: https://patchwork.freedesktop.org/patch/msgid/20230420115752.31470-1-christian.koenig@amd.com commit 15f5ee6b77c0953b3d668eb3f3bb3c0be0a280f6 Author: Yang Li Date: Fri Apr 21 17:13:19 2023 +0800 drm/tve200: Use devm_platform_ioremap_resource() Convert platform_get_resource(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20230421091319.79744-1-yang.lee@linux.alibaba.com commit 66ca1d8f222bdb1c9470e44131e12d753622ab08 Author: Andi Shyti Date: Fri Apr 21 21:00:26 2023 +0200 drm/i915/i915_drv: Use i915 instead of dev_priv insied the file_priv structure In the process of renaming all instances of 'dev_priv' to 'i915', start using 'i915' within the i915_drv.h file. Signed-off-by: Andi Shyti Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230421190026.294208-3-andi.shyti@linux.intel.com commit 64e22551b64c694de428a9d3e210587df2831ef3 Author: Andi Shyti Date: Fri Apr 21 21:00:25 2023 +0200 drm/i915/i915_drv: Use proper parameter naming in for_each_engine() for_each_engine() loops through engines in the GT, not in dev_priv. Because it's misleading, call it "gt__" instead of "dev_priv__". Signed-off-by: Andi Shyti Reviewed-by: Rodrigo Vivi Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230421190026.294208-2-andi.shyti@linux.intel.com commit faca6aaa4838c3c234caa619d3c7d1f09da0d303 Author: Fei Yang Date: Fri Apr 21 20:25:35 2023 +0200 drm/i915/mtl: fix mocs selftest Media GT has a different base for MOCS register, need to apply gsi_offset to the mmio address if not using the intel_uncore_r/w functions for register access. Cc: Matt Roper Signed-off-by: Fei Yang Reviewed-by: Matt Roper Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230421182535.292670-3-andi.shyti@linux.intel.com commit b76c0deef6273609c02ed5053209f6397cd1b0fb Author: Madhumitha Tolakanahalli Pradeep Date: Fri Apr 21 20:25:34 2023 +0200 drm/i915/mtl: Define MOCS and PAT tables for MTL On MTL, GT can no longer allocate on LLC - only the CPU can. This, along with programming new register bits that MTL requires calls for a MOCS/PAT table update. Also the PAT index registers are multicasted for primary GT, and there is an address jump from index 7 to 8. This patch makes sure that these registers are programmed in the proper way. BSpec: 44509, 45101, 44235 Cc: Matt Roper Cc: Lucas De Marchi Signed-off-by: Madhumitha Tolakanahalli Pradeep Signed-off-by: Aravind Iddamsetty Signed-off-by: Nirmoy Das Signed-off-by: Fei Yang Reviewed-by: Andrzej Hajda Reviewed-by: Nirmoy Das Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230421182535.292670-2-andi.shyti@linux.intel.com commit e1964d892fe5710c16e55d2eb153954f8407fb9a Author: Maíra Canal Date: Fri Aug 12 17:57:45 2022 -0300 drm/sti: Drop of_gpio header This driver includes the deprecated OF GPIO header yet fail to use symbols from it, so drop this include. Cc: Alain Volmat Signed-off-by: Maíra Canal Acked-by: Alain Volmat Link: https://patchwork.freedesktop.org/patch/msgid/20220812205746.609107-5-mairacanal@riseup.net commit 6b99658c93ce0ab84c4682a22df245ddefb0ebc5 Author: Maíra Canal Date: Fri Aug 12 17:57:42 2022 -0300 drm/bridge: anx7625: Drop of_gpio header This driver includes the deprecated OF GPIO header yet fail to use symbols from it, so drop the include. Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Signed-off-by: Maíra Canal Reviewed-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220812205746.609107-2-mairacanal@riseup.net commit 55b24786b74863b8f10e4d262e642749911cb3bb Author: Rodrigo Siqueira Date: Tue Apr 11 18:09:43 2023 -0600 drm/display: Add missing OLED Vesa brightnesses definitions This commit adds missing luminance control registers to enable a more standard way (VESA) to deal with eDP luminance control. Cc: Anthony Koo Cc: Iswara Negulendran Cc: Felipe Clark Cc: Harry Wentland Signed-off-by: Rodrigo Siqueira Reviewed-by: Harry Wentland Link: https://patchwork.freedesktop.org/patch/msgid/20230412000943.429031-1-Rodrigo.Siqueira@amd.com commit 1993f598998d7419f5c9fa8459f4919cf5f3643e Author: Richard Leitner Date: Mon Mar 13 08:50:17 2023 +0100 drm/panel: simple: Add InnoLux G070ACE-L01 Add InnoLux G070ACE-L01 7" 800x480 TFT LCD with WLED backlight panel support. Timing data was extracted from datasheet and vendor provided EDID file. Signed-off-by: Richard Leitner Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230201-innolux-g070ace-v2-2-2371e251dd40@skidata.com commit 4b4b96826ba980fef5bbb9caabcff005c6a60294 Author: Richard Leitner Date: Mon Mar 13 08:50:16 2023 +0100 dt-bindings: display: simple: add support for InnoLux G070ACE-L01 Add Innolux G070ACE-L01 7" WVGA (800x480) TFT LCD panel compatible string. Signed-off-by: Richard Leitner Acked-by: Krzysztof Kozlowski Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230201-innolux-g070ace-v2-1-2371e251dd40@skidata.com commit 7787af256504b13f0ab6c311ed7870a895b762b8 Author: Fei Yang Date: Thu Apr 20 12:23:49 2023 +0200 drm/i915/mtl: Set has_llc=0 On MTL, LLC is not shared between GT and CPU, set has_llc=0. Signed-off-by: Fei Yang Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Reviewed-by: Nirmoy Das Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230420102349.15302-1-nirmoy.das@intel.com commit 8f7f1b020ea641f21e7c88db55170a4d15834668 Author: Hamza Mahfooz Date: Fri Apr 14 14:26:27 2023 -0400 drm/amd/display: fix flickering caused by S/G mode Currently, on a handful of ASICs. We allow the framebuffer for a given plane to exist in either VRAM or GTT. However, if the plane's new framebuffer is in a different memory domain than it's previous framebuffer, flipping between them can cause the screen to flicker. So, to fix this, don't perform an immediate flip in the aforementioned case. Cc: stable@vger.kernel.org Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2354 Reviewed-by: Roman Li Fixes: 81d0bcf99009 ("drm/amdgpu: make display pinning more flexible (v2)") Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 0026c273e68ee82a7843f5de26147357bc7e6551 Author: Arnd Bergmann Date: Thu Apr 20 10:47:01 2023 +0200 drm/amd/display: dumb_abm_lcd: avoid missing-prototype warnings The dmub_abm_set_ambient_level() function has no caller and can just be removed, the other ones have a declaration in the header file and just need to see the prototype: drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:122:14: error: no previous prototype for function 'dmub_abm_get_current_backlight' [-Werror,-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:133:14: error: no previous prototype for function 'dmub_abm_get_target_backlight' [-Werror,-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:144:6: error: no previous prototype for function 'dmub_abm_set_level' [-Werror,-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:163:6: error: no previous prototype for function 'dmub_abm_set_ambient_level' [-Werror,-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:183:6: error: no previous prototype for function 'dmub_abm_init_config' [-Werror,-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:213:6: error: no previous prototype for function 'dmub_abm_set_pause' [-Werror,-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:231:6: error: no previous prototype for function 'dmub_abm_set_pipe' [-Werror,-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:251:6: error: no previous prototype for function 'dmub_abm_set_backlight_level' [-Werror,-Wmissing-prototypes] Fixes: b8fe56375f78 ("drm/amd/display: Refactor ABM feature") Signed-off-by: Arnd Bergmann Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 4371fa7795dabb422171de5e8d9fe7aa3e2edb86 Author: Aric Cyr Date: Sun Apr 2 22:20:20 2023 -0400 drm/amd/display: 3.2.231 This DC version brings along: - FW Release 0.0.162.0 - Enable FPO+Vactivate - Support for VESA SCR - Refactor DMUB commands - Fixes in secure display, modeset, memleak and more - Picked up missed patches in history Acked-by: Qingqing Zhuo Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 053065a43ca6466575d9d3c9110e305fdcf303d3 Author: Aurabindo Pillai Date: Thu Apr 6 15:01:32 2023 -0400 drm/amd/display: Add FAMS related definitions and documenation for enum fields [Why&How] Add Enum and documenation related to FAMS (Firmware Assisted Memclk Switching) and CAB (Cache As Buffer) Reviewed-by: Qingqing Zhuo Reviewed-by: Leo Li Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 87c2213e85bd81e4a9a4d0880c256568794ae388 Author: hackyzh002 Date: Wed Apr 19 20:22:33 2023 +0800 drm/amdgpu: Fix integer overflow in amdgpu_cs_pass1 The type of size is unsigned int, if size is 0x40000000, there will be an integer overflow, size will be zero after size *= sizeof(uint32_t), will cause uninitialized memory to be referenced later. Reviewed-by: Christian König Signed-off-by: hackyzh002 Signed-off-by: Alex Deucher commit f828b681d0cd566f86351c0b913e6cb6ed8c7b9c Author: hackyzh002 Date: Wed Apr 19 20:20:58 2023 +0800 drm/radeon: Fix integer overflow in radeon_cs_parser_init The type of size is unsigned, if size is 0x40000000, there will be an integer overflow, size will be zero after size *= sizeof(uint32_t), will cause uninitialized memory to be referenced later Reviewed-by: Christian König Signed-off-by: hackyzh002 Signed-off-by: Alex Deucher commit 4f63b7a59926eb7fb50091e796170a10a8ef4091 Author: Aurabindo Pillai Date: Thu Apr 6 17:08:53 2023 -0400 drm/amd/display: Add FAMS capability to DCN31 DCN31 supports FAMS, but this was not correctly set to the hardware setup sequence. This commit fixes this issue by setting the MCLK switch capability based on the feature capability retrieved from the DMUB. Reviewed-by: Rodrigo Siqueira Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 710cc1e7cd461446a9325c9bd1e9a54daa462952 Author: Nicholas Kazlauskas Date: Thu May 2 13:21:48 2019 -0400 drm/amd/display: Explicitly specify update type per plane info change [Why] The bit for flip addr is being set causing the determination for FAST vs MEDIUM to always return MEDIUM when plane info is provided as a surface update. This causes extreme stuttering for the typical atomic update path on Linux. [How] Don't use update_flags->raw for determining FAST vs MEDIUM. It's too fragile to changes like this. Explicitly specify the update type per update flag instead. It's not as clever as checking the bits itself but at least it's correct. Fixes: aa5fdb1ab5b6 ("drm/amd/display: Explicitly specify update type per plane info change") Reviewed-by: Rodrigo Siqueira Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 58e67bb3c131da5ee14e4842b08e53f4888dce0a Author: Zhongwei Date: Fri Oct 28 13:40:31 2022 +0800 drm/amd/display: fix dpms_off issue when disabling bios mode [Why] disable_vbios_mode_if_required() will set dpms_off to false during boot when pixel clk dismatches with driver requires. This will cause extra backlight on and off if OS call 2 times setmode. [How] Set dpms_off to true to keep power_off and let OS control backlight by display's powerState. Reviewed-by: Rodrigo Siqueira Signed-off-by: Zhongwei Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 255ce8f7c169fa385ad04f01c7babab5f636a3ce Author: Po-Ting Chen Date: Fri Feb 26 15:48:02 2021 +0800 drm/amd/display: update GSP1 generic info packet for PSRSU Base on PSRSU specification, every seletive update frame need to use two SDP to indicate the frame active range. So we occupy another GSP1 for PSRSU execution. Reviewed-by: Rodrigo Siqueira Signed-off-by: Po-Ting Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3ac73f1ef2b403048c98fdf0f29ba32571efb849 Author: Igor Kravchenko Date: Fri Jul 10 16:24:30 2020 -0400 drm/amd/display: Set min_width and min_height capability for DCN30 Add min_width, min_height fields to dc_plane_cap structure. Set values to 16x16 for discrete ASICs, and 64x64 for others. Reviewed-by: Rodrigo Siqueira Signed-off-by: Igor Kravchenko Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4335077a76095ff75dc0ffb031aeae93f9f5e80f Author: Meenakshikumar Somasundaram Date: Wed Jan 12 19:58:04 2022 -0500 drm/amd/display: Adjust dmub outbox notification enable [Why] Currently driver enables dmub outbox notification before oubox ISR is registered. During boot scenario, sometimes dmub issues hpd outbox message before driver registers ISR and those messages are missed. [How] Enable dmub outbox notification after outbox ISR is registered. Also, restructured outbox enable code to call from dm layer and renamed APIs. Reviewed-by: Rodrigo Siqueira Signed-off-by: Meenakshikumar Somasundaram Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 72a9be2f444a9fd4ab34e6329fa1889dbd3a7ef3 Author: Krunoslav Kovac Date: Fri Mar 11 16:12:58 2022 -0500 drm/amd/display: 3-plane MPO enablement for DCN321 Enable 3-planes MPO for DCN321 by reporting max_slave_planes in DC caps for each ASIC. Reviewed-by: Rodrigo Siqueira Signed-off-by: Krunoslav Kovac Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0244b0f7d5ac2b6a8d5716f6dd2fb2631f13a3b5 Author: Aurabindo Pillai Date: Thu Apr 6 16:46:30 2023 -0400 drm/amd/display: Add extra check for 444 16 format DCN30 is missing a check for the pixel format 444 when using 16bits before setting the flag that Viewport exceeds the surface. Reviewed-by: Rodrigo Siqueira Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 05ffbdf4dbd55b9526535bddddf40dafdc2b27d4 Author: Sherry Wang Date: Sun Oct 9 17:05:51 2022 +0800 drm/amd/display: correct DML calc error [Why] DML calculation is different from HW formula. [How] Correct the bug to keep it same as HW formula. Reviewed-by: Rodrigo Siqueira Signed-off-by: Sherry Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 44243719117171e947317a1aca4625c317f7dcb0 Author: Dmytro Laktyushkin Date: Thu Apr 30 15:38:04 2020 -0400 drm/amd/display: Limit nv21 dst_y Dst_y can become negative in extreme odm 4to1 cases. While not strictly invalid, this should be limited to 0 for rq/dlg/ttu calculation. Reviewed-by: Rodrigo Siqueira Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2c30f85551211a48f7be57499a6fcb4ad00875da Author: Jasdeep Dhillon Date: Tue Feb 28 11:46:31 2023 -0500 drm/amd/display: Isolate remaining FPU code in DCN32 [Why] DCN32 resource contains code that uses FPU. [How] Moved code into DCN32 FPU Reviewed-by: Rodrigo Siqueira Signed-off-by: Jasdeep Dhillon Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 974ce18160bb16c8addf6889fff977564404b87b Author: Aurabindo Pillai Date: Thu Apr 6 16:19:16 2023 -0400 drm/amd/display: Add check for PState change in DCN32 For pstate change, allow DML to loop through all possible prefetch combinations so as to support more display configurations. Set the max and min prefetch modes to enable the sequence. Reviewed-by: Rodrigo Siqueira Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a1f1fecd04f0b9ef600898c7f9b2094504127fd7 Author: Aurabindo Pillai Date: Thu Apr 6 16:16:33 2023 -0400 drm/amd/display: Set DRAM clock if retraining is required Set DRAM clock change state if retraining is required. Reviewed-by: Rodrigo Siqueira Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 92d1fe5954dc28c4e0260b730dd79d2acfdfa29f Author: Dillon Varone Date: Thu Apr 6 16:10:04 2023 -0400 drm/amd/display: add support for low bpc [WHY&HOW] Low bpc timings are failing validation, port a patch to allow them to pass. Signed-off-by: Dillon Varone Acked-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7abac457ba75e3c6f6468036ad6f424bc56b2750 Author: Srinivasan Shanmugam Date: Wed Apr 19 18:40:00 2023 +0530 drm/amd/amdgpu: Fix style issues in amdgpu_discovery.c Fix following checkpatch errors in amdgpu_discovery.c ERROR: space required after that ',' (ctx:VxV) ERROR: space required before the open parenthesis '(' ERROR: code indent should use tabs where possible Cc: Christian König Cc: Alex Deucher Cc: Mario Limonciello Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 8b6a6aa5d6d2be6a0669a29deb89184aaa0bad65 Author: Aurabindo Pillai Date: Thu Apr 6 15:59:45 2023 -0400 drm/amd/display: Update bounding box values for DCN321 [Why&how] Update bounding box values as per hardware spec Fixes: 197485c69543 ("drm/amd/display: Create dcn321_fpu file") Acked-by: Leo Li Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8fa33bd8d327ae2f9b602cd883f32efc4662bea0 Author: Aurabindo Pillai Date: Thu Apr 6 15:48:48 2023 -0400 drm/amd/display: Do not clear GPINT register when releasing DMUB from reset [Why & How] There's no need to clear GPINT register for DMUB when releasing it from reset. Fix that. Fixes: ac2e555e0a7f ("drm/amd/display: Add DMCUB source files and changes for DCN32/321") Reviewed-by: Leo Li Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 948ca54c424be395402624ca0e21ad5ddf77cb6a Author: Srinivasan Shanmugam Date: Wed Apr 19 17:35:15 2023 +0530 drm/amd/display: Remove unused variables in dcn21_hwseq.c Fix the below compiler error: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c:229:11: error: unused variable 'otg_inst' [-Werror,-Wunused-variable]         uint32_t otg_inst = pipe_ctx->stream_res.tg->inst;                  ^ drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c:226:20: error: unused variable 'cmd' [-Werror,-Wunused-variable]         union dmub_rb_cmd cmd; Cc: Aurabindo Pillai Cc: Jerry Zuo Cc: Yongqiang Sun Signed-off-by: Srinivasan Shanmugam Reviewed-by: Yongqiang Sun Signed-off-by: Alex Deucher commit 47659738fbd2f06730635a487605002ea9b11f3d Author: Le Ma Date: Fri Nov 19 15:35:30 2021 +0800 drm/amdgpu: allocate doorbell index for multi-die case Allocate different doorbell index for kiq/kcq rings on each die Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 47fc644f801e4414753a9b7e87ed41f991cd68c3 Author: Srinivasan Shanmugam Date: Wed Apr 19 16:12:45 2023 +0530 drm/amd/amdgpu: Fix style errors in amdgpu_drv.c & amdgpu_device.c Fix following checkpatch style errors in amdgpu_drv.c & amdgpu_device.c ERROR: exactly one space required after that #ifdef ERROR: spaces required around that '+=' (ctx:WxV) ERROR: space required before the open brace '{' ERROR: spaces required around that '||' (ctx:VxE) ERROR: space prohibited before that close parenthesis ')' ERROR: space required before the open parenthesis '(' ERROR: space required before the open brace '{' ERROR: code indent should use tabs where possible Cc: Christian König Cc: Alex Deucher Cc: Mario Limonciello Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 5c65a4b8e65e3247f86ec5152da138500edcf50c Author: Srinivasan Shanmugam Date: Wed Apr 19 14:55:03 2023 +0530 drm/amd/amdgpu: Fix spaces in array indexing and indentations in amdgpu_kms.c Fix the following errors reported by checkpatch: ERROR: space prohibited before open square bracket '[' +#define TA_FW_NAME(type) [TA_FW_TYPE_PSP_##type] = #type ERROR: code indent should use tabs where possible + query_fw.fw_type = AMDGPU_INFO_FW_GFX_RLCV;$ Cc: Christian König Cc: Alex Deucher Cc: Mario Limonciello Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 8eba72053c682d8ae652bed4a62546239e58390b Author: Candice Li Date: Wed Apr 19 17:28:19 2023 +0800 drm/amdgpu: Drop pcie_bif ras check from fatal error handler Some ASICs support fatal error event but do not support pcie_bif ras. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 01382501509871d0799bab6bd412c228486af5bf Author: Longlong Yao Date: Thu Apr 13 13:21:45 2023 +0800 drm/amdgpu: fix calltrace warning in amddrm_buddy_fini The following call trace is observed when removing the amdgpu driver, which is caused by that BOs allocated for psp are not freed until removing. [61811.450562] RIP: 0010:amddrm_buddy_fini.cold+0x29/0x47 [amddrm_buddy] [61811.450577] Call Trace: [61811.450577] [61811.450579] amdgpu_vram_mgr_fini+0x135/0x1c0 [amdgpu] [61811.450728] amdgpu_ttm_fini+0x207/0x290 [amdgpu] [61811.450870] amdgpu_bo_fini+0x27/0xa0 [amdgpu] [61811.451012] gmc_v9_0_sw_fini+0x4a/0x60 [amdgpu] [61811.451166] amdgpu_device_fini_sw+0x117/0x520 [amdgpu] [61811.451306] amdgpu_driver_release_kms+0x16/0x30 [amdgpu] [61811.451447] devm_drm_dev_init_release+0x4d/0x80 [drm] [61811.451466] devm_action_release+0x15/0x20 [61811.451469] release_nodes+0x40/0xb0 [61811.451471] devres_release_all+0x9b/0xd0 [61811.451473] __device_release_driver+0x1bb/0x2a0 [61811.451476] driver_detach+0xf3/0x140 [61811.451479] bus_remove_driver+0x6c/0xf0 [61811.451481] driver_unregister+0x31/0x60 [61811.451483] pci_unregister_driver+0x40/0x90 [61811.451486] amdgpu_exit+0x15/0x447 [amdgpu] For smu v13_0_2, if the GPU supports xgmi, refer to commit f5c7e7797060 ("drm/amdgpu: Adjust removal control flow for smu v13_0_2"), it will run gpu recover in AMDGPU_RESET_FOR_DEVICE_REMOVE mode when removing, which makes all devices in hive list have hw reset but no resume except the basic ip blocks, then other ip blocks will not call .hw_fini according to ip_block.status.hw. Since psp_free_shared_bufs just includes some software operations, so move it to psp_sw_fini. Reviewed-by: Guchun Chen Reviewed-by: Feifei Xu Signed-off-by: Longlong Yao Signed-off-by: Alex Deucher commit b0dc10428460ac2408cf5f82fc3562e9e57324e1 Author: Cruise Hung Date: Fri May 13 09:16:42 2022 +0800 drm/amd/display: Reset OUTBOX0 r/w pointer on DMUB reset [Why & How] We missed resetting OUTBOX0 mailbox r/w pointer on DMUB reset. Fix it. Fixes: 6ecf9773a503 ("drm/amd/display: Fix DMUB outbox trace in S4 (#4465)") Signed-off-by: Cruise Hung Acked-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6152aec1ddb40620cd8d2b36b45171c2d1bd82d1 Author: Radhakrishna Sripada Date: Fri Mar 17 17:58:52 2023 -0700 drm/i915/mtl: Skip pcode qgv restrictions for MTL Communicating QGV points restriction to PUnit happens via PM Demand instead of the Pcode mailbox in the previous platforms. GV point restriction is handled by the PM demand code. Signed-off-by: Radhakrishna Sripada Reviewed-by: Vinod Govindapillai Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230318005852.2303937-5-radhakrishna.sripada@intel.com commit 63c381552f69d188fe1e705515251c52bb07449c Author: Thomas Zimmermann Date: Thu Mar 30 09:30:46 2023 +0200 drm/armada: Implement fbdev emulation as in-kernel client Move code from ad-hoc fbdev callbacks into DRM client functions and remove the old callbacks. The functions instruct the client to poll for changed output or restore the display. The DRM core calls both, the old callbacks and the new client helpers, from the same places. The new functions perform the same operation as before, so there's no change in functionality. Replace all code that initializes or releases fbdev emulation throughout the driver. Instead initialize the fbdev client by a single call to armada_fbdev_setup() after armada has registered its DRM device. As in most drivers, aramda's fbdev emulation now acts like a regular DRM client. The fbdev client setup consists of the initial preparation and the hot-plugging of the display. The latter creates the fbdev device and sets up the fbdev framebuffer. The setup performs display hot-plugging once. If no display can be detected, DRM probe helpers re-run the detection on each hotplug event. A call to drm_dev_unregister() releases the client automatically. No further action is required within armada. If the fbdev framebuffer has been fully set up, struct fb_ops.fb_destroy implements the release. For partially initialized emulation, the fbdev client reverts the initial setup. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230330073046.7150-5-tzimmermann@suse.de commit 174c3c38e3a2a37bccf56e537e3703ce020a50ff Author: Thomas Zimmermann Date: Thu Mar 30 09:30:45 2023 +0200 drm/armada: Initialize fbdev DRM client Initialize the fbdev client in the fbdev code with empty helper functions. Also clean up the client. The helpers will later implement various functionality of the DRM client. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230330073046.7150-4-tzimmermann@suse.de commit 169c85edcabcc1a7f01b7b5bee1f918ca49ac14f Author: Thomas Zimmermann Date: Thu Mar 30 09:30:44 2023 +0200 drm/armada: Hide fbdev support behind config option Only build armada's fbdev emulation if CONFIG_DRM_FBDEV_EMULATION has been enabled. No functional changes, but allows to build armada without fbdev. Signed-off-by: Thomas Zimmermann Reviewed-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230330073046.7150-3-tzimmermann@suse.de commit 1c9da7db8899fa0e891997118d75b46d38102497 Author: Thomas Zimmermann Date: Thu Mar 30 09:30:43 2023 +0200 drm/armada: Include Include to get declarations of of_node_put() and of_device_is_available(). No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230330073046.7150-2-tzimmermann@suse.de commit bfa010f608491036327db20aad1d15e28da0189e Author: José Roberto de Souza Date: Thu Apr 20 10:05:58 2023 -0700 drm/i915: Initialize dkl_phy spin lock from display code path drm/i915: Initialize dkl_phy spin lock from display code path Start moving the initialization of display locks from i915_driver_early_probe(). Display locks should be initialized from display-only code paths. It was also agreed that if a variable is only used in one file, it should be initialized only in that file, so intel_dkl_phy_init() was added. v2: - added intel_display_locks_init() v3: - rebased v4: - dropped intel_display_locks_init() v5: - moved intel_dkl_phy_init() to the beginning of file Cc: intel-gfx@lists.freedesktop.org Cc: Rodrigo Vivi Cc: Ville Syrjälä Cc: Jani Nikula Cc: Maarten Lankhorst Reviewed-by: Lucas De Marchi Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20230420170558.35398-1-jose.souza@intel.com commit 20dfae3ca28ff874e506c48704eed2a465a82585 Author: Fei Yang Date: Thu Apr 20 12:23:49 2023 +0200 drm/i915/mtl: Set has_llc=0 On MTL, LLC is not shared between GT and CPU, set has_llc=0. Signed-off-by: Fei Yang Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Reviewed-by: Nirmoy Das Signed-off-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230420102349.15302-1-nirmoy.das@intel.com commit 4e7f84ec068cec6a9a72fe0f558e0ae4cf765c51 Author: Le Ma Date: Thu Dec 16 15:35:25 2021 +0800 drm/amdgpu: initialize num_xcd to 1 for gfx v9_0 Assign value here as the num_xcd is referenced in some gfx9 common path. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 66daccde429611530db82605c197be01adadb389 Author: Le Ma Date: Wed Dec 1 16:44:18 2021 +0800 drm/amdgpu: add master/slave check in init phase Skip KCQ setup on slave xcc as there's no use case. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 224d3df954c184826657bbacd2a562dc99478cb3 Author: Samson Tam Date: Wed Feb 23 10:23:25 2022 -0500 drm/amd/display: Clear GPINT1 before taking DMCUB out of reset [Why] Workaround for DMCUB front door load [How] Clear GPINT after reset so its consistent Signed-off-by: Samson Tam Acked-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 79b6e265d92092b49252f546e1a0f63ae8851f83 Author: Aurabindo Pillai Date: Thu Apr 6 12:28:59 2023 -0400 drm/amd/display: Fixes for dcn32_clk_mgr implementation [Why&How] Fix CLK MGR early initialization and add logging. Fixes: 265280b99822 ("drm/amd/display: add CLKMGR changes for DCN32/321") Reviewed-by: Leo Li Reviewed-by: Qingqing Zhuo Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a82e0b6fb2cb369672ff9ffb383d7d402aa54163 Author: Ville Syrjälä Date: Tue Apr 11 22:14:29 2023 +0300 drm/i915/psr: Sprinkle cpu_transcoder variables around Reduce the 'intel_dp' stuff a bit by introducing local cpu_transcoder variables. Ideally I'd like the whole PSR code to stop using intel_dp except during a full modeset, but dunno yet if that's possible. But the less 'intel_dp' we have sprad around the easier that should be to figure out eventually. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230411191429.29895-9-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander commit 4fb5f569055ccead1807139791b368b31f1e7301 Author: Ville Syrjälä Date: Tue Apr 11 22:14:28 2023 +0300 drm/i915/psr: Include PSR_PERF_CNT in debugfs output on all platforms The fact that DC states reset the PSR perofrmance counter is no reason not to include it in the debug output. But let's keep the comment there to remind people about that caveat. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230411191429.29895-8-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander commit da57e3d6ed433bbfc52730aec111afb6856f9441 Author: Ville Syrjälä Date: Tue Apr 11 22:14:27 2023 +0300 drm/i915/psr: Add a FIXME for the PSR vs. AUX usage conflict We need to disable PSR when we are doing AUX by hand, otherwise it's possible that the PSR hardware could be using the AUX CH while we try to do our manual stuff. Add a FIXME for now. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230411191429.29895-7-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander commit 2590ef92cdff017ac98012593db54c4d5b96388d Author: Ville Syrjälä Date: Tue Apr 11 22:14:26 2023 +0300 drm/i915/psr: Define more PSR mask bits Define more of the PSR mask bits, and describe in detail what some of them do. Even if we don't set them all from the driver they can be very useful during PSR debugging. Having to trawl through bspec every time to find them is not fun, and re-reverse engineering the behaviour every time is time consuming (even if a bit more fun than spec trawling). v2: Moar bits Put the description into a comment to be easily available v2: Fix the BDW_UNMASK_VBL_TO_REGS_IN_SRD/HSW_UNMASK_VBL_TO_REGS_IN_SRD description Rebase due to intel_psr_regs.h Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230411191429.29895-6-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander commit 34c1aeb579ddd36392e18e2fc354db441556811e Author: Nikita Travkin Date: Sat Apr 8 13:20:14 2023 +0500 drm/bridge: ti-sn65dsi86: Implement wait_hpd_asserted This bridge doesn't actually implement HPD due to it being way too slow but instead expects the panel driver to wait enough to assume HPD is asserted. However some panels (such as the generic 'edp-panel') expect the bridge to deal with the delay and pass maximum delay to the aux instead. In order to support such panels, add a dummy implementation of wait that would just sleep the maximum delay and assume no failure has happened. Signed-off-by: Nikita Travkin Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230408082014.235425-1-nikita@trvn.ru commit 2624ee66359b24062b6e8f6216c4ff2a778237a6 Author: Ville Syrjälä Date: Tue Apr 11 22:14:25 2023 +0300 drm/i915/psr: Use intel_de_rmw() Replace some hand rolled RMW stuff with intel_de_rmw(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230411191429.29895-5-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander commit 1d9582dc2b5f5c82dc9471c8d97c0712d5a04c5c Author: Ville Syrjälä Date: Tue Apr 11 22:14:24 2023 +0300 drm/i915/psr: Clean up PSR register defininitions Use REG_BIT() & co. to make the PSR register definitions nicer. v2: Rebase due to intel_psr_regs.h Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230411191429.29895-4-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander commit 3df3c589cc8f4ff1f08302029d6ddef96ea1d449 Author: Ville Syrjälä Date: Tue Apr 11 22:14:23 2023 +0300 drm/i915: Clean up various display chicken registers Modernize a bunch of display chicken registers by using REG_BIT() & co. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230411191429.29895-3-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander commit 3d0d33363cdf4bdc41227cccc28848d6b2fc2998 Author: Ville Syrjälä Date: Tue Apr 11 22:14:22 2023 +0300 drm/i915: Fix up whitespace in some display chicken registers Fix a bunch of whitespace issues in some display register definitons. Only touching the bits alerayd using REG_BIT() & co. here. The rest will come later. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230411191429.29895-2-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander commit 12de65d9c6e3b7b0b05ec03cc19669268ee1318f Author: Ville Syrjälä Date: Tue Apr 18 20:55:21 2023 +0300 drm/i915: Drop a useless forward declararion ilk_pfit_enable() is defined before the first use. No need for a forwared declaration. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230418175528.13117-9-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 75d020db38b8ec325fe5a28336646e93eac3b033 Author: Ville Syrjälä Date: Tue Apr 18 20:55:20 2023 +0300 drm/i915: Use REG_BIT() & co. for ilk+ pfit registers Polish the ilk+ pfit registers with REG_BIT() & co., and also take the opportunity to unify the ivb/hsw vs. not checks in ilk_pfit_enable() and ilk_get_pfit_config(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230418175528.13117-8-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit e27525cc805548eaaa9d0cb8e8f0f181e9cd5390 Author: Ville Syrjälä Date: Tue Apr 18 20:55:19 2023 +0300 drm/i915: Namespace pfit registers properly Give the PFIT_CONTROL bits a consistent namespace. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230418175528.13117-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 08df6d30c1022e738dd26e732a36f3f7642594d2 Author: Ville Syrjälä Date: Tue Apr 18 20:55:18 2023 +0300 drm/i915: Use REG_BIT() & co for the pre-ilk pfit registers Modernize the gmch pfit register definitions using REG_BIT/etc. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230418175528.13117-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 597421a806c7485b91ee4cf7ec2ce3618223dc92 Author: Ville Syrjälä Date: Tue Apr 18 20:55:17 2023 +0300 drm/i915: Relocate skl_get_pfit_config() Move skl_get_pfit_config() next to the other skl+ scaler code and rename it to skl_scaler_get_config() so that it has a consistnet namespace. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230418175528.13117-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 8976b18249407df8bf6ea18ecae0640a15341a50 Author: Ville Syrjälä Date: Tue Apr 18 20:55:16 2023 +0300 drm/i915: Relocate intel_atomic_setup_scalers() Move intel_atomic_setup_scalers() next to the other scaler code in skl_scaler.c. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230418175528.13117-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 8637e1c84c5f2c3ea4a1e145ca226fef90a148a2 Author: Ville Syrjälä Date: Tue Apr 18 20:55:15 2023 +0300 drm/i915: Relocate VBLANK_EVASION_TIME_US Move the VBLANK_EVASION_TIME_US definition to a slightly better place. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230418175528.13117-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 691248d4135fe3fae64b4ee0676bc96a7fd6950c Author: Ville Syrjälä Date: Tue Apr 18 20:55:14 2023 +0300 drm/i915: Check pipe source size when using skl+ scalers The skl+ scalers only sample 12 bits of PIPESRC so we can't do any plane scaling at all when the pipe source size is >4k. Make sure the pipe source size is also below the scaler's src size limits. Might not be 100% accurate, but should at least be safe. We can refine the limits later if we discover that recent hw is less restricted. Cc: stable@vger.kernel.org Tested-by: Ross Zwisler Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8357 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230418175528.13117-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 8902a55dfcff7add5d8cc77781ecc311fba8855a Author: Jani Nikula Date: Mon Apr 17 18:37:41 2023 +0300 drm/i915/display: throw out struct intel_load_detect_pipe An error-valued pointer can handle all in one without the wrapper struct. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230417153741.1074692-2-jani.nikula@intel.com commit b13604c0ff26ecde5f708ef5e1fd233f8e89e1f6 Author: Jani Nikula Date: Mon Apr 17 18:37:40 2023 +0300 drm/i915/display: split out load detect to a separate file Load detect is shared between tv and crt but otherwise isolated in intel_display.c. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230417153741.1074692-1-jani.nikula@intel.com commit 91c249b2b9f6a80c744387b6713adf275ffd296b Author: Thomas Zimmermann Date: Mon Apr 17 14:56:51 2023 +0200 arch/x86: Implement with generic helpers Include and set the required preprocessor tokens correctly. x86 now implements its own set of fb helpers, but still follows the overall pattern of the other files. v3: * clarified commit message Signed-off-by: Thomas Zimmermann Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-20-tzimmermann@suse.de commit db76f19a607d6cf4a9d5868d05675c355e99809c Author: Thomas Zimmermann Date: Mon Apr 17 14:56:50 2023 +0200 arch/sparc: Implement with generic helpers Replace sparc64's fb_pgprotect() with the generic one from . On sparc, pgprot_writecombine() and pgprot_noncached() are the same; hence no functional changes v3: * use default implementation for fb_pgprotect() on sparc64 (Arnd) v2: * restore the original fb_pgprotect() Signed-off-by: Thomas Zimmermann Cc: "David S. Miller" Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-19-tzimmermann@suse.de commit 4eec0b3048fcd74b504c2a6828a07f133a8ab508 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:49 2023 +0200 arch/sparc: Implement fb_is_primary_device() in source file Other architectures implment fb_is_primary_device() in a source file. Do the same on sparc. No functional changes, but allows to remove several include statement from . v2: * don't include in header file Signed-off-by: Thomas Zimmermann Cc: "David S. Miller" Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-18-tzimmermann@suse.de commit b6cf29637be638a6846d2d297d80cf7c6fb74faf Author: Thomas Zimmermann Date: Mon Apr 17 14:56:48 2023 +0200 arch/sh: Implement with generic helpers Replace the architecture's fbdev helpers with the generic ones from . No functional changes. v2: * use default implementation for fb_pgprotect() (Arnd) Signed-off-by: Thomas Zimmermann Cc: Yoshinori Sato Cc: Rich Felker Cc: John Paul Adrian Glaubitz Acked-by: John Paul Adrian Glaubitz Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-17-tzimmermann@suse.de commit b50f6d465ac1fb37cab7bfb39ac6c9fb9d8e3716 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:47 2023 +0200 arch/powerpc: Implement with generic helpers Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Acked-by: Michael Ellerman Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-16-tzimmermann@suse.de commit f3424d287626f223cd9851e4d14a5c37b8d04028 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:46 2023 +0200 arch/parisc: Implement with generic helpers Replace the architecture's fbdev helpers with the generic ones from . On PARISC, pgprot_writecombine() and pgprot_noncached() are the same; hence no functional changes. v3: * use default implementation for fb_pgprotect() (Arnd) Signed-off-by: Thomas Zimmermann Cc: "James E.J. Bottomley" Cc: Helge Deller Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-15-tzimmermann@suse.de commit cf41d18b72c8b79f617c59529171faf49aa74dca Author: Thomas Zimmermann Date: Mon Apr 17 14:56:45 2023 +0200 arch/parisc: Implement fb_is_primary_device() under arch/parisc Move PARISC's implementation of fb_is_primary_device() into the architecture directory. This the place of the declaration and where other architectures implement this function. No functional changes. Signed-off-by: Thomas Zimmermann Cc: "James E.J. Bottomley" Cc: Helge Deller Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-14-tzimmermann@suse.de commit d77f0ecdac62968ec99a18deff3d91b453974b9c Author: Thomas Zimmermann Date: Mon Apr 17 14:56:44 2023 +0200 arch/parisc: Remove trailing whitespaces Fix trailing whitespaces. No functional changes. Signed-off-by: Thomas Zimmermann Cc: "James E.J. Bottomley" Cc: Helge Deller Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-13-tzimmermann@suse.de commit 7470849745e6cd746ae773a6e59b309867310181 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:43 2023 +0200 video: Move HP PARISC STI core code to shared location STI core files have been located in console and fbdev code. Move the source code and header to the directories for video helpers. Also update the config and build rules such that the code depends on the config symbol CONFIG_STI_CORE, which STI console and STI framebuffer select automatically. Cleans up the console makefile and prepares PARISC to implement fb_is_primary_device() within the arch/ directory. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-12-tzimmermann@suse.de commit 0d556f1f0e01ccab9c6bca8099e45170beb01297 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:42 2023 +0200 video: Remove trailing whitespaces Fix trailing whitespaces. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-11-tzimmermann@suse.de commit 910994c0f622e5d2e02ec20e4a0dc342be5bca42 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:41 2023 +0200 arch/mips: Implement with generic helpers Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann Cc: Thomas Bogendoerfer Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-10-tzimmermann@suse.de commit db21647767db268cebc4a244c61700aeb4a0b17d Author: Thomas Zimmermann Date: Mon Apr 17 14:56:40 2023 +0200 arch/m68k: Implement with generic helpers Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. v2: * provide empty fb_pgprotect() on non-MMU systems Signed-off-by: Thomas Zimmermann Cc: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-9-tzimmermann@suse.de commit d847517950f07353c1195de098c25024f948fe37 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:39 2023 +0200 arch/m68k: Merge variants of fb_pgprotect() into single function Merge all variants of fb_pgprotect() into a single function body. There are two different cases for MMU systems. For non-MMU systems, the function body will be empty. No functional changes, but this will help with the switch to . Signed-off-by: Thomas Zimmermann Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-8-tzimmermann@suse.de commit 84998fc1c39270b8e20223d1b10c00464eec09dc Author: Thomas Zimmermann Date: Mon Apr 17 14:56:38 2023 +0200 arch/loongarch: Implement with generic helpers Replace the architecture's fbdev helpers with the generic ones from . No functional changes. v2: * use default implementation for fb_pgprotect() (Arnd) Signed-off-by: Thomas Zimmermann Cc: Huacai Chen Cc: WANG Xuerui Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-7-tzimmermann@suse.de commit 81ea5144f0cb88ae417f66448e66fd41cbe1e2c6 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:37 2023 +0200 arch/ia64: Implement with generic helpers Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-6-tzimmermann@suse.de commit 10b707b4a2022ee901e6801c35c7eee0de62c168 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:36 2023 +0200 arch/arm64: Implement with generic helpers Replace the architecture's fbdev helpers with the generic ones from . No functional changes. v2: * use default implementation for fb_pgprotect() (Arnd) Signed-off-by: Thomas Zimmermann Cc: Catalin Marinas Cc: Will Deacon Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-5-tzimmermann@suse.de commit 9cfefba8daabb8058122fbcc74ff37b9e515df07 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:35 2023 +0200 arch/arm: Implement with generic helpers Replace the architecture's fbdev helpers with the generic ones from . No functional changes. v2: * use default implementation for fb_pgprotect() (Arnd) Signed-off-by: Thomas Zimmermann Cc: Russell King Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-4-tzimmermann@suse.de commit 3a6155052b07157f3af49e1e63f68cb1943f7de9 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:34 2023 +0200 arch/arc: Implement with generic helpers Replace the architecture's fbdev helpers with the generic ones from . On arc, pgprot_writecombine() and pgprot_noncached() are the same; hence no functional changes. v3: * use default implementation for fb_pgprotect() (Arnd) Signed-off-by: Thomas Zimmermann Cc: Vineet Gupta Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-3-tzimmermann@suse.de commit 91254a4d2e01b8a91c6f0929b77e5fff676a0751 Author: Thomas Zimmermann Date: Mon Apr 17 14:56:33 2023 +0200 fbdev: Prepare generic architecture helpers Generic implementations of fb_pgprotect() and fb_is_primary_device() have been in the source code for a long time. Prepare the header file to make use of them. Improve the code by using an inline function for fb_pgprotect() and by removing include statements. The default mode set by fb_pgprotect() is now writecombine, which is what most platforms want. Symbols are protected by preprocessor guards. Architectures that provide a symbol need to define a preprocessor token of the same name and value. Otherwise the header file will provide a generic implementation. This pattern has been taken from . v3: * include the correct header files v2: * use writecombine mappings by default (Arnd) Signed-off-by: Thomas Zimmermann Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-2-tzimmermann@suse.de commit ba1fb317bbcb67d8024f0e83e509e8c57da35ac5 Author: Jani Nikula Date: Wed Apr 19 14:54:49 2023 +0300 drm/i915/wm: remove stale and unused ilk_wm_max_level() declaration The declaration was removed earlier, but got accidentally resurrected in i915xx_wm.[ch] refactoring. Remove harder. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230419115449.422214-1-jani.nikula@intel.com commit 3bece767dab2ffbd6f77be1a0ceb3e214f0144f8 Author: Haridhar Kalvala Date: Tue Apr 18 15:04:46 2023 -0700 drm/i915/mtl: WA to clear RDOP clock gating Workaround implementation to clear RDOP clock gating. Bspec: 66622 Signed-off-by: Haridhar Kalvala Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20230418220446.2205509-5-radhakrishna.sripada@intel.com commit c91acda3a380bcaf41b67c8fbab668ef8ddf91c3 Author: Maíra Canal Date: Wed Apr 12 11:29:23 2023 -0300 drm/gem: Check for valid formats Currently, drm_gem_fb_create() doesn't check if the pixel format is supported, which can lead to the acceptance of invalid pixel formats e.g. the acceptance of invalid modifiers. Therefore, add a check for valid formats on drm_gem_fb_create(). Note that this check is only valid for atomic drivers, because, for non-atomic drivers, checking drm_any_plane_has_format() is not possible since the format list for the primary plane is fake, and we'd therefore reject valid formats. Adding this check to drm_gem_fb_create() will guarantee that the igt@kms_addfb_basic@addfb25-bad-modifier IGT test passes for drivers using this callback. This commit is a recapture of a series sent a while ago. Initially, I sent a patch [1] similar to this one in which I introduced the format check to drm_gem_fb_create(). Based on the feedback on the patch, I placed the check inside framebuffer_check() [2] so that it wouldn't be needed to hit any driver-specific code path when the check fails. Therefore, we could remove the check from the specific drivers (i915, amdgpu, and vmwgfx). But, with some new feedback, it was shown that introducing this check inside framebuffer_check() is problematic for the i915 driver [3]. For the i915 driver, in the legacy case, in which we don't get the modifier from the userspace, i915's fb_create hook computes the right modifier, which isn't necessarily linear. Therefore, if we check the modifier before that point, we might get wrong answers. So, I kept the check inside the i915 driver and removed the check from amdgpu and vmwgfx [4]. But, this yet hasn't solved the i915 problem [5]. As we cannot add the check inside framebuffer_check() without affecting the i915 behavior, this commit went back to the original patch. This way we can guarantee a more uniform behavior from the drivers that use the drm_gem_fb_create() callback. [1] https://lore.kernel.org/dri-devel/20230103125322.855089-1-mcanal@igalia.com/T/ [2] https://lore.kernel.org/dri-devel/20230109105807.18172-1-mcanal@igalia.com/T/ [3] https://lore.kernel.org/dri-devel/Y8AAdW2y7zN7DCUZ@intel.com/ [4] https://lore.kernel.org/dri-devel/20230113112743.188486-1-mcanal@igalia.com/T/ [5] https://lore.kernel.org/dri-devel/Y8FXWvEhO7GCRKVJ@intel.com/ Signed-off-by: Maíra Canal Reviewed-by: Ville Syrjälä Acked-by: Daniel Vetter Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230412142923.136707-1-mcanal@igalia.com commit 514b8a79aa85d800458cfb7909ed0e1a1c1bffa2 Author: Madhumitha Tolakanahalli Pradeep Date: Tue Apr 18 15:04:45 2023 -0700 drm/i915/mtl: Extend Wa_22011802037 to MTL A-step Wa_22011802037 was being applied to all graphics_ver 11 & 12. This patch updates the if statement to apply the W/A to right platforms and extends it to MTL-M:A step. v1.1: Fix checkpatch warning. v2: Change the check to reflect the wa at other places(Lucas) Bspec: 66622 Cc: Lucas De Marchi Cc: Umesh Nerlige Ramappa Signed-off-by: Madhumitha Tolakanahalli Pradeep Signed-off-by: Radhakrishna Sripada Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20230418220446.2205509-4-radhakrishna.sripada@intel.com commit 0c8d9870177a2d7c9e88a2e79dc20950ec84328f Author: Matt Roper Date: Tue Apr 18 15:04:44 2023 -0700 drm/i915/mtl: Re-use ADL-P's "DC off" power well As with ADL-P, MTL's "DC off" power well should be a dependency of the PGC and PGD power wells, not the entire PG2 well. In fact, the DC5/DC6 requirements between the two platforms are the same, so the Xe_LPD "DC off" well definition can just be re-used for Xe_LPD+. Bspec: 49193 Signed-off-by: Matt Roper Signed-off-by: Radhakrishna Sripada Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230418220446.2205509-3-radhakrishna.sripada@intel.com commit 88c487938414c519fdb1c7e55211d8778d3367d0 Author: Matt Roper Date: Tue Apr 18 15:04:43 2023 -0700 drm/i915: Use separate "DC off" power well for ADL-P and DG2 Although ADL-P and DG2 both use the same general power well setup, the DC5/DC6 requirements are slightly different which means each platform should have its own "DC off" power well. DG2 (i.e., Xe_HPD IP) requires that DC5 be disabled whenever PG2 is active. However ADL-P (i.e., Xe_LPD IP) only requires DC5/DC6 to be disabled when the PGC or PGD subwells are active; we should be able to remain in these DC states when PGB and general PG2 functionality is in use. v2: Use dc_of as power well name. Move xehpd power domain definitions near power well definition.(Imre) Bspec: 49193 Signed-off-by: Matt Roper Signed-off-by: Radhakrishna Sripada Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230418220446.2205509-2-radhakrishna.sripada@intel.com commit 0c29efa23f5c2f51b744856200af0cff3e287e9e Author: Tejas Upadhyay Date: Wed Apr 19 11:30:36 2023 +0530 drm/i915/selftests: Consider multi-gt instead of to_gt() In order to enable complete multi-GT, loop through all the GTs, rather than relying on the to_gt(), which only provides a reference to the primary GT. Problem appear when it runs on platform like MTL where different set of engines are possible on different GTs. Signed-off-by: Tejas Upadhyay Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230419060036.3422635-4-tejas.upadhyay@intel.com commit a347279dec1eb68e995f864ae1fd41ab57cbcd21 Author: Tejas Upadhyay Date: Wed Apr 19 11:30:35 2023 +0530 drm/i915/gem: Consider multi-gt instead of to_gt() In order to enable complete multi-GT, use the GT reference obtained directly from the engine, rather than relying on the to_gt(), which only provides a reference to the primary GT. Problem appear when it runs on platform like MTL where different set of engines are possible on different GTs. Signed-off-by: Tejas Upadhyay Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230419060036.3422635-3-tejas.upadhyay@intel.com commit a6704f4a5452950e7ff22cab0cff23477dbdf0e0 Author: Tejas Upadhyay Date: Wed Apr 19 11:30:34 2023 +0530 drm/i915/gt: Consider multi-gt instead of to_gt() In order to enable complete multi-GT, use the GT reference obtained directly from the engine, rather than relying on the to_gt(), which only provides a reference to the primary GT. Problem appear when it runs on platform like MTL where different set of engines are possible on different GTs. Cc: Andi Shyti Signed-off-by: Tejas Upadhyay Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230419060036.3422635-2-tejas.upadhyay@intel.com commit 476f62b8a597202a7c97bf50a7f6ece0925ce6f0 Author: Jani Nikula Date: Wed Apr 19 12:42:43 2023 +0300 drm/i915: use explicit includes for i915_reg.h and i915_irq.h A lot of places include i915_reg.h implicitly via i915_irq.h, which gets included implicitly via intel_display_trace.h. Remove the includes from the headers, and include i915_reg.h and i915_irq.h explicitly where needed. Signed-off-by: Jani Nikula Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230419094243.366821-1-jani.nikula@intel.com commit 27ac123b454417ea92d77c13a5d94655f53b759c Author: Imre Deak Date: Fri Apr 14 20:38:00 2023 +0300 drm/i915/dp_mst: Fix active port PLL selection for secondary MST streams The port PLL selection needs to be up-to-date in the CRTC state of both the primary and all secondary MST streams. The commit removing the encoder update_prepare/complete hooks (see Fixes: below), stopped doing this for secondary streams, fix this up. Fixes: 0f752b2178c9 ("drm/i915: Remove the encoder update_prepare()/complete() hooks") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8336 Cc: Mika Kahola Signed-off-by: Imre Deak Reviewed-by: Mika Kahola Link: https://patchwork.freedesktop.org/patch/msgid/20230414173800.590790-1-imre.deak@intel.com commit 96c7c2f4d5bd94b15fe63448c087f01607b56f4a Author: Danilo Krummrich Date: Tue Apr 18 12:04:53 2023 +0200 drm/scheduler: set entity to NULL in drm_sched_entity_pop_job() It already happend a few times that patches slipped through which implemented access to an entity through a job that was already removed from the entities queue. Since jobs and entities might have different lifecycles, this can potentially cause UAF bugs. In order to make it obvious that a jobs entity pointer shouldn't be accessed after drm_sched_entity_pop_job() was called successfully, set the jobs entity pointer to NULL once the job is removed from the entity queue. Moreover, debugging a potential NULL pointer dereference is way easier than potentially corrupted memory through a UAF. Signed-off-by: Danilo Krummrich Link: https://lore.kernel.org/r/20230418100453.4433-1-dakr@redhat.com Reviewed-by: Luben Tuikov Signed-off-by: Luben Tuikov commit 86b20703e4c5a3c39891def0a68e7438aeca9db9 Author: Le Ma Date: Wed Jul 27 14:24:05 2022 +0800 drm/amdgpu: add xcc index argument to rlc safe_mode func (v4) v1: To support multple XCD case (Le) v2: unify naming style (Le) v3: apply the changes to gc v11_0 (Hawking) v4: apply the changes to gc SOC21 (Morris) Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Morris Zhang Signed-off-by: Alex Deucher commit d51ac6d0a23caf1005cb640f8533161c5d2dd0c0 Author: Le Ma Date: Tue May 24 11:22:49 2022 +0800 drm/amdgpu: add xcc index argument to select_sh_se function v2 v1: To support multiple XCD case (Le) v2: introduce xcc index to gfx_v11_0_select_sh_se (Hawking) Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit ec08571aca7c5e6bf2d1820db9c8aaa104eb9b68 Author: Le Ma Date: Wed Nov 17 17:51:17 2021 +0800 drm/amdgpu: add xcc index argument to gfx v9_4_3 functions Change those v9_4_3 interfaces which are exposed in gfx_v9_0.c. For some active single-xcc emu models, the code path in gfx_v9_0.c is better to keep reserved for a while. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6f917fdc934518401ff2e166e6db1f6ac1ef1078 Author: Le Ma Date: Wed Nov 17 17:24:02 2021 +0800 drm/amdgpu: add multi-XCC initial support in gfx_v9_4_3.c Each XCD needs to be initialized respectively. The major changes are: 1. add iteration to do rlc/kiq/kcq init/fini for each xcd 2. load rlc/mec microcode to each xcd 3. add argument to specify xcc index in initialization functions Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5aa998baab3360d0f1b93d6aff3df924045f956c Author: Le Ma Date: Wed Nov 17 16:28:51 2021 +0800 drm/amdgpu: add xcc index argument to soc15_grbm_select To support grbm select for multiple XCD case. v2: unify naming style Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 86301129698be52f8398f92ea8564168f6bfcae1 Author: Le Ma Date: Tue May 24 10:09:39 2022 +0800 drm/amdgpu: split gc v9_4_3 functionality from gc v9_0 To prepare for gc v9_4_3 specific feature. v2: fix exports (Alex) Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit def799c6596d078112095c24c25e162cb5102d90 Author: Le Ma Date: Tue May 24 12:23:03 2022 +0800 drm/amdgpu: add multi-xcc support to amdgpu_gfx interfaces (v4) v1: Modify kiq_init/fini, mqd_sw_init/fini and enable/disable_kcq to adapt to multi-die case. Pass 0 as default to all asics with single xcc (Le) v2: squash commits to avoid breaking the build (Le) v3: unify naming style (Le) v4: apply the changes to gc v11_0 (Hawking) Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit c38be07035bcb31274ce5f85e3b249f691c5b8db Author: Le Ma Date: Tue Nov 16 21:56:34 2021 +0800 drm/amdgpu: separate the mqd_backup for kiq from kcq This will benifit the mqd indexing for kiq/kcq in multi XCD case. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit be697aa3a78ef83a6b8d49e1f0671a002e502cd0 Author: Le Ma Date: Wed Jul 27 14:35:49 2022 +0800 drm/amdgpu: move queue_bitmap to an independent structure (v3) To allocate independent queue_bitmap for each XCD, then the old bitmap policy can be continued to use with a clear logic. Use mec_bitmap[0] as default for all non-GC 9.4.3 IPs. v2: squash commits to avoid breaking the build v3: unify naming style Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit 277bd3371f11400d5b02df54f057569be4b10cea Author: Le Ma Date: Tue May 24 10:51:43 2022 +0800 drm/amdgpu: convert gfx.kiq to array type (v3) v1: more kiq instances are a available in SOC (Le) v2: squash commits to avoid breaking the build (Le) v3: make the conversion for gfx/mec v11_0 (Hawking) Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit 20c3dffdccbd494e0dd631d1660aeecbff6775f2 Author: Nikita Zhandarovich Date: Thu Apr 13 08:12:28 2023 -0700 radeon: avoid double free in ci_dpm_init() Several calls to ci_dpm_fini() will attempt to free resources that either have been freed before or haven't been allocated yet. This may lead to undefined or dangerous behaviour. For instance, if r600_parse_extended_power_table() fails, it might call r600_free_extended_power_table() as will ci_dpm_fini() later during error handling. Fix this by only freeing pointers to objects previously allocated. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: cc8dbbb4f62a ("drm/radeon: add dpm support for CI dGPUs (v2)") Co-developed-by: Natalia Petrova Signed-off-by: Nikita Zhandarovich Signed-off-by: Alex Deucher commit 94344e62a9ce8abcf681390f9822a7b075cf98e2 Author: Tom Rix Date: Fri Apr 14 11:08:30 2023 -0400 drm/amd/display: remove unused variable oldest_index cpp_check reports drivers/gpu/drm/amd/display/modules/freesync/freesync.c:1143:17: style: Variable 'oldest_index' is assigned a value that is never used. [unreadVariable] oldest_index = 0; ^ This variable is not used so remove. Signed-off-by: Tom Rix Signed-off-by: Alex Deucher commit 1fa8d710573f02ae9118bc5f53e7ede09d6920da Author: Alan Liu Date: Fri Apr 14 18:39:52 2023 +0800 drm/amdgpu: Fix desktop freezed after gpu-reset [Why] After gpu-reset, sometimes the driver fails to enable vblank irq, causing flip_done timed out and the desktop freezed. During gpu-reset, we disable and enable vblank irq in dm_suspend() and dm_resume(). Later on in amdgpu_irq_gpu_reset_resume_helper(), we check irqs' refcount and decide to enable or disable the irqs again. However, we have 2 sets of API for controling vblank irq, one is dm_vblank_get/put() and another is amdgpu_irq_get/put(). Each API has its own refcount and flag to store the state of vblank irq, and they are not synchronized. In drm we use the first API to control vblank irq but in amdgpu_irq_gpu_reset_resume_helper() we use the second set of API. The failure happens when vblank irq was enabled by dm_vblank_get() before gpu-reset, we have vblank->enabled true. However, during gpu-reset, in amdgpu_irq_gpu_reset_resume_helper() vblank irq's state checked from amdgpu_irq_update() is DISABLED. So finally it disables vblank irq again. After gpu-reset, if there is a cursor plane commit, the driver will try to enable vblank irq by calling drm_vblank_enable(), but the vblank->enabled is still true, so it fails to turn on vblank irq and causes flip_done can't be completed in vblank irq handler and desktop become freezed. [How] Combining the 2 vblank control APIs by letting drm's API finally calls amdgpu_irq's API, so the irq's refcount and state of both APIs can be synchronized. Also add a check to prevent refcount from being less then 0 in amdgpu_irq_put(). v2: - Add warning in amdgpu_irq_enable() if the irq is already disabled. - Call dc_interrupt_set() in dm_set_vblank() to avoid refcount change if it is in gpu-reset. v3: - Improve commit message and code comments. Signed-off-by: Alan Liu Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 7f102a906681cddb8ababe53e0caa40a17f4cd11 Author: Colin Ian King Date: Mon Apr 17 18:42:37 2023 +0100 drm/amd/pm: Fix spelling mistake "aquire" -> "acquire" There is a spelling mistake in the smu_i2c_bus_access prototype. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 4f18b9a6711adbc7c76993c734a94ee3f5c61791 Author: Bas Nieuwenhuizen Date: Thu Apr 13 16:22:53 2023 +0200 drm/amdgpu: Add support for querying the max ibs in a submission. (v3) This info would be used by radv to figure out when we need to split a submission into multiple submissions. radv currently has a limit of 192 which seems to work for most gfx submissions, but is way too high for e.g. compute or sdma. Userspace is available at https://gitlab.freedesktop.org/bnieuwenhuizen/mesa/-/commits/ib-rejection-v3 v3: Completely rewrote based on suggestion of making it a separate query. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2498 Reviewed-by: Christian König Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Alex Deucher commit c30ddcece3a0a86853862a7d92678a79525ca1fb Author: Bas Nieuwenhuizen Date: Thu Apr 13 16:22:52 2023 +0200 drm/amdgpu: Add a max ibs per submission limit. And ensure each ring supports that many submissions. This makes sure that we don't get surprises after the submission has been scheduled where the ring allocation actually gets rejected. My calculations on the existing limits: COMPUTE v10: 128 COMPUTE v11: 128 COMPUTE v6: 157 COMPUTE v7: 133 COMPUTE v8: 130 COMPUTE v9: 125 GFX v10: 208 GFX v11: 213 GFX v6: 154 (doubling this in the previous patch) GFX v7: 226 GFX v8: 213 GFX v9: 208 GFX v9 (SW): 208 SDMA CIK: 87 SDMA SI: 97 SDMA v2.4: 74 SDMA v3.0: 74 SDMA v4.0: 72 SDMA v5.0: 51 SDMA v6.0: 52 UVD ENC v6.0: 98 UVD ENC v7.0: 92 UVD v3.1: 124 UVD v4.2: 124 UVD v5.0: 83 UVD v6.0 (VM): 55 UVD v7.0: 51 VCE v2.0: 126 VCE v3.0 (VM): 98 VCE v4.0: 93 VCN DEC v1.0: 49 VCN DEC v2.0: 51 VCN DEC v3.0: 51 VCN ENC v1.0: 58 VCN ENC v2.0: 93 VCN ENC v3.0: 93 VCN ENC v4.0: 93 VCN JPEG v1.0: 17 VCN JPEG v2.0: 16 VCN JPEG v2.5: 17 VCN JPEG v3.0: 17 VCN JPEG v4.0: 17 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2498 Reviewed-by: Christian König Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Alex Deucher commit 97041ed37718dc9ba30aa23ca74093dc93ac89fb Author: Bas Nieuwenhuizen Date: Thu Apr 13 16:22:51 2023 +0200 drm/amdgpu: Increase GFX6 graphics ring size. To ensure it supports 192 IBs per submission, so we can keep a simplified IB limit in the follow up patch without having to look at IP or GPU version. Reviewed-by: Christian König Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Alex Deucher commit 128c1ca0303fe764a4cde5f761e72810d9e40b6e Author: Alvin Lee Date: Fri Apr 29 20:41:10 2022 -0400 drm/amd/display: Update DTBCLK for DCN32 [Why&How] - Implement interface to program DTBCLK DTO’s according to reference DTBCLK returned by PMFW - This is required because DTO programming requires exact DTBCLK reference freq or it could result in underflow Acked-by: Aurabindo Pillai Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3306ba4b60b2f3d9ac6bddc587a4d702e1ba2224 Author: Arnd Bergmann Date: Tue Apr 18 00:07:18 2023 +0200 drm/amd/display: fix is_timing_changed() prototype Three functions in the amdgpu display driver cause -Wmissing-prototype warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1858:6: error: no previous prototype for 'is_timing_changed' [-Werror=missing-prototypes] is_timing_changed() is actually meant to be a global symbol, but needs a proper name and prototype. Fixes: 17ce8a6907f7 ("drm/amd/display: Add dsc pre-validation in atomic check") Reviewed-by: Aurabindo Pillai Signed-off-by: Arnd Bergmann Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit cd8f067a46d34dee3188da184912ae3d64d98444 Author: Wesley Chalmers Date: Wed Jun 10 11:49:16 2020 -0400 drm/amd/display: Add logging for display MALL refresh setting [WHY] Add log entry for when display refresh from MALL settings are sent to SMU. Fixes: 1664641ea946 ("drm/amd/display: Add logger for SMU msg") Signed-off-by: Wesley Chalmers Acked-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0c316556d124916e1dc2be171b3414b764972802 Author: Tianci Yin Date: Mon Feb 6 15:58:46 2023 +0800 drm/amd/display: Disable migration to ensure consistency of per-CPU variable [why] Since the variable fpu_recursion_depth is per-CPU type, it has one copy on each CPU, thread migration causes data consistency issue, then the call trace shows up. And preemption disabling can't prevent migration. [how] Disable migration to ensure consistency of fpu_recursion_depth. Reviewed-by: Aurabindo Pillai Signed-off-by: Tianci Yin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2a66c0c9d20238812172693b5bef28c6c659eff4 Author: Mikita Lipski Date: Thu May 17 15:44:20 2018 -0400 drm/amd/display: Write TEST_EDID_CHECKSUM_WRITE for EDID tests Extract edid's checksum and send it back for verification if EDID_TEST is requested. Signed-off-by: Mikita Lipski Acked-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 08c73e896836be1a1875c612c25a9ad81893ff98 Author: Aurabindo Pillai Date: Wed Apr 5 16:17:42 2023 -0400 drm/amd/display: remove incorrect early return [Why&How] Remove incorrect early return in a device specific fifo reset workaround Reviewed-by: Leo Li Reviewed-by: Qingqing Zhuo Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c18842a2e81a3e3d5c7401f061d7887b422aeebc Author: Hersen Wu Date: Sun May 29 10:54:30 2022 -0400 drm/amd/display: Return error code on DSC atomic check failure [Why&How] We were not returning -EINVAL on DSC atomic check fail. Add it. Fixes: 71be4b16d39a ("drm/amd/display: dsc validate fail not pass to atomic check") Reviewed-by: Aurabindo Pillai Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 499e4b1c722e0e2ca40c56342b766e95f6c31f4a Author: Eric Yang Date: Fri May 29 17:13:57 2020 -0400 drm/amd/display: add mechanism to skip DCN init [Why] If optimized init is done in FW. DCN init can be skipped in driver. This need to be communicated between driver and fw and maintain backwards compatibility. [How] Use DMUB scratch 0 bit 2 to indicate optimized init done in fw and use DMUB scatch 4 bit 0 to indicate drive supports the optimized flow so FW will perform it. Signed-off-by: Eric Yang Acked-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit bddb55ccbdc20dd7fd526c8dfb13f695637bf7b1 Author: Dmytro Laktyushkin Date: Mon Apr 3 10:13:12 2023 -0400 drm/amd/display: set dcn315 lb bpp to 48 [Why & How] Fix a typo for dcn315 line buffer bpp. Reviewed-by: Jun Lei Acked-by: Qingqing Zhuo Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7ab269d54813e03eec8a5acc415b2aef55aaf916 Author: Daniel Miess Date: Tue Apr 4 14:04:11 2023 -0400 drm/amd/display: limit timing for single dimm memory [Why] 1. It could hit bandwidth limitdation under single dimm memory when connecting 8K external monitor. 2. IsSupportedVidPn got validation failed with 2K240Hz eDP + 8K24Hz external monitor. 3. It's better to filter out such combination in EnumVidPnCofuncModality 4. For short term, filter out in dc bandwidth validation. [How] Force 2K@240Hz+8K@24Hz timing validation false in dc. Reviewed-by: Nicholas Kazlauskas Acked-by: Qingqing Zhuo Signed-off-by: Daniel Miess Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a6c0c9f56197fcb3418be82a7d9f9952be1b5598 Author: Jingwen Zhu Date: Thu Mar 30 16:38:59 2023 +0800 drm/amd/display: Improvement for handling edp link training fails [Why] The eDP retrain will cause the DPCD 300 to be reset to default. And cause the brightness can't be set correctly. [How] delete the call to edp panel power control in both enable_link_output/disable_link_output entirely and only call edp panel control in enable_link_dp and  disable_link_dp once. Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Jingwen Zhu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f0c5f9ebbc4cfd6b9611b8a5d9fb208c5f60e3e6 Author: Michael Mityushkin Date: Thu Mar 30 11:35:08 2023 -0400 drm/amd/display: Apply correct panel mode when reinitializing hardware [Why] When link training during engine recovery, ASSR might fail causing panel mode to be reset to default. This should not happen for eDP as it will prevent the panel from turning back on. [How] Added dp_panel_mode to struct dc_link to remember previously applied panel mode. Do not reset panel mode to default while performing link training if previously used panel mode = eDP. Reviewed-by: Nicholas Kazlauskas Acked-by: Qingqing Zhuo Signed-off-by: Michael Mityushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ec341e0f4a02040ee8d6ef156f8bf02c5aa5c511 Author: Dmytro Laktyushkin Date: Mon Mar 20 16:47:21 2023 -0400 drm/amd/display: add extra dc odm debug options [Why & How] Add options for dc odm debug. Reviewed-by: Ariel Bernstein Acked-by: Qingqing Zhuo Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 21fc0ff38f571debdba6aaff944addb50f49a7f7 Author: Alex Hung Date: Mon Apr 3 17:45:41 2023 +0800 drm/amd/display: fix a divided-by-zero error [Why & How] timing.dsc_cfg.num_slices_v can be zero and it is necessary to check before using it. This fixes the error "divide error: 0000 [#1] PREEMPT SMP NOPTI". Reviewed-by: Aurabindo Pillai Acked-by: Qingqing Zhuo Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 276641775848020c6e84166d1bc885e028a04680 Author: Anthony Koo Date: Sat Apr 1 11:45:31 2023 -0400 drm/amd/display: [FW Promotion] Release 0.0.162.0 - Add DMUB_CMD__IDLE_OPT_DCN_NOTIFY_IDLE command - Remove d3 entry event and instead check for stream mask - dmu: Enable timeout recovery and detection for p-state Acked-by: Qingqing Zhuo Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d062de7b68f27546a45c063b046b66c0a73633db Author: Alvin Lee Date: Fri Mar 31 20:02:57 2023 -0400 drm/amd/display: Enable FPO + Vactive [Description] - Enable FPO + Vactive Reviewed-by: George Shen Acked-by: Qingqing Zhuo Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9fc6e4b36f2a748c853512d5ce4c8c4b98941c75 Author: Alvin Lee Date: Fri Mar 31 17:38:21 2023 -0400 drm/amd/display: Set watermarks set D equal to A [Description] - Since we do not use optimized watermark settings for MALL, set D = A - PMFW uses Set D for d0i3.1, so driver should make D = A for the time being - If we choose to optimize in the future we can set watermarks D correctly Reviewed-by: Jun Lei Acked-by: Qingqing Zhuo Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7052a801d6bc8cd203e1708313e4996630208a6e Author: Michael Mityushkin Date: Thu Mar 30 12:46:58 2023 -0400 drm/amd/display: Correct output color space during HW reinitialize [Why] Doing core_link_disable_stream or set_dpms_off when reinitializing hardware causes issue to repro with external display connected. This is unnecessary, blanking pixel data should be sufficient. [How] Call disable_pixel_data while reinitializing hardware instead of core_link_disable_stream or set_dpms_off. Reviewed-by: Nicholas Kazlauskas Acked-by: Qingqing Zhuo Signed-off-by: Michael Mityushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6bfe9a23a8d6c7292d520747859a515fd429518d Author: Nasir Osman Date: Thu Mar 30 15:08:42 2023 -0400 drm/amd/display: DSC policy override when ODM combine is forced [why] When we force ODM combine with DSC, we lose several 8 bit and 10 bit modes in validation and thus not able to use HDR. This is due to the number of horizontal slices used in DSC not properly being accounted for currently when 2:1 ODM Combine is forced. [how] Enforce at least two horizontal slices are used for DSC when ODM combine is forced. Reviewed-by: Nicholas Kazlauskas Acked-by: Qingqing Zhuo Signed-off-by: Nasir Osman Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4d5f872dbc755114628c236e17421629ec522203 Author: Iswara Nagulendran Date: Thu Mar 16 16:29:06 2023 -0400 drm/amd/display: Adding support for VESA SCR [HOW&WHY] Write DPCD 721 bit 7 to high, and the appropriate luminance level to DPCD 734-736 if bit 4 from DPCD register 734 is high, indicating that the panel luminance control is enabled from the panel side. Reviewed-by: Anthony Koo Acked-by: Qingqing Zhuo Signed-off-by: Iswara Nagulendran Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e3416e872f84086667df21daf166506fab97358d Author: Rodrigo Siqueira Date: Fri Mar 24 14:29:52 2023 -0600 drm/amd/display: Add FAMS validation before trying to use it To ensure that FAMS can be used, DC must check if there is VRR support. This commit adds the required configuration to ensure FAMS can be executed in the target system. Reviewed-by: Alvin Lee Acked-by: Qingqing Zhuo Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit cdff36a0217aadf5cbc167893ad1c0da869619cb Author: Hersen Wu Date: Tue Mar 28 10:45:24 2023 -0400 drm/amd/display: fix access hdcp_workqueue assert [Why] hdcp are enabled for asics from raven. for old asics which hdcp are not enabled, hdcp_workqueue are null. some access to hdcp work queue are not guarded with pointer check. [How] add hdcp_workqueue pointer check before access workqueue. Reviewed-by: Bhawanpreet Lakha Acked-by: Qingqing Zhuo Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 522b9a5d5852f99e51fbc460054dc8af3b4b5b30 Author: Josip Pavic Date: Fri Mar 24 15:31:10 2023 -0400 drm/amd/display: drain dmub inbox if queue is full [Why & How] If dmub command queuing fails due to the inbox being full, flush the inbox and resubmit the comamnd. This was previously the default behavior but was lost in a refactor. Reviewed-by: Nicholas Kazlauskas Acked-by: Qingqing Zhuo Signed-off-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e97cc04fe0fb33e489583dff79f6b1d6919fcc66 Author: Josip Pavic Date: Wed Feb 15 15:47:59 2023 -0500 drm/amd/display: refactor dmub commands into single function [Why & How] Consolidate dmub access to a single interface. This makes it easier to add code in the future that needs to run every time a dmub command is requested (e.g. instrumentation, locking etc). Reviewed-by: Nicholas Kazlauskas Acked-by: Qingqing Zhuo Signed-off-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c4edb01374685a3ea195c7d31459448cabe5a34e Author: Alvin Lee Date: Tue Mar 28 09:53:33 2023 -0400 drm/amd/display: Reduce SubVP + DRR stretch margin [Description] - Having excessively large margin causes failure in the static schedulability check in some cases for SubVP + DRR - 100us of DRR margin is sufficient based on a weeks worth of stress testing on different display configs Reviewed-by: Michael Strauss Acked-by: Qingqing Zhuo Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d11dfbecc3feed5916bbe6c10942d9db61a9e2de Author: Alvin Lee Date: Mon Mar 27 18:40:34 2023 -0400 drm/amd/display: Only consider DISPCLK when using optimized boot path [Description] - Previous bug fix for audio issue included dtbclk and p-state on the optimized boot path which is incorarect - We only care about DISPCLK in the optimized vs. non-optimized boot path to avoid audio issues Reviewed-by: Saaem Rizvi Acked-by: Qingqing Zhuo Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3cfd03b79425c8c9e10d15434f0b017249372609 Author: Dmytro Laktyushkin Date: Mon Mar 27 15:33:54 2023 -0400 drm/amd/display: update max streams per surface Increse to 6 as that is the max surfaces supported asics can have. The is no practical use case yet, but this is valuable for pre-si validation. Reviewed-by: Ariel Bernstein Acked-by: Qingqing Zhuo Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c0162a05bd31129e29a23d4bd1d2321c9663d5bc Author: Hersen Wu Date: Mon Mar 27 09:10:48 2023 -0400 drm/amd/display: fix memleak in aconnector->timing_requested [Why] when amdgpu_dm_update_connector_after_detect is called two times successively with valid sink, memory allocated of aconnector->timing_requested for the first call is not free. this causes memeleak. [How] allocate memory only when aconnector->timing_requested is null. Reviewed-by: Qingqing Zhuo Acked-by: Qingqing Zhuo Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 72529b683c6d94fa87f3a42efd9b92ccfb8def41 Author: Aurabindo Pillai Date: Fri Mar 24 10:42:37 2023 -0400 drm/amd/display: Fix hang when skipping modeset [Why&How] When skipping full modeset since the only state change was a front porch change, the DC commit sequence requires extra checks to handle non existant plane states being asked to be removed from context. Reviewed-by: Alvin Lee Acked-by: Qingqing Zhuo Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 785b250e33c7b1a9dcdb262eac691cd33ac7a53a Author: Alan Liu Date: Wed Mar 22 13:43:28 2023 +0800 drm/amd/display: Fix in disabling secure display [Why] Currently we don't check if secure display is enabled before we send command to disable secure display in dmub. It will accidentally cause some other igt tests to fail, eg, crtc-linear-degamma. [How] Refactor the code we reset the secure display state to check secure display was enabled or not before stopping it in dmub. Reviewed-by: Wayne Lin Acked-by: Qingqing Zhuo Signed-off-by: Alan Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4ad3ee5ccc77aa3f9d702f7b9ad4d9cfeca6c443 Author: Alex Hung Date: Wed Mar 15 19:09:15 2023 +0800 drm/amd/display: allow edp updates for virtual signal [Why] When IGT's kms_hdmi_inject forces EDID for HDMI audio, dc rejects the request because virtual signal is not in dc_is_audio_capable_signal function. [How] Includes SIGNAL_TYPE_VIRTUAL as audio capable. Reviewed-by: Chao-kai Wang Acked-by: Qingqing Zhuo Signed-off-by: Alex Hung Signed-off-by: Wenchieh Chien Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d63e31f66892f67d8f1e279c57c4c0aee789fc66 Author: Josip Pavic Date: Fri May 14 14:04:02 2021 -0400 drm/amd/display: copy dmub caps to dc on dcn31 [Why & How] Add code path to copy dmub caps to dc, which is missing on dcn31 Acked-by: Qingqing Zhuo Signed-off-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e0a77e09c707cf89317de00f87b94b1168f27acd Author: Rodrigo Siqueira Date: Tue Apr 4 14:54:05 2023 -0600 drm/amd/display: Add missing WA and MCLK validation When the commit fff7eb56b376 ("drm/amd/display: Don't set dram clock change requirement for SubVP") was merged, we missed some parts associated with the MCLK switch. This commit adds all the missing parts. Fixes: fff7eb56b376 ("drm/amd/display: Don't set dram clock change requirement for SubVP") Reviewed-by: Aurabindo Pillai Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 751e17147953bc30036b8fe0eaaf780b6951404c Author: Wesley Chalmers Date: Tue Feb 28 13:48:00 2023 -0500 drm/amd/display: Block optimize on consecutive FAMS enables [WHY] It is possible to commit state multiple times in rapid succession with FAMS enabled; if each of these commits were to set optimized_required, then the user may see latency. [HOW] fw_based_mclk_switching is currently not used in dc->clk_mgr; use it to track whether the current state has FAMS enabled; if it has, then do not disable FAMS in prepare_bandwidth, and do not set optimized_required. Reviewed-by: Rodrigo Siqueira Signed-off-by: Wesley Chalmers Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e101bf95ea87ccc03ac2f48dfc0757c6364ff3c7 Author: Wesley Chalmers Date: Thu Nov 3 22:29:31 2022 -0400 drm/amd/display: Do not set drr on pipe commit [WHY] Writing to DRR registers such as OTG_V_TOTAL_MIN on the same frame as a pipe commit can cause underflow. [HOW] Move DMUB p-state delegate into optimze_bandwidth; enabling FAMS sets optimized_required. This change expects that Freesync requests are blocked when optimized_required is true. Reviewed-by: Rodrigo Siqueira Signed-off-by: Wesley Chalmers Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6f0ef80a00adfd51be22b6ab84acd48de1d3938d Author: Leon Huang Date: Thu Dec 8 16:06:07 2022 +0800 drm/amd/display: Fix ABM pipe/backlight issues when change backlight [Why] set ABM pipe/backlight gets some issues when abm callback func pointers are NULL. For some usecase, driver would like to control PWM level before ABM resource is ready. However, recent flow refactor of ABM didn't consider that use case. [How] Rollback flow that sending inbox command to dmub directly when ABM function pointers aren't ready. Reviewed-by: Rodrigo Siqueira Signed-off-by: Leon Huang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9b035d089086deb75d6664b26d36e35853e58ce9 Author: Srinivasan Shanmugam Date: Sat Apr 15 21:03:16 2023 +0530 drm/amd/display: Check & log if receiver supports MST, DSC & FEC. After reading from receiver via DPCD, check & log if it supports MST, DSC & FEC Cc: Aurabindo Pillai Cc: Fangzhi Zuo Signed-off-by: Srinivasan Shanmugam Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit e4dfd94d5e3851df607b26ab5b20ad8d94f5ccff Author: Srinivasan Shanmugam Date: Mon Apr 17 22:30:01 2023 +0530 drm/amd/display: Unconditionally print when DP sink power state fails The previous 'commit ca9beb8aac68 ("drm/amd/display: Add logging when setting DP sink power state fails")', it is better to unconditionally print "failed to power up sink", because we are returning DC_ERROR_UNEXPECTED. Fixes: ca9beb8aac68 ("drm/amd/display: Add logging when setting DP sink power state fails") Cc: Aurabindo Pillai Cc: Fangzhi Zuo Signed-off-by: Srinivasan Shanmugam Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit b8fe56375f78835db47565d91ea9d21767fe3c08 Author: Leon Huang Date: Tue Nov 8 16:29:13 2022 +0800 drm/amd/display: Refactor ABM feature [Why] Refactor ABM feature and implement inbox command for DMUB. [How] Implement the ioctl to send inbox command to DMUB. Reviewed-by: Rodrigo Siqueira Signed-off-by: Leon Huang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a823c5a825cf9e49b2e20011cd87d93f949c2a27 Author: Ville Syrjälä Date: Mon Apr 17 16:17:28 2023 +0300 drm/i915: Reuse _hotplug_mask() in .hpd_detection_setup() Replace the hardcoded masks with just a loop over all hpd pins using the _hotplug_mask() functions. v2: Deal with mtp Reviewed-by: Vinod Govindapillai #v1 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230417131728.7705-5-ville.syrjala@linux.intel.com commit cfe5bdfb27fa234505e96f7775d32415ed705f94 Author: Ville Syrjälä Date: Mon Apr 17 16:17:27 2023 +0300 drm/i915: Check HPD live state during eDP probe We need to untangle the mess where some SKL machines (at least) declare both DDI A and DDI E to be present in their VBT, and both using AUX A. DDI A is a ghost eDP, wheres DDI E may be a real DP->VGA converter. Currently that is handled by checking the VBT child devices for conflicts before output probing. But that kind of solution will not work for the ADL phantom dual eDP VBTs. I think on those we just have to probe the eDP first. And would be nice to use the same probe scheme for everything. On these SKL systems if we probe DDI A first (which is only natural given it's declared by VBT first) we will get an answer via AUX, but it came from the DP->VGA converter hooked to the DDI E, not DDI A. Thus we mistakenly register eDP on DDI A and screw up the real DP device in DDI E. To fix this let's check the HPD live state during the eDP probe. If we got an answer via DPCD but HPD is still down let's assume we got the answer from someone else. Smoke tested on all my eDP machines (ilk,hsw-ult,tgl,adl) and I also tested turning off all HPD hardware prior to loading i915 to make sure it all comes up properly. And I simulated the failure path too by not turning on HPD sense and that correctly gave up on eDP. I *think* Windows might just fully depend on HPD here. I couldn't really find any other way they probe displays. And I did find code where they also check the live state prior to AUX transfers (something Imre and I have also talked about perhaps doing). That would also solve this as we'd not succeed in the eDP probe DPCD reads. Other solutions I've considered: - Reintrduce DDI strap checks on SKL. Unfortunately we just don't have any idea how reliable they are on real production hardware, and commit 5a2376d1360b ("drm/i915/skl: WaIgnoreDDIAStrap is forever, always init DDI A") does suggest that not very. Sadly that commit is very poor in details :/ Also the systems (Asrock B250M-HDV at least) fixed by commit 41e35ffb380b ("drm/i915: Favor last VBT child device with conflicting AUX ch/DDC pin") might still not work since we don't know what their straps indicate. Stupid me for not asking the reporter to check those at the time :( We have currently two CI machines (fi-cfl-guc,fi-cfl-8700k both MS-7B54/Z370M) that also declare both DDI A and DDI E in VBT to use AUX A, and on these the DDI A strap is also set. There doesn't seem to be anything hooked up to either DDI however. But given the DDI A strap is wrong on these it might well be wrong on the Asrock too. Most other CI machines seem to have straps that generally match the VBT. fi-kbl-soraka is an exception though as DDI D strap is not set, but it is declared in VBT as a DP++ port. No idea if there's a real physical port to go with it or not. - Some kind of quirk just for the cases where both DDI A and DDI E are present in VBT. Might be feasible given we've ignored DDI A in these cases up to now successfully. But feels rather unsatisfactory, and not very future proof against funny VBTs. References: https://bugs.freedesktop.org/show_bug.cgi?id=111966 Reviewed-by: Vinod Govindapillai Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230417131728.7705-4-ville.syrjala@linux.intel.com commit d28cdc43b43b77287d7839ef1b94fdaa24d2a444 Author: Ville Syrjälä Date: Mon Apr 17 16:17:26 2023 +0300 drm/i915: Introduce intel_hpd_enable_detection() Add a mechanism by which we can enable the HPD sense for individual encoders. This will be used during eDP probing to figure out if anything is actually connected. The normal intel_hpd_irq_setup() thing doesn't work since we only do that after probing the outputs, and we only enable HPD sense for encoders that were successfully probed. The other idea that crossed my minds was to just turn on HPD sense for all pins before output probing and let hpd_irq_setup() clean it up afterwards. But that doesn't work for BXT/GLK where the HPD invert information comes from the VBT child device. So looks like this really needs to be per-encoder. v2: Give it a better name (Jani) v3: Deal with mtl Reviewed-by: Vinod Govindapillai #v2 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230417131728.7705-3-ville.syrjala@linux.intel.com commit 40d06b0fae915ec8bbfbde69ee1cfb2d9a2b7a53 Author: Ville Syrjälä Date: Mon Apr 17 16:17:25 2023 +0300 drm/i915: Introduce _hotplug_mask() Pair each _hotplug_enables() function with a corresponding _hotplug_mask() function so that we can determine right bits to clear on a per hpd_pin basis. We'll need this for turning on HPD sense for a specific encoder rather than just all of them. v2: Drop the unused 'i915' param (Jani) v3: Drop the _foo_hotplug_enables() redirection too v4: Deal with mtp Cc: Jani Nikula Reviewed-by: Vinod Govindapillai #v3 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230417131728.7705-2-ville.syrjala@linux.intel.com commit d1f3b5e92cbab10b4710ba33e20b264c852d19aa Author: Andi Shyti Date: Tue Apr 18 01:53:56 2023 +0200 drm/i915: Make IRQ reset and postinstall multi-gt aware In multi-gt systems IRQs need to be reset and enabled per GT. This might add some redundancy when handling interrupts for engines that might not exist in every tile, but helps to keep the code cleaner and more understandable. Signed-off-by: Andi Shyti Cc: Tvrtko Ursulin Reviewed-by: Matt Roper Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230417235356.1291060-1-andi.shyti@linux.intel.com commit 088248f4b0ee089cb78a318411d23566e3737dd1 Author: Jani Nikula Date: Mon Apr 17 11:57:42 2023 +0300 drm/i915/pps: use intel_de_rmw() for panel unlock Use rmw where needed. Signed-off-by: Jani Nikula Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230417085742.793379-1-jani.nikula@intel.com commit 4aa35a0130d6b8afbefc9ef530a521fb0fb9b8e1 Author: Markus Elfring Date: Sun Apr 16 10:50:12 2023 +0200 drm/nouveau/therm: Move an assignment statement behind a null pointer check in two functions The address of a data structure member was determined before a corresponding null pointer check in the implementation of the functions “nvkm_fanpwm_create” and “nvkm_fantog_create”. Thus avoid the risk for undefined behaviour by moving the assignment for the data structure member “fan” behind two null pointer checks. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/3d0215dc-74d4-2c42-2eee-7a5fcf62b9f1@web.de commit 8a89e1323d7dc90fa551cf2167ab838013641788 Author: Markus Elfring Date: Sun Apr 16 08:45:31 2023 +0200 drm/nouveau/pci: Move an expression into a function call parameter in nvkm_pcie_set_link() The variable “pbus” was read only once in the implementation of the function “nvkm_pcie_set_link”. Thus move the usage of an expression into a parameter for a function call. Signed-off-by: Markus Elfring Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/04e2c1f5-26c7-9a23-5861-3d8757556cdd@web.de commit 488c1ce6a8f3d46e20440b2e240e096a20259fcc Author: Markus Elfring Date: Sun Apr 16 08:18:40 2023 +0200 drm/nouveau/pci: Move a variable assignment behind condition checks in nvkm_pcie_set_link() The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “nvkm_pcie_set_link”. Thus avoid the risk for undefined behaviour by moving the assignment for the variable “subdev” behind some condition checks. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/b31019b1-bb73-ed93-3378-e551e17a4f32@web.de commit 41239aa4f751fbc39481a4af726faa347a26da83 Author: Markus Elfring Date: Sun Apr 16 07:45:54 2023 +0200 drm/nouveau/clk: Move a variable assignment behind a null pointer check in nvkm_pstate_new() The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “nvkm_pstate_new”. Thus avoid the risk for undefined behaviour by moving the assignment for the variable “cstate” behind the null pointer check. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/6435d829-2c9b-a3f7-c8cd-cf923508a092@web.de commit 5149545dbcbb15105312014201b9c0aa859c6044 Author: Markus Elfring Date: Sat Apr 15 22:30:30 2023 +0200 drm/nouveau/bios/power_budget: Move an expression into a macro call parameter in nvbios_power_budget_header() The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “nvbios_power_budget_header”. Thus avoid the risk for undefined behaviour by moving the usage of an expression into a parameter for a macro call in one if branch. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/529fe82e-59f0-71a2-1e33-b051f833b67c@web.de commit 6ef481d45f8b37dc9cca11d7126bd2c99e8a0943 Author: Markus Elfring Date: Sat Apr 15 22:02:31 2023 +0200 drm/nouveau/debugfs: Replace five seq_printf() calls by seq_puts() in nouveau_debugfs_pstate_get() Five strings which did not contain a data format specification should be put into a sequence. Thus use the corresponding function “seq_puts”. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/bdee7e41-094a-91d1-3f6f-56df402d70b7@web.de commit df8133d0c3e53e98df3c78c30f31530f580f1bce Author: Markus Elfring Date: Sat Apr 15 21:48:47 2023 +0200 drm/nouveau/debugfs: Use seq_putc() in nouveau_debugfs_pstate_get() A single character (line break) should be put into a sequence. Thus use the corresponding function “seq_putc”. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/e6f9b34e-58d9-b1aa-8b12-8d4a55153d1d@web.de commit e1b570db8687c993e7a87516387a3bb3b5e63ac6 Author: Markus Elfring Date: Sat Apr 15 21:24:43 2023 +0200 drm/nouveau/debugfs: Move a variable assignment behind a null pointer check in nouveau_debugfs_pstate_get() The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “nouveau_debugfs_pstate_get”. Thus avoid the risk for undefined behaviour by moving the assignment for the variable “ctrl” behind the null pointer check. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/5b7b99f7-1692-74e5-4b1e-cfa14dad7c57@web.de commit 3778724bec53a3585cde6aed8c75ae3f085c3dcb Author: Markus Elfring Date: Sat Apr 15 21:06:06 2023 +0200 drm/nouveau/debugfs: Move an expression into a function call parameter in nouveau_debugfs_pstate_set() The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “nouveau_debugfs_pstate_set”. Thus avoid the risk for undefined behaviour by moving the usage of an expression into a parameter for a function call at the end. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/1903e057-57d3-e12e-da37-008e23afd2e2@web.de commit 4f048de28b90abefff2044f450e882576eb746e9 Author: Konrad Dybcio Date: Mon Apr 17 16:39:06 2023 +0200 drm/panel: nt36523: Add Lenovo J606F panel Some Lenovo J606F tablets come with a 2K (2000x1200) 60Hz 11" 5:3 video mode display. Add support for these panels. Reviewed-by: Linus Walleij Reviewed-by: Jianhua Lu Signed-off-by: Konrad Dybcio Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230412-topic-lenovopanel-v3-4-bcf9ba4de46f@linaro.org commit 1eae88fa7b56b3b02d0e003a737fc31d71f3f486 Author: Konrad Dybcio Date: Mon Apr 17 16:39:05 2023 +0200 drm/panel: nt36523: Get orientation from OF Some bright vendors mount their display panels upside down. Add the required pieces to allow for accounting for that. Reviewed-by: Linus Walleij Reviewed-by: Jianhua Lu Signed-off-by: Konrad Dybcio Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230412-topic-lenovopanel-v3-3-bcf9ba4de46f@linaro.org commit aecb583cb997935fb4f4a667a8013469528a8d53 Author: Konrad Dybcio Date: Mon Apr 17 16:39:04 2023 +0200 drm/panel: nt36523: Add DCS backlight support This chip supports controlling the backlight via DCS commands, on at least some panels. Add support for doing so. Note this may only concern the NT36523*W* variant. Nobody knows, really, there's no docs. Reviewed-by: Linus Walleij Reviewed-by: Jianhua Lu Signed-off-by: Konrad Dybcio Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230412-topic-lenovopanel-v3-2-bcf9ba4de46f@linaro.org commit b4b26ab24f8f9ad3aa9fbdfd211e51b051ddb91e Author: Konrad Dybcio Date: Mon Apr 17 16:39:03 2023 +0200 dt-bindings: display: panel: nt36523: Add Lenovo J606F panel Some Lenovo J606F tablets come with a 2K (2000x1200) 60Hz 11" 5:3 video mode display. Document it and allow rotation while at it (Lenovo mounted it upside down!). Reviewed-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230412-topic-lenovopanel-v3-1-bcf9ba4de46f@linaro.org commit 62bb6b4920ce9d9a7cc365c4e1cc13134cd1cc24 Author: Jani Nikula Date: Fri Apr 14 12:42:02 2023 +0300 drm/i915/display: add intel_display_driver_early_probe() Add intel_display_driver_early_probe() as the early probe call to replace intel_init_display_hooks(). The latter will be "demoted" to setting up hooks in intel_display.c only. Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/0b02311e5343527b501b44671d2188f2a1b30a7d.1681465222.git.jani.nikula@intel.com commit cde4bd87863124fb6feee35b7f73552f5e75ea61 Author: Jani Nikula Date: Fri Apr 14 12:42:01 2023 +0300 drm/i915/display: rename intel_display_driver_suspend/resume functions Follow the usual naming conventions. Switch to i915 arguments and naming while at it. Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/cdd4228337678609967ed176dcfc9690de5d490b.1681465222.git.jani.nikula@intel.com commit 3183b9ebad7d3f1d711f152222577116ca08b299 Author: Jani Nikula Date: Fri Apr 14 12:42:00 2023 +0300 drm/i915/display: move display suspend/resume to intel_display_driver.[ch] High level display functionality only called from driver top level code. Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/11fdd82437370d8f341cd546d546de5e934c000f.1681465222.git.jani.nikula@intel.com commit 59c6106e274dbafd9d25357585ae5ede4b6673dd Author: Jani Nikula Date: Fri Apr 14 12:41:59 2023 +0300 drm/i915/display: add intel_display_reset.[ch] Split out the display reset functionality to a separate file to declutter intel_display.c. Rename the functions accordingly. The minor downside is having to expose __intel_display_resume(). Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/5e98e2fc5f0c09490e02d22250c8201342852288.1681465222.git.jani.nikula@intel.com commit 86a1758d751de03e8f3d8810fe22eaf571798871 Author: Jani Nikula Date: Fri Apr 14 12:41:58 2023 +0300 drm/i915/display: rename intel_display_driver_* functions Follow the usual naming conventions. v2: - Also rename references in comments (Gustavo) Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/6ff7b76018bf4cf611037d7bf027c975cddfe2af.1681465222.git.jani.nikula@intel.com commit 40053823baadce4e300cb011ac4e3d16be93bf6a Author: Jani Nikula Date: Fri Apr 14 12:41:57 2023 +0300 drm/i915/display: move modeset probe/remove functions to intel_display_driver.c High level display functionality only called from driver top level code. v2: - Remove unnecessary declarations for intel_sanitize_watermarks() and intel_atomic_check() (Gustavo) Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/c00df5cfc233520bc28dd972296197a8a619a6a0.1681465222.git.jani.nikula@intel.com commit 15e4f0b541d4c0b2144955111a1b37b5bfabbf63 Author: Jani Nikula Date: Fri Apr 14 12:41:56 2023 +0300 drm/i915/display: rename intel_modeset_probe_defer() -> intel_display_driver_probe_defer() Follow the usual naming conventions. Reviewed-by: Gustavo Sousa Reviewed-by: Lucas De Marchi Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/ab5023570d8ae55c0d9c98c78f588e51c0790b6c.1681465222.git.jani.nikula@intel.com commit ff2c80be1a002ae268ee78e3cf183b89c1aef77c Author: Jani Nikula Date: Fri Apr 14 12:41:55 2023 +0300 drm/i915/display: move intel_modeset_probe_defer() to intel_display_driver.[ch] High level display functionality only called from driver top level code. Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/831ed4d0356b51526704269038a6d2d72739e779.1681465222.git.jani.nikula@intel.com commit 77316e7552137e1ed1ac3d719be844f36756eb1c Author: Jani Nikula Date: Fri Apr 14 12:41:54 2023 +0300 drm/i915/display: start high level display driver file The only way to truly clean up intel_display.[ch] is to move stuff out of them until there's absolutely nothing left. Start moving the high level display driver entry points, i.e. functions called from top level driver code only, to a new file, which we'll call intel_display_driver.c. The intention is that there's no low-level display code or details here. This is an in-between layer. Initially, move intel_display_driver_register() and intel_display_driver_unregister() there. Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/e42cc037881a4c6042948a34bd4a9698f9e8487c.1681465222.git.jani.nikula@intel.com commit ae52dd7d6d933511c90d129addfc629feff147b5 Author: Jani Nikula Date: Fri Apr 14 12:41:53 2023 +0300 drm/i915/display: remove intel_display_commit_duplicated_state() This seems like an unnecessary wrapper layer. Removing it will be helpful later. Reviewed-by: Gustavo Sousa Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/a38f08e259221d71314ce6d764431147b0fba218.1681465222.git.jani.nikula@intel.com commit e28f6966ac8021d8b677fe3839361db8c9344206 Author: Sui Jingfeng Date: Sun Apr 16 22:38:49 2023 +0800 dma-buf/dma-resv.c: fix a typo The dma_resv_wait_timeout() function return a value greater than zero on success. Signed-off-by: Sui Jingfeng Reviewed-by: Christian König Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230416143849.1142779-1-suijingfeng@loongson.cn commit 7f6f26d7adee150e09d7537acc6d6894c27c0b7a Merge: 116b1c5a364bc afa351a15d809 Author: Thomas Zimmermann Date: Sun Apr 16 18:50:39 2023 +0200 Merge drm/drm-next into drm-misc-next Backmerging drm-next to sync with msm tree. Resolves a conflict between aperture-helper changes and msm's use of those interfaces. Signed-off-by: Thomas Zimmermann commit 116b1c5a364bcbdc40be64d4f3ec9dbc32e264dd Author: Thomas Zimmermann Date: Thu Apr 6 15:21:09 2023 +0200 video/aperture: Provide a VGA helper for gma500 and internal use The hardware for gma500 is different from the rest, as it uses stolen framebuffer memory that is not available via PCI BAR. The regular PCI removal helper cannot detect the framebuffer, while the non-PCI helper misses possible conflicting VGA devices (i.e., a framebuffer or text console). Gma500 therefore calls both helpers to catch all cases. It's confusing as it implies that there's something about the PCI device that requires ownership management. The relationship between the PCI device and the VGA devices is non-obvious. At worst, readers might assume that calling two functions for clearing aperture ownership is a bug in the driver. Hence, move the PCI removal helper's code for VGA functionality into a separate function and call this function from gma500. Documents the purpose of each call to aperture helpers. The change contains comments and example code form the discussion at [1]. v5: * fix grammar in gma500 comment (Javier) Signed-off-by: Thomas Zimmermann Link: https://patchwork.kernel.org/project/dri-devel/patch/20230404201842.567344-1-daniel.vetter@ffwll.ch/ # 1 Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-10-tzimmermann@suse.de commit 5ca1479cd35d9003040e6ac829380debe89b802b Author: Daniel Vetter Date: Thu Apr 6 15:21:08 2023 +0200 fbdev: Simplify fb_is_primary_device for x86 vga_default_device really is supposed to cover all corners, at least for x86. Additionally checking for rom shadowing should be redundant, because the bios/fw only does that for the boot vga device. If this turns out to be wrong, then most likely that's a special case which should be added to the vgaarb code, not replicated all over. Patch motived by changes to the aperture helpers, which also have this open code in a bunch of places, and which are all removed in a clean-up series. This function here is just for selecting the default fbdev device for fbcon, but I figured for consistency it might be good to throw this patch in on top. Note that the shadow rom check predates vgaarb, which was only wired up in commit 88674088d10c ("x86: Use vga_default_device() when determining whether an fb is primary"). That patch doesn't explain why we still fall back to the shadow rom check. v4: - fix commit message style (i.e., commit 1234 ("...")) - fix Daniel's S-o-b address v5: - add back an S-o-b tag with Daniel's Intel address Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Cc: Daniel Vetter Cc: Helge Deller Cc: Daniel Vetter Cc: Javier Martinez Canillas Cc: Thomas Zimmermann Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-9-tzimmermann@suse.de commit 5ae3716cfdcd286268133867f67d0803847acefc Author: Daniel Vetter Date: Thu Apr 6 15:21:07 2023 +0200 video/aperture: Only remove sysfb on the default vga pci device Instead of calling aperture_remove_conflicting_devices() to remove the conflicting devices, just call to aperture_detach_devices() to detach the device that matches the same PCI BAR / aperture range. Since the former is just a wrapper of the latter plus a sysfb_disable() call, and now that's done in this function but only for the primary devices. This fixes a regression introduced by commit ee7a69aa38d8 ("fbdev: Disable sysfb device registration when removing conflicting FBs"), where we remove the sysfb when loading a driver for an unrelated pci device, resulting in the user losing their efifb console or similar. Note that in practice this only is a problem with the nvidia blob, because that's the only gpu driver people might install which does not come with an fbdev driver of it's own. For everyone else the real gpu driver will restore a working console. Also note that in the referenced bug there's confusion that this same bug also happens on amdgpu. But that was just another amdgpu specific regression, which just happened to happen at roughly the same time and with the same user-observable symptoms. That bug is fixed now, see https://bugzilla.kernel.org/show_bug.cgi?id=216331#c15 Note that we should not have any such issues on non-pci multi-gpu issues, because I could only find two such cases: - SoC with some external panel over spi or similar. These panel drivers do not use drm_aperture_remove_conflicting_framebuffers(), so no problem. - vga+mga, which is a direct console driver and entirely bypasses all this. For the above reasons the cc: stable is just notionally, this patch will need a backport and that's up to nvidia if they care enough. v2: - Explain a bit better why other multi-gpu that aren't pci shouldn't have any issues with making all this fully pci specific. v3 - polish commit message (Javier) v4: - Fix commit message style (i.e., commit 1234 ("...")) - fix Daniel's S-o-b address v5: - add back an S-o-b tag with Daniel's Intel address Fixes: ee7a69aa38d8 ("fbdev: Disable sysfb device registration when removing conflicting FBs") Tested-by: Aaron Plattner Reviewed-by: Javier Martinez Canillas Link: https://bugzilla.kernel.org/show_bug.cgi?id=216303#c28 Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Cc: Aaron Plattner Cc: Javier Martinez Canillas Cc: Thomas Zimmermann Cc: Helge Deller Cc: Sam Ravnborg Cc: Alex Deucher Cc: # v5.19+ (if someone else does the backport) Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-8-tzimmermann@suse.de commit 5fbcc6708fe32ef80122cd2a59ddca9d18b24d6e Author: Daniel Vetter Date: Thu Apr 6 15:21:06 2023 +0200 video/aperture: Drop primary argument With the preceding patches it's become defunct. Also I'm about to add a different boolean argument, so it's better to keep the confusion down to the absolute minimum. v2: Since the hypervfb patch got droppped (it's only a pci device for gen1 vm, not for gen2) there is one leftover user in an actual driver left to touch. v4: - fixes to commit message - fix Daniel's S-o-b address v5: - add back an S-o-b tag with Daniel's Intel address Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Wei Liu Cc: Dexuan Cui Cc: linux-hyperv@vger.kernel.org Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-7-tzimmermann@suse.de commit f1d599d315fb7b7343cddaf365e671aaa8453aca Author: Daniel Vetter Date: Thu Apr 6 15:21:05 2023 +0200 video/aperture: Move vga handling to pci function A few reasons for this: - It's really the only one where this matters. I tried looking around, and I didn't find any non-pci vga-compatible controllers for x86 (since that's the only platform where we had this until a few patches ago), where a driver participating in the aperture claim dance would interfere. - I also don't expect that any future bus anytime soon will not just look like pci towards the OS, that's been the case for like 25+ years by now for practically everything (even non non-x86). - Also it's a bit funny if we have one part of the vga removal in the pci function, and the other in the generic one. v2: Rebase. v4: - fix Daniel's S-o-b address v5: - add back an S-o-b tag with Daniel's Intel address Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-6-tzimmermann@suse.de commit 7450cd235b45d43ee6f3c235f89e92623458175d Author: Daniel Vetter Date: Thu Apr 6 15:21:04 2023 +0200 video/aperture: Only kick vgacon when the pdev is decoding vga Otherwise it's a bit silly, and we might throw out the driver for the screen the user is actually looking at. I haven't found a bug report for this case yet, but we did get bug reports for the analog case where we're throwing out the efifb driver. v2: Flip the check around to make it clear it's a special case for kicking out the vgacon driver only (Thomas) v4: - fixes to commit message - fix Daniel's S-o-b address v5: - add back an S-o-b tag with Daniel's Intel address Link: https://bugzilla.kernel.org/show_bug.cgi?id=216303 Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-5-tzimmermann@suse.de commit 62aeaeaa1b267c5149abee6b45967a5df3feed58 Author: Daniel Vetter Date: Thu Apr 6 15:21:03 2023 +0200 drm/aperture: Remove primary argument Only really pci devices have a business setting this - it's for figuring out whether the legacy vga stuff should be nuked too. And with the preceding two patches those are all using the pci version of this. Which means for all other callers primary == false and we can remove it now. v2: - Reorder to avoid compile fail (Thomas) - Include gma500, which retained it's called to the non-pci version. v4: - fix Daniel's S-o-b address v5: - add back an S-o-b tag with Daniel's Intel address Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Deepak Rawat Cc: Neil Armstrong Cc: Kevin Hilman Cc: Jerome Brunet Cc: Martin Blumenstingl Cc: Thierry Reding Cc: Jonathan Hunter Cc: Emma Anholt Cc: Helge Deller Cc: David Airlie Cc: Daniel Vetter Cc: linux-hyperv@vger.kernel.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-tegra@vger.kernel.org Cc: linux-fbdev@vger.kernel.org Acked-by: Martin Blumenstingl Acked-by: Thierry Reding Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-4-tzimmermann@suse.de commit db082219569e3392cd38c9e322151450c855eed4 Author: Daniel Vetter Date: Thu Apr 6 15:21:02 2023 +0200 video/aperture: use generic code to figure out the vga default device Since vgaarb has been promoted to be a core piece of the pci subsystem we don't have to open code random guesses anymore, we actually know this in a platform agnostic way, and there's no need for an x86 specific hack. See also commit 1d38fe6ee6a8 ("PCI/VGA: Move vgaarb to drivers/pci") This should not result in any functional change, and the non-x86 multi-gpu pci systems are probably rare enough to not matter (I don't know of any tbh). But it's a nice cleanup, so let's do it. There's been a few questions on previous iterations on dri-devel and irc: - fb_is_primary_device() seems to be yet another implementation of this theme, and at least on x86 it checks for both vga_default_device OR rom shadowing. There shouldn't ever be a case where rom shadowing gives any additional hints about the boot vga device, but if there is then the default vga selection in vgaarb should probably be fixed. And not special-case checks replicated all over. - Thomas also brought up that on most !x86 systems fb_is_primary_device() returns 0, except on sparc/parisc. But these 2 special cases are about platform specific devices and not pci, so shouldn't have any interactions. - Furthermore fb_is_primary_device() is a bit a red herring since it's only used to select the right fbdev driver for fbcon, and not for the fw handover dance which the aperture helpers handle. At least for x86 we might want to look into unifying them, but that's a separate thing. v2: Extend commit message trying to summarize various discussions. v4: - make the test for the primary device easier to read (Javier) - fix commit message style (i.e., commit 1234 ("...")) - fix Daniel's S-o-b address v5: - add back an S-o-b tag with Daniel's Intel address Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-3-tzimmermann@suse.de commit 80e993988b97fe794f3ec2be6db05fe30f9353c3 Author: Daniel Vetter Date: Thu Apr 6 15:21:01 2023 +0200 drm/gma500: Use drm_aperture_remove_conflicting_pci_framebuffers This one nukes all framebuffers, which is a bit much. In reality gma500 is igpu and never shipped with anything discrete, so there should not be any difference. v2: Unfortunately the framebuffer sits outside of the pci bars for gma500, and so only using the pci helpers won't be enough. Otoh if we only use non-pci helper, then we don't get the vga handling, and subsequent refactoring to untangle these special cases won't work. It's not pretty, but the simplest fix (since gma500 really is the only quirky pci driver like this we have) is to just have both calls. v4: - fix Daniel's S-o-b address v5: - add back an S-o-b tag with Daniel's Intel address Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Thomas Zimmermann Cc: Patrik Jakobsson Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-2-tzimmermann@suse.de commit dae2f7b89a8436351a2982d0d96a8a56accca576 Author: Dan Carpenter Date: Wed Mar 22 12:06:55 2023 +0300 drm/imx/lcdc: fix a NULL vs IS_ERR() bug in probe The devm_drm_dev_alloc() function returns error pointers. It never returns NULL. Fix the check. Fixes: c87e859cdeb5 ("drm/imx/lcdc: Implement DRM driver for imx25") Signed-off-by: Dan Carpenter Reviewed-by: Uwe Kleine-König Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/d0a1fc55-3ef6-444e-b3ef-fdc937d8d57a@kili.mountain commit 8bfbdadce85c4c51689da10f39c805a7106d4567 Author: Cong Liu Date: Sat Apr 15 00:41:09 2023 +0200 drm/i915: Fix memory leaks in i915 selftests This patch fixes memory leaks on error escapes in function fake_get_pages Fixes: c3bfba9a2225 ("drm/i915: Check for integer truncation on scatterlist creation") Signed-off-by: Cong Liu Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230414224109.1051922-1-andi.shyti@linux.intel.com commit e920aabf8348de4160301b029b13d72eae0531d5 Author: Ville Syrjälä Date: Fri Apr 14 22:01:59 2023 +0300 drm/i915: Make intel_{mpllb,c10pll}_state_verify() safer intel_{mpllb,c10pll}_state_verify() blows up if you call them for a non-modeset/fastset commit on account of the relevant connector not being part of the overall atomic state. Currently the state checker only runs for modeset/fastset commits, but for testing purposes it is sometimes desirable to run it for other commits too. Check for modeset/fastset in intel_{mpllb,c10pll}_state_verify() itself to make this safe. v2: Give the new intel_c10pll_state_verify() the same treatment Add comment to explain why we do this Reviewed-by: Jani Nikula #v1 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230414190159.7904-1-ville.syrjala@linux.intel.com commit ebb7619d3ac85d7aae0a5e8d7038d32211ca7dba Author: Fabio Estevam Date: Mon Apr 3 23:01:29 2023 -0300 drm/bridge: fsl-ldb: Add i.MX6SX support i.MX6SX has a single LVDS port and share a similar LDB_CTRL register layout with i.MX8MP and i.MX93. There is no LVDS CTRL register on the i.MX6SX, so only write to this register on the appropriate SoCs. Add support for the i.MX6SX LDB. Tested on a imx6sx-sdb board with a Hannstar HSD100PXN1 LVDS panel and also on a custom i.MX6SX-based board. Signed-off-by: Fabio Estevam Reviewed-by: Neil Armstrong Reviewed-by: Marek Vasut Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20230404020129.509356-2-festevam@gmail.com commit f85f2ce57783913a23f21b9d3d03a27357c07c3a Author: Fabio Estevam Date: Mon Apr 3 23:01:28 2023 -0300 dt-bindings: display: bridge: ldb: Add an i.MX6SX entry i.MX6SX has a single LVDS port and share a similar LDB_CTRL register layout with i.MX8MP and i.MX93. Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski Reviewed-by: Marek Vasut Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20230404020129.509356-1-festevam@gmail.com commit 3b6692357f70498f617ea1b31a0378070a0acf1c Author: Ville Syrjälä Date: Thu Apr 13 23:06:02 2023 +0300 drm/i915: Make intel_get_crtc_new_encoder() less oopsy The point of the WARN was to print something, not oops straight up. Currently that is precisely what happens if we can't find the connector for the crtc in the atomic state. Get the dev pointer from the atomic state instead of the potentially NULL encoder to avoid that. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230413200602.6037-2-ville.syrjala@linux.intel.com Fixes: 3a47ae201e07 ("drm/i915/display: Make WARN* drm specific where encoder ptr is available") Reviewed-by: Jani Nikula commit adfbae9ffe339eed08d54a4eb87c93f4b35f214b Author: Lucas De Marchi Date: Thu Apr 13 13:03:49 2023 -0700 drm/i915/gt: Avoid out-of-bounds access when loading HuC When HuC is loaded by GSC, there is no header definition for the kernel to look at and firmware is just handed to GSC. However when reading the version, it should still check the size of the blob to guarantee it's not incurring into out-of-bounds array access. If firmware is smaller than expected, the following message is now printed: # echo boom > /lib/firmware/i915/dg2_huc_gsc.bin # dmesg | grep -i huc [drm] GT0: HuC firmware i915/dg2_huc_gsc.bin: invalid size: 5 < 184 [drm] *ERROR* GT0: HuC firmware i915/dg2_huc_gsc.bin: fetch failed -ENODATA ... Even without this change the size, header and signature are still checked by GSC when loading, so this only avoids the out-of-bounds array access. Fixes: a7b516bd981f ("drm/i915/huc: Add fetch support for gsc-loaded HuC binary") Cc: Daniele Ceraolo Spurio Cc: Alan Previn Signed-off-by: Lucas De Marchi Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230413200349.3492571-1-lucas.demarchi@intel.com commit 764739d8cef28a3c926bb58a63894a162d9997a2 Author: Clint Taylor Date: Thu Apr 13 14:24:43 2023 -0700 drm/i915/mtl: Initial DDI port setup Initialization sequences and C10 phy are in place to be able to enable the first 2 ports of MTL. The other ports use C20 phy that still need to be properly added. Enable the first ports for now, keeping a TODO comment about the others. Reviewed-by: Lucas De Marchi Signed-off-by: Radhakrishna Sripada Signed-off-by: Clint Taylor Link: https://patchwork.freedesktop.org/patch/msgid/20230413212443.1504245-10-radhakrishna.sripada@intel.com commit b66a8abaa48accd3d4b93c1820bbd995fa26ed78 Author: Ankit Nautiyal Date: Thu Apr 13 14:24:42 2023 -0700 drm/i915/display/mtl: Fill port width in DDI_BUF_/TRANS_DDI_FUNC_/PORT_BUF_CTL for HDMI MTL requires the PORT_CTL_WIDTH, TRANS_DDI_FUNC_CTL and DDI_BUF_CTL to be filled with 4 lanes for TMDS mode. This patch enables D2D link and fills PORT_WIDTH in appropriate registers. v2: - Added fixes from Clint's Add HDMI implementation changes. - Modified commit message. v3: - Use TRANS_DDI_PORT_WIDTH() instead of DDI_PORT_WIDTH() for the value of TRANS_DDI_FUNC_CTL_*. (Gustavo) Cc: Taylor, Clinton A Signed-off-by: Ankit Nautiyal Signed-off-by: Radhakrishna Sripada Signed-off-by: Mika Kahola Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230413212443.1504245-9-radhakrishna.sripada@intel.com commit 5836bc5f8d3113ccdda2a10fb86344a9f03698ca Author: Radhakrishna Sripada Date: Thu Apr 13 14:24:41 2023 -0700 drm/i915/mtl: Add C10 phy programming for HDMI Like DG2, we still don't have a proper algorithm that can be used for calculating PHY settings, but we do have tables of register values for a handful of the more common link rates. Some support is better than none, so let's go ahead and add/use these tables when we can, and also add some logic to hdmi_port_clock_valid() to filter the modelist to just the modes we can actually support with these link rates. Hopefully we'll have a proper / non-encumbered algorithm to calculate these registers by the time we upstream and we'll be able to replace this patch with something more general purpose. Bspec: 64568 v2: Rebasing with Clint's HDMI C10 PLL tables (Mika) v3: Remove the extra hdmi clock check pruning. Cc: Imre Deak Cc: Uma Shankar Signed-off-by: Radhakrishna Sripada Signed-off-by: Clint Taylor Signed-off-by: Mika Kahola Signed-off-by: Ankit Nautiyal Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230413212443.1504245-8-radhakrishna.sripada@intel.com commit 23ef61946374a9ba52ae051cbc95e82f054ea16b Author: José Roberto de Souza Date: Thu Apr 13 14:24:40 2023 -0700 drm/i915/mtl/display: Implement DisplayPort sequences The differences between MTL and TGL DP sequences are big enough to MTL have its own functions. Also it is much easier to follow MTL sequences against spec with its own functions. One change worthy to mention is the move of 'intel_display_power_get(dev_priv, dig_port->ddi_io_power_domain)'. This call is not necessary for MTL but we have _put() counter part in intel_ddi_post_disable_dp() that needs to balanced. We could add a display version check on it but instead here it is moving it to intel_ddi_pre_enable_dp() so it is executed for all platforms in a single place and this will not cause any harm in MTL and newer platforms. v2: - Fix logic to wait for buf idle. - Use the right register to wait for ddi active.(RK) v3: - Increase wait timeout for ddi buf active (Mika) v4: - Increase idle timeout for ddi buf idle (Mika) v5: use rmw in mtl_disable_ddi_buf. Donot clear link training mask(Imre) BSpec: 65448 65505 Cc: Matt Roper Cc: Satyeshwar Singh Cc: Clint Taylor Cc: Ankit Nautiyal Cc: Imre Deak Signed-off-by: Radhakrishna Sripada Signed-off-by: José Roberto de Souza Signed-off-by: Mika Kahola Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230413212443.1504245-7-radhakrishna.sripada@intel.com commit babde06db8858a4fdb4ab3c64e442885487dbd8c Author: Mika Kahola Date: Thu Apr 13 14:24:39 2023 -0700 drm/i915/mtl: MTL PICA hotplug detection PICA is used for DP alt mode and TBT modes. Hotplug interruption is routed from PICA chip to south display engine and from there to north display engine. This patch adds functionality to enable hotplug detection for all Type-C ports (4 ports available). Differently from HPD in south display, PICA provides a dedicated HPD control register for each supported port, so we loop over ports ourselves instead of using intel_hpd_hotplug_enables() or intel_get_hpd_pins(). BSpec: 49305, 55726, 65107, 65300 Reviewed-by: Imre Deak Signed-off-by: Madhumitha Tolakanahalli Pradeep Signed-off-by: Gustavo Sousa Signed-off-by: Radhakrishna Sripada Signed-off-by: Mika Kahola Link: https://patchwork.freedesktop.org/patch/msgid/20230413212443.1504245-6-radhakrishna.sripada@intel.com commit ea8af87ae6be578b3b633ad6aa9188b0ce4cd7ee Author: Mika Kahola Date: Thu Apr 13 14:24:38 2023 -0700 drm/i915/mtl: Add vswing programming for C10 phys C10 phys uses direct mapping internally for voltage and pre-emphasis levels. Program the levels directly to the fields in the VDR Registers. Bspec: 65449 v2: From table "C10: Tx EQ settings for DP 1.4x" it shows level 1 and preemphasis 1 instead of two times of level 1 preemphasis 0. Fix this in the driver code as well. v3: VSwing update (Clint) v4: Add vboost termination ctl programming(Imre) Fix tx llogic and other nits Restrict C10 vdr ctl register access for C10 phy(RK) v5: Program vboots, termination ctl for both lanes(Imre) Cc: Imre Deak Cc: Uma Shankar Signed-off-by: Clint Taylor Signed-off-by: Radhakrishna Sripada Signed-off-by: Mika Kahola Reviewed-by: Imre Deak (v3) Link: https://patchwork.freedesktop.org/patch/msgid/20230413212443.1504245-5-radhakrishna.sripada@intel.com commit 51390cc0e00a378b7c152bb6f63efc0a01b59d20 Author: Radhakrishna Sripada Date: Thu Apr 13 14:24:37 2023 -0700 drm/i915/mtl: Add Support for C10 PHY message bus and pll programming XELPDP has C10 and C20 phys from Synopsys to drive displays. Each phy has a dedicated PIPE 5.2 Message bus for configuration. This message bus is used to configure the phy internal registers. XELPDP has C10 phys to drive output to the EDP and the native output from the display engine. Add structures, programming hardware state readout logic. Port clock calculations are similar to DG2. Use the DG2 formulae to calculate the port clock but use the relevant pll signals. Note: PHY lane 0 is always used for PLL programming. Add sequences for C10 phy enable/disable phy lane reset, powerdown change sequence and phy lane programming. Bspec: 64539, 64568, 64599, 65100, 65101, 65450, 65451, 67610, 67636 v2: Squash patches related to C10 phy message bus and pll programming support (Jani) Move register definitions to a new file i.e. intel_cx0_reg_defs.h (Jani) Move macro definitions (Jani) DP rates as separate patch (Jani) Spin out xelpdp register definitions into a separate file (Jani) Replace macro to select registers based on phy lane with function calls (Jani) Fix styling issues (Jani) Call XELPDP_PORT_P2M_MSGBUS_STATUS() with port instead of phy (Lucas) v3: Move clear request flag into try-loop v4: On PHY idle change drm_err_once() as drm_dbg_kms() (Jani) use __intel_de_wait_for_register() instead of __intel_wait_for_register and uncomment intel_uncore.h (Jani) Add DP-alt support for PHY lane programming (Khaled) v4: Add tx and cmn on c10mpllb_state (Imre) Add missing waits for pending transactions between two message bus writes (Imre) General cleanups and simplifications (Imre) v5: Few nit cleanups from rev4 (imre) s/dev_priv/i915/ , s/c10mpllb/c10pll/ (RK) Rebase v6: Move the mtl code from intel_c10pll_calc_port_clock to mtl function Fix typo in comment for REG_FIELD_PREP8 definition(Imre) Cc: Mika Kahola Cc: Imre Deak Cc: Uma Shankar Cc: Gustavo Sousa Signed-off-by: Radhakrishna Sripada Signed-off-by: Mika Kahola Reviewed-by: Imre Deak (v4) Link: https://patchwork.freedesktop.org/patch/msgid/20230413212443.1504245-4-radhakrishna.sripada@intel.com commit a42e65f33c38e3b0191cf6a1bc8ebb6c8289127d Author: Mika Kahola Date: Thu Apr 13 14:24:36 2023 -0700 drm/i915/mtl: Create separate reg file for PICA registers Create a separate file to store registers for PICA chips C10 and C20. v2: Rename file (Jani) v3: Use _PICK_EVEN_2RANGES() macro (Lucas) Coding style fixed (Lucas) v4: Redefine macros (Imre) Reviewed-by: Vinod Govindapillai Signed-off-by: Radhakrishna Sripada Signed-off-by: Mika Kahola Link: https://patchwork.freedesktop.org/patch/msgid/20230413212443.1504245-3-radhakrishna.sripada@intel.com commit 7cb3eb334b8c2a06f780abcf38bffbd9efa4cec1 Author: Mika Kahola Date: Thu Apr 13 14:24:35 2023 -0700 drm/i915/mtl: Add DP rates Add DP rates for Meteorlake. Reviewed-by: Vinod Govindapillai Signed-off-by: Radhakrishna Sripada Signed-off-by: Mika Kahola Link: https://patchwork.freedesktop.org/patch/msgid/20230413212443.1504245-2-radhakrishna.sripada@intel.com commit 446a20c9ba622bb531f1705eab88b64d478ee434 Author: Jani Nikula Date: Tue Apr 11 13:56:43 2023 +0300 drm/i915: hide mkwrite_device_info() better The goal has been to just make device info a pointer to static const data, i.e. the static const structs in i915_pci.c. See [1]. However, there were issues with intel_device_info_runtime_init() clearing the display sub-struct of device info on the !HAS_DISPLAY() path, which consequently disables a lot of display functionality, like it should. Looks like we'd have to cover all those paths, and maybe sprinkle HAS_DISPLAY() checks in them, which we haven't gotten around to. In the mean time, hide mkwrite_device_info() better within intel_device_info.c by adding a intel_device_info_driver_create() for the very early initialization of the device info and initial runtime info. This also lets us declutter i915_drv.h a bit, and stops promoting mkwrite_device_info() as something that could be used. [1] https://lore.kernel.org/r/a0422f0a8ac055f65b7922bcd3119b180a41e79e.1655712106.git.jani.nikula@intel.com Signed-off-by: Jani Nikula Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20230411105643.292416-1-jani.nikula@intel.com commit d7c281eecec0699449ca9ecfff82fe056dddb488 Author: Bhanuprakash Modem Date: Thu Apr 13 17:15:02 2023 +0530 drm/i915/debugfs: New debugfs for display clock frequencies Instead of mixing display & non-display stuff together, move display specific clock info to new debugfs. This patch will create a new debugfs "i915_cdclk_info" to expose Current & Max cdclk and Max pixel clock frequency info. Example: $ cat /sys/kernel/debug/dri/0/i915_cdclk_info Current CD clock frequency: 163200 kHz Max CD clock frequency: 652800 kHz Max pixel clock frequency: 1305600 kHz V2: - s/i915_display_clock_info/i915_cdclk_info/ (Jani) - Move the logic to intel_cdclk.c (Jani) - Don't remove info from i915_frequency_info (Jani) V3: - Drop locking (Jani) Cc: Jani Nikula Signed-off-by: Bhanuprakash Modem Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230413114502.1105288-1-bhanuprakash.modem@intel.com commit e13b3f65af719e79046df2b1da6599eb387752e0 Author: Ville Syrjälä Date: Tue Apr 4 20:54:31 2023 +0300 drm/i915: Use min() instead of hand rolling it Most places in the vblank code use min() to clamp scanline counters below vtotal. But we missed one in the gen3/4 pixel counter based codepath. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230404175431.23064-3-ville.syrjala@linux.intel.com Reviewed-by: Mitul Golani commit 435db526a68b6454a882eae7a3768c516d4b540e Author: Ville Syrjälä Date: Tue Apr 4 20:54:30 2023 +0300 drm/i915: Evade transcoder's vblank when doing seamless M/N changes The transcoder M/N values are double buffered on the transcoder's undelayed vblank. So when doing seamless M/N fastsets we need to evade also that. Note that currently the pipe's delayed vblank == transcoder's undelayed vblank, so this is still a nop change. But in the future when we may have to delay the pipe's vblank to create a register programming window ("window2") for the DSB. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230404175431.23064-2-ville.syrjala@linux.intel.com Reviewed-by: Mitul Golani Date: Tue Apr 4 20:54:29 2023 +0300 drm/i915: Allow arbitrary refresh rates with VRR eDP panels If the panel supports VRR it must be capable of accepting timings with arbitrary vblank length, within the valid VRR range. Use that fact to allow the user to request any refresh rate they like. We simply pick the next highest fixed mode from our list, and adjust the vblank to get the desired refresh rate in the end. Of course currently everything to do with the vrefresh is using 1Hz precision, so might not be exact. But we can improve that in the future by just upping our vrefresh precision. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230404175431.23064-1-ville.syrjala@linux.intel.com Reviewed-by: Mitul Golani commit e39c76b2160bbd005587f978d29603ef790aefcd Author: Chaitanya Kumar Borah Date: Thu Mar 30 20:31:04 2023 +0530 drm/i915/color: Fix typo for Plane CSC indexes Replace _PLANE_INPUT_CSC_RY_GY_2_* with _PLANE_CSC_RY_GY_2_* for Plane CSC Fixes: 6eba56f64d5d ("drm/i915/pxp: black pixels on pxp disabled") Cc: Signed-off-by: Chaitanya Kumar Borah Reviewed-by: Uma Shankar Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230330150104.2923519-1-chaitanya.kumar.borah@intel.com commit 76ec69272195317080c16b970d23aebdaf192883 Author: Ville Syrjälä Date: Tue Mar 28 15:23:57 2023 +0300 drm/i915: Flag purely internal commits to not clear crtc_state->inherited If we have to force the hardware to go through a full modeset due to eg. cdclk reprogramming, we need to preserve crtc_state->inherited for all crtcs that have not otherwise gone through the whole compute_config() stuff after connectors have been detected. Otherwise eg. cdclk induced modeset glk_force_audio_cdclk() will clear the inherited flag, and thus the first real commit coming from userspace later on will not be forced through the full .compute_config() path and so eg. audio state may not get properly recomputed. But instead of adding all kinds of ad-hoc crtc_state->inherited preservation hacks all over, let's change things so that we only clear it for the crtcs directly included in userspace/client initiated commits. Should be far less fragile since now we just need to remember to flag the internal commits, and not worry about where new crtcs might get pulled in. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5260 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230328122357.1697-1-ville.syrjala@linux.intel.com Reviewed-by: Luca Coelho commit 1af1d18825d3a5d36b6a3e5049998c3f09321145 Author: Ville Syrjälä Date: Mon Mar 20 22:33:52 2023 +0200 drm/i915/vrr: Allow VRR to be toggled during fastsets Now that VRR enable/disable are called from convenient places it is trivial to allow it to change state during fastsets. Make it so. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7542 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230320203352.19515-7-ville.syrjala@linux.intel.com Reviewed-by: Mitul Golani commit 99cfbed19d06dfe9c9929c436b5a768231c05b70 Author: Ville Syrjälä Date: Tue Mar 21 15:56:15 2023 +0200 drm/i915/vrr: Relocate VRR enable/disable Move VRR enabling/disabling into a place where it also works for fastsets. With this we always start the transcoder up in non-VRR mode. Granted we already did that but for a very short period of time. But now that we might end up doing a bit more with the transcoder in non-VRR mode it seems prudent to also update the active timings as the transcoder changes its operating mode. crtc_state->vrr.enable still tracks whether VRR is actually enabled or not, but now we configure all the other VRR timing registers whenever VRR is possible (whether we actually enable it or not). crtc_state->vrr.flipline can now serve as our "is VRR possible" bit of state. I decided to leave the MSA timing ignore bit set all the time whether VRR is actually enabled or not. If the sink can figure out the timings with that information when VRR is active then surely it can also do it when VRR is inactive. v2: Protect intel_vrr_set_transcoder_timings() with HAS_VRR() Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230321135615.27338-1-ville.syrjala@linux.intel.com Reviewed-by: Mitul Golani commit ecaeecea9263496ecbb287aac6545e8b3cd9257d Author: Ville Syrjälä Date: Mon Mar 20 22:33:50 2023 +0200 drm/i915/vrr: Tell intel_crtc_update_active_timings() about VRR explicitly In order to move VRR enable/disable to a place where it's also applicable to fastsets we need to be prepared to configure the pipe into non-VRR mode initially, and then later switch to VRR mode. To that end allow the active timings to be configured in non-VRR mode temporarily even when the crtc_state says we're going to be using VRR. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230320203352.19515-5-ville.syrjala@linux.intel.com Reviewed-by: Mitul Golani commit fa9e4fce52ec4ee45ddfc6747ecb2bc8856c4753 Author: Ville Syrjälä Date: Mon Mar 20 22:33:49 2023 +0200 drm/i915/vrr: Make delayed vblank operational in VRR mode on adl/dg2 On adl/dg2 a chicken bit needs to be set for TRANS_SET_CONTENXT_LATENCY to take effect in VRR mode. Can't really think of a reason why we'd ever disable that chicken bit, so let's just always set it. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230320203352.19515-4-ville.syrjala@linux.intel.com Reviewed-by: Mitul Golani commit b25e07419fee6e3be07e58cc64f50e11228987d3 Author: Ville Syrjälä Date: Mon Mar 20 22:33:48 2023 +0200 drm/i915/vrr: Eliminate redundant function arguments Some of the VRR functions take redundant arguments. Get rid of them to make life simpler. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230320203352.19515-3-ville.syrjala@linux.intel.com Reviewed-by: Mitul Golani commit 6a98560755636b07ca54bf9cea6435b8e82b57d5 Author: Ville Syrjälä Date: Mon Mar 20 22:33:47 2023 +0200 drm/i915: Generalize planes_{enabling,disabling}() I want to use the same logic that planes_{enabling,disabling}() are using for other features as well. Generlize the thing into a pair of macros. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230320203352.19515-2-ville.syrjala@linux.intel.com Reviewed-by: Mitul Golani commit 17e05aeb3b987a17b2ee5185264bec5db1d0c746 Author: Maíra Canal Date: Mon Jan 16 17:58:01 2023 -0300 drm/vkms: Use drmm_mode_config_init() Use drmm_mode_config_init() instead of drm_mode_config_init(), as it allows us to assure that the resource will be properly cleaned. Signed-off-by: Maíra Canal Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230116205800.1266227-2-mcanal@igalia.com commit 99cc528ebe923d04767e9979665a0824727376ba Author: Maíra Canal Date: Mon Jan 16 17:58:00 2023 -0300 drm/vkms: Use drmm_crtc_init_with_planes() Use drmm_crtc_init_with_planes() instead of drm_crtc_init_with_planes() to get rid of the explicit destroy hook in struct drm_crtc_funcs. Signed-off-by: Maíra Canal Reviewed-by: Javier Martinez Canillas Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230116205800.1266227-1-mcanal@igalia.com commit 1bf3836383e6957ac848ee81eb691820c862b3d6 Author: Jani Nikula Date: Tue Apr 11 16:19:22 2023 +0300 drm/i915/display: remove unnecessary i915_debugfs.h includes Leftovers from before display debugfs was separated to its own file. Signed-off-by: Jani Nikula Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230411131922.401602-1-jani.nikula@intel.com commit bfa8342c27c67e86a7b7022df06848709386e00d Author: Daniel Vetter Date: Wed Apr 12 10:09:20 2023 +0200 MAINTAINERS: add drm_bridge for drm bridge maintainers Otherwise core changes don't get noticed by the right people. I noticed this because a patch set from Jagan Teki seems to have fallen through the cracks. Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Cc: Jagan Teki Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Reviewed-by: Laurent Pinchart Reviewed-by: Andrzej Hajda Acked-by: Neil Armstrong Reviewed-by: Jagan Teki [narmstrong: fixed ordering & Daniel's SoB] Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230412080921.10171-1-daniel.vetter@ffwll.ch commit 394f811848827ad23d2b43e94e5d72a24cfbc39f Author: Mike Christie Date: Fri Apr 7 15:05:51 2023 -0500 scsi: target: Add block PR support to iblock This adds support for the block PR callouts to target_core_iblock. This patch doesn't attempt to implement the entire spec because there's no way support it all like SPEC_I_PT and ALL_TG_PT. This only supports exporting the iblock device from one path on the local target. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-19-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 8455799d2d4676b746dce3d59cbc8060a6223619 Author: Mike Christie Date: Fri Apr 7 15:05:50 2023 -0500 scsi: target: Report and detect unsupported PR commands The backend modules don't know about ports and I_T nexuses and the pr_ops callouts the modules will use don't support the old RESERVE/RELEASE commands. This patch has us report we don't support those types of commands and fail them. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-18-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit d9b3275bddd58f1e61171483c3625b5bd0841b71 Author: Mike Christie Date: Fri Apr 7 15:05:49 2023 -0500 scsi: target: Pass struct target_opcode_descriptor to enabled The iblock pr_ops support does not support commands that require port or I_T Nexus info. This adds a struct target_opcode_descriptor as an argument to the enabled callout so we can still have the common tcm_is_pr_enabled and tcm_is_scsi2_reservations_enabled functions and also determine if the command is supported based on the command and service action and device settings. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-17-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 53062ace0b6e47f17cae2db453858c8a369a2fe4 Author: Mike Christie Date: Fri Apr 7 15:05:48 2023 -0500 scsi: target: Allow backends to hook into PR handling For the cases where you want to export a device to a VM via a single I_T nexus and want to passthrough the PR handling to the physical/real device you have to use pscsi or tcmu. Both are good for specific uses however for the case where you want good performance, and are not using SCSI devices directly (using DM/MD RAID or multipath devices) then we are out of luck. The following patches allow iblock to mimimally hook into the LIO PR code and then pass the PR handling to the physical device. Note that like with the tcmu an pscsi cases it's only supported when you export the device via one I_T nexus. This patch adds the initial LIO callouts. The next patch will modify iblock. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-16-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 0217da08c1b904be49ac141442bbc1671d3630e7 Author: Mike Christie Date: Fri Apr 7 15:05:47 2023 -0500 scsi: target: Rename sbc_ops to exec_cmd_ops The next patches allow us to call the block layer's pr_ops from the backends. This will require allowing the backends to hook into the cmd processing for SPC commands, so this renames sbc_ops to a more generic exec_cmd_ops. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-15-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 28c97ba38ff9c00bc177887c2d8568b7115a44e0 Author: Mike Christie Date: Fri Apr 7 15:05:46 2023 -0500 nvme: Add pr_ops read_reservation support This patch adds support for the pr_ops read_reservation callout by calling the NVMe Reservation Report helper. It then parses that info to detect if there is a reservation and if there is then convert the returned info to a pr_ops pr_held_reservation struct. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-14-michael.christie@oracle.com Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit be1a7cd2d0ed028ffdd60c65e3734e2a1d8b17df Author: Mike Christie Date: Fri Apr 7 15:05:45 2023 -0500 nvme: Add a nvme_pr_type enum The next patch adds support to report the reservation type, so we need to be able to convert from the NVMe PR value we get from the device to the linux block layer PR value that will be returned to callers. To prepare for that, this patch adds a nvme_pr_type enum and renames the nvme_pr_type function. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-13-michael.christie@oracle.com Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 5fd96a4e15de8442915a912233d800c56f49001d Author: Mike Christie Date: Fri Apr 7 15:05:44 2023 -0500 nvme: Add pr_ops read_keys support This patch adds support for the pr_ops read_keys callout by calling the NVMe Reservation Report helper, then parsing that info to get the controller's registered keys. Because the callout is only used in the kernel where the callers, like LIO, do not know about controller/host IDs, the callout just returns the registered keys which is required by the SCSI PR in READ KEYS command. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-12-michael.christie@oracle.com Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit f0614790b77300d69a1f37265f98b68c4835811b Author: Mike Christie Date: Fri Apr 7 15:05:43 2023 -0500 nvme: Add helper to send pr command Move the code that checks for multipath support and sends the pr command to a new helper so it can be used by the reservation report support added in the next patches. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-11-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit b668f2f5467c3316b67fa04975e2fccb0baec576 Author: Mike Christie Date: Fri Apr 7 15:05:42 2023 -0500 nvme: Move pr code to it's own file This patch moves the pr code to it's own file because I'm going to be adding more functions and core.c is getting bigger. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-10-michael.christie@oracle.com Reviewed-by: Chaitanya Kulkarni Reviewed-by: Keith Busch Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit d45b446bd81822f5a0c3019f58e6c69f7ce71ce6 Author: Mike Christie Date: Fri Apr 7 15:05:41 2023 -0500 nvme: Don't hardcode the data len for pr commands Reservation Report support needs to pass in a variable sized buffer, so this patch has the pr command helpers take a data length argument. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-9-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Chaitanya Kulkarni Signed-off-by: Martin K. Petersen commit f2bf2e7e2d526116aab942aaf1b71a949a570ba6 Author: Mike Christie Date: Fri Apr 7 15:05:40 2023 -0500 nvme: Fix reservation status related structs This fixes the following issues with the reservation status structs: 1. resv10 is bytes 23:10 so it should be 14 bytes. 2. regctl_ds only supports 64 bit host IDs. These are not currently used, but will be in this patchset which adds support for the reservation report command. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-8-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 8a8da082e9e46fb8c246822145a2e4920a8d03d5 Author: Mike Christie Date: Fri Apr 7 15:05:39 2023 -0500 dm: Add support for block PR read keys/reservation This adds support in dm for the block PR read keys and read reservation callouts. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-7-michael.christie@oracle.com Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 0af7b5e2362d3b67334f20e49138d89141dc24d3 Author: Mike Christie Date: Fri Apr 7 15:05:38 2023 -0500 scsi: Add support for block PR read keys/reservation This adds support in sd.c for the block PR read keys and read reservation callouts, so upper layers like LIO can get the PR info that's been setup using the existing pr callouts and return it to initiators. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-6-michael.christie@oracle.com Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 0730b1632b7e803aad81ff19a4fda964a9d97053 Author: Mike Christie Date: Fri Apr 7 15:05:37 2023 -0500 scsi: Move sd_pr_type to scsi_common LIO is going to want to do the same block to/from SCSI pr types as sd.c so this moves the sd_pr_type helper to scsi_common and renames it. The next patch will then also add a helper to go from the SCSI value to the block one for use with PERSISTENT_RESERVE_IN commands. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-5-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Bart Van Assche Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 20bebccbc45db71b4a55c465fcc1be37d5daed0d Author: Mike Christie Date: Fri Apr 7 15:05:36 2023 -0500 scsi: Rename sd_pr_command Rename sd_pr_command to sd_pr_out_command to match a sd_pr_in_command helper added in the next patches. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-4-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Bart Van Assche Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 7ba150834b840f6f5cdd07ca69a4ccf39df59a66 Author: Mike Christie Date: Fri Apr 7 15:05:35 2023 -0500 block: Rename BLK_STS_NEXUS to BLK_STS_RESV_CONFLICT BLK_STS_NEXUS is used for NVMe/SCSI reservation conflicts and DASD's locking feature which works similar to NVMe/SCSI reservations where a host can get a lock on a device and when the lock is taken it will get failures. This patch renames BLK_STS_NEXUS so it better reflects this type of use. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-3-michael.christie@oracle.com Acked-by: Stefan Haberland Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit c787f1baa5031c22cbe20af17b2ee36ad32957ea Author: Mike Christie Date: Fri Apr 7 15:05:34 2023 -0500 block: Add PR callouts for read keys and reservation Add callouts for reading keys and reservations. This allows LIO to support the READ_KEYS and READ_RESERVATION commands so it can export devices to VMs for software like windows clustering. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230407200551.12660-2-michael.christie@oracle.com Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit b90b044c64f669cb20919fb5e5673933de59c653 Author: Nirmoy Das Date: Tue Apr 4 20:13:42 2023 +0200 drm/i915/mtl: Disable stolen memory backed FB for A0 Stolen memory is not usable for MTL A0 stepping beyond certain access size and we have no control over userspace access size of /dev/fb which can be backed by stolen memory. So disable stolen memory backed fb by setting i915->dsm.usable_size to zero. v2: remove hsdes reference and fix commit message(Andi) v3: use revid as we want to target SOC stepping(Radhakrishna) Cc: Matthew Auld Cc: Andi Shyti Cc: Daniele Ceraolo Spurio Cc: Lucas De Marchi Cc: Radhakrishna Sripada Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Reviewed-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230404181342.23362-1-nirmoy.das@intel.com commit ea68a3e9d14e9e0bf017d178fb4bd53b6deb1482 Merge: 16fc9c08f0ec7 55bf14961db9d Author: Joonas Lahtinen Date: Tue Apr 11 15:43:45 2023 +0300 Merge drm/drm-next into drm-intel-gt-next Need to pull in commit from drm-next (earlier in drm-intel-next): 1eca0778f4b3 ("drm/i915: add struct i915_dsm to wrap dsm members together") In order to merge following patch to drm-intel-gt-next: https://patchwork.freedesktop.org/patch/530942/?series=114925&rev=6 Signed-off-by: Joonas Lahtinen commit d6fff836c0e0502a569811c7708aed0762e04337 Author: Ville Syrjälä Date: Wed Mar 29 16:50:01 2023 +0300 drm/i915: Hook up csc into state checker Have the state checker validate that the csc matrices look correct when read back from the hardware. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-12-ville.syrjala@linux.intel.com Reviewed-by: Ankit Nautiyal commit 37c8cabfcc5ce2c06baf0a2d0176043b0b256e49 Author: Ville Syrjälä Date: Wed Mar 29 16:50:00 2023 +0300 drm/i915: Include the csc matrices in the crtc state dump Include the csc matrices in the state dump. The format being hardware specific we just dump as hex for now. Might have to think of some way to get a bit more human readable output... Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-11-ville.syrjala@linux.intel.com Reviewed-by: Ankit Nautiyal commit b6f4b3a1474d8bed9fad2b4d681368710375bbe9 Author: Ville Syrjälä Date: Wed Mar 29 16:49:59 2023 +0300 drm/i915: Implement chv cgm csc readout Read out the csc matrix on chv, and stash the result into the correct spot in the crtc state. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-10-ville.syrjala@linux.intel.com Reviewed-by: Ankit Nautiyal commit 01c2be8e1b97ee4891d1e1ffb7758897d441bb3c Author: Ville Syrjälä Date: Wed Mar 29 16:49:58 2023 +0300 drm/i915: Add hardware csc readout for ilk+ Read out the pipe/output csc matrices on ilk+ and stash the results (in the hardware specific format) into the appropriate place in the crtc state. Note that on skl/glk/icl the pipe csc unit suffers from an issue where *reads* of the coefficient/offset registers also disarm the double buffer update (if currently armed via CSC_MODE write). So it's rather important that the readout only happens after the csc registers have been latched. Fortunately the state checker only runs after the start of vblank where the latching happens. And on skl/glk the DMC + CSC register read has the potential to corrupt the latched CSC register values, so let's add a comment reminding us that the DC states should remain off until the readout has been completed. TODO: maybe we could somehow check to make sure PSR has in fact latched the new register values already, and that DC states have been off all along? Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-9-ville.syrjala@linux.intel.com Reviewed-by: Ankit Nautiyal commit e006df050606785aa7d04cd47f913d9c6ce4669d Author: Ville Syrjälä Date: Tue Apr 11 08:51:44 2023 +0300 drm/i915: Sprinke a few sanity check WARNS during csc assignment Make sure the csc enable bit(s) match the way we're about to fill the csc matrices. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-8-ville.syrjala@linux.intel.com Reviewed-by: Ankit Nautiyal commit e0980b8d82d1306251bcd67b693e008bb6c89512 Author: Ville Syrjälä Date: Wed Mar 29 16:49:56 2023 +0300 drm/i915: Utilize crtc_state->csc on chv Store the chv cgm csc matrix in the crtc state as well. We shall store it in the same place where we store the ilk+ pipe csc matrix (as opposed to the output csc matrix). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-7-ville.syrjala@linux.intel.com Reviewed-by: Ankit Nautiyal commit 68f5f78d0fe08f277a3aea9ad28508a7f243de6a Author: Ville Syrjälä Date: Wed Mar 29 16:49:55 2023 +0300 drm/i915: Store ilk+ csc matrices in the crtc state Embed a pair of intel_csc_matrix structs in the crtc state, and fill them out appropriately during atomic_check(). Since pre-ivb platforms don't have programmable post offsets we shall leave those zeroed, mainly in preparation for state readout+check. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-6-ville.syrjala@linux.intel.com Reviewed-by: Ankit Nautiyal commit 1dcd7aac31842028beb5fa2531fd54ce0d588b17 Author: Ville Syrjälä Date: Wed Mar 29 16:49:54 2023 +0300 drm/i915: Start using struct intel_csc_matrix for chv cgm csc Convert chv_cgm_csc_convert_ctm() over to using the new intel_csc_matrix structure. No pre/post offsets on this hardware so only the coefficients get filled out. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-5-ville.syrjala@linux.intel.com Reviewed-by: Ankit Nautiyal commit ec280042094c3f700d7321e7163591c6eac72274 Author: Ville Syrjälä Date: Wed Mar 29 16:49:53 2023 +0300 drm/i915: Split chv_load_cgm_csc() into pieces Split chv_cgm_csc_convert_ctm() out from chv_load_cgm_csc() so that we have functions with clear jobs. This is also how the ilk+ code is already structured. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-4-ville.syrjala@linux.intel.com Reviewed-by: Ankit Nautiyal commit 57b5482bff9e4f60069a8c0de91bb397612ce059 Author: Ville Syrjälä Date: Wed Mar 29 16:49:52 2023 +0300 drm/i915: Introduce intel_csc_matrix struct Introduce a structure that can hold our CSC matrices. In there we shall have the preoffsets, postoffsets, and coefficients, all in platform specific format (at least for now). We shall start by converting the ilk+ code to make use of the new structure. chv will come later. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-3-ville.syrjala@linux.intel.com Reviewed-by: Ankit Nautiyal commit 404c3acda4b65924c05bc63242e94f954f84c165 Author: Ville Syrjälä Date: Wed Mar 29 16:49:51 2023 +0300 drm/i915: Fix limited range csc matrix Our current limited range matrix is a bit off. I think it was originally calculated with rounding, as if we wanted the normal pixel replication type of behaviour. That is, since the 8bpc max value is 0xeb we assumed the 16bpc max value should be 0xebeb, but what the HDMI spec actually says it should be is 0xeb00. So to get what we want we make the formula out = in * (235-16) << (12-8) / in_max + 16 << (12-8), with 12 being precision of the csc, 8 being the precision of the constants we used. The hardware takes its coefficients as floating point values, but the (235−16)/255 = ~.86, so exponent 0 is what we want anyway, so it works out perfectly without having to hardcode it in hex or start playing with floats. In terms of raw numbers we are feeding the hardware the post offset changes from 0x101 to 0x100, and the coefficient changes from 0xdc0 to 0xdb0 (~.860->~.855). So this should make everything come out just a tad darker. I already used better constants in lut_limited_range() earlier so the output of the two paths should be closer now. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-2-ville.syrjala@linux.intel.com Reviewed-by: Ankit Nautiyal commit 16fc9c08f0ec7b1c95f1ea4a16097acdb3fc943d Author: Lionel Landwerlin Date: Fri Apr 7 12:32:37 2023 +0300 drm/i915: disable sampler indirect state in bindless heap By default the indirect state sampler data (border colors) are stored in the same heap as the SAMPLER_STATE structure. For userspace drivers that can be 2 different heaps (dynamic state heap & bindless sampler state heap). This means that border colors have to copied in 2 different places so that the same SAMPLER_STATE structure find the right data. This change is forcing the indirect state sampler data to only be in the dynamic state pool (more convenient for userspace drivers, they only have to have one copy of the border colors). This is reproducing the behavior of the Windows drivers. BSpec: 46052 Signed-off-by: Lionel Landwerlin Cc: stable@vger.kernel.org Reviewed-by: Haridhar Kalvala Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230407093237.3296286-1-lionel.g.landwerlin@intel.com commit e24e6d695377ca70008ffc39695c3975b3e177b6 Author: Nirmoy Das Date: Tue Apr 4 16:31:00 2023 +0200 drm/i915/display: Implement fb_mmap callback function If stolen memory allocation fails for fbdev, the driver will fallback to system memory. Calculation of smem_start is wrong for such framebuffer objs if the platform comes with no gmadr or no aperture. Solve this by adding fb_mmap callback which will use GTT if aperture is available otherwise will use cpu to access the framebuffer. v2: Use to_intel_fbdev() function(Jani) Cc: Matthew Auld Cc: Andi Shyti Cc: Ville Syrjälä Cc: Jani Nikula Cc: Imre Deak Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230404143100.10452-5-nirmoy.das@intel.com commit 63b685efaa4d6b9db388857a2e6f5f5f11454f8d Author: Nirmoy Das Date: Tue Apr 4 16:30:59 2023 +0200 drm/i915/display: Add helper func to get intel_fbdev from drm_fb_helper Add a helper function to retrieve struct intel_fbdev from struct drm_fb_helper. Cc: Matthew Auld Cc: Andi Shyti Cc: Ville Syrjälä Cc: Jani Nikula Cc: Imre Deak Signed-off-by: Nirmoy Das Reviewed-by: Jani Nikula Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230404143100.10452-4-nirmoy.das@intel.com commit eaee1c08586395182e0004b3512a2f83570ea461 Author: Nirmoy Das Date: Tue Apr 4 16:30:58 2023 +0200 drm/i915: Add a function to mmap framebuffer obj Implement i915_gem_fb_mmap() to enable fb_ops.fb_mmap() callback for i915's framebuffer objects. v2: add a comment why i915_gem_object_get() needed(Andi). v3: mmap also ttm objects. Cc: Matthew Auld Cc: Andi Shyti Cc: Ville Syrjälä Cc: Jani Nikula Cc: Imre Deak Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230404143100.10452-3-nirmoy.das@intel.com commit ddb78a51fac65e8db2316ded59e27ab621aea856 Author: Nirmoy Das Date: Tue Apr 4 16:30:57 2023 +0200 drm/i915/display: Set I915_BO_ALLOC_USER for fb Framebuffer is exposed to userspace so make sure we set proper flags for it. Set I915_BO_PREALLOC for prealloced fb so that ttm won't clear existing data. Cc: Matthew Auld Cc: Andi Shyti Cc: Andrzej Hajda Cc: Ville Syrjälä Cc: Jani Nikula Cc: Imre Deak Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230404143100.10452-2-nirmoy.das@intel.com commit ddb24fc525ddaf35130d96478f3f18682a9d5926 Author: Nirmoy Das Date: Tue Apr 4 16:30:56 2023 +0200 drm/i915/ttm: Add I915_BO_PREALLOC Add a mechanism to preserve existing data when creating a TTM object with the I915_BO_ALLOC_USER flag. This will be used in the subsequent patch where the I915_BO_ALLOC_USER flag will be applied to the framebuffer object. For a pre-allocated framebuffer without the I915_BO_PREALLOC flag. TTM would clear the content, which is not desirable. Cc: Matthew Auld Cc: Andi Shyti Cc: Andrzej Hajda Cc: Ville Syrjälä Cc: Jani Nikula Cc: Imre Deak Signed-off-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230404143100.10452-1-nirmoy.das@intel.com commit 1af3de62f03f651c5e50c0e00f8fed34d07b9df3 Author: Miquel Raynal Date: Fri Mar 24 12:05:58 2023 +0100 ieee802154: ca8210: Flag the driver as being limited This is a hardMAC device wired to Linux 802154 softMAC implementation. It is a bit limited in the sense that it cannot handle anything else that datagrams. Let's flag it like this to prevent using unsupported features such as scan/beacons handling. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20230324110558.90707-3-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 822452fb6c696bb2331649ce6fbb49e49261cc71 Author: Miquel Raynal Date: Fri Mar 24 12:05:57 2023 +0100 net: ieee802154: Handle limited devices with only datagram support Some devices, like HardMAC ones can be a bit limited in the way they handle mac commands. In particular, they might just not support it at all and instead only be able to transmit and receive regular data packets. In this case, they cannot be used for any of the internal management commands that we have introduced so far and must be flagged accordingly. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20230324110558.90707-2-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit d021d218f6d924ff5417c64b2e41d184e4bb32d3 Author: Miquel Raynal Date: Fri Mar 10 15:53:46 2023 +0100 mac802154: Handle received BEACON_REQ When performing an active scan, devices emit BEACON_REQ which must be answered by other PANs receiving the request, unless they are already passively sending beacons. Answering a beacon request becomes a duty when the user tells us to send beacons and the request provides an interval of 15. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20230310145346.1397068-5-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 26f88e4ebd4fbe96fb4326408e2af05644716d76 Author: Miquel Raynal Date: Fri Mar 10 15:53:45 2023 +0100 ieee802154: Add support for allowing to answer BEACON_REQ Accept beaconing configurations from the user which involve answering beacon requests rather than only passively sending beacons. This may help devices to find the PAN more quickly. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20230310145346.1397068-4-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit e2c3e6f53a7a8a00ffeed127cfd1b397c3b016f8 Author: Miquel Raynal Date: Fri Mar 10 15:53:44 2023 +0100 mac802154: Handle active scanning Active scan support is based on the current passive scan support, cheered up with beacon requests sent after every channel change. Co-developed-by: David Girault Signed-off-by: David Girault Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20230310145346.1397068-3-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit b8866426411c34489b0265bf720b4d917c8d4795 Author: Miquel Raynal Date: Fri Mar 10 15:53:43 2023 +0100 ieee802154: Add support for user active scan requests In case a passive scan could not discover any PAN, a device may decide to perform an active scan to force coordinators to send a BEACON "immediately". Allow users to request to perform an active scan. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20230310145346.1397068-2-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 76862af5d1add618f0cc99868bc729925f9551d2 Author: Randy Dunlap Date: Mon Jan 2 12:45:12 2023 -0800 apparmor: fix kernel-doc complaints Correct kernel-doc notation to placate kernel-doc W=1 warnings: security/apparmor/policy.c:439: warning: duplicate section name 'Return' security/apparmor/secid.c:57: warning: Cannot understand * security/apparmor/file.c:174: warning: cannot understand function prototype: 'struct aa_perms default_perms = ' Signed-off-by: Randy Dunlap Cc: John Johansen Cc: John Johansen Cc: apparmor@lists.ubuntu.com Cc: Paul Moore Cc: James Morris Cc: "Serge E. Hallyn" Signed-off-by: John Johansen